var proxyMarker=Symbol("Comlink.proxy"),createEndpoint=Symbol("Comlink.endpoint"),releaseProxy=Symbol("Comlink.releaseProxy"),finalizer=Symbol("Comlink.finalizer"),throwMarker=Symbol("Comlink.thrown"),isObject=val=>"object"==typeof val&&null!==val||"function"==typeof val,proxyTransferHandler={canHandle:val=>isObject(val)&&val[proxyMarker],serialize(obj){var{port1,port2}=new MessageChannel;return expose(obj,port1),[port2,[port2]]},deserialize(port){return port.start(),wrap(port)}},throwTransferHandler={canHandle:value=>isObject(value)&&throwMarker in value,serialize(_ref){_ref=_ref.value,_ref=_ref instanceof Error?{isError:!0,value:{message:_ref.message,name:_ref.name,stack:_ref.stack}}:{isError:!1,value:_ref};return[_ref,[]]},deserialize(serialized){if(serialized.isError)throw Object.assign(new Error(serialized.value.message),serialized.value);throw serialized.value}},transferHandlers=new Map([["proxy",proxyTransferHandler],["throw",throwTransferHandler]]);function isAllowedOrigin(allowedOrigins,origin){for(var allowedOrigin of allowedOrigins){if(origin===allowedOrigin||"*"===allowedOrigin)return!0;if(allowedOrigin instanceof RegExp&&allowedOrigin.test(origin))return!0}return!1}function expose(obj){var ep=1obj[prop],obj),rawValue=path.reduce((obj,prop)=>obj[prop],obj);switch(type){case"GET":returnValue=rawValue;break;case"SET":parent[path.slice(-1)[0]]=fromWireValue(ev.data.value),returnValue=!0;break;case"APPLY":returnValue=rawValue.apply(parent,argumentList);break;case"CONSTRUCT":var returnValue=proxy(new rawValue(...argumentList));break;case"ENDPOINT":var{port1,port2}=new MessageChannel;expose(obj,port2),returnValue=transfer(port1,[port1]);break;case"RELEASE":returnValue=void 0;break;default:return}}catch(value){returnValue={value:value,[throwMarker]:0}}Promise.resolve(returnValue).catch(value=>({value:value,[throwMarker]:0})).then(returnValue=>{var[returnValue,transferables]=toWireValue(returnValue);ep.postMessage(Object.assign(Object.assign({},returnValue),{id:id}),transferables),"RELEASE"===type&&(ep.removeEventListener("message",callback),closeEndPoint(ep),finalizer in obj)&&"function"==typeof obj[finalizer]&&obj[finalizer]()}).catch(error=>{var[wireValue,transferables]=toWireValue({value:new TypeError("Unserializable return value"),[throwMarker]:0});ep.postMessage(Object.assign(Object.assign({},wireValue),{id:id}),transferables)})}else console.warn("Invalid origin '".concat(ev.origin,"' for comlink proxy"))}),ep.start&&ep.start()}function isMessagePort(endpoint){return"MessagePort"===endpoint.constructor.name}function closeEndPoint(endpoint){isMessagePort(endpoint)&&endpoint.close()}function wrap(ep,target){var pendingListeners=new Map;return ep.addEventListener("message",function(ev){ev=ev.data;if(ev&&ev.id){var resolver=pendingListeners.get(ev.id);if(resolver)try{resolver(ev)}finally{pendingListeners.delete(ev.id)}}}),createProxy(ep,pendingListeners,[],target)}function throwIfProxyReleased(isReleased){if(isReleased)throw new Error("Proxy has been released and is not useable")}function releaseEndpoint(ep){return requestResponseMessage(ep,new Map,{type:"RELEASE"}).then(()=>{closeEndPoint(ep)})}var proxyCounter=new WeakMap,proxyFinalizers="FinalizationRegistry"in globalThis&&new FinalizationRegistry(ep=>{var newCount=(proxyCounter.get(ep)||0)-1;proxyCounter.set(ep,newCount),0==newCount&&releaseEndpoint(ep)});function registerProxy(proxy,ep){var newCount=(proxyCounter.get(ep)||0)+1;proxyCounter.set(ep,newCount),proxyFinalizers&&proxyFinalizers.register(proxy,ep,proxy)}function unregisterProxy(proxy){proxyFinalizers&&proxyFinalizers.unregister(proxy)}function createProxy(ep,pendingListeners){var path=2{unregisterProxy(proxy),releaseEndpoint(ep),pendingListeners.clear(),isProxyReleased=!0}:"then"===prop?0===path.length?{then:()=>proxy}:(r=requestResponseMessage(ep,pendingListeners,{type:"GET",path:path.map(p=>p.toString())}).then(fromWireValue)).then.bind(r):createProxy(ep,pendingListeners,[...path,prop])},set(_target,prop,rawValue){throwIfProxyReleased(isProxyReleased);var[rawValue,transferables]=toWireValue(rawValue);return requestResponseMessage(ep,pendingListeners,{type:"SET",path:[...path,prop].map(p=>p.toString()),value:rawValue},transferables).then(fromWireValue)},apply(_target,_thisArg,rawArgumentList){throwIfProxyReleased(isProxyReleased);var last=path[path.length-1];return last===createEndpoint?requestResponseMessage(ep,pendingListeners,{type:"ENDPOINT"}).then(fromWireValue):"bind"===last?createProxy(ep,pendingListeners,path.slice(0,-1)):([last,rawArgumentList]=processArguments(rawArgumentList),requestResponseMessage(ep,pendingListeners,{type:"APPLY",path:path.map(p=>p.toString()),argumentList:last},rawArgumentList).then(fromWireValue))},construct(_target,rawArgumentList){throwIfProxyReleased(isProxyReleased);var[rawArgumentList,transferables]=processArguments(rawArgumentList);return requestResponseMessage(ep,pendingListeners,{type:"CONSTRUCT",path:path.map(p=>p.toString()),argumentList:rawArgumentList},transferables).then(fromWireValue)}});return registerProxy(proxy,ep),proxy}function myFlat(arr){return Array.prototype.concat.apply([],arr)}function processArguments(argumentList){argumentList=argumentList.map(toWireValue);return[argumentList.map(v=>v[0]),myFlat(argumentList.map(v=>v[1]))]}var transferCache=new WeakMap;function transfer(obj,transfers){return transferCache.set(obj,transfers),obj}function proxy(obj){return Object.assign(obj,{[proxyMarker]:!0})}function toWireValue(value){for(var[name,handler]of transferHandlers){var transferables;if(handler.canHandle(value))return[handler,transferables]=handler.serialize(value),[{type:"HANDLER",name:name,value:handler},transferables]}return[{type:"RAW",value:value},transferCache.get(value)||[]]}function fromWireValue(value){switch(value.type){case"HANDLER":return transferHandlers.get(value.name).deserialize(value.value);case"RAW":return value.value}}function requestResponseMessage(ep,pendingListeners,msg,transfers){return new Promise(resolve=>{var id=generateUUID();pendingListeners.set(id,resolve),ep.start&&ep.start(),ep.postMessage(Object.assign({id:id},msg),transfers)})}function generateUUID(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var TYPE_MAP={32768:"FILE",16384:"DIR",40960:"SYMBOLIC_LINK",49152:"SOCKET",8192:"CHARACTER_DEVICE",24576:"BLOCK_DEVICE",4096:"NAMED_PIPE"};class ArchiveReader{constructor(wasmModule){this._wasmModule=wasmModule,this._runCode=wasmModule.runCode,this._file=null,this._passphrase=null,this._locale="en_US.UTF-8"}async open(file){null!==this._file&&(console.warn("Closing previous file"),this.close());file=await this._loadFile(file);this._fileLength=file.length,this._filePtr=file.ptr}close(){this._runCode.closeArchive(this._archive),this._wasmModule._free(this._filePtr),this._file=null,this._filePtr=null,this._archive=null}hasEncryptedData(){this._archive=this._runCode.openArchive(this._filePtr,this._fileLength,this._passphrase,this._locale),this._runCode.getNextEntry(this._archive);var status=this._runCode.hasEncryptedEntries(this._archive);return 0!==status&&(0{_ref2=_ref2.file;return acc+_ref2.size+128},0)+128,bufferPtr=this._runCode.malloc(totalSize),outputSizePtr=this._runCode.malloc(this._runCode.sizeOfSizeT()),newArchive=this._runCode.startArchiveWrite(compression,format,bufferPtr,totalSize,outputSizePtr,passphrase);for({file,pathname}of files){var fileData=await this._loadFile(file);this._runCode.writeArchiveFile(newArchive,pathname||file.name,fileData.length,fileData.ptr),this._runCode.free(fileData.ptr)}compression=this._runCode.finishArchiveWrite(newArchive,outputSizePtr);if(compression<0)throw new Error(this._runCode.getError(newArchive));return this._wasmModule.HEAPU8.slice(bufferPtr,bufferPtr+compression)}async _loadFile(file){var file=await file.arrayBuffer(),file=new Uint8Array(file),filePtr=this._runCode.malloc(file.length);return this._wasmModule.HEAPU8.set(file,filePtr),{ptr:filePtr,length:file.length}}}var libarchive=(()=>{var _scriptDir=import.meta.url;return async function(){var readyPromiseResolve,readyPromiseReject,require,fs,nodePath,read_,readBinary,readAsync,moduleArg=0{readyPromiseResolve=resolve,readyPromiseReject=reject}),Object.assign({},Module)),thisProgram="./this.program",quit_=(status,toThrow)=>{throw toThrow},ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,scriptDirectory="";ENVIRONMENT_IS_NODE?(createRequire=(await import("module"))["createRequire"],require=createRequire(import.meta.url),fs=require("fs"),nodePath=require("path"),scriptDirectory=ENVIRONMENT_IS_WORKER?nodePath.dirname(scriptDirectory)+"/":require("url").fileURLToPath(new URL("./",import.meta.url)),read_=(filename,binary)=>(filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename),fs.readFileSync(filename,binary?void 0:"utf8")),readBinary=filename=>{filename=read_(filename,!0);return filename=filename.buffer?filename:new Uint8Array(filename)},readAsync=function(filename,onload,onerror){var binary=!(3{err?onerror(err):onload(binary?data.buffer:data)})},!Module.thisProgram&&1{throw process.exitCode=status,toThrow},Module.inspect=()=>"[Emscripten Module object]"):(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:"undefined"!=typeof document&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=0!==(scriptDirectory=_scriptDir?_scriptDir:scriptDirectory).indexOf("blob:")?scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1):"",read_=url=>{var xhr=new XMLHttpRequest;return xhr.open("GET",url,!1),xhr.send(null),xhr.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=url=>{var xhr=new XMLHttpRequest;return xhr.open("GET",url,!1),xhr.responseType="arraybuffer",xhr.send(null),new Uint8Array(xhr.response)}),readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,!0),xhr.responseType="arraybuffer",xhr.onload=()=>{200==xhr.status||0==xhr.status&&xhr.response?onload(xhr.response):onerror()},xhr.onerror=onerror,xhr.send(null)});var wasmBinary,wasmMemory,HEAP8,HEAPU8,HEAP16,HEAP32,HEAPU32,out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console),ABORT=(Object.assign(Module,moduleOverrides),Module.arguments&&Module.arguments,Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit),Module.wasmBinary&&(wasmBinary=Module.wasmBinary),"object"!=typeof WebAssembly&&abort("no native wasm support detected"),!1);function assert(condition,text){condition||abort(text)}function updateMemoryViews(){var b=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(b),Module.HEAP16=HEAP16=new Int16Array(b),Module.HEAPU8=HEAPU8=new Uint8Array(b),Module.HEAPU16=new Uint16Array(b),Module.HEAP32=HEAP32=new Int32Array(b),Module.HEAPU32=HEAPU32=new Uint32Array(b),Module.HEAPF32=new Float32Array(b),Module.HEAPF64=new Float64Array(b)}var __ATPRERUN__=[],__ATINIT__=[],__ATPOSTRUN__=[];function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)cb=Module.preRun.shift(),__ATPRERUN__.unshift(cb);var cb;callRuntimeCallbacks(__ATPRERUN__)}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)cb=Module.postRun.shift(),__ATPOSTRUN__.unshift(cb);var cb;callRuntimeCallbacks(__ATPOSTRUN__)}var runDependencies=0,dependenciesFulfilled=null;function addRunDependency(){var _Module$monitorRunDep;runDependencies++,null!=(_Module$monitorRunDep=Module.monitorRunDependencies)&&_Module$monitorRunDep.call(Module,runDependencies)}function removeRunDependency(){var _Module$monitorRunDep2;runDependencies--,null!=(_Module$monitorRunDep2=Module.monitorRunDependencies)&&_Module$monitorRunDep2.call(Module,runDependencies),0==runDependencies&&dependenciesFulfilled&&(_Module$monitorRunDep2=dependenciesFulfilled,dependenciesFulfilled=null,_Module$monitorRunDep2())}function abort(what){null!=(_Module$onAbort=Module.onAbort)&&_Module$onAbort.call(Module,what),err(what="Aborted("+what+")"),ABORT=!0,what+=". Build with -sASSERTIONS for more info.";var _Module$onAbort=new WebAssembly.RuntimeError(what);throw readyPromiseReject(_Module$onAbort),_Module$onAbort}var wasmBinaryFile,createRequire,tempDouble,tempI64,isDataURI=filename=>filename.startsWith("data:application/octet-stream;base64,"),isFileURI=filename=>filename.startsWith("file://");function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(file);throw"both async and sync fetching of the wasm failed"}function instantiateArrayBuffer(binaryFile,imports,receiver){return function(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if("function"==typeof fetch&&!isFileURI(binaryFile))return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{if(response.ok)return response.arrayBuffer();throw"failed to load wasm binary file at '"+binaryFile+"'"}).catch(()=>getBinarySync(binaryFile));if(readAsync)return new Promise((resolve,reject)=>{readAsync(binaryFile,response=>resolve(new Uint8Array(response)),reject)})}return Promise.resolve().then(()=>getBinarySync(binaryFile))}(binaryFile).then(binary=>WebAssembly.instantiate(binary,imports)).then(instance=>instance).then(receiver,reason=>{err("failed to asynchronously prepare wasm: ".concat(reason)),abort(reason)})}function ExitStatus(status){this.name="ExitStatus",this.message="Program terminated with exit(".concat(status,")"),this.status=status}Module.locateFile?isDataURI(wasmBinaryFile="libarchive.wasm")||(createRequire=wasmBinaryFile,wasmBinaryFile=Module.locateFile?Module.locateFile(createRequire,scriptDirectory):scriptDirectory+createRequire):wasmBinaryFile=new URL("libarchive.wasm",import.meta.url).href;var callRuntimeCallbacks=callbacks=>{for(;0"/"===path.charAt(0),splitPath:filename=>{return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{for(var up=0,i=parts.length-1;0<=i;i--){var last=parts[i];"."===last?parts.splice(i,1):".."===last?(parts.splice(i,1),up++):up&&(parts.splice(i,1),up--)}if(allowAboveRoot)for(;up;up--)parts.unshift("..");return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash="/"===path.substr(-1);return(path=(path=PATH.normalizeArray(path.split("/").filter(p=>!!p),!isAbsolute).join("/"))||isAbsolute?path:".")&&trailingSlash&&(path+="/"),(isAbsolute?"/":"")+path},dirname:path=>{var path=PATH.splitPath(path),root=path[0],path=path[1];return root||path?root+(path=path&&path.substr(0,path.length-1)):"."},basename:path=>{var lastSlash;return"/"===path?"/":-1===(lastSlash=(path=(path=PATH.normalize(path)).replace(/\/$/,"")).lastIndexOf("/"))?path:path.substr(lastSlash+1)},join:function(){var paths=Array.prototype.slice.call(arguments);return PATH.normalize(paths.join("/"))},join2:(l,r)=>PATH.normalize(l+"/"+r)},initRandomFill=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return view=>crypto.getRandomValues(view);if(ENVIRONMENT_IS_NODE)try{var randomBytes,crypto_module=require("crypto");return crypto_module.randomFillSync?view=>crypto_module.randomFillSync(view):(randomBytes=crypto_module.randomBytes,view=>(view.set(randomBytes(view.byteLength)),view))}catch(e){}abort("initRandomDevice")},randomFill=view=>(randomFill=initRandomFill())(view),PATH_FS={resolve:function(){for(var resolvedPath="",resolvedAbsolute=!1,i=arguments.length-1;-1<=i&&!resolvedAbsolute;i--){var path=0<=i?arguments[i]:FS.cwd();if("string"!=typeof path)throw new TypeError("Arguments to path.resolve must be strings");if(!path)return"";resolvedPath=path+"/"+resolvedPath,resolvedAbsolute=PATH.isAbs(path)}return(resolvedAbsolute?"/":"")+(resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(p=>!!p),!resolvedAbsolute).join("/"))||"."},relative:(from,to)=>{function trim(arr){for(var start=0;start{for(var endIdx=idx+maxBytesToRead,endPtr=idx;heapOrArray[endPtr]&&!(endIdx<=endPtr);)++endPtr;if(16>10,56320|1023&u1)))):str+=String.fromCharCode(u0)}return str},FS_stdin_getChar_buffer=[],lengthBytesUTF8=str=>{for(var len=0,i=0;i{if(!(0>6}else{if(u<=65535){if(endIdx<=outIdx+2)break;heap[outIdx++]=224|u>>12}else{if(endIdx<=outIdx+3)break;heap[outIdx++]=240|u>>18,heap[outIdx++]=128|u>>12&63}heap[outIdx++]=128|u>>6&63}heap[outIdx++]=128|63&u}}return heap[outIdx]=0,outIdx-startIdx};function intArrayFromString(stringy,dontAddNull,length){length=0{abort()},MEMFS={ops_table:null,mount(mount){return MEMFS.createNode(null,"/",16895,0)},createNode(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode))throw new FS.ErrnoError(63);MEMFS.ops_table||(MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}});mode=FS.createNode(parent,name,mode,dev);return FS.isDir(mode.mode)?(mode.node_ops=MEMFS.ops_table.dir.node,mode.stream_ops=MEMFS.ops_table.dir.stream,mode.contents={}):FS.isFile(mode.mode)?(mode.node_ops=MEMFS.ops_table.file.node,mode.stream_ops=MEMFS.ops_table.file.stream,mode.usedBytes=0,mode.contents=null):FS.isLink(mode.mode)?(mode.node_ops=MEMFS.ops_table.link.node,mode.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(mode.mode)&&(mode.node_ops=MEMFS.ops_table.chrdev.node,mode.stream_ops=MEMFS.ops_table.chrdev.stream),mode.timestamp=Date.now(),parent&&(parent.contents[name]=mode,parent.timestamp=mode.timestamp),mode},getFileDataAsTypedArray(node){return node.contents?node.contents.subarray?node.contents.subarray(0,node.usedBytes):new Uint8Array(node.contents):new Uint8Array(0)},expandFileStorage(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;newCapacity<=prevCapacity||(newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<1048576?2:1.125)>>>0),0!=prevCapacity&&(newCapacity=Math.max(newCapacity,256)),prevCapacity=node.contents,node.contents=new Uint8Array(newCapacity),0=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(8{var mode=0;return canRead&&(mode|=365),canWrite&&(mode|=146),mode},FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(path){var opts=1!!p),current=FS.root,current_path="/",i=0;i>>0)%FS.nameTable.length},hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash],FS.nameTable[hash]=node},hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node)FS.nameTable[hash]=node.name_next;else for(var current=FS.nameTable[hash];current;){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}},lookupNode(parent,name){var errCode=FS.mayLookup(parent);if(errCode)throw new FS.ErrnoError(errCode,parent);for(var errCode=FS.hashName(parent.id,name),node=FS.nameTable[errCode];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name)return node}return FS.lookup(parent,name)},createNode(parent,name,mode,rdev){parent=new FS.FSNode(parent,name,mode,rdev);return FS.hashAddNode(parent),parent},destroyNode(node){FS.hashRemoveNode(node)},isRoot(node){return node===node.parent},isMountpoint(node){return!!node.mounted},isFile(mode){return 32768==(61440&mode)},isDir(mode){return 16384==(61440&mode)},isLink(mode){return 40960==(61440&mode)},isChrdev(mode){return 8192==(61440&mode)},isBlkdev(mode){return 24576==(61440&mode)},isFIFO(mode){return 4096==(61440&mode)},isSocket(mode){return 49152==(49152&mode)},flagsToPermissionString(flag){var perms=["r","w","rw"][3&flag];return 512&flag&&(perms+="w"),perms},nodePermissions(node,perms){return FS.ignorePermissions||(!perms.includes("r")||292&node.mode)&&(!perms.includes("w")||146&node.mode)&&(!perms.includes("x")||73&node.mode)?0:2},mayLookup(dir){var errCode=FS.nodePermissions(dir,"x");return errCode||(dir.node_ops.lookup?0:2)},mayCreate(dir,name){try{FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}name=FS.nodePermissions(dir,"wx");if(name)return name;if(isdir){if(!FS.isDir(node.mode))return 54;if(FS.isRoot(node)||FS.getPath(node)===FS.cwd())return 10}else if(FS.isDir(node.mode))return 31;return 0},mayOpen(node,flags){return node?FS.isLink(node.mode)?32:FS.isDir(node.mode)&&("r"!==FS.flagsToPermissionString(flags)||512&flags)?31:FS.nodePermissions(node,FS.flagsToPermissionString(flags)):44},MAX_OPEN_FDS:4096,nextfd(){for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++)if(!FS.streams[fd])return fd;throw new FS.ErrnoError(33)},getStreamChecked(fd){fd=FS.getStream(fd);if(fd)return fd;throw new FS.ErrnoError(8)},getStream:fd=>FS.streams[fd],createStream(stream){var fd=1dev>>8,minor:dev=>255&dev,makedev:(ma,mi)=>ma<<8|mi,registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:dev=>FS.devices[dev],getMounts(mount){for(var mounts=[],check=[mount];check.length;){var m=check.pop();mounts.push(m),check.push.apply(check,m.mounts)}return mounts},syncfs(populate,callback){"function"==typeof populate&&(callback=populate,populate=!1),FS.syncFSRequests++,1=mounts.length&&doCallback(null)}mounts.forEach(mount=>{if(!mount.type.syncfs)return done(null);mount.type.syncfs(mount,populate,done)})},mount(type,opts,mountpoint){var node,root="/"===mountpoint,pseudo=!mountpoint;if(root&&FS.root)throw new FS.ErrnoError(10);if(!root&&!pseudo){pseudo=FS.lookupPath(mountpoint,{follow_mount:!1});if(mountpoint=pseudo.path,node=pseudo.node,FS.isMountpoint(node))throw new FS.ErrnoError(10);if(!FS.isDir(node.mode))throw new FS.ErrnoError(54)}pseudo={type:type,opts:opts,mountpoint:mountpoint,mounts:[]},opts=type.mount(pseudo);return(opts.mount=pseudo).root=opts,root?FS.root=opts:node&&(node.mounted=pseudo,node.mount)&&node.mount.mounts.push(pseudo),opts},unmount(mountpoint){mountpoint=FS.lookupPath(mountpoint,{follow_mount:!1});if(!FS.isMountpoint(mountpoint.node))throw new FS.ErrnoError(28);var mountpoint=mountpoint.node,mount=mountpoint.mounted,mounts=FS.getMounts(mount),mount=(Object.keys(FS.nameTable).forEach(hash=>{for(var current=FS.nameTable[hash];current;){var next=current.name_next;mounts.includes(current.mount)&&FS.destroyNode(current),current=next}}),mountpoint.mounted=null,mountpoint.mount.mounts.indexOf(mount));mountpoint.mount.mounts.splice(mount,1)},lookup(parent,name){return parent.node_ops.lookup(parent,name)},mknod(path,mode,dev){var parent=FS.lookupPath(path,{parent:!0}).node,path=PATH.basename(path);if(!path||"."===path||".."===path)throw new FS.ErrnoError(28);var errCode=FS.mayCreate(parent,path);if(errCode)throw new FS.ErrnoError(errCode);if(parent.node_ops.mknod)return parent.node_ops.mknod(parent,path,mode,dev);throw new FS.ErrnoError(63)},create(path,mode){return FS.mknod(path,mode=(mode=void 0!==mode?mode:438)&4095|32768,0)},mkdir(path,mode){return FS.mknod(path,mode=(mode=void 0!==mode?mode:511)&1023|16384,0)},mkdirTree(path,mode){for(var dirs=path.split("/"),d="",i=0;i{var flags={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[str];if(void 0===flags)throw new Error("Unknown file open mode: ".concat(str));return flags})(flags):flags)?4095&mode|32768:0,"object"==typeof path)node=path;else{path=PATH.normalize(path);try{var node=FS.lookupPath(path,{follow:!(131072&flags)}).node}catch(e){}}var created=!1;if(64&flags)if(node){if(128&flags)throw new FS.ErrnoError(20)}else node=FS.mknod(path,mode,0),created=!0;if(!node)throw new FS.ErrnoError(44);if(FS.isChrdev(node.mode)&&(flags&=-513),65536&flags&&!FS.isDir(node.mode))throw new FS.ErrnoError(54);if(!created){mode=FS.mayOpen(node,flags);if(mode)throw new FS.ErrnoError(mode)}512&flags&&!created&&FS.truncate(node,0),flags&=-131713;mode=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:!0,position:0,stream_ops:node.stream_ops,ungotten:[],error:!1});return mode.stream_ops.open&&mode.stream_ops.open(mode),!Module.logReadFiles||1&flags||(FS.readFiles||(FS.readFiles={}),path in FS.readFiles)||(FS.readFiles[path]=1),mode},close(stream){if(FS.isClosed(stream))throw new FS.ErrnoError(8);stream.getdents&&(stream.getdents=null);try{stream.stream_ops.close&&stream.stream_ops.close(stream)}catch(e){throw e}finally{FS.closeStream(stream.fd)}stream.fd=null},isClosed(stream){return null===stream.fd},llseek(stream,offset,whence){if(FS.isClosed(stream))throw new FS.ErrnoError(8);if(!stream.seekable||!stream.stream_ops.llseek)throw new FS.ErrnoError(70);if(0!=whence&&1!=whence&&2!=whence)throw new FS.ErrnoError(28);return stream.position=stream.stream_ops.llseek(stream,offset,whence),stream.ungotten=[],stream.position},read(stream,buffer,offset,length,position){if(length<0||position<0)throw new FS.ErrnoError(28);if(FS.isClosed(stream))throw new FS.ErrnoError(8);if(1==(2097155&stream.flags))throw new FS.ErrnoError(8);if(FS.isDir(stream.node.mode))throw new FS.ErrnoError(31);if(!stream.stream_ops.read)throw new FS.ErrnoError(28);var seeking=void 0!==position;if(seeking){if(!stream.seekable)throw new FS.ErrnoError(70)}else position=stream.position;buffer=stream.stream_ops.read(stream,buffer,offset,length,position);return seeking||(stream.position+=buffer),buffer},write(stream,buffer,offset,length,position,canOwn){if(length<0||position<0)throw new FS.ErrnoError(28);if(FS.isClosed(stream))throw new FS.ErrnoError(8);if(0==(2097155&stream.flags))throw new FS.ErrnoError(8);if(FS.isDir(stream.node.mode))throw new FS.ErrnoError(31);if(!stream.stream_ops.write)throw new FS.ErrnoError(28);stream.seekable&&1024&stream.flags&&FS.llseek(stream,0,2);var seeking=void 0!==position;if(seeking){if(!stream.seekable)throw new FS.ErrnoError(70)}else position=stream.position;buffer=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);return seeking||(stream.position+=buffer),buffer},allocate(stream,offset,length){if(FS.isClosed(stream))throw new FS.ErrnoError(8);if(offset<0||length<=0)throw new FS.ErrnoError(28);if(0==(2097155&stream.flags))throw new FS.ErrnoError(8);if(!FS.isFile(stream.node.mode)&&!FS.isDir(stream.node.mode))throw new FS.ErrnoError(43);if(!stream.stream_ops.allocate)throw new FS.ErrnoError(138);stream.stream_ops.allocate(stream,offset,length)},mmap(stream,length,position,prot,flags){if(0!=(2&prot)&&0==(2&flags)&&2!=(2097155&stream.flags))throw new FS.ErrnoError(2);if(1==(2097155&stream.flags))throw new FS.ErrnoError(2);if(stream.stream_ops.mmap)return stream.stream_ops.mmap(stream,length,position,prot,flags);throw new FS.ErrnoError(43)},msync(stream,buffer,offset,length,mmapFlags){return stream.stream_ops.msync?stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags):0},munmap:stream=>0,ioctl(stream,cmd,arg){if(stream.stream_ops.ioctl)return stream.stream_ops.ioctl(stream,cmd,arg);throw new FS.ErrnoError(59)},readFile(path){var ret,opts=1FS.currentPath,chdir(path){path=FS.lookupPath(path,{follow:!0});if(null===path.node)throw new FS.ErrnoError(44);if(!FS.isDir(path.node.mode))throw new FS.ErrnoError(54);var errCode=FS.nodePermissions(path.node,"x");if(errCode)throw new FS.ErrnoError(errCode);FS.currentPath=path.path},createDefaultDirectories(){FS.mkdir("/tmp"),FS.mkdir("/home"),FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(stream,buffer,offset,length,pos)=>length}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0,randomByte=()=>(0===randomLeft&&(randomLeft=randomFill(randomBuffer).byteLength),randomBuffer[--randomLeft]);FS.createDevice("/dev","random",randomByte),FS.createDevice("/dev","urandom",randomByte),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd"),FS.mount({mount(){var node=FS.createNode(proc_self,"fd",16895,73);return node.node_ops={lookup(parent,name){var stream=FS.getStreamChecked(+name),name={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>stream.path}};return name.parent=name}},node}},{},"/proc/self/fd")},createStandardStreams(){Module.stdin?FS.createDevice("/dev","stdin",Module.stdin):FS.symlink("/dev/tty","/dev/stdin"),Module.stdout?FS.createDevice("/dev","stdout",null,Module.stdout):FS.symlink("/dev/tty","/dev/stdout"),Module.stderr?FS.createDevice("/dev","stderr",null,Module.stderr):FS.symlink("/dev/tty1","/dev/stderr"),FS.open("/dev/stdin",0),FS.open("/dev/stdout",1),FS.open("/dev/stderr",1)},ensureErrnoError(){FS.ErrnoError||(FS.ErrnoError=function(errno,node){this.name="ErrnoError",this.node=node,this.setErrno=function(errno){this.errno=errno},this.setErrno(errno),this.message="FS error"},FS.ErrnoError.prototype=new Error,FS.ErrnoError.prototype.constructor=FS.ErrnoError,[44].forEach(code=>{FS.genericErrors[code]=new FS.ErrnoError(code),FS.genericErrors[code].stack=""}))},staticInit(){FS.ensureErrnoError(),FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS:MEMFS}},init(input,output,error){FS.init.initialized=!0,FS.ensureErrnoError(),Module.stdin=input||Module.stdin,Module.stdout=output||Module.stdout,Module.stderr=error||Module.stderr,FS.createStandardStreams()},quit(){FS.init.initialized=!1;for(var i=0;ithis.length-1||idx<0))return chunkOffset=idx%this.chunkSize,idx=idx/this.chunkSize|0,this.getter(idx)[chunkOffset]},LazyUint8Array.prototype.setDataGetter=function(getter){this.getter=getter},LazyUint8Array.prototype.cacheLength=function(){var xhr=new XMLHttpRequest;if(xhr.open("HEAD",url,!1),xhr.send(null),!(200<=xhr.status&&xhr.status<300||304===xhr.status))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var header,datalength=Number(xhr.getResponseHeader("Content-length")),hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&"bytes"===header,xhr=(header=xhr.getResponseHeader("Content-Encoding"))&&"gzip"===header,chunkSize=1048576,lazyArray=(hasByteServing||(chunkSize=datalength),this);lazyArray.setDataGetter(chunkNum=>{var start=chunkNum*chunkSize,end=(chunkNum+1)*chunkSize-1,end=Math.min(end,datalength-1);if(void 0===lazyArray.chunks[chunkNum]&&(lazyArray.chunks[chunkNum]=((from,to)=>{if(to=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice)for(var i=0;i{var fn=node.stream_ops[key];stream_ops[key]=function(){return FS.forceLoadFile(node),fn.apply(null,arguments)}}),stream_ops.read=(stream,buffer,offset,length,position)=>(FS.forceLoadFile(node),writeChunks(stream,buffer,offset,length,position)),stream_ops.mmap=(stream,length,position,prot,flags)=>{FS.forceLoadFile(node);mmapAlloc();throw new FS.ErrnoError(48)},node.stream_ops=stream_ops,node}},UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"",SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(dirfd,path,allowEmpty){if(PATH.isAbs(path))return path;if(dirfd=-100===dirfd?FS.cwd():SYSCALLS.getStreamFromFD(dirfd).path,0!=path.length)return PATH.join2(dirfd,path);if(allowEmpty)return dirfd;throw new FS.ErrnoError(44)},doStat(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node)))return-54;throw e}HEAP32[buf>>2]=stat.dev,HEAP32[buf+4>>2]=stat.mode,HEAPU32[buf+8>>2]=stat.nlink,HEAP32[buf+12>>2]=stat.uid,HEAP32[buf+16>>2]=stat.gid,HEAP32[buf+20>>2]=stat.rdev,tempI64=[stat.size>>>0,(tempDouble=stat.size,1<=+Math.abs(tempDouble)?0>>0:~~+Math.ceil((tempDouble-(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+24>>2]=tempI64[0],HEAP32[buf+28>>2]=tempI64[1],HEAP32[buf+32>>2]=4096,HEAP32[buf+36>>2]=stat.blocks;var func=stat.atime.getTime(),path=stat.mtime.getTime(),ctime=stat.ctime.getTime();return tempI64=[Math.floor(func/1e3)>>>0,(tempDouble=Math.floor(func/1e3),1<=+Math.abs(tempDouble)?0>>0:~~+Math.ceil((tempDouble-(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1],HEAPU32[buf+48>>2]=func%1e3*1e3,tempI64=[Math.floor(path/1e3)>>>0,(tempDouble=Math.floor(path/1e3),1<=+Math.abs(tempDouble)?0>>0:~~+Math.ceil((tempDouble-(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+56>>2]=tempI64[0],HEAP32[buf+60>>2]=tempI64[1],HEAPU32[buf+64>>2]=path%1e3*1e3,tempI64=[Math.floor(ctime/1e3)>>>0,(tempDouble=Math.floor(ctime/1e3),1<=+Math.abs(tempDouble)?0>>0:~~+Math.ceil((tempDouble-(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+72>>2]=tempI64[0],HEAP32[buf+76>>2]=tempI64[1],HEAPU32[buf+80>>2]=ctime%1e3*1e3,tempI64=[stat.ino>>>0,(tempDouble=stat.ino,1<=+Math.abs(tempDouble)?0>>0:~~+Math.ceil((tempDouble-(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+88>>2]=tempI64[0],HEAP32[buf+92>>2]=tempI64[1],0},doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode))throw new FS.ErrnoError(43);if(2&flags)return 0;addr=HEAPU8.slice(addr,addr+len);FS.msync(stream,addr,offset,len,flags)},varargs:void 0,get(){var ret=HEAP32[+SYSCALLS.varargs>>2];return SYSCALLS.varargs+=4,ret},getp(){return SYSCALLS.get()},getStr(ptr){return UTF8ToString(ptr)},getStreamFromFD(fd){return FS.getStreamChecked(fd)}};var setErrNo=value=>HEAP32[___errno_location()>>2]=value;var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount(mount){return FS.createNode(null,"/",16895,0)},createPipe(){var pipe={buckets:[],refcnt:2},rName=(pipe.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0}),PIPEFS.nextname()),wName=PIPEFS.nextname(),rNode=FS.createNode(PIPEFS.root,rName,4096,0),wNode=FS.createNode(PIPEFS.root,wName,4096,0),pipe=(rNode.pipe=pipe,wNode.pipe=pipe,FS.createStream({path:rName,node:rNode,flags:0,seekable:!1,stream_ops:PIPEFS.stream_ops})),rName=(rNode.stream=pipe,FS.createStream({path:wName,node:wNode,flags:1,seekable:!1,stream_ops:PIPEFS.stream_ops}));return wNode.stream=rName,{readable_fd:pipe.fd,writable_fd:rName.fd}},stream_ops:{poll(stream){var pipe=stream.node.pipe;if(1==(2097155&stream.flags))return 260;if(0hi+2097152>>>0<4194305-!!lo?(lo>>>0)+4294967296*hi:NaN;var isLeapYear=year=>year%4==0&&(year%100!=0||year%400==0),MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335],MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334],ydayFromDate=date=>{return(isLeapYear(date.getFullYear())?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE)[date.getMonth()]+date.getDate()-1};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite),stringToNewUTF8=str=>{var size=lengthBytesUTF8(str)+1,ret=_malloc(size);return ret&&stringToUTF8(str,ret,size),ret},ENV={},getExecutableName=()=>thisProgram||"./this.program",getEnvStrings=()=>{if(!getEnvStrings.strings){var env={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:getExecutableName()};for(x in ENV)void 0===ENV[x]?delete env[x]:env[x]=ENV[x];var x,strings=[];for(x in env)strings.push("".concat(x,"=").concat(env[x]));getEnvStrings.strings=strings}return getEnvStrings.strings},keepRuntimeAlive=()=>noExitRuntime||!1,moduleOverrides=(status,implicit)=>{var _Module$onExit;status=status,keepRuntimeAlive()||(null!=(_Module$onExit=Module.onExit)&&_Module$onExit.call(Module,status),ABORT=!0),quit_(status,new ExitStatus(status))};function FSNode(parent,name,mode,rdev){this.parent=parent=parent||this,this.mount=parent.mount,this.mounted=null,this.id=FS.nextInode++,this.name=name,this.mode=mode,this.node_ops={},this.stream_ops={},this.rdev=rdev}var calledRun,MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31],MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31],writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer)},getCFunc=ident=>{return Module["_"+ident]},stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1,ret=stackAlloc(size);return stringToUTF8(str,ret,size),ret},ccall=(ident,returnType,argTypes,args,opts)=>{var toC={string:str=>{var ret=0;return ret=null!=str&&0!==str?stringToUTF8OnStack(str):ret},array:arr=>{var ret=stackAlloc(arr.length);return writeArrayToMemory(arr,ret),ret}};var ident=getCFunc(ident),cArgs=[],stack=0;if(args)for(var i=0;i{var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;function processData(byteArray){function finish(byteArray){null!=preFinish&&preFinish(),dontCreateFile||((parent,name,fileData,canRead,canWrite,canOwn)=>{FS.createDataFile(parent,name,fileData,canRead,canWrite,canOwn)})(parent,name,byteArray,canRead,canWrite,canOwn),null!=onload&&onload(),removeRunDependency()}((byteArray,fullname,finish,onerror)=>{"undefined"!=typeof Browser&&Browser.init();var handled=!1;return preloadPlugins.forEach(plugin=>{handled||plugin.canHandle(fullname)&&(plugin.handle(byteArray,fullname,finish,onerror),handled=!0)}),handled})(byteArray,fullname,finish,()=>{null!=onerror&&onerror(),removeRunDependency()})||finish(byteArray)}addRunDependency(),"string"==typeof url?((url,onload,onerror,noRunDep)=>{var dep=noRunDep?"":"al ".concat(url);readAsync(url,arrayBuffer=>{assert(arrayBuffer,'Loading data file "'.concat(url,'" failed (no arrayBuffer).')),onload(new Uint8Array(arrayBuffer)),dep&&removeRunDependency()},event=>{if(!onerror)throw'Loading data file "'.concat(url,'" failed.');onerror()}),dep&&addRunDependency()})(url,byteArray=>processData(byteArray),onerror):processData(url)},FS.staticInit(),{i:function(fd){try{var old=SYSCALLS.getStreamFromFD(fd);return FS.createStream(old).fd}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},a:function(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:if((arg=SYSCALLS.get())<0)return-28;for(;FS.streams[arg];)arg++;return FS.createStream(stream,arg).fd;case 1:case 2:return 0;case 3:return stream.flags;case 4:var arg=SYSCALLS.get();return stream.flags|=arg,0;case 5:arg=SYSCALLS.getp();return HEAP16[arg+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return setErrNo(28),-1;default:return-28}}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},x:function(fd,buf){try{var stream=SYSCALLS.getStreamFromFD(fd);return SYSCALLS.doStat(FS.stat,stream.path,buf)}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},u:function(path,buf){try{return path=SYSCALLS.getStr(path),SYSCALLS.doStat(FS.lstat,path,buf)}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},v:function(dirfd,path,buf,flags){try{path=SYSCALLS.getStr(path);var nofollow=256&flags,allowEmpty=4096&flags;return flags&=-6401,path=SYSCALLS.calculateAt(dirfd,path,allowEmpty),SYSCALLS.doStat(nofollow?FS.lstat:FS.stat,path,buf)}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},y:function(dirfd,path,flags,varargs){SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path),path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?SYSCALLS.get():0;return FS.open(path,flags,mode).fd}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},t:function(fdPtr){try{if(0==fdPtr)throw new FS.ErrnoError(21);var res=PIPEFS.createPipe();return HEAP32[fdPtr>>2]=res.readable_fd,HEAP32[fdPtr+4>>2]=res.writable_fd,0}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},s:function(fds,nfds,timeout){try{for(var nonzero=0,i=0;i>2],events=HEAP16[pollfd+4>>1],mask=32,stream=FS.getStream(fd);stream&&(mask=SYSCALLS.DEFAULT_POLLMASK,stream.stream_ops.poll)&&(mask=stream.stream_ops.poll(stream,-1)),(mask&=24|events)&&nonzero++,HEAP16[pollfd+6>>1]=mask}return nonzero}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},w:function(path,buf){try{return path=SYSCALLS.getStr(path),SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},q:function(dirfd,path,flags){try{return path=SYSCALLS.getStr(path),path=SYSCALLS.calculateAt(dirfd,path),0===flags?FS.unlink(path):512===flags?FS.rmdir(path):abort("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},B:()=>1,k:function(time_low,time_high,tmPtr){time_low=convertI32PairToI53Checked(time_low,time_high),time_high=new Date(1e3*time_low),HEAP32[tmPtr>>2]=time_high.getUTCSeconds(),HEAP32[tmPtr+4>>2]=time_high.getUTCMinutes(),HEAP32[tmPtr+8>>2]=time_high.getUTCHours(),HEAP32[tmPtr+12>>2]=time_high.getUTCDate(),HEAP32[tmPtr+16>>2]=time_high.getUTCMonth(),HEAP32[tmPtr+20>>2]=time_high.getUTCFullYear()-1900,HEAP32[tmPtr+24>>2]=time_high.getUTCDay(),time_low=Date.UTC(time_high.getUTCFullYear(),0,1,0,0,0,0),time_high=(time_high.getTime()-time_low)/864e5|0,HEAP32[tmPtr+28>>2]=time_high},l:function(time_low,time_high,tmPtr){var time_low=convertI32PairToI53Checked(time_low,time_high),time_high=new Date(1e3*time_low),time_low=(HEAP32[tmPtr>>2]=time_high.getSeconds(),HEAP32[tmPtr+4>>2]=time_high.getMinutes(),HEAP32[tmPtr+8>>2]=time_high.getHours(),HEAP32[tmPtr+12>>2]=time_high.getDate(),HEAP32[tmPtr+16>>2]=time_high.getMonth(),HEAP32[tmPtr+20>>2]=time_high.getFullYear()-1900,HEAP32[tmPtr+24>>2]=time_high.getDay(),0|ydayFromDate(time_high)),time_low=(HEAP32[tmPtr+28>>2]=time_low,HEAP32[tmPtr+36>>2]=-60*time_high.getTimezoneOffset(),new Date(time_high.getFullYear(),0,1)),summerOffset=new Date(time_high.getFullYear(),6,1).getTimezoneOffset(),time_low=time_low.getTimezoneOffset(),time_high=0|(summerOffset!=time_low&&time_high.getTimezoneOffset()==Math.min(time_low,summerOffset));HEAP32[tmPtr+32>>2]=time_high},m:function(tmPtr){date=new Date(HEAP32[tmPtr+20>>2]+1900,HEAP32[tmPtr+16>>2],HEAP32[tmPtr+12>>2],HEAP32[tmPtr+8>>2],HEAP32[tmPtr+4>>2],HEAP32[tmPtr>>2],0),dst=HEAP32[tmPtr+32>>2],guessedOffset=date.getTimezoneOffset(),start=new Date(date.getFullYear(),0,1),summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset(),start=start.getTimezoneOffset(),dstOffset=Math.min(start,summerOffset),dst<0?HEAP32[tmPtr+32>>2]=Number(summerOffset!=start&&dstOffset==guessedOffset):0>2]=date.getDay(),dst=0|ydayFromDate(date),HEAP32[tmPtr+28>>2]=dst,HEAP32[tmPtr>>2]=date.getSeconds(),HEAP32[tmPtr+4>>2]=date.getMinutes(),HEAP32[tmPtr+8>>2]=date.getHours(),HEAP32[tmPtr+12>>2]=date.getDate(),HEAP32[tmPtr+16>>2]=date.getMonth(),HEAP32[tmPtr+20>>2]=date.getYear(),dstOffset=date.getTime();var date,dst,guessedOffset,summerOffset,dstOffset,start=isNaN(dstOffset)?(setErrNo(61),-1):dstOffset/1e3;return setTempRet0((tempDouble=start,1<=+Math.abs(tempDouble)?0>>0:~~+Math.ceil((tempDouble-(~~tempDouble>>>0))/4294967296)>>>0:0)),start>>>0},n:function(tmPtr){time=Date.UTC(HEAP32[tmPtr+20>>2]+1900,HEAP32[tmPtr+16>>2],HEAP32[tmPtr+12>>2],HEAP32[tmPtr+8>>2],HEAP32[tmPtr+4>>2],HEAP32[tmPtr>>2],0),time=new Date(time),HEAP32[tmPtr+24>>2]=time.getUTCDay(),start=Date.UTC(time.getUTCFullYear(),0,1,0,0,0,0),start=(time.getTime()-start)/864e5|0,HEAP32[tmPtr+28>>2]=start;var time,start,tmPtr=time.getTime()/1e3;return setTempRet0((tempDouble=tmPtr,1<=+Math.abs(tempDouble)?0>>0:~~+Math.ceil((tempDouble-(~~tempDouble>>>0))/4294967296)>>>0:0)),tmPtr>>>0},r:(timezone,daylight,tzname)=>{var currentYear=(new Date).getFullYear(),winter=new Date(currentYear,0,1),currentYear=new Date(currentYear,6,1),winterOffset=winter.getTimezoneOffset(),summerOffset=currentYear.getTimezoneOffset(),stdTimezoneOffset=Math.max(winterOffset,summerOffset);function extractZone(date){date=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return date?date[1]:"GMT"}HEAPU32[timezone>>2]=60*stdTimezoneOffset,HEAP32[daylight>>2]=Number(winterOffset!=summerOffset);timezone=extractZone(winter),stdTimezoneOffset=extractZone(currentYear),daylight=stringToNewUTF8(timezone),winter=stringToNewUTF8(stdTimezoneOffset);summerOffset>2]=daylight,HEAPU32[tzname+4>>2]=winter):(HEAPU32[tzname>>2]=winter,HEAPU32[tzname+4>>2]=daylight)},b:()=>{abort("")},c:()=>Date.now(),h:(dest,src,num)=>HEAPU8.copyWithin(dest,src,src+num),p:requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;if(!(2147483648{size=(size-wasmMemory.buffer.byteLength+65535)/65536;try{return wasmMemory.grow(size),updateMemoryViews(),1}catch(e){}})(Math.min(2147483648,(overGrownHeapSize=Math.max(requestedSize,overGrownHeapSize))+((multiple=65536)-overGrownHeapSize%multiple)%multiple)))return!0}return!1},z:(__environ,environ_buf)=>{var bufSize=0;return getEnvStrings().forEach((string,i)=>{var ptr=environ_buf+bufSize;((str,buffer)=>{for(var i=0;i>0]=str.charCodeAt(i);HEAP8[buffer>>0]=0})(string,HEAPU32[__environ+4*i>>2]=ptr),bufSize+=string.length+1}),0},A:(penviron_count,penviron_buf_size)=>{var strings=getEnvStrings(),bufSize=(HEAPU32[penviron_count>>2]=strings.length,0);return strings.forEach(string=>bufSize+=string.length+1),HEAPU32[penviron_buf_size>>2]=bufSize,0},g:moduleOverrides,e:function(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);return FS.close(stream),0}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return e.errno}},j:function(fd,iov,iovcnt,pnum){try{var num=((stream,iov,iovcnt,offset)=>{for(var ret=0,i=0;i>2],len=HEAPU32[iov+4>>2],ptr=(iov+=8,FS.read(stream,HEAP8,ptr,len,offset));if(ptr<0)return-1;if(ret+=ptr,ptr>2]=num,0}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return e.errno}},o:function(fd,offset_low,offset_high,whence,newOffset){var stream,offset_low=convertI32PairToI53Checked(offset_low,offset_high);try{return isNaN(offset_low)?61:(stream=SYSCALLS.getStreamFromFD(fd),FS.llseek(stream,offset_low,whence),tempI64=[stream.position>>>0,(tempDouble=stream.position,1<=+Math.abs(tempDouble)?0>>0:~~+Math.ceil((tempDouble-(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1],stream.getdents&&0===offset_low&&0===whence&&(stream.getdents=null),0)}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return e.errno}},d:function(fd,iov,iovcnt,pnum){try{var num=((stream,iov,iovcnt,offset)=>{for(var ret=0,i=0;i>2],len=HEAPU32[iov+4>>2],ptr=(iov+=8,FS.write(stream,HEAP8,ptr,len,offset));if(ptr<0)return-1;ret+=ptr,void 0!==offset&&(offset+=ptr)}return ret})(SYSCALLS.getStreamFromFD(fd),iov,iovcnt);return HEAPU32[pnum>>2]=num,0}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return e.errno}},f:(s,maxsize,format,tm)=>{var tm_zone=HEAPU32[tm+40>>2],date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""},pattern=UTF8ToString(format),EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(rule in EXPANSION_RULES_1)pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule]);var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){for(var str="number"==typeof value?value.toString():value||"";str.length{for(var newDate=new Date(date.getTime());0leap-newDate.getDate()))return newDate.setDate(newDate.getDate()+days),newDate;days-=leap-newDate.getDate()+1,newDate.setDate(1),currentMonth<11?newDate.setMonth(currentMonth+1):(newDate.setMonth(0),newDate.setFullYear(newDate.getFullYear()+1))}return newDate})(new Date(date.tm_year+1900,0,1),date.tm_yday),janFourthThisYear=new Date(date.getFullYear(),0,4),janFourthNextYear=new Date(date.getFullYear()+1,0,4),janFourthThisYear=getFirstWeekStartDate(janFourthThisYear),janFourthNextYear=getFirstWeekStartDate(janFourthNextYear);return compareByDay(janFourthThisYear,date)<=0?compareByDay(janFourthNextYear,date)<=0?date.getFullYear()+1:date.getFullYear():date.getFullYear()-1}var rule,EXPANSION_RULES_2={"%a":date=>WEEKDAYS[date.tm_wday].substring(0,3),"%A":date=>WEEKDAYS[date.tm_wday],"%b":date=>MONTHS[date.tm_mon].substring(0,3),"%B":date=>MONTHS[date.tm_mon],"%C":date=>{return leadingNulls((date.tm_year+1900)/100|0,2)},"%d":date=>leadingNulls(date.tm_mday,2),"%e":date=>leadingSomething(date.tm_mday,2," "),"%g":date=>getWeekBasedYear(date).toString().substring(2),"%G":date=>getWeekBasedYear(date),"%H":date=>leadingNulls(date.tm_hour,2),"%I":date=>{date=date.tm_hour;return 0==date?date=12:12leadingNulls(date.tm_mday+((array,index)=>{for(var sum=0,i=0;i<=index;sum+=array[i++]);return sum})(isLeapYear(date.tm_year+1900)?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,date.tm_mon-1),3),"%m":date=>leadingNulls(date.tm_mon+1,2),"%M":date=>leadingNulls(date.tm_min,2),"%n":()=>"\n","%p":date=>0<=date.tm_hour&&date.tm_hour<12?"AM":"PM","%S":date=>leadingNulls(date.tm_sec,2),"%t":()=>"\t","%u":date=>date.tm_wday||7,"%U":date=>{date=date.tm_yday+7-date.tm_wday;return leadingNulls(Math.floor(date/7),2)},"%V":date=>{var jan1,val=Math.floor((date.tm_yday+7-(date.tm_wday+6)%7)/7);return(date.tm_wday+371-date.tm_yday-2)%7<=2&&val++,val?53!=val||4==(jan1=(date.tm_wday+371-date.tm_yday)%7)||3==jan1&&isLeapYear(date.tm_year)||(val=1):(val=52,(4==(jan1=(date.tm_wday+7-date.tm_yday-1)%7)||5==jan1&&isLeapYear(date.tm_year%400-1))&&val++),leadingNulls(val,2)},"%w":date=>date.tm_wday,"%W":date=>{date=date.tm_yday+7-(date.tm_wday+6)%7;return leadingNulls(Math.floor(date/7),2)},"%y":date=>(date.tm_year+1900).toString().substring(2),"%Y":date=>date.tm_year+1900,"%z":date=>{var ahead=0<=(date=date.tm_gmtoff),date=Math.abs(date)/60;return(ahead?"+":"-")+String("0000"+(date/60*100+date%60)).slice(-4)},"%Z":date=>date.tm_zone,"%%":()=>"%"},pattern=pattern.replace(/%%/g,"\0\0");for(rule in EXPANSION_RULES_2)pattern.includes(rule)&&(pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date)));tm=intArrayFromString(pattern=pattern.replace(/\0\0/g,"%"),!1);return tm.length>maxsize?0:(writeArrayToMemory(tm,s),tm.length-1)}}),wasmExports=function(){var binaryFile,imports,callback,info={a:wasmImports};function receiveInstance(instance,module){return wasmExports=instance.exports,wasmMemory=wasmExports.C,updateMemoryViews(),instance=wasmExports.D,__ATINIT__.unshift(instance),removeRunDependency(),wasmExports}if(addRunDependency(),Module.instantiateWasm)try{return Module.instantiateWasm(info,receiveInstance)}catch(e){err("Module.instantiateWasm callback failed with error: ".concat(e)),readyPromiseReject(e)}return binaryFile=wasmBinaryFile,imports=info,callback=function(result){receiveInstance(result.instance)},(wasmBinary||"function"!=typeof WebAssembly.instantiateStreaming||isDataURI(binaryFile)||isFileURI(binaryFile)||ENVIRONMENT_IS_NODE||"function"!=typeof fetch?instantiateArrayBuffer(binaryFile,imports,callback):fetch(binaryFile,{credentials:"same-origin"}).then(response=>{return WebAssembly.instantiateStreaming(response,imports).then(callback,function(reason){return err("wasm streaming compile failed: ".concat(reason)),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(binaryFile,imports,callback)})})).catch(readyPromiseReject),{}}(),_malloc=(Module._get_version=()=>(Module._get_version=wasmExports.E)(),Module._archive_open=(a0,a1,a2,a3)=>(Module._archive_open=wasmExports.F)(a0,a1,a2,a3),Module._archive_read_add_passphrase=(a0,a1)=>(Module._archive_read_add_passphrase=wasmExports.G)(a0,a1),Module._archive_error_string=a0=>(Module._archive_error_string=wasmExports.H)(a0),Module._get_next_entry=a0=>(Module._get_next_entry=wasmExports.I)(a0),Module._get_filedata=(a0,a1)=>(Module._get_filedata=wasmExports.J)(a0,a1),Module._malloc=a0=>(_malloc=Module._malloc=wasmExports.K)(a0)),___errno_location=(Module._archive_close=a0=>(Module._archive_close=wasmExports.L)(a0),Module._start_archive_write=(a0,a1,a2,a3,a4,a5)=>(Module._start_archive_write=wasmExports.M)(a0,a1,a2,a3,a4,a5),Module._write_archive_file=(a0,a1,a2,a3)=>(Module._write_archive_file=wasmExports.N)(a0,a1,a2,a3),Module._size_of_size_t=()=>(Module._size_of_size_t=wasmExports.O)(),Module._finish_archive_write=(a0,a1)=>(Module._finish_archive_write=wasmExports.P)(a0,a1),Module._free=a0=>(Module._free=wasmExports.Q)(a0),()=>(___errno_location=wasmExports.R)()),setTempRet0=(Module._archive_entry_birthtime_nsec=a0=>(Module._archive_entry_birthtime_nsec=wasmExports.S)(a0),Module._archive_entry_filetype=a0=>(Module._archive_entry_filetype=wasmExports.T)(a0),Module._archive_entry_mtime_nsec=a0=>(Module._archive_entry_mtime_nsec=wasmExports.U)(a0),Module._archive_entry_pathname=a0=>(Module._archive_entry_pathname=wasmExports.V)(a0),Module._archive_entry_pathname_utf8=a0=>(Module._archive_entry_pathname_utf8=wasmExports.W)(a0),Module._archive_entry_size=a0=>(Module._archive_entry_size=wasmExports.X)(a0),Module._archive_entry_is_encrypted=a0=>(Module._archive_entry_is_encrypted=wasmExports.Y)(a0),Module._archive_read_has_encrypted_entries=a0=>(Module._archive_read_has_encrypted_entries=wasmExports.Z)(a0),Module._archive_read_data_skip=a0=>(Module._archive_read_data_skip=wasmExports._)(a0),a0=>(setTempRet0=wasmExports.aa)(a0)),stackSave=()=>(stackSave=wasmExports.ba)(),stackRestore=a0=>(stackRestore=wasmExports.ca)(a0),stackAlloc=a0=>(stackAlloc=wasmExports.da)(a0);function run(){function doRun(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT)||(Module.noFSInit||FS.init.initialized||FS.init(),FS.ignorePermissions=!1,PIPEFS.root=FS.mount(PIPEFS,{},null),callRuntimeCallbacks(__ATINIT__),readyPromiseResolve(Module),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),postRun())}0{var numericArgs=!argTypes||argTypes.every(type=>"number"===type||"boolean"===type);return"string"!==returnType&&numericArgs&&!opts?getCFunc(ident):function(){return ccall(ident,returnType,argTypes,arguments)}},Module.allocate=(slab,allocator)=>{allocator=(1==allocator?stackAlloc:_malloc)(slab.length);return slab.subarray||slab.slice||(slab=new Uint8Array(slab)),HEAPU8.set(slab,allocator),allocator},dependenciesFulfilled=function runCaller(){calledRun||run(),calledRun||(dependenciesFulfilled=runCaller)},Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);0this.allocate(this.intArrayFromString(str),"i8",0),malloc:this.cwrap("malloc","number",["number"]),free:this.cwrap("free",null,["number"]),sizeOfSizeT:this.cwrap("size_of_size_t","number",[])}}monitorRunDependencies(){}}function getWasmModule(cb){libarchive(new WasmModule).then(module=>{module.initFunctions(),cb(module)})}var reader=null,writer=null,ready=!1;class LibArchiveWorker{constructor(readyCallback){LibArchiveWorker.readyCallback=readyCallback,ready&&setTimeout(()=>readyCallback(),0)}open(file,cb){reader.open(file).then(()=>cb())}listFiles(){var entry,arr=[];for(entry of reader.entries(!0))arr.push(entry);return arr}extractFiles(){var entry,arr=[];for(entry of reader.entries(!1))arr.push(entry);return arr}extractSingleFile(target){for(var entry of reader.entries(!0,target))if(entry.fileData)return entry}hasEncryptedData(){return reader.hasEncryptedData()}usePassword(passphrase){reader.setPassphrase(passphrase)}setLocale(locale){reader.setLocale(locale)}writeArchive(files,compression,format,passphrase){return writer.write(files,compression,format,passphrase)}close(){reader.close()}}getWasmModule(wasmModule=>{reader=new ArchiveReader(wasmModule),writer=new ArchiveWriter(wasmModule),null!=LibArchiveWorker&&null!=LibArchiveWorker.readyCallback&&LibArchiveWorker.readyCallback(),ready=!0}),expose(LibArchiveWorker);