@sec-ant/barcode-detector
Advanced tools
Comparing version 1.2.2 to 1.3.0
/// <reference types="dom-webcodecs" /> | ||
import { ZXingModule } from "@sec-ant/zxing-wasm/reader"; | ||
import { BARCODE_DETECTOR_FORMATS } from "./utils.js"; | ||
@@ -17,3 +18,14 @@ export type BarcodeFormat = (typeof BARCODE_DETECTOR_FORMATS)[number]; | ||
} | ||
export declare class BarcodeDetector { | ||
interface CustomEventMap { | ||
load: CustomEvent<ZXingModule<"reader">>; | ||
error: CustomEvent<unknown>; | ||
} | ||
type ChangeEventListener = <K extends keyof CustomEventMap>(type: K, callback: ((evt: CustomEventMap[K]) => void) | { | ||
handleEvent(evt: CustomEventMap[K]): void; | ||
} | null, options?: boolean | AddEventListenerOptions | undefined) => void; | ||
export interface BarcodeDetector { | ||
addEventListener: ChangeEventListener; | ||
removeEventListener: ChangeEventListener; | ||
} | ||
export declare class BarcodeDetector extends EventTarget { | ||
#private; | ||
@@ -20,0 +32,0 @@ constructor(barcodeDectorOptions?: BarcodeDetectorOptions); |
@@ -1,3 +0,3 @@ | ||
"use strict";var He=(c,p,u)=>{if(!p.has(c))throw TypeError("Cannot "+u)};var ke=(c,p,u)=>(He(c,p,"read from private field"),u?u.call(c):p.get(c)),Ue=(c,p,u)=>{if(p.has(c))throw TypeError("Cannot add the same private member more than once");p instanceof WeakSet?p.add(c):p.set(c,u)},Be=(c,p,u,g)=>(He(c,p,"write to private field"),g?g.call(c,u):p.set(c,u),u);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ve=["aztec","code_128","code_39","code_93","codabar","data_matrix","ean_13","ean_8","itf","pdf417","qr_code","upc_a","upc_e","unknown"];function Ma(c){if(Ge(c))return{width:c.naturalWidth,height:c.naturalHeight};if(Xe(c))return{width:c.width.baseVal.value,height:c.height.baseVal.value};if(qe(c))return{width:c.videoWidth,height:c.videoHeight};if(ja(c))return{width:c.width,height:c.height};if(Je(c))return{width:c.width,height:c.height};if(Ra(c))return{width:c.width,height:c.height};if(Ze(c))return{width:c.displayWidth,height:c.displayHeight};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 Ge(c){try{return c instanceof HTMLImageElement}catch{return!1}}function Xe(c){try{return c instanceof SVGImageElement}catch{return!1}}function qe(c){try{return c instanceof HTMLVideoElement}catch{return!1}}function ja(c){try{return c instanceof HTMLCanvasElement}catch{return!1}}function Je(c){try{return c instanceof ImageBitmap}catch{return!1}}function Ra(c){try{return c instanceof OffscreenCanvas}catch{return!1}}function Ze(c){try{return c instanceof VideoFrame}catch{return!1}}function Ia(c){try{return c instanceof Blob}catch{return!1}}function Wa(c){try{return c instanceof ImageData}catch{return!1}}function Ha(c,p){try{const u=new OffscreenCanvas(c,p);if(u.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return u;throw void 0}catch{const u=document.createElement("canvas");return u.width=c,u.height=p,u}}async function Qe(c){if(Ge(c)&&!await Ba(c))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Xe(c)&&!await Va(c))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(Ze(c)&&za(c))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(qe(c)&&(c.readyState===0||c.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(Je(c)&&Ya(c))throw new DOMException("The image source is detached.","InvalidStateError");const{width:p,height:u}=Ma(c);if(p===0||u===0)return null;const P=Ha(p,u).getContext("2d");P.drawImage(c,0,0);try{return P.getImageData(0,0,p,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function ka(c){let p;try{p=await createImageBitmap(c)}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await Qe(p)}async function Ua(c){if(Ia(c))return await ka(c);if(Wa(c)){if(La(c))throw new DOMException("The image data has been detached.","InvalidStateError");return c}return await Qe(c)}async function Ba(c){try{return await c.decode(),!0}catch{return!1}}async function Va(c){var p;try{return await((p=c.decode)==null?void 0:p.call(c)),!0}catch{return!1}}function za(c){return c.format===null}function La(c){return c.data.buffer.byteLength===0}function Ya(c){return c.width===0&&c.height===0}function ze(c,p){return c instanceof DOMException?new DOMException(`${p}: ${c.message}`,c.name):c instanceof Error?new c.constructor(`${p}: ${c.message}`):new Error(`${p}: ${c}`)}const Le=c=>{let p;const u=new Set,g=(M,N)=>{const k=typeof M=="function"?M(p):M;if(!Object.is(k,p)){const j=p;p=N??typeof k!="object"?k:Object.assign({},p,k),u.forEach(L=>L(p,j))}},P=()=>p,F={setState:g,getState:P,subscribe:M=>(u.add(M),()=>u.delete(M)),destroy:()=>{u.clear()}};return p=c(g,P,F),F},Na=c=>c?Le(c):Le,Ga={locateFile:(c,p)=>{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.3/dist/${g}/${c}`:p+c}},lt=Na()(()=>({zxingModuleWeakMap:new WeakMap,zxingModuleOverrides:Ga}));function Xa(c){lt.setState({zxingModuleOverrides:c})}function Ke(c,p=lt.getState().zxingModuleOverrides){const{zxingModuleWeakMap:u}=lt.getState(),g=u.get(c);if(g&&Object.is(p,lt.getState().zxingModuleOverrides))return g;{lt.setState({zxingModuleOverrides:p});const P=c(p);return u.set(c,P),P}}const Ye=["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"],rt={tryHarder:!0,formats:[],maxSymbols:255};async function qa(c,{tryHarder:p=rt.tryHarder,formats:u=rt.formats,maxSymbols:g=rt.maxSymbols}=rt,P){const F=await Ke(P,lt.getState().zxingModuleOverrides),{data:M,width:N,height:k,data:{byteLength:j}}=c,L=F._malloc(j);F.HEAP8.set(M,L);const G=F.readBarcodesFromPixmap(L,N,k,p,Ja(u),g);F._free(L);const B=[];for(let V=0;V<G.size();++V){const X=G.get(V);B.push({...X,format:Za(X.format)})}return B}function Ja(c){return c.join("|")}function Za(c){const p=Ne(c);let u=0,g=Ye.length-1;for(;u<=g;){const P=Math.floor((u+g)/2),F=Ye[P],M=Ne(F);if(M===p)return F;M<p?u=P+1:g=P-1}return"None"}function Ne(c){return c.toLowerCase().replace(/_-\[\]/g,"")}var tr=(()=>{var c=typeof document>"u"?require("url").pathToFileURL(__filename).href:document.currentScript&&document.currentScript.src||new URL("pure.js",document.baseURI).href;return function(p={}){var u=p,g,P;u.ready=new Promise((t,e)=>{g=t,P=e});var F=Object.assign({},u),M="./this.program",N=typeof window=="object",k=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var j="";function L(t){return u.locateFile?u.locateFile(t,j):j+t}var G;(N||k)&&(k?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="",k&&(G=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 B=u.printErr||console.error.bind(console);Object.assign(u,F),F=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"&&_t("no native wasm support detected");var X,E,bt=!1,q,U,ut,Ct,R,S,qt,Jt;function Zt(){var t=X.buffer;u.HEAP8=q=new Int8Array(t),u.HEAP16=ut=new Int16Array(t),u.HEAP32=R=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=Ct=new Uint16Array(t),u.HEAPU32=S=new Uint32Array(t),u.HEAPF32=qt=new Float32Array(t),u.HEAPF64=Jt=new Float64Array(t)}var Qt,Kt=[],te=[],ee=[];function rr(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)or(u.preRun.shift());It(Kt)}function nr(){It(te)}function ar(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)sr(u.postRun.shift());It(ee)}function or(t){Kt.unshift(t)}function ir(t){te.unshift(t)}function sr(t){ee.unshift(t)}var nt=0,dt=null;function ur(t){nt++,u.monitorRunDependencies&&u.monitorRunDependencies(nt)}function cr(t){if(nt--,u.monitorRunDependencies&&u.monitorRunDependencies(nt),nt==0&&dt){var e=dt;dt=null,e()}}function _t(t){u.onAbort&&u.onAbort(t),t="Aborted("+t+")",B(t),bt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw P(e),e}var fr="data:application/octet-stream;base64,";function re(t){return t.startsWith(fr)}var at;u.locateFile?(at="zxing_reader.wasm",re(at)||(at=L(at))):at=new URL("/reader/zxing_reader.wasm",self.location).href;function ne(t){if(t==at&&V)return new Uint8Array(V);if(G)return G(t);throw"both async and sync fetching of the wasm failed"}function lr(t){return!V&&(N||k)&&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(()=>ne(t)):Promise.resolve().then(()=>ne(t))}function ae(t,e,r){return lr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{B("failed to asynchronously prepare wasm: "+n),_t(n)})}function dr(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!re(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(i){return B("wasm streaming compile failed: "+i),B("falling back to ArrayBuffer instantiation"),ae(e,r,n)})}):ae(e,r,n)}function hr(){var t={a:ta};function e(n,a){var o=n.exports;return E=o,X=E.qa,Zt(),Qt=E.ua,ir(E.ra),cr(),o}ur();function r(n){e(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(t,e)}catch(n){B("Module.instantiateWasm callback failed with error: "+n),P(n)}return dr(V,at,t,r).catch(P),{}}var It=t=>{for(;t.length>0;)t.shift()(u)},Tt=[],Pt=0;function pr(t){var e=new Et(t);return e.get_caught()||(e.set_caught(!0),Pt--),e.set_rethrown(!1),Tt.push(e),Oe(e.excPtr),e.get_exception_ptr()}var J=0;function yr(){w(0,0);var t=Tt.pop();Fe(t.excPtr),J=0}function Et(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){S[this.ptr+4>>2]=e},this.get_type=function(){return S[this.ptr+4>>2]},this.set_destructor=function(e){S[this.ptr+8>>2]=e},this.get_destructor=function(){return S[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,q[this.ptr+12>>0]=e},this.get_caught=function(){return q[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,q[this.ptr+13>>0]=e},this.get_rethrown=function(){return q[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){S[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return S[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=je(this.get_type());if(e)return S[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}function vr(t){throw J||(J=t),J}var Wt=t=>{var e=J;if(!e)return wt(0),0;var r=new Et(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return wt(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var i=r.ptr+16;if(Me(o,n,i))return wt(o),e}return wt(n),e},mr=()=>Wt([]),gr=t=>Wt([t]),wr=(t,e)=>Wt([t,e]);function $r(t){var e=new Et(t).get_exception_ptr();return e}function br(){var t=Tt.pop();t||_t("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Tt.push(t),t.set_rethrown(!0),t.set_caught(!1),Pt++),J=e,J}function Cr(t,e,r){var n=new Et(t);throw n.init(e,r),J=t,Pt++,J}function _r(){return Pt}var At={};function oe(t){for(;t.length;){var e=t.pop(),r=t.pop();r(e)}}function ht(t){return this.fromWireType(R[t>>2])}var ct={},ot={},xt={},ie=void 0;function Dt(t){throw new ie(t)}function it(t,e,r){t.forEach(function(s){xt[s]=e});function n(s){var f=r(s);f.length!==t.length&&Dt("Mismatched type converter count");for(var l=0;l<t.length;++l)Z(t[l],f[l])}var a=new Array(e.length),o=[],i=0;e.forEach((s,f)=>{ot.hasOwnProperty(s)?a[f]=ot[s]:(o.push(s),ct.hasOwnProperty(s)||(ct[s]=[]),ct[s].push(()=>{a[f]=ot[s],++i,i===o.length&&n(a)}))}),o.length===0&&n(a)}var Tr=function(t){var e=At[t];delete At[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(i=>i.getterReturnType).concat(a.map(i=>i.setterArgumentType));it([t],o,i=>{var s={};return a.forEach((f,l)=>{var h=f.fieldName,v=i[l],m=f.getter,C=f.getterContext,A=i[l+a.length],I=f.setter,x=f.setterContext;s[h]={read:W=>v.fromWireType(m(C,W)),write:(W,d)=>{var y=[];I(x,W,A.toWireType(y,d)),oe(y)}}}),[{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 v=r();for(h in s)s[h].write(v,l[h]);return f!==null&&f.push(n,v),v},argPackAdvance:8,readValueFromPointer:ht,destructorFunction:n}]})};function Pr(t,e,r,n,a){}function Ht(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 Er(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);se=t}var se=void 0;function H(t){for(var e="",r=t;U[r];)e+=se[U[r++]];return e}var ft=void 0;function _(t){throw new ft(t)}function Ar(t,e,r={}){var n=e.name;if(t||_(`type "${n}" must have a positive integer typeid pointer`),ot.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;_(`Cannot register type '${n}' twice`)}if(ot[t]=e,delete xt[t],ct.hasOwnProperty(t)){var a=ct[t];delete ct[t],a.forEach(o=>o())}}function Z(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Ar(t,e,r)}function xr(t,e,r,n,a){var o=Ht(r);e=H(e),Z(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=q;else if(r===2)s=ut;else if(r===4)s=R;else throw new TypeError("Unknown boolean type size: "+e);return this.fromWireType(s[i>>o])},destructorFunction:null})}function Dr(t){if(!(this instanceof tt)||!(t instanceof tt))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 Sr(t){return{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}}function kt(t){function e(r){return r.$$.ptrType.registeredClass.name}_(e(t)+" instance already deleted")}var Ut=!1;function ue(t){}function Fr(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}function ce(t){t.count.value-=1;var e=t.count.value===0;e&&Fr(t)}function fe(t,e,r){if(e===r)return t;if(r.baseClass===void 0)return null;var n=fe(t,e,r.baseClass);return n===null?null:r.downcast(n)}var le={};function Or(){return Object.keys(vt).length}function Mr(){var t=[];for(var e in vt)vt.hasOwnProperty(e)&&t.push(vt[e]);return t}var pt=[];function Bt(){for(;pt.length;){var t=pt.pop();t.$$.deleteScheduled=!1,t.delete()}}var yt=void 0;function jr(t){yt=t,pt.length&&yt&&yt(Bt)}function Rr(){u.getInheritedInstanceCount=Or,u.getLiveInheritedInstances=Mr,u.flushPendingDeletes=Bt,u.setDelayFunction=jr}var vt={};function Ir(t,e){for(e===void 0&&_("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}function Wr(t,e){return e=Ir(t,e),vt[e]}function St(t,e){(!e.ptrType||!e.ptr)&&Dt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&Dt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},mt(Object.create(t,{$$:{value:e}}))}function Hr(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Wr(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?St(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):St(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),i=le[o];if(!i)return a.call(this);var s;this.isConst?s=i.constPointerType:s=i.pointerType;var f=fe(e,this.registeredClass,s.registeredClass);return f===null?a.call(this):this.isSmartPointer?St(s.registeredClass.instancePrototype,{ptrType:s,ptr:f,smartPtrType:this,smartPtr:t}):St(s.registeredClass.instancePrototype,{ptrType:s,ptr:f})}var mt=function(t){return typeof FinalizationRegistry>"u"?(mt=e=>e,t):(Ut=new FinalizationRegistry(e=>{ce(e.$$)}),mt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Ut.register(e,a,e)}return e},ue=e=>Ut.unregister(e),mt(t))};function kr(){if(this.$$.ptr||kt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=mt(Object.create(Object.getPrototypeOf(this),{$$:{value:Sr(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function Ur(){this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&_("Object already scheduled for deletion"),ue(this),ce(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Br(){return!this.$$.ptr}function Vr(){return this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&_("Object already scheduled for deletion"),pt.push(this),pt.length===1&&yt&&yt(Bt),this.$$.deleteScheduled=!0,this}function zr(){tt.prototype.isAliasOf=Dr,tt.prototype.clone=kr,tt.prototype.delete=Ur,tt.prototype.isDeleted=Br,tt.prototype.deleteLater=Vr}function tt(){}var Lr=48,Yr=57;function de(t){if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Lr&&e<=Yr?`_${t}`:t}function he(t,e){return t=de(t),{[t]:function(){return e.apply(this,arguments)}}[t]}function pe(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 ye(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`),pe(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 Nr(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 Vt(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 Gr(t,e){if(e===null)return this.isReference&&_(`null is not a valid ${this.name}`),0;e.$$||_(`Cannot pass "${Yt(e)}" as a ${this.name}`),e.$$.ptr||_(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Vt(e.$$.ptr,r,this.registeredClass);return n}function Xr(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 "${Yt(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=Vt(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,et.toHandle(function(){a.delete()})),t!==null&&t.push(this.rawDestructor,r)}break;default:_("Unsupporting sharing policy")}return r}function qr(t,e){if(e===null)return this.isReference&&_(`null is not a valid ${this.name}`),0;e.$$||_(`Cannot pass "${Yt(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=Vt(e.$$.ptr,r,this.registeredClass);return n}function Jr(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function Zr(t){this.rawDestructor&&this.rawDestructor(t)}function Qr(t){t!==null&&t.delete()}function Kr(){Q.prototype.getPointee=Jr,Q.prototype.destructor=Zr,Q.prototype.argPackAdvance=8,Q.prototype.readValueFromPointer=ht,Q.prototype.deleteObject=Qr,Q.prototype.fromWireType=Hr}function Q(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=Gr,this.destructorFunction=null):(this.toWireType=qr,this.destructorFunction=null):this.toWireType=Xr}function ve(t,e,r){u.hasOwnProperty(t)||Dt("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 tn=(t,e,r)=>{var n=u["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},Ft=[],T=t=>{var e=Ft[t];return e||(t>=Ft.length&&(Ft.length=t+1),Ft[t]=e=Qt.get(t)),e},en=(t,e,r)=>{if(t.includes("j"))return tn(t,e,r);var n=T(e).apply(null,r);return n},rn=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),en(t,e,r)}};function Y(t,e){t=H(t);function r(){return t.includes("j")?rn(t,e):T(e)}var n=r();return typeof n!="function"&&_(`unknown function pointer with signature ${t}: ${e}`),n}function nn(t,e){var r=he(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+` | ||
`+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 me=void 0;function ge(t){var e=Se(t),r=H(e);return K(e),r}function Ot(t,e){var r=[],n={};function a(o){if(!n[o]&&!ot[o]){if(xt[o]){xt[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new me(`${t}: `+r.map(ge).join([", "]))}function an(t,e,r,n,a,o,i,s,f,l,h,v,m){h=H(h),o=Y(a,o),s&&(s=Y(i,s)),l&&(l=Y(f,l)),m=Y(v,m);var C=de(h);ye(C,function(){Ot(`Cannot construct ${h} due to unbound types`,[n])}),it([t,e,r],n?[n]:[],function(A){A=A[0];var I,x;n?(I=A.registeredClass,x=I.instancePrototype):x=tt.prototype;var W=he(C,function(){if(Object.getPrototypeOf(this)!==d)throw new ft("Use 'new' to construct "+h);if(y.constructor_body===void 0)throw new ft(h+" has no accessible constructor");var Rt=y.constructor_body[arguments.length];if(Rt===void 0)throw new ft(`Tried to invoke ctor of ${h} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(y.constructor_body).toString()}) parameters instead!`);return Rt.apply(this,arguments)}),d=Object.create(x,{constructor:{value:W}});W.prototype=d;var y=new Nr(h,W,d,m,I,o,s,l);y.baseClass&&(y.baseClass.__derivedClasses===void 0&&(y.baseClass.__derivedClasses=[]),y.baseClass.__derivedClasses.push(y));var D=new Q(h,y,!0,!1,!1),O=new Q(h+"*",y,!1,!1,!1),st=new Q(h+" const*",y,!1,!0,!1);return le[t]={pointerType:O,constPointerType:st},ve(C,W),[D,O,st]})}function zt(t,e){for(var r=[],n=0;n<t;n++)r.push(S[e+n*4>>2]);return r}function Lt(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",v=i-2,m=new Array(v),C=[],A=[];return function(){arguments.length!==v&&_(`function ${t} called with ${arguments.length} arguments, expected ${v} args!`),A.length=0;var I;C.length=s?2:1,C[0]=a,s&&(I=e[1].toWireType(A,this),C[1]=I);for(var x=0;x<v;++x)m[x]=e[x+2].toWireType(A,arguments[x]),C.push(m[x]);var W=n.apply(null,C);function d(y){if(f)oe(A);else for(var D=s?1:2;D<e.length;D++){var O=D===1?I:m[D-2];e[D].destructorFunction!==null&&e[D].destructorFunction(O)}if(h)return e[0].fromWireType(y)}return d(W)}}function on(t,e,r,n,a,o){var i=zt(e,r);a=Y(n,a),it([],[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 ft(`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]=()=>{Ot(`Cannot construct ${s.name} due to unbound types`,i)},it([],i,function(l){return l.splice(1,0,null),s.registeredClass.constructor_body[e-1]=Lt(f,l,null,a,o),[]}),[]})}function sn(t,e,r,n,a,o,i,s,f){var l=zt(r,n);e=H(e),o=Y(a,o),it([],[t],function(h){h=h[0];var v=`${h.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&h.registeredClass.pureVirtualFunctions.push(e);function m(){Ot(`Cannot call ${v} due to unbound types`,l)}var C=h.registeredClass.instancePrototype,A=C[e];return A===void 0||A.overloadTable===void 0&&A.className!==h.name&&A.argCount===r-2?(m.argCount=r-2,m.className=h.name,C[e]=m):(pe(C,e,v),C[e].overloadTable[r-2]=m),it([],l,function(I){var x=Lt(v,I,h,o,i);return C[e].overloadTable===void 0?(x.argCount=r-2,C[e]=x):C[e].overloadTable[r-2]=x,[]}),[]})}function un(){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 z=new we;function $e(t){t>=z.reserved&&--z.get(t).refcount===0&&z.free(t)}function cn(){for(var t=0,e=z.reserved;e<z.allocated.length;++e)z.allocated[e]!==void 0&&++t;return t}function fn(){z.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),z.reserved=z.allocated.length,u.count_emval_handles=cn}var et={toValue:t=>(t||_("Cannot use deleted val. handle = "+t),z.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 z.allocate({refcount:1,value:t})}}};function ln(t,e){e=H(e),Z(t,{name:e,fromWireType:function(r){var n=et.toValue(r);return $e(r),n},toWireType:function(r,n){return et.toHandle(n)},argPackAdvance:8,readValueFromPointer:ht,destructorFunction:null})}function Yt(t){if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t}function dn(t,e){switch(e){case 2:return function(r){return this.fromWireType(qt[r>>2])};case 3:return function(r){return this.fromWireType(Jt[r>>3])};default:throw new TypeError("Unknown float type: "+t)}}function hn(t,e,r){var n=Ht(r);e=H(e),Z(t,{name:e,fromWireType:function(a){return a},toWireType:function(a,o){return o},argPackAdvance:8,readValueFromPointer:dn(e,n),destructorFunction:null})}function pn(t,e,r,n,a,o,i){var s=zt(e,r);t=H(t),a=Y(n,a),ye(t,function(){Ot(`Cannot call ${t} due to unbound types`,s)},e-1),it([],s,function(f){var l=[f[0],null].concat(f.slice(1));return ve(t,Lt(t,l,null,a,o),e-1),[]})}function yn(t,e,r){switch(e){case 0:return r?function(n){return q[n]}:function(n){return U[n]};case 1:return r?function(n){return ut[n>>1]}:function(n){return Ct[n>>1]};case 2:return r?function(n){return R[n>>2]}:function(n){return S[n>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function vn(t,e,r,n,a){e=H(e);var o=Ht(r),i=v=>v;if(n===0){var s=32-8*r;i=v=>v<<s>>>s}var f=e.includes("unsigned"),l=(v,m)=>{},h;f?h=function(v,m){return l(m,this.name),m>>>0}:h=function(v,m){return l(m,this.name),m},Z(t,{name:e,fromWireType:i,toWireType:h,argPackAdvance:8,readValueFromPointer:yn(e,o,n!==0),destructorFunction:null})}function mn(t,e,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(i){i=i>>2;var s=S,f=s[i],l=s[i+1];return new a(s.buffer,l,f)}r=H(r),Z(t,{name:r,fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}var 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 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},gn=(t,e,r)=>be(t,U,e,r),Ce=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e},_e=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,wn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&_e)return _e.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},Nt=(t,e)=>t?wn(U,t,e):"";function $n(t,e){e=H(e);var r=e==="std::string";Z(t,{name:e,fromWireType:function(n){var a=S[n>>2],o=n+4,i;if(r)for(var s=o,f=0;f<=a;++f){var l=o+f;if(f==a||U[l]==0){var h=l-s,v=Nt(s,h);i===void 0?i=v:(i+=String.fromCharCode(0),i+=v),s=l+1}}else{for(var m=new Array(a),f=0;f<a;++f)m[f]=String.fromCharCode(U[o+f]);i=m.join("")}return K(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=Ce(a):o=a.length;var s=Xt(4+o+1),f=s+4;if(S[s>>2]=o,r&&i)gn(a,f,o+1);else if(i)for(var l=0;l<o;++l){var h=a.charCodeAt(l);h>255&&(K(f),_("String has UTF-16 code units that do not fit in 8 bits")),U[f+l]=h}else for(var l=0;l<o;++l)U[f+l]=a[l];return n!==null&&n.push(K,s),s},argPackAdvance:8,readValueFromPointer:ht,destructorFunction:function(n){K(n)}})}var Te=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,bn=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&Ct[n];)++n;if(r=n<<1,r-t>32&&Te)return Te.decode(U.subarray(t,r));for(var o="",i=0;!(i>=e/2);++i){var s=ut[t+i*2>>1];if(s==0)break;o+=String.fromCharCode(s)}return o},Cn=(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);ut[e>>1]=i,e+=2}return ut[e>>1]=0,e-n},_n=t=>t.length*2,Tn=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=R[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},Pn=(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(R[e>>2]=i,e+=4,e+4>a)break}return R[e>>2]=0,e-n},En=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},An=function(t,e,r){r=H(r);var n,a,o,i,s;e===2?(n=bn,a=Cn,i=_n,o=()=>Ct,s=1):e===4&&(n=Tn,a=Pn,i=En,o=()=>S,s=2),Z(t,{name:r,fromWireType:function(f){for(var l=S[f>>2],h=o(),v,m=f+4,C=0;C<=l;++C){var A=f+4+C*e;if(C==l||h[A>>s]==0){var I=A-m,x=n(m,I);v===void 0?v=x:(v+=String.fromCharCode(0),v+=x),m=A+e}}return K(f),v},toWireType:function(f,l){typeof l!="string"&&_(`Cannot pass non-string to C++ string type ${r}`);var h=i(l),v=Xt(4+h+e);return S[v>>2]=h>>s,a(l,v+4,h+e),f!==null&&f.push(K,v),v},argPackAdvance:8,readValueFromPointer:ht,destructorFunction:function(f){K(f)}})};function xn(t,e,r,n,a,o){At[t]={name:H(e),rawConstructor:Y(r,n),rawDestructor:Y(a,o),fields:[]}}function Dn(t,e,r,n,a,o,i,s,f,l){At[t].fields.push({fieldName:H(e),getterReturnType:r,getter:Y(n,a),getterContext:o,setterArgumentType:i,setter:Y(s,f),setterContext:l})}function Sn(t,e){e=H(e),Z(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:function(){},toWireType:function(r,n){}})}var Fn={};function On(t){var e=Fn[t];return e===void 0?H(t):e}function Pe(){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 Mn(t){return t===0?et.toHandle(Pe()):(t=On(t),et.toHandle(Pe()[t]))}function jn(t){t>4&&(z.get(t).refcount+=1)}function Ee(t,e){var r=ot[t];return r===void 0&&_(e+" has unknown type "+ge(t)),r}function Rn(t){var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var i=Ee(S[n+o*4>>2],"parameter "+o);e[o+1]=i.readValueFromPointer(a),a+=i.argPackAdvance}var s=new(r.bind.apply(r,e));return et.toHandle(s)}}var Ae={};function In(t,e,r,n){t=et.toValue(t);var a=Ae[e];return a||(a=Rn(e),Ae[e]=a),a(t,r,n)}function Wn(t,e){t=Ee(t,"_emval_take_value");var r=t.readValueFromPointer(e);return et.toHandle(r)}var Hn=()=>{_t("")},kn=(t,e,r)=>U.copyWithin(t,e,e+r),Un=()=>2147483648,Bn=t=>{var e=X.buffer,r=t-e.byteLength+65535>>>16;try{return X.grow(r),Zt(),1}catch{}},Vn=t=>{var e=U.length;t>>>=0;var r=Un();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=Bn(i);if(s)return!0}return!1},Gt={},zn=()=>M||"./this.program",gt=()=>{if(!gt.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,_:zn()};for(var r in Gt)Gt[r]===void 0?delete e[r]:e[r]=Gt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);gt.strings=n}return gt.strings},Ln=(t,e)=>{for(var r=0;r<t.length;++r)q[e++>>0]=t.charCodeAt(r);q[e>>0]=0},Yn=(t,e)=>{var r=0;return gt().forEach(function(n,a){var o=e+r;S[t+a*4>>2]=o,Ln(n,o),r+=n.length+1}),0},Nn=(t,e)=>{var r=gt();S[t>>2]=r.length;var n=0;return r.forEach(function(a){n+=a.length+1}),S[e>>2]=n,0};function Gn(t){return t}var Mt=t=>t%4===0&&(t%100!==0||t%400===0),Xn=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},xe=[31,29,31,30,31,30,31,31,30,31,30,31],De=[31,28,31,30,31,30,31,31,30,31,30,31],qn=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Mt(r.getFullYear()),a=r.getMonth(),o=(n?xe:De)[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 Jn(t,e,r){var n=r>0?r:Ce(t)+1,a=new Array(n),o=be(t,a,0,a.length);return e&&(a.length=o),a}var Zn=(t,e)=>{q.set(t,e)},Qn=(t,e,r,n)=>{var a=R[n+40>>2],o={tm_sec:R[n>>2],tm_min:R[n+4>>2],tm_hour:R[n+8>>2],tm_mday:R[n+12>>2],tm_mon:R[n+16>>2],tm_year:R[n+20>>2],tm_wday:R[n+24>>2],tm_yday:R[n+28>>2],tm_isdst:R[n+32>>2],tm_gmtoff:R[n+36>>2],tm_zone:a?Nt(a):""},i=Nt(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 v(d,y,D){for(var O=typeof d=="number"?d.toString():d||"";O.length<y;)O=D[0]+O;return O}function m(d,y){return v(d,y,"0")}function C(d,y){function D(st){return st<0?-1:st>0?1:0}var O;return(O=D(d.getFullYear()-y.getFullYear()))===0&&(O=D(d.getMonth()-y.getMonth()))===0&&(O=D(d.getDate()-y.getDate())),O}function A(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 I(d){var y=qn(new Date(d.tm_year+1900,0,1),d.tm_yday),D=new Date(y.getFullYear(),0,4),O=new Date(y.getFullYear()+1,0,4),st=A(D),Rt=A(O);return C(st,y)<=0?C(Rt,y)<=0?y.getFullYear()+1:y.getFullYear():y.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 y=d.tm_year+1900;return m(y/100|0,2)},"%d":d=>m(d.tm_mday,2),"%e":d=>v(d.tm_mday,2," "),"%g":d=>I(d).toString().substring(2),"%G":d=>I(d),"%H":d=>m(d.tm_hour,2),"%I":d=>{var y=d.tm_hour;return y==0?y=12:y>12&&(y-=12),m(y,2)},"%j":d=>m(d.tm_mday+Xn(Mt(d.tm_year+1900)?xe:De,d.tm_mon-1),3),"%m":d=>m(d.tm_mon+1,2),"%M":d=>m(d.tm_min,2),"%n":()=>` | ||
`,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>m(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var y=d.tm_yday+7-d.tm_wday;return m(Math.floor(y/7),2)},"%V":d=>{var y=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&y++,y){if(y==53){var D=(d.tm_wday+371-d.tm_yday)%7;D!=4&&(D!=3||!Mt(d.tm_year))&&(y=1)}}else{y=52;var O=(d.tm_wday+7-d.tm_yday-1)%7;(O==4||O==5&&Mt(d.tm_year%400-1))&&y++}return m(y,2)},"%w":d=>d.tm_wday,"%W":d=>{var y=d.tm_yday+7-(d.tm_wday+6)%7;return m(Math.floor(y/7),2)},"%y":d=>(d.tm_year+1900).toString().substring(2),"%Y":d=>d.tm_year+1900,"%z":d=>{var y=d.tm_gmtoff,D=y>=0;return y=Math.abs(y)/60,y=y/60*100+y%60,(D?"+":"-")+("0000"+y).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=Jn(i,!1);return W.length>e?0:(Zn(W,t),W.length-1)},Kn=(t,e,r,n,a)=>Qn(t,e,r,n);ie=u.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Er(),ft=u.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},zr(),Rr(),Kr(),me=u.UnboundTypeError=nn(Error,"UnboundTypeError"),un(),fn();var ta={q:pr,u:yr,a:mr,h:gr,l:wr,I:$r,P:br,n:Cr,ba:_r,d:vr,oa:Tr,Y:Pr,fa:xr,na:an,ma:on,D:sn,ea:ln,W:hn,J:pn,w:vn,s:mn,V:$n,L:An,Q:xn,pa:Dn,ga:Sn,U:$e,la:Mn,R:jn,ia:In,ka:Wn,K:Hn,da:kn,ca:Vn,$:Yn,aa:Nn,H:wa,T:xa,B:ba,p:va,b:ea,C:ga,ha:_a,c:ia,j:ua,i:aa,x:$a,O:ma,v:pa,G:Pa,N:Ea,A:Ca,F:Da,Z:Fa,X:Oa,k:sa,f:oa,e:na,g:ra,M:Aa,m:ha,o:ca,S:fa,t:da,ja:ya,y:Ta,r:la,E:Sa,z:Gn,_:Kn};hr();var K=u._free=t=>(K=u._free=E.sa)(t),Xt=u._malloc=t=>(Xt=u._malloc=E.ta)(t),Se=t=>(Se=E.va)(t);u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=E.wa)();var w=(t,e)=>(w=E.xa)(t,e),wt=t=>(wt=E.ya)(t),$=()=>($=E.za)(),b=t=>(b=E.Aa)(t),Fe=t=>(Fe=E.Ba)(t),Oe=t=>(Oe=E.Ca)(t),Me=(t,e,r)=>(Me=E.Da)(t,e,r),je=t=>(je=E.Ea)(t);u.dynCall_viijii=(t,e,r,n,a,o,i)=>(u.dynCall_viijii=E.Fa)(t,e,r,n,a,o,i);var Re=u.dynCall_jiii=(t,e,r,n)=>(Re=u.dynCall_jiii=E.Ga)(t,e,r,n),Ie=u.dynCall_jiiii=(t,e,r,n,a)=>(Ie=u.dynCall_jiiii=E.Ha)(t,e,r,n,a);u.dynCall_iiiiij=(t,e,r,n,a,o,i)=>(u.dynCall_iiiiij=E.Ia)(t,e,r,n,a,o,i),u.dynCall_iiiiijj=(t,e,r,n,a,o,i,s,f)=>(u.dynCall_iiiiijj=E.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=E.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 ra(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 na(t,e,r){var n=$();try{T(t)(e,r)}catch(a){if(b(n),a!==a+0)throw a;w(1,0)}}function aa(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 oa(t,e){var r=$();try{T(t)(e)}catch(n){if(b(r),n!==n+0)throw n;w(1,0)}}function ia(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 sa(t){var e=$();try{T(t)()}catch(r){if(b(e),r!==r+0)throw r;w(1,0)}}function ua(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 ca(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 fa(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 la(t,e,r,n,a,o,i,s,f,l,h){var v=$();try{T(t)(e,r,n,a,o,i,s,f,l,h)}catch(m){if(b(v),m!==m+0)throw m;w(1,0)}}function da(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 pa(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 ya(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 va(t){var e=$();try{return T(t)()}catch(r){if(b(e),r!==r+0)throw r;w(1,0)}}function ma(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 ga(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 wa(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 $a(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 ba(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 Ca(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(v){if(b(h),v!==v+0)throw v;w(1,0)}}function _a(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 Ta(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(v){if(b(h),v!==v+0)throw v;w(1,0)}}function Pa(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 Ea(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 Aa(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 xa(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 Da(t,e,r,n,a,o,i,s,f,l,h,v){var m=$();try{return T(t)(e,r,n,a,o,i,s,f,l,h,v)}catch(C){if(b(m),C!==C+0)throw C;w(1,0)}}function Sa(t,e,r,n,a,o,i,s,f,l,h,v,m,C,A,I){var x=$();try{T(t)(e,r,n,a,o,i,s,f,l,h,v,m,C,A,I)}catch(W){if(b(x),W!==W+0)throw W;w(1,0)}}function Fa(t,e,r,n){var a=$();try{return Re(t,e,r,n)}catch(o){if(b(a),o!==o+0)throw o;w(1,0)}}function Oa(t,e,r,n,a){var o=$();try{return Ie(t,e,r,n,a)}catch(i){if(b(o),i!==i+0)throw i;w(1,0)}}var jt;dt=function t(){jt||We(),jt||(dt=t)};function We(){if(nt>0||(rr(),nt>0))return;function t(){jt||(jt=!0,u.calledRun=!0,!bt&&(nr(),g(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),ar()))}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 We(),p.ready}})();function Qa(c){return Ke(tr,c)}async function Ka(c,{tryHarder:p=rt.tryHarder,formats:u=rt.formats,maxSymbols:g=rt.maxSymbols}=rt){return qa(c,{tryHarder:p,formats:u,maxSymbols:g},tr)}const er=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 to(c){for(const[p,u]of er)if(c===u)return p;return"unknown"}var $t;class eo{constructor(p={}){Ue(this,$t,void 0);var u;try{const g=(u=p==null?void 0:p.formats)==null?void 0:u.filter(P=>P!=="unknown");if((g==null?void 0:g.length)===0)throw new TypeError("Hint option provided, but is empty.");g==null||g.forEach(P=>{if(!Ve.includes(P))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${P}' is not a valid enum value of type BarcodeFormat.`)}),Qa().catch(()=>{}),Be(this,$t,g??[])}catch(g){throw ze(g,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Ve.filter(p=>p!=="unknown")}async detect(p){try{const u=await Ua(p);if(u===null)return[];let g;try{g=await Ka(u,{tryHarder:!0,formats:ke(this,$t).map(P=>er.get(P))})}catch{throw new DOMException("Barcode detection service unavailable. Use 'setZXingModuleOverrides' in offline or strict CSP environments.","NotSupportedError")}return g.map(P=>{const{topLeft:{x:F,y:M},topRight:{x:N,y:k},bottomLeft:{x:j,y:L},bottomRight:{x:G,y:B}}=P.position,V=Math.min(F,N,j,G),X=Math.min(M,k,L,B),E=Math.max(F,N,j,G),bt=Math.max(M,k,L,B);return{boundingBox:new DOMRectReadOnly(V,X,E-V,bt-X),rawValue:new TextDecoder().decode(P.bytes),format:to(P.format),cornerPoints:[{x:F,y:M},{x:N,y:k},{x:G,y:B},{x:j,y:L}]}})}catch(u){throw ze(u,"Failed to execute 'detect' on 'BarcodeDetector'")}}}$t=new WeakMap;exports.BarcodeDetector=eo;exports.setZXingModuleOverrides=Xa; | ||
"use strict";var He=(c,p,u)=>{if(!p.has(c))throw TypeError("Cannot "+u)};var ke=(c,p,u)=>(He(c,p,"read from private field"),u?u.call(c):p.get(c)),Ue=(c,p,u)=>{if(p.has(c))throw TypeError("Cannot add the same private member more than once");p instanceof WeakSet?p.add(c):p.set(c,u)},Be=(c,p,u,$)=>(He(c,p,"write to private field"),$?$.call(c,u):p.set(c,u),u);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ve=["aztec","code_128","code_39","code_93","codabar","data_matrix","ean_13","ean_8","itf","pdf417","qr_code","upc_a","upc_e","unknown"];function Ra(c){if(Ge(c))return{width:c.naturalWidth,height:c.naturalHeight};if(Xe(c))return{width:c.width.baseVal.value,height:c.height.baseVal.value};if(qe(c))return{width:c.videoWidth,height:c.videoHeight};if(Ze(c))return{width:c.width,height:c.height};if(Ke(c))return{width:c.displayWidth,height:c.displayHeight};if(Je(c))return{width:c.width,height:c.height};if(Qe(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 Ge(c){try{return c instanceof HTMLImageElement}catch{return!1}}function Xe(c){try{return c instanceof SVGImageElement}catch{return!1}}function qe(c){try{return c instanceof HTMLVideoElement}catch{return!1}}function Je(c){try{return c instanceof HTMLCanvasElement}catch{return!1}}function Ze(c){try{return c instanceof ImageBitmap}catch{return!1}}function Qe(c){try{return c instanceof OffscreenCanvas}catch{return!1}}function Ke(c){try{return c instanceof VideoFrame}catch{return!1}}function Ia(c){try{return c instanceof Blob}catch{return!1}}function Wa(c){try{return c instanceof ImageData}catch{return!1}}function Ha(c,p){try{const u=new OffscreenCanvas(c,p);if(u.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return u;throw void 0}catch{const u=document.createElement("canvas");return u.width=c,u.height=p,u}}async function tr(c){if(Ge(c)&&!await Va(c))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Xe(c)&&!await za(c))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(Ke(c)&&La(c))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(qe(c)&&(c.readyState===0||c.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(Ze(c)&&Na(c))throw new DOMException("The image source is detached.","InvalidStateError");const{width:p,height:u}=Ra(c);if(p===0||u===0)return null;const g=Ha(p,u).getContext("2d");g.drawImage(c,0,0);try{return g.getImageData(0,0,p,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function ka(c){let p;try{p=await createImageBitmap(c)}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await tr(p)}function Ua(c){const{width:p,height:u}=c;if(p===0||u===0)return null;const $=c.getContext("2d");try{return $.getImageData(0,0,p,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Ba(c){if(Ia(c))return await ka(c);if(Wa(c)){if(Ya(c))throw new DOMException("The image data has been detached.","InvalidStateError");return c}return Je(c)||Qe(c)?Ua(c):await tr(c)}async function Va(c){try{return await c.decode(),!0}catch{return!1}}async function za(c){var p;try{return await((p=c.decode)==null?void 0:p.call(c)),!0}catch{return!1}}function La(c){return c.format===null}function Ya(c){return c.data.buffer.byteLength===0}function Na(c){return c.width===0&&c.height===0}function ze(c,p){return c instanceof DOMException?new DOMException(`${p}: ${c.message}`,c.name):c instanceof Error?new c.constructor(`${p}: ${c.message}`):new Error(`${p}: ${c}`)}const Le=c=>{let p;const u=new Set,$=(M,G)=>{const k=typeof M=="function"?M(p):M;if(!Object.is(k,p)){const j=p;p=G??typeof k!="object"?k:Object.assign({},p,k),u.forEach(Y=>Y(p,j))}},g=()=>p,E={setState:$,getState:g,subscribe:M=>(u.add(M),()=>u.delete(M)),destroy:()=>{u.clear()}};return p=c($,g,E),E},Ga=c=>c?Le(c):Le,Xa={locateFile:(c,p)=>{var u;const $=(u=c.match(/_(.+?)\.wasm$/))==null?void 0:u[1];return $?`https://cdn.jsdelivr.net/npm/@sec-ant/zxing-wasm@2.1.3/dist/${$}/${c}`:p+c}},lt=Ga()(()=>({zxingModuleWeakMap:new WeakMap,zxingModuleOverrides:Xa}));function qa(c){lt.setState({zxingModuleOverrides:c})}function er(c,p=lt.getState().zxingModuleOverrides){const{zxingModuleWeakMap:u}=lt.getState(),$=u.get(c);if($&&Object.is(p,lt.getState().zxingModuleOverrides))return $;{lt.setState({zxingModuleOverrides:p});const g=c(p);return u.set(c,g),g}}const Ye=["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"],rt={tryHarder:!0,formats:[],maxSymbols:255};async function Ja(c,{tryHarder:p=rt.tryHarder,formats:u=rt.formats,maxSymbols:$=rt.maxSymbols}=rt,g){const E=await er(g,lt.getState().zxingModuleOverrides),{data:M,width:G,height:k,data:{byteLength:j}}=c,Y=E._malloc(j);E.HEAP8.set(M,Y);const X=E.readBarcodesFromPixmap(Y,G,k,p,Za(u),$);E._free(Y);const V=[];for(let U=0;U<X.size();++U){const q=X.get(U);V.push({...q,format:Qa(q.format)})}return V}function Za(c){return c.join("|")}function Qa(c){const p=Ne(c);let u=0,$=Ye.length-1;for(;u<=$;){const g=Math.floor((u+$)/2),E=Ye[g],M=Ne(E);if(M===p)return E;M<p?u=g+1:$=g-1}return"None"}function Ne(c){return c.toLowerCase().replace(/_-\[\]/g,"")}var rr=(()=>{var c=typeof document>"u"?require("url").pathToFileURL(__filename).href:document.currentScript&&document.currentScript.src||new URL("pure.js",document.baseURI).href;return function(p={}){var u=p,$,g;u.ready=new Promise((t,e)=>{$=t,g=e});var E=Object.assign({},u),M="./this.program",G=typeof window=="object",k=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var j="";function Y(t){return u.locateFile?u.locateFile(t,j):j+t}var X;(G||k)&&(k?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="",k&&(X=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 V=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 U;u.wasmBinary&&(U=u.wasmBinary),u.noExitRuntime,typeof WebAssembly!="object"&&_t("no native wasm support detected");var q,A,bt=!1,z,B,ut,Ct,R,F,qt,Jt;function Zt(){var t=q.buffer;u.HEAP8=z=new Int8Array(t),u.HEAP16=ut=new Int16Array(t),u.HEAP32=R=new Int32Array(t),u.HEAPU8=B=new Uint8Array(t),u.HEAPU16=Ct=new Uint16Array(t),u.HEAPU32=F=new Uint32Array(t),u.HEAPF32=qt=new Float32Array(t),u.HEAPF64=Jt=new Float64Array(t)}var Qt,Kt=[],te=[],ee=[];function ar(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)sr(u.preRun.shift());It(Kt)}function or(){It(te)}function ir(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)cr(u.postRun.shift());It(ee)}function sr(t){Kt.unshift(t)}function ur(t){te.unshift(t)}function cr(t){ee.unshift(t)}var nt=0,dt=null;function fr(t){nt++,u.monitorRunDependencies&&u.monitorRunDependencies(nt)}function lr(t){if(nt--,u.monitorRunDependencies&&u.monitorRunDependencies(nt),nt==0&&dt){var e=dt;dt=null,e()}}function _t(t){u.onAbort&&u.onAbort(t),t="Aborted("+t+")",V(t),bt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw g(e),e}var dr="data:application/octet-stream;base64,";function re(t){return t.startsWith(dr)}var at;u.locateFile?(at="zxing_reader.wasm",re(at)||(at=Y(at))):at=new URL("/reader/zxing_reader.wasm",self.location).href;function ne(t){if(t==at&&U)return new Uint8Array(U);if(X)return X(t);throw"both async and sync fetching of the wasm failed"}function hr(t){return!U&&(G||k)&&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(()=>ne(t)):Promise.resolve().then(()=>ne(t))}function ae(t,e,r){return hr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{V("failed to asynchronously prepare wasm: "+n),_t(n)})}function pr(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!re(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(i){return V("wasm streaming compile failed: "+i),V("falling back to ArrayBuffer instantiation"),ae(e,r,n)})}):ae(e,r,n)}function yr(){var t={a:ra};function e(n,a){var o=n.exports;return A=o,q=A.qa,Zt(),Qt=A.ua,ur(A.ra),lr(),o}fr();function r(n){e(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(t,e)}catch(n){V("Module.instantiateWasm callback failed with error: "+n),g(n)}return pr(U,at,t,r).catch(g),{}}var It=t=>{for(;t.length>0;)t.shift()(u)},Tt=[],Pt=0;function vr(t){var e=new Et(t);return e.get_caught()||(e.set_caught(!0),Pt--),e.set_rethrown(!1),Tt.push(e),Oe(e.excPtr),e.get_exception_ptr()}var J=0;function mr(){w(0,0);var t=Tt.pop();Fe(t.excPtr),J=0}function Et(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,z[this.ptr+12>>0]=e},this.get_caught=function(){return z[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,z[this.ptr+13>>0]=e},this.get_rethrown=function(){return z[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=je(this.get_type());if(e)return F[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}function gr(t){throw J||(J=t),J}var Wt=t=>{var e=J;if(!e)return wt(0),0;var r=new Et(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return wt(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var i=r.ptr+16;if(Me(o,n,i))return wt(o),e}return wt(n),e},wr=()=>Wt([]),$r=t=>Wt([t]),br=(t,e)=>Wt([t,e]);function Cr(t){var e=new Et(t).get_exception_ptr();return e}function _r(){var t=Tt.pop();t||_t("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Tt.push(t),t.set_rethrown(!0),t.set_caught(!1),Pt++),J=e,J}function Tr(t,e,r){var n=new Et(t);throw n.init(e,r),J=t,Pt++,J}function Pr(){return Pt}var At={};function oe(t){for(;t.length;){var e=t.pop(),r=t.pop();r(e)}}function ht(t){return this.fromWireType(R[t>>2])}var ct={},ot={},Dt={},ie=void 0;function xt(t){throw new ie(t)}function it(t,e,r){t.forEach(function(s){Dt[s]=e});function n(s){var f=r(s);f.length!==t.length&&xt("Mismatched type converter count");for(var l=0;l<t.length;++l)Z(t[l],f[l])}var a=new Array(e.length),o=[],i=0;e.forEach((s,f)=>{ot.hasOwnProperty(s)?a[f]=ot[s]:(o.push(s),ct.hasOwnProperty(s)||(ct[s]=[]),ct[s].push(()=>{a[f]=ot[s],++i,i===o.length&&n(a)}))}),o.length===0&&n(a)}var Er=function(t){var e=At[t];delete At[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(i=>i.getterReturnType).concat(a.map(i=>i.setterArgumentType));it([t],o,i=>{var s={};return a.forEach((f,l)=>{var h=f.fieldName,v=i[l],m=f.getter,_=f.getterContext,D=i[l+a.length],I=f.setter,x=f.setterContext;s[h]={read:W=>v.fromWireType(m(_,W)),write:(W,d)=>{var y=[];I(x,W,D.toWireType(y,d)),oe(y)}}}),[{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 v=r();for(h in s)s[h].write(v,l[h]);return f!==null&&f.push(n,v),v},argPackAdvance:8,readValueFromPointer:ht,destructorFunction:n}]})};function Ar(t,e,r,n,a){}function Ht(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 Dr(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);se=t}var se=void 0;function H(t){for(var e="",r=t;B[r];)e+=se[B[r++]];return e}var ft=void 0;function T(t){throw new ft(t)}function xr(t,e,r={}){var n=e.name;if(t||T(`type "${n}" must have a positive integer typeid pointer`),ot.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(ot[t]=e,delete Dt[t],ct.hasOwnProperty(t)){var a=ct[t];delete ct[t],a.forEach(o=>o())}}function Z(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return xr(t,e,r)}function Sr(t,e,r,n,a){var o=Ht(r);e=H(e),Z(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=z;else if(r===2)s=ut;else if(r===4)s=R;else throw new TypeError("Unknown boolean type size: "+e);return this.fromWireType(s[i>>o])},destructorFunction:null})}function Fr(t){if(!(this instanceof tt)||!(t instanceof tt))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 Or(t){return{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}}function kt(t){function e(r){return r.$$.ptrType.registeredClass.name}T(e(t)+" instance already deleted")}var Ut=!1;function ue(t){}function Mr(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}function ce(t){t.count.value-=1;var e=t.count.value===0;e&&Mr(t)}function fe(t,e,r){if(e===r)return t;if(r.baseClass===void 0)return null;var n=fe(t,e,r.baseClass);return n===null?null:r.downcast(n)}var le={};function jr(){return Object.keys(vt).length}function Rr(){var t=[];for(var e in vt)vt.hasOwnProperty(e)&&t.push(vt[e]);return t}var pt=[];function Bt(){for(;pt.length;){var t=pt.pop();t.$$.deleteScheduled=!1,t.delete()}}var yt=void 0;function Ir(t){yt=t,pt.length&&yt&&yt(Bt)}function Wr(){u.getInheritedInstanceCount=jr,u.getLiveInheritedInstances=Rr,u.flushPendingDeletes=Bt,u.setDelayFunction=Ir}var vt={};function Hr(t,e){for(e===void 0&&T("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}function kr(t,e){return e=Hr(t,e),vt[e]}function St(t,e){(!e.ptrType||!e.ptr)&&xt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&xt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},mt(Object.create(t,{$$:{value:e}}))}function Ur(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=kr(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?St(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):St(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),i=le[o];if(!i)return a.call(this);var s;this.isConst?s=i.constPointerType:s=i.pointerType;var f=fe(e,this.registeredClass,s.registeredClass);return f===null?a.call(this):this.isSmartPointer?St(s.registeredClass.instancePrototype,{ptrType:s,ptr:f,smartPtrType:this,smartPtr:t}):St(s.registeredClass.instancePrototype,{ptrType:s,ptr:f})}var mt=function(t){return typeof FinalizationRegistry>"u"?(mt=e=>e,t):(Ut=new FinalizationRegistry(e=>{ce(e.$$)}),mt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Ut.register(e,a,e)}return e},ue=e=>Ut.unregister(e),mt(t))};function Br(){if(this.$$.ptr||kt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=mt(Object.create(Object.getPrototypeOf(this),{$$:{value:Or(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function Vr(){this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),ue(this),ce(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function zr(){return!this.$$.ptr}function Lr(){return this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),pt.push(this),pt.length===1&&yt&&yt(Bt),this.$$.deleteScheduled=!0,this}function Yr(){tt.prototype.isAliasOf=Fr,tt.prototype.clone=Br,tt.prototype.delete=Vr,tt.prototype.isDeleted=zr,tt.prototype.deleteLater=Lr}function tt(){}var Nr=48,Gr=57;function de(t){if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Nr&&e<=Gr?`_${t}`:t}function he(t,e){return t=de(t),{[t]:function(){return e.apply(this,arguments)}}[t]}function pe(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}}function ye(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`),pe(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 Xr(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 Vt(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 qr(t,e){if(e===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;e.$$||T(`Cannot pass "${Yt(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=Vt(e.$$.ptr,r,this.registeredClass);return n}function Jr(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 "${Yt(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=Vt(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,et.toHandle(function(){a.delete()})),t!==null&&t.push(this.rawDestructor,r)}break;default:T("Unsupporting sharing policy")}return r}function Zr(t,e){if(e===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;e.$$||T(`Cannot pass "${Yt(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=Vt(e.$$.ptr,r,this.registeredClass);return n}function Qr(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function Kr(t){this.rawDestructor&&this.rawDestructor(t)}function tn(t){t!==null&&t.delete()}function en(){Q.prototype.getPointee=Qr,Q.prototype.destructor=Kr,Q.prototype.argPackAdvance=8,Q.prototype.readValueFromPointer=ht,Q.prototype.deleteObject=tn,Q.prototype.fromWireType=Ur}function Q(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=qr,this.destructorFunction=null):(this.toWireType=Zr,this.destructorFunction=null):this.toWireType=Jr}function ve(t,e,r){u.hasOwnProperty(t)||xt("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 rn=(t,e,r)=>{var n=u["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},Ft=[],P=t=>{var e=Ft[t];return e||(t>=Ft.length&&(Ft.length=t+1),Ft[t]=e=Qt.get(t)),e},nn=(t,e,r)=>{if(t.includes("j"))return rn(t,e,r);var n=P(e).apply(null,r);return n},an=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),nn(t,e,r)}};function N(t,e){t=H(t);function r(){return t.includes("j")?an(t,e):P(e)}var n=r();return typeof n!="function"&&T(`unknown function pointer with signature ${t}: ${e}`),n}function on(t,e){var r=he(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+` | ||
`+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 me=void 0;function ge(t){var e=Se(t),r=H(e);return K(e),r}function Ot(t,e){var r=[],n={};function a(o){if(!n[o]&&!ot[o]){if(Dt[o]){Dt[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new me(`${t}: `+r.map(ge).join([", "]))}function sn(t,e,r,n,a,o,i,s,f,l,h,v,m){h=H(h),o=N(a,o),s&&(s=N(i,s)),l&&(l=N(f,l)),m=N(v,m);var _=de(h);ye(_,function(){Ot(`Cannot construct ${h} due to unbound types`,[n])}),it([t,e,r],n?[n]:[],function(D){D=D[0];var I,x;n?(I=D.registeredClass,x=I.instancePrototype):x=tt.prototype;var W=he(_,function(){if(Object.getPrototypeOf(this)!==d)throw new ft("Use 'new' to construct "+h);if(y.constructor_body===void 0)throw new ft(h+" has no accessible constructor");var Rt=y.constructor_body[arguments.length];if(Rt===void 0)throw new ft(`Tried to invoke ctor of ${h} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(y.constructor_body).toString()}) parameters instead!`);return Rt.apply(this,arguments)}),d=Object.create(x,{constructor:{value:W}});W.prototype=d;var y=new Xr(h,W,d,m,I,o,s,l);y.baseClass&&(y.baseClass.__derivedClasses===void 0&&(y.baseClass.__derivedClasses=[]),y.baseClass.__derivedClasses.push(y));var S=new Q(h,y,!0,!1,!1),O=new Q(h+"*",y,!1,!1,!1),st=new Q(h+" const*",y,!1,!0,!1);return le[t]={pointerType:O,constPointerType:st},ve(_,W),[S,O,st]})}function zt(t,e){for(var r=[],n=0;n<t;n++)r.push(F[e+n*4>>2]);return r}function Lt(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,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",v=i-2,m=new Array(v),_=[],D=[];return function(){arguments.length!==v&&T(`function ${t} called with ${arguments.length} arguments, expected ${v} args!`),D.length=0;var I;_.length=s?2:1,_[0]=a,s&&(I=e[1].toWireType(D,this),_[1]=I);for(var x=0;x<v;++x)m[x]=e[x+2].toWireType(D,arguments[x]),_.push(m[x]);var W=n.apply(null,_);function d(y){if(f)oe(D);else for(var S=s?1:2;S<e.length;S++){var O=S===1?I:m[S-2];e[S].destructorFunction!==null&&e[S].destructorFunction(O)}if(h)return e[0].fromWireType(y)}return d(W)}}function un(t,e,r,n,a,o){var i=zt(e,r);a=N(n,a),it([],[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 ft(`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]=()=>{Ot(`Cannot construct ${s.name} due to unbound types`,i)},it([],i,function(l){return l.splice(1,0,null),s.registeredClass.constructor_body[e-1]=Lt(f,l,null,a,o),[]}),[]})}function cn(t,e,r,n,a,o,i,s,f){var l=zt(r,n);e=H(e),o=N(a,o),it([],[t],function(h){h=h[0];var v=`${h.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&h.registeredClass.pureVirtualFunctions.push(e);function m(){Ot(`Cannot call ${v} due to unbound types`,l)}var _=h.registeredClass.instancePrototype,D=_[e];return D===void 0||D.overloadTable===void 0&&D.className!==h.name&&D.argCount===r-2?(m.argCount=r-2,m.className=h.name,_[e]=m):(pe(_,e,v),_[e].overloadTable[r-2]=m),it([],l,function(I){var x=Lt(v,I,h,o,i);return _[e].overloadTable===void 0?(x.argCount=r-2,_[e]=x):_[e].overloadTable[r-2]=x,[]}),[]})}function fn(){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 L=new we;function $e(t){t>=L.reserved&&--L.get(t).refcount===0&&L.free(t)}function ln(){for(var t=0,e=L.reserved;e<L.allocated.length;++e)L.allocated[e]!==void 0&&++t;return t}function dn(){L.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),L.reserved=L.allocated.length,u.count_emval_handles=ln}var et={toValue:t=>(t||T("Cannot use deleted val. handle = "+t),L.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 L.allocate({refcount:1,value:t})}}};function hn(t,e){e=H(e),Z(t,{name:e,fromWireType:function(r){var n=et.toValue(r);return $e(r),n},toWireType:function(r,n){return et.toHandle(n)},argPackAdvance:8,readValueFromPointer:ht,destructorFunction:null})}function Yt(t){if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t}function pn(t,e){switch(e){case 2:return function(r){return this.fromWireType(qt[r>>2])};case 3:return function(r){return this.fromWireType(Jt[r>>3])};default:throw new TypeError("Unknown float type: "+t)}}function yn(t,e,r){var n=Ht(r);e=H(e),Z(t,{name:e,fromWireType:function(a){return a},toWireType:function(a,o){return o},argPackAdvance:8,readValueFromPointer:pn(e,n),destructorFunction:null})}function vn(t,e,r,n,a,o,i){var s=zt(e,r);t=H(t),a=N(n,a),ye(t,function(){Ot(`Cannot call ${t} due to unbound types`,s)},e-1),it([],s,function(f){var l=[f[0],null].concat(f.slice(1));return ve(t,Lt(t,l,null,a,o),e-1),[]})}function mn(t,e,r){switch(e){case 0:return r?function(n){return z[n]}:function(n){return B[n]};case 1:return r?function(n){return ut[n>>1]}:function(n){return Ct[n>>1]};case 2:return r?function(n){return R[n>>2]}:function(n){return F[n>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function gn(t,e,r,n,a){e=H(e);var o=Ht(r),i=v=>v;if(n===0){var s=32-8*r;i=v=>v<<s>>>s}var f=e.includes("unsigned"),l=(v,m)=>{},h;f?h=function(v,m){return l(m,this.name),m>>>0}:h=function(v,m){return l(m,this.name),m},Z(t,{name:e,fromWireType:i,toWireType:h,argPackAdvance:8,readValueFromPointer:mn(e,o,n!==0),destructorFunction:null})}function wn(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=H(r),Z(t,{name:r,fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}var 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 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},$n=(t,e,r)=>be(t,B,e,r),Ce=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e},_e=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,bn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&_e)return _e.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},Nt=(t,e)=>t?bn(B,t,e):"";function Cn(t,e){e=H(e);var r=e==="std::string";Z(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||B[l]==0){var h=l-s,v=Nt(s,h);i===void 0?i=v:(i+=String.fromCharCode(0),i+=v),s=l+1}}else{for(var m=new Array(a),f=0;f<a;++f)m[f]=String.fromCharCode(B[o+f]);i=m.join("")}return K(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||T("Cannot pass non-string to std::string"),r&&i?o=Ce(a):o=a.length;var s=Xt(4+o+1),f=s+4;if(F[s>>2]=o,r&&i)$n(a,f,o+1);else if(i)for(var l=0;l<o;++l){var h=a.charCodeAt(l);h>255&&(K(f),T("String has UTF-16 code units that do not fit in 8 bits")),B[f+l]=h}else for(var l=0;l<o;++l)B[f+l]=a[l];return n!==null&&n.push(K,s),s},argPackAdvance:8,readValueFromPointer:ht,destructorFunction:function(n){K(n)}})}var Te=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,_n=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&Ct[n];)++n;if(r=n<<1,r-t>32&&Te)return Te.decode(B.subarray(t,r));for(var o="",i=0;!(i>=e/2);++i){var s=ut[t+i*2>>1];if(s==0)break;o+=String.fromCharCode(s)}return o},Tn=(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);ut[e>>1]=i,e+=2}return ut[e>>1]=0,e-n},Pn=t=>t.length*2,En=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=R[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},An=(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(R[e>>2]=i,e+=4,e+4>a)break}return R[e>>2]=0,e-n},Dn=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},xn=function(t,e,r){r=H(r);var n,a,o,i,s;e===2?(n=_n,a=Tn,i=Pn,o=()=>Ct,s=1):e===4&&(n=En,a=An,i=Dn,o=()=>F,s=2),Z(t,{name:r,fromWireType:function(f){for(var l=F[f>>2],h=o(),v,m=f+4,_=0;_<=l;++_){var D=f+4+_*e;if(_==l||h[D>>s]==0){var I=D-m,x=n(m,I);v===void 0?v=x:(v+=String.fromCharCode(0),v+=x),m=D+e}}return K(f),v},toWireType:function(f,l){typeof l!="string"&&T(`Cannot pass non-string to C++ string type ${r}`);var h=i(l),v=Xt(4+h+e);return F[v>>2]=h>>s,a(l,v+4,h+e),f!==null&&f.push(K,v),v},argPackAdvance:8,readValueFromPointer:ht,destructorFunction:function(f){K(f)}})};function Sn(t,e,r,n,a,o){At[t]={name:H(e),rawConstructor:N(r,n),rawDestructor:N(a,o),fields:[]}}function Fn(t,e,r,n,a,o,i,s,f,l){At[t].fields.push({fieldName:H(e),getterReturnType:r,getter:N(n,a),getterContext:o,setterArgumentType:i,setter:N(s,f),setterContext:l})}function On(t,e){e=H(e),Z(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:function(){},toWireType:function(r,n){}})}var Mn={};function jn(t){var e=Mn[t];return e===void 0?H(t):e}function Pe(){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 Rn(t){return t===0?et.toHandle(Pe()):(t=jn(t),et.toHandle(Pe()[t]))}function In(t){t>4&&(L.get(t).refcount+=1)}function Ee(t,e){var r=ot[t];return r===void 0&&T(e+" has unknown type "+ge(t)),r}function Wn(t){var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var i=Ee(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 et.toHandle(s)}}var Ae={};function Hn(t,e,r,n){t=et.toValue(t);var a=Ae[e];return a||(a=Wn(e),Ae[e]=a),a(t,r,n)}function kn(t,e){t=Ee(t,"_emval_take_value");var r=t.readValueFromPointer(e);return et.toHandle(r)}var Un=()=>{_t("")},Bn=(t,e,r)=>B.copyWithin(t,e,e+r),Vn=()=>2147483648,zn=t=>{var e=q.buffer,r=t-e.byteLength+65535>>>16;try{return q.grow(r),Zt(),1}catch{}},Ln=t=>{var e=B.length;t>>>=0;var r=Vn();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=zn(i);if(s)return!0}return!1},Gt={},Yn=()=>M||"./this.program",gt=()=>{if(!gt.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,_:Yn()};for(var r in Gt)Gt[r]===void 0?delete e[r]:e[r]=Gt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);gt.strings=n}return gt.strings},Nn=(t,e)=>{for(var r=0;r<t.length;++r)z[e++>>0]=t.charCodeAt(r);z[e>>0]=0},Gn=(t,e)=>{var r=0;return gt().forEach(function(n,a){var o=e+r;F[t+a*4>>2]=o,Nn(n,o),r+=n.length+1}),0},Xn=(t,e)=>{var r=gt();F[t>>2]=r.length;var n=0;return r.forEach(function(a){n+=a.length+1}),F[e>>2]=n,0};function qn(t){return t}var Mt=t=>t%4===0&&(t%100!==0||t%400===0),Jn=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},De=[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],Zn=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Mt(r.getFullYear()),a=r.getMonth(),o=(n?De: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 Qn(t,e,r){var n=r>0?r:Ce(t)+1,a=new Array(n),o=be(t,a,0,a.length);return e&&(a.length=o),a}var Kn=(t,e)=>{z.set(t,e)},ta=(t,e,r,n)=>{var a=R[n+40>>2],o={tm_sec:R[n>>2],tm_min:R[n+4>>2],tm_hour:R[n+8>>2],tm_mday:R[n+12>>2],tm_mon:R[n+16>>2],tm_year:R[n+20>>2],tm_wday:R[n+24>>2],tm_yday:R[n+28>>2],tm_isdst:R[n+32>>2],tm_gmtoff:R[n+36>>2],tm_zone:a?Nt(a):""},i=Nt(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 v(d,y,S){for(var O=typeof d=="number"?d.toString():d||"";O.length<y;)O=S[0]+O;return O}function m(d,y){return v(d,y,"0")}function _(d,y){function S(st){return st<0?-1:st>0?1:0}var O;return(O=S(d.getFullYear()-y.getFullYear()))===0&&(O=S(d.getMonth()-y.getMonth()))===0&&(O=S(d.getDate()-y.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 I(d){var y=Zn(new Date(d.tm_year+1900,0,1),d.tm_yday),S=new Date(y.getFullYear(),0,4),O=new Date(y.getFullYear()+1,0,4),st=D(S),Rt=D(O);return _(st,y)<=0?_(Rt,y)<=0?y.getFullYear()+1:y.getFullYear():y.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 y=d.tm_year+1900;return m(y/100|0,2)},"%d":d=>m(d.tm_mday,2),"%e":d=>v(d.tm_mday,2," "),"%g":d=>I(d).toString().substring(2),"%G":d=>I(d),"%H":d=>m(d.tm_hour,2),"%I":d=>{var y=d.tm_hour;return y==0?y=12:y>12&&(y-=12),m(y,2)},"%j":d=>m(d.tm_mday+Jn(Mt(d.tm_year+1900)?De:xe,d.tm_mon-1),3),"%m":d=>m(d.tm_mon+1,2),"%M":d=>m(d.tm_min,2),"%n":()=>` | ||
`,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>m(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var y=d.tm_yday+7-d.tm_wday;return m(Math.floor(y/7),2)},"%V":d=>{var y=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&y++,y){if(y==53){var S=(d.tm_wday+371-d.tm_yday)%7;S!=4&&(S!=3||!Mt(d.tm_year))&&(y=1)}}else{y=52;var O=(d.tm_wday+7-d.tm_yday-1)%7;(O==4||O==5&&Mt(d.tm_year%400-1))&&y++}return m(y,2)},"%w":d=>d.tm_wday,"%W":d=>{var y=d.tm_yday+7-(d.tm_wday+6)%7;return m(Math.floor(y/7),2)},"%y":d=>(d.tm_year+1900).toString().substring(2),"%Y":d=>d.tm_year+1900,"%z":d=>{var y=d.tm_gmtoff,S=y>=0;return y=Math.abs(y)/60,y=y/60*100+y%60,(S?"+":"-")+("0000"+y).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=Qn(i,!1);return W.length>e?0:(Kn(W,t),W.length-1)},ea=(t,e,r,n,a)=>ta(t,e,r,n);ie=u.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Dr(),ft=u.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},Yr(),Wr(),en(),me=u.UnboundTypeError=on(Error,"UnboundTypeError"),fn(),dn();var ra={q:vr,u:mr,a:wr,h:$r,l:br,I:Cr,P:_r,n:Tr,ba:Pr,d:gr,oa:Er,Y:Ar,fa:Sr,na:sn,ma:un,D:cn,ea:hn,W:yn,J:vn,w:gn,s:wn,V:Cn,L:xn,Q:Sn,pa:Fn,ga:On,U:$e,la:Rn,R:In,ia:Hn,ka:kn,K:Un,da:Bn,ca:Ln,$:Gn,aa:Xn,H:ba,T:Sa,B:_a,p:ga,b:na,C:$a,ha:Pa,c:ua,j:fa,i:ia,x:Ca,O:wa,v:va,G:Aa,N:Da,A:Ta,F:Fa,Z:Ma,X:ja,k:ca,f:sa,e:oa,g:aa,M:xa,m:ya,o:la,S:da,t:pa,ja:ma,y:Ea,r:ha,E:Oa,z:qn,_:ea};yr();var K=u._free=t=>(K=u._free=A.sa)(t),Xt=u._malloc=t=>(Xt=u._malloc=A.ta)(t),Se=t=>(Se=A.va)(t);u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=A.wa)();var w=(t,e)=>(w=A.xa)(t,e),wt=t=>(wt=A.ya)(t),b=()=>(b=A.za)(),C=t=>(C=A.Aa)(t),Fe=t=>(Fe=A.Ba)(t),Oe=t=>(Oe=A.Ca)(t),Me=(t,e,r)=>(Me=A.Da)(t,e,r),je=t=>(je=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 Re=u.dynCall_jiii=(t,e,r,n)=>(Re=u.dynCall_jiii=A.Ga)(t,e,r,n),Ie=u.dynCall_jiiii=(t,e,r,n,a)=>(Ie=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 na(t,e){var r=b();try{return P(t)(e)}catch(n){if(C(r),n!==n+0)throw n;w(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;w(1,0)}}function oa(t,e,r){var n=b();try{P(t)(e,r)}catch(a){if(C(n),a!==a+0)throw a;w(1,0)}}function ia(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;w(1,0)}}function sa(t,e){var r=b();try{P(t)(e)}catch(n){if(C(r),n!==n+0)throw n;w(1,0)}}function ua(t,e,r){var n=b();try{return P(t)(e,r)}catch(a){if(C(n),a!==a+0)throw a;w(1,0)}}function ca(t){var e=b();try{P(t)()}catch(r){if(C(e),r!==r+0)throw r;w(1,0)}}function fa(t,e,r,n){var a=b();try{return P(t)(e,r,n)}catch(o){if(C(a),o!==o+0)throw o;w(1,0)}}function la(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;w(1,0)}}function da(t,e,r,n,a,o,i){var s=b();try{P(t)(e,r,n,a,o,i)}catch(f){if(C(s),f!==f+0)throw f;w(1,0)}}function ha(t,e,r,n,a,o,i,s,f,l,h){var v=b();try{P(t)(e,r,n,a,o,i,s,f,l,h)}catch(m){if(C(v),m!==m+0)throw m;w(1,0)}}function pa(t,e,r,n,a,o,i,s){var f=b();try{P(t)(e,r,n,a,o,i,s)}catch(l){if(C(f),l!==l+0)throw l;w(1,0)}}function ya(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;w(1,0)}}function va(t,e,r,n,a,o,i){var s=b();try{return P(t)(e,r,n,a,o,i)}catch(f){if(C(s),f!==f+0)throw f;w(1,0)}}function ma(t,e,r,n,a,o,i,s,f){var l=b();try{P(t)(e,r,n,a,o,i,s,f)}catch(h){if(C(l),h!==h+0)throw h;w(1,0)}}function ga(t){var e=b();try{return P(t)()}catch(r){if(C(e),r!==r+0)throw r;w(1,0)}}function wa(t,e,r,n,a,o,i){var s=b();try{return P(t)(e,r,n,a,o,i)}catch(f){if(C(s),f!==f+0)throw f;w(1,0)}}function $a(t,e,r,n){var a=b();try{return P(t)(e,r,n)}catch(o){if(C(a),o!==o+0)throw o;w(1,0)}}function ba(t,e,r,n){var a=b();try{return P(t)(e,r,n)}catch(o){if(C(a),o!==o+0)throw o;w(1,0)}}function Ca(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;w(1,0)}}function _a(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;w(1,0)}}function Ta(t,e,r,n,a,o,i,s,f,l){var h=b();try{return P(t)(e,r,n,a,o,i,s,f,l)}catch(v){if(C(h),v!==v+0)throw v;w(1,0)}}function Pa(t,e,r){var n=b();try{return P(t)(e,r)}catch(a){if(C(n),a!==a+0)throw a;w(1,0)}}function Ea(t,e,r,n,a,o,i,s,f,l){var h=b();try{P(t)(e,r,n,a,o,i,s,f,l)}catch(v){if(C(h),v!==v+0)throw v;w(1,0)}}function Aa(t,e,r,n,a,o,i,s){var f=b();try{return P(t)(e,r,n,a,o,i,s)}catch(l){if(C(f),l!==l+0)throw l;w(1,0)}}function Da(t,e,r,n,a,o,i,s,f){var l=b();try{return P(t)(e,r,n,a,o,i,s,f)}catch(h){if(C(l),h!==h+0)throw h;w(1,0)}}function xa(t,e,r,n,a,o,i){var s=b();try{P(t)(e,r,n,a,o,i)}catch(f){if(C(s),f!==f+0)throw f;w(1,0)}}function Sa(t,e,r,n){var a=b();try{return P(t)(e,r,n)}catch(o){if(C(a),o!==o+0)throw o;w(1,0)}}function Fa(t,e,r,n,a,o,i,s,f,l,h,v){var m=b();try{return P(t)(e,r,n,a,o,i,s,f,l,h,v)}catch(_){if(C(m),_!==_+0)throw _;w(1,0)}}function Oa(t,e,r,n,a,o,i,s,f,l,h,v,m,_,D,I){var x=b();try{P(t)(e,r,n,a,o,i,s,f,l,h,v,m,_,D,I)}catch(W){if(C(x),W!==W+0)throw W;w(1,0)}}function Ma(t,e,r,n){var a=b();try{return Re(t,e,r,n)}catch(o){if(C(a),o!==o+0)throw o;w(1,0)}}function ja(t,e,r,n,a){var o=b();try{return Ie(t,e,r,n,a)}catch(i){if(C(o),i!==i+0)throw i;w(1,0)}}var jt;dt=function t(){jt||We(),jt||(dt=t)};function We(){if(nt>0||(ar(),nt>0))return;function t(){jt||(jt=!0,u.calledRun=!0,!bt&&(or(),$(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),ir()))}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 We(),p.ready}})();function Ka(c){return er(rr,c)}async function to(c,{tryHarder:p=rt.tryHarder,formats:u=rt.formats,maxSymbols:$=rt.maxSymbols}=rt){return Ja(c,{tryHarder:p,formats:u,maxSymbols:$},rr)}const nr=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 eo(c){for(const[p,u]of nr)if(c===u)return p;return"unknown"}var $t;class ro extends EventTarget{constructor(u={}){var $;super();Ue(this,$t,void 0);try{const g=($=u==null?void 0:u.formats)==null?void 0:$.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(!Ve.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.`)}),Be(this,$t,g??[]),Ka().then(E=>{this.dispatchEvent(new CustomEvent("load",{detail:E}))}).catch(E=>{this.dispatchEvent(new CustomEvent("error",{detail:E}))})}catch(g){throw ze(g,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Ve.filter(u=>u!=="unknown")}async detect(u){try{const $=await Ba(u);if($===null)return[];let g;try{g=await to($,{tryHarder:!0,formats:ke(this,$t).map(E=>nr.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:G},topRight:{x:k,y:j},bottomLeft:{x:Y,y:X},bottomRight:{x:V,y:U}}=E.position,q=Math.min(M,k,Y,V),A=Math.min(G,j,X,U),bt=Math.max(M,k,Y,V),z=Math.max(G,j,X,U);return{boundingBox:new DOMRectReadOnly(q,A,bt-q,z-A),rawValue:new TextDecoder().decode(E.bytes),format:eo(E.format),cornerPoints:[{x:M,y:G},{x:k,y:j},{x:V,y:U},{x:Y,y:X}]}})}catch($){throw ze($,"Failed to execute 'detect' on 'BarcodeDetector'")}}}$t=new WeakMap;exports.BarcodeDetector=ro;exports.setZXingModuleOverrides=qa; |
/// <reference types="dom-webcodecs" /> | ||
export declare const BARCODE_DETECTOR_FORMATS: readonly ["aztec", "code_128", "code_39", "code_93", "codabar", "data_matrix", "ean_13", "ean_8", "itf", "pdf417", "qr_code", "upc_a", "upc_e", "unknown"]; | ||
export declare function getIntrinsicDimensionsOfCanvasImageSource(image: CanvasImageSourceWebCodecs): { | ||
width: number; | ||
height: number; | ||
}; | ||
export declare function isHTMLImageElement(image: ImageBitmapSourceWebCodecs): image is HTMLImageElement; | ||
export declare function isSVGImageElement(image: ImageBitmapSourceWebCodecs): image is SVGImageElement; | ||
export declare function isHTMLVideoElement(image: ImageBitmapSourceWebCodecs): image is HTMLVideoElement; | ||
export declare function isHTMLCanvasElement(image: ImageBitmapSourceWebCodecs): image is HTMLCanvasElement; | ||
export declare function isImageBitmap(image: ImageBitmapSourceWebCodecs): image is ImageBitmap; | ||
export declare function isOffscreenCanvas(image: ImageBitmapSourceWebCodecs): image is OffscreenCanvas; | ||
export declare function isVideoFrame(image: ImageBitmapSourceWebCodecs): image is VideoFrame; | ||
export declare function isBlob(image: ImageBitmapSourceWebCodecs): image is Blob; | ||
export declare function isImageData(image: ImageBitmapSourceWebCodecs): image is ImageData; | ||
export declare function createCanvas(width: number, height: number): OffscreenCanvas | HTMLCanvasElement; | ||
export declare function getImageDataFromCanvasImageSource(canvasImageSource: CanvasImageSourceWebCodecs): Promise<ImageData | null>; | ||
export declare function getImageDataFromBlob(blob: Blob): Promise<ImageData | null>; | ||
export declare function getImageDataFromImageBitmapSource(image: ImageBitmapSourceWebCodecs): Promise<ImageData | null>; | ||
export declare function isHTMLImageElementDecodable(image: HTMLImageElement): Promise<boolean>; | ||
declare global { | ||
@@ -26,6 +9,2 @@ interface SVGImageElement { | ||
} | ||
export declare function isSVGImageElementDecodable(image: SVGImageElement): Promise<boolean>; | ||
export declare function isVideoFrameClosed(image: VideoFrame): boolean; | ||
export declare function isImageDataArrayBufferDetached(image: ImageData): boolean; | ||
export declare function isImageBitmapClosed(imageBitmap: ImageBitmap): boolean; | ||
export declare function addPrefixToExceptionOrError(e: unknown, prefix: string): TypeError | DOMException; |
/// <reference types="dom-webcodecs" /> | ||
import { ZXingModule } from "@sec-ant/zxing-wasm/reader"; | ||
import { BARCODE_DETECTOR_FORMATS } from "./utils.js"; | ||
@@ -17,3 +18,14 @@ export type BarcodeFormat = (typeof BARCODE_DETECTOR_FORMATS)[number]; | ||
} | ||
export declare class BarcodeDetector { | ||
interface CustomEventMap { | ||
load: CustomEvent<ZXingModule<"reader">>; | ||
error: CustomEvent<unknown>; | ||
} | ||
type ChangeEventListener = <K extends keyof CustomEventMap>(type: K, callback: ((evt: CustomEventMap[K]) => void) | { | ||
handleEvent(evt: CustomEventMap[K]): void; | ||
} | null, options?: boolean | AddEventListenerOptions | undefined) => void; | ||
export interface BarcodeDetector { | ||
addEventListener: ChangeEventListener; | ||
removeEventListener: ChangeEventListener; | ||
} | ||
export declare class BarcodeDetector extends EventTarget { | ||
#private; | ||
@@ -20,0 +32,0 @@ constructor(barcodeDectorOptions?: BarcodeDetectorOptions); |
/// <reference types="dom-webcodecs" /> | ||
export declare const BARCODE_DETECTOR_FORMATS: readonly ["aztec", "code_128", "code_39", "code_93", "codabar", "data_matrix", "ean_13", "ean_8", "itf", "pdf417", "qr_code", "upc_a", "upc_e", "unknown"]; | ||
export declare function getIntrinsicDimensionsOfCanvasImageSource(image: CanvasImageSourceWebCodecs): { | ||
width: number; | ||
height: number; | ||
}; | ||
export declare function isHTMLImageElement(image: ImageBitmapSourceWebCodecs): image is HTMLImageElement; | ||
export declare function isSVGImageElement(image: ImageBitmapSourceWebCodecs): image is SVGImageElement; | ||
export declare function isHTMLVideoElement(image: ImageBitmapSourceWebCodecs): image is HTMLVideoElement; | ||
export declare function isHTMLCanvasElement(image: ImageBitmapSourceWebCodecs): image is HTMLCanvasElement; | ||
export declare function isImageBitmap(image: ImageBitmapSourceWebCodecs): image is ImageBitmap; | ||
export declare function isOffscreenCanvas(image: ImageBitmapSourceWebCodecs): image is OffscreenCanvas; | ||
export declare function isVideoFrame(image: ImageBitmapSourceWebCodecs): image is VideoFrame; | ||
export declare function isBlob(image: ImageBitmapSourceWebCodecs): image is Blob; | ||
export declare function isImageData(image: ImageBitmapSourceWebCodecs): image is ImageData; | ||
export declare function createCanvas(width: number, height: number): OffscreenCanvas | HTMLCanvasElement; | ||
export declare function getImageDataFromCanvasImageSource(canvasImageSource: CanvasImageSourceWebCodecs): Promise<ImageData | null>; | ||
export declare function getImageDataFromBlob(blob: Blob): Promise<ImageData | null>; | ||
export declare function getImageDataFromImageBitmapSource(image: ImageBitmapSourceWebCodecs): Promise<ImageData | null>; | ||
export declare function isHTMLImageElementDecodable(image: HTMLImageElement): Promise<boolean>; | ||
declare global { | ||
@@ -26,6 +9,2 @@ interface SVGImageElement { | ||
} | ||
export declare function isSVGImageElementDecodable(image: SVGImageElement): Promise<boolean>; | ||
export declare function isVideoFrameClosed(image: VideoFrame): boolean; | ||
export declare function isImageDataArrayBufferDetached(image: ImageData): boolean; | ||
export declare function isImageBitmapClosed(imageBitmap: ImageBitmap): boolean; | ||
export declare function addPrefixToExceptionOrError(e: unknown, prefix: string): TypeError | DOMException; |
@@ -1,3 +0,3 @@ | ||
var er=(M,B,z)=>{if(!B.has(M))throw TypeError("Cannot "+z)};var rr=(M,B,z)=>(er(M,B,"read from private field"),z?z.call(M):B.get(M)),nr=(M,B,z)=>{if(B.has(M))throw TypeError("Cannot add the same private member more than once");B instanceof WeakSet?B.add(M):B.set(M,z)},ar=(M,B,z,yt)=>(er(M,B,"write to private field"),yt?yt.call(M,z):B.set(M,z),z);var BarcodeDetectionAPI=function(M){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 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(or(c))return{width:c.width,height:c.height};if(ee(c))return{width:c.width,height:c.height};if(ir(c))return{width:c.width,height:c.height};if(re(c))return{width:c.displayWidth,height:c.displayHeight};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 or(c){try{return c instanceof HTMLCanvasElement}catch{return!1}}function ee(c){try{return c instanceof ImageBitmap}catch{return!1}}function ir(c){try{return c instanceof OffscreenCanvas}catch{return!1}}function re(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,v){try{const u=new OffscreenCanvas(c,v);if(u.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return u;throw void 0}catch{const u=document.createElement("canvas");return u.width=c,u.height=v,u}}async function ne(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(re(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(ee(c)&&vr(c))throw new DOMException("The image source is detached.","InvalidStateError");const{width:v,height:u}=z(c);if(v===0||u===0)return null;const P=cr(v,u).getContext("2d");P.drawImage(c,0,0);try{return P.getImageData(0,0,v,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function fr(c){let v;try{v=await createImageBitmap(c)}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await ne(v)}async function lr(c){if(sr(c))return await fr(c);if(ur(c)){if(yr(c))throw new DOMException("The image data has been detached.","InvalidStateError");return c}return await ne(c)}async function dr(c){try{return await c.decode(),!0}catch{return!1}}async function hr(c){var v;try{return await((v=c.decode)==null?void 0:v.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 ae(c,v){return c instanceof DOMException?new DOMException(`${v}: ${c.message}`,c.name):c instanceof Error?new c.constructor(`${v}: ${c.message}`):new Error(`${v}: ${c}`)}const oe=c=>{let v;const u=new Set,w=(j,q)=>{const U=typeof j=="function"?j(v):j;if(!Object.is(U,v)){const R=v;v=q??typeof U!="object"?U:Object.assign({},v,U),u.forEach(G=>G(v,R))}},P=()=>v,F={setState:w,getState:P,subscribe:j=>(u.add(j),()=>u.delete(j)),destroy:()=>{u.clear()}};return v=c(w,P,F),F},mr=c=>c?oe(c):oe,gr={locateFile:(c,v)=>{var u;const w=(u=c.match(/_(.+?)\.wasm$/))==null?void 0:u[1];return w?`https://cdn.jsdelivr.net/npm/@sec-ant/zxing-wasm@2.1.3/dist/${w}/${c}`:v+c}},lt=mr()(()=>({zxingModuleWeakMap:new WeakMap,zxingModuleOverrides:gr}));function wr(c){lt.setState({zxingModuleOverrides:c})}function ie(c,v=lt.getState().zxingModuleOverrides){const{zxingModuleWeakMap:u}=lt.getState(),w=u.get(c);if(w&&Object.is(v,lt.getState().zxingModuleOverrides))return w;{lt.setState({zxingModuleOverrides:v});const P=c(v);return u.set(c,P),P}}const se=["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:v=nt.tryHarder,formats:u=nt.formats,maxSymbols:w=nt.maxSymbols}=nt,P){const F=await ie(P,lt.getState().zxingModuleOverrides),{data:j,width:q,height:U,data:{byteLength:R}}=c,G=F._malloc(R);F.HEAP8.set(j,G);const J=F.readBarcodesFromPixmap(G,q,U,v,br(u),w);F._free(G);const L=[];for(let Y=0;Y<J.size();++Y){const Z=J.get(Y);L.push({...Z,format:Cr(Z.format)})}return L}function br(c){return c.join("|")}function Cr(c){const v=ue(c);let u=0,w=se.length-1;for(;u<=w;){const P=Math.floor((u+w)/2),F=se[P],j=ue(F);if(j===v)return F;j<v?u=P+1:w=P-1}return"None"}function ue(c){return c.toLowerCase().replace(/_-\[\]/g,"")}var ce=(()=>{var c=document.currentScript&&document.currentScript.src||new URL("index.js",document.baseURI).href;return function(v={}){var u=v,w,P;u.ready=new Promise((t,e)=>{w=t,P=e});var F=Object.assign({},u),j="./this.program",q=typeof window=="object",U=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var R="";function G(t){return u.locateFile?u.locateFile(t,R):R+t}var J;(q||U)&&(U?R=self.location.href:typeof document<"u"&&document.currentScript&&(R=document.currentScript.src),c&&(R=c),R.indexOf("blob:")!==0?R=R.substr(0,R.replace(/[?#].*/,"").lastIndexOf("/")+1):R="",U&&(J=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 L=u.printErr||console.error.bind(console);Object.assign(u,F),F=null,u.arguments&&u.arguments,u.thisProgram&&(j=u.thisProgram),u.quit&&u.quit;var Y;u.wasmBinary&&(Y=u.wasmBinary),u.noExitRuntime,typeof WebAssembly!="object"&&At("no native wasm support detected");var Z,E,Pt=!1,Q,V,dt,Et,I,x,de,he;function pe(){var t=Z.buffer;u.HEAP8=Q=new Int8Array(t),u.HEAP16=dt=new Int16Array(t),u.HEAP32=I=new Int32Array(t),u.HEAPU8=V=new Uint8Array(t),u.HEAPU16=Et=new Uint16Array(t),u.HEAPU32=x=new Uint32Array(t),u.HEAPF32=de=new Float32Array(t),u.HEAPF64=he=new Float64Array(t)}var ye,ve=[],me=[],ge=[];function Er(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Sr(u.preRun.shift());Bt(ve)}function Ar(){Bt(me)}function Dr(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Fr(u.postRun.shift());Bt(ge)}function Sr(t){ve.unshift(t)}function xr(t){me.unshift(t)}function Fr(t){ge.unshift(t)}var it=0,mt=null;function Or(t){it++,u.monitorRunDependencies&&u.monitorRunDependencies(it)}function Mr(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+")",L(t),Pt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw P(e),e}var jr="data:application/octet-stream;base64,";function we(t){return t.startsWith(jr)}var st;u.locateFile?(st="zxing_reader.wasm",we(st)||(st=G(st))):st=new URL("/reader/zxing_reader.wasm",self.location).href;function $e(t){if(t==st&&Y)return new Uint8Array(Y);if(J)return J(t);throw"both async and sync fetching of the wasm failed"}function Rr(t){return!Y&&(q||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(()=>$e(t)):Promise.resolve().then(()=>$e(t))}function be(t,e,r){return Rr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{L("failed to asynchronously prepare wasm: "+n),At(n)})}function Ir(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!we(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(i){return L("wasm streaming compile failed: "+i),L("falling back to ArrayBuffer instantiation"),be(e,r,n)})}):be(e,r,n)}function Wr(){var t={a:Ta};function e(n,a){var o=n.exports;return E=o,Z=E.qa,pe(),ye=E.ua,xr(E.ra),Mr(),o}Or();function r(n){e(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(t,e)}catch(n){L("Module.instantiateWasm callback failed with error: "+n),P(n)}return Ir(Y,st,t,r).catch(P),{}}var Bt=t=>{for(;t.length>0;)t.shift()(u)},Dt=[],St=0;function Hr(t){var e=new xt(t);return e.get_caught()||(e.set_caught(!0),St--),e.set_rethrown(!1),Dt.push(e),qe(e.excPtr),e.get_exception_ptr()}var K=0;function kr(){g(0,0);var t=Dt.pop();Xe(t.excPtr),K=0}function xt(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,Q[this.ptr+12>>0]=e},this.get_caught=function(){return Q[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,Q[this.ptr+13>>0]=e},this.get_rethrown=function(){return Q[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=Ze(this.get_type());if(e)return x[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}function Br(t){throw K||(K=t),K}var Ut=t=>{var e=K;if(!e)return Tt(0),0;var r=new xt(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(Je(o,n,i))return Tt(o),e}return Tt(n),e},Ur=()=>Ut([]),Vr=t=>Ut([t]),zr=(t,e)=>Ut([t,e]);function Lr(t){var e=new xt(t).get_exception_ptr();return e}function Yr(){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),St++),K=e,K}function Nr(t,e,r){var n=new xt(t);throw n.init(e,r),K=t,St++,K}function Gr(){return St}var Ft={};function Ce(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={},_e=void 0;function Mt(t){throw new _e(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 Xr=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],m=f.getter,C=f.getterContext,A=i[l+a.length],W=f.setter,D=f.setterContext;s[h]={read:H=>y.fromWireType(m(C,H)),write:(H,d)=>{var p=[];W(D,H,A.toWireType(p,d)),Ce(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 qr(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 Jr(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);Te=t}var Te=void 0;function k(t){for(var e="",r=t;V[r];)e+=Te[V[r++]];return e}var pt=void 0;function _(t){throw new pt(t)}function Zr(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 Zr(t,e,r)}function Qr(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=Q;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 Kr(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 tn(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 Pe(t){}function en(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}function Ee(t){t.count.value-=1;var e=t.count.value===0;e&&en(t)}function 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)}var De={};function rn(){return Object.keys(bt).length}function nn(){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 an(t){$t=t,wt.length&&$t&&$t(Yt)}function on(){u.getInheritedInstanceCount=rn,u.getLiveInheritedInstances=nn,u.flushPendingDeletes=Yt,u.setDelayFunction=an}var bt={};function sn(t,e){for(e===void 0&&_("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}function un(t,e){return e=sn(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 cn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=un(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=De[o];if(!i)return a.call(this);var s;this.isConst?s=i.constPointerType:s=i.pointerType;var f=Ae(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=>{Ee(e.$$)}),Ct=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Lt.register(e,a,e)}return e},Pe=e=>Lt.unregister(e),Ct(t))};function fn(){if(this.$$.ptr||zt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Ct(Object.create(Object.getPrototypeOf(this),{$$:{value:tn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function ln(){this.$$.ptr||zt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&_("Object already scheduled for deletion"),Pe(this),Ee(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function dn(){return!this.$$.ptr}function hn(){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 pn(){at.prototype.isAliasOf=Kr,at.prototype.clone=fn,at.prototype.delete=ln,at.prototype.isDeleted=dn,at.prototype.deleteLater=hn}function at(){}var yn=48,vn=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>=yn&&e<=vn?`_${t}`:t}function xe(t,e){return t=Se(t),{[t]:function(){return e.apply(this,arguments)}}[t]}function Fe(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 Oe(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`),Fe(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 mn(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 gn(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 wn(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 $n(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 bn(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function Cn(t){this.rawDestructor&&this.rawDestructor(t)}function _n(t){t!==null&&t.delete()}function Tn(){et.prototype.getPointee=bn,et.prototype.destructor=Cn,et.prototype.argPackAdvance=8,et.prototype.readValueFromPointer=gt,et.prototype.deleteObject=_n,et.prototype.fromWireType=cn}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=gn,this.destructorFunction=null):(this.toWireType=$n,this.destructorFunction=null):this.toWireType=wn}function Me(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 Pn=(t,e,r)=>{var n=u["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},Rt=[],T=t=>{var e=Rt[t];return e||(t>=Rt.length&&(Rt.length=t+1),Rt[t]=e=ye.get(t)),e},En=(t,e,r)=>{if(t.includes("j"))return Pn(t,e,r);var n=T(e).apply(null,r);return n},An=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),En(t,e,r)}};function X(t,e){t=k(t);function r(){return t.includes("j")?An(t,e):T(e)}var n=r();return typeof n!="function"&&_(`unknown function pointer with signature ${t}: ${e}`),n}function Dn(t,e){var r=xe(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+` | ||
`+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 je=void 0;function Re(t){var e=Ge(t),r=k(e);return rt(e),r}function It(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 je(`${t}: `+r.map(Re).join([", "]))}function Sn(t,e,r,n,a,o,i,s,f,l,h,y,m){h=k(h),o=X(a,o),s&&(s=X(i,s)),l&&(l=X(f,l)),m=X(y,m);var C=Se(h);Oe(C,function(){It(`Cannot construct ${h} due to unbound types`,[n])}),ct([t,e,r],n?[n]:[],function(A){A=A[0];var W,D;n?(W=A.registeredClass,D=W.instancePrototype):D=at.prototype;var H=xe(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(D,{constructor:{value:H}});H.prototype=d;var p=new mn(h,H,d,m,W,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 De[t]={pointerType:O,constPointerType:ft},Me(C,H),[S,O,ft]})}function 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&&_("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,m=new Array(y),C=[],A=[];return function(){arguments.length!==y&&_(`function ${t} called with ${arguments.length} arguments, expected ${y} args!`),A.length=0;var W;C.length=s?2:1,C[0]=a,s&&(W=e[1].toWireType(A,this),C[1]=W);for(var D=0;D<y;++D)m[D]=e[D+2].toWireType(A,arguments[D]),C.push(m[D]);var H=n.apply(null,C);function d(p){if(f)Ce(A);else for(var S=s?1:2;S<e.length;S++){var O=S===1?W:m[S-2];e[S].destructorFunction!==null&&e[S].destructorFunction(O)}if(h)return e[0].fromWireType(p)}return d(H)}}function xn(t,e,r,n,a,o){var i=Gt(e,r);a=X(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]=()=>{It(`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 Fn(t,e,r,n,a,o,i,s,f){var l=Gt(r,n);e=k(e),o=X(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 m(){It(`Cannot call ${y} due to unbound types`,l)}var C=h.registeredClass.instancePrototype,A=C[e];return A===void 0||A.overloadTable===void 0&&A.className!==h.name&&A.argCount===r-2?(m.argCount=r-2,m.className=h.name,C[e]=m):(Fe(C,e,y),C[e].overloadTable[r-2]=m),ct([],l,function(W){var D=Xt(y,W,h,o,i);return C[e].overloadTable===void 0?(D.argCount=r-2,C[e]=D):C[e].overloadTable[r-2]=D,[]}),[]})}function On(){Object.assign(Ie.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 Ie(){this.allocated=[void 0],this.freelist=[]}var N=new Ie;function We(t){t>=N.reserved&&--N.get(t).refcount===0&&N.free(t)}function Mn(){for(var t=0,e=N.reserved;e<N.allocated.length;++e)N.allocated[e]!==void 0&&++t;return t}function jn(){N.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),N.reserved=N.allocated.length,u.count_emval_handles=Mn}var ot={toValue:t=>(t||_("Cannot use deleted val. handle = "+t),N.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 N.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 We(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 In(t,e){switch(e){case 2:return function(r){return this.fromWireType(de[r>>2])};case 3:return function(r){return this.fromWireType(he[r>>3])};default:throw new TypeError("Unknown float type: "+t)}}function Wn(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:In(e,n),destructorFunction:null})}function Hn(t,e,r,n,a,o,i){var s=Gt(e,r);t=k(t),a=X(n,a),Oe(t,function(){It(`Cannot call ${t} due to unbound types`,s)},e-1),ct([],s,function(f){var l=[f[0],null].concat(f.slice(1));return Me(t,Xt(t,l,null,a,o),e-1),[]})}function kn(t,e,r){switch(e){case 0:return r?function(n){return Q[n]}:function(n){return V[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 x[n>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function Bn(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,m)=>{},h;f?h=function(y,m){return l(m,this.name),m>>>0}:h=function(y,m){return l(m,this.name),m},tt(t,{name:e,fromWireType:i,toWireType:h,argPackAdvance:8,readValueFromPointer:kn(e,o,n!==0),destructorFunction:null})}function Un(t,e,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(i){i=i>>2;var s=x,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 He=(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},Vn=(t,e,r)=>He(t,V,e,r),ke=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},Be=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,zn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&Be)return Be.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?zn(V,t,e):"";function Ln(t,e){e=k(e);var r=e==="std::string";tt(t,{name:e,fromWireType:function(n){var a=x[n>>2],o=n+4,i;if(r)for(var s=o,f=0;f<=a;++f){var l=o+f;if(f==a||V[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 m=new Array(a),f=0;f<a;++f)m[f]=String.fromCharCode(V[o+f]);i=m.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=ke(a):o=a.length;var s=Qt(4+o+1),f=s+4;if(x[s>>2]=o,r&&i)Vn(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")),V[f+l]=h}else for(var l=0;l<o;++l)V[f+l]=a[l];return n!==null&&n.push(rt,s),s},argPackAdvance:8,readValueFromPointer:gt,destructorFunction:function(n){rt(n)}})}var Ue=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Yn=(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&&Ue)return Ue.decode(V.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},Nn=(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},Gn=t=>t.length*2,Xn=(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},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(I[e>>2]=i,e+=4,e+4>a)break}return I[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},Zn=function(t,e,r){r=k(r);var n,a,o,i,s;e===2?(n=Yn,a=Nn,i=Gn,o=()=>Et,s=1):e===4&&(n=Xn,a=qn,i=Jn,o=()=>x,s=2),tt(t,{name:r,fromWireType:function(f){for(var l=x[f>>2],h=o(),y,m=f+4,C=0;C<=l;++C){var A=f+4+C*e;if(C==l||h[A>>s]==0){var W=A-m,D=n(m,W);y===void 0?y=D:(y+=String.fromCharCode(0),y+=D),m=A+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 x[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 Qn(t,e,r,n,a,o){Ft[t]={name:k(e),rawConstructor:X(r,n),rawDestructor:X(a,o),fields:[]}}function Kn(t,e,r,n,a,o,i,s,f,l){Ft[t].fields.push({fieldName:k(e),getterReturnType:r,getter:X(n,a),getterContext:o,setterArgumentType:i,setter:X(s,f),setterContext:l})}function ta(t,e){e=k(e),tt(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:function(){},toWireType:function(r,n){}})}var ea={};function ra(t){var e=ea[t];return e===void 0?k(t):e}function Ve(){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 na(t){return t===0?ot.toHandle(Ve()):(t=ra(t),ot.toHandle(Ve()[t]))}function aa(t){t>4&&(N.get(t).refcount+=1)}function ze(t,e){var r=ut[t];return r===void 0&&_(e+" has unknown type "+Re(t)),r}function oa(t){var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var i=ze(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 ot.toHandle(s)}}var Le={};function ia(t,e,r,n){t=ot.toValue(t);var a=Le[e];return a||(a=oa(e),Le[e]=a),a(t,r,n)}function sa(t,e){t=ze(t,"_emval_take_value");var r=t.readValueFromPointer(e);return ot.toHandle(r)}var ua=()=>{At("")},ca=(t,e,r)=>V.copyWithin(t,e,e+r),fa=()=>2147483648,la=t=>{var e=Z.buffer,r=t-e.byteLength+65535>>>16;try{return Z.grow(r),pe(),1}catch{}},da=t=>{var e=V.length;t>>>=0;var r=fa();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=la(i);if(s)return!0}return!1},Zt={},ha=()=>j||"./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,_:ha()};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},pa=(t,e)=>{for(var r=0;r<t.length;++r)Q[e++>>0]=t.charCodeAt(r);Q[e>>0]=0},ya=(t,e)=>{var r=0;return _t().forEach(function(n,a){var o=e+r;x[t+a*4>>2]=o,pa(n,o),r+=n.length+1}),0},va=(t,e)=>{var r=_t();x[t>>2]=r.length;var n=0;return r.forEach(function(a){n+=a.length+1}),x[e>>2]=n,0};function ma(t){return t}var Wt=t=>t%4===0&&(t%100!==0||t%400===0),ga=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Ye=[31,29,31,30,31,30,31,31,30,31,30,31],Ne=[31,28,31,30,31,30,31,31,30,31,30,31],wa=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Wt(r.getFullYear()),a=r.getMonth(),o=(n?Ye:Ne)[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 $a(t,e,r){var n=r>0?r:ke(t)+1,a=new Array(n),o=He(t,a,0,a.length);return e&&(a.length=o),a}var ba=(t,e)=>{Q.set(t,e)},Ca=(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 m(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 A(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 W(d){var p=wa(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=A(S),kt=A(O);return C(ft,p)<=0?C(kt,p)<=0?p.getFullYear()+1:p.getFullYear():p.getFullYear()-1}var D={"%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 m(p/100|0,2)},"%d":d=>m(d.tm_mday,2),"%e":d=>y(d.tm_mday,2," "),"%g":d=>W(d).toString().substring(2),"%G":d=>W(d),"%H":d=>m(d.tm_hour,2),"%I":d=>{var p=d.tm_hour;return p==0?p=12:p>12&&(p-=12),m(p,2)},"%j":d=>m(d.tm_mday+ga(Wt(d.tm_year+1900)?Ye:Ne,d.tm_mon-1),3),"%m":d=>m(d.tm_mon+1,2),"%M":d=>m(d.tm_min,2),"%n":()=>` | ||
`,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>m(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var p=d.tm_yday+7-d.tm_wday;return m(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 m(p,2)},"%w":d=>d.tm_wday,"%W":d=>{var p=d.tm_yday+7-(d.tm_wday+6)%7;return m(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 D)i.includes(f)&&(i=i.replace(new RegExp(f,"g"),D[f](o)));i=i.replace(/\0\0/g,"%");var H=$a(i,!1);return H.length>e?0:(ba(H,t),H.length-1)},_a=(t,e,r,n,a)=>Ca(t,e,r,n);_e=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"}},pn(),on(),Tn(),je=u.UnboundTypeError=Dn(Error,"UnboundTypeError"),On(),jn();var Ta={q:Hr,u:kr,a:Ur,h:Vr,l:zr,I:Lr,P:Yr,n:Nr,ba:Gr,d:Br,oa:Xr,Y:qr,fa:Qr,na:Sn,ma:xn,D:Fn,ea:Rn,W:Wn,J:Hn,w:Bn,s:Un,V:Ln,L:Zn,Q:Qn,pa:Kn,ga:ta,U:We,la:na,R:aa,ia,ka:sa,K:ua,da:ca,ca:da,$:ya,aa:va,H:za,T:Qa,B:Ya,p:Ba,b:Pa,C:Va,ha:Ga,c:xa,j:Oa,i:Da,x:La,O:Ua,v:Ha,G:qa,N:Ja,A:Na,F:Ka,Z:eo,X:ro,k:Fa,f:Sa,e:Aa,g:Ea,M:Za,m:Wa,o:Ma,S:ja,t:Ia,ja:ka,y:Xa,r:Ra,E:to,z:ma,_:_a};Wr();var rt=u._free=t=>(rt=u._free=E.sa)(t),Qt=u._malloc=t=>(Qt=u._malloc=E.ta)(t),Ge=t=>(Ge=E.va)(t);u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=E.wa)();var g=(t,e)=>(g=E.xa)(t,e),Tt=t=>(Tt=E.ya)(t),$=()=>($=E.za)(),b=t=>(b=E.Aa)(t),Xe=t=>(Xe=E.Ba)(t),qe=t=>(qe=E.Ca)(t),Je=(t,e,r)=>(Je=E.Da)(t,e,r),Ze=t=>(Ze=E.Ea)(t);u.dynCall_viijii=(t,e,r,n,a,o,i)=>(u.dynCall_viijii=E.Fa)(t,e,r,n,a,o,i);var Qe=u.dynCall_jiii=(t,e,r,n)=>(Qe=u.dynCall_jiii=E.Ga)(t,e,r,n),Ke=u.dynCall_jiiii=(t,e,r,n,a)=>(Ke=u.dynCall_jiiii=E.Ha)(t,e,r,n,a);u.dynCall_iiiiij=(t,e,r,n,a,o,i)=>(u.dynCall_iiiiij=E.Ia)(t,e,r,n,a,o,i),u.dynCall_iiiiijj=(t,e,r,n,a,o,i,s,f)=>(u.dynCall_iiiiijj=E.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=E.Ka)(t,e,r,n,a,o,i,s,f,l);function Pa(t,e){var r=$();try{return T(t)(e)}catch(n){if(b(r),n!==n+0)throw n;g(1,0)}}function Ea(t,e,r,n){var a=$();try{T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(1,0)}}function Aa(t,e,r){var n=$();try{T(t)(e,r)}catch(a){if(b(n),a!==a+0)throw a;g(1,0)}}function Da(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;g(1,0)}}function Sa(t,e){var r=$();try{T(t)(e)}catch(n){if(b(r),n!==n+0)throw n;g(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;g(1,0)}}function Fa(t){var e=$();try{T(t)()}catch(r){if(b(e),r!==r+0)throw r;g(1,0)}}function Oa(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(1,0)}}function Ma(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;g(1,0)}}function ja(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;g(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(m){if(b(y),m!==m+0)throw m;g(1,0)}}function Ia(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;g(1,0)}}function Wa(t,e,r,n,a){var o=$();try{T(t)(e,r,n,a)}catch(i){if(b(o),i!==i+0)throw i;g(1,0)}}function Ha(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;g(1,0)}}function ka(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;g(1,0)}}function Ba(t){var e=$();try{return T(t)()}catch(r){if(b(e),r!==r+0)throw r;g(1,0)}}function Ua(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;g(1,0)}}function Va(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(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;g(1,0)}}function La(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;g(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;g(1,0)}}function Na(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;g(1,0)}}function Ga(t,e,r){var n=$();try{return T(t)(e,r)}catch(a){if(b(n),a!==a+0)throw a;g(1,0)}}function Xa(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;g(1,0)}}function qa(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;g(1,0)}}function Ja(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;g(1,0)}}function Za(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;g(1,0)}}function Qa(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(1,0)}}function Ka(t,e,r,n,a,o,i,s,f,l,h,y){var m=$();try{return T(t)(e,r,n,a,o,i,s,f,l,h,y)}catch(C){if(b(m),C!==C+0)throw C;g(1,0)}}function to(t,e,r,n,a,o,i,s,f,l,h,y,m,C,A,W){var D=$();try{T(t)(e,r,n,a,o,i,s,f,l,h,y,m,C,A,W)}catch(H){if(b(D),H!==H+0)throw H;g(1,0)}}function eo(t,e,r,n){var a=$();try{return Qe(t,e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(1,0)}}function ro(t,e,r,n,a){var o=$();try{return Ke(t,e,r,n,a)}catch(i){if(b(o),i!==i+0)throw i;g(1,0)}}var Ht;mt=function t(){Ht||tr(),Ht||(mt=t)};function tr(){if(it>0||(Er(),it>0))return;function t(){Ht||(Ht=!0,u.calledRun=!0,!Pt&&(Ar(),w(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Dr()))}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 tr(),v.ready}})();function _r(c){return ie(ce,c)}async function Tr(c,{tryHarder:v=nt.tryHarder,formats:u=nt.formats,maxSymbols:w=nt.maxSymbols}=nt){return $r(c,{tryHarder:v,formats:u,maxSymbols:w},ce)}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 Pr(c){for(const[v,u]of fe)if(c===u)return v;return"unknown"}class le{constructor(v={}){nr(this,vt,void 0);var u;try{const w=(u=v==null?void 0:v.formats)==null?void 0:u.filter(P=>P!=="unknown");if((w==null?void 0:w.length)===0)throw new TypeError("Hint option provided, but is empty.");w==null||w.forEach(P=>{if(!B.includes(P))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${P}' is not a valid enum value of type BarcodeFormat.`)}),_r().catch(()=>{}),ar(this,vt,w??[])}catch(w){throw ae(w,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return B.filter(v=>v!=="unknown")}async detect(v){try{const u=await lr(v);if(u===null)return[];let w;try{w=await Tr(u,{tryHarder:!0,formats:rr(this,vt).map(P=>fe.get(P))})}catch{throw new DOMException("Barcode detection service unavailable. Use 'setZXingModuleOverrides' in offline or strict CSP environments.","NotSupportedError")}return w.map(P=>{const{topLeft:{x:F,y:j},topRight:{x:q,y:U},bottomLeft:{x:R,y:G},bottomRight:{x:J,y:L}}=P.position,Y=Math.min(F,q,R,J),Z=Math.min(j,U,G,L),E=Math.max(F,q,R,J),Pt=Math.max(j,U,G,L);return{boundingBox:new DOMRectReadOnly(Y,Z,E-Y,Pt-Z),rawValue:new TextDecoder().decode(P.bytes),format:Pr(P.format),cornerPoints:[{x:F,y:j},{x:q,y:U},{x:J,y:L},{x:R,y:G}]}})}catch(u){throw ae(u,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return vt=new WeakMap,globalThis.BarcodeDetector??(globalThis.BarcodeDetector=le),M.BarcodeDetector=le,M.setZXingModuleOverrides=wr,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}),M}({}); | ||
var nr=(M,B,L)=>{if(!B.has(M))throw TypeError("Cannot "+L)};var ar=(M,B,L)=>(nr(M,B,"read from private field"),L?L.call(M):B.get(M)),or=(M,B,L)=>{if(B.has(M))throw TypeError("Cannot add the same private member more than once");B instanceof WeakSet?B.add(M):B.set(M,L)},ir=(M,B,L,yt)=>(nr(M,B,"write to private field"),yt?yt.call(M,L):B.set(M,L),L);var BarcodeDetectionAPI=function(M){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 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)&&mr(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=cr(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 fr(c){let m;try{m=await createImageBitmap(c)}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await oe(m)}function lr(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 dr(c){if(sr(c))return await fr(c);if(ur(c)){if(vr(c))throw new DOMException("The image data has been detached.","InvalidStateError");return c}return ee(c)||ne(c)?lr(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 vr(c){return c.data.buffer.byteLength===0}function mr(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=(j,J)=>{const U=typeof j=="function"?j(m):j;if(!Object.is(U,m)){const I=m;m=J??typeof U!="object"?U:Object.assign({},m,U),u.forEach(X=>X(m,I))}},g=()=>m,E={setState:P,getState:g,subscribe:j=>(u.add(j),()=>u.delete(j)),destroy:()=>{u.clear()}};return m=c(P,g,E),E},gr=c=>c?se(c):se,wr={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=gr()(()=>({zxingModuleWeakMap:new WeakMap,zxingModuleOverrides:wr}));function $r(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 br(c,{tryHarder:m=nt.tryHarder,formats:u=nt.formats,maxSymbols:P=nt.maxSymbols}=nt,g){const E=await ue(g,lt.getState().zxingModuleOverrides),{data:j,width:J,height:U,data:{byteLength:I}}=c,X=E._malloc(I);E.HEAP8.set(j,X);const Z=E.readBarcodesFromPixmap(X,J,U,m,Cr(u),P);E._free(X);const Y=[];for(let V=0;V<Z.size();++V){const Q=Z.get(V);Y.push({...Q,format:_r(Q.format)})}return Y}function Cr(c){return c.join("|")}function _r(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],j=fe(E);if(j===m)return E;j<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("index.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),j="./this.program",J=typeof window=="object",U=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var I="";function X(t){return u.locateFile?u.locateFile(t,I):I+t}var Z;(J||U)&&(U?I=self.location.href:typeof document<"u"&&document.currentScript&&(I=document.currentScript.src),c&&(I=c),I.indexOf("blob:")!==0?I=I.substr(0,I.replace(/[?#].*/,"").lastIndexOf("/")+1):I="",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&&(j=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,R,F,pe,ye;function ve(){var t=Q.buffer;u.HEAP8=N=new Int8Array(t),u.HEAP16=dt=new Int16Array(t),u.HEAP32=R=new Int32Array(t),u.HEAPU8=z=new Uint8Array(t),u.HEAPU16=Et=new Uint16Array(t),u.HEAPU32=F=new Uint32Array(t),u.HEAPF32=pe=new Float32Array(t),u.HEAPF64=ye=new Float64Array(t)}var me,ge=[],we=[],$e=[];function Ar(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Sr(u.preRun.shift());Bt(ge)}function Dr(){Bt(we)}function xr(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Or(u.postRun.shift());Bt($e)}function Sr(t){ge.unshift(t)}function Fr(t){we.unshift(t)}function Or(t){$e.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 be(t){return t.startsWith(Ir)}var st;u.locateFile?(st="zxing_reader.wasm",be(st)||(st=X(st))):st=new URL("/reader/zxing_reader.wasm",self.location).href;function Ce(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(()=>Ce(t)):Promise.resolve().then(()=>Ce(t))}function _e(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"&&!be(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"),_e(e,r,n)})}):_e(e,r,n)}function Hr(){var t={a:Pa};function e(n,a){var o=n.exports;return A=o,Q=A.qa,ve(),me=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),Ze(e.excPtr),e.get_exception_ptr()}var K=0;function Br(){w(0,0);var t=Dt.pop();Je(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=Ke(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(Qe(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 Te(t){for(;t.length;){var e=t.pop(),r=t.pop();r(e)}}function gt(t){return this.fromWireType(R[t>>2])}var ht={},ut={},Ot={},Pe=void 0;function Mt(t){throw new Pe(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],W=f.setter,x=f.setterContext;s[h]={read:H=>y.fromWireType(v(C,H)),write:(H,d)=>{var p=[];W(x,H,D.toWireType(p,d)),Te(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);Ee=t}var Ee=void 0;function k(t){for(var e="",r=t;z[r];)e+=Ee[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=R;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 Ae(t){}function rn(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}function De(t){t.count.value-=1;var e=t.count.value===0;e&&rn(t)}function xe(t,e,r){if(e===r)return t;if(r.baseClass===void 0)return null;var n=xe(t,e,r.baseClass);return n===null?null:r.downcast(n)}var Se={};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=Se[o];if(!i)return a.call(this);var s;this.isConst?s=i.constPointerType:s=i.pointerType;var f=xe(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=>{De(e.$$)}),Ct=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Lt.register(e,a,e)}return e},Ae=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"),Ae(this),De(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 Fe(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 Oe(t,e){return t=Fe(t),{[t]:function(){return e.apply(this,arguments)}}[t]}function Me(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 je(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`),Me(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 Ie(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=me.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=Oe(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+` | ||
`+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 Re=void 0;function We(t){var e=qe(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 Re(`${t}: `+r.map(We).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=Fe(h);je(C,function(){Rt(`Cannot construct ${h} due to unbound types`,[n])}),ct([t,e,r],n?[n]:[],function(D){D=D[0];var W,x;n?(W=D.registeredClass,x=W.instancePrototype):x=at.prototype;var H=Oe(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:H}});H.prototype=d;var p=new gn(h,H,d,v,W,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 Se[t]={pointerType:O,constPointerType:ft},Ie(C,H),[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 W;C.length=s?2:1,C[0]=a,s&&(W=e[1].toWireType(D,this),C[1]=W);for(var x=0;x<y;++x)v[x]=e[x+2].toWireType(D,arguments[x]),C.push(v[x]);var H=n.apply(null,C);function d(p){if(f)Te(D);else for(var S=s?1:2;S<e.length;S++){var O=S===1?W:v[S-2];e[S].destructorFunction!==null&&e[S].destructorFunction(O)}if(h)return e[0].fromWireType(p)}return d(H)}}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):(Me(C,e,y),C[e].overloadTable[r-2]=v),ct([],l,function(W){var x=Xt(y,W,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(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;function ke(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 ke(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(pe[r>>2])};case 3:return function(r){return this.fromWireType(ye[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),je(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 Ie(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 R[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 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 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)=>Be(t,z,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,Ln=(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 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=Ue(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 ze=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&&ze)return ze.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=R[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(R[e>>2]=i,e+=4,e+4>a)break}return R[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 W=D-v,x=n(v,W);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 Le(){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(Le()):(t=na(t),ot.toHandle(Le()[t]))}function oa(t){t>4&&(G.get(t).refcount+=1)}function Ye(t,e){var r=ut[t];return r===void 0&&_(e+" has unknown type "+We(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=Ye(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 Ne={};function sa(t,e,r,n){t=ot.toValue(t);var a=Ne[e];return a||(a=ia(e),Ne[e]=a),a(t,r,n)}function ua(t,e){t=Ye(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),ve(),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=()=>j||"./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},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],$a=(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 ba(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 Ca=(t,e)=>{N.set(t,e)},_a=(t,e,r,n)=>{var a=R[n+40>>2],o={tm_sec:R[n>>2],tm_min:R[n+4>>2],tm_hour:R[n+8>>2],tm_mday:R[n+12>>2],tm_mon:R[n+16>>2],tm_year:R[n+20>>2],tm_wday:R[n+24>>2],tm_yday:R[n+28>>2],tm_isdst:R[n+32>>2],tm_gmtoff:R[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 W(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=>W(d).toString().substring(2),"%G":d=>W(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)?Ge:Xe,d.tm_mon-1),3),"%m":d=>v(d.tm_mon+1,2),"%M":d=>v(d.tm_min,2),"%n":()=>` | ||
`,"%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 H=ba(i,!1);return H.length>e?0:(Ca(H,t),H.length-1)},Ta=(t,e,r,n,a)=>_a(t,e,r,n);Pe=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(),Re=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:ke,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),qe=t=>(qe=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),Je=t=>(Je=A.Ba)(t),Ze=t=>(Ze=A.Ca)(t),Qe=(t,e,r)=>(Qe=A.Da)(t,e,r),Ke=t=>(Ke=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 tr=u.dynCall_jiii=(t,e,r,n)=>(tr=u.dynCall_jiii=A.Ga)(t,e,r,n),er=u.dynCall_jiiii=(t,e,r,n,a)=>(er=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,W){var x=$();try{T(t)(e,r,n,a,o,i,s,f,l,h,y,v,C,D,W)}catch(H){if(b(x),H!==H+0)throw H;w(1,0)}}function ro(t,e,r,n){var a=$();try{return tr(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 er(t,e,r,n,a)}catch(i){if(b(o),i!==i+0)throw i;w(1,0)}}var Ht;mt=function t(){Ht||rr(),Ht||(mt=t)};function rr(){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 rr(),m.ready}})();function Tr(c){return ue(le,c)}async function Pr(c,{tryHarder:m=nt.tryHarder,formats:u=nt.formats,maxSymbols:P=nt.maxSymbols}=nt){return br(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 Er(c){for(const[m,u]of de)if(c===u)return m;return"unknown"}class he extends EventTarget{constructor(u={}){var P;super();or(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.`)}),ir(this,vt,g??[]),Tr().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 dr(u);if(P===null)return[];let g;try{g=await Pr(P,{tryHarder:!0,formats:ar(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:j,y:J},topRight:{x:U,y:I},bottomLeft:{x:X,y:Z},bottomRight:{x:Y,y:V}}=E.position,Q=Math.min(j,U,X,Y),A=Math.min(J,I,Z,V),Pt=Math.max(j,U,X,Y),N=Math.max(J,I,Z,V);return{boundingBox:new DOMRectReadOnly(Q,A,Pt-Q,N-A),rawValue:new TextDecoder().decode(E.bytes),format:Er(E.format),cornerPoints:[{x:j,y:J},{x:U,y:I},{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=he),M.BarcodeDetector=he,M.setZXingModuleOverrides=$r,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}),M}({}); |
@@ -1,3 +0,3 @@ | ||
var tr=(M,B,z)=>{if(!B.has(M))throw TypeError("Cannot "+z)};var er=(M,B,z)=>(tr(M,B,"read from private field"),z?z.call(M):B.get(M)),rr=(M,B,z)=>{if(B.has(M))throw TypeError("Cannot add the same private member more than once");B instanceof WeakSet?B.add(M):B.set(M,z)},nr=(M,B,z,yt)=>(tr(M,B,"write to private field"),yt?yt.call(M,z):B.set(M,z),z);var BarcodeDetectionAPI=function(M){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 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(ar(c))return{width:c.width,height:c.height};if(ee(c))return{width:c.width,height:c.height};if(or(c))return{width:c.width,height:c.height};if(re(c))return{width:c.displayWidth,height:c.displayHeight};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 ar(c){try{return c instanceof HTMLCanvasElement}catch{return!1}}function ee(c){try{return c instanceof ImageBitmap}catch{return!1}}function or(c){try{return c instanceof OffscreenCanvas}catch{return!1}}function re(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,v){try{const u=new OffscreenCanvas(c,v);if(u.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return u;throw void 0}catch{const u=document.createElement("canvas");return u.width=c,u.height=v,u}}async function ne(c){if(yt(c)&&!await lr(c))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Kt(c)&&!await dr(c))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(re(c)&&hr(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(ee(c)&&yr(c))throw new DOMException("The image source is detached.","InvalidStateError");const{width:v,height:u}=z(c);if(v===0||u===0)return null;const P=ur(v,u).getContext("2d");P.drawImage(c,0,0);try{return P.getImageData(0,0,v,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function cr(c){let v;try{v=await createImageBitmap(c)}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await ne(v)}async function fr(c){if(ir(c))return await cr(c);if(sr(c)){if(pr(c))throw new DOMException("The image data has been detached.","InvalidStateError");return c}return await ne(c)}async function lr(c){try{return await c.decode(),!0}catch{return!1}}async function dr(c){var v;try{return await((v=c.decode)==null?void 0:v.call(c)),!0}catch{return!1}}function hr(c){return c.format===null}function pr(c){return c.data.buffer.byteLength===0}function yr(c){return c.width===0&&c.height===0}function ae(c,v){return c instanceof DOMException?new DOMException(`${v}: ${c.message}`,c.name):c instanceof Error?new c.constructor(`${v}: ${c.message}`):new Error(`${v}: ${c}`)}const oe=c=>{let v;const u=new Set,w=(j,q)=>{const U=typeof j=="function"?j(v):j;if(!Object.is(U,v)){const R=v;v=q??typeof U!="object"?U:Object.assign({},v,U),u.forEach(G=>G(v,R))}},P=()=>v,F={setState:w,getState:P,subscribe:j=>(u.add(j),()=>u.delete(j)),destroy:()=>{u.clear()}};return v=c(w,P,F),F},vr=c=>c?oe(c):oe,mr={locateFile:(c,v)=>{var u;const w=(u=c.match(/_(.+?)\.wasm$/))==null?void 0:u[1];return w?`https://cdn.jsdelivr.net/npm/@sec-ant/zxing-wasm@2.1.3/dist/${w}/${c}`:v+c}},lt=vr()(()=>({zxingModuleWeakMap:new WeakMap,zxingModuleOverrides:mr}));function gr(c){lt.setState({zxingModuleOverrides:c})}function ie(c,v=lt.getState().zxingModuleOverrides){const{zxingModuleWeakMap:u}=lt.getState(),w=u.get(c);if(w&&Object.is(v,lt.getState().zxingModuleOverrides))return w;{lt.setState({zxingModuleOverrides:v});const P=c(v);return u.set(c,P),P}}const se=["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 wr(c,{tryHarder:v=nt.tryHarder,formats:u=nt.formats,maxSymbols:w=nt.maxSymbols}=nt,P){const F=await ie(P,lt.getState().zxingModuleOverrides),{data:j,width:q,height:U,data:{byteLength:R}}=c,G=F._malloc(R);F.HEAP8.set(j,G);const J=F.readBarcodesFromPixmap(G,q,U,v,$r(u),w);F._free(G);const L=[];for(let Y=0;Y<J.size();++Y){const Z=J.get(Y);L.push({...Z,format:br(Z.format)})}return L}function $r(c){return c.join("|")}function br(c){const v=ue(c);let u=0,w=se.length-1;for(;u<=w;){const P=Math.floor((u+w)/2),F=se[P],j=ue(F);if(j===v)return F;j<v?u=P+1:w=P-1}return"None"}function ue(c){return c.toLowerCase().replace(/_-\[\]/g,"")}var ce=(()=>{var c=document.currentScript&&document.currentScript.src||new URL("pure.js",document.baseURI).href;return function(v={}){var u=v,w,P;u.ready=new Promise((t,e)=>{w=t,P=e});var F=Object.assign({},u),j="./this.program",q=typeof window=="object",U=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var R="";function G(t){return u.locateFile?u.locateFile(t,R):R+t}var J;(q||U)&&(U?R=self.location.href:typeof document<"u"&&document.currentScript&&(R=document.currentScript.src),c&&(R=c),R.indexOf("blob:")!==0?R=R.substr(0,R.replace(/[?#].*/,"").lastIndexOf("/")+1):R="",U&&(J=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 L=u.printErr||console.error.bind(console);Object.assign(u,F),F=null,u.arguments&&u.arguments,u.thisProgram&&(j=u.thisProgram),u.quit&&u.quit;var Y;u.wasmBinary&&(Y=u.wasmBinary),u.noExitRuntime,typeof WebAssembly!="object"&&At("no native wasm support detected");var Z,E,Pt=!1,Q,V,dt,Et,I,x,le,de;function he(){var t=Z.buffer;u.HEAP8=Q=new Int8Array(t),u.HEAP16=dt=new Int16Array(t),u.HEAP32=I=new Int32Array(t),u.HEAPU8=V=new Uint8Array(t),u.HEAPU16=Et=new Uint16Array(t),u.HEAPU32=x=new Uint32Array(t),u.HEAPF32=le=new Float32Array(t),u.HEAPF64=de=new Float64Array(t)}var pe,ye=[],ve=[],me=[];function Er(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Sr(u.preRun.shift());Bt(ye)}function Ar(){Bt(ve)}function Dr(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Fr(u.postRun.shift());Bt(me)}function Sr(t){ye.unshift(t)}function xr(t){ve.unshift(t)}function Fr(t){me.unshift(t)}var it=0,mt=null;function Or(t){it++,u.monitorRunDependencies&&u.monitorRunDependencies(it)}function Mr(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+")",L(t),Pt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw P(e),e}var jr="data:application/octet-stream;base64,";function ge(t){return t.startsWith(jr)}var st;u.locateFile?(st="zxing_reader.wasm",ge(st)||(st=G(st))):st=new URL("/reader/zxing_reader.wasm",self.location).href;function we(t){if(t==st&&Y)return new Uint8Array(Y);if(J)return J(t);throw"both async and sync fetching of the wasm failed"}function Rr(t){return!Y&&(q||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(()=>we(t)):Promise.resolve().then(()=>we(t))}function $e(t,e,r){return Rr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{L("failed to asynchronously prepare wasm: "+n),At(n)})}function Ir(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!ge(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(i){return L("wasm streaming compile failed: "+i),L("falling back to ArrayBuffer instantiation"),$e(e,r,n)})}):$e(e,r,n)}function Wr(){var t={a:Ta};function e(n,a){var o=n.exports;return E=o,Z=E.qa,he(),pe=E.ua,xr(E.ra),Mr(),o}Or();function r(n){e(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(t,e)}catch(n){L("Module.instantiateWasm callback failed with error: "+n),P(n)}return Ir(Y,st,t,r).catch(P),{}}var Bt=t=>{for(;t.length>0;)t.shift()(u)},Dt=[],St=0;function Hr(t){var e=new xt(t);return e.get_caught()||(e.set_caught(!0),St--),e.set_rethrown(!1),Dt.push(e),Xe(e.excPtr),e.get_exception_ptr()}var K=0;function kr(){g(0,0);var t=Dt.pop();Ge(t.excPtr),K=0}function xt(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,Q[this.ptr+12>>0]=e},this.get_caught=function(){return Q[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,Q[this.ptr+13>>0]=e},this.get_rethrown=function(){return Q[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=Je(this.get_type());if(e)return x[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}function Br(t){throw K||(K=t),K}var Ut=t=>{var e=K;if(!e)return Tt(0),0;var r=new xt(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(qe(o,n,i))return Tt(o),e}return Tt(n),e},Ur=()=>Ut([]),Vr=t=>Ut([t]),zr=(t,e)=>Ut([t,e]);function Lr(t){var e=new xt(t).get_exception_ptr();return e}function Yr(){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),St++),K=e,K}function Nr(t,e,r){var n=new xt(t);throw n.init(e,r),K=t,St++,K}function Gr(){return St}var Ft={};function be(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={},Ce=void 0;function Mt(t){throw new Ce(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 Xr=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],m=f.getter,C=f.getterContext,A=i[l+a.length],W=f.setter,D=f.setterContext;s[h]={read:H=>y.fromWireType(m(C,H)),write:(H,d)=>{var p=[];W(D,H,A.toWireType(p,d)),be(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 qr(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 Jr(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);_e=t}var _e=void 0;function k(t){for(var e="",r=t;V[r];)e+=_e[V[r++]];return e}var pt=void 0;function _(t){throw new pt(t)}function Zr(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 Zr(t,e,r)}function Qr(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=Q;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 Kr(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 tn(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 Te(t){}function en(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}function Pe(t){t.count.value-=1;var e=t.count.value===0;e&&en(t)}function Ee(t,e,r){if(e===r)return t;if(r.baseClass===void 0)return null;var n=Ee(t,e,r.baseClass);return n===null?null:r.downcast(n)}var Ae={};function rn(){return Object.keys(bt).length}function nn(){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 an(t){$t=t,wt.length&&$t&&$t(Yt)}function on(){u.getInheritedInstanceCount=rn,u.getLiveInheritedInstances=nn,u.flushPendingDeletes=Yt,u.setDelayFunction=an}var bt={};function sn(t,e){for(e===void 0&&_("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}function un(t,e){return e=sn(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 cn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=un(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=Ae[o];if(!i)return a.call(this);var s;this.isConst?s=i.constPointerType:s=i.pointerType;var f=Ee(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=>{Pe(e.$$)}),Ct=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Lt.register(e,a,e)}return e},Te=e=>Lt.unregister(e),Ct(t))};function fn(){if(this.$$.ptr||zt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Ct(Object.create(Object.getPrototypeOf(this),{$$:{value:tn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function ln(){this.$$.ptr||zt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&_("Object already scheduled for deletion"),Te(this),Pe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function dn(){return!this.$$.ptr}function hn(){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 pn(){at.prototype.isAliasOf=Kr,at.prototype.clone=fn,at.prototype.delete=ln,at.prototype.isDeleted=dn,at.prototype.deleteLater=hn}function at(){}var yn=48,vn=57;function De(t){if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=yn&&e<=vn?`_${t}`:t}function Se(t,e){return t=De(t),{[t]:function(){return e.apply(this,arguments)}}[t]}function xe(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 Fe(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`),xe(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 mn(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 gn(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 wn(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 $n(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 bn(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function Cn(t){this.rawDestructor&&this.rawDestructor(t)}function _n(t){t!==null&&t.delete()}function Tn(){et.prototype.getPointee=bn,et.prototype.destructor=Cn,et.prototype.argPackAdvance=8,et.prototype.readValueFromPointer=gt,et.prototype.deleteObject=_n,et.prototype.fromWireType=cn}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=gn,this.destructorFunction=null):(this.toWireType=$n,this.destructorFunction=null):this.toWireType=wn}function Oe(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 Pn=(t,e,r)=>{var n=u["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},Rt=[],T=t=>{var e=Rt[t];return e||(t>=Rt.length&&(Rt.length=t+1),Rt[t]=e=pe.get(t)),e},En=(t,e,r)=>{if(t.includes("j"))return Pn(t,e,r);var n=T(e).apply(null,r);return n},An=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),En(t,e,r)}};function X(t,e){t=k(t);function r(){return t.includes("j")?An(t,e):T(e)}var n=r();return typeof n!="function"&&_(`unknown function pointer with signature ${t}: ${e}`),n}function Dn(t,e){var r=Se(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+` | ||
`+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 Me=void 0;function je(t){var e=Ne(t),r=k(e);return rt(e),r}function It(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 Me(`${t}: `+r.map(je).join([", "]))}function Sn(t,e,r,n,a,o,i,s,f,l,h,y,m){h=k(h),o=X(a,o),s&&(s=X(i,s)),l&&(l=X(f,l)),m=X(y,m);var C=De(h);Fe(C,function(){It(`Cannot construct ${h} due to unbound types`,[n])}),ct([t,e,r],n?[n]:[],function(A){A=A[0];var W,D;n?(W=A.registeredClass,D=W.instancePrototype):D=at.prototype;var H=Se(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(D,{constructor:{value:H}});H.prototype=d;var p=new mn(h,H,d,m,W,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 Ae[t]={pointerType:O,constPointerType:ft},Oe(C,H),[S,O,ft]})}function 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&&_("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,m=new Array(y),C=[],A=[];return function(){arguments.length!==y&&_(`function ${t} called with ${arguments.length} arguments, expected ${y} args!`),A.length=0;var W;C.length=s?2:1,C[0]=a,s&&(W=e[1].toWireType(A,this),C[1]=W);for(var D=0;D<y;++D)m[D]=e[D+2].toWireType(A,arguments[D]),C.push(m[D]);var H=n.apply(null,C);function d(p){if(f)be(A);else for(var S=s?1:2;S<e.length;S++){var O=S===1?W:m[S-2];e[S].destructorFunction!==null&&e[S].destructorFunction(O)}if(h)return e[0].fromWireType(p)}return d(H)}}function xn(t,e,r,n,a,o){var i=Gt(e,r);a=X(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]=()=>{It(`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 Fn(t,e,r,n,a,o,i,s,f){var l=Gt(r,n);e=k(e),o=X(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 m(){It(`Cannot call ${y} due to unbound types`,l)}var C=h.registeredClass.instancePrototype,A=C[e];return A===void 0||A.overloadTable===void 0&&A.className!==h.name&&A.argCount===r-2?(m.argCount=r-2,m.className=h.name,C[e]=m):(xe(C,e,y),C[e].overloadTable[r-2]=m),ct([],l,function(W){var D=Xt(y,W,h,o,i);return C[e].overloadTable===void 0?(D.argCount=r-2,C[e]=D):C[e].overloadTable[r-2]=D,[]}),[]})}function On(){Object.assign(Re.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 Re(){this.allocated=[void 0],this.freelist=[]}var N=new Re;function Ie(t){t>=N.reserved&&--N.get(t).refcount===0&&N.free(t)}function Mn(){for(var t=0,e=N.reserved;e<N.allocated.length;++e)N.allocated[e]!==void 0&&++t;return t}function jn(){N.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),N.reserved=N.allocated.length,u.count_emval_handles=Mn}var ot={toValue:t=>(t||_("Cannot use deleted val. handle = "+t),N.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 N.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 Ie(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 In(t,e){switch(e){case 2:return function(r){return this.fromWireType(le[r>>2])};case 3:return function(r){return this.fromWireType(de[r>>3])};default:throw new TypeError("Unknown float type: "+t)}}function Wn(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:In(e,n),destructorFunction:null})}function Hn(t,e,r,n,a,o,i){var s=Gt(e,r);t=k(t),a=X(n,a),Fe(t,function(){It(`Cannot call ${t} due to unbound types`,s)},e-1),ct([],s,function(f){var l=[f[0],null].concat(f.slice(1));return Oe(t,Xt(t,l,null,a,o),e-1),[]})}function kn(t,e,r){switch(e){case 0:return r?function(n){return Q[n]}:function(n){return V[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 x[n>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function Bn(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,m)=>{},h;f?h=function(y,m){return l(m,this.name),m>>>0}:h=function(y,m){return l(m,this.name),m},tt(t,{name:e,fromWireType:i,toWireType:h,argPackAdvance:8,readValueFromPointer:kn(e,o,n!==0),destructorFunction:null})}function Un(t,e,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(i){i=i>>2;var s=x,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 We=(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},Vn=(t,e,r)=>We(t,V,e,r),He=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},ke=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,zn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&ke)return ke.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?zn(V,t,e):"";function Ln(t,e){e=k(e);var r=e==="std::string";tt(t,{name:e,fromWireType:function(n){var a=x[n>>2],o=n+4,i;if(r)for(var s=o,f=0;f<=a;++f){var l=o+f;if(f==a||V[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 m=new Array(a),f=0;f<a;++f)m[f]=String.fromCharCode(V[o+f]);i=m.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=He(a):o=a.length;var s=Qt(4+o+1),f=s+4;if(x[s>>2]=o,r&&i)Vn(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")),V[f+l]=h}else for(var l=0;l<o;++l)V[f+l]=a[l];return n!==null&&n.push(rt,s),s},argPackAdvance:8,readValueFromPointer:gt,destructorFunction:function(n){rt(n)}})}var Be=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Yn=(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&&Be)return Be.decode(V.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},Nn=(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},Gn=t=>t.length*2,Xn=(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},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(I[e>>2]=i,e+=4,e+4>a)break}return I[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},Zn=function(t,e,r){r=k(r);var n,a,o,i,s;e===2?(n=Yn,a=Nn,i=Gn,o=()=>Et,s=1):e===4&&(n=Xn,a=qn,i=Jn,o=()=>x,s=2),tt(t,{name:r,fromWireType:function(f){for(var l=x[f>>2],h=o(),y,m=f+4,C=0;C<=l;++C){var A=f+4+C*e;if(C==l||h[A>>s]==0){var W=A-m,D=n(m,W);y===void 0?y=D:(y+=String.fromCharCode(0),y+=D),m=A+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 x[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 Qn(t,e,r,n,a,o){Ft[t]={name:k(e),rawConstructor:X(r,n),rawDestructor:X(a,o),fields:[]}}function Kn(t,e,r,n,a,o,i,s,f,l){Ft[t].fields.push({fieldName:k(e),getterReturnType:r,getter:X(n,a),getterContext:o,setterArgumentType:i,setter:X(s,f),setterContext:l})}function ta(t,e){e=k(e),tt(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:function(){},toWireType:function(r,n){}})}var ea={};function ra(t){var e=ea[t];return e===void 0?k(t):e}function Ue(){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 na(t){return t===0?ot.toHandle(Ue()):(t=ra(t),ot.toHandle(Ue()[t]))}function aa(t){t>4&&(N.get(t).refcount+=1)}function Ve(t,e){var r=ut[t];return r===void 0&&_(e+" has unknown type "+je(t)),r}function oa(t){var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var i=Ve(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 ot.toHandle(s)}}var ze={};function ia(t,e,r,n){t=ot.toValue(t);var a=ze[e];return a||(a=oa(e),ze[e]=a),a(t,r,n)}function sa(t,e){t=Ve(t,"_emval_take_value");var r=t.readValueFromPointer(e);return ot.toHandle(r)}var ua=()=>{At("")},ca=(t,e,r)=>V.copyWithin(t,e,e+r),fa=()=>2147483648,la=t=>{var e=Z.buffer,r=t-e.byteLength+65535>>>16;try{return Z.grow(r),he(),1}catch{}},da=t=>{var e=V.length;t>>>=0;var r=fa();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=la(i);if(s)return!0}return!1},Zt={},ha=()=>j||"./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,_:ha()};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},pa=(t,e)=>{for(var r=0;r<t.length;++r)Q[e++>>0]=t.charCodeAt(r);Q[e>>0]=0},ya=(t,e)=>{var r=0;return _t().forEach(function(n,a){var o=e+r;x[t+a*4>>2]=o,pa(n,o),r+=n.length+1}),0},va=(t,e)=>{var r=_t();x[t>>2]=r.length;var n=0;return r.forEach(function(a){n+=a.length+1}),x[e>>2]=n,0};function ma(t){return t}var Wt=t=>t%4===0&&(t%100!==0||t%400===0),ga=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Le=[31,29,31,30,31,30,31,31,30,31,30,31],Ye=[31,28,31,30,31,30,31,31,30,31,30,31],wa=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Wt(r.getFullYear()),a=r.getMonth(),o=(n?Le:Ye)[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 $a(t,e,r){var n=r>0?r:He(t)+1,a=new Array(n),o=We(t,a,0,a.length);return e&&(a.length=o),a}var ba=(t,e)=>{Q.set(t,e)},Ca=(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 m(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 A(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 W(d){var p=wa(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=A(S),kt=A(O);return C(ft,p)<=0?C(kt,p)<=0?p.getFullYear()+1:p.getFullYear():p.getFullYear()-1}var D={"%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 m(p/100|0,2)},"%d":d=>m(d.tm_mday,2),"%e":d=>y(d.tm_mday,2," "),"%g":d=>W(d).toString().substring(2),"%G":d=>W(d),"%H":d=>m(d.tm_hour,2),"%I":d=>{var p=d.tm_hour;return p==0?p=12:p>12&&(p-=12),m(p,2)},"%j":d=>m(d.tm_mday+ga(Wt(d.tm_year+1900)?Le:Ye,d.tm_mon-1),3),"%m":d=>m(d.tm_mon+1,2),"%M":d=>m(d.tm_min,2),"%n":()=>` | ||
`,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>m(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var p=d.tm_yday+7-d.tm_wday;return m(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 m(p,2)},"%w":d=>d.tm_wday,"%W":d=>{var p=d.tm_yday+7-(d.tm_wday+6)%7;return m(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 D)i.includes(f)&&(i=i.replace(new RegExp(f,"g"),D[f](o)));i=i.replace(/\0\0/g,"%");var H=$a(i,!1);return H.length>e?0:(ba(H,t),H.length-1)},_a=(t,e,r,n,a)=>Ca(t,e,r,n);Ce=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"}},pn(),on(),Tn(),Me=u.UnboundTypeError=Dn(Error,"UnboundTypeError"),On(),jn();var Ta={q:Hr,u:kr,a:Ur,h:Vr,l:zr,I:Lr,P:Yr,n:Nr,ba:Gr,d:Br,oa:Xr,Y:qr,fa:Qr,na:Sn,ma:xn,D:Fn,ea:Rn,W:Wn,J:Hn,w:Bn,s:Un,V:Ln,L:Zn,Q:Qn,pa:Kn,ga:ta,U:Ie,la:na,R:aa,ia,ka:sa,K:ua,da:ca,ca:da,$:ya,aa:va,H:za,T:Qa,B:Ya,p:Ba,b:Pa,C:Va,ha:Ga,c:xa,j:Oa,i:Da,x:La,O:Ua,v:Ha,G:qa,N:Ja,A:Na,F:Ka,Z:eo,X:ro,k:Fa,f:Sa,e:Aa,g:Ea,M:Za,m:Wa,o:Ma,S:ja,t:Ia,ja:ka,y:Xa,r:Ra,E:to,z:ma,_:_a};Wr();var rt=u._free=t=>(rt=u._free=E.sa)(t),Qt=u._malloc=t=>(Qt=u._malloc=E.ta)(t),Ne=t=>(Ne=E.va)(t);u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=E.wa)();var g=(t,e)=>(g=E.xa)(t,e),Tt=t=>(Tt=E.ya)(t),$=()=>($=E.za)(),b=t=>(b=E.Aa)(t),Ge=t=>(Ge=E.Ba)(t),Xe=t=>(Xe=E.Ca)(t),qe=(t,e,r)=>(qe=E.Da)(t,e,r),Je=t=>(Je=E.Ea)(t);u.dynCall_viijii=(t,e,r,n,a,o,i)=>(u.dynCall_viijii=E.Fa)(t,e,r,n,a,o,i);var Ze=u.dynCall_jiii=(t,e,r,n)=>(Ze=u.dynCall_jiii=E.Ga)(t,e,r,n),Qe=u.dynCall_jiiii=(t,e,r,n,a)=>(Qe=u.dynCall_jiiii=E.Ha)(t,e,r,n,a);u.dynCall_iiiiij=(t,e,r,n,a,o,i)=>(u.dynCall_iiiiij=E.Ia)(t,e,r,n,a,o,i),u.dynCall_iiiiijj=(t,e,r,n,a,o,i,s,f)=>(u.dynCall_iiiiijj=E.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=E.Ka)(t,e,r,n,a,o,i,s,f,l);function Pa(t,e){var r=$();try{return T(t)(e)}catch(n){if(b(r),n!==n+0)throw n;g(1,0)}}function Ea(t,e,r,n){var a=$();try{T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(1,0)}}function Aa(t,e,r){var n=$();try{T(t)(e,r)}catch(a){if(b(n),a!==a+0)throw a;g(1,0)}}function Da(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;g(1,0)}}function Sa(t,e){var r=$();try{T(t)(e)}catch(n){if(b(r),n!==n+0)throw n;g(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;g(1,0)}}function Fa(t){var e=$();try{T(t)()}catch(r){if(b(e),r!==r+0)throw r;g(1,0)}}function Oa(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(1,0)}}function Ma(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;g(1,0)}}function ja(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;g(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(m){if(b(y),m!==m+0)throw m;g(1,0)}}function Ia(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;g(1,0)}}function Wa(t,e,r,n,a){var o=$();try{T(t)(e,r,n,a)}catch(i){if(b(o),i!==i+0)throw i;g(1,0)}}function Ha(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;g(1,0)}}function ka(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;g(1,0)}}function Ba(t){var e=$();try{return T(t)()}catch(r){if(b(e),r!==r+0)throw r;g(1,0)}}function Ua(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;g(1,0)}}function Va(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(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;g(1,0)}}function La(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;g(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;g(1,0)}}function Na(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;g(1,0)}}function Ga(t,e,r){var n=$();try{return T(t)(e,r)}catch(a){if(b(n),a!==a+0)throw a;g(1,0)}}function Xa(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;g(1,0)}}function qa(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;g(1,0)}}function Ja(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;g(1,0)}}function Za(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;g(1,0)}}function Qa(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(1,0)}}function Ka(t,e,r,n,a,o,i,s,f,l,h,y){var m=$();try{return T(t)(e,r,n,a,o,i,s,f,l,h,y)}catch(C){if(b(m),C!==C+0)throw C;g(1,0)}}function to(t,e,r,n,a,o,i,s,f,l,h,y,m,C,A,W){var D=$();try{T(t)(e,r,n,a,o,i,s,f,l,h,y,m,C,A,W)}catch(H){if(b(D),H!==H+0)throw H;g(1,0)}}function eo(t,e,r,n){var a=$();try{return Ze(t,e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(1,0)}}function ro(t,e,r,n,a){var o=$();try{return Qe(t,e,r,n,a)}catch(i){if(b(o),i!==i+0)throw i;g(1,0)}}var Ht;mt=function t(){Ht||Ke(),Ht||(mt=t)};function Ke(){if(it>0||(Er(),it>0))return;function t(){Ht||(Ht=!0,u.calledRun=!0,!Pt&&(Ar(),w(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Dr()))}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 Ke(),v.ready}})();function Cr(c){return ie(ce,c)}async function _r(c,{tryHarder:v=nt.tryHarder,formats:u=nt.formats,maxSymbols:w=nt.maxSymbols}=nt){return wr(c,{tryHarder:v,formats:u,maxSymbols:w},ce)}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 Tr(c){for(const[v,u]of fe)if(c===u)return v;return"unknown"}class Pr{constructor(v={}){rr(this,vt,void 0);var u;try{const w=(u=v==null?void 0:v.formats)==null?void 0:u.filter(P=>P!=="unknown");if((w==null?void 0:w.length)===0)throw new TypeError("Hint option provided, but is empty.");w==null||w.forEach(P=>{if(!B.includes(P))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${P}' is not a valid enum value of type BarcodeFormat.`)}),Cr().catch(()=>{}),nr(this,vt,w??[])}catch(w){throw ae(w,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return B.filter(v=>v!=="unknown")}async detect(v){try{const u=await fr(v);if(u===null)return[];let w;try{w=await _r(u,{tryHarder:!0,formats:er(this,vt).map(P=>fe.get(P))})}catch{throw new DOMException("Barcode detection service unavailable. Use 'setZXingModuleOverrides' in offline or strict CSP environments.","NotSupportedError")}return w.map(P=>{const{topLeft:{x:F,y:j},topRight:{x:q,y:U},bottomLeft:{x:R,y:G},bottomRight:{x:J,y:L}}=P.position,Y=Math.min(F,q,R,J),Z=Math.min(j,U,G,L),E=Math.max(F,q,R,J),Pt=Math.max(j,U,G,L);return{boundingBox:new DOMRectReadOnly(Y,Z,E-Y,Pt-Z),rawValue:new TextDecoder().decode(P.bytes),format:Tr(P.format),cornerPoints:[{x:F,y:j},{x:q,y:U},{x:J,y:L},{x:R,y:G}]}})}catch(u){throw ae(u,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return vt=new WeakMap,M.BarcodeDetector=Pr,M.setZXingModuleOverrides=gr,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}),M}({}); | ||
var rr=(M,B,L)=>{if(!B.has(M))throw TypeError("Cannot "+L)};var nr=(M,B,L)=>(rr(M,B,"read from private field"),L?L.call(M):B.get(M)),ar=(M,B,L)=>{if(B.has(M))throw TypeError("Cannot add the same private member more than once");B instanceof WeakSet?B.add(M):B.set(M,L)},or=(M,B,L,yt)=>(rr(M,B,"write to private field"),yt?yt.call(M,L):B.set(M,L),L);var BarcodeDetectionAPI=function(M){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=(j,J)=>{const U=typeof j=="function"?j(m):j;if(!Object.is(U,m)){const I=m;m=J??typeof U!="object"?U:Object.assign({},m,U),u.forEach(X=>X(m,I))}},g=()=>m,E={setState:P,getState:g,subscribe:j=>(u.add(j),()=>u.delete(j)),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:j,width:J,height:U,data:{byteLength:I}}=c,X=E._malloc(I);E.HEAP8.set(j,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],j=fe(E);if(j===m)return E;j<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("pure.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),j="./this.program",J=typeof window=="object",U=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var I="";function X(t){return u.locateFile?u.locateFile(t,I):I+t}var Z;(J||U)&&(U?I=self.location.href:typeof document<"u"&&document.currentScript&&(I=document.currentScript.src),c&&(I=c),I.indexOf("blob:")!==0?I=I.substr(0,I.replace(/[?#].*/,"").lastIndexOf("/")+1):I="",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&&(j=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,R,F,he,pe;function ye(){var t=Q.buffer;u.HEAP8=N=new Int8Array(t),u.HEAP16=dt=new Int16Array(t),u.HEAP32=R=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(R[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],W=f.setter,x=f.setterContext;s[h]={read:H=>y.fromWireType(v(C,H)),write:(H,d)=>{var p=[];W(x,H,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=R;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()+` | ||
`+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 W,x;n?(W=D.registeredClass,x=W.instancePrototype):x=at.prototype;var H=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:H}});H.prototype=d;var p=new gn(h,H,d,v,W,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,H),[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 W;C.length=s?2:1,C[0]=a,s&&(W=e[1].toWireType(D,this),C[1]=W);for(var x=0;x<y;++x)v[x]=e[x+2].toWireType(D,arguments[x]),C.push(v[x]);var H=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?W:v[S-2];e[S].destructorFunction!==null&&e[S].destructorFunction(O)}if(h)return e[0].fromWireType(p)}return d(H)}}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(W){var x=Xt(y,W,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 R[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=R[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(R[e>>2]=i,e+=4,e+4>a)break}return R[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 W=D-v,x=n(v,W);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=()=>j||"./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=R[n+40>>2],o={tm_sec:R[n>>2],tm_min:R[n+4>>2],tm_hour:R[n+8>>2],tm_mday:R[n+12>>2],tm_mon:R[n+16>>2],tm_year:R[n+20>>2],tm_wday:R[n+24>>2],tm_yday:R[n+28>>2],tm_isdst:R[n+32>>2],tm_gmtoff:R[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 W(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=>W(d).toString().substring(2),"%G":d=>W(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":()=>` | ||
`,"%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 H=ba(i,!1);return H.length>e?0:(Ca(H,t),H.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,W){var x=$();try{T(t)(e,r,n,a,o,i,s,f,l,h,y,v,C,D,W)}catch(H){if(b(x),H!==H+0)throw H;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:j,y:J},topRight:{x:U,y:I},bottomLeft:{x:X,y:Z},bottomRight:{x:Y,y:V}}=E.position,Q=Math.min(j,U,X,Y),A=Math.min(J,I,Z,V),Pt=Math.max(j,U,X,Y),N=Math.max(J,I,Z,V);return{boundingBox:new DOMRectReadOnly(Q,A,Pt-Q,N-A),rawValue:new TextDecoder().decode(E.bytes),format:Pr(E.format),cornerPoints:[{x:j,y:J},{x:U,y:I},{x:Y,y:V},{x:X,y:Z}]}})}catch(P){throw ie(P,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return vt=new WeakMap,M.BarcodeDetector=Er,M.setZXingModuleOverrides=wr,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}),M}({}); |
@@ -1,3 +0,3 @@ | ||
var tr=(H,B,z)=>{if(!B.has(H))throw TypeError("Cannot "+z)};var er=(H,B,z)=>(tr(H,B,"read from private field"),z?z.call(H):B.get(H)),rr=(H,B,z)=>{if(B.has(H))throw TypeError("Cannot add the same private member more than once");B instanceof WeakSet?B.add(H):B.set(H,z)},nr=(H,B,z,yt)=>(tr(H,B,"write to private field"),yt?yt.call(H,z):B.set(H,z),z);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 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(ar(c))return{width:c.width,height:c.height};if(ee(c))return{width:c.width,height:c.height};if(or(c))return{width:c.width,height:c.height};if(re(c))return{width:c.displayWidth,height:c.displayHeight};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 ar(c){try{return c instanceof HTMLCanvasElement}catch{return!1}}function ee(c){try{return c instanceof ImageBitmap}catch{return!1}}function or(c){try{return c instanceof OffscreenCanvas}catch{return!1}}function re(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,v){try{const u=new OffscreenCanvas(c,v);if(u.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return u;throw void 0}catch{const u=document.createElement("canvas");return u.width=c,u.height=v,u}}async function ne(c){if(yt(c)&&!await lr(c))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Kt(c)&&!await dr(c))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(re(c)&&hr(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(ee(c)&&yr(c))throw new DOMException("The image source is detached.","InvalidStateError");const{width:v,height:u}=z(c);if(v===0||u===0)return null;const P=ur(v,u).getContext("2d");P.drawImage(c,0,0);try{return P.getImageData(0,0,v,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function cr(c){let v;try{v=await createImageBitmap(c)}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await ne(v)}async function fr(c){if(ir(c))return await cr(c);if(sr(c)){if(pr(c))throw new DOMException("The image data has been detached.","InvalidStateError");return c}return await ne(c)}async function lr(c){try{return await c.decode(),!0}catch{return!1}}async function dr(c){var v;try{return await((v=c.decode)==null?void 0:v.call(c)),!0}catch{return!1}}function hr(c){return c.format===null}function pr(c){return c.data.buffer.byteLength===0}function yr(c){return c.width===0&&c.height===0}function ae(c,v){return c instanceof DOMException?new DOMException(`${v}: ${c.message}`,c.name):c instanceof Error?new c.constructor(`${v}: ${c.message}`):new Error(`${v}: ${c}`)}const oe=c=>{let v;const u=new Set,w=(M,q)=>{const U=typeof M=="function"?M(v):M;if(!Object.is(U,v)){const j=v;v=q??typeof U!="object"?U:Object.assign({},v,U),u.forEach(G=>G(v,j))}},P=()=>v,F={setState:w,getState:P,subscribe:M=>(u.add(M),()=>u.delete(M)),destroy:()=>{u.clear()}};return v=c(w,P,F),F},vr=c=>c?oe(c):oe,mr={locateFile:(c,v)=>{var u;const w=(u=c.match(/_(.+?)\.wasm$/))==null?void 0:u[1];return w?`https://cdn.jsdelivr.net/npm/@sec-ant/zxing-wasm@2.1.3/dist/${w}/${c}`:v+c}},lt=vr()(()=>({zxingModuleWeakMap:new WeakMap,zxingModuleOverrides:mr}));function gr(c){lt.setState({zxingModuleOverrides:c})}function ie(c,v=lt.getState().zxingModuleOverrides){const{zxingModuleWeakMap:u}=lt.getState(),w=u.get(c);if(w&&Object.is(v,lt.getState().zxingModuleOverrides))return w;{lt.setState({zxingModuleOverrides:v});const P=c(v);return u.set(c,P),P}}const se=["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 wr(c,{tryHarder:v=nt.tryHarder,formats:u=nt.formats,maxSymbols:w=nt.maxSymbols}=nt,P){const F=await ie(P,lt.getState().zxingModuleOverrides),{data:M,width:q,height:U,data:{byteLength:j}}=c,G=F._malloc(j);F.HEAP8.set(M,G);const J=F.readBarcodesFromPixmap(G,q,U,v,$r(u),w);F._free(G);const L=[];for(let Y=0;Y<J.size();++Y){const Z=J.get(Y);L.push({...Z,format:br(Z.format)})}return L}function $r(c){return c.join("|")}function br(c){const v=ue(c);let u=0,w=se.length-1;for(;u<=w;){const P=Math.floor((u+w)/2),F=se[P],M=ue(F);if(M===v)return F;M<v?u=P+1:w=P-1}return"None"}function ue(c){return c.toLowerCase().replace(/_-\[\]/g,"")}var ce=(()=>{var c=document.currentScript&&document.currentScript.src||new URL("side-effects.js",document.baseURI).href;return function(v={}){var u=v,w,P;u.ready=new Promise((t,e)=>{w=t,P=e});var F=Object.assign({},u),M="./this.program",q=typeof window=="object",U=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var j="";function G(t){return u.locateFile?u.locateFile(t,j):j+t}var J;(q||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&&(J=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 L=u.printErr||console.error.bind(console);Object.assign(u,F),F=null,u.arguments&&u.arguments,u.thisProgram&&(M=u.thisProgram),u.quit&&u.quit;var Y;u.wasmBinary&&(Y=u.wasmBinary),u.noExitRuntime,typeof WebAssembly!="object"&&At("no native wasm support detected");var Z,E,Pt=!1,Q,V,dt,Et,R,x,le,de;function he(){var t=Z.buffer;u.HEAP8=Q=new Int8Array(t),u.HEAP16=dt=new Int16Array(t),u.HEAP32=R=new Int32Array(t),u.HEAPU8=V=new Uint8Array(t),u.HEAPU16=Et=new Uint16Array(t),u.HEAPU32=x=new Uint32Array(t),u.HEAPF32=le=new Float32Array(t),u.HEAPF64=de=new Float64Array(t)}var pe,ye=[],ve=[],me=[];function Er(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Sr(u.preRun.shift());Bt(ye)}function Ar(){Bt(ve)}function Dr(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Fr(u.postRun.shift());Bt(me)}function Sr(t){ye.unshift(t)}function xr(t){ve.unshift(t)}function Fr(t){me.unshift(t)}var it=0,mt=null;function Or(t){it++,u.monitorRunDependencies&&u.monitorRunDependencies(it)}function Mr(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+")",L(t),Pt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw P(e),e}var jr="data:application/octet-stream;base64,";function ge(t){return t.startsWith(jr)}var st;u.locateFile?(st="zxing_reader.wasm",ge(st)||(st=G(st))):st=new URL("/reader/zxing_reader.wasm",self.location).href;function we(t){if(t==st&&Y)return new Uint8Array(Y);if(J)return J(t);throw"both async and sync fetching of the wasm failed"}function Rr(t){return!Y&&(q||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(()=>we(t)):Promise.resolve().then(()=>we(t))}function $e(t,e,r){return Rr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{L("failed to asynchronously prepare wasm: "+n),At(n)})}function Ir(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!ge(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(i){return L("wasm streaming compile failed: "+i),L("falling back to ArrayBuffer instantiation"),$e(e,r,n)})}):$e(e,r,n)}function Wr(){var t={a:Ta};function e(n,a){var o=n.exports;return E=o,Z=E.qa,he(),pe=E.ua,xr(E.ra),Mr(),o}Or();function r(n){e(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(t,e)}catch(n){L("Module.instantiateWasm callback failed with error: "+n),P(n)}return Ir(Y,st,t,r).catch(P),{}}var Bt=t=>{for(;t.length>0;)t.shift()(u)},Dt=[],St=0;function Hr(t){var e=new xt(t);return e.get_caught()||(e.set_caught(!0),St--),e.set_rethrown(!1),Dt.push(e),Xe(e.excPtr),e.get_exception_ptr()}var K=0;function kr(){g(0,0);var t=Dt.pop();Ge(t.excPtr),K=0}function xt(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,Q[this.ptr+12>>0]=e},this.get_caught=function(){return Q[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,Q[this.ptr+13>>0]=e},this.get_rethrown=function(){return Q[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=Je(this.get_type());if(e)return x[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}function Br(t){throw K||(K=t),K}var Ut=t=>{var e=K;if(!e)return Tt(0),0;var r=new xt(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(qe(o,n,i))return Tt(o),e}return Tt(n),e},Ur=()=>Ut([]),Vr=t=>Ut([t]),zr=(t,e)=>Ut([t,e]);function Lr(t){var e=new xt(t).get_exception_ptr();return e}function Yr(){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),St++),K=e,K}function Nr(t,e,r){var n=new xt(t);throw n.init(e,r),K=t,St++,K}function Gr(){return St}var Ft={};function be(t){for(;t.length;){var e=t.pop(),r=t.pop();r(e)}}function gt(t){return this.fromWireType(R[t>>2])}var ht={},ut={},Ot={},Ce=void 0;function Mt(t){throw new Ce(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 Xr=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],m=f.getter,C=f.getterContext,A=i[l+a.length],I=f.setter,D=f.setterContext;s[h]={read:W=>y.fromWireType(m(C,W)),write:(W,d)=>{var p=[];I(D,W,A.toWireType(p,d)),be(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 qr(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 Jr(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);_e=t}var _e=void 0;function k(t){for(var e="",r=t;V[r];)e+=_e[V[r++]];return e}var pt=void 0;function _(t){throw new pt(t)}function Zr(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 Zr(t,e,r)}function Qr(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=Q;else if(r===2)s=dt;else if(r===4)s=R;else throw new TypeError("Unknown boolean type size: "+e);return this.fromWireType(s[i>>o])},destructorFunction:null})}function Kr(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 tn(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 Te(t){}function en(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}function Pe(t){t.count.value-=1;var e=t.count.value===0;e&&en(t)}function Ee(t,e,r){if(e===r)return t;if(r.baseClass===void 0)return null;var n=Ee(t,e,r.baseClass);return n===null?null:r.downcast(n)}var Ae={};function rn(){return Object.keys(bt).length}function nn(){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 an(t){$t=t,wt.length&&$t&&$t(Yt)}function on(){u.getInheritedInstanceCount=rn,u.getLiveInheritedInstances=nn,u.flushPendingDeletes=Yt,u.setDelayFunction=an}var bt={};function sn(t,e){for(e===void 0&&_("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}function un(t,e){return e=sn(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 cn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=un(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=Ae[o];if(!i)return a.call(this);var s;this.isConst?s=i.constPointerType:s=i.pointerType;var f=Ee(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=>{Pe(e.$$)}),Ct=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Lt.register(e,a,e)}return e},Te=e=>Lt.unregister(e),Ct(t))};function fn(){if(this.$$.ptr||zt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Ct(Object.create(Object.getPrototypeOf(this),{$$:{value:tn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function ln(){this.$$.ptr||zt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&_("Object already scheduled for deletion"),Te(this),Pe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function dn(){return!this.$$.ptr}function hn(){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 pn(){at.prototype.isAliasOf=Kr,at.prototype.clone=fn,at.prototype.delete=ln,at.prototype.isDeleted=dn,at.prototype.deleteLater=hn}function at(){}var yn=48,vn=57;function De(t){if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=yn&&e<=vn?`_${t}`:t}function Se(t,e){return t=De(t),{[t]:function(){return e.apply(this,arguments)}}[t]}function xe(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 Fe(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`),xe(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 mn(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 gn(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 wn(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 $n(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 bn(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function Cn(t){this.rawDestructor&&this.rawDestructor(t)}function _n(t){t!==null&&t.delete()}function Tn(){et.prototype.getPointee=bn,et.prototype.destructor=Cn,et.prototype.argPackAdvance=8,et.prototype.readValueFromPointer=gt,et.prototype.deleteObject=_n,et.prototype.fromWireType=cn}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=gn,this.destructorFunction=null):(this.toWireType=$n,this.destructorFunction=null):this.toWireType=wn}function Oe(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 Pn=(t,e,r)=>{var n=u["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},Rt=[],T=t=>{var e=Rt[t];return e||(t>=Rt.length&&(Rt.length=t+1),Rt[t]=e=pe.get(t)),e},En=(t,e,r)=>{if(t.includes("j"))return Pn(t,e,r);var n=T(e).apply(null,r);return n},An=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),En(t,e,r)}};function X(t,e){t=k(t);function r(){return t.includes("j")?An(t,e):T(e)}var n=r();return typeof n!="function"&&_(`unknown function pointer with signature ${t}: ${e}`),n}function Dn(t,e){var r=Se(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+` | ||
`+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 Me=void 0;function je(t){var e=Ne(t),r=k(e);return rt(e),r}function It(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 Me(`${t}: `+r.map(je).join([", "]))}function Sn(t,e,r,n,a,o,i,s,f,l,h,y,m){h=k(h),o=X(a,o),s&&(s=X(i,s)),l&&(l=X(f,l)),m=X(y,m);var C=De(h);Fe(C,function(){It(`Cannot construct ${h} due to unbound types`,[n])}),ct([t,e,r],n?[n]:[],function(A){A=A[0];var I,D;n?(I=A.registeredClass,D=I.instancePrototype):D=at.prototype;var W=Se(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(D,{constructor:{value:W}});W.prototype=d;var p=new mn(h,W,d,m,I,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 Ae[t]={pointerType:O,constPointerType:ft},Oe(C,W),[S,O,ft]})}function 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&&_("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,m=new Array(y),C=[],A=[];return function(){arguments.length!==y&&_(`function ${t} called with ${arguments.length} arguments, expected ${y} args!`),A.length=0;var I;C.length=s?2:1,C[0]=a,s&&(I=e[1].toWireType(A,this),C[1]=I);for(var D=0;D<y;++D)m[D]=e[D+2].toWireType(A,arguments[D]),C.push(m[D]);var W=n.apply(null,C);function d(p){if(f)be(A);else for(var S=s?1:2;S<e.length;S++){var O=S===1?I:m[S-2];e[S].destructorFunction!==null&&e[S].destructorFunction(O)}if(h)return e[0].fromWireType(p)}return d(W)}}function xn(t,e,r,n,a,o){var i=Gt(e,r);a=X(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]=()=>{It(`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 Fn(t,e,r,n,a,o,i,s,f){var l=Gt(r,n);e=k(e),o=X(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 m(){It(`Cannot call ${y} due to unbound types`,l)}var C=h.registeredClass.instancePrototype,A=C[e];return A===void 0||A.overloadTable===void 0&&A.className!==h.name&&A.argCount===r-2?(m.argCount=r-2,m.className=h.name,C[e]=m):(xe(C,e,y),C[e].overloadTable[r-2]=m),ct([],l,function(I){var D=Xt(y,I,h,o,i);return C[e].overloadTable===void 0?(D.argCount=r-2,C[e]=D):C[e].overloadTable[r-2]=D,[]}),[]})}function On(){Object.assign(Re.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 Re(){this.allocated=[void 0],this.freelist=[]}var N=new Re;function Ie(t){t>=N.reserved&&--N.get(t).refcount===0&&N.free(t)}function Mn(){for(var t=0,e=N.reserved;e<N.allocated.length;++e)N.allocated[e]!==void 0&&++t;return t}function jn(){N.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),N.reserved=N.allocated.length,u.count_emval_handles=Mn}var ot={toValue:t=>(t||_("Cannot use deleted val. handle = "+t),N.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 N.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 Ie(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 In(t,e){switch(e){case 2:return function(r){return this.fromWireType(le[r>>2])};case 3:return function(r){return this.fromWireType(de[r>>3])};default:throw new TypeError("Unknown float type: "+t)}}function Wn(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:In(e,n),destructorFunction:null})}function Hn(t,e,r,n,a,o,i){var s=Gt(e,r);t=k(t),a=X(n,a),Fe(t,function(){It(`Cannot call ${t} due to unbound types`,s)},e-1),ct([],s,function(f){var l=[f[0],null].concat(f.slice(1));return Oe(t,Xt(t,l,null,a,o),e-1),[]})}function kn(t,e,r){switch(e){case 0:return r?function(n){return Q[n]}:function(n){return V[n]};case 1:return r?function(n){return dt[n>>1]}:function(n){return Et[n>>1]};case 2:return r?function(n){return R[n>>2]}:function(n){return x[n>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function Bn(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,m)=>{},h;f?h=function(y,m){return l(m,this.name),m>>>0}:h=function(y,m){return l(m,this.name),m},tt(t,{name:e,fromWireType:i,toWireType:h,argPackAdvance:8,readValueFromPointer:kn(e,o,n!==0),destructorFunction:null})}function Un(t,e,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(i){i=i>>2;var s=x,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 We=(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},Vn=(t,e,r)=>We(t,V,e,r),He=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},ke=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,zn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&ke)return ke.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?zn(V,t,e):"";function Ln(t,e){e=k(e);var r=e==="std::string";tt(t,{name:e,fromWireType:function(n){var a=x[n>>2],o=n+4,i;if(r)for(var s=o,f=0;f<=a;++f){var l=o+f;if(f==a||V[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 m=new Array(a),f=0;f<a;++f)m[f]=String.fromCharCode(V[o+f]);i=m.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=He(a):o=a.length;var s=Qt(4+o+1),f=s+4;if(x[s>>2]=o,r&&i)Vn(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")),V[f+l]=h}else for(var l=0;l<o;++l)V[f+l]=a[l];return n!==null&&n.push(rt,s),s},argPackAdvance:8,readValueFromPointer:gt,destructorFunction:function(n){rt(n)}})}var Be=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Yn=(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&&Be)return Be.decode(V.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},Nn=(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},Gn=t=>t.length*2,Xn=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=R[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(R[e>>2]=i,e+=4,e+4>a)break}return R[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},Zn=function(t,e,r){r=k(r);var n,a,o,i,s;e===2?(n=Yn,a=Nn,i=Gn,o=()=>Et,s=1):e===4&&(n=Xn,a=qn,i=Jn,o=()=>x,s=2),tt(t,{name:r,fromWireType:function(f){for(var l=x[f>>2],h=o(),y,m=f+4,C=0;C<=l;++C){var A=f+4+C*e;if(C==l||h[A>>s]==0){var I=A-m,D=n(m,I);y===void 0?y=D:(y+=String.fromCharCode(0),y+=D),m=A+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 x[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 Qn(t,e,r,n,a,o){Ft[t]={name:k(e),rawConstructor:X(r,n),rawDestructor:X(a,o),fields:[]}}function Kn(t,e,r,n,a,o,i,s,f,l){Ft[t].fields.push({fieldName:k(e),getterReturnType:r,getter:X(n,a),getterContext:o,setterArgumentType:i,setter:X(s,f),setterContext:l})}function ta(t,e){e=k(e),tt(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:function(){},toWireType:function(r,n){}})}var ea={};function ra(t){var e=ea[t];return e===void 0?k(t):e}function Ue(){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 na(t){return t===0?ot.toHandle(Ue()):(t=ra(t),ot.toHandle(Ue()[t]))}function aa(t){t>4&&(N.get(t).refcount+=1)}function Ve(t,e){var r=ut[t];return r===void 0&&_(e+" has unknown type "+je(t)),r}function oa(t){var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var i=Ve(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 ot.toHandle(s)}}var ze={};function ia(t,e,r,n){t=ot.toValue(t);var a=ze[e];return a||(a=oa(e),ze[e]=a),a(t,r,n)}function sa(t,e){t=Ve(t,"_emval_take_value");var r=t.readValueFromPointer(e);return ot.toHandle(r)}var ua=()=>{At("")},ca=(t,e,r)=>V.copyWithin(t,e,e+r),fa=()=>2147483648,la=t=>{var e=Z.buffer,r=t-e.byteLength+65535>>>16;try{return Z.grow(r),he(),1}catch{}},da=t=>{var e=V.length;t>>>=0;var r=fa();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=la(i);if(s)return!0}return!1},Zt={},ha=()=>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,_:ha()};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},pa=(t,e)=>{for(var r=0;r<t.length;++r)Q[e++>>0]=t.charCodeAt(r);Q[e>>0]=0},ya=(t,e)=>{var r=0;return _t().forEach(function(n,a){var o=e+r;x[t+a*4>>2]=o,pa(n,o),r+=n.length+1}),0},va=(t,e)=>{var r=_t();x[t>>2]=r.length;var n=0;return r.forEach(function(a){n+=a.length+1}),x[e>>2]=n,0};function ma(t){return t}var Wt=t=>t%4===0&&(t%100!==0||t%400===0),ga=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Le=[31,29,31,30,31,30,31,31,30,31,30,31],Ye=[31,28,31,30,31,30,31,31,30,31,30,31],wa=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Wt(r.getFullYear()),a=r.getMonth(),o=(n?Le:Ye)[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 $a(t,e,r){var n=r>0?r:He(t)+1,a=new Array(n),o=We(t,a,0,a.length);return e&&(a.length=o),a}var ba=(t,e)=>{Q.set(t,e)},Ca=(t,e,r,n)=>{var a=R[n+40>>2],o={tm_sec:R[n>>2],tm_min:R[n+4>>2],tm_hour:R[n+8>>2],tm_mday:R[n+12>>2],tm_mon:R[n+16>>2],tm_year:R[n+20>>2],tm_wday:R[n+24>>2],tm_yday:R[n+28>>2],tm_isdst:R[n+32>>2],tm_gmtoff:R[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 m(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 A(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 I(d){var p=wa(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=A(S),kt=A(O);return C(ft,p)<=0?C(kt,p)<=0?p.getFullYear()+1:p.getFullYear():p.getFullYear()-1}var D={"%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 m(p/100|0,2)},"%d":d=>m(d.tm_mday,2),"%e":d=>y(d.tm_mday,2," "),"%g":d=>I(d).toString().substring(2),"%G":d=>I(d),"%H":d=>m(d.tm_hour,2),"%I":d=>{var p=d.tm_hour;return p==0?p=12:p>12&&(p-=12),m(p,2)},"%j":d=>m(d.tm_mday+ga(Wt(d.tm_year+1900)?Le:Ye,d.tm_mon-1),3),"%m":d=>m(d.tm_mon+1,2),"%M":d=>m(d.tm_min,2),"%n":()=>` | ||
`,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>m(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var p=d.tm_yday+7-d.tm_wday;return m(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 m(p,2)},"%w":d=>d.tm_wday,"%W":d=>{var p=d.tm_yday+7-(d.tm_wday+6)%7;return m(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 D)i.includes(f)&&(i=i.replace(new RegExp(f,"g"),D[f](o)));i=i.replace(/\0\0/g,"%");var W=$a(i,!1);return W.length>e?0:(ba(W,t),W.length-1)},_a=(t,e,r,n,a)=>Ca(t,e,r,n);Ce=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"}},pn(),on(),Tn(),Me=u.UnboundTypeError=Dn(Error,"UnboundTypeError"),On(),jn();var Ta={q:Hr,u:kr,a:Ur,h:Vr,l:zr,I:Lr,P:Yr,n:Nr,ba:Gr,d:Br,oa:Xr,Y:qr,fa:Qr,na:Sn,ma:xn,D:Fn,ea:Rn,W:Wn,J:Hn,w:Bn,s:Un,V:Ln,L:Zn,Q:Qn,pa:Kn,ga:ta,U:Ie,la:na,R:aa,ia,ka:sa,K:ua,da:ca,ca:da,$:ya,aa:va,H:za,T:Qa,B:Ya,p:Ba,b:Pa,C:Va,ha:Ga,c:xa,j:Oa,i:Da,x:La,O:Ua,v:Ha,G:qa,N:Ja,A:Na,F:Ka,Z:eo,X:ro,k:Fa,f:Sa,e:Aa,g:Ea,M:Za,m:Wa,o:Ma,S:ja,t:Ia,ja:ka,y:Xa,r:Ra,E:to,z:ma,_:_a};Wr();var rt=u._free=t=>(rt=u._free=E.sa)(t),Qt=u._malloc=t=>(Qt=u._malloc=E.ta)(t),Ne=t=>(Ne=E.va)(t);u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=E.wa)();var g=(t,e)=>(g=E.xa)(t,e),Tt=t=>(Tt=E.ya)(t),$=()=>($=E.za)(),b=t=>(b=E.Aa)(t),Ge=t=>(Ge=E.Ba)(t),Xe=t=>(Xe=E.Ca)(t),qe=(t,e,r)=>(qe=E.Da)(t,e,r),Je=t=>(Je=E.Ea)(t);u.dynCall_viijii=(t,e,r,n,a,o,i)=>(u.dynCall_viijii=E.Fa)(t,e,r,n,a,o,i);var Ze=u.dynCall_jiii=(t,e,r,n)=>(Ze=u.dynCall_jiii=E.Ga)(t,e,r,n),Qe=u.dynCall_jiiii=(t,e,r,n,a)=>(Qe=u.dynCall_jiiii=E.Ha)(t,e,r,n,a);u.dynCall_iiiiij=(t,e,r,n,a,o,i)=>(u.dynCall_iiiiij=E.Ia)(t,e,r,n,a,o,i),u.dynCall_iiiiijj=(t,e,r,n,a,o,i,s,f)=>(u.dynCall_iiiiijj=E.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=E.Ka)(t,e,r,n,a,o,i,s,f,l);function Pa(t,e){var r=$();try{return T(t)(e)}catch(n){if(b(r),n!==n+0)throw n;g(1,0)}}function Ea(t,e,r,n){var a=$();try{T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(1,0)}}function Aa(t,e,r){var n=$();try{T(t)(e,r)}catch(a){if(b(n),a!==a+0)throw a;g(1,0)}}function Da(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;g(1,0)}}function Sa(t,e){var r=$();try{T(t)(e)}catch(n){if(b(r),n!==n+0)throw n;g(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;g(1,0)}}function Fa(t){var e=$();try{T(t)()}catch(r){if(b(e),r!==r+0)throw r;g(1,0)}}function Oa(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(1,0)}}function Ma(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;g(1,0)}}function ja(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;g(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(m){if(b(y),m!==m+0)throw m;g(1,0)}}function Ia(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;g(1,0)}}function Wa(t,e,r,n,a){var o=$();try{T(t)(e,r,n,a)}catch(i){if(b(o),i!==i+0)throw i;g(1,0)}}function Ha(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;g(1,0)}}function ka(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;g(1,0)}}function Ba(t){var e=$();try{return T(t)()}catch(r){if(b(e),r!==r+0)throw r;g(1,0)}}function Ua(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;g(1,0)}}function Va(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(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;g(1,0)}}function La(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;g(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;g(1,0)}}function Na(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;g(1,0)}}function Ga(t,e,r){var n=$();try{return T(t)(e,r)}catch(a){if(b(n),a!==a+0)throw a;g(1,0)}}function Xa(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;g(1,0)}}function qa(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;g(1,0)}}function Ja(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;g(1,0)}}function Za(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;g(1,0)}}function Qa(t,e,r,n){var a=$();try{return T(t)(e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(1,0)}}function Ka(t,e,r,n,a,o,i,s,f,l,h,y){var m=$();try{return T(t)(e,r,n,a,o,i,s,f,l,h,y)}catch(C){if(b(m),C!==C+0)throw C;g(1,0)}}function to(t,e,r,n,a,o,i,s,f,l,h,y,m,C,A,I){var D=$();try{T(t)(e,r,n,a,o,i,s,f,l,h,y,m,C,A,I)}catch(W){if(b(D),W!==W+0)throw W;g(1,0)}}function eo(t,e,r,n){var a=$();try{return Ze(t,e,r,n)}catch(o){if(b(a),o!==o+0)throw o;g(1,0)}}function ro(t,e,r,n,a){var o=$();try{return Qe(t,e,r,n,a)}catch(i){if(b(o),i!==i+0)throw i;g(1,0)}}var Ht;mt=function t(){Ht||Ke(),Ht||(mt=t)};function Ke(){if(it>0||(Er(),it>0))return;function t(){Ht||(Ht=!0,u.calledRun=!0,!Pt&&(Ar(),w(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Dr()))}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 Ke(),v.ready}})();function Cr(c){return ie(ce,c)}async function _r(c,{tryHarder:v=nt.tryHarder,formats:u=nt.formats,maxSymbols:w=nt.maxSymbols}=nt){return wr(c,{tryHarder:v,formats:u,maxSymbols:w},ce)}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 Tr(c){for(const[v,u]of fe)if(c===u)return v;return"unknown"}class Pr{constructor(v={}){rr(this,vt,void 0);var u;try{const w=(u=v==null?void 0:v.formats)==null?void 0:u.filter(P=>P!=="unknown");if((w==null?void 0:w.length)===0)throw new TypeError("Hint option provided, but is empty.");w==null||w.forEach(P=>{if(!B.includes(P))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${P}' is not a valid enum value of type BarcodeFormat.`)}),Cr().catch(()=>{}),nr(this,vt,w??[])}catch(w){throw ae(w,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return B.filter(v=>v!=="unknown")}async detect(v){try{const u=await fr(v);if(u===null)return[];let w;try{w=await _r(u,{tryHarder:!0,formats:er(this,vt).map(P=>fe.get(P))})}catch{throw new DOMException("Barcode detection service unavailable. Use 'setZXingModuleOverrides' in offline or strict CSP environments.","NotSupportedError")}return w.map(P=>{const{topLeft:{x:F,y:M},topRight:{x:q,y:U},bottomLeft:{x:j,y:G},bottomRight:{x:J,y:L}}=P.position,Y=Math.min(F,q,j,J),Z=Math.min(M,U,G,L),E=Math.max(F,q,j,J),Pt=Math.max(M,U,G,L);return{boundingBox:new DOMRectReadOnly(Y,Z,E-Y,Pt-Z),rawValue:new TextDecoder().decode(P.bytes),format:Tr(P.format),cornerPoints:[{x:F,y:M},{x:q,y:U},{x:J,y:L},{x:j,y:G}]}})}catch(u){throw ae(u,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return vt=new WeakMap,globalThis.BarcodeDetector??(globalThis.BarcodeDetector=Pr),H.setZXingModuleOverrides=gr,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"}),H}({}); | ||
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()+` | ||
`+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":()=>` | ||
`,"%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}({}); |
@@ -5,3 +5,3 @@ { | ||
"private": false, | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "files": [ |
@@ -209,6 +209,38 @@ # @sec-ant/barcode-detector | ||
## Lifecycle Events | ||
The `BarcodeDetector` provided by this package also extends class `EventTarget` and provides 2 lifecycle events: `load` and `error`. You can use `addEventListener` and `removeEventListener` to register and remove callback hooks on these events. | ||
### `load` Event | ||
The `load` event, which is a `CustomEvent`, will be dispatched on the successful instanciation of ZXing wasm module. For advanced usage, the instanciated module is passed as the `detail` parameter. | ||
```ts | ||
import { BarcodeDetector } from "@sec-ant/barcode-detector/pure"; | ||
const barcodeDetector = new BarcodeDetector(); | ||
barcodeDetector.addEventListener("load", ({ detail }) => { | ||
console.log(detail); // zxing wasm module | ||
}); | ||
``` | ||
### `error` Event | ||
The `error` event, which is a `CustomEvent`, will be dispatched if the instanciation of ZXing wasm module is failed. An error is passed as the `detail` parameter. | ||
```ts | ||
import { BarcodeDetector } from "@sec-ant/barcode-detector/pure"; | ||
const barcodeDetector = new BarcodeDetector(); | ||
barcodeDetector.addEventListener("error", ({ detail }) => { | ||
console.log(detail); // an error | ||
}); | ||
``` | ||
## Example | ||
```ts | ||
import "@sec-ant/barcode-detector/side-effects"; | ||
import { BarcodeDetector } from "@sec-ant/barcode-detector/pure"; | ||
@@ -215,0 +247,0 @@ const barcodeDetector: BarcodeDetector = new BarcodeDetector({ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
269750
2920
264