/* * * decoder.js v2.0.0 * Copyright (c) 2025-9-25 Ezviz-OpenBiz * * https://github.com/Ezviz-OpenBiz/EZUIKit-flv * */ !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t,n;var r,o=function(){if(n)return t;n=1;var e=!0;if((i=void 0!==i?i:{}).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 r,o,i={print:function(e){},printErr:function(e){postMessage({cmd:"wasmError",message:e})}},s=Object.assign({},i),A="./this.program",a="";if("undefined"!=typeof document&&document.currentScript&&(a=document.currentScript.src),a=a.startsWith("blob:")?"":a.substr(0,a.replace(/[?#].*/,"").lastIndexOf("/")+1),"object"!=typeof 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?)");r=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},o=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)};var l,c,d,u=i.print||console.log.bind(console),h=i.printErr||console.error.bind(console);Object.assign(i,s),s=null,l="fetchSettings",Object.getOwnPropertyDescriptor(i,l)&&R(`\`Module.${l}\` was supplied but \`${l}\` not included in INCOMING_MODULE_JS_API`),i.arguments&&i.arguments,V("arguments","arguments_"),i.thisProgram&&(A=i.thisProgram),V("thisProgram","thisProgram"),i.quit&&i.quit,V("quit","quit_"),w(void 0===i.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),w(void 0===i.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),w(void 0===i.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),w(void 0===i.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),w(void 0===i.read,"Module.read option was removed (modify read_ in JS)"),w(void 0===i.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),w(void 0===i.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),w(void 0===i.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),w(void 0===i.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),V("asm","wasmExports"),V("read","read_"),V("readAsync","readAsync"),V("readBinary","readBinary"),V("setWindowTitle","setWindowTitle"),w(!0,"worker environment detected but not enabled at build time. Add `worker` to `-sENVIRONMENT` to enable."),w(!0,"node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."),w(!0,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable."),i.wasmBinary&&(c=i.wasmBinary),V("wasmBinary","wasmBinary"),"object"!=typeof WebAssembly&&h("no native wasm support detected");var p,f,m,g,v,C,y,_,b=!1;function w(e,t){e||R("Assertion failed"+(t?": "+t:""))}function E(){var e=d.buffer;i.HEAP8=p=new Int8Array(e),i.HEAP16=m=new Int16Array(e),i.HEAPU8=f=new Uint8Array(e),i.HEAPU16=g=new Uint16Array(e),i.HEAP32=v=new Int32Array(e),i.HEAPU32=C=new Uint32Array(e),i.HEAPF32=y=new Float32Array(e),i.HEAPF64=_=new Float64Array(e)}function $(){if(!b){var e=dn();0==e&&(e+=4);var t=C[e>>2],n=C[e+4>>2];34821223==t&&2310721022==n||R(`Stack overflow! Stack cookie has been overwritten at ${X(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${X(n)} ${X(t)}`),1668509029!=C[0]&&R("Runtime error: The application has corrupted its heap memory area (address zero)!")}}w(!i.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),w("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),w(!i.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),w(!i.INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var k=[],T=[],L=[],F=!1;w(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),w(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),w(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),w(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 S=0,P=null,M=null,I={};function O(e){for(var t=e;;){if(!I[e])return e;e=t+Math.random()}}function D(e){var t,n;S++,null===(t=(n=i).monitorRunDependencies)||void 0===t||t.call(n,S),e?(w(!I[e]),I[e]=1,null===P&&"undefined"!=typeof setInterval&&(P=setInterval((()=>{if(b)return clearInterval(P),void(P=null);var e=!1;for(var t in I)e||(e=!0,h("still waiting on run dependencies:")),h(`dependency: ${t}`);e&&h("(end of list)")}),1e4))):h("warning: run dependency added without ID")}function x(e){var t,n;if(S--,null===(t=(n=i).monitorRunDependencies)||void 0===t||t.call(n,S),e?(w(I[e]),delete I[e]):h("warning: run dependency removed without ID"),0==S&&(null!==P&&(clearInterval(P),P=null),M)){var r=M;M=null,r()}}function R(e){var t,n;throw null===(t=(n=i).onAbort)||void 0===t||t.call(n,e),h(e="Aborted("+e+")"),b=!0,new WebAssembly.RuntimeError(e)}var N,U,B,j=e=>e.startsWith("data:application/octet-stream;base64,"),Q=e=>e.startsWith("file://");function z(e,t){return function(){w(F,`native function \`${e}\` called before runtime initialization`);var n=rn[e];return w(n,`exported native function \`${e}\` not found`),w(arguments.length<=t,`native function \`${e}\` called with ${arguments.length} args but expects ${t}`),n(...arguments)}}function H(){var e,t="decoder.wasm";return j(t)?t:(e=t,i.locateFile?i.locateFile(e,a):a+e)}function W(e){if(e==N&&c)return new Uint8Array(c);throw"both async and sync fetching of the wasm failed"}function K(t,n,r){return function(t){return!c&&e&&"function"==typeof fetch?fetch(t,{credentials:"same-origin"}).then((e=>{if(!e.ok)throw`failed to load wasm binary file at '${t}'`;return e.arrayBuffer()})).catch((()=>W(t))):Promise.resolve().then((()=>W(t)))}(t).then((e=>WebAssembly.instantiate(e,n))).then(r,(e=>{h(`failed to asynchronously prepare wasm: ${e}`),Q(N)&&h(`warning: Loading from a file URI (${N}) 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`),R(e)}))}function V(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){R(`\`Module.${e}\` has been replaced by \`${t}\``+(n?" (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 G(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 Y(e,t){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,e,{configurable:!0,get(){J(`\`${e}\` is not longer defined by emscripten. ${t}`)}})}function q(e){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){var t=`'${e}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;G(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),R(t)}})}Y("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),Y("asm","Please use wasmExports instead");var Z=e=>{for(;e.length>0;)e.shift()(i)};i.noExitRuntime;var X=e=>(w("number"==typeof e),"0x"+(e>>>=0).toString(16).padStart(8,"0")),J=e=>{J.shown||={},J.shown[e]||(J.shown[e]=1,h(e))},ee="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,te=(e,t,n)=>{for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.buffer&&ee)return ee.decode(e.subarray(t,o));for(var i="";t>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|A)}else i+=String.fromCharCode(s)}return i},ne=(e,t)=>(w("number"==typeof e,`UTF8ToString expects a number (got ${typeof e})`),e?te(f,e,t):"");function re(){w(null!=we.varargs);var e=v[+we.varargs>>2];return we.varargs+=4,e}var oe=re,ie={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:e=>{var t=ie.isAbs(e),n="/"===e.substr(-1);return(e=ie.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=ie.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=ie.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){for(var e=arguments.length,t=new Array(e),n=0;nie.normalize(e+"/"+t)},se=e=>(se=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);R("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),Ae={resolve:function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?n<0||arguments.length<=n?void 0:arguments[n]:be.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,t=ie.isAbs(r)}return(t?"/":"")+(e=ie.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=Ae.resolve(e).substr(1),t=Ae.resolve(t).substr(1);for(var r=n(e.split("/")),o=n(t.split("/")),i=Math.min(r.length,o.length),s=i,A=0;A{for(var t=0,n=0;n=55296&&r<=57343?(t+=4,++n):t+=3}return t},ce=(e,t,n,r)=>{if(w("string"==typeof e,`stringToUTF8Array expects a string (got ${typeof e})`),!(r>0))return 0;for(var o=n,i=n+r-1,s=0;s=55296&&A<=57343)A=65536+((1023&A)<<10)|1023&e.charCodeAt(++s);if(A<=127){if(n>=i)break;t[n++]=A}else if(A<=2047){if(n+1>=i)break;t[n++]=192|A>>6,t[n++]=128|63&A}else if(A<=65535){if(n+2>=i)break;t[n++]=224|A>>12,t[n++]=128|A>>6&63,t[n++]=128|63&A}else{if(n+3>=i)break;A>1114111&&J("Invalid Unicode code point "+X(A)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[n++]=240|A>>18,t[n++]=128|A>>12&63,t[n++]=128|A>>6&63,t[n++]=128|63&A}}return t[n]=0,n-o};function de(e,t,n){var r=le(e)+1,o=new Array(r),i=ce(e,o,0,o.length);return o.length=i,o}var ue,he,pe,fe={ttys:[],init(){},shutdown(){},register(e,t){fe.ttys[e]={input:[],output:[],ops:t},be.registerDevice(e,fe.stream_ops)},stream_ops:{open(e){var t=fe.ttys[e.node.rdev];if(!t)throw new be.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,o){if(!e.tty||!e.tty.ops.get_char)throw new be.ErrnoError(60);for(var i=0,s=0;s(()=>{if(!ae.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;ae=de(e)}return ae.shift()})(),put_char(e,t){null===t||10===t?(u(te(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(u(te(e.output,0)),e.output=[])},ioctl_tcgets:e=>({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:(e,t,n)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(h(te(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(h(te(e.output,0)),e.output=[])}}},me=e=>{R("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported")},ge={ops_table:null,mount:e=>ge.createNode(null,"/",16895,0),createNode(e,t,n,r){if(be.isBlkdev(n)||be.isFIFO(n))throw new be.ErrnoError(63);ge.ops_table||={dir:{node:{getattr:ge.node_ops.getattr,setattr:ge.node_ops.setattr,lookup:ge.node_ops.lookup,mknod:ge.node_ops.mknod,rename:ge.node_ops.rename,unlink:ge.node_ops.unlink,rmdir:ge.node_ops.rmdir,readdir:ge.node_ops.readdir,symlink:ge.node_ops.symlink},stream:{llseek:ge.stream_ops.llseek}},file:{node:{getattr:ge.node_ops.getattr,setattr:ge.node_ops.setattr},stream:{llseek:ge.stream_ops.llseek,read:ge.stream_ops.read,write:ge.stream_ops.write,allocate:ge.stream_ops.allocate,mmap:ge.stream_ops.mmap,msync:ge.stream_ops.msync}},link:{node:{getattr:ge.node_ops.getattr,setattr:ge.node_ops.setattr,readlink:ge.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ge.node_ops.getattr,setattr:ge.node_ops.setattr},stream:be.chrdev_stream_ops}};var o=be.createNode(e,t,n,r);return be.isDir(o.mode)?(o.node_ops=ge.ops_table.dir.node,o.stream_ops=ge.ops_table.dir.stream,o.contents={}):be.isFile(o.mode)?(o.node_ops=ge.ops_table.file.node,o.stream_ops=ge.ops_table.file.stream,o.usedBytes=0,o.contents=null):be.isLink(o.mode)?(o.node_ops=ge.ops_table.link.node,o.stream_ops=ge.ops_table.link.stream):be.isChrdev(o.mode)&&(o.node_ops=ge.ops_table.chrdev.node,o.stream_ops=ge.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),0!=n&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=be.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,be.isDir(e.mode)?t.size=4096:be.isFile(e.mode)?t.size=e.usedBytes:be.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ge.resizeFileStorage(e,t.size)},lookup(e,t){throw be.genericErrors[44]},mknod:(e,t,n,r)=>ge.createNode(e,t,n,r),rename(e,t,n){if(be.isDir(e.mode)){var r;try{r=be.lookupNode(t,n)}catch(e){}if(r)for(var o in r.contents)throw new be.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var n=be.lookupNode(e,t);for(var r in n.contents)throw new be.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var n of Object.keys(e.contents))t.push(n);return t},symlink(e,t,n){var r=ge.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!be.isLink(e.mode))throw new be.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,r,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,r);if(w(s>=0),s>8&&i.subarray)t.set(i.subarray(o,o+s),n);else for(var A=0;A0||n+t(ge.stream_ops.write(e,t,0,r,n,!1),0)}},ve=i.preloadPlugins||[],Ce=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},ye={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"},_e={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},be={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class extends Error{constructor(e){for(var t in super(ye[e]),this.name="ErrnoError",this.errno=e,_e)if(_e[t]===e){this.code=t;break}}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=be.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return be.isDir(this.mode)}get isDevice(){return be.isChrdev(this.mode)}},lookupPath(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(e=Ae.resolve(e)))return{path:"",node:null};if(t=Object.assign({follow_mount:!0,recurse_count:0},t),t.recurse_count>8)throw new be.ErrnoError(32);for(var n=e.split("/").filter((e=>!!e)),r=be.root,o="/",i=0;i40)throw new be.ErrnoError(32)}}return{path:o,node:r}},getPath(e){for(var t;;){if(be.isRoot(e)){var n=e.mount.mountpoint;return t?"/"!==n[n.length-1]?`${n}/${t}`:n+t:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r>>0)%be.nameTable.length},hashAddNode(e){var t=be.hashName(e.parent.id,e.name);e.name_next=be.nameTable[t],be.nameTable[t]=e},hashRemoveNode(e){var t=be.hashName(e.parent.id,e.name);if(be.nameTable[t]===e)be.nameTable[t]=e.name_next;else for(var n=be.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=be.mayLookup(e);if(n)throw new be.ErrnoError(n);for(var r=be.hashName(e.id,t),o=be.nameTable[r];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return be.lookup(e,t)},createNode(e,t,n,r){w("object"==typeof e);var o=new be.FSNode(e,t,n,r);return be.hashAddNode(o),o},destroyNode(e){be.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>be.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){if(!be.isDir(e.mode))return 54;var t=be.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{be.lookupNode(e,t);return 20}catch(e){}return be.nodePermissions(e,"wx")},mayDelete(e,t,n){var r;try{r=be.lookupNode(e,t)}catch(e){return e.errno}var o=be.nodePermissions(e,"wx");if(o)return o;if(n){if(!be.isDir(r.mode))return 54;if(be.isRoot(r)||be.getPath(r)===be.cwd())return 10}else if(be.isDir(r.mode))return 31;return 0},mayOpen:(e,t)=>e?be.isLink(e.mode)?32:be.isDir(e.mode)&&("r"!==be.flagsToPermissionString(t)||512&t)?31:be.nodePermissions(e,be.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=be.MAX_OPEN_FDS;e++)if(!be.streams[e])return e;throw new be.ErrnoError(33)},getStreamChecked(e){var t=be.getStream(e);if(!t)throw new be.ErrnoError(8);return t},getStream:e=>be.streams[e],createStream(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return e=Object.assign(new be.FSStream,e),-1==t&&(t=be.nextfd()),e.fd=t,be.streams[t]=e,e},closeStream(e){be.streams[e]=null},dupStream(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;var o=be.createStream(e,r);return null===(t=o.stream_ops)||void 0===t||null===(n=t.dup)||void 0===n||n.call(t,o),o},chrdev_stream_ops:{open(e){var t,n,r=be.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,null===(t=(n=e.stream_ops).open)||void 0===t||t.call(n,e)},llseek(){throw new be.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){be.devices[e]={stream_ops:t}},getDevice:e=>be.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push(...r.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),be.syncFSRequests++,be.syncFSRequests>1&&h(`warning: ${be.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=be.getMounts(be.root.mount),r=0;function o(e){return w(be.syncFSRequests>0),be.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++r>=n.length&&o(null)}n.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount(e,t,n){if("string"==typeof e)throw e;var r,o="/"===n,i=!n;if(o&&be.root)throw new be.ErrnoError(10);if(!o&&!i){var s=be.lookupPath(n,{follow_mount:!1});if(n=s.path,r=s.node,be.isMountpoint(r))throw new be.ErrnoError(10);if(!be.isDir(r.mode))throw new be.ErrnoError(54)}var A={type:e,opts:t,mountpoint:n,mounts:[]},a=e.mount(A);return a.mount=A,A.root=a,o?be.root=a:r&&(r.mounted=A,r.mount&&r.mount.mounts.push(A)),a},unmount(e){var t=be.lookupPath(e,{follow_mount:!1});if(!be.isMountpoint(t.node))throw new be.ErrnoError(28);var n=t.node,r=n.mounted,o=be.getMounts(r);Object.keys(be.nameTable).forEach((e=>{for(var t=be.nameTable[e];t;){var n=t.name_next;o.includes(t.mount)&&be.destroyNode(t),t=n}})),n.mounted=null;var i=n.mount.mounts.indexOf(r);w(-1!==i),n.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,n){var r=be.lookupPath(e,{parent:!0}).node,o=ie.basename(e);if(!o||"."===o||".."===o)throw new be.ErrnoError(28);var i=be.mayCreate(r,o);if(i)throw new be.ErrnoError(i);if(!r.node_ops.mknod)throw new be.ErrnoError(63);return r.node_ops.mknod(r,o,t,n)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,be.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,be.mknod(e,t,0)),mkdirTree(e,t){for(var n=e.split("/"),r="",o=0;o(void 0===n&&(n=t,t=438),t|=8192,be.mknod(e,t,n)),symlink(e,t){if(!Ae.resolve(e))throw new be.ErrnoError(44);var n=be.lookupPath(t,{parent:!0}).node;if(!n)throw new be.ErrnoError(44);var r=ie.basename(t),o=be.mayCreate(n,r);if(o)throw new be.ErrnoError(o);if(!n.node_ops.symlink)throw new be.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename(e,t){var n,r,o=ie.dirname(e),i=ie.dirname(t),s=ie.basename(e),A=ie.basename(t);if(n=be.lookupPath(e,{parent:!0}).node,r=be.lookupPath(t,{parent:!0}).node,!n||!r)throw new be.ErrnoError(44);if(n.mount!==r.mount)throw new be.ErrnoError(75);var a,l=be.lookupNode(n,s),c=Ae.relative(e,i);if("."!==c.charAt(0))throw new be.ErrnoError(28);if("."!==(c=Ae.relative(t,o)).charAt(0))throw new be.ErrnoError(55);try{a=be.lookupNode(r,A)}catch(e){}if(l!==a){var d=be.isDir(l.mode),u=be.mayDelete(n,s,d);if(u)throw new be.ErrnoError(u);if(u=a?be.mayDelete(r,A,d):be.mayCreate(r,A))throw new be.ErrnoError(u);if(!n.node_ops.rename)throw new be.ErrnoError(63);if(be.isMountpoint(l)||a&&be.isMountpoint(a))throw new be.ErrnoError(10);if(r!==n&&(u=be.nodePermissions(n,"w")))throw new be.ErrnoError(u);be.hashRemoveNode(l);try{n.node_ops.rename(l,r,A)}catch(e){throw e}finally{be.hashAddNode(l)}}},rmdir(e){var t=be.lookupPath(e,{parent:!0}).node,n=ie.basename(e),r=be.lookupNode(t,n),o=be.mayDelete(t,n,!0);if(o)throw new be.ErrnoError(o);if(!t.node_ops.rmdir)throw new be.ErrnoError(63);if(be.isMountpoint(r))throw new be.ErrnoError(10);t.node_ops.rmdir(t,n),be.destroyNode(r)},readdir(e){var t=be.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new be.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=be.lookupPath(e,{parent:!0}).node;if(!t)throw new be.ErrnoError(44);var n=ie.basename(e),r=be.lookupNode(t,n),o=be.mayDelete(t,n,!1);if(o)throw new be.ErrnoError(o);if(!t.node_ops.unlink)throw new be.ErrnoError(63);if(be.isMountpoint(r))throw new be.ErrnoError(10);t.node_ops.unlink(t,n),be.destroyNode(r)},readlink(e){var t=be.lookupPath(e).node;if(!t)throw new be.ErrnoError(44);if(!t.node_ops.readlink)throw new be.ErrnoError(28);return Ae.resolve(be.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var n=be.lookupPath(e,{follow:!t}).node;if(!n)throw new be.ErrnoError(44);if(!n.node_ops.getattr)throw new be.ErrnoError(63);return n.node_ops.getattr(n)},lstat:e=>be.stat(e,!0),chmod(e,t,n){var r;"string"==typeof e?r=be.lookupPath(e,{follow:!n}).node:r=e;if(!r.node_ops.setattr)throw new be.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})},lchmod(e,t){be.chmod(e,t,!0)},fchmod(e,t){var n=be.getStreamChecked(e);be.chmod(n.node,t)},chown(e,t,n,r){var o;"string"==typeof e?o=be.lookupPath(e,{follow:!r}).node:o=e;if(!o.node_ops.setattr)throw new be.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,t,n){be.chown(e,t,n,!0)},fchown(e,t,n){var r=be.getStreamChecked(e);be.chown(r.node,t,n)},truncate(e,t){if(t<0)throw new be.ErrnoError(28);var n;"string"==typeof e?n=be.lookupPath(e,{follow:!0}).node:n=e;if(!n.node_ops.setattr)throw new be.ErrnoError(63);if(be.isDir(n.mode))throw new be.ErrnoError(31);if(!be.isFile(n.mode))throw new be.ErrnoError(28);var r=be.nodePermissions(n,"w");if(r)throw new be.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate(e,t){var n=be.getStreamChecked(e);if(!(2097155&n.flags))throw new be.ErrnoError(28);be.truncate(n.node,t)},utime(e,t,n){var r=be.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open(e,t,n){if(""===e)throw new be.ErrnoError(44);var r;if(n=void 0===n?438:n,n=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&n|32768:0,"object"==typeof e)r=e;else{e=ie.normalize(e);try{r=be.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(r){if(128&t)throw new be.ErrnoError(20)}else r=be.mknod(e,n,0),o=!0;if(!r)throw new be.ErrnoError(44);if(be.isChrdev(r.mode)&&(t&=-513),65536&t&&!be.isDir(r.mode))throw new be.ErrnoError(54);if(!o){var s=be.mayOpen(r,t);if(s)throw new be.ErrnoError(s)}512&t&&!o&&be.truncate(r,0),t&=-131713;var A=be.createStream({node:r,path:be.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return A.stream_ops.open&&A.stream_ops.open(A),!i.logReadFiles||1&t||(be.readFiles||(be.readFiles={}),e in be.readFiles||(be.readFiles[e]=1)),A},close(e){if(be.isClosed(e))throw new be.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{be.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,n){if(be.isClosed(e))throw new be.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new be.ErrnoError(70);if(0!=n&&1!=n&&2!=n)throw new be.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,o){if(w(n>=0),r<0||o<0)throw new be.ErrnoError(28);if(be.isClosed(e))throw new be.ErrnoError(8);if(1==(2097155&e.flags))throw new be.ErrnoError(8);if(be.isDir(e.node.mode))throw new be.ErrnoError(31);if(!e.stream_ops.read)throw new be.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new be.ErrnoError(70)}else o=e.position;var s=e.stream_ops.read(e,t,n,r,o);return i||(e.position+=s),s},write(e,t,n,r,o,i){if(w(n>=0),r<0||o<0)throw new be.ErrnoError(28);if(be.isClosed(e))throw new be.ErrnoError(8);if(!(2097155&e.flags))throw new be.ErrnoError(8);if(be.isDir(e.node.mode))throw new be.ErrnoError(31);if(!e.stream_ops.write)throw new be.ErrnoError(28);e.seekable&&1024&e.flags&&be.llseek(e,0,2);var s=void 0!==o;if(s){if(!e.seekable)throw new be.ErrnoError(70)}else o=e.position;var A=e.stream_ops.write(e,t,n,r,o,i);return s||(e.position+=A),A},allocate(e,t,n){if(be.isClosed(e))throw new be.ErrnoError(8);if(t<0||n<=0)throw new be.ErrnoError(28);if(!(2097155&e.flags))throw new be.ErrnoError(8);if(!be.isFile(e.node.mode)&&!be.isDir(e.node.mode))throw new be.ErrnoError(43);if(!e.stream_ops.allocate)throw new be.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap(e,t,n,r,o){if(2&r&&!(2&o)&&2!=(2097155&e.flags))throw new be.ErrnoError(2);if(1==(2097155&e.flags))throw new be.ErrnoError(2);if(!e.stream_ops.mmap)throw new be.ErrnoError(43);return e.stream_ops.mmap(e,t,n,r,o)},msync:(e,t,n,r,o)=>(w(n>=0),e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,o):0),ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new be.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var n,r=be.open(e,t.flags),o=be.stat(e).size,i=new Uint8Array(o);return be.read(r,i,0,o,0),"utf8"===t.encoding?n=te(i,0):"binary"===t.encoding&&(n=i),be.close(r),n},writeFile(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.flags=n.flags||577;var r=be.open(e,n.flags,n.mode);if("string"==typeof t){var o=new Uint8Array(le(t)+1),i=ce(t,o,0,o.length);be.write(r,o,0,i,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");be.write(r,t,0,t.byteLength,void 0,n.canOwn)}be.close(r)},cwd:()=>be.currentPath,chdir(e){var t=be.lookupPath(e,{follow:!0});if(null===t.node)throw new be.ErrnoError(44);if(!be.isDir(t.node.mode))throw new be.ErrnoError(54);var n=be.nodePermissions(t.node,"x");if(n)throw new be.ErrnoError(n);be.currentPath=t.path},createDefaultDirectories(){be.mkdir("/tmp"),be.mkdir("/home"),be.mkdir("/home/web_user")},createDefaultDevices(){be.mkdir("/dev"),be.registerDevice(be.makedev(1,3),{read:()=>0,write:(e,t,n,r,o)=>r}),be.mkdev("/dev/null",be.makedev(1,3)),fe.register(be.makedev(5,0),fe.default_tty_ops),fe.register(be.makedev(6,0),fe.default_tty1_ops),be.mkdev("/dev/tty",be.makedev(5,0)),be.mkdev("/dev/tty1",be.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(0===t&&(t=se(e).byteLength),e[--t]);be.createDevice("/dev","random",n),be.createDevice("/dev","urandom",n),be.mkdir("/dev/shm"),be.mkdir("/dev/shm/tmp")},createSpecialDirectories(){be.mkdir("/proc");var e=be.mkdir("/proc/self");be.mkdir("/proc/self/fd"),be.mount({mount(){var t=be.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var n=+t,r=be.getStreamChecked(n),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>r.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams(){i.stdin?be.createDevice("/dev","stdin",i.stdin):be.symlink("/dev/tty","/dev/stdin"),i.stdout?be.createDevice("/dev","stdout",null,i.stdout):be.symlink("/dev/tty","/dev/stdout"),i.stderr?be.createDevice("/dev","stderr",null,i.stderr):be.symlink("/dev/tty1","/dev/stderr");var e=be.open("/dev/stdin",0),t=be.open("/dev/stdout",1),n=be.open("/dev/stderr",1);w(0===e.fd,`invalid handle for stdin (${e.fd})`),w(1===t.fd,`invalid handle for stdout (${t.fd})`),w(2===n.fd,`invalid handle for stderr (${n.fd})`)},staticInit(){[44].forEach((e=>{be.genericErrors[e]=new be.ErrnoError(e),be.genericErrors[e].stack=""})),be.nameTable=new Array(4096),be.mount(ge,{},"/"),be.createDefaultDirectories(),be.createDefaultDevices(),be.createSpecialDirectories(),be.filesystems={MEMFS:ge}},init(e,t,n){w(!be.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)"),be.init.initialized=!0,i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=n||i.stderr,be.createStandardStreams()},quit(){be.init.initialized=!1,an(0);for(var e=0;e=i.length)return 0;var s=Math.min(i.length-o,r);if(w(s>=0),i.slice)for(var A=0;A{var t=s.stream_ops[e];A[e]=function(){return be.forceLoadFile(s),t(...arguments)}})),A.read=(e,t,n,r,o)=>(be.forceLoadFile(s),a(e,t,n,r,o)),A.mmap=(e,t,n,r,o)=>{be.forceLoadFile(s);var i=me();if(!i)throw new be.ErrnoError(48);return a(e,p,i,t,n),{ptr:i,allocated:!0}},s.stream_ops=A,s},absolutePath(){R("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){R("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){R("FS.createLink has been removed; use FS.symlink instead")},joinPath(){R("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){R("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){R("FS.standardizePath has been removed; use PATH.normalize instead")}},we={DEFAULT_POLLMASK:5,calculateAt(e,t,n){if(ie.isAbs(t))return t;var r;-100===e?r=be.cwd():r=we.getStreamFromFD(e).path;if(0==t.length){if(!n)throw new be.ErrnoError(44);return r}return ie.join2(r,t)},doStat(e,t,n){var r=e(t);v[n>>2]=r.dev,v[n+4>>2]=r.mode,C[n+8>>2]=r.nlink,v[n+12>>2]=r.uid,v[n+16>>2]=r.gid,v[n+20>>2]=r.rdev,B=[r.size>>>0,(U=r.size,+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[n+24>>2]=B[0],v[n+28>>2]=B[1],v[n+32>>2]=4096,v[n+36>>2]=r.blocks;var o=r.atime.getTime(),i=r.mtime.getTime(),s=r.ctime.getTime();return B=[Math.floor(o/1e3)>>>0,(U=Math.floor(o/1e3),+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[n+40>>2]=B[0],v[n+44>>2]=B[1],C[n+48>>2]=o%1e3*1e3,B=[Math.floor(i/1e3)>>>0,(U=Math.floor(i/1e3),+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[n+56>>2]=B[0],v[n+60>>2]=B[1],C[n+64>>2]=i%1e3*1e3,B=[Math.floor(s/1e3)>>>0,(U=Math.floor(s/1e3),+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[n+72>>2]=B[0],v[n+76>>2]=B[1],C[n+80>>2]=s%1e3*1e3,B=[r.ino>>>0,(U=r.ino,+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[n+88>>2]=B[0],v[n+92>>2]=B[1],0},doMsync(e,t,n,r,o){if(!be.isFile(t.node.mode))throw new be.ErrnoError(43);if(2&r)return 0;var i=f.slice(e,e+n);be.msync(t,i,o,n,r)},getStreamFromFD:e=>be.getStreamChecked(e),varargs:void 0,getStr:e=>ne(e)},Ee=e=>{for(var t="",n=e;f[n];)t+=ue[f[n++]];return t},$e={},ke={},Te={},Le=e=>{throw new he(e)},Fe=e=>{throw new pe(e)},Se=(e,t,n)=>{function r(t){var r=n(t);r.length!==e.length&&Fe("Mismatched type converter count");for(var o=0;o{ke.hasOwnProperty(e)?o[t]=ke[e]:(i.push(e),$e.hasOwnProperty(e)||($e[e]=[]),$e[e].push((()=>{o[t]=ke[e],++s===i.length&&r(o)})))})),0===i.length&&r(o)};function Pe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var r=t.name;if(e||Le(`type "${r}" must have a positive integer typeid pointer`),ke.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;Le(`Cannot register type '${r}' twice`)}if(ke[e]=t,delete Te[e],$e.hasOwnProperty(e)){var o=$e[e];delete $e[e],o.forEach((e=>e()))}}(e,t,n)}var Me,Ie=e=>{Le(e.$$.ptrType.registeredClass.name+" instance already deleted")},Oe=!1,De=e=>{},xe=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Re=(e,t,n)=>{if(t===n)return e;if(void 0===n.baseClass)return null;var r=Re(e,t,n.baseClass);return null===r?null:n.downcast(r)},Ne={},Ue=()=>Object.keys(He).length,Be=()=>{var e=[];for(var t in He)He.hasOwnProperty(t)&&e.push(He[t]);return e},je=[],Qe=()=>{for(;je.length;){var e=je.pop();e.$$.deleteScheduled=!1,e.delete()}},ze=e=>{Me=e,je.length&&Me&&Me(Qe)},He={},We=(e,t)=>(t=((e,t)=>{for(void 0===t&&Le("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),He[t]),Ke=(e,t)=>(t.ptrType&&t.ptr||Fe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!==!!t.smartPtr&&Fe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Ge(Object.create(e,{$$:{value:t,writable:!0}})));function Ve(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=We(this.registeredClass,t);if(void 0!==n){if(0===n.$$.count.value)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var r=n.clone();return this.destructor(e),r}function o(){return this.isSmartPointer?Ke(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Ke(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,s=this.registeredClass.getActualType(t),A=Ne[s];if(!A)return o.call(this);i=this.isConst?A.constPointerType:A.pointerType;var a=Re(t,this.registeredClass,i.registeredClass);return null===a?o.call(this):this.isSmartPointer?Ke(i.registeredClass.instancePrototype,{ptrType:i,ptr:a,smartPtrType:this,smartPtr:e}):Ke(i.registeredClass.instancePrototype,{ptrType:i,ptr:a})}var Ge=e=>"undefined"==typeof FinalizationRegistry?(Ge=e=>e,e):(Oe=new FinalizationRegistry((e=>{xe(e.$$)})),Ge=e=>{var t=e.$$;if(!!t.smartPtr){var n={$$:t},r=t.ptrType.registeredClass;n.leakWarning=new Error(`Embind found a leaked C++ instance ${r.name} <${X(t.ptr)}>.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated`),"captureStackTrace"in Error&&Error.captureStackTrace(n.leakWarning,Ve),Oe.register(e,n,e)}return e},De=e=>Oe.unregister(e),Ge(e));function Ye(){}var qe=(e,t)=>Object.defineProperty(t,"name",{value:e}),Ze=(e,t,n)=>{if(void 0===e[t].overloadTable){var r=e[t];e[t]=function(){for(var r=arguments.length,o=new Array(r),i=0;i{for(;t!==n;)t.upcast||Le(`Expected null or instance of ${n.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function et(e,t){if(null===t)return this.isReference&&Le(`null is not a valid ${this.name}`),0;t.$$||Le(`Cannot pass "${Et(t)}" as a ${this.name}`),t.$$.ptr||Le(`Cannot pass deleted object as a pointer of type ${this.name}`);var n=t.$$.ptrType.registeredClass;return Je(t.$$.ptr,n,this.registeredClass)}function tt(e,t){var n;if(null===t)return this.isReference&&Le(`null is not a valid ${this.name}`),this.isSmartPointer?(n=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,n),n):0;t&&t.$$||Le(`Cannot pass "${Et(t)}" as a ${this.name}`),t.$$.ptr||Le(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&Le(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;if(n=Je(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Le("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:Le(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var o=t.clone();n=this.rawShare(n,bt.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,n)}break;default:Le("Unsupporting sharing policy")}return n}function nt(e,t){if(null===t)return this.isReference&&Le(`null is not a valid ${this.name}`),0;t.$$||Le(`Cannot pass "${Et(t)}" as a ${this.name}`),t.$$.ptr||Le(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&Le(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;return Je(t.$$.ptr,n,this.registeredClass)}function rt(e){return this.fromWireType(C[e>>2])}function ot(e,t,n,r,o,i,s,A,a,l,c){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=r,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=s,this.rawGetPointee=A,this.rawConstructor=a,this.rawShare=l,this.rawDestructor=c,o||void 0!==t.baseClass?this.toWireType=tt:r?(this.toWireType=et,this.destructorFunction=null):(this.toWireType=nt,this.destructorFunction=null)}var it,st,At=e=>it.get(e),at=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e.includes("j")?((e,t,n)=>(w("dynCall_"+(e=e.replace(/p/g,"i"))in i,`bad function pointer type - dynCall function not found for sig '${e}'`),null!=n&&n.length?w(n.length===e.substring(1).replace(/j/g,"--").length):w(1==e.length),(0,i["dynCall_"+e])(t,...n)))(e,t,n):(w(At(t),`missing table entry in dynCall: ${t}`),At(t)(...n))},lt=(e,t)=>{var n,r,o=(e=Ee(e)).includes("j")?(r=t,w((n=e).includes("j")||n.includes("p"),"getDynCaller should only be called with i64 sigs"),function(){for(var e=arguments.length,t=new Array(e),o=0;o{var t=An(e),n=Ee(t);return on(t),n},dt=(e,t)=>{var n=[],r={};throw t.forEach((function e(t){r[t]||ke[t]||(Te[t]?Te[t].forEach(e):(n.push(t),r[t]=!0))})),new st(`${e}: `+n.map(ct).join([", "]))},ut=(e,t)=>{for(var n=[],r=0;r>2]);return n},ht=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function pt(e){for(var t=1;t0?", ":"")+A),l+=(n||r?"var rv = ":"")+"invoker(fn"+(A.length>0?", ":"")+A+");\n",o)l+="runDestructors(destructors);\n";else for(a=t?1:2;a(e instanceof Object||Le(`${n} with invalid "this": ${e}`),e instanceof t.registeredClass.constructor||Le(`${n} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||Le(`cannot call emscripten binding method ${n} on deleted object`),Je(e.$$.ptr,e.$$.ptrType.registeredClass,t.registeredClass)),vt=[],Ct=[],yt=e=>{e>9&&0==--Ct[e+1]&&(w(void 0!==Ct[e],"Decref for unallocated handle."),Ct[e]=void 0,vt.push(e))},_t=()=>Ct.length/2-5-vt.length,bt={toValue:e=>(e||Le("Cannot use deleted val. handle = "+e),w(2===e||void 0!==Ct[e]&&e%2==0,`invalid handle: ${e}`),Ct[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=vt.pop()||Ct.length;return Ct[t]=e,Ct[t+1]=1,t}}}},wt={name:"emscripten::val",fromWireType:e=>{var t=bt.toValue(e);return yt(e),t},toWireType:(e,t)=>bt.toHandle(t),argPackAdvance:8,readValueFromPointer:rt,destructorFunction:null},Et=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},$t=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(y[e>>2])};case 8:return function(e){return this.fromWireType(_[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},kt=(e,t,n)=>{switch(t){case 1:return n?e=>p[e]:e=>f[e];case 2:return n?e=>m[e>>1]:e=>g[e>>1];case 4:return n?e=>v[e>>2]:e=>C[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Tt=(e,t,n)=>(w("number"==typeof n,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),ce(e,f,t,n)),Lt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ft=(e,t)=>{w(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var n=e,r=n>>1,o=r+t/2;!(r>=o)&&g[r];)++r;if((n=r<<1)-e>32&&Lt)return Lt.decode(f.subarray(e,n));for(var i="",s=0;!(s>=t/2);++s){var A=m[e+2*s>>1];if(0==A)break;i+=String.fromCharCode(A)}return i},St=(e,t,n)=>{if(w(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),w("number"==typeof n,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),n??=2147483647,n<2)return 0;for(var r=t,o=(n-=2)<2*e.length?n/2:e.length,i=0;i>1]=s,t+=2}return m[t>>1]=0,t-r},Pt=e=>2*e.length,Mt=(e,t)=>{w(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var n=0,r="";!(n>=t/4);){var o=v[e+4*n>>2];if(0==o)break;if(++n,o>=65536){var i=o-65536;r+=String.fromCharCode(55296|i>>10,56320|1023&i)}else r+=String.fromCharCode(o)}return r},It=(e,t,n)=>{if(w(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),w("number"==typeof n,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),n??=2147483647,n<4)return 0;for(var r=t,o=r+n-4,i=0;i=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i);if(v[t>>2]=s,(t+=4)+4>o)break}return v[t>>2]=0,t-r},Ot=e=>{for(var t=0,n=0;n=55296&&r<=57343&&++n,t+=4}return t},Dt=(e,t)=>{var n=ke[e];return void 0===n&&Le(`${t} has unknown type ${ct(e)}`),n},xt=(e,t,n)=>{var r=[],o=e.toWireType(r,n);return r.length&&(C[t>>2]=bt.toHandle(r)),o},Rt={},Nt=[],Ut=(e,t)=>(w(e==e>>>0||e==(0|e)),w(t===(0|t)),t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN),Bt=[0,31,60,91,121,152,182,213,244,274,305,335],jt=[0,31,59,90,120,151,181,212,243,273,304,334],Qt=e=>{var t;return((t=e.getFullYear())%4==0&&(t%100!=0||t%400==0)?Bt:jt)[e.getMonth()]+e.getDate()-1},zt=(e,t)=>(w(t===(0|t)),(e>>>0)+4294967296*t),Ht=(e,t)=>{if(e<=0)return e;var n=t<=32?Math.abs(1<=n&&(t<=32||e>n)&&(e=-2*n+e),e},Wt=(e,t)=>e>=0?e:t<=32?2*Math.abs(1<{for(var t=e;f[t];)++t;return t-e},Vt=(e,t)=>{w(!(3&t));var n=e,r=t;function o(e){var t;return r=function(e,t){return"double"===t||"i64"===t?7&e&&(w(4==(7&e)),e+=4):w(!(3&e)),e}(r,e),"double"===e?(t=_[r>>3],r+=8):"i64"==e?(t=[v[r>>2],v[r+4>>2]],r+=8):(w(!(3&r)),e="i32",t=v[r>>2],r+=4),t}for(var i,s,A,a,l,c,d=[];;){var u=n;if(0===(i=p[n]))break;if(s=p[n+1],37==i){var h=!1,m=!1,g=!1,C=!1,y=!1;e:for(;;){switch(s){case 43:h=!0;break;case 45:m=!0;break;case 35:g=!0;break;case 48:if(C)break e;C=!0;break;case 32:y=!0;break;default:break e}n++,s=p[n+1]}var b=0;if(42==s)b=o("i32"),n++,s=p[n+1];else for(;s>=48&&s<=57;)b=10*b+(s-48),n++,s=p[n+1];var E,$=!1,k=-1;if(46==s){if(k=0,$=!0,n++,42==(s=p[n+1]))k=o("i32"),n++;else for(;;){var T=p[n+1];if(T<48||T>57)break;k=10*k+(T-48),n++}s=p[n+1]}switch(k<0&&(k=6,$=!1),String.fromCharCode(s)){case"h":104==p[n+2]?(n++,E=1):E=2;break;case"l":108==p[n+2]?(n++,E=8):E=4;break;case"L":case"q":case"j":E=8;break;case"z":case"t":case"I":E=4;break;default:E=null}switch(E&&n++,s=p[n+1],String.fromCharCode(s)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":var L=100==s||105==s;if(A=o("i"+8*(E=E||4)),8==E&&(A=117==s?(l=A[0],c=A[1],(l>>>0)+4294967296*(c>>>0)):zt(A[0],A[1])),E<=4){var F=Math.pow(256,E)-1;A=(L?Ht:Wt)(A&F,8*E)}var S=Math.abs(A),P="";if(100==s||105==s)O=Ht(A,8*E).toString(10);else if(117==s)O=Wt(A,8*E).toString(10),A=Math.abs(A);else if(111==s)O=(g?"0":"")+S.toString(8);else if(120==s||88==s){if(P=g&&0!=A?"0x":"",A<0){A=-A,O=(S-1).toString(16);for(var M=[],I=0;I=0&&(h?P="+"+P:y&&(P=" "+P)),"-"==O.charAt(0)&&(P="-"+P,O=O.substr(1));P.length+O.lengthR&&R>=-4?(s=(103==s?"f":"F").charCodeAt(0),k-=R+1):(s=(103==s?"e":"E").charCodeAt(0),k--),x=Math.min(k,20)}101==s||69==s?(O=A.toExponential(x),/[eE][-+]\d$/.test(O)&&(O=O.slice(0,-1)+"0"+O.slice(-1))):102!=s&&70!=s||(O=A.toFixed(x),0===A&&((a=A)<0||0===a&&1/a==-1/0)&&(O="-"+O));var N=O.split("e");if(D&&!g)for(;N[0].length>1&&N[0].includes(".")&&("0"==N[0].slice(-1)||"."==N[0].slice(-1));)N[0]=N[0].slice(0,-1);else for(g&&-1==O.indexOf(".")&&(N[0]+=".");k>x++;)N[0]+="0";O=N[0]+(N.length>1?"e"+N[1]:""),69==s&&(O=O.toUpperCase()),A>=0&&(h?O="+"+O:y&&(O=" "+O))}else O=(A<0?"-":"")+"inf",C=!1;for(;O.length0;)d.push(32);m||d.push(o("i8"));break;case"n":var j=o("i32*");v[j>>2]=d.length;break;case"%":d.push(i);break;default:for(I=u;I=4)){t+=c+"\n";continue}d=f[1],u=f[2],h=f[3],p=0|f[4]}var m=!1;if(8&e){var g,v=emscripten_source_map.originalPositionFor({line:h,column:p});(m=null===(g=v)||void 0===g?void 0:g.source)&&(64&e&&(v.source=v.source.substring(v.source.replace(/\\/g,"/").lastIndexOf("/")+1)),t+=` at ${d} (${v.source}:${v.line}:${v.column})\n`)}(16&e||!m)&&(64&e&&(u=u.substring(u.replace(/\\/g,"/").lastIndexOf("/")+1)),t+=(m?` = ${d}`:` at ${d}`)+` (${u}:${h}:${p})\n`)}return t=t.replace(/\s+$/,"")}var Yt,qt,Zt,Xt=e=>{var t=d.buffer,n=(e-t.byteLength+65535)/65536;try{return d.grow(n),E(),1}catch(n){h(`growMemory: Attempted to grow heap from ${t.byteLength} bytes to ${e} bytes, but got error: ${n}`)}},Jt={},en=()=>{if(!en.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:A||"./this.program"};for(var t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(var t in e)n.push(`${t}=${e[t]}`);en.strings=n}return en.strings};be.createPreloadedFile=(e,t,n,r,i,s,A,a,l,c)=>{var d=t?Ae.resolve(ie.join2(e,t)):e,u=O(`cp ${d}`);function h(n){function o(n){null==c||c(),a||((e,t,n,r,o,i)=>{be.createDataFile(e,t,n,r,o,i)})(e,t,n,r,i,l),null==s||s(),x(u)}((e,t,n,r)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return ve.forEach((i=>{o||i.canHandle(t)&&(i.handle(e,t,n,r),o=!0)})),o})(n,d,o,(()=>{null==A||A(),x(u)}))||o(n)}D(u),"string"==typeof n?((e,t,n,r)=>{var i=O(`al ${e}`);o(e,(n=>{w(n,`Loading data file "${e}" failed (no arrayBuffer).`),t(new Uint8Array(n)),i&&x(i)}),(t=>{if(!n)throw`Loading data file "${e}" failed.`;n()})),i&&D(i)})(n,h,A):h(n)},be.staticInit(),(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);ue=e})(),he=i.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},pe=i.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(Ye.prototype,{isAliasOf(e){if(!(this instanceof Ye))return!1;if(!(e instanceof Ye))return!1;var t=this.$$.ptrType.registeredClass,n=this.$$.ptr;e.$$=e.$$;for(var r=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;r.baseClass;)o=r.upcast(o),r=r.baseClass;return t===r&&n===o},clone(){if(this.$$.ptr||Ie(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Ge(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Ie(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Le("Object already scheduled for deletion"),De(this),xe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ie(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Le("Object already scheduled for deletion"),je.push(this),1===je.length&&Me&&Me(Qe),this.$$.deleteScheduled=!0,this}}),i.getInheritedInstanceCount=Ue,i.getLiveInheritedInstances=Be,i.flushPendingDeletes=Qe,i.setDelayFunction=ze,Object.assign(ot.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t;null===(t=this.rawDestructor)||void 0===t||t.call(this,e)},argPackAdvance:8,readValueFromPointer:rt,fromWireType:Ve}),st=i.UnboundTypeError=(Yt=Error,(Zt=qe(qt="UnboundTypeError",(function(e){this.name=qt,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Yt.prototype),Zt.prototype.constructor=Zt,Zt.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Zt),Ct.push(0,1,void 0,1,null,1,!0,1,!1,1),w(10===Ct.length),i.count_emval_handles=_t;var tn,nn={__assert_fail:(e,t,n,r)=>{R(`Assertion failed: ${ne(e)}, at: `+[t?ne(t):"unknown filename",n,r?ne(r):"unknown function"])},__syscall_fcntl64:function(e,t,n){we.varargs=n;try{var r=we.getStreamFromFD(e);switch(t){case 0:if((o=re())<0)return-28;for(;be.streams[o];)o++;return be.dupStream(r,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return r.flags;case 4:var o=re();return r.flags|=o,0;case 12:o=oe();return m[o+0>>1]=2,0}return-28}catch(e){if(void 0===be||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_openat:function(e,t,n,r){we.varargs=r;try{t=we.getStr(t),t=we.calculateAt(e,t);var o=r?re():0;return be.open(t,n,o).fd}catch(e){if(void 0===be||"ErrnoError"!==e.name)throw e;return-e.errno}},_abort_js:()=>{R("native code called abort()")},_embind_register_bigint:(e,t,n,r,o)=>{},_embind_register_bool:(e,t,n,r)=>{Pe(e,{name:t=Ee(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(f[e])},destructorFunction:null})},_embind_register_class:(e,t,n,r,o,s,A,a,l,c,d,u,h)=>{d=Ee(d),s=lt(o,s),a&&=lt(A,a),c&&=lt(l,c),h=lt(u,h);var p=(e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e})(d);((e,t,n)=>{i.hasOwnProperty(e)?(Le(`Cannot register public name '${e}' twice`),Ze(i,e,e),i.hasOwnProperty(n)&&Le(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),i[e].overloadTable[n]=t):i[e]=t})(p,(function(){dt(`Cannot construct ${d} due to unbound types`,[r])})),Se([e,t,n],r?[r]:[],(t=>{var n,o;t=t[0],o=r?(n=t.registeredClass).instancePrototype:Ye.prototype;var A=qe(d,(function(){if(Object.getPrototypeOf(this)!==l)throw new he("Use 'new' to construct "+d);if(void 0===u.constructor_body)throw new he(d+" has no accessible constructor");for(var e=arguments.length,t=new Array(e),n=0;n{i.hasOwnProperty(e)||Fe("Replacing nonexistent public symbol"),void 0!==i[e].overloadTable&&void 0!==n||(i[e]=t,i[e].argCount=n)})(p,A),[f,m,g]}))},_embind_register_class_constructor:(e,t,n,r,o,i)=>{w(t>0);var s=ut(t,n);o=lt(r,o),Se([],[e],(e=>{var n=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new he(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{dt(`Cannot construct ${e.name} due to unbound types`,s)},Se([],s,(r=>(r.splice(1,0,null),e.registeredClass.constructor_body[t-1]=mt(n,r,null,o,i),[]))),[]}))},_embind_register_class_function:(e,t,n,r,o,i,s,A,a)=>{var l=ut(n,r);t=(e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?(w(")"==e[e.length-1],"Parentheses for argument names should match."),e.substr(0,t)):e})(t=Ee(t)),i=lt(o,i),Se([],[e],(e=>{var r=`${(e=e[0]).name}.${t}`;function o(){dt(`Cannot call ${r} due to unbound types`,l)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),A&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,d=c[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===n-2?(o.argCount=n-2,o.className=e.name,c[t]=o):(Ze(c,t,r),c[t].overloadTable[n-2]=o),Se([],l,(o=>{var A=mt(r,o,e,i,s,a);return void 0===c[t].overloadTable?(A.argCount=n-2,c[t]=A):c[t].overloadTable[n-2]=A,[]})),[]}))},_embind_register_class_property:(e,t,n,r,o,i,s,A,a,l)=>{t=Ee(t),o=lt(r,o),Se([],[e],(e=>{var r=`${(e=e[0]).name}.${t}`,c={get(){dt(`Cannot access ${r} due to unbound types`,[n,s])},enumerable:!0,configurable:!0};return c.set=a?()=>dt(`Cannot access ${r} due to unbound types`,[n,s]):e=>Le(r+" is a read-only property"),Object.defineProperty(e.registeredClass.instancePrototype,t,c),Se([],a?[n,s]:[n],(n=>{var s=n[0],c={get(){var t=gt(this,e,r+" getter");return s.fromWireType(o(i,t))},enumerable:!0};if(a){a=lt(A,a);var d=n[1];c.set=function(t){var n=gt(this,e,r+" setter"),o=[];a(l,n,d.toWireType(o,t)),ht(o)}}return Object.defineProperty(e.registeredClass.instancePrototype,t,c),[]})),[]}))},_embind_register_emval:e=>Pe(e,wt),_embind_register_float:(e,t,n)=>{Pe(e,{name:t=Ee(t),fromWireType:e=>e,toWireType:(e,t)=>{if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError(`Cannot convert ${Et(t)} to ${this.name}`);return t},argPackAdvance:8,readValueFromPointer:$t(t,n),destructorFunction:null})},_embind_register_integer:(e,t,n,r,o)=>{t=Ee(t),-1===o&&(o=4294967295);var i=e=>e;if(0===r){var s=32-8*n;i=e=>e<>>s}var A=t.includes("unsigned"),a=(e,n)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError(`Cannot convert "${Et(e)}" to ${n}`);if(eo)throw new TypeError(`Passing a number "${Et(e)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${r}, ${o}]!`)};Pe(e,{name:t,fromWireType:i,toWireType:A?function(e,t){return a(t,this.name),t>>>0}:function(e,t){return a(t,this.name),t},argPackAdvance:8,readValueFromPointer:kt(t,n,0!==r),destructorFunction:null})},_embind_register_memory_view:(e,t,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=C[e>>2],n=C[e+4>>2];return new r(p.buffer,n,t)}Pe(e,{name:n=Ee(n),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:(e,t)=>{var n="std::string"===(t=Ee(t));Pe(e,{name:t,fromWireType(e){var t,r=C[e>>2],o=e+4;if(n)for(var i=o,s=0;s<=r;++s){var A=o+s;if(s==r||0==f[A]){var a=ne(i,A-i);void 0===t?t=a:(t+=String.fromCharCode(0),t+=a),i=A+1}}else{var l=new Array(r);for(s=0;s>2]=r,n&&o)Tt(t,s,r+1);else if(o)for(var A=0;A255&&(on(s),Le("String has UTF-16 code units that do not fit in 8 bits")),f[s+A]=a}else for(A=0;A{var r,o,i,s;n=Ee(n),2===t?(r=Ft,o=St,s=Pt,i=e=>g[e>>1]):4===t&&(r=Mt,o=It,s=Ot,i=e=>C[e>>2]),Pe(e,{name:n,fromWireType:e=>{for(var n,o=C[e>>2],s=e+4,A=0;A<=o;++A){var a=e+4+A*t;if(A==o||0==i(a)){var l=r(s,a-s);void 0===n?n=l:(n+=String.fromCharCode(0),n+=l),s=a+t}}return on(e),n},toWireType:(e,r)=>{"string"!=typeof r&&Le(`Cannot pass non-string to C++ string type ${n}`);var i=s(r),A=sn(4+i+t);return C[A>>2]=i/t,o(r,A+4,i+t),null!==e&&e.push(on,A),A},argPackAdvance:8,readValueFromPointer:rt,destructorFunction(e){on(e)}})},_embind_register_void:(e,t)=>{Pe(e,{isVoid:!0,name:t=Ee(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},_emval_as:(e,t,n)=>(e=bt.toValue(e),t=Dt(t,"emval::as"),xt(t,n,e)),_emval_call_method:(e,t,n,r,o)=>{var i,s;return(e=Nt[e])(t=bt.toValue(t),t[n=void 0===(s=Rt[i=n])?Ee(i):s],r,o)},_emval_decref:yt,_emval_get_method_caller:(e,t,n)=>{var r=((e,t)=>{for(var n=new Array(e),r=0;r>2],"parameter "+r);return n})(e,t),o=r.shift();e--;var i="return function (obj, func, destructorsRef, args) {\n",s=0,A=[];0===n&&A.push("obj");for(var a=["retType"],l=[o],c=0;ce.name)).join(", ")}) => ${o.name}>`;return d=qe(p,h),u=Nt.length,Nt.push(d),u},_emval_run_destructors:e=>{var t=bt.toValue(e);ht(t),yt(e)},_emval_take_value:(e,t)=>{var n=(e=Dt(e,"_emval_take_value")).readValueFromPointer(t);return bt.toHandle(n)},_gmtime_js:function(e,t,n){var r=Ut(e,t),o=new Date(1e3*r);v[n>>2]=o.getUTCSeconds(),v[n+4>>2]=o.getUTCMinutes(),v[n+8>>2]=o.getUTCHours(),v[n+12>>2]=o.getUTCDate(),v[n+16>>2]=o.getUTCMonth(),v[n+20>>2]=o.getUTCFullYear()-1900,v[n+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),s=(o.getTime()-i)/864e5|0;v[n+28>>2]=s},_localtime_js:function(e,t,n){var r=Ut(e,t),o=new Date(1e3*r);v[n>>2]=o.getSeconds(),v[n+4>>2]=o.getMinutes(),v[n+8>>2]=o.getHours(),v[n+12>>2]=o.getDate(),v[n+16>>2]=o.getMonth(),v[n+20>>2]=o.getFullYear()-1900,v[n+24>>2]=o.getDay();var i=0|Qt(o);v[n+28>>2]=i,v[n+36>>2]=-60*o.getTimezoneOffset();var s=new Date(o.getFullYear(),0,1),A=new Date(o.getFullYear(),6,1).getTimezoneOffset(),a=s.getTimezoneOffset(),l=0|(A!=a&&o.getTimezoneOffset()==Math.min(a,A));v[n+32>>2]=l},_mktime_js:function(e){var t,n=(()=>{var t=new Date(v[e+20>>2]+1900,v[e+16>>2],v[e+12>>2],v[e+8>>2],v[e+4>>2],v[e>>2],0),n=v[e+32>>2],r=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),A=Math.min(s,i);if(n<0)v[e+32>>2]=Number(i!=s&&A==r);else if(n>0!=(A==r)){var a=Math.max(s,i),l=n>0?A:a;t.setTime(t.getTime()+6e4*(l-r))}v[e+24>>2]=t.getDay();var c=0|Qt(t);v[e+28>>2]=c,v[e>>2]=t.getSeconds(),v[e+4>>2]=t.getMinutes(),v[e+8>>2]=t.getHours(),v[e+12>>2]=t.getDate(),v[e+16>>2]=t.getMonth(),v[e+20>>2]=t.getYear();var d=t.getTime();return isNaN(d)?-1:d/1e3})();return U=n,t=+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0,ln(t),n>>>0},_tzset_js:(e,t,n,r)=>{var o=(new Date).getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1),A=i.getTimezoneOffset(),a=s.getTimezoneOffset(),l=Math.max(A,a);C[e>>2]=60*l,v[t>>2]=Number(A!=a);var c=e=>e.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],d=c(i),u=c(s);w(d),w(u),w(le(d)<=16,`timezone name truncated to fit in TZNAME_MAX (${d})`),w(le(u)<=16,`timezone name truncated to fit in TZNAME_MAX (${u})`),aDate.now(),emscripten_log:(e,t,n)=>{var r=Vt(t,n);((e,t)=>{24&e&&(t=t.replace(/\s+$/,""),t+=(t.length>0?"\n":"")+Gt(e)),1&e||(6&e?h(t):u(t))})(e,te(r,0))},emscripten_resize_heap:e=>{var t=f.length;w((e>>>=0)>t);var n=2147483648;if(e>n)return h(`Cannot enlarge memory, requested ${e} bytes, but the limit is 2147483648 bytes!`),!1;for(var r,o,i=1;i<=4;i*=2){var s=t*(1+.2/i);s=Math.min(s,e+100663296);var A=Math.min(n,(r=Math.max(e,s))+((o=65536)-r%o)%o);if(Xt(A))return!0}return h(`Failed to grow the heap from ${t} bytes to ${A} bytes, not enough memory!`),!1},environ_get:(e,t)=>{var n=0;return en().forEach(((r,o)=>{var i=t+n;C[e+4*o>>2]=i,((e,t)=>{for(var n=0;n{var n=en();C[e>>2]=n.length;var r=0;return n.forEach((e=>r+=e.length+1)),C[t>>2]=r,0},fd_close:function(e){try{var t=we.getStreamFromFD(e);return be.close(t),0}catch(e){if(void 0===be||"ErrnoError"!==e.name)throw e;return e.errno}},fd_fdstat_get:function(e,t){try{var n=we.getStreamFromFD(e),r=n.tty?2:be.isDir(n.mode)?3:be.isLink(n.mode)?7:4;return p[t]=r,m[t+2>>1]=0,B=[0,(U=0,+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[t+8>>2]=B[0],v[t+12>>2]=B[1],B=[0,(U=0,+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[t+16>>2]=B[0],v[t+20>>2]=B[1],0}catch(e){if(void 0===be||"ErrnoError"!==e.name)throw e;return e.errno}},fd_read:function(e,t,n,r){try{var o=((e,t,n,r)=>{for(var o=0,i=0;i>2],A=C[t+4>>2];t+=8;var a=be.read(e,p,s,A,r);if(a<0)return-1;if(o+=a,a>2]=o,0}catch(e){if(void 0===be||"ErrnoError"!==e.name)throw e;return e.errno}},fd_seek:function(e,t,n,r,o){var i=Ut(t,n);try{if(isNaN(i))return 61;var s=we.getStreamFromFD(e);return be.llseek(s,i,r),B=[s.position>>>0,(U=s.position,+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[o>>2]=B[0],v[o+4>>2]=B[1],s.getdents&&0===i&&0===r&&(s.getdents=null),0}catch(e){if(void 0===be||"ErrnoError"!==e.name)throw e;return e.errno}},fd_write:function(e,t,n,r){try{var o=((e,t,n,r)=>{for(var o=0,i=0;i>2],A=C[t+4>>2];t+=8;var a=be.write(e,p,s,A,r);if(a<0)return-1;o+=a}return o})(we.getStreamFromFD(e),t,n);return C[r>>2]=o,0}catch(e){if(void 0===be||"ErrnoError"!==e.name)throw e;return e.errno}}},rn=function(){var e={env:nn,wasi_snapshot_preview1:nn};function t(e,t){var n;return rn=e.exports,w(d=rn.memory,"memory not found in wasm exports"),E(),w(it=rn.__indirect_function_table,"table not found in wasm exports"),n=rn.__wasm_call_ctors,T.unshift(n),x("wasm-instantiate"),rn}D("wasm-instantiate");var n,r,o,s=i;if(i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return h(`Module.instantiateWasm callback failed with error: ${e}`),!1}return N||(N=H()),n=N,r=e,o=function(e){w(i===s,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),s=null,t(e.instance)},c||"function"!=typeof WebAssembly.instantiateStreaming||j(n)||"function"!=typeof fetch?K(n,r,o):fetch(n,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(o,(function(e){return h(`wasm streaming compile failed: ${e}`),h("falling back to ArrayBuffer instantiation"),K(n,r,o)})))),{}}(),on=z("free",1),sn=z("malloc",1),An=z("__getTypeName",1),an=z("fflush",1),ln=z("_emscripten_tempret_set",1),cn=()=>(cn=rn.emscripten_stack_init)(),dn=()=>(dn=rn.emscripten_stack_get_end)();function un(){var e;cn(),w(!(3&(e=dn()))),0==e&&(e+=4),C[e>>2]=34821223,C[e+4>>2]=2310721022,C[0]=1668509029}function hn(){function e(){tn||(tn=!0,i.calledRun=!0,b||(w(!F),F=!0,$(),i.noFSInit||be.init.initialized||be.init(),be.ignorePermissions=!1,Z(T),i.onRuntimeInitialized&&i.onRuntimeInitialized(),w(!i._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if($(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),L.unshift(e);var e;Z(L)}()))}S>0||(un(),function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),k.unshift(e);var e;Z(k)}(),S>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),e()}),1)):e(),$()))}if(i.dynCall_ijiii=z("dynCall_ijiii",6),i.dynCall_viiijj=z("dynCall_viiijj",8),i.dynCall_jij=z("dynCall_jij",4),i.dynCall_jii=z("dynCall_jii",3),i.dynCall_jiji=z("dynCall_jiji",5),i._ff_h264_cabac_tables=119404,["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","stackAlloc","getTempRet0","exitJS","arraySum","addDays","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","readEmAsmArgs","jstoi_q","listenOnce","autoResumeAudioContext","setWasmTableEntry","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","intArrayToString","AsciiToString","stringToNewUTF8","stringToUTF8OnStack","writeArrayToMemory","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","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","getFunctionArgsName","createJsInvokerSignature","registerInheritedInstance","unregisterInheritedInstance","enumReadValueFromPointer","emval_get_global"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get(){var t=`\`${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`,n=e;n.startsWith("_")||(n="$"+e),t+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${n}')`,G(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),J(t)}}),q(e)})),["run","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","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","stackSave","stackRestore","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","emscriptenLog","readEmAsmArgsArray","jstoi_s","getExecutableName","dynCallLegacy","getDynCaller","dynCall","getWasmTableEntry","asyncLoad","alignMemory","mmapAlloc","wasmTable","noExitRuntime","freeTableIndexes","functionsInTableMap","reallyNegative","unSign","strLen","reSign","formatString","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","jsStackTrace","getCallstack","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","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","getFunctionName","heap32VectorToArray","requireRegisteredType","usesDestructorStack","createJsInvoker","UnboundTypeError","PureVirtualError","GenericWireTypeSize","EmValType","init_embind","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredPointers","registerType","integerReadValueFromPointer","floatReadValueFromPointer","readPointer","runDestructors","newFunc","craftInvokerFunction","embind__requireFunction","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","throwInstanceAlreadyDeleted","deletionQueue","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_freelist","emval_handles","emval_symbols","init_emval","count_emval_handles","getStringOrSymbol","Emval","emval_returnValue","emval_lookupTypes","emval_methodCallers","emval_addMethodCaller","reflectConstruct"].forEach(q),M=function e(){tn||hn(),tn||(M=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return hn(),t=i}(),i=e(o),s={exports:{}};var A=(r||(r=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var A=new o(r,i||e,s),a=n?n+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],A]:e._events[a].push(A):(e._events[a]=A,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function A(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),A.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},A.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,s=new Array(i);o-1?this.pickers.splice(t,1):console.warn("Picker not found in the provider.")}closeOther(e){for(const t of this.pickers)t!==e&&(t.open=!1)}constructor(){this.pickers=[]}}.getInstance(),c=["top","tl","tr","bottom","bl","br"],d="epicker",u={getPopupContainer:()=>document.body,wrapClassName:"",open:!1,placement:"br",offset:[0,0],zIndex:1e3,content:"",trigger:"click",mouseLeaveDelay:.1,isMobile:!1};class h{get $popupContainer(){if("function"==typeof this._options.getPopupContainer&&!this._options.isMobile){const e=this._options.getPopupContainer();if(e){if(!["INPUT","CANVAS","VIDEO","IMG"].includes(null==e?void 0:e.tagName))return e!==document.body&&(e.style.cssText+="position: relative;"),e;console.warn("popup container node does not support child elements, default body!")}else console.warn("popup container does not exist, default body!")}return document.body}get open(){return this._open}set open(e){this._disabled||(this._animationTimerClear(),e?(this.$content.style.display="inline-flex",this._options.isMobile&&document.body.classList.add(`${d}-body-noscroll`),this._animationTimer=setTimeout((()=>{this._animationTimerClear(),this.$content.style.opacity="1"}),20)):(this.$content.style.opacity="0",this._options.isMobile&&document.body.classList.remove(`${d}-body-noscroll`),this._animationTimer=setTimeout((()=>{this._animationTimerClear(),this.$content.style.display="none"}),350)),requestAnimationFrame((()=>{this._setPlacement()})),this._open!==!!e&&(this._onOpenChange(e),this._open=!!e))}get disabled(){return this._disabled}set disabled(e){e?this.$container.classList.add(`${d}-disabled`):this.$container.classList.remove(`${d}-disabled`),this._disabled=e}setPlacement(e){this._disabled||(c.includes(e)?this._options.placement=e:console.warn(`${e} is not a valid placement`),this._setPlacement())}destroy(){this._removeHtml(),l.remove(this)}innerHTML(e){var t;this.$body&&(this.$body.innerHTML=e||""),null==(t=this.$popupContainer)||t.appendChild(this.$content)}_onOpenChange(e){null==this._options.onOpenChange||this._options.onOpenChange.call(this._options,!!e)}_animationTimerClear(){this._animationTimer&&(clearTimeout(this._animationTimer),this._animationTimer=null)}_removeHtml(){var e,t;(this.$content.removeEventListener("click",this._onContentClick),this.$container.removeEventListener("click",this._onContentClick),"click"===this._options.trigger&&this.$container.removeEventListener("click",this._onShow),"hover"===this._options.trigger&&(this.$container.removeEventListener("mouseover",this._onShow),this.$container.removeEventListener("mousemove",this._onShow),this.$container.removeEventListener("mouseleave",this._onHide),this.$content.removeEventListener("mouseover",this._onContentShow),this.$content.removeEventListener("mousemove",this._onContentShow),this.$content.removeEventListener("mouseleave",this._onHide)),this._options.isMobile||(window.removeEventListener("blur",this._onHide),document.removeEventListener("visibilitychange",this._onHide),window.removeEventListener("resize",this._onHide),document.removeEventListener("click",this._onDocumentClick)),this._$mask)&&(this._$mask.removeEventListener("click",this._onHide),null==(t=this.$content)||t.removeChild(this._$mask));null==(e=this.$popupContainer)||e.removeChild(this.$content),this.$content.innerHTML=""}_setPlacement(){if(!this._open||this._options.isMobile)return;const e=this.$container.getBoundingClientRect(),t=this.$content.getBoundingClientRect(),n=this.$popupContainer.getBoundingClientRect(),r=e.left-n.left,o=-(e.right-n.right),i=e.y-n.y;let s,A=r+(e.width-t.width)/2;const a=i-t.height,l=i+e.height;if(/^t/.test(this._options.placement)){var c,d,u;switch(this._options.placement){case"top":s=void 0;break;case"tl":s=void 0,A=r;break;case"tr":A=void 0,s=o}this.$content.style.cssText+=`\n ${void 0!==s?`right: ${s+((null==(c=this._options.offset)?void 0:c[0])||0)}px;`:""}\n ${void 0!==A?`left: ${A+((null==(d=this._options.offset)?void 0:d[0])||0)}px;`:""}\n top: ${a+((null==(u=this._options.offset)?void 0:u[1])||0)}px;\n z-index:${this._options.zIndex};\n `}else if(/^b/.test(this._options.placement)){var h,p,f;switch(this._options.placement){case"bottom":s=void 0;break;case"bl":s=void 0,A=r;break;case"br":A=void 0,s=o}this.$content.style.cssText+=`\n ${void 0!==s?`right: ${s+((null==(h=this._options.offset)?void 0:h[0])||0)}px;`:""}\n ${void 0!==A?`left: ${A+((null==(p=this._options.offset)?void 0:p[0])||0)}px;`:""}\n top: ${l+((null==(f=this._options.offset)?void 0:f[1])||0)}px;\n z-index:${this._options.zIndex};\n `}}_initContentStyle(){if(this.$content.classList.add(`${d}`,`${d}-${this._options.placement}`),this._options.isMobile&&(this.$content.classList.add(`${d}-mobile`),this._$mask=document.createElement("div"),this._$mask.classList.add(`${d}-mask`),this.$content.appendChild(this._$mask)),this.$body=document.createElement("div"),this.$body.classList.add(`${d}-body`),this.$content.appendChild(this.$body),this._options.wrapClassName)try{this.$content.classList.add(this._options.wrapClassName)}catch(e){}}_eventListener(){this.$content.addEventListener("click",this._onContentClick),this.$container.addEventListener("click",this._onContentClick),"click"===this._options.trigger&&this.$container.addEventListener("click",this._onShow),"hover"===this._options.trigger&&(this.$container.addEventListener("mouseover",this._onShow),this.$container.addEventListener("mousemove",this._onShow),this.$container.addEventListener("mouseleave",this._onHide),this.$content.addEventListener("mouseover",this._onContentShow),this.$content.addEventListener("mousemove",this._onContentShow),this.$content.addEventListener("mouseleave",this._onHide)),this._$mask&&this._$mask.addEventListener("click",this._onHide),this._options.isMobile||(window.addEventListener("blur",this._onHide),document.addEventListener("visibilitychange",this._onHide),window.addEventListener("resize",this._onHide),document.addEventListener("click",this._onDocumentClick))}_onContentClick(e){e.stopPropagation(),l.closeOther(this)}_onShow(e){var t,n;null==e||null==(t=e.stopPropagation)||t.call(e),null==e||null==(n=e.preventDefault)||n.call(e),this._disabled||(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=null),this.open=!0)}_onContentShow(e){null==e.stopPropagation||e.stopPropagation.call(e),null==e.preventDefault||e.preventDefault.call(e),this.open&&!this._disabled&&this._onShow(null)}_onHide(){this._open&&!this._disabled&&(this._hideTimer=setTimeout((()=>{this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=null),this.open=!1}),this._options.mouseLeaveDelay>0?1e3*this._options.mouseLeaveDelay:100))}_onDocumentClick(e){if(!this.$content.contains(e.target)&&this.$content!==e.target&&!this.$container.contains(e.target)&&this.$container!==e.target){if(this._disabled)return;this._onHide()}}constructor(e){if(this._open=!1,this._animationTimer=null,this._hideTimer=null,this._disabled=!1,this._options=Object.assign({},u,e||{}),this._options.isMobile&&(this._options.trigger="click"),l.add(this),"function"==typeof this._options.container?this.$container=this._options.container():this.$container=this._options.container,!this.$container)throw new Error("container is required!");this.$content=document.createElement("div"),this._initContentStyle(),this.innerHTML(this._options.content),this._onContentClick=this._onContentClick.bind(this),this._onShow=this._onShow.bind(this),this._onContentShow=this._onContentShow.bind(this),this._onHide=this._onHide.bind(this),this._onDocumentClick=this._onDocumentClick.bind(this),this._eventListener(),this.open=!!this._options.open}}h.VERSION="0.1.0-beta.11"; /* * delegate.js v3.2.0 * Copyright (c) 2025-07-25 * Released under the MIT License. */ const p=9;if("undefined"!=typeof Element&&!Element.prototype.matches){const e=Element.prototype;e.matches=(null==e?void 0:e.matchesSelector)||(null==e?void 0:e.mozMatchesSelector)||(null==e?void 0:e.msMatchesSelector)||(null==e?void 0:e.oMatchesSelector)||(null==e?void 0:e.webkitMatchesSelector)}function f(e,t,n,r,o){const i=g.apply(this,arguments);return e.addEventListener(n,i,o),{destroy:function(){e.removeEventListener(n,i,o)}}}function m(e,t,n,r,o){return"function"==typeof e.addEventListener?f.apply(null,arguments):"function"==typeof n?f.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return f(e,t,n,r,o)})))}function g(e,t,n,r){return function(n){n.delegateTarget=function(e,t){for(;e&&e.nodeType!==p;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}(n.target,t),n.delegateTarget&&r.call(e,n)}}var v,C={exports:{}};var y,_,b,w=(v||(v=1,y=C,function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},t=y.exports,n=function(){for(var t,n=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],r=0,o=n.length,i={};rString(t[n])||"")):r}get locale(){return this._locale}get translations(){return this._translations}appendTranslations(e){this._translations=k(this._translations,e,{clone:!1}),this._locale||(this._locale=Object.keys(this._translations)[0]),this._onChange()}switchLocale(e){e in this._translations&&(this._locale=e,this._onChange())}getCurrentLocale(){return this._locale}getCurrentTranslation(){return this._translations[this._locale]}getVersion(){return"1.1.0-alpha.3"}_onChange(){return null==this.options.onChange?void 0:this.options.onChange.call(this.options,this)}_findChainValue(e,t){const n=t.split(".");let r=e;for(let e=0;e{var t;(null==(t=this.$container)?void 0:t.classList.contains(`${L}-disabled`))||null==this._onControlClick||this._onControlClick.call(this,e)}))}hide(){this.$container&&(this.$container.style.display="none",this.$container.classList.add(`${L}-hide`))}destroy(){var e;this.removeAllListeners(),null==(e=this.$popupContainer)||e.removeChild(this.$container)}_onControlClick(e){null==this.__options.onClick||this.__options.onClick.call(this.__options,e)}constructor(e){super(),this.__options={},this._disabled=!1,this._active=!1,this.__options=Object.assign({},e||{}),this.$container=document.createElement(e.tagName||"span"),this.$container.classList.add(`${L}-control`),"text"===(null==e?void 0:e.controlType)?this.$container.classList.add(`${L}-control-text`):"block"===(null==e?void 0:e.controlType)?this.$container.classList.add(`${L}-control-block`):this.$container.classList.add(`${L}-control-btn`),(null==e?void 0:e.classNameSuffix)&&this.$container.classList.add(`${L}-control-${null==e?void 0:e.classNameSuffix}`),(null==e?void 0:e.className)&&this.$container.classList.add(e.className),e.getPopupContainer?this.$popupContainer=null==e.getPopupContainer?void 0:e.getPopupContainer.call(e):this.$popupContainer=document.body,this.$popupContainer.appendChild(this.$container),this._onClick()}}function I(){return I=Object.assign||function(e){for(var t=1;t\n \n \n \n \n \n
${(null==(e=this._options.locale)?void 0:e.loading)||"loading..."}
\n `}show(e){e&&(this.$container.innerHTML=e),this.$container.style.display="flex",this.$container.classList.remove(`${L}-hide`),this.$popupContainer.classList.add(`${L}-has-loading`)}hide(){super.hide(),this.$popupContainer.classList.remove(`${L}-has-loading`)}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(Object.assign({},O,I({},e,{tagName:"div",controlType:"block"}))),this._options=Object.assign({},e),this.$container.classList.add(`${L}-loading`,`${L}-hide`),this._html()}}function x(){return x=Object.assign||function(e){for(var t=1;t`,null==(t=this.$container.querySelector(`.${L}-poster-img`))||t.addEventListener("error",this._imgLoadErrorEvent)):this.$container.innerHTML=""}show(){this.$container&&(this.$container.style.display="flex",this.$container.classList.remove(`${L}-hide`))}hide(){var e,t;super.hide(),null==(t=this.$container)||null==(e=t.querySelector(`.${L}-poster-img`))||e.removeEventListener("error",this._imgLoadErrorEvent)}destroy(){this.hide(),this.$popupContainer.removeChild(this.$container)}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(Object.assign({},R,x({},e,{tagName:"div",controlType:"block"}))),this._options=Object.assign({},R,e),this.$container.classList.add(`${L}-poster`,`${L}-hide`),this._imgLoadErrorEvent=this._imgLoadErrorEvent.bind(this),this._options.poster&&this.setPoster(this._options.poster)}}const U={play:'',pause:'',volume:e=>``,mobileFullscreen:'',fullscreen:'',exitFullscreen:'\n ',globalFullscreen:'',exitGlobalFullscreen:'',close:'',ptz:'',download:'',sdk:'',cloudRec:'',cloudRecord:'',playBack:'',playForward:'',filter:'',arrow:'',more:'',moreDot:'',minusCircle:'',plusCircle:'',record:'',talk:'',talkGrowth:e=>``,capturePicture:'',zoom:'',privacyMasking:'',info:'',error:''};function B(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r="";return n&&Object.keys(n).forEach((e=>{r+=`${e}="${n[e]}"`})),`${e}`}const j=function(){return B(U.play,"play",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},Q=function(){return B(U.pause,"pause",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return B(U.volume(L),"volume",e)},H=function(){return B(U.mobileFullscreen,"mobile-fullscreen",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},W=function(){return B(U.exitFullscreen,"exit-fullscreen",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},K=function(){return B(U.fullscreen,"fullscreen",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},V=function(){return B(U.exitGlobalFullscreen,"exit-global-fullscreen",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},G=function(){return B(U.globalFullscreen,"global-fullscreen",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},Y=function(){return B(U.capturePicture,"capture-picture",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},q=function(){return B(U.ptz,"ptz",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},Z=function(){return B(U.record,"record",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},X=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return B(U.talkGrowth(L),"talk-growth",e)},J=function(){return B(U.minusCircle,"minus-circle",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},ee=function(){return B(U.plusCircle,"plus-circle",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},te=function(){return B(U.sdk,"sdk",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},ne=function(){return B(U.cloudRec,"cloud-rec",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},re=function(){return B(U.cloudRecord,"cloud-record",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},oe=function(){return B(U.error,"error",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},ie=function(){return B(U.info,"info",arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})};function se(){return se=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:0;this._show(`${ie()}
${e}
`,t,"info")}warn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this._show(`${ie()}
${e}
`,t,"warn")}error(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this._show(`${oe()}
${e}
`,t,"error")}toast(e){}_show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info";this._timer&&(clearTimeout(this._timer),this._timer=null),this.$popupContainer.classList.add(`${L}-has-message`,`${L}-has-message-${n}`),"function"==typeof this._options.render?this.$container.innerHTML=this._options.render(e,t,n):this.$container.innerHTML=`
${e||""}
`,this.$container.style.display="flex",this.$container.classList.remove(`${L}-hide`),t>0&&(this._timer=setTimeout((()=>{this.hide(),this._timer&&clearTimeout(this._timer),this._timer=null}),1e3*t))}destroy(){this._timer&&(clearTimeout(this._timer),this._timer=null),this.hide(),super.destroy()}hide(){super.hide(),this.$container.innerHTML="",Array.from(this.$popupContainer.classList).forEach((e=>{new RegExp(`^${L}-has-message`,"ig").test(e)&&this.$popupContainer.classList.remove(e)}))}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(Object.assign({},Ae,se({},e,{tagName:"div",controlType:"block"}))),this._options=Object.assign({},Ae,e),this.$container.classList.add(`${L}-message`,`${L}-hide`)}}function le(){return le=Object.assign||function(e){for(var t=1;t{r=Date.now(),n=null,e.apply(this,i)}),a))}}var de,ue,he;class pe{static orientationEventListener(e){let t=null,n=()=>{var e,t;if(null==(e=screen)?void 0:e.orientation)return{angle:screen.orientation.angle,type:screen.orientation.type||screen.mozOrientation||screen.msOrientation};if(void 0!==(null==(t=window)?void 0:t.orientation)){const e=window.orientation;return{angle:e>=0?e:360+e,type:90===Math.abs(e)?"landscape":"portrait"}}return pe.isMobile?{angle:window.innerWidth>window.innerHeight?90:0,type:window.innerWidth>window.innerHeight?"landscape":"portrait"}:{angle:0,type:"unknow"}},r=n(),o=()=>{const t=null==n?void 0:n();t.angle===r.angle&&t.type===r.type||(null==e||e(t),r=t)},i=()=>{t&&clearTimeout(t),o&&(t=setTimeout(o,200))};return screen.orientation?screen.orientation.addEventListener("change",o):"onorientationchange"in window?window.addEventListener("orientationchange",o):pe.isMobile&&window.addEventListener("resize",i),[r,()=>{screen.orientation&&o?screen.orientation.removeEventListener("change",o):"onorientationchange"in window&&o?window.removeEventListener("orientationchange",o):pe.isMobile&&window.removeEventListener("resize",i),o=null,i=null,n=null,t&&(clearTimeout(t),t=null)}]}static resizeObserver(e,t){let n=(n,r)=>{for(const o of n)o.target===e&&t&&t(n,r)},r=new ResizeObserver(ce(n,50));return r.observe(e),{unobserve(){try{null==r||r.unobserve(e)}catch(e){}n=null},disconnect(){null==r||r.disconnect(),r=null,n=null}}}}pe.isMobile=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i.test(null==(de=navigator)?void 0:de.userAgent)||/Macintosh/i.test(null==(ue=navigator)?void 0:ue.userAgent)&&(null==(he=navigator)?void 0:he.maxTouchPoints)>1;const fe={step:.01,range:[0,1],draggable:!0,disabled:!1,showPercent:!1,showPlus:!1,showMinus:!1,onChange:()=>{},renderText:(e,t)=>(100*t).toFixed(0)};class me{get disabled(){return this._disabled}set disabled(e){this._disabled=e}get value(){return this._value}set value(e){this._updateValuePercent("value",e)}get percent(){return this._percent}set percent(e){this._updateValuePercent("percent",e)}destroy(){var e,t,n,r,o,i,s,A,a,l;null==(t=this._delegateSliderMouseDown)||null==(e=t.destroy)||e.call(t),this._delegateSliderMouseDown=null,null==(r=this._delegateSliderHandleMouseDown)||null==(n=r.destroy)||n.call(r),this._delegateSliderHandleMouseDown=null,null==(i=this._delegateProgressMouseDown)||null==(o=i.destroy)||o.call(i),this._delegateProgressMouseDown=null,null==(A=this._delegatePlusClick)||null==(s=A.destroy)||s.call(A),this._delegatePlusClick=null,null==(l=this._delegateMinusClick)||null==(a=l.destroy)||a.call(l),this._delegateMinusClick=null,this.$content&&this.$container.removeChild(this.$content),this.$content=null}_updateValuePercent(e,t){if("percent"===e){if(t<0||t>1)return;this._percent!==t&&(this._percent=+t.toFixed(2),this._convertPercentToValue(this._percent),null==this.options.onChange||this.options.onChange.call(this.options,this._value,this._percent,this.options.range),this._updateUI())}else if("value"===e){if(tthis.options.range[1])return;this._value!==t&&(this._value=+t.toFixed(2),this._convertValueToPercent(this._value),null==this.options.onChange||this.options.onChange.call(this.options,this._value,this._percent,this.options.range),this._updateUI())}}_convertPercentToValue(e){this._value=+(this.options.range[0]+(this.options.range[1]-this.options.range[0])*e).toFixed(2)}_convertValueToPercent(e){this._percent=+((e-this.options.range[0])/(this.options.range[1]-this.options.range[0])).toFixed(2)}_render(){var e;this.$content=document.createElement("div"),this.$content.className=`${L}-progress ${null!=(e=this.options.className)?e:""}`,this.$content.innerHTML=`${this.options.showPercent?`
${null==this.options.renderText?void 0:this.options.renderText.call(this.options,this._value,this._percent,this.options.range)}
`:""}\n ${this.options.showPlus?`
\n ${ee()}\n
`:""}\n
\n
\n
\n
\n ${this.options.showMinus?`
\n ${J()}\n
`:""}`,this.$container.appendChild(this.$content)}_updateUI(){const e=this.$content;if(null==e||e.setAttribute("data-value",this._value+""),e.querySelector(`.${L}-progress-slider-fill`)){const t=+(100*this._percent).toFixed(0);this.options.showPercent&&(e.querySelector(`.${L}-progress-text`).innerHTML=null==this.options.renderText?void 0:this.options.renderText.call(this.options,this._value,this._percent,this.options.range)),e.querySelector(`.${L}-progress-slider-fill`).style.height=t+"%",e.querySelector(`.${L}-progress-slider-handle`).style.top=100-t+"%"}}_eventListeners(){this._delegateSliderMouseDown=m(this.$content,`.${L}-progress-slider`,"mousedown",(e=>{var t,n;if(e.stopPropagation(),e.delegateTarget.classList.contains(`${L}-disabled`)||this._disabled)return;const r=this.$content.querySelector(`.${L}-progress-slider`).getBoundingClientRect();let o=e.clientY-r.top;o=Math.max(0,Math.min(o,r.height));const i=+((r.height-o)/r.height).toFixed(2);this._convertPercentToValue(i),null==(n=this.options)||null==(t=n.onProgressClick)||t.call(n,this._value,i,this.options.range),this.percent=i})),this._delegateSliderHandleMouseDown=m(this.$content,`.${L}-progress-slider-handle`,"mousedown",(e=>{if(e.stopPropagation(),!this.options.draggable)return;if(e.delegateTarget.classList.contains(`${L}-disabled`)||this._disabled)return;const t=e.clientY,n=this.$content.querySelector(`.${L}-progress-slider-fill`).offsetHeight,r=this.$content.querySelector(`.${L}-progress-slider`).offsetHeight;let o=ce((e=>{if(e.stopPropagation(),!this.options.draggable||this._disabled)return;const o=t-e.clientY;let i=n+o;i=Math.max(0,Math.min(i,r)),this.percent=+(i/r).toFixed(2)}),20);const i=this.$content;function s(){i.removeEventListener("mousemove",o),o=null,i.removeEventListener("mouseup",s),i.removeEventListener("mouseup",s)}i.addEventListener("mousemove",o),i.addEventListener("mouseup",s),i.addEventListener("mouseleave",s)})),this.options.showPlus&&(this._delegatePlusClick=m(this.$content,`.${L}-progress-plus`,"click",(e=>{if(e.delegateTarget.classList.contains(`${L}-disabled`)||this._disabled)return;const t=this._value+this.options.step;t<=this.options.range[1]?this.value=t:this.value=this.options.range[1],null==this.options.onPlusClick||this.options.onPlusClick.call(this.options,this.value,this.percent,this.options.range)}))),this.options.showMinus&&(this._delegateMinusClick=m(this.$content,`.${L}-progress-minus`,"click",(e=>{if(e.delegateTarget.classList.contains(`${L}-disabled`)||this._disabled)return;const t=this._value-this.options.step;t>=this.options.range[0]?this.value=t:this.value=this.options.range[0],null==this.options.onMinusClick||this.options.onMinusClick.call(this.options,this.value,this.percent,this.options.range)}))),this._delegateProgressMouseDown=m(this.$container,`.${L}-progress`,"mousedown",(e=>{e.stopPropagation()}))}constructor(e){var t,n;if(this._percent=0,this._value=0,this._disabled=!1,this._delegateSliderMouseDown=null,this._delegateSliderHandleMouseDown=null,this._delegateProgressMouseDown=null,this._delegatePlusClick=null,this._delegateMinusClick=null,this.options=Object.assign({},fe,e),2!==(null==(t=this.options.range)?void 0:t.length))throw new Error("Progress range must be an array with two elements.");if(this.options.range[0]>=this.options.range[1])throw new Error("Progress range first element must be less than the second element.");this.$container=e.container,this._render(),this._eventListeners();const r=null!=(n=this.options.defaultValue)?n:this.options.range[0];this._value=+r.toFixed(2),this._percent=+((r-this.options.range[0])/(this.options.range[1]-this.options.range[0])).toFixed(2),this._updateUI(),this.disabled=this.options.disabled}}function ge(){return ge=Object.assign||function(e){for(var t=1;t{},onChange:()=>{}};function Ce(e,t,n,r,o,i,s){try{var A=e[i](s),a=A.value}catch(e){return void n(e)}A.done?t(a):Promise.resolve(a).then(r,o)}function ye(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Ce(i,r,o,s,A,"next",e)}function A(e){Ce(i,r,o,s,A,"throw",e)}s(void 0)}))}}const _e={prefix:"ezplayer"};class be{static getInstance(){return be.instance||(be.instance=new be),be.instance}add(e,t){if(e){const n=this.fullscreens.findIndex((t=>t.element===e));n>=0?(this.fullscreens[n].onChange||(this.fullscreens[n].onChange=[]),this.fullscreens[n].onChange.push(t)):this.fullscreens.push({element:e,onChange:[t]})}}getChanges(e){const t=this.fullscreens.find((t=>t.element===e));return t&&(null==t?void 0:t.onChange)||[]}remove(e,t){const n=this.fullscreens.findIndex((t=>t.element===e));if(n>=0){var r;const e=null==(r=this.fullscreens[n].onChange)?void 0:r.find((e=>e===t));if(e){var o;const t=null==(o=this.fullscreens[n].onChange)?void 0:o.filter((t=>t!==e));this.fullscreens[n].onChange=t}(!this.fullscreens[n].onChange||this.fullscreens[n].onChange&&0===this.fullscreens[n].onChange.length)&&this.fullscreens.splice(n,1)}}constructor(){this.fullscreens=[]}}const we=be.getInstance();let Ee=class{fullscreen(){return ye((function*(){if(!pe.isMobile)return yield E.request(this.$container);this._fullscreenchange(this.$container,!0)})).call(this)}exitFullscreen(){return ye((function*(){if(pe.isMobile)this._fullscreenchange(this.$container,!1);else if(this._isFullscreen)return yield E.exit()})).call(this)}toggle(){return ye((function*(){if(!pe.isMobile)return yield E.toggle(this.$container);this._fullscreenchange(this.$container,!this._isCurrentFullscreen)})).call(this)}destroy(){E.isEnabled&&E.off("change",this._fullscreenchange2),pe.isMobile&&this._options.onChange&&we.remove(this.$container,this._options.onChange),this._fullscreenchange2=null}_fullscreenchange2(){this._fullscreenchange()}_fullscreenchange(e,t){if(this._isFullscreen=E.isFullscreen,e)this._isCurrentFullscreen=!!t,this._currentFullscreenElementList=[];else if(this._isFullscreen){const e=E.element,t=this._currentFullscreenElementList.indexOf(e);e&&-1===t?this._currentFullscreenElementList.unshift(e):e&&t>=1&&this._currentFullscreenElementList.shift();const n=this._currentFullscreenElementList.indexOf(this.$container);this._isCurrentFullscreen=n>=0}else this._isCurrentFullscreen=!1,this._currentFullscreenElementList=[];var n,r,o;this._isCurrentFullscreen?null==(n=this.$container)||n.classList.add(`${this._options.prefix}-fullscreen`):(null==(r=this.$container)||r.classList.remove(`${this._options.prefix}-fullscreen`),null==(o=this.$container)||o.classList.remove(`${this._options.prefix}-global-fullscreen`));pe.isMobile?we.getChanges(this.$container).forEach((e=>{e({isCurrentFullscreen:this._isCurrentFullscreen,isFullscreen:this._isFullscreen,isMobile:pe.isMobile})})):null==this._options.onChange||this._options.onChange.call(this._options,{isCurrentFullscreen:this._isCurrentFullscreen,isFullscreen:this._isFullscreen,isMobile:pe.isMobile}),pe.isMobile&&(this._isCurrentFullscreen?document.body.classList.add(`${this._options.prefix}-body-mobile-noscroll`):document.body.classList.remove(`${this._options.prefix}-body-mobile-noscroll`))}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._isCurrentFullscreen=!1,this._isFullscreen=!1,this._currentFullscreenElementList=[],this.$container=e,this._options=Object.assign({},_e,t),this._options.onChange&&pe.isMobile&&we.add(this.$container,this._options.onChange),this._isFullscreen=!!this._options.isFullscreen,this._fullscreenchange2=this._fullscreenchange2.bind(this),E.isEnabled&&E.on("change",this._fullscreenchange2)}};function $e(){return $e=Object.assign||function(e){for(var t=1;t"left"===e.part)),e.filter((e=>"right"===e.part))]}var Ie={autoFocus:3,footer:{btnList:[{iconId:"play",part:"left",isrender:1},{iconId:"volume",part:"left",defaultActive:1,isrender:1},{iconId:"fullscreen",part:"right",defaultActive:0,isrender:1},{iconId:"globalFullscreen",part:"right",defaultActive:0,isrender:1}]}};const Oe={pcLive:{autoFocus:3,header:{btnList:[{iconId:"deviceID",part:"left",isrender:1},{iconId:"deviceName",part:"left",isrender:1},{iconId:"rec",part:"right",isrender:1},{iconId:"cloudRec",part:"right",isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",isrender:1},{iconId:"capturePicture",part:"left",isrender:1},{iconId:"sound",part:"left",isrender:1},{iconId:"pantile",part:"left",isrender:1},{iconId:"recordvideo",part:"left",isrender:1},{iconId:"talk",part:"left",isrender:1},{iconId:"zoom",part:"left",isrender:1},{iconId:"hd",part:"right",isrender:1},{iconId:"webExpend",part:"right",isrender:1},{iconId:"expend",part:"right",isrender:1}]}},pcRec:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRecord",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}},mobileLive:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}},mobileRec:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}},security:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}},voice:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}};class De{destroy(){var e;null==(e=this.$popupContainer)||e.removeChild(this.$container)}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._options=e,this.$container=document.createElement("div"),this._defaultClass=`${L}-${this._options.cType}`,this._options.cType&&this.$container.classList.add(this._defaultClass),(null==e?void 0:e.className)&&this.$container.classList.add(e.className),(null==e?void 0:e.color)&&(this.$container.style.cssText+=`--${L}-default-color: ${e.color};`),(null==e?void 0:e.activeColor)&&(this.$container.style.cssText+=`--${L}-active-color: ${e.activeColor};`),(null==e?void 0:e.backgroundColor)&&(this.$container.style.cssText+=`;background-image: url();background-color: ${e.backgroundColor};`),e.getPopupContainer?this.$popupContainer=null==e.getPopupContainer?void 0:e.getPopupContainer.call(e):this.$popupContainer=document.body,this.$left=document.createElement("div"),this.$left.classList.add(`${this._defaultClass}-left`),this.$right=document.createElement("div"),this.$right.classList.add(`${this._defaultClass}-right`),this.$container.appendChild(this.$left),this.$container.appendChild(this.$right),this.$popupContainer.appendChild(this.$container)}}function xe(){return xe=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},{cType:"header"}))}}class Ne{destroy(){this.$container.remove()}constructor(e){if(this.$container=document.createElement("div"),this.$container.classList.add(`${L}-content`),"function"==typeof e.getPopupContainer){const t=null==e.getPopupContainer?void 0:e.getPopupContainer.call(e);null==t||t.appendChild(this.$container)}}}function Ue(){return Ue=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},{cType:"footer"}))}}function je(){return je=Object.assign||function(e){for(var t=1;t0&&(null==(t=this._picker)||t.innerHTML(`
    \n ${e.map((e=>`\n
  • \n ${e.label}\n
  • \n `)).join("")}\n
`),this._activeOption())}_render(e){if(e)if(this.$container.querySelector(`.${L}-select-btn`))this.$container.querySelector(`.${L}-select-btn`).innerHTML=`${null==e?void 0:e.label}`;else{const t=document.createElement("span");t.classList.add(`${L}-btn`,`${L}-select-btn`),t.innerHTML=`${null==e?void 0:e.label}`,this.$container.appendChild(t)}}_activeOption(){if(this._picker){var e,t;const n=null==(e=this._picker.$body)?void 0:e.querySelector(`.${L}-active`);null==n||n.classList.remove(L+"-active");const r=null==(t=this._picker.$body)?void 0:t.querySelector(`.${L}-select-option[data-value="${this.value}"]`);null==r||r.classList.add(L+"-active");const o=this.list.find((e=>e.value===this.value));this._render(o)}}_onSelectChange(){this._picker&&(this._delegation=m(this._picker.$body,`.${L}-select-option`,"click",(e=>{const t=e.delegateTarget;if(!t.classList.contains(`${L}-disabled`)){const e=t.getAttribute("data-value");if(this.value!==+e){this.value=+e,this._activeOption();const t=this.list.find((e=>e.value===this.value));null==this._options.onChange||this._options.onChange.call(this._options,this.value,t),this._picker.open=!1}}})))}destroy(){var e,t;null==(e=this._delegation)||e.destroy(),null==(t=this._picker)||t.destroy(),super.destroy()}_onControlClick(e){null==this._options.onClick||this._options.onClick.call(this._options,e)}constructor(e){super(Ge({tagName:"span",type:"button",controlType:"button"},e)),this._options=e,this.list=e.list||[],void 0===e.value&&null===e.value||(this.value=e.value),this._picker=new h({container:this.$container,getPopupContainer:()=>this.$container,trigger:pe.isMobile?"click":"hover",isMobile:pe.isMobile,wrapClassName:`${L}-${e.classNameSuffix}-picker`,open:this._options.open,offset:[0,-10],placement:"top",onOpenChange:e=>{const t=this.list.find((e=>e.value===this.value));null==this._options.onOpenChange||this._options.onOpenChange.call(this._options,e,this.value,t)}}),this.list&&this.updateSelectOptions(this.list),this._onSelectChange(),this._activeOption()}}function qe(){return qe=Object.assign||function(e){for(var t=1;t{this._playing!==e&&(this._playing=e,this._render())})),this._render()}},volume:class extends M{get muted(){return this._muted}set muted(e){this._muted!==e&&(e?(this._volume=0,this._progress&&(this._progress.value=0)):(this._volume=this._lastVolume,this._progress&&(this._progress.value=this._lastVolume)),this._muted=e,null==this._options.onChange||this._options.onChange.call(this._options,this.volume,e),this.emit(P.control.volumechange,this.volume,e)),this._updateUI()}get volume(){return this._lastVolume}set volume(e){if(e>=0&&e<=1){const t=+e.toFixed(2);this._lastVolume!==t&&(this._volume=t,this._lastVolume=this._volume,this._progress&&(this._progress.value=t),null==this._options.onChange||this._options.onChange.call(this._options,t,this._muted),this.emit(P.control.volumechange,t,this._muted)),this._updateUI()}}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this.picker&&(this.picker.disabled=e),this._updateDisabledState(e)}destroy(){var e,t,n;null==(t=this._progress)||null==(e=t.destroy)||e.call(t),this._progress=null,null==(n=this.picker)||n.destroy(),this.picker=null,super.destroy()}_toggleMute(){if(!this.disabled)return 0===this._lastVolume?(this.volume=this._options.volume||.5,void(this.muted=!1)):void(this.muted?this.muted=!1:this.muted=!0)}_updateUI(){var e,t,n,r;(this._$content.classList.remove(L+"-icon-volume-muted"),this._$content.classList.remove(L+"-icon-volume-zero"),this._$content.classList.remove(L+"-icon-volume-low"),this._$content.classList.remove(L+"-icon-volume-high"),this._muted)?(this._volume=0,this._$content.classList.add(L+"-icon-volume-muted"),this._$content.setAttribute("title",(null==(t=this._options)||null==(e=t.locale)?void 0:e.muted)||"muted")):(this._$content.classList.remove(L+"-icon-volume-muted"),0===this._volume?this._$content.classList.add(L+"-icon-volume-zero"):this._volume<=.5?this._$content.classList.add(L+"-icon-volume-low"):this._$content.classList.add(L+"-icon-volume-high"),this._$content.setAttribute("title",(null==(r=this._options)||null==(n=r.locale)?void 0:n.volume)||"volume"))}get _$content(){return this.$container.querySelector(`.${L}-icon-volume`)}_render(){var e;this.$container.innerHTML=z({title:null==(e=this._options.locale)?void 0:e.volume})}_onControlClick(){}_addEventListener(){m(this.$container,`.${L}-control-volume`,"mousedown",(()=>{this.$container.classList.contains(`${L}-disabled`)||this._toggleMute()}))}constructor(e){super(ge({},e,{tagName:"span",classNameSuffix:"volume",controlType:"button"})),this._muted=!1,this._volume=0,this._lastVolume=0,this._progress=null,this._options=Object.assign({},ve,e),this._render(),this._volume=this._options.volume>=1?1:this._options.volume<=0?0:+this._options.volume.toFixed(2),this._lastVolume=this._volume,this._muted=!!this._options.muted||!1,pe.isMobile||(this.picker=new h({container:this.$container,getPopupContainer:()=>this.$container,trigger:this._options.trigger,open:this._options.open,offset:[0,-10],placement:"top",onOpenChange:e=>{null==this._options.onOpenChange||this._options.onOpenChange.call(this._options,e,this._muted?this._lastVolume:this.volume,this._muted),this.emit(P.control.volumePanelOpenChange,e,this._lastVolume,this._muted)}}),this._progress=new me({container:this.picker.$body,defaultValue:this._options.muted?0:this._options.volume,range:[0,1],step:.1,showPercent:!0,className:`${L}-volume-progress`,onProgressClick:()=>{this.muted=!1},onChange:e=>{e!==this._volume&&(this.volume=e)}})),this._updateUI(),this._addEventListener(),this.on(P.audioCodecUnsupported,(()=>{this.disabled=!0})),this.on(P.volumechange,((e,t)=>{this._muted!==t&&(this.muted=t),this._lastVolume!==e&&(this.volume=e)}))}},deviceID:class extends M{_render(){this.$container.innerHTML=`DeviceIDDeviceIDDeviceIDDeviceIDDeviceIDDeviceIDDeviceIDDeviceID`}constructor(e){super(et({},e,{tagName:"span",controlType:"text",classNameSuffix:"device-id"})),this._render()}},deviceName:class extends M{_render(){this.$container.innerHTML=`DeviceNameDeviceNameDeviceNameDeviceNameDeviceNameDeviceName`}constructor(e){super(tt({},e,{tagName:"span",controlType:"text",classNameSuffix:"device-name"})),this._render()}},capturePicture:class extends M{_render(){var e;this.$container.innerHTML=Y({title:null==(e=this._options.locale)?void 0:e.capturePicture})}_onControlClick(e){this.emit(P.control.capturePicture,this._options.type||"download",this._options.quality||.9),super._onControlClick(e)}constructor(e){super(Qe({},e,{tagName:"span",classNameSuffix:"capture-picture"})),this._options=e,this._render()}},ptz:class extends M{_render(){this.$container.innerHTML=q()}_onControlClick(e){null==this._options.onClick||this._options.onClick.call(this._options,e)}constructor(e){super(ze({},e,{tagName:"span",controlType:"button",classNameSuffix:"ptz"})),this._options=e,this._render()}},record:class extends M{_render(){this.$container.innerHTML=Z()}_onControlClick(e){null==this._options.onClick||this._options.onClick.call(this._options,e)}constructor(e){super(He({},e,{tagName:"span",controlType:"button",classNameSuffix:"record"})),this._options=e,this._render()}},talk:class extends M{_render(){this.$container.innerHTML=X()}onClick(){}_onControlClick(e){null==this._options.onClick||this._options.onClick.call(this._options,e)}constructor(e){super(We({},e,{tagName:"span",controlType:"button",classNameSuffix:"talk"})),this._options=e,this._render()}},zoom:class extends M{_render(){}destroy(){var e;this._options.rootContainer&&this._$zoomPanel&&(null==(e=this._options.rootContainer)||e.removeChild(this._$zoomPanel),this._$zoomPanel=null);super.destroy()}_onControlClick(e){}constructor(e){super(Ke({},e,{tagName:"span",controlType:"button",classNameSuffix:"zoom"})),this._options=Object.assign({},Ve,e||{}),this._render()}},definition:class extends Ye{constructor(e){super(qe({},e,{value:e.definition||1,controlType:"button",list:[{label:"4k",value:4},{label:"极清极清极清极清极清极清极清",value:2},{label:"1080p",value:1},{label:"标清标清标清标清标清标清标清标清",value:.5}],classNameSuffix:"definition",onChange:(t,n)=>{var r;null==e||null==(r=e.onChange)||r.call(e,t,n),this.emit(P.control.changeDefinition,t,n)},onOpenChange:(t,n,r)=>{var o;null==e||null==(o=e.onOpenChange)||o.call(e,t,n,r),this.emit(P.control.definitionPanelOpenChange,t,n,r)}}))}},fullscreen:ke,globalFullscreen:class extends ke{_render(){var e,t;this.$container.innerHTML=V({title:null==(e=this.options.locale)?void 0:e.exitGlobalFullscreen})+G({title:null==(t=this.options.locale)?void 0:t.globalFullscreen})}_onControlClick(){var e,t;this.isCurrentFullscreen&&this._$rootContainer.classList.contains(`${L}-global-fullscreen`)?(this._$rootContainer.classList.remove(`${L}-global-fullscreen`),null==(e=this._fullscreenUtil)||e.exitFullscreen()):(this._$rootContainer.classList.add(`${L}-global-fullscreen`),null==(t=this._fullscreenUtil)||t.fullscreen())}constructor(e){super(je({},e,{controlType:"button",classNameSuffix:"global-fullscreen"}))}},rec:class extends M{_render(){var e,t,n;this.$container.innerHTML=te({title:null==(e=this._options.locale)?void 0:e.sdkRec,"data-type":"sdk"})+ne({title:null==(t=this._options.locale)?void 0:t.cloudRec,"data-type":"cloudRec"})+re({title:null==(n=this._options.locale)?void 0:n.cloudRecord,"data-type":"cloudRecord"})}_activeIcon(e){switch(this.$container.querySelectorAll(`.${L}-icon`).forEach((e=>{e.classList.remove(`${L}-active`)})),e){case"sdk":var t;null==(t=this.$container.querySelector(`.${L}-icon-sdk`))||t.classList.add(`${L}-active`);break;case"cloudRec":var n;null==(n=this.$container.querySelector(`.${L}-icon-cloud-rec`))||n.classList.add(`${L}-active`);break;case"cloudRecord":var r;null==(r=this.$container.querySelector(`.${L}-icon-cloud-record`))||r.classList.add(`${L}-active`)}}_onClickIcon(){this._delegation=m(this.$container,`.${L}-icon`,"click",(e=>{const t=e.delegateTarget;if(!t.classList.contains(`${L}-disabled`)){const e=t.getAttribute("data-type");this.recType!==e&&(this.recType=e,this._activeIcon(e),this.emit(P.control.changeRecType,e),null==this._options.onChange||this._options.onChange.call(this._options,e))}}))}destroy(){var e;null==(e=this._delegation)||e.destroy(),this._delegation=null,super.destroy()}_onControlClick(e){null==this._options.onClick||this._options.onClick.call(this._options,e)}constructor(e){super(Te({},e,{tagName:"div",controlType:"block",classNameSuffix:"rec"})),this._options=e,this.recType=e.recType||"sdk",this._render(),this._onClickIcon(),this._activeIcon(e.recType)}},speed:class extends Ye{constructor(e){super(Ze({},e,{value:e.speed||1,list:[{label:"4x4x",value:4},{label:"2x",value:2},{label:"1x1x",value:1},{label:"0.5x",value:.5}],classNameSuffix:"speed",controlType:"button",onChange:(t,n)=>{var r;null==e||null==(r=e.onChange)||r.call(e,t,n),this.emit(P.control.changeSpeed,t,n)},onOpenChange:(t,n,r)=>{var o;null==e||null==(o=e.onOpenChange)||o.call(e,t,n,r),this.emit(P.control.speedPanelOpenChange,t,n,r)}}))}},date:class extends M{_render(){this.$container.innerHTML="date"}_onControlClick(e){super._onControlClick(e)}constructor(e){super(Xe({},e,{tagName:"span",controlType:"button",classNameSuffix:"date"})),this._options=e,this._render()}},timeLine:class extends M{_render(){this.$container.innerHTML=`Line`}_onControlClick(e){null==this._options.onClick||this._options.onClick.call(this._options,e)}constructor(e){super(Je({},e,{tagName:"div",controlType:"block",classNameSuffix:"time-line"})),this._options=e,this._render()}},playBack:class extends M{_render(){this.$container.innerHTML=`\n ${U.playBack}\n ${this._options.time||10}\n `}_onControlClick(e){null==this._options.onClick||this._options.onClick.call(this._options,e)}constructor(e){super(nt({},e,{tagName:"span",controlType:"button",classNameSuffix:"play-back"})),this._options=e,this._render()}},playForward:class extends M{_render(){this.$container.innerHTML=`\n ${U.playForward}\n ${this._options.time||10}\n `}_onControlClick(e){null==this._options.onClick||this._options.onClick.call(this._options,e)}constructor(e){super(rt({},e,{tagName:"span",controlType:"button",classNameSuffix:"play-forward"})),this._options=e,this._render()}}};function it(e,t,n,r,o,i,s){try{var A=e[i](s),a=A.value}catch(e){return void n(e)}A.done?t(a):Promise.resolve(a).then(r,o)}function st(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){it(i,r,o,s,A,"next",e)}function A(e){it(i,r,o,s,A,"throw",e)}s(void 0)}))}}function At(){return At=Object.assign||function(e){for(var t=1;t=0&&e<=1&&(this._volume!==e&&(this._volume=e,this.emit(P.volumechange,e,this._muted),(null==(t=this.controls)?void 0:t.volumeControl)&&(null==(r=this.controls)||null==(n=r.volumeControl)?void 0:n.volume)!==e&&this.controls.volumeControl.emit(P.volumechange,e,this._muted)))}get muted(){return this._muted}set muted(e){var t,n,r;this._muted!==e&&(this._muted=e,this.emit(P.volumechange,this._volume,this._muted),(null==(t=this.controls)?void 0:t.volumeControl)&&(null==(r=this.controls)||null==(n=r.volumeControl)?void 0:n.muted)!==e&&this.controls.volumeControl.emit(P.volumechange,this._volume,e))}get zoom(){return this._zoom}set zoom(e){this._zoom=e}get recording(){return this._recording}get isCurrentFullscreen(){return this._isCurrentFullscreen}get recType(){return this._recType}get orientationAngle(){return this._orientationAngle}resize(e,t){let n="";n+="number"==typeof e?`width: ${e}px;`:`width: ${e};`,n+="number"==typeof t?`height: ${t}px;`:`height: ${t};`,this.$container&&(this.$container.style.cssText+=n)}fullscreen(){return st((function*(){var e;return yield null==(e=this._fullscreen)?void 0:e.fullscreen()})).call(this)}exitFullscreen(){return st((function*(){var e;return yield null==(e=this._fullscreen)?void 0:e.exitFullscreen()})).call(this)}changeTheme(e){this._changeThemeFlag=!0,null==this.emit||this.emit.call(this,P.changeTheme,e),this._renderTheme(e)}setPoster(e){var t;null==(t=this.posterControl)||t.setPoster(e)}destroy(){var e,t,n,r,o;this.$container&&(this.emit(P.theme.beforeDestroy),this._removeEventListener(),this._unmountedControls(),null==(e=this._loadingControl)||e.destroy(),this._loadingControl=null,null==(t=this.messageControl)||t.destroy(),this.messageControl=null,null==(n=this.posterControl)||n.destroy(),this.posterControl=null,null==(r=this.contentControl)||r.destroy(),this.contentControl=null,Array.from((null==(o=this.$container)?void 0:o.classList)||[]).forEach((e=>{new RegExp(`^${L}-`,"ig").test(e)&&this.$container.classList.remove(e)})),this.emit(P.theme.destroyed),this._onPauseTimingFunc&&(this._onPauseTimingFunc=null),this.removeAllListeners(),this.i18n=null)}_initOptions(e){if(this.options=Object.assign({},at,e),"function"==typeof this.options.container?this.$container=this.options.container():this.$container=this.options.container,!this.$container)throw new Error("container option is required!");const t=["zh","en"].includes(this.options.language)?this.options.language:"zh";this.i18n=new T({zh:Le,en:Fe},{defaultLocale:t})}_initClassName(){var e,t;this.$container.classList.add(L,pe.isMobile?L+"-mobile":L+"-pc"),["ezopen","flv","hls","mp4"].includes(this.options.type)&&this.$container.classList.add(`${L}-${this.options.type}`),"string"==typeof this.options.className&&this.$container.classList.add(this.options.className),this.resize(null==(e=this.options)?void 0:e.width,null==(t=this.options)?void 0:t.height)}_unmountedControls(){if(!this.controls)return;const e=Object.keys(this.controls).length>0||this._$header||this._$footer;if(this._interactiveResult&&(null==this._interactiveResult.cleanup||this._interactiveResult.cleanup.call(this._interactiveResult),this._interactiveResult=null),e&&this.emit(P.control.beforeUnmountControls),Object.keys(this.controls).length>0){for(const e in this.controls){var t,n;null==(t=(n=this.controls[e]).destroy)||t.call(n)}this.controls=null}this._$header&&(this._$header.destroy(),this._$header=null),this._$footer&&(this._$footer.destroy(),this._$footer=null),e&&this.emit(P.control.unmountedControls)}_renderTheme(e){return st((function*(){var t,n,r;if(this._unmountedControls(),"[object Object]"!==Object.prototype.toString.call(e))return;this.controls={},this.emit(P.control.beforeMountControls);const o=function(e){var t,n;const r={};var o;r.autoFocus=null!=(o=null==e?void 0:e.autoFocus)?o:3,r.poster=(null==e?void 0:e.poster)||"";const i=[],s=[],A=((null==e||null==(t=e.header)?void 0:t.btnList)||[]).filter((e=>1===e.isrender&&["deviceID","deviceName"].includes(e.iconId)?(i.push(e),!1):1===e.isrender&&S.includes(e.iconId)?(s.push(s[0]?Se({},e,{part:s[0].part}):e),!1):1===e.isrender)).map((e=>(Pe[e.iconId]&&(e.iconId=Pe[e.iconId]),e))),a=((null==e||null==(n=e.footer)?void 0:n.btnList)||[]).filter((e=>1===e.isrender&&["deviceID","deviceName"].includes(e.iconId)?(i.push(e),!1):1===e.isrender&&S.includes(e.iconId)?(s.push(s[0]?Se({},e,{part:s[0].part}):e),!1):1===e.isrender)).map((e=>(Pe[e.iconId]&&(e.iconId=Pe[e.iconId]),e)));var l,c,d,u,h,p;return A.length>0||i.length>0||s.length>0?(r.header={},r.header.color=null==e||null==(l=e.header)?void 0:l.color,r.header.backgroundColor=null==e||null==(c=e.header)?void 0:c.backgroundColor,r.header.activeColor=null==e||null==(d=e.header)?void 0:d.activeColor,r.header.btnList=[...i||[],...s||[],...A||[]]):r.header=void 0,a.length>0?(r.footer={},r.footer.color=null==e||null==(u=e.footer)?void 0:u.color,r.footer.backgroundColor=null==e||null==(h=e.footer)?void 0:h.backgroundColor,r.footer.activeColor=null==e||null==(p=e.footer)?void 0:p.activeColor,r.footer.btnList=a):r.footer=void 0,r}(e);if(o.poster&&this.setPoster(o.poster),null==(t=this.posterControl)||t.show(),o.header){this._$header=new Re({getPopupContainer:()=>this.$container,color:o.header.color,activeColor:o.header.activeColor,backgroundColor:o.header.backgroundColor});const[e,t]=Me(o.header.btnList||[]);this._renderControls(this._$header.$left,e),this._renderControls(this._$header.$right,t)}if(o.footer){this._$footer=new Be({getPopupContainer:()=>this.$container,color:o.footer.color,activeColor:o.footer.activeColor,backgroundColor:o.footer.backgroundColor});const[e,t]=Me(o.footer.btnList||[]);this._renderControls(this._$footer.$left,e),this._renderControls(this._$footer.$right,t)}var i,s,A,a,l,c,d;(this._$header||this._$footer)&&0!==(null==o?void 0:o.autoFocus)&&(this._interactiveResult=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3,n=arguments.length>2?arguments[2]:void 0,r=null,o=!1;const i=e.querySelector(`.${L}-header`),s=e.querySelector(`.${L}-footer`);let A=()=>{r&&(clearTimeout(r),r=null)},a=()=>{null==A||A(),null==i||i.classList.remove(`${L}-hide-transition`),null==s||s.classList.remove(`${L}-hide-transition`),o||n(!0),o=!0},l=()=>{null==A||A(),e.classList.contains(`${L}-player-pause`)||(null==i||i.classList.add(`${L}-hide-transition`),null==s||s.classList.add(`${L}-hide-transition`),o&&n(!1),o=!1)},c=()=>{null==a||a(),r=setTimeout((()=>{null==A||A(),null==l||l()}),t)},d=e=>{var t;null==e||null==(t=e.stopPropagation)||t.call(e),null==A||A()},u=()=>{o?null==l||l():null==c||c()},h=e=>{var t;null==e||null==(t=e.stopPropagation)||t.call(e),null==c||c()};if(c(),pe.isMobile&&u){const t=window.PointerEvent?"pointerdown":"touchstart";e.addEventListener(t,u),s&&s.addEventListener(t,h),i&&i.addEventListener(t,h)}else{const t=window.PointerEvent?"pointerdown":"click";var p,f,m,g;e.addEventListener(t,c),e.addEventListener("mousemove",c),e.addEventListener("mouseleave",l),s&&(null==s||null==(p=s.addEventListener)||p.call(s,t,d),null==s||null==(f=s.addEventListener)||f.call(s,"mousemove",d)),i&&(null==i||null==(m=i.addEventListener)||m.call(i,t,d),null==i||null==(g=i.addEventListener)||g.call(i,"mousemove",d))}return{cleanup:()=>{if(e){if(pe.isMobile&&u){const t=window.PointerEvent?"pointerdown":"touchstart";e.removeEventListener(t,u),s&&c&&s.removeEventListener(t,h),i&&c&&i.removeEventListener(t,h)}if(c){const a=window.PointerEvent?"pointerdown":"click";var t,n,r,o;e.removeEventListener(a,c),e.removeEventListener("mousemove",c),e.removeEventListener("mouseleave",l),s&&A&&(null==s||null==(t=s.removeEventListener)||t.call(s,a,d),null==s||null==(n=s.removeEventListener)||n.call(s,"mousemove",d)),i&&A&&(null==i||null==(r=i.removeEventListener)||r.call(i,a,d),null==i||null==(o=i.removeEventListener)||o.call(i,"mousemove",d))}l&&e.removeEventListener("mouseleave",l),u=null,c=null,l=null,a=null,h=null,d=null,null==A||A(),A=null}},clearTimeout:A,setTimeoutShow:c,hide:l}}(this.$container,1e3*((null==e?void 0:e.autoFocus)||3),(e=>{this.emit(P.control.controlsBarOpenChange,e)})),this._onPauseTimingFunc&&(this.removeListener(F,this._onPauseTimingFunc),this._onPauseTimingFunc=null),this._onPauseTimingFunc=e=>{var t,n,r,o;e?null==(n=this._interactiveResult)||null==(t=n.clearTimeout)||t.call(n):null==(o=this._interactiveResult)||null==(r=o.setTimeoutShow)||r.call(o)},this.on(F,this._onPauseTimingFunc)),(null==(s=(i=this).controls)?void 0:s.volumeControl)&&(i.controls.volumeControl.on(P.control.volumechange,((e,t)=>{i.muted!==t&&(i.muted=t),i.volume!==e&&(i.volume=e),i.emit(P.control.volumechange,e,t)})),i.controls.volumeControl.on(P.control.volumePanelOpenChange,((e,t,n)=>{i.emit(P.control.volumePanelOpenChange,e,t,n)}))),(null==(A=i.controls)?void 0:A.playControl)&&i.controls.playControl.on(P.control.play,(e=>{i.playing!==e&&(i.playing=e,i.emit(P.control.play,e))})),(null==(a=i.controls)?void 0:a.recControl)&&i.controls.recControl.on(P.control.changeRecType,(e=>{i.recType!==e&&(i.emit(P.control.changeRecType,e),i.emit(P.changeRecType,e))})),(null==(l=i.controls)?void 0:l.definitionControl)&&i.controls.definitionControl.on(P.control.definitionPanelOpenChange,((e,t,n)=>{pe.isMobile&&i.emit(F,e,t)})),(null==(c=i.controls)?void 0:c.speedControl)&&i.controls.speedControl.on(P.control.speedPanelOpenChange,((e,t,n)=>{pe.isMobile&&i.emit(F,e,t)})),(null==(d=i.controls)?void 0:d.capturePictureControl)&&i.controls.capturePictureControl.on(P.control.capturePicture,((e,t)=>{i.emit(P.control.capturePicture,e)})),this.emit(P.control.mountedControls),(null==(n=this.controls)?void 0:n.volumeControl)&&!this._changeThemeFlag&&(this.controls.volumeControl.disabled=!0),(null==(r=this.controls)?void 0:r.globalFullscreenControl)&&!this.playing&&(this.controls.globalFullscreenControl.disabled=!0)})).call(this)}_renderControls(e,t){return st((function*(){if(e){const A=this._changeThemeFlag,a=lt.reduce(((e,t)=>(e[t]=this[t],e)),{});for(const l of t){var n,r,o,i,s;if(S.includes(l.iconId))(null==(n=this.controls)?void 0:n.recControl)||(this.controls.recControl=new ot.rec(At({rootContainer:this.$container,getPopupContainer:()=>e,recType:this._recType,locale:(null==(r=this.i18n)?void 0:r.getCurrentTranslation())||{}},(null==(o=this.options)?void 0:o.recOptions)||{},A?a:{})));else if(ot[l.iconId])this.controls[`${l.iconId}Control`]=new ot[l.iconId](At({rootContainer:this.$container,getPopupContainer:()=>e,locale:(null==(i=this.i18n)?void 0:i.getCurrentTranslation())||{}},(null==(s=this.options)?void 0:s[`${l.iconId}Options`])||{},A?a:{}))}}})).call(this)}_mobileInnerWidthHeight(){if(pe.isMobile){var e,t,n,r;const o=Math.floor(window.innerHeight),i=Math.floor(window.innerWidth);null==(t=this.$container)||null==(e=t.style)||e.setProperty(`--${L}-mobile-inner-height`,`${o}px`),null==(r=this.$container)||null==(n=r.style)||n.setProperty(`--${L}-mobile-inner-width`,`${i}px`)}}_addEventListener(){this._fullscreen=new Ee(this.$container,{prefix:L,onChange:e=>{e.isCurrentFullscreen?this.emit(P.fullscreen):this._isCurrentFullscreen&&this.emit(P.exitFullscreen),this._isCurrentFullscreen=e.isCurrentFullscreen,this.emit(P.fullscreenChange,e)}});const e=e=>{if(this.$container){var t;switch(null==(t=this.$container.classList)||t.remove(`${L}-angle-0`,`${L}-angle-90`,`${L}-angle-180`,`${L}-angle-270`),e.angle){case 0:this.$container.classList.add(`${L}-angle-0`);break;case 90:this.$container.classList.add(`${L}-angle-90`);break;case 180:this.$container.classList.add(`${L}-angle-180`);break;case 270:this.$container.classList.add(`${L}-angle-270`)}this.orientationAngle!==e.angle&&this.emit(P.orientationChange,e.angle),this._orientationAngle=e.angle,this._mobileInnerWidthHeight()}},[t,n]=pe.orientationEventListener(e);this._cleanupOrientation=n,e(t),this._mobileInnerWidthHeight(),window.addEventListener("resize",ce(this._mobileInnerWidthHeight,20)),this._cleanUpResizeObserver=pe.resizeObserver(this.$container,ce((()=>{const e=Math.floor(this.$container.clientWidth),t=Math.floor(this.$container.clientHeight);if(this.width!==e||this.height!==t){if(this.emit(ct.EVENTS.resize,{width:e,height:t}),this._width=e,this._height=t,this._$header){var n,r,o,i;e-30<=((null==(r=this._$header)||null==(n=r.$left)?void 0:n.clientWidth)||0)+((null==(i=this._$header)||null==(o=i.$right)?void 0:o.clientWidth)||0)?this.emit(ct.EVENTS.control.headerMoreShow,!0):this.emit(ct.EVENTS.control.headerMoreShow,!1)}if(this._$footer){var s,A;e-16<=((null==(s=this._$footer.$left)?void 0:s.clientWidth)||0)+((null==(A=this._$footer.$right)?void 0:A.clientWidth)||0)?this.emit(ct.EVENTS.control.footerMoreShow,!0):this.emit(ct.EVENTS.control.footerMoreShow,!1)}}}),20))}_removeEventListener(){var e,t,n,r;this._isCurrentFullscreen&&(null==(r=this._fullscreen)||r.exitFullscreen());null==(e=this._fullscreen)||e.destroy(),this._fullscreen=null,null==this._cleanupOrientation||this._cleanupOrientation.call(this),this._cleanupOrientation=null,null==(n=this._cleanUpResizeObserver)||null==(t=n.unobserve)||t.call(n),this._cleanUpResizeObserver=null,window.removeEventListener("resize",this._mobileInnerWidthHeight)}_reset(){this._zoom=1}constructor(e){var t,n,r,o,i,s;(super(),this.options=at,this.controls={},this._$header=null,this._$footer=null,this._interactiveResult=null,this._fullscreen=null,this._cleanupOrientation=null,this._cleanUpResizeObserver=null,this._width=0,this._height=0,this._isCurrentFullscreen=!1,this._orientationAngle=0,this._playing=!1,this._loading=!1,this._volume=0,this._muted=!1,this._zoom=1,this._recording=!1,this._changeThemeFlag=!1,this._onPauseTimingFunc=null,this._recType="sdk",null==e.onInitializing||e.onInitializing.call(e,this),this._initOptions(e),this._initClassName(),this.contentControl=new Ne({getPopupContainer:()=>this.$container}),null!==this.options.loadingOptions)&&(this._loadingControl=new D(At({locale:(null==(r=this.i18n)?void 0:r.getCurrentTranslation())||{}},this.options.loadingOptions||{},{getPopupContainer:()=>this.$container})));null!==this.options.messageOptions&&(this.messageControl=new ae(At({locale:(null==(o=this.i18n)?void 0:o.getCurrentTranslation())||{}},this.options.messageOptions||{},{getPopupContainer:()=>this.$container})));if(null!==this.options.posterOptions&&(this.posterControl=new N(At({},this.options.posterOptions||{},{getPopupContainer:()=>this.contentControl.$container}))),this._volume=(null==(t=this.options.volumeOptions)?void 0:t.volume)||0,this._muted=(null==(n=this.options.volumeOptions)?void 0:n.muted)||!1,this._mobileInnerWidthHeight=this._mobileInnerWidthHeight.bind(this),["flv","hls","mp4"].includes(e.type))this._renderTheme([null].includes(null==(i=this.options)?void 0:i.themeData)?null:Ie);else if("ezopen"===e.type){var A;this._renderTheme([null].includes(null==(A=this.options)?void 0:A.themeData)?null:Oe.pcLive)}this._addEventListener(),null==(s=this)||s.on(P.audioCodecUnsupported,(()=>{var e;(null==(e=s.controls)?void 0:e.volumeControl)&&s.controls.volumeControl.emit(P.audioCodecUnsupported)})),null==s||s.on(P.message,((e,t,n)=>{var r;if(["fetchError","error"].includes(t))null==(r=s.messageControl)||r.error(e,n);else if("warn"===t){var o;null==(o=s.messageControl)||o.warn(e,n)}else if("info"===t){var i;null==(i=s.messageControl)||i.info(e,n)}})),null==s||s.on(P.audioInfo,(e=>{var t;(null==s||null==(t=s.controls)?void 0:t.volumeControl)&&(e.audioFormatName||e.encType)&&(s.controls.volumeControl.disabled=!1)})),null==s||s.on(P.play,(e=>{var t,n;e&&(null==(n=s.messageControl)||n.hide()),(null==s||null==(t=s.controls)?void 0:t.globalFullscreenControl)&&(s.controls.globalFullscreenControl.disabled=!e)}))}}ct.TEMPLATES=Oe,ct.EVENTS=P,ct.LOCALES={zh:Le,en:Fe},ct.THEME_VERSION="0.0.1-alpha.18";const dt={videoBuffer:.2,videoBufferDelay:1e3,debug:!1,openWebglAlignment:!1},ut="initVideo",ht="render",pt="playAudio",ft="initAudio",mt="audioCode",gt="videoCode",vt=1,Ct=2,yt="init",_t="decode",bt="audioDecode",wt="videoDecode",Et="close",$t="updateConfig",kt=k({fullscreenChange:"fullscreenChange",orientationChange:"orientationChange",decoderWorkerInit:"decoderWorkerInit",play:"play",playing:"playing",pause:"pause",mute:"mute",load:"load",loading:"loading",loaded:"loaded",videoInfo:"videoInfo",timeUpdate:"timeUpdate",timeUpdateOSD:"timeUpdateOSD",audioInfo:"audioInfo",log:"log",error:"error",kBps:"kBps",timeout:"timeout",heartTimeout:"heartTimeout",heartRetryTimes:"heartRetryTimes",delayTimeout:"delayTimeout",loadingTimeout:"loadingTimeout",loadingRetryTimes:"loadingRetryTimes",stats:"stats",performance:"performance",buffer:"buffer",videoFrame:"videoFrame",start:"start",metadata:"metadata",resize:"resize",streamEnd:"streamEnd",streamSuccess:"streamSuccess",streamMessage:"streamMessage",streamError:"streamError",volumechange:"volumechange",audioCodecUnsupported:"audioCodecUnsupported",unrecoverableEarlyEof:"unrecoverableEarlyEof",destroy:"destroy",mseSourceOpen:"mseSourceOpen",mseSourceClose:"mseSourceClose",mseSourceBufferError:"mseSourceBufferError",mseSourceBufferBusy:"mseSourceBufferBusy",mseSourceBufferFull:"mseSourceBufferFull",videoWaiting:"videoWaiting",videoTimeUpdate:"videoTimeUpdate",videoSyncAudio:"videoSyncAudio",playToRenderTimes:"playToRenderTimes",localVideoRecords:"localVideoRecords",getDefinitionListResult:"getDefinitionListResult",definitionChange:"definitionChange",definitionListChange:"definitionListChange",playbackRateListChange:"playbackRateListChange",playbackRateChange:"playbackRateChange",decoderLoaded:"decoderLoaded",end:"end"},ct.EVENTS,{clone:!1});kt.load,kt.timeUpdate,kt.videoInfo,kt.audioInfo,kt.error,kt.kBps,kt.log,kt.start,kt.delayTimeout,kt.play,kt.pause,kt.mute,kt.stats,kt.volumechange,kt.performance,kt.playToRenderTimes,kt.mseSourceBufferFull,kt.mseSourceBufferError;const Tt="key",Lt="delta";(()=>{try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){}})(),Date.now||(Date.now=function(){return(new Date).getTime()}),i.postRun=function(){let e=[],t=[],n={};"VideoEncoder"in self&&(n={hasInit:!1,isEmitInfo:!1,offscreenCanvas:null,offscreenCanvasCtx:null,decoder:new VideoDecoder({output:function(e){n.isEmitInfo||(r.opt.debug,postMessage({cmd:ut,w:e.codedWidth,h:e.codedHeight}),n.isEmitInfo=!0,n.offscreenCanvas=new OffscreenCanvas(e.codedWidth,e.codedHeight),n.offscreenCanvasCtx=n.offscreenCanvas.getContext("2d")),n.offscreenCanvasCtx.drawImage(e,0,0,e.codedWidth,e.codedHeight);const t=n.offscreenCanvas.transferToImageBitmap();postMessage({cmd:ht,buffer:t,delay:r.delay,ts:0},[t]),setTimeout((function(){e.close?e.close():e.destroy()}),100)},error:function(e){}}),decode:function(e,t){const o=e[0]>>4==1;if(n.hasInit){const r=new EncodedVideoChunk({data:e.slice(5),timestamp:t,type:o?Tt:Lt});n.decoder.decode(r)}else if(o&&0===e[1]){const t=15&e[0];r.setVideoCodec(t);const o=function(e){const t=e.subarray(1,4);let n="avc1.";for(let e=0;e<3;e++){let r=t[e].toString(16);r.length<2&&(r="0"+r),n+=r}return{codec:n,description:e}}(e.slice(5));n.decoder.configure(o),n.hasInit=!0}},reset(){n.hasInit=!1,n.isEmitInfo=!1,n.offscreenCanvas=null,n.offscreenCanvasCtx=null}});const r={opt:{debug:dt.debug,useOffscreen:dt.useOffscreen,useWCS:dt.useWCS,videoBuffer:dt.videoBuffer,openWebglAlignment:dt.openWebglAlignment,videoBufferDelay:dt.videoBufferDelay},useOffscreen:function(){return r.opt.useOffscreen&&"undefined"!=typeof OffscreenCanvas},initAudioPlanar:function(e,n){postMessage({cmd:ft,sampleRate:n,channels:e});const r=[];let o=0;this.playAudioPlanar=function(n,s,A){let a=s;const l=[];let c=0;for(let e=0;e<2;e++){const t=i.HEAPU32[(n>>2)+e]>>2;l[e]=i.HEAPF32.subarray(t,t+a)}if(o){if(!(a>=(s=1024-o)))return o+=a,t[0]=Float32Array.of(...t[0],...l[0]),void(2===e&&(t[1]=Float32Array.of(...t[1],...l[1])));r[0]=Float32Array.of(...t[0],...l[0].subarray(0,s)),2===e&&(r[1]=Float32Array.of(...t[1],...l[1].subarray(0,s))),postMessage({cmd:pt,buffer:r,ts:A},r.map((e=>e.buffer))),c=s,a-=s}for(o=a;o>=1024;o-=1024)r[0]=l[0].slice(c,c+=1024),2===e&&(r[1]=l[1].slice(c-1024,c)),postMessage({cmd:pt,buffer:r,ts:A},r.map((e=>e.buffer)));o&&(t[0]=l[0].slice(c),2===e&&(t[1]=l[1].slice(c)))}},setVideoCodec:function(e){postMessage({cmd:gt,code:e})},setAudioCodec:function(e){postMessage({cmd:mt,code:e})},setVideoSize:function(e,t){postMessage({cmd:ut,w:e,h:t});const n=e*t,o=n>>2;r.useOffscreen()?(this.offscreenCanvas=new OffscreenCanvas(e,t),this.offscreenCanvasGL=this.offscreenCanvas.getContext("webgl"),this.webglObj=((e,t)=>{var n=["attribute vec4 vertexPos;","attribute vec4 texturePos;","varying vec2 textureCoord;","void main()","{","gl_Position = vertexPos;","textureCoord = texturePos.xy;","}"].join("\n"),r=["precision highp float;","varying highp vec2 textureCoord;","uniform sampler2D ySampler;","uniform sampler2D uSampler;","uniform sampler2D vSampler;","const mat4 YUV2RGB = mat4","(","1.1643828125, 0, 1.59602734375, -.87078515625,","1.1643828125, -.39176171875, -.81296875, .52959375,","1.1643828125, 2.017234375, 0, -1.081390625,","0, 0, 0, 1",");","void main(void) {","highp float y = texture2D(ySampler, textureCoord).r;","highp float u = texture2D(uSampler, textureCoord).r;","highp float v = texture2D(vSampler, textureCoord).r;","gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;","}"].join("\n");t&&e.pixelStorei(e.UNPACK_ALIGNMENT,1);var o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS);var i=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(i,r),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS);var s=e.createProgram();e.attachShader(s,o),e.attachShader(s,i),e.linkProgram(s),e.getProgramParameter(s,e.LINK_STATUS),e.useProgram(s);var A=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,A),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var a=e.getAttribLocation(s,"vertexPos");e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,!1,0,0);var l=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,l),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var c=e.getAttribLocation(s,"texturePos");function d(t,n){var r=e.createTexture();return e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),e.uniform1i(e.getUniformLocation(s,t),n),r}e.enableVertexAttribArray(c),e.vertexAttribPointer(c,2,e.FLOAT,!1,0,0);var u=d("ySampler",0),h=d("uSampler",1),p=d("vSampler",2);return{render:function(t,n,r,o,i){e.viewport(0,0,t,n),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,u),e.texImage2D(e.TEXTURE_2D,0,e.LUMINANCE,t,n,0,e.LUMINANCE,e.UNSIGNED_BYTE,r),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,h),e.texImage2D(e.TEXTURE_2D,0,e.LUMINANCE,t/2,n/2,0,e.LUMINANCE,e.UNSIGNED_BYTE,o),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,p),e.texImage2D(e.TEXTURE_2D,0,e.LUMINANCE,t/2,n/2,0,e.LUMINANCE,e.UNSIGNED_BYTE,i),e.drawArrays(e.TRIANGLE_STRIP,0,4)},destroy:function(){try{e.deleteProgram(s),e.deleteBuffer(A),e.deleteBuffer(l),e.deleteTexture(u),e.deleteTexture(h),e.deleteTexture(p)}catch(e){}}}})(this.offscreenCanvasGL,r.opt.openWebglAlignment),this.draw=function(r,s,A,a){const l=i.HEAPU8.subarray(s,s+n),c=i.HEAPU8.subarray(A,A+o),d=i.HEAPU8.subarray(a,a+o);this.webglObj.render(e,t,l,c,d);const u=this.offscreenCanvas.transferToImageBitmap();postMessage({cmd:ht,buffer:u,delay:this.delay,ts:r},[u])}):this.draw=function(e,t,r,s,A,a){const l=[Uint8Array.from(i.HEAPU8.subarray(t,t+n)),Uint8Array.from(i.HEAPU8.subarray(r,r+o)),Uint8Array.from(i.HEAPU8.subarray(s,s+o))];postMessage({cmd:ht,output:l,delay:this.delay,ts:e,w:A,h:a},l.map((e=>e.buffer)))}},getDelay:function(e){if(!e)return-1;if(this.firstTimestamp){if(e){const t=Date.now()-this.startTimestamp,n=e-this.firstTimestamp;this.delay=t>=n?t-n:n-t}}else this.firstTimestamp=e,this.startTimestamp=Date.now(),this.delay=-1;return this.delay},resetDelay:function(){this.firstTimestamp=null,this.startTimestamp=null,this.delay=-1},init:function(){r.opt.debug;const t=e=>{r.opt.useWCS&&r.useOffscreen()&&e.type===Ct&&n.decode?n.decode(e.payload,e.ts):e.decoder.decode(e.payload,e.ts)};this.stopId=setInterval((()=>{if(e.length)if(this.dropping){let n=e.shift();for(n&&n.type===vt&&0===n.payload[1]&&t(n);!n.isIFrame&&e.length;)n=e.shift(),n.type===vt&&0===n.payload[1]&&t(n);n.isIFrame&&(this.dropping=!1,t(n))}else{let n=e[0];if(-1===this.getDelay(n.ts))e.shift(),t(n);else if(this.delay>r.opt.videoBuffer+r.opt.videoBufferDelay)this.resetDelay(),this.dropping=!0;else for(;e.length&&(n=e[0],this.getDelay(n.ts)>r.opt.videoBuffer);)e.shift(),t(n)}}),10)},close:function(){var i,A,a,l;r.opt.debug,clearInterval(this.stopId),this.stopId=null,null==o||null===(i=o.clear)||void 0===i||i.call(o),null==s||null===(A=s.clear)||void 0===A||A.call(s),null===(a=n)||void 0===a||null===(l=a.reset)||void 0===l||l.call(a),this.firstTimestamp=null,this.startTimestamp=null,this.delay=-1,this.dropping=!1,this.webglObj&&(this.webglObj.destroy(),this.offscreenCanvas=null,this.offscreenCanvasGL=null,this.offscreenCanvasCtx=null),e=[],t=[],delete this.playAudioPlanar,delete this.draw},pushBuffer:function(t,n){n.type===vt?e.push({ts:n.ts,payload:t,decoder:o,type:vt}):n.type===Ct&&e.push({ts:n.ts,payload:t,decoder:s,type:Ct,isIFrame:n.isIFrame})}},o=new i.AudioDecoder(r),s=new i.VideoDecoder(r);self.onmessage=function(e){const t=e.data;switch(t.cmd){case yt:try{r.opt=Object.assign(r.opt,JSON.parse(t.opt))}catch(e){}o.sample_rate=t.sampleRate,r.init();break;case _t:r.pushBuffer(t.buffer,t.options);break;case bt:o.decode(t.buffer,t.ts);break;case wt:s.decode(t.buffer,t.ts);break;case Et:r.close();break;case $t:r.opt[t.key]=t.value}}},i.onRuntimeInitialized=function(){setTimeout((()=>{postMessage({cmd:yt})}),10)}}));