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