mirror of
https://github.com/Karaka-Management/Resources.git
synced 2026-01-11 13:28:40 +00:00
21 lines
404 KiB
JavaScript
21 lines
404 KiB
JavaScript
function Gr(r,t){t===void 0&&(t=r.constructor);var e=Error.captureStackTrace;e&&e(r,t)}var Kt,Wr=(Kt=function(r,t){return Kt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},Kt(r,t)},function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}Kt(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}),We=function(r){function t(e,n){var o,i,a,s=this.constructor,u=r.call(this,e,n)||this;return Object.defineProperty(u,"name",{value:s.name,enumerable:!1,configurable:!0}),o=u,i=s.prototype,(a=Object.setPrototypeOf)?a(o,i):o.__proto__=i,Gr(u),u}return Wr(t,r),t}(Error);var qt,_e,zr=(qt=function(r,t){return qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])},qt(r,t)},function(r,t){function e(){this.constructor=r}qt(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}),wt=function(r){function t(e){e===void 0&&(e=void 0);var n=r.call(this,e)||this;return n.message=e,n}return zr(t,r),t.prototype.getKind=function(){return this.constructor.kind},t.kind="Exception",t}(We),jr=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),mt=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return jr(t,r),t.kind="ArgumentException",t}(wt),Yr=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),N=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return Yr(t,r),t.kind="IllegalArgumentException",t}(wt),Zr=function(){function r(t){if(this.binarizer=t,t===null)throw new N("Binarizer must be non-null.")}return r.prototype.getWidth=function(){return this.binarizer.getWidth()},r.prototype.getHeight=function(){return this.binarizer.getHeight()},r.prototype.getBlackRow=function(t,e){return this.binarizer.getBlackRow(t,e)},r.prototype.getBlackMatrix=function(){return this.matrix!==null&&this.matrix!==void 0||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},r.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},r.prototype.crop=function(t,e,n,o){var i=this.binarizer.getLuminanceSource().crop(t,e,n,o);return new r(this.binarizer.createBinarizer(i))},r.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},r.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new r(this.binarizer.createBinarizer(t))},r.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new r(this.binarizer.createBinarizer(t))},r.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},r}(),Kr=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),at=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return Kr(t,r),t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t}(wt),qr=function(){function r(t){this.source=t}return r.prototype.getLuminanceSource=function(){return this.source},r.prototype.getWidth=function(){return this.source.getWidth()},r.prototype.getHeight=function(){return this.source.getHeight()},r}(),Z=function(){function r(){}return r.arraycopy=function(t,e,n,o,i){for(;i--;)n[o++]=t[e++]},r.currentTimeMillis=function(){return Date.now()},r}(),Qr=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Le=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return Qr(t,r),t.kind="IndexOutOfBoundsException",t}(wt),Jr=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ze=function(r){function t(e,n){e===void 0&&(e=void 0),n===void 0&&(n=void 0);var o=r.call(this,n)||this;return o.index=e,o.message=n,o}return Jr(t,r),t.kind="ArrayIndexOutOfBoundsException",t}(Le),$r=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$=function(){function r(){}return r.fill=function(t,e){for(var n=0,o=t.length;n<o;n++)t[n]=e},r.fillWithin=function(t,e,n,o){r.rangeCheck(t.length,e,n);for(var i=e;i<n;i++)t[i]=o},r.rangeCheck=function(t,e,n){if(e>n)throw new N("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new ze(e);if(n>t)throw new ze(n)},r.asList=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t},r.create=function(t,e,n){return Array.from({length:t}).map(function(o){return Array.from({length:e}).fill(n)})},r.createInt32Array=function(t,e,n){return Array.from({length:t}).map(function(o){return Int32Array.from({length:e}).fill(n)})},r.equals=function(t,e){if(!t||!e||!t.length||!e.length||t.length!==e.length)return!1;for(var n=0,o=t.length;n<o;n++)if(t[n]!==e[n])return!1;return!0},r.hashCode=function(t){var e,n;if(t===null)return 0;var o=1;try{for(var i=$r(t),a=i.next();!a.done;a=i.next())o=31*o+a.value}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return o},r.fillUint8Array=function(t,e){for(var n=0;n!==t.length;n++)t[n]=e},r.copyOf=function(t,e){return t.slice(0,e)},r.copyOfUint8Array=function(t,e){if(t.length<=e){var n=new Uint8Array(e);return n.set(t),n}return t.slice(0,e)},r.copyOfRange=function(t,e,n){var o=n-e,i=new Int32Array(o);return Z.arraycopy(t,e,i,0,o),i},r.binarySearch=function(t,e,n){n===void 0&&(n=r.numberComparator);for(var o=0,i=t.length-1;o<=i;){var a=i+o>>1,s=n(e,t[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},r.numberComparator=function(t,e){return t-e},r}(),P=function(){function r(){}return r.numberOfTrailingZeros=function(t){var e;if(t===0)return 32;var n=31;return(e=t<<16)!==0&&(n-=16,t=e),(e=t<<8)!==0&&(n-=8,t=e),(e=t<<4)!==0&&(n-=4,t=e),(e=t<<2)!==0&&(n-=2,t=e),n-(t<<1>>>31)},r.numberOfLeadingZeros=function(t){if(t===0)return 32;var e=1;return!(t>>>16)&&(e+=16,t<<=16),!(t>>>24)&&(e+=8,t<<=8),!(t>>>28)&&(e+=4,t<<=4),!(t>>>30)&&(e+=2,t<<=2),e-=t>>>31},r.toHexString=function(t){return t.toString(16)},r.toBinaryString=function(t){return String(parseInt(String(t),2))},r.bitCount=function(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,t+=t>>>8,63&(t+=t>>>16)},r.truncDivision=function(t,e){return Math.trunc(t/e)},r.parseInt=function(t,e){return e===void 0&&(e=void 0),parseInt(t,e)},r.MIN_VALUE_32_BITS=-2147483648,r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),st=function(){function r(t,e){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=e??r.makeArray(t))}return r.prototype.getSize=function(){return this.size},r.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},r.prototype.ensureCapacity=function(t){if(t>32*this.bits.length){var e=r.makeArray(t);Z.arraycopy(this.bits,0,e,0,this.bits.length),this.bits=e}},r.prototype.get=function(t){return(this.bits[Math.floor(t/32)]&1<<(31&t))!=0},r.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(31&t)},r.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(31&t)},r.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,o=Math.floor(t/32),i=n[o];i&=~((1<<(31&t))-1);for(var a=n.length;i===0;){if(++o===a)return e;i=n[o]}var s=32*o+P.numberOfTrailingZeros(i);return s>e?e:s},r.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,o=Math.floor(t/32),i=~n[o];i&=~((1<<(31&t))-1);for(var a=n.length;i===0;){if(++o===a)return e;i=~n[o]}var s=32*o+P.numberOfTrailingZeros(i);return s>e?e:s},r.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e},r.prototype.setRange=function(t,e){if(e<t||t<0||e>this.size)throw new N;if(e!==t){e--;for(var n=Math.floor(t/32),o=Math.floor(e/32),i=this.bits,a=n;a<=o;a++){var s=(2<<(a<o?31:31&e))-(1<<(a>n?0:31&t));i[a]|=s}}},r.prototype.clear=function(){for(var t=this.bits.length,e=this.bits,n=0;n<t;n++)e[n]=0},r.prototype.isRange=function(t,e,n){if(e<t||t<0||e>this.size)throw new N;if(e===t)return!0;e--;for(var o=Math.floor(t/32),i=Math.floor(e/32),a=this.bits,s=o;s<=i;s++){var u=(2<<(s<i?31:31&e))-(1<<(s>o?0:31&t))&4294967295;if((a[s]&u)!==(n?u:0))return!1}return!0},r.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},r.prototype.appendBits=function(t,e){if(e<0||e>32)throw new N("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(var n=e;n>0;n--)this.appendBit((t>>n-1&1)==1)},r.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var n=0;n<e;n++)this.appendBit(t.get(n))},r.prototype.xor=function(t){if(this.size!==t.size)throw new N("Sizes don't match");for(var e=this.bits,n=0,o=e.length;n<o;n++)e[n]^=t.bits[n]},r.prototype.toBytes=function(t,e,n,o){for(var i=0;i<o;i++){for(var a=0,s=0;s<8;s++)this.get(t)&&(a|=1<<7-s),t++;e[n+i]=a}},r.prototype.getBitArray=function(){return this.bits},r.prototype.reverse=function(){for(var t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),n=e+1,o=this.bits,i=0;i<n;i++){var a=o[i];a=(a=(a=(a=(a=a>>1&1431655765|(1431655765&a)<<1)>>2&858993459|(858993459&a)<<2)>>4&252645135|(252645135&a)<<4)>>8&16711935|(16711935&a)<<8)>>16&65535|(65535&a)<<16,t[e-i]=a}if(this.size!==32*n){var s=32*n-this.size,u=t[0]>>>s;for(i=1;i<n;i++){var c=t[i];u|=c<<32-s,t[i-1]=u,u=c>>>s}t[n-1]=u}this.bits=t},r.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.size===e.size&&$.equals(this.bits,e.bits)},r.prototype.hashCode=function(){return 31*this.size+$.hashCode(this.bits)},r.prototype.toString=function(){for(var t="",e=0,n=this.size;e<n;e++)!(7&e)&&(t+=" "),t+=this.get(e)?"X":".";return t},r.prototype.clone=function(){return new r(this.size,this.bits.slice())},r.prototype.toArray=function(){for(var t=[],e=0,n=this.size;e<n;e++)t.push(this.get(e));return t},r}();(function(r){r[r.OTHER=0]="OTHER",r[r.PURE_BARCODE=1]="PURE_BARCODE",r[r.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",r[r.TRY_HARDER=3]="TRY_HARDER",r[r.CHARACTER_SET=4]="CHARACTER_SET",r[r.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",r[r.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",r[r.ENABLE_CODE_39_EXTENDED_MODE=7]="ENABLE_CODE_39_EXTENDED_MODE",r[r.ASSUME_GS1=8]="ASSUME_GS1",r[r.RETURN_CODABAR_START_END=9]="RETURN_CODABAR_START_END",r[r.NEED_RESULT_POINT_CALLBACK=10]="NEED_RESULT_POINT_CALLBACK",r[r.ALLOWED_EAN_EXTENSIONS=11]="ALLOWED_EAN_EXTENSIONS"})(_e||(_e={}));var z,Q=_e,tn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),T=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return tn(t,r),t.getFormatInstance=function(){return new t},t.kind="FormatException",t}(wt),en=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(r){r[r.Cp437=0]="Cp437",r[r.ISO8859_1=1]="ISO8859_1",r[r.ISO8859_2=2]="ISO8859_2",r[r.ISO8859_3=3]="ISO8859_3",r[r.ISO8859_4=4]="ISO8859_4",r[r.ISO8859_5=5]="ISO8859_5",r[r.ISO8859_6=6]="ISO8859_6",r[r.ISO8859_7=7]="ISO8859_7",r[r.ISO8859_8=8]="ISO8859_8",r[r.ISO8859_9=9]="ISO8859_9",r[r.ISO8859_10=10]="ISO8859_10",r[r.ISO8859_11=11]="ISO8859_11",r[r.ISO8859_13=12]="ISO8859_13",r[r.ISO8859_14=13]="ISO8859_14",r[r.ISO8859_15=14]="ISO8859_15",r[r.ISO8859_16=15]="ISO8859_16",r[r.SJIS=16]="SJIS",r[r.Cp1250=17]="Cp1250",r[r.Cp1251=18]="Cp1251",r[r.Cp1252=19]="Cp1252",r[r.Cp1256=20]="Cp1256",r[r.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",r[r.UTF8=22]="UTF8",r[r.ASCII=23]="ASCII",r[r.Big5=24]="Big5",r[r.GB18030=25]="GB18030",r[r.EUC_KR=26]="EUC_KR"})(z||(z={}));var me,nt=function(){function r(t,e,n){for(var o,i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=t,this.name=n,this.values=typeof e=="number"?Int32Array.from([e]):e,this.otherEncodingNames=a,r.VALUE_IDENTIFIER_TO_ECI.set(t,this),r.NAME_TO_ECI.set(n,this);for(var u=this.values,c=0,f=u.length;c!==f;c++){var h=u[c];r.VALUES_TO_ECI.set(h,this)}try{for(var l=en(a),d=l.next();!d.done;d=l.next()){var p=d.value;r.NAME_TO_ECI.set(p,this)}}catch(y){o={error:y}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}}return r.prototype.getValueIdentifier=function(){return this.valueIdentifier},r.prototype.getName=function(){return this.name},r.prototype.getValue=function(){return this.values[0]},r.getCharacterSetECIByValue=function(t){if(t<0||t>=900)throw new T("incorect value");var e=r.VALUES_TO_ECI.get(t);if(e===void 0)throw new T("incorect value");return e},r.getCharacterSetECIByName=function(t){var e=r.NAME_TO_ECI.get(t);if(e===void 0)throw new T("incorect value");return e},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.getName()===e.getName()},r.VALUE_IDENTIFIER_TO_ECI=new Map,r.VALUES_TO_ECI=new Map,r.NAME_TO_ECI=new Map,r.Cp437=new r(z.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(z.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(z.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(z.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(z.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(z.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(z.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(z.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(z.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(z.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(z.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(z.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(z.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(z.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(z.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(z.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(z.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(z.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(z.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(z.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(z.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(z.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(z.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(z.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(z.Big5,28,"Big5"),r.GB18030=new r(z.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(z.EUC_KR,30,"EUC_KR","EUC-KR"),r}(),rn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ne=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return rn(t,r),t.kind="UnsupportedOperationException",t}(wt),At=function(){function r(){}return r.decode=function(t,e){var n=this.encodingName(e);return this.customDecoder?this.customDecoder(t,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(t,n):new TextDecoder(n).decode(t)},r.shouldDecodeOnFallback=function(t){return!r.isBrowser()&&t==="ISO-8859-1"},r.encode=function(t,e){var n=this.encodingName(e);return this.customEncoder?this.customEncoder(t,n):typeof TextEncoder>"u"?this.encodeFallback(t):new TextEncoder().encode(t)},r.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},r.encodingName=function(t){return typeof t=="string"?t:t.getName()},r.encodingCharacterSet=function(t){return t instanceof nt?t:nt.getCharacterSetECIByName(t)},r.decodeFallback=function(t,e){var n=this.encodingCharacterSet(e);if(r.isDecodeFallbackSupported(n)){for(var o="",i=0,a=t.length;i<a;i++){var s=t[i].toString(16);s.length<2&&(s="0"+s),o+="%"+s}return decodeURIComponent(o)}if(n.equals(nt.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new ne("Encoding "+this.encodingName(e)+" not supported by fallback.")},r.isDecodeFallbackSupported=function(t){return t.equals(nt.UTF8)||t.equals(nt.ISO8859_1)||t.equals(nt.ASCII)},r.encodeFallback=function(t){for(var e=btoa(unescape(encodeURIComponent(t))).split(""),n=[],o=0;o<e.length;o++)n.push(e[o].charCodeAt(0));return new Uint8Array(n)},r}(),F=function(){function r(){}return r.castAsNonUtf8Char=function(t,e){e===void 0&&(e=null);var n=e?e.getName():this.ISO88591;return At.decode(new Uint8Array([t]),n)},r.guessEncoding=function(t,e){if(e!=null&&e.get(Q.CHARACTER_SET)!==void 0)return e.get(Q.CHARACTER_SET).toString();for(var n=t.length,o=!0,i=!0,a=!0,s=0,u=0,c=0,f=0,h=0,l=0,d=0,p=0,y=0,C=0,w=0,v=t.length>3&&t[0]===239&&t[1]===187&&t[2]===191,_=0;_<n&&(o||i||a);_++){var m=255&t[_];a&&(s>0?128&m?s--:a=!1:128&m&&(64&m?(s++,32&m?(s++,16&m?(s++,8&m?a=!1:f++):c++):u++):a=!1)),o&&(m>127&&m<160?o=!1:m>159&&(m<192||m===215||m===247)&&w++),i&&(h>0?m<64||m===127||m>252?i=!1:h--:m===128||m===160||m>239?i=!1:m>160&&m<224?(l++,p=0,++d>y&&(y=d)):m>127?(h++,d=0,++p>C&&(C=p)):(d=0,p=0))}return a&&s>0&&(a=!1),i&&h>0&&(i=!1),a&&(v||u+c+f>0)?r.UTF8:i&&(r.ASSUME_SHIFT_JIS||y>=3||C>=3)?r.SHIFT_JIS:o&&i?y===2&&l===2||10*w>=n?r.SHIFT_JIS:r.ISO88591:o?r.ISO88591:i?r.SHIFT_JIS:a?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(i,a,s,u,c,f){if(i==="%%")return"%";if(e[++o]!==void 0){i=u?parseInt(u.substr(1)):void 0;var h,l=c?parseInt(c.substr(1)):void 0;switch(f){case"s":h=e[o];break;case"c":h=e[o][0];break;case"f":h=parseFloat(e[o]).toFixed(i);break;case"p":h=parseFloat(e[o]).toPrecision(i);break;case"e":h=parseFloat(e[o]).toExponential(i);break;case"x":h=parseInt(e[o]).toString(l||16);break;case"d":h=parseFloat(parseInt(e[o],l||10).toPrecision(i)).toFixed(0)}h=typeof h=="object"?JSON.stringify(h):(+h).toString(l);for(var d=parseInt(s),p=s&&s[0]+""=="0"?"0":" ";h.length<d;)h=a!==void 0?h+p:p+h;return h}})},r.getBytes=function(t,e){return At.encode(t,e)},r.getCharCode=function(t,e){return e===void 0&&(e=0),t.charCodeAt(e)},r.getCharAt=function(t){return String.fromCharCode(t)},r.SHIFT_JIS=nt.SJIS.getName(),r.GB2312="GB2312",r.ISO88591=nt.ISO8859_1.getName(),r.EUC_JP="EUC_JP",r.UTF8=nt.UTF8.getName(),r.PLATFORM_DEFAULT_ENCODING=r.UTF8,r.ASSUME_SHIFT_JIS=!1,r}(),B=function(){function r(t){t===void 0&&(t=""),this.value=t}return r.prototype.enableDecoding=function(t){return this.encoding=t,this},r.prototype.append=function(t){return typeof t=="string"?this.value+=t.toString():this.encoding?this.value+=F.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this},r.prototype.appendChars=function(t,e,n){for(var o=e;e<e+n;o++)this.append(t[o]);return this},r.prototype.length=function(){return this.value.length},r.prototype.charAt=function(t){return this.value.charAt(t)},r.prototype.deleteCharAt=function(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)},r.prototype.setCharAt=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)},r.prototype.substring=function(t,e){return this.value.substring(t,e)},r.prototype.setLengthToZero=function(){this.value=""},r.prototype.toString=function(){return this.value},r.prototype.insert=function(t,e){this.value=this.value.substring(0,t)+e+this.value.substring(t)},r}(),yt=function(){function r(t,e,n,o){if(this.width=t,this.height=e,this.rowSize=n,this.bits=o,e==null&&(e=t),this.height=e,t<1||e<1)throw new N("Both dimensions must be greater than 0");n==null&&(n=Math.floor((t+31)/32)),this.rowSize=n,o==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return r.parseFromBooleanArray=function(t){for(var e=t.length,n=t[0].length,o=new r(n,e),i=0;i<e;i++)for(var a=t[i],s=0;s<n;s++)a[s]&&o.set(s,i);return o},r.parseFromString=function(t,e,n){if(t===null)throw new N("stringRepresentation cannot be null");for(var o=new Array(t.length),i=0,a=0,s=-1,u=0,c=0;c<t.length;)if(t.charAt(c)===`
|
||
`||t.charAt(c)==="\r"){if(i>a){if(s===-1)s=i-a;else if(i-a!==s)throw new N("row lengths do not match");a=i,u++}c++}else if(t.substring(c,c+e.length)===e)c+=e.length,o[i]=!0,i++;else{if(t.substring(c,c+n.length)!==n)throw new N("illegal character encountered: "+t.substring(c));c+=n.length,o[i]=!1,i++}if(i>a){if(s===-1)s=i-a;else if(i-a!==s)throw new N("row lengths do not match");u++}for(var f=new r(s,u),h=0;h<i;h++)o[h]&&f.set(Math.floor(h%s),Math.floor(h/s));return f},r.prototype.get=function(t,e){var n=e*this.rowSize+Math.floor(t/32);return(this.bits[n]>>>(31&t)&1)!=0},r.prototype.set=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]|=1<<(31&t)&4294967295},r.prototype.unset=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]&=~(1<<(31&t)&4294967295)},r.prototype.flip=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]^=1<<(31&t)&4294967295},r.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new N("input matrix dimensions do not match");for(var e=new st(Math.floor(this.width/32)+1),n=this.rowSize,o=this.bits,i=0,a=this.height;i<a;i++)for(var s=i*n,u=t.getRow(i,e).getBitArray(),c=0;c<n;c++)o[s+c]^=u[c]},r.prototype.clear=function(){for(var t=this.bits,e=t.length,n=0;n<e;n++)t[n]=0},r.prototype.setRegion=function(t,e,n,o){if(e<0||t<0)throw new N("Left and top must be nonnegative");if(o<1||n<1)throw new N("Height and width must be at least 1");var i=t+n,a=e+o;if(a>this.height||i>this.width)throw new N("The region must fit inside the matrix");for(var s=this.rowSize,u=this.bits,c=e;c<a;c++)for(var f=c*s,h=t;h<i;h++)u[f+Math.floor(h/32)]|=1<<(31&h)&4294967295},r.prototype.getRow=function(t,e){e==null||e.getSize()<this.width?e=new st(this.width):e.clear();for(var n=this.rowSize,o=this.bits,i=t*n,a=0;a<n;a++)e.setBulk(32*a,o[i+a]);return e},r.prototype.setRow=function(t,e){Z.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)},r.prototype.rotate180=function(){for(var t=this.getWidth(),e=this.getHeight(),n=new st(t),o=new st(t),i=0,a=Math.floor((e+1)/2);i<a;i++)n=this.getRow(i,n),o=this.getRow(e-1-i,o),n.reverse(),o.reverse(),this.setRow(i,o),this.setRow(e-1-i,n)},r.prototype.getEnclosingRectangle=function(){for(var t=this.width,e=this.height,n=this.rowSize,o=this.bits,i=t,a=e,s=-1,u=-1,c=0;c<e;c++)for(var f=0;f<n;f++){var h=o[c*n+f];if(h!==0){if(c<a&&(a=c),c>u&&(u=c),32*f<i){for(var l=0;!(h<<31-l&4294967295);)l++;32*f+l<i&&(i=32*f+l)}if(32*f+31>s){for(l=31;!(h>>>l);)l--;32*f+l>s&&(s=32*f+l)}}}return s<i||u<a?null:Int32Array.from([i,a,s-i+1,u-a+1])},r.prototype.getTopLeftOnBit=function(){for(var t=this.rowSize,e=this.bits,n=0;n<e.length&&e[n]===0;)n++;if(n===e.length)return null;for(var o=n/t,i=n%t*32,a=e[n],s=0;!(a<<31-s&4294967295);)s++;return i+=s,Int32Array.from([i,o])},r.prototype.getBottomRightOnBit=function(){for(var t=this.rowSize,e=this.bits,n=e.length-1;n>=0&&e[n]===0;)n--;if(n<0)return null;for(var o=Math.floor(n/t),i=32*Math.floor(n%t),a=e[n],s=31;!(a>>>s);)s--;return i+=s,Int32Array.from([i,o])},r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.getRowSize=function(){return this.rowSize},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.width===e.width&&this.height===e.height&&this.rowSize===e.rowSize&&$.equals(this.bits,e.bits)},r.prototype.hashCode=function(){var t=this.width;return t=31*(t=31*(t=31*(t=31*t+this.width)+this.height)+this.rowSize)+$.hashCode(this.bits)},r.prototype.toString=function(t,e,n){return t===void 0&&(t="X "),e===void 0&&(e=" "),n===void 0&&(n=`
|
||
`),this.buildToString(t,e,n)},r.prototype.buildToString=function(t,e,n){for(var o=new B,i=0,a=this.height;i<a;i++){for(var s=0,u=this.width;s<u;s++)o.append(this.get(s,i)?t:e);o.append(n)}return o.toString()},r.prototype.clone=function(){return new r(this.width,this.height,this.rowSize,this.bits.slice())},r}(),nn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),E=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return nn(t,r),t.getNotFoundInstance=function(){return new t},t.kind="NotFoundException",t}(wt),on=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),an=function(r){function t(e){var n=r.call(this,e)||this;return n.luminances=t.EMPTY,n.buckets=new Int32Array(t.LUMINANCE_BUCKETS),n}return on(t,r),t.prototype.getBlackRow=function(e,n){var o=this.getLuminanceSource(),i=o.getWidth();n==null||n.getSize()<i?n=new st(i):n.clear(),this.initArrays(i);for(var a=o.getRow(e,this.luminances),s=this.buckets,u=0;u<i;u++)s[(255&a[u])>>t.LUMINANCE_SHIFT]++;var c=t.estimateBlackPoint(s);if(i<3)for(u=0;u<i;u++)(255&a[u])<c&&n.set(u);else{var f=255&a[0],h=255&a[1];for(u=1;u<i-1;u++){var l=255&a[u+1];(4*h-f-l)/2<c&&n.set(u),f=h,h=l}}return n},t.prototype.getBlackMatrix=function(){var e=this.getLuminanceSource(),n=e.getWidth(),o=e.getHeight(),i=new yt(n,o);this.initArrays(n);for(var a=this.buckets,s=1;s<5;s++)for(var u=Math.floor(o*s/5),c=e.getRow(u,this.luminances),f=Math.floor(4*n/5),h=Math.floor(n/5);h<f;h++)a[(255&c[h])>>t.LUMINANCE_SHIFT]++;var l=t.estimateBlackPoint(a),d=e.getMatrix();for(s=0;s<o;s++){var p=s*n;for(h=0;h<n;h++)(255&d[p+h])<l&&i.set(h,s)}return i},t.prototype.createBinarizer=function(e){return new t(e)},t.prototype.initArrays=function(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e));for(var n=this.buckets,o=0;o<t.LUMINANCE_BUCKETS;o++)n[o]=0},t.estimateBlackPoint=function(e){for(var n=e.length,o=0,i=0,a=0,s=0;s<n;s++)e[s]>a&&(i=s,a=e[s]),e[s]>o&&(o=e[s]);var u=0,c=0;for(s=0;s<n;s++){var f=s-i;(p=e[s]*f*f)>c&&(u=s,c=p)}if(i>u){var h=i;i=u,u=h}if(u-i<=n/16)throw new E;var l=u-1,d=-1;for(s=u-1;s>i;s--){var p,y=s-i;(p=y*y*(u-s)*(o-e[s]))>d&&(l=s,d=p)}return l<<t.LUMINANCE_SHIFT},t.LUMINANCE_BITS=5,t.LUMINANCE_SHIFT=8-t.LUMINANCE_BITS,t.LUMINANCE_BUCKETS=1<<t.LUMINANCE_BITS,t.EMPTY=Uint8ClampedArray.from([0]),t}(qr),sn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),un=function(r){function t(e){var n=r.call(this,e)||this;return n.matrix=null,n}return sn(t,r),t.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var e=this.getLuminanceSource(),n=e.getWidth(),o=e.getHeight();if(n>=t.MINIMUM_DIMENSION&&o>=t.MINIMUM_DIMENSION){var i=e.getMatrix(),a=n>>t.BLOCK_SIZE_POWER;n&t.BLOCK_SIZE_MASK&&a++;var s=o>>t.BLOCK_SIZE_POWER;o&t.BLOCK_SIZE_MASK&&s++;var u=t.calculateBlackPoints(i,a,s,n,o),c=new yt(n,o);t.calculateThresholdForBlock(i,a,s,n,o,u,c),this.matrix=c}else this.matrix=r.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(e){return new t(e)},t.calculateThresholdForBlock=function(e,n,o,i,a,s,u){for(var c=a-t.BLOCK_SIZE,f=i-t.BLOCK_SIZE,h=0;h<o;h++){var l=h<<t.BLOCK_SIZE_POWER;l>c&&(l=c);for(var d=t.cap(h,2,o-3),p=0;p<n;p++){var y=p<<t.BLOCK_SIZE_POWER;y>f&&(y=f);for(var C=t.cap(p,2,n-3),w=0,v=-2;v<=2;v++){var _=s[d+v];w+=_[C-2]+_[C-1]+_[C]+_[C+1]+_[C+2]}var m=w/25;t.thresholdBlock(e,y,l,m,i,u)}}},t.cap=function(e,n,o){return e<n?n:e>o?o:e},t.thresholdBlock=function(e,n,o,i,a,s){for(var u=0,c=o*a+n;u<t.BLOCK_SIZE;u++,c+=a)for(var f=0;f<t.BLOCK_SIZE;f++)(255&e[c+f])<=i&&s.set(n+f,o+u)},t.calculateBlackPoints=function(e,n,o,i,a){for(var s=a-t.BLOCK_SIZE,u=i-t.BLOCK_SIZE,c=new Array(o),f=0;f<o;f++){c[f]=new Int32Array(n);var h=f<<t.BLOCK_SIZE_POWER;h>s&&(h=s);for(var l=0;l<n;l++){var d=l<<t.BLOCK_SIZE_POWER;d>u&&(d=u);for(var p=0,y=255,C=0,w=0,v=h*i+d;w<t.BLOCK_SIZE;w++,v+=i){for(var _=0;_<t.BLOCK_SIZE;_++){var m=255&e[v+_];p+=m,m<y&&(y=m),m>C&&(C=m)}if(C-y>t.MIN_DYNAMIC_RANGE)for(w++,v+=i;w<t.BLOCK_SIZE;w++,v+=i)for(_=0;_<t.BLOCK_SIZE;_++)p+=255&e[v+_]}var I=p>>2*t.BLOCK_SIZE_POWER;if(C-y<=t.MIN_DYNAMIC_RANGE&&(I=y/2,f>0&&l>0)){var S=(c[f-1][l]+2*c[f][l-1]+c[f-1][l-1])/4;y<S&&(I=S)}c[f][l]=I}}return c},t.BLOCK_SIZE_POWER=3,t.BLOCK_SIZE=1<<t.BLOCK_SIZE_POWER,t.BLOCK_SIZE_MASK=t.BLOCK_SIZE-1,t.MINIMUM_DIMENSION=5*t.BLOCK_SIZE,t.MIN_DYNAMIC_RANGE=24,t}(an),ue=function(){function r(t,e){this.width=t,this.height=e}return r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.isCropSupported=function(){return!1},r.prototype.crop=function(t,e,n,o){throw new ne("This luminance source does not support cropping.")},r.prototype.isRotateSupported=function(){return!1},r.prototype.rotateCounterClockwise=function(){throw new ne("This luminance source does not support rotation by 90 degrees.")},r.prototype.rotateCounterClockwise45=function(){throw new ne("This luminance source does not support rotation by 45 degrees.")},r.prototype.toString=function(){for(var t=new Uint8ClampedArray(this.width),e=new B,n=0;n<this.height;n++){for(var o=this.getRow(n,t),i=0;i<this.width;i++){var a=255&o[i],s=void 0;s=a<64?"#":a<128?"+":a<192?".":" ",e.append(s)}e.append(`
|
||
`)}return e.toString()},r}(),cn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Fe=function(r){function t(e){var n=r.call(this,e.getWidth(),e.getHeight())||this;return n.delegate=e,n}return cn(t,r),t.prototype.getRow=function(e,n){for(var o=this.delegate.getRow(e,n),i=this.getWidth(),a=0;a<i;a++)o[a]=255-(255&o[a]);return o},t.prototype.getMatrix=function(){for(var e=this.delegate.getMatrix(),n=this.getWidth()*this.getHeight(),o=new Uint8ClampedArray(n),i=0;i<n;i++)o[i]=255-(255&e[i]);return o},t.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},t.prototype.crop=function(e,n,o,i){return new t(this.delegate.crop(e,n,o,i))},t.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},t.prototype.invert=function(){return this.delegate},t.prototype.rotateCounterClockwise=function(){return new t(this.delegate.rotateCounterClockwise())},t.prototype.rotateCounterClockwise45=function(){return new t(this.delegate.rotateCounterClockwise45())},t}(ue),fn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),hn=function(r){function t(e){var n=r.call(this,e.width,e.height)||this;return n.canvas=e,n.tempCanvasElement=null,n.buffer=t.makeBufferFromCanvasImageData(e),n}return fn(t,r),t.makeBufferFromCanvasImageData=function(e){var n=e.getContext("2d").getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(n.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,n,o){var i=new Uint8ClampedArray(n*o);if(t.FRAME_INDEX=!t.FRAME_INDEX,t.FRAME_INDEX)for(var a=0,s=0,u=e.length;a<u;a+=4,s++){var c=void 0;e[a+3]===0?c=255:c=306*e[a]+601*e[a+1]+117*e[a+2]+512>>10,i[s]=c}else{a=0,s=0;for(var f=e.length;a<f;a+=4,s++)c=void 0,e[a+3]===0?c=255:c=306*e[a]+601*e[a+1]+117*e[a+2]+512>>10,i[s]=255-c}return i},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new N("Requested row is outside the image: "+e);var o=this.getWidth(),i=e*o;return n===null?n=this.buffer.slice(i,i+o):(n.length<o&&(n=new Uint8ClampedArray(o)),n.set(this.buffer.slice(i,i+o))),n},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,o,i){return r.prototype.crop.call(this,e,n,o,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var n=this.getTempCanvasElement(),o=n.getContext("2d"),i=e*t.DEGREE_TO_RADIANS,a=this.canvas.width,s=this.canvas.height,u=Math.ceil(Math.abs(Math.cos(i))*a+Math.abs(Math.sin(i))*s),c=Math.ceil(Math.abs(Math.sin(i))*a+Math.abs(Math.cos(i))*s);return n.width=u,n.height=c,o.translate(u/2,c/2),o.rotate(i),o.drawImage(this.canvas,a/-2,s/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.prototype.invert=function(){return new Fe(this)},t.DEGREE_TO_RADIANS=Math.PI/180,t.FRAME_INDEX=!0,t}(ue),ln=function(){function r(t,e,n){this.deviceId=t,this.label=e,this.kind="videoinput",this.groupId=n||void 0}return r.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},r}(),ht=function(r,t,e,n){return new(e||(e=Promise))(function(o,i){function a(c){try{u(n.next(c))}catch(f){i(f)}}function s(c){try{u(n.throw(c))}catch(f){i(f)}}function u(c){var f;c.done?o(c.value):(f=c.value,f instanceof e?f:new e(function(h){h(f)})).then(a,s)}u((n=n.apply(r,t||[])).next())})},lt=function(r,t){var e,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(c){return function(f){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,n&&(o=2&f[0]?n.return:f[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,f[1])).done)return o;switch(n=0,o&&(f=[2&f[0],o.value]),f[0]){case 0:case 1:o=f;break;case 4:return a.label++,{value:f[1],done:!1};case 5:a.label++,n=f[1],f=[0];continue;case 7:f=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!((o=o.length>0&&o[o.length-1])||f[0]!==6&&f[0]!==2)){a=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){a.label=f[1];break}if(f[0]===6&&a.label<o[1]){a.label=o[1],o=f;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(f);break}o[2]&&a.ops.pop(),a.trys.pop();continue}f=t.call(r,a)}catch(h){f=[6,h],n=0}finally{e=o=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([u,c])}}},dn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Vt=function(){function r(t,e,n){e===void 0&&(e=500),this.reader=t,this.timeBetweenScansMillis=e,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(r.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),r.prototype.listVideoInputDevices=function(){return ht(this,void 0,void 0,function(){var t,e,n,o,i,a,s,u,c,f,h,l;return lt(this,function(d){switch(d.label){case 0: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.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=d.sent(),e=[];try{for(n=dn(t),o=n.next();!o.done;o=n.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,u=i.label||"Video device "+(e.length+1),c=i.groupId,f={deviceId:s,label:u,kind:a,groupId:c},e.push(f))}catch(p){h={error:p}}finally{try{o&&!o.done&&(l=n.return)&&l.call(n)}finally{if(h)throw h.error}}return[2,e]}})})},r.prototype.getVideoInputDevices=function(){return ht(this,void 0,void 0,function(){return lt(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,t.sent().map(function(e){return new ln(e.deviceId,e.label)})]}})})},r.prototype.findDeviceById=function(t){return ht(this,void 0,void 0,function(){var e;return lt(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(e=n.sent())?[2,e.find(function(o){return o.deviceId===t})]:[2,null]}})})},r.prototype.decodeFromInputVideoDevice=function(t,e){return ht(this,void 0,void 0,function(){return lt(this,function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,e)];case 1:return[2,n.sent()]}})})},r.prototype.decodeOnceFromVideoDevice=function(t,e){return ht(this,void 0,void 0,function(){var n;return lt(this,function(o){switch(o.label){case 0:return this.reset(),n={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(n,e)];case 1:return[2,o.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return ht(this,void 0,void 0,function(){var n;return lt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=o.sent(),[4,this.decodeOnceFromStream(n,e)];case 2:return[2,o.sent()]}})})},r.prototype.decodeOnceFromStream=function(t,e){return ht(this,void 0,void 0,function(){var n;return lt(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return n=o.sent(),[4,this.decodeOnce(n)];case 2:return[2,o.sent()]}})})},r.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,n){return ht(this,void 0,void 0,function(){return lt(this,function(o){switch(o.label){case 0:return[4,this.decodeFromVideoDevice(t,e,n)];case 1:return[2,o.sent()]}})})},r.prototype.decodeFromVideoDevice=function(t,e,n){return ht(this,void 0,void 0,function(){var o;return lt(this,function(i){switch(i.label){case 0:return o={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,e,n)];case 1:return[2,i.sent()]}})})},r.prototype.decodeFromConstraints=function(t,e,n){return ht(this,void 0,void 0,function(){var o;return lt(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return o=i.sent(),[4,this.decodeFromStream(o,e,n)];case 2:return[2,i.sent()]}})})},r.prototype.decodeFromStream=function(t,e,n){return ht(this,void 0,void 0,function(){var o;return lt(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return o=i.sent(),[4,this.decodeContinuously(o,n)];case 2:return[2,i.sent()]}})})},r.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},r.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},r.prototype.attachStreamToVideo=function(t,e){return ht(this,void 0,void 0,function(){var n;return lt(this,function(o){switch(o.label){case 0:return n=this.prepareVideoElement(e),this.addVideoSource(n,t),this.videoElement=n,this.stream=t,[4,this.playVideoOnLoadAsync(n)];case 1:return o.sent(),[2,n]}})})},r.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise(function(n,o){return e.playVideoOnLoad(t,function(){return n()})})},r.prototype.playVideoOnLoad=function(t,e){var n=this;this.videoEndedListener=function(){return n.stopStreams()},this.videoCanPlayListener=function(){return n.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)},r.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},r.prototype.tryPlayVideo=function(t){return ht(this,void 0,void 0,function(){return lt(this,function(e){switch(e.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.play()];case 2:return e.sent(),[3,4];case 3:return e.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},r.prototype.getMediaElement=function(t,e){var n=document.getElementById(t);if(!n)throw new mt("element with id '"+t+"' not found");if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new mt("element with id '"+t+"' must be an "+e+" element");return n},r.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new mt("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)},r.prototype.decodeFromVideo=function(t,e){if(!t&&!e)throw new mt("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)},r.prototype.decodeFromVideoContinuously=function(t,e,n){if(t===void 0&&e===void 0)throw new mt("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,n):this.decodeFromVideoElementContinuously(t,n)},r.prototype.decodeFromImageElement=function(t){if(!t)throw new mt("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);return this.imageElement=e,this.isImageLoaded(e)?this.decodeOnce(e,!1,!0):this._decodeOnLoadImage(e)},r.prototype.decodeFromVideoElement=function(t){var e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)},r.prototype.decodeFromVideoElementContinuously=function(t,e){var n=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(n,e)},r.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new mt("A video element must be provided.");this.reset();var e=this.prepareVideoElement(t);return this.videoElement=e,e},r.prototype.decodeFromImageUrl=function(t){if(!t)throw new mt("An URL must be provided.");this.reset();var e=this.prepareImageElement();this.imageElement=e;var n=this._decodeOnLoadImage(e);return e.src=t,n},r.prototype.decodeFromVideoUrl=function(t){if(!t)throw new mt("An URL must be provided.");this.reset();var e=this.prepareVideoElement(),n=this.decodeFromVideoElement(e);return e.src=t,n},r.prototype.decodeFromVideoUrlContinuously=function(t,e){if(!t)throw new mt("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),o=this.decodeFromVideoElementContinuously(n,e);return n.src=t,o},r.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(n,o){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(n,o)},t.addEventListener("load",e.imageLoadedListener)})},r.prototype._decodeOnLoadVideo=function(t){return ht(this,void 0,void 0,function(){return lt(this,function(e){switch(e.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return e.sent(),[4,this.decodeOnce(t)];case 2:return[2,e.sent()]}})})},r.prototype._decodeOnLoadVideoContinuously=function(t,e){return ht(this,void 0,void 0,function(){return lt(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return n.sent(),this.decodeContinuously(t,e),[2]}})})},r.prototype.isImageLoaded=function(t){return!!t.complete&&t.naturalWidth!==0},r.prototype.prepareImageElement=function(t){var e;return t===void 0&&((e=document.createElement("img")).width=200,e.height=200),typeof t=="string"&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e},r.prototype.prepareVideoElement=function(t){var e;return t||typeof document>"u"||((e=document.createElement("video")).width=200,e.height=200),typeof t=="string"&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},r.prototype.decodeOnce=function(t,e,n){var o=this;e===void 0&&(e=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var i=function(a,s){if(o._stopAsyncDecode)return s(new E("Video stream has ended before any code could be detected.")),void(o._stopAsyncDecode=void 0);try{a(o.decode(t))}catch(u){if(e&&u instanceof E||(u instanceof at||u instanceof T)&&n)return setTimeout(i,o._timeBetweenDecodingAttempts,a,s);s(u)}};return new Promise(function(a,s){return i(a,s)})},r.prototype.decodeContinuously=function(t,e){var n=this;this._stopContinuousDecode=!1;var o=function(){if(n._stopContinuousDecode)n._stopContinuousDecode=void 0;else try{var i=n.decode(t);e(i,null),setTimeout(o,n.timeBetweenScansMillis)}catch(a){e(null,a),(a instanceof at||a instanceof T||a instanceof E)&&setTimeout(o,n._timeBetweenDecodingAttempts)}};o()},r.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)},r.prototype.createBinaryBitmap=function(t){this.getCaptureCanvasContext(t),t instanceof HTMLVideoElement?this.drawFrameOnCanvas(t):this.drawImageOnCanvas(t);var e=this.getCaptureCanvas(t),n=new hn(e),o=new un(n);return new Zr(o)},r.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var e=this.getCaptureCanvas(t),n=void 0;try{n=e.getContext("2d",{willReadFrequently:!0})}catch{n=e.getContext("2d")}this.captureCanvasContext=n}return this.captureCanvasContext},r.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas},r.prototype.drawFrameOnCanvas=function(t,e,n){e===void 0&&(e={sx:0,sy:0,sWidth:t.videoWidth,sHeight:t.videoHeight,dx:0,dy:0,dWidth:t.videoWidth,dHeight:t.videoHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},r.prototype.drawImageOnCanvas=function(t,e,n){e===void 0&&(e={sx:0,sy:0,sWidth:t.naturalWidth,sHeight:t.naturalHeight,dx:0,dy:0,dWidth:t.naturalWidth,dHeight:t.naturalHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},r.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},r.prototype.createCaptureCanvas=function(t){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var e,n,o=document.createElement("canvas");return t!==void 0&&(t instanceof HTMLVideoElement?(e=t.videoWidth,n=t.videoHeight):t instanceof HTMLImageElement&&(e=t.naturalWidth||t.width,n=t.naturalHeight||t.height)),o.style.width=e+"px",o.style.height=n+"px",o.width=e,o.height=n,o},r.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},r.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},r.prototype._destroyVideoElement=function(){this.videoElement&&(this.videoEndedListener!==void 0&&this.videoElement.removeEventListener("ended",this.videoEndedListener),this.videoPlayingEventListener!==void 0&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),this.videoCanPlayListener!==void 0&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},r.prototype._destroyImageElement=function(){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)},r.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},r.prototype.addVideoSource=function(t,e){try{t.srcObject=e}catch{t.src=URL.createObjectURL(e)}},r.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch{t.src=""}this.videoElement.removeAttribute("src")},r}(),ft=function(){function r(t,e,n,o,i,a){n===void 0&&(n=e==null?0:8*e.length),a===void 0&&(a=Z.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=n,this.resultPoints=o,this.format=i,this.timestamp=a,this.text=t,this.rawBytes=e,this.numBits=n??(e==null?0:8*e.length),this.resultPoints=o,this.format=i,this.resultMetadata=null,this.timestamp=a??Z.currentTimeMillis()}return r.prototype.getText=function(){return this.text},r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.getResultPoints=function(){return this.resultPoints},r.prototype.getBarcodeFormat=function(){return this.format},r.prototype.getResultMetadata=function(){return this.resultMetadata},r.prototype.putMetadata=function(t,e){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)},r.prototype.putAllMetadata=function(t){t!==null&&(this.resultMetadata===null?this.resultMetadata=t:this.resultMetadata=new Map(t))},r.prototype.addResultPoints=function(t){var e=this.resultPoints;if(e===null)this.resultPoints=t;else if(t!==null&&t.length>0){var n=new Array(e.length+t.length);Z.arraycopy(e,0,n,0,e.length),Z.arraycopy(t,0,n,e.length,t.length),this.resultPoints=n}},r.prototype.getTimestamp=function(){return this.timestamp},r.prototype.toString=function(){return this.text},r}();(function(r){r[r.AZTEC=0]="AZTEC",r[r.CODABAR=1]="CODABAR",r[r.CODE_39=2]="CODE_39",r[r.CODE_93=3]="CODE_93",r[r.CODE_128=4]="CODE_128",r[r.DATA_MATRIX=5]="DATA_MATRIX",r[r.EAN_8=6]="EAN_8",r[r.EAN_13=7]="EAN_13",r[r.ITF=8]="ITF",r[r.MAXICODE=9]="MAXICODE",r[r.PDF_417=10]="PDF_417",r[r.QR_CODE=11]="QR_CODE",r[r.RSS_14=12]="RSS_14",r[r.RSS_EXPANDED=13]="RSS_EXPANDED",r[r.UPC_A=14]="UPC_A",r[r.UPC_E=15]="UPC_E",r[r.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(me||(me={}));var Ee,D=me;(function(r){r[r.OTHER=0]="OTHER",r[r.ORIENTATION=1]="ORIENTATION",r[r.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",r[r.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",r[r.ISSUE_NUMBER=4]="ISSUE_NUMBER",r[r.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",r[r.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",r[r.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",r[r.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",r[r.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",r[r.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(Ee||(Ee={}));var ut,ct=Ee,ce=function(){function r(t,e,n,o,i,a){i===void 0&&(i=-1),a===void 0&&(a=-1),this.rawBytes=t,this.text=e,this.byteSegments=n,this.ecLevel=o,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=a,this.numBits=t==null?0:8*t.length}return r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.setNumBits=function(t){this.numBits=t},r.prototype.getText=function(){return this.text},r.prototype.getByteSegments=function(){return this.byteSegments},r.prototype.getECLevel=function(){return this.ecLevel},r.prototype.getErrorsCorrected=function(){return this.errorsCorrected},r.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},r.prototype.getErasures=function(){return this.erasures},r.prototype.setErasures=function(t){this.erasures=t},r.prototype.getOther=function(){return this.other},r.prototype.setOther=function(t){this.other=t},r.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},r.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},r.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},r}(),Gt=function(){function r(){}return r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new N;return this.logTable[t]},r.addOrSubtract=function(t,e){return t^e},r}(),Rt=function(){function r(t,e){if(e.length===0)throw new N;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var o=1;o<n&&e[o]===0;)o++;o===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-o),Z.arraycopy(e,o,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return r.prototype.getCoefficients=function(){return this.coefficients},r.prototype.getDegree=function(){return this.coefficients.length-1},r.prototype.isZero=function(){return this.coefficients[0]===0},r.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},r.prototype.evaluateAt=function(t){if(t===0)return this.getCoefficient(0);var e,n=this.coefficients;if(t===1){e=0;for(var o=0,i=n.length;o!==i;o++){var a=n[o];e=Gt.addOrSubtract(e,a)}return e}e=n[0];var s=n.length,u=this.field;for(o=1;o<s;o++)e=Gt.addOrSubtract(u.multiply(t,e),n[o]);return e},r.prototype.addOrSubtract=function(t){if(!this.field.equals(t.field))throw new N("GenericGFPolys do not have same GenericGF field");if(this.isZero())return t;if(t.isZero())return this;var e=this.coefficients,n=t.coefficients;if(e.length>n.length){var o=e;e=n,n=o}var i=new Int32Array(n.length),a=n.length-e.length;Z.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=Gt.addOrSubtract(e[s-a],n[s]);return new r(this.field,i)},r.prototype.multiply=function(t){if(!this.field.equals(t.field))throw new N("GenericGFPolys do not have same GenericGF field");if(this.isZero()||t.isZero())return this.field.getZero();for(var e=this.coefficients,n=e.length,o=t.coefficients,i=o.length,a=new Int32Array(n+i-1),s=this.field,u=0;u<n;u++)for(var c=e[u],f=0;f<i;f++)a[u+f]=Gt.addOrSubtract(a[u+f],s.multiply(c,o[f]));return new r(s,a)},r.prototype.multiplyScalar=function(t){if(t===0)return this.field.getZero();if(t===1)return this;for(var e=this.coefficients.length,n=this.field,o=new Int32Array(e),i=this.coefficients,a=0;a<e;a++)o[a]=n.multiply(i[a],t);return new r(n,o)},r.prototype.multiplyByMonomial=function(t,e){if(t<0)throw new N;if(e===0)return this.field.getZero();for(var n=this.coefficients,o=n.length,i=new Int32Array(o+t),a=this.field,s=0;s<o;s++)i[s]=a.multiply(n[s],e);return new r(a,i)},r.prototype.divide=function(t){if(!this.field.equals(t.field))throw new N("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new N("Divide by 0");for(var e=this.field,n=e.getZero(),o=this,i=t.getCoefficient(t.getDegree()),a=e.inverse(i);o.getDegree()>=t.getDegree()&&!o.isZero();){var s=o.getDegree()-t.getDegree(),u=e.multiply(o.getCoefficient(o.getDegree()),a),c=t.multiplyByMonomial(s,u),f=e.buildMonomial(s,u);n=n.addOrSubtract(f),o=o.addOrSubtract(c)}return[n,o]},r.prototype.toString=function(){for(var t="",e=this.getDegree();e>=0;e--){var n=this.getCoefficient(e);if(n!==0){if(n<0?(t+=" - ",n=-n):t.length>0&&(t+=" + "),e===0||n!==1){var o=this.field.log(n);o===0?t+="1":o===1?t+="a":(t+="a^",t+=o)}e!==0&&(e===1?t+="x":(t+="x^",t+=e))}}return t},r}(),pn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ir=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return pn(t,r),t.kind="ArithmeticException",t}(wt),gn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),gt=function(r){function t(e,n,o){var i=r.call(this)||this;i.primitive=e,i.size=n,i.generatorBase=o;for(var a=new Int32Array(n),s=1,u=0;u<n;u++)a[u]=s,(s*=2)>=n&&(s^=e,s&=n-1);i.expTable=a;var c=new Int32Array(n);for(u=0;u<n-1;u++)c[a[u]]=u;return i.logTable=c,i.zero=new Rt(i,Int32Array.from([0])),i.one=new Rt(i,Int32Array.from([1])),i}return gn(t,r),t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,n){if(e<0)throw new N;if(n===0)return this.zero;var o=new Int32Array(e+1);return o[0]=n,new Rt(this,o)},t.prototype.inverse=function(e){if(e===0)throw new Ir;return this.expTable[this.size-this.logTable[e]-1]},t.prototype.multiply=function(e,n){return e===0||n===0?0:this.expTable[(this.logTable[e]+this.logTable[n])%(this.size-1)]},t.prototype.getSize=function(){return this.size},t.prototype.getGeneratorBase=function(){return this.generatorBase},t.prototype.toString=function(){return"GF(0x"+P.toHexString(this.primitive)+","+this.size+")"},t.prototype.equals=function(e){return e===this},t.AZTEC_DATA_12=new t(4201,4096,1),t.AZTEC_DATA_10=new t(1033,1024,1),t.AZTEC_DATA_6=new t(67,64,1),t.AZTEC_PARAM=new t(19,16,1),t.QR_CODE_FIELD_256=new t(285,256,0),t.DATA_MATRIX_FIELD_256=new t(301,256,1),t.AZTEC_DATA_8=t.DATA_MATRIX_FIELD_256,t.MAXICODE_FIELD_64=t.AZTEC_DATA_6,t}(Gt),yn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Qt=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return yn(t,r),t.kind="ReedSolomonException",t}(wt),wn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Nt=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return wn(t,r),t.kind="IllegalStateException",t}(wt),fe=function(){function r(t){this.field=t}return r.prototype.decode=function(t,e){for(var n=this.field,o=new Rt(n,t),i=new Int32Array(e),a=!0,s=0;s<e;s++){var u=o.evaluateAt(n.exp(s+n.getGeneratorBase()));i[i.length-1-s]=u,u!==0&&(a=!1)}if(!a){var c=new Rt(n,i),f=this.runEuclideanAlgorithm(n.buildMonomial(e,1),c,e),h=f[0],l=f[1],d=this.findErrorLocations(h),p=this.findErrorMagnitudes(l,d);for(s=0;s<d.length;s++){var y=t.length-1-n.log(d[s]);if(y<0)throw new Qt("Bad error location");t[y]=gt.addOrSubtract(t[y],p[s])}}},r.prototype.runEuclideanAlgorithm=function(t,e,n){if(t.getDegree()<e.getDegree()){var o=t;t=e,e=o}for(var i=this.field,a=t,s=e,u=i.getZero(),c=i.getOne();s.getDegree()>=(n/2|0);){var f=a,h=u;if(u=c,(a=s).isZero())throw new Qt("r_{i-1} was zero");s=f;for(var l=i.getZero(),d=a.getCoefficient(a.getDegree()),p=i.inverse(d);s.getDegree()>=a.getDegree()&&!s.isZero();){var y=s.getDegree()-a.getDegree(),C=i.multiply(s.getCoefficient(s.getDegree()),p);l=l.addOrSubtract(i.buildMonomial(y,C)),s=s.addOrSubtract(a.multiplyByMonomial(y,C))}if(c=l.multiply(u).addOrSubtract(h),s.getDegree()>=a.getDegree())throw new Nt("Division algorithm failed to reduce polynomial?")}var w=c.getCoefficient(0);if(w===0)throw new Qt("sigmaTilde(0) was zero");var v=i.inverse(w);return[c.multiplyScalar(v),s.multiplyScalar(v)]},r.prototype.findErrorLocations=function(t){var e=t.getDegree();if(e===1)return Int32Array.from([t.getCoefficient(1)]);for(var n=new Int32Array(e),o=0,i=this.field,a=1;a<i.getSize()&&o<e;a++)t.evaluateAt(a)===0&&(n[o]=i.inverse(a),o++);if(o!==e)throw new Qt("Error locator degree does not match number of roots");return n},r.prototype.findErrorMagnitudes=function(t,e){for(var n=e.length,o=new Int32Array(n),i=this.field,a=0;a<n;a++){for(var s=i.inverse(e[a]),u=1,c=0;c<n;c++)if(a!==c){var f=i.multiply(e[c],s),h=1&f?-2&f:1|f;u=i.multiply(u,h)}o[a]=i.multiply(t.evaluateAt(s),i.inverse(u)),i.getGeneratorBase()!==0&&(o[a]=i.multiply(o[a],s))}return o},r}();(function(r){r[r.UPPER=0]="UPPER",r[r.LOWER=1]="LOWER",r[r.MIXED=2]="MIXED",r[r.DIGIT=3]="DIGIT",r[r.PUNCT=4]="PUNCT",r[r.BINARY=5]="BINARY"})(ut||(ut={}));var je=function(){function r(){}return r.prototype.decode=function(t){this.ddata=t;var e=t.getBits(),n=this.extractBits(e),o=this.correctBits(n),i=r.convertBoolArrayToByteArray(o),a=r.getEncodedData(o),s=new ce(i,a,null,null);return s.setNumBits(o.length),s},r.highLevelDecode=function(t){return this.getEncodedData(t)},r.getEncodedData=function(t){for(var e=t.length,n=ut.UPPER,o=ut.UPPER,i="",a=0;a<e;)if(o===ut.BINARY){if(e-a<5)break;var s=r.readCode(t,a,5);if(a+=5,s===0){if(e-a<11)break;s=r.readCode(t,a,11)+31,a+=11}for(var u=0;u<s;u++){if(e-a<8){a=e;break}var c=r.readCode(t,a,8);i+=F.castAsNonUtf8Char(c),a+=8}o=n}else{var f=o===ut.DIGIT?4:5;if(e-a<f)break;c=r.readCode(t,a,f),a+=f;var h=r.getCharacter(o,c);h.startsWith("CTRL_")?(n=o,o=r.getTable(h.charAt(5)),h.charAt(6)==="L"&&(n=o)):(i+=h,o=n)}return i},r.getTable=function(t){switch(t){case"L":return ut.LOWER;case"P":return ut.PUNCT;case"M":return ut.MIXED;case"D":return ut.DIGIT;case"B":return ut.BINARY;default:return ut.UPPER}},r.getCharacter=function(t,e){switch(t){case ut.UPPER:return r.UPPER_TABLE[e];case ut.LOWER:return r.LOWER_TABLE[e];case ut.MIXED:return r.MIXED_TABLE[e];case ut.PUNCT:return r.PUNCT_TABLE[e];case ut.DIGIT:return r.DIGIT_TABLE[e];default:throw new Nt("Bad table")}},r.prototype.correctBits=function(t){var e,n;this.ddata.getNbLayers()<=2?(n=6,e=gt.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,e=gt.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,e=gt.AZTEC_DATA_10):(n=12,e=gt.AZTEC_DATA_12);var o=this.ddata.getNbDatablocks(),i=t.length/n;if(i<o)throw new T;for(var a=t.length%n,s=new Int32Array(i),u=0;u<i;u++,a+=n)s[u]=r.readCode(t,a,n);try{new fe(e).decode(s,i-o)}catch(y){throw new T(y)}var c=(1<<n)-1,f=0;for(u=0;u<o;u++){if((d=s[u])===0||d===c)throw new T;d!==1&&d!==c-1||f++}var h=new Array(o*n-f),l=0;for(u=0;u<o;u++){var d;if((d=s[u])===1||d===c-1)h.fill(d>1,l,l+n-1),l+=n-1;else for(var p=n-1;p>=0;--p)h[l++]=(d&1<<p)!=0}return h},r.prototype.extractBits=function(t){var e=this.ddata.isCompact(),n=this.ddata.getNbLayers(),o=(e?11:14)+4*n,i=new Int32Array(o),a=new Array(this.totalBitsInLayer(n,e));if(e)for(var s=0;s<i.length;s++)i[s]=s;else{var u=o+1+2*P.truncDivision(P.truncDivision(o,2)-1,15),c=o/2,f=P.truncDivision(u,2);for(s=0;s<c;s++){var h=s+P.truncDivision(s,15);i[c-s-1]=f-h-1,i[c+s]=f+h+1}}s=0;for(var l=0;s<n;s++){for(var d=4*(n-s)+(e?9:12),p=2*s,y=o-1-p,C=0;C<d;C++)for(var w=2*C,v=0;v<2;v++)a[l+w+v]=t.get(i[p+v],i[p+C]),a[l+2*d+w+v]=t.get(i[p+C],i[y-v]),a[l+4*d+w+v]=t.get(i[y-v],i[y-C]),a[l+6*d+w+v]=t.get(i[y-C],i[p+v]);l+=8*d}return a},r.readCode=function(t,e,n){for(var o=0,i=e;i<e+n;i++)o<<=1,t[i]&&(o|=1);return o},r.readByte=function(t,e){var n=t.length-e;return n>=8?r.readCode(t,e,8):r.readCode(t,e,n)<<8-n},r.convertBoolArrayToByteArray=function(t){for(var e=new Uint8Array((t.length+7)/8),n=0;n<e.length;n++)e[n]=r.readByte(t,8*n);return e},r.prototype.totalBitsInLayer=function(t,e){return((e?88:112)+16*t)*t},r.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"],r.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"],r.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"],r.PUNCT_TABLE=["","\r",`\r
|
||
`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],r.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],r}(),U=function(){function r(){}return r.round=function(t){return isNaN(t)?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},r.distance=function(t,e,n,o){var i=t-n,a=e-o;return Math.sqrt(i*i+a*a)},r.sum=function(t){for(var e=0,n=0,o=t.length;n!==o;n++)e+=t[n];return e},r}(),Ie=function(){function r(){}return r.floatToIntBits=function(t){return t},r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),R=function(){function r(t,e){this.x=t,this.y=e}return r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.equals=function(t){if(t instanceof r){var e=t;return this.x===e.x&&this.y===e.y}return!1},r.prototype.hashCode=function(){return 31*Ie.floatToIntBits(this.x)+Ie.floatToIntBits(this.y)},r.prototype.toString=function(){return"("+this.x+","+this.y+")"},r.orderBestPatterns=function(t){var e,n,o,i=this.distance(t[0],t[1]),a=this.distance(t[1],t[2]),s=this.distance(t[0],t[2]);if(a>=i&&a>=s?(n=t[0],e=t[1],o=t[2]):s>=a&&s>=i?(n=t[1],e=t[0],o=t[2]):(n=t[2],e=t[0],o=t[1]),this.crossProductZ(e,n,o)<0){var u=e;e=o,o=u}t[0]=e,t[1]=n,t[2]=o},r.distance=function(t,e){return U.distance(t.x,t.y,e.x,e.y)},r.crossProductZ=function(t,e,n){var o=e.x,i=e.y;return(n.x-o)*(t.y-i)-(n.y-i)*(t.x-o)},r}(),xe=function(){function r(t,e){this.bits=t,this.points=e}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),Cn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),vn=function(r){function t(e,n,o,i,a){var s=r.call(this,e,n)||this;return s.compact=o,s.nbDatablocks=i,s.nbLayers=a,s}return Cn(t,r),t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(xe),Se=function(){function r(t,e,n,o){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),e==null&&(e=r.INIT_SIZE),n==null&&(n=t.getWidth()/2|0),o==null&&(o=t.getHeight()/2|0);var i=e/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new E}return r.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,n=this.upInit,o=this.downInit,i=!1,a=!0,s=!1,u=!1,c=!1,f=!1,h=!1,l=this.width,d=this.height;a;){a=!1;for(var p=!0;(p||!u)&&e<l;)(p=this.containsBlackPoint(n,o,e,!1))?(e++,a=!0,u=!0):u||e++;if(e>=l){i=!0;break}for(var y=!0;(y||!c)&&o<d;)(y=this.containsBlackPoint(t,e,o,!0))?(o++,a=!0,c=!0):c||o++;if(o>=d){i=!0;break}for(var C=!0;(C||!f)&&t>=0;)(C=this.containsBlackPoint(n,o,t,!1))?(t--,a=!0,f=!0):f||t--;if(t<0){i=!0;break}for(var w=!0;(w||!h)&&n>=0;)(w=this.containsBlackPoint(t,e,n,!0))?(n--,a=!0,h=!0):h||n--;if(n<0){i=!0;break}a&&(s=!0)}if(!i&&s){for(var v=e-t,_=null,m=1;_===null&&m<v;m++)_=this.getBlackPointOnSegment(t,o-m,t+m,o);if(_==null)throw new E;var I=null;for(m=1;I===null&&m<v;m++)I=this.getBlackPointOnSegment(t,n+m,t+m,n);if(I==null)throw new E;var S=null;for(m=1;S===null&&m<v;m++)S=this.getBlackPointOnSegment(e,n+m,e-m,n);if(S==null)throw new E;var O=null;for(m=1;O===null&&m<v;m++)O=this.getBlackPointOnSegment(e,o-m,e-m,o);if(O==null)throw new E;return this.centerEdges(O,_,S,I)}throw new E},r.prototype.getBlackPointOnSegment=function(t,e,n,o){for(var i=U.round(U.distance(t,e,n,o)),a=(n-t)/i,s=(o-e)/i,u=this.image,c=0;c<i;c++){var f=U.round(t+c*a),h=U.round(e+c*s);if(u.get(f,h))return new R(f,h)}return null},r.prototype.centerEdges=function(t,e,n,o){var i=t.getX(),a=t.getY(),s=e.getX(),u=e.getY(),c=n.getX(),f=n.getY(),h=o.getX(),l=o.getY(),d=r.CORR;return i<this.width/2?[new R(h-d,l+d),new R(s+d,u+d),new R(c-d,f-d),new R(i+d,a-d)]:[new R(h+d,l+d),new R(s+d,u-d),new R(c-d,f+d),new R(i-d,a-d)]},r.prototype.containsBlackPoint=function(t,e,n,o){var i=this.image;if(o){for(var a=t;a<=e;a++)if(i.get(a,n))return!0}else for(var s=t;s<=e;s++)if(i.get(n,s))return!0;return!1},r.INIT_SIZE=10,r.CORR=1,r}(),Ye=function(){function r(){}return r.checkAndNudgePoints=function(t,e){for(var n=t.getWidth(),o=t.getHeight(),i=!0,a=0;a<e.length&&i;a+=2){var s=Math.floor(e[a]),u=Math.floor(e[a+1]);if(s<-1||s>n||u<-1||u>o)throw new E;i=!1,s===-1?(e[a]=0,i=!0):s===n&&(e[a]=n-1,i=!0),u===-1?(e[a+1]=0,i=!0):u===o&&(e[a+1]=o-1,i=!0)}for(i=!0,a=e.length-2;a>=0&&i;a-=2){if(s=Math.floor(e[a]),u=Math.floor(e[a+1]),s<-1||s>n||u<-1||u>o)throw new E;i=!1,s===-1?(e[a]=0,i=!0):s===n&&(e[a]=n-1,i=!0),u===-1?(e[a+1]=0,i=!0):u===o&&(e[a+1]=o-1,i=!0)}},r}(),Sr=function(){function r(t,e,n,o,i,a,s,u,c){this.a11=t,this.a21=e,this.a31=n,this.a12=o,this.a22=i,this.a32=a,this.a13=s,this.a23=u,this.a33=c}return r.quadrilateralToQuadrilateral=function(t,e,n,o,i,a,s,u,c,f,h,l,d,p,y,C){var w=r.quadrilateralToSquare(t,e,n,o,i,a,s,u);return r.squareToQuadrilateral(c,f,h,l,d,p,y,C).times(w)},r.prototype.transformPoints=function(t){for(var e=t.length,n=this.a11,o=this.a12,i=this.a13,a=this.a21,s=this.a22,u=this.a23,c=this.a31,f=this.a32,h=this.a33,l=0;l<e;l+=2){var d=t[l],p=t[l+1],y=i*d+u*p+h;t[l]=(n*d+a*p+c)/y,t[l+1]=(o*d+s*p+f)/y}},r.prototype.transformPointsWithValues=function(t,e){for(var n=this.a11,o=this.a12,i=this.a13,a=this.a21,s=this.a22,u=this.a23,c=this.a31,f=this.a32,h=this.a33,l=t.length,d=0;d<l;d++){var p=t[d],y=e[d],C=i*p+u*y+h;t[d]=(n*p+a*y+c)/C,e[d]=(o*p+s*y+f)/C}},r.squareToQuadrilateral=function(t,e,n,o,i,a,s,u){var c=t-n+i-s,f=e-o+a-u;if(c===0&&f===0)return new r(n-t,i-n,t,o-e,a-o,e,0,0,1);var h=n-i,l=s-i,d=o-a,p=u-a,y=h*p-l*d,C=(c*p-l*f)/y,w=(h*f-c*d)/y;return new r(n-t+C*n,s-t+w*s,t,o-e+C*o,u-e+w*u,e,C,w,1)},r.quadrilateralToSquare=function(t,e,n,o,i,a,s,u){return r.squareToQuadrilateral(t,e,n,o,i,a,s,u).buildAdjoint()},r.prototype.buildAdjoint=function(){return new r(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)},r.prototype.times=function(t){return new r(this.a11*t.a11+this.a21*t.a12+this.a31*t.a13,this.a11*t.a21+this.a21*t.a22+this.a31*t.a23,this.a11*t.a31+this.a21*t.a32+this.a31*t.a33,this.a12*t.a11+this.a22*t.a12+this.a32*t.a13,this.a12*t.a21+this.a22*t.a22+this.a32*t.a23,this.a12*t.a31+this.a22*t.a32+this.a32*t.a33,this.a13*t.a11+this.a23*t.a12+this.a33*t.a13,this.a13*t.a21+this.a23*t.a22+this.a33*t.a23,this.a13*t.a31+this.a23*t.a32+this.a33*t.a33)},r}(),An=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),_n=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return An(t,r),t.prototype.sampleGrid=function(e,n,o,i,a,s,u,c,f,h,l,d,p,y,C,w,v,_,m){var I=Sr.quadrilateralToQuadrilateral(i,a,s,u,c,f,h,l,d,p,y,C,w,v,_,m);return this.sampleGridWithTransform(e,n,o,I)},t.prototype.sampleGridWithTransform=function(e,n,o,i){if(n<=0||o<=0)throw new E;for(var a=new yt(n,o),s=new Float32Array(2*n),u=0;u<o;u++){for(var c=s.length,f=u+.5,h=0;h<c;h+=2)s[h]=h/2+.5,s[h+1]=f;i.transformPoints(s),Ye.checkAndNudgePoints(e,s);try{for(h=0;h<c;h+=2)e.get(Math.floor(s[h]),Math.floor(s[h+1]))&&a.set(h/2,u)}catch{throw new E}}return a},t}(Ye),ke=function(){function r(){}return r.setGridSampler=function(t){r.gridSampler=t},r.getInstance=function(){return r.gridSampler},r.gridSampler=new _n,r}(),dt=function(){function r(t,e){this.x=t,this.y=e}return r.prototype.toResultPoint=function(){return new R(this.getX(),this.getY())},r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r}(),mn=function(){function r(t){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=t}return r.prototype.detect=function(){return this.detectMirror(!1)},r.prototype.detectMirror=function(t){var e=this.getMatrixCenter(),n=this.getBullsEyeCorners(e);if(t){var o=n[0];n[0]=n[2],n[2]=o}this.extractParameters(n);var i=this.sampleGrid(this.image,n[this.shift%4],n[(this.shift+1)%4],n[(this.shift+2)%4],n[(this.shift+3)%4]),a=this.getMatrixCornerPoints(n);return new vn(i,a,this.compact,this.nbDataBlocks,this.nbLayers)},r.prototype.extractParameters=function(t){if(!(this.isValidPoint(t[0])&&this.isValidPoint(t[1])&&this.isValidPoint(t[2])&&this.isValidPoint(t[3])))throw new E;var e=2*this.nbCenterLayers,n=new Int32Array([this.sampleLine(t[0],t[1],e),this.sampleLine(t[1],t[2],e),this.sampleLine(t[2],t[3],e),this.sampleLine(t[3],t[0],e)]);this.shift=this.getRotation(n,e);for(var o=0,i=0;i<4;i++){var a=n[(this.shift+i)%4];this.compact?(o<<=7,o+=a>>1&127):(o<<=10,o+=(a>>2&992)+(a>>1&31))}var s=this.getCorrectedParameterData(o,this.compact);this.compact?(this.nbLayers=1+(s>>6),this.nbDataBlocks=1+(63&s)):(this.nbLayers=1+(s>>11),this.nbDataBlocks=1+(2047&s))},r.prototype.getRotation=function(t,e){var n=0;t.forEach(function(i,a,s){n=(n<<3)+((i>>e-2<<1)+(1&i))}),n=((1&n)<<11)+(n>>1);for(var o=0;o<4;o++)if(P.bitCount(n^this.EXPECTED_CORNER_BITS[o])<=2)return o;throw new E},r.prototype.getCorrectedParameterData=function(t,e){var n,o;e?(n=7,o=2):(n=10,o=4);for(var i=n-o,a=new Int32Array(n),s=n-1;s>=0;--s)a[s]=15&t,t>>=4;try{new fe(gt.AZTEC_PARAM).decode(a,i)}catch{throw new E}var u=0;for(s=0;s<o;s++)u=(u<<4)+a[s];return u},r.prototype.getBullsEyeCorners=function(t){var e=t,n=t,o=t,i=t,a=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var s=this.getFirstDifferent(e,a,1,-1),u=this.getFirstDifferent(n,a,1,1),c=this.getFirstDifferent(o,a,-1,1),f=this.getFirstDifferent(i,a,-1,-1);if(this.nbCenterLayers>2){var h=this.distancePoint(f,s)*this.nbCenterLayers/(this.distancePoint(i,e)*(this.nbCenterLayers+2));if(h<.75||h>1.25||!this.isWhiteOrBlackRectangle(s,u,c,f))break}e=s,n=u,o=c,i=f,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new E;this.compact=this.nbCenterLayers===5;var l=new R(e.getX()+.5,e.getY()-.5),d=new R(n.getX()+.5,n.getY()+.5),p=new R(o.getX()-.5,o.getY()+.5),y=new R(i.getX()-.5,i.getY()-.5);return this.expandSquare([l,d,p,y],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},r.prototype.getMatrixCenter=function(){var t,e,n,o;try{t=(c=new Se(this.image).detect())[0],e=c[1],n=c[2],o=c[3]}catch{var i=this.image.getWidth()/2,a=this.image.getHeight()/2;t=this.getFirstDifferent(new dt(i+7,a-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new dt(i+7,a+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new dt(i-7,a+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new dt(i-7,a-7),!1,-1,-1).toResultPoint()}var s=U.round((t.getX()+o.getX()+e.getX()+n.getX())/4),u=U.round((t.getY()+o.getY()+e.getY()+n.getY())/4);try{var c;t=(c=new Se(this.image,15,s,u).detect())[0],e=c[1],n=c[2],o=c[3]}catch{t=this.getFirstDifferent(new dt(s+7,u-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new dt(s+7,u+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new dt(s-7,u+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new dt(s-7,u-7),!1,-1,-1).toResultPoint()}return s=U.round((t.getX()+o.getX()+e.getX()+n.getX())/4),u=U.round((t.getY()+o.getY()+e.getY()+n.getY())/4),new dt(s,u)},r.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},r.prototype.sampleGrid=function(t,e,n,o,i){var a=ke.getInstance(),s=this.getDimension(),u=s/2-this.nbCenterLayers,c=s/2+this.nbCenterLayers;return a.sampleGrid(t,s,s,u,u,c,u,c,c,u,c,e.getX(),e.getY(),n.getX(),n.getY(),o.getX(),o.getY(),i.getX(),i.getY())},r.prototype.sampleLine=function(t,e,n){for(var o=0,i=this.distanceResultPoint(t,e),a=i/n,s=t.getX(),u=t.getY(),c=a*(e.getX()-t.getX())/i,f=a*(e.getY()-t.getY())/i,h=0;h<n;h++)this.image.get(U.round(s+h*c),U.round(u+h*f))&&(o|=1<<n-h-1);return o},r.prototype.isWhiteOrBlackRectangle=function(t,e,n,o){t=new dt(t.getX()-3,t.getY()+3),e=new dt(e.getX()-3,e.getY()-3),n=new dt(n.getX()+3,n.getY()-3),o=new dt(o.getX()+3,o.getY()+3);var i=this.getColor(o,t);if(i===0)return!1;var a=this.getColor(t,e);return a===i&&(a=this.getColor(e,n))===i&&(a=this.getColor(n,o))===i},r.prototype.getColor=function(t,e){for(var n=this.distancePoint(t,e),o=(e.getX()-t.getX())/n,i=(e.getY()-t.getY())/n,a=0,s=t.getX(),u=t.getY(),c=this.image.get(t.getX(),t.getY()),f=Math.ceil(n),h=0;h<f;h++)s+=o,u+=i,this.image.get(U.round(s),U.round(u))!==c&&a++;var l=a/n;return l>.1&&l<.9?0:l<=.1===c?1:-1},r.prototype.getFirstDifferent=function(t,e,n,o){for(var i=t.getX()+n,a=t.getY()+o;this.isValid(i,a)&&this.image.get(i,a)===e;)i+=n,a+=o;for(i-=n,a-=o;this.isValid(i,a)&&this.image.get(i,a)===e;)i+=n;for(i-=n;this.isValid(i,a)&&this.image.get(i,a)===e;)a+=o;return new dt(i,a-=o)},r.prototype.expandSquare=function(t,e,n){var o=n/(2*e),i=t[0].getX()-t[2].getX(),a=t[0].getY()-t[2].getY(),s=(t[0].getX()+t[2].getX())/2,u=(t[0].getY()+t[2].getY())/2,c=new R(s+o*i,u+o*a),f=new R(s-o*i,u-o*a);return i=t[1].getX()-t[3].getX(),a=t[1].getY()-t[3].getY(),s=(t[1].getX()+t[3].getX())/2,u=(t[1].getY()+t[3].getY())/2,[c,new R(s+o*i,u+o*a),f,new R(s-o*i,u-o*a)]},r.prototype.isValid=function(t,e){return t>=0&&t<this.image.getWidth()&&e>0&&e<this.image.getHeight()},r.prototype.isValidPoint=function(t){var e=U.round(t.getX()),n=U.round(t.getY());return this.isValid(e,n)},r.prototype.distancePoint=function(t,e){return U.distance(t.getX(),t.getY(),e.getX(),e.getY())},r.prototype.distanceResultPoint=function(t,e){return U.distance(t.getX(),t.getY(),e.getX(),e.getY())},r.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(P.truncDivision(this.nbLayers-4,8)+1)+15},r}(),Te=function(){function r(){}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n=null,o=new mn(t.getBlackMatrix()),i=null,a=null;try{i=(s=o.detectMirror(!1)).getPoints(),this.reportFoundResultPoints(e,i),a=new je().decode(s)}catch(h){n=h}if(a==null)try{var s;i=(s=o.detectMirror(!0)).getPoints(),this.reportFoundResultPoints(e,i),a=new je().decode(s)}catch(h){throw n??h}var u=new ft(a.getText(),a.getRawBytes(),a.getNumBits(),i,D.AZTEC,Z.currentTimeMillis()),c=a.getByteSegments();c!=null&&u.putMetadata(ct.BYTE_SEGMENTS,c);var f=a.getECLevel();return f!=null&&u.putMetadata(ct.ERROR_CORRECTION_LEVEL,f),u},r.prototype.reportFoundResultPoints=function(t,e){if(t!=null){var n=t.get(Q.NEED_RESULT_POINT_CALLBACK);n!=null&&e.forEach(function(o,i,a){n.foundPossibleResultPoint(o)})}},r.prototype.reset=function(){},r}(),En=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Aa=function(r){function t(e){return e===void 0&&(e=500),r.call(this,new Te,e)||this}return En(t,r),t}(Vt),ot=function(){function r(){}return r.prototype.decode=function(t,e){try{return this.doDecode(t,e)}catch{if(e&&e.get(Q.TRY_HARDER)===!0&&t.isRotateSupported()){var n=t.rotateCounterClockwise(),o=this.doDecode(n,e),i=o.getResultMetadata(),a=270;i!==null&&i.get(ct.ORIENTATION)===!0&&(a+=i.get(ct.ORIENTATION)%360),o.putMetadata(ct.ORIENTATION,a);var s=o.getResultPoints();if(s!==null)for(var u=n.getHeight(),c=0;c<s.length;c++)s[c]=new R(u-s[c].getY()-1,s[c].getX());return o}throw new E}},r.prototype.reset=function(){},r.prototype.doDecode=function(t,e){var n,o=t.getWidth(),i=t.getHeight(),a=new st(o),s=e&&e.get(Q.TRY_HARDER)===!0,u=Math.max(1,i>>(s?8:5));n=s?i:15;for(var c=Math.trunc(i/2),f=0;f<n;f++){var h=Math.trunc((f+1)/2),l=c+u*(1&f?-h:h);if(l<0||l>=i)break;try{a=t.getBlackRow(l,a)}catch{continue}for(var d=function(w){if(w===1&&(a.reverse(),e&&e.get(Q.NEED_RESULT_POINT_CALLBACK)===!0)){var v=new Map;e.forEach(function(I,S){return v.set(S,I)}),v.delete(Q.NEED_RESULT_POINT_CALLBACK),e=v}try{var _=p.decodeRow(l,a,e);if(w===1){_.putMetadata(ct.ORIENTATION,180);var m=_.getResultPoints();m!==null&&(m[0]=new R(o-m[0].getX()-1,m[0].getY()),m[1]=new R(o-m[1].getX()-1,m[1].getY()))}return{value:_}}catch{}},p=this,y=0;y<2;y++){var C=d(y);if(typeof C=="object")return C.value}}throw new E},r.recordPattern=function(t,e,n){for(var o=n.length,i=0;i<o;i++)n[i]=0;var a=t.getSize();if(e>=a)throw new E;for(var s=!t.get(e),u=0,c=e;c<a;){if(t.get(c)!==s)n[u]++;else{if(++u===o)break;n[u]=1,s=!s}c++}if(u!==o&&(u!==o-1||c!==a))throw new E},r.recordPatternInReverse=function(t,e,n){for(var o=n.length,i=t.get(e);e>0&&o>=0;)t.get(--e)!==i&&(o--,i=!i);if(o>=0)throw new E;r.recordPattern(t,e+1,n)},r.patternMatchVariance=function(t,e,n){for(var o=t.length,i=0,a=0,s=0;s<o;s++)i+=t[s],a+=e[s];if(i<a)return Number.POSITIVE_INFINITY;var u=i/a;n*=u;for(var c=0,f=0;f<o;f++){var h=t[f],l=e[f]*u,d=h>l?h-l:l-h;if(d>n)return Number.POSITIVE_INFINITY;c+=d}return c/i},r}(),In=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ze=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return In(t,r),t.findStartPattern=function(e){for(var n=e.getSize(),o=e.getNextSet(0),i=0,a=Int32Array.from([0,0,0,0,0,0]),s=o,u=!1,c=o;c<n;c++)if(e.get(c)!==u)a[i]++;else{if(i===5){for(var f=t.MAX_AVG_VARIANCE,h=-1,l=t.CODE_START_A;l<=t.CODE_START_C;l++){var d=ot.patternMatchVariance(a,t.CODE_PATTERNS[l],t.MAX_INDIVIDUAL_VARIANCE);d<f&&(f=d,h=l)}if(h>=0&&e.isRange(Math.max(0,s-(c-s)/2),s,!1))return Int32Array.from([s,c,h]);s+=a[0]+a[1],(a=a.slice(2,a.length))[i-1]=0,a[i]=0,i--}else i++;a[i]=1,u=!u}throw new E},t.decodeCode=function(e,n,o){ot.recordPattern(e,o,n);for(var i=t.MAX_AVG_VARIANCE,a=-1,s=0;s<t.CODE_PATTERNS.length;s++){var u=t.CODE_PATTERNS[s],c=this.patternMatchVariance(n,u,t.MAX_INDIVIDUAL_VARIANCE);c<i&&(i=c,a=s)}if(a>=0)return a;throw new E},t.prototype.decodeRow=function(e,n,o){var i,a=o&&o.get(Q.ASSUME_GS1)===!0,s=t.findStartPattern(n),u=s[2],c=0,f=new Uint8Array(20);switch(f[c++]=u,u){case t.CODE_START_A:i=t.CODE_CODE_A;break;case t.CODE_START_B:i=t.CODE_CODE_B;break;case t.CODE_START_C:i=t.CODE_CODE_C;break;default:throw new T}for(var h=!1,l=!1,d="",p=s[0],y=s[1],C=Int32Array.from([0,0,0,0,0,0]),w=0,v=0,_=u,m=0,I=!0,S=!1,O=!1;!h;){var M=l;switch(l=!1,w=v,v=t.decodeCode(n,C,y),f[c++]=v,v!==t.CODE_STOP&&(I=!0),v!==t.CODE_STOP&&(_+=++m*v),p=y,y+=C.reduce(function(Ur,Xr){return Ur+Xr},0),v){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new T}switch(i){case t.CODE_CODE_A:if(v<64)d+=O===S?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),O=!1;else if(v<96)d+=O===S?String.fromCharCode(v-64):String.fromCharCode(v+64),O=!1;else switch(v!==t.CODE_STOP&&(I=!1),v){case t.CODE_FNC_1:a&&(d.length===0?d+="]C1":d+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!S&&O?(S=!0,O=!1):S&&O?(S=!1,O=!1):O=!0;break;case t.CODE_SHIFT:l=!0,i=t.CODE_CODE_B;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:h=!0}break;case t.CODE_CODE_B:if(v<96)d+=O===S?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),O=!1;else switch(v!==t.CODE_STOP&&(I=!1),v){case t.CODE_FNC_1:a&&(d.length===0?d+="]C1":d+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!S&&O?(S=!0,O=!1):S&&O?(S=!1,O=!1):O=!0;break;case t.CODE_SHIFT:l=!0,i=t.CODE_CODE_A;break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:h=!0}break;case t.CODE_CODE_C:if(v<100)v<10&&(d+="0"),d+=v;else switch(v!==t.CODE_STOP&&(I=!1),v){case t.CODE_FNC_1:a&&(d.length===0?d+="]C1":d+=String.fromCharCode(29));break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_STOP:h=!0}}M&&(i=i===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var k=y-p;if(y=n.getNextUnset(y),!n.isRange(y,Math.min(n.getSize(),y+(y-p)/2),!1))throw new E;if((_-=m*w)%103!==w)throw new at;var x=d.length;if(x===0)throw new E;x>0&&I&&(d=i===t.CODE_CODE_C?d.substring(0,x-2):d.substring(0,x-1));for(var J=(s[1]+s[0])/2,W=p+k/2,tt=f.length,It=new Uint8Array(tt),St=0;St<tt;St++)It[St]=f[St];var he=[new R(J,e),new R(W,e)];return new ft(d,It,0,he,D.CODE_128,new Date().getTime())},t.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])],t.MAX_AVG_VARIANCE=.25,t.MAX_INDIVIDUAL_VARIANCE=.7,t.CODE_SHIFT=98,t.CODE_CODE_C=99,t.CODE_CODE_B=100,t.CODE_CODE_A=101,t.CODE_FNC_1=102,t.CODE_FNC_2=97,t.CODE_FNC_3=96,t.CODE_FNC_4_A=101,t.CODE_FNC_4_B=100,t.CODE_START_A=103,t.CODE_START_B=104,t.CODE_START_C=105,t.CODE_STOP=106,t}(ot),Sn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),le=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ke=function(r){function t(e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var o=r.call(this)||this;return o.usingCheckDigit=e,o.extendedMode=n,o.decodeRowResult="",o.counters=new Int32Array(9),o}return Sn(t,r),t.prototype.decodeRow=function(e,n,o){var i,a,s,u,c=this.counters;c.fill(0),this.decodeRowResult="";var f,h,l=t.findAsteriskPattern(n,c),d=n.getNextSet(l[1]),p=n.getSize();do{t.recordPattern(n,d,c);var y=t.toNarrowWidePattern(c);if(y<0)throw new E;f=t.patternToChar(y),this.decodeRowResult+=f,h=d;try{for(var C=(i=void 0,le(c)),w=C.next();!w.done;w=C.next())d+=w.value}catch(J){i={error:J}}finally{try{w&&!w.done&&(a=C.return)&&a.call(C)}finally{if(i)throw i.error}}d=n.getNextSet(d)}while(f!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v,_=0;try{for(var m=le(c),I=m.next();!I.done;I=m.next())_+=I.value}catch(J){s={error:J}}finally{try{I&&!I.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(d!==p&&2*(d-h-_)<_)throw new E;if(this.usingCheckDigit){for(var S=this.decodeRowResult.length-1,O=0,M=0;M<S;M++)O+=t.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(M));if(this.decodeRowResult.charAt(S)!==t.ALPHABET_STRING.charAt(O%43))throw new at;this.decodeRowResult=this.decodeRowResult.substring(0,S)}if(this.decodeRowResult.length===0)throw new E;v=this.extendedMode?t.decodeExtended(this.decodeRowResult):this.decodeRowResult;var k=(l[1]+l[0])/2,x=h+_/2;return new ft(v,null,0,[new R(k,e),new R(x,e)],D.CODE_39,new Date().getTime())},t.findAsteriskPattern=function(e,n){for(var o=e.getSize(),i=e.getNextSet(0),a=0,s=i,u=!1,c=n.length,f=i;f<o;f++)if(e.get(f)!==u)n[a]++;else{if(a===c-1){if(this.toNarrowWidePattern(n)===t.ASTERISK_ENCODING&&e.isRange(Math.max(0,s-Math.floor((f-s)/2)),s,!1))return[s,f];s+=n[0]+n[1],n.copyWithin(0,2,2+a-1),n[a-1]=0,n[a]=0,a--}else a++;n[a]=1,u=!u}throw new E},t.toNarrowWidePattern=function(e){var n,o,i,a=e.length,s=0;do{var u=2147483647;try{for(var c=(n=void 0,le(e)),f=c.next();!f.done;f=c.next())(p=f.value)<u&&p>s&&(u=p)}catch(y){n={error:y}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}s=u,i=0;for(var h=0,l=0,d=0;d<a;d++)(p=e[d])>s&&(l|=1<<a-1-d,i++,h+=p);if(i===3){for(d=0;d<a&&i>0;d++){var p;if((p=e[d])>s&&(i--,2*p>=h))return-1}return l}}while(i>3);return-1},t.patternToChar=function(e){for(var n=0;n<t.CHARACTER_ENCODINGS.length;n++)if(t.CHARACTER_ENCODINGS[n]===e)return t.ALPHABET_STRING.charAt(n);if(e===t.ASTERISK_ENCODING)return"*";throw new E},t.decodeExtended=function(e){for(var n=e.length,o="",i=0;i<n;i++){var a=e.charAt(i);if(a==="+"||a==="$"||a==="%"||a==="/"){var s=e.charAt(i+1),u="\0";switch(a){case"+":if(!(s>="A"&&s<="Z"))throw new T;u=String.fromCharCode(s.charCodeAt(0)+32);break;case"$":if(!(s>="A"&&s<="Z"))throw new T;u=String.fromCharCode(s.charCodeAt(0)-64);break;case"%":if(s>="A"&&s<="E")u=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")u=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")u=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")u=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")u="\0";else if(s==="V")u="@";else if(s==="W")u="`";else{if(s!=="X"&&s!=="Y"&&s!=="Z")throw new T;u="\x7F"}break;case"/":if(s>="A"&&s<="O")u=String.fromCharCode(s.charCodeAt(0)-32);else{if(s!=="Z")throw new T;u=":"}}o+=u,i++}else o+=a}return o},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",t.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],t.ASTERISK_ENCODING=148,t}(ot),Tn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),de=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},qe=function(r){function t(){var e=r.call(this)||this;return e.decodeRowResult="",e.counters=new Int32Array(6),e}return Tn(t,r),t.prototype.decodeRow=function(e,n,o){var i,a,s,u,c,f,h=this.findAsteriskPattern(n),l=n.getNextSet(h[1]),d=n.getSize(),p=this.counters;p.fill(0),this.decodeRowResult="";do{t.recordPattern(n,l,p);var y=this.toPattern(p);if(y<0)throw new E;c=this.patternToChar(y),this.decodeRowResult+=c,f=l;try{for(var C=(i=void 0,de(p)),w=C.next();!w.done;w=C.next())l+=w.value}catch(M){i={error:M}}finally{try{w&&!w.done&&(a=C.return)&&a.call(C)}finally{if(i)throw i.error}}l=n.getNextSet(l)}while(c!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v=0;try{for(var _=de(p),m=_.next();!m.done;m=_.next())v+=m.value}catch(M){s={error:M}}finally{try{m&&!m.done&&(u=_.return)&&u.call(_)}finally{if(s)throw s.error}}if(l===d||!n.get(l))throw new E;if(this.decodeRowResult.length<2)throw new E;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var I=this.decodeExtended(this.decodeRowResult),S=(h[1]+h[0])/2,O=f+v/2;return new ft(I,null,0,[new R(S,e),new R(O,e)],D.CODE_93,new Date().getTime())},t.prototype.findAsteriskPattern=function(e){var n=e.getSize(),o=e.getNextSet(0);this.counters.fill(0);for(var i=this.counters,a=o,s=!1,u=i.length,c=0,f=o;f<n;f++)if(e.get(f)!==s)i[c]++;else{if(c===u-1){if(this.toPattern(i)===t.ASTERISK_ENCODING)return new Int32Array([a,f]);a+=i[0]+i[1],i.copyWithin(0,2,2+c-1),i[c-1]=0,i[c]=0,c--}else c++;i[c]=1,s=!s}throw new E},t.prototype.toPattern=function(e){var n,o,i=0;try{for(var a=de(e),s=a.next();!s.done;s=a.next())i+=s.value}catch(d){n={error:d}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}for(var u=0,c=e.length,f=0;f<c;f++){var h=Math.round(9*e[f]/i);if(h<1||h>4)return-1;if(1&f)u<<=h;else for(var l=0;l<h;l++)u=u<<1|1}return u},t.prototype.patternToChar=function(e){for(var n=0;n<t.CHARACTER_ENCODINGS.length;n++)if(t.CHARACTER_ENCODINGS[n]===e)return t.ALPHABET_STRING.charAt(n);throw new E},t.prototype.decodeExtended=function(e){for(var n=e.length,o="",i=0;i<n;i++){var a=e.charAt(i);if(a>="a"&&a<="d"){if(i>=n-1)throw new T;var s=e.charAt(i+1),u="\0";switch(a){case"d":if(!(s>="A"&&s<="Z"))throw new T;u=String.fromCharCode(s.charCodeAt(0)+32);break;case"a":if(!(s>="A"&&s<="Z"))throw new T;u=String.fromCharCode(s.charCodeAt(0)-64);break;case"b":if(s>="A"&&s<="E")u=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")u=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")u=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")u=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")u="\0";else if(s==="V")u="@";else if(s==="W")u="`";else{if(!(s>="X"&&s<="Z"))throw new T;u=String.fromCharCode(127)}break;case"c":if(s>="A"&&s<="O")u=String.fromCharCode(s.charCodeAt(0)-32);else{if(s!=="Z")throw new T;u=":"}}o+=u,i++}else o+=a}return o},t.prototype.checkChecksums=function(e){var n=e.length;this.checkOneChecksum(e,n-2,20),this.checkOneChecksum(e,n-1,15)},t.prototype.checkOneChecksum=function(e,n,o){for(var i=1,a=0,s=n-1;s>=0;s--)a+=i*t.ALPHABET_STRING.indexOf(e.charAt(s)),++i>o&&(i=1);if(e.charAt(n)!==t.ALPHABET_STRING[a%47])throw new at},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",t.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],t.ASTERISK_ENCODING=t.CHARACTER_ENCODINGS[47],t}(ot),On=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),bn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Qe=function(r){function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return On(t,r),t.prototype.decodeRow=function(e,n,o){var i,a,s=this.decodeStart(n),u=this.decodeEnd(n),c=new B;t.decodeMiddle(n,s[1],u[0],c);var f=c.toString(),h=null;o!=null&&(h=o.get(Q.ALLOWED_LENGTHS)),h==null&&(h=t.DEFAULT_ALLOWED_LENGTHS);var l=f.length,d=!1,p=0;try{for(var y=bn(h),C=y.next();!C.done;C=y.next()){var w=C.value;if(l===w){d=!0;break}w>p&&(p=w)}}catch(_){i={error:_}}finally{try{C&&!C.done&&(a=y.return)&&a.call(y)}finally{if(i)throw i.error}}if(!d&&l>p&&(d=!0),!d)throw new T;var v=[new R(s[1],e),new R(u[0],e)];return new ft(f,null,0,v,D.ITF,new Date().getTime())},t.decodeMiddle=function(e,n,o,i){var a=new Int32Array(10),s=new Int32Array(5),u=new Int32Array(5);for(a.fill(0),s.fill(0),u.fill(0);n<o;){ot.recordPattern(e,n,a);for(var c=0;c<5;c++){var f=2*c;s[c]=a[f],u[c]=a[f+1]}var h=t.decodeDigit(s);i.append(h.toString()),h=this.decodeDigit(u),i.append(h.toString()),a.forEach(function(l){n+=l})}},t.prototype.decodeStart=function(e){var n=t.skipWhiteSpace(e),o=t.findGuardPattern(e,n,t.START_PATTERN);return this.narrowLineWidth=(o[1]-o[0])/4,this.validateQuietZone(e,o[0]),o},t.prototype.validateQuietZone=function(e,n){var o=10*this.narrowLineWidth;o=o<n?o:n;for(var i=n-1;o>0&&i>=0&&!e.get(i);i--)o--;if(o!==0)throw new E},t.skipWhiteSpace=function(e){var n=e.getSize(),o=e.getNextSet(0);if(o===n)throw new E;return o},t.prototype.decodeEnd=function(e){e.reverse();try{var n=t.skipWhiteSpace(e),o=void 0;try{o=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[0])}catch(a){a instanceof E&&(o=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,o[0]);var i=o[0];return o[0]=e.getSize()-o[1],o[1]=e.getSize()-i,o}finally{e.reverse()}},t.findGuardPattern=function(e,n,o){var i=o.length,a=new Int32Array(i),s=e.getSize(),u=!1,c=0,f=n;a.fill(0);for(var h=n;h<s;h++)if(e.get(h)!==u)a[c]++;else{if(c===i-1){if(ot.patternMatchVariance(a,o,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return[f,h];f+=a[0]+a[1],Z.arraycopy(a,2,a,0,c-1),a[c-1]=0,a[c]=0,c--}else c++;a[c]=1,u=!u}throw new E},t.decodeDigit=function(e){for(var n=t.MAX_AVG_VARIANCE,o=-1,i=t.PATTERNS.length,a=0;a<i;a++){var s=t.PATTERNS[a],u=ot.patternMatchVariance(e,s,t.MAX_INDIVIDUAL_VARIANCE);u<n?(n=u,o=a):u===n&&(o=-1)}if(o>=0)return o%10;throw new E},t.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])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}(ot),Rn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),kt=function(r){function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return Rn(t,r),t.findStartGuardPattern=function(e){for(var n,o=!1,i=0,a=Int32Array.from([0,0,0]);!o;){a=Int32Array.from([0,0,0]);var s=(n=t.findGuardPattern(e,i,!1,this.START_END_PATTERN,a))[0],u=s-((i=n[1])-s);u>=0&&(o=e.isRange(u,s,!1))}return n},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var o=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===o},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,o=0,i=n-1;i>=0;i-=2){if((a=e.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new T;o+=a}for(o*=3,i=n-2;i>=0;i-=2){var a;if((a=e.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new T;o+=a}return(1e3-o)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(e,n,o,i){return this.findGuardPattern(e,n,o,i,new Int32Array(i.length))},t.findGuardPattern=function(e,n,o,i,a){for(var s=e.getSize(),u=0,c=n=o?e.getNextUnset(n):e.getNextSet(n),f=i.length,h=o,l=n;l<s;l++)if(e.get(l)!==h)a[u]++;else{if(u===f-1){if(ot.patternMatchVariance(a,i,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return Int32Array.from([c,l]);c+=a[0]+a[1];for(var d=a.slice(2,a.length),p=0;p<u-1;p++)a[p]=d[p];a[u-1]=0,a[u]=0,u--}else u++;a[u]=1,h=!h}throw new E},t.decodeDigit=function(e,n,o,i){this.recordPattern(e,o,n);for(var a=this.MAX_AVG_VARIANCE,s=-1,u=i.length,c=0;c<u;c++){var f=i[c],h=ot.patternMatchVariance(n,f,t.MAX_INDIVIDUAL_VARIANCE);h<a&&(a=h,s=c)}if(s>=0)return s;throw new E},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.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])],t}(ot),Nn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Dn=function(){function r(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(t,e,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(e,n,o),a=o.toString(),s=r.parseExtensionString(a),u=[new R((n[0]+n[1])/2,t),new R(i,t)],c=new ft(a,null,0,u,D.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},r.prototype.decodeMiddle=function(t,e,n){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),u=e[1],c=0,f=0;f<5&&u<s;f++){var h=kt.decodeDigit(t,a,u,kt.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+h%10);try{for(var l=(o=void 0,Nn(a)),d=l.next();!d.done;d=l.next())u+=d.value}catch(y){o={error:y}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}h>=10&&(c|=1<<4-f),f!==4&&(u=t.getNextSet(u),u=t.getNextUnset(u))}if(n.length!==5)throw new E;var p=this.determineCheckDigit(c);if(r.extensionChecksum(n.toString())!==p)throw new E;return u},r.extensionChecksum=function(t){for(var e=t.length,n=0,o=e-2;o>=0;o-=2)n+=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);for(n*=3,o=e-1;o>=0;o-=2)n+=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);return(n*=3)%10},r.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new E},r.parseExtensionString=function(t){if(t.length!==5)return null;var e=r.parseExtension5String(t);return e==null?null:new Map([[ct.SUGGESTED_PRICE,e]])},r.parseExtension5String=function(t){var e;switch(t.charAt(0)){case"0":e="\xA3";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e=""}var n=parseInt(t.substring(1)),o=n%100;return e+(n/100).toString()+"."+(o<10?"0"+o:o.toString())},r}(),Mn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Pn=function(){function r(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(t,e,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(e,n,o),a=o.toString(),s=r.parseExtensionString(a),u=[new R((n[0]+n[1])/2,t),new R(i,t)],c=new ft(a,null,0,u,D.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},r.prototype.decodeMiddle=function(t,e,n){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),u=e[1],c=0,f=0;f<2&&u<s;f++){var h=kt.decodeDigit(t,a,u,kt.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+h%10);try{for(var l=(o=void 0,Mn(a)),d=l.next();!d.done;d=l.next())u+=d.value}catch(p){o={error:p}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}h>=10&&(c|=1<<1-f),f!==1&&(u=t.getNextSet(u),u=t.getNextUnset(u))}if(n.length!==2)throw new E;if(parseInt(n.toString())%4!==c)throw new E;return u},r.parseExtensionString=function(t){return t.length!==2?null:new Map([[ct.ISSUE_NUMBER,parseInt(t)]])},r}(),Bn=function(){function r(){}return r.decodeRow=function(t,e,n){var o=kt.findGuardPattern(e,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new Dn().decodeRow(t,e,o)}catch{return new Pn().decodeRow(t,e,o)}},r.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),r}(),Ln=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),rt=function(r){function t(){var e=r.call(this)||this;e.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var n=10;n<20;n++){for(var o=t.L_PATTERNS[n-10],i=new Int32Array(o.length),a=0;a<o.length;a++)i[a]=o[o.length-a-1];t.L_AND_G_PATTERNS[n]=i}return e}return Ln(t,r),t.prototype.decodeRow=function(e,n,o){var i=t.findStartGuardPattern(n),a=o==null?null:o.get(Q.NEED_RESULT_POINT_CALLBACK);if(a!=null){var s=new R((i[0]+i[1])/2,e);a.foundPossibleResultPoint(s)}var u=this.decodeMiddle(n,i,this.decodeRowStringBuffer),c=u.rowOffset,f=u.resultString;if(a!=null){var h=new R(c,e);a.foundPossibleResultPoint(h)}var l=t.decodeEnd(n,c);if(a!=null){var d=new R((l[0]+l[1])/2,e);a.foundPossibleResultPoint(d)}var p=l[1],y=p+(p-l[0]);if(y>=n.getSize()||!n.isRange(p,y,!1))throw new E;var C=f.toString();if(C.length<8)throw new T;if(!t.checkChecksum(C))throw new at;var w=(i[1]+i[0])/2,v=(l[1]+l[0])/2,_=this.getBarcodeFormat(),m=[new R(w,e),new R(v,e)],I=new ft(C,null,0,m,_,new Date().getTime()),S=0;try{var O=Bn.decodeRow(e,n,l[1]);I.putMetadata(ct.UPC_EAN_EXTENSION,O.getText()),I.putAllMetadata(O.getResultMetadata()),I.addResultPoints(O.getResultPoints()),S=O.getText().length}catch{}var M=o==null?null:o.get(Q.ALLOWED_EAN_EXTENSIONS);if(M!=null){var k=!1;for(var x in M)if(S.toString()===x){k=!0;break}if(!k)throw new E}return _===D.EAN_13||D.UPC_A,I},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var o=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===o},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,o=0,i=n-1;i>=0;i-=2){if((a=e.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new T;o+=a}for(o*=3,i=n-2;i>=0;i-=2){var a;if((a=e.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new T;o+=a}return(1e3-o)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(kt),Fn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Je=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Oe=function(r){function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return Fn(t,r),t.prototype.decodeMiddle=function(e,n,o){var i,a,s,u,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var f=e.getSize(),h=n[1],l=0,d=0;d<6&&h<f;d++){var p=rt.decodeDigit(e,c,h,rt.L_AND_G_PATTERNS);o+=String.fromCharCode("0".charCodeAt(0)+p%10);try{for(var y=(i=void 0,Je(c)),C=y.next();!C.done;C=y.next())h+=C.value}catch(_){i={error:_}}finally{try{C&&!C.done&&(a=y.return)&&a.call(y)}finally{if(i)throw i.error}}p>=10&&(l|=1<<5-d)}for(o=t.determineFirstDigit(o,l),h=rt.findGuardPattern(e,h,!0,rt.MIDDLE_PATTERN,new Int32Array(rt.MIDDLE_PATTERN.length).fill(0))[1],d=0;d<6&&h<f;d++){p=rt.decodeDigit(e,c,h,rt.L_PATTERNS),o+=String.fromCharCode("0".charCodeAt(0)+p);try{for(var w=(s=void 0,Je(c)),v=w.next();!v.done;v=w.next())h+=v.value}catch(_){s={error:_}}finally{try{v&&!v.done&&(u=w.return)&&u.call(w)}finally{if(s)throw s.error}}}return{rowOffset:h,resultString:o}},t.prototype.getBarcodeFormat=function(){return D.EAN_13},t.determineFirstDigit=function(e,n){for(var o=0;o<10;o++)if(n===this.FIRST_DIGIT_ENCODINGS[o])return e=String.fromCharCode("0".charCodeAt(0)+o)+e;throw new E},t.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],t}(rt),xn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),$e=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},tr=function(r){function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return xn(t,r),t.prototype.decodeMiddle=function(e,n,o){var i,a,s,u,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var f=e.getSize(),h=n[1],l=0;l<4&&h<f;l++){var d=rt.decodeDigit(e,c,h,rt.L_PATTERNS);o+=String.fromCharCode("0".charCodeAt(0)+d);try{for(var p=(i=void 0,$e(c)),y=p.next();!y.done;y=p.next())h+=y.value}catch(v){i={error:v}}finally{try{y&&!y.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}for(h=rt.findGuardPattern(e,h,!0,rt.MIDDLE_PATTERN,new Int32Array(rt.MIDDLE_PATTERN.length).fill(0))[1],l=0;l<4&&h<f;l++){d=rt.decodeDigit(e,c,h,rt.L_PATTERNS),o+=String.fromCharCode("0".charCodeAt(0)+d);try{for(var C=(s=void 0,$e(c)),w=C.next();!w.done;w=C.next())h+=w.value}catch(v){s={error:v}}finally{try{w&&!w.done&&(u=C.return)&&u.call(C)}finally{if(s)throw s.error}}}return{rowOffset:h,resultString:o}},t.prototype.getBarcodeFormat=function(){return D.EAN_8},t}(rt),kn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),er=function(r){function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.ean13Reader=new Oe,e}return kn(t,r),t.prototype.getBarcodeFormat=function(){return D.UPC_A},t.prototype.decode=function(e,n){return this.maybeReturnResult(this.ean13Reader.decode(e))},t.prototype.decodeRow=function(e,n,o){return this.maybeReturnResult(this.ean13Reader.decodeRow(e,n,o))},t.prototype.decodeMiddle=function(e,n,o){return this.ean13Reader.decodeMiddle(e,n,o)},t.prototype.maybeReturnResult=function(e){var n=e.getText();if(n.charAt(0)==="0"){var o=new ft(n.substring(1),null,null,e.getResultPoints(),D.UPC_A);return e.getResultMetadata()!=null&&o.putAllMetadata(e.getResultMetadata()),o}throw new E},t.prototype.reset=function(){this.ean13Reader.reset()},t}(rt),Vn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Hn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},rr=function(r){function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return Vn(t,r),t.prototype.decodeMiddle=function(e,n,o){var i,a,s=this.decodeMiddleCounters.map(function(y){return y});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var u=e.getSize(),c=n[1],f=0,h=0;h<6&&c<u;h++){var l=t.decodeDigit(e,s,c,t.L_AND_G_PATTERNS);o+=String.fromCharCode("0".charCodeAt(0)+l%10);try{for(var d=(i=void 0,Hn(s)),p=d.next();!p.done;p=d.next())c+=p.value}catch(y){i={error:y}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}l>=10&&(f|=1<<5-h)}return t.determineNumSysAndCheckDigit(new B(o),f),c},t.prototype.decodeEnd=function(e,n){return t.findGuardPatternWithoutCounters(e,n,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return rt.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,n){for(var o=0;o<=1;o++)for(var i=0;i<10;i++)if(n===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[o][i])return e.insert(0,"0"+o),void e.append("0"+i);throw E.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return D.UPC_E},t.convertUPCEtoUPCA=function(e){var n=e.slice(1,7).split("").map(function(a){return a.charCodeAt(0)}),o=new B;o.append(e.charAt(0));var i=n[5];switch(i){case 0:case 1:case 2:o.appendChars(n,0,2),o.append(i),o.append("0000"),o.appendChars(n,2,3);break;case 3:o.appendChars(n,0,3),o.append("00000"),o.appendChars(n,3,2);break;case 4:o.appendChars(n,0,4),o.append("00000"),o.append(n[4]);break;default:o.appendChars(n,0,5),o.append("0000"),o.append(i)}return e.length>=8&&o.append(e.charAt(7)),o.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.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])],t}(rt),Un=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),nr=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pe=function(r){function t(e){var n=r.call(this)||this,o=e==null?null:e.get(Q.POSSIBLE_FORMATS),i=[];return o!=null&&(o.indexOf(D.EAN_13)>-1&&i.push(new Oe),o.indexOf(D.UPC_A)>-1&&i.push(new er),o.indexOf(D.EAN_8)>-1&&i.push(new tr),o.indexOf(D.UPC_E)>-1&&i.push(new rr)),i.length===0&&(i.push(new Oe),i.push(new er),i.push(new tr),i.push(new rr)),n.readers=i,n}return Un(t,r),t.prototype.decodeRow=function(e,n,o){var i,a;try{for(var s=nr(this.readers),u=s.next();!u.done;u=s.next()){var c=u.value;try{var f=c.decodeRow(e,n,o),h=f.getBarcodeFormat()===D.EAN_13&&f.getText().charAt(0)==="0",l=o==null?null:o.get(Q.POSSIBLE_FORMATS),d=l==null||l.includes(D.UPC_A);if(h&&d){var p=f.getRawBytes(),y=new ft(f.getText().substring(1),p,p?p.length:null,f.getResultPoints(),D.UPC_A);return y.putAllMetadata(f.getResultMetadata()),y}return f}catch{}}}catch(C){i={error:C}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}throw new E},t.prototype.reset=function(){var e,n;try{for(var o=nr(this.readers),i=o.next();!i.done;i=o.next())i.value.reset()}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},t}(ot),Xn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Gn=function(r){function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},e}return Xn(t,r),t.prototype.decodeRow=function(e,n,o){var i=this.getValidRowData(n);if(!i)throw new E;var a=this.codaBarDecodeRow(i.row);if(!a)throw new E;return new ft(a,null,0,[new R(i.left,e),new R(i.right,e)],D.CODABAR,new Date().getTime())},t.prototype.getValidRowData=function(e){var n=e.toArray(),o=n.indexOf(!0);if(o===-1)return null;var i=n.lastIndexOf(!0);if(i<=o)return null;for(var a=[],s=(n=n.slice(o,i+1))[0],u=1,c=1;c<n.length;c++)n[c]===s?u++:(s=n[c],a.push(u),u=1);return a.push(u),a.length<23&&(a.length+1)%8!=0?null:{row:a,left:o,right:i}},t.prototype.codaBarDecodeRow=function(e){for(var n=[],o=Math.ceil(e.reduce(function(s,u){return(s+u)/2},0));e.length>0;){var i=e.splice(0,8).splice(0,7).map(function(s){return s<o?"n":"w"}).join("");if(this.CODA_BAR_CHAR_SET[i]===void 0)return null;n.push(this.CODA_BAR_CHAR_SET[i])}var a=n.join("");return this.validCodaBarString(a)?a:null},t.prototype.validCodaBarString=function(e){return/^[A-D].{1,}[A-D]$/.test(e)},t}(ot),Wn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),zn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Pt=function(r){function t(){var e=r.call(this)||this;return e.decodeFinderCounters=new Int32Array(4),e.dataCharacterCounters=new Int32Array(8),e.oddRoundingErrors=new Array(4),e.evenRoundingErrors=new Array(4),e.oddCounts=new Array(e.dataCharacterCounters.length/2),e.evenCounts=new Array(e.dataCharacterCounters.length/2),e}return Wn(t,r),t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(e,n){for(var o=0;o<n.length;o++)if(ot.patternMatchVariance(e,n[o],t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return o;throw new E},t.count=function(e){return U.sum(new Int32Array(e))},t.increment=function(e,n){for(var o=0,i=n[0],a=1;a<e.length;a++)n[a]>i&&(i=n[a],o=a);e[o]++},t.decrement=function(e,n){for(var o=0,i=n[0],a=1;a<e.length;a++)n[a]<i&&(i=n[a],o=a);e[o]--},t.isFinderPattern=function(e){var n,o,i=e[0]+e[1],a=i/(i+e[2]+e[3]);if(a>=t.MIN_FINDER_PATTERN_RATIO&&a<=t.MAX_FINDER_PATTERN_RATIO){var s=Number.MAX_SAFE_INTEGER,u=Number.MIN_SAFE_INTEGER;try{for(var c=zn(e),f=c.next();!f.done;f=c.next()){var h=f.value;h>u&&(u=h),h<s&&(s=h)}}catch(l){n={error:l}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}return u<10*s}return!1},t.MAX_AVG_VARIANCE=.2,t.MAX_INDIVIDUAL_VARIANCE=.45,t.MIN_FINDER_PATTERN_RATIO=9.5/12,t.MAX_FINDER_PATTERN_RATIO=12.5/14,t}(ot),ae=function(){function r(t,e){this.value=t,this.checksumPortion=e}return r.prototype.getValue=function(){return this.value},r.prototype.getChecksumPortion=function(){return this.checksumPortion},r.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.value===e.value&&this.checksumPortion===e.checksumPortion},r.prototype.hashCode=function(){return this.value^this.checksumPortion},r}(),Tr=function(){function r(t,e,n,o,i){this.value=t,this.startEnd=e,this.value=t,this.startEnd=e,this.resultPoints=new Array,this.resultPoints.push(new R(n,i)),this.resultPoints.push(new R(o,i))}return r.prototype.getValue=function(){return this.value},r.prototype.getStartEnd=function(){return this.startEnd},r.prototype.getResultPoints=function(){return this.resultPoints},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.value===e.value},r.prototype.hashCode=function(){return this.value},r}(),jn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ft=function(){function r(){}return r.getRSSvalue=function(t,e,n){var o,i,a=0;try{for(var s=jn(t),u=s.next();!u.done;u=s.next())a+=u.value}catch(w){o={error:w}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var c=0,f=0,h=t.length,l=0;l<h-1;l++){var d=void 0;for(d=1,f|=1<<l;d<t[l];d++,f&=~(1<<l)){var p=r.combins(a-d-1,h-l-2);if(n&&f===0&&a-d-(h-l-1)>=h-l-1&&(p-=r.combins(a-d-(h-l),h-l-2)),h-l-1>1){for(var y=0,C=a-d-(h-l-2);C>e;C--)y+=r.combins(a-d-C-1,h-l-3);p-=y*(h-1-l)}else a-d>e&&p--;c+=p}a-=d}return c},r.combins=function(t,e){var n,o;t-e>e?(o=e,n=t-e):(o=t-e,n=e);for(var i=1,a=1,s=t;s>n;s--)i*=s,a<=o&&(i/=a,a++);for(;a<=o;)i/=a,a++;return i},r}(),Yn=function(){function r(){}return r.buildBitArray=function(t){var e=2*t.length-1;t[t.length-1].getRightChar()==null&&(e-=1);for(var n=new st(12*e),o=0,i=t[0].getRightChar().getValue(),a=11;a>=0;--a)i&1<<a&&n.set(o),o++;for(a=1;a<t.length;++a){for(var s=t[a],u=s.getLeftChar().getValue(),c=11;c>=0;--c)u&1<<c&&n.set(o),o++;if(s.getRightChar()!==null){var f=s.getRightChar().getValue();for(c=11;c>=0;--c)f&1<<c&&n.set(o),o++}}return n},r}(),Dt=function(){function r(t,e){e?this.decodedInformation=null:(this.finished=t,this.decodedInformation=e)}return r.prototype.getDecodedInformation=function(){return this.decodedInformation},r.prototype.isFinished=function(){return this.finished},r}(),Ve=function(){function r(t){this.newPosition=t}return r.prototype.getNewPosition=function(){return this.newPosition},r}(),Zn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),_t=function(r){function t(e,n){var o=r.call(this,e)||this;return o.value=n,o}return Zn(t,r),t.prototype.getValue=function(){return this.value},t.prototype.isFNC1=function(){return this.value===t.FNC1},t.FNC1="$",t}(Ve),Kn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Mt=function(r){function t(e,n,o){var i=r.call(this,e)||this;return o?(i.remaining=!0,i.remainingValue=i.remainingValue):(i.remaining=!1,i.remainingValue=0),i.newString=n,i}return Kn(t,r),t.prototype.getNewString=function(){return this.newString},t.prototype.isRemaining=function(){return this.remaining},t.prototype.getRemainingValue=function(){return this.remainingValue},t}(Ve),qn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Jt=function(r){function t(e,n,o){var i=r.call(this,e)||this;if(n<0||n>10||o<0||o>10)throw new T;return i.firstDigit=n,i.secondDigit=o,i}return qn(t,r),t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.prototype.isAnyFNC1=function(){return this.firstDigit===t.FNC1||this.secondDigit===t.FNC1},t.FNC1=10,t}(Ve),$t=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Qn=function(){function r(){}return r.parseFieldsInGeneralPurpose=function(t){var e,n,o,i,a,s,u,c;if(!t)return null;if(t.length<2)throw new E;var f=t.substring(0,2);try{for(var h=$t(r.TWO_DIGIT_DATA_LENGTH),l=h.next();!l.done;l=h.next())if((I=l.value)[0]===f)return I[1]===r.VARIABLE_LENGTH?r.processVariableAI(2,I[2],t):r.processFixedAI(2,I[1],t)}catch(S){e={error:S}}finally{try{l&&!l.done&&(n=h.return)&&n.call(h)}finally{if(e)throw e.error}}if(t.length<3)throw new E;var d=t.substring(0,3);try{for(var p=$t(r.THREE_DIGIT_DATA_LENGTH),y=p.next();!y.done;y=p.next())if((I=y.value)[0]===d)return I[1]===r.VARIABLE_LENGTH?r.processVariableAI(3,I[2],t):r.processFixedAI(3,I[1],t)}catch(S){o={error:S}}finally{try{y&&!y.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var C=$t(r.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),w=C.next();!w.done;w=C.next())if((I=w.value)[0]===d)return I[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,I[2],t):r.processFixedAI(4,I[1],t)}catch(S){a={error:S}}finally{try{w&&!w.done&&(s=C.return)&&s.call(C)}finally{if(a)throw a.error}}if(t.length<4)throw new E;var v=t.substring(0,4);try{for(var _=$t(r.FOUR_DIGIT_DATA_LENGTH),m=_.next();!m.done;m=_.next()){var I;if((I=m.value)[0]===v)return I[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,I[2],t):r.processFixedAI(4,I[1],t)}}catch(S){u={error:S}}finally{try{m&&!m.done&&(c=_.return)&&c.call(_)}finally{if(u)throw u.error}}throw new E},r.processFixedAI=function(t,e,n){if(n.length<t)throw new E;var o=n.substring(0,t);if(n.length<t+e)throw new E;var i=n.substring(t,t+e),a=n.substring(t+e),s="("+o+")"+i,u=r.parseFieldsInGeneralPurpose(a);return u==null?s:s+u},r.processVariableAI=function(t,e,n){var o,i=n.substring(0,t);o=n.length<t+e?n.length:t+e;var a=n.substring(t,o),s=n.substring(o),u="("+i+")"+a,c=r.parseFieldsInGeneralPurpose(s);return c==null?u:u+c},r.VARIABLE_LENGTH=[],r.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",r.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",r.VARIABLE_LENGTH,20],["22",r.VARIABLE_LENGTH,29],["30",r.VARIABLE_LENGTH,8],["37",r.VARIABLE_LENGTH,8],["90",r.VARIABLE_LENGTH,30],["91",r.VARIABLE_LENGTH,30],["92",r.VARIABLE_LENGTH,30],["93",r.VARIABLE_LENGTH,30],["94",r.VARIABLE_LENGTH,30],["95",r.VARIABLE_LENGTH,30],["96",r.VARIABLE_LENGTH,30],["97",r.VARIABLE_LENGTH,3],["98",r.VARIABLE_LENGTH,30],["99",r.VARIABLE_LENGTH,30]],r.THREE_DIGIT_DATA_LENGTH=[["240",r.VARIABLE_LENGTH,30],["241",r.VARIABLE_LENGTH,30],["242",r.VARIABLE_LENGTH,6],["250",r.VARIABLE_LENGTH,30],["251",r.VARIABLE_LENGTH,30],["253",r.VARIABLE_LENGTH,17],["254",r.VARIABLE_LENGTH,20],["400",r.VARIABLE_LENGTH,30],["401",r.VARIABLE_LENGTH,30],["402",17],["403",r.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",r.VARIABLE_LENGTH,20],["421",r.VARIABLE_LENGTH,15],["422",3],["423",r.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],r.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",r.VARIABLE_LENGTH,15],["391",r.VARIABLE_LENGTH,18],["392",r.VARIABLE_LENGTH,15],["393",r.VARIABLE_LENGTH,18],["703",r.VARIABLE_LENGTH,30]],r.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",r.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",r.VARIABLE_LENGTH,20],["8003",r.VARIABLE_LENGTH,30],["8004",r.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",r.VARIABLE_LENGTH,30],["8008",r.VARIABLE_LENGTH,12],["8018",18],["8020",r.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",r.VARIABLE_LENGTH,70],["8200",r.VARIABLE_LENGTH,70]],r}(),oe=function(){function r(t){this.buffer=new B,this.information=t}return r.prototype.decodeAllCodes=function(t,e){for(var n=e,o=null;;){var i=this.decodeGeneralPurposeField(n,o),a=Qn.parseFieldsInGeneralPurpose(i.getNewString());if(a!=null&&t.append(a),o=i.isRemaining()?""+i.getRemainingValue():null,n===i.getNewPosition())break;n=i.getNewPosition()}return t.toString()},r.prototype.isStillNumeric=function(t){if(t+7>this.information.getSize())return t+4<=this.information.getSize();for(var e=t;e<t+3;++e)if(this.information.get(e))return!0;return this.information.get(t+3)},r.prototype.decodeNumeric=function(t){if(t+7>this.information.getSize()){var e=this.extractNumericValueFromBitArray(t,4);return new Jt(this.information.getSize(),e===0?Jt.FNC1:e-1,Jt.FNC1)}var n=this.extractNumericValueFromBitArray(t,7);return new Jt(t+7,(n-8)/11,(n-8)%11)},r.prototype.extractNumericValueFromBitArray=function(t,e){return r.extractNumericValueFromBitArray(this.information,t,e)},r.extractNumericValueFromBitArray=function(t,e,n){for(var o=0,i=0;i<n;++i)t.get(e+i)&&(o|=1<<n-i-1);return o},r.prototype.decodeGeneralPurposeField=function(t,e){this.buffer.setLengthToZero(),e!=null&&this.buffer.append(e),this.current.setPosition(t);var n=this.parseBlocks();return n!=null&&n.isRemaining()?new Mt(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new Mt(this.current.getPosition(),this.buffer.toString())},r.prototype.parseBlocks=function(){var t,e;do{var n=this.current.getPosition();if(t=this.current.isAlpha()?(e=this.parseAlphaBlock()).isFinished():this.current.isIsoIec646()?(e=this.parseIsoIec646Block()).isFinished():(e=this.parseNumericBlock()).isFinished(),n===this.current.getPosition()&&!t)break}while(!t);return e.getDecodedInformation()},r.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var t=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFirstDigitFNC1()){var e=void 0;return e=t.isSecondDigitFNC1()?new Mt(this.current.getPosition(),this.buffer.toString()):new Mt(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()),new Dt(!0,e)}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1())return e=new Mt(this.current.getPosition(),this.buffer.toString()),new Dt(!0,e);this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Dt(!1)},r.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var t=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){var e=new Mt(this.current.getPosition(),this.buffer.toString());return new Dt(!0,e)}this.buffer.append(t.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 Dt(!1)},r.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var t=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){var e=new Mt(this.current.getPosition(),this.buffer.toString());return new Dt(!0,e)}this.buffer.append(t.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 Dt(!1)},r.prototype.isStillIsoIec646=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<116)return!0;if(t+8>this.information.getSize())return!1;var o=this.extractNumericValueFromBitArray(t,8);return o>=232&&o<253},r.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new _t(t+5,_t.FNC1);if(e>=5&&e<15)return new _t(t+5,"0"+(e-5));var n,o=this.extractNumericValueFromBitArray(t,7);if(o>=64&&o<90)return new _t(t+7,""+(o+1));if(o>=90&&o<116)return new _t(t+7,""+(o+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:n="!";break;case 233:n='"';break;case 234:n="%";break;case 235:n="&";break;case 236:n="'";break;case 237:n="(";break;case 238:n=")";break;case 239:n="*";break;case 240:n="+";break;case 241:n=",";break;case 242:n="-";break;case 243:n=".";break;case 244:n="/";break;case 245:n=":";break;case 246:n=";";break;case 247:n="<";break;case 248:n="=";break;case 249:n=">";break;case 250:n="?";break;case 251:n="_";break;case 252:n=" ";break;default:throw new T}return new _t(t+8,n)},r.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,6);return n>=16&&n<63},r.prototype.decodeAlphanumeric=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new _t(t+5,_t.FNC1);if(e>=5&&e<15)return new _t(t+5,"0"+(e-5));var n,o=this.extractNumericValueFromBitArray(t,6);if(o>=32&&o<58)return new _t(t+6,""+(o+33));switch(o){case 58:n="*";break;case 59:n=",";break;case 60:n="-";break;case 61:n=".";break;case 62:n="/";break;default:throw new Nt("Decoding invalid alphanumeric value: "+o)}return new _t(t+6,n)},r.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<5&&e+t<this.information.getSize();++e)if(e===2){if(!this.information.get(t+2))return!1}else if(this.information.get(t+e))return!1;return!0},r.prototype.isAlphaOr646ToNumericLatch=function(t){if(t+3>this.information.getSize())return!1;for(var e=t;e<t+3;++e)if(this.information.get(e))return!1;return!0},r.prototype.isNumericToAlphaNumericLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<4&&e+t<this.information.getSize();++e)if(this.information.get(t+e))return!1;return!0},r}(),Or=function(){function r(t){this.information=t,this.generalDecoder=new oe(t)}return r.prototype.getInformation=function(){return this.information},r.prototype.getGeneralDecoder=function(){return this.generalDecoder},r}(),Jn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Et=function(r){function t(e){return r.call(this,e)||this}return Jn(t,r),t.prototype.encodeCompressedGtin=function(e,n){e.append("(01)");var o=e.length();e.append("9"),this.encodeCompressedGtinWithoutAI(e,n,o)},t.prototype.encodeCompressedGtinWithoutAI=function(e,n,o){for(var i=0;i<4;++i){var a=this.getGeneralDecoder().extractNumericValueFromBitArray(n+10*i,10);a/100==0&&e.append("0"),a/10==0&&e.append("0"),e.append(a)}t.appendCheckDigit(e,o)},t.appendCheckDigit=function(e,n){for(var o=0,i=0;i<13;i++){var a=e.charAt(i+n).charCodeAt(0)-"0".charCodeAt(0);o+=1&i?a:3*a}(o=10-o%10)===10&&(o=0),e.append(o)},t.GTIN_SIZE=40,t}(Or),$n=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),to=function(r){function t(e){return r.call(this,e)||this}return $n(t,r),t.prototype.parseInformation=function(){var e=new B;e.append("(01)");var n=e.length(),o=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE,4);return e.append(o),this.encodeCompressedGtinWithoutAI(e,t.HEADER_SIZE+4,n),this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE+44)},t.HEADER_SIZE=4,t}(Et),eo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ro=function(r){function t(e){return r.call(this,e)||this}return eo(t,r),t.prototype.parseInformation=function(){var e=new B;return this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE)},t.HEADER_SIZE=5,t}(Or),no=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ie=function(r){function t(e){return r.call(this,e)||this}return no(t,r),t.prototype.encodeCompressedWeight=function(e,n,o){var i=this.getGeneralDecoder().extractNumericValueFromBitArray(n,o);this.addWeightCode(e,i);for(var a=this.checkWeight(i),s=1e5,u=0;u<5;++u)a/s==0&&e.append("0"),s/=10;e.append(a)},t}(Et),oo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),br=function(r){function t(e){return r.call(this,e)||this}return oo(t,r),t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+ie.GTIN_SIZE+t.WEIGHT_SIZE)throw new E;var e=new B;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+ie.GTIN_SIZE,t.WEIGHT_SIZE),e.toString()},t.HEADER_SIZE=5,t.WEIGHT_SIZE=15,t}(ie),io=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ao=function(r){function t(e){return r.call(this,e)||this}return io(t,r),t.prototype.addWeightCode=function(e,n){e.append("(3103)")},t.prototype.checkWeight=function(e){return e},t}(br),so=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),uo=function(r){function t(e){return r.call(this,e)||this}return so(t,r),t.prototype.addWeightCode=function(e,n){n<1e4?e.append("(3202)"):e.append("(3203)")},t.prototype.checkWeight=function(e){return e<1e4?e:e-1e4},t}(br),co=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),fo=function(r){function t(e){return r.call(this,e)||this}return co(t,r),t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+Et.GTIN_SIZE)throw new E;var e=new B;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Et.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(392"),e.append(n),e.append(")");var o=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+Et.GTIN_SIZE+t.LAST_DIGIT_SIZE,null);return e.append(o.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t}(Et),ho=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),lo=function(r){function t(e){return r.call(this,e)||this}return ho(t,r),t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+Et.GTIN_SIZE)throw new E;var e=new B;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Et.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(393"),e.append(n),e.append(")");var o=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Et.GTIN_SIZE+t.LAST_DIGIT_SIZE,t.FIRST_THREE_DIGITS_SIZE);o/100==0&&e.append("0"),o/10==0&&e.append("0"),e.append(o);var i=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+Et.GTIN_SIZE+t.LAST_DIGIT_SIZE+t.FIRST_THREE_DIGITS_SIZE,null);return e.append(i.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t.FIRST_THREE_DIGITS_SIZE=10,t}(Et),po=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Tt=function(r){function t(e,n,o){var i=r.call(this,e)||this;return i.dateCode=o,i.firstAIdigits=n,i}return po(t,r),t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE+t.DATE_SIZE)throw new E;var e=new B;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+t.GTIN_SIZE,t.WEIGHT_SIZE),this.encodeCompressedDate(e,t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE),e.toString()},t.prototype.encodeCompressedDate=function(e,n){var o=this.getGeneralDecoder().extractNumericValueFromBitArray(n,t.DATE_SIZE);if(o!==38400){e.append("("),e.append(this.dateCode),e.append(")");var i=o%32,a=(o/=32)%12+1,s=o/=12;s/10==0&&e.append("0"),e.append(s),a/10==0&&e.append("0"),e.append(a),i/10==0&&e.append("0"),e.append(i)}},t.prototype.addWeightCode=function(e,n){e.append("("),e.append(this.firstAIdigits),e.append(n/1e5),e.append(")")},t.prototype.checkWeight=function(e){return e%1e5},t.HEADER_SIZE=8,t.WEIGHT_SIZE=20,t.DATE_SIZE=16,t}(ie);function go(r){try{if(r.get(1))return new to(r);if(!r.get(2))return new ro(r);switch(oe.extractNumericValueFromBitArray(r,1,4)){case 4:return new ao(r);case 5:return new uo(r)}switch(oe.extractNumericValueFromBitArray(r,1,5)){case 12:return new fo(r);case 13:return new lo(r)}switch(oe.extractNumericValueFromBitArray(r,1,7)){case 56:return new Tt(r,"310","11");case 57:return new Tt(r,"320","11");case 58:return new Tt(r,"310","13");case 59:return new Tt(r,"320","13");case 60:return new Tt(r,"310","15");case 61:return new Tt(r,"320","15");case 62:return new Tt(r,"310","17");case 63:return new Tt(r,"320","17")}}catch(t){throw console.log(t),new Nt("unknown decoder: "+r)}}var et,or=function(){function r(t,e,n,o){this.leftchar=t,this.rightchar=e,this.finderpattern=n,this.maybeLast=o}return r.prototype.mayBeLast=function(){return this.maybeLast},r.prototype.getLeftChar=function(){return this.leftchar},r.prototype.getRightChar=function(){return this.rightchar},r.prototype.getFinderPattern=function(){return this.finderpattern},r.prototype.mustBeLast=function(){return this.rightchar==null},r.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"},r.equals=function(t,e){return t instanceof r&&r.equalsOrNull(t.leftchar,e.leftchar)&&r.equalsOrNull(t.rightchar,e.rightchar)&&r.equalsOrNull(t.finderpattern,e.finderpattern)},r.equalsOrNull=function(t,e){return t===null?e===null:r.equals(t,e)},r.prototype.hashCode=function(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()},r}(),yo=function(){function r(t,e,n){this.pairs=t,this.rowNumber=e,this.wasReversed=n}return r.prototype.getPairs=function(){return this.pairs},r.prototype.getRowNumber=function(){return this.rowNumber},r.prototype.isReversed=function(){return this.wasReversed},r.prototype.isEquivalent=function(t){return this.checkEqualitity(this,t)},r.prototype.toString=function(){return"{ "+this.pairs+" }"},r.prototype.equals=function(t,e){return t instanceof r&&this.checkEqualitity(t,e)&&t.wasReversed===e.wasReversed},r.prototype.checkEqualitity=function(t,e){var n;if(t&&e)return t.forEach(function(o,i){e.forEach(function(a){o.getLeftChar().getValue()===a.getLeftChar().getValue()&&o.getRightChar().getValue()===a.getRightChar().getValue()&&o.getFinderPatter().getValue()===a.getFinderPatter().getValue()&&(n=!0)})}),n},r}(),wo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ot=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Co=function(r){function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.pairs=new Array(t.MAX_PAIRS),e.rows=new Array,e.startEnd=[2],e}return wo(t,r),t.prototype.decodeRow=function(e,n,o){this.pairs.length=0,this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(e,n))}catch{}return this.pairs.length=0,this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(e,n))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(e,n){for(var o,i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(n,this.pairs,e))}catch(s){if(s instanceof E){if(!this.pairs.length)throw new E;i=!0}}if(this.checkChecksum())return this.pairs;if(o=!!this.rows.length,this.storeRow(e,!1),o){var a=this.checkRowsBoolean(!1);if(a!=null||(a=this.checkRowsBoolean(!0))!=null)return a}throw new E},t.prototype.checkRowsBoolean=function(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&(this.rows=this.rows.reverse());var n=null;try{n=this.checkRows(new Array,0)}catch(o){console.log(o)}return e&&(this.rows=this.rows.reverse()),n},t.prototype.checkRows=function(e,n){for(var o,i,a=n;a<this.rows.length;a++){var s=this.rows[a];this.pairs.length=0;try{for(var u=(o=void 0,Ot(e)),c=u.next();!c.done;c=u.next()){var f=c.value;this.pairs.push(f.getPairs())}}catch(l){o={error:l}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}if(this.pairs.push(s.getPairs()),t.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var h=new Array(e);h.push(s);try{return this.checkRows(h,a+1)}catch(l){console.log(l)}}}throw new E},t.isValidSequence=function(e){var n,o;try{for(var i=Ot(t.FINDER_PATTERN_SEQUENCES),a=i.next();!a.done;a=i.next()){var s=a.value;if(!(e.length>s.length)){for(var u=!0,c=0;c<e.length;c++)if(e[c].getFinderPattern().getValue()!==s[c]){u=!1;break}if(u)return!0}}}catch(f){n={error:f}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return!1},t.prototype.storeRow=function(e,n){for(var o=0,i=!1,a=!1;o<this.rows.length;){var s=this.rows[o];if(s.getRowNumber()>e){a=s.isEquivalent(this.pairs);break}i=s.isEquivalent(this.pairs),o++}a||i||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(o,new yo(this.pairs,e,n)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,n){var o,i,a,s,u,c;try{for(var f=Ot(n),h=f.next();!h.done;h=f.next()){var l=h.value;if(l.getPairs().length!==e.length)try{for(var d=(a=void 0,Ot(l.getPairs())),p=d.next();!p.done;p=d.next()){var y=p.value,C=!1;try{for(var w=(u=void 0,Ot(e)),v=w.next();!v.done;v=w.next()){var _=v.value;if(or.equals(y,_)){C=!0;break}}}catch(m){u={error:m}}finally{try{v&&!v.done&&(c=w.return)&&c.call(w)}finally{if(u)throw u.error}}}}catch(m){a={error:m}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}}}catch(m){o={error:m}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}},t.isPartialRow=function(e,n){var o,i,a,s,u,c;try{for(var f=Ot(n),h=f.next();!h.done;h=f.next()){var l=h.value,d=!0;try{for(var p=(a=void 0,Ot(e)),y=p.next();!y.done;y=p.next()){var C=y.value,w=!1;try{for(var v=(u=void 0,Ot(l.getPairs())),_=v.next();!_.done;_=v.next()){var m=_.value;if(C.equals(m)){w=!0;break}}}catch(I){u={error:I}}finally{try{_&&!_.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}if(!w){d=!1;break}}}catch(I){a={error:I}}finally{try{y&&!y.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}if(d)return!0}}catch(I){o={error:I}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(e){var n=go(Yn.buildBitArray(e)).parseInformation(),o=e[0].getFinderPattern().getResultPoints(),i=e[e.length-1].getFinderPattern().getResultPoints(),a=[o[0],o[1],i[0],i[1]];return new ft(n,null,null,a,D.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs.get(0),n=e.getLeftChar(),o=e.getRightChar();if(o===null)return!1;for(var i=o.getChecksumPortion(),a=2,s=1;s<this.pairs.size();++s){var u=this.pairs.get(s);i+=u.getLeftChar().getChecksumPortion(),a++;var c=u.getRightChar();c!=null&&(i+=c.getChecksumPortion(),a++)}return 211*(a-4)+(i%=211)===n.getValue()},t.getNextSecondBar=function(e,n){var o;return e.get(n)?(o=e.getNextUnset(n),o=e.getNextSet(o)):(o=e.getNextSet(n),o=e.getNextUnset(o)),o},t.prototype.retrieveNextPair=function(e,n,o){var i,a=n.length%2==0;this.startFromEven&&(a=!a);var s=!0,u=-1;do this.findNextPair(e,n,u),(i=this.parseFoundFinderPattern(e,o,a))===null?u=t.getNextSecondBar(e,this.startEnd[0]):s=!1;while(s);var c,f=this.decodeDataCharacter(e,i,a,!0);if(!this.isEmptyPair(n)&&n[n.length-1].mustBeLast())throw new E;try{c=this.decodeDataCharacter(e,i,a,!1)}catch(h){c=null,console.log(h)}return new or(f,c,i,!0)},t.prototype.isEmptyPair=function(e){return e.length===0},t.prototype.findNextPair=function(e,n,o){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;var a,s=e.getSize();o>=0?a=o:this.isEmptyPair(n)?a=0:a=n[n.length-1].getFinderPattern().getStartEnd()[1];var u=n.length%2!=0;this.startFromEven&&(u=!u);for(var c=!1;a<s&&(c=!e.get(a));)a++;for(var f=0,h=a,l=a;l<s;l++)if(e.get(l)!==c)i[f]++;else{if(f===3){if(u&&t.reverseCounters(i),t.isFinderPattern(i))return this.startEnd[0]=h,void(this.startEnd[1]=l);u&&t.reverseCounters(i),h+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,f--}else f++;i[f]=1,c=!c}throw new E},t.reverseCounters=function(e){for(var n=e.length,o=0;o<n/2;++o){var i=e[o];e[o]=e[n-o-1],e[n-o-1]=i}},t.prototype.parseFoundFinderPattern=function(e,n,o){var i,a,s;if(o){for(var u=this.startEnd[0]-1;u>=0&&!e.get(u);)u--;u++,i=this.startEnd[0]-u,a=u,s=this.startEnd[1]}else a=this.startEnd[0],i=(s=e.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var c,f=this.getDecodeFinderCounters();Z.arraycopy(f,0,f,1,f.length-1),f[0]=i;try{c=this.parseFinderValue(f,t.FINDER_PATTERNS)}catch{return null}return new Tr(c,[a,s],a,s,n)},t.prototype.decodeDataCharacter=function(e,n,o,i){for(var a=this.getDataCharacterCounters(),s=0;s<a.length;s++)a[s]=0;if(i)t.recordPatternInReverse(e,n.getStartEnd()[0],a);else{t.recordPattern(e,n.getStartEnd()[1],a);for(var u=0,c=a.length-1;u<c;u++,c--){var f=a[u];a[u]=a[c],a[c]=f}}var h=U.sum(new Int32Array(a))/17,l=(n.getStartEnd()[1]-n.getStartEnd()[0])/15;if(Math.abs(h-l)/l>.3)throw new E;var d=this.getOddCounts(),p=this.getEvenCounts(),y=this.getOddRoundingErrors(),C=this.getEvenRoundingErrors();for(u=0;u<a.length;u++){var w=1*a[u]/h,v=w+.5;if(v<1){if(w<.3)throw new E;v=1}else if(v>8){if(w>8.7)throw new E;v=8}var _=u/2;1&u?(p[_]=v,C[_]=w-v):(d[_]=v,y[_]=w-v)}this.adjustOddEvenCounts(17);var m=4*n.getValue()+(o?0:2)+(i?0:1)-1,I=0,S=0;for(u=d.length-1;u>=0;u--){if(t.isNotA1left(n,o,i)){var O=t.WEIGHTS[m][2*u];S+=d[u]*O}I+=d[u]}var M=0;for(u=p.length-1;u>=0;u--)t.isNotA1left(n,o,i)&&(O=t.WEIGHTS[m][2*u+1],M+=p[u]*O);var k=S+M;if(1&I||I>13||I<4)throw new E;var x=(13-I)/2,J=t.SYMBOL_WIDEST[x],W=9-J,tt=Ft.getRSSvalue(d,J,!0),It=Ft.getRSSvalue(p,W,!1),St=t.EVEN_TOTAL_SUBSET[x],he=t.GSUM[x];return new ae(tt*St+It+he,k)},t.isNotA1left=function(e,n,o){return!(e.getValue()===0&&n&&o)},t.prototype.adjustOddEvenCounts=function(e){var n=U.sum(new Int32Array(this.getOddCounts())),o=U.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1;n>13?a=!0:n<4&&(i=!0);var s=!1,u=!1;o>13?u=!0:o<4&&(s=!0);var c=n+o-e,f=(1&n)==1,h=(1&o)==0;if(c===1)if(f){if(h)throw new E;a=!0}else{if(!h)throw new E;u=!0}else if(c===-1)if(f){if(h)throw new E;i=!0}else{if(!h)throw new E;s=!0}else{if(c!==0)throw new E;if(f){if(!h)throw new E;n<o?(i=!0,u=!0):(a=!0,s=!0)}else if(h)throw new E}if(i){if(a)throw new E;t.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&t.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(u)throw new E;t.increment(this.getEvenCounts(),this.getOddRoundingErrors())}u&&t.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.SYMBOL_WIDEST=[7,5,4,3,1],t.EVEN_TOTAL_SUBSET=[4,20,52,104,204],t.GSUM=[0,348,1388,2948,3988],t.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])],t.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]],t.FINDER_PAT_A=0,t.FINDER_PAT_B=1,t.FINDER_PAT_C=2,t.FINDER_PAT_D=3,t.FINDER_PAT_E=4,t.FINDER_PAT_F=5,t.FINDER_PATTERN_SEQUENCES=[[t.FINDER_PAT_A,t.FINDER_PAT_A],[t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B],[t.FINDER_PAT_A,t.FINDER_PAT_C,t.FINDER_PAT_B,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_C],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F]],t.MAX_PAIRS=11,t}(Pt),vo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ao=function(r){function t(e,n,o){var i=r.call(this,e,n)||this;return i.count=0,i.finderPattern=o,i}return vo(t,r),t.prototype.getFinderPattern=function(){return this.finderPattern},t.prototype.getCount=function(){return this.count},t.prototype.incrementCount=function(){this.count++},t}(ae),_o=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ge=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ir=function(r){function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return _o(t,r),t.prototype.decodeRow=function(e,n,o){var i,a,s,u,c=this.decodePair(n,!1,e,o);t.addOrTally(this.possibleLeftPairs,c),n.reverse();var f=this.decodePair(n,!0,e,o);t.addOrTally(this.possibleRightPairs,f),n.reverse();try{for(var h=ge(this.possibleLeftPairs),l=h.next();!l.done;l=h.next()){var d=l.value;if(d.getCount()>1)try{for(var p=(s=void 0,ge(this.possibleRightPairs)),y=p.next();!y.done;y=p.next()){var C=y.value;if(C.getCount()>1&&t.checkChecksum(d,C))return t.constructResult(d,C)}}catch(w){s={error:w}}finally{try{y&&!y.done&&(u=p.return)&&u.call(p)}finally{if(s)throw s.error}}}}catch(w){i={error:w}}finally{try{l&&!l.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}throw new E},t.addOrTally=function(e,n){var o,i;if(n!=null){var a=!1;try{for(var s=ge(e),u=s.next();!u.done;u=s.next()){var c=u.value;if(c.getValue()===n.getValue()){c.incrementCount(),a=!0;break}}}catch(f){o={error:f}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}a||e.push(n)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,n){for(var o=4537077*e.getValue()+n.getValue(),i=new String(o).toString(),a=new B,s=13-i.length;s>0;s--)a.append("0");a.append(i);var u=0;for(s=0;s<13;s++){var c=a.charAt(s).charCodeAt(0)-"0".charCodeAt(0);u+=1&s?c:3*c}(u=10-u%10)===10&&(u=0),a.append(u.toString());var f=e.getFinderPattern().getResultPoints(),h=n.getFinderPattern().getResultPoints();return new ft(a.toString(),null,0,[f[0],f[1],h[0],h[1]],D.RSS_14,new Date().getTime())},t.checkChecksum=function(e,n){var o=(e.getChecksumPortion()+16*n.getChecksumPortion())%79,i=9*e.getFinderPattern().getValue()+n.getFinderPattern().getValue();return i>72&&i--,i>8&&i--,o===i},t.prototype.decodePair=function(e,n,o,i){try{var a=this.findFinderPattern(e,n),s=this.parseFoundFinderPattern(e,o,n,a),u=i==null?null:i.get(Q.NEED_RESULT_POINT_CALLBACK);if(u!=null){var c=(a[0]+a[1])/2;n&&(c=e.getSize()-1-c),u.foundPossibleResultPoint(new R(c,o))}var f=this.decodeDataCharacter(e,s,!0),h=this.decodeDataCharacter(e,s,!1);return new Ao(1597*f.getValue()+h.getValue(),f.getChecksumPortion()+4*h.getChecksumPortion(),s)}catch{return null}},t.prototype.decodeDataCharacter=function(e,n,o){for(var i=this.getDataCharacterCounters(),a=0;a<i.length;a++)i[a]=0;if(o)ot.recordPatternInReverse(e,n.getStartEnd()[0],i);else{ot.recordPattern(e,n.getStartEnd()[1]+1,i);for(var s=0,u=i.length-1;s<u;s++,u--){var c=i[s];i[s]=i[u],i[u]=c}}var f=o?16:15,h=U.sum(new Int32Array(i))/f,l=this.getOddCounts(),d=this.getEvenCounts(),p=this.getOddRoundingErrors(),y=this.getEvenRoundingErrors();for(s=0;s<i.length;s++){var C=i[s]/h,w=Math.floor(C+.5);w<1?w=1:w>8&&(w=8);var v=Math.floor(s/2);1&s?(d[v]=w,y[v]=C-w):(l[v]=w,p[v]=C-w)}this.adjustOddEvenCounts(o,f);var _=0,m=0;for(s=l.length-1;s>=0;s--)m*=9,m+=l[s],_+=l[s];var I=0,S=0;for(s=d.length-1;s>=0;s--)I*=9,I+=d[s],S+=d[s];var O=m+3*I;if(o){if(1&_||_>12||_<4)throw new E;var M=(12-_)/2,k=9-(It=t.OUTSIDE_ODD_WIDEST[M]),x=Ft.getRSSvalue(l,It,!1),J=Ft.getRSSvalue(d,k,!0),W=t.OUTSIDE_EVEN_TOTAL_SUBSET[M],tt=t.OUTSIDE_GSUM[M];return new ae(x*W+J+tt,O)}if(1&S||S>10||S<4)throw new E;M=(10-S)/2,k=9-(It=t.INSIDE_ODD_WIDEST[M]),x=Ft.getRSSvalue(l,It,!0),J=Ft.getRSSvalue(d,k,!1);var It,St=t.INSIDE_ODD_TOTAL_SUBSET[M];return tt=t.INSIDE_GSUM[M],new ae(J*St+x+tt,O)},t.prototype.findFinderPattern=function(e,n){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var i=e.getSize(),a=!1,s=0;s<i&&n!==(a=!e.get(s));)s++;for(var u=0,c=s,f=s;f<i;f++)if(e.get(f)!==a)o[u]++;else{if(u===3){if(Pt.isFinderPattern(o))return[c,f];c+=o[0]+o[1],o[0]=o[2],o[1]=o[3],o[2]=0,o[3]=0,u--}else u++;o[u]=1,a=!a}throw new E},t.prototype.parseFoundFinderPattern=function(e,n,o,i){for(var a=e.get(i[0]),s=i[0]-1;s>=0&&a!==e.get(s);)s--;s++;var u=i[0]-s,c=this.getDecodeFinderCounters(),f=new Int32Array(c.length);Z.arraycopy(c,0,f,1,c.length-1),f[0]=u;var h=this.parseFinderValue(f,t.FINDER_PATTERNS),l=s,d=i[1];return o&&(l=e.getSize()-1-l,d=e.getSize()-1-d),new Tr(h,[s,i[1]],l,d,n)},t.prototype.adjustOddEvenCounts=function(e,n){var o=U.sum(new Int32Array(this.getOddCounts())),i=U.sum(new Int32Array(this.getEvenCounts())),a=!1,s=!1,u=!1,c=!1;e?(o>12?s=!0:o<4&&(a=!0),i>12?c=!0:i<4&&(u=!0)):(o>11?s=!0:o<5&&(a=!0),i>10?c=!0:i<4&&(u=!0));var f=o+i-n,h=(1&o)==(e?1:0),l=(1&i)==1;if(f===1)if(h){if(l)throw new E;s=!0}else{if(!l)throw new E;c=!0}else if(f===-1)if(h){if(l)throw new E;a=!0}else{if(!l)throw new E;u=!0}else{if(f!==0)throw new E;if(h){if(!l)throw new E;o<i?(a=!0,c=!0):(s=!0,u=!0)}else if(l)throw new E}if(a){if(s)throw new E;Pt.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(s&&Pt.decrement(this.getOddCounts(),this.getOddRoundingErrors()),u){if(c)throw new E;Pt.increment(this.getEvenCounts(),this.getOddRoundingErrors())}c&&Pt.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],t.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],t.OUTSIDE_GSUM=[0,161,961,2015,2715],t.INSIDE_GSUM=[0,336,1036,1516],t.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],t.INSIDE_ODD_WIDEST=[2,4,6,8],t.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])],t}(Pt),mo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Wt=function(r){function t(e){var n=r.call(this)||this;n.readers=[];var o=e?e.get(Q.POSSIBLE_FORMATS):null,i=e&&e.get(Q.ASSUME_CODE_39_CHECK_DIGIT)!==void 0,a=e&&e.get(Q.ENABLE_CODE_39_EXTENDED_MODE)!==void 0;return o&&((o.includes(D.EAN_13)||o.includes(D.UPC_A)||o.includes(D.EAN_8)||o.includes(D.UPC_E))&&n.readers.push(new pe(e)),o.includes(D.CODE_39)&&n.readers.push(new Ke(i,a)),o.includes(D.CODE_93)&&n.readers.push(new qe),o.includes(D.CODE_128)&&n.readers.push(new Ze),o.includes(D.ITF)&&n.readers.push(new Qe),o.includes(D.CODABAR)&&n.readers.push(new Gn),o.includes(D.RSS_14)&&n.readers.push(new ir),o.includes(D.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),n.readers.push(new Co))),n.readers.length===0&&(n.readers.push(new pe(e)),n.readers.push(new Ke),n.readers.push(new qe),n.readers.push(new pe(e)),n.readers.push(new Ze),n.readers.push(new Qe),n.readers.push(new ir)),n}return mo(t,r),t.prototype.decodeRow=function(e,n,o){for(var i=0;i<this.readers.length;i++)try{return this.readers[i].decodeRow(e,n,o)}catch{}throw new E},t.prototype.reset=function(){this.readers.forEach(function(e){return e.reset()})},t}(ot),Eo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),_a=function(r){function t(e,n){return e===void 0&&(e=500),r.call(this,new Wt(n),e,n)||this}return Eo(t,r),t}(Vt),ar=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},G=function(){function r(t,e,n){this.ecCodewords=t,this.ecBlocks=[e],n&&this.ecBlocks.push(n)}return r.prototype.getECCodewords=function(){return this.ecCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r}(),X=function(){function r(t,e){this.count=t,this.dataCodewords=e}return r.prototype.getCount=function(){return this.count},r.prototype.getDataCodewords=function(){return this.dataCodewords},r}(),Io=function(){function r(t,e,n,o,i,a){var s,u;this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=n,this.dataRegionSizeRows=o,this.dataRegionSizeColumns=i,this.ecBlocks=a;var c=0,f=a.getECCodewords(),h=a.getECBlocks();try{for(var l=ar(h),d=l.next();!d.done;d=l.next()){var p=d.value;c+=p.getCount()*(p.getDataCodewords()+f)}}catch(y){s={error:y}}finally{try{d&&!d.done&&(u=l.return)&&u.call(l)}finally{if(s)throw s.error}}this.totalCodewords=c}return r.prototype.getVersionNumber=function(){return this.versionNumber},r.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},r.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},r.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},r.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},r.prototype.getTotalCodewords=function(){return this.totalCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r.getVersionForDimensions=function(t,e){var n,o;if(1&t||1&e)throw new T;try{for(var i=ar(r.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===t&&s.symbolSizeColumns===e)return s}}catch(u){n={error:u}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new T},r.prototype.toString=function(){return""+this.versionNumber},r.buildVersions=function(){return[new r(1,10,10,8,8,new G(5,new X(1,3))),new r(2,12,12,10,10,new G(7,new X(1,5))),new r(3,14,14,12,12,new G(10,new X(1,8))),new r(4,16,16,14,14,new G(12,new X(1,12))),new r(5,18,18,16,16,new G(14,new X(1,18))),new r(6,20,20,18,18,new G(18,new X(1,22))),new r(7,22,22,20,20,new G(20,new X(1,30))),new r(8,24,24,22,22,new G(24,new X(1,36))),new r(9,26,26,24,24,new G(28,new X(1,44))),new r(10,32,32,14,14,new G(36,new X(1,62))),new r(11,36,36,16,16,new G(42,new X(1,86))),new r(12,40,40,18,18,new G(48,new X(1,114))),new r(13,44,44,20,20,new G(56,new X(1,144))),new r(14,48,48,22,22,new G(68,new X(1,174))),new r(15,52,52,24,24,new G(42,new X(2,102))),new r(16,64,64,14,14,new G(56,new X(2,140))),new r(17,72,72,16,16,new G(36,new X(4,92))),new r(18,80,80,18,18,new G(48,new X(4,114))),new r(19,88,88,20,20,new G(56,new X(4,144))),new r(20,96,96,22,22,new G(68,new X(4,174))),new r(21,104,104,24,24,new G(56,new X(6,136))),new r(22,120,120,18,18,new G(68,new X(6,175))),new r(23,132,132,20,20,new G(62,new X(8,163))),new r(24,144,144,22,22,new G(62,new X(8,156),new X(2,155))),new r(25,8,18,6,16,new G(7,new X(1,5))),new r(26,8,32,6,14,new G(11,new X(1,10))),new r(27,12,26,10,24,new G(14,new X(1,16))),new r(28,12,36,10,16,new G(18,new X(1,22))),new r(29,16,36,14,16,new G(24,new X(1,32))),new r(30,16,48,14,22,new G(28,new X(1,49)))]},r.VERSIONS=r.buildVersions(),r}(),So=function(){function r(t){var e=t.getHeight();if(e<8||e>144||1&e)throw new T;this.version=r.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new yt(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return r.prototype.getVersion=function(){return this.version},r.readVersion=function(t){var e=t.getHeight(),n=t.getWidth();return Io.getVersionForDimensions(e,n)},r.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,n=4,o=0,i=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),s=!1,u=!1,c=!1,f=!1;do if(n!==i||o!==0||s)if(n!==i-2||o!==0||!(3&a)||u)if(n!==i+4||o!==2||7&a||c)if(n!==i-2||o!==0||(7&a)!=4||f){do n<i&&o>=0&&!this.readMappingMatrix.get(o,n)&&(t[e++]=255&this.readUtah(n,o,i,a)),n-=2,o+=2;while(n>=0&&o<a);n+=1,o+=3;do n>=0&&o<a&&!this.readMappingMatrix.get(o,n)&&(t[e++]=255&this.readUtah(n,o,i,a)),n+=2,o-=2;while(n<i&&o>=0);n+=3,o+=1}else t[e++]=255&this.readCorner4(i,a),n-=2,o+=2,f=!0;else t[e++]=255&this.readCorner3(i,a),n-=2,o+=2,c=!0;else t[e++]=255&this.readCorner2(i,a),n-=2,o+=2,u=!0;else t[e++]=255&this.readCorner1(i,a),n-=2,o+=2,s=!0;while(n<i||o<a);if(e!==this.version.getTotalCodewords())throw new T;return t},r.prototype.readModule=function(t,e,n,o){return t<0&&(t+=n,e+=4-(n+4&7)),e<0&&(e+=o,t+=4-(o+4&7)),this.readMappingMatrix.set(e,t),this.mappingBitMatrix.get(e,t)},r.prototype.readUtah=function(t,e,n,o){var i=0;return this.readModule(t-2,e-2,n,o)&&(i|=1),i<<=1,this.readModule(t-2,e-1,n,o)&&(i|=1),i<<=1,this.readModule(t-1,e-2,n,o)&&(i|=1),i<<=1,this.readModule(t-1,e-1,n,o)&&(i|=1),i<<=1,this.readModule(t-1,e,n,o)&&(i|=1),i<<=1,this.readModule(t,e-2,n,o)&&(i|=1),i<<=1,this.readModule(t,e-1,n,o)&&(i|=1),i<<=1,this.readModule(t,e,n,o)&&(i|=1),i},r.prototype.readCorner1=function(t,e){var n=0;return this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,1,t,e)&&(n|=1),n<<=1,this.readModule(t-1,2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(2,e-1,t,e)&&(n|=1),n<<=1,this.readModule(3,e-1,t,e)&&(n|=1),n},r.prototype.readCorner2=function(t,e){var n=0;return this.readModule(t-3,0,t,e)&&(n|=1),n<<=1,this.readModule(t-2,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(0,e-4,t,e)&&(n|=1),n<<=1,this.readModule(0,e-3,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n},r.prototype.readCorner3=function(t,e){var n=0;return this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(0,e-3,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-3,t,e)&&(n|=1),n<<=1,this.readModule(1,e-2,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n},r.prototype.readCorner4=function(t,e){var n=0;return this.readModule(t-3,0,t,e)&&(n|=1),n<<=1,this.readModule(t-2,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(2,e-1,t,e)&&(n|=1),n<<=1,this.readModule(3,e-1,t,e)&&(n|=1),n},r.prototype.extractDataRegion=function(t){var e=this.version.getSymbolSizeRows(),n=this.version.getSymbolSizeColumns();if(t.getHeight()!==e)throw new N("Dimension of bitMatrix must match the version size");for(var o=this.version.getDataRegionSizeRows(),i=this.version.getDataRegionSizeColumns(),a=e/o|0,s=n/i|0,u=new yt(s*i,a*o),c=0;c<a;++c)for(var f=c*o,h=0;h<s;++h)for(var l=h*i,d=0;d<o;++d)for(var p=c*(o+2)+1+d,y=f+d,C=0;C<i;++C){var w=h*(i+2)+1+C;if(t.get(w,p)){var v=l+C;u.set(v,y)}}return u},r}(),sr=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},To=function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e){var n,o,i,a,s=e.getECBlocks(),u=0,c=s.getECBlocks();try{for(var f=sr(c),h=f.next();!h.done;h=f.next())u+=(C=h.value).getCount()}catch(tt){n={error:tt}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}var l=new Array(u),d=0;try{for(var p=sr(c),y=p.next();!y.done;y=p.next())for(var C=y.value,w=0;w<C.getCount();w++){var v=C.getDataCodewords(),_=s.getECCodewords()+v;l[d++]=new r(v,new Uint8Array(_))}}catch(tt){i={error:tt}}finally{try{y&&!y.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}var m=l[0].codewords.length-s.getECCodewords(),I=m-1,S=0;for(w=0;w<I;w++)for(var O=0;O<d;O++)l[O].codewords[w]=t[S++];var M=e.getVersionNumber()===24,k=M?8:d;for(O=0;O<k;O++)l[O].codewords[m-1]=t[S++];var x=l[0].codewords.length;for(w=m;w<x;w++)for(O=0;O<d;O++){var J=M?(O+8)%d:O,W=M&&J>7?w-1:w;l[J].codewords[W]=t[S++]}if(S!==t.length)throw new N;return l},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r}(),Rr=function(){function r(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return r.prototype.getBitOffset=function(){return this.bitOffset},r.prototype.getByteOffset=function(){return this.byteOffset},r.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new N(""+t);var e=0,n=this.bitOffset,o=this.byteOffset,i=this.bytes;if(n>0){var a=8-n,s=t<a?t:a,u=255>>8-s<<(c=a-s);e=(i[o]&u)>>c,t-=s,(n+=s)===8&&(n=0,o++)}if(t>0){for(;t>=8;)e=e<<8|255&i[o],o++,t-=8;if(t>0){var c;u=255>>(c=8-t)<<c,e=e<<t|(i[o]&u)>>c,n+=t}}return this.bitOffset=n,this.byteOffset=o,e},r.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},r}();(function(r){r[r.PAD_ENCODE=0]="PAD_ENCODE",r[r.ASCII_ENCODE=1]="ASCII_ENCODE",r[r.C40_ENCODE=2]="C40_ENCODE",r[r.TEXT_ENCODE=3]="TEXT_ENCODE",r[r.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",r[r.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",r[r.BASE256_ENCODE=6]="BASE256_ENCODE"})(et||(et={}));var xt,Oo=function(){function r(){}return r.decode=function(t){var e=new Rr(t),n=new B,o=new B,i=new Array,a=et.ASCII_ENCODE;do if(a===et.ASCII_ENCODE)a=this.decodeAsciiSegment(e,n,o);else{switch(a){case et.C40_ENCODE:this.decodeC40Segment(e,n);break;case et.TEXT_ENCODE:this.decodeTextSegment(e,n);break;case et.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,n);break;case et.EDIFACT_ENCODE:this.decodeEdifactSegment(e,n);break;case et.BASE256_ENCODE:this.decodeBase256Segment(e,n,i);break;default:throw new T}a=et.ASCII_ENCODE}while(a!==et.PAD_ENCODE&&e.available()>0);return o.length()>0&&n.append(o.toString()),new ce(t,n.toString(),i.length===0?null:i,null)},r.decodeAsciiSegment=function(t,e,n){var o=!1;do{var i=t.readBits(8);if(i===0)throw new T;if(i<=128)return o&&(i+=128),e.append(String.fromCharCode(i-1)),et.ASCII_ENCODE;if(i===129)return et.PAD_ENCODE;if(i<=229){var a=i-130;a<10&&e.append("0"),e.append(""+a)}else switch(i){case 230:return et.C40_ENCODE;case 231:return et.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:o=!0;break;case 236:e.append("[)>05"),n.insert(0,"");break;case 237:e.append("[)>06"),n.insert(0,"");break;case 238:return et.ANSIX12_ENCODE;case 239:return et.TEXT_ENCODE;case 240:return et.EDIFACT_ENCODE;default:if(i!==254||t.available()!==0)throw new T}}while(t.available()>0);return et.ASCII_ENCODE},r.decodeC40Segment=function(t,e){var n=!1,o=[],i=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),o);for(var s=0;s<3;s++){var u=o[s];switch(i){case 0:if(u<3)i=u+1;else{if(!(u<this.C40_BASIC_SET_CHARS.length))throw new T;var c=this.C40_BASIC_SET_CHARS[u];n?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):e.append(c)}break;case 1:n?(e.append(String.fromCharCode(u+128)),n=!1):e.append(String.fromCharCode(u)),i=0;break;case 2:if(u<this.C40_SHIFT2_SET_CHARS.length)c=this.C40_SHIFT2_SET_CHARS[u],n?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):e.append(c);else switch(u){case 27:e.append(String.fromCharCode(29));break;case 30:n=!0;break;default:throw new T}i=0;break;case 3:n?(e.append(String.fromCharCode(u+224)),n=!1):e.append(String.fromCharCode(u+96)),i=0;break;default:throw new T}}}while(t.available()>0)},r.decodeTextSegment=function(t,e){var n=!1,o=[],i=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),o);for(var s=0;s<3;s++){var u=o[s];switch(i){case 0:if(u<3)i=u+1;else{if(!(u<this.TEXT_BASIC_SET_CHARS.length))throw new T;var c=this.TEXT_BASIC_SET_CHARS[u];n?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):e.append(c)}break;case 1:n?(e.append(String.fromCharCode(u+128)),n=!1):e.append(String.fromCharCode(u)),i=0;break;case 2:if(u<this.TEXT_SHIFT2_SET_CHARS.length)c=this.TEXT_SHIFT2_SET_CHARS[u],n?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):e.append(c);else switch(u){case 27:e.append(String.fromCharCode(29));break;case 30:n=!0;break;default:throw new T}i=0;break;case 3:if(!(u<this.TEXT_SHIFT3_SET_CHARS.length))throw new T;c=this.TEXT_SHIFT3_SET_CHARS[u],n?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):e.append(c),i=0;break;default:throw new T}}}while(t.available()>0)},r.decodeAnsiX12Segment=function(t,e){var n=[];do{if(t.available()===8)return;var o=t.readBits(8);if(o===254)return;this.parseTwoBytes(o,t.readBits(8),n);for(var i=0;i<3;i++){var a=n[i];switch(a){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(a<14)e.append(String.fromCharCode(a+44));else{if(!(a<40))throw new T;e.append(String.fromCharCode(a+51))}}}}while(t.available()>0)},r.parseTwoBytes=function(t,e,n){var o=(t<<8)+e-1,i=Math.floor(o/1600);n[0]=i,o-=1600*i,i=Math.floor(o/40),n[1]=i,n[2]=o-40*i},r.decodeEdifactSegment=function(t,e){do{if(t.available()<=16)return;for(var n=0;n<4;n++){var o=t.readBits(6);if(o===31){var i=8-t.getBitOffset();return void(i!==8&&t.readBits(i))}!(32&o)&&(o|=64),e.append(String.fromCharCode(o))}}while(t.available()>0)},r.decodeBase256Segment=function(t,e,n){var o,i=1+t.getByteOffset(),a=this.unrandomize255State(t.readBits(8),i++);if((o=a===0?t.available()/8|0:a<250?a:250*(a-249)+this.unrandomize255State(t.readBits(8),i++))<0)throw new T;for(var s=new Uint8Array(o),u=0;u<o;u++){if(t.available()<8)throw new T;s[u]=this.unrandomize255State(t.readBits(8),i++)}n.push(s);try{e.append(At.decode(s,F.ISO88591))}catch(c){throw new Nt("Platform does not support required encoding: "+c.message)}},r.unrandomize255State=function(t,e){var n=t-(149*e%255+1);return n>=0?n:n+256},r.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"],r.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],r.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"],r.TEXT_SHIFT2_SET_CHARS=r.C40_SHIFT2_SET_CHARS,r.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)],r}(),bo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ro=function(){function r(){this.rsDecoder=new fe(gt.DATA_MATRIX_FIELD_256)}return r.prototype.decode=function(t){var e,n,o=new So(t),i=o.getVersion(),a=o.readCodewords(),s=To.getDataBlocks(a,i),u=0;try{for(var c=bo(s),f=c.next();!f.done;f=c.next())u+=f.value.getNumDataCodewords()}catch(v){e={error:v}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}for(var h=new Uint8Array(u),l=s.length,d=0;d<l;d++){var p=s[d],y=p.getCodewords(),C=p.getNumDataCodewords();this.correctErrors(y,C);for(var w=0;w<C;w++)h[w*l+d]=y[w]}return Oo.decode(h)},r.prototype.correctErrors=function(t,e){var n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch{throw new at}for(var o=0;o<e;o++)t[o]=n[o]},r}(),No=function(){function r(t){this.image=t,this.rectangleDetector=new Se(this.image)}return r.prototype.detect=function(){var t=this.rectangleDetector.detect(),e=this.detectSolid1(t);if((e=this.detectSolid2(e))[3]=this.correctTopRight(e),!e[3])throw new E;var n=(e=this.shiftToModuleCenter(e))[0],o=e[1],i=e[2],a=e[3],s=this.transitionsBetween(n,a)+1,u=this.transitionsBetween(i,a)+1;(1&s)==1&&(s+=1),(1&u)==1&&(u+=1),4*s<7*u&&4*u<7*s&&(s=u=Math.max(s,u));var c=r.sampleGrid(this.image,n,o,i,a,s,u);return new xe(c,[n,o,i,a])},r.shiftPoint=function(t,e,n){var o=(e.getX()-t.getX())/(n+1),i=(e.getY()-t.getY())/(n+1);return new R(t.getX()+o,t.getY()+i)},r.moveAway=function(t,e,n){var o=t.getX(),i=t.getY();return o<e?o-=1:o+=1,i<n?i-=1:i+=1,new R(o,i)},r.prototype.detectSolid1=function(t){var e=t[0],n=t[1],o=t[3],i=t[2],a=this.transitionsBetween(e,n),s=this.transitionsBetween(n,o),u=this.transitionsBetween(o,i),c=this.transitionsBetween(i,e),f=a,h=[i,e,n,o];return f>s&&(f=s,h[0]=e,h[1]=n,h[2]=o,h[3]=i),f>u&&(f=u,h[0]=n,h[1]=o,h[2]=i,h[3]=e),f>c&&(h[0]=o,h[1]=i,h[2]=e,h[3]=n),h},r.prototype.detectSolid2=function(t){var e=t[0],n=t[1],o=t[2],i=t[3],a=this.transitionsBetween(e,i),s=r.shiftPoint(n,o,4*(a+1)),u=r.shiftPoint(o,n,4*(a+1));return this.transitionsBetween(s,e)<this.transitionsBetween(u,i)?(t[0]=e,t[1]=n,t[2]=o,t[3]=i):(t[0]=n,t[1]=o,t[2]=i,t[3]=e),t},r.prototype.correctTopRight=function(t){var e=t[0],n=t[1],o=t[2],i=t[3],a=this.transitionsBetween(e,i),s=this.transitionsBetween(n,i),u=r.shiftPoint(e,n,4*(s+1)),c=r.shiftPoint(o,n,4*(a+1));a=this.transitionsBetween(u,i),s=this.transitionsBetween(c,i);var f=new R(i.getX()+(o.getX()-n.getX())/(a+1),i.getY()+(o.getY()-n.getY())/(a+1)),h=new R(i.getX()+(e.getX()-n.getX())/(s+1),i.getY()+(e.getY()-n.getY())/(s+1));return this.isValid(f)?this.isValid(h)?this.transitionsBetween(u,f)+this.transitionsBetween(c,f)>this.transitionsBetween(u,h)+this.transitionsBetween(c,h)?f:h:f:this.isValid(h)?h:null},r.prototype.shiftToModuleCenter=function(t){var e=t[0],n=t[1],o=t[2],i=t[3],a=this.transitionsBetween(e,i)+1,s=this.transitionsBetween(o,i)+1,u=r.shiftPoint(e,n,4*s),c=r.shiftPoint(o,n,4*a);(1&(a=this.transitionsBetween(u,i)+1))==1&&(a+=1),(1&(s=this.transitionsBetween(c,i)+1))==1&&(s+=1);var f,h,l=(e.getX()+n.getX()+o.getX()+i.getX())/4,d=(e.getY()+n.getY()+o.getY()+i.getY())/4;return e=r.moveAway(e,l,d),n=r.moveAway(n,l,d),o=r.moveAway(o,l,d),i=r.moveAway(i,l,d),u=r.shiftPoint(e,n,4*s),u=r.shiftPoint(u,i,4*a),f=r.shiftPoint(n,e,4*s),f=r.shiftPoint(f,o,4*a),c=r.shiftPoint(o,i,4*s),c=r.shiftPoint(c,n,4*a),h=r.shiftPoint(i,o,4*s),[u,f,c,h=r.shiftPoint(h,e,4*a)]},r.prototype.isValid=function(t){return t.getX()>=0&&t.getX()<this.image.getWidth()&&t.getY()>0&&t.getY()<this.image.getHeight()},r.sampleGrid=function(t,e,n,o,i,a,s){return ke.getInstance().sampleGrid(t,a,s,.5,.5,a-.5,.5,a-.5,s-.5,.5,s-.5,e.getX(),e.getY(),i.getX(),i.getY(),o.getX(),o.getY(),n.getX(),n.getY())},r.prototype.transitionsBetween=function(t,e){var n=Math.trunc(t.getX()),o=Math.trunc(t.getY()),i=Math.trunc(e.getX()),a=Math.trunc(e.getY()),s=Math.abs(a-o)>Math.abs(i-n);if(s){var u=n;n=o,o=u,u=i,i=a,a=u}for(var c=Math.abs(i-n),f=Math.abs(a-o),h=-c/2,l=o<a?1:-1,d=n<i?1:-1,p=0,y=this.image.get(s?o:n,s?n:o),C=n,w=o;C!==i;C+=d){var v=this.image.get(s?w:C,s?C:w);if(v!==y&&(p++,y=v),(h+=f)>0){if(w===a)break;w+=l,h-=c}}return p},r}(),be=function(){function r(){this.decoder=new Ro}return r.prototype.decode=function(t,e){var n,o;if(e===void 0&&(e=null),e!=null&&e.has(Q.PURE_BARCODE)){var i=r.extractPureBits(t.getBlackMatrix());n=this.decoder.decode(i),o=r.NO_POINTS}else{var a=new No(t.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=n.getRawBytes(),u=new ft(n.getText(),s,8*s.length,o,D.DATA_MATRIX,Z.currentTimeMillis()),c=n.getByteSegments();c!=null&&u.putMetadata(ct.BYTE_SEGMENTS,c);var f=n.getECLevel();return f!=null&&u.putMetadata(ct.ERROR_CORRECTION_LEVEL,f),u},r.prototype.reset=function(){},r.extractPureBits=function(t){var e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e==null||n==null)throw new E;var o=this.moduleSize(e,t),i=e[1],a=n[1],s=e[0],u=(n[0]-s+1)/o,c=(a-i+1)/o;if(u<=0||c<=0)throw new E;var f=o/2;i+=f,s+=f;for(var h=new yt(u,c),l=0;l<c;l++)for(var d=i+l*o,p=0;p<u;p++)t.get(s+p*o,d)&&h.set(p,l);return h},r.moduleSize=function(t,e){for(var n=e.getWidth(),o=t[0],i=t[1];o<n&&e.get(o,i);)o++;if(o===n)throw new E;var a=o-t[0];if(a===0)throw new E;return a},r.NO_POINTS=[],r}(),Do=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ma=function(r){function t(e){return e===void 0&&(e=500),r.call(this,new be,e)||this}return Do(t,r),t}(Vt);(function(r){r[r.L=0]="L",r[r.M=1]="M",r[r.Q=2]="Q",r[r.H=3]="H"})(xt||(xt={}));var it,Zt=function(){function r(t,e,n){this.value=t,this.stringValue=e,this.bits=n,r.FOR_BITS.set(n,this),r.FOR_VALUE.set(t,this)}return r.prototype.getValue=function(){return this.value},r.prototype.getBits=function(){return this.bits},r.fromString=function(t){switch(t){case"L":return r.L;case"M":return r.M;case"Q":return r.Q;case"H":return r.H;default:throw new mt(t+"not available")}},r.prototype.toString=function(){return this.stringValue},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.value===e.value},r.forBits=function(t){if(t<0||t>=r.FOR_BITS.size)throw new N;return r.FOR_BITS.get(t)},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.L=new r(xt.L,"L",1),r.M=new r(xt.M,"M",0),r.Q=new r(xt.Q,"Q",3),r.H=new r(xt.H,"H",2),r}(),Mo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Nr=function(){function r(t){this.errorCorrectionLevel=Zt.forBits(t>>3&3),this.dataMask=7&t}return r.numBitsDiffering=function(t,e){return P.bitCount(t^e)},r.decodeFormatInformation=function(t,e){var n=r.doDecodeFormatInformation(t,e);return n!==null?n:r.doDecodeFormatInformation(t^r.FORMAT_INFO_MASK_QR,e^r.FORMAT_INFO_MASK_QR)},r.doDecodeFormatInformation=function(t,e){var n,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=Mo(r.FORMAT_INFO_DECODE_LOOKUP),u=s.next();!u.done;u=s.next()){var c=u.value,f=c[0];if(f===t||f===e)return new r(c[1]);var h=r.numBitsDiffering(t,f);h<i&&(a=c[1],i=h),t!==e&&(h=r.numBitsDiffering(e,f))<i&&(a=c[1],i=h)}}catch(l){n={error:l}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i<=3?new r(a):null},r.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},r.prototype.getDataMask=function(){return this.dataMask},r.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.errorCorrectionLevel===e.errorCorrectionLevel&&this.dataMask===e.dataMask},r.FORMAT_INFO_MASK_QR=21522,r.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])],r}(),Po=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},A=function(){function r(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.ecCodewordsPerBlock=t,this.ecBlocks=e}return r.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},r.prototype.getNumBlocks=function(){var t,e,n=0,o=this.ecBlocks;try{for(var i=Po(o),a=i.next();!a.done;a=i.next())n+=a.value.getCount()}catch(s){t={error:s}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return n},r.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},r.prototype.getECBlocks=function(){return this.ecBlocks},r}(),g=function(){function r(t,e){this.count=t,this.dataCodewords=e}return r.prototype.getCount=function(){return this.count},r.prototype.getDataCodewords=function(){return this.dataCodewords},r}(),Bo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Lt=function(){function r(t,e){for(var n,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];this.versionNumber=t,this.alignmentPatternCenters=e,this.ecBlocks=i;var s=0,u=i[0].getECCodewordsPerBlock(),c=i[0].getECBlocks();try{for(var f=Bo(c),h=f.next();!h.done;h=f.next()){var l=h.value;s+=l.getCount()*(l.getDataCodewords()+u)}}catch(d){n={error:d}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}this.totalCodewords=s}return r.prototype.getVersionNumber=function(){return this.versionNumber},r.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},r.prototype.getTotalCodewords=function(){return this.totalCodewords},r.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},r.prototype.getECBlocksForLevel=function(t){return this.ecBlocks[t.getValue()]},r.getProvisionalVersionForDimension=function(t){if(t%4!=1)throw new T;try{return this.getVersionForNumber((t-17)/4)}catch{throw new T}},r.getVersionForNumber=function(t){if(t<1||t>40)throw new N;return r.VERSIONS[t-1]},r.decodeVersionInformation=function(t){for(var e=Number.MAX_SAFE_INTEGER,n=0,o=0;o<r.VERSION_DECODE_INFO.length;o++){var i=r.VERSION_DECODE_INFO[o];if(i===t)return r.getVersionForNumber(o+7);var a=Nr.numBitsDiffering(t,i);a<e&&(n=o+7,e=a)}return e<=3?r.getVersionForNumber(n):null},r.prototype.buildFunctionPattern=function(){var t=this.getDimensionForVersion(),e=new yt(t);e.setRegion(0,0,9,9),e.setRegion(t-8,0,8,9),e.setRegion(0,t-8,9,8);for(var n=this.alignmentPatternCenters.length,o=0;o<n;o++)for(var i=this.alignmentPatternCenters[o]-2,a=0;a<n;a++)o===0&&(a===0||a===n-1)||o===n-1&&a===0||e.setRegion(this.alignmentPatternCenters[a]-2,i,5,5);return e.setRegion(6,9,1,t-17),e.setRegion(9,6,t-17,1),this.versionNumber>6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e},r.prototype.toString=function(){return""+this.versionNumber},r.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]),r.VERSIONS=[new r(1,new Int32Array(0),new A(7,new g(1,19)),new A(10,new g(1,16)),new A(13,new g(1,13)),new A(17,new g(1,9))),new r(2,Int32Array.from([6,18]),new A(10,new g(1,34)),new A(16,new g(1,28)),new A(22,new g(1,22)),new A(28,new g(1,16))),new r(3,Int32Array.from([6,22]),new A(15,new g(1,55)),new A(26,new g(1,44)),new A(18,new g(2,17)),new A(22,new g(2,13))),new r(4,Int32Array.from([6,26]),new A(20,new g(1,80)),new A(18,new g(2,32)),new A(26,new g(2,24)),new A(16,new g(4,9))),new r(5,Int32Array.from([6,30]),new A(26,new g(1,108)),new A(24,new g(2,43)),new A(18,new g(2,15),new g(2,16)),new A(22,new g(2,11),new g(2,12))),new r(6,Int32Array.from([6,34]),new A(18,new g(2,68)),new A(16,new g(4,27)),new A(24,new g(4,19)),new A(28,new g(4,15))),new r(7,Int32Array.from([6,22,38]),new A(20,new g(2,78)),new A(18,new g(4,31)),new A(18,new g(2,14),new g(4,15)),new A(26,new g(4,13),new g(1,14))),new r(8,Int32Array.from([6,24,42]),new A(24,new g(2,97)),new A(22,new g(2,38),new g(2,39)),new A(22,new g(4,18),new g(2,19)),new A(26,new g(4,14),new g(2,15))),new r(9,Int32Array.from([6,26,46]),new A(30,new g(2,116)),new A(22,new g(3,36),new g(2,37)),new A(20,new g(4,16),new g(4,17)),new A(24,new g(4,12),new g(4,13))),new r(10,Int32Array.from([6,28,50]),new A(18,new g(2,68),new g(2,69)),new A(26,new g(4,43),new g(1,44)),new A(24,new g(6,19),new g(2,20)),new A(28,new g(6,15),new g(2,16))),new r(11,Int32Array.from([6,30,54]),new A(20,new g(4,81)),new A(30,new g(1,50),new g(4,51)),new A(28,new g(4,22),new g(4,23)),new A(24,new g(3,12),new g(8,13))),new r(12,Int32Array.from([6,32,58]),new A(24,new g(2,92),new g(2,93)),new A(22,new g(6,36),new g(2,37)),new A(26,new g(4,20),new g(6,21)),new A(28,new g(7,14),new g(4,15))),new r(13,Int32Array.from([6,34,62]),new A(26,new g(4,107)),new A(22,new g(8,37),new g(1,38)),new A(24,new g(8,20),new g(4,21)),new A(22,new g(12,11),new g(4,12))),new r(14,Int32Array.from([6,26,46,66]),new A(30,new g(3,115),new g(1,116)),new A(24,new g(4,40),new g(5,41)),new A(20,new g(11,16),new g(5,17)),new A(24,new g(11,12),new g(5,13))),new r(15,Int32Array.from([6,26,48,70]),new A(22,new g(5,87),new g(1,88)),new A(24,new g(5,41),new g(5,42)),new A(30,new g(5,24),new g(7,25)),new A(24,new g(11,12),new g(7,13))),new r(16,Int32Array.from([6,26,50,74]),new A(24,new g(5,98),new g(1,99)),new A(28,new g(7,45),new g(3,46)),new A(24,new g(15,19),new g(2,20)),new A(30,new g(3,15),new g(13,16))),new r(17,Int32Array.from([6,30,54,78]),new A(28,new g(1,107),new g(5,108)),new A(28,new g(10,46),new g(1,47)),new A(28,new g(1,22),new g(15,23)),new A(28,new g(2,14),new g(17,15))),new r(18,Int32Array.from([6,30,56,82]),new A(30,new g(5,120),new g(1,121)),new A(26,new g(9,43),new g(4,44)),new A(28,new g(17,22),new g(1,23)),new A(28,new g(2,14),new g(19,15))),new r(19,Int32Array.from([6,30,58,86]),new A(28,new g(3,113),new g(4,114)),new A(26,new g(3,44),new g(11,45)),new A(26,new g(17,21),new g(4,22)),new A(26,new g(9,13),new g(16,14))),new r(20,Int32Array.from([6,34,62,90]),new A(28,new g(3,107),new g(5,108)),new A(26,new g(3,41),new g(13,42)),new A(30,new g(15,24),new g(5,25)),new A(28,new g(15,15),new g(10,16))),new r(21,Int32Array.from([6,28,50,72,94]),new A(28,new g(4,116),new g(4,117)),new A(26,new g(17,42)),new A(28,new g(17,22),new g(6,23)),new A(30,new g(19,16),new g(6,17))),new r(22,Int32Array.from([6,26,50,74,98]),new A(28,new g(2,111),new g(7,112)),new A(28,new g(17,46)),new A(30,new g(7,24),new g(16,25)),new A(24,new g(34,13))),new r(23,Int32Array.from([6,30,54,78,102]),new A(30,new g(4,121),new g(5,122)),new A(28,new g(4,47),new g(14,48)),new A(30,new g(11,24),new g(14,25)),new A(30,new g(16,15),new g(14,16))),new r(24,Int32Array.from([6,28,54,80,106]),new A(30,new g(6,117),new g(4,118)),new A(28,new g(6,45),new g(14,46)),new A(30,new g(11,24),new g(16,25)),new A(30,new g(30,16),new g(2,17))),new r(25,Int32Array.from([6,32,58,84,110]),new A(26,new g(8,106),new g(4,107)),new A(28,new g(8,47),new g(13,48)),new A(30,new g(7,24),new g(22,25)),new A(30,new g(22,15),new g(13,16))),new r(26,Int32Array.from([6,30,58,86,114]),new A(28,new g(10,114),new g(2,115)),new A(28,new g(19,46),new g(4,47)),new A(28,new g(28,22),new g(6,23)),new A(30,new g(33,16),new g(4,17))),new r(27,Int32Array.from([6,34,62,90,118]),new A(30,new g(8,122),new g(4,123)),new A(28,new g(22,45),new g(3,46)),new A(30,new g(8,23),new g(26,24)),new A(30,new g(12,15),new g(28,16))),new r(28,Int32Array.from([6,26,50,74,98,122]),new A(30,new g(3,117),new g(10,118)),new A(28,new g(3,45),new g(23,46)),new A(30,new g(4,24),new g(31,25)),new A(30,new g(11,15),new g(31,16))),new r(29,Int32Array.from([6,30,54,78,102,126]),new A(30,new g(7,116),new g(7,117)),new A(28,new g(21,45),new g(7,46)),new A(30,new g(1,23),new g(37,24)),new A(30,new g(19,15),new g(26,16))),new r(30,Int32Array.from([6,26,52,78,104,130]),new A(30,new g(5,115),new g(10,116)),new A(28,new g(19,47),new g(10,48)),new A(30,new g(15,24),new g(25,25)),new A(30,new g(23,15),new g(25,16))),new r(31,Int32Array.from([6,30,56,82,108,134]),new A(30,new g(13,115),new g(3,116)),new A(28,new g(2,46),new g(29,47)),new A(30,new g(42,24),new g(1,25)),new A(30,new g(23,15),new g(28,16))),new r(32,Int32Array.from([6,34,60,86,112,138]),new A(30,new g(17,115)),new A(28,new g(10,46),new g(23,47)),new A(30,new g(10,24),new g(35,25)),new A(30,new g(19,15),new g(35,16))),new r(33,Int32Array.from([6,30,58,86,114,142]),new A(30,new g(17,115),new g(1,116)),new A(28,new g(14,46),new g(21,47)),new A(30,new g(29,24),new g(19,25)),new A(30,new g(11,15),new g(46,16))),new r(34,Int32Array.from([6,34,62,90,118,146]),new A(30,new g(13,115),new g(6,116)),new A(28,new g(14,46),new g(23,47)),new A(30,new g(44,24),new g(7,25)),new A(30,new g(59,16),new g(1,17))),new r(35,Int32Array.from([6,30,54,78,102,126,150]),new A(30,new g(12,121),new g(7,122)),new A(28,new g(12,47),new g(26,48)),new A(30,new g(39,24),new g(14,25)),new A(30,new g(22,15),new g(41,16))),new r(36,Int32Array.from([6,24,50,76,102,128,154]),new A(30,new g(6,121),new g(14,122)),new A(28,new g(6,47),new g(34,48)),new A(30,new g(46,24),new g(10,25)),new A(30,new g(2,15),new g(64,16))),new r(37,Int32Array.from([6,28,54,80,106,132,158]),new A(30,new g(17,122),new g(4,123)),new A(28,new g(29,46),new g(14,47)),new A(30,new g(49,24),new g(10,25)),new A(30,new g(24,15),new g(46,16))),new r(38,Int32Array.from([6,32,58,84,110,136,162]),new A(30,new g(4,122),new g(18,123)),new A(28,new g(13,46),new g(32,47)),new A(30,new g(48,24),new g(14,25)),new A(30,new g(42,15),new g(32,16))),new r(39,Int32Array.from([6,26,54,82,110,138,166]),new A(30,new g(20,117),new g(4,118)),new A(28,new g(40,47),new g(7,48)),new A(30,new g(43,24),new g(22,25)),new A(30,new g(10,15),new g(67,16))),new r(40,Int32Array.from([6,30,58,86,114,142,170]),new A(30,new g(19,118),new g(6,119)),new A(28,new g(18,47),new g(31,48)),new A(30,new g(34,24),new g(34,25)),new A(30,new g(20,15),new g(61,16)))],r}();(function(r){r[r.DATA_MASK_000=0]="DATA_MASK_000",r[r.DATA_MASK_001=1]="DATA_MASK_001",r[r.DATA_MASK_010=2]="DATA_MASK_010",r[r.DATA_MASK_011=3]="DATA_MASK_011",r[r.DATA_MASK_100=4]="DATA_MASK_100",r[r.DATA_MASK_101=5]="DATA_MASK_101",r[r.DATA_MASK_110=6]="DATA_MASK_110",r[r.DATA_MASK_111=7]="DATA_MASK_111"})(it||(it={}));var Ct,ur=function(){function r(t,e){this.value=t,this.isMasked=e}return r.prototype.unmaskBitMatrix=function(t,e){for(var n=0;n<e;n++)for(var o=0;o<e;o++)this.isMasked(n,o)&&t.flip(o,n)},r.values=new Map([[it.DATA_MASK_000,new r(it.DATA_MASK_000,function(t,e){return(t+e&1)==0})],[it.DATA_MASK_001,new r(it.DATA_MASK_001,function(t,e){return(1&t)==0})],[it.DATA_MASK_010,new r(it.DATA_MASK_010,function(t,e){return e%3==0})],[it.DATA_MASK_011,new r(it.DATA_MASK_011,function(t,e){return(t+e)%3==0})],[it.DATA_MASK_100,new r(it.DATA_MASK_100,function(t,e){return(Math.floor(t/2)+Math.floor(e/3)&1)==0})],[it.DATA_MASK_101,new r(it.DATA_MASK_101,function(t,e){return t*e%6==0})],[it.DATA_MASK_110,new r(it.DATA_MASK_110,function(t,e){return t*e%6<3})],[it.DATA_MASK_111,new r(it.DATA_MASK_111,function(t,e){return(t+e+t*e%3&1)==0})]]),r}(),Lo=function(){function r(t){var e=t.getHeight();if(e<21||(3&e)!=1)throw new T;this.bitMatrix=t}return r.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;for(var t=0,e=0;e<6;e++)t=this.copyBit(e,8,t);t=this.copyBit(7,8,t),t=this.copyBit(8,8,t),t=this.copyBit(8,7,t);for(var n=5;n>=0;n--)t=this.copyBit(8,n,t);var o=this.bitMatrix.getHeight(),i=0,a=o-7;for(n=o-1;n>=a;n--)i=this.copyBit(8,n,i);for(e=o-8;e<o;e++)i=this.copyBit(e,8,i);if(this.parsedFormatInfo=Nr.decodeFormatInformation(t,i),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new T},r.prototype.readVersion=function(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;var t=this.bitMatrix.getHeight(),e=Math.floor((t-17)/4);if(e<=6)return Lt.getVersionForNumber(e);for(var n=0,o=t-11,i=5;i>=0;i--)for(var a=t-9;a>=o;a--)n=this.copyBit(a,i,n);var s=Lt.decodeVersionInformation(n);if(s!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;for(n=0,a=5;a>=0;a--)for(i=t-9;i>=o;i--)n=this.copyBit(a,i,n);if((s=Lt.decodeVersionInformation(n))!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;throw new T},r.prototype.copyBit=function(t,e,n){return(this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e))?n<<1|1:n<<1},r.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),n=ur.values.get(t.getDataMask()),o=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,o);for(var i=e.buildFunctionPattern(),a=!0,s=new Uint8Array(e.getTotalCodewords()),u=0,c=0,f=0,h=o-1;h>0;h-=2){h===6&&h--;for(var l=0;l<o;l++)for(var d=a?o-1-l:l,p=0;p<2;p++)i.get(h-p,d)||(f++,c<<=1,this.bitMatrix.get(h-p,d)&&(c|=1),f===8&&(s[u++]=c,f=0,c=0));a=!a}if(u!==e.getTotalCodewords())throw new T;return s},r.prototype.remask=function(){if(this.parsedFormatInfo!==null){var t=ur.values[this.parsedFormatInfo.getDataMask()],e=this.bitMatrix.getHeight();t.unmaskBitMatrix(this.bitMatrix,e)}},r.prototype.setMirror=function(t){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=t},r.prototype.mirror=function(){for(var t=this.bitMatrix,e=0,n=t.getWidth();e<n;e++)for(var o=e+1,i=t.getHeight();o<i;o++)t.get(e,o)!==t.get(o,e)&&(t.flip(o,e),t.flip(e,o))},r}(),cr=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fo=function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e,n){var o,i,a,s;if(t.length!==e.getTotalCodewords())throw new N;var u=e.getECBlocksForLevel(n),c=0,f=u.getECBlocks();try{for(var h=cr(f),l=h.next();!l.done;l=h.next())c+=(w=l.value).getCount()}catch(W){o={error:W}}finally{try{l&&!l.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}var d=new Array(c),p=0;try{for(var y=cr(f),C=y.next();!C.done;C=y.next())for(var w=C.value,v=0;v<w.getCount();v++){var _=w.getDataCodewords(),m=u.getECCodewordsPerBlock()+_;d[p++]=new r(_,new Uint8Array(m))}}catch(W){a={error:W}}finally{try{C&&!C.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}for(var I=d[0].codewords.length,S=d.length-1;S>=0&&d[S].codewords.length!==I;)S--;S++;var O=I-u.getECCodewordsPerBlock(),M=0;for(v=0;v<O;v++)for(var k=0;k<p;k++)d[k].codewords[v]=t[M++];for(k=S;k<p;k++)d[k].codewords[O]=t[M++];var x=d[0].codewords.length;for(v=O;v<x;v++)for(k=0;k<p;k++){var J=k<S?v:v+1;d[k].codewords[J]=t[M++]}return d},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r}();(function(r){r[r.TERMINATOR=0]="TERMINATOR",r[r.NUMERIC=1]="NUMERIC",r[r.ALPHANUMERIC=2]="ALPHANUMERIC",r[r.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",r[r.BYTE=4]="BYTE",r[r.ECI=5]="ECI",r[r.KANJI=6]="KANJI",r[r.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",r[r.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",r[r.HANZI=9]="HANZI"})(Ct||(Ct={}));var Y,te,q=function(){function r(t,e,n,o){this.value=t,this.stringValue=e,this.characterCountBitsForVersions=n,this.bits=o,r.FOR_BITS.set(o,this),r.FOR_VALUE.set(t,this)}return r.forBits=function(t){var e=r.FOR_BITS.get(t);if(e===void 0)throw new N;return e},r.prototype.getCharacterCountBits=function(t){var e,n=t.getVersionNumber();return e=n<=9?0:n<=26?1:2,this.characterCountBitsForVersions[e]},r.prototype.getValue=function(){return this.value},r.prototype.getBits=function(){return this.bits},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.value===e.value},r.prototype.toString=function(){return this.stringValue},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.TERMINATOR=new r(Ct.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),r.NUMERIC=new r(Ct.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),r.ALPHANUMERIC=new r(Ct.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),r.STRUCTURED_APPEND=new r(Ct.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),r.BYTE=new r(Ct.BYTE,"BYTE",Int32Array.from([8,16,16]),4),r.ECI=new r(Ct.ECI,"ECI",Int32Array.from([0,0,0]),7),r.KANJI=new r(Ct.KANJI,"KANJI",Int32Array.from([8,10,12]),8),r.FNC1_FIRST_POSITION=new r(Ct.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),r.FNC1_SECOND_POSITION=new r(Ct.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),r.HANZI=new r(Ct.HANZI,"HANZI",Int32Array.from([8,10,12]),13),r}(),xo=function(){function r(){}return r.decode=function(t,e,n,o){var i=new Rr(t),a=new B,s=new Array,u=-1,c=-1;try{var f=null,h=!1,l=void 0;do{if(i.available()<4)l=q.TERMINATOR;else{var d=i.readBits(4);l=q.forBits(d)}switch(l){case q.TERMINATOR:break;case q.FNC1_FIRST_POSITION:case q.FNC1_SECOND_POSITION:h=!0;break;case q.STRUCTURED_APPEND:if(i.available()<16)throw new T;u=i.readBits(8),c=i.readBits(8);break;case q.ECI:var p=r.parseECIValue(i);if((f=nt.getCharacterSetECIByValue(p))===null)throw new T;break;case q.HANZI:var y=i.readBits(4),C=i.readBits(l.getCharacterCountBits(e));y===r.GB2312_SUBSET&&r.decodeHanziSegment(i,a,C);break;default:var w=i.readBits(l.getCharacterCountBits(e));switch(l){case q.NUMERIC:r.decodeNumericSegment(i,a,w);break;case q.ALPHANUMERIC:r.decodeAlphanumericSegment(i,a,w,h);break;case q.BYTE:r.decodeByteSegment(i,a,w,f,s,o);break;case q.KANJI:r.decodeKanjiSegment(i,a,w);break;default:throw new T}}}while(l!==q.TERMINATOR)}catch{throw new T}return new ce(t,a.toString(),s.length===0?null:s,n===null?null:n.toString(),u,c)},r.decodeHanziSegment=function(t,e,n){if(13*n>t.available())throw new T;for(var o=new Uint8Array(2*n),i=0;n>0;){var a=t.readBits(13),s=a/96<<8&4294967295|a%96;s+=s<959?41377:42657,o[i]=s>>8&255,o[i+1]=255&s,i+=2,n--}try{e.append(At.decode(o,F.GB2312))}catch(u){throw new T(u)}},r.decodeKanjiSegment=function(t,e,n){if(13*n>t.available())throw new T;for(var o=new Uint8Array(2*n),i=0;n>0;){var a=t.readBits(13),s=a/192<<8&4294967295|a%192;s+=s<7936?33088:49472,o[i]=s>>8,o[i+1]=s,i+=2,n--}try{e.append(At.decode(o,F.SHIFT_JIS))}catch(u){throw new T(u)}},r.decodeByteSegment=function(t,e,n,o,i,a){if(8*n>t.available())throw new T;for(var s,u=new Uint8Array(n),c=0;c<n;c++)u[c]=t.readBits(8);s=o===null?F.guessEncoding(u,a):o.getName();try{e.append(At.decode(u,s))}catch(f){throw new T(f)}i.push(u)},r.toAlphaNumericChar=function(t){if(t>=r.ALPHANUMERIC_CHARS.length)throw new T;return r.ALPHANUMERIC_CHARS[t]},r.decodeAlphanumericSegment=function(t,e,n,o){for(var i=e.length();n>1;){if(t.available()<11)throw new T;var a=t.readBits(11);e.append(r.toAlphaNumericChar(Math.floor(a/45))),e.append(r.toAlphaNumericChar(a%45)),n-=2}if(n===1){if(t.available()<6)throw new T;e.append(r.toAlphaNumericChar(t.readBits(6)))}if(o)for(var s=i;s<e.length();s++)e.charAt(s)==="%"&&(s<e.length()-1&&e.charAt(s+1)==="%"?e.deleteCharAt(s+1):e.setCharAt(s,String.fromCharCode(29)))},r.decodeNumericSegment=function(t,e,n){for(;n>=3;){if(t.available()<10)throw new T;var o=t.readBits(10);if(o>=1e3)throw new T;e.append(r.toAlphaNumericChar(Math.floor(o/100))),e.append(r.toAlphaNumericChar(Math.floor(o/10)%10)),e.append(r.toAlphaNumericChar(o%10)),n-=3}if(n===2){if(t.available()<7)throw new T;var i=t.readBits(7);if(i>=100)throw new T;e.append(r.toAlphaNumericChar(Math.floor(i/10))),e.append(r.toAlphaNumericChar(i%10))}else if(n===1){if(t.available()<4)throw new T;var a=t.readBits(4);if(a>=10)throw new T;e.append(r.toAlphaNumericChar(a))}},r.parseECIValue=function(t){var e=t.readBits(8);if(!(128&e))return 127&e;if((192&e)==128)return(63&e)<<8&4294967295|t.readBits(8);if((224&e)==192)return(31&e)<<16&4294967295|t.readBits(16);throw new T},r.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",r.GB2312_SUBSET=1,r}(),Dr=function(){function r(t){this.mirrored=t}return r.prototype.isMirrored=function(){return this.mirrored},r.prototype.applyMirroredCorrection=function(t){if(this.mirrored&&t!==null&&!(t.length<3)){var e=t[0];t[0]=t[2],t[2]=e}},r}(),fr=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ko=function(){function r(){this.rsDecoder=new fe(gt.QR_CODE_FIELD_256)}return r.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(yt.parseFromBooleanArray(t),e)},r.prototype.decodeBitMatrix=function(t,e){var n=new Lo(t),o=null;try{return this.decodeBitMatrixParser(n,e)}catch(a){o=a}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var i=this.decodeBitMatrixParser(n,e);return i.setOther(new Dr(!0)),i}catch(a){throw o!==null?o:a}},r.prototype.decodeBitMatrixParser=function(t,e){var n,o,i,a,s=t.readVersion(),u=t.readFormatInformation().getErrorCorrectionLevel(),c=t.readCodewords(),f=Fo.getDataBlocks(c,s,u),h=0;try{for(var l=fr(f),d=l.next();!d.done;d=l.next())h+=(v=d.value).getNumDataCodewords()}catch(S){n={error:S}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}var p=new Uint8Array(h),y=0;try{for(var C=fr(f),w=C.next();!w.done;w=C.next()){var v,_=(v=w.value).getCodewords(),m=v.getNumDataCodewords();this.correctErrors(_,m);for(var I=0;I<m;I++)p[y++]=_[I]}}catch(S){i={error:S}}finally{try{w&&!w.done&&(a=C.return)&&a.call(C)}finally{if(i)throw i.error}}return xo.decode(p,s,u,e)},r.prototype.correctErrors=function(t,e){var n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch{throw new at}for(var o=0;o<e;o++)t[o]=n[o]},r}(),Vo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ho=function(r){function t(e,n,o){var i=r.call(this,e,n)||this;return i.estimatedModuleSize=o,i}return Vo(t,r),t.prototype.aboutEquals=function(e,n,o){if(Math.abs(n-this.getY())<=e&&Math.abs(o-this.getX())<=e){var i=Math.abs(e-this.estimatedModuleSize);return i<=1||i<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,o){return new t((this.getX()+n)/2,(this.getY()+e)/2,(this.estimatedModuleSize+o)/2)},t}(R),Uo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Xo=function(){function r(t,e,n,o,i,a,s){this.image=t,this.startX=e,this.startY=n,this.width=o,this.height=i,this.moduleSize=a,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return r.prototype.find=function(){for(var t=this.startX,e=this.height,n=t+this.width,o=this.startY+e/2,i=new Int32Array(3),a=this.image,s=0;s<e;s++){var u=o+(1&s?-Math.floor((s+1)/2):Math.floor((s+1)/2));i[0]=0,i[1]=0,i[2]=0;for(var c=t;c<n&&!a.get(c,u);)c++;for(var f=0;c<n;){if(a.get(c,u))if(f===1)i[1]++;else if(f===2){var h;if(this.foundPatternCross(i)&&(h=this.handlePossibleCenter(i,u,c))!==null)return h;i[0]=i[2],i[1]=1,i[2]=0,f=1}else i[++f]++;else f===1&&f++,i[f]++;c++}if(this.foundPatternCross(i)&&(h=this.handlePossibleCenter(i,u,n))!==null)return h}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new E},r.centerFromEnd=function(t,e){return e-t[2]-t[1]/2},r.prototype.foundPatternCross=function(t){for(var e=this.moduleSize,n=e/2,o=0;o<3;o++)if(Math.abs(e-t[o])>=n)return!1;return!0},r.prototype.crossCheckVertical=function(t,e,n,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var u=t;u>=0&&i.get(e,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&!i.get(e,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u<a&&i.get(e,u)&&s[1]<=n;)s[1]++,u++;if(u===a||s[1]>n)return NaN;for(;u<a&&!i.get(e,u)&&s[2]<=n;)s[2]++,u++;if(s[2]>n)return NaN;var c=s[0]+s[1]+s[2];return 5*Math.abs(c-o)>=2*o?NaN:this.foundPatternCross(s)?r.centerFromEnd(s,u):NaN},r.prototype.handlePossibleCenter=function(t,e,n){var o,i,a=t[0]+t[1]+t[2],s=r.centerFromEnd(t,n),u=this.crossCheckVertical(e,s,2*t[1],a);if(!isNaN(u)){var c=(t[0]+t[1]+t[2])/3;try{for(var f=Uo(this.possibleCenters),h=f.next();!h.done;h=f.next()){var l=h.value;if(l.aboutEquals(c,u,s))return l.combineEstimate(u,s,c)}}catch(p){o={error:p}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}var d=new Ho(s,u,c);this.possibleCenters.push(d),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(d)}return null},r}(),Go=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Wo=function(r){function t(e,n,o,i){var a=r.call(this,e,n)||this;return a.estimatedModuleSize=o,a.count=i,i===void 0&&(a.count=1),a}return Go(t,r),t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,n,o){if(Math.abs(n-this.getY())<=e&&Math.abs(o-this.getX())<=e){var i=Math.abs(e-this.estimatedModuleSize);return i<=1||i<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,o){var i=this.count+1;return new t((this.count*this.getX()+n)/i,(this.count*this.getY()+e)/i,(this.count*this.estimatedModuleSize+o)/i,i)},t}(R),zo=function(){function r(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r}(),Ht=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},jo=function(){function r(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}return r.prototype.getImage=function(){return this.image},r.prototype.getPossibleCenters=function(){return this.possibleCenters},r.prototype.find=function(t){var e=t!=null&&t.get(Q.TRY_HARDER)!==void 0,n=t!=null&&t.get(Q.PURE_BARCODE)!==void 0,o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*r.MAX_MODULES));(s<r.MIN_SKIP||e)&&(s=r.MIN_SKIP);for(var u=!1,c=new Int32Array(5),f=s-1;f<i&&!u;f+=s){c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0;for(var h=0,l=0;l<a;l++)if(o.get(l,f))(1&h)==1&&h++,c[h]++;else if(1&h)c[h]++;else if(h===4)if(r.foundPatternCross(c)){if(this.handlePossibleCenter(c,f,l,n)!==!0){c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,h=3;continue}if(s=2,this.hasSkipped===!0)u=this.haveMultiplyConfirmedCenters();else{var d=this.findRowSkip();d>c[2]&&(f+=d-c[2]-s,l=a-1)}h=0,c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0}else c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,h=3;else c[++h]++;r.foundPatternCross(c)&&this.handlePossibleCenter(c,f,a,n)===!0&&(s=c[0],this.hasSkipped&&(u=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return R.orderBestPatterns(p),new zo(p)},r.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2},r.foundPatternCross=function(t){for(var e=0,n=0;n<5;n++){var o=t[n];if(o===0)return!1;e+=o}if(e<7)return!1;var i=e/7,a=i/2;return Math.abs(i-t[0])<a&&Math.abs(i-t[1])<a&&Math.abs(3*i-t[2])<3*a&&Math.abs(i-t[3])<a&&Math.abs(i-t[4])<a},r.prototype.getCrossCheckStateCount=function(){var t=this.crossCheckStateCount;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t},r.prototype.crossCheckDiagonal=function(t,e,n,o){for(var i=this.getCrossCheckStateCount(),a=0,s=this.image;t>=a&&e>=a&&s.get(e-a,t-a);)i[2]++,a++;if(t<a||e<a)return!1;for(;t>=a&&e>=a&&!s.get(e-a,t-a)&&i[1]<=n;)i[1]++,a++;if(t<a||e<a||i[1]>n)return!1;for(;t>=a&&e>=a&&s.get(e-a,t-a)&&i[0]<=n;)i[0]++,a++;if(i[0]>n)return!1;var u=s.getHeight(),c=s.getWidth();for(a=1;t+a<u&&e+a<c&&s.get(e+a,t+a);)i[2]++,a++;if(t+a>=u||e+a>=c)return!1;for(;t+a<u&&e+a<c&&!s.get(e+a,t+a)&&i[3]<n;)i[3]++,a++;if(t+a>=u||e+a>=c||i[3]>=n)return!1;for(;t+a<u&&e+a<c&&s.get(e+a,t+a)&&i[4]<n;)i[4]++,a++;if(i[4]>=n)return!1;var f=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(f-o)<2*o&&r.foundPatternCross(i)},r.prototype.crossCheckVertical=function(t,e,n,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),u=t;u>=0&&i.get(e,u);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(e,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(e,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u<a&&i.get(e,u);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!i.get(e,u)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&i.get(e,u)&&s[4]<n;)s[4]++,u++;if(s[4]>=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-o)>=2*o?NaN:r.foundPatternCross(s)?r.centerFromEnd(s,u):NaN},r.prototype.crossCheckHorizontal=function(t,e,n,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),u=t;u>=0&&i.get(u,e);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(u,e)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(u,e)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u<a&&i.get(u,e);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!i.get(u,e)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&i.get(u,e)&&s[4]<n;)s[4]++,u++;if(s[4]>=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-o)>=o?NaN:r.foundPatternCross(s)?r.centerFromEnd(s,u):NaN},r.prototype.handlePossibleCenter=function(t,e,n,o){var i=t[0]+t[1]+t[2]+t[3]+t[4],a=r.centerFromEnd(t,n),s=this.crossCheckVertical(e,Math.floor(a),t[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),t[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),t[2],i)))){for(var u=i/7,c=!1,f=this.possibleCenters,h=0,l=f.length;h<l;h++){var d=f[h];if(d.aboutEquals(u,s,a)){f[h]=d.combineEstimate(s,a,u),c=!0;break}}if(!c){var p=new Wo(a,s,u);f.push(p),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(p)}return!0}return!1},r.prototype.findRowSkip=function(){var t,e;if(this.possibleCenters.length<=1)return 0;var n=null;try{for(var o=Ht(this.possibleCenters),i=o.next();!i.done;i=o.next()){var a=i.value;if(a.getCount()>=r.CENTER_QUORUM){if(n!=null)return this.hasSkipped=!0,Math.floor((Math.abs(n.getX()-a.getX())-Math.abs(n.getY()-a.getY()))/2);n=a}}}catch(s){t={error:s}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return 0},r.prototype.haveMultiplyConfirmedCenters=function(){var t,e,n,o,i=0,a=0,s=this.possibleCenters.length;try{for(var u=Ht(this.possibleCenters),c=u.next();!c.done;c=u.next())(p=c.value).getCount()>=r.CENTER_QUORUM&&(i++,a+=p.getEstimatedModuleSize())}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=u.return)&&e.call(u)}finally{if(t)throw t.error}}if(i<3)return!1;var f=a/s,h=0;try{for(var l=Ht(this.possibleCenters),d=l.next();!d.done;d=l.next()){var p=d.value;h+=Math.abs(p.getEstimatedModuleSize()-f)}}catch(y){n={error:y}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}return h<=.05*a},r.prototype.selectBestPatterns=function(){var t,e,n,o,i=this.possibleCenters.length;if(i<3)throw new E;var a,s=this.possibleCenters;if(i>3){var u=0,c=0;try{for(var f=Ht(this.possibleCenters),h=f.next();!h.done;h=f.next()){var l=h.value.getEstimatedModuleSize();u+=l,c+=l*l}}catch(_){t={error:_}}finally{try{h&&!h.done&&(e=f.return)&&e.call(f)}finally{if(t)throw t.error}}a=u/i;var d=Math.sqrt(c/i-a*a);s.sort(function(_,m){var I=Math.abs(m.getEstimatedModuleSize()-a),S=Math.abs(_.getEstimatedModuleSize()-a);return I<S?-1:I>S?1:0});for(var p=Math.max(.2*a,d),y=0;y<s.length&&s.length>3;y++){var C=s[y];Math.abs(C.getEstimatedModuleSize()-a)>p&&(s.splice(y,1),y--)}}if(s.length>3){u=0;try{for(var w=Ht(s),v=w.next();!v.done;v=w.next())u+=v.value.getEstimatedModuleSize()}catch(_){n={error:_}}finally{try{v&&!v.done&&(o=w.return)&&o.call(w)}finally{if(n)throw n.error}}a=u/s.length,s.sort(function(_,m){if(m.getCount()===_.getCount()){var I=Math.abs(m.getEstimatedModuleSize()-a),S=Math.abs(_.getEstimatedModuleSize()-a);return I<S?1:I>S?-1:0}return m.getCount()-_.getCount()}),s.splice(3)}return[s[0],s[1],s[2]]},r.CENTER_QUORUM=2,r.MIN_SKIP=3,r.MAX_MODULES=57,r}(),Yo=function(){function r(t){this.image=t}return r.prototype.getImage=function(){return this.image},r.prototype.getResultPointCallback=function(){return this.resultPointCallback},r.prototype.detect=function(t){this.resultPointCallback=t==null?null:t.get(Q.NEED_RESULT_POINT_CALLBACK);var e=new jo(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(e)},r.prototype.processFinderPatternInfo=function(t){var e=t.getTopLeft(),n=t.getTopRight(),o=t.getBottomLeft(),i=this.calculateModuleSize(e,n,o);if(i<1)throw new E("No pattern found in proccess finder.");var a=r.computeDimension(e,n,o,i),s=Lt.getProvisionalVersionForDimension(a),u=s.getDimensionForVersion()-7,c=null;if(s.getAlignmentPatternCenters().length>0)for(var f=n.getX()-e.getX()+o.getX(),h=n.getY()-e.getY()+o.getY(),l=1-3/u,d=Math.floor(e.getX()+l*(f-e.getX())),p=Math.floor(e.getY()+l*(h-e.getY())),y=4;y<=16;y<<=1)try{c=this.findAlignmentInRegion(i,d,p,y);break}catch(v){if(!(v instanceof E))throw v}var C=r.createTransform(e,n,o,c,a),w=r.sampleGrid(this.image,C,a);return new xe(w,c===null?[o,e,n]:[o,e,n,c])},r.createTransform=function(t,e,n,o,i){var a,s,u,c,f=i-3.5;return o!==null?(a=o.getX(),s=o.getY(),c=u=f-3):(a=e.getX()-t.getX()+n.getX(),s=e.getY()-t.getY()+n.getY(),u=f,c=f),Sr.quadrilateralToQuadrilateral(3.5,3.5,f,3.5,u,c,3.5,f,t.getX(),t.getY(),e.getX(),e.getY(),a,s,n.getX(),n.getY())},r.sampleGrid=function(t,e,n){return ke.getInstance().sampleGridWithTransform(t,n,n,e)},r.computeDimension=function(t,e,n,o){var i=U.round(R.distance(t,e)/o),a=U.round(R.distance(t,n)/o),s=Math.floor((i+a)/2)+7;switch(3&s){case 0:s++;break;case 2:s--;break;case 3:throw new E("Dimensions could be not found.")}return s},r.prototype.calculateModuleSize=function(t,e,n){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,n))/2},r.prototype.calculateModuleSizeOneWay=function(t,e){var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),o=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(n)?o/7:isNaN(o)?n/7:(n+o)/14},r.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,n,o){var i=this.sizeOfBlackWhiteBlackRun(t,e,n,o),a=1,s=t-(n-t);s<0?(a=t/(t-s),s=0):s>=this.image.getWidth()&&(a=(this.image.getWidth()-1-t)/(s-t),s=this.image.getWidth()-1);var u=Math.floor(e-(o-e)*a);return a=1,u<0?(a=e/(e-u),u=0):u>=this.image.getHeight()&&(a=(this.image.getHeight()-1-e)/(u-e),u=this.image.getHeight()-1),s=Math.floor(t+(s-t)*a),(i+=this.sizeOfBlackWhiteBlackRun(t,e,s,u))-1},r.prototype.sizeOfBlackWhiteBlackRun=function(t,e,n,o){var i=Math.abs(o-e)>Math.abs(n-t);if(i){var a=t;t=e,e=a,a=n,n=o,o=a}for(var s=Math.abs(n-t),u=Math.abs(o-e),c=-s/2,f=t<n?1:-1,h=e<o?1:-1,l=0,d=n+f,p=t,y=e;p!==d;p+=f){var C=i?y:p,w=i?p:y;if(l===1===this.image.get(C,w)){if(l===2)return U.distance(p,y,t,e);l++}if((c+=u)>0){if(y===o)break;y+=h,c-=s}}return l===2?U.distance(n+f,o,t,e):NaN},r.prototype.findAlignmentInRegion=function(t,e,n,o){var i=Math.floor(o*t),a=Math.max(0,e-i),s=Math.min(this.image.getWidth()-1,e+i);if(s-a<3*t)throw new E("Alignment top exceeds estimated module size.");var u=Math.max(0,n-i),c=Math.min(this.image.getHeight()-1,n+i);if(c-u<3*t)throw new E("Alignment bottom exceeds estimated module size.");return new Xo(this.image,a,u,s-a,c-u,t,this.resultPointCallback).find()},r}(),Re=function(){function r(){this.decoder=new ko}return r.prototype.getDecoder=function(){return this.decoder},r.prototype.decode=function(t,e){var n,o;if(e!=null&&e.get(Q.PURE_BARCODE)!==void 0){var i=r.extractPureBits(t.getBlackMatrix());n=this.decoder.decodeBitMatrix(i,e),o=r.NO_POINTS}else{var a=new Yo(t.getBlackMatrix()).detect(e);n=this.decoder.decodeBitMatrix(a.getBits(),e),o=a.getPoints()}n.getOther()instanceof Dr&&n.getOther().applyMirroredCorrection(o);var s=new ft(n.getText(),n.getRawBytes(),void 0,o,D.QR_CODE,void 0),u=n.getByteSegments();u!==null&&s.putMetadata(ct.BYTE_SEGMENTS,u);var c=n.getECLevel();return c!==null&&s.putMetadata(ct.ERROR_CORRECTION_LEVEL,c),n.hasStructuredAppend()&&(s.putMetadata(ct.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),s.putMetadata(ct.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),s},r.prototype.reset=function(){},r.extractPureBits=function(t){var e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e===null||n===null)throw new E;var o=this.moduleSize(e,t),i=e[1],a=n[1],s=e[0],u=n[0];if(s>=u||i>=a)throw new E;if(a-i!=u-s&&(u=s+(a-i))>=t.getWidth())throw new E;var c=Math.round((u-s+1)/o),f=Math.round((a-i+1)/o);if(c<=0||f<=0)throw new E;if(f!==c)throw new E;var h=Math.floor(o/2);i+=h;var l=(s+=h)+Math.floor((c-1)*o)-u;if(l>0){if(l>h)throw new E;s-=l}var d=i+Math.floor((f-1)*o)-a;if(d>0){if(d>h)throw new E;i-=d}for(var p=new yt(c,f),y=0;y<f;y++)for(var C=i+Math.floor(y*o),w=0;w<c;w++)t.get(s+Math.floor(w*o),C)&&p.set(w,y);return p},r.moduleSize=function(t,e){for(var n=e.getHeight(),o=e.getWidth(),i=t[0],a=t[1],s=!0,u=0;i<o&&a<n;){if(s!==e.get(i,a)){if(++u==5)break;s=!s}i++,a++}if(i===o||a===n)throw new E;return(i-t[0])/7},r.NO_POINTS=new Array,r}(),Zo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},V=function(){function r(){}return r.prototype.PDF417Common=function(){},r.getBitCountSum=function(t){return U.sum(t)},r.toIntArray=function(t){var e,n;if(t==null||!t.length)return r.EMPTY_INT_ARRAY;var o=new Int32Array(t.length),i=0;try{for(var a=Zo(t),s=a.next();!s.done;s=a.next()){var u=s.value;o[i++]=u}}catch(c){e={error:c}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return o},r.getCodeword=function(t){var e=$.binarySearch(r.SYMBOL_TABLE,262143&t);return e<0?-1:(r.CODEWORD_TABLE[e]-1)%r.NUMBER_OF_CODEWORDS},r.NUMBER_OF_CODEWORDS=929,r.MAX_CODEWORDS_IN_BARCODE=r.NUMBER_OF_CODEWORDS-1,r.MIN_ROWS_IN_BARCODE=3,r.MAX_ROWS_IN_BARCODE=90,r.MODULES_IN_CODEWORD=17,r.MODULES_IN_STOP_PATTERN=18,r.BARS_IN_MODULE=8,r.EMPTY_INT_ARRAY=new Int32Array([]),r.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]),r.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]),r}(),Ko=function(){function r(t,e){this.bits=t,this.points=e}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),qo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Qo=function(){function r(){}return r.detectMultiple=function(t,e,n){var o=t.getBlackMatrix(),i=r.detect(n,o);return i.length||((o=o.clone()).rotate180(),i=r.detect(n,o)),new Ko(o,i)},r.detect=function(t,e){for(var n,o,i=new Array,a=0,s=0,u=!1;a<e.getHeight();){var c=r.findVertices(e,a,s);if(c[0]!=null||c[3]!=null){if(u=!0,i.push(c),!t)break;c[2]!=null?(s=Math.trunc(c[2].getX()),a=Math.trunc(c[2].getY())):(s=Math.trunc(c[4].getX()),a=Math.trunc(c[4].getY()))}else{if(!u)break;u=!1,s=0;try{for(var f=(n=void 0,qo(i)),h=f.next();!h.done;h=f.next()){var l=h.value;l[1]!=null&&(a=Math.trunc(Math.max(a,l[1].getY()))),l[3]!=null&&(a=Math.max(a,Math.trunc(l[3].getY())))}}catch(d){n={error:d}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}a+=r.ROW_STEP}}return i},r.findVertices=function(t,e,n){var o=t.getHeight(),i=t.getWidth(),a=new Array(8);return r.copyToResult(a,r.findRowsWithPattern(t,o,i,e,n,r.START_PATTERN),r.INDEXES_START_PATTERN),a[4]!=null&&(n=Math.trunc(a[4].getX()),e=Math.trunc(a[4].getY())),r.copyToResult(a,r.findRowsWithPattern(t,o,i,e,n,r.STOP_PATTERN),r.INDEXES_STOP_PATTERN),a},r.copyToResult=function(t,e,n){for(var o=0;o<n.length;o++)t[n[o]]=e[o]},r.findRowsWithPattern=function(t,e,n,o,i,a){for(var s=new Array(4),u=!1,c=new Int32Array(a.length);o<e;o+=r.ROW_STEP)if((d=r.findGuardPattern(t,i,o,n,!1,a,c))!=null){for(;o>0;){if((l=r.findGuardPattern(t,i,--o,n,!1,a,c))==null){o++;break}d=l}s[0]=new R(d[0],o),s[1]=new R(d[1],o),u=!0;break}var f=o+1;if(u){for(var h=0,l=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);f<e;f++){var d;if((d=r.findGuardPattern(t,l[0],f,n,!1,a,c))!=null&&Math.abs(l[0]-d[0])<r.MAX_PATTERN_DRIFT&&Math.abs(l[1]-d[1])<r.MAX_PATTERN_DRIFT)l=d,h=0;else{if(h>r.SKIPPED_ROW_COUNT_MAX)break;h++}}f-=h+1,s[2]=new R(l[0],f),s[3]=new R(l[1],f)}return f-o<r.BARCODE_MIN_HEIGHT&&$.fill(s,null),s},r.findGuardPattern=function(t,e,n,o,i,a,s){$.fillWithin(s,0,s.length,0);for(var u=e,c=0;t.get(u,n)&&u>0&&c++<r.MAX_PIXEL_DRIFT;)u--;for(var f=u,h=0,l=a.length,d=i;f<o;f++)if(t.get(f,n)!==d)s[h]++;else{if(h===l-1){if(r.patternMatchVariance(s,a,r.MAX_INDIVIDUAL_VARIANCE)<r.MAX_AVG_VARIANCE)return new Int32Array([u,f]);u+=s[0]+s[1],Z.arraycopy(s,2,s,0,h-1),s[h-1]=0,s[h]=0,h--}else h++;s[h]=1,d=!d}return h===l-1&&r.patternMatchVariance(s,a,r.MAX_INDIVIDUAL_VARIANCE)<r.MAX_AVG_VARIANCE?new Int32Array([u,f-1]):null},r.patternMatchVariance=function(t,e,n){for(var o=t.length,i=0,a=0,s=0;s<o;s++)i+=t[s],a+=e[s];if(i<a)return 1/0;var u=i/a;n*=u;for(var c=0,f=0;f<o;f++){var h=t[f],l=e[f]*u,d=h>l?h-l:l-h;if(d>n)return 1/0;c+=d}return c/i},r.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),r.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),r.MAX_AVG_VARIANCE=.42,r.MAX_INDIVIDUAL_VARIANCE=.8,r.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),r.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),r.MAX_PIXEL_DRIFT=3,r.MAX_PATTERN_DRIFT=5,r.SKIPPED_ROW_COUNT_MAX=25,r.ROW_STEP=5,r.BARCODE_MIN_HEIGHT=10,r}(),Jo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Bt=function(){function r(t,e){if(e.length===0)throw new N;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var o=1;o<n&&e[o]===0;)o++;o===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-o),Z.arraycopy(e,o,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return r.prototype.getCoefficients=function(){return this.coefficients},r.prototype.getDegree=function(){return this.coefficients.length-1},r.prototype.isZero=function(){return this.coefficients[0]===0},r.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},r.prototype.evaluateAt=function(t){var e,n;if(t===0)return this.getCoefficient(0);if(t===1){var o=0;try{for(var i=Jo(this.coefficients),a=i.next();!a.done;a=i.next()){var s=a.value;o=this.field.add(o,s)}}catch(h){e={error:h}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return o}for(var u=this.coefficients[0],c=this.coefficients.length,f=1;f<c;f++)u=this.field.add(this.field.multiply(t,u),this.coefficients[f]);return u},r.prototype.add=function(t){if(!this.field.equals(t.field))throw new N("ModulusPolys do not have same ModulusGF field");if(this.isZero())return t;if(t.isZero())return this;var e=this.coefficients,n=t.coefficients;if(e.length>n.length){var o=e;e=n,n=o}var i=new Int32Array(n.length),a=n.length-e.length;Z.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=this.field.add(e[s-a],n[s]);return new r(this.field,i)},r.prototype.subtract=function(t){if(!this.field.equals(t.field))throw new N("ModulusPolys do not have same ModulusGF field");return t.isZero()?this:this.add(t.negative())},r.prototype.multiply=function(t){return t instanceof r?this.multiplyOther(t):this.multiplyScalar(t)},r.prototype.multiplyOther=function(t){if(!this.field.equals(t.field))throw new N("ModulusPolys do not have same ModulusGF field");if(this.isZero()||t.isZero())return new r(this.field,new Int32Array([0]));for(var e=this.coefficients,n=e.length,o=t.coefficients,i=o.length,a=new Int32Array(n+i-1),s=0;s<n;s++)for(var u=e[s],c=0;c<i;c++)a[s+c]=this.field.add(a[s+c],this.field.multiply(u,o[c]));return new r(this.field,a)},r.prototype.negative=function(){for(var t=this.coefficients.length,e=new Int32Array(t),n=0;n<t;n++)e[n]=this.field.subtract(0,this.coefficients[n]);return new r(this.field,e)},r.prototype.multiplyScalar=function(t){if(t===0)return new r(this.field,new Int32Array([0]));if(t===1)return this;for(var e=this.coefficients.length,n=new Int32Array(e),o=0;o<e;o++)n[o]=this.field.multiply(this.coefficients[o],t);return new r(this.field,n)},r.prototype.multiplyByMonomial=function(t,e){if(t<0)throw new N;if(e===0)return new r(this.field,new Int32Array([0]));for(var n=this.coefficients.length,o=new Int32Array(n+t),i=0;i<n;i++)o[i]=this.field.multiply(this.coefficients[i],e);return new r(this.field,o)},r.prototype.toString=function(){for(var t=new B,e=this.getDegree();e>=0;e--){var n=this.getCoefficient(e);n!==0&&(n<0?(t.append(" - "),n=-n):t.length()>0&&t.append(" + "),e!==0&&n===1||t.append(n),e!==0&&(e===1?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()},r}(),$o=function(){function r(){}return r.prototype.add=function(t,e){return(t+e)%this.modulus},r.prototype.subtract=function(t,e){return(this.modulus+t-e)%this.modulus},r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new N;return this.logTable[t]},r.prototype.inverse=function(t){if(t===0)throw new Ir;return this.expTable[this.modulus-this.logTable[t]-1]},r.prototype.multiply=function(t,e){return t===0||e===0?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]},r.prototype.getSize=function(){return this.modulus},r.prototype.equals=function(t){return t===this},r}(),ti=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ei=function(r){function t(e,n){var o=r.call(this)||this;o.modulus=e,o.expTable=new Int32Array(e),o.logTable=new Int32Array(e);for(var i=1,a=0;a<e;a++)o.expTable[a]=i,i=i*n%e;for(a=0;a<e-1;a++)o.logTable[o.expTable[a]]=a;return o.zero=new Bt(o,new Int32Array([0])),o.one=new Bt(o,new Int32Array([1])),o}return ti(t,r),t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,n){if(e<0)throw new N;if(n===0)return this.zero;var o=new Int32Array(e+1);return o[0]=n,new Bt(this,o)},t.PDF417_GF=new t(V.NUMBER_OF_CODEWORDS,3),t}($o),ri=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ni=function(){function r(){this.field=ei.PDF417_GF}return r.prototype.decode=function(t,e,n){for(var o,i,a=new Bt(this.field,t),s=new Int32Array(e),u=!1,c=e;c>0;c--){var f=a.evaluateAt(this.field.exp(c));s[e-c]=f,f!==0&&(u=!0)}if(!u)return 0;var h=this.field.getOne();if(n!=null)try{for(var l=ri(n),d=l.next();!d.done;d=l.next()){var p=d.value,y=this.field.exp(t.length-1-p),C=new Bt(this.field,new Int32Array([this.field.subtract(0,y),1]));h=h.multiply(C)}}catch(M){o={error:M}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}var w=new Bt(this.field,s),v=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),w,e),_=v[0],m=v[1],I=this.findErrorLocations(_),S=this.findErrorMagnitudes(m,_,I);for(c=0;c<I.length;c++){var O=t.length-1-this.field.log(I[c]);if(O<0)throw at.getChecksumInstance();t[O]=this.field.subtract(t[O],S[c])}return I.length},r.prototype.runEuclideanAlgorithm=function(t,e,n){if(t.getDegree()<e.getDegree()){var o=t;t=e,e=o}for(var i=t,a=e,s=this.field.getZero(),u=this.field.getOne();a.getDegree()>=Math.round(n/2);){var c=i,f=s;if(s=u,(i=a).isZero())throw at.getChecksumInstance();a=c;for(var h=this.field.getZero(),l=i.getCoefficient(i.getDegree()),d=this.field.inverse(l);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),y=this.field.multiply(a.getCoefficient(a.getDegree()),d);h=h.add(this.field.buildMonomial(p,y)),a=a.subtract(i.multiplyByMonomial(p,y))}u=h.multiply(s).subtract(f).negative()}var C=u.getCoefficient(0);if(C===0)throw at.getChecksumInstance();var w=this.field.inverse(C);return[u.multiply(w),a.multiply(w)]},r.prototype.findErrorLocations=function(t){for(var e=t.getDegree(),n=new Int32Array(e),o=0,i=1;i<this.field.getSize()&&o<e;i++)t.evaluateAt(i)===0&&(n[o]=this.field.inverse(i),o++);if(o!==e)throw at.getChecksumInstance();return n},r.prototype.findErrorMagnitudes=function(t,e,n){for(var o=e.getDegree(),i=new Int32Array(o),a=1;a<=o;a++)i[o-a]=this.field.multiply(a,e.getCoefficient(a));var s=new Bt(this.field,i),u=n.length,c=new Int32Array(u);for(a=0;a<u;a++){var f=this.field.inverse(n[a]),h=this.field.subtract(0,t.evaluateAt(f)),l=this.field.inverse(s.evaluateAt(f));c[a]=this.field.multiply(h,l)}return c},r}(),Ne=function(){function r(t,e,n,o,i){t instanceof r?this.constructor_2(t):this.constructor_1(t,e,n,o,i)}return r.prototype.constructor_1=function(t,e,n,o,i){var a=e==null||n==null,s=o==null||i==null;if(a&&s)throw new E;a?(e=new R(0,o.getY()),n=new R(0,i.getY())):s&&(o=new R(t.getWidth()-1,e.getY()),i=new R(t.getWidth()-1,n.getY())),this.image=t,this.topLeft=e,this.bottomLeft=n,this.topRight=o,this.bottomRight=i,this.minX=Math.trunc(Math.min(e.getX(),n.getX())),this.maxX=Math.trunc(Math.max(o.getX(),i.getX())),this.minY=Math.trunc(Math.min(e.getY(),o.getY())),this.maxY=Math.trunc(Math.max(n.getY(),i.getY()))},r.prototype.constructor_2=function(t){this.image=t.image,this.topLeft=t.getTopLeft(),this.bottomLeft=t.getBottomLeft(),this.topRight=t.getTopRight(),this.bottomRight=t.getBottomRight(),this.minX=t.getMinX(),this.maxX=t.getMaxX(),this.minY=t.getMinY(),this.maxY=t.getMaxY()},r.merge=function(t,e){return t==null?e:e==null?t:new r(t.image,t.topLeft,t.bottomLeft,e.topRight,e.bottomRight)},r.prototype.addMissingRows=function(t,e,n){var o=this.topLeft,i=this.bottomLeft,a=this.topRight,s=this.bottomRight;if(t>0){var u=n?this.topLeft:this.topRight,c=Math.trunc(u.getY()-t);c<0&&(c=0);var f=new R(u.getX(),c);n?o=f:a=f}if(e>0){var h=n?this.bottomLeft:this.bottomRight,l=Math.trunc(h.getY()+e);l>=this.image.getHeight()&&(l=this.image.getHeight()-1);var d=new R(h.getX(),l);n?i=d:s=d}return new r(this.image,o,i,a,s)},r.prototype.getMinX=function(){return this.minX},r.prototype.getMaxX=function(){return this.maxX},r.prototype.getMinY=function(){return this.minY},r.prototype.getMaxY=function(){return this.maxY},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getBottomRight=function(){return this.bottomRight},r}(),oi=function(){function r(t,e,n,o){this.columnCount=t,this.errorCorrectionLevel=o,this.rowCountUpperPart=e,this.rowCountLowerPart=n,this.rowCount=e+n}return r.prototype.getColumnCount=function(){return this.columnCount},r.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},r.prototype.getRowCount=function(){return this.rowCount},r.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},r.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},r}(),He=function(){function r(){this.buffer=""}return r.form=function(t,e){var n=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(o,i,a,s,u,c){if(o==="%%")return"%";if(e[++n]!==void 0){o=s?parseInt(s.substr(1)):void 0;var f,h=u?parseInt(u.substr(1)):void 0;switch(c){case"s":f=e[n];break;case"c":f=e[n][0];break;case"f":f=parseFloat(e[n]).toFixed(o);break;case"p":f=parseFloat(e[n]).toPrecision(o);break;case"e":f=parseFloat(e[n]).toExponential(o);break;case"x":f=parseInt(e[n]).toString(h||16);break;case"d":f=parseFloat(parseInt(e[n],h||10).toPrecision(o)).toFixed(0)}f=typeof f=="object"?JSON.stringify(f):(+f).toString(h);for(var l=parseInt(a),d=a&&a[0]+""=="0"?"0":" ";f.length<l;)f=i!==void 0?f+d:d+f;return f}})},r.prototype.format=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.buffer+=r.form(t,e)},r.prototype.toString=function(){return this.buffer},r}(),ii=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Mr=function(){function r(t){this.boundingBox=new Ne(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return r.prototype.getCodewordNearby=function(t){var e=this.getCodeword(t);if(e!=null)return e;for(var n=1;n<r.MAX_NEARBY_DISTANCE;n++){var o=this.imageRowToCodewordIndex(t)-n;if(o>=0&&(e=this.codewords[o])!=null||(o=this.imageRowToCodewordIndex(t)+n)<this.codewords.length&&(e=this.codewords[o])!=null)return e}return null},r.prototype.imageRowToCodewordIndex=function(t){return t-this.boundingBox.getMinY()},r.prototype.setCodeword=function(t,e){this.codewords[this.imageRowToCodewordIndex(t)]=e},r.prototype.getCodeword=function(t){return this.codewords[this.imageRowToCodewordIndex(t)]},r.prototype.getBoundingBox=function(){return this.boundingBox},r.prototype.getCodewords=function(){return this.codewords},r.prototype.toString=function(){var t,e,n=new He,o=0;try{for(var i=ii(this.codewords),a=i.next();!a.done;a=i.next()){var s=a.value;s!=null?n.format("%3d: %3d|%3d%n",o++,s.getRowNumber(),s.getValue()):n.format("%3d: | %n",o++)}}catch(u){t={error:u}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return n.toString()},r.MAX_NEARBY_DISTANCE=5,r}(),ai=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},si=function(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n,o,i=e.call(r),a=[];try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a},zt=function(){function r(){this.values=new Map}return r.prototype.setValue=function(t){t=Math.trunc(t);var e=this.values.get(t);e==null&&(e=0),e++,this.values.set(t,e)},r.prototype.getValue=function(){var t,e,n=-1,o=new Array,i=function(c,f){var h=function(){return c},l=function(){return f};l()>n?(n=l(),(o=[]).push(h())):l()===n&&o.push(h())};try{for(var a=ai(this.values.entries()),s=a.next();!s.done;s=a.next()){var u=si(s.value,2);i(u[0],u[1])}}catch(c){t={error:c}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return V.toIntArray(o)},r.prototype.getConfidence=function(t){return this.values.get(t)},r}(),ui=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ye=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},hr=function(r){function t(e,n){var o=r.call(this,e)||this;return o._isLeft=n,o}return ui(t,r),t.prototype.setRowNumbers=function(){var e,n;try{for(var o=ye(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;a?.setRowNumberAsRowIndicatorColumn()}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var n=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(n,e);for(var o=this.getBoundingBox(),i=this._isLeft?o.getTopLeft():o.getTopRight(),a=this._isLeft?o.getBottomLeft():o.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),u=this.imageRowToCodewordIndex(Math.trunc(a.getY())),c=-1,f=1,h=0,l=s;l<u;l++)if(n[l]!=null){var d=n[l],p=d.getRowNumber()-c;if(p===0)h++;else if(p===1)f=Math.max(f,h),h=1,c=d.getRowNumber();else if(p<0||d.getRowNumber()>=e.getRowCount()||p>l)n[l]=null;else{for(var y=void 0,C=(y=f>2?(f-2)*p:p)>=l,w=1;w<=y&&!C;w++)C=n[l-w]!=null;C?n[l]=null:(c=d.getRowNumber(),h=1)}}},t.prototype.getRowHeights=function(){var e,n,o=this.getBarcodeMetadata();if(o==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(o);var i=new Int32Array(o.getRowCount());try{for(var a=ye(this.getCodewords()),s=a.next();!s.done;s=a.next()){var u=s.value;if(u!=null){var c=u.getRowNumber();if(c>=i.length)continue;i[c]++}}}catch(f){e={error:f}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var n=this.getBoundingBox(),o=this._isLeft?n.getTopLeft():n.getTopRight(),i=this._isLeft?n.getBottomLeft():n.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),u=this.getCodewords(),c=-1,f=a;f<s;f++)if(u[f]!=null){var h=u[f];h.setRowNumberAsRowIndicatorColumn();var l=h.getRowNumber()-c;l===0||(l===1?c=h.getRowNumber():h.getRowNumber()>=e.getRowCount()?u[f]=null:c=h.getRowNumber())}},t.prototype.getBarcodeMetadata=function(){var e,n,o=this.getCodewords(),i=new zt,a=new zt,s=new zt,u=new zt;try{for(var c=ye(o),f=c.next();!f.done;f=c.next()){var h=f.value;if(h!=null){h.setRowNumberAsRowIndicatorColumn();var l=h.getValue()%30,d=h.getRowNumber();switch(this._isLeft||(d+=2),d%3){case 0:a.setValue(3*l+1);break;case 1:u.setValue(l/3),s.setValue(l%3);break;case 2:i.setValue(l+1)}}}}catch(y){e={error:y}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}if(i.getValue().length===0||a.getValue().length===0||s.getValue().length===0||u.getValue().length===0||i.getValue()[0]<1||a.getValue()[0]+s.getValue()[0]<V.MIN_ROWS_IN_BARCODE||a.getValue()[0]+s.getValue()[0]>V.MAX_ROWS_IN_BARCODE)return null;var p=new oi(i.getValue()[0],a.getValue()[0],s.getValue()[0],u.getValue()[0]);return this.removeIncorrectCodewords(o,p),p},t.prototype.removeIncorrectCodewords=function(e,n){for(var o=0;o<e.length;o++){var i=e[o];if(e[o]!=null){var a=i.getValue()%30,s=i.getRowNumber();if(s>n.getRowCount())e[o]=null;else switch(this._isLeft||(s+=2),s%3){case 0:3*a+1!==n.getRowCountUpperPart()&&(e[o]=null);break;case 1:Math.trunc(a/3)===n.getErrorCorrectionLevel()&&a%3===n.getRowCountLowerPart()||(e[o]=null);break;case 2:a+1!==n.getColumnCount()&&(e[o]=null)}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+`
|
||
`+r.prototype.toString.call(this)},t}(Mr),ci=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fi=function(){function r(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return r.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t,e=V.MAX_CODEWORDS_IN_BARCODE;do t=e,e=this.adjustRowNumbersAndGetCount();while(e>0&&e<t);return this.detectionResultColumns},r.prototype.adjustIndicatorColumnRowNumbers=function(t){t?.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},r.prototype.adjustRowNumbersAndGetCount=function(){var t=this.adjustRowNumbersByRow();if(t===0)return 0;for(var e=1;e<this.barcodeColumnCount+1;e++)for(var n=this.detectionResultColumns[e].getCodewords(),o=0;o<n.length;o++)n[o]!=null&&(n[o].hasValidRowNumber()||this.adjustRowNumbers(e,o,n));return t},r.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},r.prototype.adjustRowNumbersFromBothRI=function(){if(this.detectionResultColumns[0]!=null&&this.detectionResultColumns[this.barcodeColumnCount+1]!=null){for(var t=this.detectionResultColumns[0].getCodewords(),e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<t.length;n++)if(t[n]!=null&&e[n]!=null&&t[n].getRowNumber()===e[n].getRowNumber())for(var o=1;o<=this.barcodeColumnCount;o++){var i=this.detectionResultColumns[o].getCodewords()[n];i!=null&&(i.setRowNumber(t[n].getRowNumber()),i.hasValidRowNumber()||(this.detectionResultColumns[o].getCodewords()[n]=null))}}},r.prototype.adjustRowNumbersFromRRI=function(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;for(var t=0,e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<e.length;n++)if(e[n]!=null)for(var o=e[n].getRowNumber(),i=0,a=this.barcodeColumnCount+1;a>0&&i<this.ADJUST_ROW_NUMBER_SKIP;a--){var s=this.detectionResultColumns[a].getCodewords()[n];s!=null&&(i=r.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||t++)}return t},r.prototype.adjustRowNumbersFromLRI=function(){if(this.detectionResultColumns[0]==null)return 0;for(var t=0,e=this.detectionResultColumns[0].getCodewords(),n=0;n<e.length;n++)if(e[n]!=null)for(var o=e[n].getRowNumber(),i=0,a=1;a<this.barcodeColumnCount+1&&i<this.ADJUST_ROW_NUMBER_SKIP;a++){var s=this.detectionResultColumns[a].getCodewords()[n];s!=null&&(i=r.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||t++)}return t},r.adjustRowNumberIfValid=function(t,e,n){return n==null||n.hasValidRowNumber()||(n.isValidRowNumber(t)?(n.setRowNumber(t),e=0):++e),e},r.prototype.adjustRowNumbers=function(t,e,n){var o,i;if(this.detectionResultColumns[t-1]!=null){var a=n[e],s=this.detectionResultColumns[t-1].getCodewords(),u=s;this.detectionResultColumns[t+1]!=null&&(u=this.detectionResultColumns[t+1].getCodewords());var c=new Array(14);c[2]=s[e],c[3]=u[e],e>0&&(c[0]=n[e-1],c[4]=s[e-1],c[5]=u[e-1]),e>1&&(c[8]=n[e-2],c[10]=s[e-2],c[11]=u[e-2]),e<n.length-1&&(c[1]=n[e+1],c[6]=s[e+1],c[7]=u[e+1]),e<n.length-2&&(c[9]=n[e+2],c[12]=s[e+2],c[13]=u[e+2]);try{for(var f=ci(c),h=f.next();!h.done;h=f.next()){var l=h.value;if(r.adjustRowNumber(a,l))return}}catch(d){o={error:d}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}},r.adjustRowNumber=function(t,e){return e!=null&&!(!e.hasValidRowNumber()||e.getBucket()!==t.getBucket())&&(t.setRowNumber(e.getRowNumber()),!0)},r.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},r.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},r.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},r.prototype.setBoundingBox=function(t){this.boundingBox=t},r.prototype.getBoundingBox=function(){return this.boundingBox},r.prototype.setDetectionResultColumn=function(t,e){this.detectionResultColumns[t]=e},r.prototype.getDetectionResultColumn=function(t){return this.detectionResultColumns[t]},r.prototype.toString=function(){var t=this.detectionResultColumns[0];t==null&&(t=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var e=new He,n=0;n<t.getCodewords().length;n++){e.format("CW %3d:",n);for(var o=0;o<this.barcodeColumnCount+2;o++)if(this.detectionResultColumns[o]!=null){var i=this.detectionResultColumns[o].getCodewords()[n];i!=null?e.format(" %3d|%3d",i.getRowNumber(),i.getValue()):e.format(" | ")}else e.format(" | ");e.format("%n")}return e.toString()},r}(),hi=function(){function r(t,e,n,o){this.rowNumber=r.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(t),this.endX=Math.trunc(e),this.bucket=Math.trunc(n),this.value=Math.trunc(o)}return r.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},r.prototype.isValidRowNumber=function(t){return t!==r.BARCODE_ROW_UNKNOWN&&this.bucket===t%3*3},r.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))},r.prototype.getWidth=function(){return this.endX-this.startX},r.prototype.getStartX=function(){return this.startX},r.prototype.getEndX=function(){return this.endX},r.prototype.getBucket=function(){return this.bucket},r.prototype.getValue=function(){return this.value},r.prototype.getRowNumber=function(){return this.rowNumber},r.prototype.setRowNumber=function(t){this.rowNumber=t},r.prototype.toString=function(){return this.rowNumber+"|"+this.value},r.BARCODE_ROW_UNKNOWN=-1,r}(),li=function(){function r(){}return r.initialize=function(){for(var t=0;t<V.SYMBOL_TABLE.length;t++)for(var e=V.SYMBOL_TABLE[t],n=1&e,o=0;o<V.BARS_IN_MODULE;o++){for(var i=0;(1&e)===n;)i+=1,e>>=1;n=1&e,r.RATIOS_TABLE[t]||(r.RATIOS_TABLE[t]=new Array(V.BARS_IN_MODULE)),r.RATIOS_TABLE[t][V.BARS_IN_MODULE-o-1]=Math.fround(i/V.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},r.getDecodedValue=function(t){var e=r.getDecodedCodewordValue(r.sampleBitCounts(t));return e!==-1?e:r.getClosestDecodedValue(t)},r.sampleBitCounts=function(t){for(var e=U.sum(t),n=new Int32Array(V.BARS_IN_MODULE),o=0,i=0,a=0;a<V.MODULES_IN_CODEWORD;a++){var s=e/(2*V.MODULES_IN_CODEWORD)+a*e/V.MODULES_IN_CODEWORD;i+t[o]<=s&&(i+=t[o],o++),n[o]++}return n},r.getDecodedCodewordValue=function(t){var e=r.getBitValue(t);return V.getCodeword(e)===-1?-1:e},r.getBitValue=function(t){for(var e=0,n=0;n<t.length;n++)for(var o=0;o<t[n];o++)e=e<<1|(n%2==0?1:0);return Math.trunc(e)},r.getClosestDecodedValue=function(t){var e=U.sum(t),n=new Array(V.BARS_IN_MODULE);if(e>1)for(var o=0;o<n.length;o++)n[o]=Math.fround(t[o]/e);var i=Ie.MAX_VALUE,a=-1;this.bSymbolTableReady||r.initialize();for(var s=0;s<r.RATIOS_TABLE.length;s++){for(var u=0,c=r.RATIOS_TABLE[s],f=0;f<V.BARS_IN_MODULE;f++){var h=Math.fround(c[f]-n[f]);if((u+=Math.fround(h*h))>=i)break}u<i&&(i=u,a=V.SYMBOL_TABLE[s])}return a},r.bSymbolTableReady=!1,r.RATIOS_TABLE=new Array(V.SYMBOL_TABLE.length).map(function(t){return new Array(V.BARS_IN_MODULE)}),r}(),lr=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},di=function(){function r(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return r.prototype.getSegmentIndex=function(){return this.segmentIndex},r.prototype.setSegmentIndex=function(t){this.segmentIndex=t},r.prototype.getFileId=function(){return this.fileId},r.prototype.setFileId=function(t){this.fileId=t},r.prototype.getOptionalData=function(){return this.optionalData},r.prototype.setOptionalData=function(t){this.optionalData=t},r.prototype.isLastSegment=function(){return this.lastSegment},r.prototype.setLastSegment=function(t){this.lastSegment=t},r.prototype.getSegmentCount=function(){return this.segmentCount},r.prototype.setSegmentCount=function(t){this.segmentCount=t},r.prototype.getSender=function(){return this.sender||null},r.prototype.setSender=function(t){this.sender=t},r.prototype.getAddressee=function(){return this.addressee||null},r.prototype.setAddressee=function(t){this.addressee=t},r.prototype.getFileName=function(){return this.fileName},r.prototype.setFileName=function(t){this.fileName=t},r.prototype.getFileSize=function(){return this.fileSize},r.prototype.setFileSize=function(t){this.fileSize=t},r.prototype.getChecksum=function(){return this.checksum},r.prototype.setChecksum=function(t){this.checksum=t},r.prototype.getTimestamp=function(){return this.timestamp},r.prototype.setTimestamp=function(t){this.timestamp=t},r}(),dr=function(){function r(){}return r.parseLong=function(t,e){return e===void 0&&(e=void 0),parseInt(t,e)},r}(),pi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),gi=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return pi(t,r),t.kind="NullPointerException",t}(wt),yi=function(){function r(){}return r.prototype.writeBytes=function(t){this.writeBytesOffset(t,0,t.length)},r.prototype.writeBytesOffset=function(t,e,n){if(t==null)throw new gi;if(e<0||e>t.length||n<0||e+n>t.length||e+n<0)throw new Le;if(n!==0)for(var o=0;o<n;o++)this.write(t[e+o])},r.prototype.flush=function(){},r.prototype.close=function(){},r}(),wi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ci=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return wi(t,r),t}(wt),vi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ai=function(r){function t(e){e===void 0&&(e=32);var n=r.call(this)||this;if(n.count=0,e<0)throw new N("Negative initial size: "+e);return n.buf=new Uint8Array(e),n}return vi(t,r),t.prototype.ensureCapacity=function(e){e-this.buf.length>0&&this.grow(e)},t.prototype.grow=function(e){var n=this.buf.length<<1;if(n-e<0&&(n=e),n<0){if(e<0)throw new Ci;n=P.MAX_VALUE}this.buf=$.copyOfUint8Array(this.buf,n)},t.prototype.write=function(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1},t.prototype.writeBytesOffset=function(e,n,o){if(n<0||n>e.length||o<0||n+o-e.length>0)throw new Le;this.ensureCapacity(this.count+o),Z.arraycopy(e,n,this.buf,this.count,o),this.count+=o},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return $.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(e){return e?typeof e=="string"?this.toString_string(e):this.toString_number(e):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(e){return new String(this.buf).toString()},t.prototype.toString_number=function(e){return new String(this.buf).toString()},t.prototype.close=function(){},t}(yi);function Pr(){if(typeof window<"u")return window.BigInt||null;if(lr!==void 0)return lr.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function bt(r){if(te===void 0&&(te=Pr()),te===null)throw new Error("BigInt is not supported!");return te(r)}(function(r){r[r.ALPHA=0]="ALPHA",r[r.LOWER=1]="LOWER",r[r.MIXED=2]="MIXED",r[r.PUNCT=3]="PUNCT",r[r.ALPHA_SHIFT=4]="ALPHA_SHIFT",r[r.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(Y||(Y={}));var De,_i=function(){function r(){}return r.decode=function(t,e){var n=new B(""),o=nt.ISO8859_1;n.enableDecoding(o);for(var i=1,a=t[i++],s=new di;i<t[0];){switch(a){case r.TEXT_COMPACTION_MODE_LATCH:i=r.textCompaction(t,i,n);break;case r.BYTE_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:i=r.byteCompaction(a,t,o,i,n);break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(t[i++]);break;case r.NUMERIC_COMPACTION_MODE_LATCH:i=r.numericCompaction(t,i,n);break;case r.ECI_CHARSET:nt.getCharacterSetECIByValue(t[i++]);break;case r.ECI_GENERAL_PURPOSE:i+=2;break;case r.ECI_USER_DEFINED:i++;break;case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:i=r.decodeMacroBlock(t,i,s);break;case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:throw new T;default:i--,i=r.textCompaction(t,i,n)}if(!(i<t.length))throw T.getFormatInstance();a=t[i++]}if(n.length()===0)throw T.getFormatInstance();var u=new ce(null,n.toString(),null,e);return u.setOther(s),u},r.decodeMacroBlock=function(t,e,n){if(e+r.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw T.getFormatInstance();for(var o=new Int32Array(r.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i<r.NUMBER_OF_SEQUENCE_CODEWORDS;i++,e++)o[i]=t[e];n.setSegmentIndex(P.parseInt(r.decodeBase900toBase10(o,r.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new B;e=r.textCompaction(t,e,a),n.setFileId(a.toString());var s=-1;for(t[e]===r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=e+1);e<t[0];)switch(t[e]){case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(t[++e]){case r.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var u=new B;e=r.textCompaction(t,e+1,u),n.setFileName(u.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var c=new B;e=r.textCompaction(t,e+1,c),n.setSender(c.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var f=new B;e=r.textCompaction(t,e+1,f),n.setAddressee(f.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var h=new B;e=r.numericCompaction(t,e+1,h),n.setSegmentCount(P.parseInt(h.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var l=new B;e=r.numericCompaction(t,e+1,l),n.setTimestamp(dr.parseLong(l.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var d=new B;e=r.numericCompaction(t,e+1,d),n.setChecksum(P.parseInt(d.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var p=new B;e=r.numericCompaction(t,e+1,p),n.setFileSize(dr.parseLong(p.toString()));break;default:throw T.getFormatInstance()}break;case r.MACRO_PDF417_TERMINATOR:e++,n.setLastSegment(!0);break;default:throw T.getFormatInstance()}if(s!==-1){var y=e-s;n.isLastSegment()&&y--,n.setOptionalData($.copyOfRange(t,s,s+y))}return e},r.textCompaction=function(t,e,n){for(var o=new Int32Array(2*(t[0]-e)),i=new Int32Array(2*(t[0]-e)),a=0,s=!1;e<t[0]&&!s;){var u=t[e++];if(u<r.TEXT_COMPACTION_MODE_LATCH)o[a]=u/30,o[a+1]=u%30,a+=2;else switch(u){case r.TEXT_COMPACTION_MODE_LATCH:o[a++]=r.TEXT_COMPACTION_MODE_LATCH;break;case r.BYTE_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:case r.NUMERIC_COMPACTION_MODE_LATCH:case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:e--,s=!0;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o[a]=r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,u=t[e++],i[a]=u,a++}}return r.decodeTextCompaction(o,i,a,n),e},r.decodeTextCompaction=function(t,e,n,o){for(var i=Y.ALPHA,a=Y.ALPHA,s=0;s<n;){var u=t[s],c="";switch(i){case Y.ALPHA:if(u<26)c=String.fromCharCode(65+u);else switch(u){case 26:c=" ";break;case r.LL:i=Y.LOWER;break;case r.ML:i=Y.MIXED;break;case r.PS:a=i,i=Y.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(e[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:i=Y.ALPHA}break;case Y.LOWER:if(u<26)c=String.fromCharCode(97+u);else switch(u){case 26:c=" ";break;case r.AS:a=i,i=Y.ALPHA_SHIFT;break;case r.ML:i=Y.MIXED;break;case r.PS:a=i,i=Y.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(e[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:i=Y.ALPHA}break;case Y.MIXED:if(u<r.PL)c=r.MIXED_CHARS[u];else switch(u){case r.PL:i=Y.PUNCT;break;case 26:c=" ";break;case r.LL:i=Y.LOWER;break;case r.AL:i=Y.ALPHA;break;case r.PS:a=i,i=Y.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(e[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:i=Y.ALPHA}break;case Y.PUNCT:if(u<r.PAL)c=r.PUNCT_CHARS[u];else switch(u){case r.PAL:i=Y.ALPHA;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(e[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:i=Y.ALPHA}break;case Y.ALPHA_SHIFT:if(i=a,u<26)c=String.fromCharCode(65+u);else switch(u){case 26:c=" ";break;case r.TEXT_COMPACTION_MODE_LATCH:i=Y.ALPHA}break;case Y.PUNCT_SHIFT:if(i=a,u<r.PAL)c=r.PUNCT_CHARS[u];else switch(u){case r.PAL:i=Y.ALPHA;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(e[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:i=Y.ALPHA}}c!==""&&o.append(c),s++}},r.byteCompaction=function(t,e,n,o,i){var a=new Ai,s=0,u=0,c=!1;switch(t){case r.BYTE_COMPACTION_MODE_LATCH:for(var f=new Int32Array(6),h=e[o++];o<e[0]&&!c;)switch(f[s++]=h,u=900*u+h,h=e[o++]){case r.TEXT_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH:case r.NUMERIC_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:o--,c=!0;break;default:if(s%5==0&&s>0){for(var l=0;l<6;++l)a.write(Number(bt(u)>>bt(8*(5-l))));u=0,s=0}}o===e[0]&&h<r.TEXT_COMPACTION_MODE_LATCH&&(f[s++]=h);for(var d=0;d<s;d++)a.write(f[d]);break;case r.BYTE_COMPACTION_MODE_LATCH_6:for(;o<e[0]&&!c;){var p=e[o++];if(p<r.TEXT_COMPACTION_MODE_LATCH)s++,u=900*u+p;else switch(p){case r.TEXT_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH:case r.NUMERIC_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:o--,c=!0}if(s%5==0&&s>0){for(l=0;l<6;++l)a.write(Number(bt(u)>>bt(8*(5-l))));u=0,s=0}}}return i.append(At.decode(a.toByteArray(),n)),o},r.numericCompaction=function(t,e,n){for(var o=0,i=!1,a=new Int32Array(r.MAX_NUMERIC_CODEWORDS);e<t[0]&&!i;){var s=t[e++];if(e===t[0]&&(i=!0),s<r.TEXT_COMPACTION_MODE_LATCH)a[o]=s,o++;else switch(s){case r.TEXT_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:e--,i=!0}(o%r.MAX_NUMERIC_CODEWORDS==0||s===r.NUMERIC_COMPACTION_MODE_LATCH||i)&&o>0&&(n.append(r.decodeBase900toBase10(a,o)),o=0)}return e},r.decodeBase900toBase10=function(t,e){for(var n=bt(0),o=0;o<e;o++)n+=r.EXP900[e-o-1]*bt(t[o]);var i=n.toString();if(i.charAt(0)!=="1")throw new T;return i.substring(1)},r.TEXT_COMPACTION_MODE_LATCH=900,r.BYTE_COMPACTION_MODE_LATCH=901,r.NUMERIC_COMPACTION_MODE_LATCH=902,r.BYTE_COMPACTION_MODE_LATCH_6=924,r.ECI_USER_DEFINED=925,r.ECI_GENERAL_PURPOSE=926,r.ECI_CHARSET=927,r.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,r.MACRO_PDF417_TERMINATOR=922,r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,r.MAX_NUMERIC_CODEWORDS=15,r.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,r.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,r.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,r.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,r.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,r.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,r.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,r.PL=25,r.LL=27,r.AS=27,r.ML=28,r.AL=28,r.PS=29,r.PAL=29,r.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,:
|
||
-.$/"|*()?{}'`,r.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",r.EXP900=Pr()?function(){var t=[];t[0]=bt(1);var e=bt(900);t[1]=e;for(var n=2;n<16;n++)t[n]=t[n-1]*e;return t}():[],r.NUMBER_OF_SEQUENCE_CODEWORDS=2,r}(),Ut=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},mi=function(){function r(){}return r.decode=function(t,e,n,o,i,a,s){for(var u,c=new Ne(t,e,n,o,i),f=null,h=null,l=!0;;l=!1){if(e!=null&&(f=r.getRowIndicatorColumn(t,c,e,!0,a,s)),o!=null&&(h=r.getRowIndicatorColumn(t,c,o,!1,a,s)),(u=r.merge(f,h))==null)throw E.getNotFoundInstance();var d=u.getBoundingBox();if(!l||d==null||!(d.getMinY()<c.getMinY()||d.getMaxY()>c.getMaxY()))break;c=d}u.setBoundingBox(c);var p=u.getBarcodeColumnCount()+1;u.setDetectionResultColumn(0,f),u.setDetectionResultColumn(p,h);for(var y=f!=null,C=1;C<=p;C++){var w=y?C:p-C;if(u.getDetectionResultColumn(w)===void 0){var v=void 0;v=w===0||w===p?new hr(c,w===0):new Mr(c),u.setDetectionResultColumn(w,v);for(var _=-1,m=_,I=c.getMinY();I<=c.getMaxY();I++){if((_=r.getStartColumn(u,w,I,y))<0||_>c.getMaxX()){if(m===-1)continue;_=m}var S=r.detectCodeword(t,c.getMinX(),c.getMaxX(),y,_,I,a,s);S!=null&&(v.setCodeword(I,S),m=_,a=Math.min(a,S.getWidth()),s=Math.max(s,S.getWidth()))}}}return r.createDecoderResult(u)},r.merge=function(t,e){if(t==null&&e==null)return null;var n=r.getBarcodeMetadata(t,e);if(n==null)return null;var o=Ne.merge(r.adjustBoundingBox(t),r.adjustBoundingBox(e));return new fi(n,o)},r.adjustBoundingBox=function(t){var e,n;if(t==null)return null;var o=t.getRowHeights();if(o==null)return null;var i=r.getMax(o),a=0;try{for(var s=Ut(o),u=s.next();!u.done;u=s.next()){var c=u.value;if(a+=i-c,c>0)break}}catch(d){e={error:d}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}for(var f=t.getCodewords(),h=0;a>0&&f[h]==null;h++)a--;var l=0;for(h=o.length-1;h>=0&&(l+=i-o[h],!(o[h]>0));h--);for(h=f.length-1;l>0&&f[h]==null;h--)l--;return t.getBoundingBox().addMissingRows(a,l,t.isLeft())},r.getMax=function(t){var e,n,o=-1;try{for(var i=Ut(t),a=i.next();!a.done;a=i.next()){var s=a.value;o=Math.max(o,s)}}catch(u){e={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return o},r.getBarcodeMetadata=function(t,e){var n,o;return t==null||(n=t.getBarcodeMetadata())==null?e==null?null:e.getBarcodeMetadata():e==null||(o=e.getBarcodeMetadata())==null?n:n.getColumnCount()!==o.getColumnCount()&&n.getErrorCorrectionLevel()!==o.getErrorCorrectionLevel()&&n.getRowCount()!==o.getRowCount()?null:n},r.getRowIndicatorColumn=function(t,e,n,o,i,a){for(var s=new hr(e,o),u=0;u<2;u++)for(var c=u===0?1:-1,f=Math.trunc(Math.trunc(n.getX())),h=Math.trunc(Math.trunc(n.getY()));h<=e.getMaxY()&&h>=e.getMinY();h+=c){var l=r.detectCodeword(t,0,t.getWidth(),o,f,h,i,a);l!=null&&(s.setCodeword(h,l),f=o?l.getStartX():l.getEndX())}return s},r.adjustCodewordCount=function(t,e){var n=e[0][1],o=n.getValue(),i=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-r.getNumberOfECCodeWords(t.getBarcodeECLevel());if(o.length===0){if(i<1||i>V.MAX_CODEWORDS_IN_BARCODE)throw E.getNotFoundInstance();n.setValue(i)}else o[0]!==i&&n.setValue(i)},r.createDecoderResult=function(t){var e=r.createBarcodeMatrix(t);r.adjustCodewordCount(t,e);for(var n=new Array,o=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),i=[],a=new Array,s=0;s<t.getBarcodeRowCount();s++)for(var u=0;u<t.getBarcodeColumnCount();u++){var c=e[s][u+1].getValue(),f=s*t.getBarcodeColumnCount()+u;c.length===0?n.push(f):c.length===1?o[f]=c[0]:(a.push(f),i.push(c))}for(var h=new Array(i.length),l=0;l<h.length;l++)h[l]=i[l];return r.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),o,V.toIntArray(n),V.toIntArray(a),h)},r.createDecoderResultFromAmbiguousValues=function(t,e,n,o,i){for(var a=new Int32Array(o.length),s=100;s-- >0;){for(var u=0;u<a.length;u++)e[o[u]]=i[u][a[u]];try{return r.decodeCodewords(e,t,n)}catch(c){if(!(c instanceof at))throw c}if(a.length===0)throw at.getChecksumInstance();for(u=0;u<a.length;u++){if(a[u]<i[u].length-1){a[u]++;break}if(a[u]=0,u===a.length-1)throw at.getChecksumInstance()}}throw at.getChecksumInstance()},r.createBarcodeMatrix=function(t){for(var e,n,o,i,a=Array.from({length:t.getBarcodeRowCount()},function(){return new Array(t.getBarcodeColumnCount()+2)}),s=0;s<a.length;s++)for(var u=0;u<a[s].length;u++)a[s][u]=new zt;var c=0;try{for(var f=Ut(t.getDetectionResultColumns()),h=f.next();!h.done;h=f.next()){var l=h.value;if(l!=null)try{for(var d=(o=void 0,Ut(l.getCodewords())),p=d.next();!p.done;p=d.next()){var y=p.value;if(y!=null){var C=y.getRowNumber();if(C>=0){if(C>=a.length)continue;a[C][c].setValue(y.getValue())}}}}catch(w){o={error:w}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}c++}}catch(w){e={error:w}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}return a},r.isValidBarcodeColumn=function(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1},r.getStartColumn=function(t,e,n,o){var i,a,s=o?1:-1,u=null;if(r.isValidBarcodeColumn(t,e-s)&&(u=t.getDetectionResultColumn(e-s).getCodeword(n)),u!=null)return o?u.getEndX():u.getStartX();if((u=t.getDetectionResultColumn(e).getCodewordNearby(n))!=null)return o?u.getStartX():u.getEndX();if(r.isValidBarcodeColumn(t,e-s)&&(u=t.getDetectionResultColumn(e-s).getCodewordNearby(n)),u!=null)return o?u.getEndX():u.getStartX();for(var c=0;r.isValidBarcodeColumn(t,e-s);){e-=s;try{for(var f=(i=void 0,Ut(t.getDetectionResultColumn(e).getCodewords())),h=f.next();!h.done;h=f.next()){var l=h.value;if(l!=null)return(o?l.getEndX():l.getStartX())+s*c*(l.getEndX()-l.getStartX())}}catch(d){i={error:d}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}c++}return o?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},r.detectCodeword=function(t,e,n,o,i,a,s,u){i=r.adjustCodewordStartColumn(t,e,n,o,i,a);var c,f=r.getModuleBitCount(t,e,n,o,i,a);if(f==null)return null;var h=U.sum(f);if(o)c=i+h;else{for(var l=0;l<f.length/2;l++){var d=f[l];f[l]=f[f.length-1-l],f[f.length-1-l]=d}i=(c=i)-h}if(!r.checkCodewordSkew(h,s,u))return null;var p=li.getDecodedValue(f),y=V.getCodeword(p);return y===-1?null:new hi(i,c,r.getCodewordBucketNumber(p),y)},r.getModuleBitCount=function(t,e,n,o,i,a){for(var s=i,u=new Int32Array(8),c=0,f=o?1:-1,h=o;(o?s<n:s>=e)&&c<u.length;)t.get(s,a)===h?(u[c]++,s+=f):(c++,h=!h);return c===u.length||s===(o?n:e)&&c===u.length-1?u:null},r.getNumberOfECCodeWords=function(t){return 2<<t},r.adjustCodewordStartColumn=function(t,e,n,o,i,a){for(var s=i,u=o?-1:1,c=0;c<2;c++){for(;(o?s>=e:s<n)&&o===t.get(s,a);){if(Math.abs(i-s)>r.CODEWORD_SKEW_SIZE)return i;s+=u}u=-u,o=!o}return s},r.checkCodewordSkew=function(t,e,n){return e-r.CODEWORD_SKEW_SIZE<=t&&t<=n+r.CODEWORD_SKEW_SIZE},r.decodeCodewords=function(t,e,n){if(t.length===0)throw T.getFormatInstance();var o=1<<e+1,i=r.correctErrors(t,n,o);r.verifyCodewordCount(t,o);var a=_i.decode(t,""+e);return a.setErrorsCorrected(i),a.setErasures(n.length),a},r.correctErrors=function(t,e,n){if(e!=null&&e.length>n/2+r.MAX_ERRORS||n<0||n>r.MAX_EC_CODEWORDS)throw at.getChecksumInstance();return r.errorCorrection.decode(t,n,e)},r.verifyCodewordCount=function(t,e){if(t.length<4)throw T.getFormatInstance();var n=t[0];if(n>t.length)throw T.getFormatInstance();if(n===0){if(!(e<t.length))throw T.getFormatInstance();t[0]=t.length-e}},r.getBitCountForCodeword=function(t){for(var e=new Int32Array(8),n=0,o=e.length-1;!((1&t)!==n&&(n=1&t,--o<0));)e[o]++,t>>=1;return e},r.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},r.getCodewordBucketNumber_number=function(t){return r.getCodewordBucketNumber(r.getBitCountForCodeword(t))},r.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},r.toString=function(t){for(var e=new He,n=0;n<t.length;n++){e.format("Row %2d: ",n);for(var o=0;o<t[n].length;o++){var i=t[n][o];i.getValue().length===0?e.format(" ",null):e.format("%4d(%2d)",i.getValue()[0],i.getConfidence(i.getValue()[0]))}e.format("%n")}return e.toString()},r.CODEWORD_SKEW_SIZE=2,r.MAX_ERRORS=3,r.MAX_EC_CODEWORDS=512,r.errorCorrection=new ni,r}(),Ei=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Me=function(){function r(){}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n=r.decode(t,e,!1);if(n==null||n.length===0||n[0]==null)throw E.getNotFoundInstance();return n[0]},r.prototype.decodeMultiple=function(t,e){e===void 0&&(e=null);try{return r.decode(t,e,!0)}catch(n){throw n instanceof T||n instanceof at?E.getNotFoundInstance():n}},r.decode=function(t,e,n){var o,i,a=new Array,s=Qo.detectMultiple(t,e,n);try{for(var u=Ei(s.getPoints()),c=u.next();!c.done;c=u.next()){var f=c.value,h=mi.decode(s.getBits(),f[4],f[5],f[6],f[7],r.getMinCodewordWidth(f),r.getMaxCodewordWidth(f)),l=new ft(h.getText(),h.getRawBytes(),void 0,f,D.PDF_417);l.putMetadata(ct.ERROR_CORRECTION_LEVEL,h.getECLevel());var d=h.getOther();d!=null&&l.putMetadata(ct.PDF417_EXTRA_METADATA,d),a.push(l)}}catch(p){o={error:p}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return a.map(function(p){return p})},r.getMaxWidth=function(t,e){return t==null||e==null?0:Math.trunc(Math.abs(t.getX()-e.getX()))},r.getMinWidth=function(t,e){return t==null||e==null?P.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))},r.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(r.getMaxWidth(t[0],t[4]),r.getMaxWidth(t[6],t[2])*V.MODULES_IN_CODEWORD/V.MODULES_IN_STOP_PATTERN),Math.max(r.getMaxWidth(t[1],t[5]),r.getMaxWidth(t[7],t[3])*V.MODULES_IN_CODEWORD/V.MODULES_IN_STOP_PATTERN)))},r.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(r.getMinWidth(t[0],t[4]),r.getMinWidth(t[6],t[2])*V.MODULES_IN_CODEWORD/V.MODULES_IN_STOP_PATTERN),Math.min(r.getMinWidth(t[1],t[5]),r.getMinWidth(t[7],t[3])*V.MODULES_IN_CODEWORD/V.MODULES_IN_STOP_PATTERN)))},r.prototype.reset=function(){},r}(),Ii=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),pr=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return Ii(t,r),t.kind="ReaderException",t}(wt),gr=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Si=function(){function r(){}return r.prototype.decode=function(t,e){return this.setHints(e),this.decodeInternal(t)},r.prototype.decodeWithState=function(t){return this.readers!==null&&this.readers!==void 0||this.setHints(null),this.decodeInternal(t)},r.prototype.setHints=function(t){this.hints=t;var e=t!=null&&t.get(Q.TRY_HARDER)!==void 0,n=t==null?null:t.get(Q.POSSIBLE_FORMATS),o=new Array;if(n!=null){var i=n.some(function(a){return a===D.UPC_A||a===D.UPC_E||a===D.EAN_13||a===D.EAN_8||a===D.CODABAR||a===D.CODE_39||a===D.CODE_93||a===D.CODE_128||a===D.ITF||a===D.RSS_14||a===D.RSS_EXPANDED});i&&!e&&o.push(new Wt(t)),n.includes(D.QR_CODE)&&o.push(new Re),n.includes(D.DATA_MATRIX)&&o.push(new be),n.includes(D.AZTEC)&&o.push(new Te),n.includes(D.PDF_417)&&o.push(new Me),i&&e&&o.push(new Wt(t))}o.length===0&&(e||o.push(new Wt(t)),o.push(new Re),o.push(new be),o.push(new Te),o.push(new Me),e&&o.push(new Wt(t))),this.readers=o},r.prototype.reset=function(){var t,e;if(this.readers!==null)try{for(var n=gr(this.readers),o=n.next();!o.done;o=n.next())o.value.reset()}catch(i){t={error:i}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},r.prototype.decodeInternal=function(t){var e,n;if(this.readers===null)throw new pr("No readers where selected, nothing can be read.");try{for(var o=gr(this.readers),i=o.next();!i.done;i=o.next()){var a=i.value;try{return a.decode(t,this.hints)}catch(s){if(s instanceof pr)continue}}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}throw new E("No MultiFormat Readers were able to detect the code.")},r}(),Ti=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ea=function(r){function t(e,n){e===void 0&&(e=null),n===void 0&&(n=500);var o=new Si;return o.setHints(e),r.call(this,o,n)||this}return Ti(t,r),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t}(Vt),Oi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ia=function(r){function t(e){return e===void 0&&(e=500),r.call(this,new Me,e)||this}return Oi(t,r),t}(Vt),bi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Sa=function(r){function t(e){return e===void 0&&(e=500),r.call(this,new Re,e)||this}return bi(t,r),t}(Vt);(function(r){r[r.ERROR_CORRECTION=0]="ERROR_CORRECTION",r[r.CHARACTER_SET=1]="CHARACTER_SET",r[r.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",r[r.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",r[r.MIN_SIZE=4]="MIN_SIZE",r[r.MAX_SIZE=5]="MAX_SIZE",r[r.MARGIN=6]="MARGIN",r[r.PDF417_COMPACT=7]="PDF417_COMPACT",r[r.PDF417_COMPACTION=8]="PDF417_COMPACTION",r[r.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",r[r.AZTEC_LAYERS=10]="AZTEC_LAYERS",r[r.QR_VERSION=11]="QR_VERSION",r[r.GS1_FORMAT=12]="GS1_FORMAT",r[r.FORCE_C40=13]="FORCE_C40"})(De||(De={}));var Pe,yr,j=De,Br=function(){function r(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new Rt(t,Int32Array.from([1])))}return r.prototype.buildGenerator=function(t){var e=this.cachedGenerators;if(t>=e.length)for(var n=e[e.length-1],o=this.field,i=e.length;i<=t;i++){var a=n.multiply(new Rt(o,Int32Array.from([1,o.exp(i-1+o.getGeneratorBase())])));e.push(a),n=a}return e[t]},r.prototype.encode=function(t,e){if(e===0)throw new N("No error correction bytes");var n=t.length-e;if(n<=0)throw new N("No data bytes provided");var o=this.buildGenerator(e),i=new Int32Array(n);Z.arraycopy(t,0,i,0,n);for(var a=new Rt(this.field,i),s=(a=a.multiplyByMonomial(e,1)).divide(o)[1].getCoefficients(),u=e-s.length,c=0;c<u;c++)t[n+c]=0;Z.arraycopy(s,0,t,n+u,s.length)},r}(),jt=function(){function r(){}return r.applyMaskPenaltyRule1=function(t){return r.applyMaskPenaltyRule1Internal(t,!0)+r.applyMaskPenaltyRule1Internal(t,!1)},r.applyMaskPenaltyRule2=function(t){for(var e=0,n=t.getArray(),o=t.getWidth(),i=t.getHeight(),a=0;a<i-1;a++)for(var s=n[a],u=0;u<o-1;u++){var c=s[u];c===s[u+1]&&c===n[a+1][u]&&c===n[a+1][u+1]&&e++}return r.N2*e},r.applyMaskPenaltyRule3=function(t){for(var e=0,n=t.getArray(),o=t.getWidth(),i=t.getHeight(),a=0;a<i;a++)for(var s=0;s<o;s++){var u=n[a];s+6<o&&u[s]===1&&u[s+1]===0&&u[s+2]===1&&u[s+3]===1&&u[s+4]===1&&u[s+5]===0&&u[s+6]===1&&(r.isWhiteHorizontal(u,s-4,s)||r.isWhiteHorizontal(u,s+7,s+11))&&e++,a+6<i&&n[a][s]===1&&n[a+1][s]===0&&n[a+2][s]===1&&n[a+3][s]===1&&n[a+4][s]===1&&n[a+5][s]===0&&n[a+6][s]===1&&(r.isWhiteVertical(n,s,a-4,a)||r.isWhiteVertical(n,s,a+7,a+11))&&e++}return e*r.N3},r.isWhiteHorizontal=function(t,e,n){e=Math.max(e,0),n=Math.min(n,t.length);for(var o=e;o<n;o++)if(t[o]===1)return!1;return!0},r.isWhiteVertical=function(t,e,n,o){n=Math.max(n,0),o=Math.min(o,t.length);for(var i=n;i<o;i++)if(t[i][e]===1)return!1;return!0},r.applyMaskPenaltyRule4=function(t){for(var e=0,n=t.getArray(),o=t.getWidth(),i=t.getHeight(),a=0;a<i;a++)for(var s=n[a],u=0;u<o;u++)s[u]===1&&e++;var c=t.getHeight()*t.getWidth();return Math.floor(10*Math.abs(2*e-c)/c)*r.N4},r.getDataMaskBit=function(t,e,n){var o,i;switch(t){case 0:o=n+e&1;break;case 1:o=1&n;break;case 2:o=e%3;break;case 3:o=(n+e)%3;break;case 4:o=Math.floor(n/2)+Math.floor(e/3)&1;break;case 5:o=(1&(i=n*e))+i%3;break;case 6:o=(1&(i=n*e))+i%3&1;break;case 7:o=(i=n*e)%3+(n+e&1)&1;break;default:throw new N("Invalid mask pattern: "+t)}return o===0},r.applyMaskPenaltyRule1Internal=function(t,e){for(var n=0,o=e?t.getHeight():t.getWidth(),i=e?t.getWidth():t.getHeight(),a=t.getArray(),s=0;s<o;s++){for(var u=0,c=-1,f=0;f<i;f++){var h=e?a[s][f]:a[f][s];h===c?u++:(u>=5&&(n+=r.N1+(u-5)),u=1,c=h)}u>=5&&(n+=r.N1+(u-5))}return n},r.N1=3,r.N2=3,r.N3=40,r.N4=10,r}(),Ri=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Lr=function(){function r(t,e){this.width=t,this.height=e;for(var n=new Array(e),o=0;o!==e;o++)n[o]=new Uint8Array(t);this.bytes=n}return r.prototype.getHeight=function(){return this.height},r.prototype.getWidth=function(){return this.width},r.prototype.get=function(t,e){return this.bytes[e][t]},r.prototype.getArray=function(){return this.bytes},r.prototype.setNumber=function(t,e,n){this.bytes[e][t]=n},r.prototype.setBoolean=function(t,e,n){this.bytes[e][t]=n?1:0},r.prototype.clear=function(t){var e,n;try{for(var o=Ri(this.bytes),i=o.next();!i.done;i=o.next()){var a=i.value;$.fill(a,t)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;if(this.width!==e.width||this.height!==e.height)return!1;for(var n=0,o=this.height;n<o;++n)for(var i=this.bytes[n],a=e.bytes[n],s=0,u=this.width;s<u;++s)if(i[s]!==a[s])return!1;return!0},r.prototype.toString=function(){for(var t=new B,e=0,n=this.height;e<n;++e){for(var o=this.bytes[e],i=0,a=this.width;i<a;++i)switch(o[i]){case 0:t.append(" 0");break;case 1:t.append(" 1");break;default:t.append(" ")}t.append(`
|
||
`)}return t.toString()},r}(),Be=function(){function r(){this.maskPattern=-1}return r.prototype.getMode=function(){return this.mode},r.prototype.getECLevel=function(){return this.ecLevel},r.prototype.getVersion=function(){return this.version},r.prototype.getMaskPattern=function(){return this.maskPattern},r.prototype.getMatrix=function(){return this.matrix},r.prototype.toString=function(){var t=new B;return t.append(`<<
|
||
`),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append(`
|
||
ecLevel: `),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append(`
|
||
version: `),t.append(this.version?this.version.toString():"null"),t.append(`
|
||
maskPattern: `),t.append(this.maskPattern.toString()),this.matrix?(t.append(`
|
||
matrix:
|
||
`),t.append(this.matrix.toString())):t.append(`
|
||
matrix: null
|
||
`),t.append(`>>
|
||
`),t.toString()},r.prototype.setMode=function(t){this.mode=t},r.prototype.setECLevel=function(t){this.ecLevel=t},r.prototype.setVersion=function(t){this.version=t},r.prototype.setMaskPattern=function(t){this.maskPattern=t},r.prototype.setMatrix=function(t){this.matrix=t},r.isValidMaskPattern=function(t){return t>=0&&t<r.NUM_MASK_PATTERNS},r.NUM_MASK_PATTERNS=8,r}(),Ni=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),K=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return Ni(t,r),t.kind="WriterException",t}(wt),wr=function(){function r(){}return r.clearMatrix=function(t){t.clear(255)},r.buildMatrix=function(t,e,n,o,i){r.clearMatrix(i),r.embedBasicPatterns(n,i),r.embedTypeInfo(e,o,i),r.maybeEmbedVersionInfo(n,i),r.embedDataBits(t,o,i)},r.embedBasicPatterns=function(t,e){r.embedPositionDetectionPatternsAndSeparators(e),r.embedDarkDotAtLeftBottomCorner(e),r.maybeEmbedPositionAdjustmentPatterns(t,e),r.embedTimingPatterns(e)},r.embedTypeInfo=function(t,e,n){var o=new st;r.makeTypeInfoBits(t,e,o);for(var i=0,a=o.getSize();i<a;++i){var s=o.get(o.getSize()-1-i),u=r.TYPE_INFO_COORDINATES[i],c=u[0],f=u[1];if(n.setBoolean(c,f,s),i<8){var h=n.getWidth()-i-1,l=8;n.setBoolean(h,l,s)}else h=8,l=n.getHeight()-7+(i-8),n.setBoolean(h,l,s)}},r.maybeEmbedVersionInfo=function(t,e){if(!(t.getVersionNumber()<7)){var n=new st;r.makeVersionInfoBits(t,n);for(var o=17,i=0;i<6;++i)for(var a=0;a<3;++a){var s=n.get(o);o--,e.setBoolean(i,e.getHeight()-11+a,s),e.setBoolean(e.getHeight()-11+a,i,s)}}},r.embedDataBits=function(t,e,n){for(var o=0,i=-1,a=n.getWidth()-1,s=n.getHeight()-1;a>0;){for(a===6&&(a-=1);s>=0&&s<n.getHeight();){for(var u=0;u<2;++u){var c=a-u;if(r.isEmpty(n.get(c,s))){var f=void 0;o<t.getSize()?(f=t.get(o),++o):f=!1,e!==255&&jt.getDataMaskBit(e,c,s)&&(f=!f),n.setBoolean(c,s,f)}}s+=i}s+=i=-i,a-=2}if(o!==t.getSize())throw new K("Not all bits consumed: "+o+"/"+t.getSize())},r.findMSBSet=function(t){return 32-P.numberOfLeadingZeros(t)},r.calculateBCHCode=function(t,e){if(e===0)throw new N("0 polynomial");var n=r.findMSBSet(e);for(t<<=n-1;r.findMSBSet(t)>=n;)t^=e<<r.findMSBSet(t)-n;return t},r.makeTypeInfoBits=function(t,e,n){if(!Be.isValidMaskPattern(e))throw new K("Invalid mask pattern");var o=t.getBits()<<3|e;n.appendBits(o,5);var i=r.calculateBCHCode(o,r.TYPE_INFO_POLY);n.appendBits(i,10);var a=new st;if(a.appendBits(r.TYPE_INFO_MASK_PATTERN,15),n.xor(a),n.getSize()!==15)throw new K("should not happen but we got: "+n.getSize())},r.makeVersionInfoBits=function(t,e){e.appendBits(t.getVersionNumber(),6);var n=r.calculateBCHCode(t.getVersionNumber(),r.VERSION_INFO_POLY);if(e.appendBits(n,12),e.getSize()!==18)throw new K("should not happen but we got: "+e.getSize())},r.isEmpty=function(t){return t===255},r.embedTimingPatterns=function(t){for(var e=8;e<t.getWidth()-8;++e){var n=(e+1)%2;r.isEmpty(t.get(e,6))&&t.setNumber(e,6,n),r.isEmpty(t.get(6,e))&&t.setNumber(6,e,n)}},r.embedDarkDotAtLeftBottomCorner=function(t){if(t.get(8,t.getHeight()-8)===0)throw new K;t.setNumber(8,t.getHeight()-8,1)},r.embedHorizontalSeparationPattern=function(t,e,n){for(var o=0;o<8;++o){if(!r.isEmpty(n.get(t+o,e)))throw new K;n.setNumber(t+o,e,0)}},r.embedVerticalSeparationPattern=function(t,e,n){for(var o=0;o<7;++o){if(!r.isEmpty(n.get(t,e+o)))throw new K;n.setNumber(t,e+o,0)}},r.embedPositionAdjustmentPattern=function(t,e,n){for(var o=0;o<5;++o)for(var i=r.POSITION_ADJUSTMENT_PATTERN[o],a=0;a<5;++a)n.setNumber(t+a,e+o,i[a])},r.embedPositionDetectionPattern=function(t,e,n){for(var o=0;o<7;++o)for(var i=r.POSITION_DETECTION_PATTERN[o],a=0;a<7;++a)n.setNumber(t+a,e+o,i[a])},r.embedPositionDetectionPatternsAndSeparators=function(t){var e=r.POSITION_DETECTION_PATTERN[0].length;r.embedPositionDetectionPattern(0,0,t),r.embedPositionDetectionPattern(t.getWidth()-e,0,t),r.embedPositionDetectionPattern(0,t.getWidth()-e,t),r.embedHorizontalSeparationPattern(0,7,t),r.embedHorizontalSeparationPattern(t.getWidth()-8,7,t),r.embedHorizontalSeparationPattern(0,t.getWidth()-8,t),r.embedVerticalSeparationPattern(7,0,t),r.embedVerticalSeparationPattern(t.getHeight()-7-1,0,t),r.embedVerticalSeparationPattern(7,t.getHeight()-7,t)},r.maybeEmbedPositionAdjustmentPatterns=function(t,e){if(!(t.getVersionNumber()<2))for(var n=t.getVersionNumber()-1,o=r.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n],i=0,a=o.length;i!==a;i++){var s=o[i];if(s>=0)for(var u=0;u!==a;u++){var c=o[u];c>=0&&r.isEmpty(e.get(c,s))&&r.embedPositionAdjustmentPattern(c-2,s-2,e)}}},r.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])]),r.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])]),r.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])]),r.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])]),r.VERSION_INFO_POLY=7973,r.TYPE_INFO_POLY=1335,r.TYPE_INFO_MASK_PATTERN=21522,r}(),Di=function(){function r(t,e){this.dataBytes=t,this.errorCorrectionBytes=e}return r.prototype.getDataBytes=function(){return this.dataBytes},r.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},r}(),Cr=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fr=function(){function r(){}return r.calculateMaskPenalty=function(t){return jt.applyMaskPenaltyRule1(t)+jt.applyMaskPenaltyRule2(t)+jt.applyMaskPenaltyRule3(t)+jt.applyMaskPenaltyRule4(t)},r.encode=function(t,e,n){n===void 0&&(n=null);var o=r.DEFAULT_BYTE_MODE_ENCODING,i=n!==null&&n.get(j.CHARACTER_SET)!==void 0;i&&(o=n.get(j.CHARACTER_SET).toString());var a=this.chooseMode(t,o),s=new st;if(a===q.BYTE&&(i||r.DEFAULT_BYTE_MODE_ENCODING!==o)){var u=nt.getCharacterSetECIByName(o);u!==void 0&&this.appendECI(u,s)}this.appendModeInfo(a,s);var c,f=new st;if(this.appendBytes(t,a,f,o),n!==null&&n.get(j.QR_VERSION)!==void 0){var h=Number.parseInt(n.get(j.QR_VERSION).toString(),10);c=Lt.getVersionForNumber(h);var l=this.calculateBitsNeeded(a,s,f,c);if(!this.willFit(l,c,e))throw new K("Data too big for requested version")}else c=this.recommendVersion(e,a,s,f);var d=new st;d.appendBitArray(s);var p=a===q.BYTE?f.getSizeInBytes():t.length;this.appendLengthInfo(p,c,a,d),d.appendBitArray(f);var y=c.getECBlocksForLevel(e),C=c.getTotalCodewords()-y.getTotalECCodewords();this.terminateBits(C,d);var w=this.interleaveWithECBytes(d,c.getTotalCodewords(),C,y.getNumBlocks()),v=new Be;v.setECLevel(e),v.setMode(a),v.setVersion(c);var _=c.getDimensionForVersion(),m=new Lr(_,_),I=this.chooseMaskPattern(w,e,c,m);return v.setMaskPattern(I),wr.buildMatrix(w,e,c,I,m),v.setMatrix(m),v},r.recommendVersion=function(t,e,n,o){var i=this.calculateBitsNeeded(e,n,o,Lt.getVersionForNumber(1)),a=this.chooseVersion(i,t),s=this.calculateBitsNeeded(e,n,o,a);return this.chooseVersion(s,t)},r.calculateBitsNeeded=function(t,e,n,o){return e.getSize()+t.getCharacterCountBits(o)+n.getSize()},r.getAlphanumericCode=function(t){return t<r.ALPHANUMERIC_TABLE.length?r.ALPHANUMERIC_TABLE[t]:-1},r.chooseMode=function(t,e){if(e===void 0&&(e=null),nt.SJIS.getName()===e&&this.isOnlyDoubleByteKanji(t))return q.KANJI;for(var n=!1,o=!1,i=0,a=t.length;i<a;++i){var s=t.charAt(i);if(r.isDigit(s))n=!0;else{if(this.getAlphanumericCode(s.charCodeAt(0))===-1)return q.BYTE;o=!0}}return o?q.ALPHANUMERIC:n?q.NUMERIC:q.BYTE},r.isOnlyDoubleByteKanji=function(t){var e;try{e=At.encode(t,nt.SJIS)}catch{return!1}var n=e.length;if(n%2!=0)return!1;for(var o=0;o<n;o+=2){var i=255&e[o];if((i<129||i>159)&&(i<224||i>235))return!1}return!0},r.chooseMaskPattern=function(t,e,n,o){for(var i=Number.MAX_SAFE_INTEGER,a=-1,s=0;s<Be.NUM_MASK_PATTERNS;s++){wr.buildMatrix(t,e,n,s,o);var u=this.calculateMaskPenalty(o);u<i&&(i=u,a=s)}return a},r.chooseVersion=function(t,e){for(var n=1;n<=40;n++){var o=Lt.getVersionForNumber(n);if(r.willFit(t,o,e))return o}throw new K("Data too big")},r.willFit=function(t,e,n){return e.getTotalCodewords()-e.getECBlocksForLevel(n).getTotalECCodewords()>=(t+7)/8},r.terminateBits=function(t,e){var n=8*t;if(e.getSize()>n)throw new K("data bits cannot fit in the QR Code"+e.getSize()+" > "+n);for(var o=0;o<4&&e.getSize()<n;++o)e.appendBit(!1);var i=7&e.getSize();if(i>0)for(o=i;o<8;o++)e.appendBit(!1);var a=t-e.getSizeInBytes();for(o=0;o<a;++o)e.appendBits(1&o?17:236,8);if(e.getSize()!==n)throw new K("Bits size does not equal capacity")},r.getNumDataBytesAndNumECBytesForBlockID=function(t,e,n,o,i,a){if(o>=n)throw new K("Block ID too large");var s=t%n,u=n-s,c=Math.floor(t/n),f=c+1,h=Math.floor(e/n),l=h+1,d=c-h,p=f-l;if(d!==p)throw new K("EC bytes mismatch");if(n!==u+s)throw new K("RS blocks mismatch");if(t!==(h+d)*u+(l+p)*s)throw new K("Total bytes mismatch");o<u?(i[0]=h,a[0]=d):(i[0]=l,a[0]=p)},r.interleaveWithECBytes=function(t,e,n,o){var i,a,s,u;if(t.getSizeInBytes()!==n)throw new K("Number of bits and data bytes does not match");for(var c=0,f=0,h=0,l=new Array,d=0;d<o;++d){var p=new Int32Array(1),y=new Int32Array(1);r.getNumDataBytesAndNumECBytesForBlockID(e,n,o,d,p,y);var C=p[0],w=new Uint8Array(C);t.toBytes(8*c,w,0,C);var v=r.generateECBytes(w,y[0]);l.push(new Di(w,v)),f=Math.max(f,C),h=Math.max(h,v.length),c+=p[0]}if(n!==c)throw new K("Data bytes does not match offset");var _=new st;for(d=0;d<f;++d)try{for(var m=(i=void 0,Cr(l)),I=m.next();!I.done;I=m.next())d<(w=I.value.getDataBytes()).length&&_.appendBits(w[d],8)}catch(M){i={error:M}}finally{try{I&&!I.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}for(d=0;d<h;++d)try{for(var S=(s=void 0,Cr(l)),O=S.next();!O.done;O=S.next())d<(v=O.value.getErrorCorrectionBytes()).length&&_.appendBits(v[d],8)}catch(M){s={error:M}}finally{try{O&&!O.done&&(u=S.return)&&u.call(S)}finally{if(s)throw s.error}}if(e!==_.getSizeInBytes())throw new K("Interleaving error: "+e+" and "+_.getSizeInBytes()+" differ.");return _},r.generateECBytes=function(t,e){for(var n=t.length,o=new Int32Array(n+e),i=0;i<n;i++)o[i]=255&t[i];new Br(gt.QR_CODE_FIELD_256).encode(o,e);var a=new Uint8Array(e);for(i=0;i<e;i++)a[i]=o[n+i];return a},r.appendModeInfo=function(t,e){e.appendBits(t.getBits(),4)},r.appendLengthInfo=function(t,e,n,o){var i=n.getCharacterCountBits(e);if(t>=1<<i)throw new K(t+" is bigger than "+((1<<i)-1));o.appendBits(t,i)},r.appendBytes=function(t,e,n,o){switch(e){case q.NUMERIC:r.appendNumericBytes(t,n);break;case q.ALPHANUMERIC:r.appendAlphanumericBytes(t,n);break;case q.BYTE:r.append8BitBytes(t,n,o);break;case q.KANJI:r.appendKanjiBytes(t,n);break;default:throw new K("Invalid mode: "+e)}},r.getDigit=function(t){return t.charCodeAt(0)-48},r.isDigit=function(t){var e=r.getDigit(t);return e>=0&&e<=9},r.appendNumericBytes=function(t,e){for(var n=t.length,o=0;o<n;){var i=r.getDigit(t.charAt(o));if(o+2<n){var a=r.getDigit(t.charAt(o+1)),s=r.getDigit(t.charAt(o+2));e.appendBits(100*i+10*a+s,10),o+=3}else o+1<n?(a=r.getDigit(t.charAt(o+1)),e.appendBits(10*i+a,7),o+=2):(e.appendBits(i,4),o++)}},r.appendAlphanumericBytes=function(t,e){for(var n=t.length,o=0;o<n;){var i=r.getAlphanumericCode(t.charCodeAt(o));if(i===-1)throw new K;if(o+1<n){var a=r.getAlphanumericCode(t.charCodeAt(o+1));if(a===-1)throw new K;e.appendBits(45*i+a,11),o+=2}else e.appendBits(i,6),o++}},r.append8BitBytes=function(t,e,n){var o;try{o=At.encode(t,n)}catch(u){throw new K(u)}for(var i=0,a=o.length;i!==a;i++){var s=o[i];e.appendBits(s,8)}},r.appendKanjiBytes=function(t,e){var n;try{n=At.encode(t,nt.SJIS)}catch(c){throw new K(c)}for(var o=n.length,i=0;i<o;i+=2){var a=(255&n[i])<<8&4294967295|255&n[i+1],s=-1;if(a>=33088&&a<=40956?s=a-33088:a>=57408&&a<=60351&&(s=a-49472),s===-1)throw new K("Invalid byte sequence");var u=192*(s>>8)+(255&s);e.appendBits(u,13)}},r.appendECI=function(t,e){e.appendBits(q.ECI.getBits(),4),e.appendBits(t.getValue(),8)},r.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]),r.DEFAULT_BYTE_MODE_ENCODING=nt.UTF8.getName(),r}(),Ta=function(){function r(){}return r.prototype.write=function(t,e,n,o){if(o===void 0&&(o=null),t.length===0)throw new N("Found empty contents");if(e<0||n<0)throw new N("Requested dimensions are too small: "+e+"x"+n);var i=Zt.L,a=r.QUIET_ZONE_SIZE;o!==null&&(o.get(j.ERROR_CORRECTION)!==void 0&&(i=Zt.fromString(o.get(j.ERROR_CORRECTION).toString())),o.get(j.MARGIN)!==void 0&&(a=Number.parseInt(o.get(j.MARGIN).toString(),10)));var s=Fr.encode(t,i,o);return this.renderResult(s,e,n,a)},r.prototype.writeToDom=function(t,e,n,o,i){i===void 0&&(i=null),typeof t=="string"&&(t=document.querySelector(t));var a=this.write(e,n,o,i);t&&t.appendChild(a)},r.prototype.renderResult=function(t,e,n,o){var i=t.getMatrix();if(i===null)throw new Nt;for(var a=i.getWidth(),s=i.getHeight(),u=a+2*o,c=s+2*o,f=Math.max(e,u),h=Math.max(n,c),l=Math.min(Math.floor(f/u),Math.floor(h/c)),d=Math.floor((f-a*l)/2),p=Math.floor((h-s*l)/2),y=this.createSVGElement(f,h),C=0,w=p;C<s;C++,w+=l)for(var v=0,_=d;v<a;v++,_+=l)if(i.get(v,C)===1){var m=this.createSvgRectElement(_,w,l,l);y.appendChild(m)}return y},r.prototype.createSVGElement=function(t,e){var n=document.createElementNS(r.SVG_NS,"svg");return n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"width",e.toString()),n},r.prototype.createSvgRectElement=function(t,e,n,o){var i=document.createElementNS(r.SVG_NS,"rect");return i.setAttributeNS(null,"x",t.toString()),i.setAttributeNS(null,"y",e.toString()),i.setAttributeNS(null,"height",n.toString()),i.setAttributeNS(null,"width",o.toString()),i.setAttributeNS(null,"fill","#000000"),i},r.QUIET_ZONE_SIZE=4,r.SVG_NS="http://www.w3.org/2000/svg",r}(),Mi=function(){function r(){}return r.prototype.encode=function(t,e,n,o,i){if(t.length===0)throw new N("Found empty contents");if(e!==D.QR_CODE)throw new N("Can only encode QR_CODE, but got "+e);if(n<0||o<0)throw new N("Requested dimensions are too small: "+n+"x"+o);var a=Zt.L,s=r.QUIET_ZONE_SIZE;i!==null&&(i.get(j.ERROR_CORRECTION)!==void 0&&(a=Zt.fromString(i.get(j.ERROR_CORRECTION).toString())),i.get(j.MARGIN)!==void 0&&(s=Number.parseInt(i.get(j.MARGIN).toString(),10)));var u=Fr.encode(t,a,i);return r.renderResult(u,n,o,s)},r.renderResult=function(t,e,n,o){var i=t.getMatrix();if(i===null)throw new Nt;for(var a=i.getWidth(),s=i.getHeight(),u=a+2*o,c=s+2*o,f=Math.max(e,u),h=Math.max(n,c),l=Math.min(Math.floor(f/u),Math.floor(h/c)),d=Math.floor((f-a*l)/2),p=Math.floor((h-s*l)/2),y=new yt(f,h),C=0,w=p;C<s;C++,w+=l)for(var v=0,_=d;v<a;v++,_+=l)i.get(v,C)===1&&y.setRegion(_,w,l,l);return y},r.QUIET_ZONE_SIZE=4,r}(),Oa=function(){function r(){}return r.prototype.encode=function(t,e,n,o,i){if(e!==D.QR_CODE)throw new N("No encoder available for format "+e);return new Mi().encode(t,e,n,o,i)},r}(),Pi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ba=function(r){function t(e,n,o,i,a,s,u,c){var f=r.call(this,s,u)||this;if(f.yuvData=e,f.dataWidth=n,f.dataHeight=o,f.left=i,f.top=a,i+s>n||a+u>o)throw new N("Crop rectangle does not fit within image data.");return c&&f.reverseHorizontal(s,u),f}return Pi(t,r),t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new N("Requested row is outside the image: "+e);var o=this.getWidth();(n==null||n.length<o)&&(n=new Uint8ClampedArray(o));var i=(e+this.top)*this.dataWidth+this.left;return Z.arraycopy(this.yuvData,i,n,0,o),n},t.prototype.getMatrix=function(){var e=this.getWidth(),n=this.getHeight();if(e===this.dataWidth&&n===this.dataHeight)return this.yuvData;var o=e*n,i=new Uint8ClampedArray(o),a=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return Z.arraycopy(this.yuvData,a,i,0,o),i;for(var s=0;s<n;s++){var u=s*e;Z.arraycopy(this.yuvData,a,i,u,e),a+=this.dataWidth}return i},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,o,i){return new t(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+n,o,i,!1)},t.prototype.renderThumbnail=function(){for(var e=this.getWidth()/t.THUMBNAIL_SCALE_FACTOR,n=this.getHeight()/t.THUMBNAIL_SCALE_FACTOR,o=new Int32Array(e*n),i=this.yuvData,a=this.top*this.dataWidth+this.left,s=0;s<n;s++){for(var u=s*e,c=0;c<e;c++){var f=255&i[a+c*t.THUMBNAIL_SCALE_FACTOR];o[u+c]=4278190080|65793*f}a+=this.dataWidth*t.THUMBNAIL_SCALE_FACTOR}return o},t.prototype.getThumbnailWidth=function(){return this.getWidth()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.getThumbnailHeight=function(){return this.getHeight()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.reverseHorizontal=function(e,n){for(var o=this.yuvData,i=0,a=this.top*this.dataWidth+this.left;i<n;i++,a+=this.dataWidth)for(var s=a+e/2,u=a,c=a+e-1;u<s;u++,c--){var f=o[u];o[u]=o[c],o[c]=f}},t.prototype.invert=function(){return new Fe(this)},t.THUMBNAIL_SCALE_FACTOR=2,t}(ue),Bi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ra=function(r){function t(e,n,o,i,a,s,u){var c=r.call(this,n,o)||this;if(c.dataWidth=i,c.dataHeight=a,c.left=s,c.top=u,e.BYTES_PER_ELEMENT===4){for(var f=n*o,h=new Uint8ClampedArray(f),l=0;l<f;l++){var d=e[l],p=d>>16&255,y=d>>7&510,C=255&d;h[l]=(p+y+C)/4&255}c.luminances=h}else c.luminances=e;if(i===void 0&&(c.dataWidth=n),a===void 0&&(c.dataHeight=o),s===void 0&&(c.left=0),u===void 0&&(c.top=0),c.left+n>c.dataWidth||c.top+o>c.dataHeight)throw new N("Crop rectangle does not fit within image data.");return c}return Bi(t,r),t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new N("Requested row is outside the image: "+e);var o=this.getWidth();(n==null||n.length<o)&&(n=new Uint8ClampedArray(o));var i=(e+this.top)*this.dataWidth+this.left;return Z.arraycopy(this.luminances,i,n,0,o),n},t.prototype.getMatrix=function(){var e=this.getWidth(),n=this.getHeight();if(e===this.dataWidth&&n===this.dataHeight)return this.luminances;var o=e*n,i=new Uint8ClampedArray(o),a=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return Z.arraycopy(this.luminances,a,i,0,o),i;for(var s=0;s<n;s++){var u=s*e;Z.arraycopy(this.luminances,a,i,u,e),a+=this.dataWidth}return i},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,o,i){return new t(this.luminances,o,i,this.dataWidth,this.dataHeight,this.left+e,this.top+n)},t.prototype.invert=function(){return new Fe(this)},t}(ue),Li=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ue=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return Li(t,r),t.forName=function(e){return this.getCharacterSetECIByName(e)},t}(nt),xr=function(){function r(){}return r.ISO_8859_1=nt.ISO8859_1,r}(),Fi=function(){function r(t,e,n){this.codewords=t,this.numcols=e,this.numrows=n,this.bits=new Uint8Array(e*n),$.fill(this.bits,2)}return r.prototype.getNumrows=function(){return this.numrows},r.prototype.getNumcols=function(){return this.numcols},r.prototype.getBits=function(){return this.bits},r.prototype.getBit=function(t,e){return this.bits[e*this.numcols+t]===1},r.prototype.setBit=function(t,e,n){this.bits[e*this.numcols+t]=n?1:0},r.prototype.noBit=function(t,e){return this.bits[e*this.numcols+t]===2},r.prototype.place=function(){var t=0,e=4,n=0;do{e===this.numrows&&n===0&&this.corner1(t++),e===this.numrows-2&&n===0&&this.numcols%4!=0&&this.corner2(t++),e===this.numrows-2&&n===0&&this.numcols%8==4&&this.corner3(t++),e===this.numrows+4&&n===2&&this.numcols%8==0&&this.corner4(t++);do e<this.numrows&&n>=0&&this.noBit(n,e)&&this.utah(e,n,t++),e-=2,n+=2;while(e>=0&&n<this.numcols);e++,n+=3;do e>=0&&n<this.numcols&&this.noBit(n,e)&&this.utah(e,n,t++),e+=2,n-=2;while(e<this.numrows&&n>=0);e+=3,n++}while(e<this.numrows||n<this.numcols);this.noBit(this.numcols-1,this.numrows-1)&&(this.setBit(this.numcols-1,this.numrows-1,!0),this.setBit(this.numcols-2,this.numrows-2,!0))},r.prototype.module=function(t,e,n,o){t<0&&(t+=this.numrows,e+=4-(this.numrows+4)%8),e<0&&(e+=this.numcols,t+=4-(this.numcols+4)%8);var i=this.codewords.charCodeAt(n);i&=1<<8-o,this.setBit(e,t,i!==0)},r.prototype.utah=function(t,e,n){this.module(t-2,e-2,n,1),this.module(t-2,e-1,n,2),this.module(t-1,e-2,n,3),this.module(t-1,e-1,n,4),this.module(t-1,e,n,5),this.module(t,e-2,n,6),this.module(t,e-1,n,7),this.module(t,e,n,8)},r.prototype.corner1=function(t){this.module(this.numrows-1,0,t,1),this.module(this.numrows-1,1,t,2),this.module(this.numrows-1,2,t,3),this.module(0,this.numcols-2,t,4),this.module(0,this.numcols-1,t,5),this.module(1,this.numcols-1,t,6),this.module(2,this.numcols-1,t,7),this.module(3,this.numcols-1,t,8)},r.prototype.corner2=function(t){this.module(this.numrows-3,0,t,1),this.module(this.numrows-2,0,t,2),this.module(this.numrows-1,0,t,3),this.module(0,this.numcols-4,t,4),this.module(0,this.numcols-3,t,5),this.module(0,this.numcols-2,t,6),this.module(0,this.numcols-1,t,7),this.module(1,this.numcols-1,t,8)},r.prototype.corner3=function(t){this.module(this.numrows-3,0,t,1),this.module(this.numrows-2,0,t,2),this.module(this.numrows-1,0,t,3),this.module(0,this.numcols-2,t,4),this.module(0,this.numcols-1,t,5),this.module(1,this.numcols-1,t,6),this.module(2,this.numcols-1,t,7),this.module(3,this.numcols-1,t,8)},r.prototype.corner4=function(t){this.module(this.numrows-1,0,t,1),this.module(this.numrows-1,this.numcols-1,t,2),this.module(0,this.numcols-3,t,3),this.module(0,this.numcols-2,t,4),this.module(0,this.numcols-1,t,5),this.module(1,this.numcols-3,t,6),this.module(1,this.numcols-2,t,7),this.module(1,this.numcols-1,t,8)},r}(),vr=[5,7,10,11,12,14,18,20,24,28,36,42,48,56,62,68],xi=[[228,48,15,111,62],[23,68,144,134,240,92,254],[28,24,185,166,223,248,116,255,110,61],[175,138,205,12,194,168,39,245,60,97,120],[41,153,158,91,61,42,142,213,97,178,100,242],[156,97,192,252,95,9,157,119,138,45,18,186,83,185],[83,195,100,39,188,75,66,61,241,213,109,129,94,254,225,48,90,188],[15,195,244,9,233,71,168,2,188,160,153,145,253,79,108,82,27,174,186,172],[52,190,88,205,109,39,176,21,155,197,251,223,155,21,5,172,254,124,12,181,184,96,50,193],[211,231,43,97,71,96,103,174,37,151,170,53,75,34,249,121,17,138,110,213,141,136,120,151,233,168,93,255],[245,127,242,218,130,250,162,181,102,120,84,179,220,251,80,182,229,18,2,4,68,33,101,137,95,119,115,44,175,184,59,25,225,98,81,112],[77,193,137,31,19,38,22,153,247,105,122,2,245,133,242,8,175,95,100,9,167,105,214,111,57,121,21,1,253,57,54,101,248,202,69,50,150,177,226,5,9,5],[245,132,172,223,96,32,117,22,238,133,238,231,205,188,237,87,191,106,16,147,118,23,37,90,170,205,131,88,120,100,66,138,186,240,82,44,176,87,187,147,160,175,69,213,92,253,225,19],[175,9,223,238,12,17,220,208,100,29,175,170,230,192,215,235,150,159,36,223,38,200,132,54,228,146,218,234,117,203,29,232,144,238,22,150,201,117,62,207,164,13,137,245,127,67,247,28,155,43,203,107,233,53,143,46],[242,93,169,50,144,210,39,118,202,188,201,189,143,108,196,37,185,112,134,230,245,63,197,190,250,106,185,221,175,64,114,71,161,44,147,6,27,218,51,63,87,10,40,130,188,17,163,31,176,170,4,107,232,7,94,166,224,124,86,47,11,204],[220,228,173,89,251,149,159,56,89,33,147,244,154,36,73,127,213,136,248,180,234,197,158,177,68,122,93,213,15,160,227,236,66,139,153,185,202,167,179,25,220,232,96,210,231,136,223,239,181,241,59,52,172,25,49,232,211,189,64,54,108,153,132,63,96,103,82,186]],ee=(Pe=function(r,t){for(var e=1,n=0;n<255;n++)t[n]=e,r[e]=n,(e*=2)>=256&&(e^=301);return{LOG:r,ALOG:t}}([],[]),Pe.LOG),Ar=Pe.ALOG;(function(r){r[r.FORCE_NONE=0]="FORCE_NONE",r[r.FORCE_SQUARE=1]="FORCE_SQUARE",r[r.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"})(yr||(yr={}));var b,kr="[)>05",Vr="[)>06",se="",ki=function(){function r(){}return r.encodeECC200=function(t,e){if(t.length!==e.getDataCapacity())throw new Error("The number of codewords does not match the selected symbol");var n=new B;n.append(t);var o=e.getInterleavedBlockCount();if(o===1){var i=this.createECCBlock(t,e.getErrorCodewords());n.append(i)}else{for(var a=[],s=[],u=0;u<o;u++)a[u]=e.getDataLengthForInterleavedBlock(u+1),s[u]=e.getErrorLengthForInterleavedBlock(u+1);for(var c=0;c<o;c++){for(var f=new B,h=c;h<e.getDataCapacity();h+=o)f.append(t.charAt(h));i=this.createECCBlock(f.toString(),s[c]);for(var l=0,d=c;d<s[c]*o;d+=o)n.setCharAt(e.getDataCapacity()+d,i.charAt(l++))}}return n.toString()},r.createECCBlock=function(t,e){for(var n=-1,o=0;o<vr.length;o++)if(vr[o]===e){n=o;break}if(n<0)throw new Error("Illegal number of error correction codewords specified: "+e);var i=xi[n],a=[];for(o=0;o<e;o++)a[o]=0;for(o=0;o<t.length;o++){for(var s=a[e-1]^t.charAt(o).charCodeAt(0),u=e-1;u>0;u--)s!==0&&i[u]!==0?a[u]=a[u-1]^Ar[(ee[s]+ee[i[u]])%255]:a[u]=a[u-1];s!==0&&i[0]!==0?a[0]=Ar[(ee[s]+ee[i[0]])%255]:a[0]=0}var c=[];for(o=0;o<e;o++)c[o]=a[e-o-1];return c.map(function(f){return String.fromCharCode(f)}).join("")},r}(),Vi=function(){function r(){}return r.prototype.getEncodingMode=function(){return 0},r.prototype.encode=function(t){if(L.determineConsecutiveDigitCount(t.getMessage(),t.pos)>=2)t.writeCodeword(this.encodeASCIIDigits(t.getMessage().charCodeAt(t.pos),t.getMessage().charCodeAt(t.pos+1))),t.pos+=2;else{var e=t.getCurrentChar(),n=L.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(n!==this.getEncodingMode())switch(n){case 5:return t.writeCodeword(231),void t.signalEncoderChange(5);case 1:return t.writeCodeword(230),void t.signalEncoderChange(1);case 3:t.writeCodeword(238),t.signalEncoderChange(3);break;case 2:t.writeCodeword(239),t.signalEncoderChange(2);break;case 4:t.writeCodeword(240),t.signalEncoderChange(4);break;default:throw new Error("Illegal mode: "+n)}else L.isExtendedASCII(e)?(t.writeCodeword(235),t.writeCodeword(e-128+1),t.pos++):(t.writeCodeword(e+1),t.pos++)}},r.prototype.encodeASCIIDigits=function(t,e){if(L.isDigit(t)&&L.isDigit(e))return 10*(t-48)+(e-48)+130;throw new Error("not digits: "+t+e)},r}(),Hi=function(){function r(){}return r.prototype.getEncodingMode=function(){return 5},r.prototype.encode=function(t){var e=new B;for(e.append(0);t.hasMoreCharacters();){var n=t.getCurrentChar();if(e.append(n),t.pos++,L.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}var o=e.length()-1,i=t.getCodewordCount()+o+1;t.updateSymbolInfo(i);var a=t.getSymbolInfo().getDataCapacity()-i>0;if(t.hasMoreCharacters()||a)if(o<=249)e.setCharAt(0,F.getCharAt(o));else{if(!(o<=1555))throw new Error("Message length not in valid ranges: "+o);e.setCharAt(0,F.getCharAt(Math.floor(o/250)+249)),e.insert(1,F.getCharAt(o%250))}var s=0;for(n=e.length();s<n;s++)t.writeCodeword(this.randomize255State(e.charAt(s).charCodeAt(0),t.getCodewordCount()+1))},r.prototype.randomize255State=function(t,e){var n=t+(149*e%255+1);return n<=255?n:n-256},r}(),Xe=function(){function r(){}return r.prototype.getEncodingMode=function(){return 1},r.prototype.encodeMaximal=function(t){for(var e=new B,n=0,o=t.pos,i=0;t.hasMoreCharacters();){var a=t.getCurrentChar();t.pos++,n=this.encodeChar(a,e),e.length()%3==0&&(o=t.pos,i=e.length())}if(i!==e.length()){var s=Math.floor(e.length()/3*2),u=Math.floor(t.getCodewordCount()+s+1);t.updateSymbolInfo(u);var c=t.getSymbolInfo().getDataCapacity()-u,f=Math.floor(e.length()%3);(f===2&&c!==2||f===1&&(n>3||c!==1))&&(t.pos=o)}e.length()>0&&t.writeCodeword(230),this.handleEOD(t,e)},r.prototype.encode=function(t){for(var e=new B;t.hasMoreCharacters();){var n=t.getCurrentChar();t.pos++;var o=this.encodeChar(n,e),i=2*Math.floor(e.length()/3),a=t.getCodewordCount()+i;t.updateSymbolInfo(a);var s=t.getSymbolInfo().getDataCapacity()-a;if(!t.hasMoreCharacters()){var u=new B;for(e.length()%3==2&&s!==2&&(o=this.backtrackOneCharacter(t,e,u,o));e.length()%3==1&&(o>3||s!==1);)o=this.backtrackOneCharacter(t,e,u,o);break}if(e.length()%3==0&&L.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}this.handleEOD(t,e)},r.prototype.backtrackOneCharacter=function(t,e,n,o){var i=e.length(),a=e.toString().substring(0,i-o);e.setLengthToZero(),e.append(a),t.pos--;var s=t.getCurrentChar();return o=this.encodeChar(s,n),t.resetSymbolInfo(),o},r.prototype.writeNextTriplet=function(t,e){t.writeCodewords(this.encodeToCodewords(e.toString()));var n=e.toString().substring(3);e.setLengthToZero(),e.append(n)},r.prototype.handleEOD=function(t,e){var n=Math.floor(e.length()/3*2),o=e.length()%3,i=t.getCodewordCount()+n;t.updateSymbolInfo(i);var a=t.getSymbolInfo().getDataCapacity()-i;if(o===2){for(e.append("\0");e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(254)}else if(a===1&&o===1){for(;e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(254),t.pos--}else{if(o!==0)throw new Error("Unexpected case. Please report!");for(;e.length()>=3;)this.writeNextTriplet(t,e);(a>0||t.hasMoreCharacters())&&t.writeCodeword(254)}t.signalEncoderChange(0)},r.prototype.encodeChar=function(t,e){if(t===" ".charCodeAt(0))return e.append(3),1;if(t>="0".charCodeAt(0)&&t<="9".charCodeAt(0))return e.append(t-48+4),1;if(t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0))return e.append(t-65+14),1;if(t<" ".charCodeAt(0))return e.append(0),e.append(t),2;if(t<="/".charCodeAt(0))return e.append(1),e.append(t-33),2;if(t<="@".charCodeAt(0))return e.append(1),e.append(t-58+15),2;if(t<="_".charCodeAt(0))return e.append(1),e.append(t-91+22),2;if(t<=127)return e.append(2),e.append(t-96),2;e.append("1");var n=2;return n+=this.encodeChar(t-128,e)},r.prototype.encodeToCodewords=function(t){var e=1600*t.charCodeAt(0)+40*t.charCodeAt(1)+t.charCodeAt(2)+1,n=e/256,o=e%256,i=new B;return i.append(n),i.append(o),i.toString()},r}(),Ui=function(){function r(){}return r.prototype.getEncodingMode=function(){return 4},r.prototype.encode=function(t){for(var e=new B;t.hasMoreCharacters();){var n=t.getCurrentChar();if(this.encodeChar(n,e),t.pos++,e.length()>=4){t.writeCodewords(this.encodeToCodewords(e.toString()));var o=e.toString().substring(4);if(e.setLengthToZero(),e.append(o),L.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}}e.append(F.getCharAt(31)),this.handleEOD(t,e)},r.prototype.handleEOD=function(t,e){try{var n=e.length();if(n===0)return;if(n===1){t.updateSymbolInfo();var o=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),i=t.getRemainingCharacters();if(i>o&&(t.updateSymbolInfo(t.getCodewordCount()+1),o=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount()),i<=o&&o<=2)return}if(n>4)throw new Error("Count must not exceed 4");var a=n-1,s=this.encodeToCodewords(e.toString()),u=!t.hasMoreCharacters()&&a<=2;a<=2&&(t.updateSymbolInfo(t.getCodewordCount()+a),(o=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount())>=3&&(u=!1,t.updateSymbolInfo(t.getCodewordCount()+s.length))),u?(t.resetSymbolInfo(),t.pos-=a):t.writeCodewords(s)}finally{t.signalEncoderChange(0)}},r.prototype.encodeChar=function(t,e){t>=" ".charCodeAt(0)&&t<="?".charCodeAt(0)?e.append(t):t>="@".charCodeAt(0)&&t<="^".charCodeAt(0)?e.append(F.getCharAt(t-64)):L.illegalCharacter(F.getCharAt(t))},r.prototype.encodeToCodewords=function(t){var e=t.length;if(e===0)throw new Error("StringBuilder must not be empty");var n=(t.charAt(0).charCodeAt(0)<<18)+((e>=2?t.charAt(1).charCodeAt(0):0)<<12)+((e>=3?t.charAt(2).charCodeAt(0):0)<<6)+(e>=4?t.charAt(3).charCodeAt(0):0),o=n>>16&255,i=n>>8&255,a=255&n,s=new B;return s.append(o),e>=2&&s.append(i),e>=3&&s.append(a),s.toString()},r}(),Xi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Gi=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},H=function(){function r(t,e,n,o,i,a,s,u){s===void 0&&(s=0),u===void 0&&(u=0),this.rectangular=t,this.dataCapacity=e,this.errorCodewords=n,this.matrixWidth=o,this.matrixHeight=i,this.dataRegions=a,this.rsBlockData=s,this.rsBlockError=u}return r.lookup=function(t,e,n,o,i){var a,s;e===void 0&&(e=0),n===void 0&&(n=null),o===void 0&&(o=null),i===void 0&&(i=!0);try{for(var u=Gi(zi),c=u.next();!c.done;c=u.next()){var f=c.value;if((e!==1||!f.rectangular)&&(e!==2||f.rectangular)&&(n==null||!(f.getSymbolWidth()<n.getWidth()||f.getSymbolHeight()<n.getHeight()))&&(o==null||!(f.getSymbolWidth()>o.getWidth()||f.getSymbolHeight()>o.getHeight()))&&t<=f.dataCapacity)return f}}catch(h){a={error:h}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}if(i)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+t);return null},r.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},r.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},r.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},r.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},r.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+2*this.getHorizontalDataRegions()},r.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+2*this.getVerticalDataRegions()},r.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},r.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},r.prototype.getDataCapacity=function(){return this.dataCapacity},r.prototype.getErrorCodewords=function(){return this.errorCodewords},r.prototype.getDataLengthForInterleavedBlock=function(t){return this.rsBlockData},r.prototype.getErrorLengthForInterleavedBlock=function(t){return this.rsBlockError},r}(),Wi=function(r){function t(){return r.call(this,!1,1558,620,22,22,36,-1,62)||this}return Xi(t,r),t.prototype.getInterleavedBlockCount=function(){return 10},t.prototype.getDataLengthForInterleavedBlock=function(e){return e<=8?156:155},t}(H),zi=[new H(!1,3,5,8,8,1),new H(!1,5,7,10,10,1),new H(!0,5,7,16,6,1),new H(!1,8,10,12,12,1),new H(!0,10,11,14,6,2),new H(!1,12,12,14,14,1),new H(!0,16,14,24,10,1),new H(!1,18,14,16,16,1),new H(!1,22,18,18,18,1),new H(!0,22,18,16,10,2),new H(!1,30,20,20,20,1),new H(!0,32,24,16,14,2),new H(!1,36,24,22,22,1),new H(!1,44,28,24,24,1),new H(!0,49,28,22,14,2),new H(!1,62,36,14,14,4),new H(!1,86,42,16,16,4),new H(!1,114,48,18,18,4),new H(!1,144,56,20,20,4),new H(!1,174,68,22,22,4),new H(!1,204,84,24,24,4,102,42),new H(!1,280,112,14,14,16,140,56),new H(!1,368,144,16,16,16,92,36),new H(!1,456,192,18,18,16,114,48),new H(!1,576,224,20,20,16,144,56),new H(!1,696,272,22,22,16,174,68),new H(!1,816,336,24,24,16,136,56),new H(!1,1050,408,18,18,36,175,68),new H(!1,1304,496,20,20,36,163,62),new Wi],ji=function(){function r(t){this.msg=t,this.pos=0,this.skipAtEnd=0;for(var e=t.split("").map(function(s){return s.charCodeAt(0)}),n=new B,o=0,i=e.length;o<i;o++){var a=String.fromCharCode(255&e[o]);if(a==="?"&&t.charAt(o)!=="?")throw new Error("Message contains characters outside ISO-8859-1 encoding.");n.append(a)}this.msg=n.toString(),this.shape=0,this.codewords=new B,this.newEncoding=-1}return r.prototype.setSymbolShape=function(t){this.shape=t},r.prototype.setSizeConstraints=function(t,e){this.minSize=t,this.maxSize=e},r.prototype.getMessage=function(){return this.msg},r.prototype.setSkipAtEnd=function(t){this.skipAtEnd=t},r.prototype.getCurrentChar=function(){return this.msg.charCodeAt(this.pos)},r.prototype.getCurrent=function(){return this.msg.charCodeAt(this.pos)},r.prototype.getCodewords=function(){return this.codewords},r.prototype.writeCodewords=function(t){this.codewords.append(t)},r.prototype.writeCodeword=function(t){this.codewords.append(t)},r.prototype.getCodewordCount=function(){return this.codewords.length()},r.prototype.getNewEncoding=function(){return this.newEncoding},r.prototype.signalEncoderChange=function(t){this.newEncoding=t},r.prototype.resetEncoderSignal=function(){this.newEncoding=-1},r.prototype.hasMoreCharacters=function(){return this.pos<this.getTotalMessageCharCount()},r.prototype.getTotalMessageCharCount=function(){return this.msg.length-this.skipAtEnd},r.prototype.getRemainingCharacters=function(){return this.getTotalMessageCharCount()-this.pos},r.prototype.getSymbolInfo=function(){return this.symbolInfo},r.prototype.updateSymbolInfo=function(t){t===void 0&&(t=this.getCodewordCount()),(this.symbolInfo==null||t>this.symbolInfo.getDataCapacity())&&(this.symbolInfo=H.lookup(t,this.shape,this.minSize,this.maxSize,!0))},r.prototype.resetSymbolInfo=function(){this.symbolInfo=null},r}(),Yi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Zi=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return Yi(t,r),t.prototype.getEncodingMode=function(){return 3},t.prototype.encode=function(e){for(var n=new B;e.hasMoreCharacters();){var o=e.getCurrentChar();if(e.pos++,this.encodeChar(o,n),n.length()%3==0&&(this.writeNextTriplet(e,n),L.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode())){e.signalEncoderChange(0);break}}this.handleEOD(e,n)},t.prototype.encodeChar=function(e,n){switch(e){case 13:n.append(0);break;case"*".charCodeAt(0):n.append(1);break;case">".charCodeAt(0):n.append(2);break;case" ".charCodeAt(0):n.append(3);break;default:e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)?n.append(e-48+4):e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)?n.append(e-65+14):L.illegalCharacter(F.getCharAt(e))}return 1},t.prototype.handleEOD=function(e,n){e.updateSymbolInfo();var o=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),i=n.length();e.pos-=i,(e.getRemainingCharacters()>1||o>1||e.getRemainingCharacters()!==o)&&e.writeCodeword(254),e.getNewEncoding()<0&&e.signalEncoderChange(0)},t}(Xe),Ki=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),qi=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return Ki(t,r),t.prototype.getEncodingMode=function(){return 2},t.prototype.encodeChar=function(e,n){if(e===" ".charCodeAt(0))return n.append(3),1;if(e>="0".charCodeAt(0)&&e<="9".charCodeAt(0))return n.append(e-48+4),1;if(e>="a".charCodeAt(0)&&e<="z".charCodeAt(0))return n.append(e-97+14),1;if(e<" ".charCodeAt(0))return n.append(0),n.append(e),2;if(e<="/".charCodeAt(0))return n.append(1),n.append(e-33),2;if(e<="@".charCodeAt(0))return n.append(1),n.append(e-58+15),2;if(e>="[".charCodeAt(0)&&e<="_".charCodeAt(0))return n.append(1),n.append(e-91+22),2;if(e==="`".charCodeAt(0))return n.append(2),n.append(0),2;if(e<="Z".charCodeAt(0))return n.append(2),n.append(e-65+1),2;if(e<=127)return n.append(2),n.append(e-123+27),2;n.append("1");var o=2;return o+=this.encodeChar(e-128,n)},t}(Xe),Qi=function(){function r(){}return r.randomize253State=function(t){var e=129+(149*t%253+1);return e<=254?e:e-254},r.encodeHighLevel=function(t,e,n,o,i){e===void 0&&(e=0),n===void 0&&(n=null),o===void 0&&(o=null),i===void 0&&(i=!1);var a=new Xe,s=[new Vi,a,new qi,new Zi,new Ui,new Hi],u=new ji(t);u.setSymbolShape(e),u.setSizeConstraints(n,o),t.startsWith(kr)&&t.endsWith(se)?(u.writeCodeword(236),u.setSkipAtEnd(2),u.pos+=7):t.startsWith(Vr)&&t.endsWith(se)&&(u.writeCodeword(237),u.setSkipAtEnd(2),u.pos+=7);var c=0;for(i&&(a.encodeMaximal(u),c=u.getNewEncoding(),u.resetEncoderSignal());u.hasMoreCharacters();)s[c].encode(u),u.getNewEncoding()>=0&&(c=u.getNewEncoding(),u.resetEncoderSignal());var f=u.getCodewordCount();u.updateSymbolInfo();var h=u.getSymbolInfo().getDataCapacity();f<h&&c!==0&&c!==5&&c!==4&&u.writeCodeword("\xFE");var l=u.getCodewords();for(l.length()<h&&l.append(129);l.length()<h;)l.append(this.randomize253State(l.length()+1));return u.getCodewords().toString()},r.lookAheadTest=function(t,e,n){var o=this.lookAheadTestIntern(t,e,n);if(n===3&&o===3){for(var i=Math.min(e+3,t.length),a=e;a<i;a++)if(!this.isNativeX12(t.charCodeAt(a)))return 0}else if(n===4&&o===4){for(i=Math.min(e+4,t.length),a=e;a<i;a++)if(!this.isNativeEDIFACT(t.charCodeAt(a)))return 0}return o},r.lookAheadTestIntern=function(t,e,n){if(e>=t.length)return n;var o;n===0?o=[0,1,1,1,1,1.25]:(o=[1,2,2,2,2,2.25])[n]=0;for(var i=0,a=new Uint8Array(6),s=[];;){if(e+i===t.length){$.fill(a,0),$.fill(s,0);var u=this.findMinimums(o,s,P.MAX_VALUE,a),c=this.getMinimumCount(a);if(s[0]===u)return 0;if(c===1){if(a[5]>0)return 5;if(a[4]>0)return 4;if(a[2]>0)return 2;if(a[3]>0)return 3}return 1}var f=t.charCodeAt(e+i);if(i++,this.isDigit(f)?o[0]+=.5:this.isExtendedASCII(f)?(o[0]=Math.ceil(o[0]),o[0]+=2):(o[0]=Math.ceil(o[0]),o[0]++),this.isNativeC40(f)?o[1]+=2/3:this.isExtendedASCII(f)?o[1]+=8/3:o[1]+=4/3,this.isNativeText(f)?o[2]+=2/3:this.isExtendedASCII(f)?o[2]+=8/3:o[2]+=4/3,this.isNativeX12(f)?o[3]+=2/3:this.isExtendedASCII(f)?o[3]+=13/3:o[3]+=10/3,this.isNativeEDIFACT(f)?o[4]+=3/4:this.isExtendedASCII(f)?o[4]+=4.25:o[4]+=3.25,this.isSpecialB256(f)?o[5]+=4:o[5]++,i>=4){if($.fill(a,0),$.fill(s,0),this.findMinimums(o,s,P.MAX_VALUE,a),s[0]<this.min(s[5],s[1],s[2],s[3],s[4]))return 0;if(s[5]<s[0]||s[5]+1<this.min(s[1],s[2],s[3],s[4]))return 5;if(s[4]+1<this.min(s[5],s[1],s[2],s[3],s[0]))return 4;if(s[2]+1<this.min(s[5],s[1],s[4],s[3],s[0]))return 2;if(s[3]+1<this.min(s[5],s[1],s[4],s[2],s[0]))return 3;if(s[1]+1<this.min(s[0],s[5],s[4],s[2])){if(s[1]<s[3])return 1;if(s[1]===s[3]){for(var h=e+i+1;h<t.length;){var l=t.charCodeAt(h);if(this.isX12TermSep(l))return 3;if(!this.isNativeX12(l))break;h++}return 1}}}}},r.min=function(t,e,n,o,i){var a=Math.min(t,Math.min(e,Math.min(n,o)));return i===void 0?a:Math.min(a,i)},r.findMinimums=function(t,e,n,o){for(var i=0;i<6;i++){var a=e[i]=Math.ceil(t[i]);n>a&&(n=a,$.fill(o,0)),n===a&&(o[i]=o[i]+1)}return n},r.getMinimumCount=function(t){for(var e=0,n=0;n<6;n++)e+=t[n];return e||0},r.isDigit=function(t){return t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)},r.isExtendedASCII=function(t){return t>=128&&t<=255},r.isNativeC40=function(t){return t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)},r.isNativeText=function(t){return t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="a".charCodeAt(0)&&t<="z".charCodeAt(0)},r.isNativeX12=function(t){return this.isX12TermSep(t)||t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)},r.isX12TermSep=function(t){return t===13||t==="*".charCodeAt(0)||t===">".charCodeAt(0)},r.isNativeEDIFACT=function(t){return t>=" ".charCodeAt(0)&&t<="^".charCodeAt(0)},r.isSpecialB256=function(t){return!1},r.determineConsecutiveDigitCount=function(t,e){e===void 0&&(e=0);for(var n=t.length,o=e;o<n&&this.isDigit(t.charCodeAt(o));)o++;return o-e},r.illegalCharacter=function(t){var e=P.toHexString(t.charCodeAt(0));throw e="0000".substring(0,4-e.length)+e,new Error("Illegal character: "+t+" (0x"+e+")")},r}(),L=Qi,we=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_r=function(){function r(t){this.charset=t,this.name=t.name}return r.prototype.canEncode=function(t){try{return At.encode(t,this.charset)!=null}catch{return!1}},r}(),Ji=function(){function r(t,e,n){var o,i,a,s,u,c;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map(function(M){return new _r(Ue.forName(M))}),this.encoders=[];var f=[];f.push(new _r(xr.ISO_8859_1));for(var h=e!=null&&e.name.startsWith("UTF"),l=0;l<t.length;l++){var d=!1;try{for(var p=(o=void 0,we(f)),y=p.next();!y.done;y=p.next()){var C=y.value,w=t.charAt(l);if(w.charCodeAt(0)===n||C.canEncode(w)){d=!0;break}}}catch(M){o={error:M}}finally{try{y&&!y.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}if(!d)try{for(var v=(a=void 0,we(this.ENCODERS)),_=v.next();!_.done;_=v.next())if((C=_.value).canEncode(t.charAt(l))){f.push(C),d=!0;break}}catch(M){a={error:M}}finally{try{_&&!_.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}d||(h=!0)}if(f.length!==1||h){this.encoders=[];var m=0;try{for(var I=we(f),S=I.next();!S.done;S=I.next())C=S.value,this.encoders[m++]=C}catch(M){u={error:M}}finally{try{S&&!S.done&&(c=I.return)&&c.call(I)}finally{if(u)throw u.error}}}else this.encoders=[f[0]];var O=-1;if(e!=null){for(l=0;l<this.encoders.length;l++)if(this.encoders[l]!=null&&e.name===this.encoders[l].name){O=l;break}}this.priorityEncoderIndex=O}return r.prototype.length=function(){return this.encoders.length},r.prototype.getCharsetName=function(t){if(!(t<this.length()))throw new Error("index must be less than length");return this.encoders[t].name},r.prototype.getCharset=function(t){if(!(t<this.length()))throw new Error("index must be less than length");return this.encoders[t].charset},r.prototype.getECIValue=function(t){return this.encoders[t].charset.getValueIdentifier()},r.prototype.getPriorityEncoderIndex=function(){return this.priorityEncoderIndex},r.prototype.canEncode=function(t,e){if(!(e<this.length()))throw new Error("index must be less than length");return!0},r.prototype.encode=function(t,e){if(!(e<this.length()))throw new Error("index must be less than length");return At.encode(F.getCharAt(t),this.encoders[e].name)},r}(),$i=function(){function r(t,e,n){this.fnc1=n;var o=new Ji(t,e,n);if(o.length()===1)for(var i=0;i<this.bytes.length;i++){var a=t.charAt(i).charCodeAt(0);this.bytes[i]=a===n?1e3:a}else this.bytes=this.encodeMinimally(t,o,n)}return r.prototype.getFNC1Character=function(){return this.fnc1},r.prototype.length=function(){return this.bytes.length},r.prototype.haveNCharacters=function(t,e){if(t+e-1>=this.bytes.length)return!1;for(var n=0;n<e;n++)if(this.isECI(t+n))return!1;return!0},r.prototype.charAt=function(t){if(t<0||t>=this.length())throw new Error(""+t);if(this.isECI(t))throw new Error("value at "+t+" is not a character but an ECI");return this.isFNC1(t)?this.fnc1:this.bytes[t]},r.prototype.subSequence=function(t,e){if(t<0||t>e||e>this.length())throw new Error(""+t);for(var n=new B,o=t;o<e;o++){if(this.isECI(o))throw new Error("value at "+o+" is not a character but an ECI");n.append(this.charAt(o))}return n.toString()},r.prototype.isECI=function(t){if(t<0||t>=this.length())throw new Error(""+t);return this.bytes[t]>255&&this.bytes[t]<=999},r.prototype.isFNC1=function(t){if(t<0||t>=this.length())throw new Error(""+t);return this.bytes[t]===1e3},r.prototype.getECIValue=function(t){if(t<0||t>=this.length())throw new Error(""+t);if(!this.isECI(t))throw new Error("value at "+t+" is not an ECI but a character");return this.bytes[t]-256},r.prototype.addEdge=function(t,e,n){(t[e][n.encoderIndex]==null||t[e][n.encoderIndex].cachedTotalSize>n.cachedTotalSize)&&(t[e][n.encoderIndex]=n)},r.prototype.addEdges=function(t,e,n,o,i,a){var s=t.charAt(o).charCodeAt(0),u=0,c=e.length();e.getPriorityEncoderIndex()>=0&&(s===a||e.canEncode(s,e.getPriorityEncoderIndex()))&&(c=(u=e.getPriorityEncoderIndex())+1);for(var f=u;f<c;f++)(s===a||e.canEncode(s,f))&&this.addEdge(n,o+1,new mr(s,e,f,i,a))},r.prototype.encodeMinimally=function(t,e,n){var o=t.length,i=new mr[o+1][e.length()];this.addEdges(t,e,i,0,null,n);for(var a=1;a<=o;a++){for(var s=0;s<e.length();s++)i[a][s]!=null&&a<o&&this.addEdges(t,e,i,a,i[a][s],n);for(s=0;s<e.length();s++)i[a-1][s]=null}var u=-1,c=P.MAX_VALUE;for(s=0;s<e.length();s++)if(i[o][s]!=null){var f=i[o][s];f.cachedTotalSize<c&&(c=f.cachedTotalSize,u=s)}if(u<0)throw new Error('Failed to encode "'+t+'"');for(var h=[],l=i[o][u];l!=null;){if(l.isFNC1())h.unshift(1e3);else{var d=e.encode(l.c,l.encoderIndex);for(a=d.length-1;a>=0;a--)h.unshift(255&d[a])}(l.previous===null?0:l.previous.encoderIndex)!==l.encoderIndex&&h.unshift(256+e.getECIValue(l.encoderIndex)),l=l.previous}var p=[];for(a=0;a<p.length;a++)p[a]=h[a];return p},r}(),mr=function(){function r(t,e,n,o,i){this.c=t,this.encoderSet=e,this.encoderIndex=n,this.previous=o,this.fnc1=i,this.c=t===i?1e3:t;var a=this.isFNC1()?1:e.encode(t,n).length;(o===null?0:o.encoderIndex)!==n&&(a+=3),o!=null&&(a+=o.cachedTotalSize),this.cachedTotalSize=a}return r.prototype.isFNC1=function(){return this.c===1e3},r}(),ta=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Yt=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ea=function(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n,o,i=e.call(r),a=[];try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a},ra=function(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(ea(arguments[t]));return r};(function(r){r[r.ASCII=0]="ASCII",r[r.C40=1]="C40",r[r.TEXT=2]="TEXT",r[r.X12=3]="X12",r[r.EDF=4]="EDF",r[r.B256=5]="B256"})(b||(b={}));var na=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],pt=function(){function r(){}return r.isExtendedASCII=function(t,e){return t!==e&&t>=128&&t<=255},r.isInC40Shift1Set=function(t){return t<=31},r.isInC40Shift2Set=function(t,e){var n,o;try{for(var i=Yt(na),a=i.next();!a.done;a=i.next())if(a.value.charCodeAt(0)===t)return!0}catch(s){n={error:s}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return t===e},r.isInTextShift1Set=function(t){return this.isInC40Shift1Set(t)},r.isInTextShift2Set=function(t,e){return this.isInC40Shift2Set(t,e)},r.encodeHighLevel=function(t,e,n,o){e===void 0&&(e=null),n===void 0&&(n=-1),o===void 0&&(o=0);var i=0;return t.startsWith(kr)&&t.endsWith(se)?(i=5,t=t.substring(7,t.length-2)):t.startsWith(Vr)&&t.endsWith(se)&&(i=6,t=t.substring(7,t.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,ra(this.encode(t,e,n,o,i)))))},r.encode=function(t,e,n,o,i){return this.encodeMinimally(new ia(t,e,n,o,i)).getBytes()},r.addEdge=function(t,e){var n=e.fromPosition+e.characterLength;(t[n][e.getEndMode()]===null||t[n][e.getEndMode()].cachedTotalSize>e.cachedTotalSize)&&(t[n][e.getEndMode()]=e)},r.getNumberOfC40Words=function(t,e,n,o){for(var i=0,a=e;a<t.length();a++){if(t.isECI(a))return o[0]=0,0;var s=t.charAt(a);if(n&&L.isNativeC40(s)||!n&&L.isNativeText(s))i++;else if(r.isExtendedASCII(s,t.getFNC1Character())){var u=255&s;u>=128&&(n&&L.isNativeC40(u-128)||!n&&L.isNativeText(u-128))?i+=3:i+=4}else i+=2;if(i%3==0||(i-2)%3==0&&a+1===t.length())return o[0]=a-e+1,Math.ceil(i/3)}return o[0]=0,0},r.addEdges=function(t,e,n,o){var i,a;if(t.isECI(n))this.addEdge(e,new vt(t,b.ASCII,n,1,o));else{var s,u=t.charAt(n);if(o===null||o.getEndMode()!==b.EDF){L.isDigit(u)&&t.haveNCharacters(n,2)&&L.isDigit(t.charAt(n+1))?this.addEdge(e,new vt(t,b.ASCII,n,2,o)):this.addEdge(e,new vt(t,b.ASCII,n,1,o));var c=[b.C40,b.TEXT];try{for(var f=Yt(c),h=f.next();!h.done;h=f.next()){var l=h.value,d=[];r.getNumberOfC40Words(t,n,l===b.C40,d)>0&&this.addEdge(e,new vt(t,l,n,d[0],o))}}catch(y){i={error:y}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}t.haveNCharacters(n,3)&&L.isNativeX12(t.charAt(n))&&L.isNativeX12(t.charAt(n+1))&&L.isNativeX12(t.charAt(n+2))&&this.addEdge(e,new vt(t,b.X12,n,3,o)),this.addEdge(e,new vt(t,b.B256,n,1,o))}for(s=0;s<3;s++){var p=n+s;if(!t.haveNCharacters(p,1)||!L.isNativeEDIFACT(t.charAt(p)))break;this.addEdge(e,new vt(t,b.EDF,n,s+1,o))}s===3&&t.haveNCharacters(n,4)&&L.isNativeEDIFACT(t.charAt(n+3))&&this.addEdge(e,new vt(t,b.EDF,n,4,o))}},r.encodeMinimally=function(t){var e=t.length(),n=Array(e+1).fill(null).map(function(){return Array(6).fill(0)});this.addEdges(t,n,0,null);for(var o=1;o<=e;o++){for(var i=0;i<6;i++)n[o][i]!==null&&o<e&&this.addEdges(t,n,o,n[o][i]);for(i=0;i<6;i++)n[o-1][i]=null}var a=-1,s=P.MAX_VALUE;for(i=0;i<6;i++)if(n[e][i]!==null){var u=n[e][i],c=i>=1&&i<=3?u.cachedTotalSize+1:u.cachedTotalSize;c<s&&(s=c,a=i)}if(a<0)throw new Error('Failed to encode "'+t+'"');return new oa(n[e][a])},r}(),oa=function(){function r(t){var e=t.input,n=0,o=[],i=[],a=[];t.mode!==b.C40&&t.mode!==b.TEXT&&t.mode!==b.X12||t.getEndMode()===b.ASCII||(n+=this.prepend(vt.getBytes(254),o));for(var s=t;s!==null;)n+=this.prepend(s.getDataBytes(),o),s.previous!==null&&s.getPreviousStartMode()===s.getMode()||(s.getMode()===b.B256&&(n<=249?(o.unshift(n),n++):(o.unshift(n%250),o.unshift(n/250+249),n+=2),i.push(o.length),a.push(n)),this.prepend(s.getLatchBytes(),o),n=0),s=s.previous;e.getMacroId()===5?n+=this.prepend(vt.getBytes(236),o):e.getMacroId()===6&&(n+=this.prepend(vt.getBytes(237),o)),e.getFNC1Character()>0&&(n+=this.prepend(vt.getBytes(232),o));for(var u=0;u<i.length;u++)this.applyRandomPattern(o,o.length-i[u],a[u]);var c=t.getMinSymbolSize(o.length);for(o.length<c&&o.push(129);o.length<c;)o.push(this.randomize253State(o.length+1));for(this.bytes=new Uint8Array(o.length),u=0;u<this.bytes.length;u++)this.bytes[u]=o[u]}return r.prototype.prepend=function(t,e){for(var n=t.length-1;n>=0;n--)e.unshift(t[n]);return t.length},r.prototype.randomize253State=function(t){var e=129+(149*t%253+1);return e<=254?e:e-254},r.prototype.applyRandomPattern=function(t,e,n){for(var o=0;o<n;o++){var i=e+o,a=(255&t[i])+(149*(i+1)%255+1);t[i]=a<=255?a:a-256}},r.prototype.getBytes=function(){return this.bytes},r}(),vt=function(){function r(t,e,n,o,i){if(this.input=t,this.mode=e,this.fromPosition=n,this.characterLength=o,this.previous=i,this.allCodewordCapacities=[3,5,8,10,12,16,18,22,30,32,36,44,49,62,86,114,144,174,204,280,368,456,576,696,816,1050,1304,1558],this.squareCodewordCapacities=[3,5,8,12,18,22,30,36,44,62,86,114,144,174,204,280,368,456,576,696,816,1050,1304,1558],this.rectangularCodewordCapacities=[5,10,16,33,32,49],!(n+o<=t.length()))throw new Error("Invalid edge");var a=i!==null?i.cachedTotalSize:0,s=this.getPreviousMode();switch(e){case b.ASCII:a++,(t.isECI(n)||pt.isExtendedASCII(t.charAt(n),t.getFNC1Character()))&&a++,s!==b.C40&&s!==b.TEXT&&s!==b.X12||a++;break;case b.B256:a++,(s!==b.B256||this.getB256Size()===250)&&a++,s===b.ASCII?a++:s!==b.C40&&s!==b.TEXT&&s!==b.X12||(a+=2);break;case b.C40:case b.TEXT:case b.X12:e===b.X12?a+=2:a+=2*pt.getNumberOfC40Words(t,n,e===b.C40,[]),s===b.ASCII||s===b.B256?a++:s===e||s!==b.C40&&s!==b.TEXT&&s!==b.X12||(a+=2);break;case b.EDF:a+=3,s===b.ASCII||s===b.B256?a++:s!==b.C40&&s!==b.TEXT&&s!==b.X12||(a+=2)}this.cachedTotalSize=a}return r.prototype.getB256Size=function(){for(var t=0,e=this;e!==null&&e.mode===b.B256&&t<=250;)t++,e=e.previous;return t},r.prototype.getPreviousStartMode=function(){return this.previous===null?b.ASCII:this.previous.mode},r.prototype.getPreviousMode=function(){return this.previous===null?b.ASCII:this.previous.getEndMode()},r.prototype.getEndMode=function(){if(this.mode===b.EDF&&(this.characterLength<4||(t=this.getLastASCII())>0&&this.getCodewordsRemaining(this.cachedTotalSize+t)<=2-t))return b.ASCII;if(this.mode===b.C40||this.mode===b.TEXT||this.mode===b.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&this.getCodewordsRemaining(this.cachedTotalSize)===0)return b.ASCII;var t;if((t=this.getLastASCII())===1&&this.getCodewordsRemaining(this.cachedTotalSize+1)===0)return b.ASCII}return this.mode},r.prototype.getMode=function(){return this.mode},r.prototype.getLastASCII=function(){var t=this.input.length(),e=this.fromPosition+this.characterLength;return t-e>4||e>=t?0:t-e==1?pt.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?0:1:t-e==2?pt.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())||pt.isExtendedASCII(this.input.charAt(e+1),this.input.getFNC1Character())?0:L.isDigit(this.input.charAt(e))&&L.isDigit(this.input.charAt(e+1))?1:2:t-e==3?L.isDigit(this.input.charAt(e))&&L.isDigit(this.input.charAt(e+1))&&!pt.isExtendedASCII(this.input.charAt(e+2),this.input.getFNC1Character())||L.isDigit(this.input.charAt(e+1))&&L.isDigit(this.input.charAt(e+2))&&!pt.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?2:0:L.isDigit(this.input.charAt(e))&&L.isDigit(this.input.charAt(e+1))&&L.isDigit(this.input.charAt(e+2))&&L.isDigit(this.input.charAt(e+3))?2:0},r.prototype.getMinSymbolSize=function(t){var e,n,o,i,a,s;switch(this.input.getShapeHint()){case 1:try{for(var u=Yt(this.squareCodewordCapacities),c=u.next();!c.done;c=u.next())if((p=c.value)>=t)return p}catch(y){e={error:y}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}break;case 2:try{for(var f=Yt(this.rectangularCodewordCapacities),h=f.next();!h.done;h=f.next())if((p=h.value)>=t)return p}catch(y){o={error:y}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}try{for(var l=Yt(this.allCodewordCapacities),d=l.next();!d.done;d=l.next()){var p;if((p=d.value)>=t)return p}}catch(y){a={error:y}}finally{try{d&&!d.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}return this.allCodewordCapacities[this.allCodewordCapacities.length-1]},r.prototype.getCodewordsRemaining=function(t){return this.getMinSymbolSize(t)-t},r.getBytes=function(t,e){var n=new Uint8Array(e?2:1);return n[0]=t,e&&(n[1]=e),n},r.prototype.setC40Word=function(t,e,n,o,i){var a=1600*(255&n)+40*(255&o)+(255&i)+1;t[e]=a/256,t[e+1]=a%256},r.prototype.getX12Value=function(t){return t===13?0:t===42?1:t===62?2:t===32?3:t>=48&&t<=57?t-44:t>=65&&t<=90?t-51:t},r.prototype.getX12Words=function(){if(this.characterLength%3!=0)throw new Error("X12 words must be a multiple of 3");for(var t=new Uint8Array(this.characterLength/3*2),e=0;e<t.length;e+=2)this.setC40Word(t,e,this.getX12Value(this.input.charAt(this.fromPosition+e/2*3)),this.getX12Value(this.input.charAt(this.fromPosition+e/2*3+1)),this.getX12Value(this.input.charAt(this.fromPosition+e/2*3+2)));return t},r.prototype.getShiftValue=function(t,e,n){return e&&pt.isInC40Shift1Set(t)||!e&&pt.isInTextShift1Set(t)?0:e&&pt.isInC40Shift2Set(t,n)||!e&&pt.isInTextShift2Set(t,n)?1:2},r.prototype.getC40Value=function(t,e,n,o){if(n===o){if(e!==2)throw new Error("FNC1 cannot be used in C40 shift 2");return 27}return t?n<=31?n:n===32?3:n<=47?n-33:n<=57?n-44:n<=64?n-43:n<=90?n-51:n<=95?n-69:n<=127?n-96:n:n===0?0:e===0&&n<=3?n-1:e===1&&n<=31?n:n===32?3:n>=33&&n<=47?n-33:n>=48&&n<=57?n-44:n>=58&&n<=64?n-43:n>=65&&n<=90?n-64:n>=91&&n<=95?n-69:n===96?0:n>=97&&n<=122?n-83:n>=123&&n<=127?n-96:n},r.prototype.getC40Words=function(t,e){for(var n=[],o=0;o<this.characterLength;o++){var i=this.input.charAt(this.fromPosition+o);if(t&&L.isNativeC40(i)||!t&&L.isNativeText(i))n.push(this.getC40Value(t,0,i,e));else if(pt.isExtendedASCII(i,e)){var a=(255&i)-128;t&&L.isNativeC40(a)||!t&&L.isNativeText(a)?(n.push(1),n.push(30),n.push(this.getC40Value(t,0,a,e))):(n.push(1),n.push(30),s=this.getShiftValue(a,t,e),n.push(s),n.push(this.getC40Value(t,s,a,e)))}else{var s=this.getShiftValue(i,t,e);n.push(s),n.push(this.getC40Value(t,s,i,e))}}if(n.length%3!=0){if((n.length-2)%3!=0||this.fromPosition+this.characterLength!==this.input.length())throw new Error("C40 words must be a multiple of 3");n.push(0)}var u=new Uint8Array(n.length/3*2),c=0;for(o=0;o<n.length;o+=3)this.setC40Word(u,c,255&n[o],255&n[o+1],255&n[o+2]),c+=2;return u},r.prototype.getEDFBytes=function(){for(var t=Math.ceil(this.characterLength/4),e=new Uint8Array(3*t),n=this.fromPosition,o=Math.min(this.fromPosition+this.characterLength-1,this.input.length()-1),i=0;i<t;i+=3){for(var a=[],s=0;s<4;s++)a[s]=n<=o?63&this.input.charAt(n++):n===o+1?31:0;var u=a[0]<<18;u|=a[1]<<12,u|=a[2]<<6,u|=a[3],e[i]=u>>16&255,e[i+1]=u>>8&255,e[i+2]=255&u}return e},r.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case b.ASCII:case b.B256:switch(this.mode){case b.B256:return r.getBytes(231);case b.C40:return r.getBytes(230);case b.TEXT:return r.getBytes(239);case b.X12:return r.getBytes(238);case b.EDF:return r.getBytes(240)}break;case b.C40:case b.TEXT:case b.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case b.ASCII:return r.getBytes(254);case b.B256:return r.getBytes(254,231);case b.C40:return r.getBytes(254,230);case b.TEXT:return r.getBytes(254,239);case b.X12:return r.getBytes(254,238);case b.EDF:return r.getBytes(254,240)}break;case b.EDF:if(this.mode!==b.EDF)throw new Error("Cannot switch from EDF to "+this.mode)}return new Uint8Array(0)},r.prototype.getDataBytes=function(){switch(this.mode){case b.ASCII:return this.input.isECI(this.fromPosition)?r.getBytes(241,this.input.getECIValue(this.fromPosition)+1):pt.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?r.getBytes(235,this.input.charAt(this.fromPosition)-127):this.characterLength===2?r.getBytes(10*this.input.charAt(this.fromPosition)+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?r.getBytes(232):r.getBytes(this.input.charAt(this.fromPosition)+1);case b.B256:return r.getBytes(this.input.charAt(this.fromPosition));case b.C40:return this.getC40Words(!0,this.input.getFNC1Character());case b.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case b.X12:return this.getX12Words();case b.EDF:return this.getEDFBytes()}},r}(),ia=function(r){function t(e,n,o,i,a){var s=r.call(this,e,n,o)||this;return s.shape=i,s.macroId=a,s}return ta(t,r),t.prototype.getMacroId=function(){return this.macroId},t.prototype.getShapeHint=function(){return this.shape},t}($i),Na=function(){function r(){}return r.prototype.encode=function(t,e,n,o,i){if(i===void 0&&(i=null),t.trim()==="")throw new Error("Found empty contents");if(e!==D.DATA_MATRIX)throw new Error("Can only encode DATA_MATRIX, but got "+e);if(n<0||o<0)throw new Error("Requested dimensions can't be negative: "+n+"x"+o);var a,s=0,u=null,c=null;if(i!=null){var f=i.get(j.DATA_MATRIX_SHAPE);f!=null&&(s=f);var h=i.get(j.MIN_SIZE);h!=null&&(u=h);var l=i.get(j.MAX_SIZE);l!=null&&(c=l)}if(i!=null&&i.has(j.DATA_MATRIX_COMPACT)&&i.get(j.DATA_MATRIX_COMPACT).toString()){var d=i.has(j.GS1_FORMAT)&&!!i.get(j.GS1_FORMAT).toString(),p=null;i.has(j.CHARACTER_SET)&&(p=Ue.forName(i.get(j.CHARACTER_SET).toString())),a=pt.encodeHighLevel(t,p,d?29:-1,s)}else{var y=i!=null&&i.has(j.FORCE_C40)&&!!i.get(j.FORCE_C40).toString();a=L.encodeHighLevel(t,s,u,c,y)}var C=H.lookup(a.length,s,u,c,!0),w=ki.encodeECC200(a,C),v=new Fi(w,C.getSymbolDataWidth(),C.getSymbolDataHeight());return v.place(),this.encodeLowLevel(v,C,n,o)},r.prototype.encodeLowLevel=function(t,e,n,o){for(var i=e.getSymbolDataWidth(),a=e.getSymbolDataHeight(),s=new Lr(e.getSymbolWidth(),e.getSymbolHeight()),u=0,c=0;c<a;c++){var f=void 0;if(c%e.matrixHeight==0){f=0;for(var h=0;h<e.getSymbolWidth();h++)s.setBoolean(f,u,h%2==0),f++;u++}for(f=0,h=0;h<i;h++)h%e.matrixWidth==0&&(s.setBoolean(f,u,!0),f++),s.setBoolean(f,u,t.getBit(h,c)),f++,h%e.matrixWidth==e.matrixWidth-1&&(s.setBoolean(f,u,c%2==0),f++);if(u++,c%e.matrixHeight==e.matrixHeight-1){for(f=0,h=0;h<e.getSymbolWidth();h++)s.setBoolean(f,u,!0),f++;u++}}return this.convertByteMatrixToBitMatrix(s,n,o)},r.prototype.convertByteMatrixToBitMatrix=function(t,e,n){var o,i=t.getWidth(),a=t.getHeight(),s=Math.max(e,i),u=Math.max(n,a),c=Math.min(s/i,u/a),f=(s-i*c)/2,h=(u-a*c)/2;n<a||e<i?(f=0,h=0,o=new yt(i,a)):o=new yt(e,n),o.clear();for(var l=0,d=h;l<a;l++,d+=c)for(var p=0,y=f;p<i;p++,y+=c)t.get(p,l)===1&&o.setRegion(y,d,c,c);return o},r}(),aa=function(){function r(){}return r.prototype.isCompact=function(){return this.compact},r.prototype.setCompact=function(t){this.compact=t},r.prototype.getSize=function(){return this.size},r.prototype.setSize=function(t){this.size=t},r.prototype.getLayers=function(){return this.layers},r.prototype.setLayers=function(t){this.layers=t},r.prototype.getCodeWords=function(){return this.codeWords},r.prototype.setCodeWords=function(t){this.codeWords=t},r.prototype.getMatrix=function(){return this.matrix},r.prototype.setMatrix=function(t){this.matrix=t},r}(),Er=function(){function r(){}return r.singletonList=function(t){return[t]},r.min=function(t,e){return t.sort(e)[0]},r}(),sa=function(){function r(t){this.previous=t}return r.prototype.getPrevious=function(){return this.previous},r}(),ua=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ge=function(r){function t(e,n,o){var i=r.call(this,e)||this;return i.value=n,i.bitCount=o,i}return ua(t,r),t.prototype.appendTo=function(e,n){e.appendBits(this.value,this.bitCount)},t.prototype.add=function(e,n){return new t(this,e,n)},t.prototype.addBinaryShift=function(e,n){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new t(this,e,n)},t.prototype.toString=function(){var e=this.value&(1<<this.bitCount)-1;return e|=1<<this.bitCount,"<"+P.toBinaryString(e|1<<this.bitCount).substring(1)+">"},t}(sa),ca=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),fa=function(r){function t(e,n,o){var i=r.call(this,e,0,0)||this;return i.binaryShiftStart=n,i.binaryShiftByteCount=o,i}return ca(t,r),t.prototype.appendTo=function(e,n){for(var o=0;o<this.binaryShiftByteCount;o++)(o===0||o===31&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?e.appendBits(this.binaryShiftByteCount-31,16):o===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(n[this.binaryShiftStart+o],8)},t.prototype.addBinaryShift=function(e,n){return new t(this,e,n)},t.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},t}(Ge);function Xt(r,t,e){return new Ge(r,t,e)}var ha=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],la=new Ge(null,0,0),Ce=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])],da=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Hr=function(r){var t,e;try{for(var n=da(r),o=n.next();!o.done;o=n.next()){var i=o.value;$.fill(i,-1)}}catch(a){t={error:a}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r[0][4]=0,r[1][4]=0,r[1][0]=28,r[3][4]=0,r[2][4]=0,r[2][0]=15,r}($.createInt32Array(6,6)),pa=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ga=function(){function r(t,e,n,o){this.token=t,this.mode=e,this.binaryShiftByteCount=n,this.bitCount=o}return r.prototype.getMode=function(){return this.mode},r.prototype.getToken=function(){return this.token},r.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},r.prototype.getBitCount=function(){return this.bitCount},r.prototype.latchAndAppend=function(t,e){var n=this.bitCount,o=this.token;if(t!==this.mode){var i=Ce[this.mode][t];o=Xt(o,65535&i,i>>16),n+=i>>16}var a=t===2?4:5;return new r(o=Xt(o,e,a),t,0,n+a)},r.prototype.shiftAndAppend=function(t,e){var n=this.token,o=this.mode===2?4:5;return n=Xt(n,Hr[this.mode][t],o),new r(n=Xt(n,e,5),this.mode,0,this.bitCount+o+5)},r.prototype.addBinaryShiftChar=function(t){var e=this.token,n=this.mode,o=this.bitCount;if(this.mode===4||this.mode===2){var i=Ce[n][0];e=Xt(e,65535&i,i>>16),o+=i>>16,n=0}var a=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,s=new r(e,n,this.binaryShiftByteCount+1,o+a);return s.binaryShiftByteCount===2078&&(s=s.endBinaryShift(t+1)),s},r.prototype.endBinaryShift=function(t){if(this.binaryShiftByteCount===0)return this;var e=this.token;return new r(e=function(n,o,i){return new fa(n,o,i)}(e,t-this.binaryShiftByteCount,this.binaryShiftByteCount),this.mode,0,this.bitCount)},r.prototype.isBetterThanOrEqualTo=function(t){var e=this.bitCount+(Ce[this.mode][t.mode]>>16);return this.binaryShiftByteCount<t.binaryShiftByteCount?e+=r.calculateBinaryShiftCost(t)-r.calculateBinaryShiftCost(this):this.binaryShiftByteCount>t.binaryShiftByteCount&&t.binaryShiftByteCount>0&&(e+=10),e<=t.bitCount},r.prototype.toBitArray=function(t){for(var e,n,o=[],i=this.endBinaryShift(t.length).token;i!==null;i=i.getPrevious())o.unshift(i);var a=new st;try{for(var s=pa(o),u=s.next();!u.done;u=s.next())u.value.appendTo(a,t)}catch(c){e={error:c}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return a},r.prototype.toString=function(){return F.format("%s bits=%d bytes=%d",ha[this.mode],this.bitCount,this.binaryShiftByteCount)},r.calculateBinaryShiftCost=function(t){return t.binaryShiftByteCount>62?21:t.binaryShiftByteCount>31?20:t.binaryShiftByteCount>0?10:0},r.INITIAL_STATE=new r(la,0,0,0),r}(),ve=function(r){var t=F.getCharCode(" "),e=F.getCharCode("."),n=F.getCharCode(",");r[0][t]=1;for(var o=F.getCharCode("Z"),i=F.getCharCode("A"),a=i;a<=o;a++)r[0][a]=a-i+2;r[1][t]=1;var s=F.getCharCode("z"),u=F.getCharCode("a");for(a=u;a<=s;a++)r[1][a]=a-u+2;r[2][t]=1;var c=F.getCharCode("9"),f=F.getCharCode("0");for(a=f;a<=c;a++)r[2][a]=a-f+2;r[2][n]=12,r[2][e]=13;for(var h=["\0"," ","","","","","","","\x07","\b"," ",`
|
||
`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~","\x7F"],l=0;l<h.length;l++)r[3][F.getCharCode(h[l])]=l;var d=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(l=0;l<d.length;l++)F.getCharCode(d[l])>0&&(r[4][F.getCharCode(d[l])]=l);return r}($.createInt32Array(5,256)),re=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ya=function(){function r(t){this.text=t}return r.prototype.encode=function(){for(var t=F.getCharCode(" "),e=F.getCharCode(`
|
||
`),n=Er.singletonList(ga.INITIAL_STATE),o=0;o<this.text.length;o++){var i=void 0,a=o+1<this.text.length?this.text[o+1]:0;switch(this.text[o]){case F.getCharCode("\r"):i=a===e?2:0;break;case F.getCharCode("."):i=a===t?3:0;break;case F.getCharCode(","):i=a===t?4:0;break;case F.getCharCode(":"):i=a===t?5:0;break;default:i=0}i>0?(n=r.updateStateListForPair(n,o,i),o++):n=this.updateStateListForChar(n,o)}return Er.min(n,function(s,u){return s.getBitCount()-u.getBitCount()}).toBitArray(this.text)},r.prototype.updateStateListForChar=function(t,e){var n,o,i=[];try{for(var a=re(t),s=a.next();!s.done;s=a.next()){var u=s.value;this.updateStateForChar(u,e,i)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return r.simplifyStates(i)},r.prototype.updateStateForChar=function(t,e,n){for(var o=255&this.text[e],i=ve[t.getMode()][o]>0,a=null,s=0;s<=4;s++){var u=ve[s][o];if(u>0){if(a==null&&(a=t.endBinaryShift(e)),!i||s===t.getMode()||s===2){var c=a.latchAndAppend(s,u);n.push(c)}if(!i&&Hr[t.getMode()][s]>=0){var f=a.shiftAndAppend(s,u);n.push(f)}}}if(t.getBinaryShiftByteCount()>0||ve[t.getMode()][o]===0){var h=t.addBinaryShiftChar(e);n.push(h)}},r.updateStateListForPair=function(t,e,n){var o,i,a=[];try{for(var s=re(t),u=s.next();!u.done;u=s.next()){var c=u.value;this.updateStateForPair(c,e,n,a)}}catch(f){o={error:f}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return this.simplifyStates(a)},r.updateStateForPair=function(t,e,n,o){var i=t.endBinaryShift(e);if(o.push(i.latchAndAppend(4,n)),t.getMode()!==4&&o.push(i.shiftAndAppend(4,n)),n===3||n===4){var a=i.latchAndAppend(2,16-n).latchAndAppend(2,1);o.push(a)}if(t.getBinaryShiftByteCount()>0){var s=t.addBinaryShiftChar(e).addBinaryShiftChar(e+1);o.push(s)}},r.simplifyStates=function(t){var e,n,o,i,a=[];try{for(var s=re(t),u=s.next();!u.done;u=s.next()){var c=u.value,f=!0,h=function(p){if(p.isBetterThanOrEqualTo(c))return f=!1,"break";c.isBetterThanOrEqualTo(p)&&(a=a.filter(function(y){return y!==p}))};try{for(var l=(o=void 0,re(a)),d=l.next();!d.done&&h(d.value)!=="break";d=l.next());}catch(p){o={error:p}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}f&&a.push(c)}}catch(p){e={error:p}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return a},r}(),wa=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ae=function(){function r(){}return r.encodeBytes=function(t){return r.encode(t,r.DEFAULT_EC_PERCENT,r.DEFAULT_AZTEC_LAYERS)},r.encode=function(t,e,n){var o,i,a,s,u,c=new ya(t).encode(),f=P.truncDivision(c.getSize()*e,100)+11,h=c.getSize()+f;if(n!==r.DEFAULT_AZTEC_LAYERS){if(o=n<0,(i=Math.abs(n))>(o?r.MAX_NB_BITS_COMPACT:r.MAX_NB_BITS))throw new N(F.format("Illegal value %s for layers",n));var l=(a=r.totalBitsInLayer(i,o))-a%(s=r.WORD_SIZE[i]);if((u=r.stuffBits(c,s)).getSize()+f>l)throw new N("Data to large for user specified layer");if(o&&u.getSize()>64*s)throw new N("Data to large for user specified layer")}else{s=0,u=null;for(var d=0;;d++){if(d>r.MAX_NB_BITS)throw new N("Data too large for an Aztec code");if(i=(o=d<=3)?d+1:d,!(h>(a=r.totalBitsInLayer(i,o)))&&(u!=null&&s===r.WORD_SIZE[i]||(s=r.WORD_SIZE[i],u=r.stuffBits(c,s)),l=a-a%s,!(o&&u.getSize()>64*s)&&u.getSize()+f<=l))break}}var p,y=r.generateCheckWords(u,a,s),C=u.getSize()/s,w=r.generateModeMessage(o,i,C),v=(o?11:14)+4*i,_=new Int32Array(v);if(o)for(p=v,d=0;d<_.length;d++)_[d]=d;else{p=v+1+2*P.truncDivision(P.truncDivision(v,2)-1,15);var m=P.truncDivision(v,2),I=P.truncDivision(p,2);for(d=0;d<m;d++){var S=d+P.truncDivision(d,15);_[m-d-1]=I-S-1,_[m+d]=I+S+1}}for(var O=new yt(p),M=(d=0,0);d<i;d++){for(var k=4*(i-d)+(o?9:12),x=0;x<k;x++)for(var J=2*x,W=0;W<2;W++)y.get(M+J+W)&&O.set(_[2*d+W],_[2*d+x]),y.get(M+2*k+J+W)&&O.set(_[2*d+x],_[v-1-2*d-W]),y.get(M+4*k+J+W)&&O.set(_[v-1-2*d-W],_[v-1-2*d-x]),y.get(M+6*k+J+W)&&O.set(_[v-1-2*d-x],_[2*d+W]);M+=8*k}if(r.drawModeMessage(O,o,p,w),o)r.drawBullsEye(O,P.truncDivision(p,2),5);else for(r.drawBullsEye(O,P.truncDivision(p,2),7),d=0,x=0;d<P.truncDivision(v,2)-1;d+=15,x+=16)for(W=1&P.truncDivision(p,2);W<p;W+=2)O.set(P.truncDivision(p,2)-x,W),O.set(P.truncDivision(p,2)+x,W),O.set(W,P.truncDivision(p,2)-x),O.set(W,P.truncDivision(p,2)+x);var tt=new aa;return tt.setCompact(o),tt.setSize(p),tt.setLayers(i),tt.setCodeWords(C),tt.setMatrix(O),tt},r.drawBullsEye=function(t,e,n){for(var o=0;o<n;o+=2)for(var i=e-o;i<=e+o;i++)t.set(i,e-o),t.set(i,e+o),t.set(e-o,i),t.set(e+o,i);t.set(e-n,e-n),t.set(e-n+1,e-n),t.set(e-n,e-n+1),t.set(e+n,e-n),t.set(e+n,e-n+1),t.set(e+n,e+n-1)},r.generateModeMessage=function(t,e,n){var o=new st;return t?(o.appendBits(e-1,2),o.appendBits(n-1,6),o=r.generateCheckWords(o,28,4)):(o.appendBits(e-1,5),o.appendBits(n-1,11),o=r.generateCheckWords(o,40,4)),o},r.drawModeMessage=function(t,e,n,o){var i=P.truncDivision(n,2);if(e)for(var a=0;a<7;a++){var s=i-3+a;o.get(a)&&t.set(s,i-5),o.get(a+7)&&t.set(i+5,s),o.get(20-a)&&t.set(s,i+5),o.get(27-a)&&t.set(i-5,s)}else for(a=0;a<10;a++)s=i-5+a+P.truncDivision(a,5),o.get(a)&&t.set(s,i-7),o.get(a+10)&&t.set(i+7,s),o.get(29-a)&&t.set(s,i+7),o.get(39-a)&&t.set(i-7,s)},r.generateCheckWords=function(t,e,n){var o,i,a=t.getSize()/n,s=new Br(r.getGF(n)),u=P.truncDivision(e,n),c=r.bitsToWords(t,n,u);s.encode(c,u-a);var f=e%n,h=new st;h.appendBits(0,f);try{for(var l=wa(Array.from(c)),d=l.next();!d.done;d=l.next()){var p=d.value;h.appendBits(p,n)}}catch(y){o={error:y}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}return h},r.bitsToWords=function(t,e,n){var o,i,a=new Int32Array(n);for(o=0,i=t.getSize()/e;o<i;o++){for(var s=0,u=0;u<e;u++)s|=t.get(o*e+u)?1<<e-u-1:0;a[o]=s}return a},r.getGF=function(t){switch(t){case 4:return gt.AZTEC_PARAM;case 6:return gt.AZTEC_DATA_6;case 8:return gt.AZTEC_DATA_8;case 10:return gt.AZTEC_DATA_10;case 12:return gt.AZTEC_DATA_12;default:throw new N("Unsupported word size "+t)}},r.stuffBits=function(t,e){for(var n=new st,o=t.getSize(),i=(1<<e)-2,a=0;a<o;a+=e){for(var s=0,u=0;u<e;u++)(a+u>=o||t.get(a+u))&&(s|=1<<e-1-u);(s&i)===i?(n.appendBits(s&i,e),a--):s&i?n.appendBits(s,e):(n.appendBits(1|s,e),a--)}return n},r.totalBitsInLayer=function(t,e){return((e?88:112)+16*t)*t},r.DEFAULT_EC_PERCENT=33,r.DEFAULT_AZTEC_LAYERS=0,r.MAX_NB_BITS=32,r.MAX_NB_BITS_COMPACT=4,r.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]),r}(),Da=function(){function r(){}return r.prototype.encode=function(t,e,n,o){return this.encodeWithHints(t,e,n,o,null)},r.prototype.encodeWithHints=function(t,e,n,o,i){var a=xr.ISO_8859_1,s=Ae.DEFAULT_EC_PERCENT,u=Ae.DEFAULT_AZTEC_LAYERS;return i!=null&&(i.has(j.CHARACTER_SET)&&(a=Ue.forName(i.get(j.CHARACTER_SET).toString())),i.has(j.ERROR_CORRECTION)&&(s=P.parseInt(i.get(j.ERROR_CORRECTION).toString())),i.has(j.AZTEC_LAYERS)&&(u=P.parseInt(i.get(j.AZTEC_LAYERS).toString()))),r.encodeLayers(t,e,n,o,a,s,u)},r.encodeLayers=function(t,e,n,o,i,a,s){if(e!==D.AZTEC)throw new N("Can only encode AZTEC, but got "+e);var u=Ae.encode(F.getBytes(t,i),a,s);return r.renderResult(u,n,o)},r.renderResult=function(t,e,n){var o=t.getMatrix();if(o==null)throw new Nt;for(var i=o.getWidth(),a=o.getHeight(),s=Math.max(e,i),u=Math.max(n,a),c=Math.min(s/i,u/a),f=(s-i*c)/2,h=(u-a*c)/2,l=new yt(s,u),d=0,p=h;d<a;d++,p+=c)for(var y=0,C=f;y<i;y++,C+=c)o.get(y,d)&&l.setRegion(C,p,c,c);return l},r}();var Ma=null;export{Or as AbstractExpandedDecoder,mt as ArgumentException,Ir as ArithmeticException,aa as AztecCode,Te as AztecCodeReader,Da as AztecCodeWriter,je as AztecDecoder,mn as AztecDetector,vn as AztecDetectorResult,Ae as AztecEncoder,ya as AztecHighLevelEncoder,dt as AztecPoint,D as BarcodeFormat,qr as Binarizer,Zr as BinaryBitmap,st as BitArray,yt as BitMatrix,Rr as BitSource,Aa as BrowserAztecCodeReader,_a as BrowserBarcodeReader,Vt as BrowserCodeReader,ma as BrowserDatamatrixCodeReader,Ea as BrowserMultiFormatReader,Ia as BrowserPDF417Reader,Sa as BrowserQRCodeReader,Ta as BrowserQRCodeSvgWriter,nt as CharacterSetECI,at as ChecksumException,Gn as CodaBarReader,Ze as Code128Reader,Ke as Code39Reader,qe as Code93Reader,Oo as DataMatrixDecodedBitStreamParser,Fi as DataMatrixDefaultPlacement,ki as DataMatrixErrorCorrection,L as DataMatrixHighLevelEncoder,be as DataMatrixReader,H as DataMatrixSymbolInfo,yr as DataMatrixSymbolShapeHint,Na as DataMatrixWriter,Q as DecodeHintType,ce as DecoderResult,_n as DefaultGridSampler,xe as DetectorResult,Oe as EAN13Reader,j as EncodeHintType,wt as Exception,T as FormatException,gt as GenericGF,Rt as GenericGFPoly,an as GlobalHistogramBinarizer,Ye as GridSampler,ke as GridSamplerInstance,hn as HTMLCanvasElementLuminanceSource,un as HybridBinarizer,Qe as ITFReader,N as IllegalArgumentException,Nt as IllegalStateException,Fe as InvertedLuminanceSource,ue as LuminanceSource,U as MathUtils,Wt as MultiFormatOneDReader,Si as MultiFormatReader,Oa as MultiFormatWriter,E as NotFoundException,ot as OneDReader,_i as PDF417DecodedBitStreamParser,ni as PDF417DecoderErrorCorrection,Me as PDF417Reader,di as PDF417ResultMetadata,Sr as PerspectiveTransform,ba as PlanarYUVLuminanceSource,Lr as QRCodeByteMatrix,ur as QRCodeDataMask,xo as QRCodeDecodedBitStreamParser,Zt as QRCodeDecoderErrorCorrectionLevel,Nr as QRCodeDecoderFormatInformation,Fr as QRCodeEncoder,Be as QRCodeEncoderQRCode,jt as QRCodeMaskUtil,wr as QRCodeMatrixUtil,q as QRCodeMode,Re as QRCodeReader,Lt as QRCodeVersion,Mi as QRCodeWriter,Ra as RGBLuminanceSource,ir as RSS14Reader,Co as RSSExpandedReader,pr as ReaderException,fe as ReedSolomonDecoder,Br as ReedSolomonEncoder,Qt as ReedSolomonException,ft as Result,ct as ResultMetadataType,R as ResultPoint,F as StringUtils,ne as UnsupportedOperationException,ln as VideoInputDevice,Se as WhiteRectangleDetector,K as WriterException,$ as ZXingArrays,Ue as ZXingCharset,P as ZXingInteger,xr as ZXingStandardCharsets,B as ZXingStringBuilder,At as ZXingStringEncoding,Z as ZXingSystem,go as createAbstractExpandedDecoder,Ma as default};
|