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