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