| 12345678 |
- /*
- *
- * DecoderWorker.js v0.1.0
- * Copyright (c) 2024-8-1 Ezviz-OpenBiz
- * .
- *
- */
- !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";var e={DEFAULT_SAMPLERATE:44100,DEFAULT_CHANNEL:1,H264AUD:[0,0,0,1,9,224],H265AUD:[0,0,0,1,70,1,80],DEF_AAC:"aac",DEF_MP3:"mp3",DEF_H265:"h265",DEF_HEVC:"hevc",DEF_H264:"h264",DEF_AVC:"avc",CODEC_OFFSET_TABLE:["hevc","h265","avc","h264","aac","mp3"]};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t={exports:{}};!function(e,r){function t(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function n(e,r,t){return n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,r,t){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(e,n));return t&&s(o,t.prototype),o},n.apply(null,arguments)}function o(e,r,t){return r&&function(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,r),e}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function a(e,r){return null!=r&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function s(e,r){return s=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},s(e,r)}function u(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function c(e){var r="function"==typeof Map?new Map:void 0;return c=function(e){if(null===e||(t=e,-1===Function.toString.call(t).indexOf("[native code]")))return e;var t;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,o)}function o(){return n(e,arguments,i(this).constructor)}return o.prototype=Object.create(e.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),s(o,e)},c(e)}function l(e,r){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,r){if(e){if("string"==typeof e)return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void 0}}(e))||r){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var d,f,p=(f="undefined"!=typeof document?null==(d=document.currentScript)?void 0:d.src:void 0,function(e){var r,t=function(){var r=dr.value;r in e||Object.defineProperty(e,r,{configurable:!0,get:function(){q("Access to module property ('"+r+"') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.")}})};void 0===e&&(e={});var n,i,d=Object.assign({},e),p=new Promise((function(e,r){n=e,i=r}));["_malloc","_free","_memory","_registerWasmPlayer","_setCodecType","_exitWasmPlayer","_initDecoder","_decodeCodecContext","_destroy","_demuxTsStream","_getPacket","_getVLCLen","_getVLC","_getVPSLen","_getVPS","_getSPSLen","_getSPS","_getPPSLen","_getPPS","_getSEILen","_getSEI","___indirect_function_table","_ff_h264_cabac_tables","onRuntimeInitialized"].forEach((function(e){Object.getOwnPropertyDescriptor(p,e)||Object.defineProperty(p,e,{get:function(){return q("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")},set:function(){return q("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})}));var m="object"==("undefined"==typeof window?"undefined":u(window)),h="function"==typeof importScripts,g="object"==("undefined"==typeof process?"undefined":u(process))&&"object"==u(process.versions)&&"string"==typeof process.versions.node,v=!m&&!g&&!h;if(d.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var E,y,w,b=Object.assign({},d),_="./this.program",S="";if(v){if("object"==("undefined"==typeof process?"undefined":u(process))||"object"==("undefined"==typeof window?"undefined":u(window))||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)")}else{if(!m&&!h)throw new Error("environment detection error");if(h?S=self.location.href:"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),f&&(S=f),S=S.startsWith("blob:")?"":S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1),"object"!=("undefined"==typeof window?"undefined":u(window))&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");E=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},h&&(w=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),y=function(e,r,t){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):t()},n.onerror=t,n.send(null)}}var O,T,k,A=d.print||console.log.bind(console),M=d.printErr||console.error.bind(console);Object.assign(d,b),b=null,O="fetchSettings",Object.getOwnPropertyDescriptor(d,O)&&q("`Module."+O+"` was supplied but `"+O+"` not included in INCOMING_MODULE_JS_API"),d.arguments&&d.arguments,ie("arguments","arguments_"),d.thisProgram&&(_=d.thisProgram),ie("thisProgram","thisProgram"),d.quit&&d.quit,ie("quit","quit_"),L(void 0===d.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),L(void 0===d.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),L(void 0===d.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),L(void 0===d.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),L(void 0===d.read,"Module.read option was removed (modify read_ in JS)"),L(void 0===d.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),L(void 0===d.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),L(void 0===d.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),L(void 0===d.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),ie("asm","wasmExports"),ie("read","read_"),ie("readAsync","readAsync"),ie("readBinary","readBinary"),ie("setWindowTitle","setWindowTitle"),L(!g,"node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."),L(!v,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable."),d.wasmBinary&&(T=d.wasmBinary),ie("wasmBinary","wasmBinary"),"object"!=("undefined"==typeof WebAssembly?"undefined":u(WebAssembly))&&M("no native wasm support detected");var P,F,C,D,x,I=!1;function L(e,r){e||q("Assertion failed"+(r?": "+r:""))}function N(){var e=k.buffer;d.HEAP8=P=new Int8Array(e),d.HEAP16=C=new Int16Array(e),d.HEAPU8=F=new Uint8Array(e),d.HEAPU16=new Uint16Array(e),d.HEAP32=D=new Int32Array(e),d.HEAPU32=x=new Uint32Array(e),d.HEAPF32=new Float32Array(e),d.HEAPF64=new Float64Array(e)}function R(){if(!I){var e=ir();0==e&&(e+=4);var r=x[e>>2],t=x[e+4>>2];34821223==r&&2310721022==t||q("Stack overflow! Stack cookie has been overwritten at "+le(e)+", expected hex dwords 0x89BACDFE and 0x2135467, but received "+le(t)+" "+le(r)),1668509029!=x[0]&&q("Runtime error: The application has corrupted its heap memory area (address zero)!")}}L(!d.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),L("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),L(!d.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),L(!d.INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),r=new Int8Array(e.buffer);if(e[0]=25459,115!==r[0]||99!==r[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var U=[],B=[],j=[],$=!1;L(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(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 W=0,H=null,z=null,V={};function G(e){for(var r=e;;){if(!V[e])return e;e=r+Math.random()}}function Y(e){var r;W++,null==(r=d.monitorRunDependencies)||r.call(d,W),e?(L(!V[e]),V[e]=1,null===H&&"undefined"!=typeof setInterval&&(H=setInterval((function(){if(I)return clearInterval(H),void(H=null);var e=!1;for(var r in V)e||(e=!0,M("still waiting on run dependencies:")),M("dependency: "+r);e&&M("(end of list)")}),1e4))):M("warning: run dependency added without ID")}function Q(e){var r;if(W--,null==(r=d.monitorRunDependencies)||r.call(d,W),e?(L(V[e]),delete V[e]):M("warning: run dependency removed without ID"),0==W&&(null!==H&&(clearInterval(H),H=null),z)){var t=z;z=null,t()}}function q(e){var r;null==(r=d.onAbort)||r.call(d,e),M(e="Aborted("+e+")"),I=!0;var t=new WebAssembly.RuntimeError(e);throw i(t),t}var K,X,J,Z=function(e){return e.startsWith("data:application/octet-stream;base64,")},ee=function(e){return e.startsWith("file://")};function re(e,r){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];L($,"native function `"+e+"` called before runtime initialization");var i=er[e];return L(i,"exported native function `"+e+"` not found"),L(n.length<=r,"native function `"+e+"` called with "+n.length+" args but expects "+r),i.apply(void 0,[].concat(n))}}function te(){var e,r="decoder.wasm";return Z(r)?r:(e=r,d.locateFile?d.locateFile(e,S):S+e)}function ne(e){if(e==K&&T)return new Uint8Array(T);if(w)return w(e);throw"both async and sync fetching of the wasm failed"}function oe(e,r,t){return function(e){return T||!m&&!h||"function"!=typeof fetch?Promise.resolve().then((function(){return ne(e)})):fetch(e,{credentials:"same-origin"}).then((function(r){if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()})).catch((function(){return ne(e)}))}(e).then((function(e){return WebAssembly.instantiate(e,r)})).then(t,(function(e){M("failed to asynchronously prepare wasm: "+e),ee(K)&&M("warning: Loading from a file URI ("+K+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),q(e)}))}function ie(e,r,t){void 0===t&&(t=!0),Object.getOwnPropertyDescriptor(d,e)||Object.defineProperty(d,e,{configurable:!0,get:function(){q("`Module."+e+"` has been replaced by `"+r+"`"+(t?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function ae(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}function se(e,r){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,e,{configurable:!0,get:function(){de("`"+e+"` is not longer defined by emscripten. "+r)}})}function ue(e){Object.getOwnPropertyDescriptor(d,e)||Object.defineProperty(d,e,{configurable:!0,get:function(){var r="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)";ae(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),q(r)}})}se("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),se("asm","Please use wasmExports instead");var ce=function(e){for(;e.length>0;)e.shift()(d)};d.noExitRuntime;var le=function(e){return L("number"==typeof e),"0x"+(e>>>=0).toString(16).padStart(8,"0")},de=function(e){var r;(r=de).shown||(r.shown={}),de.shown[e]||(de.shown[e]=1,M(e))};function fe(){L(null!=xe.varargs);var e=D[+xe.varargs>>2];return xe.varargs+=4,e}var pe=fe,me={isAbs:function(e){return"/"===e.charAt(0)},splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,r){for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:function(e){var r=me.isAbs(e),t="/"===e.substr(-1);return(e=me.normalizeArray(e.split("/").filter((function(e){return!!e})),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:function(e){var r=me.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(e){if("/"===e)return"/";var r=(e=(e=me.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return me.normalize(r.join("/"))},join2:function(e,r){return me.normalize(e+"/"+r)}},he=function(e){return(he=function(){if("object"==("undefined"==typeof crypto?"undefined":u(crypto))&&"function"==typeof crypto.getRandomValues)return function(e){return crypto.getRandomValues(e)};q("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}())(e)},ge={resolve:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];for(var n="",o=!1,i=r.length-1;i>=-1&&!o;i--){var a=i>=0?r[i]:Ce.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");if(!a)return"";n=a+"/"+n,o=me.isAbs(a)}return(o?"/":"")+(n=me.normalizeArray(n.split("/").filter((function(e){return!!e})),!o).join("/"))||"."},relative:function(e,r){var t=function(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)};e=ge.resolve(e).substr(1),r=ge.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},ve="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,Ee=function(e,r,t){for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&ve)return ve.decode(e.subarray(r,o));for(var i="";r<o;){var a=e[r++];if(128&a){var s=63&e[r++];if(192!=(224&a)){var u=63&e[r++];if(224==(240&a)?a=(15&a)<<12|s<<6|u:(240!=(248&a)&&de("Invalid UTF-8 leading byte "+le(a)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),a=(7&a)<<18|s<<12|u<<6|63&e[r++]),a<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},ye=[],we=function(e){for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},be=function(e,r,t,n){if(L("string"==typeof e,"stringToUTF8Array expects a string (got "+(void 0===e?"undefined":u(e))+")"),!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(t>=i)break;r[t++]=s}else if(s<=2047){if(t+1>=i)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=i)break;s>1114111&&de("Invalid Unicode code point "+le(s)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function _e(e,r,t){var n=we(e)+1,o=new Array(n),i=be(e,o,0,o.length);return o.length=i,o}var Se,Oe={ttys:[],init:function(){},shutdown:function(){},register:function(e,r){Oe.ttys[e]={input:[],output:[],ops:r},Ce.registerDevice(e,Oe.stream_ops)},stream_ops:{open:function(e){var r=Oe.ttys[e.node.rdev];if(!r)throw new Ce.ErrnoError(43);e.tty=r,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Ce.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Ce.ErrnoError(29)}if(void 0===s&&0===i)throw new Ce.ErrnoError(6);if(null==s)break;i++,r[t+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Ce.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch(e){throw new Ce.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){return function(){if(!ye.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;ye=_e(e)}return ye.shift()}()},put_char:function(e,r){null===r||10===r?(A(Ee(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync:function(e){e.output&&e.output.length>0&&(A(Ee(e.output,0)),e.output=[])},ioctl_tcgets:function(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets:function(e,r,t){return 0},ioctl_tiocgwinsz:function(e){return[24,80]}},default_tty1_ops:{put_char:function(e,r){null===r||10===r?(M(Ee(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync:function(e){e.output&&e.output.length>0&&(M(Ee(e.output,0)),e.output=[])}}},Te=function(e){q("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported")},ke={ops_table:null,mount:function(e){return ke.createNode(null,"/",16895,0)},createNode:function(e,r,t,n){var o;if(Ce.isBlkdev(t)||Ce.isFIFO(t))throw new Ce.ErrnoError(63);(o=ke).ops_table||(o.ops_table={dir:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,lookup:ke.node_ops.lookup,mknod:ke.node_ops.mknod,rename:ke.node_ops.rename,unlink:ke.node_ops.unlink,rmdir:ke.node_ops.rmdir,readdir:ke.node_ops.readdir,symlink:ke.node_ops.symlink},stream:{llseek:ke.stream_ops.llseek}},file:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:{llseek:ke.stream_ops.llseek,read:ke.stream_ops.read,write:ke.stream_ops.write,allocate:ke.stream_ops.allocate,mmap:ke.stream_ops.mmap,msync:ke.stream_ops.msync}},link:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,readlink:ke.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:Ce.chrdev_stream_ops}});var i=Ce.createNode(e,r,t,n);return Ce.isDir(i.mode)?(i.node_ops=ke.ops_table.dir.node,i.stream_ops=ke.ops_table.dir.stream,i.contents={}):Ce.isFile(i.mode)?(i.node_ops=ke.ops_table.file.node,i.stream_ops=ke.ops_table.file.stream,i.usedBytes=0,i.contents=null):Ce.isLink(i.mode)?(i.node_ops=ke.ops_table.link.node,i.stream_ops=ke.ops_table.link.stream):Ce.isChrdev(i.mode)&&(i.node_ops=ke.ops_table.chrdev.node,i.stream_ops=ke.ops_table.chrdev.stream),i.timestamp=Date.now(),e&&(e.contents[r]=i,e.timestamp=i.timestamp),i},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr:function(e){var r={};return r.dev=Ce.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,Ce.isDir(e.mode)?r.size=4096:Ce.isFile(e.mode)?r.size=e.usedBytes:Ce.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&ke.resizeFileStorage(e,r.size)},lookup:function(e,r){throw Ce.genericErrors[44]},mknod:function(e,r,t,n){return ke.createNode(e,r,t,n)},rename:function(e,r,t){if(Ce.isDir(e.mode)){var n;try{n=Ce.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new Ce.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink:function(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir:function(e,r){var t=Ce.lookupNode(e,r);for(var n in t.contents)throw new Ce.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir:function(e){for(var r,t=[".",".."],n=l(Object.keys(e.contents));!(r=n()).done;){var o=r.value;t.push(o)}return t},symlink:function(e,r,t){var n=ke.createNode(e,r,41471,0);return n.link=t,n},readlink:function(e){if(!Ce.isLink(e.mode))throw new Ce.ErrnoError(28);return e.link}},stream_ops:{read:function(e,r,t,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(L(a>=0),a>8&&i.subarray)r.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)r[t+s]=i[o+s];return a},write:function(e,r,t,n,o,i){if(L(!a(r,ArrayBuffer)),r.buffer===P.buffer&&(i=!1),!n)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return L(0===o,"canOwn must imply no weird position inside the file"),s.contents=r.subarray(t,t+n),s.usedBytes=n,n;if(0===s.usedBytes&&0===o)return s.contents=r.slice(t,t+n),s.usedBytes=n,n;if(o+n<=s.usedBytes)return s.contents.set(r.subarray(t,t+n),o),n}if(ke.expandFileStorage(s,o+n),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+n),o);else for(var u=0;u<n;u++)s.contents[o+u]=r[t+u];return s.usedBytes=Math.max(s.usedBytes,o+n),n},llseek:function(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&Ce.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Ce.ErrnoError(28);return n},allocate:function(e,r,t){ke.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap:function(e,r,t,n,o){if(!Ce.isFile(e.node.mode))throw new Ce.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==P.buffer){if((t>0||t+r<s.length)&&(s=s.subarray?s.subarray(t,t+r):Array.prototype.slice.call(s,t,t+r)),a=!0,!(i=Te()))throw new Ce.ErrnoError(48);P.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(e,r,t,n,o){return ke.stream_ops.write(e,r,0,n,t,!1),0}}},Ae=d.preloadPlugins||[],Me=function(e,r){var t=0;return e&&(t|=365),r&&(t|=146),t},Pe={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"},Fe={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},Ce={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:function(e){function r(r){var t;for(var n in(t=e.call(this,Pe[r])||this).name="ErrnoError",t.errno=r,Fe)if(Fe[n]===r){t.code=n;break}return t}return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&s(e,r)}(r,e),r}(c(Error)),genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:function(){function e(){this.shared={}}return o(e,[{key:"object",get:function(){return this.node},set:function(e){this.node=e}},{key:"isRead",get:function(){return 1!=(2097155&this.flags)}},{key:"isWrite",get:function(){return!!(2097155&this.flags)}},{key:"isAppend",get:function(){return 1024&this.flags}},{key:"flags",get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},{key:"position",get:function(){return this.shared.position},set:function(e){this.shared.position=e}}]),e}(),FSNode:function(){function e(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ce.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}return o(e,[{key:"read",get:function(){return(this.mode&this.readMode)===this.readMode},set:function(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}},{key:"write",get:function(){return(this.mode&this.writeMode)===this.writeMode},set:function(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}},{key:"isFolder",get:function(){return Ce.isDir(this.mode)}},{key:"isDevice",get:function(){return Ce.isChrdev(this.mode)}}]),e}(),lookupPath:function(e,r){if(void 0===r&&(r={}),!(e=ge.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new Ce.ErrnoError(32);for(var t=e.split("/").filter((function(e){return!!e})),n=Ce.root,o="/",i=0;i<t.length;i++){var a=i===t.length-1;if(a&&r.parent)break;if(n=Ce.lookupNode(n,t[i]),o=me.join2(o,t[i]),Ce.isMountpoint(n)&&(!a||a&&r.follow_mount)&&(n=n.mounted.root),!a||r.follow)for(var s=0;Ce.isLink(n.mode);){var u=Ce.readlink(o);if(o=ge.resolve(me.dirname(o),u),n=Ce.lookupPath(o,{recurse_count:r.recurse_count+1}).node,s++>40)throw new Ce.ErrnoError(32)}}return{path:o,node:n}},getPath:function(e){for(var r;;){if(Ce.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?t+"/"+r:t+r:t}r=r?e.name+"/"+r:e.name,e=e.parent}},hashName:function(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%Ce.nameTable.length},hashAddNode:function(e){var r=Ce.hashName(e.parent.id,e.name);e.name_next=Ce.nameTable[r],Ce.nameTable[r]=e},hashRemoveNode:function(e){var r=Ce.hashName(e.parent.id,e.name);if(Ce.nameTable[r]===e)Ce.nameTable[r]=e.name_next;else for(var t=Ce.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:function(e,r){var t=Ce.mayLookup(e);if(t)throw new Ce.ErrnoError(t);for(var n=Ce.hashName(e.id,r),o=Ce.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===r)return o}return Ce.lookup(e,r)},createNode:function(e,r,t,n){L("object"==(void 0===e?"undefined":u(e)));var o=new Ce.FSNode(e,r,t,n);return Ce.hashAddNode(o),o},destroyNode:function(e){Ce.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return!(49152&~e)},flagsToPermissionString:function(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:function(e,r){return Ce.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2},mayLookup:function(e){if(!Ce.isDir(e.mode))return 54;var r=Ce.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate:function(e,r){try{return Ce.lookupNode(e,r),20}catch(e){}return Ce.nodePermissions(e,"wx")},mayDelete:function(e,r,t){var n;try{n=Ce.lookupNode(e,r)}catch(e){return e.errno}var o=Ce.nodePermissions(e,"wx");if(o)return o;if(t){if(!Ce.isDir(n.mode))return 54;if(Ce.isRoot(n)||Ce.getPath(n)===Ce.cwd())return 10}else if(Ce.isDir(n.mode))return 31;return 0},mayOpen:function(e,r){return e?Ce.isLink(e.mode)?32:Ce.isDir(e.mode)&&("r"!==Ce.flagsToPermissionString(r)||512&r)?31:Ce.nodePermissions(e,Ce.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd:function(){for(var e=0;e<=Ce.MAX_OPEN_FDS;e++)if(!Ce.streams[e])return e;throw new Ce.ErrnoError(33)},getStreamChecked:function(e){var r=Ce.getStream(e);if(!r)throw new Ce.ErrnoError(8);return r},getStream:function(e){return Ce.streams[e]},createStream:function(e,r){return void 0===r&&(r=-1),e=Object.assign(new Ce.FSStream,e),-1==r&&(r=Ce.nextfd()),e.fd=r,Ce.streams[r]=e,e},closeStream:function(e){Ce.streams[e]=null},dupStream:function(e,r){var t,n;void 0===r&&(r=-1);var o=Ce.createStream(e,r);return null==(n=o.stream_ops)||null==(t=n.dup)||t.call(n,o),o},chrdev_stream_ops:{open:function(e){var r=Ce.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,null==e.stream_ops.open||e.stream_ops.open.call(e.stream_ops,e)},llseek:function(){throw new Ce.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,r){return e<<8|r},registerDevice:function(e,r){Ce.devices[e]={stream_ops:r}},getDevice:function(e){return Ce.devices[e]},getMounts:function(e){for(var r=[],t=[e];t.length;){var n,o=t.pop();r.push(o),(n=t).push.apply(n,[].concat(o.mounts))}return r},syncfs:function(e,r){"function"==typeof e&&(r=e,e=!1),Ce.syncFSRequests++,Ce.syncFSRequests>1&&M("warning: "+Ce.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=Ce.getMounts(Ce.root.mount),n=0;function o(e){return L(Ce.syncFSRequests>0),Ce.syncFSRequests--,r(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((function(r){if(!r.type.syncfs)return i(null);r.type.syncfs(r,e,i)}))},mount:function(e,r,t){if("string"==typeof e)throw e;var n,o="/"===t,i=!t;if(o&&Ce.root)throw new Ce.ErrnoError(10);if(!o&&!i){var a=Ce.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,Ce.isMountpoint(n))throw new Ce.ErrnoError(10);if(!Ce.isDir(n.mode))throw new Ce.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Ce.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(e){var r=Ce.lookupPath(e,{follow_mount:!1});if(!Ce.isMountpoint(r.node))throw new Ce.ErrnoError(28);var t=r.node,n=t.mounted,o=Ce.getMounts(n);Object.keys(Ce.nameTable).forEach((function(e){for(var r=Ce.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&Ce.destroyNode(r),r=t}})),t.mounted=null;var i=t.mount.mounts.indexOf(n);L(-1!==i),t.mount.mounts.splice(i,1)},lookup:function(e,r){return e.node_ops.lookup(e,r)},mknod:function(e,r,t){var n=Ce.lookupPath(e,{parent:!0}).node,o=me.basename(e);if(!o||"."===o||".."===o)throw new Ce.ErrnoError(28);var i=Ce.mayCreate(n,o);if(i)throw new Ce.ErrnoError(i);if(!n.node_ops.mknod)throw new Ce.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:function(e,r){return r=void 0!==r?r:438,r&=4095,r|=32768,Ce.mknod(e,r,0)},mkdir:function(e,r){return r=void 0!==r?r:511,r&=1023,r|=16384,Ce.mknod(e,r,0)},mkdirTree:function(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{Ce.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,r,t){return void 0===t&&(t=r,r=438),r|=8192,Ce.mknod(e,r,t)},symlink:function(e,r){if(!ge.resolve(e))throw new Ce.ErrnoError(44);var t=Ce.lookupPath(r,{parent:!0}).node;if(!t)throw new Ce.ErrnoError(44);var n=me.basename(r),o=Ce.mayCreate(t,n);if(o)throw new Ce.ErrnoError(o);if(!t.node_ops.symlink)throw new Ce.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename:function(e,r){var t,n,o=me.dirname(e),i=me.dirname(r),a=me.basename(e),s=me.basename(r);if(t=Ce.lookupPath(e,{parent:!0}).node,n=Ce.lookupPath(r,{parent:!0}).node,!t||!n)throw new Ce.ErrnoError(44);if(t.mount!==n.mount)throw new Ce.ErrnoError(75);var u,c=Ce.lookupNode(t,a),l=ge.relative(e,i);if("."!==l.charAt(0))throw new Ce.ErrnoError(28);if("."!==(l=ge.relative(r,o)).charAt(0))throw new Ce.ErrnoError(55);try{u=Ce.lookupNode(n,s)}catch(e){}if(c!==u){var d=Ce.isDir(c.mode),f=Ce.mayDelete(t,a,d);if(f)throw new Ce.ErrnoError(f);if(f=u?Ce.mayDelete(n,s,d):Ce.mayCreate(n,s))throw new Ce.ErrnoError(f);if(!t.node_ops.rename)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(c)||u&&Ce.isMountpoint(u))throw new Ce.ErrnoError(10);if(n!==t&&(f=Ce.nodePermissions(t,"w")))throw new Ce.ErrnoError(f);Ce.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(e){throw e}finally{Ce.hashAddNode(c)}}},rmdir:function(e){var r=Ce.lookupPath(e,{parent:!0}).node,t=me.basename(e),n=Ce.lookupNode(r,t),o=Ce.mayDelete(r,t,!0);if(o)throw new Ce.ErrnoError(o);if(!r.node_ops.rmdir)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(n))throw new Ce.ErrnoError(10);r.node_ops.rmdir(r,t),Ce.destroyNode(n)},readdir:function(e){var r=Ce.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new Ce.ErrnoError(54);return r.node_ops.readdir(r)},unlink:function(e){var r=Ce.lookupPath(e,{parent:!0}).node;if(!r)throw new Ce.ErrnoError(44);var t=me.basename(e),n=Ce.lookupNode(r,t),o=Ce.mayDelete(r,t,!1);if(o)throw new Ce.ErrnoError(o);if(!r.node_ops.unlink)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(n))throw new Ce.ErrnoError(10);r.node_ops.unlink(r,t),Ce.destroyNode(n)},readlink:function(e){var r=Ce.lookupPath(e).node;if(!r)throw new Ce.ErrnoError(44);if(!r.node_ops.readlink)throw new Ce.ErrnoError(28);return ge.resolve(Ce.getPath(r.parent),r.node_ops.readlink(r))},stat:function(e,r){var t=Ce.lookupPath(e,{follow:!r}).node;if(!t)throw new Ce.ErrnoError(44);if(!t.node_ops.getattr)throw new Ce.ErrnoError(63);return t.node_ops.getattr(t)},lstat:function(e){return Ce.stat(e,!0)},chmod:function(e,r,t){var n;if(!(n="string"==typeof e?Ce.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,r){Ce.chmod(e,r,!0)},fchmod:function(e,r){var t=Ce.getStreamChecked(e);Ce.chmod(t.node,r)},chown:function(e,r,t,n){var o;if(!(o="string"==typeof e?Ce.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,r,t){Ce.chown(e,r,t,!0)},fchown:function(e,r,t){var n=Ce.getStreamChecked(e);Ce.chown(n.node,r,t)},truncate:function(e,r){if(r<0)throw new Ce.ErrnoError(28);var t;if(!(t="string"==typeof e?Ce.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);if(Ce.isDir(t.mode))throw new Ce.ErrnoError(31);if(!Ce.isFile(t.mode))throw new Ce.ErrnoError(28);var n=Ce.nodePermissions(t,"w");if(n)throw new Ce.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate:function(e,r){var t=Ce.getStreamChecked(e);if(!(2097155&t.flags))throw new Ce.ErrnoError(28);Ce.truncate(t.node,r)},utime:function(e,r,t){var n=Ce.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open:function(e,r,t){if(""===e)throw new Ce.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?function(e){var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error("Unknown file open mode: "+e);return r}(r):r)?4095&t|32768:0,"object"==(void 0===e?"undefined":u(e)))n=e;else{e=me.normalize(e);try{n=Ce.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var o=!1;if(64&r)if(n){if(128&r)throw new Ce.ErrnoError(20)}else n=Ce.mknod(e,t,0),o=!0;if(!n)throw new Ce.ErrnoError(44);if(Ce.isChrdev(n.mode)&&(r&=-513),65536&r&&!Ce.isDir(n.mode))throw new Ce.ErrnoError(54);if(!o){var i=Ce.mayOpen(n,r);if(i)throw new Ce.ErrnoError(i)}512&r&&!o&&Ce.truncate(n,0),r&=-131713;var a=Ce.createStream({node:n,path:Ce.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!d.logReadFiles||1&r||(Ce.readFiles||(Ce.readFiles={}),e in Ce.readFiles||(Ce.readFiles[e]=1)),a},close:function(e){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ce.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,r,t){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ce.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new Ce.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read:function(e,r,t,n,o){if(L(t>=0),n<0||o<0)throw new Ce.ErrnoError(28);if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(1==(2097155&e.flags))throw new Ce.ErrnoError(8);if(Ce.isDir(e.node.mode))throw new Ce.ErrnoError(31);if(!e.stream_ops.read)throw new Ce.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Ce.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,r,t,n,o);return i||(e.position+=a),a},write:function(e,r,t,n,o,i){if(L(t>=0),n<0||o<0)throw new Ce.ErrnoError(28);if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(!(2097155&e.flags))throw new Ce.ErrnoError(8);if(Ce.isDir(e.node.mode))throw new Ce.ErrnoError(31);if(!e.stream_ops.write)throw new Ce.ErrnoError(28);e.seekable&&1024&e.flags&&Ce.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Ce.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,i);return a||(e.position+=s),s},allocate:function(e,r,t){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(r<0||t<=0)throw new Ce.ErrnoError(28);if(!(2097155&e.flags))throw new Ce.ErrnoError(8);if(!Ce.isFile(e.node.mode)&&!Ce.isDir(e.node.mode))throw new Ce.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ce.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap:function(e,r,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new Ce.ErrnoError(2);if(1==(2097155&e.flags))throw new Ce.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ce.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:function(e,r,t,n,o){return L(t>=0),e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0},ioctl:function(e,r,t){if(!e.stream_ops.ioctl)throw new Ce.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile:function(e,r){if(void 0===r&&(r={}),r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error('Invalid encoding type "'+r.encoding+'"');var t,n=Ce.open(e,r.flags),o=Ce.stat(e).size,i=new Uint8Array(o);return Ce.read(n,i,0,o,0),"utf8"===r.encoding?t=Ee(i,0):"binary"===r.encoding&&(t=i),Ce.close(n),t},writeFile:function(e,r,t){void 0===t&&(t={}),t.flags=t.flags||577;var n=Ce.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(we(r)+1),i=be(r,o,0,o.length);Ce.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");Ce.write(n,r,0,r.byteLength,void 0,t.canOwn)}Ce.close(n)},cwd:function(){return Ce.currentPath},chdir:function(e){var r=Ce.lookupPath(e,{follow:!0});if(null===r.node)throw new Ce.ErrnoError(44);if(!Ce.isDir(r.node.mode))throw new Ce.ErrnoError(54);var t=Ce.nodePermissions(r.node,"x");if(t)throw new Ce.ErrnoError(t);Ce.currentPath=r.path},createDefaultDirectories:function(){Ce.mkdir("/tmp"),Ce.mkdir("/home"),Ce.mkdir("/home/web_user")},createDefaultDevices:function(){Ce.mkdir("/dev"),Ce.registerDevice(Ce.makedev(1,3),{read:function(){return 0},write:function(e,r,t,n,o){return n}}),Ce.mkdev("/dev/null",Ce.makedev(1,3)),Oe.register(Ce.makedev(5,0),Oe.default_tty_ops),Oe.register(Ce.makedev(6,0),Oe.default_tty1_ops),Ce.mkdev("/dev/tty",Ce.makedev(5,0)),Ce.mkdev("/dev/tty1",Ce.makedev(6,0));var e=new Uint8Array(1024),r=0,t=function(){return 0===r&&(r=he(e).byteLength),e[--r]};Ce.createDevice("/dev","random",t),Ce.createDevice("/dev","urandom",t),Ce.mkdir("/dev/shm"),Ce.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){Ce.mkdir("/proc");var e=Ce.mkdir("/proc/self");Ce.mkdir("/proc/self/fd"),Ce.mount({mount:function(){var r=Ce.createNode(e,"fd",16895,73);return r.node_ops={lookup:function(e,r){var t=+r,n=Ce.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams:function(){d.stdin?Ce.createDevice("/dev","stdin",d.stdin):Ce.symlink("/dev/tty","/dev/stdin"),d.stdout?Ce.createDevice("/dev","stdout",null,d.stdout):Ce.symlink("/dev/tty","/dev/stdout"),d.stderr?Ce.createDevice("/dev","stderr",null,d.stderr):Ce.symlink("/dev/tty1","/dev/stderr");var e=Ce.open("/dev/stdin",0),r=Ce.open("/dev/stdout",1),t=Ce.open("/dev/stderr",1);L(0===e.fd,"invalid handle for stdin ("+e.fd+")"),L(1===r.fd,"invalid handle for stdout ("+r.fd+")"),L(2===t.fd,"invalid handle for stderr ("+t.fd+")")},staticInit:function(){[44].forEach((function(e){Ce.genericErrors[e]=new Ce.ErrnoError(e),Ce.genericErrors[e].stack="<generic error, no stack>"})),Ce.nameTable=new Array(4096),Ce.mount(ke,{},"/"),Ce.createDefaultDirectories(),Ce.createDefaultDevices(),Ce.createSpecialDirectories(),Ce.filesystems={MEMFS:ke}},init:function(e,r,t){L(!Ce.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),Ce.init.initialized=!0,d.stdin=e||d.stdin,d.stdout=r||d.stdout,d.stderr=t||d.stderr,Ce.createStandardStreams()},quit:function(){Ce.init.initialized=!1,tr(0);for(var e=0;e<Ce.streams.length;e++){var r=Ce.streams[e];r&&Ce.close(r)}},findObject:function(e,r){var t=Ce.analyzePath(e,r);return t.exists?t.object:null},analyzePath:function(e,r){try{e=(n=Ce.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Ce.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=me.basename(e),n=Ce.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath:function(e,r,t,n){e="string"==typeof e?e:Ce.getPath(e);for(var o=r.split("/").reverse();o.length;){var i=o.pop();if(i){var a=me.join2(e,i);try{Ce.mkdir(a)}catch(e){}e=a}}return a},createFile:function(e,r,t,n,o){var i=me.join2("string"==typeof e?e:Ce.getPath(e),r),a=Me(n,o);return Ce.create(i,a)},createDataFile:function(e,r,t,n,o,i){var a=r;e&&(e="string"==typeof e?e:Ce.getPath(e),a=r?me.join2(e,r):e);var s=Me(n,o),u=Ce.create(a,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),l=0,d=t.length;l<d;++l)c[l]=t.charCodeAt(l);t=c}Ce.chmod(u,146|s);var f=Ce.open(u,577);Ce.write(f,t,0,t.length,0,i),Ce.close(f),Ce.chmod(u,s)}},createDevice:function(e,r,t,n){var o=me.join2("string"==typeof e?e:Ce.getPath(e),r),i=Me(!!t,!!n);Ce.createDevice.major||(Ce.createDevice.major=64);var a=Ce.makedev(Ce.createDevice.major++,0);return Ce.registerDevice(a,{open:function(e){e.seekable=!1},close:function(e){var r;(null==n||null==(r=n.buffer)?void 0:r.length)&&n(10)},read:function(e,r,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(e){throw new Ce.ErrnoError(29)}if(void 0===u&&0===a)throw new Ce.ErrnoError(6);if(null==u)break;a++,r[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:function(e,r,t,o,i){for(var a=0;a<o;a++)try{n(r[t+a])}catch(e){throw new Ce.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Ce.mkdev(o,i,a)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!E)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=_e(E(e.url)),e.usedBytes=e.contents.length}catch(e){throw new Ce.ErrnoError(29)}},createLazyFile:function(e,r,t,n,i){var a=function(){function e(){this.lengthKnown=!1,this.chunks=[]}var r=e.prototype;return r.get=function(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},r.setDataGetter=function(e){this.getter=e},r.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,i=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,a=1048576;o||(a=n);var s=this;s.setDataGetter((function(e){var r=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,r){if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):_e(o.responseText||"")}(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,A("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},o(e,[{key:"length",get:function(){return this.lengthKnown||this.cacheLength(),this._length}},{key:"chunkSize",get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}]),e}();if("undefined"!=typeof XMLHttpRequest){if(!h)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s={isDevice:!1,contents:new a}}else s={isDevice:!1,url:t};var u=Ce.createFile(e,r,s,n,i);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,r,t,n,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(L(a>=0),i.slice)for(var s=0;s<a;s++)r[t+s]=i[o+s];else for(s=0;s<a;s++)r[t+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((function(e){var r=u.stream_ops[e];c[e]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ce.forceLoadFile(u),r.apply(void 0,[].concat(t))}})),c.read=function(e,r,t,n,o){return Ce.forceLoadFile(u),l(e,r,t,n,o)},c.mmap=function(e,r,t,n,o){Ce.forceLoadFile(u);var i=Te();if(!i)throw new Ce.ErrnoError(48);return l(e,P,i,r,t),{ptr:i,allocated:!0}},u.stream_ops=c,u},absolutePath:function(){q("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder:function(){q("FS.createFolder has been removed; use FS.mkdir instead")},createLink:function(){q("FS.createLink has been removed; use FS.symlink instead")},joinPath:function(){q("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc:function(){q("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath:function(){q("FS.standardizePath has been removed; use PATH.normalize instead")}},De=function(e,r){return L("number"==typeof e,"UTF8ToString expects a number (got "+(void 0===e?"undefined":u(e))+")"),e?Ee(F,e,r):""},xe={DEFAULT_POLLMASK:5,calculateAt:function(e,r,t){if(me.isAbs(r))return r;var n;if(n=-100===e?Ce.cwd():xe.getStreamFromFD(e).path,0==r.length){if(!t)throw new Ce.ErrnoError(44);return n}return me.join2(n,r)},doStat:function(e,r,t){var n=e(r);D[t>>2]=n.dev,D[t+4>>2]=n.mode,x[t+8>>2]=n.nlink,D[t+12>>2]=n.uid,D[t+16>>2]=n.gid,D[t+20>>2]=n.rdev,J=[n.size>>>0,(X=n.size,+Math.abs(X)>=1?X>0?+Math.floor(X/4294967296)>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],D[t+24>>2]=J[0],D[t+28>>2]=J[1],D[t+32>>2]=4096,D[t+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return J=[Math.floor(o/1e3)>>>0,(X=Math.floor(o/1e3),+Math.abs(X)>=1?X>0?+Math.floor(X/4294967296)>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],D[t+40>>2]=J[0],D[t+44>>2]=J[1],x[t+48>>2]=o%1e3*1e3,J=[Math.floor(i/1e3)>>>0,(X=Math.floor(i/1e3),+Math.abs(X)>=1?X>0?+Math.floor(X/4294967296)>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],D[t+56>>2]=J[0],D[t+60>>2]=J[1],x[t+64>>2]=i%1e3*1e3,J=[Math.floor(a/1e3)>>>0,(X=Math.floor(a/1e3),+Math.abs(X)>=1?X>0?+Math.floor(X/4294967296)>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],D[t+72>>2]=J[0],D[t+76>>2]=J[1],x[t+80>>2]=a%1e3*1e3,J=[n.ino>>>0,(X=n.ino,+Math.abs(X)>=1?X>0?+Math.floor(X/4294967296)>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],D[t+88>>2]=J[0],D[t+92>>2]=J[1],0},doMsync:function(e,r,t,n,o){if(!Ce.isFile(r.node.mode))throw new Ce.ErrnoError(43);if(2&n)return 0;var i=F.slice(e,e+t);Ce.msync(r,i,o,t,n)},getStreamFromFD:function(e){return Ce.getStreamChecked(e)},varargs:void 0,getStr:function(e){return De(e)}},Ie=function(e,r){return L(e==e>>>0||e==(0|e)),L(r===(0|r)),r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN},Le=[0,31,60,91,121,152,182,213,244,274,305,335],Ne=[0,31,59,90,120,151,181,212,243,273,304,334],Re=function(e){var r;return((r=e.getFullYear())%4!=0||r%100==0&&r%400!=0?Ne:Le)[e.getMonth()]+e.getDate()-1},Ue=function(e,r,t){return L("number"==typeof t,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),be(e,F,r,t)};Se=function(){return performance.now()};var Be,je,$e=function(e){var r=k.buffer,t=(e-r.byteLength+65535)/65536;try{return k.grow(t),N(),1}catch(t){M("growMemory: Attempted to grow heap from "+r.byteLength+" bytes to "+e+" bytes, but got error: "+t)}},We={},He=function(){if(!He.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==("undefined"==typeof navigator?"undefined":u(navigator))&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:_||"./this.program"};for(var r in We)void 0===We[r]?delete e[r]:e[r]=We[r];var t=[];for(var r in e)t.push(r+"="+e[r]);He.strings=t}return He.strings},ze=function(e){return sr(e)},Ve=function(e,r,t,n,o){var i={string:function(e){var r=0;return null!=e&&0!==e&&(r=function(e){var r=we(e)+1,t=ze(r);return Ue(e,t,r),t}(e)),r},array:function(e){var r,t,n=ze(e.length);return t=n,L((r=e).length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),P.set(r,t),n}},a=function(e){var r=d["_"+e];return L(r,"Cannot call unknown function "+e+", make sure it is exported"),r}(e),s=[],u=0;if(L("array"!==r,'Return type should not be "array".'),n)for(var c=0;c<n.length;c++){var l=i[t[c]];l?(0===u&&(u=ur()),s[c]=l(n[c])):s[c]=n[c]}var f=a.apply(void 0,[].concat(s));return f=function(e){return 0!==u&&ar(u),function(e){return"string"===r?De(e):"boolean"===r?Boolean(e):e}(e)}(f)},Ge=function(e,r){L(e<16384),e<128?r.push(e):r.push(e%128|128,e>>7)},Ye=function(e,r){var t;if(L(!r.includes("j"),"i64 not permitted in function signatures when WASM_BIGINT is disabled"),"function"==typeof WebAssembly.Function)return new WebAssembly.Function(function(e){L(!e.includes("j"),"i64 not permitted in function signatures when WASM_BIGINT is disabled");for(var r={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},t={parameters:[],results:"v"==e[0]?[]:[r[e[0]]]},n=1;n<e.length;++n)L(e[n]in r,"invalid signature char: "+e[n]),t.parameters.push(r[e[n]]);return t}(r),e);var n=[1];!function(e,r){var t=e.slice(0,1),n=e.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};r.push(96),Ge(n.length,r);for(var i=0;i<n.length;++i)L(n[i]in o,"invalid signature char: "+n[i]),r.push(o[n[i]]);"v"==t?r.push(0):r.push(1,o[t])}(r,n);var o=[0,97,115,109,1,0,0,0,1];Ge(n.length,o),(t=o).push.apply(t,[].concat(n)),o.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var i=new WebAssembly.Module(new Uint8Array(o));return new WebAssembly.Instance(i,{e:{f:e}}).exports.f},Qe=[],qe=function(e){var r=Qe[e];return r||(e>=Qe.length&&(Qe.length=e+1),Qe[e]=r=Be.get(e)),L(Be.get(e)==r,"JavaScript-side Wasm function table mirror is out of date!"),r},Ke=function(e){return je||(je=new WeakMap,function(e,r){if(je)for(var t=e;t<e+r;t++){var n=qe(t);n&&je.set(n,t)}}(0,Be.length)),je.get(e)||0},Xe=[],Je=function(e,r){Be.set(e,r),Qe[e]=Be.get(e)};Ce.createPreloadedFile=function(e,r,t,n,o,i,a,s,u,c){var l=function(t){function l(t){null==c||c(),s||function(e,r,t,n,o,i){Ce.createDataFile(e,r,t,n,o,i)}(e,r,t,n,o,u),null==i||i(),Q(f)}(function(e,r,t,n){"undefined"!=typeof Browser&&Browser.init();var o=!1;return Ae.forEach((function(i){o||i.canHandle(r)&&(i.handle(e,r,t,n),o=!0)})),o})(t,d,l,(function(){null==a||a(),Q(f)}))||l(t)},d=r?ge.resolve(me.join2(e,r)):e,f=G("cp "+d);Y(f),"string"==typeof t?function(e,r,t,n){var o=G("al "+e);y(e,(function(t){L(t,'Loading data file "'+e+'" failed (no arrayBuffer).'),r(new Uint8Array(t)),o&&Q(o)}),(function(r){if(!t)throw'Loading data file "'+e+'" failed.';t()})),o&&Y(o)}(t,l,a):l(t)},Ce.staticInit();var Ze={__syscall_fcntl64:function(e,r,t){xe.varargs=t;try{var n=xe.getStreamFromFD(e);switch(r){case 0:if((o=fe())<0)return-28;for(;Ce.streams[o];)o++;return Ce.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=fe();return n.flags|=o,0;case 12:return o=pe(),C[o+0>>1]=2,0}return-28}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_openat:function(e,r,t,n){xe.varargs=n;try{r=xe.getStr(r),r=xe.calculateAt(e,r);var o=n?fe():0;return Ce.open(r,t,o).fd}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},_abort_js:function(){q("native code called abort()")},_emscripten_get_now_is_monotonic:function(){return 1},_emscripten_memcpy_js:function(e,r,t){return F.copyWithin(e,r,r+t)},_gmtime_js:function(e,r,t){var n=Ie(e,r),o=new Date(1e3*n);D[t>>2]=o.getUTCSeconds(),D[t+4>>2]=o.getUTCMinutes(),D[t+8>>2]=o.getUTCHours(),D[t+12>>2]=o.getUTCDate(),D[t+16>>2]=o.getUTCMonth(),D[t+20>>2]=o.getUTCFullYear()-1900,D[t+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),a=(o.getTime()-i)/864e5|0;D[t+28>>2]=a},_localtime_js:function(e,r,t){var n=Ie(e,r),o=new Date(1e3*n);D[t>>2]=o.getSeconds(),D[t+4>>2]=o.getMinutes(),D[t+8>>2]=o.getHours(),D[t+12>>2]=o.getDate(),D[t+16>>2]=o.getMonth(),D[t+20>>2]=o.getFullYear()-1900,D[t+24>>2]=o.getDay();var i=0|Re(o);D[t+28>>2]=i,D[t+36>>2]=-60*o.getTimezoneOffset();var a=new Date(o.getFullYear(),0,1),s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),u=a.getTimezoneOffset(),c=0|(s!=u&&o.getTimezoneOffset()==Math.min(u,s));D[t+32>>2]=c},_mktime_js:function(e){var r,t=function(){var r=new Date(D[e+20>>2]+1900,D[e+16>>2],D[e+12>>2],D[e+8>>2],D[e+4>>2],D[e>>2],0),t=D[e+32>>2],n=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=Math.min(a,i);if(t<0)D[e+32>>2]=Number(i!=a&&s==n);else if(t>0!=(s==n)){var u=Math.max(a,i),c=t>0?s:u;r.setTime(r.getTime()+6e4*(c-n))}D[e+24>>2]=r.getDay();var l=0|Re(r);D[e+28>>2]=l,D[e>>2]=r.getSeconds(),D[e+4>>2]=r.getMinutes(),D[e+8>>2]=r.getHours(),D[e+12>>2]=r.getDate(),D[e+16>>2]=r.getMonth(),D[e+20>>2]=r.getYear();var d=r.getTime();return isNaN(d)?-1:d/1e3}();return X=t,r=+Math.abs(X)>=1?X>0?+Math.floor(X/4294967296)>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0,nr(r),t>>>0},_tzset_js:function(e,r,t,n){var o=(new Date).getFullYear(),i=new Date(o,0,1),a=new Date(o,6,1),s=i.getTimezoneOffset(),u=a.getTimezoneOffset(),c=Math.max(s,u);x[e>>2]=60*c,D[r>>2]=Number(s!=u);var l=function(e){return e.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1]},d=l(i),f=l(a);L(d),L(f),L(we(d)<=16,"timezone name truncated to fit in TZNAME_MAX ("+d+")"),L(we(f)<=16,"timezone name truncated to fit in TZNAME_MAX ("+f+")"),u<s?(Ue(d,t,17),Ue(f,n,17)):(Ue(d,n,17),Ue(f,t,17))},emscripten_date_now:function(){return Date.now()},emscripten_get_now:Se,emscripten_resize_heap:function(e){var r=F.length;L((e>>>=0)>r);var t=2147483648;if(e>t)return M("Cannot enlarge memory, requested "+e+" bytes, but the limit is "+t+" bytes!"),!1;for(var n,o,i=1;i<=4;i*=2){var a=r*(1+.2/i);a=Math.min(a,e+100663296);var s=Math.min(t,(n=Math.max(e,a))+((o=65536)-n%o)%o);if($e(s))return!0}return M("Failed to grow the heap from "+r+" bytes to "+s+" bytes, not enough memory!"),!1},environ_get:function(e,r){var t=0;return He().forEach((function(n,o){var i=r+t;x[e+4*o>>2]=i,function(e,r){for(var t=0;t<e.length;++t)L(e.charCodeAt(t)===(255&e.charCodeAt(t))),P[r++]=e.charCodeAt(t);P[r]=0}(n,i),t+=n.length+1})),0},environ_sizes_get:function(e,r){var t=He();x[e>>2]=t.length;var n=0;return t.forEach((function(e){return n+=e.length+1})),x[r>>2]=n,0},fd_close:function(e){try{var r=xe.getStreamFromFD(e);return Ce.close(r),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},fd_fdstat_get:function(e,r){try{var t=xe.getStreamFromFD(e),n=t.tty?2:Ce.isDir(t.mode)?3:Ce.isLink(t.mode)?7:4;return P[r]=n,C[r+2>>1]=0,J=[0,(X=0,+Math.abs(X)>=1?X>0?+Math.floor(X/4294967296)>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],D[r+8>>2]=J[0],D[r+12>>2]=J[1],J=[0,(X=0,+Math.abs(X)>=1?X>0?+Math.floor(X/4294967296)>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],D[r+16>>2]=J[0],D[r+20>>2]=J[1],0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},fd_read:function(e,r,t,n){try{var o=function(e,r,t,n){for(var o=0,i=0;i<t;i++){var a=x[r>>2],s=x[r+4>>2];r+=8;var u=Ce.read(e,P,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}(xe.getStreamFromFD(e),r,t);return x[n>>2]=o,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},fd_seek:function(e,r,t,n,o){var i=Ie(r,t);try{if(isNaN(i))return 61;var a=xe.getStreamFromFD(e);return Ce.llseek(a,i,n),J=[a.position>>>0,(X=a.position,+Math.abs(X)>=1?X>0?+Math.floor(X/4294967296)>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],D[o>>2]=J[0],D[o+4>>2]=J[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},fd_write:function(e,r,t,n){try{var o=function(e,r,t,n){for(var o=0,i=0;i<t;i++){var a=x[r>>2],s=x[r+4>>2];r+=8;var u=Ce.write(e,P,a,s,n);if(u<0)return-1;o+=u}return o}(xe.getStreamFromFD(e),r,t);return x[n>>2]=o,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}}},er=function(){var e={env:Ze,wasi_snapshot_preview1:Ze};function r(e,r){var t;return er=e.exports,L(k=er.memory,"memory not found in wasm exports"),N(),L(Be=er.__indirect_function_table,"table not found in wasm exports"),t=er.__wasm_call_ctors,B.unshift(t),Q("wasm-instantiate"),er}Y("wasm-instantiate");var t,n,o,a,s=d;if(d.instantiateWasm)try{return d.instantiateWasm(e,r)}catch(e){M("Module.instantiateWasm callback failed with error: "+e),i(e)}return K||(K=te()),(t=T,n=K,o=e,a=function(e){L(d===s,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),s=null,r(e.instance)},t||"function"!=typeof WebAssembly.instantiateStreaming||Z(n)||"function"!=typeof fetch?oe(n,o,a):fetch(n,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,o).then(a,(function(e){return M("wasm streaming compile failed: "+e),M("falling back to ArrayBuffer instantiation"),oe(n,o,a)}))}))).catch(i),{}}();d._malloc=re("malloc",1),d._free=re("free",1),d._registerWasmPlayer=re("registerWasmPlayer",0),d._setCodecType=re("setCodecType",4),d._exitWasmPlayer=re("exitWasmPlayer",1),d._initDecoder=re("initDecoder",1),d._decodeCodecContext=re("decodeCodecContext",5),d._destroy=re("destroy",1),d._demuxTsStream=re("demuxTsStream",3),d._getPacket=re("getPacket",0),d._getVLCLen=re("getVLCLen",0),d._getVLC=re("getVLC",0),d._getVPSLen=re("getVPSLen",0),d._getVPS=re("getVPS",0),d._getSPSLen=re("getSPSLen",0),d._getSPS=re("getSPS",0),d._getPPSLen=re("getPPSLen",0),d._getPPS=re("getPPS",0),d._getSEILen=re("getSEILen",0),d._getSEI=re("getSEI",0);var rr,tr=re("fflush",1),nr=re("_emscripten_tempret_set",1),or=function(){return(or=er.emscripten_stack_init)()},ir=function(){return(ir=er.emscripten_stack_get_end)()},ar=function(e){return(ar=er._emscripten_stack_restore)(e)},sr=function(e){return(sr=er._emscripten_stack_alloc)(e)},ur=function(){return(ur=er.emscripten_stack_get_current)()};function cr(){var e;or(),L(!(3&(e=ir()))),0==e&&(e+=4),x[e>>2]=34821223,x[e+4>>2]=2310721022,x[0]=1668509029}function lr(){function e(){rr||(rr=!0,d.calledRun=!0,I||(L(!$),$=!0,R(),d.noFSInit||Ce.init.initialized||Ce.init(),Ce.ignorePermissions=!1,ce(B),n(d),d.onRuntimeInitialized&&d.onRuntimeInitialized(),L(!d._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(R(),d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;)e=d.postRun.shift(),j.unshift(e);var e;ce(j)}()))}W>0||(cr(),function(){if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)e=d.preRun.shift(),U.unshift(e);var e;ce(U)}(),W>0||(d.setStatus?(d.setStatus("Running..."),setTimeout((function(){setTimeout((function(){d.setStatus("")}),1),e()}),1)):e(),R()))}if(d.dynCall_jiji=re("dynCall_jiji",5),d.dynCall_iiiiij=re("dynCall_iiiiij",7),d.dynCall_jiiij=re("dynCall_jiiij",6),d._ff_h264_cabac_tables=113148,d.run=lr,d.ccall=Ve,d.cwrap=function(e,r,t,n){return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return Ve(e,r,t,o)}},d.addFunction=function(e,r){L(void 0!==e);var t=Ke(e);if(t)return t;for(var n=0;n<Be.length;n++)L(qe(n)!=e,"function in Table but not functionsInTableMap");var o=function(){if(Xe.length)return Xe.pop();try{Be.grow(1)}catch(e){if(!a(e,RangeError))throw e;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return Be.length-1}();try{Je(o,e)}catch(t){if(!a(t,TypeError))throw t;L(void 0!==r,"Missing signature argument to addFunction: "+e);var i=Ye(e,r);Je(o,i)}return je.set(e,o),o},d.removeFunction=function(e){je.delete(qe(e)),Je(e,null),Xe.push(e)},["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","getTempRet0","exitJS","arraySum","addDays","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","emscriptenLog","readEmAsmArgs","jstoi_q","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","getCallstack","convertPCtoSourceLocation","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","ExceptionInfo","findMatchingCatch","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","FS_unlink","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","demangle","stackTrace"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get:function(){var r="`"+e+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line",t=e;t.startsWith("_")||(t="$"+e),r+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='"+t+"')",ae(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),de(r)}}),ue(e)})),["addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createLazyFile","FS_createLink","FS_createDevice","FS_readFile","out","err","callMain","abort","wasmMemory","wasmExports","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","stackSave","stackRestore","stackAlloc","setTempRet0","ptrToString","zeroMemory","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","ERRNO_CODES","ERRNO_MESSAGES","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","readEmAsmArgsArray","jstoi_s","getExecutableName","asyncLoad","alignMemory","mmapAlloc","wasmTable","noExitRuntime","getCFunc","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","freeTableIndexes","functionsInTableMap","getEmptyTableSlot","updateTableMap","getFunctionAddress","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","Browser","getPreloadedImageData__data","wget","SYSCALLS","preloadPlugins","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS","FS_createDataFile","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack"].forEach(ue),z=function e(){rr||lr(),rr||(z=e)},d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);d.preInit.length>0;)d.preInit.pop()();lr(),r=p;for(var dr,fr=l(Object.keys(d));!(dr=fr()).done;)t();return r});"object"===u(r)&&"object"===u(e)&&(e.exports=p)}(t,t.exports);var n,o,i,a,s=r(t.exports),u="wasmLoading",c="wasmLoaded",l="wasmFailed",d="registerWasmPlayer",f="videoCallback",p="decodeCodecContext",m="destroy",h="demuxTsStream",g="demuxCoreReceive",v="readPacket",E="readPacketEnd",y="mediaInfo",w=function(e,r){return{cmd:e,data:r}},b=(n="undefined"!=typeof self?self:window,o={navigator:void 0!==n.navigator?n.navigator:{userAgent:""},infoMap:{engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","360","360SE","360EE","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet","iPad"]}},i={getMatchMap:function(e){return{Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,Edge:e.indexOf("Edge")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Arora:e.indexOf("Arora")>-1,Lunascape:e.indexOf("Lunascape")>-1,QupZilla:e.indexOf("QupZilla")>-1,"Coc Coc":e.indexOf("coc_coc_browser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,Iceweasel:e.indexOf("Iceweasel")>-1,Konqueror:e.indexOf("Konqueror")>-1,Iceape:e.indexOf("Iceape")>-1,SeaMonkey:e.indexOf("SeaMonkey")>-1,Epiphany:e.indexOf("Epiphany")>-1,360:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1,"360EE":e.indexOf("360EE")>-1,"360SE":e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Nexus 7")>-1,iPad:e.indexOf("iPad")>-1}},matchInfoMap:function(e){var r,t=(null==(r=o.navigator)?void 0:r.userAgent)||"",n=i.getMatchMap(t);for(var a in o.infoMap)for(var s=0;s<o.infoMap[a].length;s++){var u=o.infoMap[a][s];n[u]&&(e[a]=u)}},getOS:function(){var e=this;return i.matchInfoMap(e),null==e?void 0:e.os},getOSVersion:function(){var e=this,r=o.navigator.userAgent||"";e.osVersion="";var t={Windows:function(){var e=r.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[e]||e},Android:function(){return r.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return r.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return r.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return r.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return r.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return r.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};return"function"==typeof t[e.os]&&(e.osVersion=t[e.os](),e.osVersion==r&&(e.osVersion="")),e.osVersion},getOrientationStatu:function(){return window.matchMedia("(orientation: portrait)").matches?"vertical":"horizontal"},getDeviceType:function(){var e=this;return e.device="PC",i.matchInfoMap(e),e.device},getNetwork:function(){var e,r,t,n;return null==(e=(null==(r=navigator)?void 0:r.connection)||(null==(t=navigator)?void 0:t.mozConnection)||(null==(n=navigator)?void 0:n.webkitConnection))?void 0:e.effectiveType},getLanguage:function(){var e,r,t;return this.language=((t=((null==(e=o.navigator)?void 0:e.browserLanguage)||(null==(r=o.navigator)?void 0:r.language)).split("-"))[1]&&(t[1]=t[1].toUpperCase()),t.join("_")),this.language},createFingerprint:function(e){var r=document.createElement("canvas"),t=r.getContext("2d"),n=e||window.location.host;t.textBaseline="top",t.font="14px 'Arial'",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText(n,4,17);var o=r.toDataURL().replace("data:image/png;base64,","");return function(e){var r,t,n,o="";for(r=0,t=(e+="").length;r<t;r++)o+=(n=e.charCodeAt(r).toString(16)).length<2?"0"+n:n;return o}(atob(o).slice(-16,-12))},getBrowserInfo:function(){var e=this;i.matchInfoMap(e);var r=o.navigator.userAgent||"",t=function(e,r){var t=o.navigator.mimeTypes;for(var n in t)if(t[n][e]==r)return!0;return!1},a=i.getMatchMap(r),s=!1;if(n.chrome){var u=r.replace(/^.*Chrome\/([\d]+).*$/,"$1");+u>36&&n.showModalDialog?s=!0:+u>45&&(s=t("type","application/vnd.chromium.remoting-viewer"))}if(a.Baidu&&a.Opera&&(a.Baidu=!1),a.Mobile&&(a.Mobile=!r.includes("iPad")),s&&(t("type","application/gameplugin")||o.navigator&&void 0===o.navigator.connection.saveData?a["360SE"]=!0:a["360EE"]=!0),a.IE||a.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:case 75:case 105:break;case 102:a["360EE"]=!0;break;case 104:a["360SE"]=!0}var c={Safari:function(){return r.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return r.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return r.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return r.replace(/^.*Edge\/([\d.]+).*$/,"$1")},Firefox:function(){return r.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return r.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return r.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return r.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return r.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return r.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Arora:function(){return r.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return r.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return r.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return r.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return r.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return r.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return r.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return r.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return r.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return r.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return r.replace(/^.*QihooBrowser\/([\d.]+).*$/,"$1")},"360SE":function(){return{63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[+r.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[+r.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return r.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return r.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return r.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return r.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return r.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return r.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},LBBROWSER:function(){return{57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[+navigator.userAgent.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"2345Explorer":function(){return r.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return r.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return r.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return r.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return r.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return r.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},Taobao:function(){return r.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return r.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return r.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return r.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return r.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return r.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};return e.browserVersion="",c[e.browser]&&(e.browserVersion=c[e.browser](),e.browserVersion==r&&(e.browserVersion="")),"Edge"==e.browser&&(e.engine="EdgeHTML"),"Chrome"==e.browser&&parseInt(e.browserVersion)>27&&(e.engine="Blink"),"Opera"==e.browser&&parseInt(e.browserVersion)>12&&(e.engine="Blink"),"Yandex"==e.browser&&(e.engine="Blink"),e.browser+" (version: "+e.browserVersion+"; kernel: "+e.engine+")"}},a={DeviceInfoObj:function(e){var r,t=function(r){var t;null==(t=e.info)||t.forEach((function(e){e.toLowerCase()===r.toLowerCase()&&(s[r]=a[r])}))};e=e||{domain:""};var a={deviceType:i.getDeviceType(),OS:i.getOS(),OSVersion:i.getOSVersion(),sh:n.screen.height,sw:n.screen.width,lang:i.getLanguage(),netWork:i.getNetwork(),orientation:i.getOrientationStatu(),browserInfo:i.getBrowserInfo(),fingerprint:i.createFingerprint(e.domain),userAgent:null==(r=o.navigator)?void 0:r.userAgent};if(!e.info||0===e.info.length)return a;var s={};for(var u in a)t(u);return s}},{getDeviceInfo:function(e){return a.DeviceInfoObj(e)}}),_=function(){function e(){}return e.add=function(r,t){e.queues.push({url:r,data:t})},e.fire=function(){if(e.queues&&0!==e.queues.length){e.isStop=!1;var r=e.queues[0];r.url&&e.api.report(r.data),e.queues.splice(0,1),e.fire()}else e.isStop=!0},e}();_.isStop=!0,_.queues=[];var S=function(){function e(e){this.url=e}var r=e.prototype;return r.report=function(e){this.checkUrl(this.url)&&this.sendInfo(e)},r.sendInfo=function(e){navigator.sendBeacon?this.sendBeacon(this.url,e):this.sendImage(this.url,e)},r.sendImage=function(e,r){var t=this.changeJSON2Query(r),n=new Image;n.onload=n.onerror=function(){n=null},n.src=e+"?"+t+"&random="+Math.random()},r.sendBeacon=function(e,r){try{navigator.sendBeacon(e,this.formatParamsByURLSearchParams(r))}catch(e){}},r.formatParamsByURLSearchParams=function(e){var r=new URLSearchParams;for(var t in e)"object"==typeof e[t]&&(e[t]=JSON.stringify(e[t])),r.append(t,e[t]);return r},r.changeJSON2Query=function(e){var r="";for(var t in e){""!=r&&(r+="&");var n=e[t];r+=t+"="+encodeURIComponent("object"==typeof n?JSON.stringify(n):n)}return r},r.checkUrl=function(e){return!!e&&/^[hH][tT][tT][pP]([sS]?):\/\//.test(e)},e}();function O(){return O=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},O.apply(this,arguments)}var T=function(){function e(e){this.options=e,this.extendsInfo=e.extendsInfo||{},this.clientInfo=this._getDeviceInfo(),_.api=new S(e.url)}var r=e.prototype;return r.send=function(e){return this.options.forbidden||"object"!=typeof e||(this._handleRecordError(e),_.isStop&&_.fire()),this},r.setForbidden=function(e){this.options.forbidden=e},r.updateExtendsInfo=function(e){void 0===e&&(e={}),this.extendsInfo=O({},this.extendsInfo||{},e)},r._handleRecordError=function(e){try{var r=this._handleErrorInfo(e);_.add(this.options.url,r)}catch(e){}},r._handleErrorInfo=function(e){var r=this._getExtendsInfo(),t=O({st:(new Date).getTime()},r,e);return t.clientInfo=this.clientInfo,t},r._getExtendsInfo=function(){try{var e,r={},t=this.extendsInfo||{};for(var n in"function"==typeof t.getDynamic&&(e=t.getDynamic()),"[object Object]"===Object.prototype.toString.call(e)&&(t=O({},t,e)),t)"function"!=typeof t[n]&&(r[n]=t[n]);return r}catch(e){return{}}},r._getDeviceInfo=function(){try{var e=b.getDeviceInfo();return JSON.stringify(e)}catch(e){return""}},e}(),k=function(){function e(){}return e.init=function(r){e.collect=new T(r)},e.send=function(r,t){var n,o;null==(o=e.collect)||null==(n=o.send)||n.call(o,{action:r,logInfo:t})},e.updateParams=function(r){e.collect.updateExtendsInfo(r)},e}(),A={sampleRate:0,sampleChannel:0,sample:0,fps:0,gop:0,vDuration:0,aDuration:0,duration:0,aCodec:"",vCodec:"",audioNone:!1,width:0,height:0},M=null,P=function(r,t){var n,o,i,a,s={vps:null,sps:null,pps:null,sei:null},u={vlc:null},c=r.cwrap("getSPSLen","number",[])(),l=r.cwrap("getSPS","number",[])();if(c<0)return l>0&&(r._free(l),l=null),{};var d=r.HEAPU8.subarray(l,l+c);s.sps=new Uint8Array(c),null==(n=s.sps)||n.set(d,0);var f=r.cwrap("getPPSLen","number",[])(),p=r.cwrap("getPPS","number",[])(),m=r.HEAPU8.subarray(p,p+f);s.pps=new Uint8Array(f),null==(o=s.pps)||o.set(m,0);var h=r.cwrap("getSEILen","number",[])(),g=r.cwrap("getSEI","number",[])(),v=r.HEAPU8.subarray(g,g+h);s.sei=new Uint8Array(h),null==(i=s.sei)||i.set(v,0);var E=r.cwrap("getVLCLen","number",[])(),y=r.cwrap("getVLC","number",[])(),w=r.HEAPU8.subarray(y,y+E);if(u.vlc=new Uint8Array(E),null==(a=u.vlc)||a.set(w,0),(null==t?void 0:t.vCodec)===e.DEF_HEVC||(null==t?void 0:t.vCodec)===e.DEF_H265){var b,_=r.cwrap("getVPSLen","number",[])(),S=r.cwrap("getVPS","number",[])(),O=r.HEAPU8.subarray(S,S+_);s.vps=new Uint8Array(_),null==(b=s.vps)||b.set(O,0),r._free(O),O=null}try{r._free(l)}catch(e){k.send("worker",{name:"readPacket",free:"spsPtr"})}l=null;try{r._free(d)}catch(e){k.send("worker",{name:"readPacket",free:"spsSubPtr"})}d=null;try{r._free(m)}catch(e){k.send("worker",{name:"readPacket",free:"ppsSubPtr"})}m=null;try{r._free(v)}catch(e){k.send("worker",{name:"readPacket",free:"seiSubPtr"})}v=null;try{r._free(w)}catch(e){k.send("worker",{name:"readPacket",free:"vlcSubPtr"})}return w=null,{nalu:s,vlc:u}};function F(){return F=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},F.apply(this,arguments)}postMessage(w(u)),s().then((function(r){postMessage(w(c));var t=r,n=null,o=null,i=null,a={};self.onmessage=function(r){var s=r.data;switch(s.cmd){case d:n=t.cwrap("registerWasmPlayer","number",[])(),o=t.addFunction((function(e,r,o,i,a,s,u,c,l){var d=t.HEAPU8.subarray(e,e+i*c),p=t.HEAPU8.subarray(r,r+a*c/2),m=t.HEAPU8.subarray(o,o+s*c/2),h=new Uint8Array(d),g=new Uint8Array(p),v=new Uint8Array(m);postMessage(w(f,{vcodecerPtr:n,ptsSec:1*l/1e3,strideY:i,height:c,width:u,bufY:h,bufU:g,bufV:v})),t._free(d),d=null,h=null,t._free(p),p=null,g=null,t._free(m),m=null,v=null}),"viiiiiiiid"),i=t.addFunction((function(r,t,n,o,i,a,s,u,c,l,d){var f=e.CODEC_OFFSET_TABLE[d],p=e.CODEC_OFFSET_TABLE[l];postMessage(w(y,Object.assign(F({},A,{fps:n,vDuration:o,aDuration:i,duration:a,gop:s,width:u,height:c,aCodec:f,vCodec:p}),f?{sample:r>0?r:e.DEFAULT_SAMPLERATE,sampleChannel:t>=0?t:e.DEFAULT_CHANNEL}:{sampleRate:0,sampleChannel:0,audioNone:!0})))}),"viiddddiiiii"),t._setCodecType(n,0,o,i),t.cwrap("initDecoder","number",["number"])(n);break;case p:var u=s.data,c=u.nalBuf,l=u.pts,b=u.flushDecoder,_=t._malloc(c.length);t.HEAP8.set(c,_);var S=parseInt(1e3*l+"");t._decodeCodecContext(n,_,c.length,S,b),t._free(_),_=null;break;case h:var O=s.data,T=O.buff;O.tsUrl,function(e,r,t,n){null!=M&&(e._free(M),M=null),M=e._malloc(r.length),e.HEAP8.set(r,M);try{var o=e.cwrap("demuxTsStream","number",["number","number","number"])(M,r.length,t);e._free(M),M=null,o>=0&&postMessage(w(g))}catch(e){k.send("worker",{name:"demuxTsStream",msg:e})}}(t,T,n);break;case v:!function(e,r){for(;;){var t=e.cwrap("getPacket","number",[])(),n=e.HEAPU32[t/4],o=e.HEAPU32[t/4+1],i=e.HEAPF64[t/8+1],a=e.HEAPF64[t/8+1+1],s=e.HEAPU32[t/4+1+1+2+2],u=e.HEAPU32[t/4+1+1+2+2+1],c=e.HEAPU8.subarray(u,u+o),l=null,d=[0,1].includes(n);if(d)try{l=P(e,r)}catch(e){}if(!d||o<=0)break;var f=a>0?a:i;f<0||0===t||(self.postMessage(w(v,{type:n,size:o,ptime:i,dtime:a,keyframe:s,data:Array.from(c),pts:f,layer:l})),c=null,l=null,t=null)}postMessage(w(E))}(t,a);break;case m:null!==o&&t.removeFunction(o),o=null,null!==i&&t.removeFunction(i),i=null,t.cwrap("destroy","number",["number"])(n),self.close()}}})).catch((function(e){self.postMessage(w(l,{data:e}))}))}));
|