ckgl/node_modules/zxing-wasm/dist/cjs/writer/index.js
2024-12-21 18:03:43 +08:00

3 lines
22 KiB
JavaScript

"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../core-D9FNMpWh.cjs");var yr=(()=>{var U=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(J={}){var u=J,mr,Q;u.ready=new Promise((r,e)=>{mr=r,Q=e});var br=Object.assign({},u),wr=typeof window=="object",Y=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var R="";function Yr(r){return u.locateFile?u.locateFile(r,R):R+r}var sr;(wr||Y)&&(Y?R=self.location.href:typeof document<"u"&&document.currentScript&&(R=document.currentScript.src),U&&(R=U),R.indexOf("blob:")!==0?R=R.substr(0,R.replace(/[?#].*/,"").lastIndexOf("/")+1):R="",Y&&(sr=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),u.print||console.log.bind(console);var Z=u.printErr||console.error.bind(console);Object.assign(u,br),br=null,u.arguments&&u.arguments,u.thisProgram&&u.thisProgram,u.quit&&u.quit;var L;u.wasmBinary&&(L=u.wasmBinary),typeof WebAssembly!="object"&&ur("no native wasm support detected");var rr,Tr=!1,M,y,H,N,O,h,$r,Ar;function Er(){var r=rr.buffer;u.HEAP8=M=new Int8Array(r),u.HEAP16=H=new Int16Array(r),u.HEAPU8=y=new Uint8Array(r),u.HEAPU16=N=new Uint16Array(r),u.HEAP32=O=new Int32Array(r),u.HEAPU32=h=new Uint32Array(r),u.HEAPF32=$r=new Float32Array(r),u.HEAPF64=Ar=new Float64Array(r)}var Cr=[],Rr=[],Fr=[];function re(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)ne(u.preRun.shift());fr(Cr)}function ee(){fr(Rr)}function te(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)ie(u.postRun.shift());fr(Fr)}function ne(r){Cr.unshift(r)}function ae(r){Rr.unshift(r)}function ie(r){Fr.unshift(r)}var j=0,q=null;function oe(r){var e;j++,(e=u.monitorRunDependencies)===null||e===void 0||e.call(u,j)}function se(r){var e;if(j--,(e=u.monitorRunDependencies)===null||e===void 0||e.call(u,j),j==0&&q){var t=q;q=null,t()}}function ur(r){var e;(e=u.onAbort)===null||e===void 0||e.call(u,r),r="Aborted("+r+")",Z(r),Tr=!0,r+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(r);throw Q(t),t}var ue="data:application/octet-stream;base64,",Pr=r=>r.startsWith(ue),V;V="zxing_writer.wasm",Pr(V)||(V=Yr(V));function Wr(r){if(r==V&&L)return new Uint8Array(L);if(sr)return sr(r);throw"both async and sync fetching of the wasm failed"}function fe(r){return!L&&(wr||Y)&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+r+"'";return e.arrayBuffer()}).catch(()=>Wr(r)):Promise.resolve().then(()=>Wr(r))}function kr(r,e,t){return fe(r).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(t,n=>{Z(`failed to asynchronously prepare wasm: ${n}`),ur(n)})}function ce(r,e,t,n){return!r&&typeof WebAssembly.instantiateStreaming=="function"&&!Pr(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var i=WebAssembly.instantiateStreaming(a,t);return i.then(n,function(o){return Z(`wasm streaming compile failed: ${o}`),Z("falling back to ArrayBuffer instantiation"),kr(e,t,n)})}):kr(e,t,n)}function le(){var r={a:Ft};function e(n,a){return g=n.exports,rr=g.R,Er(),Br=g.V,ae(g.S),se(),g}oe();function t(n){e(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(r,e)}catch(n){Z(`Module.instantiateWasm callback failed with error: ${n}`),Q(n)}return ce(L,V,r,t).catch(Q),{}}var fr=r=>{for(;r.length>0;)r.shift()(u)};u.noExitRuntime;var Sr=[],ve=r=>{var e=new cr(r);return e.get_caught()||e.set_caught(!0),e.set_rethrown(!1),Sr.push(e),Kr(e.excPtr),e.get_exception_ptr()},I=0,de=()=>{T(0,0);var r=Sr.pop();Gr(r.excPtr),I=0};function cr(r){this.excPtr=r,this.ptr=r-24,this.set_type=function(e){h[this.ptr+4>>2]=e},this.get_type=function(){return h[this.ptr+4>>2]},this.set_destructor=function(e){h[this.ptr+8>>2]=e},this.get_destructor=function(){return h[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,M[this.ptr+12>>0]=e},this.get_caught=function(){return M[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,M[this.ptr+13>>0]=e},this.get_rethrown=function(){return M[this.ptr+13>>0]!=0},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){h[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return h[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=Jr(this.get_type());if(e)return h[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var he=r=>{throw I||(I=r),I},lr=r=>{var e=I;if(!e)return K(0),0;var t=new cr(e);t.set_adjusted_ptr(e);var n=t.get_type();if(!n)return K(0),e;for(var a in r){var i=r[a];if(i===0||i===n)break;var o=t.ptr+16;if(zr(i,n,o))return K(i),e}return K(n),e},_e=()=>lr([]),pe=r=>lr([r]),ge=(r,e)=>lr([r,e]),ye=(r,e,t)=>{var n=new cr(r);throw n.init(e,t),I=r,I},er={},vr=r=>{for(;r.length;){var e=r.pop(),t=r.pop();t(e)}};function dr(r){return this.fromWireType(O[r>>2])}var B={},D={},tr={},Ur,Mr=r=>{throw new Ur(r)},Or=(r,e,t)=>{r.forEach(function(s){tr[s]=e});function n(s){var f=t(s);f.length!==r.length&&Mr("Mismatched type converter count");for(var c=0;c<r.length;++c)F(r[c],f[c])}var a=new Array(e.length),i=[],o=0;e.forEach((s,f)=>{D.hasOwnProperty(s)?a[f]=D[s]:(i.push(s),B.hasOwnProperty(s)||(B[s]=[]),B[s].push(()=>{a[f]=D[s],++o,o===i.length&&n(a)}))}),i.length===0&&n(a)},me=r=>{var e=er[r];delete er[r];var t=e.rawConstructor,n=e.rawDestructor,a=e.fields,i=a.map(o=>o.getterReturnType).concat(a.map(o=>o.setterArgumentType));Or([r],i,o=>{var s={};return a.forEach((f,c)=>{var l=f.fieldName,v=o[c],_=f.getter,d=f.getterContext,k=o[c+a.length],C=f.setter,m=f.setterContext;s[l]={read:z=>v.fromWireType(_(d,z)),write:(z,gr)=>{var or=[];C(m,z,k.toWireType(or,gr)),vr(or)}}}),[{name:e.name,fromWireType:f=>{var c={};for(var l in s)c[l]=s[l].read(f);return n(f),c},toWireType:(f,c)=>{for(var l in s)if(!(l in c))throw new TypeError(`Missing field: "${l}"`);var v=t();for(l in s)s[l].write(v,c[l]);return f!==null&&f.push(n,v),v},argPackAdvance:P,readValueFromPointer:dr,destructorFunction:n}]})},be=(r,e,t,n,a)=>{},we=()=>{for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);jr=r},jr,p=r=>{for(var e="",t=r;y[t];)e+=jr[y[t++]];return e},Ir,b=r=>{throw new Ir(r)};function Te(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=e.name;if(r||b(`type "${n}" must have a positive integer typeid pointer`),D.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;b(`Cannot register type '${n}' twice`)}if(D[r]=e,delete tr[r],B.hasOwnProperty(r)){var a=B[r];delete B[r],a.forEach(i=>i())}}function F(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Te(r,e,t)}var P=8,$e=(r,e,t,n)=>{e=p(e),F(r,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,i){return i?t:n},argPackAdvance:P,readValueFromPointer:function(a){return this.fromWireType(y[a])},destructorFunction:null})};function Ae(){Object.assign(Dr.prototype,{get(r){return this.allocated[r]},has(r){return this.allocated[r]!==void 0},allocate(r){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=r,e},free(r){this.allocated[r]=void 0,this.freelist.push(r)}})}function Dr(){this.allocated=[void 0],this.freelist=[]}var $=new Dr,hr=r=>{r>=$.reserved&&--$.get(r).refcount===0&&$.free(r)},Ee=()=>{for(var r=0,e=$.reserved;e<$.allocated.length;++e)$.allocated[e]!==void 0&&++r;return r},Ce=()=>{$.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),$.reserved=$.allocated.length,u.count_emval_handles=Ee},x={toValue:r=>(r||b("Cannot use deleted val. handle = "+r),$.get(r).value),toHandle:r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return $.allocate({refcount:1,value:r})}}},Re=(r,e)=>{e=p(e),F(r,{name:e,fromWireType:t=>{var n=x.toValue(t);return hr(t),n},toWireType:(t,n)=>x.toHandle(n),argPackAdvance:P,readValueFromPointer:dr,destructorFunction:null})},Fe=(r,e,t)=>{if(r[e].overloadTable===void 0){var n=r[e];r[e]=function(){return r[e].overloadTable.hasOwnProperty(arguments.length)||b(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[arguments.length].apply(this,arguments)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},xr=(r,e,t)=>{u.hasOwnProperty(r)?((t===void 0||u[r].overloadTable!==void 0&&u[r].overloadTable[t]!==void 0)&&b(`Cannot register public name '${r}' twice`),Fe(u,r,r),u.hasOwnProperty(t)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),u[r].overloadTable[t]=e):(u[r]=e,t!==void 0&&(u[r].numArguments=t))},Pe=(r,e,t)=>{switch(e){case 1:return t?function(n){return this.fromWireType(M[n>>0])}:function(n){return this.fromWireType(y[n>>0])};case 2:return t?function(n){return this.fromWireType(H[n>>1])}:function(n){return this.fromWireType(N[n>>1])};case 4:return t?function(n){return this.fromWireType(O[n>>2])}:function(n){return this.fromWireType(h[n>>2])};default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},We=(r,e,t,n)=>{e=p(e);function a(){}a.values={},F(r,{name:e,constructor:a,fromWireType:function(i){return this.constructor.values[i]},toWireType:(i,o)=>o.value,argPackAdvance:P,readValueFromPointer:Pe(e,t,n),destructorFunction:null}),xr(e,a)},nr=(r,e)=>Object.defineProperty(e,"name",{value:r}),Hr=r=>{var e=qr(r),t=p(e);return W(e),t},Vr=(r,e)=>{var t=D[r];return t===void 0&&b(e+" has unknown type "+Hr(r)),t},ke=(r,e,t)=>{var n=Vr(r,"enum");e=p(e);var a=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:nr(`${n.name}_${e}`,function(){})}});a.values[t]=i,a[e]=i},Se=(r,e)=>{switch(e){case 4:return function(t){return this.fromWireType($r[t>>2])};case 8:return function(t){return this.fromWireType(Ar[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},Ue=(r,e,t)=>{e=p(e),F(r,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:P,readValueFromPointer:Se(e,t),destructorFunction:null})};function Me(r){for(var e=1;e<r.length;++e)if(r[e]!==null&&r[e].destructorFunction===void 0)return!0;return!1}function Oe(r,e,t,n,a,i){var o=e.length;o<2&&b("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=e[1]!==null&&t!==null,f=Me(e),c=e[0].name!=="void",l=o-2,v=new Array(l),_=[],d=[],k=function(){arguments.length!==l&&b(`function ${r} called with ${arguments.length} arguments, expected ${l}`),d.length=0;var C;_.length=s?2:1,_[0]=a,s&&(C=e[1].toWireType(d,this),_[1]=C);for(var m=0;m<l;++m)v[m]=e[m+2].toWireType(d,arguments[m]),_.push(v[m]);var z=n.apply(null,_);function gr(or){if(f)vr(d);else for(var X=s?1:2;X<e.length;X++){var Ht=X===1?C:v[X-2];e[X].destructorFunction!==null&&e[X].destructorFunction(Ht)}if(c)return e[0].fromWireType(or)}return gr(z)};return nr(r,k)}var je=(r,e)=>{for(var t=[],n=0;n<r;n++)t.push(h[e+n*4>>2]);return t},Ie=(r,e,t)=>{u.hasOwnProperty(r)||Mr("Replacing nonexistant public symbol"),u[r].overloadTable!==void 0&&t!==void 0?u[r].overloadTable[t]=e:(u[r]=e,u[r].argCount=t)},De=(r,e,t)=>{var n=u["dynCall_"+r];return t&&t.length?n.apply(null,[e].concat(t)):n.call(null,e)},ar=[],Br,w=r=>{var e=ar[r];return e||(r>=ar.length&&(ar.length=r+1),ar[r]=e=Br.get(r)),e},xe=(r,e,t)=>{if(r.includes("j"))return De(r,e,t);var n=w(e).apply(null,t);return n},He=(r,e)=>{var t=[];return function(){return t.length=0,Object.assign(t,arguments),xe(r,e,t)}},G=(r,e)=>{r=p(r);function t(){return r.includes("j")?He(r,e):w(e)}var n=t();return typeof n!="function"&&b(`unknown function pointer with signature ${r}: ${e}`),n},Ve=(r,e)=>{var t=nr(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
`+a.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(r.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},Xr,Be=(r,e)=>{var t=[],n={};function a(i){if(!n[i]&&!D[i]){if(tr[i]){tr[i].forEach(a);return}t.push(i),n[i]=!0}}throw e.forEach(a),new Xr(`${r}: `+t.map(Hr).join([", "]))},Xe=r=>{r=r.trim();const e=r.indexOf("(");return e!==-1?r.substr(0,e):r},Ze=(r,e,t,n,a,i,o)=>{var s=je(e,t);r=p(r),r=Xe(r),a=G(n,a),xr(r,function(){Be(`Cannot call ${r} due to unbound types`,s)},e-1),Or([],s,function(f){var c=[f[0],null].concat(f.slice(1));return Ie(r,Oe(r,c,null,a,i),e-1),[]})},Le=(r,e,t)=>{switch(e){case 1:return t?n=>M[n>>0]:n=>y[n>>0];case 2:return t?n=>H[n>>1]:n=>N[n>>1];case 4:return t?n=>O[n>>2]:n=>h[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},Ne=(r,e,t,n,a)=>{e=p(e);var i=l=>l;if(n===0){var o=32-8*t;i=l=>l<<o>>>o}var s=e.includes("unsigned"),f=(l,v)=>{},c;s?c=function(l,v){return f(v,this.name),v>>>0}:c=function(l,v){return f(v,this.name),v},F(r,{name:e,fromWireType:i,toWireType:c,argPackAdvance:P,readValueFromPointer:Le(e,t,n!==0),destructorFunction:null})},qe=(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function i(o){var s=h[o>>2],f=h[o+4>>2];return new a(M.buffer,f,s)}t=p(t),F(r,{name:t,fromWireType:i,argPackAdvance:P,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})};function Ge(r){return this.fromWireType(h[r>>2])}var Ke=(r,e,t,n)=>{if(!(n>0))return 0;for(var a=t,i=t+n-1,o=0;o<r.length;++o){var s=r.charCodeAt(o);if(s>=55296&&s<=57343){var f=r.charCodeAt(++o);s=65536+((s&1023)<<10)|f&1023}if(s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|s&63}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|s&63}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|s&63}}return e[t]=0,t-a},ze=(r,e,t)=>Ke(r,y,e,t),Je=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},Zr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Qe=(r,e,t)=>{for(var n=e+t,a=e;r[a]&&!(a>=n);)++a;if(a-e>16&&r.buffer&&Zr)return Zr.decode(r.subarray(e,a));for(var i="";e<a;){var o=r[e++];if(!(o&128)){i+=String.fromCharCode(o);continue}var s=r[e++]&63;if((o&224)==192){i+=String.fromCharCode((o&31)<<6|s);continue}var f=r[e++]&63;if((o&240)==224?o=(o&15)<<12|s<<6|f:o=(o&7)<<18|s<<12|f<<6|r[e++]&63,o<65536)i+=String.fromCharCode(o);else{var c=o-65536;i+=String.fromCharCode(55296|c>>10,56320|c&1023)}}return i},Ye=(r,e)=>r?Qe(y,r,e):"",rt=(r,e)=>{e=p(e);var t=e==="std::string";F(r,{name:e,fromWireType(n){var a=h[n>>2],i=n+4,o;if(t)for(var s=i,f=0;f<=a;++f){var c=i+f;if(f==a||y[c]==0){var l=c-s,v=Ye(s,l);o===void 0?o=v:(o+="\0",o+=v),s=c+1}}else{for(var _=new Array(a),f=0;f<a;++f)_[f]=String.fromCharCode(y[i+f]);o=_.join("")}return W(n),o},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var i,o=typeof a=="string";o||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||b("Cannot pass non-string to std::string"),t&&o?i=Je(a):i=a.length;var s=pr(4+i+1),f=s+4;if(h[s>>2]=i,t&&o)ze(a,f,i+1);else if(o)for(var c=0;c<i;++c){var l=a.charCodeAt(c);l>255&&(W(f),b("String has UTF-16 code units that do not fit in 8 bits")),y[f+c]=l}else for(var c=0;c<i;++c)y[f+c]=a[c];return n!==null&&n.push(W,s),s},argPackAdvance:P,readValueFromPointer:Ge,destructorFunction(n){W(n)}})},Lr=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,et=(r,e)=>{for(var t=r,n=t>>1,a=n+e/2;!(n>=a)&&N[n];)++n;if(t=n<<1,t-r>32&&Lr)return Lr.decode(y.subarray(r,t));for(var i="",o=0;!(o>=e/2);++o){var s=H[r+o*2>>1];if(s==0)break;i+=String.fromCharCode(s)}return i},tt=(r,e,t)=>{var n;if((n=t)!==null&&n!==void 0||(t=2147483647),t<2)return 0;t-=2;for(var a=e,i=t<r.length*2?t/2:r.length,o=0;o<i;++o){var s=r.charCodeAt(o);H[e>>1]=s,e+=2}return H[e>>1]=0,e-a},nt=r=>r.length*2,at=(r,e)=>{for(var t=0,n="";!(t>=e/4);){var a=O[r+t*4>>2];if(a==0)break;if(++t,a>=65536){var i=a-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(a)}return n},it=(r,e,t)=>{var n;if((n=t)!==null&&n!==void 0||(t=2147483647),t<4)return 0;for(var a=e,i=a+t-4,o=0;o<r.length;++o){var s=r.charCodeAt(o);if(s>=55296&&s<=57343){var f=r.charCodeAt(++o);s=65536+((s&1023)<<10)|f&1023}if(O[e>>2]=s,e+=4,e+4>i)break}return O[e>>2]=0,e-a},ot=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&++t,e+=4}return e},st=(r,e,t)=>{t=p(t);var n,a,i,o,s;e===2?(n=et,a=tt,o=nt,i=()=>N,s=1):e===4&&(n=at,a=it,o=ot,i=()=>h,s=2),F(r,{name:t,fromWireType:f=>{for(var c=h[f>>2],l=i(),v,_=f+4,d=0;d<=c;++d){var k=f+4+d*e;if(d==c||l[k>>s]==0){var C=k-_,m=n(_,C);v===void 0?v=m:(v+="\0",v+=m),_=k+e}}return W(f),v},toWireType:(f,c)=>{typeof c!="string"&&b(`Cannot pass non-string to C++ string type ${t}`);var l=o(c),v=pr(4+l+e);return h[v>>2]=l>>s,a(c,v+4,l+e),f!==null&&f.push(W,v),v},argPackAdvance:P,readValueFromPointer:dr,destructorFunction(f){W(f)}})},ut=(r,e,t,n,a,i)=>{er[r]={name:p(e),rawConstructor:G(t,n),rawDestructor:G(a,i),fields:[]}},ft=(r,e,t,n,a,i,o,s,f,c)=>{er[r].fields.push({fieldName:p(e),getterReturnType:t,getter:G(n,a),getterContext:i,setterArgumentType:o,setter:G(s,f),setterContext:c})},ct=(r,e)=>{e=p(e),F(r,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},_r=[],lt=(r,e,t,n)=>(r=_r[r],e=x.toValue(e),r(null,e,t,n)),vt={},dt=r=>{var e=vt[r];return e===void 0?p(r):e},Nr=()=>{if(typeof globalThis=="object")return globalThis;function r(e){e.$$$embind_global$$$=e;var t=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return t||delete e.$$$embind_global$$$,t}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&r(global)?$$$embind_global$$$=global:typeof self=="object"&&r(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},ht=r=>r===0?x.toHandle(Nr()):(r=dt(r),x.toHandle(Nr()[r])),_t=r=>{var e=_r.length;return _r.push(r),e},pt=(r,e)=>{for(var t=new Array(r),n=0;n<r;++n)t[n]=Vr(h[e+n*4>>2],"parameter "+n);return t},gt=Reflect.construct,yt=(r,e,t)=>{var n=[],a=r.toWireType(n,t);return n.length&&(h[e>>2]=x.toHandle(n)),a},mt=(r,e,t)=>{var n=pt(r,e),a=n.shift();r--;var i=new Array(r),o=(f,c,l,v)=>{for(var _=0,d=0;d<r;++d)i[d]=n[d].readValueFromPointer(v+_),_+=n[d].argPackAdvance;for(var k=t===1?gt(c,i):c.apply(f,i),d=0;d<r;++d){var C,m;(C=(m=n[d]).deleteObject)===null||C===void 0||C.call(m,i[d])}return yt(a,l,k)},s=`methodCaller<(${n.map(f=>f.name).join(", ")}) => ${a.name}>`;return _t(nr(s,o))},bt=r=>{r>4&&($.get(r).refcount+=1)},wt=r=>{var e=x.toValue(r);vr(e),hr(r)},Tt=()=>{ur("")},$t=(r,e,t)=>y.copyWithin(r,e,e+t),At=()=>2147483648,Et=r=>{var e=rr.buffer,t=(r-e.byteLength+65535)/65536;try{return rr.grow(t),Er(),1}catch{}},Ct=r=>{var e=y.length;r>>>=0;var t=At();if(r>t)return!1;for(var n=(f,c)=>f+(c-f%c)%c,a=1;a<=4;a*=2){var i=e*(1+.2/a);i=Math.min(i,r+100663296);var o=Math.min(t,n(Math.max(r,i),65536)),s=Et(o);if(s)return!0}return!1},Rt=r=>r;Ur=u.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},we(),Ir=u.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Ae(),Ce(),Xr=u.UnboundTypeError=Ve(Error,"UnboundTypeError");var Ft={r:ve,q:de,g:_e,d:pe,k:ge,a:ye,i:he,M:me,C:be,H:$e,G:Re,K:We,b:ke,v:Ue,L:Ze,h:Ne,e:qe,u:rt,p:st,w:ut,N:ft,I:ct,z:lt,P:hr,B:ht,A:mt,x:bt,Q:wt,s:Tt,F:$t,E:Ct,y:Mt,c:Pt,l:Ot,n:Ut,o:jt,f:Wt,t:xt,m:Dt,D:St,J:kt,j:It,O:Rt},g=le(),pr=u._malloc=r=>(pr=u._malloc=g.T)(r),W=u._free=r=>(W=u._free=g.U)(r),qr=r=>(qr=g.W)(r),T=(r,e)=>(T=g.X)(r,e),K=r=>(K=g.Y)(r),A=()=>(A=g.Z)(),E=r=>(E=g._)(r),Gr=r=>(Gr=g.$)(r),Kr=r=>(Kr=g.aa)(r),zr=(r,e,t)=>(zr=g.ba)(r,e,t),Jr=r=>(Jr=g.ca)(r);function Pt(r,e){var t=A();try{return w(r)(e)}catch(n){if(E(t),n!==n+0)throw n;T(1,0)}}function Wt(r,e){var t=A();try{w(r)(e)}catch(n){if(E(t),n!==n+0)throw n;T(1,0)}}function kt(r,e,t,n,a,i){var o=A();try{w(r)(e,t,n,a,i)}catch(s){if(E(o),s!==s+0)throw s;T(1,0)}}function St(r,e,t,n,a){var i=A();try{w(r)(e,t,n,a)}catch(o){if(E(i),o!==o+0)throw o;T(1,0)}}function Ut(r,e,t,n){var a=A();try{return w(r)(e,t,n)}catch(i){if(E(a),i!==i+0)throw i;T(1,0)}}function Mt(r,e,t,n,a){var i=A();try{return w(r)(e,t,n,a)}catch(o){if(E(i),o!==o+0)throw o;T(1,0)}}function Ot(r,e,t){var n=A();try{return w(r)(e,t)}catch(a){if(E(n),a!==a+0)throw a;T(1,0)}}function jt(r){var e=A();try{w(r)()}catch(t){if(E(e),t!==t+0)throw t;T(1,0)}}function It(r,e,t,n,a,i,o,s,f,c,l){var v=A();try{w(r)(e,t,n,a,i,o,s,f,c,l)}catch(_){if(E(v),_!==_+0)throw _;T(1,0)}}function Dt(r,e,t,n){var a=A();try{w(r)(e,t,n)}catch(i){if(E(a),i!==i+0)throw i;T(1,0)}}function xt(r,e,t){var n=A();try{w(r)(e,t)}catch(a){if(E(n),a!==a+0)throw a;T(1,0)}}var ir;q=function r(){ir||Qr(),ir||(q=r)};function Qr(){if(j>0||(re(),j>0))return;function r(){ir||(ir=!0,u.calledRun=!0,!Tr&&(ee(),mr(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),te()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),r()},1)):r()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return Qr(),J.ready}})();function Vt(U){return S.getZXingModuleWithFactory(yr,U)}function Bt(U){return S.setZXingModuleOverridesWithFactory(yr,U)}async function Xt(U,J){return S.writeBarcodeToImageFileWithFactory(yr,U,J)}exports.barcodeFormats=S.barcodeFormats;exports.characterSets=S.characterSets;exports.defaultEncodeHints=S.defaultWriterOptions;exports.defaultWriterOptions=S.defaultWriterOptions;exports.purgeZXingModule=S.purgeZXingModule;exports.writeInputEccLevels=S.writeInputEccLevels;exports.getZXingModule=Vt;exports.setZXingModuleOverrides=Bt;exports.writeBarcodeToImageFile=Xt;