barcode-detector 3.0.5 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/ponyfill.js +1 -1
- package/dist/es/ponyfill.js +1197 -1254
- package/dist/iife/index.js +1 -1
- package/dist/iife/polyfill.js +1 -1
- package/dist/iife/ponyfill.js +1 -1
- package/package.json +22 -21
package/dist/iife/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var BarcodeDetectionAPI=function(_){"use strict";var Ze=_=>{throw TypeError(_)};var Qe=(_,M,R)=>M.has(_)||Ze("Cannot "+R);var Je=(_,M,R)=>(Qe(_,M,"read from private field"),R?R.call(_):M.get(_)),Ke=(_,M,R)=>M.has(_)?Ze("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(_):M.set(_,R),tr=(_,M,R,gt)=>(Qe(_,M,"write to private field"),gt?gt.call(_,R):M.set(_,R),R);var ct,me;const M=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],R=M.map(([i])=>i),gt=R.filter((i,f)=>M[f][1]==="L"),er=R.filter((i,f)=>M[f][1]==="M");function Lt(i){switch(i){case"Linear-Codes":return gt.reduce((f,p)=>f|Lt(p),0);case"Matrix-Codes":return er.reduce((f,p)=>f|Lt(p),0);case"Any":return(1<<M.length)-1;case"None":return 0;default:return 1<<R.indexOf(i)}}function rr(i){if(i===0)return"None";const f=31-Math.clz32(i);return R[f]}function nr(i){return i.reduce((f,p)=>f|Lt(p),0)}const ar=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function or(i){return ar.indexOf(i)}const ne=["Unknown","ASCII","ISO8859_1","ISO8859_2","ISO8859_3","ISO8859_4","ISO8859_5","ISO8859_6","ISO8859_7","ISO8859_8","ISO8859_9","ISO8859_10","ISO8859_11","ISO8859_13","ISO8859_14","ISO8859_15","ISO8859_16","Cp437","Cp1250","Cp1251","Cp1252","Cp1256","Shift_JIS","Big5","GB2312","GB18030","EUC_JP","EUC_KR","UTF16BE","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function ir(i){return i==="UnicodeBig"?ne.indexOf("UTF16BE"):ne.indexOf(i)}const sr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function ur(i){return sr[i]}const cr=["Ignore","Read","Require"];function lr(i){return cr.indexOf(i)}const fr=["Plain","ECI","HRI","Hex","Escaped"];function dr(i){return fr.indexOf(i)}const wt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function ae(i){return{...i,formats:nr(i.formats),binarizer:or(i.binarizer),eanAddOnSymbol:lr(i.eanAddOnSymbol),textMode:dr(i.textMode),characterSet:ir(i.characterSet)}}function hr(i){return{...i,format:rr(i.format),contentType:ur(i.contentType),eccLevel:i.ecLevel}}const pr="2.2.0",vr="0a3797f698b339c1c01c487a7a43f1368610f503",yr={locateFile:(i,f)=>{const p=i.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.0/dist/${p[1]}/${i}`:f+i}},$t=new WeakMap;function mr(i,f){return Object.is(i,f)||Object.keys(i).length===Object.keys(f).length&&Object.keys(i).every(p=>Object.hasOwn(f,p)&&i[p]===f[p])}function oe(i,{overrides:f,equalityFn:p=mr,fireImmediately:l=!1}={}){var C;const[A,F]=(C=$t.get(i))!=null?C:[yr],L=f!=null?f:A;let S;if(l){if(F&&(S=p(A,L)))return F;const j=i({...L});return $t.set(i,[L,j]),j}(S!=null?S:p(A,L))||$t.set(i,[L])}function gr(i){$t.delete(i)}async function wr(i,f,p=wt){const l={...wt,...p},C=await oe(i,{fireImmediately:!0});let A,F;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:j},width:q,height:Z}=f;F=C._malloc(j),C.HEAPU8.set(S,F),A=C.readBarcodesFromPixmap(F,q,Z,ae(l))}else{let S,j;if("buffer"in f)[S,j]=[f.byteLength,f];else if("byteLength"in f)[S,j]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,j]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");F=C._malloc(S),C.HEAPU8.set(j,F),A=C.readBarcodesFromImage(F,S,ae(l))}C._free(F);const L=[];for(let S=0;S<A.size();++S)L.push(hr(A.get(S)));return L}({...wt,formats:[...wt.formats]});var Wt=async function(i={}){var f,p,l=i,C,A,F=new Promise((e,t)=>{C=e,A=t}),L=typeof window=="object",S=typeof Bun<"u",j=typeof WorkerGlobalScope<"u";typeof process=="object"&&!((p=process.versions)===null||p===void 0)&&p.node&&process.type!="renderer";var q="./this.program",Z,Q="";function lt(e){return l.locateFile?l.locateFile(e,Q):Q+e}var ft,at;if(L||j||S){try{Q=new URL(".",Z).href}catch{}j&&(at=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),ft=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)}}var bt=console.log.bind(console),Y=console.error.bind(console),dt,Ct,ge=!1,J,V,Tt,ot,it,P,we,$e;function be(){var e=Ct.buffer;J=new Int8Array(e),Tt=new Int16Array(e),l.HEAPU8=V=new Uint8Array(e),ot=new Uint16Array(e),it=new Int32Array(e),P=new Uint32Array(e),we=new Float32Array(e),$e=new Float64Array(e)}function Ur(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)Kr(l.preRun.shift());Ce(Pe)}function Vr(){E.ya()}function kr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)Jr(l.postRun.shift());Ce(Te)}var K=0,ht=null;function Hr(e){var t;K++,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K)}function Nr(e){var t;if(K--,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K),K==0&&ht){var r=ht;ht=null,r()}}function kt(e){var t;(t=l.onAbort)===null||t===void 0||t.call(l,e),e="Aborted("+e+")",Y(e),ge=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw A(r),r}var Pt;function zr(){return lt("zxing_reader.wasm")}function Gr(e){if(e==Pt&&dt)return new Uint8Array(dt);if(at)return at(e);throw"both async and sync fetching of the wasm failed"}async function Xr(e){if(!dt)try{var t=await ft(e);return new Uint8Array(t)}catch{}return Gr(e)}async function qr(e,t){try{var r=await Xr(e),n=await WebAssembly.instantiate(r,t);return n}catch(a){Y(`failed to asynchronously prepare wasm: ${a}`),kt(a)}}async function Yr(e,t,r){if(!e&&typeof WebAssembly.instantiateStreaming=="function")try{var n=fetch(t,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(o){Y(`wasm streaming compile failed: ${o}`),Y("falling back to ArrayBuffer instantiation")}return qr(t,r)}function Zr(){return{a:Ma}}async function Qr(){function e(o,u){return E=o.exports,Ct=E.xa,be(),Fe=E.Ba,Nr(),E}Hr();function t(o){return e(o.instance)}var r=Zr();if(l.instantiateWasm)return new Promise((o,u)=>{l.instantiateWasm(r,(s,c)=>{o(e(s))})});Pt!=null||(Pt=zr());try{var n=await Yr(dt,Pt,r),a=t(n);return a}catch(o){return A(o),Promise.reject(o)}}var Ce=e=>{for(;e.length>0;)e.shift()(l)},Te=[],Jr=e=>Te.push(e),Pe=[],Kr=e=>Pe.push(e),m=e=>Ba(e),g=()=>La(),_t=[],Et=0,tn=e=>{var t=new Ht(e);return t.get_caught()||(t.set_caught(!0),Et--),t.set_rethrown(!1),_t.push(t),Ua(e),ja(e)},N=0,en=()=>{y(0,0);var e=_t.pop();Wa(e.excPtr),N=0};class Ht{constructor(t){this.excPtr=t,this.ptr=t-24}set_type(t){P[this.ptr+4>>2]=t}get_type(){return P[this.ptr+4>>2]}set_destructor(t){P[this.ptr+8>>2]=t}get_destructor(){return P[this.ptr+8>>2]}set_caught(t){t=t?1:0,J[this.ptr+12]=t}get_caught(){return J[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,J[this.ptr+13]=t}get_rethrown(){return J[this.ptr+13]!=0}init(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r)}set_adjusted_ptr(t){P[this.ptr+16>>2]=t}get_adjusted_ptr(){return P[this.ptr+16>>2]}}var Ot=e=>Ra(e),Nt=e=>{var t=N;if(!t)return Ot(0),0;var r=new Ht(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ot(0),t;for(var a of e){if(a===0||a===n)break;var o=r.ptr+16;if(Va(a,n,o))return Ot(a),t}return Ot(n),t},rn=()=>Nt([]),nn=e=>Nt([e]),an=(e,t)=>Nt([e,t]),on=()=>{var e=_t.pop();e||kt("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(_t.push(e),e.set_rethrown(!0),e.set_caught(!1),Et++),N=t,N},sn=(e,t,r)=>{var n=new Ht(e);throw n.init(t,r),N=e,Et++,N},un=()=>Et,cn=e=>{throw N||(N=e),N},ln=()=>kt(""),At={},zt=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function pt(e){return this.fromWireType(P[e>>2])}var st={},tt={},St={},fn=class extends Error{constructor(e){super(e),this.name="InternalError"}},Dt=e=>{throw new fn(e)},et=(e,t,r)=>{e.forEach(s=>St[s]=t);function n(s){var c=r(s);c.length!==e.length&&Dt("Mismatched type converter count");for(var d=0;d<e.length;++d)H(e[d],c[d])}var a=new Array(t.length),o=[],u=0;t.forEach((s,c)=>{tt.hasOwnProperty(s)?a[c]=tt[s]:(o.push(s),st.hasOwnProperty(s)||(st[s]=[]),st[s].push(()=>{a[c]=tt[s],++u,u===o.length&&n(a)}))}),o.length===0&&n(a)},dn=e=>{var t=At[e];delete At[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([e],o,u=>{var s={};return a.forEach((c,d)=>{var h=c.fieldName,v=u[d],$=u[d].optional,b=c.getter,O=c.getterContext,I=u[d+a.length],D=c.setter,x=c.setterContext;s[h]={read:X=>v.fromWireType(b(O,X)),write:(X,W)=>{var U=[];D(x,X,I.toWireType(U,W)),zt(U)},optional:$}}),[{name:t.name,fromWireType:c=>{var d={};for(var h in s)d[h]=s[h].read(c);return n(c),d},toWireType:(c,d)=>{for(var h in s)if(!(h in d)&&!s[h].optional)throw new TypeError(`Missing field: "${h}"`);var v=r();for(h in s)s[h].write(v,d[h]);return c!==null&&c.push(n,v),v},argPackAdvance:z,readValueFromPointer:pt,destructorFunction:n}]})},hn=(e,t,r,n,a)=>{},pn=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);_e=e},_e,B=e=>{for(var t="",r=e;V[r];)t+=_e[V[r++]];return t},vt=class extends Error{constructor(e){super(e),this.name="BindingError"}},T=e=>{throw new vt(e)};function vn(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=t.name;if(e||T(`type "${n}" must have a positive integer typeid pointer`),tt.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(tt[e]=t,delete St[e],st.hasOwnProperty(e)){var a=st[e];delete st[e],a.forEach(o=>o())}}function H(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return vn(e,t,r)}var z=8,yn=(e,t,r,n)=>{t=B(t),H(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:z,readValueFromPointer:function(a){return this.fromWireType(V[a])},destructorFunction:null})},mn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Gt=e=>{function t(r){return r.$$.ptrType.registeredClass.name}T(t(e)+" instance already deleted")},Xt=!1,Ee=e=>{},gn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Oe=e=>{e.count.value-=1;var t=e.count.value===0;t&&gn(e)},yt=e=>typeof FinalizationRegistry>"u"?(yt=t=>t,e):(Xt=new FinalizationRegistry(t=>{Oe(t.$$)}),yt=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(t,a,t)}return t},Ee=t=>Xt.unregister(t),yt(e)),wn=()=>{let e=It.prototype;Object.assign(e,{isAliasOf(r){if(!(this instanceof It)||!(r instanceof It))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var o=r.$$.ptrType.registeredClass,u=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;o.baseClass;)u=o.upcast(u),o=o.baseClass;return n===o&&a===u},clone(){if(this.$$.ptr||Gt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:mn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),Ee(this),Oe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)};function It(){}var qt=(e,t)=>Object.defineProperty(t,"name",{value:e}),Ae={},Se=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return e[t].overloadTable.hasOwnProperty(o.length)||T(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[o.length].apply(this,o)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},De=(e,t,r)=>{l.hasOwnProperty(e)?((r===void 0||l[e].overloadTable!==void 0&&l[e].overloadTable[r]!==void 0)&&T(`Cannot register public name '${e}' twice`),Se(l,e,e),l[e].overloadTable.hasOwnProperty(r)&&T(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[e].overloadTable[r]=t):(l[e]=t,l[e].argCount=r)},$n=48,bn=57,Cn=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=$n&&t<=bn?`_${e}`:e};function Tn(e,t,r,n,a,o,u,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Yt=(e,t,r)=>{for(;t!==r;)t.upcast||T(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e},Zt=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e};function Pn(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(t)}" as a ${this.name}`),t.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=Yt(t.$$.ptr,r,this.registeredClass);return n}function _n(e,t){var r;if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&T(`Cannot pass "${Zt(t)}" as a ${this.name}`),t.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&T(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=Yt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&T("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:T(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var a=t.clone();r=this.rawShare(r,G.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:T("Unsupporting sharing policy")}return r}function En(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(t)}" as a ${this.name}`),t.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&T(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=Yt(t.$$.ptr,r,this.registeredClass);return n}var Ie=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=Ie(e,t,r.baseClass);return n===null?null:r.downcast(n)},On={},An=(e,t)=>{for(t===void 0&&T("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},Sn=(e,t)=>(t=An(e,t),On[t]),xt=(e,t)=>{(!t.ptrType||!t.ptr)&&Dt("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Dt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},yt(Object.create(e,{$$:{value:t,writable:!0}}))};function Dn(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Sn(this.registeredClass,t);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?xt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):xt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(t),u=Ae[o];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var c=Ie(t,this.registeredClass,s.registeredClass);return c===null?a.call(this):this.isSmartPointer?xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c,smartPtrType:this,smartPtr:e}):xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c})}var In=()=>{Object.assign(Mt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t;(t=this.rawDestructor)===null||t===void 0||t.call(this,e)},argPackAdvance:z,readValueFromPointer:pt,fromWireType:Dn})};function Mt(e,t,r,n,a,o,u,s,c,d,h){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=h,!a&&t.baseClass===void 0?n?(this.toWireType=Pn,this.destructorFunction=null):(this.toWireType=En,this.destructorFunction=null):this.toWireType=_n}var xe=(e,t,r)=>{l.hasOwnProperty(e)||Dt("Replacing nonexistent public symbol"),l[e].overloadTable!==void 0&&r!==void 0?l[e].overloadTable[r]=t:(l[e]=t,l[e].argCount=r)},Me=[],Fe,w=e=>{var t=Me[e];return t||(Me[e]=t=Fe.get(e)),t},xn=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.includes("j"))return dynCallLegacy(e,t,r);var n=w(t),a=n(...r);return a},Mn=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return xn(e,t,a,r)}},k=function(e,t){e=B(e);function r(){if(e.includes("j"))return Mn(e,t);var a=w(t);return a}var n=r();return typeof n!="function"&&T(`unknown function pointer with signature ${e}: ${t}`),n};class Fn extends Error{}var je=e=>{var t=Fa(e),r=B(t);return nt(t),r},Ft=(e,t)=>{var r=[],n={};function a(o){if(!n[o]&&!tt[o]){if(St[o]){St[o].forEach(a);return}r.push(o),n[o]=!0}}throw t.forEach(a),new Fn(`${e}: `+r.map(je).join([", "]))},jn=(e,t,r,n,a,o,u,s,c,d,h,v,$)=>{h=B(h),o=k(a,o),s&&(s=k(u,s)),d&&(d=k(c,d)),$=k(v,$);var b=Cn(h);De(b,function(){Ft(`Cannot construct ${h} due to unbound types`,[n])}),et([e,t,r],n?[n]:[],O=>{O=O[0];var I,D;n?(I=O.registeredClass,D=I.instancePrototype):D=It.prototype;var x=qt(h,function(){if(Object.getPrototypeOf(this)!==X)throw new vt(`Use 'new' to construct ${h}`);if(W.constructor_body===void 0)throw new vt(`${h} has no accessible constructor`);for(var qe=arguments.length,Rt=new Array(qe),Bt=0;Bt<qe;Bt++)Rt[Bt]=arguments[Bt];var Ye=W.constructor_body[Rt.length];if(Ye===void 0)throw new vt(`Tried to invoke ctor of ${h} with invalid number of parameters (${Rt.length}) - expected (${Object.keys(W.constructor_body).toString()}) parameters instead!`);return Ye.apply(this,Rt)}),X=Object.create(D,{constructor:{value:x}});x.prototype=X;var W=new Tn(h,x,X,$,I,o,s,d);if(W.baseClass){var U,jt;(jt=(U=W.baseClass).__derivedClasses)!==null&&jt!==void 0||(U.__derivedClasses=[]),W.baseClass.__derivedClasses.push(W)}var Oo=new Mt(h,W,!0,!1,!1),Ge=new Mt(h+"*",W,!1,!1,!1),Xe=new Mt(h+" const*",W,!1,!0,!1);return Ae[e]={pointerType:Ge,constPointerType:Xe},xe(b,x),[Oo,Ge,Xe]})},Qt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(P[t+n*4>>2]);return r};function Rn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Jt(e,t,r,n,a,o){var u=t.length;u<2&&T("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=t[1]!==null&&r!==null,c=Rn(t),d=t[0].name!=="void",h=u-2,v=new Array(h),$=[],b=[],O=function(){b.length=0;var I;$.length=s?2:1,$[0]=a,s&&(I=t[1].toWireType(b,this),$[1]=I);for(var D=0;D<h;++D)v[D]=t[D+2].toWireType(b,D<0||arguments.length<=D?void 0:arguments[D]),$.push(v[D]);var x=n(...$);function X(W){if(c)zt(b);else for(var U=s?1:2;U<t.length;U++){var jt=U===1?I:v[U-2];t[U].destructorFunction!==null&&t[U].destructorFunction(jt)}if(d)return t[0].fromWireType(W)}return X(x)};return qt(e,O)}var Bn=(e,t,r,n,a,o)=>{var u=Qt(t,r);a=k(n,a),et([],[e],s=>{s=s[0];var c=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[t-1]!==void 0)throw new vt(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[t-1]=()=>{Ft(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,d=>(d.splice(1,0,null),s.registeredClass.constructor_body[t-1]=Jt(c,d,null,a,o),[])),[]})},Re=e=>{e=e.trim();const t=e.indexOf("(");return t===-1?e:e.slice(0,t)},Ln=(e,t,r,n,a,o,u,s,c,d)=>{var h=Qt(r,n);t=B(t),t=Re(t),o=k(a,o),et([],[e],v=>{v=v[0];var $=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&v.registeredClass.pureVirtualFunctions.push(t);function b(){Ft(`Cannot call ${$} due to unbound types`,h)}var O=v.registeredClass.instancePrototype,I=O[t];return I===void 0||I.overloadTable===void 0&&I.className!==v.name&&I.argCount===r-2?(b.argCount=r-2,b.className=v.name,O[t]=b):(Se(O,t,$),O[t].overloadTable[r-2]=b),et([],h,D=>{var x=Jt($,D,v,o,u);return O[t].overloadTable===void 0?(x.argCount=r-2,O[t]=x):O[t].overloadTable[r-2]=x,[]}),[]})},Be=[],rt=[0,1,,1,null,1,!0,1,!1,1],Kt=e=>{e>9&&--rt[e+1]===0&&(rt[e]=void 0,Be.push(e))},G={toValue:e=>(e||T(`Cannot use deleted val. handle = ${e}`),rt[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=Be.pop()||rt.length;return rt[t]=e,rt[t+1]=1,t}}}},Le={name:"emscripten::val",fromWireType:e=>{var t=G.toValue(e);return Kt(e),t},toWireType:(e,t)=>G.toHandle(t),argPackAdvance:z,readValueFromPointer:pt,destructorFunction:null},Wn=e=>H(e,Le),Un=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(we[r>>2])};case 8:return function(r){return this.fromWireType($e[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Vn=(e,t,r)=>{t=B(t),H(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:z,readValueFromPointer:Un(t,r),destructorFunction:null})},kn=(e,t,r,n,a,o,u,s)=>{var c=Qt(t,r);e=B(e),e=Re(e),a=k(n,a),De(e,function(){Ft(`Cannot call ${e} due to unbound types`,c)},t-1),et([],c,d=>{var h=[d[0],null].concat(d.slice(1));return xe(e,Jt(e,h,null,a,o),t-1),[]})},Hn=(e,t,r)=>{switch(t){case 1:return r?n=>J[n]:n=>V[n];case 2:return r?n=>Tt[n>>1]:n=>ot[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Nn=(e,t,r,n,a)=>{t=B(t);const o=n===0;let u=c=>c;if(o){var s=32-8*r;u=c=>c<<s>>>s,a=u(a)}H(e,{name:t,fromWireType:u,toWireType:(c,d)=>d,argPackAdvance:z,readValueFromPointer:Hn(t,r,n!==0),destructorFunction:null})},zn=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function o(u){var s=P[u>>2],c=P[u+4>>2];return new a(J.buffer,c,s)}r=B(r),H(e,{name:r,fromWireType:o,argPackAdvance:z,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Gn=Object.assign({optional:!0},Le),Xn=(e,t)=>{H(e,Gn)},qn=(e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,u=0;u<e.length;++u){var s=e.charCodeAt(u);if(s>=55296&&s<=57343){var c=e.charCodeAt(++u);s=65536+((s&1023)<<10)|c&1023}if(s<=127){if(r>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|s&63}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|s&63}else{if(r+3>=o)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|s&63}}return t[r]=0,r-a},ut=(e,t,r)=>qn(e,V,t,r),We=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},Ue=typeof TextDecoder<"u"?new TextDecoder:void 0,Ve=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var n=t+r,a=t;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&Ue)return Ue.decode(e.subarray(t,a));for(var o="";t<a;){var u=e[t++];if(!(u&128)){o+=String.fromCharCode(u);continue}var s=e[t++]&63;if((u&224)==192){o+=String.fromCharCode((u&31)<<6|s);continue}var c=e[t++]&63;if((u&240)==224?u=(u&15)<<12|s<<6|c:u=(u&7)<<18|s<<12|c<<6|e[t++]&63,u<65536)o+=String.fromCharCode(u);else{var d=u-65536;o+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return o},Yn=(e,t)=>e?Ve(V,e,t):"",Zn=(e,t)=>{t=B(t),H(e,{name:t,fromWireType(r){for(var n=P[r>>2],a=r+4,o,s,u=a,s=0;s<=n;++s){var c=a+s;if(s==n||V[c]==0){var d=c-u,h=Yn(u,d);o===void 0?o=h:(o+="\0",o+=h),u=c+1}}return nt(r),o},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,o=typeof n=="string";o||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||T("Cannot pass non-string to std::string"),o?a=We(n):a=n.length;var u=ze(4+a+1),s=u+4;return P[u>>2]=a,o?ut(n,s,a+1):V.set(n,s),r!==null&&r.push(nt,u),u},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(r){nt(r)}})},ke=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Qn=(e,t)=>{for(var r=e>>1,n=r+t/2,a=r;!(a>=n)&&ot[a];)++a;if(a-r>16&&ke)return ke.decode(ot.subarray(r,a));for(var o="",u=r;!(u>=n);++u){var s=ot[u];if(s==0)break;o+=String.fromCharCode(s)}return o},Jn=(e,t,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=t,a=r<e.length*2?r/2:e.length,o=0;o<a;++o){var u=e.charCodeAt(o);Tt[t>>1]=u,t+=2}return Tt[t>>1]=0,t-n},Kn=e=>e.length*2,ta=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=it[e+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},ea=(e,t,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,o=0;o<e.length;++o){var u=e.charCodeAt(o);if(u>=55296&&u<=57343){var s=e.charCodeAt(++o);u=65536+((u&1023)<<10)|s&1023}if(it[t>>2]=u,t+=4,t+4>a)break}return it[t>>2]=0,t-n},ra=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},na=(e,t,r)=>{r=B(r);var n,a,o,u;t===2?(n=Qn,a=Jn,u=Kn,o=s=>ot[s>>1]):t===4&&(n=ta,a=ea,u=ra,o=s=>P[s>>2]),H(e,{name:r,fromWireType:s=>{for(var c=P[s>>2],d,h=s+4,v=0;v<=c;++v){var $=s+4+v*t;if(v==c||o($)==0){var b=$-h,O=n(h,b);d===void 0?d=O:(d+="\0",d+=O),h=$+t}}return nt(s),d},toWireType:(s,c)=>{typeof c!="string"&&T(`Cannot pass non-string to C++ string type ${r}`);var d=u(c),h=ze(4+d+t);return P[h>>2]=d/t,a(c,h+4,d+t),s!==null&&s.push(nt,h),h},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(s){nt(s)}})},aa=(e,t,r,n,a,o)=>{At[e]={name:B(t),rawConstructor:k(r,n),rawDestructor:k(a,o),fields:[]}},oa=(e,t,r,n,a,o,u,s,c,d)=>{At[e].fields.push({fieldName:B(t),getterReturnType:r,getter:k(n,a),getterContext:o,setterArgumentType:u,setter:k(s,c),setterContext:d})},ia=(e,t)=>{t=B(t),H(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},te=[],sa=(e,t,r,n)=>(e=te[e],t=G.toValue(t),e(null,t,r,n)),ua={},ca=e=>{var t=ua[e];return t===void 0?B(e):t},He=()=>{if(typeof globalThis=="object")return globalThis;function e(t){t.$$$embind_global$$$=t;var r=typeof $$$embind_global$$$=="object"&&t.$$$embind_global$$$==t;return r||delete t.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&e(global)?$$$embind_global$$$=global:typeof self=="object"&&e(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},la=e=>e===0?G.toHandle(He()):(e=ca(e),G.toHandle(He()[e])),fa=e=>{var t=te.length;return te.push(e),t},Ne=(e,t)=>{var r=tt[e];return r===void 0&&T(`${t} has unknown type ${je(e)}`),r},da=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=Ne(P[t+n*4>>2],`parameter ${n}`);return r},ha=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(P[t>>2]=G.toHandle(n)),a},pa=Reflect.construct,va=(e,t,r)=>{var n=da(e,t),a=n.shift();e--;var o=new Array(e),u=(c,d,h,v)=>{for(var $=0,b=0;b<e;++b)o[b]=n[b].readValueFromPointer(v+$),$+=n[b].argPackAdvance;var O=r===1?pa(d,o):d.apply(c,o);return ha(a,h,O)},s=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${a.name}>`;return fa(qt(s,u))},ya=e=>{e>9&&(rt[e+1]+=1)},ma=e=>{var t=G.toValue(e);zt(t),Kt(e)},ga=(e,t)=>{e=Ne(e,"_emval_take_value");var r=e.readValueFromPointer(t);return G.toHandle(r)},wa=(e,t,r,n)=>{var a=new Date().getFullYear(),o=new Date(a,0,1),u=new Date(a,6,1),s=o.getTimezoneOffset(),c=u.getTimezoneOffset(),d=Math.max(s,c);P[e>>2]=d*60,it[t>>2]=+(s!=c);var h=b=>{var O=b>=0?"-":"+",I=Math.abs(b),D=String(Math.floor(I/60)).padStart(2,"0"),x=String(I%60).padStart(2,"0");return`UTC${O}${D}${x}`},v=h(s),$=h(c);c<s?(ut(v,r,17),ut($,n,17)):(ut(v,n,17),ut($,r,17))},$a=()=>2147483648,ba=(e,t)=>Math.ceil(e/t)*t,Ca=e=>{var t=Ct.buffer,r=(e-t.byteLength+65535)/65536|0;try{return Ct.grow(r),be(),1}catch{}},Ta=e=>{var t=V.length;e>>>=0;var r=$a();if(e>r)return!1;for(var n=1;n<=4;n*=2){var a=t*(1+.2/n);a=Math.min(a,e+100663296);var o=Math.min(r,ba(Math.max(e,a),65536)),u=Ca(o);if(u)return!0}return!1},ee={},Pa=()=>q||"./this.program",mt=()=>{if(!mt.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Pa()};for(var r in ee)ee[r]===void 0?delete t[r]:t[r]=ee[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);mt.strings=n}return mt.strings},_a=(e,t)=>{var r=0,n=0;for(var a of mt()){var o=t+r;P[e+n>>2]=o,r+=ut(a,o,1/0)+1,n+=4}return 0},Ea=(e,t)=>{var r=mt();P[e>>2]=r.length;var n=0;for(var a of r)n+=We(a)+1;return P[t>>2]=n,0},Oa=e=>52;function Aa(e,t,r,n,a){return 70}var Sa=[null,[],[]],Da=(e,t)=>{var r=Sa[e];t===0||t===10?((e===1?bt:Y)(Ve(r)),r.length=0):r.push(t)},Ia=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var u=P[t>>2],s=P[t+4>>2];t+=8;for(var c=0;c<s;c++)Da(e,V[u+c]);a+=s}return P[n>>2]=a,0},xa=e=>e;pn(),wn(),In(),l.noExitRuntime&&l.noExitRuntime,l.print&&(bt=l.print),l.printErr&&(Y=l.printErr),l.wasmBinary&&(dt=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(q=l.thisProgram);var Ma={s:tn,w:en,a:rn,j:nn,m:an,P:on,p:sn,ga:un,d:cn,ba:ln,ua:dn,aa:hn,pa:yn,sa:jn,ra:Bn,H:Ln,na:Wn,V:Vn,W:kn,x:Nn,t:zn,ta:Xn,oa:Zn,Q:na,I:aa,va:oa,qa:ia,da:sa,wa:Kt,D:la,ma:va,X:ya,Y:ma,U:ga,ca:wa,ha:Ta,ea:_a,fa:Ea,ia:Oa,_:Aa,S:Ia,K:po,C:yo,M:Ga,R:Co,q:co,b:Ya,E:ho,ka:go,c:Za,ja:wo,h:za,i:to,r:ao,O:fo,v:io,F:uo,L:lo,z:mo,J:To,$:Po,Z:_o,k:Qa,f:Na,e:qa,g:Xa,N:bo,l:Ka,la:vo,o:oo,B:eo,u:so,T:no,A:$o,n:Ja,G:ro,y:xa},E=await Qr();E.ya;var Fa=E.za,nt=l._free=E.Aa,ze=l._malloc=E.Ca,ja=E.Da,y=E.Ea,Ra=E.Fa,Ba=E.Ga,La=E.Ha,Wa=E.Ia,Ua=E.Ja,Va=E.Ka;l.dynCall_viijii=E.La;var ka=l.dynCall_iiijj=E.Ma;l.dynCall_jiji=E.Na;var Ha=l.dynCall_jiiii=E.Oa;l.dynCall_iiiiij=E.Pa,l.dynCall_iiiiijj=E.Qa,l.dynCall_iiiiiijj=E.Ra;function Na(e,t){var r=g();try{w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function za(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function Ga(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function Xa(e,t,r,n){var a=g();try{w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function qa(e,t,r){var n=g();try{w(e)(t,r)}catch(a){if(m(n),a!==a+0)throw a;y(1,0)}}function Ya(e,t){var r=g();try{return w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function Za(e,t,r){var n=g();try{return w(e)(t,r)}catch(a){if(m(n),a!==a+0)throw a;y(1,0)}}function Qa(e){var t=g();try{w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function Ja(e,t,r,n,a,o,u,s,c,d,h){var v=g();try{w(e)(t,r,n,a,o,u,s,c,d,h)}catch($){if(m(v),$!==$+0)throw $;y(1,0)}}function Ka(e,t,r,n,a){var o=g();try{w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function to(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function eo(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ro(e,t,r,n,a,o,u,s,c,d,h,v,$,b,O,I){var D=g();try{w(e)(t,r,n,a,o,u,s,c,d,h,v,$,b,O,I)}catch(x){if(m(D),x!==x+0)throw x;y(1,0)}}function no(e,t,r,n,a,o,u,s,c){var d=g();try{w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function ao(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function oo(e,t,r,n,a,o){var u=g();try{w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function io(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function so(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function uo(e,t,r,n,a,o,u,s){var c=g();try{return w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function co(e){var t=g();try{return w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function lo(e,t,r,n,a,o,u,s,c){var d=g();try{return w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function fo(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ho(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function po(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function vo(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function yo(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function mo(e,t,r,n,a,o,u,s,c,d){var h=g();try{return w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function go(e,t,r){var n=g();try{return w(e)(t,r)}catch(a){if(m(n),a!==a+0)throw a;y(1,0)}}function wo(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function $o(e,t,r,n,a,o,u,s,c,d){var h=g();try{w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function bo(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function Co(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function To(e,t,r,n,a,o,u,s,c,d,h,v){var $=g();try{return w(e)(t,r,n,a,o,u,s,c,d,h,v)}catch(b){if(m($),b!==b+0)throw b;y(1,0)}}function Po(e,t,r,n,a,o,u){var s=g();try{return ka(e,t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function _o(e,t,r,n,a){var o=g();try{return Ha(e,t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function re(){if(K>0){ht=re;return}if(Ur(),K>0){ht=re;return}function e(){var t;l.calledRun=!0,!ge&&(Vr(),C(l),(t=l.onRuntimeInitialized)===null||t===void 0||t.call(l),kr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),e()},1)):e()}function Eo(){if(l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()()}return Eo(),re(),f=F,f};function Ut(i){return oe(Wt,i)}function $r(){return gr(Wt)}function br(i){Ut({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function Cr(i,f){return wr(Wt,i,f)}const Tr="68d20eb8c486afabf49fab6d9fbc5f118df8648ec6200e8039ef8912a169c00c",ie=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"],["any","Any"]],Pr=[...ie,["unknown"]].map(i=>i[0]),Vt=new Map(ie);function _r(i){for(const[f,p]of Vt)if(i===p)return f;return"unknown"}function Er(i){if(se(i))return{width:i.naturalWidth,height:i.naturalHeight};if(ue(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ce(i))return{width:i.videoWidth,height:i.videoHeight};if(fe(i))return{width:i.width,height:i.height};if(he(i))return{width:i.displayWidth,height:i.displayHeight};if(le(i))return{width:i.width,height:i.height};if(de(i))return{width:i.width,height:i.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 se(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function ue(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function ce(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function le(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function fe(i){try{return i instanceof ImageBitmap||Object.prototype.toString.call(i)==="[object ImageBitmap]"}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas||Object.prototype.toString.call(i)==="[object OffscreenCanvas]"}catch{return!1}}function he(i){try{return i instanceof VideoFrame||Object.prototype.toString.call(i)==="[object VideoFrame]"}catch{return!1}}function Or(i){try{return i instanceof Blob||Object.prototype.toString.call(i)==="[object Blob]"}catch{return!1}}function Ar(i){try{return i instanceof ImageData||Object.prototype.toString.call(i)==="[object ImageData]"}catch{return!1}}function Sr(i,f){try{const p=new OffscreenCanvas(i,f);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=i,p.height=f,p}}async function pe(i){if(se(i)&&!await Mr(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ue(i)&&!await Fr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(he(i)&&jr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ce(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(fe(i)&&Br(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:p}=Er(i);if(f===0||p===0)return null;const C=Sr(f,p).getContext("2d");C.drawImage(i,0,0);try{return C.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Dr(i){let f;try{f=await createImageBitmap(i)}catch{try{if(globalThis.Image){f=new Image;let C="";try{C=URL.createObjectURL(i),f.src=C,await f.decode()}finally{URL.revokeObjectURL(C)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await pe(f)}function Ir(i){const{width:f,height:p}=i;if(f===0||p===0)return null;const l=i.getContext("2d");try{return l.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function xr(i){if(Or(i))return await Dr(i);if(Ar(i)){if(Rr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return le(i)||de(i)?Ir(i):await pe(i)}async function Mr(i){try{return await i.decode(),!0}catch{return!1}}async function Fr(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function jr(i){return i.format===null}function Rr(i){return i.data.buffer.byteLength===0}function Br(i){return i.width===0&&i.height===0}function ve(i,f){return Lr(i)?new DOMException(`${f}: ${i.message}`,i.name):Wr(i)?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}function Lr(i){return i instanceof DOMException||Object.prototype.toString.call(i)==="[object DOMException]"}function Wr(i){return i instanceof Error||Object.prototype.toString.call(i)==="[object Error]"}class ye{constructor(f={}){Ke(this,ct);var p;try{const l=(p=f==null?void 0:f.formats)==null?void 0:p.filter(C=>C!=="unknown");if((l==null?void 0:l.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const C of l!=null?l:[])if(!Vt.has(C))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${C}' is not a valid enum value of type BarcodeFormat.`);tr(this,ct,l!=null?l:[]),Ut({fireImmediately:!0}).catch(()=>{})}catch(l){throw ve(l,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Pr.filter(f=>f!=="unknown")}async detect(f){try{const p=await xr(f);if(p===null)return[];let l;const C={tryCode39ExtendedMode:!1,textMode:"Plain",formats:Je(this,ct).map(A=>Vt.get(A))};try{l=await Cr(p,C)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return l.map(A=>{const{topLeft:{x:F,y:L},topRight:{x:S,y:j},bottomLeft:{x:q,y:Z},bottomRight:{x:Q,y:lt}}=A.position,ft=Math.min(F,S,q,Q),at=Math.min(L,j,Z,lt),bt=Math.max(F,S,q,Q),Y=Math.max(L,j,Z,lt);return{boundingBox:new DOMRectReadOnly(ft,at,bt-ft,Y-at),rawValue:A.text,format:_r(A.format),cornerPoints:[{x:F,y:L},{x:S,y:j},{x:Q,y:lt},{x:q,y:Z}]}})}catch(p){throw ve(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ct=new WeakMap,(me=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=ye),_.BarcodeDetector=ye,_.ZXING_CPP_COMMIT=vr,_.ZXING_WASM_SHA256=Tr,_.ZXING_WASM_VERSION=pr,_.prepareZXingModule=Ut,_.purgeZXingModule=$r,_.setZXingModuleOverrides=br,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});
|
|
1
|
+
var BarcodeDetectionAPI=(function(O){"use strict";var nr=O=>{throw TypeError(O)};var ar=(O,M,F)=>M.has(O)||nr("Cannot "+F);var or=(O,M,F)=>(ar(O,M,"read from private field"),F?F.call(O):M.get(O)),ir=(O,M,F)=>M.has(O)?nr("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(O):M.set(O,F),sr=(O,M,F,vt)=>(ar(O,M,"write to private field"),vt?vt.call(O,F):M.set(O,F),F);var it,pe;const M=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],F=M.map(([i])=>i),vt=F.filter((i,f)=>M[f][1]==="L"),ur=F.filter((i,f)=>M[f][1]==="M");function Bt(i){switch(i){case"Linear-Codes":return vt.reduce((f,h)=>f|Bt(h),0);case"Matrix-Codes":return ur.reduce((f,h)=>f|Bt(h),0);case"Any":return(1<<M.length)-1;case"None":return 0;default:return 1<<F.indexOf(i)}}function cr(i){if(i===0)return"None";const f=31-Math.clz32(i);return F[f]}function lr(i){return i.reduce((f,h)=>f|Bt(h),0)}const fr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function dr(i){return fr.indexOf(i)}const te=["Unknown","ASCII","ISO8859_1","ISO8859_2","ISO8859_3","ISO8859_4","ISO8859_5","ISO8859_6","ISO8859_7","ISO8859_8","ISO8859_9","ISO8859_10","ISO8859_11","ISO8859_13","ISO8859_14","ISO8859_15","ISO8859_16","Cp437","Cp1250","Cp1251","Cp1252","Cp1256","Shift_JIS","Big5","GB2312","GB18030","EUC_JP","EUC_KR","UTF16BE","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function hr(i){return i==="UnicodeBig"?te.indexOf("UTF16BE"):te.indexOf(i)}const pr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function vr(i){return pr[i]}const yr=["Ignore","Read","Require"];function mr(i){return yr.indexOf(i)}const gr=["Plain","ECI","HRI","Hex","Escaped"];function wr(i){return gr.indexOf(i)}const yt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function ee(i){return{...i,formats:lr(i.formats),binarizer:dr(i.binarizer),eanAddOnSymbol:mr(i.eanAddOnSymbol),textMode:wr(i.textMode),characterSet:hr(i.characterSet)}}function $r(i){return{...i,format:cr(i.format),contentType:vr(i.contentType),eccLevel:i.ecLevel}}const br="2.2.3",Cr="fba4e9503fee4518ca2e89510baeea9bcc36dc8d",Tr={locateFile:(i,f)=>{const h=i.match(/_(.+?)\.wasm$/);return h?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.3/dist/${h[1]}/${i}`:f+i}},mt=new WeakMap;function Pr(i,f){return Object.is(i,f)||Object.keys(i).length===Object.keys(f).length&&Object.keys(i).every(h=>Object.hasOwn(f,h)&&i[h]===f[h])}function re(i,{overrides:f,equalityFn:h=Pr,fireImmediately:T=!1}={}){var l;const[x,A]=(l=mt.get(i))!=null?l:[Tr],B=f!=null?f:x;let S;if(T){if(A&&(S=h(x,B)))return A;const R=i({...B});return mt.set(i,[B,R]),R}(S!=null?S:h(x,B))||mt.set(i,[B])}function Er(i){mt.delete(i)}async function Or(i,f,h=yt){const T={...yt,...h},l=await re(i,{fireImmediately:!0});let x,A;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:R},width:H,height:Z}=f;A=l._malloc(R),l.HEAPU8.set(S,A),x=l.readBarcodesFromPixmap(A,H,Z,ee(T))}else{let S,R;if("buffer"in f)[S,R]=[f.byteLength,f];else if("byteLength"in f)[S,R]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,R]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");A=l._malloc(S),l.HEAPU8.set(R,A),x=l.readBarcodesFromImage(A,S,ee(T))}l._free(A);const B=[];for(let S=0;S<x.size();++S)B.push($r(x.get(S)));return B}({...yt,formats:[...yt.formats]});async function Rt(i={}){var f,h,T,l=i,x=!!globalThis.window,A=typeof Bun<"u",B=!!globalThis.WorkerGlobalScope;!((h=globalThis.process)===null||h===void 0||(h=h.versions)===null||h===void 0)&&h.node&&((T=globalThis.process)===null||T===void 0?void 0:T.type)!="renderer";var S="./this.program",R,H="";function Z(t){return l.locateFile?l.locateFile(t,H):H+t}var nt,Q;if(x||B||A){try{H=new URL(".",R).href}catch{}B&&(Q=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),nt=async t=>{var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)}}var st=console.log.bind(console),k=console.error.bind(console),J,gt=!1,ve,ye,K,N,wt,ut,ct,E,me,ge,we=!1;function $e(){var t=xt.buffer;K=new Int8Array(t),wt=new Int16Array(t),l.HEAPU8=N=new Uint8Array(t),ut=new Uint16Array(t),ct=new Int32Array(t),E=new Uint32Array(t),me=new Float32Array(t),ge=new Float64Array(t)}function Xr(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)an(l.preRun.shift());be(Te)}function qr(){we=!0,pt.xa()}function Yr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)nn(l.postRun.shift());be(Ce)}function Ut(t){var e,r;(e=l.onAbort)===null||e===void 0||e.call(l,t),t="Aborted("+t+")",k(t),gt=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw(r=ye)===null||r===void 0||r(n),n}var $t;function Zr(){return Z("zxing_reader.wasm")}function Qr(t){if(t==$t&&J)return new Uint8Array(J);if(Q)return Q(t);throw"both async and sync fetching of the wasm failed"}async function Jr(t){if(!J)try{var e=await nt(t);return new Uint8Array(e)}catch{}return Qr(t)}async function Kr(t,e){try{var r=await Jr(t),n=await WebAssembly.instantiate(r,e);return n}catch(a){k(`failed to asynchronously prepare wasm: ${a}`),Ut(a)}}async function tn(t,e,r){if(!t&&WebAssembly.instantiateStreaming)try{var n=fetch(e,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(o){k(`wasm streaming compile failed: ${o}`),k("falling back to ArrayBuffer instantiation")}return Kr(e,r)}function en(){var t={a:ja};return t}async function rn(){function t(o,s){return pt=o.exports,Ra(pt),$e(),pt}function e(o){return t(o.instance)}var r=en();if(l.instantiateWasm)return new Promise((o,s)=>{l.instantiateWasm(r,(u,c)=>{o(t(u))})});$t!=null||($t=Zr());var n=await tn(J,$t,r),a=e(n);return a}var be=t=>{for(;t.length>0;)t.shift()(l)},Ce=[],nn=t=>Ce.push(t),Te=[],an=t=>Te.push(t),g=t=>ze(t),w=()=>Ge(),bt=[],Ct=0,on=t=>{var e=new Vt(t);return e.get_caught()||(e.set_caught(!0),Ct--),e.set_rethrown(!1),bt.push(e),qe(t),ke(t)},z=0,sn=()=>{m(0,0);var t=bt.pop();Xe(t.excPtr),z=0};class Vt{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){E[this.ptr+4>>2]=e}get_type(){return E[this.ptr+4>>2]}set_destructor(e){E[this.ptr+8>>2]=e}get_destructor(){return E[this.ptr+8>>2]}set_caught(e){e=e?1:0,K[this.ptr+12]=e}get_caught(){return K[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,K[this.ptr+13]=e}get_rethrown(){return K[this.ptr+13]!=0}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){E[this.ptr+16>>2]=e}get_adjusted_ptr(){return E[this.ptr+16>>2]}}var Tt=t=>Ne(t),Wt=t=>{var e=z;if(!e)return Tt(0),0;var r=new Vt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return Tt(0),e;for(var a of t){if(a===0||a===n)break;var o=r.ptr+16;if(Ye(a,n,o))return Tt(a),e}return Tt(n),e},un=()=>Wt([]),cn=t=>Wt([t]),ln=(t,e)=>Wt([t,e]),fn=()=>{var t=bt.pop();t||Ut("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(bt.push(t),t.set_rethrown(!0),t.set_caught(!1),Ct++),z=e,z},dn=(t,e,r)=>{var n=new Vt(t);throw n.init(e,r),z=t,Ct++,z},hn=()=>Ct,pn=t=>{throw z||(z=t),z},vn=()=>Ut(""),Pt={},Ht=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function lt(t){return this.fromWireType(E[t>>2])}var at={},tt={},Et={},yn=class extends Error{constructor(t){super(t),this.name="InternalError"}},Ot=t=>{throw new yn(t)},et=(t,e,r)=>{t.forEach(u=>Et[u]=e);function n(u){var c=r(u);c.length!==t.length&&Ot("Mismatched type converter count");for(var d=0;d<t.length;++d)V(t[d],c[d])}var a=new Array(e.length),o=[],s=0;for(let[u,c]of e.entries())tt.hasOwnProperty(c)?a[u]=tt[c]:(o.push(c),at.hasOwnProperty(c)||(at[c]=[]),at[c].push(()=>{a[u]=tt[c],++s,s===o.length&&n(a)}));o.length===0&&n(a)},mn=t=>{var e=Pt[t];delete Pt[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));et([t],o,s=>{var u={};for(var[c,d]of a.entries()){const p=s[c],v=d.getter,y=d.getterContext,C=s[c+a.length],I=d.setter,D=d.setterContext;u[d.fieldName]={read:P=>p.fromWireType(v(y,P)),write:(P,_)=>{var Y=[];I(D,P,C.toWireType(Y,_)),Ht(Y)},optional:p.optional}}return[{name:e.name,fromWireType:p=>{var v={};for(var y in u)v[y]=u[y].read(p);return n(p),v},toWireType:(p,v)=>{for(var y in u)if(!(y in v)&&!u[y].optional)throw new TypeError(`Missing field: "${y}"`);var C=r();for(y in u)u[y].write(C,v[y]);return p!==null&&p.push(n,C),C},readValueFromPointer:lt,destructorFunction:n}]})},gn=(t,e,r,n,a)=>{},j=t=>{for(var e="";;){var r=N[t++];if(!r)return e;e+=String.fromCharCode(r)}},ft=class extends Error{constructor(t){super(t),this.name="BindingError"}},b=t=>{throw new ft(t)};function wn(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=e.name;if(t||b(`type "${n}" must have a positive integer typeid pointer`),tt.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;b(`Cannot register type '${n}' twice`)}if(tt[t]=e,delete Et[t],at.hasOwnProperty(t)){var a=at[t];delete at[t],a.forEach(o=>o())}}function V(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return wn(t,e,r)}var $n=(t,e,r,n)=>{e=j(e),V(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},readValueFromPointer:function(a){return this.fromWireType(N[a])},destructorFunction:null})},bn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),kt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}b(e(t)+" instance already deleted")},Nt=!1,Pe=t=>{},Cn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},Ee=t=>{t.count.value-=1;var e=t.count.value===0;e&&Cn(t)},dt=t=>globalThis.FinalizationRegistry?(Nt=new FinalizationRegistry(e=>{Ee(e.$$)}),dt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Nt.register(e,a,e)}return e},Pe=e=>Nt.unregister(e),dt(t)):(dt=e=>e,t),Tn=()=>{let t=_t.prototype;Object.assign(t,{isAliasOf(r){if(!(this instanceof _t)||!(r instanceof _t))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var o=r.$$.ptrType.registeredClass,s=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;o.baseClass;)s=o.upcast(s),o=o.baseClass;return n===o&&a===s},clone(){if(this.$$.ptr||kt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=dt(Object.create(Object.getPrototypeOf(this),{$$:{value:bn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),Pe(this),Ee(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const e=Symbol.dispose;e&&(t[e]=t.delete)};function _t(){}var zt=(t,e)=>Object.defineProperty(e,"name",{value:t}),Oe={},_e=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return t[e].overloadTable.hasOwnProperty(o.length)||b(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[o.length].apply(this,o)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},Se=(t,e,r)=>{l.hasOwnProperty(t)?((r===void 0||l[t].overloadTable!==void 0&&l[t].overloadTable[r]!==void 0)&&b(`Cannot register public name '${t}' twice`),_e(l,t,t),l[t].overloadTable.hasOwnProperty(r)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[t].overloadTable[r]=e):(l[t]=e,l[t].argCount=r)},Pn=48,En=57,On=t=>{t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Pn&&e<=En?`_${t}`:t};function _n(t,e,r,n,a,o,s,u){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}var Gt=(t,e,r)=>{for(;e!==r;)e.upcast||b(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t},Xt=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t};function Sn(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${Xt(e)}" as a ${this.name}`),e.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Gt(e.$$.ptr,r,this.registeredClass);return n}function Dn(t,e){var r;if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;(!e||!e.$$)&&b(`Cannot pass "${Xt(e)}" as a ${this.name}`),e.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&b(`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=Gt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&b("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:b(`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,W.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:b("Unsupporting sharing policy")}return r}function In(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${Xt(e)}" as a ${this.name}`),e.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&b(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Gt(e.$$.ptr,r,this.registeredClass);return n}var 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)},xn={},Mn=(t,e)=>{for(e===void 0&&b("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},An=(t,e)=>(e=Mn(t,e),xn[e]),St=(t,e)=>{(!e.ptrType||!e.ptr)&&Ot("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&Ot("Both smartPtrType and smartPtr must be specified"),e.count={value:1},dt(Object.create(t,{$$:{value:e,writable:!0}}))};function Fn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=An(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),s=Oe[o];if(!s)return a.call(this);var u;this.isConst?u=s.constPointerType:u=s.pointerType;var c=De(e,this.registeredClass,u.registeredClass);return c===null?a.call(this):this.isSmartPointer?St(u.registeredClass.instancePrototype,{ptrType:u,ptr:c,smartPtrType:this,smartPtr:t}):St(u.registeredClass.instancePrototype,{ptrType:u,ptr:c})}var Bn=()=>{Object.assign(Dt.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){var e;(e=this.rawDestructor)===null||e===void 0||e.call(this,t)},readValueFromPointer:lt,fromWireType:Fn})};function Dt(t,e,r,n,a,o,s,u,c,d,p){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=p,!a&&e.baseClass===void 0?n?(this.toWireType=Sn,this.destructorFunction=null):(this.toWireType=In,this.destructorFunction=null):this.toWireType=Dn}var Ie=(t,e,r)=>{l.hasOwnProperty(t)||Ot("Replacing nonexistent public symbol"),l[t].overloadTable!==void 0&&r!==void 0?l[t].overloadTable[r]=e:(l[t]=e,l[t].argCount=r)},X={},Rn=(t,e,r)=>{t=t.replace(/p/g,"i");var n=X[t];return n(e,...r)},xe=[],$=t=>{var e=xe[t];return e||(xe[t]=e=Je.get(t)),e},jn=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.includes("j"))return Rn(t,e,r);var n=$(e),a=n(...r);return a},Ln=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return jn(t,e,a,r)}},U=function(t,e){t=j(t);function r(){if(t.includes("j"))return Ln(t,e);var a=$(e);return a}var n=r();return typeof n!="function"&&b(`unknown function pointer with signature ${t}: ${e}`),n};class Un extends Error{}var Me=t=>{var e=He(t),r=j(e);return q(e),r},It=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!tt[o]){if(Et[o]){Et[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Un(`${t}: `+r.map(Me).join([", "]))},Vn=(t,e,r,n,a,o,s,u,c,d,p,v,y)=>{p=j(p),o=U(a,o),u&&(u=U(s,u)),d&&(d=U(c,d)),y=U(v,y);var C=On(p);Se(C,function(){It(`Cannot construct ${p} due to unbound types`,[n])}),et([t,e,r],n?[n]:[],I=>{I=I[0];var D,P;n?(D=I.registeredClass,P=D.instancePrototype):P=_t.prototype;var _=zt(p,function(){if(Object.getPrototypeOf(this)!==Y)throw new ft(`Use 'new' to construct ${p}`);if(L.constructor_body===void 0)throw new ft(`${p} has no accessible constructor`);for(var er=arguments.length,At=new Array(er),Ft=0;Ft<er;Ft++)At[Ft]=arguments[Ft];var rr=L.constructor_body[At.length];if(rr===void 0)throw new ft(`Tried to invoke ctor of ${p} with invalid number of parameters (${At.length}) - expected (${Object.keys(L.constructor_body).toString()}) parameters instead!`);return rr.apply(this,At)}),Y=Object.create(P,{constructor:{value:_}});_.prototype=Y;var L=new _n(p,_,Y,y,D,o,u,d);if(L.baseClass){var G,Mt;(Mt=(G=L.baseClass).__derivedClasses)!==null&&Mt!==void 0||(G.__derivedClasses=[]),L.baseClass.__derivedClasses.push(L)}var bo=new Dt(p,L,!0,!1,!1),Ke=new Dt(p+"*",L,!1,!1,!1),tr=new Dt(p+" const*",L,!1,!0,!1);return Oe[t]={pointerType:Ke,constPointerType:tr},Ie(C,_),[bo,Ke,tr]})},qt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(E[e+n*4>>2]);return r};function Wn(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].destructorFunction===void 0)return!0;return!1}function Yt(t,e,r,n,a,o){var s=e.length;s<2&&b("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=e[1]!==null&&r!==null,c=Wn(e),d=!e[0].isVoid,p=s-2,v=new Array(p),y=[],C=[],I=function(){C.length=0;var D;y.length=u?2:1,y[0]=a,u&&(D=e[1].toWireType(C,this),y[1]=D);for(var P=0;P<p;++P)v[P]=e[P+2].toWireType(C,P<0||arguments.length<=P?void 0:arguments[P]),y.push(v[P]);var _=n(...y);function Y(L){if(c)Ht(C);else for(var G=u?1:2;G<e.length;G++){var Mt=G===1?D:v[G-2];e[G].destructorFunction!==null&&e[G].destructorFunction(Mt)}if(d)return e[0].fromWireType(L)}return Y(_)};return zt(t,I)}var Hn=(t,e,r,n,a,o)=>{var s=qt(e,r);a=U(n,a),et([],[t],u=>{u=u[0];var c=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[e-1]!==void 0)throw new ft(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.registeredClass.constructor_body[e-1]=()=>{It(`Cannot construct ${u.name} due to unbound types`,s)},et([],s,d=>(d.splice(1,0,null),u.registeredClass.constructor_body[e-1]=Yt(c,d,null,a,o),[])),[]})},Ae=t=>{t=t.trim();const e=t.indexOf("(");return e===-1?t:t.slice(0,e)},kn=(t,e,r,n,a,o,s,u,c,d)=>{var p=qt(r,n);e=j(e),e=Ae(e),o=U(a,o),et([],[t],v=>{v=v[0];var y=`${v.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&v.registeredClass.pureVirtualFunctions.push(e);function C(){It(`Cannot call ${y} due to unbound types`,p)}var I=v.registeredClass.instancePrototype,D=I[e];return D===void 0||D.overloadTable===void 0&&D.className!==v.name&&D.argCount===r-2?(C.argCount=r-2,C.className=v.name,I[e]=C):(_e(I,e,y),I[e].overloadTable[r-2]=C),et([],p,P=>{var _=Yt(y,P,v,o,s);return I[e].overloadTable===void 0?(_.argCount=r-2,I[e]=_):I[e].overloadTable[r-2]=_,[]}),[]})},Fe=[],rt=[0,1,,1,null,1,!0,1,!1,1],Zt=t=>{t>9&&--rt[t+1]===0&&(rt[t]=void 0,Fe.push(t))},W={toValue:t=>(t||b(`Cannot use deleted val. handle = ${t}`),rt[t]),toHandle:t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=Fe.pop()||rt.length;return rt[e]=t,rt[e+1]=1,e}}}},Be={name:"emscripten::val",fromWireType:t=>{var e=W.toValue(t);return Zt(t),e},toWireType:(t,e)=>W.toHandle(e),readValueFromPointer:lt,destructorFunction:null},Nn=t=>V(t,Be),zn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(me[r>>2])};case 8:return function(r){return this.fromWireType(ge[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Gn=(t,e,r)=>{e=j(e),V(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,readValueFromPointer:zn(e,r),destructorFunction:null})},Xn=(t,e,r,n,a,o,s,u)=>{var c=qt(e,r);t=j(t),t=Ae(t),a=U(n,a),Se(t,function(){It(`Cannot call ${t} due to unbound types`,c)},e-1),et([],c,d=>{var p=[d[0],null].concat(d.slice(1));return Ie(t,Yt(t,p,null,a,o),e-1),[]})},qn=(t,e,r)=>{switch(e){case 1:return r?n=>K[n]:n=>N[n];case 2:return r?n=>wt[n>>1]:n=>ut[n>>1];case 4:return r?n=>ct[n>>2]:n=>E[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Yn=(t,e,r,n,a)=>{e=j(e);const o=n===0;let s=c=>c;if(o){var u=32-8*r;s=c=>c<<u>>>u,a=s(a)}V(t,{name:e,fromWireType:s,toWireType:(c,d)=>d,readValueFromPointer:qn(e,r,n!==0),destructorFunction:null})},Zn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(s){var u=E[s>>2],c=E[s+4>>2];return new a(K.buffer,c,u)}r=j(r),V(t,{name:r,fromWireType:o,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Qn=Object.assign({optional:!0},Be),Jn=(t,e)=>{V(t,Qn)},Kn=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<t.length;++s){var u=t.codePointAt(s);if(u<=127){if(r>=o)break;e[r++]=u}else if(u<=2047){if(r+1>=o)break;e[r++]=192|u>>6,e[r++]=128|u&63}else if(u<=65535){if(r+2>=o)break;e[r++]=224|u>>12,e[r++]=128|u>>6&63,e[r++]=128|u&63}else{if(r+3>=o)break;e[r++]=240|u>>18,e[r++]=128|u>>12&63,e[r++]=128|u>>6&63,e[r++]=128|u&63,s++}}return e[r]=0,r-a},ot=(t,e,r)=>Kn(t,N,e,r),Re=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},je=globalThis.TextDecoder&&new TextDecoder,Le=(t,e,r,n)=>{var a=e+r;if(n)return a;for(;t[e]&&!(e>=a);)++e;return e},Ue=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;var a=Le(t,e,r,n);if(a-e>16&&t.buffer&&je)return je.decode(t.subarray(e,a));for(var o="";e<a;){var s=t[e++];if(!(s&128)){o+=String.fromCharCode(s);continue}var u=t[e++]&63;if((s&224)==192){o+=String.fromCharCode((s&31)<<6|u);continue}var c=t[e++]&63;if((s&240)==224?s=(s&15)<<12|u<<6|c:s=(s&7)<<18|u<<12|c<<6|t[e++]&63,s<65536)o+=String.fromCharCode(s);else{var d=s-65536;o+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return o},ta=(t,e,r)=>t?Ue(N,t,e,r):"",ea=(t,e)=>{e=j(e),V(t,{name:e,fromWireType(r){var n=E[r>>2],a=r+4,o;return o=ta(a,n,!0),q(r),o},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,o=typeof n=="string";o||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||b("Cannot pass non-string to std::string"),o?a=Re(n):a=n.length;var s=Kt(4+a+1),u=s+4;return E[s>>2]=a,o?ot(n,u,a+1):N.set(n,u),r!==null&&r.push(q,s),s},readValueFromPointer:lt,destructorFunction(r){q(r)}})},Ve=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,ra=(t,e,r)=>{var n=t>>1,a=Le(ut,n,e/2,r);if(a-n>16&&Ve)return Ve.decode(ut.subarray(n,a));for(var o="",s=n;s<a;++s){var u=ut[s];o+=String.fromCharCode(u)}return o},na=(t,e,r)=>{if(r!=null||(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 s=t.charCodeAt(o);wt[e>>1]=s,e+=2}return wt[e>>1]=0,e-n},aa=t=>t.length*2,oa=(t,e,r)=>{for(var n="",a=t>>2,o=0;!(o>=e/4);o++){var s=E[a+o];if(!s&&!r)break;n+=String.fromCodePoint(s)}return n},ia=(t,e,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,o=0;o<t.length;++o){var s=t.codePointAt(o);if(s>65535&&o++,ct[e>>2]=s,e+=4,e+4>a)break}return ct[e>>2]=0,e-n},sa=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.codePointAt(r);n>65535&&r++,e+=4}return e},ua=(t,e,r)=>{r=j(r);var n,a,o;e===2?(n=ra,a=na,o=aa):(n=oa,a=ia,o=sa),V(t,{name:r,fromWireType:s=>{var u=E[s>>2],c=n(s+4,u*e,!0);return q(s),c},toWireType:(s,u)=>{typeof u!="string"&&b(`Cannot pass non-string to C++ string type ${r}`);var c=o(u),d=Kt(4+c+e);return E[d>>2]=c/e,a(u,d+4,c+e),s!==null&&s.push(q,d),d},readValueFromPointer:lt,destructorFunction(s){q(s)}})},ca=(t,e,r,n,a,o)=>{Pt[t]={name:j(e),rawConstructor:U(r,n),rawDestructor:U(a,o),fields:[]}},la=(t,e,r,n,a,o,s,u,c,d)=>{Pt[t].fields.push({fieldName:j(e),getterReturnType:r,getter:U(n,a),getterContext:o,setterArgumentType:s,setter:U(u,c),setterContext:d})},fa=(t,e)=>{e=j(e),V(t,{isVoid:!0,name:e,fromWireType:()=>{},toWireType:(r,n)=>{}})},Qt=[],da=t=>{var e=Qt.length;return Qt.push(t),e},ha=(t,e)=>{var r=tt[t];return r===void 0&&b(`${e} has unknown type ${Me(t)}`),r},pa=(t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=ha(E[e+n*4>>2],`parameter ${n}`);return r},va=(t,e,r)=>{var n=[],a=t(n,r);return n.length&&(E[e>>2]=W.toHandle(n)),a},ya={},We=t=>{var e=ya[t];return e===void 0?j(t):e},ma=(t,e,r)=>{var n=8,[a,...o]=pa(t,e),s=a.toWireType.bind(a),u=o.map(v=>v.readValueFromPointer.bind(v));t--;var c=new Array(t),d=(v,y,C,I)=>{for(var D=0,P=0;P<t;++P)c[P]=u[P](I+D),D+=n;var _;switch(r){case 0:_=W.toValue(v).apply(null,c);break;case 2:_=Reflect.construct(W.toValue(v),c);break;case 3:_=c[0];break;case 1:_=W.toValue(v)[We(y)](...c);break}return va(s,C,_)},p=`methodCaller<(${o.map(v=>v.name)}) => ${a.name}>`;return da(zt(p,d))},ga=t=>t?(t=We(t),W.toHandle(globalThis[t])):W.toHandle(globalThis),wa=t=>{t>9&&(rt[t+1]+=1)},$a=(t,e,r,n,a)=>Qt[t](e,r,n,a),ba=t=>{var e=W.toValue(t);Ht(e),Zt(t)},Ca=(t,e,r,n)=>{var a=new Date().getFullYear(),o=new Date(a,0,1),s=new Date(a,6,1),u=o.getTimezoneOffset(),c=s.getTimezoneOffset(),d=Math.max(u,c);E[t>>2]=d*60,ct[e>>2]=+(u!=c);var p=C=>{var I=C>=0?"-":"+",D=Math.abs(C),P=String(Math.floor(D/60)).padStart(2,"0"),_=String(D%60).padStart(2,"0");return`UTC${I}${P}${_}`},v=p(u),y=p(c);c<u?(ot(v,r,17),ot(y,n,17)):(ot(v,n,17),ot(y,r,17))},Ta=()=>2147483648,Pa=(t,e)=>Math.ceil(t/e)*e,Ea=t=>{var e=xt.buffer.byteLength,r=(t-e+65535)/65536|0;try{return xt.grow(r),$e(),1}catch{}},Oa=t=>{var e=N.length;t>>>=0;var r=Ta();if(t>r)return!1;for(var n=1;n<=4;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var o=Math.min(r,Pa(Math.max(t,a),65536)),s=Ea(o);if(s)return!0}return!1},Jt={},_a=()=>S||"./this.program",ht=()=>{if(!ht.strings){var t=(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:_a()};for(var r in Jt)Jt[r]===void 0?delete e[r]:e[r]=Jt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);ht.strings=n}return ht.strings},Sa=(t,e)=>{var r=0,n=0;for(var a of ht()){var o=e+r;E[t+n>>2]=o,r+=ot(a,o,1/0)+1,n+=4}return 0},Da=(t,e)=>{var r=ht();E[t>>2]=r.length;var n=0;for(var a of r)n+=Re(a)+1;return E[e>>2]=n,0},Ia=t=>52;function xa(t,e,r,n,a){return 70}var Ma=[null,[],[]],Aa=(t,e)=>{var r=Ma[t];e===0||e===10?((t===1?st:k)(Ue(r)),r.length=0):r.push(e)},Fa=(t,e,r,n)=>{for(var a=0,o=0;o<r;o++){var s=E[e>>2],u=E[e+4>>2];e+=8;for(var c=0;c<u;c++)Aa(t,N[s+c]);a+=u}return E[n>>2]=a,0},Ba=t=>t;if(Tn(),Bn(),l.noExitRuntime&&l.noExitRuntime,l.print&&(st=l.print),l.printErr&&(k=l.printErr),l.wasmBinary&&(J=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(S=l.thisProgram),l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()();var He,q,Kt,ke,m,Ne,ze,Ge,Xe,qe,Ye,Ze,Qe,xt,Je;function Ra(t){He=t.ya,q=l._free=t.za,Kt=l._malloc=t.Ba,ke=t.Ca,m=t.Da,Ne=t.Ea,ze=t.Fa,Ge=t.Ga,Xe=t.Ha,qe=t.Ia,Ye=t.Ja,X.viijii=t.Ka,Ze=X.iiijj=t.La,X.jiji=t.Ma,Qe=X.jiiii=t.Na,X.iiiiij=t.Oa,X.iiiiijj=t.Pa,X.iiiiiijj=t.Qa,xt=t.wa,Je=t.Aa}var ja={s:on,w:sn,a:un,j:cn,m:ln,Q:fn,p:dn,U:hn,d:pn,ca:vn,ta:mn,ba:gn,oa:$n,ra:Vn,qa:Hn,H:kn,ma:Nn,X:Gn,Y:Xn,x:Yn,t:Zn,sa:Jn,na:ea,R:ua,I:ca,ua:la,pa:fa,N:ma,va:Zt,D:ga,S:wa,M:$a,ia:ba,da:Ca,ga:Oa,ea:Sa,fa:Da,ha:Ia,$:xa,V:Fa,K:io,C:co,Z:Na,T:yo,r:ro,b:Ha,E:oo,ka:fo,c:za,ja:ho,h:ka,i:qa,q:Ja,P:ao,v:to,F:eo,L:no,z:lo,J:mo,aa:go,_:wo,f:Ga,l:La,e:Wa,g:Va,O:vo,k:Ua,la:so,o:Ka,B:Ya,u:uo,W:Qa,A:po,n:Xa,G:Za,y:Ba};function La(t,e){var r=w();try{$(t)(e)}catch(n){if(g(r),n!==n+0)throw n;m(1,0)}}function Ua(t,e,r,n,a){var o=w();try{$(t)(e,r,n,a)}catch(s){if(g(o),s!==s+0)throw s;m(1,0)}}function Va(t,e,r,n){var a=w();try{$(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function Wa(t,e,r){var n=w();try{$(t)(e,r)}catch(a){if(g(n),a!==a+0)throw a;m(1,0)}}function Ha(t,e){var r=w();try{return $(t)(e)}catch(n){if(g(r),n!==n+0)throw n;m(1,0)}}function ka(t,e,r,n){var a=w();try{return $(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function Na(t,e,r,n,a,o){var s=w();try{return $(t)(e,r,n,a,o)}catch(u){if(g(s),u!==u+0)throw u;m(1,0)}}function za(t,e,r){var n=w();try{return $(t)(e,r)}catch(a){if(g(n),a!==a+0)throw a;m(1,0)}}function Ga(t){var e=w();try{$(t)()}catch(r){if(g(e),r!==r+0)throw r;m(1,0)}}function Xa(t,e,r,n,a,o,s,u,c,d,p){var v=w();try{$(t)(e,r,n,a,o,s,u,c,d,p)}catch(y){if(g(v),y!==y+0)throw y;m(1,0)}}function qa(t,e,r,n,a){var o=w();try{return $(t)(e,r,n,a)}catch(s){if(g(o),s!==s+0)throw s;m(1,0)}}function Ya(t,e,r,n,a,o,s){var u=w();try{$(t)(e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function Za(t,e,r,n,a,o,s,u,c,d,p,v,y,C,I,D){var P=w();try{$(t)(e,r,n,a,o,s,u,c,d,p,v,y,C,I,D)}catch(_){if(g(P),_!==_+0)throw _;m(1,0)}}function Qa(t,e,r,n,a,o,s,u,c){var d=w();try{$(t)(e,r,n,a,o,s,u,c)}catch(p){if(g(d),p!==p+0)throw p;m(1,0)}}function Ja(t,e,r,n,a,o){var s=w();try{return $(t)(e,r,n,a,o)}catch(u){if(g(s),u!==u+0)throw u;m(1,0)}}function Ka(t,e,r,n,a,o){var s=w();try{$(t)(e,r,n,a,o)}catch(u){if(g(s),u!==u+0)throw u;m(1,0)}}function to(t,e,r,n,a,o,s){var u=w();try{return $(t)(e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function eo(t,e,r,n,a,o,s,u){var c=w();try{return $(t)(e,r,n,a,o,s,u)}catch(d){if(g(c),d!==d+0)throw d;m(1,0)}}function ro(t){var e=w();try{return $(t)()}catch(r){if(g(e),r!==r+0)throw r;m(1,0)}}function no(t,e,r,n,a,o,s,u,c){var d=w();try{return $(t)(e,r,n,a,o,s,u,c)}catch(p){if(g(d),p!==p+0)throw p;m(1,0)}}function ao(t,e,r,n,a,o,s){var u=w();try{return $(t)(e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function oo(t,e,r,n){var a=w();try{return $(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function io(t,e,r,n){var a=w();try{return $(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function so(t,e,r,n,a,o,s,u){var c=w();try{$(t)(e,r,n,a,o,s,u)}catch(d){if(g(c),d!==d+0)throw d;m(1,0)}}function uo(t,e,r,n,a,o,s,u){var c=w();try{$(t)(e,r,n,a,o,s,u)}catch(d){if(g(c),d!==d+0)throw d;m(1,0)}}function co(t,e,r,n,a,o){var s=w();try{return $(t)(e,r,n,a,o)}catch(u){if(g(s),u!==u+0)throw u;m(1,0)}}function lo(t,e,r,n,a,o,s,u,c,d){var p=w();try{return $(t)(e,r,n,a,o,s,u,c,d)}catch(v){if(g(p),v!==v+0)throw v;m(1,0)}}function fo(t,e,r){var n=w();try{return $(t)(e,r)}catch(a){if(g(n),a!==a+0)throw a;m(1,0)}}function ho(t,e,r,n,a){var o=w();try{return $(t)(e,r,n,a)}catch(s){if(g(o),s!==s+0)throw s;m(1,0)}}function po(t,e,r,n,a,o,s,u,c,d){var p=w();try{$(t)(e,r,n,a,o,s,u,c,d)}catch(v){if(g(p),v!==v+0)throw v;m(1,0)}}function vo(t,e,r,n,a,o,s){var u=w();try{$(t)(e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function yo(t,e,r,n){var a=w();try{return $(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function mo(t,e,r,n,a,o,s,u,c,d,p,v){var y=w();try{return $(t)(e,r,n,a,o,s,u,c,d,p,v)}catch(C){if(g(y),C!==C+0)throw C;m(1,0)}}function go(t,e,r,n,a,o,s){var u=w();try{return Ze(t,e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function wo(t,e,r,n,a){var o=w();try{return Qe(t,e,r,n,a)}catch(s){if(g(o),s!==s+0)throw s;m(1,0)}}function $o(){Xr();function t(){var e,r;l.calledRun=!0,!gt&&(qr(),(e=ve)===null||e===void 0||e(l),(r=l.onRuntimeInitialized)===null||r===void 0||r.call(l),Yr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),t()},1)):t()}var pt;return pt=await rn(),$o(),we?f=l:f=new Promise((t,e)=>{ve=t,ye=e}),f}function jt(i){return re(Rt,i)}function _r(){return Er(Rt)}function Sr(i){jt({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function Dr(i,f){return Or(Rt,i,f)}const Ir="85d46f55d7c86a4d09bb04273367408b19c324f582d040d018aecb25a9a82942",ne=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"],["any","Any"]],xr=[...ne,["unknown"]].map(i=>i[0]),Lt=new Map(ne);function Mr(i){for(const[f,h]of Lt)if(i===h)return f;return"unknown"}function Ar(i){if(ae(i))return{width:i.naturalWidth,height:i.naturalHeight};if(oe(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ie(i))return{width:i.videoWidth,height:i.videoHeight};if(ue(i))return{width:i.width,height:i.height};if(le(i))return{width:i.displayWidth,height:i.displayHeight};if(se(i))return{width:i.width,height:i.height};if(ce(i))return{width:i.width,height:i.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 ae(i){var f,h;try{return i instanceof((h=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:h.HTMLImageElement)}catch{return!1}}function oe(i){var f,h;try{return i instanceof((h=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:h.SVGImageElement)}catch{return!1}}function ie(i){var f,h;try{return i instanceof((h=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:h.HTMLVideoElement)}catch{return!1}}function se(i){var f,h;try{return i instanceof((h=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:h.HTMLCanvasElement)}catch{return!1}}function ue(i){try{return i instanceof ImageBitmap||Object.prototype.toString.call(i)==="[object ImageBitmap]"}catch{return!1}}function ce(i){try{return i instanceof OffscreenCanvas||Object.prototype.toString.call(i)==="[object OffscreenCanvas]"}catch{return!1}}function le(i){try{return i instanceof VideoFrame||Object.prototype.toString.call(i)==="[object VideoFrame]"}catch{return!1}}function Fr(i){try{return i instanceof Blob||Object.prototype.toString.call(i)==="[object Blob]"}catch{return!1}}function Br(i){try{return i instanceof ImageData||Object.prototype.toString.call(i)==="[object ImageData]"}catch{return!1}}function Rr(i,f){try{const h=new OffscreenCanvas(i,f);if(h.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return h;throw void 0}catch{const h=document.createElement("canvas");return h.width=i,h.height=f,h}}async function fe(i){if(ae(i)&&!await Vr(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(oe(i)&&!await Wr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(le(i)&&Hr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ie(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(ue(i)&&Nr(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:h}=Ar(i);if(f===0||h===0)return null;const l=Rr(f,h).getContext("2d");l.drawImage(i,0,0);try{return l.getImageData(0,0,f,h)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function jr(i){let f;try{f=await createImageBitmap(i)}catch{try{if(globalThis.Image){f=new Image;let l="";try{l=URL.createObjectURL(i),f.src=l,await f.decode()}finally{URL.revokeObjectURL(l)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await fe(f)}function Lr(i){const{width:f,height:h}=i;if(f===0||h===0)return null;const T=i.getContext("2d");try{return T.getImageData(0,0,f,h)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Ur(i){if(Fr(i))return await jr(i);if(Br(i)){if(kr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return se(i)||ce(i)?Lr(i):await fe(i)}async function Vr(i){try{return await i.decode(),!0}catch{return!1}}async function Wr(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function Hr(i){return i.format===null}function kr(i){return i.data.buffer.byteLength===0}function Nr(i){return i.width===0&&i.height===0}function de(i,f){return zr(i)?new DOMException(`${f}: ${i.message}`,i.name):Gr(i)?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}function zr(i){return i instanceof DOMException||Object.prototype.toString.call(i)==="[object DOMException]"}function Gr(i){return i instanceof Error||Object.prototype.toString.call(i)==="[object Error]"}class he{constructor(f={}){ir(this,it);var h;try{const T=(h=f==null?void 0:f.formats)==null?void 0:h.filter(l=>l!=="unknown");if((T==null?void 0:T.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const l of T!=null?T:[])if(!Lt.has(l))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${l}' is not a valid enum value of type BarcodeFormat.`);sr(this,it,T!=null?T:[]),jt({fireImmediately:!0}).catch(()=>{})}catch(T){throw de(T,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return xr.filter(f=>f!=="unknown")}async detect(f){try{const h=await Ur(f);if(h===null)return[];let T;const l={tryCode39ExtendedMode:!1,textMode:"Plain",formats:or(this,it).map(x=>Lt.get(x))};try{T=await Dr(h,l)}catch(x){throw console.error(x),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return T.map(x=>{const{topLeft:{x:A,y:B},topRight:{x:S,y:R},bottomLeft:{x:H,y:Z},bottomRight:{x:nt,y:Q}}=x.position,st=Math.min(A,S,H,nt),k=Math.min(B,R,Z,Q),J=Math.max(A,S,H,nt),gt=Math.max(B,R,Z,Q);return{boundingBox:new DOMRectReadOnly(st,k,J-st,gt-k),rawValue:x.text,format:Mr(x.format),cornerPoints:[{x:A,y:B},{x:S,y:R},{x:nt,y:Q},{x:H,y:Z}]}})}catch(h){throw de(h,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return it=new WeakMap,(pe=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=he),O.BarcodeDetector=he,O.ZXING_CPP_COMMIT=Cr,O.ZXING_WASM_SHA256=Ir,O.ZXING_WASM_VERSION=br,O.prepareZXingModule=jt,O.purgeZXingModule=_r,O.setZXingModuleOverrides=Sr,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),O})({});
|
package/dist/iife/polyfill.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var BarcodeDetectionAPI=function(_){"use strict";var Ye=_=>{throw TypeError(_)};var Ze=(_,M,R)=>M.has(_)||Ye("Cannot "+R);var Qe=(_,M,R)=>(Ze(_,M,"read from private field"),R?R.call(_):M.get(_)),Je=(_,M,R)=>M.has(_)?Ye("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(_):M.set(_,R),Ke=(_,M,R,gt)=>(Ze(_,M,"write to private field"),gt?gt.call(_,R):M.set(_,R),R);var ct,ye;const M=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],R=M.map(([i])=>i),gt=R.filter((i,f)=>M[f][1]==="L"),tr=R.filter((i,f)=>M[f][1]==="M");function Bt(i){switch(i){case"Linear-Codes":return gt.reduce((f,p)=>f|Bt(p),0);case"Matrix-Codes":return tr.reduce((f,p)=>f|Bt(p),0);case"Any":return(1<<M.length)-1;case"None":return 0;default:return 1<<R.indexOf(i)}}function er(i){if(i===0)return"None";const f=31-Math.clz32(i);return R[f]}function rr(i){return i.reduce((f,p)=>f|Bt(p),0)}const nr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function ar(i){return nr.indexOf(i)}const ne=["Unknown","ASCII","ISO8859_1","ISO8859_2","ISO8859_3","ISO8859_4","ISO8859_5","ISO8859_6","ISO8859_7","ISO8859_8","ISO8859_9","ISO8859_10","ISO8859_11","ISO8859_13","ISO8859_14","ISO8859_15","ISO8859_16","Cp437","Cp1250","Cp1251","Cp1252","Cp1256","Shift_JIS","Big5","GB2312","GB18030","EUC_JP","EUC_KR","UTF16BE","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function or(i){return i==="UnicodeBig"?ne.indexOf("UTF16BE"):ne.indexOf(i)}const ir=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function sr(i){return ir[i]}const ur=["Ignore","Read","Require"];function cr(i){return ur.indexOf(i)}const lr=["Plain","ECI","HRI","Hex","Escaped"];function fr(i){return lr.indexOf(i)}const wt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function ae(i){return{...i,formats:rr(i.formats),binarizer:ar(i.binarizer),eanAddOnSymbol:cr(i.eanAddOnSymbol),textMode:fr(i.textMode),characterSet:or(i.characterSet)}}function dr(i){return{...i,format:er(i.format),contentType:sr(i.contentType),eccLevel:i.ecLevel}}const hr="2.2.0",pr="0a3797f698b339c1c01c487a7a43f1368610f503",vr={locateFile:(i,f)=>{const p=i.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.0/dist/${p[1]}/${i}`:f+i}},$t=new WeakMap;function yr(i,f){return Object.is(i,f)||Object.keys(i).length===Object.keys(f).length&&Object.keys(i).every(p=>Object.hasOwn(f,p)&&i[p]===f[p])}function oe(i,{overrides:f,equalityFn:p=yr,fireImmediately:l=!1}={}){var C;const[A,F]=(C=$t.get(i))!=null?C:[vr],B=f!=null?f:A;let S;if(l){if(F&&(S=p(A,B)))return F;const j=i({...B});return $t.set(i,[B,j]),j}(S!=null?S:p(A,B))||$t.set(i,[B])}function mr(i){$t.delete(i)}async function gr(i,f,p=wt){const l={...wt,...p},C=await oe(i,{fireImmediately:!0});let A,F;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:j},width:q,height:Z}=f;F=C._malloc(j),C.HEAPU8.set(S,F),A=C.readBarcodesFromPixmap(F,q,Z,ae(l))}else{let S,j;if("buffer"in f)[S,j]=[f.byteLength,f];else if("byteLength"in f)[S,j]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,j]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");F=C._malloc(S),C.HEAPU8.set(j,F),A=C.readBarcodesFromImage(F,S,ae(l))}C._free(F);const B=[];for(let S=0;S<A.size();++S)B.push(dr(A.get(S)));return B}({...wt,formats:[...wt.formats]});var Wt=async function(i={}){var f,p,l=i,C,A,F=new Promise((e,t)=>{C=e,A=t}),B=typeof window=="object",S=typeof Bun<"u",j=typeof WorkerGlobalScope<"u";typeof process=="object"&&!((p=process.versions)===null||p===void 0)&&p.node&&process.type!="renderer";var q="./this.program",Z,Q="";function lt(e){return l.locateFile?l.locateFile(e,Q):Q+e}var ft,at;if(B||j||S){try{Q=new URL(".",Z).href}catch{}j&&(at=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),ft=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)}}var bt=console.log.bind(console),Y=console.error.bind(console),dt,Ct,me=!1,J,V,Tt,ot,it,P,ge,we;function $e(){var e=Ct.buffer;J=new Int8Array(e),Tt=new Int16Array(e),l.HEAPU8=V=new Uint8Array(e),ot=new Uint16Array(e),it=new Int32Array(e),P=new Uint32Array(e),ge=new Float32Array(e),we=new Float64Array(e)}function Ur(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)Kr(l.preRun.shift());be(Te)}function Vr(){E.ya()}function kr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)Jr(l.postRun.shift());be(Ce)}var K=0,ht=null;function Hr(e){var t;K++,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K)}function Nr(e){var t;if(K--,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K),K==0&&ht){var r=ht;ht=null,r()}}function kt(e){var t;(t=l.onAbort)===null||t===void 0||t.call(l,e),e="Aborted("+e+")",Y(e),me=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw A(r),r}var Pt;function zr(){return lt("zxing_reader.wasm")}function Gr(e){if(e==Pt&&dt)return new Uint8Array(dt);if(at)return at(e);throw"both async and sync fetching of the wasm failed"}async function Xr(e){if(!dt)try{var t=await ft(e);return new Uint8Array(t)}catch{}return Gr(e)}async function qr(e,t){try{var r=await Xr(e),n=await WebAssembly.instantiate(r,t);return n}catch(a){Y(`failed to asynchronously prepare wasm: ${a}`),kt(a)}}async function Yr(e,t,r){if(!e&&typeof WebAssembly.instantiateStreaming=="function")try{var n=fetch(t,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(o){Y(`wasm streaming compile failed: ${o}`),Y("falling back to ArrayBuffer instantiation")}return qr(t,r)}function Zr(){return{a:Ma}}async function Qr(){function e(o,u){return E=o.exports,Ct=E.xa,$e(),Me=E.Ba,Nr(),E}Hr();function t(o){return e(o.instance)}var r=Zr();if(l.instantiateWasm)return new Promise((o,u)=>{l.instantiateWasm(r,(s,c)=>{o(e(s))})});Pt!=null||(Pt=zr());try{var n=await Yr(dt,Pt,r),a=t(n);return a}catch(o){return A(o),Promise.reject(o)}}var be=e=>{for(;e.length>0;)e.shift()(l)},Ce=[],Jr=e=>Ce.push(e),Te=[],Kr=e=>Te.push(e),m=e=>La(e),g=()=>Ba(),_t=[],Et=0,tn=e=>{var t=new Ht(e);return t.get_caught()||(t.set_caught(!0),Et--),t.set_rethrown(!1),_t.push(t),Ua(e),ja(e)},N=0,en=()=>{y(0,0);var e=_t.pop();Wa(e.excPtr),N=0};class Ht{constructor(t){this.excPtr=t,this.ptr=t-24}set_type(t){P[this.ptr+4>>2]=t}get_type(){return P[this.ptr+4>>2]}set_destructor(t){P[this.ptr+8>>2]=t}get_destructor(){return P[this.ptr+8>>2]}set_caught(t){t=t?1:0,J[this.ptr+12]=t}get_caught(){return J[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,J[this.ptr+13]=t}get_rethrown(){return J[this.ptr+13]!=0}init(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r)}set_adjusted_ptr(t){P[this.ptr+16>>2]=t}get_adjusted_ptr(){return P[this.ptr+16>>2]}}var Ot=e=>Ra(e),Nt=e=>{var t=N;if(!t)return Ot(0),0;var r=new Ht(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ot(0),t;for(var a of e){if(a===0||a===n)break;var o=r.ptr+16;if(Va(a,n,o))return Ot(a),t}return Ot(n),t},rn=()=>Nt([]),nn=e=>Nt([e]),an=(e,t)=>Nt([e,t]),on=()=>{var e=_t.pop();e||kt("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(_t.push(e),e.set_rethrown(!0),e.set_caught(!1),Et++),N=t,N},sn=(e,t,r)=>{var n=new Ht(e);throw n.init(t,r),N=e,Et++,N},un=()=>Et,cn=e=>{throw N||(N=e),N},ln=()=>kt(""),At={},zt=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function pt(e){return this.fromWireType(P[e>>2])}var st={},tt={},St={},fn=class extends Error{constructor(e){super(e),this.name="InternalError"}},Dt=e=>{throw new fn(e)},et=(e,t,r)=>{e.forEach(s=>St[s]=t);function n(s){var c=r(s);c.length!==e.length&&Dt("Mismatched type converter count");for(var d=0;d<e.length;++d)H(e[d],c[d])}var a=new Array(t.length),o=[],u=0;t.forEach((s,c)=>{tt.hasOwnProperty(s)?a[c]=tt[s]:(o.push(s),st.hasOwnProperty(s)||(st[s]=[]),st[s].push(()=>{a[c]=tt[s],++u,u===o.length&&n(a)}))}),o.length===0&&n(a)},dn=e=>{var t=At[e];delete At[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([e],o,u=>{var s={};return a.forEach((c,d)=>{var h=c.fieldName,v=u[d],$=u[d].optional,b=c.getter,O=c.getterContext,x=u[d+a.length],D=c.setter,I=c.setterContext;s[h]={read:X=>v.fromWireType(b(O,X)),write:(X,W)=>{var U=[];D(I,X,x.toWireType(U,W)),zt(U)},optional:$}}),[{name:t.name,fromWireType:c=>{var d={};for(var h in s)d[h]=s[h].read(c);return n(c),d},toWireType:(c,d)=>{for(var h in s)if(!(h in d)&&!s[h].optional)throw new TypeError(`Missing field: "${h}"`);var v=r();for(h in s)s[h].write(v,d[h]);return c!==null&&c.push(n,v),v},argPackAdvance:z,readValueFromPointer:pt,destructorFunction:n}]})},hn=(e,t,r,n,a)=>{},pn=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Pe=e},Pe,L=e=>{for(var t="",r=e;V[r];)t+=Pe[V[r++]];return t},vt=class extends Error{constructor(e){super(e),this.name="BindingError"}},T=e=>{throw new vt(e)};function vn(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=t.name;if(e||T(`type "${n}" must have a positive integer typeid pointer`),tt.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(tt[e]=t,delete St[e],st.hasOwnProperty(e)){var a=st[e];delete st[e],a.forEach(o=>o())}}function H(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return vn(e,t,r)}var z=8,yn=(e,t,r,n)=>{t=L(t),H(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:z,readValueFromPointer:function(a){return this.fromWireType(V[a])},destructorFunction:null})},mn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Gt=e=>{function t(r){return r.$$.ptrType.registeredClass.name}T(t(e)+" instance already deleted")},Xt=!1,_e=e=>{},gn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Ee=e=>{e.count.value-=1;var t=e.count.value===0;t&&gn(e)},yt=e=>typeof FinalizationRegistry>"u"?(yt=t=>t,e):(Xt=new FinalizationRegistry(t=>{Ee(t.$$)}),yt=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(t,a,t)}return t},_e=t=>Xt.unregister(t),yt(e)),wn=()=>{let e=xt.prototype;Object.assign(e,{isAliasOf(r){if(!(this instanceof xt)||!(r instanceof xt))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var o=r.$$.ptrType.registeredClass,u=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;o.baseClass;)u=o.upcast(u),o=o.baseClass;return n===o&&a===u},clone(){if(this.$$.ptr||Gt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:mn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),_e(this),Ee(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)};function xt(){}var qt=(e,t)=>Object.defineProperty(t,"name",{value:e}),Oe={},Ae=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return e[t].overloadTable.hasOwnProperty(o.length)||T(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[o.length].apply(this,o)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},Se=(e,t,r)=>{l.hasOwnProperty(e)?((r===void 0||l[e].overloadTable!==void 0&&l[e].overloadTable[r]!==void 0)&&T(`Cannot register public name '${e}' twice`),Ae(l,e,e),l[e].overloadTable.hasOwnProperty(r)&&T(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[e].overloadTable[r]=t):(l[e]=t,l[e].argCount=r)},$n=48,bn=57,Cn=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=$n&&t<=bn?`_${e}`:e};function Tn(e,t,r,n,a,o,u,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Yt=(e,t,r)=>{for(;t!==r;)t.upcast||T(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e},Zt=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e};function Pn(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(t)}" as a ${this.name}`),t.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=Yt(t.$$.ptr,r,this.registeredClass);return n}function _n(e,t){var r;if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&T(`Cannot pass "${Zt(t)}" as a ${this.name}`),t.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&T(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=Yt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&T("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:T(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var a=t.clone();r=this.rawShare(r,G.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:T("Unsupporting sharing policy")}return r}function En(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(t)}" as a ${this.name}`),t.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&T(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=Yt(t.$$.ptr,r,this.registeredClass);return n}var De=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=De(e,t,r.baseClass);return n===null?null:r.downcast(n)},On={},An=(e,t)=>{for(t===void 0&&T("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},Sn=(e,t)=>(t=An(e,t),On[t]),It=(e,t)=>{(!t.ptrType||!t.ptr)&&Dt("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Dt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},yt(Object.create(e,{$$:{value:t,writable:!0}}))};function Dn(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Sn(this.registeredClass,t);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?It(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):It(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(t),u=Oe[o];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var c=De(t,this.registeredClass,s.registeredClass);return c===null?a.call(this):this.isSmartPointer?It(s.registeredClass.instancePrototype,{ptrType:s,ptr:c,smartPtrType:this,smartPtr:e}):It(s.registeredClass.instancePrototype,{ptrType:s,ptr:c})}var xn=()=>{Object.assign(Mt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t;(t=this.rawDestructor)===null||t===void 0||t.call(this,e)},argPackAdvance:z,readValueFromPointer:pt,fromWireType:Dn})};function Mt(e,t,r,n,a,o,u,s,c,d,h){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=h,!a&&t.baseClass===void 0?n?(this.toWireType=Pn,this.destructorFunction=null):(this.toWireType=En,this.destructorFunction=null):this.toWireType=_n}var xe=(e,t,r)=>{l.hasOwnProperty(e)||Dt("Replacing nonexistent public symbol"),l[e].overloadTable!==void 0&&r!==void 0?l[e].overloadTable[r]=t:(l[e]=t,l[e].argCount=r)},Ie=[],Me,w=e=>{var t=Ie[e];return t||(Ie[e]=t=Me.get(e)),t},In=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.includes("j"))return dynCallLegacy(e,t,r);var n=w(t),a=n(...r);return a},Mn=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return In(e,t,a,r)}},k=function(e,t){e=L(e);function r(){if(e.includes("j"))return Mn(e,t);var a=w(t);return a}var n=r();return typeof n!="function"&&T(`unknown function pointer with signature ${e}: ${t}`),n};class Fn extends Error{}var Fe=e=>{var t=Fa(e),r=L(t);return nt(t),r},Ft=(e,t)=>{var r=[],n={};function a(o){if(!n[o]&&!tt[o]){if(St[o]){St[o].forEach(a);return}r.push(o),n[o]=!0}}throw t.forEach(a),new Fn(`${e}: `+r.map(Fe).join([", "]))},jn=(e,t,r,n,a,o,u,s,c,d,h,v,$)=>{h=L(h),o=k(a,o),s&&(s=k(u,s)),d&&(d=k(c,d)),$=k(v,$);var b=Cn(h);Se(b,function(){Ft(`Cannot construct ${h} due to unbound types`,[n])}),et([e,t,r],n?[n]:[],O=>{O=O[0];var x,D;n?(x=O.registeredClass,D=x.instancePrototype):D=xt.prototype;var I=qt(h,function(){if(Object.getPrototypeOf(this)!==X)throw new vt(`Use 'new' to construct ${h}`);if(W.constructor_body===void 0)throw new vt(`${h} has no accessible constructor`);for(var Xe=arguments.length,Rt=new Array(Xe),Lt=0;Lt<Xe;Lt++)Rt[Lt]=arguments[Lt];var qe=W.constructor_body[Rt.length];if(qe===void 0)throw new vt(`Tried to invoke ctor of ${h} with invalid number of parameters (${Rt.length}) - expected (${Object.keys(W.constructor_body).toString()}) parameters instead!`);return qe.apply(this,Rt)}),X=Object.create(D,{constructor:{value:I}});I.prototype=X;var W=new Tn(h,I,X,$,x,o,s,d);if(W.baseClass){var U,jt;(jt=(U=W.baseClass).__derivedClasses)!==null&&jt!==void 0||(U.__derivedClasses=[]),W.baseClass.__derivedClasses.push(W)}var Oo=new Mt(h,W,!0,!1,!1),ze=new Mt(h+"*",W,!1,!1,!1),Ge=new Mt(h+" const*",W,!1,!0,!1);return Oe[e]={pointerType:ze,constPointerType:Ge},xe(b,I),[Oo,ze,Ge]})},Qt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(P[t+n*4>>2]);return r};function Rn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Jt(e,t,r,n,a,o){var u=t.length;u<2&&T("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=t[1]!==null&&r!==null,c=Rn(t),d=t[0].name!=="void",h=u-2,v=new Array(h),$=[],b=[],O=function(){b.length=0;var x;$.length=s?2:1,$[0]=a,s&&(x=t[1].toWireType(b,this),$[1]=x);for(var D=0;D<h;++D)v[D]=t[D+2].toWireType(b,D<0||arguments.length<=D?void 0:arguments[D]),$.push(v[D]);var I=n(...$);function X(W){if(c)zt(b);else for(var U=s?1:2;U<t.length;U++){var jt=U===1?x:v[U-2];t[U].destructorFunction!==null&&t[U].destructorFunction(jt)}if(d)return t[0].fromWireType(W)}return X(I)};return qt(e,O)}var Ln=(e,t,r,n,a,o)=>{var u=Qt(t,r);a=k(n,a),et([],[e],s=>{s=s[0];var c=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[t-1]!==void 0)throw new vt(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[t-1]=()=>{Ft(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,d=>(d.splice(1,0,null),s.registeredClass.constructor_body[t-1]=Jt(c,d,null,a,o),[])),[]})},je=e=>{e=e.trim();const t=e.indexOf("(");return t===-1?e:e.slice(0,t)},Bn=(e,t,r,n,a,o,u,s,c,d)=>{var h=Qt(r,n);t=L(t),t=je(t),o=k(a,o),et([],[e],v=>{v=v[0];var $=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&v.registeredClass.pureVirtualFunctions.push(t);function b(){Ft(`Cannot call ${$} due to unbound types`,h)}var O=v.registeredClass.instancePrototype,x=O[t];return x===void 0||x.overloadTable===void 0&&x.className!==v.name&&x.argCount===r-2?(b.argCount=r-2,b.className=v.name,O[t]=b):(Ae(O,t,$),O[t].overloadTable[r-2]=b),et([],h,D=>{var I=Jt($,D,v,o,u);return O[t].overloadTable===void 0?(I.argCount=r-2,O[t]=I):O[t].overloadTable[r-2]=I,[]}),[]})},Re=[],rt=[0,1,,1,null,1,!0,1,!1,1],Kt=e=>{e>9&&--rt[e+1]===0&&(rt[e]=void 0,Re.push(e))},G={toValue:e=>(e||T(`Cannot use deleted val. handle = ${e}`),rt[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=Re.pop()||rt.length;return rt[t]=e,rt[t+1]=1,t}}}},Le={name:"emscripten::val",fromWireType:e=>{var t=G.toValue(e);return Kt(e),t},toWireType:(e,t)=>G.toHandle(t),argPackAdvance:z,readValueFromPointer:pt,destructorFunction:null},Wn=e=>H(e,Le),Un=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(ge[r>>2])};case 8:return function(r){return this.fromWireType(we[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Vn=(e,t,r)=>{t=L(t),H(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:z,readValueFromPointer:Un(t,r),destructorFunction:null})},kn=(e,t,r,n,a,o,u,s)=>{var c=Qt(t,r);e=L(e),e=je(e),a=k(n,a),Se(e,function(){Ft(`Cannot call ${e} due to unbound types`,c)},t-1),et([],c,d=>{var h=[d[0],null].concat(d.slice(1));return xe(e,Jt(e,h,null,a,o),t-1),[]})},Hn=(e,t,r)=>{switch(t){case 1:return r?n=>J[n]:n=>V[n];case 2:return r?n=>Tt[n>>1]:n=>ot[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Nn=(e,t,r,n,a)=>{t=L(t);const o=n===0;let u=c=>c;if(o){var s=32-8*r;u=c=>c<<s>>>s,a=u(a)}H(e,{name:t,fromWireType:u,toWireType:(c,d)=>d,argPackAdvance:z,readValueFromPointer:Hn(t,r,n!==0),destructorFunction:null})},zn=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function o(u){var s=P[u>>2],c=P[u+4>>2];return new a(J.buffer,c,s)}r=L(r),H(e,{name:r,fromWireType:o,argPackAdvance:z,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Gn=Object.assign({optional:!0},Le),Xn=(e,t)=>{H(e,Gn)},qn=(e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,u=0;u<e.length;++u){var s=e.charCodeAt(u);if(s>=55296&&s<=57343){var c=e.charCodeAt(++u);s=65536+((s&1023)<<10)|c&1023}if(s<=127){if(r>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|s&63}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|s&63}else{if(r+3>=o)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|s&63}}return t[r]=0,r-a},ut=(e,t,r)=>qn(e,V,t,r),Be=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},We=typeof TextDecoder<"u"?new TextDecoder:void 0,Ue=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var n=t+r,a=t;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&We)return We.decode(e.subarray(t,a));for(var o="";t<a;){var u=e[t++];if(!(u&128)){o+=String.fromCharCode(u);continue}var s=e[t++]&63;if((u&224)==192){o+=String.fromCharCode((u&31)<<6|s);continue}var c=e[t++]&63;if((u&240)==224?u=(u&15)<<12|s<<6|c:u=(u&7)<<18|s<<12|c<<6|e[t++]&63,u<65536)o+=String.fromCharCode(u);else{var d=u-65536;o+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return o},Yn=(e,t)=>e?Ue(V,e,t):"",Zn=(e,t)=>{t=L(t),H(e,{name:t,fromWireType(r){for(var n=P[r>>2],a=r+4,o,s,u=a,s=0;s<=n;++s){var c=a+s;if(s==n||V[c]==0){var d=c-u,h=Yn(u,d);o===void 0?o=h:(o+="\0",o+=h),u=c+1}}return nt(r),o},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,o=typeof n=="string";o||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||T("Cannot pass non-string to std::string"),o?a=Be(n):a=n.length;var u=Ne(4+a+1),s=u+4;return P[u>>2]=a,o?ut(n,s,a+1):V.set(n,s),r!==null&&r.push(nt,u),u},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(r){nt(r)}})},Ve=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Qn=(e,t)=>{for(var r=e>>1,n=r+t/2,a=r;!(a>=n)&&ot[a];)++a;if(a-r>16&&Ve)return Ve.decode(ot.subarray(r,a));for(var o="",u=r;!(u>=n);++u){var s=ot[u];if(s==0)break;o+=String.fromCharCode(s)}return o},Jn=(e,t,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=t,a=r<e.length*2?r/2:e.length,o=0;o<a;++o){var u=e.charCodeAt(o);Tt[t>>1]=u,t+=2}return Tt[t>>1]=0,t-n},Kn=e=>e.length*2,ta=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=it[e+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},ea=(e,t,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,o=0;o<e.length;++o){var u=e.charCodeAt(o);if(u>=55296&&u<=57343){var s=e.charCodeAt(++o);u=65536+((u&1023)<<10)|s&1023}if(it[t>>2]=u,t+=4,t+4>a)break}return it[t>>2]=0,t-n},ra=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},na=(e,t,r)=>{r=L(r);var n,a,o,u;t===2?(n=Qn,a=Jn,u=Kn,o=s=>ot[s>>1]):t===4&&(n=ta,a=ea,u=ra,o=s=>P[s>>2]),H(e,{name:r,fromWireType:s=>{for(var c=P[s>>2],d,h=s+4,v=0;v<=c;++v){var $=s+4+v*t;if(v==c||o($)==0){var b=$-h,O=n(h,b);d===void 0?d=O:(d+="\0",d+=O),h=$+t}}return nt(s),d},toWireType:(s,c)=>{typeof c!="string"&&T(`Cannot pass non-string to C++ string type ${r}`);var d=u(c),h=Ne(4+d+t);return P[h>>2]=d/t,a(c,h+4,d+t),s!==null&&s.push(nt,h),h},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(s){nt(s)}})},aa=(e,t,r,n,a,o)=>{At[e]={name:L(t),rawConstructor:k(r,n),rawDestructor:k(a,o),fields:[]}},oa=(e,t,r,n,a,o,u,s,c,d)=>{At[e].fields.push({fieldName:L(t),getterReturnType:r,getter:k(n,a),getterContext:o,setterArgumentType:u,setter:k(s,c),setterContext:d})},ia=(e,t)=>{t=L(t),H(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},te=[],sa=(e,t,r,n)=>(e=te[e],t=G.toValue(t),e(null,t,r,n)),ua={},ca=e=>{var t=ua[e];return t===void 0?L(e):t},ke=()=>{if(typeof globalThis=="object")return globalThis;function e(t){t.$$$embind_global$$$=t;var r=typeof $$$embind_global$$$=="object"&&t.$$$embind_global$$$==t;return r||delete t.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&e(global)?$$$embind_global$$$=global:typeof self=="object"&&e(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},la=e=>e===0?G.toHandle(ke()):(e=ca(e),G.toHandle(ke()[e])),fa=e=>{var t=te.length;return te.push(e),t},He=(e,t)=>{var r=tt[e];return r===void 0&&T(`${t} has unknown type ${Fe(e)}`),r},da=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=He(P[t+n*4>>2],`parameter ${n}`);return r},ha=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(P[t>>2]=G.toHandle(n)),a},pa=Reflect.construct,va=(e,t,r)=>{var n=da(e,t),a=n.shift();e--;var o=new Array(e),u=(c,d,h,v)=>{for(var $=0,b=0;b<e;++b)o[b]=n[b].readValueFromPointer(v+$),$+=n[b].argPackAdvance;var O=r===1?pa(d,o):d.apply(c,o);return ha(a,h,O)},s=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${a.name}>`;return fa(qt(s,u))},ya=e=>{e>9&&(rt[e+1]+=1)},ma=e=>{var t=G.toValue(e);zt(t),Kt(e)},ga=(e,t)=>{e=He(e,"_emval_take_value");var r=e.readValueFromPointer(t);return G.toHandle(r)},wa=(e,t,r,n)=>{var a=new Date().getFullYear(),o=new Date(a,0,1),u=new Date(a,6,1),s=o.getTimezoneOffset(),c=u.getTimezoneOffset(),d=Math.max(s,c);P[e>>2]=d*60,it[t>>2]=+(s!=c);var h=b=>{var O=b>=0?"-":"+",x=Math.abs(b),D=String(Math.floor(x/60)).padStart(2,"0"),I=String(x%60).padStart(2,"0");return`UTC${O}${D}${I}`},v=h(s),$=h(c);c<s?(ut(v,r,17),ut($,n,17)):(ut(v,n,17),ut($,r,17))},$a=()=>2147483648,ba=(e,t)=>Math.ceil(e/t)*t,Ca=e=>{var t=Ct.buffer,r=(e-t.byteLength+65535)/65536|0;try{return Ct.grow(r),$e(),1}catch{}},Ta=e=>{var t=V.length;e>>>=0;var r=$a();if(e>r)return!1;for(var n=1;n<=4;n*=2){var a=t*(1+.2/n);a=Math.min(a,e+100663296);var o=Math.min(r,ba(Math.max(e,a),65536)),u=Ca(o);if(u)return!0}return!1},ee={},Pa=()=>q||"./this.program",mt=()=>{if(!mt.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Pa()};for(var r in ee)ee[r]===void 0?delete t[r]:t[r]=ee[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);mt.strings=n}return mt.strings},_a=(e,t)=>{var r=0,n=0;for(var a of mt()){var o=t+r;P[e+n>>2]=o,r+=ut(a,o,1/0)+1,n+=4}return 0},Ea=(e,t)=>{var r=mt();P[e>>2]=r.length;var n=0;for(var a of r)n+=Be(a)+1;return P[t>>2]=n,0},Oa=e=>52;function Aa(e,t,r,n,a){return 70}var Sa=[null,[],[]],Da=(e,t)=>{var r=Sa[e];t===0||t===10?((e===1?bt:Y)(Ue(r)),r.length=0):r.push(t)},xa=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var u=P[t>>2],s=P[t+4>>2];t+=8;for(var c=0;c<s;c++)Da(e,V[u+c]);a+=s}return P[n>>2]=a,0},Ia=e=>e;pn(),wn(),xn(),l.noExitRuntime&&l.noExitRuntime,l.print&&(bt=l.print),l.printErr&&(Y=l.printErr),l.wasmBinary&&(dt=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(q=l.thisProgram);var Ma={s:tn,w:en,a:rn,j:nn,m:an,P:on,p:sn,ga:un,d:cn,ba:ln,ua:dn,aa:hn,pa:yn,sa:jn,ra:Ln,H:Bn,na:Wn,V:Vn,W:kn,x:Nn,t:zn,ta:Xn,oa:Zn,Q:na,I:aa,va:oa,qa:ia,da:sa,wa:Kt,D:la,ma:va,X:ya,Y:ma,U:ga,ca:wa,ha:Ta,ea:_a,fa:Ea,ia:Oa,_:Aa,S:xa,K:po,C:yo,M:Ga,R:Co,q:co,b:Ya,E:ho,ka:go,c:Za,ja:wo,h:za,i:to,r:ao,O:fo,v:io,F:uo,L:lo,z:mo,J:To,$:Po,Z:_o,k:Qa,f:Na,e:qa,g:Xa,N:bo,l:Ka,la:vo,o:oo,B:eo,u:so,T:no,A:$o,n:Ja,G:ro,y:Ia},E=await Qr();E.ya;var Fa=E.za,nt=l._free=E.Aa,Ne=l._malloc=E.Ca,ja=E.Da,y=E.Ea,Ra=E.Fa,La=E.Ga,Ba=E.Ha,Wa=E.Ia,Ua=E.Ja,Va=E.Ka;l.dynCall_viijii=E.La;var ka=l.dynCall_iiijj=E.Ma;l.dynCall_jiji=E.Na;var Ha=l.dynCall_jiiii=E.Oa;l.dynCall_iiiiij=E.Pa,l.dynCall_iiiiijj=E.Qa,l.dynCall_iiiiiijj=E.Ra;function Na(e,t){var r=g();try{w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function za(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function Ga(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function Xa(e,t,r,n){var a=g();try{w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function qa(e,t,r){var n=g();try{w(e)(t,r)}catch(a){if(m(n),a!==a+0)throw a;y(1,0)}}function Ya(e,t){var r=g();try{return w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function Za(e,t,r){var n=g();try{return w(e)(t,r)}catch(a){if(m(n),a!==a+0)throw a;y(1,0)}}function Qa(e){var t=g();try{w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function Ja(e,t,r,n,a,o,u,s,c,d,h){var v=g();try{w(e)(t,r,n,a,o,u,s,c,d,h)}catch($){if(m(v),$!==$+0)throw $;y(1,0)}}function Ka(e,t,r,n,a){var o=g();try{w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function to(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function eo(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ro(e,t,r,n,a,o,u,s,c,d,h,v,$,b,O,x){var D=g();try{w(e)(t,r,n,a,o,u,s,c,d,h,v,$,b,O,x)}catch(I){if(m(D),I!==I+0)throw I;y(1,0)}}function no(e,t,r,n,a,o,u,s,c){var d=g();try{w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function ao(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function oo(e,t,r,n,a,o){var u=g();try{w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function io(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function so(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function uo(e,t,r,n,a,o,u,s){var c=g();try{return w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function co(e){var t=g();try{return w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function lo(e,t,r,n,a,o,u,s,c){var d=g();try{return w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function fo(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ho(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function po(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function vo(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function yo(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function mo(e,t,r,n,a,o,u,s,c,d){var h=g();try{return w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function go(e,t,r){var n=g();try{return w(e)(t,r)}catch(a){if(m(n),a!==a+0)throw a;y(1,0)}}function wo(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function $o(e,t,r,n,a,o,u,s,c,d){var h=g();try{w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function bo(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function Co(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function To(e,t,r,n,a,o,u,s,c,d,h,v){var $=g();try{return w(e)(t,r,n,a,o,u,s,c,d,h,v)}catch(b){if(m($),b!==b+0)throw b;y(1,0)}}function Po(e,t,r,n,a,o,u){var s=g();try{return ka(e,t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function _o(e,t,r,n,a){var o=g();try{return Ha(e,t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function re(){if(K>0){ht=re;return}if(Ur(),K>0){ht=re;return}function e(){var t;l.calledRun=!0,!me&&(Vr(),C(l),(t=l.onRuntimeInitialized)===null||t===void 0||t.call(l),kr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),e()},1)):e()}function Eo(){if(l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()()}return Eo(),re(),f=F,f};function Ut(i){return oe(Wt,i)}function wr(){return mr(Wt)}function $r(i){Ut({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function br(i,f){return gr(Wt,i,f)}const Cr="68d20eb8c486afabf49fab6d9fbc5f118df8648ec6200e8039ef8912a169c00c",ie=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"],["any","Any"]],Tr=[...ie,["unknown"]].map(i=>i[0]),Vt=new Map(ie);function Pr(i){for(const[f,p]of Vt)if(i===p)return f;return"unknown"}function _r(i){if(se(i))return{width:i.naturalWidth,height:i.naturalHeight};if(ue(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ce(i))return{width:i.videoWidth,height:i.videoHeight};if(fe(i))return{width:i.width,height:i.height};if(he(i))return{width:i.displayWidth,height:i.displayHeight};if(le(i))return{width:i.width,height:i.height};if(de(i))return{width:i.width,height:i.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 se(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function ue(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function ce(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function le(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function fe(i){try{return i instanceof ImageBitmap||Object.prototype.toString.call(i)==="[object ImageBitmap]"}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas||Object.prototype.toString.call(i)==="[object OffscreenCanvas]"}catch{return!1}}function he(i){try{return i instanceof VideoFrame||Object.prototype.toString.call(i)==="[object VideoFrame]"}catch{return!1}}function Er(i){try{return i instanceof Blob||Object.prototype.toString.call(i)==="[object Blob]"}catch{return!1}}function Or(i){try{return i instanceof ImageData||Object.prototype.toString.call(i)==="[object ImageData]"}catch{return!1}}function Ar(i,f){try{const p=new OffscreenCanvas(i,f);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=i,p.height=f,p}}async function pe(i){if(se(i)&&!await Ir(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ue(i)&&!await Mr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(he(i)&&Fr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ce(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(fe(i)&&Rr(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:p}=_r(i);if(f===0||p===0)return null;const C=Ar(f,p).getContext("2d");C.drawImage(i,0,0);try{return C.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Sr(i){let f;try{f=await createImageBitmap(i)}catch{try{if(globalThis.Image){f=new Image;let C="";try{C=URL.createObjectURL(i),f.src=C,await f.decode()}finally{URL.revokeObjectURL(C)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await pe(f)}function Dr(i){const{width:f,height:p}=i;if(f===0||p===0)return null;const l=i.getContext("2d");try{return l.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function xr(i){if(Er(i))return await Sr(i);if(Or(i)){if(jr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return le(i)||de(i)?Dr(i):await pe(i)}async function Ir(i){try{return await i.decode(),!0}catch{return!1}}async function Mr(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function Fr(i){return i.format===null}function jr(i){return i.data.buffer.byteLength===0}function Rr(i){return i.width===0&&i.height===0}function ve(i,f){return Lr(i)?new DOMException(`${f}: ${i.message}`,i.name):Br(i)?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}function Lr(i){return i instanceof DOMException||Object.prototype.toString.call(i)==="[object DOMException]"}function Br(i){return i instanceof Error||Object.prototype.toString.call(i)==="[object Error]"}class Wr{constructor(f={}){Je(this,ct);var p;try{const l=(p=f==null?void 0:f.formats)==null?void 0:p.filter(C=>C!=="unknown");if((l==null?void 0:l.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const C of l!=null?l:[])if(!Vt.has(C))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${C}' is not a valid enum value of type BarcodeFormat.`);Ke(this,ct,l!=null?l:[]),Ut({fireImmediately:!0}).catch(()=>{})}catch(l){throw ve(l,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Tr.filter(f=>f!=="unknown")}async detect(f){try{const p=await xr(f);if(p===null)return[];let l;const C={tryCode39ExtendedMode:!1,textMode:"Plain",formats:Qe(this,ct).map(A=>Vt.get(A))};try{l=await br(p,C)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return l.map(A=>{const{topLeft:{x:F,y:B},topRight:{x:S,y:j},bottomLeft:{x:q,y:Z},bottomRight:{x:Q,y:lt}}=A.position,ft=Math.min(F,S,q,Q),at=Math.min(B,j,Z,lt),bt=Math.max(F,S,q,Q),Y=Math.max(B,j,Z,lt);return{boundingBox:new DOMRectReadOnly(ft,at,bt-ft,Y-at),rawValue:A.text,format:Pr(A.format),cornerPoints:[{x:F,y:B},{x:S,y:j},{x:Q,y:lt},{x:q,y:Z}]}})}catch(p){throw ve(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ct=new WeakMap,(ye=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=Wr),_.ZXING_CPP_COMMIT=pr,_.ZXING_WASM_SHA256=Cr,_.ZXING_WASM_VERSION=hr,_.prepareZXingModule=Ut,_.purgeZXingModule=wr,_.setZXingModuleOverrides=$r,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});
|
|
1
|
+
var BarcodeDetectionAPI=(function(O){"use strict";var rr=O=>{throw TypeError(O)};var nr=(O,M,F)=>M.has(O)||rr("Cannot "+F);var ar=(O,M,F)=>(nr(O,M,"read from private field"),F?F.call(O):M.get(O)),or=(O,M,F)=>M.has(O)?rr("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(O):M.set(O,F),ir=(O,M,F,vt)=>(nr(O,M,"write to private field"),vt?vt.call(O,F):M.set(O,F),F);var it,de;const M=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],F=M.map(([i])=>i),vt=F.filter((i,f)=>M[f][1]==="L"),sr=F.filter((i,f)=>M[f][1]==="M");function Rt(i){switch(i){case"Linear-Codes":return vt.reduce((f,d)=>f|Rt(d),0);case"Matrix-Codes":return sr.reduce((f,d)=>f|Rt(d),0);case"Any":return(1<<M.length)-1;case"None":return 0;default:return 1<<F.indexOf(i)}}function ur(i){if(i===0)return"None";const f=31-Math.clz32(i);return F[f]}function cr(i){return i.reduce((f,d)=>f|Rt(d),0)}const lr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function fr(i){return lr.indexOf(i)}const te=["Unknown","ASCII","ISO8859_1","ISO8859_2","ISO8859_3","ISO8859_4","ISO8859_5","ISO8859_6","ISO8859_7","ISO8859_8","ISO8859_9","ISO8859_10","ISO8859_11","ISO8859_13","ISO8859_14","ISO8859_15","ISO8859_16","Cp437","Cp1250","Cp1251","Cp1252","Cp1256","Shift_JIS","Big5","GB2312","GB18030","EUC_JP","EUC_KR","UTF16BE","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function hr(i){return i==="UnicodeBig"?te.indexOf("UTF16BE"):te.indexOf(i)}const dr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function pr(i){return dr[i]}const vr=["Ignore","Read","Require"];function yr(i){return vr.indexOf(i)}const mr=["Plain","ECI","HRI","Hex","Escaped"];function gr(i){return mr.indexOf(i)}const yt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function ee(i){return{...i,formats:cr(i.formats),binarizer:fr(i.binarizer),eanAddOnSymbol:yr(i.eanAddOnSymbol),textMode:gr(i.textMode),characterSet:hr(i.characterSet)}}function wr(i){return{...i,format:ur(i.format),contentType:pr(i.contentType),eccLevel:i.ecLevel}}const $r="2.2.3",br="fba4e9503fee4518ca2e89510baeea9bcc36dc8d",Cr={locateFile:(i,f)=>{const d=i.match(/_(.+?)\.wasm$/);return d?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.3/dist/${d[1]}/${i}`:f+i}},mt=new WeakMap;function Tr(i,f){return Object.is(i,f)||Object.keys(i).length===Object.keys(f).length&&Object.keys(i).every(d=>Object.hasOwn(f,d)&&i[d]===f[d])}function re(i,{overrides:f,equalityFn:d=Tr,fireImmediately:T=!1}={}){var l;const[D,A]=(l=mt.get(i))!=null?l:[Cr],R=f!=null?f:D;let S;if(T){if(A&&(S=d(D,R)))return A;const j=i({...R});return mt.set(i,[R,j]),j}(S!=null?S:d(D,R))||mt.set(i,[R])}function Pr(i){mt.delete(i)}async function Er(i,f,d=yt){const T={...yt,...d},l=await re(i,{fireImmediately:!0});let D,A;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:j},width:H,height:Z}=f;A=l._malloc(j),l.HEAPU8.set(S,A),D=l.readBarcodesFromPixmap(A,H,Z,ee(T))}else{let S,j;if("buffer"in f)[S,j]=[f.byteLength,f];else if("byteLength"in f)[S,j]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,j]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");A=l._malloc(S),l.HEAPU8.set(j,A),D=l.readBarcodesFromImage(A,S,ee(T))}l._free(A);const R=[];for(let S=0;S<D.size();++S)R.push(wr(D.get(S)));return R}({...yt,formats:[...yt.formats]});async function jt(i={}){var f,d,T,l=i,D=!!globalThis.window,A=typeof Bun<"u",R=!!globalThis.WorkerGlobalScope;!((d=globalThis.process)===null||d===void 0||(d=d.versions)===null||d===void 0)&&d.node&&((T=globalThis.process)===null||T===void 0?void 0:T.type)!="renderer";var S="./this.program",j,H="";function Z(t){return l.locateFile?l.locateFile(t,H):H+t}var nt,Q;if(D||R||A){try{H=new URL(".",j).href}catch{}R&&(Q=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),nt=async t=>{var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)}}var st=console.log.bind(console),k=console.error.bind(console),J,gt=!1,pe,ve,K,N,wt,ut,ct,E,ye,me,ge=!1;function we(){var t=Dt.buffer;K=new Int8Array(t),wt=new Int16Array(t),l.HEAPU8=N=new Uint8Array(t),ut=new Uint16Array(t),ct=new Int32Array(t),E=new Uint32Array(t),ye=new Float32Array(t),me=new Float64Array(t)}function Xr(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)an(l.preRun.shift());$e(Ce)}function qr(){ge=!0,pt.xa()}function Yr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)nn(l.postRun.shift());$e(be)}function Ut(t){var e,r;(e=l.onAbort)===null||e===void 0||e.call(l,t),t="Aborted("+t+")",k(t),gt=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw(r=ve)===null||r===void 0||r(n),n}var $t;function Zr(){return Z("zxing_reader.wasm")}function Qr(t){if(t==$t&&J)return new Uint8Array(J);if(Q)return Q(t);throw"both async and sync fetching of the wasm failed"}async function Jr(t){if(!J)try{var e=await nt(t);return new Uint8Array(e)}catch{}return Qr(t)}async function Kr(t,e){try{var r=await Jr(t),n=await WebAssembly.instantiate(r,e);return n}catch(a){k(`failed to asynchronously prepare wasm: ${a}`),Ut(a)}}async function tn(t,e,r){if(!t&&WebAssembly.instantiateStreaming)try{var n=fetch(e,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(o){k(`wasm streaming compile failed: ${o}`),k("falling back to ArrayBuffer instantiation")}return Kr(e,r)}function en(){var t={a:Ba};return t}async function rn(){function t(o,s){return pt=o.exports,ja(pt),we(),pt}function e(o){return t(o.instance)}var r=en();if(l.instantiateWasm)return new Promise((o,s)=>{l.instantiateWasm(r,(u,c)=>{o(t(u))})});$t!=null||($t=Zr());var n=await tn(J,$t,r),a=e(n);return a}var $e=t=>{for(;t.length>0;)t.shift()(l)},be=[],nn=t=>be.push(t),Ce=[],an=t=>Ce.push(t),g=t=>Ne(t),w=()=>ze(),bt=[],Ct=0,on=t=>{var e=new Vt(t);return e.get_caught()||(e.set_caught(!0),Ct--),e.set_rethrown(!1),bt.push(e),Xe(t),He(t)},z=0,sn=()=>{m(0,0);var t=bt.pop();Ge(t.excPtr),z=0};class Vt{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){E[this.ptr+4>>2]=e}get_type(){return E[this.ptr+4>>2]}set_destructor(e){E[this.ptr+8>>2]=e}get_destructor(){return E[this.ptr+8>>2]}set_caught(e){e=e?1:0,K[this.ptr+12]=e}get_caught(){return K[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,K[this.ptr+13]=e}get_rethrown(){return K[this.ptr+13]!=0}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){E[this.ptr+16>>2]=e}get_adjusted_ptr(){return E[this.ptr+16>>2]}}var Tt=t=>ke(t),Wt=t=>{var e=z;if(!e)return Tt(0),0;var r=new Vt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return Tt(0),e;for(var a of t){if(a===0||a===n)break;var o=r.ptr+16;if(qe(a,n,o))return Tt(a),e}return Tt(n),e},un=()=>Wt([]),cn=t=>Wt([t]),ln=(t,e)=>Wt([t,e]),fn=()=>{var t=bt.pop();t||Ut("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(bt.push(t),t.set_rethrown(!0),t.set_caught(!1),Ct++),z=e,z},hn=(t,e,r)=>{var n=new Vt(t);throw n.init(e,r),z=t,Ct++,z},dn=()=>Ct,pn=t=>{throw z||(z=t),z},vn=()=>Ut(""),Pt={},Ht=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function lt(t){return this.fromWireType(E[t>>2])}var at={},tt={},Et={},yn=class extends Error{constructor(t){super(t),this.name="InternalError"}},Ot=t=>{throw new yn(t)},et=(t,e,r)=>{t.forEach(u=>Et[u]=e);function n(u){var c=r(u);c.length!==t.length&&Ot("Mismatched type converter count");for(var h=0;h<t.length;++h)V(t[h],c[h])}var a=new Array(e.length),o=[],s=0;for(let[u,c]of e.entries())tt.hasOwnProperty(c)?a[u]=tt[c]:(o.push(c),at.hasOwnProperty(c)||(at[c]=[]),at[c].push(()=>{a[u]=tt[c],++s,s===o.length&&n(a)}));o.length===0&&n(a)},mn=t=>{var e=Pt[t];delete Pt[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));et([t],o,s=>{var u={};for(var[c,h]of a.entries()){const p=s[c],v=h.getter,y=h.getterContext,C=s[c+a.length],I=h.setter,x=h.setterContext;u[h.fieldName]={read:P=>p.fromWireType(v(y,P)),write:(P,_)=>{var Y=[];I(x,P,C.toWireType(Y,_)),Ht(Y)},optional:p.optional}}return[{name:e.name,fromWireType:p=>{var v={};for(var y in u)v[y]=u[y].read(p);return n(p),v},toWireType:(p,v)=>{for(var y in u)if(!(y in v)&&!u[y].optional)throw new TypeError(`Missing field: "${y}"`);var C=r();for(y in u)u[y].write(C,v[y]);return p!==null&&p.push(n,C),C},readValueFromPointer:lt,destructorFunction:n}]})},gn=(t,e,r,n,a)=>{},B=t=>{for(var e="";;){var r=N[t++];if(!r)return e;e+=String.fromCharCode(r)}},ft=class extends Error{constructor(t){super(t),this.name="BindingError"}},b=t=>{throw new ft(t)};function wn(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=e.name;if(t||b(`type "${n}" must have a positive integer typeid pointer`),tt.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;b(`Cannot register type '${n}' twice`)}if(tt[t]=e,delete Et[t],at.hasOwnProperty(t)){var a=at[t];delete at[t],a.forEach(o=>o())}}function V(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return wn(t,e,r)}var $n=(t,e,r,n)=>{e=B(e),V(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},readValueFromPointer:function(a){return this.fromWireType(N[a])},destructorFunction:null})},bn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),kt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}b(e(t)+" instance already deleted")},Nt=!1,Te=t=>{},Cn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},Pe=t=>{t.count.value-=1;var e=t.count.value===0;e&&Cn(t)},ht=t=>globalThis.FinalizationRegistry?(Nt=new FinalizationRegistry(e=>{Pe(e.$$)}),ht=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Nt.register(e,a,e)}return e},Te=e=>Nt.unregister(e),ht(t)):(ht=e=>e,t),Tn=()=>{let t=_t.prototype;Object.assign(t,{isAliasOf(r){if(!(this instanceof _t)||!(r instanceof _t))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var o=r.$$.ptrType.registeredClass,s=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;o.baseClass;)s=o.upcast(s),o=o.baseClass;return n===o&&a===s},clone(){if(this.$$.ptr||kt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=ht(Object.create(Object.getPrototypeOf(this),{$$:{value:bn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),Te(this),Pe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const e=Symbol.dispose;e&&(t[e]=t.delete)};function _t(){}var zt=(t,e)=>Object.defineProperty(e,"name",{value:t}),Ee={},Oe=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return t[e].overloadTable.hasOwnProperty(o.length)||b(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[o.length].apply(this,o)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},_e=(t,e,r)=>{l.hasOwnProperty(t)?((r===void 0||l[t].overloadTable!==void 0&&l[t].overloadTable[r]!==void 0)&&b(`Cannot register public name '${t}' twice`),Oe(l,t,t),l[t].overloadTable.hasOwnProperty(r)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[t].overloadTable[r]=e):(l[t]=e,l[t].argCount=r)},Pn=48,En=57,On=t=>{t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Pn&&e<=En?`_${t}`:t};function _n(t,e,r,n,a,o,s,u){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}var Gt=(t,e,r)=>{for(;e!==r;)e.upcast||b(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t},Xt=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t};function Sn(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${Xt(e)}" as a ${this.name}`),e.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Gt(e.$$.ptr,r,this.registeredClass);return n}function xn(t,e){var r;if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;(!e||!e.$$)&&b(`Cannot pass "${Xt(e)}" as a ${this.name}`),e.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&b(`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=Gt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&b("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:b(`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,W.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:b("Unsupporting sharing policy")}return r}function In(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${Xt(e)}" as a ${this.name}`),e.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&b(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Gt(e.$$.ptr,r,this.registeredClass);return n}var Se=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=Se(t,e,r.baseClass);return n===null?null:r.downcast(n)},Dn={},Mn=(t,e)=>{for(e===void 0&&b("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},An=(t,e)=>(e=Mn(t,e),Dn[e]),St=(t,e)=>{(!e.ptrType||!e.ptr)&&Ot("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&Ot("Both smartPtrType and smartPtr must be specified"),e.count={value:1},ht(Object.create(t,{$$:{value:e,writable:!0}}))};function Fn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=An(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),s=Ee[o];if(!s)return a.call(this);var u;this.isConst?u=s.constPointerType:u=s.pointerType;var c=Se(e,this.registeredClass,u.registeredClass);return c===null?a.call(this):this.isSmartPointer?St(u.registeredClass.instancePrototype,{ptrType:u,ptr:c,smartPtrType:this,smartPtr:t}):St(u.registeredClass.instancePrototype,{ptrType:u,ptr:c})}var Rn=()=>{Object.assign(xt.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){var e;(e=this.rawDestructor)===null||e===void 0||e.call(this,t)},readValueFromPointer:lt,fromWireType:Fn})};function xt(t,e,r,n,a,o,s,u,c,h,p){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=c,this.rawShare=h,this.rawDestructor=p,!a&&e.baseClass===void 0?n?(this.toWireType=Sn,this.destructorFunction=null):(this.toWireType=In,this.destructorFunction=null):this.toWireType=xn}var xe=(t,e,r)=>{l.hasOwnProperty(t)||Ot("Replacing nonexistent public symbol"),l[t].overloadTable!==void 0&&r!==void 0?l[t].overloadTable[r]=e:(l[t]=e,l[t].argCount=r)},X={},jn=(t,e,r)=>{t=t.replace(/p/g,"i");var n=X[t];return n(e,...r)},Ie=[],$=t=>{var e=Ie[t];return e||(Ie[t]=e=Qe.get(t)),e},Bn=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.includes("j"))return jn(t,e,r);var n=$(e),a=n(...r);return a},Ln=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return Bn(t,e,a,r)}},U=function(t,e){t=B(t);function r(){if(t.includes("j"))return Ln(t,e);var a=$(e);return a}var n=r();return typeof n!="function"&&b(`unknown function pointer with signature ${t}: ${e}`),n};class Un extends Error{}var De=t=>{var e=We(t),r=B(e);return q(e),r},It=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!tt[o]){if(Et[o]){Et[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Un(`${t}: `+r.map(De).join([", "]))},Vn=(t,e,r,n,a,o,s,u,c,h,p,v,y)=>{p=B(p),o=U(a,o),u&&(u=U(s,u)),h&&(h=U(c,h)),y=U(v,y);var C=On(p);_e(C,function(){It(`Cannot construct ${p} due to unbound types`,[n])}),et([t,e,r],n?[n]:[],I=>{I=I[0];var x,P;n?(x=I.registeredClass,P=x.instancePrototype):P=_t.prototype;var _=zt(p,function(){if(Object.getPrototypeOf(this)!==Y)throw new ft(`Use 'new' to construct ${p}`);if(L.constructor_body===void 0)throw new ft(`${p} has no accessible constructor`);for(var tr=arguments.length,At=new Array(tr),Ft=0;Ft<tr;Ft++)At[Ft]=arguments[Ft];var er=L.constructor_body[At.length];if(er===void 0)throw new ft(`Tried to invoke ctor of ${p} with invalid number of parameters (${At.length}) - expected (${Object.keys(L.constructor_body).toString()}) parameters instead!`);return er.apply(this,At)}),Y=Object.create(P,{constructor:{value:_}});_.prototype=Y;var L=new _n(p,_,Y,y,x,o,u,h);if(L.baseClass){var G,Mt;(Mt=(G=L.baseClass).__derivedClasses)!==null&&Mt!==void 0||(G.__derivedClasses=[]),L.baseClass.__derivedClasses.push(L)}var bo=new xt(p,L,!0,!1,!1),Je=new xt(p+"*",L,!1,!1,!1),Ke=new xt(p+" const*",L,!1,!0,!1);return Ee[t]={pointerType:Je,constPointerType:Ke},xe(C,_),[bo,Je,Ke]})},qt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(E[e+n*4>>2]);return r};function Wn(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].destructorFunction===void 0)return!0;return!1}function Yt(t,e,r,n,a,o){var s=e.length;s<2&&b("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=e[1]!==null&&r!==null,c=Wn(e),h=!e[0].isVoid,p=s-2,v=new Array(p),y=[],C=[],I=function(){C.length=0;var x;y.length=u?2:1,y[0]=a,u&&(x=e[1].toWireType(C,this),y[1]=x);for(var P=0;P<p;++P)v[P]=e[P+2].toWireType(C,P<0||arguments.length<=P?void 0:arguments[P]),y.push(v[P]);var _=n(...y);function Y(L){if(c)Ht(C);else for(var G=u?1:2;G<e.length;G++){var Mt=G===1?x:v[G-2];e[G].destructorFunction!==null&&e[G].destructorFunction(Mt)}if(h)return e[0].fromWireType(L)}return Y(_)};return zt(t,I)}var Hn=(t,e,r,n,a,o)=>{var s=qt(e,r);a=U(n,a),et([],[t],u=>{u=u[0];var c=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[e-1]!==void 0)throw new ft(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.registeredClass.constructor_body[e-1]=()=>{It(`Cannot construct ${u.name} due to unbound types`,s)},et([],s,h=>(h.splice(1,0,null),u.registeredClass.constructor_body[e-1]=Yt(c,h,null,a,o),[])),[]})},Me=t=>{t=t.trim();const e=t.indexOf("(");return e===-1?t:t.slice(0,e)},kn=(t,e,r,n,a,o,s,u,c,h)=>{var p=qt(r,n);e=B(e),e=Me(e),o=U(a,o),et([],[t],v=>{v=v[0];var y=`${v.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&v.registeredClass.pureVirtualFunctions.push(e);function C(){It(`Cannot call ${y} due to unbound types`,p)}var I=v.registeredClass.instancePrototype,x=I[e];return x===void 0||x.overloadTable===void 0&&x.className!==v.name&&x.argCount===r-2?(C.argCount=r-2,C.className=v.name,I[e]=C):(Oe(I,e,y),I[e].overloadTable[r-2]=C),et([],p,P=>{var _=Yt(y,P,v,o,s);return I[e].overloadTable===void 0?(_.argCount=r-2,I[e]=_):I[e].overloadTable[r-2]=_,[]}),[]})},Ae=[],rt=[0,1,,1,null,1,!0,1,!1,1],Zt=t=>{t>9&&--rt[t+1]===0&&(rt[t]=void 0,Ae.push(t))},W={toValue:t=>(t||b(`Cannot use deleted val. handle = ${t}`),rt[t]),toHandle:t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=Ae.pop()||rt.length;return rt[e]=t,rt[e+1]=1,e}}}},Fe={name:"emscripten::val",fromWireType:t=>{var e=W.toValue(t);return Zt(t),e},toWireType:(t,e)=>W.toHandle(e),readValueFromPointer:lt,destructorFunction:null},Nn=t=>V(t,Fe),zn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(ye[r>>2])};case 8:return function(r){return this.fromWireType(me[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Gn=(t,e,r)=>{e=B(e),V(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,readValueFromPointer:zn(e,r),destructorFunction:null})},Xn=(t,e,r,n,a,o,s,u)=>{var c=qt(e,r);t=B(t),t=Me(t),a=U(n,a),_e(t,function(){It(`Cannot call ${t} due to unbound types`,c)},e-1),et([],c,h=>{var p=[h[0],null].concat(h.slice(1));return xe(t,Yt(t,p,null,a,o),e-1),[]})},qn=(t,e,r)=>{switch(e){case 1:return r?n=>K[n]:n=>N[n];case 2:return r?n=>wt[n>>1]:n=>ut[n>>1];case 4:return r?n=>ct[n>>2]:n=>E[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Yn=(t,e,r,n,a)=>{e=B(e);const o=n===0;let s=c=>c;if(o){var u=32-8*r;s=c=>c<<u>>>u,a=s(a)}V(t,{name:e,fromWireType:s,toWireType:(c,h)=>h,readValueFromPointer:qn(e,r,n!==0),destructorFunction:null})},Zn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(s){var u=E[s>>2],c=E[s+4>>2];return new a(K.buffer,c,u)}r=B(r),V(t,{name:r,fromWireType:o,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Qn=Object.assign({optional:!0},Fe),Jn=(t,e)=>{V(t,Qn)},Kn=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<t.length;++s){var u=t.codePointAt(s);if(u<=127){if(r>=o)break;e[r++]=u}else if(u<=2047){if(r+1>=o)break;e[r++]=192|u>>6,e[r++]=128|u&63}else if(u<=65535){if(r+2>=o)break;e[r++]=224|u>>12,e[r++]=128|u>>6&63,e[r++]=128|u&63}else{if(r+3>=o)break;e[r++]=240|u>>18,e[r++]=128|u>>12&63,e[r++]=128|u>>6&63,e[r++]=128|u&63,s++}}return e[r]=0,r-a},ot=(t,e,r)=>Kn(t,N,e,r),Re=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},je=globalThis.TextDecoder&&new TextDecoder,Be=(t,e,r,n)=>{var a=e+r;if(n)return a;for(;t[e]&&!(e>=a);)++e;return e},Le=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;var a=Be(t,e,r,n);if(a-e>16&&t.buffer&&je)return je.decode(t.subarray(e,a));for(var o="";e<a;){var s=t[e++];if(!(s&128)){o+=String.fromCharCode(s);continue}var u=t[e++]&63;if((s&224)==192){o+=String.fromCharCode((s&31)<<6|u);continue}var c=t[e++]&63;if((s&240)==224?s=(s&15)<<12|u<<6|c:s=(s&7)<<18|u<<12|c<<6|t[e++]&63,s<65536)o+=String.fromCharCode(s);else{var h=s-65536;o+=String.fromCharCode(55296|h>>10,56320|h&1023)}}return o},ta=(t,e,r)=>t?Le(N,t,e,r):"",ea=(t,e)=>{e=B(e),V(t,{name:e,fromWireType(r){var n=E[r>>2],a=r+4,o;return o=ta(a,n,!0),q(r),o},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,o=typeof n=="string";o||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||b("Cannot pass non-string to std::string"),o?a=Re(n):a=n.length;var s=Kt(4+a+1),u=s+4;return E[s>>2]=a,o?ot(n,u,a+1):N.set(n,u),r!==null&&r.push(q,s),s},readValueFromPointer:lt,destructorFunction(r){q(r)}})},Ue=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,ra=(t,e,r)=>{var n=t>>1,a=Be(ut,n,e/2,r);if(a-n>16&&Ue)return Ue.decode(ut.subarray(n,a));for(var o="",s=n;s<a;++s){var u=ut[s];o+=String.fromCharCode(u)}return o},na=(t,e,r)=>{if(r!=null||(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 s=t.charCodeAt(o);wt[e>>1]=s,e+=2}return wt[e>>1]=0,e-n},aa=t=>t.length*2,oa=(t,e,r)=>{for(var n="",a=t>>2,o=0;!(o>=e/4);o++){var s=E[a+o];if(!s&&!r)break;n+=String.fromCodePoint(s)}return n},ia=(t,e,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,o=0;o<t.length;++o){var s=t.codePointAt(o);if(s>65535&&o++,ct[e>>2]=s,e+=4,e+4>a)break}return ct[e>>2]=0,e-n},sa=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.codePointAt(r);n>65535&&r++,e+=4}return e},ua=(t,e,r)=>{r=B(r);var n,a,o;e===2?(n=ra,a=na,o=aa):(n=oa,a=ia,o=sa),V(t,{name:r,fromWireType:s=>{var u=E[s>>2],c=n(s+4,u*e,!0);return q(s),c},toWireType:(s,u)=>{typeof u!="string"&&b(`Cannot pass non-string to C++ string type ${r}`);var c=o(u),h=Kt(4+c+e);return E[h>>2]=c/e,a(u,h+4,c+e),s!==null&&s.push(q,h),h},readValueFromPointer:lt,destructorFunction(s){q(s)}})},ca=(t,e,r,n,a,o)=>{Pt[t]={name:B(e),rawConstructor:U(r,n),rawDestructor:U(a,o),fields:[]}},la=(t,e,r,n,a,o,s,u,c,h)=>{Pt[t].fields.push({fieldName:B(e),getterReturnType:r,getter:U(n,a),getterContext:o,setterArgumentType:s,setter:U(u,c),setterContext:h})},fa=(t,e)=>{e=B(e),V(t,{isVoid:!0,name:e,fromWireType:()=>{},toWireType:(r,n)=>{}})},Qt=[],ha=t=>{var e=Qt.length;return Qt.push(t),e},da=(t,e)=>{var r=tt[t];return r===void 0&&b(`${e} has unknown type ${De(t)}`),r},pa=(t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=da(E[e+n*4>>2],`parameter ${n}`);return r},va=(t,e,r)=>{var n=[],a=t(n,r);return n.length&&(E[e>>2]=W.toHandle(n)),a},ya={},Ve=t=>{var e=ya[t];return e===void 0?B(t):e},ma=(t,e,r)=>{var n=8,[a,...o]=pa(t,e),s=a.toWireType.bind(a),u=o.map(v=>v.readValueFromPointer.bind(v));t--;var c=new Array(t),h=(v,y,C,I)=>{for(var x=0,P=0;P<t;++P)c[P]=u[P](I+x),x+=n;var _;switch(r){case 0:_=W.toValue(v).apply(null,c);break;case 2:_=Reflect.construct(W.toValue(v),c);break;case 3:_=c[0];break;case 1:_=W.toValue(v)[Ve(y)](...c);break}return va(s,C,_)},p=`methodCaller<(${o.map(v=>v.name)}) => ${a.name}>`;return ha(zt(p,h))},ga=t=>t?(t=Ve(t),W.toHandle(globalThis[t])):W.toHandle(globalThis),wa=t=>{t>9&&(rt[t+1]+=1)},$a=(t,e,r,n,a)=>Qt[t](e,r,n,a),ba=t=>{var e=W.toValue(t);Ht(e),Zt(t)},Ca=(t,e,r,n)=>{var a=new Date().getFullYear(),o=new Date(a,0,1),s=new Date(a,6,1),u=o.getTimezoneOffset(),c=s.getTimezoneOffset(),h=Math.max(u,c);E[t>>2]=h*60,ct[e>>2]=+(u!=c);var p=C=>{var I=C>=0?"-":"+",x=Math.abs(C),P=String(Math.floor(x/60)).padStart(2,"0"),_=String(x%60).padStart(2,"0");return`UTC${I}${P}${_}`},v=p(u),y=p(c);c<u?(ot(v,r,17),ot(y,n,17)):(ot(v,n,17),ot(y,r,17))},Ta=()=>2147483648,Pa=(t,e)=>Math.ceil(t/e)*e,Ea=t=>{var e=Dt.buffer.byteLength,r=(t-e+65535)/65536|0;try{return Dt.grow(r),we(),1}catch{}},Oa=t=>{var e=N.length;t>>>=0;var r=Ta();if(t>r)return!1;for(var n=1;n<=4;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var o=Math.min(r,Pa(Math.max(t,a),65536)),s=Ea(o);if(s)return!0}return!1},Jt={},_a=()=>S||"./this.program",dt=()=>{if(!dt.strings){var t=(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:_a()};for(var r in Jt)Jt[r]===void 0?delete e[r]:e[r]=Jt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);dt.strings=n}return dt.strings},Sa=(t,e)=>{var r=0,n=0;for(var a of dt()){var o=e+r;E[t+n>>2]=o,r+=ot(a,o,1/0)+1,n+=4}return 0},xa=(t,e)=>{var r=dt();E[t>>2]=r.length;var n=0;for(var a of r)n+=Re(a)+1;return E[e>>2]=n,0},Ia=t=>52;function Da(t,e,r,n,a){return 70}var Ma=[null,[],[]],Aa=(t,e)=>{var r=Ma[t];e===0||e===10?((t===1?st:k)(Le(r)),r.length=0):r.push(e)},Fa=(t,e,r,n)=>{for(var a=0,o=0;o<r;o++){var s=E[e>>2],u=E[e+4>>2];e+=8;for(var c=0;c<u;c++)Aa(t,N[s+c]);a+=u}return E[n>>2]=a,0},Ra=t=>t;if(Tn(),Rn(),l.noExitRuntime&&l.noExitRuntime,l.print&&(st=l.print),l.printErr&&(k=l.printErr),l.wasmBinary&&(J=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(S=l.thisProgram),l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()();var We,q,Kt,He,m,ke,Ne,ze,Ge,Xe,qe,Ye,Ze,Dt,Qe;function ja(t){We=t.ya,q=l._free=t.za,Kt=l._malloc=t.Ba,He=t.Ca,m=t.Da,ke=t.Ea,Ne=t.Fa,ze=t.Ga,Ge=t.Ha,Xe=t.Ia,qe=t.Ja,X.viijii=t.Ka,Ye=X.iiijj=t.La,X.jiji=t.Ma,Ze=X.jiiii=t.Na,X.iiiiij=t.Oa,X.iiiiijj=t.Pa,X.iiiiiijj=t.Qa,Dt=t.wa,Qe=t.Aa}var Ba={s:on,w:sn,a:un,j:cn,m:ln,Q:fn,p:hn,U:dn,d:pn,ca:vn,ta:mn,ba:gn,oa:$n,ra:Vn,qa:Hn,H:kn,ma:Nn,X:Gn,Y:Xn,x:Yn,t:Zn,sa:Jn,na:ea,R:ua,I:ca,ua:la,pa:fa,N:ma,va:Zt,D:ga,S:wa,M:$a,ia:ba,da:Ca,ga:Oa,ea:Sa,fa:xa,ha:Ia,$:Da,V:Fa,K:io,C:co,Z:Na,T:yo,r:ro,b:Ha,E:oo,ka:fo,c:za,ja:ho,h:ka,i:qa,q:Ja,P:ao,v:to,F:eo,L:no,z:lo,J:mo,aa:go,_:wo,f:Ga,l:La,e:Wa,g:Va,O:vo,k:Ua,la:so,o:Ka,B:Ya,u:uo,W:Qa,A:po,n:Xa,G:Za,y:Ra};function La(t,e){var r=w();try{$(t)(e)}catch(n){if(g(r),n!==n+0)throw n;m(1,0)}}function Ua(t,e,r,n,a){var o=w();try{$(t)(e,r,n,a)}catch(s){if(g(o),s!==s+0)throw s;m(1,0)}}function Va(t,e,r,n){var a=w();try{$(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function Wa(t,e,r){var n=w();try{$(t)(e,r)}catch(a){if(g(n),a!==a+0)throw a;m(1,0)}}function Ha(t,e){var r=w();try{return $(t)(e)}catch(n){if(g(r),n!==n+0)throw n;m(1,0)}}function ka(t,e,r,n){var a=w();try{return $(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function Na(t,e,r,n,a,o){var s=w();try{return $(t)(e,r,n,a,o)}catch(u){if(g(s),u!==u+0)throw u;m(1,0)}}function za(t,e,r){var n=w();try{return $(t)(e,r)}catch(a){if(g(n),a!==a+0)throw a;m(1,0)}}function Ga(t){var e=w();try{$(t)()}catch(r){if(g(e),r!==r+0)throw r;m(1,0)}}function Xa(t,e,r,n,a,o,s,u,c,h,p){var v=w();try{$(t)(e,r,n,a,o,s,u,c,h,p)}catch(y){if(g(v),y!==y+0)throw y;m(1,0)}}function qa(t,e,r,n,a){var o=w();try{return $(t)(e,r,n,a)}catch(s){if(g(o),s!==s+0)throw s;m(1,0)}}function Ya(t,e,r,n,a,o,s){var u=w();try{$(t)(e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function Za(t,e,r,n,a,o,s,u,c,h,p,v,y,C,I,x){var P=w();try{$(t)(e,r,n,a,o,s,u,c,h,p,v,y,C,I,x)}catch(_){if(g(P),_!==_+0)throw _;m(1,0)}}function Qa(t,e,r,n,a,o,s,u,c){var h=w();try{$(t)(e,r,n,a,o,s,u,c)}catch(p){if(g(h),p!==p+0)throw p;m(1,0)}}function Ja(t,e,r,n,a,o){var s=w();try{return $(t)(e,r,n,a,o)}catch(u){if(g(s),u!==u+0)throw u;m(1,0)}}function Ka(t,e,r,n,a,o){var s=w();try{$(t)(e,r,n,a,o)}catch(u){if(g(s),u!==u+0)throw u;m(1,0)}}function to(t,e,r,n,a,o,s){var u=w();try{return $(t)(e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function eo(t,e,r,n,a,o,s,u){var c=w();try{return $(t)(e,r,n,a,o,s,u)}catch(h){if(g(c),h!==h+0)throw h;m(1,0)}}function ro(t){var e=w();try{return $(t)()}catch(r){if(g(e),r!==r+0)throw r;m(1,0)}}function no(t,e,r,n,a,o,s,u,c){var h=w();try{return $(t)(e,r,n,a,o,s,u,c)}catch(p){if(g(h),p!==p+0)throw p;m(1,0)}}function ao(t,e,r,n,a,o,s){var u=w();try{return $(t)(e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function oo(t,e,r,n){var a=w();try{return $(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function io(t,e,r,n){var a=w();try{return $(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function so(t,e,r,n,a,o,s,u){var c=w();try{$(t)(e,r,n,a,o,s,u)}catch(h){if(g(c),h!==h+0)throw h;m(1,0)}}function uo(t,e,r,n,a,o,s,u){var c=w();try{$(t)(e,r,n,a,o,s,u)}catch(h){if(g(c),h!==h+0)throw h;m(1,0)}}function co(t,e,r,n,a,o){var s=w();try{return $(t)(e,r,n,a,o)}catch(u){if(g(s),u!==u+0)throw u;m(1,0)}}function lo(t,e,r,n,a,o,s,u,c,h){var p=w();try{return $(t)(e,r,n,a,o,s,u,c,h)}catch(v){if(g(p),v!==v+0)throw v;m(1,0)}}function fo(t,e,r){var n=w();try{return $(t)(e,r)}catch(a){if(g(n),a!==a+0)throw a;m(1,0)}}function ho(t,e,r,n,a){var o=w();try{return $(t)(e,r,n,a)}catch(s){if(g(o),s!==s+0)throw s;m(1,0)}}function po(t,e,r,n,a,o,s,u,c,h){var p=w();try{$(t)(e,r,n,a,o,s,u,c,h)}catch(v){if(g(p),v!==v+0)throw v;m(1,0)}}function vo(t,e,r,n,a,o,s){var u=w();try{$(t)(e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function yo(t,e,r,n){var a=w();try{return $(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function mo(t,e,r,n,a,o,s,u,c,h,p,v){var y=w();try{return $(t)(e,r,n,a,o,s,u,c,h,p,v)}catch(C){if(g(y),C!==C+0)throw C;m(1,0)}}function go(t,e,r,n,a,o,s){var u=w();try{return Ye(t,e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function wo(t,e,r,n,a){var o=w();try{return Ze(t,e,r,n,a)}catch(s){if(g(o),s!==s+0)throw s;m(1,0)}}function $o(){Xr();function t(){var e,r;l.calledRun=!0,!gt&&(qr(),(e=pe)===null||e===void 0||e(l),(r=l.onRuntimeInitialized)===null||r===void 0||r.call(l),Yr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),t()},1)):t()}var pt;return pt=await rn(),$o(),ge?f=l:f=new Promise((t,e)=>{pe=t,ve=e}),f}function Bt(i){return re(jt,i)}function Or(){return Pr(jt)}function _r(i){Bt({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function Sr(i,f){return Er(jt,i,f)}const xr="85d46f55d7c86a4d09bb04273367408b19c324f582d040d018aecb25a9a82942",ne=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"],["any","Any"]],Ir=[...ne,["unknown"]].map(i=>i[0]),Lt=new Map(ne);function Dr(i){for(const[f,d]of Lt)if(i===d)return f;return"unknown"}function Mr(i){if(ae(i))return{width:i.naturalWidth,height:i.naturalHeight};if(oe(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ie(i))return{width:i.videoWidth,height:i.videoHeight};if(ue(i))return{width:i.width,height:i.height};if(le(i))return{width:i.displayWidth,height:i.displayHeight};if(se(i))return{width:i.width,height:i.height};if(ce(i))return{width:i.width,height:i.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 ae(i){var f,d;try{return i instanceof((d=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:d.HTMLImageElement)}catch{return!1}}function oe(i){var f,d;try{return i instanceof((d=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:d.SVGImageElement)}catch{return!1}}function ie(i){var f,d;try{return i instanceof((d=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:d.HTMLVideoElement)}catch{return!1}}function se(i){var f,d;try{return i instanceof((d=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:d.HTMLCanvasElement)}catch{return!1}}function ue(i){try{return i instanceof ImageBitmap||Object.prototype.toString.call(i)==="[object ImageBitmap]"}catch{return!1}}function ce(i){try{return i instanceof OffscreenCanvas||Object.prototype.toString.call(i)==="[object OffscreenCanvas]"}catch{return!1}}function le(i){try{return i instanceof VideoFrame||Object.prototype.toString.call(i)==="[object VideoFrame]"}catch{return!1}}function Ar(i){try{return i instanceof Blob||Object.prototype.toString.call(i)==="[object Blob]"}catch{return!1}}function Fr(i){try{return i instanceof ImageData||Object.prototype.toString.call(i)==="[object ImageData]"}catch{return!1}}function Rr(i,f){try{const d=new OffscreenCanvas(i,f);if(d.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return d;throw void 0}catch{const d=document.createElement("canvas");return d.width=i,d.height=f,d}}async function fe(i){if(ae(i)&&!await Ur(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(oe(i)&&!await Vr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(le(i)&&Wr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ie(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(ue(i)&&kr(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:d}=Mr(i);if(f===0||d===0)return null;const l=Rr(f,d).getContext("2d");l.drawImage(i,0,0);try{return l.getImageData(0,0,f,d)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function jr(i){let f;try{f=await createImageBitmap(i)}catch{try{if(globalThis.Image){f=new Image;let l="";try{l=URL.createObjectURL(i),f.src=l,await f.decode()}finally{URL.revokeObjectURL(l)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await fe(f)}function Br(i){const{width:f,height:d}=i;if(f===0||d===0)return null;const T=i.getContext("2d");try{return T.getImageData(0,0,f,d)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Lr(i){if(Ar(i))return await jr(i);if(Fr(i)){if(Hr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return se(i)||ce(i)?Br(i):await fe(i)}async function Ur(i){try{return await i.decode(),!0}catch{return!1}}async function Vr(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function Wr(i){return i.format===null}function Hr(i){return i.data.buffer.byteLength===0}function kr(i){return i.width===0&&i.height===0}function he(i,f){return Nr(i)?new DOMException(`${f}: ${i.message}`,i.name):zr(i)?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}function Nr(i){return i instanceof DOMException||Object.prototype.toString.call(i)==="[object DOMException]"}function zr(i){return i instanceof Error||Object.prototype.toString.call(i)==="[object Error]"}class Gr{constructor(f={}){or(this,it);var d;try{const T=(d=f==null?void 0:f.formats)==null?void 0:d.filter(l=>l!=="unknown");if((T==null?void 0:T.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const l of T!=null?T:[])if(!Lt.has(l))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${l}' is not a valid enum value of type BarcodeFormat.`);ir(this,it,T!=null?T:[]),Bt({fireImmediately:!0}).catch(()=>{})}catch(T){throw he(T,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Ir.filter(f=>f!=="unknown")}async detect(f){try{const d=await Lr(f);if(d===null)return[];let T;const l={tryCode39ExtendedMode:!1,textMode:"Plain",formats:ar(this,it).map(D=>Lt.get(D))};try{T=await Sr(d,l)}catch(D){throw console.error(D),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return T.map(D=>{const{topLeft:{x:A,y:R},topRight:{x:S,y:j},bottomLeft:{x:H,y:Z},bottomRight:{x:nt,y:Q}}=D.position,st=Math.min(A,S,H,nt),k=Math.min(R,j,Z,Q),J=Math.max(A,S,H,nt),gt=Math.max(R,j,Z,Q);return{boundingBox:new DOMRectReadOnly(st,k,J-st,gt-k),rawValue:D.text,format:Dr(D.format),cornerPoints:[{x:A,y:R},{x:S,y:j},{x:nt,y:Q},{x:H,y:Z}]}})}catch(d){throw he(d,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return it=new WeakMap,(de=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=Gr),O.ZXING_CPP_COMMIT=br,O.ZXING_WASM_SHA256=xr,O.ZXING_WASM_VERSION=$r,O.prepareZXingModule=Bt,O.purgeZXingModule=Or,O.setZXingModuleOverrides=_r,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),O})({});
|