QRCode/dist/assets/index.e641ed81.js

34 lines
395 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function Al(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 wl=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)}};wl();function cs(o,a){const f=Object.create(null),h=o.split(",");for(let d=0;d<h.length;d++)f[h[d]]=!0;return a?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<o.length;f++){const h=o[f],d=Tt(h)?Il(h):fs(h);if(d)for(const x in d)a[x]=d[x]}return a}else{if(Tt(o))return o;if(St(o))return o}}const Cl=/;(?![^(]*\))/g,ml=/:(.+)/;function Il(o){const a={};return o.split(Cl).forEach(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;f<o.length;f++){const h=us(o[f]);h&&(a+=h+" ")}else if(St(o))for(const f in o)o[f]&&(a+=f+" ");return a.trim()}const Tl=o=>Tt(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<o.length;f++)o[f](a)},si=(o,a,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<h;f++)this.effects[f].stop();for(f=0,h=this.cleanups.length;f<h;f++)this.cleanups[f]();if(this.scopes)for(f=0,h=this.scopes.length;f<h;f++)this.scopes[f].stop(!0);if(this.parent&&!a){const d=this.parent.scopes.pop();d&&d!==this&&(this.parent.scopes[this.index]=d,d.index=this.index)}this.active=!1}}}function Ll(o,a=un){a&&a.active&&a.effects.push(o)}const As=o=>{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<o.length;a++)o[a].w|=Bn},vl=o=>{const{deps:a}=o;if(a.length){let f=0;for(let h=0;h<a.length;h++){const d=a[h];ko(d)&&!Uo(d)?d.delete(o):a[f++]=d,d.w&=~Bn,d.n&=~Bn}a.length=f}},Gi=new WeakMap;let Rr=0,Bn=1;const Xi=30;let en;const Xn=Symbol(""),Zi=Symbol("");class ws{constructor(a,f=null,h){this.fn=a,this.scheduler=f,this.active=!0,this.deps=[],this.parent=void 0,Ll(this,h)}run(){if(!this.active)return this.fn();let a=en,f=Rn;for(;a;){if(a===this)return;a=a.parent}try{return this.parent=en,en=this,Rn=!0,Bn=1<<++Rr,Rr<=Xi?Bl(this):Qs(this),this.fn()}finally{Rr<=Xi&&vl(this),Bn=1<<--Rr,en=this.parent,Rn=f,this.parent=void 0,this.deferStop&&this.stop()}}stop(){en===this?this.deferStop=!0:this.active&&(Qs(this),this.onStop&&this.onStop(),this.active=!1)}}function Qs(o){const{deps:a}=o;if(a.length){for(let f=0;f<a.length;f++)a[f].delete(o);a.length=0}}let Rn=!0;const Ho=[];function pr(){Ho.push(Rn),Rn=!1}function Cr(){const o=Ho.pop();Rn=o===void 0?!0:o}function jt(o,a,f){if(Rn&&en){let h=Gi.get(o);h||Gi.set(o,h=new Map);let d=h.get(f);d||h.set(f,d=As()),jo(d)}}function jo(o,a){let f=!1;Rr<=Xi?Uo(o)||(o.n|=Bn,f=!ko(o)):f=!o.has(en),f&&(o.add(en),en.deps.push(o))}function pn(o,a,f,h,d,x){const p=Gi.get(o);if(!p)return;let T=[];if(a==="clear")T=[...p.values()];else if(f==="length"&&be(o))p.forEach((m,S)=>{(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<p;x++)jt(h,"get",x+"");const d=h[a](...f);return d===-1||d===!1?h[a](...f.map(ke)):d}}),["push","pop","shift","unshift","splice"].forEach(a=>{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)<f.length:Le(f,h),m=Reflect.set(f,h,d,x);return f===ke(x)&&(T?Fr(d,p)&&pn(f,"set",h,d):pn(f,"add",h,d)),m}}function zl(o,a){const f=Le(o,a);o[a];const h=Reflect.deleteProperty(o,a);return h&&f&&pn(o,"delete",a,void 0),h}function Wl(o,a){const f=Reflect.has(o,a);return(!gs(a)||!Vo.has(a))&&jt(o,"has",a),f}function Yl(o){return jt(o,"iterate",be(o)?"length":Xn),Reflect.ownKeys(o)}const Wo={get:Fl,set:jl,deleteProperty:zl,has:Wl,ownKeys:Yl},Gl={get:Ul,set(o,a){return!0},deleteProperty(o,a){return!0}},Xl=_t({},Wo,{get:kl,set:Vl}),ps=o=>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<o.length;x++)d.push(Kt(o[x],a,f,h));return d}function xi(o,a,f,h=!0){const d=a?a.vnode:null;if(a){let x=a.parent;const p=a.proxy,T=f;for(;x;){const S=x.ec;if(S){for(let M=0;M<S.length;M++)if(S[M](o,p,T)===!1)return}x=x.parent}const m=a.appContext.config.errorHandler;if(m){Ln(m,null,10,[o,p,T]);return}}u1(o,f,d,h)}function u1(o,a,f,h=!0){console.error(o)}let oi=!1,Qi=!1;const Ht=[];let An=0;const Br=[];let Lr=null,cr=0;const vr=[];let On=null,fr=0;const na=Promise.resolve();let Ss=null,qi=null;function ra(o){const a=Ss||na;return o?a.then(this?o.bind(this):o):a}function h1(o){let a=An+1,f=Ht.length;for(;a<f;){const h=a+f>>>1;Hr(Ht[h])<o?a=h+1:f=h}return a}function ia(o){(!Ht.length||!Ht.includes(o,oi&&o.allowRecurse?An+1:An))&&o!==qi&&(o.id==null?Ht.push(o):Ht.splice(h1(o.id),0,o),sa())}function sa(){!oi&&!Qi&&(Qi=!0,Ss=na.then(la))}function d1(o){const a=Ht.indexOf(o);a>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;cr<Lr.length;cr++)Lr[cr]();Lr=null,cr=0,qi=null,bs(o,a)}}function aa(o){if(vr.length){const a=[...new Set(vr)];if(vr.length=0,On){On.push(...a);return}for(On=a,On.sort((f,h)=>Hr(f)-Hr(h)),fr=0;fr<On.length;fr++)On[fr]();On=null,fr=0}}const Hr=o=>o.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;An<Ht.length;An++){const f=Ht[An];f&&f.active!==!1&&Ln(f,null,14)}}finally{An=0,Ht.length=0,aa(),oi=!1,Ss=null,(Ht.length||Br.length||vr.length)&&la(o)}}function A1(o,a,...f){if(o.isUnmounted)return;const h=o.vnode.props||$e;let d=f;const x=a.startsWith("update:"),p=x&&a.slice(7);if(p&&p in h){const M=`${p==="modelValue"?"model":p}Modifiers`,{number:j,trim:U}=h[M]||$e;U?d=f.map(ne=>ne.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;j<M.length;j++){const U=M[j];if(p[U]!==h[U]&&!Ai(S,U))return!0}}}else return(d||T)&&(!T||!T.$stable)?!0:h===p?!1:h?p?no(h,p,S):!0:!!p;return!1}function no(o,a,f){const h=Object.keys(a);if(h.length!==Object.keys(o).length)return!0;for(let d=0;d<h.length;d++){const x=h[d];if(a[x]!==o[x]&&!Ai(f,x))return!0}return!1}function m1({vnode:o,parent:a},f){for(;a&&a.subTree===o;)(o=a.vnode).el=f,a=a.parent}const I1=o=>o.__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<f.length&&h;d++)h=h[f[d]];return h}}function ur(o,a){if(!St(o)||o.__v_skip||(a=a||new Set,a.has(o)))return o;if(a.add(o),It(o))ur(o.value,a);else if(be(o))for(let f=0;f<o.length;f++)ur(o[f],a);else if(Lo(o)||gr(o))o.forEach(f=>{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;x<o.length;x++){let p=o[x];const T=f==null?p.key:String(f)+String(p.key!=null?p.key:x);p.type===$t?(p.patchFlag&128&&d++,h=h.concat(ga(p.children,a,T))):(a||p.type!==wn)&&h.push(T!=null?Qn(p,{key:T}):p)}if(d>1)for(let x=0;x<h.length;x++)h[x].patchFlag=-2;return h}function ys(o){return Ne(o)?{setup:o,name:o.name}:o}const es=o=>!!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;f<o.length;f++)a[o[f]]=o[f];return a}return o}function Ot(o,a){return o?[...new Set([].concat(o,a))]:a}function Wn(o,a){return o?_t(_t(Object.create(null),o),a):a}function z1(o,a){if(!o)return a;if(!a)return o;const f=_t(Object.create(null),o);for(const h in a)f[h]=Ot(o[h],a[h]);return f}function W1(o,a,f,h=!1){const d={},x={};si(x,pi,1),o.propsDefaults=Object.create(null),ma(o,a,d,x);for(const p in o.propsOptions[0])p in d||(d[p]=void 0);f?o.props=h?d:s1(d):o.type.props?o.props=d:o.props=x,o.attrs=x}function Y1(o,a,f,h){const{props:d,attrs:x,vnode:{patchFlag:p}}=o,T=ke(d),[m]=o.propsOptions;let S=!1;if((h||p>0)&&!(p&16)){if(p&8){const M=o.vnode.dynamicProps;for(let j=0;j<M.length;j++){let U=M[j];if(Ai(o.emitsOptions,U))continue;const ne=a[U];if(m)if(Le(x,U))ne!==x[U]&&(x[U]=ne,S=!0);else{const K=Ar(U);d[K]=rs(m,T,K,ne,o,!1)}else ne!==x[U]&&(x[U]=ne,S=!0)}}}else{ma(o,a,d,x)&&(S=!0);let M;for(const j in T)(!a||!Le(a,j)&&((M=Er(j))===j||!Le(a,M)))&&(m?f&&(f[j]!==void 0||f[M]!==void 0)&&(d[j]=rs(m,T,j,void 0,o,!0)):delete d[j]);if(x!==T)for(const j in x)(!a||!Le(a,j)&&!0)&&(delete x[j],S=!0)}S&&pn(o,"set","$attrs")}function ma(o,a,f,h){const[d,x]=o.propsOptions;let p=!1,T;if(a)for(let m in a){if(ri(m))continue;const S=a[m];let M;d&&Le(d,M=Ar(m))?!x||!x.includes(M)?f[M]=S:(T||(T={}))[M]=S:Ai(o.emitsOptions,m)||(!(m in h)||S!==h[m])&&(h[m]=S,p=!0)}if(x){const m=ke(f),S=T||$e;for(let M=0;M<x.length;M++){const j=x[M];f[j]=rs(d,m,j,S[j],o,!Le(S,j))}}return p}function rs(o,a,f,h,d,x){const p=o[f];if(p!=null){const T=Le(p,"default");if(T&&h===void 0){const m=p.default;if(p.type!==Function&&Ne(m)){const{propsDefaults:S}=d;f in S?h=S[f]:(wr(d),h=S[f]=m.call(null,a),Kn())}else h=m}p[0]&&(x&&!T?h=!1:p[1]&&(h===""||h===Er(f))&&(h=!0))}return h}function Ia(o,a,f=!1){const h=a.propsCache,d=h.get(o);if(d)return d;const x=o.props,p={},T=[];let m=!1;if(!Ne(o)){const M=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<x.length;M++){const j=Ar(x[M]);ao(j)&&(p[j]=$e)}else if(x)for(const M in x){const j=Ar(M);if(ao(j)){const U=x[M],ne=p[j]=be(U)||Ne(U)?{type:U}:U;if(ne){const K=fo(Boolean,ne.type),fe=fo(String,ne.type);ne[0]=K>-1,ne[1]=fe<0||K<fe,(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;p<d.length;p++){const T=d[p];x&&(T.oldValue=x[p].value);let m=T.dir[h];m&&(pr(),Kt(m,f,8,[o.el,T,o,a]),Cr())}}function ya(){return{app:null,config:{isNativeTag:Sl,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let K1=0;function Q1(o,a){return function(h,d=null){Ne(h)||(h=Object.assign({},h)),d!=null&&!St(d)&&(d=null);const x=ya(),p=new Set;let T=!1;const m=x.app={_uid:K1++,_component:h,_props:d,_container:null,_context:x,_instance:null,version:Cc,get config(){return x.config},set config(S){},use(S,...M){return p.has(S)||(S&&Ne(S.install)?(p.add(S),S.install(m,...M)):Ne(S)&&(p.add(S),S(m,...M))),m},mixin(S){return x.mixins.includes(S)||x.mixins.push(S),m},component(S,M){return M?(x.components[S]=M,m):x.components[S]},directive(S,M){return M?(x.directives[S]=M,m):x.directives[S]},mount(S,M,j){if(!T){const U=En(h,d);return U.appContext=x,M&&a?a(U,S):o(U,S,j),T=!0,m._container=S,S.__vue_app__=m,Ds(U.component)||U.component.proxy}},unmount(){T&&(o(null,m._container),delete m._container.__vue_app__)},provide(S,M){return x.provides[S]=M,m}};return m}}function is(o,a,f,h,d=!1){if(be(o)){o.forEach((U,ne)=>is(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<k.length;H++)ne(b,k[H]);if(P){let H=P.subTree;if(_===H){const J=P.vnode;V(b,J,J.scopeId,J.slotScopeIds,P.parent)}}},ve=(b,_,v,k,P,H,J,R,Q=0)=>{for(let Y=Q;Y<b.length;Y++){const oe=b[Y]=R?Dn(b[Y]):hn(b[Y]);ue(null,oe,_,v,k,P,H,J,R)}},ze=(b,_,v,k,P,H,J)=>{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<Te.length;Ue++){const He=Te[Ue],kt=ie[He],Ze=re[He];(Ze!==kt||He==="value")&&x(R,He,kt,Ze,P,b.children,v,k,Ye)}}Q&1&&b.children!==_.children&&M(R,_.children)}else!J&&Y==null&&Ie(R,_,ie,re,v,k,P);((we=re.onVnodeUpdated)||oe)&&Ft(()=>{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;re<ie;re++){const we=_[re]=Q?Dn(_[re]):hn(_[re]);ue(b[re],we,v,null,P,H,J,R,Q)}Y>oe?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=we<oe?_[we].el:k;for(;Y<=re;)ue(null,_[Y]=Q?Dn(_[Y]):hn(_[Y]),v,pe,P,H,J,R,Q),Y++}}else if(Y>re)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;Y++)tt[Y]=0;for(Y=we;Y<=ie;Y++){const _e=b[Y];if(He>=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<oe?_[_e+1].el:k;tt[Y]===0?ue(null,bt,v,$n,P,H,J,R,Q):Ze&&(Ue<0||Y!==je[Ue]?Dt(bt,v,$n,2):Ue--)}}},Dt=(b,_,v,k,P=null)=>{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;ie<Q.length;ie++)Dt(Q[ie],_,v,k);h(b.anchor,_,v);return}if(J===Wi){Xe(b,_,v);return}if(k!==2&&Y&1&&R)if(k===0)R.beforeEnter(H),h(H,_,v),Ft(()=>R.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;J<b.length;J++)rt(b[J],_,v,k,P)},nn=b=>b.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<h.length;x++){const p=h[x];let T=d[x];T.shapeFlag&1&&!T.dynamicChildren&&((T.patchFlag<=0||T.patchFlag===32)&&(T=d[x]=Dn(d[x]),T.el=p.el),f||Na(p,T))}}function $1(o){const a=o.slice(),f=[0];let h,d,x,p,T;const m=o.length;for(h=0;h<m;h++){const S=o[h];if(S!==0){if(d=f[f.length-1],o[d]<S){a[h]=d,f.push(h);continue}for(x=0,p=f.length-1;x<p;)T=x+p>>1,o[f[T]]<S?x=T+1:p=T;S<o[f[x]]&&(x>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;f<o.length;f++){const h=o[f];for(const d in h)if(d==="class")a.class!==h.class&&(a.class=us([a.class,h.class]));else if(d==="style")a.style=fs([a.style,h.style]);else if(ui(d)){const x=a[d],p=h[d];p&&x!==p&&!(be(x)&&x.includes(p))&&(a[d]=x?[].concat(x,p):p)}else d!==""&&(a[d]=h[d])}return a}function fn(o,a,f,h=null){Kt(o,a,7,[f,h])}const ss=o=>o?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?`<svg>${o}</svg>`: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<wo.length;d++){const x=wo[d]+h;if(x in o)return Yi[a]=x}return a}const Eo="http://www.w3.org/1999/xlink";function yc(o,a,f,h,d){if(h&&a.startsWith("xlink:"))f==null?o.removeAttributeNS(Eo,a.slice(6,a.length)):o.setAttributeNS(Eo,a,f);else{const x=pl(a);f==null||x&&!Do(f)?o.removeAttribute(a):o.setAttribute(a,x?"":f)}}function Nc(o,a,f,h,d,x,p){if(a==="innerHTML"||a==="textContent"){h&&p(h,d,x),o[a]=f==null?"":f;return}if(a==="value"&&o.tagName!=="PROGRESS"&&!o.tagName.includes("-")){o._value=f;const m=f==null?"":f;(o.value!==m||o.tagName==="OPTION")&&(o.value=m),f==null&&o.removeAttribute(a);return}let T=!1;if(f===""||f==null){const m=typeof o[a];m==="boolean"?f=Do(f):f==null&&m==="string"?(f="",T=!0):m==="number"&&(f=0,T=!0)}try{o[a]=f}catch{}T&&o.removeAttribute(a)}const[La,_c]=(()=>{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<m.length;T++){var S=m[T];if(x.has(S))return f.logError(S+" is not supported videoConstaints.",!0),!1}return!0},o}(),Dr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Gc(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Je={exports:{}};(function(o,a){(function(f,h){h(a)})(Dr,function(f){/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)e.hasOwnProperty(t)&&(A[t]=e[t])};function d(A,e){h(A,e);function t(){this.constructor=A}A.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function x(A,e){var t=Object.setPrototypeOf;t?t(A,e):A.__proto__=e}function p(A,e){e===void 0&&(e=A.constructor);var t=Error.captureStackTrace;t&&t(A,e)}var T=function(A){d(e,A);function e(t){var n=this.constructor,r=A.call(this,t)||this;return Object.defineProperty(r,"name",{value:n.name,enumerable:!1}),x(r,n.prototype),p(r),r}return e}(Error);class m extends T{constructor(e=void 0){super(e),this.message=e}getKind(){return this.constructor.kind}}m.kind="Exception";class S extends m{}S.kind="ArgumentException";class M extends m{}M.kind="IllegalArgumentException";class j{constructor(e){if(this.binarizer=e,e===null)throw new M("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(e,t){return this.binarizer.getBlackRow(e,t)}getBlackMatrix(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(e,t,n,r){const i=this.binarizer.getLuminanceSource().crop(e,t,n,r);return new j(this.binarizer.createBinarizer(i))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new j(this.binarizer.createBinarizer(e))}rotateCounterClockwise45(){const e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new j(this.binarizer.createBinarizer(e))}toString(){try{return this.getBlackMatrix().toString()}catch{return""}}}class U extends m{static getChecksumInstance(){return new U}}U.kind="ChecksumException";class ne{constructor(e){this.source=e}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class K{static arraycopy(e,t,n,r,i){for(;i--;)n[r++]=e[t++]}static currentTimeMillis(){return Date.now()}}class fe extends m{}fe.kind="IndexOutOfBoundsException";class ue extends fe{constructor(e=void 0,t=void 0){super(t),this.index=e,this.message=t}}ue.kind="ArrayIndexOutOfBoundsException";class ${static fill(e,t){for(let n=0,r=e.length;n<r;n++)e[n]=t}static fillWithin(e,t,n,r){$.rangeCheck(e.length,t,n);for(let i=t;i<n;i++)e[i]=r}static rangeCheck(e,t,n){if(t>n)throw new M("fromIndex("+t+") > toIndex("+n+")");if(t<0)throw new ue(t);if(n>e)throw new ue(n)}static asList(...e){return e}static create(e,t,n){return Array.from({length:e}).map(i=>Array.from({length:t}).fill(n))}static createInt32Array(e,t,n){return Array.from({length:e}).map(i=>Int32Array.from({length:t}).fill(n))}static equals(e,t){if(!e||!t||!e.length||!t.length||e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}static hashCode(e){if(e===null)return 0;let t=1;for(const n of e)t=31*t+n;return t}static fillUint8Array(e,t){for(let n=0;n!==e.length;n++)e[n]=t}static copyOf(e,t){return e.slice(0,t)}static copyOfUint8Array(e,t){if(e.length<=t){const n=new Uint8Array(t);return n.set(e),n}return e.slice(0,t)}static copyOfRange(e,t,n){const r=n-t,i=new Int32Array(r);return K.arraycopy(e,t,i,0,r),i}static binarySearch(e,t,n){n===void 0&&(n=$.numberComparator);let r=0,i=e.length-1;for(;r<=i;){const s=i+r>>1,l=n(t,e[s]);if(l>0)r=s+1;else if(l<0)i=s-1;else return s}return-r-1}static numberComparator(e,t){return e-t}}class se{static numberOfTrailingZeros(e){let t;if(e===0)return 32;let n=31;return t=e<<16,t!==0&&(n-=16,e=t),t=e<<8,t!==0&&(n-=8,e=t),t=e<<4,t!==0&&(n-=4,e=t),t=e<<2,t!==0&&(n-=2,e=t),n-(e<<1>>>31)}static numberOfLeadingZeros(e){if(e===0)return 32;let t=1;return e>>>16===0&&(t+=16,e<<=16),e>>>24===0&&(t+=8,e<<=8),e>>>28===0&&(t+=4,e<<=4),e>>>30===0&&(t+=2,e<<=2),t-=e>>>31,t}static toHexString(e){return e.toString(16)}static toBinaryString(e){return String(parseInt(String(e),2))}static bitCount(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),e=e+(e>>>4)&252645135,e=e+(e>>>8),e=e+(e>>>16),e&63}static truncDivision(e,t){return Math.trunc(e/t)}static parseInt(e,t=void 0){return parseInt(e,t)}}se.MIN_VALUE_32_BITS=-2147483648,se.MAX_VALUE=Number.MAX_SAFE_INTEGER;class Ee{constructor(e,t){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,t==null?this.bits=Ee.makeArray(e):this.bits=t)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(e){if(e>this.bits.length*32){const t=Ee.makeArray(e);K.arraycopy(this.bits,0,t,0,this.bits.length),this.bits=t}}get(e){return(this.bits[Math.floor(e/32)]&1<<(e&31))!==0}set(e){this.bits[Math.floor(e/32)]|=1<<(e&31)}flip(e){this.bits[Math.floor(e/32)]^=1<<(e&31)}getNextSet(e){const t=this.size;if(e>=t)return t;const n=this.bits;let r=Math.floor(e/32),i=n[r];i&=~((1<<(e&31))-1);const s=n.length;for(;i===0;){if(++r===s)return t;i=n[r]}const l=r*32+se.numberOfTrailingZeros(i);return l>t?t:l}getNextUnset(e){const t=this.size;if(e>=t)return t;const n=this.bits;let r=Math.floor(e/32),i=~n[r];i&=~((1<<(e&31))-1);const s=n.length;for(;i===0;){if(++r===s)return t;i=~n[r]}const l=r*32+se.numberOfTrailingZeros(i);return l>t?t:l}setBulk(e,t){this.bits[Math.floor(e/32)]=t}setRange(e,t){if(t<e||e<0||t>this.size)throw new M;if(t===e)return;t--;const n=Math.floor(e/32),r=Math.floor(t/32),i=this.bits;for(let s=n;s<=r;s++){const l=s>n?0:e&31,c=s<r?31:t&31,u=(2<<c)-(1<<l);i[s]|=u}}clear(){const e=this.bits.length,t=this.bits;for(let n=0;n<e;n++)t[n]=0}isRange(e,t,n){if(t<e||e<0||t>this.size)throw new M;if(t===e)return!0;t--;const r=Math.floor(e/32),i=Math.floor(t/32),s=this.bits;for(let l=r;l<=i;l++){const c=l>r?0:e&31,u=l<i?31:t&31,g=(2<<u)-(1<<c)&4294967295;if((s[l]&g)!==(n?g:0))return!1}return!0}appendBit(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++}appendBits(e,t){if(t<0||t>32)throw new M("Num bits must be between 0 and 32");this.ensureCapacity(this.size+t);for(let n=t;n>0;n--)this.appendBit((e>>n-1&1)===1)}appendBitArray(e){const t=e.size;this.ensureCapacity(this.size+t);for(let n=0;n<t;n++)this.appendBit(e.get(n))}xor(e){if(this.size!==e.size)throw new M("Sizes don't match");const t=this.bits;for(let n=0,r=t.length;n<r;n++)t[n]^=e.bits[n]}toBytes(e,t,n,r){for(let i=0;i<r;i++){let s=0;for(let l=0;l<8;l++)this.get(e)&&(s|=1<<7-l),e++;t[n+i]=s}}getBitArray(){return this.bits}reverse(){const e=new Int32Array(this.bits.length),t=Math.floor((this.size-1)/32),n=t+1,r=this.bits;for(let i=0;i<n;i++){let s=r[i];s=s>>1&1431655765|(s&1431655765)<<1,s=s>>2&858993459|(s&858993459)<<2,s=s>>4&252645135|(s&252645135)<<4,s=s>>8&16711935|(s&16711935)<<8,s=s>>16&65535|(s&65535)<<16,e[t-i]=s}if(this.size!==n*32){const i=n*32-this.size;let s=e[0]>>>i;for(let l=1;l<n;l++){const c=e[l];s|=c<<32-i,e[l-1]=s,s=c>>>i}e[n-1]=s}this.bits=e}static makeArray(e){return new Int32Array(Math.floor((e+31)/32))}equals(e){if(!(e instanceof Ee))return!1;const t=e;return this.size===t.size&&$.equals(this.bits,t.bits)}hashCode(){return 31*this.size+$.hashCode(this.bits)}toString(){let e="";for(let t=0,n=this.size;t<n;t++)(t&7)===0&&(e+=" "),e+=this.get(t)?"X":".";return e}clone(){return new Ee(this.size,this.bits.slice())}}var Xe;(function(A){A[A.OTHER=0]="OTHER",A[A.PURE_BARCODE=1]="PURE_BARCODE",A[A.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",A[A.TRY_HARDER=3]="TRY_HARDER",A[A.CHARACTER_SET=4]="CHARACTER_SET",A[A.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",A[A.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",A[A.ASSUME_GS1=7]="ASSUME_GS1",A[A.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",A[A.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",A[A.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(Xe||(Xe={}));var me=Xe;class G extends m{static getFormatInstance(){return new G}}G.kind="FormatException";var ae;(function(A){A[A.Cp437=0]="Cp437",A[A.ISO8859_1=1]="ISO8859_1",A[A.ISO8859_2=2]="ISO8859_2",A[A.ISO8859_3=3]="ISO8859_3",A[A.ISO8859_4=4]="ISO8859_4",A[A.ISO8859_5=5]="ISO8859_5",A[A.ISO8859_6=6]="ISO8859_6",A[A.ISO8859_7=7]="ISO8859_7",A[A.ISO8859_8=8]="ISO8859_8",A[A.ISO8859_9=9]="ISO8859_9",A[A.ISO8859_10=10]="ISO8859_10",A[A.ISO8859_11=11]="ISO8859_11",A[A.ISO8859_13=12]="ISO8859_13",A[A.ISO8859_14=13]="ISO8859_14",A[A.ISO8859_15=14]="ISO8859_15",A[A.ISO8859_16=15]="ISO8859_16",A[A.SJIS=16]="SJIS",A[A.Cp1250=17]="Cp1250",A[A.Cp1251=18]="Cp1251",A[A.Cp1252=19]="Cp1252",A[A.Cp1256=20]="Cp1256",A[A.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",A[A.UTF8=22]="UTF8",A[A.ASCII=23]="ASCII",A[A.Big5=24]="Big5",A[A.GB18030=25]="GB18030",A[A.EUC_KR=26]="EUC_KR"})(ae||(ae={}));class V{constructor(e,t,n,...r){this.valueIdentifier=e,this.name=n,typeof t=="number"?this.values=Int32Array.from([t]):this.values=t,this.otherEncodingNames=r,V.VALUE_IDENTIFIER_TO_ECI.set(e,this),V.NAME_TO_ECI.set(n,this);const i=this.values;for(let s=0,l=i.length;s!==l;s++){const c=i[s];V.VALUES_TO_ECI.set(c,this)}for(const s of r)V.NAME_TO_ECI.set(s,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(e){if(e<0||e>=900)throw new G("incorect value");const t=V.VALUES_TO_ECI.get(e);if(t===void 0)throw new G("incorect value");return t}static getCharacterSetECIByName(e){const t=V.NAME_TO_ECI.get(e);if(t===void 0)throw new G("incorect value");return t}equals(e){if(!(e instanceof V))return!1;const t=e;return this.getName()===t.getName()}}V.VALUE_IDENTIFIER_TO_ECI=new Map,V.VALUES_TO_ECI=new Map,V.NAME_TO_ECI=new Map,V.Cp437=new V(ae.Cp437,Int32Array.from([0,2]),"Cp437"),V.ISO8859_1=new V(ae.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),V.ISO8859_2=new V(ae.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),V.ISO8859_3=new V(ae.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),V.ISO8859_4=new V(ae.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),V.ISO8859_5=new V(ae.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),V.ISO8859_6=new V(ae.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),V.ISO8859_7=new V(ae.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),V.ISO8859_8=new V(ae.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),V.ISO8859_9=new V(ae.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),V.ISO8859_10=new V(ae.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),V.ISO8859_11=new V(ae.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),V.ISO8859_13=new V(ae.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),V.ISO8859_14=new V(ae.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),V.ISO8859_15=new V(ae.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),V.ISO8859_16=new V(ae.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),V.SJIS=new V(ae.SJIS,20,"SJIS","Shift_JIS"),V.Cp1250=new V(ae.Cp1250,21,"Cp1250","windows-1250"),V.Cp1251=new V(ae.Cp1251,22,"Cp1251","windows-1251"),V.Cp1252=new V(ae.Cp1252,23,"Cp1252","windows-1252"),V.Cp1256=new V(ae.Cp1256,24,"Cp1256","windows-1256"),V.UnicodeBigUnmarked=new V(ae.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),V.UTF8=new V(ae.UTF8,26,"UTF8","UTF-8"),V.ASCII=new V(ae.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),V.Big5=new V(ae.Big5,28,"Big5"),V.GB18030=new V(ae.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),V.EUC_KR=new V(ae.EUC_KR,30,"EUC_KR","EUC-KR");class ve extends m{}ve.kind="UnsupportedOperationException";class ze{static decode(e,t){const n=this.encodingName(t);return this.customDecoder?this.customDecoder(e,n):typeof TextDecoder=="undefined"||this.shouldDecodeOnFallback(n)?this.decodeFallback(e,n):new TextDecoder(n).decode(e)}static shouldDecodeOnFallback(e){return!ze.isBrowser()&&e==="ISO-8859-1"}static encode(e,t){const n=this.encodingName(t);return this.customEncoder?this.customEncoder(e,n):typeof TextEncoder=="undefined"?this.encodeFallback(e):new TextEncoder().encode(e)}static isBrowser(){return typeof window!="undefined"&&{}.toString.call(window)==="[object Window]"}static encodingName(e){return typeof e=="string"?e:e.getName()}static encodingCharacterSet(e){return e instanceof V?e:V.getCharacterSetECIByName(e)}static decodeFallback(e,t){const n=this.encodingCharacterSet(t);if(ze.isDecodeFallbackSupported(n)){let r="";for(let i=0,s=e.length;i<s;i++){let l=e[i].toString(16);l.length<2&&(l="0"+l),r+="%"+l}return decodeURIComponent(r)}if(n.equals(V.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new ve(`Encoding ${this.encodingName(t)} not supported by fallback.`)}static isDecodeFallbackSupported(e){return e.equals(V.UTF8)||e.equals(V.ISO8859_1)||e.equals(V.ASCII)}static encodeFallback(e){const n=btoa(unescape(encodeURIComponent(e))).split(""),r=[];for(let i=0;i<n.length;i++)r.push(n[i].charCodeAt(0));return new Uint8Array(r)}}class le{static castAsNonUtf8Char(e,t=null){const n=t?t.getName():this.ISO88591;return ze.decode(new Uint8Array([e]),n)}static guessEncoding(e,t){if(t!=null&&t.get(me.CHARACTER_SET)!==void 0)return t.get(me.CHARACTER_SET).toString();const n=e.length;let r=!0,i=!0,s=!0,l=0,c=0,u=0,g=0,w=0,E=0,I=0,y=0,N=0,O=0,B=0;const X=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191;for(let Z=0;Z<n&&(r||i||s);Z++){const W=e[Z]&255;s&&(l>0?(W&128)===0?s=!1:l--:(W&128)!==0&&((W&64)===0?s=!1:(l++,(W&32)===0?c++:(l++,(W&16)===0?u++:(l++,(W&8)===0?g++:s=!1))))),r&&(W>127&&W<160?r=!1:W>159&&(W<192||W===215||W===247)&&B++),i&&(w>0?W<64||W===127||W>252?i=!1:w--:W===128||W===160||W>239?i=!1:W>160&&W<224?(E++,y=0,I++,I>N&&(N=I)):W>127?(w++,I=0,y++,y>O&&(O=y)):(I=0,y=0))}return s&&l>0&&(s=!1),i&&w>0&&(i=!1),s&&(X||c+u+g>0)?le.UTF8:i&&(le.ASSUME_SHIFT_JIS||N>=3||O>=3)?le.SHIFT_JIS:r&&i?N===2&&E===2||B*10>=n?le.SHIFT_JIS:le.ISO88591:r?le.ISO88591:i?le.SHIFT_JIS:s?le.UTF8:le.PLATFORM_DEFAULT_ENCODING}static format(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<y;)I=l!==void 0?I+N:N+I;return I}let i=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(i,r)}static getBytes(e,t){return ze.encode(e,t)}static getCharCode(e,t=0){return e.charCodeAt(t)}static getCharAt(e){return String.fromCharCode(e)}}le.SHIFT_JIS=V.SJIS.getName(),le.GB2312="GB2312",le.ISO88591=V.ISO8859_1.getName(),le.EUC_JP="EUC_JP",le.UTF8=V.UTF8.getName(),le.PLATFORM_DEFAULT_ENCODING=le.UTF8,le.ASSUME_SHIFT_JIS=!1;class Ie{constructor(e=""){this.value=e}enableDecoding(e){return this.encoding=e,this}append(e){return typeof e=="string"?this.value+=e.toString():this.encoding?this.value+=le.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this}appendChars(e,t,n){for(let r=t;t<t+n;r++)this.append(e[r]);return this}length(){return this.value.length}charAt(e){return this.value.charAt(e)}deleteCharAt(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)}setCharAt(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+1)}substring(e,t){return this.value.substring(e,t)}setLengthToZero(){this.value=""}toString(){return this.value}insert(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+t.length)}}class et{constructor(e,t,n,r){if(this.width=e,this.height=t,this.rowSize=n,this.bits=r,t==null&&(t=e),this.height=t,e<1||t<1)throw new M("Both dimensions must be greater than 0");n==null&&(n=Math.floor((e+31)/32)),this.rowSize=n,r==null&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(e){const t=e.length,n=e[0].length,r=new et(n,t);for(let i=0;i<t;i++){const s=e[i];for(let l=0;l<n;l++)s[l]&&r.set(l,i)}return r}static parseFromString(e,t,n){if(e===null)throw new M("stringRepresentation cannot be null");const r=new Array(e.length);let i=0,s=0,l=-1,c=0,u=0;for(;u<e.length;)if(e.charAt(u)===`
`||e.charAt(u)==="\r"){if(i>s){if(l===-1)l=i-s;else if(i-s!==l)throw new M("row lengths do not match");s=i,c++}u++}else if(e.substring(u,u+t.length)===t)u+=t.length,r[i]=!0,i++;else if(e.substring(u,u+n.length)===n)u+=n.length,r[i]=!1,i++;else throw new M("illegal character encountered: "+e.substring(u));if(i>s){if(l===-1)l=i-s;else if(i-s!==l)throw new M("row lengths do not match");c++}const g=new et(l,c);for(let w=0;w<i;w++)r[w]&&g.set(Math.floor(w%l),Math.floor(w/l));return g}get(e,t){const n=t*this.rowSize+Math.floor(e/32);return(this.bits[n]>>>(e&31)&1)!==0}set(e,t){const n=t*this.rowSize+Math.floor(e/32);this.bits[n]|=1<<(e&31)&4294967295}unset(e,t){const n=t*this.rowSize+Math.floor(e/32);this.bits[n]&=~(1<<(e&31)&4294967295)}flip(e,t){const n=t*this.rowSize+Math.floor(e/32);this.bits[n]^=1<<(e&31)&4294967295}xor(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new M("input matrix dimensions do not match");const t=new Ee(Math.floor(this.width/32)+1),n=this.rowSize,r=this.bits;for(let i=0,s=this.height;i<s;i++){const l=i*n,c=e.getRow(i,t).getBitArray();for(let u=0;u<n;u++)r[l+u]^=c[u]}}clear(){const e=this.bits,t=e.length;for(let n=0;n<t;n++)e[n]=0}setRegion(e,t,n,r){if(t<0||e<0)throw new M("Left and top must be nonnegative");if(r<1||n<1)throw new M("Height and width must be at least 1");const i=e+n,s=t+r;if(s>this.height||i>this.width)throw new M("The region must fit inside the matrix");const l=this.rowSize,c=this.bits;for(let u=t;u<s;u++){const g=u*l;for(let w=e;w<i;w++)c[g+Math.floor(w/32)]|=1<<(w&31)&4294967295}}getRow(e,t){t==null||t.getSize()<this.width?t=new Ee(this.width):t.clear();const n=this.rowSize,r=this.bits,i=e*n;for(let s=0;s<n;s++)t.setBulk(s*32,r[i+s]);return t}setRow(e,t){K.arraycopy(t.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)}rotate180(){const e=this.getWidth(),t=this.getHeight();let n=new Ee(e),r=new Ee(e);for(let i=0,s=Math.floor((t+1)/2);i<s;i++)n=this.getRow(i,n),r=this.getRow(t-1-i,r),n.reverse(),r.reverse(),this.setRow(i,r),this.setRow(t-1-i,n)}getEnclosingRectangle(){const e=this.width,t=this.height,n=this.rowSize,r=this.bits;let i=e,s=t,l=-1,c=-1;for(let u=0;u<t;u++)for(let g=0;g<n;g++){const w=r[u*n+g];if(w!==0){if(u<s&&(s=u),u>c&&(c=u),g*32<i){let E=0;for(;(w<<31-E&4294967295)===0;)E++;g*32+E<i&&(i=g*32+E)}if(g*32+31>l){let E=31;for(;w>>>E===0;)E--;g*32+E>l&&(l=g*32+E)}}}return l<i||c<s?null:Int32Array.from([i,s,l-i+1,c-s+1])}getTopLeftOnBit(){const e=this.rowSize,t=this.bits;let n=0;for(;n<t.length&&t[n]===0;)n++;if(n===t.length)return null;const r=n/e;let i=n%e*32;const s=t[n];let l=0;for(;(s<<31-l&4294967295)===0;)l++;return i+=l,Int32Array.from([i,r])}getBottomRightOnBit(){const e=this.rowSize,t=this.bits;let n=t.length-1;for(;n>=0&&t[n]===0;)n--;if(n<0)return null;const r=Math.floor(n/e);let i=Math.floor(n%e)*32;const s=t[n];let l=31;for(;s>>>l===0;)l--;return i+=l,Int32Array.from([i,r])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(e){if(!(e instanceof et))return!1;const t=e;return this.width===t.width&&this.height===t.height&&this.rowSize===t.rowSize&&$.equals(this.bits,t.bits)}hashCode(){let e=this.width;return e=31*e+this.width,e=31*e+this.height,e=31*e+this.rowSize,e=31*e+$.hashCode(this.bits),e}toString(e="X ",t=" ",n=`
`){return this.buildToString(e,t,n)}buildToString(e,t,n){let r=new Ie;for(let i=0,s=this.height;i<s;i++){for(let l=0,c=this.width;l<c;l++)r.append(this.get(l,i)?e:t);r.append(n)}return r.toString()}clone(){return new et(this.width,this.height,this.rowSize,this.bits.slice())}}class F extends m{static getNotFoundInstance(){return new F}}F.kind="NotFoundException";class ot extends ne{constructor(e){super(e),this.luminances=ot.EMPTY,this.buckets=new Int32Array(ot.LUMINANCE_BUCKETS)}getBlackRow(e,t){const n=this.getLuminanceSource(),r=n.getWidth();t==null||t.getSize()<r?t=new Ee(r):t.clear(),this.initArrays(r);const i=n.getRow(e,this.luminances),s=this.buckets;for(let c=0;c<r;c++)s[(i[c]&255)>>ot.LUMINANCE_SHIFT]++;const l=ot.estimateBlackPoint(s);if(r<3)for(let c=0;c<r;c++)(i[c]&255)<l&&t.set(c);else{let c=i[0]&255,u=i[1]&255;for(let g=1;g<r-1;g++){const w=i[g+1]&255;(u*4-c-w)/2<l&&t.set(g),c=u,u=w}}return t}getBlackMatrix(){const e=this.getLuminanceSource(),t=e.getWidth(),n=e.getHeight(),r=new et(t,n);this.initArrays(t);const i=this.buckets;for(let c=1;c<5;c++){const u=Math.floor(n*c/5),g=e.getRow(u,this.luminances),w=Math.floor(t*4/5);for(let E=Math.floor(t/5);E<w;E++){const I=g[E]&255;i[I>>ot.LUMINANCE_SHIFT]++}}const s=ot.estimateBlackPoint(i),l=e.getMatrix();for(let c=0;c<n;c++){const u=c*t;for(let g=0;g<t;g++)(l[u+g]&255)<s&&r.set(g,c)}return r}createBinarizer(e){return new ot(e)}initArrays(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e));const t=this.buckets;for(let n=0;n<ot.LUMINANCE_BUCKETS;n++)t[n]=0}static estimateBlackPoint(e){const t=e.length;let n=0,r=0,i=0;for(let g=0;g<t;g++)e[g]>i&&(r=g,i=e[g]),e[g]>n&&(n=e[g]);let s=0,l=0;for(let g=0;g<t;g++){const w=g-r,E=e[g]*w*w;E>l&&(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<<ot.LUMINANCE_SHIFT}}ot.LUMINANCE_BITS=5,ot.LUMINANCE_SHIFT=8-ot.LUMINANCE_BITS,ot.LUMINANCE_BUCKETS=1<<ot.LUMINANCE_BITS,ot.EMPTY=Uint8ClampedArray.from([0]);class he extends ot{constructor(e){super(e),this.matrix=null}getBlackMatrix(){if(this.matrix!==null)return this.matrix;const e=this.getLuminanceSource(),t=e.getWidth(),n=e.getHeight();if(t>=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;g<n;g++){let w=g<<he.BLOCK_SIZE_POWER;w>c&&(w=c);const E=he.cap(g,2,n-3);for(let I=0;I<t;I++){let y=I<<he.BLOCK_SIZE_POWER;y>u&&(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 e<t?t:e>n?n:e}static thresholdBlock(e,t,n,r,i,s){for(let l=0,c=n*i+t;l<he.BLOCK_SIZE;l++,c+=i)for(let u=0;u<he.BLOCK_SIZE;u++)(e[c+u]&255)<=r&&s.set(t+u,n+l)}static calculateBlackPoints(e,t,n,r,i){const s=i-he.BLOCK_SIZE,l=r-he.BLOCK_SIZE,c=new Array(n);for(let u=0;u<n;u++){c[u]=new Int32Array(t);let g=u<<he.BLOCK_SIZE_POWER;g>s&&(g=s);for(let w=0;w<t;w++){let E=w<<he.BLOCK_SIZE_POWER;E>l&&(E=l);let I=0,y=255,N=0;for(let B=0,X=g*r+E;B<he.BLOCK_SIZE;B++,X+=r){for(let Z=0;Z<he.BLOCK_SIZE;Z++){const W=e[X+Z]&255;I+=W,W<y&&(y=W),W>N&&(N=W)}if(N-y>he.MIN_DYNAMIC_RANGE)for(B++,X+=r;B<he.BLOCK_SIZE;B++,X+=r)for(let Z=0;Z<he.BLOCK_SIZE;Z++)I+=e[X+Z]&255}let O=I>>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<B&&(O=B)}c[u][w]=O}}return c}}he.BLOCK_SIZE_POWER=3,he.BLOCK_SIZE=1<<he.BLOCK_SIZE_POWER,he.BLOCK_SIZE_MASK=he.BLOCK_SIZE-1,he.MINIMUM_DIMENSION=he.BLOCK_SIZE*5,he.MIN_DYNAMIC_RANGE=24;class We{constructor(e,t){this.width=e,this.height=t}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(e,t,n,r){throw new ve("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new ve("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new ve("This luminance source does not support rotation by 45 degrees.")}toString(){const e=new Uint8ClampedArray(this.width);let t=new Ie;for(let n=0;n<this.height;n++){const r=this.getRow(n,e);for(let i=0;i<this.width;i++){const s=r[i]&255;let l;s<64?l="#":s<128?l="+":s<192?l=".":l=" ",t.append(l)}t.append(`
`)}return t.toString()}}class Re extends We{constructor(e){super(e.getWidth(),e.getHeight()),this.delegate=e}getRow(e,t){const n=this.delegate.getRow(e,t),r=this.getWidth();for(let i=0;i<r;i++)n[i]=255-(n[i]&255);return n}getMatrix(){const e=this.delegate.getMatrix(),t=this.getWidth()*this.getHeight(),n=new Uint8ClampedArray(t);for(let r=0;r<t;r++)n[r]=255-(e[r]&255);return n}isCropSupported(){return this.delegate.isCropSupported()}crop(e,t,n,r){return new Re(this.delegate.crop(e,t,n,r))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new Re(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new Re(this.delegate.rotateCounterClockwise45())}}class xt extends We{constructor(e){super(e.width,e.height),this.canvas=e,this.tempCanvasElement=null,this.buffer=xt.makeBufferFromCanvasImageData(e)}static makeBufferFromCanvasImageData(e){const t=e.getContext("2d").getImageData(0,0,e.width,e.height);return xt.toGrayscaleBuffer(t.data,e.width,e.height)}static toGrayscaleBuffer(e,t,n){const r=new Uint8ClampedArray(t*n);for(let i=0,s=0,l=e.length;i<l;i+=4,s++){let c;if(e[i+3]===0)c=255;else{const g=e[i],w=e[i+1],E=e[i+2];c=306*g+601*w+117*E+512>>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.length<n&&(t=new Uint8ClampedArray(n)),t.set(this.buffer.slice(r,r+n))),t}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(e,t,n,r){return super.crop(e,t,n,r),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(this.tempCanvasElement===null){const e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement}rotate(e){const t=this.getTempCanvasElement(),n=t.getContext("2d"),r=e*xt.DEGREE_TO_RADIANS,i=this.canvas.width,s=this.canvas.height,l=Math.ceil(Math.abs(Math.cos(r))*i+Math.abs(Math.sin(r))*s),c=Math.ceil(Math.abs(Math.sin(r))*i+Math.abs(Math.cos(r))*s);return t.width=l,t.height=c,n.translate(l/2,c/2),n.rotate(r),n.drawImage(this.canvas,i/-2,s/-2),this.buffer=xt.makeBufferFromCanvasImageData(t),this}invert(){return new Re(this)}}xt.DEGREE_TO_RADIANS=Math.PI/180;class qn{constructor(e,t,n){this.deviceId=e,this.label=t,this.kind="videoinput",this.groupId=n||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var ft=(globalThis||Dr||self||window||void 0)&&(globalThis||Dr||self||window||void 0).__awaiter||function(A,e,t,n){function r(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function l(g){try{u(n.next(g))}catch(w){s(w)}}function c(g){try{u(n.throw(g))}catch(w){s(w)}}function u(g){g.done?i(g.value):r(g.value).then(l,c)}u((n=n.apply(A,e||[])).next())})};class Dt{constructor(e,t=500,n){this.reader=e,this.timeBetweenScansMillis=t,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}get hasNavigator(){return typeof navigator!="undefined"}get isMediaDevicesSuported(){return this.hasNavigator&&!!navigator.mediaDevices}get canEnumerateDevices(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)}get timeBetweenDecodingAttempts(){return this._timeBetweenDecodingAttempts}set timeBetweenDecodingAttempts(e){this._timeBetweenDecodingAttempts=e<0?0:e}set hints(e){this._hints=e||null}get hints(){return this._hints}listVideoInputDevices(){return ft(this,void 0,void 0,function*(){if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");const e=yield navigator.mediaDevices.enumerateDevices(),t=[];for(const n of e){const r=n.kind==="video"?"videoinput":n.kind;if(r!=="videoinput")continue;const i=n.deviceId||n.id,s=n.label||`Video device ${t.length+1}`,l=n.groupId,c={deviceId:i,label:s,kind:r,groupId:l};t.push(c)}return t})}getVideoInputDevices(){return ft(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(t=>new 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(;r<n&&t[r]===0;)r++;r===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-r),K.arraycopy(t,r,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(e){return this.coefficients[this.coefficients.length-1-e]}evaluateAt(e){if(e===0)return this.getCoefficient(0);const t=this.coefficients;let n;if(e===1){n=0;for(let s=0,l=t.length;s!==l;s++){const c=t[s];n=mn.addOrSubtract(n,c)}return n}n=t[0];const r=t.length,i=this.field;for(let s=1;s<r;s++)n=mn.addOrSubtract(i.multiply(e,n),t[s]);return n}addOrSubtract(e){if(!this.field.equals(e.field))throw new M("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;let t=this.coefficients,n=e.coefficients;if(t.length>n.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<n.length;s++)r[s]=mn.addOrSubtract(t[s-i],n[s]);return new ut(this.field,r)}multiply(e){if(!this.field.equals(e.field))throw new M("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();const t=this.coefficients,n=t.length,r=e.coefficients,i=r.length,s=new Int32Array(n+i-1),l=this.field;for(let c=0;c<n;c++){const u=t[c];for(let g=0;g<i;g++)s[c+g]=mn.addOrSubtract(s[c+g],l.multiply(u,r[g]))}return new ut(l,s)}multiplyScalar(e){if(e===0)return this.field.getZero();if(e===1)return this;const t=this.coefficients.length,n=this.field,r=new Int32Array(t),i=this.coefficients;for(let s=0;s<t;s++)r[s]=n.multiply(i[s],e);return new ut(n,r)}multiplyByMonomial(e,t){if(e<0)throw new M;if(t===0)return this.field.getZero();const n=this.coefficients,r=n.length,i=new Int32Array(r+e),s=this.field;for(let l=0;l<r;l++)i[l]=s.multiply(n[l],t);return new ut(s,i)}divide(e){if(!this.field.equals(e.field))throw new M("GenericGFPolys do not have same GenericGF field");if(e.isZero())throw new M("Divide by 0");const t=this.field;let n=t.getZero(),r=this;const i=e.getCoefficient(e.getDegree()),s=t.inverse(i);for(;r.getDegree()>=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;l++)r[l]=i,i*=2,i>=t&&(i^=e,i&=t-1);this.expTable=r;const s=new Int32Array(t);for(let l=0;l<t-1;l++)s[r[l]]=l;this.logTable=s,this.zero=new ut(this,Int32Array.from([0])),this.one=new ut(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(e,t){if(e<0)throw new M;if(t===0)return this.zero;const n=new Int32Array(e+1);return n[0]=t,new ut(this,n)}inverse(e){if(e===0)throw new In;return this.expTable[this.size-this.logTable[e]-1]}multiply(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+se.toHexString(this.primitive)+","+this.size+")"}equals(e){return e===this}}Oe.AZTEC_DATA_12=new Oe(4201,4096,1),Oe.AZTEC_DATA_10=new Oe(1033,1024,1),Oe.AZTEC_DATA_6=new Oe(67,64,1),Oe.AZTEC_PARAM=new Oe(19,16,1),Oe.QR_CODE_FIELD_256=new Oe(285,256,0),Oe.DATA_MATRIX_FIELD_256=new Oe(301,256,1),Oe.AZTEC_DATA_8=Oe.DATA_MATRIX_FIELD_256,Oe.MAXICODE_FIELD_64=Oe.AZTEC_DATA_6;class b extends m{}b.kind="ReedSolomonException";class _ extends m{}_.kind="IllegalStateException";class v{constructor(e){this.field=e}decode(e,t){const n=this.field,r=new ut(n,e),i=new Int32Array(t);let s=!0;for(let I=0;I<t;I++){const y=r.evaluateAt(n.exp(I+n.getGeneratorBase()));i[i.length-1-I]=y,y!==0&&(s=!1)}if(s)return;const l=new ut(n,i),c=this.runEuclideanAlgorithm(n.buildMonomial(t,1),l,t),u=c[0],g=c[1],w=this.findErrorLocations(u),E=this.findErrorMagnitudes(g,w);for(let I=0;I<w.length;I++){const y=e.length-1-n.log(w[I]);if(y<0)throw new b("Bad error location");e[y]=Oe.addOrSubtract(e[y],E[I])}}runEuclideanAlgorithm(e,t,n){if(e.getDegree()<t.getDegree()){const I=e;e=t,t=I}const r=this.field;let i=e,s=t,l=r.getZero(),c=r.getOne();for(;s.getDegree()>=(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;s<i.getSize()&&r<t;s++)e.evaluateAt(s)===0&&(n[r]=i.inverse(s),r++);if(r!==t)throw new b("Error locator degree does not match number of roots");return n}findErrorMagnitudes(e,t){const n=t.length,r=new Int32Array(n),i=this.field;for(let s=0;s<n;s++){const l=i.inverse(t[s]);let c=1;for(let u=0;u<n;u++)if(s!==u){const g=i.multiply(t[u],l),w=(g&1)===0?g|1:g&-2;c=i.multiply(c,w)}r[s]=i.multiply(e.evaluateAt(l),i.inverse(c)),i.getGeneratorBase()!==0&&(r[s]=i.multiply(r[s],l))}return r}}var k;(function(A){A[A.UPPER=0]="UPPER",A[A.LOWER=1]="LOWER",A[A.MIXED=2]="MIXED",A[A.DIGIT=3]="DIGIT",A[A.PUNCT=4]="PUNCT",A[A.BINARY=5]="BINARY"})(k||(k={}));class P{decode(e){this.ddata=e;let t=e.getBits(),n=this.extractBits(t),r=this.correctBits(n),i=P.convertBoolArrayToByteArray(r),s=P.getEncodedData(r),l=new nn(i,s,null,null);return l.setNumBits(r.length),l}static highLevelDecode(e){return this.getEncodedData(e)}static getEncodedData(e){let t=e.length,n=k.UPPER,r=k.UPPER,i="",s=0;for(;s<t;)if(r===k.BINARY){if(t-s<5)break;let l=P.readCode(e,s,5);if(s+=5,l===0){if(t-s<11)break;l=P.readCode(e,s,11)+31,s+=11}for(let c=0;c<l;c++){if(t-s<8){s=t;break}const u=P.readCode(e,s,8);i+=le.castAsNonUtf8Char(u),s+=8}r=n}else{let l=r===k.DIGIT?4:5;if(t-s<l)break;let c=P.readCode(e,s,l);s+=l;let u=P.getCharacter(r,c);u.startsWith("CTRL_")?(n=r,r=P.getTable(u.charAt(5)),u.charAt(6)==="L"&&(n=r)):(i+=u,r=n)}return i}static getTable(e){switch(e){case"L":return k.LOWER;case"P":return k.PUNCT;case"M":return k.MIXED;case"D":return k.DIGIT;case"B":return k.BINARY;case"U":default:return k.UPPER}}static getCharacter(e,t){switch(e){case k.UPPER:return P.UPPER_TABLE[t];case k.LOWER:return P.LOWER_TABLE[t];case k.MIXED:return P.MIXED_TABLE[t];case k.PUNCT:return P.PUNCT_TABLE[t];case k.DIGIT:return P.DIGIT_TABLE[t];default:throw new _("Bad table")}}correctBits(e){let t,n;this.ddata.getNbLayers()<=2?(n=6,t=Oe.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,t=Oe.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,t=Oe.AZTEC_DATA_10):(n=12,t=Oe.AZTEC_DATA_12);let r=this.ddata.getNbDatablocks(),i=e.length/n;if(i<r)throw new G;let s=e.length%n,l=new Int32Array(i);for(let E=0;E<i;E++,s+=n)l[E]=P.readCode(e,s,n);try{new v(t).decode(l,i-r)}catch(E){throw new G(E)}let c=(1<<n)-1,u=0;for(let E=0;E<r;E++){let I=l[E];if(I===0||I===c)throw new G;(I===1||I===c-1)&&u++}let g=new Array(r*n-u),w=0;for(let E=0;E<r;E++){let I=l[E];if(I===1||I===c-1)g.fill(I>1,w,w+n-1),w+=n-1;else for(let y=n-1;y>=0;--y)g[w++]=(I&1<<y)!==0}return g}extractBits(e){let t=this.ddata.isCompact(),n=this.ddata.getNbLayers(),r=(t?11:14)+n*4,i=new Int32Array(r),s=new Array(this.totalBitsInLayer(n,t));if(t)for(let l=0;l<i.length;l++)i[l]=l;else{let l=r+1+2*se.truncDivision(se.truncDivision(r,2)-1,15),c=r/2,u=se.truncDivision(l,2);for(let g=0;g<c;g++){let w=g+se.truncDivision(g,15);i[c-g-1]=u-w-1,i[c+g]=u+w+1}}for(let l=0,c=0;l<n;l++){let u=(n-l)*4+(t?9:12),g=l*2,w=r-1-g;for(let E=0;E<u;E++){let I=E*2;for(let y=0;y<2;y++)s[c+I+y]=e.get(i[g+y],i[g+E]),s[c+2*u+I+y]=e.get(i[g+E],i[w-y]),s[c+4*u+I+y]=e.get(i[w-y],i[w-E]),s[c+6*u+I+y]=e.get(i[w-E],i[g+y])}c+=u*8}return s}static readCode(e,t,n){let r=0;for(let i=t;i<t+n;i++)r<<=1,e[i]&&(r|=1);return r}static readByte(e,t){let n=e.length-t;return n>=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<t.length;n++)t[n]=P.readByte(e,8*n);return t}totalBitsInLayer(e,t){return((t?88:112)+16*e)*e}}P.UPPER_TABLE=["CTRL_PS"," ","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","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],P.LOWER_TABLE=["CTRL_PS"," ","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","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],P.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`
`,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],P.PUNCT_TABLE=["","\r",`\r
`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","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;)y=this.containsBlackPoint(n,r,t,!1),y?(t++,s=!0,c=!0):c||t++;if(t>=E){i=!0;break}let N=!0;for(;(N||!u)&&r<I;)N=this.containsBlackPoint(e,t,r,!0),N?(r++,s=!0,u=!0):u||r++;if(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&&Z<y;Z++)N=this.getBlackPointOnSegment(e,r-Z,e+Z,r);if(N==null)throw new F;let O=null;for(let Z=1;O===null&&Z<y;Z++)O=this.getBlackPointOnSegment(e,n+Z,e+Z,n);if(O==null)throw new F;let B=null;for(let Z=1;B===null&&Z<y;Z++)B=this.getBlackPointOnSegment(t,n+Z,t-Z,n);if(B==null)throw new F;let X=null;for(let Z=1;X===null&&Z<y;Z++)X=this.getBlackPointOnSegment(t,r-Z,t-Z,r);if(X==null)throw new F;return this.centerEdges(X,N,B,O)}else throw new F}getBlackPointOnSegment(e,t,n,r){const i=H.round(H.distance(e,t,n,r)),s=(n-e)/i,l=(r-t)/i,c=this.image;for(let u=0;u<i;u++){const g=H.round(e+u*s),w=H.round(t+u*l);if(c.get(g,w))return new R(g,w)}return null}centerEdges(e,t,n,r){const i=e.getX(),s=e.getY(),l=t.getX(),c=t.getY(),u=n.getX(),g=n.getY(),w=r.getX(),E=r.getY(),I=oe.CORR;return i<this.width/2?[new R(w-I,E+I),new R(l+I,c+I),new R(u-I,g-I),new R(i+I,s-I)]:[new R(w+I,E+I),new R(l+I,c-I),new R(u-I,g+I),new R(i-I,s-I)]}containsBlackPoint(e,t,n,r){const i=this.image;if(r){for(let s=e;s<=t;s++)if(i.get(s,n))return!0}else for(let s=e;s<=t;s++)if(i.get(n,s))return!0;return!1}}oe.INIT_SIZE=10,oe.CORR=1;class ie{static checkAndNudgePoints(e,t){const n=e.getWidth(),r=e.getHeight();let i=!0;for(let s=0;s<t.length&&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)}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<t;E+=2){const I=e[E],y=e[E+1],N=i*I+c*y+w;e[E]=(n*I+s*y+u)/N,e[E+1]=(r*I+l*y+g)/N}}transformPointsWithValues(e,t){const 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,E=e.length;for(let I=0;I<E;I++){const y=e[I],N=t[I],O=i*y+c*N+w;e[I]=(n*y+s*N+u)/O,t[I]=(r*y+l*N+g)/O}}static squareToQuadrilateral(e,t,n,r,i,s,l,c){const u=e-n+i-l,g=t-r+s-c;if(u===0&&g===0)return new re(n-e,i-n,e,r-t,s-r,t,0,0,1);{const w=n-i,E=l-i,I=r-s,y=c-s,N=w*y-E*I,O=(u*y-E*g)/N,B=(w*g-u*I)/N;return new re(n-e+O*n,l-e+B*l,e,r-t+O*r,c-t+B*c,t,O,B,1)}}static quadrilateralToSquare(e,t,n,r,i,s,l,c){return re.squareToQuadrilateral(e,t,n,r,i,s,l,c).buildAdjoint()}buildAdjoint(){return new re(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)}times(e){return new re(this.a11*e.a11+this.a21*e.a12+this.a31*e.a13,this.a11*e.a21+this.a21*e.a22+this.a31*e.a23,this.a11*e.a31+this.a21*e.a32+this.a31*e.a33,this.a12*e.a11+this.a22*e.a12+this.a32*e.a13,this.a12*e.a21+this.a22*e.a22+this.a32*e.a23,this.a12*e.a31+this.a22*e.a32+this.a32*e.a33,this.a13*e.a11+this.a23*e.a12+this.a33*e.a13,this.a13*e.a21+this.a23*e.a22+this.a33*e.a23,this.a13*e.a31+this.a23*e.a32+this.a33*e.a33)}}class we extends ie{sampleGrid(e,t,n,r,i,s,l,c,u,g,w,E,I,y,N,O,B,X,Z){const W=re.quadrilateralToQuadrilateral(r,i,s,l,c,u,g,w,E,I,y,N,O,B,X,Z);return this.sampleGridWithTransform(e,t,n,W)}sampleGridWithTransform(e,t,n,r){if(t<=0||n<=0)throw new F;const i=new et(t,n),s=new Float32Array(2*t);for(let l=0;l<n;l++){const c=s.length,u=l+.5;for(let g=0;g<c;g+=2)s[g]=g/2+.5,s[g+1]=u;r.transformPoints(s),ie.checkAndNudgePoints(e,s);try{for(let g=0;g<c;g+=2)e.get(Math.floor(s[g]),Math.floor(s[g+1]))&&i.set(g/2,l)}catch{throw new F}}return i}}class pe{static setGridSampler(e){pe.gridSampler=e}static getInstance(){return pe.gridSampler}}pe.gridSampler=new we;class Te{constructor(e,t){this.x=e,this.y=t}toResultPoint(){return new R(this.getX(),this.getY())}getX(){return this.x}getY(){return this.y}}class Ue{constructor(e){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=e}detect(){return this.detectMirror(!1)}detectMirror(e){let t=this.getMatrixCenter(),n=this.getBullsEyeCorners(t);if(e){let s=n[0];n[0]=n[2],n[2]=s}this.extractParameters(n);let r=this.sampleGrid(this.image,n[this.shift%4],n[(this.shift+1)%4],n[(this.shift+2)%4],n[(this.shift+3)%4]),i=this.getMatrixCornerPoints(n);return new Y(r,i,this.compact,this.nbDataBlocks,this.nbLayers)}extractParameters(e){if(!this.isValidPoint(e[0])||!this.isValidPoint(e[1])||!this.isValidPoint(e[2])||!this.isValidPoint(e[3]))throw new F;let t=2*this.nbCenterLayers,n=new Int32Array([this.sampleLine(e[0],e[1],t),this.sampleLine(e[1],e[2],t),this.sampleLine(e[2],e[3],t),this.sampleLine(e[3],e[0],t)]);this.shift=this.getRotation(n,t);let r=0;for(let s=0;s<4;s++){let l=n[(this.shift+s)%4];this.compact?(r<<=7,r+=l>>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;c<r;c++)l=(l<<4)+s[c];return l}getBullsEyeCorners(e){let t=e,n=e,r=e,i=e,s=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let w=this.getFirstDifferent(t,s,1,-1),E=this.getFirstDifferent(n,s,1,1),I=this.getFirstDifferent(r,s,-1,1),y=this.getFirstDifferent(i,s,-1,-1);if(this.nbCenterLayers>2){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<n;w++)this.image.get(H.round(l+w*u),H.round(c+w*g))&&(r|=1<<n-w-1);return r}isWhiteOrBlackRectangle(e,t,n,r){let i=3;e=new Te(e.getX()-i,e.getY()+i),t=new Te(t.getX()-i,t.getY()-i),n=new Te(n.getX()+i,n.getY()-i),r=new Te(r.getX()+i,r.getY()+i);let s=this.getColor(r,e);if(s===0)return!1;let l=this.getColor(e,t);return l!==s||(l=this.getColor(t,n),l!==s)?!1:(l=this.getColor(n,r),l===s)}getColor(e,t){let n=this.distancePoint(e,t),r=(t.getX()-e.getX())/n,i=(t.getY()-e.getY())/n,s=0,l=e.getX(),c=e.getY(),u=this.image.get(e.getX(),e.getY()),g=Math.ceil(n);for(let E=0;E<g;E++)l+=r,c+=i,this.image.get(H.round(l),H.round(c))!==u&&s++;let w=s/n;return 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&&e<this.image.getWidth()&&t>0&&t<this.image.getHeight()}isValidPoint(e){let t=H.round(e.getX()),n=H.round(e.getY());return this.isValid(t,n)}distancePoint(e,t){return H.distance(e.getX(),e.getY(),t.getX(),t.getY())}distanceResultPoint(e,t){return H.distance(e.getX(),e.getY(),t.getX(),t.getY())}getDimension(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(se.truncDivision(this.nbLayers-4,8)+1)+15}}class He{decode(e,t=null){let n=null,r=new Ue(e.getBlackMatrix()),i=null,s=null;try{let g=r.detectMirror(!1);i=g.getPoints(),this.reportFoundResultPoints(t,i),s=new P().decode(g)}catch(g){n=g}if(s==null)try{let g=r.detectMirror(!0);i=g.getPoints(),this.reportFoundResultPoints(t,i),s=new P().decode(g)}catch(g){throw n!=null?n:g}let l=new rt(s.getText(),s.getRawBytes(),s.getNumBits(),i,de.AZTEC,K.currentTimeMillis()),c=s.getByteSegments();c!=null&&l.putMetadata(Ye.BYTE_SEGMENTS,c);let u=s.getECLevel();return u!=null&&l.putMetadata(Ye.ERROR_CORRECTION_LEVEL,u),l}reportFoundResultPoints(e,t){if(e!=null){let n=e.get(me.NEED_RESULT_POINT_CALLBACK);n!=null&&t.forEach((r,i,s)=>{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<u.length;w++)u[w]=new R(g-u[w].getY()-1,u[w].getX())}return s}else throw new F}}reset(){}doDecode(e,t){const n=e.getWidth(),r=e.getHeight();let i=new Ee(n);const s=t&&t.get(me.TRY_HARDER)===!0,l=Math.max(1,r>>(s?8:5));let c;s?c=r:c=15;const u=Math.trunc(r/2);for(let g=0;g<c;g++){const w=Math.trunc((g+1)/2),E=(g&1)===0,I=u+l*(E?w:-w);if(I<0||I>=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<r;u++)n[u]=0;const i=e.getSize();if(t>=i)throw new F;let s=!e.get(t),l=0,c=t;for(;c<i;){if(e.get(c)!==s)n[l]++;else{if(++l===r)break;n[l]=1,s=!s}c++}if(!(l===r||l===r-1&&c===i))throw new F}static recordPatternInReverse(e,t,n){let r=n.length,i=e.get(t);for(;t>0&&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;u<r;u++)i+=e[u],s+=t[u];if(i<s)return Number.POSITIVE_INFINITY;const l=i/s;n*=l;let c=0;for(let u=0;u<r;u++){const g=e[u],w=t[u]*l,E=g>w?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<t;u++)if(e.get(u)!==l)i[r]++;else{if(r===c-1){let g=q.MAX_AVG_VARIANCE,w=-1;for(let E=q.CODE_START_A;E<=q.CODE_START_C;E++){const I=Ze.patternMatchVariance(i,q.CODE_PATTERNS[E],q.MAX_INDIVIDUAL_VARIANCE);I<g&&(g=I,w=E)}if(w>=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<q.CODE_PATTERNS.length;s++){const l=q.CODE_PATTERNS[s],c=this.patternMatchVariance(t,l,q.MAX_INDIVIDUAL_VARIANCE);c<r&&(r=c,i=s)}if(i>=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;lr<Ct;lr++)Ut[lr]=c[lr];const ar=[new R(Pt,e),new R(Qe,e)];return new rt(E,Ut,0,ar,de.CODE_128,new Date().getTime())}}q.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],q.MAX_AVG_VARIANCE=.25,q.MAX_INDIVIDUAL_VARIANCE=.7,q.CODE_SHIFT=98,q.CODE_CODE_C=99,q.CODE_CODE_B=100,q.CODE_CODE_A=101,q.CODE_FNC_1=102,q.CODE_FNC_2=97,q.CODE_FNC_3=96,q.CODE_FNC_4_A=101,q.CODE_FNC_4_B=100,q.CODE_START_A=103,q.CODE_START_B=104,q.CODE_START_C=105,q.CODE_STOP=106;class tt extends Ze{constructor(e=!1,t=!1){super(),this.usingCheckDigit=e,this.extendedMode=t,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(e,t,n){let r=this.counters;r.fill(0),this.decodeRowResult="";let i=tt.findAsteriskPattern(t,r),s=t.getNextSet(i[1]),l=t.getSize(),c,u;do{tt.recordPattern(t,s,r);let N=tt.toNarrowWidePattern(r);if(N<0)throw new F;c=tt.patternToChar(N),this.decodeRowResult+=c,u=s;for(let O of r)s+=O;s=t.getNextSet(s)}while(c!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let g=0;for(let N of r)g+=N;let w=s-u-g;if(s!==l&&w*2<g)throw new F;if(this.usingCheckDigit){let N=this.decodeRowResult.length-1,O=0;for(let B=0;B<N;B++)O+=tt.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(B));if(this.decodeRowResult.charAt(N)!==tt.ALPHABET_STRING.charAt(O%43))throw new U;this.decodeRowResult=this.decodeRowResult.substring(0,N)}if(this.decodeRowResult.length===0)throw new F;let E;this.extendedMode?E=tt.decodeExtended(this.decodeRowResult):E=this.decodeRowResult;let I=(i[1]+i[0])/2,y=u+g/2;return new rt(E,null,0,[new R(I,e),new R(y,e)],de.CODE_39,new Date().getTime())}static findAsteriskPattern(e,t){let n=e.getSize(),r=e.getNextSet(0),i=0,s=r,l=!1,c=t.length;for(let u=r;u<n;u++)if(e.get(u)!==l)t[i]++;else{if(i===c-1){if(this.toNarrowWidePattern(t)===tt.ASTERISK_ENCODING&&e.isRange(Math.max(0,s-Math.floor((u-s)/2)),s,!1))return[s,u];s+=t[0]+t[1],t.copyWithin(0,2,2+i-1),t[i-1]=0,t[i]=0,i--}else i++;t[i]=1,l=!l}throw new F}static toNarrowWidePattern(e){let t=e.length,n=0,r;do{let i=2147483647;for(let c of e)c<i&&c>n&&(i=c);n=i,r=0;let s=0,l=0;for(let c=0;c<t;c++){let u=e[c];u>n&&(l|=1<<t-1-c,r++,s+=u)}if(r===3){for(let c=0;c<t&&r>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<tt.CHARACTER_ENCODINGS.length;t++)if(tt.CHARACTER_ENCODINGS[t]===e)return tt.ALPHABET_STRING.charAt(t);if(e===tt.ASTERISK_ENCODING)return"*";throw new F}static decodeExtended(e){let t=e.length,n="";for(let r=0;r<t;r++){let i=e.charAt(r);if(i==="+"||i==="$"||i==="%"||i==="/"){let s=e.charAt(r+1),l="\0";switch(i){case"+":if(s>="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);t<n;){Ze.recordPattern(e,t,i);for(let u=0;u<5;u++){let g=2*u;s[u]=i[g],l[u]=i[g+1]}let c=je.decodeDigit(s);r.append(c.toString()),c=this.decodeDigit(l),r.append(c.toString()),i.forEach(function(u){t+=u})}}decodeStart(e){let t=je.skipWhiteSpace(e),n=je.findGuardPattern(e,t,je.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(e,n[0]),n}validateQuietZone(e,t){let n=this.narrowLineWidth*10;n=n<t?n:t;for(let r=t-1;n>0&&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<s;g++)if(e.get(g)!==l)i[c]++;else{if(c===r-1){if(Ze.patternMatchVariance(i,n,je.MAX_INDIVIDUAL_VARIANCE)<je.MAX_AVG_VARIANCE)return[u,g];u+=i[0]+i[1],K.arraycopy(i,2,i,0,c-1),i[c-1]=0,i[c]=0,c--}else c++;i[c]=1,l=!l}throw new F}static decodeDigit(e){let t=je.MAX_AVG_VARIANCE,n=-1,r=je.PATTERNS.length;for(let i=0;i<r;i++){let s=je.PATTERNS[i],l=Ze.patternMatchVariance(e,s,je.MAX_INDIVIDUAL_VARIANCE);l<t?(t=l,n=i):l===t&&(n=-1)}if(n>=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<s;w++)if(e.get(w)!==g)i[l]++;else{if(l===u-1){if(Ze.patternMatchVariance(i,r,_e.MAX_INDIVIDUAL_VARIANCE)<_e.MAX_AVG_VARIANCE)return Int32Array.from([c,w]);c+=i[0]+i[1];let E=i.slice(2,i.length-1);for(let I=0;I<l-1;I++)i[I]=E[I];i[l-1]=0,i[l]=0,l--}else l++;i[l]=1,g=!g}throw new F}static decodeDigit(e,t,n,r){this.recordPattern(e,n,t);let i=this.MAX_AVG_VARIANCE,s=-1,l=r.length;for(let c=0;c<l;c++){let u=r[c],g=Ze.patternMatchVariance(t,u,_e.MAX_INDIVIDUAL_VARIANCE);g<i&&(i=g,s=c)}if(s>=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<i;u++){let g=_e.decodeDigit(e,r,s,_e.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+g%10);for(let w of r)s+=w;g>=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<i;c++){let u=_e.decodeDigit(e,r,s,_e.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+u%10);for(let g of r)s+=g;u>=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.length;r++)n[r]=t[t.length-r-1];Pe.L_AND_G_PATTERNS[e]=n}}decodeRow(e,t,n){let r=Pe.findStartGuardPattern(t),i=n==null?null:n.get(me.NEED_RESULT_POINT_CALLBACK);if(i!=null){const W=new R((r[0]+r[1])/2,e);i.foundPossibleResultPoint(W)}let s=this.decodeMiddle(t,r,this.decodeRowStringBuffer),l=s.rowOffset,c=s.resultString;if(i!=null){const W=new R(l,e);i.foundPossibleResultPoint(W)}let u=Pe.decodeEnd(t,l);if(i!=null){const W=new R((u[0]+u[1])/2,e);i.foundPossibleResultPoint(W)}let g=u[1],w=g+(g-u[0]);if(w>=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<i;u++){let g=Pe.decodeDigit(e,r,s,Pe.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+g%10);for(let w of r)s+=w;g>=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&&s<i;u++){let g=Pe.decodeDigit(e,r,s,Pe.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+g);for(let w of r)s+=w}return{rowOffset:s,resultString:n}}getBarcodeFormat(){return de.EAN_13}static determineFirstDigit(e,t){for(let n=0;n<10;n++)if(t===this.FIRST_DIGIT_ENCODINGS[n])return e=String.fromCharCode("0".charCodeAt(0)+n)+e,e;throw new F}}Pn.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class Bs extends Pe{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(e,t,n){const r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=e.getSize(),s=t[1];for(let c=0;c<4&&s<i;c++){let u=Pe.decodeDigit(e,r,s,Pe.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+u);for(let g of r)s+=g}s=Pe.findGuardPattern(e,s,!0,Pe.MIDDLE_PATTERN,new Int32Array(Pe.MIDDLE_PATTERN.length).fill(0))[1];for(let c=0;c<4&&s<i;c++){let u=Pe.decodeDigit(e,r,s,Pe.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+u);for(let g of r)s+=g}return{rowOffset:s,resultString:n}}getBarcodeFormat(){return de.EAN_8}}class ka extends Pe{constructor(){super(...arguments),this.ean13Reader=new Pn}getBarcodeFormat(){return de.UPC_A}decode(e,t){return this.maybeReturnResult(this.ean13Reader.decode(e))}decodeRow(e,t,n){return this.maybeReturnResult(this.ean13Reader.decodeRow(e,t,n))}decodeMiddle(e,t,n){return this.ean13Reader.decodeMiddle(e,t,n)}maybeReturnResult(e){let t=e.getText();if(t.charAt(0)==="0"){let n=new rt(t.substring(1),null,null,e.getResultPoints(),de.UPC_A);return e.getResultMetadata()!=null&&n.putAllMetadata(e.getResultMetadata()),n}else throw new F}reset(){this.ean13Reader.reset()}}class Qt extends Pe{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(e,t,n){const r=this.decodeMiddleCounters.map(c=>c);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<i;c++){const u=Qt.decodeDigit(e,r,s,Qt.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+u%10);for(let g of r)s+=g;u>=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;n<t.length;n++)if(Ze.patternMatchVariance(e,t[n],yt.MAX_INDIVIDUAL_VARIANCE)<yt.MAX_AVG_VARIANCE)return n;throw new F}static count(e){return H.sum(new Int32Array(e))}static increment(e,t){let n=0,r=t[0];for(let i=1;i<e.length;i++)t[i]>r&&(r=t[i],n=i);e[n]++}static decrement(e,t){let n=0,r=t[0];for(let i=1;i<e.length;i++)t[i]<r&&(r=t[i],n=i);e[n]--}static isFinderPattern(e){let t=e[0]+e[1],n=t+e[2]+e[3],r=t/n;if(r>=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<i&&(i=l);return s<10*i}return!1}}yt.MAX_AVG_VARIANCE=.2,yt.MAX_INDIVIDUAL_VARIANCE=.45,yt.MIN_FINDER_PATTERN_RATIO=9.5/12,yt.MAX_FINDER_PATTERN_RATIO=12.5/14;class er{constructor(e,t){this.value=e,this.checksumPortion=t}getValue(){return this.value}getChecksumPortion(){return this.checksumPortion}toString(){return this.value+"("+this.checksumPortion+")"}equals(e){if(!(e instanceof er))return!1;const t=e;return this.value===t.value&&this.checksumPortion===t.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class zr{constructor(e,t,n,r,i){this.value=e,this.startEnd=t,this.value=e,this.startEnd=t,this.resultPoints=new Array,this.resultPoints.push(new R(n,i)),this.resultPoints.push(new R(r,i))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(e){if(!(e instanceof zr))return!1;const t=e;return this.value===t.value}hashCode(){return this.value}}class rn{constructor(){}static getRSSvalue(e,t,n){let r=0;for(let c of e)r+=c;let i=0,s=0,l=e.length;for(let c=0;c<l-1;c++){let u;for(u=1,s|=1<<c;u<e[c];u++,s&=~(1<<c)){let g=rn.combins(r-u-1,l-c-2);if(n&&s===0&&r-u-(l-c-1)>=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<<c)!=0&&r.set(i),i++;for(let c=1;c<e.length;++c){let u=e[c],g=u.getLeftChar().getValue();for(let w=11;w>=0;--w)(g&1<<w)!=0&&r.set(i),i++;if(u.getRightChar()!=null){let w=u.getRightChar().getValue();for(let E=11;E>=0;--E)(w&1<<E)!=0&&r.set(i),i++}}return r}}class Fn{constructor(e,t){t?this.decodedInformation=null:(this.finished=e,this.decodedInformation=t)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class mi{constructor(e){this.newPosition=e}getNewPosition(){return this.newPosition}}class Rt extends mi{constructor(e,t){super(e),this.value=t}getValue(){return this.value}isFNC1(){return this.value===Rt.FNC1}}Rt.FNC1="$";class kn extends mi{constructor(e,t,n){super(e),n?(this.remaining=!0,this.remainingValue=this.remainingValue):(this.remaining=!1,this.remainingValue=0),this.newString=t}getNewString(){return this.newString}isRemaining(){return this.remaining}getRemainingValue(){return this.remainingValue}}class Vt extends mi{constructor(e,t,n){if(super(e),t<0||t>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.length<e)throw new F;let r=n.substring(0,e);if(n.length<e+t)throw new F;let i=n.substring(e,e+t),s=n.substring(e+t),l="("+r+")"+i,c=ee.parseFieldsInGeneralPurpose(s);return c==null?l:l+c}static processVariableAI(e,t,n){let r=n.substring(0,e),i;n.length<e+t?i=n.length:i=e+t;let s=n.substring(e,i),l=n.substring(i),c="("+r+")"+s,u=ee.parseFieldsInGeneralPurpose(l);return u==null?c:c+u}}ee.VARIABLE_LENGTH=[],ee.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",ee.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",ee.VARIABLE_LENGTH,20],["22",ee.VARIABLE_LENGTH,29],["30",ee.VARIABLE_LENGTH,8],["37",ee.VARIABLE_LENGTH,8],["90",ee.VARIABLE_LENGTH,30],["91",ee.VARIABLE_LENGTH,30],["92",ee.VARIABLE_LENGTH,30],["93",ee.VARIABLE_LENGTH,30],["94",ee.VARIABLE_LENGTH,30],["95",ee.VARIABLE_LENGTH,30],["96",ee.VARIABLE_LENGTH,30],["97",ee.VARIABLE_LENGTH,3],["98",ee.VARIABLE_LENGTH,30],["99",ee.VARIABLE_LENGTH,30]],ee.THREE_DIGIT_DATA_LENGTH=[["240",ee.VARIABLE_LENGTH,30],["241",ee.VARIABLE_LENGTH,30],["242",ee.VARIABLE_LENGTH,6],["250",ee.VARIABLE_LENGTH,30],["251",ee.VARIABLE_LENGTH,30],["253",ee.VARIABLE_LENGTH,17],["254",ee.VARIABLE_LENGTH,20],["400",ee.VARIABLE_LENGTH,30],["401",ee.VARIABLE_LENGTH,30],["402",17],["403",ee.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",ee.VARIABLE_LENGTH,20],["421",ee.VARIABLE_LENGTH,15],["422",3],["423",ee.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],ee.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",ee.VARIABLE_LENGTH,15],["391",ee.VARIABLE_LENGTH,18],["392",ee.VARIABLE_LENGTH,15],["393",ee.VARIABLE_LENGTH,18],["703",ee.VARIABLE_LENGTH,30]],ee.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",ee.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",ee.VARIABLE_LENGTH,20],["8003",ee.VARIABLE_LENGTH,30],["8004",ee.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",ee.VARIABLE_LENGTH,30],["8008",ee.VARIABLE_LENGTH,12],["8018",18],["8020",ee.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",ee.VARIABLE_LENGTH,70],["8200",ee.VARIABLE_LENGTH,70]];class tr{constructor(e){this.buffer=new Ie,this.information=e}decodeAllCodes(e,t){let n=t,r=null;do{let i=this.decodeGeneralPurposeField(n,r),s=ee.parseFieldsInGeneralPurpose(i.getNewString());if(s!=null&&e.append(s),i.isRemaining()?r=""+i.getRemainingValue():r=null,n===i.getNewPosition())break;n=i.getNewPosition()}while(!0);return e.toString()}isStillNumeric(e){if(e+7>this.information.getSize())return e+4<=this.information.getSize();for(let t=e;t<e+3;++t)if(this.information.get(t))return!0;return this.information.get(e+3)}decodeNumeric(e){if(e+7>this.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;i<n;++i)e.get(t+i)&&(r|=1<<n-i-1);return r}decodeGeneralPurposeField(e,t){this.buffer.setLengthToZero(),t!=null&&this.buffer.append(t),this.current.setPosition(e);let n=this.parseBlocks();return n!=null&&n.isRemaining()?new kn(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new kn(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let e,t;do{let n=this.current.getPosition();if(this.current.isAlpha()?(t=this.parseAlphaBlock(),e=t.isFinished()):this.current.isIsoIec646()?(t=this.parseIsoIec646Block(),e=t.isFinished()):(t=this.parseNumericBlock(),e=t.isFinished()),!(n!==this.current.getPosition())&&!e)break}while(!e);return t.getDecodedInformation()}parseNumericBlock(){for(;this.isStillNumeric(this.current.getPosition());){let e=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFirstDigitFNC1()){let t;return e.isSecondDigitFNC1()?t=new kn(this.current.getPosition(),this.buffer.toString()):t=new kn(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new Fn(!0,t)}if(this.buffer.append(e.getFirstDigit()),e.isSecondDigitFNC1()){let t=new kn(this.current.getPosition(),this.buffer.toString());return new Fn(!0,t)}this.buffer.append(e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Fn(!1)}parseIsoIec646Block(){for(;this.isStillIsoIec646(this.current.getPosition());){let e=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){let t=new kn(this.current.getPosition(),this.buffer.toString());return new Fn(!0,t)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new Fn(!1)}parseAlphaBlock(){for(;this.isStillAlpha(this.current.getPosition());){let e=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){let t=new kn(this.current.getPosition(),this.buffer.toString());return new Fn(!0,t)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new Fn(!1)}isStillIsoIec646(e){if(e+5>this.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+e<this.information.getSize();++t)if(t===2){if(!this.information.get(e+2))return!1}else if(this.information.get(e+t))return!1;return!0}isAlphaOr646ToNumericLatch(e){if(e+3>this.information.getSize())return!1;for(let t=e;t<e+3;++t)if(this.information.get(t))return!1;return!0}isNumericToAlphaNumericLatch(e){if(e+1>this.information.getSize())return!1;for(let t=0;t<4&&t+e<this.information.getSize();++t)if(this.information.get(e+t))return!1;return!0}}class vs{constructor(e){this.information=e,this.generalDecoder=new tr(e)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class Lt extends vs{constructor(e){super(e)}encodeCompressedGtin(e,t){e.append("(01)");let n=e.length();e.append("9"),this.encodeCompressedGtinWithoutAI(e,t,n)}encodeCompressedGtinWithoutAI(e,t,n){for(let r=0;r<4;++r){let i=this.getGeneralDecoder().extractNumericValueFromBitArray(t+10*r,10);i/100===0&&e.append("0"),i/10===0&&e.append("0"),e.append(i)}Lt.appendCheckDigit(e,n)}static appendCheckDigit(e,t){let n=0;for(let r=0;r<13;r++){let i=e.charAt(r+t).charCodeAt(0)-"0".charCodeAt(0);n+=(r&1)===0?3*i:i}n=10-n%10,n===10&&(n=0),e.append(n)}}Lt.GTIN_SIZE=40;class nr extends Lt{constructor(e){super(e)}parseInformation(){let e=new Ie;e.append("(01)");let t=e.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(nr.HEADER_SIZE,4);return e.append(n),this.encodeCompressedGtinWithoutAI(e,nr.HEADER_SIZE+4,t),this.getGeneralDecoder().decodeAllCodes(e,nr.HEADER_SIZE+44)}}nr.HEADER_SIZE=1+1+2;class Wr extends vs{constructor(e){super(e)}parseInformation(){let e=new Ie;return this.getGeneralDecoder().decodeAllCodes(e,Wr.HEADER_SIZE)}}Wr.HEADER_SIZE=2+1+2;class Yr extends Lt{constructor(e){super(e)}encodeCompressedWeight(e,t,n){let r=this.getGeneralDecoder().extractNumericValueFromBitArray(t,n);this.addWeightCode(e,r);let i=this.checkWeight(r),s=1e5;for(let l=0;l<5;++l)i/s===0&&e.append("0"),s/=10;e.append(i)}}class sn extends Yr{constructor(e){super(e)}parseInformation(){if(this.getInformation().getSize()!=sn.HEADER_SIZE+Yr.GTIN_SIZE+sn.WEIGHT_SIZE)throw new F;let e=new Ie;return this.encodeCompressedGtin(e,sn.HEADER_SIZE),this.encodeCompressedWeight(e,sn.HEADER_SIZE+Yr.GTIN_SIZE,sn.WEIGHT_SIZE),e.toString()}}sn.HEADER_SIZE=4+1,sn.WEIGHT_SIZE=15;class Ha extends sn{constructor(e){super(e)}addWeightCode(e,t){e.append("(3103)")}checkWeight(e){return e}}class ja extends sn{constructor(e){super(e)}addWeightCode(e,t){t<1e4?e.append("(3202)"):e.append("(3203)")}checkWeight(e){return e<1e4?e:e-1e4}}class on extends Lt{constructor(e){super(e)}parseInformation(){if(this.getInformation().getSize()<on.HEADER_SIZE+Lt.GTIN_SIZE)throw new F;let e=new Ie;this.encodeCompressedGtin(e,on.HEADER_SIZE);let t=this.getGeneralDecoder().extractNumericValueFromBitArray(on.HEADER_SIZE+Lt.GTIN_SIZE,on.LAST_DIGIT_SIZE);e.append("(392"),e.append(t),e.append(")");let n=this.getGeneralDecoder().decodeGeneralPurposeField(on.HEADER_SIZE+Lt.GTIN_SIZE+on.LAST_DIGIT_SIZE,null);return e.append(n.getNewString()),e.toString()}}on.HEADER_SIZE=5+1+2,on.LAST_DIGIT_SIZE=2;class Mt extends Lt{constructor(e){super(e)}parseInformation(){if(this.getInformation().getSize()<Mt.HEADER_SIZE+Lt.GTIN_SIZE)throw new F;let e=new Ie;this.encodeCompressedGtin(e,Mt.HEADER_SIZE);let t=this.getGeneralDecoder().extractNumericValueFromBitArray(Mt.HEADER_SIZE+Lt.GTIN_SIZE,Mt.LAST_DIGIT_SIZE);e.append("(393"),e.append(t),e.append(")");let n=this.getGeneralDecoder().extractNumericValueFromBitArray(Mt.HEADER_SIZE+Lt.GTIN_SIZE+Mt.LAST_DIGIT_SIZE,Mt.FIRST_THREE_DIGITS_SIZE);n/100==0&&e.append("0"),n/10==0&&e.append("0"),e.append(n);let r=this.getGeneralDecoder().decodeGeneralPurposeField(Mt.HEADER_SIZE+Lt.GTIN_SIZE+Mt.LAST_DIGIT_SIZE+Mt.FIRST_THREE_DIGITS_SIZE,null);return e.append(r.getNewString()),e.toString()}}Mt.HEADER_SIZE=5+1+2,Mt.LAST_DIGIT_SIZE=2,Mt.FIRST_THREE_DIGITS_SIZE=10;class it extends Yr{constructor(e,t,n){super(e),this.dateCode=n,this.firstAIdigits=t}parseInformation(){if(this.getInformation().getSize()!=it.HEADER_SIZE+it.GTIN_SIZE+it.WEIGHT_SIZE+it.DATE_SIZE)throw new F;let e=new Ie;return this.encodeCompressedGtin(e,it.HEADER_SIZE),this.encodeCompressedWeight(e,it.HEADER_SIZE+it.GTIN_SIZE,it.WEIGHT_SIZE),this.encodeCompressedDate(e,it.HEADER_SIZE+it.GTIN_SIZE+it.WEIGHT_SIZE),e.toString()}encodeCompressedDate(e,t){let n=this.getGeneralDecoder().extractNumericValueFromBitArray(t,it.DATE_SIZE);if(n==38400)return;e.append("("),e.append(this.dateCode),e.append(")");let r=n%32;n/=32;let i=n%12+1;n/=12;let s=n;s/10==0&&e.append("0"),e.append(s),i/10==0&&e.append("0"),e.append(i),r/10==0&&e.append("0"),e.append(r)}addWeightCode(e,t){e.append("("),e.append(this.firstAIdigits),e.append(t/1e5),e.append(")")}checkWeight(e){return e%1e5}}it.HEADER_SIZE=7+1,it.WEIGHT_SIZE=20,it.DATE_SIZE=16;function Va(A){try{if(A.get(1))return new nr(A);if(!A.get(2))return new Wr(A);switch(tr.extractNumericValueFromBitArray(A,1,4)){case 4:return new Ha(A);case 5:return new ja(A)}switch(tr.extractNumericValueFromBitArray(A,1,5)){case 12:return new on(A);case 13:return new Mt(A)}switch(tr.extractNumericValueFromBitArray(A,1,7)){case 56:return new it(A,"310","11");case 57:return new it(A,"320","11");case 58:return new it(A,"310","13");case 59:return new it(A,"320","13");case 60:return new it(A,"310","15");case 61:return new it(A,"320","15");case 62:return new it(A,"310","17");case 63:return new it(A,"320","17")}}catch(e){throw console.log(e),new _("unknown decoder: "+A)}}class Tn{constructor(e,t,n,r){this.leftchar=e,this.rightchar=t,this.finderpattern=n,this.maybeLast=r}mayBeLast(){return this.maybeLast}getLeftChar(){return this.leftchar}getRightChar(){return this.rightchar}getFinderPattern(){return this.finderpattern}mustBeLast(){return this.rightchar==null}toString(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"}static equals(e,t){return e instanceof Tn?Tn.equalsOrNull(e.leftchar,t.leftchar)&&Tn.equalsOrNull(e.rightchar,t.rightchar)&&Tn.equalsOrNull(e.finderpattern,t.finderpattern):!1}static equalsOrNull(e,t){return e===null?t===null:Tn.equals(e,t)}hashCode(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()}}class Ii{constructor(e,t,n){this.pairs=e,this.rowNumber=t,this.wasReversed=n}getPairs(){return this.pairs}getRowNumber(){return this.rowNumber}isReversed(){return this.wasReversed}isEquivalent(e){return this.checkEqualitity(this,e)}toString(){return"{ "+this.pairs+" }"}equals(e,t){return e instanceof Ii?this.checkEqualitity(e,t)&&e.wasReversed===t.wasReversed:!1}checkEqualitity(e,t){if(!e||!t)return;let n;return e.forEach((r,i)=>{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;n<this.rows.length;n++){let r=this.rows[n];this.pairs.length=0;for(let s of e)this.pairs.push(s.getPairs());if(this.pairs.push(r.getPairs()),!z.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let i=new Array(e);i.push(r);try{return this.checkRows(i,n+1)}catch(s){this.verbose&&console.log(s)}}throw new F}static isValidSequence(e){for(let t of z.FINDER_PATTERN_SEQUENCES){if(e.length>t.length)continue;let n=!0;for(let r=0;r<e.length;r++)if(e[r].getFinderPattern().getValue()!=t[r]){n=!1;break}if(n)return!0}return!1}storeRow(e,t){let n=0,r=!1,i=!1;for(;n<this.rows.length;){let s=this.rows[n];if(s.getRowNumber()>e){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<this.pairs.size();++l){let c=this.pairs.get(l);r+=c.getLeftChar().getChecksumPortion(),i++;let u=c.getRightChar();u!=null&&(r+=u.getChecksumPortion(),i++)}return r%=211,211*(i-4)+r==t.getValue()}static getNextSecondBar(e,t){let n;return e.get(t)?(n=e.getNextUnset(t),n=e.getNextSet(n)):(n=e.getNextSet(t),n=e.getNextUnset(n)),n}retrieveNextPair(e,t,n){let r=t.length%2==0;this.startFromEven&&(r=!r);let i,s=!0,l=-1;do this.findNextPair(e,t,l),i=this.parseFoundFinderPattern(e,n,r),i==null?l=z.getNextSecondBar(e,this.startEnd[0]):s=!1;while(s);let c=this.decodeDataCharacter(e,i,r,!0);if(!this.isEmptyPair(t)&&t[t.length-1].mustBeLast())throw new F;let u;try{u=this.decodeDataCharacter(e,i,r,!1)}catch(g){u=null,this.verbose&&console.log(g)}return new Tn(c,u,i,!0)}isEmptyPair(e){return e.length===0}findNextPair(e,t,n){let r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=e.getSize(),s;n>=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<i&&(c=!e.get(s),!!c);)s++;let u=0,g=s;for(let w=s;w<i;w++)if(e.get(w)!=c)r[u]++;else{if(u==3){if(l&&z.reverseCounters(r),z.isFinderPattern(r)){this.startEnd[0]=g,this.startEnd[1]=w;return}l&&z.reverseCounters(r),g+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,u--}else u++;r[u]=1,c=!c}throw new F}static reverseCounters(e){let t=e.length;for(let n=0;n<t/2;++n){let r=e[n];e[n]=e[t-n-1],e[t-n-1]=r}}parseFoundFinderPattern(e,t,n){let r,i,s;if(n){let u=this.startEnd[0]-1;for(;u>=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<i.length;Qe++)i[Qe]=0;if(r)z.recordPatternInReverse(e,t.getStartEnd()[0],i);else{z.recordPattern(e,t.getStartEnd()[1],i);for(let Qe=0,Ct=i.length-1;Qe<Ct;Qe++,Ct--){let Ut=i[Qe];i[Qe]=i[Ct],i[Ct]=Ut}}let s=17,l=H.sum(new Int32Array(i))/s,c=(t.getStartEnd()[1]-t.getStartEnd()[0])/15;if(Math.abs(l-c)/c>.3)throw new F;let u=this.getOddCounts(),g=this.getEvenCounts(),w=this.getOddRoundingErrors(),E=this.getEvenRoundingErrors();for(let Qe=0;Qe<i.length;Qe++){let Ct=1*i[Qe]/l,Ut=Ct+.5;if(Ut<1){if(Ct<.3)throw new F;Ut=1}else if(Ut>8){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;t<n?(r=!0,l=!0):(i=!0,s=!0)}else if(g)throw new F}else throw new F;if(r){if(i)throw new F;z.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&z.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(l)throw new F;z.increment(this.getEvenCounts(),this.getOddRoundingErrors())}l&&z.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}z.SYMBOL_WIDEST=[7,5,4,3,1],z.EVEN_TOTAL_SUBSET=[4,20,52,104,204],z.GSUM=[0,348,1388,2948,3988],z.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],z.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],z.FINDER_PAT_A=0,z.FINDER_PAT_B=1,z.FINDER_PAT_C=2,z.FINDER_PAT_D=3,z.FINDER_PAT_E=4,z.FINDER_PAT_F=5,z.FINDER_PATTERN_SEQUENCES=[[z.FINDER_PAT_A,z.FINDER_PAT_A],[z.FINDER_PAT_A,z.FINDER_PAT_B,z.FINDER_PAT_B],[z.FINDER_PAT_A,z.FINDER_PAT_C,z.FINDER_PAT_B,z.FINDER_PAT_D],[z.FINDER_PAT_A,z.FINDER_PAT_E,z.FINDER_PAT_B,z.FINDER_PAT_D,z.FINDER_PAT_C],[z.FINDER_PAT_A,z.FINDER_PAT_E,z.FINDER_PAT_B,z.FINDER_PAT_D,z.FINDER_PAT_D,z.FINDER_PAT_F],[z.FINDER_PAT_A,z.FINDER_PAT_E,z.FINDER_PAT_B,z.FINDER_PAT_D,z.FINDER_PAT_E,z.FINDER_PAT_F,z.FINDER_PAT_F],[z.FINDER_PAT_A,z.FINDER_PAT_A,z.FINDER_PAT_B,z.FINDER_PAT_B,z.FINDER_PAT_C,z.FINDER_PAT_C,z.FINDER_PAT_D,z.FINDER_PAT_D],[z.FINDER_PAT_A,z.FINDER_PAT_A,z.FINDER_PAT_B,z.FINDER_PAT_B,z.FINDER_PAT_C,z.FINDER_PAT_C,z.FINDER_PAT_D,z.FINDER_PAT_E,z.FINDER_PAT_E],[z.FINDER_PAT_A,z.FINDER_PAT_A,z.FINDER_PAT_B,z.FINDER_PAT_B,z.FINDER_PAT_C,z.FINDER_PAT_C,z.FINDER_PAT_D,z.FINDER_PAT_E,z.FINDER_PAT_F,z.FINDER_PAT_F],[z.FINDER_PAT_A,z.FINDER_PAT_A,z.FINDER_PAT_B,z.FINDER_PAT_B,z.FINDER_PAT_C,z.FINDER_PAT_D,z.FINDER_PAT_D,z.FINDER_PAT_E,z.FINDER_PAT_E,z.FINDER_PAT_F,z.FINDER_PAT_F]],z.MAX_PAIRS=11;class za extends er{constructor(e,t,n){super(e,t),this.count=0,this.finderPattern=n}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class at extends yt{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(e,t,n){const r=this.decodePair(t,!1,e,n);at.addOrTally(this.possibleLeftPairs,r),t.reverse();let i=this.decodePair(t,!0,e,n);at.addOrTally(this.possibleRightPairs,i),t.reverse();for(let s of this.possibleLeftPairs)if(s.getCount()>1){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;O<r.length;O++)r[O]=0;if(n)Ze.recordPatternInReverse(e,t.getStartEnd()[0],r);else{Ze.recordPattern(e,t.getStartEnd()[1]+1,r);for(let O=0,B=r.length-1;O<B;O++,B--){let X=r[O];r[O]=r[B],r[B]=X}}let i=n?16:15,s=H.sum(new Int32Array(r))/i,l=this.getOddCounts(),c=this.getEvenCounts(),u=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors();for(let O=0;O<r.length;O++){let B=r[O]/s,X=Math.floor(B+.5);X<1?X=1:X>8&&(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<r&&(i=!e.get(s),t!==i);)s++;let l=0,c=s;for(let u=s;u<r;u++)if(e.get(u)!==i)n[l]++;else{if(l===3){if(yt.isFinderPattern(n))return[c,u];c+=n[0]+n[1],n[0]=n[2],n[1]=n[3],n[2]=0,n[3]=0,l--}else l++;n[l]=1,i=!i}throw new F}parseFoundFinderPattern(e,t,n,r){let i=e.get(r[0]),s=r[0]-1;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;n<r?(i=!0,c=!0):(s=!0,l=!0)}else if(w)throw new F}else throw new F;if(i){if(s)throw new F;yt.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(s&&yt.decrement(this.getOddCounts(),this.getOddRoundingErrors()),l){if(c)throw new F;yt.increment(this.getEvenCounts(),this.getOddRoundingErrors())}c&&yt.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}at.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],at.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],at.OUTSIDE_GSUM=[0,161,961,2015,2715],at.INSIDE_GSUM=[0,336,1036,1516],at.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],at.INSIDE_ODD_WIDEST=[2,4,6,8],at.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])];class rr extends Ze{constructor(e,t){super(),this.readers=[],this.verbose=t===!0;const n=e?e.get(me.POSSIBLE_FORMATS):null,r=e&&e.get(me.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;n&&((n.includes(de.EAN_13)||n.includes(de.UPC_A)||n.includes(de.EAN_8)||n.includes(de.UPC_E))&&this.readers.push(new Ci(e)),n.includes(de.CODE_39)&&this.readers.push(new tt(r)),n.includes(de.CODE_128)&&this.readers.push(new q),n.includes(de.ITF)&&this.readers.push(new je),n.includes(de.RSS_14)&&this.readers.push(new at),n.includes(de.RSS_EXPANDED)&&this.readers.push(new z(this.verbose))),this.readers.length===0&&(this.readers.push(new Ci(e)),this.readers.push(new tt),this.readers.push(new Ci(e)),this.readers.push(new q),this.readers.push(new je),this.readers.push(new at),this.readers.push(new z(this.verbose)))}decodeRow(e,t,n){for(let r=0;r<this.readers.length;r++)try{return this.readers[r].decodeRow(e,t,n)}catch{}throw new F}reset(){this.readers.forEach(e=>e.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<i&&r>=0&&!this.readMappingMatrix.get(r,n)&&(e[t++]=this.readUtah(n,r,i,s)&255),n-=2,r+=2;while(n>=0&&r<s);n+=1,r+=3;do n>=0&&r<s&&!this.readMappingMatrix.get(r,n)&&(e[t++]=this.readUtah(n,r,i,s)&255),n+=2,r-=2;while(n<i&&r>=0);n+=3,r+=1}while(n<i||r<s);if(t!==this.version.getTotalCodewords())throw new G;return e}readModule(e,t,n,r){return e<0&&(e+=n,t+=4-(n+4&7)),t<0&&(t+=r,e+=4-(r+4&7)),this.readMappingMatrix.set(t,e),this.mappingBitMatrix.get(t,e)}readUtah(e,t,n,r){let i=0;return this.readModule(e-2,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e-2,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t,n,r)&&(i|=1),i<<=1,this.readModule(e,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e,t,n,r)&&(i|=1),i}readCorner1(e,t){let n=0;return this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,1,e,t)&&(n|=1),n<<=1,this.readModule(e-1,2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(2,t-1,e,t)&&(n|=1),n<<=1,this.readModule(3,t-1,e,t)&&(n|=1),n}readCorner2(e,t){let n=0;return this.readModule(e-3,0,e,t)&&(n|=1),n<<=1,this.readModule(e-2,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(0,t-4,e,t)&&(n|=1),n<<=1,this.readModule(0,t-3,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n}readCorner3(e,t){let n=0;return this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(0,t-3,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-3,e,t)&&(n|=1),n<<=1,this.readModule(1,t-2,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n}readCorner4(e,t){let n=0;return this.readModule(e-3,0,e,t)&&(n|=1),n<<=1,this.readModule(e-2,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(2,t-1,e,t)&&(n|=1),n<<=1,this.readModule(3,t-1,e,t)&&(n|=1),n}extractDataRegion(e){const t=this.version.getSymbolSizeRows(),n=this.version.getSymbolSizeColumns();if(e.getHeight()!==t)throw new M("Dimension of bitMatrix must match the version size");const r=this.version.getDataRegionSizeRows(),i=this.version.getDataRegionSizeColumns(),s=t/r|0,l=n/i|0,c=s*r,u=l*i,g=new et(u,c);for(let w=0;w<s;++w){const E=w*r;for(let I=0;I<l;++I){const y=I*i;for(let N=0;N<r;++N){const O=w*(r+2)+1+N,B=E+N;for(let X=0;X<i;++X){const Z=I*(i+2)+1+X;if(e.get(Z,O)){const W=y+X;g.set(W,B)}}}}}return g}}class Si{constructor(e,t){this.numDataCodewords=e,this.codewords=t}static getDataBlocks(e,t){const n=t.getECBlocks();let r=0;const i=n.getECBlocks();for(let N of i)r+=N.getCount();const s=new Array(r);let l=0;for(let N of i)for(let O=0;O<N.getCount();O++){const B=N.getDataCodewords(),X=n.getECCodewords()+B;s[l++]=new Si(B,new Uint8Array(X))}const u=s[0].codewords.length-n.getECCodewords(),g=u-1;let w=0;for(let N=0;N<g;N++)for(let O=0;O<l;O++)s[O].codewords[N]=e[w++];const E=t.getVersionNumber()===24,I=E?8:l;for(let N=0;N<I;N++)s[N].codewords[u-1]=e[w++];const y=s[0].codewords.length;for(let N=u;N<y;N++)for(let O=0;O<l;O++){const B=E?(O+8)%l:O,X=E&&B>7?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<s?e:s,c=s-l,u=255>>8-l<<c;t=(i[r]&u)>>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;t=t<<e|(i[r]&l)>>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(c<this.C40_BASIC_SET_CHARS.length){const u=this.C40_BASIC_SET_CHARS[c];n?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):t.append(u)}else throw new G;break;case 1:n?(t.append(String.fromCharCode(c+128)),n=!1):t.append(String.fromCharCode(c)),i=0;break;case 2:if(c<this.C40_SHIFT2_SET_CHARS.length){const u=this.C40_SHIFT2_SET_CHARS[c];n?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):t.append(u)}else switch(c){case 27:t.append(String.fromCharCode(29));break;case 30:n=!0;break;default:throw new G}i=0;break;case 3:n?(t.append(String.fromCharCode(c+224)),n=!1):t.append(String.fromCharCode(c+96)),i=0;break;default:throw new G}}}while(e.available()>0)}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(c<this.TEXT_BASIC_SET_CHARS.length){const u=this.TEXT_BASIC_SET_CHARS[c];n?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):t.append(u)}else throw new G;break;case 1:n?(t.append(String.fromCharCode(c+128)),n=!1):t.append(String.fromCharCode(c)),i=0;break;case 2:if(c<this.TEXT_SHIFT2_SET_CHARS.length){const u=this.TEXT_SHIFT2_SET_CHARS[c];n?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):t.append(u)}else switch(c){case 27:t.append(String.fromCharCode(29));break;case 30:n=!0;break;default:throw new G}i=0;break;case 3:if(c<this.TEXT_SHIFT3_SET_CHARS.length){const u=this.TEXT_SHIFT3_SET_CHARS[c];n?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):t.append(u),i=0}else throw new G;break;default:throw new G}}}while(e.available()>0)}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<s;c++){if(e.available()<8)throw new G;l[c]=this.unrandomize255State(e.readBits(8),r++)}n.push(l);try{t.append(ze.decode(l,le.ISO88591))}catch(c){throw new _("Platform does not support required encoding: "+c.message)}}static unrandomize255State(e,t){const n=149*t%255+1,r=e-n;return r>=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;u<c;u++){const g=i[u],w=g.getCodewords(),E=g.getNumDataCodewords();this.correctErrors(w,E);for(let I=0;I<E;I++)l[I*c+u]=w[I]}return Sn.decode(l)}correctErrors(e,t){const n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch{throw new U}for(let r=0;r<t;r++)e[r]=n[r]}}class ht{constructor(e){this.image=e,this.rectangleDetector=new oe(this.image)}detect(){const e=this.rectangleDetector.detect();let t=this.detectSolid1(e);if(t=this.detectSolid2(t),t[3]=this.correctTopRight(t),!t[3])throw new F;t=this.shiftToModuleCenter(t);const n=t[0],r=t[1],i=t[2],s=t[3];let l=this.transitionsBetween(n,s)+1,c=this.transitionsBetween(i,s)+1;(l&1)===1&&(l+=1),(c&1)===1&&(c+=1),4*l<7*c&&4*c<7*l&&(l=c=Math.max(l,c));let u=ht.sampleGrid(this.image,n,r,i,s,l,c);return new Q(u,[n,r,i,s])}static shiftPoint(e,t,n){let r=(t.getX()-e.getX())/(n+1),i=(t.getY()-e.getY())/(n+1);return new R(e.getX()+r,e.getY()+i)}static moveAway(e,t,n){let r=e.getX(),i=e.getY();return r<t?r-=1:r+=1,i<n?i-=1:i+=1,new R(r,i)}detectSolid1(e){let t=e[0],n=e[1],r=e[3],i=e[2],s=this.transitionsBetween(t,n),l=this.transitionsBetween(n,r),c=this.transitionsBetween(r,i),u=this.transitionsBetween(i,t),g=s,w=[i,t,n,r];return g>l&&(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 u<g?(e[0]=t,e[1]=n,e[2]=r,e[3]=i):(e[0]=n,e[1]=r,e[2]=i,e[3]=t),e}correctTopRight(e){let t=e[0],n=e[1],r=e[2],i=e[3],s=this.transitionsBetween(t,i),l=this.transitionsBetween(n,i),c=ht.shiftPoint(t,n,(l+1)*4),u=ht.shiftPoint(r,n,(s+1)*4);s=this.transitionsBetween(c,i),l=this.transitionsBetween(u,i);let g=new R(i.getX()+(r.getX()-n.getX())/(s+1),i.getY()+(r.getY()-n.getY())/(s+1)),w=new R(i.getX()+(t.getX()-n.getX())/(l+1),i.getY()+(t.getY()-n.getY())/(l+1));if(!this.isValid(g))return this.isValid(w)?w:null;if(!this.isValid(w))return g;let E=this.transitionsBetween(c,g)+this.transitionsBetween(u,g),I=this.transitionsBetween(c,w)+this.transitionsBetween(u,w);return E>I?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()<this.image.getWidth()&&e.getY()>0&&e.getY()<this.image.getHeight()}static sampleGrid(e,t,n,r,i,s,l){return pe.getInstance().sampleGrid(e,s,l,.5,.5,s-.5,.5,s-.5,l-.5,.5,l-.5,t.getX(),t.getY(),i.getX(),i.getY(),r.getX(),r.getY(),n.getX(),n.getY())}transitionsBetween(e,t){let n=Math.trunc(e.getX()),r=Math.trunc(e.getY()),i=Math.trunc(t.getX()),s=Math.trunc(t.getY()),l=Math.abs(s-r)>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=r<s?1:-1,E=n<i?1:-1,I=0,y=this.image.get(l?r:n,l?n:r);for(let N=n,O=r;N!==i;N+=E){let B=this.image.get(l?O:N,l?N:O);if(B!==y&&(I++,y=B),g+=u,g>0){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<g;I++){const y=i+I*r;for(let N=0;N<u;N++)e.get(l+N*r,y)&&E.set(N,I)}return E}static moduleSize(e,t){const n=t.getWidth();let r=e[0];const i=e[1];for(;r<n&&t.get(r,i);)r++;if(r===n)throw new F;const s=r-e[0];if(s===0)throw new F;return s}}bn.NO_POINTS=[];class Ga extends Dt{constructor(e=500){super(new bn,e)}}var ir;(function(A){A[A.L=0]="L",A[A.M=1]="M",A[A.Q=2]="Q",A[A.H=3]="H"})(ir||(ir={}));class qe{constructor(e,t,n){this.value=e,this.stringValue=t,this.bits=n,qe.FOR_BITS.set(n,this),qe.FOR_VALUE.set(e,this)}getValue(){return this.value}getBits(){return this.bits}static fromString(e){switch(e){case"L":return qe.L;case"M":return qe.M;case"Q":return qe.Q;case"H":return qe.H;default:throw new S(e+"not available")}}toString(){return this.stringValue}equals(e){if(!(e instanceof qe))return!1;const t=e;return this.value===t.value}static forBits(e){if(e<0||e>=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);l<n&&(r=i[1],n=l),e!==t&&(l=Nt.numBitsDiffering(t,s),l<n&&(r=i[1],n=l))}return n<=3?new Nt(r):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(e){if(!(e instanceof Nt))return!1;const t=e;return this.errorCorrectionLevel===t.errorCorrectionLevel&&this.dataMask===t.dataMask}}Nt.FORMAT_INFO_MASK_QR=21522,Nt.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])];class D{constructor(e,...t){this.ecCodewordsPerBlock=e,this.ecBlocks=t}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let e=0;const t=this.ecBlocks;for(const n of t)e+=n.getCount();return e}getTotalECCodewords(){return this.ecCodewordsPerBlock*this.getNumBlocks()}getECBlocks(){return this.ecBlocks}}class C{constructor(e,t){this.count=e,this.dataCodewords=t}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class ce{constructor(e,t,...n){this.versionNumber=e,this.alignmentPatternCenters=t,this.ecBlocks=n;let r=0;const i=n[0].getECCodewordsPerBlock(),s=n[0].getECBlocks();for(const l of s)r+=l.getCount()*(l.getDataCodewords()+i);this.totalCodewords=r}getVersionNumber(){return this.versionNumber}getAlignmentPatternCenters(){return this.alignmentPatternCenters}getTotalCodewords(){return this.totalCodewords}getDimensionForVersion(){return 17+4*this.versionNumber}getECBlocksForLevel(e){return this.ecBlocks[e.getValue()]}static getProvisionalVersionForDimension(e){if(e%4!==1)throw new G;try{return this.getVersionForNumber((e-17)/4)}catch{throw new G}}static getVersionForNumber(e){if(e<1||e>40)throw new M;return ce.VERSIONS[e-1]}static decodeVersionInformation(e){let t=Number.MAX_SAFE_INTEGER,n=0;for(let r=0;r<ce.VERSION_DECODE_INFO.length;r++){const i=ce.VERSION_DECODE_INFO[r];if(i===e)return ce.getVersionForNumber(r+7);const s=Nt.numBitsDiffering(e,i);s<t&&(n=r+7,t=s)}return t<=3?ce.getVersionForNumber(n):null}buildFunctionPattern(){const e=this.getDimensionForVersion(),t=new et(e);t.setRegion(0,0,9,9),t.setRegion(e-8,0,8,9),t.setRegion(0,e-8,9,8);const n=this.alignmentPatternCenters.length;for(let r=0;r<n;r++){const i=this.alignmentPatternCenters[r]-2;for(let s=0;s<n;s++)r===0&&(s===0||s===n-1)||r===n-1&&s===0||t.setRegion(this.alignmentPatternCenters[s]-2,i,5,5)}return t.setRegion(6,9,1,e-17),t.setRegion(9,6,e-17,1),this.versionNumber>6&&(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<t;n++)for(let r=0;r<t;r++)this.isMasked(n,r)&&e.flip(r,n)}}zt.values=new Map([[At.DATA_MASK_000,new zt(At.DATA_MASK_000,(A,e)=>(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<t;i++)n=this.copyBit(i,8,n);if(this.parsedFormatInfo=Nt.decodeFormatInformation(e,n),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new G}readVersion(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;const e=this.bitMatrix.getHeight(),t=Math.floor((e-17)/4);if(t<=6)return ce.getVersionForNumber(t);let n=0;const r=e-11;for(let s=5;s>=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<r;E++){const I=s?r-1-E:E;for(let y=0;y<2;y++)i.get(w-y,I)||(g++,u<<=1,this.bitMatrix.get(w-y,I)&&(u|=1),g===8&&(l[c++]=u,g=0,u=0))}s=!s}if(c!==t.getTotalCodewords())throw new G;return l}remask(){if(this.parsedFormatInfo===null)return;const e=zt.values[this.parsedFormatInfo.getDataMask()],t=this.bitMatrix.getHeight();e.unmaskBitMatrix(this.bitMatrix,t)}setMirror(e){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=e}mirror(){const e=this.bitMatrix;for(let t=0,n=e.getWidth();t<n;t++)for(let r=t+1,i=e.getHeight();r<i;r++)e.get(t,r)!==e.get(r,t)&&(e.flip(r,t),e.flip(t,r))}}class yi{constructor(e,t){this.numDataCodewords=e,this.codewords=t}static getDataBlocks(e,t,n){if(e.length!==t.getTotalCodewords())throw new M;const r=t.getECBlocksForLevel(n);let i=0;const s=r.getECBlocks();for(const y of s)i+=y.getCount();const l=new Array(i);let c=0;for(const y of s)for(let N=0;N<y.getCount();N++){const O=y.getDataCodewords(),B=r.getECCodewordsPerBlock()+O;l[c++]=new yi(O,new Uint8Array(B))}const u=l[0].codewords.length;let g=l.length-1;for(;g>=0&&l[g].codewords.length!==u;)g--;g++;const w=u-r.getECCodewordsPerBlock();let E=0;for(let y=0;y<w;y++)for(let N=0;N<c;N++)l[N].codewords[y]=e[E++];for(let y=g;y<c;y++)l[y].codewords[w]=e[E++];const I=l[0].codewords.length;for(let y=w;y<I;y++)for(let N=0;N<c;N++){const O=N<g?y:y+1;l[N].codewords[O]=e[E++]}return l}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}var Wt;(function(A){A[A.TERMINATOR=0]="TERMINATOR",A[A.NUMERIC=1]="NUMERIC",A[A.ALPHANUMERIC=2]="ALPHANUMERIC",A[A.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",A[A.BYTE=4]="BYTE",A[A.ECI=5]="ECI",A[A.KANJI=6]="KANJI",A[A.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",A[A.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",A[A.HANZI=9]="HANZI"})(Wt||(Wt={}));class ge{constructor(e,t,n,r){this.value=e,this.stringValue=t,this.characterCountBitsForVersions=n,this.bits=r,ge.FOR_BITS.set(r,this),ge.FOR_VALUE.set(e,this)}static forBits(e){const t=ge.FOR_BITS.get(e);if(t===void 0)throw new M;return t}getCharacterCountBits(e){const t=e.getVersionNumber();let n;return t<=9?n=0:t<=26?n=1:n=2,this.characterCountBitsForVersions[n]}getValue(){return this.value}getBits(){return this.bits}equals(e){if(!(e instanceof ge))return!1;const t=e;return this.value===t.value}toString(){return this.stringValue}}ge.FOR_BITS=new Map,ge.FOR_VALUE=new Map,ge.TERMINATOR=new ge(Wt.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),ge.NUMERIC=new ge(Wt.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),ge.ALPHANUMERIC=new ge(Wt.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),ge.STRUCTURED_APPEND=new ge(Wt.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),ge.BYTE=new ge(Wt.BYTE,"BYTE",Int32Array.from([8,16,16]),4),ge.ECI=new ge(Wt.ECI,"ECI",Int32Array.from([0,0,0]),7),ge.KANJI=new ge(Wt.KANJI,"KANJI",Int32Array.from([8,10,12]),8),ge.FNC1_FIRST_POSITION=new ge(Wt.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),ge.FNC1_SECOND_POSITION=new ge(Wt.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),ge.HANZI=new ge(Wt.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class st{static decode(e,t,n,r){const i=new bi(e);let s=new Ie;const l=new Array;let c=-1,u=-1;try{let g=null,w=!1,E;do{if(i.available()<4)E=ge.TERMINATOR;else{const I=i.readBits(4);E=ge.forBits(I)}switch(E){case ge.TERMINATOR:break;case ge.FNC1_FIRST_POSITION:case ge.FNC1_SECOND_POSITION:w=!0;break;case ge.STRUCTURED_APPEND:if(i.available()<16)throw new G;c=i.readBits(8),u=i.readBits(8);break;case ge.ECI:const I=st.parseECIValue(i);if(g=V.getCharacterSetECIByValue(I),g===null)throw new G;break;case ge.HANZI:const y=i.readBits(4),N=i.readBits(E.getCharacterCountBits(t));y===st.GB2312_SUBSET&&st.decodeHanziSegment(i,s,N);break;default:const O=i.readBits(E.getCharacterCountBits(t));switch(E){case ge.NUMERIC:st.decodeNumericSegment(i,s,O);break;case ge.ALPHANUMERIC:st.decodeAlphanumericSegment(i,s,O,w);break;case ge.BYTE:st.decodeByteSegment(i,s,O,g,l,r);break;case ge.KANJI:st.decodeKanjiSegment(i,s,O);break;default:throw new G}break}}while(E!==ge.TERMINATOR)}catch{throw new G}return new nn(e,s.toString(),l.length===0?null:l,n===null?null:n.toString(),c,u)}static decodeHanziSegment(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/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<n;u++)l[u]=e.readBits(8);let c;r===null?c=le.guessEncoding(l,s):c=r.getName();try{t.append(ze.decode(l,c))}catch(u){throw new G(u)}i.push(l)}static toAlphaNumericChar(e){if(e>=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<t.length();s++)t.charAt(s)==="%"&&(s<t.length()-1&&t.charAt(s+1)==="%"?t.deleteCharAt(s+1):t.setCharAt(s,String.fromCharCode(29)))}static decodeNumericSegment(e,t,n){for(;n>=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<E;I++)c[u++]=w[I]}return st.decode(c,n,r,t)}correctErrors(e,t){const n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch{throw new U}for(let r=0;r<t;r++)e[r]=n[r]}}class Ni extends R{constructor(e,t,n){super(e,t),this.estimatedModuleSize=n}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.getX()+t)/2,i=(this.getY()+e)/2,s=(this.estimatedModuleSize+n)/2;return new Ni(r,i,s)}}class Gr{constructor(e,t,n,r,i,s,l){this.image=e,this.startX=t,this.startY=n,this.width=r,this.height=i,this.moduleSize=s,this.resultPointCallback=l,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const e=this.startX,t=this.height,n=this.width,r=e+n,i=this.startY+t/2,s=new Int32Array(3),l=this.image;for(let c=0;c<t;c++){const u=i+((c&1)===0?Math.floor((c+1)/2):-Math.floor((c+1)/2));s[0]=0,s[1]=0,s[2]=0;let g=e;for(;g<r&&!l.get(g,u);)g++;let w=0;for(;g<r;){if(l.get(g,u))if(w===1)s[1]++;else if(w===2){if(this.foundPatternCross(s)){const E=this.handlePossibleCenter(s,u,g);if(E!==null)return E}s[0]=s[2],s[1]=1,s[2]=0,w=1}else s[++w]++;else w===1&&w++,s[w]++;g++}if(this.foundPatternCross(s)){const E=this.handlePossibleCenter(s,u,r);if(E!==null)return E}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new F}static centerFromEnd(e,t){return t-e[2]-e[1]/2}foundPatternCross(e){const t=this.moduleSize,n=t/2;for(let r=0;r<3;r++)if(Math.abs(t-e[r])>=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;c<s&&i.get(t,c)&&l[1]<=n;)l[1]++,c++;if(c===s||l[1]>n)return NaN;for(;c<s&&!i.get(t,c)&&l[2]<=n;)l[2]++,c++;if(l[2]>n)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));(l<wt.MIN_SKIP||t)&&(l=wt.MIN_SKIP);let c=!1;const u=new Int32Array(5);for(let w=l-1;w<i&&!c;w+=l){u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0;let E=0;for(let I=0;I<s;I++)if(r.get(I,w))(E&1)===1&&E++,u[E]++;else if((E&1)===0)if(E===4)if(wt.foundPatternCross(u)){if(this.handlePossibleCenter(u,w,I,n)===!0)if(l=2,this.hasSkipped===!0)c=this.haveMultiplyConfirmedCenters();else{const N=this.findRowSkip();N>u[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])<r&&Math.abs(n-e[1])<r&&Math.abs(3*n-e[2])<3*r&&Math.abs(n-e[3])<r&&Math.abs(n-e[4])<r}getCrossCheckStateCount(){const e=this.crossCheckStateCount;return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e}crossCheckDiagonal(e,t,n,r){const i=this.getCrossCheckStateCount();let s=0;const l=this.image;for(;e>=s&&t>=s&&l.get(t-s,e-s);)i[2]++,s++;if(e<s||t<s)return!1;for(;e>=s&&t>=s&&!l.get(t-s,e-s)&&i[1]<=n;)i[1]++,s++;if(e<s||t<s||i[1]>n)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&&l.get(t+s,e+s);)i[2]++,s++;if(e+s>=c||t+s>=u)return!1;for(;e+s<c&&t+s<u&&!l.get(t+s,e+s)&&i[3]<n;)i[3]++,s++;if(e+s>=c||t+s>=u||i[3]>=n)return!1;for(;e+s<c&&t+s<u&&l.get(t+s,e+s)&&i[4]<n;)i[4]++,s++;if(i[4]>=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<s&&i.get(t,c);)l[2]++,c++;if(c===s)return NaN;for(;c<s&&!i.get(t,c)&&l[3]<n;)l[3]++,c++;if(c===s||l[3]>=n)return NaN;for(;c<s&&i.get(t,c)&&l[4]<n;)l[4]++,c++;if(l[4]>=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<s&&i.get(c,t);)l[2]++,c++;if(c===s)return NaN;for(;c<s&&!i.get(c,t)&&l[3]<n;)l[3]++,c++;if(c===s||l[3]>=n)return NaN;for(;c<s&&i.get(c,t)&&l[4]<n;)l[4]++,c++;if(l[4]>=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<E;w++){const I=g[w];if(I.aboutEquals(c,l,s)){g[w]=I.combineEstimate(l,s,c),u=!0;break}}if(!u){const w=new _i(s,l,c);g.push(w),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(w)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let t=null;for(const n of this.possibleCenters)if(n.getCount()>=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 g<w?-1:g>w?1:0});const l=Math.max(.2*n,s);for(let c=0;c<t.length&&t.length>3;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 l<c?1:l>c?-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=e<n?1:-1,g=t<r?1:-1;let w=0;const E=n+u;for(let I=e,y=t;I!==E;I+=u){const N=i?y:I,O=i?I:y;if(w===1===this.image.get(N,O)){if(w===2)return H.distance(I,y,e,t);w++}if(c+=l,c>0){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<e*3)throw new F("Alignment top exceeds estimated module size.");const c=Math.max(0,n-i),u=Math.min(this.image.getHeight()-1,n+i);if(u-c<e*3)throw new F("Alignment bottom exceeds estimated module size.");return new Gr(this.image,s,c,l-s,u-c,e,this.resultPointCallback).find()}}class yn{constructor(){this.decoder=new Za}getDecoder(){return this.decoder}decode(e,t){let n,r;if(t!=null&&t.get(me.PURE_BARCODE)!==void 0){const c=yn.extractPureBits(e.getBlackMatrix());n=this.decoder.decodeBitMatrix(c,t),r=yn.NO_POINTS}else{const c=new Ir(e.getBlackMatrix()).detect(t);n=this.decoder.decodeBitMatrix(c.getBits(),t),r=c.getPoints()}n.getOther()instanceof Ps&&n.getOther().applyMirroredCorrection(r);const i=new rt(n.getText(),n.getRawBytes(),void 0,r,de.QR_CODE,void 0),s=n.getByteSegments();s!==null&&i.putMetadata(Ye.BYTE_SEGMENTS,s);const l=n.getECLevel();return l!==null&&i.putMetadata(Ye.ERROR_CORRECTION_LEVEL,l),n.hasStructuredAppend()&&(i.putMetadata(Ye.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),i.putMetadata(Ye.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),i}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],s=n[1],l=t[0],c=n[0];if(l>=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;N<g;N++){const O=i+Math.floor(N*r);for(let B=0;B<u;B++)e.get(l+Math.floor(B*r),O)&&y.set(B,N)}return y}static moduleSize(e,t){const n=t.getHeight(),r=t.getWidth();let i=e[0],s=e[1],l=!0,c=0;for(;i<r&&s<n;){if(l!==t.get(i,s)){if(++c===5)break;l=!l}i++,s++}if(i===r||s===n)throw new F;return(i-e[0])/7}}yn.NO_POINTS=new Array;class Ae{PDF417Common(){}static getBitCountSum(e){return H.sum(e)}static toIntArray(e){if(e==null||!e.length)return Ae.EMPTY_INT_ARRAY;const t=new Int32Array(e.length);let n=0;for(const r of e)t[n++]=r;return t}static getCodeword(e){const t=$.binarySearch(Ae.SYMBOL_TABLE,e&262143);return t<0?-1:(Ae.CODEWORD_TABLE[t]-1)%Ae.NUMBER_OF_CODEWORDS}}Ae.NUMBER_OF_CODEWORDS=929,Ae.MAX_CODEWORDS_IN_BARCODE=Ae.NUMBER_OF_CODEWORDS-1,Ae.MIN_ROWS_IN_BARCODE=3,Ae.MAX_ROWS_IN_BARCODE=90,Ae.MODULES_IN_CODEWORD=17,Ae.MODULES_IN_STOP_PATTERN=18,Ae.BARS_IN_MODULE=8,Ae.EMPTY_INT_ARRAY=new Int32Array([]),Ae.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),Ae.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]);class Qa{constructor(e,t){this.bits=e,this.points=t}getBits(){return this.bits}getPoints(){return this.points}}class Se{static detectMultiple(e,t,n){let r=e.getBlackMatrix(),i=Se.detect(n,r);return i.length||(r=r.clone(),r.rotate180(),i=Se.detect(n,r)),new Qa(r,i)}static detect(e,t){const n=new Array;let r=0,i=0,s=!1;for(;r<t.getHeight();){const l=Se.findVertices(t,r,i);if(l[0]==null&&l[3]==null){if(!s)break;s=!1,i=0;for(const c of n)c[1]!=null&&(r=Math.trunc(Math.max(r,c[1].getY()))),c[3]!=null&&(r=Math.max(r,Math.trunc(c[3].getY())));r+=Se.ROW_STEP;continue}if(s=!0,n.push(l),!e)break;l[2]!=null?(i=Math.trunc(l[2].getX()),r=Math.trunc(l[2].getY())):(i=Math.trunc(l[4].getX()),r=Math.trunc(l[4].getY()))}return n}static findVertices(e,t,n){const r=e.getHeight(),i=e.getWidth(),s=new Array(8);return Se.copyToResult(s,Se.findRowsWithPattern(e,r,i,t,n,Se.START_PATTERN),Se.INDEXES_START_PATTERN),s[4]!=null&&(n=Math.trunc(s[4].getX()),t=Math.trunc(s[4].getY())),Se.copyToResult(s,Se.findRowsWithPattern(e,r,i,t,n,Se.STOP_PATTERN),Se.INDEXES_STOP_PATTERN),s}static copyToResult(e,t,n){for(let r=0;r<n.length;r++)e[n[r]]=t[r]}static findRowsWithPattern(e,t,n,r,i,s){const l=new Array(4);let c=!1;const u=new Int32Array(s.length);for(;r<t;r+=Se.ROW_STEP){let w=Se.findGuardPattern(e,i,r,n,!1,s,u);if(w!=null){for(;r>0;){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(;g<t;g++){const I=Se.findGuardPattern(e,E[0],g,n,!1,s,u);if(I!=null&&Math.abs(E[0]-I[0])<Se.MAX_PATTERN_DRIFT&&Math.abs(E[1]-I[1])<Se.MAX_PATTERN_DRIFT)E=I,w=0;else{if(w>Se.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-r<Se.BARCODE_MIN_HEIGHT&&$.fill(l,null),l}static findGuardPattern(e,t,n,r,i,s,l){$.fillWithin(l,0,l.length,0);let c=t,u=0;for(;e.get(c,n)&&c>0&&u++<Se.MAX_PIXEL_DRIFT;)c--;let g=c,w=0,E=s.length;for(let I=i;g<r;g++)if(e.get(g,n)!==I)l[w]++;else{if(w===E-1){if(Se.patternMatchVariance(l,s,Se.MAX_INDIVIDUAL_VARIANCE)<Se.MAX_AVG_VARIANCE)return new Int32Array([c,g]);c+=l[0]+l[1],K.arraycopy(l,2,l,0,w-1),l[w-1]=0,l[w]=0,w--}else w++;l[w]=1,I=!I}return w===E-1&&Se.patternMatchVariance(l,s,Se.MAX_INDIVIDUAL_VARIANCE)<Se.MAX_AVG_VARIANCE?new Int32Array([c,g-1]):null}static patternMatchVariance(e,t,n){let r=e.length,i=0,s=0;for(let u=0;u<r;u++)i+=e[u],s+=t[u];if(i<s)return 1/0;let l=i/s;n*=l;let c=0;for(let u=0;u<r;u++){let g=e[u],w=t[u]*l,E=g>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(;r<n&&t[r]===0;)r++;r===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-r),K.arraycopy(t,r,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(e){return this.coefficients[this.coefficients.length-1-e]}evaluateAt(e){if(e===0)return this.getCoefficient(0);if(e===1){let r=0;for(let i of this.coefficients)r=this.field.add(r,i);return r}let t=this.coefficients[0],n=this.coefficients.length;for(let r=1;r<n;r++)t=this.field.add(this.field.multiply(e,t),this.coefficients[r]);return t}add(e){if(!this.field.equals(e.field))throw new M("ModulusPolys do not have same ModulusGF field");if(this.isZero())return e;if(e.isZero())return this;let t=this.coefficients,n=e.coefficients;if(t.length>n.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<n.length;s++)r[s]=this.field.add(t[s-i],n[s]);return new Et(this.field,r)}subtract(e){if(!this.field.equals(e.field))throw new M("ModulusPolys do not have same ModulusGF field");return e.isZero()?this:this.add(e.negative())}multiply(e){return e instanceof Et?this.multiplyOther(e):this.multiplyScalar(e)}multiplyOther(e){if(!this.field.equals(e.field))throw new M("ModulusPolys do not have same ModulusGF field");if(this.isZero()||e.isZero())return new Et(this.field,new Int32Array([0]));let t=this.coefficients,n=t.length,r=e.coefficients,i=r.length,s=new Int32Array(n+i-1);for(let l=0;l<n;l++){let c=t[l];for(let u=0;u<i;u++)s[l+u]=this.field.add(s[l+u],this.field.multiply(c,r[u]))}return new Et(this.field,s)}negative(){let e=this.coefficients.length,t=new Int32Array(e);for(let n=0;n<e;n++)t[n]=this.field.subtract(0,this.coefficients[n]);return new Et(this.field,t)}multiplyScalar(e){if(e===0)return new Et(this.field,new Int32Array([0]));if(e===1)return this;let t=this.coefficients.length,n=new Int32Array(t);for(let r=0;r<t;r++)n[r]=this.field.multiply(this.coefficients[r],e);return new Et(this.field,n)}multiplyByMonomial(e,t){if(e<0)throw new M;if(t===0)return new Et(this.field,new Int32Array([0]));let n=this.coefficients.length,r=new Int32Array(n+e);for(let i=0;i<n;i++)r[i]=this.field.multiply(this.coefficients[i],t);return new Et(this.field,r)}toString(){let e=new Ie;for(let t=this.getDegree();t>=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;r<e;r++)this.expTable[r]=n,n=n*t%e;for(let r=0;r<e-1;r++)this.logTable[this.expTable[r]]=r;this.zero=new Et(this,new Int32Array([0])),this.one=new Et(this,new Int32Array([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(e,t){if(e<0)throw new M;if(t===0)return this.zero;let n=new Int32Array(e+1);return n[0]=t,new Et(this,n)}}Mi.PDF417_GF=new Mi(Ae.NUMBER_OF_CODEWORDS,3);class Fs{constructor(){this.field=Mi.PDF417_GF}decode(e,t,n){let r=new Et(this.field,e),i=new Int32Array(t),s=!1;for(let y=t;y>0;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<E.length;y++){let N=e.length-1-this.field.log(E[y]);if(N<0)throw U.getChecksumInstance();e[N]=this.field.subtract(e[N],I[y])}return E.length}runEuclideanAlgorithm(e,t,n){if(e.getDegree()<t.getDegree()){let E=e;e=t,t=E}let r=e,i=t,s=this.field.getZero(),l=this.field.getOne();for(;i.getDegree()>=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;i<this.field.getSize()&&r<t;i++)e.evaluateAt(i)===0&&(n[r]=this.field.inverse(i),r++);if(r!==t)throw U.getChecksumInstance();return n}findErrorMagnitudes(e,t,n){let r=t.getDegree(),i=new Int32Array(r);for(let u=1;u<=r;u++)i[r-u]=this.field.multiply(u,t.getCoefficient(u));let s=new Et(this.field,i),l=n.length,c=new Int32Array(l);for(let u=0;u<l;u++){let g=this.field.inverse(n[u]),w=this.field.subtract(0,e.evaluateAt(g)),E=this.field.inverse(s.evaluateAt(g));c[u]=this.field.multiply(w,E)}return c}}class Un{constructor(e,t,n,r,i){e instanceof Un?this.constructor_2(e):this.constructor_1(e,t,n,r,i)}constructor_1(e,t,n,r,i){const s=t==null||n==null,l=r==null||i==null;if(s&&l)throw new F;s?(t=new R(0,r.getY()),n=new R(0,i.getY())):l&&(r=new R(e.getWidth()-1,t.getY()),i=new R(e.getWidth()-1,n.getY())),this.image=e,this.topLeft=t,this.bottomLeft=n,this.topRight=r,this.bottomRight=i,this.minX=Math.trunc(Math.min(t.getX(),n.getX())),this.maxX=Math.trunc(Math.max(r.getX(),i.getX())),this.minY=Math.trunc(Math.min(t.getY(),r.getY())),this.maxY=Math.trunc(Math.max(n.getY(),i.getY()))}constructor_2(e){this.image=e.image,this.topLeft=e.getTopLeft(),this.bottomLeft=e.getBottomLeft(),this.topRight=e.getTopRight(),this.bottomRight=e.getBottomRight(),this.minX=e.getMinX(),this.maxX=e.getMaxX(),this.minY=e.getMinY(),this.maxY=e.getMaxY()}static merge(e,t){return e==null?t:t==null?e:new Un(e.image,e.topLeft,e.bottomLeft,t.topRight,t.bottomRight)}addMissingRows(e,t,n){let r=this.topLeft,i=this.bottomLeft,s=this.topRight,l=this.bottomRight;if(e>0){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<y;)I=l!==void 0?I+N:N+I;return I}let i=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(i,r)}format(e,...t){this.buffer+=Tr.form(e,t)}toString(){return this.buffer}}class Sr{constructor(e){this.boundingBox=new Un(e),this.codewords=new Array(e.getMaxY()-e.getMinY()+1)}getCodewordNearby(e){let t=this.getCodeword(e);if(t!=null)return t;for(let n=1;n<Sr.MAX_NEARBY_DISTANCE;n++){let r=this.imageRowToCodewordIndex(e)-n;if(r>=0&&(t=this.codewords[r],t!=null)||(r=this.imageRowToCodewordIndex(e)+n,r<this.codewords.length&&(t=this.codewords[r],t!=null)))return t}return null}imageRowToCodewordIndex(e){return e-this.boundingBox.getMinY()}setCodeword(e,t){this.codewords[this.imageRowToCodewordIndex(e)]=t}getCodeword(e){return this.codewords[this.imageRowToCodewordIndex(e)]}getBoundingBox(){return this.boundingBox}getCodewords(){return this.codewords}toString(){const e=new Tr;let t=0;for(const n of this.codewords){if(n==null){e.format("%3d: | %n",t++);continue}e.format("%3d: %3d|%3d%n",t++,n.getRowNumber(),n.getValue())}return e.toString()}}Sr.MAX_NEARBY_DISTANCE=5;class br{constructor(){this.values=new Map}setValue(e){e=Math.trunc(e);let t=this.values.get(e);t==null&&(t=0),t++,this.values.set(e,t)}getValue(){let e=-1,t=new Array;for(const[n,r]of this.values.entries()){const i={getKey:()=>n,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<l;w++){if(t[w]==null)continue;let E=t[w],I=E.getRowNumber()-c;if(I===0)g++;else if(I===1)u=Math.max(u,g),g=1,c=E.getRowNumber();else if(I<0||E.getRowNumber()>=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<s;u++){if(l[u]==null)continue;let g=l[u];g.setRowNumberAsRowIndicatorColumn();let w=g.getRowNumber()-c;w===0||(w===1?c=g.getRowNumber():g.getRowNumber()>=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.MIN_ROWS_IN_BARCODE||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;n<e.length;n++){let r=e[n];if(e[n]==null)continue;let i=r.getValue()%30,s=r.getRowNumber();if(s>t.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&&e<t);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(e){e!=null&&e.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let e=this.adjustRowNumbersByRow();if(e===0)return 0;for(let t=1;t<this.barcodeColumnCount+1;t++){let n=this.detectionResultColumns[t].getCodewords();for(let r=0;r<n.length;r++)n[r]!=null&&(n[r].hasValidRowNumber()||this.adjustRowNumbers(t,r,n))}return e}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}adjustRowNumbersFromBothRI(){if(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)return;let e=this.detectionResultColumns[0].getCodewords(),t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let n=0;n<e.length;n++)if(e[n]!=null&&t[n]!=null&&e[n].getRowNumber()===t[n].getRowNumber())for(let r=1;r<=this.barcodeColumnCount;r++){let i=this.detectionResultColumns[r].getCodewords()[n];i!=null&&(i.setRowNumber(e[n].getRowNumber()),i.hasValidRowNumber()||(this.detectionResultColumns[r].getCodewords()[n]=null))}}adjustRowNumbersFromRRI(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;let e=0,t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let n=0;n<t.length;n++){if(t[n]==null)continue;let r=t[n].getRowNumber(),i=0;for(let s=this.barcodeColumnCount+1;s>0&&i<this.ADJUST_ROW_NUMBER_SKIP;s--){let l=this.detectionResultColumns[s].getCodewords()[n];l!=null&&(i=yr.adjustRowNumberIfValid(r,i,l),l.hasValidRowNumber()||e++)}}return e}adjustRowNumbersFromLRI(){if(this.detectionResultColumns[0]==null)return 0;let e=0,t=this.detectionResultColumns[0].getCodewords();for(let n=0;n<t.length;n++){if(t[n]==null)continue;let r=t[n].getRowNumber(),i=0;for(let s=1;s<this.barcodeColumnCount+1&&i<this.ADJUST_ROW_NUMBER_SKIP;s++){let l=this.detectionResultColumns[s].getCodewords()[n];l!=null&&(i=yr.adjustRowNumberIfValid(r,i,l),l.hasValidRowNumber()||e++)}}return e}static adjustRowNumberIfValid(e,t,n){return n==null||n.hasValidRowNumber()||(n.isValidRowNumber(e)?(n.setRowNumber(e),t=0):++t),t}adjustRowNumbers(e,t,n){let r=n[t],i=this.detectionResultColumns[e-1].getCodewords(),s=i;this.detectionResultColumns[e+1]!=null&&(s=this.detectionResultColumns[e+1].getCodewords());let l=new Array(14);l[2]=i[t],l[3]=s[t],t>0&&(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<n.length-1&&(l[1]=n[t+1],l[6]=i[t+1],l[7]=s[t+1]),t<n.length-2&&(l[9]=n[t+2],l[12]=i[t+2],l[13]=s[t+2]);for(let c of l)if(yr.adjustRowNumber(r,c))return}static adjustRowNumber(e,t){return t==null?!1:t.hasValidRowNumber()&&t.getBucket()===e.getBucket()?(e.setRowNumber(t.getRowNumber()),!0):!1}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(e){this.boundingBox=e}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(e,t){this.detectionResultColumns[e]=t}getDetectionResultColumn(e){return this.detectionResultColumns[e]}toString(){let e=this.detectionResultColumns[0];e==null&&(e=this.detectionResultColumns[this.barcodeColumnCount+1]);let t=new Tr;for(let n=0;n<e.getCodewords().length;n++){t.format("CW %3d:",n);for(let r=0;r<this.barcodeColumnCount+2;r++){if(this.detectionResultColumns[r]==null){t.format(" | ");continue}let i=this.detectionResultColumns[r].getCodewords()[n];if(i==null){t.format(" | ");continue}t.format(" %3d|%3d",i.getRowNumber(),i.getValue())}t.format("%n")}return t.toString()}}class Nr{constructor(e,t,n,r){this.rowNumber=Nr.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(e),this.endX=Math.trunc(t),this.bucket=Math.trunc(n),this.value=Math.trunc(r)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(e){return e!==Nr.BARCODE_ROW_UNKNOWN&&this.bucket===e%3*3}setRowNumberAsRowIndicatorColumn(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))}getWidth(){return this.endX-this.startX}getStartX(){return this.startX}getEndX(){return this.endX}getBucket(){return this.bucket}getValue(){return this.value}getRowNumber(){return this.rowNumber}setRowNumber(e){this.rowNumber=e}toString(){return this.rowNumber+"|"+this.value}}Nr.BARCODE_ROW_UNKNOWN=-1;class Bt{static initialize(){for(let e=0;e<Ae.SYMBOL_TABLE.length;e++){let t=Ae.SYMBOL_TABLE[e],n=t&1;for(let r=0;r<Ae.BARS_IN_MODULE;r++){let i=0;for(;(t&1)===n;)i+=1,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;s<Ae.MODULES_IN_CODEWORD;s++){let l=t/(2*Ae.MODULES_IN_CODEWORD)+s*t/Ae.MODULES_IN_CODEWORD;i+e[r]<=l&&(i+=e[r],r++),n[r]++}return n}static getDecodedCodewordValue(e){let t=Bt.getBitValue(e);return Ae.getCodeword(t)===-1?-1:t}static getBitValue(e){let t=0;for(let n=0;n<e.length;n++)for(let r=0;r<e[n];r++)t=t<<1|(n%2===0?1:0);return Math.trunc(t)}static getClosestDecodedValue(e){let t=H.sum(e),n=new Array(Ae.BARS_IN_MODULE);if(t>1)for(let s=0;s<n.length;s++)n[s]=Math.fround(e[s]/t);let r=J.MAX_VALUE,i=-1;this.bSymbolTableReady||Bt.initialize();for(let s=0;s<Bt.RATIOS_TABLE.length;s++){let l=0,c=Bt.RATIOS_TABLE[s];for(let u=0;u<Ae.BARS_IN_MODULE;u++){let g=Math.fround(c[u]-n[u]);if(l+=Math.fround(g*g),l>=r)break}l<r&&(r=l,i=Ae.SYMBOL_TABLE[s])}return i}}Bt.bSymbolTableReady=!1,Bt.RATIOS_TABLE=new Array(Ae.SYMBOL_TABLE.length).map(A=>new 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;r<n;r++)this.write(e[t+r])}flush(){}close(){}}class el extends m{}class tl extends $a{constructor(e=32){if(super(),this.count=0,e<0)throw new M("Negative initial size: "+e);this.buf=new Uint8Array(e)}ensureCapacity(e){e-this.buf.length>0&&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(;i<e[0];){switch(s){case L.TEXT_COMPACTION_MODE_LATCH:i=L.textCompaction(e,i,n);break;case L.BYTE_COMPACTION_MODE_LATCH:case L.BYTE_COMPACTION_MODE_LATCH_6:i=L.byteCompaction(s,e,r,i,n);break;case L.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(e[i++]);break;case L.NUMERIC_COMPACTION_MODE_LATCH:i=L.numericCompaction(e,i,n);break;case L.ECI_CHARSET:V.getCharacterSetECIByValue(e[i++]);break;case L.ECI_GENERAL_PURPOSE:i+=2;break;case L.ECI_USER_DEFINED:i++;break;case L.BEGIN_MACRO_PDF417_CONTROL_BLOCK:i=L.decodeMacroBlock(e,i,l);break;case L.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case L.MACRO_PDF417_TERMINATOR:throw new G;default:i--,i=L.textCompaction(e,i,n);break}if(i<e.length)s=e[i++];else throw G.getFormatInstance()}if(n.length()===0)throw G.getFormatInstance();let c=new nn(null,n.toString(),null,t);return c.setOther(l),c}static decodeMacroBlock(e,t,n){if(t+L.NUMBER_OF_SEQUENCE_CODEWORDS>e[0])throw G.getFormatInstance();let r=new Int32Array(L.NUMBER_OF_SEQUENCE_CODEWORDS);for(let l=0;l<L.NUMBER_OF_SEQUENCE_CODEWORDS;l++,t++)r[l]=e[t];n.setSegmentIndex(se.parseInt(L.decodeBase900toBase10(r,L.NUMBER_OF_SEQUENCE_CODEWORDS)));let i=new Ie;t=L.textCompaction(e,t,i),n.setFileId(i.toString());let s=-1;for(e[t]===L.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=t+1);t<e[0];)switch(e[t]){case L.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(t++,e[t]){case L.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let l=new Ie;t=L.textCompaction(e,t+1,l),n.setFileName(l.toString());break;case L.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let c=new Ie;t=L.textCompaction(e,t+1,c),n.setSender(c.toString());break;case L.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let u=new Ie;t=L.textCompaction(e,t+1,u),n.setAddressee(u.toString());break;case L.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let g=new Ie;t=L.numericCompaction(e,t+1,g),n.setSegmentCount(se.parseInt(g.toString()));break;case L.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let w=new Ie;t=L.numericCompaction(e,t+1,w),n.setTimestamp(Hs.parseLong(w.toString()));break;case L.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let E=new Ie;t=L.numericCompaction(e,t+1,E),n.setChecksum(se.parseInt(E.toString()));break;case L.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let I=new Ie;t=L.numericCompaction(e,t+1,I),n.setFileSize(Hs.parseLong(I.toString()));break;default:throw G.getFormatInstance()}break;case L.MACRO_PDF417_TERMINATOR:t++,n.setLastSegment(!0);break;default:throw G.getFormatInstance()}if(s!==-1){let l=t-s;n.isLastSegment()&&l--,n.setOptionalData($.copyOfRange(e,s,s+l))}return t}static textCompaction(e,t,n){let r=new Int32Array((e[0]-t)*2),i=new Int32Array((e[0]-t)*2),s=0,l=!1;for(;t<e[0]&&!l;){let c=e[t++];if(c<L.TEXT_COMPACTION_MODE_LATCH)r[s]=c/30,r[s+1]=c%30,s+=2;else switch(c){case L.TEXT_COMPACTION_MODE_LATCH:r[s++]=L.TEXT_COMPACTION_MODE_LATCH;break;case L.BYTE_COMPACTION_MODE_LATCH:case L.BYTE_COMPACTION_MODE_LATCH_6:case L.NUMERIC_COMPACTION_MODE_LATCH:case L.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case L.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case L.MACRO_PDF417_TERMINATOR:t--,l=!0;break;case L.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r[s]=L.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,c=e[t++],i[s]=c,s++;break}}return L.decodeTextCompaction(r,i,s,n),t}static decodeTextCompaction(e,t,n,r){let i=Ge.ALPHA,s=Ge.ALPHA,l=0;for(;l<n;){let c=e[l],u="";switch(i){case Ge.ALPHA:if(c<26)u=String.fromCharCode(65+c);else switch(c){case 26:u=" ";break;case L.LL:i=Ge.LOWER;break;case L.ML:i=Ge.MIXED;break;case L.PS:s=i,i=Ge.PUNCT_SHIFT;break;case L.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[l]);break;case L.TEXT_COMPACTION_MODE_LATCH:i=Ge.ALPHA;break}break;case Ge.LOWER:if(c<26)u=String.fromCharCode(97+c);else switch(c){case 26:u=" ";break;case L.AS:s=i,i=Ge.ALPHA_SHIFT;break;case L.ML:i=Ge.MIXED;break;case L.PS:s=i,i=Ge.PUNCT_SHIFT;break;case L.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[l]);break;case L.TEXT_COMPACTION_MODE_LATCH:i=Ge.ALPHA;break}break;case Ge.MIXED:if(c<L.PL)u=L.MIXED_CHARS[c];else switch(c){case L.PL:i=Ge.PUNCT;break;case 26:u=" ";break;case L.LL:i=Ge.LOWER;break;case L.AL:i=Ge.ALPHA;break;case L.PS:s=i,i=Ge.PUNCT_SHIFT;break;case L.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[l]);break;case L.TEXT_COMPACTION_MODE_LATCH:i=Ge.ALPHA;break}break;case Ge.PUNCT:if(c<L.PAL)u=L.PUNCT_CHARS[c];else switch(c){case L.PAL:i=Ge.ALPHA;break;case L.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[l]);break;case L.TEXT_COMPACTION_MODE_LATCH:i=Ge.ALPHA;break}break;case Ge.ALPHA_SHIFT:if(i=s,c<26)u=String.fromCharCode(65+c);else switch(c){case 26:u=" ";break;case L.TEXT_COMPACTION_MODE_LATCH:i=Ge.ALPHA;break}break;case Ge.PUNCT_SHIFT:if(i=s,c<L.PAL)u=L.PUNCT_CHARS[c];else switch(c){case L.PAL:i=Ge.ALPHA;break;case L.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[l]);break;case L.TEXT_COMPACTION_MODE_LATCH:i=Ge.ALPHA;break}break}u!==""&&r.append(u),l++}}static byteCompaction(e,t,n,r,i){let s=new tl,l=0,c=0,u=!1;switch(e){case L.BYTE_COMPACTION_MODE_LATCH:let g=new Int32Array(6),w=t[r++];for(;r<t[0]&&!u;)switch(g[l++]=w,c=900*c+w,w=t[r++],w){case L.TEXT_COMPACTION_MODE_LATCH:case L.BYTE_COMPACTION_MODE_LATCH:case L.NUMERIC_COMPACTION_MODE_LATCH:case L.BYTE_COMPACTION_MODE_LATCH_6:case L.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case L.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case L.MACRO_PDF417_TERMINATOR:r--,u=!0;break;default:if(l%5===0&&l>0){for(let E=0;E<6;++E)s.write(Number(Nn(c)>>Nn(8*(5-E))));c=0,l=0}break}r===t[0]&&w<L.TEXT_COMPACTION_MODE_LATCH&&(g[l++]=w);for(let E=0;E<l;E++)s.write(g[E]);break;case L.BYTE_COMPACTION_MODE_LATCH_6:for(;r<t[0]&&!u;){let E=t[r++];if(E<L.TEXT_COMPACTION_MODE_LATCH)l++,c=900*c+E;else switch(E){case L.TEXT_COMPACTION_MODE_LATCH:case L.BYTE_COMPACTION_MODE_LATCH:case L.NUMERIC_COMPACTION_MODE_LATCH:case L.BYTE_COMPACTION_MODE_LATCH_6:case L.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case L.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case L.MACRO_PDF417_TERMINATOR:r--,u=!0;break}if(l%5===0&&l>0){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(;t<e[0]&&!i;){let l=e[t++];if(t===e[0]&&(i=!0),l<L.TEXT_COMPACTION_MODE_LATCH)s[r]=l,r++;else switch(l){case L.TEXT_COMPACTION_MODE_LATCH:case L.BYTE_COMPACTION_MODE_LATCH:case L.BYTE_COMPACTION_MODE_LATCH_6:case L.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case L.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case L.MACRO_PDF417_TERMINATOR:t--,i=!0;break}(r%L.MAX_NUMERIC_CODEWORDS===0||l===L.NUMERIC_COMPACTION_MODE_LATCH||i)&&r>0&&(n.append(L.decodeBase900toBase10(s,r)),r=0)}return t}static decodeBase900toBase10(e,t){let n=Nn(0);for(let i=0;i<t;i++)n+=L.EXP900[t-i-1]*Nn(e[i]);let r=n.toString();if(r.charAt(0)!=="1")throw new G;return r.substring(1)}}L.TEXT_COMPACTION_MODE_LATCH=900,L.BYTE_COMPACTION_MODE_LATCH=901,L.NUMERIC_COMPACTION_MODE_LATCH=902,L.BYTE_COMPACTION_MODE_LATCH_6=924,L.ECI_USER_DEFINED=925,L.ECI_GENERAL_PURPOSE=926,L.ECI_CHARSET=927,L.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,L.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,L.MACRO_PDF417_TERMINATOR=922,L.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,L.MAX_NUMERIC_CODEWORDS=15,L.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,L.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,L.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,L.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,L.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,L.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,L.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,L.PL=25,L.LL=27,L.AS=27,L.ML=28,L.AL=28,L.PS=29,L.PAL=29,L.PUNCT_CHARS=`;<>@[\\]_\`~!\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.getMinY()||N.getMaxY()>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;c<e.getBarcodeRowCount();c++)for(let u=0;u<e.getBarcodeColumnCount();u++){let g=t[c][u+1].getValue(),w=c*e.getBarcodeColumnCount()+u;g.length===0?n.push(w):g.length===1?r[w]=g[0]:(s.push(w),i.push(g))}let l=new Array(i.length);for(let c=0;c<l.length;c++)l[c]=i[c];return ye.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),r,Ae.toIntArray(n),Ae.toIntArray(s),l)}static createDecoderResultFromAmbiguousValues(e,t,n,r,i){let s=new Int32Array(r.length),l=100;for(;l-- >0;){for(let c=0;c<s.length;c++)t[r[c]]=i[c][s[c]];try{return ye.decodeCodewords(t,e,n)}catch(c){if(!(c instanceof U))throw c}if(s.length===0)throw U.getChecksumInstance();for(let c=0;c<s.length;c++)if(s[c]<i[c].length-1){s[c]++;break}else if(s[c]=0,c===s.length-1)throw U.getChecksumInstance()}throw U.getChecksumInstance()}static createBarcodeMatrix(e){let t=Array.from({length:e.getBarcodeRowCount()},()=>new Array(e.getBarcodeColumnCount()+2));for(let r=0;r<t.length;r++)for(let i=0;i<t[r].length;i++)t[r][i]=new br;let n=0;for(let r of e.getDetectionResultColumns()){if(r!=null){for(let i of r.getCodewords())if(i!=null){let s=i.getRowNumber();if(s>=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<u.length/2;y++){let N=u[y];u[y]=u[u.length-1-y],u[u.length-1-y]=N}g=i,i=g-w}if(!ye.checkCodewordSkew(w,l,c))return null;let E=Bt.getDecodedValue(u),I=Ae.getCodeword(E);return I===-1?null:new Nr(i,g,ye.getCodewordBucketNumber(E),I)}static getModuleBitCount(e,t,n,r,i,s){let l=i,c=new Int32Array(8),u=0,g=r?1:-1,w=r;for(;(r?l<n:l>=t)&&u<c.length;)e.get(l,s)===w?(c[u]++,l+=g):(u++,w=!w);return u===c.length||l===(r?n:t)&&u===c.length-1?c:null}static getNumberOfECCodeWords(e){return 2<<e}static adjustCodewordStartColumn(e,t,n,r,i,s){let l=i,c=r?-1:1;for(let u=0;u<2;u++){for(;(r?l>=t:l<n)&&r===e.get(l,s);){if(Math.abs(i-l)>ye.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<<t+1,i=ye.correctErrors(e,n,r);ye.verifyCodewordCount(e,r);let s=L.decode(e,""+t);return s.setErrorsCorrected(i),s.setErasures(n.length),s}static correctErrors(e,t,n){if(t!=null&&t.length>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<e.length)e[0]=e.length-t;else throw G.getFormatInstance()}static getBitCountForCodeword(e){let t=new Int32Array(8),n=0,r=t.length-1;for(;!((e&1)!==n&&(n=e&1,r--,r<0));)t[r]++,e>>=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;n<e.length;n++){t.format("Row %2d: ",n);for(let r=0;r<e[n].length;r++){let i=e[n][r];i.getValue().length===0?t.format(" ",null):t.format("%4d(%2d)",i.getValue()[0],i.getConfidence(i.getValue()[0]))}t.format("%n")}return t.toString()}}ye.CODEWORD_SKEW_SIZE=2,ye.MAX_ERRORS=3,ye.MAX_EC_CODEWORDS=512,ye.errorCorrection=new Fs;class pt{decode(e,t=null){let n=pt.decode(e,t,!1);if(n==null||n.length===0||n[0]==null)throw F.getNotFoundInstance();return n[0]}decodeMultiple(e,t=null){try{return pt.decode(e,t,!0)}catch(n){throw n instanceof G||n instanceof U?F.getNotFoundInstance():n}}static decode(e,t,n){const r=new Array,i=Se.detectMultiple(e,t,n);for(const s of i.getPoints()){const l=ye.decode(i.getBits(),s[4],s[5],s[6],s[7],pt.getMinCodewordWidth(s),pt.getMaxCodewordWidth(s)),c=new rt(l.getText(),l.getRawBytes(),void 0,s,de.PDF_417);c.putMetadata(Ye.ERROR_CORRECTION_LEVEL,l.getECLevel());const u=l.getOther();u!=null&&c.putMetadata(Ye.PDF417_EXTRA_METADATA,u),r.push(c)}return r.map(s=>s)}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<u;g++)e[n+g]=0;K.arraycopy(c,0,e,n+u,c.length)}}class lt{constructor(){}static applyMaskPenaltyRule1(e){return lt.applyMaskPenaltyRule1Internal(e,!0)+lt.applyMaskPenaltyRule1Internal(e,!1)}static applyMaskPenaltyRule2(e){let t=0;const n=e.getArray(),r=e.getWidth(),i=e.getHeight();for(let s=0;s<i-1;s++){const l=n[s];for(let c=0;c<r-1;c++){const u=l[c];u===l[c+1]&&u===n[s+1][c]&&u===n[s+1][c+1]&&t++}}return lt.N2*t}static applyMaskPenaltyRule3(e){let t=0;const n=e.getArray(),r=e.getWidth(),i=e.getHeight();for(let s=0;s<i;s++)for(let l=0;l<r;l++){const c=n[s];l+6<r&&c[l]===1&&c[l+1]===0&&c[l+2]===1&&c[l+3]===1&&c[l+4]===1&&c[l+5]===0&&c[l+6]===1&&(lt.isWhiteHorizontal(c,l-4,l)||lt.isWhiteHorizontal(c,l+7,l+11))&&t++,s+6<i&&n[s][l]===1&&n[s+1][l]===0&&n[s+2][l]===1&&n[s+3][l]===1&&n[s+4][l]===1&&n[s+5][l]===0&&n[s+6][l]===1&&(lt.isWhiteVertical(n,l,s-4,s)||lt.isWhiteVertical(n,l,s+7,s+11))&&t++}return t*lt.N3}static isWhiteHorizontal(e,t,n){t=Math.max(t,0),n=Math.min(n,e.length);for(let r=t;r<n;r++)if(e[r]===1)return!1;return!0}static isWhiteVertical(e,t,n,r){n=Math.max(n,0),r=Math.min(r,e.length);for(let i=n;i<r;i++)if(e[i][t]===1)return!1;return!0}static applyMaskPenaltyRule4(e){let t=0;const n=e.getArray(),r=e.getWidth(),i=e.getHeight();for(let c=0;c<i;c++){const u=n[c];for(let g=0;g<r;g++)u[g]===1&&t++}const s=e.getHeight()*e.getWidth();return Math.floor(Math.abs(t*2-s)*10/s)*lt.N4}static getDataMaskBit(e,t,n){let r,i;switch(e){case 0:r=n+t&1;break;case 1:r=n&1;break;case 2:r=t%3;break;case 3:r=(n+t)%3;break;case 4:r=Math.floor(n/2)+Math.floor(t/3)&1;break;case 5:i=n*t,r=(i&1)+i%3;break;case 6:i=n*t,r=(i&1)+i%3&1;break;case 7:i=n*t,r=i%3+(n+t&1)&1;break;default:throw new M("Invalid mask pattern: "+e)}return r===0}static applyMaskPenaltyRule1Internal(e,t){let n=0;const r=t?e.getHeight():e.getWidth(),i=t?e.getWidth():e.getHeight(),s=e.getArray();for(let l=0;l<r;l++){let c=0,u=-1;for(let g=0;g<i;g++){const w=t?s[l][g]:s[g][l];w===u?c++:(c>=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<r;++n){const i=this.bytes[n],s=t.bytes[n];for(let l=0,c=this.width;l<c;++l)if(i[l]!==s[l])return!1}return!0}toString(){const e=new Ie;for(let t=0,n=this.height;t<n;++t){const r=this.bytes[t];for(let i=0,s=this.width;i<s;++i)switch(r[i]){case 0:e.append(" 0");break;case 1:e.append(" 1");break;default:e.append(" ");break}e.append(`
`)}return e.toString()}}class Hn{constructor(){this.maskPattern=-1}getMode(){return this.mode}getECLevel(){return this.ecLevel}getVersion(){return this.version}getMaskPattern(){return this.maskPattern}getMatrix(){return this.matrix}toString(){const e=new Ie;return e.append(`<<
`),e.append(" mode: "),e.append(this.mode?this.mode.toString():"null"),e.append(`
ecLevel: `),e.append(this.ecLevel?this.ecLevel.toString():"null"),e.append(`
version: `),e.append(this.version?this.version.toString():"null"),e.append(`
maskPattern: `),e.append(this.maskPattern.toString()),this.matrix?(e.append(`
matrix:
`),e.append(this.matrix.toString())):e.append(`
matrix: null
`),e.append(`>>
`),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&&e<Hn.NUM_MASK_PATTERNS}}Hn.NUM_MASK_PATTERNS=8;class Ke extends m{}Ke.kind="WriterException";class xe{constructor(){}static clearMatrix(e){e.clear(255)}static buildMatrix(e,t,n,r,i){xe.clearMatrix(i),xe.embedBasicPatterns(n,i),xe.embedTypeInfo(t,r,i),xe.maybeEmbedVersionInfo(n,i),xe.embedDataBits(e,r,i)}static embedBasicPatterns(e,t){xe.embedPositionDetectionPatternsAndSeparators(t),xe.embedDarkDotAtLeftBottomCorner(t),xe.maybeEmbedPositionAdjustmentPatterns(e,t),xe.embedTimingPatterns(t)}static embedTypeInfo(e,t,n){const r=new Ee;xe.makeTypeInfoBits(e,t,r);for(let i=0,s=r.getSize();i<s;++i){const l=r.get(r.getSize()-1-i),c=xe.TYPE_INFO_COORDINATES[i],u=c[0],g=c[1];if(n.setBoolean(u,g,l),i<8){const w=n.getWidth()-i-1,E=8;n.setBoolean(w,E,l)}else{const E=n.getHeight()-7+(i-8);n.setBoolean(8,E,l)}}}static maybeEmbedVersionInfo(e,t){if(e.getVersionNumber()<7)return;const n=new Ee;xe.makeVersionInfoBits(e,n);let r=6*3-1;for(let i=0;i<6;++i)for(let s=0;s<3;++s){const l=n.get(r);r--,t.setBoolean(i,t.getHeight()-11+s,l),t.setBoolean(t.getHeight()-11+s,i,l)}}static embedDataBits(e,t,n){let r=0,i=-1,s=n.getWidth()-1,l=n.getHeight()-1;for(;s>0;){for(s===6&&(s-=1);l>=0&&l<n.getHeight();){for(let c=0;c<2;++c){const u=s-c;if(!xe.isEmpty(n.get(u,l)))continue;let g;r<e.getSize()?(g=e.get(r),++r):g=!1,t!==255&&lt.getDataMaskBit(t,u,l)&&(g=!g),n.setBoolean(u,l,g)}l+=i}i=-i,l+=i,s-=2}if(r!==e.getSize())throw new Ke("Not all bits consumed: "+r+"/"+e.getSize())}static findMSBSet(e){return 32-se.numberOfLeadingZeros(e)}static calculateBCHCode(e,t){if(t===0)throw new M("0 polynomial");const n=xe.findMSBSet(t);for(e<<=n-1;xe.findMSBSet(e)>=n;)e^=t<<xe.findMSBSet(e)-n;return e}static makeTypeInfoBits(e,t,n){if(!Hn.isValidMaskPattern(t))throw new Ke("Invalid mask pattern");const r=e.getBits()<<3|t;n.appendBits(r,5);const i=xe.calculateBCHCode(r,xe.TYPE_INFO_POLY);n.appendBits(i,10);const s=new Ee;if(s.appendBits(xe.TYPE_INFO_MASK_PATTERN,15),n.xor(s),n.getSize()!==15)throw new Ke("should not happen but we got: "+n.getSize())}static makeVersionInfoBits(e,t){t.appendBits(e.getVersionNumber(),6);const n=xe.calculateBCHCode(e.getVersionNumber(),xe.VERSION_INFO_POLY);if(t.appendBits(n,12),t.getSize()!==18)throw new Ke("should not happen but we got: "+t.getSize())}static isEmpty(e){return e===255}static embedTimingPatterns(e){for(let t=8;t<e.getWidth()-8;++t){const n=(t+1)%2;xe.isEmpty(e.get(t,6))&&e.setNumber(t,6,n),xe.isEmpty(e.get(6,t))&&e.setNumber(6,t,n)}}static embedDarkDotAtLeftBottomCorner(e){if(e.get(8,e.getHeight()-8)===0)throw new Ke;e.setNumber(8,e.getHeight()-8,1)}static embedHorizontalSeparationPattern(e,t,n){for(let r=0;r<8;++r){if(!xe.isEmpty(n.get(e+r,t)))throw new Ke;n.setNumber(e+r,t,0)}}static embedVerticalSeparationPattern(e,t,n){for(let r=0;r<7;++r){if(!xe.isEmpty(n.get(e,t+r)))throw new Ke;n.setNumber(e,t+r,0)}}static embedPositionAdjustmentPattern(e,t,n){for(let r=0;r<5;++r){const i=xe.POSITION_ADJUSTMENT_PATTERN[r];for(let s=0;s<5;++s)n.setNumber(e+s,t+r,i[s])}}static embedPositionDetectionPattern(e,t,n){for(let r=0;r<7;++r){const i=xe.POSITION_DETECTION_PATTERN[r];for(let s=0;s<7;++s)n.setNumber(e+s,t+r,i[s])}}static embedPositionDetectionPatternsAndSeparators(e){const t=xe.POSITION_DETECTION_PATTERN[0].length;xe.embedPositionDetectionPattern(0,0,e),xe.embedPositionDetectionPattern(e.getWidth()-t,0,e),xe.embedPositionDetectionPattern(0,e.getWidth()-t,e);const n=8;xe.embedHorizontalSeparationPattern(0,n-1,e),xe.embedHorizontalSeparationPattern(e.getWidth()-n,n-1,e),xe.embedHorizontalSeparationPattern(0,e.getWidth()-n,e);const r=7;xe.embedVerticalSeparationPattern(r,0,e),xe.embedVerticalSeparationPattern(e.getHeight()-r-1,0,e),xe.embedVerticalSeparationPattern(r,e.getHeight()-r,e)}static maybeEmbedPositionAdjustmentPatterns(e,t){if(e.getVersionNumber()<2)return;const n=e.getVersionNumber()-1,r=xe.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n];for(let i=0,s=r.length;i!==s;i++){const l=r[i];if(l>=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 e<nt.ALPHANUMERIC_TABLE.length?nt.ALPHANUMERIC_TABLE[e]:-1}static chooseMode(e,t=null){if(V.SJIS.getName()===t&&this.isOnlyDoubleByteKanji(e))return ge.KANJI;let n=!1,r=!1;for(let i=0,s=e.length;i<s;++i){const l=e.charAt(i);if(nt.isDigit(l))n=!0;else if(this.getAlphanumericCode(l.charCodeAt(0))!==-1)r=!0;else return ge.BYTE}return r?ge.ALPHANUMERIC:n?ge.NUMERIC:ge.BYTE}static isOnlyDoubleByteKanji(e){let t;try{t=ze.encode(e,V.SJIS)}catch{return!1}const n=t.length;if(n%2!==0)return!1;for(let r=0;r<n;r+=2){const i=t[r]&255;if((i<129||i>159)&&(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<Hn.NUM_MASK_PATTERNS;l++){xe.buildMatrix(e,t,n,l,r);let c=this.calculateMaskPenalty(r);c<i&&(i=c,s=l)}return s}static chooseVersion(e,t){for(let n=1;n<=40;n++){const r=ce.getVersionForNumber(n);if(nt.willFit(e,r,t))return r}throw new Ke("Data too big")}static willFit(e,t,n){const r=t.getTotalCodewords(),s=t.getECBlocksForLevel(n).getTotalECCodewords(),l=r-s,c=(e+7)/8;return 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()<n;++s)t.appendBit(!1);const r=t.getSize()&7;if(r>0)for(let s=r;s<8;s++)t.appendBit(!1);const i=e-t.getSizeInBytes();for(let s=0;s<i;++s)t.appendBits((s&1)===0?236:17,8);if(t.getSize()!==n)throw new Ke("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(e,t,n,r,i,s){if(r>=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<c?(i[0]=w,s[0]=I):(i[0]=E,s[0]=y)}static interleaveWithECBytes(e,t,n,r){if(e.getSizeInBytes()!==n)throw new Ke("Number of bits and data bytes does not match");let i=0,s=0,l=0;const c=new Array;for(let g=0;g<r;++g){const w=new Int32Array(1),E=new Int32Array(1);nt.getNumDataBytesAndNumECBytesForBlockID(t,n,r,g,w,E);const I=w[0],y=new Uint8Array(I);e.toBytes(8*i,y,0,I);const N=nt.generateECBytes(y,E[0]);c.push(new ol(y,N)),s=Math.max(s,I),l=Math.max(l,N.length),i+=w[0]}if(n!==i)throw new Ke("Data bytes does not match offset");const u=new Ee;for(let g=0;g<s;++g)for(const w of c){const E=w.getDataBytes();g<E.length&&u.appendBits(E[g],8)}for(let g=0;g<l;++g)for(const w of c){const E=w.getErrorCorrectionBytes();g<E.length&&u.appendBits(E[g],8)}if(t!==u.getSizeInBytes())throw new Ke("Interleaving error: "+t+" and "+u.getSizeInBytes()+" differ.");return u}static generateECBytes(e,t){const n=e.length,r=new Int32Array(n+t);for(let s=0;s<n;s++)r[s]=e[s]&255;new Di(Oe.QR_CODE_FIELD_256).encode(r,t);const i=new Uint8Array(t);for(let s=0;s<t;s++)i[s]=r[n+s];return i}static appendModeInfo(e,t){t.appendBits(e.getBits(),4)}static appendLengthInfo(e,t,n,r){const i=n.getCharacterCountBits(t);if(e>=1<<i)throw new Ke(e+" is bigger than "+((1<<i)-1));r.appendBits(e,i)}static appendBytes(e,t,n,r){switch(t){case ge.NUMERIC:nt.appendNumericBytes(e,n);break;case ge.ALPHANUMERIC:nt.appendAlphanumericBytes(e,n);break;case ge.BYTE:nt.append8BitBytes(e,n,r);break;case ge.KANJI:nt.appendKanjiBytes(e,n);break;default:throw new Ke("Invalid mode: "+t)}}static getDigit(e){return e.charCodeAt(0)-48}static isDigit(e){const t=nt.getDigit(e);return t>=0&&t<=9}static appendNumericBytes(e,t){const n=e.length;let r=0;for(;r<n;){const i=nt.getDigit(e.charAt(r));if(r+2<n){const s=nt.getDigit(e.charAt(r+1)),l=nt.getDigit(e.charAt(r+2));t.appendBits(i*100+s*10+l,10),r+=3}else if(r+1<n){const s=nt.getDigit(e.charAt(r+1));t.appendBits(i*10+s,7),r+=2}else t.appendBits(i,4),r++}}static appendAlphanumericBytes(e,t){const n=e.length;let r=0;for(;r<n;){const i=nt.getAlphanumericCode(e.charCodeAt(r));if(i===-1)throw new Ke;if(r+1<n){const s=nt.getAlphanumericCode(e.charCodeAt(r+1));if(s===-1)throw new Ke;t.appendBits(i*45+s,11),r+=2}else t.appendBits(i,6),r++}}static append8BitBytes(e,t,n){let r;try{r=ze.encode(e,n)}catch(i){throw new Ke(i)}for(let i=0,s=r.length;i!==s;i++){const l=r[i];t.appendBits(l,8)}}static appendKanjiBytes(e,t){let n;try{n=ze.encode(e,V.SJIS)}catch(i){throw new Ke(i)}const r=n.length;for(let i=0;i<r;i+=2){const s=n[i]&255,l=n[i+1]&255,c=s<<8&4294967295|l;let u=-1;if(c>=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;O<l;O++,B+=E)for(let X=0,Z=I;X<s;X++,Z+=E)if(i.get(X,O)===1){const W=this.createSvgRectElement(Z,B,E,E);N.appendChild(W)}return N}createSVGElement(e,t){const n=document.createElementNS(jn.SVG_NS,"svg");return n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"width",t.toString()),n}createSvgRectElement(e,t,n,r){const i=document.createElementNS(jn.SVG_NS,"rect");return i.setAttributeNS(null,"x",e.toString()),i.setAttributeNS(null,"y",t.toString()),i.setAttributeNS(null,"height",n.toString()),i.setAttributeNS(null,"width",r.toString()),i.setAttributeNS(null,"fill","#000000"),i}}jn.QUIET_ZONE_SIZE=4,jn.SVG_NS="http://www.w3.org/2000/svg";class sr{encode(e,t,n,r,i){if(e.length===0)throw new M("Found empty contents");if(t!==de.QR_CODE)throw new M("Can only encode QR_CODE, but got "+t);if(n<0||r<0)throw new M(`Requested dimensions are too small: ${n}x${r}`);let s=qe.L,l=sr.QUIET_ZONE_SIZE;i!==null&&(i.get(gt.ERROR_CORRECTION)!==void 0&&(s=qe.fromString(i.get(gt.ERROR_CORRECTION).toString())),i.get(gt.MARGIN)!==void 0&&(l=Number.parseInt(i.get(gt.MARGIN).toString(),10)));const c=nt.encode(e,s,i);return sr.renderResult(c,n,r,l)}static 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=new et(g,w);for(let O=0,B=y;O<l;O++,B+=E)for(let X=0,Z=I;X<s;X++,Z+=E)i.get(X,O)===1&&N.setRegion(Z,B,E,E);return N}}sr.QUIET_ZONE_SIZE=4;class al{encode(e,t,n,r,i){let s;switch(t){case de.QR_CODE:s=new sr;break;default:throw new M("No encoder available for format "+t)}return s.encode(e,t,n,r,i)}}class an extends We{constructor(e,t,n,r,i,s,l,c){if(super(s,l),this.yuvData=e,this.dataWidth=t,this.dataHeight=n,this.left=r,this.top=i,r+s>t||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<n)&&(t=new Uint8ClampedArray(n));const r=(e+this.top)*this.dataWidth+this.left;return K.arraycopy(this.yuvData,r,t,0,n),t}getMatrix(){const e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.yuvData;const n=e*t,r=new Uint8ClampedArray(n);let i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return K.arraycopy(this.yuvData,i,r,0,n),r;for(let s=0;s<t;s++){const l=s*e;K.arraycopy(this.yuvData,i,r,l,e),i+=this.dataWidth}return r}isCropSupported(){return!0}crop(e,t,n,r){return new an(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+t,n,r,!1)}renderThumbnail(){const e=this.getWidth()/an.THUMBNAIL_SCALE_FACTOR,t=this.getHeight()/an.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(e*t),r=this.yuvData;let i=this.top*this.dataWidth+this.left;for(let s=0;s<t;s++){const l=s*e;for(let c=0;c<e;c++){const u=r[i+c*an.THUMBNAIL_SCALE_FACTOR]&255;n[l+c]=4278190080|u*65793}i+=this.dataWidth*an.THUMBNAIL_SCALE_FACTOR}return n}getThumbnailWidth(){return this.getWidth()/an.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/an.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(e,t){const n=this.yuvData;for(let r=0,i=this.top*this.dataWidth+this.left;r<t;r++,i+=this.dataWidth){const s=i+e/2;for(let l=i,c=i+e-1;l<s;l++,c--){const u=n[l];n[l]=n[c],n[c]=u}}}invert(){return new Re(this)}}an.THUMBNAIL_SCALE_FACTOR=2;class Ri extends We{constructor(e,t,n,r,i,s,l){if(super(t,n),this.dataWidth=r,this.dataHeight=i,this.left=s,this.top=l,e.BYTES_PER_ELEMENT===4){const c=t*n,u=new Uint8ClampedArray(c);for(let g=0;g<c;g++){const w=e[g],E=w>>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<n)&&(t=new Uint8ClampedArray(n));const r=(e+this.top)*this.dataWidth+this.left;return K.arraycopy(this.luminances,r,t,0,n),t}getMatrix(){const e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.luminances;const n=e*t,r=new Uint8ClampedArray(n);let i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return K.arraycopy(this.luminances,i,r,0,n),r;for(let s=0;s<t;s++){const l=s*e;K.arraycopy(this.luminances,i,r,l,e),i+=this.dataWidth}return r}isCropSupported(){return!0}crop(e,t,n,r){return new Ri(this.luminances,n,r,this.dataWidth,this.dataHeight,this.left+e,this.top+t)}invert(){return new Re(this)}}class Ws extends V{static forName(e){return this.getCharacterSetECIByName(e)}}class Li{}Li.ISO_8859_1=V.ISO8859_1;class Ys{isCompact(){return this.compact}setCompact(e){this.compact=e}getSize(){return this.size}setSize(e){this.size=e}getLayers(){return this.layers}setLayers(e){this.layers=e}getCodeWords(){return this.codeWords}setCodeWords(e){this.codeWords=e}getMatrix(){return this.matrix}setMatrix(e){this.matrix=e}}class Gs{static singletonList(e){return[e]}static min(e,t){return e.sort(t)[0]}}class ll{constructor(e){this.previous=e}getPrevious(){return this.previous}}class or extends ll{constructor(e,t,n){super(e),this.value=t,this.bitCount=n}appendTo(e,t){e.appendBits(this.value,this.bitCount)}add(e,t){return new or(this,e,t)}addBinaryShift(e,t){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new or(this,e,t)}toString(){let e=this.value&(1<<this.bitCount)-1;return e|=1<<this.bitCount,"<"+se.toBinaryString(e|1<<this.bitCount).substring(1)+">"}}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;n<this.binaryShiftByteCount;n++)(n===0||n===31&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?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.binaryShiftByteCount<e.binaryShiftByteCount?t+=cn.calculateBinaryShiftCost(e)-cn.calculateBinaryShiftCost(this):this.binaryShiftByteCount>e.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<g.length;E++)A[Xs][le.getCharCode(g[E])]=E;const w=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let E=0;E<w.length;E++)le.getCharCode(w[E])>0&&(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;i<this.text.length;i++){let s,l=i+1<this.text.length?this.text[i+1]:0;switch(this.text[i]){case le.getCharCode("\r"):s=l===t?2:0;break;case le.getCharCode("."):s=l===e?3:0;break;case le.getCharCode(","):s=l===e?4:0;break;case le.getCharCode(":"):s=l===e?5:0;break;default:s=0}s>0?(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<O.length;W++)O[W]=W}else{B=N+1+2*se.truncDivision(se.truncDivision(N,2)-1,15);let W=se.truncDivision(N,2),Me=se.truncDivision(B,2);for(let Ce=0;Ce<W;Ce++){let vt=Ce+se.truncDivision(Ce,15);O[W-Ce-1]=Me-vt-1,O[W+Ce]=Me+vt+1}}let X=new et(B);for(let W=0,Me=0;W<c;W++){let Ce=(c-W)*4+(l?9:12);for(let vt=0;vt<Ce;vt++){let qt=vt*2;for(let Pt=0;Pt<2;Pt++)E.get(Me+qt+Pt)&&X.set(O[W*2+Pt],O[W*2+vt]),E.get(Me+Ce*2+qt+Pt)&&X.set(O[W*2+vt],O[N-1-W*2-Pt]),E.get(Me+Ce*4+qt+Pt)&&X.set(O[N-1-W*2-Pt],O[N-1-W*2-vt]),E.get(Me+Ce*6+qt+Pt)&&X.set(O[N-1-W*2-vt],O[W*2+Pt])}Me+=Ce*8}if(Be.drawModeMessage(X,l,B,y),l)Be.drawBullsEye(X,se.truncDivision(B,2),5);else{Be.drawBullsEye(X,se.truncDivision(B,2),7);for(let W=0,Me=0;W<se.truncDivision(N,2)-1;W+=15,Me+=16)for(let Ce=se.truncDivision(B,2)&1;Ce<B;Ce+=2)X.set(se.truncDivision(B,2)-Me,Ce),X.set(se.truncDivision(B,2)+Me,Ce),X.set(Ce,se.truncDivision(B,2)-Me),X.set(Ce,se.truncDivision(B,2)+Me)}let Z=new Ys;return Z.setCompact(l),Z.setSize(B),Z.setLayers(c),Z.setCodeWords(I),Z.setMatrix(X),Z}static drawBullsEye(e,t,n){for(let r=0;r<n;r+=2)for(let i=t-r;i<=t+r;i++)e.set(i,t-r),e.set(i,t+r),e.set(t-r,i),e.set(t+r,i);e.set(t-n,t-n),e.set(t-n+1,t-n),e.set(t-n,t-n+1),e.set(t+n,t-n),e.set(t+n,t-n+1),e.set(t+n,t+n-1)}static generateModeMessage(e,t,n){let r=new Ee;return e?(r.appendBits(t-1,2),r.appendBits(n-1,6),r=Be.generateCheckWords(r,28,4)):(r.appendBits(t-1,5),r.appendBits(n-1,11),r=Be.generateCheckWords(r,40,4)),r}static drawModeMessage(e,t,n,r){let i=se.truncDivision(n,2);if(t)for(let s=0;s<7;s++){let l=i-3+s;r.get(s)&&e.set(l,i-5),r.get(s+7)&&e.set(i+5,l),r.get(20-s)&&e.set(l,i+5),r.get(27-s)&&e.set(i-5,l)}else for(let s=0;s<10;s++){let l=i-5+s+se.truncDivision(s,5);r.get(s)&&e.set(l,i-7),r.get(s+10)&&e.set(i+7,l),r.get(29-s)&&e.set(l,i+7),r.get(39-s)&&e.set(i-7,l)}}static generateCheckWords(e,t,n){let r=e.getSize()/n,i=new Di(Be.getGF(n)),s=se.truncDivision(t,n),l=Be.bitsToWords(e,n,s);i.encode(l,s-r);let c=t%n,u=new Ee;u.appendBits(0,c);for(const g of Array.from(l))u.appendBits(g,n);return u}static bitsToWords(e,t,n){let r=new Int32Array(n),i,s;for(i=0,s=e.getSize()/t;i<s;i++){let l=0;for(let c=0;c<t;c++)l|=e.get(i*t+c)?1<<t-c-1:0;r[i]=l}return r}static getGF(e){switch(e){case 4:return Oe.AZTEC_PARAM;case 6:return Oe.AZTEC_DATA_6;case 8:return Oe.AZTEC_DATA_8;case 10:return Oe.AZTEC_DATA_10;case 12:return Oe.AZTEC_DATA_12;default:throw new M("Unsupported word size "+e)}}static stuffBits(e,t){let n=new Ee,r=e.getSize(),i=(1<<t)-2;for(let s=0;s<r;s+=t){let l=0;for(let c=0;c<t;c++)(s+c>=r||e.get(s+c))&&(l|=1<<t-1-c);(l&i)===i?(n.appendBits(l&i,t),s--):(l&i)===0?(n.appendBits(l|1,t),s--):n.appendBits(l,t)}return n}static totalBitsInLayer(e,t){return((t?88:112)+16*e)*e}}Be.DEFAULT_EC_PERCENT=33,Be.DEFAULT_AZTEC_LAYERS=0,Be.MAX_NB_BITS=32,Be.MAX_NB_BITS_COMPACT=4,Be.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class qr{encode(e,t,n,r){return this.encodeWithHints(e,t,n,r,null)}encodeWithHints(e,t,n,r,i){let s=Li.ISO_8859_1,l=Be.DEFAULT_EC_PERCENT,c=Be.DEFAULT_AZTEC_LAYERS;return i!=null&&(i.has(gt.CHARACTER_SET)&&(s=Ws.forName(i.get(gt.CHARACTER_SET).toString())),i.has(gt.ERROR_CORRECTION)&&(l=se.parseInt(i.get(gt.ERROR_CORRECTION).toString())),i.has(gt.AZTEC_LAYERS)&&(c=se.parseInt(i.get(gt.AZTEC_LAYERS).toString()))),qr.encodeLayers(e,t,n,r,s,l,c)}static encodeLayers(e,t,n,r,i,s,l){if(t!==de.AZTEC)throw new M("Can only encode AZTEC, but got "+t);let c=Be.encode(le.getBytes(e,i),s,l);return qr.renderResult(c,n,r)}static renderResult(e,t,n){let r=e.getMatrix();if(r==null)throw new _;let i=r.getWidth(),s=r.getHeight(),l=Math.max(t,i),c=Math.max(n,s),u=Math.min(l/i,c/s),g=(l-i*u)/2,w=(c-s*u)/2,E=new et(l,c);for(let I=0,y=w;I<s;I++,y+=u)for(let N=0,O=g;N<i;N++,O+=u)r.get(N,I)&&E.setRegion(O,y,u,u);return E}}f.ArgumentException=S,f.ArithmeticException=In,f.AztecCode=Ys,f.AztecCodeReader=He,f.AztecCodeWriter=qr,f.AztecDecoder=P,f.AztecDetector=Ue,f.AztecDetectorResult=Y,f.AztecEncoder=Be,f.AztecHighLevelEncoder=Mr,f.AztecPoint=Te,f.BarcodeFormat=de,f.Binarizer=ne,f.BinaryBitmap=j,f.BitArray=Ee,f.BitMatrix=et,f.BitSource=bi,f.BrowserAztecCodeReader=kt,f.BrowserBarcodeReader=Wa,f.BrowserCodeReader=Dt,f.BrowserDatamatrixCodeReader=Ga,f.BrowserMultiFormatReader=rl,f.BrowserPDF417Reader=il,f.BrowserQRCodeReader=sl,f.BrowserQRCodeSvgWriter=jn,f.CharacterSetECI=V,f.ChecksumException=U,f.Code128Reader=q,f.Code39Reader=tt,f.DataMatrixDecodedBitStreamParser=Sn,f.DataMatrixReader=bn,f.DecodeHintType=me,f.DecoderResult=nn,f.DefaultGridSampler=we,f.DetectorResult=Q,f.EAN13Reader=Pn,f.EncodeHintType=gt,f.Exception=m,f.FormatException=G,f.GenericGF=Oe,f.GenericGFPoly=ut,f.GlobalHistogramBinarizer=ot,f.GridSampler=ie,f.GridSamplerInstance=pe,f.HTMLCanvasElementLuminanceSource=xt,f.HybridBinarizer=he,f.ITFReader=je,f.IllegalArgumentException=M,f.IllegalStateException=_,f.InvertedLuminanceSource=Re,f.LuminanceSource=We,f.MathUtils=H,f.MultiFormatOneDReader=rr,f.MultiFormatReader=zs,f.MultiFormatWriter=al,f.NotFoundException=F,f.OneDReader=Ze,f.PDF417DecodedBitStreamParser=L,f.PDF417DecoderErrorCorrection=Fs,f.PDF417Reader=pt,f.PDF417ResultMetadata=Us,f.PerspectiveTransform=re,f.PlanarYUVLuminanceSource=an,f.QRCodeByteMatrix=Kr,f.QRCodeDataMask=zt,f.QRCodeDecodedBitStreamParser=st,f.QRCodeDecoderErrorCorrectionLevel=qe,f.QRCodeDecoderFormatInformation=Nt,f.QRCodeEncoder=nt,f.QRCodeEncoderQRCode=Hn,f.QRCodeMaskUtil=lt,f.QRCodeMatrixUtil=xe,f.QRCodeMode=ge,f.QRCodeReader=yn,f.QRCodeVersion=ce,f.QRCodeWriter=sr,f.RGBLuminanceSource=Ri,f.RSS14Reader=at,f.RSSExpandedReader=z,f.ReaderException=Zr,f.ReedSolomonDecoder=v,f.ReedSolomonEncoder=Di,f.ReedSolomonException=b,f.Result=rt,f.ResultMetadataType=Ye,f.ResultPoint=R,f.StringUtils=le,f.UnsupportedOperationException=ve,f.VideoInputDevice=qn,f.WhiteRectangleDetector=oe,f.WriterException=Ke,f.ZXingArrays=$,f.ZXingCharset=Ws,f.ZXingInteger=se,f.ZXingStandardCharsets=Li,f.ZXingStringBuilder=Ie,f.ZXingStringEncoding=ze,f.ZXingSystem=K,Object.defineProperty(f,"__esModule",{value:!0})})})(Je,Je.exports);var Xc=Gc(Je.exports),Zc=Al({__proto__:null,default:Xc},[Je.exports]),Kc=function(){function o(a,f,h){if(this.formatMap=new Map([[te.QR_CODE,Je.exports.BarcodeFormat.QR_CODE],[te.AZTEC,Je.exports.BarcodeFormat.AZTEC],[te.CODABAR,Je.exports.BarcodeFormat.CODABAR],[te.CODE_39,Je.exports.BarcodeFormat.CODE_39],[te.CODE_93,Je.exports.BarcodeFormat.CODE_93],[te.CODE_128,Je.exports.BarcodeFormat.CODE_128],[te.DATA_MATRIX,Je.exports.BarcodeFormat.DATA_MATRIX],[te.MAXICODE,Je.exports.BarcodeFormat.MAXICODE],[te.ITF,Je.exports.BarcodeFormat.ITF],[te.EAN_13,Je.exports.BarcodeFormat.EAN_13],[te.EAN_8,Je.exports.BarcodeFormat.EAN_8],[te.PDF_417,Je.exports.BarcodeFormat.PDF_417],[te.RSS_14,Je.exports.BarcodeFormat.RSS_14],[te.RSS_EXPANDED,Je.exports.BarcodeFormat.RSS_EXPANDED],[te.UPC_A,Je.exports.BarcodeFormat.UPC_A],[te.UPC_E,Je.exports.BarcodeFormat.UPC_E],[te.UPC_EAN_EXTENSION,Je.exports.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!Zc)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=f,this.logger=h;var d=this.createZXingFormats(a),x=new Map;x.set(Je.exports.DecodeHintType.POSSIBLE_FORMATS,d),this.hints=x}return o.prototype.decodeAsync=function(a){var f=this;return new Promise(function(h,d){try{h(f.decode(a))}catch(x){d(x)}})},o.prototype.decode=function(a){var f=new Je.exports.MultiFormatReader(this.verbose,this.hints),h=new Je.exports.HTMLCanvasElementLuminanceSource(a),d=new Je.exports.BinaryBitmap(new Je.exports.HybridBinarizer(h)),x=f.decode(d);return{text:x.text,format:Ba.create(this.toHtml5QrcodeSupportedFormats(x.format))}},o.prototype.createReverseFormatMap=function(){var a=new Map;return this.formatMap.forEach(function(f,h,d){a.set(f,h)}),a},o.prototype.toHtml5QrcodeSupportedFormats=function(a){if(!this.reverseFormatMap.has(a))throw"reverseFormatMap doesn't have "+a;return this.reverseFormatMap.get(a)},o.prototype.createZXingFormats=function(a){for(var f=[],h=0,d=a;h<d.length;h++){var x=d[h];this.formatMap.has(x)?f.push(this.formatMap.get(x)):this.logger.logError(x+" is not supported byZXingHtml5QrcodeShim")}return f},o}(),Qc=globalThis&&globalThis.__awaiter||function(o,a,f,h){function d(x){return x instanceof f?x:new f(function(p){p(x)})}return new(f||(f=Promise))(function(x,p){function T(M){try{S(h.next(M))}catch(j){p(j)}}function m(M){try{S(h.throw(M))}catch(j){p(j)}}function S(M){M.done?x(M.value):d(M.value).then(T,m)}S((h=h.apply(o,a||[])).next())})},qc=globalThis&&globalThis.__generator||function(o,a){var f={label:0,sent:function(){if(x[0]&1)throw x[1];return x[1]},trys:[],ops:[]},h,d,x,p;return p={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function T(S){return function(M){return m([S,M])}}function m(S){if(h)throw new TypeError("Generator is already executing.");for(;f;)try{if(h=1,d&&(x=S[0]&2?d.return:S[0]?d.throw||((x=d.return)&&x.call(d),0):d.next)&&!(x=x.call(d,S[1])).done)return x;switch(d=0,x&&(S=[S[0]&2,x.value]),S[0]){case 0:case 1:x=S;break;case 4:return f.label++,{value:S[1],done:!1};case 5:f.label++,d=S[1],S=[0];continue;case 7:S=f.ops.pop(),f.trys.pop();continue;default:if(x=f.trys,!(x=x.length>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]<x[3])){f.label=S[1];break}if(S[0]===6&&f.label<x[1]){f.label=x[1],x=S;break}if(x&&f.label<x[2]){f.label=x[2],f.ops.push(S);break}x[2]&&f.ops.pop(),f.trys.pop();continue}S=a.call(o,f)}catch(M){S=[6,M],d=0}finally{h=x=0}if(S[0]&5)throw S[1];return{value:S[0]?S[1]:void 0,done:!0}}},yo=function(){function o(a,f,h){if(this.formatMap=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.ITF,"itf"],[te.EAN_13,"ean_13"],[te.EAN_8,"ean_8"],[te.PDF_417,"pdf417"],[te.UPC_A,"upc_a"],[te.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!o.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=f,this.logger=h;var d=this.createBarcodeDetectorFormats(a);if(this.detector=new BarcodeDetector(d),!this.detector)throw"BarcodeDetector detector not supported"}return o.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var a=new BarcodeDetector({formats:["qr_code"]});return typeof a!="undefined"},o.prototype.decodeAsync=function(a){return Qc(this,void 0,void 0,function(){var f,h;return qc(this,function(d){switch(d.label){case 0:return[4,this.detector.detect(a)];case 1:if(f=d.sent(),!f||f.length===0)throw"No barcode or QR code detected.";return h=this.selectLargestBarcode(f),[2,{text:h.rawValue,format:Ba.create(this.toHtml5QrcodeSupportedFormats(h.format))}]}})})},o.prototype.selectLargestBarcode=function(a){for(var f=null,h=0,d=0,x=a;d<x.length;d++){var p=x[d],T=p.boundingBox.width*p.boundingBox.height;T>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<d.length;h++){var x=d[h];this.formatMap.has(x)?f.push(this.formatMap.get(x)):this.logger.warn(x+" is not supported byBarcodeDetectorDelegate")}return{formats:f}},o.prototype.toHtml5QrcodeSupportedFormats=function(a){if(!this.reverseFormatMap.has(a))throw"reverseFormatMap doesn't have "+a;return this.reverseFormatMap.get(a)},o.prototype.createReverseFormatMap=function(){var a=new Map;return this.formatMap.forEach(function(f,h,d){a.set(f,h)}),a},o}(),Jc=function(){function o(a,f,h,d){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.verbose=f,d.useBarCodeDetectorIfSupported===!0&&yo.isSupported()?this.decoder=new yo(a,f,h):this.decoder=new Kc(a,f,h)}return o.prototype.decodeAsync=function(a){var f=this,h=performance.now();return this.decoder.decodeAsync(a).finally(function(){if(f.verbose){var d=performance.now()-h;f.executionResults.push(d),f.executions++,f.possiblyFlushPerformanceReport()}})},o.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var a=0,f=0,h=this.executionResults;f<h.length;f++){var d=h[f];a+=d}var x=a/this.executionResults.length;console.log(x+" ms for "+this.executionResults.length+" last runs."),this.executions=0,this.executionResults=[]}},o}(),$c=function(){function o(){}return o.createExperimentalFeaturesConfig=function(a){return a?(a.useBarCodeDetectorIfSupported!==!0&&(a.useBarCodeDetectorIfSupported=!1),a):{useBarCodeDetectorIfSupported:!1}},o}(),ct;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.NOT_STARTED=1]="NOT_STARTED",o[o.SCANNING=2]="SCANNING",o[o.PAUSED=3]="PAUSED"})(ct||(ct={}));var e0=function(){function o(){this.state=ct.NOT_STARTED,this.onGoingTransactionNewState=ct.UNKNOWN}return o.prototype.directTransition=function(a){this.failIfTransitionOngoing(),this.validateTransition(a),this.state=a},o.prototype.startTransition=function(a){return this.failIfTransitionOngoing(),this.validateTransition(a),this.onGoingTransactionNewState=a,this},o.prototype.execute=function(){if(this.onGoingTransactionNewState===ct.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var a=this.onGoingTransactionNewState;this.onGoingTransactionNewState=ct.UNKNOWN,this.directTransition(a)},o.prototype.cancel=function(){if(this.onGoingTransactionNewState===ct.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=ct.UNKNOWN},o.prototype.getState=function(){return this.state},o.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==ct.UNKNOWN)throw"Cannnot transition to a new state, already under transition"},o.prototype.validateTransition=function(a){switch(this.state){case ct.UNKNOWN:throw"Transition from unknown is not allowed";case ct.NOT_STARTED:this.failIfNewStateIs(a,[ct.PAUSED]);break;case ct.SCANNING:break;case ct.PAUSED:break}},o.prototype.failIfNewStateIs=function(a,f){for(var h=0,d=f;h<d.length;h++){var x=d[h];if(a===x)throw"Cannot transition from "+this.state+" to "+a}},o}(),t0=function(){function o(a){this.stateManager=a}return o.prototype.startTransition=function(a){return this.stateManager.startTransition(a)},o.prototype.directTransition=function(a){this.stateManager.directTransition(a)},o.prototype.getState=function(){return this.stateManager.getState()},o.prototype.canScanFile=function(){return this.stateManager.getState()===ct.NOT_STARTED},o.prototype.isScanning=function(){return this.stateManager.getState()!==ct.NOT_STARTED},o.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===ct.SCANNING},o.prototype.isPaused=function(){return this.stateManager.getState()===ct.PAUSED},o}(),n0=function(){function o(){}return o.create=function(){return new t0(new e0)},o}(),r0=globalThis&&globalThis.__extends||function(){var o=function(a,f){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var x in d)Object.prototype.hasOwnProperty.call(d,x)&&(h[x]=d[x])},o(a,f)};return function(a,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");o(a,f);function h(){this.constructor=a}a.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}}(),Xt=function(o){r0(a,o);function a(){return o!==null&&o.apply(this,arguments)||this}return a.DEFAULT_WIDTH=300,a.DEFAULT_WIDTH_OFFSET=2,a.FILE_SCAN_MIN_HEIGHT=300,a.MIN_QR_BOX_SIZE=50,a.SHADED_LEFT=1,a.SHADED_RIGHT=2,a.SHADED_TOP=3,a.SHADED_BOTTOM=4,a.SHADED_REGION_ELEMENT_ID="qr-shaded-region",a.VERBOSE=!1,a.BORDER_SHADER_DEFAULT_COLOR="#ffffff",a.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",a}(dn),i0=function(){function o(a,f){this.logger=f,this.fps=Xt.SCAN_DEFAULT_FPS,a?(a.fps&&(this.fps=a.fps),this.disableFlip=a.disableFlip===!0,this.qrbox=a.qrbox,this.aspectRatio=a.aspectRatio,this.videoConstraints=a.videoConstraints):this.disableFlip=Xt.DEFAULT_DISABLE_FLIP}return o.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?Fa.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},o.prototype.isShadedBoxEnabled=function(){return!hr(this.qrbox)},o.create=function(a,f){return new o(a,f)},o}(),No=function(){function o(a,f){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.videoElement=null,this.localMediaStream=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(a))throw"HTML Element with id="+a+" not found";this.elementId=a,this.verbose=!1;var h;typeof f=="boolean"?this.verbose=f===!0:f&&(this.verbose=f.verbose===!0,h=f.experimentalFeatures),this.logger=new Pa(this.verbose),this.qrcode=new Jc(this.getSupportedFormats(f),this.verbose,this.logger,$c.createExperimentalFeaturesConfig(h)),this.foreverScanTimeout,this.localMediaStream,this.shouldScan=!0,this.stateManagerProxy=n0.create()}return o.prototype.start=function(a,f,h,d){if(!a)throw"cameraIdOrConfig is required";if(!h||typeof h!="function")throw"qrCodeSuccessCallback is required and should be a function.";d||(d=this.verbose?this.logger.log:function(){});var x=i0.create(f,this.logger);this.clearElement();var p=!1;x.videoConstraints&&(x.isMediaStreamConstraintsValid()?p=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var T=p;x.isShadedBoxEnabled();var m=document.getElementById(this.elementId),S=m.clientWidth?m.clientWidth:Xt.DEFAULT_WIDTH;m.style.position="relative",this.shouldScan=!0,this.element=m;var M=this,j=this.stateManagerProxy.startTransition(ct.SCANNING);return new Promise(function(U,ne){var K=T?x.videoConstraints:M.createVideoConstraints(a);if(!K){j.cancel(),ne("videoConstraints should be defined");return}navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia({audio:!1,video:K}).then(function(fe){M.onMediaStreamReceived(fe,x,T,S,h,d).then(function(ue){j.execute(),M.isScanning=!0,U(null)}).catch(function(ue){j.cancel(),ne(ue)})}).catch(function(fe){j.cancel(),ne(Or.errorGettingUserMedia(fe))}):(j.cancel(),ne(Or.cameraStreamingNotSupported()))})},o.prototype.pause=function(a){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(ct.PAUSED),this.showPausedState(),(hr(a)||a!==!0)&&(a=!1),a&&this.videoElement&&this.videoElement.pause()},o.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.videoElement)throw"VideoElement doesn't exist while trying resume()";var a=this,f=function(){a.stateManagerProxy.directTransition(ct.SCANNING),a.hidePausedState()},h=this.videoElement.paused;if(!h){f();return}var d=function(){var x;setTimeout(f,200),(x=a.videoElement)===null||x===void 0||x.removeEventListener("playing",d)};this.videoElement.addEventListener("playing",d),this.videoElement.play()},o.prototype.getState=function(){return this.stateManagerProxy.getState()},o.prototype.stop=function(){var a=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var f=this.stateManagerProxy.startTransition(ct.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var h=function(){if(!!a.element){var d=document.getElementById(Xt.SHADED_REGION_ELEMENT_ID);d&&a.element.removeChild(d)}};return new Promise(function(d,x){var p=function(){a.localMediaStream=null,a.element&&(a.element.removeChild(a.videoElement),a.element.removeChild(a.canvasElement)),h(),a.qrRegion&&(a.qrRegion=null),a.context&&(a.context=null),f.execute(),a.hidePausedState(),a.isScanning=!1,d()};a.localMediaStream||p();var T=a.localMediaStream.getVideoTracks().length,m=0;a.localMediaStream.getVideoTracks().forEach(function(S){a.localMediaStream.removeTrack(S),S.stop(),++m,m>=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;T<m.length;T++){var S=m[T];S.enabled=!1,S.stop(),x.removeTrack(S)}};navigator.mediaDevices.enumerateDevices().then(function(x){for(var p=[],T=0,m=x;T<m.length;T++){var S=m[T];S.kind==="videoinput"&&p.push({id:S.deviceId,label:S.label})}d(h),a(p)}).catch(function(x){f(x.name+" : "+x.message)})}).catch(function(h){f(h.name+" : "+h.message)})})},o.getCamerasFromMediaStreamTrack=function(){return new Promise(function(a,f){var h=function(x){for(var p=[],T=0,m=x;T<m.length;T++){var S=m[T];S.kind==="video"&&p.push({id:S.id,label:S.label})}a(p)},d=MediaStreamTrack;d.getSources(h)})},o.prototype.getSupportedFormats=function(a){var f=[te.QR_CODE,te.AZTEC,te.CODABAR,te.CODE_39,te.CODE_93,te.CODE_128,te.DATA_MATRIX,te.MAXICODE,te.ITF,te.EAN_13,te.EAN_8,te.PDF_417,te.RSS_14,te.RSS_EXPANDED,te.UPC_A,te.UPC_E,te.UPC_EAN_EXTENSION];if(!a||typeof a=="boolean"||!a.formatsToSupport)return f;if(!Array.isArray(a.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(a.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var h=[],d=0,x=a.formatsToSupport;d<x.length;d++){var p=x[d];Yc(p)?h.push(p):this.logger.warn("Invalid format: "+p+" passed in config, ignoring.")}if(h.length===0)throw"None of formatsToSupport match supported values.";return h},o.prototype.validateQrboxSize=function(a,f,h){var d=this,x=h.qrbox;this.validateQrboxConfig(x);var p=this.toQrdimensions(a,f,x),T=function(S){if(S<Xt.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+(" "+Xt.MIN_QR_BOX_SIZE+"px.")},m=function(S){return S>a&&(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;a<f.length;a++){var h=f[a];if(o.isCameraScanType(h))return!0}return!1},o.isCameraScanType=function(a){return a===vn.SCAN_TYPE_CAMERA},o.isFileScanType=function(a){return a===vn.SCAN_TYPE_FILE},o.prototype.validateAndReturnScanTypes=function(a){if(!a||a.length===0)return dn.DEFAULT_SUPPORTED_SCAN_TYPE;var f=dn.DEFAULT_SUPPORTED_SCAN_TYPE.length;if(a.length>f)throw"Max "+f+" values expected for supportedScanTypes";for(var h=0,d=a;h<d.length;h++){var x=d[h];if(!dn.DEFAULT_SUPPORTED_SCAN_TYPE.includes(x))throw"Unsupported scan type "+x}return a},o}(),Zt;(function(o){o[o.STATUS_DEFAULT=0]="STATUS_DEFAULT",o[o.STATUS_SUCCESS=1]="STATUS_SUCCESS",o[o.STATUS_WARNING=2]="STATUS_WARNING",o[o.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(Zt||(Zt={}));function h0(o){return{fps:o.fps,qrbox:o.qrbox,aspectRatio:o.aspectRatio,disableFlip:o.disableFlip,videoConstraints:o.videoConstraints}}function d0(o,a){return{formatsToSupport:o.formatsToSupport,experimentalFeatures:o.experimentalFeatures,verbose:a}}var g0=function(){function o(a,f,h){if(this.lastMatchFound=null,this.cameraScanImage=null,this.fileScanImage=null,this.elementId=a,this.config=this.createConfig(f),this.verbose=h===!0,!document.getElementById(a))throw"HTML Element with id="+a+" not found";this.scanTypeSelector=new xn(this.config.supportedScanTypes),this.currentScanType=this.scanTypeSelector.getDefaultScanType(),this.sectionSwapAllowed=!0,this.logger=new Pa(this.verbose),this.persistedDataManager=new l0,f.rememberLastUsedCamera!==!0&&this.persistedDataManager.reset()}return o.prototype.render=function(a,f){var h=this;this.lastMatchFound=null,this.qrCodeSuccessCallback=function(x,p){if(a)a(x,p);else{if(h.lastMatchFound===x)return;h.lastMatchFound=x,h.setHeaderMessage(Jt.lastMatch(x),Zt.STATUS_SUCCESS)}},this.qrCodeErrorCallback=function(x,p){f&&f(x,p)};var d=document.getElementById(this.elementId);if(!d)throw"HTML Element with id="+this.elementId+" not found";d.innerHTML="",this.createBasicLayout(d),this.html5Qrcode=new No(this.getScanRegionId(),d0(this.config,this.verbose))},o.prototype.pause=function(a){if(!this.html5Qrcode)throw"Code scanner not initialized.";(hr(a)||a!==!0)&&(a=!1),this.html5Qrcode.pause(a)},o.prototype.resume=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";this.html5Qrcode.resume()},o.prototype.getState=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode.getState()},o.prototype.clear=function(){var a=this,f=function(){var h=document.getElementById(a.elementId);h&&(h.innerHTML="",a.resetBasicLayout(h))};return this.html5Qrcode?new Promise(function(h,d){if(!a.html5Qrcode){h();return}a.html5Qrcode.isScanning?a.html5Qrcode.stop().then(function(x){if(!a.html5Qrcode){h();return}a.html5Qrcode.clear(),f(),h()}).catch(function(x){a.verbose&&a.logger.logError("Unable to stop qrcode scanner",x),d(x)}):(a.html5Qrcode.clear(),f())}):Promise.resolve()},o.prototype.getRunningTrackCapabilities=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode.getRunningTrackCapabilities()},o.prototype.applyVideoConstraints=function(a){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode.applyVideoConstraints(a)},o.prototype.createConfig=function(a){return a?(a.fps||(a.fps=dn.SCAN_DEFAULT_FPS),a.rememberLastUsedCamera!==!dn.DEFAULT_REMEMBER_LAST_CAMERA_USED&&(a.rememberLastUsedCamera=dn.DEFAULT_REMEMBER_LAST_CAMERA_USED),a):{fps:dn.SCAN_DEFAULT_FPS,rememberLastUsedCamera:dn.DEFAULT_REMEMBER_LAST_CAMERA_USED,supportedScanTypes:dn.DEFAULT_SUPPORTED_SCAN_TYPE}},o.prototype.createBasicLayout=function(a){a.style.position="relative",a.style.padding="0px",a.style.border="1px solid silver",this.createHeader(a);var f=document.createElement("div"),h=this.getScanRegionId();f.id=h,f.style.width="100%",f.style.minHeight="100px",f.style.textAlign="center",a.appendChild(f),xn.isCameraScanType(this.currentScanType)?this.insertCameraScanImageToScanRegion():this.insertFileScanImageToScanRegion();var d=document.createElement("div"),x=this.getDashboardId();d.id=x,d.style.width="100%",a.appendChild(d),this.setupInitialDashboard(d)},o.prototype.resetBasicLayout=function(a){a.style.border="none"},o.prototype.setupInitialDashboard=function(a){this.createSection(a),this.createSectionControlPanel(),this.scanTypeSelector.hasMoreThanOneScanType()&&this.createSectionSwap()},o.prototype.createHeader=function(a){var f=document.createElement("div");f.style.textAlign="left",f.style.margin="0px",a.appendChild(f);var h=new u0;h.renderInto(f);var d=document.createElement("div");d.id=this.getHeaderMessageContainerId(),d.style.display="none",d.style.textAlign="center",d.style.fontSize="14px",d.style.padding="2px 10px",d.style.margin="4px",d.style.borderTop="1px solid #f6f6f6",f.appendChild(d)},o.prototype.createSection=function(a){var f=document.createElement("div");f.id=this.getDashboardSectionId(),f.style.width="100%",f.style.padding="10px 0px 10px 0px",f.style.textAlign="left",a.appendChild(f)},o.prototype.createCameraListUi=function(a,f,h){var d=this;d.setHeaderMessage(Jt.cameraPermissionRequesting());var x=function(){h||d.createPermissionButton(a,f)};No.getCameras().then(function(p){d.persistedDataManager.setHasPermission(!0),d.resetHeaderMessage(),p&&p.length>0?(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<j.length;M++){var U=j[M],ne=U.id,K=U.label==null?ne:U.label,fe=document.createElement("option");fe.value=ne,fe.innerText=K,S.push(fe),T.appendChild(fe)}x.appendChild(T),d.appendChild(x);var ue=document.createElement("span"),$=document.createElement("button");$.innerText=Jt.scanButtonStartScanningText(),ue.appendChild($);var se=document.createElement("button");se.innerText=Jt.scanButtonStopScanningText(),se.style.display="none",se.disabled=!0,ue.appendChild(se),d.appendChild(ue);var Ee=function(V){V||($.style.display="none"),$.innerText=Jt.scanButtonStartScanningText(),$.style.opacity="1",$.disabled=!1,V&&($.style.display="inline-block")};if($.addEventListener("click",function(V){$.innerText=Jt.scanButtonScanningStarting(),T.disabled=!0,$.disabled=!0,$.style.opacity="0.5",f.scanTypeSelector.hasMoreThanOneScanType()&&h.showHideScanTypeSwapLink(!1),h.resetHeaderMessage();var ve=T.value;h.persistedDataManager.setLastUsedCameraId(ve),h.html5Qrcode.start(ve,h0(h.config),h.qrCodeSuccessCallback,h.qrCodeErrorCallback).then(function(ze){se.disabled=!1,se.style.display="inline-block",Ee(!1)}).catch(function(ze){h.showHideScanTypeSwapLink(!0),T.disabled=!1,Ee(!0),h.setHeaderMessage(ze,Zt.STATUS_WARNING)})}),p===1&&$.click(),se.addEventListener("click",function(V){if(!h.html5Qrcode)throw"html5Qrcode not defined";se.disabled=!0,h.html5Qrcode.stop().then(function(ve){f.scanTypeSelector.hasMoreThanOneScanType()&&h.showHideScanTypeSwapLink(!0),T.disabled=!1,$.disabled=!1,se.style.display="none",$.style.display="inline-block",h.insertCameraScanImageToScanRegion()}).catch(function(ve){se.disabled=!1,h.setHeaderMessage(ve,Zt.STATUS_WARNING)})}),h.persistedDataManager.getLastUsedCameraId()){for(var Xe=h.persistedDataManager.getLastUsedCameraId(),me=!1,G=0,ae=S;G<ae.length;G++){var fe=ae[G];if(fe.value===Xe){me=!0;break}}me?(T.value=Xe,$.click()):h.persistedDataManager.resetLastUsedCameraId()}},o.prototype.createSectionSwap=function(){var a=this,f=Jt.textIfCameraScanSelected(),h=Jt.textIfFileScanSelected(),d=document.getElementById(this.getDashboardSectionId()),x=document.createElement("div");x.style.textAlign="center";var p=document.createElement("a");p.style.textDecoration="underline",p.id=this.getDashboardSectionSwapLinkId(),p.innerText=xn.isCameraScanType(this.currentScanType)?f:h,p.addEventListener("click",function(){if(!a.sectionSwapAllowed){a.verbose&&a.logger.logError("Section swap called when not allowed");return}a.resetHeaderMessage(),a.getFileScanInput().value="",a.sectionSwapAllowed=!1,xn.isCameraScanType(a.currentScanType)?(a.clearScanRegion(),a.getFileScanInput().disabled=!1,a.getCameraScanRegion().style.display="none",a.getFileScanRegion().style.display="block",p.innerText=h,a.currentScanType=vn.SCAN_TYPE_FILE,a.insertFileScanImageToScanRegion()):(a.clearScanRegion(),a.getFileScanInput().disabled=!0,a.getCameraScanRegion().style.display="block",a.getFileScanRegion().style.display="none",p.innerText=f,a.currentScanType=vn.SCAN_TYPE_CAMERA,a.insertCameraScanImageToScanRegion(),a.startCameraScanIfPermissionExistsOnSwap()),a.sectionSwapAllowed=!0}),x.appendChild(p),d.appendChild(x)},o.prototype.startCameraScanIfPermissionExistsOnSwap=function(){var a=this,f=this;if(this.persistedDataManager.hasCameraPermissions()){Oo.hasCameraPermissions().then(function(h){if(h){var d=document.getElementById(f.getCameraPermissionButtonId());if(!d)throw a.logger.logError("Permission button not found, fail;"),"Permission button not found";d.click()}else f.persistedDataManager.setHasPermission(!1)}).catch(function(h){f.persistedDataManager.setHasPermission(!1)});return}},o.prototype.resetHeaderMessage=function(){var a=document.getElementById(this.getHeaderMessageContainerId());a.style.display="none"},o.prototype.setHeaderMessage=function(a,f){f||(f=Zt.STATUS_DEFAULT);var h=this.getHeaderMessageDiv();switch(h.innerText=a,h.style.display="block",f){case Zt.STATUS_SUCCESS:h.style.background="#6aaf5042",h.style.color="#477735";break;case Zt.STATUS_WARNING:h.style.background="#cb243124",h.style.color="#cb2431";break;case Zt.STATUS_DEFAULT:default:h.style.background="#00000000",h.style.color="rgb(17, 17, 17)";break}},o.prototype.showHideScanTypeSwapLink=function(a){a!==!0&&(a=!1),this.sectionSwapAllowed=a,this.getDashboardSectionSwapLink().style.display=a?"inline-block":"none"},o.prototype.insertCameraScanImageToScanRegion=function(){var a=this,f=document.getElementById(this.getScanRegionId());if(this.cameraScanImage){f.innerHTML="<br>",f.appendChild(this.cameraScanImage);return}this.cameraScanImage=new Image,this.cameraScanImage.onload=function(h){f.innerHTML="<br>",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="<br>",f.appendChild(this.fileScanImage);return}this.fileScanImage=new Image,this.fileScanImage.onload=function(h){f.innerHTML="<br>",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=`<a href="sms:1922&body=${p}">\u6309\u6211\u50B3\u9001\u7C21\u8A0A</a>`}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");