speaktome-api
Version:
JavaScript modules for Mozilla's cloud speech recognition API
1 lines • 104 kB
JavaScript
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).SpeakToMe=e()}}(function(){var define,module,exports;return function o(a,u,l){function s(r,e){if(!u[r]){if(!a[r]){var i="function"==typeof require&&require;if(!e&&i)return i(r,!0);if(f)return f(r,!0);var n=new Error("Cannot find module '"+r+"'");throw n.code="MODULE_NOT_FOUND",n}var t=u[r]={exports:{}};a[r][0].call(t.exports,function(e){return s(a[r][1][e]||e)},t,t.exports,o,a,u,l)}return u[r].exports}for(var f="function"==typeof require&&require,e=0;e<l.length;e++)s(l[e]);return s}({1:[function(e,r,i){},{}],2:[function(e,r,s){(function(t){function o(e,r){for(var i=0,n=e.length-1;0<=n;n--){var t=e[n];"."===t?e.splice(n,1):".."===t?(e.splice(n,1),i++):i&&(e.splice(n,1),i--)}if(r)for(;i--;i)e.unshift("..");return e}function a(e,r){if(e.filter)return e.filter(r);for(var i=[],n=0;n<e.length;n++)r(e[n],n,e)&&i.push(e[n]);return i}s.resolve=function(){for(var e="",r=!1,i=arguments.length-1;-1<=i&&!r;i--){var n=0<=i?arguments[i]:t.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(e=n+"/"+e,r="/"===n.charAt(0))}return(r?"/":"")+(e=o(a(e.split("/"),function(e){return!!e}),!r).join("/"))||"."},s.normalize=function(e){var r=s.isAbsolute(e),i="/"===n(e,-1);return(e=o(a(e.split("/"),function(e){return!!e}),!r).join("/"))||r||(e="."),e&&i&&(e+="/"),(r?"/":"")+e},s.isAbsolute=function(e){return"/"===e.charAt(0)},s.join=function(){var e=Array.prototype.slice.call(arguments,0);return s.normalize(a(e,function(e,r){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},s.relative=function(e,r){function i(e){for(var r=0;r<e.length&&""===e[r];r++);for(var i=e.length-1;0<=i&&""===e[i];i--);return i<r?[]:e.slice(r,i-r+1)}e=s.resolve(e).substr(1),r=s.resolve(r).substr(1);for(var n=i(e.split("/")),t=i(r.split("/")),o=Math.min(n.length,t.length),a=o,u=0;u<o;u++)if(n[u]!==t[u]){a=u;break}var l=[];for(u=a;u<n.length;u++)l.push("..");return(l=l.concat(t.slice(a))).join("/")},s.sep="/",s.delimiter=":",s.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var r=e.charCodeAt(0),i=47===r,n=-1,t=!0,o=e.length-1;1<=o;--o)if(47===(r=e.charCodeAt(o))){if(!t){n=o;break}}else t=!1;return-1===n?i?"/":".":i&&1===n?"/":e.slice(0,n)},s.basename=function(e,r){var i=function(e){"string"!=typeof e&&(e+="");var r,i=0,n=-1,t=!0;for(r=e.length-1;0<=r;--r)if(47===e.charCodeAt(r)){if(!t){i=r+1;break}}else-1===n&&(t=!1,n=r+1);return-1===n?"":e.slice(i,n)}(e);return r&&i.substr(-1*r.length)===r&&(i=i.substr(0,i.length-r.length)),i},s.extname=function(e){"string"!=typeof e&&(e+="");for(var r=-1,i=0,n=-1,t=!0,o=0,a=e.length-1;0<=a;--a){var u=e.charCodeAt(a);if(47!==u)-1===n&&(t=!1,n=a+1),46===u?-1===r?r=a:1!==o&&(o=1):-1!==r&&(o=-1);else if(!t){i=a+1;break}}return-1===r||-1===n||0===o||1===o&&r===n-1&&r===i+1?"":e.slice(r,n)};var n="b"==="ab".substr(-1)?function(e,r,i){return e.substr(r,i)}:function(e,r,i){return r<0&&(r=e.length+r),e.substr(r,i)}}).call(this,e("_process"))},{_process:3}],3:[function(e,r,i){var n,t,o=r.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function l(r){if(n===setTimeout)return setTimeout(r,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(r,0);try{return n(r,0)}catch(e){try{return n.call(null,r,0)}catch(e){return n.call(this,r,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{t="function"==typeof clearTimeout?clearTimeout:u}catch(e){t=u}}();var s,f=[],c=!1,d=-1;function _(){c&&s&&(c=!1,s.length?f=s.concat(f):d=-1,f.length&&h())}function h(){if(!c){var e=l(_);c=!0;for(var r=f.length;r;){for(s=f,f=[];++d<r;)s&&s[d].run();d=-1,r=f.length}s=null,c=!1,function(r){if(t===clearTimeout)return clearTimeout(r);if((t===u||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(r);try{t(r)}catch(e){try{return t.call(null,r)}catch(e){return t.call(this,r)}}}(e)}}function M(e,r){this.fun=e,this.array=r}function p(){}o.nextTick=function(e){var r=new Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)r[i-1]=arguments[i];f.push(new M(e,r)),1!==f.length||c||l(h)},M.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],4:[function(e,r,i){var M="audio/ogg";MediaRecorder.isTypeSupported(M)||(M="audio/webm;codecs=opus"),void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(i){var n=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return n?new Promise(function(e,r){n.call(navigator,i,e,r)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),void 0!==r&&(r.exports=function(e){var o={vad:!0,timeout:3e3,continuous:!1,serverURL:"https://speaktome-2.services.mozilla.com/",listener:null};e&&(!1===e.vad&&(o.vad=!1),e.timeout&&(o.timeout=e.timeout),e.listener&&(o.listener=e.listener));var a,u,l,s,f,r,c,i="ready",d=null;function n(n){r=n,h({state:"listening"}),a=new AudioContext,u=a.createMediaStreamSource(n),l=a.createAnalyser(),s=a.createMediaStreamDestination(),u.channelCount=1,l.channelCount=1,s.channelCount=1,u.connect(l),l.connect(s),o.vad&&(d=SpeakToMeVAD({listener:function(e){c=e,_()}}),c="",scriptprocessor=a.createScriptProcessor(2048,1,1),scriptprocessor.connect(a.destination),scriptprocessor.onaudioprocess=d.onAudioProcessingEvent,u.connect(scriptprocessor));var e={audioBitsPerSecond:16e3,mimeType:M};(f=new MediaRecorder(s.stream,e)).start(),o.vad||setTimeout(_,o.timeout),f.onstop=function(e){if(h({state:"processing"}),o.vad&&"novoice"==c||!t[0].size)h({state:"result",data:[]}),h({state:"ready"});else{var r=new Blob(t,{type:"audio/ogg; codecs=opus"});i=r,h({state:"sending"}),fetch(o.serverURL,{method:"POST",body:i}).then(function(e){return e.json()}).then(function(e){if("ok"!==e.status)throw new Error("Receive bad status:",e.status);h({state:"result",data:e.data}),h({state:"ready"})}).catch(function(e){h({state:"error",error:e}),h({state:"ready"})})}var i;t=[],n=s=l=u=a=f=null,scriptprocessor=null};var t=[];f.ondataavailable=function(e){t.push(e.data)}}function _(){"listening"==i?(r.getAudioTracks()[0].stop(),f.stop(),u.disconnect(scriptprocessor),u.disconnect(l),l.disconnect(s),scriptprocessor.disconnect(a.destination),a.close()):console.warn("stopListening(): stopping but not listening?!")}function h(e){if(i=e.state,o.listener)try{o.listener(e)}catch(e){console.error("SpeakToMe: Listener error",e)}else console.warn("SpeakToMe: You need to initialize SpeakToMe with an event listener!")}return{listen:function(){"ready"==i?navigator.mediaDevices.getUserMedia({audio:!0}).then(n).catch(function(e){h({state:"error",error:e}),h({state:"ready"})}):console.warn("Listen() called when not ready")},stop:_,setListener:function(e){o.listener=e},getmediaStream:function(){return r}}})},{}],5:[function(e,r,i){void 0!==r&&(r.exports=SpeakToMe);var n={preRun:[],postRun:[],print:function(e){console.log("[webrtc_vad.js print]",e)},printErr:function(e){console.error("[webrtc_vad.js error]",e)},canvas:void 0,setStatus:function(e){console.log("[webrtc_vad.js status] ",e)},totalDependencies:0,monitorRunDependencies:function(e){this.totalDependencies=Math.max(this.totalDependencies,e),n.setStatus(e?"Preparing... ("+(this.totalDependencies-e)+"/"+this.totalDependencies+")":"All downloads complete.")}};n.setStatus("Loading webrtc_vad..."),window.onerror=function(e){n.setStatus("Exception thrown, see JavaScript console"),n.setStatus=function(e){e&&n.printErr("[post-exception status] "+e)}},n.noInitialRun=!0,n.onRuntimeInitialized=function(){n.setStatus("Webrtc_vad and SpeakToMeVad loaded")}},{}],6:[function(_dereq_,module,exports){var Module;Module||(Module=(void 0!==Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1,nodeFS,nodePath;if(Module.ENVIRONMENT)if("WEB"===Module.ENVIRONMENT)ENVIRONMENT_IS_WEB=!0;else if("WORKER"===Module.ENVIRONMENT)ENVIRONMENT_IS_WORKER=!0;else if("NODE"===Module.ENVIRONMENT)ENVIRONMENT_IS_NODE=!0;else{if("SHELL"!==Module.ENVIRONMENT)throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");ENVIRONMENT_IS_SHELL=!0}else ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"function"==typeof _dereq_&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE)Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn),Module.read=function(e,r){nodeFS||(nodeFS=_dereq_("fs")),nodePath||(nodePath=_dereq_("path")),e=nodePath.normalize(e);var i=nodeFS.readFileSync(e);return r?i:i.toString()},Module.readBinary=function(e){var r=Module.read(e,!0);return r.buffer||(r=new Uint8Array(r)),assert(r.buffer),r},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(1<process.argv.length?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),void 0!==module&&(module.exports=Module),process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),Module.inspect=function(){return"[Emscripten Module object]"};else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var r=read(e,"binary");return assert("object"==typeof r),r},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),"function"==typeof quit&&(Module.quit=function(e,r){quit(e)});else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),r.response}),Module.readAsync=function(e,r,i){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?r(n.response):i()},n.onerror=i,n.send(null)},void 0!==arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.warn(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),void 0===Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}function globalEval(e){eval.call(null,e)}for(var key in!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.quit||(Module.quit=function(e,r){throw r}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[],moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(e){return tempRet0=e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){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("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var r=parseInt(e.substr(1));return assert(r%8==0),r/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,r){return"double"===r||"i64"===r?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},getAlignSize:function(e,r,i){return i||"i64"!=e&&"double"!=e?e?Math.min(r||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(r,8):8},dynCall:function(e,r,i){return i&&i.length?Module["dynCall_"+e].apply(null,[r].concat(i)):Module["dynCall_"+e].call(null,r)},functionPointers:[],addFunction:function(e){for(var r=0;r<Runtime.functionPointers.length;r++)if(!Runtime.functionPointers[r])return Runtime.functionPointers[r]=e,2*(1+r);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(r,i){assert(i),Runtime.funcWrappers[i]||(Runtime.funcWrappers[i]={});var e=Runtime.funcWrappers[i];return e[r]||(1===i.length?e[r]=function(){return Runtime.dynCall(i,r)}:2===i.length?e[r]=function(e){return Runtime.dynCall(i,r,[e])}:e[r]=function(){return Runtime.dynCall(i,r,Array.prototype.slice.call(arguments))}),e[r]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var r=STACKTOP;return STACKTOP=(STACKTOP=STACKTOP+e|0)+15&-16,r},staticAlloc:function(e){var r=STATICTOP;return STATICTOP=(STATICTOP=STATICTOP+e|0)+15&-16,r},dynamicAlloc:function(e){var r=HEAP32[DYNAMICTOP_PTR>>2],i=-16&(r+e+15|0);if((HEAP32[DYNAMICTOP_PTR>>2]=i,TOTAL_MEMORY<=i)&&!enlargeMemory())return HEAP32[DYNAMICTOP_PTR>>2]=r,0;return r},alignMemory:function(e,r){return e=Math.ceil(e/(r||16))*(r||16)},makeBigInt:function(e,r,i){return i?+(e>>>0)+4294967296*+(r>>>0):+(e>>>0)+4294967296*+(0|r)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0,cwrap,ccall;function assert(e,r){e||abort("Assertion failed: "+r)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,r,i,n){switch("*"===(i=i||"i8").charAt(i.length-1)&&(i="i32"),i){case"i1":case"i8":HEAP8[e>>0]=r;break;case"i16":HEAP16[e>>1]=r;break;case"i32":HEAP32[e>>2]=r;break;case"i64":tempI64=[r>>>0,(tempDouble=r,1<=+Math_abs(tempDouble)?0<tempDouble?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=r;break;case"double":HEAPF64[e>>3]=r;break;default:abort("invalid type for setValue: "+i)}}function getValue(e,r,i){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+r)}return null}!function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var r=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,r),r},stringToC:function(e){var r=0;if(null!=e&&0!==e){var i=1+(e.length<<2);stringToUTF8(e,r=Runtime.stackAlloc(i),i)}return r}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,r,i,n,t){var o=getCFunc(e),a=[],u=0;if(n)for(var l=0;l<n.length;l++){var s=toC[i[l]];s?(0===u&&(u=Runtime.stackSave()),a[l]=s(n[l])):a[l]=n[l]}var f=o.apply(null,a);if("string"===r&&(f=Pointer_stringify(f)),0!==u){if(t&&t.async)return void EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(u)});Runtime.stackRestore(u)}return f};var sourceRegex=/^function\s*[a-zA-Z$_0-9]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;function parseJSFunc(e){var r=e.toString().match(sourceRegex).slice(1);return{arguments:r[0],body:r[1],returnValue:r[2]}}var JSsource=null;function ensureJSsource(){if(!JSsource)for(var e in JSsource={},JSfuncs)JSfuncs.hasOwnProperty(e)&&(JSsource[e]=parseJSFunc(JSfuncs[e]))}cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(e){return"number"===e}),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(e,r){return"$"+r}),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){ensureJSsource(),funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if("number"!==type){var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"=("+convertCode.returnValue+");"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+="ret = "+strgfy+"(ret);"}return numericArgs||(ensureJSsource(),funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;function allocate(e,r,i,n){var t,o;"number"==typeof e?(t=!0,o=e):(t=!1,o=e.length);var a,u="string"==typeof r?r:null;if(a=i==ALLOC_NONE?n:["function"==typeof _malloc?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===i?ALLOC_STATIC:i](Math.max(o,u?1:r.length)),t){var l;n=a;for(assert(0==(3&a)),l=a+(-4&o);n<l;n+=4)HEAP32[n>>2]=0;for(l=a+o;n<l;)HEAP8[n++>>0]=0;return a}if("i8"===u)return e.subarray||e.slice?HEAPU8.set(e,a):HEAPU8.set(new Uint8Array(e),a),a;for(var s,f,c,d=0;d<o;){var _=e[d];"function"==typeof _&&(_=Runtime.getFunctionIndex(_)),0!==(s=u||r[d])?("i64"==s&&(s="i32"),setValue(a+d,_,s),c!==s&&(f=Runtime.getNativeTypeSize(s),c=s),d+=f):d++}return a}function getMemory(e){return staticSealed?runtimeInitialized?_malloc(e):Runtime.dynamicAlloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,r){if(0===r||!e)return"";for(var i,n=0,t=0;n|=i=HEAPU8[e+t>>0],(0!=i||r)&&(t++,!r||t!=r););r||(r=t);var o="";if(n<128){for(var a;0<r;)a=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(r,1024))),o=o?o+a:a,e+=1024,r-=1024;return o}return Module.UTF8ToString(e)}function AsciiToString(e){for(var r="";;){var i=HEAP8[e++>>0];if(!i)return r;r+=String.fromCharCode(i)}}function stringToAscii(e,r){return writeAsciiToMemory(e,r,!1)}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii;var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,r){for(var i=r;e[i];)++i;if(16<i-r&&e.subarray&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(r,i));for(var n,t,o,a,u,l="";;){if(!(n=e[r++]))return l;if(128&n)if(t=63&e[r++],192!=(224&n))if(o=63&e[r++],224==(240&n)?n=(15&n)<<12|t<<6|o:(a=63&e[r++],240==(248&n)?n=(7&n)<<18|t<<12|o<<6|a:(u=63&e[r++],n=248==(252&n)?(3&n)<<24|t<<18|o<<12|a<<6|u:(1&n)<<30|t<<24|o<<18|a<<12|u<<6|63&e[r++])),n<65536)l+=String.fromCharCode(n);else{var s=n-65536;l+=String.fromCharCode(55296|s>>10,56320|1023&s)}else l+=String.fromCharCode((31&n)<<6|t);else l+=String.fromCharCode(n)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,r,i,n){if(!(0<n))return 0;for(var t=i,o=i+n-1,a=0;a<e.length;++a){var u=e.charCodeAt(a);if(55296<=u&&u<=57343&&(u=65536+((1023&u)<<10)|1023&e.charCodeAt(++a)),u<=127){if(o<=i)break;r[i++]=u}else if(u<=2047){if(o<=i+1)break;r[i++]=192|u>>6,r[i++]=128|63&u}else if(u<=65535){if(o<=i+2)break;r[i++]=224|u>>12,r[i++]=128|u>>6&63,r[i++]=128|63&u}else if(u<=2097151){if(o<=i+3)break;r[i++]=240|u>>18,r[i++]=128|u>>12&63,r[i++]=128|u>>6&63,r[i++]=128|63&u}else if(u<=67108863){if(o<=i+4)break;r[i++]=248|u>>24,r[i++]=128|u>>18&63,r[i++]=128|u>>12&63,r[i++]=128|u>>6&63,r[i++]=128|63&u}else{if(o<=i+5)break;r[i++]=252|u>>30,r[i++]=128|u>>24&63,r[i++]=128|u>>18&63,r[i++]=128|u>>12&63,r[i++]=128|u>>6&63,r[i++]=128|63&u}}return r[i]=0,i-t}function stringToUTF8(e,r,i){return stringToUTF8Array(e,HEAPU8,r,i)}function lengthBytesUTF8(e){for(var r=0,i=0;i<e.length;++i){var n=e.charCodeAt(i);55296<=n&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++i)),n<=127?++r:r+=n<=2047?2:n<=65535?3:n<=2097151?4:n<=67108863?5:6}return r}Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8;var UTF16Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;function demangle(e){var r=Module.___cxa_demangle||Module.__cxa_demangle;if(r){try{var i=e.substr(1),n=lengthBytesUTF8(i)+1,t=_malloc(n);stringToUTF8(i,t,n);var o=_malloc(4),a=r(t,0,0,o);if(0===getValue(o,"i32")&&a)return Pointer_stringify(a)}catch(e){}finally{t&&_free(t),o&&_free(o),a&&_free(a)}return e}return Runtime.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,function(e){var r=demangle(e);return e===r?e:e+" ["+r+"]"})}function jsStackTrace(){var r=new Error;if(!r.stack){try{throw new Error(0)}catch(e){r=e}if(!r.stack)return"(no stack trace available)"}return r.stack.toString()}function stackTrace(){var e=jsStackTrace();return Module.extraStackTrace&&(e+="\n"+Module.extraStackTrace()),demangleAll(e)}function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}Module.stackTrace=stackTrace,STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216;function getTotalMemory(){return TOTAL_MEMORY}if(TOTAL_MEMORY<TOTAL_STACK&&Module.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")"),buffer=Module.buffer?Module.buffer:new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews(),HEAP32[0]=1668509029,HEAP16[1]=25459,115!==HEAPU8[2]||99!==HEAPU8[3])throw"Runtime error: expected the system to be little-endian!";function callRuntimeCallbacks(e){for(;0<e.length;){var r=e.shift();if("function"!=typeof r){var i=r.func;"number"==typeof i?void 0===r.arg?Module.dynCall_v(i):Module.dynCall_vi(i,r.arg):i(void 0===r.arg?null:r.arg)}else r()}}Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,r,i){var n=0<i?i:lengthBytesUTF8(e)+1,t=new Array(n),o=stringToUTF8Array(e,t,0,t.length);return r&&(t.length=o),t}function intArrayToString(e){for(var r=[],i=0;i<e.length;i++){var n=e[i];255<n&&(n&=255),r.push(String.fromCharCode(n))}return r.join("")}function writeStringToMemory(e,r,i){var n,t;Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!"),i&&(t=r+lengthBytesUTF8(e),n=HEAP8[t]),stringToUTF8(e,r,1/0),i&&(HEAP8[t]=n)}function writeArrayToMemory(e,r){HEAP8.set(e,r)}function writeAsciiToMemory(e,r,i){for(var n=0;n<e.length;++n)HEAP8[r++>>0]=e.charCodeAt(n);i||(HEAP8[r>>0]=0)}Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,r){var i=65535&e,n=65535&r;return i*n+((e>>>16)*n+i*(r>>>16)<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var r=0;r<32;r++)if(e&1<<31-r)return r;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var r=dependenciesFulfilled;dependenciesFulfilled=null,r()}}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[];STATIC_BASE=8,STATICTOP=STATIC_BASE+5408,__ATINIT__.push(),allocate([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,28,17,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,82,26,28,19,153,27,59,26,115,26,41,13,222,29,23,15,140,30,98,28,156,19,10,17,114,32,101,39,94,39,47,46,67,46,165,24,1,37,99,37,127,42,157,29,244,31,59,29,122,1,40,4,237,1,70,2,176,2,81,2,218,1,185,2,219,1,176,2,165,1,199,1,43,2,249,1,55,2,12,2,73,2,207,4,253,1,60,3,236,1,4,6,55,4,82,3,8,0,4,0,3,0,14,0,7,0,5,0,24,0,21,0,24,0,57,0,48,0,57,0,37,0,32,0,37,0,100,0,80,0,100,0,6,0,3,0,2,0,9,0,5,0,3,0,82,0,78,0,82,0,29,1,4,1,29,1,94,0,94,0,94,0,76,4,26,4,76,4,34,0,62,0,72,0,66,0,53,0,25,0,94,0,66,0,56,0,62,0,75,0,103,0,48,0,82,0,45,0,87,0,50,0,47,0,80,0,46,0,83,0,41,0,78,0,81,0,6,0,8,0,10,0,12,0,14,0,16,0,128,2,0,3,32,2,32,2,64,2,64,2,64,2,64,2,128,44,128,44,0,45,0,45,0,45,0,45,0,36,128,35,0,35,128,34,0,34,128,33,0,0,201,0,146,1,91,2,36,3,237,3,182,4,126,5,71,6,16,7,217,7,161,8,106,9,50,10,251,10,195,11,139,12,83,13,27,14,227,14,171,15,114,16,57,17,0,18,199,18,142,19,85,20,27,21,225,21,167,22,109,23,51,24,248,24,189,25,130,26,70,27,11,28,207,28,147,29,86,30,25,31,220,31,159,32,97,33,35,34,228,34,166,35,103,36,39,37,231,37,167,38,103,39,38,40,229,40,163,41,97,42,30,43,219,43,152,44,84,45,16,46,204,46,134,47,65,48,251,48,180,49,109,50,38,51,222,51,150,52,77,53,3,54,185,54,111,55,36,56,216,56,140,57,63,58,242,58,164,59,86,60,7,61,183,61,103,62,22,63,197,63,115,64,32,65,205,65,121,66,37,67,208,67,122,68,35,69,204,69,116,70,28,71,195,71,105,72,14,73,179,73,87,74,250,74,157,75,63,76,224,76,128,77,32,78,191,78,93,79,250,79,151,80,51,81,206,81,104,82,1,83,154,83,50,84,201,84,95,85,244,85,137,86,29,87,176,87,66,88,211,88,99,89,243,89,129,90,15,91,156,91,40,92,179,92,61,93,198,93,79,94,214,94,93,95,226,95,103,96,235,96,110,97,240,97,113,98,241,98,112,99,238,99,107,100,231,100,98,101,221,101,86,102,206,102,69,103,188,103,49,104,165,104,25,105,139,105,252,105,108,106,219,106,74,107,183,107,35,108,142,108,248,108,97,109,201,109,48,110,149,110,250,110,94,111,192,111,34,112,130,112,225,112,64,113,157,113,249,113,84,114,174,114,6,115,94,115,181,115,10,116,94,116,177,116,3,117,84,117,164,117,243,117,64,118,141,118,216,118,34,119,107,119,179,119,249,119,63,120,131,120,198,120,8,121,73,121,137,121,199,121,4,122,65,122,124,122,181,122,238,122,37,123,92,123,145,123,196,123,247,123,41,124,89,124,136,124,182,124,226,124,14,125,56,125,97,125,137,125,176,125,213,125,249,125,28,126,62,126,94,126,126,126,156,126,185,126,212,126,239,126,8,127,32,127,55,127,76,127,97,127,116,127,134,127,150,127,166,127,180,127,193,127,205,127,215,127,224,127,232,127,239,127,245,127,249,127,252,127,254,127,255,127,254,127,252,127,249,127,245,127,239,127,232,127,224,127,215,127,205,127,193,127,180,127,166,127,150,127,134,127,116,127,97,127,76,127,55,127,32,127,8,127,239,126,212,126,185,126,156,126,126,126,94,126,62,126,28,126,249,125,213,125,176,125,137,125,97,125,56,125,14,125,226,124,182,124,136,124,89,124,41,124,247,123,196,123,145,123,92,123,37,123,238,122,181,122,124,122,65,122,4,122,199,121,137,121,73,121,8,121,198,120,131,120,63,120,249,119,179,119,107,119,34,119,216,118,141,118,64,118,243,117,164,117,84,117,3,117,177,116,94,116,10,116,181,115,94,115,6,115,174,114,84,114,249,113,157,113,64,113,225,112,130,112,34,112,192,111,94,111,250,110,149,110,48,110,201,109,97,109,248,108,142,108,35,108,183,107,74,107,219,106,108,106,252,105,139,105,25,105,165,104,49,104,188,103,69,103,206,102,86,102,221,101,98,101,231,100,107,100,238,99,112,99,241,98,113,98,240,97,110,97,235,96,103,96,226,95,93,95,214,94,79,94,198,93,61,93,179,92,40,92,156,91,15,91,129,90,243,89,99,89,211,88,66,88,176,87,29,87,137,86,244,85,95,85,201,84,50,84,154,83,1,83,104,82,206,81,51,81,151,80,250,79,93,79,191,78,32,78,128,77,224,76,63,76,157,75,250,74,87,74,179,73,14,73,105,72,195,71,28,71,116,70,204,69,35,69,122,68,208,67,37,67,121,66,205,65,32,65,115,64,197,63,22,63,103,62,183,61,7,61,86,60,164,59,242,58,63,58,140,57,216,56,36,56,111,55,185,54,3,54,77,53,150,52,222,51,38,51,109,50,180,49,251,48,65,48,134,47,204,46,16,46,84,45,152,44,219,43,30,43,97,42,163,41,229,40,38,40,103,39,167,38,231,37,39,37,103,36,166,35,228,34,35,34,97,33,159,32,220,31,25,31,86,30,147,29,207,28,11,28,70,27,130,26,189,25,248,24,51,24,109,23,167,22,225,21,27,21,85,20,142,19,199,18,0,18,57,17,114,16,171,15,227,14,27,14,83,13,139,12,195,11,251,10,50,10,106,9,161,8,217,7,16,7,71,6,126,5,182,4,237,3,36,3,91,2,146,1,201,0,0,0,55,255,110,254,165,253,220,252,19,252,74,251,130,250,185,249,240,248,39,248,95,247,150,246,206,245,5,245,61,244,117,243,173,242,229,241,29,241,85,240,142,239,199,238,0,238,57,237,114,236,171,235,229,234,31,234,89,233,147,232,205,231,8,231,67,230,126,229,186,228,245,227,49,227,109,226,170,225,231,224,36,224,97,223,159,222,221,221,28,221,90,220,153,219,217,218,25,218,89,217,153,216,218,215,27,215,93,214,159,213,226,212,37,212,104,211,172,210,240,209,52,209,122,208,191,207,5,207,76,206,147,205,218,204,34,204,106,203,179,202,253,201,71,201,145,200,220,199,40,199,116,198,193,197,14,197,92,196,170,195,249,194,73,194,153,193,234,192,59,192,141,191,224,190,51,190,135,189,219,188,48,188,134,187,221,186,52,186,140,185,228,184,61,184,151,183,242,182,77,182,169,181,6,181,99,180,193,179,32,179,128,178,224,177,65,177,163,176,6,176,105,175,205,174,50,174,152,173,255,172,102,172,206,171,55,171,161,170,12,170,119,169,227,168,80,168,190,167,45,167,157,166,13,166,127,165,241,164,100,164,216,163,77,163,195,162,58,162,177,161,42,161,163,160,30,160,153,159,21,159,146,158,16,158,143,157,15,157,144,156,18,156,149,155,25,155,158,154,35,154,170,153,50,153,187,152,68,152,207,151,91,151,231,150,117,150,4,150,148,149,37,149,182,148,73,148,221,147,114,147,8,147,159,146,55,146,208,145,107,145,6,145,162,144,64,144,222,143,126,143,31,143,192,142,99,142,7,142,172,141,82,141,250,140,162,140,75,140,246,139,162,139,79,139,253,138,172,138,92,138,13,138,192,137,115,137,40,137,222,136,149,136,77,136,7,136,193,135,125,135,58,135,248,134,183,134,119,134,57,134,252,133,191,133,132,133,75,133,18,133,219,132,164,132,111,132,60,132,9,132,215,131,167,131,120,131,74,131,30,131,242,130,200,130,159,130,119,130,80,130,43,130,7,130,228,129,194,129,162,129,130,129,100,129,71,129,44,129,17,129,248,128,224,128,201,128,180,128,159,128,140,128,122,128,106,128,90,128,76,128,63,128,51,128,41,128,32,128,24,128,17,128,11,128,7,128,4,128,2,128,1,128,2,128,4,128,7,128,11,128,17,128,24,128,32,128,41,128,51,128,63,128,76,128,90,128,106,128,122,128,140,128,159,128,180,128,201,128,224,128,248,128,17,129,44,129,71,129,100,129,130,129,162,129,194,129,228,129,7,130,43,130,80,130,119,130,159,130,200,130,242,130,30,131,74,131,120,131,167,131,215,131,9,132,60,132,111,132,164,132,219,132,18,133,75,133,132,133,191,133,252,133,57,134,119,134,183,134,248,134,58,135,125,135,193,135,7,136,77,136,149,136,222,136,40,137,115,137,192,137,13,138,92,138,172,138,253,138,79,139,162,139,246,139,75,140,162,140,250,140,82,141,172,141,7,142,99,142,192,142,31,143,126,143,222,143,64,144,162,144,6,145,107,145,208,145,55,146,159,146,8,147,114,147,221,147,73,148,182,148,37,149,148,149,4,150,117,150,231,150,91,151,207,151,68,152,187,152,50,153,170,153,35,154,158,154,25,155,149,155,18,156,144,156,15,157,143,157,16,158,146,158,21,159,153,159,30,160,163,160,42,161,177,161,58,162,195,162,77,163,216,163,100,164,241,164,127,165,13,166,157,166,45,167,190,167,80,168,227,168,119,169,12,170,161,170,55,171,206,171,102,172,255,172,152,173,50,174,205,174,105,175,6,176,163,176,65,177,224,177,128,178,32,179,193,179,99,180,6,181,169,181,77,182,242,182,151,183,61,184,228,184,140,185,52,186,221,186,134,187,48,188,219,188,135,189,51,190,224,190,141,191,59,192,234,192,153,193,73,194,249,194,170,195,92,196,14,197,193,197,116,198,40,199,220,199,145,200,71,201,253,201,179,202,106,203,34,204,218,204,147,205,76,206,5,207,191,207,122,208,52,209,240,209,172,210,104,211,37,212,226,212,159,213,93,214,27,215,218,215,153,216,89,217,25,218,217,218,153,219,90,220,28,221,221,221,159,222,97,223,36,224,231,224,170,225,109,226,49,227,245,227,186,228,126,229,67,230,8,231,205,231,147,232,89,233,31,234,229,234,171,235,114,236,57,237,0,238,199,238,142,239,85,240,29,241,229,241,173,242,117,243,61,244,5,245,206,245,150,246,95,247,39,248,240,248,185,249,130,250,74,251,19,252,220,252,165,253,110,254,55,255,1,0,128,0,2,0,64,0,3,0,192,0,4,0,32,0,5,0,160,0,6,0,96,0,7,0,224,0,8,0,16,0,9,0,144,0,10,0,80,0,11,0,208,0,12,0,48,0,13,0,176,0,14,0,112,0,15,0,240,0,17,0,136,0,18,0,72,0,19,0,200,0,20,0,40,0,21,0,168,0,22,0,104,0,23,0,232,0,25,0,152,0,26,0,88,0,27,0,216,0,28,0,56,0,29,0,184,0,30,0,120,0,31,0,248,0,33,0,132,0,34,0,68,0,35,0,196,0,37,0,164,0,38,0,100,0,39,0,228,0,41,0,148,0,42,0,84,0,43,0,212,0,44,0,52,0,45,0,180,0,46,0,116,0,47,0,244,0,49,0,140,0,50,0,76,0,51,0,204,0,53,0,172,0,54,0,108,0,55,0,236,0,57,0,156,0,58,0,92,0,59,0,220,0,61,0,188,0,62,0,124,0,63,0,252,0,65,0,130,0,67,0,194,0,69,0,162,0,70,0,98,0,71,0,226,0,73,0,146,0,74,0,82,0,75,0,210,0,77,0,178,0,78,0,114,0,79,0,242,0,81,0,138,0,83,0,202,0,85,0,170,0,86,0,106,0,87,0,234,0,89,0,154,0,91,0,218,0,93,0,186,0,94,0,122,0,95,0,250,0,97,0,134,0,99,0,198,0,101,0,166,0,103,0,230,0,105,0,150,0,107,0,214,0,109,0,182,0,110,0,118,0,111,0,246,0,113,0,142,0,115,0,206,0,117,0,174,0,119,0,238,0,121,0,158,0,123,0,222,0,125,0,190,0,127,0,254,0,131,0,193,0,133,0,161,0,135,0,225,0,137,0,145,0,139,0,209,0,141,0,177,0,143,0,241,0,147,0,201,0,149,0,169,0,151,0,233,0,155,0,217,0,157,0,185,0,159,0,249,0,163,0,197,0,167,0,229,0,171,0,213,0,173,0,181,0,175,0,245,0,179,0,205,0,183,0,237,0,187,0,221,0,191,0,253,0,199,0,227,0,203,0,211,0,207,0,243,0,215,0,235,0,223,0,251,0,239,0,247,0,1,0,64,0,2,0,32,0,3,0,96,0,4,0,16,0,5,0,80,0,6,0,48,0,7,0,112,0,9,0,72,0,10,0,40,0,11,0,104,0,12,0,24,0,13,0,88,0,14,0,56,0,15,0,120,0,17,0,68,0,18,0,36,0,19,0,100,0,21,0,84,0,22,0,52,0,23,0,116,0,25,0,76,0,26,0,44,0,27,0,108,0,29,0,92,0,30,0,60,0,31,0,124,0,33,0,66,0,35,0,98,0,37,0,82,0,38,0,50,0,39,0,114,0,41,0,74,0,43,0,106,0,45,0,90,0,46,0,58,0,47,0,122,0,49,0,70,0,51,0,102,0,53,0,86,0,55,0,118,0,57,0,78,0,59,0,110,0,61,0,94,0,63,0,126,0,67,0,97,0,69,0,81,0,71,0,113,0,75,0,105,0,77,0,89,0,79,0,121,0,83,0,101,0,87,0,117,0,91,0,109,0,95,0,125,0,103,0,115,0,111,0,123,0,100,97,116,97,91,48,93,32,61,61,32,118,97,108,48,0,109,97,105,110,46,99,0,112,114,111,99,101,115,115,95,100,97,116,97,0,100,97,116,97,91,49,48,48,93,32,61,61,32,118,97,108,49,48,48,0,100,97,116,97,91,50,48,48,48,93,32,61,61,32,118,97,108,50,48,48,48,0,112,114,111,99,101,115,115,95,100,97,116,97,58,32,100,97,116,97,32,61,61,32,78,85,76,76,32,0,100,97,116,97,95,108,101,110,103,116,104,32,62,61,32,48,0,119,101,98,114,116,99,47,99,111,109,109,111,110,95,97,117,100,105,111,47,118,97,100,47,118,97,100,95,102,105,108,116,101,114,98,97,110,107,46,99,0,87,101,98,82,116,99,86,97,100,95,67,97,108,99,117,108,97,116,101,70,101,97,116,117,114,101,115,0,100,97,116,97,95,108,101,110,103,116,104,32,60,61,32,50,52,48,0,100,97,116,97,95,105,110,32,33,61,32,78,85,76,76,0,76,111,103,79,102,69,110,101,114,103,121,0,100,97,116,97,95,108,101,110,103,116,104,32,62,32,48,0,99,104,97,110,110,101,108,32,60,32,107,78,117,109,67,104,97,110,110,101,108,115,0,119,101,98,114,116,99,47,99,111,109,109,111,110,95,97,117,100,105,111,47,118,97,100,47,118,97,100,95,115,112,46,99,0,87,101,98,82,116,99,86,97,100,95,70,105,110,100,77,105,110,105,109,117,109,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;function ___assert_fail(e,r,i,n){throw ABORT=!0,"Assertion failed: "+Pointer_stringify(e)+", at: "+[r?Pointer_stringify(r):"unknown filename",i,n?Pointer_stringify(n):"unknown function"]+" at "+stackTrace()}function ___setErrNo(e){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=e),e}function ___lock(){}function _emscripten_memcpy_big(e,r,i){return HEAPU8.set(HEAPU8.subarray(r,r+i),e),e}function _abort(){Module.abort()}function _pthread_once(e,r){_pthread_once.seen||(_pthread_once.seen={}),e in _pthread_once.seen||(Module.dynCall_v(r),_pthread_once.seen[e]=1)}STATICTOP+=16,Module._sbrk=_sbrk,Module._memset=_memset,Module._memcpy=_memcpy;var SYSCALLS={varargs:0,get:function(e){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(){return Pointer_stringify(SYSCALLS.get())},get64:function(){var e=SYSCALLS.get(),r=SYSCALLS.get();return assert(0<=e?0===r:-1===r),e},getZero:function(){assert(0===SYSCALLS.get())}};function ___syscall140(e,r){SYSCALLS.varargs=r;try{var i=SYSCALLS.getStreamFromFD(),n=SYSCALLS.get(),t=SYSCALLS.get(),o=SYSCALLS.get(),a=SYSCALLS.get(),u=t;return assert(0===n),FS.llseek(i,u,a),HEAP32[o>>2]=i.position,i.getdents&&0===u&&0===a&&(i.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,r){SYSCALLS.varargs=r;try{var i=SYSCALLS.get(),n=SYSCALLS.get(),t=SYSCALLS.get(),o=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(e,r){var i=___syscall146.buffers[e];assert(i),0===r||10===r?((1===e?Module.print:Module.printErr)(UTF8ArrayToString(i,0)),i.length=0):i.push(r)});for(var a=0;a<t;a++){for(var u=HEAP32[n+8*a>>2],l=HEAP32[n+(8*a+4)>>2],s=0;s<l;s++)___syscall146.printChar(i,HEAPU8[u+s]);o+=l}return o}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,r){SYSCALLS.varargs=r;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___unlock(){}function ___syscall6(e,r){SYSCALLS.varargs=r;try{var i=SYSCALLS.getStreamFromFD();return FS.close(i),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function invoke_iiiiiiii(e,r,i,n,t,o,a,u){try{return Module.dynCall_iiiiiiii(e,r,i,n,t,o,a,u)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_iiii(e,r,i,n){try{return Module.dynCall_iiii(e,r,i,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_vi(e,r){try{Module.dynCall_vi(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_ii(e,r){try{return Module.dynCall_ii(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiiiiii(e,r,i,n,t,o,a,u){try{Module.dynCall_viiiiiii(e,r,i,n,t,o,a,u)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_v(e){try{Module.dynCall_v(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_iiiiiiiii(e,r,i,n,t,o,a,u,l){try{return Module.dynCall_iiiiiiiii(e,r,i,n,t,o,a,u,l)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_iii(e,r,i){try{return Module.dynCall_iii(e,r,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}__ATEXIT__.push(function(){var e=Module._fflush;e&&e(0);var r=___syscall146.printChar;if(r){var i=___syscall146.buffers;i[1].length&&r(1,10),i[2].length&&r(2,10)}}),DYNAMICTOP_PTR=allocate(1,"i32",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0,Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0},Module.asmLibraryArg={abort:abort,assert:assert,enlargeMemory:enlargeMemory,getTotalMemory:getTotalMemory,abortOnCannotGrowMemory:abortOnCannotGrowMemory,invoke_iiiiiiii:invoke_iiiiiiii,invoke_iiii:invoke_iiii,invoke_vi:invoke_vi,invoke_ii:invoke_ii,invoke_viiiiiii:invoke_viiiiiii,invoke_v:invoke_v,invoke_iiiiiiiii:invoke_iiiiiiiii,invoke_iii:invoke_iii,___lock:___lock,___syscall6:___syscall6,_pthread_once:_pthread_once,_abort:_abort,___syscall140:___syscall140,___setErrNo:___setErrNo,_emscripten_memcpy_big:_emscripten_memcpy_big,___syscall54:___syscall54,___unlock:___unlock,___assert_fail:___assert_fail,___syscall146:___syscall146,DYNAMICTOP_PTR:DYNAMICTOP_PTR,tempDoublePtr:tempDoublePtr,ABORT:ABORT,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX};var asm=function(e,r,i){"use asm";var h=new e.Int8Array(i);var Q=new e.Int16Array(i);var we=new e.Int32Array(i);var c=new e.Uint8Array(i);var $=new e.Uint16Array(i);var n=new e.Uint32Array(i);var t=new e.Float32Array(i);var o=new e.Float64Array(i);var a=r.DYNAMICTOP_PTR|0;var u=r.tempDoublePtr|0;var l=r.ABORT|0;var ke=r.STACKTOP|0;var s=r.STACK_MAX|0;var f=0;var d=0;var _=0;var M=0;var p=e.NaN,v=e.Infinity;var m=0,T=0,A=0,b=0,y=0.0,g=0,S=0,w=0,k=0.0;var E=0;var R=e.Math.floor;var C=e.Math.abs;var O=e.Math.sqrt;var P=e.Math.pow;var N=e.Math.cos;var I=e.Math.sin;var L=e.Math.tan;var U=e.Math.acos;var F=e.Math.asin;var H=e.Math.atan;var D=e.Math.atan2;var x=e.Math.exp;var Y=e.Math.log;var V=e.Math.ceil;var ee=e.Math.imul;var B=e.Math.min;var K=e.Math.max;var W=e.Math.clz32;var z=r.abort;var j=r.assert;var J=r.enlargeMemory;var q=r.getTotalMemory;var G=r.abortOnCannotGrowMemory;var X=r.invoke_iiiiiiii;var Z=r.invoke_iiii;var re=r.invoke_vi;var ie=r.invoke_ii;var ne=r.invoke_viiiiiii;var te=r.invoke_v;var oe=r.invoke_iiiiiiiii;var ae=r.invoke_iii;var ue=r.___lock;var le=r.___syscall6;var se=r._pthread_once;var Ee=r._abort;var fe=r.___syscall140;var ce=r.___setErrNo;var de=r._emscripten_memcpy_big;var _e=r.___syscall54;var he=r.___unlock;var Me=r.___assert_fail;var pe=r.___syscall146;var ve=0.0;function me(e){e=e|0;var r=0;r=ke;ke=ke+e|0;ke=ke+15&-16;return r|0}function Te(){return ke|0}function Ae(e){e=e|0;ke=e}function be(e,r){e=e|0;r=r|0;ke=e;s=r}function ye(e,r){e=e|0;r=r|0;if(!f){f=e;d=r}}function ge(e){e=e|0;E=e}function Se(){return E|0}function Re(){var e=0;if((Pe(3740)|0)==-1){e=0;return e|0}e=(Ne(we[935]|0)|0)!=-1&1;return e|0}function Ce(e){e=e|0;return Ie(we[935]|0,e)|0}function Oe(e,r,i,n,t,o){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;if(!e)Br(3482)|0;if((Q[e>>1]|0)!=(n|0))Me(3404,3420,30,3427);if((Q[e+200>>1]|0)!=(t|0))Me(3440,3420,31,3427);if((Q[e+4e3>>1]|0)==(o|0))return Le(we[935]|0,i,e,r)|0;else Me(3460,3420,32,3427);return 0}function Pe(e){e=e|0;var r=0,i=0;if(!e){r=-1;return r|0}i=Kr(736)|0;we[e>>2]=i;if(!i){r=-1;return r|0}Je();we[i+732>>2]=0;r=0;return r|0}function Ne(e){e=e|0;return Ue(e)|0}function Ie(e,r){e=e|0;r=r|0;var i=0;if((e|0)!=0?(we[e+732>>2]|0)==42:0)i=Fe(e,r)|0;else i=-1;return i|0}function Le(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0;if(!e){t=-1;return t|0}if((i|0)==0?1:(we[e+732>>2]|0)!=42){t=-1;return t|0}e:do{if((r|0)>=32e3)if((r|0)<48e3)switch(r|0){case 32e3:{o=32;break e;break}default:{t=-1;return t|0}}else switch(r|0){case 48e3:{o=48;break e;break}default:{t=-1;return t|0}}else{if((r|0)<16e3){switch(r|0){case 8e3:{o=8;break e;break}default:t=-1}return t|0}switch(r|0){case 16e3:{o=16;break e;break}default:{t=-1;return t|0}}}}while(0);if(!((o*30|0)==(n|0)|((o*10|0)==(n|0)|(o*20|0)==(n|0)))){t=-1;return t|0}e:do{if((r|0)<32e3)if((r|0)<16e3){switch(r|0){case 8e3:break;default:{a=-1;break e}}a=De(e,i,n)|0;break}else{switch(r|0){case 16e3:break;default:{a=-1;break e}}a=Ye(e,i,n)|0;break}else if((r|0)<48e3){switch(r|0){case 32e3:break;default:{a=-1;break e}}a=xe(e,i,n)|0;break}else{switch(r|0){case 48e3:break;default:{a=-1;break e}}a=He(e,i,n)|0;break}}while(0);t=(a|0)<1?a:1;return t|0}function Ue(e){e=e|0;var r=0,i=0,n=0;if(!e){r=-1;return r|0}we[e>>2]=1;i=e+4|0;we[i>>2]=0;we[i+4>>2]=0;we[i+8>>2]=0;we[i+12>>2]=0;i=e+276|0;we[i>>2]=0;we[i+4>>2]=0;Ze(e+20|0);i=0;do{Q[e+180+(i<<1)>>1]=Q[384+(i<<1)>>1]|0;Q[e+204+(i<<1)>>1]=Q[408+(i<<1)>>1]|0;Q[e+228+(i<<1)>>1]=Q[432+(i<<1)>>1]|0;Q[e+252+(i<<1)>>1]=Q[456+(i<<1)>>1]|0;i=i+1|0}while((i|0)!=12);n=0;do{Q[e+476+(n<<1)>>1]=1e4;Q[e+284+(n<<1)>>1]=0;n=n+1|0}while((n|0)!=96);n=e+680|0;we[n>>2]=0;we[n+4>>2]=0;we[n+8>>2]=0;we[n+12>>2]=0;we[n+16>>2]=0;we[n+20>>2]=0;we[n+24>>2]=0;Q[e+668>>1]=1600;Q[e+670>>1]=1600;Q[e+672>>1]=1600;Q[e+674>>1]=1600;Q[e+676>>1]=1600;Q[e+678>>1]=1600;n=e+708|0;Q[n>>1]=Q[240]|0;Q[n+2>>1]=Q[241]|0;Q[n+4>>1]=Q[242]|0;n=e+714|0;Q[n>>1]=Q[243]|0;Q[n+2>>1]=Q[244]|0;Q[n+4>>1]=Q[245]|0;n=e+720|0;Q[n>>1]=Q[246]|0;Q[n+2>>1]=Q[247]|0;Q[n+4>>1]=Q[248]|0;n=e+726|0;Q[n>>1]=Q[249]|0;Q[n+2>>1]=Q[250]|0;Q[n+4>>1]=Q[251]|0;we[e+732>>2]=42;r=0;return r|0}function Fe(e,r){e=e|0;r=r|0;var i=0;switch(r|0){case 0:{r=e+708|0;Q[r>>1]=Q[240]|0;Q[r+2>>1]=Q[241]|0;Q[r+4>>1]=Q[242]|0;r=e+714|0;Q[r>>1]=Q[243]|0;Q[r+2>>1]=Q[244]|0;Q[r+4>>1]=Q[245]|0;r=e+720|0;Q[r>>1]=Q[246]|0;Q[r+2>>1]=Q[247]|0;Q[r+4>>1]=Q[248]|0;r=e+726|0;Q[r>>1]=Q[249]|0;Q[r+2>>1]=Q[250]|0;Q[r+4>>1]=Q[251]|0;i=0;return i|0}case 1:{r=e+708|0;Q[r>>1]=Q[240]|0;Q[r+2>>1]=Q[241]|0;Q[r+4>>1]=