async function Module(moduleArg={}){
var readAsync,Module=moduleArg,thisProgram="./this.program",quit_=(status,toThrow)=>{throw toThrow
},_scriptName=import.meta.url,scriptDirectory="";try{scriptDirectory=new URL(".",_scriptName).href
}catch{}readAsync=async url=>{var response=await fetch(url,{credentials:"same-origin"})
;if(response.ok)return response.arrayBuffer();throw new Error(response.status+" : "+response.url)}
;var wasmBinary,EXITSTATUS,readyPromiseResolve,readyPromiseReject,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP64,HEAPU64,wasmBinaryFile,out=console.log.bind(console),err=console.error.bind(console),ABORT=!1,runtimeInitialized=!1
;function updateMemoryViews(){var b=wasmMemory.buffer
;HEAP8=new Int8Array(b),HEAP16=new Int16Array(b),
HEAPU8=new Uint8Array(b),HEAPU16=new Uint16Array(b),
HEAP32=new Int32Array(b),HEAPU32=new Uint32Array(b),HEAPF32=new Float32Array(b),
HEAPF64=new Float64Array(b),HEAP64=new BigInt64Array(b),HEAPU64=new BigUint64Array(b)}
function abort(what){Module.onAbort?.(what),err(what="Aborted("+what+")"),ABORT=!0,
what+=". Build with -sASSERTIONS for more info.",runtimeInitialized&&___trap()
;var e=new WebAssembly.RuntimeError(what);throw readyPromiseReject?.(e),e}function findWasmBinary(){
return Module.locateFile?function locateFile(path){
return Module.locateFile?Module.locateFile(path,scriptDirectory):scriptDirectory+path
}("wax.common.wasm"):new URL("wax.common.wasm",import.meta.url).href}
async function getWasmBinary(binaryFile){if(!wasmBinary)try{var response=await readAsync(binaryFile)
;return new Uint8Array(response)}catch{}return function getBinarySync(file){
if(file==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary)
;throw"both async and sync fetching of the wasm failed"}(binaryFile)}
async function instantiateAsync(binary,binaryFile,imports){if(!binary)try{
var response=fetch(binaryFile,{credentials:"same-origin"})
;return await WebAssembly.instantiateStreaming(response,imports)}catch(reason){
err(`wasm streaming compile failed: ${reason}`),err("falling back to ArrayBuffer instantiation")}
return async function instantiateArrayBuffer(binaryFile,imports){try{
var binary=await getWasmBinary(binaryFile);return await WebAssembly.instantiate(binary,imports)
}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`),abort(reason)}
}(binaryFile,imports)}class ExitStatus{name="ExitStatus";constructor(status){
this.message=`Program terminated with exit(${status})`,this.status=status}}
var callRuntimeCallbacks=callbacks=>{for(;callbacks.length>0;)callbacks.shift()(Module)
},onPostRuns=[],addOnPostRun=cb=>onPostRuns.push(cb),onPreRuns=[],addOnPreRun=cb=>onPreRuns.push(cb),noExitRuntime=!0,UTF8Decoder=new TextDecoder,findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{
var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx
;for(;heapOrArray[idx]&&!(idx>=maxIdx);)++idx;return idx
},UTF8ToString=(ptr,maxBytesToRead,ignoreNul)=>{if(!ptr)return""
;var end=findStringEnd(HEAPU8,ptr,maxBytesToRead,ignoreNul)
;return UTF8Decoder.decode(HEAPU8.subarray(ptr,end))},syscallGetVarargI=()=>{
var ret=HEAP32[+SYSCALLS.varargs>>2];return SYSCALLS.varargs+=4,ret
},syscallGetVarargP=syscallGetVarargI,PATH={isAbs:path=>"/"===path.charAt(0),
splitPath:filename=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(filename).slice(1),
normalizeArray:(parts,allowAboveRoot)=>{for(var up=0,i=parts.length-1;i>=0;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.slice(-1)
;return(path=PATH.normalizeArray(path.split("/").filter((p=>!!p)),!isAbsolute).join("/"))||isAbsolute||(path="."),
path&&trailingSlash&&(path+="/"),(isAbsolute?"/":"")+path},dirname:path=>{
var result=PATH.splitPath(path),root=result[0],dir=result[1]
;return root||dir?(dir&&(dir=dir.slice(0,-1)),root+dir):"."},
basename:path=>path&&path.match(/([^\/]+|\/)\/*$/)[1],
join:(...paths)=>PATH.normalize(paths.join("/")),join2:(l,r)=>PATH.normalize(l+"/"+r)
},randomFill=view=>{(randomFill=view=>crypto.getRandomValues(view))(view)},PATH_FS={
resolve:(...args)=>{
for(var resolvedPath="",resolvedAbsolute=!1,i=args.length-1;i>=-1&&!resolvedAbsolute;i--){
var path=i>=0?args[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<arr.length&&""===arr[start];start++);
for(var end=arr.length-1;end>=0&&""===arr[end];end--);
return start>end?[]:arr.slice(start,end-start+1)}from=PATH_FS.resolve(from).slice(1),
to=PATH_FS.resolve(to).slice(1)
;for(var fromParts=trim(from.split("/")),toParts=trim(to.split("/")),length=Math.min(fromParts.length,toParts.length),samePartsLength=length,i=0;i<length;i++)if(fromParts[i]!==toParts[i]){
samePartsLength=i;break}var outputParts=[]
;for(i=samePartsLength;i<fromParts.length;i++)outputParts.push("..")
;return(outputParts=outputParts.concat(toParts.slice(samePartsLength))).join("/")}
},UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{
var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul)
;return UTF8Decoder.decode(heapOrArray.buffer?heapOrArray.subarray(idx,endPtr):new Uint8Array(heapOrArray.slice(idx,endPtr)))
},FS_stdin_getChar_buffer=[],lengthBytesUTF8=str=>{for(var len=0,i=0;i<str.length;++i){
var c=str.charCodeAt(i);c<=127?len++:c<=2047?len+=2:c>=55296&&c<=57343?(len+=4,++i):len+=3}
return len},stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0
;for(var startIdx=outIdx,endIdx=outIdx+maxBytesToWrite-1,i=0;i<str.length;++i){
var u=str.codePointAt(i);if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){
if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6,heap[outIdx++]=128|63&u}else if(u<=65535){
if(outIdx+2>=endIdx)break
;heap[outIdx++]=224|u>>12,heap[outIdx++]=128|u>>6&63,heap[outIdx++]=128|63&u}else{
if(outIdx+3>=endIdx)break
;heap[outIdx++]=240|u>>18,heap[outIdx++]=128|u>>12&63,heap[outIdx++]=128|u>>6&63,
heap[outIdx++]=128|63&u,i++}}return heap[outIdx]=0,outIdx-startIdx
},intArrayFromString=(stringy,dontAddNull,length)=>{
var len=length>0?length:lengthBytesUTF8(stringy)+1,u8array=new Array(len),numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length)
;return dontAddNull&&(u8array.length=numBytesWritten),u8array},TTY={ttys:[],init(){},shutdown(){},
register(dev,ops){TTY.ttys[dev]={input:[],output:[],ops},FS.registerDevice(dev,TTY.stream_ops)},
stream_ops:{open(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty)throw new FS.ErrnoError(43)
;stream.tty=tty,stream.seekable=!1},close(stream){stream.tty.ops.fsync(stream.tty)},fsync(stream){
stream.tty.ops.fsync(stream.tty)},read(stream,buffer,offset,length,pos){
if(!stream.tty||!stream.tty.ops.get_char)throw new FS.ErrnoError(60)
;for(var bytesRead=0,i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty)
}catch(e){throw new FS.ErrnoError(29)}if(void 0===result&&0===bytesRead)throw new FS.ErrnoError(6)
;if(null==result)break;bytesRead++,buffer[offset+i]=result}
return bytesRead&&(stream.node.atime=Date.now()),bytesRead},write(stream,buffer,offset,length,pos){
if(!stream.tty||!stream.tty.ops.put_char)throw new FS.ErrnoError(60);try{
for(var i=0;i<length;i++)stream.tty.ops.put_char(stream.tty,buffer[offset+i])}catch(e){
throw new FS.ErrnoError(29)}return length&&(stream.node.mtime=stream.node.ctime=Date.now()),i}},
default_tty_ops:{get_char:tty=>(()=>{if(!FS_stdin_getChar_buffer.length){var result=null
;if(globalThis.window?.prompt&&null!==(result=window.prompt("Input: "))&&(result+="\n"),
!result)return null;FS_stdin_getChar_buffer=intArrayFromString(result,!0)}
return FS_stdin_getChar_buffer.shift()})(),put_char(tty,val){
null===val||10===val?(out(UTF8ArrayToString(tty.output)),tty.output=[]):0!=val&&tty.output.push(val)
},fsync(tty){tty.output?.length>0&&(out(UTF8ArrayToString(tty.output)),tty.output=[])},
ioctl_tcgets:tty=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,
c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),
ioctl_tcsets:(tty,optional_actions,data)=>0,ioctl_tiocgwinsz:tty=>[24,80]},default_tty1_ops:{
put_char(tty,val){
null===val||10===val?(err(UTF8ArrayToString(tty.output)),tty.output=[]):0!=val&&tty.output.push(val)
},fsync(tty){tty.output?.length>0&&(err(UTF8ArrayToString(tty.output)),tty.output=[])}}
},alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment,mmapAlloc=size=>{
size=alignMemory(size,65536);var ptr=_emscripten_builtin_memalign(65536,size)
;return ptr&&((ptr,size)=>{HEAPU8.fill(0,ptr,ptr+size)})(ptr,size),ptr},MEMFS={ops_table:null,
mount:mount=>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||={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,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}};var node=FS.createNode(parent,name,mode,dev)
;return FS.isDir(node.mode)?(node.node_ops=MEMFS.ops_table.dir.node,
node.stream_ops=MEMFS.ops_table.dir.stream,
node.contents={}):FS.isFile(node.mode)?(node.node_ops=MEMFS.ops_table.file.node,
node.stream_ops=MEMFS.ops_table.file.stream,
node.usedBytes=0,node.contents=null):FS.isLink(node.mode)?(node.node_ops=MEMFS.ops_table.link.node,
node.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(node.mode)&&(node.node_ops=MEMFS.ops_table.chrdev.node,
node.stream_ops=MEMFS.ops_table.chrdev.stream),node.atime=node.mtime=node.ctime=Date.now(),
parent&&(parent.contents[name]=node,parent.atime=parent.mtime=parent.ctime=node.atime),node},
getFileDataAsTypedArray:node=>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
;if(!(prevCapacity>=newCapacity)){
newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<1048576?2:1.125)>>>0),
0!=prevCapacity&&(newCapacity=Math.max(newCapacity,256));var oldContents=node.contents
;node.contents=new Uint8Array(newCapacity),
node.usedBytes>0&&node.contents.set(oldContents.subarray(0,node.usedBytes),0)}},
resizeFileStorage(node,newSize){if(node.usedBytes!=newSize)if(0==newSize)node.contents=null,
node.usedBytes=0;else{var oldContents=node.contents;node.contents=new Uint8Array(newSize),
oldContents&&node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes))),
node.usedBytes=newSize}},node_ops:{getattr(node){var attr={}
;return attr.dev=FS.isChrdev(node.mode)?node.id:1,attr.ino=node.id,attr.mode=node.mode,attr.nlink=1,
attr.uid=0,
attr.gid=0,attr.rdev=node.rdev,FS.isDir(node.mode)?attr.size=4096:FS.isFile(node.mode)?attr.size=node.usedBytes:FS.isLink(node.mode)?attr.size=node.link.length:attr.size=0,
attr.atime=new Date(node.atime),attr.mtime=new Date(node.mtime),attr.ctime=new Date(node.ctime),
attr.blksize=4096,attr.blocks=Math.ceil(attr.size/attr.blksize),attr},setattr(node,attr){
for(const key of["mode","atime","mtime","ctime"])null!=attr[key]&&(node[key]=attr[key])
;void 0!==attr.size&&MEMFS.resizeFileStorage(node,attr.size)},lookup(parent,name){
throw MEMFS.doesNotExistError||(MEMFS.doesNotExistError=new FS.ErrnoError(44),
MEMFS.doesNotExistError.stack="<generic error, no stack>"),MEMFS.doesNotExistError},
mknod:(parent,name,mode,dev)=>MEMFS.createNode(parent,name,mode,dev),
rename(old_node,new_dir,new_name){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)
}catch(e){}if(new_node){
if(FS.isDir(old_node.mode))for(var i in new_node.contents)throw new FS.ErrnoError(55)
;FS.hashRemoveNode(new_node)}
delete old_node.parent.contents[old_node.name],new_dir.contents[new_name]=old_node,
old_node.name=new_name,
new_dir.ctime=new_dir.mtime=old_node.parent.ctime=old_node.parent.mtime=Date.now()},
unlink(parent,name){delete parent.contents[name],parent.ctime=parent.mtime=Date.now()},
rmdir(parent,name){var node=FS.lookupNode(parent,name)
;for(var i in node.contents)throw new FS.ErrnoError(55);delete parent.contents[name],
parent.ctime=parent.mtime=Date.now()},readdir:node=>[".","..",...Object.keys(node.contents)],
symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,41471,0)
;return node.link=oldpath,node},readlink(node){if(!FS.isLink(node.mode))throw new FS.ErrnoError(28)
;return node.link}},stream_ops:{read(stream,buffer,offset,length,position){
var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0
;var size=Math.min(stream.node.usedBytes-position,length)
;if(size>8&&contents.subarray)buffer.set(contents.subarray(position,position+size),offset);else for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i]
;return size},write(stream,buffer,offset,length,position,canOwn){
if(buffer.buffer===HEAP8.buffer&&(canOwn=!1),!length)return 0;var node=stream.node
;if(node.mtime=node.ctime=Date.now(),buffer.subarray&&(!node.contents||node.contents.subarray)){
if(canOwn)return node.contents=buffer.subarray(offset,offset+length),node.usedBytes=length,length
;if(0===node.usedBytes&&0===position)return node.contents=buffer.slice(offset,offset+length),
node.usedBytes=length,length
;if(position+length<=node.usedBytes)return node.contents.set(buffer.subarray(offset,offset+length),position),
length}
if(MEMFS.expandFileStorage(node,position+length),node.contents.subarray&&buffer.subarray)node.contents.set(buffer.subarray(offset,offset+length),position);else for(var i=0;i<length;i++)node.contents[position+i]=buffer[offset+i]
;return node.usedBytes=Math.max(node.usedBytes,position+length),length},
llseek(stream,offset,whence){var position=offset
;if(1===whence?position+=stream.position:2===whence&&FS.isFile(stream.node.mode)&&(position+=stream.node.usedBytes),
position<0)throw new FS.ErrnoError(28);return position},mmap(stream,length,position,prot,flags){
if(!FS.isFile(stream.node.mode))throw new FS.ErrnoError(43)
;var ptr,allocated,contents=stream.node.contents
;if(2&flags||!contents||contents.buffer!==HEAP8.buffer){
if(allocated=!0,!(ptr=mmapAlloc(length)))throw new FS.ErrnoError(48)
;contents&&((position>0||position+length<contents.length)&&(contents=contents.subarray?contents.subarray(position,position+length):Array.prototype.slice.call(contents,position,position+length)),
HEAP8.set(contents,ptr))}else allocated=!1,ptr=contents.byteOffset;return{ptr,allocated}},
msync:(stream,buffer,offset,length,mmapFlags)=>(MEMFS.stream_ops.write(stream,buffer,0,length,offset,!1),
0)}},FS_getMode=(canRead,canWrite)=>{var mode=0;return canRead&&(mode|=365),canWrite&&(mode|=146),
mode
},runDependencies=0,dependenciesFulfilled=null,preloadPlugins=[],FS_preloadFile=async(parent,name,url,canRead,canWrite,dontCreateFile,canOwn,preFinish)=>{
var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;runDependencies++,
Module.monitorRunDependencies?.(runDependencies);try{var byteArray=url
;"string"==typeof url&&(byteArray=await(async url=>{var arrayBuffer=await readAsync(url)
;return new Uint8Array(arrayBuffer)})(url)),byteArray=await(async(byteArray,fullname)=>{
for(var plugin of("undefined"!=typeof Browser&&Browser.init(),
preloadPlugins))if(plugin.canHandle(fullname))return plugin.handle(byteArray,fullname)
;return byteArray})(byteArray,fullname),preFinish?.(),dontCreateFile||((...args)=>{
FS.createDataFile(...args)})(parent,name,byteArray,canRead,canWrite,canOwn)}finally{(()=>{
if(runDependencies--,
Module.monitorRunDependencies?.(runDependencies),0==runDependencies&&dependenciesFulfilled){
var callback=dependenciesFulfilled;dependenciesFulfilled=null,callback()}})()}},FS={root:null,
mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,
ignorePermissions:!0,filesystems:null,syncFSRequests:0,readFiles:{},ErrnoError:class{
name="ErrnoError";constructor(errno){this.errno=errno}},FSStream:class{shared={};get object(){
return this.node}set object(val){this.node=val}get isRead(){return 1!=(2097155&this.flags)}
get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){
return this.shared.flags}set flags(val){this.shared.flags=val}get position(){
return this.shared.position}set position(val){this.shared.position=val}},FSNode:class{node_ops={}
;stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(parent,name,mode,rdev){
parent||(parent=this),this.parent=parent,this.mount=parent.mount,this.id=FS.nextInode++,
this.name=name,this.mode=mode,this.rdev=rdev,this.atime=this.mtime=this.ctime=Date.now()}get read(){
return(this.mode&this.readMode)===this.readMode}set read(val){
val?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){
return(this.mode&this.writeMode)===this.writeMode}set write(val){
val?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return FS.isDir(this.mode)}
get isDevice(){return FS.isChrdev(this.mode)}},lookupPath(path,opts={}){
if(!path)throw new FS.ErrnoError(44)
;opts.follow_mount??=!0,PATH.isAbs(path)||(path=FS.cwd()+"/"+path)
;linkloop:for(var nlinks=0;nlinks<40;nlinks++){
for(var parts=path.split("/").filter((p=>!!p)),current=FS.root,current_path="/",i=0;i<parts.length;i++){
var islast=i===parts.length-1;if(islast&&opts.parent)break;if("."!==parts[i])if(".."!==parts[i]){
current_path=PATH.join2(current_path,parts[i]);try{current=FS.lookupNode(current,parts[i])}catch(e){
if(44===e?.errno&&islast&&opts.noent_okay)return{path:current_path};throw e}
if(!FS.isMountpoint(current)||islast&&!opts.follow_mount||(current=current.mounted.root),
FS.isLink(current.mode)&&(!islast||opts.follow)){
if(!current.node_ops.readlink)throw new FS.ErrnoError(52)
;var link=current.node_ops.readlink(current)
;PATH.isAbs(link)||(link=PATH.dirname(current_path)+"/"+link),
path=link+"/"+parts.slice(i+1).join("/");continue linkloop}}else{
if(current_path=PATH.dirname(current_path),FS.isRoot(current)){
path=current_path+"/"+parts.slice(i+1).join("/"),nlinks--;continue linkloop}current=current.parent}}
return{path:current_path,node:current}}throw new FS.ErrnoError(32)},getPath(node){for(var path;;){
if(FS.isRoot(node)){var mount=node.mount.mountpoint
;return path?"/"!==mount[mount.length-1]?`${mount}/${path}`:mount+path:mount}
path=path?`${node.name}/${path}`:node.name,node=node.parent}},hashName(parentid,name){
for(var hash=0,i=0;i<name.length;i++)hash=(hash<<5)-hash+name.charCodeAt(i)|0
;return(parentid+hash>>>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)
;for(var hash=FS.hashName(parent.id,name),node=FS.nameTable[hash];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){
var node=new FS.FSNode(parent,name,mode,rdev);return FS.hashAddNode(node),node},destroyNode(node){
FS.hashRemoveNode(node)},isRoot:node=>node===node.parent,isMountpoint:node=>!!node.mounted,
isFile:mode=>32768==(61440&mode),isDir:mode=>16384==(61440&mode),isLink:mode=>40960==(61440&mode),
isChrdev:mode=>8192==(61440&mode),isBlkdev:mode=>24576==(61440&mode),
isFIFO:mode=>4096==(61440&mode),isSocket:mode=>!(49152&~mode),flagsToPermissionString(flag){
var perms=["r","w","rw"][3&flag];return 512&flag&&(perms+="w"),perms},
nodePermissions:(node,perms)=>FS.ignorePermissions||(!perms.includes("r")||292&node.mode)&&(!perms.includes("w")||146&node.mode)&&(!perms.includes("x")||73&node.mode)?0:2,
mayLookup(dir){if(!FS.isDir(dir.mode))return 54;var errCode=FS.nodePermissions(dir,"x")
;return errCode||(dir.node_ops.lookup?0:2)},mayCreate(dir,name){if(!FS.isDir(dir.mode))return 54
;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}
var errCode=FS.nodePermissions(dir,"wx");if(errCode)return errCode;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)=>node?FS.isLink(node.mode)?32:FS.isDir(node.mode)&&("r"!==FS.flagsToPermissionString(flags)||576&flags)?31:FS.nodePermissions(node,FS.flagsToPermissionString(flags)):44,
checkOpExists(op,err){if(!op)throw new FS.ErrnoError(err);return op},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){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream
},getStream:fd=>FS.streams[fd],
createStream:(stream,fd=-1)=>(stream=Object.assign(new FS.FSStream,stream),-1==fd&&(fd=FS.nextfd()),
stream.fd=fd,FS.streams[fd]=stream,stream),closeStream(fd){FS.streams[fd]=null},
dupStream(origStream,fd=-1){var stream=FS.createStream(origStream,fd)
;return stream.stream_ops?.dup?.(stream),stream},doSetAttr(stream,node,attr){
var setattr=stream?.stream_ops.setattr,arg=setattr?stream:node;setattr??=node.node_ops.setattr,
FS.checkOpExists(setattr,63),setattr(arg,attr)},chrdev_stream_ops:{open(stream){
var device=FS.getDevice(stream.node.rdev)
;stream.stream_ops=device.stream_ops,stream.stream_ops.open?.(stream)},llseek(){
throw new FS.ErrnoError(70)}},major:dev=>dev>>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(...m.mounts)}return mounts},syncfs(populate,callback){
"function"==typeof populate&&(callback=populate,populate=!1),FS.syncFSRequests++,
FS.syncFSRequests>1&&err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`)
;var mounts=FS.getMounts(FS.root.mount),completed=0;function doCallback(errCode){
return FS.syncFSRequests--,callback(errCode)}function done(errCode){
if(errCode)return done.errored?void 0:(done.errored=!0,doCallback(errCode))
;++completed>=mounts.length&&doCallback(null)}
for(var mount of mounts)mount.type.syncfs?mount.type.syncfs(mount,populate,done):done(null)},
mount(type,opts,mountpoint){var node,root="/"===mountpoint,pseudo=!mountpoint
;if(root&&FS.root)throw new FS.ErrnoError(10);if(!root&&!pseudo){
var lookup=FS.lookupPath(mountpoint,{follow_mount:!1});if(mountpoint=lookup.path,node=lookup.node,
FS.isMountpoint(node))throw new FS.ErrnoError(10)
;if(!FS.isDir(node.mode))throw new FS.ErrnoError(54)}var mount={type,opts,mountpoint,mounts:[]
},mountRoot=type.mount(mount);return mountRoot.mount=mount,mount.root=mountRoot,
root?FS.root=mountRoot:node&&(node.mounted=mount,node.mount&&node.mount.mounts.push(mount)),
mountRoot},unmount(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:!1})
;if(!FS.isMountpoint(lookup.node))throw new FS.ErrnoError(28)
;var node=lookup.node,mount=node.mounted,mounts=FS.getMounts(mount)
;for(var[hash,current]of Object.entries(FS.nameTable))for(;current;){var next=current.name_next
;mounts.includes(current.mount)&&FS.destroyNode(current),current=next}node.mounted=null
;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},
lookup:(parent,name)=>parent.node_ops.lookup(parent,name),mknod(path,mode,dev){
var parent=FS.lookupPath(path,{parent:!0}).node,name=PATH.basename(path)
;if(!name)throw new FS.ErrnoError(28);if("."===name||".."===name)throw new FS.ErrnoError(20)
;var errCode=FS.mayCreate(parent,name);if(errCode)throw new FS.ErrnoError(errCode)
;if(!parent.node_ops.mknod)throw new FS.ErrnoError(63)
;return parent.node_ops.mknod(parent,name,mode,dev)},statfs:path=>FS.statfsNode(FS.lookupPath(path,{
follow:!0}).node),statfsStream:stream=>FS.statfsNode(stream.node),statfsNode(node){var rtn={
bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:FS.nextInode,ffree:FS.nextInode-1,
fsid:42,flags:2,namelen:255}
;return node.node_ops.statfs&&Object.assign(rtn,node.node_ops.statfs(node.mount.opts.root)),rtn},
create:(path,mode=438)=>(mode&=4095,mode|=32768,FS.mknod(path,mode,0)),
mkdir:(path,mode=511)=>(mode&=1023,mode|=16384,FS.mknod(path,mode,0)),mkdirTree(path,mode){
var dirs=path.split("/"),d="";for(var dir of dirs)if(dir){(d||PATH.isAbs(path))&&(d+="/"),d+=dir
;try{FS.mkdir(d,mode)}catch(e){if(20!=e.errno)throw e}}},
mkdev:(path,mode,dev)=>(void 0===dev&&(dev=mode,mode=438),mode|=8192,FS.mknod(path,mode,dev)),
symlink(oldpath,newpath){if(!PATH_FS.resolve(oldpath))throw new FS.ErrnoError(44)
;var parent=FS.lookupPath(newpath,{parent:!0}).node;if(!parent)throw new FS.ErrnoError(44)
;var newname=PATH.basename(newpath),errCode=FS.mayCreate(parent,newname)
;if(errCode)throw new FS.ErrnoError(errCode);if(!parent.node_ops.symlink)throw new FS.ErrnoError(63)
;return parent.node_ops.symlink(parent,newname,oldpath)},rename(old_path,new_path){
var old_dir,new_dir,old_dirname=PATH.dirname(old_path),new_dirname=PATH.dirname(new_path),old_name=PATH.basename(old_path),new_name=PATH.basename(new_path)
;if(old_dir=FS.lookupPath(old_path,{parent:!0}).node,new_dir=FS.lookupPath(new_path,{parent:!0
}).node,!old_dir||!new_dir)throw new FS.ErrnoError(44)
;if(old_dir.mount!==new_dir.mount)throw new FS.ErrnoError(75)
;var new_node,old_node=FS.lookupNode(old_dir,old_name),relative=PATH_FS.relative(old_path,new_dirname)
;if("."!==relative.charAt(0))throw new FS.ErrnoError(28)
;if("."!==(relative=PATH_FS.relative(new_path,old_dirname)).charAt(0))throw new FS.ErrnoError(55)
;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(old_node!==new_node){
var isdir=FS.isDir(old_node.mode),errCode=FS.mayDelete(old_dir,old_name,isdir)
;if(errCode)throw new FS.ErrnoError(errCode)
;if(errCode=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name))throw new FS.ErrnoError(errCode)
;if(!old_dir.node_ops.rename)throw new FS.ErrnoError(63)
;if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node))throw new FS.ErrnoError(10)
;if(new_dir!==old_dir&&(errCode=FS.nodePermissions(old_dir,"w")))throw new FS.ErrnoError(errCode)
;FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name),
old_node.parent=new_dir}catch(e){throw e}finally{FS.hashAddNode(old_node)}}},rmdir(path){
var parent=FS.lookupPath(path,{parent:!0
}).node,name=PATH.basename(path),node=FS.lookupNode(parent,name),errCode=FS.mayDelete(parent,name,!0)
;if(errCode)throw new FS.ErrnoError(errCode);if(!parent.node_ops.rmdir)throw new FS.ErrnoError(63)
;if(FS.isMountpoint(node))throw new FS.ErrnoError(10);parent.node_ops.rmdir(parent,name),
FS.destroyNode(node)},readdir(path){var node=FS.lookupPath(path,{follow:!0}).node
;return FS.checkOpExists(node.node_ops.readdir,54)(node)},unlink(path){
var parent=FS.lookupPath(path,{parent:!0}).node;if(!parent)throw new FS.ErrnoError(44)
;var name=PATH.basename(path),node=FS.lookupNode(parent,name),errCode=FS.mayDelete(parent,name,!1)
;if(errCode)throw new FS.ErrnoError(errCode);if(!parent.node_ops.unlink)throw new FS.ErrnoError(63)
;if(FS.isMountpoint(node))throw new FS.ErrnoError(10);parent.node_ops.unlink(parent,name),
FS.destroyNode(node)},readlink(path){var link=FS.lookupPath(path).node
;if(!link)throw new FS.ErrnoError(44);if(!link.node_ops.readlink)throw new FS.ErrnoError(28)
;return link.node_ops.readlink(link)},stat(path,dontFollow){var node=FS.lookupPath(path,{
follow:!dontFollow}).node;return FS.checkOpExists(node.node_ops.getattr,63)(node)},fstat(fd){
var stream=FS.getStreamChecked(fd),node=stream.node,getattr=stream.stream_ops.getattr,arg=getattr?stream:node
;return getattr??=node.node_ops.getattr,FS.checkOpExists(getattr,63),getattr(arg)},
lstat:path=>FS.stat(path,!0),doChmod(stream,node,mode,dontFollow){FS.doSetAttr(stream,node,{
mode:4095&mode|-4096&node.mode,ctime:Date.now(),dontFollow})},chmod(path,mode,dontFollow){var node
;"string"==typeof path?node=FS.lookupPath(path,{follow:!dontFollow}).node:node=path
;FS.doChmod(null,node,mode,dontFollow)},lchmod(path,mode){FS.chmod(path,mode,!0)},fchmod(fd,mode){
var stream=FS.getStreamChecked(fd);FS.doChmod(stream,stream.node,mode,!1)},
doChown(stream,node,dontFollow){FS.doSetAttr(stream,node,{timestamp:Date.now(),dontFollow})},
chown(path,uid,gid,dontFollow){var node;"string"==typeof path?node=FS.lookupPath(path,{
follow:!dontFollow}).node:node=path;FS.doChown(null,node,dontFollow)},lchown(path,uid,gid){
FS.chown(path,uid,gid,!0)},fchown(fd,uid,gid){var stream=FS.getStreamChecked(fd)
;FS.doChown(stream,stream.node,!1)},doTruncate(stream,node,len){
if(FS.isDir(node.mode))throw new FS.ErrnoError(31)
;if(!FS.isFile(node.mode))throw new FS.ErrnoError(28);var errCode=FS.nodePermissions(node,"w")
;if(errCode)throw new FS.ErrnoError(errCode);FS.doSetAttr(stream,node,{size:len,timestamp:Date.now()
})},truncate(path,len){if(len<0)throw new FS.ErrnoError(28);var node
;"string"==typeof path?node=FS.lookupPath(path,{follow:!0}).node:node=path
;FS.doTruncate(null,node,len)},ftruncate(fd,len){var stream=FS.getStreamChecked(fd)
;if(len<0||!(2097155&stream.flags))throw new FS.ErrnoError(28);FS.doTruncate(stream,stream.node,len)
},utime(path,atime,mtime){var node=FS.lookupPath(path,{follow:!0}).node
;FS.checkOpExists(node.node_ops.setattr,63)(node,{atime,mtime})},open(path,flags,mode=438){
if(""===path)throw new FS.ErrnoError(44);var node,isDirPath
;if(mode=64&(flags="string"==typeof flags?(str=>{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: ${str}`);return flags
})(flags):flags)?4095&mode|32768:0,"object"==typeof path)node=path;else{isDirPath=path.endsWith("/")
;var lookup=FS.lookupPath(path,{follow:!(131072&flags),noent_okay:!0});node=lookup.node,
path=lookup.path}var created=!1;if(64&flags)if(node){if(128&flags)throw new FS.ErrnoError(20)}else{
if(isDirPath)throw new FS.ErrnoError(31);node=FS.mknod(path,511|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){var errCode=FS.mayOpen(node,flags);if(errCode)throw new FS.ErrnoError(errCode)}
512&flags&&!created&&FS.truncate(node,0),flags&=-131713;var stream=FS.createStream({node,
path:FS.getPath(node),flags,seekable:!0,position:0,stream_ops:node.stream_ops,ungotten:[],error:!1})
;return stream.stream_ops.open&&stream.stream_ops.open(stream),created&&FS.chmod(node,511&mode),
!Module.logReadFiles||1&flags||path in FS.readFiles||(FS.readFiles[path]=1),stream},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=>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
;var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position)
;return seeking||(stream.position+=bytesRead),bytesRead},
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(!(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
;var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn)
;return seeking||(stream.position+=bytesWritten),bytesWritten},
mmap(stream,length,position,prot,flags){
if(2&prot&&!(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)throw new FS.ErrnoError(43);if(!length)throw new FS.ErrnoError(28)
;return stream.stream_ops.mmap(stream,length,position,prot,flags)},
msync:(stream,buffer,offset,length,mmapFlags)=>stream.stream_ops.msync?stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags):0,
ioctl(stream,cmd,arg){if(!stream.stream_ops.ioctl)throw new FS.ErrnoError(59)
;return stream.stream_ops.ioctl(stream,cmd,arg)},readFile(path,opts={}){opts.flags=opts.flags||0,
opts.encoding=opts.encoding||"binary",
"utf8"!==opts.encoding&&"binary"!==opts.encoding&&abort(`Invalid encoding type "${opts.encoding}"`)
;var stream=FS.open(path,opts.flags),length=FS.stat(path).size,buf=new Uint8Array(length)
;return FS.read(stream,buf,0,length,0),"utf8"===opts.encoding&&(buf=UTF8ArrayToString(buf)),
FS.close(stream),buf},writeFile(path,data,opts={}){opts.flags=opts.flags||577
;var stream=FS.open(path,opts.flags,opts.mode)
;"string"==typeof data&&(data=new Uint8Array(intArrayFromString(data,!0))),
ArrayBuffer.isView(data)?FS.write(stream,data,0,data.byteLength,void 0,opts.canOwn):abort("Unsupported data type"),
FS.close(stream)},cwd:()=>FS.currentPath,chdir(path){var lookup=FS.lookupPath(path,{follow:!0})
;if(null===lookup.node)throw new FS.ErrnoError(44)
;if(!FS.isDir(lookup.node.mode))throw new FS.ErrnoError(54)
;var errCode=FS.nodePermissions(lookup.node,"x");if(errCode)throw new FS.ErrnoError(errCode)
;FS.currentPath=lookup.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,llseek:()=>0
}),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&&(randomFill(randomBuffer),
randomLeft=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.stream_ops={
llseek:MEMFS.stream_ops.llseek},node.node_ops={lookup(parent,name){
var fd=+name,stream=FS.getStreamChecked(fd),ret={parent:null,mount:{mountpoint:"fake"},node_ops:{
readlink:()=>stream.path},id:fd+1};return ret.parent=ret,ret},
readdir:()=>Array.from(FS.streams.entries()).filter((([k,v])=>v)).map((([k,v])=>k.toString()))},node
}},{},"/proc/self/fd")},createStandardStreams(input,output,error){
input?FS.createDevice("/dev","stdin",input):FS.symlink("/dev/tty","/dev/stdin"),
output?FS.createDevice("/dev","stdout",null,output):FS.symlink("/dev/tty","/dev/stdout"),
error?FS.createDevice("/dev","stderr",null,error):FS.symlink("/dev/tty1","/dev/stderr")
;FS.open("/dev/stdin",0),FS.open("/dev/stdout",1),FS.open("/dev/stderr",1)},staticInit(){
FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),
FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS}},
init(input,output,error){FS.initialized=!0,input??=Module.stdin,output??=Module.stdout,
error??=Module.stderr,FS.createStandardStreams(input,output,error)},quit(){
for(var stream of(FS.initialized=!1,FS.streams))stream&&FS.close(stream)},
findObject(path,dontResolveLastLink){var ret=FS.analyzePath(path,dontResolveLastLink)
;return ret.exists?ret.object:null},analyzePath(path,dontResolveLastLink){try{
path=(lookup=FS.lookupPath(path,{follow:!dontResolveLastLink})).path}catch(e){}var ret={isRoot:!1,
exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null}
;try{var lookup=FS.lookupPath(path,{parent:!0});ret.parentExists=!0,ret.parentPath=lookup.path,
ret.parentObject=lookup.node,ret.name=PATH.basename(path),lookup=FS.lookupPath(path,{
follow:!dontResolveLastLink}),ret.exists=!0,ret.path=lookup.path,ret.object=lookup.node,
ret.name=lookup.node.name,ret.isRoot="/"===lookup.path}catch(e){ret.error=e.errno}return ret},
createPath(parent,path,canRead,canWrite){parent="string"==typeof parent?parent:FS.getPath(parent)
;for(var parts=path.split("/").reverse();parts.length;){var part=parts.pop();if(part){
var current=PATH.join2(parent,part);try{FS.mkdir(current)}catch(e){if(20!=e.errno)throw e}
parent=current}}return current},createFile(parent,name,properties,canRead,canWrite){
var path=PATH.join2("string"==typeof parent?parent:FS.getPath(parent),name),mode=FS_getMode(canRead,canWrite)
;return FS.create(path,mode)},createDataFile(parent,name,data,canRead,canWrite,canOwn){var path=name
;parent&&(parent="string"==typeof parent?parent:FS.getPath(parent),
path=name?PATH.join2(parent,name):parent)
;var mode=FS_getMode(canRead,canWrite),node=FS.create(path,mode);if(data){if("string"==typeof data){
for(var arr=new Array(data.length),i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr}
FS.chmod(node,146|mode);var stream=FS.open(node,577);FS.write(stream,data,0,data.length,0,canOwn),
FS.close(stream),FS.chmod(node,mode)}},createDevice(parent,name,input,output){
var path=PATH.join2("string"==typeof parent?parent:FS.getPath(parent),name),mode=FS_getMode(!!input,!!output)
;FS.createDevice.major??=64;var dev=FS.makedev(FS.createDevice.major++,0)
;return FS.registerDevice(dev,{open(stream){stream.seekable=!1},close(stream){
output?.buffer?.length&&output(10)},read(stream,buffer,offset,length,pos){
for(var bytesRead=0,i=0;i<length;i++){var result;try{result=input()}catch(e){
throw new FS.ErrnoError(29)}if(void 0===result&&0===bytesRead)throw new FS.ErrnoError(6)
;if(null==result)break;bytesRead++,buffer[offset+i]=result}
return bytesRead&&(stream.node.atime=Date.now()),bytesRead},write(stream,buffer,offset,length,pos){
for(var i=0;i<length;i++)try{output(buffer[offset+i])}catch(e){throw new FS.ErrnoError(29)}
return length&&(stream.node.mtime=stream.node.ctime=Date.now()),i}}),FS.mkdev(path,mode,dev)},
forceLoadFile(obj){if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return!0
;if(globalThis.XMLHttpRequest)abort("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{
obj.contents=undefined(obj.url)}catch(e){throw new FS.ErrnoError(29)}},
createLazyFile(parent,name,url,canRead,canWrite){class LazyUint8Array{lengthKnown=!1;chunks=[]
;get(idx){if(!(idx>this.length-1||idx<0)){
var chunkOffset=idx%this.chunkSize,chunkNum=idx/this.chunkSize|0
;return this.getter(chunkNum)[chunkOffset]}}setDataGetter(getter){this.getter=getter}cacheLength(){
var xhr=new XMLHttpRequest
;xhr.open("HEAD",url,!1),xhr.send(null),xhr.status>=200&&xhr.status<300||304===xhr.status||abort("Couldn't load "+url+". Status: "+xhr.status)
;var header,datalength=Number(xhr.getResponseHeader("Content-length")),hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&"bytes"===header,usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&"gzip"===header,chunkSize=1048576
;hasByteServing||(chunkSize=datalength);var lazyArray=this;lazyArray.setDataGetter((chunkNum=>{
var start=chunkNum*chunkSize,end=(chunkNum+1)*chunkSize-1;return end=Math.min(end,datalength-1),
void 0===lazyArray.chunks[chunkNum]&&(lazyArray.chunks[chunkNum]=((from,to)=>{
from>to&&abort("invalid range ("+from+", "+to+") or no bytes requested!"),
to>datalength-1&&abort("only "+datalength+" bytes available! programmer error!")
;var xhr=new XMLHttpRequest
;return xhr.open("GET",url,!1),datalength!==chunkSize&&xhr.setRequestHeader("Range","bytes="+from+"-"+to),
xhr.responseType="arraybuffer",
xhr.overrideMimeType&&xhr.overrideMimeType("text/plain; charset=x-user-defined"),xhr.send(null),
xhr.status>=200&&xhr.status<300||304===xhr.status||abort("Couldn't load "+url+". Status: "+xhr.status),
void 0!==xhr.response?new Uint8Array(xhr.response||[]):intArrayFromString(xhr.responseText||"",!0)
})(start,end)),
void 0===lazyArray.chunks[chunkNum]&&abort("doXHR failed!"),lazyArray.chunks[chunkNum]})),
!usesGzip&&datalength||(chunkSize=datalength=1,datalength=this.getter(0).length,
chunkSize=datalength,
out("LazyFiles on gzip forces download of the whole file when length is accessed")),
this._length=datalength,this._chunkSize=chunkSize,this.lengthKnown=!0}get length(){
return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){
return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(globalThis.XMLHttpRequest){
abort("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc")
;var properties={isDevice:!1,contents:new LazyUint8Array}}else properties={isDevice:!1,url}
;var node=FS.createFile(parent,name,properties,canRead,canWrite)
;properties.contents?node.contents=properties.contents:properties.url&&(node.contents=null,
node.url=properties.url),Object.defineProperties(node,{usedBytes:{get:function(){
return this.contents.length}}});var stream_ops={}
;for(const[key,fn]of Object.entries(node.stream_ops))stream_ops[key]=(...args)=>(FS.forceLoadFile(node),
fn(...args));function writeChunks(stream,buffer,offset,length,position){
var contents=stream.node.contents;if(position>=contents.length)return 0
;var size=Math.min(contents.length-position,length)
;if(contents.slice)for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i];else for(i=0;i<size;i++)buffer[offset+i]=contents.get(position+i)
;return size}return 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)
;var ptr=mmapAlloc(length);if(!ptr)throw new FS.ErrnoError(48)
;return writeChunks(stream,HEAP8,ptr,length,position),{ptr,allocated:!0}
},node.stream_ops=stream_ops,node}},SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(dirfd,path,allowEmpty){
if(PATH.isAbs(path))return path;var dir
;-100===dirfd?dir=FS.cwd():dir=SYSCALLS.getStreamFromFD(dirfd).path;if(0==path.length){
if(!allowEmpty)throw new FS.ErrnoError(44);return dir}return dir+"/"+path},writeStat(buf,stat){
HEAPU32[buf>>2]=stat.dev,HEAPU32[buf+4>>2]=stat.mode,HEAPU32[buf+8>>2]=stat.nlink,
HEAPU32[buf+12>>2]=stat.uid,HEAPU32[buf+16>>2]=stat.gid,HEAPU32[buf+20>>2]=stat.rdev,
HEAP64[buf+24>>3]=BigInt(stat.size),HEAP32[buf+32>>2]=4096,HEAP32[buf+36>>2]=stat.blocks
;var atime=stat.atime.getTime(),mtime=stat.mtime.getTime(),ctime=stat.ctime.getTime()
;return HEAP64[buf+40>>3]=BigInt(Math.floor(atime/1e3)),HEAPU32[buf+48>>2]=atime%1e3*1e3*1e3,
HEAP64[buf+56>>3]=BigInt(Math.floor(mtime/1e3)),HEAPU32[buf+64>>2]=mtime%1e3*1e3*1e3,
HEAP64[buf+72>>3]=BigInt(Math.floor(ctime/1e3)),HEAPU32[buf+80>>2]=ctime%1e3*1e3*1e3,
HEAP64[buf+88>>3]=BigInt(stat.ino),0},writeStatFs(buf,stats){HEAPU32[buf+4>>2]=stats.bsize,
HEAPU32[buf+60>>2]=stats.bsize,
HEAP64[buf+8>>3]=BigInt(stats.blocks),HEAP64[buf+16>>3]=BigInt(stats.bfree),
HEAP64[buf+24>>3]=BigInt(stats.bavail),
HEAP64[buf+32>>3]=BigInt(stats.files),HEAP64[buf+40>>3]=BigInt(stats.ffree),
HEAPU32[buf+48>>2]=stats.fsid,HEAPU32[buf+64>>2]=stats.flags,HEAPU32[buf+56>>2]=stats.namelen},
doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode))throw new FS.ErrnoError(43)
;if(2&flags)return 0;var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)
},getStreamFromFD:fd=>FS.getStreamChecked(fd),varargs:void 0,getStr:ptr=>UTF8ToString(ptr)}
;var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)
;var getCppExceptionTag=()=>___cpp_exception,getCppExceptionThrownObjectFromWebAssemblyException=ex=>{
var unwind_header=ex.getArg(getCppExceptionTag(),0)
;return ___thrown_object_from_unwind_exception(unwind_header)
},stackAlloc=sz=>__emscripten_stack_alloc(sz),getExceptionMessageCommon=ptr=>{
var sp=_emscripten_stack_get_current(),type_addr_addr=stackAlloc(4),message_addr_addr=stackAlloc(4)
;___get_exception_message(ptr,type_addr_addr,message_addr_addr)
;var message,type_addr=HEAPU32[type_addr_addr>>2],message_addr=HEAPU32[message_addr_addr>>2],type=UTF8ToString(type_addr)
;return _free(type_addr),message_addr&&(message=UTF8ToString(message_addr),_free(message_addr)),
__emscripten_stack_restore(sp),[type,message]},getExceptionMessage=ex=>{
var ptr=getCppExceptionThrownObjectFromWebAssemblyException(ex)
;return getExceptionMessageCommon(ptr)
},createNamedFunction=(name,func)=>Object.defineProperty(func,"name",{value:name
}),emval_freelist=[],emval_handles=[0,1,,1,null,1,!0,1,!1,1],BindingError=class BindingError extends Error{
constructor(message){super(message),this.name="BindingError"}},throwBindingError=message=>{
throw new BindingError(message)
},Emval_toValue=handle=>(handle||throwBindingError(`Cannot use deleted val. handle = ${handle}`),
emval_handles[handle]),Emval_toHandle=value=>{switch(value){case void 0:return 2;case null:return 4
;case!0:return 6;case!1:return 8;default:{const handle=emval_freelist.pop()||emval_handles.length
;return emval_handles[handle]=value,emval_handles[handle+1]=1,handle}}}
;class PureVirtualError extends Error{}var AsciiToString=ptr=>{for(var str="";;){
var ch=HEAPU8[ptr++];if(!ch)return str;str+=String.fromCharCode(ch)}
},registeredInstances={},getBasestPointer=(class_,ptr)=>{
for(void 0===ptr&&throwBindingError("ptr should not be undefined");class_.baseClass;)ptr=class_.upcast(ptr),
class_=class_.baseClass;return ptr},registeredTypes={},getTypeName=type=>{
var ptr=___getTypeName(type),rv=AsciiToString(ptr);return _free(ptr),rv
},requireRegisteredType=(rawType,humanName)=>{var impl=registeredTypes[rawType]
;return void 0===impl&&throwBindingError(`${humanName} has unknown type ${getTypeName(rawType)}`),
impl},detachFinalizer=handle=>{},finalizationRegistry=!1,releaseClassHandle=$$=>{$$.count.value-=1,
0===$$.count.value&&($$=>{
$$.smartPtr?$$.smartPtrType.rawDestructor($$.smartPtr):$$.ptrType.registeredClass.rawDestructor($$.ptr)
})($$)
},attachFinalizer=handle=>globalThis.FinalizationRegistry?(finalizationRegistry=new FinalizationRegistry((info=>{
releaseClassHandle(info.$$)})),attachFinalizer=handle=>{var $$=handle.$$;if(!!$$.smartPtr){
var info={$$};finalizationRegistry.register(handle,info,handle)}return handle
},detachFinalizer=handle=>finalizationRegistry.unregister(handle),
attachFinalizer(handle)):(attachFinalizer=handle=>handle,
handle),structRegistrations={},runDestructors=destructors=>{for(;destructors.length;){
var ptr=destructors.pop();destructors.pop()(ptr)}};function readPointer(pointer){
return this.fromWireType(HEAPU32[pointer>>2])}
var awaitingDependencies={},typeDependencies={},InternalError=class InternalError extends Error{
constructor(message){super(message),this.name="InternalError"}},throwInternalError=message=>{
throw new InternalError(message)
},whenDependentTypesAreResolved=(myTypes,dependentTypes,getTypeConverters)=>{
function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters)
;myTypeConverters.length!==myTypes.length&&throwInternalError("Mismatched type converter count")
;for(var i=0;i<myTypes.length;++i)registerType(myTypes[i],myTypeConverters[i])}
myTypes.forEach((type=>typeDependencies[type]=dependentTypes))
;var typeConverters=new Array(dependentTypes.length),unregisteredTypes=[],registered=0
;for(let[i,dt]of dependentTypes.entries())registeredTypes.hasOwnProperty(dt)?typeConverters[i]=registeredTypes[dt]:(unregisteredTypes.push(dt),
awaitingDependencies.hasOwnProperty(dt)||(awaitingDependencies[dt]=[]),
awaitingDependencies[dt].push((()=>{
typeConverters[i]=registeredTypes[dt],++registered===unregisteredTypes.length&&onComplete(typeConverters)
})));0===unregisteredTypes.length&&onComplete(typeConverters)}
;function registerType(rawType,registeredInstance,options={}){
return function sharedRegisterType(rawType,registeredInstance,options={}){
var name=registeredInstance.name
;if(rawType||throwBindingError(`type "${name}" must have a positive integer typeid pointer`),
registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations)return
;throwBindingError(`Cannot register type '${name}' twice`)}
if(registeredTypes[rawType]=registeredInstance,delete typeDependencies[rawType],
awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType]
;delete awaitingDependencies[rawType],callbacks.forEach((cb=>cb()))}
}(rawType,registeredInstance,options)}var integerReadValueFromPointer=(name,width,signed)=>{
switch(width){case 1:return signed?pointer=>HEAP8[pointer]:pointer=>HEAPU8[pointer];case 2:
return signed?pointer=>HEAP16[pointer>>1]:pointer=>HEAPU16[pointer>>1];case 4:
return signed?pointer=>HEAP32[pointer>>2]:pointer=>HEAPU32[pointer>>2];case 8:
return signed?pointer=>HEAP64[pointer>>3]:pointer=>HEAPU64[pointer>>3];default:
throw new TypeError(`invalid integer width (${width}): ${name}`)}
},throwInstanceAlreadyDeleted=obj=>{throwBindingError(function getInstanceTypeName(handle){
return handle.$$.ptrType.registeredClass.name}(obj)+" instance already deleted")},deletionQueue=[]
;function ClassHandle(){}
var registeredPointers={},ensureOverloadTable=(proto,methodName,humanName)=>{
if(void 0===proto[methodName].overloadTable){var prevFunc=proto[methodName]
;proto[methodName]=function(...args){
return proto[methodName].overloadTable.hasOwnProperty(args.length)||throwBindingError(`Function '${humanName}' called with an invalid number of arguments (${args.length}) - expects one of (${proto[methodName].overloadTable})!`),
proto[methodName].overloadTable[args.length].apply(this,args)},proto[methodName].overloadTable=[],
proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}
;function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){
this.name=name,this.constructor=constructor,this.instancePrototype=instancePrototype,
this.rawDestructor=rawDestructor,this.baseClass=baseClass,this.getActualType=getActualType,
this.upcast=upcast,this.downcast=downcast,this.pureVirtualFunctions=[]}
var upcastPointer=(ptr,ptrClass,desiredClass)=>{
for(;ptrClass!==desiredClass;)ptrClass.upcast||throwBindingError(`Expected null or instance of ${desiredClass.name}, got an instance of ${ptrClass.name}`),
ptr=ptrClass.upcast(ptr),ptrClass=ptrClass.baseClass;return ptr},embindRepr=v=>{
if(null===v)return"null";var t=typeof v
;return"object"===t||"array"===t||"function"===t?v.toString():""+v}
;function constNoSmartPtrRawPointerToWireType(destructors,handle){
if(null===handle)return this.isReference&&throwBindingError(`null is not a valid ${this.name}`),0
;handle.$$||throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`),
handle.$$.ptr||throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)
;var handleClass=handle.$$.ptrType.registeredClass
;return upcastPointer(handle.$$.ptr,handleClass,this.registeredClass)}
function genericPointerToWireType(destructors,handle){var ptr
;if(null===handle)return this.isReference&&throwBindingError(`null is not a valid ${this.name}`),
this.isSmartPointer?(ptr=this.rawConstructor(),
null!==destructors&&destructors.push(this.rawDestructor,ptr),ptr):0
;handle&&handle.$$||throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`),
handle.$$.ptr||throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`),
!this.isConst&&handle.$$.ptrType.isConst&&throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)
;var handleClass=handle.$$.ptrType.registeredClass
;if(ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass),
this.isSmartPointer)switch(void 0===handle.$$.smartPtr&&throwBindingError("Passing raw pointer to smart pointer is illegal"),
this.sharingPolicy){case 0:
handle.$$.smartPtrType===this?ptr=handle.$$.smartPtr:throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)
;break;case 1:ptr=handle.$$.smartPtr;break;case 2:
if(handle.$$.smartPtrType===this)ptr=handle.$$.smartPtr;else{var clonedHandle=handle.clone()
;ptr=this.rawShare(ptr,Emval_toHandle((()=>clonedHandle.delete()))),
null!==destructors&&destructors.push(this.rawDestructor,ptr)}break;default:
throwBindingError("Unsupporting sharing policy")}return ptr}
function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){
if(null===handle)return this.isReference&&throwBindingError(`null is not a valid ${this.name}`),0
;handle.$$||throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`),
handle.$$.ptr||throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`),
handle.$$.ptrType.isConst&&throwBindingError(`Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}`)
;var handleClass=handle.$$.ptrType.registeredClass
;return upcastPointer(handle.$$.ptr,handleClass,this.registeredClass)}
var downcastPointer=(ptr,ptrClass,desiredClass)=>{if(ptrClass===desiredClass)return ptr
;if(void 0===desiredClass.baseClass)return null
;var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass)
;return null===rv?null:desiredClass.downcast(rv)
},makeClassHandle=(prototype,record)=>(record.ptrType&&record.ptr||throwInternalError("makeClassHandle requires ptr and ptrType"),
!!record.smartPtrType!==!!record.smartPtr&&throwInternalError("Both smartPtrType and smartPtr must be specified"),
record.count={value:1},attachFinalizer(Object.create(prototype,{$$:{value:record,writable:!0}})))
;function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr)
;if(!rawPointer)return this.destructor(ptr),null
;var registeredInstance=((class_,ptr)=>(ptr=getBasestPointer(class_,ptr),
registeredInstances[ptr]))(this.registeredClass,rawPointer);if(void 0!==registeredInstance){
if(0===registeredInstance.$$.count.value)return registeredInstance.$$.ptr=rawPointer,
registeredInstance.$$.smartPtr=ptr,registeredInstance.clone();var rv=registeredInstance.clone()
;return this.destructor(ptr),rv}function makeDefaultHandle(){
return this.isSmartPointer?makeClassHandle(this.registeredClass.instancePrototype,{
ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr
}):makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr})}
var toType,actualType=this.registeredClass.getActualType(rawPointer),registeredPointerRecord=registeredPointers[actualType]
;if(!registeredPointerRecord)return makeDefaultHandle.call(this)
;toType=this.isConst?registeredPointerRecord.constPointerType:registeredPointerRecord.pointerType
;var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass)
;return null===dp?makeDefaultHandle.call(this):this.isSmartPointer?makeClassHandle(toType.registeredClass.instancePrototype,{
ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr
}):makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}
function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){
this.name=name,this.registeredClass=registeredClass,this.isReference=isReference,
this.isConst=isConst,this.isSmartPointer=isSmartPointer,this.pointeeType=pointeeType,
this.sharingPolicy=sharingPolicy,
this.rawGetPointee=rawGetPointee,this.rawConstructor=rawConstructor,this.rawShare=rawShare,
this.rawDestructor=rawDestructor,
isSmartPointer||void 0!==registeredClass.baseClass?this.toWireType=genericPointerToWireType:isConst?(this.toWireType=constNoSmartPtrRawPointerToWireType,
this.destructorFunction=null):(this.toWireType=nonConstNoSmartPtrRawPointerToWireType,
this.destructorFunction=null)}var embind__requireFunction=(signature,rawFunction,isAsync=!1)=>{
signature=AsciiToString(signature);var fp=function makeDynCaller(){var funcPtr
;return funcPtr=rawFunction,wasmTable.get(funcPtr)}()
;return"function"!=typeof fp&&throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`),
fp};class UnboundTypeError extends Error{}var throwUnboundTypeError=(message,types)=>{
var unboundTypes=[],seen={};throw types.forEach((function visit(type){
seen[type]||registeredTypes[type]||(typeDependencies[type]?typeDependencies[type].forEach(visit):(unboundTypes.push(type),
seen[type]=!0))})),new UnboundTypeError(`${message}: `+unboundTypes.map(getTypeName).join([", "]))}
;function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFunc,cppTargetFunc,isAsync){
var argCount=argTypes.length
;argCount<2&&throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!")
;var isClassMethodFunc=null!==argTypes[1]&&null!==classType,needsDestructorStack=function usesDestructorStack(argTypes){
for(var i=1;i<argTypes.length;++i)if(null!==argTypes[i]&&void 0===argTypes[i].destructorFunction)return!0
;return!1
}(argTypes),returns=!argTypes[0].isVoid,expectedArgCount=argCount-2,argsWired=new Array(expectedArgCount),invokerFuncArgs=[],destructors=[]
;return createNamedFunction(humanName,(function(...args){var thisWired;destructors.length=0,
invokerFuncArgs.length=isClassMethodFunc?2:1,
invokerFuncArgs[0]=cppTargetFunc,isClassMethodFunc&&(thisWired=argTypes[1].toWireType(destructors,this),
invokerFuncArgs[1]=thisWired)
;for(var i=0;i<expectedArgCount;++i)argsWired[i]=argTypes[i+2].toWireType(destructors,args[i]),
invokerFuncArgs.push(argsWired[i]);return function onDone(rv){
if(needsDestructorStack)runDestructors(destructors);else for(var i=isClassMethodFunc?1:2;i<argTypes.length;i++){
var param=1===i?thisWired:argsWired[i-2]
;null!==argTypes[i].destructorFunction&&argTypes[i].destructorFunction(param)}
if(returns)return argTypes[0].fromWireType(rv)}(cppInvokerFunc(...invokerFuncArgs))}))}
var heap32VectorToArray=(count,firstElement)=>{
for(var array=[],i=0;i<count;i++)array.push(HEAPU32[firstElement+4*i>>2]);return array
},getFunctionName=signature=>{const argsIndex=(signature=signature.trim()).indexOf("(")
;return-1===argsIndex?signature:signature.slice(0,argsIndex)},__emval_decref=handle=>{
handle>9&&0==--emval_handles[handle+1]&&(emval_handles[handle]=void 0,emval_freelist.push(handle))
},EmValType={name:"emscripten::val",fromWireType:handle=>{var rv=Emval_toValue(handle)
;return __emval_decref(handle),rv},toWireType:(destructors,value)=>Emval_toHandle(value),
readValueFromPointer:readPointer,destructorFunction:null},floatReadValueFromPointer=(name,width)=>{
switch(width){case 4:return function(pointer){return this.fromWireType(HEAPF32[pointer>>2])};case 8:
return function(pointer){return this.fromWireType(HEAPF64[pointer>>3])};default:
throw new TypeError(`invalid float width (${width}): ${name}`)}},EmValOptionalType=Object.assign({
optional:!0
},EmValType),UTF16Decoder=new TextDecoder("utf-16le"),UTF16ToString=(ptr,maxBytesToRead,ignoreNul)=>{
var idx=ptr>>1,endIdx=findStringEnd(HEAPU16,idx,maxBytesToRead/2,ignoreNul)
;return UTF16Decoder.decode(HEAPU16.subarray(idx,endIdx))
},stringToUTF16=(str,outPtr,maxBytesToWrite)=>{
if(maxBytesToWrite??=2147483647,maxBytesToWrite<2)return 0
;for(var startPtr=outPtr,numCharsToWrite=(maxBytesToWrite-=2)<2*str.length?maxBytesToWrite/2:str.length,i=0;i<numCharsToWrite;++i){
var codeUnit=str.charCodeAt(i);HEAP16[outPtr>>1]=codeUnit,outPtr+=2}return HEAP16[outPtr>>1]=0,
outPtr-startPtr},lengthBytesUTF16=str=>2*str.length,UTF32ToString=(ptr,maxBytesToRead,ignoreNul)=>{
for(var str="",startIdx=ptr>>2,i=0;!(i>=maxBytesToRead/4);i++){var utf32=HEAPU32[startIdx+i]
;if(!utf32&&!ignoreNul)break;str+=String.fromCodePoint(utf32)}return str
},stringToUTF32=(str,outPtr,maxBytesToWrite)=>{
if(maxBytesToWrite??=2147483647,maxBytesToWrite<4)return 0
;for(var startPtr=outPtr,endPtr=startPtr+maxBytesToWrite-4,i=0;i<str.length;++i){
var codePoint=str.codePointAt(i);if(codePoint>65535&&i++,HEAP32[outPtr>>2]=codePoint,
(outPtr+=4)+4>endPtr)break}return HEAP32[outPtr>>2]=0,outPtr-startPtr},lengthBytesUTF32=str=>{
for(var len=0,i=0;i<str.length;++i){str.codePointAt(i)>65535&&i++,len+=4}return len
},emval_methodCallers=[],emval_symbols={},getStringOrSymbol=address=>{
var symbol=emval_symbols[address];return void 0===symbol?AsciiToString(address):symbol
},__emval_invoke=(caller,handle,methodName,destructorsRef,args)=>emval_methodCallers[caller](handle,methodName,destructorsRef,args),bigintToI53Checked=num=>num<-9007199254740992||num>9007199254740992?NaN:Number(num)
;var _emscripten_date_now=()=>Date.now();var growMemory=size=>{
var pages=(size-wasmMemory.buffer.byteLength+65535)/65536|0;try{return wasmMemory.grow(pages),
updateMemoryViews(),1}catch(e){}},ENV={},getEnvStrings=()=>{if(!getEnvStrings.strings){var env={
USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",
LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:thisProgram||"./this.program"
};for(var x in ENV)void 0===ENV[x]?delete env[x]:env[x]=ENV[x];var strings=[]
;for(var x in env)strings.push(`${x}=${env[x]}`);getEnvStrings.strings=strings}
return getEnvStrings.strings}
;var _malloc,_main,___getTypeName,_free,_emscripten_builtin_memalign,___trap,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,___cxa_decrement_exception_refcount,___cxa_increment_exception_refcount,___thrown_object_from_unwind_exception,___get_exception_message,___cpp_exception,wasmMemory,wasmTable,_proc_exit=code=>{
EXITSTATUS=code,noExitRuntime||(Module.onExit?.(code),ABORT=!0),quit_(0,new ExitStatus(code))}
;if(FS.createPreloadedFile=(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish)=>{
FS_preloadFile(parent,name,url,canRead,canWrite,dontCreateFile,canOwn,preFinish).then(onload).catch(onerror)
},FS.preloadFile=FS_preloadFile,FS.staticInit(),(()=>{let proto=ClassHandle.prototype
;Object.assign(proto,{isAliasOf(other){if(!(this instanceof ClassHandle))return!1
;if(!(other instanceof ClassHandle))return!1
;var leftClass=this.$$.ptrType.registeredClass,left=this.$$.ptr;other.$$=other.$$
;for(var rightClass=other.$$.ptrType.registeredClass,right=other.$$.ptr;leftClass.baseClass;)left=leftClass.upcast(left),
leftClass=leftClass.baseClass;for(;rightClass.baseClass;)right=rightClass.upcast(right),
rightClass=rightClass.baseClass;return leftClass===rightClass&&left===right},clone(){
if(this.$$.ptr||throwInstanceAlreadyDeleted(this),
this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this
;var o,clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:(o=this.$$,{
count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,
ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType})}}))
;return clone.$$.count.value+=1,clone.$$.deleteScheduled=!1,clone},delete(){
this.$$.ptr||throwInstanceAlreadyDeleted(this),
this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&throwBindingError("Object already scheduled for deletion"),
detachFinalizer(this),
releaseClassHandle(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,
this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){
return this.$$.ptr||throwInstanceAlreadyDeleted(this),
this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&throwBindingError("Object already scheduled for deletion"),
deletionQueue.push(this),deletionQueue.length,this.$$.deleteScheduled=!0,this}})
;const symbolDispose=Symbol.dispose;symbolDispose&&(proto[symbolDispose]=proto.delete)})(),
Object.assign(RegisteredPointer.prototype,{getPointee(ptr){
return this.rawGetPointee&&(ptr=this.rawGetPointee(ptr)),ptr},destructor(ptr){
this.rawDestructor?.(ptr)},readValueFromPointer:readPointer,
fromWireType:RegisteredPointer_fromWireType
}),Module.noExitRuntime&&(noExitRuntime=Module.noExitRuntime),
Module.preloadPlugins&&(preloadPlugins=Module.preloadPlugins),Module.print&&(out=Module.print),
Module.printErr&&(err=Module.printErr),Module.wasmBinary&&(wasmBinary=Module.wasmBinary),
Module.arguments&&Module.arguments,Module.thisProgram&&(thisProgram=Module.thisProgram),
Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.shift()()
;Module.getExceptionMessage=getExceptionMessage,Module.incrementExceptionRefcount=ex=>{
var ptr=getCppExceptionThrownObjectFromWebAssemblyException(ex)
;___cxa_increment_exception_refcount(ptr)},Module.decrementExceptionRefcount=ex=>{
var ptr=getCppExceptionThrownObjectFromWebAssemblyException(ex)
;___cxa_decrement_exception_refcount(ptr)};var wasmExports,wasmImports={
q:(condition,filename,line,func)=>abort(`Assertion failed: ${UTF8ToString(condition)}, at: `+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"]),
C:function ___syscall_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{
var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:if((arg=syscallGetVarargI())<0)return-28
;for(;FS.streams[arg];)arg++;return FS.dupStream(stream,arg).fd;case 1:case 2:case 13:case 14:
return 0;case 3:return stream.flags;case 4:var arg=syscallGetVarargI();return stream.flags|=arg,0
;case 12:arg=syscallGetVarargP();return HEAP16[arg+0>>1]=2,0}return-28}catch(e){
if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},
ba:function ___syscall_fstat64(fd,buf){try{return SYSCALLS.writeStat(buf,FS.fstat(fd))}catch(e){
if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},
aa:function ___syscall_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd)
;stream.getdents||=FS.readdir(stream.path)
;for(var pos=0,off=FS.llseek(stream,0,1),startIdx=Math.floor(off/280),endIdx=Math.min(stream.getdents.length,startIdx+Math.floor(count/280)),idx=startIdx;idx<endIdx;idx++){
var id,type,name=stream.getdents[idx];if("."===name)id=stream.node.id,type=4;else if(".."===name){
id=FS.lookupPath(stream.path,{parent:!0}).node.id,type=4}else{var child;try{
child=FS.lookupNode(stream.node,name)}catch(e){if(28===e?.errno)continue;throw e}id=child.id,
type=FS.isChrdev(child.mode)?2:FS.isDir(child.mode)?4:FS.isLink(child.mode)?10:8}
HEAP64[dirp+pos>>3]=BigInt(id),HEAP64[dirp+pos+8>>3]=BigInt(280*(idx+1)),HEAP16[dirp+pos+16>>1]=280,
HEAP8[dirp+pos+18]=type,stringToUTF8(name,dirp+pos+19,256),pos+=280}
return FS.llseek(stream,280*idx,0),pos}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e
;return-e.errno}},p:function ___syscall_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{
var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21510:case 21511:case 21512:
case 21524:case 21515:return stream.tty?0:-59;case 21505:if(!stream.tty)return-59
;if(stream.tty.ops.ioctl_tcgets){
var termios=stream.tty.ops.ioctl_tcgets(stream),argp=syscallGetVarargP()
;HEAP32[argp>>2]=termios.c_iflag||0,
HEAP32[argp+4>>2]=termios.c_oflag||0,HEAP32[argp+8>>2]=termios.c_cflag||0,
HEAP32[argp+12>>2]=termios.c_lflag||0;for(var i=0;i<32;i++)HEAP8[argp+i+17]=termios.c_cc[i]||0
;return 0}return 0;case 21506:case 21507:case 21508:if(!stream.tty)return-59
;if(stream.tty.ops.ioctl_tcsets){argp=syscallGetVarargP()
;var c_iflag=HEAP32[argp>>2],c_oflag=HEAP32[argp+4>>2],c_cflag=HEAP32[argp+8>>2],c_lflag=HEAP32[argp+12>>2],c_cc=[]
;for(i=0;i<32;i++)c_cc.push(HEAP8[argp+i+17]);return stream.tty.ops.ioctl_tcsets(stream.tty,op,{
c_iflag,c_oflag,c_cflag,c_lflag,c_cc})}return 0;case 21519:if(!stream.tty)return-59
;argp=syscallGetVarargP();return HEAP32[argp>>2]=0,0;case 21520:return stream.tty?-28:-59
;case 21537:case 21531:argp=syscallGetVarargP();return FS.ioctl(stream,op,argp);case 21523:
if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tiocgwinsz){
var winsize=stream.tty.ops.ioctl_tiocgwinsz(stream.tty);argp=syscallGetVarargP()
;HEAP16[argp>>1]=winsize[0],HEAP16[argp+2>>1]=winsize[1]}return 0;default:return-28}}catch(e){
if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},
$:function ___syscall_lstat64(path,buf){try{
return path=SYSCALLS.getStr(path),SYSCALLS.writeStat(buf,FS.lstat(path))}catch(e){
if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},
_:function ___syscall_newfstatat(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.writeStat(buf,nofollow?FS.lstat(path):FS.stat(path))}catch(e){
if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},
B:function ___syscall_openat(dirfd,path,flags,varargs){SYSCALLS.varargs=varargs;try{
path=SYSCALLS.getStr(path),path=SYSCALLS.calculateAt(dirfd,path)
;var mode=varargs?syscallGetVarargI():0;return FS.open(path,flags,mode).fd}catch(e){
if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},
Z:function ___syscall_stat64(path,buf){try{
return path=SYSCALLS.getStr(path),SYSCALLS.writeStat(buf,FS.stat(path))}catch(e){
if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},o:ex=>{
var e=new WebAssembly.Exception(getCppExceptionTag(),[ex],{traceStack:!0})
;throw e.message=getExceptionMessage(e),e},T:()=>abort(""),
S:(constructorName,wrapperType,properties)=>{constructorName=AsciiToString(constructorName),
wrapperType=requireRegisteredType(wrapperType,"wrapper"),properties=Emval_toValue(properties)
;var registeredClass=wrapperType.registeredClass,wrapperPrototype=registeredClass.instancePrototype,baseClassPrototype=registeredClass.baseClass.instancePrototype,baseConstructor=registeredClass.baseClass.constructor,ctor=createNamedFunction(constructorName,(function(...args){
for(var name of registeredClass.baseClass.pureVirtualFunctions)if(this[name]===baseClassPrototype[name])throw new PureVirtualError(`Pure virtual function ${name} must be implemented in JavaScript`)
;Object.defineProperty(this,"__parent",{value:wrapperPrototype}),this.__construct(...args)}))
;return wrapperPrototype.__construct=function __construct(...args){
this===wrapperPrototype&&throwBindingError("Pass correct 'this' to __construct")
;var inner=baseConstructor.implement(this,...args);detachFinalizer(inner)
;var class_,ptr,instance,$$=inner.$$;inner.notifyOnDestruction(),$$.preservePointerOnDelete=!0,
Object.defineProperties(this,{$$:{value:$$}}),attachFinalizer(this),class_=registeredClass,
ptr=$$.ptr,
instance=this,ptr=getBasestPointer(class_,ptr),registeredInstances.hasOwnProperty(ptr)?throwBindingError(`Tried to register registered instance: ${ptr}`):registeredInstances[ptr]=instance
},wrapperPrototype.__destruct=function __destruct(){var class_,ptr
;this===wrapperPrototype&&throwBindingError("Pass correct 'this' to __destruct"),
detachFinalizer(this),class_=registeredClass,ptr=this.$$.ptr,ptr=getBasestPointer(class_,ptr),
registeredInstances.hasOwnProperty(ptr)?delete registeredInstances[ptr]:throwBindingError(`Tried to unregister unregistered instance: ${ptr}`)
},ctor.prototype=Object.create(wrapperPrototype),Object.assign(ctor.prototype,properties),
Emval_toHandle(ctor)},R:structType=>{var reg=structRegistrations[structType]
;delete structRegistrations[structType]
;var rawConstructor=reg.rawConstructor,rawDestructor=reg.rawDestructor,fieldRecords=reg.fields,fieldTypes=fieldRecords.map((field=>field.getterReturnType)).concat(fieldRecords.map((field=>field.setterArgumentType)))
;whenDependentTypesAreResolved([structType],fieldTypes,(fieldTypes=>{var fields={}
;for(var[i,field]of fieldRecords.entries()){
const getterReturnType=fieldTypes[i],getter=field.getter,getterContext=field.getterContext,setterArgumentType=fieldTypes[i+fieldRecords.length],setter=field.setter,setterContext=field.setterContext
;fields[field.fieldName]={read:ptr=>getterReturnType.fromWireType(getter(getterContext,ptr)),
write:(ptr,o)=>{var destructors=[]
;setter(setterContext,ptr,setterArgumentType.toWireType(destructors,o)),runDestructors(destructors)
},optional:getterReturnType.optional}}return[{name:reg.name,fromWireType:ptr=>{var rv={}
;for(var i in fields)rv[i]=fields[i].read(ptr);return rawDestructor(ptr),rv},
toWireType:(destructors,o)=>{
for(var fieldName in fields)if(!(fieldName in o)&&!fields[fieldName].optional)throw new TypeError(`Missing field: "${fieldName}"`)
;var ptr=rawConstructor();for(fieldName in fields)fields[fieldName].write(ptr,o[fieldName])
;return null!==destructors&&destructors.push(rawDestructor,ptr),ptr},
readValueFromPointer:readPointer,destructorFunction:rawDestructor}]}))},
y:(primitiveType,name,size,minRange,maxRange)=>{name=AsciiToString(name)
;const isUnsignedType=0n===minRange;let fromWireType=value=>value;if(isUnsignedType){
const bitSize=8*size
;fromWireType=value=>BigInt.asUintN(bitSize,value),maxRange=fromWireType(maxRange)}
registerType(primitiveType,{name,fromWireType,
toWireType:(destructors,value)=>("number"==typeof value&&(value=BigInt(value)),value),
readValueFromPointer:integerReadValueFromPointer(name,size,!isUnsignedType),destructorFunction:null
})},Q:(rawType,name,trueValue,falseValue)=>{registerType(rawType,{name:name=AsciiToString(name),
fromWireType:function(wt){return!!wt},toWireType:function(destructors,o){
return o?trueValue:falseValue},readValueFromPointer:function(pointer){
return this.fromWireType(HEAPU8[pointer])},destructorFunction:null})},
g:(rawType,rawPointerType,rawConstPointerType,baseClassRawType,getActualTypeSignature,getActualType,upcastSignature,upcast,downcastSignature,downcast,name,destructorSignature,rawDestructor)=>{
name=AsciiToString(name),
getActualType=embind__requireFunction(getActualTypeSignature,getActualType),
upcast&&=embind__requireFunction(upcastSignature,upcast),
downcast&&=embind__requireFunction(downcastSignature,downcast),
rawDestructor=embind__requireFunction(destructorSignature,rawDestructor)
;var legalFunctionName=(name=>{var f=(name=name.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0)
;return f>=48&&f<=57?`_${name}`:name})(name);((name,value,numArguments)=>{
Module.hasOwnProperty(name)?((void 0===numArguments||void 0!==Module[name].overloadTable&&void 0!==Module[name].overloadTable[numArguments])&&throwBindingError(`Cannot register public name '${name}' twice`),
ensureOverloadTable(Module,name,name),
Module[name].overloadTable.hasOwnProperty(numArguments)&&throwBindingError(`Cannot register multiple overloads of a function with the same number of arguments (${numArguments})!`),
Module[name].overloadTable[numArguments]=value):(Module[name]=value,
Module[name].argCount=numArguments)})(legalFunctionName,(function(){
throwUnboundTypeError(`Cannot construct ${name} due to unbound types`,[baseClassRawType])})),
whenDependentTypesAreResolved([rawType,rawPointerType,rawConstPointerType],baseClassRawType?[baseClassRawType]:[],(base=>{
var baseClass,basePrototype
;base=base[0],basePrototype=baseClassRawType?(baseClass=base.registeredClass).instancePrototype:ClassHandle.prototype
;var constructor=createNamedFunction(name,(function(...args){
if(Object.getPrototypeOf(this)!==instancePrototype)throw new BindingError(`Use 'new' to construct ${name}`)
;if(void 0===registeredClass.constructor_body)throw new BindingError(`${name} has no accessible constructor`)
;var body=registeredClass.constructor_body[args.length]
;if(void 0===body)throw new BindingError(`Tried to invoke ctor of ${name} with invalid number of parameters (${args.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`)
;return body.apply(this,args)})),instancePrototype=Object.create(basePrototype,{constructor:{
value:constructor}});constructor.prototype=instancePrototype
;var registeredClass=new RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast)
;registeredClass.baseClass&&(registeredClass.baseClass.__derivedClasses??=[],
registeredClass.baseClass.__derivedClasses.push(registeredClass))
;var referenceConverter=new RegisteredPointer(name,registeredClass,!0,!1,!1),pointerConverter=new RegisteredPointer(name+"*",registeredClass,!1,!1,!1),constPointerConverter=new RegisteredPointer(name+" const*",registeredClass,!1,!0,!1)
;return registeredPointers[rawType]={pointerType:pointerConverter,
constPointerType:constPointerConverter},((name,value,numArguments)=>{
Module.hasOwnProperty(name)||throwInternalError("Replacing nonexistent public symbol"),
void 0!==Module[name].overloadTable&&void 0!==numArguments?Module[name].overloadTable[numArguments]=value:(Module[name]=value,
Module[name].argCount=numArguments)
})(legalFunctionName,constructor),[referenceConverter,pointerConverter,constPointerConverter]}))},
x:(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,fn,isAsync,isNonnullReturn)=>{
var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=AsciiToString(methodName),
methodName=getFunctionName(methodName),
rawInvoker=embind__requireFunction(invokerSignature,rawInvoker,isAsync),
whenDependentTypesAreResolved([],[rawClassType],(classType=>{
var humanName=`${(classType=classType[0]).name}.${methodName}`;function unboundTypesHandler(){
throwUnboundTypeError(`Cannot call ${humanName} due to unbound types`,rawArgTypes)}
methodName.startsWith("@@")&&(methodName=Symbol[methodName.substring(2)])
;var proto=classType.registeredClass.constructor
;return void 0===proto[methodName]?(unboundTypesHandler.argCount=argCount-1,
proto[methodName]=unboundTypesHandler):(ensureOverloadTable(proto,methodName,humanName),
proto[methodName].overloadTable[argCount-1]=unboundTypesHandler),
whenDependentTypesAreResolved([],rawArgTypes,(argTypes=>{
var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1)),func=craftInvokerFunction(humanName,invokerArgsArray,null,rawInvoker,fn)
;if(void 0===proto[methodName].overloadTable?(func.argCount=argCount-1,
proto[methodName]=func):proto[methodName].overloadTable[argCount-1]=func,
classType.registeredClass.__derivedClasses)for(const derivedClass of classType.registeredClass.__derivedClasses)derivedClass.constructor.hasOwnProperty(methodName)||(derivedClass.constructor[methodName]=func)
;return[]})),[]}))},
k:(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor)=>{
var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr)
;invoker=embind__requireFunction(invokerSignature,invoker),
whenDependentTypesAreResolved([],[rawClassType],(classType=>{
var humanName=`constructor ${(classType=classType[0]).name}`
;if(void 0===classType.registeredClass.constructor_body&&(classType.registeredClass.constructor_body=[]),
void 0!==classType.registeredClass.constructor_body[argCount-1])throw new BindingError(`Cannot register multiple constructors with identical number of parameters (${argCount-1}) for class '${classType.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`)
;return classType.registeredClass.constructor_body[argCount-1]=()=>{
throwUnboundTypeError(`Cannot construct ${classType.name} due to unbound types`,rawArgTypes)},
whenDependentTypesAreResolved([],rawArgTypes,(argTypes=>(argTypes.splice(1,0,null),
classType.registeredClass.constructor_body[argCount-1]=craftInvokerFunction(humanName,argTypes,null,invoker,rawConstructor),
[]))),[]}))},
a:(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,context,isPureVirtual,isAsync,isNonnullReturn)=>{
var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=AsciiToString(methodName),
methodName=getFunctionName(methodName),
rawInvoker=embind__requireFunction(invokerSignature,rawInvoker,isAsync),
whenDependentTypesAreResolved([],[rawClassType],(classType=>{
var humanName=`${(classType=classType[0]).name}.${methodName}`;function unboundTypesHandler(){
throwUnboundTypeError(`Cannot call ${humanName} due to unbound types`,rawArgTypes)}
methodName.startsWith("@@")&&(methodName=Symbol[methodName.substring(2)]),
isPureVirtual&&classType.registeredClass.pureVirtualFunctions.push(methodName)
;var proto=classType.registeredClass.instancePrototype,method=proto[methodName]
;return void 0===method||void 0===method.overloadTable&&method.className!==classType.name&&method.argCount===argCount-2?(unboundTypesHandler.argCount=argCount-2,
unboundTypesHandler.className=classType.name,
proto[methodName]=unboundTypesHandler):(ensureOverloadTable(proto,methodName,humanName),
proto[methodName].overloadTable[argCount-2]=unboundTypesHandler),
whenDependentTypesAreResolved([],rawArgTypes,(argTypes=>{
var memberFunction=craftInvokerFunction(humanName,argTypes,classType,rawInvoker,context)
;return void 0===proto[methodName].overloadTable?(memberFunction.argCount=argCount-2,
proto[methodName]=memberFunction):proto[methodName].overloadTable[argCount-2]=memberFunction,[]})),
[]}))},P:rawType=>registerType(rawType,EmValType),w:(rawType,name,size)=>{registerType(rawType,{
name:name=AsciiToString(name),fromWireType:value=>value,toWireType:(destructors,value)=>value,
readValueFromPointer:floatReadValueFromPointer(name,size),destructorFunction:null})},
j:(primitiveType,name,size,minRange,maxRange)=>{name=AsciiToString(name)
;let fromWireType=value=>value;if(0===minRange){var bitshift=32-8*size
;fromWireType=value=>value<<bitshift>>>bitshift,maxRange=fromWireType(maxRange)}
registerType(primitiveType,{name,fromWireType,toWireType:(destructors,value)=>value,
readValueFromPointer:integerReadValueFromPointer(name,size,0!==minRange),destructorFunction:null})},
d:(rawType,dataTypeIndex,name)=>{
var TA=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][dataTypeIndex]
;function decodeMemoryView(handle){var size=HEAPU32[handle>>2],data=HEAPU32[handle+4>>2]
;return new TA(HEAP8.buffer,data,size)}registerType(rawType,{name:name=AsciiToString(name),
fromWireType:decodeMemoryView,readValueFromPointer:decodeMemoryView},{
ignoreDuplicateRegistrations:!0})},h:(rawOptionalType,rawType)=>{
registerType(rawOptionalType,EmValOptionalType)},
v:(rawType,rawPointeeType,name,sharingPolicy,getPointeeSignature,rawGetPointee,constructorSignature,rawConstructor,shareSignature,rawShare,destructorSignature,rawDestructor)=>{
name=AsciiToString(name),rawGetPointee=embind__requireFunction(getPointeeSignature,rawGetPointee),
rawConstructor=embind__requireFunction(constructorSignature,rawConstructor),
rawShare=embind__requireFunction(shareSignature,rawShare),
rawDestructor=embind__requireFunction(destructorSignature,rawDestructor),
whenDependentTypesAreResolved([rawType],[rawPointeeType],(pointeeType=>(pointeeType=pointeeType[0],
[new RegisteredPointer(name,pointeeType.registeredClass,!1,!1,!0,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor)])))
},O:(rawType,name)=>{name=AsciiToString(name);registerType(rawType,{name,fromWireType(value){
var str,length=HEAPU32[value>>2],payload=value+4;return str=UTF8ToString(payload,length,!0),
_free(value),str},toWireType(destructors,value){var length
;value instanceof ArrayBuffer&&(value=new Uint8Array(value))
;var valueIsOfTypeString="string"==typeof value
;valueIsOfTypeString||ArrayBuffer.isView(value)&&1==value.BYTES_PER_ELEMENT||throwBindingError("Cannot pass non-string to std::string"),
length=valueIsOfTypeString?lengthBytesUTF8(value):value.length
;var base=_malloc(4+length+1),ptr=base+4
;(HEAPU32[base>>2]=length,valueIsOfTypeString)?stringToUTF8(value,ptr,length+1):HEAPU8.set(value,ptr)
;return null!==destructors&&destructors.push(_free,base),base},readValueFromPointer:readPointer,
destructorFunction(ptr){_free(ptr)}})},n:(rawType,charSize,name)=>{
var decodeString,encodeString,lengthBytesUTF
;name=AsciiToString(name),2===charSize?(decodeString=UTF16ToString,encodeString=stringToUTF16,
lengthBytesUTF=lengthBytesUTF16):(decodeString=UTF32ToString,encodeString=stringToUTF32,
lengthBytesUTF=lengthBytesUTF32),registerType(rawType,{name,fromWireType:value=>{
var length=HEAPU32[value>>2],str=decodeString(value+4,length*charSize,!0);return _free(value),str},
toWireType:(destructors,value)=>{
"string"!=typeof value&&throwBindingError(`Cannot pass non-string to C++ string type ${name}`)
;var length=lengthBytesUTF(value),ptr=_malloc(4+length+charSize)
;return HEAPU32[ptr>>2]=length/charSize,encodeString(value,ptr+4,length+charSize),
null!==destructors&&destructors.push(_free,ptr),ptr},readValueFromPointer:readPointer,
destructorFunction(ptr){_free(ptr)}})},
f:(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor)=>{
structRegistrations[rawType]={name:AsciiToString(name),
rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),
rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),fields:[]}},
e:(structType,fieldName,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext)=>{
structRegistrations[structType].fields.push({fieldName:AsciiToString(fieldName),getterReturnType,
getter:embind__requireFunction(getterSignature,getter),getterContext,setterArgumentType,
setter:embind__requireFunction(setterSignature,setter),setterContext})},N:(rawType,name)=>{
registerType(rawType,{isVoid:!0,name:name=AsciiToString(name),fromWireType:()=>{},
toWireType:(destructors,o)=>{}})},b:(argCount,argTypesPtr,kind)=>{
var[retType,...argTypes]=((argCount,argTypes)=>{
for(var a=new Array(argCount),i=0;i<argCount;++i)a[i]=requireRegisteredType(HEAPU32[argTypes+4*i>>2],`parameter ${i}`)
;return a
})(argCount,argTypesPtr),toReturnWire=retType.toWireType.bind(retType),argFromPtr=argTypes.map((type=>type.readValueFromPointer.bind(type)))
;argCount--
;var caller,id,argN=new Array(argCount),functionName=`methodCaller<(${argTypes.map((t=>t.name))}) => ${retType.name}>`
;return caller=createNamedFunction(functionName,((handle,methodName,destructorsRef,args)=>{
for(var rv,offset=0,i=0;i<argCount;++i)argN[i]=argFromPtr[i](args+offset),offset+=8;switch(kind){
case 0:rv=Emval_toValue(handle).apply(null,argN);break;case 2:
rv=Reflect.construct(Emval_toValue(handle),argN);break;case 3:rv=argN[0];break;case 1:
rv=Emval_toValue(handle)[getStringOrSymbol(methodName)](...argN)}
return((toReturnWire,destructorsRef,handle)=>{
var destructors=[],result=toReturnWire(destructors,handle)
;return destructors.length&&(HEAPU32[destructorsRef>>2]=Emval_toHandle(destructors)),result
})(toReturnWire,destructorsRef,rv)
})),id=emval_methodCallers.length,emval_methodCallers.push(caller),id},M:__emval_decref,
L:(object,property)=>delete(object=Emval_toValue(object))[property=Emval_toValue(property)],
K:name=>name?(name=getStringOrSymbol(name),
Emval_toHandle(globalThis[name])):Emval_toHandle(globalThis),
l:(handle,key)=>(handle=Emval_toValue(handle),key=Emval_toValue(key),Emval_toHandle(handle[key])),
u:handle=>{handle>9&&(emval_handles[handle+1]+=1)},c:__emval_invoke,
t:(a1,a2,a3,a4,a5)=>__emval_invoke(a1,a2,a3,a4,a5),
s:handle=>"string"==typeof(handle=Emval_toValue(handle)),J:()=>Emval_toHandle([]),
I:v=>Emval_toHandle(getStringOrSymbol(v)),H:()=>Emval_toHandle({}),G:handle=>{
var destructors=Emval_toValue(handle);runDestructors(destructors),__emval_decref(handle)},
i:(handle,key,value)=>{
handle=Emval_toValue(handle),key=Emval_toValue(key),value=Emval_toValue(value),handle[key]=value},
F:function __munmap_js(addr,len,prot,flags,fd,offset){offset=bigintToI53Checked(offset);try{
var stream=SYSCALLS.getStreamFromFD(fd);2&prot&&SYSCALLS.doMsync(addr,stream,len,flags,offset)
}catch(e){if(void 0===FS||"ErrnoError"!==e.name)throw e;return-e.errno}},
E:(timezone,daylight,std_name,dst_name)=>{
var currentYear=(new Date).getFullYear(),winter=new Date(currentYear,0,1),summer=new Date(currentYear,6,1),winterOffset=winter.getTimezoneOffset(),summerOffset=summer.getTimezoneOffset(),stdTimezoneOffset=Math.max(winterOffset,summerOffset)
;HEAPU32[timezone>>2]=60*stdTimezoneOffset,HEAP32[daylight>>2]=Number(winterOffset!=summerOffset)
;var extractZone=timezoneOffset=>{
var sign=timezoneOffset>=0?"-":"+",absOffset=Math.abs(timezoneOffset)
;return`UTC${sign}${String(Math.floor(absOffset/60)).padStart(2,"0")}${String(absOffset%60).padStart(2,"0")}`
},winterName=extractZone(winterOffset),summerName=extractZone(summerOffset)
;summerOffset<winterOffset?(stringToUTF8(winterName,std_name,17),
stringToUTF8(summerName,dst_name,17)):(stringToUTF8(winterName,dst_name,17),
stringToUTF8(summerName,std_name,17))},Y:function _clock_time_get(clk_id,ignored_precision,ptime){
if(ignored_precision=bigintToI53Checked(ignored_precision),
!((clock_id=clk_id)>=0&&clock_id<=3))return 28;var clock_id,now
;now=0===clk_id?_emscripten_date_now():performance.now();var nsec=Math.round(1e3*now*1e3)
;return HEAP64[ptime>>3]=BigInt(nsec),0},r:_emscripten_date_now,D:requestedSize=>{
var oldSize=HEAPU8.length;if((requestedSize>>>=0)>2147483648)return!1
;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown)
;overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296)
;var newSize=Math.min(2147483648,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536))
;if(growMemory(newSize))return!0}return!1},X:(__environ,environ_buf)=>{var bufSize=0,envp=0
;for(var string of getEnvStrings()){var ptr=environ_buf+bufSize;HEAPU32[__environ+envp>>2]=ptr,
bufSize+=stringToUTF8(string,ptr,1/0)+1,envp+=4}return 0},W:(penviron_count,penviron_buf_size)=>{
var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0
;for(var string of strings)bufSize+=lengthBytesUTF8(string)+1
;return HEAPU32[penviron_buf_size>>2]=bufSize,0},m:function _fd_close(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}},V:function _fd_fdstat_get(fd,pbuf){
try{
var stream=SYSCALLS.getStreamFromFD(fd),type=stream.tty?2:FS.isDir(stream.mode)?3:FS.isLink(stream.mode)?7:4
;return HEAP8[pbuf]=type,
HEAP16[pbuf+2>>1]=0,HEAP64[pbuf+8>>3]=BigInt(0),HEAP64[pbuf+16>>3]=BigInt(0),0}catch(e){
if(void 0===FS||"ErrnoError"!==e.name)throw e;return e.errno}},
A:function _fd_read(fd,iov,iovcnt,pnum){try{var num=((stream,iov,iovcnt,offset)=>{
for(var ret=0,i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2],len=HEAPU32[iov+4>>2];iov+=8
;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;if(ret+=curr,curr<len)break
;void 0!==offset&&(offset+=curr)}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
}},U:function _fd_seek(fd,offset,whence,newOffset){offset=bigintToI53Checked(offset);try{
if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd)
;return FS.llseek(stream,offset,whence),HEAP64[newOffset>>3]=BigInt(stream.position),
stream.getdents&&0===offset&&0===whence&&(stream.getdents=null),0}catch(e){
if(void 0===FS||"ErrnoError"!==e.name)throw e;return e.errno}},
z:function _fd_write(fd,iov,iovcnt,pnum){try{var num=((stream,iov,iovcnt,offset)=>{
for(var ret=0,i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2],len=HEAPU32[iov+4>>2];iov+=8
;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;if(ret+=curr,curr<len)break
;void 0!==offset&&(offset+=curr)}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
}}};function callMain(){var status,entryFunction=_main;try{var ret=entryFunction(0,0)
;return EXITSTATUS=status=ret,_proc_exit(status),ret}catch(e){return(e=>{
if(e instanceof ExitStatus||"unwind"==e)return EXITSTATUS;quit_(0,e)})(e)}}
return wasmExports=await async function createWasm(){function receiveInstance(instance,module){
return function assignWasmExports(wasmExports){
_malloc=wasmExports.ga,_main=Module._main=wasmExports.ha,___getTypeName=wasmExports.ia,
_free=wasmExports.ja,_emscripten_builtin_memalign=wasmExports.ka,___trap=wasmExports.la,
__emscripten_stack_restore=wasmExports.ma,__emscripten_stack_alloc=wasmExports.na,
_emscripten_stack_get_current=wasmExports.oa,___cxa_decrement_exception_refcount=wasmExports.pa,
___cxa_increment_exception_refcount=wasmExports.qa,
___thrown_object_from_unwind_exception=wasmExports.ra,___get_exception_message=wasmExports.sa,
wasmMemory=wasmExports.ca,___cpp_exception=wasmExports.ea,wasmTable=wasmExports.fa
}(wasmExports=instance.exports),updateMemoryViews(),wasmExports}var info=function getWasmImports(){
return{a:wasmImports}}();return Module.instantiateWasm?new Promise(((resolve,reject)=>{
Module.instantiateWasm(info,((inst,mod)=>{resolve(receiveInstance(inst))}))
})):(wasmBinaryFile??=findWasmBinary(),function receiveInstantiationResult(result){
return receiveInstance(result.instance)}(await instantiateAsync(wasmBinary,wasmBinaryFile,info)))
}(),function run(){function doRun(){(Module.calledRun=!0,ABORT)||(!function initRuntime(){
runtimeInitialized=!0,Module.noFSInit||FS.initialized||FS.init(),TTY.init(),wasmExports.da(),
FS.ignorePermissions=!1}(),readyPromiseResolve?.(Module),Module.onRuntimeInitialized?.(),
Module.noInitialRun||!1||callMain(),function postRun(){
if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift())
;callRuntimeCallbacks(onPostRuns)}())}
runDependencies>0?dependenciesFulfilled=run:(!function preRun(){
if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift())
;callRuntimeCallbacks(onPreRuns)
}(),runDependencies>0?dependenciesFulfilled=run:Module.setStatus?(Module.setStatus("Running..."),
setTimeout((()=>{setTimeout((()=>Module.setStatus("")),1),doRun()}),1)):doRun())}(),
runtimeInitialized?Module:new Promise(((resolve,reject)=>{readyPromiseResolve=resolve,
readyPromiseReject=reject}))}export default Module;