diff --git a/dist/assets/index.42417b10.js b/dist/assets/index.e641ed81.js similarity index 91% rename from dist/assets/index.42417b10.js rename to dist/assets/index.e641ed81.js index 869f19b..8e44d44 100644 --- a/dist/assets/index.42417b10.js +++ b/dist/assets/index.e641ed81.js @@ -1,4 +1,4 @@ -function xl(o,a){return a.forEach(function(f){f&&typeof f!="string"&&!Array.isArray(f)&&Object.keys(f).forEach(function(h){if(h!=="default"&&!(h in o)){var d=Object.getOwnPropertyDescriptor(f,h);Object.defineProperty(o,h,d.get?d:{enumerable:!0,get:function(){return f[h]}})}})}),Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}const Al=function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))h(d);new MutationObserver(d=>{for(const x of d)if(x.type==="childList")for(const p of x.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&h(p)}).observe(document,{childList:!0,subtree:!0});function f(d){const x={};return d.integrity&&(x.integrity=d.integrity),d.referrerpolicy&&(x.referrerPolicy=d.referrerpolicy),d.crossorigin==="use-credentials"?x.credentials="include":d.crossorigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function h(d){if(d.ep)return;d.ep=!0;const x=f(d);fetch(d.href,x)}};Al();function ls(o,a){const f=Object.create(null),h=o.split(",");for(let d=0;d!!f[d.toLowerCase()]:d=>!!f[d]}const wl="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",El=ls(wl);function Oo(o){return!!o||o===""}function cs(o){if(be(o)){const a={};for(let f=0;f{if(f){const h=f.split(Cl);h.length>1&&(a[h[0].trim()]=h[1].trim())}}),a}function fs(o){let a="";if(Tt(o))a=o;else if(be(o))for(let f=0;fTt(o)?o:o==null?"":be(o)||St(o)&&(o.toString===Bo||!Ne(o.toString))?JSON.stringify(o,Do,2):String(o),Do=(o,a)=>a&&a.__v_isRef?Do(o,a.value):gr(a)?{[`Map(${a.size})`]:[...a.entries()].reduce((f,[h,d])=>(f[`${h} =>`]=d,f),{})}:Ro(a)?{[`Set(${a.size})`]:[...a.values()]}:St(a)&&!be(a)&&!vo(a)?String(a):a,$e={},dr=[],tn=()=>{},Tl=()=>!1,Sl=/^on[^a-z]/,ui=o=>Sl.test(o),us=o=>o.startsWith("onUpdate:"),_t=Object.assign,hs=(o,a)=>{const f=o.indexOf(a);f>-1&&o.splice(f,1)},bl=Object.prototype.hasOwnProperty,Le=(o,a)=>bl.call(o,a),be=Array.isArray,gr=o=>hi(o)==="[object Map]",Ro=o=>hi(o)==="[object Set]",Ne=o=>typeof o=="function",Tt=o=>typeof o=="string",ds=o=>typeof o=="symbol",St=o=>o!==null&&typeof o=="object",Lo=o=>St(o)&&Ne(o.then)&&Ne(o.catch),Bo=Object.prototype.toString,hi=o=>Bo.call(o),yl=o=>hi(o).slice(8,-1),vo=o=>hi(o)==="[object Object]",gs=o=>Tt(o)&&o!=="NaN"&&o[0]!=="-"&&""+parseInt(o,10)===o,ni=ls(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),di=o=>{const a=Object.create(null);return f=>a[f]||(a[f]=o(f))},Nl=/-(\w)/g,Ar=di(o=>o.replace(Nl,(a,f)=>f?f.toUpperCase():"")),_l=/\B([A-Z])/g,Er=di(o=>o.replace(_l,"-$1").toLowerCase()),Po=di(o=>o.charAt(0).toUpperCase()+o.slice(1)),Fi=di(o=>o?`on${Po(o)}`:""),Fr=(o,a)=>!Object.is(o,a),ki=(o,a)=>{for(let f=0;f{Object.defineProperty(o,a,{configurable:!0,enumerable:!1,value:f})},Ml=o=>{const a=parseFloat(o);return isNaN(a)?o:a};let Zs;const Ol=()=>Zs||(Zs=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});let un;class Dl{constructor(a=!1){this.active=!0,this.effects=[],this.cleanups=[],!a&&un&&(this.parent=un,this.index=(un.scopes||(un.scopes=[])).push(this)-1)}run(a){if(this.active){const f=un;try{return un=this,a()}finally{un=f}}}on(){un=this}off(){un=this.parent}stop(a){if(this.active){let f,h;for(f=0,h=this.effects.length;f{const a=new Set(o);return a.w=0,a.n=0,a},Fo=o=>(o.w&Bn)>0,ko=o=>(o.n&Bn)>0,Ll=({deps:o})=>{if(o.length)for(let a=0;a{const{deps:a}=o;if(a.length){let f=0;for(let h=0;h{(S==="length"||S>=h)&&T.push(m)});else switch(f!==void 0&&T.push(p.get(f)),a){case"add":be(o)?gs(f)&&T.push(p.get("length")):(T.push(p.get(Xn)),gr(o)&&T.push(p.get(Xi)));break;case"delete":be(o)||(T.push(p.get(Xn)),gr(o)&&T.push(p.get(Xi)));break;case"set":gr(o)&&T.push(p.get(Xn));break}if(T.length===1)T[0]&&Zi(T[0]);else{const m=[];for(const S of T)S&&m.push(...S);Zi(xs(m))}}function Zi(o,a){for(const f of be(o)?o:[...o])(f!==en||f.allowRecurse)&&(f.scheduler?f.scheduler():f.run())}const vl=ls("__proto__,__v_isRef,__isVue"),jo=new Set(Object.getOwnPropertyNames(Symbol).map(o=>Symbol[o]).filter(ds)),Pl=ws(),Fl=ws(!1,!0),kl=ws(!0),Qs=Ul();function Ul(){const o={};return["includes","indexOf","lastIndexOf"].forEach(a=>{o[a]=function(...f){const h=ke(this);for(let x=0,p=this.length;x{o[a]=function(...f){pr();const h=ke(this)[a].apply(this,f);return Cr(),h}}),o}function ws(o=!1,a=!1){return function(h,d,x){if(d==="__v_isReactive")return!o;if(d==="__v_isReadonly")return o;if(d==="__v_isShallow")return a;if(d==="__v_raw"&&x===(o?a?t1:Go:a?Yo:Wo).get(h))return h;const p=be(h);if(!o&&p&&Le(Qs,d))return Reflect.get(Qs,d,x);const T=Reflect.get(h,d,x);return(ds(d)?jo.has(d):vl(d))||(o||jt(h,"get",d),a)?T:It(T)?!p||!gs(d)?T.value:T:St(T)?o?Xo(T):Cs(T):T}}const Hl=Vo(),jl=Vo(!0);function Vo(o=!1){return function(f,h,d,x){let p=f[h];if(kr(p)&&It(p)&&!It(d))return!1;if(!o&&!kr(d)&&(Zo(d)||(d=ke(d),p=ke(p)),!be(f)&&It(p)&&!It(d)))return p.value=d,!0;const T=be(f)&&gs(h)?Number(h)o,gi=o=>Reflect.getPrototypeOf(o);function qr(o,a,f=!1,h=!1){o=o.__v_raw;const d=ke(o),x=ke(a);a!==x&&!f&&jt(d,"get",a),!f&&jt(d,"get",x);const{has:p}=gi(d),T=h?Es:f?Is:Ur;if(p.call(d,a))return T(o.get(a));if(p.call(d,x))return T(o.get(x));o!==d&&o.get(a)}function Jr(o,a=!1){const f=this.__v_raw,h=ke(f),d=ke(o);return o!==d&&!a&&jt(h,"has",o),!a&&jt(h,"has",d),o===d?f.has(o):f.has(o)||f.has(d)}function $r(o,a=!1){return o=o.__v_raw,!a&&jt(ke(o),"iterate",Xn),Reflect.get(o,"size",o)}function qs(o){o=ke(o);const a=ke(this);return gi(a).has.call(a,o)||(a.add(o),pn(a,"add",o,o)),this}function Js(o,a){a=ke(a);const f=ke(this),{has:h,get:d}=gi(f);let x=h.call(f,o);x||(o=ke(o),x=h.call(f,o));const p=d.call(f,o);return f.set(o,a),x?Fr(a,p)&&pn(f,"set",o,a):pn(f,"add",o,a),this}function $s(o){const a=ke(this),{has:f,get:h}=gi(a);let d=f.call(a,o);d||(o=ke(o),d=f.call(a,o)),h&&h.call(a,o);const x=a.delete(o);return d&&pn(a,"delete",o,void 0),x}function eo(){const o=ke(this),a=o.size!==0,f=o.clear();return a&&pn(o,"clear",void 0,void 0),f}function ei(o,a){return function(h,d){const x=this,p=x.__v_raw,T=ke(p),m=a?Es:o?Is:Ur;return!o&&jt(T,"iterate",Xn),p.forEach((S,M)=>h.call(d,m(S),m(M),x))}}function ti(o,a,f){return function(...h){const d=this.__v_raw,x=ke(d),p=gr(x),T=o==="entries"||o===Symbol.iterator&&p,m=o==="keys"&&p,S=d[o](...h),M=f?Es:a?Is:Ur;return!a&&jt(x,"iterate",m?Xi:Xn),{next(){const{value:j,done:U}=S.next();return U?{value:j,done:U}:{value:T?[M(j[0]),M(j[1])]:M(j),done:U}},[Symbol.iterator](){return this}}}}function Mn(o){return function(...a){return o==="delete"?!1:this}}function Xl(){const o={get(x){return qr(this,x)},get size(){return $r(this)},has:Jr,add:qs,set:Js,delete:$s,clear:eo,forEach:ei(!1,!1)},a={get(x){return qr(this,x,!1,!0)},get size(){return $r(this)},has:Jr,add:qs,set:Js,delete:$s,clear:eo,forEach:ei(!1,!0)},f={get(x){return qr(this,x,!0)},get size(){return $r(this,!0)},has(x){return Jr.call(this,x,!0)},add:Mn("add"),set:Mn("set"),delete:Mn("delete"),clear:Mn("clear"),forEach:ei(!0,!1)},h={get(x){return qr(this,x,!0,!0)},get size(){return $r(this,!0)},has(x){return Jr.call(this,x,!0)},add:Mn("add"),set:Mn("set"),delete:Mn("delete"),clear:Mn("clear"),forEach:ei(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(x=>{o[x]=ti(x,!1,!1),f[x]=ti(x,!0,!1),a[x]=ti(x,!1,!0),h[x]=ti(x,!0,!0)}),[o,f,a,h]}const[Zl,Kl,Ql,ql]=Xl();function ps(o,a){const f=a?o?ql:Ql:o?Kl:Zl;return(h,d,x)=>d==="__v_isReactive"?!o:d==="__v_isReadonly"?o:d==="__v_raw"?h:Reflect.get(Le(f,d)&&d in h?f:h,d,x)}const Jl={get:ps(!1,!1)},$l={get:ps(!1,!0)},e1={get:ps(!0,!1)},Wo=new WeakMap,Yo=new WeakMap,Go=new WeakMap,t1=new WeakMap;function n1(o){switch(o){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function r1(o){return o.__v_skip||!Object.isExtensible(o)?0:n1(yl(o))}function Cs(o){return kr(o)?o:ms(o,!1,zo,Jl,Wo)}function i1(o){return ms(o,!1,Gl,$l,Yo)}function Xo(o){return ms(o,!0,Yl,e1,Go)}function ms(o,a,f,h,d){if(!St(o)||o.__v_raw&&!(a&&o.__v_isReactive))return o;const x=d.get(o);if(x)return x;const p=r1(o);if(p===0)return o;const T=new Proxy(o,p===2?h:f);return d.set(o,T),T}function xr(o){return kr(o)?xr(o.__v_raw):!!(o&&o.__v_isReactive)}function kr(o){return!!(o&&o.__v_isReadonly)}function Zo(o){return!!(o&&o.__v_isShallow)}function Ko(o){return xr(o)||kr(o)}function ke(o){const a=o&&o.__v_raw;return a?ke(a):o}function Qo(o){return ii(o,"__v_skip",!0),o}const Ur=o=>St(o)?Cs(o):o,Is=o=>St(o)?Xo(o):o;function qo(o){Rn&&en&&(o=ke(o),Ho(o.dep||(o.dep=xs())))}function Jo(o,a){o=ke(o),o.dep&&Zi(o.dep)}function It(o){return!!(o&&o.__v_isRef===!0)}function s1(o){return o1(o,!1)}function o1(o,a){return It(o)?o:new a1(o,a)}class a1{constructor(a,f){this.__v_isShallow=f,this.dep=void 0,this.__v_isRef=!0,this._rawValue=f?a:ke(a),this._value=f?a:Ur(a)}get value(){return qo(this),this._value}set value(a){a=this.__v_isShallow?a:ke(a),Fr(a,this._rawValue)&&(this._rawValue=a,this._value=this.__v_isShallow?a:Ur(a),Jo(this))}}function $o(o){return It(o)?o.value:o}const l1={get:(o,a,f)=>$o(Reflect.get(o,a,f)),set:(o,a,f,h)=>{const d=o[a];return It(d)&&!It(f)?(d.value=f,!0):Reflect.set(o,a,f,h)}};function ea(o){return xr(o)?o:new Proxy(o,l1)}class c1{constructor(a,f,h,d){this._setter=f,this.dep=void 0,this.__v_isRef=!0,this._dirty=!0,this.effect=new As(a,()=>{this._dirty||(this._dirty=!0,Jo(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!d,this.__v_isReadonly=h}get value(){const a=ke(this);return qo(a),(a._dirty||!a._cacheable)&&(a._dirty=!1,a._value=a.effect.run()),a._value}set value(a){this._setter(a)}}function f1(o,a,f=!1){let h,d;const x=Ne(o);return x?(h=o,d=tn):(h=o.get,d=o.set),new c1(h,d,x||!d,f)}function Ln(o,a,f,h){let d;try{d=h?o(...h):o()}catch(x){xi(x,a,f)}return d}function Kt(o,a,f,h){if(Ne(o)){const x=Ln(o,a,f,h);return x&&Lo(x)&&x.catch(p=>{xi(p,a,f)}),x}const d=[];for(let x=0;x>>1;Hr(Ht[h])An&&Ht.splice(a,1)}function sa(o,a,f,h){be(o)?f.push(...o):(!a||!a.includes(o,o.allowRecurse?h+1:h))&&f.push(o),ia()}function g1(o){sa(o,Lr,Br,cr)}function x1(o){sa(o,On,vr,fr)}function Ss(o,a=null){if(Br.length){for(Qi=a,Lr=[...new Set(Br)],Br.length=0,cr=0;crHr(f)-Hr(h)),fr=0;fro.id==null?1/0:o.id;function aa(o){Ki=!1,si=!0,Ss(o),Ht.sort((f,h)=>Hr(f)-Hr(h));const a=tn;try{for(An=0;Anne.trim()):j&&(d=f.map(Ml))}let T,m=h[T=Fi(a)]||h[T=Fi(Ar(a))];!m&&x&&(m=h[T=Fi(Er(a))]),m&&Kt(m,o,6,d);const S=h[T+"Once"];if(S){if(!o.emitted)o.emitted={};else if(o.emitted[T])return;o.emitted[T]=!0,Kt(S,o,6,d)}}function la(o,a,f=!1){const h=a.emitsCache,d=h.get(o);if(d!==void 0)return d;const x=o.emits;let p={},T=!1;if(!Ne(o)){const m=S=>{const M=la(S,a,!0);M&&(T=!0,_t(p,M))};!f&&a.mixins.length&&a.mixins.forEach(m),o.extends&&m(o.extends),o.mixins&&o.mixins.forEach(m)}return!x&&!T?(h.set(o,null),null):(be(x)?x.forEach(m=>p[m]=null):_t(p,x),h.set(o,p),p)}function Ai(o,a){return!o||!ui(a)?!1:(a=a.slice(2).replace(/Once$/,""),Le(o,a[0].toLowerCase()+a.slice(1))||Le(o,Er(a))||Le(o,a))}let gn=null,ca=null;function oi(o){const a=gn;return gn=o,ca=o&&o.type.__scopeId||null,a}function w1(o,a=gn,f){if(!a||o._n)return o;const h=(...d)=>{h._d&&fo(-1);const x=oi(a),p=o(...d);return oi(x),h._d&&fo(1),p};return h._n=!0,h._c=!0,h._d=!0,h}function Ui(o){const{type:a,vnode:f,proxy:h,withProxy:d,props:x,propsOptions:[p],slots:T,attrs:m,emit:S,render:M,renderCache:j,data:U,setupState:ne,ctx:K,inheritAttrs:fe}=o;let ue,$;const se=oi(o);try{if(f.shapeFlag&4){const Xe=d||h;ue=hn(M.call(Xe,Xe,j,x,ne,U,K)),$=m}else{const Xe=a;ue=hn(Xe.length>1?Xe(x,{attrs:m,slots:T,emit:S}):Xe(x,null)),$=a.props?m:E1(m)}}catch(Xe){Pr.length=0,xi(Xe,o,1),ue=En(wn)}let Ee=ue;if($&&fe!==!1){const Xe=Object.keys($),{shapeFlag:me}=Ee;Xe.length&&me&7&&(p&&Xe.some(us)&&($=p1($,p)),Ee=Qn(Ee,$))}return f.dirs&&(Ee.dirs=Ee.dirs?Ee.dirs.concat(f.dirs):f.dirs),f.transition&&(Ee.transition=f.transition),ue=Ee,oi(se),ue}const E1=o=>{let a;for(const f in o)(f==="class"||f==="style"||ui(f))&&((a||(a={}))[f]=o[f]);return a},p1=(o,a)=>{const f={};for(const h in o)(!us(h)||!(h.slice(9)in a))&&(f[h]=o[h]);return f};function C1(o,a,f){const{props:h,children:d,component:x}=o,{props:p,children:T,patchFlag:m}=a,S=x.emitsOptions;if(a.dirs||a.transition)return!0;if(f&&m>=0){if(m&1024)return!0;if(m&16)return h?to(h,p,S):!!p;if(m&8){const M=a.dynamicProps;for(let j=0;jo.__isSuspense;function T1(o,a){a&&a.pendingBranch?be(o)?a.effects.push(...o):a.effects.push(o):x1(o)}function S1(o,a){if(mt){let f=mt.provides;const h=mt.parent&&mt.parent.provides;h===f&&(f=mt.provides=Object.create(h)),f[o]=a}}function Hi(o,a,f=!1){const h=mt||gn;if(h){const d=h.parent==null?h.vnode.appContext&&h.vnode.appContext.provides:h.parent.provides;if(d&&o in d)return d[o];if(arguments.length>1)return f&&Ne(a)?a.call(h.proxy):a}}const no={};function ji(o,a,f){return fa(o,a,f)}function fa(o,a,{immediate:f,deep:h,flush:d,onTrack:x,onTrigger:p}=$e){const T=mt;let m,S=!1,M=!1;if(It(o)?(m=()=>o.value,S=Zo(o)):xr(o)?(m=()=>o,h=!0):be(o)?(M=!0,S=o.some(xr),m=()=>o.map($=>{if(It($))return $.value;if(xr($))return ur($);if(Ne($))return Ln($,T,2)})):Ne(o)?a?m=()=>Ln(o,T,2):m=()=>{if(!(T&&T.isUnmounted))return j&&j(),Kt(o,T,3,[U])}:m=tn,a&&h){const $=m;m=()=>ur($())}let j,U=$=>{j=ue.onStop=()=>{Ln($,T,4)}};if(jr)return U=tn,a?f&&Kt(a,T,3,[m(),M?[]:void 0,U]):m(),tn;let ne=M?[]:no;const K=()=>{if(!!ue.active)if(a){const $=ue.run();(h||S||(M?$.some((se,Ee)=>Fr(se,ne[Ee])):Fr($,ne)))&&(j&&j(),Kt(a,T,3,[$,ne===no?void 0:ne,U]),ne=$)}else ue.run()};K.allowRecurse=!!a;let fe;d==="sync"?fe=K:d==="post"?fe=()=>Ft(K,T&&T.suspense):fe=()=>{!T||T.isMounted?g1(K):K()};const ue=new As(m,fe);return a?f?K():ne=ue.run():d==="post"?Ft(ue.run.bind(ue),T&&T.suspense):ue.run(),()=>{ue.stop(),T&&T.scope&&hs(T.scope.effects,ue)}}function b1(o,a,f){const h=this.proxy,d=Tt(o)?o.includes(".")?ua(h,o):()=>h[o]:o.bind(h,h);let x;Ne(a)?x=a:(x=a.handler,f=a);const p=mt;wr(this);const T=fa(d,x.bind(h),f);return p?wr(p):Kn(),T}function ua(o,a){const f=a.split(".");return()=>{let h=o;for(let d=0;d{ur(f,a)});else if(vo(o))for(const f in o)ur(o[f],a);return o}function y1(){const o={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return xa(()=>{o.isMounted=!0}),Aa(()=>{o.isUnmounting=!0}),o}const Gt=[Function,Array],N1={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Gt,onEnter:Gt,onAfterEnter:Gt,onEnterCancelled:Gt,onBeforeLeave:Gt,onLeave:Gt,onAfterLeave:Gt,onLeaveCancelled:Gt,onBeforeAppear:Gt,onAppear:Gt,onAfterAppear:Gt,onAppearCancelled:Gt},setup(o,{slots:a}){const f=dc(),h=y1();let d;return()=>{const x=a.default&&da(a.default(),!0);if(!x||!x.length)return;let p=x[0];if(x.length>1){for(const fe of x)if(fe.type!==wn){p=fe;break}}const T=ke(o),{mode:m}=T;if(h.isLeaving)return Vi(p);const S=ro(p);if(!S)return Vi(p);const M=qi(S,T,h,f);Ji(S,M);const j=f.subTree,U=j&&ro(j);let ne=!1;const{getTransitionKey:K}=S.type;if(K){const fe=K();d===void 0?d=fe:fe!==d&&(d=fe,ne=!0)}if(U&&U.type!==wn&&(!Yn(S,U)||ne)){const fe=qi(U,T,h,f);if(Ji(U,fe),m==="out-in")return h.isLeaving=!0,fe.afterLeave=()=>{h.isLeaving=!1,f.update()},Vi(p);m==="in-out"&&S.type!==wn&&(fe.delayLeave=(ue,$,se)=>{const Ee=ha(h,U);Ee[String(U.key)]=U,ue._leaveCb=()=>{$(),ue._leaveCb=void 0,delete M.delayedLeave},M.delayedLeave=se})}return p}}},_1=N1;function ha(o,a){const{leavingVNodes:f}=o;let h=f.get(a.type);return h||(h=Object.create(null),f.set(a.type,h)),h}function qi(o,a,f,h){const{appear:d,mode:x,persisted:p=!1,onBeforeEnter:T,onEnter:m,onAfterEnter:S,onEnterCancelled:M,onBeforeLeave:j,onLeave:U,onAfterLeave:ne,onLeaveCancelled:K,onBeforeAppear:fe,onAppear:ue,onAfterAppear:$,onAppearCancelled:se}=a,Ee=String(o.key),Xe=ha(f,o),me=(ae,V)=>{ae&&Kt(ae,h,9,V)},G={mode:x,persisted:p,beforeEnter(ae){let V=T;if(!f.isMounted)if(d)V=fe||T;else return;ae._leaveCb&&ae._leaveCb(!0);const ve=Xe[Ee];ve&&Yn(o,ve)&&ve.el._leaveCb&&ve.el._leaveCb(),me(V,[ae])},enter(ae){let V=m,ve=S,ze=M;if(!f.isMounted)if(d)V=ue||m,ve=$||S,ze=se||M;else return;let le=!1;const Ie=ae._enterCb=et=>{le||(le=!0,et?me(ze,[ae]):me(ve,[ae]),G.delayedLeave&&G.delayedLeave(),ae._enterCb=void 0)};V?(V(ae,Ie),V.length<=1&&Ie()):Ie()},leave(ae,V){const ve=String(o.key);if(ae._enterCb&&ae._enterCb(!0),f.isUnmounting)return V();me(j,[ae]);let ze=!1;const le=ae._leaveCb=Ie=>{ze||(ze=!0,V(),Ie?me(K,[ae]):me(ne,[ae]),ae._leaveCb=void 0,Xe[ve]===o&&delete Xe[ve])};Xe[ve]=o,U?(U(ae,le),U.length<=1&&le()):le()},clone(ae){return qi(ae,a,f,h)}};return G}function Vi(o){if(wi(o))return o=Qn(o),o.children=null,o}function ro(o){return wi(o)?o.children?o.children[0]:void 0:o}function Ji(o,a){o.shapeFlag&6&&o.component?Ji(o.component.subTree,a):o.shapeFlag&128?(o.ssContent.transition=a.clone(o.ssContent),o.ssFallback.transition=a.clone(o.ssFallback)):o.transition=a}function da(o,a=!1,f){let h=[],d=0;for(let x=0;x1)for(let x=0;x!!o.type.__asyncLoader,wi=o=>o.type.__isKeepAlive;function M1(o,a){ga(o,"a",a)}function O1(o,a){ga(o,"da",a)}function ga(o,a,f=mt){const h=o.__wdc||(o.__wdc=()=>{let d=f;for(;d;){if(d.isDeactivated)return;d=d.parent}return o()});if(Ei(a,h,f),f){let d=f.parent;for(;d&&d.parent;)wi(d.parent.vnode)&&D1(h,a,f,d),d=d.parent}}function D1(o,a,f,h){const d=Ei(a,o,h,!0);wa(()=>{hs(h[a],d)},f)}function Ei(o,a,f=mt,h=!1){if(f){const d=f[o]||(f[o]=[]),x=a.__weh||(a.__weh=(...p)=>{if(f.isUnmounted)return;pr(),wr(f);const T=Kt(a,f,o,p);return Kn(),Cr(),T});return h?d.unshift(x):d.push(x),x}}const Cn=o=>(a,f=mt)=>(!jr||o==="sp")&&Ei(o,a,f),R1=Cn("bm"),xa=Cn("m"),L1=Cn("bu"),B1=Cn("u"),Aa=Cn("bum"),wa=Cn("um"),v1=Cn("sp"),P1=Cn("rtg"),F1=Cn("rtc");function k1(o,a=mt){Ei("ec",o,a)}let es=!0;function U1(o){const a=pa(o),f=o.proxy,h=o.ctx;es=!1,a.beforeCreate&&io(a.beforeCreate,o,"bc");const{data:d,computed:x,methods:p,watch:T,provide:m,inject:S,created:M,beforeMount:j,mounted:U,beforeUpdate:ne,updated:K,activated:fe,deactivated:ue,beforeDestroy:$,beforeUnmount:se,destroyed:Ee,unmounted:Xe,render:me,renderTracked:G,renderTriggered:ae,errorCaptured:V,serverPrefetch:ve,expose:ze,inheritAttrs:le,components:Ie,directives:et,filters:F}=a;if(S&&H1(S,h,null,o.appContext.config.unwrapInjectedRef),p)for(const We in p){const Re=p[We];Ne(Re)&&(h[We]=Re.bind(f))}if(d){const We=d.call(f,f);St(We)&&(o.data=Cs(We))}if(es=!0,x)for(const We in x){const Re=x[We],xt=Ne(Re)?Re.bind(f,f):Ne(Re.get)?Re.get.bind(f,f):tn,qn=!Ne(Re)&&Ne(Re.set)?Re.set.bind(f):tn,ft=pc({get:xt,set:qn});Object.defineProperty(h,We,{enumerable:!0,configurable:!0,get:()=>ft.value,set:Dt=>ft.value=Dt})}if(T)for(const We in T)Ea(T[We],h,f,We);if(m){const We=Ne(m)?m.call(f):m;Reflect.ownKeys(We).forEach(Re=>{S1(Re,We[Re])})}M&&io(M,o,"c");function he(We,Re){be(Re)?Re.forEach(xt=>We(xt.bind(f))):Re&&We(Re.bind(f))}if(he(R1,j),he(xa,U),he(L1,ne),he(B1,K),he(M1,fe),he(O1,ue),he(k1,V),he(F1,G),he(P1,ae),he(Aa,se),he(wa,Xe),he(v1,ve),be(ze))if(ze.length){const We=o.exposed||(o.exposed={});ze.forEach(Re=>{Object.defineProperty(We,Re,{get:()=>f[Re],set:xt=>f[Re]=xt})})}else o.exposed||(o.exposed={});me&&o.render===tn&&(o.render=me),le!=null&&(o.inheritAttrs=le),Ie&&(o.components=Ie),et&&(o.directives=et)}function H1(o,a,f=tn,h=!1){be(o)&&(o=ts(o));for(const d in o){const x=o[d];let p;St(x)?"default"in x?p=Hi(x.from||d,x.default,!0):p=Hi(x.from||d):p=Hi(x),It(p)&&h?Object.defineProperty(a,d,{enumerable:!0,configurable:!0,get:()=>p.value,set:T=>p.value=T}):a[d]=p}}function io(o,a,f){Kt(be(o)?o.map(h=>h.bind(a.proxy)):o.bind(a.proxy),a,f)}function Ea(o,a,f,h){const d=h.includes(".")?ua(f,h):()=>f[h];if(Tt(o)){const x=a[o];Ne(x)&&ji(d,x)}else if(Ne(o))ji(d,o.bind(f));else if(St(o))if(be(o))o.forEach(x=>Ea(x,a,f,h));else{const x=Ne(o.handler)?o.handler.bind(f):a[o.handler];Ne(x)&&ji(d,x,o)}}function pa(o){const a=o.type,{mixins:f,extends:h}=a,{mixins:d,optionsCache:x,config:{optionMergeStrategies:p}}=o.appContext,T=x.get(a);let m;return T?m=T:!d.length&&!f&&!h?m=a:(m={},d.length&&d.forEach(S=>ai(m,S,p,!0)),ai(m,a,p)),x.set(a,m),m}function ai(o,a,f,h=!1){const{mixins:d,extends:x}=a;x&&ai(o,x,f,!0),d&&d.forEach(p=>ai(o,p,f,!0));for(const p in a)if(!(h&&p==="expose")){const T=j1[p]||f&&f[p];o[p]=T?T(o[p],a[p]):a[p]}return o}const j1={data:so,props:Wn,emits:Wn,methods:Wn,computed:Wn,beforeCreate:Ot,created:Ot,beforeMount:Ot,mounted:Ot,beforeUpdate:Ot,updated:Ot,beforeDestroy:Ot,beforeUnmount:Ot,destroyed:Ot,unmounted:Ot,activated:Ot,deactivated:Ot,errorCaptured:Ot,serverPrefetch:Ot,components:Wn,directives:Wn,watch:z1,provide:so,inject:V1};function so(o,a){return a?o?function(){return _t(Ne(o)?o.call(this,this):o,Ne(a)?a.call(this,this):a)}:a:o}function V1(o,a){return Wn(ts(o),ts(a))}function ts(o){if(be(o)){const a={};for(let f=0;f0)&&!(p&16)){if(p&8){const M=o.vnode.dynamicProps;for(let j=0;j{m=!0;const[U,ne]=ma(j,a,!0);_t(p,U),ne&&T.push(...ne)};!f&&a.mixins.length&&a.mixins.forEach(M),o.extends&&M(o.extends),o.mixins&&o.mixins.forEach(M)}if(!x&&!m)return h.set(o,dr),dr;if(be(x))for(let M=0;M-1,ne[1]=fe<0||K-1||Le(ne,"default"))&&T.push(j)}}}const S=[p,T];return h.set(o,S),S}function oo(o){return o[0]!=="$"}function ao(o){const a=o&&o.toString().match(/^\s*function (\w+)/);return a?a[1]:o===null?"null":""}function lo(o,a){return ao(o)===ao(a)}function co(o,a){return be(a)?a.findIndex(f=>lo(f,o)):Ne(a)&&lo(a,o)?0:-1}const Ia=o=>o[0]==="_"||o==="$stable",ys=o=>be(o)?o.map(hn):[hn(o)],G1=(o,a,f)=>{const h=w1((...d)=>ys(a(...d)),f);return h._c=!1,h},Ta=(o,a,f)=>{const h=o._ctx;for(const d in o){if(Ia(d))continue;const x=o[d];if(Ne(x))a[d]=G1(d,x,h);else if(x!=null){const p=ys(x);a[d]=()=>p}}},Sa=(o,a)=>{const f=ys(a);o.slots.default=()=>f},X1=(o,a)=>{if(o.vnode.shapeFlag&32){const f=a._;f?(o.slots=ke(a),ii(a,"_",f)):Ta(a,o.slots={})}else o.slots={},a&&Sa(o,a);ii(o.slots,pi,1)},Z1=(o,a,f)=>{const{vnode:h,slots:d}=o;let x=!0,p=$e;if(h.shapeFlag&32){const T=a._;T?f&&T===1?x=!1:(_t(d,a),!f&&T===1&&delete d._):(x=!a.$stable,Ta(a,d)),p=a}else a&&(Sa(o,a),p={default:1});if(x)for(const T in d)!Ia(T)&&!(T in p)&&delete d[T]};function Vn(o,a,f,h){const d=o.dirs,x=a&&a.dirs;for(let p=0;prs(U,a&&(be(a)?a[ne]:a),f,h,d));return}if($i(h)&&!d)return;const x=h.shapeFlag&4?Os(h.component)||h.component.proxy:h.el,p=d?null:x,{i:T,r:m}=o,S=a&&a.r,M=T.refs===$e?T.refs={}:T.refs,j=T.setupState;if(S!=null&&S!==m&&(Tt(S)?(M[S]=null,Le(j,S)&&(j[S]=null)):It(S)&&(S.value=null)),Ne(m))Ln(m,T,12,[p,M]);else{const U=Tt(m),ne=It(m);if(U||ne){const K=()=>{if(o.f){const fe=U?M[m]:m.value;d?be(fe)&&hs(fe,x):be(fe)?fe.includes(x)||fe.push(x):U?(M[m]=[x],Le(j,m)&&(j[m]=M[m])):(m.value=[x],o.k&&(M[o.k]=m.value))}else U?(M[m]=p,Le(j,m)&&(j[m]=p)):It(m)&&(m.value=p,o.k&&(M[o.k]=p))};p?(K.id=-1,Ft(K,f)):K()}}}const Ft=T1;function q1(o){return J1(o)}function J1(o,a){const f=Ol();f.__VUE__=!0;const{insert:h,remove:d,patchProp:x,createElement:p,createText:T,createComment:m,setText:S,setElementText:M,parentNode:j,nextSibling:U,setScopeId:ne=tn,cloneNode:K,insertStaticContent:fe}=o,ue=(b,_,v,k=null,P=null,H=null,J=!1,R=null,Q=!!_.dynamicChildren)=>{if(b===_)return;b&&!Yn(b,_)&&(k=nn(b),rt(b,P,H,!0),b=null),_.patchFlag===-2&&(Q=!1,_.dynamicChildren=null);const{type:Y,ref:oe,shapeFlag:ie}=_;switch(Y){case Ns:$(b,_,v,k);break;case wn:se(b,_,v,k);break;case zi:b==null&&Ee(_,v,k,J);break;case $t:et(b,_,v,k,P,H,J,R,Q);break;default:ie&1?G(b,_,v,k,P,H,J,R,Q):ie&6?F(b,_,v,k,P,H,J,R,Q):(ie&64||ie&128)&&Y.process(b,_,v,k,P,H,J,R,Q,ut)}oe!=null&&P&&rs(oe,b&&b.ref,H,_||b,!_)},$=(b,_,v,k)=>{if(b==null)h(_.el=T(_.children),v,k);else{const P=_.el=b.el;_.children!==b.children&&S(P,_.children)}},se=(b,_,v,k)=>{b==null?h(_.el=m(_.children||""),v,k):_.el=b.el},Ee=(b,_,v,k)=>{[b.el,b.anchor]=fe(b.children,_,v,k,b.el,b.anchor)},Xe=({el:b,anchor:_},v,k)=>{let P;for(;b&&b!==_;)P=U(b),h(b,v,k),b=P;h(_,v,k)},me=({el:b,anchor:_})=>{let v;for(;b&&b!==_;)v=U(b),d(b),b=v;d(_)},G=(b,_,v,k,P,H,J,R,Q)=>{J=J||_.type==="svg",b==null?ae(_,v,k,P,H,J,R,Q):ze(b,_,P,H,J,R,Q)},ae=(b,_,v,k,P,H,J,R)=>{let Q,Y;const{type:oe,props:ie,shapeFlag:re,transition:we,patchFlag:pe,dirs:Te}=b;if(b.el&&K!==void 0&&pe===-1)Q=b.el=K(b.el);else{if(Q=b.el=p(b.type,H,ie&&ie.is,ie),re&8?M(Q,b.children):re&16&&ve(b.children,Q,null,k,P,H&&oe!=="foreignObject",J,R),Te&&Vn(b,null,k,"created"),ie){for(const He in ie)He!=="value"&&!ni(He)&&x(Q,He,null,ie[He],H,b.children,k,P,Ye);"value"in ie&&x(Q,"value",null,ie.value),(Y=ie.onVnodeBeforeMount)&&fn(Y,k,b)}V(Q,b,b.scopeId,J,k)}Te&&Vn(b,null,k,"beforeMount");const Ue=(!P||P&&!P.pendingBranch)&&we&&!we.persisted;Ue&&we.beforeEnter(Q),h(Q,_,v),((Y=ie&&ie.onVnodeMounted)||Ue||Te)&&Ft(()=>{Y&&fn(Y,k,b),Ue&&we.enter(Q),Te&&Vn(b,null,k,"mounted")},P)},V=(b,_,v,k,P)=>{if(v&&ne(b,v),k)for(let H=0;H{for(let Y=Q;Y{const R=_.el=b.el;let{patchFlag:Q,dynamicChildren:Y,dirs:oe}=_;Q|=b.patchFlag&16;const ie=b.props||$e,re=_.props||$e;let we;v&&zn(v,!1),(we=re.onVnodeBeforeUpdate)&&fn(we,v,_,b),oe&&Vn(_,b,v,"beforeUpdate"),v&&zn(v,!0);const pe=P&&_.type!=="foreignObject";if(Y?le(b.dynamicChildren,Y,R,v,k,pe,H):J||xt(b,_,R,null,v,k,pe,H,!1),Q>0){if(Q&16)Ie(R,_,ie,re,v,k,P);else if(Q&2&&ie.class!==re.class&&x(R,"class",null,re.class,P),Q&4&&x(R,"style",ie.style,re.style,P),Q&8){const Te=_.dynamicProps;for(let Ue=0;Ue{we&&fn(we,v,_,b),oe&&Vn(_,b,v,"updated")},k)},le=(b,_,v,k,P,H,J)=>{for(let R=0;R<_.length;R++){const Q=b[R],Y=_[R],oe=Q.el&&(Q.type===$t||!Yn(Q,Y)||Q.shapeFlag&70)?j(Q.el):v;ue(Q,Y,oe,null,k,P,H,J,!0)}},Ie=(b,_,v,k,P,H,J)=>{if(v!==k){for(const R in k){if(ni(R))continue;const Q=k[R],Y=v[R];Q!==Y&&R!=="value"&&x(b,R,Y,Q,J,_.children,P,H,Ye)}if(v!==$e)for(const R in v)!ni(R)&&!(R in k)&&x(b,R,v[R],null,J,_.children,P,H,Ye);"value"in k&&x(b,"value",v.value,k.value)}},et=(b,_,v,k,P,H,J,R,Q)=>{const Y=_.el=b?b.el:T(""),oe=_.anchor=b?b.anchor:T("");let{patchFlag:ie,dynamicChildren:re,slotScopeIds:we}=_;we&&(R=R?R.concat(we):we),b==null?(h(Y,v,k),h(oe,v,k),ve(_.children,v,oe,P,H,J,R,Q)):ie>0&&ie&64&&re&&b.dynamicChildren?(le(b.dynamicChildren,re,v,P,H,J,R),(_.key!=null||P&&_===P.subTree)&&ya(b,_,!0)):xt(b,_,v,oe,P,H,J,R,Q)},F=(b,_,v,k,P,H,J,R,Q)=>{_.slotScopeIds=R,b==null?_.shapeFlag&512?P.ctx.activate(_,v,k,J,Q):ot(_,v,k,P,H,J,Q):he(b,_,Q)},ot=(b,_,v,k,P,H,J)=>{const R=b.component=hc(b,k,P);if(wi(b)&&(R.ctx.renderer=ut),gc(R),R.asyncDep){if(P&&P.registerDep(R,We),!b.el){const Q=R.subTree=En(wn);se(null,Q,_,v)}return}We(R,b,_,v,P,H,J)},he=(b,_,v)=>{const k=_.component=b.component;if(C1(b,_,v))if(k.asyncDep&&!k.asyncResolved){Re(k,_,v);return}else k.next=_,d1(k.update),k.update();else _.component=b.component,_.el=b.el,k.vnode=_},We=(b,_,v,k,P,H,J)=>{const R=()=>{if(b.isMounted){let{next:oe,bu:ie,u:re,parent:we,vnode:pe}=b,Te=oe,Ue;zn(b,!1),oe?(oe.el=pe.el,Re(b,oe,J)):oe=pe,ie&&ki(ie),(Ue=oe.props&&oe.props.onVnodeBeforeUpdate)&&fn(Ue,we,oe,pe),zn(b,!0);const He=Ui(b),kt=b.subTree;b.subTree=He,ue(kt,He,j(kt.el),nn(kt),b,P,H),oe.el=He.el,Te===null&&m1(b,He.el),re&&Ft(re,P),(Ue=oe.props&&oe.props.onVnodeUpdated)&&Ft(()=>fn(Ue,we,oe,pe),P)}else{let oe;const{el:ie,props:re}=_,{bm:we,m:pe,parent:Te}=b,Ue=$i(_);if(zn(b,!1),we&&ki(we),!Ue&&(oe=re&&re.onVnodeBeforeMount)&&fn(oe,Te,_),zn(b,!0),ie&&Oe){const He=()=>{b.subTree=Ui(b),Oe(ie,b.subTree,b,P,null)};Ue?_.type.__asyncLoader().then(()=>!b.isUnmounted&&He()):He()}else{const He=b.subTree=Ui(b);ue(null,He,v,k,b,P,H),_.el=He.el}if(pe&&Ft(pe,P),!Ue&&(oe=re&&re.onVnodeMounted)){const He=_;Ft(()=>fn(oe,Te,He),P)}_.shapeFlag&256&&b.a&&Ft(b.a,P),b.isMounted=!0,_=v=k=null}},Q=b.effect=new As(R,()=>ra(b.update),b.scope),Y=b.update=Q.run.bind(Q);Y.id=b.uid,zn(b,!0),Y()},Re=(b,_,v)=>{_.component=b;const k=b.vnode.props;b.vnode=_,b.next=null,Y1(b,_.props,k,v),Z1(b,_.children,v),pr(),Ss(void 0,b.update),Cr()},xt=(b,_,v,k,P,H,J,R,Q=!1)=>{const Y=b&&b.children,oe=b?b.shapeFlag:0,ie=_.children,{patchFlag:re,shapeFlag:we}=_;if(re>0){if(re&128){ft(Y,ie,v,k,P,H,J,R,Q);return}else if(re&256){qn(Y,ie,v,k,P,H,J,R,Q);return}}we&8?(oe&16&&Ye(Y,P,H),ie!==Y&&M(v,ie)):oe&16?we&16?ft(Y,ie,v,k,P,H,J,R,Q):Ye(Y,P,H,!0):(oe&8&&M(v,""),we&16&&ve(ie,v,k,P,H,J,R,Q))},qn=(b,_,v,k,P,H,J,R,Q)=>{b=b||dr,_=_||dr;const Y=b.length,oe=_.length,ie=Math.min(Y,oe);let re;for(re=0;reoe?Ye(b,P,H,!0,!1,ie):ve(_,v,k,P,H,J,R,Q,ie)},ft=(b,_,v,k,P,H,J,R,Q)=>{let Y=0;const oe=_.length;let ie=b.length-1,re=oe-1;for(;Y<=ie&&Y<=re;){const we=b[Y],pe=_[Y]=Q?Dn(_[Y]):hn(_[Y]);if(Yn(we,pe))ue(we,pe,v,null,P,H,J,R,Q);else break;Y++}for(;Y<=ie&&Y<=re;){const we=b[ie],pe=_[re]=Q?Dn(_[re]):hn(_[re]);if(Yn(we,pe))ue(we,pe,v,null,P,H,J,R,Q);else break;ie--,re--}if(Y>ie){if(Y<=re){const we=re+1,pe=were)for(;Y<=ie;)rt(b[Y],P,H,!0),Y++;else{const we=Y,pe=Y,Te=new Map;for(Y=pe;Y<=re;Y++){const _e=_[Y]=Q?Dn(_[Y]):hn(_[Y]);_e.key!=null&&Te.set(_e.key,Y)}let Ue,He=0;const kt=re-pe+1;let Ze=!1,q=0;const tt=new Array(kt);for(Y=0;Y=kt){rt(_e,P,H,!0);continue}let bt;if(_e.key!=null)bt=Te.get(_e.key);else for(Ue=pe;Ue<=re;Ue++)if(tt[Ue-pe]===0&&Yn(_e,_[Ue])){bt=Ue;break}bt===void 0?rt(_e,P,H,!0):(tt[bt-pe]=Y+1,bt>=q?q=bt:Ze=!0,ue(_e,_[bt],v,null,P,H,J,R,Q),He++)}const je=Ze?$1(tt):dr;for(Ue=je.length-1,Y=kt-1;Y>=0;Y--){const _e=pe+Y,bt=_[_e],$n=_e+1{const{el:H,type:J,transition:R,children:Q,shapeFlag:Y}=b;if(Y&6){Dt(b.component.subTree,_,v,k);return}if(Y&128){b.suspense.move(_,v,k);return}if(Y&64){J.move(b,_,v,ut);return}if(J===$t){h(H,_,v);for(let ie=0;ieR.enter(H),P);else{const{leave:ie,delayLeave:re,afterLeave:we}=R,pe=()=>h(H,_,v),Te=()=>{ie(H,()=>{pe(),we&&we()})};re?re(H,pe,Te):Te()}else h(H,_,v)},rt=(b,_,v,k=!1,P=!1)=>{const{type:H,props:J,ref:R,children:Q,dynamicChildren:Y,shapeFlag:oe,patchFlag:ie,dirs:re}=b;if(R!=null&&rs(R,null,v,b,!0),oe&256){_.ctx.deactivate(b);return}const we=oe&1&&re,pe=!$i(b);let Te;if(pe&&(Te=J&&J.onVnodeBeforeUnmount)&&fn(Te,_,b),oe&6)mr(b.component,v,k);else{if(oe&128){b.suspense.unmount(v,k);return}we&&Vn(b,null,_,"beforeUnmount"),oe&64?b.type.remove(b,_,v,P,ut,k):Y&&(H!==$t||ie>0&&ie&64)?Ye(Y,_,v,!1,!0):(H===$t&&ie&384||!P&&oe&16)&&Ye(Q,_,v),k&&Jn(b)}(pe&&(Te=J&&J.onVnodeUnmounted)||we)&&Ft(()=>{Te&&fn(Te,_,b),we&&Vn(b,null,_,"unmounted")},v)},Jn=b=>{const{type:_,el:v,anchor:k,transition:P}=b;if(_===$t){de(v,k);return}if(_===zi){me(b);return}const H=()=>{d(v),P&&!P.persisted&&P.afterLeave&&P.afterLeave()};if(b.shapeFlag&1&&P&&!P.persisted){const{leave:J,delayLeave:R}=P,Q=()=>J(v,H);R?R(b.el,H,Q):Q()}else H()},de=(b,_)=>{let v;for(;b!==_;)v=U(b),d(b),b=v;d(_)},mr=(b,_,v)=>{const{bum:k,scope:P,update:H,subTree:J,um:R}=b;k&&ki(k),P.stop(),H&&(H.active=!1,rt(J,b,_,v)),R&&Ft(R,_),Ft(()=>{b.isUnmounted=!0},_),_&&_.pendingBranch&&!_.isUnmounted&&b.asyncDep&&!b.asyncResolved&&b.suspenseId===_.pendingId&&(_.deps--,_.deps===0&&_.resolve())},Ye=(b,_,v,k=!1,P=!1,H=0)=>{for(let J=H;Jb.shapeFlag&6?nn(b.component.subTree):b.shapeFlag&128?b.suspense.next():U(b.anchor||b.el),mn=(b,_,v)=>{b==null?_._vnode&&rt(_._vnode,null,null,!0):ue(_._vnode||null,b,_,null,null,null,v),oa(),_._vnode=b},ut={p:ue,um:rt,m:Dt,r:Jn,mt:ot,mc:ve,pc:xt,pbc:le,n:nn,o};let In,Oe;return a&&([In,Oe]=a(ut)),{render:mn,hydrate:In,createApp:Q1(mn,In)}}function zn({effect:o,update:a},f){o.allowRecurse=a.allowRecurse=f}function ya(o,a,f=!1){const h=o.children,d=a.children;if(be(h)&&be(d))for(let x=0;x>1,o[f[T]]0&&(a[h]=f[x-1]),f[x]=h)}}for(x=f.length,p=f[x-1];x-- >0;)f[x]=p,p=a[p];return f}const ec=o=>o.__isTeleport,tc=Symbol(),$t=Symbol(void 0),Ns=Symbol(void 0),wn=Symbol(void 0),zi=Symbol(void 0),Pr=[];let Zn=null;function _s(o=!1){Pr.push(Zn=o?null:[])}function nc(){Pr.pop(),Zn=Pr[Pr.length-1]||null}let li=1;function fo(o){li+=o}function Na(o){return o.dynamicChildren=li>0?Zn||dr:null,nc(),li>0&&Zn&&Zn.push(o),o}function _a(o,a,f,h,d,x){return Na(ci(o,a,f,h,d,x,!0))}function rc(o,a,f,h,d){return Na(En(o,a,f,h,d,!0))}function ic(o){return o?o.__v_isVNode===!0:!1}function Yn(o,a){return o.type===a.type&&o.key===a.key}const pi="__vInternal",Ma=({key:o})=>o!=null?o:null,ri=({ref:o,ref_key:a,ref_for:f})=>o!=null?Tt(o)||It(o)||Ne(o)?{i:gn,r:o,k:a,f:!!f}:o:null;function ci(o,a=null,f=null,h=0,d=null,x=o===$t?0:1,p=!1,T=!1){const m={__v_isVNode:!0,__v_skip:!0,type:o,props:a,key:a&&Ma(a),ref:a&&ri(a),scopeId:ca,slotScopeIds:null,children:f,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:x,patchFlag:h,dynamicProps:d,dynamicChildren:null,appContext:null};return T?(Ms(m,f),x&128&&o.normalize(m)):f&&(m.shapeFlag|=Tt(f)?8:16),li>0&&!p&&Zn&&(m.patchFlag>0||x&6)&&m.patchFlag!==32&&Zn.push(m),m}const En=sc;function sc(o,a=null,f=null,h=0,d=null,x=!1){if((!o||o===tc)&&(o=wn),ic(o)){const T=Qn(o,a,!0);return f&&Ms(T,f),T}if(Ec(o)&&(o=o.__vccOpts),a){a=oc(a);let{class:T,style:m}=a;T&&!Tt(T)&&(a.class=fs(T)),St(m)&&(Ko(m)&&!be(m)&&(m=_t({},m)),a.style=cs(m))}const p=Tt(o)?1:I1(o)?128:ec(o)?64:St(o)?4:Ne(o)?2:0;return ci(o,a,f,h,d,p,x,!0)}function oc(o){return o?Ko(o)||pi in o?_t({},o):o:null}function Qn(o,a,f=!1){const{props:h,ref:d,patchFlag:x,children:p}=o,T=a?lc(h||{},a):h;return{__v_isVNode:!0,__v_skip:!0,type:o.type,props:T,key:T&&Ma(T),ref:a&&a.ref?f&&d?be(d)?d.concat(ri(a)):[d,ri(a)]:ri(a):d,scopeId:o.scopeId,slotScopeIds:o.slotScopeIds,children:p,target:o.target,targetAnchor:o.targetAnchor,staticCount:o.staticCount,shapeFlag:o.shapeFlag,patchFlag:a&&o.type!==$t?x===-1?16:x|16:x,dynamicProps:o.dynamicProps,dynamicChildren:o.dynamicChildren,appContext:o.appContext,dirs:o.dirs,transition:o.transition,component:o.component,suspense:o.suspense,ssContent:o.ssContent&&Qn(o.ssContent),ssFallback:o.ssFallback&&Qn(o.ssFallback),el:o.el,anchor:o.anchor}}function ac(o=" ",a=0){return En(Ns,null,o,a)}function hn(o){return o==null||typeof o=="boolean"?En(wn):be(o)?En($t,null,o.slice()):typeof o=="object"?Dn(o):En(Ns,null,String(o))}function Dn(o){return o.el===null||o.memo?o:Qn(o)}function Ms(o,a){let f=0;const{shapeFlag:h}=o;if(a==null)a=null;else if(be(a))f=16;else if(typeof a=="object")if(h&65){const d=a.default;d&&(d._c&&(d._d=!1),Ms(o,d()),d._c&&(d._d=!0));return}else{f=32;const d=a._;!d&&!(pi in a)?a._ctx=gn:d===3&&gn&&(gn.slots._===1?a._=1:(a._=2,o.patchFlag|=1024))}else Ne(a)?(a={default:a,_ctx:gn},f=32):(a=String(a),h&64?(f=16,a=[ac(a)]):f=8);o.children=a,o.shapeFlag|=f}function lc(...o){const a={};for(let f=0;fo?Oa(o)?Os(o)||o.proxy:is(o.parent):null,fi=_t(Object.create(null),{$:o=>o,$el:o=>o.vnode.el,$data:o=>o.data,$props:o=>o.props,$attrs:o=>o.attrs,$slots:o=>o.slots,$refs:o=>o.refs,$parent:o=>is(o.parent),$root:o=>is(o.root),$emit:o=>o.emit,$options:o=>pa(o),$forceUpdate:o=>()=>ra(o.update),$nextTick:o=>na.bind(o.proxy),$watch:o=>b1.bind(o)}),cc={get({_:o},a){const{ctx:f,setupState:h,data:d,props:x,accessCache:p,type:T,appContext:m}=o;let S;if(a[0]!=="$"){const ne=p[a];if(ne!==void 0)switch(ne){case 1:return h[a];case 2:return d[a];case 4:return f[a];case 3:return x[a]}else{if(h!==$e&&Le(h,a))return p[a]=1,h[a];if(d!==$e&&Le(d,a))return p[a]=2,d[a];if((S=o.propsOptions[0])&&Le(S,a))return p[a]=3,x[a];if(f!==$e&&Le(f,a))return p[a]=4,f[a];es&&(p[a]=0)}}const M=fi[a];let j,U;if(M)return a==="$attrs"&&jt(o,"get",a),M(o);if((j=T.__cssModules)&&(j=j[a]))return j;if(f!==$e&&Le(f,a))return p[a]=4,f[a];if(U=m.config.globalProperties,Le(U,a))return U[a]},set({_:o},a,f){const{data:h,setupState:d,ctx:x}=o;return d!==$e&&Le(d,a)?(d[a]=f,!0):h!==$e&&Le(h,a)?(h[a]=f,!0):Le(o.props,a)||a[0]==="$"&&a.slice(1)in o?!1:(x[a]=f,!0)},has({_:{data:o,setupState:a,accessCache:f,ctx:h,appContext:d,propsOptions:x}},p){let T;return!!f[p]||o!==$e&&Le(o,p)||a!==$e&&Le(a,p)||(T=x[0])&&Le(T,p)||Le(h,p)||Le(fi,p)||Le(d.config.globalProperties,p)},defineProperty(o,a,f){return f.get!=null?o._.accessCache[a]=0:Le(f,"value")&&this.set(o,a,f.value,null),Reflect.defineProperty(o,a,f)}},fc=ba();let uc=0;function hc(o,a,f){const h=o.type,d=(a?a.appContext:o.appContext)||fc,x={uid:uc++,vnode:o,type:h,parent:a,appContext:d,root:null,next:null,subTree:null,effect:null,update:null,scope:new Dl(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:a?a.provides:Object.create(d.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ma(h,d),emitsOptions:la(h,d),emit:null,emitted:null,propsDefaults:$e,inheritAttrs:h.inheritAttrs,ctx:$e,data:$e,props:$e,attrs:$e,slots:$e,refs:$e,setupState:$e,setupContext:null,suspense:f,suspenseId:f?f.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return x.ctx={_:x},x.root=a?a.root:x,x.emit=A1.bind(null,x),o.ce&&o.ce(x),x}let mt=null;const dc=()=>mt||gn,wr=o=>{mt=o,o.scope.on()},Kn=()=>{mt&&mt.scope.off(),mt=null};function Oa(o){return o.vnode.shapeFlag&4}let jr=!1;function gc(o,a=!1){jr=a;const{props:f,children:h}=o.vnode,d=Oa(o);W1(o,f,d,a),X1(o,h);const x=d?xc(o,a):void 0;return jr=!1,x}function xc(o,a){const f=o.type;o.accessCache=Object.create(null),o.proxy=Qo(new Proxy(o.ctx,cc));const{setup:h}=f;if(h){const d=o.setupContext=h.length>1?wc(o):null;wr(o),pr();const x=Ln(h,o,0,[o.props,d]);if(Cr(),Kn(),Lo(x)){if(x.then(Kn,Kn),a)return x.then(p=>{uo(o,p,a)}).catch(p=>{xi(p,o,0)});o.asyncDep=x}else uo(o,x,a)}else Da(o,a)}function uo(o,a,f){Ne(a)?o.type.__ssrInlineRender?o.ssrRender=a:o.render=a:St(a)&&(o.setupState=ea(a)),Da(o,f)}let ho;function Da(o,a,f){const h=o.type;if(!o.render){if(!a&&ho&&!h.render){const d=h.template;if(d){const{isCustomElement:x,compilerOptions:p}=o.appContext.config,{delimiters:T,compilerOptions:m}=h,S=_t(_t({isCustomElement:x,delimiters:T},p),m);h.render=ho(d,S)}}o.render=h.render||tn}wr(o),pr(),U1(o),Cr(),Kn()}function Ac(o){return new Proxy(o.attrs,{get(a,f){return jt(o,"get","$attrs"),a[f]}})}function wc(o){const a=h=>{o.exposed=h||{}};let f;return{get attrs(){return f||(f=Ac(o))},slots:o.slots,emit:o.emit,expose:a}}function Os(o){if(o.exposed)return o.exposeProxy||(o.exposeProxy=new Proxy(ea(Qo(o.exposed)),{get(a,f){if(f in a)return a[f];if(f in fi)return fi[f](o)}}))}function Ec(o){return Ne(o)&&"__vccOpts"in o}const pc=(o,a)=>f1(o,a,jr),Cc="3.2.33",mc="http://www.w3.org/2000/svg",Gn=typeof document!="undefined"?document:null,go=Gn&&Gn.createElement("template"),Ic={insert:(o,a,f)=>{a.insertBefore(o,f||null)},remove:o=>{const a=o.parentNode;a&&a.removeChild(o)},createElement:(o,a,f,h)=>{const d=a?Gn.createElementNS(mc,o):Gn.createElement(o,f?{is:f}:void 0);return o==="select"&&h&&h.multiple!=null&&d.setAttribute("multiple",h.multiple),d},createText:o=>Gn.createTextNode(o),createComment:o=>Gn.createComment(o),setText:(o,a)=>{o.nodeValue=a},setElementText:(o,a)=>{o.textContent=a},parentNode:o=>o.parentNode,nextSibling:o=>o.nextSibling,querySelector:o=>Gn.querySelector(o),setScopeId(o,a){o.setAttribute(a,"")},cloneNode(o){const a=o.cloneNode(!0);return"_value"in o&&(a._value=o._value),a},insertStaticContent(o,a,f,h,d,x){const p=f?f.previousSibling:a.lastChild;if(d&&(d===x||d.nextSibling))for(;a.insertBefore(d.cloneNode(!0),f),!(d===x||!(d=d.nextSibling)););else{go.innerHTML=h?`${o}`:o;const T=go.content;if(h){const m=T.firstChild;for(;m.firstChild;)T.appendChild(m.firstChild);T.removeChild(m)}a.insertBefore(T,f)}return[p?p.nextSibling:a.firstChild,f?f.previousSibling:a.lastChild]}};function Tc(o,a,f){const h=o._vtc;h&&(a=(a?[a,...h]:[...h]).join(" ")),a==null?o.removeAttribute("class"):f?o.setAttribute("class",a):o.className=a}function Sc(o,a,f){const h=o.style,d=Tt(f);if(f&&!d){for(const x in f)ss(h,x,f[x]);if(a&&!Tt(a))for(const x in a)f[x]==null&&ss(h,x,"")}else{const x=h.display;d?a!==f&&(h.cssText=f):a&&o.removeAttribute("style"),"_vod"in o&&(h.display=x)}}const xo=/\s*!important$/;function ss(o,a,f){if(be(f))f.forEach(h=>ss(o,a,h));else if(f==null&&(f=""),a.startsWith("--"))o.setProperty(a,f);else{const h=bc(o,a);xo.test(f)?o.setProperty(Er(h),f.replace(xo,""),"important"):o[h]=f}}const Ao=["Webkit","Moz","ms"],Wi={};function bc(o,a){const f=Wi[a];if(f)return f;let h=Ar(a);if(h!=="filter"&&h in o)return Wi[a]=h;h=Po(h);for(let d=0;d{let o=Date.now,a=!1;if(typeof window!="undefined"){Date.now()>document.createEvent("Event").timeStamp&&(o=()=>performance.now());const f=navigator.userAgent.match(/firefox\/(\d+)/i);a=!!(f&&Number(f[1])<=53)}return[o,a]})();let os=0;const Mc=Promise.resolve(),Oc=()=>{os=0},Dc=()=>os||(Mc.then(Oc),os=Ra());function Rc(o,a,f,h){o.addEventListener(a,f,h)}function Lc(o,a,f,h){o.removeEventListener(a,f,h)}function Bc(o,a,f,h,d=null){const x=o._vei||(o._vei={}),p=x[a];if(h&&p)p.value=h;else{const[T,m]=vc(a);if(h){const S=x[a]=Pc(h,d);Rc(o,T,S,m)}else p&&(Lc(o,T,p,m),x[a]=void 0)}}const Eo=/(?:Once|Passive|Capture)$/;function vc(o){let a;if(Eo.test(o)){a={};let f;for(;f=o.match(Eo);)o=o.slice(0,o.length-f[0].length),a[f[0].toLowerCase()]=!0}return[Er(o.slice(2)),a]}function Pc(o,a){const f=h=>{const d=h.timeStamp||Ra();(_c||d>=f.attached-1)&&Kt(Fc(h,f.value),a,5,[h])};return f.value=o,f.attached=Dc(),f}function Fc(o,a){if(be(a)){const f=o.stopImmediatePropagation;return o.stopImmediatePropagation=()=>{f.call(o),o._stopped=!0},a.map(h=>d=>!d._stopped&&h&&h(d))}else return a}const po=/^on[a-z]/,kc=(o,a,f,h,d=!1,x,p,T,m)=>{a==="class"?Tc(o,h,d):a==="style"?Sc(o,f,h):ui(a)?us(a)||Bc(o,a,f,h,p):(a[0]==="."?(a=a.slice(1),!0):a[0]==="^"?(a=a.slice(1),!1):Uc(o,a,h,d))?Nc(o,a,h,x,p,T,m):(a==="true-value"?o._trueValue=h:a==="false-value"&&(o._falseValue=h),yc(o,a,h,d))};function Uc(o,a,f,h){return h?!!(a==="innerHTML"||a==="textContent"||a in o&&po.test(a)&&Ne(f)):a==="spellcheck"||a==="draggable"||a==="translate"||a==="form"||a==="list"&&o.tagName==="INPUT"||a==="type"&&o.tagName==="TEXTAREA"||po.test(a)&&Tt(f)?!1:a in o}const Hc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};_1.props;const jc=_t({patchProp:kc},Ic);let Co;function Vc(){return Co||(Co=q1(jc))}const zc=(...o)=>{const a=Vc().createApp(...o),{mount:f}=a;return a.mount=h=>{const d=Wc(h);if(!d)return;const x=a._component;!Ne(x)&&!x.render&&!x.template&&(x.template=d.innerHTML),d.innerHTML="";const p=f(d,!1,d instanceof SVGElement);return d instanceof Element&&(d.removeAttribute("v-cloak"),d.setAttribute("data-v-app","")),p},a};function Wc(o){return Tt(o)?document.querySelector(o):o}var te;(function(o){o[o.QR_CODE=0]="QR_CODE",o[o.AZTEC=1]="AZTEC",o[o.CODABAR=2]="CODABAR",o[o.CODE_39=3]="CODE_39",o[o.CODE_93=4]="CODE_93",o[o.CODE_128=5]="CODE_128",o[o.DATA_MATRIX=6]="DATA_MATRIX",o[o.MAXICODE=7]="MAXICODE",o[o.ITF=8]="ITF",o[o.EAN_13=9]="EAN_13",o[o.EAN_8=10]="EAN_8",o[o.PDF_417=11]="PDF_417",o[o.RSS_14=12]="RSS_14",o[o.RSS_EXPANDED=13]="RSS_EXPANDED",o[o.UPC_A=14]="UPC_A",o[o.UPC_E=15]="UPC_E",o[o.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(te||(te={}));var mo=new Map([[te.QR_CODE,"QR_CODE"],[te.AZTEC,"AZTEC"],[te.CODABAR,"CODABAR"],[te.CODE_39,"CODE_39"],[te.CODE_93,"CODE_93"],[te.CODE_128,"CODE_128"],[te.DATA_MATRIX,"DATA_MATRIX"],[te.MAXICODE,"MAXICODE"],[te.ITF,"ITF"],[te.EAN_13,"EAN_13"],[te.EAN_8,"EAN_8"],[te.PDF_417,"PDF_417"],[te.RSS_14,"RSS_14"],[te.RSS_EXPANDED,"RSS_EXPANDED"],[te.UPC_A,"UPC_A"],[te.UPC_E,"UPC_E"],[te.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),Io;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.URL=1]="URL"})(Io||(Io={}));function Yc(o){return Object.values(te).includes(o)}var vn;(function(o){o[o.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",o[o.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(vn||(vn={}));var dn=function(){function o(){}return o.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",o.SCAN_DEFAULT_FPS=2,o.DEFAULT_DISABLE_FLIP=!1,o.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,o.DEFAULT_SUPPORTED_SCAN_TYPE=[vn.SCAN_TYPE_CAMERA,vn.SCAN_TYPE_FILE],o}(),La=function(){function o(a,f){this.format=a,this.formatName=f}return o.prototype.toString=function(){return this.formatName},o.create=function(a){if(!mo.has(a))throw a+" not in html5QrcodeSupportedFormatsTextMap";return new o(a,mo.get(a))},o}(),To=function(){function o(){}return o.createFromText=function(a){var f={text:a};return{decodedText:a,result:f}},o.createFromQrcodeResult=function(a){return{decodedText:a.text,result:a}},o}(),as;(function(o){o[o.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",o[o.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",o[o.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(as||(as={}));var Ba=function(){function o(){}return o.createFrom=function(a){return{errorMessage:a,type:as.UNKWOWN_ERROR}},o}(),va=function(){function o(a){this.verbose=a}return o.prototype.log=function(a){this.verbose&&console.log(a)},o.prototype.warn=function(a){this.verbose&&console.warn(a)},o.prototype.logError=function(a,f){(this.verbose||f===!0)&&console.error(a)},o.prototype.logErrors=function(a){if(a.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(a)},o}();function hr(o){return typeof o=="undefined"||o===null}var Or=function(){function o(){}return o.codeParseError=function(a){return"QR code parse error, error = "+a},o.errorGettingUserMedia=function(a){return"Error getting userMedia, error = "+a},o.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},o.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},o.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},o.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},o}(),Jt=function(){function o(){}return o.scanningStatus=function(){return"Scanning"},o.idleStatus=function(){return"Idle"},o.errorStatus=function(){return"Error"},o.permissionStatus=function(){return"Permission"},o.noCameraFoundErrorStatus=function(){return"No Cameras"},o.lastMatch=function(a){return"Last Match: "+a},o.codeScannerTitle=function(){return"Code Scanner"},o.cameraPermissionTitle=function(){return"Request Camera Permissions"},o.cameraPermissionRequesting=function(){return"Requesting camera permissions..."},o.noCameraFound=function(){return"No camera found"},o.scanButtonStopScanningText=function(){return"Stop Scanning"},o.scanButtonStartScanningText=function(){return"Start Scanning"},o.scanButtonScanningStarting=function(){return"Launching Camera..."},o.textIfCameraScanSelected=function(){return"Scan an Image File"},o.textIfFileScanSelected=function(){return"Scan using camera directly"},o.selectCamera=function(){return"Select Camera"},o}(),So=function(){function o(){}return o.builtUsing=function(){return"Built using "},o.reportIssues=function(){return"Report issues"},o}(),Pa=function(){function o(){}return o.isMediaStreamConstraintsValid=function(a,f){if(typeof a!="object"){var h=typeof a;return f.logError("videoConstraints should be of type object, the "+("object passed is of type "+h+"."),!0),!1}for(var d=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],x=new Set(d),p=Object.keys(a),T=0,m=p;T{for(const x of d)if(x.type==="childList")for(const p of x.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&h(p)}).observe(document,{childList:!0,subtree:!0});function f(d){const x={};return d.integrity&&(x.integrity=d.integrity),d.referrerpolicy&&(x.referrerPolicy=d.referrerpolicy),d.crossorigin==="use-credentials"?x.credentials="include":d.crossorigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function h(d){if(d.ep)return;d.ep=!0;const x=f(d);fetch(d.href,x)}};wl();function cs(o,a){const f=Object.create(null),h=o.split(",");for(let d=0;d!!f[d.toLowerCase()]:d=>!!f[d]}const El="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",pl=cs(El);function Do(o){return!!o||o===""}function fs(o){if(be(o)){const a={};for(let f=0;f{if(f){const h=f.split(ml);h.length>1&&(a[h[0].trim()]=h[1].trim())}}),a}function us(o){let a="";if(Tt(o))a=o;else if(be(o))for(let f=0;fTt(o)?o:o==null?"":be(o)||St(o)&&(o.toString===vo||!Ne(o.toString))?JSON.stringify(o,Ro,2):String(o),Ro=(o,a)=>a&&a.__v_isRef?Ro(o,a.value):gr(a)?{[`Map(${a.size})`]:[...a.entries()].reduce((f,[h,d])=>(f[`${h} =>`]=d,f),{})}:Lo(a)?{[`Set(${a.size})`]:[...a.values()]}:St(a)&&!be(a)&&!Po(a)?String(a):a,$e={},dr=[],tn=()=>{},Sl=()=>!1,bl=/^on[^a-z]/,ui=o=>bl.test(o),hs=o=>o.startsWith("onUpdate:"),_t=Object.assign,ds=(o,a)=>{const f=o.indexOf(a);f>-1&&o.splice(f,1)},yl=Object.prototype.hasOwnProperty,Le=(o,a)=>yl.call(o,a),be=Array.isArray,gr=o=>hi(o)==="[object Map]",Lo=o=>hi(o)==="[object Set]",Ne=o=>typeof o=="function",Tt=o=>typeof o=="string",gs=o=>typeof o=="symbol",St=o=>o!==null&&typeof o=="object",Bo=o=>St(o)&&Ne(o.then)&&Ne(o.catch),vo=Object.prototype.toString,hi=o=>vo.call(o),Nl=o=>hi(o).slice(8,-1),Po=o=>hi(o)==="[object Object]",xs=o=>Tt(o)&&o!=="NaN"&&o[0]!=="-"&&""+parseInt(o,10)===o,ri=cs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),di=o=>{const a=Object.create(null);return f=>a[f]||(a[f]=o(f))},_l=/-(\w)/g,Ar=di(o=>o.replace(_l,(a,f)=>f?f.toUpperCase():"")),Ml=/\B([A-Z])/g,Er=di(o=>o.replace(Ml,"-$1").toLowerCase()),Fo=di(o=>o.charAt(0).toUpperCase()+o.slice(1)),Fi=di(o=>o?`on${Fo(o)}`:""),Fr=(o,a)=>!Object.is(o,a),ki=(o,a)=>{for(let f=0;f{Object.defineProperty(o,a,{configurable:!0,enumerable:!1,value:f})},Ol=o=>{const a=parseFloat(o);return isNaN(a)?o:a};let Ks;const Dl=()=>Ks||(Ks=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});let un;class Rl{constructor(a=!1){this.active=!0,this.effects=[],this.cleanups=[],!a&&un&&(this.parent=un,this.index=(un.scopes||(un.scopes=[])).push(this)-1)}run(a){if(this.active){const f=un;try{return un=this,a()}finally{un=f}}}on(){un=this}off(){un=this.parent}stop(a){if(this.active){let f,h;for(f=0,h=this.effects.length;f{const a=new Set(o);return a.w=0,a.n=0,a},ko=o=>(o.w&Bn)>0,Uo=o=>(o.n&Bn)>0,Bl=({deps:o})=>{if(o.length)for(let a=0;a{const{deps:a}=o;if(a.length){let f=0;for(let h=0;h{(S==="length"||S>=h)&&T.push(m)});else switch(f!==void 0&&T.push(p.get(f)),a){case"add":be(o)?xs(f)&&T.push(p.get("length")):(T.push(p.get(Xn)),gr(o)&&T.push(p.get(Zi)));break;case"delete":be(o)||(T.push(p.get(Xn)),gr(o)&&T.push(p.get(Zi)));break;case"set":gr(o)&&T.push(p.get(Xn));break}if(T.length===1)T[0]&&Ki(T[0]);else{const m=[];for(const S of T)S&&m.push(...S);Ki(As(m))}}function Ki(o,a){for(const f of be(o)?o:[...o])(f!==en||f.allowRecurse)&&(f.scheduler?f.scheduler():f.run())}const Pl=cs("__proto__,__v_isRef,__isVue"),Vo=new Set(Object.getOwnPropertyNames(Symbol).map(o=>Symbol[o]).filter(gs)),Fl=Es(),kl=Es(!1,!0),Ul=Es(!0),qs=Hl();function Hl(){const o={};return["includes","indexOf","lastIndexOf"].forEach(a=>{o[a]=function(...f){const h=ke(this);for(let x=0,p=this.length;x{o[a]=function(...f){pr();const h=ke(this)[a].apply(this,f);return Cr(),h}}),o}function Es(o=!1,a=!1){return function(h,d,x){if(d==="__v_isReactive")return!o;if(d==="__v_isReadonly")return o;if(d==="__v_isShallow")return a;if(d==="__v_raw"&&x===(o?a?n1:Xo:a?Go:Yo).get(h))return h;const p=be(h);if(!o&&p&&Le(qs,d))return Reflect.get(qs,d,x);const T=Reflect.get(h,d,x);return(gs(d)?Vo.has(d):Pl(d))||(o||jt(h,"get",d),a)?T:It(T)?!p||!xs(d)?T.value:T:St(T)?o?Zo(T):ms(T):T}}const jl=zo(),Vl=zo(!0);function zo(o=!1){return function(f,h,d,x){let p=f[h];if(kr(p)&&It(p)&&!It(d))return!1;if(!o&&!kr(d)&&(Ko(d)||(d=ke(d),p=ke(p)),!be(f)&&It(p)&&!It(d)))return p.value=d,!0;const T=be(f)&&xs(h)?Number(h)o,gi=o=>Reflect.getPrototypeOf(o);function Jr(o,a,f=!1,h=!1){o=o.__v_raw;const d=ke(o),x=ke(a);a!==x&&!f&&jt(d,"get",a),!f&&jt(d,"get",x);const{has:p}=gi(d),T=h?ps:f?Ts:Ur;if(p.call(d,a))return T(o.get(a));if(p.call(d,x))return T(o.get(x));o!==d&&o.get(a)}function $r(o,a=!1){const f=this.__v_raw,h=ke(f),d=ke(o);return o!==d&&!a&&jt(h,"has",o),!a&&jt(h,"has",d),o===d?f.has(o):f.has(o)||f.has(d)}function ei(o,a=!1){return o=o.__v_raw,!a&&jt(ke(o),"iterate",Xn),Reflect.get(o,"size",o)}function Js(o){o=ke(o);const a=ke(this);return gi(a).has.call(a,o)||(a.add(o),pn(a,"add",o,o)),this}function $s(o,a){a=ke(a);const f=ke(this),{has:h,get:d}=gi(f);let x=h.call(f,o);x||(o=ke(o),x=h.call(f,o));const p=d.call(f,o);return f.set(o,a),x?Fr(a,p)&&pn(f,"set",o,a):pn(f,"add",o,a),this}function eo(o){const a=ke(this),{has:f,get:h}=gi(a);let d=f.call(a,o);d||(o=ke(o),d=f.call(a,o)),h&&h.call(a,o);const x=a.delete(o);return d&&pn(a,"delete",o,void 0),x}function to(){const o=ke(this),a=o.size!==0,f=o.clear();return a&&pn(o,"clear",void 0,void 0),f}function ti(o,a){return function(h,d){const x=this,p=x.__v_raw,T=ke(p),m=a?ps:o?Ts:Ur;return!o&&jt(T,"iterate",Xn),p.forEach((S,M)=>h.call(d,m(S),m(M),x))}}function ni(o,a,f){return function(...h){const d=this.__v_raw,x=ke(d),p=gr(x),T=o==="entries"||o===Symbol.iterator&&p,m=o==="keys"&&p,S=d[o](...h),M=f?ps:a?Ts:Ur;return!a&&jt(x,"iterate",m?Zi:Xn),{next(){const{value:j,done:U}=S.next();return U?{value:j,done:U}:{value:T?[M(j[0]),M(j[1])]:M(j),done:U}},[Symbol.iterator](){return this}}}}function Mn(o){return function(...a){return o==="delete"?!1:this}}function Zl(){const o={get(x){return Jr(this,x)},get size(){return ei(this)},has:$r,add:Js,set:$s,delete:eo,clear:to,forEach:ti(!1,!1)},a={get(x){return Jr(this,x,!1,!0)},get size(){return ei(this)},has:$r,add:Js,set:$s,delete:eo,clear:to,forEach:ti(!1,!0)},f={get(x){return Jr(this,x,!0)},get size(){return ei(this,!0)},has(x){return $r.call(this,x,!0)},add:Mn("add"),set:Mn("set"),delete:Mn("delete"),clear:Mn("clear"),forEach:ti(!0,!1)},h={get(x){return Jr(this,x,!0,!0)},get size(){return ei(this,!0)},has(x){return $r.call(this,x,!0)},add:Mn("add"),set:Mn("set"),delete:Mn("delete"),clear:Mn("clear"),forEach:ti(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(x=>{o[x]=ni(x,!1,!1),f[x]=ni(x,!0,!1),a[x]=ni(x,!1,!0),h[x]=ni(x,!0,!0)}),[o,f,a,h]}const[Kl,Ql,ql,Jl]=Zl();function Cs(o,a){const f=a?o?Jl:ql:o?Ql:Kl;return(h,d,x)=>d==="__v_isReactive"?!o:d==="__v_isReadonly"?o:d==="__v_raw"?h:Reflect.get(Le(f,d)&&d in h?f:h,d,x)}const $l={get:Cs(!1,!1)},e1={get:Cs(!1,!0)},t1={get:Cs(!0,!1)},Yo=new WeakMap,Go=new WeakMap,Xo=new WeakMap,n1=new WeakMap;function r1(o){switch(o){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function i1(o){return o.__v_skip||!Object.isExtensible(o)?0:r1(Nl(o))}function ms(o){return kr(o)?o:Is(o,!1,Wo,$l,Yo)}function s1(o){return Is(o,!1,Xl,e1,Go)}function Zo(o){return Is(o,!0,Gl,t1,Xo)}function Is(o,a,f,h,d){if(!St(o)||o.__v_raw&&!(a&&o.__v_isReactive))return o;const x=d.get(o);if(x)return x;const p=i1(o);if(p===0)return o;const T=new Proxy(o,p===2?h:f);return d.set(o,T),T}function xr(o){return kr(o)?xr(o.__v_raw):!!(o&&o.__v_isReactive)}function kr(o){return!!(o&&o.__v_isReadonly)}function Ko(o){return!!(o&&o.__v_isShallow)}function Qo(o){return xr(o)||kr(o)}function ke(o){const a=o&&o.__v_raw;return a?ke(a):o}function qo(o){return si(o,"__v_skip",!0),o}const Ur=o=>St(o)?ms(o):o,Ts=o=>St(o)?Zo(o):o;function Jo(o){Rn&&en&&(o=ke(o),jo(o.dep||(o.dep=As())))}function $o(o,a){o=ke(o),o.dep&&Ki(o.dep)}function It(o){return!!(o&&o.__v_isRef===!0)}function Ui(o){return o1(o,!1)}function o1(o,a){return It(o)?o:new a1(o,a)}class a1{constructor(a,f){this.__v_isShallow=f,this.dep=void 0,this.__v_isRef=!0,this._rawValue=f?a:ke(a),this._value=f?a:Ur(a)}get value(){return Jo(this),this._value}set value(a){a=this.__v_isShallow?a:ke(a),Fr(a,this._rawValue)&&(this._rawValue=a,this._value=this.__v_isShallow?a:Ur(a),$o(this))}}function ea(o){return It(o)?o.value:o}const l1={get:(o,a,f)=>ea(Reflect.get(o,a,f)),set:(o,a,f,h)=>{const d=o[a];return It(d)&&!It(f)?(d.value=f,!0):Reflect.set(o,a,f,h)}};function ta(o){return xr(o)?o:new Proxy(o,l1)}class c1{constructor(a,f,h,d){this._setter=f,this.dep=void 0,this.__v_isRef=!0,this._dirty=!0,this.effect=new ws(a,()=>{this._dirty||(this._dirty=!0,$o(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!d,this.__v_isReadonly=h}get value(){const a=ke(this);return Jo(a),(a._dirty||!a._cacheable)&&(a._dirty=!1,a._value=a.effect.run()),a._value}set value(a){this._setter(a)}}function f1(o,a,f=!1){let h,d;const x=Ne(o);return x?(h=o,d=tn):(h=o.get,d=o.set),new c1(h,d,x||!d,f)}function Ln(o,a,f,h){let d;try{d=h?o(...h):o()}catch(x){xi(x,a,f)}return d}function Kt(o,a,f,h){if(Ne(o)){const x=Ln(o,a,f,h);return x&&Bo(x)&&x.catch(p=>{xi(p,a,f)}),x}const d=[];for(let x=0;x>>1;Hr(Ht[h])An&&Ht.splice(a,1)}function oa(o,a,f,h){be(o)?f.push(...o):(!a||!a.includes(o,o.allowRecurse?h+1:h))&&f.push(o),sa()}function g1(o){oa(o,Lr,Br,cr)}function x1(o){oa(o,On,vr,fr)}function bs(o,a=null){if(Br.length){for(qi=a,Lr=[...new Set(Br)],Br.length=0,cr=0;crHr(f)-Hr(h)),fr=0;fro.id==null?1/0:o.id;function la(o){Qi=!1,oi=!0,bs(o),Ht.sort((f,h)=>Hr(f)-Hr(h));const a=tn;try{for(An=0;Anne.trim()):j&&(d=f.map(Ol))}let T,m=h[T=Fi(a)]||h[T=Fi(Ar(a))];!m&&x&&(m=h[T=Fi(Er(a))]),m&&Kt(m,o,6,d);const S=h[T+"Once"];if(S){if(!o.emitted)o.emitted={};else if(o.emitted[T])return;o.emitted[T]=!0,Kt(S,o,6,d)}}function ca(o,a,f=!1){const h=a.emitsCache,d=h.get(o);if(d!==void 0)return d;const x=o.emits;let p={},T=!1;if(!Ne(o)){const m=S=>{const M=ca(S,a,!0);M&&(T=!0,_t(p,M))};!f&&a.mixins.length&&a.mixins.forEach(m),o.extends&&m(o.extends),o.mixins&&o.mixins.forEach(m)}return!x&&!T?(h.set(o,null),null):(be(x)?x.forEach(m=>p[m]=null):_t(p,x),h.set(o,p),p)}function Ai(o,a){return!o||!ui(a)?!1:(a=a.slice(2).replace(/Once$/,""),Le(o,a[0].toLowerCase()+a.slice(1))||Le(o,Er(a))||Le(o,a))}let gn=null,fa=null;function ai(o){const a=gn;return gn=o,fa=o&&o.type.__scopeId||null,a}function w1(o,a=gn,f){if(!a||o._n)return o;const h=(...d)=>{h._d&&uo(-1);const x=ai(a),p=o(...d);return ai(x),h._d&&uo(1),p};return h._n=!0,h._c=!0,h._d=!0,h}function Hi(o){const{type:a,vnode:f,proxy:h,withProxy:d,props:x,propsOptions:[p],slots:T,attrs:m,emit:S,render:M,renderCache:j,data:U,setupState:ne,ctx:K,inheritAttrs:fe}=o;let ue,$;const se=ai(o);try{if(f.shapeFlag&4){const Xe=d||h;ue=hn(M.call(Xe,Xe,j,x,ne,U,K)),$=m}else{const Xe=a;ue=hn(Xe.length>1?Xe(x,{attrs:m,slots:T,emit:S}):Xe(x,null)),$=a.props?m:E1(m)}}catch(Xe){Pr.length=0,xi(Xe,o,1),ue=En(wn)}let Ee=ue;if($&&fe!==!1){const Xe=Object.keys($),{shapeFlag:me}=Ee;Xe.length&&me&7&&(p&&Xe.some(hs)&&($=p1($,p)),Ee=Qn(Ee,$))}return f.dirs&&(Ee.dirs=Ee.dirs?Ee.dirs.concat(f.dirs):f.dirs),f.transition&&(Ee.transition=f.transition),ue=Ee,ai(se),ue}const E1=o=>{let a;for(const f in o)(f==="class"||f==="style"||ui(f))&&((a||(a={}))[f]=o[f]);return a},p1=(o,a)=>{const f={};for(const h in o)(!hs(h)||!(h.slice(9)in a))&&(f[h]=o[h]);return f};function C1(o,a,f){const{props:h,children:d,component:x}=o,{props:p,children:T,patchFlag:m}=a,S=x.emitsOptions;if(a.dirs||a.transition)return!0;if(f&&m>=0){if(m&1024)return!0;if(m&16)return h?no(h,p,S):!!p;if(m&8){const M=a.dynamicProps;for(let j=0;jo.__isSuspense;function T1(o,a){a&&a.pendingBranch?be(o)?a.effects.push(...o):a.effects.push(o):x1(o)}function S1(o,a){if(mt){let f=mt.provides;const h=mt.parent&&mt.parent.provides;h===f&&(f=mt.provides=Object.create(h)),f[o]=a}}function ji(o,a,f=!1){const h=mt||gn;if(h){const d=h.parent==null?h.vnode.appContext&&h.vnode.appContext.provides:h.parent.provides;if(d&&o in d)return d[o];if(arguments.length>1)return f&&Ne(a)?a.call(h.proxy):a}}const ro={};function Vi(o,a,f){return ua(o,a,f)}function ua(o,a,{immediate:f,deep:h,flush:d,onTrack:x,onTrigger:p}=$e){const T=mt;let m,S=!1,M=!1;if(It(o)?(m=()=>o.value,S=Ko(o)):xr(o)?(m=()=>o,h=!0):be(o)?(M=!0,S=o.some(xr),m=()=>o.map($=>{if(It($))return $.value;if(xr($))return ur($);if(Ne($))return Ln($,T,2)})):Ne(o)?a?m=()=>Ln(o,T,2):m=()=>{if(!(T&&T.isUnmounted))return j&&j(),Kt(o,T,3,[U])}:m=tn,a&&h){const $=m;m=()=>ur($())}let j,U=$=>{j=ue.onStop=()=>{Ln($,T,4)}};if(Vr)return U=tn,a?f&&Kt(a,T,3,[m(),M?[]:void 0,U]):m(),tn;let ne=M?[]:ro;const K=()=>{if(!!ue.active)if(a){const $=ue.run();(h||S||(M?$.some((se,Ee)=>Fr(se,ne[Ee])):Fr($,ne)))&&(j&&j(),Kt(a,T,3,[$,ne===ro?void 0:ne,U]),ne=$)}else ue.run()};K.allowRecurse=!!a;let fe;d==="sync"?fe=K:d==="post"?fe=()=>Ft(K,T&&T.suspense):fe=()=>{!T||T.isMounted?g1(K):K()};const ue=new ws(m,fe);return a?f?K():ne=ue.run():d==="post"?Ft(ue.run.bind(ue),T&&T.suspense):ue.run(),()=>{ue.stop(),T&&T.scope&&ds(T.scope.effects,ue)}}function b1(o,a,f){const h=this.proxy,d=Tt(o)?o.includes(".")?ha(h,o):()=>h[o]:o.bind(h,h);let x;Ne(a)?x=a:(x=a.handler,f=a);const p=mt;wr(this);const T=ua(d,x.bind(h),f);return p?wr(p):Kn(),T}function ha(o,a){const f=a.split(".");return()=>{let h=o;for(let d=0;d{ur(f,a)});else if(Po(o))for(const f in o)ur(o[f],a);return o}function y1(){const o={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Aa(()=>{o.isMounted=!0}),wa(()=>{o.isUnmounting=!0}),o}const Gt=[Function,Array],N1={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Gt,onEnter:Gt,onAfterEnter:Gt,onEnterCancelled:Gt,onBeforeLeave:Gt,onLeave:Gt,onAfterLeave:Gt,onLeaveCancelled:Gt,onBeforeAppear:Gt,onAppear:Gt,onAfterAppear:Gt,onAppearCancelled:Gt},setup(o,{slots:a}){const f=dc(),h=y1();let d;return()=>{const x=a.default&&ga(a.default(),!0);if(!x||!x.length)return;let p=x[0];if(x.length>1){for(const fe of x)if(fe.type!==wn){p=fe;break}}const T=ke(o),{mode:m}=T;if(h.isLeaving)return zi(p);const S=io(p);if(!S)return zi(p);const M=Ji(S,T,h,f);$i(S,M);const j=f.subTree,U=j&&io(j);let ne=!1;const{getTransitionKey:K}=S.type;if(K){const fe=K();d===void 0?d=fe:fe!==d&&(d=fe,ne=!0)}if(U&&U.type!==wn&&(!Yn(S,U)||ne)){const fe=Ji(U,T,h,f);if($i(U,fe),m==="out-in")return h.isLeaving=!0,fe.afterLeave=()=>{h.isLeaving=!1,f.update()},zi(p);m==="in-out"&&S.type!==wn&&(fe.delayLeave=(ue,$,se)=>{const Ee=da(h,U);Ee[String(U.key)]=U,ue._leaveCb=()=>{$(),ue._leaveCb=void 0,delete M.delayedLeave},M.delayedLeave=se})}return p}}},_1=N1;function da(o,a){const{leavingVNodes:f}=o;let h=f.get(a.type);return h||(h=Object.create(null),f.set(a.type,h)),h}function Ji(o,a,f,h){const{appear:d,mode:x,persisted:p=!1,onBeforeEnter:T,onEnter:m,onAfterEnter:S,onEnterCancelled:M,onBeforeLeave:j,onLeave:U,onAfterLeave:ne,onLeaveCancelled:K,onBeforeAppear:fe,onAppear:ue,onAfterAppear:$,onAppearCancelled:se}=a,Ee=String(o.key),Xe=da(f,o),me=(ae,V)=>{ae&&Kt(ae,h,9,V)},G={mode:x,persisted:p,beforeEnter(ae){let V=T;if(!f.isMounted)if(d)V=fe||T;else return;ae._leaveCb&&ae._leaveCb(!0);const ve=Xe[Ee];ve&&Yn(o,ve)&&ve.el._leaveCb&&ve.el._leaveCb(),me(V,[ae])},enter(ae){let V=m,ve=S,ze=M;if(!f.isMounted)if(d)V=ue||m,ve=$||S,ze=se||M;else return;let le=!1;const Ie=ae._enterCb=et=>{le||(le=!0,et?me(ze,[ae]):me(ve,[ae]),G.delayedLeave&&G.delayedLeave(),ae._enterCb=void 0)};V?(V(ae,Ie),V.length<=1&&Ie()):Ie()},leave(ae,V){const ve=String(o.key);if(ae._enterCb&&ae._enterCb(!0),f.isUnmounting)return V();me(j,[ae]);let ze=!1;const le=ae._leaveCb=Ie=>{ze||(ze=!0,V(),Ie?me(K,[ae]):me(ne,[ae]),ae._leaveCb=void 0,Xe[ve]===o&&delete Xe[ve])};Xe[ve]=o,U?(U(ae,le),U.length<=1&&le()):le()},clone(ae){return Ji(ae,a,f,h)}};return G}function zi(o){if(wi(o))return o=Qn(o),o.children=null,o}function io(o){return wi(o)?o.children?o.children[0]:void 0:o}function $i(o,a){o.shapeFlag&6&&o.component?$i(o.component.subTree,a):o.shapeFlag&128?(o.ssContent.transition=a.clone(o.ssContent),o.ssFallback.transition=a.clone(o.ssFallback)):o.transition=a}function ga(o,a=!1,f){let h=[],d=0;for(let x=0;x1)for(let x=0;x!!o.type.__asyncLoader,wi=o=>o.type.__isKeepAlive;function M1(o,a){xa(o,"a",a)}function O1(o,a){xa(o,"da",a)}function xa(o,a,f=mt){const h=o.__wdc||(o.__wdc=()=>{let d=f;for(;d;){if(d.isDeactivated)return;d=d.parent}return o()});if(Ei(a,h,f),f){let d=f.parent;for(;d&&d.parent;)wi(d.parent.vnode)&&D1(h,a,f,d),d=d.parent}}function D1(o,a,f,h){const d=Ei(a,o,h,!0);Ea(()=>{ds(h[a],d)},f)}function Ei(o,a,f=mt,h=!1){if(f){const d=f[o]||(f[o]=[]),x=a.__weh||(a.__weh=(...p)=>{if(f.isUnmounted)return;pr(),wr(f);const T=Kt(a,f,o,p);return Kn(),Cr(),T});return h?d.unshift(x):d.push(x),x}}const Cn=o=>(a,f=mt)=>(!Vr||o==="sp")&&Ei(o,a,f),R1=Cn("bm"),Aa=Cn("m"),L1=Cn("bu"),B1=Cn("u"),wa=Cn("bum"),Ea=Cn("um"),v1=Cn("sp"),P1=Cn("rtg"),F1=Cn("rtc");function k1(o,a=mt){Ei("ec",o,a)}let ts=!0;function U1(o){const a=Ca(o),f=o.proxy,h=o.ctx;ts=!1,a.beforeCreate&&so(a.beforeCreate,o,"bc");const{data:d,computed:x,methods:p,watch:T,provide:m,inject:S,created:M,beforeMount:j,mounted:U,beforeUpdate:ne,updated:K,activated:fe,deactivated:ue,beforeDestroy:$,beforeUnmount:se,destroyed:Ee,unmounted:Xe,render:me,renderTracked:G,renderTriggered:ae,errorCaptured:V,serverPrefetch:ve,expose:ze,inheritAttrs:le,components:Ie,directives:et,filters:F}=a;if(S&&H1(S,h,null,o.appContext.config.unwrapInjectedRef),p)for(const We in p){const Re=p[We];Ne(Re)&&(h[We]=Re.bind(f))}if(d){const We=d.call(f,f);St(We)&&(o.data=ms(We))}if(ts=!0,x)for(const We in x){const Re=x[We],xt=Ne(Re)?Re.bind(f,f):Ne(Re.get)?Re.get.bind(f,f):tn,qn=!Ne(Re)&&Ne(Re.set)?Re.set.bind(f):tn,ft=pc({get:xt,set:qn});Object.defineProperty(h,We,{enumerable:!0,configurable:!0,get:()=>ft.value,set:Dt=>ft.value=Dt})}if(T)for(const We in T)pa(T[We],h,f,We);if(m){const We=Ne(m)?m.call(f):m;Reflect.ownKeys(We).forEach(Re=>{S1(Re,We[Re])})}M&&so(M,o,"c");function he(We,Re){be(Re)?Re.forEach(xt=>We(xt.bind(f))):Re&&We(Re.bind(f))}if(he(R1,j),he(Aa,U),he(L1,ne),he(B1,K),he(M1,fe),he(O1,ue),he(k1,V),he(F1,G),he(P1,ae),he(wa,se),he(Ea,Xe),he(v1,ve),be(ze))if(ze.length){const We=o.exposed||(o.exposed={});ze.forEach(Re=>{Object.defineProperty(We,Re,{get:()=>f[Re],set:xt=>f[Re]=xt})})}else o.exposed||(o.exposed={});me&&o.render===tn&&(o.render=me),le!=null&&(o.inheritAttrs=le),Ie&&(o.components=Ie),et&&(o.directives=et)}function H1(o,a,f=tn,h=!1){be(o)&&(o=ns(o));for(const d in o){const x=o[d];let p;St(x)?"default"in x?p=ji(x.from||d,x.default,!0):p=ji(x.from||d):p=ji(x),It(p)&&h?Object.defineProperty(a,d,{enumerable:!0,configurable:!0,get:()=>p.value,set:T=>p.value=T}):a[d]=p}}function so(o,a,f){Kt(be(o)?o.map(h=>h.bind(a.proxy)):o.bind(a.proxy),a,f)}function pa(o,a,f,h){const d=h.includes(".")?ha(f,h):()=>f[h];if(Tt(o)){const x=a[o];Ne(x)&&Vi(d,x)}else if(Ne(o))Vi(d,o.bind(f));else if(St(o))if(be(o))o.forEach(x=>pa(x,a,f,h));else{const x=Ne(o.handler)?o.handler.bind(f):a[o.handler];Ne(x)&&Vi(d,x,o)}}function Ca(o){const a=o.type,{mixins:f,extends:h}=a,{mixins:d,optionsCache:x,config:{optionMergeStrategies:p}}=o.appContext,T=x.get(a);let m;return T?m=T:!d.length&&!f&&!h?m=a:(m={},d.length&&d.forEach(S=>li(m,S,p,!0)),li(m,a,p)),x.set(a,m),m}function li(o,a,f,h=!1){const{mixins:d,extends:x}=a;x&&li(o,x,f,!0),d&&d.forEach(p=>li(o,p,f,!0));for(const p in a)if(!(h&&p==="expose")){const T=j1[p]||f&&f[p];o[p]=T?T(o[p],a[p]):a[p]}return o}const j1={data:oo,props:Wn,emits:Wn,methods:Wn,computed:Wn,beforeCreate:Ot,created:Ot,beforeMount:Ot,mounted:Ot,beforeUpdate:Ot,updated:Ot,beforeDestroy:Ot,beforeUnmount:Ot,destroyed:Ot,unmounted:Ot,activated:Ot,deactivated:Ot,errorCaptured:Ot,serverPrefetch:Ot,components:Wn,directives:Wn,watch:z1,provide:oo,inject:V1};function oo(o,a){return a?o?function(){return _t(Ne(o)?o.call(this,this):o,Ne(a)?a.call(this,this):a)}:a:o}function V1(o,a){return Wn(ns(o),ns(a))}function ns(o){if(be(o)){const a={};for(let f=0;f0)&&!(p&16)){if(p&8){const M=o.vnode.dynamicProps;for(let j=0;j{m=!0;const[U,ne]=Ia(j,a,!0);_t(p,U),ne&&T.push(...ne)};!f&&a.mixins.length&&a.mixins.forEach(M),o.extends&&M(o.extends),o.mixins&&o.mixins.forEach(M)}if(!x&&!m)return h.set(o,dr),dr;if(be(x))for(let M=0;M-1,ne[1]=fe<0||K-1||Le(ne,"default"))&&T.push(j)}}}const S=[p,T];return h.set(o,S),S}function ao(o){return o[0]!=="$"}function lo(o){const a=o&&o.toString().match(/^\s*function (\w+)/);return a?a[1]:o===null?"null":""}function co(o,a){return lo(o)===lo(a)}function fo(o,a){return be(a)?a.findIndex(f=>co(f,o)):Ne(a)&&co(a,o)?0:-1}const Ta=o=>o[0]==="_"||o==="$stable",Ns=o=>be(o)?o.map(hn):[hn(o)],G1=(o,a,f)=>{const h=w1((...d)=>Ns(a(...d)),f);return h._c=!1,h},Sa=(o,a,f)=>{const h=o._ctx;for(const d in o){if(Ta(d))continue;const x=o[d];if(Ne(x))a[d]=G1(d,x,h);else if(x!=null){const p=Ns(x);a[d]=()=>p}}},ba=(o,a)=>{const f=Ns(a);o.slots.default=()=>f},X1=(o,a)=>{if(o.vnode.shapeFlag&32){const f=a._;f?(o.slots=ke(a),si(a,"_",f)):Sa(a,o.slots={})}else o.slots={},a&&ba(o,a);si(o.slots,pi,1)},Z1=(o,a,f)=>{const{vnode:h,slots:d}=o;let x=!0,p=$e;if(h.shapeFlag&32){const T=a._;T?f&&T===1?x=!1:(_t(d,a),!f&&T===1&&delete d._):(x=!a.$stable,Sa(a,d)),p=a}else a&&(ba(o,a),p={default:1});if(x)for(const T in d)!Ta(T)&&!(T in p)&&delete d[T]};function Vn(o,a,f,h){const d=o.dirs,x=a&&a.dirs;for(let p=0;pis(U,a&&(be(a)?a[ne]:a),f,h,d));return}if(es(h)&&!d)return;const x=h.shapeFlag&4?Ds(h.component)||h.component.proxy:h.el,p=d?null:x,{i:T,r:m}=o,S=a&&a.r,M=T.refs===$e?T.refs={}:T.refs,j=T.setupState;if(S!=null&&S!==m&&(Tt(S)?(M[S]=null,Le(j,S)&&(j[S]=null)):It(S)&&(S.value=null)),Ne(m))Ln(m,T,12,[p,M]);else{const U=Tt(m),ne=It(m);if(U||ne){const K=()=>{if(o.f){const fe=U?M[m]:m.value;d?be(fe)&&ds(fe,x):be(fe)?fe.includes(x)||fe.push(x):U?(M[m]=[x],Le(j,m)&&(j[m]=M[m])):(m.value=[x],o.k&&(M[o.k]=m.value))}else U?(M[m]=p,Le(j,m)&&(j[m]=p)):It(m)&&(m.value=p,o.k&&(M[o.k]=p))};p?(K.id=-1,Ft(K,f)):K()}}}const Ft=T1;function q1(o){return J1(o)}function J1(o,a){const f=Dl();f.__VUE__=!0;const{insert:h,remove:d,patchProp:x,createElement:p,createText:T,createComment:m,setText:S,setElementText:M,parentNode:j,nextSibling:U,setScopeId:ne=tn,cloneNode:K,insertStaticContent:fe}=o,ue=(b,_,v,k=null,P=null,H=null,J=!1,R=null,Q=!!_.dynamicChildren)=>{if(b===_)return;b&&!Yn(b,_)&&(k=nn(b),rt(b,P,H,!0),b=null),_.patchFlag===-2&&(Q=!1,_.dynamicChildren=null);const{type:Y,ref:oe,shapeFlag:ie}=_;switch(Y){case _s:$(b,_,v,k);break;case wn:se(b,_,v,k);break;case Wi:b==null&&Ee(_,v,k,J);break;case $t:et(b,_,v,k,P,H,J,R,Q);break;default:ie&1?G(b,_,v,k,P,H,J,R,Q):ie&6?F(b,_,v,k,P,H,J,R,Q):(ie&64||ie&128)&&Y.process(b,_,v,k,P,H,J,R,Q,ut)}oe!=null&&P&&is(oe,b&&b.ref,H,_||b,!_)},$=(b,_,v,k)=>{if(b==null)h(_.el=T(_.children),v,k);else{const P=_.el=b.el;_.children!==b.children&&S(P,_.children)}},se=(b,_,v,k)=>{b==null?h(_.el=m(_.children||""),v,k):_.el=b.el},Ee=(b,_,v,k)=>{[b.el,b.anchor]=fe(b.children,_,v,k,b.el,b.anchor)},Xe=({el:b,anchor:_},v,k)=>{let P;for(;b&&b!==_;)P=U(b),h(b,v,k),b=P;h(_,v,k)},me=({el:b,anchor:_})=>{let v;for(;b&&b!==_;)v=U(b),d(b),b=v;d(_)},G=(b,_,v,k,P,H,J,R,Q)=>{J=J||_.type==="svg",b==null?ae(_,v,k,P,H,J,R,Q):ze(b,_,P,H,J,R,Q)},ae=(b,_,v,k,P,H,J,R)=>{let Q,Y;const{type:oe,props:ie,shapeFlag:re,transition:we,patchFlag:pe,dirs:Te}=b;if(b.el&&K!==void 0&&pe===-1)Q=b.el=K(b.el);else{if(Q=b.el=p(b.type,H,ie&&ie.is,ie),re&8?M(Q,b.children):re&16&&ve(b.children,Q,null,k,P,H&&oe!=="foreignObject",J,R),Te&&Vn(b,null,k,"created"),ie){for(const He in ie)He!=="value"&&!ri(He)&&x(Q,He,null,ie[He],H,b.children,k,P,Ye);"value"in ie&&x(Q,"value",null,ie.value),(Y=ie.onVnodeBeforeMount)&&fn(Y,k,b)}V(Q,b,b.scopeId,J,k)}Te&&Vn(b,null,k,"beforeMount");const Ue=(!P||P&&!P.pendingBranch)&&we&&!we.persisted;Ue&&we.beforeEnter(Q),h(Q,_,v),((Y=ie&&ie.onVnodeMounted)||Ue||Te)&&Ft(()=>{Y&&fn(Y,k,b),Ue&&we.enter(Q),Te&&Vn(b,null,k,"mounted")},P)},V=(b,_,v,k,P)=>{if(v&&ne(b,v),k)for(let H=0;H{for(let Y=Q;Y{const R=_.el=b.el;let{patchFlag:Q,dynamicChildren:Y,dirs:oe}=_;Q|=b.patchFlag&16;const ie=b.props||$e,re=_.props||$e;let we;v&&zn(v,!1),(we=re.onVnodeBeforeUpdate)&&fn(we,v,_,b),oe&&Vn(_,b,v,"beforeUpdate"),v&&zn(v,!0);const pe=P&&_.type!=="foreignObject";if(Y?le(b.dynamicChildren,Y,R,v,k,pe,H):J||xt(b,_,R,null,v,k,pe,H,!1),Q>0){if(Q&16)Ie(R,_,ie,re,v,k,P);else if(Q&2&&ie.class!==re.class&&x(R,"class",null,re.class,P),Q&4&&x(R,"style",ie.style,re.style,P),Q&8){const Te=_.dynamicProps;for(let Ue=0;Ue{we&&fn(we,v,_,b),oe&&Vn(_,b,v,"updated")},k)},le=(b,_,v,k,P,H,J)=>{for(let R=0;R<_.length;R++){const Q=b[R],Y=_[R],oe=Q.el&&(Q.type===$t||!Yn(Q,Y)||Q.shapeFlag&70)?j(Q.el):v;ue(Q,Y,oe,null,k,P,H,J,!0)}},Ie=(b,_,v,k,P,H,J)=>{if(v!==k){for(const R in k){if(ri(R))continue;const Q=k[R],Y=v[R];Q!==Y&&R!=="value"&&x(b,R,Y,Q,J,_.children,P,H,Ye)}if(v!==$e)for(const R in v)!ri(R)&&!(R in k)&&x(b,R,v[R],null,J,_.children,P,H,Ye);"value"in k&&x(b,"value",v.value,k.value)}},et=(b,_,v,k,P,H,J,R,Q)=>{const Y=_.el=b?b.el:T(""),oe=_.anchor=b?b.anchor:T("");let{patchFlag:ie,dynamicChildren:re,slotScopeIds:we}=_;we&&(R=R?R.concat(we):we),b==null?(h(Y,v,k),h(oe,v,k),ve(_.children,v,oe,P,H,J,R,Q)):ie>0&&ie&64&&re&&b.dynamicChildren?(le(b.dynamicChildren,re,v,P,H,J,R),(_.key!=null||P&&_===P.subTree)&&Na(b,_,!0)):xt(b,_,v,oe,P,H,J,R,Q)},F=(b,_,v,k,P,H,J,R,Q)=>{_.slotScopeIds=R,b==null?_.shapeFlag&512?P.ctx.activate(_,v,k,J,Q):ot(_,v,k,P,H,J,Q):he(b,_,Q)},ot=(b,_,v,k,P,H,J)=>{const R=b.component=hc(b,k,P);if(wi(b)&&(R.ctx.renderer=ut),gc(R),R.asyncDep){if(P&&P.registerDep(R,We),!b.el){const Q=R.subTree=En(wn);se(null,Q,_,v)}return}We(R,b,_,v,P,H,J)},he=(b,_,v)=>{const k=_.component=b.component;if(C1(b,_,v))if(k.asyncDep&&!k.asyncResolved){Re(k,_,v);return}else k.next=_,d1(k.update),k.update();else _.component=b.component,_.el=b.el,k.vnode=_},We=(b,_,v,k,P,H,J)=>{const R=()=>{if(b.isMounted){let{next:oe,bu:ie,u:re,parent:we,vnode:pe}=b,Te=oe,Ue;zn(b,!1),oe?(oe.el=pe.el,Re(b,oe,J)):oe=pe,ie&&ki(ie),(Ue=oe.props&&oe.props.onVnodeBeforeUpdate)&&fn(Ue,we,oe,pe),zn(b,!0);const He=Hi(b),kt=b.subTree;b.subTree=He,ue(kt,He,j(kt.el),nn(kt),b,P,H),oe.el=He.el,Te===null&&m1(b,He.el),re&&Ft(re,P),(Ue=oe.props&&oe.props.onVnodeUpdated)&&Ft(()=>fn(Ue,we,oe,pe),P)}else{let oe;const{el:ie,props:re}=_,{bm:we,m:pe,parent:Te}=b,Ue=es(_);if(zn(b,!1),we&&ki(we),!Ue&&(oe=re&&re.onVnodeBeforeMount)&&fn(oe,Te,_),zn(b,!0),ie&&Oe){const He=()=>{b.subTree=Hi(b),Oe(ie,b.subTree,b,P,null)};Ue?_.type.__asyncLoader().then(()=>!b.isUnmounted&&He()):He()}else{const He=b.subTree=Hi(b);ue(null,He,v,k,b,P,H),_.el=He.el}if(pe&&Ft(pe,P),!Ue&&(oe=re&&re.onVnodeMounted)){const He=_;Ft(()=>fn(oe,Te,He),P)}_.shapeFlag&256&&b.a&&Ft(b.a,P),b.isMounted=!0,_=v=k=null}},Q=b.effect=new ws(R,()=>ia(b.update),b.scope),Y=b.update=Q.run.bind(Q);Y.id=b.uid,zn(b,!0),Y()},Re=(b,_,v)=>{_.component=b;const k=b.vnode.props;b.vnode=_,b.next=null,Y1(b,_.props,k,v),Z1(b,_.children,v),pr(),bs(void 0,b.update),Cr()},xt=(b,_,v,k,P,H,J,R,Q=!1)=>{const Y=b&&b.children,oe=b?b.shapeFlag:0,ie=_.children,{patchFlag:re,shapeFlag:we}=_;if(re>0){if(re&128){ft(Y,ie,v,k,P,H,J,R,Q);return}else if(re&256){qn(Y,ie,v,k,P,H,J,R,Q);return}}we&8?(oe&16&&Ye(Y,P,H),ie!==Y&&M(v,ie)):oe&16?we&16?ft(Y,ie,v,k,P,H,J,R,Q):Ye(Y,P,H,!0):(oe&8&&M(v,""),we&16&&ve(ie,v,k,P,H,J,R,Q))},qn=(b,_,v,k,P,H,J,R,Q)=>{b=b||dr,_=_||dr;const Y=b.length,oe=_.length,ie=Math.min(Y,oe);let re;for(re=0;reoe?Ye(b,P,H,!0,!1,ie):ve(_,v,k,P,H,J,R,Q,ie)},ft=(b,_,v,k,P,H,J,R,Q)=>{let Y=0;const oe=_.length;let ie=b.length-1,re=oe-1;for(;Y<=ie&&Y<=re;){const we=b[Y],pe=_[Y]=Q?Dn(_[Y]):hn(_[Y]);if(Yn(we,pe))ue(we,pe,v,null,P,H,J,R,Q);else break;Y++}for(;Y<=ie&&Y<=re;){const we=b[ie],pe=_[re]=Q?Dn(_[re]):hn(_[re]);if(Yn(we,pe))ue(we,pe,v,null,P,H,J,R,Q);else break;ie--,re--}if(Y>ie){if(Y<=re){const we=re+1,pe=were)for(;Y<=ie;)rt(b[Y],P,H,!0),Y++;else{const we=Y,pe=Y,Te=new Map;for(Y=pe;Y<=re;Y++){const _e=_[Y]=Q?Dn(_[Y]):hn(_[Y]);_e.key!=null&&Te.set(_e.key,Y)}let Ue,He=0;const kt=re-pe+1;let Ze=!1,q=0;const tt=new Array(kt);for(Y=0;Y=kt){rt(_e,P,H,!0);continue}let bt;if(_e.key!=null)bt=Te.get(_e.key);else for(Ue=pe;Ue<=re;Ue++)if(tt[Ue-pe]===0&&Yn(_e,_[Ue])){bt=Ue;break}bt===void 0?rt(_e,P,H,!0):(tt[bt-pe]=Y+1,bt>=q?q=bt:Ze=!0,ue(_e,_[bt],v,null,P,H,J,R,Q),He++)}const je=Ze?$1(tt):dr;for(Ue=je.length-1,Y=kt-1;Y>=0;Y--){const _e=pe+Y,bt=_[_e],$n=_e+1{const{el:H,type:J,transition:R,children:Q,shapeFlag:Y}=b;if(Y&6){Dt(b.component.subTree,_,v,k);return}if(Y&128){b.suspense.move(_,v,k);return}if(Y&64){J.move(b,_,v,ut);return}if(J===$t){h(H,_,v);for(let ie=0;ieR.enter(H),P);else{const{leave:ie,delayLeave:re,afterLeave:we}=R,pe=()=>h(H,_,v),Te=()=>{ie(H,()=>{pe(),we&&we()})};re?re(H,pe,Te):Te()}else h(H,_,v)},rt=(b,_,v,k=!1,P=!1)=>{const{type:H,props:J,ref:R,children:Q,dynamicChildren:Y,shapeFlag:oe,patchFlag:ie,dirs:re}=b;if(R!=null&&is(R,null,v,b,!0),oe&256){_.ctx.deactivate(b);return}const we=oe&1&&re,pe=!es(b);let Te;if(pe&&(Te=J&&J.onVnodeBeforeUnmount)&&fn(Te,_,b),oe&6)mr(b.component,v,k);else{if(oe&128){b.suspense.unmount(v,k);return}we&&Vn(b,null,_,"beforeUnmount"),oe&64?b.type.remove(b,_,v,P,ut,k):Y&&(H!==$t||ie>0&&ie&64)?Ye(Y,_,v,!1,!0):(H===$t&&ie&384||!P&&oe&16)&&Ye(Q,_,v),k&&Jn(b)}(pe&&(Te=J&&J.onVnodeUnmounted)||we)&&Ft(()=>{Te&&fn(Te,_,b),we&&Vn(b,null,_,"unmounted")},v)},Jn=b=>{const{type:_,el:v,anchor:k,transition:P}=b;if(_===$t){de(v,k);return}if(_===Wi){me(b);return}const H=()=>{d(v),P&&!P.persisted&&P.afterLeave&&P.afterLeave()};if(b.shapeFlag&1&&P&&!P.persisted){const{leave:J,delayLeave:R}=P,Q=()=>J(v,H);R?R(b.el,H,Q):Q()}else H()},de=(b,_)=>{let v;for(;b!==_;)v=U(b),d(b),b=v;d(_)},mr=(b,_,v)=>{const{bum:k,scope:P,update:H,subTree:J,um:R}=b;k&&ki(k),P.stop(),H&&(H.active=!1,rt(J,b,_,v)),R&&Ft(R,_),Ft(()=>{b.isUnmounted=!0},_),_&&_.pendingBranch&&!_.isUnmounted&&b.asyncDep&&!b.asyncResolved&&b.suspenseId===_.pendingId&&(_.deps--,_.deps===0&&_.resolve())},Ye=(b,_,v,k=!1,P=!1,H=0)=>{for(let J=H;Jb.shapeFlag&6?nn(b.component.subTree):b.shapeFlag&128?b.suspense.next():U(b.anchor||b.el),mn=(b,_,v)=>{b==null?_._vnode&&rt(_._vnode,null,null,!0):ue(_._vnode||null,b,_,null,null,null,v),aa(),_._vnode=b},ut={p:ue,um:rt,m:Dt,r:Jn,mt:ot,mc:ve,pc:xt,pbc:le,n:nn,o};let In,Oe;return a&&([In,Oe]=a(ut)),{render:mn,hydrate:In,createApp:Q1(mn,In)}}function zn({effect:o,update:a},f){o.allowRecurse=a.allowRecurse=f}function Na(o,a,f=!1){const h=o.children,d=a.children;if(be(h)&&be(d))for(let x=0;x>1,o[f[T]]0&&(a[h]=f[x-1]),f[x]=h)}}for(x=f.length,p=f[x-1];x-- >0;)f[x]=p,p=a[p];return f}const ec=o=>o.__isTeleport,tc=Symbol(),$t=Symbol(void 0),_s=Symbol(void 0),wn=Symbol(void 0),Wi=Symbol(void 0),Pr=[];let Zn=null;function Ms(o=!1){Pr.push(Zn=o?null:[])}function nc(){Pr.pop(),Zn=Pr[Pr.length-1]||null}let ci=1;function uo(o){ci+=o}function _a(o){return o.dynamicChildren=ci>0?Zn||dr:null,nc(),ci>0&&Zn&&Zn.push(o),o}function Ma(o,a,f,h,d,x){return _a(jr(o,a,f,h,d,x,!0))}function rc(o,a,f,h,d){return _a(En(o,a,f,h,d,!0))}function ic(o){return o?o.__v_isVNode===!0:!1}function Yn(o,a){return o.type===a.type&&o.key===a.key}const pi="__vInternal",Oa=({key:o})=>o!=null?o:null,ii=({ref:o,ref_key:a,ref_for:f})=>o!=null?Tt(o)||It(o)||Ne(o)?{i:gn,r:o,k:a,f:!!f}:o:null;function jr(o,a=null,f=null,h=0,d=null,x=o===$t?0:1,p=!1,T=!1){const m={__v_isVNode:!0,__v_skip:!0,type:o,props:a,key:a&&Oa(a),ref:a&&ii(a),scopeId:fa,slotScopeIds:null,children:f,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:x,patchFlag:h,dynamicProps:d,dynamicChildren:null,appContext:null};return T?(Os(m,f),x&128&&o.normalize(m)):f&&(m.shapeFlag|=Tt(f)?8:16),ci>0&&!p&&Zn&&(m.patchFlag>0||x&6)&&m.patchFlag!==32&&Zn.push(m),m}const En=sc;function sc(o,a=null,f=null,h=0,d=null,x=!1){if((!o||o===tc)&&(o=wn),ic(o)){const T=Qn(o,a,!0);return f&&Os(T,f),T}if(Ec(o)&&(o=o.__vccOpts),a){a=oc(a);let{class:T,style:m}=a;T&&!Tt(T)&&(a.class=us(T)),St(m)&&(Qo(m)&&!be(m)&&(m=_t({},m)),a.style=fs(m))}const p=Tt(o)?1:I1(o)?128:ec(o)?64:St(o)?4:Ne(o)?2:0;return jr(o,a,f,h,d,p,x,!0)}function oc(o){return o?Qo(o)||pi in o?_t({},o):o:null}function Qn(o,a,f=!1){const{props:h,ref:d,patchFlag:x,children:p}=o,T=a?lc(h||{},a):h;return{__v_isVNode:!0,__v_skip:!0,type:o.type,props:T,key:T&&Oa(T),ref:a&&a.ref?f&&d?be(d)?d.concat(ii(a)):[d,ii(a)]:ii(a):d,scopeId:o.scopeId,slotScopeIds:o.slotScopeIds,children:p,target:o.target,targetAnchor:o.targetAnchor,staticCount:o.staticCount,shapeFlag:o.shapeFlag,patchFlag:a&&o.type!==$t?x===-1?16:x|16:x,dynamicProps:o.dynamicProps,dynamicChildren:o.dynamicChildren,appContext:o.appContext,dirs:o.dirs,transition:o.transition,component:o.component,suspense:o.suspense,ssContent:o.ssContent&&Qn(o.ssContent),ssFallback:o.ssFallback&&Qn(o.ssFallback),el:o.el,anchor:o.anchor}}function ac(o=" ",a=0){return En(_s,null,o,a)}function hn(o){return o==null||typeof o=="boolean"?En(wn):be(o)?En($t,null,o.slice()):typeof o=="object"?Dn(o):En(_s,null,String(o))}function Dn(o){return o.el===null||o.memo?o:Qn(o)}function Os(o,a){let f=0;const{shapeFlag:h}=o;if(a==null)a=null;else if(be(a))f=16;else if(typeof a=="object")if(h&65){const d=a.default;d&&(d._c&&(d._d=!1),Os(o,d()),d._c&&(d._d=!0));return}else{f=32;const d=a._;!d&&!(pi in a)?a._ctx=gn:d===3&&gn&&(gn.slots._===1?a._=1:(a._=2,o.patchFlag|=1024))}else Ne(a)?(a={default:a,_ctx:gn},f=32):(a=String(a),h&64?(f=16,a=[ac(a)]):f=8);o.children=a,o.shapeFlag|=f}function lc(...o){const a={};for(let f=0;fo?Da(o)?Ds(o)||o.proxy:ss(o.parent):null,fi=_t(Object.create(null),{$:o=>o,$el:o=>o.vnode.el,$data:o=>o.data,$props:o=>o.props,$attrs:o=>o.attrs,$slots:o=>o.slots,$refs:o=>o.refs,$parent:o=>ss(o.parent),$root:o=>ss(o.root),$emit:o=>o.emit,$options:o=>Ca(o),$forceUpdate:o=>()=>ia(o.update),$nextTick:o=>ra.bind(o.proxy),$watch:o=>b1.bind(o)}),cc={get({_:o},a){const{ctx:f,setupState:h,data:d,props:x,accessCache:p,type:T,appContext:m}=o;let S;if(a[0]!=="$"){const ne=p[a];if(ne!==void 0)switch(ne){case 1:return h[a];case 2:return d[a];case 4:return f[a];case 3:return x[a]}else{if(h!==$e&&Le(h,a))return p[a]=1,h[a];if(d!==$e&&Le(d,a))return p[a]=2,d[a];if((S=o.propsOptions[0])&&Le(S,a))return p[a]=3,x[a];if(f!==$e&&Le(f,a))return p[a]=4,f[a];ts&&(p[a]=0)}}const M=fi[a];let j,U;if(M)return a==="$attrs"&&jt(o,"get",a),M(o);if((j=T.__cssModules)&&(j=j[a]))return j;if(f!==$e&&Le(f,a))return p[a]=4,f[a];if(U=m.config.globalProperties,Le(U,a))return U[a]},set({_:o},a,f){const{data:h,setupState:d,ctx:x}=o;return d!==$e&&Le(d,a)?(d[a]=f,!0):h!==$e&&Le(h,a)?(h[a]=f,!0):Le(o.props,a)||a[0]==="$"&&a.slice(1)in o?!1:(x[a]=f,!0)},has({_:{data:o,setupState:a,accessCache:f,ctx:h,appContext:d,propsOptions:x}},p){let T;return!!f[p]||o!==$e&&Le(o,p)||a!==$e&&Le(a,p)||(T=x[0])&&Le(T,p)||Le(h,p)||Le(fi,p)||Le(d.config.globalProperties,p)},defineProperty(o,a,f){return f.get!=null?o._.accessCache[a]=0:Le(f,"value")&&this.set(o,a,f.value,null),Reflect.defineProperty(o,a,f)}},fc=ya();let uc=0;function hc(o,a,f){const h=o.type,d=(a?a.appContext:o.appContext)||fc,x={uid:uc++,vnode:o,type:h,parent:a,appContext:d,root:null,next:null,subTree:null,effect:null,update:null,scope:new Rl(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:a?a.provides:Object.create(d.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ia(h,d),emitsOptions:ca(h,d),emit:null,emitted:null,propsDefaults:$e,inheritAttrs:h.inheritAttrs,ctx:$e,data:$e,props:$e,attrs:$e,slots:$e,refs:$e,setupState:$e,setupContext:null,suspense:f,suspenseId:f?f.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return x.ctx={_:x},x.root=a?a.root:x,x.emit=A1.bind(null,x),o.ce&&o.ce(x),x}let mt=null;const dc=()=>mt||gn,wr=o=>{mt=o,o.scope.on()},Kn=()=>{mt&&mt.scope.off(),mt=null};function Da(o){return o.vnode.shapeFlag&4}let Vr=!1;function gc(o,a=!1){Vr=a;const{props:f,children:h}=o.vnode,d=Da(o);W1(o,f,d,a),X1(o,h);const x=d?xc(o,a):void 0;return Vr=!1,x}function xc(o,a){const f=o.type;o.accessCache=Object.create(null),o.proxy=qo(new Proxy(o.ctx,cc));const{setup:h}=f;if(h){const d=o.setupContext=h.length>1?wc(o):null;wr(o),pr();const x=Ln(h,o,0,[o.props,d]);if(Cr(),Kn(),Bo(x)){if(x.then(Kn,Kn),a)return x.then(p=>{ho(o,p,a)}).catch(p=>{xi(p,o,0)});o.asyncDep=x}else ho(o,x,a)}else Ra(o,a)}function ho(o,a,f){Ne(a)?o.type.__ssrInlineRender?o.ssrRender=a:o.render=a:St(a)&&(o.setupState=ta(a)),Ra(o,f)}let go;function Ra(o,a,f){const h=o.type;if(!o.render){if(!a&&go&&!h.render){const d=h.template;if(d){const{isCustomElement:x,compilerOptions:p}=o.appContext.config,{delimiters:T,compilerOptions:m}=h,S=_t(_t({isCustomElement:x,delimiters:T},p),m);h.render=go(d,S)}}o.render=h.render||tn}wr(o),pr(),U1(o),Cr(),Kn()}function Ac(o){return new Proxy(o.attrs,{get(a,f){return jt(o,"get","$attrs"),a[f]}})}function wc(o){const a=h=>{o.exposed=h||{}};let f;return{get attrs(){return f||(f=Ac(o))},slots:o.slots,emit:o.emit,expose:a}}function Ds(o){if(o.exposed)return o.exposeProxy||(o.exposeProxy=new Proxy(ta(qo(o.exposed)),{get(a,f){if(f in a)return a[f];if(f in fi)return fi[f](o)}}))}function Ec(o){return Ne(o)&&"__vccOpts"in o}const pc=(o,a)=>f1(o,a,Vr),Cc="3.2.33",mc="http://www.w3.org/2000/svg",Gn=typeof document!="undefined"?document:null,xo=Gn&&Gn.createElement("template"),Ic={insert:(o,a,f)=>{a.insertBefore(o,f||null)},remove:o=>{const a=o.parentNode;a&&a.removeChild(o)},createElement:(o,a,f,h)=>{const d=a?Gn.createElementNS(mc,o):Gn.createElement(o,f?{is:f}:void 0);return o==="select"&&h&&h.multiple!=null&&d.setAttribute("multiple",h.multiple),d},createText:o=>Gn.createTextNode(o),createComment:o=>Gn.createComment(o),setText:(o,a)=>{o.nodeValue=a},setElementText:(o,a)=>{o.textContent=a},parentNode:o=>o.parentNode,nextSibling:o=>o.nextSibling,querySelector:o=>Gn.querySelector(o),setScopeId(o,a){o.setAttribute(a,"")},cloneNode(o){const a=o.cloneNode(!0);return"_value"in o&&(a._value=o._value),a},insertStaticContent(o,a,f,h,d,x){const p=f?f.previousSibling:a.lastChild;if(d&&(d===x||d.nextSibling))for(;a.insertBefore(d.cloneNode(!0),f),!(d===x||!(d=d.nextSibling)););else{xo.innerHTML=h?`${o}`:o;const T=xo.content;if(h){const m=T.firstChild;for(;m.firstChild;)T.appendChild(m.firstChild);T.removeChild(m)}a.insertBefore(T,f)}return[p?p.nextSibling:a.firstChild,f?f.previousSibling:a.lastChild]}};function Tc(o,a,f){const h=o._vtc;h&&(a=(a?[a,...h]:[...h]).join(" ")),a==null?o.removeAttribute("class"):f?o.setAttribute("class",a):o.className=a}function Sc(o,a,f){const h=o.style,d=Tt(f);if(f&&!d){for(const x in f)os(h,x,f[x]);if(a&&!Tt(a))for(const x in a)f[x]==null&&os(h,x,"")}else{const x=h.display;d?a!==f&&(h.cssText=f):a&&o.removeAttribute("style"),"_vod"in o&&(h.display=x)}}const Ao=/\s*!important$/;function os(o,a,f){if(be(f))f.forEach(h=>os(o,a,h));else if(f==null&&(f=""),a.startsWith("--"))o.setProperty(a,f);else{const h=bc(o,a);Ao.test(f)?o.setProperty(Er(h),f.replace(Ao,""),"important"):o[h]=f}}const wo=["Webkit","Moz","ms"],Yi={};function bc(o,a){const f=Yi[a];if(f)return f;let h=Ar(a);if(h!=="filter"&&h in o)return Yi[a]=h;h=Fo(h);for(let d=0;d{let o=Date.now,a=!1;if(typeof window!="undefined"){Date.now()>document.createEvent("Event").timeStamp&&(o=()=>performance.now());const f=navigator.userAgent.match(/firefox\/(\d+)/i);a=!!(f&&Number(f[1])<=53)}return[o,a]})();let as=0;const Mc=Promise.resolve(),Oc=()=>{as=0},Dc=()=>as||(Mc.then(Oc),as=La());function Rc(o,a,f,h){o.addEventListener(a,f,h)}function Lc(o,a,f,h){o.removeEventListener(a,f,h)}function Bc(o,a,f,h,d=null){const x=o._vei||(o._vei={}),p=x[a];if(h&&p)p.value=h;else{const[T,m]=vc(a);if(h){const S=x[a]=Pc(h,d);Rc(o,T,S,m)}else p&&(Lc(o,T,p,m),x[a]=void 0)}}const po=/(?:Once|Passive|Capture)$/;function vc(o){let a;if(po.test(o)){a={};let f;for(;f=o.match(po);)o=o.slice(0,o.length-f[0].length),a[f[0].toLowerCase()]=!0}return[Er(o.slice(2)),a]}function Pc(o,a){const f=h=>{const d=h.timeStamp||La();(_c||d>=f.attached-1)&&Kt(Fc(h,f.value),a,5,[h])};return f.value=o,f.attached=Dc(),f}function Fc(o,a){if(be(a)){const f=o.stopImmediatePropagation;return o.stopImmediatePropagation=()=>{f.call(o),o._stopped=!0},a.map(h=>d=>!d._stopped&&h&&h(d))}else return a}const Co=/^on[a-z]/,kc=(o,a,f,h,d=!1,x,p,T,m)=>{a==="class"?Tc(o,h,d):a==="style"?Sc(o,f,h):ui(a)?hs(a)||Bc(o,a,f,h,p):(a[0]==="."?(a=a.slice(1),!0):a[0]==="^"?(a=a.slice(1),!1):Uc(o,a,h,d))?Nc(o,a,h,x,p,T,m):(a==="true-value"?o._trueValue=h:a==="false-value"&&(o._falseValue=h),yc(o,a,h,d))};function Uc(o,a,f,h){return h?!!(a==="innerHTML"||a==="textContent"||a in o&&Co.test(a)&&Ne(f)):a==="spellcheck"||a==="draggable"||a==="translate"||a==="form"||a==="list"&&o.tagName==="INPUT"||a==="type"&&o.tagName==="TEXTAREA"||Co.test(a)&&Tt(f)?!1:a in o}const Hc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};_1.props;const jc=_t({patchProp:kc},Ic);let mo;function Vc(){return mo||(mo=q1(jc))}const zc=(...o)=>{const a=Vc().createApp(...o),{mount:f}=a;return a.mount=h=>{const d=Wc(h);if(!d)return;const x=a._component;!Ne(x)&&!x.render&&!x.template&&(x.template=d.innerHTML),d.innerHTML="";const p=f(d,!1,d instanceof SVGElement);return d instanceof Element&&(d.removeAttribute("v-cloak"),d.setAttribute("data-v-app","")),p},a};function Wc(o){return Tt(o)?document.querySelector(o):o}var te;(function(o){o[o.QR_CODE=0]="QR_CODE",o[o.AZTEC=1]="AZTEC",o[o.CODABAR=2]="CODABAR",o[o.CODE_39=3]="CODE_39",o[o.CODE_93=4]="CODE_93",o[o.CODE_128=5]="CODE_128",o[o.DATA_MATRIX=6]="DATA_MATRIX",o[o.MAXICODE=7]="MAXICODE",o[o.ITF=8]="ITF",o[o.EAN_13=9]="EAN_13",o[o.EAN_8=10]="EAN_8",o[o.PDF_417=11]="PDF_417",o[o.RSS_14=12]="RSS_14",o[o.RSS_EXPANDED=13]="RSS_EXPANDED",o[o.UPC_A=14]="UPC_A",o[o.UPC_E=15]="UPC_E",o[o.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(te||(te={}));var Io=new Map([[te.QR_CODE,"QR_CODE"],[te.AZTEC,"AZTEC"],[te.CODABAR,"CODABAR"],[te.CODE_39,"CODE_39"],[te.CODE_93,"CODE_93"],[te.CODE_128,"CODE_128"],[te.DATA_MATRIX,"DATA_MATRIX"],[te.MAXICODE,"MAXICODE"],[te.ITF,"ITF"],[te.EAN_13,"EAN_13"],[te.EAN_8,"EAN_8"],[te.PDF_417,"PDF_417"],[te.RSS_14,"RSS_14"],[te.RSS_EXPANDED,"RSS_EXPANDED"],[te.UPC_A,"UPC_A"],[te.UPC_E,"UPC_E"],[te.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),To;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.URL=1]="URL"})(To||(To={}));function Yc(o){return Object.values(te).includes(o)}var vn;(function(o){o[o.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",o[o.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(vn||(vn={}));var dn=function(){function o(){}return o.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",o.SCAN_DEFAULT_FPS=2,o.DEFAULT_DISABLE_FLIP=!1,o.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,o.DEFAULT_SUPPORTED_SCAN_TYPE=[vn.SCAN_TYPE_CAMERA,vn.SCAN_TYPE_FILE],o}(),Ba=function(){function o(a,f){this.format=a,this.formatName=f}return o.prototype.toString=function(){return this.formatName},o.create=function(a){if(!Io.has(a))throw a+" not in html5QrcodeSupportedFormatsTextMap";return new o(a,Io.get(a))},o}(),So=function(){function o(){}return o.createFromText=function(a){var f={text:a};return{decodedText:a,result:f}},o.createFromQrcodeResult=function(a){return{decodedText:a.text,result:a}},o}(),ls;(function(o){o[o.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",o[o.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",o[o.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(ls||(ls={}));var va=function(){function o(){}return o.createFrom=function(a){return{errorMessage:a,type:ls.UNKWOWN_ERROR}},o}(),Pa=function(){function o(a){this.verbose=a}return o.prototype.log=function(a){this.verbose&&console.log(a)},o.prototype.warn=function(a){this.verbose&&console.warn(a)},o.prototype.logError=function(a,f){(this.verbose||f===!0)&&console.error(a)},o.prototype.logErrors=function(a){if(a.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(a)},o}();function hr(o){return typeof o=="undefined"||o===null}var Or=function(){function o(){}return o.codeParseError=function(a){return"QR code parse error, error = "+a},o.errorGettingUserMedia=function(a){return"Error getting userMedia, error = "+a},o.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},o.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},o.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},o.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},o}(),Jt=function(){function o(){}return o.scanningStatus=function(){return"Scanning"},o.idleStatus=function(){return"Idle"},o.errorStatus=function(){return"Error"},o.permissionStatus=function(){return"Permission"},o.noCameraFoundErrorStatus=function(){return"No Cameras"},o.lastMatch=function(a){return"Last Match: "+a},o.codeScannerTitle=function(){return"Code Scanner"},o.cameraPermissionTitle=function(){return"Request Camera Permissions"},o.cameraPermissionRequesting=function(){return"Requesting camera permissions..."},o.noCameraFound=function(){return"No camera found"},o.scanButtonStopScanningText=function(){return"Stop Scanning"},o.scanButtonStartScanningText=function(){return"Start Scanning"},o.scanButtonScanningStarting=function(){return"Launching Camera..."},o.textIfCameraScanSelected=function(){return"Scan an Image File"},o.textIfFileScanSelected=function(){return"Scan using camera directly"},o.selectCamera=function(){return"Select Camera"},o}(),bo=function(){function o(){}return o.builtUsing=function(){return"Built using "},o.reportIssues=function(){return"Report issues"},o}(),Fa=function(){function o(){}return o.isMediaStreamConstraintsValid=function(a,f){if(typeof a!="object"){var h=typeof a;return f.logError("videoConstraints should be of type object, the "+("object passed is of type "+h+"."),!0),!1}for(var d=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],x=new Set(d),p=Object.keys(a),T=0,m=p;T>ot.LUMINANCE_SHIFT]++;const l=ot.estimateBlackPoint(s);if(r<3)for(let c=0;c>ot.LUMINANCE_SHIFT]++}}const s=ot.estimateBlackPoint(i),l=e.getMatrix();for(let c=0;ci&&(r=g,i=e[g]),e[g]>n&&(n=e[g]);let s=0,l=0;for(let g=0;gl&&(s=g,l=E)}if(r>s){const g=r;r=s,s=g}if(s-r<=t/16)throw new F;let c=s-1,u=-1;for(let g=s-1;g>r;g--){const w=g-r,E=w*w*(s-g)*(n-e[g]);E>u&&(c=g,u=E)}return c<=he.MINIMUM_DIMENSION&&n>=he.MINIMUM_DIMENSION){const r=e.getMatrix();let i=t>>he.BLOCK_SIZE_POWER;(t&he.BLOCK_SIZE_MASK)!==0&&i++;let s=n>>he.BLOCK_SIZE_POWER;(n&he.BLOCK_SIZE_MASK)!==0&&s++;const l=he.calculateBlackPoints(r,i,s,t,n),c=new et(t,n);he.calculateThresholdForBlock(r,i,s,t,n,l,c),this.matrix=c}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(e){return new he(e)}static calculateThresholdForBlock(e,t,n,r,i,s,l){const c=i-he.BLOCK_SIZE,u=r-he.BLOCK_SIZE;for(let g=0;gc&&(w=c);const E=he.cap(g,2,n-3);for(let I=0;Iu&&(y=u);const N=he.cap(I,2,t-3);let O=0;for(let X=-2;X<=2;X++){const Z=s[E+X];O+=Z[N-2]+Z[N-1]+Z[N]+Z[N+1]+Z[N+2]}const B=O/25;he.thresholdBlock(e,y,w,B,r,l)}}}static cap(e,t,n){return en?n:e}static thresholdBlock(e,t,n,r,i,s){for(let l=0,c=n*i+t;ls&&(g=s);for(let w=0;wl&&(E=l);let I=0,y=255,N=0;for(let B=0,X=g*r+E;BN&&(N=W)}if(N-y>he.MIN_DYNAMIC_RANGE)for(B++,X+=r;B>he.BLOCK_SIZE_POWER*2;if(N-y<=he.MIN_DYNAMIC_RANGE&&(O=y/2,u>0&&w>0)){const B=(c[u-1][w]+2*c[u][w-1]+c[u-1][w-1])/4;y>10}r[s]=c}return r}getRow(e,t){if(e<0||e>=this.getHeight())throw new M("Requested row is outside the image: "+e);const n=this.getWidth(),r=e*n;return t===null?t=this.buffer.slice(r,r+n):(t.lengthnew qn(t.deviceId,t.label))})}findDeviceById(e){return ft(this,void 0,void 0,function*(){const t=yield this.listVideoInputDevices();return t?t.find(n=>n.deviceId===e):null})}decodeFromInputVideoDevice(e,t){return ft(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(e,t)})}decodeOnceFromVideoDevice(e,t){return ft(this,void 0,void 0,function*(){this.reset();let n;e?n={deviceId:{exact:e}}:n={facingMode:"environment"};const r={video:n};return yield this.decodeOnceFromConstraints(r,t)})}decodeOnceFromConstraints(e,t){return ft(this,void 0,void 0,function*(){const n=yield navigator.mediaDevices.getUserMedia(e);return yield this.decodeOnceFromStream(n,t)})}decodeOnceFromStream(e,t){return ft(this,void 0,void 0,function*(){this.reset();const n=yield this.attachStreamToVideo(e,t);return yield this.decodeOnce(n)})}decodeFromInputVideoDeviceContinuously(e,t,n){return ft(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(e,t,n)})}decodeFromVideoDevice(e,t,n){return ft(this,void 0,void 0,function*(){let r;e?r={deviceId:{exact:e}}:r={facingMode:"environment"};const i={video:r};return yield this.decodeFromConstraints(i,t,n)})}decodeFromConstraints(e,t,n){return ft(this,void 0,void 0,function*(){const r=yield navigator.mediaDevices.getUserMedia(e);return yield this.decodeFromStream(r,t,n)})}decodeFromStream(e,t,n){return ft(this,void 0,void 0,function*(){this.reset();const r=yield this.attachStreamToVideo(e,t);return yield this.decodeContinuously(r,n)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(e,t){return ft(this,void 0,void 0,function*(){const n=this.prepareVideoElement(t);return this.addVideoSource(n,e),this.videoElement=n,this.stream=e,yield this.playVideoOnLoadAsync(n),n})}playVideoOnLoadAsync(e){return new Promise((t,n)=>this.playVideoOnLoad(e,()=>t()))}playVideoOnLoad(e,t){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(e),e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",t),this.tryPlayVideo(e)}isVideoPlaying(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2}tryPlayVideo(e){return ft(this,void 0,void 0,function*(){if(this.isVideoPlaying(e)){console.warn("Trying to play video that is already playing.");return}try{yield e.play()}catch{console.warn("It was not possible to play the video.")}})}getMediaElement(e,t){const n=document.getElementById(e);if(!n)throw new S(`element with id '${e}' not found`);if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new S(`element with id '${e}' must be an ${t} element`);return n}decodeFromImage(e,t){if(!e&&!t)throw new S("either imageElement with a src set or an url must be provided");return t&&!e?this.decodeFromImageUrl(t):this.decodeFromImageElement(e)}decodeFromVideo(e,t){if(!e&&!t)throw new S("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrl(t):this.decodeFromVideoElement(e)}decodeFromVideoContinuously(e,t,n){if(e===void 0&&t===void 0)throw new S("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrlContinuously(t,n):this.decodeFromVideoElementContinuously(e,n)}decodeFromImageElement(e){if(!e)throw new S("An image element must be provided.");this.reset();const t=this.prepareImageElement(e);this.imageElement=t;let n;return this.isImageLoaded(t)?n=this.decodeOnce(t,!1,!0):n=this._decodeOnLoadImage(t),n}decodeFromVideoElement(e){const t=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(t)}decodeFromVideoElementContinuously(e,t){const n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(n,t)}_decodeFromVideoElementSetup(e){if(!e)throw new S("A video element must be provided.");this.reset();const t=this.prepareVideoElement(e);return this.videoElement=t,t}decodeFromImageUrl(e){if(!e)throw new S("An URL must be provided.");this.reset();const t=this.prepareImageElement();this.imageElement=t;const n=this._decodeOnLoadImage(t);return t.src=e,n}decodeFromVideoUrl(e){if(!e)throw new S("An URL must be provided.");this.reset();const t=this.prepareVideoElement(),n=this.decodeFromVideoElement(t);return t.src=e,n}decodeFromVideoUrlContinuously(e,t){if(!e)throw new S("An URL must be provided.");this.reset();const n=this.prepareVideoElement(),r=this.decodeFromVideoElementContinuously(n,t);return n.src=e,r}_decodeOnLoadImage(e){return new Promise((t,n)=>{this.imageLoadedListener=()=>this.decodeOnce(e,!1,!0).then(t,n),e.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(e){return ft(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(e),yield this.decodeOnce(e)})}_decodeOnLoadVideoContinuously(e,t){return ft(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(e),this.decodeContinuously(e,t)})}isImageLoaded(e){return!(!e.complete||e.naturalWidth===0)}prepareImageElement(e){let t;return typeof e=="undefined"&&(t=document.createElement("img"),t.width=200,t.height=200),typeof e=="string"&&(t=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(t=e),t}prepareVideoElement(e){let t;return!e&&typeof document!="undefined"&&(t=document.createElement("video"),t.width=200,t.height=200),typeof e=="string"&&(t=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(t=e),t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t}decodeOnce(e,t=!0,n=!0){this._stopAsyncDecode=!1;const r=(i,s)=>{if(this._stopAsyncDecode){s(new F("Video stream has ended before any code could be detected.")),this._stopAsyncDecode=void 0;return}try{const l=this.decode(e);i(l)}catch(l){const c=t&&l instanceof F,g=(l instanceof U||l instanceof G)&&n;if(c||g)return setTimeout(r,this._timeBetweenDecodingAttempts,i,s);s(l)}};return new Promise((i,s)=>r(i,s))}decodeContinuously(e,t){this._stopContinuousDecode=!1;const n=()=>{if(this._stopContinuousDecode){this._stopContinuousDecode=void 0;return}try{const r=this.decode(e);t(r,null),setTimeout(n,this.timeBetweenScansMillis)}catch(r){t(null,r);const i=r instanceof U||r instanceof G,s=r instanceof F;(i||s)&&setTimeout(n,this._timeBetweenDecodingAttempts)}};n()}decode(e){const t=this.createBinaryBitmap(e);return this.decodeBitmap(t)}createBinaryBitmap(e){const t=this.getCaptureCanvasContext(e);this.drawImageOnCanvas(t,e);const n=this.getCaptureCanvas(e),r=new xt(n),i=new he(r);return new j(i)}getCaptureCanvasContext(e){if(!this.captureCanvasContext){const n=this.getCaptureCanvas(e).getContext("2d");this.captureCanvasContext=n}return this.captureCanvasContext}getCaptureCanvas(e){if(!this.captureCanvas){const t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas}drawImageOnCanvas(e,t){e.drawImage(t,0,0)}decodeBitmap(e){return this.reader.decode(e,this._hints)}createCaptureCanvas(e){if(typeof document=="undefined")return this._destroyCaptureCanvas(),null;const t=document.createElement("canvas");let n,r;return typeof e!="undefined"&&(e instanceof HTMLVideoElement?(n=e.videoWidth,r=e.videoHeight):e instanceof HTMLImageElement&&(n=e.naturalWidth||e.width,r=e.naturalHeight||e.height)),t.style.width=n+"px",t.style.height=r+"px",t.width=n,t.height=r,t}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(e=>e.stop()),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){!this.videoElement||(typeof this.videoEndedListener!="undefined"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener!="undefined"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener!="undefined"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)}_destroyImageElement(){!this.imageElement||(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(e,t){try{e.srcObject=t}catch{e.src=URL.createObjectURL(t)}}cleanVideoSource(e){try{e.srcObject=null}catch{e.src=""}this.videoElement.removeAttribute("src")}}class rt{constructor(e,t,n=t==null?0:8*t.length,r,i,s=K.currentTimeMillis()){this.text=e,this.rawBytes=t,this.numBits=n,this.resultPoints=r,this.format=i,this.timestamp=s,this.text=e,this.rawBytes=t,n==null?this.numBits=t==null?0:8*t.length:this.numBits=n,this.resultPoints=r,this.format=i,this.resultMetadata=null,s==null?this.timestamp=K.currentTimeMillis():this.timestamp=s}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(e,t){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)}putAllMetadata(e){e!==null&&(this.resultMetadata===null?this.resultMetadata=e:this.resultMetadata=new Map(e))}addResultPoints(e){const t=this.resultPoints;if(t===null)this.resultPoints=e;else if(e!==null&&e.length>0){const n=new Array(t.length+e.length);K.arraycopy(t,0,n,0,t.length),K.arraycopy(e,0,n,t.length,e.length),this.resultPoints=n}}getTimestamp(){return this.timestamp}toString(){return this.text}}var Jn;(function(A){A[A.AZTEC=0]="AZTEC",A[A.CODABAR=1]="CODABAR",A[A.CODE_39=2]="CODE_39",A[A.CODE_93=3]="CODE_93",A[A.CODE_128=4]="CODE_128",A[A.DATA_MATRIX=5]="DATA_MATRIX",A[A.EAN_8=6]="EAN_8",A[A.EAN_13=7]="EAN_13",A[A.ITF=8]="ITF",A[A.MAXICODE=9]="MAXICODE",A[A.PDF_417=10]="PDF_417",A[A.QR_CODE=11]="QR_CODE",A[A.RSS_14=12]="RSS_14",A[A.RSS_EXPANDED=13]="RSS_EXPANDED",A[A.UPC_A=14]="UPC_A",A[A.UPC_E=15]="UPC_E",A[A.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(Jn||(Jn={}));var de=Jn,mr;(function(A){A[A.OTHER=0]="OTHER",A[A.ORIENTATION=1]="ORIENTATION",A[A.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",A[A.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",A[A.ISSUE_NUMBER=4]="ISSUE_NUMBER",A[A.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",A[A.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",A[A.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",A[A.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",A[A.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",A[A.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(mr||(mr={}));var Ye=mr;class nn{constructor(e,t,n,r,i=-1,s=-1){this.rawBytes=e,this.text=t,this.byteSegments=n,this.ecLevel=r,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=s,this.numBits=e==null?0:8*e.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(e){this.numBits=e}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(e){this.errorsCorrected=e}getErasures(){return this.erasures}setErasures(e){this.erasures=e}getOther(){return this.other}setOther(e){this.other=e}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class mn{exp(e){return this.expTable[e]}log(e){if(e===0)throw new M;return this.logTable[e]}static addOrSubtract(e,t){return e^t}}class ut{constructor(e,t){if(t.length===0)throw new M;this.field=e;const n=t.length;if(n>1&&t[0]===0){let r=1;for(;rn.length){const s=t;t=n,n=s}let r=new Int32Array(n.length);const i=n.length-t.length;K.arraycopy(n,0,r,0,i);for(let s=i;s=e.getDegree()&&!r.isZero();){const l=r.getDegree()-e.getDegree(),c=t.multiply(r.getCoefficient(r.getDegree()),s),u=e.multiplyByMonomial(l,c),g=t.buildMonomial(l,c);n=n.addOrSubtract(g),r=r.addOrSubtract(u)}return[n,r]}toString(){let e="";for(let t=this.getDegree();t>=0;t--){let n=this.getCoefficient(t);if(n!==0){if(n<0?(e+=" - ",n=-n):e.length>0&&(e+=" + "),t===0||n!==1){const r=this.field.log(n);r===0?e+="1":r===1?e+="a":(e+="a^",e+=r)}t!==0&&(t===1?e+="x":(e+="x^",e+=t))}}return e}}class In extends m{}In.kind="ArithmeticException";class Oe extends mn{constructor(e,t,n){super(),this.primitive=e,this.size=t,this.generatorBase=n;const r=new Int32Array(t);let i=1;for(let l=0;l=t&&(i^=e,i&=t-1);this.expTable=r;const s=new Int32Array(t);for(let l=0;l=(n/2|0);){let I=i,y=l;if(i=s,l=c,i.isZero())throw new b("r_{i-1} was zero");s=I;let N=r.getZero();const O=i.getCoefficient(i.getDegree()),B=r.inverse(O);for(;s.getDegree()>=i.getDegree()&&!s.isZero();){const X=s.getDegree()-i.getDegree(),Z=r.multiply(s.getCoefficient(s.getDegree()),B);N=N.addOrSubtract(r.buildMonomial(X,Z)),s=s.addOrSubtract(i.multiplyByMonomial(X,Z))}if(c=N.multiply(l).addOrSubtract(y),s.getDegree()>=i.getDegree())throw new _("Division algorithm failed to reduce polynomial?")}const u=c.getCoefficient(0);if(u===0)throw new b("sigmaTilde(0) was zero");const g=r.inverse(u),w=c.multiplyScalar(g),E=s.multiplyScalar(g);return[w,E]}findErrorLocations(e){const t=e.getDegree();if(t===1)return Int32Array.from([e.getCoefficient(1)]);const n=new Int32Array(t);let r=0;const i=this.field;for(let s=1;s1,w,w+n-1),w+=n-1;else for(let y=n-1;y>=0;--y)g[w++]=(I&1<=8?P.readCode(e,t,8):P.readCode(e,t,n)<<8-n}static convertBoolArrayToByteArray(e){let t=new Uint8Array((e.length+7)/8);for(let n=0;n","?","[","]","{","}","CTRL_UL"],P.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class H{constructor(){}static round(e){return e===NaN?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0}static distance(e,t,n,r){const i=e-n,s=t-r;return Math.sqrt(i*i+s*s)}static sum(e){let t=0;for(let n=0,r=e.length;n!==r;n++)t+=e[n];return t}}class J{static floatToIntBits(e){return e}}J.MAX_VALUE=Number.MAX_SAFE_INTEGER;class R{constructor(e,t){this.x=e,this.y=t}getX(){return this.x}getY(){return this.y}equals(e){if(e instanceof R){const t=e;return this.x===t.x&&this.y===t.y}return!1}hashCode(){return 31*J.floatToIntBits(this.x)+J.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(e){const t=this.distance(e[0],e[1]),n=this.distance(e[1],e[2]),r=this.distance(e[0],e[2]);let i,s,l;if(n>=t&&n>=r?(s=e[0],i=e[1],l=e[2]):r>=n&&r>=t?(s=e[1],i=e[0],l=e[2]):(s=e[2],i=e[0],l=e[1]),this.crossProductZ(i,s,l)<0){const c=i;i=l,l=c}e[0]=i,e[1]=s,e[2]=l}static distance(e,t){return H.distance(e.x,e.y,t.x,t.y)}static crossProductZ(e,t,n){const r=t.x,i=t.y;return(n.x-r)*(e.y-i)-(n.y-i)*(e.x-r)}}class Q{constructor(e,t){this.bits=e,this.points=t}getBits(){return this.bits}getPoints(){return this.points}}class Y extends Q{constructor(e,t,n,r,i){super(e,t),this.compact=n,this.nbDatablocks=r,this.nbLayers=i}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class oe{constructor(e,t,n,r){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),t==null&&(t=oe.INIT_SIZE),n==null&&(n=e.getWidth()/2|0),r==null&&(r=e.getHeight()/2|0);const i=t/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=r-i,this.downInit=r+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new F}detect(){let e=this.leftInit,t=this.rightInit,n=this.upInit,r=this.downInit,i=!1,s=!0,l=!1,c=!1,u=!1,g=!1,w=!1;const E=this.width,I=this.height;for(;s;){s=!1;let y=!0;for(;(y||!c)&&t=E){i=!0;break}let N=!0;for(;(N||!u)&&r=I){i=!0;break}let O=!0;for(;(O||!g)&&e>=0;)O=this.containsBlackPoint(n,r,e,!1),O?(e--,s=!0,g=!0):g||e--;if(e<0){i=!0;break}let B=!0;for(;(B||!w)&&n>=0;)B=this.containsBlackPoint(e,t,n,!0),B?(n--,s=!0,w=!0):w||n--;if(n<0){i=!0;break}s&&(l=!0)}if(!i&&l){const y=t-e;let N=null;for(let Z=1;N===null&&Zn||c<-1||c>r)throw new F;i=!1,l===-1?(t[s]=0,i=!0):l===n&&(t[s]=n-1,i=!0),c===-1?(t[s+1]=0,i=!0):c===r&&(t[s+1]=r-1,i=!0)}i=!0;for(let s=t.length-2;s>=0&&i;s-=2){const l=Math.floor(t[s]),c=Math.floor(t[s+1]);if(l<-1||l>n||c<-1||c>r)throw new F;i=!1,l===-1?(t[s]=0,i=!0):l===n&&(t[s]=n-1,i=!0),c===-1?(t[s+1]=0,i=!0):c===r&&(t[s+1]=r-1,i=!0)}}}class re{constructor(e,t,n,r,i,s,l,c,u){this.a11=e,this.a21=t,this.a31=n,this.a12=r,this.a22=i,this.a32=s,this.a13=l,this.a23=c,this.a33=u}static quadrilateralToQuadrilateral(e,t,n,r,i,s,l,c,u,g,w,E,I,y,N,O){const B=re.quadrilateralToSquare(e,t,n,r,i,s,l,c);return re.squareToQuadrilateral(u,g,w,E,I,y,N,O).times(B)}transformPoints(e){const t=e.length,n=this.a11,r=this.a12,i=this.a13,s=this.a21,l=this.a22,c=this.a23,u=this.a31,g=this.a32,w=this.a33;for(let E=0;E>1&127):(r<<=10,r+=(l>>2&31<<5)+(l>>1&31))}let i=this.getCorrectedParameterData(r,this.compact);this.compact?(this.nbLayers=(i>>6)+1,this.nbDataBlocks=(i&63)+1):(this.nbLayers=(i>>11)+1,this.nbDataBlocks=(i&2047)+1)}getRotation(e,t){let n=0;e.forEach((r,i,s)=>{let l=(r>>t-2<<1)+(r&1);n=(n<<3)+l}),n=((n&1)<<11)+(n>>1);for(let r=0;r<4;r++)if(se.bitCount(n^this.EXPECTED_CORNER_BITS[r])<=2)return r;throw new F}getCorrectedParameterData(e,t){let n,r;t?(n=7,r=2):(n=10,r=4);let i=n-r,s=new Int32Array(n);for(let c=n-1;c>=0;--c)s[c]=e&15,e>>=4;try{new v(Oe.AZTEC_PARAM).decode(s,i)}catch{throw new F}let l=0;for(let c=0;c2){let N=this.distancePoint(y,w)*this.nbCenterLayers/(this.distancePoint(i,t)*(this.nbCenterLayers+2));if(N<.75||N>1.25||!this.isWhiteOrBlackRectangle(w,E,I,y))break}t=w,n=E,r=I,i=y,s=!s}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new F;this.compact=this.nbCenterLayers===5;let l=new R(t.getX()+.5,t.getY()-.5),c=new R(n.getX()+.5,n.getY()+.5),u=new R(r.getX()-.5,r.getY()+.5),g=new R(i.getX()-.5,i.getY()-.5);return this.expandSquare([l,c,u,g],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let e,t,n,r;try{let l=new oe(this.image).detect();e=l[0],t=l[1],n=l[2],r=l[3]}catch{let c=this.image.getWidth()/2,u=this.image.getHeight()/2;e=this.getFirstDifferent(new Te(c+7,u-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new Te(c+7,u+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new Te(c-7,u+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new Te(c-7,u-7),!1,-1,-1).toResultPoint()}let i=H.round((e.getX()+r.getX()+t.getX()+n.getX())/4),s=H.round((e.getY()+r.getY()+t.getY()+n.getY())/4);try{let l=new oe(this.image,15,i,s).detect();e=l[0],t=l[1],n=l[2],r=l[3]}catch{e=this.getFirstDifferent(new Te(i+7,s-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new Te(i+7,s+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new Te(i-7,s+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new Te(i-7,s-7),!1,-1,-1).toResultPoint()}return i=H.round((e.getX()+r.getX()+t.getX()+n.getX())/4),s=H.round((e.getY()+r.getY()+t.getY()+n.getY())/4),new Te(i,s)}getMatrixCornerPoints(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())}sampleGrid(e,t,n,r,i){let s=pe.getInstance(),l=this.getDimension(),c=l/2-this.nbCenterLayers,u=l/2+this.nbCenterLayers;return s.sampleGrid(e,l,l,c,c,u,c,u,u,c,u,t.getX(),t.getY(),n.getX(),n.getY(),r.getX(),r.getY(),i.getX(),i.getY())}sampleLine(e,t,n){let r=0,i=this.distanceResultPoint(e,t),s=i/n,l=e.getX(),c=e.getY(),u=s*(t.getX()-e.getX())/i,g=s*(t.getY()-e.getY())/i;for(let w=0;w.1&&w<.9?0:w<=.1===u?1:-1}getFirstDifferent(e,t,n,r){let i=e.getX()+n,s=e.getY()+r;for(;this.isValid(i,s)&&this.image.get(i,s)===t;)i+=n,s+=r;for(i-=n,s-=r;this.isValid(i,s)&&this.image.get(i,s)===t;)i+=n;for(i-=n;this.isValid(i,s)&&this.image.get(i,s)===t;)s+=r;return s-=r,new Te(i,s)}expandSquare(e,t,n){let r=n/(2*t),i=e[0].getX()-e[2].getX(),s=e[0].getY()-e[2].getY(),l=(e[0].getX()+e[2].getX())/2,c=(e[0].getY()+e[2].getY())/2,u=new R(l+r*i,c+r*s),g=new R(l-r*i,c-r*s);i=e[1].getX()-e[3].getX(),s=e[1].getY()-e[3].getY(),l=(e[1].getX()+e[3].getX())/2,c=(e[1].getY()+e[3].getY())/2;let w=new R(l+r*i,c+r*s),E=new R(l-r*i,c-r*s);return[u,w,g,E]}isValid(e,t){return e>=0&&e0&&t{n.foundPossibleResultPoint(r)})}}reset(){}}class kt extends Dt{constructor(e=500){super(new He,e)}}class Ze{decode(e,t){try{return this.doDecode(e,t)}catch{if(t&&t.get(me.TRY_HARDER)===!0&&e.isRotateSupported()){const i=e.rotateCounterClockwise(),s=this.doDecode(i,t),l=s.getResultMetadata();let c=270;l!==null&&l.get(Ye.ORIENTATION)===!0&&(c=c+l.get(Ye.ORIENTATION)%360),s.putMetadata(Ye.ORIENTATION,c);const u=s.getResultPoints();if(u!==null){const g=i.getHeight();for(let w=0;w>(s?8:5));let c;s?c=r:c=15;const u=Math.trunc(r/2);for(let g=0;g=r)break;try{i=e.getBlackRow(I,i)}catch{continue}for(let y=0;y<2;y++){if(y===1&&(i.reverse(),t&&t.get(me.NEED_RESULT_POINT_CALLBACK)===!0)){const N=new Map;t.forEach((O,B)=>N.set(B,O)),N.delete(me.NEED_RESULT_POINT_CALLBACK),t=N}try{const N=this.decodeRow(I,i,t);if(y===1){N.putMetadata(Ye.ORIENTATION,180);const O=N.getResultPoints();O!==null&&(O[0]=new R(n-O[0].getX()-1,O[0].getY()),O[1]=new R(n-O[1].getX()-1,O[1].getY()))}return N}catch{}}}throw new F}static recordPattern(e,t,n){const r=n.length;for(let u=0;u=i)throw new F;let s=!e.get(t),l=0,c=t;for(;c0&&r>=0;)e.get(--t)!==i&&(r--,i=!i);if(r>=0)throw new F;Ze.recordPattern(e,t+1,n)}static patternMatchVariance(e,t,n){const r=e.length;let i=0,s=0;for(let u=0;uw?g-w:w-g;if(E>n)return Number.POSITIVE_INFINITY;c+=E}return c/i}}class q extends Ze{static findStartPattern(e){const t=e.getSize(),n=e.getNextSet(0);let r=0,i=Int32Array.from([0,0,0,0,0,0]),s=n,l=!1;const c=6;for(let u=n;u=0&&e.isRange(Math.max(0,s-(u-s)/2),s,!1))return Int32Array.from([s,u,w]);s+=i[0]+i[1],i=i.slice(2,i.length-1),i[r-1]=0,i[r]=0,r--}else r++;i[r]=1,l=!l}throw new F}static decodeCode(e,t,n){Ze.recordPattern(e,n,t);let r=q.MAX_AVG_VARIANCE,i=-1;for(let s=0;s=0)return i;throw new F}decodeRow(e,t,n){const r=n&&n.get(me.ASSUME_GS1)===!0,i=q.findStartPattern(t),s=i[2];let l=0;const c=new Uint8Array(20);c[l++]=s;let u;switch(s){case q.CODE_START_A:u=q.CODE_CODE_A;break;case q.CODE_START_B:u=q.CODE_CODE_B;break;case q.CODE_START_C:u=q.CODE_CODE_C;break;default:throw new G}let g=!1,w=!1,E="",I=i[0],y=i[1];const N=Int32Array.from([0,0,0,0,0,0]);let O=0,B=0,X=s,Z=0,W=!0,Me=!1,Ce=!1;for(;!g;){const lr=w;switch(w=!1,O=B,B=q.decodeCode(t,N,y),c[l++]=B,B!==q.CODE_STOP&&(W=!0),B!==q.CODE_STOP&&(Z++,X+=Z*B),I=y,y+=N.reduce((dl,gl)=>dl+gl,0),B){case q.CODE_START_A:case q.CODE_START_B:case q.CODE_START_C:throw new G}switch(u){case q.CODE_CODE_A:if(B<64)Ce===Me?E+=String.fromCharCode(" ".charCodeAt(0)+B):E+=String.fromCharCode(" ".charCodeAt(0)+B+128),Ce=!1;else if(B<96)Ce===Me?E+=String.fromCharCode(B-64):E+=String.fromCharCode(B+64),Ce=!1;else switch(B!==q.CODE_STOP&&(W=!1),B){case q.CODE_FNC_1:r&&(E.length===0?E+="]C1":E+=String.fromCharCode(29));break;case q.CODE_FNC_2:case q.CODE_FNC_3:break;case q.CODE_FNC_4_A:!Me&&Ce?(Me=!0,Ce=!1):Me&&Ce?(Me=!1,Ce=!1):Ce=!0;break;case q.CODE_SHIFT:w=!0,u=q.CODE_CODE_B;break;case q.CODE_CODE_B:u=q.CODE_CODE_B;break;case q.CODE_CODE_C:u=q.CODE_CODE_C;break;case q.CODE_STOP:g=!0;break}break;case q.CODE_CODE_B:if(B<96)Ce===Me?E+=String.fromCharCode(" ".charCodeAt(0)+B):E+=String.fromCharCode(" ".charCodeAt(0)+B+128),Ce=!1;else switch(B!==q.CODE_STOP&&(W=!1),B){case q.CODE_FNC_1:r&&(E.length===0?E+="]C1":E+=String.fromCharCode(29));break;case q.CODE_FNC_2:case q.CODE_FNC_3:break;case q.CODE_FNC_4_B:!Me&&Ce?(Me=!0,Ce=!1):Me&&Ce?(Me=!1,Ce=!1):Ce=!0;break;case q.CODE_SHIFT:w=!0,u=q.CODE_CODE_A;break;case q.CODE_CODE_A:u=q.CODE_CODE_A;break;case q.CODE_CODE_C:u=q.CODE_CODE_C;break;case q.CODE_STOP:g=!0;break}break;case q.CODE_CODE_C:if(B<100)B<10&&(E+="0"),E+=B;else switch(B!==q.CODE_STOP&&(W=!1),B){case q.CODE_FNC_1:r&&(E.length===0?E+="]C1":E+=String.fromCharCode(29));break;case q.CODE_CODE_A:u=q.CODE_CODE_A;break;case q.CODE_CODE_B:u=q.CODE_CODE_B;break;case q.CODE_STOP:g=!0;break}break}lr&&(u=u===q.CODE_CODE_A?q.CODE_CODE_B:q.CODE_CODE_A)}const vt=y-I;if(y=t.getNextUnset(y),!t.isRange(y,Math.min(t.getSize(),y+(y-I)/2),!1))throw new F;if(X-=Z*O,X%103!==O)throw new U;const qt=E.length;if(qt===0)throw new F;qt>0&&W&&(u===q.CODE_CODE_C?E=E.substring(0,qt-2):E=E.substring(0,qt-1));const Pt=(i[1]+i[0])/2,Qe=I+vt/2,Ct=c.length,Ut=new Uint8Array(Ct);for(let lr=0;lrn&&(i=c);n=i,r=0;let s=0,l=0;for(let c=0;cn&&(l|=1<0;c++){let u=e[c];if(u>n&&(r--,u*2>=s))return-1}return l}}while(r>3);return-1}static patternToChar(e){for(let t=0;t="A"&&s<="Z")l=String.fromCharCode(s.charCodeAt(0)+32);else throw new G;break;case"$":if(s>="A"&&s<="Z")l=String.fromCharCode(s.charCodeAt(0)-64);else throw new G;break;case"%":if(s>="A"&&s<="E")l=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")l=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")l=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")l="\0";else if(s==="V")l="@";else if(s==="W")l="`";else if(s==="X"||s==="Y"||s==="Z")l="\x7F";else throw new G;break;case"/":if(s>="A"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")l=":";else throw new G;break}n+=l,r++}else n+=i}return n}}tt.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",tt.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],tt.ASTERISK_ENCODING=148;class je extends Ze{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(e,t,n){let r=this.decodeStart(t),i=this.decodeEnd(t),s=new Ie;je.decodeMiddle(t,r[1],i[0],s);let l=s.toString(),c=null;n!=null&&(c=n.get(me.ALLOWED_LENGTHS)),c==null&&(c=je.DEFAULT_ALLOWED_LENGTHS);let u=l.length,g=!1,w=0;for(let y of c){if(u===y){g=!0;break}y>w&&(w=y)}if(!g&&u>w&&(g=!0),!g)throw new G;const E=[new R(r[1],e),new R(i[0],e)];return new rt(l,null,0,E,de.ITF,new Date().getTime())}static decodeMiddle(e,t,n,r){let i=new Int32Array(10),s=new Int32Array(5),l=new Int32Array(5);for(i.fill(0),s.fill(0),l.fill(0);t0&&r>=0&&!e.get(r);r--)n--;if(n!==0)throw new F}static skipWhiteSpace(e){const t=e.getSize(),n=e.getNextSet(0);if(n===t)throw new F;return n}decodeEnd(e){e.reverse();try{let t=je.skipWhiteSpace(e),n;try{n=je.findGuardPattern(e,t,je.END_PATTERN_REVERSED[0])}catch(i){i instanceof F&&(n=je.findGuardPattern(e,t,je.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,n[0]);let r=n[0];return n[0]=e.getSize()-n[1],n[1]=e.getSize()-r,n}finally{e.reverse()}}static findGuardPattern(e,t,n){let r=n.length,i=new Int32Array(r),s=e.getSize(),l=!1,c=0,u=t;i.fill(0);for(let g=t;g=0)return n%10;throw new F}}je.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],je.MAX_AVG_VARIANCE=.38,je.MAX_INDIVIDUAL_VARIANCE=.5,je.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],je.START_PATTERN=Int32Array.from([1,1,1,1]),je.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class _e extends Ze{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(e){let t=!1,n,r=0,i=Int32Array.from([0,0,0]);for(;!t;){i=Int32Array.from([0,0,0]),n=_e.findGuardPattern(e,r,!1,this.START_END_PATTERN,i);let s=n[0];r=n[1];let l=s-(r-s);l>=0&&(t=e.isRange(l,s,!1))}return n}static checkChecksum(e){return _e.checkStandardUPCEANChecksum(e)}static checkStandardUPCEANChecksum(e){let t=e.length;if(t===0)return!1;let n=parseInt(e.charAt(t-1),10);return _e.getStandardUPCEANChecksum(e.substring(0,t-1))===n}static getStandardUPCEANChecksum(e){let t=e.length,n=0;for(let r=t-1;r>=0;r-=2){let i=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(i<0||i>9)throw new G;n+=i}n*=3;for(let r=t-2;r>=0;r-=2){let i=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(i<0||i>9)throw new G;n+=i}return(1e3-n)%10}static decodeEnd(e,t){return _e.findGuardPattern(e,t,!1,_e.START_END_PATTERN,new Int32Array(_e.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(e,t,n,r){return this.findGuardPattern(e,t,n,r,new Int32Array(r.length))}static findGuardPattern(e,t,n,r,i){let s=e.getSize();t=n?e.getNextUnset(t):e.getNextSet(t);let l=0,c=t,u=r.length,g=n;for(let w=t;w=0)return s;throw new F}}_e.MAX_AVG_VARIANCE=.48,_e.MAX_INDIVIDUAL_VARIANCE=.7,_e.START_END_PATTERN=Int32Array.from([1,1,1]),_e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),_e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),_e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])];class bt{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(e,t,n){let r=this.decodeRowStringBuffer,i=this.decodeMiddle(t,n,r),s=r.toString(),l=bt.parseExtensionString(s),c=[new R((n[0]+n[1])/2,e),new R(i,e)],u=new rt(s,null,0,c,de.UPC_EAN_EXTENSION,new Date().getTime());return l!=null&&u.putAllMetadata(l),u}decodeMiddle(e,t,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=e.getSize(),s=t[1],l=0;for(let u=0;u<5&&s=10&&(l|=1<<4-u),u!==4&&(s=e.getNextSet(s),s=e.getNextUnset(s))}if(n.length!==5)throw new F;let c=this.determineCheckDigit(l);if(bt.extensionChecksum(n.toString())!==c)throw new F;return s}static extensionChecksum(e){let t=e.length,n=0;for(let r=t-2;r>=0;r-=2)n+=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);n*=3;for(let r=t-1;r>=0;r-=2)n+=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);return n*=3,n%10}determineCheckDigit(e){for(let t=0;t<10;t++)if(e===this.CHECK_DIGIT_ENCODINGS[t])return t;throw new F}static parseExtensionString(e){if(e.length!==5)return null;let t=bt.parseExtension5String(e);return t==null?null:new Map([[Ye.SUGGESTED_PRICE,t]])}static parseExtension5String(e){let t;switch(e.charAt(0)){case"0":t="\xA3";break;case"5":t="$";break;case"9":switch(e){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}t="";break;default:t="";break}let n=parseInt(e.substring(1)),r=(n/100).toString(),i=n%100,s=i<10?"0"+i:i.toString();return t+r+"."+s}}class $n{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(e,t,n){let r=this.decodeRowStringBuffer,i=this.decodeMiddle(t,n,r),s=r.toString(),l=$n.parseExtensionString(s),c=[new R((n[0]+n[1])/2,e),new R(i,e)],u=new rt(s,null,0,c,de.UPC_EAN_EXTENSION,new Date().getTime());return l!=null&&u.putAllMetadata(l),u}decodeMiddle(e,t,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=e.getSize(),s=t[1],l=0;for(let c=0;c<2&&s=10&&(l|=1<<1-c),c!==1&&(s=e.getNextSet(s),s=e.getNextUnset(s))}if(n.length!==2)throw new F;if(parseInt(n.toString())%4!==l)throw new F;return s}static parseExtensionString(e){return e.length!==2?null:new Map([[Ye.ISSUE_NUMBER,parseInt(e)]])}}class Rs{static decodeRow(e,t,n){let r=_e.findGuardPattern(t,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new bt().decodeRow(e,t,r)}catch{return new $n().decodeRow(e,t,r)}}}Rs.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class Pe extends _e{constructor(){super(),this.decodeRowStringBuffer="",Pe.L_AND_G_PATTERNS=Pe.L_PATTERNS.map(e=>Int32Array.from(e));for(let e=10;e<20;e++){let t=Pe.L_PATTERNS[e-10],n=new Int32Array(t.length);for(let r=0;r=t.getSize()||!t.isRange(g,w,!1))throw new F;let E=c.toString();if(E.length<8)throw new G;if(!Pe.checkChecksum(E))throw new U;let I=(r[1]+r[0])/2,y=(u[1]+u[0])/2,N=this.getBarcodeFormat(),O=[new R(I,e),new R(y,e)],B=new rt(E,null,0,O,N,new Date().getTime()),X=0;try{let W=Rs.decodeRow(e,t,u[1]);B.putMetadata(Ye.UPC_EAN_EXTENSION,W.getText()),B.putAllMetadata(W.getResultMetadata()),B.addResultPoints(W.getResultPoints()),X=W.getText().length}catch{}let Z=n==null?null:n.get(me.ALLOWED_EAN_EXTENSIONS);if(Z!=null){let W=!1;for(let Me in Z)if(X.toString()===Me){W=!0;break}if(!W)throw new F}return N===de.EAN_13||de.UPC_A,B}static checkChecksum(e){return Pe.checkStandardUPCEANChecksum(e)}static checkStandardUPCEANChecksum(e){let t=e.length;if(t===0)return!1;let n=parseInt(e.charAt(t-1),10);return Pe.getStandardUPCEANChecksum(e.substring(0,t-1))===n}static getStandardUPCEANChecksum(e){let t=e.length,n=0;for(let r=t-1;r>=0;r-=2){let i=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(i<0||i>9)throw new G;n+=i}n*=3;for(let r=t-2;r>=0;r-=2){let i=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(i<0||i>9)throw new G;n+=i}return(1e3-n)%10}static decodeEnd(e,t){return Pe.findGuardPattern(e,t,!1,Pe.START_END_PATTERN,new Int32Array(Pe.START_END_PATTERN.length).fill(0))}}class Pn extends Pe{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(e,t,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=e.getSize(),s=t[1],l=0;for(let u=0;u<6&&s=10&&(l|=1<<5-u)}n=Pn.determineFirstDigit(n,l),s=Pe.findGuardPattern(e,s,!0,Pe.MIDDLE_PATTERN,new Int32Array(Pe.MIDDLE_PATTERN.length).fill(0))[1];for(let u=0;u<6&&sc);r[0]=0,r[1]=0,r[2]=0,r[3]=0;const i=e.getSize();let s=t[1],l=0;for(let c=0;c<6&&s=10&&(l|=1<<5-c)}return Qt.determineNumSysAndCheckDigit(new Ie(n),l),s}decodeEnd(e,t){return Qt.findGuardPatternWithoutCounters(e,t,!0,Qt.MIDDLE_END_PATTERN)}checkChecksum(e){return Pe.checkChecksum(Qt.convertUPCEtoUPCA(e))}static determineNumSysAndCheckDigit(e,t){for(let n=0;n<=1;n++)for(let r=0;r<10;r++)if(t===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[n][r]){e.insert(0,"0"+n),e.append("0"+r);return}throw F.getNotFoundInstance()}getBarcodeFormat(){return de.UPC_E}static convertUPCEtoUPCA(e){const t=e.slice(1,7).split("").map(i=>i.charCodeAt(0)),n=new Ie;n.append(e.charAt(0));let r=t[5];switch(r){case 0:case 1:case 2:n.appendChars(t,0,2),n.append(r),n.append("0000"),n.appendChars(t,2,3);break;case 3:n.appendChars(t,0,3),n.append("00000"),n.appendChars(t,3,2);break;case 4:n.appendChars(t,0,4),n.append("00000"),n.append(t[4]);break;default:n.appendChars(t,0,5),n.append("0000"),n.append(r);break}return e.length>=8&&n.append(e.charAt(7)),n.toString()}}Qt.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Qt.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])];class Ci extends Ze{constructor(e){super();let t=e==null?null:e.get(me.POSSIBLE_FORMATS),n=[];t!=null&&(t.indexOf(de.EAN_13)>-1?n.push(new Pn):t.indexOf(de.UPC_A)>-1&&n.push(new Fa),t.indexOf(de.EAN_8)>-1&&n.push(new Ls),t.indexOf(de.UPC_E)>-1&&n.push(new Qt)),n.length===0&&(n.push(new Pn),n.push(new Ls),n.push(new Qt)),this.readers=n}decodeRow(e,t,n){for(let r of this.readers)try{const i=r.decodeRow(e,t,n),s=i.getBarcodeFormat()===de.EAN_13&&i.getText().charAt(0)==="0",l=n==null?null:n.get(me.POSSIBLE_FORMATS),c=l==null||l.includes(de.UPC_A);if(s&&c){const u=i.getRawBytes(),g=new rt(i.getText().substring(1),u,u.length,i.getResultPoints(),de.UPC_A);return g.putAllMetadata(i.getResultMetadata()),g}return i}catch{}throw new F}reset(){for(let e of this.readers)e.reset()}}class yt extends Ze{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(e,t){for(let n=0;nr&&(r=t[i],n=i);e[n]++}static decrement(e,t){let n=0,r=t[0];for(let i=1;i=yt.MIN_FINDER_PATTERN_RATIO&&r<=yt.MAX_FINDER_PATTERN_RATIO){let i=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(let l of e)l>s&&(s=l),l=l-c-1&&(g-=rn.combins(r-u-(l-c),l-c-2)),l-c-1>1){let w=0;for(let E=r-u-(l-c-2);E>t;E--)w+=rn.combins(r-u-E-1,l-c-3);g-=w*(l-1-c)}else r-u>t&&g--;i+=g}r-=u}return i}static combins(e,t){let n,r;e-t>t?(r=t,n=e-t):(r=e-t,n=t);let i=1,s=1;for(let l=e;l>n;l--)i*=l,s<=r&&(i/=s,s++);for(;s<=r;)i/=s,s++;return i}}class ka{static buildBitArray(e){let t=e.length*2-1;e[e.length-1].getRightChar()==null&&(t-=1);let n=12*t,r=new Ee(n),i=0,l=e[0].getRightChar().getValue();for(let c=11;c>=0;--c)(l&1<=0;--w)(g&1<=0;--E)(w&1<10||n<0||n>10)throw new G;this.firstDigit=t,this.secondDigit=n}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return this.firstDigit*10+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===Vt.FNC1}isSecondDigitFNC1(){return this.secondDigit===Vt.FNC1}isAnyFNC1(){return this.firstDigit===Vt.FNC1||this.secondDigit===Vt.FNC1}}Vt.FNC1=10;class ee{constructor(){}static parseFieldsInGeneralPurpose(e){if(!e)return null;if(e.length<2)throw new F;let t=e.substring(0,2);for(let i of ee.TWO_DIGIT_DATA_LENGTH)if(i[0]===t)return i[1]===ee.VARIABLE_LENGTH?ee.processVariableAI(2,i[2],e):ee.processFixedAI(2,i[1],e);if(e.length<3)throw new F;let n=e.substring(0,3);for(let i of ee.THREE_DIGIT_DATA_LENGTH)if(i[0]===n)return i[1]===ee.VARIABLE_LENGTH?ee.processVariableAI(3,i[2],e):ee.processFixedAI(3,i[1],e);for(let i of ee.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(i[0]===n)return i[1]===ee.VARIABLE_LENGTH?ee.processVariableAI(4,i[2],e):ee.processFixedAI(4,i[1],e);if(e.length<4)throw new F;let r=e.substring(0,4);for(let i of ee.FOUR_DIGIT_DATA_LENGTH)if(i[0]===r)return i[1]===ee.VARIABLE_LENGTH?ee.processVariableAI(4,i[2],e):ee.processFixedAI(4,i[1],e);throw new F}static processFixedAI(e,t,n){if(n.lengththis.information.getSize())return e+4<=this.information.getSize();for(let t=e;tthis.information.getSize()){let i=this.extractNumericValueFromBitArray(e,4);return i===0?new Vt(this.information.getSize(),Vt.FNC1,Vt.FNC1):new Vt(this.information.getSize(),i-1,Vt.FNC1)}let t=this.extractNumericValueFromBitArray(e,7),n=(t-8)/11,r=(t-8)%11;return new Vt(e+7,n,r)}extractNumericValueFromBitArray(e,t){return tr.extractNumericValueFromBitArray(this.information,e,t)}static extractNumericValueFromBitArray(e,t,n){let r=0;for(let i=0;ithis.information.getSize())return!1;let t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+7>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<116)return!0;if(e+8>this.information.getSize())return!1;let r=this.extractNumericValueFromBitArray(e,8);return r>=232&&r<253}decodeIsoIec646(e){let t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new Rt(e+5,Rt.FNC1);if(t>=5&&t<15)return new Rt(e+5,"0"+(t-5));let n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<90)return new Rt(e+7,""+(n+1));if(n>=90&&n<116)return new Rt(e+7,""+(n+7));let r=this.extractNumericValueFromBitArray(e,8),i;switch(r){case 232:i="!";break;case 233:i='"';break;case 234:i="%";break;case 235:i="&";break;case 236:i="'";break;case 237:i="(";break;case 238:i=")";break;case 239:i="*";break;case 240:i="+";break;case 241:i=",";break;case 242:i="-";break;case 243:i=".";break;case 244:i="/";break;case 245:i=":";break;case 246:i=";";break;case 247:i="<";break;case 248:i="=";break;case 249:i=">";break;case 250:i="?";break;case 251:i="_";break;case 252:i=" ";break;default:throw new G}return new Rt(e+8,i)}isStillAlpha(e){if(e+5>this.information.getSize())return!1;let t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+6>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(e,6);return n>=16&&n<63}decodeAlphanumeric(e){let t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new Rt(e+5,Rt.FNC1);if(t>=5&&t<15)return new Rt(e+5,"0"+(t-5));let n=this.extractNumericValueFromBitArray(e,6);if(n>=32&&n<58)return new Rt(e+6,""+(n+33));let r;switch(n){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new _("Decoding invalid alphanumeric value: "+n)}return new Rt(e+6,r)}isAlphaTo646ToAlphaLatch(e){if(e+1>this.information.getSize())return!1;for(let t=0;t<5&&t+ethis.information.getSize())return!1;for(let t=e;tthis.information.getSize())return!1;for(let t=0;t<4&&t+e{t.forEach(s=>{r.getLeftChar().getValue()===s.getLeftChar().getValue()&&r.getRightChar().getValue()===s.getRightChar().getValue()&&r.getFinderPatter().getValue()===s.getFinderPatter().getValue()&&(n=!0)})}),n}}class z extends yt{constructor(e){super(...arguments),this.pairs=new Array(z.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=e===!0}decodeRow(e,t,n){this.pairs.length=0,this.startFromEven=!1;try{return z.constructResult(this.decodeRow2pairs(e,t))}catch(r){this.verbose&&console.log(r)}return this.pairs.length=0,this.startFromEven=!0,z.constructResult(this.decodeRow2pairs(e,t))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(e,t){let n=!1;for(;!n;)try{this.pairs.push(this.retrieveNextPair(t,this.pairs,e))}catch(i){if(i instanceof F){if(!this.pairs.length)throw new F;n=!0}}if(this.checkChecksum())return this.pairs;let r;if(this.rows.length?r=!0:r=!1,this.storeRow(e,!1),r){let i=this.checkRowsBoolean(!1);if(i!=null||(i=this.checkRowsBoolean(!0),i!=null))return i}throw new F}checkRowsBoolean(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&(this.rows=this.rows.reverse());let t=null;try{t=this.checkRows(new Array,0)}catch(n){this.verbose&&console.log(n)}return e&&(this.rows=this.rows.reverse()),t}checkRows(e,t){for(let n=t;nt.length)continue;let n=!0;for(let r=0;re){i=s.isEquivalent(this.pairs);break}r=s.isEquivalent(this.pairs),n++}i||r||z.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new Ii(this.pairs,e,t)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(e,t){for(let n of t)if(n.getPairs().length!==e.length){for(let r of n.getPairs())for(let i of e)if(Tn.equals(r,i))break}}static isPartialRow(e,t){for(let n of t){let r=!0;for(let i of e){let s=!1;for(let l of n.getPairs())if(i.equals(l)){s=!0;break}if(!s){r=!1;break}}if(r)return!0}return!1}getRows(){return this.rows}static constructResult(e){let t=ka.buildBitArray(e),r=ja(t).parseInformation(),i=e[0].getFinderPattern().getResultPoints(),s=e[e.length-1].getFinderPattern().getResultPoints(),l=[i[0],i[1],s[0],s[1]];return new rt(r,null,null,l,de.RSS_EXPANDED,null)}checkChecksum(){let e=this.pairs.get(0),t=e.getLeftChar(),n=e.getRightChar();if(n==null)return!1;let r=n.getChecksumPortion(),i=2;for(let l=1;l=0?s=n:this.isEmptyPair(t)?s=0:s=t[t.length-1].getFinderPattern().getStartEnd()[1];let l=t.length%2!=0;this.startFromEven&&(l=!l);let c=!1;for(;s=0&&!e.get(u);)u--;u++,r=this.startEnd[0]-u,i=u,s=this.startEnd[1]}else i=this.startEnd[0],s=e.getNextUnset(this.startEnd[1]+1),r=s-this.startEnd[1];let l=this.getDecodeFinderCounters();K.arraycopy(l,0,l,1,l.length-1),l[0]=r;let c;try{c=this.parseFinderValue(l,z.FINDER_PATTERNS)}catch{return null}return new Vr(c,[i,s],i,s,t)}decodeDataCharacter(e,t,n,r){let i=this.getDataCharacterCounters();for(let Qe=0;Qe.3)throw new F;let u=this.getOddCounts(),g=this.getEvenCounts(),w=this.getOddRoundingErrors(),E=this.getEvenRoundingErrors();for(let Qe=0;Qe8){if(Ct>8.7)throw new F;Ut=8}let ar=Qe/2;(Qe&1)==0?(u[ar]=Ut,w[ar]=Ct-Ut):(g[ar]=Ut,E[ar]=Ct-Ut)}this.adjustOddEvenCounts(s);let I=4*t.getValue()+(n?0:2)+(r?0:1)-1,y=0,N=0;for(let Qe=u.length-1;Qe>=0;Qe--){if(z.isNotA1left(t,n,r)){let Ct=z.WEIGHTS[I][2*Qe];N+=u[Qe]*Ct}y+=u[Qe]}let O=0;for(let Qe=g.length-1;Qe>=0;Qe--)if(z.isNotA1left(t,n,r)){let Ct=z.WEIGHTS[I][2*Qe+1];O+=g[Qe]*Ct}let B=N+O;if((y&1)!=0||y>13||y<4)throw new F;let X=(13-y)/2,Z=z.SYMBOL_WIDEST[X],W=9-Z,Me=rn.getRSSvalue(u,Z,!0),Ce=rn.getRSSvalue(g,W,!1),vt=z.EVEN_TOTAL_SUBSET[X],qt=z.GSUM[X],Pt=Me*vt+Ce+qt;return new er(Pt,B)}static isNotA1left(e,t,n){return!(e.getValue()==0&&t&&n)}adjustOddEvenCounts(e){let t=H.sum(new Int32Array(this.getOddCounts())),n=H.sum(new Int32Array(this.getEvenCounts())),r=!1,i=!1;t>13?i=!0:t<4&&(r=!0);let s=!1,l=!1;n>13?l=!0:n<4&&(s=!0);let c=t+n-e,u=(t&1)==1,g=(n&1)==0;if(c==1)if(u){if(g)throw new F;i=!0}else{if(!g)throw new F;l=!0}else if(c==-1)if(u){if(g)throw new F;r=!0}else{if(!g)throw new F;s=!0}else if(c==0){if(u){if(!g)throw new F;t1){for(let l of this.possibleRightPairs)if(l.getCount()>1&&at.checkChecksum(s,l))return at.constructResult(s,l)}throw new F}static addOrTally(e,t){if(t==null)return;let n=!1;for(let r of e)if(r.getValue()===t.getValue()){r.incrementCount(),n=!0;break}n||e.push(t)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(e,t){let n=4537077*e.getValue()+t.getValue(),r=new String(n).toString(),i=new Ie;for(let u=13-r.length;u>0;u--)i.append("0");i.append(r);let s=0;for(let u=0;u<13;u++){let g=i.charAt(u).charCodeAt(0)-"0".charCodeAt(0);s+=(u&1)===0?3*g:g}s=10-s%10,s===10&&(s=0),i.append(s.toString());let l=e.getFinderPattern().getResultPoints(),c=t.getFinderPattern().getResultPoints();return new rt(i.toString(),null,0,[l[0],l[1],c[0],c[1]],de.RSS_14,new Date().getTime())}static checkChecksum(e,t){let n=(e.getChecksumPortion()+16*t.getChecksumPortion())%79,r=9*e.getFinderPattern().getValue()+t.getFinderPattern().getValue();return r>72&&r--,r>8&&r--,n===r}decodePair(e,t,n,r){try{let i=this.findFinderPattern(e,t),s=this.parseFoundFinderPattern(e,n,t,i),l=r==null?null:r.get(me.NEED_RESULT_POINT_CALLBACK);if(l!=null){let g=(i[0]+i[1])/2;t&&(g=e.getSize()-1-g),l.foundPossibleResultPoint(new R(g,n))}let c=this.decodeDataCharacter(e,s,!0),u=this.decodeDataCharacter(e,s,!1);return new Va(1597*c.getValue()+u.getValue(),c.getChecksumPortion()+4*u.getChecksumPortion(),s)}catch{return null}}decodeDataCharacter(e,t,n){let r=this.getDataCharacterCounters();for(let O=0;O8&&(X=8);let Z=Math.floor(O/2);(O&1)===0?(l[Z]=X,u[Z]=B-X):(c[Z]=X,g[Z]=B-X)}this.adjustOddEvenCounts(n,i);let w=0,E=0;for(let O=l.length-1;O>=0;O--)E*=9,E+=l[O],w+=l[O];let I=0,y=0;for(let O=c.length-1;O>=0;O--)I*=9,I+=c[O],y+=c[O];let N=E+3*I;if(n){if((w&1)!==0||w>12||w<4)throw new F;let O=(12-w)/2,B=at.OUTSIDE_ODD_WIDEST[O],X=9-B,Z=rn.getRSSvalue(l,B,!1),W=rn.getRSSvalue(c,X,!0),Me=at.OUTSIDE_EVEN_TOTAL_SUBSET[O],Ce=at.OUTSIDE_GSUM[O];return new er(Z*Me+W+Ce,N)}else{if((y&1)!==0||y>10||y<4)throw new F;let O=(10-y)/2,B=at.INSIDE_ODD_WIDEST[O],X=9-B,Z=rn.getRSSvalue(l,B,!0),W=rn.getRSSvalue(c,X,!1),Me=at.INSIDE_ODD_TOTAL_SUBSET[O],Ce=at.INSIDE_GSUM[O];return new er(W*Me+Z+Ce,N)}}findFinderPattern(e,t){let n=this.getDecodeFinderCounters();n[0]=0,n[1]=0,n[2]=0,n[3]=0;let r=e.getSize(),i=!1,s=0;for(;s=0&&i!==e.get(s);)s--;s++;const l=r[0]-s,c=this.getDecodeFinderCounters(),u=new Int32Array(c.length);K.arraycopy(c,0,u,1,c.length-1),u[0]=l;const g=this.parseFinderValue(u,at.FINDER_PATTERNS);let w=s,E=r[1];return n&&(w=e.getSize()-1-w,E=e.getSize()-1-E),new Vr(g,[s,r[1]],w,E,t)}adjustOddEvenCounts(e,t){let n=H.sum(new Int32Array(this.getOddCounts())),r=H.sum(new Int32Array(this.getEvenCounts())),i=!1,s=!1,l=!1,c=!1;e?(n>12?s=!0:n<4&&(i=!0),r>12?c=!0:r<4&&(l=!0)):(n>11?s=!0:n<5&&(i=!0),r>10?c=!0:r<4&&(l=!0));let u=n+r-t,g=(n&1)===(e?1:0),w=(r&1)===1;if(u===1)if(g){if(w)throw new F;s=!0}else{if(!w)throw new F;c=!0}else if(u===-1)if(g){if(w)throw new F;i=!0}else{if(!w)throw new F;l=!0}else if(u===0){if(g){if(!w)throw new F;ne.reset())}}class za extends Dt{constructor(e=500,t){super(new rr(t),e,t)}}class Ve{constructor(e,t,n){this.ecCodewords=e,this.ecBlocks=[t],n&&this.ecBlocks.push(n)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class Fe{constructor(e,t){this.count=e,this.dataCodewords=t}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class De{constructor(e,t,n,r,i,s){this.versionNumber=e,this.symbolSizeRows=t,this.symbolSizeColumns=n,this.dataRegionSizeRows=r,this.dataRegionSizeColumns=i,this.ecBlocks=s;let l=0;const c=s.getECCodewords(),u=s.getECBlocks();for(let g of u)l+=g.getCount()*(g.getDataCodewords()+c);this.totalCodewords=l}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(e,t){if((e&1)!==0||(t&1)!==0)throw new G;for(let n of De.VERSIONS)if(n.symbolSizeRows===e&&n.symbolSizeColumns===t)return n;throw new G}toString(){return""+this.versionNumber}static buildVersions(){return[new De(1,10,10,8,8,new Ve(5,new Fe(1,3))),new De(2,12,12,10,10,new Ve(7,new Fe(1,5))),new De(3,14,14,12,12,new Ve(10,new Fe(1,8))),new De(4,16,16,14,14,new Ve(12,new Fe(1,12))),new De(5,18,18,16,16,new Ve(14,new Fe(1,18))),new De(6,20,20,18,18,new Ve(18,new Fe(1,22))),new De(7,22,22,20,20,new Ve(20,new Fe(1,30))),new De(8,24,24,22,22,new Ve(24,new Fe(1,36))),new De(9,26,26,24,24,new Ve(28,new Fe(1,44))),new De(10,32,32,14,14,new Ve(36,new Fe(1,62))),new De(11,36,36,16,16,new Ve(42,new Fe(1,86))),new De(12,40,40,18,18,new Ve(48,new Fe(1,114))),new De(13,44,44,20,20,new Ve(56,new Fe(1,144))),new De(14,48,48,22,22,new Ve(68,new Fe(1,174))),new De(15,52,52,24,24,new Ve(42,new Fe(2,102))),new De(16,64,64,14,14,new Ve(56,new Fe(2,140))),new De(17,72,72,16,16,new Ve(36,new Fe(4,92))),new De(18,80,80,18,18,new Ve(48,new Fe(4,114))),new De(19,88,88,20,20,new Ve(56,new Fe(4,144))),new De(20,96,96,22,22,new Ve(68,new Fe(4,174))),new De(21,104,104,24,24,new Ve(56,new Fe(6,136))),new De(22,120,120,18,18,new Ve(68,new Fe(6,175))),new De(23,132,132,20,20,new Ve(62,new Fe(8,163))),new De(24,144,144,22,22,new Ve(62,new Fe(8,156),new Fe(2,155))),new De(25,8,18,6,16,new Ve(7,new Fe(1,5))),new De(26,8,32,6,14,new Ve(11,new Fe(1,10))),new De(27,12,26,10,24,new Ve(14,new Fe(1,16))),new De(28,12,36,10,16,new Ve(18,new Fe(1,22))),new De(29,16,36,14,16,new Ve(24,new Fe(1,32))),new De(30,16,48,14,22,new Ve(28,new Fe(1,49)))]}}De.VERSIONS=De.buildVersions();class Ti{constructor(e){const t=e.getHeight();if(t<8||t>144||(t&1)!==0)throw new G;this.version=Ti.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new et(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(e){const t=e.getHeight(),n=e.getWidth();return De.getVersionForDimensions(t,n)}readCodewords(){const e=new Int8Array(this.version.getTotalCodewords());let t=0,n=4,r=0;const i=this.mappingBitMatrix.getHeight(),s=this.mappingBitMatrix.getWidth();let l=!1,c=!1,u=!1,g=!1;do if(n===i&&r===0&&!l)e[t++]=this.readCorner1(i,s)&255,n-=2,r+=2,l=!0;else if(n===i-2&&r===0&&(s&3)!==0&&!c)e[t++]=this.readCorner2(i,s)&255,n-=2,r+=2,c=!0;else if(n===i+4&&r===2&&(s&7)===0&&!u)e[t++]=this.readCorner3(i,s)&255,n-=2,r+=2,u=!0;else if(n===i-2&&r===0&&(s&7)===4&&!g)e[t++]=this.readCorner4(i,s)&255,n-=2,r+=2,g=!0;else{do n=0&&!this.readMappingMatrix.get(r,n)&&(e[t++]=this.readUtah(n,r,i,s)&255),n-=2,r+=2;while(n>=0&&r=0&&r=0);n+=3,r+=1}while(n7?N-1:N;s[B].codewords[X]=e[w++]}if(w!==e.length)throw new M;return s}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class bi{constructor(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(e){if(e<1||e>32||e>this.available())throw new M(""+e);let t=0,n=this.bitOffset,r=this.byteOffset;const i=this.bytes;if(n>0){const s=8-n,l=e>8-l<>c,e-=l,n+=l,n===8&&(n=0,r++)}if(e>0){for(;e>=8;)t=t<<8|i[r]&255,r++,e-=8;if(e>0){const s=8-e,l=255>>s<>s,n+=e}}return this.bitOffset=n,this.byteOffset=r,t}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var dt;(function(A){A[A.PAD_ENCODE=0]="PAD_ENCODE",A[A.ASCII_ENCODE=1]="ASCII_ENCODE",A[A.C40_ENCODE=2]="C40_ENCODE",A[A.TEXT_ENCODE=3]="TEXT_ENCODE",A[A.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",A[A.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",A[A.BASE256_ENCODE=6]="BASE256_ENCODE"})(dt||(dt={}));class Sn{static decode(e){const t=new bi(e),n=new Ie,r=new Ie,i=new Array;let s=dt.ASCII_ENCODE;do if(s===dt.ASCII_ENCODE)s=this.decodeAsciiSegment(t,n,r);else{switch(s){case dt.C40_ENCODE:this.decodeC40Segment(t,n);break;case dt.TEXT_ENCODE:this.decodeTextSegment(t,n);break;case dt.ANSIX12_ENCODE:this.decodeAnsiX12Segment(t,n);break;case dt.EDIFACT_ENCODE:this.decodeEdifactSegment(t,n);break;case dt.BASE256_ENCODE:this.decodeBase256Segment(t,n,i);break;default:throw new G}s=dt.ASCII_ENCODE}while(s!==dt.PAD_ENCODE&&t.available()>0);return r.length()>0&&n.append(r.toString()),new nn(e,n.toString(),i.length===0?null:i,null)}static decodeAsciiSegment(e,t,n){let r=!1;do{let i=e.readBits(8);if(i===0)throw new G;if(i<=128)return r&&(i+=128),t.append(String.fromCharCode(i-1)),dt.ASCII_ENCODE;if(i===129)return dt.PAD_ENCODE;if(i<=229){const s=i-130;s<10&&t.append("0"),t.append(""+s)}else switch(i){case 230:return dt.C40_ENCODE;case 231:return dt.BASE256_ENCODE;case 232:t.append(String.fromCharCode(29));break;case 233:case 234:break;case 235:r=!0;break;case 236:t.append("[)>05"),n.insert(0,"");break;case 237:t.append("[)>06"),n.insert(0,"");break;case 238:return dt.ANSIX12_ENCODE;case 239:return dt.TEXT_ENCODE;case 240:return dt.EDIFACT_ENCODE;case 241:break;default:if(i!==254||e.available()!==0)throw new G;break}}while(e.available()>0);return dt.ASCII_ENCODE}static decodeC40Segment(e,t){let n=!1;const r=[];let i=0;do{if(e.available()===8)return;const s=e.readBits(8);if(s===254)return;this.parseTwoBytes(s,e.readBits(8),r);for(let l=0;l<3;l++){const c=r[l];switch(i){case 0:if(c<3)i=c+1;else if(c0)}static decodeTextSegment(e,t){let n=!1,r=[],i=0;do{if(e.available()===8)return;const s=e.readBits(8);if(s===254)return;this.parseTwoBytes(s,e.readBits(8),r);for(let l=0;l<3;l++){const c=r[l];switch(i){case 0:if(c<3)i=c+1;else if(c0)}static decodeAnsiX12Segment(e,t){const n=[];do{if(e.available()===8)return;const r=e.readBits(8);if(r===254)return;this.parseTwoBytes(r,e.readBits(8),n);for(let i=0;i<3;i++){const s=n[i];switch(s){case 0:t.append("\r");break;case 1:t.append("*");break;case 2:t.append(">");break;case 3:t.append(" ");break;default:if(s<14)t.append(String.fromCharCode(s+44));else if(s<40)t.append(String.fromCharCode(s+51));else throw new G;break}}}while(e.available()>0)}static parseTwoBytes(e,t,n){let r=(e<<8)+t-1,i=Math.floor(r/1600);n[0]=i,r-=i*1600,i=Math.floor(r/40),n[1]=i,n[2]=r-i*40}static decodeEdifactSegment(e,t){do{if(e.available()<=16)return;for(let n=0;n<4;n++){let r=e.readBits(6);if(r===31){const i=8-e.getBitOffset();i!==8&&e.readBits(i);return}(r&32)===0&&(r|=64),t.append(String.fromCharCode(r))}}while(e.available()>0)}static decodeBase256Segment(e,t,n){let r=1+e.getByteOffset();const i=this.unrandomize255State(e.readBits(8),r++);let s;if(i===0?s=e.available()/8|0:i<250?s=i:s=250*(i-249)+this.unrandomize255State(e.readBits(8),r++),s<0)throw new G;const l=new Uint8Array(s);for(let c=0;c=0?r:r+256}}Sn.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Sn.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],Sn.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],Sn.TEXT_SHIFT2_SET_CHARS=Sn.C40_SHIFT2_SET_CHARS,Sn.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)];class Wa{constructor(){this.rsDecoder=new v(Oe.DATA_MATRIX_FIELD_256)}decode(e){const t=new Ti(e),n=t.getVersion(),r=t.readCodewords(),i=Si.getDataBlocks(r,n);let s=0;for(let u of i)s+=u.getNumDataCodewords();const l=new Uint8Array(s),c=i.length;for(let u=0;ul&&(g=l,w[0]=t,w[1]=n,w[2]=r,w[3]=i),g>c&&(g=c,w[0]=n,w[1]=r,w[2]=i,w[3]=t),g>u&&(w[0]=r,w[1]=i,w[2]=t,w[3]=n),w}detectSolid2(e){let t=e[0],n=e[1],r=e[2],i=e[3],s=this.transitionsBetween(t,i),l=ht.shiftPoint(n,r,(s+1)*4),c=ht.shiftPoint(r,n,(s+1)*4),u=this.transitionsBetween(l,t),g=this.transitionsBetween(c,i);return uI?g:w}shiftToModuleCenter(e){let t=e[0],n=e[1],r=e[2],i=e[3],s=this.transitionsBetween(t,i)+1,l=this.transitionsBetween(r,i)+1,c=ht.shiftPoint(t,n,l*4),u=ht.shiftPoint(r,n,s*4);s=this.transitionsBetween(c,i)+1,l=this.transitionsBetween(u,i)+1,(s&1)===1&&(s+=1),(l&1)===1&&(l+=1);let g=(t.getX()+n.getX()+r.getX()+i.getX())/4,w=(t.getY()+n.getY()+r.getY()+i.getY())/4;t=ht.moveAway(t,g,w),n=ht.moveAway(n,g,w),r=ht.moveAway(r,g,w),i=ht.moveAway(i,g,w);let E,I;return c=ht.shiftPoint(t,n,l*4),c=ht.shiftPoint(c,i,s*4),E=ht.shiftPoint(n,t,l*4),E=ht.shiftPoint(E,r,s*4),u=ht.shiftPoint(r,i,l*4),u=ht.shiftPoint(u,n,s*4),I=ht.shiftPoint(i,r,l*4),I=ht.shiftPoint(I,t,s*4),[c,E,u,I]}isValid(e){return e.getX()>=0&&e.getX()0&&e.getY()Math.abs(i-n);if(l){let N=n;n=r,r=N,N=i,i=s,s=N}let c=Math.abs(i-n),u=Math.abs(s-r),g=-c/2,w=r0){if(O===s)break;O+=w,g-=c}}return I}}class bn{constructor(){this.decoder=new Wa}decode(e,t=null){let n,r;if(t!=null&&t.has(me.PURE_BARCODE)){const u=bn.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(u),r=bn.NO_POINTS}else{const u=new ht(e.getBlackMatrix()).detect();n=this.decoder.decode(u.getBits()),r=u.getPoints()}const i=n.getRawBytes(),s=new rt(n.getText(),i,8*i.length,r,de.DATA_MATRIX,K.currentTimeMillis()),l=n.getByteSegments();l!=null&&s.putMetadata(Ye.BYTE_SEGMENTS,l);const c=n.getECLevel();return c!=null&&s.putMetadata(Ye.ERROR_CORRECTION_LEVEL,c),s}reset(){}static extractPureBits(e){const t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(t==null||n==null)throw new F;const r=this.moduleSize(t,e);let i=t[1];const s=n[1];let l=t[0];const u=(n[0]-l+1)/r,g=(s-i+1)/r;if(u<=0||g<=0)throw new F;const w=r/2;i+=w,l+=w;const E=new et(u,g);for(let I=0;I=qe.FOR_BITS.size)throw new M;return qe.FOR_BITS.get(e)}}qe.FOR_BITS=new Map,qe.FOR_VALUE=new Map,qe.L=new qe(ir.L,"L",1),qe.M=new qe(ir.M,"M",0),qe.Q=new qe(ir.Q,"Q",3),qe.H=new qe(ir.H,"H",2);class Nt{constructor(e){this.errorCorrectionLevel=qe.forBits(e>>3&3),this.dataMask=e&7}static numBitsDiffering(e,t){return se.bitCount(e^t)}static decodeFormatInformation(e,t){const n=Nt.doDecodeFormatInformation(e,t);return n!==null?n:Nt.doDecodeFormatInformation(e^Nt.FORMAT_INFO_MASK_QR,t^Nt.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(e,t){let n=Number.MAX_SAFE_INTEGER,r=0;for(const i of Nt.FORMAT_INFO_DECODE_LOOKUP){const s=i[0];if(s===e||s===t)return new Nt(i[1]);let l=Nt.numBitsDiffering(e,s);l40)throw new M;return ce.VERSIONS[e-1]}static decodeVersionInformation(e){let t=Number.MAX_SAFE_INTEGER,n=0;for(let r=0;r6&&(t.setRegion(e-11,0,3,6),t.setRegion(0,e-11,6,3)),t}toString(){return""+this.versionNumber}}ce.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),ce.VERSIONS=[new ce(1,new Int32Array(0),new D(7,new C(1,19)),new D(10,new C(1,16)),new D(13,new C(1,13)),new D(17,new C(1,9))),new ce(2,Int32Array.from([6,18]),new D(10,new C(1,34)),new D(16,new C(1,28)),new D(22,new C(1,22)),new D(28,new C(1,16))),new ce(3,Int32Array.from([6,22]),new D(15,new C(1,55)),new D(26,new C(1,44)),new D(18,new C(2,17)),new D(22,new C(2,13))),new ce(4,Int32Array.from([6,26]),new D(20,new C(1,80)),new D(18,new C(2,32)),new D(26,new C(2,24)),new D(16,new C(4,9))),new ce(5,Int32Array.from([6,30]),new D(26,new C(1,108)),new D(24,new C(2,43)),new D(18,new C(2,15),new C(2,16)),new D(22,new C(2,11),new C(2,12))),new ce(6,Int32Array.from([6,34]),new D(18,new C(2,68)),new D(16,new C(4,27)),new D(24,new C(4,19)),new D(28,new C(4,15))),new ce(7,Int32Array.from([6,22,38]),new D(20,new C(2,78)),new D(18,new C(4,31)),new D(18,new C(2,14),new C(4,15)),new D(26,new C(4,13),new C(1,14))),new ce(8,Int32Array.from([6,24,42]),new D(24,new C(2,97)),new D(22,new C(2,38),new C(2,39)),new D(22,new C(4,18),new C(2,19)),new D(26,new C(4,14),new C(2,15))),new ce(9,Int32Array.from([6,26,46]),new D(30,new C(2,116)),new D(22,new C(3,36),new C(2,37)),new D(20,new C(4,16),new C(4,17)),new D(24,new C(4,12),new C(4,13))),new ce(10,Int32Array.from([6,28,50]),new D(18,new C(2,68),new C(2,69)),new D(26,new C(4,43),new C(1,44)),new D(24,new C(6,19),new C(2,20)),new D(28,new C(6,15),new C(2,16))),new ce(11,Int32Array.from([6,30,54]),new D(20,new C(4,81)),new D(30,new C(1,50),new C(4,51)),new D(28,new C(4,22),new C(4,23)),new D(24,new C(3,12),new C(8,13))),new ce(12,Int32Array.from([6,32,58]),new D(24,new C(2,92),new C(2,93)),new D(22,new C(6,36),new C(2,37)),new D(26,new C(4,20),new C(6,21)),new D(28,new C(7,14),new C(4,15))),new ce(13,Int32Array.from([6,34,62]),new D(26,new C(4,107)),new D(22,new C(8,37),new C(1,38)),new D(24,new C(8,20),new C(4,21)),new D(22,new C(12,11),new C(4,12))),new ce(14,Int32Array.from([6,26,46,66]),new D(30,new C(3,115),new C(1,116)),new D(24,new C(4,40),new C(5,41)),new D(20,new C(11,16),new C(5,17)),new D(24,new C(11,12),new C(5,13))),new ce(15,Int32Array.from([6,26,48,70]),new D(22,new C(5,87),new C(1,88)),new D(24,new C(5,41),new C(5,42)),new D(30,new C(5,24),new C(7,25)),new D(24,new C(11,12),new C(7,13))),new ce(16,Int32Array.from([6,26,50,74]),new D(24,new C(5,98),new C(1,99)),new D(28,new C(7,45),new C(3,46)),new D(24,new C(15,19),new C(2,20)),new D(30,new C(3,15),new C(13,16))),new ce(17,Int32Array.from([6,30,54,78]),new D(28,new C(1,107),new C(5,108)),new D(28,new C(10,46),new C(1,47)),new D(28,new C(1,22),new C(15,23)),new D(28,new C(2,14),new C(17,15))),new ce(18,Int32Array.from([6,30,56,82]),new D(30,new C(5,120),new C(1,121)),new D(26,new C(9,43),new C(4,44)),new D(28,new C(17,22),new C(1,23)),new D(28,new C(2,14),new C(19,15))),new ce(19,Int32Array.from([6,30,58,86]),new D(28,new C(3,113),new C(4,114)),new D(26,new C(3,44),new C(11,45)),new D(26,new C(17,21),new C(4,22)),new D(26,new C(9,13),new C(16,14))),new ce(20,Int32Array.from([6,34,62,90]),new D(28,new C(3,107),new C(5,108)),new D(26,new C(3,41),new C(13,42)),new D(30,new C(15,24),new C(5,25)),new D(28,new C(15,15),new C(10,16))),new ce(21,Int32Array.from([6,28,50,72,94]),new D(28,new C(4,116),new C(4,117)),new D(26,new C(17,42)),new D(28,new C(17,22),new C(6,23)),new D(30,new C(19,16),new C(6,17))),new ce(22,Int32Array.from([6,26,50,74,98]),new D(28,new C(2,111),new C(7,112)),new D(28,new C(17,46)),new D(30,new C(7,24),new C(16,25)),new D(24,new C(34,13))),new ce(23,Int32Array.from([6,30,54,78,102]),new D(30,new C(4,121),new C(5,122)),new D(28,new C(4,47),new C(14,48)),new D(30,new C(11,24),new C(14,25)),new D(30,new C(16,15),new C(14,16))),new ce(24,Int32Array.from([6,28,54,80,106]),new D(30,new C(6,117),new C(4,118)),new D(28,new C(6,45),new C(14,46)),new D(30,new C(11,24),new C(16,25)),new D(30,new C(30,16),new C(2,17))),new ce(25,Int32Array.from([6,32,58,84,110]),new D(26,new C(8,106),new C(4,107)),new D(28,new C(8,47),new C(13,48)),new D(30,new C(7,24),new C(22,25)),new D(30,new C(22,15),new C(13,16))),new ce(26,Int32Array.from([6,30,58,86,114]),new D(28,new C(10,114),new C(2,115)),new D(28,new C(19,46),new C(4,47)),new D(28,new C(28,22),new C(6,23)),new D(30,new C(33,16),new C(4,17))),new ce(27,Int32Array.from([6,34,62,90,118]),new D(30,new C(8,122),new C(4,123)),new D(28,new C(22,45),new C(3,46)),new D(30,new C(8,23),new C(26,24)),new D(30,new C(12,15),new C(28,16))),new ce(28,Int32Array.from([6,26,50,74,98,122]),new D(30,new C(3,117),new C(10,118)),new D(28,new C(3,45),new C(23,46)),new D(30,new C(4,24),new C(31,25)),new D(30,new C(11,15),new C(31,16))),new ce(29,Int32Array.from([6,30,54,78,102,126]),new D(30,new C(7,116),new C(7,117)),new D(28,new C(21,45),new C(7,46)),new D(30,new C(1,23),new C(37,24)),new D(30,new C(19,15),new C(26,16))),new ce(30,Int32Array.from([6,26,52,78,104,130]),new D(30,new C(5,115),new C(10,116)),new D(28,new C(19,47),new C(10,48)),new D(30,new C(15,24),new C(25,25)),new D(30,new C(23,15),new C(25,16))),new ce(31,Int32Array.from([6,30,56,82,108,134]),new D(30,new C(13,115),new C(3,116)),new D(28,new C(2,46),new C(29,47)),new D(30,new C(42,24),new C(1,25)),new D(30,new C(23,15),new C(28,16))),new ce(32,Int32Array.from([6,34,60,86,112,138]),new D(30,new C(17,115)),new D(28,new C(10,46),new C(23,47)),new D(30,new C(10,24),new C(35,25)),new D(30,new C(19,15),new C(35,16))),new ce(33,Int32Array.from([6,30,58,86,114,142]),new D(30,new C(17,115),new C(1,116)),new D(28,new C(14,46),new C(21,47)),new D(30,new C(29,24),new C(19,25)),new D(30,new C(11,15),new C(46,16))),new ce(34,Int32Array.from([6,34,62,90,118,146]),new D(30,new C(13,115),new C(6,116)),new D(28,new C(14,46),new C(23,47)),new D(30,new C(44,24),new C(7,25)),new D(30,new C(59,16),new C(1,17))),new ce(35,Int32Array.from([6,30,54,78,102,126,150]),new D(30,new C(12,121),new C(7,122)),new D(28,new C(12,47),new C(26,48)),new D(30,new C(39,24),new C(14,25)),new D(30,new C(22,15),new C(41,16))),new ce(36,Int32Array.from([6,24,50,76,102,128,154]),new D(30,new C(6,121),new C(14,122)),new D(28,new C(6,47),new C(34,48)),new D(30,new C(46,24),new C(10,25)),new D(30,new C(2,15),new C(64,16))),new ce(37,Int32Array.from([6,28,54,80,106,132,158]),new D(30,new C(17,122),new C(4,123)),new D(28,new C(29,46),new C(14,47)),new D(30,new C(49,24),new C(10,25)),new D(30,new C(24,15),new C(46,16))),new ce(38,Int32Array.from([6,32,58,84,110,136,162]),new D(30,new C(4,122),new C(18,123)),new D(28,new C(13,46),new C(32,47)),new D(30,new C(48,24),new C(14,25)),new D(30,new C(42,15),new C(32,16))),new ce(39,Int32Array.from([6,26,54,82,110,138,166]),new D(30,new C(20,117),new C(4,118)),new D(28,new C(40,47),new C(7,48)),new D(30,new C(43,24),new C(22,25)),new D(30,new C(10,15),new C(67,16))),new ce(40,Int32Array.from([6,30,58,86,114,142,170]),new D(30,new C(19,118),new C(6,119)),new D(28,new C(18,47),new C(31,48)),new D(30,new C(34,24),new C(34,25)),new D(30,new C(20,15),new C(61,16)))];var At;(function(A){A[A.DATA_MASK_000=0]="DATA_MASK_000",A[A.DATA_MASK_001=1]="DATA_MASK_001",A[A.DATA_MASK_010=2]="DATA_MASK_010",A[A.DATA_MASK_011=3]="DATA_MASK_011",A[A.DATA_MASK_100=4]="DATA_MASK_100",A[A.DATA_MASK_101=5]="DATA_MASK_101",A[A.DATA_MASK_110=6]="DATA_MASK_110",A[A.DATA_MASK_111=7]="DATA_MASK_111"})(At||(At={}));class zt{constructor(e,t){this.value=e,this.isMasked=t}unmaskBitMatrix(e,t){for(let n=0;n(A+e&1)===0)],[At.DATA_MASK_001,new zt(At.DATA_MASK_001,(A,e)=>(A&1)===0)],[At.DATA_MASK_010,new zt(At.DATA_MASK_010,(A,e)=>e%3===0)],[At.DATA_MASK_011,new zt(At.DATA_MASK_011,(A,e)=>(A+e)%3===0)],[At.DATA_MASK_100,new zt(At.DATA_MASK_100,(A,e)=>(Math.floor(A/2)+Math.floor(e/3)&1)===0)],[At.DATA_MASK_101,new zt(At.DATA_MASK_101,(A,e)=>A*e%6===0)],[At.DATA_MASK_110,new zt(At.DATA_MASK_110,(A,e)=>A*e%6<3)],[At.DATA_MASK_111,new zt(At.DATA_MASK_111,(A,e)=>(A+e+A*e%3&1)===0)]]);class Ga{constructor(e){const t=e.getHeight();if(t<21||(t&3)!==1)throw new G;this.bitMatrix=e}readFormatInformation(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;let e=0;for(let i=0;i<6;i++)e=this.copyBit(i,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(let i=5;i>=0;i--)e=this.copyBit(8,i,e);const t=this.bitMatrix.getHeight();let n=0;const r=t-7;for(let i=t-1;i>=r;i--)n=this.copyBit(8,i,n);for(let i=t-8;i=0;s--)for(let l=e-9;l>=r;l--)n=this.copyBit(l,s,n);let i=ce.decodeVersionInformation(n);if(i!==null&&i.getDimensionForVersion()===e)return this.parsedVersion=i,i;n=0;for(let s=5;s>=0;s--)for(let l=e-9;l>=r;l--)n=this.copyBit(s,l,n);if(i=ce.decodeVersionInformation(n),i!==null&&i.getDimensionForVersion()===e)return this.parsedVersion=i,i;throw new G}copyBit(e,t,n){return(this.isMirror?this.bitMatrix.get(t,e):this.bitMatrix.get(e,t))?n<<1|1:n<<1}readCodewords(){const e=this.readFormatInformation(),t=this.readVersion(),n=zt.values.get(e.getDataMask()),r=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,r);const i=t.buildFunctionPattern();let s=!0;const l=new Uint8Array(t.getTotalCodewords());let c=0,u=0,g=0;for(let w=r-1;w>0;w-=2){w===6&&w--;for(let E=0;E=0&&l[g].codewords.length!==u;)g--;g++;const w=u-r.getECCodewordsPerBlock();let E=0;for(let y=0;ye.available())throw new G;const r=new Uint8Array(2*n);let i=0;for(;n>0;){const s=e.readBits(13);let l=s/96<<8&4294967295|s%96;l<959?l+=41377:l+=42657,r[i]=l>>8&255,r[i+1]=l&255,i+=2,n--}try{t.append(ze.decode(r,le.GB2312))}catch(s){throw new G(s)}}static decodeKanjiSegment(e,t,n){if(n*13>e.available())throw new G;const r=new Uint8Array(2*n);let i=0;for(;n>0;){const s=e.readBits(13);let l=s/192<<8&4294967295|s%192;l<7936?l+=33088:l+=49472,r[i]=l>>8,r[i+1]=l,i+=2,n--}try{t.append(ze.decode(r,le.SHIFT_JIS))}catch(s){throw new G(s)}}static decodeByteSegment(e,t,n,r,i,s){if(8*n>e.available())throw new G;const l=new Uint8Array(n);for(let u=0;u=st.ALPHANUMERIC_CHARS.length)throw new G;return st.ALPHANUMERIC_CHARS[e]}static decodeAlphanumericSegment(e,t,n,r){const i=t.length();for(;n>1;){if(e.available()<11)throw new G;const s=e.readBits(11);t.append(st.toAlphaNumericChar(Math.floor(s/45))),t.append(st.toAlphaNumericChar(s%45)),n-=2}if(n===1){if(e.available()<6)throw new G;t.append(st.toAlphaNumericChar(e.readBits(6)))}if(r)for(let s=i;s=3;){if(e.available()<10)throw new G;const r=e.readBits(10);if(r>=1e3)throw new G;t.append(st.toAlphaNumericChar(Math.floor(r/100))),t.append(st.toAlphaNumericChar(Math.floor(r/10)%10)),t.append(st.toAlphaNumericChar(r%10)),n-=3}if(n===2){if(e.available()<7)throw new G;const r=e.readBits(7);if(r>=100)throw new G;t.append(st.toAlphaNumericChar(Math.floor(r/10))),t.append(st.toAlphaNumericChar(r%10))}else if(n===1){if(e.available()<4)throw new G;const r=e.readBits(4);if(r>=10)throw new G;t.append(st.toAlphaNumericChar(r))}}static parseECIValue(e){const t=e.readBits(8);if((t&128)===0)return t&127;if((t&192)===128){const n=e.readBits(8);return(t&63)<<8&4294967295|n}if((t&224)===192){const n=e.readBits(16);return(t&31)<<16&4294967295|n}throw new G}}st.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",st.GB2312_SUBSET=1;class vs{constructor(e){this.mirrored=e}isMirrored(){return this.mirrored}applyMirroredCorrection(e){if(!this.mirrored||e===null||e.length<3)return;const t=e[0];e[0]=e[2],e[2]=t}}class Xa{constructor(){this.rsDecoder=new v(Oe.QR_CODE_FIELD_256)}decodeBooleanArray(e,t){return this.decodeBitMatrix(et.parseFromBooleanArray(e),t)}decodeBitMatrix(e,t){const n=new Ga(e);let r=null;try{return this.decodeBitMatrixParser(n,t)}catch(i){r=i}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();const i=this.decodeBitMatrixParser(n,t);return i.setOther(new vs(!0)),i}catch(i){throw r!==null?r:i}}decodeBitMatrixParser(e,t){const n=e.readVersion(),r=e.readFormatInformation().getErrorCorrectionLevel(),i=e.readCodewords(),s=yi.getDataBlocks(i,n,r);let l=0;for(const g of s)l+=g.getNumDataCodewords();const c=new Uint8Array(l);let u=0;for(const g of s){const w=g.getCodewords(),E=g.getNumDataCodewords();this.correctErrors(w,E);for(let I=0;I=n)return!1;return!0}crossCheckVertical(e,t,n,r){const i=this.image,s=i.getHeight(),l=this.crossCheckStateCount;l[0]=0,l[1]=0,l[2]=0;let c=e;for(;c>=0&&i.get(t,c)&&l[1]<=n;)l[1]++,c--;if(c<0||l[1]>n)return NaN;for(;c>=0&&!i.get(t,c)&&l[0]<=n;)l[0]++,c--;if(l[0]>n)return NaN;for(c=e+1;cn)return NaN;for(;cn)return NaN;const u=l[0]+l[1]+l[2];return 5*Math.abs(u-r)>=2*r?NaN:this.foundPatternCross(l)?Yr.centerFromEnd(l,c):NaN}handlePossibleCenter(e,t,n){const r=e[0]+e[1]+e[2],i=Yr.centerFromEnd(e,n),s=this.crossCheckVertical(t,i,2*e[1],r);if(!isNaN(s)){const l=(e[0]+e[1]+e[2])/3;for(const u of this.possibleCenters)if(u.aboutEquals(l,s,i))return u.combineEstimate(s,i,l);const c=new Ni(i,s,l);this.possibleCenters.push(c),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(c)}return null}}class _i extends R{constructor(e,t,n,r){super(e,t),this.estimatedModuleSize=n,this.count=r,r===void 0&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(e,t,n){if(Math.abs(t-this.getY())<=e&&Math.abs(n-this.getX())<=e){const r=Math.abs(e-this.estimatedModuleSize);return r<=1||r<=this.estimatedModuleSize}return!1}combineEstimate(e,t,n){const r=this.count+1,i=(this.count*this.getX()+t)/r,s=(this.count*this.getY()+e)/r,l=(this.count*this.estimatedModuleSize+n)/r;return new _i(i,s,l,r)}}class Za{constructor(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class wt{constructor(e,t){this.image=e,this.resultPointCallback=t,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=t}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(e){const t=e!=null&&e.get(me.TRY_HARDER)!==void 0,n=e!=null&&e.get(me.PURE_BARCODE)!==void 0,r=this.image,i=r.getHeight(),s=r.getWidth();let l=Math.floor(3*i/(4*wt.MAX_MODULES));(lu[2]&&(w+=N-u[2]-l,I=s-1)}else{u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,E=3;continue}E=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,E=3;else u[++E]++;else u[E]++;wt.foundPatternCross(u)&&this.handlePossibleCenter(u,w,s,n)===!0&&(l=u[0],this.hasSkipped&&(c=this.haveMultiplyConfirmedCenters()))}const g=this.selectBestPatterns();return R.orderBestPatterns(g),new Za(g)}static centerFromEnd(e,t){return t-e[4]-e[3]-e[2]/2}static foundPatternCross(e){let t=0;for(let i=0;i<5;i++){const s=e[i];if(s===0)return!1;t+=s}if(t<7)return!1;const n=t/7,r=n/2;return Math.abs(n-e[0])=s&&t>=s&&l.get(t-s,e-s);)i[2]++,s++;if(e=s&&t>=s&&!l.get(t-s,e-s)&&i[1]<=n;)i[1]++,s++;if(en)return!1;for(;e>=s&&t>=s&&l.get(t-s,e-s)&&i[0]<=n;)i[0]++,s++;if(i[0]>n)return!1;const c=l.getHeight(),u=l.getWidth();for(s=1;e+s=c||t+s>=u)return!1;for(;e+s=c||t+s>=u||i[3]>=n)return!1;for(;e+s=n)return!1;const g=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(g-r)<2*r&&wt.foundPatternCross(i)}crossCheckVertical(e,t,n,r){const i=this.image,s=i.getHeight(),l=this.getCrossCheckStateCount();let c=e;for(;c>=0&&i.get(t,c);)l[2]++,c--;if(c<0)return NaN;for(;c>=0&&!i.get(t,c)&&l[1]<=n;)l[1]++,c--;if(c<0||l[1]>n)return NaN;for(;c>=0&&i.get(t,c)&&l[0]<=n;)l[0]++,c--;if(l[0]>n)return NaN;for(c=e+1;c=n)return NaN;for(;c=n)return NaN;const u=l[0]+l[1]+l[2]+l[3]+l[4];return 5*Math.abs(u-r)>=2*r?NaN:wt.foundPatternCross(l)?wt.centerFromEnd(l,c):NaN}crossCheckHorizontal(e,t,n,r){const i=this.image,s=i.getWidth(),l=this.getCrossCheckStateCount();let c=e;for(;c>=0&&i.get(c,t);)l[2]++,c--;if(c<0)return NaN;for(;c>=0&&!i.get(c,t)&&l[1]<=n;)l[1]++,c--;if(c<0||l[1]>n)return NaN;for(;c>=0&&i.get(c,t)&&l[0]<=n;)l[0]++,c--;if(l[0]>n)return NaN;for(c=e+1;c=n)return NaN;for(;c=n)return NaN;const u=l[0]+l[1]+l[2]+l[3]+l[4];return 5*Math.abs(u-r)>=r?NaN:wt.foundPatternCross(l)?wt.centerFromEnd(l,c):NaN}handlePossibleCenter(e,t,n,r){const i=e[0]+e[1]+e[2]+e[3]+e[4];let s=wt.centerFromEnd(e,n),l=this.crossCheckVertical(t,Math.floor(s),e[2],i);if(!isNaN(l)&&(s=this.crossCheckHorizontal(Math.floor(s),Math.floor(l),e[2],i),!isNaN(s)&&(!r||this.crossCheckDiagonal(Math.floor(l),Math.floor(s),e[2],i)))){const c=i/7;let u=!1;const g=this.possibleCenters;for(let w=0,E=g.length;w=wt.CENTER_QUORUM)if(t==null)t=n;else return this.hasSkipped=!0,Math.floor((Math.abs(t.getX()-n.getX())-Math.abs(t.getY()-n.getY()))/2);return 0}haveMultiplyConfirmedCenters(){let e=0,t=0;const n=this.possibleCenters.length;for(const s of this.possibleCenters)s.getCount()>=wt.CENTER_QUORUM&&(e++,t+=s.getEstimatedModuleSize());if(e<3)return!1;const r=t/n;let i=0;for(const s of this.possibleCenters)i+=Math.abs(s.getEstimatedModuleSize()-r);return i<=.05*t}selectBestPatterns(){const e=this.possibleCenters.length;if(e<3)throw new F;const t=this.possibleCenters;let n;if(e>3){let r=0,i=0;for(const c of this.possibleCenters){const u=c.getEstimatedModuleSize();r+=u,i+=u*u}n=r/e;let s=Math.sqrt(i/e-n*n);t.sort((c,u)=>{const g=Math.abs(u.getEstimatedModuleSize()-n),w=Math.abs(c.getEstimatedModuleSize()-n);return gw?1:0});const l=Math.max(.2*n,s);for(let c=0;c3;c++){const u=t[c];Math.abs(u.getEstimatedModuleSize()-n)>l&&(t.splice(c,1),c--)}}if(t.length>3){let r=0;for(const i of t)r+=i.getEstimatedModuleSize();n=r/t.length,t.sort((i,s)=>{if(s.getCount()===i.getCount()){const l=Math.abs(s.getEstimatedModuleSize()-n),c=Math.abs(i.getEstimatedModuleSize()-n);return lc?-1:0}else return s.getCount()-i.getCount()}),t.splice(3)}return[t[0],t[1],t[2]]}}wt.CENTER_QUORUM=2,wt.MIN_SKIP=3,wt.MAX_MODULES=57;class Ir{constructor(e){this.image=e}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(e){this.resultPointCallback=e==null?null:e.get(me.NEED_RESULT_POINT_CALLBACK);const n=new wt(this.image,this.resultPointCallback).find(e);return this.processFinderPatternInfo(n)}processFinderPatternInfo(e){const t=e.getTopLeft(),n=e.getTopRight(),r=e.getBottomLeft(),i=this.calculateModuleSize(t,n,r);if(i<1)throw new F("No pattern found in proccess finder.");const s=Ir.computeDimension(t,n,r,i),l=ce.getProvisionalVersionForDimension(s),c=l.getDimensionForVersion()-7;let u=null;if(l.getAlignmentPatternCenters().length>0){const I=n.getX()-t.getX()+r.getX(),y=n.getY()-t.getY()+r.getY(),N=1-3/c,O=Math.floor(t.getX()+N*(I-t.getX())),B=Math.floor(t.getY()+N*(y-t.getY()));for(let X=4;X<=16;X<<=1)try{u=this.findAlignmentInRegion(i,O,B,X);break}catch(Z){if(!(Z instanceof F))throw Z}}const g=Ir.createTransform(t,n,r,u,s),w=Ir.sampleGrid(this.image,g,s);let E;return u===null?E=[r,t,n]:E=[r,t,n,u],new Q(w,E)}static createTransform(e,t,n,r,i){const s=i-3.5;let l,c,u,g;return r!==null?(l=r.getX(),c=r.getY(),u=s-3,g=u):(l=t.getX()-e.getX()+n.getX(),c=t.getY()-e.getY()+n.getY(),u=s,g=s),re.quadrilateralToQuadrilateral(3.5,3.5,s,3.5,u,g,3.5,s,e.getX(),e.getY(),t.getX(),t.getY(),l,c,n.getX(),n.getY())}static sampleGrid(e,t,n){return pe.getInstance().sampleGridWithTransform(e,n,n,t)}static computeDimension(e,t,n,r){const i=H.round(R.distance(e,t)/r),s=H.round(R.distance(e,n)/r);let l=Math.floor((i+s)/2)+7;switch(l&3){case 0:l++;break;case 2:l--;break;case 3:throw new F("Dimensions could be not found.")}return l}calculateModuleSize(e,t,n){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,n))/2}calculateModuleSizeOneWay(e,t){const n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY())),r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(n)?r/7:isNaN(r)?n/7:(n+r)/14}sizeOfBlackWhiteBlackRunBothWays(e,t,n,r){let i=this.sizeOfBlackWhiteBlackRun(e,t,n,r),s=1,l=e-(n-e);l<0?(s=e/(e-l),l=0):l>=this.image.getWidth()&&(s=(this.image.getWidth()-1-e)/(l-e),l=this.image.getWidth()-1);let c=Math.floor(t-(r-t)*s);return s=1,c<0?(s=t/(t-c),c=0):c>=this.image.getHeight()&&(s=(this.image.getHeight()-1-t)/(c-t),c=this.image.getHeight()-1),l=Math.floor(e+(l-e)*s),i+=this.sizeOfBlackWhiteBlackRun(e,t,l,c),i-1}sizeOfBlackWhiteBlackRun(e,t,n,r){const i=Math.abs(r-t)>Math.abs(n-e);if(i){let I=e;e=t,t=I,I=n,n=r,r=I}const s=Math.abs(n-e),l=Math.abs(r-t);let c=-s/2;const u=e0){if(y===r)break;y+=g,c-=s}}return w===2?H.distance(n+u,r,e,t):NaN}findAlignmentInRegion(e,t,n,r){const i=Math.floor(r*e),s=Math.max(0,t-i),l=Math.min(this.image.getWidth()-1,t+i);if(l-s=c||i>=s)throw new F;if(s-i!==c-l&&(c=l+(s-i),c>=e.getWidth()))throw new F;const u=Math.round((c-l+1)/r),g=Math.round((s-i+1)/r);if(u<=0||g<=0)throw new F;if(g!==u)throw new F;const w=Math.floor(r/2);i+=w,l+=w;const E=l+Math.floor((u-1)*r)-c;if(E>0){if(E>w)throw new F;l-=E}const I=i+Math.floor((g-1)*r)-s;if(I>0){if(I>w)throw new F;i-=I}const y=new et(u,g);for(let N=0;N0;){const E=Se.findGuardPattern(e,i,--r,n,!1,s,u);if(E!=null)w=E;else{r++;break}}l[0]=new R(w[0],r),l[1]=new R(w[1],r),c=!0;break}}let g=r+1;if(c){let w=0,E=Int32Array.from([Math.trunc(l[0].getX()),Math.trunc(l[1].getX())]);for(;gSe.SKIPPED_ROW_COUNT_MAX)break;w++}}g-=w+1,l[2]=new R(E[0],g),l[3]=new R(E[1],g)}return g-r0&&u++w?g-w:w-g;if(E>n)return 1/0;c+=E}return c/i}}Se.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),Se.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),Se.MAX_AVG_VARIANCE=.42,Se.MAX_INDIVIDUAL_VARIANCE=.8,Se.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),Se.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),Se.MAX_PIXEL_DRIFT=3,Se.MAX_PATTERN_DRIFT=5,Se.SKIPPED_ROW_COUNT_MAX=25,Se.ROW_STEP=5,Se.BARCODE_MIN_HEIGHT=10;class Et{constructor(e,t){if(t.length===0)throw new M;this.field=e;let n=t.length;if(n>1&&t[0]===0){let r=1;for(;rn.length){let s=t;t=n,n=s}let r=new Int32Array(n.length),i=n.length-t.length;K.arraycopy(n,0,r,0,i);for(let s=i;s=0;t--){let n=this.getCoefficient(t);n!==0&&(n<0?(e.append(" - "),n=-n):e.length()>0&&e.append(" + "),(t===0||n!==1)&&e.append(n),t!==0&&(t===1?e.append("x"):(e.append("x^"),e.append(t))))}return e.toString()}}class Qa{add(e,t){return(e+t)%this.modulus}subtract(e,t){return(this.modulus+e-t)%this.modulus}exp(e){return this.expTable[e]}log(e){if(e===0)throw new M;return this.logTable[e]}inverse(e){if(e===0)throw new In;return this.expTable[this.modulus-this.logTable[e]-1]}multiply(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.modulus-1)]}getSize(){return this.modulus}equals(e){return e===this}}class Mi extends Qa{constructor(e,t){super(),this.modulus=e,this.expTable=new Int32Array(e),this.logTable=new Int32Array(e);let n=1;for(let r=0;r0;y--){let N=r.evaluateAt(this.field.exp(y));i[t-y]=N,N!==0&&(s=!0)}if(!s)return 0;let l=this.field.getOne();if(n!=null)for(const y of n){let N=this.field.exp(e.length-1-y),O=new Et(this.field,new Int32Array([this.field.subtract(0,N),1]));l=l.multiply(O)}let c=new Et(this.field,i),u=this.runEuclideanAlgorithm(this.field.buildMonomial(t,1),c,t),g=u[0],w=u[1],E=this.findErrorLocations(g),I=this.findErrorMagnitudes(w,g,E);for(let y=0;y=Math.round(n/2);){let E=r,I=s;if(r=i,s=l,r.isZero())throw U.getChecksumInstance();i=E;let y=this.field.getZero(),N=r.getCoefficient(r.getDegree()),O=this.field.inverse(N);for(;i.getDegree()>=r.getDegree()&&!i.isZero();){let B=i.getDegree()-r.getDegree(),X=this.field.multiply(i.getCoefficient(i.getDegree()),O);y=y.add(this.field.buildMonomial(B,X)),i=i.subtract(r.multiplyByMonomial(B,X))}l=y.multiply(s).subtract(I).negative()}let c=l.getCoefficient(0);if(c===0)throw U.getChecksumInstance();let u=this.field.inverse(c),g=l.multiply(u),w=i.multiply(u);return[g,w]}findErrorLocations(e){let t=e.getDegree(),n=new Int32Array(t),r=0;for(let i=1;i0){let c=n?this.topLeft:this.topRight,u=Math.trunc(c.getY()-e);u<0&&(u=0);let g=new R(c.getX(),u);n?r=g:s=g}if(t>0){let c=n?this.bottomLeft:this.bottomRight,u=Math.trunc(c.getY()+t);u>=this.image.getHeight()&&(u=this.image.getHeight()-1);let g=new R(c.getX(),u);n?i=g:l=g}return new Un(this.image,r,i,s,l)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class qa{constructor(e,t,n,r){this.columnCount=e,this.errorCorrectionLevel=r,this.rowCountUpperPart=t,this.rowCountLowerPart=n,this.rowCount=t+n}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class Tr{constructor(){this.buffer=""}static form(e,t){let n=-1;function r(s,l,c,u,g,w){if(s==="%%")return"%";if(t[++n]===void 0)return;s=u?parseInt(u.substr(1)):void 0;let E=g?parseInt(g.substr(1)):void 0,I;switch(w){case"s":I=t[n];break;case"c":I=t[n][0];break;case"f":I=parseFloat(t[n]).toFixed(s);break;case"p":I=parseFloat(t[n]).toPrecision(s);break;case"e":I=parseFloat(t[n]).toExponential(s);break;case"x":I=parseInt(t[n]).toString(E||16);break;case"d":I=parseFloat(parseInt(t[n],E||10).toPrecision(s)).toFixed(0);break}I=typeof I=="object"?JSON.stringify(I):(+I).toString(E);let y=parseInt(c),N=c&&c[0]+""=="0"?"0":" ";for(;I.length=0&&(t=this.codewords[r],t!=null)||(r=this.imageRowToCodewordIndex(e)+n,rn,getValue:()=>r};i.getValue()>e?(e=i.getValue(),t=[],t.push(i.getKey())):i.getValue()===e&&t.push(i.getKey())}return Ae.toIntArray(t)}getConfidence(e){return this.values.get(e)}}class Fs extends Sr{constructor(e,t){super(e),this._isLeft=t}setRowNumbers(){for(let e of this.getCodewords())e!=null&&e.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(e){let t=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(t,e);let n=this.getBoundingBox(),r=this._isLeft?n.getTopLeft():n.getTopRight(),i=this._isLeft?n.getBottomLeft():n.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(r.getY())),l=this.imageRowToCodewordIndex(Math.trunc(i.getY())),c=-1,u=1,g=0;for(let w=s;w=e.getRowCount()||I>w)t[w]=null;else{let y;u>2?y=(u-2)*I:y=I;let N=y>=w;for(let O=1;O<=y&&!N;O++)N=t[w-O]!=null;N?t[w]=null:(c=E.getRowNumber(),g=1)}}}getRowHeights(){let e=this.getBarcodeMetadata();if(e==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(e);let t=new Int32Array(e.getRowCount());for(let n of this.getCodewords())if(n!=null){let r=n.getRowNumber();if(r>=t.length)continue;t[r]++}return t}adjustIncompleteIndicatorColumnRowNumbers(e){let t=this.getBoundingBox(),n=this._isLeft?t.getTopLeft():t.getTopRight(),r=this._isLeft?t.getBottomLeft():t.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),s=this.imageRowToCodewordIndex(Math.trunc(r.getY())),l=this.getCodewords(),c=-1;for(let u=i;u=e.getRowCount()?l[u]=null:c=g.getRowNumber())}}getBarcodeMetadata(){let e=this.getCodewords(),t=new br,n=new br,r=new br,i=new br;for(let l of e){if(l==null)continue;l.setRowNumberAsRowIndicatorColumn();let c=l.getValue()%30,u=l.getRowNumber();switch(this._isLeft||(u+=2),u%3){case 0:n.setValue(c*3+1);break;case 1:i.setValue(c/3),r.setValue(c%3);break;case 2:t.setValue(c+1);break}}if(t.getValue().length===0||n.getValue().length===0||r.getValue().length===0||i.getValue().length===0||t.getValue()[0]<1||n.getValue()[0]+r.getValue()[0]Ae.MAX_ROWS_IN_BARCODE)return null;let s=new qa(t.getValue()[0],n.getValue()[0],r.getValue()[0],i.getValue()[0]);return this.removeIncorrectCodewords(e,s),s}removeIncorrectCodewords(e,t){for(let n=0;nt.getRowCount()){e[n]=null;continue}switch(this._isLeft||(s+=2),s%3){case 0:i*3+1!==t.getRowCountUpperPart()&&(e[n]=null);break;case 1:(Math.trunc(i/3)!==t.getErrorCorrectionLevel()||i%3!==t.getRowCountLowerPart())&&(e[n]=null);break;case 2:i+1!==t.getColumnCount()&&(e[n]=null);break}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+` -`+super.toString()}}class yr{constructor(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let e=Ae.MAX_CODEWORDS_IN_BARCODE,t;do t=e,e=this.adjustRowNumbersAndGetCount();while(e>0&&e0&&i0&&(l[0]=n[t-1],l[4]=i[t-1],l[5]=s[t-1]),t>1&&(l[8]=n[t-2],l[10]=i[t-2],l[11]=s[t-2]),t>=1;n=t&1,Bt.RATIOS_TABLE[e]||(Bt.RATIOS_TABLE[e]=new Array(Ae.BARS_IN_MODULE)),Bt.RATIOS_TABLE[e][Ae.BARS_IN_MODULE-r-1]=Math.fround(i/Ae.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(e){let t=Bt.getDecodedCodewordValue(Bt.sampleBitCounts(e));return t!==-1?t:Bt.getClosestDecodedValue(e)}static sampleBitCounts(e){let t=H.sum(e),n=new Int32Array(Ae.BARS_IN_MODULE),r=0,i=0;for(let s=0;s1)for(let s=0;s=r)break}lnew Array(Ae.BARS_IN_MODULE));class ks{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(e){this.segmentIndex=e}getFileId(){return this.fileId}setFileId(e){this.fileId=e}getOptionalData(){return this.optionalData}setOptionalData(e){this.optionalData=e}isLastSegment(){return this.lastSegment}setLastSegment(e){this.lastSegment=e}getSegmentCount(){return this.segmentCount}setSegmentCount(e){this.segmentCount=e}getSender(){return this.sender||null}setSender(e){this.sender=e}getAddressee(){return this.addressee||null}setAddressee(e){this.addressee=e}getFileName(){return this.fileName}setFileName(e){this.fileName=e}getFileSize(){return this.fileSize}setFileSize(e){this.fileSize=e}getChecksum(){return this.checksum}setChecksum(e){this.checksum=e}getTimestamp(){return this.timestamp}setTimestamp(e){this.timestamp=e}}class Us{static parseLong(e,t=void 0){return parseInt(e,t)}}class Hs extends m{}Hs.kind="NullPointerException";class Ja{writeBytes(e){this.writeBytesOffset(e,0,e.length)}writeBytesOffset(e,t,n){if(e==null)throw new Hs;if(t<0||t>e.length||n<0||t+n>e.length||t+n<0)throw new fe;if(n===0)return;for(let r=0;r0&&this.grow(e)}grow(e){let n=this.buf.length<<1;if(n-e<0&&(n=e),n<0){if(e<0)throw new $a;n=se.MAX_VALUE}this.buf=$.copyOfUint8Array(this.buf,n)}write(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1}writeBytesOffset(e,t,n){if(t<0||t>e.length||n<0||t+n-e.length>0)throw new fe;this.ensureCapacity(this.count+n),K.arraycopy(e,t,this.buf,this.count,n),this.count+=n}writeTo(e){e.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return $.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(e){return e?typeof e=="string"?this.toString_string(e):this.toString_number(e):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(e){return new String(this.buf).toString()}toString_number(e){return new String(this.buf).toString()}close(){}}var Ge;(function(A){A[A.ALPHA=0]="ALPHA",A[A.LOWER=1]="LOWER",A[A.MIXED=2]="MIXED",A[A.PUNCT=3]="PUNCT",A[A.ALPHA_SHIFT=4]="ALPHA_SHIFT",A[A.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(Ge||(Ge={}));function js(){if(typeof window!="undefined")return window.BigInt||null;if(typeof Dr!="undefined")return Dr.BigInt||null;if(typeof self!="undefined")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let Gr;function Nn(A){if(typeof Gr=="undefined"&&(Gr=js()),Gr===null)throw new Error("BigInt is not supported!");return Gr(A)}function tl(){let A=[];A[0]=Nn(1);let e=Nn(900);A[1]=e;for(let t=2;t<16;t++)A[t]=A[t-1]*e;return A}class L{static decode(e,t){let n=new Ie(""),r=V.ISO8859_1;n.enableDecoding(r);let i=1,s=e[i++],l=new ks;for(;ie[0])throw G.getFormatInstance();let r=new Int32Array(L.NUMBER_OF_SEQUENCE_CODEWORDS);for(let l=0;l0){for(let E=0;E<6;++E)s.write(Number(Nn(c)>>Nn(8*(5-E))));c=0,l=0}break}r===t[0]&&w0){for(let I=0;I<6;++I)s.write(Number(Nn(c)>>Nn(8*(5-I))));c=0,l=0}}break}return i.append(ze.decode(s.toByteArray(),n)),r}static numericCompaction(e,t,n){let r=0,i=!1,s=new Int32Array(L.MAX_NUMERIC_CODEWORDS);for(;t0&&(n.append(L.decodeBase900toBase10(s,r)),r=0)}return t}static decodeBase900toBase10(e,t){let n=Nn(0);for(let i=0;i@[\\]_\`~!\r ,: --.$/"|*()?{}'`,L.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",L.EXP900=js()?tl():[],L.NUMBER_OF_SEQUENCE_CODEWORDS=2;class ye{constructor(){}static decode(e,t,n,r,i,s,l){let c=new Un(e,t,n,r,i),u=null,g=null,w;for(let y=!0;;y=!1){if(t!=null&&(u=ye.getRowIndicatorColumn(e,c,t,!0,s,l)),r!=null&&(g=ye.getRowIndicatorColumn(e,c,r,!1,s,l)),w=ye.merge(u,g),w==null)throw F.getNotFoundInstance();let N=w.getBoundingBox();if(y&&N!=null&&(N.getMinY()c.getMaxY()))c=N;else break}w.setBoundingBox(c);let E=w.getBarcodeColumnCount()+1;w.setDetectionResultColumn(0,u),w.setDetectionResultColumn(E,g);let I=u!=null;for(let y=1;y<=E;y++){let N=I?y:E-y;if(w.getDetectionResultColumn(N)!==void 0)continue;let O;N===0||N===E?O=new Fs(c,N===0):O=new Sr(c),w.setDetectionResultColumn(N,O);let B=-1,X=B;for(let Z=c.getMinY();Z<=c.getMaxY();Z++){if(B=ye.getStartColumn(w,N,Z,I),B<0||B>c.getMaxX()){if(X===-1)continue;B=X}let W=ye.detectCodeword(e,c.getMinX(),c.getMaxX(),I,B,Z,s,l);W!=null&&(O.setCodeword(Z,W),X=B,s=Math.min(s,W.getWidth()),l=Math.max(l,W.getWidth()))}}return ye.createDecoderResult(w)}static merge(e,t){if(e==null&&t==null)return null;let n=ye.getBarcodeMetadata(e,t);if(n==null)return null;let r=Un.merge(ye.adjustBoundingBox(e),ye.adjustBoundingBox(t));return new yr(n,r)}static adjustBoundingBox(e){if(e==null)return null;let t=e.getRowHeights();if(t==null)return null;let n=ye.getMax(t),r=0;for(let l of t)if(r+=n-l,l>0)break;let i=e.getCodewords();for(let l=0;r>0&&i[l]==null;l++)r--;let s=0;for(let l=t.length-1;l>=0&&(s+=n-t[l],!(t[l]>0));l--);for(let l=i.length-1;s>0&&i[l]==null;l--)s--;return e.getBoundingBox().addMissingRows(r,s,e.isLeft())}static getMax(e){let t=-1;for(let n of e)t=Math.max(t,n);return t}static getBarcodeMetadata(e,t){let n;if(e==null||(n=e.getBarcodeMetadata())==null)return t==null?null:t.getBarcodeMetadata();let r;return t==null||(r=t.getBarcodeMetadata())==null?n:n.getColumnCount()!==r.getColumnCount()&&n.getErrorCorrectionLevel()!==r.getErrorCorrectionLevel()&&n.getRowCount()!==r.getRowCount()?null:n}static getRowIndicatorColumn(e,t,n,r,i,s){let l=new Fs(t,r);for(let c=0;c<2;c++){let u=c===0?1:-1,g=Math.trunc(Math.trunc(n.getX()));for(let w=Math.trunc(Math.trunc(n.getY()));w<=t.getMaxY()&&w>=t.getMinY();w+=u){let E=ye.detectCodeword(e,0,e.getWidth(),r,g,w,i,s);E!=null&&(l.setCodeword(w,E),r?g=E.getStartX():g=E.getEndX())}}return l}static adjustCodewordCount(e,t){let n=t[0][1],r=n.getValue(),i=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-ye.getNumberOfECCodeWords(e.getBarcodeECLevel());if(r.length===0){if(i<1||i>Ae.MAX_CODEWORDS_IN_BARCODE)throw F.getNotFoundInstance();n.setValue(i)}else r[0]!==i&&n.setValue(i)}static createDecoderResult(e){let t=ye.createBarcodeMatrix(e);ye.adjustCodewordCount(e,t);let n=new Array,r=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),i=[],s=new Array;for(let c=0;c0;){for(let c=0;cnew Array(e.getBarcodeColumnCount()+2));for(let r=0;r=0){if(s>=t.length)continue;t[s][n].setValue(i.getValue())}}}n++}return t}static isValidBarcodeColumn(e,t){return t>=0&&t<=e.getBarcodeColumnCount()+1}static getStartColumn(e,t,n,r){let i=r?1:-1,s=null;if(ye.isValidBarcodeColumn(e,t-i)&&(s=e.getDetectionResultColumn(t-i).getCodeword(n)),s!=null)return r?s.getEndX():s.getStartX();if(s=e.getDetectionResultColumn(t).getCodewordNearby(n),s!=null)return r?s.getStartX():s.getEndX();if(ye.isValidBarcodeColumn(e,t-i)&&(s=e.getDetectionResultColumn(t-i).getCodewordNearby(n)),s!=null)return r?s.getEndX():s.getStartX();let l=0;for(;ye.isValidBarcodeColumn(e,t-i);){t-=i;for(let c of e.getDetectionResultColumn(t).getCodewords())if(c!=null)return(r?c.getEndX():c.getStartX())+i*l*(c.getEndX()-c.getStartX());l++}return r?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()}static detectCodeword(e,t,n,r,i,s,l,c){i=ye.adjustCodewordStartColumn(e,t,n,r,i,s);let u=ye.getModuleBitCount(e,t,n,r,i,s);if(u==null)return null;let g,w=H.sum(u);if(r)g=i+w;else{for(let y=0;y=t)&&u=t:lye.CODEWORD_SKEW_SIZE)return i;l+=c}c=-c,r=!r}return l}static checkCodewordSkew(e,t,n){return t-ye.CODEWORD_SKEW_SIZE<=e&&e<=n+ye.CODEWORD_SKEW_SIZE}static decodeCodewords(e,t,n){if(e.length===0)throw G.getFormatInstance();let r=1<n/2+ye.MAX_ERRORS||n<0||n>ye.MAX_EC_CODEWORDS)throw U.getChecksumInstance();return ye.errorCorrection.decode(e,n,t)}static verifyCodewordCount(e,t){if(e.length<4)throw G.getFormatInstance();let n=e[0];if(n>e.length)throw G.getFormatInstance();if(n===0)if(t>=1;return t}static getCodewordBucketNumber(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)}static getCodewordBucketNumber_number(e){return ye.getCodewordBucketNumber(ye.getBitCountForCodeword(e))}static getCodewordBucketNumber_Int32Array(e){return(e[0]-e[2]+e[4]-e[6]+9)%9}static toString(e){let t=new Tr;for(let n=0;ns)}static getMaxWidth(e,t){return e==null||t==null?0:Math.trunc(Math.abs(e.getX()-t.getX()))}static getMinWidth(e,t){return e==null||t==null?se.MAX_VALUE:Math.trunc(Math.abs(e.getX()-t.getX()))}static getMaxCodewordWidth(e){return Math.floor(Math.max(Math.max(pt.getMaxWidth(e[0],e[4]),pt.getMaxWidth(e[6],e[2])*Ae.MODULES_IN_CODEWORD/Ae.MODULES_IN_STOP_PATTERN),Math.max(pt.getMaxWidth(e[1],e[5]),pt.getMaxWidth(e[7],e[3])*Ae.MODULES_IN_CODEWORD/Ae.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(e){return Math.floor(Math.min(Math.min(pt.getMinWidth(e[0],e[4]),pt.getMinWidth(e[6],e[2])*Ae.MODULES_IN_CODEWORD/Ae.MODULES_IN_STOP_PATTERN),Math.min(pt.getMinWidth(e[1],e[5]),pt.getMinWidth(e[7],e[3])*Ae.MODULES_IN_CODEWORD/Ae.MODULES_IN_STOP_PATTERN)))}reset(){}}class Xr extends m{}Xr.kind="ReaderException";class Vs{constructor(e,t){this.verbose=e===!0,t&&this.setHints(t)}decode(e,t){return t&&this.setHints(t),this.decodeInternal(e)}decodeWithState(e){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(e)}setHints(e){this.hints=e;const t=e!=null&&e.get(me.TRY_HARDER)!==void 0,n=e==null?null:e.get(me.POSSIBLE_FORMATS),r=new Array;if(n!=null){const i=n.some(s=>s===de.UPC_A||s===de.UPC_E||s===de.EAN_13||s===de.EAN_8||s===de.CODABAR||s===de.CODE_39||s===de.CODE_93||s===de.CODE_128||s===de.ITF||s===de.RSS_14||s===de.RSS_EXPANDED);i&&!t&&r.push(new rr(e,this.verbose)),n.includes(de.QR_CODE)&&r.push(new yn),n.includes(de.DATA_MATRIX)&&r.push(new bn),n.includes(de.AZTEC)&&r.push(new He),n.includes(de.PDF_417)&&r.push(new pt),i&&t&&r.push(new rr(e,this.verbose))}r.length===0&&(t||r.push(new rr(e,this.verbose)),r.push(new yn),r.push(new bn),r.push(new He),r.push(new pt),t&&r.push(new rr(e,this.verbose))),this.readers=r}reset(){if(this.readers!==null)for(const e of this.readers)e.reset()}decodeInternal(e){if(this.readers===null)throw new Xr("No readers where selected, nothing can be read.");for(const t of this.readers)try{return t.decode(e,this.hints)}catch(n){if(n instanceof Xr)continue}throw new F("No MultiFormat Readers were able to detect the code.")}}class nl extends Dt{constructor(e=null,t=500){const n=new Vs;n.setHints(e),super(n,t)}decodeBitmap(e){return this.reader.decodeWithState(e)}}class rl extends Dt{constructor(e=500){super(new pt,e)}}class il extends Dt{constructor(e=500){super(new yn,e)}}var Oi;(function(A){A[A.ERROR_CORRECTION=0]="ERROR_CORRECTION",A[A.CHARACTER_SET=1]="CHARACTER_SET",A[A.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",A[A.MIN_SIZE=3]="MIN_SIZE",A[A.MAX_SIZE=4]="MAX_SIZE",A[A.MARGIN=5]="MARGIN",A[A.PDF417_COMPACT=6]="PDF417_COMPACT",A[A.PDF417_COMPACTION=7]="PDF417_COMPACTION",A[A.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",A[A.AZTEC_LAYERS=9]="AZTEC_LAYERS",A[A.QR_VERSION=10]="QR_VERSION"})(Oi||(Oi={}));var gt=Oi;class Di{constructor(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new ut(e,Int32Array.from([1])))}buildGenerator(e){const t=this.cachedGenerators;if(e>=t.length){let n=t[t.length-1];const r=this.field;for(let i=t.length;i<=e;i++){const s=n.multiply(new ut(r,Int32Array.from([1,r.exp(i-1+r.getGeneratorBase())])));t.push(s),n=s}}return t[e]}encode(e,t){if(t===0)throw new M("No error correction bytes");const n=e.length-t;if(n<=0)throw new M("No data bytes provided");const r=this.buildGenerator(t),i=new Int32Array(n);K.arraycopy(e,0,i,0,n);let s=new ut(this.field,i);s=s.multiplyByMonomial(t,1);const c=s.divide(r)[1].getCoefficients(),u=t-c.length;for(let g=0;g=5&&(n+=lt.N1+(c-5)),c=1,u=w)}c>=5&&(n+=lt.N1+(c-5))}return n}}lt.N1=3,lt.N2=3,lt.N3=40,lt.N4=10;class Zr{constructor(e,t){this.width=e,this.height=t;const n=new Array(t);for(let r=0;r!==t;r++)n[r]=new Uint8Array(e);this.bytes=n}getHeight(){return this.height}getWidth(){return this.width}get(e,t){return this.bytes[t][e]}getArray(){return this.bytes}setNumber(e,t,n){this.bytes[t][e]=n}setBoolean(e,t,n){this.bytes[t][e]=n?1:0}clear(e){for(const t of this.bytes)$.fill(t,e)}equals(e){if(!(e instanceof Zr))return!1;const t=e;if(this.width!==t.width||this.height!==t.height)return!1;for(let n=0,r=this.height;n","?","[","]","{","}","CTRL_UL"],P.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class H{constructor(){}static round(e){return e===NaN?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0}static distance(e,t,n,r){const i=e-n,s=t-r;return Math.sqrt(i*i+s*s)}static sum(e){let t=0;for(let n=0,r=e.length;n!==r;n++)t+=e[n];return t}}class J{static floatToIntBits(e){return e}}J.MAX_VALUE=Number.MAX_SAFE_INTEGER;class R{constructor(e,t){this.x=e,this.y=t}getX(){return this.x}getY(){return this.y}equals(e){if(e instanceof R){const t=e;return this.x===t.x&&this.y===t.y}return!1}hashCode(){return 31*J.floatToIntBits(this.x)+J.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(e){const t=this.distance(e[0],e[1]),n=this.distance(e[1],e[2]),r=this.distance(e[0],e[2]);let i,s,l;if(n>=t&&n>=r?(s=e[0],i=e[1],l=e[2]):r>=n&&r>=t?(s=e[1],i=e[0],l=e[2]):(s=e[2],i=e[0],l=e[1]),this.crossProductZ(i,s,l)<0){const c=i;i=l,l=c}e[0]=i,e[1]=s,e[2]=l}static distance(e,t){return H.distance(e.x,e.y,t.x,t.y)}static crossProductZ(e,t,n){const r=t.x,i=t.y;return(n.x-r)*(e.y-i)-(n.y-i)*(e.x-r)}}class Q{constructor(e,t){this.bits=e,this.points=t}getBits(){return this.bits}getPoints(){return this.points}}class Y extends Q{constructor(e,t,n,r,i){super(e,t),this.compact=n,this.nbDatablocks=r,this.nbLayers=i}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class oe{constructor(e,t,n,r){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),t==null&&(t=oe.INIT_SIZE),n==null&&(n=e.getWidth()/2|0),r==null&&(r=e.getHeight()/2|0);const i=t/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=r-i,this.downInit=r+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new F}detect(){let e=this.leftInit,t=this.rightInit,n=this.upInit,r=this.downInit,i=!1,s=!0,l=!1,c=!1,u=!1,g=!1,w=!1;const E=this.width,I=this.height;for(;s;){s=!1;let y=!0;for(;(y||!c)&&t=E){i=!0;break}let N=!0;for(;(N||!u)&&r=I){i=!0;break}let O=!0;for(;(O||!g)&&e>=0;)O=this.containsBlackPoint(n,r,e,!1),O?(e--,s=!0,g=!0):g||e--;if(e<0){i=!0;break}let B=!0;for(;(B||!w)&&n>=0;)B=this.containsBlackPoint(e,t,n,!0),B?(n--,s=!0,w=!0):w||n--;if(n<0){i=!0;break}s&&(l=!0)}if(!i&&l){const y=t-e;let N=null;for(let Z=1;N===null&&Zn||c<-1||c>r)throw new F;i=!1,l===-1?(t[s]=0,i=!0):l===n&&(t[s]=n-1,i=!0),c===-1?(t[s+1]=0,i=!0):c===r&&(t[s+1]=r-1,i=!0)}i=!0;for(let s=t.length-2;s>=0&&i;s-=2){const l=Math.floor(t[s]),c=Math.floor(t[s+1]);if(l<-1||l>n||c<-1||c>r)throw new F;i=!1,l===-1?(t[s]=0,i=!0):l===n&&(t[s]=n-1,i=!0),c===-1?(t[s+1]=0,i=!0):c===r&&(t[s+1]=r-1,i=!0)}}}class re{constructor(e,t,n,r,i,s,l,c,u){this.a11=e,this.a21=t,this.a31=n,this.a12=r,this.a22=i,this.a32=s,this.a13=l,this.a23=c,this.a33=u}static quadrilateralToQuadrilateral(e,t,n,r,i,s,l,c,u,g,w,E,I,y,N,O){const B=re.quadrilateralToSquare(e,t,n,r,i,s,l,c);return re.squareToQuadrilateral(u,g,w,E,I,y,N,O).times(B)}transformPoints(e){const t=e.length,n=this.a11,r=this.a12,i=this.a13,s=this.a21,l=this.a22,c=this.a23,u=this.a31,g=this.a32,w=this.a33;for(let E=0;E>1&127):(r<<=10,r+=(l>>2&31<<5)+(l>>1&31))}let i=this.getCorrectedParameterData(r,this.compact);this.compact?(this.nbLayers=(i>>6)+1,this.nbDataBlocks=(i&63)+1):(this.nbLayers=(i>>11)+1,this.nbDataBlocks=(i&2047)+1)}getRotation(e,t){let n=0;e.forEach((r,i,s)=>{let l=(r>>t-2<<1)+(r&1);n=(n<<3)+l}),n=((n&1)<<11)+(n>>1);for(let r=0;r<4;r++)if(se.bitCount(n^this.EXPECTED_CORNER_BITS[r])<=2)return r;throw new F}getCorrectedParameterData(e,t){let n,r;t?(n=7,r=2):(n=10,r=4);let i=n-r,s=new Int32Array(n);for(let c=n-1;c>=0;--c)s[c]=e&15,e>>=4;try{new v(Oe.AZTEC_PARAM).decode(s,i)}catch{throw new F}let l=0;for(let c=0;c2){let N=this.distancePoint(y,w)*this.nbCenterLayers/(this.distancePoint(i,t)*(this.nbCenterLayers+2));if(N<.75||N>1.25||!this.isWhiteOrBlackRectangle(w,E,I,y))break}t=w,n=E,r=I,i=y,s=!s}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new F;this.compact=this.nbCenterLayers===5;let l=new R(t.getX()+.5,t.getY()-.5),c=new R(n.getX()+.5,n.getY()+.5),u=new R(r.getX()-.5,r.getY()+.5),g=new R(i.getX()-.5,i.getY()-.5);return this.expandSquare([l,c,u,g],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let e,t,n,r;try{let l=new oe(this.image).detect();e=l[0],t=l[1],n=l[2],r=l[3]}catch{let c=this.image.getWidth()/2,u=this.image.getHeight()/2;e=this.getFirstDifferent(new Te(c+7,u-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new Te(c+7,u+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new Te(c-7,u+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new Te(c-7,u-7),!1,-1,-1).toResultPoint()}let i=H.round((e.getX()+r.getX()+t.getX()+n.getX())/4),s=H.round((e.getY()+r.getY()+t.getY()+n.getY())/4);try{let l=new oe(this.image,15,i,s).detect();e=l[0],t=l[1],n=l[2],r=l[3]}catch{e=this.getFirstDifferent(new Te(i+7,s-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new Te(i+7,s+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new Te(i-7,s+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new Te(i-7,s-7),!1,-1,-1).toResultPoint()}return i=H.round((e.getX()+r.getX()+t.getX()+n.getX())/4),s=H.round((e.getY()+r.getY()+t.getY()+n.getY())/4),new Te(i,s)}getMatrixCornerPoints(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())}sampleGrid(e,t,n,r,i){let s=pe.getInstance(),l=this.getDimension(),c=l/2-this.nbCenterLayers,u=l/2+this.nbCenterLayers;return s.sampleGrid(e,l,l,c,c,u,c,u,u,c,u,t.getX(),t.getY(),n.getX(),n.getY(),r.getX(),r.getY(),i.getX(),i.getY())}sampleLine(e,t,n){let r=0,i=this.distanceResultPoint(e,t),s=i/n,l=e.getX(),c=e.getY(),u=s*(t.getX()-e.getX())/i,g=s*(t.getY()-e.getY())/i;for(let w=0;w.1&&w<.9?0:w<=.1===u?1:-1}getFirstDifferent(e,t,n,r){let i=e.getX()+n,s=e.getY()+r;for(;this.isValid(i,s)&&this.image.get(i,s)===t;)i+=n,s+=r;for(i-=n,s-=r;this.isValid(i,s)&&this.image.get(i,s)===t;)i+=n;for(i-=n;this.isValid(i,s)&&this.image.get(i,s)===t;)s+=r;return s-=r,new Te(i,s)}expandSquare(e,t,n){let r=n/(2*t),i=e[0].getX()-e[2].getX(),s=e[0].getY()-e[2].getY(),l=(e[0].getX()+e[2].getX())/2,c=(e[0].getY()+e[2].getY())/2,u=new R(l+r*i,c+r*s),g=new R(l-r*i,c-r*s);i=e[1].getX()-e[3].getX(),s=e[1].getY()-e[3].getY(),l=(e[1].getX()+e[3].getX())/2,c=(e[1].getY()+e[3].getY())/2;let w=new R(l+r*i,c+r*s),E=new R(l-r*i,c-r*s);return[u,w,g,E]}isValid(e,t){return e>=0&&e0&&t{n.foundPossibleResultPoint(r)})}}reset(){}}class kt extends Dt{constructor(e=500){super(new He,e)}}class Ze{decode(e,t){try{return this.doDecode(e,t)}catch{if(t&&t.get(me.TRY_HARDER)===!0&&e.isRotateSupported()){const i=e.rotateCounterClockwise(),s=this.doDecode(i,t),l=s.getResultMetadata();let c=270;l!==null&&l.get(Ye.ORIENTATION)===!0&&(c=c+l.get(Ye.ORIENTATION)%360),s.putMetadata(Ye.ORIENTATION,c);const u=s.getResultPoints();if(u!==null){const g=i.getHeight();for(let w=0;w>(s?8:5));let c;s?c=r:c=15;const u=Math.trunc(r/2);for(let g=0;g=r)break;try{i=e.getBlackRow(I,i)}catch{continue}for(let y=0;y<2;y++){if(y===1&&(i.reverse(),t&&t.get(me.NEED_RESULT_POINT_CALLBACK)===!0)){const N=new Map;t.forEach((O,B)=>N.set(B,O)),N.delete(me.NEED_RESULT_POINT_CALLBACK),t=N}try{const N=this.decodeRow(I,i,t);if(y===1){N.putMetadata(Ye.ORIENTATION,180);const O=N.getResultPoints();O!==null&&(O[0]=new R(n-O[0].getX()-1,O[0].getY()),O[1]=new R(n-O[1].getX()-1,O[1].getY()))}return N}catch{}}}throw new F}static recordPattern(e,t,n){const r=n.length;for(let u=0;u=i)throw new F;let s=!e.get(t),l=0,c=t;for(;c0&&r>=0;)e.get(--t)!==i&&(r--,i=!i);if(r>=0)throw new F;Ze.recordPattern(e,t+1,n)}static patternMatchVariance(e,t,n){const r=e.length;let i=0,s=0;for(let u=0;uw?g-w:w-g;if(E>n)return Number.POSITIVE_INFINITY;c+=E}return c/i}}class q extends Ze{static findStartPattern(e){const t=e.getSize(),n=e.getNextSet(0);let r=0,i=Int32Array.from([0,0,0,0,0,0]),s=n,l=!1;const c=6;for(let u=n;u=0&&e.isRange(Math.max(0,s-(u-s)/2),s,!1))return Int32Array.from([s,u,w]);s+=i[0]+i[1],i=i.slice(2,i.length-1),i[r-1]=0,i[r]=0,r--}else r++;i[r]=1,l=!l}throw new F}static decodeCode(e,t,n){Ze.recordPattern(e,n,t);let r=q.MAX_AVG_VARIANCE,i=-1;for(let s=0;s=0)return i;throw new F}decodeRow(e,t,n){const r=n&&n.get(me.ASSUME_GS1)===!0,i=q.findStartPattern(t),s=i[2];let l=0;const c=new Uint8Array(20);c[l++]=s;let u;switch(s){case q.CODE_START_A:u=q.CODE_CODE_A;break;case q.CODE_START_B:u=q.CODE_CODE_B;break;case q.CODE_START_C:u=q.CODE_CODE_C;break;default:throw new G}let g=!1,w=!1,E="",I=i[0],y=i[1];const N=Int32Array.from([0,0,0,0,0,0]);let O=0,B=0,X=s,Z=0,W=!0,Me=!1,Ce=!1;for(;!g;){const lr=w;switch(w=!1,O=B,B=q.decodeCode(t,N,y),c[l++]=B,B!==q.CODE_STOP&&(W=!0),B!==q.CODE_STOP&&(Z++,X+=Z*B),I=y,y+=N.reduce((gl,xl)=>gl+xl,0),B){case q.CODE_START_A:case q.CODE_START_B:case q.CODE_START_C:throw new G}switch(u){case q.CODE_CODE_A:if(B<64)Ce===Me?E+=String.fromCharCode(" ".charCodeAt(0)+B):E+=String.fromCharCode(" ".charCodeAt(0)+B+128),Ce=!1;else if(B<96)Ce===Me?E+=String.fromCharCode(B-64):E+=String.fromCharCode(B+64),Ce=!1;else switch(B!==q.CODE_STOP&&(W=!1),B){case q.CODE_FNC_1:r&&(E.length===0?E+="]C1":E+=String.fromCharCode(29));break;case q.CODE_FNC_2:case q.CODE_FNC_3:break;case q.CODE_FNC_4_A:!Me&&Ce?(Me=!0,Ce=!1):Me&&Ce?(Me=!1,Ce=!1):Ce=!0;break;case q.CODE_SHIFT:w=!0,u=q.CODE_CODE_B;break;case q.CODE_CODE_B:u=q.CODE_CODE_B;break;case q.CODE_CODE_C:u=q.CODE_CODE_C;break;case q.CODE_STOP:g=!0;break}break;case q.CODE_CODE_B:if(B<96)Ce===Me?E+=String.fromCharCode(" ".charCodeAt(0)+B):E+=String.fromCharCode(" ".charCodeAt(0)+B+128),Ce=!1;else switch(B!==q.CODE_STOP&&(W=!1),B){case q.CODE_FNC_1:r&&(E.length===0?E+="]C1":E+=String.fromCharCode(29));break;case q.CODE_FNC_2:case q.CODE_FNC_3:break;case q.CODE_FNC_4_B:!Me&&Ce?(Me=!0,Ce=!1):Me&&Ce?(Me=!1,Ce=!1):Ce=!0;break;case q.CODE_SHIFT:w=!0,u=q.CODE_CODE_A;break;case q.CODE_CODE_A:u=q.CODE_CODE_A;break;case q.CODE_CODE_C:u=q.CODE_CODE_C;break;case q.CODE_STOP:g=!0;break}break;case q.CODE_CODE_C:if(B<100)B<10&&(E+="0"),E+=B;else switch(B!==q.CODE_STOP&&(W=!1),B){case q.CODE_FNC_1:r&&(E.length===0?E+="]C1":E+=String.fromCharCode(29));break;case q.CODE_CODE_A:u=q.CODE_CODE_A;break;case q.CODE_CODE_B:u=q.CODE_CODE_B;break;case q.CODE_STOP:g=!0;break}break}lr&&(u=u===q.CODE_CODE_A?q.CODE_CODE_B:q.CODE_CODE_A)}const vt=y-I;if(y=t.getNextUnset(y),!t.isRange(y,Math.min(t.getSize(),y+(y-I)/2),!1))throw new F;if(X-=Z*O,X%103!==O)throw new U;const qt=E.length;if(qt===0)throw new F;qt>0&&W&&(u===q.CODE_CODE_C?E=E.substring(0,qt-2):E=E.substring(0,qt-1));const Pt=(i[1]+i[0])/2,Qe=I+vt/2,Ct=c.length,Ut=new Uint8Array(Ct);for(let lr=0;lrn&&(i=c);n=i,r=0;let s=0,l=0;for(let c=0;cn&&(l|=1<0;c++){let u=e[c];if(u>n&&(r--,u*2>=s))return-1}return l}}while(r>3);return-1}static patternToChar(e){for(let t=0;t="A"&&s<="Z")l=String.fromCharCode(s.charCodeAt(0)+32);else throw new G;break;case"$":if(s>="A"&&s<="Z")l=String.fromCharCode(s.charCodeAt(0)-64);else throw new G;break;case"%":if(s>="A"&&s<="E")l=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")l=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")l=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")l="\0";else if(s==="V")l="@";else if(s==="W")l="`";else if(s==="X"||s==="Y"||s==="Z")l="\x7F";else throw new G;break;case"/":if(s>="A"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")l=":";else throw new G;break}n+=l,r++}else n+=i}return n}}tt.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",tt.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],tt.ASTERISK_ENCODING=148;class je extends Ze{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(e,t,n){let r=this.decodeStart(t),i=this.decodeEnd(t),s=new Ie;je.decodeMiddle(t,r[1],i[0],s);let l=s.toString(),c=null;n!=null&&(c=n.get(me.ALLOWED_LENGTHS)),c==null&&(c=je.DEFAULT_ALLOWED_LENGTHS);let u=l.length,g=!1,w=0;for(let y of c){if(u===y){g=!0;break}y>w&&(w=y)}if(!g&&u>w&&(g=!0),!g)throw new G;const E=[new R(r[1],e),new R(i[0],e)];return new rt(l,null,0,E,de.ITF,new Date().getTime())}static decodeMiddle(e,t,n,r){let i=new Int32Array(10),s=new Int32Array(5),l=new Int32Array(5);for(i.fill(0),s.fill(0),l.fill(0);t0&&r>=0&&!e.get(r);r--)n--;if(n!==0)throw new F}static skipWhiteSpace(e){const t=e.getSize(),n=e.getNextSet(0);if(n===t)throw new F;return n}decodeEnd(e){e.reverse();try{let t=je.skipWhiteSpace(e),n;try{n=je.findGuardPattern(e,t,je.END_PATTERN_REVERSED[0])}catch(i){i instanceof F&&(n=je.findGuardPattern(e,t,je.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,n[0]);let r=n[0];return n[0]=e.getSize()-n[1],n[1]=e.getSize()-r,n}finally{e.reverse()}}static findGuardPattern(e,t,n){let r=n.length,i=new Int32Array(r),s=e.getSize(),l=!1,c=0,u=t;i.fill(0);for(let g=t;g=0)return n%10;throw new F}}je.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],je.MAX_AVG_VARIANCE=.38,je.MAX_INDIVIDUAL_VARIANCE=.5,je.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],je.START_PATTERN=Int32Array.from([1,1,1,1]),je.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class _e extends Ze{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(e){let t=!1,n,r=0,i=Int32Array.from([0,0,0]);for(;!t;){i=Int32Array.from([0,0,0]),n=_e.findGuardPattern(e,r,!1,this.START_END_PATTERN,i);let s=n[0];r=n[1];let l=s-(r-s);l>=0&&(t=e.isRange(l,s,!1))}return n}static checkChecksum(e){return _e.checkStandardUPCEANChecksum(e)}static checkStandardUPCEANChecksum(e){let t=e.length;if(t===0)return!1;let n=parseInt(e.charAt(t-1),10);return _e.getStandardUPCEANChecksum(e.substring(0,t-1))===n}static getStandardUPCEANChecksum(e){let t=e.length,n=0;for(let r=t-1;r>=0;r-=2){let i=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(i<0||i>9)throw new G;n+=i}n*=3;for(let r=t-2;r>=0;r-=2){let i=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(i<0||i>9)throw new G;n+=i}return(1e3-n)%10}static decodeEnd(e,t){return _e.findGuardPattern(e,t,!1,_e.START_END_PATTERN,new Int32Array(_e.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(e,t,n,r){return this.findGuardPattern(e,t,n,r,new Int32Array(r.length))}static findGuardPattern(e,t,n,r,i){let s=e.getSize();t=n?e.getNextUnset(t):e.getNextSet(t);let l=0,c=t,u=r.length,g=n;for(let w=t;w=0)return s;throw new F}}_e.MAX_AVG_VARIANCE=.48,_e.MAX_INDIVIDUAL_VARIANCE=.7,_e.START_END_PATTERN=Int32Array.from([1,1,1]),_e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),_e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),_e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])];class bt{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(e,t,n){let r=this.decodeRowStringBuffer,i=this.decodeMiddle(t,n,r),s=r.toString(),l=bt.parseExtensionString(s),c=[new R((n[0]+n[1])/2,e),new R(i,e)],u=new rt(s,null,0,c,de.UPC_EAN_EXTENSION,new Date().getTime());return l!=null&&u.putAllMetadata(l),u}decodeMiddle(e,t,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=e.getSize(),s=t[1],l=0;for(let u=0;u<5&&s=10&&(l|=1<<4-u),u!==4&&(s=e.getNextSet(s),s=e.getNextUnset(s))}if(n.length!==5)throw new F;let c=this.determineCheckDigit(l);if(bt.extensionChecksum(n.toString())!==c)throw new F;return s}static extensionChecksum(e){let t=e.length,n=0;for(let r=t-2;r>=0;r-=2)n+=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);n*=3;for(let r=t-1;r>=0;r-=2)n+=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);return n*=3,n%10}determineCheckDigit(e){for(let t=0;t<10;t++)if(e===this.CHECK_DIGIT_ENCODINGS[t])return t;throw new F}static parseExtensionString(e){if(e.length!==5)return null;let t=bt.parseExtension5String(e);return t==null?null:new Map([[Ye.SUGGESTED_PRICE,t]])}static parseExtension5String(e){let t;switch(e.charAt(0)){case"0":t="\xA3";break;case"5":t="$";break;case"9":switch(e){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}t="";break;default:t="";break}let n=parseInt(e.substring(1)),r=(n/100).toString(),i=n%100,s=i<10?"0"+i:i.toString();return t+r+"."+s}}class $n{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(e,t,n){let r=this.decodeRowStringBuffer,i=this.decodeMiddle(t,n,r),s=r.toString(),l=$n.parseExtensionString(s),c=[new R((n[0]+n[1])/2,e),new R(i,e)],u=new rt(s,null,0,c,de.UPC_EAN_EXTENSION,new Date().getTime());return l!=null&&u.putAllMetadata(l),u}decodeMiddle(e,t,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=e.getSize(),s=t[1],l=0;for(let c=0;c<2&&s=10&&(l|=1<<1-c),c!==1&&(s=e.getNextSet(s),s=e.getNextUnset(s))}if(n.length!==2)throw new F;if(parseInt(n.toString())%4!==l)throw new F;return s}static parseExtensionString(e){return e.length!==2?null:new Map([[Ye.ISSUE_NUMBER,parseInt(e)]])}}class Ls{static decodeRow(e,t,n){let r=_e.findGuardPattern(t,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new bt().decodeRow(e,t,r)}catch{return new $n().decodeRow(e,t,r)}}}Ls.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class Pe extends _e{constructor(){super(),this.decodeRowStringBuffer="",Pe.L_AND_G_PATTERNS=Pe.L_PATTERNS.map(e=>Int32Array.from(e));for(let e=10;e<20;e++){let t=Pe.L_PATTERNS[e-10],n=new Int32Array(t.length);for(let r=0;r=t.getSize()||!t.isRange(g,w,!1))throw new F;let E=c.toString();if(E.length<8)throw new G;if(!Pe.checkChecksum(E))throw new U;let I=(r[1]+r[0])/2,y=(u[1]+u[0])/2,N=this.getBarcodeFormat(),O=[new R(I,e),new R(y,e)],B=new rt(E,null,0,O,N,new Date().getTime()),X=0;try{let W=Ls.decodeRow(e,t,u[1]);B.putMetadata(Ye.UPC_EAN_EXTENSION,W.getText()),B.putAllMetadata(W.getResultMetadata()),B.addResultPoints(W.getResultPoints()),X=W.getText().length}catch{}let Z=n==null?null:n.get(me.ALLOWED_EAN_EXTENSIONS);if(Z!=null){let W=!1;for(let Me in Z)if(X.toString()===Me){W=!0;break}if(!W)throw new F}return N===de.EAN_13||de.UPC_A,B}static checkChecksum(e){return Pe.checkStandardUPCEANChecksum(e)}static checkStandardUPCEANChecksum(e){let t=e.length;if(t===0)return!1;let n=parseInt(e.charAt(t-1),10);return Pe.getStandardUPCEANChecksum(e.substring(0,t-1))===n}static getStandardUPCEANChecksum(e){let t=e.length,n=0;for(let r=t-1;r>=0;r-=2){let i=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(i<0||i>9)throw new G;n+=i}n*=3;for(let r=t-2;r>=0;r-=2){let i=e.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(i<0||i>9)throw new G;n+=i}return(1e3-n)%10}static decodeEnd(e,t){return Pe.findGuardPattern(e,t,!1,Pe.START_END_PATTERN,new Int32Array(Pe.START_END_PATTERN.length).fill(0))}}class Pn extends Pe{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(e,t,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=e.getSize(),s=t[1],l=0;for(let u=0;u<6&&s=10&&(l|=1<<5-u)}n=Pn.determineFirstDigit(n,l),s=Pe.findGuardPattern(e,s,!0,Pe.MIDDLE_PATTERN,new Int32Array(Pe.MIDDLE_PATTERN.length).fill(0))[1];for(let u=0;u<6&&sc);r[0]=0,r[1]=0,r[2]=0,r[3]=0;const i=e.getSize();let s=t[1],l=0;for(let c=0;c<6&&s=10&&(l|=1<<5-c)}return Qt.determineNumSysAndCheckDigit(new Ie(n),l),s}decodeEnd(e,t){return Qt.findGuardPatternWithoutCounters(e,t,!0,Qt.MIDDLE_END_PATTERN)}checkChecksum(e){return Pe.checkChecksum(Qt.convertUPCEtoUPCA(e))}static determineNumSysAndCheckDigit(e,t){for(let n=0;n<=1;n++)for(let r=0;r<10;r++)if(t===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[n][r]){e.insert(0,"0"+n),e.append("0"+r);return}throw F.getNotFoundInstance()}getBarcodeFormat(){return de.UPC_E}static convertUPCEtoUPCA(e){const t=e.slice(1,7).split("").map(i=>i.charCodeAt(0)),n=new Ie;n.append(e.charAt(0));let r=t[5];switch(r){case 0:case 1:case 2:n.appendChars(t,0,2),n.append(r),n.append("0000"),n.appendChars(t,2,3);break;case 3:n.appendChars(t,0,3),n.append("00000"),n.appendChars(t,3,2);break;case 4:n.appendChars(t,0,4),n.append("00000"),n.append(t[4]);break;default:n.appendChars(t,0,5),n.append("0000"),n.append(r);break}return e.length>=8&&n.append(e.charAt(7)),n.toString()}}Qt.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Qt.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])];class Ci extends Ze{constructor(e){super();let t=e==null?null:e.get(me.POSSIBLE_FORMATS),n=[];t!=null&&(t.indexOf(de.EAN_13)>-1?n.push(new Pn):t.indexOf(de.UPC_A)>-1&&n.push(new ka),t.indexOf(de.EAN_8)>-1&&n.push(new Bs),t.indexOf(de.UPC_E)>-1&&n.push(new Qt)),n.length===0&&(n.push(new Pn),n.push(new Bs),n.push(new Qt)),this.readers=n}decodeRow(e,t,n){for(let r of this.readers)try{const i=r.decodeRow(e,t,n),s=i.getBarcodeFormat()===de.EAN_13&&i.getText().charAt(0)==="0",l=n==null?null:n.get(me.POSSIBLE_FORMATS),c=l==null||l.includes(de.UPC_A);if(s&&c){const u=i.getRawBytes(),g=new rt(i.getText().substring(1),u,u.length,i.getResultPoints(),de.UPC_A);return g.putAllMetadata(i.getResultMetadata()),g}return i}catch{}throw new F}reset(){for(let e of this.readers)e.reset()}}class yt extends Ze{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(e,t){for(let n=0;nr&&(r=t[i],n=i);e[n]++}static decrement(e,t){let n=0,r=t[0];for(let i=1;i=yt.MIN_FINDER_PATTERN_RATIO&&r<=yt.MAX_FINDER_PATTERN_RATIO){let i=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(let l of e)l>s&&(s=l),l=l-c-1&&(g-=rn.combins(r-u-(l-c),l-c-2)),l-c-1>1){let w=0;for(let E=r-u-(l-c-2);E>t;E--)w+=rn.combins(r-u-E-1,l-c-3);g-=w*(l-1-c)}else r-u>t&&g--;i+=g}r-=u}return i}static combins(e,t){let n,r;e-t>t?(r=t,n=e-t):(r=e-t,n=t);let i=1,s=1;for(let l=e;l>n;l--)i*=l,s<=r&&(i/=s,s++);for(;s<=r;)i/=s,s++;return i}}class Ua{static buildBitArray(e){let t=e.length*2-1;e[e.length-1].getRightChar()==null&&(t-=1);let n=12*t,r=new Ee(n),i=0,l=e[0].getRightChar().getValue();for(let c=11;c>=0;--c)(l&1<=0;--w)(g&1<=0;--E)(w&1<10||n<0||n>10)throw new G;this.firstDigit=t,this.secondDigit=n}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return this.firstDigit*10+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===Vt.FNC1}isSecondDigitFNC1(){return this.secondDigit===Vt.FNC1}isAnyFNC1(){return this.firstDigit===Vt.FNC1||this.secondDigit===Vt.FNC1}}Vt.FNC1=10;class ee{constructor(){}static parseFieldsInGeneralPurpose(e){if(!e)return null;if(e.length<2)throw new F;let t=e.substring(0,2);for(let i of ee.TWO_DIGIT_DATA_LENGTH)if(i[0]===t)return i[1]===ee.VARIABLE_LENGTH?ee.processVariableAI(2,i[2],e):ee.processFixedAI(2,i[1],e);if(e.length<3)throw new F;let n=e.substring(0,3);for(let i of ee.THREE_DIGIT_DATA_LENGTH)if(i[0]===n)return i[1]===ee.VARIABLE_LENGTH?ee.processVariableAI(3,i[2],e):ee.processFixedAI(3,i[1],e);for(let i of ee.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(i[0]===n)return i[1]===ee.VARIABLE_LENGTH?ee.processVariableAI(4,i[2],e):ee.processFixedAI(4,i[1],e);if(e.length<4)throw new F;let r=e.substring(0,4);for(let i of ee.FOUR_DIGIT_DATA_LENGTH)if(i[0]===r)return i[1]===ee.VARIABLE_LENGTH?ee.processVariableAI(4,i[2],e):ee.processFixedAI(4,i[1],e);throw new F}static processFixedAI(e,t,n){if(n.lengththis.information.getSize())return e+4<=this.information.getSize();for(let t=e;tthis.information.getSize()){let i=this.extractNumericValueFromBitArray(e,4);return i===0?new Vt(this.information.getSize(),Vt.FNC1,Vt.FNC1):new Vt(this.information.getSize(),i-1,Vt.FNC1)}let t=this.extractNumericValueFromBitArray(e,7),n=(t-8)/11,r=(t-8)%11;return new Vt(e+7,n,r)}extractNumericValueFromBitArray(e,t){return tr.extractNumericValueFromBitArray(this.information,e,t)}static extractNumericValueFromBitArray(e,t,n){let r=0;for(let i=0;ithis.information.getSize())return!1;let t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+7>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<116)return!0;if(e+8>this.information.getSize())return!1;let r=this.extractNumericValueFromBitArray(e,8);return r>=232&&r<253}decodeIsoIec646(e){let t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new Rt(e+5,Rt.FNC1);if(t>=5&&t<15)return new Rt(e+5,"0"+(t-5));let n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<90)return new Rt(e+7,""+(n+1));if(n>=90&&n<116)return new Rt(e+7,""+(n+7));let r=this.extractNumericValueFromBitArray(e,8),i;switch(r){case 232:i="!";break;case 233:i='"';break;case 234:i="%";break;case 235:i="&";break;case 236:i="'";break;case 237:i="(";break;case 238:i=")";break;case 239:i="*";break;case 240:i="+";break;case 241:i=",";break;case 242:i="-";break;case 243:i=".";break;case 244:i="/";break;case 245:i=":";break;case 246:i=";";break;case 247:i="<";break;case 248:i="=";break;case 249:i=">";break;case 250:i="?";break;case 251:i="_";break;case 252:i=" ";break;default:throw new G}return new Rt(e+8,i)}isStillAlpha(e){if(e+5>this.information.getSize())return!1;let t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+6>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(e,6);return n>=16&&n<63}decodeAlphanumeric(e){let t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new Rt(e+5,Rt.FNC1);if(t>=5&&t<15)return new Rt(e+5,"0"+(t-5));let n=this.extractNumericValueFromBitArray(e,6);if(n>=32&&n<58)return new Rt(e+6,""+(n+33));let r;switch(n){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new _("Decoding invalid alphanumeric value: "+n)}return new Rt(e+6,r)}isAlphaTo646ToAlphaLatch(e){if(e+1>this.information.getSize())return!1;for(let t=0;t<5&&t+ethis.information.getSize())return!1;for(let t=e;tthis.information.getSize())return!1;for(let t=0;t<4&&t+e{t.forEach(s=>{r.getLeftChar().getValue()===s.getLeftChar().getValue()&&r.getRightChar().getValue()===s.getRightChar().getValue()&&r.getFinderPatter().getValue()===s.getFinderPatter().getValue()&&(n=!0)})}),n}}class z extends yt{constructor(e){super(...arguments),this.pairs=new Array(z.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=e===!0}decodeRow(e,t,n){this.pairs.length=0,this.startFromEven=!1;try{return z.constructResult(this.decodeRow2pairs(e,t))}catch(r){this.verbose&&console.log(r)}return this.pairs.length=0,this.startFromEven=!0,z.constructResult(this.decodeRow2pairs(e,t))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(e,t){let n=!1;for(;!n;)try{this.pairs.push(this.retrieveNextPair(t,this.pairs,e))}catch(i){if(i instanceof F){if(!this.pairs.length)throw new F;n=!0}}if(this.checkChecksum())return this.pairs;let r;if(this.rows.length?r=!0:r=!1,this.storeRow(e,!1),r){let i=this.checkRowsBoolean(!1);if(i!=null||(i=this.checkRowsBoolean(!0),i!=null))return i}throw new F}checkRowsBoolean(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&(this.rows=this.rows.reverse());let t=null;try{t=this.checkRows(new Array,0)}catch(n){this.verbose&&console.log(n)}return e&&(this.rows=this.rows.reverse()),t}checkRows(e,t){for(let n=t;nt.length)continue;let n=!0;for(let r=0;re){i=s.isEquivalent(this.pairs);break}r=s.isEquivalent(this.pairs),n++}i||r||z.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new Ii(this.pairs,e,t)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(e,t){for(let n of t)if(n.getPairs().length!==e.length){for(let r of n.getPairs())for(let i of e)if(Tn.equals(r,i))break}}static isPartialRow(e,t){for(let n of t){let r=!0;for(let i of e){let s=!1;for(let l of n.getPairs())if(i.equals(l)){s=!0;break}if(!s){r=!1;break}}if(r)return!0}return!1}getRows(){return this.rows}static constructResult(e){let t=Ua.buildBitArray(e),r=Va(t).parseInformation(),i=e[0].getFinderPattern().getResultPoints(),s=e[e.length-1].getFinderPattern().getResultPoints(),l=[i[0],i[1],s[0],s[1]];return new rt(r,null,null,l,de.RSS_EXPANDED,null)}checkChecksum(){let e=this.pairs.get(0),t=e.getLeftChar(),n=e.getRightChar();if(n==null)return!1;let r=n.getChecksumPortion(),i=2;for(let l=1;l=0?s=n:this.isEmptyPair(t)?s=0:s=t[t.length-1].getFinderPattern().getStartEnd()[1];let l=t.length%2!=0;this.startFromEven&&(l=!l);let c=!1;for(;s=0&&!e.get(u);)u--;u++,r=this.startEnd[0]-u,i=u,s=this.startEnd[1]}else i=this.startEnd[0],s=e.getNextUnset(this.startEnd[1]+1),r=s-this.startEnd[1];let l=this.getDecodeFinderCounters();K.arraycopy(l,0,l,1,l.length-1),l[0]=r;let c;try{c=this.parseFinderValue(l,z.FINDER_PATTERNS)}catch{return null}return new zr(c,[i,s],i,s,t)}decodeDataCharacter(e,t,n,r){let i=this.getDataCharacterCounters();for(let Qe=0;Qe.3)throw new F;let u=this.getOddCounts(),g=this.getEvenCounts(),w=this.getOddRoundingErrors(),E=this.getEvenRoundingErrors();for(let Qe=0;Qe8){if(Ct>8.7)throw new F;Ut=8}let ar=Qe/2;(Qe&1)==0?(u[ar]=Ut,w[ar]=Ct-Ut):(g[ar]=Ut,E[ar]=Ct-Ut)}this.adjustOddEvenCounts(s);let I=4*t.getValue()+(n?0:2)+(r?0:1)-1,y=0,N=0;for(let Qe=u.length-1;Qe>=0;Qe--){if(z.isNotA1left(t,n,r)){let Ct=z.WEIGHTS[I][2*Qe];N+=u[Qe]*Ct}y+=u[Qe]}let O=0;for(let Qe=g.length-1;Qe>=0;Qe--)if(z.isNotA1left(t,n,r)){let Ct=z.WEIGHTS[I][2*Qe+1];O+=g[Qe]*Ct}let B=N+O;if((y&1)!=0||y>13||y<4)throw new F;let X=(13-y)/2,Z=z.SYMBOL_WIDEST[X],W=9-Z,Me=rn.getRSSvalue(u,Z,!0),Ce=rn.getRSSvalue(g,W,!1),vt=z.EVEN_TOTAL_SUBSET[X],qt=z.GSUM[X],Pt=Me*vt+Ce+qt;return new er(Pt,B)}static isNotA1left(e,t,n){return!(e.getValue()==0&&t&&n)}adjustOddEvenCounts(e){let t=H.sum(new Int32Array(this.getOddCounts())),n=H.sum(new Int32Array(this.getEvenCounts())),r=!1,i=!1;t>13?i=!0:t<4&&(r=!0);let s=!1,l=!1;n>13?l=!0:n<4&&(s=!0);let c=t+n-e,u=(t&1)==1,g=(n&1)==0;if(c==1)if(u){if(g)throw new F;i=!0}else{if(!g)throw new F;l=!0}else if(c==-1)if(u){if(g)throw new F;r=!0}else{if(!g)throw new F;s=!0}else if(c==0){if(u){if(!g)throw new F;t1){for(let l of this.possibleRightPairs)if(l.getCount()>1&&at.checkChecksum(s,l))return at.constructResult(s,l)}throw new F}static addOrTally(e,t){if(t==null)return;let n=!1;for(let r of e)if(r.getValue()===t.getValue()){r.incrementCount(),n=!0;break}n||e.push(t)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(e,t){let n=4537077*e.getValue()+t.getValue(),r=new String(n).toString(),i=new Ie;for(let u=13-r.length;u>0;u--)i.append("0");i.append(r);let s=0;for(let u=0;u<13;u++){let g=i.charAt(u).charCodeAt(0)-"0".charCodeAt(0);s+=(u&1)===0?3*g:g}s=10-s%10,s===10&&(s=0),i.append(s.toString());let l=e.getFinderPattern().getResultPoints(),c=t.getFinderPattern().getResultPoints();return new rt(i.toString(),null,0,[l[0],l[1],c[0],c[1]],de.RSS_14,new Date().getTime())}static checkChecksum(e,t){let n=(e.getChecksumPortion()+16*t.getChecksumPortion())%79,r=9*e.getFinderPattern().getValue()+t.getFinderPattern().getValue();return r>72&&r--,r>8&&r--,n===r}decodePair(e,t,n,r){try{let i=this.findFinderPattern(e,t),s=this.parseFoundFinderPattern(e,n,t,i),l=r==null?null:r.get(me.NEED_RESULT_POINT_CALLBACK);if(l!=null){let g=(i[0]+i[1])/2;t&&(g=e.getSize()-1-g),l.foundPossibleResultPoint(new R(g,n))}let c=this.decodeDataCharacter(e,s,!0),u=this.decodeDataCharacter(e,s,!1);return new za(1597*c.getValue()+u.getValue(),c.getChecksumPortion()+4*u.getChecksumPortion(),s)}catch{return null}}decodeDataCharacter(e,t,n){let r=this.getDataCharacterCounters();for(let O=0;O8&&(X=8);let Z=Math.floor(O/2);(O&1)===0?(l[Z]=X,u[Z]=B-X):(c[Z]=X,g[Z]=B-X)}this.adjustOddEvenCounts(n,i);let w=0,E=0;for(let O=l.length-1;O>=0;O--)E*=9,E+=l[O],w+=l[O];let I=0,y=0;for(let O=c.length-1;O>=0;O--)I*=9,I+=c[O],y+=c[O];let N=E+3*I;if(n){if((w&1)!==0||w>12||w<4)throw new F;let O=(12-w)/2,B=at.OUTSIDE_ODD_WIDEST[O],X=9-B,Z=rn.getRSSvalue(l,B,!1),W=rn.getRSSvalue(c,X,!0),Me=at.OUTSIDE_EVEN_TOTAL_SUBSET[O],Ce=at.OUTSIDE_GSUM[O];return new er(Z*Me+W+Ce,N)}else{if((y&1)!==0||y>10||y<4)throw new F;let O=(10-y)/2,B=at.INSIDE_ODD_WIDEST[O],X=9-B,Z=rn.getRSSvalue(l,B,!0),W=rn.getRSSvalue(c,X,!1),Me=at.INSIDE_ODD_TOTAL_SUBSET[O],Ce=at.INSIDE_GSUM[O];return new er(W*Me+Z+Ce,N)}}findFinderPattern(e,t){let n=this.getDecodeFinderCounters();n[0]=0,n[1]=0,n[2]=0,n[3]=0;let r=e.getSize(),i=!1,s=0;for(;s=0&&i!==e.get(s);)s--;s++;const l=r[0]-s,c=this.getDecodeFinderCounters(),u=new Int32Array(c.length);K.arraycopy(c,0,u,1,c.length-1),u[0]=l;const g=this.parseFinderValue(u,at.FINDER_PATTERNS);let w=s,E=r[1];return n&&(w=e.getSize()-1-w,E=e.getSize()-1-E),new zr(g,[s,r[1]],w,E,t)}adjustOddEvenCounts(e,t){let n=H.sum(new Int32Array(this.getOddCounts())),r=H.sum(new Int32Array(this.getEvenCounts())),i=!1,s=!1,l=!1,c=!1;e?(n>12?s=!0:n<4&&(i=!0),r>12?c=!0:r<4&&(l=!0)):(n>11?s=!0:n<5&&(i=!0),r>10?c=!0:r<4&&(l=!0));let u=n+r-t,g=(n&1)===(e?1:0),w=(r&1)===1;if(u===1)if(g){if(w)throw new F;s=!0}else{if(!w)throw new F;c=!0}else if(u===-1)if(g){if(w)throw new F;i=!0}else{if(!w)throw new F;l=!0}else if(u===0){if(g){if(!w)throw new F;ne.reset())}}class Wa extends Dt{constructor(e=500,t){super(new rr(t),e,t)}}class Ve{constructor(e,t,n){this.ecCodewords=e,this.ecBlocks=[t],n&&this.ecBlocks.push(n)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class Fe{constructor(e,t){this.count=e,this.dataCodewords=t}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class De{constructor(e,t,n,r,i,s){this.versionNumber=e,this.symbolSizeRows=t,this.symbolSizeColumns=n,this.dataRegionSizeRows=r,this.dataRegionSizeColumns=i,this.ecBlocks=s;let l=0;const c=s.getECCodewords(),u=s.getECBlocks();for(let g of u)l+=g.getCount()*(g.getDataCodewords()+c);this.totalCodewords=l}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(e,t){if((e&1)!==0||(t&1)!==0)throw new G;for(let n of De.VERSIONS)if(n.symbolSizeRows===e&&n.symbolSizeColumns===t)return n;throw new G}toString(){return""+this.versionNumber}static buildVersions(){return[new De(1,10,10,8,8,new Ve(5,new Fe(1,3))),new De(2,12,12,10,10,new Ve(7,new Fe(1,5))),new De(3,14,14,12,12,new Ve(10,new Fe(1,8))),new De(4,16,16,14,14,new Ve(12,new Fe(1,12))),new De(5,18,18,16,16,new Ve(14,new Fe(1,18))),new De(6,20,20,18,18,new Ve(18,new Fe(1,22))),new De(7,22,22,20,20,new Ve(20,new Fe(1,30))),new De(8,24,24,22,22,new Ve(24,new Fe(1,36))),new De(9,26,26,24,24,new Ve(28,new Fe(1,44))),new De(10,32,32,14,14,new Ve(36,new Fe(1,62))),new De(11,36,36,16,16,new Ve(42,new Fe(1,86))),new De(12,40,40,18,18,new Ve(48,new Fe(1,114))),new De(13,44,44,20,20,new Ve(56,new Fe(1,144))),new De(14,48,48,22,22,new Ve(68,new Fe(1,174))),new De(15,52,52,24,24,new Ve(42,new Fe(2,102))),new De(16,64,64,14,14,new Ve(56,new Fe(2,140))),new De(17,72,72,16,16,new Ve(36,new Fe(4,92))),new De(18,80,80,18,18,new Ve(48,new Fe(4,114))),new De(19,88,88,20,20,new Ve(56,new Fe(4,144))),new De(20,96,96,22,22,new Ve(68,new Fe(4,174))),new De(21,104,104,24,24,new Ve(56,new Fe(6,136))),new De(22,120,120,18,18,new Ve(68,new Fe(6,175))),new De(23,132,132,20,20,new Ve(62,new Fe(8,163))),new De(24,144,144,22,22,new Ve(62,new Fe(8,156),new Fe(2,155))),new De(25,8,18,6,16,new Ve(7,new Fe(1,5))),new De(26,8,32,6,14,new Ve(11,new Fe(1,10))),new De(27,12,26,10,24,new Ve(14,new Fe(1,16))),new De(28,12,36,10,16,new Ve(18,new Fe(1,22))),new De(29,16,36,14,16,new Ve(24,new Fe(1,32))),new De(30,16,48,14,22,new Ve(28,new Fe(1,49)))]}}De.VERSIONS=De.buildVersions();class Ti{constructor(e){const t=e.getHeight();if(t<8||t>144||(t&1)!==0)throw new G;this.version=Ti.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new et(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(e){const t=e.getHeight(),n=e.getWidth();return De.getVersionForDimensions(t,n)}readCodewords(){const e=new Int8Array(this.version.getTotalCodewords());let t=0,n=4,r=0;const i=this.mappingBitMatrix.getHeight(),s=this.mappingBitMatrix.getWidth();let l=!1,c=!1,u=!1,g=!1;do if(n===i&&r===0&&!l)e[t++]=this.readCorner1(i,s)&255,n-=2,r+=2,l=!0;else if(n===i-2&&r===0&&(s&3)!==0&&!c)e[t++]=this.readCorner2(i,s)&255,n-=2,r+=2,c=!0;else if(n===i+4&&r===2&&(s&7)===0&&!u)e[t++]=this.readCorner3(i,s)&255,n-=2,r+=2,u=!0;else if(n===i-2&&r===0&&(s&7)===4&&!g)e[t++]=this.readCorner4(i,s)&255,n-=2,r+=2,g=!0;else{do n=0&&!this.readMappingMatrix.get(r,n)&&(e[t++]=this.readUtah(n,r,i,s)&255),n-=2,r+=2;while(n>=0&&r=0&&r=0);n+=3,r+=1}while(n7?N-1:N;s[B].codewords[X]=e[w++]}if(w!==e.length)throw new M;return s}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class bi{constructor(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(e){if(e<1||e>32||e>this.available())throw new M(""+e);let t=0,n=this.bitOffset,r=this.byteOffset;const i=this.bytes;if(n>0){const s=8-n,l=e>8-l<>c,e-=l,n+=l,n===8&&(n=0,r++)}if(e>0){for(;e>=8;)t=t<<8|i[r]&255,r++,e-=8;if(e>0){const s=8-e,l=255>>s<>s,n+=e}}return this.bitOffset=n,this.byteOffset=r,t}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var dt;(function(A){A[A.PAD_ENCODE=0]="PAD_ENCODE",A[A.ASCII_ENCODE=1]="ASCII_ENCODE",A[A.C40_ENCODE=2]="C40_ENCODE",A[A.TEXT_ENCODE=3]="TEXT_ENCODE",A[A.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",A[A.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",A[A.BASE256_ENCODE=6]="BASE256_ENCODE"})(dt||(dt={}));class Sn{static decode(e){const t=new bi(e),n=new Ie,r=new Ie,i=new Array;let s=dt.ASCII_ENCODE;do if(s===dt.ASCII_ENCODE)s=this.decodeAsciiSegment(t,n,r);else{switch(s){case dt.C40_ENCODE:this.decodeC40Segment(t,n);break;case dt.TEXT_ENCODE:this.decodeTextSegment(t,n);break;case dt.ANSIX12_ENCODE:this.decodeAnsiX12Segment(t,n);break;case dt.EDIFACT_ENCODE:this.decodeEdifactSegment(t,n);break;case dt.BASE256_ENCODE:this.decodeBase256Segment(t,n,i);break;default:throw new G}s=dt.ASCII_ENCODE}while(s!==dt.PAD_ENCODE&&t.available()>0);return r.length()>0&&n.append(r.toString()),new nn(e,n.toString(),i.length===0?null:i,null)}static decodeAsciiSegment(e,t,n){let r=!1;do{let i=e.readBits(8);if(i===0)throw new G;if(i<=128)return r&&(i+=128),t.append(String.fromCharCode(i-1)),dt.ASCII_ENCODE;if(i===129)return dt.PAD_ENCODE;if(i<=229){const s=i-130;s<10&&t.append("0"),t.append(""+s)}else switch(i){case 230:return dt.C40_ENCODE;case 231:return dt.BASE256_ENCODE;case 232:t.append(String.fromCharCode(29));break;case 233:case 234:break;case 235:r=!0;break;case 236:t.append("[)>05"),n.insert(0,"");break;case 237:t.append("[)>06"),n.insert(0,"");break;case 238:return dt.ANSIX12_ENCODE;case 239:return dt.TEXT_ENCODE;case 240:return dt.EDIFACT_ENCODE;case 241:break;default:if(i!==254||e.available()!==0)throw new G;break}}while(e.available()>0);return dt.ASCII_ENCODE}static decodeC40Segment(e,t){let n=!1;const r=[];let i=0;do{if(e.available()===8)return;const s=e.readBits(8);if(s===254)return;this.parseTwoBytes(s,e.readBits(8),r);for(let l=0;l<3;l++){const c=r[l];switch(i){case 0:if(c<3)i=c+1;else if(c0)}static decodeTextSegment(e,t){let n=!1,r=[],i=0;do{if(e.available()===8)return;const s=e.readBits(8);if(s===254)return;this.parseTwoBytes(s,e.readBits(8),r);for(let l=0;l<3;l++){const c=r[l];switch(i){case 0:if(c<3)i=c+1;else if(c0)}static decodeAnsiX12Segment(e,t){const n=[];do{if(e.available()===8)return;const r=e.readBits(8);if(r===254)return;this.parseTwoBytes(r,e.readBits(8),n);for(let i=0;i<3;i++){const s=n[i];switch(s){case 0:t.append("\r");break;case 1:t.append("*");break;case 2:t.append(">");break;case 3:t.append(" ");break;default:if(s<14)t.append(String.fromCharCode(s+44));else if(s<40)t.append(String.fromCharCode(s+51));else throw new G;break}}}while(e.available()>0)}static parseTwoBytes(e,t,n){let r=(e<<8)+t-1,i=Math.floor(r/1600);n[0]=i,r-=i*1600,i=Math.floor(r/40),n[1]=i,n[2]=r-i*40}static decodeEdifactSegment(e,t){do{if(e.available()<=16)return;for(let n=0;n<4;n++){let r=e.readBits(6);if(r===31){const i=8-e.getBitOffset();i!==8&&e.readBits(i);return}(r&32)===0&&(r|=64),t.append(String.fromCharCode(r))}}while(e.available()>0)}static decodeBase256Segment(e,t,n){let r=1+e.getByteOffset();const i=this.unrandomize255State(e.readBits(8),r++);let s;if(i===0?s=e.available()/8|0:i<250?s=i:s=250*(i-249)+this.unrandomize255State(e.readBits(8),r++),s<0)throw new G;const l=new Uint8Array(s);for(let c=0;c=0?r:r+256}}Sn.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Sn.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],Sn.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],Sn.TEXT_SHIFT2_SET_CHARS=Sn.C40_SHIFT2_SET_CHARS,Sn.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)];class Ya{constructor(){this.rsDecoder=new v(Oe.DATA_MATRIX_FIELD_256)}decode(e){const t=new Ti(e),n=t.getVersion(),r=t.readCodewords(),i=Si.getDataBlocks(r,n);let s=0;for(let u of i)s+=u.getNumDataCodewords();const l=new Uint8Array(s),c=i.length;for(let u=0;ul&&(g=l,w[0]=t,w[1]=n,w[2]=r,w[3]=i),g>c&&(g=c,w[0]=n,w[1]=r,w[2]=i,w[3]=t),g>u&&(w[0]=r,w[1]=i,w[2]=t,w[3]=n),w}detectSolid2(e){let t=e[0],n=e[1],r=e[2],i=e[3],s=this.transitionsBetween(t,i),l=ht.shiftPoint(n,r,(s+1)*4),c=ht.shiftPoint(r,n,(s+1)*4),u=this.transitionsBetween(l,t),g=this.transitionsBetween(c,i);return uI?g:w}shiftToModuleCenter(e){let t=e[0],n=e[1],r=e[2],i=e[3],s=this.transitionsBetween(t,i)+1,l=this.transitionsBetween(r,i)+1,c=ht.shiftPoint(t,n,l*4),u=ht.shiftPoint(r,n,s*4);s=this.transitionsBetween(c,i)+1,l=this.transitionsBetween(u,i)+1,(s&1)===1&&(s+=1),(l&1)===1&&(l+=1);let g=(t.getX()+n.getX()+r.getX()+i.getX())/4,w=(t.getY()+n.getY()+r.getY()+i.getY())/4;t=ht.moveAway(t,g,w),n=ht.moveAway(n,g,w),r=ht.moveAway(r,g,w),i=ht.moveAway(i,g,w);let E,I;return c=ht.shiftPoint(t,n,l*4),c=ht.shiftPoint(c,i,s*4),E=ht.shiftPoint(n,t,l*4),E=ht.shiftPoint(E,r,s*4),u=ht.shiftPoint(r,i,l*4),u=ht.shiftPoint(u,n,s*4),I=ht.shiftPoint(i,r,l*4),I=ht.shiftPoint(I,t,s*4),[c,E,u,I]}isValid(e){return e.getX()>=0&&e.getX()0&&e.getY()Math.abs(i-n);if(l){let N=n;n=r,r=N,N=i,i=s,s=N}let c=Math.abs(i-n),u=Math.abs(s-r),g=-c/2,w=r0){if(O===s)break;O+=w,g-=c}}return I}}class bn{constructor(){this.decoder=new Ya}decode(e,t=null){let n,r;if(t!=null&&t.has(me.PURE_BARCODE)){const u=bn.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(u),r=bn.NO_POINTS}else{const u=new ht(e.getBlackMatrix()).detect();n=this.decoder.decode(u.getBits()),r=u.getPoints()}const i=n.getRawBytes(),s=new rt(n.getText(),i,8*i.length,r,de.DATA_MATRIX,K.currentTimeMillis()),l=n.getByteSegments();l!=null&&s.putMetadata(Ye.BYTE_SEGMENTS,l);const c=n.getECLevel();return c!=null&&s.putMetadata(Ye.ERROR_CORRECTION_LEVEL,c),s}reset(){}static extractPureBits(e){const t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(t==null||n==null)throw new F;const r=this.moduleSize(t,e);let i=t[1];const s=n[1];let l=t[0];const u=(n[0]-l+1)/r,g=(s-i+1)/r;if(u<=0||g<=0)throw new F;const w=r/2;i+=w,l+=w;const E=new et(u,g);for(let I=0;I=qe.FOR_BITS.size)throw new M;return qe.FOR_BITS.get(e)}}qe.FOR_BITS=new Map,qe.FOR_VALUE=new Map,qe.L=new qe(ir.L,"L",1),qe.M=new qe(ir.M,"M",0),qe.Q=new qe(ir.Q,"Q",3),qe.H=new qe(ir.H,"H",2);class Nt{constructor(e){this.errorCorrectionLevel=qe.forBits(e>>3&3),this.dataMask=e&7}static numBitsDiffering(e,t){return se.bitCount(e^t)}static decodeFormatInformation(e,t){const n=Nt.doDecodeFormatInformation(e,t);return n!==null?n:Nt.doDecodeFormatInformation(e^Nt.FORMAT_INFO_MASK_QR,t^Nt.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(e,t){let n=Number.MAX_SAFE_INTEGER,r=0;for(const i of Nt.FORMAT_INFO_DECODE_LOOKUP){const s=i[0];if(s===e||s===t)return new Nt(i[1]);let l=Nt.numBitsDiffering(e,s);l40)throw new M;return ce.VERSIONS[e-1]}static decodeVersionInformation(e){let t=Number.MAX_SAFE_INTEGER,n=0;for(let r=0;r6&&(t.setRegion(e-11,0,3,6),t.setRegion(0,e-11,6,3)),t}toString(){return""+this.versionNumber}}ce.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),ce.VERSIONS=[new ce(1,new Int32Array(0),new D(7,new C(1,19)),new D(10,new C(1,16)),new D(13,new C(1,13)),new D(17,new C(1,9))),new ce(2,Int32Array.from([6,18]),new D(10,new C(1,34)),new D(16,new C(1,28)),new D(22,new C(1,22)),new D(28,new C(1,16))),new ce(3,Int32Array.from([6,22]),new D(15,new C(1,55)),new D(26,new C(1,44)),new D(18,new C(2,17)),new D(22,new C(2,13))),new ce(4,Int32Array.from([6,26]),new D(20,new C(1,80)),new D(18,new C(2,32)),new D(26,new C(2,24)),new D(16,new C(4,9))),new ce(5,Int32Array.from([6,30]),new D(26,new C(1,108)),new D(24,new C(2,43)),new D(18,new C(2,15),new C(2,16)),new D(22,new C(2,11),new C(2,12))),new ce(6,Int32Array.from([6,34]),new D(18,new C(2,68)),new D(16,new C(4,27)),new D(24,new C(4,19)),new D(28,new C(4,15))),new ce(7,Int32Array.from([6,22,38]),new D(20,new C(2,78)),new D(18,new C(4,31)),new D(18,new C(2,14),new C(4,15)),new D(26,new C(4,13),new C(1,14))),new ce(8,Int32Array.from([6,24,42]),new D(24,new C(2,97)),new D(22,new C(2,38),new C(2,39)),new D(22,new C(4,18),new C(2,19)),new D(26,new C(4,14),new C(2,15))),new ce(9,Int32Array.from([6,26,46]),new D(30,new C(2,116)),new D(22,new C(3,36),new C(2,37)),new D(20,new C(4,16),new C(4,17)),new D(24,new C(4,12),new C(4,13))),new ce(10,Int32Array.from([6,28,50]),new D(18,new C(2,68),new C(2,69)),new D(26,new C(4,43),new C(1,44)),new D(24,new C(6,19),new C(2,20)),new D(28,new C(6,15),new C(2,16))),new ce(11,Int32Array.from([6,30,54]),new D(20,new C(4,81)),new D(30,new C(1,50),new C(4,51)),new D(28,new C(4,22),new C(4,23)),new D(24,new C(3,12),new C(8,13))),new ce(12,Int32Array.from([6,32,58]),new D(24,new C(2,92),new C(2,93)),new D(22,new C(6,36),new C(2,37)),new D(26,new C(4,20),new C(6,21)),new D(28,new C(7,14),new C(4,15))),new ce(13,Int32Array.from([6,34,62]),new D(26,new C(4,107)),new D(22,new C(8,37),new C(1,38)),new D(24,new C(8,20),new C(4,21)),new D(22,new C(12,11),new C(4,12))),new ce(14,Int32Array.from([6,26,46,66]),new D(30,new C(3,115),new C(1,116)),new D(24,new C(4,40),new C(5,41)),new D(20,new C(11,16),new C(5,17)),new D(24,new C(11,12),new C(5,13))),new ce(15,Int32Array.from([6,26,48,70]),new D(22,new C(5,87),new C(1,88)),new D(24,new C(5,41),new C(5,42)),new D(30,new C(5,24),new C(7,25)),new D(24,new C(11,12),new C(7,13))),new ce(16,Int32Array.from([6,26,50,74]),new D(24,new C(5,98),new C(1,99)),new D(28,new C(7,45),new C(3,46)),new D(24,new C(15,19),new C(2,20)),new D(30,new C(3,15),new C(13,16))),new ce(17,Int32Array.from([6,30,54,78]),new D(28,new C(1,107),new C(5,108)),new D(28,new C(10,46),new C(1,47)),new D(28,new C(1,22),new C(15,23)),new D(28,new C(2,14),new C(17,15))),new ce(18,Int32Array.from([6,30,56,82]),new D(30,new C(5,120),new C(1,121)),new D(26,new C(9,43),new C(4,44)),new D(28,new C(17,22),new C(1,23)),new D(28,new C(2,14),new C(19,15))),new ce(19,Int32Array.from([6,30,58,86]),new D(28,new C(3,113),new C(4,114)),new D(26,new C(3,44),new C(11,45)),new D(26,new C(17,21),new C(4,22)),new D(26,new C(9,13),new C(16,14))),new ce(20,Int32Array.from([6,34,62,90]),new D(28,new C(3,107),new C(5,108)),new D(26,new C(3,41),new C(13,42)),new D(30,new C(15,24),new C(5,25)),new D(28,new C(15,15),new C(10,16))),new ce(21,Int32Array.from([6,28,50,72,94]),new D(28,new C(4,116),new C(4,117)),new D(26,new C(17,42)),new D(28,new C(17,22),new C(6,23)),new D(30,new C(19,16),new C(6,17))),new ce(22,Int32Array.from([6,26,50,74,98]),new D(28,new C(2,111),new C(7,112)),new D(28,new C(17,46)),new D(30,new C(7,24),new C(16,25)),new D(24,new C(34,13))),new ce(23,Int32Array.from([6,30,54,78,102]),new D(30,new C(4,121),new C(5,122)),new D(28,new C(4,47),new C(14,48)),new D(30,new C(11,24),new C(14,25)),new D(30,new C(16,15),new C(14,16))),new ce(24,Int32Array.from([6,28,54,80,106]),new D(30,new C(6,117),new C(4,118)),new D(28,new C(6,45),new C(14,46)),new D(30,new C(11,24),new C(16,25)),new D(30,new C(30,16),new C(2,17))),new ce(25,Int32Array.from([6,32,58,84,110]),new D(26,new C(8,106),new C(4,107)),new D(28,new C(8,47),new C(13,48)),new D(30,new C(7,24),new C(22,25)),new D(30,new C(22,15),new C(13,16))),new ce(26,Int32Array.from([6,30,58,86,114]),new D(28,new C(10,114),new C(2,115)),new D(28,new C(19,46),new C(4,47)),new D(28,new C(28,22),new C(6,23)),new D(30,new C(33,16),new C(4,17))),new ce(27,Int32Array.from([6,34,62,90,118]),new D(30,new C(8,122),new C(4,123)),new D(28,new C(22,45),new C(3,46)),new D(30,new C(8,23),new C(26,24)),new D(30,new C(12,15),new C(28,16))),new ce(28,Int32Array.from([6,26,50,74,98,122]),new D(30,new C(3,117),new C(10,118)),new D(28,new C(3,45),new C(23,46)),new D(30,new C(4,24),new C(31,25)),new D(30,new C(11,15),new C(31,16))),new ce(29,Int32Array.from([6,30,54,78,102,126]),new D(30,new C(7,116),new C(7,117)),new D(28,new C(21,45),new C(7,46)),new D(30,new C(1,23),new C(37,24)),new D(30,new C(19,15),new C(26,16))),new ce(30,Int32Array.from([6,26,52,78,104,130]),new D(30,new C(5,115),new C(10,116)),new D(28,new C(19,47),new C(10,48)),new D(30,new C(15,24),new C(25,25)),new D(30,new C(23,15),new C(25,16))),new ce(31,Int32Array.from([6,30,56,82,108,134]),new D(30,new C(13,115),new C(3,116)),new D(28,new C(2,46),new C(29,47)),new D(30,new C(42,24),new C(1,25)),new D(30,new C(23,15),new C(28,16))),new ce(32,Int32Array.from([6,34,60,86,112,138]),new D(30,new C(17,115)),new D(28,new C(10,46),new C(23,47)),new D(30,new C(10,24),new C(35,25)),new D(30,new C(19,15),new C(35,16))),new ce(33,Int32Array.from([6,30,58,86,114,142]),new D(30,new C(17,115),new C(1,116)),new D(28,new C(14,46),new C(21,47)),new D(30,new C(29,24),new C(19,25)),new D(30,new C(11,15),new C(46,16))),new ce(34,Int32Array.from([6,34,62,90,118,146]),new D(30,new C(13,115),new C(6,116)),new D(28,new C(14,46),new C(23,47)),new D(30,new C(44,24),new C(7,25)),new D(30,new C(59,16),new C(1,17))),new ce(35,Int32Array.from([6,30,54,78,102,126,150]),new D(30,new C(12,121),new C(7,122)),new D(28,new C(12,47),new C(26,48)),new D(30,new C(39,24),new C(14,25)),new D(30,new C(22,15),new C(41,16))),new ce(36,Int32Array.from([6,24,50,76,102,128,154]),new D(30,new C(6,121),new C(14,122)),new D(28,new C(6,47),new C(34,48)),new D(30,new C(46,24),new C(10,25)),new D(30,new C(2,15),new C(64,16))),new ce(37,Int32Array.from([6,28,54,80,106,132,158]),new D(30,new C(17,122),new C(4,123)),new D(28,new C(29,46),new C(14,47)),new D(30,new C(49,24),new C(10,25)),new D(30,new C(24,15),new C(46,16))),new ce(38,Int32Array.from([6,32,58,84,110,136,162]),new D(30,new C(4,122),new C(18,123)),new D(28,new C(13,46),new C(32,47)),new D(30,new C(48,24),new C(14,25)),new D(30,new C(42,15),new C(32,16))),new ce(39,Int32Array.from([6,26,54,82,110,138,166]),new D(30,new C(20,117),new C(4,118)),new D(28,new C(40,47),new C(7,48)),new D(30,new C(43,24),new C(22,25)),new D(30,new C(10,15),new C(67,16))),new ce(40,Int32Array.from([6,30,58,86,114,142,170]),new D(30,new C(19,118),new C(6,119)),new D(28,new C(18,47),new C(31,48)),new D(30,new C(34,24),new C(34,25)),new D(30,new C(20,15),new C(61,16)))];var At;(function(A){A[A.DATA_MASK_000=0]="DATA_MASK_000",A[A.DATA_MASK_001=1]="DATA_MASK_001",A[A.DATA_MASK_010=2]="DATA_MASK_010",A[A.DATA_MASK_011=3]="DATA_MASK_011",A[A.DATA_MASK_100=4]="DATA_MASK_100",A[A.DATA_MASK_101=5]="DATA_MASK_101",A[A.DATA_MASK_110=6]="DATA_MASK_110",A[A.DATA_MASK_111=7]="DATA_MASK_111"})(At||(At={}));class zt{constructor(e,t){this.value=e,this.isMasked=t}unmaskBitMatrix(e,t){for(let n=0;n(A+e&1)===0)],[At.DATA_MASK_001,new zt(At.DATA_MASK_001,(A,e)=>(A&1)===0)],[At.DATA_MASK_010,new zt(At.DATA_MASK_010,(A,e)=>e%3===0)],[At.DATA_MASK_011,new zt(At.DATA_MASK_011,(A,e)=>(A+e)%3===0)],[At.DATA_MASK_100,new zt(At.DATA_MASK_100,(A,e)=>(Math.floor(A/2)+Math.floor(e/3)&1)===0)],[At.DATA_MASK_101,new zt(At.DATA_MASK_101,(A,e)=>A*e%6===0)],[At.DATA_MASK_110,new zt(At.DATA_MASK_110,(A,e)=>A*e%6<3)],[At.DATA_MASK_111,new zt(At.DATA_MASK_111,(A,e)=>(A+e+A*e%3&1)===0)]]);class Xa{constructor(e){const t=e.getHeight();if(t<21||(t&3)!==1)throw new G;this.bitMatrix=e}readFormatInformation(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;let e=0;for(let i=0;i<6;i++)e=this.copyBit(i,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(let i=5;i>=0;i--)e=this.copyBit(8,i,e);const t=this.bitMatrix.getHeight();let n=0;const r=t-7;for(let i=t-1;i>=r;i--)n=this.copyBit(8,i,n);for(let i=t-8;i=0;s--)for(let l=e-9;l>=r;l--)n=this.copyBit(l,s,n);let i=ce.decodeVersionInformation(n);if(i!==null&&i.getDimensionForVersion()===e)return this.parsedVersion=i,i;n=0;for(let s=5;s>=0;s--)for(let l=e-9;l>=r;l--)n=this.copyBit(s,l,n);if(i=ce.decodeVersionInformation(n),i!==null&&i.getDimensionForVersion()===e)return this.parsedVersion=i,i;throw new G}copyBit(e,t,n){return(this.isMirror?this.bitMatrix.get(t,e):this.bitMatrix.get(e,t))?n<<1|1:n<<1}readCodewords(){const e=this.readFormatInformation(),t=this.readVersion(),n=zt.values.get(e.getDataMask()),r=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,r);const i=t.buildFunctionPattern();let s=!0;const l=new Uint8Array(t.getTotalCodewords());let c=0,u=0,g=0;for(let w=r-1;w>0;w-=2){w===6&&w--;for(let E=0;E=0&&l[g].codewords.length!==u;)g--;g++;const w=u-r.getECCodewordsPerBlock();let E=0;for(let y=0;ye.available())throw new G;const r=new Uint8Array(2*n);let i=0;for(;n>0;){const s=e.readBits(13);let l=s/96<<8&4294967295|s%96;l<959?l+=41377:l+=42657,r[i]=l>>8&255,r[i+1]=l&255,i+=2,n--}try{t.append(ze.decode(r,le.GB2312))}catch(s){throw new G(s)}}static decodeKanjiSegment(e,t,n){if(n*13>e.available())throw new G;const r=new Uint8Array(2*n);let i=0;for(;n>0;){const s=e.readBits(13);let l=s/192<<8&4294967295|s%192;l<7936?l+=33088:l+=49472,r[i]=l>>8,r[i+1]=l,i+=2,n--}try{t.append(ze.decode(r,le.SHIFT_JIS))}catch(s){throw new G(s)}}static decodeByteSegment(e,t,n,r,i,s){if(8*n>e.available())throw new G;const l=new Uint8Array(n);for(let u=0;u=st.ALPHANUMERIC_CHARS.length)throw new G;return st.ALPHANUMERIC_CHARS[e]}static decodeAlphanumericSegment(e,t,n,r){const i=t.length();for(;n>1;){if(e.available()<11)throw new G;const s=e.readBits(11);t.append(st.toAlphaNumericChar(Math.floor(s/45))),t.append(st.toAlphaNumericChar(s%45)),n-=2}if(n===1){if(e.available()<6)throw new G;t.append(st.toAlphaNumericChar(e.readBits(6)))}if(r)for(let s=i;s=3;){if(e.available()<10)throw new G;const r=e.readBits(10);if(r>=1e3)throw new G;t.append(st.toAlphaNumericChar(Math.floor(r/100))),t.append(st.toAlphaNumericChar(Math.floor(r/10)%10)),t.append(st.toAlphaNumericChar(r%10)),n-=3}if(n===2){if(e.available()<7)throw new G;const r=e.readBits(7);if(r>=100)throw new G;t.append(st.toAlphaNumericChar(Math.floor(r/10))),t.append(st.toAlphaNumericChar(r%10))}else if(n===1){if(e.available()<4)throw new G;const r=e.readBits(4);if(r>=10)throw new G;t.append(st.toAlphaNumericChar(r))}}static parseECIValue(e){const t=e.readBits(8);if((t&128)===0)return t&127;if((t&192)===128){const n=e.readBits(8);return(t&63)<<8&4294967295|n}if((t&224)===192){const n=e.readBits(16);return(t&31)<<16&4294967295|n}throw new G}}st.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",st.GB2312_SUBSET=1;class Ps{constructor(e){this.mirrored=e}isMirrored(){return this.mirrored}applyMirroredCorrection(e){if(!this.mirrored||e===null||e.length<3)return;const t=e[0];e[0]=e[2],e[2]=t}}class Za{constructor(){this.rsDecoder=new v(Oe.QR_CODE_FIELD_256)}decodeBooleanArray(e,t){return this.decodeBitMatrix(et.parseFromBooleanArray(e),t)}decodeBitMatrix(e,t){const n=new Xa(e);let r=null;try{return this.decodeBitMatrixParser(n,t)}catch(i){r=i}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();const i=this.decodeBitMatrixParser(n,t);return i.setOther(new Ps(!0)),i}catch(i){throw r!==null?r:i}}decodeBitMatrixParser(e,t){const n=e.readVersion(),r=e.readFormatInformation().getErrorCorrectionLevel(),i=e.readCodewords(),s=yi.getDataBlocks(i,n,r);let l=0;for(const g of s)l+=g.getNumDataCodewords();const c=new Uint8Array(l);let u=0;for(const g of s){const w=g.getCodewords(),E=g.getNumDataCodewords();this.correctErrors(w,E);for(let I=0;I=n)return!1;return!0}crossCheckVertical(e,t,n,r){const i=this.image,s=i.getHeight(),l=this.crossCheckStateCount;l[0]=0,l[1]=0,l[2]=0;let c=e;for(;c>=0&&i.get(t,c)&&l[1]<=n;)l[1]++,c--;if(c<0||l[1]>n)return NaN;for(;c>=0&&!i.get(t,c)&&l[0]<=n;)l[0]++,c--;if(l[0]>n)return NaN;for(c=e+1;cn)return NaN;for(;cn)return NaN;const u=l[0]+l[1]+l[2];return 5*Math.abs(u-r)>=2*r?NaN:this.foundPatternCross(l)?Gr.centerFromEnd(l,c):NaN}handlePossibleCenter(e,t,n){const r=e[0]+e[1]+e[2],i=Gr.centerFromEnd(e,n),s=this.crossCheckVertical(t,i,2*e[1],r);if(!isNaN(s)){const l=(e[0]+e[1]+e[2])/3;for(const u of this.possibleCenters)if(u.aboutEquals(l,s,i))return u.combineEstimate(s,i,l);const c=new Ni(i,s,l);this.possibleCenters.push(c),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(c)}return null}}class _i extends R{constructor(e,t,n,r){super(e,t),this.estimatedModuleSize=n,this.count=r,r===void 0&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(e,t,n){if(Math.abs(t-this.getY())<=e&&Math.abs(n-this.getX())<=e){const r=Math.abs(e-this.estimatedModuleSize);return r<=1||r<=this.estimatedModuleSize}return!1}combineEstimate(e,t,n){const r=this.count+1,i=(this.count*this.getX()+t)/r,s=(this.count*this.getY()+e)/r,l=(this.count*this.estimatedModuleSize+n)/r;return new _i(i,s,l,r)}}class Ka{constructor(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class wt{constructor(e,t){this.image=e,this.resultPointCallback=t,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=t}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(e){const t=e!=null&&e.get(me.TRY_HARDER)!==void 0,n=e!=null&&e.get(me.PURE_BARCODE)!==void 0,r=this.image,i=r.getHeight(),s=r.getWidth();let l=Math.floor(3*i/(4*wt.MAX_MODULES));(lu[2]&&(w+=N-u[2]-l,I=s-1)}else{u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,E=3;continue}E=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,E=3;else u[++E]++;else u[E]++;wt.foundPatternCross(u)&&this.handlePossibleCenter(u,w,s,n)===!0&&(l=u[0],this.hasSkipped&&(c=this.haveMultiplyConfirmedCenters()))}const g=this.selectBestPatterns();return R.orderBestPatterns(g),new Ka(g)}static centerFromEnd(e,t){return t-e[4]-e[3]-e[2]/2}static foundPatternCross(e){let t=0;for(let i=0;i<5;i++){const s=e[i];if(s===0)return!1;t+=s}if(t<7)return!1;const n=t/7,r=n/2;return Math.abs(n-e[0])=s&&t>=s&&l.get(t-s,e-s);)i[2]++,s++;if(e=s&&t>=s&&!l.get(t-s,e-s)&&i[1]<=n;)i[1]++,s++;if(en)return!1;for(;e>=s&&t>=s&&l.get(t-s,e-s)&&i[0]<=n;)i[0]++,s++;if(i[0]>n)return!1;const c=l.getHeight(),u=l.getWidth();for(s=1;e+s=c||t+s>=u)return!1;for(;e+s=c||t+s>=u||i[3]>=n)return!1;for(;e+s=n)return!1;const g=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(g-r)<2*r&&wt.foundPatternCross(i)}crossCheckVertical(e,t,n,r){const i=this.image,s=i.getHeight(),l=this.getCrossCheckStateCount();let c=e;for(;c>=0&&i.get(t,c);)l[2]++,c--;if(c<0)return NaN;for(;c>=0&&!i.get(t,c)&&l[1]<=n;)l[1]++,c--;if(c<0||l[1]>n)return NaN;for(;c>=0&&i.get(t,c)&&l[0]<=n;)l[0]++,c--;if(l[0]>n)return NaN;for(c=e+1;c=n)return NaN;for(;c=n)return NaN;const u=l[0]+l[1]+l[2]+l[3]+l[4];return 5*Math.abs(u-r)>=2*r?NaN:wt.foundPatternCross(l)?wt.centerFromEnd(l,c):NaN}crossCheckHorizontal(e,t,n,r){const i=this.image,s=i.getWidth(),l=this.getCrossCheckStateCount();let c=e;for(;c>=0&&i.get(c,t);)l[2]++,c--;if(c<0)return NaN;for(;c>=0&&!i.get(c,t)&&l[1]<=n;)l[1]++,c--;if(c<0||l[1]>n)return NaN;for(;c>=0&&i.get(c,t)&&l[0]<=n;)l[0]++,c--;if(l[0]>n)return NaN;for(c=e+1;c=n)return NaN;for(;c=n)return NaN;const u=l[0]+l[1]+l[2]+l[3]+l[4];return 5*Math.abs(u-r)>=r?NaN:wt.foundPatternCross(l)?wt.centerFromEnd(l,c):NaN}handlePossibleCenter(e,t,n,r){const i=e[0]+e[1]+e[2]+e[3]+e[4];let s=wt.centerFromEnd(e,n),l=this.crossCheckVertical(t,Math.floor(s),e[2],i);if(!isNaN(l)&&(s=this.crossCheckHorizontal(Math.floor(s),Math.floor(l),e[2],i),!isNaN(s)&&(!r||this.crossCheckDiagonal(Math.floor(l),Math.floor(s),e[2],i)))){const c=i/7;let u=!1;const g=this.possibleCenters;for(let w=0,E=g.length;w=wt.CENTER_QUORUM)if(t==null)t=n;else return this.hasSkipped=!0,Math.floor((Math.abs(t.getX()-n.getX())-Math.abs(t.getY()-n.getY()))/2);return 0}haveMultiplyConfirmedCenters(){let e=0,t=0;const n=this.possibleCenters.length;for(const s of this.possibleCenters)s.getCount()>=wt.CENTER_QUORUM&&(e++,t+=s.getEstimatedModuleSize());if(e<3)return!1;const r=t/n;let i=0;for(const s of this.possibleCenters)i+=Math.abs(s.getEstimatedModuleSize()-r);return i<=.05*t}selectBestPatterns(){const e=this.possibleCenters.length;if(e<3)throw new F;const t=this.possibleCenters;let n;if(e>3){let r=0,i=0;for(const c of this.possibleCenters){const u=c.getEstimatedModuleSize();r+=u,i+=u*u}n=r/e;let s=Math.sqrt(i/e-n*n);t.sort((c,u)=>{const g=Math.abs(u.getEstimatedModuleSize()-n),w=Math.abs(c.getEstimatedModuleSize()-n);return gw?1:0});const l=Math.max(.2*n,s);for(let c=0;c3;c++){const u=t[c];Math.abs(u.getEstimatedModuleSize()-n)>l&&(t.splice(c,1),c--)}}if(t.length>3){let r=0;for(const i of t)r+=i.getEstimatedModuleSize();n=r/t.length,t.sort((i,s)=>{if(s.getCount()===i.getCount()){const l=Math.abs(s.getEstimatedModuleSize()-n),c=Math.abs(i.getEstimatedModuleSize()-n);return lc?-1:0}else return s.getCount()-i.getCount()}),t.splice(3)}return[t[0],t[1],t[2]]}}wt.CENTER_QUORUM=2,wt.MIN_SKIP=3,wt.MAX_MODULES=57;class Ir{constructor(e){this.image=e}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(e){this.resultPointCallback=e==null?null:e.get(me.NEED_RESULT_POINT_CALLBACK);const n=new wt(this.image,this.resultPointCallback).find(e);return this.processFinderPatternInfo(n)}processFinderPatternInfo(e){const t=e.getTopLeft(),n=e.getTopRight(),r=e.getBottomLeft(),i=this.calculateModuleSize(t,n,r);if(i<1)throw new F("No pattern found in proccess finder.");const s=Ir.computeDimension(t,n,r,i),l=ce.getProvisionalVersionForDimension(s),c=l.getDimensionForVersion()-7;let u=null;if(l.getAlignmentPatternCenters().length>0){const I=n.getX()-t.getX()+r.getX(),y=n.getY()-t.getY()+r.getY(),N=1-3/c,O=Math.floor(t.getX()+N*(I-t.getX())),B=Math.floor(t.getY()+N*(y-t.getY()));for(let X=4;X<=16;X<<=1)try{u=this.findAlignmentInRegion(i,O,B,X);break}catch(Z){if(!(Z instanceof F))throw Z}}const g=Ir.createTransform(t,n,r,u,s),w=Ir.sampleGrid(this.image,g,s);let E;return u===null?E=[r,t,n]:E=[r,t,n,u],new Q(w,E)}static createTransform(e,t,n,r,i){const s=i-3.5;let l,c,u,g;return r!==null?(l=r.getX(),c=r.getY(),u=s-3,g=u):(l=t.getX()-e.getX()+n.getX(),c=t.getY()-e.getY()+n.getY(),u=s,g=s),re.quadrilateralToQuadrilateral(3.5,3.5,s,3.5,u,g,3.5,s,e.getX(),e.getY(),t.getX(),t.getY(),l,c,n.getX(),n.getY())}static sampleGrid(e,t,n){return pe.getInstance().sampleGridWithTransform(e,n,n,t)}static computeDimension(e,t,n,r){const i=H.round(R.distance(e,t)/r),s=H.round(R.distance(e,n)/r);let l=Math.floor((i+s)/2)+7;switch(l&3){case 0:l++;break;case 2:l--;break;case 3:throw new F("Dimensions could be not found.")}return l}calculateModuleSize(e,t,n){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,n))/2}calculateModuleSizeOneWay(e,t){const n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY())),r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(n)?r/7:isNaN(r)?n/7:(n+r)/14}sizeOfBlackWhiteBlackRunBothWays(e,t,n,r){let i=this.sizeOfBlackWhiteBlackRun(e,t,n,r),s=1,l=e-(n-e);l<0?(s=e/(e-l),l=0):l>=this.image.getWidth()&&(s=(this.image.getWidth()-1-e)/(l-e),l=this.image.getWidth()-1);let c=Math.floor(t-(r-t)*s);return s=1,c<0?(s=t/(t-c),c=0):c>=this.image.getHeight()&&(s=(this.image.getHeight()-1-t)/(c-t),c=this.image.getHeight()-1),l=Math.floor(e+(l-e)*s),i+=this.sizeOfBlackWhiteBlackRun(e,t,l,c),i-1}sizeOfBlackWhiteBlackRun(e,t,n,r){const i=Math.abs(r-t)>Math.abs(n-e);if(i){let I=e;e=t,t=I,I=n,n=r,r=I}const s=Math.abs(n-e),l=Math.abs(r-t);let c=-s/2;const u=e0){if(y===r)break;y+=g,c-=s}}return w===2?H.distance(n+u,r,e,t):NaN}findAlignmentInRegion(e,t,n,r){const i=Math.floor(r*e),s=Math.max(0,t-i),l=Math.min(this.image.getWidth()-1,t+i);if(l-s=c||i>=s)throw new F;if(s-i!==c-l&&(c=l+(s-i),c>=e.getWidth()))throw new F;const u=Math.round((c-l+1)/r),g=Math.round((s-i+1)/r);if(u<=0||g<=0)throw new F;if(g!==u)throw new F;const w=Math.floor(r/2);i+=w,l+=w;const E=l+Math.floor((u-1)*r)-c;if(E>0){if(E>w)throw new F;l-=E}const I=i+Math.floor((g-1)*r)-s;if(I>0){if(I>w)throw new F;i-=I}const y=new et(u,g);for(let N=0;N0;){const E=Se.findGuardPattern(e,i,--r,n,!1,s,u);if(E!=null)w=E;else{r++;break}}l[0]=new R(w[0],r),l[1]=new R(w[1],r),c=!0;break}}let g=r+1;if(c){let w=0,E=Int32Array.from([Math.trunc(l[0].getX()),Math.trunc(l[1].getX())]);for(;gSe.SKIPPED_ROW_COUNT_MAX)break;w++}}g-=w+1,l[2]=new R(E[0],g),l[3]=new R(E[1],g)}return g-r0&&u++w?g-w:w-g;if(E>n)return 1/0;c+=E}return c/i}}Se.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),Se.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),Se.MAX_AVG_VARIANCE=.42,Se.MAX_INDIVIDUAL_VARIANCE=.8,Se.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),Se.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),Se.MAX_PIXEL_DRIFT=3,Se.MAX_PATTERN_DRIFT=5,Se.SKIPPED_ROW_COUNT_MAX=25,Se.ROW_STEP=5,Se.BARCODE_MIN_HEIGHT=10;class Et{constructor(e,t){if(t.length===0)throw new M;this.field=e;let n=t.length;if(n>1&&t[0]===0){let r=1;for(;rn.length){let s=t;t=n,n=s}let r=new Int32Array(n.length),i=n.length-t.length;K.arraycopy(n,0,r,0,i);for(let s=i;s=0;t--){let n=this.getCoefficient(t);n!==0&&(n<0?(e.append(" - "),n=-n):e.length()>0&&e.append(" + "),(t===0||n!==1)&&e.append(n),t!==0&&(t===1?e.append("x"):(e.append("x^"),e.append(t))))}return e.toString()}}class qa{add(e,t){return(e+t)%this.modulus}subtract(e,t){return(this.modulus+e-t)%this.modulus}exp(e){return this.expTable[e]}log(e){if(e===0)throw new M;return this.logTable[e]}inverse(e){if(e===0)throw new In;return this.expTable[this.modulus-this.logTable[e]-1]}multiply(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.modulus-1)]}getSize(){return this.modulus}equals(e){return e===this}}class Mi extends qa{constructor(e,t){super(),this.modulus=e,this.expTable=new Int32Array(e),this.logTable=new Int32Array(e);let n=1;for(let r=0;r0;y--){let N=r.evaluateAt(this.field.exp(y));i[t-y]=N,N!==0&&(s=!0)}if(!s)return 0;let l=this.field.getOne();if(n!=null)for(const y of n){let N=this.field.exp(e.length-1-y),O=new Et(this.field,new Int32Array([this.field.subtract(0,N),1]));l=l.multiply(O)}let c=new Et(this.field,i),u=this.runEuclideanAlgorithm(this.field.buildMonomial(t,1),c,t),g=u[0],w=u[1],E=this.findErrorLocations(g),I=this.findErrorMagnitudes(w,g,E);for(let y=0;y=Math.round(n/2);){let E=r,I=s;if(r=i,s=l,r.isZero())throw U.getChecksumInstance();i=E;let y=this.field.getZero(),N=r.getCoefficient(r.getDegree()),O=this.field.inverse(N);for(;i.getDegree()>=r.getDegree()&&!i.isZero();){let B=i.getDegree()-r.getDegree(),X=this.field.multiply(i.getCoefficient(i.getDegree()),O);y=y.add(this.field.buildMonomial(B,X)),i=i.subtract(r.multiplyByMonomial(B,X))}l=y.multiply(s).subtract(I).negative()}let c=l.getCoefficient(0);if(c===0)throw U.getChecksumInstance();let u=this.field.inverse(c),g=l.multiply(u),w=i.multiply(u);return[g,w]}findErrorLocations(e){let t=e.getDegree(),n=new Int32Array(t),r=0;for(let i=1;i0){let c=n?this.topLeft:this.topRight,u=Math.trunc(c.getY()-e);u<0&&(u=0);let g=new R(c.getX(),u);n?r=g:s=g}if(t>0){let c=n?this.bottomLeft:this.bottomRight,u=Math.trunc(c.getY()+t);u>=this.image.getHeight()&&(u=this.image.getHeight()-1);let g=new R(c.getX(),u);n?i=g:l=g}return new Un(this.image,r,i,s,l)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class Ja{constructor(e,t,n,r){this.columnCount=e,this.errorCorrectionLevel=r,this.rowCountUpperPart=t,this.rowCountLowerPart=n,this.rowCount=t+n}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class Tr{constructor(){this.buffer=""}static form(e,t){let n=-1;function r(s,l,c,u,g,w){if(s==="%%")return"%";if(t[++n]===void 0)return;s=u?parseInt(u.substr(1)):void 0;let E=g?parseInt(g.substr(1)):void 0,I;switch(w){case"s":I=t[n];break;case"c":I=t[n][0];break;case"f":I=parseFloat(t[n]).toFixed(s);break;case"p":I=parseFloat(t[n]).toPrecision(s);break;case"e":I=parseFloat(t[n]).toExponential(s);break;case"x":I=parseInt(t[n]).toString(E||16);break;case"d":I=parseFloat(parseInt(t[n],E||10).toPrecision(s)).toFixed(0);break}I=typeof I=="object"?JSON.stringify(I):(+I).toString(E);let y=parseInt(c),N=c&&c[0]+""=="0"?"0":" ";for(;I.length=0&&(t=this.codewords[r],t!=null)||(r=this.imageRowToCodewordIndex(e)+n,rn,getValue:()=>r};i.getValue()>e?(e=i.getValue(),t=[],t.push(i.getKey())):i.getValue()===e&&t.push(i.getKey())}return Ae.toIntArray(t)}getConfidence(e){return this.values.get(e)}}class ks extends Sr{constructor(e,t){super(e),this._isLeft=t}setRowNumbers(){for(let e of this.getCodewords())e!=null&&e.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(e){let t=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(t,e);let n=this.getBoundingBox(),r=this._isLeft?n.getTopLeft():n.getTopRight(),i=this._isLeft?n.getBottomLeft():n.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(r.getY())),l=this.imageRowToCodewordIndex(Math.trunc(i.getY())),c=-1,u=1,g=0;for(let w=s;w=e.getRowCount()||I>w)t[w]=null;else{let y;u>2?y=(u-2)*I:y=I;let N=y>=w;for(let O=1;O<=y&&!N;O++)N=t[w-O]!=null;N?t[w]=null:(c=E.getRowNumber(),g=1)}}}getRowHeights(){let e=this.getBarcodeMetadata();if(e==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(e);let t=new Int32Array(e.getRowCount());for(let n of this.getCodewords())if(n!=null){let r=n.getRowNumber();if(r>=t.length)continue;t[r]++}return t}adjustIncompleteIndicatorColumnRowNumbers(e){let t=this.getBoundingBox(),n=this._isLeft?t.getTopLeft():t.getTopRight(),r=this._isLeft?t.getBottomLeft():t.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),s=this.imageRowToCodewordIndex(Math.trunc(r.getY())),l=this.getCodewords(),c=-1;for(let u=i;u=e.getRowCount()?l[u]=null:c=g.getRowNumber())}}getBarcodeMetadata(){let e=this.getCodewords(),t=new br,n=new br,r=new br,i=new br;for(let l of e){if(l==null)continue;l.setRowNumberAsRowIndicatorColumn();let c=l.getValue()%30,u=l.getRowNumber();switch(this._isLeft||(u+=2),u%3){case 0:n.setValue(c*3+1);break;case 1:i.setValue(c/3),r.setValue(c%3);break;case 2:t.setValue(c+1);break}}if(t.getValue().length===0||n.getValue().length===0||r.getValue().length===0||i.getValue().length===0||t.getValue()[0]<1||n.getValue()[0]+r.getValue()[0]Ae.MAX_ROWS_IN_BARCODE)return null;let s=new Ja(t.getValue()[0],n.getValue()[0],r.getValue()[0],i.getValue()[0]);return this.removeIncorrectCodewords(e,s),s}removeIncorrectCodewords(e,t){for(let n=0;nt.getRowCount()){e[n]=null;continue}switch(this._isLeft||(s+=2),s%3){case 0:i*3+1!==t.getRowCountUpperPart()&&(e[n]=null);break;case 1:(Math.trunc(i/3)!==t.getErrorCorrectionLevel()||i%3!==t.getRowCountLowerPart())&&(e[n]=null);break;case 2:i+1!==t.getColumnCount()&&(e[n]=null);break}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+` +`+super.toString()}}class yr{constructor(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let e=Ae.MAX_CODEWORDS_IN_BARCODE,t;do t=e,e=this.adjustRowNumbersAndGetCount();while(e>0&&e0&&i0&&(l[0]=n[t-1],l[4]=i[t-1],l[5]=s[t-1]),t>1&&(l[8]=n[t-2],l[10]=i[t-2],l[11]=s[t-2]),t>=1;n=t&1,Bt.RATIOS_TABLE[e]||(Bt.RATIOS_TABLE[e]=new Array(Ae.BARS_IN_MODULE)),Bt.RATIOS_TABLE[e][Ae.BARS_IN_MODULE-r-1]=Math.fround(i/Ae.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(e){let t=Bt.getDecodedCodewordValue(Bt.sampleBitCounts(e));return t!==-1?t:Bt.getClosestDecodedValue(e)}static sampleBitCounts(e){let t=H.sum(e),n=new Int32Array(Ae.BARS_IN_MODULE),r=0,i=0;for(let s=0;s1)for(let s=0;s=r)break}lnew Array(Ae.BARS_IN_MODULE));class Us{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(e){this.segmentIndex=e}getFileId(){return this.fileId}setFileId(e){this.fileId=e}getOptionalData(){return this.optionalData}setOptionalData(e){this.optionalData=e}isLastSegment(){return this.lastSegment}setLastSegment(e){this.lastSegment=e}getSegmentCount(){return this.segmentCount}setSegmentCount(e){this.segmentCount=e}getSender(){return this.sender||null}setSender(e){this.sender=e}getAddressee(){return this.addressee||null}setAddressee(e){this.addressee=e}getFileName(){return this.fileName}setFileName(e){this.fileName=e}getFileSize(){return this.fileSize}setFileSize(e){this.fileSize=e}getChecksum(){return this.checksum}setChecksum(e){this.checksum=e}getTimestamp(){return this.timestamp}setTimestamp(e){this.timestamp=e}}class Hs{static parseLong(e,t=void 0){return parseInt(e,t)}}class js extends m{}js.kind="NullPointerException";class $a{writeBytes(e){this.writeBytesOffset(e,0,e.length)}writeBytesOffset(e,t,n){if(e==null)throw new js;if(t<0||t>e.length||n<0||t+n>e.length||t+n<0)throw new fe;if(n===0)return;for(let r=0;r0&&this.grow(e)}grow(e){let n=this.buf.length<<1;if(n-e<0&&(n=e),n<0){if(e<0)throw new el;n=se.MAX_VALUE}this.buf=$.copyOfUint8Array(this.buf,n)}write(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1}writeBytesOffset(e,t,n){if(t<0||t>e.length||n<0||t+n-e.length>0)throw new fe;this.ensureCapacity(this.count+n),K.arraycopy(e,t,this.buf,this.count,n),this.count+=n}writeTo(e){e.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return $.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(e){return e?typeof e=="string"?this.toString_string(e):this.toString_number(e):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(e){return new String(this.buf).toString()}toString_number(e){return new String(this.buf).toString()}close(){}}var Ge;(function(A){A[A.ALPHA=0]="ALPHA",A[A.LOWER=1]="LOWER",A[A.MIXED=2]="MIXED",A[A.PUNCT=3]="PUNCT",A[A.ALPHA_SHIFT=4]="ALPHA_SHIFT",A[A.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(Ge||(Ge={}));function Vs(){if(typeof window!="undefined")return window.BigInt||null;if(typeof Dr!="undefined")return Dr.BigInt||null;if(typeof self!="undefined")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let Xr;function Nn(A){if(typeof Xr=="undefined"&&(Xr=Vs()),Xr===null)throw new Error("BigInt is not supported!");return Xr(A)}function nl(){let A=[];A[0]=Nn(1);let e=Nn(900);A[1]=e;for(let t=2;t<16;t++)A[t]=A[t-1]*e;return A}class L{static decode(e,t){let n=new Ie(""),r=V.ISO8859_1;n.enableDecoding(r);let i=1,s=e[i++],l=new Us;for(;ie[0])throw G.getFormatInstance();let r=new Int32Array(L.NUMBER_OF_SEQUENCE_CODEWORDS);for(let l=0;l0){for(let E=0;E<6;++E)s.write(Number(Nn(c)>>Nn(8*(5-E))));c=0,l=0}break}r===t[0]&&w0){for(let I=0;I<6;++I)s.write(Number(Nn(c)>>Nn(8*(5-I))));c=0,l=0}}break}return i.append(ze.decode(s.toByteArray(),n)),r}static numericCompaction(e,t,n){let r=0,i=!1,s=new Int32Array(L.MAX_NUMERIC_CODEWORDS);for(;t0&&(n.append(L.decodeBase900toBase10(s,r)),r=0)}return t}static decodeBase900toBase10(e,t){let n=Nn(0);for(let i=0;i@[\\]_\`~!\r ,: +-.$/"|*()?{}'`,L.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",L.EXP900=Vs()?nl():[],L.NUMBER_OF_SEQUENCE_CODEWORDS=2;class ye{constructor(){}static decode(e,t,n,r,i,s,l){let c=new Un(e,t,n,r,i),u=null,g=null,w;for(let y=!0;;y=!1){if(t!=null&&(u=ye.getRowIndicatorColumn(e,c,t,!0,s,l)),r!=null&&(g=ye.getRowIndicatorColumn(e,c,r,!1,s,l)),w=ye.merge(u,g),w==null)throw F.getNotFoundInstance();let N=w.getBoundingBox();if(y&&N!=null&&(N.getMinY()c.getMaxY()))c=N;else break}w.setBoundingBox(c);let E=w.getBarcodeColumnCount()+1;w.setDetectionResultColumn(0,u),w.setDetectionResultColumn(E,g);let I=u!=null;for(let y=1;y<=E;y++){let N=I?y:E-y;if(w.getDetectionResultColumn(N)!==void 0)continue;let O;N===0||N===E?O=new ks(c,N===0):O=new Sr(c),w.setDetectionResultColumn(N,O);let B=-1,X=B;for(let Z=c.getMinY();Z<=c.getMaxY();Z++){if(B=ye.getStartColumn(w,N,Z,I),B<0||B>c.getMaxX()){if(X===-1)continue;B=X}let W=ye.detectCodeword(e,c.getMinX(),c.getMaxX(),I,B,Z,s,l);W!=null&&(O.setCodeword(Z,W),X=B,s=Math.min(s,W.getWidth()),l=Math.max(l,W.getWidth()))}}return ye.createDecoderResult(w)}static merge(e,t){if(e==null&&t==null)return null;let n=ye.getBarcodeMetadata(e,t);if(n==null)return null;let r=Un.merge(ye.adjustBoundingBox(e),ye.adjustBoundingBox(t));return new yr(n,r)}static adjustBoundingBox(e){if(e==null)return null;let t=e.getRowHeights();if(t==null)return null;let n=ye.getMax(t),r=0;for(let l of t)if(r+=n-l,l>0)break;let i=e.getCodewords();for(let l=0;r>0&&i[l]==null;l++)r--;let s=0;for(let l=t.length-1;l>=0&&(s+=n-t[l],!(t[l]>0));l--);for(let l=i.length-1;s>0&&i[l]==null;l--)s--;return e.getBoundingBox().addMissingRows(r,s,e.isLeft())}static getMax(e){let t=-1;for(let n of e)t=Math.max(t,n);return t}static getBarcodeMetadata(e,t){let n;if(e==null||(n=e.getBarcodeMetadata())==null)return t==null?null:t.getBarcodeMetadata();let r;return t==null||(r=t.getBarcodeMetadata())==null?n:n.getColumnCount()!==r.getColumnCount()&&n.getErrorCorrectionLevel()!==r.getErrorCorrectionLevel()&&n.getRowCount()!==r.getRowCount()?null:n}static getRowIndicatorColumn(e,t,n,r,i,s){let l=new ks(t,r);for(let c=0;c<2;c++){let u=c===0?1:-1,g=Math.trunc(Math.trunc(n.getX()));for(let w=Math.trunc(Math.trunc(n.getY()));w<=t.getMaxY()&&w>=t.getMinY();w+=u){let E=ye.detectCodeword(e,0,e.getWidth(),r,g,w,i,s);E!=null&&(l.setCodeword(w,E),r?g=E.getStartX():g=E.getEndX())}}return l}static adjustCodewordCount(e,t){let n=t[0][1],r=n.getValue(),i=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-ye.getNumberOfECCodeWords(e.getBarcodeECLevel());if(r.length===0){if(i<1||i>Ae.MAX_CODEWORDS_IN_BARCODE)throw F.getNotFoundInstance();n.setValue(i)}else r[0]!==i&&n.setValue(i)}static createDecoderResult(e){let t=ye.createBarcodeMatrix(e);ye.adjustCodewordCount(e,t);let n=new Array,r=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),i=[],s=new Array;for(let c=0;c0;){for(let c=0;cnew Array(e.getBarcodeColumnCount()+2));for(let r=0;r=0){if(s>=t.length)continue;t[s][n].setValue(i.getValue())}}}n++}return t}static isValidBarcodeColumn(e,t){return t>=0&&t<=e.getBarcodeColumnCount()+1}static getStartColumn(e,t,n,r){let i=r?1:-1,s=null;if(ye.isValidBarcodeColumn(e,t-i)&&(s=e.getDetectionResultColumn(t-i).getCodeword(n)),s!=null)return r?s.getEndX():s.getStartX();if(s=e.getDetectionResultColumn(t).getCodewordNearby(n),s!=null)return r?s.getStartX():s.getEndX();if(ye.isValidBarcodeColumn(e,t-i)&&(s=e.getDetectionResultColumn(t-i).getCodewordNearby(n)),s!=null)return r?s.getEndX():s.getStartX();let l=0;for(;ye.isValidBarcodeColumn(e,t-i);){t-=i;for(let c of e.getDetectionResultColumn(t).getCodewords())if(c!=null)return(r?c.getEndX():c.getStartX())+i*l*(c.getEndX()-c.getStartX());l++}return r?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()}static detectCodeword(e,t,n,r,i,s,l,c){i=ye.adjustCodewordStartColumn(e,t,n,r,i,s);let u=ye.getModuleBitCount(e,t,n,r,i,s);if(u==null)return null;let g,w=H.sum(u);if(r)g=i+w;else{for(let y=0;y=t)&&u=t:lye.CODEWORD_SKEW_SIZE)return i;l+=c}c=-c,r=!r}return l}static checkCodewordSkew(e,t,n){return t-ye.CODEWORD_SKEW_SIZE<=e&&e<=n+ye.CODEWORD_SKEW_SIZE}static decodeCodewords(e,t,n){if(e.length===0)throw G.getFormatInstance();let r=1<n/2+ye.MAX_ERRORS||n<0||n>ye.MAX_EC_CODEWORDS)throw U.getChecksumInstance();return ye.errorCorrection.decode(e,n,t)}static verifyCodewordCount(e,t){if(e.length<4)throw G.getFormatInstance();let n=e[0];if(n>e.length)throw G.getFormatInstance();if(n===0)if(t>=1;return t}static getCodewordBucketNumber(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)}static getCodewordBucketNumber_number(e){return ye.getCodewordBucketNumber(ye.getBitCountForCodeword(e))}static getCodewordBucketNumber_Int32Array(e){return(e[0]-e[2]+e[4]-e[6]+9)%9}static toString(e){let t=new Tr;for(let n=0;ns)}static getMaxWidth(e,t){return e==null||t==null?0:Math.trunc(Math.abs(e.getX()-t.getX()))}static getMinWidth(e,t){return e==null||t==null?se.MAX_VALUE:Math.trunc(Math.abs(e.getX()-t.getX()))}static getMaxCodewordWidth(e){return Math.floor(Math.max(Math.max(pt.getMaxWidth(e[0],e[4]),pt.getMaxWidth(e[6],e[2])*Ae.MODULES_IN_CODEWORD/Ae.MODULES_IN_STOP_PATTERN),Math.max(pt.getMaxWidth(e[1],e[5]),pt.getMaxWidth(e[7],e[3])*Ae.MODULES_IN_CODEWORD/Ae.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(e){return Math.floor(Math.min(Math.min(pt.getMinWidth(e[0],e[4]),pt.getMinWidth(e[6],e[2])*Ae.MODULES_IN_CODEWORD/Ae.MODULES_IN_STOP_PATTERN),Math.min(pt.getMinWidth(e[1],e[5]),pt.getMinWidth(e[7],e[3])*Ae.MODULES_IN_CODEWORD/Ae.MODULES_IN_STOP_PATTERN)))}reset(){}}class Zr extends m{}Zr.kind="ReaderException";class zs{constructor(e,t){this.verbose=e===!0,t&&this.setHints(t)}decode(e,t){return t&&this.setHints(t),this.decodeInternal(e)}decodeWithState(e){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(e)}setHints(e){this.hints=e;const t=e!=null&&e.get(me.TRY_HARDER)!==void 0,n=e==null?null:e.get(me.POSSIBLE_FORMATS),r=new Array;if(n!=null){const i=n.some(s=>s===de.UPC_A||s===de.UPC_E||s===de.EAN_13||s===de.EAN_8||s===de.CODABAR||s===de.CODE_39||s===de.CODE_93||s===de.CODE_128||s===de.ITF||s===de.RSS_14||s===de.RSS_EXPANDED);i&&!t&&r.push(new rr(e,this.verbose)),n.includes(de.QR_CODE)&&r.push(new yn),n.includes(de.DATA_MATRIX)&&r.push(new bn),n.includes(de.AZTEC)&&r.push(new He),n.includes(de.PDF_417)&&r.push(new pt),i&&t&&r.push(new rr(e,this.verbose))}r.length===0&&(t||r.push(new rr(e,this.verbose)),r.push(new yn),r.push(new bn),r.push(new He),r.push(new pt),t&&r.push(new rr(e,this.verbose))),this.readers=r}reset(){if(this.readers!==null)for(const e of this.readers)e.reset()}decodeInternal(e){if(this.readers===null)throw new Zr("No readers where selected, nothing can be read.");for(const t of this.readers)try{return t.decode(e,this.hints)}catch(n){if(n instanceof Zr)continue}throw new F("No MultiFormat Readers were able to detect the code.")}}class rl extends Dt{constructor(e=null,t=500){const n=new zs;n.setHints(e),super(n,t)}decodeBitmap(e){return this.reader.decodeWithState(e)}}class il extends Dt{constructor(e=500){super(new pt,e)}}class sl extends Dt{constructor(e=500){super(new yn,e)}}var Oi;(function(A){A[A.ERROR_CORRECTION=0]="ERROR_CORRECTION",A[A.CHARACTER_SET=1]="CHARACTER_SET",A[A.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",A[A.MIN_SIZE=3]="MIN_SIZE",A[A.MAX_SIZE=4]="MAX_SIZE",A[A.MARGIN=5]="MARGIN",A[A.PDF417_COMPACT=6]="PDF417_COMPACT",A[A.PDF417_COMPACTION=7]="PDF417_COMPACTION",A[A.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",A[A.AZTEC_LAYERS=9]="AZTEC_LAYERS",A[A.QR_VERSION=10]="QR_VERSION"})(Oi||(Oi={}));var gt=Oi;class Di{constructor(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new ut(e,Int32Array.from([1])))}buildGenerator(e){const t=this.cachedGenerators;if(e>=t.length){let n=t[t.length-1];const r=this.field;for(let i=t.length;i<=e;i++){const s=n.multiply(new ut(r,Int32Array.from([1,r.exp(i-1+r.getGeneratorBase())])));t.push(s),n=s}}return t[e]}encode(e,t){if(t===0)throw new M("No error correction bytes");const n=e.length-t;if(n<=0)throw new M("No data bytes provided");const r=this.buildGenerator(t),i=new Int32Array(n);K.arraycopy(e,0,i,0,n);let s=new ut(this.field,i);s=s.multiplyByMonomial(t,1);const c=s.divide(r)[1].getCoefficients(),u=t-c.length;for(let g=0;g=5&&(n+=lt.N1+(c-5)),c=1,u=w)}c>=5&&(n+=lt.N1+(c-5))}return n}}lt.N1=3,lt.N2=3,lt.N3=40,lt.N4=10;class Kr{constructor(e,t){this.width=e,this.height=t;const n=new Array(t);for(let r=0;r!==t;r++)n[r]=new Uint8Array(e);this.bytes=n}getHeight(){return this.height}getWidth(){return this.width}get(e,t){return this.bytes[t][e]}getArray(){return this.bytes}setNumber(e,t,n){this.bytes[t][e]=n}setBoolean(e,t,n){this.bytes[t][e]=n?1:0}clear(e){for(const t of this.bytes)$.fill(t,e)}equals(e){if(!(e instanceof Kr))return!1;const t=e;if(this.width!==t.width||this.height!==t.height)return!1;for(let n=0,r=this.height;n> -`),e.toString()}setMode(e){this.mode=e}setECLevel(e){this.ecLevel=e}setVersion(e){this.version=e}setMaskPattern(e){this.maskPattern=e}setMatrix(e){this.matrix=e}static isValidMaskPattern(e){return e>=0&&e0;){for(s===6&&(s-=1);l>=0&&l=n;)e^=t<=0)for(let c=0;c!==s;c++){const u=r[c];u>=0&&xe.isEmpty(t.get(u,l))&&xe.embedPositionAdjustmentPattern(u-2,l-2,t)}}}}xe.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),xe.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),xe.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),xe.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),xe.VERSION_INFO_POLY=7973,xe.TYPE_INFO_POLY=1335,xe.TYPE_INFO_MASK_PATTERN=21522;class sl{constructor(e,t){this.dataBytes=e,this.errorCorrectionBytes=t}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class nt{constructor(){}static calculateMaskPenalty(e){return lt.applyMaskPenaltyRule1(e)+lt.applyMaskPenaltyRule2(e)+lt.applyMaskPenaltyRule3(e)+lt.applyMaskPenaltyRule4(e)}static encode(e,t,n=null){let r=nt.DEFAULT_BYTE_MODE_ENCODING;const i=n!==null&&n.get(gt.CHARACTER_SET)!==void 0;i&&(r=n.get(gt.CHARACTER_SET).toString());const s=this.chooseMode(e,r),l=new Ee;if(s===ge.BYTE&&(i||nt.DEFAULT_BYTE_MODE_ENCODING!==r)){const Z=V.getCharacterSetECIByName(r);Z!==void 0&&this.appendECI(Z,l)}this.appendModeInfo(s,l);const c=new Ee;this.appendBytes(e,s,c,r);let u;if(n!==null&&n.get(gt.QR_VERSION)!==void 0){const Z=Number.parseInt(n.get(gt.QR_VERSION).toString(),10);u=ce.getVersionForNumber(Z);const W=this.calculateBitsNeeded(s,l,c,u);if(!this.willFit(W,u,t))throw new Ke("Data too big for requested version")}else u=this.recommendVersion(t,s,l,c);const g=new Ee;g.appendBitArray(l);const w=s===ge.BYTE?c.getSizeInBytes():e.length;this.appendLengthInfo(w,u,s,g),g.appendBitArray(c);const E=u.getECBlocksForLevel(t),I=u.getTotalCodewords()-E.getTotalECCodewords();this.terminateBits(I,g);const y=this.interleaveWithECBytes(g,u.getTotalCodewords(),I,E.getNumBlocks()),N=new Hn;N.setECLevel(t),N.setMode(s),N.setVersion(u);const O=u.getDimensionForVersion(),B=new Zr(O,O),X=this.chooseMaskPattern(y,t,u,B);return N.setMaskPattern(X),xe.buildMatrix(y,t,u,X,B),N.setMatrix(B),N}static recommendVersion(e,t,n,r){const i=this.calculateBitsNeeded(t,n,r,ce.getVersionForNumber(1)),s=this.chooseVersion(i,e),l=this.calculateBitsNeeded(t,n,r,s);return this.chooseVersion(l,e)}static calculateBitsNeeded(e,t,n,r){return t.getSize()+e.getCharacterCountBits(r)+n.getSize()}static getAlphanumericCode(e){return e159)&&(i<224||i>235))return!1}return!0}static chooseMaskPattern(e,t,n,r){let i=Number.MAX_SAFE_INTEGER,s=-1;for(let l=0;l=c}static terminateBits(e,t){const n=e*8;if(t.getSize()>n)throw new Ke("data bits cannot fit in the QR Code"+t.getSize()+" > "+n);for(let s=0;s<4&&t.getSize()0)for(let s=r;s<8;s++)t.appendBit(!1);const i=e-t.getSizeInBytes();for(let s=0;s=n)throw new Ke("Block ID too large");const l=e%n,c=n-l,u=Math.floor(e/n),g=u+1,w=Math.floor(t/n),E=w+1,I=u-w,y=g-E;if(I!==y)throw new Ke("EC bytes mismatch");if(n!==c+l)throw new Ke("RS blocks mismatch");if(e!==(w+I)*c+(E+y)*l)throw new Ke("Total bytes mismatch");r=1<=0&&t<=9}static appendNumericBytes(e,t){const n=e.length;let r=0;for(;r=33088&&c<=40956?u=c-33088:c>=57408&&c<=60351&&(u=c-49472),u===-1)throw new Ke("Invalid byte sequence");const g=(u>>8)*192+(u&255);t.appendBits(g,13)}}static appendECI(e,t){t.appendBits(ge.ECI.getBits(),4),t.appendBits(e.getValue(),8)}}nt.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),nt.DEFAULT_BYTE_MODE_ENCODING=V.UTF8.getName();class jn{write(e,t,n,r=null){if(e.length===0)throw new M("Found empty contents");if(t<0||n<0)throw new M("Requested dimensions are too small: "+t+"x"+n);let i=qe.L,s=jn.QUIET_ZONE_SIZE;r!==null&&(r.get(gt.ERROR_CORRECTION)!==void 0&&(i=qe.fromString(r.get(gt.ERROR_CORRECTION).toString())),r.get(gt.MARGIN)!==void 0&&(s=Number.parseInt(r.get(gt.MARGIN).toString(),10)));const l=nt.encode(e,i,r);return this.renderResult(l,t,n,s)}writeToDom(e,t,n,r,i=null){typeof e=="string"&&(e=document.querySelector(e));const s=this.write(t,n,r,i);e&&e.appendChild(s)}renderResult(e,t,n,r){const i=e.getMatrix();if(i===null)throw new _;const s=i.getWidth(),l=i.getHeight(),c=s+r*2,u=l+r*2,g=Math.max(t,c),w=Math.max(n,u),E=Math.min(Math.floor(g/c),Math.floor(w/u)),I=Math.floor((g-s*E)/2),y=Math.floor((w-l*E)/2),N=this.createSVGElement(g,w);for(let O=0,B=y;Ot||i+l>n)throw new M("Crop rectangle does not fit within image data.");c&&this.reverseHorizontal(s,l)}getRow(e,t){if(e<0||e>=this.getHeight())throw new M("Requested row is outside the image: "+e);const n=this.getWidth();(t==null||t.length>16&255,I=w>>7&510,y=w&255;u[g]=(E+I+y)/4&255}this.luminances=u}else this.luminances=e;if(r===void 0&&(this.dataWidth=t),i===void 0&&(this.dataHeight=n),s===void 0&&(this.left=0),l===void 0&&(this.top=0),this.left+t>this.dataWidth||this.top+n>this.dataHeight)throw new M("Crop rectangle does not fit within image data.")}getRow(e,t){if(e<0||e>=this.getHeight())throw new M("Requested row is outside the image: "+e);const n=this.getWidth();(t==null||t.length"}}class Bi extends or{constructor(e,t,n){super(e,0,0),this.binaryShiftStart=t,this.binaryShiftByteCount=n}appendTo(e,t){for(let n=0;n62?e.appendBits(this.binaryShiftByteCount-31,16):n===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(t[this.binaryShiftStart+n],8)}addBinaryShift(e,t){return new Bi(this,e,t)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function ll(A,e,t){return new Bi(A,e,t)}function _r(A,e,t){return new or(A,e,t)}const cl=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],_n=0,Kr=1,Yt=2,Gs=3,ln=4,fl=new or(null,0,0),vi=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,(10<<16)+(29<<5)+30]),Int32Array.from([(9<<16)+(30<<4)+14,0,(5<<16)+30,(5<<16)+29,(10<<16)+(29<<5)+30]),Int32Array.from([(4<<16)+14,(9<<16)+(14<<5)+28,0,(9<<16)+(14<<5)+29,(14<<16)+(14<<10)+(29<<5)+30]),Int32Array.from([(5<<16)+29,(5<<16)+28,(10<<16)+(29<<5)+30,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,(10<<16)+(31<<5)+28,(10<<16)+(31<<5)+30,(10<<16)+(31<<5)+29,0])];function ul(A){for(let e of A)$.fill(e,-1);return A[_n][ln]=0,A[Kr][ln]=0,A[Kr][_n]=28,A[Gs][ln]=0,A[Yt][ln]=0,A[Yt][_n]=15,A}const Xs=ul($.createInt32Array(6,6));class cn{constructor(e,t,n,r){this.token=e,this.mode=t,this.binaryShiftByteCount=n,this.bitCount=r}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(e,t){let n=this.bitCount,r=this.token;if(e!==this.mode){let s=vi[this.mode][e];r=_r(r,s&65535,s>>16),n+=s>>16}let i=e===Yt?4:5;return r=_r(r,t,i),new cn(r,e,0,n+i)}shiftAndAppend(e,t){let n=this.token,r=this.mode===Yt?4:5;return n=_r(n,Xs[this.mode][e],r),n=_r(n,t,5),new cn(n,this.mode,0,this.bitCount+r+5)}addBinaryShiftChar(e){let t=this.token,n=this.mode,r=this.bitCount;if(this.mode===ln||this.mode===Yt){let l=vi[n][_n];t=_r(t,l&65535,l>>16),r+=l>>16,n=_n}let i=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,s=new cn(t,n,this.binaryShiftByteCount+1,r+i);return s.binaryShiftByteCount===2047+31&&(s=s.endBinaryShift(e+1)),s}endBinaryShift(e){if(this.binaryShiftByteCount===0)return this;let t=this.token;return t=ll(t,e-this.binaryShiftByteCount,this.binaryShiftByteCount),new cn(t,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(e){let t=this.bitCount+(vi[this.mode][e.mode]>>16);return this.binaryShiftByteCounte.binaryShiftByteCount&&e.binaryShiftByteCount>0&&(t+=10),t<=e.bitCount}toBitArray(e){let t=[];for(let r=this.endBinaryShift(e.length).token;r!==null;r=r.getPrevious())t.unshift(r);let n=new Ee;for(const r of t)r.appendTo(n,e);return n}toString(){return le.format("%s bits=%d bytes=%d",cl[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(e){return e.binaryShiftByteCount>62?21:e.binaryShiftByteCount>31?20:e.binaryShiftByteCount>0?10:0}}cn.INITIAL_STATE=new cn(fl,_n,0,0);function hl(A){const e=le.getCharCode(" "),t=le.getCharCode("."),n=le.getCharCode(",");A[_n][e]=1;const r=le.getCharCode("Z"),i=le.getCharCode("A");for(let E=i;E<=r;E++)A[_n][E]=E-i+2;A[Kr][e]=1;const s=le.getCharCode("z"),l=le.getCharCode("a");for(let E=l;E<=s;E++)A[Kr][E]=E-l+2;A[Yt][e]=1;const c=le.getCharCode("9"),u=le.getCharCode("0");for(let E=u;E<=c;E++)A[Yt][E]=E-u+2;A[Yt][n]=12,A[Yt][t]=13;const g=["\0"," ","","","","","","","\x07","\b"," ",` -`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~","\x7F"];for(let E=0;E","?","[","]","{","}"];for(let E=0;E0&&(A[ln][le.getCharCode(w[E])]=E);return A}const Pi=hl($.createInt32Array(5,256));class Mr{constructor(e){this.text=e}encode(){const e=le.getCharCode(" "),t=le.getCharCode(` -`);let n=Ys.singletonList(cn.INITIAL_STATE);for(let i=0;i0?(n=Mr.updateStateListForPair(n,i,s),i++):n=this.updateStateListForChar(n,i)}return Ys.min(n,(i,s)=>i.getBitCount()-s.getBitCount()).toBitArray(this.text)}updateStateListForChar(e,t){const n=[];for(let r of e)this.updateStateForChar(r,t,n);return Mr.simplifyStates(n)}updateStateForChar(e,t,n){let r=this.text[t]&255,i=Pi[e.getMode()][r]>0,s=null;for(let l=0;l<=ln;l++){let c=Pi[l][r];if(c>0){if(s==null&&(s=e.endBinaryShift(t)),!i||l===e.getMode()||l===Yt){const u=s.latchAndAppend(l,c);n.push(u)}if(!i&&Xs[e.getMode()][l]>=0){const u=s.shiftAndAppend(l,c);n.push(u)}}}if(e.getBinaryShiftByteCount()>0||Pi[e.getMode()][r]===0){let l=e.addBinaryShiftChar(t);n.push(l)}}static updateStateListForPair(e,t,n){const r=[];for(let i of e)this.updateStateForPair(i,t,n,r);return this.simplifyStates(r)}static updateStateForPair(e,t,n,r){let i=e.endBinaryShift(t);if(r.push(i.latchAndAppend(ln,n)),e.getMode()!==ln&&r.push(i.shiftAndAppend(ln,n)),n===3||n===4){let s=i.latchAndAppend(Yt,16-n).latchAndAppend(Yt,1);r.push(s)}if(e.getBinaryShiftByteCount()>0){let s=e.addBinaryShiftChar(t).addBinaryShiftChar(t+1);r.push(s)}}static simplifyStates(e){let t=[];for(const n of e){let r=!0;for(const i of t){if(i.isBetterThanOrEqualTo(n)){r=!1;break}n.isBetterThanOrEqualTo(i)&&(t=t.filter(s=>s!==i))}r&&t.push(n)}return t}}class Be{constructor(){}static encodeBytes(e){return Be.encode(e,Be.DEFAULT_EC_PERCENT,Be.DEFAULT_AZTEC_LAYERS)}static encode(e,t,n){let r=new Mr(e).encode(),i=se.truncDivision(r.getSize()*t,100)+11,s=r.getSize()+i,l,c,u,g,w;if(n!==Be.DEFAULT_AZTEC_LAYERS){if(l=n<0,c=Math.abs(n),c>(l?Be.MAX_NB_BITS_COMPACT:Be.MAX_NB_BITS))throw new M(le.format("Illegal value %s for layers",n));u=Be.totalBitsInLayer(c,l),g=Be.WORD_SIZE[c];let W=u-u%g;if(w=Be.stuffBits(r,g),w.getSize()+i>W)throw new M("Data to large for user specified layer");if(l&&w.getSize()>g*64)throw new M("Data to large for user specified layer")}else{g=0,w=null;for(let W=0;;W++){if(W>Be.MAX_NB_BITS)throw new M("Data too large for an Aztec code");if(l=W<=3,c=l?W+1:W,u=Be.totalBitsInLayer(c,l),s>u)continue;(w==null||g!==Be.WORD_SIZE[c])&&(g=Be.WORD_SIZE[c],w=Be.stuffBits(r,g));let Me=u-u%g;if(!(l&&w.getSize()>g*64)&&w.getSize()+i<=Me)break}}let E=Be.generateCheckWords(w,u,g),I=w.getSize()/g,y=Be.generateModeMessage(l,c,I),N=(l?11:14)+c*4,O=new Int32Array(N),B;if(l){B=N;for(let W=0;W=r||e.get(s+c))&&(l|=1<0&&x[x.length-1])&&(S[0]===6||S[0]===2)){f=0;continue}if(S[0]===3&&(!x||S[1]>x[0]&&S[1]h&&(h=T,f=p)}if(!f)throw"No largest barcode found";return f},o.prototype.createBarcodeDetectorFormats=function(a){for(var f=[],h=0,d=a;h=T&&p()})})},o.prototype.scanFile=function(a,f){return this.scanFileV2(a,f).then(function(h){return h.decodedText})},o.prototype.scanFileV2=function(a,f){var h=this;if(!a||!(a instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(hr(f)&&(f=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(d,x){h.possiblyCloseLastScanImageFile(),h.clearElement(),h.lastScanImageFile=URL.createObjectURL(a);var p=new Image;p.onload=function(){var T=p.width,m=p.height,S=document.getElementById(h.elementId),M=S.clientWidth?S.clientWidth:Xt.DEFAULT_WIDTH,j=Math.max(S.clientHeight?S.clientHeight:m,Xt.FILE_SCAN_MIN_HEIGHT),U=h.computeCanvasDrawConfig(T,m,M,j);if(f){var ne=h.createCanvasElement(M,j,"qr-canvas-visible");ne.style.display="inline-block",S.appendChild(ne);var K=ne.getContext("2d");if(!K)throw"Unable to get 2d context from canvas";K.canvas.width=M,K.canvas.height=j,K.drawImage(p,0,0,T,m,U.x,U.y,U.width,U.height)}var fe=h.createCanvasElement(U.width,U.height);S.appendChild(fe);var ue=fe.getContext("2d");if(!ue)throw"Unable to get 2d context from canvas";ue.canvas.width=U.width,ue.canvas.height=U.height,ue.drawImage(p,0,0,T,m,0,0,U.width,U.height);try{h.qrcode.decodeAsync(fe).then(function($){d(To.createFromQrcodeResult($))}).catch(x)}catch($){x("QR code parse error, error = "+$)}},p.onerror=x,p.onabort=x,p.onstalled=x,p.onsuspend=x,p.src=URL.createObjectURL(a)})},o.prototype.clear=function(){this.clearElement()},o.getCameras=function(){if(navigator.mediaDevices)return o.getCamerasFromMediaDevices();var a=MediaStreamTrack;if(MediaStreamTrack&&a.getSources)return o.getCamerasFromMediaStreamTrack();var f=function(){if(location.protocol==="https:")return!0;var d=location.host.split(":")[0];return d==="127.0.0.1"||d==="localhost"},h=Or.unableToQuerySupportedDevices();return f()||(h=Or.insecureContextCameraQueryError()),Promise.reject(h)},o.prototype.getRunningTrackCapabilities=function(){if(this.localMediaStream==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";if(this.localMediaStream.getVideoTracks().length===0)throw"No video tracks found";var a=this.localMediaStream.getVideoTracks()[0];return a.getCapabilities()},o.prototype.applyVideoConstraints=function(a){var f=this;if(a){if(!Pa.isMediaStreamConstraintsValid(a,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";if(this.localMediaStream===null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";if(this.localMediaStream.getVideoTracks().length===0)throw"No video tracks found";return new Promise(function(h,d){if("aspectRatio"in a){d("Chaning 'aspectRatio' in run-time is not yet supported.");return}var x=f.localMediaStream.getVideoTracks()[0];x.applyConstraints(a).then(function(p){h(p)}).catch(function(p){d(p)})})},o.getCamerasFromMediaDevices=function(){return new Promise(function(a,f){navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(function(h){var d=function(x){for(var p=x.getVideoTracks(),T=0,m=p;Ta&&(d.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),S=a),S};T(p.width),T(p.height),p.width=m(p.width)},o.prototype.validateQrboxConfig=function(a){if(typeof a!="number"&&typeof a!="function"&&(a.width===void 0||a.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},o.prototype.toQrdimensions=function(a,f,h){if(typeof h=="number")return{width:h,height:h};if(typeof h=="function")try{return h(a,f)}catch(d){throw new Error("qrbox config was passed as a function but it failed with unknown error"+d)}return h},o.prototype.setupUi=function(a,f,h){h.isShadedBoxEnabled()&&this.validateQrboxSize(a,f,h);var d=hr(h.qrbox)?{width:a,height:f}:h.qrbox;this.validateQrboxConfig(d);var x=this.toQrdimensions(a,f,d);x.height>f&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var p=h.isShadedBoxEnabled()&&x.height<=f,T={x:0,y:0,width:a,height:f},m=p?this.getShadedRegionBounds(a,f,x):T,S=this.createCanvasElement(m.width,m.height),M=S.getContext("2d");M.canvas.width=m.width,M.canvas.height=m.height,this.element.append(S),p&&this.possiblyInsertShadingElement(this.element,a,f,x),this.createScannerPausedUiElement(this.element),this.qrRegion=m,this.context=M,this.canvasElement=S},o.prototype.createScannerPausedUiElement=function(a){var f=document.createElement("div");f.innerText="Scanner paused",f.style.display="none",f.style.position="absolute",f.style.top="0px",f.style.zIndex="1",f.style.background="yellow",f.style.textAlign="center",f.style.width="100%",a.appendChild(f),this.scannerPausedUiElement=f},o.prototype.scanContext=function(a,f){var h=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(d){return a(d.text,To.createFromQrcodeResult(d)),h.possiblyUpdateShaders(!0),!0}).catch(function(d){h.possiblyUpdateShaders(!1);var x=Or.codeParseError(d);return f(x,Ba.createFrom(x)),!1})},o.prototype.foreverScan=function(a,f,h){var d=this;if(!!this.shouldScan&&!!this.localMediaStream){var x=this.videoElement,p=x.videoWidth/x.clientWidth,T=x.videoHeight/x.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var m=this.qrRegion.width*p,S=this.qrRegion.height*T,M=this.qrRegion.x*p,j=this.qrRegion.y*T;this.context.drawImage(x,M,j,m,S,0,0,this.qrRegion.width,this.qrRegion.height);var U=function(){d.foreverScanTimeout=setTimeout(function(){d.foreverScan(a,f,h)},d.getTimeoutFps(a.fps))};this.scanContext(f,h).then(function(ne){!ne&&a.disableFlip!==!0?(d.context.translate(d.context.canvas.width,0),d.context.scale(-1,1),d.scanContext(f,h).finally(function(){U()})):U()}).catch(function(ne){d.logger.logError("Error happend while scanning context",ne),U()})}},o.prototype.onMediaStreamReceived=function(a,f,h,d,x,p){var T=this,m=this;return new Promise(function(S,M){var j=function(){var K=T.createVideoElement(d);m.element.append(K),K.onabort=M,K.onerror=M;var fe=function(){var ue=K.clientWidth,$=K.clientHeight;m.setupUi(ue,$,f),m.foreverScan(f,x,p),K.removeEventListener("playing",fe),S(null)};K.addEventListener("playing",fe),K.srcObject=a,K.play(),m.videoElement=K};if(m.localMediaStream=a,h||!f.aspectRatio)j();else{var U={aspectRatio:f.aspectRatio},ne=a.getVideoTracks()[0];ne.applyConstraints(U).then(function(K){return j()}).catch(function(K){m.logger.logErrors(["[Html5Qrcode] Constriants could not be satisfied, ignoring constraints",K]),j()})}})},o.prototype.createVideoConstraints=function(a){if(typeof a=="string")return{deviceId:{exact:a}};if(typeof a=="object"){var f="facingMode",h="deviceId",d={user:!0,environment:!0},x="exact",p=function(K){if(K in d)return!0;throw"config has invalid 'facingMode' value = "+("'"+K+"'")},T=Object.keys(a);if(T.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+(" if passed as an object, found "+T.length+" keys");var m=Object.keys(a)[0];if(m!==f&&m!==h)throw"Only '"+f+"' and '"+h+"' are supported for 'cameraIdOrConfig'";if(m===f){var S=a.facingMode;if(typeof S=="string"){if(p(S))return{facingMode:S}}else if(typeof S=="object")if(x in S){if(p(S[""+x]))return{facingMode:{exact:S[""+x]}}}else throw"'facingMode' should be string or object with"+(" "+x+" as key.");else{var M=typeof S;throw"Invalid type of 'facingMode' = "+M}}else{var j=a.deviceId;if(typeof j=="string")return{deviceId:j};if(typeof j=="object"){if(x in j)return{deviceId:{exact:j[""+x]}};throw"'deviceId' should be string or object with"+(" "+x+" as key.")}else{var U=typeof j;throw"Invalid type of 'deviceId' = "+U}}}var ne=typeof a;throw"Invalid type of 'cameraIdOrConfig' = "+ne},o.prototype.computeCanvasDrawConfig=function(a,f,h,d){if(a<=h&&f<=d){var x=(h-a)/2,p=(d-f)/2;return{x,y:p,width:a,height:f}}else{var T=a,m=f;return a>h&&(f=h/a*f,a=h),f>d&&(a=d/f*a,f=d),this.logger.log("Image downsampled from "+(T+"X"+m)+(" to "+a+"X"+f+".")),this.computeCanvasDrawConfig(a,f,h,d)}},o.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var a=document.getElementById(this.elementId);a&&(a.innerHTML="")},o.prototype.createVideoElement=function(a){var f=document.createElement("video");return f.style.width=a+"px",f.muted=!0,f.setAttribute("muted","true"),f.playsInline=!0,f},o.prototype.possiblyUpdateShaders=function(a){this.qrMatch!==a&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(f){f.style.backgroundColor=a?Xt.BORDER_SHADER_MATCH_COLOR:Xt.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=a)},o.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},o.prototype.createCanvasElement=function(a,f,h){var d=a,x=f,p=document.createElement("canvas");return p.style.width=d+"px",p.style.height=x+"px",p.style.display="none",p.id=hr(h)?"qr-canvas":h,p},o.prototype.getShadedRegionBounds=function(a,f,h){if(h.width>a||h.height>f)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(a-h.width)/2,y:(f-h.height)/2,width:h.width,height:h.height}},o.prototype.possiblyInsertShadingElement=function(a,f,h,d){if(!(f-d.width<1||h-d.height<1)){var x=document.createElement("div");x.style.position="absolute";var p=(f-d.width)/2,T=(h-d.height)/2;if(x.style.borderLeft=p+"px solid #0000007a",x.style.borderRight=p+"px solid #0000007a",x.style.borderTop=T+"px solid #0000007a",x.style.borderBottom=T+"px solid #0000007a",x.style.boxSizing="border-box",x.style.top="0px",x.style.bottom="0px",x.style.left="0px",x.style.right="0px",x.id=""+Xt.SHADED_REGION_ELEMENT_ID,f-d.width<11||h-d.height<11)this.hasBorderShaders=!1;else{var m=5,S=40;this.insertShaderBorders(x,S,m,-m,0,!0),this.insertShaderBorders(x,S,m,-m,0,!1),this.insertShaderBorders(x,S,m,d.height+m,0,!0),this.insertShaderBorders(x,S,m,d.height+m,0,!1),this.insertShaderBorders(x,m,S+m,-m,-m,!0),this.insertShaderBorders(x,m,S+m,d.height+m-S,-m,!0),this.insertShaderBorders(x,m,S+m,-m,-m,!1),this.insertShaderBorders(x,m,S+m,d.height+m-S,-m,!1),this.hasBorderShaders=!0}a.append(x)}},o.prototype.insertShaderBorders=function(a,f,h,d,x,p){var T=document.createElement("div");T.style.position="absolute",T.style.backgroundColor=Xt.BORDER_SHADER_DEFAULT_COLOR,T.style.width=f+"px",T.style.height=h+"px",T.style.top=d+"px",p?T.style.left=x+"px":T.style.right=x+"px",this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(T),a.appendChild(T)},o.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},o.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},o.prototype.getTimeoutFps=function(a){return 1e3/a},o}(),Ds="data:image/svg+xml;base64,",s0=Ds+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNzEuNjQzIDM3MS42NDMiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDM3MS42NDMgMzcxLjY0MyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZD0iTTEwNS4wODQgMzguMjcxaDE2My43Njh2MjBIMTA1LjA4NHoiLz48cGF0aCBkPSJNMzExLjU5NiAxOTAuMTg5Yy03LjQ0MS05LjM0Ny0xOC40MDMtMTYuMjA2LTMyLjc0My0yMC41MjJWMzBjMC0xNi41NDItMTMuNDU4LTMwLTMwLTMwSDEyNS4wODRjLTE2LjU0MiAwLTMwIDEzLjQ1OC0zMCAzMHYxMjAuMTQzaC04LjI5NmMtMTYuNTQyIDAtMzAgMTMuNDU4LTMwIDMwdjEuMzMzYTI5LjgwNCAyOS44MDQgMCAwIDAgNC42MDMgMTUuOTM5Yy03LjM0IDUuNDc0LTEyLjEwMyAxNC4yMjEtMTIuMTAzIDI0LjA2MXYxLjMzM2MwIDkuODQgNC43NjMgMTguNTg3IDEyLjEwMyAyNC4wNjJhMjkuODEgMjkuODEgMCAwIDAtNC42MDMgMTUuOTM4djEuMzMzYzAgMTYuNTQyIDEzLjQ1OCAzMCAzMCAzMGg4LjMyNGMuNDI3IDExLjYzMSA3LjUwMyAyMS41ODcgMTcuNTM0IDI2LjE3Ny45MzEgMTAuNTAzIDQuMDg0IDMwLjE4NyAxNC43NjggNDUuNTM3YTkuOTg4IDkuOTg4IDAgMCAwIDguMjE2IDQuMjg4IDkuOTU4IDkuOTU4IDAgMCAwIDUuNzA0LTEuNzkzYzQuNTMzLTMuMTU1IDUuNjUtOS4zODggMi40OTUtMTMuOTIxLTYuNzk4LTkuNzY3LTkuNjAyLTIyLjYwOC0xMC43Ni0zMS40aDgyLjY4NWMuMjcyLjQxNC41NDUuODE4LjgxNSAxLjIxIDMuMTQyIDQuNTQxIDkuMzcyIDUuNjc5IDEzLjkxMyAyLjUzNCA0LjU0Mi0zLjE0MiA1LjY3Ny05LjM3MSAyLjUzNS0xMy45MTMtMTEuOTE5LTE3LjIyOS04Ljc4Ny0zNS44ODQgOS41ODEtNTcuMDEyIDMuMDY3LTIuNjUyIDEyLjMwNy0xMS43MzIgMTEuMjE3LTI0LjAzMy0uODI4LTkuMzQzLTcuMTA5LTE3LjE5NC0xOC42NjktMjMuMzM3YTkuODU3IDkuODU3IDAgMCAwLTEuMDYxLS40ODZjLS40NjYtLjE4Mi0xMS40MDMtNC41NzktOS43NDEtMTUuNzA2IDEuMDA3LTYuNzM3IDE0Ljc2OC04LjI3MyAyMy43NjYtNy42NjYgMjMuMTU2IDEuNTY5IDM5LjY5OCA3LjgwMyA0Ny44MzYgMTguMDI2IDUuNzUyIDcuMjI1IDcuNjA3IDE2LjYyMyA1LjY3MyAyOC43MzMtLjQxMyAyLjU4NS0uODI0IDUuMjQxLTEuMjQ1IDcuOTU5LTUuNzU2IDM3LjE5NC0xMi45MTkgODMuNDgzLTQ5Ljg3IDExNC42NjEtNC4yMjEgMy41NjEtNC43NTYgOS44Ny0xLjE5NCAxNC4wOTJhOS45OCA5Ljk4IDAgMCAwIDcuNjQ4IDMuNTUxIDkuOTU1IDkuOTU1IDAgMCAwIDYuNDQ0LTIuMzU4YzQyLjY3Mi0zNi4wMDUgNTAuODAyLTg4LjUzMyA1Ni43MzctMTI2Ljg4OC40MTUtMi42ODQuODIxLTUuMzA5IDEuMjI5LTcuODYzIDIuODM0LTE3LjcyMS0uNDU1LTMyLjY0MS05Ljc3Mi00NC4zNDV6bS0yMzIuMzA4IDQyLjYyYy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi0xLjMzM2MwLTUuNTE0IDQuNDg2LTEwIDEwLTEwaDE1djIxLjMzM2gtMTV6bS0yLjUtNTIuNjY2YzAtNS41MTQgNC40ODYtMTAgMTAtMTBoNy41djIxLjMzM2gtNy41Yy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi0xLjMzM3ptMTcuNSA5My45OTloLTcuNWMtNS41MTQgMC0xMC00LjQ4Ni0xMC0xMHYtMS4zMzNjMC01LjUxNCA0LjQ4Ni0xMCAxMC0xMGg3LjV2MjEuMzMzem0zMC43OTYgMjguODg3Yy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi04LjI3MWg5MS40NTdjLS44NTEgNi42NjgtLjQzNyAxMi43ODcuNzMxIDE4LjI3MWgtODIuMTg4em03OS40ODItMTEzLjY5OGMtMy4xMjQgMjAuOTA2IDEyLjQyNyAzMy4xODQgMjEuNjI1IDM3LjA0IDUuNDQxIDIuOTY4IDcuNTUxIDUuNjQ3IDcuNzAxIDcuMTg4LjIxIDIuMTUtMi41NTMgNS42ODQtNC40NzcgNy4yNTEtLjQ4Mi4zNzgtLjkyOS44LTEuMzM1IDEuMjYxLTYuOTg3IDcuOTM2LTExLjk4MiAxNS41Mi0xNS40MzIgMjIuNjg4aC05Ny41NjRWMzBjMC01LjUxNCA0LjQ4Ni0xMCAxMC0xMGgxMjMuNzY5YzUuNTE0IDAgMTAgNC40ODYgMTAgMTB2MTM1LjU3OWMtMy4wMzItLjM4MS02LjE1LS42OTQtOS4zODktLjkxNC0yNS4xNTktMS42OTQtNDIuMzcgNy43NDgtNDQuODk4IDI0LjY2NnoiLz48cGF0aCBkPSJNMTc5LjEyOSA4My4xNjdoLTI0LjA2YTUgNSAwIDAgMC01IDV2MjQuMDYxYTUgNSAwIDAgMCA1IDVoMjQuMDZhNSA1IDAgMCAwIDUtNVY4OC4xNjdhNSA1IDAgMCAwLTUtNXpNMTcyLjYyOSAxNDIuODZoLTEyLjU2VjEzMC44YTUgNSAwIDEgMC0xMCAwdjE3LjA2MWE1IDUgMCAwIDAgNSA1aDE3LjU2YTUgNSAwIDEgMCAwLTEwLjAwMXpNMjE2LjU2OCA4My4xNjdoLTI0LjA2YTUgNSAwIDAgMC01IDV2MjQuMDYxYTUgNSAwIDAgMCA1IDVoMjQuMDZhNSA1IDAgMCAwIDUtNVY4OC4xNjdhNSA1IDAgMCAwLTUtNXptLTUgMjQuMDYxaC0xNC4wNlY5My4xNjdoMTQuMDZ2MTQuMDYxek0yMTEuNjY5IDEyNS45MzZIMTk3LjQxYTUgNSAwIDAgMC01IDV2MTQuMjU3YTUgNSAwIDAgMCA1IDVoMTQuMjU5YTUgNSAwIDAgMCA1LTV2LTE0LjI1N2E1IDUgMCAwIDAtNS01eiIvPjwvc3ZnPg==",o0=Ds+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1OS4wMTggNTkuMDE4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1OS4wMTggNTkuMDE4IiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJtNTguNzQxIDU0LjgwOS01Ljk2OS02LjI0NGExMC43NCAxMC43NCAwIDAgMCAyLjgyLTcuMjVjMC01Ljk1My00Ljg0My0xMC43OTYtMTAuNzk2LTEwLjc5NlMzNCAzNS4zNjEgMzQgNDEuMzE0IDM4Ljg0MyA1Mi4xMSA0NC43OTYgNTIuMTFjMi40NDEgMCA0LjY4OC0uODI0IDYuNDk5LTIuMTk2bDYuMDAxIDYuMjc3YS45OTguOTk4IDAgMCAwIDEuNDE0LjAzMiAxIDEgMCAwIDAgLjAzMS0xLjQxNHpNMzYgNDEuMzE0YzAtNC44NSAzLjk0Ni04Ljc5NiA4Ljc5Ni04Ljc5NnM4Ljc5NiAzLjk0NiA4Ljc5NiA4Ljc5Ni0zLjk0NiA4Ljc5Ni04Ljc5NiA4Ljc5NlMzNiA0Ni4xNjQgMzYgNDEuMzE0ek0xMC40MzEgMTYuMDg4YzAgMy4wNyAyLjQ5OCA1LjU2OCA1LjU2OSA1LjU2OHM1LjU2OS0yLjQ5OCA1LjU2OS01LjU2OGMwLTMuMDcxLTIuNDk4LTUuNTY5LTUuNTY5LTUuNTY5cy01LjU2OSAyLjQ5OC01LjU2OSA1LjU2OXptOS4xMzggMGMwIDEuOTY4LTEuNjAyIDMuNTY4LTMuNTY5IDMuNTY4cy0zLjU2OS0xLjYwMS0zLjU2OS0zLjU2OCAxLjYwMi0zLjU2OSAzLjU2OS0zLjU2OSAzLjU2OSAxLjYwMSAzLjU2OSAzLjU2OXoiLz48cGF0aCBkPSJtMzAuODgyIDI4Ljk4NyA5LjE4LTEwLjA1NCAxMS4yNjIgMTAuMzIzYTEgMSAwIDAgMCAxLjM1MS0xLjQ3NWwtMTItMTFhMSAxIDAgMCAwLTEuNDE0LjA2M2wtOS43OTQgMTAuNzI3LTQuNzQzLTQuNzQzYTEuMDAzIDEuMDAzIDAgMCAwLTEuMzY4LS4wNDRMNi4zMzkgMzcuNzY4YTEgMSAwIDEgMCAxLjMyMiAxLjUwMWwxNi4zMTMtMTQuMzYyIDcuMzE5IDcuMzE4YS45OTkuOTk5IDAgMSAwIDEuNDE0LTEuNDE0bC0xLjgyNS0xLjgyNHoiLz48cGF0aCBkPSJNMzAgNDYuNTE4SDJ2LTQyaDU0djI4YTEgMSAwIDEgMCAyIDB2LTI5YTEgMSAwIDAgMC0xLTFIMWExIDEgMCAwIDAtMSAxdjQ0YTEgMSAwIDAgMCAxIDFoMjlhMSAxIDAgMSAwIDAtMnoiLz48L3N2Zz4=",No=Ds+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NjAgNDYwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0NjAgNDYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJNMjMwIDBDMTAyLjk3NSAwIDAgMTAyLjk3NSAwIDIzMHMxMDIuOTc1IDIzMCAyMzAgMjMwIDIzMC0xMDIuOTc0IDIzMC0yMzBTMzU3LjAyNSAwIDIzMCAwem0zOC4zMzMgMzc3LjM2YzAgOC42NzYtNy4wMzQgMTUuNzEtMTUuNzEgMTUuNzFoLTQzLjEwMWMtOC42NzYgMC0xNS43MS03LjAzNC0xNS43MS0xNS43MVYyMDIuNDc3YzAtOC42NzYgNy4wMzMtMTUuNzEgMTUuNzEtMTUuNzFoNDMuMTAxYzguNjc2IDAgMTUuNzEgNy4wMzMgMTUuNzEgMTUuNzFWMzc3LjM2ek0yMzAgMTU3Yy0yMS41MzkgMC0zOS0xNy40NjEtMzktMzlzMTcuNDYxLTM5IDM5LTM5IDM5IDE3LjQ2MSAzOSAzOS0xNy40NjEgMzktMzkgMzl6Ii8+PC9zdmc+",a0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAQgAAAEIBarqQRAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAE1SURBVDiNfdI7S0NBEAXgLya1otFgpbYSbISAgpXYi6CmiH9KCAiChaVga6OiWPgfRDQ+0itaGVNosXtluWwcuMzePfM4M3sq8lbHBubwg1dc4m1E/J/N4ghDPOIsfk/4xiEao5KX0McFljN4C9d4QTPXuY99jP3DsIoDPGM6BY5i5yI5R7O4q+ImFkJY2DCh3cAH2klyB+9J1xUMMAG7eCh1a+Mr+k48b5diXrFVwwLuS+BJ9MfR7+G0FHOHhTHhnXNWS87VDF4pcnfQK4Ep7XScNLmPTZgURNKKYENYWDpzW1BhscS1WHS8CDgURFJQrWcoF3c13KKbgg1BYQfy8xZWEzTTw1QZbAoKu8FqJnktdu5hcVSHmchiILzzuaDQvjBzV2m8yohCE1jHfPx/xhU+y4G/D75ELlRJsSYAAAAASUVORK5CYII=",_o=function(){function o(){}return o.createDefault=function(){return{hasPermission:!1,lastUsedCameraId:null}},o}(),l0=function(){function o(){this.data=_o.createDefault();var a=localStorage.getItem(o.LOCAL_STORAGE_KEY);a?this.data=JSON.parse(a):this.reset()}return o.prototype.hasCameraPermissions=function(){return this.data.hasPermission},o.prototype.getLastUsedCameraId=function(){return this.data.lastUsedCameraId},o.prototype.setHasPermission=function(a){this.data.hasPermission=a,this.flush()},o.prototype.setLastUsedCameraId=function(a){this.data.lastUsedCameraId=a,this.flush()},o.prototype.resetLastUsedCameraId=function(){this.data.lastUsedCameraId=null,this.flush()},o.prototype.reset=function(){this.data=_o.createDefault(),this.flush()},o.prototype.flush=function(){localStorage.setItem(o.LOCAL_STORAGE_KEY,JSON.stringify(this.data))},o.LOCAL_STORAGE_KEY="HTML5_QRCODE_DATA",o}(),c0=function(){function o(){this.infoDiv=document.createElement("div")}return o.prototype.renderInto=function(a){this.infoDiv.style.position="absolute",this.infoDiv.style.top="10px",this.infoDiv.style.right="10px",this.infoDiv.style.zIndex="2",this.infoDiv.style.display="none",this.infoDiv.style.padding="5pt",this.infoDiv.style.border="1px solid silver",this.infoDiv.style.fontSize="10pt",this.infoDiv.style.background="rgb(248 248 248)",this.infoDiv.innerText=So.builtUsing();var f=document.createElement("a");f.innerText="html5-qrcode",f.href="https://github.com/mebjas/html5-qrcode",f.target="new",this.infoDiv.appendChild(f);var h=document.createElement("br"),d=document.createElement("br");this.infoDiv.appendChild(h),this.infoDiv.appendChild(d);var x=document.createElement("a");x.innerText=So.reportIssues(),x.href="https://github.com/mebjas/html5-qrcode/issues",x.target="new",this.infoDiv.appendChild(x),a.appendChild(this.infoDiv)},o.prototype.show=function(){this.infoDiv.style.display="block"},o.prototype.hide=function(){this.infoDiv.style.display="none"},o}(),f0=function(){function o(a,f){this.isShowingInfoIcon=!0,this.onTapIn=a,this.onTapOut=f,this.infoIcon=document.createElement("img")}return o.prototype.renderInto=function(a){var f=this;this.infoIcon.alt="Info icon",this.infoIcon.src=No,this.infoIcon.style.position="absolute",this.infoIcon.style.top="4px",this.infoIcon.style.right="4px",this.infoIcon.style.opacity="0.6",this.infoIcon.style.cursor="pointer",this.infoIcon.style.zIndex="2",this.infoIcon.style.width="16px",this.infoIcon.style.height="16px",this.infoIcon.onmouseover=function(h){return f.onHoverIn()},this.infoIcon.onmouseout=function(h){return f.onHoverOut()},this.infoIcon.onclick=function(h){return f.onClick()},a.appendChild(this.infoIcon)},o.prototype.onHoverIn=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="1")},o.prototype.onHoverOut=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="0.6")},o.prototype.onClick=function(){this.isShowingInfoIcon?(this.isShowingInfoIcon=!1,this.onTapIn(),this.infoIcon.src=a0,this.infoIcon.style.opacity="1"):(this.isShowingInfoIcon=!0,this.onTapOut(),this.infoIcon.src=No,this.infoIcon.style.opacity="0.6")},o}(),u0=function(){function o(){var a=this;this.infoDiv=new c0,this.infoIcon=new f0(function(){a.infoDiv.show()},function(){a.infoDiv.hide()})}return o.prototype.renderInto=function(a){this.infoDiv.renderInto(a),this.infoIcon.renderInto(a)},o}(),Mo=function(){function o(){}return o.hasCameraPermissions=function(){return new Promise(function(a,f){navigator.mediaDevices.enumerateDevices().then(function(h){h.forEach(function(d){d.kind==="videoinput"&&d.label&&a(!0)}),a(!1)})})},o}(),xn=function(){function o(a){this.supportedScanTypes=this.validateAndReturnScanTypes(a)}return o.prototype.getDefaultScanType=function(){return this.supportedScanTypes[0]},o.prototype.hasMoreThanOneScanType=function(){return this.supportedScanTypes.length>1},o.prototype.isCameraScanRequired=function(){for(var a=0,f=this.supportedScanTypes;af)throw"Max "+f+" values expected for supportedScanTypes";for(var h=0,d=a;h0?(a.removeChild(f),d.renderCameraSelection(p)):(d.setHeaderMessage(Jt.noCameraFound(),Zt.STATUS_WARNING),x())}).catch(function(p){d.persistedDataManager.setHasPermission(!1),h?h.disabled=!1:x(),d.setHeaderMessage(p,Zt.STATUS_WARNING)})},o.prototype.createPermissionButton=function(a,f){var h=this,d=document.createElement("button");d.id=this.getCameraPermissionButtonId(),d.innerText=Jt.cameraPermissionTitle(),d.addEventListener("click",function(){d.disabled=!0,h.createCameraListUi(a,f,d)}),f.appendChild(d)},o.prototype.createPermissionsUi=function(a,f){var h=this;if(xn.isCameraScanType(this.currentScanType)&&this.persistedDataManager.hasCameraPermissions()){Mo.hasCameraPermissions().then(function(d){d?h.createCameraListUi(a,f):(h.persistedDataManager.setHasPermission(!1),h.createPermissionButton(a,f))}).catch(function(d){h.persistedDataManager.setHasPermission(!1),h.createPermissionButton(a,f)});return}this.createPermissionButton(a,f)},o.prototype.createSectionControlPanel=function(){var a=document.getElementById(this.getDashboardSectionId()),f=document.createElement("div");a.appendChild(f);var h=document.createElement("div");h.id=this.getDashboardSectionCameraScanRegionId(),h.style.display=xn.isCameraScanType(this.currentScanType)?"block":"none",f.appendChild(h);var d=document.createElement("div");d.style.textAlign="center",h.appendChild(d),this.scanTypeSelector.isCameraScanRequired()&&this.createPermissionsUi(h,d),this.renderFileScanUi(f)},o.prototype.renderFileScanUi=function(a){var f=this,h=document.createElement("div");h.id=this.getDashboardSectionFileScanRegionId(),h.style.textAlign="center",h.style.display=xn.isCameraScanType(this.currentScanType)?"none":"block",a.appendChild(h);var d=document.createElement("input");d.id=this.getFileScanInputId(),d.accept="image/*",d.type="file",d.style.width="200px",d.disabled=xn.isCameraScanType(this.currentScanType);var x=document.createElement("span");x.innerText=" Select Image",h.appendChild(d),h.appendChild(x),d.addEventListener("change",function(p){if(!f.html5Qrcode)throw"html5Qrcode not defined";if(!(p==null||p.target==null)&&!!xn.isFileScanType(f.currentScanType)&&p.target.files.length!==0){var T=p.target.files[0];f.html5Qrcode.scanFileV2(T,!0).then(function(m){f.resetHeaderMessage(),f.qrCodeSuccessCallback(m.decodedText,m)}).catch(function(m){f.setHeaderMessage(m,Zt.STATUS_WARNING),f.qrCodeErrorCallback(m,Ba.createFrom(m))})}})},o.prototype.renderCameraSelection=function(a){var f=this,h=this,d=document.getElementById(this.getDashboardSectionCameraScanRegionId());d.style.textAlign="center";var x=document.createElement("span");x.style.marginRight="10px";var p=a.length,T=document.createElement("select");if(p===1)T.style.display="none";else{var m=Jt.selectCamera();x.innerText=m+" ("+a.length+") "}T.id=this.getCameraSelectionId();for(var S=[],M=0,j=a;M",f.appendChild(this.cameraScanImage);return}this.cameraScanImage=new Image,this.cameraScanImage.onload=function(h){f.innerHTML="
",f.appendChild(a.cameraScanImage)},this.cameraScanImage.width=64,this.cameraScanImage.style.opacity="0.8",this.cameraScanImage.src=s0},o.prototype.insertFileScanImageToScanRegion=function(){var a=this,f=document.getElementById(this.getScanRegionId());if(this.fileScanImage){f.innerHTML="
",f.appendChild(this.fileScanImage);return}this.fileScanImage=new Image,this.fileScanImage.onload=function(h){f.innerHTML="
",f.appendChild(a.fileScanImage)},this.fileScanImage.width=64,this.fileScanImage.style.opacity="0.8",this.fileScanImage.src=o0},o.prototype.clearScanRegion=function(){var a=document.getElementById(this.getScanRegionId());a.innerHTML=""},o.prototype.getDashboardSectionId=function(){return this.elementId+"__dashboard_section"},o.prototype.getDashboardSectionCameraScanRegionId=function(){return this.elementId+"__dashboard_section_csr"},o.prototype.getDashboardSectionFileScanRegionId=function(){return this.elementId+"__dashboard_section_fsr"},o.prototype.getDashboardSectionSwapLinkId=function(){return this.elementId+"__dashboard_section_swaplink"},o.prototype.getScanRegionId=function(){return this.elementId+"__scan_region"},o.prototype.getDashboardId=function(){return this.elementId+"__dashboard"},o.prototype.getFileScanInputId=function(){return this.elementId+"__filescan_input"},o.prototype.getStatusSpanId=function(){return this.elementId+"__status_span"},o.prototype.getHeaderMessageContainerId=function(){return this.elementId+"__header_message"},o.prototype.getCameraSelectionId=function(){return this.elementId+"__camera_selection"},o.prototype.getCameraPermissionButtonId=function(){return this.elementId+"__camera_permission_button"},o.prototype.getCameraScanRegion=function(){return document.getElementById(this.getDashboardSectionCameraScanRegionId())},o.prototype.getFileScanRegion=function(){return document.getElementById(this.getDashboardSectionFileScanRegionId())},o.prototype.getFileScanInput=function(){return document.getElementById(this.getFileScanInputId())},o.prototype.getDashboardSectionSwapLink=function(){return document.getElementById(this.getDashboardSectionSwapLinkId())},o.prototype.getHeaderMessageDiv=function(){return document.getElementById(this.getHeaderMessageContainerId())},o}();const x0={id:"qr-code-full-region"},A0=bs({props:{qrbox:null,fps:null},emits:["decodedCode"],setup(o,{emit:a}){const f=o;var h={fps:f.fps?f.fps:10};let d="";f.qrbox&&(h.qrbox=f.qrbox);function x(m,S){d!==m&&(d=m,a("decodedCode",m,S))}function p(m,S){}async function T(){await na();var m=new g0("qr-code-full-region",h,void 0);m.render(x,p)}return T(),(m,S)=>(_s(),_a("div",x0))}}),w0={class:"section",style:{width:"500px",margin:"auto"}},E0=bs({setup(o){let a=s1("");const f=function(h,d){console.log(`Scan result ${h}`,d),a.value=`\u5167\u5BB9:${h}`};return(h,d)=>(_s(),_a($t,null,[ci("div",w0,[En(A0,{qrbox:250,fps:10,style:{width:"500px"},onDecodedCode:f})]),ci("div",null,Il($o(a)),1)],64))}});const p0=bs({setup(o){return(a,f)=>(_s(),rc(E0))}});zc(p0).mount("#app"); +`),e.toString()}setMode(e){this.mode=e}setECLevel(e){this.ecLevel=e}setVersion(e){this.version=e}setMaskPattern(e){this.maskPattern=e}setMatrix(e){this.matrix=e}static isValidMaskPattern(e){return e>=0&&e0;){for(s===6&&(s-=1);l>=0&&l=n;)e^=t<=0)for(let c=0;c!==s;c++){const u=r[c];u>=0&&xe.isEmpty(t.get(u,l))&&xe.embedPositionAdjustmentPattern(u-2,l-2,t)}}}}xe.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),xe.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),xe.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),xe.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),xe.VERSION_INFO_POLY=7973,xe.TYPE_INFO_POLY=1335,xe.TYPE_INFO_MASK_PATTERN=21522;class ol{constructor(e,t){this.dataBytes=e,this.errorCorrectionBytes=t}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class nt{constructor(){}static calculateMaskPenalty(e){return lt.applyMaskPenaltyRule1(e)+lt.applyMaskPenaltyRule2(e)+lt.applyMaskPenaltyRule3(e)+lt.applyMaskPenaltyRule4(e)}static encode(e,t,n=null){let r=nt.DEFAULT_BYTE_MODE_ENCODING;const i=n!==null&&n.get(gt.CHARACTER_SET)!==void 0;i&&(r=n.get(gt.CHARACTER_SET).toString());const s=this.chooseMode(e,r),l=new Ee;if(s===ge.BYTE&&(i||nt.DEFAULT_BYTE_MODE_ENCODING!==r)){const Z=V.getCharacterSetECIByName(r);Z!==void 0&&this.appendECI(Z,l)}this.appendModeInfo(s,l);const c=new Ee;this.appendBytes(e,s,c,r);let u;if(n!==null&&n.get(gt.QR_VERSION)!==void 0){const Z=Number.parseInt(n.get(gt.QR_VERSION).toString(),10);u=ce.getVersionForNumber(Z);const W=this.calculateBitsNeeded(s,l,c,u);if(!this.willFit(W,u,t))throw new Ke("Data too big for requested version")}else u=this.recommendVersion(t,s,l,c);const g=new Ee;g.appendBitArray(l);const w=s===ge.BYTE?c.getSizeInBytes():e.length;this.appendLengthInfo(w,u,s,g),g.appendBitArray(c);const E=u.getECBlocksForLevel(t),I=u.getTotalCodewords()-E.getTotalECCodewords();this.terminateBits(I,g);const y=this.interleaveWithECBytes(g,u.getTotalCodewords(),I,E.getNumBlocks()),N=new Hn;N.setECLevel(t),N.setMode(s),N.setVersion(u);const O=u.getDimensionForVersion(),B=new Kr(O,O),X=this.chooseMaskPattern(y,t,u,B);return N.setMaskPattern(X),xe.buildMatrix(y,t,u,X,B),N.setMatrix(B),N}static recommendVersion(e,t,n,r){const i=this.calculateBitsNeeded(t,n,r,ce.getVersionForNumber(1)),s=this.chooseVersion(i,e),l=this.calculateBitsNeeded(t,n,r,s);return this.chooseVersion(l,e)}static calculateBitsNeeded(e,t,n,r){return t.getSize()+e.getCharacterCountBits(r)+n.getSize()}static getAlphanumericCode(e){return e159)&&(i<224||i>235))return!1}return!0}static chooseMaskPattern(e,t,n,r){let i=Number.MAX_SAFE_INTEGER,s=-1;for(let l=0;l=c}static terminateBits(e,t){const n=e*8;if(t.getSize()>n)throw new Ke("data bits cannot fit in the QR Code"+t.getSize()+" > "+n);for(let s=0;s<4&&t.getSize()0)for(let s=r;s<8;s++)t.appendBit(!1);const i=e-t.getSizeInBytes();for(let s=0;s=n)throw new Ke("Block ID too large");const l=e%n,c=n-l,u=Math.floor(e/n),g=u+1,w=Math.floor(t/n),E=w+1,I=u-w,y=g-E;if(I!==y)throw new Ke("EC bytes mismatch");if(n!==c+l)throw new Ke("RS blocks mismatch");if(e!==(w+I)*c+(E+y)*l)throw new Ke("Total bytes mismatch");r=1<=0&&t<=9}static appendNumericBytes(e,t){const n=e.length;let r=0;for(;r=33088&&c<=40956?u=c-33088:c>=57408&&c<=60351&&(u=c-49472),u===-1)throw new Ke("Invalid byte sequence");const g=(u>>8)*192+(u&255);t.appendBits(g,13)}}static appendECI(e,t){t.appendBits(ge.ECI.getBits(),4),t.appendBits(e.getValue(),8)}}nt.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),nt.DEFAULT_BYTE_MODE_ENCODING=V.UTF8.getName();class jn{write(e,t,n,r=null){if(e.length===0)throw new M("Found empty contents");if(t<0||n<0)throw new M("Requested dimensions are too small: "+t+"x"+n);let i=qe.L,s=jn.QUIET_ZONE_SIZE;r!==null&&(r.get(gt.ERROR_CORRECTION)!==void 0&&(i=qe.fromString(r.get(gt.ERROR_CORRECTION).toString())),r.get(gt.MARGIN)!==void 0&&(s=Number.parseInt(r.get(gt.MARGIN).toString(),10)));const l=nt.encode(e,i,r);return this.renderResult(l,t,n,s)}writeToDom(e,t,n,r,i=null){typeof e=="string"&&(e=document.querySelector(e));const s=this.write(t,n,r,i);e&&e.appendChild(s)}renderResult(e,t,n,r){const i=e.getMatrix();if(i===null)throw new _;const s=i.getWidth(),l=i.getHeight(),c=s+r*2,u=l+r*2,g=Math.max(t,c),w=Math.max(n,u),E=Math.min(Math.floor(g/c),Math.floor(w/u)),I=Math.floor((g-s*E)/2),y=Math.floor((w-l*E)/2),N=this.createSVGElement(g,w);for(let O=0,B=y;Ot||i+l>n)throw new M("Crop rectangle does not fit within image data.");c&&this.reverseHorizontal(s,l)}getRow(e,t){if(e<0||e>=this.getHeight())throw new M("Requested row is outside the image: "+e);const n=this.getWidth();(t==null||t.length>16&255,I=w>>7&510,y=w&255;u[g]=(E+I+y)/4&255}this.luminances=u}else this.luminances=e;if(r===void 0&&(this.dataWidth=t),i===void 0&&(this.dataHeight=n),s===void 0&&(this.left=0),l===void 0&&(this.top=0),this.left+t>this.dataWidth||this.top+n>this.dataHeight)throw new M("Crop rectangle does not fit within image data.")}getRow(e,t){if(e<0||e>=this.getHeight())throw new M("Requested row is outside the image: "+e);const n=this.getWidth();(t==null||t.length"}}class Bi extends or{constructor(e,t,n){super(e,0,0),this.binaryShiftStart=t,this.binaryShiftByteCount=n}appendTo(e,t){for(let n=0;n62?e.appendBits(this.binaryShiftByteCount-31,16):n===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(t[this.binaryShiftStart+n],8)}addBinaryShift(e,t){return new Bi(this,e,t)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function cl(A,e,t){return new Bi(A,e,t)}function _r(A,e,t){return new or(A,e,t)}const fl=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],_n=0,Qr=1,Yt=2,Xs=3,ln=4,ul=new or(null,0,0),vi=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,(10<<16)+(29<<5)+30]),Int32Array.from([(9<<16)+(30<<4)+14,0,(5<<16)+30,(5<<16)+29,(10<<16)+(29<<5)+30]),Int32Array.from([(4<<16)+14,(9<<16)+(14<<5)+28,0,(9<<16)+(14<<5)+29,(14<<16)+(14<<10)+(29<<5)+30]),Int32Array.from([(5<<16)+29,(5<<16)+28,(10<<16)+(29<<5)+30,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,(10<<16)+(31<<5)+28,(10<<16)+(31<<5)+30,(10<<16)+(31<<5)+29,0])];function hl(A){for(let e of A)$.fill(e,-1);return A[_n][ln]=0,A[Qr][ln]=0,A[Qr][_n]=28,A[Xs][ln]=0,A[Yt][ln]=0,A[Yt][_n]=15,A}const Zs=hl($.createInt32Array(6,6));class cn{constructor(e,t,n,r){this.token=e,this.mode=t,this.binaryShiftByteCount=n,this.bitCount=r}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(e,t){let n=this.bitCount,r=this.token;if(e!==this.mode){let s=vi[this.mode][e];r=_r(r,s&65535,s>>16),n+=s>>16}let i=e===Yt?4:5;return r=_r(r,t,i),new cn(r,e,0,n+i)}shiftAndAppend(e,t){let n=this.token,r=this.mode===Yt?4:5;return n=_r(n,Zs[this.mode][e],r),n=_r(n,t,5),new cn(n,this.mode,0,this.bitCount+r+5)}addBinaryShiftChar(e){let t=this.token,n=this.mode,r=this.bitCount;if(this.mode===ln||this.mode===Yt){let l=vi[n][_n];t=_r(t,l&65535,l>>16),r+=l>>16,n=_n}let i=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,s=new cn(t,n,this.binaryShiftByteCount+1,r+i);return s.binaryShiftByteCount===2047+31&&(s=s.endBinaryShift(e+1)),s}endBinaryShift(e){if(this.binaryShiftByteCount===0)return this;let t=this.token;return t=cl(t,e-this.binaryShiftByteCount,this.binaryShiftByteCount),new cn(t,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(e){let t=this.bitCount+(vi[this.mode][e.mode]>>16);return this.binaryShiftByteCounte.binaryShiftByteCount&&e.binaryShiftByteCount>0&&(t+=10),t<=e.bitCount}toBitArray(e){let t=[];for(let r=this.endBinaryShift(e.length).token;r!==null;r=r.getPrevious())t.unshift(r);let n=new Ee;for(const r of t)r.appendTo(n,e);return n}toString(){return le.format("%s bits=%d bytes=%d",fl[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(e){return e.binaryShiftByteCount>62?21:e.binaryShiftByteCount>31?20:e.binaryShiftByteCount>0?10:0}}cn.INITIAL_STATE=new cn(ul,_n,0,0);function dl(A){const e=le.getCharCode(" "),t=le.getCharCode("."),n=le.getCharCode(",");A[_n][e]=1;const r=le.getCharCode("Z"),i=le.getCharCode("A");for(let E=i;E<=r;E++)A[_n][E]=E-i+2;A[Qr][e]=1;const s=le.getCharCode("z"),l=le.getCharCode("a");for(let E=l;E<=s;E++)A[Qr][E]=E-l+2;A[Yt][e]=1;const c=le.getCharCode("9"),u=le.getCharCode("0");for(let E=u;E<=c;E++)A[Yt][E]=E-u+2;A[Yt][n]=12,A[Yt][t]=13;const g=["\0"," ","","","","","","","\x07","\b"," ",` +`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~","\x7F"];for(let E=0;E","?","[","]","{","}"];for(let E=0;E0&&(A[ln][le.getCharCode(w[E])]=E);return A}const Pi=dl($.createInt32Array(5,256));class Mr{constructor(e){this.text=e}encode(){const e=le.getCharCode(" "),t=le.getCharCode(` +`);let n=Gs.singletonList(cn.INITIAL_STATE);for(let i=0;i0?(n=Mr.updateStateListForPair(n,i,s),i++):n=this.updateStateListForChar(n,i)}return Gs.min(n,(i,s)=>i.getBitCount()-s.getBitCount()).toBitArray(this.text)}updateStateListForChar(e,t){const n=[];for(let r of e)this.updateStateForChar(r,t,n);return Mr.simplifyStates(n)}updateStateForChar(e,t,n){let r=this.text[t]&255,i=Pi[e.getMode()][r]>0,s=null;for(let l=0;l<=ln;l++){let c=Pi[l][r];if(c>0){if(s==null&&(s=e.endBinaryShift(t)),!i||l===e.getMode()||l===Yt){const u=s.latchAndAppend(l,c);n.push(u)}if(!i&&Zs[e.getMode()][l]>=0){const u=s.shiftAndAppend(l,c);n.push(u)}}}if(e.getBinaryShiftByteCount()>0||Pi[e.getMode()][r]===0){let l=e.addBinaryShiftChar(t);n.push(l)}}static updateStateListForPair(e,t,n){const r=[];for(let i of e)this.updateStateForPair(i,t,n,r);return this.simplifyStates(r)}static updateStateForPair(e,t,n,r){let i=e.endBinaryShift(t);if(r.push(i.latchAndAppend(ln,n)),e.getMode()!==ln&&r.push(i.shiftAndAppend(ln,n)),n===3||n===4){let s=i.latchAndAppend(Yt,16-n).latchAndAppend(Yt,1);r.push(s)}if(e.getBinaryShiftByteCount()>0){let s=e.addBinaryShiftChar(t).addBinaryShiftChar(t+1);r.push(s)}}static simplifyStates(e){let t=[];for(const n of e){let r=!0;for(const i of t){if(i.isBetterThanOrEqualTo(n)){r=!1;break}n.isBetterThanOrEqualTo(i)&&(t=t.filter(s=>s!==i))}r&&t.push(n)}return t}}class Be{constructor(){}static encodeBytes(e){return Be.encode(e,Be.DEFAULT_EC_PERCENT,Be.DEFAULT_AZTEC_LAYERS)}static encode(e,t,n){let r=new Mr(e).encode(),i=se.truncDivision(r.getSize()*t,100)+11,s=r.getSize()+i,l,c,u,g,w;if(n!==Be.DEFAULT_AZTEC_LAYERS){if(l=n<0,c=Math.abs(n),c>(l?Be.MAX_NB_BITS_COMPACT:Be.MAX_NB_BITS))throw new M(le.format("Illegal value %s for layers",n));u=Be.totalBitsInLayer(c,l),g=Be.WORD_SIZE[c];let W=u-u%g;if(w=Be.stuffBits(r,g),w.getSize()+i>W)throw new M("Data to large for user specified layer");if(l&&w.getSize()>g*64)throw new M("Data to large for user specified layer")}else{g=0,w=null;for(let W=0;;W++){if(W>Be.MAX_NB_BITS)throw new M("Data too large for an Aztec code");if(l=W<=3,c=l?W+1:W,u=Be.totalBitsInLayer(c,l),s>u)continue;(w==null||g!==Be.WORD_SIZE[c])&&(g=Be.WORD_SIZE[c],w=Be.stuffBits(r,g));let Me=u-u%g;if(!(l&&w.getSize()>g*64)&&w.getSize()+i<=Me)break}}let E=Be.generateCheckWords(w,u,g),I=w.getSize()/g,y=Be.generateModeMessage(l,c,I),N=(l?11:14)+c*4,O=new Int32Array(N),B;if(l){B=N;for(let W=0;W=r||e.get(s+c))&&(l|=1<0&&x[x.length-1])&&(S[0]===6||S[0]===2)){f=0;continue}if(S[0]===3&&(!x||S[1]>x[0]&&S[1]h&&(h=T,f=p)}if(!f)throw"No largest barcode found";return f},o.prototype.createBarcodeDetectorFormats=function(a){for(var f=[],h=0,d=a;h=T&&p()})})},o.prototype.scanFile=function(a,f){return this.scanFileV2(a,f).then(function(h){return h.decodedText})},o.prototype.scanFileV2=function(a,f){var h=this;if(!a||!(a instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(hr(f)&&(f=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(d,x){h.possiblyCloseLastScanImageFile(),h.clearElement(),h.lastScanImageFile=URL.createObjectURL(a);var p=new Image;p.onload=function(){var T=p.width,m=p.height,S=document.getElementById(h.elementId),M=S.clientWidth?S.clientWidth:Xt.DEFAULT_WIDTH,j=Math.max(S.clientHeight?S.clientHeight:m,Xt.FILE_SCAN_MIN_HEIGHT),U=h.computeCanvasDrawConfig(T,m,M,j);if(f){var ne=h.createCanvasElement(M,j,"qr-canvas-visible");ne.style.display="inline-block",S.appendChild(ne);var K=ne.getContext("2d");if(!K)throw"Unable to get 2d context from canvas";K.canvas.width=M,K.canvas.height=j,K.drawImage(p,0,0,T,m,U.x,U.y,U.width,U.height)}var fe=h.createCanvasElement(U.width,U.height);S.appendChild(fe);var ue=fe.getContext("2d");if(!ue)throw"Unable to get 2d context from canvas";ue.canvas.width=U.width,ue.canvas.height=U.height,ue.drawImage(p,0,0,T,m,0,0,U.width,U.height);try{h.qrcode.decodeAsync(fe).then(function($){d(So.createFromQrcodeResult($))}).catch(x)}catch($){x("QR code parse error, error = "+$)}},p.onerror=x,p.onabort=x,p.onstalled=x,p.onsuspend=x,p.src=URL.createObjectURL(a)})},o.prototype.clear=function(){this.clearElement()},o.getCameras=function(){if(navigator.mediaDevices)return o.getCamerasFromMediaDevices();var a=MediaStreamTrack;if(MediaStreamTrack&&a.getSources)return o.getCamerasFromMediaStreamTrack();var f=function(){if(location.protocol==="https:")return!0;var d=location.host.split(":")[0];return d==="127.0.0.1"||d==="localhost"},h=Or.unableToQuerySupportedDevices();return f()||(h=Or.insecureContextCameraQueryError()),Promise.reject(h)},o.prototype.getRunningTrackCapabilities=function(){if(this.localMediaStream==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";if(this.localMediaStream.getVideoTracks().length===0)throw"No video tracks found";var a=this.localMediaStream.getVideoTracks()[0];return a.getCapabilities()},o.prototype.applyVideoConstraints=function(a){var f=this;if(a){if(!Fa.isMediaStreamConstraintsValid(a,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";if(this.localMediaStream===null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";if(this.localMediaStream.getVideoTracks().length===0)throw"No video tracks found";return new Promise(function(h,d){if("aspectRatio"in a){d("Chaning 'aspectRatio' in run-time is not yet supported.");return}var x=f.localMediaStream.getVideoTracks()[0];x.applyConstraints(a).then(function(p){h(p)}).catch(function(p){d(p)})})},o.getCamerasFromMediaDevices=function(){return new Promise(function(a,f){navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(function(h){var d=function(x){for(var p=x.getVideoTracks(),T=0,m=p;Ta&&(d.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),S=a),S};T(p.width),T(p.height),p.width=m(p.width)},o.prototype.validateQrboxConfig=function(a){if(typeof a!="number"&&typeof a!="function"&&(a.width===void 0||a.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},o.prototype.toQrdimensions=function(a,f,h){if(typeof h=="number")return{width:h,height:h};if(typeof h=="function")try{return h(a,f)}catch(d){throw new Error("qrbox config was passed as a function but it failed with unknown error"+d)}return h},o.prototype.setupUi=function(a,f,h){h.isShadedBoxEnabled()&&this.validateQrboxSize(a,f,h);var d=hr(h.qrbox)?{width:a,height:f}:h.qrbox;this.validateQrboxConfig(d);var x=this.toQrdimensions(a,f,d);x.height>f&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var p=h.isShadedBoxEnabled()&&x.height<=f,T={x:0,y:0,width:a,height:f},m=p?this.getShadedRegionBounds(a,f,x):T,S=this.createCanvasElement(m.width,m.height),M=S.getContext("2d");M.canvas.width=m.width,M.canvas.height=m.height,this.element.append(S),p&&this.possiblyInsertShadingElement(this.element,a,f,x),this.createScannerPausedUiElement(this.element),this.qrRegion=m,this.context=M,this.canvasElement=S},o.prototype.createScannerPausedUiElement=function(a){var f=document.createElement("div");f.innerText="Scanner paused",f.style.display="none",f.style.position="absolute",f.style.top="0px",f.style.zIndex="1",f.style.background="yellow",f.style.textAlign="center",f.style.width="100%",a.appendChild(f),this.scannerPausedUiElement=f},o.prototype.scanContext=function(a,f){var h=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(d){return a(d.text,So.createFromQrcodeResult(d)),h.possiblyUpdateShaders(!0),!0}).catch(function(d){h.possiblyUpdateShaders(!1);var x=Or.codeParseError(d);return f(x,va.createFrom(x)),!1})},o.prototype.foreverScan=function(a,f,h){var d=this;if(!!this.shouldScan&&!!this.localMediaStream){var x=this.videoElement,p=x.videoWidth/x.clientWidth,T=x.videoHeight/x.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var m=this.qrRegion.width*p,S=this.qrRegion.height*T,M=this.qrRegion.x*p,j=this.qrRegion.y*T;this.context.drawImage(x,M,j,m,S,0,0,this.qrRegion.width,this.qrRegion.height);var U=function(){d.foreverScanTimeout=setTimeout(function(){d.foreverScan(a,f,h)},d.getTimeoutFps(a.fps))};this.scanContext(f,h).then(function(ne){!ne&&a.disableFlip!==!0?(d.context.translate(d.context.canvas.width,0),d.context.scale(-1,1),d.scanContext(f,h).finally(function(){U()})):U()}).catch(function(ne){d.logger.logError("Error happend while scanning context",ne),U()})}},o.prototype.onMediaStreamReceived=function(a,f,h,d,x,p){var T=this,m=this;return new Promise(function(S,M){var j=function(){var K=T.createVideoElement(d);m.element.append(K),K.onabort=M,K.onerror=M;var fe=function(){var ue=K.clientWidth,$=K.clientHeight;m.setupUi(ue,$,f),m.foreverScan(f,x,p),K.removeEventListener("playing",fe),S(null)};K.addEventListener("playing",fe),K.srcObject=a,K.play(),m.videoElement=K};if(m.localMediaStream=a,h||!f.aspectRatio)j();else{var U={aspectRatio:f.aspectRatio},ne=a.getVideoTracks()[0];ne.applyConstraints(U).then(function(K){return j()}).catch(function(K){m.logger.logErrors(["[Html5Qrcode] Constriants could not be satisfied, ignoring constraints",K]),j()})}})},o.prototype.createVideoConstraints=function(a){if(typeof a=="string")return{deviceId:{exact:a}};if(typeof a=="object"){var f="facingMode",h="deviceId",d={user:!0,environment:!0},x="exact",p=function(K){if(K in d)return!0;throw"config has invalid 'facingMode' value = "+("'"+K+"'")},T=Object.keys(a);if(T.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+(" if passed as an object, found "+T.length+" keys");var m=Object.keys(a)[0];if(m!==f&&m!==h)throw"Only '"+f+"' and '"+h+"' are supported for 'cameraIdOrConfig'";if(m===f){var S=a.facingMode;if(typeof S=="string"){if(p(S))return{facingMode:S}}else if(typeof S=="object")if(x in S){if(p(S[""+x]))return{facingMode:{exact:S[""+x]}}}else throw"'facingMode' should be string or object with"+(" "+x+" as key.");else{var M=typeof S;throw"Invalid type of 'facingMode' = "+M}}else{var j=a.deviceId;if(typeof j=="string")return{deviceId:j};if(typeof j=="object"){if(x in j)return{deviceId:{exact:j[""+x]}};throw"'deviceId' should be string or object with"+(" "+x+" as key.")}else{var U=typeof j;throw"Invalid type of 'deviceId' = "+U}}}var ne=typeof a;throw"Invalid type of 'cameraIdOrConfig' = "+ne},o.prototype.computeCanvasDrawConfig=function(a,f,h,d){if(a<=h&&f<=d){var x=(h-a)/2,p=(d-f)/2;return{x,y:p,width:a,height:f}}else{var T=a,m=f;return a>h&&(f=h/a*f,a=h),f>d&&(a=d/f*a,f=d),this.logger.log("Image downsampled from "+(T+"X"+m)+(" to "+a+"X"+f+".")),this.computeCanvasDrawConfig(a,f,h,d)}},o.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var a=document.getElementById(this.elementId);a&&(a.innerHTML="")},o.prototype.createVideoElement=function(a){var f=document.createElement("video");return f.style.width=a+"px",f.muted=!0,f.setAttribute("muted","true"),f.playsInline=!0,f},o.prototype.possiblyUpdateShaders=function(a){this.qrMatch!==a&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(f){f.style.backgroundColor=a?Xt.BORDER_SHADER_MATCH_COLOR:Xt.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=a)},o.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},o.prototype.createCanvasElement=function(a,f,h){var d=a,x=f,p=document.createElement("canvas");return p.style.width=d+"px",p.style.height=x+"px",p.style.display="none",p.id=hr(h)?"qr-canvas":h,p},o.prototype.getShadedRegionBounds=function(a,f,h){if(h.width>a||h.height>f)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(a-h.width)/2,y:(f-h.height)/2,width:h.width,height:h.height}},o.prototype.possiblyInsertShadingElement=function(a,f,h,d){if(!(f-d.width<1||h-d.height<1)){var x=document.createElement("div");x.style.position="absolute";var p=(f-d.width)/2,T=(h-d.height)/2;if(x.style.borderLeft=p+"px solid #0000007a",x.style.borderRight=p+"px solid #0000007a",x.style.borderTop=T+"px solid #0000007a",x.style.borderBottom=T+"px solid #0000007a",x.style.boxSizing="border-box",x.style.top="0px",x.style.bottom="0px",x.style.left="0px",x.style.right="0px",x.id=""+Xt.SHADED_REGION_ELEMENT_ID,f-d.width<11||h-d.height<11)this.hasBorderShaders=!1;else{var m=5,S=40;this.insertShaderBorders(x,S,m,-m,0,!0),this.insertShaderBorders(x,S,m,-m,0,!1),this.insertShaderBorders(x,S,m,d.height+m,0,!0),this.insertShaderBorders(x,S,m,d.height+m,0,!1),this.insertShaderBorders(x,m,S+m,-m,-m,!0),this.insertShaderBorders(x,m,S+m,d.height+m-S,-m,!0),this.insertShaderBorders(x,m,S+m,-m,-m,!1),this.insertShaderBorders(x,m,S+m,d.height+m-S,-m,!1),this.hasBorderShaders=!0}a.append(x)}},o.prototype.insertShaderBorders=function(a,f,h,d,x,p){var T=document.createElement("div");T.style.position="absolute",T.style.backgroundColor=Xt.BORDER_SHADER_DEFAULT_COLOR,T.style.width=f+"px",T.style.height=h+"px",T.style.top=d+"px",p?T.style.left=x+"px":T.style.right=x+"px",this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(T),a.appendChild(T)},o.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},o.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},o.prototype.getTimeoutFps=function(a){return 1e3/a},o}(),Rs="data:image/svg+xml;base64,",s0=Rs+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNzEuNjQzIDM3MS42NDMiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDM3MS42NDMgMzcxLjY0MyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZD0iTTEwNS4wODQgMzguMjcxaDE2My43Njh2MjBIMTA1LjA4NHoiLz48cGF0aCBkPSJNMzExLjU5NiAxOTAuMTg5Yy03LjQ0MS05LjM0Ny0xOC40MDMtMTYuMjA2LTMyLjc0My0yMC41MjJWMzBjMC0xNi41NDItMTMuNDU4LTMwLTMwLTMwSDEyNS4wODRjLTE2LjU0MiAwLTMwIDEzLjQ1OC0zMCAzMHYxMjAuMTQzaC04LjI5NmMtMTYuNTQyIDAtMzAgMTMuNDU4LTMwIDMwdjEuMzMzYTI5LjgwNCAyOS44MDQgMCAwIDAgNC42MDMgMTUuOTM5Yy03LjM0IDUuNDc0LTEyLjEwMyAxNC4yMjEtMTIuMTAzIDI0LjA2MXYxLjMzM2MwIDkuODQgNC43NjMgMTguNTg3IDEyLjEwMyAyNC4wNjJhMjkuODEgMjkuODEgMCAwIDAtNC42MDMgMTUuOTM4djEuMzMzYzAgMTYuNTQyIDEzLjQ1OCAzMCAzMCAzMGg4LjMyNGMuNDI3IDExLjYzMSA3LjUwMyAyMS41ODcgMTcuNTM0IDI2LjE3Ny45MzEgMTAuNTAzIDQuMDg0IDMwLjE4NyAxNC43NjggNDUuNTM3YTkuOTg4IDkuOTg4IDAgMCAwIDguMjE2IDQuMjg4IDkuOTU4IDkuOTU4IDAgMCAwIDUuNzA0LTEuNzkzYzQuNTMzLTMuMTU1IDUuNjUtOS4zODggMi40OTUtMTMuOTIxLTYuNzk4LTkuNzY3LTkuNjAyLTIyLjYwOC0xMC43Ni0zMS40aDgyLjY4NWMuMjcyLjQxNC41NDUuODE4LjgxNSAxLjIxIDMuMTQyIDQuNTQxIDkuMzcyIDUuNjc5IDEzLjkxMyAyLjUzNCA0LjU0Mi0zLjE0MiA1LjY3Ny05LjM3MSAyLjUzNS0xMy45MTMtMTEuOTE5LTE3LjIyOS04Ljc4Ny0zNS44ODQgOS41ODEtNTcuMDEyIDMuMDY3LTIuNjUyIDEyLjMwNy0xMS43MzIgMTEuMjE3LTI0LjAzMy0uODI4LTkuMzQzLTcuMTA5LTE3LjE5NC0xOC42NjktMjMuMzM3YTkuODU3IDkuODU3IDAgMCAwLTEuMDYxLS40ODZjLS40NjYtLjE4Mi0xMS40MDMtNC41NzktOS43NDEtMTUuNzA2IDEuMDA3LTYuNzM3IDE0Ljc2OC04LjI3MyAyMy43NjYtNy42NjYgMjMuMTU2IDEuNTY5IDM5LjY5OCA3LjgwMyA0Ny44MzYgMTguMDI2IDUuNzUyIDcuMjI1IDcuNjA3IDE2LjYyMyA1LjY3MyAyOC43MzMtLjQxMyAyLjU4NS0uODI0IDUuMjQxLTEuMjQ1IDcuOTU5LTUuNzU2IDM3LjE5NC0xMi45MTkgODMuNDgzLTQ5Ljg3IDExNC42NjEtNC4yMjEgMy41NjEtNC43NTYgOS44Ny0xLjE5NCAxNC4wOTJhOS45OCA5Ljk4IDAgMCAwIDcuNjQ4IDMuNTUxIDkuOTU1IDkuOTU1IDAgMCAwIDYuNDQ0LTIuMzU4YzQyLjY3Mi0zNi4wMDUgNTAuODAyLTg4LjUzMyA1Ni43MzctMTI2Ljg4OC40MTUtMi42ODQuODIxLTUuMzA5IDEuMjI5LTcuODYzIDIuODM0LTE3LjcyMS0uNDU1LTMyLjY0MS05Ljc3Mi00NC4zNDV6bS0yMzIuMzA4IDQyLjYyYy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi0xLjMzM2MwLTUuNTE0IDQuNDg2LTEwIDEwLTEwaDE1djIxLjMzM2gtMTV6bS0yLjUtNTIuNjY2YzAtNS41MTQgNC40ODYtMTAgMTAtMTBoNy41djIxLjMzM2gtNy41Yy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi0xLjMzM3ptMTcuNSA5My45OTloLTcuNWMtNS41MTQgMC0xMC00LjQ4Ni0xMC0xMHYtMS4zMzNjMC01LjUxNCA0LjQ4Ni0xMCAxMC0xMGg3LjV2MjEuMzMzem0zMC43OTYgMjguODg3Yy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi04LjI3MWg5MS40NTdjLS44NTEgNi42NjgtLjQzNyAxMi43ODcuNzMxIDE4LjI3MWgtODIuMTg4em03OS40ODItMTEzLjY5OGMtMy4xMjQgMjAuOTA2IDEyLjQyNyAzMy4xODQgMjEuNjI1IDM3LjA0IDUuNDQxIDIuOTY4IDcuNTUxIDUuNjQ3IDcuNzAxIDcuMTg4LjIxIDIuMTUtMi41NTMgNS42ODQtNC40NzcgNy4yNTEtLjQ4Mi4zNzgtLjkyOS44LTEuMzM1IDEuMjYxLTYuOTg3IDcuOTM2LTExLjk4MiAxNS41Mi0xNS40MzIgMjIuNjg4aC05Ny41NjRWMzBjMC01LjUxNCA0LjQ4Ni0xMCAxMC0xMGgxMjMuNzY5YzUuNTE0IDAgMTAgNC40ODYgMTAgMTB2MTM1LjU3OWMtMy4wMzItLjM4MS02LjE1LS42OTQtOS4zODktLjkxNC0yNS4xNTktMS42OTQtNDIuMzcgNy43NDgtNDQuODk4IDI0LjY2NnoiLz48cGF0aCBkPSJNMTc5LjEyOSA4My4xNjdoLTI0LjA2YTUgNSAwIDAgMC01IDV2MjQuMDYxYTUgNSAwIDAgMCA1IDVoMjQuMDZhNSA1IDAgMCAwIDUtNVY4OC4xNjdhNSA1IDAgMCAwLTUtNXpNMTcyLjYyOSAxNDIuODZoLTEyLjU2VjEzMC44YTUgNSAwIDEgMC0xMCAwdjE3LjA2MWE1IDUgMCAwIDAgNSA1aDE3LjU2YTUgNSAwIDEgMCAwLTEwLjAwMXpNMjE2LjU2OCA4My4xNjdoLTI0LjA2YTUgNSAwIDAgMC01IDV2MjQuMDYxYTUgNSAwIDAgMCA1IDVoMjQuMDZhNSA1IDAgMCAwIDUtNVY4OC4xNjdhNSA1IDAgMCAwLTUtNXptLTUgMjQuMDYxaC0xNC4wNlY5My4xNjdoMTQuMDZ2MTQuMDYxek0yMTEuNjY5IDEyNS45MzZIMTk3LjQxYTUgNSAwIDAgMC01IDV2MTQuMjU3YTUgNSAwIDAgMCA1IDVoMTQuMjU5YTUgNSAwIDAgMCA1LTV2LTE0LjI1N2E1IDUgMCAwIDAtNS01eiIvPjwvc3ZnPg==",o0=Rs+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1OS4wMTggNTkuMDE4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1OS4wMTggNTkuMDE4IiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJtNTguNzQxIDU0LjgwOS01Ljk2OS02LjI0NGExMC43NCAxMC43NCAwIDAgMCAyLjgyLTcuMjVjMC01Ljk1My00Ljg0My0xMC43OTYtMTAuNzk2LTEwLjc5NlMzNCAzNS4zNjEgMzQgNDEuMzE0IDM4Ljg0MyA1Mi4xMSA0NC43OTYgNTIuMTFjMi40NDEgMCA0LjY4OC0uODI0IDYuNDk5LTIuMTk2bDYuMDAxIDYuMjc3YS45OTguOTk4IDAgMCAwIDEuNDE0LjAzMiAxIDEgMCAwIDAgLjAzMS0xLjQxNHpNMzYgNDEuMzE0YzAtNC44NSAzLjk0Ni04Ljc5NiA4Ljc5Ni04Ljc5NnM4Ljc5NiAzLjk0NiA4Ljc5NiA4Ljc5Ni0zLjk0NiA4Ljc5Ni04Ljc5NiA4Ljc5NlMzNiA0Ni4xNjQgMzYgNDEuMzE0ek0xMC40MzEgMTYuMDg4YzAgMy4wNyAyLjQ5OCA1LjU2OCA1LjU2OSA1LjU2OHM1LjU2OS0yLjQ5OCA1LjU2OS01LjU2OGMwLTMuMDcxLTIuNDk4LTUuNTY5LTUuNTY5LTUuNTY5cy01LjU2OSAyLjQ5OC01LjU2OSA1LjU2OXptOS4xMzggMGMwIDEuOTY4LTEuNjAyIDMuNTY4LTMuNTY5IDMuNTY4cy0zLjU2OS0xLjYwMS0zLjU2OS0zLjU2OCAxLjYwMi0zLjU2OSAzLjU2OS0zLjU2OSAzLjU2OSAxLjYwMSAzLjU2OSAzLjU2OXoiLz48cGF0aCBkPSJtMzAuODgyIDI4Ljk4NyA5LjE4LTEwLjA1NCAxMS4yNjIgMTAuMzIzYTEgMSAwIDAgMCAxLjM1MS0xLjQ3NWwtMTItMTFhMSAxIDAgMCAwLTEuNDE0LjA2M2wtOS43OTQgMTAuNzI3LTQuNzQzLTQuNzQzYTEuMDAzIDEuMDAzIDAgMCAwLTEuMzY4LS4wNDRMNi4zMzkgMzcuNzY4YTEgMSAwIDEgMCAxLjMyMiAxLjUwMWwxNi4zMTMtMTQuMzYyIDcuMzE5IDcuMzE4YS45OTkuOTk5IDAgMSAwIDEuNDE0LTEuNDE0bC0xLjgyNS0xLjgyNHoiLz48cGF0aCBkPSJNMzAgNDYuNTE4SDJ2LTQyaDU0djI4YTEgMSAwIDEgMCAyIDB2LTI5YTEgMSAwIDAgMC0xLTFIMWExIDEgMCAwIDAtMSAxdjQ0YTEgMSAwIDAgMCAxIDFoMjlhMSAxIDAgMSAwIDAtMnoiLz48L3N2Zz4=",_o=Rs+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NjAgNDYwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0NjAgNDYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJNMjMwIDBDMTAyLjk3NSAwIDAgMTAyLjk3NSAwIDIzMHMxMDIuOTc1IDIzMCAyMzAgMjMwIDIzMC0xMDIuOTc0IDIzMC0yMzBTMzU3LjAyNSAwIDIzMCAwem0zOC4zMzMgMzc3LjM2YzAgOC42NzYtNy4wMzQgMTUuNzEtMTUuNzEgMTUuNzFoLTQzLjEwMWMtOC42NzYgMC0xNS43MS03LjAzNC0xNS43MS0xNS43MVYyMDIuNDc3YzAtOC42NzYgNy4wMzMtMTUuNzEgMTUuNzEtMTUuNzFoNDMuMTAxYzguNjc2IDAgMTUuNzEgNy4wMzMgMTUuNzEgMTUuNzFWMzc3LjM2ek0yMzAgMTU3Yy0yMS41MzkgMC0zOS0xNy40NjEtMzktMzlzMTcuNDYxLTM5IDM5LTM5IDM5IDE3LjQ2MSAzOSAzOS0xNy40NjEgMzktMzkgMzl6Ii8+PC9zdmc+",a0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAQgAAAEIBarqQRAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAE1SURBVDiNfdI7S0NBEAXgLya1otFgpbYSbISAgpXYi6CmiH9KCAiChaVga6OiWPgfRDQ+0itaGVNosXtluWwcuMzePfM4M3sq8lbHBubwg1dc4m1E/J/N4ghDPOIsfk/4xiEao5KX0McFljN4C9d4QTPXuY99jP3DsIoDPGM6BY5i5yI5R7O4q+ImFkJY2DCh3cAH2klyB+9J1xUMMAG7eCh1a+Mr+k48b5diXrFVwwLuS+BJ9MfR7+G0FHOHhTHhnXNWS87VDF4pcnfQK4Ep7XScNLmPTZgURNKKYENYWDpzW1BhscS1WHS8CDgURFJQrWcoF3c13KKbgg1BYQfy8xZWEzTTw1QZbAoKu8FqJnktdu5hcVSHmchiILzzuaDQvjBzV2m8yohCE1jHfPx/xhU+y4G/D75ELlRJsSYAAAAASUVORK5CYII=",Mo=function(){function o(){}return o.createDefault=function(){return{hasPermission:!1,lastUsedCameraId:null}},o}(),l0=function(){function o(){this.data=Mo.createDefault();var a=localStorage.getItem(o.LOCAL_STORAGE_KEY);a?this.data=JSON.parse(a):this.reset()}return o.prototype.hasCameraPermissions=function(){return this.data.hasPermission},o.prototype.getLastUsedCameraId=function(){return this.data.lastUsedCameraId},o.prototype.setHasPermission=function(a){this.data.hasPermission=a,this.flush()},o.prototype.setLastUsedCameraId=function(a){this.data.lastUsedCameraId=a,this.flush()},o.prototype.resetLastUsedCameraId=function(){this.data.lastUsedCameraId=null,this.flush()},o.prototype.reset=function(){this.data=Mo.createDefault(),this.flush()},o.prototype.flush=function(){localStorage.setItem(o.LOCAL_STORAGE_KEY,JSON.stringify(this.data))},o.LOCAL_STORAGE_KEY="HTML5_QRCODE_DATA",o}(),c0=function(){function o(){this.infoDiv=document.createElement("div")}return o.prototype.renderInto=function(a){this.infoDiv.style.position="absolute",this.infoDiv.style.top="10px",this.infoDiv.style.right="10px",this.infoDiv.style.zIndex="2",this.infoDiv.style.display="none",this.infoDiv.style.padding="5pt",this.infoDiv.style.border="1px solid silver",this.infoDiv.style.fontSize="10pt",this.infoDiv.style.background="rgb(248 248 248)",this.infoDiv.innerText=bo.builtUsing();var f=document.createElement("a");f.innerText="html5-qrcode",f.href="https://github.com/mebjas/html5-qrcode",f.target="new",this.infoDiv.appendChild(f);var h=document.createElement("br"),d=document.createElement("br");this.infoDiv.appendChild(h),this.infoDiv.appendChild(d);var x=document.createElement("a");x.innerText=bo.reportIssues(),x.href="https://github.com/mebjas/html5-qrcode/issues",x.target="new",this.infoDiv.appendChild(x),a.appendChild(this.infoDiv)},o.prototype.show=function(){this.infoDiv.style.display="block"},o.prototype.hide=function(){this.infoDiv.style.display="none"},o}(),f0=function(){function o(a,f){this.isShowingInfoIcon=!0,this.onTapIn=a,this.onTapOut=f,this.infoIcon=document.createElement("img")}return o.prototype.renderInto=function(a){var f=this;this.infoIcon.alt="Info icon",this.infoIcon.src=_o,this.infoIcon.style.position="absolute",this.infoIcon.style.top="4px",this.infoIcon.style.right="4px",this.infoIcon.style.opacity="0.6",this.infoIcon.style.cursor="pointer",this.infoIcon.style.zIndex="2",this.infoIcon.style.width="16px",this.infoIcon.style.height="16px",this.infoIcon.onmouseover=function(h){return f.onHoverIn()},this.infoIcon.onmouseout=function(h){return f.onHoverOut()},this.infoIcon.onclick=function(h){return f.onClick()},a.appendChild(this.infoIcon)},o.prototype.onHoverIn=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="1")},o.prototype.onHoverOut=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="0.6")},o.prototype.onClick=function(){this.isShowingInfoIcon?(this.isShowingInfoIcon=!1,this.onTapIn(),this.infoIcon.src=a0,this.infoIcon.style.opacity="1"):(this.isShowingInfoIcon=!0,this.onTapOut(),this.infoIcon.src=_o,this.infoIcon.style.opacity="0.6")},o}(),u0=function(){function o(){var a=this;this.infoDiv=new c0,this.infoIcon=new f0(function(){a.infoDiv.show()},function(){a.infoDiv.hide()})}return o.prototype.renderInto=function(a){this.infoDiv.renderInto(a),this.infoIcon.renderInto(a)},o}(),Oo=function(){function o(){}return o.hasCameraPermissions=function(){return new Promise(function(a,f){navigator.mediaDevices.enumerateDevices().then(function(h){h.forEach(function(d){d.kind==="videoinput"&&d.label&&a(!0)}),a(!1)})})},o}(),xn=function(){function o(a){this.supportedScanTypes=this.validateAndReturnScanTypes(a)}return o.prototype.getDefaultScanType=function(){return this.supportedScanTypes[0]},o.prototype.hasMoreThanOneScanType=function(){return this.supportedScanTypes.length>1},o.prototype.isCameraScanRequired=function(){for(var a=0,f=this.supportedScanTypes;af)throw"Max "+f+" values expected for supportedScanTypes";for(var h=0,d=a;h0?(a.removeChild(f),d.renderCameraSelection(p)):(d.setHeaderMessage(Jt.noCameraFound(),Zt.STATUS_WARNING),x())}).catch(function(p){d.persistedDataManager.setHasPermission(!1),h?h.disabled=!1:x(),d.setHeaderMessage(p,Zt.STATUS_WARNING)})},o.prototype.createPermissionButton=function(a,f){var h=this,d=document.createElement("button");d.id=this.getCameraPermissionButtonId(),d.innerText=Jt.cameraPermissionTitle(),d.addEventListener("click",function(){d.disabled=!0,h.createCameraListUi(a,f,d)}),f.appendChild(d)},o.prototype.createPermissionsUi=function(a,f){var h=this;if(xn.isCameraScanType(this.currentScanType)&&this.persistedDataManager.hasCameraPermissions()){Oo.hasCameraPermissions().then(function(d){d?h.createCameraListUi(a,f):(h.persistedDataManager.setHasPermission(!1),h.createPermissionButton(a,f))}).catch(function(d){h.persistedDataManager.setHasPermission(!1),h.createPermissionButton(a,f)});return}this.createPermissionButton(a,f)},o.prototype.createSectionControlPanel=function(){var a=document.getElementById(this.getDashboardSectionId()),f=document.createElement("div");a.appendChild(f);var h=document.createElement("div");h.id=this.getDashboardSectionCameraScanRegionId(),h.style.display=xn.isCameraScanType(this.currentScanType)?"block":"none",f.appendChild(h);var d=document.createElement("div");d.style.textAlign="center",h.appendChild(d),this.scanTypeSelector.isCameraScanRequired()&&this.createPermissionsUi(h,d),this.renderFileScanUi(f)},o.prototype.renderFileScanUi=function(a){var f=this,h=document.createElement("div");h.id=this.getDashboardSectionFileScanRegionId(),h.style.textAlign="center",h.style.display=xn.isCameraScanType(this.currentScanType)?"none":"block",a.appendChild(h);var d=document.createElement("input");d.id=this.getFileScanInputId(),d.accept="image/*",d.type="file",d.style.width="200px",d.disabled=xn.isCameraScanType(this.currentScanType);var x=document.createElement("span");x.innerText=" Select Image",h.appendChild(d),h.appendChild(x),d.addEventListener("change",function(p){if(!f.html5Qrcode)throw"html5Qrcode not defined";if(!(p==null||p.target==null)&&!!xn.isFileScanType(f.currentScanType)&&p.target.files.length!==0){var T=p.target.files[0];f.html5Qrcode.scanFileV2(T,!0).then(function(m){f.resetHeaderMessage(),f.qrCodeSuccessCallback(m.decodedText,m)}).catch(function(m){f.setHeaderMessage(m,Zt.STATUS_WARNING),f.qrCodeErrorCallback(m,va.createFrom(m))})}})},o.prototype.renderCameraSelection=function(a){var f=this,h=this,d=document.getElementById(this.getDashboardSectionCameraScanRegionId());d.style.textAlign="center";var x=document.createElement("span");x.style.marginRight="10px";var p=a.length,T=document.createElement("select");if(p===1)T.style.display="none";else{var m=Jt.selectCamera();x.innerText=m+" ("+a.length+") "}T.id=this.getCameraSelectionId();for(var S=[],M=0,j=a;M",f.appendChild(this.cameraScanImage);return}this.cameraScanImage=new Image,this.cameraScanImage.onload=function(h){f.innerHTML="
",f.appendChild(a.cameraScanImage)},this.cameraScanImage.width=64,this.cameraScanImage.style.opacity="0.8",this.cameraScanImage.src=s0},o.prototype.insertFileScanImageToScanRegion=function(){var a=this,f=document.getElementById(this.getScanRegionId());if(this.fileScanImage){f.innerHTML="
",f.appendChild(this.fileScanImage);return}this.fileScanImage=new Image,this.fileScanImage.onload=function(h){f.innerHTML="
",f.appendChild(a.fileScanImage)},this.fileScanImage.width=64,this.fileScanImage.style.opacity="0.8",this.fileScanImage.src=o0},o.prototype.clearScanRegion=function(){var a=document.getElementById(this.getScanRegionId());a.innerHTML=""},o.prototype.getDashboardSectionId=function(){return this.elementId+"__dashboard_section"},o.prototype.getDashboardSectionCameraScanRegionId=function(){return this.elementId+"__dashboard_section_csr"},o.prototype.getDashboardSectionFileScanRegionId=function(){return this.elementId+"__dashboard_section_fsr"},o.prototype.getDashboardSectionSwapLinkId=function(){return this.elementId+"__dashboard_section_swaplink"},o.prototype.getScanRegionId=function(){return this.elementId+"__scan_region"},o.prototype.getDashboardId=function(){return this.elementId+"__dashboard"},o.prototype.getFileScanInputId=function(){return this.elementId+"__filescan_input"},o.prototype.getStatusSpanId=function(){return this.elementId+"__status_span"},o.prototype.getHeaderMessageContainerId=function(){return this.elementId+"__header_message"},o.prototype.getCameraSelectionId=function(){return this.elementId+"__camera_selection"},o.prototype.getCameraPermissionButtonId=function(){return this.elementId+"__camera_permission_button"},o.prototype.getCameraScanRegion=function(){return document.getElementById(this.getDashboardSectionCameraScanRegionId())},o.prototype.getFileScanRegion=function(){return document.getElementById(this.getDashboardSectionFileScanRegionId())},o.prototype.getFileScanInput=function(){return document.getElementById(this.getFileScanInputId())},o.prototype.getDashboardSectionSwapLink=function(){return document.getElementById(this.getDashboardSectionSwapLinkId())},o.prototype.getHeaderMessageDiv=function(){return document.getElementById(this.getHeaderMessageContainerId())},o}();const x0={id:"qr-code-full-region"},A0=ys({props:{qrbox:null,fps:null},emits:["decodedCode"],setup(o,{emit:a}){const f=o;var h={fps:f.fps?f.fps:10};let d="";f.qrbox&&(h.qrbox=f.qrbox);function x(m,S){d!==m&&(d=m,a("decodedCode",m,S))}function p(m,S){}async function T(){await ra();var m=new g0("qr-code-full-region",h,void 0);m.render(x,p)}return T(),(m,S)=>(Ms(),Ma("div",x0))}}),w0={class:"section",style:{width:"500px",margin:"auto"}},E0=jr("div",{id:"smsto"},null,-1),p0=ys({setup(o){let a=Ui("");Ui(""),Ui("visibility:hidden");const f=function(d,x){d.includes("smsto:1922:")?h(d):a.value=`\u5167\u5BB9:${d}`};function h(d){let p=d.split("smsto:1922:")[1];a.value=`\u5167\u5BB9:${p}`;let T=document.getElementById("smsto");T.innerHTML=`\u6309\u6211\u50B3\u9001\u7C21\u8A0A`}return(d,x)=>(Ms(),Ma($t,null,[jr("div",w0,[En(A0,{qrbox:250,fps:10,style:{width:"100%"},onDecodedCode:f})]),jr("div",null,Tl(ea(a)),1),E0],64))}});const C0=ys({setup(o){return(a,f)=>(Ms(),rc(p0))}});zc(C0).mount("#app"); diff --git a/dist/index.html b/dist/index.html index 39f167b..3deb48d 100644 --- a/dist/index.html +++ b/dist/index.html @@ -7,7 +7,7 @@ HTML5 QR Code with Vue js - + diff --git a/package.json b/package.json index 50bc096..731d6fa 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,20 @@ { - "name": "qrcode", - "private": true, - "version": "0.0.0", - "scripts": { - "dev": "vite", - "build": "vue-tsc --noEmit && vite build", - "preview": "vite preview" - }, - "dependencies": { - "html5-qrcode": "^2.2.1", - "vue": "^3.2.25" - }, - "devDependencies": { - "@vitejs/plugin-vue": "^2.3.1", - "typescript": "^4.5.4", - "vite": "^2.9.5", - "vue-tsc": "^0.34.7" - } -} + "name": "qrcode", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite --host", + "build": "vue-tsc --noEmit && vite build", + "preview": "vite preview" + }, + "dependencies": { + "html5-qrcode": "^2.2.1", + "vue": "^3.2.25" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^2.3.1", + "typescript": "^4.5.4", + "vite": "^2.9.5", + "vue-tsc": "^0.34.7" + } +} \ No newline at end of file diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index 38dae70..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - diff --git a/src/components/QRCode.vue b/src/components/QRCode.vue index 27754cb..f767f0d 100644 --- a/src/components/QRCode.vue +++ b/src/components/QRCode.vue @@ -5,18 +5,37 @@ import QRCodeScanner from './QRCodeScanner.vue'; // defineProps<{ msg: string }>() let result = ref('') +let smscontent = ref('') +let isSHowSMS = ref('visibility:hidden') const decodedCode = function (decodedText: string, decodedResult: any) { - console.log(`Scan result ${decodedText}`, decodedResult); - result.value = `內容:${decodedText}`; + // console.log(`Scan result ${decodedText}`, decodedResult); + if (decodedText.includes('smsto:1922:')) { + smsto1922(decodedText); + } else { + result.value = `內容:${decodedText}`; + } +} + +function smsto1922(decodedText: string) { + let contents = decodedText.split('smsto:1922:'); + let sms = contents[1]; + result.value = `內容:${sms}`; + // smscontent.value = sms; + let smsto = document.getElementById("smsto")!; + smsto.innerHTML = `按我傳送簡訊`; } \ No newline at end of file