barcode-detector 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- var rr=(H,B,L)=>{if(!B.has(H))throw TypeError("Cannot "+L)};var nr=(H,B,L)=>(rr(H,B,"read from private field"),L?L.call(H):B.get(H)),ar=(H,B,L)=>{if(B.has(H))throw TypeError("Cannot add the same private member more than once");B instanceof WeakSet?B.add(H):B.set(H,L)},or=(H,B,L,yt)=>(rr(H,B,"write to private field"),yt?yt.call(H,L):B.set(H,L),L);var BarcodeDetectionAPI=function(H){var vt;"use strict";const B=["aztec","code_128","code_39","code_93","codabar","data_matrix","ean_13","ean_8","itf","pdf417","qr_code","upc_a","upc_e","unknown"];function L(c){if(yt(c))return{width:c.naturalWidth,height:c.naturalHeight};if(Kt(c))return{width:c.width.baseVal.value,height:c.height.baseVal.value};if(te(c))return{width:c.videoWidth,height:c.videoHeight};if(re(c))return{width:c.width,height:c.height};if(ae(c))return{width:c.displayWidth,height:c.displayHeight};if(ee(c))return{width:c.width,height:c.height};if(ne(c))return{width:c.width,height:c.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function yt(c){try{return c instanceof HTMLImageElement}catch{return!1}}function Kt(c){try{return c instanceof SVGImageElement}catch{return!1}}function te(c){try{return c instanceof HTMLVideoElement}catch{return!1}}function ee(c){try{return c instanceof HTMLCanvasElement}catch{return!1}}function re(c){try{return c instanceof ImageBitmap}catch{return!1}}function ne(c){try{return c instanceof OffscreenCanvas}catch{return!1}}function ae(c){try{return c instanceof VideoFrame}catch{return!1}}function ir(c){try{return c instanceof Blob}catch{return!1}}function sr(c){try{return c instanceof ImageData}catch{return!1}}function ur(c,m){try{const u=new OffscreenCanvas(c,m);if(u.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return u;throw void 0}catch{const u=document.createElement("canvas");return u.width=c,u.height=m,u}}async function oe(c){if(yt(c)&&!await dr(c))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Kt(c)&&!await hr(c))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(ae(c)&&pr(c))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(te(c)&&(c.readyState===0||c.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(re(c)&&vr(c))throw new DOMException("The image source is detached.","InvalidStateError");const{width:m,height:u}=L(c);if(m===0||u===0)return null;const g=ur(m,u).getContext("2d");g.drawImage(c,0,0);try{return g.getImageData(0,0,m,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function cr(c){let m;try{m=await createImageBitmap(c)}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await oe(m)}function fr(c){const{width:m,height:u}=c;if(m===0||u===0)return null;const P=c.getContext("2d");try{return P.getImageData(0,0,m,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function lr(c){if(ir(c))return await cr(c);if(sr(c)){if(yr(c))throw new DOMException("The image data has been detached.","InvalidStateError");return c}return ee(c)||ne(c)?fr(c):await oe(c)}async function dr(c){try{return await c.decode(),!0}catch{return!1}}async function hr(c){var m;try{return await((m=c.decode)==null?void 0:m.call(c)),!0}catch{return!1}}function pr(c){return c.format===null}function yr(c){return c.data.buffer.byteLength===0}function vr(c){return c.width===0&&c.height===0}function ie(c,m){return c instanceof DOMException?new DOMException(`${m}: ${c.message}`,c.name):c instanceof Error?new c.constructor(`${m}: ${c.message}`):new Error(`${m}: ${c}`)}const se=c=>{let m;const u=new Set,P=(M,J)=>{const U=typeof M=="function"?M(m):M;if(!Object.is(U,m)){const j=m;m=J??typeof U!="object"?U:Object.assign({},m,U),u.forEach(X=>X(m,j))}},g=()=>m,E={setState:P,getState:g,subscribe:M=>(u.add(M),()=>u.delete(M)),destroy:()=>{u.clear()}};return m=c(P,g,E),E},mr=c=>c?se(c):se,gr={locateFile:(c,m)=>{var u;const P=(u=c.match(/_(.+?)\.wasm$/))==null?void 0:u[1];return P?`https://cdn.jsdelivr.net/npm/@sec-ant/zxing-wasm@2.1.3/dist/${P}/${c}`:m+c}},lt=mr()(()=>({zxingModuleWeakMap:new WeakMap,zxingModuleOverrides:gr}));function wr(c){lt.setState({zxingModuleOverrides:c})}function ue(c,m=lt.getState().zxingModuleOverrides){const{zxingModuleWeakMap:u}=lt.getState(),P=u.get(c);if(P&&Object.is(m,lt.getState().zxingModuleOverrides))return P;{lt.setState({zxingModuleOverrides:m});const g=c(m);return u.set(c,g),g}}const ce=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","UPC-A","UPC-E"],nt={tryHarder:!0,formats:[],maxSymbols:255};async function $r(c,{tryHarder:m=nt.tryHarder,formats:u=nt.formats,maxSymbols:P=nt.maxSymbols}=nt,g){const E=await ue(g,lt.getState().zxingModuleOverrides),{data:M,width:J,height:U,data:{byteLength:j}}=c,X=E._malloc(j);E.HEAP8.set(M,X);const Z=E.readBarcodesFromPixmap(X,J,U,m,br(u),P);E._free(X);const Y=[];for(let V=0;V<Z.size();++V){const Q=Z.get(V);Y.push({...Q,format:Cr(Q.format)})}return Y}function br(c){return c.join("|")}function Cr(c){const m=fe(c);let u=0,P=ce.length-1;for(;u<=P;){const g=Math.floor((u+P)/2),E=ce[g],M=fe(E);if(M===m)return E;M<m?u=g+1:P=g-1}return"None"}function fe(c){return c.toLowerCase().replace(/_-\[\]/g,"")}var le=(()=>{var c=document.currentScript&&document.currentScript.src||new URL("side-effects.js",document.baseURI).href;return function(m={}){var u=m,P,g;u.ready=new Promise((t,e)=>{P=t,g=e});var E=Object.assign({},u),M="./this.program",J=typeof window=="object",U=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var j="";function X(t){return u.locateFile?u.locateFile(t,j):j+t}var Z;(J||U)&&(U?j=self.location.href:typeof document<"u"&&document.currentScript&&(j=document.currentScript.src),c&&(j=c),j.indexOf("blob:")!==0?j=j.substr(0,j.replace(/[?#].*/,"").lastIndexOf("/")+1):j="",U&&(Z=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),u.print||console.log.bind(console);var Y=u.printErr||console.error.bind(console);Object.assign(u,E),E=null,u.arguments&&u.arguments,u.thisProgram&&(M=u.thisProgram),u.quit&&u.quit;var V;u.wasmBinary&&(V=u.wasmBinary),u.noExitRuntime,typeof WebAssembly!="object"&&At("no native wasm support detected");var Q,A,Pt=!1,N,z,dt,Et,I,F,he,pe;function ye(){var t=Q.buffer;u.HEAP8=N=new Int8Array(t),u.HEAP16=dt=new Int16Array(t),u.HEAP32=I=new Int32Array(t),u.HEAPU8=z=new Uint8Array(t),u.HEAPU16=Et=new Uint16Array(t),u.HEAPU32=F=new Uint32Array(t),u.HEAPF32=he=new Float32Array(t),u.HEAPF64=pe=new Float64Array(t)}var ve,me=[],ge=[],we=[];function Ar(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Sr(u.preRun.shift());Bt(me)}function Dr(){Bt(ge)}function xr(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Or(u.postRun.shift());Bt(we)}function Sr(t){me.unshift(t)}function Fr(t){ge.unshift(t)}function Or(t){we.unshift(t)}var it=0,mt=null;function Mr(t){it++,u.monitorRunDependencies&&u.monitorRunDependencies(it)}function jr(t){if(it--,u.monitorRunDependencies&&u.monitorRunDependencies(it),it==0&&mt){var e=mt;mt=null,e()}}function At(t){u.onAbort&&u.onAbort(t),t="Aborted("+t+")",Y(t),Pt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw g(e),e}var Ir="data:application/octet-stream;base64,";function $e(t){return t.startsWith(Ir)}var st;u.locateFile?(st="zxing_reader.wasm",$e(st)||(st=X(st))):st=new URL("/reader/zxing_reader.wasm",self.location).href;function be(t){if(t==st&&V)return new Uint8Array(V);if(Z)return Z(t);throw"both async and sync fetching of the wasm failed"}function Rr(t){return!V&&(J||U)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>be(t)):Promise.resolve().then(()=>be(t))}function Ce(t,e,r){return Rr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{Y("failed to asynchronously prepare wasm: "+n),At(n)})}function Wr(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!$e(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(i){return Y("wasm streaming compile failed: "+i),Y("falling back to ArrayBuffer instantiation"),Ce(e,r,n)})}):Ce(e,r,n)}function Hr(){var t={a:Pa};function e(n,a){var o=n.exports;return A=o,Q=A.qa,ye(),ve=A.ua,Fr(A.ra),jr(),o}Mr();function r(n){e(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(t,e)}catch(n){Y("Module.instantiateWasm callback failed with error: "+n),g(n)}return Wr(V,st,t,r).catch(g),{}}var Bt=t=>{for(;t.length>0;)t.shift()(u)},Dt=[],xt=0;function kr(t){var e=new St(t);return e.get_caught()||(e.set_caught(!0),xt--),e.set_rethrown(!1),Dt.push(e),Je(e.excPtr),e.get_exception_ptr()}var K=0;function Br(){w(0,0);var t=Dt.pop();qe(t.excPtr),K=0}function St(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){F[this.ptr+4>>2]=e},this.get_type=function(){return F[this.ptr+4>>2]},this.set_destructor=function(e){F[this.ptr+8>>2]=e},this.get_destructor=function(){return F[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,N[this.ptr+12>>0]=e},this.get_caught=function(){return N[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,N[this.ptr+13>>0]=e},this.get_rethrown=function(){return N[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){F[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return F[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=Qe(this.get_type());if(e)return F[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}function Ur(t){throw K||(K=t),K}var Ut=t=>{var e=K;if(!e)return Tt(0),0;var r=new St(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return Tt(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var i=r.ptr+16;if(Ze(o,n,i))return Tt(o),e}return Tt(n),e},Vr=()=>Ut([]),zr=t=>Ut([t]),Lr=(t,e)=>Ut([t,e]);function Yr(t){var e=new St(t).get_exception_ptr();return e}function Nr(){var t=Dt.pop();t||At("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Dt.push(t),t.set_rethrown(!0),t.set_caught(!1),xt++),K=e,K}function Gr(t,e,r){var n=new St(t);throw n.init(e,r),K=t,xt++,K}function Xr(){return xt}var Ft={};function _e(t){for(;t.length;){var e=t.pop(),r=t.pop();r(e)}}function gt(t){return this.fromWireType(I[t>>2])}var ht={},ut={},Ot={},Te=void 0;function Mt(t){throw new Te(t)}function ct(t,e,r){t.forEach(function(s){Ot[s]=e});function n(s){var f=r(s);f.length!==t.length&&Mt("Mismatched type converter count");for(var l=0;l<t.length;++l)tt(t[l],f[l])}var a=new Array(e.length),o=[],i=0;e.forEach((s,f)=>{ut.hasOwnProperty(s)?a[f]=ut[s]:(o.push(s),ht.hasOwnProperty(s)||(ht[s]=[]),ht[s].push(()=>{a[f]=ut[s],++i,i===o.length&&n(a)}))}),o.length===0&&n(a)}var qr=function(t){var e=Ft[t];delete Ft[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(i=>i.getterReturnType).concat(a.map(i=>i.setterArgumentType));ct([t],o,i=>{var s={};return a.forEach((f,l)=>{var h=f.fieldName,y=i[l],v=f.getter,C=f.getterContext,D=i[l+a.length],R=f.setter,x=f.setterContext;s[h]={read:W=>y.fromWireType(v(C,W)),write:(W,d)=>{var p=[];R(x,W,D.toWireType(p,d)),_e(p)}}}),[{name:e.name,fromWireType:function(f){var l={};for(var h in s)l[h]=s[h].read(f);return n(f),l},toWireType:function(f,l){for(var h in s)if(!(h in l))throw new TypeError(`Missing field: "${h}"`);var y=r();for(h in s)s[h].write(y,l[h]);return f!==null&&f.push(n,y),y},argPackAdvance:8,readValueFromPointer:gt,destructorFunction:n}]})};function Jr(t,e,r,n,a){}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}`)}}function Zr(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);Pe=t}var Pe=void 0;function k(t){for(var e="",r=t;z[r];)e+=Pe[z[r++]];return e}var pt=void 0;function _(t){throw new pt(t)}function Qr(t,e,r={}){var n=e.name;if(t||_(`type "${n}" must have a positive integer typeid pointer`),ut.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;_(`Cannot register type '${n}' twice`)}if(ut[t]=e,delete Ot[t],ht.hasOwnProperty(t)){var a=ht[t];delete ht[t],a.forEach(o=>o())}}function tt(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Qr(t,e,r)}function Kr(t,e,r,n,a){var o=Vt(r);e=k(e),tt(t,{name:e,fromWireType:function(i){return!!i},toWireType:function(i,s){return s?n:a},argPackAdvance:8,readValueFromPointer:function(i){var s;if(r===1)s=N;else if(r===2)s=dt;else if(r===4)s=I;else throw new TypeError("Unknown boolean type size: "+e);return this.fromWireType(s[i>>o])},destructorFunction:null})}function tn(t){if(!(this instanceof at)||!(t instanceof at))return!1;for(var e=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a}function en(t){return{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}}function zt(t){function e(r){return r.$$.ptrType.registeredClass.name}_(e(t)+" instance already deleted")}var Lt=!1;function Ee(t){}function rn(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}function Ae(t){t.count.value-=1;var e=t.count.value===0;e&&rn(t)}function De(t,e,r){if(e===r)return t;if(r.baseClass===void 0)return null;var n=De(t,e,r.baseClass);return n===null?null:r.downcast(n)}var xe={};function nn(){return Object.keys(bt).length}function an(){var t=[];for(var e in bt)bt.hasOwnProperty(e)&&t.push(bt[e]);return t}var wt=[];function Yt(){for(;wt.length;){var t=wt.pop();t.$$.deleteScheduled=!1,t.delete()}}var $t=void 0;function on(t){$t=t,wt.length&&$t&&$t(Yt)}function sn(){u.getInheritedInstanceCount=nn,u.getLiveInheritedInstances=an,u.flushPendingDeletes=Yt,u.setDelayFunction=on}var bt={};function un(t,e){for(e===void 0&&_("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}function cn(t,e){return e=un(t,e),bt[e]}function jt(t,e){(!e.ptrType||!e.ptr)&&Mt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&Mt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Ct(Object.create(t,{$$:{value:e}}))}function fn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=cn(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?jt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):jt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),i=xe[o];if(!i)return a.call(this);var s;this.isConst?s=i.constPointerType:s=i.pointerType;var f=De(e,this.registeredClass,s.registeredClass);return f===null?a.call(this):this.isSmartPointer?jt(s.registeredClass.instancePrototype,{ptrType:s,ptr:f,smartPtrType:this,smartPtr:t}):jt(s.registeredClass.instancePrototype,{ptrType:s,ptr:f})}var Ct=function(t){return typeof FinalizationRegistry>"u"?(Ct=e=>e,t):(Lt=new FinalizationRegistry(e=>{Ae(e.$$)}),Ct=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Lt.register(e,a,e)}return e},Ee=e=>Lt.unregister(e),Ct(t))};function ln(){if(this.$$.ptr||zt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Ct(Object.create(Object.getPrototypeOf(this),{$$:{value:en(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function dn(){this.$$.ptr||zt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&_("Object already scheduled for deletion"),Ee(this),Ae(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function hn(){return!this.$$.ptr}function pn(){return this.$$.ptr||zt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&_("Object already scheduled for deletion"),wt.push(this),wt.length===1&&$t&&$t(Yt),this.$$.deleteScheduled=!0,this}function yn(){at.prototype.isAliasOf=tn,at.prototype.clone=ln,at.prototype.delete=dn,at.prototype.isDeleted=hn,at.prototype.deleteLater=pn}function at(){}var vn=48,mn=57;function Se(t){if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=vn&&e<=mn?`_${t}`:t}function Fe(t,e){return t=Se(t),{[t]:function(){return e.apply(this,arguments)}}[t]}function Oe(t,e,r){if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||_(`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 Me(t,e,r){u.hasOwnProperty(t)?((r===void 0||u[t].overloadTable!==void 0&&u[t].overloadTable[r]!==void 0)&&_(`Cannot register public name '${t}' twice`),Oe(u,t,t),u.hasOwnProperty(r)&&_(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),u[t].overloadTable[r]=e):(u[t]=e,r!==void 0&&(u[t].numArguments=r))}function gn(t,e,r,n,a,o,i,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}function Nt(t,e,r){for(;e!==r;)e.upcast||_(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t}function wn(t,e){if(e===null)return this.isReference&&_(`null is not a valid ${this.name}`),0;e.$$||_(`Cannot pass "${qt(e)}" as a ${this.name}`),e.$$.ptr||_(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Nt(e.$$.ptr,r,this.registeredClass);return n}function $n(t,e){var r;if(e===null)return this.isReference&&_(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;e.$$||_(`Cannot pass "${qt(e)}" as a ${this.name}`),e.$$.ptr||_(`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=Nt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&_("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:_(`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 a=e.clone();r=this.rawShare(r,ot.toHandle(function(){a.delete()})),t!==null&&t.push(this.rawDestructor,r)}break;default:_("Unsupporting sharing policy")}return r}function bn(t,e){if(e===null)return this.isReference&&_(`null is not a valid ${this.name}`),0;e.$$||_(`Cannot pass "${qt(e)}" as a ${this.name}`),e.$$.ptr||_(`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,n=Nt(e.$$.ptr,r,this.registeredClass);return n}function Cn(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function _n(t){this.rawDestructor&&this.rawDestructor(t)}function Tn(t){t!==null&&t.delete()}function Pn(){et.prototype.getPointee=Cn,et.prototype.destructor=_n,et.prototype.argPackAdvance=8,et.prototype.readValueFromPointer=gt,et.prototype.deleteObject=Tn,et.prototype.fromWireType=fn}function et(t,e,r,n,a,o,i,s,f,l,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=f,this.rawShare=l,this.rawDestructor=h,!a&&e.baseClass===void 0?n?(this.toWireType=wn,this.destructorFunction=null):(this.toWireType=bn,this.destructorFunction=null):this.toWireType=$n}function je(t,e,r){u.hasOwnProperty(t)||Mt("Replacing nonexistant public symbol"),u[t].overloadTable!==void 0&&r!==void 0?u[t].overloadTable[r]=e:(u[t]=e,u[t].argCount=r)}var En=(t,e,r)=>{var n=u["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},It=[],T=t=>{var e=It[t];return e||(t>=It.length&&(It.length=t+1),It[t]=e=ve.get(t)),e},An=(t,e,r)=>{if(t.includes("j"))return En(t,e,r);var n=T(e).apply(null,r);return n},Dn=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),An(t,e,r)}};function q(t,e){t=k(t);function r(){return t.includes("j")?Dn(t,e):T(e)}var n=r();return typeof n!="function"&&_(`unknown function pointer with signature ${t}: ${e}`),n}function xn(t,e){var r=Fe(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
2
- `+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r}var Ie=void 0;function Re(t){var e=Xe(t),r=k(e);return rt(e),r}function Rt(t,e){var r=[],n={};function a(o){if(!n[o]&&!ut[o]){if(Ot[o]){Ot[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Ie(`${t}: `+r.map(Re).join([", "]))}function Sn(t,e,r,n,a,o,i,s,f,l,h,y,v){h=k(h),o=q(a,o),s&&(s=q(i,s)),l&&(l=q(f,l)),v=q(y,v);var C=Se(h);Me(C,function(){Rt(`Cannot construct ${h} due to unbound types`,[n])}),ct([t,e,r],n?[n]:[],function(D){D=D[0];var R,x;n?(R=D.registeredClass,x=R.instancePrototype):x=at.prototype;var W=Fe(C,function(){if(Object.getPrototypeOf(this)!==d)throw new pt("Use 'new' to construct "+h);if(p.constructor_body===void 0)throw new pt(h+" has no accessible constructor");var kt=p.constructor_body[arguments.length];if(kt===void 0)throw new pt(`Tried to invoke ctor of ${h} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(p.constructor_body).toString()}) parameters instead!`);return kt.apply(this,arguments)}),d=Object.create(x,{constructor:{value:W}});W.prototype=d;var p=new gn(h,W,d,v,R,o,s,l);p.baseClass&&(p.baseClass.__derivedClasses===void 0&&(p.baseClass.__derivedClasses=[]),p.baseClass.__derivedClasses.push(p));var S=new et(h,p,!0,!1,!1),O=new et(h+"*",p,!1,!1,!1),ft=new et(h+" const*",p,!1,!0,!1);return xe[t]={pointerType:O,constPointerType:ft},je(C,W),[S,O,ft]})}function Gt(t,e){for(var r=[],n=0;n<t;n++)r.push(F[e+n*4>>2]);return r}function Xt(t,e,r,n,a,o){var i=e.length;i<2&&_("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=e[1]!==null&&r!==null,f=!1,l=1;l<e.length;++l)if(e[l]!==null&&e[l].destructorFunction===void 0){f=!0;break}var h=e[0].name!=="void",y=i-2,v=new Array(y),C=[],D=[];return function(){arguments.length!==y&&_(`function ${t} called with ${arguments.length} arguments, expected ${y} args!`),D.length=0;var R;C.length=s?2:1,C[0]=a,s&&(R=e[1].toWireType(D,this),C[1]=R);for(var x=0;x<y;++x)v[x]=e[x+2].toWireType(D,arguments[x]),C.push(v[x]);var W=n.apply(null,C);function d(p){if(f)_e(D);else for(var S=s?1:2;S<e.length;S++){var O=S===1?R:v[S-2];e[S].destructorFunction!==null&&e[S].destructorFunction(O)}if(h)return e[0].fromWireType(p)}return d(W)}}function Fn(t,e,r,n,a,o){var i=Gt(e,r);a=q(n,a),ct([],[t],function(s){s=s[0];var f=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[e-1]!==void 0)throw new pt(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[e-1]=()=>{Rt(`Cannot construct ${s.name} due to unbound types`,i)},ct([],i,function(l){return l.splice(1,0,null),s.registeredClass.constructor_body[e-1]=Xt(f,l,null,a,o),[]}),[]})}function On(t,e,r,n,a,o,i,s,f){var l=Gt(r,n);e=k(e),o=q(a,o),ct([],[t],function(h){h=h[0];var y=`${h.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&h.registeredClass.pureVirtualFunctions.push(e);function v(){Rt(`Cannot call ${y} due to unbound types`,l)}var C=h.registeredClass.instancePrototype,D=C[e];return D===void 0||D.overloadTable===void 0&&D.className!==h.name&&D.argCount===r-2?(v.argCount=r-2,v.className=h.name,C[e]=v):(Oe(C,e,y),C[e].overloadTable[r-2]=v),ct([],l,function(R){var x=Xt(y,R,h,o,i);return C[e].overloadTable===void 0?(x.argCount=r-2,C[e]=x):C[e].overloadTable[r-2]=x,[]}),[]})}function Mn(){Object.assign(We.prototype,{get(t){return this.allocated[t]},has(t){return this.allocated[t]!==void 0},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}})}function We(){this.allocated=[void 0],this.freelist=[]}var G=new We;function He(t){t>=G.reserved&&--G.get(t).refcount===0&&G.free(t)}function jn(){for(var t=0,e=G.reserved;e<G.allocated.length;++e)G.allocated[e]!==void 0&&++t;return t}function In(){G.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),G.reserved=G.allocated.length,u.count_emval_handles=jn}var ot={toValue:t=>(t||_("Cannot use deleted val. handle = "+t),G.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return G.allocate({refcount:1,value:t})}}};function Rn(t,e){e=k(e),tt(t,{name:e,fromWireType:function(r){var n=ot.toValue(r);return He(r),n},toWireType:function(r,n){return ot.toHandle(n)},argPackAdvance:8,readValueFromPointer:gt,destructorFunction:null})}function qt(t){if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t}function Wn(t,e){switch(e){case 2:return function(r){return this.fromWireType(he[r>>2])};case 3:return function(r){return this.fromWireType(pe[r>>3])};default:throw new TypeError("Unknown float type: "+t)}}function Hn(t,e,r){var n=Vt(r);e=k(e),tt(t,{name:e,fromWireType:function(a){return a},toWireType:function(a,o){return o},argPackAdvance:8,readValueFromPointer:Wn(e,n),destructorFunction:null})}function kn(t,e,r,n,a,o,i){var s=Gt(e,r);t=k(t),a=q(n,a),Me(t,function(){Rt(`Cannot call ${t} due to unbound types`,s)},e-1),ct([],s,function(f){var l=[f[0],null].concat(f.slice(1));return je(t,Xt(t,l,null,a,o),e-1),[]})}function Bn(t,e,r){switch(e){case 0:return r?function(n){return N[n]}:function(n){return z[n]};case 1:return r?function(n){return dt[n>>1]}:function(n){return Et[n>>1]};case 2:return r?function(n){return I[n>>2]}:function(n){return F[n>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function Un(t,e,r,n,a){e=k(e);var o=Vt(r),i=y=>y;if(n===0){var s=32-8*r;i=y=>y<<s>>>s}var f=e.includes("unsigned"),l=(y,v)=>{},h;f?h=function(y,v){return l(v,this.name),v>>>0}:h=function(y,v){return l(v,this.name),v},tt(t,{name:e,fromWireType:i,toWireType:h,argPackAdvance:8,readValueFromPointer:Bn(e,o,n!==0),destructorFunction:null})}function Vn(t,e,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(i){i=i>>2;var s=F,f=s[i],l=s[i+1];return new a(s.buffer,l,f)}r=k(r),tt(t,{name:r,fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}var ke=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,i=0;i<t.length;++i){var s=t.charCodeAt(i);if(s>=55296&&s<=57343){var f=t.charCodeAt(++i);s=65536+((s&1023)<<10)|f&1023}if(s<=127){if(r>=o)break;e[r++]=s}else if(s<=2047){if(r+1>=o)break;e[r++]=192|s>>6,e[r++]=128|s&63}else if(s<=65535){if(r+2>=o)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|s&63}else{if(r+3>=o)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|s&63}}return e[r]=0,r-a},zn=(t,e,r)=>ke(t,z,e,r),Be=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},Ue=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Ln=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&Ue)return Ue.decode(t.subarray(e,a));for(var o="";e<a;){var i=t[e++];if(!(i&128)){o+=String.fromCharCode(i);continue}var s=t[e++]&63;if((i&224)==192){o+=String.fromCharCode((i&31)<<6|s);continue}var f=t[e++]&63;if((i&240)==224?i=(i&15)<<12|s<<6|f:i=(i&7)<<18|s<<12|f<<6|t[e++]&63,i<65536)o+=String.fromCharCode(i);else{var l=i-65536;o+=String.fromCharCode(55296|l>>10,56320|l&1023)}}return o},Jt=(t,e)=>t?Ln(z,t,e):"";function Yn(t,e){e=k(e);var r=e==="std::string";tt(t,{name:e,fromWireType:function(n){var a=F[n>>2],o=n+4,i;if(r)for(var s=o,f=0;f<=a;++f){var l=o+f;if(f==a||z[l]==0){var h=l-s,y=Jt(s,h);i===void 0?i=y:(i+=String.fromCharCode(0),i+=y),s=l+1}}else{for(var v=new Array(a),f=0;f<a;++f)v[f]=String.fromCharCode(z[o+f]);i=v.join("")}return rt(n),i},toWireType:function(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,i=typeof a=="string";i||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||_("Cannot pass non-string to std::string"),r&&i?o=Be(a):o=a.length;var s=Qt(4+o+1),f=s+4;if(F[s>>2]=o,r&&i)zn(a,f,o+1);else if(i)for(var l=0;l<o;++l){var h=a.charCodeAt(l);h>255&&(rt(f),_("String has UTF-16 code units that do not fit in 8 bits")),z[f+l]=h}else for(var l=0;l<o;++l)z[f+l]=a[l];return n!==null&&n.push(rt,s),s},argPackAdvance:8,readValueFromPointer:gt,destructorFunction:function(n){rt(n)}})}var Ve=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Nn=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&Et[n];)++n;if(r=n<<1,r-t>32&&Ve)return Ve.decode(z.subarray(t,r));for(var o="",i=0;!(i>=e/2);++i){var s=dt[t+i*2>>1];if(s==0)break;o+=String.fromCharCode(s)}return o},Gn=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<2)return 0;r-=2;for(var n=e,a=r<t.length*2?r/2:t.length,o=0;o<a;++o){var i=t.charCodeAt(o);dt[e>>1]=i,e+=2}return dt[e>>1]=0,e-n},Xn=t=>t.length*2,qn=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=I[t+r*4>>2];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},Jn=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,o=0;o<t.length;++o){var i=t.charCodeAt(o);if(i>=55296&&i<=57343){var s=t.charCodeAt(++o);i=65536+((i&1023)<<10)|s&1023}if(I[e>>2]=i,e+=4,e+4>a)break}return I[e>>2]=0,e-n},Zn=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},Qn=function(t,e,r){r=k(r);var n,a,o,i,s;e===2?(n=Nn,a=Gn,i=Xn,o=()=>Et,s=1):e===4&&(n=qn,a=Jn,i=Zn,o=()=>F,s=2),tt(t,{name:r,fromWireType:function(f){for(var l=F[f>>2],h=o(),y,v=f+4,C=0;C<=l;++C){var D=f+4+C*e;if(C==l||h[D>>s]==0){var R=D-v,x=n(v,R);y===void 0?y=x:(y+=String.fromCharCode(0),y+=x),v=D+e}}return rt(f),y},toWireType:function(f,l){typeof l!="string"&&_(`Cannot pass non-string to C++ string type ${r}`);var h=i(l),y=Qt(4+h+e);return F[y>>2]=h>>s,a(l,y+4,h+e),f!==null&&f.push(rt,y),y},argPackAdvance:8,readValueFromPointer:gt,destructorFunction:function(f){rt(f)}})};function Kn(t,e,r,n,a,o){Ft[t]={name:k(e),rawConstructor:q(r,n),rawDestructor:q(a,o),fields:[]}}function ta(t,e,r,n,a,o,i,s,f,l){Ft[t].fields.push({fieldName:k(e),getterReturnType:r,getter:q(n,a),getterContext:o,setterArgumentType:i,setter:q(s,f),setterContext:l})}function ea(t,e){e=k(e),tt(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:function(){},toWireType:function(r,n){}})}var ra={};function na(t){var e=ra[t];return e===void 0?k(t):e}function ze(){if(typeof globalThis=="object")return globalThis;function t(e){e.$$$embind_global$$$=e;var r=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")}function aa(t){return t===0?ot.toHandle(ze()):(t=na(t),ot.toHandle(ze()[t]))}function oa(t){t>4&&(G.get(t).refcount+=1)}function Le(t,e){var r=ut[t];return r===void 0&&_(e+" has unknown type "+Re(t)),r}function ia(t){var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var i=Le(F[n+o*4>>2],"parameter "+o);e[o+1]=i.readValueFromPointer(a),a+=i.argPackAdvance}var s=new(r.bind.apply(r,e));return ot.toHandle(s)}}var Ye={};function sa(t,e,r,n){t=ot.toValue(t);var a=Ye[e];return a||(a=ia(e),Ye[e]=a),a(t,r,n)}function ua(t,e){t=Le(t,"_emval_take_value");var r=t.readValueFromPointer(e);return ot.toHandle(r)}var ca=()=>{At("")},fa=(t,e,r)=>z.copyWithin(t,e,e+r),la=()=>2147483648,da=t=>{var e=Q.buffer,r=t-e.byteLength+65535>>>16;try{return Q.grow(r),ye(),1}catch{}},ha=t=>{var e=z.length;t>>>=0;var r=la();if(t>r)return!1;for(var n=(f,l)=>f+(l-f%l)%l,a=1;a<=4;a*=2){var o=e*(1+.2/a);o=Math.min(o,t+100663296);var i=Math.min(r,n(Math.max(t,o),65536)),s=da(i);if(s)return!0}return!1},Zt={},pa=()=>M||"./this.program",_t=()=>{if(!_t.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:pa()};for(var r in Zt)Zt[r]===void 0?delete e[r]:e[r]=Zt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);_t.strings=n}return _t.strings},ya=(t,e)=>{for(var r=0;r<t.length;++r)N[e++>>0]=t.charCodeAt(r);N[e>>0]=0},va=(t,e)=>{var r=0;return _t().forEach(function(n,a){var o=e+r;F[t+a*4>>2]=o,ya(n,o),r+=n.length+1}),0},ma=(t,e)=>{var r=_t();F[t>>2]=r.length;var n=0;return r.forEach(function(a){n+=a.length+1}),F[e>>2]=n,0};function ga(t){return t}var Wt=t=>t%4===0&&(t%100!==0||t%400===0),wa=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Ne=[31,29,31,30,31,30,31,31,30,31,30,31],Ge=[31,28,31,30,31,30,31,31,30,31,30,31],$a=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Wt(r.getFullYear()),a=r.getMonth(),o=(n?Ne:Ge)[a];if(e>o-r.getDate())e-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+e),r}return r};function ba(t,e,r){var n=r>0?r:Be(t)+1,a=new Array(n),o=ke(t,a,0,a.length);return e&&(a.length=o),a}var Ca=(t,e)=>{N.set(t,e)},_a=(t,e,r,n)=>{var a=I[n+40>>2],o={tm_sec:I[n>>2],tm_min:I[n+4>>2],tm_hour:I[n+8>>2],tm_mday:I[n+12>>2],tm_mon:I[n+16>>2],tm_year:I[n+20>>2],tm_wday:I[n+24>>2],tm_yday:I[n+28>>2],tm_isdst:I[n+32>>2],tm_gmtoff:I[n+36>>2],tm_zone:a?Jt(a):""},i=Jt(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var f in s)i=i.replace(new RegExp(f,"g"),s[f]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function y(d,p,S){for(var O=typeof d=="number"?d.toString():d||"";O.length<p;)O=S[0]+O;return O}function v(d,p){return y(d,p,"0")}function C(d,p){function S(ft){return ft<0?-1:ft>0?1:0}var O;return(O=S(d.getFullYear()-p.getFullYear()))===0&&(O=S(d.getMonth()-p.getMonth()))===0&&(O=S(d.getDate()-p.getDate())),O}function D(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function R(d){var p=$a(new Date(d.tm_year+1900,0,1),d.tm_yday),S=new Date(p.getFullYear(),0,4),O=new Date(p.getFullYear()+1,0,4),ft=D(S),kt=D(O);return C(ft,p)<=0?C(kt,p)<=0?p.getFullYear()+1:p.getFullYear():p.getFullYear()-1}var x={"%a":d=>l[d.tm_wday].substring(0,3),"%A":d=>l[d.tm_wday],"%b":d=>h[d.tm_mon].substring(0,3),"%B":d=>h[d.tm_mon],"%C":d=>{var p=d.tm_year+1900;return v(p/100|0,2)},"%d":d=>v(d.tm_mday,2),"%e":d=>y(d.tm_mday,2," "),"%g":d=>R(d).toString().substring(2),"%G":d=>R(d),"%H":d=>v(d.tm_hour,2),"%I":d=>{var p=d.tm_hour;return p==0?p=12:p>12&&(p-=12),v(p,2)},"%j":d=>v(d.tm_mday+wa(Wt(d.tm_year+1900)?Ne:Ge,d.tm_mon-1),3),"%m":d=>v(d.tm_mon+1,2),"%M":d=>v(d.tm_min,2),"%n":()=>`
3
- `,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>v(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var p=d.tm_yday+7-d.tm_wday;return v(Math.floor(p/7),2)},"%V":d=>{var p=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&p++,p){if(p==53){var S=(d.tm_wday+371-d.tm_yday)%7;S!=4&&(S!=3||!Wt(d.tm_year))&&(p=1)}}else{p=52;var O=(d.tm_wday+7-d.tm_yday-1)%7;(O==4||O==5&&Wt(d.tm_year%400-1))&&p++}return v(p,2)},"%w":d=>d.tm_wday,"%W":d=>{var p=d.tm_yday+7-(d.tm_wday+6)%7;return v(Math.floor(p/7),2)},"%y":d=>(d.tm_year+1900).toString().substring(2),"%Y":d=>d.tm_year+1900,"%z":d=>{var p=d.tm_gmtoff,S=p>=0;return p=Math.abs(p)/60,p=p/60*100+p%60,(S?"+":"-")+("0000"+p).slice(-4)},"%Z":d=>d.tm_zone,"%%":()=>"%"};i=i.replace(/%%/g,"\0\0");for(var f in x)i.includes(f)&&(i=i.replace(new RegExp(f,"g"),x[f](o)));i=i.replace(/\0\0/g,"%");var W=ba(i,!1);return W.length>e?0:(Ca(W,t),W.length-1)},Ta=(t,e,r,n,a)=>_a(t,e,r,n);Te=u.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Zr(),pt=u.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},yn(),sn(),Pn(),Ie=u.UnboundTypeError=xn(Error,"UnboundTypeError"),Mn(),In();var Pa={q:kr,u:Br,a:Vr,h:zr,l:Lr,I:Yr,P:Nr,n:Gr,ba:Xr,d:Ur,oa:qr,Y:Jr,fa:Kr,na:Sn,ma:Fn,D:On,ea:Rn,W:Hn,J:kn,w:Un,s:Vn,V:Yn,L:Qn,Q:Kn,pa:ta,ga:ea,U:He,la:aa,R:oa,ia:sa,ka:ua,K:ca,da:fa,ca:ha,$:va,aa:ma,H:La,T:Ka,B:Na,p:Ua,b:Ea,C:za,ha:Xa,c:Fa,j:Ma,i:xa,x:Ya,O:Va,v:ka,G:Ja,N:Za,A:Ga,F:to,Z:ro,X:no,k:Oa,f:Sa,e:Da,g:Aa,M:Qa,m:Ha,o:ja,S:Ia,t:Wa,ja:Ba,y:qa,r:Ra,E:eo,z:ga,_:Ta};Hr();var rt=u._free=t=>(rt=u._free=A.sa)(t),Qt=u._malloc=t=>(Qt=u._malloc=A.ta)(t),Xe=t=>(Xe=A.va)(t);u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=A.wa)();var w=(t,e)=>(w=A.xa)(t,e),Tt=t=>(Tt=A.ya)(t),$=()=>($=A.za)(),b=t=>(b=A.Aa)(t),qe=t=>(qe=A.Ba)(t),Je=t=>(Je=A.Ca)(t),Ze=(t,e,r)=>(Ze=A.Da)(t,e,r),Qe=t=>(Qe=A.Ea)(t);u.dynCall_viijii=(t,e,r,n,a,o,i)=>(u.dynCall_viijii=A.Fa)(t,e,r,n,a,o,i);var Ke=u.dynCall_jiii=(t,e,r,n)=>(Ke=u.dynCall_jiii=A.Ga)(t,e,r,n),tr=u.dynCall_jiiii=(t,e,r,n,a)=>(tr=u.dynCall_jiiii=A.Ha)(t,e,r,n,a);u.dynCall_iiiiij=(t,e,r,n,a,o,i)=>(u.dynCall_iiiiij=A.Ia)(t,e,r,n,a,o,i),u.dynCall_iiiiijj=(t,e,r,n,a,o,i,s,f)=>(u.dynCall_iiiiijj=A.Ja)(t,e,r,n,a,o,i,s,f),u.dynCall_iiiiiijj=(t,e,r,n,a,o,i,s,f,l)=>(u.dynCall_iiiiiijj=A.Ka)(t,e,r,n,a,o,i,s,f,l);function Ea(t,e){var r=$();try{return T(t)(e)}catch(n){if(b(r),n!==n+0)throw n;w(1,0)}}function Aa(t,e,r,n){var a=$();try{T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;w(1,0)}}function Da(t,e,r){var n=$();try{T(t)(e,r)}catch(a){if(b(n),a!==a+0)throw a;w(1,0)}}function xa(t,e,r,n,a){var o=$();try{return T(t)(e,r,n,a)}catch(i){if(b(o),i!==i+0)throw i;w(1,0)}}function Sa(t,e){var r=$();try{T(t)(e)}catch(n){if(b(r),n!==n+0)throw n;w(1,0)}}function Fa(t,e,r){var n=$();try{return T(t)(e,r)}catch(a){if(b(n),a!==a+0)throw a;w(1,0)}}function Oa(t){var e=$();try{T(t)()}catch(r){if(b(e),r!==r+0)throw r;w(1,0)}}function Ma(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;w(1,0)}}function ja(t,e,r,n,a,o){var i=$();try{T(t)(e,r,n,a,o)}catch(s){if(b(i),s!==s+0)throw s;w(1,0)}}function Ia(t,e,r,n,a,o,i){var s=$();try{T(t)(e,r,n,a,o,i)}catch(f){if(b(s),f!==f+0)throw f;w(1,0)}}function Ra(t,e,r,n,a,o,i,s,f,l,h){var y=$();try{T(t)(e,r,n,a,o,i,s,f,l,h)}catch(v){if(b(y),v!==v+0)throw v;w(1,0)}}function Wa(t,e,r,n,a,o,i,s){var f=$();try{T(t)(e,r,n,a,o,i,s)}catch(l){if(b(f),l!==l+0)throw l;w(1,0)}}function Ha(t,e,r,n,a){var o=$();try{T(t)(e,r,n,a)}catch(i){if(b(o),i!==i+0)throw i;w(1,0)}}function ka(t,e,r,n,a,o,i){var s=$();try{return T(t)(e,r,n,a,o,i)}catch(f){if(b(s),f!==f+0)throw f;w(1,0)}}function Ba(t,e,r,n,a,o,i,s,f){var l=$();try{T(t)(e,r,n,a,o,i,s,f)}catch(h){if(b(l),h!==h+0)throw h;w(1,0)}}function Ua(t){var e=$();try{return T(t)()}catch(r){if(b(e),r!==r+0)throw r;w(1,0)}}function Va(t,e,r,n,a,o,i){var s=$();try{return T(t)(e,r,n,a,o,i)}catch(f){if(b(s),f!==f+0)throw f;w(1,0)}}function za(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;w(1,0)}}function La(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;w(1,0)}}function Ya(t,e,r,n,a,o){var i=$();try{return T(t)(e,r,n,a,o)}catch(s){if(b(i),s!==s+0)throw s;w(1,0)}}function Na(t,e,r,n,a,o){var i=$();try{return T(t)(e,r,n,a,o)}catch(s){if(b(i),s!==s+0)throw s;w(1,0)}}function Ga(t,e,r,n,a,o,i,s,f,l){var h=$();try{return T(t)(e,r,n,a,o,i,s,f,l)}catch(y){if(b(h),y!==y+0)throw y;w(1,0)}}function Xa(t,e,r){var n=$();try{return T(t)(e,r)}catch(a){if(b(n),a!==a+0)throw a;w(1,0)}}function qa(t,e,r,n,a,o,i,s,f,l){var h=$();try{T(t)(e,r,n,a,o,i,s,f,l)}catch(y){if(b(h),y!==y+0)throw y;w(1,0)}}function Ja(t,e,r,n,a,o,i,s){var f=$();try{return T(t)(e,r,n,a,o,i,s)}catch(l){if(b(f),l!==l+0)throw l;w(1,0)}}function Za(t,e,r,n,a,o,i,s,f){var l=$();try{return T(t)(e,r,n,a,o,i,s,f)}catch(h){if(b(l),h!==h+0)throw h;w(1,0)}}function Qa(t,e,r,n,a,o,i){var s=$();try{T(t)(e,r,n,a,o,i)}catch(f){if(b(s),f!==f+0)throw f;w(1,0)}}function Ka(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;w(1,0)}}function to(t,e,r,n,a,o,i,s,f,l,h,y){var v=$();try{return T(t)(e,r,n,a,o,i,s,f,l,h,y)}catch(C){if(b(v),C!==C+0)throw C;w(1,0)}}function eo(t,e,r,n,a,o,i,s,f,l,h,y,v,C,D,R){var x=$();try{T(t)(e,r,n,a,o,i,s,f,l,h,y,v,C,D,R)}catch(W){if(b(x),W!==W+0)throw W;w(1,0)}}function ro(t,e,r,n){var a=$();try{return Ke(t,e,r,n)}catch(o){if(b(a),o!==o+0)throw o;w(1,0)}}function no(t,e,r,n,a){var o=$();try{return tr(t,e,r,n,a)}catch(i){if(b(o),i!==i+0)throw i;w(1,0)}}var Ht;mt=function t(){Ht||er(),Ht||(mt=t)};function er(){if(it>0||(Ar(),it>0))return;function t(){Ht||(Ht=!0,u.calledRun=!0,!Pt&&(Dr(),P(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),xr()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),t()},1)):t()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return er(),m.ready}})();function _r(c){return ue(le,c)}async function Tr(c,{tryHarder:m=nt.tryHarder,formats:u=nt.formats,maxSymbols:P=nt.maxSymbols}=nt){return $r(c,{tryHarder:m,formats:u,maxSymbols:P},le)}const de=new Map([["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["data_matrix","DataMatrix"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["pdf417","PDF417"],["qr_code","QRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"]]);function Pr(c){for(const[m,u]of de)if(c===u)return m;return"unknown"}class Er extends EventTarget{constructor(u={}){var P;super();ar(this,vt,void 0);try{const g=(P=u==null?void 0:u.formats)==null?void 0:P.filter(E=>E!=="unknown");if((g==null?void 0:g.length)===0)throw new TypeError("Hint option provided, but is empty.");g==null||g.forEach(E=>{if(!B.includes(E))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${E}' is not a valid enum value of type BarcodeFormat.`)}),or(this,vt,g??[]),_r().then(E=>{this.dispatchEvent(new CustomEvent("load",{detail:E}))}).catch(E=>{this.dispatchEvent(new CustomEvent("error",{detail:E}))})}catch(g){throw ie(g,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return B.filter(u=>u!=="unknown")}async detect(u){try{const P=await lr(u);if(P===null)return[];let g;try{g=await Tr(P,{tryHarder:!0,formats:nr(this,vt).map(E=>de.get(E))})}catch{throw new DOMException("Barcode detection service unavailable. Use 'setZXingModuleOverrides' in offline or strict CSP environments.","NotSupportedError")}return g.map(E=>{const{topLeft:{x:M,y:J},topRight:{x:U,y:j},bottomLeft:{x:X,y:Z},bottomRight:{x:Y,y:V}}=E.position,Q=Math.min(M,U,X,Y),A=Math.min(J,j,Z,V),Pt=Math.max(M,U,X,Y),N=Math.max(J,j,Z,V);return{boundingBox:new DOMRectReadOnly(Q,A,Pt-Q,N-A),rawValue:new TextDecoder().decode(E.bytes),format:Pr(E.format),cornerPoints:[{x:M,y:J},{x:U,y:j},{x:Y,y:V},{x:X,y:Z}]}})}catch(P){throw ie(P,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return vt=new WeakMap,globalThis.BarcodeDetector??(globalThis.BarcodeDetector=Er),H.setZXingModuleOverrides=wr,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"}),H}({});
1
+ var nr=(W,U,z)=>{if(!U.has(W))throw TypeError("Cannot "+z)};var ar=(W,U,z)=>(nr(W,U,"read from private field"),z?z.call(W):U.get(W)),or=(W,U,z)=>{if(U.has(W))throw TypeError("Cannot add the same private member more than once");U instanceof WeakSet?U.add(W):U.set(W,z)},ir=(W,U,z,yt)=>(nr(W,U,"write to private field"),yt?yt.call(W,z):U.set(W,z),z);var BarcodeDetectionAPI=function(W){var mt;"use strict";const U=["aztec","code_128","code_39","code_93","codabar","data_matrix","ean_13","ean_8","itf","pdf417","qr_code","upc_a","upc_e","unknown"];function z(c){if(yt(c))return{width:c.naturalWidth,height:c.naturalHeight};if(Kt(c))return{width:c.width.baseVal.value,height:c.height.baseVal.value};if(te(c))return{width:c.videoWidth,height:c.videoHeight};if(re(c))return{width:c.width,height:c.height};if(ae(c))return{width:c.displayWidth,height:c.displayHeight};if(ee(c))return{width:c.width,height:c.height};if(ne(c))return{width:c.width,height:c.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function yt(c){try{return c instanceof HTMLImageElement}catch{return!1}}function Kt(c){try{return c instanceof SVGImageElement}catch{return!1}}function te(c){try{return c instanceof HTMLVideoElement}catch{return!1}}function ee(c){try{return c instanceof HTMLCanvasElement}catch{return!1}}function re(c){try{return c instanceof ImageBitmap}catch{return!1}}function ne(c){try{return c instanceof OffscreenCanvas}catch{return!1}}function ae(c){try{return c instanceof VideoFrame}catch{return!1}}function sr(c){try{return c instanceof Blob}catch{return!1}}function ur(c){try{return c instanceof ImageData}catch{return!1}}function cr(c,m){try{const u=new OffscreenCanvas(c,m);if(u.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return u;throw void 0}catch{const u=document.createElement("canvas");return u.width=c,u.height=m,u}}async function oe(c){if(yt(c)&&!await hr(c))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Kt(c)&&!await pr(c))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(ae(c)&&yr(c))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(te(c)&&(c.readyState===0||c.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(re(c)&&vr(c))throw new DOMException("The image source is detached.","InvalidStateError");const{width:m,height:u}=z(c);if(m===0||u===0)return null;const w=cr(m,u).getContext("2d");w.drawImage(c,0,0);try{return w.getImageData(0,0,m,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function lr(c){let m;try{if(createImageBitmap)m=await createImageBitmap(c);else{m=new Image;let g="";try{g=URL.createObjectURL(c),m.src=g,await m.decode()}finally{URL.revokeObjectURL(g)}}}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await oe(m)}function dr(c){const{width:m,height:u}=c;if(m===0||u===0)return null;const g=c.getContext("2d");try{return g.getImageData(0,0,m,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function fr(c){if(sr(c))return await lr(c);if(ur(c)){if(mr(c))throw new DOMException("The image data has been detached.","InvalidStateError");return c}return ee(c)||ne(c)?dr(c):await oe(c)}async function hr(c){try{return await c.decode(),!0}catch{return!1}}async function pr(c){var m;try{return await((m=c.decode)==null?void 0:m.call(c)),!0}catch{return!1}}function yr(c){return c.format===null}function mr(c){return c.data.buffer.byteLength===0}function vr(c){return c.width===0&&c.height===0}function ie(c,m){return c instanceof DOMException?new DOMException(`${m}: ${c.message}`,c.name):c instanceof Error?new c.constructor(`${m}: ${c.message}`):new Error(`${m}: ${c}`)}const se=c=>{let m;const u=new Set,g=(M,X)=>{const V=typeof M=="function"?M(m):M;if(!Object.is(V,m)){const j=m;m=X??typeof V!="object"?V:Object.assign({},m,V),u.forEach(q=>q(m,j))}},w=()=>m,E={setState:g,getState:w,subscribe:M=>(u.add(M),()=>u.delete(M)),destroy:()=>{u.clear()}};return m=c(g,w,E),E},gr=c=>c?se(c):se,wr={locateFile:(c,m)=>{var u;const g=(u=c.match(/_(.+?)\.wasm$/))==null?void 0:u[1];return g?`https://cdn.jsdelivr.net/npm/@sec-ant/zxing-wasm@2.1.4/dist/${g}/${c}`:m+c}},ft=gr()(()=>({zxingModuleWeakMap:new WeakMap,zxingModuleOverrides:wr}));function $r(c){ft.setState({zxingModuleOverrides:c})}function ue(c,m=ft.getState().zxingModuleOverrides){const{zxingModuleWeakMap:u}=ft.getState(),g=u.get(c);if(g&&Object.is(m,ft.getState().zxingModuleOverrides))return g;{ft.setState({zxingModuleOverrides:m});const w=c(m);return u.set(c,w),w}}const ce=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","UPC-A","UPC-E"],at={tryHarder:!0,formats:[],maxSymbols:255};async function br(c,{tryHarder:m=at.tryHarder,formats:u=at.formats,maxSymbols:g=at.maxSymbols}=at,w){const E=await ue(w,ft.getState().zxingModuleOverrides),{data:M,width:X,height:V,data:{byteLength:j}}=c,q=E._malloc(j);E.HEAP8.set(M,q);const Q=E.readBarcodesFromPixmap(q,X,V,m,Cr(u),g);E._free(q);const Y=[];for(let L=0;L<Q.size();++L){const J=Q.get(L);Y.push({...J,format:_r(J.format)})}return Y}function Cr(c){return c.join("|")}function _r(c){const m=le(c);let u=0,g=ce.length-1;for(;u<=g;){const w=Math.floor((u+g)/2),E=ce[w],M=le(E);if(M===m)return E;M<m?u=w+1:g=w-1}return"None"}function le(c){return c.toLowerCase().replace(/_-\[\]/g,"")}var de=(()=>{var c=document.currentScript&&document.currentScript.src||new URL("side-effects.js",document.baseURI).href;return function(m={}){var u=m,g,w;u.ready=new Promise((t,e)=>{g=t,w=e});var E=Object.assign({},u),M="./this.program",X=typeof window=="object",V=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var j="";function q(t){return u.locateFile?u.locateFile(t,j):j+t}var Q;(X||V)&&(V?j=self.location.href:typeof document<"u"&&document.currentScript&&(j=document.currentScript.src),c&&(j=c),j.indexOf("blob:")!==0?j=j.substr(0,j.replace(/[?#].*/,"").lastIndexOf("/")+1):j="",V&&(Q=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),u.print||console.log.bind(console);var Y=u.printErr||console.error.bind(console);Object.assign(u,E),E=null,u.arguments&&u.arguments,u.thisProgram&&(M=u.thisProgram),u.quit&&u.quit;var L;u.wasmBinary&&(L=u.wasmBinary),u.noExitRuntime,typeof WebAssembly!="object"&&Dt("no native wasm support detected");var J,vt=!1,N,H,gt,Et,k,x,he,pe;function ye(){var t=J.buffer;u.HEAP8=N=new Int8Array(t),u.HEAP16=gt=new Int16Array(t),u.HEAPU8=H=new Uint8Array(t),u.HEAPU16=Et=new Uint16Array(t),u.HEAP32=k=new Int32Array(t),u.HEAPU32=x=new Uint32Array(t),u.HEAPF32=he=new Float32Array(t),u.HEAPF64=pe=new Float64Array(t)}var me,ve=[],ge=[],we=[];function Ar(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Or(u.preRun.shift());Bt(ve)}function xr(){Bt(ge)}function Sr(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Mr(u.postRun.shift());Bt(we)}function Or(t){ve.unshift(t)}function Fr(t){ge.unshift(t)}function Mr(t){we.unshift(t)}var st=0,wt=null;function jr(t){st++,u.monitorRunDependencies&&u.monitorRunDependencies(st)}function Rr(t){if(st--,u.monitorRunDependencies&&u.monitorRunDependencies(st),st==0&&wt){var e=wt;wt=null,e()}}function Dt(t){u.onAbort&&u.onAbort(t),t="Aborted("+t+")",Y(t),vt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw w(e),e}var Ir="data:application/octet-stream;base64,";function $e(t){return t.startsWith(Ir)}var ut;u.locateFile?(ut="zxing_reader.wasm",$e(ut)||(ut=q(ut))):ut=new URL("/reader/zxing_reader.wasm",self.location).href;function be(t){if(t==ut&&L)return new Uint8Array(L);if(Q)return Q(t);throw"both async and sync fetching of the wasm failed"}function Wr(t){return!L&&(X||V)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>be(t)):Promise.resolve().then(()=>be(t))}function Ce(t,e,r){return Wr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{Y(`failed to asynchronously prepare wasm: ${n}`),Dt(n)})}function Hr(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!$e(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(i){return Y(`wasm streaming compile failed: ${i}`),Y("falling back to ArrayBuffer instantiation"),Ce(e,r,n)})}):Ce(e,r,n)}function kr(){var t={a:Ea};function e(n,a){var o=n.exports;return S=o,J=S.qa,ye(),me=S.ua,Fr(S.ra),Rr(),o}jr();function r(n){e(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(t,e)}catch(n){Y(`Module.instantiateWasm callback failed with error: ${n}`),w(n)}return Hr(L,ut,t,r).catch(w),{}}var Bt=t=>{for(;t.length>0;)t.shift()(u)},At=[],xt=0,Br=t=>{var e=new St(t);return e.get_caught()||(e.set_caught(!0),xt--),e.set_rethrown(!1),At.push(e),Qe(e.excPtr),e.get_exception_ptr()},K=0,Ur=()=>{$(0,0);var t=At.pop();Ze(t.excPtr),K=0};function St(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){x[this.ptr+4>>2]=e},this.get_type=function(){return x[this.ptr+4>>2]},this.set_destructor=function(e){x[this.ptr+8>>2]=e},this.get_destructor=function(){return x[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,N[this.ptr+12>>0]=e},this.get_caught=function(){return N[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,N[this.ptr+13>>0]=e},this.get_rethrown=function(){return N[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){x[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return x[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=Ke(this.get_type());if(e)return x[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var Vr=t=>{throw K||(K=t),K},Ut=t=>{var e=K;if(!e)return Pt(0),0;var r=new St(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return Pt(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var i=r.ptr+16;if(Je(o,n,i))return Pt(o),e}return Pt(n),e},Lr=()=>Ut([]),zr=t=>Ut([t]),Yr=(t,e)=>Ut([t,e]),Nr=t=>{var e=new St(t).get_exception_ptr();return e},Gr=()=>{var t=At.pop();t||Dt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(At.push(t),t.set_rethrown(!0),t.set_caught(!1),xt++),K=e,K},Xr=(t,e,r)=>{var n=new St(t);throw n.init(e,r),K=t,xt++,K},qr=()=>xt,Ot={},_e=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function Vt(t){return this.fromWireType(k[t>>2])}var ht={},ct={},Ft={},Te=void 0,Mt=t=>{throw new Te(t)},lt=(t,e,r)=>{t.forEach(function(s){Ft[s]=e});function n(s){var l=r(s);l.length!==t.length&&Mt("Mismatched type converter count");for(var d=0;d<t.length;++d)tt(t[d],l[d])}var a=new Array(e.length),o=[],i=0;e.forEach((s,l)=>{ct.hasOwnProperty(s)?a[l]=ct[s]:(o.push(s),ht.hasOwnProperty(s)||(ht[s]=[]),ht[s].push(()=>{a[l]=ct[s],++i,i===o.length&&n(a)}))}),o.length===0&&n(a)},Zr=t=>{var e=Ot[t];delete Ot[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(i=>i.getterReturnType).concat(a.map(i=>i.setterArgumentType));lt([t],o,i=>{var s={};return a.forEach((l,d)=>{var h=l.fieldName,y=i[d],v=l.getter,_=l.getterContext,D=i[d+a.length],R=l.setter,A=l.setterContext;s[h]={read:I=>y.fromWireType(v(_,I)),write:(I,f)=>{var p=[];R(A,I,D.toWireType(p,f)),_e(p)}}}),[{name:e.name,fromWireType:l=>{var d={};for(var h in s)d[h]=s[h].read(l);return n(l),d},toWireType:(l,d)=>{for(var h in s)if(!(h in d))throw new TypeError(`Missing field: "${h}"`);var y=r();for(h in s)s[h].write(y,d[h]);return l!==null&&l.push(n,y),y},argPackAdvance:et,readValueFromPointer:Vt,destructorFunction:n}]})},Qr=(t,e,r,n,a)=>{},Jr=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);Pe=t},Pe=void 0,B=t=>{for(var e="",r=t;H[r];)e+=Pe[H[r++]];return e},pt=void 0,T=t=>{throw new pt(t)};function Kr(t,e,r={}){var n=e.name;if(t||T(`type "${n}" must have a positive integer typeid pointer`),ct.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(ct[t]=e,delete Ft[t],ht.hasOwnProperty(t)){var a=ht[t];delete ht[t],a.forEach(o=>o())}}function tt(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Kr(t,e,r)}var et=8,tn=(t,e,r,n)=>{e=B(e),tt(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:et,readValueFromPointer:function(a){return this.fromWireType(H[a])},destructorFunction:null})};function en(t){if(!(this instanceof ot)||!(t instanceof ot))return!1;for(var e=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a}var rn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Lt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}T(e(t)+" instance already deleted")},zt=!1,Ee=t=>{},nn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},De=t=>{t.count.value-=1;var e=t.count.value===0;e&&nn(t)},Ae=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=Ae(t,e,r.baseClass);return n===null?null:r.downcast(n)},xe={},an=()=>Object.keys(Ct).length,on=()=>{var t=[];for(var e in Ct)Ct.hasOwnProperty(e)&&t.push(Ct[e]);return t},$t=[],Yt=()=>{for(;$t.length;){var t=$t.pop();t.$$.deleteScheduled=!1,t.delete()}},bt=void 0,sn=t=>{bt=t,$t.length&&bt&&bt(Yt)},un=()=>{u.getInheritedInstanceCount=an,u.getLiveInheritedInstances=on,u.flushPendingDeletes=Yt,u.setDelayFunction=sn},Ct={},cn=(t,e)=>{for(e===void 0&&T("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},ln=(t,e)=>(e=cn(t,e),Ct[e]),jt=(t,e)=>{(!e.ptrType||!e.ptr)&&Mt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&Mt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},_t(Object.create(t,{$$:{value:e}}))};function dn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=ln(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?jt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):jt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),i=xe[o];if(!i)return a.call(this);var s;this.isConst?s=i.constPointerType:s=i.pointerType;var l=Ae(e,this.registeredClass,s.registeredClass);return l===null?a.call(this):this.isSmartPointer?jt(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:t}):jt(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}var _t=t=>typeof FinalizationRegistry>"u"?(_t=e=>e,t):(zt=new FinalizationRegistry(e=>{De(e.$$)}),_t=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};zt.register(e,a,e)}return e},Ee=e=>zt.unregister(e),_t(t));function fn(){if(this.$$.ptr||Lt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=_t(Object.create(Object.getPrototypeOf(this),{$$:{value:rn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function hn(){this.$$.ptr||Lt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),Ee(this),De(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function pn(){return!this.$$.ptr}function yn(){return this.$$.ptr||Lt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),$t.push(this),$t.length===1&&bt&&bt(Yt),this.$$.deleteScheduled=!0,this}var mn=()=>{ot.prototype.isAliasOf=en,ot.prototype.clone=fn,ot.prototype.delete=hn,ot.prototype.isDeleted=pn,ot.prototype.deleteLater=yn};function ot(){}var vn=48,gn=57,Se=t=>{if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=vn&&e<=gn?`_${t}`:t};function Oe(t,e){return t=Se(t),{[t]:function(){return e.apply(this,arguments)}}[t]}var Fe=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||T(`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}},Me=(t,e,r)=>{u.hasOwnProperty(t)?((r===void 0||u[t].overloadTable!==void 0&&u[t].overloadTable[r]!==void 0)&&T(`Cannot register public name '${t}' twice`),Fe(u,t,t),u.hasOwnProperty(r)&&T(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),u[t].overloadTable[r]=e):(u[t]=e,r!==void 0&&(u[t].numArguments=r))};function wn(t,e,r,n,a,o,i,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var Nt=(t,e,r)=>{for(;e!==r;)e.upcast||T(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function $n(t,e){if(e===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;e.$$||T(`Cannot pass "${qt(e)}" as a ${this.name}`),e.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Nt(e.$$.ptr,r,this.registeredClass);return n}function bn(t,e){var r;if(e===null)return this.isReference&&T(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;e.$$||T(`Cannot pass "${qt(e)}" as a ${this.name}`),e.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&T(`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=Nt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&T("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:T(`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 a=e.clone();r=this.rawShare(r,it.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:T("Unsupporting sharing policy")}return r}function Cn(t,e){if(e===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;e.$$||T(`Cannot pass "${qt(e)}" as a ${this.name}`),e.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&T(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Nt(e.$$.ptr,r,this.registeredClass);return n}function je(t){return this.fromWireType(x[t>>2])}function _n(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function Tn(t){this.rawDestructor&&this.rawDestructor(t)}var Pn=t=>{t!==null&&t.delete()},En=()=>{rt.prototype.getPointee=_n,rt.prototype.destructor=Tn,rt.prototype.argPackAdvance=et,rt.prototype.readValueFromPointer=je,rt.prototype.deleteObject=Pn,rt.prototype.fromWireType=dn};function rt(t,e,r,n,a,o,i,s,l,d,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=d,this.rawDestructor=h,!a&&e.baseClass===void 0?n?(this.toWireType=$n,this.destructorFunction=null):(this.toWireType=Cn,this.destructorFunction=null):this.toWireType=bn}var Re=(t,e,r)=>{u.hasOwnProperty(t)||Mt("Replacing nonexistant public symbol"),u[t].overloadTable!==void 0&&r!==void 0?u[t].overloadTable[r]=e:(u[t]=e,u[t].argCount=r)},Dn=(t,e,r)=>{var n=u["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},Rt=[],P=t=>{var e=Rt[t];return e||(t>=Rt.length&&(Rt.length=t+1),Rt[t]=e=me.get(t)),e},An=(t,e,r)=>{if(t.includes("j"))return Dn(t,e,r);var n=P(e).apply(null,r);return n},xn=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),An(t,e,r)}},Z=(t,e)=>{t=B(t);function r(){return t.includes("j")?xn(t,e):P(e)}var n=r();return typeof n!="function"&&T(`unknown function pointer with signature ${t}: ${e}`),n},Sn=(t,e)=>{var r=Oe(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
2
+ `+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},Ie=void 0,We=t=>{var e=qe(t),r=B(e);return nt(e),r},It=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!ct[o]){if(Ft[o]){Ft[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Ie(`${t}: `+r.map(We).join([", "]))},On=(t,e,r,n,a,o,i,s,l,d,h,y,v)=>{h=B(h),o=Z(a,o),s&&(s=Z(i,s)),d&&(d=Z(l,d)),v=Z(y,v);var _=Se(h);Me(_,function(){It(`Cannot construct ${h} due to unbound types`,[n])}),lt([t,e,r],n?[n]:[],function(D){D=D[0];var R,A;n?(R=D.registeredClass,A=R.instancePrototype):A=ot.prototype;var I=Oe(_,function(){if(Object.getPrototypeOf(this)!==f)throw new pt("Use 'new' to construct "+h);if(p.constructor_body===void 0)throw new pt(h+" has no accessible constructor");var kt=p.constructor_body[arguments.length];if(kt===void 0)throw new pt(`Tried to invoke ctor of ${h} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(p.constructor_body).toString()}) parameters instead!`);return kt.apply(this,arguments)}),f=Object.create(A,{constructor:{value:I}});I.prototype=f;var p=new wn(h,I,f,v,R,o,s,d);p.baseClass&&(p.baseClass.__derivedClasses===void 0&&(p.baseClass.__derivedClasses=[]),p.baseClass.__derivedClasses.push(p));var O=new rt(h,p,!0,!1,!1),F=new rt(h+"*",p,!1,!1,!1),dt=new rt(h+" const*",p,!1,!0,!1);return xe[t]={pointerType:F,constPointerType:dt},Re(_,I),[O,F,dt]})},Gt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(x[e+n*4>>2]);return r};function Xt(t,e,r,n,a,o){var i=e.length;i<2&&T("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=e[1]!==null&&r!==null,l=!1,d=1;d<e.length;++d)if(e[d]!==null&&e[d].destructorFunction===void 0){l=!0;break}var h=e[0].name!=="void",y=i-2,v=new Array(y),_=[],D=[];return function(){arguments.length!==y&&T(`function ${t} called with ${arguments.length} arguments, expected ${y}`),D.length=0;var R;_.length=s?2:1,_[0]=a,s&&(R=e[1].toWireType(D,this),_[1]=R);for(var A=0;A<y;++A)v[A]=e[A+2].toWireType(D,arguments[A]),_.push(v[A]);var I=n.apply(null,_);function f(p){if(l)_e(D);else for(var O=s?1:2;O<e.length;O++){var F=O===1?R:v[O-2];e[O].destructorFunction!==null&&e[O].destructorFunction(F)}if(h)return e[0].fromWireType(p)}return f(I)}}var Fn=(t,e,r,n,a,o)=>{var i=Gt(e,r);a=Z(n,a),lt([],[t],function(s){s=s[0];var l=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[e-1]!==void 0)throw new pt(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[e-1]=()=>{It(`Cannot construct ${s.name} due to unbound types`,i)},lt([],i,d=>(d.splice(1,0,null),s.registeredClass.constructor_body[e-1]=Xt(l,d,null,a,o),[])),[]})},Mn=(t,e,r,n,a,o,i,s,l)=>{var d=Gt(r,n);e=B(e),o=Z(a,o),lt([],[t],function(h){h=h[0];var y=`${h.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&h.registeredClass.pureVirtualFunctions.push(e);function v(){It(`Cannot call ${y} due to unbound types`,d)}var _=h.registeredClass.instancePrototype,D=_[e];return D===void 0||D.overloadTable===void 0&&D.className!==h.name&&D.argCount===r-2?(v.argCount=r-2,v.className=h.name,_[e]=v):(Fe(_,e,y),_[e].overloadTable[r-2]=v),lt([],d,function(R){var A=Xt(y,R,h,o,i);return _[e].overloadTable===void 0?(A.argCount=r-2,_[e]=A):_[e].overloadTable[r-2]=A,[]}),[]})};function jn(){Object.assign(He.prototype,{get(t){return this.allocated[t]},has(t){return this.allocated[t]!==void 0},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}})}function He(){this.allocated=[void 0],this.freelist=[]}var G=new He,ke=t=>{t>=G.reserved&&--G.get(t).refcount===0&&G.free(t)},Rn=()=>{for(var t=0,e=G.reserved;e<G.allocated.length;++e)G.allocated[e]!==void 0&&++t;return t},In=()=>{G.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),G.reserved=G.allocated.length,u.count_emval_handles=Rn},it={toValue:t=>(t||T("Cannot use deleted val. handle = "+t),G.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return G.allocate({refcount:1,value:t})}}},Wn=(t,e)=>{e=B(e),tt(t,{name:e,fromWireType:r=>{var n=it.toValue(r);return ke(r),n},toWireType:(r,n)=>it.toHandle(n),argPackAdvance:et,readValueFromPointer:Vt,destructorFunction:null})},qt=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},Hn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(he[r>>2])};case 8:return function(r){return this.fromWireType(pe[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},kn=(t,e,r)=>{e=B(e),tt(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:et,readValueFromPointer:Hn(e,r),destructorFunction:null})},Bn=(t,e,r,n,a,o,i)=>{var s=Gt(e,r);t=B(t),a=Z(n,a),Me(t,function(){It(`Cannot call ${t} due to unbound types`,s)},e-1),lt([],s,function(l){var d=[l[0],null].concat(l.slice(1));return Re(t,Xt(t,d,null,a,o),e-1),[]})},Un=(t,e,r)=>{switch(e){case 1:return r?n=>N[n>>0]:n=>H[n>>0];case 2:return r?n=>gt[n>>1]:n=>Et[n>>1];case 4:return r?n=>k[n>>2]:n=>x[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Vn=(t,e,r,n,a)=>{e=B(e);var o=h=>h;if(n===0){var i=32-8*r;o=h=>h<<i>>>i}var s=e.includes("unsigned"),l=(h,y)=>{},d;s?d=function(h,y){return l(y,this.name),y>>>0}:d=function(h,y){return l(y,this.name),y},tt(t,{name:e,fromWireType:o,toWireType:d,argPackAdvance:et,readValueFromPointer:Un(e,r,n!==0),destructorFunction:null})},Ln=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(i){var s=x[i>>2],l=x[i+4>>2];return new a(N.buffer,l,s)}r=B(r),tt(t,{name:r,fromWireType:o,argPackAdvance:et,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Be=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,i=0;i<t.length;++i){var s=t.charCodeAt(i);if(s>=55296&&s<=57343){var l=t.charCodeAt(++i);s=65536+((s&1023)<<10)|l&1023}if(s<=127){if(r>=o)break;e[r++]=s}else if(s<=2047){if(r+1>=o)break;e[r++]=192|s>>6,e[r++]=128|s&63}else if(s<=65535){if(r+2>=o)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|s&63}else{if(r+3>=o)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|s&63}}return e[r]=0,r-a},zn=(t,e,r)=>Be(t,H,e,r),Ue=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},Ve=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Yn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&Ve)return Ve.decode(t.subarray(e,a));for(var o="";e<a;){var i=t[e++];if(!(i&128)){o+=String.fromCharCode(i);continue}var s=t[e++]&63;if((i&224)==192){o+=String.fromCharCode((i&31)<<6|s);continue}var l=t[e++]&63;if((i&240)==224?i=(i&15)<<12|s<<6|l:i=(i&7)<<18|s<<12|l<<6|t[e++]&63,i<65536)o+=String.fromCharCode(i);else{var d=i-65536;o+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return o},Zt=(t,e)=>t?Yn(H,t,e):"",Nn=(t,e)=>{e=B(e);var r=e==="std::string";tt(t,{name:e,fromWireType:n=>{var a=x[n>>2],o=n+4,i;if(r)for(var s=o,l=0;l<=a;++l){var d=o+l;if(l==a||H[d]==0){var h=d-s,y=Zt(s,h);i===void 0?i=y:(i+=String.fromCharCode(0),i+=y),s=d+1}}else{for(var v=new Array(a),l=0;l<a;++l)v[l]=String.fromCharCode(H[o+l]);i=v.join("")}return nt(n),i},toWireType:(n,a)=>{a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,i=typeof a=="string";i||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||T("Cannot pass non-string to std::string"),r&&i?o=Ue(a):o=a.length;var s=Jt(4+o+1),l=s+4;if(x[s>>2]=o,r&&i)zn(a,l,o+1);else if(i)for(var d=0;d<o;++d){var h=a.charCodeAt(d);h>255&&(nt(l),T("String has UTF-16 code units that do not fit in 8 bits")),H[l+d]=h}else for(var d=0;d<o;++d)H[l+d]=a[d];return n!==null&&n.push(nt,s),s},argPackAdvance:et,readValueFromPointer:je,destructorFunction:n=>nt(n)})},Le=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Gn=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&Et[n];)++n;if(r=n<<1,r-t>32&&Le)return Le.decode(H.subarray(t,r));for(var o="",i=0;!(i>=e/2);++i){var s=gt[t+i*2>>1];if(s==0)break;o+=String.fromCharCode(s)}return o},Xn=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<2)return 0;r-=2;for(var n=e,a=r<t.length*2?r/2:t.length,o=0;o<a;++o){var i=t.charCodeAt(o);gt[e>>1]=i,e+=2}return gt[e>>1]=0,e-n},qn=t=>t.length*2,Zn=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=k[t+r*4>>2];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},Qn=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,o=0;o<t.length;++o){var i=t.charCodeAt(o);if(i>=55296&&i<=57343){var s=t.charCodeAt(++o);i=65536+((i&1023)<<10)|s&1023}if(k[e>>2]=i,e+=4,e+4>a)break}return k[e>>2]=0,e-n},Jn=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},Kn=(t,e,r)=>{r=B(r);var n,a,o,i,s;e===2?(n=Gn,a=Xn,i=qn,o=()=>Et,s=1):e===4&&(n=Zn,a=Qn,i=Jn,o=()=>x,s=2),tt(t,{name:r,fromWireType:l=>{for(var d=x[l>>2],h=o(),y,v=l+4,_=0;_<=d;++_){var D=l+4+_*e;if(_==d||h[D>>s]==0){var R=D-v,A=n(v,R);y===void 0?y=A:(y+=String.fromCharCode(0),y+=A),v=D+e}}return nt(l),y},toWireType:(l,d)=>{typeof d!="string"&&T(`Cannot pass non-string to C++ string type ${r}`);var h=i(d),y=Jt(4+h+e);return x[y>>2]=h>>s,a(d,y+4,h+e),l!==null&&l.push(nt,y),y},argPackAdvance:et,readValueFromPointer:Vt,destructorFunction:l=>nt(l)})},ta=(t,e,r,n,a,o)=>{Ot[t]={name:B(e),rawConstructor:Z(r,n),rawDestructor:Z(a,o),fields:[]}},ea=(t,e,r,n,a,o,i,s,l,d)=>{Ot[t].fields.push({fieldName:B(e),getterReturnType:r,getter:Z(n,a),getterContext:o,setterArgumentType:i,setter:Z(s,l),setterContext:d})},ra=(t,e)=>{e=B(e),tt(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},na={},aa=t=>{var e=na[t];return e===void 0?B(t):e},ze=()=>{if(typeof globalThis=="object")return globalThis;function t(e){e.$$$embind_global$$$=e;var r=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},oa=t=>t===0?it.toHandle(ze()):(t=aa(t),it.toHandle(ze()[t])),ia=t=>{t>4&&(G.get(t).refcount+=1)},Ye=(t,e)=>{var r=ct[t];return r===void 0&&T(e+" has unknown type "+We(t)),r},sa=t=>{var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var i=Ye(x[n+o*4>>2],"parameter "+o);e[o+1]=i.readValueFromPointer(a),a+=i.argPackAdvance}var s=new(r.bind.apply(r,e));return it.toHandle(s)}},Ne={},ua=(t,e,r,n)=>{t=it.toValue(t);var a=Ne[e];return a||(a=sa(e),Ne[e]=a),a(t,r,n)},ca=(t,e)=>{t=Ye(t,"_emval_take_value");var r=t.readValueFromPointer(e);return it.toHandle(r)},la=()=>{Dt("")},da=(t,e,r)=>H.copyWithin(t,e,e+r),fa=()=>2147483648,ha=t=>{var e=J.buffer,r=(t-e.byteLength+65535)/65536;try{return J.grow(r),ye(),1}catch{}},pa=t=>{var e=H.length;t>>>=0;var r=fa();if(t>r)return!1;for(var n=(l,d)=>l+(d-l%d)%d,a=1;a<=4;a*=2){var o=e*(1+.2/a);o=Math.min(o,t+100663296);var i=Math.min(r,n(Math.max(t,o),65536)),s=ha(i);if(s)return!0}return!1},Qt={},ya=()=>M||"./this.program",Tt=()=>{if(!Tt.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:ya()};for(var r in Qt)Qt[r]===void 0?delete e[r]:e[r]=Qt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);Tt.strings=n}return Tt.strings},ma=(t,e)=>{for(var r=0;r<t.length;++r)N[e++>>0]=t.charCodeAt(r);N[e>>0]=0},va=(t,e)=>{var r=0;return Tt().forEach((n,a)=>{var o=e+r;x[t+a*4>>2]=o,ma(n,o),r+=n.length+1}),0},ga=(t,e)=>{var r=Tt();x[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),x[e>>2]=n,0},wa=t=>t,Wt=t=>t%4===0&&(t%100!==0||t%400===0),$a=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Ge=[31,29,31,30,31,30,31,31,30,31,30,31],Xe=[31,28,31,30,31,30,31,31,30,31,30,31],ba=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Wt(r.getFullYear()),a=r.getMonth(),o=(n?Ge:Xe)[a];if(e>o-r.getDate())e-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+e),r}return r};function Ca(t,e,r){var n=r>0?r:Ue(t)+1,a=new Array(n),o=Be(t,a,0,a.length);return e&&(a.length=o),a}var _a=(t,e)=>{N.set(t,e)},Ta=(t,e,r,n)=>{var a=x[n+40>>2],o={tm_sec:k[n>>2],tm_min:k[n+4>>2],tm_hour:k[n+8>>2],tm_mday:k[n+12>>2],tm_mon:k[n+16>>2],tm_year:k[n+20>>2],tm_wday:k[n+24>>2],tm_yday:k[n+28>>2],tm_isdst:k[n+32>>2],tm_gmtoff:k[n+36>>2],tm_zone:a?Zt(a):""},i=Zt(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in s)i=i.replace(new RegExp(l,"g"),s[l]);var d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function y(f,p,O){for(var F=typeof f=="number"?f.toString():f||"";F.length<p;)F=O[0]+F;return F}function v(f,p){return y(f,p,"0")}function _(f,p){function O(dt){return dt<0?-1:dt>0?1:0}var F;return(F=O(f.getFullYear()-p.getFullYear()))===0&&(F=O(f.getMonth()-p.getMonth()))===0&&(F=O(f.getDate()-p.getDate())),F}function D(f){switch(f.getDay()){case 0:return new Date(f.getFullYear()-1,11,29);case 1:return f;case 2:return new Date(f.getFullYear(),0,3);case 3:return new Date(f.getFullYear(),0,2);case 4:return new Date(f.getFullYear(),0,1);case 5:return new Date(f.getFullYear()-1,11,31);case 6:return new Date(f.getFullYear()-1,11,30)}}function R(f){var p=ba(new Date(f.tm_year+1900,0,1),f.tm_yday),O=new Date(p.getFullYear(),0,4),F=new Date(p.getFullYear()+1,0,4),dt=D(O),kt=D(F);return _(dt,p)<=0?_(kt,p)<=0?p.getFullYear()+1:p.getFullYear():p.getFullYear()-1}var A={"%a":f=>d[f.tm_wday].substring(0,3),"%A":f=>d[f.tm_wday],"%b":f=>h[f.tm_mon].substring(0,3),"%B":f=>h[f.tm_mon],"%C":f=>{var p=f.tm_year+1900;return v(p/100|0,2)},"%d":f=>v(f.tm_mday,2),"%e":f=>y(f.tm_mday,2," "),"%g":f=>R(f).toString().substring(2),"%G":f=>R(f),"%H":f=>v(f.tm_hour,2),"%I":f=>{var p=f.tm_hour;return p==0?p=12:p>12&&(p-=12),v(p,2)},"%j":f=>v(f.tm_mday+$a(Wt(f.tm_year+1900)?Ge:Xe,f.tm_mon-1),3),"%m":f=>v(f.tm_mon+1,2),"%M":f=>v(f.tm_min,2),"%n":()=>`
3
+ `,"%p":f=>f.tm_hour>=0&&f.tm_hour<12?"AM":"PM","%S":f=>v(f.tm_sec,2),"%t":()=>" ","%u":f=>f.tm_wday||7,"%U":f=>{var p=f.tm_yday+7-f.tm_wday;return v(Math.floor(p/7),2)},"%V":f=>{var p=Math.floor((f.tm_yday+7-(f.tm_wday+6)%7)/7);if((f.tm_wday+371-f.tm_yday-2)%7<=2&&p++,p){if(p==53){var O=(f.tm_wday+371-f.tm_yday)%7;O!=4&&(O!=3||!Wt(f.tm_year))&&(p=1)}}else{p=52;var F=(f.tm_wday+7-f.tm_yday-1)%7;(F==4||F==5&&Wt(f.tm_year%400-1))&&p++}return v(p,2)},"%w":f=>f.tm_wday,"%W":f=>{var p=f.tm_yday+7-(f.tm_wday+6)%7;return v(Math.floor(p/7),2)},"%y":f=>(f.tm_year+1900).toString().substring(2),"%Y":f=>f.tm_year+1900,"%z":f=>{var p=f.tm_gmtoff,O=p>=0;return p=Math.abs(p)/60,p=p/60*100+p%60,(O?"+":"-")+("0000"+p).slice(-4)},"%Z":f=>f.tm_zone,"%%":()=>"%"};i=i.replace(/%%/g,"\0\0");for(var l in A)i.includes(l)&&(i=i.replace(new RegExp(l,"g"),A[l](o)));i=i.replace(/\0\0/g,"%");var I=Ca(i,!1);return I.length>e?0:(_a(I,t),I.length-1)},Pa=(t,e,r,n,a)=>Ta(t,e,r,n);Te=u.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Jr(),pt=u.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},mn(),un(),En(),Ie=u.UnboundTypeError=Sn(Error,"UnboundTypeError"),jn(),In();var Ea={q:Br,u:Ur,a:Lr,h:zr,l:Yr,I:Nr,P:Gr,n:Xr,ba:qr,d:Vr,oa:Zr,Y:Qr,fa:tn,na:On,ma:Fn,D:Mn,ea:Wn,W:kn,J:Bn,w:Vn,s:Ln,V:Nn,L:Kn,Q:ta,pa:ea,ga:ra,U:ke,la:oa,R:ia,ia:ua,ka:ca,K:la,da,ca:pa,$:va,aa:ga,H:Ya,T:to,B:Ga,p:Va,b:Da,C:za,ha:qa,c:Fa,j:ja,i:Sa,x:Na,O:La,v:Ba,G:Qa,N:Ja,A:Xa,F:eo,Z:no,X:ao,k:Ma,f:Oa,e:xa,g:Aa,M:Ka,m:ka,o:Ra,S:Ia,t:Ha,ja:Ua,y:Za,r:Wa,E:ro,z:wa,_:Pa},S=kr(),nt=u._free=t=>(nt=u._free=S.sa)(t),Jt=u._malloc=t=>(Jt=u._malloc=S.ta)(t),qe=t=>(qe=S.va)(t);u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=S.wa)();var $=(t,e)=>($=S.xa)(t,e),Pt=t=>(Pt=S.ya)(t),b=()=>(b=S.za)(),C=t=>(C=S.Aa)(t),Ze=t=>(Ze=S.Ba)(t),Qe=t=>(Qe=S.Ca)(t),Je=(t,e,r)=>(Je=S.Da)(t,e,r),Ke=t=>(Ke=S.Ea)(t);u.dynCall_viijii=(t,e,r,n,a,o,i)=>(u.dynCall_viijii=S.Fa)(t,e,r,n,a,o,i);var tr=u.dynCall_jiii=(t,e,r,n)=>(tr=u.dynCall_jiii=S.Ga)(t,e,r,n),er=u.dynCall_jiiii=(t,e,r,n,a)=>(er=u.dynCall_jiiii=S.Ha)(t,e,r,n,a);u.dynCall_iiiiij=(t,e,r,n,a,o,i)=>(u.dynCall_iiiiij=S.Ia)(t,e,r,n,a,o,i),u.dynCall_iiiiijj=(t,e,r,n,a,o,i,s,l)=>(u.dynCall_iiiiijj=S.Ja)(t,e,r,n,a,o,i,s,l),u.dynCall_iiiiiijj=(t,e,r,n,a,o,i,s,l,d)=>(u.dynCall_iiiiiijj=S.Ka)(t,e,r,n,a,o,i,s,l,d);function Da(t,e){var r=b();try{return P(t)(e)}catch(n){if(C(r),n!==n+0)throw n;$(1,0)}}function Aa(t,e,r,n){var a=b();try{P(t)(e,r,n)}catch(o){if(C(a),o!==o+0)throw o;$(1,0)}}function xa(t,e,r){var n=b();try{P(t)(e,r)}catch(a){if(C(n),a!==a+0)throw a;$(1,0)}}function Sa(t,e,r,n,a){var o=b();try{return P(t)(e,r,n,a)}catch(i){if(C(o),i!==i+0)throw i;$(1,0)}}function Oa(t,e){var r=b();try{P(t)(e)}catch(n){if(C(r),n!==n+0)throw n;$(1,0)}}function Fa(t,e,r){var n=b();try{return P(t)(e,r)}catch(a){if(C(n),a!==a+0)throw a;$(1,0)}}function Ma(t){var e=b();try{P(t)()}catch(r){if(C(e),r!==r+0)throw r;$(1,0)}}function ja(t,e,r,n){var a=b();try{return P(t)(e,r,n)}catch(o){if(C(a),o!==o+0)throw o;$(1,0)}}function Ra(t,e,r,n,a,o){var i=b();try{P(t)(e,r,n,a,o)}catch(s){if(C(i),s!==s+0)throw s;$(1,0)}}function Ia(t,e,r,n,a,o,i){var s=b();try{P(t)(e,r,n,a,o,i)}catch(l){if(C(s),l!==l+0)throw l;$(1,0)}}function Wa(t,e,r,n,a,o,i,s,l,d,h){var y=b();try{P(t)(e,r,n,a,o,i,s,l,d,h)}catch(v){if(C(y),v!==v+0)throw v;$(1,0)}}function Ha(t,e,r,n,a,o,i,s){var l=b();try{P(t)(e,r,n,a,o,i,s)}catch(d){if(C(l),d!==d+0)throw d;$(1,0)}}function ka(t,e,r,n,a){var o=b();try{P(t)(e,r,n,a)}catch(i){if(C(o),i!==i+0)throw i;$(1,0)}}function Ba(t,e,r,n,a,o,i){var s=b();try{return P(t)(e,r,n,a,o,i)}catch(l){if(C(s),l!==l+0)throw l;$(1,0)}}function Ua(t,e,r,n,a,o,i,s,l){var d=b();try{P(t)(e,r,n,a,o,i,s,l)}catch(h){if(C(d),h!==h+0)throw h;$(1,0)}}function Va(t){var e=b();try{return P(t)()}catch(r){if(C(e),r!==r+0)throw r;$(1,0)}}function La(t,e,r,n,a,o,i){var s=b();try{return P(t)(e,r,n,a,o,i)}catch(l){if(C(s),l!==l+0)throw l;$(1,0)}}function za(t,e,r,n){var a=b();try{return P(t)(e,r,n)}catch(o){if(C(a),o!==o+0)throw o;$(1,0)}}function Ya(t,e,r,n){var a=b();try{return P(t)(e,r,n)}catch(o){if(C(a),o!==o+0)throw o;$(1,0)}}function Na(t,e,r,n,a,o){var i=b();try{return P(t)(e,r,n,a,o)}catch(s){if(C(i),s!==s+0)throw s;$(1,0)}}function Ga(t,e,r,n,a,o){var i=b();try{return P(t)(e,r,n,a,o)}catch(s){if(C(i),s!==s+0)throw s;$(1,0)}}function Xa(t,e,r,n,a,o,i,s,l,d){var h=b();try{return P(t)(e,r,n,a,o,i,s,l,d)}catch(y){if(C(h),y!==y+0)throw y;$(1,0)}}function qa(t,e,r){var n=b();try{return P(t)(e,r)}catch(a){if(C(n),a!==a+0)throw a;$(1,0)}}function Za(t,e,r,n,a,o,i,s,l,d){var h=b();try{P(t)(e,r,n,a,o,i,s,l,d)}catch(y){if(C(h),y!==y+0)throw y;$(1,0)}}function Qa(t,e,r,n,a,o,i,s){var l=b();try{return P(t)(e,r,n,a,o,i,s)}catch(d){if(C(l),d!==d+0)throw d;$(1,0)}}function Ja(t,e,r,n,a,o,i,s,l){var d=b();try{return P(t)(e,r,n,a,o,i,s,l)}catch(h){if(C(d),h!==h+0)throw h;$(1,0)}}function Ka(t,e,r,n,a,o,i){var s=b();try{P(t)(e,r,n,a,o,i)}catch(l){if(C(s),l!==l+0)throw l;$(1,0)}}function to(t,e,r,n){var a=b();try{return P(t)(e,r,n)}catch(o){if(C(a),o!==o+0)throw o;$(1,0)}}function eo(t,e,r,n,a,o,i,s,l,d,h,y){var v=b();try{return P(t)(e,r,n,a,o,i,s,l,d,h,y)}catch(_){if(C(v),_!==_+0)throw _;$(1,0)}}function ro(t,e,r,n,a,o,i,s,l,d,h,y,v,_,D,R){var A=b();try{P(t)(e,r,n,a,o,i,s,l,d,h,y,v,_,D,R)}catch(I){if(C(A),I!==I+0)throw I;$(1,0)}}function no(t,e,r,n){var a=b();try{return tr(t,e,r,n)}catch(o){if(C(a),o!==o+0)throw o;$(1,0)}}function ao(t,e,r,n,a){var o=b();try{return er(t,e,r,n,a)}catch(i){if(C(o),i!==i+0)throw i;$(1,0)}}var Ht;wt=function t(){Ht||rr(),Ht||(wt=t)};function rr(){if(st>0||(Ar(),st>0))return;function t(){Ht||(Ht=!0,u.calledRun=!0,!vt&&(xr(),g(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Sr()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),t()},1)):t()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return rr(),m.ready}})();function Tr(c){return ue(de,c)}async function Pr(c,{tryHarder:m=at.tryHarder,formats:u=at.formats,maxSymbols:g=at.maxSymbols}=at){return br(c,{tryHarder:m,formats:u,maxSymbols:g},de)}const fe=new Map([["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["data_matrix","DataMatrix"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["pdf417","PDF417"],["qr_code","QRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"]]);function Er(c){for(const[m,u]of fe)if(c===u)return m;return"unknown"}class Dr extends EventTarget{constructor(u={}){var g;super();or(this,mt,void 0);try{const w=(g=u==null?void 0:u.formats)==null?void 0:g.filter(E=>E!=="unknown");if((w==null?void 0:w.length)===0)throw new TypeError("Hint option provided, but is empty.");w==null||w.forEach(E=>{if(!U.includes(E))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${E}' is not a valid enum value of type BarcodeFormat.`)}),ir(this,mt,w??[]),Tr().then(E=>{this.dispatchEvent(new CustomEvent("load",{detail:E}))}).catch(E=>{this.dispatchEvent(new CustomEvent("error",{detail:E}))})}catch(w){throw ie(w,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return U.filter(u=>u!=="unknown")}async detect(u){try{const g=await fr(u);if(g===null)return[];let w;try{w=await Pr(g,{tryHarder:!0,formats:ar(this,mt).map(E=>fe.get(E))})}catch{throw new DOMException("Barcode detection service unavailable. Use 'setZXingModuleOverrides' in offline or strict CSP environments.","NotSupportedError")}return w.map(E=>{const{topLeft:{x:M,y:X},topRight:{x:V,y:j},bottomLeft:{x:q,y:Q},bottomRight:{x:Y,y:L}}=E.position,J=Math.min(M,V,q,Y),vt=Math.min(X,j,Q,L),N=Math.max(M,V,q,Y),H=Math.max(X,j,Q,L);return{boundingBox:new DOMRectReadOnly(J,vt,N-J,H-vt),rawValue:new TextDecoder().decode(E.bytes),format:Er(E.format),cornerPoints:[{x:M,y:X},{x:V,y:j},{x:Y,y:L},{x:q,y:Q}]}})}catch(g){throw ie(g,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return mt=new WeakMap,globalThis.BarcodeDetector??(globalThis.BarcodeDetector=Dr),W.setZXingModuleOverrides=$r,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"}),W}({});
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "barcode-detector",
3
3
  "description": "A Barcode Detection API polyfill that uses ZXing webassembly under the hood",
4
4
  "private": false,
5
- "version": "2.0.0",
5
+ "version": "2.0.1",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "./dist"
@@ -59,15 +59,15 @@
59
59
  "format": "prettier . --write",
60
60
  "prebuild": "npm run lint && npm run type-check && npm run format",
61
61
  "build:es": "vite build",
62
- "build:cjs": "node ./scripts/build-cjs.js",
63
- "build:iife": "node ./scripts/build-iife.js",
62
+ "build:cjs": "tsx ./scripts/build-cjs.ts",
63
+ "build:iife": "tsx ./scripts/build-iife.ts",
64
64
  "build": "npm run build:es && npm run build:cjs && npm run build:iife",
65
65
  "postbuild:es": "tsc --declarationDir ./dist/es",
66
66
  "postbuild:cjs": "tsc --declarationDir ./dist/cjs",
67
67
  "start": "vite preview --outDir ./tests --port $npm_package_config_port -l silent",
68
- "pretest": "node ./scripts/list-dir.js",
69
- "pretest:ui": "node ./scripts/list-dir.js",
70
- "precoverage": "node ./scripts/list-dir.js",
68
+ "pretest": "tsx ./scripts/list-dir.ts",
69
+ "pretest:ui": "tsx ./scripts/list-dir.ts",
70
+ "precoverage": "tsx ./scripts/list-dir.ts",
71
71
  "test": "start-server-and-test $npm_package_config_port 'vitest --coverage'",
72
72
  "test:ui": "start-server-and-test $npm_package_config_port 'vitest --ui --coverage'",
73
73
  "coverage": "start-server-and-test $npm_package_config_port 'vitest run --coverage'",
@@ -76,24 +76,25 @@
76
76
  "postncu": "npm i"
77
77
  },
78
78
  "devDependencies": {
79
- "@typescript-eslint/eslint-plugin": "^6.4.1",
80
- "@typescript-eslint/parser": "^6.4.1",
79
+ "@typescript-eslint/eslint-plugin": "^6.6.0",
80
+ "@typescript-eslint/parser": "^6.6.0",
81
81
  "@vitest/browser": "^0.34.3",
82
82
  "@vitest/coverage-istanbul": "^0.34.3",
83
83
  "@vitest/ui": "^0.34.3",
84
84
  "eslint": "^8.48.0",
85
85
  "http-server": "^14.1.1",
86
- "npm-check-updates": "^16.13.1",
86
+ "npm-check-updates": "^16.13.3",
87
87
  "playwright": "^1.37.1",
88
- "prettier": "^3.0.2",
88
+ "prettier": "^3.0.3",
89
89
  "rimraf": "^5.0.1",
90
90
  "start-server-and-test": "^2.0.0",
91
+ "tsx": "^3.12.8",
91
92
  "typescript": "^5.2.2",
92
93
  "vite": "^4.4.9",
93
94
  "vitest": "^0.34.3"
94
95
  },
95
96
  "dependencies": {
96
- "@sec-ant/zxing-wasm": "^2.1.3",
97
+ "@sec-ant/zxing-wasm": "^2.1.4",
97
98
  "@types/dom-webcodecs": "^0.1.8"
98
99
  }
99
100
  }