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