zwave-js-ui
Version:
Z-Wave Control Panel and MQTT Gateway
2 lines • 65.1 kB
JavaScript
import{y as di,_ as hi,c as ht,b as x,e as fi,h as cr,w as M,aX as ft,k as te,l as Ue,aY as mi,aZ as mt,F as vt,G as pt,H as Be,K as vi,M as pi,af as gi,i as ur,o as pe,W as yi,a_ as wi,f as $i,n as Ci,U as _i,V as bi,D as Ti,at as Si,a$ as Ei,t as Pi,O as Oi,L as Di,Y as xi,z as Qe}from"./index-DwzE-W2i.js";var mr=o=>{throw TypeError(o)},vr=(o,n,l)=>n.has(o)||mr("Cannot "+l),Ri=(o,n,l)=>(vr(o,n,"read from private field"),l?l.call(o):n.get(o)),Ai=(o,n,l)=>n.has(o)?mr("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(o):n.set(o,l),Mi=(o,n,l,f)=>(vr(o,n,"write to private field"),n.set(o,l),l);const dr=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataBarLimited","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function Vi(o){return o.join("|")}function Fi(o){const n=hr(o);let l=0,f=dr.length-1;for(;l<=f;){const s=Math.floor((l+f)/2),p=dr[s],g=hr(p);if(g===n)return p;g<n?l=s+1:f=s-1}return"None"}function hr(o){return o.toLowerCase().replace(/_-\[\]/g,"")}function ji(o,n){return o.Binarizer[n]}function Wi(o,n){return o.CharacterSet[n]}const ki=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Ii(o){return ki[o.value]}function Li(o,n){return o.EanAddOnSymbol[n]}function Hi(o,n){return o.TextMode[n]}const ge={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 pr(o,n){return{...n,formats:Vi(n.formats),binarizer:ji(o,n.binarizer),eanAddOnSymbol:Li(o,n.eanAddOnSymbol),textMode:Hi(o,n.textMode),characterSet:Wi(o,n.characterSet)}}function gr(o){return{...o,format:Fi(o.format),eccLevel:o.eccLevel,contentType:Ii(o.contentType)}}const Ui={locateFile:(o,n)=>{const l=o.match(/_(.+?)\.wasm$/);return l?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.3.4/dist/${l[1]}/${o}`:n+o}};let gt=new WeakMap;function wt(o,n){var l;const f=gt.get(o);if(f!=null&&f.modulePromise&&n===void 0)return f.modulePromise;const s=(l=f?.moduleOverrides)!=null?l:Ui,p=o({...s});return gt.set(o,{moduleOverrides:s,modulePromise:p}),p}function Bi(o,n){gt.set(o,{moduleOverrides:n})}async function Qi(o,n,l=ge){const f={...ge,...l},s=await wt(o),{size:p}=n,g=new Uint8Array(await n.arrayBuffer()),R=s._malloc(p);s.HEAPU8.set(g,R);const j=s.readBarcodesFromImage(R,p,pr(s,f));s._free(R);const V=[];for(let E=0;E<j.size();++E)V.push(gr(j.get(E)));return V}async function qi(o,n,l=ge){const f={...ge,...l},s=await wt(o),{data:p,width:g,height:R,data:{byteLength:j}}=n,V=s._malloc(j);s.HEAPU8.set(p,V);const E=s.readBarcodesFromPixmap(V,g,R,pr(s,f));s._free(V);const L=[];for(let $=0;$<E.size();++$)L.push(gr(E.get($)));return L}({...ge,formats:[...ge.formats]});var Ne=(()=>{var o,n=typeof document<"u"&&((o=document.currentScript)==null?void 0:o.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(l={}){var f,s=l,p,g,R=new Promise((e,t)=>{p=e,g=t}),j=typeof window=="object",V=typeof Bun<"u",E=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var L=Object.assign({},s),$="./this.program",P="";function Y(e){return s.locateFile?s.locateFile(e,P):P+e}var X,N;if(j||E||V){var q;E?P=self.location.href:typeof document<"u"&&((q=document.currentScript)===null||q===void 0?void 0:q.tagName.toUpperCase())==="SCRIPT"&&(P=document.currentScript.src),n&&(P=n),P.startsWith("blob:")?P="":P=P.substr(0,P.replace(/[?#].*/,"").lastIndexOf("/")+1),E&&(N=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),X=e=>fetch(e,{credentials:"same-origin"}).then(t=>t.ok?t.arrayBuffer():Promise.reject(new Error(t.status+" : "+t.url)))}var he=s.print||console.log.bind(console),G=s.printErr||console.error.bind(console);Object.assign(s,L),L=null,s.arguments&&s.arguments,s.thisProgram&&($=s.thisProgram);var z=s.wasmBinary,Se,$t=!1,J,B,fe,ye,se,A,Ct,_t;function bt(){var e=Se.buffer;s.HEAP8=J=new Int8Array(e),s.HEAP16=fe=new Int16Array(e),s.HEAPU8=B=new Uint8Array(e),s.HEAPU16=ye=new Uint16Array(e),s.HEAP32=se=new Int32Array(e),s.HEAPU32=A=new Uint32Array(e),s.HEAPF32=Ct=new Float32Array(e),s.HEAPF64=_t=new Float64Array(e)}var Tt=[],St=[],Et=[];function Or(){var e=s.preRun;e&&(typeof e=="function"&&(e=[e]),e.forEach(Rr)),Xe(Tt)}function Dr(){Xe(St)}function xr(){var e=s.postRun;e&&(typeof e=="function"&&(e=[e]),e.forEach(Mr)),Xe(Et)}function Rr(e){Tt.unshift(e)}function Ar(e){St.unshift(e)}function Mr(e){Et.unshift(e)}var le=0,we=null;function Vr(e){var t;le++,(t=s.monitorRunDependencies)===null||t===void 0||t.call(s,le)}function Fr(e){var t;if(le--,(t=s.monitorRunDependencies)===null||t===void 0||t.call(s,le),le==0&&we){var r=we;we=null,r()}}function Ge(e){var t;(t=s.onAbort)===null||t===void 0||t.call(s,e),e="Aborted("+e+")",G(e),$t=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw g(r),r}var jr="data:application/octet-stream;base64,",Pt=e=>e.startsWith(jr);function Wr(){var e="zxing_reader.wasm";return Pt(e)?e:Y(e)}var Ee;function Ot(e){if(e==Ee&&z)return new Uint8Array(z);if(N)return N(e);throw"both async and sync fetching of the wasm failed"}function kr(e){return z?Promise.resolve().then(()=>Ot(e)):X(e).then(t=>new Uint8Array(t),()=>Ot(e))}function Dt(e,t,r){return kr(e).then(a=>WebAssembly.instantiate(a,t)).then(r,a=>{G(`failed to asynchronously prepare wasm: ${a}`),Ge(a)})}function Ir(e,t,r,a){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Pt(t)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(i=>{var c=WebAssembly.instantiateStreaming(i,r);return c.then(a,function(d){return G(`wasm streaming compile failed: ${d}`),G("falling back to ArrayBuffer instantiation"),Dt(t,r,a)})}):Dt(t,r,a)}function Lr(){return{a:Dn}}function Hr(){var e,t=Lr();function r(i,c){return W=i.exports,Se=W.za,bt(),kt=W.Da,Ar(W.Aa),Fr(),W}Vr();function a(i){r(i.instance)}if(s.instantiateWasm)try{return s.instantiateWasm(t,r)}catch(i){G(`Module.instantiateWasm callback failed with error: ${i}`),g(i)}return(e=Ee)!==null&&e!==void 0||(Ee=Wr()),Ir(z,Ee,t,a).catch(g),{}}var Xe=e=>{e.forEach(t=>t(s))};s.noExitRuntime;var b=e=>Kt(e),T=()=>Zt(),Pe=[],Oe=0,Ur=e=>{var t=new Ke(e);return t.get_caught()||(t.set_caught(!0),Oe--),t.set_rethrown(!1),Pe.push(t),Jt(e),Gt(e)},re=0,Br=()=>{C(0,0);var e=Pe.pop();Yt(e.excPtr),re=0};class Ke{constructor(t){this.excPtr=t,this.ptr=t-24}set_type(t){A[this.ptr+4>>2]=t}get_type(){return A[this.ptr+4>>2]}set_destructor(t){A[this.ptr+8>>2]=t}get_destructor(){return A[this.ptr+8>>2]}set_caught(t){t=t?1:0,J[this.ptr+12]=t}get_caught(){return J[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,J[this.ptr+13]=t}get_rethrown(){return J[this.ptr+13]!=0}init(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r)}set_adjusted_ptr(t){A[this.ptr+16>>2]=t}get_adjusted_ptr(){return A[this.ptr+16>>2]}}var Qr=e=>{throw re||(re=e),re},De=e=>Xt(e),Ze=e=>{var t=re;if(!t)return De(0),0;var r=new Ke(t);r.set_adjusted_ptr(t);var a=r.get_type();if(!a)return De(0),t;for(var i of e){if(i===0||i===a)break;var c=r.ptr+16;if(er(i,a,c))return De(i),t}return De(a),t},qr=()=>Ze([]),zr=e=>Ze([e]),Nr=(e,t)=>Ze([e,t]),Gr=()=>{var e=Pe.pop();e||Ge("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(Pe.push(e),e.set_rethrown(!0),e.set_caught(!1),Oe++),re=t,re},Xr=(e,t,r)=>{var a=new Ke(e);throw a.init(t,r),re=e,Oe++,re},Kr=()=>Oe,Zr=()=>{Ge("")},xe={},Ye=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function $e(e){return this.fromWireType(A[e>>2])}var me={},ce={},Re={},xt,Ae=e=>{throw new xt(e)},ue=(e,t,r)=>{e.forEach(u=>Re[u]=t);function a(u){var h=r(u);h.length!==e.length&&Ae("Mismatched type converter count");for(var m=0;m<e.length;++m)K(e[m],h[m])}var i=new Array(t.length),c=[],d=0;t.forEach((u,h)=>{ce.hasOwnProperty(u)?i[h]=ce[u]:(c.push(u),me.hasOwnProperty(u)||(me[u]=[]),me[u].push(()=>{i[h]=ce[u],++d,d===c.length&&a(i)}))}),c.length===0&&a(i)},Yr=e=>{var t=xe[e];delete xe[e];var r=t.rawConstructor,a=t.rawDestructor,i=t.fields,c=i.map(d=>d.getterReturnType).concat(i.map(d=>d.setterArgumentType));ue([e],c,d=>{var u={};return i.forEach((h,m)=>{var v=h.fieldName,y=d[m],_=h.getter,D=h.getterContext,F=d[m+i.length],H=h.setter,k=h.setterContext;u[v]={read:I=>y.fromWireType(_(D,I)),write:(I,de)=>{var Q=[];H(k,I,F.toWireType(Q,de)),Ye(Q)}}}),[{name:t.name,fromWireType:h=>{var m={};for(var v in u)m[v]=u[v].read(h);return a(h),m},toWireType:(h,m)=>{for(var v in u)if(!(v in m))throw new TypeError(`Missing field: "${v}"`);var y=r();for(v in u)u[v].write(y,m[v]);return h!==null&&h.push(a,y),y},argPackAdvance:ee,readValueFromPointer:$e,destructorFunction:a}]})},Jr=(e,t,r,a,i)=>{},ea=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Rt=e},Rt,U=e=>{for(var t="",r=e;B[r];)t+=Rt[B[r++]];return t},ve,O=e=>{throw new ve(e)};function ta(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var a=t.name;if(e||O(`type "${a}" must have a positive integer typeid pointer`),ce.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;O(`Cannot register type '${a}' twice`)}if(ce[e]=t,delete Re[e],me.hasOwnProperty(e)){var i=me[e];delete me[e],i.forEach(c=>c())}}function K(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return ta(e,t,r)}var ee=8,ra=(e,t,r,a)=>{t=U(t),K(e,{name:t,fromWireType:function(i){return!!i},toWireType:function(i,c){return c?r:a},argPackAdvance:ee,readValueFromPointer:function(i){return this.fromWireType(B[i])},destructorFunction:null})},aa=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Je=e=>{function t(r){return r.$$.ptrType.registeredClass.name}O(t(e)+" instance already deleted")},et=!1,At=e=>{},na=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Mt=e=>{e.count.value-=1;var t=e.count.value===0;t&&na(e)},Vt=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var a=Vt(e,t,r.baseClass);return a===null?null:r.downcast(a)},Ft={},ia={},oa=(e,t)=>{for(t===void 0&&O("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},sa=(e,t)=>(t=oa(e,t),ia[t]),Me=(e,t)=>{(!t.ptrType||!t.ptr)&&Ae("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,a=!!t.smartPtr;return r!==a&&Ae("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Ce(Object.create(e,{$$:{value:t,writable:!0}}))};function la(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=sa(this.registeredClass,t);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var a=r.clone();return this.destructor(e),a}function i(){return this.isSmartPointer?Me(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Me(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var c=this.registeredClass.getActualType(t),d=Ft[c];if(!d)return i.call(this);var u;this.isConst?u=d.constPointerType:u=d.pointerType;var h=Vt(t,this.registeredClass,u.registeredClass);return h===null?i.call(this):this.isSmartPointer?Me(u.registeredClass.instancePrototype,{ptrType:u,ptr:h,smartPtrType:this,smartPtr:e}):Me(u.registeredClass.instancePrototype,{ptrType:u,ptr:h})}var Ce=e=>typeof FinalizationRegistry>"u"?(Ce=t=>t,e):(et=new FinalizationRegistry(t=>{Mt(t.$$)}),Ce=t=>{var r=t.$$,a=!!r.smartPtr;if(a){var i={$$:r};et.register(t,i,t)}return t},At=t=>et.unregister(t),Ce(e)),ca=()=>{Object.assign(Ve.prototype,{isAliasOf(e){if(!(this instanceof Ve)||!(e instanceof Ve))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var a=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;a.baseClass;)i=a.upcast(i),a=a.baseClass;return t===a&&r===i},clone(){if(this.$$.ptr||Je(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Ce(Object.create(Object.getPrototypeOf(this),{$$:{value:aa(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Je(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&O("Object already scheduled for deletion"),At(this),Mt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Je(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&O("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}})};function Ve(){}var _e=(e,t)=>Object.defineProperty(t,"name",{value:e}),jt=(e,t,r)=>{if(e[t].overloadTable===void 0){var a=e[t];e[t]=function(){for(var i=arguments.length,c=new Array(i),d=0;d<i;d++)c[d]=arguments[d];return e[t].overloadTable.hasOwnProperty(c.length)||O(`Function '${r}' called with an invalid number of arguments (${c.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[c.length].apply(this,c)},e[t].overloadTable=[],e[t].overloadTable[a.argCount]=a}},tt=(e,t,r)=>{s.hasOwnProperty(e)?((r===void 0||s[e].overloadTable!==void 0&&s[e].overloadTable[r]!==void 0)&&O(`Cannot register public name '${e}' twice`),jt(s,e,e),s.hasOwnProperty(r)&&O(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),s[e].overloadTable[r]=t):(s[e]=t,r!==void 0&&(s[e].numArguments=r))},ua=48,da=57,ha=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=ua&&t<=da?`_${e}`:e};function fa(e,t,r,a,i,c,d,u){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=a,this.baseClass=i,this.getActualType=c,this.upcast=d,this.downcast=u,this.pureVirtualFunctions=[]}var rt=(e,t,r)=>{for(;t!==r;)t.upcast||O(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function ma(e,t){if(t===null)return this.isReference&&O(`null is not a valid ${this.name}`),0;t.$$||O(`Cannot pass "${lt(t)}" as a ${this.name}`),t.$$.ptr||O(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass,a=rt(t.$$.ptr,r,this.registeredClass);return a}function va(e,t){var r;if(t===null)return this.isReference&&O(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&O(`Cannot pass "${lt(t)}" as a ${this.name}`),t.$$.ptr||O(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&O(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var a=t.$$.ptrType.registeredClass;if(r=rt(t.$$.ptr,a,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&O("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:O(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var i=t.clone();r=this.rawShare(r,ne.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:O("Unsupporting sharing policy")}return r}function pa(e,t){if(t===null)return this.isReference&&O(`null is not a valid ${this.name}`),0;t.$$||O(`Cannot pass "${lt(t)}" as a ${this.name}`),t.$$.ptr||O(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&O(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass,a=rt(t.$$.ptr,r,this.registeredClass);return a}var ga=()=>{Object.assign(Fe.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t;(t=this.rawDestructor)===null||t===void 0||t.call(this,e)},argPackAdvance:ee,readValueFromPointer:$e,fromWireType:la})};function Fe(e,t,r,a,i,c,d,u,h,m,v){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=a,this.isSmartPointer=i,this.pointeeType=c,this.sharingPolicy=d,this.rawGetPointee=u,this.rawConstructor=h,this.rawShare=m,this.rawDestructor=v,!i&&t.baseClass===void 0?a?(this.toWireType=ma,this.destructorFunction=null):(this.toWireType=pa,this.destructorFunction=null):this.toWireType=va}var Wt=(e,t,r)=>{s.hasOwnProperty(e)||Ae("Replacing nonexistent public symbol"),s[e].overloadTable!==void 0&&r!==void 0?s[e].overloadTable[r]=t:(s[e]=t,s[e].argCount=r)},ya=(e,t,r)=>{e=e.replace(/p/g,"i");var a=s["dynCall_"+e];return a(t,...r)},je=[],kt,S=e=>{var t=je[e];return t||(e>=je.length&&(je.length=e+1),je[e]=t=kt.get(e)),t},wa=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.includes("j"))return ya(e,t,r);var a=S(t)(...r);return a},$a=(e,t)=>function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return wa(e,t,a)},Z=(e,t)=>{e=U(e);function r(){return e.includes("j")?$a(e,t):S(t)}var a=r();return typeof a!="function"&&O(`unknown function pointer with signature ${e}: ${t}`),a},Ca=(e,t)=>{var r=_e(t,function(a){this.name=t,this.message=a;var i=new Error(a).stack;i!==void 0&&(this.stack=this.toString()+`
`+i.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},It,Lt=e=>{var t=Nt(e),r=U(t);return ie(t),r},We=(e,t)=>{var r=[],a={};function i(c){if(!a[c]&&!ce[c]){if(Re[c]){Re[c].forEach(i);return}r.push(c),a[c]=!0}}throw t.forEach(i),new It(`${e}: `+r.map(Lt).join([", "]))},_a=(e,t,r,a,i,c,d,u,h,m,v,y,_)=>{v=U(v),c=Z(i,c),u&&(u=Z(d,u)),m&&(m=Z(h,m)),_=Z(y,_);var D=ha(v);tt(D,function(){We(`Cannot construct ${v} due to unbound types`,[a])}),ue([e,t,r],a?[a]:[],F=>{F=F[0];var H,k;a?(H=F.registeredClass,k=H.instancePrototype):k=Ve.prototype;var I=_e(v,function(){if(Object.getPrototypeOf(this)!==de)throw new ve("Use 'new' to construct "+v);if(Q.constructor_body===void 0)throw new ve(v+" has no accessible constructor");for(var sr=arguments.length,Le=new Array(sr),He=0;He<sr;He++)Le[He]=arguments[He];var lr=Q.constructor_body[Le.length];if(lr===void 0)throw new ve(`Tried to invoke ctor of ${v} with invalid number of parameters (${Le.length}) - expected (${Object.keys(Q.constructor_body).toString()}) parameters instead!`);return lr.apply(this,Le)}),de=Object.create(k,{constructor:{value:I}});I.prototype=de;var Q=new fa(v,I,de,_,H,c,u,m);if(Q.baseClass){var oe,Ie;(Ie=(oe=Q.baseClass).__derivedClasses)!==null&&Ie!==void 0||(oe.__derivedClasses=[]),Q.baseClass.__derivedClasses.push(Q)}var ui=new Fe(v,Q,!0,!1,!1),ir=new Fe(v+"*",Q,!1,!1,!1),or=new Fe(v+" const*",Q,!1,!0,!1);return Ft[e]={pointerType:ir,constPointerType:or},Wt(D,I),[ui,ir,or]})},at=(e,t)=>{for(var r=[],a=0;a<e;a++)r.push(A[t+a*4>>2]);return r};function ba(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function nt(e,t,r,a,i,c){var d=t.length;d<2&&O("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=t[1]!==null&&r!==null,h=ba(t),m=t[0].name!=="void",v=d-2,y=new Array(v),_=[],D=[],F=function(){D.length=0;var H;_.length=u?2:1,_[0]=i,u&&(H=t[1].toWireType(D,this),_[1]=H);for(var k=0;k<v;++k)y[k]=t[k+2].toWireType(D,k<0||arguments.length<=k?void 0:arguments[k]),_.push(y[k]);var I=a(..._);function de(Q){if(h)Ye(D);else for(var oe=u?1:2;oe<t.length;oe++){var Ie=oe===1?H:y[oe-2];t[oe].destructorFunction!==null&&t[oe].destructorFunction(Ie)}if(m)return t[0].fromWireType(Q)}return de(I)};return _e(e,F)}var Ta=(e,t,r,a,i,c)=>{var d=at(t,r);i=Z(a,i),ue([],[e],u=>{u=u[0];var h=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[t-1]!==void 0)throw new ve(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.registeredClass.constructor_body[t-1]=()=>{We(`Cannot construct ${u.name} due to unbound types`,d)},ue([],d,m=>(m.splice(1,0,null),u.registeredClass.constructor_body[t-1]=nt(h,m,null,i,c),[])),[]})},Ht=e=>{e=e.trim();const t=e.indexOf("(");return t!==-1?e.substr(0,t):e},Sa=(e,t,r,a,i,c,d,u,h,m)=>{var v=at(r,a);t=U(t),t=Ht(t),c=Z(i,c),ue([],[e],y=>{y=y[0];var _=`${y.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),u&&y.registeredClass.pureVirtualFunctions.push(t);function D(){We(`Cannot call ${_} due to unbound types`,v)}var F=y.registeredClass.instancePrototype,H=F[t];return H===void 0||H.overloadTable===void 0&&H.className!==y.name&&H.argCount===r-2?(D.argCount=r-2,D.className=y.name,F[t]=D):(jt(F,t,_),F[t].overloadTable[r-2]=D),ue([],v,k=>{var I=nt(_,k,y,c,d);return F[t].overloadTable===void 0?(I.argCount=r-2,F[t]=I):F[t].overloadTable[r-2]=I,[]}),[]})},it=[],ae=[],ot=e=>{e>9&&--ae[e+1]===0&&(ae[e]=void 0,it.push(e))},Ea=()=>ae.length/2-5-it.length,Pa=()=>{ae.push(0,1,void 0,1,null,1,!0,1,!1,1),s.count_emval_handles=Ea},ne={toValue:e=>(e||O("Cannot use deleted val. handle = "+e),ae[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=it.pop()||ae.length;return ae[t]=e,ae[t+1]=1,t}}}},Ut={name:"emscripten::val",fromWireType:e=>{var t=ne.toValue(e);return ot(e),t},toWireType:(e,t)=>ne.toHandle(t),argPackAdvance:ee,readValueFromPointer:$e,destructorFunction:null},Oa=e=>K(e,Ut),Da=(e,t,r)=>{switch(t){case 1:return r?function(a){return this.fromWireType(J[a])}:function(a){return this.fromWireType(B[a])};case 2:return r?function(a){return this.fromWireType(fe[a>>1])}:function(a){return this.fromWireType(ye[a>>1])};case 4:return r?function(a){return this.fromWireType(se[a>>2])}:function(a){return this.fromWireType(A[a>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},xa=(e,t,r,a)=>{t=U(t);function i(){}i.values={},K(e,{name:t,constructor:i,fromWireType:function(c){return this.constructor.values[c]},toWireType:(c,d)=>d.value,argPackAdvance:ee,readValueFromPointer:Da(t,r,a),destructorFunction:null}),tt(t,i)},st=(e,t)=>{var r=ce[e];return r===void 0&&O(`${t} has unknown type ${Lt(e)}`),r},Ra=(e,t,r)=>{var a=st(e,"enum");t=U(t);var i=a.constructor,c=Object.create(a.constructor.prototype,{value:{value:r},constructor:{value:_e(`${a.name}_${t}`,function(){})}});i.values[r]=c,i[t]=c},lt=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},Aa=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(Ct[r>>2])};case 8:return function(r){return this.fromWireType(_t[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Ma=(e,t,r)=>{t=U(t),K(e,{name:t,fromWireType:a=>a,toWireType:(a,i)=>i,argPackAdvance:ee,readValueFromPointer:Aa(t,r),destructorFunction:null})},Va=(e,t,r,a,i,c,d,u)=>{var h=at(t,r);e=U(e),e=Ht(e),i=Z(a,i),tt(e,function(){We(`Cannot call ${e} due to unbound types`,h)},t-1),ue([],h,m=>{var v=[m[0],null].concat(m.slice(1));return Wt(e,nt(e,v,null,i,c),t-1),[]})},Fa=(e,t,r)=>{switch(t){case 1:return r?a=>J[a]:a=>B[a];case 2:return r?a=>fe[a>>1]:a=>ye[a>>1];case 4:return r?a=>se[a>>2]:a=>A[a>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},ja=(e,t,r,a,i)=>{t=U(t);var c=v=>v;if(a===0){var d=32-8*r;c=v=>v<<d>>>d}var u=t.includes("unsigned"),h=(v,y)=>{},m;u?m=function(v,y){return h(y,this.name),y>>>0}:m=function(v,y){return h(y,this.name),y},K(e,{name:t,fromWireType:c,toWireType:m,argPackAdvance:ee,readValueFromPointer:Fa(t,r,a!==0),destructorFunction:null})},Wa=(e,t,r)=>{var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],i=a[t];function c(d){var u=A[d>>2],h=A[d+4>>2];return new i(J.buffer,h,u)}r=U(r),K(e,{name:r,fromWireType:c,argPackAdvance:ee,readValueFromPointer:c},{ignoreDuplicateRegistrations:!0})},ka=Object.assign({optional:!0},Ut),Ia=(e,t)=>{K(e,ka)},La=(e,t,r,a)=>{if(!(a>0))return 0;for(var i=r,c=r+a-1,d=0;d<e.length;++d){var u=e.charCodeAt(d);if(u>=55296&&u<=57343){var h=e.charCodeAt(++d);u=65536+((u&1023)<<10)|h&1023}if(u<=127){if(r>=c)break;t[r++]=u}else if(u<=2047){if(r+1>=c)break;t[r++]=192|u>>6,t[r++]=128|u&63}else if(u<=65535){if(r+2>=c)break;t[r++]=224|u>>12,t[r++]=128|u>>6&63,t[r++]=128|u&63}else{if(r+3>=c)break;t[r++]=240|u>>18,t[r++]=128|u>>12&63,t[r++]=128|u>>6&63,t[r++]=128|u&63}}return t[r]=0,r-i},be=(e,t,r)=>La(e,B,t,r),Ha=e=>{for(var t=0,r=0;r<e.length;++r){var a=e.charCodeAt(r);a<=127?t++:a<=2047?t+=2:a>=55296&&a<=57343?(t+=4,++r):t+=3}return t},Bt=typeof TextDecoder<"u"?new TextDecoder:void 0,Qt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var a=t+r,i=t;e[i]&&!(i>=a);)++i;if(i-t>16&&e.buffer&&Bt)return Bt.decode(e.subarray(t,i));for(var c="";t<i;){var d=e[t++];if(!(d&128)){c+=String.fromCharCode(d);continue}var u=e[t++]&63;if((d&224)==192){c+=String.fromCharCode((d&31)<<6|u);continue}var h=e[t++]&63;if((d&240)==224?d=(d&15)<<12|u<<6|h:d=(d&7)<<18|u<<12|h<<6|e[t++]&63,d<65536)c+=String.fromCharCode(d);else{var m=d-65536;c+=String.fromCharCode(55296|m>>10,56320|m&1023)}}return c},Ua=(e,t)=>e?Qt(B,e,t):"",Ba=(e,t)=>{t=U(t);var r=t==="std::string";K(e,{name:t,fromWireType(a){var i=A[a>>2],c=a+4,d;if(r)for(var u=c,h=0;h<=i;++h){var m=c+h;if(h==i||B[m]==0){var v=m-u,y=Ua(u,v);d===void 0?d=y:(d+="\0",d+=y),u=m+1}}else{for(var _=new Array(i),h=0;h<i;++h)_[h]=String.fromCharCode(B[c+h]);d=_.join("")}return ie(a),d},toWireType(a,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var c,d=typeof i=="string";d||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array||O("Cannot pass non-string to std::string"),r&&d?c=Ha(i):c=i.length;var u=dt(4+c+1),h=u+4;if(A[u>>2]=c,r&&d)be(i,h,c+1);else if(d)for(var m=0;m<c;++m){var v=i.charCodeAt(m);v>255&&(ie(h),O("String has UTF-16 code units that do not fit in 8 bits")),B[h+m]=v}else for(var m=0;m<c;++m)B[h+m]=i[m];return a!==null&&a.push(ie,u),u},argPackAdvance:ee,readValueFromPointer:$e,destructorFunction(a){ie(a)}})},qt=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Qa=(e,t)=>{for(var r=e,a=r>>1,i=a+t/2;!(a>=i)&&ye[a];)++a;if(r=a<<1,r-e>32&&qt)return qt.decode(B.subarray(e,r));for(var c="",d=0;!(d>=t/2);++d){var u=fe[e+d*2>>1];if(u==0)break;c+=String.fromCharCode(u)}return c},qa=(e,t,r)=>{var a;if((a=r)!==null&&a!==void 0||(r=2147483647),r<2)return 0;r-=2;for(var i=t,c=r<e.length*2?r/2:e.length,d=0;d<c;++d){var u=e.charCodeAt(d);fe[t>>1]=u,t+=2}return fe[t>>1]=0,t-i},za=e=>e.length*2,Na=(e,t)=>{for(var r=0,a="";!(r>=t/4);){var i=se[e+r*4>>2];if(i==0)break;if(++r,i>=65536){var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|c&1023)}else a+=String.fromCharCode(i)}return a},Ga=(e,t,r)=>{var a;if((a=r)!==null&&a!==void 0||(r=2147483647),r<4)return 0;for(var i=t,c=i+r-4,d=0;d<e.length;++d){var u=e.charCodeAt(d);if(u>=55296&&u<=57343){var h=e.charCodeAt(++d);u=65536+((u&1023)<<10)|h&1023}if(se[t>>2]=u,t+=4,t+4>c)break}return se[t>>2]=0,t-i},Xa=e=>{for(var t=0,r=0;r<e.length;++r){var a=e.charCodeAt(r);a>=55296&&a<=57343&&++r,t+=4}return t},Ka=(e,t,r)=>{r=U(r);var a,i,c,d;t===2?(a=Qa,i=qa,d=za,c=u=>ye[u>>1]):t===4&&(a=Na,i=Ga,d=Xa,c=u=>A[u>>2]),K(e,{name:r,fromWireType:u=>{for(var h=A[u>>2],m,v=u+4,y=0;y<=h;++y){var _=u+4+y*t;if(y==h||c(_)==0){var D=_-v,F=a(v,D);m===void 0?m=F:(m+="\0",m+=F),v=_+t}}return ie(u),m},toWireType:(u,h)=>{typeof h!="string"&&O(`Cannot pass non-string to C++ string type ${r}`);var m=d(h),v=dt(4+m+t);return A[v>>2]=m/t,i(h,v+4,m+t),u!==null&&u.push(ie,v),v},argPackAdvance:ee,readValueFromPointer:$e,destructorFunction(u){ie(u)}})},Za=(e,t,r,a,i,c)=>{xe[e]={name:U(t),rawConstructor:Z(r,a),rawDestructor:Z(i,c),fields:[]}},Ya=(e,t,r,a,i,c,d,u,h,m)=>{xe[e].fields.push({fieldName:U(t),getterReturnType:r,getter:Z(a,i),getterContext:c,setterArgumentType:d,setter:Z(u,h),setterContext:m})},Ja=(e,t)=>{t=U(t),K(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,a)=>{}})},en=(e,t,r)=>B.copyWithin(e,t,t+r),ct=[],tn=(e,t,r,a)=>(e=ct[e],t=ne.toValue(t),e(null,t,r,a)),rn={},an=e=>{var t=rn[e];return t===void 0?U(e):t},zt=()=>{if(typeof globalThis=="object")return globalThis;function e(t){t.$$$embind_global$$$=t;var r=typeof $$$embind_global$$$=="object"&&t.$$$embind_global$$$==t;return r||delete t.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&e(global)?$$$embind_global$$$=global:typeof self=="object"&&e(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},nn=e=>e===0?ne.toHandle(zt()):(e=an(e),ne.toHandle(zt()[e])),on=e=>{var t=ct.length;return ct.push(e),t},sn=(e,t)=>{for(var r=new Array(e),a=0;a<e;++a)r[a]=st(A[t+a*4>>2],"parameter "+a);return r},ln=Reflect.construct,cn=(e,t,r)=>{var a=[],i=e.toWireType(a,r);return a.length&&(A[t>>2]=ne.toHandle(a)),i},un=(e,t,r)=>{var a=sn(e,t),i=a.shift();e--;var c=new Array(e),d=(h,m,v,y)=>{for(var _=0,D=0;D<e;++D)c[D]=a[D].readValueFromPointer(y+_),_+=a[D].argPackAdvance;var F=r===1?ln(m,c):m.apply(h,c);return cn(i,v,F)},u=`methodCaller<(${a.map(h=>h.name).join(", ")}) => ${i.name}>`;return on(_e(u,d))},dn=e=>{e>9&&(ae[e+1]+=1)},hn=e=>{var t=ne.toValue(e);Ye(t),ot(e)},fn=(e,t)=>{e=st(e,"_emval_take_value");var r=e.readValueFromPointer(t);return ne.toHandle(r)},mn=(e,t,r,a)=>{var i=new Date().getFullYear(),c=new Date(i,0,1),d=new Date(i,6,1),u=c.getTimezoneOffset(),h=d.getTimezoneOffset(),m=Math.max(u,h);A[e>>2]=m*60,se[t>>2]=+(u!=h);var v=D=>{var F=D>=0?"-":"+",H=Math.abs(D),k=String(Math.floor(H/60)).padStart(2,"0"),I=String(H%60).padStart(2,"0");return`UTC${F}${k}${I}`},y=v(u),_=v(h);h<u?(be(y,r,17),be(_,a,17)):(be(y,a,17),be(_,r,17))},vn=()=>2147483648,pn=(e,t)=>Math.ceil(e/t)*t,gn=e=>{var t=Se.buffer,r=(e-t.byteLength+65535)/65536|0;try{return Se.grow(r),bt(),1}catch{}},yn=e=>{var t=B.length;e>>>=0;var r=vn();if(e>r)return!1;for(var a=1;a<=4;a*=2){var i=t*(1+.2/a);i=Math.min(i,e+100663296);var c=Math.min(r,pn(Math.max(e,i),65536)),d=gn(c);if(d)return!0}return!1},ut={},wn=()=>$||"./this.program",Te=()=>{if(!Te.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:wn()};for(var r in ut)ut[r]===void 0?delete t[r]:t[r]=ut[r];var a=[];for(var r in t)a.push(`${r}=${t[r]}`);Te.strings=a}return Te.strings},$n=(e,t)=>{for(var r=0;r<e.length;++r)J[t++]=e.charCodeAt(r);J[t]=0},Cn=(e,t)=>{var r=0;return Te().forEach((a,i)=>{var c=t+r;A[e+i*4>>2]=c,$n(a,c),r+=a.length+1}),0},_n=(e,t)=>{var r=Te();A[e>>2]=r.length;var a=0;return r.forEach(i=>a+=i.length+1),A[t>>2]=a,0},bn=e=>52;function Tn(e,t,r,a,i){return 70}var Sn=[null,[],[]],En=(e,t)=>{var r=Sn[e];t===0||t===10?((e===1?he:G)(Qt(r)),r.length=0):r.push(t)},Pn=(e,t,r,a)=>{for(var i=0,c=0;c<r;c++){var d=A[t>>2],u=A[t+4>>2];t+=8;for(var h=0;h<u;h++)En(e,B[d+h]);i+=u}return A[a>>2]=i,0},On=e=>e;xt=s.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},ea(),ve=s.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},ca(),ga(),It=s.UnboundTypeError=Ca(Error,"UnboundTypeError"),Pa();var Dn={t:Ur,x:Br,a:qr,j:zr,k:Nr,O:Gr,q:Xr,ga:Kr,d:Qr,ca:Zr,va:Yr,ba:Jr,pa:ra,ta:_a,sa:Ta,E:Sa,oa:Oa,F:xa,n:Ra,W:Ma,X:Va,y:ja,u:Wa,ua:Ia,V:Ba,P:Ka,L:Za,wa:Ya,qa:Ja,ja:en,T:tn,xa:ot,ya:nn,U:un,Y:dn,Z:hn,ra:fn,da:mn,ha:yn,ea:Cn,fa:_n,ia:bn,$:Tn,S:Pn,J:Kn,C:Yn,Q:Vn,R:ii,r:zn,b:xn,D:Xn,la:ei,c:jn,ka:ti,h:Mn,i:Ln,s:Hn,N:Gn,w:Bn,I:ai,K:Nn,z:Jn,H:oi,aa:li,_:ci,l:Wn,f:Fn,e:An,g:Rn,M:ni,m:In,ma:Zn,p:Un,v:Qn,na:qn,B:ri,o:kn,G:si,A:On},W=Hr(),Nt=e=>(Nt=W.Ba)(e),ie=s._free=e=>(ie=s._free=W.Ca)(e),dt=s._malloc=e=>(dt=s._malloc=W.Ea)(e),Gt=e=>(Gt=W.Fa)(e),C=(e,t)=>(C=W.Ga)(e,t),Xt=e=>(Xt=W.Ha)(e),Kt=e=>(Kt=W.Ia)(e),Zt=()=>(Zt=W.Ja)(),Yt=e=>(Yt=W.Ka)(e),Jt=e=>(Jt=W.La)(e),er=(e,t,r)=>(er=W.Ma)(e,t,r);s.dynCall_viijii=(e,t,r,a,i,c,d)=>(s.dynCall_viijii=W.Na)(e,t,r,a,i,c,d);var tr=s.dynCall_jiii=(e,t,r,a)=>(tr=s.dynCall_jiii=W.Oa)(e,t,r,a);s.dynCall_jiji=(e,t,r,a,i)=>(s.dynCall_jiji=W.Pa)(e,t,r,a,i);var rr=s.dynCall_jiiii=(e,t,r,a,i)=>(rr=s.dynCall_jiiii=W.Qa)(e,t,r,a,i);s.dynCall_iiiiij=(e,t,r,a,i,c,d)=>(s.dynCall_iiiiij=W.Ra)(e,t,r,a,i,c,d),s.dynCall_iiiiijj=(e,t,r,a,i,c,d,u,h)=>(s.dynCall_iiiiijj=W.Sa)(e,t,r,a,i,c,d,u,h),s.dynCall_iiiiiijj=(e,t,r,a,i,c,d,u,h,m)=>(s.dynCall_iiiiiijj=W.Ta)(e,t,r,a,i,c,d,u,h,m);function xn(e,t){var r=T();try{return S(e)(t)}catch(a){if(b(r),a!==a+0)throw a;C(1,0)}}function Rn(e,t,r,a){var i=T();try{S(e)(t,r,a)}catch(c){if(b(i),c!==c+0)throw c;C(1,0)}}function An(e,t,r){var a=T();try{S(e)(t,r)}catch(i){if(b(a),i!==i+0)throw i;C(1,0)}}function Mn(e,t,r,a){var i=T();try{return S(e)(t,r,a)}catch(c){if(b(i),c!==c+0)throw c;C(1,0)}}function Vn(e,t,r,a,i){var c=T();try{return S(e)(t,r,a,i)}catch(d){if(b(c),d!==d+0)throw d;C(1,0)}}function Fn(e,t){var r=T();try{S(e)(t)}catch(a){if(b(r),a!==a+0)throw a;C(1,0)}}function jn(e,t,r){var a=T();try{return S(e)(t,r)}catch(i){if(b(a),i!==i+0)throw i;C(1,0)}}function Wn(e){var t=T();try{S(e)()}catch(r){if(b(t),r!==r+0)throw r;C(1,0)}}function kn(e,t,r,a,i,c,d,u,h,m,v){var y=T();try{S(e)(t,r,a,i,c,d,u,h,m,v)}catch(_){if(b(y),_!==_+0)throw _;C(1,0)}}function In(e,t,r,a,i){var c=T();try{S(e)(t,r,a,i)}catch(d){if(b(c),d!==d+0)throw d;C(1,0)}}function Ln(e,t,r,a,i){var c=T();try{return S(e)(t,r,a,i)}catch(d){if(b(c),d!==d+0)throw d;C(1,0)}}function Hn(e,t,r,a,i,c){var d=T();try{return S(e)(t,r,a,i,c)}catch(u){if(b(d),u!==u+0)throw u;C(1,0)}}function Un(e,t,r,a,i,c){var d=T();try{S(e)(t,r,a,i,c)}catch(u){if(b(d),u!==u+0)throw u;C(1,0)}}function Bn(e,t,r,a,i,c,d){var u=T();try{return S(e)(t,r,a,i,c,d)}catch(h){if(b(u),h!==h+0)throw h;C(1,0)}}function Qn(e,t,r,a,i,c,d,u){var h=T();try{S(e)(t,r,a,i,c,d,u)}catch(m){if(b(h),m!==m+0)throw m;C(1,0)}}function qn(e,t,r,a,i,c,d,u,h){var m=T();try{S(e)(t,r,a,i,c,d,u,h)}catch(v){if(b(m),v!==v+0)throw v;C(1,0)}}function zn(e){var t=T();try{return S(e)()}catch(r){if(b(t),r!==r+0)throw r;C(1,0)}}function Nn(e,t,r,a,i,c,d,u,h){var m=T();try{return S(e)(t,r,a,i,c,d,u,h)}catch(v){if(b(m),v!==v+0)throw v;C(1,0)}}function Gn(e,t,r,a,i,c,d){var u=T();try{return S(e)(t,r,a,i,c,d)}catch(h){if(b(u),h!==h+0)throw h;C(1,0)}}function Xn(e,t,r,a){var i=T();try{return S(e)(t,r,a)}catch(c){if(b(i),c!==c+0)throw c;C(1,0)}}function Kn(e,t,r,a){var i=T();try{return S(e)(t,r,a)}catch(c){if(b(i),c!==c+0)throw c;C(1,0)}}function Zn(e,t,r,a,i,c,d,u){var h=T();try{S(e)(t,r,a,i,c,d,u)}catch(m){if(b(h),m!==m+0)throw m;C(1,0)}}function Yn(e,t,r,a,i,c){var d=T();try{return S(e)(t,r,a,i,c)}catch(u){if(b(d),u!==u+0)throw u;C(1,0)}}function Jn(e,t,r,a,i,c,d,u,h,m){var v=T();try{return S(e)(t,r,a,i,c,d,u,h,m)}catch(y){if(b(v),y!==y+0)throw y;C(1,0)}}function ei(e,t,r){var a=T();try{return S(e)(t,r)}catch(i){if(b(a),i!==i+0)throw i;C(1,0)}}function ti(e,t,r,a,i){var c=T();try{return S(e)(t,r,a,i)}catch(d){if(b(c),d!==d+0)throw d;C(1,0)}}function ri(e,t,r,a,i,c,d,u,h,m){var v=T();try{S(e)(t,r,a,i,c,d,u,h,m)}catch(y){if(b(v),y!==y+0)throw y;C(1,0)}}function ai(e,t,r,a,i,c,d,u){var h=T();try{return S(e)(t,r,a,i,c,d,u)}catch(m){if(b(h),m!==m+0)throw m;C(1,0)}}function ni(e,t,r,a,i,c,d){var u=T();try{S(e)(t,r,a,i,c,d)}catch(h){if(b(u),h!==h+0)throw h;C(1,0)}}function ii(e,t,r,a){var i=T();try{return S(e)(t,r,a)}catch(c){if(b(i),c!==c+0)throw c;C(1,0)}}function oi(e,t,r,a,i,c,d,u,h,m,v,y){var _=T();try{return S(e)(t,r,a,i,c,d,u,h,m,v,y)}catch(D){if(b(_),D!==D+0)throw D;C(1,0)}}function si(e,t,r,a,i,c,d,u,h,m,v,y,_,D,F,H){var k=T();try{S(e)(t,r,a,i,c,d,u,h,m,v,y,_,D,F,H)}catch(I){if(b(k),I!==I+0)throw I;C(1,0)}}function li(e,t,r,a){var i=T();try{return tr(e,t,r,a)}catch(c){if(b(i),c!==c+0)throw c;C(1,0)}}function ci(e,t,r,a,i){var c=T();try{return rr(e,t,r,a,i)}catch(d){if(b(c),d!==d+0)throw d;C(1,0)}}var ke,ar;we=function e(){ke||nr(),ke||(we=e)};function nr(){if(le>0||!ar&&(ar=1,Or(),le>0))return;function e(){var t;ke||(ke=1,s.calledRun=1,!$t&&(Dr(),p(s),(t=s.onRuntimeInitialized)===null||t===void 0||t.call(s),xr()))}s.setStatus?(s.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>s.setStatus(""),1),e()},1)):e()}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return nr(),f=R,f}})();function zi(o){return wt(Ne,o)}function Ni(o){return Bi(Ne,o)}async function Gi(o,n){return Qi(Ne,o,n)}async function Xi(o,n){return qi(Ne,o,n)}const yr=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"]],Ki=[...yr,["unknown"]].map(o=>o[0]),yt=new Map(yr);function Zi(o){for(const[n,l]of yt)if(o===l)return n;return"unknown"}function Yi(o){if(wr(o))return{width:o.naturalWidth,height:o.naturalHeight};if($r(o))return{width:o.width.baseVal.value,height:o.height.baseVal.value};if(Cr(o))return{width:o.videoWidth,height:o.videoHeight};if(br(o))return{width:o.width,height:o.height};if(Sr(o))return{width:o.displayWidth,height:o.displayHeight};if(_r(o))return{width:o.width,height:o.height};if(Tr(o))return{width:o.width,height:o.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function wr(o){var n,l;try{return o instanceof((l=(n=o?.ownerDocument)==null?void 0:n.defaultView)==null?void 0:l.HTMLImageElement)}catch{return!1}}function $r(o){var n,l;try{return o instanceof((l=(n=o?.ownerDocument)==null?void 0:n.defaultView)==null?void 0:l.SVGImageElement)}catch{return!1}}function Cr(o){var n,l;try{return o instanceof((l=(n=o?.ownerDocument)==null?void 0:n.defaultView)==null?void 0:l.HTMLVideoElement)}catch{return!1}}function _r(o){var n,l;try{return o instanceof((l=(n=o?.ownerDocument)==null?void 0:n.defaultView)==null?void 0:l.HTMLCanvasElement)}catch{return!1}}function br(o){try{return o instanceof ImageBitmap||Object.prototype.toString.call(o)==="[object ImageBitmap]"}catch{return!1}}function Tr(o){try{return o instanceof OffscreenCanvas||Object.prototype.toString.call(o)==="[object OffscreenCanvas]"}catch{return!1}}function Sr(o){try{return o instanceof VideoFrame||Object.prototype.toString.call(o)==="[object VideoFrame]"}catch{return!1}}function Er(o){try{return o instanceof Blob||Object.prototype.toString.call(o)==="[object Blob]"}catch{return!1}}function Ji(o){try{return o instanceof ImageData||Object.prototype.toString.call(o)==="[object ImageData]"}catch{return!1}}function eo(o,n){try{const l=new OffscreenCanvas(o,n);if(l.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return l;throw void 0}catch{const l=document.createElement("canvas");return l.width=o,l.height=n,l}}async function Pr(o){if(wr(o)&&!await no(o))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if($r(o)&&!await io(o))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(Sr(o)&&oo(o))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(Cr(o)&&(o.readyState===0||o.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(br(o)&&lo(o))throw new DOMException("The image source is detached.","InvalidStateError");const{width:n,height:l}=Yi(o);if(n===0||l===0)return null;const f=eo(n,l).getContext("2d");f.drawImage(o,0,0);try{return f.getImageData(0,0,n,l)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function to(o){let n;try{if(globalThis.createImageBitmap)n=await createImageBitmap(o);else if(globalThis.Image){n=new Image;let l="";try{l=URL.createObjectURL(o),n.src=l,await n.decode()}finally{URL.revokeObjectURL(l)}}else return o}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await Pr(n)}function ro(o){const{width:n,height:l}=o;if(n===0||l===0)return null;const f=o.getContext("2d");try{return f.getImageData(0,0,n,l)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function ao(o){if(Er(o))return await to(o);if(Ji(o)){if(so(o))throw new DOMException("The image data has been detached.","InvalidStateError");return o}return _r(o)||Tr(o)?ro(o):await Pr(o)}async function no(o){try{return await o.decode(),!0}catch{return!1}}async function io(o){var n;try{return await((n=o.decode)==null?void 0:n.call(o)),!0}catch{return!1}}function oo(o){return o.format===null}function so(o){return o.data.buffer.byteLength===0}function lo(o){return o.width===0&&o.height===0}function fr(o,n){return co(o)?new DOMException(`${n}: ${o.message}`,o.name):uo(o)?new o.constructor(`${n}: ${o.message}`):new Error(`${n}: ${o}`)}function co(o){return o instanceof DOMException||Object.prototype.toString.call(o)==="[object DOMException]"}function uo(o){return o instanceof Error||Object.prototype.toString.call(o)==="[object Error]"}var ze;class ho extends EventTarget{constructor(n={}){var l;super(),Ai(this,ze);try{const f=(l=n?.formats)==null?void 0:l.filter(s=>s!=="unknown");if(f?.length===0)throw new TypeError("Hint option provided, but is empty.");for(const s of f??[])if(!yt.has(s))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${s}' is not a valid enum value of type BarcodeFormat.`);Mi(this,ze,f??[]),zi().then(s=>{this.dispatchEvent(new CustomEvent("load",{detail:s}))}).catch(s=>{this.dispatchEvent(new CustomEvent("error",{detail:s}))})}catch(f){throw fr(f,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Ki.filter(n=>n!=="unknown")}async detect(n){try{const l=await ao(n);if(l===null)return[];let f;const s={tryHarder:!0,returnCodabarStartEnd:!0,formats:Ri(this,ze).map(p=>yt.get(p))};try{Er(l)?f=await Gi(l,s):f=await Xi(l,s)}catch(p){throw console.error(p),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return f.map(p=>{const{topLeft:{x:g,y:R},topRight:{x:j,y:V},bottomLeft:{x:E,y:L},bottomRight:{x:$,y:P}}=p.position,Y=Math.min(g,j,E,$),X=Math.min(R,V,L,P),N=Math.max(g,j,E,$),q=Math.max(R,V,L,P);return{boundingBox:new DOMRectReadOnly(Y,X,N-Y,q-X),rawValue:p.text,format:Zi(p.format),cornerPoints:[{x:g,y:R},{x:j,y:V},{x:$,y:P},{x:E,y:L}]}})}catch(l){throw fr(l,"Failed to execute 'detect' on 'BarcodeDetector'")}}}ze=new WeakMap;globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=ho);class w{constructor(n,l,f,s,p){this._legacyCanvasSize=w.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=n,this.$canvas=document.createElement("canvas"),f&&typeof f=="object"?this._onDecode=l:(console.warn(f||s||p?"You're using a deprecated version of the QrScanner constructor which will be removed in the future":"Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=l),l=typeof f=="object"?f:{},this._onDecodeError=l.onDecodeError||(typeof f=="function"?f:this._onDecodeError),this._calculateScanRegion=l.calculateScanRegion||(typeof s=="function"?s:this._calculateScanRegion),this._preferredCamera=l.preferredCamera||p||this._preferredCamera,this._legacyCanvasSize=typeof f=="number"?f:typeof s=="number"?s:this._legacyCanvasSize,this._maxScansPerSecond=l.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),n.disablePictureInPicture=!0,n.playsInline=!0,n.muted=!0;let g=!1;if(n.hidden&&(n.hidden=!1,g=!0),document.body.contains(n)||(document.body.appendChild(n),g=!0),f=n.parentElement,l.highlightScanRegion||l.highlightCodeOutline){if(s=!!l.overlay,this.$overlay=l.overlay||document.createElement("div"),p=this.$overlay.style,p.position="absolute",p.display="none",p.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!s&&l.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch{}f.insertBefore(this.$overlay,this.$video.nextSibling)}l.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(n),requestAnimationFrame(()=>{let R=window.getComputedStyle(n);R.display==="none"&&(n.style.setProperty("display","block","important"),g=!0),R.visibility!=="visible"&&(n.style.setProperty("visibility","visible","important"),g=!0),g&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),n.style.opacity="0",n.style.width="0",n.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),n.addEventListener("play",this._onPlay),n.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=w.createQrEngine()}static set WORKER_PATH(n){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await w.listCameras(!1)).length}catch{return!1}}static async listCameras(n=!1){if(!navigator.mediaDevices)return[];let l=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(s=>s.kind==="videoinput"),f;try{n&&(await l()).every(s=>!s.label)&&(f=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await l()).map((s,p)=>({id:s.deviceId,label:s.label||(p===0?"Default Camera":`Camera ${p+1}`)}))}finally{f&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),w._stopVideoStream(f))}}async hasFlash(){let n;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;n=this.$video.srcObject}else n=(await this._getCameraStream()).stream;return"torch"in n.getVideoTracks()[0].getSettings()}catch{return!1}finally{n&&n!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),w._stopVideoStream(n))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(n){throw this._flashOn=!1,n}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),w._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&(window.location.protocol!=="https:"&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:n,facingMode:l}=await this._getCameraStream();!this._active||this._paused?w._stopVideoStream(n):(this._setVideoMirror(l),this.$video.srcObject=n,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(n){if(!this._paused)throw this._active=!1,n}}stop(){this.pause(),this._active=!1}async pause(n=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),th