You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 lines
42 KiB

8 months ago
"use strict";var Zr=o=>{throw TypeError(o)};var Jr=(o,d,p)=>d.has(o)||Zr("Cannot "+p);var Kr=(o,d,p)=>(Jr(o,d,"read from private field"),p?p.call(o):d.get(o)),te=(o,d,p)=>d.has(o)?Zr("Cannot add the same private member more than once"):d instanceof WeakSet?d.add(o):d.set(o,p),re=(o,d,p,y)=>(Jr(o,d,"write to private field"),y?y.call(o,p):d.set(o,p),p);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ee=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataBarLimited","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function ro(o){return o.join("|")}function eo(o){const d=ne(o);let p=0,y=ee.length-1;for(;p<=y;){const c=Math.floor((p+y)/2),P=ee[c],S=ne(P);if(S===d)return P;S<d?p=c+1:y=c-1}return"None"}function ne(o){return o.toLowerCase().replace(/_-\[\]/g,"")}function no(o,d){return o.Binarizer[d]}function ao(o,d){return o.CharacterSet[d]}const oo=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function io(o){return oo[o.value]}function so(o,d){return o.EanAddOnSymbol[d]}function uo(o,d){return o.TextMode[d]}const st={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!1,validateCode39CheckSum:!1,validateITFCheckSum:!1,returnCodabarStartEnd:!1,returnErrors:!1,eanAddOnSymbol:"Read",textMode:"Plain",characterSet:"Unknown"};function oe(o,d){return{...d,formats:ro(d.formats),binarizer:no(o,d.binarizer),eanAddOnSymbol:so(o,d.eanAddOnSymbol),textMode:uo(o,d.textMode),characterSet:ao(o,d.characterSet)}}function ie(o){return{...o,format:eo(o.format),eccLevel:o.eccLevel,contentType:io(o.contentType)}}const co={locateFile:(o,d)=>{const p=o.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.3.4/dist/${p[1]}/${o}`:d+o}};let ar=new WeakMap;function ir(o,d){var p;const y=ar.get(o);if(y!=null&&y.modulePromise&&d===void 0)return y.modulePromise;const c=(p=y==null?void 0:y.moduleOverrides)!=null?p:co,P=o({...c});return ar.set(o,{moduleOverrides:c,modulePromise:P}),P}function lo(o,d){ar.set(o,{moduleOverrides:d})}async function fo(o,d,p=st){const y={...st,...p},c=await ir(o),{size:P}=d,S=new Uint8Array(await d.arrayBuffer()),B=c._malloc(P);c.HEAPU8.set(S,B);const V=c.readBarcodesFromImage(B,P,oe(c,y));c._free(B);const R=[];for(let W=0;W<V.size();++W)R.push(ie(V.get(W)));return R}async function ho(o,d,p=st){const y={...st,...p},c=await ir(o),{data:P,width:S,height:B,data:{byteLength:V}}=d,R=c._malloc(V);c.HEAPU8.set(P,R);const W=c.readBarcodesFromPixmap(R,S,B,oe(c,y));c._free(R);const N=[];for(let H=0;H<W.size();++H)N.push(ie(W.get(H)));return N}({...st,formats:[...st.formats]});var Bt=(()=>{var o,d=typeof document<"u"&&((o=document.currentScript)==null?void 0:o.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(p={}){var y,c=p,P,S,B=new Promise((t,r)=>{P=t,S=r}),V=typeof window=="object",R=typeof Bun<"u",W=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var N=Object.assign({},c),H="./this.program",I="";function ut(t){return c.locateFile?c.locateFile(t,I):I+t}var ct,et;if(V||W||R){var lt;W?I=self.location.href:typeof document<"u"&&((lt=document.currentScript)===null||lt===void 0?void 0:lt.tagName.toUpperCase())==="SCRIPT"&&(I=document.currentScript.src),d&&(I=d),I.startsWith("blob:")?I="":I=I.substr(0,I.replace(/[?#].*/,"").lastIndexOf("/")+1),W&&(et=t=>{var r=new XMLHttpRequest;return r.open("GET",t,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ct=t=>fetch(t,{credentials:"same-origin"}).then(r=>r.ok?r.arrayBuffer():Promise.reject(new Error(r.status+" : "+r.url)))}var kt=c.print||console.log.bind(console),nt=c.printErr||console.error.bind(console);Object.assign(c,N),N=null,c.arguments&&c.arguments,c.thisProgram&&(H=c.thisProgram);var
`+a.replace(/^Error(:[^\n]*)?\n/,""))});return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},e},Ar,Or=t=>{var r=Wr(t),e=j(r);return Y(r),e},Ft=(t,r)=>{var e=[],n={};function a(i){if(!n[i]&&!K[i]){if(_t[i]){_t[i].forEach(a);return}e.push(i),n[i]=!0}}throw r.forEach(a),new Ar(`${t}: `+e.map(Or).join([", "]))},hn=(t,r,e,n,a,i,u,s,l,f,h,v,g)=>{h=j(h),i=U(a,i),s&&(s=U(u,s)),f&&(f=U(l,f)),g=U(v,g);var T=en(h);Xt(T,function(){Ft(`Cannot construct ${h} due to unbound types`,[n])}),tt([t,r,e],n?[n]:[],_=>{_=_[0];var x,O;n?(x=_.registeredClass,O=x.instancePrototype):O=St.prototype;var D=vt(h,function(){if(Object.getPrototypeOf(this)!==rt)throw new it("Use 'new' to construct "+h);if(M.constructor_body===void 0)throw new it(h+" has no accessible constructor");for(var Yr=arguments.length,It=new Array(Yr),Rt=0;Rt<Yr;Rt++)It[Rt]=arguments[Rt];var qr=M.constructor_body[It.length];if(qr===void 0)throw new it(`Tried to invoke ctor of ${h} with invalid number of parameters (${It.length}) - expected (${Object.keys(M.constructor_body).toString()}) parameters instead!`);return qr.apply(this,It)}),rt=Object.create(O,{constructor:{value:D}});D.prototype=rt;var M=new nn(h,D,rt,g,x,i,s,f);if(M.baseClass){var q,Wt;(Wt=(q=M.baseClass).__derivedClasses)!==null&&Wt!==void 0||(q.__derivedClasses=[]),M.baseClass.__derivedClasses.push(M)}var to=new xt(h,M,!0,!1,!1),Xr=new xt(h+"*",M,!1,!1,!1),Qr=new xt(h+" const*",M,!1,!0,!1);return Cr[t]={pointerType:Xr,constPointerType:Qr},Er(T,D),[to,Xr,Qr]})},Yt=(t,r)=>{for(var e=[],n=0;n<t;n++)e.push(E[r+n*4>>2]);return e};function pn(t){for(var r=1;r<t.length;++r)if(t[r]!==null&&t[r].destructorFunction===void 0)return!0;return!1}function qt(t,r,e,n,a,i){var u=r.length;u<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=r[1]!==null&&e!==null,l=pn(r),f=r[0].name!=="void",h=u-2,v=new Array(h),g=[],T=[],_=function(){T.length=0;var x;g.length=s?2:1,g[0]=a,s&&(x=r[1].toWireType(T,this),g[1]=x);for(var O=0;O<h;++O)v[O]=r[O+2].toWireType(T,O<0||arguments.length<=O?void 0:arguments[O]),g.push(v[O]);var D=n(...g);function rt(M){if(l)zt(T);else for(var q=s?1:2;q<r.length;q++){var Wt=q===1?x:v[q-2];r[q].destructorFunction!==null&&r[q].destructorFunction(Wt)}if(f)return r[0].fromWireType(M)}return rt(D)};return vt(t,_)}var vn=(t,r,e,n,a,i)=>{var u=Yt(r,e);a=U(n,a),tt([],[t],s=>{s=s[0];var l=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[r-1]!==void 0)throw new it(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[r-1]=()=>{Ft(`Cannot construct ${s.name} due to unbound types`,u)},tt([],u,f=>(f.splice(1,0,null),s.registeredClass.constructor_body[r-1]=qt(l,f,null,a,i),[])),[]})},Dr=t=>{t=t.trim();const r=t.indexOf("(");return r!==-1?t.substr(0,r):t},yn=(t,r,e,n,a,i,u,s,l,f)=>{var h=Yt(e,n);r=j(r),r=Dr(r),i=U(a,i),tt([],[t],v=>{v=v[0];var g=`${v.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&v.registeredClass.pureVirtualFunctions.push(r);function T(){Ft(`Cannot call ${g} due to unbound types`,h)}var _=v.registeredClass.instancePrototype,x=_[r];return x===void 0||x.overloadTable===void 0&&x.className!==v.name&&x.argCount===e-2?(T.argCount=e-2,T.className=v.name,_[r]=T):(Pr(_,r,g),_[r].overloadTable[e-2]=T),tt([],h,O=>{var D=qt(g,O,v,i,u);return _[r].overloadTable===void 0?(D.argCount=e-2,_[r]=D):_[r].overloadTable[e-2]=D,[]}),[]})},Zt=[],X=[],Jt=t=>{t>9&&--X[t+1]===0&&(X[t]=void 0,Zt.push(t))},mn=()=>X.length/2-5-Zt.length,gn=()=>{X.push(0,1,void 0,1,null,1,!0,1,!1,1),c.count_emval_handles=mn},Q={toValue:t=>(t||C("Cannot use deleted val. handle = "+t),X[t]),toHandle:t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{co