var BrowserFS=(()=>{var Zi=Object.defineProperty,nd=Object.defineProperties,od=Object.getOwnPropertyDescriptor,ad=Object.getOwnPropertyDescriptors,sd=Object.getOwnPropertyNames,yu=Object.getOwnPropertySymbols,ud=Object.getPrototypeOf,wu=Object.prototype.hasOwnProperty,cd=Object.prototype.propertyIsEnumerable,ld=Reflect.get;var Re=Math.pow,bu=(r,t,e)=>t in r?Zi(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Xe=(r,t)=>{for(var e in t||(t={}))wu.call(t,e)&&bu(r,e,t[e]);if(yu)for(var e of yu(t))cd.call(t,e)&&bu(r,e,t[e]);return r},rt=(r,t)=>nd(r,ad(t)),u=(r,t)=>Zi(r,"name",{value:t,configurable:!0});var Wi=(r,t)=>{for(var e in t)Zi(r,e,{get:t[e],enumerable:!0})},fd=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of sd(t))!wu.call(r,n)&&n!==e&&Zi(r,n,{get:()=>t[n],enumerable:!(i=od(t,n))||i.enumerable});return r};var hd=r=>fd(Zi({},"__esModule",{value:!0}),r);var _u=(r,t,e)=>ld(ud(r),e,t);var C=(r,t,e)=>new Promise((i,n)=>{var o=m=>{try{l(e.next(m))}catch(y){n(y)}},a=m=>{try{l(e.throw(m))}catch(y){n(y)}},l=m=>m.done?i(m.value):Promise.resolve(m.value).then(o,a);l((e=e.apply(r,t)).next())}),vu=(r,t,e)=>(t=r[Symbol.asyncIterator],e=(i,n)=>(n=r[i])&&(t[i]=o=>new Promise((a,l,m)=>(o=n.call(r,o),m=o.done,Promise.resolve(o.value).then(y=>a({value:y,done:m}),l)))),t?t.call(r):(r=r[Symbol.iterator](),t={},e("next"),e("return"),t));var qy={};Wi(qy,{ActionType:()=>ri,ApiError:()=>T,AsyncKeyValueFile:()=>Ii,AsyncKeyValueFileSystem:()=>Ti,AsyncMirror:()=>Sr,BaseFile:()=>$r,BaseFileSystem:()=>gt,Cred:()=>Ye,Dropbox:()=>xr,Emscripten:()=>Ir,EmscriptenFS:()=>Ai,ErrorCode:()=>tt,ErrorStrings:()=>mt,FileFlag:()=>We,FileSystem:()=>Zr,FileSystemAccess:()=>Tr,FileType:()=>je,FolderAdapter:()=>rr,HTTPRequest:()=>dr,InMemory:()=>Kt,IndexedDB:()=>ur,IsoFS:()=>Mr,OverlayFS:()=>lr,SimpleSyncRWTransaction:()=>Wr,Stats:()=>Me,Storage:()=>cr,SyncKeyValueFile:()=>xi,SyncKeyValueFileSystem:()=>Hr,SynchronousFileSystem:()=>kt,WorkerFS:()=>Rr,XMLHTTPRequest:()=>dr,ZipFS:()=>Qt,backends:()=>ha,configure:()=>Wy,default:()=>Hy,fs:()=>to,getFileSystem:()=>id,initialize:()=>rd,registerBackend:()=>Zy});var Oe={};Wi(Oe,{_debugEnd:()=>uc,_debugProcess:()=>sc,_events:()=>Fc,_eventsCount:()=>xc,_exiting:()=>$u,_fatalExceptions:()=>ic,_getActiveHandles:()=>qu,_getActiveRequests:()=>Hu,_kill:()=>Ku,_linkedBinding:()=>ju,_maxListeners:()=>Sc,_preload_modules:()=>_c,_rawDebug:()=>Uu,_startProfilerIdleNotifier:()=>cc,_stopProfilerIdleNotifier:()=>lc,_tickCallback:()=>ac,abort:()=>pc,addListener:()=>Ic,allowedNodeEnvironmentFlags:()=>ec,arch:()=>Iu,argv:()=>Ru,argv0:()=>wc,assert:()=>tc,binding:()=>Nu,chdir:()=>Lu,config:()=>Zu,cpuUsage:()=>Un,cwd:()=>Pn,debugPort:()=>bc,default:()=>Dc,dlopen:()=>Wu,domain:()=>zu,emit:()=>Bc,emitWarning:()=>Cu,env:()=>Au,execArgv:()=>Ou,execPath:()=>yc,exit:()=>Ju,features:()=>rc,hasUncaughtExceptionCaptureCallback:()=>oc,hrtime:()=>Ln,kill:()=>Xu,listeners:()=>Nc,memoryUsage:()=>Yu,moduleLoadList:()=>Mu,nextTick:()=>Su,off:()=>Ac,on:()=>vr,once:()=>Tc,openStdin:()=>Qu,pid:()=>mc,platform:()=>Tu,ppid:()=>gc,prependListener:()=>kc,prependOnceListener:()=>Cc,reallyExit:()=>Vu,release:()=>Pu,removeAllListeners:()=>Oc,removeListener:()=>Rc,resourceUsage:()=>Gu,setSourceMapsEnabled:()=>vc,setUncaughtExceptionCaptureCallback:()=>nc,stderr:()=>hc,stdin:()=>dc,stdout:()=>fc,title:()=>xu,umask:()=>Du,uptime:()=>Ec,version:()=>Bu,versions:()=>ku});function ma(r){throw new Error("Node.js process "+r+" is not supported by JSPM core outside of Node.js")}u(ma,"unimplemented");var _r=[],vi=!1,Yr,Dn=-1;function dd(){!vi||!Yr||(vi=!1,Yr.length?_r=Yr.concat(_r):Dn=-1,_r.length&&Eu())}u(dd,"cleanUpNextTick");function Eu(){if(!vi){var r=setTimeout(dd,0);vi=!0;for(var t=_r.length;t;){for(Yr=_r,_r=[];++Dn1)for(var e=1;eDate.now()-da);var da;function Ec(){return jr.now()/1e3}u(Ec,"uptime");var pa=1e9;function Ln(r){var t=Math.floor((Date.now()-jr.now())*.001),e=jr.now()*.001,i=Math.floor(e)+t,n=Math.floor(e%1*1e9);return r&&(i=i-r[0],n=n-r[1],n<0&&(i--,n+=pa)),[i,n]}u(Ln,"hrtime");Ln.bigint=function(r){var t=Ln(r);return typeof BigInt=="undefined"?t[0]*pa+t[1]:BigInt(t[0]*pa)+BigInt(t[1])};var Sc=10,Fc={},xc=0;function vr(){return Dc}u(vr,"on");var Ic=vr,Tc=vr,Ac=vr,Rc=vr,Oc=vr,Bc=It,kc=vr,Cc=vr;function Nc(r){return[]}u(Nc,"listeners");var Dc={version:Bu,versions:ku,arch:Iu,platform:Tu,release:Pu,_rawDebug:Uu,moduleLoadList:Mu,binding:Nu,_linkedBinding:ju,_events:Fc,_eventsCount:xc,_maxListeners:Sc,on:vr,addListener:Ic,once:Tc,off:Ac,removeListener:Rc,removeAllListeners:Oc,emit:Bc,prependListener:kc,prependOnceListener:Cc,listeners:Nc,domain:zu,_exiting:$u,config:Zu,dlopen:Wu,uptime:Ec,_getActiveRequests:Hu,_getActiveHandles:qu,reallyExit:Vu,_kill:Ku,cpuUsage:Un,resourceUsage:Gu,memoryUsage:Yu,kill:Xu,exit:Ju,openStdin:Qu,allowedNodeEnvironmentFlags:ec,assert:tc,features:rc,_fatalExceptions:ic,setUncaughtExceptionCaptureCallback:nc,hasUncaughtExceptionCaptureCallback:oc,emitWarning:Cu,nextTick:Su,_tickCallback:ac,_debugProcess:sc,_debugEnd:uc,_startProfilerIdleNotifier:cc,_stopProfilerIdleNotifier:lc,stdout:fc,stdin:dc,stderr:hc,abort:pc,umask:Du,chdir:Lu,cwd:Pn,env:Au,title:xu,argv:Ru,execArgv:Ou,pid:mc,ppid:gc,execPath:yc,debugPort:bc,hrtime:Ln,argv0:wc,_preload_modules:_c,setSourceMapsEnabled:vc};var Hi={},Lc=!1;function pd(){if(Lc)return Hi;Lc=!0,Hi.byteLength=l,Hi.toByteArray=y,Hi.fromByteArray=v;for(var r=[],t=[],e=typeof Uint8Array!="undefined"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n0)throw new Error("Invalid string. Length must be a multiple of 4");var A=S.indexOf("=");A===-1&&(A=E);var O=A===E?0:4-A%4;return[A,O]}u(a,"getLens");function l(S){var E=a(S),A=E[0],O=E[1];return(A+O)*3/4-O}u(l,"byteLength");function m(S,E,A){return(E+A)*3/4-A}u(m,"_byteLength");function y(S){var E,A=a(S),O=A[0],U=A[1],j=new e(m(S,O,U)),W=0,se=U>0?O-4:O,Y;for(Y=0;Y>16&255,j[W++]=E>>8&255,j[W++]=E&255;return U===2&&(E=t[S.charCodeAt(Y)]<<2|t[S.charCodeAt(Y+1)]>>4,j[W++]=E&255),U===1&&(E=t[S.charCodeAt(Y)]<<10|t[S.charCodeAt(Y+1)]<<4|t[S.charCodeAt(Y+2)]>>2,j[W++]=E>>8&255,j[W++]=E&255),j}u(y,"toByteArray");function g(S){return r[S>>18&63]+r[S>>12&63]+r[S>>6&63]+r[S&63]}u(g,"tripletToBase64");function w(S,E,A){for(var O,U=[],j=E;jse?se:W+j));return O===1?(E=S[A-1],U.push(r[E>>2]+r[E<<4&63]+"==")):O===2&&(E=(S[A-2]<<8)+S[A-1],U.push(r[E>>10]+r[E>>4&63]+r[E<<2&63]+"=")),U.join("")}return u(v,"fromByteArray"),Hi}u(pd,"dew$2");var Mn={},Pc=!1;function md(){if(Pc)return Mn;Pc=!0;return Mn.read=function(r,t,e,i,n){var o,a,l=n*8-i-1,m=(1<>1,g=-7,w=e?n-1:0,v=e?-1:1,S=r[t+w];for(w+=v,o=S&(1<<-g)-1,S>>=-g,g+=l;g>0;o=o*256+r[t+w],w+=v,g-=8);for(a=o&(1<<-g)-1,o>>=-g,g+=i;g>0;a=a*256+r[t+w],w+=v,g-=8);if(o===0)o=1-y;else{if(o===m)return a?NaN:(S?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-y}return(S?-1:1)*a*Math.pow(2,o-i)},Mn.write=function(r,t,e,i,n,o){var a,l,m,y=o*8-n-1,g=(1<>1,v=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=i?0:o-1,E=i?1:-1,A=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=g):(a=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-a))<1&&(a--,m*=2),a+w>=1?t+=v/m:t+=v*Math.pow(2,1-w),t*m>=2&&(a++,m/=2),a+w>=g?(l=0,a=g):a+w>=1?(l=(t*m-1)*Math.pow(2,n),a=a+w):(l=t*Math.pow(2,w-1)*Math.pow(2,n),a=0));n>=8;r[e+S]=l&255,S+=E,l/=256,n-=8);for(a=a<0;r[e+S]=a&255,S+=E,a/=256,y-=8);r[e+S-E]|=A*128},Mn}u(md,"dew$1");var Xr={},Uc=!1;function gd(){if(Uc)return Xr;Uc=!0;let r=pd(),t=md(),e=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Xr.Buffer=a,Xr.SlowBuffer=U,Xr.INSPECT_MAX_BYTES=50;let i=2147483647;Xr.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=n(),!a.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function n(){try{let f=new Uint8Array(1),s={foo:function(){return 42}};return Object.setPrototypeOf(s,Uint8Array.prototype),Object.setPrototypeOf(f,s),f.foo()===42}catch(f){return!1}}u(n,"typedArraySupport"),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(f){if(f>i)throw new RangeError('The value "'+f+'" is invalid for option "size"');let s=new Uint8Array(f);return Object.setPrototypeOf(s,a.prototype),s}u(o,"createBuffer");function a(f,s,c){if(typeof f=="number"){if(typeof s=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(f)}return l(f,s,c)}u(a,"Buffer"),a.poolSize=8192;function l(f,s,c){if(typeof f=="string")return w(f,s);if(ArrayBuffer.isView(f))return S(f);if(f==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if(He(f,ArrayBuffer)||f&&He(f.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(He(f,SharedArrayBuffer)||f&&He(f.buffer,SharedArrayBuffer)))return E(f,s,c);if(typeof f=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let p=f.valueOf&&f.valueOf();if(p!=null&&p!==f)return a.from(p,s,c);let _=A(f);if(_)return _;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof f[Symbol.toPrimitive]=="function")return a.from(f[Symbol.toPrimitive]("string"),s,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}u(l,"from"),a.from=function(f,s,c){return l(f,s,c)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function m(f){if(typeof f!="number")throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}u(m,"assertSize");function y(f,s,c){return m(f),f<=0?o(f):s!==void 0?typeof c=="string"?o(f).fill(s,c):o(f).fill(s):o(f)}u(y,"alloc"),a.alloc=function(f,s,c){return y(f,s,c)};function g(f){return m(f),o(f<0?0:O(f)|0)}u(g,"allocUnsafe"),a.allocUnsafe=function(f){return g(f)},a.allocUnsafeSlow=function(f){return g(f)};function w(f,s){if((typeof s!="string"||s==="")&&(s="utf8"),!a.isEncoding(s))throw new TypeError("Unknown encoding: "+s);let c=j(f,s)|0,p=o(c),_=p.write(f,s);return _!==c&&(p=p.slice(0,_)),p}u(w,"fromString");function v(f){let s=f.length<0?0:O(f.length)|0,c=o(s);for(let p=0;p=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return f|0}u(O,"checked");function U(f){return+f!=f&&(f=0),a.alloc(+f)}u(U,"SlowBuffer"),a.isBuffer=u(function(s){return s!=null&&s._isBuffer===!0&&s!==a.prototype},"isBuffer"),a.compare=u(function(s,c){if(He(s,Uint8Array)&&(s=a.from(s,s.offset,s.byteLength)),He(c,Uint8Array)&&(c=a.from(c,c.offset,c.byteLength)),!a.isBuffer(s)||!a.isBuffer(c))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(s===c)return 0;let p=s.length,_=c.length;for(let d=0,x=Math.min(p,_);d_.length?(a.isBuffer(x)||(x=a.from(x)),x.copy(_,d)):Uint8Array.prototype.set.call(_,x,d);else if(a.isBuffer(x))x.copy(_,d);else throw new TypeError('"list" argument must be an Array of Buffers');d+=x.length}return _},"concat");function j(f,s){if(a.isBuffer(f))return f.length;if(ArrayBuffer.isView(f)||He(f,ArrayBuffer))return f.byteLength;if(typeof f!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);let c=f.length,p=arguments.length>2&&arguments[2]===!0;if(!p&&c===0)return 0;let _=!1;for(;;)switch(s){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return Pe(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c*2;case"hex":return c>>>1;case"base64":return et(f).length;default:if(_)return p?-1:Pe(f).length;s=(""+s).toLowerCase(),_=!0}}u(j,"byteLength"),a.byteLength=j;function W(f,s,c){let p=!1;if((s===void 0||s<0)&&(s=0),s>this.length||((c===void 0||c>this.length)&&(c=this.length),c<=0)||(c>>>=0,s>>>=0,c<=s))return"";for(f||(f="utf8");;)switch(f){case"hex":return D(this,s,c);case"utf8":case"utf-8":return $(this,s,c);case"ascii":return pe(this,s,c);case"latin1":case"binary":return P(this,s,c);case"base64":return B(this,s,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,s,c);default:if(p)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),p=!0}}u(W,"slowToString"),a.prototype._isBuffer=!0;function se(f,s,c){let p=f[s];f[s]=f[c],f[c]=p}u(se,"swap"),a.prototype.swap16=u(function(){let s=this.length;if(s%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let c=0;cc&&(s+=" ... "),""},"inspect"),e&&(a.prototype[e]=a.prototype.inspect),a.prototype.compare=u(function(s,c,p,_,d){if(He(s,Uint8Array)&&(s=a.from(s,s.offset,s.byteLength)),!a.isBuffer(s))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof s);if(c===void 0&&(c=0),p===void 0&&(p=s?s.length:0),_===void 0&&(_=0),d===void 0&&(d=this.length),c<0||p>s.length||_<0||d>this.length)throw new RangeError("out of range index");if(_>=d&&c>=p)return 0;if(_>=d)return-1;if(c>=p)return 1;if(c>>>=0,p>>>=0,_>>>=0,d>>>=0,this===s)return 0;let x=d-_,Z=p-c,oe=Math.min(x,Z),k=this.slice(_,d),z=s.slice(c,p);for(let b=0;b2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,ot(c)&&(c=_?0:f.length-1),c<0&&(c=f.length+c),c>=f.length){if(_)return-1;c=f.length-1}else if(c<0)if(_)c=0;else return-1;if(typeof s=="string"&&(s=a.from(s,p)),a.isBuffer(s))return s.length===0?-1:he(f,s,c,p,_);if(typeof s=="number")return s=s&255,typeof Uint8Array.prototype.indexOf=="function"?_?Uint8Array.prototype.indexOf.call(f,s,c):Uint8Array.prototype.lastIndexOf.call(f,s,c):he(f,[s],c,p,_);throw new TypeError("val must be string, number or Buffer")}u(Y,"bidirectionalIndexOf");function he(f,s,c,p,_){let d=1,x=f.length,Z=s.length;if(p!==void 0&&(p=String(p).toLowerCase(),p==="ucs2"||p==="ucs-2"||p==="utf16le"||p==="utf-16le")){if(f.length<2||s.length<2)return-1;d=2,x/=2,Z/=2,c/=2}function oe(z,b){return d===1?z[b]:z.readUInt16BE(b*d)}u(oe,"read");let k;if(_){let z=-1;for(k=c;kx&&(c=x-Z),k=c;k>=0;k--){let z=!0;for(let b=0;b_&&(p=_)):p=_;let d=s.length;p>d/2&&(p=d/2);let x;for(x=0;x>>0,isFinite(p)?(p=p>>>0,_===void 0&&(_="utf8")):(_=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let d=this.length-c;if((p===void 0||p>d)&&(p=d),s.length>0&&(p<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");_||(_="utf8");let x=!1;for(;;)switch(_){case"hex":return q(this,s,c,p);case"utf8":case"utf-8":return ee(this,s,c,p);case"ascii":case"latin1":case"binary":return J(this,s,c,p);case"base64":return te(this,s,c,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,s,c,p);default:if(x)throw new TypeError("Unknown encoding: "+_);_=(""+_).toLowerCase(),x=!0}},"write"),a.prototype.toJSON=u(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function B(f,s,c){return s===0&&c===f.length?r.fromByteArray(f):r.fromByteArray(f.slice(s,c))}u(B,"base64Slice");function $(f,s,c){c=Math.min(f.length,c);let p=[],_=s;for(;_239?4:d>223?3:d>191?2:1;if(_+Z<=c){let oe,k,z,b;switch(Z){case 1:d<128&&(x=d);break;case 2:oe=f[_+1],(oe&192)===128&&(b=(d&31)<<6|oe&63,b>127&&(x=b));break;case 3:oe=f[_+1],k=f[_+2],(oe&192)===128&&(k&192)===128&&(b=(d&15)<<12|(oe&63)<<6|k&63,b>2047&&(b<55296||b>57343)&&(x=b));break;case 4:oe=f[_+1],k=f[_+2],z=f[_+3],(oe&192)===128&&(k&192)===128&&(z&192)===128&&(b=(d&15)<<18|(oe&63)<<12|(k&63)<<6|z&63,b>65535&&b<1114112&&(x=b))}}x===null?(x=65533,Z=1):x>65535&&(x-=65536,p.push(x>>>10&1023|55296),x=56320|x&1023),p.push(x),_+=Z}return _e(p)}u($,"utf8Slice");let ne=4096;function _e(f){let s=f.length;if(s<=ne)return String.fromCharCode.apply(String,f);let c="",p=0;for(;pp)&&(c=p);let _="";for(let d=s;dp&&(s=p),c<0?(c+=p,c<0&&(c=0)):c>p&&(c=p),cc)throw new RangeError("Trying to access beyond buffer length")}u(V,"checkOffset"),a.prototype.readUintLE=a.prototype.readUIntLE=u(function(s,c,p){s=s>>>0,c=c>>>0,p||V(s,c,this.length);let _=this[s],d=1,x=0;for(;++x>>0,c=c>>>0,p||V(s,c,this.length);let _=this[s+--c],d=1;for(;c>0&&(d*=256);)_+=this[s+--c]*d;return _},"readUIntBE"),a.prototype.readUint8=a.prototype.readUInt8=u(function(s,c){return s=s>>>0,c||V(s,1,this.length),this[s]},"readUInt8"),a.prototype.readUint16LE=a.prototype.readUInt16LE=u(function(s,c){return s=s>>>0,c||V(s,2,this.length),this[s]|this[s+1]<<8},"readUInt16LE"),a.prototype.readUint16BE=a.prototype.readUInt16BE=u(function(s,c){return s=s>>>0,c||V(s,2,this.length),this[s]<<8|this[s+1]},"readUInt16BE"),a.prototype.readUint32LE=a.prototype.readUInt32LE=u(function(s,c){return s=s>>>0,c||V(s,4,this.length),(this[s]|this[s+1]<<8|this[s+2]<<16)+this[s+3]*16777216},"readUInt32LE"),a.prototype.readUint32BE=a.prototype.readUInt32BE=u(function(s,c){return s=s>>>0,c||V(s,4,this.length),this[s]*16777216+(this[s+1]<<16|this[s+2]<<8|this[s+3])},"readUInt32BE"),a.prototype.readBigUInt64LE=Ke(u(function(s){s=s>>>0,I(s,"offset");let c=this[s],p=this[s+7];(c===void 0||p===void 0)&&R(s,this.length-8);let _=c+this[++s]*Re(2,8)+this[++s]*Re(2,16)+this[++s]*Re(2,24),d=this[++s]+this[++s]*Re(2,8)+this[++s]*Re(2,16)+p*Re(2,24);return BigInt(_)+(BigInt(d)<>>0,I(s,"offset");let c=this[s],p=this[s+7];(c===void 0||p===void 0)&&R(s,this.length-8);let _=c*Re(2,24)+this[++s]*Re(2,16)+this[++s]*Re(2,8)+this[++s],d=this[++s]*Re(2,24)+this[++s]*Re(2,16)+this[++s]*Re(2,8)+p;return(BigInt(_)<>>0,c=c>>>0,p||V(s,c,this.length);let _=this[s],d=1,x=0;for(;++x=d&&(_-=Math.pow(2,8*c)),_},"readIntLE"),a.prototype.readIntBE=u(function(s,c,p){s=s>>>0,c=c>>>0,p||V(s,c,this.length);let _=c,d=1,x=this[s+--_];for(;_>0&&(d*=256);)x+=this[s+--_]*d;return d*=128,x>=d&&(x-=Math.pow(2,8*c)),x},"readIntBE"),a.prototype.readInt8=u(function(s,c){return s=s>>>0,c||V(s,1,this.length),this[s]&128?(255-this[s]+1)*-1:this[s]},"readInt8"),a.prototype.readInt16LE=u(function(s,c){s=s>>>0,c||V(s,2,this.length);let p=this[s]|this[s+1]<<8;return p&32768?p|4294901760:p},"readInt16LE"),a.prototype.readInt16BE=u(function(s,c){s=s>>>0,c||V(s,2,this.length);let p=this[s+1]|this[s]<<8;return p&32768?p|4294901760:p},"readInt16BE"),a.prototype.readInt32LE=u(function(s,c){return s=s>>>0,c||V(s,4,this.length),this[s]|this[s+1]<<8|this[s+2]<<16|this[s+3]<<24},"readInt32LE"),a.prototype.readInt32BE=u(function(s,c){return s=s>>>0,c||V(s,4,this.length),this[s]<<24|this[s+1]<<16|this[s+2]<<8|this[s+3]},"readInt32BE"),a.prototype.readBigInt64LE=Ke(u(function(s){s=s>>>0,I(s,"offset");let c=this[s],p=this[s+7];(c===void 0||p===void 0)&&R(s,this.length-8);let _=this[s+4]+this[s+5]*Re(2,8)+this[s+6]*Re(2,16)+(p<<24);return(BigInt(_)<>>0,I(s,"offset");let c=this[s],p=this[s+7];(c===void 0||p===void 0)&&R(s,this.length-8);let _=(c<<24)+this[++s]*Re(2,16)+this[++s]*Re(2,8)+this[++s];return(BigInt(_)<>>0,c||V(s,4,this.length),t.read(this,s,!0,23,4)},"readFloatLE"),a.prototype.readFloatBE=u(function(s,c){return s=s>>>0,c||V(s,4,this.length),t.read(this,s,!1,23,4)},"readFloatBE"),a.prototype.readDoubleLE=u(function(s,c){return s=s>>>0,c||V(s,8,this.length),t.read(this,s,!0,52,8)},"readDoubleLE"),a.prototype.readDoubleBE=u(function(s,c){return s=s>>>0,c||V(s,8,this.length),t.read(this,s,!1,52,8)},"readDoubleBE");function ie(f,s,c,p,_,d){if(!a.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(s>_||sf.length)throw new RangeError("Index out of range")}u(ie,"checkInt"),a.prototype.writeUintLE=a.prototype.writeUIntLE=u(function(s,c,p,_){if(s=+s,c=c>>>0,p=p>>>0,!_){let Z=Math.pow(2,8*p)-1;ie(this,s,c,p,Z,0)}let d=1,x=0;for(this[c]=s&255;++x>>0,p=p>>>0,!_){let Z=Math.pow(2,8*p)-1;ie(this,s,c,p,Z,0)}let d=p-1,x=1;for(this[c+d]=s&255;--d>=0&&(x*=256);)this[c+d]=s/x&255;return c+p},"writeUIntBE"),a.prototype.writeUint8=a.prototype.writeUInt8=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,1,255,0),this[c]=s&255,c+1},"writeUInt8"),a.prototype.writeUint16LE=a.prototype.writeUInt16LE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,2,65535,0),this[c]=s&255,this[c+1]=s>>>8,c+2},"writeUInt16LE"),a.prototype.writeUint16BE=a.prototype.writeUInt16BE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,2,65535,0),this[c]=s>>>8,this[c+1]=s&255,c+2},"writeUInt16BE"),a.prototype.writeUint32LE=a.prototype.writeUInt32LE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,4,4294967295,0),this[c+3]=s>>>24,this[c+2]=s>>>16,this[c+1]=s>>>8,this[c]=s&255,c+4},"writeUInt32LE"),a.prototype.writeUint32BE=a.prototype.writeUInt32BE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,4,4294967295,0),this[c]=s>>>24,this[c+1]=s>>>16,this[c+2]=s>>>8,this[c+3]=s&255,c+4},"writeUInt32BE");function me(f,s,c,p,_){xe(s,p,_,f,c,7);let d=Number(s&BigInt(4294967295));f[c++]=d,d=d>>8,f[c++]=d,d=d>>8,f[c++]=d,d=d>>8,f[c++]=d;let x=Number(s>>BigInt(32)&BigInt(4294967295));return f[c++]=x,x=x>>8,f[c++]=x,x=x>>8,f[c++]=x,x=x>>8,f[c++]=x,c}u(me,"wrtBigUInt64LE");function Fe(f,s,c,p,_){xe(s,p,_,f,c,7);let d=Number(s&BigInt(4294967295));f[c+7]=d,d=d>>8,f[c+6]=d,d=d>>8,f[c+5]=d,d=d>>8,f[c+4]=d;let x=Number(s>>BigInt(32)&BigInt(4294967295));return f[c+3]=x,x=x>>8,f[c+2]=x,x=x>>8,f[c+1]=x,x=x>>8,f[c]=x,c+8}u(Fe,"wrtBigUInt64BE"),a.prototype.writeBigUInt64LE=Ke(u(function(s,c=0){return me(this,s,c,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE")),a.prototype.writeBigUInt64BE=Ke(u(function(s,c=0){return Fe(this,s,c,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")),a.prototype.writeIntLE=u(function(s,c,p,_){if(s=+s,c=c>>>0,!_){let oe=Math.pow(2,8*p-1);ie(this,s,c,p,oe-1,-oe)}let d=0,x=1,Z=0;for(this[c]=s&255;++d>0)-Z&255;return c+p},"writeIntLE"),a.prototype.writeIntBE=u(function(s,c,p,_){if(s=+s,c=c>>>0,!_){let oe=Math.pow(2,8*p-1);ie(this,s,c,p,oe-1,-oe)}let d=p-1,x=1,Z=0;for(this[c+d]=s&255;--d>=0&&(x*=256);)s<0&&Z===0&&this[c+d+1]!==0&&(Z=1),this[c+d]=(s/x>>0)-Z&255;return c+p},"writeIntBE"),a.prototype.writeInt8=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,1,127,-128),s<0&&(s=255+s+1),this[c]=s&255,c+1},"writeInt8"),a.prototype.writeInt16LE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,2,32767,-32768),this[c]=s&255,this[c+1]=s>>>8,c+2},"writeInt16LE"),a.prototype.writeInt16BE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,2,32767,-32768),this[c]=s>>>8,this[c+1]=s&255,c+2},"writeInt16BE"),a.prototype.writeInt32LE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,4,2147483647,-2147483648),this[c]=s&255,this[c+1]=s>>>8,this[c+2]=s>>>16,this[c+3]=s>>>24,c+4},"writeInt32LE"),a.prototype.writeInt32BE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,4,2147483647,-2147483648),s<0&&(s=4294967295+s+1),this[c]=s>>>24,this[c+1]=s>>>16,this[c+2]=s>>>8,this[c+3]=s&255,c+4},"writeInt32BE"),a.prototype.writeBigInt64LE=Ke(u(function(s,c=0){return me(this,s,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE")),a.prototype.writeBigInt64BE=Ke(u(function(s,c=0){return Fe(this,s,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Ne(f,s,c,p,_,d){if(c+p>f.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}u(Ne,"checkIEEE754");function Ae(f,s,c,p,_){return s=+s,c=c>>>0,_||Ne(f,s,c,4),t.write(f,s,c,p,23,4),c+4}u(Ae,"writeFloat"),a.prototype.writeFloatLE=u(function(s,c,p){return Ae(this,s,c,!0,p)},"writeFloatLE"),a.prototype.writeFloatBE=u(function(s,c,p){return Ae(this,s,c,!1,p)},"writeFloatBE");function Le(f,s,c,p,_){return s=+s,c=c>>>0,_||Ne(f,s,c,8),t.write(f,s,c,p,52,8),c+8}u(Le,"writeDouble"),a.prototype.writeDoubleLE=u(function(s,c,p){return Le(this,s,c,!0,p)},"writeDoubleLE"),a.prototype.writeDoubleBE=u(function(s,c,p){return Le(this,s,c,!1,p)},"writeDoubleBE"),a.prototype.copy=u(function(s,c,p,_){if(!a.isBuffer(s))throw new TypeError("argument should be a Buffer");if(p||(p=0),!_&&_!==0&&(_=this.length),c>=s.length&&(c=s.length),c||(c=0),_>0&&_=this.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("sourceEnd out of bounds");_>this.length&&(_=this.length),s.length-c<_-p&&(_=s.length-c+p);let d=_-p;return this===s&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(c,p,_):Uint8Array.prototype.set.call(s,this.subarray(p,_),c),d},"copy"),a.prototype.fill=u(function(s,c,p,_){if(typeof s=="string"){if(typeof c=="string"?(_=c,c=0,p=this.length):typeof p=="string"&&(_=p,p=this.length),_!==void 0&&typeof _!="string")throw new TypeError("encoding must be a string");if(typeof _=="string"&&!a.isEncoding(_))throw new TypeError("Unknown encoding: "+_);if(s.length===1){let x=s.charCodeAt(0);(_==="utf8"&&x<128||_==="latin1")&&(s=x)}}else typeof s=="number"?s=s&255:typeof s=="boolean"&&(s=Number(s));if(c<0||this.length>>0,p=p===void 0?this.length:p>>>0,s||(s=0);let d;if(typeof s=="number")for(d=c;dRe(2,32)?_=re(String(c)):typeof c=="bigint"&&(_=String(c),(c>Re(BigInt(2),BigInt(32))||c<-Re(BigInt(2),BigInt(32)))&&(_=re(_)),_+="n"),p+=` It must be ${s}. Received ${_}`,p},RangeError);function re(f){let s="",c=f.length,p=f[0]==="-"?1:0;for(;c>=p+4;c-=3)s=`_${f.slice(c-3,c)}${s}`;return`${f.slice(0,c)}${s}`}u(re,"addNumericalSeparator");function be(f,s,c){I(s,"offset"),(f[s]===void 0||f[s+c]===void 0)&&R(s,f.length-(c+1))}u(be,"checkBounds");function xe(f,s,c,p,_,d){if(f>c||f3?s===0||s===BigInt(0)?Z=`>= 0${x} and < 2${x} ** ${(d+1)*8}${x}`:Z=`>= -(2${x} ** ${(d+1)*8-1}${x}) and < 2 ** ${(d+1)*8-1}${x}`:Z=`>= ${s}${x} and <= ${c}${x}`,new M.ERR_OUT_OF_RANGE("value",Z,f)}be(p,_,d)}u(xe,"checkIntBI");function I(f,s){if(typeof f!="number")throw new M.ERR_INVALID_ARG_TYPE(s,"number",f)}u(I,"validateNumber");function R(f,s,c){throw Math.floor(f)!==f?(I(f,c),new M.ERR_OUT_OF_RANGE(c||"offset","an integer",f)):s<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE(c||"offset",`>= ${c?1:0} and <= ${s}`,f)}u(R,"boundsError");let ae=/[^+/0-9A-Za-z-_]/g;function ge(f){if(f=f.split("=")[0],f=f.trim().replace(ae,""),f.length<2)return"";for(;f.length%4!==0;)f=f+"=";return f}u(ge,"base64clean");function Pe(f,s){s=s||1/0;let c,p=f.length,_=null,d=[];for(let x=0;x55295&&c<57344){if(!_){if(c>56319){(s-=3)>-1&&d.push(239,191,189);continue}else if(x+1===p){(s-=3)>-1&&d.push(239,191,189);continue}_=c;continue}if(c<56320){(s-=3)>-1&&d.push(239,191,189),_=c;continue}c=(_-55296<<10|c-56320)+65536}else _&&(s-=3)>-1&&d.push(239,191,189);if(_=null,c<128){if((s-=1)<0)break;d.push(c)}else if(c<2048){if((s-=2)<0)break;d.push(c>>6|192,c&63|128)}else if(c<65536){if((s-=3)<0)break;d.push(c>>12|224,c>>6&63|128,c&63|128)}else if(c<1114112){if((s-=4)<0)break;d.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw new Error("Invalid code point")}return d}u(Pe,"utf8ToBytes");function Se(f){let s=[];for(let c=0;c>8,_=c%256,d.push(_),d.push(p);return d}u(ve,"utf16leToBytes");function et(f){return r.toByteArray(ge(f))}u(et,"base64ToBytes");function ct(f,s,c,p){let _;for(_=0;_=s.length||_>=f.length);++_)s[_+c]=f[_];return _}u(ct,"blitBuffer");function He(f,s){return f instanceof s||f!=null&&f.constructor!=null&&f.constructor.name!=null&&f.constructor.name===s.name}u(He,"isInstance");function ot(f){return f!==f}u(ot,"numberIsNaN");let Ut=function(){let f="0123456789abcdef",s=new Array(256);for(let c=0;c<16;++c){let p=c*16;for(let _=0;_<16;++_)s[p+_]=f[c]+f[_]}return s}();function Ke(f){return typeof BigInt=="undefined"?bt:f}u(Ke,"defineBigIntMethod");function bt(){throw new Error("BigInt not supported")}return u(bt,"BufferBigIntNotDefined"),Xr}u(gd,"dew");var Jr=gd();Jr.Buffer;Jr.SlowBuffer;Jr.INSPECT_MAX_BYTES;Jr.kMaxLength;var fe=Jr.Buffer,Qy=Jr.INSPECT_MAX_BYTES,eb=Jr.kMaxLength;var Yi={};Wi(Yi,{_toUnixTimestamp:()=>Hc,access:()=>$p,accessSync:()=>Em,appendFile:()=>bp,appendFileSync:()=>Qp,chmod:()=>Pp,chmodSync:()=>bm,chown:()=>Dp,chownSync:()=>gm,close:()=>_p,closeSync:()=>tm,constants:()=>Si,createReadStream:()=>qp,createWriteStream:()=>Vp,exists:()=>lp,existsSync:()=>Gc,fchmod:()=>Tp,fchmodSync:()=>um,fchown:()=>Ip,fchownSync:()=>sm,fdatasync:()=>Sp,fdatasyncSync:()=>nm,fstat:()=>wp,fstatSync:()=>em,fsync:()=>Ep,fsyncSync:()=>im,ftruncate:()=>vp,ftruncateSync:()=>rm,futimes:()=>Ap,futimesSync:()=>cm,getMount:()=>Fi,getMounts:()=>Vc,initialize:()=>Kc,lchmod:()=>Up,lchmodSync:()=>wm,lchown:()=>Lp,lchownSync:()=>ym,link:()=>kp,linkSync:()=>dm,lstat:()=>hp,lstatSync:()=>Yp,lutimes:()=>jp,lutimesSync:()=>vm,mkdir:()=>Op,mkdirSync:()=>fm,mount:()=>Gn,open:()=>mp,openSync:()=>Jp,promises:()=>Gi,read:()=>xp,readFile:()=>gp,readFileSync:()=>Xc,readSync:()=>am,readdir:()=>Bp,readdirSync:()=>hm,readlink:()=>Np,readlinkSync:()=>mm,realpath:()=>zp,realpathSync:()=>Xa,rename:()=>cp,renameSync:()=>Kp,rmdir:()=>Rp,rmdirSync:()=>lm,stat:()=>fp,statSync:()=>Gp,symlink:()=>Cp,symlinkSync:()=>pm,truncate:()=>dp,truncateSync:()=>Xp,umount:()=>Ea,unlink:()=>pp,unlinkSync:()=>Yc,unwatchFile:()=>Wp,utimes:()=>Mp,utimesSync:()=>_m,watch:()=>Hp,watchFile:()=>Zp,write:()=>Fp,writeFile:()=>yp,writeFileSync:()=>Jc,writeSync:()=>om});var tt=(A=>(A[A.EPERM=1]="EPERM",A[A.ENOENT=2]="ENOENT",A[A.EIO=5]="EIO",A[A.EBADF=9]="EBADF",A[A.EACCES=13]="EACCES",A[A.EBUSY=16]="EBUSY",A[A.EEXIST=17]="EEXIST",A[A.ENOTDIR=20]="ENOTDIR",A[A.EISDIR=21]="EISDIR",A[A.EINVAL=22]="EINVAL",A[A.EFBIG=27]="EFBIG",A[A.ENOSPC=28]="ENOSPC",A[A.EROFS=30]="EROFS",A[A.ENOTEMPTY=39]="ENOTEMPTY",A[A.ENOTSUP=95]="ENOTSUP",A))(tt||{}),mt={};mt[1]="Operation not permitted.";mt[2]="No such file or directory.";mt[5]="Input/output error.";mt[9]="Bad file descriptor.";mt[13]="Permission denied.";mt[16]="Resource busy or locked.";mt[17]="File exists.";mt[20]="File is not a directory.";mt[21]="File is a directory.";mt[22]="Invalid argument.";mt[27]="File is too big.";mt[28]="No space left on disk.";mt[30]="Cannot modify a read-only file system.";mt[39]="Directory is not empty.";mt[95]="Operation is not supported.";var T=class extends Error{constructor(e,i=mt[e],n){super(i);this.syscall="";this.errno=e,this.code=tt[e],this.path=n,this.message=`Error: ${this.code}: ${i}${this.path?`, '${this.path}'`:""}`}static fromJSON(e){let i=new T(e.errno,e.message,e.path);return i.code=e.code,i.stack=e.stack,i}static fromBuffer(e,i=0){return T.fromJSON(JSON.parse(e.toString("utf8",i+4,i+4+e.readUInt32LE(i))))}static FileError(e,i){return new T(e,mt[e],i)}static EACCES(e){return this.FileError(13,e)}static ENOENT(e){return this.FileError(2,e)}static EEXIST(e){return this.FileError(17,e)}static EISDIR(e){return this.FileError(21,e)}static ENOTDIR(e){return this.FileError(20,e)}static EPERM(e){return this.FileError(1,e)}static ENOTEMPTY(e){return this.FileError(39,e)}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message}}writeToBuffer(e=fe.alloc(this.bufferSize()),i=0){let n=e.write(JSON.stringify(this.toJSON()),i+4);return e.writeUInt32LE(n,i),e}bufferSize(){return 4+fe.byteLength(JSON.stringify(this.toJSON()))}};u(T,"ApiError");var ga={},Mc=!1,Ei=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:global;function yd(){if(Mc)return ga;Mc=!0;var r=ga={},t,e;function i(){throw new Error("setTimeout has not been defined")}u(i,"defaultSetTimout");function n(){throw new Error("clearTimeout has not been defined")}u(n,"defaultClearTimeout"),function(){try{typeof setTimeout=="function"?t=setTimeout:t=i}catch(A){t=i}try{typeof clearTimeout=="function"?e=clearTimeout:e=n}catch(A){e=n}}();function o(A){if(t===setTimeout)return setTimeout(A,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(A,0);try{return t(A,0)}catch(O){try{return t.call(null,A,0)}catch(U){return t.call(this||Ei,A,0)}}}u(o,"runTimeout");function a(A){if(e===clearTimeout)return clearTimeout(A);if((e===n||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(A);try{return e(A)}catch(O){try{return e.call(null,A)}catch(U){return e.call(this||Ei,A)}}}u(a,"runClearTimeout");var l=[],m=!1,y,g=-1;function w(){!m||!y||(m=!1,y.length?l=y.concat(l):g=-1,l.length&&v())}u(w,"cleanUpNextTick");function v(){if(!m){var A=o(w);m=!0;for(var O=l.length;O;){for(y=l,l=[];++g1)for(var U=1;U2){var S=l.lastIndexOf("/");if(S!==l.length-1){S===-1?(l="",m=0):(l=l.slice(0,S),m=l.length-1-l.lastIndexOf("/")),y=v,g=0;continue}}else if(l.length===2||l.length===1){l="",m=0,y=v,g=0;continue}}a&&(l.length>0?l+="/..":l="..",m=2)}else l.length>0?l+="/"+o.slice(y+1,v):l=o.slice(y+1,v),m=v-y-1;y=v,g=0}else w===46&&g!==-1?++g:g=-1}return l}u(e,"normalizeStringPosix");function i(o,a){var l=a.dir||a.root,m=a.base||(a.name||"")+(a.ext||"");return l?l===a.root?l+m:l+o+m:m}u(i,"_format");var n={resolve:u(function(){for(var a="",l=!1,m,y=arguments.length-1;y>=-1&&!l;y--){var g;y>=0?g=arguments[y]:(m===void 0&&(m=r.cwd()),g=m),t(g),g.length!==0&&(a=g+"/"+a,l=g.charCodeAt(0)===47)}return a=e(a,!l),l?a.length>0?"/"+a:"/":a.length>0?a:"."},"resolve"),normalize:u(function(a){if(t(a),a.length===0)return".";var l=a.charCodeAt(0)===47,m=a.charCodeAt(a.length-1)===47;return a=e(a,!l),a.length===0&&!l&&(a="."),a.length>0&&m&&(a+="/"),l?"/"+a:a},"normalize"),isAbsolute:u(function(a){return t(a),a.length>0&&a.charCodeAt(0)===47},"isAbsolute"),join:u(function(){if(arguments.length===0)return".";for(var a,l=0;l0&&(a===void 0?a=m:a+="/"+m)}return a===void 0?".":n.normalize(a)},"join"),relative:u(function(a,l){if(t(a),t(l),a===l||(a=n.resolve(a),l=n.resolve(l),a===l))return"";for(var m=1;mE){if(l.charCodeAt(w+O)===47)return l.slice(w+O+1);if(O===0)return l.slice(w+O)}else g>E&&(a.charCodeAt(m+O)===47?A=O:O===0&&(A=0));break}var U=a.charCodeAt(m+O),j=l.charCodeAt(w+O);if(U!==j)break;U===47&&(A=O)}var W="";for(O=m+A+1;O<=y;++O)(O===y||a.charCodeAt(O)===47)&&(W.length===0?W+="..":W+="/..");return W.length>0?W+l.slice(w+A):(w+=A,l.charCodeAt(w)===47&&++w,l.slice(w))},"relative"),_makeLong:u(function(a){return a},"_makeLong"),dirname:u(function(a){if(t(a),a.length===0)return".";for(var l=a.charCodeAt(0),m=l===47,y=-1,g=!0,w=a.length-1;w>=1;--w)if(l=a.charCodeAt(w),l===47){if(!g){y=w;break}}else g=!1;return y===-1?m?"/":".":m&&y===1?"//":a.slice(0,y)},"dirname"),basename:u(function(a,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');t(a);var m=0,y=-1,g=!0,w;if(l!==void 0&&l.length>0&&l.length<=a.length){if(l.length===a.length&&l===a)return"";var v=l.length-1,S=-1;for(w=a.length-1;w>=0;--w){var E=a.charCodeAt(w);if(E===47){if(!g){m=w+1;break}}else S===-1&&(g=!1,S=w+1),v>=0&&(E===l.charCodeAt(v)?--v===-1&&(y=w):(v=-1,y=S))}return m===y?y=S:y===-1&&(y=a.length),a.slice(m,y)}else{for(w=a.length-1;w>=0;--w)if(a.charCodeAt(w)===47){if(!g){m=w+1;break}}else y===-1&&(g=!1,y=w+1);return y===-1?"":a.slice(m,y)}},"basename"),extname:u(function(a){t(a);for(var l=-1,m=0,y=-1,g=!0,w=0,v=a.length-1;v>=0;--v){var S=a.charCodeAt(v);if(S===47){if(!g){m=v+1;break}continue}y===-1&&(g=!1,y=v+1),S===46?l===-1?l=v:w!==1&&(w=1):l!==-1&&(w=-1)}return l===-1||y===-1||w===0||w===1&&l===y-1&&l===m+1?"":a.slice(l,y)},"extname"),format:u(function(a){if(a===null||typeof a!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof a);return i("/",a)},"format"),parse:u(function(a){t(a);var l={root:"",dir:"",base:"",ext:"",name:""};if(a.length===0)return l;var m=a.charCodeAt(0),y=m===47,g;y?(l.root="/",g=1):g=0;for(var w=-1,v=0,S=-1,E=!0,A=a.length-1,O=0;A>=g;--A){if(m=a.charCodeAt(A),m===47){if(!E){v=A+1;break}continue}S===-1&&(E=!1,S=A+1),m===46?w===-1?w=A:O!==1&&(O=1):w!==-1&&(O=-1)}return w===-1||S===-1||O===0||O===1&&w===S-1&&w===v+1?S!==-1&&(v===0&&y?l.base=l.name=a.slice(1,S):l.base=l.name=a.slice(v,S)):(v===0&&y?(l.name=a.slice(1,w),l.base=a.slice(1,S)):(l.name=a.slice(v,w),l.base=a.slice(v,S)),l.ext=a.slice(w,S)),v>0?l.dir=a.slice(0,v-1):y&&(l.dir="/"),l},"parse"),sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,ya=n,ya}u(bd,"dew");var Ft=bd();var Tb=Ft._makeLong,_t=Ft.basename,Ab=Ft.delimiter,Ze=Ft.dirname,Rb=Ft.extname,Ob=Ft.format,Bb=Ft.isAbsolute,Bt=Ft.join,kb=Ft.normalize,Cb=Ft.parse,Qr=Ft.posix,zc=Ft.relative,qt=Ft.resolve,ei=Ft.sep,Nb=Ft.win32;var ri=(n=>(n[n.NOP=0]="NOP",n[n.THROW_EXCEPTION=1]="THROW_EXCEPTION",n[n.TRUNCATE_FILE=2]="TRUNCATE_FILE",n[n.CREATE_FILE=3]="CREATE_FILE",n))(ri||{}),ti=class{static getFileFlag(t){return ti.flagCache.has(t)||ti.flagCache.set(t,new ti(t)),ti.flagCache.get(t)}constructor(t){if(this.flagStr=t,ti.validFlagStrs.indexOf(t)<0)throw new T(22,"Invalid flag: "+t)}getFlagString(){return this.flagStr}getMode(){let t=0;return t<<=1,t+=+this.isReadable(),t<<=1,t+=+this.isWriteable(),t<<=1,t}isReadable(){return this.flagStr.indexOf("r")!==-1||this.flagStr.indexOf("+")!==-1}isWriteable(){return this.flagStr.indexOf("w")!==-1||this.flagStr.indexOf("a")!==-1||this.flagStr.indexOf("+")!==-1}isTruncating(){return this.flagStr.indexOf("w")!==-1}isAppendable(){return this.flagStr.indexOf("a")!==-1}isSynchronous(){return this.flagStr.indexOf("s")!==-1}isExclusive(){return this.flagStr.indexOf("x")!==-1}pathExistsAction(){return this.isExclusive()?1:this.isTruncating()?2:0}pathNotExistsAction(){return(this.isWriteable()||this.isAppendable())&&this.flagStr!=="r+"?3:1}},We=ti;u(We,"FileFlag"),We.flagCache=new Map,We.validFlagStrs=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];var $r=class{sync(){return C(this,null,function*(){throw new T(95)})}syncSync(){throw new T(95)}datasync(){return C(this,null,function*(){return this.sync()})}datasyncSync(){return this.syncSync()}chown(t,e){return C(this,null,function*(){throw new T(95)})}chownSync(t,e){throw new T(95)}chmod(t){return C(this,null,function*(){throw new T(95)})}chmodSync(t){throw new T(95)}utimes(t,e){return C(this,null,function*(){throw new T(95)})}utimesSync(t,e){throw new T(95)}};u($r,"BaseFile");var Zr=class{constructor(t){}};u(Zr,"FileSystem");var ba=class extends Zr{constructor(e){super();this._ready=Promise.resolve(this)}get metadata(){return{name:this.constructor.name,readonly:!1,synchronous:!1,supportsProperties:!1,supportsLinks:!1,totalSpace:0,freeSpace:0}}whenReady(){return this._ready}openFile(e,i,n){return C(this,null,function*(){throw new T(95)})}createFile(e,i,n,o){return C(this,null,function*(){throw new T(95)})}open(e,i,n,o){return C(this,null,function*(){try{let a=yield this.stat(e,o);switch(i.pathExistsAction()){case 1:throw T.EEXIST(e);case 2:let l=yield this.openFile(e,i,o);if(!l)throw new Error("BFS has reached an impossible code path; please file a bug.");return yield l.truncate(0),yield l.sync(),l;case 0:return this.openFile(e,i,o);default:throw new T(22,"Invalid FileFlag object.")}}catch(a){switch(i.pathNotExistsAction()){case 3:let l=yield this.stat(Ze(e),o);if(l&&!l.isDirectory())throw T.ENOTDIR(Ze(e));return this.createFile(e,i,n,o);case 1:throw T.ENOENT(e);default:throw new T(22,"Invalid FileFlag object.")}}})}access(e,i,n){return C(this,null,function*(){throw new T(95)})}accessSync(e,i,n){throw new T(95)}rename(e,i,n){return C(this,null,function*(){throw new T(95)})}renameSync(e,i,n){throw new T(95)}stat(e,i){return C(this,null,function*(){throw new T(95)})}statSync(e,i){throw new T(95)}openFileSync(e,i,n){throw new T(95)}createFileSync(e,i,n,o){throw new T(95)}openSync(e,i,n,o){let a;try{a=this.statSync(e,o)}catch(l){switch(i.pathNotExistsAction()){case 3:if(!this.statSync(Ze(e),o).isDirectory())throw T.ENOTDIR(Ze(e));return this.createFileSync(e,i,n,o);case 1:throw T.ENOENT(e);default:throw new T(22,"Invalid FileFlag object.")}}if(!a.hasAccess(n,o))throw T.EACCES(e);switch(i.pathExistsAction()){case 1:throw T.EEXIST(e);case 2:return this.unlinkSync(e,o),this.createFileSync(e,i,a.mode,o);case 0:return this.openFileSync(e,i,o);default:throw new T(22,"Invalid FileFlag object.")}}unlink(e,i){return C(this,null,function*(){throw new T(95)})}unlinkSync(e,i){throw new T(95)}rmdir(e,i){return C(this,null,function*(){throw new T(95)})}rmdirSync(e,i){throw new T(95)}mkdir(e,i,n){return C(this,null,function*(){throw new T(95)})}mkdirSync(e,i,n){throw new T(95)}readdir(e,i){return C(this,null,function*(){throw new T(95)})}readdirSync(e,i){throw new T(95)}exists(e,i){return C(this,null,function*(){try{return yield this.stat(e,i),!0}catch(n){return!1}})}existsSync(e,i){try{return this.statSync(e,i),!0}catch(n){return!1}}realpath(e,i){return C(this,null,function*(){if(this.metadata.supportsLinks){let n=e.split(ei);for(let o=0;ovd,COPYFILE_FICLONE:()=>Ed,COPYFILE_FICLONE_FORCE:()=>Sd,F_OK:()=>wd,O_APPEND:()=>Bd,O_CREAT:()=>Td,O_DIRECT:()=>Ud,O_DIRECTORY:()=>kd,O_DSYNC:()=>Ld,O_EXCL:()=>Ad,O_NOATIME:()=>Cd,O_NOCTTY:()=>Rd,O_NOFOLLOW:()=>Nd,O_NONBLOCK:()=>Md,O_RDONLY:()=>Fd,O_RDWR:()=>Id,O_SYMLINK:()=>Pd,O_SYNC:()=>Dd,O_TRUNC:()=>Od,O_WRONLY:()=>xd,R_OK:()=>sr,S_IFBLK:()=>zd,S_IFCHR:()=>jd,S_IFDIR:()=>zn,S_IFIFO:()=>$d,S_IFLNK:()=>$n,S_IFMT:()=>Vt,S_IFREG:()=>jn,S_IFSOCK:()=>Zd,S_IRGRP:()=>Gd,S_IROTH:()=>Qd,S_IRUSR:()=>Hd,S_IRWXG:()=>Kd,S_IRWXO:()=>Jd,S_IRWXU:()=>Wd,S_IWGRP:()=>Yd,S_IWOTH:()=>ep,S_IWUSR:()=>qd,S_IXGRP:()=>Xd,S_IXOTH:()=>tp,S_IXUSR:()=>Vd,W_OK:()=>ii,X_OK:()=>_d});var wd=0,sr=4,ii=2,_d=1,vd=1,Ed=2,Sd=4,Fd=0,xd=1,Id=2,Td=64,Ad=128,Rd=256,Od=512,Bd=1024,kd=65536,Cd=262144,Nd=131072,Dd=1052672,Ld=4096,Pd=32768,Ud=16384,Md=2048,Vt=61440,jn=32768,zn=16384,jd=8192,zd=24576,$d=4096,$n=40960,Zd=49152,Wd=448,Hd=256,qd=128,Vd=64,Kd=56,Gd=32,Yd=16,Xd=8,Jd=7,Qd=4,ep=2,tp=1;var je=(i=>(i[i.FILE=32768]="FILE",i[i.DIRECTORY=16384]="DIRECTORY",i[i.SYMLINK=40960]="SYMLINK",i))(je||{}),Me=class{constructor(t,e,i,n,o,a,l,m,y){this.dev=0;this.ino=0;this.rdev=0;this.nlink=1;this.blksize=4096;this.uid=0;this.gid=0;this.fileData=null;this.size=e;let g=0;if(typeof n!="number"&&(g=Date.now(),n=g),typeof o!="number"&&(g||(g=Date.now()),o=g),typeof a!="number"&&(g||(g=Date.now()),a=g),typeof y!="number"&&(g||(g=Date.now()),y=g),typeof l!="number"&&(l=0),typeof m!="number"&&(m=0),this.atimeMs=n,this.ctimeMs=a,this.mtimeMs=o,this.birthtimeMs=y,i)this.mode=i;else switch(t){case je.FILE:this.mode=420;break;case je.DIRECTORY:default:this.mode=511}this.blocks=Math.ceil(e/512),this.mode&61440||(this.mode|=t)}static fromBuffer(t){let e=t.readUInt32LE(0),i=t.readUInt32LE(4),n=t.readDoubleLE(8),o=t.readDoubleLE(16),a=t.readDoubleLE(24),l=t.readUInt32LE(32),m=t.readUInt32LE(36);return new Me(i&61440,e,i&-61441,n,o,a,l,m)}static clone(t){return new Me(t.mode&61440,t.size,t.mode&-61441,t.atimeMs,t.mtimeMs,t.ctimeMs,t.uid,t.gid,t.birthtimeMs)}get atime(){return new Date(this.atimeMs)}get mtime(){return new Date(this.mtimeMs)}get ctime(){return new Date(this.ctimeMs)}get birthtime(){return new Date(this.birthtimeMs)}toBuffer(){let t=fe.alloc(32);return t.writeUInt32LE(this.size,0),t.writeUInt32LE(this.mode,4),t.writeDoubleLE(this.atime.getTime(),8),t.writeDoubleLE(this.mtime.getTime(),16),t.writeDoubleLE(this.ctime.getTime(),24),t.writeUInt32LE(this.uid,32),t.writeUInt32LE(this.gid,36),t}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}hasAccess(t,e){if(e.euid===0||e.egid===0)return!0;let i=this.mode&-61441,n=15,o=15,a=15;if(e.euid==this.uid){let y=(3840&i)>>8;n=(t^y)&t}if(e.egid==this.gid){let y=(240&i)>>4;o=(t^y)&t}let l=15&i;return a=(t^l)&t,!(n&o&a)}getCred(t=this.uid,e=this.gid){return new Ye(t,e,this.uid,this.gid,t,e)}chmod(t){this.mode=this.mode&61440|t}chown(t,e){!isNaN(+t)&&0<=+t&&+tthis._buffer.length){let n=fe.alloc(e-this._buffer.length,0);this.writeSync(n,0,n.length,this._buffer.length),this._flag.isSynchronous()&&Fi("/").metadata.synchronous&&this.syncSync();return}this._stat.size=e;let i=fe.alloc(e);this._buffer.copy(i,0,0,e),this._buffer=i,this._flag.isSynchronous()&&Fi("/").metadata.synchronous&&this.syncSync()}write(e,i,n,o){return C(this,null,function*(){return this.writeSync(e,i,n,o)})}writeSync(e,i,n,o){if(this._dirty=!0,o==null&&(o=this.getPos()),!this._flag.isWriteable())throw new T(1,"File not opened with a writeable mode.");let a=o+n;if(a>this._stat.size&&(this._stat.size=a,a>this._buffer.length)){let m=fe.alloc(a);this._buffer.copy(m),this._buffer=m}let l=e.copy(this._buffer,o,i,i+n);return this._stat.mtimeMs=Date.now(),this._flag.isSynchronous()?(this.syncSync(),l):(this.setPos(o+l),l)}read(e,i,n,o){return C(this,null,function*(){return{bytesRead:this.readSync(e,i,n,o),buffer:e}})}readSync(e,i,n,o){if(!this._flag.isReadable())throw new T(1,"File not opened with a readable mode.");o==null&&(o=this.getPos()),o+n>this._stat.size&&(n=this._stat.size-o);let l=this._buffer.copy(e,i,o,o+n);return this._stat.atimeMs=Date.now(),this._pos=o+n,l}chmod(e){return C(this,null,function*(){this.chmodSync(e)})}chmodSync(e){if(!this._fs.metadata.supportsProperties)throw new T(95);this._dirty=!0,this._stat.chmod(e),this.syncSync()}chown(e,i){return C(this,null,function*(){this.chownSync(e,i)})}chownSync(e,i){if(!this._fs.metadata.supportsProperties)throw new T(95);this._dirty=!0,this._stat.chown(e,i),this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}};u(Tt,"PreloadFile");var er=class extends Tt{constructor(t,e,i,n,o){super(t,e,i,n,o)}sync(){return C(this,null,function*(){})}syncSync(){}close(){return C(this,null,function*(){})}closeSync(){}};u(er,"NoSyncFile");var Er="/",_a=null;function $c(){return _a||(_a=fe.from("{}"))}u($c,"getEmptyDirNode");function Wn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let t=Math.random()*16|0;return(r==="x"?t:t&3|8).toString(16)})}u(Wn,"GenerateRandomID");var qi=class{constructor(t,e){this.key=t;this.value=e;this.prev=null;this.next=null}};u(qi,"LRUNode");var Zn=class{constructor(t){this.limit=t;this.size=0;this.map={};this.head=null;this.tail=null}set(t,e){let i=new qi(t,e);this.map[t]?(this.map[t].value=i.value,this.remove(i.key)):this.size>=this.limit&&(delete this.map[this.tail.key],this.size--,this.tail=this.tail.prev,this.tail.next=null),this.setHead(i)}get(t){if(this.map[t]){let e=this.map[t].value,i=new qi(t,e);return this.remove(t),this.setHead(i),e}else return null}remove(t){let e=this.map[t];e&&(e.prev!==null?e.prev.next=e.next:this.head=e.next,e.next!==null?e.next.prev=e.prev:this.tail=e.prev,delete this.map[t],this.size--)}removeAll(){this.size=0,this.map={},this.head=null,this.tail=null}setHead(t){t.next=this.head,t.prev=null,this.head!==null&&(this.head.prev=t),this.head=t,this.tail===null&&(this.tail=t),this.size++,this.map[t.key]=t}};u(Zn,"LRUCache");var Wr=class{constructor(t){this.store=t;this.originalData={};this.modifiedKeys=[]}get(t){let e=this.store.get(t);return this.stashOldValue(t,e),e}put(t,e,i){return this.markModified(t),this.store.put(t,e,i)}del(t){this.markModified(t),this.store.del(t)}commit(){}abort(){for(let t of this.modifiedKeys){let e=this.originalData[t];e?this.store.put(t,e,!0):this.store.del(t)}}_has(t){return Object.prototype.hasOwnProperty.call(this.originalData,t)}stashOldValue(t,e){this._has(t)||(this.originalData[t]=e)}markModified(t){this.modifiedKeys.indexOf(t)===-1&&(this.modifiedKeys.push(t),this._has(t)||(this.originalData[t]=this.store.get(t)))}};u(Wr,"SimpleSyncRWTransaction");var xi=class extends Tt{constructor(t,e,i,n,o){super(t,e,i,n,o)}syncSync(){this.isDirty()&&(this._fs._syncSync(this.getPath(),this.getBuffer(),this.getStats()),this.resetDirty())}closeSync(){this.syncSync()}};u(xi,"SyncKeyValueFile");var Hr=class extends kt{constructor(e){super();this.store=e.store,this.makeRootDirectory()}static isAvailable(){return!0}getName(){return this.store.name()}isReadOnly(){return!1}supportsSymlinks(){return!1}supportsProps(){return!0}supportsSynch(){return!0}empty(){this.store.clear(),this.makeRootDirectory()}accessSync(e,i,n){let o=this.store.beginTransaction("readonly");if(!this.findINode(o,e).toStats().hasAccess(i,n))throw T.EACCES(e)}renameSync(e,i,n){let o=this.store.beginTransaction("readwrite"),a=Ze(e),l=_t(e),m=Ze(i),y=_t(i),g=this.findINode(o,a),w=this.getDirListing(o,a,g);if(!g.toStats().hasAccess(2,n))throw T.EACCES(e);if(!w[l])throw T.ENOENT(e);let v=w[l];if(delete w[l],(m+"/").indexOf(e+"/")===0)throw new T(16,a);let S,E;if(m===a?(S=g,E=w):(S=this.findINode(o,m),E=this.getDirListing(o,m,S)),E[y]){let A=this.getINode(o,i,E[y]);if(A.isFile())try{o.del(A.id),o.del(E[y])}catch(O){throw o.abort(),O}else throw T.EPERM(i)}E[y]=v;try{o.put(g.id,fe.from(JSON.stringify(w)),!0),o.put(S.id,fe.from(JSON.stringify(E)),!0)}catch(A){throw o.abort(),A}o.commit()}statSync(e,i){let n=this.findINode(this.store.beginTransaction("readonly"),e).toStats();if(!n.hasAccess(4,i))throw T.EACCES(e);return n}createFileSync(e,i,n,o){let a=this.store.beginTransaction("readwrite"),l=fe.alloc(0),m=this.commitNewFile(a,e,je.FILE,n,o,l);return new xi(this,e,i,m.toStats(),l)}openFileSync(e,i,n){let o=this.store.beginTransaction("readonly"),a=this.findINode(o,e),l=o.get(a.id);if(!a.toStats().hasAccess(i.getMode(),n))throw T.EACCES(e);if(l===void 0)throw T.ENOENT(e);return new xi(this,e,i,a.toStats(),l)}unlinkSync(e,i){this.removeEntry(e,!1,i)}rmdirSync(e,i){if(this.readdirSync(e,i).length>0)throw T.ENOTEMPTY(e);this.removeEntry(e,!0,i)}mkdirSync(e,i,n){let o=this.store.beginTransaction("readwrite"),a=fe.from("{}");this.commitNewFile(o,e,je.DIRECTORY,i,n,a)}readdirSync(e,i){let n=this.store.beginTransaction("readonly"),o=this.findINode(n,e);if(!o.toStats().hasAccess(4,i))throw T.EACCES(e);return Object.keys(this.getDirListing(n,e,o))}chmodSync(e,i,n){this.openFileSync(e,We.getFileFlag("r+"),n).chmodSync(i)}chownSync(e,i,n,o){this.openFileSync(e,We.getFileFlag("r+"),o).chownSync(i,n)}_syncSync(e,i,n){let o=this.store.beginTransaction("readwrite"),a=this._findINode(o,Ze(e),_t(e)),l=this.getINode(o,e,a),m=l.update(n);try{o.put(l.id,i,!0),m&&o.put(a,l.toBuffer(),!0)}catch(y){throw o.abort(),y}o.commit()}makeRootDirectory(){let e=this.store.beginTransaction("readwrite");if(e.get(Er)===void 0){let i=new Date().getTime(),n=new Mt(Wn(),4096,511|je.DIRECTORY,i,i,i,0,0);e.put(n.id,$c(),!1),e.put(Er,n.toBuffer(),!1),e.commit()}}_findINode(e,i,n,o=new Set){let a=Qr.join(i,n);if(o.has(a))throw new T(5,"Infinite loop detected while finding inode",a);o.add(a);let l=u(m=>{let y=this.getDirListing(e,i,m);if(y[n])return y[n];throw T.ENOENT(qt(i,n))},"readDirectory");return i==="."&&(i=Pn()),i==="/"?n===""?Er:l(this.getINode(e,i,Er)):l(this.getINode(e,i+ei+n,this._findINode(e,Ze(i),_t(i),o)))}findINode(e,i){return this.getINode(e,i,this._findINode(e,Ze(i),_t(i)))}getINode(e,i,n){let o=e.get(n);if(o===void 0)throw T.ENOENT(i);return Mt.fromBuffer(o)}getDirListing(e,i,n){if(!n.isDirectory())throw T.ENOTDIR(i);let o=e.get(n.id);if(o===void 0)throw T.ENOENT(i);return JSON.parse(o.toString())}addNewNode(e,i){let o;for(;0<5;)try{return o=Wn(),e.put(o,i,!1),o}catch(a){}throw new T(5,"Unable to commit data to key-value store.")}commitNewFile(e,i,n,o,a,l){let m=Ze(i),y=_t(i),g=this.findINode(e,m),w=this.getDirListing(e,m,g),v=new Date().getTime();if(!g.toStats().hasAccess(4,a))throw T.EACCES(i);if(i==="/")throw T.EEXIST(i);if(w[y])throw T.EEXIST(i);let S;try{let E=this.addNewNode(e,l);S=new Mt(E,l.length,o|n,v,v,v,a.uid,a.gid);let A=this.addNewNode(e,S.toBuffer());w[y]=A,e.put(g.id,fe.from(JSON.stringify(w)),!0)}catch(E){throw e.abort(),E}return e.commit(),S}removeEntry(e,i,n){let o=this.store.beginTransaction("readwrite"),a=Ze(e),l=this.findINode(o,a),m=this.getDirListing(o,a,l),y=_t(e);if(!m[y])throw T.ENOENT(e);let g=m[y],w=this.getINode(o,e,g);if(!w.toStats().hasAccess(2,n))throw T.EACCES(e);if(delete m[y],!i&&w.isDirectory())throw T.EISDIR(e);if(i&&!w.isDirectory())throw T.ENOTDIR(e);try{o.del(w.id),o.del(g),o.put(l.id,fe.from(JSON.stringify(m)),!0)}catch(v){throw o.abort(),v}o.commit()}};u(Hr,"SyncKeyValueFileSystem");var Ii=class extends Tt{constructor(t,e,i,n,o){super(t,e,i,n,o)}sync(){return C(this,null,function*(){this.isDirty()&&(yield this._fs._sync(this.getPath(),this.getBuffer(),this.getStats()),this.resetDirty())})}close(){return C(this,null,function*(){this.sync()})}};u(Ii,"AsyncKeyValueFile");var Ti=class extends gt{constructor(e){super();this._cache=null;e>0&&(this._cache=new Zn(e))}static isAvailable(){return!0}init(e){return C(this,null,function*(){this.store=e,yield this.makeRootDirectory()})}getName(){return this.store.name()}isReadOnly(){return!1}supportsSymlinks(){return!1}supportsProps(){return!0}supportsSynch(){return!1}empty(){return C(this,null,function*(){this._cache&&this._cache.removeAll(),yield this.store.clear(),yield this.makeRootDirectory()})}access(e,i,n){return C(this,null,function*(){let o=this.store.beginTransaction("readonly"),a=yield this.findINode(o,e);if(!a)throw T.ENOENT(e);if(!a.toStats().hasAccess(i,n))throw T.EACCES(e)})}rename(e,i,n){return C(this,null,function*(){let o=this._cache;this._cache&&(this._cache=null,o.removeAll());try{let a=this.store.beginTransaction("readwrite"),l=Ze(e),m=_t(e),y=Ze(i),g=_t(i),w=yield this.findINode(a,l),v=yield this.getDirListing(a,l,w);if(!w.toStats().hasAccess(2,n))throw T.EACCES(e);if(!v[m])throw T.ENOENT(e);let S=v[m];if(delete v[m],(y+"/").indexOf(e+"/")===0)throw new T(16,l);let E,A;if(y===l?(E=w,A=v):(E=yield this.findINode(a,y),A=yield this.getDirListing(a,y,E)),A[g]){let O=yield this.getINode(a,i,A[g]);if(O.isFile())try{yield a.del(O.id),yield a.del(A[g])}catch(U){throw yield a.abort(),U}else throw T.EPERM(i)}A[g]=S;try{yield a.put(w.id,fe.from(JSON.stringify(v)),!0),yield a.put(E.id,fe.from(JSON.stringify(A)),!0)}catch(O){throw yield a.abort(),O}yield a.commit()}finally{o&&(this._cache=o)}})}stat(e,i){return C(this,null,function*(){let n=this.store.beginTransaction("readonly"),a=(yield this.findINode(n,e)).toStats();if(!a.hasAccess(4,i))throw T.EACCES(e);return a})}createFile(e,i,n,o){return C(this,null,function*(){let a=this.store.beginTransaction("readwrite"),l=fe.alloc(0),m=yield this.commitNewFile(a,e,je.FILE,n,o,l);return new Ii(this,e,i,m.toStats(),l)})}openFile(e,i,n){return C(this,null,function*(){let o=this.store.beginTransaction("readonly"),a=yield this.findINode(o,e),l=yield o.get(a.id);if(!a.toStats().hasAccess(i.getMode(),n))throw T.EACCES(e);if(l===void 0)throw T.ENOENT(e);return new Ii(this,e,i,a.toStats(),l)})}unlink(e,i){return C(this,null,function*(){return this.removeEntry(e,!1,i)})}rmdir(e,i){return C(this,null,function*(){if((yield this.readdir(e,i)).length>0)throw T.ENOTEMPTY(e);yield this.removeEntry(e,!0,i)})}mkdir(e,i,n){return C(this,null,function*(){let o=this.store.beginTransaction("readwrite"),a=fe.from("{}");yield this.commitNewFile(o,e,je.DIRECTORY,i,n,a)})}readdir(e,i){return C(this,null,function*(){let n=this.store.beginTransaction("readonly"),o=yield this.findINode(n,e);if(!o.toStats().hasAccess(4,i))throw T.EACCES(e);return Object.keys(yield this.getDirListing(n,e,o))})}chmod(e,i,n){return C(this,null,function*(){yield(yield this.openFile(e,We.getFileFlag("r+"),n)).chmod(i)})}chown(e,i,n,o){return C(this,null,function*(){yield(yield this.openFile(e,We.getFileFlag("r+"),o)).chown(i,n)})}_sync(e,i,n){return C(this,null,function*(){let o=this.store.beginTransaction("readwrite"),a=yield this._findINode(o,Ze(e),_t(e)),l=yield this.getINode(o,e,a),m=l.update(n);try{yield o.put(l.id,i,!0),m&&(yield o.put(a,l.toBuffer(),!0))}catch(y){throw yield o.abort(),y}yield o.commit()})}makeRootDirectory(){return C(this,null,function*(){let e=this.store.beginTransaction("readwrite");if((yield e.get(Er))===void 0){let i=new Date().getTime(),n=new Mt(Wn(),4096,511|je.DIRECTORY,i,i,i,0,0);yield e.put(n.id,$c(),!1),yield e.put(Er,n.toBuffer(),!1),yield e.commit()}})}_findINode(a,l,m){return C(this,arguments,function*(e,i,n,o=new Set){let y=Qr.join(i,n);if(o.has(y))throw new T(5,"Infinite loop detected while finding inode",y);if(o.add(y),this._cache){let g=this._cache.get(y);if(g)return g}if(i==="/"){if(n==="")return this._cache&&this._cache.set(y,Er),Er;{let g=yield this.getINode(e,i,Er),w=yield this.getDirListing(e,i,g);if(w[n]){let v=w[n];return this._cache&&this._cache.set(y,v),v}else throw T.ENOENT(qt(i,n))}}else{let g=yield this.findINode(e,i,o),w=yield this.getDirListing(e,i,g);if(w[n]){let v=w[n];return this._cache&&this._cache.set(y,v),v}else throw T.ENOENT(qt(i,n))}})}findINode(o,a){return C(this,arguments,function*(e,i,n=new Set){let l=yield this._findINode(e,Ze(i),_t(i),n);return this.getINode(e,i,l)})}getINode(e,i,n){return C(this,null,function*(){let o=yield e.get(n);if(!o)throw T.ENOENT(i);return Mt.fromBuffer(o)})}getDirListing(e,i,n){return C(this,null,function*(){if(!n.isDirectory())throw T.ENOTDIR(i);let o=yield e.get(n.id);try{return JSON.parse(o.toString())}catch(a){throw T.ENOENT(i)}})}addNewNode(e,i){return C(this,null,function*(){let n=0,o=u(()=>C(this,null,function*(){if(++n===5)throw new T(5,"Unable to commit data to key-value store.");{let a=Wn();return(yield e.put(a,i,!1))?a:o()}}),"reroll");return o()})}commitNewFile(e,i,n,o,a,l){return C(this,null,function*(){let m=Ze(i),y=_t(i),g=yield this.findINode(e,m),w=yield this.getDirListing(e,m,g),v=new Date().getTime();if(!g.toStats().hasAccess(2,a))throw T.EACCES(i);if(i==="/")throw T.EEXIST(i);if(w[y])throw yield e.abort(),T.EEXIST(i);try{let S=yield this.addNewNode(e,l),E=new Mt(S,l.length,o|n,v,v,v,a.uid,a.gid),A=yield this.addNewNode(e,E.toBuffer());return w[y]=A,yield e.put(g.id,fe.from(JSON.stringify(w)),!0),yield e.commit(),E}catch(S){throw e.abort(),S}})}removeEntry(e,i,n){return C(this,null,function*(){this._cache&&this._cache.remove(e);let o=this.store.beginTransaction("readwrite"),a=Ze(e),l=yield this.findINode(o,a),m=yield this.getDirListing(o,a,l),y=_t(e);if(!m[y])throw T.ENOENT(e);let g=m[y],w=yield this.getINode(o,e,g);if(!w.toStats().hasAccess(2,n))throw T.EACCES(e);if(delete m[y],!i&&w.isDirectory())throw T.EISDIR(e);if(i&&!w.isDirectory())throw T.ENOTDIR(e);try{yield o.del(w.id),yield o.del(g),yield o.put(l.id,fe.from(JSON.stringify(m)),!0)}catch(v){throw yield o.abort(),v}yield o.commit()})}};u(Ti,"AsyncKeyValueFileSystem");function ni(r,t=0,e=r.length){if(t<0||e<0||e>r.length||t>e)throw new TypeError(`Invalid slice bounds on buffer of length ${r.length}: [${t}, ${e}]`);return r.length===0?fe.alloc(0):r.subarray(t,e)}u(ni,"copyingSlice");function qn(r){return C(this,null,function*(){if(!fe.isBuffer(r))throw new T(22,"option must be a Buffer.")})}u(qn,"bufferValidator");function Hn(r,t,e,i,n){return Math.min(r+1,t+1,e+1,i===n?t:t+1)}u(Hn,"_min");function rp(r,t){if(r===t)return 0;r.length>t.length&&([r,t]=[t,r]);let e=r.length,i=t.length;for(;e>0&&r.charCodeAt(e-1)===t.charCodeAt(i-1);)e--,i--;let n=0;for(;nw?w+1:E+1:v===o[e+S]?l:l+1,l=E}}return w}u(rp,"levenshtein");function Zc(r,t){return C(this,null,function*(){let e=r.Options,i=r.Name,n=0,o=!1,a=!1;for(let l in e)if(Object.prototype.hasOwnProperty.call(e,l)){let m=e[l],y=t&&t[l];if(y==null){if(!m.optional){let g=Object.keys(t).filter(w=>!(w in e)).map(w=>({str:w,distance:rp(l,w)})).filter(w=>w.distance<5).sort((w,v)=>w.distance-v.distance);if(o)return;throw o=!0,new T(22,`[${i}] Required option '${l}' not provided.${g.length>0?` You provided unrecognized option '${g[0].str}'; perhaps you meant to type '${l}'.`:""} Option description: ${m.description}`)}}else{let g=!1;if(Array.isArray(m.type)?g=m.type.indexOf(typeof y)!==-1:g=typeof y===m.type,g){if(m.validator){n++;try{yield m.validator(y)}catch(w){if(!o){if(w)throw o=!0,w;if(n--,n===0&&a)return}}}}else{if(o)return;throw o=!0,new T(22,`[${i}] Value provided for option ${l} is not the proper type. Expected ${Array.isArray(m.type)?`one of {${m.type.join(", ")}}`:m.type}, but received ${typeof y} Option description: ${m.description}`)}}}a=!0})}u(Zc,"checkOptions");function Vi(r){return new Promise(t=>{setTimeout(t,r)})}u(Vi,"wait");var Yw=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:r=>setTimeout(r,0);function Je(r,t){t=typeof r=="function"?r:t,Zc(this,r);let e=new this(typeof r=="function"?{}:r);if(typeof t!="function")return e.whenReady();e.whenReady().then(i=>t(null,i)).catch(i=>t(i))}u(Je,"CreateBackend");var Vn=class{constructor(){this.store=new Map}name(){return Kt.Name}clear(){this.store.clear()}beginTransaction(t){return new Wr(this)}get(t){return this.store.get(t)}put(t,e,i){return!i&&this.store.has(t)?!1:(this.store.set(t,e),!0)}del(t){this.store.delete(t)}};u(Vn,"InMemoryStore");var va=class extends Hr{constructor(){super({store:new Vn})}},Kt=va;u(Kt,"InMemoryFileSystem"),Kt.Name="InMemory",Kt.Create=Je.bind(va),Kt.Options={};function Hc(r){if(typeof r=="number")return r;if(r instanceof Date)return r.getTime()/1e3;throw new Error("Cannot parse time: "+r)}u(Hc,"_toUnixTimestamp");function jt(r,t){switch(typeof r){case"number":return r;case"string":let e=parseInt(r,8);return isNaN(e)?t:e;default:return t}}u(jt,"normalizeMode");function Ct(r){if(r instanceof Date)return r;if(typeof r=="number")return new Date(r*1e3);throw new T(22,"Invalid time.")}u(Ct,"normalizeTime");function lt(r){if(r.indexOf("\0")>=0)throw new T(22,"Path must be a string without null bytes.");if(r==="")throw new T(22,"Path must not be empty.");return r=r.replaceAll(/\/+/g,"/"),Qr.resolve(r)}u(lt,"normalizePath");function qr(r,t,e,i){switch(r===null?"null":typeof r){case"object":return{encoding:typeof r.encoding!="undefined"?r.encoding:t,flag:typeof r.flag!="undefined"?r.flag:e,mode:jt(r.mode,i)};case"string":return{encoding:r,flag:e,mode:i};case"null":case"undefined":case"function":return{encoding:t,flag:e,mode:i};default:throw new TypeError(`"options" must be a string or an object, got ${typeof r} instead.`)}}u(qr,"normalizeOptions");function Ue(){}u(Ue,"nop");var Ce;function qc(r){Ce=r}u(qc,"setCred");var oi=new Map,ip=100;function Kn(r){let t=ip++;return oi.set(t,r),t}u(Kn,"getFdForFile");function st(r){if(!oi.has(r))throw new T(9,"Invalid file descriptor.");return oi.get(r)}u(st,"fd2file");var tr=new Map;Kt.Create().then(r=>Gn("/",r));function Fi(r){return tr.get(r)}u(Fi,"getMount");function Vc(){return Object.fromEntries(tr.entries())}u(Vc,"getMounts");function Gn(r,t){if(r[0]!=="/"&&(r="/"+r),r=Qr.resolve(r),tr.has(r))throw new T(22,"Mount point "+r+" is already in use.");tr.set(r,t)}u(Gn,"mount");function Ea(r){if(r[0]!=="/"&&(r=`/${r}`),r=Qr.resolve(r),!tr.has(r))throw new T(22,"Mount point "+r+" is already unmounted.");tr.delete(r)}u(Ea,"umount");function Gt(r){let t=[...tr].sort((e,i)=>e[0].length>i[0].length?-1:1);for(let[e,i]of t)if(e.length<=r.length&&r.startsWith(e))return r=r.slice(e.length>1?e.length:0),r===""&&(r="/"),{fs:i,path:r,mountPoint:e};throw new T(5,"BrowserFS not initialized with a file system")}u(Gt,"resolveFS");function Wc(r,t){for(let[e,i]of Object.entries(t))r=r.replaceAll(e,i);return r}u(Wc,"fixPaths");function Vr(r,t){return r.stack=Wc(r.stack,t),r.message=Wc(r.message,t),r}u(Vr,"fixError");function Kc(r){r["/"]&&Ea("/");for(let[t,e]of Object.entries(r)){if(!e.constructor.isAvailable())throw new T(22,`Can not mount "${t}" since the filesystem is unavailable.`);Gn(t,e)}}u(Kc,"initialize");var Gi={};Wi(Gi,{access:()=>Ya,appendFile:()=>Aa,chmod:()=>qa,chown:()=>Wa,close:()=>Oa,constants:()=>Si,createReadStream:()=>sp,createWriteStream:()=>up,exists:()=>Yn,fchmod:()=>La,fchown:()=>Da,fdatasync:()=>Ca,fstat:()=>Ra,fsync:()=>ka,ftruncate:()=>Ba,futimes:()=>Pa,lchmod:()=>Va,lchown:()=>Ha,link:()=>za,lstat:()=>xa,lutimes:()=>Ga,mkdir:()=>Ma,open:()=>Ta,read:()=>Na,readFile:()=>Jn,readdir:()=>ja,readlink:()=>Za,realpath:()=>Ki,rename:()=>Sa,rmdir:()=>Ua,stat:()=>Fa,symlink:()=>$a,truncate:()=>Ia,unlink:()=>Xn,unwatchFile:()=>op,utimes:()=>Ka,watch:()=>ap,watchFile:()=>np,write:()=>eo,writeFile:()=>Qn});function ft(){return C(this,arguments,function*(...[r,t,e,...i]){e=lt(e);let{fs:n,path:o}=Gt(t&&(yield Yn(e))?yield Ki(e):e);try{return n[r](o,...i)}catch(a){throw Vr(a,{[o]:e})}})}u(ft,"doOp");function Sa(r,t){return C(this,null,function*(){r=lt(r),t=lt(t);let e=Gt(r),i=Gt(t),n={[e.path]:r,[i.path]:t};try{if(e.fs===i.fs)return e.fs.rename(e.path,i.path,Ce);let o=yield Jn(r);yield Qn(t,o),yield Xn(r)}catch(o){throw Vr(o,n)}})}u(Sa,"rename");function Yn(r){return C(this,null,function*(){r=lt(r);try{let{fs:t,path:e}=Gt(r);return t.exists(e,Ce)}catch(t){if(t.errno==2)return!1;throw t}})}u(Yn,"exists");function Fa(r){return C(this,null,function*(){return ft("stat",!0,r,Ce)})}u(Fa,"stat");function xa(r){return C(this,null,function*(){return ft("stat",!1,r,Ce)})}u(xa,"lstat");function Ia(r,t=0){return C(this,null,function*(){if(t<0)throw new T(22);return ft("truncate",!0,r,t,Ce)})}u(Ia,"truncate");function Xn(r){return C(this,null,function*(){return ft("unlink",!1,r,Ce)})}u(Xn,"unlink");function Ta(r,t,e=420){return C(this,null,function*(){let i=yield ft("open",!0,r,We.getFileFlag(t),jt(e,420),Ce);return Kn(i)})}u(Ta,"open");function Jn(e){return C(this,arguments,function*(r,t={}){let i=qr(t,null,"r",null),n=We.getFileFlag(i.flag);if(!n.isReadable())throw new T(22,"Flag passed to readFile must allow for reading.");return ft("readFile",!0,r,i.encoding,n,Ce)})}u(Jn,"readFile");function Qn(r,t,e){return C(this,null,function*(){let i=qr(e,"utf8","w",420),n=We.getFileFlag(i.flag);if(!n.isWriteable())throw new T(22,"Flag passed to writeFile must allow for writing.");return ft("writeFile",!0,r,t,i.encoding,n,i.mode,Ce)})}u(Qn,"writeFile");function Aa(r,t,e){return C(this,null,function*(){let i=qr(e,"utf8","a",420),n=We.getFileFlag(i.flag);if(!n.isAppendable())throw new T(22,"Flag passed to appendFile must allow for appending.");return ft("appendFile",!0,r,t,i.encoding,n,i.mode,Ce)})}u(Aa,"appendFile");function Ra(r){return C(this,null,function*(){return st(r).stat()})}u(Ra,"fstat");function Oa(r){return C(this,null,function*(){yield st(r).close(),oi.delete(r)})}u(Oa,"close");function Ba(r,t=0){return C(this,null,function*(){let e=st(r);if(t<0)throw new T(22);return e.truncate(t)})}u(Ba,"ftruncate");function ka(r){return C(this,null,function*(){return st(r).sync()})}u(ka,"fsync");function Ca(r){return C(this,null,function*(){return st(r).datasync()})}u(Ca,"fdatasync");function eo(r,t,e,i,n){return C(this,null,function*(){let o,a=0,l,m;if(typeof t=="string"){m=typeof e=="number"?e:null;let g=typeof i=="string"?i:"utf8";a=0,o=fe.from(t,g),l=o.length}else o=t,a=e,l=i,m=typeof n=="number"?n:null;let y=st(r);return m==null&&(m=y.getPos()),y.write(o,a,l,m)})}u(eo,"write");function Na(r,t,e,i,n){return C(this,null,function*(){let o=st(r);return isNaN(+n)&&(n=o.getPos()),o.read(t,e,i,n)})}u(Na,"read");function Da(r,t,e){return C(this,null,function*(){return st(r).chown(t,e)})}u(Da,"fchown");function La(r,t){return C(this,null,function*(){let e=typeof t=="string"?parseInt(t,8):t;return st(r).chmod(e)})}u(La,"fchmod");function Pa(r,t,e){return C(this,null,function*(){return st(r).utimes(Ct(t),Ct(e))})}u(Pa,"futimes");function Ua(r){return C(this,null,function*(){return ft("rmdir",!0,r,Ce)})}u(Ua,"rmdir");function Ma(r,t){return C(this,null,function*(){return ft("mkdir",!0,r,jt(t,511),Ce)})}u(Ma,"mkdir");function ja(r){return C(this,null,function*(){r=lt(r);let t=yield ft("readdir",!0,r,Ce),e=[...tr.keys()];for(let i of e)if(i.startsWith(r)){let n=i.slice(r.length);if(n.includes("/")||n.length==0)continue;t.push(n)}return t})}u(ja,"readdir");function za(r,t){return C(this,null,function*(){return t=lt(t),ft("link",!1,r,t,Ce)})}u(za,"link");function $a(r,t,e="file"){return C(this,null,function*(){if(!["file","dir","junction"].includes(e))throw new T(22,"Invalid type: "+e);return t=lt(t),ft("symlink",!1,r,t,e,Ce)})}u($a,"symlink");function Za(r){return C(this,null,function*(){return ft("readlink",!1,r,Ce)})}u(Za,"readlink");function Wa(r,t,e){return C(this,null,function*(){return ft("chown",!0,r,t,e,Ce)})}u(Wa,"chown");function Ha(r,t,e){return C(this,null,function*(){return ft("chown",!1,r,t,e,Ce)})}u(Ha,"lchown");function qa(r,t){return C(this,null,function*(){let e=jt(t,-1);if(e<0)throw new T(22,"Invalid mode.");return ft("chmod",!0,r,e,Ce)})}u(qa,"chmod");function Va(r,t){return C(this,null,function*(){let e=jt(t,-1);if(e<1)throw new T(22,"Invalid mode.");return ft("chmod",!1,lt(r),e,Ce)})}u(Va,"lchmod");function Ka(r,t,e){return C(this,null,function*(){return ft("utimes",!0,r,Ct(t),Ct(e),Ce)})}u(Ka,"utimes");function Ga(r,t,e){return C(this,null,function*(){return ft("utimes",!1,r,Ct(t),Ct(e),Ce)})}u(Ga,"lutimes");function Ki(e){return C(this,arguments,function*(r,t={}){r=lt(r);let{fs:i,path:n,mountPoint:o}=Gt(r);try{if(!(yield i.stat(n,Ce)).isSymbolicLink())return r;let l=o+lt(yield i.readlink(n,Ce));return Ki(l)}catch(a){throw Vr(a,{[n]:r})}})}u(Ki,"realpath");function np(i,n){return C(this,arguments,function*(r,t,e=Ue){throw new T(95)})}u(np,"watchFile");function op(e){return C(this,arguments,function*(r,t=Ue){throw new T(95)})}u(op,"unwatchFile");function ap(i,n){return C(this,arguments,function*(r,t,e=Ue){throw new T(95)})}u(ap,"watch");function Ya(r,t=384){return C(this,null,function*(){return ft("access",!0,r,t,Ce)})}u(Ya,"access");function sp(r,t){return C(this,null,function*(){throw new T(95)})}u(sp,"createReadStream");function up(r,t){return C(this,null,function*(){throw new T(95)})}u(up,"createWriteStream");function cp(r,t,e=Ue){Sa(r,t).then(()=>e()).catch(e)}u(cp,"rename");function lp(r,t=Ue){Yn(r).then(t).catch(()=>t(!1))}u(lp,"exists");function fp(r,t=Ue){Fa(r).then(e=>t(null,e)).catch(t)}u(fp,"stat");function hp(r,t=Ue){xa(r).then(e=>t(null,e)).catch(t)}u(hp,"lstat");function dp(r,t=0,e=Ue){e=typeof t=="function"?t:e,Ia(r,typeof t=="number"?t:0).then(()=>e()).catch(e)}u(dp,"truncate");function pp(r,t=Ue){Xn(r).then(()=>t()).catch(t)}u(pp,"unlink");function mp(r,t,e,i=Ue){let n=jt(e,420);i=typeof e=="function"?e:i,Ta(r,t,n).then(o=>i(null,o)).catch(i)}u(mp,"open");function gp(r,t={},e=Ue){e=typeof t=="function"?t:e,Jn(r,typeof t=="function"?null:t).then(i=>e(null,i)).catch(e)}u(gp,"readFile");function yp(r,t,e={},i=Ue){i=typeof e=="function"?e:i,Qn(r,t,typeof e=="function"?void 0:e).then(n=>i(null,n)).catch(i)}u(yp,"writeFile");function bp(r,t,e,i=Ue){i=typeof e=="function"?e:i,Aa(r,t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}u(bp,"appendFile");function wp(r,t=Ue){Ra(r).then(e=>t(null,e)).catch(t)}u(wp,"fstat");function _p(r,t=Ue){Oa(r).then(()=>t()).catch(t)}u(_p,"close");function vp(r,t,e=Ue){let i=typeof t=="number"?t:0;e=typeof t=="function"?t:e,Ba(r,i)}u(vp,"ftruncate");function Ep(r,t=Ue){ka(r).then(()=>t()).catch(t)}u(Ep,"fsync");function Sp(r,t=Ue){Ca(r).then(()=>t()).catch(t)}u(Sp,"fdatasync");function Fp(r,t,e,i,n,o=Ue){let a,l,m,y=null,g;if(typeof t=="string"){switch(g="utf8",typeof e){case"function":o=e;break;case"number":y=e,g=typeof i=="string"?i:"utf8",o=typeof n=="function"?n:o;break;default:o=typeof i=="function"?i:typeof n=="function"?n:o,o(new T(22,"Invalid arguments."));return}a=fe.from(t,g),l=0,m=a.length;let w=o;eo(r,a,l,m,y).then(v=>w(null,v,a.toString(g))).catch(w)}else{a=t,l=e,m=i,y=typeof n=="number"?n:null;let w=typeof n=="function"?n:o;eo(r,a,l,m,y).then(v=>w(null,v,a)).catch(w)}}u(Fp,"write");function xp(r,t,e,i,n,o=Ue){Na(r,t,e,i,n).then(({bytesRead:a,buffer:l})=>o(null,a,l)).catch(o)}u(xp,"read");function Ip(r,t,e,i=Ue){Da(r,t,e).then(()=>i()).catch(i)}u(Ip,"fchown");function Tp(r,t,e){La(r,t).then(()=>e()).catch(e)}u(Tp,"fchmod");function Ap(r,t,e,i=Ue){Pa(r,t,e).then(()=>i()).catch(i)}u(Ap,"futimes");function Rp(r,t=Ue){Ua(r).then(()=>t()).catch(t)}u(Rp,"rmdir");function Op(r,t,e=Ue){Ma(r,t).then(()=>e()).catch(e)}u(Op,"mkdir");function Bp(r,t=Ue){ja(r).then(e=>t(null,e)).catch(t)}u(Bp,"readdir");function kp(r,t,e=Ue){za(r,t).then(()=>e()).catch(e)}u(kp,"link");function Cp(r,t,e,i=Ue){let n=typeof e=="string"?e:"file";i=typeof e=="function"?e:i,$a(r,t,typeof e=="function"?null:e).then(()=>i()).catch(i)}u(Cp,"symlink");function Np(r,t=Ue){Za(r).then(e=>t(null,e)).catch(t)}u(Np,"readlink");function Dp(r,t,e,i=Ue){Wa(r,t,e).then(()=>i()).catch(i)}u(Dp,"chown");function Lp(r,t,e,i=Ue){Ha(r,t,e).then(()=>i()).catch(i)}u(Lp,"lchown");function Pp(r,t,e=Ue){qa(r,t).then(()=>e()).catch(e)}u(Pp,"chmod");function Up(r,t,e=Ue){Va(r,t).then(()=>e()).catch(e)}u(Up,"lchmod");function Mp(r,t,e,i=Ue){Ka(r,t,e).then(()=>i()).catch(i)}u(Mp,"utimes");function jp(r,t,e,i=Ue){Ga(r,t,e).then(()=>i()).catch(i)}u(jp,"lutimes");function zp(r,t,e=Ue){let i=typeof t=="object"?t:{};e=typeof t=="function"?t:e,Ki(r,typeof t=="function"?null:t).then(n=>e(null,n)).catch(e)}u(zp,"realpath");function $p(r,t,e=Ue){let i=typeof t=="number"?t:4;e=typeof t=="function"?t:e,Ya(r,typeof t=="function"?null:t).then(()=>e()).catch(e)}u($p,"access");function Zp(r,t,e=Ue){throw new T(95)}u(Zp,"watchFile");function Wp(r,t=Ue){throw new T(95)}u(Wp,"unwatchFile");function Hp(r,t,e=Ue){throw new T(95)}u(Hp,"watch");function qp(r,t){throw new T(95)}u(qp,"createReadStream");function Vp(r,t){throw new T(95)}u(Vp,"createWriteStream");function ht(...[r,t,e,...i]){e=lt(e);let{fs:n,path:o}=Gt(t&&Gc(e)?Xa(e):e);try{return n[r](o,...i)}catch(a){throw Vr(a,{[o]:e})}}u(ht,"doOp");function Kp(r,t){r=lt(r),t=lt(t);let e=Gt(r),i=Gt(t),n={[e.path]:r,[i.path]:t};try{if(e===i)return e.fs.renameSync(e.path,i.path,Ce);let o=Xc(r);Jc(t,o),Yc(r)}catch(o){throw Vr(o,n)}}u(Kp,"renameSync");function Gc(r){r=lt(r);try{let{fs:t,path:e}=Gt(r);return t.existsSync(e,Ce)}catch(t){if(t.errno==2)return!1;throw t}}u(Gc,"existsSync");function Gp(r){return ht("statSync",!0,r,Ce)}u(Gp,"statSync");function Yp(r){return ht("statSync",!1,r,Ce)}u(Yp,"lstatSync");function Xp(r,t=0){if(t<0)throw new T(22);return ht("truncateSync",!0,r,t,Ce)}u(Xp,"truncateSync");function Yc(r){return ht("unlinkSync",!1,r,Ce)}u(Yc,"unlinkSync");function Jp(r,t,e=420){let i=ht("openSync",!0,r,We.getFileFlag(t),jt(e,420),Ce);return Kn(i)}u(Jp,"openSync");function Xc(r,t={}){let e=qr(t,null,"r",null),i=We.getFileFlag(e.flag);if(!i.isReadable())throw new T(22,"Flag passed to readFile must allow for reading.");return ht("readFileSync",!0,r,e.encoding,i,Ce)}u(Xc,"readFileSync");function Jc(r,t,e){let i=qr(e,"utf8","w",420),n=We.getFileFlag(i.flag);if(!n.isWriteable())throw new T(22,"Flag passed to writeFile must allow for writing.");return ht("writeFileSync",!0,r,t,i.encoding,n,i.mode,Ce)}u(Jc,"writeFileSync");function Qp(r,t,e){let i=qr(e,"utf8","a",420),n=We.getFileFlag(i.flag);if(!n.isAppendable())throw new T(22,"Flag passed to appendFile must allow for appending.");return ht("appendFileSync",!0,r,t,i.encoding,n,i.mode,Ce)}u(Qp,"appendFileSync");function em(r){return st(r).statSync()}u(em,"fstatSync");function tm(r){st(r).closeSync(),oi.delete(r)}u(tm,"closeSync");function rm(r,t=0){let e=st(r);if(t<0)throw new T(22);e.truncateSync(t)}u(rm,"ftruncateSync");function im(r){st(r).syncSync()}u(im,"fsyncSync");function nm(r){st(r).datasyncSync()}u(nm,"fdatasyncSync");function om(r,t,e,i,n){let o,a=0,l,m;if(typeof t=="string"){m=typeof e=="number"?e:null;let g=typeof i=="string"?i:"utf8";a=0,o=fe.from(t,g),l=o.length}else o=t,a=e,l=i,m=typeof n=="number"?n:null;let y=st(r);return m==null&&(m=y.getPos()),y.writeSync(o,a,l,m)}u(om,"writeSync");function am(r,t,e,i,n){let o=st(r),a=e;return typeof e=="object"&&({offset:a,length:i,position:n}=e),isNaN(+n)&&(n=o.getPos()),o.readSync(t,a,i,n)}u(am,"readSync");function sm(r,t,e){st(r).chownSync(t,e)}u(sm,"fchownSync");function um(r,t){let e=typeof t=="string"?parseInt(t,8):t;st(r).chmodSync(e)}u(um,"fchmodSync");function cm(r,t,e){st(r).utimesSync(Ct(t),Ct(e))}u(cm,"futimesSync");function lm(r){return ht("rmdirSync",!0,r,Ce)}u(lm,"rmdirSync");function fm(r,t){ht("mkdirSync",!0,r,jt(t,511),Ce)}u(fm,"mkdirSync");function hm(r){r=lt(r);let t=ht("readdirSync",!0,r,Ce),e=[...tr.keys()];for(let i of e)if(i.startsWith(r)){let n=i.slice(r.length);if(n.includes("/")||n.length==0)continue;t.push(n)}return t}u(hm,"readdirSync");function dm(r,t){return t=lt(t),ht("linkSync",!1,r,t,Ce)}u(dm,"linkSync");function pm(r,t,e){if(!["file","dir","junction"].includes(e))throw new T(22,"Invalid type: "+e);return t=lt(t),ht("symlinkSync",!1,r,t,e,Ce)}u(pm,"symlinkSync");function mm(r){return ht("readlinkSync",!1,r,Ce)}u(mm,"readlinkSync");function gm(r,t,e){ht("chownSync",!0,r,t,e,Ce)}u(gm,"chownSync");function ym(r,t,e){ht("chownSync",!1,r,t,e,Ce)}u(ym,"lchownSync");function bm(r,t){let e=jt(t,-1);if(e<0)throw new T(22,"Invalid mode.");ht("chmodSync",!0,r,e,Ce)}u(bm,"chmodSync");function wm(r,t){let e=jt(t,-1);if(e<1)throw new T(22,"Invalid mode.");ht("chmodSync",!1,r,e,Ce)}u(wm,"lchmodSync");function _m(r,t,e){ht("utimesSync",!0,r,Ct(t),Ct(e),Ce)}u(_m,"utimesSync");function vm(r,t,e){ht("utimesSync",!1,r,Ct(t),Ct(e),Ce)}u(vm,"lutimesSync");function Xa(r,t={}){r=lt(r);let{fs:e,path:i,mountPoint:n}=Gt(r);try{if(!e.statSync(i,Ce).isSymbolicLink())return r;let a=lt(n+e.readlinkSync(i,Ce));return Xa(a)}catch(o){throw Vr(o,{[i]:r})}}u(Xa,"realpathSync");function Em(r,t=384){return ht("accessSync",!0,r,t,Ce)}u(Em,"accessSync");var Sm=Yi,to=Sm;var ro=class{constructor(t){this.efs=t;this.nodefs=t.getNodeFS(),this.FS=t.getFS(),this.PATH=t.getPATH(),this.ERRNO_CODES=t.getERRNO_CODES()}open(t){let e=this.efs.realPath(t.node),i=this.FS;try{i.isFile(t.node.mode)&&(t.nfd=this.nodefs.openSync(e,this.efs.flagsToPermissionString(t.flags)))}catch(n){throw n.code?new i.ErrnoError(this.ERRNO_CODES[n.code]):n}}close(t){let e=this.FS;try{e.isFile(t.node.mode)&&t.nfd&&this.nodefs.closeSync(t.nfd)}catch(i){throw i.code?new e.ErrnoError(this.ERRNO_CODES[i.code]):i}}read(t,e,i,n,o){try{return this.nodefs.readSync(t.nfd,fe.from(e),i,n,o)}catch(a){throw new this.FS.ErrnoError(this.ERRNO_CODES[a.code])}}write(t,e,i,n,o){try{return this.nodefs.writeSync(t.nfd,fe.from(e),i,n,o)}catch(a){throw new this.FS.ErrnoError(this.ERRNO_CODES[a.code])}}llseek(t,e,i){let n=e;if(i===1)n+=t.position;else if(i===2&&this.FS.isFile(t.node.mode))try{let o=this.nodefs.fstatSync(t.nfd);n+=o.size}catch(o){throw new this.FS.ErrnoError(this.ERRNO_CODES[o.code])}if(n<0)throw new this.FS.ErrnoError(this.ERRNO_CODES.EINVAL);return t.position=n,n}};u(ro,"BFSEmscriptenStreamOps");var io=class{constructor(t){this._fs=t;this.nodefs=t.getNodeFS(),this.FS=t.getFS(),this.PATH=t.getPATH(),this.ERRNO_CODES=t.getERRNO_CODES()}getattr(t){let e=this._fs.realPath(t),i;try{i=this.nodefs.lstatSync(e)}catch(n){throw n.code?new this.FS.ErrnoError(this.ERRNO_CODES[n.code]):n}return{dev:i.dev,ino:i.ino,mode:i.mode,nlink:i.nlink,uid:i.uid,gid:i.gid,rdev:i.rdev,size:i.size,atime:i.atime,mtime:i.mtime,ctime:i.ctime,blksize:i.blksize,blocks:i.blocks}}setattr(t,e){let i=this._fs.realPath(t);try{if(e.mode!==void 0&&(this.nodefs.chmodSync(i,e.mode),t.mode=e.mode),e.timestamp!==void 0){let n=new Date(e.timestamp);this.nodefs.utimesSync(i,n,n)}}catch(n){if(!n.code)throw n;if(n.code!=="ENOTSUP")throw new this.FS.ErrnoError(this.ERRNO_CODES[n.code])}if(e.size!==void 0)try{this.nodefs.truncateSync(i,e.size)}catch(n){throw n.code?new this.FS.ErrnoError(this.ERRNO_CODES[n.code]):n}}lookup(t,e){let i=this.PATH.join2(this._fs.realPath(t),e),n=this._fs.getMode(i);return this._fs.createNode(t,e,n)}mknod(t,e,i,n){let o=this._fs.createNode(t,e,i,n),a=this._fs.realPath(o);try{this.FS.isDir(o.mode)?this.nodefs.mkdirSync(a,o.mode):this.nodefs.writeFileSync(a,"",{mode:o.mode})}catch(l){throw l.code?new this.FS.ErrnoError(this.ERRNO_CODES[l.code]):l}return o}rename(t,e,i){let n=this._fs.realPath(t),o=this.PATH.join2(this._fs.realPath(e),i);try{this.nodefs.renameSync(n,o),t.name=i,t.parent=e}catch(a){throw a.code?new this.FS.ErrnoError(this.ERRNO_CODES[a.code]):a}}unlink(t,e){let i=this.PATH.join2(this._fs.realPath(t),e);try{this.nodefs.unlinkSync(i)}catch(n){throw n.code?new this.FS.ErrnoError(this.ERRNO_CODES[n.code]):n}}rmdir(t,e){let i=this.PATH.join2(this._fs.realPath(t),e);try{this.nodefs.rmdirSync(i)}catch(n){throw n.code?new this.FS.ErrnoError(this.ERRNO_CODES[n.code]):n}}readdir(t){let e=this._fs.realPath(t);try{let i=this.nodefs.readdirSync(e);return i.push(".",".."),i}catch(i){throw i.code?new this.FS.ErrnoError(this.ERRNO_CODES[i.code]):i}}symlink(t,e,i){let n=this.PATH.join2(this._fs.realPath(t),e);try{this.nodefs.symlinkSync(i,n)}catch(o){throw o.code?new this.FS.ErrnoError(this.ERRNO_CODES[o.code]):o}}readlink(t){let e=this._fs.realPath(t);try{return this.nodefs.readlinkSync(e)}catch(i){throw i.code?new this.FS.ErrnoError(this.ERRNO_CODES[i.code]):i}}};u(io,"BFSEmscriptenEntryOps");var Ai=class{constructor(t=globalThis.FS,e=globalThis.PATH,i=globalThis.ERRNO_CODES,n=Yi){this.flagsToPermissionStringMap={0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"};this.nodefs=n,this.FS=t,this.PATH=e,this.ERRNO_CODES=i,this.node_ops=new io(this),this.stream_ops=new ro(this)}mount(t){return this.createNode(null,"/",this.getMode(t.opts.root),0)}createNode(t,e,i,n){let o=this.FS;if(!o.isDir(i)&&!o.isFile(i)&&!o.isLink(i))throw new o.ErrnoError(this.ERRNO_CODES.EINVAL);let a=o.createNode(t,e,i);return a.node_ops=this.node_ops,a.stream_ops=this.stream_ops,a}getMode(t){let e;try{e=this.nodefs.lstatSync(t)}catch(i){throw i.code?new this.FS.ErrnoError(this.ERRNO_CODES[i.code]):i}return e.mode}realPath(t){let e=[];for(;t.parent!==t;)e.push(t.name),t=t.parent;return e.push(t.mount.opts.root),e.reverse(),this.PATH.join.apply(null,e)}flagsToPermissionString(t){let e=typeof t=="string"?parseInt(t,10):t;return e&=8191,e in this.flagsToPermissionStringMap?this.flagsToPermissionStringMap[e]:t}getNodeFS(){return this.nodefs}getFS(){return this.FS}getPATH(){return this.PATH}getERRNO_CODES(){return this.ERRNO_CODES}};u(Ai,"BFSEmscriptenFS");var no=class extends Tt{constructor(t,e,i,n,o){super(t,e,i,n,o)}syncSync(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())}closeSync(){this.syncSync()}};u(no,"MirrorFile");var Xi=class extends kt{constructor({sync:e,async:i}){super();this._queue=[];this._queueRunning=!1;this._isInitialized=!1;this._initializeCallbacks=[];this._sync=e,this._async=i,this._ready=this._initialize()}static isAvailable(){return!0}get metadata(){return rt(Xe({},super.metadata),{name:Xi.Name,synchronous:!0,supportsProperties:this._sync.metadata.supportsProperties&&this._async.metadata.supportsProperties})}_syncSync(e){let i=e.getStats();this._sync.writeFileSync(e.getPath(),e.getBuffer(),null,We.getFileFlag("w"),i.mode,i.getCred(0,0)),this.enqueueOp({apiMethod:"writeFile",arguments:[e.getPath(),e.getBuffer(),null,e.getFlag(),i.mode,i.getCred(0,0)]})}renameSync(e,i,n){this._sync.renameSync(e,i,n),this.enqueueOp({apiMethod:"rename",arguments:[e,i,n]})}statSync(e,i){return this._sync.statSync(e,i)}openSync(e,i,n,o){return this._sync.openSync(e,i,n,o).closeSync(),new no(this,e,i,this._sync.statSync(e,o),this._sync.readFileSync(e,null,We.getFileFlag("r"),o))}unlinkSync(e,i){this._sync.unlinkSync(e,i),this.enqueueOp({apiMethod:"unlink",arguments:[e,i]})}rmdirSync(e,i){this._sync.rmdirSync(e,i),this.enqueueOp({apiMethod:"rmdir",arguments:[e,i]})}mkdirSync(e,i,n){this._sync.mkdirSync(e,i,n),this.enqueueOp({apiMethod:"mkdir",arguments:[e,i,n]})}readdirSync(e,i){return this._sync.readdirSync(e,i)}existsSync(e,i){return this._sync.existsSync(e,i)}chmodSync(e,i,n){this._sync.chmodSync(e,i,n),this.enqueueOp({apiMethod:"chmod",arguments:[e,i,n]})}chownSync(e,i,n,o){this._sync.chownSync(e,i,n,o),this.enqueueOp({apiMethod:"chown",arguments:[e,i,n,o]})}utimesSync(e,i,n,o){this._sync.utimesSync(e,i,n,o),this.enqueueOp({apiMethod:"utimes",arguments:[e,i,n,o]})}_initialize(){return C(this,null,function*(){if(!this._isInitialized){let e=u((o,a)=>C(this,null,function*(){if(o!=="/"){let m=yield this._async.stat(o,Ye.Root);this._sync.mkdirSync(o,a,m.getCred())}let l=yield this._async.readdir(o,Ye.Root);for(let m of l)yield n(Bt(o,m))}),"copyDirectory"),i=u((o,a)=>C(this,null,function*(){let l=yield this._async.readFile(o,null,We.getFileFlag("r"),Ye.Root);this._sync.writeFileSync(o,l,null,We.getFileFlag("w"),a,Ye.Root)}),"copyFile"),n=u(o=>C(this,null,function*(){let a=yield this._async.stat(o,Ye.Root);a.isDirectory()?yield e(o,a.mode):yield i(o,a.mode)}),"copyItem");try{yield e("/",0),this._isInitialized=!0}catch(o){throw this._isInitialized=!1,o}}return this})}enqueueOp(e){if(this._queue.push(e),!this._queueRunning){this._queueRunning=!0;let i=u(n=>{if(n)throw new Error(`WARNING: File system has desynchronized. Received following error: ${n} $`);if(this._queue.length>0){let o=this._queue.shift();o.arguments.push(i),this._async[o.apiMethod].apply(this._async,o.arguments)}else this._queueRunning=!1},"doNextOp");i()}}},Sr=Xi;u(Sr,"AsyncMirror"),Sr.Name="AsyncMirror",Sr.Create=Je.bind(Xi),Sr.Options={sync:{type:"object",description:"The synchronous file system to mirror the asynchronous file system to.",validator:e=>C(Xi,null,function*(){if(!(e!=null&&e.metadata.synchronous))throw new T(22,"'sync' option must be a file system that supports synchronous operations")})},async:{type:"object",description:"The asynchronous file system to mirror."}};function Fr(r){return r==="/"?"":r}u(Fr,"fixPath");function Kr(r){let t=r.error;if(t[".tag"])return t;if(t.error){let e=t.error;return e[".tag"]?e:e.reason&&e.reason[".tag"]?e.reason:e}else if(typeof t=="string")try{let e=JSON.parse(t);if(e.error&&e.error.reason&&e.error.reason[".tag"])return e.error.reason}catch(e){}return t}u(Kr,"extractError");function ut(r){if(r.user_message)return r.user_message.text;if(r.error_summary)return r.error_summary;if(typeof r.error=="string")return r.error;if(typeof r.error=="object")return ut(r.error);throw new Error(`Dropbox's servers gave us a garbage error message: ${JSON.stringify(r)}`)}u(ut,"getErrorMessage");function Ji(r,t,e){switch(r[".tag"]){case"malformed_path":return new T(9,e,t);case"not_found":return T.ENOENT(t);case"not_file":return T.EISDIR(t);case"not_folder":return T.ENOTDIR(t);case"restricted_content":return T.EPERM(t);case"other":default:return new T(5,e,t)}}u(Ji,"convertLookupError");function Ri(r,t,e){switch(r[".tag"]){case"malformed_path":case"disallowed_name":return new T(9,e,t);case"conflict":case"no_write_permission":case"team_folder":return T.EPERM(t);case"insufficient_space":return new T(28,e);case"other":default:return new T(5,e,t)}}u(Ri,"convertWriteError");function oo(r,t){return C(this,null,function*(){let e={path:Fr(t)};try{yield r.filesDeleteV2(e)}catch(i){let n=Kr(i);switch(n[".tag"]){case"path_lookup":throw Ji(n.path_lookup,t,ut(i));case"path_write":throw Ri(n.path_write,t,ut(i));case"too_many_write_operations":yield Vi(500),yield oo(r,t);break;case"other":default:throw new T(5,ut(i),t)}}})}u(oo,"deleteFiles");var Qi=class extends Tt{constructor(t,e,i,n,o){super(t,e,i,n,o)}sync(){return C(this,null,function*(){yield this._fs._syncFile(this.getPath(),this.getBuffer())})}close(){return C(this,null,function*(){yield this.sync()})}};u(Qi,"DropboxFile");var ao=class extends gt{constructor(e){super();this._client=e}static isAvailable(){return typeof globalThis.Dropbox!="undefined"}get metadata(){return rt(Xe({},super.metadata),{name:ao.Name})}empty(){return C(this,null,function*(){let e=yield this.readdir("/",Ye.Root);for(let i of e)yield oo(this._client,i)})}rename(e,i,n){return C(this,null,function*(){let o=u(()=>C(this,null,function*(){let a={from_path:Fr(e),to_path:Fr(i)};try{yield this._client.filesMoveV2(a)}catch(l){let m=Kr(l);switch(m[".tag"]){case"from_lookup":throw Ji(m.from_lookup,e,ut(l));case"from_write":throw Ri(m.from_write,e,ut(l));case"to":throw Ri(m.to,i,ut(l));case"cant_copy_shared_folder":case"cant_nest_shared_folder":throw new T(1,ut(l),e);case"cant_move_folder_into_itself":case"duplicated_or_nested_paths":throw new T(9,ut(l),e);case"too_many_files":throw new T(28,ut(l),e);case"other":default:throw new T(5,ut(l),e)}}}),"rename");try{if((yield this.stat(i,n)).isDirectory())throw T.EISDIR(i);yield this.unlink(i,n),o()}catch(a){if(e===i)throw T.ENOENT(i);o()}})}stat(e,i){return C(this,null,function*(){if(e==="/")return new Me(je.DIRECTORY,4096);let n={path:Fr(e)};try{let o=yield this._client.filesGetMetadata(n);switch(o[".tag"]){case"file":let a=o;return new Me(je.FILE,a.size);case"folder":return new Me(je.DIRECTORY,4096);case"deleted":throw T.ENOENT(e);default:throw new T(22,"Invalid file type",e)}}catch(o){let a=Kr(o);switch(a[".tag"]){case"path":throw Ji(a.path,e,ut(o));default:throw new T(5,ut(o),e)}}})}openFile(e,i,n){return C(this,null,function*(){let o={path:Fr(e)};try{let l=yield(yield this._client.filesDownload(o)).fileBlob.arrayBuffer();return new Qi(this,e,i,new Me(je.FILE,l.byteLength),fe.from(l))}catch(a){let l=Kr(a);switch(l[".tag"]){case"path":throw Ji(l.path,e,ut(a));case"other":default:throw new T(5,ut(a),e)}}})}createFile(e,i,n,o){return C(this,null,function*(){let a=fe.alloc(0),m={contents:new Blob([a],{type:"octet/stream"}),path:Fr(e)};try{let y=yield this._client.filesUpload(m);return new Qi(this,e,i,new Me(je.FILE,y.size,420,Date.now(),Date.parse(y.server_modified)),a)}catch(y){let g=Kr(y);switch(g[".tag"]){case"path":throw Ri(g.path.reason,e,ut(y));case"too_many_write_operations":yield Vi(500),yield this.createFile(e,i,n,o);break;case"other":default:throw new T(5,ut(y),e)}}})}unlink(e,i){return C(this,null,function*(){if((yield this.stat(e,i)).isDirectory())throw T.EISDIR(e);yield oo(this._client,e)})}rmdir(e,i){return C(this,null,function*(){if((yield this.readdir(e,i)).length>0)throw T.ENOTEMPTY(e);yield oo(this._client,e)})}mkdir(e,i,n){return C(this,null,function*(){let o=Ze(e),a=yield this.stat(o,n);if(a&&!a.isDirectory())throw T.ENOTDIR(o);let l={path:Fr(e)};try{yield this._client.filesCreateFolderV2(l)}catch(m){let y=Kr(m);if(y[".tag"]==="too_many_write_operations")yield Vi(500),yield this.mkdir(e,i,n);else throw Ri(y.path,e,ut(m))}})}readdir(e,i){return C(this,null,function*(){let n={path:Fr(e)};try{let o=yield this._client.filesListFolder(n);return yield el(this._client,o,e,[])}catch(o){throw Qc(o,e)}})}_syncFile(e,i){return C(this,null,function*(){let o={contents:new Blob([i],{type:"octet/stream"}),path:Fr(e),mode:{".tag":"overwrite"}};try{yield this._client.filesUpload(o)}catch(a){let l=Kr(a);switch(l[".tag"]){case"path":throw Ri(l.path.reason,e,ut(a));case"too_many_write_operations":yield Vi(500),yield this._syncFile(e,i);break;case"other":default:throw new T(5,ut(a),e)}}})}},xr=ao;u(xr,"DropboxFileSystem"),xr.Name="DropboxV2",xr.Create=Je.bind(ao),xr.Options={client:{type:"object",description:"An *authenticated* Dropbox client. Must be from the 2.5.x JS SDK."}};function Qc(r,t){let e=Kr(r);switch(e[".tag"]){case"path":return Ji(e.path,t,ut(r));case"other":default:return new T(5,ut(r),t)}}u(Qc,"convertListFolderError");function el(r,t,e,i){return C(this,null,function*(){try{let n=r.entries.map(l=>l.path_display).filter(l=>!!l),o=i.concat(n);if(!r.has_more)return o;let a={cursor:r.cursor};return yield t.filesListFolderContinue(a),yield el(t,r,e,o)}catch(n){throw Qc(n,e)}})}u(el,"_readdir");function it(r,t=""){let e=r.errno,i=r.node,n=[];for(;i&&(n.unshift(i.name),i!==i.parent);)i=i.parent;return new T(e,mt[e],n.length>0?"/"+n.join("/"):t)}u(it,"convertError");var so=class extends $r{constructor(e,i,n,o){super();this._fs=e;this._FS=i;this._path=n;this._stream=o}getPos(){}close(){return C(this,null,function*(){return this.closeSync()})}closeSync(){try{this._FS.close(this._stream)}catch(e){throw it(e,this._path)}}stat(){return C(this,null,function*(){return this.statSync()})}statSync(){try{return this._fs.statSync(this._path,Ye.Root)}catch(e){throw it(e,this._path)}}truncate(e){return C(this,null,function*(){return this.truncateSync(e)})}truncateSync(e){try{this._FS.ftruncate(this._stream.fd,e)}catch(i){throw it(i,this._path)}}write(e,i,n,o){return C(this,null,function*(){return this.writeSync(e,i,n,o)})}writeSync(e,i,n,o){try{let a=o===null?void 0:o;return this._FS.write(this._stream,e,i,n,a)}catch(a){throw it(a,this._path)}}read(e,i,n,o){return C(this,null,function*(){return{bytesRead:this.readSync(e,i,n,o),buffer:e}})}readSync(e,i,n,o){try{let a=o===null?void 0:o;return this._FS.read(this._stream,e,i,n,a)}catch(a){throw it(a,this._path)}}sync(){return C(this,null,function*(){this.syncSync()})}syncSync(){}chown(e,i){return C(this,null,function*(){return this.chownSync(e,i)})}chownSync(e,i){try{this._FS.fchown(this._stream.fd,e,i)}catch(n){throw it(n,this._path)}}chmod(e){return C(this,null,function*(){return this.chmodSync(e)})}chmodSync(e){try{this._FS.fchmod(this._stream.fd,e)}catch(i){throw it(i,this._path)}}utimes(e,i){return C(this,null,function*(){return this.utimesSync(e,i)})}utimesSync(e,i){this._fs.utimesSync(this._path,e,i,Ye.Root)}};u(so,"EmscriptenFile");var Ja=class extends kt{constructor({FS:e}){super();this._FS=e}static isAvailable(){return!0}get metadata(){return rt(Xe({},super.metadata),{name:this._FS.DB_NAME(),supportsProperties:!0,supportsLinks:!0})}renameSync(e,i,n){try{this._FS.rename(e,i)}catch(o){throw o.errno===2?it(o,this.existsSync(e,n)?i:e):it(o)}}statSync(e,i){try{let n=this._FS.stat(e),o=this.modeToFileType(n.mode);return new Me(o,n.size,n.mode,n.atime.getTime(),n.mtime.getTime(),n.ctime.getTime())}catch(n){throw it(n,e)}}openSync(e,i,n,o){try{let a=this._FS.open(e,i.getFlagString(),n);return new so(this,this._FS,e,a)}catch(a){throw it(a,e)}}unlinkSync(e,i){try{this._FS.unlink(e)}catch(n){throw it(n,e)}}rmdirSync(e,i){try{this._FS.rmdir(e)}catch(n){throw it(n,e)}}mkdirSync(e,i,n){try{this._FS.mkdir(e,i)}catch(o){throw it(o,e)}}readdirSync(e,i){try{return this._FS.readdir(e).filter(n=>n!=="."&&n!=="..")}catch(n){throw it(n,e)}}truncateSync(e,i,n){try{this._FS.truncate(e,i)}catch(o){throw it(o,e)}}readFileSync(e,i,n,o){try{let a=this._FS.readFile(e,{flags:n.getFlagString()}),l=fe.from(a);return i?l.toString(i):l}catch(a){throw it(a,e)}}writeFileSync(e,i,n,o,a,l){try{n&&(i=fe.from(i,n)),this._FS.writeFile(e,i,{flags:o.getFlagString(),encoding:"binary"}),this._FS.chmod(e,a)}catch(m){throw it(m,e)}}chmodSync(e,i,n){try{this._FS.chmod(e,i)}catch(o){throw it(o,e)}}chownSync(e,i,n,o){try{this._FS.chown(e,i,n)}catch(a){throw it(a,e)}}symlinkSync(e,i,n,o){try{this._FS.symlink(e,i)}catch(a){throw it(a)}}readlinkSync(e,i){try{return this._FS.readlink(e)}catch(n){throw it(n,e)}}utimesSync(e,i,n,o){try{this._FS.utime(e,i.getTime(),n.getTime())}catch(a){throw it(a,e)}}modeToFileType(e){if(this._FS.isDir(e))return je.DIRECTORY;if(this._FS.isFile(e))return je.FILE;if(this._FS.isLink(e))return je.SYMLINK;throw T.EPERM(`Invalid mode: ${e}`)}},Ir=Ja;u(Ir,"EmscriptenFileSystem"),Ir.Name="EmscriptenFileSystem",Ir.Create=Je.bind(Ja),Ir.Options={FS:{type:"object",description:"The Emscripten file system to use (the `FS` variable)"}};var uo=u((r="",t)=>{throw t.name==="NotFoundError"?T.ENOENT(r):t},"handleError"),co=class extends Tt{constructor(t,e,i,n,o){super(t,e,i,n,o)}sync(){return C(this,null,function*(){this.isDirty()&&(yield this._fs._sync(this.getPath(),this.getBuffer(),this.getStats(),Ye.Root),this.resetDirty())})}close(){return C(this,null,function*(){yield this.sync()})}};u(co,"FileSystemAccessFile");var lo=class extends gt{constructor({handle:e}){super();this._handles={"/":e}}static isAvailable(){return typeof FileSystemHandle=="function"}get metadata(){return rt(Xe({},super.metadata),{name:lo.Name})}_sync(e,i,n,o){return C(this,null,function*(){let a=yield this.stat(e,o);n.mtime!==a.mtime&&(yield this.writeFile(e,i,null,We.getFileFlag("w"),a.mode,o))})}rename(e,i,n){return C(this,null,function*(){try{let o=yield this.getHandle(e);if(o instanceof FileSystemDirectoryHandle){let a=yield this.readdir(e,n);if(yield this.mkdir(i,"wx",n),a.length===0)yield this.unlink(e,n);else for(let l of a)yield this.rename(Bt(e,l),Bt(i,l),n),yield this.unlink(e,n)}if(o instanceof FileSystemFileHandle){let a=yield o.getFile(),l=yield this.getHandle(Ze(i));if(l instanceof FileSystemDirectoryHandle){let y=yield(yield l.getFileHandle(_t(i),{create:!0})).createWritable(),g=yield a.arrayBuffer();yield y.write(g),y.close(),yield this.unlink(e,n)}}}catch(o){uo(e,o)}})}writeFile(e,i,n,o,a,l,m){return C(this,null,function*(){let y=yield this.getHandle(Ze(e));if(y instanceof FileSystemDirectoryHandle){let w=yield(yield y.getFileHandle(_t(e),{create:!0})).createWritable();yield w.write(i),yield w.close()}})}readFile(e,i,n){return C(this,null,function*(){let o=yield this.getHandle(e);return o instanceof FileSystemFileHandle?yield(yield o.getFile()).text():""})}createFile(e,i,n,o){return C(this,null,function*(){return yield this.writeFile(e,fe.alloc(0),null,i,n,o,!0),this.openFile(e,i,o)})}stat(e,i){return C(this,null,function*(){let n=yield this.getHandle(e);if(!n)throw T.FileError(22,e);if(n instanceof FileSystemDirectoryHandle)return new Me(je.DIRECTORY,4096);if(n instanceof FileSystemFileHandle){let{lastModified:o,size:a}=yield n.getFile();return new Me(je.FILE,a,void 0,void 0,o)}})}exists(e,i){return C(this,null,function*(){try{return yield this.getHandle(e),!0}catch(n){return!1}})}openFile(e,i,n){return C(this,null,function*(){let o=yield this.getHandle(e);if(o instanceof FileSystemFileHandle){let a=yield o.getFile(),l=yield a.arrayBuffer();return this.newFile(e,i,l,a.size,a.lastModified)}})}unlink(e,i){return C(this,null,function*(){let n=yield this.getHandle(Ze(e));if(n instanceof FileSystemDirectoryHandle)try{yield n.removeEntry(_t(e),{recursive:!0})}catch(o){uo(e,o)}})}rmdir(e,i){return C(this,null,function*(){return this.unlink(e,i)})}mkdir(e,i,n){return C(this,null,function*(){let o=i&&i.flag&&i.flag.includes("w")&&!i.flag.includes("x"),a=null;try{a=yield this.getHandle(e)}catch(m){}if(a&&!o)throw T.EEXIST(e);let l=yield this.getHandle(Ze(e));l instanceof FileSystemDirectoryHandle&&(yield l.getDirectoryHandle(_t(e),{create:!0}))})}readdir(e,i){return C(this,null,function*(){let n=yield this.getHandle(e);if(n instanceof FileSystemDirectoryHandle){let y=[];try{for(var o=vu(n.keys()),a,l,m;a=!(l=yield o.next()).done;a=!1){let g=l.value;y.push(g)}}catch(l){m=[l]}finally{try{a&&(l=o.return)&&(yield l.call(o))}finally{if(m)throw m[0]}}return y}})}newFile(e,i,n,o,a){return new co(this,e,i,new Me(je.FILE,o||0,void 0,void 0,a||new Date().getTime()),fe.from(n))}getHandle(e){return C(this,null,function*(){if(e==="/")return this._handles["/"];let i="/",[,...n]=e.split("/"),o=u(m=>C(this,[m],function*([a,...l]){let y=i,g=u(v=>C(this,null,function*(){return i=Bt(i,a),this._handles[i]=v,l.length===0?this._handles[i]:yield o(l)}),"continueWalk"),w=this._handles[i];try{return yield g(yield w.getDirectoryHandle(a))}catch(v){if(v.name==="TypeMismatchError")try{return yield g(yield w.getFileHandle(a))}catch(S){uo(y,S)}else{if(v.message==="Name is not allowed.")throw new T(2,v.message,y);uo(y,v)}}}),"getHandleParts");return yield o(n)})}},Tr=lo;u(Tr,"FileSystemAccessFileSystem"),Tr.Name="FileSystemAccess",Tr.Create=Je.bind(lo),Tr.Options={};var Qa=class extends gt{constructor({folder:e,wrapped:i}){super();this._folder=e,this._wrapped=i,this._ready=this._initialize()}static isAvailable(){return!0}get metadata(){return rt(Xe(Xe({},super.metadata),this._wrapped.metadata),{supportsLinks:!1})}_initialize(){return C(this,null,function*(){if(!(yield this._wrapped.exists(this._folder,Ye.Root))&&this._wrapped.metadata.readonly)throw T.ENOENT(this._folder);return yield this._wrapped.mkdir(this._folder,511,Ye.Root),this})}},rr=Qa;u(rr,"FolderAdapter"),rr.Name="FolderAdapter",rr.Create=Je.bind(Qa),rr.Options={folder:{type:"string",description:"The folder to use as the root directory"},wrapped:{type:"object",description:"The file system to wrap"}};function tl(r,t){if(t!==null&&typeof t=="object"){let e=t,i=e.path;i&&(i="/"+zc(r,i),e.message=e.message.replace(e.path,i),e.path=i)}return t}u(tl,"translateError");function Fm(r,t){return typeof t=="function"?function(e){arguments.length>0&&(arguments[0]=tl(r,e)),t.apply(null,arguments)}:t}u(Fm,"wrapCallback");function rl(r,t,e){return r.slice(r.length-4)!=="Sync"?function(){return arguments.length>0&&(t&&(arguments[0]=Bt(this._folder,arguments[0])),e&&(arguments[1]=Bt(this._folder,arguments[1])),arguments[arguments.length-1]=Fm(this._folder,arguments[arguments.length-1])),this._wrapped[r].apply(this._wrapped,arguments)}:function(){try{return t&&(arguments[0]=Bt(this._folder,arguments[0])),e&&(arguments[1]=Bt(this._folder,arguments[1])),this._wrapped[r].apply(this._wrapped,arguments)}catch(i){throw tl(this._folder,i)}}}u(rl,"wrapFunction");["diskSpace","stat","statSync","open","openSync","unlink","unlinkSync","rmdir","rmdirSync","mkdir","mkdirSync","readdir","readdirSync","exists","existsSync","realpath","realpathSync","truncate","truncateSync","readFile","readFileSync","writeFile","writeFileSync","appendFile","appendFileSync","chmod","chmodSync","chown","chownSync","utimes","utimesSync","readlink","readlinkSync"].forEach(r=>{rr.prototype[r]=rl(r,!0,!1)});["rename","renameSync","link","linkSync","symlink","symlinkSync"].forEach(r=>{rr.prototype[r]=rl(r,!0,!0)});var xm=(()=>{try{return globalThis.indexedDB||globalThis.mozIndexedDB||globalThis.webkitIndexedDB||globalThis.msIndexedDB}catch(r){return null}})();function en(r,t=r.toString()){switch(r.name){case"NotFoundError":return new T(2,t);case"QuotaExceededError":return new T(28,t);default:return new T(5,t)}}u(en,"convertError");function rn(r,t=5,e=null){return function(i){i.preventDefault(),r(new T(t,e!==null?e:void 0))}}u(rn,"onErrorHandler");var tn=class{constructor(t,e){this.tx=t;this.store=e}get(t){return new Promise((e,i)=>{try{let n=this.store.get(t);n.onerror=rn(i),n.onsuccess=o=>{let a=o.target.result;e(a===void 0?a:fe.from(a))}}catch(n){i(en(n))}})}};u(tn,"IndexedDBROTransaction");var fo=class extends tn{constructor(t,e){super(t,e)}put(t,e,i){return new Promise((n,o)=>{try{let a=i?this.store.put(e,t):this.store.add(e,t);a.onerror=rn(o),a.onsuccess=()=>{n(!0)}}catch(a){o(en(a))}})}del(t){return new Promise((e,i)=>{try{let n=this.store.delete(t);n.onerror=rn(i),n.onsuccess=()=>{e()}}catch(n){i(en(n))}})}commit(){return new Promise(t=>{setTimeout(t,0)})}abort(){return new Promise((t,e)=>{try{this.tx.abort(),t()}catch(i){e(en(i))}})}};u(fo,"IndexedDBRWTransaction");var Oi=class{constructor(t,e){this.db=t;this.storeName=e}static Create(t,e){return new Promise((i,n)=>{let o=e.open(t,1);o.onupgradeneeded=a=>{let l=a.target.result;l.objectStoreNames.contains(t)&&l.deleteObjectStore(t),l.createObjectStore(t)},o.onsuccess=a=>{i(new Oi(a.target.result,t))},o.onerror=rn(n,13)})}name(){return ur.Name+" - "+this.storeName}clear(){return new Promise((t,e)=>{try{let i=this.db.transaction(this.storeName,"readwrite"),n=i.objectStore(this.storeName),o=n.clear();o.onsuccess=()=>{setTimeout(t,0)},o.onerror=rn(e)}catch(i){e(en(i))}})}beginTransaction(t="readonly"){let e=this.db.transaction(this.storeName,t),i=e.objectStore(this.storeName);if(t==="readwrite")return new fo(e,i);if(t==="readonly")return new tn(e,i);throw new T(22,"Invalid transaction type.")}};u(Oi,"IndexedDBStore");var es=class extends Ti{static isAvailable(t=globalThis.indexedDB){try{if(!(t instanceof IDBFactory)||!xm.open("__browserfs_test__"))return!1}catch(e){return!1}}constructor({cacheSize:t=100,storeName:e="browserfs",idbFactory:i=globalThis.indexedDB}){super(t),this._ready=Oi.Create(e,i).then(n=>(this.init(n),this))}},ur=es;u(ur,"IndexedDBFileSystem"),ur.Name="IndexedDB",ur.Create=Je.bind(es),ur.Options={storeName:{type:"string",optional:!0,description:"The name of this file system. You can have multiple IndexedDB file systems operating at once, but each must have a different name."},cacheSize:{type:"number",optional:!0,description:"The size of the inode cache. Defaults to 100. A size of 0 or below disables caching."},idbFactory:{type:"object",optional:!0,description:"The IDBFactory to use. Defaults to globalThis.indexedDB."}};var ho=class{constructor(t){this._storage=t}name(){return cr.Name}clear(){this._storage.clear()}beginTransaction(t){return new Wr(this)}get(t){let e=this._storage.getItem(t);if(typeof e=="string")return fe.from(e)}put(t,e,i){try{return!i&&this._storage.getItem(t)!==null?!1:(this._storage.setItem(t,e.toString()),!0)}catch(n){throw new T(28,"Storage is full.")}}del(t){try{this._storage.removeItem(t)}catch(e){throw new T(5,"Unable to delete key "+t+": "+e)}}};u(ho,"StorageStore");var ts=class extends Hr{static isAvailable(t=globalThis.localStorage){return t instanceof Storage}constructor({storage:t=globalThis.localStorage}){super({store:new ho(t)})}},cr=ts;u(cr,"StorageFileSystem"),cr.Name="Storage",cr.Create=Je.bind(ts),cr.Options={storage:{type:"object",optional:!0,description:"The Storage to use. Defaults to globalThis.localStorage."}};var Bi=class{constructor(){this._locks=new Map}lock(t){return new Promise(e=>{this._locks.has(t)?this._locks.get(t).push(e):this._locks.set(t,[])})}unlock(t){if(!this._locks.has(t))throw new Error("unlock of a non-locked mutex");let e=this._locks.get(t).shift();if(e){setTimeout(e,0);return}this._locks.delete(t)}tryLock(t){return this._locks.has(t)?!1:(this._locks.set(t,[]),!0)}isLocked(t){return this._locks.has(t)}};u(Bi,"Mutex");var ki=class{constructor(t){this._ready=Promise.resolve(this);this._fs=t,this._mu=new Bi}whenReady(){return this._ready}get metadata(){return rt(Xe({},this._fs.metadata),{name:"LockedFS<"+this._fs.metadata.name+">"})}get fs(){return this._fs}rename(t,e,i){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.rename(t,e,i),this._mu.unlock(t)})}renameSync(t,e,i){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.renameSync(t,e,i)}stat(t,e){return C(this,null,function*(){yield this._mu.lock(t);let i=yield this._fs.stat(t,e);return this._mu.unlock(t),i})}statSync(t,e){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.statSync(t,e)}access(t,e,i){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.access(t,e,i),this._mu.unlock(t)})}accessSync(t,e,i){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.accessSync(t,e,i)}open(t,e,i,n){return C(this,null,function*(){yield this._mu.lock(t);let o=yield this._fs.open(t,e,i,n);return this._mu.unlock(t),o})}openSync(t,e,i,n){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.openSync(t,e,i,n)}unlink(t,e){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.unlink(t,e),this._mu.unlock(t)})}unlinkSync(t,e){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.unlinkSync(t,e)}rmdir(t,e){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.rmdir(t,e),this._mu.unlock(t)})}rmdirSync(t,e){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.rmdirSync(t,e)}mkdir(t,e,i){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.mkdir(t,e,i),this._mu.unlock(t)})}mkdirSync(t,e,i){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.mkdirSync(t,e,i)}readdir(t,e){return C(this,null,function*(){yield this._mu.lock(t);let i=yield this._fs.readdir(t,e);return this._mu.unlock(t),i})}readdirSync(t,e){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.readdirSync(t,e)}exists(t,e){return C(this,null,function*(){yield this._mu.lock(t);let i=yield this._fs.exists(t,e);return this._mu.unlock(t),i})}existsSync(t,e){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.existsSync(t,e)}realpath(t,e){return C(this,null,function*(){yield this._mu.lock(t);let i=yield this._fs.realpath(t,e);return this._mu.unlock(t),i})}realpathSync(t,e){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.realpathSync(t,e)}truncate(t,e,i){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.truncate(t,e,i),this._mu.unlock(t)})}truncateSync(t,e,i){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.truncateSync(t,e,i)}readFile(t,e,i,n){return C(this,null,function*(){yield this._mu.lock(t);let o=yield this._fs.readFile(t,e,i,n);return this._mu.unlock(t),o})}readFileSync(t,e,i,n){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.readFileSync(t,e,i,n)}writeFile(t,e,i,n,o,a){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.writeFile(t,e,i,n,o,a),this._mu.unlock(t)})}writeFileSync(t,e,i,n,o,a){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.writeFileSync(t,e,i,n,o,a)}appendFile(t,e,i,n,o,a){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.appendFile(t,e,i,n,o,a),this._mu.unlock(t)})}appendFileSync(t,e,i,n,o,a){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.appendFileSync(t,e,i,n,o,a)}chmod(t,e,i){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.chmod(t,e,i),this._mu.unlock(t)})}chmodSync(t,e,i){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.chmodSync(t,e,i)}chown(t,e,i,n){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.chown(t,e,i,n),this._mu.unlock(t)})}chownSync(t,e,i,n){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.chownSync(t,e,i,n)}utimes(t,e,i,n){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.utimes(t,e,i,n),this._mu.unlock(t)})}utimesSync(t,e,i,n){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.utimesSync(t,e,i,n)}link(t,e,i){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.link(t,e,i),this._mu.unlock(t)})}linkSync(t,e,i){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.linkSync(t,e,i)}symlink(t,e,i,n){return C(this,null,function*(){yield this._mu.lock(t),yield this._fs.symlink(t,e,i,n),this._mu.unlock(t)})}symlinkSync(t,e,i,n){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.symlinkSync(t,e,i,n)}readlink(t,e){return C(this,null,function*(){yield this._mu.lock(t);let i=yield this._fs.readlink(t,e);return this._mu.unlock(t),i})}readlinkSync(t,e){if(this._mu.isLocked(t))throw new Error("invalid sync call");return this._fs.readlinkSync(t,e)}};u(ki,"LockedFS");var Ar="/.deletedFiles.log";function il(r){return 146|r}u(il,"makeModeWritable");function zt(r){return We.getFileFlag(r)}u(zt,"getFlag");var nn=class extends Tt{constructor(t,e,i,n,o){super(t,e,i,n,o)}sync(){return C(this,null,function*(){this.isDirty()&&(yield this._fs._syncAsync(this),this.resetDirty())})}syncSync(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())}close(){return C(this,null,function*(){yield this.sync()})}closeSync(){this.syncSync()}};u(nn,"OverlayFile");var on=class extends gt{constructor({writable:e,readable:i}){super();this._isInitialized=!1;this._deletedFiles={};this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;this._deleteLogError=null;if(this._writable=e,this._readable=i,this._writable.metadata.readonly)throw new T(22,"Writable file system must be writable.")}static isAvailable(){return!0}get metadata(){return rt(Xe({},super.metadata),{name:lr.Name,synchronous:this._readable.metadata.synchronous&&this._writable.metadata.synchronous,supportsProperties:this._readable.metadata.supportsProperties&&this._writable.metadata.supportsProperties})}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}_syncAsync(e){return C(this,null,function*(){let i=e.getStats();return yield this.createParentDirectoriesAsync(e.getPath(),i.getCred(0,0)),this._writable.writeFile(e.getPath(),e.getBuffer(),null,zt("w"),i.mode,i.getCred(0,0))})}_syncSync(e){let i=e.getStats();this.createParentDirectories(e.getPath(),i.getCred(0,0)),this._writable.writeFileSync(e.getPath(),e.getBuffer(),null,zt("w"),i.mode,i.getCred(0,0))}_initialize(){return C(this,null,function*(){if(!this._isInitialized){try{let e=yield this._writable.readFile(Ar,"utf8",zt("r"),Ye.Root);this._deleteLog=e}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}})}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,i){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",i)}rename(e,i,n){return C(this,null,function*(){if(this.checkInitialized(),this.checkPath(e),this.checkPath(i),e===Ar||i===Ar)throw T.EPERM("Cannot rename deletion log.");let o=yield this.stat(e,n);if(o.isDirectory()){if(e===i)return;let a=511;if(yield this.exists(i,n)){let l=yield this.stat(i,n);if(a=l.mode,l.isDirectory()){if((yield this.readdir(i,n)).length>0)throw T.ENOTEMPTY(i)}else throw T.ENOTDIR(i)}if((yield this._writable.exists(e,n))?yield this._writable.rename(e,i,n):(yield this._writable.exists(i,n))||(yield this._writable.mkdir(i,a,n)),yield this._readable.exists(e,n))for(let l of yield this._readable.readdir(e,n))yield this.rename(qt(e,l),qt(i,l),n)}else{if((yield this.exists(i,n))&&(yield this.stat(i,n)).isDirectory())throw T.EISDIR(i);yield this.writeFile(i,yield this.readFile(e,null,zt("r"),n),null,zt("w"),o.mode,n)}e!==i&&(yield this.exists(e,n))&&(yield this.unlink(e,n))})}renameSync(e,i,n){if(this.checkInitialized(),this.checkPath(e),this.checkPath(i),e===Ar||i===Ar)throw T.EPERM("Cannot rename deletion log.");let o=this.statSync(e,n);if(o.isDirectory()){if(e===i)return;let a=511;if(this.existsSync(i,n)){let l=this.statSync(i,n);if(a=l.mode,l.isDirectory()){if(this.readdirSync(i,n).length>0)throw T.ENOTEMPTY(i)}else throw T.ENOTDIR(i)}this._writable.existsSync(e,n)?this._writable.renameSync(e,i,n):this._writable.existsSync(i,n)||this._writable.mkdirSync(i,a,n),this._readable.existsSync(e,n)&&this._readable.readdirSync(e,n).forEach(l=>{this.renameSync(qt(e,l),qt(i,l),n)})}else{if(this.existsSync(i,n)&&this.statSync(i,n).isDirectory())throw T.EISDIR(i);this.writeFileSync(i,this.readFileSync(e,null,zt("r"),n),null,zt("w"),o.mode,n)}e!==i&&this.existsSync(e,n)&&this.unlinkSync(e,n)}stat(e,i){return C(this,null,function*(){this.checkInitialized();try{return this._writable.stat(e,i)}catch(n){if(this._deletedFiles[e])throw T.ENOENT(e);let o=Me.clone(yield this._readable.stat(e,i));return o.mode=il(o.mode),o}})}statSync(e,i){this.checkInitialized();try{return this._writable.statSync(e,i)}catch(n){if(this._deletedFiles[e])throw T.ENOENT(e);let o=Me.clone(this._readable.statSync(e,i));return o.mode=il(o.mode),o}}open(e,i,n,o){return C(this,null,function*(){if(this.checkInitialized(),this.checkPath(e),e===Ar)throw T.EPERM("Cannot open deletion log.");if(yield this.exists(e,o))switch(i.pathExistsAction()){case 2:return yield this.createParentDirectoriesAsync(e,o),this._writable.open(e,i,n,o);case 0:if(yield this._writable.exists(e,o))return this._writable.open(e,i,n,o);{let a=yield this._readable.readFile(e,null,zt("r"),o),l=Me.clone(yield this._readable.stat(e,o));return l.mode=n,new nn(this,e,i,l,a)}default:throw T.EEXIST(e)}else switch(i.pathNotExistsAction()){case 3:return yield this.createParentDirectoriesAsync(e,o),this._writable.open(e,i,n,o);default:throw T.ENOENT(e)}})}openSync(e,i,n,o){if(this.checkInitialized(),this.checkPath(e),e===Ar)throw T.EPERM("Cannot open deletion log.");if(this.existsSync(e,o))switch(i.pathExistsAction()){case 2:return this.createParentDirectories(e,o),this._writable.openSync(e,i,n,o);case 0:if(this._writable.existsSync(e,o))return this._writable.openSync(e,i,n,o);{let a=this._readable.readFileSync(e,null,zt("r"),o),l=Me.clone(this._readable.statSync(e,o));return l.mode=n,new nn(this,e,i,l,a)}default:throw T.EEXIST(e)}else switch(i.pathNotExistsAction()){case 3:return this.createParentDirectories(e,o),this._writable.openSync(e,i,n,o);default:throw T.ENOENT(e)}}unlink(e,i){return C(this,null,function*(){if(this.checkInitialized(),this.checkPath(e),yield this.exists(e,i))(yield this._writable.exists(e,i))&&(yield this._writable.unlink(e,i)),(yield this.exists(e,i))&&this.deletePath(e,i);else throw T.ENOENT(e)})}unlinkSync(e,i){if(this.checkInitialized(),this.checkPath(e),this.existsSync(e,i))this._writable.existsSync(e,i)&&this._writable.unlinkSync(e,i),this.existsSync(e,i)&&this.deletePath(e,i);else throw T.ENOENT(e)}rmdir(e,i){return C(this,null,function*(){if(this.checkInitialized(),yield this.exists(e,i)){if((yield this._writable.exists(e,i))&&(yield this._writable.rmdir(e,i)),yield this.exists(e,i)){if((yield this.readdir(e,i)).length>0)throw T.ENOTEMPTY(e);this.deletePath(e,i)}}else throw T.ENOENT(e)})}rmdirSync(e,i){if(this.checkInitialized(),this.existsSync(e,i)){if(this._writable.existsSync(e,i)&&this._writable.rmdirSync(e,i),this.existsSync(e,i)){if(this.readdirSync(e,i).length>0)throw T.ENOTEMPTY(e);this.deletePath(e,i)}}else throw T.ENOENT(e)}mkdir(e,i,n){return C(this,null,function*(){if(this.checkInitialized(),yield this.exists(e,n))throw T.EEXIST(e);yield this.createParentDirectoriesAsync(e,n),yield this._writable.mkdir(e,i,n)})}mkdirSync(e,i,n){if(this.checkInitialized(),this.existsSync(e,n))throw T.EEXIST(e);this.createParentDirectories(e,n),this._writable.mkdirSync(e,i,n)}readdir(e,i){return C(this,null,function*(){if(this.checkInitialized(),!(yield this.stat(e,i)).isDirectory())throw T.ENOTDIR(e);let o=[];try{o=o.concat(yield this._writable.readdir(e,i))}catch(l){}try{o=o.concat((yield this._readable.readdir(e,i)).filter(l=>!this._deletedFiles[`${e}/${l}`]))}catch(l){}let a={};return o.filter(l=>{let m=!a[l];return a[l]=!0,m})})}readdirSync(e,i){if(this.checkInitialized(),!this.statSync(e,i).isDirectory())throw T.ENOTDIR(e);let o=[];try{o=o.concat(this._writable.readdirSync(e,i))}catch(l){}try{o=o.concat(this._readable.readdirSync(e,i).filter(l=>!this._deletedFiles[`${e}/${l}`]))}catch(l){}let a={};return o.filter(l=>{let m=!a[l];return a[l]=!0,m})}exists(e,i){return C(this,null,function*(){return this.checkInitialized(),(yield this._writable.exists(e,i))||(yield this._readable.exists(e,i))&&this._deletedFiles[e]!==!0})}existsSync(e,i){return this.checkInitialized(),this._writable.existsSync(e,i)||this._readable.existsSync(e,i)&&this._deletedFiles[e]!==!0}chmod(e,i,n){return C(this,null,function*(){this.checkInitialized(),yield this.operateOnWritableAsync(e,n),yield this._writable.chmod(e,i,n)})}chmodSync(e,i,n){this.checkInitialized(),this.operateOnWritable(e,n),this._writable.chmodSync(e,i,n)}chown(e,i,n,o){return C(this,null,function*(){this.checkInitialized(),yield this.operateOnWritableAsync(e,o),yield this._writable.chown(e,i,n,o)})}chownSync(e,i,n,o){this.checkInitialized(),this.operateOnWritable(e,o),this._writable.chownSync(e,i,n,o)}utimes(e,i,n,o){return C(this,null,function*(){this.checkInitialized(),yield this.operateOnWritableAsync(e,o),yield this._writable.utimes(e,i,n,o)})}utimesSync(e,i,n,o){this.checkInitialized(),this.operateOnWritable(e,o),this._writable.utimesSync(e,i,n,o)}deletePath(e,i){this._deletedFiles[e]=!0,this.updateLog(`d${e} `,i)}updateLog(e,i){this._deleteLog+=e,this._deleteLogUpdatePending?this._deleteLogUpdateNeeded=!0:(this._deleteLogUpdatePending=!0,this._writable.writeFile(Ar,this._deleteLog,"utf8",We.getFileFlag("w"),420,i).then(()=>{this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,this.updateLog("",i))}).catch(n=>{this._deleteLogError=n}).finally(()=>{this._deleteLogUpdatePending=!1}))}_reparseDeletionLog(){this._deletedFiles={},this._deleteLog.split(` `).forEach(e=>{this._deletedFiles[e.slice(1)]=e.slice(0,1)==="d"})}checkInitialized(){if(this._isInitialized){if(this._deleteLogError!==null){let e=this._deleteLogError;throw this._deleteLogError=null,e}}else throw new T(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.")}checkPath(e){if(e===Ar)throw T.EPERM(e)}createParentDirectories(e,i){let n=Ze(e),o=[];for(;!this._writable.existsSync(n,i);)o.push(n),n=Ze(n);o=o.reverse();for(let a of o)this._writable.mkdirSync(a,this.statSync(a,i).mode,i)}createParentDirectoriesAsync(e,i){return C(this,null,function*(){let n=Ze(e),o=[];for(;!(yield this._writable.exists(n,i));)o.push(n),n=Ze(n);o=o.reverse();for(let a of o){let l=yield this.stat(a,i);yield this._writable.mkdir(a,l.mode,i)}})}operateOnWritable(e,i){if(!this.existsSync(e,i))throw T.ENOENT(e);this._writable.existsSync(e,i)||this.copyToWritable(e,i)}operateOnWritableAsync(e,i){return C(this,null,function*(){if(!(yield this.exists(e,i)))throw T.ENOENT(e);if(!(yield this._writable.exists(e,i)))return this.copyToWritableAsync(e,i)})}copyToWritable(e,i){let n=this.statSync(e,i);n.isDirectory()?this._writable.mkdirSync(e,n.mode,i):this.writeFileSync(e,this._readable.readFileSync(e,null,zt("r"),i),null,zt("w"),n.mode,i)}copyToWritableAsync(e,i){return C(this,null,function*(){let n=yield this.stat(e,i);n.isDirectory()?yield this._writable.mkdir(e,n.mode,i):yield this.writeFile(e,yield this._readable.readFile(e,null,zt("r"),i),null,zt("w"),n.mode,i)})}};u(on,"UnlockedOverlayFS");var po=class extends ki{static isAvailable(){return on.isAvailable()}constructor(t){super(new on(t)),this._ready=this._initialize()}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}_initialize(){return C(this,null,function*(){return yield _u(po.prototype,this,"fs")._initialize(),this})}},lr=po;u(lr,"OverlayFS"),lr.Name="OverlayFS",lr.Create=Je.bind(po),lr.Options={writable:{type:"object",description:"The file system to write modified files to."},readable:{type:"object",description:"The file system that initially populates this file system."}};function Im(r){return typeof r=="object"&&"isBFS"in r&&!!r.isBFS}u(Im,"isRPCMessage");var an=class extends gt{constructor({worker:e}){super();this._currentID=0;this._requests=new Map;this._isInitialized=!1;this._worker=e,this._worker.onmessage=i=>{if(!Im(i.data))return;let{id:n,method:o,value:a}=i.data;if(o==="metadata"){this._metadata=a,this._isInitialized=!0;return}let{resolve:l,reject:m}=this._requests.get(n);if(this._requests.delete(n),a instanceof Error||a instanceof T){m(a);return}l(a)}}static isAvailable(){return typeof importScripts!="undefined"||typeof Worker!="undefined"}get metadata(){return rt(Xe(Xe({},super.metadata),this._metadata),{name:an.Name,synchronous:!1})}_rpc(e,...i){return C(this,null,function*(){return new Promise((n,o)=>{let a=this._currentID++;this._requests.set(a,{resolve:n,reject:o}),this._worker.postMessage({isBFS:!0,id:a,method:e,args:i})})})}rename(e,i,n){return this._rpc("rename",e,i,n)}stat(e,i){return this._rpc("stat",e,i)}open(e,i,n,o){return this._rpc("open",e,i,n,o)}unlink(e,i){return this._rpc("unlink",e,i)}rmdir(e,i){return this._rpc("rmdir",e,i)}mkdir(e,i,n){return this._rpc("mkdir",e,i,n)}readdir(e,i){return this._rpc("readdir",e,i)}exists(e,i){return this._rpc("exists",e,i)}realpath(e,i){return this._rpc("realpath",e,i)}truncate(e,i,n){return this._rpc("truncate",e,i,n)}readFile(e,i,n,o){return this._rpc("readFile",e,i,n,o)}writeFile(e,i,n,o,a,l){return this._rpc("writeFile",e,i,n,o,a,l)}appendFile(e,i,n,o,a,l){return this._rpc("appendFile",e,i,n,o,a,l)}chmod(e,i,n){return this._rpc("chmod",e,i,n)}chown(e,i,n,o){return this._rpc("chown",e,i,n,o)}utimes(e,i,n,o){return this._rpc("utimes",e,i,n,o)}link(e,i,n){return this._rpc("link",e,i,n)}symlink(e,i,n,o){return this._rpc("symlink",e,i,n,o)}readlink(e,i){return this._rpc("readlink",e,i)}syncClose(e,i){return this._rpc("syncClose",e,i)}},Rr=an;u(Rr,"WorkerFS"),Rr.Name="WorkerFS",Rr.Create=Je.bind(an),Rr.Options={worker:{type:"object",description:"The target worker that you want to connect to, or the current worker if in a worker context.",validator:e=>C(an,null,function*(){if(typeof(e==null?void 0:e.postMessage)!="function")throw new T(22,"option must be a Web Worker instance.")})}};var nl=typeof fetch!="undefined"&&fetch!==null;function mo(r){throw new T(5,r.message)}u(mo,"convertError");function rs(r,t){return C(this,null,function*(){let e=yield fetch(r).catch(mo);if(!e.ok)throw new T(5,`fetch error: response returned code ${e.status}`);switch(t){case"buffer":let i=yield e.arrayBuffer().catch(mo);return fe.from(i);case"json":return yield e.json().catch(mo);default:throw new T(22,"Invalid download type: "+t)}})}u(rs,"fetchFile");function ol(r){return C(this,null,function*(){let t=yield fetch(r,{method:"HEAD"}).catch(mo);if(!t.ok)throw new T(5,`fetch HEAD error: response returned code ${t.status}`);return parseInt(t.headers.get("Content-Length")||"-1",10)})}u(ol,"fetchFileSize");var hr=class{static fromListing(t){let e=new hr,i=new fr;e._index["/"]=i;let n=[["",t,i]];for(;n.length>0;){let o,a=n.pop(),l=a[0],m=a[1],y=a[2];for(let g in m)if(Object.prototype.hasOwnProperty.call(m,g)){let w=m[g],v=`${l}/${g}`;w?(e._index[v]=o=new fr,n.push([v,w,o])):o=new Ci(new Me(je.FILE,-1,365)),y&&(y._ls[g]=o)}}return e}constructor(){this._index={},this.addPath("/",new fr)}fileIterator(t){for(let e in this._index)if(Object.prototype.hasOwnProperty.call(this._index,e)){let i=this._index[e],n=i.getListing();for(let o of n){let a=i.getItem(o);Or(a)&&t(a.getData())}}}addPath(t,e){if(!e)throw new Error("Inode must be specified");if(t[0]!=="/")throw new Error("Path must be absolute, got: "+t);if(Object.prototype.hasOwnProperty.call(this._index,t))return this._index[t]===e;let i=this._split_path(t),n=i[0],o=i[1],a=this._index[n];return a===void 0&&t!=="/"&&(a=new fr,!this.addPath(n,a))||t!=="/"&&!a.addItem(o,e)?!1:($t(e)&&(this._index[t]=e),!0)}addPathFast(t,e){let i=t.lastIndexOf("/"),n=i===0?"/":t.substring(0,i),o=t.substring(i+1),a=this._index[n];return a===void 0&&(a=new fr,this.addPathFast(n,a)),a.addItem(o,e)?(e.isDir()&&(this._index[t]=e),!0):!1}removePath(t){let e=this._split_path(t),i=e[0],n=e[1],o=this._index[i];if(o===void 0)return null;let a=o.remItem(n);if(a===null)return null;if($t(a)){let l=a.getListing();for(let m of l)this.removePath(t+"/"+m);t!=="/"&&delete this._index[t]}return a}ls(t){let e=this._index[t];return e===void 0?null:e.getListing()}getInode(t){let e=this._split_path(t),i=e[0],n=e[1],o=this._index[i];return o===void 0?null:i===t?o:o.getItem(n)}_split_path(t){let e=Ze(t),i=t.substr(e.length+(e==="/"?0:1));return[e,i]}};u(hr,"FileIndex");var Ci=class{constructor(t){this.data=t}isFile(){return!0}isDir(){return!1}getData(){return this.data}setData(t){this.data=t}toStats(){return new Me(je.FILE,4096,438)}};u(Ci,"FileInode");var fr=class{constructor(t=null){this.data=t;this._ls={}}isFile(){return!1}isDir(){return!0}getData(){return this.data}getStats(){return new Me(je.DIRECTORY,4096,365)}toStats(){return this.getStats()}getListing(){return Object.keys(this._ls)}getItem(t){let e=this._ls[t];return e||null}addItem(t,e){return t in this._ls?!1:(this._ls[t]=e,!0)}remItem(t){let e=this._ls[t];return e===void 0?null:(delete this._ls[t],e)}};u(fr,"DirInode");function Or(r){return!!r&&r.isFile()}u(Or,"isFileInode");function $t(r){return!!r&&r.isDir()}u($t,"isDirInode");var go=class extends gt{constructor({index:e,baseUrl:i=""}){super();e||(e="index.json");let n=typeof e=="string"?rs(e,"json"):Promise.resolve(e);this._ready=n.then(o=>(this._index=hr.fromListing(o),this)),i.length>0&&i.charAt(i.length-1)!=="/"&&(i=i+"/"),this.prefixUrl=i,this._requestFileInternal=rs,this._requestFileSizeInternal=ol}static isAvailable(){return nl}get metadata(){return rt(Xe({},super.metadata),{name:go.Name,readonly:!0})}empty(){this._index.fileIterator(function(e){e.fileData=null})}preloadFile(e,i){let n=this._index.getInode(e);if(Or(n)){if(n===null)throw T.ENOENT(e);let o=n.getData();o.size=i.length,o.fileData=i}else throw T.EISDIR(e)}stat(e,i){return C(this,null,function*(){let n=this._index.getInode(e);if(n===null)throw T.ENOENT(e);if(!n.toStats().hasAccess(4,i))throw T.EACCES(e);let o;if(Or(n))o=n.getData(),o.size<0&&(o.size=yield this._requestFileSize(e));else if($t(n))o=n.getStats();else throw T.FileError(22,e);return o})}open(e,i,n,o){return C(this,null,function*(){if(i.isWriteable())throw new T(1,e);let a=this._index.getInode(e);if(a===null)throw T.ENOENT(e);if(!a.toStats().hasAccess(i.getMode(),o))throw T.EACCES(e);if(Or(a)||$t(a))switch(i.pathExistsAction()){case 1:case 2:throw T.EEXIST(e);case 0:if($t(a)){let y=a.getStats();return new er(this,e,i,y,y.fileData||void 0)}let l=a.getData();if(l.fileData)return new er(this,e,i,Me.clone(l),l.fileData);let m=yield this._requestFile(e,"buffer");return l.size=m.length,l.fileData=m,new er(this,e,i,Me.clone(l),m);default:throw new T(22,"Invalid FileMode object.")}else throw T.EPERM(e)})}readdir(e,i){return C(this,null,function*(){return this.readdirSync(e,i)})}readFile(e,i,n,o){return C(this,null,function*(){let a=yield this.open(e,n,420,o);try{let m=a.getBuffer();return i===null?ni(m):m.toString(i)}finally{yield a.close()}})}_getHTTPPath(e){return e.charAt(0)==="/"&&(e=e.slice(1)),this.prefixUrl+e}_requestFile(e,i){return this._requestFileInternal(this._getHTTPPath(e),i)}_requestFileSize(e){return this._requestFileSizeInternal(this._getHTTPPath(e))}},dr=go;u(dr,"HTTPRequest"),dr.Name="HTTPRequest",dr.Create=Je.bind(go),dr.Options={index:{type:["string","object"],optional:!0,description:"URL to a file index as a JSON file or the file index object itself, generated with the make_http_index script. Defaults to `index.json`."},baseUrl:{type:"string",optional:!0,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}};var dl,pl,Ni=typeof Reflect=="object"?Reflect:null,al=Ni&&typeof Ni.apply=="function"?Ni.apply:function(r,t,e){return Function.prototype.apply.call(r,t,e)};pl=Ni&&typeof Ni.ownKeys=="function"?Ni.ownKeys:Object.getOwnPropertySymbols?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:function(r){return Object.getOwnPropertyNames(r)};var sl=Number.isNaN||function(r){return r!=r};function Ge(){Ge.init.call(this)}u(Ge,"o");dl=Ge,Ge.EventEmitter=Ge,Ge.prototype._events=void 0,Ge.prototype._eventsCount=0,Ge.prototype._maxListeners=void 0;var ul=10;function yo(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}u(yo,"u");function ml(r){return r._maxListeners===void 0?Ge.defaultMaxListeners:r._maxListeners}u(ml,"f");function cl(r,t,e,i){var n,o,a,l;if(yo(e),(o=r._events)===void 0?(o=r._events=Object.create(null),r._eventsCount=0):(o.newListener!==void 0&&(r.emit("newListener",t,e.listener?e.listener:e),o=r._events),a=o[t]),a===void 0)a=o[t]=e,++r._eventsCount;else if(typeof a=="function"?a=o[t]=i?[e,a]:[a,e]:i?a.unshift(e):a.push(e),(n=ml(r))>0&&a.length>n&&!a.warned){a.warned=!0;var m=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");m.name="MaxListenersExceededWarning",m.emitter=r,m.type=t,m.count=a.length,l=m,console&&console.warn&&console.warn(l)}return r}u(cl,"v");function Tm(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}u(Tm,"a");function ll(r,t,e){var i={fired:!1,wrapFn:void 0,target:r,type:t,listener:e},n=Tm.bind(i);return n.listener=e,i.wrapFn=n,n}u(ll,"l");function fl(r,t,e){var i=r._events;if(i===void 0)return[];var n=i[t];return n===void 0?[]:typeof n=="function"?e?[n.listener||n]:[n]:e?function(o){for(var a=new Array(o.length),l=0;l0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=n[r];if(l===void 0)return!1;if(typeof l=="function")al(l,this,t);else{var m=l.length,y=gl(l,m);for(e=0;e=0;o--)if(e[o]===t||e[o].listener===t){a=e[o].listener,n=o;break}if(n<0)return this;n===0?e.shift():function(l,m){for(;m+1=0;i--)this.removeListener(r,t[i]);return this},Ge.prototype.listeners=function(r){return fl(this,r,!0)},Ge.prototype.rawListeners=function(r){return fl(this,r,!1)},Ge.listenerCount=function(r,t){return typeof r.listenerCount=="function"?r.listenerCount(t):hl.call(r,t)},Ge.prototype.listenerCount=hl,Ge.prototype.eventNames=function(){return this._eventsCount>0?pl(this._events):[]};var vt=dl;vt.EventEmitter;vt.defaultMaxListeners;vt.init;vt.listenerCount;vt.EventEmitter;vt.defaultMaxListeners;vt.init;vt.listenerCount;var bl,kr,Cr,Li=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:global,dt=bl={};function is(){throw new Error("setTimeout has not been defined")}u(is,"i");function ns(){throw new Error("clearTimeout has not been defined")}u(ns,"u");function wl(r){if(kr===setTimeout)return setTimeout(r,0);if((kr===is||!kr)&&setTimeout)return kr=setTimeout,setTimeout(r,0);try{return kr(r,0)}catch(t){try{return kr.call(null,r,0)}catch(e){return kr.call(this||Li,r,0)}}}u(wl,"c");(function(){try{kr=typeof setTimeout=="function"?setTimeout:is}catch(r){kr=is}try{Cr=typeof clearTimeout=="function"?clearTimeout:ns}catch(r){Cr=ns}})();var ai,Nr=[],Di=!1,bo=-1;function Am(){Di&&ai&&(Di=!1,ai.length?Nr=ai.concat(Nr):bo=-1,Nr.length&&_l())}u(Am,"h");function _l(){if(!Di){var r=wl(Am);Di=!0;for(var t=Nr.length;t;){for(ai=Nr,Nr=[];++bo1)for(var e=1;e=0&&cs.call(r)!=="[object Array]"&&cs.call(r.callee)==="[object Function]"},"n"),Om=function(){return Bo(arguments)}();Bo.isLegacyArguments=kl;var Bm=Om?Bo:kl,km=Object.prototype.toString,Cm=Function.prototype.toString,Nm=/^\s*(?:function)?\*/,Cl=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",Nl=Object.getPrototypeOf,vl=function(){if(!Cl)return!1;try{return Function("return function*() {}")()}catch(r){}}(),Dm=vl?Nl(vl):{},Lm=u(function(r){return typeof r=="function"&&(!!Nm.test(Cm.call(r))||(Cl?Nl(r)===Dm:km.call(r)==="[object GeneratorFunction]"))},"i"),Pm=typeof Object.create=="function"?function(r,t){t&&(r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:function(r,t){if(t){r.super_=t;var e=u(function(){},"o");e.prototype=t.prototype,r.prototype=new e,r.prototype.constructor=r}},Dl=u(function(r){return r&&typeof r=="object"&&typeof r.copy=="function"&&typeof r.fill=="function"&&typeof r.readUInt8=="function"},"i$1"),ze={},Um=Dl,Mm=Bm,jm=Lm;function ci(r){return r.call.bind(r)}u(ci,"c$1");var Ll=typeof BigInt!="undefined",ls=typeof Symbol!="undefined",Zt=ls&&Symbol.toStringTag!==void 0,Nt=typeof Uint8Array!="undefined",zm=typeof ArrayBuffer!="undefined";if(Nt&&Zt)var $m=Object.getPrototypeOf(Uint8Array.prototype),Yt=ci(Object.getOwnPropertyDescriptor($m,Symbol.toStringTag).get);var nt=ci(Object.prototype.toString),Zm=ci(Number.prototype.valueOf),Wm=ci(String.prototype.valueOf),Hm=ci(Boolean.prototype.valueOf);if(Ll)var qm=ci(BigInt.prototype.valueOf);if(ls)var Vm=ci(Symbol.prototype.valueOf);function ln(r,t){if(typeof r!="object")return!1;try{return t(r),!0}catch(e){return!1}}u(ln,"O");function El(r){return Nt&&Zt?Yt(r)!==void 0:Pl(r)||Ul(r)||Ml(r)||jl(r)||zl(r)||$l(r)||Zl(r)||Wl(r)||Hl(r)||ql(r)||Vl(r)}u(El,"S");function Pl(r){return Nt&&Zt?Yt(r)==="Uint8Array":nt(r)==="[object Uint8Array]"||Um(r)&&r.buffer!==void 0}u(Pl,"B");function Ul(r){return Nt&&Zt?Yt(r)==="Uint8ClampedArray":nt(r)==="[object Uint8ClampedArray]"}u(Ul,"k");function Ml(r){return Nt&&Zt?Yt(r)==="Uint16Array":nt(r)==="[object Uint16Array]"}u(Ml,"E");function jl(r){return Nt&&Zt?Yt(r)==="Uint32Array":nt(r)==="[object Uint32Array]"}u(jl,"D");function zl(r){return Nt&&Zt?Yt(r)==="Int8Array":nt(r)==="[object Int8Array]"}u(zl,"U");function $l(r){return Nt&&Zt?Yt(r)==="Int16Array":nt(r)==="[object Int16Array]"}u($l,"P");function Zl(r){return Nt&&Zt?Yt(r)==="Int32Array":nt(r)==="[object Int32Array]"}u(Zl,"x");function Wl(r){return Nt&&Zt?Yt(r)==="Float32Array":nt(r)==="[object Float32Array]"}u(Wl,"I");function Hl(r){return Nt&&Zt?Yt(r)==="Float64Array":nt(r)==="[object Float64Array]"}u(Hl,"M");function ql(r){return Nt&&Zt?Yt(r)==="BigInt64Array":nt(r)==="[object BigInt64Array]"}u(ql,"z");function Vl(r){return Nt&&Zt?Yt(r)==="BigUint64Array":nt(r)==="[object BigUint64Array]"}u(Vl,"F");function wo(r){return nt(r)==="[object Map]"}u(wo,"T");function _o(r){return nt(r)==="[object Set]"}u(_o,"N");function vo(r){return nt(r)==="[object WeakMap]"}u(vo,"W");function os(r){return nt(r)==="[object WeakSet]"}u(os,"$");function xo(r){return nt(r)==="[object ArrayBuffer]"}u(xo,"C");function Sl(r){return typeof ArrayBuffer!="undefined"&&(xo.working?xo(r):r instanceof ArrayBuffer)}u(Sl,"V");function Io(r){return nt(r)==="[object DataView]"}u(Io,"G");function Fl(r){return typeof DataView!="undefined"&&(Io.working?Io(r):r instanceof DataView)}u(Fl,"R");function To(r){return nt(r)==="[object SharedArrayBuffer]"}u(To,"J");function xl(r){return typeof SharedArrayBuffer!="undefined"&&(To.working?To(r):r instanceof SharedArrayBuffer)}u(xl,"_");function Il(r){return ln(r,Zm)}u(Il,"H");function Tl(r){return ln(r,Wm)}u(Tl,"Z");function Al(r){return ln(r,Hm)}u(Al,"q");function Rl(r){return Ll&&ln(r,qm)}u(Rl,"K");function Ol(r){return ls&&ln(r,Vm)}u(Ol,"L");ze.isArgumentsObject=Mm,ze.isGeneratorFunction=jm,ze.isPromise=function(r){return typeof Promise!="undefined"&&r instanceof Promise||r!==null&&typeof r=="object"&&typeof r.then=="function"&&typeof r.catch=="function"},ze.isArrayBufferView=function(r){return zm&&ArrayBuffer.isView?ArrayBuffer.isView(r):El(r)||Fl(r)},ze.isTypedArray=El,ze.isUint8Array=Pl,ze.isUint8ClampedArray=Ul,ze.isUint16Array=Ml,ze.isUint32Array=jl,ze.isInt8Array=zl,ze.isInt16Array=$l,ze.isInt32Array=Zl,ze.isFloat32Array=Wl,ze.isFloat64Array=Hl,ze.isBigInt64Array=ql,ze.isBigUint64Array=Vl,wo.working=typeof Map!="undefined"&&wo(new Map),ze.isMap=function(r){return typeof Map!="undefined"&&(wo.working?wo(r):r instanceof Map)},_o.working=typeof Set!="undefined"&&_o(new Set),ze.isSet=function(r){return typeof Set!="undefined"&&(_o.working?_o(r):r instanceof Set)},vo.working=typeof WeakMap!="undefined"&&vo(new WeakMap),ze.isWeakMap=function(r){return typeof WeakMap!="undefined"&&(vo.working?vo(r):r instanceof WeakMap)},os.working=typeof WeakSet!="undefined"&&os(new WeakSet),ze.isWeakSet=function(r){return os(r)},xo.working=typeof ArrayBuffer!="undefined"&&xo(new ArrayBuffer),ze.isArrayBuffer=Sl,Io.working=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"&&Io(new DataView(new ArrayBuffer(1),0,1)),ze.isDataView=Fl,To.working=typeof SharedArrayBuffer!="undefined"&&To(new SharedArrayBuffer),ze.isSharedArrayBuffer=xl,ze.isAsyncFunction=function(r){return nt(r)==="[object AsyncFunction]"},ze.isMapIterator=function(r){return nt(r)==="[object Map Iterator]"},ze.isSetIterator=function(r){return nt(r)==="[object Set Iterator]"},ze.isGeneratorObject=function(r){return nt(r)==="[object Generator]"},ze.isWebAssemblyCompiledModule=function(r){return nt(r)==="[object WebAssembly.Module]"},ze.isNumberObject=Il,ze.isStringObject=Tl,ze.isBooleanObject=Al,ze.isBigIntObject=Rl,ze.isSymbolObject=Ol,ze.isBoxedPrimitive=function(r){return Il(r)||Tl(r)||Al(r)||Rl(r)||Ol(r)},ze.isAnyArrayBuffer=function(r){return Nt&&(Sl(r)||xl(r))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(r){Object.defineProperty(ze,r,{enumerable:!1,value:function(){throw new Error(r+" is not supported in userland")}})});var sn=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:global,Q={},pr=Qe,Bl=Object.getOwnPropertyDescriptors||function(r){for(var t=Object.keys(r),e={},i=0;i=n)return l;switch(l){case"%s":return String(i[e++]);case"%d":return Number(i[e++]);case"%j":try{return JSON.stringify(i[e++])}catch(m){return"[Circular]"}default:return l}}),a=i[e];e=3&&(e.depth=arguments[2]),arguments.length>=4&&(e.colors=arguments[3]),fs(t)?e.showHidden=t:t&&Q._extend(e,t),ui(e.showHidden)&&(e.showHidden=!1),ui(e.depth)&&(e.depth=2),ui(e.colors)&&(e.colors=!1),ui(e.customInspect)&&(e.customInspect=!0),e.colors&&(e.stylize=Gm),Ao(e,r,e.depth)}u(Gr,"oe");function Gm(r,t){var e=Gr.styles[t];return e?"\x1B["+Gr.colors[e][0]+"m"+r+"\x1B["+Gr.colors[e][1]+"m":r}u(Gm,"ue");function Ym(r,t){return r}u(Ym,"fe");function Ao(r,t,e){if(r.customInspect&&t&&Fo(t.inspect)&&t.inspect!==Q.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(e,r);return Ro(i)||(i=Ao(r,i,e)),i}var n=function(v,S){if(ui(S))return v.stylize("undefined","undefined");if(Ro(S)){var E="'"+JSON.stringify(S).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return v.stylize(E,"string")}if(Yl(S))return v.stylize(""+S,"number");if(fs(S))return v.stylize(""+S,"boolean");if(ko(S))return v.stylize("null","null")}(r,t);if(n)return n;var o=Object.keys(t),a=function(v){var S={};return v.forEach(function(E,A){S[E]=!0}),S}(o);if(r.showHidden&&(o=Object.getOwnPropertyNames(t)),cn(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return as(t);if(o.length===0){if(Fo(t)){var l=t.name?": "+t.name:"";return r.stylize("[Function"+l+"]","special")}if(un(t))return r.stylize(RegExp.prototype.toString.call(t),"regexp");if(Oo(t))return r.stylize(Date.prototype.toString.call(t),"date");if(cn(t))return as(t)}var m,y="",g=!1,w=["{","}"];return Gl(t)&&(g=!0,w=["[","]"]),Fo(t)&&(y=" [Function"+(t.name?": "+t.name:"")+"]"),un(t)&&(y=" "+RegExp.prototype.toString.call(t)),Oo(t)&&(y=" "+Date.prototype.toUTCString.call(t)),cn(t)&&(y=" "+as(t)),o.length!==0||g&&t.length!=0?e<0?un(t)?r.stylize(RegExp.prototype.toString.call(t),"regexp"):r.stylize("[Object]","special"):(r.seen.push(t),m=g?function(v,S,E,A,O){for(var U=[],j=0,W=S.length;j=0&&A++,O+U.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?E[0]+(S===""?"":S+` `)+" "+v.join(`, `)+" "+E[1]:E[0]+S+" "+v.join(", ")+" "+E[1]}(m,y,w)):w[0]+y+w[1]}u(Ao,"ae");function as(r){return"["+Error.prototype.toString.call(r)+"]"}u(as,"ce");function ss(r,t,e,i,n,o){var a,l,m;if((m=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?l=m.set?r.stylize("[Getter/Setter]","special"):r.stylize("[Getter]","special"):m.set&&(l=r.stylize("[Setter]","special")),Xl(i,n)||(a="["+n+"]"),l||(r.seen.indexOf(m.value)<0?(l=ko(e)?Ao(r,m.value,null):Ao(r,m.value,e-1)).indexOf(` `)>-1&&(l=o?l.split(` `).map(function(y){return" "+y}).join(` `).substr(2):` `+l.split(` `).map(function(y){return" "+y}).join(` `)):l=r.stylize("[Circular]","special")),ui(a)){if(o&&n.match(/^\d+$/))return l;(a=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=r.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=r.stylize(a,"string"))}return a+": "+l}u(ss,"se");function Gl(r){return Array.isArray(r)}u(Gl,"pe");function fs(r){return typeof r=="boolean"}u(fs,"ye");function ko(r){return r===null}u(ko,"le");function Yl(r){return typeof r=="number"}u(Yl,"de");function Ro(r){return typeof r=="string"}u(Ro,"ge");function ui(r){return r===void 0}u(ui,"be");function un(r){return Pi(r)&&hs(r)==="[object RegExp]"}u(un,"me");function Pi(r){return typeof r=="object"&&r!==null}u(Pi,"he");function Oo(r){return Pi(r)&&hs(r)==="[object Date]"}u(Oo,"je");function cn(r){return Pi(r)&&(hs(r)==="[object Error]"||r instanceof Error)}u(cn,"Ae");function Fo(r){return typeof r=="function"}u(Fo,"we");function hs(r){return Object.prototype.toString.call(r)}u(hs,"ve");function us(r){return r<10?"0"+r.toString(10):r.toString(10)}u(us,"Oe");Q.debuglog=function(r){if(r=r.toUpperCase(),!Eo[r])if(Kl.test(r)){var t=pr.pid;Eo[r]=function(){var e=Q.format.apply(Q,arguments);console.error("%s %d: %s",r,t,e)}}else Eo[r]=function(){};return Eo[r]},Q.inspect=Gr,Gr.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Gr.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},Q.types=ze,Q.isArray=Gl,Q.isBoolean=fs,Q.isNull=ko,Q.isNullOrUndefined=function(r){return r==null},Q.isNumber=Yl,Q.isString=Ro,Q.isSymbol=function(r){return typeof r=="symbol"},Q.isUndefined=ui,Q.isRegExp=un,Q.types.isRegExp=un,Q.isObject=Pi,Q.isDate=Oo,Q.types.isDate=Oo,Q.isError=cn,Q.types.isNativeError=cn,Q.isFunction=Fo,Q.isPrimitive=function(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||r===void 0},Q.isBuffer=Dl;var Xm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Jm(){var r=new Date,t=[us(r.getHours()),us(r.getMinutes()),us(r.getSeconds())].join(":");return[r.getDate(),Xm[r.getMonth()],t].join(" ")}u(Jm,"Be");function Xl(r,t){return Object.prototype.hasOwnProperty.call(r,t)}u(Xl,"ke");Q.log=function(){console.log("%s - %s",Jm(),Q.format.apply(Q,arguments))},Q.inherits=Pm,Q._extend=function(r,t){if(!t||!Pi(t))return r;for(var e=Object.keys(t),i=e.length;i--;)r[e[i]]=t[e[i]];return r};var si=typeof Symbol!="undefined"?Symbol("util.promisify.custom"):void 0;function Qm(r,t){if(!r){var e=new Error("Promise was rejected with a falsy value");e.reason=r,r=e}return t(r)}u(Qm,"De");Q.promisify=function(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(si&&r[si]){var t;if(typeof(t=r[si])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,si,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var e,i,n=new Promise(function(l,m){e=l,i=m}),o=[],a=0;a0?n-4:n;for(e=0;e>16&255,a[l++]=t>>8&255,a[l++]=255&t;return o===2&&(t=Wt[r.charCodeAt(e)]<<2|Wt[r.charCodeAt(e+1)]>>4,a[l++]=255&t),o===1&&(t=Wt[r.charCodeAt(e)]<<10|Wt[r.charCodeAt(e+1)]<<4|Wt[r.charCodeAt(e+2)]>>2,a[l++]=t>>8&255,a[l++]=255&t),a},fromByteArray:function(r){for(var t,e=r.length,i=e%3,n=[],o=0,a=e-i;oa?a:o+16383));return i===1?(t=r[e-1],n.push(ir[t>>2]+ir[t<<4&63]+"==")):i===2&&(t=(r[e-2]<<8)+r[e-1],n.push(ir[t>>10]+ir[t>>4&63]+ir[t<<2&63]+"=")),n.join("")}},ir=[],Wt=[],Jl=typeof Uint8Array!="undefined"?Uint8Array:Array,Co="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",li=0,Ql=Co.length;li0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return e===-1&&(e=t),[e,e===t?0:4-e%4]}u(ef,"u$2");function eg(r,t,e){for(var i,n,o=[],a=t;a>18&63]+ir[n>>12&63]+ir[n>>6&63]+ir[63&n]);return o.join("")}u(eg,"c$1");Wt["-".charCodeAt(0)]=62,Wt["_".charCodeAt(0)]=63;var tg={read:function(r,t,e,i,n){var o,a,l=8*n-i-1,m=(1<>1,g=-7,w=e?n-1:0,v=e?-1:1,S=r[t+w];for(w+=v,o=S&(1<<-g)-1,S>>=-g,g+=l;g>0;o=256*o+r[t+w],w+=v,g-=8);for(a=o&(1<<-g)-1,o>>=-g,g+=i;g>0;a=256*a+r[t+w],w+=v,g-=8);if(o===0)o=1-y;else{if(o===m)return a?NaN:1/0*(S?-1:1);a+=Math.pow(2,i),o-=y}return(S?-1:1)*a*Math.pow(2,o-i)},write:function(r,t,e,i,n,o){var a,l,m,y=8*o-n-1,g=(1<>1,v=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=i?0:o-1,E=i?1:-1,A=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=g):(a=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-a))<1&&(a--,m*=2),(t+=a+w>=1?v/m:v*Math.pow(2,1-w))*m>=2&&(a++,m/=2),a+w>=g?(l=0,a=g):a+w>=1?(l=(t*m-1)*Math.pow(2,n),a+=w):(l=t*Math.pow(2,w-1)*Math.pow(2,n),a=0));n>=8;r[e+S]=255&l,S+=E,l/=256,n-=8);for(a=a<0;r[e+S]=255&a,S+=E,a/=256,y-=8);r[e+S-E]|=128*A}},Pr={},ms=lf,Ui=tg,tf=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Pr.Buffer=ue,Pr.SlowBuffer=function(r){return+r!=r&&(r=0),ue.alloc(+r)},Pr.INSPECT_MAX_BYTES=50;function Dr(r){if(r>2147483647)throw new RangeError('The value "'+r+'" is invalid for option "size"');var t=new Uint8Array(r);return Object.setPrototypeOf(t,ue.prototype),t}u(Dr,"f$2");function ue(r,t,e){if(typeof r=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return gs(r)}return ff(r,t,e)}u(ue,"u$1$1");function ff(r,t,e){if(typeof r=="string")return function(o,a){if(typeof a=="string"&&a!==""||(a="utf8"),!ue.isEncoding(a))throw new TypeError("Unknown encoding: "+a);var l=0|df(o,a),m=Dr(l),y=m.write(o,a);return y!==l&&(m=m.slice(0,y)),m}(r,t);if(ArrayBuffer.isView(r))return ds(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Lr(r,ArrayBuffer)||r&&Lr(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Lr(r,SharedArrayBuffer)||r&&Lr(r.buffer,SharedArrayBuffer)))return rf(r,t,e);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=r.valueOf&&r.valueOf();if(i!=null&&i!==r)return ue.from(i,t,e);var n=function(o){if(ue.isBuffer(o)){var a=0|ws(o.length),l=Dr(a);return l.length===0||o.copy(l,0,0,a),l}if(o.length!==void 0)return typeof o.length!="number"||_s(o.length)?Dr(0):ds(o);if(o.type==="Buffer"&&Array.isArray(o.data))return ds(o.data)}(r);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return ue.from(r[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}u(ff,"s$1");function hf(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}u(hf,"h$1$1");function gs(r){return hf(r),Dr(r<0?0:0|ws(r))}u(gs,"a$2");function ds(r){for(var t=r.length<0?0:0|ws(r.length),e=Dr(t),i=0;i=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|r}u(ws,"l$1");function df(r,t){if(ue.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Lr(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var e=r.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&e===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return ys(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return yf(r).length;default:if(n)return i?-1:ys(r).length;t=(""+t).toLowerCase(),n=!0}}u(df,"y");function rg(r,t,e){var i=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0)<=(t>>>=0))return"";for(r||(r="utf8");;)switch(r){case"hex":return fg(this,t,e);case"utf8":case"utf-8":return mf(this,t,e);case"ascii":return cg(this,t,e);case"latin1":case"binary":return lg(this,t,e);case"base64":return ug(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return hg(this,t,e);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}u(rg,"g");function fi(r,t,e){var i=r[t];r[t]=r[e],r[e]=i}u(fi,"w");function nf(r,t,e,i,n){if(r.length===0)return-1;if(typeof e=="string"?(i=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),_s(e=+e)&&(e=n?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(n)return-1;e=r.length-1}else if(e<0){if(!n)return-1;e=0}if(typeof t=="string"&&(t=ue.from(t,i)),ue.isBuffer(t))return t.length===0?-1:of(r,t,e,i,n);if(typeof t=="number")return t&=255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):of(r,[t],e,i,n);throw new TypeError("val must be string, number or Buffer")}u(nf,"d");function of(r,t,e,i,n){var o,a=1,l=r.length,m=t.length;if(i!==void 0&&((i=String(i).toLowerCase())==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||t.length<2)return-1;a=2,l/=2,m/=2,e/=2}function y(S,E){return a===1?S[E]:S.readUInt16BE(E*a)}if(u(y,"h"),n){var g=-1;for(o=e;ol&&(e=l-m),o=e;o>=0;o--){for(var w=!0,v=0;vn&&(i=n):i=n;var o=t.length;i>o/2&&(i=o/2);for(var a=0;a>8,m=a%256,y.push(m),y.push(l);return y}(t,r.length-e),r,e,i)}u(sg,"U");function ug(r,t,e){return t===0&&e===r.length?ms.fromByteArray(r):ms.fromByteArray(r.slice(t,e))}u(ug,"T");function mf(r,t,e){e=Math.min(r.length,e);for(var i=[],n=t;n239?4:y>223?3:y>191?2:1;if(n+w<=e)switch(w){case 1:y<128&&(g=y);break;case 2:(192&(o=r[n+1]))==128&&(m=(31&y)<<6|63&o)>127&&(g=m);break;case 3:o=r[n+1],a=r[n+2],(192&o)==128&&(192&a)==128&&(m=(15&y)<<12|(63&o)<<6|63&a)>2047&&(m<55296||m>57343)&&(g=m);break;case 4:o=r[n+1],a=r[n+2],l=r[n+3],(192&o)==128&&(192&a)==128&&(192&l)==128&&(m=(15&y)<<18|(63&o)<<12|(63&a)<<6|63&l)>65535&&m<1114112&&(g=m)}g===null?(g=65533,w=1):g>65535&&(g-=65536,i.push(g>>>10&1023|55296),g=56320|1023&g),i.push(g),n+=w}return function(v){var S=v.length;if(S<=4096)return String.fromCharCode.apply(String,v);for(var E="",A=0;At&&(r+=" ... "),""},tf&&(ue.prototype[tf]=ue.prototype.inspect),ue.prototype.compare=function(r,t,e,i,n){if(Lr(r,Uint8Array)&&(r=ue.from(r,r.offset,r.byteLength)),!ue.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),e===void 0&&(e=r?r.length:0),i===void 0&&(i=0),n===void 0&&(n=this.length),t<0||e>r.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=e)return 0;if(i>=n)return-1;if(t>=e)return 1;if(this===r)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(e>>>=0)-(t>>>=0),l=Math.min(o,a),m=this.slice(i,n),y=r.slice(t,e),g=0;g>>=0,isFinite(e)?(e>>>=0,i===void 0&&(i="utf8")):(i=e,e=void 0)}var n=this.length-t;if((e===void 0||e>n)&&(e=n),r.length>0&&(e<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return ig(this,r,t,e);case"utf8":case"utf-8":return ng(this,r,t,e);case"ascii":return pf(this,r,t,e);case"latin1":case"binary":return og(this,r,t,e);case"base64":return ag(this,r,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sg(this,r,t,e);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},ue.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function cg(r,t,e){var i="";e=Math.min(r.length,e);for(var n=t;ni)&&(e=i);for(var n="",o=t;oe)throw new RangeError("Trying to access beyond buffer length")}u(Et,"x");function Dt(r,t,e,i,n,o){if(!ue.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||tr.length)throw new RangeError("Index out of range")}u(Dt,"C");function gf(r,t,e,i,n,o){if(e+i>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}u(gf,"P");function af(r,t,e,i,n){return t=+t,e>>>=0,n||gf(r,0,e,4),Ui.write(r,t,e,i,23,4),e+4}u(af,"k");function sf(r,t,e,i,n){return t=+t,e>>>=0,n||gf(r,0,e,8),Ui.write(r,t,e,i,52,8),e+8}u(sf,"M");ue.prototype.slice=function(r,t){var e=this.length;(r=~~r)<0?(r+=e)<0&&(r=0):r>e&&(r=e),(t=t===void 0?e:~~t)<0?(t+=e)<0&&(t=0):t>e&&(t=e),t>>=0,t>>>=0,e||Et(r,t,this.length);for(var i=this[r],n=1,o=0;++o>>=0,t>>>=0,e||Et(r,t,this.length);for(var i=this[r+--t],n=1;t>0&&(n*=256);)i+=this[r+--t]*n;return i},ue.prototype.readUInt8=function(r,t){return r>>>=0,t||Et(r,1,this.length),this[r]},ue.prototype.readUInt16LE=function(r,t){return r>>>=0,t||Et(r,2,this.length),this[r]|this[r+1]<<8},ue.prototype.readUInt16BE=function(r,t){return r>>>=0,t||Et(r,2,this.length),this[r]<<8|this[r+1]},ue.prototype.readUInt32LE=function(r,t){return r>>>=0,t||Et(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+16777216*this[r+3]},ue.prototype.readUInt32BE=function(r,t){return r>>>=0,t||Et(r,4,this.length),16777216*this[r]+(this[r+1]<<16|this[r+2]<<8|this[r+3])},ue.prototype.readIntLE=function(r,t,e){r>>>=0,t>>>=0,e||Et(r,t,this.length);for(var i=this[r],n=1,o=0;++o=(n*=128)&&(i-=Math.pow(2,8*t)),i},ue.prototype.readIntBE=function(r,t,e){r>>>=0,t>>>=0,e||Et(r,t,this.length);for(var i=t,n=1,o=this[r+--i];i>0&&(n*=256);)o+=this[r+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*t)),o},ue.prototype.readInt8=function(r,t){return r>>>=0,t||Et(r,1,this.length),128&this[r]?-1*(255-this[r]+1):this[r]},ue.prototype.readInt16LE=function(r,t){r>>>=0,t||Et(r,2,this.length);var e=this[r]|this[r+1]<<8;return 32768&e?4294901760|e:e},ue.prototype.readInt16BE=function(r,t){r>>>=0,t||Et(r,2,this.length);var e=this[r+1]|this[r]<<8;return 32768&e?4294901760|e:e},ue.prototype.readInt32LE=function(r,t){return r>>>=0,t||Et(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},ue.prototype.readInt32BE=function(r,t){return r>>>=0,t||Et(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},ue.prototype.readFloatLE=function(r,t){return r>>>=0,t||Et(r,4,this.length),Ui.read(this,r,!0,23,4)},ue.prototype.readFloatBE=function(r,t){return r>>>=0,t||Et(r,4,this.length),Ui.read(this,r,!1,23,4)},ue.prototype.readDoubleLE=function(r,t){return r>>>=0,t||Et(r,8,this.length),Ui.read(this,r,!0,52,8)},ue.prototype.readDoubleBE=function(r,t){return r>>>=0,t||Et(r,8,this.length),Ui.read(this,r,!1,52,8)},ue.prototype.writeUIntLE=function(r,t,e,i){r=+r,t>>>=0,e>>>=0,i||Dt(this,r,t,e,Math.pow(2,8*e)-1,0);var n=1,o=0;for(this[t]=255&r;++o>>=0,e>>>=0,i||Dt(this,r,t,e,Math.pow(2,8*e)-1,0);var n=e-1,o=1;for(this[t+n]=255&r;--n>=0&&(o*=256);)this[t+n]=r/o&255;return t+e},ue.prototype.writeUInt8=function(r,t,e){return r=+r,t>>>=0,e||Dt(this,r,t,1,255,0),this[t]=255&r,t+1},ue.prototype.writeUInt16LE=function(r,t,e){return r=+r,t>>>=0,e||Dt(this,r,t,2,65535,0),this[t]=255&r,this[t+1]=r>>>8,t+2},ue.prototype.writeUInt16BE=function(r,t,e){return r=+r,t>>>=0,e||Dt(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=255&r,t+2},ue.prototype.writeUInt32LE=function(r,t,e){return r=+r,t>>>=0,e||Dt(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=255&r,t+4},ue.prototype.writeUInt32BE=function(r,t,e){return r=+r,t>>>=0,e||Dt(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=255&r,t+4},ue.prototype.writeIntLE=function(r,t,e,i){if(r=+r,t>>>=0,!i){var n=Math.pow(2,8*e-1);Dt(this,r,t,e,n-1,-n)}var o=0,a=1,l=0;for(this[t]=255&r;++o>0)-l&255;return t+e},ue.prototype.writeIntBE=function(r,t,e,i){if(r=+r,t>>>=0,!i){var n=Math.pow(2,8*e-1);Dt(this,r,t,e,n-1,-n)}var o=e-1,a=1,l=0;for(this[t+o]=255&r;--o>=0&&(a*=256);)r<0&&l===0&&this[t+o+1]!==0&&(l=1),this[t+o]=(r/a>>0)-l&255;return t+e},ue.prototype.writeInt8=function(r,t,e){return r=+r,t>>>=0,e||Dt(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=255&r,t+1},ue.prototype.writeInt16LE=function(r,t,e){return r=+r,t>>>=0,e||Dt(this,r,t,2,32767,-32768),this[t]=255&r,this[t+1]=r>>>8,t+2},ue.prototype.writeInt16BE=function(r,t,e){return r=+r,t>>>=0,e||Dt(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=255&r,t+2},ue.prototype.writeInt32LE=function(r,t,e){return r=+r,t>>>=0,e||Dt(this,r,t,4,2147483647,-2147483648),this[t]=255&r,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4},ue.prototype.writeInt32BE=function(r,t,e){return r=+r,t>>>=0,e||Dt(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=255&r,t+4},ue.prototype.writeFloatLE=function(r,t,e){return af(this,r,t,!0,e)},ue.prototype.writeFloatBE=function(r,t,e){return af(this,r,t,!1,e)},ue.prototype.writeDoubleLE=function(r,t,e){return sf(this,r,t,!0,e)},ue.prototype.writeDoubleBE=function(r,t,e){return sf(this,r,t,!1,e)},ue.prototype.copy=function(r,t,e,i){if(!ue.isBuffer(r))throw new TypeError("argument should be a Buffer");if(e||(e=0),i||i===0||(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-t=0;--o)r[o+t]=this[o+e];else Uint8Array.prototype.set.call(r,this.subarray(e,i),t);return n},ue.prototype.fill=function(r,t,e,i){if(typeof r=="string"){if(typeof t=="string"?(i=t,t=0,e=this.length):typeof e=="string"&&(i=e,e=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!ue.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){var n=r.charCodeAt(0);(i==="utf8"&&n<128||i==="latin1")&&(r=n)}}else typeof r=="number"?r&=255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length>>=0,e=e===void 0?this.length:e>>>0,r||(r=0),typeof r=="number")for(o=t;o55295&&e<57344){if(!n){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&o.push(239,191,189);continue}n=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),n=e;continue}e=65536+(n-55296<<10|e-56320)}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}u(ys,"_");function yf(r){return ms.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(dg,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(r))}u(yf,"z");function Lo(r,t,e,i){for(var n=0;n=t.length||n>=r.length);++n)t[n+e]=r[n];return n}u(Lo,"D");function Lr(r,t){return r instanceof t||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===t.name}u(Lr,"F");function _s(r){return r!=r}u(_s,"N");var pg=function(){for(var r=new Array(256),t=0;t<16;++t)for(var e=16*t,i=0;i<16;++i)r[e+i]="0123456789abcdef"[t]+"0123456789abcdef"[i];return r}();Pr.Buffer;Pr.INSPECT_MAX_BYTES;Pr.kMaxLength;var No={},Do=Pr,mr=Do.Buffer;function uf(r,t){for(var e in r)t[e]=r[e]}u(uf,"t");function hi(r,t,e){return mr(r,t,e)}u(hi,"f");mr.from&&mr.alloc&&mr.allocUnsafe&&mr.allocUnsafeSlow?No=Do:(uf(Do,No),No.Buffer=hi),hi.prototype=Object.create(mr.prototype),uf(mr,hi),hi.from=function(r,t,e){if(typeof r=="number")throw new TypeError("Argument must not be a number");return mr(r,t,e)},hi.alloc=function(r,t,e){if(typeof r!="number")throw new TypeError("Argument must be a number");var i=mr(r);return t!==void 0?typeof e=="string"?i.fill(t,e):i.fill(t):i.fill(0),i},hi.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return mr(r)},hi.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Do.SlowBuffer(r)};var mg=No,Mi={},bs=mg.Buffer,cf=bs.isEncoding||function(r){switch((r=""+r)&&r.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function fn(r){var t;switch(this.encoding=function(e){var i=function(n){if(!n)return"utf8";for(var o;;)switch(n){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return n;default:if(o)return;n=(""+n).toLowerCase(),o=!0}}(e);if(typeof i!="string"&&(bs.isEncoding===cf||!cf(e)))throw new Error("Unknown encoding: "+e);return i||e}(r),this.encoding){case"utf16le":this.text=yg,this.end=bg,t=4;break;case"utf8":this.fillLast=gg,t=4;break;case"base64":this.text=wg,this.end=_g,t=3;break;default:return this.write=vg,this.end=Eg,void 0}this.lastNeed=0,this.lastTotal=0,this.lastChar=bs.allocUnsafe(t)}u(fn,"a");function ps(r){return r<=127?0:r>>5==6?2:r>>4==14?3:r>>3==30?4:r>>6==2?-1:-2}u(ps,"r");function gg(r){var t=this.lastTotal-this.lastNeed,e=function(i,n,o){if((192&n[0])!=128)return i.lastNeed=0,"\uFFFD";if(i.lastNeed>1&&n.length>1){if((192&n[1])!=128)return i.lastNeed=1,"\uFFFD";if(i.lastNeed>2&&n.length>2&&(192&n[2])!=128)return i.lastNeed=2,"\uFFFD"}}(this,r);return e!==void 0?e:this.lastNeed<=r.length?(r.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(r.copy(this.lastChar,t,0,r.length),this.lastNeed-=r.length,void 0)}u(gg,"n$1");function yg(r,t){if((r.length-t)%2==0){var e=r.toString("utf16le",t);if(e){var i=e.charCodeAt(e.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1],e.slice(0,-1)}return e}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=r[r.length-1],r.toString("utf16le",t,r.length-1)}u(yg,"h");function bg(r){var t=r&&r.length?this.write(r):"";if(this.lastNeed){var e=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,e)}return t}u(bg,"l");function wg(r,t){var e=(r.length-t)%3;return e===0?r.toString("base64",t):(this.lastNeed=3-e,this.lastTotal=3,e===1?this.lastChar[0]=r[r.length-1]:(this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1]),r.toString("base64",t,r.length-e))}u(wg,"u$1");function _g(r){var t=r&&r.length?this.write(r):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}u(_g,"o$1");function vg(r){return r.toString(this.encoding)}u(vg,"f$1");function Eg(r){return r&&r.length?this.write(r):""}u(Eg,"c");Mi.StringDecoder=fn,fn.prototype.write=function(r){if(r.length===0)return"";var t,e;if(this.lastNeed){if((t=this.fillLast(r))===void 0)return"";e=this.lastNeed,this.lastNeed=0}else e=0;return e=0?(m>0&&(n.lastNeed=m-1),m):--l=0?(m>0&&(n.lastNeed=m-2),m):--l=0?(m>0&&(m===2?m=0:n.lastNeed=m-3),m):0}(this,r,t);if(!this.lastNeed)return r.toString("utf8",t);this.lastTotal=e;var i=r.length-(e-this.lastNeed);return r.copy(this.lastChar,0,i),r.toString("utf8",t,i)},fn.prototype.fillLast=function(r){if(this.lastNeed<=r.length)return r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,r.length),this.lastNeed-=r.length};Mi.StringDecoder;Mi.StringDecoder;var hn={},bf=!1;function Sg(){if(bf)return hn;bf=!0,hn.byteLength=l,hn.toByteArray=y,hn.fromByteArray=v;for(var r=[],t=[],e=typeof Uint8Array!="undefined"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n0)throw new Error("Invalid string. Length must be a multiple of 4");var A=S.indexOf("=");A===-1&&(A=E);var O=A===E?0:4-A%4;return[A,O]}u(a,"getLens");function l(S){var E=a(S),A=E[0],O=E[1];return(A+O)*3/4-O}u(l,"byteLength");function m(S,E,A){return(E+A)*3/4-A}u(m,"_byteLength");function y(S){var E,A=a(S),O=A[0],U=A[1],j=new e(m(S,O,U)),W=0,se=U>0?O-4:O,Y;for(Y=0;Y>16&255,j[W++]=E>>8&255,j[W++]=E&255;return U===2&&(E=t[S.charCodeAt(Y)]<<2|t[S.charCodeAt(Y+1)]>>4,j[W++]=E&255),U===1&&(E=t[S.charCodeAt(Y)]<<10|t[S.charCodeAt(Y+1)]<<4|t[S.charCodeAt(Y+2)]>>2,j[W++]=E>>8&255,j[W++]=E&255),j}u(y,"toByteArray");function g(S){return r[S>>18&63]+r[S>>12&63]+r[S>>6&63]+r[S&63]}u(g,"tripletToBase64");function w(S,E,A){for(var O,U=[],j=E;jse?se:W+j));return O===1?(E=S[A-1],U.push(r[E>>2]+r[E<<4&63]+"==")):O===2&&(E=(S[A-2]<<8)+S[A-1],U.push(r[E>>10]+r[E>>4&63]+r[E<<2&63]+"=")),U.join("")}return u(v,"fromByteArray"),hn}u(Sg,"dew$2$1");var Po={},wf=!1;function Fg(){if(wf)return Po;wf=!0;return Po.read=function(r,t,e,i,n){var o,a,l=n*8-i-1,m=(1<>1,g=-7,w=e?n-1:0,v=e?-1:1,S=r[t+w];for(w+=v,o=S&(1<<-g)-1,S>>=-g,g+=l;g>0;o=o*256+r[t+w],w+=v,g-=8);for(a=o&(1<<-g)-1,o>>=-g,g+=i;g>0;a=a*256+r[t+w],w+=v,g-=8);if(o===0)o=1-y;else{if(o===m)return a?NaN:(S?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-y}return(S?-1:1)*a*Math.pow(2,o-i)},Po.write=function(r,t,e,i,n,o){var a,l,m,y=o*8-n-1,g=(1<>1,v=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=i?0:o-1,E=i?1:-1,A=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=g):(a=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-a))<1&&(a--,m*=2),a+w>=1?t+=v/m:t+=v*Math.pow(2,1-w),t*m>=2&&(a++,m/=2),a+w>=g?(l=0,a=g):a+w>=1?(l=(t*m-1)*Math.pow(2,n),a=a+w):(l=t*Math.pow(2,w-1)*Math.pow(2,n),a=0));n>=8;r[e+S]=l&255,S+=E,l/=256,n-=8);for(a=a<0;r[e+S]=a&255,S+=E,a/=256,y-=8);r[e+S-E]|=A*128},Po}u(Fg,"dew$1$1");var di={},_f=!1;function xg(){if(_f)return di;_f=!0;let r=Sg(),t=Fg(),e=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;di.Buffer=a,di.SlowBuffer=U,di.INSPECT_MAX_BYTES=50;let i=2147483647;di.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=n(),!a.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function n(){try{let f=new Uint8Array(1),s={foo:function(){return 42}};return Object.setPrototypeOf(s,Uint8Array.prototype),Object.setPrototypeOf(f,s),f.foo()===42}catch(f){return!1}}u(n,"typedArraySupport"),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(f){if(f>i)throw new RangeError('The value "'+f+'" is invalid for option "size"');let s=new Uint8Array(f);return Object.setPrototypeOf(s,a.prototype),s}u(o,"createBuffer");function a(f,s,c){if(typeof f=="number"){if(typeof s=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(f)}return l(f,s,c)}u(a,"Buffer"),a.poolSize=8192;function l(f,s,c){if(typeof f=="string")return w(f,s);if(ArrayBuffer.isView(f))return S(f);if(f==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if(He(f,ArrayBuffer)||f&&He(f.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(He(f,SharedArrayBuffer)||f&&He(f.buffer,SharedArrayBuffer)))return E(f,s,c);if(typeof f=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let p=f.valueOf&&f.valueOf();if(p!=null&&p!==f)return a.from(p,s,c);let _=A(f);if(_)return _;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof f[Symbol.toPrimitive]=="function")return a.from(f[Symbol.toPrimitive]("string"),s,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}u(l,"from"),a.from=function(f,s,c){return l(f,s,c)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function m(f){if(typeof f!="number")throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}u(m,"assertSize");function y(f,s,c){return m(f),f<=0?o(f):s!==void 0?typeof c=="string"?o(f).fill(s,c):o(f).fill(s):o(f)}u(y,"alloc"),a.alloc=function(f,s,c){return y(f,s,c)};function g(f){return m(f),o(f<0?0:O(f)|0)}u(g,"allocUnsafe"),a.allocUnsafe=function(f){return g(f)},a.allocUnsafeSlow=function(f){return g(f)};function w(f,s){if((typeof s!="string"||s==="")&&(s="utf8"),!a.isEncoding(s))throw new TypeError("Unknown encoding: "+s);let c=j(f,s)|0,p=o(c),_=p.write(f,s);return _!==c&&(p=p.slice(0,_)),p}u(w,"fromString");function v(f){let s=f.length<0?0:O(f.length)|0,c=o(s);for(let p=0;p=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return f|0}u(O,"checked");function U(f){return+f!=f&&(f=0),a.alloc(+f)}u(U,"SlowBuffer"),a.isBuffer=u(function(s){return s!=null&&s._isBuffer===!0&&s!==a.prototype},"isBuffer"),a.compare=u(function(s,c){if(He(s,Uint8Array)&&(s=a.from(s,s.offset,s.byteLength)),He(c,Uint8Array)&&(c=a.from(c,c.offset,c.byteLength)),!a.isBuffer(s)||!a.isBuffer(c))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(s===c)return 0;let p=s.length,_=c.length;for(let d=0,x=Math.min(p,_);d_.length?(a.isBuffer(x)||(x=a.from(x)),x.copy(_,d)):Uint8Array.prototype.set.call(_,x,d);else if(a.isBuffer(x))x.copy(_,d);else throw new TypeError('"list" argument must be an Array of Buffers');d+=x.length}return _},"concat");function j(f,s){if(a.isBuffer(f))return f.length;if(ArrayBuffer.isView(f)||He(f,ArrayBuffer))return f.byteLength;if(typeof f!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);let c=f.length,p=arguments.length>2&&arguments[2]===!0;if(!p&&c===0)return 0;let _=!1;for(;;)switch(s){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return Pe(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c*2;case"hex":return c>>>1;case"base64":return et(f).length;default:if(_)return p?-1:Pe(f).length;s=(""+s).toLowerCase(),_=!0}}u(j,"byteLength"),a.byteLength=j;function W(f,s,c){let p=!1;if((s===void 0||s<0)&&(s=0),s>this.length||((c===void 0||c>this.length)&&(c=this.length),c<=0)||(c>>>=0,s>>>=0,c<=s))return"";for(f||(f="utf8");;)switch(f){case"hex":return D(this,s,c);case"utf8":case"utf-8":return $(this,s,c);case"ascii":return pe(this,s,c);case"latin1":case"binary":return P(this,s,c);case"base64":return B(this,s,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,s,c);default:if(p)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),p=!0}}u(W,"slowToString"),a.prototype._isBuffer=!0;function se(f,s,c){let p=f[s];f[s]=f[c],f[c]=p}u(se,"swap"),a.prototype.swap16=u(function(){let s=this.length;if(s%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let c=0;cc&&(s+=" ... "),""},"inspect"),e&&(a.prototype[e]=a.prototype.inspect),a.prototype.compare=u(function(s,c,p,_,d){if(He(s,Uint8Array)&&(s=a.from(s,s.offset,s.byteLength)),!a.isBuffer(s))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof s);if(c===void 0&&(c=0),p===void 0&&(p=s?s.length:0),_===void 0&&(_=0),d===void 0&&(d=this.length),c<0||p>s.length||_<0||d>this.length)throw new RangeError("out of range index");if(_>=d&&c>=p)return 0;if(_>=d)return-1;if(c>=p)return 1;if(c>>>=0,p>>>=0,_>>>=0,d>>>=0,this===s)return 0;let x=d-_,Z=p-c,oe=Math.min(x,Z),k=this.slice(_,d),z=s.slice(c,p);for(let b=0;b2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,ot(c)&&(c=_?0:f.length-1),c<0&&(c=f.length+c),c>=f.length){if(_)return-1;c=f.length-1}else if(c<0)if(_)c=0;else return-1;if(typeof s=="string"&&(s=a.from(s,p)),a.isBuffer(s))return s.length===0?-1:he(f,s,c,p,_);if(typeof s=="number")return s=s&255,typeof Uint8Array.prototype.indexOf=="function"?_?Uint8Array.prototype.indexOf.call(f,s,c):Uint8Array.prototype.lastIndexOf.call(f,s,c):he(f,[s],c,p,_);throw new TypeError("val must be string, number or Buffer")}u(Y,"bidirectionalIndexOf");function he(f,s,c,p,_){let d=1,x=f.length,Z=s.length;if(p!==void 0&&(p=String(p).toLowerCase(),p==="ucs2"||p==="ucs-2"||p==="utf16le"||p==="utf-16le")){if(f.length<2||s.length<2)return-1;d=2,x/=2,Z/=2,c/=2}function oe(z,b){return d===1?z[b]:z.readUInt16BE(b*d)}u(oe,"read");let k;if(_){let z=-1;for(k=c;kx&&(c=x-Z),k=c;k>=0;k--){let z=!0;for(let b=0;b_&&(p=_)):p=_;let d=s.length;p>d/2&&(p=d/2);let x;for(x=0;x>>0,isFinite(p)?(p=p>>>0,_===void 0&&(_="utf8")):(_=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let d=this.length-c;if((p===void 0||p>d)&&(p=d),s.length>0&&(p<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");_||(_="utf8");let x=!1;for(;;)switch(_){case"hex":return q(this,s,c,p);case"utf8":case"utf-8":return ee(this,s,c,p);case"ascii":case"latin1":case"binary":return J(this,s,c,p);case"base64":return te(this,s,c,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,s,c,p);default:if(x)throw new TypeError("Unknown encoding: "+_);_=(""+_).toLowerCase(),x=!0}},"write"),a.prototype.toJSON=u(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function B(f,s,c){return s===0&&c===f.length?r.fromByteArray(f):r.fromByteArray(f.slice(s,c))}u(B,"base64Slice");function $(f,s,c){c=Math.min(f.length,c);let p=[],_=s;for(;_239?4:d>223?3:d>191?2:1;if(_+Z<=c){let oe,k,z,b;switch(Z){case 1:d<128&&(x=d);break;case 2:oe=f[_+1],(oe&192)===128&&(b=(d&31)<<6|oe&63,b>127&&(x=b));break;case 3:oe=f[_+1],k=f[_+2],(oe&192)===128&&(k&192)===128&&(b=(d&15)<<12|(oe&63)<<6|k&63,b>2047&&(b<55296||b>57343)&&(x=b));break;case 4:oe=f[_+1],k=f[_+2],z=f[_+3],(oe&192)===128&&(k&192)===128&&(z&192)===128&&(b=(d&15)<<18|(oe&63)<<12|(k&63)<<6|z&63,b>65535&&b<1114112&&(x=b))}}x===null?(x=65533,Z=1):x>65535&&(x-=65536,p.push(x>>>10&1023|55296),x=56320|x&1023),p.push(x),_+=Z}return _e(p)}u($,"utf8Slice");let ne=4096;function _e(f){let s=f.length;if(s<=ne)return String.fromCharCode.apply(String,f);let c="",p=0;for(;pp)&&(c=p);let _="";for(let d=s;dp&&(s=p),c<0?(c+=p,c<0&&(c=0)):c>p&&(c=p),cc)throw new RangeError("Trying to access beyond buffer length")}u(V,"checkOffset"),a.prototype.readUintLE=a.prototype.readUIntLE=u(function(s,c,p){s=s>>>0,c=c>>>0,p||V(s,c,this.length);let _=this[s],d=1,x=0;for(;++x>>0,c=c>>>0,p||V(s,c,this.length);let _=this[s+--c],d=1;for(;c>0&&(d*=256);)_+=this[s+--c]*d;return _},"readUIntBE"),a.prototype.readUint8=a.prototype.readUInt8=u(function(s,c){return s=s>>>0,c||V(s,1,this.length),this[s]},"readUInt8"),a.prototype.readUint16LE=a.prototype.readUInt16LE=u(function(s,c){return s=s>>>0,c||V(s,2,this.length),this[s]|this[s+1]<<8},"readUInt16LE"),a.prototype.readUint16BE=a.prototype.readUInt16BE=u(function(s,c){return s=s>>>0,c||V(s,2,this.length),this[s]<<8|this[s+1]},"readUInt16BE"),a.prototype.readUint32LE=a.prototype.readUInt32LE=u(function(s,c){return s=s>>>0,c||V(s,4,this.length),(this[s]|this[s+1]<<8|this[s+2]<<16)+this[s+3]*16777216},"readUInt32LE"),a.prototype.readUint32BE=a.prototype.readUInt32BE=u(function(s,c){return s=s>>>0,c||V(s,4,this.length),this[s]*16777216+(this[s+1]<<16|this[s+2]<<8|this[s+3])},"readUInt32BE"),a.prototype.readBigUInt64LE=Ke(u(function(s){s=s>>>0,I(s,"offset");let c=this[s],p=this[s+7];(c===void 0||p===void 0)&&R(s,this.length-8);let _=c+this[++s]*Re(2,8)+this[++s]*Re(2,16)+this[++s]*Re(2,24),d=this[++s]+this[++s]*Re(2,8)+this[++s]*Re(2,16)+p*Re(2,24);return BigInt(_)+(BigInt(d)<>>0,I(s,"offset");let c=this[s],p=this[s+7];(c===void 0||p===void 0)&&R(s,this.length-8);let _=c*Re(2,24)+this[++s]*Re(2,16)+this[++s]*Re(2,8)+this[++s],d=this[++s]*Re(2,24)+this[++s]*Re(2,16)+this[++s]*Re(2,8)+p;return(BigInt(_)<>>0,c=c>>>0,p||V(s,c,this.length);let _=this[s],d=1,x=0;for(;++x=d&&(_-=Math.pow(2,8*c)),_},"readIntLE"),a.prototype.readIntBE=u(function(s,c,p){s=s>>>0,c=c>>>0,p||V(s,c,this.length);let _=c,d=1,x=this[s+--_];for(;_>0&&(d*=256);)x+=this[s+--_]*d;return d*=128,x>=d&&(x-=Math.pow(2,8*c)),x},"readIntBE"),a.prototype.readInt8=u(function(s,c){return s=s>>>0,c||V(s,1,this.length),this[s]&128?(255-this[s]+1)*-1:this[s]},"readInt8"),a.prototype.readInt16LE=u(function(s,c){s=s>>>0,c||V(s,2,this.length);let p=this[s]|this[s+1]<<8;return p&32768?p|4294901760:p},"readInt16LE"),a.prototype.readInt16BE=u(function(s,c){s=s>>>0,c||V(s,2,this.length);let p=this[s+1]|this[s]<<8;return p&32768?p|4294901760:p},"readInt16BE"),a.prototype.readInt32LE=u(function(s,c){return s=s>>>0,c||V(s,4,this.length),this[s]|this[s+1]<<8|this[s+2]<<16|this[s+3]<<24},"readInt32LE"),a.prototype.readInt32BE=u(function(s,c){return s=s>>>0,c||V(s,4,this.length),this[s]<<24|this[s+1]<<16|this[s+2]<<8|this[s+3]},"readInt32BE"),a.prototype.readBigInt64LE=Ke(u(function(s){s=s>>>0,I(s,"offset");let c=this[s],p=this[s+7];(c===void 0||p===void 0)&&R(s,this.length-8);let _=this[s+4]+this[s+5]*Re(2,8)+this[s+6]*Re(2,16)+(p<<24);return(BigInt(_)<>>0,I(s,"offset");let c=this[s],p=this[s+7];(c===void 0||p===void 0)&&R(s,this.length-8);let _=(c<<24)+this[++s]*Re(2,16)+this[++s]*Re(2,8)+this[++s];return(BigInt(_)<>>0,c||V(s,4,this.length),t.read(this,s,!0,23,4)},"readFloatLE"),a.prototype.readFloatBE=u(function(s,c){return s=s>>>0,c||V(s,4,this.length),t.read(this,s,!1,23,4)},"readFloatBE"),a.prototype.readDoubleLE=u(function(s,c){return s=s>>>0,c||V(s,8,this.length),t.read(this,s,!0,52,8)},"readDoubleLE"),a.prototype.readDoubleBE=u(function(s,c){return s=s>>>0,c||V(s,8,this.length),t.read(this,s,!1,52,8)},"readDoubleBE");function ie(f,s,c,p,_,d){if(!a.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(s>_||sf.length)throw new RangeError("Index out of range")}u(ie,"checkInt"),a.prototype.writeUintLE=a.prototype.writeUIntLE=u(function(s,c,p,_){if(s=+s,c=c>>>0,p=p>>>0,!_){let Z=Math.pow(2,8*p)-1;ie(this,s,c,p,Z,0)}let d=1,x=0;for(this[c]=s&255;++x>>0,p=p>>>0,!_){let Z=Math.pow(2,8*p)-1;ie(this,s,c,p,Z,0)}let d=p-1,x=1;for(this[c+d]=s&255;--d>=0&&(x*=256);)this[c+d]=s/x&255;return c+p},"writeUIntBE"),a.prototype.writeUint8=a.prototype.writeUInt8=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,1,255,0),this[c]=s&255,c+1},"writeUInt8"),a.prototype.writeUint16LE=a.prototype.writeUInt16LE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,2,65535,0),this[c]=s&255,this[c+1]=s>>>8,c+2},"writeUInt16LE"),a.prototype.writeUint16BE=a.prototype.writeUInt16BE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,2,65535,0),this[c]=s>>>8,this[c+1]=s&255,c+2},"writeUInt16BE"),a.prototype.writeUint32LE=a.prototype.writeUInt32LE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,4,4294967295,0),this[c+3]=s>>>24,this[c+2]=s>>>16,this[c+1]=s>>>8,this[c]=s&255,c+4},"writeUInt32LE"),a.prototype.writeUint32BE=a.prototype.writeUInt32BE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,4,4294967295,0),this[c]=s>>>24,this[c+1]=s>>>16,this[c+2]=s>>>8,this[c+3]=s&255,c+4},"writeUInt32BE");function me(f,s,c,p,_){xe(s,p,_,f,c,7);let d=Number(s&BigInt(4294967295));f[c++]=d,d=d>>8,f[c++]=d,d=d>>8,f[c++]=d,d=d>>8,f[c++]=d;let x=Number(s>>BigInt(32)&BigInt(4294967295));return f[c++]=x,x=x>>8,f[c++]=x,x=x>>8,f[c++]=x,x=x>>8,f[c++]=x,c}u(me,"wrtBigUInt64LE");function Fe(f,s,c,p,_){xe(s,p,_,f,c,7);let d=Number(s&BigInt(4294967295));f[c+7]=d,d=d>>8,f[c+6]=d,d=d>>8,f[c+5]=d,d=d>>8,f[c+4]=d;let x=Number(s>>BigInt(32)&BigInt(4294967295));return f[c+3]=x,x=x>>8,f[c+2]=x,x=x>>8,f[c+1]=x,x=x>>8,f[c]=x,c+8}u(Fe,"wrtBigUInt64BE"),a.prototype.writeBigUInt64LE=Ke(u(function(s,c=0){return me(this,s,c,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE")),a.prototype.writeBigUInt64BE=Ke(u(function(s,c=0){return Fe(this,s,c,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")),a.prototype.writeIntLE=u(function(s,c,p,_){if(s=+s,c=c>>>0,!_){let oe=Math.pow(2,8*p-1);ie(this,s,c,p,oe-1,-oe)}let d=0,x=1,Z=0;for(this[c]=s&255;++d>0)-Z&255;return c+p},"writeIntLE"),a.prototype.writeIntBE=u(function(s,c,p,_){if(s=+s,c=c>>>0,!_){let oe=Math.pow(2,8*p-1);ie(this,s,c,p,oe-1,-oe)}let d=p-1,x=1,Z=0;for(this[c+d]=s&255;--d>=0&&(x*=256);)s<0&&Z===0&&this[c+d+1]!==0&&(Z=1),this[c+d]=(s/x>>0)-Z&255;return c+p},"writeIntBE"),a.prototype.writeInt8=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,1,127,-128),s<0&&(s=255+s+1),this[c]=s&255,c+1},"writeInt8"),a.prototype.writeInt16LE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,2,32767,-32768),this[c]=s&255,this[c+1]=s>>>8,c+2},"writeInt16LE"),a.prototype.writeInt16BE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,2,32767,-32768),this[c]=s>>>8,this[c+1]=s&255,c+2},"writeInt16BE"),a.prototype.writeInt32LE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,4,2147483647,-2147483648),this[c]=s&255,this[c+1]=s>>>8,this[c+2]=s>>>16,this[c+3]=s>>>24,c+4},"writeInt32LE"),a.prototype.writeInt32BE=u(function(s,c,p){return s=+s,c=c>>>0,p||ie(this,s,c,4,2147483647,-2147483648),s<0&&(s=4294967295+s+1),this[c]=s>>>24,this[c+1]=s>>>16,this[c+2]=s>>>8,this[c+3]=s&255,c+4},"writeInt32BE"),a.prototype.writeBigInt64LE=Ke(u(function(s,c=0){return me(this,s,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE")),a.prototype.writeBigInt64BE=Ke(u(function(s,c=0){return Fe(this,s,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Ne(f,s,c,p,_,d){if(c+p>f.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}u(Ne,"checkIEEE754");function Ae(f,s,c,p,_){return s=+s,c=c>>>0,_||Ne(f,s,c,4),t.write(f,s,c,p,23,4),c+4}u(Ae,"writeFloat"),a.prototype.writeFloatLE=u(function(s,c,p){return Ae(this,s,c,!0,p)},"writeFloatLE"),a.prototype.writeFloatBE=u(function(s,c,p){return Ae(this,s,c,!1,p)},"writeFloatBE");function Le(f,s,c,p,_){return s=+s,c=c>>>0,_||Ne(f,s,c,8),t.write(f,s,c,p,52,8),c+8}u(Le,"writeDouble"),a.prototype.writeDoubleLE=u(function(s,c,p){return Le(this,s,c,!0,p)},"writeDoubleLE"),a.prototype.writeDoubleBE=u(function(s,c,p){return Le(this,s,c,!1,p)},"writeDoubleBE"),a.prototype.copy=u(function(s,c,p,_){if(!a.isBuffer(s))throw new TypeError("argument should be a Buffer");if(p||(p=0),!_&&_!==0&&(_=this.length),c>=s.length&&(c=s.length),c||(c=0),_>0&&_=this.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("sourceEnd out of bounds");_>this.length&&(_=this.length),s.length-c<_-p&&(_=s.length-c+p);let d=_-p;return this===s&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(c,p,_):Uint8Array.prototype.set.call(s,this.subarray(p,_),c),d},"copy"),a.prototype.fill=u(function(s,c,p,_){if(typeof s=="string"){if(typeof c=="string"?(_=c,c=0,p=this.length):typeof p=="string"&&(_=p,p=this.length),_!==void 0&&typeof _!="string")throw new TypeError("encoding must be a string");if(typeof _=="string"&&!a.isEncoding(_))throw new TypeError("Unknown encoding: "+_);if(s.length===1){let x=s.charCodeAt(0);(_==="utf8"&&x<128||_==="latin1")&&(s=x)}}else typeof s=="number"?s=s&255:typeof s=="boolean"&&(s=Number(s));if(c<0||this.length>>0,p=p===void 0?this.length:p>>>0,s||(s=0);let d;if(typeof s=="number")for(d=c;dRe(2,32)?_=re(String(c)):typeof c=="bigint"&&(_=String(c),(c>Re(BigInt(2),BigInt(32))||c<-Re(BigInt(2),BigInt(32)))&&(_=re(_)),_+="n"),p+=` It must be ${s}. Received ${_}`,p},RangeError);function re(f){let s="",c=f.length,p=f[0]==="-"?1:0;for(;c>=p+4;c-=3)s=`_${f.slice(c-3,c)}${s}`;return`${f.slice(0,c)}${s}`}u(re,"addNumericalSeparator");function be(f,s,c){I(s,"offset"),(f[s]===void 0||f[s+c]===void 0)&&R(s,f.length-(c+1))}u(be,"checkBounds");function xe(f,s,c,p,_,d){if(f>c||f3?s===0||s===BigInt(0)?Z=`>= 0${x} and < 2${x} ** ${(d+1)*8}${x}`:Z=`>= -(2${x} ** ${(d+1)*8-1}${x}) and < 2 ** ${(d+1)*8-1}${x}`:Z=`>= ${s}${x} and <= ${c}${x}`,new M.ERR_OUT_OF_RANGE("value",Z,f)}be(p,_,d)}u(xe,"checkIntBI");function I(f,s){if(typeof f!="number")throw new M.ERR_INVALID_ARG_TYPE(s,"number",f)}u(I,"validateNumber");function R(f,s,c){throw Math.floor(f)!==f?(I(f,c),new M.ERR_OUT_OF_RANGE(c||"offset","an integer",f)):s<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE(c||"offset",`>= ${c?1:0} and <= ${s}`,f)}u(R,"boundsError");let ae=/[^+/0-9A-Za-z-_]/g;function ge(f){if(f=f.split("=")[0],f=f.trim().replace(ae,""),f.length<2)return"";for(;f.length%4!==0;)f=f+"=";return f}u(ge,"base64clean");function Pe(f,s){s=s||1/0;let c,p=f.length,_=null,d=[];for(let x=0;x55295&&c<57344){if(!_){if(c>56319){(s-=3)>-1&&d.push(239,191,189);continue}else if(x+1===p){(s-=3)>-1&&d.push(239,191,189);continue}_=c;continue}if(c<56320){(s-=3)>-1&&d.push(239,191,189),_=c;continue}c=(_-55296<<10|c-56320)+65536}else _&&(s-=3)>-1&&d.push(239,191,189);if(_=null,c<128){if((s-=1)<0)break;d.push(c)}else if(c<2048){if((s-=2)<0)break;d.push(c>>6|192,c&63|128)}else if(c<65536){if((s-=3)<0)break;d.push(c>>12|224,c>>6&63|128,c&63|128)}else if(c<1114112){if((s-=4)<0)break;d.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw new Error("Invalid code point")}return d}u(Pe,"utf8ToBytes");function Se(f){let s=[];for(let c=0;c>8,_=c%256,d.push(_),d.push(p);return d}u(ve,"utf16leToBytes");function et(f){return r.toByteArray(ge(f))}u(et,"base64ToBytes");function ct(f,s,c,p){let _;for(_=0;_=s.length||_>=f.length);++_)s[_+c]=f[_];return _}u(ct,"blitBuffer");function He(f,s){return f instanceof s||f!=null&&f.constructor!=null&&f.constructor.name!=null&&f.constructor.name===s.name}u(He,"isInstance");function ot(f){return f!==f}u(ot,"numberIsNaN");let Ut=function(){let f="0123456789abcdef",s=new Array(256);for(let c=0;c<16;++c){let p=c*16;for(let _=0;_<16;++_)s[p+_]=f[c]+f[_]}return s}();function Ke(f){return typeof BigInt=="undefined"?bt:f}u(Ke,"defineBigIntMethod");function bt(){throw new Error("BigInt not supported")}return u(bt,"BufferBigIntNotDefined"),di}u(xg,"dew$g");var gr=xg();gr.Buffer;gr.INSPECT_MAX_BYTES;gr.kMaxLength;var Uo={},vf=!1;function mi(){return vf||(vf=!0,typeof Object.create=="function"?Uo=u(function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):Uo=u(function(t,e){if(e){t.super_=e;var i=u(function(){},"TempCtor");i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}},"inherits")),Uo}u(mi,"dew$f");var vs={},Ef=!1;function Pf(){return Ef||(Ef=!0,vs=vt.EventEmitter),vs}u(Pf,"dew$e");var Es={},Sf=!1;function Ig(){if(Sf)return Es;Sf=!0;function r(v,S){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(v);S&&(A=A.filter(function(O){return Object.getOwnPropertyDescriptor(v,O).enumerable})),E.push.apply(E,A)}return E}u(r,"ownKeys");function t(v){for(var S=1;S0?this.tail.next=A:this.head=A,this.tail=A,++this.length},"push")},{key:"unshift",value:u(function(E){var A={data:E,next:this.head};this.length===0&&(this.tail=A),this.head=A,++this.length},"unshift")},{key:"shift",value:u(function(){if(this.length!==0){var E=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,E}},"shift")},{key:"clear",value:u(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:u(function(E){if(this.length===0)return"";for(var A=this.head,O=""+A.data;A=A.next;)O+=E+A.data;return O},"join")},{key:"concat",value:u(function(E){if(this.length===0)return l.alloc(0);for(var A=l.allocUnsafe(E>>>0),O=this.head,U=0;O;)w(O.data,A,U),U+=O.data.length,O=O.next;return A},"concat")},{key:"consume",value:u(function(E,A){var O;return Ej.length?j.length:E;if(W===j.length?U+=j:U+=j.slice(0,E),E-=W,E===0){W===j.length?(++O,A.next?this.head=A.next:this.head=this.tail=null):(this.head=A,A.data=j.slice(W));break}++O}return this.length-=O,U},"_getString")},{key:"_getBuffer",value:u(function(E){var A=l.allocUnsafe(E),O=this.head,U=1;for(O.data.copy(A),E-=O.data.length;O=O.next;){var j=O.data,W=E>j.length?j.length:E;if(j.copy(A,A.length-E,0,W),E-=W,E===0){W===j.length?(++U,O.next?this.head=O.next:this.head=this.tail=null):(this.head=O,O.data=j.slice(W));break}++U}return this.length-=U,A},"_getBuffer")},{key:g,value:u(function(E,A){return y(this,t({},A,{depth:0,customInspect:!1}))},"value")}]),v}(),Es}u(Ig,"dew$d");var Ss={},Ff=!1;function Uf(){if(Ff)return Ss;Ff=!0;var r=Ve;function t(l,m){var y=this,g=this._readableState&&this._readableState.destroyed,w=this._writableState&&this._writableState.destroyed;return g||w?(m?m(l):l&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(o,this,l)):r.nextTick(o,this,l)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(l||null,function(v){!m&&v?y._writableState?y._writableState.errorEmitted?r.nextTick(i,y):(y._writableState.errorEmitted=!0,r.nextTick(e,y,v)):r.nextTick(e,y,v):m?(r.nextTick(i,y),m(v)):r.nextTick(i,y)}),this)}u(t,"destroy");function e(l,m){o(l,m),i(l)}u(e,"emitErrorAndCloseNT");function i(l){l._writableState&&!l._writableState.emitClose||l._readableState&&!l._readableState.emitClose||l.emit("close")}u(i,"emitCloseNT");function n(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}u(n,"undestroy");function o(l,m){l.emit("error",m)}u(o,"emitErrorNT");function a(l,m){var y=l._readableState,g=l._writableState;y&&y.autoDestroy||g&&g.autoDestroy?l.destroy(m):l.emit("error",m)}return u(a,"errorOrDestroy"),Ss={destroy:t,undestroy:n,errorOrDestroy:a},Ss}u(Uf,"dew$c");var Fs={},xf=!1;function ji(){if(xf)return Fs;xf=!0;let r={};function t(a,l,m){m||(m=Error);function y(w,v,S){return typeof l=="string"?l:l(w,v,S)}u(y,"getMessage");class g extends m{constructor(v,S,E){super(y(v,S,E))}}u(g,"NodeError"),g.prototype.name=m.name,g.prototype.code=a,r[a]=g}u(t,"createErrorType");function e(a,l){if(Array.isArray(a)){let m=a.length;return a=a.map(y=>String(y)),m>2?`one of ${l} ${a.slice(0,m-1).join(", ")}, or `+a[m-1]:m===2?`one of ${l} ${a[0]} or ${a[1]}`:`of ${l} ${a[0]}`}else return`of ${l} ${String(a)}`}u(e,"oneOf");function i(a,l,m){return a.substr(!m||m<0?0:+m,l.length)===l}u(i,"startsWith");function n(a,l,m){return(m===void 0||m>a.length)&&(m=a.length),a.substring(m-l.length,m)===l}u(n,"endsWith");function o(a,l,m){return typeof m!="number"&&(m=0),m+l.length>a.length?!1:a.indexOf(l,m)!==-1}return u(o,"includes"),t("ERR_INVALID_OPT_VALUE",function(a,l){return'The value "'+l+'" is invalid for option "'+a+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(a,l,m){let y;typeof l=="string"&&i(l,"not ")?(y="must not be",l=l.replace(/^not /,"")):y="must be";let g;if(n(a," argument"))g=`The ${a} ${y} ${e(l,"type")}`;else{let w=o(a,".")?"property":"argument";g=`The "${a}" ${w} ${y} ${e(l,"type")}`}return g+=`. Received type ${typeof m}`,g},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Fs.codes=r,Fs}u(ji,"dew$b");var xs={},If=!1;function Mf(){if(If)return xs;If=!0;var r=ji().codes.ERR_INVALID_OPT_VALUE;function t(i,n,o){return i.highWaterMark!=null?i.highWaterMark:n?i[o]:null}u(t,"highWaterMarkFrom");function e(i,n,o,a){var l=t(n,a,o);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var m=a?o:"highWaterMark";throw new r(m,l)}return Math.floor(l)}return i.objectMode?16:16*1024}return u(e,"getHighWaterMark"),xs={getHighWaterMark:e},xs}u(Mf,"dew$a");var Is={},Tf=!1,Ts=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:global;function Tg(){if(Tf)return Is;Tf=!0,Is=r;function r(e,i){if(t("noDeprecation"))return e;var n=!1;function o(){if(!n){if(t("throwDeprecation"))throw new Error(i);t("traceDeprecation")?console.trace(i):console.warn(i),n=!0}return e.apply(this||Ts,arguments)}return u(o,"deprecated"),o}u(r,"deprecate");function t(e){try{if(!Ts.localStorage)return!1}catch(n){return!1}var i=Ts.localStorage[e];return i==null?!1:String(i).toLowerCase()==="true"}return u(t,"config"),Is}u(Tg,"dew$9");var As={},Af=!1,Ag=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:global;function Ps(){if(Af)return As;Af=!0;var r=Ve;As=J;function t(M){var L=this;this.next=null,this.entry=null,this.finish=function(){Le(L,M)}}u(t,"CorkedRequest");var e;J.WritableState=q;var i={deprecate:Tg()},n=Pf(),o=gr.Buffer,a=Ag.Uint8Array||function(){};function l(M){return o.from(M)}u(l,"_uint8ArrayToBuffer");function m(M){return o.isBuffer(M)||M instanceof a}u(m,"_isUint8Array");var y=Uf(),g=Mf(),w=g.getHighWaterMark,v=ji().codes,S=v.ERR_INVALID_ARG_TYPE,E=v.ERR_METHOD_NOT_IMPLEMENTED,A=v.ERR_MULTIPLE_CALLBACK,O=v.ERR_STREAM_CANNOT_PIPE,U=v.ERR_STREAM_DESTROYED,j=v.ERR_STREAM_NULL_VALUES,W=v.ERR_STREAM_WRITE_AFTER_END,se=v.ERR_UNKNOWN_ENCODING,Y=y.errorOrDestroy;mi()(J,n);function he(){}u(he,"nop");function q(M,L,re){e=e||pi(),M=M||{},typeof re!="boolean"&&(re=L instanceof e),this.objectMode=!!M.objectMode,re&&(this.objectMode=this.objectMode||!!M.writableObjectMode),this.highWaterMark=w(this,M,"writableHighWaterMark",re),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var be=M.decodeStrings===!1;this.decodeStrings=!be,this.defaultEncoding=M.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(xe){P(L,xe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=M.emitClose!==!1,this.autoDestroy=!!M.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}u(q,"WritableState"),q.prototype.getBuffer=u(function(){for(var L=this.bufferedRequest,re=[];L;)re.push(L),L=L.next;return re},"getBuffer"),function(){try{Object.defineProperty(q.prototype,"buffer",{get:i.deprecate(u(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(M){}}();var ee;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ee=Function.prototype[Symbol.hasInstance],Object.defineProperty(J,Symbol.hasInstance,{value:u(function(L){return ee.call(this,L)?!0:this!==J?!1:L&&L._writableState instanceof q},"value")})):ee=u(function(L){return L instanceof this},"realHasInstance");function J(M){e=e||pi();var L=this instanceof e;if(!L&&!ee.call(J,this))return new J(M);this._writableState=new q(M,this,L),this.writable=!0,M&&(typeof M.write=="function"&&(this._write=M.write),typeof M.writev=="function"&&(this._writev=M.writev),typeof M.destroy=="function"&&(this._destroy=M.destroy),typeof M.final=="function"&&(this._final=M.final)),n.call(this)}u(J,"Writable"),J.prototype.pipe=function(){Y(this,new O)};function te(M,L){var re=new W;Y(M,re),r.nextTick(L,re)}u(te,"writeAfterEnd");function ye(M,L,re,be){var xe;return re===null?xe=new j:typeof re!="string"&&!L.objectMode&&(xe=new S("chunk",["string","Buffer"],re)),xe?(Y(M,xe),r.nextTick(be,xe),!1):!0}u(ye,"validChunk"),J.prototype.write=function(M,L,re){var be=this._writableState,xe=!1,I=!be.objectMode&&m(M);return I&&!o.isBuffer(M)&&(M=l(M)),typeof L=="function"&&(re=L,L=null),I?L="buffer":L||(L=be.defaultEncoding),typeof re!="function"&&(re=he),be.ending?te(this,re):(I||ye(this,be,M,re))&&(be.pendingcb++,xe=$(this,be,I,M,L,re)),xe},J.prototype.cork=function(){this._writableState.corked++},J.prototype.uncork=function(){var M=this._writableState;M.corked&&(M.corked--,!M.writing&&!M.corked&&!M.bufferProcessing&&M.bufferedRequest&&V(this,M))},J.prototype.setDefaultEncoding=u(function(L){if(typeof L=="string"&&(L=L.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((L+"").toLowerCase())>-1))throw new se(L);return this._writableState.defaultEncoding=L,this},"setDefaultEncoding"),Object.defineProperty(J.prototype,"writableBuffer",{enumerable:!1,get:u(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function B(M,L,re){return!M.objectMode&&M.decodeStrings!==!1&&typeof L=="string"&&(L=o.from(L,re)),L}u(B,"decodeChunk"),Object.defineProperty(J.prototype,"writableHighWaterMark",{enumerable:!1,get:u(function(){return this._writableState.highWaterMark},"get")});function $(M,L,re,be,xe,I){if(!re){var R=B(L,be,xe);be!==R&&(re=!0,xe="buffer",be=R)}var ae=L.objectMode?1:be.length;L.length+=ae;var ge=L.length0)if(typeof R!="string"&&!Se.objectMode&&Object.getPrototypeOf(R)!==n.prototype&&(R=a(R)),ge)Se.endEmitted?he(I,new j):B(I,Se,R,!0);else if(Se.ended)he(I,new O);else{if(Se.destroyed)return!1;Se.reading=!1,Se.decoder&&!ae?(R=Se.decoder.write(R),Se.objectMode||R.length!==0?B(I,Se,R,!1):V(I,Se)):B(I,Se,R,!1)}else ge||(Se.reading=!1,V(I,Se))}return!Se.ended&&(Se.length=ne?I=ne:(I--,I|=I>>>1,I|=I>>>2,I|=I>>>4,I|=I>>>8,I|=I>>>16,I++),I}u(_e,"computeNewHighWaterMark");function pe(I,R){return I<=0||R.length===0&&R.ended?0:R.objectMode?1:I!==I?R.flowing&&R.length?R.buffer.head.data.length:R.length:(I>R.highWaterMark&&(R.highWaterMark=_e(I)),I<=R.length?I:R.ended?R.length:(R.needReadable=!0,0))}u(pe,"howMuchToRead"),te.prototype.read=function(I){y("read",I),I=parseInt(I,10);var R=this._readableState,ae=I;if(I!==0&&(R.emittedReadable=!1),I===0&&R.needReadable&&((R.highWaterMark!==0?R.length>=R.highWaterMark:R.length>0)||R.ended))return y("read: emitReadable",R.length,R.ended),R.length===0&&R.ended?re(this):D(this),null;if(I=pe(I,R),I===0&&R.ended)return R.length===0&&re(this),null;var ge=R.needReadable;y("need readable",ge),(R.length===0||R.length-I0?Pe=L(I,R):Pe=null,Pe===null?(R.needReadable=R.length<=R.highWaterMark,I=0):(R.length-=I,R.awaitDrain=0),R.length===0&&(R.ended||(R.needReadable=!0),ae!==I&&R.ended&&re(this)),Pe!==null&&this.emit("data",Pe),Pe};function P(I,R){if(y("onEofChunk"),!R.ended){if(R.decoder){var ae=R.decoder.end();ae&&ae.length&&(R.buffer.push(ae),R.length+=R.objectMode?1:ae.length)}R.ended=!0,R.sync?D(I):(R.needReadable=!1,R.emittedReadable||(R.emittedReadable=!0,K(I)))}}u(P,"onEofChunk");function D(I){var R=I._readableState;y("emitReadable",R.needReadable,R.emittedReadable),R.needReadable=!1,R.emittedReadable||(y("emitReadable",R.flowing),R.emittedReadable=!0,r.nextTick(K,I))}u(D,"emitReadable");function K(I){var R=I._readableState;y("emitReadable_",R.destroyed,R.length,R.ended),!R.destroyed&&(R.length||R.ended)&&(I.emit("readable"),R.emittedReadable=!1),R.needReadable=!R.flowing&&!R.ended&&R.length<=R.highWaterMark,M(I)}u(K,"emitReadable_");function V(I,R){R.readingMore||(R.readingMore=!0,r.nextTick(ie,I,R))}u(V,"maybeReadMore");function ie(I,R){for(;!R.reading&&!R.ended&&(R.length1&&xe(ge.pipes,I)!==-1)&&!He&&(y("false write response, pause",ge.awaitDrain),ge.awaitDrain++),ae.pause())}u(Ut,"ondata");function Ke(c){y("onerror",c),s(),I.removeListener("error",Ke),e(I,"error")===0&&he(I,c)}u(Ke,"onerror"),ee(I,"error",Ke);function bt(){I.removeListener("finish",f),s()}u(bt,"onclose"),I.once("close",bt);function f(){y("onfinish"),I.removeListener("close",bt),s()}u(f,"onfinish"),I.once("finish",f);function s(){y("unpipe"),ae.unpipe(I)}return u(s,"unpipe"),I.emit("pipe",ae),ge.flowing||(y("pipe resume"),ae.resume()),I};function me(I){return u(function(){var ae=I._readableState;y("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&e(I,"data")&&(ae.flowing=!0,M(I))},"pipeOnDrainFunctionResult")}u(me,"pipeOnDrain"),te.prototype.unpipe=function(I){var R=this._readableState,ae={hasUnpiped:!1};if(R.pipesCount===0)return this;if(R.pipesCount===1)return I&&I!==R.pipes?this:(I||(I=R.pipes),R.pipes=null,R.pipesCount=0,R.flowing=!1,I&&I.emit("unpipe",this,ae),this);if(!I){var ge=R.pipes,Pe=R.pipesCount;R.pipes=null,R.pipesCount=0,R.flowing=!1;for(var Se=0;Se0,ge.flowing!==!1&&this.resume()):I==="readable"&&!ge.endEmitted&&!ge.readableListening&&(ge.readableListening=ge.needReadable=!0,ge.flowing=!1,ge.emittedReadable=!1,y("on readable",ge.length,ge.reading),ge.length?D(this):ge.reading||r.nextTick(Ne,this)),ae},te.prototype.addListener=te.prototype.on,te.prototype.removeListener=function(I,R){var ae=i.prototype.removeListener.call(this,I,R);return I==="readable"&&r.nextTick(Fe,this),ae},te.prototype.removeAllListeners=function(I){var R=i.prototype.removeAllListeners.apply(this,arguments);return(I==="readable"||I===void 0)&&r.nextTick(Fe,this),R};function Fe(I){var R=I._readableState;R.readableListening=I.listenerCount("readable")>0,R.resumeScheduled&&!R.paused?R.flowing=!0:I.listenerCount("data")>0&&I.resume()}u(Fe,"updateReadableListening");function Ne(I){y("readable nexttick read 0"),I.read(0)}u(Ne,"nReadingNextTick"),te.prototype.resume=function(){var I=this._readableState;return I.flowing||(y("resume"),I.flowing=!I.readableListening,Ae(this,I)),I.paused=!1,this};function Ae(I,R){R.resumeScheduled||(R.resumeScheduled=!0,r.nextTick(Le,I,R))}u(Ae,"resume");function Le(I,R){y("resume",R.reading),R.reading||I.read(0),R.resumeScheduled=!1,I.emit("resume"),M(I),R.flowing&&!R.reading&&I.read(0)}u(Le,"resume_"),te.prototype.pause=function(){return y("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(y("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function M(I){var R=I._readableState;for(y("flow",R.flowing);R.flowing&&I.read()!==null;);}u(M,"flow"),te.prototype.wrap=function(I){var R=this,ae=this._readableState,ge=!1;I.on("end",function(){if(y("wrapped end"),ae.decoder&&!ae.ended){var ve=ae.decoder.end();ve&&ve.length&&R.push(ve)}R.push(null)}),I.on("data",function(ve){if(y("wrapped data"),ae.decoder&&(ve=ae.decoder.write(ve)),!(ae.objectMode&&ve==null)&&!(!ae.objectMode&&(!ve||!ve.length))){var et=R.push(ve);et||(ge=!0,I.pause())}});for(var Pe in I)this[Pe]===void 0&&typeof I[Pe]=="function"&&(this[Pe]=u(function(et){return u(function(){return I[et].apply(I,arguments)},"methodWrapReturnFunction")},"methodWrap")(Pe));for(var Se=0;Se=R.length?(R.decoder?ae=R.buffer.join(""):R.buffer.length===1?ae=R.buffer.first():ae=R.buffer.concat(R.length),R.buffer.clear()):ae=R.buffer.consume(I,R.decoder),ae}u(L,"fromList");function re(I){var R=I._readableState;y("endReadable",R.endEmitted),R.endEmitted||(R.ended=!0,r.nextTick(be,R,I))}u(re,"endReadable");function be(I,R){if(y("endReadableNT",I.endEmitted,I.length),!I.endEmitted&&I.length===0&&(I.endEmitted=!0,R.readable=!1,R.emit("end"),I.autoDestroy)){var ae=R._writableState;(!ae||ae.autoDestroy&&ae.finished)&&R.destroy()}}u(be,"endReadableNT"),typeof Symbol=="function"&&(te.from=function(I,R){return Y===void 0&&(Y=Og()),Y(te,I,R)});function xe(I,R){for(var ae=0,ge=I.length;ae0;return l(j,se,Y,function(he){O||(O=he),he&&U.forEach(m),!se&&(U.forEach(m),A(O))})});return S.reduce(y)}return u(w,"pipeline"),Ls=w,Ls}u(zf,"dew");vt.once=function(r,t){return new Promise((e,i)=>{function n(...a){o!==void 0&&r.removeListener("error",o),e(a)}u(n,"eventListener");let o;t!=="error"&&(o=u(a=>{r.removeListener(name,n),i(a)},"errorListener"),r.once("error",o)),r.once(t,n)})};vt.on=function(r,t){let e=[],i=[],n=null,o=!1,a={next(){return C(this,null,function*(){let g=e.shift();if(g)return createIterResult(g,!1);if(n){let w=Promise.reject(n);return n=null,w}return o?createIterResult(void 0,!0):new Promise((w,v)=>i.push({resolve:w,reject:v}))})},return(){return C(this,null,function*(){r.removeListener(t,l),r.removeListener("error",m),o=!0;for(let g of i)g.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)})},throw(g){n=g,r.removeListener(t,l),r.removeListener("error",m)},[Symbol.asyncIterator](){return this}};return r.on(t,l),r.on("error",m),a;function l(...g){let w=i.shift();w?w.resolve(createIterResult(g,!1)):e.push(g)}u(l,"eventHandler");function m(g){o=!0;let w=i.shift();w?w.reject(g):n=g,a.return()}u(m,"errorHandler")};var{EventEmitter:F1,defaultMaxListeners:x1,init:I1,listenerCount:T1,on:A1,once:R1}=vt;var js={},$f=!1,zs=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:global;function kg(){if($f)return js;$f=!0,js=e;var r=vt.EventEmitter,t=mi();t(e,r),e.Readable=Us(),e.Writable=Ps(),e.Duplex=pi(),e.Transform=Ms(),e.PassThrough=jf(),e.finished=Mo(),e.pipeline=zf(),e.Stream=e;function e(){r.call(this||zs)}return u(e,"Stream"),e.prototype.pipe=function(i,n){var o=this||zs;function a(S){i.writable&&i.write(S)===!1&&o.pause&&o.pause()}u(a,"ondata"),o.on("data",a);function l(){o.readable&&o.resume&&o.resume()}u(l,"ondrain"),i.on("drain",l),!i._isStdio&&(!n||n.end!==!1)&&(o.on("end",y),o.on("close",g));var m=!1;function y(){m||(m=!0,i.end())}u(y,"onend");function g(){m||(m=!0,typeof i.destroy=="function"&&i.destroy())}u(g,"onclose");function w(S){if(v(),r.listenerCount(this||zs,"error")===0)throw S}u(w,"onerror"),o.on("error",w),i.on("error",w);function v(){o.removeListener("data",a),i.removeListener("drain",l),o.removeListener("end",y),o.removeListener("close",g),o.removeListener("error",w),i.removeListener("error",w),o.removeListener("end",v),o.removeListener("close",v),i.removeListener("close",v)}return u(v,"cleanup"),o.on("end",v),o.on("close",v),i.on("close",v),i.emit("pipe",o),i},js}u(kg,"dew");var Lt=kg();var V1=Q._extend,K1=Q.callbackify,G1=Q.debuglog,Y1=Q.deprecate,X1=Q.format,J1=Q.inherits,Q1=Q.inspect,e2=Q.isArray,t2=Q.isBoolean,r2=Q.isBuffer,i2=Q.isDate,n2=Q.isError,o2=Q.isFunction,a2=Q.isNull,s2=Q.isNullOrUndefined,u2=Q.isNumber,c2=Q.isObject,l2=Q.isPrimitive,f2=Q.isRegExp,h2=Q.isString,d2=Q.isSymbol,p2=Q.isUndefined,m2=Q.log,$s=Q.promisify,g2=Q.types,y2=Q.TextEncoder=globalThis.TextEncoder,b2=Q.TextDecoder=globalThis.TextDecoder;var Zf=Lt.Readable;Zf.wrap=function(r,t){return t=Object.assign({objectMode:r.readableObjectMode!=null||r.objectMode!=null||!0},t),t.destroy=function(e,i){r.destroy(e),i(e)},new Zf(t).wrap(r)};var N2=Lt.Writable,D2=Lt.Duplex,L2=Lt.Transform,P2=Lt.PassThrough,U2=Lt.finished,M2=Lt.pipeline,j2=Lt.Stream,z2={finished:$s(Lt.finished),pipeline:$s(Lt.pipeline)};function Wf(r,t){if(r==null)throw new TypeError("Cannot convert first argument to object");for(var e=Object(r),i=1;i=0&&Hf.call(r.callee)==="[object Function]"),e},"r$1");Object.keys||(dn=Object.prototype.hasOwnProperty,Zs=Object.prototype.toString,qf=Sh,Ws=Object.prototype.propertyIsEnumerable,Vf=!Ws.call({toString:null},"toString"),Kf=Ws.call(function(){},"prototype"),pn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],jo=u(function(r){var t=r.constructor;return t&&t.prototype===r},"f"),Gf={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Yf=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!Gf["$"+r]&&dn.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{jo(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),Eh=u(function(r){var t=r!==null&&typeof r=="object",e=Zs.call(r)==="[object Function]",i=qf(r),n=t&&Zs.call(r)==="[object String]",o=[];if(!t&&!e&&!i)throw new TypeError("Object.keys called on a non-object");var a=Kf&&e;if(n&&r.length>0&&!dn.call(r,0))for(var l=0;l0)for(var m=0;m2?arguments[2]:{},i=Ug(t);Mg&&(i=zg.call(i,Object.getOwnPropertySymbols(t)));for(var n=0;n1&&typeof t!="boolean")throw new TypeError('"allowMissing" argument must be a boolean');for(var e=Jg(r),i=Qg("%"+(e.length>0?e[0]:"")+"%",t),n=1;n=e.length){var o=bi(i,e[n]);if(!t&&!(e[n]in i))throw new yn("base intrinsic for "+r+" exists, but the property is not available.");i=o?o.get||o.value:i[e[n]]}else i=i[e[n]];return i},"c$2"),Th,th=Ih,Ah=ey("%Function%"),ty=Ah.apply,ry=Ah.call;(Th=u(function(){return th.apply(ry,arguments)},"t$4")).apply=function(){return th.apply(ty,arguments)};var iy=Th,Js,Qs,rh=u(function(r){return r!=r},"i$3"),ny=(Js=u(function(r,t){return r===0&&t===0?1/r==1/t:r===t||!(!rh(r)||!rh(t))},"r$4"),Js),oy=(Qs=u(function(){return typeof Object.is=="function"?Object.is:ny},"n$4"),Qs),ay=Ko,sy=Ko,uy=Js,Rh=Qs,cy=u(function(){var r=oy();return ay(Object,{is:r},{is:function(){return Object.is!==r}}),r},"l$5"),Oh=iy(Rh(),Object);sy(Oh,{getPolyfill:Rh,implementation:uy,shim:cy});var Bh=Oh;ru=u(function(r){return r!=r},"N");var ru,iu,ly=ru,fy=(iu=u(function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:ly},"e$5"),Ko),hy=iu,dy=Ko,py=ru,kh=iu,my=u(function(){var r=hy();return fy(Number,{isNaN:r},{isNaN:function(){return Number.isNaN!==r}}),r},"o$6"),Ch=kh();dy(Ch,{getPolyfill:kh,implementation:py,shim:my});var gy=Ch,Gs={},ih=!1;function Nh(){if(ih)return Gs;function r(y){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g})(y)}u(r,"e");function t(y,g){return!g||r(g)!=="object"&&typeof g!="function"?function(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}(y):g}u(t,"n");function e(y){return(e=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)})(y)}u(e,"r");function i(y,g){return(i=Object.setPrototypeOf||function(w,v){return w.__proto__=v,w})(y,g)}u(i,"o"),ih=!0;var n,o,a={};function l(y,g,w){w||(w=Error);var v=function(S){function E(A,O,U){var j;return function(W,se){if(!(W instanceof se))throw new TypeError("Cannot call a class as a function")}(this,E),(j=t(this,e(E).call(this,function(W,se,Y){return typeof g=="string"?g:g(W,se,Y)}(A,O,U)))).code=y,j}return u(E,"a"),function(A,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(O&&O.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),O&&i(A,O)}(E,S),E}(w);a[y]=v}u(l,"f");function m(y,g){if(Array.isArray(y)){var w=y.length;return y=y.map(function(v){return String(v)}),w>2?"one of ".concat(g," ").concat(y.slice(0,w-1).join(", "),", or ")+y[w-1]:w===2?"one of ".concat(g," ").concat(y[0]," or ").concat(y[1]):"of ".concat(g," ").concat(y[0])}return"of ".concat(g," ").concat(String(y))}return u(m,"s"),l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(y,g,w){var v,S,E;if(n===void 0&&(n=tu()),n(typeof y=="string","'name' must be a string"),typeof g=="string"&&(S="not ",g.substr(0,S.length)===S)?(v="must not be",g=g.replace(/^not /,"")):v="must be",function(O,U,j){return(j===void 0||j>O.length)&&(j=O.length),O.substring(j-U.length,j)===U}(y," argument"))E="The ".concat(y," ").concat(v," ").concat(m(g,"type"));else{var A=function(O,U,j){return typeof j!="number"&&(j=0),!(j+U.length>O.length)&&O.indexOf(U,j)!==-1}(y,".")?"property":"argument";E='The "'.concat(y,'" ').concat(A," ").concat(v," ").concat(m(g,"type"))}return E+=". Received type ".concat(r(w))},TypeError),l("ERR_INVALID_ARG_VALUE",function(y,g){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=Q);var v=o.inspect(g);return v.length>128&&(v="".concat(v.slice(0,128),"...")),"The argument '".concat(y,"' ").concat(w,". Received ").concat(v)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(y,g,w){var v;return v=w&&w.constructor&&w.constructor.name?"instance of ".concat(w.constructor.name):"type ".concat(r(w)),"Expected ".concat(y,' to be returned from the "').concat(g,'"')+" function but got ".concat(v,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var y=arguments.length,g=new Array(y),w=0;w0,"At least one arg needs to be specified");var v="The ",S=g.length;switch(g=g.map(function(E){return'"'.concat(E,'"')}),S){case 1:v+="".concat(g[0]," argument");break;case 2:v+="".concat(g[0]," and ").concat(g[1]," arguments");break;default:v+=g.slice(0,S-1).join(", "),v+=", and ".concat(g[S-1]," arguments")}return"".concat(v," must be specified")},TypeError),Gs.codes=a,Gs}u(Nh,"i$5");var nh={},oh=!1;function yy(){if(oh)return nh;oh=!0;var r=Qe;function t(q,ee,J){return ee in q?Object.defineProperty(q,ee,{value:J,enumerable:!0,configurable:!0,writable:!0}):q[ee]=J,q}u(t,"r");function e(q,ee){for(var J=0;Jq.length)&&(J=q.length),q.substring(J-ee.length,J)===ee}u(S,"d");var E="",A="",O="",U="",j={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function W(q){var ee=Object.keys(q),J=Object.create(Object.getPrototypeOf(q));return ee.forEach(function(te){J[te]=q[te]}),Object.defineProperty(J,"message",{value:q.message}),J}u(W,"O");function se(q){return w(q,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}u(se,"x");function Y(q,ee,J){var te="",ye="",B=0,$="",ne=!1,_e=se(q),pe=_e.split(` `),P=se(ee).split(` `),D=0,K="";if(J==="strictEqual"&&g(q)==="object"&&g(ee)==="object"&&q!==null&&ee!==null&&(J="strictEqualObject"),pe.length===1&&P.length===1&&pe[0]!==P[0]){var V=pe[0].length+P[0].length;if(V<=10){if(!(g(q)==="object"&&q!==null||g(ee)==="object"&&ee!==null||q===0&&ee===0))return"".concat(j[J],` `)+"".concat(pe[0]," !== ").concat(P[0],` `)}else if(J!=="strictEqualObject"&&V<(r.stderr&&r.stderr.isTTY?r.stderr.columns:80)){for(;pe[0][D]===P[0][D];)D++;D>2&&(K=` `.concat(function(I,R){if(R=Math.floor(R),I.length==0||R==0)return"";var ae=I.length*R;for(R=Math.floor(Math.log(R)/Math.log(2));R;)I+=I,R--;return I+=I.substring(0,ae-I.length)}(" ",D),"^"),D=0)}}for(var ie=pe[pe.length-1],me=P[P.length-1];ie===me&&(D++<2?$=` `.concat(ie).concat($):te=ie,pe.pop(),P.pop(),pe.length!==0&&P.length!==0);)ie=pe[pe.length-1],me=P[P.length-1];var Fe=Math.max(pe.length,P.length);if(Fe===0){var Ne=_e.split(` `);if(Ne.length>30)for(Ne[26]="".concat(E,"...").concat(U);Ne.length>27;)Ne.pop();return"".concat(j.notIdentical,` `).concat(Ne.join(` `),` `)}D>3&&($=` `.concat(E,"...").concat(U).concat($),ne=!0),te!==""&&($=` `.concat(te).concat($),te="");var Ae=0,Le=j[J]+` `.concat(A,"+ actual").concat(U," ").concat(O,"- expected").concat(U),M=" ".concat(E,"...").concat(U," Lines skipped");for(D=0;D1&&D>2&&(L>4?(ye+=` `.concat(E,"...").concat(U),ne=!0):L>3&&(ye+=` `.concat(P[D-2]),Ae++),ye+=` `.concat(P[D-1]),Ae++),B=D,te+=` `.concat(O,"-").concat(U," ").concat(P[D]),Ae++;else if(P.length1&&D>2&&(L>4?(ye+=` `.concat(E,"...").concat(U),ne=!0):L>3&&(ye+=` `.concat(pe[D-2]),Ae++),ye+=` `.concat(pe[D-1]),Ae++),B=D,ye+=` `.concat(A,"+").concat(U," ").concat(pe[D]),Ae++;else{var re=P[D],be=pe[D],xe=be!==re&&(!S(be,",")||be.slice(0,-1)!==re);xe&&S(re,",")&&re.slice(0,-1)===be&&(xe=!1,be+=","),xe?(L>1&&D>2&&(L>4?(ye+=` `.concat(E,"...").concat(U),ne=!0):L>3&&(ye+=` `.concat(pe[D-2]),Ae++),ye+=` `.concat(pe[D-1]),Ae++),B=D,ye+=` `.concat(A,"+").concat(U," ").concat(be),te+=` `.concat(O,"-").concat(U," ").concat(re),Ae+=2):(ye+=te,te="",L!==1&&D!==0||(ye+=` `.concat(be),Ae++))}if(Ae>20&&D30)for(V[26]="".concat(E,"...").concat(U);V.length>27;)V.pop();B=V.length===1?i(this,y(ee).call(this,"".concat(K," ").concat(V[0]))):i(this,y(ee).call(this,"".concat(K,` `).concat(V.join(` `),` `)))}else{var ie=se(pe),me="",Fe=j[ne];ne==="notDeepEqual"||ne==="notEqual"?(ie="".concat(j[ne],` `).concat(ie)).length>1024&&(ie="".concat(ie.slice(0,1021),"...")):(me="".concat(se(P)),ie.length>512&&(ie="".concat(ie.slice(0,509),"...")),me.length>512&&(me="".concat(me.slice(0,509),"...")),ne==="deepEqual"||ne==="equal"?ie="".concat(Fe,` `).concat(ie,` should equal `):me=" ".concat(ne," ").concat(me)),B=i(this,y(ee).call(this,"".concat(ie).concat(me)))}return Error.stackTraceLimit=D,B.generatedMessage=!$,Object.defineProperty(n(B),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),B.code="ERR_ASSERTION",B.actual=pe,B.expected=P,B.operator=ne,Error.captureStackTrace&&Error.captureStackTrace(n(B),_e),B.stack,B.name="AssertionError",i(B)}u(ee,"e");var J,te;return function(ye,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function");ye.prototype=Object.create(B&&B.prototype,{constructor:{value:ye,writable:!0,configurable:!0}}),B&&m(ye,B)}(ee,q),J=ee,(te=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:w.custom,value:function(ye,B){return w(this,function($){for(var ne=1;ne10)return!0;for(var t=0;t57)return!0}return r.length===10&&r>=Math.pow(2,32)}u(Iy,"U");function Zo(r){return Object.keys(r).filter(Iy).concat(Ho(r).filter(Object.prototype.propertyIsEnumerable.bind(r)))}u(Zo,"G");function gh(r,t){if(r===t)return 0;for(var e=r.length,i=t.length,n=0,o=Math.min(e,i);n1?K-1:0),ie=1;ie1?K-1:0),ie=1;ie1?K-1:0),ie=1;ie1?K-1:0),ie=1;ie=0;)d[x]=0}u(o,"zero");var a=0,l=1,m=2,y=3,g=258,w=29,v=256,S=v+1+w,E=30,A=19,O=2*S+1,U=15,j=16,W=7,se=256,Y=16,he=17,q=18,ee=[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],J=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],te=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ye=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],B=512,$=new Array((S+2)*2);o($);var ne=new Array(E*2);o(ne);var _e=new Array(B);o(_e);var pe=new Array(g-y+1);o(pe);var P=new Array(w);o(P);var D=new Array(E);o(D);function K(d,x,Z,oe,k){this.static_tree=d,this.extra_bits=x,this.extra_base=Z,this.elems=oe,this.max_length=k,this.has_stree=d&&d.length}u(K,"StaticTreeDesc");var V,ie,me;function Fe(d,x){this.dyn_tree=d,this.max_code=0,this.stat_desc=x}u(Fe,"TreeDesc");function Ne(d){return d<256?_e[d]:_e[256+(d>>>7)]}u(Ne,"d_code");function Ae(d,x){d.pending_buf[d.pending++]=x&255,d.pending_buf[d.pending++]=x>>>8&255}u(Ae,"put_short");function Le(d,x,Z){d.bi_valid>j-Z?(d.bi_buf|=x<>j-d.bi_valid,d.bi_valid+=Z-j):(d.bi_buf|=x<>>=1,Z<<=1;while(--x>0);return Z>>>1}u(L,"bi_reverse");function re(d){d.bi_valid===16?(Ae(d,d.bi_buf),d.bi_buf=0,d.bi_valid=0):d.bi_valid>=8&&(d.pending_buf[d.pending++]=d.bi_buf&255,d.bi_buf>>=8,d.bi_valid-=8)}u(re,"bi_flush");function be(d,x){var Z=x.dyn_tree,oe=x.max_code,k=x.stat_desc.static_tree,z=x.stat_desc.has_stree,b=x.stat_desc.extra_bits,ce=x.stat_desc.extra_base,De=x.stat_desc.max_length,h,G,X,F,N,H,Ie=0;for(F=0;F<=U;F++)d.bl_count[F]=0;for(Z[d.heap[d.heap_max]*2+1]=0,h=d.heap_max+1;hDe&&(F=De,Ie++),Z[G*2+1]=F,!(G>oe)&&(d.bl_count[F]++,N=0,G>=ce&&(N=b[G-ce]),H=Z[G*2],d.opt_len+=H*(F+N),z&&(d.static_len+=H*(k[G*2+1]+N)));if(Ie!==0){do{for(F=De-1;d.bl_count[F]===0;)F--;d.bl_count[F]--,d.bl_count[F+1]+=2,d.bl_count[De]--,Ie-=2}while(Ie>0);for(F=De;F!==0;F--)for(G=d.bl_count[F];G!==0;)X=d.heap[--h],!(X>oe)&&(Z[X*2+1]!==F&&(d.opt_len+=(F-Z[X*2+1])*Z[X*2],Z[X*2+1]=F),G--)}}u(be,"gen_bitlen");function xe(d,x,Z){var oe=new Array(U+1),k=0,z,b;for(z=1;z<=U;z++)oe[z]=k=k+Z[z-1]<<1;for(b=0;b<=x;b++){var ce=d[b*2+1];ce!==0&&(d[b*2]=L(oe[ce]++,ce))}}u(xe,"gen_codes");function I(){var d,x,Z,oe,k,z=new Array(U+1);for(Z=0,oe=0;oe>=7;oe8?Ae(d,d.bi_buf):d.bi_valid>0&&(d.pending_buf[d.pending++]=d.bi_buf),d.bi_buf=0,d.bi_valid=0}u(ae,"bi_windup");function ge(d,x,Z,oe){ae(d),oe&&(Ae(d,Z),Ae(d,~Z)),r.arraySet(d.pending_buf,d.window,x,Z,d.pending),d.pending+=Z}u(ge,"copy_block");function Pe(d,x,Z,oe){var k=x*2,z=Z*2;return d[k]>1;b>=1;b--)Se(d,Z,b);h=z;do b=d.heap[1],d.heap[1]=d.heap[d.heap_len--],Se(d,Z,1),ce=d.heap[1],d.heap[--d.heap_max]=b,d.heap[--d.heap_max]=ce,Z[h*2]=Z[b*2]+Z[ce*2],d.depth[h]=(d.depth[b]>=d.depth[ce]?d.depth[b]:d.depth[ce])+1,Z[b*2+1]=Z[ce*2+1]=h,d.heap[1]=h++,Se(d,Z,1);while(d.heap_len>=2);d.heap[--d.heap_max]=d.heap[1],be(d,x),xe(Z,De,d.bl_count)}u(et,"build_tree");function ct(d,x,Z){var oe,k=-1,z,b=x[0*2+1],ce=0,De=7,h=4;for(b===0&&(De=138,h=3),x[(Z+1)*2+1]=65535,oe=0;oe<=Z;oe++)z=b,b=x[(oe+1)*2+1],!(++ce=3&&d.bl_tree[ye[x]*2+1]===0;x--);return d.opt_len+=3*(x+1)+5+5+4,x}u(ot,"build_bl_tree");function Ut(d,x,Z,oe){var k;for(Le(d,x-257,5),Le(d,Z-1,5),Le(d,oe-4,4),k=0;k>>=1)if(x&1&&d.dyn_ltree[Z*2]!==0)return e;if(d.dyn_ltree[9*2]!==0||d.dyn_ltree[10*2]!==0||d.dyn_ltree[13*2]!==0)return i;for(Z=32;Z0?(d.strm.data_type===n&&(d.strm.data_type=Ke(d)),et(d,d.l_desc),et(d,d.d_desc),b=ot(d),k=d.opt_len+3+7>>>3,z=d.static_len+3+7>>>3,z<=k&&(k=z)):k=z=Z+5,Z+4<=k&&x!==-1?s(d,x,Z,oe):d.strategy===t||z===k?(Le(d,(l<<1)+(oe?1:0),3),ve(d,$,ne)):(Le(d,(m<<1)+(oe?1:0),3),Ut(d,d.l_desc.max_code+1,d.d_desc.max_code+1,b+1),ve(d,d.dyn_ltree,d.dyn_dtree)),R(d),oe&&ae(d)}u(p,"_tr_flush_block");function _(d,x,Z){return d.pending_buf[d.d_buf+d.last_lit*2]=x>>>8&255,d.pending_buf[d.d_buf+d.last_lit*2+1]=x&255,d.pending_buf[d.l_buf+d.last_lit]=Z&255,d.last_lit++,x===0?d.dyn_ltree[Z*2]++:(d.matches++,x--,d.dyn_ltree[(pe[Z]+v+1)*2]++,d.dyn_dtree[Ne(x)*2]++),d.last_lit===d.lit_bufsize-1}return u(_,"_tr_tally"),wi._tr_init=f,wi._tr_stored_block=s,wi._tr_flush_block=p,wi._tr_tally=_,wi._tr_align=c,wi}u(By,"dew$a");var au={},Mh=!1;function Gh(){if(Mh)return au;Mh=!0;function r(t,e,i,n){for(var o=t&65535|0,a=t>>>16&65535|0,l=0;i!==0;){l=i>2e3?2e3:i,i-=l;do o=o+e[n++]|0,a=a+o|0;while(--l);o%=65521,a%=65521}return o|a<<16|0}return u(r,"adler32"),au=r,au}u(Gh,"dew$9");var su={},jh=!1;function Yh(){if(jh)return su;jh=!0;function r(){for(var i,n=[],o=0;o<256;o++){i=o;for(var a=0;a<8;a++)i=i&1?3988292384^i>>>1:i>>>1;n[o]=i}return n}u(r,"makeTable");var t=r();function e(i,n,o,a){var l=t,m=a+o;i^=-1;for(var y=a;y>>8^l[(i^n[y])&255];return i^-1}return u(e,"crc32"),su=e,su}u(Yh,"dew$8");var uu={},zh=!1;function ky(){return zh||(zh=!0,uu={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),uu}u(ky,"dew$7");var or={},$h=!1;function Cy(){if($h)return or;$h=!0;var r=Go(),t=By(),e=Gh(),i=Yh(),n=ky(),o=0,a=1,l=3,m=4,y=5,g=0,w=1,v=-2,S=-3,E=-5,A=-1,O=1,U=2,j=3,W=4,se=0,Y=2,he=8,q=9,ee=15,J=8,te=29,ye=256,B=ye+1+te,$=30,ne=19,_e=2*B+1,pe=15,P=3,D=258,K=D+P+1,V=32,ie=42,me=69,Fe=73,Ne=91,Ae=103,Le=113,M=666,L=1,re=2,be=3,xe=4,I=3;function R(h,G){return h.msg=n[G],G}u(R,"err");function ae(h){return(h<<1)-(h>4?9:0)}u(ae,"rank");function ge(h){for(var G=h.length;--G>=0;)h[G]=0}u(ge,"zero");function Pe(h){var G=h.state,X=G.pending;X>h.avail_out&&(X=h.avail_out),X!==0&&(r.arraySet(h.output,G.pending_buf,G.pending_out,X,h.next_out),h.next_out+=X,G.pending_out+=X,h.total_out+=X,h.avail_out-=X,G.pending-=X,G.pending===0&&(G.pending_out=0))}u(Pe,"flush_pending");function Se(h,G){t._tr_flush_block(h,h.block_start>=0?h.block_start:-1,h.strstart-h.block_start,G),h.block_start=h.strstart,Pe(h.strm)}u(Se,"flush_block_only");function ve(h,G){h.pending_buf[h.pending++]=G}u(ve,"put_byte");function et(h,G){h.pending_buf[h.pending++]=G>>>8&255,h.pending_buf[h.pending++]=G&255}u(et,"putShortMSB");function ct(h,G,X,F){var N=h.avail_in;return N>F&&(N=F),N===0?0:(h.avail_in-=N,r.arraySet(G,h.input,h.next_in,N,X),h.state.wrap===1?h.adler=e(h.adler,G,N,X):h.state.wrap===2&&(h.adler=i(h.adler,G,N,X)),h.next_in+=N,h.total_in+=N,N)}u(ct,"read_buf");function He(h,G){var X=h.max_chain_length,F=h.strstart,N,H,Ie=h.prev_length,we=h.nice_match,Ee=h.strstart>h.w_size-K?h.strstart-(h.w_size-K):0,$e=h.window,br=h.w_mask,at=h.prev,qe=h.strstart+D,wt=$e[F+Ie-1],xt=$e[F+Ie];h.prev_length>=h.good_match&&(X>>=2),we>h.lookahead&&(we=h.lookahead);do if(N=G,!($e[N+Ie]!==xt||$e[N+Ie-1]!==wt||$e[N]!==$e[F]||$e[++N]!==$e[F+1])){F+=2,N++;do;while($e[++F]===$e[++N]&&$e[++F]===$e[++N]&&$e[++F]===$e[++N]&&$e[++F]===$e[++N]&&$e[++F]===$e[++N]&&$e[++F]===$e[++N]&&$e[++F]===$e[++N]&&$e[++F]===$e[++N]&&FIe){if(h.match_start=G,Ie=H,H>=we)break;wt=$e[F+Ie-1],xt=$e[F+Ie]}}while((G=at[G&br])>Ee&&--X!==0);return Ie<=h.lookahead?Ie:h.lookahead}u(He,"longest_match");function ot(h){var G=h.w_size,X,F,N,H,Ie;do{if(H=h.window_size-h.lookahead-h.strstart,h.strstart>=G+(G-K)){r.arraySet(h.window,h.window,G,G,0),h.match_start-=G,h.strstart-=G,h.block_start-=G,F=h.hash_size,X=F;do N=h.head[--X],h.head[X]=N>=G?N-G:0;while(--F);F=G,X=F;do N=h.prev[--X],h.prev[X]=N>=G?N-G:0;while(--F);H+=G}if(h.strm.avail_in===0)break;if(F=ct(h.strm,h.window,h.strstart+h.lookahead,H),h.lookahead+=F,h.lookahead+h.insert>=P)for(Ie=h.strstart-h.insert,h.ins_h=h.window[Ie],h.ins_h=(h.ins_h<h.pending_buf_size-5&&(X=h.pending_buf_size-5);;){if(h.lookahead<=1){if(ot(h),h.lookahead===0&&G===o)return L;if(h.lookahead===0)break}h.strstart+=h.lookahead,h.lookahead=0;var F=h.block_start+X;if((h.strstart===0||h.strstart>=F)&&(h.lookahead=h.strstart-F,h.strstart=F,Se(h,!1),h.strm.avail_out===0)||h.strstart-h.block_start>=h.w_size-K&&(Se(h,!1),h.strm.avail_out===0))return L}return h.insert=0,G===m?(Se(h,!0),h.strm.avail_out===0?be:xe):(h.strstart>h.block_start&&(Se(h,!1),h.strm.avail_out===0),L)}u(Ut,"deflate_stored");function Ke(h,G){for(var X,F;;){if(h.lookahead=P&&(h.ins_h=(h.ins_h<=P)if(F=t._tr_tally(h,h.strstart-h.match_start,h.match_length-P),h.lookahead-=h.match_length,h.match_length<=h.max_lazy_match&&h.lookahead>=P){h.match_length--;do h.strstart++,h.ins_h=(h.ins_h<=P&&(h.ins_h=(h.ins_h<4096)&&(h.match_length=P-1)),h.prev_length>=P&&h.match_length<=h.prev_length){N=h.strstart+h.lookahead-P,F=t._tr_tally(h,h.strstart-1-h.prev_match,h.prev_length-P),h.lookahead-=h.prev_length-1,h.prev_length-=2;do++h.strstart<=N&&(h.ins_h=(h.ins_h<=P&&h.strstart>0&&(N=h.strstart-1,F=Ie[N],F===Ie[++N]&&F===Ie[++N]&&F===Ie[++N])){H=h.strstart+D;do;while(F===Ie[++N]&&F===Ie[++N]&&F===Ie[++N]&&F===Ie[++N]&&F===Ie[++N]&&F===Ie[++N]&&F===Ie[++N]&&F===Ie[++N]&&Nh.lookahead&&(h.match_length=h.lookahead)}if(h.match_length>=P?(X=t._tr_tally(h,1,h.match_length-P),h.lookahead-=h.match_length,h.strstart+=h.match_length,h.match_length=0):(X=t._tr_tally(h,0,h.window[h.strstart]),h.lookahead--,h.strstart++),X&&(Se(h,!1),h.strm.avail_out===0))return L}return h.insert=0,G===m?(Se(h,!0),h.strm.avail_out===0?be:xe):h.last_lit&&(Se(h,!1),h.strm.avail_out===0)?L:re}u(f,"deflate_rle");function s(h,G){for(var X;;){if(h.lookahead===0&&(ot(h),h.lookahead===0)){if(G===o)return L;break}if(h.match_length=0,X=t._tr_tally(h,0,h.window[h.strstart]),h.lookahead--,h.strstart++,X&&(Se(h,!1),h.strm.avail_out===0))return L}return h.insert=0,G===m?(Se(h,!0),h.strm.avail_out===0?be:xe):h.last_lit&&(Se(h,!1),h.strm.avail_out===0)?L:re}u(s,"deflate_huff");function c(h,G,X,F,N){this.good_length=h,this.max_lazy=G,this.nice_length=X,this.max_chain=F,this.func=N}u(c,"Config");var p;p=[new c(0,0,0,0,Ut),new c(4,4,8,4,Ke),new c(4,5,16,8,Ke),new c(4,6,32,32,Ke),new c(4,4,16,16,bt),new c(8,16,32,32,bt),new c(8,16,128,128,bt),new c(8,32,128,256,bt),new c(32,128,258,1024,bt),new c(32,258,258,4096,bt)];function _(h){h.window_size=2*h.w_size,ge(h.head),h.max_lazy_match=p[h.level].max_lazy,h.good_match=p[h.level].good_length,h.nice_match=p[h.level].nice_length,h.max_chain_length=p[h.level].max_chain,h.strstart=0,h.block_start=0,h.lookahead=0,h.insert=0,h.match_length=h.prev_length=P-1,h.match_available=0,h.ins_h=0}u(_,"lm_init");function d(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=he,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(_e*2),this.dyn_dtree=new r.Buf16((2*$+1)*2),this.bl_tree=new r.Buf16((2*ne+1)*2),ge(this.dyn_ltree),ge(this.dyn_dtree),ge(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(pe+1),this.heap=new r.Buf16(2*B+1),ge(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*B+1),ge(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}u(d,"DeflateState");function x(h){var G;return!h||!h.state?R(h,v):(h.total_in=h.total_out=0,h.data_type=Y,G=h.state,G.pending=0,G.pending_out=0,G.wrap<0&&(G.wrap=-G.wrap),G.status=G.wrap?ie:Le,h.adler=G.wrap===2?0:1,G.last_flush=o,t._tr_init(G),g)}u(x,"deflateResetKeep");function Z(h){var G=x(h);return G===g&&_(h.state),G}u(Z,"deflateReset");function oe(h,G){return!h||!h.state||h.state.wrap!==2?v:(h.state.gzhead=G,g)}u(oe,"deflateSetHeader");function k(h,G,X,F,N,H){if(!h)return v;var Ie=1;if(G===A&&(G=6),F<0?(Ie=0,F=-F):F>15&&(Ie=2,F-=16),N<1||N>q||X!==he||F<8||F>15||G<0||G>9||H<0||H>W)return R(h,v);F===8&&(F=9);var we=new d;return h.state=we,we.strm=h,we.wrap=Ie,we.gzhead=null,we.w_bits=F,we.w_size=1<y||G<0)return h?R(h,v):v;if(F=h.state,!h.output||!h.input&&h.avail_in!==0||F.status===M&&G!==m)return R(h,h.avail_out===0?E:v);if(F.strm=h,X=F.last_flush,F.last_flush=G,F.status===ie)if(F.wrap===2)h.adler=0,ve(F,31),ve(F,139),ve(F,8),F.gzhead?(ve(F,(F.gzhead.text?1:0)+(F.gzhead.hcrc?2:0)+(F.gzhead.extra?4:0)+(F.gzhead.name?8:0)+(F.gzhead.comment?16:0)),ve(F,F.gzhead.time&255),ve(F,F.gzhead.time>>8&255),ve(F,F.gzhead.time>>16&255),ve(F,F.gzhead.time>>24&255),ve(F,F.level===9?2:F.strategy>=U||F.level<2?4:0),ve(F,F.gzhead.os&255),F.gzhead.extra&&F.gzhead.extra.length&&(ve(F,F.gzhead.extra.length&255),ve(F,F.gzhead.extra.length>>8&255)),F.gzhead.hcrc&&(h.adler=i(h.adler,F.pending_buf,F.pending,0)),F.gzindex=0,F.status=me):(ve(F,0),ve(F,0),ve(F,0),ve(F,0),ve(F,0),ve(F,F.level===9?2:F.strategy>=U||F.level<2?4:0),ve(F,I),F.status=Le);else{var Ie=he+(F.w_bits-8<<4)<<8,we=-1;F.strategy>=U||F.level<2?we=0:F.level<6?we=1:F.level===6?we=2:we=3,Ie|=we<<6,F.strstart!==0&&(Ie|=V),Ie+=31-Ie%31,F.status=Le,et(F,Ie),F.strstart!==0&&(et(F,h.adler>>>16),et(F,h.adler&65535)),h.adler=1}if(F.status===me)if(F.gzhead.extra){for(N=F.pending;F.gzindex<(F.gzhead.extra.length&65535)&&!(F.pending===F.pending_buf_size&&(F.gzhead.hcrc&&F.pending>N&&(h.adler=i(h.adler,F.pending_buf,F.pending-N,N)),Pe(h),N=F.pending,F.pending===F.pending_buf_size));)ve(F,F.gzhead.extra[F.gzindex]&255),F.gzindex++;F.gzhead.hcrc&&F.pending>N&&(h.adler=i(h.adler,F.pending_buf,F.pending-N,N)),F.gzindex===F.gzhead.extra.length&&(F.gzindex=0,F.status=Fe)}else F.status=Fe;if(F.status===Fe)if(F.gzhead.name){N=F.pending;do{if(F.pending===F.pending_buf_size&&(F.gzhead.hcrc&&F.pending>N&&(h.adler=i(h.adler,F.pending_buf,F.pending-N,N)),Pe(h),N=F.pending,F.pending===F.pending_buf_size)){H=1;break}F.gzindexN&&(h.adler=i(h.adler,F.pending_buf,F.pending-N,N)),H===0&&(F.gzindex=0,F.status=Ne)}else F.status=Ne;if(F.status===Ne)if(F.gzhead.comment){N=F.pending;do{if(F.pending===F.pending_buf_size&&(F.gzhead.hcrc&&F.pending>N&&(h.adler=i(h.adler,F.pending_buf,F.pending-N,N)),Pe(h),N=F.pending,F.pending===F.pending_buf_size)){H=1;break}F.gzindexN&&(h.adler=i(h.adler,F.pending_buf,F.pending-N,N)),H===0&&(F.status=Ae)}else F.status=Ae;if(F.status===Ae&&(F.gzhead.hcrc?(F.pending+2>F.pending_buf_size&&Pe(h),F.pending+2<=F.pending_buf_size&&(ve(F,h.adler&255),ve(F,h.adler>>8&255),h.adler=0,F.status=Le)):F.status=Le),F.pending!==0){if(Pe(h),h.avail_out===0)return F.last_flush=-1,g}else if(h.avail_in===0&&ae(G)<=ae(X)&&G!==m)return R(h,E);if(F.status===M&&h.avail_in!==0)return R(h,E);if(h.avail_in!==0||F.lookahead!==0||G!==o&&F.status!==M){var Ee=F.strategy===U?s(F,G):F.strategy===j?f(F,G):p[F.level].func(F,G);if((Ee===be||Ee===xe)&&(F.status=M),Ee===L||Ee===be)return h.avail_out===0&&(F.last_flush=-1),g;if(Ee===re&&(G===a?t._tr_align(F):G!==y&&(t._tr_stored_block(F,0,0,!1),G===l&&(ge(F.head),F.lookahead===0&&(F.strstart=0,F.block_start=0,F.insert=0))),Pe(h),h.avail_out===0))return F.last_flush=-1,g}return G!==m?g:F.wrap<=0?w:(F.wrap===2?(ve(F,h.adler&255),ve(F,h.adler>>8&255),ve(F,h.adler>>16&255),ve(F,h.adler>>24&255),ve(F,h.total_in&255),ve(F,h.total_in>>8&255),ve(F,h.total_in>>16&255),ve(F,h.total_in>>24&255)):(et(F,h.adler>>>16),et(F,h.adler&65535)),Pe(h),F.wrap>0&&(F.wrap=-F.wrap),F.pending!==0?g:w)}u(b,"deflate");function ce(h){var G;return!h||!h.state?v:(G=h.state.status,G!==ie&&G!==me&&G!==Fe&&G!==Ne&&G!==Ae&&G!==Le&&G!==M?R(h,v):(h.state=null,G===Le?R(h,S):g))}u(ce,"deflateEnd");function De(h,G){var X=G.length,F,N,H,Ie,we,Ee,$e,br;if(!h||!h.state||(F=h.state,Ie=F.wrap,Ie===2||Ie===1&&F.status!==ie||F.lookahead))return v;for(Ie===1&&(h.adler=e(h.adler,G,X,0)),F.wrap=0,X>=F.w_size&&(Ie===0&&(ge(F.head),F.strstart=0,F.block_start=0,F.insert=0),br=new r.Buf8(F.w_size),r.arraySet(br,G,X-F.w_size,F.w_size,0),G=br,X=F.w_size),we=h.avail_in,Ee=h.next_in,$e=h.input,h.avail_in=X,h.next_in=0,h.input=G,ot(F);F.lookahead>=P;){N=F.strstart,H=F.lookahead-(P-1);do F.ins_h=(F.ins_h<>>24,O>>>=q,U-=q,q=he>>>16&255,q===0)$[m++]=he&65535;else if(q&16){ee=he&65535,q&=15,q&&(U>>=q,U-=q),U<15&&(O+=B[a++]<>>24,O>>>=q,U-=q,q=he>>>16&255,q&16){if(J=he&65535,q&=15,Uw){i.msg="invalid distance too far back",o.mode=r;break e}if(O>>>=q,U-=q,q=m-y,J>q){if(q=J-q,q>S&&o.sane){i.msg="invalid distance too far back",o.mode=r;break e}if(te=0,ye=A,E===0){if(te+=v-q,q2;)$[m++]=ye[te++],$[m++]=ye[te++],$[m++]=ye[te++],ee-=3;ee&&($[m++]=ye[te++],ee>1&&($[m++]=ye[te++]))}else{te=m-J;do $[m++]=$[te++],$[m++]=$[te++],$[m++]=$[te++],ee-=3;while(ee>2);ee&&($[m++]=$[te++],ee>1&&($[m++]=$[te++]))}}else if(q&64){i.msg="invalid distance code",o.mode=r;break e}else{he=W[(he&65535)+(O&(1<>3,a-=ee,U-=ee<<3,O&=(1<=1&&Fe[ee]===0;ee--);if(J>ee&&(J=ee),ee===0)return O[U++]=1<<24|64<<16|0,O[U++]=1<<24|64<<16|0,W.bits=1,0;for(q=1;q0&&(v===n||ee!==1))return-1;for(Ne[1]=0,Y=1;Ye||v===a&&$>i)return 1;for(;;){M=Y-ye,j[he]me?(L=Ae[Le+j[he]],re=V[ie+j[he]]):(L=32+64,re=0),_e=1<>ye)+pe]=M<<24|L<<16|re|0;while(pe!==0);for(_e=1<>=1;if(_e!==0?(ne&=_e-1,ne+=_e):ne=0,he++,--Fe[Y]===0){if(Y===ee)break;Y=S[E+j[he]]}if(Y>J&&(ne&D)!==P){for(ye===0&&(ye=J),K+=q,te=Y-ye,B=1<e||v===a&&$>i)return 1;P=ne&D,O[P]=J<<24|te<<16|K-U|0}}return ne!==0&&(O[K+ne]=Y-ye<<24|64<<16|0),W.bits=J,0},"inflate_table"),lu}u(Dy,"dew$4");var Jt={},Hh=!1;function Ly(){if(Hh)return Jt;Hh=!0;var r=Go(),t=Gh(),e=Yh(),i=Ny(),n=Dy(),o=0,a=1,l=2,m=4,y=5,g=6,w=0,v=1,S=2,E=-2,A=-3,O=-4,U=-5,j=8,W=1,se=2,Y=3,he=4,q=5,ee=6,J=7,te=8,ye=9,B=10,$=11,ne=12,_e=13,pe=14,P=15,D=16,K=17,V=18,ie=19,me=20,Fe=21,Ne=22,Ae=23,Le=24,M=25,L=26,re=27,be=28,xe=29,I=30,R=31,ae=32,ge=852,Pe=592,Se=15,ve=Se;function et(k){return(k>>>24&255)+(k>>>8&65280)+((k&65280)<<8)+((k&255)<<24)}u(et,"zswap32");function ct(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}u(ct,"InflateState");function He(k){var z;return!k||!k.state?E:(z=k.state,k.total_in=k.total_out=z.total=0,k.msg="",z.wrap&&(k.adler=z.wrap&1),z.mode=W,z.last=0,z.havedict=0,z.dmax=32768,z.head=null,z.hold=0,z.bits=0,z.lencode=z.lendyn=new r.Buf32(ge),z.distcode=z.distdyn=new r.Buf32(Pe),z.sane=1,z.back=-1,w)}u(He,"inflateResetKeep");function ot(k){var z;return!k||!k.state?E:(z=k.state,z.wsize=0,z.whave=0,z.wnext=0,He(k))}u(ot,"inflateReset");function Ut(k,z){var b,ce;return!k||!k.state||(ce=k.state,z<0?(b=0,z=-z):(b=(z>>4)+1,z<48&&(z&=15)),z&&(z<8||z>15))?E:(ce.window!==null&&ce.wbits!==z&&(ce.window=null),ce.wrap=b,ce.wbits=z,ot(k))}u(Ut,"inflateReset2");function Ke(k,z){var b,ce;return k?(ce=new ct,k.state=ce,ce.window=null,b=Ut(k,z),b!==w&&(k.state=null),b):E}u(Ke,"inflateInit2");function bt(k){return Ke(k,ve)}u(bt,"inflateInit");var f=!0,s,c;function p(k){if(f){var z;for(s=new r.Buf32(512),c=new r.Buf32(32),z=0;z<144;)k.lens[z++]=8;for(;z<256;)k.lens[z++]=9;for(;z<280;)k.lens[z++]=7;for(;z<288;)k.lens[z++]=8;for(n(a,k.lens,0,288,s,0,k.work,{bits:9}),z=0;z<32;)k.lens[z++]=5;n(l,k.lens,0,32,c,0,k.work,{bits:5}),f=!1}k.lencode=s,k.lenbits=9,k.distcode=c,k.distbits=5}u(p,"fixedtables");function _(k,z,b,ce){var De,h=k.state;return h.window===null&&(h.wsize=1<=h.wsize?(r.arraySet(h.window,z,b-h.wsize,h.wsize,0),h.wnext=0,h.whave=h.wsize):(De=h.wsize-h.wnext,De>ce&&(De=ce),r.arraySet(h.window,z,b-ce,De,h.wnext),ce-=De,ce?(r.arraySet(h.window,z,b-ce,ce,0),h.wnext=ce,h.whave=h.wsize):(h.wnext+=De,h.wnext===h.wsize&&(h.wnext=0),h.whave>>8&255,b.check=e(b.check,St,2,0),N=0,H=0,b.mode=se;break}if(b.flags=0,b.head&&(b.head.done=!1),!(b.wrap&1)||(((N&255)<<8)+(N>>8))%31){k.msg="incorrect header check",b.mode=I;break}if((N&15)!==j){k.msg="unknown compression method",b.mode=I;break}if(N>>>=4,H-=4,pt=(N&15)+8,b.wbits===0)b.wbits=pt;else if(pt>b.wbits){k.msg="invalid window size",b.mode=I;break}b.dmax=1<>8&1),b.flags&512&&(St[0]=N&255,St[1]=N>>>8&255,b.check=e(b.check,St,2,0)),N=0,H=0,b.mode=Y;case Y:for(;H<32;){if(X===0)break e;X--,N+=ce[h++]<>>8&255,St[2]=N>>>16&255,St[3]=N>>>24&255,b.check=e(b.check,St,4,0)),N=0,H=0,b.mode=he;case he:for(;H<16;){if(X===0)break e;X--,N+=ce[h++]<>8),b.flags&512&&(St[0]=N&255,St[1]=N>>>8&255,b.check=e(b.check,St,2,0)),N=0,H=0,b.mode=q;case q:if(b.flags&1024){for(;H<16;){if(X===0)break e;X--,N+=ce[h++]<>>8&255,b.check=e(b.check,St,2,0)),N=0,H=0}else b.head&&(b.head.extra=null);b.mode=ee;case ee:if(b.flags&1024&&(Ee=b.length,Ee>X&&(Ee=X),Ee&&(b.head&&(pt=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),r.arraySet(b.head.extra,ce,h,Ee,pt)),b.flags&512&&(b.check=e(b.check,ce,Ee,h)),X-=Ee,h+=Ee,b.length-=Ee),b.length))break e;b.length=0,b.mode=J;case J:if(b.flags&2048){if(X===0)break e;Ee=0;do pt=ce[h+Ee++],b.head&&pt&&b.length<65536&&(b.head.name+=String.fromCharCode(pt));while(pt&&Ee>9&1,b.head.done=!0),k.adler=b.check=0,b.mode=ne;break;case B:for(;H<32;){if(X===0)break e;X--,N+=ce[h++]<>>=H&7,H-=H&7,b.mode=re;break}for(;H<3;){if(X===0)break e;X--,N+=ce[h++]<>>=1,H-=1,N&3){case 0:b.mode=pe;break;case 1:if(p(b),b.mode=me,z===g){N>>>=2,H-=2;break e}break;case 2:b.mode=K;break;case 3:k.msg="invalid block type",b.mode=I}N>>>=2,H-=2;break;case pe:for(N>>>=H&7,H-=H&7;H<32;){if(X===0)break e;X--,N+=ce[h++]<>>16^65535)){k.msg="invalid stored block lengths",b.mode=I;break}if(b.length=N&65535,N=0,H=0,b.mode=P,z===g)break e;case P:b.mode=D;case D:if(Ee=b.length,Ee){if(Ee>X&&(Ee=X),Ee>F&&(Ee=F),Ee===0)break e;r.arraySet(De,ce,h,Ee,G),X-=Ee,h+=Ee,F-=Ee,G+=Ee,b.length-=Ee;break}b.mode=ne;break;case K:for(;H<14;){if(X===0)break e;X--,N+=ce[h++]<>>=5,H-=5,b.ndist=(N&31)+1,N>>>=5,H-=5,b.ncode=(N&15)+4,N>>>=4,H-=4,b.nlen>286||b.ndist>30){k.msg="too many length or distance symbols",b.mode=I;break}b.have=0,b.mode=V;case V:for(;b.have>>=3,H-=3}for(;b.have<19;)b.lens[gu[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,wr={bits:b.lenbits},Ht=n(o,b.lens,0,19,b.lencode,0,b.work,wr),b.lenbits=wr.bits,Ht){k.msg="invalid code lengths set",b.mode=I;break}b.have=0,b.mode=ie;case ie:for(;b.have>>24,wt=at>>>16&255,xt=at&65535,!(qe<=H);){if(X===0)break e;X--,N+=ce[h++]<>>=qe,H-=qe,b.lens[b.have++]=xt;else{if(xt===16){for(ar=qe+2;H>>=qe,H-=qe,b.have===0){k.msg="invalid bit length repeat",b.mode=I;break}pt=b.lens[b.have-1],Ee=3+(N&3),N>>>=2,H-=2}else if(xt===17){for(ar=qe+3;H>>=qe,H-=qe,pt=0,Ee=3+(N&7),N>>>=3,H-=3}else{for(ar=qe+7;H>>=qe,H-=qe,pt=0,Ee=11+(N&127),N>>>=7,H-=7}if(b.have+Ee>b.nlen+b.ndist){k.msg="invalid bit length repeat",b.mode=I;break}for(;Ee--;)b.lens[b.have++]=pt}}if(b.mode===I)break;if(b.lens[256]===0){k.msg="invalid code -- missing end-of-block",b.mode=I;break}if(b.lenbits=9,wr={bits:b.lenbits},Ht=n(a,b.lens,0,b.nlen,b.lencode,0,b.work,wr),b.lenbits=wr.bits,Ht){k.msg="invalid literal/lengths set",b.mode=I;break}if(b.distbits=6,b.distcode=b.distdyn,wr={bits:b.distbits},Ht=n(l,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,wr),b.distbits=wr.bits,Ht){k.msg="invalid distances set",b.mode=I;break}if(b.mode=me,z===g)break e;case me:b.mode=Fe;case Fe:if(X>=6&&F>=258){k.next_out=G,k.avail_out=F,k.next_in=h,k.avail_in=X,b.hold=N,b.bits=H,i(k,we),G=k.next_out,De=k.output,F=k.avail_out,h=k.next_in,ce=k.input,X=k.avail_in,N=b.hold,H=b.bits,b.mode===ne&&(b.back=-1);break}for(b.back=0;at=b.lencode[N&(1<>>24,wt=at>>>16&255,xt=at&65535,!(qe<=H);){if(X===0)break e;X--,N+=ce[h++]<>Ot)],qe=at>>>24,wt=at>>>16&255,xt=at&65535,!(Ot+qe<=H);){if(X===0)break e;X--,N+=ce[h++]<>>=Ot,H-=Ot,b.back+=Ot}if(N>>>=qe,H-=qe,b.back+=qe,b.length=xt,wt===0){b.mode=L;break}if(wt&32){b.back=-1,b.mode=ne;break}if(wt&64){k.msg="invalid literal/length code",b.mode=I;break}b.extra=wt&15,b.mode=Ne;case Ne:if(b.extra){for(ar=b.extra;H>>=b.extra,H-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=Ae;case Ae:for(;at=b.distcode[N&(1<>>24,wt=at>>>16&255,xt=at&65535,!(qe<=H);){if(X===0)break e;X--,N+=ce[h++]<>Ot)],qe=at>>>24,wt=at>>>16&255,xt=at&65535,!(Ot+qe<=H);){if(X===0)break e;X--,N+=ce[h++]<>>=Ot,H-=Ot,b.back+=Ot}if(N>>>=qe,H-=qe,b.back+=qe,wt&64){k.msg="invalid distance code",b.mode=I;break}b.offset=xt,b.extra=wt&15,b.mode=Le;case Le:if(b.extra){for(ar=b.extra;H>>=b.extra,H-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){k.msg="invalid distance too far back",b.mode=I;break}b.mode=M;case M:if(F===0)break e;if(Ee=we-F,b.offset>Ee){if(Ee=b.offset-Ee,Ee>b.whave&&b.sane){k.msg="invalid distance too far back",b.mode=I;break}Ee>b.wnext?(Ee-=b.wnext,$e=b.wsize-Ee):$e=b.wnext-Ee,Ee>b.length&&(Ee=b.length),br=b.window}else br=De,$e=G-b.offset,Ee=b.length;Ee>F&&(Ee=F),F-=Ee,b.length-=Ee;do De[G++]=br[$e++];while(--Ee);b.length===0&&(b.mode=Fe);break;case L:if(F===0)break e;De[G++]=b.length,F--,b.mode=Fe;break;case re:if(b.wrap){for(;H<32;){if(X===0)break e;X--,N|=ce[h++]<de.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=w,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}return u(g,"Zlib"),g.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,e(this.init_done,"close before init"),e(this.mode<=de.UNZIP),this.mode===de.DEFLATE||this.mode===de.GZIP||this.mode===de.DEFLATERAW?n.deflateEnd(this.strm):(this.mode===de.INFLATE||this.mode===de.GUNZIP||this.mode===de.INFLATERAW||this.mode===de.UNZIP)&&o.inflateEnd(this.strm),this.mode=de.NONE,this.dictionary=null},g.prototype.write=function(w,v,S,E,A,O,U){return this._write(!0,w,v,S,E,A,O,U)},g.prototype.writeSync=function(w,v,S,E,A,O,U){return this._write(!1,w,v,S,E,A,O,U)},g.prototype._write=function(w,v,S,E,A,O,U,j){if(e.equal(arguments.length,8),e(this.init_done,"write before init"),e(this.mode!==de.NONE,"already finalized"),e.equal(!1,this.write_in_progress,"write already in progress"),e.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,e.equal(!1,v===void 0,"must provide flush value"),this.write_in_progress=!0,v!==de.Z_NO_FLUSH&&v!==de.Z_PARTIAL_FLUSH&&v!==de.Z_SYNC_FLUSH&&v!==de.Z_FULL_FLUSH&&v!==de.Z_FINISH&&v!==de.Z_BLOCK)throw new Error("Invalid flush value");if(S==null&&(S=r.alloc(0),A=0,E=0),this.strm.avail_in=A,this.strm.input=S,this.strm.next_in=E,this.strm.avail_out=j,this.strm.output=O,this.strm.next_out=U,this.flush=v,!w)return this._process(),this._checkError()?this._afterSync():void 0;var W=this;return t.nextTick(function(){W._process(),W._after()}),this},g.prototype._afterSync=function(){var w=this.strm.avail_out,v=this.strm.avail_in;return this.write_in_progress=!1,[v,w]},g.prototype._process=function(){var w=null;switch(this.mode){case de.DEFLATE:case de.GZIP:case de.DEFLATERAW:this.err=n.deflate(this.strm,this.flush);break;case de.UNZIP:switch(this.strm.avail_in>0&&(w=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(w===null)break;if(this.strm.input[w]===m){if(this.gzip_id_bytes_read=1,w++,this.strm.avail_in===1)break}else{this.mode=de.INFLATE;break}case 1:if(w===null)break;this.strm.input[w]===y?(this.gzip_id_bytes_read=2,this.mode=de.GUNZIP):this.mode=de.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case de.INFLATE:case de.GUNZIP:case de.INFLATERAW:for(this.err=o.inflate(this.strm,this.flush),this.err===de.Z_NEED_DICT&&this.dictionary&&(this.err=o.inflateSetDictionary(this.strm,this.dictionary),this.err===de.Z_OK?this.err=o.inflate(this.strm,this.flush):this.err===de.Z_DATA_ERROR&&(this.err=de.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===de.GUNZIP&&this.err===de.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=o.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},g.prototype._checkError=function(){switch(this.err){case de.Z_OK:case de.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===de.Z_FINISH)return this._error("unexpected end of file"),!1;break;case de.Z_STREAM_END:break;case de.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},g.prototype._after=function(){if(this._checkError()){var w=this.strm.avail_out,v=this.strm.avail_in;this.write_in_progress=!1,this.callback(v,w),this.pending_close&&this.close()}},g.prototype._error=function(w){this.strm.msg&&(w=this.strm.msg),this.onerror(w,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},g.prototype.init=function(w,v,S,E,A){e(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),e(w>=8&&w<=15,"invalid windowBits"),e(v>=-1&&v<=9,"invalid compression level"),e(S>=1&&S<=9,"invalid memlevel"),e(E===de.Z_FILTERED||E===de.Z_HUFFMAN_ONLY||E===de.Z_RLE||E===de.Z_FIXED||E===de.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(v,w,S,E,A),this._setDictionary()},g.prototype.params=function(){throw new Error("deflateParams Not supported")},g.prototype.reset=function(){this._reset(),this._setDictionary()},g.prototype._init=function(w,v,S,E,A){switch(this.level=w,this.windowBits=v,this.memLevel=S,this.strategy=E,this.flush=de.Z_NO_FLUSH,this.err=de.Z_OK,(this.mode===de.GZIP||this.mode===de.GUNZIP)&&(this.windowBits+=16),this.mode===de.UNZIP&&(this.windowBits+=32),(this.mode===de.DEFLATERAW||this.mode===de.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new i,this.mode){case de.DEFLATE:case de.GZIP:case de.DEFLATERAW:this.err=n.deflateInit2(this.strm,this.level,de.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case de.INFLATE:case de.GUNZIP:case de.INFLATERAW:case de.UNZIP:this.err=o.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==de.Z_OK&&this._error("Init error"),this.dictionary=A,this.write_in_progress=!1,this.init_done=!0},g.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=de.Z_OK,this.mode){case de.DEFLATE:case de.DEFLATERAW:this.err=n.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==de.Z_OK&&this._error("Failed to set dictionary")}},g.prototype._reset=function(){switch(this.err=de.Z_OK,this.mode){case de.DEFLATE:case de.DEFLATERAW:case de.GZIP:this.err=n.deflateReset(this.strm);break;case de.INFLATE:case de.INFLATERAW:case de.GUNZIP:this.err=o.inflateReset(this.strm);break}this.err!==de.Z_OK&&this._error("Failed to reset stream")},de.Zlib=g,de}u(Uy,"dew$1");var Te={},Kh=!1;function My(){if(Kh)return Te;Kh=!0;var r=Ve,t=gr.Buffer,e=Lt.Transform,i=Uy(),n=Q,o=Be.ok,a=gr.kMaxLength,l="Cannot create final Buffer. It would be larger than 0x"+a.toString(16)+" bytes";i.Z_MIN_WINDOWBITS=8,i.Z_MAX_WINDOWBITS=15,i.Z_DEFAULT_WINDOWBITS=15,i.Z_MIN_CHUNK=64,i.Z_MAX_CHUNK=1/0,i.Z_DEFAULT_CHUNK=16*1024,i.Z_MIN_MEMLEVEL=1,i.Z_MAX_MEMLEVEL=9,i.Z_DEFAULT_MEMLEVEL=8,i.Z_MIN_LEVEL=-1,i.Z_MAX_LEVEL=9,i.Z_DEFAULT_LEVEL=i.Z_DEFAULT_COMPRESSION;for(var m=Object.keys(i),y=0;y=a?ie=new RangeError(l):V=t.concat(_e,pe),_e=[],B.close(),ne(ie,V)}u(K,"onEnd")}u(A,"zlibBuffer");function O(B,$){if(typeof $=="string"&&($=t.from($)),!t.isBuffer($))throw new TypeError("Not a string or buffer");var ne=B._finishFlushFlag;return B._processChunk($,ne)}u(O,"zlibBufferSync");function U(B){if(!(this instanceof U))return new U(B);J.call(this,B,i.DEFLATE)}u(U,"Deflate");function j(B){if(!(this instanceof j))return new j(B);J.call(this,B,i.INFLATE)}u(j,"Inflate");function W(B){if(!(this instanceof W))return new W(B);J.call(this,B,i.GZIP)}u(W,"Gzip");function se(B){if(!(this instanceof se))return new se(B);J.call(this,B,i.GUNZIP)}u(se,"Gunzip");function Y(B){if(!(this instanceof Y))return new Y(B);J.call(this,B,i.DEFLATERAW)}u(Y,"DeflateRaw");function he(B){if(!(this instanceof he))return new he(B);J.call(this,B,i.INFLATERAW)}u(he,"InflateRaw");function q(B){if(!(this instanceof q))return new q(B);J.call(this,B,i.UNZIP)}u(q,"Unzip");function ee(B){return B===i.Z_NO_FLUSH||B===i.Z_PARTIAL_FLUSH||B===i.Z_SYNC_FLUSH||B===i.Z_FULL_FLUSH||B===i.Z_FINISH||B===i.Z_BLOCK}u(ee,"isValidFlushFlag");function J(B,$){var ne=this;if(this._opts=B=B||{},this._chunkSize=B.chunkSize||Te.Z_DEFAULT_CHUNK,e.call(this,B),B.flush&&!ee(B.flush))throw new Error("Invalid flush flag: "+B.flush);if(B.finishFlush&&!ee(B.finishFlush))throw new Error("Invalid flush flag: "+B.finishFlush);if(this._flushFlag=B.flush||i.Z_NO_FLUSH,this._finishFlushFlag=typeof B.finishFlush!="undefined"?B.finishFlush:i.Z_FINISH,B.chunkSize&&(B.chunkSizeTe.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+B.chunkSize);if(B.windowBits&&(B.windowBitsTe.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+B.windowBits);if(B.level&&(B.levelTe.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+B.level);if(B.memLevel&&(B.memLevelTe.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+B.memLevel);if(B.strategy&&B.strategy!=Te.Z_FILTERED&&B.strategy!=Te.Z_HUFFMAN_ONLY&&B.strategy!=Te.Z_RLE&&B.strategy!=Te.Z_FIXED&&B.strategy!=Te.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+B.strategy);if(B.dictionary&&!t.isBuffer(B.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new i.Zlib($);var _e=this;this._hadError=!1,this._handle.onerror=function(D,K){te(_e),_e._hadError=!0;var V=new Error(D);V.errno=K,V.code=Te.codes[K],_e.emit("error",V)};var pe=Te.Z_DEFAULT_COMPRESSION;typeof B.level=="number"&&(pe=B.level);var P=Te.Z_DEFAULT_STRATEGY;typeof B.strategy=="number"&&(P=B.strategy),this._handle.init(B.windowBits||Te.Z_DEFAULT_WINDOWBITS,pe,B.memLevel||Te.Z_DEFAULT_MEMLEVEL,P,B.dictionary),this._buffer=t.allocUnsafe(this._chunkSize),this._offset=0,this._level=pe,this._strategy=P,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!ne._handle},configurable:!0,enumerable:!0})}u(J,"Zlib"),n.inherits(J,e),J.prototype.params=function(B,$,ne){if(BTe.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+B);if($!=Te.Z_FILTERED&&$!=Te.Z_HUFFMAN_ONLY&&$!=Te.Z_RLE&&$!=Te.Z_FIXED&&$!=Te.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+$);if(this._level!==B||this._strategy!==$){var _e=this;this.flush(i.Z_SYNC_FLUSH,function(){o(_e._handle,"zlib binding closed"),_e._handle.params(B,$),_e._hadError||(_e._level=B,_e._strategy=$,ne&&ne())})}else r.nextTick(ne)},J.prototype.reset=function(){return o(this._handle,"zlib binding closed"),this._handle.reset()},J.prototype._flush=function(B){this._transform(t.alloc(0),"",B)},J.prototype.flush=function(B,$){var ne=this,_e=this._writableState;(typeof B=="function"||B===void 0&&!$)&&($=B,B=i.Z_FULL_FLUSH),_e.ended?$&&r.nextTick($):_e.ending?$&&this.once("end",$):_e.needDrain?$&&this.once("drain",function(){return ne.flush(B,$)}):(this._flushFlag=B,this.write(t.alloc(0),"",$))},J.prototype.close=function(B){te(this,B),r.nextTick(ye,this)};function te(B,$){$&&r.nextTick($),B._handle&&(B._handle.close(),B._handle=null)}u(te,"_close");function ye(B){B.emit("close")}return u(ye,"emitCloseNT"),J.prototype._transform=function(B,$,ne){var _e,pe=this._writableState,P=pe.ending||pe.ended,D=P&&(!B||pe.length===B.length);if(B!==null&&!t.isBuffer(B))return ne(new Error("invalid input"));if(!this._handle)return ne(new Error("zlib binding closed"));D?_e=this._finishFlushFlag:(_e=this._flushFlag,B.length>=pe.length&&(this._flushFlag=this._opts.flush||i.Z_NO_FLUSH)),this._processChunk(B,_e,ne)},J.prototype._processChunk=function(B,$,ne){var _e=B&&B.length,pe=this._chunkSize-this._offset,P=0,D=this,K=typeof ne=="function";if(!K){var V=[],ie=0,me;this.on("error",function(M){me=M}),o(this._handle,"zlib binding closed");do var Fe=this._handle.writeSync($,B,P,_e,this._buffer,this._offset,pe);while(!this._hadError&&Le(Fe[0],Fe[1]));if(this._hadError)throw me;if(ie>=a)throw te(this),new RangeError(l);var Ne=t.concat(V,ie);return te(this),Ne}o(this._handle,"zlib binding closed");var Ae=this._handle.write($,B,P,_e,this._buffer,this._offset,pe);Ae.buffer=B,Ae.callback=Le;function Le(M,L){if(this&&(this.buffer=null,this.callback=null),!D._hadError){var re=pe-L;if(o(re>=0,"have should not go down"),re>0){var be=D._buffer.slice(D._offset,D._offset+re);D._offset+=re,K?D.push(be):(V.push(be),ie+=be.length)}if((L===0||D._offset>=D._chunkSize)&&(pe=D._chunkSize,D._offset=0,D._buffer=t.allocUnsafe(D._chunkSize)),L===0){if(P+=_e-M,_e=M,!K)return!0;var xe=D._handle.write($,B,P,_e,D._buffer,D._offset,D._chunkSize);xe.callback=Le,xe.buffer=B;return}if(!K)return!1;ne()}}u(Le,"callback")},n.inherits(U,J),n.inherits(j,J),n.inherits(W,J),n.inherits(se,J),n.inherits(Y,J),n.inherits(he,J),n.inherits(q,J),Te}u(My,"dew");var le=My();le.codes;le.Deflate;le.Inflate;le.Gzip;le.Gunzip;le.DeflateRaw;le.InflateRaw;le.Unzip;le.createDeflate;le.createInflate;le.createDeflateRaw;le.createInflateRaw;le.createGzip;le.createGunzip;le.createUnzip;le.deflate;le.deflateSync;le.gzip;le.gzipSync;le.deflateRaw;le.deflateRawSync;le.unzip;le.unzipSync;le.inflate;le.inflateSync;le.gunzip;le.gunzipSync;le.inflateRaw;le.inflateRawSync;var RF=le.Deflate,OF=le.DeflateRaw,BF=le.Gunzip,kF=le.Gzip,CF=le.Inflate,NF=le.InflateRaw,DF=le.Unzip,LF=le.Z_BEST_COMPRESSION,PF=le.Z_BEST_SPEED,UF=le.Z_BINARY,MF=le.Z_BLOCK,jF=le.Z_BUF_ERROR,zF=le.Z_DATA_ERROR,$F=le.Z_DEFAULT_CHUNK,ZF=le.Z_DEFAULT_COMPRESSION,WF=le.Z_DEFAULT_LEVEL,HF=le.Z_DEFAULT_MEMLEVEL,qF=le.Z_DEFAULT_STRATEGY,VF=le.Z_DEFAULT_WINDOWBITS,KF=le.Z_DEFLATED,GF=le.Z_ERRNO,YF=le.Z_FILTERED,XF=le.Z_FINISH,JF=le.Z_FIXED,QF=le.Z_FULL_FLUSH,ex=le.Z_HUFFMAN_ONLY,tx=le.Z_MAX_CHUNK,rx=le.Z_MAX_LEVEL,ix=le.Z_MAX_MEMLEVEL,nx=le.Z_MAX_WINDOWBITS,ox=le.Z_MIN_CHUNK,ax=le.Z_MIN_LEVEL,sx=le.Z_MIN_MEMLEVEL,ux=le.Z_MIN_WINDOWBITS,cx=le.Z_NEED_DICT,lx=le.Z_NO_COMPRESSION,fx=le.Z_NO_FLUSH,hx=le.Z_OK,dx=le.Z_PARTIAL_FLUSH,px=le.Z_RLE,mx=le.Z_STREAM_END,gx=le.Z_STREAM_ERROR,yx=le.Z_SYNC_FLUSH,bx=le.Z_TEXT,wx=le.Z_TREES,_x=le.Z_UNKNOWN,vx=le.Zlib,Ex=le.codes,Sx=le.createDeflate,Fx=le.createDeflateRaw,xx=le.createGunzip,Ix=le.createGzip,Tx=le.createInflate,Ax=le.createInflateRaw,Rx=le.createUnzip,Ox=le.deflate,Bx=le.deflateRaw,kx=le.deflateRawSync,Cx=le.deflateSync,Nx=le.gunzip,Dx=le.gunzipSync,Lx=le.gzip,Px=le.gzipSync,Ux=le.inflate,Mx=le.inflateRaw,Xh=le.inflateRawSync,jx=le.inflateSync,zx=le.unzip,$x=le.unzipSync;var jy=["\xC7","\xFC","\xE9","\xE2","\xE4","\xE0","\xE5","\xE7","\xEA","\xEB","\xE8","\xEF","\xEE","\xEC","\xC4","\xC5","\xC9","\xE6","\xC6","\xF4","\xF6","\xF2","\xFB","\xF9","\xFF","\xD6","\xDC","\xF8","\xA3","\xD8","\xD7","\u0192","\xE1","\xED","\xF3","\xFA","\xF1","\xD1","\xAA","\xBA","\xBF","\xAE","\xAC","\xBD","\xBC","\xA1","\xAB","\xBB","_","_","_","\xA6","\xA6","\xC1","\xC2","\xC0","\xA9","\xA6","\xA6","+","+","\xA2","\xA5","+","+","-","-","+","-","+","\xE3","\xC3","+","+","-","-","\xA6","-","+","\xA4","\xF0","\xD0","\xCA","\xCB","\xC8","i","\xCD","\xCE","\xCF","+","+","_","_","\xA6","\xCC","_","\xD3","\xDF","\xD4","\xD2","\xF5","\xD5","\xB5","\xFE","\xDE","\xDA","\xDB","\xD9","\xFD","\xDD","\xAF","\xB4","\xAD","\xB1","_","\xBE","\xB6","\xA7","\xF7","\xB8","\xB0","\xA8","\xB7","\xB9","\xB3","\xB2","_"," "],Jh={};var hu=(O=>(O[O.STORED=0]="STORED",O[O.SHRUNK=1]="SHRUNK",O[O.REDUCED_1=2]="REDUCED_1",O[O.REDUCED_2=3]="REDUCED_2",O[O.REDUCED_3=4]="REDUCED_3",O[O.REDUCED_4=5]="REDUCED_4",O[O.IMPLODE=6]="IMPLODE",O[O.DEFLATE=8]="DEFLATE",O[O.DEFLATE64=9]="DEFLATE64",O[O.TERSE_OLD=10]="TERSE_OLD",O[O.BZIP2=12]="BZIP2",O[O.LZMA=14]="LZMA",O[O.TERSE_NEW=18]="TERSE_NEW",O[O.LZ77=19]="LZ77",O[O.WAVPACK=97]="WAVPACK",O[O.PPMD=98]="PPMD",O))(hu||{});function Qh(r,t){let e=t&31,i=(t>>5&15)-1,n=(t>>9)+1980,o=r&31,a=r>>5&63,l=r>>11;return new Date(n,i,e,l,a,o)}u(Qh,"msdos2date");function ta(r,t,e,i){return i===0?"":t?r.toString("utf8",e,e+i):[...r].map(n=>n>127?jy[n-128]:String.fromCharCode(n)).join()}u(ta,"safeToString");var Yo=class{constructor(t){this.data=t;if(t.readUInt32LE(0)!==67324752)throw new T(22,"Invalid Zip file: Local file header has invalid signature: "+this.data.readUInt32LE(0))}versionNeeded(){return this.data.readUInt16LE(4)}flags(){return this.data.readUInt16LE(6)}compressionMethod(){return this.data.readUInt16LE(8)}lastModFileTime(){return Qh(this.data.readUInt16LE(10),this.data.readUInt16LE(12))}rawLastModFileTime(){return this.data.readUInt32LE(10)}crc32(){return this.data.readUInt32LE(14)}fileNameLength(){return this.data.readUInt16LE(26)}extraFieldLength(){return this.data.readUInt16LE(28)}fileName(){return ta(this.data,this.useUTF8(),30,this.fileNameLength())}extraField(){let t=30+this.fileNameLength();return this.data.subarray(t,t+this.extraFieldLength())}totalSize(){return 30+this.fileNameLength()+this.extraFieldLength()}useUTF8(){return(this.flags()&2048)===2048}};u(Yo,"FileHeader");var Xo=class{constructor(t,e,i){this.header=t;this.record=e;this.data=i}decompress(){let t=this.header.compressionMethod(),e=Jh[t];if(e)return e(this.data,this.record.compressedSize(),this.record.uncompressedSize(),this.record.flag());{let i=hu[t];throw i||(i=`Unknown: ${t}`),new T(22,`Invalid compression method on file '${this.header.fileName()}': ${i}`)}}getHeader(){return this.header}getRecord(){return this.record}getRawData(){return this.data}};u(Xo,"FileData");var Jo=class{constructor(t,e){this.zipData=t;this.data=e;if(this.data.readUInt32LE(0)!==33639248)throw new T(22,`Invalid Zip file: Central directory record has invalid signature: ${this.data.readUInt32LE(0)}`);this._filename=this.produceFilename()}versionMadeBy(){return this.data.readUInt16LE(4)}versionNeeded(){return this.data.readUInt16LE(6)}flag(){return this.data.readUInt16LE(8)}compressionMethod(){return this.data.readUInt16LE(10)}lastModFileTime(){return Qh(this.data.readUInt16LE(12),this.data.readUInt16LE(14))}rawLastModFileTime(){return this.data.readUInt32LE(12)}crc32(){return this.data.readUInt32LE(16)}compressedSize(){return this.data.readUInt32LE(20)}uncompressedSize(){return this.data.readUInt32LE(24)}fileNameLength(){return this.data.readUInt16LE(28)}extraFieldLength(){return this.data.readUInt16LE(30)}fileCommentLength(){return this.data.readUInt16LE(32)}diskNumberStart(){return this.data.readUInt16LE(34)}internalAttributes(){return this.data.readUInt16LE(36)}externalAttributes(){return this.data.readUInt32LE(38)}headerRelativeOffset(){return this.data.readUInt32LE(42)}produceFilename(){return ta(this.data,this.useUTF8(),46,this.fileNameLength()).replace(/\\/g,"/")}fileName(){return this._filename}rawFileName(){return this.data.subarray(46,46+this.fileNameLength())}extraField(){let t=44+this.fileNameLength();return this.data.subarray(t,t+this.extraFieldLength())}fileComment(){let t=46+this.fileNameLength()+this.extraFieldLength();return ta(this.data,this.useUTF8(),t,this.fileCommentLength())}rawFileComment(){let t=46+this.fileNameLength()+this.extraFieldLength();return this.data.subarray(t,t+this.fileCommentLength())}totalSize(){return 46+this.fileNameLength()+this.extraFieldLength()+this.fileCommentLength()}isDirectory(){let t=this.fileName();return!!(this.externalAttributes()&16)||t.charAt(t.length-1)==="/"}isFile(){return!this.isDirectory()}useUTF8(){return(this.flag()&2048)===2048}isEncrypted(){return(this.flag()&1)===1}getFileData(){let t=this.headerRelativeOffset(),e=new Yo(this.zipData.subarray(t));return new Xo(e,this,this.zipData.subarray(t+e.totalSize()))}getData(){return this.getFileData().decompress()}getRawData(){return this.getFileData().getRawData()}getStats(){return new Me(je.FILE,this.uncompressedSize(),365,Date.now(),this.lastModFileTime().getTime())}};u(Jo,"CentralDirectory");var Qo=class{constructor(t){this.data=t;if(this.data.readUInt32LE(0)!==101010256)throw new T(22,`Invalid Zip file: End of central directory record has invalid signature: ${this.data.readUInt32LE(0)}`)}diskNumber(){return this.data.readUInt16LE(4)}cdDiskNumber(){return this.data.readUInt16LE(6)}cdDiskEntryCount(){return this.data.readUInt16LE(8)}cdTotalEntryCount(){return this.data.readUInt16LE(10)}cdSize(){return this.data.readUInt32LE(12)}cdOffset(){return this.data.readUInt32LE(16)}cdZipCommentLength(){return this.data.readUInt16LE(20)}cdZipComment(){return ta(this.data,!0,22,this.cdZipCommentLength())}rawCdZipComment(){return this.data.slice(22,22+this.cdZipCommentLength())}};u(Qo,"EndOfCentralDirectory");var ea=class{constructor(t,e,i,n){this.index=t;this.directoryEntries=e;this.eocd=i;this.data=n}};u(ea,"ZipTOC");var Ur=class extends kt{constructor({zipData:e,name:i=""}){super();this._index=new hr;this._directoryEntries=[];this._eocd=null;this.name=i,this._ready=Ur._computeIndex(e).then(n=>(this._index=n.index,this._directoryEntries=n.directoryEntries,this._eocd=n.eocd,this.data=n.data,this))}static isAvailable(){return!0}static RegisterDecompressionMethod(e,i){Jh[e]=i}static _getEOCD(e){let n=Math.min(65557,e.length-1);for(let o=22;o=o)return new ea(i,a,l,e);let m=0;for(;m++<200&&nXh(r.subarray(0,t),{chunkSize:e}));Qt.RegisterDecompressionMethod(0,(r,t,e)=>ni(r,0,e));var zy="IEEE_P1282";function Pt(r,t,e){return r.toString("ascii",t,t+e).trim()}u(Pt,"getASCIIString");function du(r,t,e){if(e===1)return String.fromCharCode(r[t]);let i=Math.floor(e/2),n=new Array(i);for(let o=0;o-1}getRockRidgeOffset(){return this._rockRidgeOffset}rootCheckForRockRidge(t){let e=this.getDirectory(t);this._rockRidgeOffset=e.getDotEntry(t)._getRockRidgeOffset(t),this._rockRidgeOffset>-1&&(this._fileOrDir=null)}length(){return this._data[0]}extendedAttributeRecordLength(){return this._data[1]}lba(){return this._data.readUInt32LE(2)*2048}dataLength(){return this._data.readUInt32LE(10)}recordingDate(){return _i(this._data,18)}fileFlags(){return this._data[25]}fileUnitSize(){return this._data[26]}interleaveGapSize(){return this._data[27]}volumeSequenceNumber(){return this._data.readUInt16LE(28)}identifier(){return this._getString(33,this._data[32])}fileName(t){if(this.hasRockRidge()){let n=this._rockRidgeFilename(t);if(n!==null)return n}let e=this.identifier();if(this.isDirectory(t))return e;let i=e.indexOf(";");return i===-1?e:e[i-1]==="."?e.slice(0,i-1):e.slice(0,i)}isDirectory(t){let e=!!(this.fileFlags()&2);return!e&&this.hasRockRidge()&&(e=this.getSUEntries(t).filter(i=>i instanceof $i).length>0),e}isSymlink(t){return this.hasRockRidge()&&this.getSUEntries(t).filter(e=>e instanceof zi).length>0}getSymlinkPath(t){let e="",i=this.getSUEntries(t),n=this._getGetString();for(let o of i)if(o instanceof zi){let a=o.componentRecords();for(let l of a){let m=l.flags();m&2?e+="./":m&4?e+="../":m&8?e+="/":(e+=l.content(n),m&1||(e+="/"))}if(!o.continueFlag())break}return e.length>1&&e[e.length-1]==="/"?e.slice(0,e.length-1):e}getFile(t){if(this.isDirectory(t))throw new Error("Tried to get a File from a directory.");return this._fileOrDir===null&&(this._fileOrDir=t.subarray(this.lba(),this.lba()+this.dataLength())),this._fileOrDir}getDirectory(t){if(!this.isDirectory(t))throw new Error("Tried to get a Directory from a file.");return this._fileOrDir===null&&(this._fileOrDir=this._constructDirectory(t)),this._fileOrDir}getSUEntries(t){return this._suEntries||this._constructSUEntries(t),this._suEntries}_rockRidgeFilename(t){let e=this.getSUEntries(t).filter(o=>o instanceof Rn);if(e.length===0||e[0].flags()&6)return null;let i="",n=this._getGetString();for(let o of e)if(i+=o.name(n),!(o.flags()&1))break;return i}_constructSUEntries(t){let e=33+this._data[32];e%2===1&&e++,e+=this._rockRidgeOffset,this._suEntries=ed(this._data,e,this.length(),t)}_getRockRidgeOffset(t){this._rockRidgeOffset=0;let e=this.getSUEntries(t);if(e.length>0){let i=e[0];if(i instanceof Fn&&i.checkBytesPass())for(let n=1;na instanceof $i)[0].childDirectoryLba()*2048,n=1/0);im instanceof On).length===0)&&(this._fileMap[l]=a,this._fileList.push(l)):n===1/0&&(n=i+a.dataLength()),i+=a.length()}}getRecord(t){return this._fileMap[t]}getFileList(){return this._fileList}getDotEntry(t){return this._constructDirectoryRecord(t.subarray(this._record.lba()))}};u(kn,"Directory");var la=class extends kn{constructor(t,e){super(t,e)}_constructDirectoryRecord(t){return new vn(t,this._record.getRockRidgeOffset())}};u(la,"ISODirectory");var fa=class extends kn{constructor(t,e){super(t,e)}_constructDirectoryRecord(t){return new En(t,this._record.getRockRidgeOffset())}};u(fa,"JolietDirectory");var pu=class extends kt{constructor({data:e,name:i=""}){super();this._data=e;let n=!1,o=16*2048,a=new Array;for(;!n;){let l=e.subarray(o);switch(new bn(l).type()){case 1:a.push(new ra(l));break;case 2:a.push(new ia(l));break;case 255:n=!0;break}o+=2048}if(a.length===0)throw new T(5,"Unable to find a suitable volume descriptor.");a.forEach(l=>{(!this._pvd||this._pvd.type()!==2)&&(this._pvd=l)}),this._root=this._pvd.rootDirectoryEntry(e),this._name=i}static isAvailable(){return!0}get metadata(){let e=`IsoFS${this._name}${this._pvd?`-${this._pvd.name()}`:""}`;return this._root&&this._root.hasRockRidge()&&(e+="-RockRidge"),rt(Xe({},super.metadata),{name:e,synchronous:!0,readonly:!0,totalSpace:this._data.length})}statSync(e){let i=this._getDirectoryRecord(e);if(i===null)throw T.ENOENT(e);return this._getStats(e,i)}openSync(e,i,n){if(i.isWriteable())throw new T(1,e);let o=this._getDirectoryRecord(e);if(o){if(o.isSymlink(this._data))return this.openSync(qt(e,o.getSymlinkPath(this._data)),i,n);{let a=o.isDirectory(this._data)?void 0:o.getFile(this._data),l=this._getStats(e,o);switch(i.pathExistsAction()){case 1:case 2:throw T.EEXIST(e);case 0:return new er(this,e,i,l,a);default:throw new T(22,"Invalid FileMode object.")}}}else throw T.ENOENT(e)}readdirSync(e){let i=this._getDirectoryRecord(e);if(i){if(i.isDirectory(this._data))return i.getDirectory(this._data).getFileList().slice(0);throw T.ENOTDIR(e)}else throw T.ENOENT(e)}readFileSync(e,i,n){let o=this.openSync(e,n,420);try{let l=o.getBuffer();return i===null?ni(l):l.toString(i)}finally{o.closeSync()}}_getDirectoryRecord(e){if(e==="/")return this._root;let i=e.split("/").slice(1),n=this._root;for(let o of i)if(n.isDirectory(this._data)){if(n=n.getDirectory(this._data).getRecord(o),!n)return null}else return null;return n}_getStats(e,i){if(i.isSymlink(this._data)){let n=qt(e,i.getSymlinkPath(this._data)),o=this._getDirectoryRecord(n);return o?this._getStats(n,o):null}else{let n=i.dataLength(),o=365,a=i.recordingDate().getTime(),l=a,m=a,y=a;if(i.hasRockRidge()){let g=i.getSUEntries(this._data);for(let w of g)if(w instanceof An)o=w.mode();else if(w instanceof Bn){let v=w.flags();v&4&&(l=w.access().getTime()),v&2&&(m=w.modify().getTime()),v&1&&(y=w.creation().getTime())}}return o=o&365,new Me(i.isDirectory(this._data)?je.DIRECTORY:je.FILE,n,o,l,m,y)}}},Mr=pu;u(Mr,"IsoFS"),Mr.Name="IsoFS",Mr.Create=Je.bind(pu),Mr.Options={data:{type:"object",description:"The ISO file in a buffer",validator:qn}};var ha={AsyncMirror:Sr,Dropbox:xr,Emscripten:Ir,FileSystemAccess:Tr,FolderAdapter:rr,InMemory:Kt,IndexedDB:ur,IsoFS:Mr,Storage:cr,OverlayFS:lr,WorkerFS:Rr,HTTPRequest:dr,XMLHTTPRequest:dr,ZipFS:Qt};Oe&&void 0&&(void 0)();function Zy(r,t){ha[r]=t}u(Zy,"registerBackend");function rd(r,t=0,e=0){return qc(new Ye(t,e,t,e,t,e)),to.initialize(r)}u(rd,"initialize");function td(r){return C(this,null,function*(){("fs"in r||r instanceof Zr)&&(r={"/":r});for(let[t,e]of Object.entries(r))typeof e!="number"&&(t=t.toString(),!(e instanceof Zr)&&(typeof e=="string"&&(e={fs:e}),r[t]=yield id(e)));return rd(r)})}u(td,"_configure");function Wy(r,t){if(typeof t!="function")return td(r);td(r).then(()=>t()).catch(e=>t(e))}u(Wy,"configure");function mu(e){return C(this,arguments,function*({fs:r,options:t={}}){if(!r)throw new T(1,'Missing "fs" property on configuration object.');if(typeof t!="object"||t===null)throw new T(22,'Invalid "options" property on configuration object.');let i=Object.keys(t).filter(o=>o!="fs");for(let o of i){let a=t[o];if(a===null||typeof a!="object"||!("fs"in a))continue;let l=yield mu(a);t[o]=l}let n=ha[r];if(n)return n.Create(t);throw new T(1,`File system ${r} is not available in BrowserFS.`)})}u(mu,"_getFileSystem");function id(r,t){if(typeof t!="function")return mu(r);mu(r).then(e=>t(null,e)).catch(e=>t(e))}u(id,"getFileSystem");var Hy=to;return hd(qy);})(); /*! Bundled license information: @jspm/core/nodelibs/browser/buffer.js: (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) @jspm/core/nodelibs/browser/chunk-44e51b61.js: (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) @jspm/core/nodelibs/browser/assert.js: (*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT *) */