2FAuth/public/build/assets/Capture-x-RcmcHd.js
2024-11-27 12:03:02 +01:00

5 lines
74 KiB
JavaScript
Vendored

import{q as So,r as ne,s as Ve,o as Ir,v as Po,x as Ut,m as ue,d as ve,e as U,y as Eo,z as Ht,A as Wr,B as Oo,a as Mo,c as Do,j as pe,k as br,f as Z,h as xo,i as Cr,C as _r,F as Tr,D as Ao,E as ko,l as Lt,t as Se,n as $r,G as jo,U as Ro,p as Fo,H as Sr}from"./app-CzxRjCVM.js";import{F as Io}from"./Form-EFIuWKGI.js";import{S as Wo}from"./Spinner-C-V0HKYn.js";import{_ as Uo}from"./QrContentDisplay-C2fFtz-5.js";import{u as Lo}from"./bus-BNAtGMCo.js";/*! 2FAuth version 5.4.3 - Copyright (c) 2024 Bubka - https://github.com/Bubka/2FAuth */var Ur=(r,i,a)=>{if(!i.has(r))throw TypeError("Cannot "+a)},Pr=(r,i,a)=>(Ur(r,i,"read from private field"),a?a.call(r):i.get(r)),Ho=(r,i,a)=>{if(i.has(r))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(r):i.set(r,a)},No=(r,i,a,c)=>(Ur(r,i,"write to private field"),i.set(r,a),a);const Lr=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"]],Bo=[...Lr,["unknown"]].map(r=>r[0]),lt=new Map(Lr);function Vo(r){for(const[i,a]of lt)if(r===a)return i;return"unknown"}function zo(r){if(Hr(r))return{width:r.naturalWidth,height:r.naturalHeight};if(Nr(r))return{width:r.width.baseVal.value,height:r.height.baseVal.value};if(Br(r))return{width:r.videoWidth,height:r.videoHeight};if(zr(r))return{width:r.width,height:r.height};if(Jr(r))return{width:r.displayWidth,height:r.displayHeight};if(Vr(r))return{width:r.width,height:r.height};if(qr(r))return{width:r.width,height:r.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 Hr(r){try{return r instanceof HTMLImageElement}catch{return!1}}function Nr(r){try{return r instanceof SVGImageElement}catch{return!1}}function Br(r){try{return r instanceof HTMLVideoElement}catch{return!1}}function Vr(r){try{return r instanceof HTMLCanvasElement}catch{return!1}}function zr(r){try{return r instanceof ImageBitmap}catch{return!1}}function qr(r){try{return r instanceof OffscreenCanvas}catch{return!1}}function Jr(r){try{return r instanceof VideoFrame}catch{return!1}}function Gr(r){try{return r instanceof Blob}catch{return!1}}function qo(r){try{return r instanceof ImageData}catch{return!1}}function Jo(r,i){try{const a=new OffscreenCanvas(r,i);if(a.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return a;throw void 0}catch{const c=document.createElement("canvas");return c.width=r,c.height=i,c}}async function Yr(r){if(Hr(r)&&!await Xo(r))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Nr(r)&&!await Ko(r))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(Jr(r)&&Zo(r))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(Br(r)&&(r.readyState===0||r.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(zr(r)&&ti(r))throw new DOMException("The image source is detached.","InvalidStateError");const{width:i,height:a}=zo(r);if(i===0||a===0)return null;const c=Jo(i,a).getContext("2d");c.drawImage(r,0,0);try{return c.getImageData(0,0,i,a)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Go(r){let i;try{if(globalThis.createImageBitmap)i=await createImageBitmap(r);else if(globalThis.Image){i=new Image;let a="";try{a=URL.createObjectURL(r),i.src=a,await i.decode()}finally{URL.revokeObjectURL(a)}}else return r}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await Yr(i)}function Yo(r){const{width:i,height:a}=r;if(i===0||a===0)return null;const c=r.getContext("2d");try{return c.getImageData(0,0,i,a)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Qo(r){if(Gr(r))return await Go(r);if(qo(r)){if(ei(r))throw new DOMException("The image data has been detached.","InvalidStateError");return r}return Vr(r)||qr(r)?Yo(r):await Yr(r)}async function Xo(r){try{return await r.decode(),!0}catch{return!1}}async function Ko(r){var i;try{return await((i=r.decode)==null?void 0:i.call(r)),!0}catch{return!1}}function Zo(r){return r.format===null}function ei(r){return r.data.buffer.byteLength===0}function ti(r){return r.width===0&&r.height===0}function Er(r,i){return r instanceof DOMException?new DOMException(`${i}: ${r.message}`,r.name):r instanceof Error?new r.constructor(`${i}: ${r.message}`):new Error(`${i}: ${r}`)}const Or=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function ri(r){return r.join("|")}function ni(r){const i=Mr(r);let a=0,c=Or.length-1;for(;a<=c;){const f=Math.floor((a+c)/2),p=Or[f],v=Mr(p);if(v===i)return p;v<i?a=f+1:c=f-1}return"None"}function Mr(r){return r.toLowerCase().replace(/_-\[\]/g,"")}function ai(r,i){return r.Binarizer[i]}function oi(r,i){return r.CharacterSet[i]}const ii=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function si(r){return ii[r.value]}function ci(r,i){return r.EanAddOnSymbol[i]}function ui(r,i){return r.TextMode[i]}const ke={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 Qr(r,i){return{...i,formats:ri(i.formats),binarizer:ai(r,i.binarizer),eanAddOnSymbol:ci(r,i.eanAddOnSymbol),textMode:ui(r,i.textMode),characterSet:oi(r,i.characterSet)}}function Xr(r){return{...r,format:ni(r.format),eccLevel:r.eccLevel,contentType:si(r.contentType)}}const li={locateFile:(r,i)=>{const a=r.match(/_(.+?)\.wasm$/);return a?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.1.3/dist/${a[1]}/${r}`:i+r}};let Dr=new WeakMap;function Nt(r,i){var a;const c=Dr.get(r);if(c!=null&&c.modulePromise&&i===void 0)return c.modulePromise;const f=(a=c==null?void 0:c.moduleOverrides)!=null?a:li,p=r({...f});return Dr.set(r,{moduleOverrides:f,modulePromise:p}),p}async function di(r,i,a=ke){const c={...ke,...a},f=await Nt(r),{size:p}=i,v=new Uint8Array(await i.arrayBuffer()),C=f._malloc(p);f.HEAPU8.set(v,C);const h=f.readBarcodesFromImage(C,p,Qr(f,c));f._free(C);const w=[];for(let _=0;_<h.size();++_)w.push(Xr(h.get(_)));return w}async function fi(r,i,a=ke){const c={...ke,...a},f=await Nt(r),{data:p,width:v,height:C,data:{byteLength:h}}=i,w=f._malloc(h);f.HEAPU8.set(p,w);const _=f.readBarcodesFromPixmap(w,v,C,Qr(f,c));f._free(w);const b=[];for(let j=0;j<_.size();++j)b.push(Xr(_.get(j)));return b}({...ke,formats:[...ke.formats]});var Bt=(()=>{var r=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(i={}){var a=i,c,f;a.ready=new Promise((e,t)=>{c=e,f=t});var p=Object.assign({},a),v="./this.program",C=typeof window=="object",h=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var w="";function _(e){return a.locateFile?a.locateFile(e,w):w+e}var b;(C||h)&&(h?w=self.location.href:typeof document<"u"&&document.currentScript&&(w=document.currentScript.src),r&&(w=r),w.indexOf("blob:")!==0?w=w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+1):w="",h&&(b=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)})),a.print||console.log.bind(console);var j=a.printErr||console.error.bind(console);Object.assign(a,p),p=null,a.arguments&&a.arguments,a.thisProgram&&(v=a.thisProgram),a.quit&&a.quit;var R;a.wasmBinary&&(R=a.wasmBinary),typeof WebAssembly!="object"&&te("no native wasm support detected");var A,I=!1,L,P,k,x,S,M,H,ae;function Pe(){var e=A.buffer;a.HEAP8=L=new Int8Array(e),a.HEAP16=k=new Int16Array(e),a.HEAPU8=P=new Uint8Array(e),a.HEAPU16=x=new Uint16Array(e),a.HEAP32=S=new Int32Array(e),a.HEAPU32=M=new Uint32Array(e),a.HEAPF32=H=new Float32Array(e),a.HEAPF64=ae=new Float64Array(e)}var Ee=[],je=[],Re=[];function qe(){if(a.preRun)for(typeof a.preRun=="function"&&(a.preRun=[a.preRun]);a.preRun.length;)mt(a.preRun.shift());bt(Ee)}function ht(){bt(je)}function pt(){if(a.postRun)for(typeof a.postRun=="function"&&(a.postRun=[a.postRun]);a.postRun.length;)Fe(a.postRun.shift());bt(Re)}function mt(e){Ee.unshift(e)}function vt(e){je.unshift(e)}function Fe(e){Re.unshift(e)}var ie=0,_e=null;function yt(e){var t;ie++,(t=a.monitorRunDependencies)===null||t===void 0||t.call(a,ie)}function ye(e){var t;if(ie--,(t=a.monitorRunDependencies)===null||t===void 0||t.call(a,ie),ie==0&&_e){var n=_e;_e=null,n()}}function te(e){var t;(t=a.onAbort)===null||t===void 0||t.call(a,e),e="Aborted("+e+")",j(e),I=!0,e+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(e);throw f(n),n}var gt="data:application/octet-stream;base64,",Je=e=>e.startsWith(gt),ge;ge="zxing_reader.wasm",Je(ge)||(ge=_(ge));function Ge(e){if(e==ge&&R)return new Uint8Array(R);if(b)return b(e);throw"both async and sync fetching of the wasm failed"}function wt(e){return!R&&(C||h)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()}).catch(()=>Ge(e)):Promise.resolve().then(()=>Ge(e))}function Ye(e,t,n){return wt(e).then(o=>WebAssembly.instantiate(o,t)).then(o=>o).then(n,o=>{j(`failed to asynchronously prepare wasm: ${o}`),te(o)})}function pn(e,t,n,o){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Je(t)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(s=>{var u=WebAssembly.instantiateStreaming(s,n);return u.then(o,function(l){return j(`wasm streaming compile failed: ${l}`),j("falling back to ArrayBuffer instantiation"),Ye(t,n,o)})}):Ye(t,n,o)}function mn(){var e={a:ro};function t(o,s){return Y=o.exports,A=Y.ia,Pe(),Zt=Y.ma,vt(Y.ja),ye(),Y}yt();function n(o){t(o.instance)}if(a.instantiateWasm)try{return a.instantiateWasm(e,t)}catch(o){j(`Module.instantiateWasm callback failed with error: ${o}`),f(o)}return pn(R,ge,e,n).catch(f),{}}var bt=e=>{for(;e.length>0;)e.shift()(a)};a.noExitRuntime;var Qe=[],Xe=0,vn=e=>{var t=new Ct(e);return t.get_caught()||(t.set_caught(!0),Xe--),t.set_rethrown(!1),Qe.push(t),hr(t.excPtr),t.get_exception_ptr()},de=0,yn=()=>{N(0,0);var e=Qe.pop();fr(e.excPtr),de=0};function Ct(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(t){M[this.ptr+4>>2]=t},this.get_type=function(){return M[this.ptr+4>>2]},this.set_destructor=function(t){M[this.ptr+8>>2]=t},this.get_destructor=function(){return M[this.ptr+8>>2]},this.set_caught=function(t){t=t?1:0,L[this.ptr+12>>0]=t},this.get_caught=function(){return L[this.ptr+12>>0]!=0},this.set_rethrown=function(t){t=t?1:0,L[this.ptr+13>>0]=t},this.get_rethrown=function(){return L[this.ptr+13>>0]!=0},this.init=function(t,n){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(n)},this.set_adjusted_ptr=function(t){M[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return M[this.ptr+16>>2]},this.get_exception_ptr=function(){var t=mr(this.get_type());if(t)return M[this.excPtr>>2];var n=this.get_adjusted_ptr();return n!==0?n:this.excPtr}}var gn=e=>{throw de||(de=e),de},_t=e=>{var t=de;if(!t)return Be(0),0;var n=new Ct(t);n.set_adjusted_ptr(t);var o=n.get_type();if(!o)return Be(0),t;for(var s in e){var u=e[s];if(u===0||u===o)break;var l=n.ptr+16;if(pr(u,o,l))return Be(u),t}return Be(o),t},wn=()=>_t([]),bn=e=>_t([e]),Cn=(e,t)=>_t([e,t]),_n=()=>{var e=Qe.pop();e||te("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(Qe.push(e),e.set_rethrown(!0),e.set_caught(!1),Xe++),de=t,de},Tn=(e,t,n)=>{var o=new Ct(e);throw o.init(t,n),de=e,Xe++,de},$n=()=>Xe,Ke={},Tt=e=>{for(;e.length;){var t=e.pop(),n=e.pop();n(t)}};function $t(e){return this.fromWireType(S[e>>2])}var Oe={},Te={},Ze={},Vt,et=e=>{throw new Vt(e)},$e=(e,t,n)=>{e.forEach(function(d){Ze[d]=t});function o(d){var m=n(d);m.length!==e.length&&et("Mismatched type converter count");for(var g=0;g<e.length;++g)se(e[g],m[g])}var s=new Array(t.length),u=[],l=0;t.forEach((d,m)=>{Te.hasOwnProperty(d)?s[m]=Te[d]:(u.push(d),Oe.hasOwnProperty(d)||(Oe[d]=[]),Oe[d].push(()=>{s[m]=Te[d],++l,l===u.length&&o(s)}))}),u.length===0&&o(s)},Sn=e=>{var t=Ke[e];delete Ke[e];var n=t.rawConstructor,o=t.rawDestructor,s=t.fields,u=s.map(l=>l.getterReturnType).concat(s.map(l=>l.setterArgumentType));$e([e],u,l=>{var d={};return s.forEach((m,g)=>{var T=m.fieldName,E=l[g],O=m.getter,D=m.getterContext,B=l[g+s.length],J=m.setter,W=m.setterContext;d[T]={read:K=>E.fromWireType(O(D,K)),write:(K,y)=>{var $=[];J(W,K,B.toWireType($,y)),Tt($)}}}),[{name:t.name,fromWireType:m=>{var g={};for(var T in d)g[T]=d[T].read(m);return o(m),g},toWireType:(m,g)=>{for(var T in d)if(!(T in g))throw new TypeError(`Missing field: "${T}"`);var E=n();for(T in d)d[T].write(E,g[T]);return m!==null&&m.push(o,E),E},argPackAdvance:ce,readValueFromPointer:$t,destructorFunction:o}]})},Pn=(e,t,n,o,s)=>{},En=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);zt=e},zt,X=e=>{for(var t="",n=e;P[n];)t+=zt[P[n++]];return t},Me,F=e=>{throw new Me(e)};function On(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var o=t.name;if(e||F(`type "${o}" must have a positive integer typeid pointer`),Te.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;F(`Cannot register type '${o}' twice`)}if(Te[e]=t,delete Ze[e],Oe.hasOwnProperty(e)){var s=Oe[e];delete Oe[e],s.forEach(u=>u())}}function se(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return On(e,t,n)}var ce=8,Mn=(e,t,n,o)=>{t=X(t),se(e,{name:t,fromWireType:function(s){return!!s},toWireType:function(s,u){return u?n:o},argPackAdvance:ce,readValueFromPointer:function(s){return this.fromWireType(P[s])},destructorFunction:null})},Dn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),St=e=>{function t(n){return n.$$.ptrType.registeredClass.name}F(t(e)+" instance already deleted")},Pt=!1,qt=e=>{},xn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Jt=e=>{e.count.value-=1;var t=e.count.value===0;t&&xn(e)},Gt=(e,t,n)=>{if(t===n)return e;if(n.baseClass===void 0)return null;var o=Gt(e,t,n.baseClass);return o===null?null:n.downcast(o)},Yt={},An=()=>Object.keys(Ue).length,kn=()=>{var e=[];for(var t in Ue)Ue.hasOwnProperty(t)&&e.push(Ue[t]);return e},Ie=[],Et=()=>{for(;Ie.length;){var e=Ie.pop();e.$$.deleteScheduled=!1,e.delete()}},We,jn=e=>{We=e,Ie.length&&We&&We(Et)},Rn=()=>{a.getInheritedInstanceCount=An,a.getLiveInheritedInstances=kn,a.flushPendingDeletes=Et,a.setDelayFunction=jn},Ue={},Fn=(e,t)=>{for(t===void 0&&F("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},In=(e,t)=>(t=Fn(e,t),Ue[t]),tt=(e,t)=>{(!t.ptrType||!t.ptr)&&et("makeClassHandle requires ptr and ptrType");var n=!!t.smartPtrType,o=!!t.smartPtr;return n!==o&&et("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Le(Object.create(e,{$$:{value:t,writable:!0}}))};function Wn(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=In(this.registeredClass,t);if(n!==void 0){if(n.$$.count.value===0)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var o=n.clone();return this.destructor(e),o}function s(){return this.isSmartPointer?tt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):tt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var u=this.registeredClass.getActualType(t),l=Yt[u];if(!l)return s.call(this);var d;this.isConst?d=l.constPointerType:d=l.pointerType;var m=Gt(t,this.registeredClass,d.registeredClass);return m===null?s.call(this):this.isSmartPointer?tt(d.registeredClass.instancePrototype,{ptrType:d,ptr:m,smartPtrType:this,smartPtr:e}):tt(d.registeredClass.instancePrototype,{ptrType:d,ptr:m})}var Le=e=>typeof FinalizationRegistry>"u"?(Le=t=>t,e):(Pt=new FinalizationRegistry(t=>{Jt(t.$$)}),Le=t=>{var n=t.$$,o=!!n.smartPtr;if(o){var s={$$:n};Pt.register(t,s,t)}return t},qt=t=>Pt.unregister(t),Le(e)),Un=()=>{Object.assign(rt.prototype,{isAliasOf(e){if(!(this instanceof rt)||!(e instanceof rt))return!1;var t=this.$$.ptrType.registeredClass,n=this.$$.ptr;e.$$=e.$$;for(var o=e.$$.ptrType.registeredClass,s=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;o.baseClass;)s=o.upcast(s),o=o.baseClass;return t===o&&n===s},clone(){if(this.$$.ptr||St(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Le(Object.create(Object.getPrototypeOf(this),{$$:{value:Dn(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||St(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&F("Object already scheduled for deletion"),qt(this),Jt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||St(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&F("Object already scheduled for deletion"),Ie.push(this),Ie.length===1&&We&&We(Et),this.$$.deleteScheduled=!0,this}})};function rt(){}var He=(e,t)=>Object.defineProperty(t,"name",{value:e}),Qt=(e,t,n)=>{if(e[t].overloadTable===void 0){var o=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||F(`Function '${n}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[o.argCount]=o}},Ot=(e,t,n)=>{a.hasOwnProperty(e)?((n===void 0||a[e].overloadTable!==void 0&&a[e].overloadTable[n]!==void 0)&&F(`Cannot register public name '${e}' twice`),Qt(a,e,e),a.hasOwnProperty(n)&&F(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),a[e].overloadTable[n]=t):(a[e]=t,n!==void 0&&(a[e].numArguments=n))},Ln=48,Hn=57,Nn=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=Ln&&t<=Hn?`_${e}`:e};function Bn(e,t,n,o,s,u,l,d){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=o,this.baseClass=s,this.getActualType=u,this.upcast=l,this.downcast=d,this.pureVirtualFunctions=[]}var Mt=(e,t,n)=>{for(;t!==n;)t.upcast||F(`Expected null or instance of ${n.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function Vn(e,t){if(t===null)return this.isReference&&F(`null is not a valid ${this.name}`),0;t.$$||F(`Cannot pass "${jt(t)}" as a ${this.name}`),t.$$.ptr||F(`Cannot pass deleted object as a pointer of type ${this.name}`);var n=t.$$.ptrType.registeredClass,o=Mt(t.$$.ptr,n,this.registeredClass);return o}function zn(e,t){var n;if(t===null)return this.isReference&&F(`null is not a valid ${this.name}`),this.isSmartPointer?(n=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,n),n):0;(!t||!t.$$)&&F(`Cannot pass "${jt(t)}" as a ${this.name}`),t.$$.ptr||F(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&F(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var o=t.$$.ptrType.registeredClass;if(n=Mt(t.$$.ptr,o,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&F("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:F(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var s=t.clone();n=this.rawShare(n,fe.toHandle(()=>s.delete())),e!==null&&e.push(this.rawDestructor,n)}break;default:F("Unsupporting sharing policy")}return n}function qn(e,t){if(t===null)return this.isReference&&F(`null is not a valid ${this.name}`),0;t.$$||F(`Cannot pass "${jt(t)}" as a ${this.name}`),t.$$.ptr||F(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&F(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass,o=Mt(t.$$.ptr,n,this.registeredClass);return o}function Xt(e){return this.fromWireType(M[e>>2])}var Jn=()=>{Object.assign(nt.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:ce,readValueFromPointer:Xt,deleteObject(e){e!==null&&e.delete()},fromWireType:Wn})};function nt(e,t,n,o,s,u,l,d,m,g,T){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=o,this.isSmartPointer=s,this.pointeeType=u,this.sharingPolicy=l,this.rawGetPointee=d,this.rawConstructor=m,this.rawShare=g,this.rawDestructor=T,!s&&t.baseClass===void 0?o?(this.toWireType=Vn,this.destructorFunction=null):(this.toWireType=qn,this.destructorFunction=null):this.toWireType=zn}var Kt=(e,t,n)=>{a.hasOwnProperty(e)||et("Replacing nonexistant public symbol"),a[e].overloadTable!==void 0&&n!==void 0?a[e].overloadTable[n]=t:(a[e]=t,a[e].argCount=n)},Gn=(e,t,n)=>{var o=a["dynCall_"+e];return n&&n.length?o.apply(null,[t].concat(n)):o.call(null,t)},at=[],Zt,V=e=>{var t=at[e];return t||(e>=at.length&&(at.length=e+1),at[e]=t=Zt.get(e)),t},Yn=(e,t,n)=>{if(e.includes("j"))return Gn(e,t,n);var o=V(t).apply(null,n);return o},Qn=(e,t)=>{var n=[];return function(){return n.length=0,Object.assign(n,arguments),Yn(e,t,n)}},oe=(e,t)=>{e=X(e);function n(){return e.includes("j")?Qn(e,t):V(t)}var o=n();return typeof o!="function"&&F(`unknown function pointer with signature ${e}: ${t}`),o},Xn=(e,t)=>{var n=He(t,function(o){this.name=t,this.message=o;var s=new Error(o).stack;s!==void 0&&(this.stack=this.toString()+`
`+s.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},n},er,tr=e=>{var t=dr(e),n=X(t);return he(t),n},ot=(e,t)=>{var n=[],o={};function s(u){if(!o[u]&&!Te[u]){if(Ze[u]){Ze[u].forEach(s);return}n.push(u),o[u]=!0}}throw t.forEach(s),new er(`${e}: `+n.map(tr).join([", "]))},Kn=(e,t,n,o,s,u,l,d,m,g,T,E,O)=>{T=X(T),u=oe(s,u),d&&(d=oe(l,d)),g&&(g=oe(m,g)),O=oe(E,O);var D=Nn(T);Ot(D,function(){ot(`Cannot construct ${T} due to unbound types`,[o])}),$e([e,t,n],o?[o]:[],function(B){B=B[0];var J,W;o?(J=B.registeredClass,W=J.instancePrototype):W=rt.prototype;var K=He(T,function(){if(Object.getPrototypeOf(this)!==y)throw new Me("Use 'new' to construct "+T);if($.constructor_body===void 0)throw new Me(T+" has no accessible constructor");var wr=$.constructor_body[arguments.length];if(wr===void 0)throw new Me(`Tried to invoke ctor of ${T} with invalid number of parameters (${arguments.length}) - expected (${Object.keys($.constructor_body).toString()}) parameters instead!`);return wr.apply(this,arguments)}),y=Object.create(W,{constructor:{value:K}});K.prototype=y;var $=new Bn(T,K,y,O,J,u,d,g);if($.baseClass){var G,Q;(Q=(G=$.baseClass).__derivedClasses)!==null&&Q!==void 0||(G.__derivedClasses=[]),$.baseClass.__derivedClasses.push($)}var De=new nt(T,$,!0,!1,!1),ct=new nt(T+"*",$,!1,!1,!1),gr=new nt(T+" const*",$,!1,!0,!1);return Yt[e]={pointerType:ct,constPointerType:gr},Kt(D,K),[De,ct,gr]})},Dt=(e,t)=>{for(var n=[],o=0;o<e;o++)n.push(M[t+o*4>>2]);return n};function Zn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function xt(e,t,n,o,s,u){var l=t.length;l<2&&F("argTypes array size mismatch! Must at least get return value and 'this' types!");var d=t[1]!==null&&n!==null,m=Zn(t),g=t[0].name!=="void",T=l-2,E=new Array(T),O=[],D=[],B=function(){arguments.length!==T&&F(`function ${e} called with ${arguments.length} arguments, expected ${T}`),D.length=0;var J;O.length=d?2:1,O[0]=s,d&&(J=t[1].toWireType(D,this),O[1]=J);for(var W=0;W<T;++W)E[W]=t[W+2].toWireType(D,arguments[W]),O.push(E[W]);var K=o.apply(null,O);function y($){if(m)Tt(D);else for(var G=d?1:2;G<t.length;G++){var Q=G===1?J:E[G-2];t[G].destructorFunction!==null&&t[G].destructorFunction(Q)}if(g)return t[0].fromWireType($)}return y(K)};return He(e,B)}var ea=(e,t,n,o,s,u)=>{var l=Dt(t,n);s=oe(o,s),$e([],[e],function(d){d=d[0];var m=`constructor ${d.name}`;if(d.registeredClass.constructor_body===void 0&&(d.registeredClass.constructor_body=[]),d.registeredClass.constructor_body[t-1]!==void 0)throw new Me(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${d.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return d.registeredClass.constructor_body[t-1]=()=>{ot(`Cannot construct ${d.name} due to unbound types`,l)},$e([],l,g=>(g.splice(1,0,null),d.registeredClass.constructor_body[t-1]=xt(m,g,null,s,u),[])),[]})},rr=e=>{e=e.trim();const t=e.indexOf("(");return t!==-1?e.substr(0,t):e},ta=(e,t,n,o,s,u,l,d,m)=>{var g=Dt(n,o);t=X(t),t=rr(t),u=oe(s,u),$e([],[e],function(T){T=T[0];var E=`${T.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),d&&T.registeredClass.pureVirtualFunctions.push(t);function O(){ot(`Cannot call ${E} due to unbound types`,g)}var D=T.registeredClass.instancePrototype,B=D[t];return B===void 0||B.overloadTable===void 0&&B.className!==T.name&&B.argCount===n-2?(O.argCount=n-2,O.className=T.name,D[t]=O):(Qt(D,t,E),D[t].overloadTable[n-2]=O),$e([],g,function(J){var W=xt(E,J,T,u,l);return D[t].overloadTable===void 0?(W.argCount=n-2,D[t]=W):D[t].overloadTable[n-2]=W,[]}),[]})};function ra(){Object.assign(nr.prototype,{get(e){return this.allocated[e]},has(e){return this.allocated[e]!==void 0},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}})}function nr(){this.allocated=[void 0],this.freelist=[]}var re=new nr,At=e=>{e>=re.reserved&&--re.get(e).refcount===0&&re.free(e)},na=()=>{for(var e=0,t=re.reserved;t<re.allocated.length;++t)re.allocated[t]!==void 0&&++e;return e},aa=()=>{re.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),re.reserved=re.allocated.length,a.count_emval_handles=na},fe={toValue:e=>(e||F("Cannot use deleted val. handle = "+e),re.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return re.allocate({refcount:1,value:e})}}},oa=(e,t)=>{t=X(t),se(e,{name:t,fromWireType:n=>{var o=fe.toValue(n);return At(n),o},toWireType:(n,o)=>fe.toHandle(o),argPackAdvance:ce,readValueFromPointer:$t,destructorFunction:null})},ia=(e,t,n)=>{switch(t){case 1:return n?function(o){return this.fromWireType(L[o>>0])}:function(o){return this.fromWireType(P[o>>0])};case 2:return n?function(o){return this.fromWireType(k[o>>1])}:function(o){return this.fromWireType(x[o>>1])};case 4:return n?function(o){return this.fromWireType(S[o>>2])}:function(o){return this.fromWireType(M[o>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},sa=(e,t,n,o)=>{t=X(t);function s(){}s.values={},se(e,{name:t,constructor:s,fromWireType:function(u){return this.constructor.values[u]},toWireType:(u,l)=>l.value,argPackAdvance:ce,readValueFromPointer:ia(t,n,o),destructorFunction:null}),Ot(t,s)},kt=(e,t)=>{var n=Te[e];return n===void 0&&F(t+" has unknown type "+tr(e)),n},ca=(e,t,n)=>{var o=kt(e,"enum");t=X(t);var s=o.constructor,u=Object.create(o.constructor.prototype,{value:{value:n},constructor:{value:He(`${o.name}_${t}`,function(){})}});s.values[n]=u,s[t]=u},jt=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},ua=(e,t)=>{switch(t){case 4:return function(n){return this.fromWireType(H[n>>2])};case 8:return function(n){return this.fromWireType(ae[n>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},la=(e,t,n)=>{t=X(t),se(e,{name:t,fromWireType:o=>o,toWireType:(o,s)=>s,argPackAdvance:ce,readValueFromPointer:ua(t,n),destructorFunction:null})},da=(e,t,n,o,s,u,l)=>{var d=Dt(t,n);e=X(e),e=rr(e),s=oe(o,s),Ot(e,function(){ot(`Cannot call ${e} due to unbound types`,d)},t-1),$e([],d,function(m){var g=[m[0],null].concat(m.slice(1));return Kt(e,xt(e,g,null,s,u),t-1),[]})},fa=(e,t,n)=>{switch(t){case 1:return n?o=>L[o>>0]:o=>P[o>>0];case 2:return n?o=>k[o>>1]:o=>x[o>>1];case 4:return n?o=>S[o>>2]:o=>M[o>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},ha=(e,t,n,o,s)=>{t=X(t);var u=T=>T;if(o===0){var l=32-8*n;u=T=>T<<l>>>l}var d=t.includes("unsigned"),m=(T,E)=>{},g;d?g=function(T,E){return m(E,this.name),E>>>0}:g=function(T,E){return m(E,this.name),E},se(e,{name:t,fromWireType:u,toWireType:g,argPackAdvance:ce,readValueFromPointer:fa(t,n,o!==0),destructorFunction:null})},pa=(e,t,n)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],s=o[t];function u(l){var d=M[l>>2],m=M[l+4>>2];return new s(L.buffer,m,d)}n=X(n),se(e,{name:n,fromWireType:u,argPackAdvance:ce,readValueFromPointer:u},{ignoreDuplicateRegistrations:!0})},ar=(e,t,n,o)=>{if(!(o>0))return 0;for(var s=n,u=n+o-1,l=0;l<e.length;++l){var d=e.charCodeAt(l);if(d>=55296&&d<=57343){var m=e.charCodeAt(++l);d=65536+((d&1023)<<10)|m&1023}if(d<=127){if(n>=u)break;t[n++]=d}else if(d<=2047){if(n+1>=u)break;t[n++]=192|d>>6,t[n++]=128|d&63}else if(d<=65535){if(n+2>=u)break;t[n++]=224|d>>12,t[n++]=128|d>>6&63,t[n++]=128|d&63}else{if(n+3>=u)break;t[n++]=240|d>>18,t[n++]=128|d>>12&63,t[n++]=128|d>>6&63,t[n++]=128|d&63}}return t[n]=0,n-s},ma=(e,t,n)=>ar(e,P,t,n),or=e=>{for(var t=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);o<=127?t++:o<=2047?t+=2:o>=55296&&o<=57343?(t+=4,++n):t+=3}return t},ir=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,va=(e,t,n)=>{for(var o=t+n,s=t;e[s]&&!(s>=o);)++s;if(s-t>16&&e.buffer&&ir)return ir.decode(e.subarray(t,s));for(var u="";t<s;){var l=e[t++];if(!(l&128)){u+=String.fromCharCode(l);continue}var d=e[t++]&63;if((l&224)==192){u+=String.fromCharCode((l&31)<<6|d);continue}var m=e[t++]&63;if((l&240)==224?l=(l&15)<<12|d<<6|m:l=(l&7)<<18|d<<12|m<<6|e[t++]&63,l<65536)u+=String.fromCharCode(l);else{var g=l-65536;u+=String.fromCharCode(55296|g>>10,56320|g&1023)}}return u},Rt=(e,t)=>e?va(P,e,t):"",ya=(e,t)=>{t=X(t);var n=t==="std::string";se(e,{name:t,fromWireType(o){var s=M[o>>2],u=o+4,l;if(n)for(var d=u,m=0;m<=s;++m){var g=u+m;if(m==s||P[g]==0){var T=g-d,E=Rt(d,T);l===void 0?l=E:(l+="\0",l+=E),d=g+1}}else{for(var O=new Array(s),m=0;m<s;++m)O[m]=String.fromCharCode(P[u+m]);l=O.join("")}return he(o),l},toWireType(o,s){s instanceof ArrayBuffer&&(s=new Uint8Array(s));var u,l=typeof s=="string";l||s instanceof Uint8Array||s instanceof Uint8ClampedArray||s instanceof Int8Array||F("Cannot pass non-string to std::string"),n&&l?u=or(s):u=s.length;var d=Wt(4+u+1),m=d+4;if(M[d>>2]=u,n&&l)ma(s,m,u+1);else if(l)for(var g=0;g<u;++g){var T=s.charCodeAt(g);T>255&&(he(m),F("String has UTF-16 code units that do not fit in 8 bits")),P[m+g]=T}else for(var g=0;g<u;++g)P[m+g]=s[g];return o!==null&&o.push(he,d),d},argPackAdvance:ce,readValueFromPointer:Xt,destructorFunction(o){he(o)}})},sr=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ga=(e,t)=>{for(var n=e,o=n>>1,s=o+t/2;!(o>=s)&&x[o];)++o;if(n=o<<1,n-e>32&&sr)return sr.decode(P.subarray(e,n));for(var u="",l=0;!(l>=t/2);++l){var d=k[e+l*2>>1];if(d==0)break;u+=String.fromCharCode(d)}return u},wa=(e,t,n)=>{var o;if((o=n)!==null&&o!==void 0||(n=2147483647),n<2)return 0;n-=2;for(var s=t,u=n<e.length*2?n/2:e.length,l=0;l<u;++l){var d=e.charCodeAt(l);k[t>>1]=d,t+=2}return k[t>>1]=0,t-s},ba=e=>e.length*2,Ca=(e,t)=>{for(var n=0,o="";!(n>=t/4);){var s=S[e+n*4>>2];if(s==0)break;if(++n,s>=65536){var u=s-65536;o+=String.fromCharCode(55296|u>>10,56320|u&1023)}else o+=String.fromCharCode(s)}return o},_a=(e,t,n)=>{var o;if((o=n)!==null&&o!==void 0||(n=2147483647),n<4)return 0;for(var s=t,u=s+n-4,l=0;l<e.length;++l){var d=e.charCodeAt(l);if(d>=55296&&d<=57343){var m=e.charCodeAt(++l);d=65536+((d&1023)<<10)|m&1023}if(S[t>>2]=d,t+=4,t+4>u)break}return S[t>>2]=0,t-s},Ta=e=>{for(var t=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);o>=55296&&o<=57343&&++n,t+=4}return t},$a=(e,t,n)=>{n=X(n);var o,s,u,l,d;t===2?(o=ga,s=wa,l=ba,u=()=>x,d=1):t===4&&(o=Ca,s=_a,l=Ta,u=()=>M,d=2),se(e,{name:n,fromWireType:m=>{for(var g=M[m>>2],T=u(),E,O=m+4,D=0;D<=g;++D){var B=m+4+D*t;if(D==g||T[B>>d]==0){var J=B-O,W=o(O,J);E===void 0?E=W:(E+="\0",E+=W),O=B+t}}return he(m),E},toWireType:(m,g)=>{typeof g!="string"&&F(`Cannot pass non-string to C++ string type ${n}`);var T=l(g),E=Wt(4+T+t);return M[E>>2]=T>>d,s(g,E+4,T+t),m!==null&&m.push(he,E),E},argPackAdvance:ce,readValueFromPointer:$t,destructorFunction(m){he(m)}})},Sa=(e,t,n,o,s,u)=>{Ke[e]={name:X(t),rawConstructor:oe(n,o),rawDestructor:oe(s,u),fields:[]}},Pa=(e,t,n,o,s,u,l,d,m,g)=>{Ke[e].fields.push({fieldName:X(t),getterReturnType:n,getter:oe(o,s),getterContext:u,setterArgumentType:l,setter:oe(d,m),setterContext:g})},Ea=(e,t)=>{t=X(t),se(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(n,o)=>{}})},Ft=[],Oa=(e,t,n,o)=>(e=Ft[e],t=fe.toValue(t),e(null,t,n,o)),Ma={},Da=e=>{var t=Ma[e];return t===void 0?X(e):t},cr=()=>{if(typeof globalThis=="object")return globalThis;function e(t){t.$$$embind_global$$$=t;var n=typeof $$$embind_global$$$=="object"&&t.$$$embind_global$$$==t;return n||delete t.$$$embind_global$$$,n}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.")},xa=e=>e===0?fe.toHandle(cr()):(e=Da(e),fe.toHandle(cr()[e])),Aa=e=>{var t=Ft.length;return Ft.push(e),t},ka=(e,t)=>{for(var n=new Array(e),o=0;o<e;++o)n[o]=kt(M[t+o*4>>2],"parameter "+o);return n},ja=Reflect.construct,Ra=(e,t,n)=>{var o=[],s=e.toWireType(o,n);return o.length&&(M[t>>2]=fe.toHandle(o)),s},Fa=(e,t,n)=>{var o=ka(e,t),s=o.shift();e--;var u=new Array(e),l=(m,g,T,E)=>{for(var O=0,D=0;D<e;++D)u[D]=o[D].readValueFromPointer(E+O),O+=o[D].argPackAdvance;for(var B=n===1?ja(g,u):g.apply(m,u),D=0;D<e;++D){var J,W;(J=(W=o[D]).deleteObject)===null||J===void 0||J.call(W,u[D])}return Ra(s,T,B)},d=`methodCaller<(${o.map(m=>m.name).join(", ")}) => ${s.name}>`;return Aa(He(d,l))},Ia=e=>{e>4&&(re.get(e).refcount+=1)},Wa=e=>{var t=fe.toValue(e);Tt(t),At(e)},Ua=(e,t)=>{e=kt(e,"_emval_take_value");var n=e.readValueFromPointer(t);return fe.toHandle(n)},La=()=>{te("")},Ha=(e,t,n)=>P.copyWithin(e,t,t+n),Na=()=>2147483648,Ba=e=>{var t=A.buffer,n=(e-t.byteLength+65535)/65536;try{return A.grow(n),Pe(),1}catch{}},Va=e=>{var t=P.length;e>>>=0;var n=Na();if(e>n)return!1;for(var o=(m,g)=>m+(g-m%g)%g,s=1;s<=4;s*=2){var u=t*(1+.2/s);u=Math.min(u,e+100663296);var l=Math.min(n,o(Math.max(e,u),65536)),d=Ba(l);if(d)return!0}return!1},It={},za=()=>v||"./this.program",Ne=()=>{if(!Ne.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,_:za()};for(var n in It)It[n]===void 0?delete t[n]:t[n]=It[n];var o=[];for(var n in t)o.push(`${n}=${t[n]}`);Ne.strings=o}return Ne.strings},qa=(e,t)=>{for(var n=0;n<e.length;++n)L[t++>>0]=e.charCodeAt(n);L[t>>0]=0},Ja=(e,t)=>{var n=0;return Ne().forEach((o,s)=>{var u=t+n;M[e+s*4>>2]=u,qa(o,u),n+=o.length+1}),0},Ga=(e,t)=>{var n=Ne();M[e>>2]=n.length;var o=0;return n.forEach(s=>o+=s.length+1),M[t>>2]=o,0},Ya=e=>e,it=e=>e%4===0&&(e%100!==0||e%400===0),Qa=(e,t)=>{for(var n=0,o=0;o<=t;n+=e[o++]);return n},ur=[31,29,31,30,31,30,31,31,30,31,30,31],lr=[31,28,31,30,31,30,31,31,30,31,30,31],Xa=(e,t)=>{for(var n=new Date(e.getTime());t>0;){var o=it(n.getFullYear()),s=n.getMonth(),u=(o?ur:lr)[s];if(t>u-n.getDate())t-=u-n.getDate()+1,n.setDate(1),s<11?n.setMonth(s+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1));else return n.setDate(n.getDate()+t),n}return n};function Ka(e,t,n){var o=or(e)+1,s=new Array(o);return ar(e,s,0,s.length),s}var Za=(e,t)=>{L.set(e,t)},eo=(e,t,n,o)=>{var s=M[o+40>>2],u={tm_sec:S[o>>2],tm_min:S[o+4>>2],tm_hour:S[o+8>>2],tm_mday:S[o+12>>2],tm_mon:S[o+16>>2],tm_year:S[o+20>>2],tm_wday:S[o+24>>2],tm_yday:S[o+28>>2],tm_isdst:S[o+32>>2],tm_gmtoff:S[o+36>>2],tm_zone:s?Rt(s):""},l=Rt(n),d={"%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 m in d)l=l.replace(new RegExp(m,"g"),d[m]);var g=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],T=["January","February","March","April","May","June","July","August","September","October","November","December"];function E(y,$,G){for(var Q=typeof y=="number"?y.toString():y||"";Q.length<$;)Q=G[0]+Q;return Q}function O(y,$){return E(y,$,"0")}function D(y,$){function G(De){return De<0?-1:De>0?1:0}var Q;return(Q=G(y.getFullYear()-$.getFullYear()))===0&&(Q=G(y.getMonth()-$.getMonth()))===0&&(Q=G(y.getDate()-$.getDate())),Q}function B(y){switch(y.getDay()){case 0:return new Date(y.getFullYear()-1,11,29);case 1:return y;case 2:return new Date(y.getFullYear(),0,3);case 3:return new Date(y.getFullYear(),0,2);case 4:return new Date(y.getFullYear(),0,1);case 5:return new Date(y.getFullYear()-1,11,31);case 6:return new Date(y.getFullYear()-1,11,30)}}function J(y){var $=Xa(new Date(y.tm_year+1900,0,1),y.tm_yday),G=new Date($.getFullYear(),0,4),Q=new Date($.getFullYear()+1,0,4),De=B(G),ct=B(Q);return D(De,$)<=0?D(ct,$)<=0?$.getFullYear()+1:$.getFullYear():$.getFullYear()-1}var W={"%a":y=>g[y.tm_wday].substring(0,3),"%A":y=>g[y.tm_wday],"%b":y=>T[y.tm_mon].substring(0,3),"%B":y=>T[y.tm_mon],"%C":y=>{var $=y.tm_year+1900;return O($/100|0,2)},"%d":y=>O(y.tm_mday,2),"%e":y=>E(y.tm_mday,2," "),"%g":y=>J(y).toString().substring(2),"%G":y=>J(y),"%H":y=>O(y.tm_hour,2),"%I":y=>{var $=y.tm_hour;return $==0?$=12:$>12&&($-=12),O($,2)},"%j":y=>O(y.tm_mday+Qa(it(y.tm_year+1900)?ur:lr,y.tm_mon-1),3),"%m":y=>O(y.tm_mon+1,2),"%M":y=>O(y.tm_min,2),"%n":()=>`
`,"%p":y=>y.tm_hour>=0&&y.tm_hour<12?"AM":"PM","%S":y=>O(y.tm_sec,2),"%t":()=>" ","%u":y=>y.tm_wday||7,"%U":y=>{var $=y.tm_yday+7-y.tm_wday;return O(Math.floor($/7),2)},"%V":y=>{var $=Math.floor((y.tm_yday+7-(y.tm_wday+6)%7)/7);if((y.tm_wday+371-y.tm_yday-2)%7<=2&&$++,$){if($==53){var G=(y.tm_wday+371-y.tm_yday)%7;G!=4&&(G!=3||!it(y.tm_year))&&($=1)}}else{$=52;var Q=(y.tm_wday+7-y.tm_yday-1)%7;(Q==4||Q==5&&it(y.tm_year%400-1))&&$++}return O($,2)},"%w":y=>y.tm_wday,"%W":y=>{var $=y.tm_yday+7-(y.tm_wday+6)%7;return O(Math.floor($/7),2)},"%y":y=>(y.tm_year+1900).toString().substring(2),"%Y":y=>y.tm_year+1900,"%z":y=>{var $=y.tm_gmtoff,G=$>=0;return $=Math.abs($)/60,$=$/60*100+$%60,(G?"+":"-")+("0000"+$).slice(-4)},"%Z":y=>y.tm_zone,"%%":()=>"%"};l=l.replace(/%%/g,"\0\0");for(var m in W)l.includes(m)&&(l=l.replace(new RegExp(m,"g"),W[m](u)));l=l.replace(/\0\0/g,"%");var K=Ka(l);return K.length>t?0:(Za(K,e),K.length-1)},to=(e,t,n,o,s)=>eo(e,t,n,o);Vt=a.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},En(),Me=a.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Un(),Rn(),Jn(),er=a.UnboundTypeError=Xn(Error,"UnboundTypeError"),ra(),aa();var ro={s:vn,u:yn,b:wn,g:bn,q:Cn,J:_n,f:Tn,V:$n,d:gn,da:Sn,Q:Pn,_:Mn,ca:Kn,ba:ea,w:ta,Y:oa,x:sa,h:ca,L:la,M:da,t:ha,o:pa,K:ya,C:$a,A:Sa,ea:Pa,$:Ea,R:Oa,ha:At,fa:xa,Z:Fa,N:Ia,O:Wa,aa:Ua,B:La,X:Ha,W:Va,T:Ja,U:Ga,E:wo,D:so,F:go,n:bo,a:no,e:uo,m:io,k:fo,H:vo,v:po,G:yo,z:_o,P:$o,l:lo,j:co,c:oo,p:ao,I:mo,r:Co,i:ho,y:To,ga:Ya,S:to},Y=mn(),he=a._free=e=>(he=a._free=Y.ka)(e),Wt=a._malloc=e=>(Wt=a._malloc=Y.la)(e),dr=e=>(dr=Y.na)(e),N=(e,t)=>(N=Y.oa)(e,t),Be=e=>(Be=Y.pa)(e),z=()=>(z=Y.qa)(),q=e=>(q=Y.ra)(e),fr=e=>(fr=Y.sa)(e),hr=e=>(hr=Y.ta)(e),pr=(e,t,n)=>(pr=Y.ua)(e,t,n),mr=e=>(mr=Y.va)(e);a.dynCall_viijii=(e,t,n,o,s,u,l)=>(a.dynCall_viijii=Y.wa)(e,t,n,o,s,u,l);var vr=a.dynCall_jiiii=(e,t,n,o,s)=>(vr=a.dynCall_jiiii=Y.xa)(e,t,n,o,s);a.dynCall_iiiiij=(e,t,n,o,s,u,l)=>(a.dynCall_iiiiij=Y.ya)(e,t,n,o,s,u,l),a.dynCall_iiiiijj=(e,t,n,o,s,u,l,d,m)=>(a.dynCall_iiiiijj=Y.za)(e,t,n,o,s,u,l,d,m),a.dynCall_iiiiiijj=(e,t,n,o,s,u,l,d,m,g)=>(a.dynCall_iiiiiijj=Y.Aa)(e,t,n,o,s,u,l,d,m,g);function no(e,t){var n=z();try{return V(e)(t)}catch(o){if(q(n),o!==o+0)throw o;N(1,0)}}function ao(e,t,n,o){var s=z();try{V(e)(t,n,o)}catch(u){if(q(s),u!==u+0)throw u;N(1,0)}}function oo(e,t,n){var o=z();try{V(e)(t,n)}catch(s){if(q(o),s!==s+0)throw s;N(1,0)}}function io(e,t,n,o){var s=z();try{return V(e)(t,n,o)}catch(u){if(q(s),u!==u+0)throw u;N(1,0)}}function so(e,t,n,o,s){var u=z();try{return V(e)(t,n,o,s)}catch(l){if(q(u),l!==l+0)throw l;N(1,0)}}function co(e,t){var n=z();try{V(e)(t)}catch(o){if(q(n),o!==o+0)throw o;N(1,0)}}function uo(e,t,n){var o=z();try{return V(e)(t,n)}catch(s){if(q(o),s!==s+0)throw s;N(1,0)}}function lo(e){var t=z();try{V(e)()}catch(n){if(q(t),n!==n+0)throw n;N(1,0)}}function fo(e,t,n,o,s){var u=z();try{return V(e)(t,n,o,s)}catch(l){if(q(u),l!==l+0)throw l;N(1,0)}}function ho(e,t,n,o,s,u,l,d,m,g,T){var E=z();try{V(e)(t,n,o,s,u,l,d,m,g,T)}catch(O){if(q(E),O!==O+0)throw O;N(1,0)}}function po(e,t,n,o,s,u,l){var d=z();try{return V(e)(t,n,o,s,u,l)}catch(m){if(q(d),m!==m+0)throw m;N(1,0)}}function mo(e,t,n,o,s){var u=z();try{V(e)(t,n,o,s)}catch(l){if(q(u),l!==l+0)throw l;N(1,0)}}function vo(e,t,n,o,s,u){var l=z();try{return V(e)(t,n,o,s,u)}catch(d){if(q(l),d!==d+0)throw d;N(1,0)}}function yo(e,t,n,o,s,u,l,d){var m=z();try{return V(e)(t,n,o,s,u,l,d)}catch(g){if(q(m),g!==g+0)throw g;N(1,0)}}function go(e,t,n,o){var s=z();try{return V(e)(t,n,o)}catch(u){if(q(s),u!==u+0)throw u;N(1,0)}}function wo(e,t,n,o){var s=z();try{return V(e)(t,n,o)}catch(u){if(q(s),u!==u+0)throw u;N(1,0)}}function bo(e){var t=z();try{return V(e)()}catch(n){if(q(t),n!==n+0)throw n;N(1,0)}}function Co(e,t,n,o,s,u,l,d){var m=z();try{V(e)(t,n,o,s,u,l,d)}catch(g){if(q(m),g!==g+0)throw g;N(1,0)}}function _o(e,t,n,o,s,u,l,d,m,g,T,E){var O=z();try{return V(e)(t,n,o,s,u,l,d,m,g,T,E)}catch(D){if(q(O),D!==D+0)throw D;N(1,0)}}function To(e,t,n,o,s,u,l,d,m,g,T,E,O,D,B,J){var W=z();try{V(e)(t,n,o,s,u,l,d,m,g,T,E,O,D,B,J)}catch(K){if(q(W),K!==K+0)throw K;N(1,0)}}function $o(e,t,n,o,s){var u=z();try{return vr(e,t,n,o,s)}catch(l){if(q(u),l!==l+0)throw l;N(1,0)}}var st;_e=function e(){st||yr(),st||(_e=e)};function yr(){if(ie>0||(qe(),ie>0))return;function e(){st||(st=!0,a.calledRun=!0,!I&&(ht(),c(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),pt()))}a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1),e()},1)):e()}if(a.preInit)for(typeof a.preInit=="function"&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();return yr(),i.ready}})();function hi(r){return Nt(Bt,r)}async function pi(r,i){return di(Bt,r,i)}async function mi(r,i){return fi(Bt,r,i)}var ze;class xr extends EventTarget{constructor(i={}){var a;super(),Ho(this,ze,void 0);try{const c=(a=i==null?void 0:i.formats)==null?void 0:a.filter(f=>f!=="unknown");if((c==null?void 0:c.length)===0)throw new TypeError("Hint option provided, but is empty.");c==null||c.forEach(f=>{if(!lt.has(f))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${f}' is not a valid enum value of type BarcodeFormat.`)}),No(this,ze,c??[]),hi().then(f=>{this.dispatchEvent(new CustomEvent("load",{detail:f}))}).catch(f=>{this.dispatchEvent(new CustomEvent("error",{detail:f}))})}catch(c){throw Er(c,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Bo.filter(i=>i!=="unknown")}async detect(i){try{const a=await Qo(i);if(a===null)return[];let c;try{Gr(a)?c=await pi(a,{tryHarder:!0,formats:Pr(this,ze).map(f=>lt.get(f))}):c=await mi(a,{tryHarder:!0,formats:Pr(this,ze).map(f=>lt.get(f))})}catch(f){throw console.error(f),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return c.map(f=>{const{topLeft:{x:p,y:v},topRight:{x:C,y:h},bottomLeft:{x:w,y:_},bottomRight:{x:b,y:j}}=f.position,R=Math.min(p,C,w,b),A=Math.min(v,h,_,j),I=Math.max(p,C,w,b),L=Math.max(v,h,_,j);return{boundingBox:new DOMRectReadOnly(R,A,I-R,L-A),rawValue:f.text,format:Vo(f.format),cornerPoints:[{x:p,y:v},{x:C,y:h},{x:b,y:j},{x:w,y:_}]}})}catch(a){throw Er(a,"Failed to execute 'detect' on 'BarcodeDetector'")}}}ze=new WeakMap;const Kr=(r,i,a="error")=>{let c,f;const p=new Promise((v,C)=>{c=v,f=C,r.addEventListener(i,c),r.addEventListener(a,f)});return p.finally(()=>{r.removeEventListener(i,c),r.removeEventListener(a,f)}),p},Ar=r=>new Promise(i=>setTimeout(i,r));class Zr extends Error{constructor(){super("this browser has no Stream API support"),this.name="StreamApiNotSupportedError"}}class vi extends Error{constructor(){super("camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP."),this.name="InsecureContextError"}}class yi extends Error{constructor(){super("Loading camera stream timed out after 6 seconds. If you are on iOS in PWA mode, this is a known issue (see https://github.com/gruhn/vue-qrcode-reader/issues/298)"),this.name="StreamLoadTimeoutError"}}let en;async function gi(r){if(window.BarcodeDetector===void 0)return console.debug("[vue-qrcode-reader] Native BarcodeDetector not supported. Will use polyfill."),new xr({formats:r});const i=await window.BarcodeDetector.getSupportedFormats(),a=r.filter(c=>!i.includes(c));return a.length>0?(console.debug(`[vue-qrcode-reader] Native BarcodeDetector does not support formats ${JSON.stringify(a)}. Will use polyfill.`),new xr({formats:r})):(console.debug("[vue-qrcode-reader] Will use native BarcodeDetector."),new window.BarcodeDetector({formats:r}))}async function tn(r){en=await gi(r)}const wi=async(r,{detectHandler:i,locateHandler:a,minDelay:c,formats:f})=>{console.debug("[vue-qrcode-reader] start scanning"),await tn(f);const p=v=>async C=>{if(r.readyState===0)console.debug("[vue-qrcode-reader] stop scanning: video element readyState is 0");else{const{lastScanned:h,contentBefore:w,lastScanHadContent:_}=v;if(C-h<c)window.requestAnimationFrame(p(v));else{const b=await en.detect(r),j=b.some(I=>!w.includes(I.rawValue));j&&i(b);const R=b.length>0;R&&a(b),!R&&_&&a(b);const A={lastScanned:C,lastScanHadContent:R,contentBefore:j?b.map(I=>I.rawValue):w};window.requestAnimationFrame(p(A))}}};p({lastScanned:performance.now(),contentBefore:[],lastScanHadContent:!1})(performance.now())};var rn={},ee={};Object.defineProperty(ee,"__esModule",{value:!0});ee.compactObject=on;ee.deprecated=Oi;var bi=ee.detectBrowser=Mi;ee.disableLog=Si;ee.disableWarnings=Pi;ee.extractVersion=dt;ee.filterStats=Di;ee.log=Ei;ee.walkStats=ft;ee.wrapPeerConnectionEvent=$i;function Ci(r,i,a){return i=_i(i),i in r?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a,r}function _i(r){var i=Ti(r,"string");return be(i)==="symbol"?i:String(i)}function Ti(r,i){if(be(r)!=="object"||r===null)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var c=a.call(r,i||"default");if(be(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}function be(r){"@babel/helpers - typeof";return be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},be(r)}var nn=!0,an=!0;function dt(r,i,a){var c=r.match(i);return c&&c.length>=a&&parseInt(c[a],10)}function $i(r,i,a){if(r.RTCPeerConnection){var c=r.RTCPeerConnection.prototype,f=c.addEventListener;c.addEventListener=function(v,C){if(v!==i)return f.apply(this,arguments);var h=function(w){var _=a(w);_&&(C.handleEvent?C.handleEvent(_):C(_))};return this._eventMap=this._eventMap||{},this._eventMap[i]||(this._eventMap[i]=new Map),this._eventMap[i].set(C,h),f.apply(this,[v,h])};var p=c.removeEventListener;c.removeEventListener=function(v,C){if(v!==i||!this._eventMap||!this._eventMap[i])return p.apply(this,arguments);if(!this._eventMap[i].has(C))return p.apply(this,arguments);var h=this._eventMap[i].get(C);return this._eventMap[i].delete(C),this._eventMap[i].size===0&&delete this._eventMap[i],Object.keys(this._eventMap).length===0&&delete this._eventMap,p.apply(this,[v,h])},Object.defineProperty(c,"on"+i,{get:function(){return this["_on"+i]},set:function(v){this["_on"+i]&&(this.removeEventListener(i,this["_on"+i]),delete this["_on"+i]),v&&this.addEventListener(i,this["_on"+i]=v)},enumerable:!0,configurable:!0})}}function Si(r){return typeof r!="boolean"?new Error("Argument type: "+be(r)+". Please use a boolean."):(nn=r,r?"adapter.js logging disabled":"adapter.js logging enabled")}function Pi(r){return typeof r!="boolean"?new Error("Argument type: "+be(r)+". Please use a boolean."):(an=!r,"adapter.js deprecation warnings "+(r?"disabled":"enabled"))}function Ei(){if((typeof window>"u"?"undefined":be(window))==="object"){if(nn)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Oi(r,i){an&&console.warn(r+" is deprecated, please use "+i+" instead.")}function Mi(r){var i={browser:null,version:null};if(typeof r>"u"||!r.navigator||!r.navigator.userAgent)return i.browser="Not a browser.",i;var a=r.navigator;if(a.mozGetUserMedia)i.browser="firefox",i.version=dt(a.userAgent,/Firefox\/(\d+)\./,1);else if(a.webkitGetUserMedia||r.isSecureContext===!1&&r.webkitRTCPeerConnection)i.browser="chrome",i.version=dt(a.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(r.RTCPeerConnection&&a.userAgent.match(/AppleWebKit\/(\d+)\./))i.browser="safari",i.version=dt(a.userAgent,/AppleWebKit\/(\d+)\./,1),i.supportsUnifiedPlan=r.RTCRtpTransceiver&&"currentDirection"in r.RTCRtpTransceiver.prototype;else return i.browser="Not a supported browser.",i;return i}function kr(r){return Object.prototype.toString.call(r)==="[object Object]"}function on(r){return kr(r)?Object.keys(r).reduce(function(i,a){var c=kr(r[a]),f=c?on(r[a]):r[a],p=c&&!Object.keys(f).length;return f===void 0||p?i:Object.assign(i,Ci({},a,f))},{}):r}function ft(r,i,a){!i||a.has(i.id)||(a.set(i.id,i),Object.keys(i).forEach(function(c){c.endsWith("Id")?ft(r,r.get(i[c]),a):c.endsWith("Ids")&&i[c].forEach(function(f){ft(r,r.get(f),a)})}))}function Di(r,i,a){var c=a?"outbound-rtp":"inbound-rtp",f=new Map;if(i===null)return f;var p=[];return r.forEach(function(v){v.type==="track"&&v.trackIdentifier===i.id&&p.push(v)}),p.forEach(function(v){r.forEach(function(C){C.type===c&&C.trackId===v.id&&ft(r,C,f)})}),f}Object.defineProperty(rn,"__esModule",{value:!0});var xi=rn.shimGetUserMedia=ji,Ai=ki(ee);function sn(r){if(typeof WeakMap!="function")return null;var i=new WeakMap,a=new WeakMap;return(sn=function(c){return c?a:i})(r)}function ki(r,i){if(r&&r.__esModule)return r;if(r===null||we(r)!=="object"&&typeof r!="function")return{default:r};var a=sn(i);if(a&&a.has(r))return a.get(r);var c={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in r)if(p!=="default"&&Object.prototype.hasOwnProperty.call(r,p)){var v=f?Object.getOwnPropertyDescriptor(r,p):null;v&&(v.get||v.set)?Object.defineProperty(c,p,v):c[p]=r[p]}return c.default=r,a&&a.set(r,c),c}function we(r){"@babel/helpers - typeof";return we=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},we(r)}var jr=Ai.log;function ji(r,i){var a=r&&r.navigator;if(a.mediaDevices){var c=function(h){if(we(h)!=="object"||h.mandatory||h.optional)return h;var w={};return Object.keys(h).forEach(function(_){if(!(_==="require"||_==="advanced"||_==="mediaSource")){var b=we(h[_])==="object"?h[_]:{ideal:h[_]};b.exact!==void 0&&typeof b.exact=="number"&&(b.min=b.max=b.exact);var j=function(A,I){return A?A+I.charAt(0).toUpperCase()+I.slice(1):I==="deviceId"?"sourceId":I};if(b.ideal!==void 0){w.optional=w.optional||[];var R={};typeof b.ideal=="number"?(R[j("min",_)]=b.ideal,w.optional.push(R),R={},R[j("max",_)]=b.ideal,w.optional.push(R)):(R[j("",_)]=b.ideal,w.optional.push(R))}b.exact!==void 0&&typeof b.exact!="number"?(w.mandatory=w.mandatory||{},w.mandatory[j("",_)]=b.exact):["min","max"].forEach(function(A){b[A]!==void 0&&(w.mandatory=w.mandatory||{},w.mandatory[j(A,_)]=b[A])})}}),h.advanced&&(w.optional=(w.optional||[]).concat(h.advanced)),w},f=function(h,w){if(i.version>=61)return w(h);if(h=JSON.parse(JSON.stringify(h)),h&&we(h.audio)==="object"){var _=function(A,I,L){I in A&&!(L in A)&&(A[L]=A[I],delete A[I])};h=JSON.parse(JSON.stringify(h)),_(h.audio,"autoGainControl","googAutoGainControl"),_(h.audio,"noiseSuppression","googNoiseSuppression"),h.audio=c(h.audio)}if(h&&we(h.video)==="object"){var b=h.video.facingMode;b=b&&(we(b)==="object"?b:{ideal:b});var j=i.version<66;if(b&&(b.exact==="user"||b.exact==="environment"||b.ideal==="user"||b.ideal==="environment")&&!(a.mediaDevices.getSupportedConstraints&&a.mediaDevices.getSupportedConstraints().facingMode&&!j)){delete h.video.facingMode;var R;if(b.exact==="environment"||b.ideal==="environment"?R=["back","rear"]:(b.exact==="user"||b.ideal==="user")&&(R=["front"]),R)return a.mediaDevices.enumerateDevices().then(function(A){A=A.filter(function(L){return L.kind==="videoinput"});var I=A.find(function(L){return R.some(function(P){return L.label.toLowerCase().includes(P)})});return!I&&A.length&&R.includes("back")&&(I=A[A.length-1]),I&&(h.video.deviceId=b.exact?{exact:I.deviceId}:{ideal:I.deviceId}),h.video=c(h.video),jr("chrome: "+JSON.stringify(h)),w(h)})}h.video=c(h.video)}return jr("chrome: "+JSON.stringify(h)),w(h)},p=function(h){return i.version>=64?h:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[h.name]||h.name,message:h.message,constraint:h.constraint||h.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},v=function(h,w,_){f(h,function(b){a.webkitGetUserMedia(b,w,function(j){_&&_(p(j))})})};if(a.getUserMedia=v.bind(a),a.mediaDevices.getUserMedia){var C=a.mediaDevices.getUserMedia.bind(a.mediaDevices);a.mediaDevices.getUserMedia=function(h){return f(h,function(w){return C(w).then(function(_){if(w.audio&&!_.getAudioTracks().length||w.video&&!_.getVideoTracks().length)throw _.getTracks().forEach(function(b){b.stop()}),new DOMException("","NotFoundError");return _},function(_){return Promise.reject(p(_))})})}}}}var cn={};Object.defineProperty(cn,"__esModule",{value:!0});var Ri=cn.shimGetUserMedia=Wi,Fi=Ii(ee);function un(r){if(typeof WeakMap!="function")return null;var i=new WeakMap,a=new WeakMap;return(un=function(c){return c?a:i})(r)}function Ii(r,i){if(r&&r.__esModule)return r;if(r===null||xe(r)!=="object"&&typeof r!="function")return{default:r};var a=un(i);if(a&&a.has(r))return a.get(r);var c={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in r)if(p!=="default"&&Object.prototype.hasOwnProperty.call(r,p)){var v=f?Object.getOwnPropertyDescriptor(r,p):null;v&&(v.get||v.set)?Object.defineProperty(c,p,v):c[p]=r[p]}return c.default=r,a&&a.set(r,c),c}function xe(r){"@babel/helpers - typeof";return xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},xe(r)}function Wi(r,i){var a=r&&r.navigator,c=r&&r.MediaStreamTrack;if(a.getUserMedia=function(h,w,_){Fi.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),a.mediaDevices.getUserMedia(h).then(w,_)},!(i.version>55&&"autoGainControl"in a.mediaDevices.getSupportedConstraints())){var f=function(h,w,_){w in h&&!(_ in h)&&(h[_]=h[w],delete h[w])},p=a.mediaDevices.getUserMedia.bind(a.mediaDevices);if(a.mediaDevices.getUserMedia=function(h){return xe(h)==="object"&&xe(h.audio)==="object"&&(h=JSON.parse(JSON.stringify(h)),f(h.audio,"autoGainControl","mozAutoGainControl"),f(h.audio,"noiseSuppression","mozNoiseSuppression")),p(h)},c&&c.prototype.getSettings){var v=c.prototype.getSettings;c.prototype.getSettings=function(){var h=v.apply(this,arguments);return f(h,"mozAutoGainControl","autoGainControl"),f(h,"mozNoiseSuppression","noiseSuppression"),h}}if(c&&c.prototype.applyConstraints){var C=c.prototype.applyConstraints;c.prototype.applyConstraints=function(h){return this.kind==="audio"&&xe(h)==="object"&&(h=JSON.parse(JSON.stringify(h)),f(h,"autoGainControl","mozAutoGainControl"),f(h,"noiseSuppression","mozNoiseSuppression")),C.apply(this,[h])}}}}var le={};Object.defineProperty(le,"__esModule",{value:!0});le.shimAudioContext=Gi;le.shimCallbacksAPI=Bi;le.shimConstraints=fn;le.shimCreateOfferLegacy=Ji;var Ui=le.shimGetUserMedia=Vi;le.shimLocalStreamsAPI=Hi;le.shimRTCIceServerUrls=zi;le.shimRemoteStreamsAPI=Ni;le.shimTrackEventTransceiver=qi;var ln=Li(ee);function dn(r){if(typeof WeakMap!="function")return null;var i=new WeakMap,a=new WeakMap;return(dn=function(c){return c?a:i})(r)}function Li(r,i){if(r&&r.__esModule)return r;if(r===null||Ce(r)!=="object"&&typeof r!="function")return{default:r};var a=dn(i);if(a&&a.has(r))return a.get(r);var c={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in r)if(p!=="default"&&Object.prototype.hasOwnProperty.call(r,p)){var v=f?Object.getOwnPropertyDescriptor(r,p):null;v&&(v.get||v.set)?Object.defineProperty(c,p,v):c[p]=r[p]}return c.default=r,a&&a.set(r,c),c}function Ce(r){"@babel/helpers - typeof";return Ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},Ce(r)}function Hi(r){if(!(Ce(r)!=="object"||!r.RTCPeerConnection)){if("getLocalStreams"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in r.RTCPeerConnection.prototype)){var i=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addStream=function(a){var c=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(a)||this._localStreams.push(a),a.getAudioTracks().forEach(function(f){return i.call(c,f,a)}),a.getVideoTracks().forEach(function(f){return i.call(c,f,a)})},r.RTCPeerConnection.prototype.addTrack=function(a){for(var c=this,f=arguments.length,p=new Array(f>1?f-1:0),v=1;v<f;v++)p[v-1]=arguments[v];return p&&p.forEach(function(C){c._localStreams?c._localStreams.includes(C)||c._localStreams.push(C):c._localStreams=[C]}),i.apply(this,arguments)}}"removeStream"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.removeStream=function(a){var c=this;this._localStreams||(this._localStreams=[]);var f=this._localStreams.indexOf(a);if(f!==-1){this._localStreams.splice(f,1);var p=a.getTracks();this.getSenders().forEach(function(v){p.includes(v.track)&&c.removeTrack(v)})}})}}function Ni(r){if(!(Ce(r)!=="object"||!r.RTCPeerConnection)&&("getRemoteStreams"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in r.RTCPeerConnection.prototype))){Object.defineProperty(r.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(a){var c=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=a),this.addEventListener("track",this._onaddstreampoly=function(f){f.streams.forEach(function(p){if(c._remoteStreams||(c._remoteStreams=[]),!c._remoteStreams.includes(p)){c._remoteStreams.push(p);var v=new Event("addstream");v.stream=p,c.dispatchEvent(v)}})})}});var i=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){var a=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(c){c.streams.forEach(function(f){if(a._remoteStreams||(a._remoteStreams=[]),!(a._remoteStreams.indexOf(f)>=0)){a._remoteStreams.push(f);var p=new Event("addstream");p.stream=f,a.dispatchEvent(p)}})}),i.apply(a,arguments)}}}function Bi(r){if(!(Ce(r)!=="object"||!r.RTCPeerConnection)){var i=r.RTCPeerConnection.prototype,a=i.createOffer,c=i.createAnswer,f=i.setLocalDescription,p=i.setRemoteDescription,v=i.addIceCandidate;i.createOffer=function(h,w){var _=arguments.length>=2?arguments[2]:arguments[0],b=a.apply(this,[_]);return w?(b.then(h,w),Promise.resolve()):b},i.createAnswer=function(h,w){var _=arguments.length>=2?arguments[2]:arguments[0],b=c.apply(this,[_]);return w?(b.then(h,w),Promise.resolve()):b};var C=function(h,w,_){var b=f.apply(this,[h]);return _?(b.then(w,_),Promise.resolve()):b};i.setLocalDescription=C,C=function(h,w,_){var b=p.apply(this,[h]);return _?(b.then(w,_),Promise.resolve()):b},i.setRemoteDescription=C,C=function(h,w,_){var b=v.apply(this,[h]);return _?(b.then(w,_),Promise.resolve()):b},i.addIceCandidate=C}}function Vi(r){var i=r&&r.navigator;if(i.mediaDevices&&i.mediaDevices.getUserMedia){var a=i.mediaDevices,c=a.getUserMedia.bind(a);i.mediaDevices.getUserMedia=function(f){return c(fn(f))}}!i.getUserMedia&&i.mediaDevices&&i.mediaDevices.getUserMedia&&(i.getUserMedia=(function(f,p,v){i.mediaDevices.getUserMedia(f).then(p,v)}).bind(i))}function fn(r){return r&&r.video!==void 0?Object.assign({},r,{video:ln.compactObject(r.video)}):r}function zi(r){if(r.RTCPeerConnection){var i=r.RTCPeerConnection;r.RTCPeerConnection=function(a,c){if(a&&a.iceServers){for(var f=[],p=0;p<a.iceServers.length;p++){var v=a.iceServers[p];v.urls===void 0&&v.url?(ln.deprecated("RTCIceServer.url","RTCIceServer.urls"),v=JSON.parse(JSON.stringify(v)),v.urls=v.url,delete v.url,f.push(v)):f.push(a.iceServers[p])}a.iceServers=f}return new i(a,c)},r.RTCPeerConnection.prototype=i.prototype,"generateCertificate"in i&&Object.defineProperty(r.RTCPeerConnection,"generateCertificate",{get:function(){return i.generateCertificate}})}}function qi(r){Ce(r)==="object"&&r.RTCTrackEvent&&"receiver"in r.RTCTrackEvent.prototype&&!("transceiver"in r.RTCTrackEvent.prototype)&&Object.defineProperty(r.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function Ji(r){var i=r.RTCPeerConnection.prototype.createOffer;r.RTCPeerConnection.prototype.createOffer=function(a){if(a){typeof a.offerToReceiveAudio<"u"&&(a.offerToReceiveAudio=!!a.offerToReceiveAudio);var c=this.getTransceivers().find(function(p){return p.receiver.track.kind==="audio"});a.offerToReceiveAudio===!1&&c?c.direction==="sendrecv"?c.setDirection?c.setDirection("sendonly"):c.direction="sendonly":c.direction==="recvonly"&&(c.setDirection?c.setDirection("inactive"):c.direction="inactive"):a.offerToReceiveAudio===!0&&!c&&this.addTransceiver("audio",{direction:"recvonly"}),typeof a.offerToReceiveVideo<"u"&&(a.offerToReceiveVideo=!!a.offerToReceiveVideo);var f=this.getTransceivers().find(function(p){return p.receiver.track.kind==="video"});a.offerToReceiveVideo===!1&&f?f.direction==="sendrecv"?f.setDirection?f.setDirection("sendonly"):f.direction="sendonly":f.direction==="recvonly"&&(f.setDirection?f.setDirection("inactive"):f.direction="inactive"):a.offerToReceiveVideo===!0&&!f&&this.addTransceiver("video",{direction:"recvonly"})}return i.apply(this,arguments)}}function Gi(r){Ce(r)!=="object"||r.AudioContext||(r.AudioContext=r.webkitAudioContext)}const Yi=r=>{let i=!1,a;return(...c)=>(i||(a=r(c),i=!0),a)};function me(r,i){if(r===!1)throw new Error(i??"assertion failure")}function Rr(r){throw new Error("this code should be unreachable")}const Qi=Yi(()=>{const r=bi(window);switch(r.browser){case"chrome":xi(window,r);break;case"firefox":Ri(window,r);break;case"safari":Ui(window,r);break;default:throw new Zr}});let Ae=Promise.resolve({type:"stop",data:{}});async function Fr(r,i,a){var c,f,p;if(console.debug("[vue-qrcode-reader] starting camera with constraints: ",JSON.stringify(i)),window.isSecureContext!==!0)throw new vi;if(((c=navigator==null?void 0:navigator.mediaDevices)==null?void 0:c.getUserMedia)===void 0)throw new Zr;Qi(),console.debug("[vue-qrcode-reader] calling getUserMedia");const v=await navigator.mediaDevices.getUserMedia({audio:!1,video:i});r.srcObject!==void 0?r.srcObject=v:r.mozSrcObject!==void 0?r.mozSrcObject=v:window.URL.createObjectURL?r.src=window.URL.createObjectURL(v):window.webkitURL?r.src=window.webkitURL.createObjectURL(v):r.src=v.id,r.play(),console.debug("[vue-qrcode-reader] waiting for video element to load"),await Promise.race([Kr(r,"loadeddata"),Ar(6e3).then(()=>{throw new yi})]),console.debug("[vue-qrcode-reader] video element loaded"),await Ar(500);const[C]=v.getVideoTracks(),h=(p=(f=C==null?void 0:C.getCapabilities)==null?void 0:f.call(C))!=null?p:{};let w=!1;return a&&h.torch&&(await C.applyConstraints({advanced:[{torch:!0}]}),w=!0),console.debug("[vue-qrcode-reader] camera ready"),{type:"start",data:{videoEl:r,stream:v,capabilities:h,constraints:i,isTorchOn:w}}}async function Xi(r,{constraints:i,torch:a,restart:c=!1}){Ae=Ae.then(p=>{if(p.type==="start"){const{data:{videoEl:v,stream:C,constraints:h,isTorchOn:w}}=p;return!c&&r===v&&i===h&&a===w?p:hn(v,C,w).then(()=>Fr(r,i,a))}else if(p.type==="stop"||p.type==="failed")return Fr(r,i,a);Rr()}).catch(p=>(console.debug(`[vue-qrcode-reader] starting camera failed with "${p}"`),{type:"failed",error:p}));const f=await Ae;if(f.type==="stop")throw new Error("Something went wrong with the camera task queue (start task).");if(f.type==="failed")throw f.error;if(f.type==="start")return f.data.capabilities;Rr()}async function hn(r,i,a){console.debug("[vue-qrcode-reader] stopping camera"),r.src="",r.srcObject=null,r.load(),await Kr(r,"error");for(const c of i.getTracks())a!=null||await c.applyConstraints({advanced:[{torch:!1}]}),i.removeTrack(c),c.stop();return{type:"stop",data:{}}}async function ut(){if(Ae=Ae.then(r=>{if(r.type==="stop"||r.type==="failed")return r;const{data:{videoEl:i,stream:a,isTorchOn:c}}=r;return hn(i,a,c)}),(await Ae).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")}const Ki=So({__name:"QrcodeStream",props:{constraints:{type:Object,default(){return{facingMode:"environment"}}},formats:{type:Array,default:()=>["qr_code"]},paused:{type:Boolean,default:!1},torch:{type:Boolean,default:!1},track:{type:Function}},emits:["detect","camera-on","camera-off","error"],setup(r,{emit:i}){const a=r,c=i,f=ne(a.constraints),p=ne(a.formats);Ve(()=>a.constraints,(x,S)=>{JSON.stringify(x)!==JSON.stringify(S)&&(f.value=x)},{deep:!0}),Ve(()=>a.formats,(x,S)=>{JSON.stringify(x)!==JSON.stringify(S)&&(p.value=x)},{deep:!0});const v=ne(),C=ne(),h=ne(),w=ne(!1),_=ne(!1);Ir(()=>{_.value=!0}),Po(()=>{ut()});const b=Ut(()=>({torch:a.torch,constraints:f.value,shouldStream:_.value&&!a.paused}));Ve(b,async x=>{const S=h.value;me(S!==void 0,"cameraSettings watcher should never be triggered when component is not mounted. Thus video element should always be defined.");const M=v.value;me(M!==void 0,"cameraSettings watcher should never be triggered when component is not mounted. Thus canvas should always be defined.");const H=M.getContext("2d");if(me(H!==null,"if cavnas is defined, canvas 2d context should also be non-null"),x.shouldStream){ut(),w.value=!1;try{const ae=await Xi(S,x);_.value?(w.value=!0,c("camera-on",ae)):await ut()}catch(ae){c("error",ae)}}else M.width=S.videoWidth,M.height=S.videoHeight,H.drawImage(S,0,0,S.videoWidth,S.videoHeight),ut(),w.value=!1,c("camera-off")},{deep:!0}),Ve(p,async x=>{_.value&&await tn(x)});const j=Ut(()=>b.value.shouldStream&&w.value);Ve(j,x=>{if(x){me(v.value!==void 0,"shouldScan watcher should only be triggered when component is mounted. Thus pause frame canvas is defined"),R(v.value),me(C.value!==void 0,"shouldScan watcher should only be triggered when component is mounted. Thus tracking canvas is defined"),R(C.value);const S=()=>a.track===void 0?500:40;me(h.value!==void 0,"shouldScan watcher should only be triggered when component is mounted. Thus video element is defined"),wi(h.value,{detectHandler:M=>c("detect",M),formats:p.value,locateHandler:A,minDelay:S()})}});const R=x=>{const S=x.getContext("2d");me(S!==null,"canvas 2d context should always be non-null"),S.clearRect(0,0,x.width,x.height)},A=x=>{const S=C.value;me(S!==void 0,"onLocate handler should only be called when component is mounted. Thus tracking canvas is always defined.");const M=h.value;if(me(M!==void 0,"onLocate handler should only be called when component is mounted. Thus video element is always defined."),x.length===0||a.track===void 0)R(S);else{const H=M.offsetWidth,ae=M.offsetHeight,Pe=M.videoWidth,Ee=M.videoHeight,je=Math.max(H/Pe,ae/Ee),Re=Pe*je,qe=Ee*je,ht=Re/Pe,pt=qe/Ee,mt=(H-Re)/2,vt=(ae-qe)/2,Fe=({x:ye,y:te})=>({x:Math.floor(ye*ht),y:Math.floor(te*pt)}),ie=({x:ye,y:te})=>({x:Math.floor(ye+mt),y:Math.floor(te+vt)}),_e=x.map(ye=>{const{boundingBox:te,cornerPoints:gt}=ye,{x:Je,y:ge}=ie(Fe({x:te.x,y:te.y})),{x:Ge,y:wt}=Fe({x:te.width,y:te.height});return{...ye,cornerPoints:gt.map(Ye=>ie(Fe(Ye))),boundingBox:DOMRectReadOnly.fromRect({x:Je,y:ge,width:Ge,height:wt})}});S.width=M.offsetWidth,S.height=M.offsetHeight;const yt=S.getContext("2d");a.track(_e,yt)}},I={width:"100%",height:"100%",position:"relative","z-index":"0"},L={width:"100%",height:"100%",position:"absolute",top:"0",left:"0"},P={width:"100%",height:"100%","object-fit":"cover"},k=Ut(()=>j.value?P:{...P,visibility:"hidden",position:"absolute"});return(x,S)=>(ue(),ve("div",{style:I},[U("video",{ref_key:"videoRef",ref:h,style:Eo(k.value),autoplay:"",muted:"",playsinline:""},null,4),Ht(U("canvas",{id:"qrcode-stream-pause-frame",ref_key:"pauseFrameRef",ref:v,style:P},null,512),[[Wr,!j.value]]),U("canvas",{id:"qrcode-stream-tracking-layer",ref_key:"trackingLayerRef",ref:C,style:L},null,512),U("div",{style:L},[Oo(x.$slots,"default")])]))}}),Zi={class:"modal is-active"},es={class:"modal-content"},ts={class:"section"},rs={class:"columns is-centered"},ns={class:"column is-three-quarters"},as={class:"modal-slot has-text-centered is-shadowless"},os={key:0},is={class:"block is-size-5"},ss={key:0},cs={class:"is-size-7 mb-3"},us={class:"is-size-7 mb-3"},ls={class:"addressbar columns is-mobile is-gapless"},ds={class:"column is-narrow has-text-left circled"},fs={class:"column is-narrow has-text-right"},hs={key:1,class:"is-size-7"},ps={class:"fullscreen-streamer"},ms={key:1,class:"field has-addons has-addons-centered mt-3"},vs={class:"control has-icons-left"},ys={class:"select"},gs=["value"],ws={class:"icon is-small is-left"},bs={class:"fullscreen-footer"},Ps={__name:"Capture",setup(r){const i=Fo(),a=Lo(),c=Mo(),f=ne(!1),p=ne(null),v=ne([]),C=ne(""),h=Do(new Io({qrcode:null,uri:""})),w=ne(!1);Ir(async()=>{var P;(P=navigator.mediaDevices)!=null&&P.enumerateDevices?await navigator.mediaDevices.enumerateDevices().then(k=>{v.value=k.filter(({kind:x})=>x==="videoinput"),v.value.length>0?p.value=v.value[0]:C.value="no_cam_on_device"}).catch(k=>{_(k)}):C.value="secured_context_required"});const _=P=>{P.name==="NotAllowedError"?C.value="need_grant_permission":P.name==="NotFoundError"?C.value="no_cam_on_device":P.name==="NotSupportedError"||P.name==="InsecureContextError"?C.value="secured_context_required":P.name==="NotReadableError"?C.value="not_readable":P.name==="OverconstrainedError"?C.value="camera_not_suitable":P.name==="StreamApiNotSupportedError"?C.value="stream_api_not_supported":c.error(P)},b=async P=>{const[k]=P;h.uri=k.rawValue,h.uri?h.uri.slice(0,33).toLowerCase()=="otpauth-migration://offline?data="?(a.migrationUri=h.uri,i.push({name:"importAccounts"})):h.uri.slice(0,15).toLowerCase()!=="otpauth://totp/"&&h.uri.slice(0,15).toLowerCase()!=="otpauth://hotp/"?(w.value=!0,c.warn({text:Sr("errors.no_valid_otp")})):(a.decodedUri=h.uri,i.push({name:"createAccount"})):c.warn({text:Sr("errors.qrcode_cannot_be_read")})};function j(P){f.value=!0}function R(P){f.value=!1}function A(){i.go(-1)}const I=(P,k)=>{for(const x of P){const[S,...M]=x.cornerPoints;k.strokeStyle="red",k.beginPath(),k.moveTo(S.x,S.y);for(const{x:H,y:ae}of M)k.lineTo(H,ae);k.lineTo(S.x,S.y),k.closePath(),k.stroke()}};function L(){location.reload()}return(P,k)=>{const x=Lt("FontAwesomeIcon"),S=Lt("ButtonBackCloseCancel"),M=Lt("modal");return ue(),ve(Tr,null,[U("div",Zi,[k[4]||(k[4]=U("div",{class:"modal-background"},null,-1)),U("div",es,[U("section",ts,[U("div",rs,[U("div",ns,[U("div",as,[pe(Z(Ro),null,{default:br(({mode:H})=>[Z(C)?(ue(),ve("div",os,[U("p",is,Se(P.$t("twofaccounts.stream.live_scan_cant_start")),1),U("p",{class:$r(["block",{"has-text-light":H=="dark"}])},Se(P.$t("twofaccounts.stream."+Z(C)+".reason")),3),Z(C)=="need_grant_permission"?(ue(),ve("div",ss,[U("p",cs,Se(P.$t("twofaccounts.stream.need_grant_permission.solution")),1),U("p",us,Se(P.$t("twofaccounts.stream.need_grant_permission.click_camera_icon")),1),U("div",ls,[U("div",ds,[pe(x,{icon:["fas","lock"],class:"ml-1",size:"xs"}),pe(x,{icon:["fas","video-slash"],class:"ml-3",size:"xs"})]),k[3]||(k[3]=U("div",{class:"column has-text-left ml-3"}," http://my.2fauth.app/... ",-1)),U("div",fs,[pe(x,{icon:["far","star"],class:"mr-1"})])]),U("p",null,[U("a",{onClick:jo(L,["stop"])},Se(P.$t("commons.refresh")),1)])])):(ue(),ve("p",hs,Se(P.$t("twofaccounts.stream."+Z(C)+".solution")),1))])):(ue(),ve("span",{key:1,class:$r(["is-size-4",H=="dark"?"has-text-light":"has-text-grey-dark"])},[pe(Wo,{isVisible:!0,type:"raw",class:"is-size-1"})],2))]),_:1})])])])])]),Ht(U("div",ps,[Z(p)!==null?(ue(),xo(Z(Ki),{key:0,track:I,onDetect:b,onError:_,onCameraOn:j,onCameraOff:R})):Cr("",!0),Z(f)&&Z(v).length>1?(ue(),ve("div",ms,[U("p",vs,[U("span",ys,[Ht(U("select",{"onUpdate:modelValue":k[0]||(k[0]=H=>_r(p)?p.value=H:null)},[(ue(!0),ve(Tr,null,Ao(Z(v),H=>(ue(),ve("option",{key:H.label,value:H},Se(H.label?H.label:P.$t("commons.default")),9,gs))),128))],512),[[ko,Z(p)]])]),U("span",ws,[pe(x,{icon:["fas","camera"]})])])])):Cr("",!0)],512),[[Wr,!Z(C)]]),U("div",bs,[pe(S,{action:"cancel",isCapture:!0,useLinkTag:!1,onCanceled:k[1]||(k[1]=H=>A())})])]),pe(M,{modelValue:Z(w),"onUpdate:modelValue":k[2]||(k[2]=H=>_r(w)?w.value=H:null)},{default:br(()=>[pe(Uo,{qrContent:Z(h).uri},null,8,["qrContent"])]),_:1},8,["modelValue"])],64)}}};export{Ps as default};
//# sourceMappingURL=Capture-x-RcmcHd.js.map