Commit dfe05910 authored by Jacob Durrant's avatar Jacob Durrant
Browse files

Update to version 1.0.1.

parent c259bd86
/**
* Webina Copyright 2019 Jacob Durrant
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var c=0;return function(){return c<a.length?{done:!1,value:a[c++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){a!=Array.prototype&&a!=Object.prototype&&(a[c]=b.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};
$jscomp.SymbolClass=function(a,c){this.$jscomp$symbol$id_=a;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:c})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};$jscomp.Symbol=function(){function a(b){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(b||"")+"_"+c++,b)}var c=0;return a}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.asyncIterator;a||(a=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("Symbol.asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};
$jscomp.iteratorFromArray=function(a,c){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var b=0,d={next:function(){if(b<a.length){var e=b++;return{value:c(e,a[e]),done:!1}}d.next=function(){return{done:!0,value:void 0}};return d.next()}};d[Symbol.iterator]=function(){return d};return d};
$jscomp.polyfill=function(a,c,b,d){if(c){b=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in b||(b[e]={});b=b[e]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})}};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a){return a})}},"es6","es3");var VERSION="1.0.0";console.log("Webina Library "+VERSION);console.log(" Compiled from Vina 1.1.2 codebase:");
console.log(" http://vina.scripps.edu/");
var WEBINA_Module,decodeBase64="function"==typeof atob?atob:function(a){var c,b,d,e,f,m,g="",h=0;for(a=a.replace(/[^A-Za-z0-9\+\/=]/g,"");c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++))<<2|(e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)))>>4,b=(15&e)<<4|(f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)))>>2,d=(3&f)<<6|(m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++))),g+=
String.fromCharCode(c),64!==f&&(g+=String.fromCharCode(b)),64!==m&&(g+=String.fromCharCode(d)),h<a.length;)return g},Webina=function(){return{WEBINA_ENVIRONMENT_IS_NODE:window.WEBINA_ENVIRONMENT_IS_NODE,WEBINA_lengthBytesUTF8:window.WEBINA_lengthBytesUTF8,WEBINA_stringToUTF8Array:window.WEBINA_stringToUTF8Array,WEBINA_assert:window.WEBINA_assert,WEBINA_ASSERTIONS:1,WEBINA_DATA_URI_PREFIX:"data:application/octet-stream;base64,",WEBINA_BASE_URL:"./",FS:window.FS,start:function(a,c,b,d,e,f){var m=this,
g="\nWEBINA\n======\n\n";void 0!==f?("/"!==f.slice(f.length-1)&&(f+="/"),this.WEBINA_BASE_URL=f,g+="User specified baseUrl: "+f+"\n"):g+="No baseUrl specified, so using ./\n\nUse Webina.start() to specify the baseUrl:\n function start(vinaParams, receptorPDBQTTxt, \n ligandPDBQTTxt, onDone, \n onError, baseUrl)\n";g+="\nExpecting files at the following locations:\n";for(var h=0;5>h;h++)g+=" "+(void 0===f?"./":f)+["Webina.min.min.js","vina.html.mem","vina.min.min.js",
"vina.worker.min.min.js","vina.wasm"][h]+"\n";g+="\n";void 0!==f?console.log(g):console.warn(g);void 0===e&&(e=function(){console.log("Webina encountered an error! Does your browser support WebAssembly?")});WEBINA_Module={preRun:[],postRun:[],stdOut:"",stdErr:"",print:function(){return function(a){1<arguments.length&&(a=Array.prototype.slice.call(arguments).join(" "));window.WEBINA_Module.stdOut+=a+"\n"}}(),printErr:function(a){1<arguments.length&&(a=Array.prototype.slice.call(arguments).join(" "));window.WEBINA_Module.stdErr+=
a+"\n"},setStatus:function(a){""===a&&void 0!==d&&(a=(new TextDecoder("utf-8")).decode(window.FS.readFile("ligand_out.pdbqt")),d(a,window.WEBINA_Module.stdOut,window.WEBINA_Module.stdErr))},onError:e,catchError:function(a){e(a)},receptorPDBQTTxt:c,ligandPDBQTTxt:b};void 0!==a.receptor&&console.warn("Webina does not support Vina's --receptor parameter. Instead, pass the content of the receptor file as a string to the webina.start() function.");void 0!==a.receptor&&console.warn("Webina does not support Vina's --ligand parameter. Instead, pass the content of the ligand file as a string to the webina.start() function.");
WEBINA_Module.arguments=["--receptor","/receptor.pdbqt","--ligand","/ligand.pdbqt"];c=Object.keys(a);b=c.length;for(h=0;h<b;h++)f=c[h],g=a[f],WEBINA_Module.arguments.push("--"+f),"boolean"!==typeof g&&WEBINA_Module.arguments.push(String(g));window.WEBINA_Module=WEBINA_Module;var k=this.WEBINA_BASE_URL+"vina.html.mem";k=WEBINA_Module.locateFile?WEBINA_Module.locateFile(k,""):k;WEBINA_Module.memoryInitializerRequestURL=k;var l=WEBINA_Module.memoryInitializerRequest=new XMLHttpRequest;l.onloadend=function(){if(404===
l.status){var a="Unable to access "+k+'. See JavaScript console for warnings. The "baseUrl" variable passed to Webina is likely incorrect.';WEBINA_Module.catchError({message:a});console.warn(a)}else a=document.createElement("script"),a.src=m.WEBINA_BASE_URL+"vina.min.js",document.body.appendChild(a)};l.open("GET",k,!0);l.responseType="arraybuffer";l.send(null)},isDataURI:function(a){return String.prototype.startsWith?a.startsWith(this.WEBINA_DATA_URI_PREFIX):0===a.indexOf(this.WEBINA_DATA_URI_PREFIX)},
intArrayFromBase64:function(a){if("boolean"==typeof this.WEBINA_ENVIRONMENT_IS_NODE&&this.WEBINA_ENVIRONMENT_IS_NODE){try{var c=Buffer.from(a,"base64")}catch(e){c=new Buffer(a,"base64")}return new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}try{var b=decodeBase64(a),d=new Uint8Array(b.length);for(a=0;a<b.length;++a)d[a]=b.charCodeAt(a);return d}catch(e){throw Error("Converting base64 string to bytes failed.");}},tryParseAsDataURI:function(a){if(this.isDataURI(a))return this.intArrayFromBase64(a.slice(this.WEBINA_DATA_URI_PREFIX.length))},
intArrayFromString:function(a,c,b){b=0<b?b:this.WEBINA_lengthBytesUTF8(a)+1;b=Array(b);a=this.WEBINA_stringToUTF8Array(a,b,0,b.length);return c&&(b.length=a),b},intArrayToString:function(a){for(var c=[],b=0;b<a.length;b++){var d=a[b];255<d&&(this.WEBINA_ASSERTIONS&&this.WEBINA_assert(!1,"Character code "+d+" ("+String.fromCharCode(d)+") at offset "+b+" not in 0x00-0xFF."),d&=255);c.push(String.fromCharCode(d))}return c.join("")}}}();
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Math.imul",function(a){return a?a:function(a,c){a=Number(a);c=Number(c);var b=a&65535,e=c&65535;return b*e+((a>>>16&65535)*e+b*(c>>>16&65535)<<16>>>0)|0}},"es6","es3");
$jscomp.polyfill("Math.fround",function(a){if(a)return a;if($jscomp.SIMPLE_FROUND_POLYFILL||"function"!==typeof Float32Array)return function(a){return a};var b=new Float32Array(1);return function(a){b[0]=a;return b[0]}},"es6","es3");
$jscomp.polyfill("Math.clz32",function(a){return a?a:function(a){a=Number(a)>>>0;if(0===a)return 32;var b=0;0===(a&4294901760)&&(a<<=16,b+=16);0===(a&4278190080)&&(a<<=8,b+=8);0===(a&4026531840)&&(a<<=4,b+=4);0===(a&3221225472)&&(a<<=2,b+=2);0===(a&2147483648)&&b++;return b}},"es6","es3");$jscomp.polyfill("Math.trunc",function(a){return a?a:function(a){a=Number(a);if(isNaN(a)||Infinity===a||-Infinity===a||0===a)return a;var b=Math.floor(Math.abs(a));return 0>a?-b:b}},"es6","es3");
$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};$jscomp.FORCE_POLYFILL_PROMISE=!1;
$jscomp.polyfill("Promise",function(a){function b(){this.batch_=null}function c(a){return a instanceof e?a:new e(function(b,c){b(a)})}if(a&&!$jscomp.FORCE_POLYFILL_PROMISE)return a;b.prototype.asyncExecute=function(a){if(null==this.batch_){this.batch_=[];var b=this;this.asyncExecuteFunction(function(){b.executeBatch_()})}this.batch_.push(a)};var d=$jscomp.global.setTimeout;b.prototype.asyncExecuteFunction=function(a){d(a,0)};b.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var a=
this.batch_;this.batch_=[];for(var b=0;b<a.length;++b){var c=a[b];a[b]=null;try{c()}catch(h){this.asyncThrow_(h)}}}this.batch_=null};b.prototype.asyncThrow_=function(a){this.asyncExecuteFunction(function(){throw a;})};var e=function(a){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var b=this.createResolveAndReject_();try{a(b.resolve,b.reject)}catch(l){b.reject(l)}};e.prototype.createResolveAndReject_=function(){function a(a){return function(d){c||(c=!0,a.call(b,d))}}var b=this,c=!1;
return{resolve:a(this.resolveTo_),reject:a(this.reject_)}};e.prototype.resolveTo_=function(a){if(a===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(a instanceof e)this.settleSameAsPromise_(a);else{a:switch(typeof a){case "object":var b=null!=a;break a;case "function":b=!0;break a;default:b=!1}b?this.resolveToNonPromiseObj_(a):this.fulfill_(a)}};e.prototype.resolveToNonPromiseObj_=function(a){var b=void 0;try{b=a.then}catch(l){this.reject_(l);return}"function"==typeof b?
this.settleSameAsThenable_(b,a):this.fulfill_(a)};e.prototype.reject_=function(a){this.settle_(2,a)};e.prototype.fulfill_=function(a){this.settle_(1,a)};e.prototype.settle_=function(a,b){if(0!=this.state_)throw Error("Cannot settle("+a+", "+b+"): Promise already settled in state"+this.state_);this.state_=a;this.result_=b;this.executeOnSettledCallbacks_()};e.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var a=0;a<this.onSettledCallbacks_.length;++a)f.asyncExecute(this.onSettledCallbacks_[a]);
this.onSettledCallbacks_=null}};var f=new b;e.prototype.settleSameAsPromise_=function(a){var b=this.createResolveAndReject_();a.callWhenSettled_(b.resolve,b.reject)};e.prototype.settleSameAsThenable_=function(a,b){var c=this.createResolveAndReject_();try{a.call(b,c.resolve,c.reject)}catch(h){c.reject(h)}};e.prototype.then=function(a,b){function c(a,b){return"function"==typeof a?function(b){try{d(a(b))}catch(r){f(r)}}:b}var d,f,g=new e(function(a,b){d=a;f=b});this.callWhenSettled_(c(a,d),c(b,f));return g};
e.prototype.catch=function(a){return this.then(void 0,a)};e.prototype.callWhenSettled_=function(a,b){function c(){switch(d.state_){case 1:a(d.result_);break;case 2:b(d.result_);break;default:throw Error("Unexpected state: "+d.state_);}}var d=this;null==this.onSettledCallbacks_?f.asyncExecute(c):this.onSettledCallbacks_.push(c)};e.resolve=c;e.reject=function(a){return new e(function(b,c){c(a)})};e.race=function(a){return new e(function(b,d){for(var e=$jscomp.makeIterator(a),f=e.next();!f.done;f=e.next())c(f.value).callWhenSettled_(b,
d)})};e.all=function(a){var b=$jscomp.makeIterator(a),d=b.next();return d.done?c([]):new e(function(a,e){function f(b){return function(c){g[b]=c;p--;0==p&&a(g)}}var g=[],p=0;do g.push(void 0),p++,c(d.value).callWhenSettled_(f(g.length-1),e),d=b.next();while(!d.done)})};return e},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};
$jscomp.SymbolClass=function(a,b){this.$jscomp$symbol$id_=a;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:b})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};$jscomp.Symbol=function(){function a(c){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(c||"")+"_"+b++,c)}var b=0;return a}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.asyncIterator;a||(a=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("Symbol.asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};
$jscomp.iteratorFromArray=function(a,b){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var c=0,d={next:function(){if(c<a.length){var e=c++;return{value:b(e,a[e]),done:!1}}d.next=function(){return{done:!0,value:void 0}};return d.next()}};d[Symbol.iterator]=function(){return d};return d};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a){return a})}},"es6","es3");
$jscomp.polyfill("Array.prototype.entries",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a,c){return[a,c]})}},"es6","es3");var WEBINA_Module="undefined"!==typeof WEBINA_Module?WEBINA_Module:{};WEBINA_Module.expectedDataFileDownloads||(WEBINA_Module.expectedDataFileDownloads=0,WEBINA_Module.finishedDataFileDownloads=0);WEBINA_Module.expectedDataFileDownloads++;
(function(){(function(a){function b(){function a(a,b){data=(new TextEncoder).encode(a);WEBINA_Module.FS_createDataFile("/",b,data,!0,!0,!1)}a(WEBINA_Module.ligandPDBQTTxt,"ligand.pdbqt");a(WEBINA_Module.receptorPDBQTTxt,"receptor.pdbqt")}WEBINA_Module.calledRun?b():(WEBINA_Module.preRun||(WEBINA_Module.preRun=[]),WEBINA_Module.preRun.push(b))})({files:[]})})();var moduleOverrides={},key;for(key in WEBINA_Module)WEBINA_Module.hasOwnProperty(key)&&(moduleOverrides[key]=WEBINA_Module[key]);
var arguments_=[],thisProgram="./this.program",quit_=function(a,b){throw b;},ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,WEBINA_ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_HAS_NODE=!1,ENVIRONMENT_IS_SHELL=!1;ENVIRONMENT_IS_WEB="object"===typeof window;ENVIRONMENT_IS_WORKER="function"===typeof importScripts;WEBINA_ENVIRONMENT_IS_NODE=(ENVIRONMENT_HAS_NODE="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;
ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!WEBINA_ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(WEBINA_Module.ENVIRONMENT)throw Error("WEBINA_Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var ENVIRONMENT_IS_PTHREAD=WEBINA_Module.ENVIRONMENT_IS_PTHREAD||!1;if(!ENVIRONMENT_IS_PTHREAD)var PthreadWorkerInit={};
var _scriptDir="undefined"!==typeof document&&document.currentScript?document.currentScript.src:void 0,scriptDirectory="";function locateFile(a){return WEBINA_Module.locateFile?WEBINA_Module.locateFile(a,scriptDirectory):scriptDirectory+a}var read_,readAsync,readBinary,setWindowTitle;
if(WEBINA_ENVIRONMENT_IS_NODE){scriptDirectory=__dirname+"/";var nodeFS,nodePath;read_=function(a,b){nodeFS||(nodeFS=require("fs"));nodePath||(nodePath=require("path"));a=nodePath.normalize(a);a=nodeFS.readFileSync(a);return b?a:a.toString()};readBinary=function(a){a=read_(a,!0);a.buffer||(a=new Uint8Array(a));WEBINA_assert(a.buffer);return a};1<process.argv.length&&(thisProgram=process.argv[1].replace(/\\/g,"/"));arguments_=process.argv.slice(2);"undefined"!==typeof module&&(module.exports=WEBINA_Module);
process.on("uncaughtException",function(a){if(!(a instanceof ExitStatus))throw a;});process.on("unhandledRejection",abort);quit_=function(a){process.exit(a)};WEBINA_Module.inspect=function(){return"[Emscripten WEBINA_Module object]"}}else if(ENVIRONMENT_IS_SHELL)"undefined"!=typeof read&&(read_=function(a){return read(a)}),readBinary=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");WEBINA_assert("object"===typeof a);return a},"undefined"!=typeof scriptArgs?
arguments_=scriptArgs:"undefined"!=typeof arguments&&(arguments_=arguments),"function"===typeof quit&&(quit_=function(a){quit(a)}),"undefined"!==typeof print&&("undefined"===typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!==typeof printErr?printErr:print);else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=0!==scriptDirectory.indexOf("blob:")?
scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1):"",read_=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),readAsync=function(a,b,c){var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?b(d.response):
c()};d.onerror=c;d.send(null)},setWindowTitle=function(a){document.title=a};else throw Error("environment detection error");var out=WEBINA_Module.print||console.log.bind(console),err=WEBINA_Module.printErr||console.warn.bind(console);for(key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(WEBINA_Module[key]=moduleOverrides[key]);moduleOverrides=null;WEBINA_Module.arguments&&(arguments_=WEBINA_Module.arguments);
Object.getOwnPropertyDescriptor(WEBINA_Module,"arguments")||Object.defineProperty(WEBINA_Module,"arguments",{configurable:!0,get:function(){abort("WEBINA_Module.arguments has been replaced with plain arguments_")}});WEBINA_Module.thisProgram&&(thisProgram=WEBINA_Module.thisProgram);Object.getOwnPropertyDescriptor(WEBINA_Module,"thisProgram")||Object.defineProperty(WEBINA_Module,"thisProgram",{configurable:!0,get:function(){abort("WEBINA_Module.thisProgram has been replaced with plain thisProgram")}});
WEBINA_Module.quit&&(quit_=WEBINA_Module.quit);Object.getOwnPropertyDescriptor(WEBINA_Module,"quit")||Object.defineProperty(WEBINA_Module,"quit",{configurable:!0,get:function(){abort("WEBINA_Module.quit has been replaced with plain quit_")}});WEBINA_assert("undefined"===typeof WEBINA_Module.memoryInitializerPrefixURL,"WEBINA_Module.memoryInitializerPrefixURL option was removed, use WEBINA_Module.locateFile instead");WEBINA_assert("undefined"===typeof WEBINA_Module.pthreadMainPrefixURL,"WEBINA_Module.pthreadMainPrefixURL option was removed, use WEBINA_Module.locateFile instead");
WEBINA_assert("undefined"===typeof WEBINA_Module.cdInitializerPrefixURL,"WEBINA_Module.cdInitializerPrefixURL option was removed, use WEBINA_Module.locateFile instead");WEBINA_assert("undefined"===typeof WEBINA_Module.filePackagePrefixURL,"WEBINA_Module.filePackagePrefixURL option was removed, use WEBINA_Module.locateFile instead");WEBINA_assert("undefined"===typeof WEBINA_Module.read,"WEBINA_Module.read option was removed (modify read_ in JS)");
WEBINA_assert("undefined"===typeof WEBINA_Module.readAsync,"WEBINA_Module.readAsync option was removed (modify readAsync in JS)");WEBINA_assert("undefined"===typeof WEBINA_Module.readBinary,"WEBINA_Module.readBinary option was removed (modify readBinary in JS)");WEBINA_assert("undefined"===typeof WEBINA_Module.setWindowTitle,"WEBINA_Module.setWindowTitle option was removed (modify setWindowTitle in JS)");
Object.getOwnPropertyDescriptor(WEBINA_Module,"read")||Object.defineProperty(WEBINA_Module,"read",{configurable:!0,get:function(){abort("WEBINA_Module.read has been replaced with plain read_")}});Object.getOwnPropertyDescriptor(WEBINA_Module,"readAsync")||Object.defineProperty(WEBINA_Module,"readAsync",{configurable:!0,get:function(){abort("WEBINA_Module.readAsync has been replaced with plain readAsync")}});
Object.getOwnPropertyDescriptor(WEBINA_Module,"readBinary")||Object.defineProperty(WEBINA_Module,"readBinary",{configurable:!0,get:function(){abort("WEBINA_Module.readBinary has been replaced with plain readBinary")}});WEBINA_assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER,"Pthreads do not work in non-browser environments yet (need Web Workers, or an alternative to them)");stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};
function dynamicAlloc(a){WEBINA_assert(DYNAMICTOP_PTR);WEBINA_assert(!ENVIRONMENT_IS_PTHREAD);var b=HEAP32[DYNAMICTOP_PTR>>2];a=b+a+15&-16;a>_emscripten_get_heap_size()&&abort("failure to dynamicAlloc - memory growth etc. is not supported there, call malloc/sbrk directly");HEAP32[DYNAMICTOP_PTR>>2]=a;return b}
function getNativeTypeSize(a){switch(a){case "i1":case "i8":return 1;case "i16":return 2;case "i32":return 4;case "i64":return 8;case "float":return 4;case "double":return 8;default:if("*"===a[a.length-1])return 4;if("i"===a[0]){var b=parseInt(a.substr(1));WEBINA_assert(0===b%8,"getNativeTypeSize invalid bits "+b+", type "+a);return b/8}return 0}}function warnOnce(a){warnOnce.shown||(warnOnce.shown={});warnOnce.shown[a]||(warnOnce.shown[a]=1,err(a))}
var asm2wasmImports={"f64-rem":function(a,b){return a%b},"debugger":function(){debugger}},functionPointers=[],tempRet0=0,setTempRet0=function(a){tempRet0=a},GLOBAL_BASE=1024,wasmBinary;WEBINA_Module.wasmBinary&&(wasmBinary=WEBINA_Module.wasmBinary);Object.getOwnPropertyDescriptor(WEBINA_Module,"wasmBinary")||Object.defineProperty(WEBINA_Module,"wasmBinary",{configurable:!0,get:function(){abort("WEBINA_Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;
WEBINA_Module.noExitRuntime&&(noExitRuntime=WEBINA_Module.noExitRuntime);Object.getOwnPropertyDescriptor(WEBINA_Module,"noExitRuntime")||Object.defineProperty(WEBINA_Module,"noExitRuntime",{configurable:!0,get:function(){abort("WEBINA_Module.noExitRuntime has been replaced with plain noExitRuntime")}});"object"!==typeof WebAssembly&&abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.");
function setValue(a,b,c,d){c=c||"i8";"*"===c.charAt(c.length-1)&&(c="i32");switch(c){case "i1":HEAP8[a>>0]=b;break;case "i8":HEAP8[a>>0]=b;break;case "i16":HEAP16[a>>1]=b;break;case "i32":HEAP32[a>>2]=b;break;case "i64":tempI64=[b>>>0,(tempDouble=b,1<=+Math_abs(tempDouble)?0<tempDouble?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)];HEAP32[a>>2]=tempI64[0];HEAP32[a+4>>2]=tempI64[1];break;case "float":HEAPF32[a>>2]=b;
break;case "double":HEAPF64[a>>3]=b;break;default:abort("invalid type for setValue: "+c)}}var wasmMemory,wasmTable=new WebAssembly.Table({initial:1388,maximum:1388,element:"anyfunc"}),wasmModule,ABORT=!1,EXITSTATUS=0;function WEBINA_assert(a,b){a||abort("Assertion failed: "+b)}var ALLOC_NONE=3;
function allocate(a,b,c,d){if("number"===typeof a){var e=!0;var f=a}else e=!1,f=a.length;var g="string"===typeof b?b:null;c=c==ALLOC_NONE?d:[_malloc,stackAlloc,dynamicAlloc][c](Math.max(f,g?1:b.length));if(e){d=c;WEBINA_assert(0==(c&3));for(a=c+(f&-4);d<a;d+=4)HEAP32[d>>2]=0;for(a=c+f;d<a;)HEAP8[d++>>0]=0;return c}if("i8"===g)return a.subarray||a.slice?HEAPU8.set(a,c):HEAPU8.set(new Uint8Array(a),c),c;d=0;for(var k,l;d<f;){var h=a[d];e=g||b[d];0===e?d++:(WEBINA_assert(e,"Must know what type to store in allocate!"),
"i64"==e&&(e="i32"),setValue(c+d,h,e),l!==e&&(k=getNativeTypeSize(e),l=e),d+=k)}return c}function getMemory(a){return runtimeInitialized?_malloc(a):dynamicAlloc(a)}
function UTF8ArrayToString(a,b,c){c=b+c;for(var d="";!(b>=c);){var e=a[b++];if(!e)break;if(e&128){var f=a[b++]&63;if(192==(e&224))d+=String.fromCharCode((e&31)<<6|f);else{var g=a[b++]&63;224==(e&240)?e=(e&15)<<12|f<<6|g:(240!=(e&248)&&warnOnce("Invalid UTF-8 leading byte 0x"+e.toString(16)+" encountered when deserializing a UTF-8 string on the asm.min.js/wasm heap to a JS string!"),e=(e&7)<<18|f<<12|g<<6|a[b++]&63);65536>e?d+=String.fromCharCode(e):(e-=65536,d+=String.fromCharCode(55296|e>>10,56320|e&
1023))}}else d+=String.fromCharCode(e)}return d}function UTF8ToString(a,b){return a?UTF8ArrayToString(HEAPU8,a,b):""}
function WEBINA_stringToUTF8Array(a,b,c,d){if(!(0<d))return 0;var e=c;d=c+d-1;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var k=a.charCodeAt(++f);g=65536+((g&1023)<<10)|k&1023}if(127>=g){if(c>=d)break;b[c++]=g}else{if(2047>=g){if(c+1>=d)break;b[c++]=192|g>>6}else{if(65535>=g){if(c+2>=d)break;b[c++]=224|g>>12}else{if(c+3>=d)break;2097152<=g&&warnOnce("Invalid Unicode code point 0x"+g.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.min.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");
b[c++]=240|g>>18;b[c++]=128|g>>12&63}b[c++]=128|g>>6&63}b[c++]=128|g&63}}b[c]=0;return c-e}function stringToUTF8(a,b,c){WEBINA_assert("number"==typeof c,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return WEBINA_stringToUTF8Array(a,HEAPU8,b,c)}
function WEBINA_lengthBytesUTF8(a){for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);55296<=d&&57343>=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++c)&1023);127>=d?++b:b=2047>=d?b+2:65535>=d?b+3:b+4}return b}function allocateUTF8(a){var b=WEBINA_lengthBytesUTF8(a)+1,c=_malloc(b);c&&WEBINA_stringToUTF8Array(a,HEAP8,c,b);return c}function allocateUTF8OnStack(a){var b=WEBINA_lengthBytesUTF8(a)+1,c=stackAlloc(b);WEBINA_stringToUTF8Array(a,HEAP8,c,b);return c}
function writeArrayToMemory(a,b){WEBINA_assert(0<=a.length,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(a,b)}function writeAsciiToMemory(a,b,c){for(var d=0;d<a.length;++d)WEBINA_assert(a.charCodeAt(d)===a.charCodeAt(d)&255),HEAP8[b++>>0]=a.charCodeAt(d);c||(HEAP8[b>>0]=0)}var WASM_PAGE_SIZE=65536,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;
function updateGlobalBufferAndViews(a){buffer=a;WEBINA_Module.HEAP8=HEAP8=new Int8Array(a);WEBINA_Module.HEAP16=HEAP16=new Int16Array(a);WEBINA_Module.HEAP32=HEAP32=new Int32Array(a);WEBINA_Module.HEAPU8=HEAPU8=new Uint8Array(a);WEBINA_Module.HEAPU16=HEAPU16=new Uint16Array(a);WEBINA_Module.HEAPU32=HEAPU32=new Uint32Array(a);WEBINA_Module.HEAPF32=HEAPF32=new Float32Array(a);WEBINA_Module.HEAPF64=HEAPF64=new Float64Array(a)}
if(!ENVIRONMENT_IS_PTHREAD){var STACK_BASE=85136,STACK_MAX=5328016,DYNAMIC_BASE=5328016,DYNAMICTOP_PTR=84128;WEBINA_assert(0===STACK_BASE%16,"stack must start aligned");WEBINA_assert(0===DYNAMIC_BASE%16,"heap must start aligned")}var TOTAL_STACK=5242880;WEBINA_Module.TOTAL_STACK&&WEBINA_assert(TOTAL_STACK===WEBINA_Module.TOTAL_STACK,"the stack size can no longer be determined at runtime");var INITIAL_TOTAL_MEMORY=WEBINA_Module.TOTAL_MEMORY||1073741824;
Object.getOwnPropertyDescriptor(WEBINA_Module,"TOTAL_MEMORY")||Object.defineProperty(WEBINA_Module,"TOTAL_MEMORY",{configurable:!0,get:function(){abort("WEBINA_Module.TOTAL_MEMORY has been replaced with plain INITIAL_TOTAL_MEMORY")}});WEBINA_assert(INITIAL_TOTAL_MEMORY>=TOTAL_STACK,"TOTAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");
WEBINA_assert("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support");
if(!ENVIRONMENT_IS_PTHREAD)if(WEBINA_Module.wasmMemory)wasmMemory=WEBINA_Module.wasmMemory;else try{wasmMemory=new WebAssembly.Memory({initial:INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE,maximum:INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE,shared:!0}),WEBINA_assert(wasmMemory.buffer instanceof SharedArrayBuffer,"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag")}catch(a){WEBINA_Module.catchError({message:"Problem using shared memory, likely because your browser does not have WebAssembly threads support. Please use a different browser, such as Google Chrome."})}
wasmMemory&&(buffer=wasmMemory.buffer);INITIAL_TOTAL_MEMORY=buffer.byteLength;WEBINA_assert(0===INITIAL_TOTAL_MEMORY%WASM_PAGE_SIZE);updateGlobalBufferAndViews(buffer);ENVIRONMENT_IS_PTHREAD||(HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE);function writeStackCookie(){WEBINA_assert(0==(STACK_MAX&3));HEAPU32[(STACK_MAX>>2)-1]=34821223;HEAPU32[(STACK_MAX>>2)-2]=2310721022;HEAP32[0]=1668509029}
function checkStackCookie(){var a=HEAPU32[(STACK_MAX>>2)-1],b=HEAPU32[(STACK_MAX>>2)-2];34821223==a&&2310721022==b||abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+b.toString(16)+" "+a.toString(16));1668509029!==HEAP32[0]&&abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}
function abortStackOverflow(a){abort("Stack overflow! Attempted to allocate "+a+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+a)+" bytes available!")}(function(){var a=new Int16Array(1),b=new Int8Array(a.buffer);a[0]=25459;if(115!==b[0]||99!==b[1])throw"Runtime error: expected the system to be little-endian!";})();
function abortFnPtrError(a,b){abort("Invalid function pointer "+a+" called with signature '"+b+"'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this). Build with WEBINA_ASSERTIONS=2 for more info.")}
function callRuntimeCallbacks(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b();else{var c=b.func;"number"===typeof c?void 0===b.arg?WEBINA_Module.dynCall_v(c):WEBINA_Module.dynCall_vi(c,b.arg):c(void 0===b.arg?null:b.arg)}}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;ENVIRONMENT_IS_PTHREAD&&(runtimeInitialized=!0);
function preRun(){if(!ENVIRONMENT_IS_PTHREAD){if(WEBINA_Module.preRun)for("function"==typeof WEBINA_Module.preRun&&(WEBINA_Module.preRun=[WEBINA_Module.preRun]);WEBINA_Module.preRun.length;)addOnPreRun(WEBINA_Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}}function initRuntime(){checkStackCookie();WEBINA_assert(!runtimeInitialized);runtimeInitialized=!0;WEBINA_Module.noFSInit||FS.init.initialized||FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}
function preMain(){checkStackCookie();ENVIRONMENT_IS_PTHREAD||(FS.ignorePermissions=!1,callRuntimeCallbacks(__ATMAIN__))}function exitRuntime(){checkStackCookie();ENVIRONMENT_IS_PTHREAD||(runtimeExited=!0)}
function postRun(){checkStackCookie();if(!ENVIRONMENT_IS_PTHREAD){if(WEBINA_Module.postRun)for("function"==typeof WEBINA_Module.postRun&&(WEBINA_Module.postRun=[WEBINA_Module.postRun]);WEBINA_Module.postRun.length;)addOnPostRun(WEBINA_Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}}function addOnPreRun(a){__ATPRERUN__.unshift(a)}function addOnPostRun(a){__ATPOSTRUN__.unshift(a)}WEBINA_assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");
WEBINA_assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");WEBINA_assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");WEBINA_assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");
var Math_abs=Math.abs,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_min=Math.min,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null,runDependencyTracking={};function getUniqueRunDependency(a){for(var b=a;runDependencyTracking[a];)a=b+Math.random();return a}
function addRunDependency(a){WEBINA_assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;WEBINA_Module.monitorRunDependencies&&WEBINA_Module.monitorRunDependencies(runDependencies);a?(WEBINA_assert(!runDependencyTracking[a]),runDependencyTracking[a]=1,null===runDependencyWatcher&&"undefined"!==typeof setInterval&&(runDependencyWatcher=setInterval(function(){if(ABORT)clearInterval(runDependencyWatcher),runDependencyWatcher=null;else{var a=!1,c;for(c in runDependencyTracking)a||
(a=!0,err("still waiting on run dependencies:")),err("dependency: "+c);a&&err("(end of list)")}},1E4))):err("warning: run dependency added without ID")}
function removeRunDependency(a){runDependencies--;WEBINA_Module.monitorRunDependencies&&WEBINA_Module.monitorRunDependencies(runDependencies);a?(WEBINA_assert(runDependencyTracking[a]),delete runDependencyTracking[a]):err("warning: run dependency removed without ID");0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled&&(a=dependenciesFulfilled,dependenciesFulfilled=null,a()))}WEBINA_Module.preloadedImages={};
WEBINA_Module.preloadedAudios={};function abort(a){if(WEBINA_Module.onAbort)WEBINA_Module.onAbort(a);ENVIRONMENT_IS_PTHREAD&&console.error("Pthread aborting at "+Error().stack);a+="";out(a);err(a);ABORT=!0;EXITSTATUS=1;throw"abort("+a+") at "+stackTrace();}var memoryInitializer=null;ENVIRONMENT_IS_PTHREAD||addOnPreRun(function(){"undefined"!==typeof SharedArrayBuffer&&(addRunDependency("pthreads"),PThread.allocateUnusedWorkers(20,function(){removeRunDependency("pthreads")}))});var dataURIPrefix="data:application/octet-stream;base64,";
function isDataURI(a){return String.prototype.startsWith?a.startsWith(dataURIPrefix):0===a.indexOf(dataURIPrefix)}var wasmBinaryFile="vina.wasm";isDataURI(wasmBinaryFile)||(wasmBinaryFile=locateFile(wasmBinaryFile));function getBinary(){try{if(wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(wasmBinaryFile);throw"both async and sync fetching of the wasm failed";}catch(a){abort(a)}}
function getBinaryPromise(){return wasmBinary||!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER||"function"!==typeof fetch?new Promise(function(a,b){a(getBinary())}):fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+wasmBinaryFile+"'";return a.arrayBuffer()}).catch(function(){return getBinary()})}
function createWasm(){function a(a,b){WEBINA_Module.asm=a.exports;wasmModule=b;ENVIRONMENT_IS_PTHREAD||removeRunDependency("wasm-instantiate")}function b(b){WEBINA_assert(WEBINA_Module===e,"the WEBINA_Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");e=null;a(b.instance,b.module)}function c(a){return getBinaryPromise().then(function(a){return WebAssembly.instantiate(a,d)}).then(a,function(a){err("failed to asynchronously prepare wasm: "+
a);abort(a)})}var d={env:asmLibraryArg,wasi_unstable:asmLibraryArg,global:{NaN:NaN,Infinity:Infinity},"global.Math":Math,asm2wasm:asm2wasmImports};ENVIRONMENT_IS_PTHREAD||addRunDependency("wasm-instantiate");var e=WEBINA_Module;if(WEBINA_Module.instantiateWasm)try{return WEBINA_Module.instantiateWasm(d,a)}catch(f){return err("WEBINA_Module.instantiateWasm callback failed with error: "+f),!1}(function(){if(wasmBinary||"function"!==typeof WebAssembly.instantiateStreaming||isDataURI(wasmBinaryFile)||
"function"!==typeof fetch)return c(b);fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,d).then(b,function(a){err("wasm streaming compile failed: "+a);err("falling back to ArrayBuffer instantiation");c(b)})})})();return{}}WEBINA_Module.asm=createWasm;
var tempDouble,tempI64,ASM_CONSTS=[function(){postMessage({cmd:"processQueuedMainThreadWork"})},function(a){if(ENVIRONMENT_IS_PTHREAD)postMessage({targetThread:a,cmd:"processThreadQueue"});else{if(!PThread.pthreads[a]||!PThread.pthreads[a].worker)return 0;PThread.pthreads[a].worker.postMessage({cmd:"processThreadQueue"})}return 1},function(){return!!WEBINA_Module.canvas},function(){noExitRuntime=!0},function(){throw"Canceled!";}];function _emscripten_asm_const_i(a){return ASM_CONSTS[a]()}
function _emscripten_asm_const_ii(a,b){return ASM_CONSTS[a](b)}function _initPthreadsJS(){PThread.initRuntime()}ENVIRONMENT_IS_PTHREAD||__ATINIT__.push({func:function(){globalCtors()}});ENVIRONMENT_IS_PTHREAD||(memoryInitializer=Webina.WEBINA_BASE_URL+"vina.html.mem");var tempDoublePtr;ENVIRONMENT_IS_PTHREAD||(tempDoublePtr=85120);WEBINA_assert(0==tempDoublePtr%8);function demangle(a){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return a}
function demangleAll(a){return a.replace(/\b__Z[\w\d_]+/g,function(a){var b=demangle(a);return a===b?a:b+" ["+a+"]"})}function jsStackTrace(){var a=Error();if(!a.stack){try{throw Error(0);}catch(b){a=b}if(!a.stack)return"(no stack trace available)"}return a.stack.toString()}function stackTrace(){var a=jsStackTrace();WEBINA_Module.extraStackTrace&&(a+="\n"+WEBINA_Module.extraStackTrace());return demangleAll(a)}
function ___assert_fail(a,b,c,d){abort("Assertion failed: "+UTF8ToString(a)+", at: "+[b?UTF8ToString(b):"unknown filename",c,d?UTF8ToString(d):"unknown function"])}var ENV={};
function ___buildEnvironment(a){if(___buildEnvironment.called){var b=HEAP32[a>>2];var c=HEAP32[b>>2]}else ___buildEnvironment.called=!0,ENV.USER="web_user",ENV.LOGNAME="web_user",ENV.PATH="/",ENV.PWD="/",ENV.HOME="/home/web_user",ENV.LANG=("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",ENV._=thisProgram,c=getMemory(1024),b=getMemory(256),HEAP32[b>>2]=c,HEAP32[a>>2]=b;a=[];var d=0,e;for(e in ENV)if("string"===typeof ENV[e]){var f=e+"="+ENV[e];
a.push(f);d+=f.length}if(1024<d)throw Error("Environment size exceeded TOTAL_ENV_SIZE!");for(e=0;e<a.length;e++)f=a[e],writeAsciiToMemory(f,c),HEAP32[b+4*e>>2]=c,c+=f.length+1;HEAP32[b+4*a.length>>2]=0}
var PROCINFO={ppid:1,pid:42,sid:42,pgid:42},ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,
EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,
ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},__main_thread_futex_wait_address;
ENVIRONMENT_IS_PTHREAD?__main_thread_futex_wait_address=PthreadWorkerInit.__main_thread_futex_wait_address:PthreadWorkerInit.__main_thread_futex_wait_address=__main_thread_futex_wait_address=85104;
function _emscripten_futex_wake(a,b){if(0>=a||a>HEAP8.length||a&1||0>b)return-28;if(0==b)return 0;2147483647<=b&&(b=Infinity);var c=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2),d=0;if(c==a&&Atomics.compareExchange(HEAP32,__main_thread_futex_wait_address>>2,c,0)==c&&(--b,d=1,0>=b))return 1;a=Atomics.notify(HEAP32,a>>2,b);if(0<=a)return a+d;throw"Atomics.notify returned an unexpected value "+a;}
var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},preallocatedWorkers:[],unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){if(!ENVIRONMENT_IS_PTHREAD){PThread.preallocatedWorkers=PThread.createNewWorkers(20);PThread.mainThreadBlock=84320;for(var a=0;61>a;++a)HEAPU32[PThread.mainThreadBlock/4+a]=
0;HEAP32[PThread.mainThreadBlock+24>>2]=PThread.mainThreadBlock;a=PThread.mainThreadBlock+168;HEAP32[a>>2]=a;for(a=0;128>a;++a)HEAPU32[21144+a]=0;Atomics.store(HEAPU32,PThread.mainThreadBlock+116>>2,84576);Atomics.store(HEAPU32,PThread.mainThreadBlock+52>>2,PThread.mainThreadBlock);Atomics.store(HEAPU32,PThread.mainThreadBlock+56>>2,PROCINFO.pid)}},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(null!==PThread.exitHandlers){for(;0<PThread.exitHandlers.length;)PThread.exitHandlers.pop()();
PThread.exitHandlers=null}ENVIRONMENT_IS_PTHREAD&&threadInfoStruct&&___pthread_tsd_run_dtors()},threadExit:function(a){var b=_pthread_self();b&&(Atomics.store(HEAPU32,b+4>>2,a),Atomics.store(HEAPU32,b+0>>2,1),Atomics.store(HEAPU32,b+72>>2,1),Atomics.store(HEAPU32,b+76>>2,0),PThread.runExitHandlers(),_emscripten_futex_wake(b+0,2147483647),__register_pthread_ptr(0,0,0),threadInfoStruct=0,ENVIRONMENT_IS_PTHREAD&&postMessage({cmd:"exit"}))},threadCancel:function(){PThread.runExitHandlers();Atomics.store(HEAPU32,
threadInfoStruct+4>>2,-1);Atomics.store(HEAPU32,threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({cmd:"cancelDone"})},terminateAllThreads:function(){for(var a in PThread.pthreads){var b=PThread.pthreads[a];b&&(PThread.freeThreadData(b),b.worker&&b.worker.terminate())}PThread.pthreads={};for(a=0;a<PThread.preallocatedWorkers.length;++a){var c=PThread.preallocatedWorkers[a];WEBINA_assert(!c.pthread);
c.terminate()}PThread.preallocatedWorkers=[];for(a=0;a<PThread.unusedWorkers.length;++a)c=PThread.unusedWorkers[a],WEBINA_assert(!c.pthread),c.terminate();PThread.unusedWorkers=[];for(a=0;a<PThread.runningWorkers.length;++a)c=PThread.runningWorkers[a],b=c.pthread,WEBINA_assert(b,"This Worker should have a pthread it is executing"),PThread.freeThreadData(b),c.terminate();PThread.runningWorkers=[]},freeThreadData:function(a){if(a){if(a.threadInfoStruct){var b=HEAP32[a.threadInfoStruct+116>>2];HEAP32[a.threadInfoStruct+
116>>2]=0;_free(b);_free(a.threadInfoStruct)}a.threadInfoStruct=0;a.allocatedOwnStack&&a.stackBase&&_free(a.stackBase);a.stackBase=0;a.worker&&(a.worker.pthread=null)}},returnWorkerToPool:function(a){delete PThread.pthreads[a.pthread.thread];PThread.unusedWorkers.push(a);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(a),1);PThread.freeThreadData(a.pthread);a.pthread=void 0},receiveObjectTransfer:function(a){},allocateUnusedWorkers:function(a,b){if("undefined"!==typeof SharedArrayBuffer){var c=
[],d=a;if(0<PThread.preallocatedWorkers.length){var e=Math.min(PThread.preallocatedWorkers.length,a);c=c.concat(PThread.preallocatedWorkers.splice(0,e));d-=e}0<d&&(c=c.concat(PThread.createNewWorkers(d)));PThread.attachListenerToWorkers(c,b);for(b=0;b<a;++b)d=c[b],e=getMemory(8),d.postMessage({cmd:"load",urlOrBlob:WEBINA_Module.mainScriptUrlOrBlob||_scriptDir,wasmMemory:wasmMemory,wasmModule:wasmModule,tempDoublePtr:e,DYNAMIC_BASE:DYNAMIC_BASE,DYNAMICTOP_PTR:DYNAMICTOP_PTR,PthreadWorkerInit:PthreadWorkerInit}),
PThread.unusedWorkers.push(d)}},attachListenerToWorkers:function(a,b){for(var c=0,d=a.length,e=0;e<d;++e)(function(a){a.onmessage=function(e){var f=e.data;a.pthread&&(PThread.currentProxiedOperationCallerThread=a.pthread.threadInfoStruct);if(f.targetThread&&f.targetThread!=_pthread_self()){var g=PThread.pthreads[f.targetThread];g?g.worker.postMessage(e.data,f.transferList):console.error('Internal error! Worker sent a message "'+f.cmd+'" to target pthread '+f.targetThread+", but that thread no longer exists!")}else if("processQueuedMainThreadWork"===
f.cmd)_emscripten_main_thread_process_queued_calls();else if("spawnThread"===f.cmd)__spawn_thread(e.data);else if("cleanupThread"===f.cmd)__cleanup_thread(f.thread);else if("killThread"===f.cmd)__kill_thread(f.thread);else if("cancelThread"===f.cmd)__cancel_thread(f.thread);else if("loaded"===f.cmd)a.loaded=!0,a.runPthread&&(a.runPthread(),delete a.runPthread),++c,c===d&&b&&b();else if("print"===f.cmd)out("Thread "+f.threadId+": "+f.text);else if("printErr"===f.cmd)err("Thread "+f.threadId+": "+f.text);
else if("alert"===f.cmd)alert("Thread "+f.threadId+": "+f.text);else if("exit"===f.cmd)a.pthread&&Atomics.load(HEAPU32,a.pthread.thread+80>>2)&&PThread.returnWorkerToPool(a);else if("exitProcess"===f.cmd){noExitRuntime=!1;try{exit(f.returnCode)}catch(h){if(h instanceof ExitStatus)return;throw h;}}else"cancelDone"===f.cmd?PThread.returnWorkerToPool(a):"objectTransfer"===f.cmd?PThread.receiveObjectTransfer(e.data):"setimmediate"===e.data.target?a.postMessage(e.data):err("worker sent an unknown command "+
f.cmd);PThread.currentProxiedOperationCallerThread=void 0};a.onerror=function(a){err("pthread sent an error! "+a.filename+":"+a.lineno+": "+a.message)}})(a[e])},createNewWorkers:function(a){if("undefined"===typeof SharedArrayBuffer)return[];var b=locateFile("vina.worker.min.js");for(var c=[],d=0;d<a;++d)c.push(new Worker(b));return c},getNewWorker:function(){0==PThread.unusedWorkers.length&&PThread.allocateUnusedWorkers(1);return 0<PThread.unusedWorkers.length?PThread.unusedWorkers.pop():null},busySpinWait:function(a){for(a=
performance.now()+a;performance.now()<a;);}};function ___call_main(a,b){a=_main(a,b);noExitRuntime||postMessage({cmd:"exitProcess",returnCode:a});return a}function _emscripten_get_now(){abort()}function ___setErrNo(a){WEBINA_Module.___errno_location?HEAP32[WEBINA_Module.___errno_location()>>2]=a:err("failed to set errno from JS");return a}function ___cxa_allocate_exception(a){return _malloc(a)}var ___exception_infos={},___exception_last=0;
function ___cxa_throw(a,b,c){___exception_infos[a]={ptr:a,adjusted:[a],type:b,destructor:c,refcount:0,caught:!1,rethrown:!1};___exception_last=a;"uncaught_exception"in __ZSt18uncaught_exceptionv?__ZSt18uncaught_exceptionv.uncaught_exceptions++:__ZSt18uncaught_exceptionv.uncaught_exceptions=1;throw a+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.";}function ___lock(){}
function ___map_file(a,b){___setErrNo(63);return-1}
var PATH={splitPath:function(a){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1)},normalizeArray:function(a,b){for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},normalize:function(a){var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=PATH.normalizeArray(a.split("/").filter(function(a){return!!a}),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+
a},dirname:function(a){var b=PATH.splitPath(a);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b},basename:function(a){if("/"===a)return"/";var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)},extname:function(a){return PATH.splitPath(a)[3]},join:function(){var a=Array.prototype.slice.call(arguments,0);return PATH.normalize(a.join("/"))},join2:function(a,b){return PATH.normalize(a+"/"+b)}},PATH_FS={resolve:function(){for(var a="",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=
0<=c?arguments[c]:FS.cwd();if("string"!==typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=PATH.normalizeArray(a.split("/").filter(function(a){return!!a}),!b).join("/");return(b?"/":"")+a||"."},relative:function(a,b){function c(a){for(var b=0;b<a.length&&""===a[b];b++);for(var c=a.length-1;0<=c&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=PATH_FS.resolve(a).substr(1);b=PATH_FS.resolve(b).substr(1);a=c(a.split("/"));b=c(b.split("/"));
for(var d=Math.min(a.length,b.length),e=d,f=0;f<d;f++)if(a[f]!==b[f]){e=f;break}d=[];for(f=e;f<a.length;f++)d.push("..");d=d.concat(b.slice(e));return d.join("/")}},TTY={ttys:[],init:function(){},shutdown:function(){},register:function(a,b){TTY.ttys[a]={input:[],output:[],ops:b};FS.registerDevice(a,TTY.stream_ops)},stream_ops:{open:function(a){var b=TTY.ttys[a.node.rdev];b||WEBINA_Module.catchError(new FS.ErrnoError(43));a.tty=b;a.seekable=!1},close:function(a){a.tty.ops.flush(a.tty)},flush:function(a){a.tty.ops.flush(a.tty)},
read:function(a,b,c,d,e){a.tty&&a.tty.ops.get_char||WEBINA_Module.catchError(new FS.ErrnoError(60));for(var f=e=0;f<d;f++){try{var g=a.tty.ops.get_char(a.tty)}catch(k){WEBINA_Module.catchError(new FS.ErrnoError(29))}void 0===g&&0===e&&WEBINA_Module.catchError(new FS.ErrnoError(6));if(null===g||void 0===g)break;e++;b[c+f]=g}e&&(a.node.timestamp=Date.now());return e},write:function(a,b,c,d,e){a.tty&&a.tty.ops.put_char||WEBINA_Module.catchError(new FS.ErrnoError(60));try{for(e=0;e<d;e++)a.tty.ops.put_char(a.tty,
b[c+e])}catch(f){WEBINA_Module.catchError(new FS.ErrnoError(29))}d&&(a.node.timestamp=Date.now());return e}},default_tty_ops:{get_char:function(a){if(!a.input.length){var b=null;if(WEBINA_ENVIRONMENT_IS_NODE){b=Buffer.alloc?Buffer.alloc(256):new Buffer(256);var c=0;try{c=fs.readSync(process.stdin.fd,b,0,256,null)}catch(d){if(-1!=d.toString().indexOf("EOF"))c=0;else throw d;}b=0<c?b.slice(0,c).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?(b=window.prompt("Input: "),
null!==b&&(b+="\n")):"function"==typeof readline&&(b=readline(),null!==b&&(b+="\n"));if(!b)return null;a.input=intArrayFromString(b,!0)}return a.input.shift()},put_char:function(a,b){null===b||10===b?(out(UTF8ArrayToString(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(out(UTF8ArrayToString(a.output,0)),a.output=[])}},default_tty1_ops:{put_char:function(a,b){null===b||10===b?(err(UTF8ArrayToString(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},
flush:function(a){a.output&&0<a.output.length&&(err(UTF8ArrayToString(a.output,0)),a.output=[])}}},MEMFS={ops_table:null,mount:function(a){return MEMFS.createNode(null,"/",16895,0)},createNode:function(a,b,c,d){(FS.isBlkdev(c)||FS.isFIFO(c))&&WEBINA_Module.catchError(new FS.ErrnoError(63));MEMFS.ops_table||(MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,
rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},
stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}});c=FS.createNode(a,b,c,d);FS.isDir(c.mode)?(c.node_ops=MEMFS.ops_table.dir.node,c.stream_ops=MEMFS.ops_table.dir.stream,c.contents={}):FS.isFile(c.mode)?(c.node_ops=MEMFS.ops_table.file.node,c.stream_ops=MEMFS.ops_table.file.stream,c.usedBytes=0,c.contents=null):FS.isLink(c.mode)?(c.node_ops=MEMFS.ops_table.link.node,c.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(c.mode)&&(c.node_ops=
MEMFS.ops_table.chrdev.node,c.stream_ops=MEMFS.ops_table.chrdev.stream);c.timestamp=Date.now();a&&(a.contents[b]=c);return c},getFileDataAsRegularArray:function(a){if(a.contents&&a.contents.subarray){for(var b=[],c=0;c<a.usedBytes;++c)b.push(a.contents[c]);return b}return a.contents},getFileDataAsTypedArray:function(a){return a.contents?a.contents.subarray?a.contents.subarray(0,a.usedBytes):new Uint8Array(a.contents):new Uint8Array},expandFileStorage:function(a,b){var c=a.contents?a.contents.length:
0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)|0),0!=c&&(b=Math.max(b,256)),c=a.contents,a.contents=new Uint8Array(b),0<a.usedBytes&&a.contents.set(c.subarray(0,a.usedBytes),0))},resizeFileStorage:function(a,b){if(a.usedBytes!=b)if(0==b)a.contents=null,a.usedBytes=0;else{if(!a.contents||a.contents.subarray){var c=a.contents;a.contents=new Uint8Array(new ArrayBuffer(b));c&&a.contents.set(c.subarray(0,Math.min(b,a.usedBytes)))}else if(a.contents||(a.contents=[]),a.contents.length>b)a.contents.length=b;
else for(;a.contents.length<b;)a.contents.push(0);a.usedBytes=b}},node_ops:{getattr:function(a){var b={};b.dev=FS.isChrdev(a.mode)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=1;b.uid=0;b.gid=0;b.rdev=a.rdev;FS.isDir(a.mode)?b.size=4096:FS.isFile(a.mode)?b.size=a.usedBytes:FS.isLink(a.mode)?b.size=a.link.length:b.size=0;b.atime=new Date(a.timestamp);b.mtime=new Date(a.timestamp);b.ctime=new Date(a.timestamp);b.blksize=4096;b.blocks=Math.ceil(b.size/b.blksize);return b},setattr:function(a,b){void 0!==b.mode&&
(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp);void 0!==b.size&&MEMFS.resizeFileStorage(a,b.size)},lookup:function(a,b){throw FS.genericErrors[44];},mknod:function(a,b,c,d){return MEMFS.createNode(a,b,c,d)},rename:function(a,b,c){if(FS.isDir(a.mode)){try{var d=FS.lookupNode(b,c)}catch(f){}if(d)for(var e in d.contents)WEBINA_Module.catchError(new FS.ErrnoError(55))}delete a.parent.contents[a.name];a.name=c;b.contents[c]=a;a.parent=b},unlink:function(a,b){delete a.contents[b]},rmdir:function(a,
b){var c=FS.lookupNode(a,b),d;for(d in c.contents)WEBINA_Module.catchError(new FS.ErrnoError(55));delete a.contents[b]},readdir:function(a){var b=[".",".."],c;for(c in a.contents)a.contents.hasOwnProperty(c)&&b.push(c);return b},symlink:function(a,b,c){a=MEMFS.createNode(a,b,41471,0);a.link=c;return a},readlink:function(a){FS.isLink(a.mode)||WEBINA_Module.catchError(new FS.ErrnoError(28));return a.link}},stream_ops:{read:function(a,b,c,d,e){var f=a.node.contents;if(e>=a.node.usedBytes)return 0;a=
Math.min(a.node.usedBytes-e,d);WEBINA_assert(0<=a);if(8<a&&f.subarray)b.set(f.subarray(e,e+a),c);else for(d=0;d<a;d++)b[c+d]=f[e+d];return a},write:function(a,b,c,d,e,f){if(!d)return 0;a=a.node;a.timestamp=Date.now();if(b.subarray&&(!a.contents||a.contents.subarray)){if(f)return WEBINA_assert(0===e,"canOwn must imply no weird position inside the file"),a.contents=b.subarray(c,c+d),a.usedBytes=d;if(0===a.usedBytes&&0===e)return a.contents=new Uint8Array(b.subarray(c,c+d)),a.usedBytes=d;if(e+d<=a.usedBytes)return a.contents.set(b.subarray(c,
c+d),e),d}MEMFS.expandFileStorage(a,e+d);if(a.contents.subarray&&b.subarray)a.contents.set(b.subarray(c,c+d),e);else for(f=0;f<d;f++)a.contents[e+f]=b[c+f];a.usedBytes=Math.max(a.usedBytes,e+d);return d},llseek:function(a,b,c){1===c?b+=a.position:2===c&&FS.isFile(a.node.mode)&&(b+=a.node.usedBytes);0>b&&WEBINA_Module.catchError(new FS.ErrnoError(28));return b},allocate:function(a,b,c){MEMFS.expandFileStorage(a.node,b+c);a.node.usedBytes=Math.max(a.node.usedBytes,b+c)},mmap:function(a,b,c,d,e,f,g){FS.isFile(a.node.mode)||
WEBINA_Module.catchError(new FS.ErrnoError(43));c=a.node.contents;if(g&2||c.buffer!==b&&c.buffer!==b.buffer){if(0<e||e+d<a.node.usedBytes)c=c.subarray?c.subarray(e,e+d):Array.prototype.slice.call(c,e,e+d);a=!0;e=b.buffer==HEAP8.buffer;(d=_malloc(d))||WEBINA_Module.catchError(new FS.ErrnoError(48));(e?HEAP8:b).set(c,d)}else a=!1,d=c.byteOffset;return{ptr:d,allocated:a}},msync:function(a,b,c,d,e){FS.isFile(a.node.mode)||WEBINA_Module.catchError(new FS.ErrnoError(43));if(e&2)return 0;MEMFS.stream_ops.write(a,
b,0,d,c,!1);return 0}}},IDBFS={dbs:{},indexedDB:function(){if("undefined"!==typeof indexedDB)return indexedDB;var a=null;"object"===typeof window&&(a=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB);WEBINA_assert(a,"IDBFS used, but indexedDB not supported");return a},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:function(a){return MEMFS.mount.apply(null,arguments)},syncfs:function(a,b,c){IDBFS.getLocalSet(a,function(d,e){if(d)return c(d);IDBFS.getRemoteSet(a,function(a,
d){if(a)return c(a);IDBFS.reconcile(b?d:e,b?e:d,c)})})},getDB:function(a,b){var c=IDBFS.dbs[a];if(c)return b(null,c);try{var d=IDBFS.indexedDB().open(a,IDBFS.DB_VERSION)}catch(e){return b(e)}if(!d)return b("Unable to connect to IndexedDB");d.onupgradeneeded=function(a){var b=a.target.result;a=a.target.transaction;b=b.objectStoreNames.contains(IDBFS.DB_STORE_NAME)?a.objectStore(IDBFS.DB_STORE_NAME):b.createObjectStore(IDBFS.DB_STORE_NAME);b.indexNames.contains("timestamp")||b.createIndex("timestamp",
"timestamp",{unique:!1})};d.onsuccess=function(){c=d.result;IDBFS.dbs[a]=c;b(null,c)};d.onerror=function(a){b(this.error);a.preventDefault()}},getLocalSet:function(a,b){function c(a){return"."!==a&&".."!==a}function d(a){return function(b){return PATH.join2(a,b)}}var e={};for(a=FS.readdir(a.mountpoint).filter(c).map(d(a.mountpoint));a.length;){var f=a.pop();try{var g=FS.stat(f)}catch(k){return b(k)}FS.isDir(g.mode)&&a.push.apply(a,FS.readdir(f).filter(c).map(d(f)));e[f]={timestamp:g.mtime}}return b(null,
{type:"local",entries:e})},getRemoteSet:function(a,b){var c={};IDBFS.getDB(a.mountpoint,function(a,e){if(a)return b(a);try{var d=e.transaction([IDBFS.DB_STORE_NAME],"readonly");d.onerror=function(a){b(this.error);a.preventDefault()};d.objectStore(IDBFS.DB_STORE_NAME).index("timestamp").openKeyCursor().onsuccess=function(a){a=a.target.result;if(!a)return b(null,{type:"remote",db:e,entries:c});c[a.primaryKey]={timestamp:a.key};a.continue()}}catch(g){return b(g)}})},loadLocalEntry:function(a,b){try{var c=
FS.lookupPath(a).node;var d=FS.stat(a)}catch(e){return b(e)}return FS.isDir(d.mode)?b(null,{timestamp:d.mtime,mode:d.mode}):FS.isFile(d.mode)?(c.contents=MEMFS.getFileDataAsTypedArray(c),b(null,{timestamp:d.mtime,mode:d.mode,contents:c.contents})):b(Error("node type not supported"))},storeLocalEntry:function(a,b,c){try{if(FS.isDir(b.mode))FS.mkdir(a,b.mode);else if(FS.isFile(b.mode))FS.writeFile(a,b.contents,{canOwn:!0});else return c(Error("node type not supported"));FS.chmod(a,b.mode);FS.utime(a,
b.timestamp,b.timestamp)}catch(d){return c(d)}c(null)},removeLocalEntry:function(a,b){try{FS.lookupPath(a);var c=FS.stat(a);FS.isDir(c.mode)?FS.rmdir(a):FS.isFile(c.mode)&&FS.unlink(a)}catch(d){return b(d)}b(null)},loadRemoteEntry:function(a,b,c){a=a.get(b);a.onsuccess=function(a){c(null,a.target.result)};a.onerror=function(a){c(this.error);a.preventDefault()}},storeRemoteEntry:function(a,b,c,d){a=a.put(c,b);a.onsuccess=function(){d(null)};a.onerror=function(a){d(this.error);a.preventDefault()}},
removeRemoteEntry:function(a,b,c){a=a.delete(b);a.onsuccess=function(){c(null)};a.onerror=function(a){c(this.error);a.preventDefault()}},reconcile:function(a,b,c){function d(a){if(a&&!k)return k=!0,c(a)}var e=0,f=[];Object.keys(a.entries).forEach(function(c){var d=a.entries[c],g=b.entries[c];if(!g||d.timestamp>g.timestamp)f.push(c),e++});var g=[];Object.keys(b.entries).forEach(function(b){a.entries[b]||(g.push(b),e++)});if(!e)return c(null);var k=!1,l=("remote"===a.type?a.db:b.db).transaction([IDBFS.DB_STORE_NAME],
"readwrite"),h=l.objectStore(IDBFS.DB_STORE_NAME);l.onerror=function(a){d(this.error);a.preventDefault()};l.oncomplete=function(a){k||c(null)};f.sort().forEach(function(a){"local"===b.type?IDBFS.loadRemoteEntry(h,a,function(b,c){if(b)return d(b);IDBFS.storeLocalEntry(a,c,d)}):IDBFS.loadLocalEntry(a,function(b,c){if(b)return d(b);IDBFS.storeRemoteEntry(h,a,c,d)})});g.sort().reverse().forEach(function(a){"local"===b.type?IDBFS.removeLocalEntry(a,d):IDBFS.removeRemoteEntry(h,a,d)})}},NODEFS={isWindows:!1,
staticInit:function(){NODEFS.isWindows=!!process.platform.match(/^win/);var a=process.binding("constants");a.fs&&(a=a.fs);NODEFS.flagsForNodeMap={1024:a.O_APPEND,64:a.O_CREAT,128:a.O_EXCL,0:a.O_RDONLY,2:a.O_RDWR,4096:a.O_SYNC,512:a.O_TRUNC,1:a.O_WRONLY}},bufferFrom:function(a){return Buffer.alloc?Buffer.from(a):new Buffer(a)},convertNodeCode:function(a){a=a.code;WEBINA_assert(a in ERRNO_CODES);return ERRNO_CODES[a]},mount:function(a){WEBINA_assert(ENVIRONMENT_HAS_NODE);return NODEFS.createNode(null,
"/",NODEFS.getMode(a.opts.root),0)},createNode:function(a,b,c,d){FS.isDir(c)||FS.isFile(c)||FS.isLink(c)||WEBINA_Module.catchError(new FS.ErrnoError(28));a=FS.createNode(a,b,c);a.node_ops=NODEFS.node_ops;a.stream_ops=NODEFS.stream_ops;return a},getMode:function(a){try{var b=fs.lstatSync(a);NODEFS.isWindows&&(b.mode|=(b.mode&292)>>2)}catch(c){if(!c.code)throw c;WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(c)))}return b.mode},realPath:function(a){for(var b=[];a.parent!==a;)b.push(a.name),
a=a.parent;b.push(a.mount.opts.root);b.reverse();return PATH.join.apply(null,b)},flagsForNode:function(a){a&=-2656257;var b=0,c;for(c in NODEFS.flagsForNodeMap)a&c&&(b|=NODEFS.flagsForNodeMap[c],a^=c);if(a)WEBINA_Module.catchError(new FS.ErrnoError(28));else return b},node_ops:{getattr:function(a){a=NODEFS.realPath(a);try{var b=fs.lstatSync(a)}catch(c){if(!c.code)throw c;WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(c)))}NODEFS.isWindows&&!b.blksize&&(b.blksize=4096);NODEFS.isWindows&&
!b.blocks&&(b.blocks=(b.size+b.blksize-1)/b.blksize|0);return{dev:b.dev,ino:b.ino,mode:b.mode,nlink:b.nlink,uid:b.uid,gid:b.gid,rdev:b.rdev,size:b.size,atime:b.atime,mtime:b.mtime,ctime:b.ctime,blksize:b.blksize,blocks:b.blocks}},setattr:function(a,b){var c=NODEFS.realPath(a);try{void 0!==b.mode&&(fs.chmodSync(c,b.mode),a.mode=b.mode);if(void 0!==b.timestamp){var d=new Date(b.timestamp);fs.utimesSync(c,d,d)}void 0!==b.size&&fs.truncateSync(c,b.size)}catch(e){if(!e.code)throw e;WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(e)))}},
lookup:function(a,b){var c=PATH.join2(NODEFS.realPath(a),b);c=NODEFS.getMode(c);return NODEFS.createNode(a,b,c)},mknod:function(a,b,c,d){a=NODEFS.createNode(a,b,c,d);b=NODEFS.realPath(a);try{FS.isDir(a.mode)?fs.mkdirSync(b,a.mode):fs.writeFileSync(b,"",{mode:a.mode})}catch(e){if(!e.code)throw e;WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(e)))}return a},rename:function(a,b,c){a=NODEFS.realPath(a);b=PATH.join2(NODEFS.realPath(b),c);try{fs.renameSync(a,b)}catch(d){if(!d.code)throw d;
WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(d)))}},unlink:function(a,b){a=PATH.join2(NODEFS.realPath(a),b);try{fs.unlinkSync(a)}catch(c){if(!c.code)throw c;WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(c)))}},rmdir:function(a,b){a=PATH.join2(NODEFS.realPath(a),b);try{fs.rmdirSync(a)}catch(c){if(!c.code)throw c;WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(c)))}},readdir:function(a){a=NODEFS.realPath(a);try{return fs.readdirSync(a)}catch(b){if(!b.code)throw b;
WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(b)))}},symlink:function(a,b,c){a=PATH.join2(NODEFS.realPath(a),b);try{fs.symlinkSync(c,a)}catch(d){if(!d.code)throw d;WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(d)))}},readlink:function(a){var b=NODEFS.realPath(a);try{return b=fs.readlinkSync(b),b=NODEJS_PATH.relative(NODEJS_PATH.resolve(a.mount.opts.root),b)}catch(c){if(!c.code)throw c;WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(c)))}}},
stream_ops:{open:function(a){var b=NODEFS.realPath(a.node);try{FS.isFile(a.node.mode)&&(a.nfd=fs.openSync(b,NODEFS.flagsForNode(a.flags)))}catch(c){if(!c.code)throw c;WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(c)))}},close:function(a){try{FS.isFile(a.node.mode)&&a.nfd&&fs.closeSync(a.nfd)}catch(b){if(!b.code)throw b;WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(b)))}},read:function(a,b,c,d,e){if(0===d)return 0;try{return fs.readSync(a.nfd,NODEFS.bufferFrom(b.buffer),
c,d,e)}catch(f){WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(f)))}},write:function(a,b,c,d,e){try{return fs.writeSync(a.nfd,NODEFS.bufferFrom(b.buffer),c,d,e)}catch(f){WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(f)))}},llseek:function(a,b,c){if(1===c)b+=a.position;else if(2===c&&FS.isFile(a.node.mode))try{var d=fs.fstatSync(a.nfd);b+=d.size}catch(e){WEBINA_Module.catchError(new FS.ErrnoError(NODEFS.convertNodeCode(e)))}0>b&&WEBINA_Module.catchError(new FS.ErrnoError(28));
return b}}},WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:function(a){function b(a){a=a.split("/");for(var b=d,c=0;c<a.length-1;c++){var f=a.slice(0,c+1).join("/");e[f]||(e[f]=WORKERFS.createNode(b,a[c],WORKERFS.DIR_MODE,0));b=e[f]}return b}function c(a){a=a.split("/");return a[a.length-1]}WEBINA_assert(ENVIRONMENT_IS_WORKER);WORKERFS.reader||(WORKERFS.reader=new FileReaderSync);var d=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0),e={};Array.prototype.forEach.call(a.opts.files||[],
function(a){WORKERFS.createNode(b(a.name),c(a.name),WORKERFS.FILE_MODE,0,a,a.lastModifiedDate)});(a.opts.blobs||[]).forEach(function(a){WORKERFS.createNode(b(a.name),c(a.name),WORKERFS.FILE_MODE,0,a.data)});(a.opts.packages||[]).forEach(function(a){a.metadata.files.forEach(function(d){var e=d.filename.substr(1);WORKERFS.createNode(b(e),c(e),WORKERFS.FILE_MODE,0,a.blob.slice(d.start,d.end))})});return d},createNode:function(a,b,c,d,e,f){d=FS.createNode(a,b,c);d.mode=c;d.node_ops=WORKERFS.node_ops;
d.stream_ops=WORKERFS.stream_ops;d.timestamp=(f||new Date).getTime();WEBINA_assert(WORKERFS.FILE_MODE!==WORKERFS.DIR_MODE);c===WORKERFS.FILE_MODE?(d.size=e.size,d.contents=e):(d.size=4096,d.contents={});a&&(a.contents[b]=d);return d},node_ops:{getattr:function(a){return{dev:1,ino:void 0,mode:a.mode,nlink:1,uid:0,gid:0,rdev:void 0,size:a.size,atime:new Date(a.timestamp),mtime:new Date(a.timestamp),ctime:new Date(a.timestamp),blksize:4096,blocks:Math.ceil(a.size/4096)}},setattr:function(a,b){void 0!==
b.mode&&(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp)},lookup:function(a,b){WEBINA_Module.catchError(new FS.ErrnoError(44))},mknod:function(a,b,c,d){WEBINA_Module.catchError(new FS.ErrnoError(63))},rename:function(a,b,c){WEBINA_Module.catchError(new FS.ErrnoError(63))},unlink:function(a,b){WEBINA_Module.catchError(new FS.ErrnoError(63))},rmdir:function(a,b){WEBINA_Module.catchError(new FS.ErrnoError(63))},readdir:function(a){var b=[".",".."],c;for(c in a.contents)a.contents.hasOwnProperty(c)&&
b.push(c);return b},symlink:function(a,b,c){WEBINA_Module.catchError(new FS.ErrnoError(63))},readlink:function(a){WEBINA_Module.catchError(new FS.ErrnoError(63))}},stream_ops:{read:function(a,b,c,d,e){if(e>=a.node.size)return 0;a=a.node.contents.slice(e,e+d);d=WORKERFS.reader.readAsArrayBuffer(a);b.set(new Uint8Array(d),c);return a.size},write:function(a,b,c,d,e){WEBINA_Module.catchError(new FS.ErrnoError(29))},llseek:function(a,b,c){1===c?b+=a.position:2===c&&FS.isFile(a.node.mode)&&(b+=a.node.size);
0>b&&WEBINA_Module.catchError(new FS.ErrnoError(28));return b}}},ERRNO_MESSAGES={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",
17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",
38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",
56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",
101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",
120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",
137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(a){if(!(a instanceof
FS.ErrnoError))throw a+" : "+stackTrace();return ___setErrNo(a.errno)},lookupPath:function(a,b){a=PATH_FS.resolve(FS.cwd(),a);b=b||{};if(!a)return{path:"",node:null};var c={follow_mount:!0,recurse_count:0},d;for(d in c)void 0===b[d]&&(b[d]=c[d]);8<b.recurse_count&&WEBINA_Module.catchError(new FS.ErrnoError(32));a=PATH.normalizeArray(a.split("/").filter(function(a){return!!a}),!1);var e=FS.root;c="/";for(d=0;d<a.length;d++){var f=d===a.length-1;if(f&&b.parent)break;e=FS.lookupNode(e,a[d]);c=PATH.join2(c,
a[d]);FS.isMountpoint(e)&&(!f||f&&b.follow_mount)&&(e=e.mounted.root);if(!f||b.follow)for(f=0;FS.isLink(e.mode);)e=FS.readlink(c),c=PATH_FS.resolve(PATH.dirname(c),e),e=FS.lookupPath(c,{recurse_count:b.recurse_count}).node,40<f++&&WEBINA_Module.catchError(new FS.ErrnoError(32))}return{path:c,node:e}},getPath:function(a){for(var b;;){if(FS.isRoot(a))return a=a.mount.mountpoint,b?"/"!==a[a.length-1]?a+"/"+b:a+b:a;b=b?a.name+"/"+b:a.name;a=a.parent}},hashName:function(a,b){for(var c=0,d=0;d<b.length;d++)c=
(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%FS.nameTable.length},hashAddNode:function(a){var b=FS.hashName(a.parent.id,a.name);a.name_next=FS.nameTable[b];FS.nameTable[b]=a},hashRemoveNode:function(a){var b=FS.hashName(a.parent.id,a.name);if(FS.nameTable[b]===a)FS.nameTable[b]=a.name_next;else for(b=FS.nameTable[b];b;){if(b.name_next===a){b.name_next=a.name_next;break}b=b.name_next}},lookupNode:function(a,b){var c=FS.mayLookup(a);c&&WEBINA_Module.catchError(new FS.ErrnoError(c,a));c=FS.hashName(a.id,
b);for(c=FS.nameTable[c];c;c=c.name_next){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return FS.lookup(a,b)},createNode:function(a,b,c,d){FS.FSNode||(FS.FSNode=function(a,b,c,d){a||(a=this);this.parent=a;this.mount=a.mount;this.mounted=null;this.id=FS.nextInode++;this.name=b;this.mode=c;this.node_ops={};this.stream_ops={};this.rdev=d},FS.FSNode.prototype={},Object.defineProperties(FS.FSNode.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=
-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}}));a=new FS.FSNode(a,b,c,d);FS.hashAddNode(a);return a},destroyNode:function(a){FS.hashRemoveNode(a)},isRoot:function(a){return a===a.parent},isMountpoint:function(a){return!!a.mounted},isFile:function(a){return 32768===(a&61440)},isDir:function(a){return 16384===(a&61440)},isLink:function(a){return 40960===
(a&61440)},isChrdev:function(a){return 8192===(a&61440)},isBlkdev:function(a){return 24576===(a&61440)},isFIFO:function(a){return 4096===(a&61440)},isSocket:function(a){return 49152===(a&49152)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(a){var b=FS.flagModes[a];if("undefined"===typeof b)throw Error("Unknown file open mode: "+a);return b},flagsToPermissionString:function(a){var b=
["r","w","rw"][a&3];a&512&&(b+="w");return b},nodePermissions:function(a,b){if(FS.ignorePermissions)return 0;if(-1===b.indexOf("r")||a.mode&292){if(-1!==b.indexOf("w")&&!(a.mode&146)||-1!==b.indexOf("x")&&!(a.mode&73))return 2}else return 2;return 0},mayLookup:function(a){var b=FS.nodePermissions(a,"x");return b?b:a.node_ops.lookup?0:2},mayCreate:function(a,b){try{return FS.lookupNode(a,b),20}catch(c){}return FS.nodePermissions(a,"wx")},mayDelete:function(a,b,c){try{var d=FS.lookupNode(a,b)}catch(e){return e.errno}if(a=
FS.nodePermissions(a,"wx"))return a;if(c){if(!FS.isDir(d.mode))return 54;if(FS.isRoot(d)||FS.getPath(d)===FS.cwd())return 10}else if(FS.isDir(d.mode))return 31;return 0},mayOpen:function(a,b){return a?FS.isLink(a.mode)?32:FS.isDir(a.mode)&&("r"!==FS.flagsToPermissionString(b)||b&512)?31:FS.nodePermissions(a,FS.flagsToPermissionString(b)):44},MAX_OPEN_FDS:4096,nextfd:function(a,b){b=b||FS.MAX_OPEN_FDS;for(a=a||0;a<=b;a++)if(!FS.streams[a])return a;WEBINA_Module.catchError(new FS.ErrnoError(33))},getStream:function(a){return FS.streams[a]},
createStream:function(a,b,c){FS.FSStream||(FS.FSStream=function(){},FS.FSStream.prototype={},Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(a){this.node=a}},isRead:{get:function(){return 1!==(this.flags&2097155)}},isWrite:{get:function(){return 0!==(this.flags&2097155)}},isAppend:{get:function(){return this.flags&1024}}}));var d=new FS.FSStream,e;for(e in a)d[e]=a[e];a=d;b=FS.nextfd(b,c);a.fd=b;return FS.streams[b]=a},closeStream:function(a){FS.streams[a]=
null},chrdev_stream_ops:{open:function(a){var b=FS.getDevice(a.node.rdev);a.stream_ops=b.stream_ops;a.stream_ops.open&&a.stream_ops.open(a)},llseek:function(){WEBINA_Module.catchError(new FS.ErrnoError(70))}},major:function(a){return a>>8},minor:function(a){return a&255},makedev:function(a,b){return a<<8|b},registerDevice:function(a,b){FS.devices[a]={stream_ops:b}},getDevice:function(a){return FS.devices[a]},getMounts:function(a){var b=[];for(a=[a];a.length;){var c=a.pop();b.push(c);a.push.apply(a,
c.mounts)}return b},syncfs:function(a,b){function c(a){WEBINA_assert(0<FS.syncFSRequests);FS.syncFSRequests--;return b(a)}function d(a){if(a){if(!d.errored)return d.errored=!0,c(a)}else++f>=e.length&&c(null)}"function"===typeof a&&(b=a,a=!1);FS.syncFSRequests++;1<FS.syncFSRequests&&console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var e=FS.getMounts(FS.root.mount),f=0;e.forEach(function(b){if(!b.type.syncfs)return d(null);b.type.syncfs(b,
a,d)})},mount:function(a,b,c){var d="/"===c,e=!c;if(d&&FS.root)WEBINA_Module.catchError(new FS.ErrnoError(10));else if(!d&&!e){var f=FS.lookupPath(c,{follow_mount:!1});c=f.path;f=f.node;FS.isMountpoint(f)&&WEBINA_Module.catchError(new FS.ErrnoError(10));FS.isDir(f.mode)||WEBINA_Module.catchError(new FS.ErrnoError(54))}b={type:a,opts:b,mountpoint:c,mounts:[]};a=a.mount(b);a.mount=b;b.root=a;d?FS.root=a:f&&(f.mounted=b,f.mount&&f.mount.mounts.push(b));return a},unmount:function(a){a=FS.lookupPath(a,
{follow_mount:!1});FS.isMountpoint(a.node)||WEBINA_Module.catchError(new FS.ErrnoError(28));a=a.node;var b=a.mounted,c=FS.getMounts(b);Object.keys(FS.nameTable).forEach(function(a){for(a=FS.nameTable[a];a;){var b=a.name_next;-1!==c.indexOf(a.mount)&&FS.destroyNode(a);a=b}});a.mounted=null;b=a.mount.mounts.indexOf(b);WEBINA_assert(-1!==b);a.mount.mounts.splice(b,1)},lookup:function(a,b){return a.node_ops.lookup(a,b)},mknod:function(a,b,c){var d=FS.lookupPath(a,{parent:!0}).node;(a=PATH.basename(a))&&
"."!==a&&".."!==a||WEBINA_Module.catchError(new FS.ErrnoError(28));var e=FS.mayCreate(d,a);e&&WEBINA_Module.catchError(new FS.ErrnoError(e));d.node_ops.mknod||WEBINA_Module.catchError(new FS.ErrnoError(63));return d.node_ops.mknod(d,a,b,c)},create:function(a,b){return FS.mknod(a,(void 0!==b?b:438)&4095|32768,0)},mkdir:function(a,b){return FS.mknod(a,(void 0!==b?b:511)&1023|16384,0)},mkdirTree:function(a,b){a=a.split("/");for(var c="",d=0;d<a.length;++d)if(a[d]){c+="/"+a[d];try{FS.mkdir(c,b)}catch(e){if(20!=
e.errno)throw e;}}},mkdev:function(a,b,c){"undefined"===typeof c&&(c=b,b=438);return FS.mknod(a,b|8192,c)},symlink:function(a,b){PATH_FS.resolve(a)||WEBINA_Module.catchError(new FS.ErrnoError(44));var c=FS.lookupPath(b,{parent:!0}).node;c||WEBINA_Module.catchError(new FS.ErrnoError(44));b=PATH.basename(b);var d=FS.mayCreate(c,b);d&&WEBINA_Module.catchError(new FS.ErrnoError(d));c.node_ops.symlink||WEBINA_Module.catchError(new FS.ErrnoError(63));return c.node_ops.symlink(c,b,a)},rename:function(a,
b){var c=PATH.dirname(a),d=PATH.dirname(b),e=PATH.basename(a),f=PATH.basename(b);try{var g=FS.lookupPath(a,{parent:!0});var k=g.node;g=FS.lookupPath(b,{parent:!0});var l=g.node}catch(m){WEBINA_Module.catchError(new FS.ErrnoError(10))}k&&l||WEBINA_Module.catchError(new FS.ErrnoError(44));k.mount!==l.mount&&WEBINA_Module.catchError(new FS.ErrnoError(75));g=FS.lookupNode(k,e);d=PATH_FS.relative(a,d);"."!==d.charAt(0)&&WEBINA_Module.catchError(new FS.ErrnoError(28));d=PATH_FS.relative(b,c);"."!==d.charAt(0)&&
WEBINA_Module.catchError(new FS.ErrnoError(55));try{var h=FS.lookupNode(l,f)}catch(m){}if(g!==h){c=FS.isDir(g.mode);(e=FS.mayDelete(k,e,c))&&WEBINA_Module.catchError(new FS.ErrnoError(e));(e=h?FS.mayDelete(l,f,c):FS.mayCreate(l,f))&&WEBINA_Module.catchError(new FS.ErrnoError(e));k.node_ops.rename||WEBINA_Module.catchError(new FS.ErrnoError(63));(FS.isMountpoint(g)||h&&FS.isMountpoint(h))&&WEBINA_Module.catchError(new FS.ErrnoError(10));l!==k&&(e=FS.nodePermissions(k,"w"))&&WEBINA_Module.catchError(new FS.ErrnoError(e));
try{FS.trackingDelegate.willMovePath&&FS.trackingDelegate.willMovePath(a,b)}catch(m){console.log("FS.trackingDelegate['willMovePath']('"+a+"', '"+b+"') threw an exception: "+m.message)}FS.hashRemoveNode(g);try{k.node_ops.rename(g,l,f)}catch(m){throw m;}finally{FS.hashAddNode(g)}try{if(FS.trackingDelegate.onMovePath)FS.trackingDelegate.onMovePath(a,b)}catch(m){console.log("FS.trackingDelegate['onMovePath']('"+a+"', '"+b+"') threw an exception: "+m.message)}}},rmdir:function(a){var b=FS.lookupPath(a,
{parent:!0}).node,c=PATH.basename(a),d=FS.lookupNode(b,c),e=FS.mayDelete(b,c,!0);e&&WEBINA_Module.catchError(new FS.ErrnoError(e));b.node_ops.rmdir||WEBINA_Module.catchError(new FS.ErrnoError(63));FS.isMountpoint(d)&&WEBINA_Module.catchError(new FS.ErrnoError(10));try{FS.trackingDelegate.willDeletePath&&FS.trackingDelegate.willDeletePath(a)}catch(f){console.log("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+f.message)}b.node_ops.rmdir(b,c);FS.destroyNode(d);try{if(FS.trackingDelegate.onDeletePath)FS.trackingDelegate.onDeletePath(a)}catch(f){console.log("FS.trackingDelegate['onDeletePath']('"+
a+"') threw an exception: "+f.message)}},readdir:function(a){a=FS.lookupPath(a,{follow:!0}).node;a.node_ops.readdir||WEBINA_Module.catchError(new FS.ErrnoError(54));return a.node_ops.readdir(a)},unlink:function(a){var b=FS.lookupPath(a,{parent:!0}).node,c=PATH.basename(a),d=FS.lookupNode(b,c),e=FS.mayDelete(b,c,!1);e&&WEBINA_Module.catchError(new FS.ErrnoError(e));b.node_ops.unlink||WEBINA_Module.catchError(new FS.ErrnoError(63));FS.isMountpoint(d)&&WEBINA_Module.catchError(new FS.ErrnoError(10));
try{FS.trackingDelegate.willDeletePath&&FS.trackingDelegate.willDeletePath(a)}catch(f){console.log("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+f.message)}b.node_ops.unlink(b,c);FS.destroyNode(d);try{if(FS.trackingDelegate.onDeletePath)FS.trackingDelegate.onDeletePath(a)}catch(f){console.log("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+f.message)}},readlink:function(a){(a=FS.lookupPath(a).node)||WEBINA_Module.catchError(new FS.ErrnoError(44));a.node_ops.readlink||
WEBINA_Module.catchError(new FS.ErrnoError(28));return PATH_FS.resolve(FS.getPath(a.parent),a.node_ops.readlink(a))},stat:function(a,b){(a=FS.lookupPath(a,{follow:!b}).node)||WEBINA_Module.catchError(new FS.ErrnoError(44));a.node_ops.getattr||WEBINA_Module.catchError(new FS.ErrnoError(63));return a.node_ops.getattr(a)},lstat:function(a){return FS.stat(a,!0)},chmod:function(a,b,c){a="string"===typeof a?FS.lookupPath(a,{follow:!c}).node:a;a.node_ops.setattr||WEBINA_Module.catchError(new FS.ErrnoError(63));