dicom-microscopy-viewer-changed
Version:
Interactive web-based viewer for DICOM Microscopy Images
1 lines • 148 kB
JavaScript
(()=>{var __webpack_modules__={327:function(e,t){var r,n=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(r=r||__filename),function(e){var t,n,o=void 0!==(e=e||{})?e:{};o.ready=new Promise((function(e,r){t=e,n=r}));var i,a,s,u=Object.assign({},o),c=[],f="object"==typeof window,l="function"==typeof importScripts,p="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,d="";if(p){var h=require("fs"),m=require("path");d=l?m.dirname(d)+"/":__dirname+"/",i=(e,t)=>(e=L(e)?new URL(e):m.normalize(e),h.readFileSync(e,t?void 0:"utf8")),s=e=>{var t=i(e,!0);return t.buffer||(t=new Uint8Array(t)),t},a=(e,t,r)=>{e=L(e)?new URL(e):m.normalize(e),h.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),c=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof G))throw e})),process.on("unhandledRejection",(function(e){throw e})),o.inspect=function(){return"[Emscripten Module object]"}}else(f||l)&&(l?d=self.location.href:"undefined"!=typeof document&&document.currentScript&&(d=document.currentScript.src),r&&(d=r),d=0!==d.indexOf("blob:")?d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},l&&(s=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),a=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});o.print||console.log.bind(console);var v,y=o.printErr||console.warn.bind(console);Object.assign(o,u),u=null,o.arguments&&(c=o.arguments),o.thisProgram&&o.thisProgram,o.quit&&o.quit,o.wasmBinary&&(v=o.wasmBinary);var g;o.noExitRuntime;"object"!=typeof WebAssembly&&q("no native wasm support detected");var w,b,T,_,$,P,C,A,x,k=!1,S="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function E(e,t){return e?function(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&S)return S.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}(T,e,t):""}function j(e,t,r){return function(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}(e,T,t,r)}function F(e){w=e,o.HEAP8=b=new Int8Array(e),o.HEAP16=_=new Int16Array(e),o.HEAP32=P=new Int32Array(e),o.HEAPU8=T=new Uint8Array(e),o.HEAPU16=$=new Uint16Array(e),o.HEAPU32=C=new Uint32Array(e),o.HEAPF32=A=new Float32Array(e),o.HEAPF64=x=new Float64Array(e)}o.INITIAL_MEMORY;var W,R=[],O=[],D=[],I=0,U=null,H=null;function q(e){o.onAbort&&o.onAbort(e),y(e="Aborted("+e+")"),k=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var M,z,V="data:application/octet-stream;base64,";function B(e){return e.startsWith(V)}function L(e){return e.startsWith("file://")}function N(e){try{if(e==M&&v)return new Uint8Array(v);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){q(e)}}function G(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function X(e){for(;e.length>0;)e.shift()(o)}function Z(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){C[this.ptr+4>>2]=e},this.get_type=function(){return C[this.ptr+4>>2]},this.set_destructor=function(e){C[this.ptr+8>>2]=e},this.get_destructor=function(){return C[this.ptr+8>>2]},this.set_refcount=function(e){P[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,b[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=b[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,b[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=b[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=P[this.ptr>>2];P[this.ptr>>2]=e+1},this.release_ref=function(){var e=P[this.ptr>>2];return P[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){C[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return C[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Ot(this.get_type()))return C[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}B(M="charlswasm_decode.wasm")||(z=M,M=o.locateFile?o.locateFile(z,d):d+z);var J={};function Y(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function K(e){return this.fromWireType(P[e>>2])}var Q={},ee={},te={},re=48,ne=57;function oe(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=re&&t<=ne?"_"+e:e}function ie(e,t){return e=oe(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function ae(e,t){var r=ie(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var se=void 0;function ue(e){throw new se(e)}function ce(e,t,r){function n(t){var n=r(t);n.length!==e.length&&ue("Mismatched type converter count");for(var o=0;o<e.length;++o)me(e[o],n[o])}e.forEach((function(e){te[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{ee.hasOwnProperty(e)?o[t]=ee[e]:(i.push(e),Q.hasOwnProperty(e)||(Q[e]=[]),Q[e].push((()=>{o[t]=ee[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function fe(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}var le=void 0;function pe(e){for(var t="",r=e;T[r];)t+=le[T[r++]];return t}var de=void 0;function he(e){throw new de(e)}function me(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||he('type "'+n+'" must have a positive integer typeid pointer'),ee.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;he("Cannot register type '"+n+"' twice")}if(ee[e]=t,delete te[e],Q.hasOwnProperty(e)){var o=Q[e];delete Q[e],o.forEach((e=>e()))}}function ve(e){if(!(this instanceof Ue))return!1;if(!(e instanceof Ue))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o}function ye(e){he(e.$$.ptrType.registeredClass.name+" instance already deleted")}var ge=!1;function we(e){}function be(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function Te(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=Te(e,t,r.baseClass);return null===n?null:r.downcast(n)}var _e={};function $e(){return Object.keys(Se).length}function Pe(){var e=[];for(var t in Se)Se.hasOwnProperty(t)&&e.push(Se[t]);return e}var Ce=[];function Ae(){for(;Ce.length;){var e=Ce.pop();e.$$.deleteScheduled=!1,e.delete()}}var xe=void 0;function ke(e){xe=e,Ce.length&&xe&&xe(Ae)}var Se={};function Ee(e,t){return t=function(e,t){for(void 0===t&&he("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),Se[t]}function je(e,t){return t.ptrType&&t.ptr||ue("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&ue("Both smartPtrType and smartPtr must be specified"),t.count={value:1},We(Object.create(e,{$$:{value:t}}))}function Fe(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Ee(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?je(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):je(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=_e[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Te(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?je(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):je(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}function We(e){return"undefined"==typeof FinalizationRegistry?(We=e=>e,e):(ge=new FinalizationRegistry((e=>{be(e.$$)})),We=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};ge.register(e,r,e)}return e},we=e=>ge.unregister(e),We(e))}function Re(){if(this.$$.ptr||ye(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=We(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}function Oe(){this.$$.ptr||ye(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&he("Object already scheduled for deletion"),we(this),be(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function De(){return!this.$$.ptr}function Ie(){return this.$$.ptr||ye(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&he("Object already scheduled for deletion"),Ce.push(this),1===Ce.length&&xe&&xe(Ae),this.$$.deleteScheduled=!0,this}function Ue(){}function He(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||he("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function qe(e,t,r){o.hasOwnProperty(e)?((void 0===r||void 0!==o[e].overloadTable&&void 0!==o[e].overloadTable[r])&&he("Cannot register public name '"+e+"' twice"),He(o,e,e),o.hasOwnProperty(r)&&he("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),o[e].overloadTable[r]=t):(o[e]=t,void 0!==r&&(o[e].numArguments=r))}function Me(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function ze(e,t,r){for(;t!==r;)t.upcast||he("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Ve(e,t){if(null===t)return this.isReference&&he("null is not a valid "+this.name),0;t.$$||he('Cannot pass "'+pt(t)+'" as a '+this.name),t.$$.ptr||he("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return ze(t.$$.ptr,r,this.registeredClass)}function Be(e,t){var r;if(null===t)return this.isReference&&he("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||he('Cannot pass "'+pt(t)+'" as a '+this.name),t.$$.ptr||he("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&he("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;if(r=ze(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&he("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:he("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,lt.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:he("Unsupporting sharing policy")}return r}function Le(e,t){if(null===t)return this.isReference&&he("null is not a valid "+this.name),0;t.$$||he('Cannot pass "'+pt(t)+'" as a '+this.name),t.$$.ptr||he("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&he("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return ze(t.$$.ptr,r,this.registeredClass)}function Ne(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Ge(e){this.rawDestructor&&this.rawDestructor(e)}function Xe(e){null!==e&&e.delete()}function Ze(e,t,r,n,o,i,a,s,u,c,f){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=f,o||void 0!==t.baseClass?this.toWireType=Be:n?(this.toWireType=Ve,this.destructorFunction=null):(this.toWireType=Le,this.destructorFunction=null)}function Je(e,t,r){o.hasOwnProperty(e)||ue("Replacing nonexistant public symbol"),void 0!==o[e].overloadTable&&void 0!==r?o[e].overloadTable[r]=t:(o[e]=t,o[e].argCount=r)}var Ye=[];function Ke(e){var t=Ye[e];return t||(e>=Ye.length&&(Ye.length=e+1),Ye[e]=t=W.get(e)),t}function Qe(e,t,r){return e.includes("j")?function(e,t,r){var n=o["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)}(e,t,r):Ke(t).apply(null,r)}function et(e,t){var r,n,o,i=(e=pe(e)).includes("j")?(r=e,n=t,o=[],function(){return o.length=0,Object.assign(o,arguments),Qe(r,n,o)}):Ke(t);return"function"!=typeof i&&he("unknown function pointer with signature "+e+": "+t),i}var tt=void 0;function rt(e){var t=Et(e),r=pe(t);return jt(t),r}function nt(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||ee[t]||(te[t]?te[t].forEach(e):(r.push(t),n[t]=!0))})),new tt(e+": "+r.map(rt).join([", "]))}function ot(e,t){for(var r=[],n=0;n<e;n++)r.push(C[t+4*n>>2]);return r}function it(e,t,r,n,o){var i=t.length;i<2&&he("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==r,s=!1,u=1;u<t.length;++u)if(null!==t[u]&&void 0===t[u].destructorFunction){s=!0;break}var c="void"!==t[0].name,f="",l="";for(u=0;u<i-2;++u)f+=(0!==u?", ":"")+"arg"+u,l+=(0!==u?", ":"")+"arg"+u+"Wired";var p="return function "+oe(e)+"("+f+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(p+="var destructors = [];\n");var d=s?"destructors":"null",h=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[he,n,o,Y,t[0],t[1]];for(a&&(p+="var thisWired = classParam.toWireType("+d+", this);\n"),u=0;u<i-2;++u)p+="var arg"+u+"Wired = argType"+u+".toWireType("+d+", arg"+u+"); // "+t[u+2].name+"\n",h.push("argType"+u),m.push(t[u+2]);if(a&&(l="thisWired"+(l.length>0?", ":"")+l),p+=(c?"var rv = ":"")+"invoker(fn"+(l.length>0?", ":"")+l+");\n",s)p+="runDestructors(destructors);\n";else for(u=a?1:2;u<t.length;++u){var v=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==t[u].destructorFunction&&(p+=v+"_dtor("+v+"); // "+t[u].name+"\n",h.push(v+"_dtor"),m.push(t[u].destructorFunction))}return c&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",h.push(p),function(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var r=ie(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}(Function,h).apply(null,m)}var at=[],st=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function ut(e){e>4&&0==--st[e].refcount&&(st[e]=void 0,at.push(e))}function ct(){for(var e=0,t=5;t<st.length;++t)void 0!==st[t]&&++e;return e}function ft(){for(var e=5;e<st.length;++e)if(void 0!==st[e])return st[e];return null}var lt={toValue:e=>(e||he("Cannot use deleted val. handle = "+e),st[e].value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=at.length?at.pop():st.length;return st[t]={refcount:1,value:e},t}}};function pt(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function dt(e,t){switch(t){case 2:return function(e){return this.fromWireType(A[e>>2])};case 3:return function(e){return this.fromWireType(x[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function ht(e,t,r){switch(t){case 0:return r?function(e){return b[e]}:function(e){return T[e]};case 1:return r?function(e){return _[e>>1]}:function(e){return $[e>>1]};case 2:return r?function(e){return P[e>>2]}:function(e){return C[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var mt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function vt(e,t){for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&$[n];)++n;if((r=n<<1)-e>32&&mt)return mt.decode(T.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=_[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function yt(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);_[t>>1]=a,t+=2}return _[t>>1]=0,t-n}function gt(e){return 2*e.length}function wt(e,t){for(var r=0,n="";!(r>=t/4);){var o=P[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n}function bt(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),P[t>>2]=a,(t+=4)+4>o)break}return P[t>>2]=0,t-n}function Tt(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t}var _t={};function $t(){return"object"==typeof globalThis?globalThis:Function("return this")()}function Pt(e,t){var r=ee[e];return void 0===r&&he(t+" has unknown type "+rt(e)),r}var Ct={};function At(e){try{return g.grow(e-w.byteLength+65535>>>16),F(g.buffer),1}catch(e){}}se=o.InternalError=ae(Error,"InternalError"),function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);le=e}(),de=o.BindingError=ae(Error,"BindingError"),Ue.prototype.isAliasOf=ve,Ue.prototype.clone=Re,Ue.prototype.delete=Oe,Ue.prototype.isDeleted=De,Ue.prototype.deleteLater=Ie,o.getInheritedInstanceCount=$e,o.getLiveInheritedInstances=Pe,o.flushPendingDeletes=Ae,o.setDelayFunction=ke,Ze.prototype.getPointee=Ne,Ze.prototype.destructor=Ge,Ze.prototype.argPackAdvance=8,Ze.prototype.readValueFromPointer=K,Ze.prototype.deleteObject=Xe,Ze.prototype.fromWireType=Fe,tt=o.UnboundTypeError=ae(Error,"UnboundTypeError"),o.count_emval_handles=ct,o.get_first_emval=ft;var xt,kt={h:function(e,t,r){throw new Z(e).init(t,r),e},q:function(e){var t=J[e];delete J[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;ce([e],o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType))),(e=>{var i={};return o.forEach(((t,r)=>{var n=t.fieldName,a=e[r],s=t.getter,u=t.getterContext,c=e[r+o.length],f=t.setter,l=t.setterContext;i[n]={read:e=>a.fromWireType(s(u,e)),write:(e,t)=>{var r=[];f(l,e,c.toWireType(r,t)),Y(r)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var r in i)t[r]=i[r].read(e);return n(e),t},toWireType:function(e,t){for(var o in i)if(!(o in t))throw new TypeError('Missing field: "'+o+'"');var a=r();for(o in i)i[o].write(a,t[o]);return null!==e&&e.push(n,a),a},argPackAdvance:8,readValueFromPointer:K,destructorFunction:n}]}))},r:function(e,t,r,n,o){},w:function(e,t,r,n,o){var i=fe(r);me(e,{name:t=pe(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=b;else if(2===r)n=_;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=P}return this.fromWireType(n[e>>i])},destructorFunction:null})},p:function(e,t,r,n,o,i,a,s,u,c,f,l,p){f=pe(f),i=et(o,i),s&&(s=et(a,s)),c&&(c=et(u,c)),p=et(l,p);var d=oe(f);qe(d,(function(){nt("Cannot construct "+f+" due to unbound types",[n])})),ce([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:Ue.prototype;var a=ie(d,(function(){if(Object.getPrototypeOf(this)!==u)throw new de("Use 'new' to construct "+f);if(void 0===l.constructor_body)throw new de(f+" has no accessible constructor");var e=l.constructor_body[arguments.length];if(void 0===e)throw new de("Tried to invoke ctor of "+f+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(l.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var l=new Me(f,a,u,p,r,i,s,c),h=new Ze(f,l,!0,!1,!1),m=new Ze(f+"*",l,!1,!1,!1),v=new Ze(f+" const*",l,!1,!0,!1);return _e[e]={pointerType:m,constPointerType:v},Je(d,a),[h,m,v]}))},o:function(e,t,r,n,o,i){var a;t>0||q(a);var s=ot(t,r);o=et(n,o),ce([],[e],(function(e){var r="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 de("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]=()=>{nt("Cannot construct "+e.name+" due to unbound types",s)},ce([],s,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=it(r,n,null,o,i),[]})),[]}))},c:function(e,t,r,n,o,i,a,s){var u=ot(r,n);t=pe(t),i=et(o,i),ce([],[e],(function(e){var n=(e=e[0]).name+"."+t;function o(){nt("Cannot call "+n+" due to unbound types",u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,f=c[t];return void 0===f||void 0===f.overloadTable&&f.className!==e.name&&f.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(He(c,t,n),c[t].overloadTable[r-2]=o),ce([],u,(function(o){var s=it(n,o,e,i,a);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},v:function(e,t){me(e,{name:t=pe(t),fromWireType:function(e){var t=lt.toValue(e);return ut(e),t},toWireType:function(e,t){return lt.toHandle(t)},argPackAdvance:8,readValueFromPointer:K,destructorFunction:null})},k:function(e,t,r){var n=fe(r);me(e,{name:t=pe(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:dt(t,n),destructorFunction:null})},e:function(e,t,r,n,o,i){var a=ot(t,r);e=pe(e),o=et(n,o),qe(e,(function(){nt("Cannot call "+e+" due to unbound types",a)}),t-1),ce([],a,(function(r){var n=[r[0],null].concat(r.slice(1));return Je(e,it(e,n,null,o,i),t-1),[]}))},b:function(e,t,r,n,o){t=pe(t),-1===o&&(o=4294967295);var i=fe(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var u=t.includes("unsigned");me(e,{name:t,fromWireType:a,toWireType:u?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:ht(t,i,0!==n),destructorFunction:null})},a:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=C,r=t[e>>=2],o=t[e+1];return new n(w,o,r)}me(e,{name:r=pe(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},j:function(e,t){var r="std::string"===(t=pe(t));me(e,{name:t,fromWireType:function(e){var t,n=C[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==T[s]){var u=E(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(T[o+a]);t=c.join("")}return jt(e),t},toWireType:function(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||he("Cannot pass non-string to std::string"),n=r&&o?function(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t}(t):t.length;var i=St(4+n+1),a=i+4;if(C[i>>2]=n,r&&o)j(t,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(jt(a),he("String has UTF-16 code units that do not fit in 8 bits")),T[a+s]=u}else for(s=0;s<n;++s)T[a+s]=t[s];return null!==e&&e.push(jt,i),i},argPackAdvance:8,readValueFromPointer:K,destructorFunction:function(e){jt(e)}})},g:function(e,t,r){var n,o,i,a,s;r=pe(r),2===t?(n=vt,o=yt,a=gt,i=()=>$,s=1):4===t&&(n=wt,o=bt,a=Tt,i=()=>C,s=2),me(e,{name:r,fromWireType:function(e){for(var r,o=C[e>>2],a=i(),u=e+4,c=0;c<=o;++c){var f=e+4+c*t;if(c==o||0==a[f>>s]){var l=n(u,f-u);void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),u=f+t}}return jt(e),r},toWireType:function(e,n){"string"!=typeof n&&he("Cannot pass non-string to C++ string type "+r);var i=a(n),u=St(4+i+t);return C[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(jt,u),u},argPackAdvance:8,readValueFromPointer:K,destructorFunction:function(e){jt(e)}})},u:function(e,t,r,n,o,i){J[e]={name:pe(t),rawConstructor:et(r,n),rawDestructor:et(o,i),fields:[]}},d:function(e,t,r,n,o,i,a,s,u,c){J[e].fields.push({fieldName:pe(t),getterReturnType:r,getter:et(n,o),getterContext:i,setterArgumentType:a,setter:et(s,u),setterContext:c})},x:function(e,t){me(e,{isVoid:!0,name:t=pe(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},i:ut,m:function(e){return 0===e?lt.toHandle($t()):(e=void 0===(r=_t[t=e])?pe(t):r,lt.toHandle($t()[e]));var t,r},l:function(e){e>4&&(st[e].refcount+=1)},y:function(e,t,r,n){e=lt.toValue(e);var i=Ct[t];return i||(i=function(e){for(var t="",r=0;r<e;++r)t+=(0!==r?", ":"")+"arg"+r;var n="return function emval_allocator_"+e+"(constructor, argTypes, args) {\n var HEAPU32 = getMemory();\n";for(r=0;r<e;++r)n+="var argType"+r+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+r+"');\nvar arg"+r+" = argType"+r+".readValueFromPointer(args);\nargs += argType"+r+"['argPackAdvance'];\nargTypes += 4;\n";return n+="var obj = new constructor("+t+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle","getMemory",n)(Pt,o,lt.toHandle,(()=>C))}(t),Ct[t]=i),i(e,r,n)},n:function(e,t){var r=(e=Pt(e,"_emval_take_value")).readValueFromPointer(t);return lt.toHandle(r)},f:function(){q("")},t:function(e,t,r){T.copyWithin(e,t,t+r)},s:function(e){var t,r,n=T.length,o=2147483648;if((e>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,e+100663296),At(Math.min(o,(t=Math.max(e,a))+((r=65536)-t%r)%r)))return!0}return!1}},St=(function(){var e={a:kt};function t(e,t){var r,n=e.exports;o.asm=n,F((g=o.asm.z).buffer),W=o.asm.C,r=o.asm.A,O.unshift(r),function(e){if(I--,o.monitorRunDependencies&&o.monitorRunDependencies(I),0==I&&(null!==U&&(clearInterval(U),U=null),H)){var t=H;H=null,t()}}()}function r(e){t(e.instance)}function i(t){return function(){if(!v&&(f||l)){if("function"==typeof fetch&&!L(M))return fetch(M,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+M+"'";return e.arrayBuffer()})).catch((function(){return N(M)}));if(a)return new Promise((function(e,t){a(M,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return N(M)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),q(e)}))}if(I++,o.monitorRunDependencies&&o.monitorRunDependencies(I),o.instantiateWasm)try{return o.instantiateWasm(e,t)}catch(e){y("Module.instantiateWasm callback failed with error: "+e),n(e)}(v||"function"!=typeof WebAssembly.instantiateStreaming||B(M)||L(M)||p||"function"!=typeof fetch?i(r):fetch(M,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),i(r)}))}))).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.A).apply(null,arguments)},o._malloc=function(){return(St=o._malloc=o.asm.B).apply(null,arguments)}),Et=o.___getTypeName=function(){return(Et=o.___getTypeName=o.asm.D).apply(null,arguments)},jt=(o.__embind_initialize_bindings=function(){return(o.__embind_initialize_bindings=o.asm.E).apply(null,arguments)},o._free=function(){return(jt=o._free=o.asm.F).apply(null,arguments)}),Ft=o.stackSave=function(){return(Ft=o.stackSave=o.asm.G).apply(null,arguments)},Wt=o.stackRestore=function(){return(Wt=o.stackRestore=o.asm.H).apply(null,arguments)},Rt=o.stackAlloc=function(){return(Rt=o.stackAlloc=o.asm.I).apply(null,arguments)},Ot=o.___cxa_is_pointer_type=function(){return(Ot=o.___cxa_is_pointer_type=o.asm.J).apply(null,arguments)};function Dt(e){function r(){xt||(xt=!0,o.calledRun=!0,k||(X(O),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),D.unshift(e);var e;X(D)}()))}e=e||c,I>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),R.unshift(e);var e;X(R)}(),I>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),r()}),1)):r()))}if(o.ccall=function(e,t,r,n,i){var a={string:e=>{var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);j(e,t=Rt(r),r)}return t},array:e=>{var t=Rt(e.length);return function(e,t){b.set(e,t)}(e,t),t}},s=function(e){return o["_"+e]}(e),u=[],c=0;if(n)for(var f=0;f<n.length;f++){var l=a[r[f]];l?(0===c&&(c=Ft()),u[f]=l(n[f])):u[f]=n[f]}var p=s.apply(null,u);return p=function(e){return 0!==c&&Wt(c),function(e){return"string"===t?E(e):"boolean"===t?Boolean(e):e}(e)}(p)},H=function e(){xt||Dt(),xt||(H=e)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return Dt(),e.ready});"object"==typeof t&&"object"==typeof e?e.exports=n:"function"==typeof define&&define.amd?define([],(function(){return n})):"object"==typeof t&&(t.CharLSWASM=n)},400:function(e,t){var r,n=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(r=r||__filename),function(e){var t,n,o=void 0!==(e=e||{})?e:{};o.ready=new Promise((function(e,r){t=e,n=r}));var i,a,s,u=Object.assign({},o),c=[],f="./this.program",l=(e,t)=>{throw t},p="object"==typeof window,d="function"==typeof importScripts,h="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";if(h){var v=require("fs"),y=require("path");m=d?y.dirname(m)+"/":__dirname+"/",i=(e,t)=>(e=Y(e)?new URL(e):y.normalize(e),v.readFileSync(e,t?void 0:"utf8")),s=e=>{var t=i(e,!0);return t.buffer||(t=new Uint8Array(t)),t},a=(e,t,r)=>{e=Y(e)?new URL(e):y.normalize(e),v.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(f=process.argv[1].replace(/\\/g,"/")),c=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof Q))throw e})),process.on("unhandledRejection",(function(e){throw e})),l=(e,t)=>{if(z())throw process.exitCode=e,t;var r;(r=t)instanceof Q||b("exiting due to exception: "+r),process.exit(e)},o.inspect=function(){return"[Emscripten Module object]"}}else(p||d)&&(d?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),r&&(m=r),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(s=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),a=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var g,w=o.print||console.log.bind(console),b=o.printErr||console.warn.bind(console);Object.assign(o,u),u=null,o.arguments&&(c=o.arguments),o.thisProgram&&(f=o.thisProgram),o.quit&&(l=o.quit),o.wasmBinary&&(g=o.wasmBinary);var T,_=o.noExitRuntime||!0;"object"!=typeof WebAssembly&&N("no native wasm support detected");var $,P,C,A,x,k,S,E,j,F=!1,W="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&W)return W.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function O(e,t){return e?R(C,e,t):""}function D(e,t,r){return function(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}(e,C,t,r)}function I(e){$=e,o.HEAP8=P=new Int8Array(e),o.HEAP16=A=new Int16Array(e),o.HEAP32=k=new Int32Array(e),o.HEAPU8=C=new Uint8Array(e),o.HEAPU16=x=new Uint16Array(e),o.HEAPU32=S=new Uint32Array(e),o.HEAPF32=E=new Float32Array(e),o.HEAPF64=j=new Float64Array(e)}o.INITIAL_MEMORY;var U,H=[],q=[],M=[];function z(){return _}var V=0,B=null,L=null;function N(e){o.onAbort&&o.onAbort(e),b(e="Aborted("+e+")"),F=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var G,X,Z="data:application/octet-stream;base64,";function J(e){return e.startsWith(Z)}function Y(e){return e.startsWith("file://")}function K(e){try{if(e==G&&g)return new Uint8Array(g);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){N(e)}}function Q(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function ee(e){for(;e.length>0;)e.shift()(o)}function te(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){S[this.ptr+4>>2]=e},this.get_type=function(){return S[this.ptr+4>>2]},this.set_destructor=function(e){S[this.ptr+8>>2]=e},this.get_destructor=function(){return S[this.ptr+8>>2]},this.set_refcount=function(e){k[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,P[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=P[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,P[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=P[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=k[this.ptr>>2];k[this.ptr>>2]=e+1},this.release_ref=function(){var e=k[this.ptr>>2];return k[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){S[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return S[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Lt(this.get_type()))return S[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}J(G="libjpegturbowasm_decode.wasm")||(X=G,G=o.locateFile?o.locateFile(X,m):m+X);var re={};function ne(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function oe(e){return this.fromWireType(k[e>>2])}var ie={},ae={},se={},ue=48,ce=57;function fe(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=ue&&t<=ce?"_"+e:e}function le(e,t){return e=fe(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function pe(e,t){var r=le(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var de=void 0;function he(e){throw new de(e)}function me(e,t,r){function n(t){var n=r(t);n.length!==e.length&&he("Mismatched type converter count");for(var o=0;o<e.length;++o)Te(e[o],n[o])}e.forEach((function(e){se[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{ae.hasOwnProperty(e)?o[t]=ae[e]:(i.push(e),ie.hasOwnProperty(e)||(ie[e]=[]),ie[e].push((()=>{o[t]=ae[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function ve(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}var ye=void 0;function ge(e){for(var t="",r=e;C[r];)t+=ye[C[r++]];return t}var we=void 0;function be(e){throw new we(e)}function Te(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||be('type "'+n+'" must have a positive integer typeid pointer'),ae.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;be("Cannot register type '"+n+"' twice")}if(ae[e]=t,delete se[e],ie.hasOwnProperty(e)){var o=ie[e];delete ie[e],o.forEach((e=>e()))}}function _e(e){if(!(this instanceof Be))return!1;if(!(e instanceof Be))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o}function $e(e){be(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Pe=!1;function Ce(e){}function Ae(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function xe(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=xe(e,t,r.baseClass);return null===n?null:r.downcast(n)}var ke={};function Se(){return Object.keys(Oe).length}function Ee(){var e=[];for(var t in Oe)Oe.hasOwnProperty(t)&&e.push(Oe[t]);return e}var je=[];function Fe(){for(;je.length;){var e=je.pop();e.$$.deleteScheduled=!1,e.delete()}}var We=void 0;function Re(e){We=e,je.length&&We&&We(Fe)}var Oe={};function De(e,t){return t=function(e,t){for(void 0===t&&be("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),Oe[t]}function Ie(e,t){return t.ptrType&&t.ptr||he("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&he("Both smartPtrType and smartPtr must be specified"),t.count={value:1},He(Object.create(e,{$$:{value:t}}))}function Ue(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=De(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Ie(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Ie(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=ke[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=xe(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?Ie(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):Ie(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}function He(e){return"undefined"==typeof FinalizationRegistry?(He=e=>e,e):(Pe=new FinalizationRegistry((e=>{Ae(e.$$)})),He=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Pe.register(e,r,e)}return e},Ce=e=>Pe.unregister(e),He(e))}function qe(){if(this.$$.ptr||$e(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=He(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}function Me(){this.$$.ptr||$e(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&be("Object already scheduled for deletion"),Ce(this),Ae(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function ze(){return!this.$$.ptr}function Ve(){return this.$$.ptr||$e(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&be("Object already scheduled for deletion"),je.push(this),1===je.length&&We&&We(Fe),this.$$.deleteScheduled=!0,this}function Be(){}function Le(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||be("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function Ne(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function Ge(e,t,r){for(;t!==r;)t.upcast||be("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Xe(e,t){if(null===t)return this.isReference&&be("null is not a valid "+this.name),0;t.$$||be('Cannot pass "'+vt(t)+'" as a '+this.name),t.$$.ptr||be("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return Ge(t.$$.ptr,r,this.registeredClass)}function Ze(e,t){var r;if(null===t)return this.isReference&&be("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||be('Cannot pass "'+vt(t)+'" as a '+this.name),t.$$.ptr||be("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&be("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;if(r=Ge(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&be("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:be("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,mt.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:be("Unsupporting sharing policy")}return r}function Je(e,t){if(null===t)return this.isReference&&be("null is not a valid "+this.name),0;t.$$||be('Cannot pass "'+vt(t)+'" as a '+this.name),t.$$.ptr||be("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&be("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return Ge(t.$$.ptr,r,this.registeredClass)}function Ye(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Ke(e){this.rawDestructor&&this.rawDestructor(e)}function Qe(e){null!==e&&e.delete()}function et(e,t,r,n,o,i,a,s,u,c,f){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=f,o||void 0!==t.baseClass?this.toWireType=Ze:n?(this.toWireType=Xe,this.destructorFunction=null):(this.toWireType=Je,this.destructorFunction=null)}var tt=[];function rt(e){var t=tt[e];return t||(e>=tt.length&&(tt.length=e+1),tt[e]=t=U.get(e)),t}function nt(e,t,r){return e.includes("j")?function(e,t,r){var n=o["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)}(e,t,r):rt(t).apply(null,r)}function ot(e,t){var r,n,o,i=(e=ge(e)).includes("j")?(r=e,n=t,o=[],function(){return o.length=0,Object.assign(o,arguments),nt(r,n,o)}):rt(t);return"function"!=typeof i&&be("unknown function pointer with signature "+e+": "+t),i}var it=void 0;function at(e){var t=qt(e),r=ge(t);return Ht(t),r}function st(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||ae[t]||(se[t]?se[t].forEach(e):(r.push(t),n[t]=!0))})),new it(e+": "+r.map(at).join([", "]))}function ut(e,t){for(var r=[],n=0;n<e;n++)r.push(S[t+4*n>>2]);return r}function ct(e,t,r,n,o){var i=t.length;i<2&&be("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==r,s=!1,u=1;u<t.length;++u)if(null!==t[u]&&void 0===t[u].destructorFunction){s=!0;break}var c="void"!==t[0].name,f="",l="";for(u=0;u<i-2;++u)f+=(0!==u?", ":"")+"arg"+u,l+=(0!==u?", ":"")+"arg"+u+"Wired";var p="return function "+fe(e)+"("+f+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(p+="var destructors = [];\n");var d=s?"destructors":"null",h=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[be,n,o,ne,t[0],t[1]];for(a&&(p+="var thisWired = classParam.toWireType("+d+", this);\n"),u=0;u<i-2;++u)p+="var arg"+u+"Wired = argType"+u+".toWireType("+d+", arg"+u+"); // "+t[u+2].name+"\n",h.push("argType"+u),m.push(t[u+2]);if(a&&(l="thisWired"+(l.length>0?", ":"")+l),p+=(c?"var rv = ":"")+"invoker(fn"+(l.length>0?", ":"")+l+");\n",s)p+="runDestructors(destructors);\n";else for(u=a?1:2;u<t.length;++u){var v=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==t[u].destructorFunction&&(p+=v+"_dtor("+v+"); // "+t[u].name+"\n",h.push(v+"_dtor"),m.push(t[u].destructorFunction))}return c&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",h.push(p),function(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var r=le(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}(Function,h).apply(null,m)}var ft=[],lt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function pt(e){e>4&&0==--lt[e].refcount&&(lt[e]=void 0,ft.push(e))}function dt(){for(var e=0,t=5;t<lt.length;++t)void 0!==lt[t]&&++e;return e}function ht(){for(var e=5;e<lt.length;++e)if(void 0!==lt[e])return lt[e];return null}var mt={toValue:e=>(e||be("Cannot use deleted val. handle = "+e),lt[e].value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=ft.length?ft.pop():lt.length;return lt[t]={refcount:1,value:e},t}}};function vt(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function yt(e,t){switch(t){case 2:return function(e){return this.fromWireType(E[e>>2])};case 3:return function(e){return this.fromWireType(j[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function gt(e,t,r){switch(t){case 0:return r?function(e){return P[e]}:function(e){return C[e]};case 1:return r?function(e){return A[e>>1]}:function(e){return x[e>>1]};case 2:return r?function(e){return k[e>>2]}:function(e){return S[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var wt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function bt(e,t){for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&x[n];)++n;if((r=n<<1)-e>32&&wt)return wt.decode(C.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=A[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function Tt(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);A[t>>1]=a,t+=2}return A[t>>1]=0,t-n}function _t(e){return 2*e.length}function $t(e,t){for(var r=0,n="";!(r>=t/4);){var o=k[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n}function Pt(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),k[t>>2]=a,(t+=4)+4>o)break}return k[t>>2]=0,t-n}function Ct(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t}var At={};function xt(){return"object"==typeof globalThis?globalThis:Function("return this")()}function kt(e,t){var r=ae[e];return void 0===r&&be(t+" has unknown type "+at(e)),r}var St={};function Et(e){try{return T.grow(e-$.byteLength+65535>>>16),I(T.buffer),1}catch(e){}}var jt={};function Ft(){if(!Ft.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",_:f||"./this.program"};for(var t in jt)void 0===jt[t]?delete e[t]:e[t]=jt[t];var r=[];for(var t in e)r.push(t+"="+e[t]