barcode-detector 2.0.4 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # barcode-detector
2
2
 
3
- [![npm](https://img.shields.io/npm/v/barcode-detector)](https://www.npmjs.com/package/barcode-detector/v/latest) [![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/%40sec-ant/barcode-detector)](https://www.npmjs.com/package/barcode-detector/v/latest) [![jsDelivr hits (npm scoped)](https://img.shields.io/jsdelivr/npm/hm/barcode-detector?color=%23ff5627)](https://cdn.jsdelivr.net/npm/barcode-detector@latest/)
3
+ [![npm](https://img.shields.io/npm/v/barcode-detector)](https://www.npmjs.com/package/barcode-detector/v/latest) [![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/barcode-detector)](https://www.npmjs.com/package/barcode-detector/v/latest) [![jsDelivr hits (npm scoped)](https://img.shields.io/jsdelivr/npm/hm/barcode-detector?color=%23ff5627)](https://cdn.jsdelivr.net/npm/barcode-detector@latest/)
4
4
 
5
- A [Barcode Detection API](https://wicg.github.io/shape-detection-api/#barcode-detection-api) polyfill that uses [ZXing webassembly](https://github.com/Sec-ant/zxing-wasm) under the hood.
5
+ A [Barcode Detection API](https://wicg.github.io/shape-detection-api/#barcode-detection-api) polyfill that uses [ZXing-C++ WebAssembly](https://github.com/Sec-ant/zxing-wasm) under the hood.
6
6
 
7
- > This package was originally published as [`@sec-ant/barcode-detector`](https://www.npmjs.com/package/@sec-ant/barcode-detector) on the npm registry. With appreciation for the generous offer from [@gruhn](https://github.com/gruhn), the package is now released under the name `barcode-detector` starting from version 2.0.0. The original name `@sec-ant/barcode-detector` will continue to be used for versions prior to 2.0.0, and will be retained solely for maintenance purposes. Eventually, it will be deprecated at an appropriate juncture.
7
+ > This package was originally published as [`@sec-ant/barcode-detector`](https://www.npmjs.com/package/@sec-ant/barcode-detector) on the npm registry. With appreciation for the generous offer from [@gruhn](https://github.com/gruhn), the package is now released under the name `barcode-detector` starting from version 2.0.0. The original package under the name `@sec-ant/barcode-detector` is deprecated.
8
8
 
9
9
  ## Install
10
10
 
@@ -162,10 +162,10 @@ This package can also be consumed as a commonjs package:
162
162
 
163
163
  In addition to `BarcodeDetector`, this package exports another function called `setZXingModuleOverrides`.
164
164
 
165
- This package employs [Sec-ant/zxing-wasm](https://github.com/Sec-ant/zxing-wasm) to enable the core barcode reading functionality. As a result, a `.wasm` binary file is fetched at runtime. The default fetch path for this binary file is:
165
+ This package employs [zxing-wasm](https://github.com/Sec-ant/zxing-wasm) to enable the core barcode reading functionality. As a result, a `.wasm` binary file is fetched at runtime. The default fetch path for this binary file is:
166
166
 
167
167
  ```
168
- https://fastly.jsdelivr.net/npm/@sec-ant/zxing-wasm@<version>/dist/reader/zxing_reader.wasm
168
+ https://fastly.jsdelivr.net/npm/zxing-wasm@<version>/dist/reader/zxing_reader.wasm
169
169
  ```
170
170
 
171
171
  The `setZXingModuleOverrides` function allows you to govern where the `.wasm` binary is served from, thereby enabling offline use of the package, use within a local network, or within a site having strict [CSP](https://developer.mozilla.org/docs/Web/HTTP/CSP) rules.
@@ -174,7 +174,7 @@ For instance, should you want to inline this `.wasm` file in your build output f
174
174
 
175
175
  ```ts
176
176
  // src/index.ts
177
- import wasmFile from "../node_modules/@sec-ant/zxing-wasm/dist/reader/zxing_reader.wasm?url";
177
+ import wasmFile from "../node_modules/zxing-wasm/dist/reader/zxing_reader.wasm?url";
178
178
 
179
179
  import {
180
180
  setZXingModuleOverrides,
@@ -261,5 +261,3 @@ barcodeDetector.detect(imageFile).then(console.log);
261
261
  The source code in this repository, as well as the build output, except for the parts listed below, is licensed under the [MIT license](./LICENSE).
262
262
 
263
263
  Test samples and resources are collected from [zxing-cpp/zxing-cpp](https://github.com/zxing-cpp/zxing-cpp), which is licensed under the [Apache-2.0 license](https://raw.githubusercontent.com/zxing-cpp/zxing-cpp/master/LICENSE), and [web-platform-tests/wpt](https://github.com/web-platform-tests/wpt), which is licensed under the [3-Clause BSD license](https://raw.githubusercontent.com/web-platform-tests/wpt/master/LICENSE.md).
264
-
265
- This package has an indirect dependency on [Sec-ant/zxing-wasm-build](https://github.com/Sec-ant/zxing-wasm-build), which is licensed under the [Apache-2.0 license](https://raw.githubusercontent.com/Sec-ant/zxing-wasm-build/main/LICENSE).
@@ -1,5 +1,5 @@
1
1
  /// <reference types="dom-webcodecs" />
2
- import { ZXingModule } from "@sec-ant/zxing-wasm/reader";
2
+ import { type ZXingModule } from "zxing-wasm/reader";
3
3
  import { BARCODE_DETECTOR_FORMATS } from "./utils.js";
4
4
  export type BarcodeFormat = (typeof BARCODE_DETECTOR_FORMATS)[number];
5
5
  export interface BarcodeDetectorOptions {
@@ -32,4 +32,4 @@ export declare class BarcodeDetector extends EventTarget {
32
32
  static getSupportedFormats(): Promise<readonly BarcodeFormat[]>;
33
33
  detect(image: ImageBitmapSourceWebCodecs): Promise<DetectedBarcode[]>;
34
34
  }
35
- export { setZXingModuleOverrides } from "@sec-ant/zxing-wasm";
35
+ export { setZXingModuleOverrides } from "zxing-wasm/reader";
package/dist/cjs/pure.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";var Ye=(c,p,i)=>{if(!p.has(c))throw TypeError("Cannot "+i)};var Jt=(c,p,i)=>(Ye(c,p,"read from private field"),i?i.call(c):p.get(c)),Ne=(c,p,i)=>{if(p.has(c))throw TypeError("Cannot add the same private member more than once");p instanceof WeakSet?p.add(c):p.set(c,i)},Ge=(c,p,i,v)=>(Ye(c,p,"write to private field"),v?v.call(c,i):p.set(c,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Xe=["aztec","code_128","code_39","code_93","codabar","data_matrix","ean_13","ean_8","itf","pdf417","qr_code","upc_a","upc_e","unknown"];function ja(c){if(Ke(c))return{width:c.naturalWidth,height:c.naturalHeight};if(tr(c))return{width:c.width.baseVal.value,height:c.height.baseVal.value};if(er(c))return{width:c.videoWidth,height:c.videoHeight};if(nr(c))return{width:c.width,height:c.height};if(or(c))return{width:c.displayWidth,height:c.displayHeight};if(rr(c))return{width:c.width,height:c.height};if(ar(c))return{width:c.width,height:c.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function Ke(c){try{return c instanceof HTMLImageElement}catch{return!1}}function tr(c){try{return c instanceof SVGImageElement}catch{return!1}}function er(c){try{return c instanceof HTMLVideoElement}catch{return!1}}function rr(c){try{return c instanceof HTMLCanvasElement}catch{return!1}}function nr(c){try{return c instanceof ImageBitmap}catch{return!1}}function ar(c){try{return c instanceof OffscreenCanvas}catch{return!1}}function or(c){try{return c instanceof VideoFrame}catch{return!1}}function ir(c){try{return c instanceof Blob}catch{return!1}}function Ia(c){try{return c instanceof ImageData}catch{return!1}}function Ra(c,p){try{const i=new OffscreenCanvas(c,p);if(i.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return i;throw void 0}catch{const i=document.createElement("canvas");return i.width=c,i.height=p,i}}async function sr(c){if(Ke(c)&&!await Ba(c))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(tr(c)&&!await Ua(c))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(or(c)&&Va(c))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(er(c)&&(c.readyState===0||c.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(nr(c)&&za(c))throw new DOMException("The image source is detached.","InvalidStateError");const{width:p,height:i}=ja(c);if(p===0||i===0)return null;const $=Ra(p,i).getContext("2d");$.drawImage(c,0,0);try{return $.getImageData(0,0,p,i)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Ha(c){let p;try{if(createImageBitmap)p=await createImageBitmap(c);else if(Image){p=new Image;let v="";try{v=URL.createObjectURL(c),p.src=v,await p.decode()}finally{URL.revokeObjectURL(v)}}else return c}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await sr(p)}function Wa(c){const{width:p,height:i}=c;if(p===0||i===0)return null;const v=c.getContext("2d");try{return v.getImageData(0,0,p,i)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function ka(c){if(ir(c))return await Ha(c);if(Ia(c)){if(La(c))throw new DOMException("The image data has been detached.","InvalidStateError");return c}return rr(c)||ar(c)?Wa(c):await sr(c)}async function Ba(c){try{return await c.decode(),!0}catch{return!1}}async function Ua(c){var p;try{return await((p=c.decode)==null?void 0:p.call(c)),!0}catch{return!1}}function Va(c){return c.format===null}function La(c){return c.data.buffer.byteLength===0}function za(c){return c.width===0&&c.height===0}function qe(c,p){return c instanceof DOMException?new DOMException(`${p}: ${c.message}`,c.name):c instanceof Error?new c.constructor(`${p}: ${c.message}`):new Error(`${p}: ${c}`)}const Je=c=>{let p;const i=new Set,v=(O,Y)=>{const j=typeof O=="function"?O(p):O;if(!Object.is(j,p)){const F=p;p=Y??typeof j!="object"?j:Object.assign({},p,j),i.forEach(V=>V(p,F))}},$=()=>p,w={setState:v,getState:$,subscribe:O=>(i.add(O),()=>i.delete(O)),destroy:()=>{i.clear()}};return p=c(v,$,w),w},Ya=c=>c?Je(c):Je,Na={locateFile:(c,p)=>{var i;const v=(i=c.match(/_(.+?)\.wasm$/))==null?void 0:i[1];return v?`https://fastly.jsdelivr.net/npm/@sec-ant/zxing-wasm@2.1.6/dist/${v}/${c}`:p+c}},st=Ya()(()=>({zxingModuleWeakMap:new WeakMap,zxingModuleOverrides:Na}));function Ga(c){st.setState({zxingModuleOverrides:c})}function Zt(c,p=st.getState().zxingModuleOverrides){const{zxingModuleWeakMap:i}=st.getState(),v=i.get(c);if(v&&Object.is(p,st.getState().zxingModuleOverrides))return v;{st.setState({zxingModuleOverrides:p});const $=c(p);return i.set(c,$),$}}const Qe=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","UPC-A","UPC-E"],B={tryHarder:!0,formats:[],maxSymbols:255};async function Xa(c,{tryHarder:p=B.tryHarder,formats:i=B.formats,maxSymbols:v=B.maxSymbols}=B,$){const w=await Zt($,st.getState().zxingModuleOverrides),{size:O}=c,Y=new Uint8Array(await c.arrayBuffer()),j=w._malloc(O);w.HEAPU8.set(Y,j);const F=w.readBarcodesFromImage(j,O,p,ur(i),v);w._free(j);const V=[];for(let L=0;L<F.size();++L){const U=F.get(L);V.push({...U,format:cr(U.format)})}return V}async function qa(c,{tryHarder:p=B.tryHarder,formats:i=B.formats,maxSymbols:v=B.maxSymbols}=B,$){const w=await Zt($,st.getState().zxingModuleOverrides),{data:O,width:Y,height:j,data:{byteLength:F}}=c,V=w._malloc(F);w.HEAPU8.set(O,V);const L=w.readBarcodesFromPixmap(V,Y,j,p,ur(i),v);w._free(V);const U=[];for(let N=0;N<L.size();++N){const J=L.get(N);U.push({...J,format:cr(J.format)})}return U}function ur(c){return c.join("|")}function cr(c){const p=Ze(c);let i=0,v=Qe.length-1;for(;i<=v;){const $=Math.floor((i+v)/2),w=Qe[$],O=Ze(w);if(O===p)return w;O<p?i=$+1:v=$-1}return"None"}function Ze(c){return c.toLowerCase().replace(/_-\[\]/g,"")}var Kt=(()=>{var c=typeof document>"u"?require("url").pathToFileURL(__filename).href:document.currentScript&&document.currentScript.src||new URL("pure.js",document.baseURI).href;return function(p={}){var i=p,v,$;i.ready=new Promise((t,e)=>{v=t,$=e});var w=Object.assign({},i),O="./this.program",Y=typeof window=="object",j=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var F="";function V(t){return i.locateFile?i.locateFile(t,F):F+t}var L;(Y||j)&&(j?F=self.location.href:typeof document<"u"&&document.currentScript&&(F=document.currentScript.src),c&&(F=c),F.indexOf("blob:")!==0?F=F.substr(0,F.replace(/[?#].*/,"").lastIndexOf("/")+1):F="",j&&(L=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),i.print||console.log.bind(console);var U=i.printErr||console.error.bind(console);Object.assign(i,w),w=null,i.arguments&&i.arguments,i.thisProgram&&(O=i.thisProgram),i.quit&&i.quit;var N;i.wasmBinary&&(N=i.wasmBinary),typeof WebAssembly!="object"&&pt("no native wasm support detected");var J,ft=!1;function Rt(t,e){t||pt(e)}var G,z,dt,bt,W,A,te,ee;function re(){var t=J.buffer;i.HEAP8=G=new Int8Array(t),i.HEAP16=dt=new Int16Array(t),i.HEAPU8=z=new Uint8Array(t),i.HEAPU16=bt=new Uint16Array(t),i.HEAP32=W=new Int32Array(t),i.HEAPU32=A=new Uint32Array(t),i.HEAPF32=te=new Float32Array(t),i.HEAPF64=ee=new Float64Array(t)}var ne=[],ae=[],oe=[];function lr(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)hr(i.preRun.shift());Ht(ne)}function fr(){Ht(ae)}function dr(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)mr(i.postRun.shift());Ht(oe)}function hr(t){ne.unshift(t)}function pr(t){ae.unshift(t)}function mr(t){oe.unshift(t)}var rt=0,ht=null;function yr(t){rt++,i.monitorRunDependencies&&i.monitorRunDependencies(rt)}function vr(t){if(rt--,i.monitorRunDependencies&&i.monitorRunDependencies(rt),rt==0&&ht){var e=ht;ht=null,e()}}function pt(t){i.onAbort&&i.onAbort(t),t="Aborted("+t+")",U(t),ft=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw $(e),e}var gr="data:application/octet-stream;base64,",ie=t=>t.startsWith(gr),nt;i.locateFile?(nt="zxing_reader.wasm",ie(nt)||(nt=V(nt))):nt=new URL("/reader/zxing_reader.wasm",self.location).href;function se(t){if(t==nt&&N)return new Uint8Array(N);if(L)return L(t);throw"both async and sync fetching of the wasm failed"}function wr(t){return!N&&(Y||j)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>se(t)):Promise.resolve().then(()=>se(t))}function ue(t,e,r){return wr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{U(`failed to asynchronously prepare wasm: ${n}`),pt(n)})}function $r(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!ie(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(s){return U(`wasm streaming compile failed: ${s}`),U("falling back to ArrayBuffer instantiation"),ue(e,r,n)})}):ue(e,r,n)}function br(){var t={a:ta};function e(n,a){return D=n.exports,J=D.ra,re(),Ce=D.va,pr(D.sa),vr(),D}yr();function r(n){e(n.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(n){U(`Module.instantiateWasm callback failed with error: ${n}`),$(n)}return $r(N,nt,t,r).catch($),{}}var Ht=t=>{for(;t.length>0;)t.shift()(i)};i.noExitRuntime;var Ct=[],_t=0,Cr=t=>{var e=new Tt(t);return e.get_caught()||(e.set_caught(!0),_t--),e.set_rethrown(!1),Ct.push(e),ke(e.excPtr),e.get_exception_ptr()},Q=0,_r=()=>{b(0,0);var t=Ct.pop();We(t.excPtr),Q=0};function Tt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){A[this.ptr+4>>2]=e},this.get_type=function(){return A[this.ptr+4>>2]},this.set_destructor=function(e){A[this.ptr+8>>2]=e},this.get_destructor=function(){return A[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,G[this.ptr+12>>0]=e},this.get_caught=function(){return G[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,G[this.ptr+13>>0]=e},this.get_rethrown=function(){return G[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){A[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return A[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=Ue(this.get_type());if(e)return A[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var Tr=t=>{throw Q||(Q=t),Q},Wt=t=>{var e=Q;if(!e)return $t(0),0;var r=new Tt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return $t(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var s=r.ptr+16;if(Be(o,n,s))return $t(o),e}return $t(n),e},Pr=()=>Wt([]),Er=t=>Wt([t]),xr=(t,e)=>Wt([t,e]),Sr=t=>{var e=new Tt(t).get_exception_ptr();return e},Ar=()=>{var t=Ct.pop();t||pt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Ct.push(t),t.set_rethrown(!0),t.set_caught(!1),_t++),Q=e,Q},Dr=(t,e,r)=>{var n=new Tt(t);throw n.init(e,r),Q=t,_t++,Q},Or=()=>_t,Pt={},ce=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function kt(t){return this.fromWireType(W[t>>2])}var ut={},at={},Et={},le,xt=t=>{throw new le(t)},ot=(t,e,r)=>{t.forEach(function(u){Et[u]=e});function n(u){var l=r(u);l.length!==t.length&&xt("Mismatched type converter count");for(var f=0;f<t.length;++f)Z(t[f],l[f])}var a=new Array(e.length),o=[],s=0;e.forEach((u,l)=>{at.hasOwnProperty(u)?a[l]=at[u]:(o.push(u),ut.hasOwnProperty(u)||(ut[u]=[]),ut[u].push(()=>{a[l]=at[u],++s,s===o.length&&n(a)}))}),o.length===0&&n(a)},Fr=t=>{var e=Pt[t];delete Pt[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));ot([t],o,s=>{var u={};return a.forEach((l,f)=>{var h=l.fieldName,y=s[f],g=l.getter,P=l.getterContext,x=s[f+a.length],R=l.setter,S=l.setterContext;u[h]={read:H=>y.fromWireType(g(P,H)),write:(H,d)=>{var m=[];R(S,H,x.toWireType(m,d)),ce(m)}}}),[{name:e.name,fromWireType:l=>{var f={};for(var h in u)f[h]=u[h].read(l);return n(l),f},toWireType:(l,f)=>{for(var h in u)if(!(h in f))throw new TypeError(`Missing field: "${h}"`);var y=r();for(h in u)u[h].write(y,f[h]);return l!==null&&l.push(n,y),y},argPackAdvance:K,readValueFromPointer:kt,destructorFunction:n}]})},Mr=(t,e,r,n,a)=>{},jr=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);fe=t},fe,k=t=>{for(var e="",r=t;z[r];)e+=fe[z[r++]];return e},ct,E=t=>{throw new ct(t)};function Ir(t,e,r={}){var n=e.name;if(t||E(`type "${n}" must have a positive integer typeid pointer`),at.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;E(`Cannot register type '${n}' twice`)}if(at[t]=e,delete Et[t],ut.hasOwnProperty(t)){var a=ut[t];delete ut[t],a.forEach(o=>o())}}function Z(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Ir(t,e,r)}var K=8,Rr=(t,e,r,n)=>{e=k(e),Z(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:K,readValueFromPointer:function(a){return this.fromWireType(z[a])},destructorFunction:null})},Hr=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Bt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}E(e(t)+" instance already deleted")},Ut=!1,de=t=>{},Wr=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&&Wr(t)},pe=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=pe(t,e,r.baseClass);return n===null?null:r.downcast(n)},me={},kr=()=>Object.keys(vt).length,Br=()=>{var t=[];for(var e in vt)vt.hasOwnProperty(e)&&t.push(vt[e]);return t},mt=[],Vt=()=>{for(;mt.length;){var t=mt.pop();t.$$.deleteScheduled=!1,t.delete()}},yt,Ur=t=>{yt=t,mt.length&&yt&&yt(Vt)},Vr=()=>{i.getInheritedInstanceCount=kr,i.getLiveInheritedInstances=Br,i.flushPendingDeletes=Vt,i.setDelayFunction=Ur},vt={},Lr=(t,e)=>{for(e===void 0&&E("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},zr=(t,e)=>(e=Lr(t,e),vt[e]),St=(t,e)=>{(!e.ptrType||!e.ptr)&&xt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&xt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},gt(Object.create(t,{$$:{value:e}}))};function Yr(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=zr(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?St(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):St(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),s=me[o];if(!s)return a.call(this);var u;this.isConst?u=s.constPointerType:u=s.pointerType;var l=pe(e,this.registeredClass,u.registeredClass);return l===null?a.call(this):this.isSmartPointer?St(u.registeredClass.instancePrototype,{ptrType:u,ptr:l,smartPtrType:this,smartPtr:t}):St(u.registeredClass.instancePrototype,{ptrType:u,ptr:l})}var gt=t=>typeof FinalizationRegistry>"u"?(gt=e=>e,t):(Ut=new FinalizationRegistry(e=>{he(e.$$)}),gt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Ut.register(e,a,e)}return e},de=e=>Ut.unregister(e),gt(t)),Nr=()=>{Object.assign(At.prototype,{isAliasOf(t){if(!(this instanceof At)||!(t instanceof At))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||Bt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=gt(Object.create(Object.getPrototypeOf(this),{$$:{value:Hr(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Bt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&E("Object already scheduled for deletion"),de(this),he(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Bt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&E("Object already scheduled for deletion"),mt.push(this),mt.length===1&&yt&&yt(Vt),this.$$.deleteScheduled=!0,this}})};function At(){}var Gr=48,Xr=57,ye=t=>{if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Gr&&e<=Xr?`_${t}`:t};function ve(t,e){return t=ye(t),{[t]:function(){return e.apply(this,arguments)}}[t]}var ge=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||E(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},we=(t,e,r)=>{i.hasOwnProperty(t)?((r===void 0||i[t].overloadTable!==void 0&&i[t].overloadTable[r]!==void 0)&&E(`Cannot register public name '${t}' twice`),ge(i,t,t),i.hasOwnProperty(r)&&E(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),i[t].overloadTable[r]=e):(i[t]=e,r!==void 0&&(i[t].numArguments=r))};function qr(t,e,r,n,a,o,s,u){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}var Lt=(t,e,r)=>{for(;e!==r;)e.upcast||E(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function Jr(t,e){if(e===null)return this.isReference&&E(`null is not a valid ${this.name}`),0;e.$$||E(`Cannot pass "${Nt(e)}" as a ${this.name}`),e.$$.ptr||E(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Lt(e.$$.ptr,r,this.registeredClass);return n}function Qr(t,e){var r;if(e===null)return this.isReference&&E(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;e.$$||E(`Cannot pass "${Nt(e)}" as a ${this.name}`),e.$$.ptr||E(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&E(`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=Lt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&E("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:E(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var a=e.clone();r=this.rawShare(r,et.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:E("Unsupporting sharing policy")}return r}function Zr(t,e){if(e===null)return this.isReference&&E(`null is not a valid ${this.name}`),0;e.$$||E(`Cannot pass "${Nt(e)}" as a ${this.name}`),e.$$.ptr||E(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&E(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Lt(e.$$.ptr,r,this.registeredClass);return n}function $e(t){return this.fromWireType(A[t>>2])}var Kr=()=>{Object.assign(Dt.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){this.rawDestructor&&this.rawDestructor(t)},argPackAdvance:K,readValueFromPointer:$e,deleteObject(t){t!==null&&t.delete()},fromWireType:Yr})};function Dt(t,e,r,n,a,o,s,u,l,f,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=l,this.rawShare=f,this.rawDestructor=h,!a&&e.baseClass===void 0?n?(this.toWireType=Jr,this.destructorFunction=null):(this.toWireType=Zr,this.destructorFunction=null):this.toWireType=Qr}var be=(t,e,r)=>{i.hasOwnProperty(t)||xt("Replacing nonexistant public symbol"),i[t].overloadTable!==void 0&&r!==void 0?i[t].overloadTable[r]=e:(i[t]=e,i[t].argCount=r)},tn=(t,e,r)=>{var n=i["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},Ot=[],Ce,T=t=>{var e=Ot[t];return e||(t>=Ot.length&&(Ot.length=t+1),Ot[t]=e=Ce.get(t)),e},en=(t,e,r)=>{if(t.includes("j"))return tn(t,e,r);var n=T(e).apply(null,r);return n},rn=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),en(t,e,r)}},q=(t,e)=>{t=k(t);function r(){return t.includes("j")?rn(t,e):T(e)}var n=r();return typeof n!="function"&&E(`unknown function pointer with signature ${t}: ${e}`),n},nn=(t,e)=>{var r=ve(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},_e,Te=t=>{var e=He(t),r=k(e);return tt(e),r},Ft=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!at[o]){if(Et[o]){Et[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new _e(`${t}: `+r.map(Te).join([", "]))},an=(t,e,r,n,a,o,s,u,l,f,h,y,g)=>{h=k(h),o=q(a,o),u&&(u=q(s,u)),f&&(f=q(l,f)),g=q(y,g);var P=ye(h);we(P,function(){Ft(`Cannot construct ${h} due to unbound types`,[n])}),ot([t,e,r],n?[n]:[],function(x){x=x[0];var R,S;n?(R=x.registeredClass,S=R.instancePrototype):S=At.prototype;var H=ve(P,function(){if(Object.getPrototypeOf(this)!==d)throw new ct("Use 'new' to construct "+h);if(m.constructor_body===void 0)throw new ct(h+" has no accessible constructor");var It=m.constructor_body[arguments.length];if(It===void 0)throw new ct(`Tried to invoke ctor of ${h} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(m.constructor_body).toString()}) parameters instead!`);return It.apply(this,arguments)}),d=Object.create(S,{constructor:{value:H}});H.prototype=d;var m=new qr(h,H,d,g,R,o,u,f);m.baseClass&&(m.baseClass.__derivedClasses===void 0&&(m.baseClass.__derivedClasses=[]),m.baseClass.__derivedClasses.push(m));var M=new Dt(h,m,!0,!1,!1),I=new Dt(h+"*",m,!1,!1,!1),it=new Dt(h+" const*",m,!1,!0,!1);return me[t]={pointerType:I,constPointerType:it},be(P,H),[M,I,it]})},zt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(A[e+n*4>>2]);return r};function Yt(t,e,r,n,a,o){var s=e.length;s<2&&E("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var u=e[1]!==null&&r!==null,l=!1,f=1;f<e.length;++f)if(e[f]!==null&&e[f].destructorFunction===void 0){l=!0;break}var h=e[0].name!=="void",y=s-2,g=new Array(y),P=[],x=[];return function(){arguments.length!==y&&E(`function ${t} called with ${arguments.length} arguments, expected ${y}`),x.length=0;var R;P.length=u?2:1,P[0]=a,u&&(R=e[1].toWireType(x,this),P[1]=R);for(var S=0;S<y;++S)g[S]=e[S+2].toWireType(x,arguments[S]),P.push(g[S]);var H=n.apply(null,P);function d(m){if(l)ce(x);else for(var M=u?1:2;M<e.length;M++){var I=M===1?R:g[M-2];e[M].destructorFunction!==null&&e[M].destructorFunction(I)}if(h)return e[0].fromWireType(m)}return d(H)}}var on=(t,e,r,n,a,o)=>{var s=zt(e,r);a=q(n,a),ot([],[t],function(u){u=u[0];var l=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[e-1]!==void 0)throw new ct(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.registeredClass.constructor_body[e-1]=()=>{Ft(`Cannot construct ${u.name} due to unbound types`,s)},ot([],s,f=>(f.splice(1,0,null),u.registeredClass.constructor_body[e-1]=Yt(l,f,null,a,o),[])),[]})},Pe=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?(Rt(t[t.length-1]==")","Parentheses for argument names should match."),t.substr(0,e)):t},sn=(t,e,r,n,a,o,s,u,l)=>{var f=zt(r,n);e=k(e),e=Pe(e),o=q(a,o),ot([],[t],function(h){h=h[0];var y=`${h.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&h.registeredClass.pureVirtualFunctions.push(e);function g(){Ft(`Cannot call ${y} due to unbound types`,f)}var P=h.registeredClass.instancePrototype,x=P[e];return x===void 0||x.overloadTable===void 0&&x.className!==h.name&&x.argCount===r-2?(g.argCount=r-2,g.className=h.name,P[e]=g):(ge(P,e,y),P[e].overloadTable[r-2]=g),ot([],f,function(R){var S=Yt(y,R,h,o,s);return P[e].overloadTable===void 0?(S.argCount=r-2,P[e]=S):P[e].overloadTable[r-2]=S,[]}),[]})};function un(){Object.assign(Ee.prototype,{get(t){return this.allocated[t]},has(t){return this.allocated[t]!==void 0},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}})}function Ee(){this.allocated=[void 0],this.freelist=[]}var X=new Ee,xe=t=>{t>=X.reserved&&--X.get(t).refcount===0&&X.free(t)},cn=()=>{for(var t=0,e=X.reserved;e<X.allocated.length;++e)X.allocated[e]!==void 0&&++t;return t},ln=()=>{X.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),X.reserved=X.allocated.length,i.count_emval_handles=cn},et={toValue:t=>(t||E("Cannot use deleted val. handle = "+t),X.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return X.allocate({refcount:1,value:t})}}},fn=(t,e)=>{e=k(e),Z(t,{name:e,fromWireType:r=>{var n=et.toValue(r);return xe(r),n},toWireType:(r,n)=>et.toHandle(n),argPackAdvance:K,readValueFromPointer:kt,destructorFunction:null})},Nt=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},dn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(te[r>>2])};case 8:return function(r){return this.fromWireType(ee[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},hn=(t,e,r)=>{e=k(e),Z(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:K,readValueFromPointer:dn(e,r),destructorFunction:null})},pn=(t,e,r,n,a,o,s)=>{var u=zt(e,r);t=k(t),t=Pe(t),a=q(n,a),we(t,function(){Ft(`Cannot call ${t} due to unbound types`,u)},e-1),ot([],u,function(l){var f=[l[0],null].concat(l.slice(1));return be(t,Yt(t,f,null,a,o),e-1),[]})},mn=(t,e,r)=>{switch(e){case 1:return r?n=>G[n>>0]:n=>z[n>>0];case 2:return r?n=>dt[n>>1]:n=>bt[n>>1];case 4:return r?n=>W[n>>2]:n=>A[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},yn=(t,e,r,n,a)=>{e=k(e);var o=h=>h;if(n===0){var s=32-8*r;o=h=>h<<s>>>s}var u=e.includes("unsigned"),l=(h,y)=>{},f;u?f=function(h,y){return l(y,this.name),y>>>0}:f=function(h,y){return l(y,this.name),y},Z(t,{name:e,fromWireType:o,toWireType:f,argPackAdvance:K,readValueFromPointer:mn(e,r,n!==0),destructorFunction:null})},vn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(s){var u=A[s>>2],l=A[s+4>>2];return new a(G.buffer,l,u)}r=k(r),Z(t,{name:r,fromWireType:o,argPackAdvance:K,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Se=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<t.length;++s){var u=t.charCodeAt(s);if(u>=55296&&u<=57343){var l=t.charCodeAt(++s);u=65536+((u&1023)<<10)|l&1023}if(u<=127){if(r>=o)break;e[r++]=u}else if(u<=2047){if(r+1>=o)break;e[r++]=192|u>>6,e[r++]=128|u&63}else if(u<=65535){if(r+2>=o)break;e[r++]=224|u>>12,e[r++]=128|u>>6&63,e[r++]=128|u&63}else{if(r+3>=o)break;e[r++]=240|u>>18,e[r++]=128|u>>12&63,e[r++]=128|u>>6&63,e[r++]=128|u&63}}return e[r]=0,r-a},gn=(t,e,r)=>Se(t,z,e,r),Ae=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},De=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,wn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&De)return De.decode(t.subarray(e,a));for(var o="";e<a;){var s=t[e++];if(!(s&128)){o+=String.fromCharCode(s);continue}var u=t[e++]&63;if((s&224)==192){o+=String.fromCharCode((s&31)<<6|u);continue}var l=t[e++]&63;if((s&240)==224?s=(s&15)<<12|u<<6|l:s=(s&7)<<18|u<<12|l<<6|t[e++]&63,s<65536)o+=String.fromCharCode(s);else{var f=s-65536;o+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return o},Gt=(t,e)=>t?wn(z,t,e):"",$n=(t,e)=>{e=k(e);var r=e==="std::string";Z(t,{name:e,fromWireType(n){var a=A[n>>2],o=n+4,s;if(r)for(var u=o,l=0;l<=a;++l){var f=o+l;if(l==a||z[f]==0){var h=f-u,y=Gt(u,h);s===void 0?s=y:(s+=String.fromCharCode(0),s+=y),u=f+1}}else{for(var g=new Array(a),l=0;l<a;++l)g[l]=String.fromCharCode(z[o+l]);s=g.join("")}return tt(n),s},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,s=typeof a=="string";s||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||E("Cannot pass non-string to std::string"),r&&s?o=Ae(a):o=a.length;var u=qt(4+o+1),l=u+4;if(A[u>>2]=o,r&&s)gn(a,l,o+1);else if(s)for(var f=0;f<o;++f){var h=a.charCodeAt(f);h>255&&(tt(l),E("String has UTF-16 code units that do not fit in 8 bits")),z[l+f]=h}else for(var f=0;f<o;++f)z[l+f]=a[f];return n!==null&&n.push(tt,u),u},argPackAdvance:K,readValueFromPointer:$e,destructorFunction(n){tt(n)}})},Oe=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,bn=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&bt[n];)++n;if(r=n<<1,r-t>32&&Oe)return Oe.decode(z.subarray(t,r));for(var o="",s=0;!(s>=e/2);++s){var u=dt[t+s*2>>1];if(u==0)break;o+=String.fromCharCode(u)}return o},Cn=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<2)return 0;r-=2;for(var n=e,a=r<t.length*2?r/2:t.length,o=0;o<a;++o){var s=t.charCodeAt(o);dt[e>>1]=s,e+=2}return dt[e>>1]=0,e-n},_n=t=>t.length*2,Tn=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=W[t+r*4>>2];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},Pn=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343){var u=t.charCodeAt(++o);s=65536+((s&1023)<<10)|u&1023}if(W[e>>2]=s,e+=4,e+4>a)break}return W[e>>2]=0,e-n},En=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},xn=(t,e,r)=>{r=k(r);var n,a,o,s,u;e===2?(n=bn,a=Cn,s=_n,o=()=>bt,u=1):e===4&&(n=Tn,a=Pn,s=En,o=()=>A,u=2),Z(t,{name:r,fromWireType:l=>{for(var f=A[l>>2],h=o(),y,g=l+4,P=0;P<=f;++P){var x=l+4+P*e;if(P==f||h[x>>u]==0){var R=x-g,S=n(g,R);y===void 0?y=S:(y+=String.fromCharCode(0),y+=S),g=x+e}}return tt(l),y},toWireType:(l,f)=>{typeof f!="string"&&E(`Cannot pass non-string to C++ string type ${r}`);var h=s(f),y=qt(4+h+e);return A[y>>2]=h>>u,a(f,y+4,h+e),l!==null&&l.push(tt,y),y},argPackAdvance:K,readValueFromPointer:kt,destructorFunction(l){tt(l)}})},Sn=(t,e,r,n,a,o)=>{Pt[t]={name:k(e),rawConstructor:q(r,n),rawDestructor:q(a,o),fields:[]}},An=(t,e,r,n,a,o,s,u,l,f)=>{Pt[t].fields.push({fieldName:k(e),getterReturnType:r,getter:q(n,a),getterContext:o,setterArgumentType:s,setter:q(u,l),setterContext:f})},Dn=(t,e)=>{e=k(e),Z(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},On={},Fn=t=>{var e=On[t];return e===void 0?k(t):e},Fe=()=>{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.")},Mn=t=>t===0?et.toHandle(Fe()):(t=Fn(t),et.toHandle(Fe()[t])),jn=t=>{t>4&&(X.get(t).refcount+=1)},Me=(t,e)=>{var r=at[t];return r===void 0&&E(e+" has unknown type "+Te(t)),r},In=t=>{var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var s=Me(A[n+o*4>>2],"parameter "+o);e[o+1]=s.readValueFromPointer(a),a+=s.argPackAdvance}var u=new(r.bind.apply(r,e));return et.toHandle(u)}},je={},Rn=(t,e,r,n)=>{t=et.toValue(t);var a=je[e];return a||(a=In(e),je[e]=a),a(t,r,n)},Hn=(t,e)=>{t=Me(t,"_emval_take_value");var r=t.readValueFromPointer(e);return et.toHandle(r)},Wn=()=>{pt("")},kn=(t,e,r)=>z.copyWithin(t,e,e+r),Bn=()=>2147483648,Un=t=>{var e=J.buffer,r=(t-e.byteLength+65535)/65536;try{return J.grow(r),re(),1}catch{}},Vn=t=>{var e=z.length;t>>>=0;var r=Bn();if(t>r)return!1;for(var n=(l,f)=>l+(f-l%f)%f,a=1;a<=4;a*=2){var o=e*(1+.2/a);o=Math.min(o,t+100663296);var s=Math.min(r,n(Math.max(t,o),65536)),u=Un(s);if(u)return!0}return!1},Xt={},Ln=()=>O||"./this.program",wt=()=>{if(!wt.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,_:Ln()};for(var r in Xt)Xt[r]===void 0?delete e[r]:e[r]=Xt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);wt.strings=n}return wt.strings},zn=(t,e)=>{for(var r=0;r<t.length;++r)G[e++>>0]=t.charCodeAt(r);G[e>>0]=0},Yn=(t,e)=>{var r=0;return wt().forEach((n,a)=>{var o=e+r;A[t+a*4>>2]=o,zn(n,o),r+=n.length+1}),0},Nn=(t,e)=>{var r=wt();A[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),A[e>>2]=n,0},Gn=t=>t,Mt=t=>t%4===0&&(t%100!==0||t%400===0),Xn=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Ie=[31,29,31,30,31,30,31,31,30,31,30,31],Re=[31,28,31,30,31,30,31,31,30,31,30,31],qn=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Mt(r.getFullYear()),a=r.getMonth(),o=(n?Ie:Re)[a];if(e>o-r.getDate())e-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+e),r}return r};function Jn(t,e,r){var n=r>0?r:Ae(t)+1,a=new Array(n),o=Se(t,a,0,a.length);return e&&(a.length=o),a}var Qn=(t,e)=>{G.set(t,e)},Zn=(t,e,r,n)=>{var a=A[n+40>>2],o={tm_sec:W[n>>2],tm_min:W[n+4>>2],tm_hour:W[n+8>>2],tm_mday:W[n+12>>2],tm_mon:W[n+16>>2],tm_year:W[n+20>>2],tm_wday:W[n+24>>2],tm_yday:W[n+28>>2],tm_isdst:W[n+32>>2],tm_gmtoff:W[n+36>>2],tm_zone:a?Gt(a):""},s=Gt(r),u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in u)s=s.replace(new RegExp(l,"g"),u[l]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function y(d,m,M){for(var I=typeof d=="number"?d.toString():d||"";I.length<m;)I=M[0]+I;return I}function g(d,m){return y(d,m,"0")}function P(d,m){function M(it){return it<0?-1:it>0?1:0}var I;return(I=M(d.getFullYear()-m.getFullYear()))===0&&(I=M(d.getMonth()-m.getMonth()))===0&&(I=M(d.getDate()-m.getDate())),I}function x(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function R(d){var m=qn(new Date(d.tm_year+1900,0,1),d.tm_yday),M=new Date(m.getFullYear(),0,4),I=new Date(m.getFullYear()+1,0,4),it=x(M),It=x(I);return P(it,m)<=0?P(It,m)<=0?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}var S={"%a":d=>f[d.tm_wday].substring(0,3),"%A":d=>f[d.tm_wday],"%b":d=>h[d.tm_mon].substring(0,3),"%B":d=>h[d.tm_mon],"%C":d=>{var m=d.tm_year+1900;return g(m/100|0,2)},"%d":d=>g(d.tm_mday,2),"%e":d=>y(d.tm_mday,2," "),"%g":d=>R(d).toString().substring(2),"%G":d=>R(d),"%H":d=>g(d.tm_hour,2),"%I":d=>{var m=d.tm_hour;return m==0?m=12:m>12&&(m-=12),g(m,2)},"%j":d=>g(d.tm_mday+Xn(Mt(d.tm_year+1900)?Ie:Re,d.tm_mon-1),3),"%m":d=>g(d.tm_mon+1,2),"%M":d=>g(d.tm_min,2),"%n":()=>`
3
- `,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>g(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var m=d.tm_yday+7-d.tm_wday;return g(Math.floor(m/7),2)},"%V":d=>{var m=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&m++,m){if(m==53){var M=(d.tm_wday+371-d.tm_yday)%7;M!=4&&(M!=3||!Mt(d.tm_year))&&(m=1)}}else{m=52;var I=(d.tm_wday+7-d.tm_yday-1)%7;(I==4||I==5&&Mt(d.tm_year%400-1))&&m++}return g(m,2)},"%w":d=>d.tm_wday,"%W":d=>{var m=d.tm_yday+7-(d.tm_wday+6)%7;return g(Math.floor(m/7),2)},"%y":d=>(d.tm_year+1900).toString().substring(2),"%Y":d=>d.tm_year+1900,"%z":d=>{var m=d.tm_gmtoff,M=m>=0;return m=Math.abs(m)/60,m=m/60*100+m%60,(M?"+":"-")+("0000"+m).slice(-4)},"%Z":d=>d.tm_zone,"%%":()=>"%"};s=s.replace(/%%/g,"\0\0");for(var l in S)s.includes(l)&&(s=s.replace(new RegExp(l,"g"),S[l](o)));s=s.replace(/\0\0/g,"%");var H=Jn(s,!1);return H.length>e?0:(Qn(H,t),H.length-1)},Kn=(t,e,r,n,a)=>Zn(t,e,r,n);le=i.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},jr(),ct=i.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},Nr(),Vr(),Kr(),_e=i.UnboundTypeError=nn(Error,"UnboundTypeError"),un(),ln();var ta={q:Cr,u:_r,a:Pr,h:Er,l:xr,I:Sr,P:Ar,n:Dr,aa:Or,d:Tr,pa:Fr,X:Mr,fa:Rr,oa:an,na:on,D:sn,ea:fn,U:hn,J:pn,w:yn,s:vn,T:$n,L:xn,Q:Sn,qa:An,ga:Dn,ba:xe,ma:Mn,V:jn,ja:Rn,la:Hn,K:Wn,da:kn,ca:Vn,_:Yn,$:Nn,H:wa,S:Aa,C:Ca,p:ya,b:ea,z:va,ha:Ta,c:ia,j:ua,i:aa,x:ba,O:ga,v:pa,G:Ea,N:xa,B:_a,F:Da,Y:Fa,W:Ma,k:sa,f:oa,e:na,g:ra,M:Sa,m:ha,ia:$a,o:ca,R:la,t:da,ka:ma,y:Pa,r:fa,E:Oa,A:Gn,Z:Kn},D=br(),tt=i._free=t=>(tt=i._free=D.ta)(t),qt=i._malloc=t=>(qt=i._malloc=D.ua)(t),He=t=>(He=D.wa)(t);i.__embind_initialize_bindings=()=>(i.__embind_initialize_bindings=D.xa)();var b=(t,e)=>(b=D.ya)(t,e),$t=t=>($t=D.za)(t),C=()=>(C=D.Aa)(),_=t=>(_=D.Ba)(t),We=t=>(We=D.Ca)(t),ke=t=>(ke=D.Da)(t),Be=(t,e,r)=>(Be=D.Ea)(t,e,r),Ue=t=>(Ue=D.Fa)(t);i.dynCall_viijii=(t,e,r,n,a,o,s)=>(i.dynCall_viijii=D.Ga)(t,e,r,n,a,o,s);var Ve=i.dynCall_jiii=(t,e,r,n)=>(Ve=i.dynCall_jiii=D.Ha)(t,e,r,n),Le=i.dynCall_jiiii=(t,e,r,n,a)=>(Le=i.dynCall_jiiii=D.Ia)(t,e,r,n,a);i.dynCall_iiiiij=(t,e,r,n,a,o,s)=>(i.dynCall_iiiiij=D.Ja)(t,e,r,n,a,o,s),i.dynCall_iiiiijj=(t,e,r,n,a,o,s,u,l)=>(i.dynCall_iiiiijj=D.Ka)(t,e,r,n,a,o,s,u,l),i.dynCall_iiiiiijj=(t,e,r,n,a,o,s,u,l,f)=>(i.dynCall_iiiiiijj=D.La)(t,e,r,n,a,o,s,u,l,f);function ea(t,e){var r=C();try{return T(t)(e)}catch(n){if(_(r),n!==n+0)throw n;b(1,0)}}function ra(t,e,r,n){var a=C();try{T(t)(e,r,n)}catch(o){if(_(a),o!==o+0)throw o;b(1,0)}}function na(t,e,r){var n=C();try{T(t)(e,r)}catch(a){if(_(n),a!==a+0)throw a;b(1,0)}}function aa(t,e,r,n,a){var o=C();try{return T(t)(e,r,n,a)}catch(s){if(_(o),s!==s+0)throw s;b(1,0)}}function oa(t,e){var r=C();try{T(t)(e)}catch(n){if(_(r),n!==n+0)throw n;b(1,0)}}function ia(t,e,r){var n=C();try{return T(t)(e,r)}catch(a){if(_(n),a!==a+0)throw a;b(1,0)}}function sa(t){var e=C();try{T(t)()}catch(r){if(_(e),r!==r+0)throw r;b(1,0)}}function ua(t,e,r,n){var a=C();try{return T(t)(e,r,n)}catch(o){if(_(a),o!==o+0)throw o;b(1,0)}}function ca(t,e,r,n,a,o){var s=C();try{T(t)(e,r,n,a,o)}catch(u){if(_(s),u!==u+0)throw u;b(1,0)}}function la(t,e,r,n,a,o,s){var u=C();try{T(t)(e,r,n,a,o,s)}catch(l){if(_(u),l!==l+0)throw l;b(1,0)}}function fa(t,e,r,n,a,o,s,u,l,f,h){var y=C();try{T(t)(e,r,n,a,o,s,u,l,f,h)}catch(g){if(_(y),g!==g+0)throw g;b(1,0)}}function da(t,e,r,n,a,o,s,u){var l=C();try{T(t)(e,r,n,a,o,s,u)}catch(f){if(_(l),f!==f+0)throw f;b(1,0)}}function ha(t,e,r,n,a){var o=C();try{T(t)(e,r,n,a)}catch(s){if(_(o),s!==s+0)throw s;b(1,0)}}function pa(t,e,r,n,a,o,s){var u=C();try{return T(t)(e,r,n,a,o,s)}catch(l){if(_(u),l!==l+0)throw l;b(1,0)}}function ma(t,e,r,n,a,o,s,u,l){var f=C();try{T(t)(e,r,n,a,o,s,u,l)}catch(h){if(_(f),h!==h+0)throw h;b(1,0)}}function ya(t){var e=C();try{return T(t)()}catch(r){if(_(e),r!==r+0)throw r;b(1,0)}}function va(t,e,r,n){var a=C();try{return T(t)(e,r,n)}catch(o){if(_(a),o!==o+0)throw o;b(1,0)}}function ga(t,e,r,n,a,o,s){var u=C();try{return T(t)(e,r,n,a,o,s)}catch(l){if(_(u),l!==l+0)throw l;b(1,0)}}function wa(t,e,r,n){var a=C();try{return T(t)(e,r,n)}catch(o){if(_(a),o!==o+0)throw o;b(1,0)}}function $a(t,e,r,n,a,o,s,u){var l=C();try{T(t)(e,r,n,a,o,s,u)}catch(f){if(_(l),f!==f+0)throw f;b(1,0)}}function ba(t,e,r,n,a,o){var s=C();try{return T(t)(e,r,n,a,o)}catch(u){if(_(s),u!==u+0)throw u;b(1,0)}}function Ca(t,e,r,n,a,o){var s=C();try{return T(t)(e,r,n,a,o)}catch(u){if(_(s),u!==u+0)throw u;b(1,0)}}function _a(t,e,r,n,a,o,s,u,l,f){var h=C();try{return T(t)(e,r,n,a,o,s,u,l,f)}catch(y){if(_(h),y!==y+0)throw y;b(1,0)}}function Ta(t,e,r){var n=C();try{return T(t)(e,r)}catch(a){if(_(n),a!==a+0)throw a;b(1,0)}}function Pa(t,e,r,n,a,o,s,u,l,f){var h=C();try{T(t)(e,r,n,a,o,s,u,l,f)}catch(y){if(_(h),y!==y+0)throw y;b(1,0)}}function Ea(t,e,r,n,a,o,s,u){var l=C();try{return T(t)(e,r,n,a,o,s,u)}catch(f){if(_(l),f!==f+0)throw f;b(1,0)}}function xa(t,e,r,n,a,o,s,u,l){var f=C();try{return T(t)(e,r,n,a,o,s,u,l)}catch(h){if(_(f),h!==h+0)throw h;b(1,0)}}function Sa(t,e,r,n,a,o,s){var u=C();try{T(t)(e,r,n,a,o,s)}catch(l){if(_(u),l!==l+0)throw l;b(1,0)}}function Aa(t,e,r,n){var a=C();try{return T(t)(e,r,n)}catch(o){if(_(a),o!==o+0)throw o;b(1,0)}}function Da(t,e,r,n,a,o,s,u,l,f,h,y){var g=C();try{return T(t)(e,r,n,a,o,s,u,l,f,h,y)}catch(P){if(_(g),P!==P+0)throw P;b(1,0)}}function Oa(t,e,r,n,a,o,s,u,l,f,h,y,g,P,x,R){var S=C();try{T(t)(e,r,n,a,o,s,u,l,f,h,y,g,P,x,R)}catch(H){if(_(S),H!==H+0)throw H;b(1,0)}}function Fa(t,e,r,n){var a=C();try{return Ve(t,e,r,n)}catch(o){if(_(a),o!==o+0)throw o;b(1,0)}}function Ma(t,e,r,n,a){var o=C();try{return Le(t,e,r,n,a)}catch(s){if(_(o),s!==s+0)throw s;b(1,0)}}var jt;ht=function t(){jt||ze(),jt||(ht=t)};function ze(){if(rt>0||(lr(),rt>0))return;function t(){jt||(jt=!0,i.calledRun=!0,!ft&&(fr(),v(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),dr()))}i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),t()},1)):t()}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return ze(),p.ready}})();function Ja(c){return Zt(Kt,c)}async function Qa(c,{tryHarder:p=B.tryHarder,formats:i=B.formats,maxSymbols:v=B.maxSymbols}=B){return Xa(c,{tryHarder:p,formats:i,maxSymbols:v},Kt)}async function Za(c,{tryHarder:p=B.tryHarder,formats:i=B.formats,maxSymbols:v=B.maxSymbols}=B){return qa(c,{tryHarder:p,formats:i,maxSymbols:v},Kt)}const Qt=new Map([["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["data_matrix","DataMatrix"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["pdf417","PDF417"],["qr_code","QRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"]]);function Ka(c){for(const[p,i]of Qt)if(c===i)return p;return"unknown"}var lt;class to extends EventTarget{constructor(i={}){var v;super();Ne(this,lt,void 0);try{const $=(v=i==null?void 0:i.formats)==null?void 0:v.filter(w=>w!=="unknown");if(($==null?void 0:$.length)===0)throw new TypeError("Hint option provided, but is empty.");$==null||$.forEach(w=>{if(!Xe.includes(w))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${w}' is not a valid enum value of type BarcodeFormat.`)}),Ge(this,lt,$??[]),Ja().then(w=>{this.dispatchEvent(new CustomEvent("load",{detail:w}))}).catch(w=>{this.dispatchEvent(new CustomEvent("error",{detail:w}))})}catch($){throw qe($,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Xe.filter(i=>i!=="unknown")}async detect(i){try{const v=await ka(i);if(v===null)return[];let $;try{ir(v)?$=await Qa(v,{tryHarder:!0,formats:Jt(this,lt).map(w=>Qt.get(w))}):$=await Za(v,{tryHarder:!0,formats:Jt(this,lt).map(w=>Qt.get(w))})}catch(w){throw console.error(w),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return $.map(w=>{const{topLeft:{x:O,y:Y},topRight:{x:j,y:F},bottomLeft:{x:V,y:L},bottomRight:{x:U,y:N}}=w.position,J=Math.min(O,j,V,U),ft=Math.min(Y,F,L,N),Rt=Math.max(O,j,V,U),G=Math.max(Y,F,L,N);return{boundingBox:new DOMRectReadOnly(J,ft,Rt-J,G-ft),rawValue:new TextDecoder().decode(w.bytes),format:Ka(w.format),cornerPoints:[{x:O,y:Y},{x:j,y:F},{x:U,y:N},{x:V,y:L}]}})}catch(v){throw qe(v,"Failed to execute 'detect' on 'BarcodeDetector'")}}}lt=new WeakMap;exports.BarcodeDetector=to;exports.setZXingModuleOverrides=Ga;
1
+ "use strict";var Ye=(i,h,s)=>{if(!h.has(i))throw TypeError("Cannot "+s)};var Kt=(i,h,s)=>(Ye(i,h,"read from private field"),s?s.call(i):h.get(i)),ze=(i,h,s)=>{if(h.has(i))throw TypeError("Cannot add the same private member more than once");h instanceof WeakSet?h.add(i):h.set(i,s)},Ge=(i,h,s,w)=>(Ye(i,h,"write to private field"),w?w.call(i,s):h.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ne=["aztec","code_128","code_39","code_93","codabar","data_matrix","ean_13","ean_8","itf","pdf417","qr_code","upc_a","upc_e","unknown"];function ba(i){if(Je(i))return{width:i.naturalWidth,height:i.naturalHeight};if(Qe(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(Ke(i))return{width:i.videoWidth,height:i.videoHeight};if(er(i))return{width:i.width,height:i.height};if(nr(i))return{width:i.displayWidth,height:i.displayHeight};if(tr(i))return{width:i.width,height:i.height};if(rr(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 Je(i){try{return i instanceof HTMLImageElement}catch{return!1}}function Qe(i){try{return i instanceof SVGImageElement}catch{return!1}}function Ke(i){try{return i instanceof HTMLVideoElement}catch{return!1}}function tr(i){try{return i instanceof HTMLCanvasElement}catch{return!1}}function er(i){try{return i instanceof ImageBitmap}catch{return!1}}function rr(i){try{return i instanceof OffscreenCanvas}catch{return!1}}function nr(i){try{return i instanceof VideoFrame}catch{return!1}}function ar(i){try{return i instanceof Blob}catch{return!1}}function Ca(i){try{return i instanceof ImageData}catch{return!1}}function _a(i,h){try{const s=new OffscreenCanvas(i,h);if(s.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return s;throw void 0}catch{const s=document.createElement("canvas");return s.width=i,s.height=h,s}}async function or(i){if(Je(i)&&!await Aa(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Qe(i)&&!await Oa(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(nr(i)&&Da(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(Ke(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(er(i)&&Fa(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:h,height:s}=ba(i);if(h===0||s===0)return null;const v=_a(h,s).getContext("2d");v.drawImage(i,0,0);try{return v.getImageData(0,0,h,s)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Ta(i){let h;try{if(createImageBitmap)h=await createImageBitmap(i);else if(Image){h=new Image;let w="";try{w=URL.createObjectURL(i),h.src=w,await h.decode()}finally{URL.revokeObjectURL(w)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await or(h)}function Pa(i){const{width:h,height:s}=i;if(h===0||s===0)return null;const w=i.getContext("2d");try{return w.getImageData(0,0,h,s)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Ea(i){if(ar(i))return await Ta(i);if(Ca(i)){if(Sa(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return tr(i)||rr(i)?Pa(i):await or(i)}async function Aa(i){try{return await i.decode(),!0}catch{return!1}}async function Oa(i){var h;try{return await((h=i.decode)==null?void 0:h.call(i)),!0}catch{return!1}}function Da(i){return i.format===null}function Sa(i){return i.data.buffer.byteLength===0}function Fa(i){return i.width===0&&i.height===0}function Xe(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}`)}const qe=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","UPC-A","UPC-E"];function xa(i){return i.join("|")}function Ma(i){const h=Ze(i);let s=0,w=qe.length-1;for(;s<=w;){const v=Math.floor((s+w)/2),$=qe[v],H=Ze($);if(H===h)return $;H<h?s=v+1:w=v-1}return"None"}function Ze(i){return i.toLowerCase().replace(/_-\[\]/g,"")}function ja(i,h){return i.Binarizer[h]}function Ia(i,h){return i.CharacterSet[h]}const Ra=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Wa(i){return Ra[i.value]}function ka(i,h){return i.EanAddOnSymbol[h]}function Ha(i,h){return i.TextMode[h]}const Mt={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 ir(i,h){return{...h,formats:xa(h.formats),binarizer:ja(i,h.binarizer),eanAddOnSymbol:ka(i,h.eanAddOnSymbol),textMode:Ha(i,h.textMode),characterSet:Ia(i,h.characterSet)}}function sr(i){return{...i,format:Ma(i.format),eccLevel:i.eccLevel,contentType:Wa(i.contentType)}}const Ba={locateFile:(i,h)=>{const s=i.match(/_(.+?)\.wasm$/);return s?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.0.0-rc.4/dist/${s[1]}/${i}`:h+i}};let te=new WeakMap;function re(i,h){var s;const w=te.get(i);if(w!=null&&w.modulePromise&&(h===void 0||Object.is(h,w.moduleOverrides)))return w.modulePromise;const v=(s=h??(w==null?void 0:w.moduleOverrides))!=null?s:Ba,$=i({...v});return te.set(i,{moduleOverrides:v,modulePromise:$}),$}function Ua(i,h){te.set(i,{moduleOverrides:h})}async function Va(i,h,s=Mt){const w={...Mt,...s},v=await re(i),{size:$}=h,H=new Uint8Array(await h.arrayBuffer()),L=v._malloc($);v.HEAPU8.set(H,L);const B=v.readBarcodesFromImage(L,$,ir(v,w));v._free(L);const O=[];for(let Y=0;Y<B.size();++Y)O.push(sr(B.get(Y)));return O}async function La(i,h,s=Mt){const w={...Mt,...s},v=await re(i),{data:$,width:H,height:L,data:{byteLength:B}}=h,O=v._malloc(B);v.HEAPU8.set($,O);const Y=v.readBarcodesFromPixmap(O,H,L,ir(v,w));v._free(O);const N=[];for(let U=0;U<Y.size();++U)N.push(sr(Y.get(U)));return N}var jt=(()=>{var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(h={}){var s=h,w,v;s.ready=new Promise((t,e)=>{w=t,v=e});var $=Object.assign({},s),H="./this.program",L=typeof window=="object",B=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var O="";function Y(t){return s.locateFile?s.locateFile(t,O):O+t}var N;(L||B)&&(B?O=self.location.href:typeof document<"u"&&document.currentScript&&(O=document.currentScript.src),i&&(O=i),O.indexOf("blob:")!==0?O=O.substr(0,O.replace(/[?#].*/,"").lastIndexOf("/")+1):O="",B&&(N=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),s.print||console.log.bind(console);var U=s.printErr||console.error.bind(console);Object.assign(s,$),$=null,s.arguments&&s.arguments,s.thisProgram&&(H=s.thisProgram),s.quit&&s.quit;var Z;s.wasmBinary&&(Z=s.wasmBinary),typeof WebAssembly!="object"&&ht("no native wasm support detected");var tt,lt=!1;function It(t,e){t||ht(e)}var V,k,ot,dt,W,_,ne,ae;function oe(){var t=tt.buffer;s.HEAP8=V=new Int8Array(t),s.HEAP16=ot=new Int16Array(t),s.HEAPU8=k=new Uint8Array(t),s.HEAPU16=dt=new Uint16Array(t),s.HEAP32=W=new Int32Array(t),s.HEAPU32=_=new Uint32Array(t),s.HEAPF32=ne=new Float32Array(t),s.HEAPF64=ae=new Float64Array(t)}var ie=[],se=[],ue=[];function ur(){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)dr(s.preRun.shift());Rt(ie)}function cr(){Rt(se)}function lr(){if(s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;)hr(s.postRun.shift());Rt(ue)}function dr(t){ie.unshift(t)}function fr(t){se.unshift(t)}function hr(t){ue.unshift(t)}var et=0,ft=null;function pr(t){et++,s.monitorRunDependencies&&s.monitorRunDependencies(et)}function mr(t){if(et--,s.monitorRunDependencies&&s.monitorRunDependencies(et),et==0&&ft){var e=ft;ft=null,e()}}function ht(t){s.onAbort&&s.onAbort(t),t="Aborted("+t+")",U(t),lt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw v(e),e}var yr="data:application/octet-stream;base64,",ce=t=>t.startsWith(yr),it;it="zxing_reader.wasm",ce(it)||(it=Y(it));function le(t){if(t==it&&Z)return new Uint8Array(Z);if(N)return N(t);throw"both async and sync fetching of the wasm failed"}function vr(t){return!Z&&(L||B)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>le(t)):Promise.resolve().then(()=>le(t))}function de(t,e,r){return vr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{U(`failed to asynchronously prepare wasm: ${n}`),ht(n)})}function gr(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!ce(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(u){return U(`wasm streaming compile failed: ${u}`),U("falling back to ArrayBuffer instantiation"),de(e,r,n)})}):de(e,r,n)}function wr(){var t={a:ta};function e(n,a){return E=n.exports,tt=E.fa,oe(),_e=E.ja,fr(E.ga),mr(),E}pr();function r(n){e(n.instance)}if(s.instantiateWasm)try{return s.instantiateWasm(t,e)}catch(n){U(`Module.instantiateWasm callback failed with error: ${n}`),v(n)}return gr(Z,it,t,r).catch(v),{}}var Rt=t=>{for(;t.length>0;)t.shift()(s)};s.noExitRuntime;var $t=[],bt=0,$r=t=>{var e=new Wt(t);return e.get_caught()||(e.set_caught(!0),bt--),e.set_rethrown(!1),$t.push(e),He(e.excPtr),e.get_exception_ptr()},J=0,br=()=>{A(0,0);var t=$t.pop();ke(t.excPtr),J=0};function Wt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){_[this.ptr+4>>2]=e},this.get_type=function(){return _[this.ptr+4>>2]},this.set_destructor=function(e){_[this.ptr+8>>2]=e},this.get_destructor=function(){return _[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,V[this.ptr+12>>0]=e},this.get_caught=function(){return V[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,V[this.ptr+13>>0]=e},this.get_rethrown=function(){return V[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){_[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return _[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=Ue(this.get_type());if(e)return _[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var Cr=t=>{throw J||(J=t),J},kt=t=>{var e=J;if(!e)return wt(0),0;var r=new Wt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return wt(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var u=r.ptr+16;if(Be(o,n,u))return wt(o),e}return wt(n),e},_r=()=>kt([]),Tr=t=>kt([t]),Pr=(t,e)=>kt([t,e]),Er=()=>{var t=$t.pop();t||ht("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||($t.push(t),t.set_rethrown(!0),t.set_caught(!1),bt++),J=e,J},Ar=(t,e,r)=>{var n=new Wt(t);throw n.init(e,r),J=t,bt++,J},Or=()=>bt,Ct={},fe=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function Ht(t){return this.fromWireType(W[t>>2])}var st={},rt={},_t={},he,Tt=t=>{throw new he(t)},nt=(t,e,r)=>{t.forEach(function(c){_t[c]=e});function n(c){var l=r(c);l.length!==t.length&&Tt("Mismatched type converter count");for(var f=0;f<t.length;++f)X(t[f],l[f])}var a=new Array(e.length),o=[],u=0;e.forEach((c,l)=>{rt.hasOwnProperty(c)?a[l]=rt[c]:(o.push(c),st.hasOwnProperty(c)||(st[c]=[]),st[c].push(()=>{a[l]=rt[c],++u,u===o.length&&n(a)}))}),o.length===0&&n(a)},Dr=t=>{var e=Ct[t];delete Ct[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));nt([t],o,u=>{var c={};return a.forEach((l,f)=>{var p=l.fieldName,y=u[f],g=l.getter,b=l.getterContext,T=u[f+a.length],I=l.setter,P=l.setterContext;c[p]={read:R=>y.fromWireType(g(b,R)),write:(R,d)=>{var m=[];I(P,R,T.toWireType(m,d)),fe(m)}}}),[{name:e.name,fromWireType:l=>{var f={};for(var p in c)f[p]=c[p].read(l);return n(l),f},toWireType:(l,f)=>{for(var p in c)if(!(p in f))throw new TypeError(`Missing field: "${p}"`);var y=r();for(p in c)c[p].write(y,f[p]);return l!==null&&l.push(n,y),y},argPackAdvance:q,readValueFromPointer:Ht,destructorFunction:n}]})},Sr=(t,e,r,n,a)=>{},Fr=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);pe=t},pe,j=t=>{for(var e="",r=t;k[r];)e+=pe[k[r++]];return e},ut,C=t=>{throw new ut(t)};function xr(t,e,r={}){var n=e.name;if(t||C(`type "${n}" must have a positive integer typeid pointer`),rt.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(rt[t]=e,delete _t[t],st.hasOwnProperty(t)){var a=st[t];delete st[t],a.forEach(o=>o())}}function X(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return xr(t,e,r)}var q=8,Mr=(t,e,r,n)=>{e=j(e),X(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:q,readValueFromPointer:function(a){return this.fromWireType(k[a])},destructorFunction:null})},jr=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Bt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}C(e(t)+" instance already deleted")},Ut=!1,me=t=>{},Ir=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},ye=t=>{t.count.value-=1;var e=t.count.value===0;e&&Ir(t)},ve=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=ve(t,e,r.baseClass);return n===null?null:r.downcast(n)},ge={},Rr=()=>Object.keys(yt).length,Wr=()=>{var t=[];for(var e in yt)yt.hasOwnProperty(e)&&t.push(yt[e]);return t},pt=[],Vt=()=>{for(;pt.length;){var t=pt.pop();t.$$.deleteScheduled=!1,t.delete()}},mt,kr=t=>{mt=t,pt.length&&mt&&mt(Vt)},Hr=()=>{s.getInheritedInstanceCount=Rr,s.getLiveInheritedInstances=Wr,s.flushPendingDeletes=Vt,s.setDelayFunction=kr},yt={},Br=(t,e)=>{for(e===void 0&&C("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},Ur=(t,e)=>(e=Br(t,e),yt[e]),Pt=(t,e)=>{(!e.ptrType||!e.ptr)&&Tt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&Tt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},vt(Object.create(t,{$$:{value:e}}))};function Vr(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Ur(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?Pt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Pt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),u=ge[o];if(!u)return a.call(this);var c;this.isConst?c=u.constPointerType:c=u.pointerType;var l=ve(e,this.registeredClass,c.registeredClass);return l===null?a.call(this):this.isSmartPointer?Pt(c.registeredClass.instancePrototype,{ptrType:c,ptr:l,smartPtrType:this,smartPtr:t}):Pt(c.registeredClass.instancePrototype,{ptrType:c,ptr:l})}var vt=t=>typeof FinalizationRegistry>"u"?(vt=e=>e,t):(Ut=new FinalizationRegistry(e=>{ye(e.$$)}),vt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Ut.register(e,a,e)}return e},me=e=>Ut.unregister(e),vt(t)),Lr=()=>{Object.assign(Et.prototype,{isAliasOf(t){if(!(this instanceof Et)||!(t instanceof Et))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||Bt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=vt(Object.create(Object.getPrototypeOf(this),{$$:{value:jr(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Bt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),me(this),ye(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Bt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),pt.push(this),pt.length===1&&mt&&mt(Vt),this.$$.deleteScheduled=!0,this}})};function Et(){}var Yr=48,zr=57,we=t=>{if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Yr&&e<=zr?`_${t}`:t};function Lt(t,e){return t=we(t),{[t]:function(){return e.apply(this,arguments)}}[t]}var $e=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||C(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},Yt=(t,e,r)=>{s.hasOwnProperty(t)?((r===void 0||s[t].overloadTable!==void 0&&s[t].overloadTable[r]!==void 0)&&C(`Cannot register public name '${t}' twice`),$e(s,t,t),s.hasOwnProperty(r)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),s[t].overloadTable[r]=e):(s[t]=e,r!==void 0&&(s[t].numArguments=r))};function Gr(t,e,r,n,a,o,u,c){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=u,this.downcast=c,this.pureVirtualFunctions=[]}var zt=(t,e,r)=>{for(;e!==r;)e.upcast||C(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function Nr(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${qt(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=zt(e.$$.ptr,r,this.registeredClass);return n}function Xr(t,e){var r;if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;e.$$||C(`Cannot pass "${qt(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&C(`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=zt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:C(`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,K.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:C("Unsupporting sharing policy")}return r}function qr(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${qt(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&C(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=zt(e.$$.ptr,r,this.registeredClass);return n}function be(t){return this.fromWireType(_[t>>2])}var Zr=()=>{Object.assign(At.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){this.rawDestructor&&this.rawDestructor(t)},argPackAdvance:q,readValueFromPointer:be,deleteObject(t){t!==null&&t.delete()},fromWireType:Vr})};function At(t,e,r,n,a,o,u,c,l,f,p){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=u,this.rawGetPointee=c,this.rawConstructor=l,this.rawShare=f,this.rawDestructor=p,!a&&e.baseClass===void 0?n?(this.toWireType=Nr,this.destructorFunction=null):(this.toWireType=qr,this.destructorFunction=null):this.toWireType=Xr}var Ce=(t,e,r)=>{s.hasOwnProperty(t)||Tt("Replacing nonexistant public symbol"),s[t].overloadTable!==void 0&&r!==void 0?s[t].overloadTable[r]=e:(s[t]=e,s[t].argCount=r)},Jr=(t,e,r)=>{var n=s["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},Ot=[],_e,D=t=>{var e=Ot[t];return e||(t>=Ot.length&&(Ot.length=t+1),Ot[t]=e=_e.get(t)),e},Qr=(t,e,r)=>{if(t.includes("j"))return Jr(t,e,r);var n=D(e).apply(null,r);return n},Kr=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),Qr(t,e,r)}},G=(t,e)=>{t=j(t);function r(){return t.includes("j")?Kr(t,e):D(e)}var n=r();return typeof n!="function"&&C(`unknown function pointer with signature ${t}: ${e}`),n},tn=(t,e)=>{var r=Lt(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},Te,Pe=t=>{var e=We(t),r=j(e);return Q(e),r},Dt=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!rt[o]){if(_t[o]){_t[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Te(`${t}: `+r.map(Pe).join([", "]))},en=(t,e,r,n,a,o,u,c,l,f,p,y,g)=>{p=j(p),o=G(a,o),c&&(c=G(u,c)),f&&(f=G(l,f)),g=G(y,g);var b=we(p);Yt(b,function(){Dt(`Cannot construct ${p} due to unbound types`,[n])}),nt([t,e,r],n?[n]:[],function(T){T=T[0];var I,P;n?(I=T.registeredClass,P=I.instancePrototype):P=Et.prototype;var R=Lt(b,function(){if(Object.getPrototypeOf(this)!==d)throw new ut("Use 'new' to construct "+p);if(m.constructor_body===void 0)throw new ut(p+" has no accessible constructor");var xt=m.constructor_body[arguments.length];if(xt===void 0)throw new ut(`Tried to invoke ctor of ${p} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(m.constructor_body).toString()}) parameters instead!`);return xt.apply(this,arguments)}),d=Object.create(P,{constructor:{value:R}});R.prototype=d;var m=new Gr(p,R,d,g,I,o,c,f);m.baseClass&&(m.baseClass.__derivedClasses===void 0&&(m.baseClass.__derivedClasses=[]),m.baseClass.__derivedClasses.push(m));var x=new At(p,m,!0,!1,!1),M=new At(p+"*",m,!1,!1,!1),at=new At(p+" const*",m,!1,!0,!1);return ge[t]={pointerType:M,constPointerType:at},Ce(b,R),[x,M,at]})},Gt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+n*4>>2]);return r};function Nt(t,e,r,n,a,o){var u=e.length;u<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var c=e[1]!==null&&r!==null,l=!1,f=1;f<e.length;++f)if(e[f]!==null&&e[f].destructorFunction===void 0){l=!0;break}var p=e[0].name!=="void",y=u-2,g=new Array(y),b=[],T=[];return function(){arguments.length!==y&&C(`function ${t} called with ${arguments.length} arguments, expected ${y}`),T.length=0;var I;b.length=c?2:1,b[0]=a,c&&(I=e[1].toWireType(T,this),b[1]=I);for(var P=0;P<y;++P)g[P]=e[P+2].toWireType(T,arguments[P]),b.push(g[P]);var R=n.apply(null,b);function d(m){if(l)fe(T);else for(var x=c?1:2;x<e.length;x++){var M=x===1?I:g[x-2];e[x].destructorFunction!==null&&e[x].destructorFunction(M)}if(p)return e[0].fromWireType(m)}return d(R)}}var rn=(t,e,r,n,a,o)=>{var u=Gt(e,r);a=G(n,a),nt([],[t],function(c){c=c[0];var l=`constructor ${c.name}`;if(c.registeredClass.constructor_body===void 0&&(c.registeredClass.constructor_body=[]),c.registeredClass.constructor_body[e-1]!==void 0)throw new ut(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${c.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return c.registeredClass.constructor_body[e-1]=()=>{Dt(`Cannot construct ${c.name} due to unbound types`,u)},nt([],u,f=>(f.splice(1,0,null),c.registeredClass.constructor_body[e-1]=Nt(l,f,null,a,o),[])),[]})},Ee=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?(It(t[t.length-1]==")","Parentheses for argument names should match."),t.substr(0,e)):t},nn=(t,e,r,n,a,o,u,c,l)=>{var f=Gt(r,n);e=j(e),e=Ee(e),o=G(a,o),nt([],[t],function(p){p=p[0];var y=`${p.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),c&&p.registeredClass.pureVirtualFunctions.push(e);function g(){Dt(`Cannot call ${y} due to unbound types`,f)}var b=p.registeredClass.instancePrototype,T=b[e];return T===void 0||T.overloadTable===void 0&&T.className!==p.name&&T.argCount===r-2?(g.argCount=r-2,g.className=p.name,b[e]=g):($e(b,e,y),b[e].overloadTable[r-2]=g),nt([],f,function(I){var P=Nt(y,I,p,o,u);return b[e].overloadTable===void 0?(P.argCount=r-2,b[e]=P):b[e].overloadTable[r-2]=P,[]}),[]})};function an(){Object.assign(Ae.prototype,{get(t){return this.allocated[t]},has(t){return this.allocated[t]!==void 0},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}})}function Ae(){this.allocated=[void 0],this.freelist=[]}var z=new Ae,Oe=t=>{t>=z.reserved&&--z.get(t).refcount===0&&z.free(t)},on=()=>{for(var t=0,e=z.reserved;e<z.allocated.length;++e)z.allocated[e]!==void 0&&++t;return t},sn=()=>{z.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),z.reserved=z.allocated.length,s.count_emval_handles=on},K={toValue:t=>(t||C("Cannot use deleted val. handle = "+t),z.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return z.allocate({refcount:1,value:t})}}},un=(t,e)=>{e=j(e),X(t,{name:e,fromWireType:r=>{var n=K.toValue(r);return Oe(r),n},toWireType:(r,n)=>K.toHandle(n),argPackAdvance:q,readValueFromPointer:Ht,destructorFunction:null})},cn=(t,e,r)=>{switch(e){case 1:return r?function(n){return this.fromWireType(V[n>>0])}:function(n){return this.fromWireType(k[n>>0])};case 2:return r?function(n){return this.fromWireType(ot[n>>1])}:function(n){return this.fromWireType(dt[n>>1])};case 4:return r?function(n){return this.fromWireType(W[n>>2])}:function(n){return this.fromWireType(_[n>>2])};default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},ln=(t,e,r,n)=>{e=j(e);function a(){}a.values={},X(t,{name:e,constructor:a,fromWireType:function(o){return this.constructor.values[o]},toWireType:(o,u)=>u.value,argPackAdvance:q,readValueFromPointer:cn(e,r,n),destructorFunction:null}),Yt(e,a)},Xt=(t,e)=>{var r=rt[t];return r===void 0&&C(e+" has unknown type "+Pe(t)),r},dn=(t,e,r)=>{var n=Xt(t,"enum");e=j(e);var a=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:Lt(`${n.name}_${e}`,function(){})}});a.values[r]=o,a[e]=o},qt=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},fn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(ne[r>>2])};case 8:return function(r){return this.fromWireType(ae[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},hn=(t,e,r)=>{e=j(e),X(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:q,readValueFromPointer:fn(e,r),destructorFunction:null})},pn=(t,e,r,n,a,o,u)=>{var c=Gt(e,r);t=j(t),t=Ee(t),a=G(n,a),Yt(t,function(){Dt(`Cannot call ${t} due to unbound types`,c)},e-1),nt([],c,function(l){var f=[l[0],null].concat(l.slice(1));return Ce(t,Nt(t,f,null,a,o),e-1),[]})},mn=(t,e,r)=>{switch(e){case 1:return r?n=>V[n>>0]:n=>k[n>>0];case 2:return r?n=>ot[n>>1]:n=>dt[n>>1];case 4:return r?n=>W[n>>2]:n=>_[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},yn=(t,e,r,n,a)=>{e=j(e);var o=p=>p;if(n===0){var u=32-8*r;o=p=>p<<u>>>u}var c=e.includes("unsigned"),l=(p,y)=>{},f;c?f=function(p,y){return l(y,this.name),y>>>0}:f=function(p,y){return l(y,this.name),y},X(t,{name:e,fromWireType:o,toWireType:f,argPackAdvance:q,readValueFromPointer:mn(e,r,n!==0),destructorFunction:null})},vn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(u){var c=_[u>>2],l=_[u+4>>2];return new a(V.buffer,l,c)}r=j(r),X(t,{name:r,fromWireType:o,argPackAdvance:q,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},De=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,u=0;u<t.length;++u){var c=t.charCodeAt(u);if(c>=55296&&c<=57343){var l=t.charCodeAt(++u);c=65536+((c&1023)<<10)|l&1023}if(c<=127){if(r>=o)break;e[r++]=c}else if(c<=2047){if(r+1>=o)break;e[r++]=192|c>>6,e[r++]=128|c&63}else if(c<=65535){if(r+2>=o)break;e[r++]=224|c>>12,e[r++]=128|c>>6&63,e[r++]=128|c&63}else{if(r+3>=o)break;e[r++]=240|c>>18,e[r++]=128|c>>12&63,e[r++]=128|c>>6&63,e[r++]=128|c&63}}return e[r]=0,r-a},gn=(t,e,r)=>De(t,k,e,r),Se=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},Fe=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,wn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&Fe)return Fe.decode(t.subarray(e,a));for(var o="";e<a;){var u=t[e++];if(!(u&128)){o+=String.fromCharCode(u);continue}var c=t[e++]&63;if((u&224)==192){o+=String.fromCharCode((u&31)<<6|c);continue}var l=t[e++]&63;if((u&240)==224?u=(u&15)<<12|c<<6|l:u=(u&7)<<18|c<<12|l<<6|t[e++]&63,u<65536)o+=String.fromCharCode(u);else{var f=u-65536;o+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return o},Zt=(t,e)=>t?wn(k,t,e):"",$n=(t,e)=>{e=j(e);var r=e==="std::string";X(t,{name:e,fromWireType(n){var a=_[n>>2],o=n+4,u;if(r)for(var c=o,l=0;l<=a;++l){var f=o+l;if(l==a||k[f]==0){var p=f-c,y=Zt(c,p);u===void 0?u=y:(u+=String.fromCharCode(0),u+=y),c=f+1}}else{for(var g=new Array(a),l=0;l<a;++l)g[l]=String.fromCharCode(k[o+l]);u=g.join("")}return Q(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||C("Cannot pass non-string to std::string"),r&&u?o=Se(a):o=a.length;var c=Qt(4+o+1),l=c+4;if(_[c>>2]=o,r&&u)gn(a,l,o+1);else if(u)for(var f=0;f<o;++f){var p=a.charCodeAt(f);p>255&&(Q(l),C("String has UTF-16 code units that do not fit in 8 bits")),k[l+f]=p}else for(var f=0;f<o;++f)k[l+f]=a[f];return n!==null&&n.push(Q,c),c},argPackAdvance:q,readValueFromPointer:be,destructorFunction(n){Q(n)}})},xe=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,bn=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&dt[n];)++n;if(r=n<<1,r-t>32&&xe)return xe.decode(k.subarray(t,r));for(var o="",u=0;!(u>=e/2);++u){var c=ot[t+u*2>>1];if(c==0)break;o+=String.fromCharCode(c)}return o},Cn=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<2)return 0;r-=2;for(var n=e,a=r<t.length*2?r/2:t.length,o=0;o<a;++o){var u=t.charCodeAt(o);ot[e>>1]=u,e+=2}return ot[e>>1]=0,e-n},_n=t=>t.length*2,Tn=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=W[t+r*4>>2];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},Pn=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,o=0;o<t.length;++o){var u=t.charCodeAt(o);if(u>=55296&&u<=57343){var c=t.charCodeAt(++o);u=65536+((u&1023)<<10)|c&1023}if(W[e>>2]=u,e+=4,e+4>a)break}return W[e>>2]=0,e-n},En=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},An=(t,e,r)=>{r=j(r);var n,a,o,u,c;e===2?(n=bn,a=Cn,u=_n,o=()=>dt,c=1):e===4&&(n=Tn,a=Pn,u=En,o=()=>_,c=2),X(t,{name:r,fromWireType:l=>{for(var f=_[l>>2],p=o(),y,g=l+4,b=0;b<=f;++b){var T=l+4+b*e;if(b==f||p[T>>c]==0){var I=T-g,P=n(g,I);y===void 0?y=P:(y+=String.fromCharCode(0),y+=P),g=T+e}}return Q(l),y},toWireType:(l,f)=>{typeof f!="string"&&C(`Cannot pass non-string to C++ string type ${r}`);var p=u(f),y=Qt(4+p+e);return _[y>>2]=p>>c,a(f,y+4,p+e),l!==null&&l.push(Q,y),y},argPackAdvance:q,readValueFromPointer:Ht,destructorFunction(l){Q(l)}})},On=(t,e,r,n,a,o)=>{Ct[t]={name:j(e),rawConstructor:G(r,n),rawDestructor:G(a,o),fields:[]}},Dn=(t,e,r,n,a,o,u,c,l,f)=>{Ct[t].fields.push({fieldName:j(e),getterReturnType:r,getter:G(n,a),getterContext:o,setterArgumentType:u,setter:G(c,l),setterContext:f})},Sn=(t,e)=>{e=j(e),X(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},Fn={},xn=t=>{var e=Fn[t];return e===void 0?j(t):e},Me=()=>{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.")},Mn=t=>t===0?K.toHandle(Me()):(t=xn(t),K.toHandle(Me()[t])),jn=t=>{t>4&&(z.get(t).refcount+=1)},In=t=>{var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var u=Xt(_[n+o*4>>2],"parameter "+o);e[o+1]=u.readValueFromPointer(a),a+=u.argPackAdvance}var c=new(r.bind.apply(r,e));return K.toHandle(c)}},je={},Rn=(t,e,r,n)=>{t=K.toValue(t);var a=je[e];return a||(a=In(e),je[e]=a),a(t,r,n)},Wn=(t,e)=>{t=Xt(t,"_emval_take_value");var r=t.readValueFromPointer(e);return K.toHandle(r)},kn=()=>{ht("")},Hn=(t,e,r)=>k.copyWithin(t,e,e+r),Bn=()=>2147483648,Un=t=>{var e=tt.buffer,r=(t-e.byteLength+65535)/65536;try{return tt.grow(r),oe(),1}catch{}},Vn=t=>{var e=k.length;t>>>=0;var r=Bn();if(t>r)return!1;for(var n=(l,f)=>l+(f-l%f)%f,a=1;a<=4;a*=2){var o=e*(1+.2/a);o=Math.min(o,t+100663296);var u=Math.min(r,n(Math.max(t,o),65536)),c=Un(u);if(c)return!0}return!1},Jt={},Ln=()=>H||"./this.program",gt=()=>{if(!gt.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:Ln()};for(var r in Jt)Jt[r]===void 0?delete e[r]:e[r]=Jt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);gt.strings=n}return gt.strings},Yn=(t,e)=>{for(var r=0;r<t.length;++r)V[e++>>0]=t.charCodeAt(r);V[e>>0]=0},zn=(t,e)=>{var r=0;return gt().forEach((n,a)=>{var o=e+r;_[t+a*4>>2]=o,Yn(n,o),r+=n.length+1}),0},Gn=(t,e)=>{var r=gt();_[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),_[e>>2]=n,0},Nn=t=>t,St=t=>t%4===0&&(t%100!==0||t%400===0),Xn=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Ie=[31,29,31,30,31,30,31,31,30,31,30,31],Re=[31,28,31,30,31,30,31,31,30,31,30,31],qn=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=St(r.getFullYear()),a=r.getMonth(),o=(n?Ie:Re)[a];if(e>o-r.getDate())e-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+e),r}return r};function Zn(t,e,r){var n=r>0?r:Se(t)+1,a=new Array(n),o=De(t,a,0,a.length);return e&&(a.length=o),a}var Jn=(t,e)=>{V.set(t,e)},Qn=(t,e,r,n)=>{var a=_[n+40>>2],o={tm_sec:W[n>>2],tm_min:W[n+4>>2],tm_hour:W[n+8>>2],tm_mday:W[n+12>>2],tm_mon:W[n+16>>2],tm_year:W[n+20>>2],tm_wday:W[n+24>>2],tm_yday:W[n+28>>2],tm_isdst:W[n+32>>2],tm_gmtoff:W[n+36>>2],tm_zone:a?Zt(a):""},u=Zt(r),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in c)u=u.replace(new RegExp(l,"g"),c[l]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],p=["January","February","March","April","May","June","July","August","September","October","November","December"];function y(d,m,x){for(var M=typeof d=="number"?d.toString():d||"";M.length<m;)M=x[0]+M;return M}function g(d,m){return y(d,m,"0")}function b(d,m){function x(at){return at<0?-1:at>0?1:0}var M;return(M=x(d.getFullYear()-m.getFullYear()))===0&&(M=x(d.getMonth()-m.getMonth()))===0&&(M=x(d.getDate()-m.getDate())),M}function T(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function I(d){var m=qn(new Date(d.tm_year+1900,0,1),d.tm_yday),x=new Date(m.getFullYear(),0,4),M=new Date(m.getFullYear()+1,0,4),at=T(x),xt=T(M);return b(at,m)<=0?b(xt,m)<=0?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}var P={"%a":d=>f[d.tm_wday].substring(0,3),"%A":d=>f[d.tm_wday],"%b":d=>p[d.tm_mon].substring(0,3),"%B":d=>p[d.tm_mon],"%C":d=>{var m=d.tm_year+1900;return g(m/100|0,2)},"%d":d=>g(d.tm_mday,2),"%e":d=>y(d.tm_mday,2," "),"%g":d=>I(d).toString().substring(2),"%G":d=>I(d),"%H":d=>g(d.tm_hour,2),"%I":d=>{var m=d.tm_hour;return m==0?m=12:m>12&&(m-=12),g(m,2)},"%j":d=>g(d.tm_mday+Xn(St(d.tm_year+1900)?Ie:Re,d.tm_mon-1),3),"%m":d=>g(d.tm_mon+1,2),"%M":d=>g(d.tm_min,2),"%n":()=>`
3
+ `,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>g(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var m=d.tm_yday+7-d.tm_wday;return g(Math.floor(m/7),2)},"%V":d=>{var m=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&m++,m){if(m==53){var x=(d.tm_wday+371-d.tm_yday)%7;x!=4&&(x!=3||!St(d.tm_year))&&(m=1)}}else{m=52;var M=(d.tm_wday+7-d.tm_yday-1)%7;(M==4||M==5&&St(d.tm_year%400-1))&&m++}return g(m,2)},"%w":d=>d.tm_wday,"%W":d=>{var m=d.tm_yday+7-(d.tm_wday+6)%7;return g(Math.floor(m/7),2)},"%y":d=>(d.tm_year+1900).toString().substring(2),"%Y":d=>d.tm_year+1900,"%z":d=>{var m=d.tm_gmtoff,x=m>=0;return m=Math.abs(m)/60,m=m/60*100+m%60,(x?"+":"-")+("0000"+m).slice(-4)},"%Z":d=>d.tm_zone,"%%":()=>"%"};u=u.replace(/%%/g,"\0\0");for(var l in P)u.includes(l)&&(u=u.replace(new RegExp(l,"g"),P[l](o)));u=u.replace(/\0\0/g,"%");var R=Zn(u,!1);return R.length>e?0:(Jn(R,t),R.length-1)},Kn=(t,e,r,n,a)=>Qn(t,e,r,n);he=s.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Fr(),ut=s.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},Lr(),Hr(),Zr(),Te=s.UnboundTypeError=tn(Error,"UnboundTypeError"),an(),sn();var ta={s:$r,v:br,b:_r,g:Tr,q:Pr,I:Er,f:Ar,T:Or,d:Cr,ba:Dr,P:Sr,Y:Mr,aa:en,$:rn,w:nn,X:un,x:ln,h:dn,K:hn,L:pn,t:yn,n:vn,J:$n,C:An,A:On,ca:Dn,Z:Sn,ea:Oe,da:Mn,M:jn,V:Rn,_:Wn,B:kn,W:Hn,U:Vn,R:zn,S:Gn,D:ma,E:pa,m:ya,a:ea,e:oa,o:ua,k:aa,G:fa,u:la,F:ha,z:ga,O:$a,l:ia,j:sa,c:na,p:ra,H:da,r:va,i:ca,y:wa,N:Nn,Q:Kn},E=wr(),Q=s._free=t=>(Q=s._free=E.ha)(t),Qt=s._malloc=t=>(Qt=s._malloc=E.ia)(t),We=t=>(We=E.ka)(t);s.__embind_initialize_bindings=()=>(s.__embind_initialize_bindings=E.la)();var A=(t,e)=>(A=E.ma)(t,e),wt=t=>(wt=E.na)(t),S=()=>(S=E.oa)(),F=t=>(F=E.pa)(t),ke=t=>(ke=E.qa)(t),He=t=>(He=E.ra)(t),Be=(t,e,r)=>(Be=E.sa)(t,e,r),Ue=t=>(Ue=E.ta)(t);s.dynCall_viijii=(t,e,r,n,a,o,u)=>(s.dynCall_viijii=E.ua)(t,e,r,n,a,o,u);var Ve=s.dynCall_jiiii=(t,e,r,n,a)=>(Ve=s.dynCall_jiiii=E.va)(t,e,r,n,a);s.dynCall_iiiiij=(t,e,r,n,a,o,u)=>(s.dynCall_iiiiij=E.wa)(t,e,r,n,a,o,u),s.dynCall_iiiiijj=(t,e,r,n,a,o,u,c,l)=>(s.dynCall_iiiiijj=E.xa)(t,e,r,n,a,o,u,c,l),s.dynCall_iiiiiijj=(t,e,r,n,a,o,u,c,l,f)=>(s.dynCall_iiiiiijj=E.ya)(t,e,r,n,a,o,u,c,l,f);function ea(t,e){var r=S();try{return D(t)(e)}catch(n){if(F(r),n!==n+0)throw n;A(1,0)}}function ra(t,e,r,n){var a=S();try{D(t)(e,r,n)}catch(o){if(F(a),o!==o+0)throw o;A(1,0)}}function na(t,e,r){var n=S();try{D(t)(e,r)}catch(a){if(F(n),a!==a+0)throw a;A(1,0)}}function aa(t,e,r,n,a){var o=S();try{return D(t)(e,r,n,a)}catch(u){if(F(o),u!==u+0)throw u;A(1,0)}}function oa(t,e,r){var n=S();try{return D(t)(e,r)}catch(a){if(F(n),a!==a+0)throw a;A(1,0)}}function ia(t){var e=S();try{D(t)()}catch(r){if(F(e),r!==r+0)throw r;A(1,0)}}function sa(t,e){var r=S();try{D(t)(e)}catch(n){if(F(r),n!==n+0)throw n;A(1,0)}}function ua(t,e,r,n){var a=S();try{return D(t)(e,r,n)}catch(o){if(F(a),o!==o+0)throw o;A(1,0)}}function ca(t,e,r,n,a,o,u,c,l,f,p){var y=S();try{D(t)(e,r,n,a,o,u,c,l,f,p)}catch(g){if(F(y),g!==g+0)throw g;A(1,0)}}function la(t,e,r,n,a,o,u){var c=S();try{return D(t)(e,r,n,a,o,u)}catch(l){if(F(c),l!==l+0)throw l;A(1,0)}}function da(t,e,r,n,a){var o=S();try{D(t)(e,r,n,a)}catch(u){if(F(o),u!==u+0)throw u;A(1,0)}}function fa(t,e,r,n,a,o){var u=S();try{return D(t)(e,r,n,a,o)}catch(c){if(F(u),c!==c+0)throw c;A(1,0)}}function ha(t,e,r,n,a,o,u,c){var l=S();try{return D(t)(e,r,n,a,o,u,c)}catch(f){if(F(l),f!==f+0)throw f;A(1,0)}}function pa(t,e,r,n){var a=S();try{return D(t)(e,r,n)}catch(o){if(F(a),o!==o+0)throw o;A(1,0)}}function ma(t,e,r,n){var a=S();try{return D(t)(e,r,n)}catch(o){if(F(a),o!==o+0)throw o;A(1,0)}}function ya(t){var e=S();try{return D(t)()}catch(r){if(F(e),r!==r+0)throw r;A(1,0)}}function va(t,e,r,n,a,o,u,c){var l=S();try{D(t)(e,r,n,a,o,u,c)}catch(f){if(F(l),f!==f+0)throw f;A(1,0)}}function ga(t,e,r,n,a,o,u,c,l,f,p,y){var g=S();try{return D(t)(e,r,n,a,o,u,c,l,f,p,y)}catch(b){if(F(g),b!==b+0)throw b;A(1,0)}}function wa(t,e,r,n,a,o,u,c,l,f,p,y,g,b,T,I){var P=S();try{D(t)(e,r,n,a,o,u,c,l,f,p,y,g,b,T,I)}catch(R){if(F(P),R!==R+0)throw R;A(1,0)}}function $a(t,e,r,n,a){var o=S();try{return Ve(t,e,r,n,a)}catch(u){if(F(o),u!==u+0)throw u;A(1,0)}}var Ft;ft=function t(){Ft||Le(),Ft||(ft=t)};function Le(){if(et>0||(ur(),et>0))return;function t(){Ft||(Ft=!0,s.calledRun=!0,!lt&&(cr(),w(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),lr()))}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),t()},1)):t()}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return Le(),h.ready}})();function Ya(i){return re(jt,i)}function za(i){return Ua(jt,i)}async function Ga(i,h){return Va(jt,i,h)}async function Na(i,h){return La(jt,i,h)}const ee=new Map([["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["data_matrix","DataMatrix"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["pdf417","PDF417"],["qr_code","QRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"]]);function Xa(i){for(const[h,s]of ee)if(i===s)return h;return"unknown"}var ct;class qa extends EventTarget{constructor(s={}){var w;super();ze(this,ct,void 0);try{const v=(w=s==null?void 0:s.formats)==null?void 0:w.filter($=>$!=="unknown");if((v==null?void 0:v.length)===0)throw new TypeError("Hint option provided, but is empty.");v==null||v.forEach($=>{if(!Ne.includes($))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${$}' is not a valid enum value of type BarcodeFormat.`)}),Ge(this,ct,v??[]),Ya().then($=>{this.dispatchEvent(new CustomEvent("load",{detail:$}))}).catch($=>{this.dispatchEvent(new CustomEvent("error",{detail:$}))})}catch(v){throw Xe(v,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Ne.filter(s=>s!=="unknown")}async detect(s){try{const w=await Ea(s);if(w===null)return[];let v;try{ar(w)?v=await Ga(w,{tryHarder:!0,formats:Kt(this,ct).map($=>ee.get($))}):v=await Na(w,{tryHarder:!0,formats:Kt(this,ct).map($=>ee.get($))})}catch($){throw console.error($),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return v.map($=>{const{topLeft:{x:H,y:L},topRight:{x:B,y:O},bottomLeft:{x:Y,y:N},bottomRight:{x:U,y:Z}}=$.position,tt=Math.min(H,B,Y,U),lt=Math.min(L,O,N,Z),It=Math.max(H,B,Y,U),V=Math.max(L,O,N,Z);return{boundingBox:new DOMRectReadOnly(tt,lt,It-tt,V-lt),rawValue:$.text,format:Xa($.format),cornerPoints:[{x:H,y:L},{x:B,y:O},{x:U,y:Z},{x:Y,y:N}]}})}catch(w){throw Xe(w,"Failed to execute 'detect' on 'BarcodeDetector'")}}}ct=new WeakMap;exports.BarcodeDetector=qa;exports.setZXingModuleOverrides=za;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="dom-webcodecs" />
2
- import { ZXingModule } from "@sec-ant/zxing-wasm/reader";
2
+ import { type ZXingModule } from "zxing-wasm/reader";
3
3
  import { BARCODE_DETECTOR_FORMATS } from "./utils.js";
4
4
  export type BarcodeFormat = (typeof BARCODE_DETECTOR_FORMATS)[number];
5
5
  export interface BarcodeDetectorOptions {
@@ -32,4 +32,4 @@ export declare class BarcodeDetector extends EventTarget {
32
32
  static getSupportedFormats(): Promise<readonly BarcodeFormat[]>;
33
33
  detect(image: ImageBitmapSourceWebCodecs): Promise<DetectedBarcode[]>;
34
34
  }
35
- export { setZXingModuleOverrides } from "@sec-ant/zxing-wasm";
35
+ export { setZXingModuleOverrides } from "zxing-wasm/reader";