barcode-detector-api-polyfill 1.0.20 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- "use strict";(()=>{function qi(r,t){var e=Object.setPrototypeOf;e?e(r,t):r.__proto__=t}function Ji(r,t){t===void 0&&(t=r.constructor);var e=Error.captureStackTrace;e&&e(r,t)}var $i=(function(){var r=function(e,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a])},r(e,n)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),On=(function(r){$i(t,r);function t(e,n){var i=this.constructor,o=r.call(this,e,n)||this;return Object.defineProperty(o,"name",{value:i.name,enumerable:!1,configurable:!0}),qi(o,i.prototype),Ji(o),o}return t})(Error);var to=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),eo=(function(r){to(t,r);function t(e){e===void 0&&(e=void 0);var n=r.call(this,e)||this;return n.message=e,n}return t.prototype.getKind=function(){var e=this.constructor;return e.kind},t.kind="Exception",t})(On),$=eo;var ro=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),no=(function(r){ro(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArgumentException",t})($),st=no;var io=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),oo=(function(r){io(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IllegalArgumentException",t})($),O=oo;var ao=(function(){function r(t){if(this.binarizer=t,t===null)throw new O("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,i){var o=this.binarizer.getLuminanceSource().crop(t,e,n,i);return new r(this.binarizer.createBinarizer(o))},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})(),Le=ao;var fo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),so=(function(r){fo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t})($),j=so;var uo=(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})(),br=uo;var co=(function(){function r(){}return r.arraycopy=function(t,e,n,i,o){for(;o--;)n[i++]=t[e++]},r.currentTimeMillis=function(){return Date.now()},r})(),V=co;var ho=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),lo=(function(r){ho(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IndexOutOfBoundsException",t})($),ye=lo;var po=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),vo=(function(r){po(t,r);function t(e,n){e===void 0&&(e=void 0),n===void 0&&(n=void 0);var i=r.call(this,n)||this;return i.index=e,i.message=n,i}return t.kind="ArrayIndexOutOfBoundsException",t})(ye),Pr=vo;var xo=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.")},go=(function(){function r(){}return r.fill=function(t,e){for(var n=0,i=t.length;n<i;n++)t[n]=e},r.fillWithin=function(t,e,n,i){r.rangeCheck(t.length,e,n);for(var o=e;o<n;o++)t[o]=i},r.rangeCheck=function(t,e,n){if(e>n)throw new O("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new Pr(e);if(n>t)throw new Pr(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){var i=Array.from({length:t});return i.map(function(o){return Array.from({length:e}).fill(n)})},r.createInt32Array=function(t,e,n){var i=Array.from({length:t});return i.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,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0},r.hashCode=function(t){var e,n;if(t===null)return 0;var i=1;try{for(var o=xo(t),a=o.next();!a.done;a=o.next()){var f=a.value;i=31*i+f}}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i},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 i=n-e,o=new Int32Array(i);return V.arraycopy(t,e,o,0,i),o},r.binarySearch=function(t,e,n){n===void 0&&(n=r.numberComparator);for(var i=0,o=t.length-1;i<=o;){var a=o+i>>1,f=n(e,t[a]);if(f>0)i=a+1;else if(f<0)o=a-1;else return a}return-i-1},r.numberComparator=function(t,e){return t-e},r})(),Y=go;var mo=(function(){function r(){}return r.numberOfTrailingZeros=function(t){var e;if(t===0)return 32;var n=31;return e=t<<16,e!==0&&(n-=16,t=e),e=t<<8,e!==0&&(n-=8,t=e),e=t<<4,e!==0&&(n-=4,t=e),e=t<<2,e!==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,e},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-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),t=t+(t>>>4)&252645135,t=t+(t>>>8),t=t+(t>>>16),t&63},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})(),M=mo;var yo=(function(){function r(t,e){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,e==null?this.bits=r.makeArray(t):this.bits=e)}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>this.bits.length*32){var e=r.makeArray(t);V.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<<(t&31))!==0},r.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(t&31)},r.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(t&31)},r.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,i=Math.floor(t/32),o=n[i];o&=~((1<<(t&31))-1);for(var a=n.length;o===0;){if(++i===a)return e;o=n[i]}var f=i*32+M.numberOfTrailingZeros(o);return f>e?e:f},r.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,i=Math.floor(t/32),o=~n[i];o&=~((1<<(t&31))-1);for(var a=n.length;o===0;){if(++i===a)return e;o=~n[i]}var f=i*32+M.numberOfTrailingZeros(o);return f>e?e:f},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 O;if(e!==t){e--;for(var n=Math.floor(t/32),i=Math.floor(e/32),o=this.bits,a=n;a<=i;a++){var f=a>n?0:t&31,s=a<i?31:e&31,u=(2<<s)-(1<<f);o[a]|=u}}},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 O;if(e===t)return!0;e--;for(var i=Math.floor(t/32),o=Math.floor(e/32),a=this.bits,f=i;f<=o;f++){var s=f>i?0:t&31,u=f<o?31:e&31,c=(2<<u)-(1<<s)&4294967295;if((a[f]&c)!==(n?c:0))return!1}return!0},r.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},r.prototype.appendBits=function(t,e){if(e<0||e>32)throw new O("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 O("Sizes don't match");for(var e=this.bits,n=0,i=e.length;n<i;n++)e[n]^=t.bits[n]},r.prototype.toBytes=function(t,e,n,i){for(var o=0;o<i;o++){for(var a=0,f=0;f<8;f++)this.get(t)&&(a|=1<<7-f),t++;e[n+o]=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,i=this.bits,o=0;o<n;o++){var a=i[o];a=a>>1&1431655765|(a&1431655765)<<1,a=a>>2&858993459|(a&858993459)<<2,a=a>>4&252645135|(a&252645135)<<4,a=a>>8&16711935|(a&16711935)<<8,a=a>>16&65535|(a&65535)<<16,t[e-o]=a}if(this.size!==n*32){for(var f=n*32-this.size,s=t[0]>>>f,o=1;o<n;o++){var u=t[o];s|=u<<32-f,t[o-1]=s,s=u>>>f}t[n-1]=s}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&&Y.equals(this.bits,e.bits)},r.prototype.hashCode=function(){return 31*this.size+Y.hashCode(this.bits)},r.prototype.toString=function(){for(var t="",e=0,n=this.size;e<n;e++)(e&7)===0&&(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})(),it=yo;var Mr;(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"})(Mr||(Mr={}));var k=Mr;var wo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ao=(function(r){wo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getFormatInstance=function(){return new t},t.kind="FormatException",t})($),S=Ao;var Eo=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.")},tt;(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"})(tt||(tt={}));var _o=(function(){function r(t,e,n){for(var i,o,a=[],f=3;f<arguments.length;f++)a[f-3]=arguments[f];this.valueIdentifier=t,this.name=n,typeof e=="number"?this.values=Int32Array.from([e]):this.values=e,this.otherEncodingNames=a,r.VALUE_IDENTIFIER_TO_ECI.set(t,this),r.NAME_TO_ECI.set(n,this);for(var s=this.values,u=0,c=s.length;u!==c;u++){var h=s[u];r.VALUES_TO_ECI.set(h,this)}try{for(var l=Eo(a),d=l.next();!d.done;d=l.next()){var p=d.value;r.NAME_TO_ECI.set(p,this)}}catch(v){i={error:v}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.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 S("incorect value");var e=r.VALUES_TO_ECI.get(t);if(e===void 0)throw new S("incorect value");return e},r.getCharacterSetECIByName=function(t){var e=r.NAME_TO_ECI.get(t);if(e===void 0)throw new S("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(tt.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(tt.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(tt.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(tt.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(tt.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(tt.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(tt.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(tt.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(tt.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(tt.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(tt.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(tt.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(tt.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(tt.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(tt.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(tt.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(tt.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(tt.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(tt.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(tt.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(tt.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(tt.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(tt.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(tt.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(tt.Big5,28,"Big5"),r.GB18030=new r(tt.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(tt.EUC_KR,30,"EUC_KR","EUC-KR"),r})(),ot=_o;var Co=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Io=(function(r){Co(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="UnsupportedOperationException",t})($),ce=Io;var So=(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 ot?t:ot.getCharacterSetECIByName(t)},r.decodeFallback=function(t,e){var n=this.encodingCharacterSet(e);if(r.isDecodeFallbackSupported(n)){for(var i="",o=0,a=t.length;o<a;o++){var f=t[o].toString(16);f.length<2&&(f="0"+f),i+="%"+f}return decodeURIComponent(i)}if(n.equals(ot.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new ce("Encoding "+this.encodingName(e)+" not supported by fallback.")},r.isDecodeFallbackSupported=function(t){return t.equals(ot.UTF8)||t.equals(ot.ISO8859_1)||t.equals(ot.ASCII)},r.encodeFallback=function(t){for(var e=btoa(unescape(encodeURIComponent(t))),n=e.split(""),i=[],o=0;o<n.length;o++)i.push(n[o].charCodeAt(0));return new Uint8Array(i)},r})(),yt=So;var Oo=(function(){function r(){}return r.castAsNonUtf8Char=function(t,e){e===void 0&&(e=null);var n=e?e.getName():this.ISO88591;return yt.decode(new Uint8Array([t]),n)},r.guessEncoding=function(t,e){if(e!=null&&e.get(k.CHARACTER_SET)!==void 0)return e.get(k.CHARACTER_SET).toString();for(var n=t.length,i=!0,o=!0,a=!0,f=0,s=0,u=0,c=0,h=0,l=0,d=0,p=0,v=0,g=0,y=0,m=t.length>3&&t[0]===239&&t[1]===187&&t[2]===191,w=0;w<n&&(i||o||a);w++){var _=t[w]&255;a&&(f>0?(_&128)===0?a=!1:f--:(_&128)!==0&&((_&64)===0?a=!1:(f++,(_&32)===0?s++:(f++,(_&16)===0?u++:(f++,(_&8)===0?c++:a=!1))))),i&&(_>127&&_<160?i=!1:_>159&&(_<192||_===215||_===247)&&y++),o&&(h>0?_<64||_===127||_>252?o=!1:h--:_===128||_===160||_>239?o=!1:_>160&&_<224?(l++,p=0,d++,d>v&&(v=d)):_>127?(h++,d=0,p++,p>g&&(g=p)):(d=0,p=0))}return a&&f>0&&(a=!1),o&&h>0&&(o=!1),a&&(m||s+u+c>0)?r.UTF8:o&&(r.ASSUME_SHIFT_JIS||v>=3||g>=3)?r.SHIFT_JIS:i&&o?v===2&&l===2||y*10>=n?r.SHIFT_JIS:r.ISO88591:i?r.ISO88591:o?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 i=-1;function o(f,s,u,c,h,l){if(f==="%%")return"%";if(e[++i]!==void 0){f=c?parseInt(c.substr(1)):void 0;var d=h?parseInt(h.substr(1)):void 0,p;switch(l){case"s":p=e[i];break;case"c":p=e[i][0];break;case"f":p=parseFloat(e[i]).toFixed(f);break;case"p":p=parseFloat(e[i]).toPrecision(f);break;case"e":p=parseFloat(e[i]).toExponential(f);break;case"x":p=parseInt(e[i]).toString(d||16);break;case"d":p=parseFloat(parseInt(e[i],d||10).toPrecision(f)).toFixed(0);break}p=typeof p=="object"?JSON.stringify(p):(+p).toString(d);for(var v=parseInt(u),g=u&&u[0]+""=="0"?"0":" ";p.length<v;)p=s!==void 0?p+g:g+p;return p}}var a=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(a,o)},r.getBytes=function(t,e){return yt.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=ot.SJIS.getName(),r.GB2312="GB2312",r.ISO88591=ot.ISO8859_1.getName(),r.EUC_JP="EUC_JP",r.UTF8=ot.UTF8.getName(),r.PLATFORM_DEFAULT_ENCODING=r.UTF8,r.ASSUME_SHIFT_JIS=!1,r})(),F=Oo;var To=(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 i=e;e<e+n;i++)this.append(t[i]);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})(),P=To;var Do=(function(){function r(t,e,n,i){if(this.width=t,this.height=e,this.rowSize=n,this.bits=i,e==null&&(e=t),this.height=e,t<1||e<1)throw new O("Both dimensions must be greater than 0");n==null&&(n=Math.floor((t+31)/32)),this.rowSize=n,i==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return r.parseFromBooleanArray=function(t){for(var e=t.length,n=t[0].length,i=new r(n,e),o=0;o<e;o++)for(var a=t[o],f=0;f<n;f++)a[f]&&i.set(f,o);return i},r.parseFromString=function(t,e,n){if(t===null)throw new O("stringRepresentation cannot be null");for(var i=new Array(t.length),o=0,a=0,f=-1,s=0,u=0;u<t.length;)if(t.charAt(u)===`
2
- `||t.charAt(u)==="\r"){if(o>a){if(f===-1)f=o-a;else if(o-a!==f)throw new O("row lengths do not match");a=o,s++}u++}else if(t.substring(u,u+e.length)===e)u+=e.length,i[o]=!0,o++;else if(t.substring(u,u+n.length)===n)u+=n.length,i[o]=!1,o++;else throw new O("illegal character encountered: "+t.substring(u));if(o>a){if(f===-1)f=o-a;else if(o-a!==f)throw new O("row lengths do not match");s++}for(var c=new r(f,s),h=0;h<o;h++)i[h]&&c.set(Math.floor(h%f),Math.floor(h/f));return c},r.prototype.get=function(t,e){var n=e*this.rowSize+Math.floor(t/32);return(this.bits[n]>>>(t&31)&1)!==0},r.prototype.set=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]|=1<<(t&31)&4294967295},r.prototype.unset=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]&=~(1<<(t&31)&4294967295)},r.prototype.flip=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]^=1<<(t&31)&4294967295},r.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new O("input matrix dimensions do not match");for(var e=new it(Math.floor(this.width/32)+1),n=this.rowSize,i=this.bits,o=0,a=this.height;o<a;o++)for(var f=o*n,s=t.getRow(o,e).getBitArray(),u=0;u<n;u++)i[f+u]^=s[u]},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,i){if(e<0||t<0)throw new O("Left and top must be nonnegative");if(i<1||n<1)throw new O("Height and width must be at least 1");var o=t+n,a=e+i;if(a>this.height||o>this.width)throw new O("The region must fit inside the matrix");for(var f=this.rowSize,s=this.bits,u=e;u<a;u++)for(var c=u*f,h=t;h<o;h++)s[c+Math.floor(h/32)]|=1<<(h&31)&4294967295},r.prototype.getRow=function(t,e){e==null||e.getSize()<this.width?e=new it(this.width):e.clear();for(var n=this.rowSize,i=this.bits,o=t*n,a=0;a<n;a++)e.setBulk(a*32,i[o+a]);return e},r.prototype.setRow=function(t,e){V.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 it(t),i=new it(t),o=0,a=Math.floor((e+1)/2);o<a;o++)n=this.getRow(o,n),i=this.getRow(e-1-o,i),n.reverse(),i.reverse(),this.setRow(o,i),this.setRow(e-1-o,n)},r.prototype.getEnclosingRectangle=function(){for(var t=this.width,e=this.height,n=this.rowSize,i=this.bits,o=t,a=e,f=-1,s=-1,u=0;u<e;u++)for(var c=0;c<n;c++){var h=i[u*n+c];if(h!==0){if(u<a&&(a=u),u>s&&(s=u),c*32<o){for(var l=0;(h<<31-l&4294967295)===0;)l++;c*32+l<o&&(o=c*32+l)}if(c*32+31>f){for(var l=31;!(h>>>l);)l--;c*32+l>f&&(f=c*32+l)}}}return f<o||s<a?null:Int32Array.from([o,a,f-o+1,s-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 i=n/t,o=n%t*32,a=e[n],f=0;(a<<31-f&4294967295)===0;)f++;return o+=f,Int32Array.from([o,i])},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 i=Math.floor(n/t),o=Math.floor(n%t)*32,a=e[n],f=31;!(a>>>f);)f--;return o+=f,Int32Array.from([o,i])},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&&Y.equals(this.bits,e.bits)},r.prototype.hashCode=function(){var t=this.width;return t=31*t+this.width,t=31*t+this.height,t=31*t+this.rowSize,t=31*t+Y.hashCode(this.bits),t},r.prototype.toString=function(t,e,n){return t===void 0&&(t="X "),e===void 0&&(e=" "),n===void 0&&(n=`
3
- `),this.buildToString(t,e,n)},r.prototype.buildToString=function(t,e,n){for(var i=new P,o=0,a=this.height;o<a;o++){for(var f=0,s=this.width;f<s;f++)i.append(this.get(f,o)?t:e);i.append(n)}return i.toString()},r.prototype.clone=function(){return new r(this.width,this.height,this.rowSize,this.bits.slice())},r})(),at=Do;var Ro=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),No=(function(r){Ro(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getNotFoundInstance=function(){return new t},t.kind="NotFoundException",t})($),A=No;var bo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Po=(function(r){bo(t,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 t.prototype.getBlackRow=function(e,n){var i=this.getLuminanceSource(),o=i.getWidth();n==null||n.getSize()<o?n=new it(o):n.clear(),this.initArrays(o);for(var a=i.getRow(e,this.luminances),f=this.buckets,s=0;s<o;s++)f[(a[s]&255)>>t.LUMINANCE_SHIFT]++;var u=t.estimateBlackPoint(f);if(o<3)for(var s=0;s<o;s++)(a[s]&255)<u&&n.set(s);else for(var c=a[0]&255,h=a[1]&255,s=1;s<o-1;s++){var l=a[s+1]&255;(h*4-c-l)/2<u&&n.set(s),c=h,h=l}return n},t.prototype.getBlackMatrix=function(){var e=this.getLuminanceSource(),n=e.getWidth(),i=e.getHeight(),o=new at(n,i);this.initArrays(n);for(var a=this.buckets,f=1;f<5;f++)for(var s=Math.floor(i*f/5),u=e.getRow(s,this.luminances),c=Math.floor(n*4/5),h=Math.floor(n/5);h<c;h++){var l=u[h]&255;a[l>>t.LUMINANCE_SHIFT]++}for(var d=t.estimateBlackPoint(a),p=e.getMatrix(),f=0;f<i;f++)for(var v=f*n,h=0;h<n;h++){var l=p[v+h]&255;l<d&&o.set(h,f)}return o},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,i=0;i<t.LUMINANCE_BUCKETS;i++)n[i]=0},t.estimateBlackPoint=function(e){for(var n=e.length,i=0,o=0,a=0,f=0;f<n;f++)e[f]>a&&(o=f,a=e[f]),e[f]>i&&(i=e[f]);for(var s=0,u=0,f=0;f<n;f++){var c=f-o,h=e[f]*c*c;h>u&&(s=f,u=h)}if(o>s){var l=o;o=s,s=l}if(s-o<=n/16)throw new A;for(var d=s-1,p=-1,f=s-1;f>o;f--){var v=f-o,h=v*v*(s-f)*(i-e[f]);h>p&&(d=f,p=h)}return d<<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})(br),Br=Po;var Mo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Bo=(function(r){Mo(t,r);function t(e){var n=r.call(this,e)||this;return n.matrix=null,n}return t.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var e=this.getLuminanceSource(),n=e.getWidth(),i=e.getHeight();if(n>=t.MINIMUM_DIMENSION&&i>=t.MINIMUM_DIMENSION){var o=e.getMatrix(),a=n>>t.BLOCK_SIZE_POWER;(n&t.BLOCK_SIZE_MASK)!==0&&a++;var f=i>>t.BLOCK_SIZE_POWER;(i&t.BLOCK_SIZE_MASK)!==0&&f++;var s=t.calculateBlackPoints(o,a,f,n,i),u=new at(n,i);t.calculateThresholdForBlock(o,a,f,n,i,s,u),this.matrix=u}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,i,o,a,f,s){for(var u=a-t.BLOCK_SIZE,c=o-t.BLOCK_SIZE,h=0;h<i;h++){var l=h<<t.BLOCK_SIZE_POWER;l>u&&(l=u);for(var d=t.cap(h,2,i-3),p=0;p<n;p++){var v=p<<t.BLOCK_SIZE_POWER;v>c&&(v=c);for(var g=t.cap(p,2,n-3),y=0,m=-2;m<=2;m++){var w=f[d+m];y+=w[g-2]+w[g-1]+w[g]+w[g+1]+w[g+2]}var _=y/25;t.thresholdBlock(e,v,l,_,o,s)}}},t.cap=function(e,n,i){return e<n?n:e>i?i:e},t.thresholdBlock=function(e,n,i,o,a,f){for(var s=0,u=i*a+n;s<t.BLOCK_SIZE;s++,u+=a)for(var c=0;c<t.BLOCK_SIZE;c++)(e[u+c]&255)<=o&&f.set(n+c,i+s)},t.calculateBlackPoints=function(e,n,i,o,a){for(var f=a-t.BLOCK_SIZE,s=o-t.BLOCK_SIZE,u=new Array(i),c=0;c<i;c++){u[c]=new Int32Array(n);var h=c<<t.BLOCK_SIZE_POWER;h>f&&(h=f);for(var l=0;l<n;l++){var d=l<<t.BLOCK_SIZE_POWER;d>s&&(d=s);for(var p=0,v=255,g=0,y=0,m=h*o+d;y<t.BLOCK_SIZE;y++,m+=o){for(var w=0;w<t.BLOCK_SIZE;w++){var _=e[m+w]&255;p+=_,_<v&&(v=_),_>g&&(g=_)}if(g-v>t.MIN_DYNAMIC_RANGE)for(y++,m+=o;y<t.BLOCK_SIZE;y++,m+=o)for(var w=0;w<t.BLOCK_SIZE;w++)p+=e[m+w]&255}var I=p>>t.BLOCK_SIZE_POWER*2;if(g-v<=t.MIN_DYNAMIC_RANGE&&(I=v/2,c>0&&l>0)){var T=(u[c-1][l]+2*u[c][l-1]+u[c-1][l-1])/4;v<T&&(I=T)}u[c][l]=I}}return u},t.BLOCK_SIZE_POWER=3,t.BLOCK_SIZE=1<<t.BLOCK_SIZE_POWER,t.BLOCK_SIZE_MASK=t.BLOCK_SIZE-1,t.MINIMUM_DIMENSION=t.BLOCK_SIZE*5,t.MIN_DYNAMIC_RANGE=24,t})(Br),ke=Bo;var Fo=(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,i){throw new ce("This luminance source does not support cropping.")},r.prototype.isRotateSupported=function(){return!1},r.prototype.rotateCounterClockwise=function(){throw new ce("This luminance source does not support rotation by 90 degrees.")},r.prototype.rotateCounterClockwise45=function(){throw new ce("This luminance source does not support rotation by 45 degrees.")},r.prototype.toString=function(){for(var t=new Uint8ClampedArray(this.width),e=new P,n=0;n<this.height;n++){for(var i=this.getRow(n,t),o=0;o<this.width;o++){var a=i[o]&255,f=void 0;a<64?f="#":a<128?f="+":a<192?f=".":f=" ",e.append(f)}e.append(`
4
- `)}return e.toString()},r})(),Ht=Fo;var Lo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ko=(function(r){Lo(t,r);function t(e){var n=r.call(this,e.getWidth(),e.getHeight())||this;return n.delegate=e,n}return t.prototype.getRow=function(e,n){for(var i=this.delegate.getRow(e,n),o=this.getWidth(),a=0;a<o;a++)i[a]=255-(i[a]&255);return i},t.prototype.getMatrix=function(){for(var e=this.delegate.getMatrix(),n=this.getWidth()*this.getHeight(),i=new Uint8ClampedArray(n),o=0;o<n;o++)i[o]=255-(e[o]&255);return i},t.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},t.prototype.crop=function(e,n,i,o){return new t(this.delegate.crop(e,n,i,o))},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})(Ht),zt=ko;var Uo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Tn=(function(r){Uo(t,r);function t(e,n){n===void 0&&(n=!1);var i=r.call(this,e.width,e.height)||this;return i.canvas=e,i.tempCanvasElement=null,i.buffer=t.makeBufferFromCanvasImageData(e,n),i}return t.makeBufferFromCanvasImageData=function(e,n){n===void 0&&(n=!1);var i=e.getContext("2d").getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(i.data,e.width,e.height,n)},t.toGrayscaleBuffer=function(e,n,i,o){o===void 0&&(o=!1);var a=new Uint8ClampedArray(n*i);if(t.FRAME_INDEX=!t.FRAME_INDEX,t.FRAME_INDEX||!o)for(var f=0,s=0,u=e.length;f<u;f+=4,s++){var c=void 0,h=e[f+3];if(h===0)c=255;else{var l=e[f],d=e[f+1],p=e[f+2];c=306*l+601*d+117*p+512>>10}a[s]=c}else for(var f=0,s=0,v=e.length;f<v;f+=4,s++){var c=void 0,h=e[f+3];if(h===0)c=255;else{var l=e[f],d=e[f+1],p=e[f+2];c=306*l+601*d+117*p+512>>10}a[s]=255-c}return a},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new O("Requested row is outside the image: "+e);var i=this.getWidth(),o=e*i;return n===null?n=this.buffer.slice(o,o+i):(n.length<i&&(n=new Uint8ClampedArray(i)),n.set(this.buffer.slice(o,o+i))),n},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,i,o){return r.prototype.crop.call(this,e,n,i,o),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(),i=n.getContext("2d"),o=e*t.DEGREE_TO_RADIANS,a=this.canvas.width,f=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*a+Math.abs(Math.sin(o))*f),u=Math.ceil(Math.abs(Math.sin(o))*a+Math.abs(Math.cos(o))*f);return n.width=s,n.height=u,i.translate(s/2,u/2),i.rotate(o),i.drawImage(this.canvas,a/-2,f/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.prototype.invert=function(){return new zt(this)},t.DEGREE_TO_RADIANS=Math.PI/180,t.FRAME_INDEX=!0,t})(Ht);var Dn=(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})();var Ot=function(r,t,e,n){function i(o){return o instanceof e?o:new e(function(a){a(o)})}return new(e||(e=Promise))(function(o,a){function f(c){try{u(n.next(c))}catch(h){a(h)}}function s(c){try{u(n.throw(c))}catch(h){a(h)}}function u(c){c.done?o(c.value):i(c.value).then(f,s)}u((n=n.apply(r,t||[])).next())})},Tt=function(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(u){return function(c){return s([u,c])}}function s(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){e.label=u[1];break}if(u[0]===6&&e.label<o[1]){e.label=o[1],o=u;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(u);break}o[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(c){u=[6,c],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Ho=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.")},Mt=(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 Ot(this,void 0,void 0,function(){var t,e,n,i,o,a,f,s,u,c,h,l;return Tt(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=Ho(t),i=n.next();!i.done;i=n.next())o=i.value,a=o.kind==="video"?"videoinput":o.kind,a==="videoinput"&&(f=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),u=o.groupId,c={deviceId:f,label:s,kind:a,groupId:u},e.push(c))}catch(p){h={error:p}}finally{try{i&&!i.done&&(l=n.return)&&l.call(n)}finally{if(h)throw h.error}}return[2,e]}})})},r.prototype.getVideoInputDevices=function(){return Ot(this,void 0,void 0,function(){var t;return Tt(this,function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return t=e.sent(),[2,t.map(function(n){return new Dn(n.deviceId,n.label)})]}})})},r.prototype.findDeviceById=function(t){return Ot(this,void 0,void 0,function(){var e;return Tt(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=n.sent(),e?[2,e.find(function(i){return i.deviceId===t})]:[2,null]}})})},r.prototype.decodeFromInputVideoDevice=function(t,e){return Ot(this,void 0,void 0,function(){return Tt(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 Ot(this,void 0,void 0,function(){var n,i;return Tt(this,function(o){switch(o.label){case 0:return this.reset(),t?n={deviceId:{exact:t}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,e)];case 1:return[2,o.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return Ot(this,void 0,void 0,function(){var n;return Tt(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,e)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(t,e){return Ot(this,void 0,void 0,function(){var n,i;return Tt(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 i=o.sent(),[2,i]}})})},r.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,n){return Ot(this,void 0,void 0,function(){return Tt(this,function(i){switch(i.label){case 0:return[4,this.decodeFromVideoDevice(t,e,n)];case 1:return[2,i.sent()]}})})},r.prototype.decodeFromVideoDevice=function(t,e,n){return Ot(this,void 0,void 0,function(){var i,o;return Tt(this,function(a){switch(a.label){case 0:return t?i={deviceId:{exact:t}}:i={facingMode:"environment"},o={video:i},[4,this.decodeFromConstraints(o,e,n)];case 1:return[2,a.sent()]}})})},r.prototype.decodeFromConstraints=function(t,e,n){return Ot(this,void 0,void 0,function(){var i;return Tt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return i=o.sent(),[4,this.decodeFromStream(i,e,n)];case 2:return[2,o.sent()]}})})},r.prototype.decodeFromStream=function(t,e,n){return Ot(this,void 0,void 0,function(){var i;return Tt(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return i=o.sent(),[4,this.decodeContinuously(i,n)];case 2:return[2,o.sent()]}})})},r.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},r.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},r.prototype.attachStreamToVideo=function(t,e){return Ot(this,void 0,void 0,function(){var n;return Tt(this,function(i){switch(i.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 i.sent(),[2,n]}})})},r.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise(function(n,i){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 Ot(this,void 0,void 0,function(){var e;return Tt(this,function(n){switch(n.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[3,4];case 3:return e=n.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 st("element with id '"+t+"' not found");if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new st("element with id '"+t+"' must be an "+e+" element");return n},r.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new st("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 st("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 st("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 st("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);this.imageElement=e;var n;return this.isImageLoaded(e)?n=this.decodeOnce(e,!1,!0):n=this._decodeOnLoadImage(e),n},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 st("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 st("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 st("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 st("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),i=this.decodeFromVideoElementContinuously(n,e);return n.src=t,i},r.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(n,i){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(n,i)},t.addEventListener("load",e.imageLoadedListener)})},r.prototype._decodeOnLoadVideo=function(t){return Ot(this,void 0,void 0,function(){return Tt(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 Ot(this,void 0,void 0,function(){return Tt(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 typeof t>"u"&&(e=document.createElement("img"),e.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"),e.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 i=this;e===void 0&&(e=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var o=function(a,f){if(i._stopAsyncDecode){f(new A("Video stream has ended before any code could be detected.")),i._stopAsyncDecode=void 0;return}try{var s=i.decode(t);a(s)}catch(l){var u=e&&l instanceof A,c=l instanceof j||l instanceof S,h=c&&n;if(u||h)return setTimeout(o,i._timeBetweenDecodingAttempts,a,f);f(l)}};return new Promise(function(a,f){return o(a,f)})},r.prototype.decodeContinuously=function(t,e){var n=this;this._stopContinuousDecode=!1;var i=function(){if(n._stopContinuousDecode){n._stopContinuousDecode=void 0;return}try{var o=n.decode(t);e(o,null),setTimeout(i,n.timeBetweenScansMillis)}catch(s){e(null,s);var a=s instanceof j||s instanceof S,f=s instanceof A;(a||f)&&setTimeout(i,n._timeBetweenDecodingAttempts)}};i()},r.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)},r.prototype.createBinaryBitmap=function(t){var e=this.getCaptureCanvasContext(t),n=!1;t instanceof HTMLVideoElement?(this.drawFrameOnCanvas(t),n=!0):this.drawImageOnCanvas(t);var i=this.getCaptureCanvas(t),o=new Tn(i,n),a=new ke(o);return new Le(a)},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=document.createElement("canvas"),n,i;return typeof t<"u"&&(t instanceof HTMLVideoElement?(n=t.videoWidth,i=t.videoHeight):t instanceof HTMLImageElement&&(n=t.naturalWidth||t.width,i=t.naturalHeight||t.height)),e.style.width=n+"px",e.style.height=i+"px",e.width=n,e.height=i,e},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&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&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})();var Vo=(function(){function r(t,e,n,i,o,a){n===void 0&&(n=e==null?0:8*e.length),a===void 0&&(a=V.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=n,this.resultPoints=i,this.format=o,this.timestamp=a,this.text=t,this.rawBytes=e,n==null?this.numBits=e==null?0:8*e.length:this.numBits=n,this.resultPoints=i,this.format=o,this.resultMetadata=null,a==null?this.timestamp=V.currentTimeMillis():this.timestamp=a}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);V.arraycopy(e,0,n,0,e.length),V.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})(),Z=Vo;var Fr;(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"})(Fr||(Fr={}));var C=Fr;var Lr;(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"})(Lr||(Lr={}));var ft=Lr;var Go=(function(){function r(t,e,n,i,o,a){o===void 0&&(o=-1),a===void 0&&(a=-1),this.rawBytes=t,this.text=e,this.byteSegments=n,this.ecLevel=i,this.structuredAppendSequenceNumber=o,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})(),Zt=Go;var Wo=(function(){function r(){}return r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new O;return this.logTable[t]},r.addOrSubtract=function(t,e){return t^e},r})(),he=Wo;var Xo=(function(){function r(t,e){if(e.length===0)throw new O;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var i=1;i<n&&e[i]===0;)i++;i===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-i),V.arraycopy(e,i,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=this.coefficients,n;if(t===1){n=0;for(var i=0,o=e.length;i!==o;i++){var a=e[i];n=he.addOrSubtract(n,a)}return n}n=e[0];for(var f=e.length,s=this.field,i=1;i<f;i++)n=he.addOrSubtract(s.multiply(t,n),e[i]);return n},r.prototype.addOrSubtract=function(t){if(!this.field.equals(t.field))throw new O("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 i=e;e=n,n=i}var o=new Int32Array(n.length),a=n.length-e.length;V.arraycopy(n,0,o,0,a);for(var f=a;f<n.length;f++)o[f]=he.addOrSubtract(e[f-a],n[f]);return new r(this.field,o)},r.prototype.multiply=function(t){if(!this.field.equals(t.field))throw new O("GenericGFPolys do not have same GenericGF field");if(this.isZero()||t.isZero())return this.field.getZero();for(var e=this.coefficients,n=e.length,i=t.coefficients,o=i.length,a=new Int32Array(n+o-1),f=this.field,s=0;s<n;s++)for(var u=e[s],c=0;c<o;c++)a[s+c]=he.addOrSubtract(a[s+c],f.multiply(u,i[c]));return new r(f,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,i=new Int32Array(e),o=this.coefficients,a=0;a<e;a++)i[a]=n.multiply(o[a],t);return new r(n,i)},r.prototype.multiplyByMonomial=function(t,e){if(t<0)throw new O;if(e===0)return this.field.getZero();for(var n=this.coefficients,i=n.length,o=new Int32Array(i+t),a=this.field,f=0;f<i;f++)o[f]=a.multiply(n[f],e);return new r(a,o)},r.prototype.divide=function(t){if(!this.field.equals(t.field))throw new O("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new O("Divide by 0");for(var e=this.field,n=e.getZero(),i=this,o=t.getCoefficient(t.getDegree()),a=e.inverse(o);i.getDegree()>=t.getDegree()&&!i.isZero();){var f=i.getDegree()-t.getDegree(),s=e.multiply(i.getCoefficient(i.getDegree()),a),u=t.multiplyByMonomial(f,s),c=e.buildMonomial(f,s);n=n.addOrSubtract(c),i=i.addOrSubtract(u)}return[n,i]},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 i=this.field.log(n);i===0?t+="1":i===1?t+="a":(t+="a^",t+=i)}e!==0&&(e===1?t+="x":(t+="x^",t+=e))}}return t},r})(),Bt=Xo;var zo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Zo=(function(r){zo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArithmeticException",t})($),Ue=Zo;var jo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Yo=(function(r){jo(t,r);function t(e,n,i){var o=r.call(this)||this;o.primitive=e,o.size=n,o.generatorBase=i;for(var a=new Int32Array(n),f=1,s=0;s<n;s++)a[s]=f,f*=2,f>=n&&(f^=e,f&=n-1);o.expTable=a;for(var u=new Int32Array(n),s=0;s<n-1;s++)u[a[s]]=s;return o.logTable=u,o.zero=new Bt(o,Int32Array.from([0])),o.one=new Bt(o,Int32Array.from([1])),o}return 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 O;if(n===0)return this.zero;var i=new Int32Array(e+1);return i[0]=n,new Bt(this,i)},t.prototype.inverse=function(e){if(e===0)throw new Ue;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"+M.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})(he),dt=Yo;var Ko=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Qo=(function(r){Ko(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ReedSolomonException",t})($),we=Qo;var qo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Jo=(function(r){qo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IllegalStateException",t})($),xt=Jo;var $o=(function(){function r(t){this.field=t}return r.prototype.decode=function(t,e){for(var n=this.field,i=new Bt(n,t),o=new Int32Array(e),a=!0,f=0;f<e;f++){var s=i.evaluateAt(n.exp(f+n.getGeneratorBase()));o[o.length-1-f]=s,s!==0&&(a=!1)}if(!a)for(var u=new Bt(n,o),c=this.runEuclideanAlgorithm(n.buildMonomial(e,1),u,e),h=c[0],l=c[1],d=this.findErrorLocations(h),p=this.findErrorMagnitudes(l,d),f=0;f<d.length;f++){var v=t.length-1-n.log(d[f]);if(v<0)throw new we("Bad error location");t[v]=dt.addOrSubtract(t[v],p[f])}},r.prototype.runEuclideanAlgorithm=function(t,e,n){if(t.getDegree()<e.getDegree()){var i=t;t=e,e=i}for(var o=this.field,a=t,f=e,s=o.getZero(),u=o.getOne();f.getDegree()>=(n/2|0);){var c=a,h=s;if(a=f,s=u,a.isZero())throw new we("r_{i-1} was zero");f=c;for(var l=o.getZero(),d=a.getCoefficient(a.getDegree()),p=o.inverse(d);f.getDegree()>=a.getDegree()&&!f.isZero();){var v=f.getDegree()-a.getDegree(),g=o.multiply(f.getCoefficient(f.getDegree()),p);l=l.addOrSubtract(o.buildMonomial(v,g)),f=f.addOrSubtract(a.multiplyByMonomial(v,g))}if(u=l.multiply(s).addOrSubtract(h),f.getDegree()>=a.getDegree())throw new xt("Division algorithm failed to reduce polynomial?")}var y=u.getCoefficient(0);if(y===0)throw new we("sigmaTilde(0) was zero");var m=o.inverse(y),w=u.multiplyScalar(m),_=f.multiplyScalar(m);return[w,_]},r.prototype.findErrorLocations=function(t){var e=t.getDegree();if(e===1)return Int32Array.from([t.getCoefficient(1)]);for(var n=new Int32Array(e),i=0,o=this.field,a=1;a<o.getSize()&&i<e;a++)t.evaluateAt(a)===0&&(n[i]=o.inverse(a),i++);if(i!==e)throw new we("Error locator degree does not match number of roots");return n},r.prototype.findErrorMagnitudes=function(t,e){for(var n=e.length,i=new Int32Array(n),o=this.field,a=0;a<n;a++){for(var f=o.inverse(e[a]),s=1,u=0;u<n;u++)if(a!==u){var c=o.multiply(e[u],f),h=(c&1)===0?c|1:c&-2;s=o.multiply(s,h)}i[a]=o.multiply(t.evaluateAt(f),o.inverse(s)),o.getGeneratorBase()!==0&&(i[a]=o.multiply(i[a],f))}return i},r})(),jt=$o;var Ct;(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"})(Ct||(Ct={}));var ta=(function(){function r(){}return r.prototype.decode=function(t){this.ddata=t;var e=t.getBits(),n=this.extractBits(e),i=this.correctBits(n),o=r.convertBoolArrayToByteArray(i),a=r.getEncodedData(i),f=new Zt(o,a,null,null);return f.setNumBits(i.length),f},r.highLevelDecode=function(t){return this.getEncodedData(t)},r.getEncodedData=function(t){for(var e=t.length,n=Ct.UPPER,i=Ct.UPPER,o="",a=0;a<e;)if(i===Ct.BINARY){if(e-a<5)break;var f=r.readCode(t,a,5);if(a+=5,f===0){if(e-a<11)break;f=r.readCode(t,a,11)+31,a+=11}for(var s=0;s<f;s++){if(e-a<8){a=e;break}var u=r.readCode(t,a,8);o+=F.castAsNonUtf8Char(u),a+=8}i=n}else{var c=i===Ct.DIGIT?4:5;if(e-a<c)break;var u=r.readCode(t,a,c);a+=c;var h=r.getCharacter(i,u);h.startsWith("CTRL_")?(n=i,i=r.getTable(h.charAt(5)),h.charAt(6)==="L"&&(n=i)):(o+=h,i=n)}return o},r.getTable=function(t){switch(t){case"L":return Ct.LOWER;case"P":return Ct.PUNCT;case"M":return Ct.MIXED;case"D":return Ct.DIGIT;case"B":return Ct.BINARY;case"U":default:return Ct.UPPER}},r.getCharacter=function(t,e){switch(t){case Ct.UPPER:return r.UPPER_TABLE[e];case Ct.LOWER:return r.LOWER_TABLE[e];case Ct.MIXED:return r.MIXED_TABLE[e];case Ct.PUNCT:return r.PUNCT_TABLE[e];case Ct.DIGIT:return r.DIGIT_TABLE[e];default:throw new xt("Bad table")}},r.prototype.correctBits=function(t){var e,n;this.ddata.getNbLayers()<=2?(n=6,e=dt.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,e=dt.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,e=dt.AZTEC_DATA_10):(n=12,e=dt.AZTEC_DATA_12);var i=this.ddata.getNbDatablocks(),o=t.length/n;if(o<i)throw new S;for(var a=t.length%n,f=new Int32Array(o),s=0;s<o;s++,a+=n)f[s]=r.readCode(t,a,n);try{var u=new jt(e);u.decode(f,o-i)}catch(g){throw new S(g)}for(var c=(1<<n)-1,h=0,s=0;s<i;s++){var l=f[s];if(l===0||l===c)throw new S;(l===1||l===c-1)&&h++}for(var d=new Array(i*n-h),p=0,s=0;s<i;s++){var l=f[s];if(l===1||l===c-1)d.fill(l>1,p,p+n-1),p+=n-1;else for(var v=n-1;v>=0;--v)d[p++]=(l&1<<v)!==0}return d},r.prototype.extractBits=function(t){var e=this.ddata.isCompact(),n=this.ddata.getNbLayers(),i=(e?11:14)+n*4,o=new Int32Array(i),a=new Array(this.totalBitsInLayer(n,e));if(e)for(var f=0;f<o.length;f++)o[f]=f;else for(var s=i+1+2*M.truncDivision(M.truncDivision(i,2)-1,15),u=i/2,c=M.truncDivision(s,2),f=0;f<u;f++){var h=f+M.truncDivision(f,15);o[u-f-1]=c-h-1,o[u+f]=c+h+1}for(var f=0,l=0;f<n;f++){for(var d=(n-f)*4+(e?9:12),p=f*2,v=i-1-p,g=0;g<d;g++)for(var y=g*2,m=0;m<2;m++)a[l+y+m]=t.get(o[p+m],o[p+g]),a[l+2*d+y+m]=t.get(o[p+g],o[v-m]),a[l+4*d+y+m]=t.get(o[v-m],o[v-g]),a[l+6*d+y+m]=t.get(o[v-g],o[p+m]);l+=d*8}return a},r.readCode=function(t,e,n){for(var i=0,o=e;o<e+n;o++)i<<=1,t[o]&&(i|=1);return i},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"," ","","","","","","","\x07","\b"," ",`
1
+ "use strict";(()=>{function qi(r,t){var e=Object.setPrototypeOf;e?e(r,t):r.__proto__=t}function Ji(r,t){t===void 0&&(t=r.constructor);var e=Error.captureStackTrace;e&&e(r,t)}var $i=(function(){var r=function(e,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a])},r(e,n)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),On=(function(r){$i(t,r);function t(e,n){var i=this.constructor,o=r.call(this,e,n)||this;return Object.defineProperty(o,"name",{value:i.name,enumerable:!1,configurable:!0}),qi(o,i.prototype),Ji(o),o}return t})(Error);var to=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),eo=(function(r){to(t,r);function t(e){e===void 0&&(e=void 0);var n=r.call(this,e)||this;return n.message=e,n}return t.prototype.getKind=function(){var e=this.constructor;return e.kind},t.kind="Exception",t})(On),$=eo;var ro=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),no=(function(r){ro(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArgumentException",t})($),st=no;var io=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),oo=(function(r){io(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IllegalArgumentException",t})($),O=oo;var ao=(function(){function r(t){if(this.binarizer=t,t===null)throw new O("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,i){var o=this.binarizer.getLuminanceSource().crop(t,e,n,i);return new r(this.binarizer.createBinarizer(o))},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})(),Le=ao;var fo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),so=(function(r){fo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t})($),j=so;var uo=(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})(),br=uo;var co=(function(){function r(){}return r.arraycopy=function(t,e,n,i,o){for(;o--;)n[i++]=t[e++]},r.currentTimeMillis=function(){return Date.now()},r})(),V=co;var lo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ho=(function(r){lo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IndexOutOfBoundsException",t})($),ye=ho;var po=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),vo=(function(r){po(t,r);function t(e,n){e===void 0&&(e=void 0),n===void 0&&(n=void 0);var i=r.call(this,n)||this;return i.index=e,i.message=n,i}return t.kind="ArrayIndexOutOfBoundsException",t})(ye),Pr=vo;var xo=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.")},go=(function(){function r(){}return r.fill=function(t,e){for(var n=0,i=t.length;n<i;n++)t[n]=e},r.fillWithin=function(t,e,n,i){r.rangeCheck(t.length,e,n);for(var o=e;o<n;o++)t[o]=i},r.rangeCheck=function(t,e,n){if(e>n)throw new O("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new Pr(e);if(n>t)throw new Pr(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){var i=Array.from({length:t});return i.map(function(o){return Array.from({length:e}).fill(n)})},r.createInt32Array=function(t,e,n){var i=Array.from({length:t});return i.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,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0},r.hashCode=function(t){var e,n;if(t===null)return 0;var i=1;try{for(var o=xo(t),a=o.next();!a.done;a=o.next()){var f=a.value;i=31*i+f}}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i},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 i=n-e,o=new Int32Array(i);return V.arraycopy(t,e,o,0,i),o},r.binarySearch=function(t,e,n){n===void 0&&(n=r.numberComparator);for(var i=0,o=t.length-1;i<=o;){var a=o+i>>1,f=n(e,t[a]);if(f>0)i=a+1;else if(f<0)o=a-1;else return a}return-i-1},r.numberComparator=function(t,e){return t-e},r})(),Y=go;var mo=(function(){function r(){}return r.numberOfTrailingZeros=function(t){var e;if(t===0)return 32;var n=31;return e=t<<16,e!==0&&(n-=16,t=e),e=t<<8,e!==0&&(n-=8,t=e),e=t<<4,e!==0&&(n-=4,t=e),e=t<<2,e!==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,e},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-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),t=t+(t>>>4)&252645135,t=t+(t>>>8),t=t+(t>>>16),t&63},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})(),M=mo;var yo=(function(){function r(t,e){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,e==null?this.bits=r.makeArray(t):this.bits=e)}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>this.bits.length*32){var e=r.makeArray(t);V.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<<(t&31))!==0},r.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(t&31)},r.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(t&31)},r.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,i=Math.floor(t/32),o=n[i];o&=~((1<<(t&31))-1);for(var a=n.length;o===0;){if(++i===a)return e;o=n[i]}var f=i*32+M.numberOfTrailingZeros(o);return f>e?e:f},r.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,i=Math.floor(t/32),o=~n[i];o&=~((1<<(t&31))-1);for(var a=n.length;o===0;){if(++i===a)return e;o=~n[i]}var f=i*32+M.numberOfTrailingZeros(o);return f>e?e:f},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 O;if(e!==t){e--;for(var n=Math.floor(t/32),i=Math.floor(e/32),o=this.bits,a=n;a<=i;a++){var f=a>n?0:t&31,s=a<i?31:e&31,u=(2<<s)-(1<<f);o[a]|=u}}},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 O;if(e===t)return!0;e--;for(var i=Math.floor(t/32),o=Math.floor(e/32),a=this.bits,f=i;f<=o;f++){var s=f>i?0:t&31,u=f<o?31:e&31,c=(2<<u)-(1<<s)&4294967295;if((a[f]&c)!==(n?c:0))return!1}return!0},r.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},r.prototype.appendBits=function(t,e){if(e<0||e>32)throw new O("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 O("Sizes don't match");for(var e=this.bits,n=0,i=e.length;n<i;n++)e[n]^=t.bits[n]},r.prototype.toBytes=function(t,e,n,i){for(var o=0;o<i;o++){for(var a=0,f=0;f<8;f++)this.get(t)&&(a|=1<<7-f),t++;e[n+o]=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,i=this.bits,o=0;o<n;o++){var a=i[o];a=a>>1&1431655765|(a&1431655765)<<1,a=a>>2&858993459|(a&858993459)<<2,a=a>>4&252645135|(a&252645135)<<4,a=a>>8&16711935|(a&16711935)<<8,a=a>>16&65535|(a&65535)<<16,t[e-o]=a}if(this.size!==n*32){for(var f=n*32-this.size,s=t[0]>>>f,o=1;o<n;o++){var u=t[o];s|=u<<32-f,t[o-1]=s,s=u>>>f}t[n-1]=s}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&&Y.equals(this.bits,e.bits)},r.prototype.hashCode=function(){return 31*this.size+Y.hashCode(this.bits)},r.prototype.toString=function(){for(var t="",e=0,n=this.size;e<n;e++)(e&7)===0&&(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})(),it=yo;var Mr;(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"})(Mr||(Mr={}));var k=Mr;var wo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ao=(function(r){wo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getFormatInstance=function(){return new t},t.kind="FormatException",t})($),S=Ao;var Eo=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.")},tt;(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"})(tt||(tt={}));var _o=(function(){function r(t,e,n){for(var i,o,a=[],f=3;f<arguments.length;f++)a[f-3]=arguments[f];this.valueIdentifier=t,this.name=n,typeof e=="number"?this.values=Int32Array.from([e]):this.values=e,this.otherEncodingNames=a,r.VALUE_IDENTIFIER_TO_ECI.set(t,this),r.NAME_TO_ECI.set(n,this);for(var s=this.values,u=0,c=s.length;u!==c;u++){var l=s[u];r.VALUES_TO_ECI.set(l,this)}try{for(var h=Eo(a),d=h.next();!d.done;d=h.next()){var p=d.value;r.NAME_TO_ECI.set(p,this)}}catch(v){i={error:v}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.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 S("incorect value");var e=r.VALUES_TO_ECI.get(t);if(e===void 0)throw new S("incorect value");return e},r.getCharacterSetECIByName=function(t){var e=r.NAME_TO_ECI.get(t);if(e===void 0)throw new S("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(tt.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(tt.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(tt.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(tt.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(tt.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(tt.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(tt.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(tt.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(tt.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(tt.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(tt.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(tt.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(tt.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(tt.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(tt.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(tt.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(tt.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(tt.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(tt.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(tt.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(tt.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(tt.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(tt.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(tt.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(tt.Big5,28,"Big5"),r.GB18030=new r(tt.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(tt.EUC_KR,30,"EUC_KR","EUC-KR"),r})(),ot=_o;var Co=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Io=(function(r){Co(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="UnsupportedOperationException",t})($),ce=Io;var So=(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 ot?t:ot.getCharacterSetECIByName(t)},r.decodeFallback=function(t,e){var n=this.encodingCharacterSet(e);if(r.isDecodeFallbackSupported(n)){for(var i="",o=0,a=t.length;o<a;o++){var f=t[o].toString(16);f.length<2&&(f="0"+f),i+="%"+f}return decodeURIComponent(i)}if(n.equals(ot.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new ce("Encoding "+this.encodingName(e)+" not supported by fallback.")},r.isDecodeFallbackSupported=function(t){return t.equals(ot.UTF8)||t.equals(ot.ISO8859_1)||t.equals(ot.ASCII)},r.encodeFallback=function(t){for(var e=btoa(unescape(encodeURIComponent(t))),n=e.split(""),i=[],o=0;o<n.length;o++)i.push(n[o].charCodeAt(0));return new Uint8Array(i)},r})(),yt=So;var Oo=(function(){function r(){}return r.castAsNonUtf8Char=function(t,e){e===void 0&&(e=null);var n=e?e.getName():this.ISO88591;return yt.decode(new Uint8Array([t]),n)},r.guessEncoding=function(t,e){if(e!=null&&e.get(k.CHARACTER_SET)!==void 0)return e.get(k.CHARACTER_SET).toString();for(var n=t.length,i=!0,o=!0,a=!0,f=0,s=0,u=0,c=0,l=0,h=0,d=0,p=0,v=0,g=0,y=0,m=t.length>3&&t[0]===239&&t[1]===187&&t[2]===191,w=0;w<n&&(i||o||a);w++){var _=t[w]&255;a&&(f>0?(_&128)===0?a=!1:f--:(_&128)!==0&&((_&64)===0?a=!1:(f++,(_&32)===0?s++:(f++,(_&16)===0?u++:(f++,(_&8)===0?c++:a=!1))))),i&&(_>127&&_<160?i=!1:_>159&&(_<192||_===215||_===247)&&y++),o&&(l>0?_<64||_===127||_>252?o=!1:l--:_===128||_===160||_>239?o=!1:_>160&&_<224?(h++,p=0,d++,d>v&&(v=d)):_>127?(l++,d=0,p++,p>g&&(g=p)):(d=0,p=0))}return a&&f>0&&(a=!1),o&&l>0&&(o=!1),a&&(m||s+u+c>0)?r.UTF8:o&&(r.ASSUME_SHIFT_JIS||v>=3||g>=3)?r.SHIFT_JIS:i&&o?v===2&&h===2||y*10>=n?r.SHIFT_JIS:r.ISO88591:i?r.ISO88591:o?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 i=-1;function o(f,s,u,c,l,h){if(f==="%%")return"%";if(e[++i]!==void 0){f=c?parseInt(c.substr(1)):void 0;var d=l?parseInt(l.substr(1)):void 0,p;switch(h){case"s":p=e[i];break;case"c":p=e[i][0];break;case"f":p=parseFloat(e[i]).toFixed(f);break;case"p":p=parseFloat(e[i]).toPrecision(f);break;case"e":p=parseFloat(e[i]).toExponential(f);break;case"x":p=parseInt(e[i]).toString(d||16);break;case"d":p=parseFloat(parseInt(e[i],d||10).toPrecision(f)).toFixed(0);break}p=typeof p=="object"?JSON.stringify(p):(+p).toString(d);for(var v=parseInt(u),g=u&&u[0]+""=="0"?"0":" ";p.length<v;)p=s!==void 0?p+g:g+p;return p}}var a=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(a,o)},r.getBytes=function(t,e){return yt.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=ot.SJIS.getName(),r.GB2312="GB2312",r.ISO88591=ot.ISO8859_1.getName(),r.EUC_JP="EUC_JP",r.UTF8=ot.UTF8.getName(),r.PLATFORM_DEFAULT_ENCODING=r.UTF8,r.ASSUME_SHIFT_JIS=!1,r})(),F=Oo;var To=(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 i=e;e<e+n;i++)this.append(t[i]);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})(),P=To;var Do=(function(){function r(t,e,n,i){if(this.width=t,this.height=e,this.rowSize=n,this.bits=i,e==null&&(e=t),this.height=e,t<1||e<1)throw new O("Both dimensions must be greater than 0");n==null&&(n=Math.floor((t+31)/32)),this.rowSize=n,i==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return r.parseFromBooleanArray=function(t){for(var e=t.length,n=t[0].length,i=new r(n,e),o=0;o<e;o++)for(var a=t[o],f=0;f<n;f++)a[f]&&i.set(f,o);return i},r.parseFromString=function(t,e,n){if(t===null)throw new O("stringRepresentation cannot be null");for(var i=new Array(t.length),o=0,a=0,f=-1,s=0,u=0;u<t.length;)if(t.charAt(u)===`
2
+ `||t.charAt(u)==="\r"){if(o>a){if(f===-1)f=o-a;else if(o-a!==f)throw new O("row lengths do not match");a=o,s++}u++}else if(t.substring(u,u+e.length)===e)u+=e.length,i[o]=!0,o++;else if(t.substring(u,u+n.length)===n)u+=n.length,i[o]=!1,o++;else throw new O("illegal character encountered: "+t.substring(u));if(o>a){if(f===-1)f=o-a;else if(o-a!==f)throw new O("row lengths do not match");s++}for(var c=new r(f,s),l=0;l<o;l++)i[l]&&c.set(Math.floor(l%f),Math.floor(l/f));return c},r.prototype.get=function(t,e){var n=e*this.rowSize+Math.floor(t/32);return(this.bits[n]>>>(t&31)&1)!==0},r.prototype.set=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]|=1<<(t&31)&4294967295},r.prototype.unset=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]&=~(1<<(t&31)&4294967295)},r.prototype.flip=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]^=1<<(t&31)&4294967295},r.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new O("input matrix dimensions do not match");for(var e=new it(Math.floor(this.width/32)+1),n=this.rowSize,i=this.bits,o=0,a=this.height;o<a;o++)for(var f=o*n,s=t.getRow(o,e).getBitArray(),u=0;u<n;u++)i[f+u]^=s[u]},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,i){if(e<0||t<0)throw new O("Left and top must be nonnegative");if(i<1||n<1)throw new O("Height and width must be at least 1");var o=t+n,a=e+i;if(a>this.height||o>this.width)throw new O("The region must fit inside the matrix");for(var f=this.rowSize,s=this.bits,u=e;u<a;u++)for(var c=u*f,l=t;l<o;l++)s[c+Math.floor(l/32)]|=1<<(l&31)&4294967295},r.prototype.getRow=function(t,e){e==null||e.getSize()<this.width?e=new it(this.width):e.clear();for(var n=this.rowSize,i=this.bits,o=t*n,a=0;a<n;a++)e.setBulk(a*32,i[o+a]);return e},r.prototype.setRow=function(t,e){V.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 it(t),i=new it(t),o=0,a=Math.floor((e+1)/2);o<a;o++)n=this.getRow(o,n),i=this.getRow(e-1-o,i),n.reverse(),i.reverse(),this.setRow(o,i),this.setRow(e-1-o,n)},r.prototype.getEnclosingRectangle=function(){for(var t=this.width,e=this.height,n=this.rowSize,i=this.bits,o=t,a=e,f=-1,s=-1,u=0;u<e;u++)for(var c=0;c<n;c++){var l=i[u*n+c];if(l!==0){if(u<a&&(a=u),u>s&&(s=u),c*32<o){for(var h=0;(l<<31-h&4294967295)===0;)h++;c*32+h<o&&(o=c*32+h)}if(c*32+31>f){for(var h=31;!(l>>>h);)h--;c*32+h>f&&(f=c*32+h)}}}return f<o||s<a?null:Int32Array.from([o,a,f-o+1,s-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 i=n/t,o=n%t*32,a=e[n],f=0;(a<<31-f&4294967295)===0;)f++;return o+=f,Int32Array.from([o,i])},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 i=Math.floor(n/t),o=Math.floor(n%t)*32,a=e[n],f=31;!(a>>>f);)f--;return o+=f,Int32Array.from([o,i])},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&&Y.equals(this.bits,e.bits)},r.prototype.hashCode=function(){var t=this.width;return t=31*t+this.width,t=31*t+this.height,t=31*t+this.rowSize,t=31*t+Y.hashCode(this.bits),t},r.prototype.toString=function(t,e,n){return t===void 0&&(t="X "),e===void 0&&(e=" "),n===void 0&&(n=`
3
+ `),this.buildToString(t,e,n)},r.prototype.buildToString=function(t,e,n){for(var i=new P,o=0,a=this.height;o<a;o++){for(var f=0,s=this.width;f<s;f++)i.append(this.get(f,o)?t:e);i.append(n)}return i.toString()},r.prototype.clone=function(){return new r(this.width,this.height,this.rowSize,this.bits.slice())},r})(),at=Do;var Ro=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),No=(function(r){Ro(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getNotFoundInstance=function(){return new t},t.kind="NotFoundException",t})($),A=No;var bo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Po=(function(r){bo(t,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 t.prototype.getBlackRow=function(e,n){var i=this.getLuminanceSource(),o=i.getWidth();n==null||n.getSize()<o?n=new it(o):n.clear(),this.initArrays(o);for(var a=i.getRow(e,this.luminances),f=this.buckets,s=0;s<o;s++)f[(a[s]&255)>>t.LUMINANCE_SHIFT]++;var u=t.estimateBlackPoint(f);if(o<3)for(var s=0;s<o;s++)(a[s]&255)<u&&n.set(s);else for(var c=a[0]&255,l=a[1]&255,s=1;s<o-1;s++){var h=a[s+1]&255;(l*4-c-h)/2<u&&n.set(s),c=l,l=h}return n},t.prototype.getBlackMatrix=function(){var e=this.getLuminanceSource(),n=e.getWidth(),i=e.getHeight(),o=new at(n,i);this.initArrays(n);for(var a=this.buckets,f=1;f<5;f++)for(var s=Math.floor(i*f/5),u=e.getRow(s,this.luminances),c=Math.floor(n*4/5),l=Math.floor(n/5);l<c;l++){var h=u[l]&255;a[h>>t.LUMINANCE_SHIFT]++}for(var d=t.estimateBlackPoint(a),p=e.getMatrix(),f=0;f<i;f++)for(var v=f*n,l=0;l<n;l++){var h=p[v+l]&255;h<d&&o.set(l,f)}return o},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,i=0;i<t.LUMINANCE_BUCKETS;i++)n[i]=0},t.estimateBlackPoint=function(e){for(var n=e.length,i=0,o=0,a=0,f=0;f<n;f++)e[f]>a&&(o=f,a=e[f]),e[f]>i&&(i=e[f]);for(var s=0,u=0,f=0;f<n;f++){var c=f-o,l=e[f]*c*c;l>u&&(s=f,u=l)}if(o>s){var h=o;o=s,s=h}if(s-o<=n/16)throw new A;for(var d=s-1,p=-1,f=s-1;f>o;f--){var v=f-o,l=v*v*(s-f)*(i-e[f]);l>p&&(d=f,p=l)}return d<<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})(br),Br=Po;var Mo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Bo=(function(r){Mo(t,r);function t(e){var n=r.call(this,e)||this;return n.matrix=null,n}return t.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var e=this.getLuminanceSource(),n=e.getWidth(),i=e.getHeight();if(n>=t.MINIMUM_DIMENSION&&i>=t.MINIMUM_DIMENSION){var o=e.getMatrix(),a=n>>t.BLOCK_SIZE_POWER;(n&t.BLOCK_SIZE_MASK)!==0&&a++;var f=i>>t.BLOCK_SIZE_POWER;(i&t.BLOCK_SIZE_MASK)!==0&&f++;var s=t.calculateBlackPoints(o,a,f,n,i),u=new at(n,i);t.calculateThresholdForBlock(o,a,f,n,i,s,u),this.matrix=u}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,i,o,a,f,s){for(var u=a-t.BLOCK_SIZE,c=o-t.BLOCK_SIZE,l=0;l<i;l++){var h=l<<t.BLOCK_SIZE_POWER;h>u&&(h=u);for(var d=t.cap(l,2,i-3),p=0;p<n;p++){var v=p<<t.BLOCK_SIZE_POWER;v>c&&(v=c);for(var g=t.cap(p,2,n-3),y=0,m=-2;m<=2;m++){var w=f[d+m];y+=w[g-2]+w[g-1]+w[g]+w[g+1]+w[g+2]}var _=y/25;t.thresholdBlock(e,v,h,_,o,s)}}},t.cap=function(e,n,i){return e<n?n:e>i?i:e},t.thresholdBlock=function(e,n,i,o,a,f){for(var s=0,u=i*a+n;s<t.BLOCK_SIZE;s++,u+=a)for(var c=0;c<t.BLOCK_SIZE;c++)(e[u+c]&255)<=o&&f.set(n+c,i+s)},t.calculateBlackPoints=function(e,n,i,o,a){for(var f=a-t.BLOCK_SIZE,s=o-t.BLOCK_SIZE,u=new Array(i),c=0;c<i;c++){u[c]=new Int32Array(n);var l=c<<t.BLOCK_SIZE_POWER;l>f&&(l=f);for(var h=0;h<n;h++){var d=h<<t.BLOCK_SIZE_POWER;d>s&&(d=s);for(var p=0,v=255,g=0,y=0,m=l*o+d;y<t.BLOCK_SIZE;y++,m+=o){for(var w=0;w<t.BLOCK_SIZE;w++){var _=e[m+w]&255;p+=_,_<v&&(v=_),_>g&&(g=_)}if(g-v>t.MIN_DYNAMIC_RANGE)for(y++,m+=o;y<t.BLOCK_SIZE;y++,m+=o)for(var w=0;w<t.BLOCK_SIZE;w++)p+=e[m+w]&255}var I=p>>t.BLOCK_SIZE_POWER*2;if(g-v<=t.MIN_DYNAMIC_RANGE&&(I=v/2,c>0&&h>0)){var T=(u[c-1][h]+2*u[c][h-1]+u[c-1][h-1])/4;v<T&&(I=T)}u[c][h]=I}}return u},t.BLOCK_SIZE_POWER=3,t.BLOCK_SIZE=1<<t.BLOCK_SIZE_POWER,t.BLOCK_SIZE_MASK=t.BLOCK_SIZE-1,t.MINIMUM_DIMENSION=t.BLOCK_SIZE*5,t.MIN_DYNAMIC_RANGE=24,t})(Br),ke=Bo;var Fo=(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,i){throw new ce("This luminance source does not support cropping.")},r.prototype.isRotateSupported=function(){return!1},r.prototype.rotateCounterClockwise=function(){throw new ce("This luminance source does not support rotation by 90 degrees.")},r.prototype.rotateCounterClockwise45=function(){throw new ce("This luminance source does not support rotation by 45 degrees.")},r.prototype.toString=function(){for(var t=new Uint8ClampedArray(this.width),e=new P,n=0;n<this.height;n++){for(var i=this.getRow(n,t),o=0;o<this.width;o++){var a=i[o]&255,f=void 0;a<64?f="#":a<128?f="+":a<192?f=".":f=" ",e.append(f)}e.append(`
4
+ `)}return e.toString()},r})(),Ht=Fo;var Lo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ko=(function(r){Lo(t,r);function t(e){var n=r.call(this,e.getWidth(),e.getHeight())||this;return n.delegate=e,n}return t.prototype.getRow=function(e,n){for(var i=this.delegate.getRow(e,n),o=this.getWidth(),a=0;a<o;a++)i[a]=255-(i[a]&255);return i},t.prototype.getMatrix=function(){for(var e=this.delegate.getMatrix(),n=this.getWidth()*this.getHeight(),i=new Uint8ClampedArray(n),o=0;o<n;o++)i[o]=255-(e[o]&255);return i},t.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},t.prototype.crop=function(e,n,i,o){return new t(this.delegate.crop(e,n,i,o))},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})(Ht),zt=ko;var Uo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Tn=(function(r){Uo(t,r);function t(e,n){n===void 0&&(n=!1);var i=r.call(this,e.width,e.height)||this;return i.canvas=e,i.tempCanvasElement=null,i.buffer=t.makeBufferFromCanvasImageData(e,n),i}return t.makeBufferFromCanvasImageData=function(e,n){n===void 0&&(n=!1);var i=e.getContext("2d").getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(i.data,e.width,e.height,n)},t.toGrayscaleBuffer=function(e,n,i,o){o===void 0&&(o=!1);var a=new Uint8ClampedArray(n*i);if(t.FRAME_INDEX=!t.FRAME_INDEX,t.FRAME_INDEX||!o)for(var f=0,s=0,u=e.length;f<u;f+=4,s++){var c=void 0,l=e[f+3];if(l===0)c=255;else{var h=e[f],d=e[f+1],p=e[f+2];c=306*h+601*d+117*p+512>>10}a[s]=c}else for(var f=0,s=0,v=e.length;f<v;f+=4,s++){var c=void 0,l=e[f+3];if(l===0)c=255;else{var h=e[f],d=e[f+1],p=e[f+2];c=306*h+601*d+117*p+512>>10}a[s]=255-c}return a},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new O("Requested row is outside the image: "+e);var i=this.getWidth(),o=e*i;return n===null?n=this.buffer.slice(o,o+i):(n.length<i&&(n=new Uint8ClampedArray(i)),n.set(this.buffer.slice(o,o+i))),n},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,i,o){return r.prototype.crop.call(this,e,n,i,o),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(),i=n.getContext("2d"),o=e*t.DEGREE_TO_RADIANS,a=this.canvas.width,f=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*a+Math.abs(Math.sin(o))*f),u=Math.ceil(Math.abs(Math.sin(o))*a+Math.abs(Math.cos(o))*f);return n.width=s,n.height=u,i.translate(s/2,u/2),i.rotate(o),i.drawImage(this.canvas,a/-2,f/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.prototype.invert=function(){return new zt(this)},t.DEGREE_TO_RADIANS=Math.PI/180,t.FRAME_INDEX=!0,t})(Ht);var Dn=(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})();var Ot=function(r,t,e,n){function i(o){return o instanceof e?o:new e(function(a){a(o)})}return new(e||(e=Promise))(function(o,a){function f(c){try{u(n.next(c))}catch(l){a(l)}}function s(c){try{u(n.throw(c))}catch(l){a(l)}}function u(c){c.done?o(c.value):i(c.value).then(f,s)}u((n=n.apply(r,t||[])).next())})},Tt=function(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(u){return function(c){return s([u,c])}}function s(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){e.label=u[1];break}if(u[0]===6&&e.label<o[1]){e.label=o[1],o=u;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(u);break}o[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(c){u=[6,c],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Ho=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.")},Mt=(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 Ot(this,void 0,void 0,function(){var t,e,n,i,o,a,f,s,u,c,l,h;return Tt(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=Ho(t),i=n.next();!i.done;i=n.next())o=i.value,a=o.kind==="video"?"videoinput":o.kind,a==="videoinput"&&(f=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),u=o.groupId,c={deviceId:f,label:s,kind:a,groupId:u},e.push(c))}catch(p){l={error:p}}finally{try{i&&!i.done&&(h=n.return)&&h.call(n)}finally{if(l)throw l.error}}return[2,e]}})})},r.prototype.getVideoInputDevices=function(){return Ot(this,void 0,void 0,function(){var t;return Tt(this,function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return t=e.sent(),[2,t.map(function(n){return new Dn(n.deviceId,n.label)})]}})})},r.prototype.findDeviceById=function(t){return Ot(this,void 0,void 0,function(){var e;return Tt(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=n.sent(),e?[2,e.find(function(i){return i.deviceId===t})]:[2,null]}})})},r.prototype.decodeFromInputVideoDevice=function(t,e){return Ot(this,void 0,void 0,function(){return Tt(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 Ot(this,void 0,void 0,function(){var n,i;return Tt(this,function(o){switch(o.label){case 0:return this.reset(),t?n={deviceId:{exact:t}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,e)];case 1:return[2,o.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return Ot(this,void 0,void 0,function(){var n;return Tt(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,e)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(t,e){return Ot(this,void 0,void 0,function(){var n,i;return Tt(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 i=o.sent(),[2,i]}})})},r.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,n){return Ot(this,void 0,void 0,function(){return Tt(this,function(i){switch(i.label){case 0:return[4,this.decodeFromVideoDevice(t,e,n)];case 1:return[2,i.sent()]}})})},r.prototype.decodeFromVideoDevice=function(t,e,n){return Ot(this,void 0,void 0,function(){var i,o;return Tt(this,function(a){switch(a.label){case 0:return t?i={deviceId:{exact:t}}:i={facingMode:"environment"},o={video:i},[4,this.decodeFromConstraints(o,e,n)];case 1:return[2,a.sent()]}})})},r.prototype.decodeFromConstraints=function(t,e,n){return Ot(this,void 0,void 0,function(){var i;return Tt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return i=o.sent(),[4,this.decodeFromStream(i,e,n)];case 2:return[2,o.sent()]}})})},r.prototype.decodeFromStream=function(t,e,n){return Ot(this,void 0,void 0,function(){var i;return Tt(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return i=o.sent(),[4,this.decodeContinuously(i,n)];case 2:return[2,o.sent()]}})})},r.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},r.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},r.prototype.attachStreamToVideo=function(t,e){return Ot(this,void 0,void 0,function(){var n;return Tt(this,function(i){switch(i.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 i.sent(),[2,n]}})})},r.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise(function(n,i){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 Ot(this,void 0,void 0,function(){var e;return Tt(this,function(n){switch(n.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[3,4];case 3:return e=n.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 st("element with id '"+t+"' not found");if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new st("element with id '"+t+"' must be an "+e+" element");return n},r.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new st("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 st("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 st("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 st("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);this.imageElement=e;var n;return this.isImageLoaded(e)?n=this.decodeOnce(e,!1,!0):n=this._decodeOnLoadImage(e),n},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 st("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 st("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 st("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 st("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),i=this.decodeFromVideoElementContinuously(n,e);return n.src=t,i},r.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(n,i){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(n,i)},t.addEventListener("load",e.imageLoadedListener)})},r.prototype._decodeOnLoadVideo=function(t){return Ot(this,void 0,void 0,function(){return Tt(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 Ot(this,void 0,void 0,function(){return Tt(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 typeof t>"u"&&(e=document.createElement("img"),e.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"),e.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 i=this;e===void 0&&(e=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var o=function(a,f){if(i._stopAsyncDecode){f(new A("Video stream has ended before any code could be detected.")),i._stopAsyncDecode=void 0;return}try{var s=i.decode(t);a(s)}catch(h){var u=e&&h instanceof A,c=h instanceof j||h instanceof S,l=c&&n;if(u||l)return setTimeout(o,i._timeBetweenDecodingAttempts,a,f);f(h)}};return new Promise(function(a,f){return o(a,f)})},r.prototype.decodeContinuously=function(t,e){var n=this;this._stopContinuousDecode=!1;var i=function(){if(n._stopContinuousDecode){n._stopContinuousDecode=void 0;return}try{var o=n.decode(t);e(o,null),setTimeout(i,n.timeBetweenScansMillis)}catch(s){e(null,s);var a=s instanceof j||s instanceof S,f=s instanceof A;(a||f)&&setTimeout(i,n._timeBetweenDecodingAttempts)}};i()},r.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)},r.prototype.createBinaryBitmap=function(t){var e=this.getCaptureCanvasContext(t),n=!1;t instanceof HTMLVideoElement?(this.drawFrameOnCanvas(t),n=!0):this.drawImageOnCanvas(t);var i=this.getCaptureCanvas(t),o=new Tn(i,n),a=new ke(o);return new Le(a)},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=document.createElement("canvas"),n,i;return typeof t<"u"&&(t instanceof HTMLVideoElement?(n=t.videoWidth,i=t.videoHeight):t instanceof HTMLImageElement&&(n=t.naturalWidth||t.width,i=t.naturalHeight||t.height)),e.style.width=n+"px",e.style.height=i+"px",e.width=n,e.height=i,e},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&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&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})();var Vo=(function(){function r(t,e,n,i,o,a){n===void 0&&(n=e==null?0:8*e.length),a===void 0&&(a=V.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=n,this.resultPoints=i,this.format=o,this.timestamp=a,this.text=t,this.rawBytes=e,n==null?this.numBits=e==null?0:8*e.length:this.numBits=n,this.resultPoints=i,this.format=o,this.resultMetadata=null,a==null?this.timestamp=V.currentTimeMillis():this.timestamp=a}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);V.arraycopy(e,0,n,0,e.length),V.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})(),Z=Vo;var Fr;(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"})(Fr||(Fr={}));var C=Fr;var Lr;(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"})(Lr||(Lr={}));var ft=Lr;var Go=(function(){function r(t,e,n,i,o,a){o===void 0&&(o=-1),a===void 0&&(a=-1),this.rawBytes=t,this.text=e,this.byteSegments=n,this.ecLevel=i,this.structuredAppendSequenceNumber=o,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})(),Zt=Go;var Wo=(function(){function r(){}return r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new O;return this.logTable[t]},r.addOrSubtract=function(t,e){return t^e},r})(),le=Wo;var Xo=(function(){function r(t,e){if(e.length===0)throw new O;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var i=1;i<n&&e[i]===0;)i++;i===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-i),V.arraycopy(e,i,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=this.coefficients,n;if(t===1){n=0;for(var i=0,o=e.length;i!==o;i++){var a=e[i];n=le.addOrSubtract(n,a)}return n}n=e[0];for(var f=e.length,s=this.field,i=1;i<f;i++)n=le.addOrSubtract(s.multiply(t,n),e[i]);return n},r.prototype.addOrSubtract=function(t){if(!this.field.equals(t.field))throw new O("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 i=e;e=n,n=i}var o=new Int32Array(n.length),a=n.length-e.length;V.arraycopy(n,0,o,0,a);for(var f=a;f<n.length;f++)o[f]=le.addOrSubtract(e[f-a],n[f]);return new r(this.field,o)},r.prototype.multiply=function(t){if(!this.field.equals(t.field))throw new O("GenericGFPolys do not have same GenericGF field");if(this.isZero()||t.isZero())return this.field.getZero();for(var e=this.coefficients,n=e.length,i=t.coefficients,o=i.length,a=new Int32Array(n+o-1),f=this.field,s=0;s<n;s++)for(var u=e[s],c=0;c<o;c++)a[s+c]=le.addOrSubtract(a[s+c],f.multiply(u,i[c]));return new r(f,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,i=new Int32Array(e),o=this.coefficients,a=0;a<e;a++)i[a]=n.multiply(o[a],t);return new r(n,i)},r.prototype.multiplyByMonomial=function(t,e){if(t<0)throw new O;if(e===0)return this.field.getZero();for(var n=this.coefficients,i=n.length,o=new Int32Array(i+t),a=this.field,f=0;f<i;f++)o[f]=a.multiply(n[f],e);return new r(a,o)},r.prototype.divide=function(t){if(!this.field.equals(t.field))throw new O("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new O("Divide by 0");for(var e=this.field,n=e.getZero(),i=this,o=t.getCoefficient(t.getDegree()),a=e.inverse(o);i.getDegree()>=t.getDegree()&&!i.isZero();){var f=i.getDegree()-t.getDegree(),s=e.multiply(i.getCoefficient(i.getDegree()),a),u=t.multiplyByMonomial(f,s),c=e.buildMonomial(f,s);n=n.addOrSubtract(c),i=i.addOrSubtract(u)}return[n,i]},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 i=this.field.log(n);i===0?t+="1":i===1?t+="a":(t+="a^",t+=i)}e!==0&&(e===1?t+="x":(t+="x^",t+=e))}}return t},r})(),Bt=Xo;var zo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Zo=(function(r){zo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArithmeticException",t})($),Ue=Zo;var jo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Yo=(function(r){jo(t,r);function t(e,n,i){var o=r.call(this)||this;o.primitive=e,o.size=n,o.generatorBase=i;for(var a=new Int32Array(n),f=1,s=0;s<n;s++)a[s]=f,f*=2,f>=n&&(f^=e,f&=n-1);o.expTable=a;for(var u=new Int32Array(n),s=0;s<n-1;s++)u[a[s]]=s;return o.logTable=u,o.zero=new Bt(o,Int32Array.from([0])),o.one=new Bt(o,Int32Array.from([1])),o}return 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 O;if(n===0)return this.zero;var i=new Int32Array(e+1);return i[0]=n,new Bt(this,i)},t.prototype.inverse=function(e){if(e===0)throw new Ue;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"+M.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})(le),dt=Yo;var Ko=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Qo=(function(r){Ko(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ReedSolomonException",t})($),we=Qo;var qo=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Jo=(function(r){qo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IllegalStateException",t})($),xt=Jo;var $o=(function(){function r(t){this.field=t}return r.prototype.decode=function(t,e){for(var n=this.field,i=new Bt(n,t),o=new Int32Array(e),a=!0,f=0;f<e;f++){var s=i.evaluateAt(n.exp(f+n.getGeneratorBase()));o[o.length-1-f]=s,s!==0&&(a=!1)}if(!a)for(var u=new Bt(n,o),c=this.runEuclideanAlgorithm(n.buildMonomial(e,1),u,e),l=c[0],h=c[1],d=this.findErrorLocations(l),p=this.findErrorMagnitudes(h,d),f=0;f<d.length;f++){var v=t.length-1-n.log(d[f]);if(v<0)throw new we("Bad error location");t[v]=dt.addOrSubtract(t[v],p[f])}},r.prototype.runEuclideanAlgorithm=function(t,e,n){if(t.getDegree()<e.getDegree()){var i=t;t=e,e=i}for(var o=this.field,a=t,f=e,s=o.getZero(),u=o.getOne();f.getDegree()>=(n/2|0);){var c=a,l=s;if(a=f,s=u,a.isZero())throw new we("r_{i-1} was zero");f=c;for(var h=o.getZero(),d=a.getCoefficient(a.getDegree()),p=o.inverse(d);f.getDegree()>=a.getDegree()&&!f.isZero();){var v=f.getDegree()-a.getDegree(),g=o.multiply(f.getCoefficient(f.getDegree()),p);h=h.addOrSubtract(o.buildMonomial(v,g)),f=f.addOrSubtract(a.multiplyByMonomial(v,g))}if(u=h.multiply(s).addOrSubtract(l),f.getDegree()>=a.getDegree())throw new xt("Division algorithm failed to reduce polynomial?")}var y=u.getCoefficient(0);if(y===0)throw new we("sigmaTilde(0) was zero");var m=o.inverse(y),w=u.multiplyScalar(m),_=f.multiplyScalar(m);return[w,_]},r.prototype.findErrorLocations=function(t){var e=t.getDegree();if(e===1)return Int32Array.from([t.getCoefficient(1)]);for(var n=new Int32Array(e),i=0,o=this.field,a=1;a<o.getSize()&&i<e;a++)t.evaluateAt(a)===0&&(n[i]=o.inverse(a),i++);if(i!==e)throw new we("Error locator degree does not match number of roots");return n},r.prototype.findErrorMagnitudes=function(t,e){for(var n=e.length,i=new Int32Array(n),o=this.field,a=0;a<n;a++){for(var f=o.inverse(e[a]),s=1,u=0;u<n;u++)if(a!==u){var c=o.multiply(e[u],f),l=(c&1)===0?c|1:c&-2;s=o.multiply(s,l)}i[a]=o.multiply(t.evaluateAt(f),o.inverse(s)),o.getGeneratorBase()!==0&&(i[a]=o.multiply(i[a],f))}return i},r})(),jt=$o;var Ct;(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"})(Ct||(Ct={}));var ta=(function(){function r(){}return r.prototype.decode=function(t){this.ddata=t;var e=t.getBits(),n=this.extractBits(e),i=this.correctBits(n),o=r.convertBoolArrayToByteArray(i),a=r.getEncodedData(i),f=new Zt(o,a,null,null);return f.setNumBits(i.length),f},r.highLevelDecode=function(t){return this.getEncodedData(t)},r.getEncodedData=function(t){for(var e=t.length,n=Ct.UPPER,i=Ct.UPPER,o="",a=0;a<e;)if(i===Ct.BINARY){if(e-a<5)break;var f=r.readCode(t,a,5);if(a+=5,f===0){if(e-a<11)break;f=r.readCode(t,a,11)+31,a+=11}for(var s=0;s<f;s++){if(e-a<8){a=e;break}var u=r.readCode(t,a,8);o+=F.castAsNonUtf8Char(u),a+=8}i=n}else{var c=i===Ct.DIGIT?4:5;if(e-a<c)break;var u=r.readCode(t,a,c);a+=c;var l=r.getCharacter(i,u);l.startsWith("CTRL_")?(n=i,i=r.getTable(l.charAt(5)),l.charAt(6)==="L"&&(n=i)):(o+=l,i=n)}return o},r.getTable=function(t){switch(t){case"L":return Ct.LOWER;case"P":return Ct.PUNCT;case"M":return Ct.MIXED;case"D":return Ct.DIGIT;case"B":return Ct.BINARY;default:return Ct.UPPER}},r.getCharacter=function(t,e){switch(t){case Ct.UPPER:return r.UPPER_TABLE[e];case Ct.LOWER:return r.LOWER_TABLE[e];case Ct.MIXED:return r.MIXED_TABLE[e];case Ct.PUNCT:return r.PUNCT_TABLE[e];case Ct.DIGIT:return r.DIGIT_TABLE[e];default:throw new xt("Bad table")}},r.prototype.correctBits=function(t){var e,n;this.ddata.getNbLayers()<=2?(n=6,e=dt.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,e=dt.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,e=dt.AZTEC_DATA_10):(n=12,e=dt.AZTEC_DATA_12);var i=this.ddata.getNbDatablocks(),o=t.length/n;if(o<i)throw new S;for(var a=t.length%n,f=new Int32Array(o),s=0;s<o;s++,a+=n)f[s]=r.readCode(t,a,n);try{var u=new jt(e);u.decode(f,o-i)}catch(g){throw new S(g)}for(var c=(1<<n)-1,l=0,s=0;s<i;s++){var h=f[s];if(h===0||h===c)throw new S;(h===1||h===c-1)&&l++}for(var d=new Array(i*n-l),p=0,s=0;s<i;s++){var h=f[s];if(h===1||h===c-1)d.fill(h>1,p,p+n-1),p+=n-1;else for(var v=n-1;v>=0;--v)d[p++]=(h&1<<v)!==0}return d},r.prototype.extractBits=function(t){var e=this.ddata.isCompact(),n=this.ddata.getNbLayers(),i=(e?11:14)+n*4,o=new Int32Array(i),a=new Array(this.totalBitsInLayer(n,e));if(e)for(var f=0;f<o.length;f++)o[f]=f;else for(var s=i+1+2*M.truncDivision(M.truncDivision(i,2)-1,15),u=i/2,c=M.truncDivision(s,2),f=0;f<u;f++){var l=f+M.truncDivision(f,15);o[u-f-1]=c-l-1,o[u+f]=c+l+1}for(var f=0,h=0;f<n;f++){for(var d=(n-f)*4+(e?9:12),p=f*2,v=i-1-p,g=0;g<d;g++)for(var y=g*2,m=0;m<2;m++)a[h+y+m]=t.get(o[p+m],o[p+g]),a[h+2*d+y+m]=t.get(o[p+g],o[v-m]),a[h+4*d+y+m]=t.get(o[v-m],o[v-g]),a[h+6*d+y+m]=t.get(o[v-g],o[p+m]);h+=d*8}return a},r.readCode=function(t,e,n){for(var i=0,o=e;o<e+n;o++)i<<=1,t[o]&&(i|=1);return i},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"," ","","","","","","","\x07","\b"," ",`
5
5
  `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~","\x7F","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],r.PUNCT_TABLE=["","\r",`\r
6
- `,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],r.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],r})(),er=ta;var ea=(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,i){var o=t-n,a=e-i;return Math.sqrt(o*o+a*a)},r.sum=function(t){for(var e=0,n=0,i=t.length;n!==i;n++){var o=t[n];e+=o}return e},r})(),G=ea;var ra=(function(){function r(){}return r.floatToIntBits=function(t){return t},r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r})(),He=ra;var na=(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*He.floatToIntBits(this.x)+He.floatToIntBits(this.y)},r.prototype.toString=function(){return"("+this.x+","+this.y+")"},r.orderBestPatterns=function(t){var e=this.distance(t[0],t[1]),n=this.distance(t[1],t[2]),i=this.distance(t[0],t[2]),o,a,f;if(n>=e&&n>=i?(a=t[0],o=t[1],f=t[2]):i>=n&&i>=e?(a=t[1],o=t[0],f=t[2]):(a=t[2],o=t[0],f=t[1]),this.crossProductZ(o,a,f)<0){var s=o;o=f,f=s}t[0]=o,t[1]=a,t[2]=f},r.distance=function(t,e){return G.distance(t.x,t.y,e.x,e.y)},r.crossProductZ=function(t,e,n){var i=e.x,o=e.y;return(n.x-i)*(t.y-o)-(n.y-o)*(t.x-i)},r})(),R=na;var ia=(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})(),le=ia;var oa=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),aa=(function(r){oa(t,r);function t(e,n,i,o,a){var f=r.call(this,e,n)||this;return f.compact=i,f.nbDatablocks=o,f.nbLayers=a,f}return t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t})(le),kr=aa;var fa=(function(){function r(t,e,n,i){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),e==null&&(e=r.INIT_SIZE),n==null&&(n=t.getWidth()/2|0),i==null&&(i=t.getHeight()/2|0);var o=e/2|0;if(this.leftInit=n-o,this.rightInit=n+o,this.upInit=i-o,this.downInit=i+o,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new A}return r.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,n=this.upInit,i=this.downInit,o=!1,a=!0,f=!1,s=!1,u=!1,c=!1,h=!1,l=this.width,d=this.height;a;){a=!1;for(var p=!0;(p||!s)&&e<l;)p=this.containsBlackPoint(n,i,e,!1),p?(e++,a=!0,s=!0):s||e++;if(e>=l){o=!0;break}for(var v=!0;(v||!u)&&i<d;)v=this.containsBlackPoint(t,e,i,!0),v?(i++,a=!0,u=!0):u||i++;if(i>=d){o=!0;break}for(var g=!0;(g||!c)&&t>=0;)g=this.containsBlackPoint(n,i,t,!1),g?(t--,a=!0,c=!0):c||t--;if(t<0){o=!0;break}for(var y=!0;(y||!h)&&n>=0;)y=this.containsBlackPoint(t,e,n,!0),y?(n--,a=!0,h=!0):h||n--;if(n<0){o=!0;break}a&&(f=!0)}if(!o&&f){for(var m=e-t,w=null,_=1;w===null&&_<m;_++)w=this.getBlackPointOnSegment(t,i-_,t+_,i);if(w==null)throw new A;for(var I=null,_=1;I===null&&_<m;_++)I=this.getBlackPointOnSegment(t,n+_,t+_,n);if(I==null)throw new A;for(var T=null,_=1;T===null&&_<m;_++)T=this.getBlackPointOnSegment(e,n+_,e-_,n);if(T==null)throw new A;for(var D=null,_=1;D===null&&_<m;_++)D=this.getBlackPointOnSegment(e,i-_,e-_,i);if(D==null)throw new A;return this.centerEdges(D,w,T,I)}else throw new A},r.prototype.getBlackPointOnSegment=function(t,e,n,i){for(var o=G.round(G.distance(t,e,n,i)),a=(n-t)/o,f=(i-e)/o,s=this.image,u=0;u<o;u++){var c=G.round(t+u*a),h=G.round(e+u*f);if(s.get(c,h))return new R(c,h)}return null},r.prototype.centerEdges=function(t,e,n,i){var o=t.getX(),a=t.getY(),f=e.getX(),s=e.getY(),u=n.getX(),c=n.getY(),h=i.getX(),l=i.getY(),d=r.CORR;return o<this.width/2?[new R(h-d,l+d),new R(f+d,s+d),new R(u-d,c-d),new R(o+d,a-d)]:[new R(h+d,l+d),new R(f+d,s-d),new R(u-d,c+d),new R(o-d,a-d)]},r.prototype.containsBlackPoint=function(t,e,n,i){var o=this.image;if(i){for(var a=t;a<=e;a++)if(o.get(a,n))return!0}else for(var f=t;f<=e;f++)if(o.get(n,f))return!0;return!1},r.INIT_SIZE=10,r.CORR=1,r})(),Ae=fa;var sa=(function(){function r(){}return r.checkAndNudgePoints=function(t,e){for(var n=t.getWidth(),i=t.getHeight(),o=!0,a=0;a<e.length&&o;a+=2){var f=Math.floor(e[a]),s=Math.floor(e[a+1]);if(f<-1||f>n||s<-1||s>i)throw new A;o=!1,f===-1?(e[a]=0,o=!0):f===n&&(e[a]=n-1,o=!0),s===-1?(e[a+1]=0,o=!0):s===i&&(e[a+1]=i-1,o=!0)}o=!0;for(var a=e.length-2;a>=0&&o;a-=2){var f=Math.floor(e[a]),s=Math.floor(e[a+1]);if(f<-1||f>n||s<-1||s>i)throw new A;o=!1,f===-1?(e[a]=0,o=!0):f===n&&(e[a]=n-1,o=!0),s===-1?(e[a+1]=0,o=!0):s===i&&(e[a+1]=i-1,o=!0)}},r})(),rr=sa;var ua=(function(){function r(t,e,n,i,o,a,f,s,u){this.a11=t,this.a21=e,this.a31=n,this.a12=i,this.a22=o,this.a32=a,this.a13=f,this.a23=s,this.a33=u}return r.quadrilateralToQuadrilateral=function(t,e,n,i,o,a,f,s,u,c,h,l,d,p,v,g){var y=r.quadrilateralToSquare(t,e,n,i,o,a,f,s),m=r.squareToQuadrilateral(u,c,h,l,d,p,v,g);return m.times(y)},r.prototype.transformPoints=function(t){for(var e=t.length,n=this.a11,i=this.a12,o=this.a13,a=this.a21,f=this.a22,s=this.a23,u=this.a31,c=this.a32,h=this.a33,l=0;l<e;l+=2){var d=t[l],p=t[l+1],v=o*d+s*p+h;t[l]=(n*d+a*p+u)/v,t[l+1]=(i*d+f*p+c)/v}},r.prototype.transformPointsWithValues=function(t,e){for(var n=this.a11,i=this.a12,o=this.a13,a=this.a21,f=this.a22,s=this.a23,u=this.a31,c=this.a32,h=this.a33,l=t.length,d=0;d<l;d++){var p=t[d],v=e[d],g=o*p+s*v+h;t[d]=(n*p+a*v+u)/g,e[d]=(i*p+f*v+c)/g}},r.squareToQuadrilateral=function(t,e,n,i,o,a,f,s){var u=t-n+o-f,c=e-i+a-s;if(u===0&&c===0)return new r(n-t,o-n,t,i-e,a-i,e,0,0,1);var h=n-o,l=f-o,d=i-a,p=s-a,v=h*p-l*d,g=(u*p-l*c)/v,y=(h*c-u*d)/v;return new r(n-t+g*n,f-t+y*f,t,i-e+g*i,s-e+y*s,e,g,y,1)},r.quadrilateralToSquare=function(t,e,n,i,o,a,f,s){return r.squareToQuadrilateral(t,e,n,i,o,a,f,s).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})(),Ve=ua;var ca=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ha=(function(r){ca(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.sampleGrid=function(e,n,i,o,a,f,s,u,c,h,l,d,p,v,g,y,m,w,_){var I=Ve.quadrilateralToQuadrilateral(o,a,f,s,u,c,h,l,d,p,v,g,y,m,w,_);return this.sampleGridWithTransform(e,n,i,I)},t.prototype.sampleGridWithTransform=function(e,n,i,o){if(n<=0||i<=0)throw new A;for(var a=new at(n,i),f=new Float32Array(2*n),s=0;s<i;s++){for(var u=f.length,c=s+.5,h=0;h<u;h+=2)f[h]=h/2+.5,f[h+1]=c;o.transformPoints(f),rr.checkAndNudgePoints(e,f);try{for(var h=0;h<u;h+=2)e.get(Math.floor(f[h]),Math.floor(f[h+1]))&&a.set(h/2,s)}catch{throw new A}}return a},t})(rr),Ur=ha;var la=(function(){function r(){}return r.setGridSampler=function(t){r.gridSampler=t},r.getInstance=function(){return r.gridSampler},r.gridSampler=new Ur,r})(),de=la;var 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})();var da=(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 i=n[0];n[0]=n[2],n[2]=i}this.extractParameters(n);var o=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 kr(o,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 A;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 i=0,o=0;o<4;o++){var a=n[(this.shift+o)%4];this.compact?(i<<=7,i+=a>>1&127):(i<<=10,i+=(a>>2&992)+(a>>1&31))}var f=this.getCorrectedParameterData(i,this.compact);this.compact?(this.nbLayers=(f>>6)+1,this.nbDataBlocks=(f&63)+1):(this.nbLayers=(f>>11)+1,this.nbDataBlocks=(f&2047)+1)},r.prototype.getRotation=function(t,e){var n=0;t.forEach(function(o,a,f){var s=(o>>e-2<<1)+(o&1);n=(n<<3)+s}),n=((n&1)<<11)+(n>>1);for(var i=0;i<4;i++)if(M.bitCount(n^this.EXPECTED_CORNER_BITS[i])<=2)return i;throw new A},r.prototype.getCorrectedParameterData=function(t,e){var n,i;e?(n=7,i=2):(n=10,i=4);for(var o=n-i,a=new Int32Array(n),f=n-1;f>=0;--f)a[f]=t&15,t>>=4;try{var s=new jt(dt.AZTEC_PARAM);s.decode(a,o)}catch{throw new A}for(var u=0,f=0;f<i;f++)u=(u<<4)+a[f];return u},r.prototype.getBullsEyeCorners=function(t){var e=t,n=t,i=t,o=t,a=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var f=this.getFirstDifferent(e,a,1,-1),s=this.getFirstDifferent(n,a,1,1),u=this.getFirstDifferent(i,a,-1,1),c=this.getFirstDifferent(o,a,-1,-1);if(this.nbCenterLayers>2){var h=this.distancePoint(c,f)*this.nbCenterLayers/(this.distancePoint(o,e)*(this.nbCenterLayers+2));if(h<.75||h>1.25||!this.isWhiteOrBlackRectangle(f,s,u,c))break}e=f,n=s,i=u,o=c,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new A;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(i.getX()-.5,i.getY()+.5),v=new R(o.getX()-.5,o.getY()-.5);return this.expandSquare([l,d,p,v],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},r.prototype.getMatrixCenter=function(){var t,e,n,i;try{var o=new Ae(this.image).detect();t=o[0],e=o[1],n=o[2],i=o[3]}catch{var a=this.image.getWidth()/2,f=this.image.getHeight()/2;t=this.getFirstDifferent(new Dt(a+7,f-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Dt(a+7,f+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new Dt(a-7,f+7),!1,-1,1).toResultPoint(),i=this.getFirstDifferent(new Dt(a-7,f-7),!1,-1,-1).toResultPoint()}var s=G.round((t.getX()+i.getX()+e.getX()+n.getX())/4),u=G.round((t.getY()+i.getY()+e.getY()+n.getY())/4);try{var o=new Ae(this.image,15,s,u).detect();t=o[0],e=o[1],n=o[2],i=o[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(),i=this.getFirstDifferent(new Dt(s-7,u-7),!1,-1,-1).toResultPoint()}return s=G.round((t.getX()+i.getX()+e.getX()+n.getX())/4),u=G.round((t.getY()+i.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,i,o){var a=de.getInstance(),f=this.getDimension(),s=f/2-this.nbCenterLayers,u=f/2+this.nbCenterLayers;return a.sampleGrid(t,f,f,s,s,u,s,u,u,s,u,e.getX(),e.getY(),n.getX(),n.getY(),i.getX(),i.getY(),o.getX(),o.getY())},r.prototype.sampleLine=function(t,e,n){for(var i=0,o=this.distanceResultPoint(t,e),a=o/n,f=t.getX(),s=t.getY(),u=a*(e.getX()-t.getX())/o,c=a*(e.getY()-t.getY())/o,h=0;h<n;h++)this.image.get(G.round(f+h*u),G.round(s+h*c))&&(i|=1<<n-h-1);return i},r.prototype.isWhiteOrBlackRectangle=function(t,e,n,i){var o=3;t=new Dt(t.getX()-o,t.getY()+o),e=new Dt(e.getX()-o,e.getY()-o),n=new Dt(n.getX()+o,n.getY()-o),i=new Dt(i.getX()+o,i.getY()+o);var a=this.getColor(i,t);if(a===0)return!1;var f=this.getColor(t,e);return f!==a||(f=this.getColor(e,n),f!==a)?!1:(f=this.getColor(n,i),f===a)},r.prototype.getColor=function(t,e){for(var n=this.distancePoint(t,e),i=(e.getX()-t.getX())/n,o=(e.getY()-t.getY())/n,a=0,f=t.getX(),s=t.getY(),u=this.image.get(t.getX(),t.getY()),c=Math.ceil(n),h=0;h<c;h++)f+=i,s+=o,this.image.get(G.round(f),G.round(s))!==u&&a++;var l=a/n;return l>.1&&l<.9?0:l<=.1===u?1:-1},r.prototype.getFirstDifferent=function(t,e,n,i){for(var o=t.getX()+n,a=t.getY()+i;this.isValid(o,a)&&this.image.get(o,a)===e;)o+=n,a+=i;for(o-=n,a-=i;this.isValid(o,a)&&this.image.get(o,a)===e;)o+=n;for(o-=n;this.isValid(o,a)&&this.image.get(o,a)===e;)a+=i;return a-=i,new Dt(o,a)},r.prototype.expandSquare=function(t,e,n){var i=n/(2*e),o=t[0].getX()-t[2].getX(),a=t[0].getY()-t[2].getY(),f=(t[0].getX()+t[2].getX())/2,s=(t[0].getY()+t[2].getY())/2,u=new R(f+i*o,s+i*a),c=new R(f-i*o,s-i*a);o=t[1].getX()-t[3].getX(),a=t[1].getY()-t[3].getY(),f=(t[1].getX()+t[3].getX())/2,s=(t[1].getY()+t[3].getY())/2;var h=new R(f+i*o,s+i*a),l=new R(f-i*o,s-i*a),d=[u,h,c,l];return d},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=G.round(t.getX()),n=G.round(t.getY());return this.isValid(e,n)},r.prototype.distancePoint=function(t,e){return G.distance(t.getX(),t.getY(),e.getX(),e.getY())},r.prototype.distanceResultPoint=function(t,e){return G.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*(M.truncDivision(this.nbLayers-4,8)+1)+15},r})(),Hr=da;var pa=(function(){function r(){}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n=null,i=new Hr(t.getBlackMatrix()),o=null,a=null;try{var f=i.detectMirror(!1);o=f.getPoints(),this.reportFoundResultPoints(e,o),a=new er().decode(f)}catch(h){n=h}if(a==null)try{var f=i.detectMirror(!0);o=f.getPoints(),this.reportFoundResultPoints(e,o),a=new er().decode(f)}catch(h){throw n??h}var s=new Z(a.getText(),a.getRawBytes(),a.getNumBits(),o,C.AZTEC,V.currentTimeMillis()),u=a.getByteSegments();u!=null&&s.putMetadata(ft.BYTE_SEGMENTS,u);var c=a.getECLevel();return c!=null&&s.putMetadata(ft.ERROR_CORRECTION_LEVEL,c),s},r.prototype.reportFoundResultPoints=function(t,e){if(t!=null){var n=t.get(k.NEED_RESULT_POINT_CALLBACK);n!=null&&e.forEach(function(i,o,a){n.foundPossibleResultPoint(i)})}},r.prototype.reset=function(){},r})(),te=pa;var va=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),yh=(function(r){va(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new te,e)||this}return t})(Mt);var xa=(function(){function r(){}return r.prototype.decode=function(t,e){try{return this.doDecode(t,e)}catch{var n=e&&e.get(k.TRY_HARDER)===!0;if(n&&t.isRotateSupported()){var i=t.rotateCounterClockwise(),o=this.doDecode(i,e),a=o.getResultMetadata(),f=270;a!==null&&a.get(ft.ORIENTATION)===!0&&(f=f+a.get(ft.ORIENTATION)%360),o.putMetadata(ft.ORIENTATION,f);var s=o.getResultPoints();if(s!==null)for(var u=i.getHeight(),c=0;c<s.length;c++)s[c]=new R(u-s[c].getY()-1,s[c].getX());return o}else throw new A}},r.prototype.reset=function(){},r.prototype.doDecode=function(t,e){var n=t.getWidth(),i=t.getHeight(),o=new it(n),a=e&&e.get(k.TRY_HARDER)===!0,f=Math.max(1,i>>(a?8:5)),s;a?s=i:s=15;for(var u=Math.trunc(i/2),c=0;c<s;c++){var h=Math.trunc((c+1)/2),l=(c&1)===0,d=u+f*(l?h:-h);if(d<0||d>=i)break;try{o=t.getBlackRow(d,o)}catch{continue}for(var p=function(m){if(m===1&&(o.reverse(),e&&e.get(k.NEED_RESULT_POINT_CALLBACK)===!0)){var w=new Map;e.forEach(function(T,D){return w.set(D,T)}),w.delete(k.NEED_RESULT_POINT_CALLBACK),e=w}try{var _=v.decodeRow(d,o,e);if(m===1){_.putMetadata(ft.ORIENTATION,180);var I=_.getResultPoints();I!==null&&(I[0]=new R(n-I[0].getX()-1,I[0].getY()),I[1]=new R(n-I[1].getX()-1,I[1].getY()))}return{value:_}}catch{}},v=this,g=0;g<2;g++){var y=p(g);if(typeof y=="object")return y.value}}throw new A},r.recordPattern=function(t,e,n){for(var i=n.length,o=0;o<i;o++)n[o]=0;var a=t.getSize();if(e>=a)throw new A;for(var f=!t.get(e),s=0,u=e;u<a;){if(t.get(u)!==f)n[s]++;else{if(++s===i)break;n[s]=1,f=!f}u++}if(!(s===i||s===i-1&&u===a))throw new A},r.recordPatternInReverse=function(t,e,n){for(var i=n.length,o=t.get(e);e>0&&i>=0;)t.get(--e)!==o&&(i--,o=!o);if(i>=0)throw new A;r.recordPattern(t,e+1,n)},r.patternMatchVariance=function(t,e,n){for(var i=t.length,o=0,a=0,f=0;f<i;f++)o+=t[f],a+=e[f];if(o<a)return Number.POSITIVE_INFINITY;var s=o/a;n*=s;for(var u=0,c=0;c<i;c++){var h=t[c],l=e[c]*s,d=h>l?h-l:l-h;if(d>n)return Number.POSITIVE_INFINITY;u+=d}return u/o},r})(),q=xa;var ga=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ma=(function(r){ga(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.findStartPattern=function(e){for(var n=e.getSize(),i=e.getNextSet(0),o=0,a=Int32Array.from([0,0,0,0,0,0]),f=i,s=!1,u=6,c=i;c<n;c++)if(e.get(c)!==s)a[o]++;else{if(o===u-1){for(var h=t.MAX_AVG_VARIANCE,l=-1,d=t.CODE_START_A;d<=t.CODE_START_C;d++){var p=q.patternMatchVariance(a,t.CODE_PATTERNS[d],t.MAX_INDIVIDUAL_VARIANCE);p<h&&(h=p,l=d)}if(l>=0&&e.isRange(Math.max(0,f-(c-f)/2),f,!1))return Int32Array.from([f,c,l]);f+=a[0]+a[1],a=a.slice(2,a.length),a[o-1]=0,a[o]=0,o--}else o++;a[o]=1,s=!s}throw new A},t.decodeCode=function(e,n,i){q.recordPattern(e,i,n);for(var o=t.MAX_AVG_VARIANCE,a=-1,f=0;f<t.CODE_PATTERNS.length;f++){var s=t.CODE_PATTERNS[f],u=this.patternMatchVariance(n,s,t.MAX_INDIVIDUAL_VARIANCE);u<o&&(o=u,a=f)}if(a>=0)return a;throw new A},t.prototype.decodeRow=function(e,n,i){var o=i&&i.get(k.ASSUME_GS1)===!0,a=t.findStartPattern(n),f=a[2],s=0,u=new Uint8Array(20);u[s++]=f;var c;switch(f){case t.CODE_START_A:c=t.CODE_CODE_A;break;case t.CODE_START_B:c=t.CODE_CODE_B;break;case t.CODE_START_C:c=t.CODE_CODE_C;break;default:throw new S}for(var h=!1,l=!1,d="",p=a[0],v=a[1],g=Int32Array.from([0,0,0,0,0,0]),y=0,m=0,w=f,_=0,I=!0,T=!1,D=!1;!h;){var b=l;switch(l=!1,y=m,m=t.decodeCode(n,g,v),u[s++]=m,m!==t.CODE_STOP&&(I=!0),m!==t.CODE_STOP&&(_++,w+=_*m),p=v,v+=g.reduce(function(Rr,Nr){return Rr+Nr},0),m){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new S}switch(c){case t.CODE_CODE_A:if(m<64)D===T?d+=String.fromCharCode(32+m):d+=String.fromCharCode(32+m+128),D=!1;else if(m<96)D===T?d+=String.fromCharCode(m-64):d+=String.fromCharCode(m+64),D=!1;else switch(m!==t.CODE_STOP&&(I=!1),m){case t.CODE_FNC_1:o&&(d.length===0?d+="]C1":d+="");break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!T&&D?(T=!0,D=!1):T&&D?(T=!1,D=!1):D=!0;break;case t.CODE_SHIFT:l=!0,c=t.CODE_CODE_B;break;case t.CODE_CODE_B:c=t.CODE_CODE_B;break;case t.CODE_CODE_C:c=t.CODE_CODE_C;break;case t.CODE_STOP:h=!0;break}break;case t.CODE_CODE_B:if(m<96)D===T?d+=String.fromCharCode(32+m):d+=String.fromCharCode(32+m+128),D=!1;else switch(m!==t.CODE_STOP&&(I=!1),m){case t.CODE_FNC_1:o&&(d.length===0?d+="]C1":d+="");break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!T&&D?(T=!0,D=!1):T&&D?(T=!1,D=!1):D=!0;break;case t.CODE_SHIFT:l=!0,c=t.CODE_CODE_A;break;case t.CODE_CODE_A:c=t.CODE_CODE_A;break;case t.CODE_CODE_C:c=t.CODE_CODE_C;break;case t.CODE_STOP:h=!0;break}break;case t.CODE_CODE_C:if(m<100)m<10&&(d+="0"),d+=m;else switch(m!==t.CODE_STOP&&(I=!1),m){case t.CODE_FNC_1:o&&(d.length===0?d+="]C1":d+="");break;case t.CODE_CODE_A:c=t.CODE_CODE_A;break;case t.CODE_CODE_B:c=t.CODE_CODE_B;break;case t.CODE_STOP:h=!0;break}break}b&&(c=c===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var L=v-p;if(v=n.getNextUnset(v),!n.isRange(v,Math.min(n.getSize(),v+(v-p)/2),!1))throw new A;if(w-=_*y,w%103!==y)throw new j;var B=d.length;if(B===0)throw new A;B>0&&I&&(c===t.CODE_CODE_C?d=d.substring(0,B-2):d=d.substring(0,B-1));for(var vt=(a[1]+a[0])/2,z=p+L/2,ut=u.length,Pt=new Uint8Array(ut),$t=0;$t<ut;$t++)Pt[$t]=u[$t];var Dr=[new R(vt,e),new R(z,e)];return new Z(d,Pt,0,Dr,C.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})(q),nr=ma;var ya=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Vr=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.")},wa=(function(r){ya(t,r);function t(e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=r.call(this)||this;return i.usingCheckDigit=e,i.extendedMode=n,i.decodeRowResult="",i.counters=new Int32Array(9),i}return t.prototype.decodeRow=function(e,n,i){var o,a,f,s,u=this.counters;u.fill(0),this.decodeRowResult="";var c=t.findAsteriskPattern(n,u),h=n.getNextSet(c[1]),l=n.getSize(),d,p;do{t.recordPattern(n,h,u);var v=t.toNarrowWidePattern(u);if(v<0)throw new A;d=t.patternToChar(v),this.decodeRowResult+=d,p=h;try{for(var g=(o=void 0,Vr(u)),y=g.next();!y.done;y=g.next()){var m=y.value;h+=m}}catch(ut){o={error:ut}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}h=n.getNextSet(h)}while(d!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var w=0;try{for(var _=Vr(u),I=_.next();!I.done;I=_.next()){var m=I.value;w+=m}}catch(ut){f={error:ut}}finally{try{I&&!I.done&&(s=_.return)&&s.call(_)}finally{if(f)throw f.error}}var T=h-p-w;if(h!==l&&T*2<w)throw new A;if(this.usingCheckDigit){for(var D=this.decodeRowResult.length-1,b=0,L=0;L<D;L++)b+=t.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(L));if(this.decodeRowResult.charAt(D)!==t.ALPHABET_STRING.charAt(b%43))throw new j;this.decodeRowResult=this.decodeRowResult.substring(0,D)}if(this.decodeRowResult.length===0)throw new A;var B;this.extendedMode?B=t.decodeExtended(this.decodeRowResult):B=this.decodeRowResult;var vt=(c[1]+c[0])/2,z=p+w/2;return new Z(B,null,0,[new R(vt,e),new R(z,e)],C.CODE_39,new Date().getTime())},t.findAsteriskPattern=function(e,n){for(var i=e.getSize(),o=e.getNextSet(0),a=0,f=o,s=!1,u=n.length,c=o;c<i;c++)if(e.get(c)!==s)n[a]++;else{if(a===u-1){if(this.toNarrowWidePattern(n)===t.ASTERISK_ENCODING&&e.isRange(Math.max(0,f-Math.floor((c-f)/2)),f,!1))return[f,c];f+=n[0]+n[1],n.copyWithin(0,2,2+a-1),n[a-1]=0,n[a]=0,a--}else a++;n[a]=1,s=!s}throw new A},t.toNarrowWidePattern=function(e){var n,i,o=e.length,a=0,f;do{var s=2147483647;try{for(var u=(n=void 0,Vr(e)),c=u.next();!c.done;c=u.next()){var h=c.value;h<s&&h>a&&(s=h)}}catch(v){n={error:v}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}a=s,f=0;for(var l=0,d=0,p=0;p<o;p++){var h=e[p];h>a&&(d|=1<<o-1-p,f++,l+=h)}if(f===3){for(var p=0;p<o&&f>0;p++){var h=e[p];if(h>a&&(f--,h*2>=l))return-1}return d}}while(f>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 A},t.decodeExtended=function(e){for(var n=e.length,i="",o=0;o<n;o++){var a=e.charAt(o);if(a==="+"||a==="$"||a==="%"||a==="/"){var f=e.charAt(o+1),s="\0";switch(a){case"+":if(f>="A"&&f<="Z")s=String.fromCharCode(f.charCodeAt(0)+32);else throw new S;break;case"$":if(f>="A"&&f<="Z")s=String.fromCharCode(f.charCodeAt(0)-64);else throw new S;break;case"%":if(f>="A"&&f<="E")s=String.fromCharCode(f.charCodeAt(0)-38);else if(f>="F"&&f<="J")s=String.fromCharCode(f.charCodeAt(0)-11);else if(f>="K"&&f<="O")s=String.fromCharCode(f.charCodeAt(0)+16);else if(f>="P"&&f<="T")s=String.fromCharCode(f.charCodeAt(0)+43);else if(f==="U")s="\0";else if(f==="V")s="@";else if(f==="W")s="`";else if(f==="X"||f==="Y"||f==="Z")s="\x7F";else throw new S;break;case"/":if(f>="A"&&f<="O")s=String.fromCharCode(f.charCodeAt(0)-32);else if(f==="Z")s=":";else throw new S;break}i+=s,o++}else i+=a}return i},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})(q),ir=wa;var Aa=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),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.")},Ea=(function(r){Aa(t,r);function t(){var e=r.call(this)||this;return e.decodeRowResult="",e.counters=new Int32Array(6),e}return t.prototype.decodeRow=function(e,n,i){var o,a,f,s,u=this.findAsteriskPattern(n),c=n.getNextSet(u[1]),h=n.getSize(),l=this.counters;l.fill(0),this.decodeRowResult="";var d,p;do{t.recordPattern(n,c,l);var v=this.toPattern(l);if(v<0)throw new A;d=this.patternToChar(v),this.decodeRowResult+=d,p=c;try{for(var g=(o=void 0,Gr(l)),y=g.next();!y.done;y=g.next()){var m=y.value;c+=m}}catch(L){o={error:L}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}c=n.getNextSet(c)}while(d!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var w=0;try{for(var _=Gr(l),I=_.next();!I.done;I=_.next()){var m=I.value;w+=m}}catch(L){f={error:L}}finally{try{I&&!I.done&&(s=_.return)&&s.call(_)}finally{if(f)throw f.error}}if(c===h||!n.get(c))throw new A;if(this.decodeRowResult.length<2)throw new A;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var T=this.decodeExtended(this.decodeRowResult),D=(u[1]+u[0])/2,b=p+w/2;return new Z(T,null,0,[new R(D,e),new R(b,e)],C.CODE_93,new Date().getTime())},t.prototype.findAsteriskPattern=function(e){var n=e.getSize(),i=e.getNextSet(0);this.counters.fill(0);for(var o=this.counters,a=i,f=!1,s=o.length,u=0,c=i;c<n;c++)if(e.get(c)!==f)o[u]++;else{if(u===s-1){if(this.toPattern(o)===t.ASTERISK_ENCODING)return new Int32Array([a,c]);a+=o[0]+o[1],o.copyWithin(0,2,2+u-1),o[u-1]=0,o[u]=0,u--}else u++;o[u]=1,f=!f}throw new A},t.prototype.toPattern=function(e){var n,i,o=0;try{for(var a=Gr(e),f=a.next();!f.done;f=a.next()){var s=f.value;o+=s}}catch(p){n={error:p}}finally{try{f&&!f.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}for(var u=0,c=e.length,h=0;h<c;h++){var l=Math.round(e[h]*9/o);if(l<1||l>4)return-1;if((h&1)===0)for(var d=0;d<l;d++)u=u<<1|1;else u<<=l}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 A},t.prototype.decodeExtended=function(e){for(var n=e.length,i="",o=0;o<n;o++){var a=e.charAt(o);if(a>="a"&&a<="d"){if(o>=n-1)throw new S;var f=e.charAt(o+1),s="\0";switch(a){case"d":if(f>="A"&&f<="Z")s=String.fromCharCode(f.charCodeAt(0)+32);else throw new S;break;case"a":if(f>="A"&&f<="Z")s=String.fromCharCode(f.charCodeAt(0)-64);else throw new S;break;case"b":if(f>="A"&&f<="E")s=String.fromCharCode(f.charCodeAt(0)-38);else if(f>="F"&&f<="J")s=String.fromCharCode(f.charCodeAt(0)-11);else if(f>="K"&&f<="O")s=String.fromCharCode(f.charCodeAt(0)+16);else if(f>="P"&&f<="T")s=String.fromCharCode(f.charCodeAt(0)+43);else if(f==="U")s="\0";else if(f==="V")s="@";else if(f==="W")s="`";else if(f>="X"&&f<="Z")s="\x7F";else throw new S;break;case"c":if(f>="A"&&f<="O")s=String.fromCharCode(f.charCodeAt(0)-32);else if(f==="Z")s=":";else throw new S;break}i+=s,o++}else i+=a}return i},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,i){for(var o=1,a=0,f=n-1;f>=0;f--)a+=o*t.ALPHABET_STRING.indexOf(e.charAt(f)),++o>i&&(o=1);if(e.charAt(n)!==t.ALPHABET_STRING[a%47])throw new j},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})(q),or=Ea;var _a=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ca=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.")},Ia=(function(r){_a(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return t.prototype.decodeRow=function(e,n,i){var o,a,f=this.decodeStart(n),s=this.decodeEnd(n),u=new P;t.decodeMiddle(n,f[1],s[0],u);var c=u.toString(),h=null;i!=null&&(h=i.get(k.ALLOWED_LENGTHS)),h==null&&(h=t.DEFAULT_ALLOWED_LENGTHS);var l=c.length,d=!1,p=0;try{for(var v=Ca(h),g=v.next();!g.done;g=v.next()){var y=g.value;if(l===y){d=!0;break}y>p&&(p=y)}}catch(_){o={error:_}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}if(!d&&l>p&&(d=!0),!d)throw new S;var m=[new R(f[1],e),new R(s[0],e)],w=new Z(c,null,0,m,C.ITF,new Date().getTime());return w},t.decodeMiddle=function(e,n,i,o){var a=new Int32Array(10),f=new Int32Array(5),s=new Int32Array(5);for(a.fill(0),f.fill(0),s.fill(0);n<i;){q.recordPattern(e,n,a);for(var u=0;u<5;u++){var c=2*u;f[u]=a[c],s[u]=a[c+1]}var h=t.decodeDigit(f);o.append(h.toString()),h=this.decodeDigit(s),o.append(h.toString()),a.forEach(function(l){n+=l})}},t.prototype.decodeStart=function(e){var n=t.skipWhiteSpace(e),i=t.findGuardPattern(e,n,t.START_PATTERN);return this.narrowLineWidth=(i[1]-i[0])/4,this.validateQuietZone(e,i[0]),i},t.prototype.validateQuietZone=function(e,n){var i=this.narrowLineWidth*10;i=i<n?i:n;for(var o=n-1;i>0&&o>=0&&!e.get(o);o--)i--;if(i!==0)throw new A},t.skipWhiteSpace=function(e){var n=e.getSize(),i=e.getNextSet(0);if(i===n)throw new A;return i},t.prototype.decodeEnd=function(e){e.reverse();try{var n=t.skipWhiteSpace(e),i=void 0;try{i=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[0])}catch(a){a instanceof A&&(i=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,i[0]);var o=i[0];return i[0]=e.getSize()-i[1],i[1]=e.getSize()-o,i}finally{e.reverse()}},t.findGuardPattern=function(e,n,i){var o=i.length,a=new Int32Array(o),f=e.getSize(),s=!1,u=0,c=n;a.fill(0);for(var h=n;h<f;h++)if(e.get(h)!==s)a[u]++;else{if(u===o-1){if(q.patternMatchVariance(a,i,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return[c,h];c+=a[0]+a[1],V.arraycopy(a,2,a,0,u-1),a[u-1]=0,a[u]=0,u--}else u++;a[u]=1,s=!s}throw new A},t.decodeDigit=function(e){for(var n=t.MAX_AVG_VARIANCE,i=-1,o=t.PATTERNS.length,a=0;a<o;a++){var f=t.PATTERNS[a],s=q.patternMatchVariance(e,f,t.MAX_INDIVIDUAL_VARIANCE);s<n?(n=s,i=a):s===n&&(i=-1)}if(i>=0)return i%10;throw new A},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})(q),ar=Ia;var Sa=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Oa=(function(r){Sa(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return t.findStartGuardPattern=function(e){for(var n=!1,i,o=0,a=Int32Array.from([0,0,0]);!n;){a=Int32Array.from([0,0,0]),i=t.findGuardPattern(e,o,!1,this.START_END_PATTERN,a);var f=i[0];o=i[1];var s=f-(o-f);s>=0&&(n=e.isRange(s,f,!1))}return i},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var i=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===i},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,i=0,o=n-1;o>=0;o-=2){var a=e.charAt(o).charCodeAt(0)-48;if(a<0||a>9)throw new S;i+=a}i*=3;for(var o=n-2;o>=0;o-=2){var a=e.charAt(o).charCodeAt(0)-48;if(a<0||a>9)throw new S;i+=a}return(1e3-i)%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,i,o){return this.findGuardPattern(e,n,i,o,new Int32Array(o.length))},t.findGuardPattern=function(e,n,i,o,a){var f=e.getSize();n=i?e.getNextUnset(n):e.getNextSet(n);for(var s=0,u=n,c=o.length,h=i,l=n;l<f;l++)if(e.get(l)!==h)a[s]++;else{if(s===c-1){if(q.patternMatchVariance(a,o,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return Int32Array.from([u,l]);u+=a[0]+a[1];for(var d=a.slice(2,a.length),p=0;p<s-1;p++)a[p]=d[p];a[s-1]=0,a[s]=0,s--}else s++;a[s]=1,h=!h}throw new A},t.decodeDigit=function(e,n,i,o){this.recordPattern(e,i,n);for(var a=this.MAX_AVG_VARIANCE,f=-1,s=o.length,u=0;u<s;u++){var c=o[u],h=q.patternMatchVariance(n,c,t.MAX_INDIVIDUAL_VARIANCE);h<a&&(a=h,f=u)}if(f>=0)return f;throw new A},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})(q),Wt=Oa;var Ta=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.")},Da=(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 i=this.decodeRowStringBuffer,o=this.decodeMiddle(e,n,i),a=i.toString(),f=r.parseExtensionString(a),s=[new R((n[0]+n[1])/2,t),new R(o,t)],u=new Z(a,null,0,s,C.UPC_EAN_EXTENSION,new Date().getTime());return f!=null&&u.putAllMetadata(f),u},r.prototype.decodeMiddle=function(t,e,n){var i,o,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var f=t.getSize(),s=e[1],u=0,c=0;c<5&&s<f;c++){var h=Wt.decodeDigit(t,a,s,Wt.L_AND_G_PATTERNS);n+=String.fromCharCode(48+h%10);try{for(var l=(i=void 0,Ta(a)),d=l.next();!d.done;d=l.next()){var p=d.value;s+=p}}catch(g){i={error:g}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}h>=10&&(u|=1<<4-c),c!==4&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(n.length!==5)throw new A;var v=this.determineCheckDigit(u);if(r.extensionChecksum(n.toString())!==v)throw new A;return s},r.extensionChecksum=function(t){for(var e=t.length,n=0,i=e-2;i>=0;i-=2)n+=t.charAt(i).charCodeAt(0)-48;n*=3;for(var i=e-1;i>=0;i-=2)n+=t.charAt(i).charCodeAt(0)-48;return n*=3,n%10},r.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new A},r.parseExtensionString=function(t){if(t.length!==5)return null;var e=r.parseExtension5String(t);return e==null?null:new Map([[ft.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="";break}var n=parseInt(t.substring(1)),i=(n/100).toString(),o=n%100,a=o<10?"0"+o:o.toString();return e+i+"."+a},r})(),Rn=Da;var Ra=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.")},Na=(function(){function r(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(t,e,n){var i=this.decodeRowStringBuffer,o=this.decodeMiddle(e,n,i),a=i.toString(),f=r.parseExtensionString(a),s=[new R((n[0]+n[1])/2,t),new R(o,t)],u=new Z(a,null,0,s,C.UPC_EAN_EXTENSION,new Date().getTime());return f!=null&&u.putAllMetadata(f),u},r.prototype.decodeMiddle=function(t,e,n){var i,o,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var f=t.getSize(),s=e[1],u=0,c=0;c<2&&s<f;c++){var h=Wt.decodeDigit(t,a,s,Wt.L_AND_G_PATTERNS);n+=String.fromCharCode(48+h%10);try{for(var l=(i=void 0,Ra(a)),d=l.next();!d.done;d=l.next()){var p=d.value;s+=p}}catch(v){i={error:v}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}h>=10&&(u|=1<<1-c),c!==1&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(n.length!==2)throw new A;if(parseInt(n.toString())%4!==u)throw new A;return s},r.parseExtensionString=function(t){return t.length!==2?null:new Map([[ft.ISSUE_NUMBER,parseInt(t)]])},r})(),Nn=Na;var ba=(function(){function r(){}return r.decodeRow=function(t,e,n){var i=Wt.findGuardPattern(e,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{var o=new Rn;return o.decodeRow(t,e,i)}catch{var a=new Nn;return a.decodeRow(t,e,i)}},r.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),r})(),bn=ba;var Pa=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ma=(function(r){Pa(t,r);function t(){var e=r.call(this)||this;e.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(f){return Int32Array.from(f)});for(var n=10;n<20;n++){for(var i=t.L_PATTERNS[n-10],o=new Int32Array(i.length),a=0;a<i.length;a++)o[a]=i[i.length-a-1];t.L_AND_G_PATTERNS[n]=o}return e}return t.prototype.decodeRow=function(e,n,i){var o=t.findStartGuardPattern(n),a=i==null?null:i.get(k.NEED_RESULT_POINT_CALLBACK);if(a!=null){var f=new R((o[0]+o[1])/2,e);a.foundPossibleResultPoint(f)}var s=this.decodeMiddle(n,o,this.decodeRowStringBuffer),u=s.rowOffset,c=s.resultString;if(a!=null){var h=new R(u,e);a.foundPossibleResultPoint(h)}var l=t.decodeEnd(n,u);if(a!=null){var d=new R((l[0]+l[1])/2,e);a.foundPossibleResultPoint(d)}var p=l[1],v=p+(p-l[0]);if(v>=n.getSize()||!n.isRange(p,v,!1))throw new A;var g=c.toString();if(g.length<8)throw new S;if(!t.checkChecksum(g))throw new j;var y=(o[1]+o[0])/2,m=(l[1]+l[0])/2,w=this.getBarcodeFormat(),_=[new R(y,e),new R(m,e)],I=new Z(g,null,0,_,w,new Date().getTime()),T=0;try{var D=bn.decodeRow(e,n,l[1]);I.putMetadata(ft.UPC_EAN_EXTENSION,D.getText()),I.putAllMetadata(D.getResultMetadata()),I.addResultPoints(D.getResultPoints()),T=D.getText().length}catch{}var b=i==null?null:i.get(k.ALLOWED_EAN_EXTENSIONS);if(b!=null){var L=!1;for(var B in b)if(T.toString()===B){L=!0;break}if(!L)throw new A}return w===C.EAN_13||C.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 i=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===i},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,i=0,o=n-1;o>=0;o-=2){var a=e.charAt(o).charCodeAt(0)-48;if(a<0||a>9)throw new S;i+=a}i*=3;for(var o=n-2;o>=0;o-=2){var a=e.charAt(o).charCodeAt(0)-48;if(a<0||a>9)throw new S;i+=a}return(1e3-i)%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})(Wt),ct=Ma;var Ba=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Pn=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.")},Fa=(function(r){Ba(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return t.prototype.decodeMiddle=function(e,n,i){var o,a,f,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=e.getSize(),h=n[1],l=0,d=0;d<6&&h<c;d++){var p=ct.decodeDigit(e,u,h,ct.L_AND_G_PATTERNS);i+=String.fromCharCode(48+p%10);try{for(var v=(o=void 0,Pn(u)),g=v.next();!g.done;g=v.next()){var y=g.value;h+=y}}catch(I){o={error:I}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}p>=10&&(l|=1<<5-d)}i=t.determineFirstDigit(i,l);var m=ct.findGuardPattern(e,h,!0,ct.MIDDLE_PATTERN,new Int32Array(ct.MIDDLE_PATTERN.length).fill(0));h=m[1];for(var d=0;d<6&&h<c;d++){var p=ct.decodeDigit(e,u,h,ct.L_PATTERNS);i+=String.fromCharCode(48+p);try{for(var w=(f=void 0,Pn(u)),_=w.next();!_.done;_=w.next()){var y=_.value;h+=y}}catch(D){f={error:D}}finally{try{_&&!_.done&&(s=w.return)&&s.call(w)}finally{if(f)throw f.error}}}return{rowOffset:h,resultString:i}},t.prototype.getBarcodeFormat=function(){return C.EAN_13},t.determineFirstDigit=function(e,n){for(var i=0;i<10;i++)if(n===this.FIRST_DIGIT_ENCODINGS[i])return e=String.fromCharCode(48+i)+e,e;throw new A},t.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],t})(ct),Ee=Fa;var La=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),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.")},ka=(function(r){La(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return t.prototype.decodeMiddle=function(e,n,i){var o,a,f,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=e.getSize(),h=n[1],l=0;l<4&&h<c;l++){var d=ct.decodeDigit(e,u,h,ct.L_PATTERNS);i+=String.fromCharCode(48+d);try{for(var p=(o=void 0,Mn(u)),v=p.next();!v.done;v=p.next()){var g=v.value;h+=g}}catch(_){o={error:_}}finally{try{v&&!v.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}}var y=ct.findGuardPattern(e,h,!0,ct.MIDDLE_PATTERN,new Int32Array(ct.MIDDLE_PATTERN.length).fill(0));h=y[1];for(var l=0;l<4&&h<c;l++){var d=ct.decodeDigit(e,u,h,ct.L_PATTERNS);i+=String.fromCharCode(48+d);try{for(var m=(f=void 0,Mn(u)),w=m.next();!w.done;w=m.next()){var g=w.value;h+=g}}catch(T){f={error:T}}finally{try{w&&!w.done&&(s=m.return)&&s.call(m)}finally{if(f)throw f.error}}}return{rowOffset:h,resultString:i}},t.prototype.getBarcodeFormat=function(){return C.EAN_8},t})(ct),Wr=ka;var Ua=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ha=(function(r){Ua(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.ean13Reader=new Ee,e}return t.prototype.getBarcodeFormat=function(){return C.UPC_A},t.prototype.decode=function(e,n){return this.maybeReturnResult(this.ean13Reader.decode(e))},t.prototype.decodeRow=function(e,n,i){return this.maybeReturnResult(this.ean13Reader.decodeRow(e,n,i))},t.prototype.decodeMiddle=function(e,n,i){return this.ean13Reader.decodeMiddle(e,n,i)},t.prototype.maybeReturnResult=function(e){var n=e.getText();if(n.charAt(0)==="0"){var i=new Z(n.substring(1),null,null,e.getResultPoints(),C.UPC_A);return e.getResultMetadata()!=null&&i.putAllMetadata(e.getResultMetadata()),i}else throw new A},t.prototype.reset=function(){this.ean13Reader.reset()},t})(ct),Xr=Ha;var Va=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ga=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.")},Wa=(function(r){Va(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return t.prototype.decodeMiddle=function(e,n,i){var o,a,f=this.decodeMiddleCounters.map(function(g){return g});f[0]=0,f[1]=0,f[2]=0,f[3]=0;for(var s=e.getSize(),u=n[1],c=0,h=0;h<6&&u<s;h++){var l=t.decodeDigit(e,f,u,t.L_AND_G_PATTERNS);i+=String.fromCharCode(48+l%10);try{for(var d=(o=void 0,Ga(f)),p=d.next();!p.done;p=d.next()){var v=p.value;u+=v}}catch(g){o={error:g}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}l>=10&&(c|=1<<5-h)}return t.determineNumSysAndCheckDigit(new P(i),c),u},t.prototype.decodeEnd=function(e,n){return t.findGuardPatternWithoutCounters(e,n,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return ct.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,n){for(var i=0;i<=1;i++)for(var o=0;o<10;o++)if(n===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[i][o]){e.insert(0,"0"+i),e.append("0"+o);return}throw A.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return C.UPC_E},t.convertUPCEtoUPCA=function(e){var n=e.slice(1,7).split("").map(function(a){return a.charCodeAt(0)}),i=new P;i.append(e.charAt(0));var o=n[5];switch(o){case 0:case 1:case 2:i.appendChars(n,0,2),i.append(o),i.append("0000"),i.appendChars(n,2,3);break;case 3:i.appendChars(n,0,3),i.append("00000"),i.appendChars(n,3,2);break;case 4:i.appendChars(n,0,4),i.append("00000"),i.append(n[4]);break;default:i.appendChars(n,0,5),i.append("0000"),i.append(o);break}return e.length>=8&&i.append(e.charAt(7)),i.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})(ct),zr=Wa;var Xa=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}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.")},za=(function(r){Xa(t,r);function t(e){var n=r.call(this)||this,i=e==null?null:e.get(k.POSSIBLE_FORMATS),o=[];return i!=null&&(i.indexOf(C.EAN_13)>-1&&o.push(new Ee),i.indexOf(C.UPC_A)>-1&&o.push(new Xr),i.indexOf(C.EAN_8)>-1&&o.push(new Wr),i.indexOf(C.UPC_E)>-1&&o.push(new zr)),o.length===0&&(o.push(new Ee),o.push(new Xr),o.push(new Wr),o.push(new zr)),n.readers=o,n}return t.prototype.decodeRow=function(e,n,i){var o,a;try{for(var f=Bn(this.readers),s=f.next();!s.done;s=f.next()){var u=s.value;try{var c=u.decodeRow(e,n,i),h=c.getBarcodeFormat()===C.EAN_13&&c.getText().charAt(0)==="0",l=i==null?null:i.get(k.POSSIBLE_FORMATS),d=l==null||l.includes(C.UPC_A);if(h&&d){var p=c.getRawBytes(),v=new Z(c.getText().substring(1),p,p?p.length:null,c.getResultPoints(),C.UPC_A);return v.putAllMetadata(c.getResultMetadata()),v}return c}catch{}}}catch(g){o={error:g}}finally{try{s&&!s.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}throw new A},t.prototype.reset=function(){var e,n;try{for(var i=Bn(this.readers),o=i.next();!o.done;o=i.next()){var a=o.value;a.reset()}}catch(f){e={error:f}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t})(q),fr=za;var Za=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ja=(function(r){Za(t,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 t.prototype.decodeRow=function(e,n,i){var o=this.getValidRowData(n);if(!o)throw new A;var a=this.codaBarDecodeRow(o.row);if(!a)throw new A;return new Z(a,null,0,[new R(o.left,e),new R(o.right,e)],C.CODABAR,new Date().getTime())},t.prototype.getValidRowData=function(e){var n=e.toArray(),i=n.indexOf(!0);if(i===-1)return null;var o=n.lastIndexOf(!0);if(o<=i)return null;n=n.slice(i,o+1);for(var a=[],f=n[0],s=1,u=1;u<n.length;u++)n[u]===f?s++:(f=n[u],a.push(s),s=1);return a.push(s),a.length<23&&(a.length+1)%8!==0?null:{row:a,left:i,right:o}},t.prototype.codaBarDecodeRow=function(e){for(var n=[],i=Math.ceil(e.reduce(function(s,u){return(s+u)/2},0));e.length>0;){var o=e.splice(0,8).splice(0,7),a=o.map(function(s){return s<i?"n":"w"}).join("");if(this.CODA_BAR_CHAR_SET[a]===void 0)return null;n.push(this.CODA_BAR_CHAR_SET[a])}var f=n.join("");return this.validCodaBarString(f)?f:null},t.prototype.validCodaBarString=function(e){var n=/^[A-D].{1,}[A-D]$/;return n.test(e)},t})(q),Zr=ja;var Ya=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ka=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.")},Qa=(function(r){Ya(t,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 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 i=0;i<n.length;i++)if(q.patternMatchVariance(e,n[i],t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return i;throw new A},t.count=function(e){return G.sum(new Int32Array(e))},t.increment=function(e,n){for(var i=0,o=n[0],a=1;a<e.length;a++)n[a]>o&&(o=n[a],i=a);e[i]++},t.decrement=function(e,n){for(var i=0,o=n[0],a=1;a<e.length;a++)n[a]<o&&(o=n[a],i=a);e[i]--},t.isFinderPattern=function(e){var n,i,o=e[0]+e[1],a=o+e[2]+e[3],f=o/a;if(f>=t.MIN_FINDER_PATTERN_RATIO&&f<=t.MAX_FINDER_PATTERN_RATIO){var s=Number.MAX_SAFE_INTEGER,u=Number.MIN_SAFE_INTEGER;try{for(var c=Ka(e),h=c.next();!h.done;h=c.next()){var l=h.value;l>u&&(u=l),l<s&&(s=l)}}catch(d){n={error:d}}finally{try{h&&!h.done&&(i=c.return)&&i.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})(q),Yt=Qa;var qa=(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})(),pe=qa;var Ja=(function(){function r(t,e,n,i,o){this.value=t,this.startEnd=e,this.value=t,this.startEnd=e,this.resultPoints=new Array,this.resultPoints.push(new R(n,o)),this.resultPoints.push(new R(i,o))}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})(),sr=Ja;var $a=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.")},tf=(function(){function r(){}return r.getRSSvalue=function(t,e,n){var i,o,a=0;try{for(var f=$a(t),s=f.next();!s.done;s=f.next()){var u=s.value;a+=u}}catch(m){i={error:m}}finally{try{s&&!s.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}for(var c=0,h=0,l=t.length,d=0;d<l-1;d++){var p=void 0;for(p=1,h|=1<<d;p<t[d];p++,h&=~(1<<d)){var v=r.combins(a-p-1,l-d-2);if(n&&h===0&&a-p-(l-d-1)>=l-d-1&&(v-=r.combins(a-p-(l-d),l-d-2)),l-d-1>1){for(var g=0,y=a-p-(l-d-2);y>e;y--)g+=r.combins(a-p-y-1,l-d-3);v-=g*(l-1-d)}else a-p>e&&v--;c+=v}a-=p}return c},r.combins=function(t,e){var n,i;t-e>e?(i=e,n=t-e):(i=t-e,n=e);for(var o=1,a=1,f=t;f>n;f--)o*=f,a<=i&&(o/=a,a++);for(;a<=i;)o/=a,a++;return o},r})(),ee=tf;var ef=(function(){function r(){}return r.buildBitArray=function(t){var e=t.length*2-1;t[t.length-1].getRightChar()==null&&(e-=1);for(var n=12*e,i=new it(n),o=0,a=t[0],f=a.getRightChar().getValue(),s=11;s>=0;--s)(f&1<<s)!==0&&i.set(o),o++;for(var s=1;s<t.length;++s){for(var u=t[s],c=u.getLeftChar().getValue(),h=11;h>=0;--h)(c&1<<h)!==0&&i.set(o),o++;if(u.getRightChar()!==null)for(var l=u.getRightChar().getValue(),h=11;h>=0;--h)(l&1<<h)!==0&&i.set(o),o++}return i},r})(),Fn=ef;var rf=(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})(),re=rf;var nf=(function(){function r(t){this.newPosition=t}return r.prototype.getNewPosition=function(){return this.newPosition},r})(),_e=nf;var of=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),af=(function(r){of(t,r);function t(e,n){var i=r.call(this,e)||this;return i.value=n,i}return t.prototype.getValue=function(){return this.value},t.prototype.isFNC1=function(){return this.value===t.FNC1},t.FNC1="$",t})(_e),Ft=af;var ff=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),sf=(function(r){ff(t,r);function t(e,n,i){var o=r.call(this,e)||this;return i?(o.remaining=!0,o.remainingValue=o.remainingValue):(o.remaining=!1,o.remainingValue=0),o.newString=n,o}return t.prototype.getNewString=function(){return this.newString},t.prototype.isRemaining=function(){return this.remaining},t.prototype.getRemainingValue=function(){return this.remainingValue},t})(_e),ne=sf;var uf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),cf=(function(r){uf(t,r);function t(e,n,i){var o=r.call(this,e)||this;if(n<0||n>10||i<0||i>10)throw new S;return o.firstDigit=n,o.secondDigit=i,o}return t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return this.firstDigit*10+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})(_e),ve=cf;var ur=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.")},hf=(function(){function r(){}return r.parseFieldsInGeneralPurpose=function(t){var e,n,i,o,a,f,s,u;if(!t)return null;if(t.length<2)throw new A;var c=t.substring(0,2);try{for(var h=ur(r.TWO_DIGIT_DATA_LENGTH),l=h.next();!l.done;l=h.next()){var d=l.value;if(d[0]===c)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(2,d[2],t):r.processFixedAI(2,d[1],t)}}catch(T){e={error:T}}finally{try{l&&!l.done&&(n=h.return)&&n.call(h)}finally{if(e)throw e.error}}if(t.length<3)throw new A;var p=t.substring(0,3);try{for(var v=ur(r.THREE_DIGIT_DATA_LENGTH),g=v.next();!g.done;g=v.next()){var d=g.value;if(d[0]===p)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(3,d[2],t):r.processFixedAI(3,d[1],t)}}catch(T){i={error:T}}finally{try{g&&!g.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}try{for(var y=ur(r.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),m=y.next();!m.done;m=y.next()){var d=m.value;if(d[0]===p)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,d[2],t):r.processFixedAI(4,d[1],t)}}catch(T){a={error:T}}finally{try{m&&!m.done&&(f=y.return)&&f.call(y)}finally{if(a)throw a.error}}if(t.length<4)throw new A;var w=t.substring(0,4);try{for(var _=ur(r.FOUR_DIGIT_DATA_LENGTH),I=_.next();!I.done;I=_.next()){var d=I.value;if(d[0]===w)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,d[2],t):r.processFixedAI(4,d[1],t)}}catch(T){s={error:T}}finally{try{I&&!I.done&&(u=_.return)&&u.call(_)}finally{if(s)throw s.error}}throw new A},r.processFixedAI=function(t,e,n){if(n.length<t)throw new A;var i=n.substring(0,t);if(n.length<t+e)throw new A;var o=n.substring(t,t+e),a=n.substring(t+e),f="("+i+")"+o,s=r.parseFieldsInGeneralPurpose(a);return s==null?f:f+s},r.processVariableAI=function(t,e,n){var i=n.substring(0,t),o;n.length<t+e?o=n.length:o=t+e;var a=n.substring(t,o),f=n.substring(o),s="("+i+")"+a,u=r.parseFieldsInGeneralPurpose(f);return u==null?s:s+u},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})(),Ln=hf;var lf=(function(){function r(t){this.buffer=new P,this.information=t}return r.prototype.decodeAllCodes=function(t,e){var n=e,i=null;do{var o=this.decodeGeneralPurposeField(n,i),a=Ln.parseFieldsInGeneralPurpose(o.getNewString());if(a!=null&&t.append(a),o.isRemaining()?i=""+o.getRemainingValue():i=null,n===o.getNewPosition())break;n=o.getNewPosition()}while(!0);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 e===0?new ve(this.information.getSize(),ve.FNC1,ve.FNC1):new ve(this.information.getSize(),e-1,ve.FNC1)}var n=this.extractNumericValueFromBitArray(t,7),i=(n-8)/11,o=(n-8)%11;return new ve(t+7,i,o)},r.prototype.extractNumericValueFromBitArray=function(t,e){return r.extractNumericValueFromBitArray(this.information,t,e)},r.extractNumericValueFromBitArray=function(t,e,n){for(var i=0,o=0;o<n;++o)t.get(e+o)&&(i|=1<<n-o-1);return i},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 ne(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new ne(this.current.getPosition(),this.buffer.toString())},r.prototype.parseBlocks=function(){var t,e;do{var n=this.current.getPosition();this.current.isAlpha()?(e=this.parseAlphaBlock(),t=e.isFinished()):this.current.isIsoIec646()?(e=this.parseIsoIec646Block(),t=e.isFinished()):(e=this.parseNumericBlock(),t=e.isFinished());var i=n!==this.current.getPosition();if(!i&&!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 t.isSecondDigitFNC1()?e=new ne(this.current.getPosition(),this.buffer.toString()):e=new ne(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()),new re(!0,e)}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1()){var e=new ne(this.current.getPosition(),this.buffer.toString());return new re(!0,e)}this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new re(!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 ne(this.current.getPosition(),this.buffer.toString());return new re(!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 re(!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 ne(this.current.getPosition(),this.buffer.toString());return new re(!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 re(!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 i=this.extractNumericValueFromBitArray(t,8);return i>=232&&i<253},r.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new Ft(t+5,Ft.FNC1);if(e>=5&&e<15)return new Ft(t+5,"0"+(e-5));var n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new Ft(t+7,""+(n+1));if(n>=90&&n<116)return new Ft(t+7,""+(n+7));var i=this.extractNumericValueFromBitArray(t,8),o;switch(i){case 232:o="!";break;case 233:o='"';break;case 234:o="%";break;case 235:o="&";break;case 236:o="'";break;case 237:o="(";break;case 238:o=")";break;case 239:o="*";break;case 240:o="+";break;case 241:o=",";break;case 242:o="-";break;case 243:o=".";break;case 244:o="/";break;case 245:o=":";break;case 246:o=";";break;case 247:o="<";break;case 248:o="=";break;case 249:o=">";break;case 250:o="?";break;case 251:o="_";break;case 252:o=" ";break;default:throw new S}return new Ft(t+8,o)},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 Ft(t+5,Ft.FNC1);if(e>=5&&e<15)return new Ft(t+5,"0"+(e-5));var n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new Ft(t+6,""+(n+33));var i;switch(n){case 58:i="*";break;case 59:i=",";break;case 60:i="-";break;case 61:i=".";break;case 62:i="/";break;default:throw new xt("Decoding invalid alphanumeric value: "+n)}return new Ft(t+6,i)},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})(),Ce=lf;var df=(function(){function r(t){this.information=t,this.generalDecoder=new Ce(t)}return r.prototype.getInformation=function(){return this.information},r.prototype.getGeneralDecoder=function(){return this.generalDecoder},r})(),Ge=df;var pf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),vf=(function(r){pf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.encodeCompressedGtin=function(e,n){e.append("(01)");var i=e.length();e.append("9"),this.encodeCompressedGtinWithoutAI(e,n,i)},t.prototype.encodeCompressedGtinWithoutAI=function(e,n,i){for(var o=0;o<4;++o){var a=this.getGeneralDecoder().extractNumericValueFromBitArray(n+10*o,10);a/100===0&&e.append("0"),a/10===0&&e.append("0"),e.append(a)}t.appendCheckDigit(e,i)},t.appendCheckDigit=function(e,n){for(var i=0,o=0;o<13;o++){var a=e.charAt(o+n).charCodeAt(0)-48;i+=(o&1)===0?3*a:a}i=10-i%10,i===10&&(i=0),e.append(i)},t.GTIN_SIZE=40,t})(Ge),Rt=vf;var xf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),gf=(function(r){xf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){var e=new P;e.append("(01)");var n=e.length(),i=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE,4);return e.append(i),this.encodeCompressedGtinWithoutAI(e,t.HEADER_SIZE+4,n),this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE+44)},t.HEADER_SIZE=4,t})(Rt),kn=gf;var mf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),yf=(function(r){mf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){var e=new P;return this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE)},t.HEADER_SIZE=5,t})(Ge),Un=yf;var wf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Af=(function(r){wf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.encodeCompressedWeight=function(e,n,i){var o=this.getGeneralDecoder().extractNumericValueFromBitArray(n,i);this.addWeightCode(e,o);for(var a=this.checkWeight(o),f=1e5,s=0;s<5;++s)a/f===0&&e.append("0"),f/=10;e.append(a)},t})(Rt),Ie=Af;var Ef=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),_f=(function(r){Ef(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+Ie.GTIN_SIZE+t.WEIGHT_SIZE)throw new A;var e=new P;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),cr=_f;var Cf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),If=(function(r){Cf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.addWeightCode=function(e,n){e.append("(3103)")},t.prototype.checkWeight=function(e){return e},t})(cr),Hn=If;var Sf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Of=(function(r){Sf(t,r);function t(e){return r.call(this,e)||this}return 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})(cr),Vn=Of;var Tf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Df=(function(r){Tf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+Rt.GTIN_SIZE)throw new A;var e=new P;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Rt.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(392"),e.append(n),e.append(")");var i=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+Rt.GTIN_SIZE+t.LAST_DIGIT_SIZE,null);return e.append(i.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t})(Rt),Gn=Df;var Rf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Nf=(function(r){Rf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+Rt.GTIN_SIZE)throw new A;var e=new P;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Rt.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(393"),e.append(n),e.append(")");var i=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Rt.GTIN_SIZE+t.LAST_DIGIT_SIZE,t.FIRST_THREE_DIGITS_SIZE);i/100===0&&e.append("0"),i/10===0&&e.append("0"),e.append(i);var o=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+Rt.GTIN_SIZE+t.LAST_DIGIT_SIZE+t.FIRST_THREE_DIGITS_SIZE,null);return e.append(o.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t.FIRST_THREE_DIGITS_SIZE=10,t})(Rt),Wn=Nf;var bf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Pf=(function(r){bf(t,r);function t(e,n,i){var o=r.call(this,e)||this;return o.dateCode=i,o.firstAIdigits=n,o}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE+t.DATE_SIZE)throw new A;var e=new P;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 i=this.getGeneralDecoder().extractNumericValueFromBitArray(n,t.DATE_SIZE);if(i!==38400){e.append("("),e.append(this.dateCode),e.append(")");var o=i%32;i/=32;var a=i%12+1;i/=12;var f=i;f/10===0&&e.append("0"),e.append(f),a/10===0&&e.append("0"),e.append(a),o/10===0&&e.append("0"),e.append(o)}},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),Kt=Pf;function jr(r){try{if(r.get(1))return new kn(r);if(!r.get(2))return new Un(r);var t=Ce.extractNumericValueFromBitArray(r,1,4);switch(t){case 4:return new Hn(r);case 5:return new Vn(r)}var e=Ce.extractNumericValueFromBitArray(r,1,5);switch(e){case 12:return new Gn(r);case 13:return new Wn(r)}var n=Ce.extractNumericValueFromBitArray(r,1,7);switch(n){case 56:return new Kt(r,"310","11");case 57:return new Kt(r,"320","11");case 58:return new Kt(r,"310","13");case 59:return new Kt(r,"320","13");case 60:return new Kt(r,"310","15");case 61:return new Kt(r,"320","15");case 62:return new Kt(r,"310","17");case 63:return new Kt(r,"320","17")}}catch(i){throw console.log(i),new xt("unknown decoder: "+r)}}var Mf=(function(){function r(t,e,n,i){this.leftchar=t,this.rightchar=e,this.finderpattern=n,this.maybeLast=i}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):!1},r.equalsOrNull=function(t,e){return t===null?e===null:r.equals(t,e)},r.prototype.hashCode=function(){var t=this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue();return t},r})(),Yr=Mf;var Bf=(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:!1},r.prototype.checkEqualitity=function(t,e){if(!(!t||!e)){var n;return t.forEach(function(i,o){e.forEach(function(a){i.getLeftChar().getValue()===a.getLeftChar().getValue()&&i.getRightChar().getValue()===a.getRightChar().getValue()&&i.getFinderPatter().getValue()===a.getFinderPatter().getValue()&&(n=!0)})}),n}},r})(),Xn=Bf;var Ff=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ie=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.")},Lf=(function(r){Ff(t,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 t.prototype.decodeRow=function(e,n,i){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 i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(n,this.pairs,e))}catch(f){if(f instanceof A){if(!this.pairs.length)throw new A;i=!0}}if(this.checkChecksum())return this.pairs;var o;if(this.rows.length?o=!0:o=!1,this.storeRow(e,!1),o){var a=this.checkRowsBoolean(!1);if(a!=null||(a=this.checkRowsBoolean(!0),a!=null))return a}throw new A},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(i){console.log(i)}return e&&(this.rows=this.rows.reverse()),n},t.prototype.checkRows=function(e,n){for(var i,o,a=n;a<this.rows.length;a++){var f=this.rows[a];this.pairs.length=0;try{for(var s=(i=void 0,ie(e)),u=s.next();!u.done;u=s.next()){var c=u.value;this.pairs.push(c.getPairs())}}catch(l){i={error:l}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}if(this.pairs.push(f.getPairs()),!!t.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var h=new Array(e);h.push(f);try{return this.checkRows(h,a+1)}catch(l){console.log(l)}}}throw new A},t.isValidSequence=function(e){var n,i;try{for(var o=ie(t.FINDER_PATTERN_SEQUENCES),a=o.next();!a.done;a=o.next()){var f=a.value;if(!(e.length>f.length)){for(var s=!0,u=0;u<e.length;u++)if(e[u].getFinderPattern().getValue()!==f[u]){s=!1;break}if(s)return!0}}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return!1},t.prototype.storeRow=function(e,n){for(var i=0,o=!1,a=!1;i<this.rows.length;){var f=this.rows[i];if(f.getRowNumber()>e){a=f.isEquivalent(this.pairs);break}o=f.isEquivalent(this.pairs),i++}a||o||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(i,new Xn(this.pairs,e,n)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,n){var i,o,a,f,s,u;try{for(var c=ie(n),h=c.next();!h.done;h=c.next()){var l=h.value;if(l.getPairs().length!==e.length){var d=!0;try{for(var p=(a=void 0,ie(l.getPairs())),v=p.next();!v.done;v=p.next()){var g=v.value,y=!1;try{for(var m=(s=void 0,ie(e)),w=m.next();!w.done;w=m.next()){var _=w.value;if(Yr.equals(g,_)){y=!0;break}}}catch(I){s={error:I}}finally{try{w&&!w.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}y||(d=!1)}}catch(I){a={error:I}}finally{try{v&&!v.done&&(f=p.return)&&f.call(p)}finally{if(a)throw a.error}}}}}catch(I){i={error:I}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}},t.isPartialRow=function(e,n){var i,o,a,f,s,u;try{for(var c=ie(n),h=c.next();!h.done;h=c.next()){var l=h.value,d=!0;try{for(var p=(a=void 0,ie(e)),v=p.next();!v.done;v=p.next()){var g=v.value,y=!1;try{for(var m=(s=void 0,ie(l.getPairs())),w=m.next();!w.done;w=m.next()){var _=w.value;if(g.equals(_)){y=!0;break}}}catch(I){s={error:I}}finally{try{w&&!w.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(!y){d=!1;break}}}catch(I){a={error:I}}finally{try{v&&!v.done&&(f=p.return)&&f.call(p)}finally{if(a)throw a.error}}if(d)return!0}}catch(I){i={error:I}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(e){var n=Fn.buildBitArray(e),i=jr(n),o=i.parseInformation(),a=e[0].getFinderPattern().getResultPoints(),f=e[e.length-1].getFinderPattern().getResultPoints(),s=[a[0],a[1],f[0],f[1]];return new Z(o,null,null,s,C.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs.get(0),n=e.getLeftChar(),i=e.getRightChar();if(i===null)return!1;for(var o=i.getChecksumPortion(),a=2,f=1;f<this.pairs.size();++f){var s=this.pairs.get(f);o+=s.getLeftChar().getChecksumPortion(),a++;var u=s.getRightChar();u!=null&&(o+=u.getChecksumPortion(),a++)}o%=211;var c=211*(a-4)+o;return c===n.getValue()},t.getNextSecondBar=function(e,n){var i;return e.get(n)?(i=e.getNextUnset(n),i=e.getNextSet(i)):(i=e.getNextSet(n),i=e.getNextUnset(i)),i},t.prototype.retrieveNextPair=function(e,n,i){var o=n.length%2===0;this.startFromEven&&(o=!o);var a,f=!0,s=-1;do this.findNextPair(e,n,s),a=this.parseFoundFinderPattern(e,i,o),a===null?s=t.getNextSecondBar(e,this.startEnd[0]):f=!1;while(f);var u=this.decodeDataCharacter(e,a,o,!0);if(!this.isEmptyPair(n)&&n[n.length-1].mustBeLast())throw new A;var c;try{c=this.decodeDataCharacter(e,a,o,!1)}catch(h){c=null,console.log(h)}return new Yr(u,c,a,!0)},t.prototype.isEmptyPair=function(e){return e.length===0},t.prototype.findNextPair=function(e,n,i){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;var a=e.getSize(),f;if(i>=0)f=i;else if(this.isEmptyPair(n))f=0;else{var s=n[n.length-1];f=s.getFinderPattern().getStartEnd()[1]}var u=n.length%2!==0;this.startFromEven&&(u=!u);for(var c=!1;f<a&&(c=!e.get(f),!!c);)f++;for(var h=0,l=f,d=f;d<a;d++)if(e.get(d)!==c)o[h]++;else{if(h===3){if(u&&t.reverseCounters(o),t.isFinderPattern(o)){this.startEnd[0]=l,this.startEnd[1]=d;return}u&&t.reverseCounters(o),l+=o[0]+o[1],o[0]=o[2],o[1]=o[3],o[2]=0,o[3]=0,h--}else h++;o[h]=1,c=!c}throw new A},t.reverseCounters=function(e){for(var n=e.length,i=0;i<n/2;++i){var o=e[i];e[i]=e[n-i-1],e[n-i-1]=o}},t.prototype.parseFoundFinderPattern=function(e,n,i){var o,a,f;if(i){for(var s=this.startEnd[0]-1;s>=0&&!e.get(s);)s--;s++,o=this.startEnd[0]-s,a=s,f=this.startEnd[1]}else a=this.startEnd[0],f=e.getNextUnset(this.startEnd[1]+1),o=f-this.startEnd[1];var u=this.getDecodeFinderCounters();V.arraycopy(u,0,u,1,u.length-1),u[0]=o;var c;try{c=this.parseFinderValue(u,t.FINDER_PATTERNS)}catch{return null}return new sr(c,[a,f],a,f,n)},t.prototype.decodeDataCharacter=function(e,n,i,o){for(var a=this.getDataCharacterCounters(),f=0;f<a.length;f++)a[f]=0;if(o)t.recordPatternInReverse(e,n.getStartEnd()[0],a);else{t.recordPattern(e,n.getStartEnd()[1],a);for(var s=0,u=a.length-1;s<u;s++,u--){var c=a[s];a[s]=a[u],a[u]=c}}var h=17,l=G.sum(new Int32Array(a))/h,d=(n.getStartEnd()[1]-n.getStartEnd()[0])/15;if(Math.abs(l-d)/d>.3)throw new A;for(var p=this.getOddCounts(),v=this.getEvenCounts(),g=this.getOddRoundingErrors(),y=this.getEvenRoundingErrors(),s=0;s<a.length;s++){var m=1*a[s]/l,w=m+.5;if(w<1){if(m<.3)throw new A;w=1}else if(w>8){if(m>8.7)throw new A;w=8}var _=s/2;(s&1)===0?(p[_]=w,g[_]=m-w):(v[_]=w,y[_]=m-w)}this.adjustOddEvenCounts(h);for(var I=4*n.getValue()+(i?0:2)+(o?0:1)-1,T=0,D=0,s=p.length-1;s>=0;s--){if(t.isNotA1left(n,i,o)){var b=t.WEIGHTS[I][2*s];D+=p[s]*b}T+=p[s]}for(var L=0,s=v.length-1;s>=0;s--)if(t.isNotA1left(n,i,o)){var b=t.WEIGHTS[I][2*s+1];L+=v[s]*b}var B=D+L;if((T&1)!==0||T>13||T<4)throw new A;var vt=(13-T)/2,z=t.SYMBOL_WIDEST[vt],ut=9-z,Pt=ee.getRSSvalue(p,z,!0),$t=ee.getRSSvalue(v,ut,!1),Dr=t.EVEN_TOTAL_SUBSET[vt],Rr=t.GSUM[vt],Nr=Pt*Dr+$t+Rr;return new pe(Nr,B)},t.isNotA1left=function(e,n,i){return!(e.getValue()===0&&n&&i)},t.prototype.adjustOddEvenCounts=function(e){var n=G.sum(new Int32Array(this.getOddCounts())),i=G.sum(new Int32Array(this.getEvenCounts())),o=!1,a=!1;n>13?a=!0:n<4&&(o=!0);var f=!1,s=!1;i>13?s=!0:i<4&&(f=!0);var u=n+i-e,c=(n&1)===1,h=(i&1)===0;if(u===1)if(c){if(h)throw new A;a=!0}else{if(!h)throw new A;s=!0}else if(u===-1)if(c){if(h)throw new A;o=!0}else{if(!h)throw new A;f=!0}else if(u===0){if(c){if(!h)throw new A;n<i?(o=!0,s=!0):(a=!0,f=!0)}else if(h)throw new A}else throw new A;if(o){if(a)throw new A;t.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&t.decrement(this.getOddCounts(),this.getOddRoundingErrors()),f){if(s)throw new A;t.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&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})(Yt),Kr=Lf;var kf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Uf=(function(r){kf(t,r);function t(e,n,i){var o=r.call(this,e,n)||this;return o.count=0,o.finderPattern=i,o}return t.prototype.getFinderPattern=function(){return this.finderPattern},t.prototype.getCount=function(){return this.count},t.prototype.incrementCount=function(){this.count++},t})(pe),zn=Uf;var Hf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Qr=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.")},Vf=(function(r){Hf(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return t.prototype.decodeRow=function(e,n,i){var o,a,f,s,u=this.decodePair(n,!1,e,i);t.addOrTally(this.possibleLeftPairs,u),n.reverse();var c=this.decodePair(n,!0,e,i);t.addOrTally(this.possibleRightPairs,c),n.reverse();try{for(var h=Qr(this.possibleLeftPairs),l=h.next();!l.done;l=h.next()){var d=l.value;if(d.getCount()>1)try{for(var p=(f=void 0,Qr(this.possibleRightPairs)),v=p.next();!v.done;v=p.next()){var g=v.value;if(g.getCount()>1&&t.checkChecksum(d,g))return t.constructResult(d,g)}}catch(y){f={error:y}}finally{try{v&&!v.done&&(s=p.return)&&s.call(p)}finally{if(f)throw f.error}}}}catch(y){o={error:y}}finally{try{l&&!l.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}throw new A},t.addOrTally=function(e,n){var i,o;if(n!=null){var a=!1;try{for(var f=Qr(e),s=f.next();!s.done;s=f.next()){var u=s.value;if(u.getValue()===n.getValue()){u.incrementCount(),a=!0;break}}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}a||e.push(n)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,n){for(var i=4537077*e.getValue()+n.getValue(),o=new String(i).toString(),a=new P,f=13-o.length;f>0;f--)a.append("0");a.append(o);for(var s=0,f=0;f<13;f++){var u=a.charAt(f).charCodeAt(0)-48;s+=(f&1)===0?3*u:u}s=10-s%10,s===10&&(s=0),a.append(s.toString());var c=e.getFinderPattern().getResultPoints(),h=n.getFinderPattern().getResultPoints();return new Z(a.toString(),null,0,[c[0],c[1],h[0],h[1]],C.RSS_14,new Date().getTime())},t.checkChecksum=function(e,n){var i=(e.getChecksumPortion()+16*n.getChecksumPortion())%79,o=9*e.getFinderPattern().getValue()+n.getFinderPattern().getValue();return o>72&&o--,o>8&&o--,i===o},t.prototype.decodePair=function(e,n,i,o){try{var a=this.findFinderPattern(e,n),f=this.parseFoundFinderPattern(e,i,n,a),s=o==null?null:o.get(k.NEED_RESULT_POINT_CALLBACK);if(s!=null){var u=(a[0]+a[1])/2;n&&(u=e.getSize()-1-u),s.foundPossibleResultPoint(new R(u,i))}var c=this.decodeDataCharacter(e,f,!0),h=this.decodeDataCharacter(e,f,!1);return new zn(1597*c.getValue()+h.getValue(),c.getChecksumPortion()+4*h.getChecksumPortion(),f)}catch{return null}},t.prototype.decodeDataCharacter=function(e,n,i){for(var o=this.getDataCharacterCounters(),a=0;a<o.length;a++)o[a]=0;if(i)q.recordPatternInReverse(e,n.getStartEnd()[0],o);else{q.recordPattern(e,n.getStartEnd()[1]+1,o);for(var f=0,s=o.length-1;f<s;f++,s--){var u=o[f];o[f]=o[s],o[s]=u}}for(var c=i?16:15,h=G.sum(new Int32Array(o))/c,l=this.getOddCounts(),d=this.getEvenCounts(),p=this.getOddRoundingErrors(),v=this.getEvenRoundingErrors(),f=0;f<o.length;f++){var g=o[f]/h,y=Math.floor(g+.5);y<1?y=1:y>8&&(y=8);var m=Math.floor(f/2);(f&1)===0?(l[m]=y,p[m]=g-y):(d[m]=y,v[m]=g-y)}this.adjustOddEvenCounts(i,c);for(var w=0,_=0,f=l.length-1;f>=0;f--)_*=9,_+=l[f],w+=l[f];for(var I=0,T=0,f=d.length-1;f>=0;f--)I*=9,I+=d[f],T+=d[f];var D=_+3*I;if(i){if((w&1)!==0||w>12||w<4)throw new A;var b=(12-w)/2,L=t.OUTSIDE_ODD_WIDEST[b],B=9-L,vt=ee.getRSSvalue(l,L,!1),z=ee.getRSSvalue(d,B,!0),ut=t.OUTSIDE_EVEN_TOTAL_SUBSET[b],Pt=t.OUTSIDE_GSUM[b];return new pe(vt*ut+z+Pt,D)}else{if((T&1)!==0||T>10||T<4)throw new A;var b=(10-T)/2,L=t.INSIDE_ODD_WIDEST[b],B=9-L,vt=ee.getRSSvalue(l,L,!0),z=ee.getRSSvalue(d,B,!1),$t=t.INSIDE_ODD_TOTAL_SUBSET[b],Pt=t.INSIDE_GSUM[b];return new pe(z*$t+vt+Pt,D)}},t.prototype.findFinderPattern=function(e,n){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var o=e.getSize(),a=!1,f=0;f<o&&(a=!e.get(f),n!==a);)f++;for(var s=0,u=f,c=f;c<o;c++)if(e.get(c)!==a)i[s]++;else{if(s===3){if(Yt.isFinderPattern(i))return[u,c];u+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,s--}else s++;i[s]=1,a=!a}throw new A},t.prototype.parseFoundFinderPattern=function(e,n,i,o){for(var a=e.get(o[0]),f=o[0]-1;f>=0&&a!==e.get(f);)f--;f++;var s=o[0]-f,u=this.getDecodeFinderCounters(),c=new Int32Array(u.length);V.arraycopy(u,0,c,1,u.length-1),c[0]=s;var h=this.parseFinderValue(c,t.FINDER_PATTERNS),l=f,d=o[1];return i&&(l=e.getSize()-1-l,d=e.getSize()-1-d),new sr(h,[f,o[1]],l,d,n)},t.prototype.adjustOddEvenCounts=function(e,n){var i=G.sum(new Int32Array(this.getOddCounts())),o=G.sum(new Int32Array(this.getEvenCounts())),a=!1,f=!1,s=!1,u=!1;e?(i>12?f=!0:i<4&&(a=!0),o>12?u=!0:o<4&&(s=!0)):(i>11?f=!0:i<5&&(a=!0),o>10?u=!0:o<4&&(s=!0));var c=i+o-n,h=(i&1)===(e?1:0),l=(o&1)===1;if(c===1)if(h){if(l)throw new A;f=!0}else{if(!l)throw new A;u=!0}else if(c===-1)if(h){if(l)throw new A;a=!0}else{if(!l)throw new A;s=!0}else if(c===0){if(h){if(!l)throw new A;i<o?(a=!0,u=!0):(f=!0,s=!0)}else if(l)throw new A}else throw new A;if(a){if(f)throw new A;Yt.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(f&&Yt.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(u)throw new A;Yt.increment(this.getEvenCounts(),this.getOddRoundingErrors())}u&&Yt.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})(Yt),hr=Vf;var Gf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Wf=(function(r){Gf(t,r);function t(e){var n=r.call(this)||this;n.readers=[];var i=e?e.get(k.POSSIBLE_FORMATS):null,o=e&&e.get(k.ASSUME_CODE_39_CHECK_DIGIT)!==void 0,a=e&&e.get(k.ENABLE_CODE_39_EXTENDED_MODE)!==void 0;return i&&((i.includes(C.EAN_13)||i.includes(C.UPC_A)||i.includes(C.EAN_8)||i.includes(C.UPC_E))&&n.readers.push(new fr(e)),i.includes(C.CODE_39)&&n.readers.push(new ir(o,a)),i.includes(C.CODE_93)&&n.readers.push(new or),i.includes(C.CODE_128)&&n.readers.push(new nr),i.includes(C.ITF)&&n.readers.push(new ar),i.includes(C.CODABAR)&&n.readers.push(new Zr),i.includes(C.RSS_14)&&n.readers.push(new hr),i.includes(C.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),n.readers.push(new Kr))),n.readers.length===0&&(n.readers.push(new fr(e)),n.readers.push(new ir),n.readers.push(new or),n.readers.push(new fr(e)),n.readers.push(new nr),n.readers.push(new ar),n.readers.push(new hr)),n}return t.prototype.decodeRow=function(e,n,i){for(var o=0;o<this.readers.length;o++)try{return this.readers[o].decodeRow(e,n,i)}catch{}throw new A},t.prototype.reset=function(){this.readers.forEach(function(e){return e.reset()})},t})(q),Xt=Wf;var Xf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),P2=(function(r){Xf(t,r);function t(e,n){return e===void 0&&(e=500),r.call(this,new Xt(n),e,n)||this}return t})(Mt);var 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.")},J=(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})();var K=(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})();var zf=(function(){function r(t,e,n,i,o,a){var f,s;this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=n,this.dataRegionSizeRows=i,this.dataRegionSizeColumns=o,this.ecBlocks=a;var u=0,c=a.getECCodewords(),h=a.getECBlocks();try{for(var l=Zn(h),d=l.next();!d.done;d=l.next()){var p=d.value;u+=p.getCount()*(p.getDataCodewords()+c)}}catch(v){f={error:v}}finally{try{d&&!d.done&&(s=l.return)&&s.call(l)}finally{if(f)throw f.error}}this.totalCodewords=u}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,i;if((t&1)!==0||(e&1)!==0)throw new S;try{for(var o=Zn(r.VERSIONS),a=o.next();!a.done;a=o.next()){var f=a.value;if(f.symbolSizeRows===t&&f.symbolSizeColumns===e)return f}}catch(s){n={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}throw new S},r.prototype.toString=function(){return""+this.versionNumber},r.buildVersions=function(){return[new r(1,10,10,8,8,new J(5,new K(1,3))),new r(2,12,12,10,10,new J(7,new K(1,5))),new r(3,14,14,12,12,new J(10,new K(1,8))),new r(4,16,16,14,14,new J(12,new K(1,12))),new r(5,18,18,16,16,new J(14,new K(1,18))),new r(6,20,20,18,18,new J(18,new K(1,22))),new r(7,22,22,20,20,new J(20,new K(1,30))),new r(8,24,24,22,22,new J(24,new K(1,36))),new r(9,26,26,24,24,new J(28,new K(1,44))),new r(10,32,32,14,14,new J(36,new K(1,62))),new r(11,36,36,16,16,new J(42,new K(1,86))),new r(12,40,40,18,18,new J(48,new K(1,114))),new r(13,44,44,20,20,new J(56,new K(1,144))),new r(14,48,48,22,22,new J(68,new K(1,174))),new r(15,52,52,24,24,new J(42,new K(2,102))),new r(16,64,64,14,14,new J(56,new K(2,140))),new r(17,72,72,16,16,new J(36,new K(4,92))),new r(18,80,80,18,18,new J(48,new K(4,114))),new r(19,88,88,20,20,new J(56,new K(4,144))),new r(20,96,96,22,22,new J(68,new K(4,174))),new r(21,104,104,24,24,new J(56,new K(6,136))),new r(22,120,120,18,18,new J(68,new K(6,175))),new r(23,132,132,20,20,new J(62,new K(8,163))),new r(24,144,144,22,22,new J(62,new K(8,156),new K(2,155))),new r(25,8,18,6,16,new J(7,new K(1,5))),new r(26,8,32,6,14,new J(11,new K(1,10))),new r(27,12,26,10,24,new J(14,new K(1,16))),new r(28,12,36,10,16,new J(18,new K(1,22))),new r(29,16,36,14,16,new J(24,new K(1,32))),new r(30,16,48,14,22,new J(28,new K(1,49)))]},r.VERSIONS=r.buildVersions(),r})(),jn=zf;var Zf=(function(){function r(t){var e=t.getHeight();if(e<8||e>144||(e&1)!==0)throw new S;this.version=r.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new at(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 jn.getVersionForDimensions(e,n)},r.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,n=4,i=0,o=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),f=!1,s=!1,u=!1,c=!1;do if(n===o&&i===0&&!f)t[e++]=this.readCorner1(o,a)&255,n-=2,i+=2,f=!0;else if(n===o-2&&i===0&&(a&3)!==0&&!s)t[e++]=this.readCorner2(o,a)&255,n-=2,i+=2,s=!0;else if(n===o+4&&i===2&&(a&7)===0&&!u)t[e++]=this.readCorner3(o,a)&255,n-=2,i+=2,u=!0;else if(n===o-2&&i===0&&(a&7)===4&&!c)t[e++]=this.readCorner4(o,a)&255,n-=2,i+=2,c=!0;else{do n<o&&i>=0&&!this.readMappingMatrix.get(i,n)&&(t[e++]=this.readUtah(n,i,o,a)&255),n-=2,i+=2;while(n>=0&&i<a);n+=1,i+=3;do n>=0&&i<a&&!this.readMappingMatrix.get(i,n)&&(t[e++]=this.readUtah(n,i,o,a)&255),n+=2,i-=2;while(n<o&&i>=0);n+=3,i+=1}while(n<o||i<a);if(e!==this.version.getTotalCodewords())throw new S;return t},r.prototype.readModule=function(t,e,n,i){return t<0&&(t+=n,e+=4-(n+4&7)),e<0&&(e+=i,t+=4-(i+4&7)),this.readMappingMatrix.set(e,t),this.mappingBitMatrix.get(e,t)},r.prototype.readUtah=function(t,e,n,i){var o=0;return this.readModule(t-2,e-2,n,i)&&(o|=1),o<<=1,this.readModule(t-2,e-1,n,i)&&(o|=1),o<<=1,this.readModule(t-1,e-2,n,i)&&(o|=1),o<<=1,this.readModule(t-1,e-1,n,i)&&(o|=1),o<<=1,this.readModule(t-1,e,n,i)&&(o|=1),o<<=1,this.readModule(t,e-2,n,i)&&(o|=1),o<<=1,this.readModule(t,e-1,n,i)&&(o|=1),o<<=1,this.readModule(t,e,n,i)&&(o|=1),o},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 O("Dimension of bitMatrix must match the version size");for(var i=this.version.getDataRegionSizeRows(),o=this.version.getDataRegionSizeColumns(),a=e/i|0,f=n/o|0,s=a*i,u=f*o,c=new at(u,s),h=0;h<a;++h)for(var l=h*i,d=0;d<f;++d)for(var p=d*o,v=0;v<i;++v)for(var g=h*(i+2)+1+v,y=l+v,m=0;m<o;++m){var w=d*(o+2)+1+m;if(t.get(w,g)){var _=p+m;c.set(_,y)}}return c},r})(),Yn=Zf;var Kn=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.")},jf=(function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e){var n,i,o,a,f=e.getECBlocks(),s=0,u=f.getECBlocks();try{for(var c=Kn(u),h=c.next();!h.done;h=c.next()){var l=h.value;s+=l.getCount()}}catch(Pt){n={error:Pt}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}var d=new Array(s),p=0;try{for(var v=Kn(u),g=v.next();!g.done;g=v.next())for(var l=g.value,y=0;y<l.getCount();y++){var m=l.getDataCodewords(),w=f.getECCodewords()+m;d[p++]=new r(m,new Uint8Array(w))}}catch(Pt){o={error:Pt}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}for(var _=d[0].codewords.length,I=_-f.getECCodewords(),T=I-1,D=0,y=0;y<T;y++)for(var b=0;b<p;b++)d[b].codewords[y]=t[D++];for(var L=e.getVersionNumber()===24,B=L?8:p,b=0;b<B;b++)d[b].codewords[I-1]=t[D++];for(var vt=d[0].codewords.length,y=I;y<vt;y++)for(var b=0;b<p;b++){var z=L?(b+8)%p:b,ut=L&&z>7?y-1:y;d[z].codewords[ut]=t[D++]}if(D!==t.length)throw new O;return d},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r})(),Qn=jf;var Yf=(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 O(""+t);var e=0,n=this.bitOffset,i=this.byteOffset,o=this.bytes;if(n>0){var a=8-n,f=t<a?t:a,s=a-f,u=255>>8-f<<s;e=(o[i]&u)>>s,t-=f,n+=f,n===8&&(n=0,i++)}if(t>0){for(;t>=8;)e=e<<8|o[i]&255,i++,t-=8;if(t>0){var s=8-t,u=255>>s<<s;e=e<<t|(o[i]&u)>>s,n+=t}}return this.bitOffset=n,this.byteOffset=i,e},r.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},r})(),We=Yf;var wt;(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"})(wt||(wt={}));var Kf=(function(){function r(){}return r.decode=function(t){var e=new We(t),n=new P,i=new P,o=new Array,a=wt.ASCII_ENCODE;do if(a===wt.ASCII_ENCODE)a=this.decodeAsciiSegment(e,n,i);else{switch(a){case wt.C40_ENCODE:this.decodeC40Segment(e,n);break;case wt.TEXT_ENCODE:this.decodeTextSegment(e,n);break;case wt.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,n);break;case wt.EDIFACT_ENCODE:this.decodeEdifactSegment(e,n);break;case wt.BASE256_ENCODE:this.decodeBase256Segment(e,n,o);break;default:throw new S}a=wt.ASCII_ENCODE}while(a!==wt.PAD_ENCODE&&e.available()>0);return i.length()>0&&n.append(i.toString()),new Zt(t,n.toString(),o.length===0?null:o,null)},r.decodeAsciiSegment=function(t,e,n){var i=!1;do{var o=t.readBits(8);if(o===0)throw new S;if(o<=128)return i&&(o+=128),e.append(String.fromCharCode(o-1)),wt.ASCII_ENCODE;if(o===129)return wt.PAD_ENCODE;if(o<=229){var a=o-130;a<10&&e.append("0"),e.append(""+a)}else switch(o){case 230:return wt.C40_ENCODE;case 231:return wt.BASE256_ENCODE;case 232:e.append("");break;case 233:case 234:break;case 235:i=!0;break;case 236:e.append("[)>05"),n.insert(0,"");break;case 237:e.append("[)>06"),n.insert(0,"");break;case 238:return wt.ANSIX12_ENCODE;case 239:return wt.TEXT_ENCODE;case 240:return wt.EDIFACT_ENCODE;case 241:break;default:if(o!==254||t.available()!==0)throw new S;break}}while(t.available()>0);return wt.ASCII_ENCODE},r.decodeC40Segment=function(t,e){var n=!1,i=[],o=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),i);for(var f=0;f<3;f++){var s=i[f];switch(o){case 0:if(s<3)o=s+1;else if(s<this.C40_BASIC_SET_CHARS.length){var u=this.C40_BASIC_SET_CHARS[s];n?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):e.append(u)}else throw new S;break;case 1:n?(e.append(String.fromCharCode(s+128)),n=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.C40_SHIFT2_SET_CHARS.length){var u=this.C40_SHIFT2_SET_CHARS[s];n?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):e.append(u)}else switch(s){case 27:e.append("");break;case 30:n=!0;break;default:throw new S}o=0;break;case 3:n?(e.append(String.fromCharCode(s+224)),n=!1):e.append(String.fromCharCode(s+96)),o=0;break;default:throw new S}}}while(t.available()>0)},r.decodeTextSegment=function(t,e){var n=!1,i=[],o=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),i);for(var f=0;f<3;f++){var s=i[f];switch(o){case 0:if(s<3)o=s+1;else if(s<this.TEXT_BASIC_SET_CHARS.length){var u=this.TEXT_BASIC_SET_CHARS[s];n?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):e.append(u)}else throw new S;break;case 1:n?(e.append(String.fromCharCode(s+128)),n=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.TEXT_SHIFT2_SET_CHARS.length){var u=this.TEXT_SHIFT2_SET_CHARS[s];n?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):e.append(u)}else switch(s){case 27:e.append("");break;case 30:n=!0;break;default:throw new S}o=0;break;case 3:if(s<this.TEXT_SHIFT3_SET_CHARS.length){var u=this.TEXT_SHIFT3_SET_CHARS[s];n?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):e.append(u),o=0}else throw new S;break;default:throw new S}}}while(t.available()>0)},r.decodeAnsiX12Segment=function(t,e){var n=[];do{if(t.available()===8)return;var i=t.readBits(8);if(i===254)return;this.parseTwoBytes(i,t.readBits(8),n);for(var o=0;o<3;o++){var a=n[o];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)e.append(String.fromCharCode(a+51));else throw new S;break}}}while(t.available()>0)},r.parseTwoBytes=function(t,e,n){var i=(t<<8)+e-1,o=Math.floor(i/1600);n[0]=o,i-=o*1600,o=Math.floor(i/40),n[1]=o,n[2]=i-o*40},r.decodeEdifactSegment=function(t,e){do{if(t.available()<=16)return;for(var n=0;n<4;n++){var i=t.readBits(6);if(i===31){var o=8-t.getBitOffset();o!==8&&t.readBits(o);return}(i&32)===0&&(i|=64),e.append(String.fromCharCode(i))}}while(t.available()>0)},r.decodeBase256Segment=function(t,e,n){var i=1+t.getByteOffset(),o=this.unrandomize255State(t.readBits(8),i++),a;if(o===0?a=t.available()/8|0:o<250?a=o:a=250*(o-249)+this.unrandomize255State(t.readBits(8),i++),a<0)throw new S;for(var f=new Uint8Array(a),s=0;s<a;s++){if(t.available()<8)throw new S;f[s]=this.unrandomize255State(t.readBits(8),i++)}n.push(f);try{e.append(yt.decode(f,F.ISO88591))}catch(u){throw new xt("Platform does not support required encoding: "+u.message)}},r.unrandomize255State=function(t,e){var n=149*e%255+1,i=t-n;return i>=0?i:i+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","{","|","}","~","\x7F"],r})(),qr=Kf;var Qf=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.")},qf=(function(){function r(){this.rsDecoder=new jt(dt.DATA_MATRIX_FIELD_256)}return r.prototype.decode=function(t){var e,n,i=new Yn(t),o=i.getVersion(),a=i.readCodewords(),f=Qn.getDataBlocks(a,o),s=0;try{for(var u=Qf(f),c=u.next();!c.done;c=u.next()){var h=c.value;s+=h.getNumDataCodewords()}}catch(w){e={error:w}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}for(var l=new Uint8Array(s),d=f.length,p=0;p<d;p++){var v=f[p],g=v.getCodewords(),y=v.getNumDataCodewords();this.correctErrors(g,y);for(var m=0;m<y;m++)l[m*d+p]=g[m]}return qr.decode(l)},r.prototype.correctErrors=function(t,e){var n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch{throw new j}for(var i=0;i<e;i++)t[i]=n[i]},r})(),qn=qf;var Jf=(function(){function r(t){this.image=t,this.rectangleDetector=new Ae(this.image)}return r.prototype.detect=function(){var t=this.rectangleDetector.detect(),e=this.detectSolid1(t);if(e=this.detectSolid2(e),e[3]=this.correctTopRight(e),!e[3])throw new A;e=this.shiftToModuleCenter(e);var n=e[0],i=e[1],o=e[2],a=e[3],f=this.transitionsBetween(n,a)+1,s=this.transitionsBetween(o,a)+1;(f&1)===1&&(f+=1),(s&1)===1&&(s+=1),4*f<7*s&&4*s<7*f&&(f=s=Math.max(f,s));var u=r.sampleGrid(this.image,n,i,o,a,f,s);return new le(u,[n,i,o,a])},r.shiftPoint=function(t,e,n){var i=(e.getX()-t.getX())/(n+1),o=(e.getY()-t.getY())/(n+1);return new R(t.getX()+i,t.getY()+o)},r.moveAway=function(t,e,n){var i=t.getX(),o=t.getY();return i<e?i-=1:i+=1,o<n?o-=1:o+=1,new R(i,o)},r.prototype.detectSolid1=function(t){var e=t[0],n=t[1],i=t[3],o=t[2],a=this.transitionsBetween(e,n),f=this.transitionsBetween(n,i),s=this.transitionsBetween(i,o),u=this.transitionsBetween(o,e),c=a,h=[o,e,n,i];return c>f&&(c=f,h[0]=e,h[1]=n,h[2]=i,h[3]=o),c>s&&(c=s,h[0]=n,h[1]=i,h[2]=o,h[3]=e),c>u&&(h[0]=i,h[1]=o,h[2]=e,h[3]=n),h},r.prototype.detectSolid2=function(t){var e=t[0],n=t[1],i=t[2],o=t[3],a=this.transitionsBetween(e,o),f=r.shiftPoint(n,i,(a+1)*4),s=r.shiftPoint(i,n,(a+1)*4),u=this.transitionsBetween(f,e),c=this.transitionsBetween(s,o);return u<c?(t[0]=e,t[1]=n,t[2]=i,t[3]=o):(t[0]=n,t[1]=i,t[2]=o,t[3]=e),t},r.prototype.correctTopRight=function(t){var e=t[0],n=t[1],i=t[2],o=t[3],a=this.transitionsBetween(e,o),f=this.transitionsBetween(n,o),s=r.shiftPoint(e,n,(f+1)*4),u=r.shiftPoint(i,n,(a+1)*4);a=this.transitionsBetween(s,o),f=this.transitionsBetween(u,o);var c=new R(o.getX()+(i.getX()-n.getX())/(a+1),o.getY()+(i.getY()-n.getY())/(a+1)),h=new R(o.getX()+(e.getX()-n.getX())/(f+1),o.getY()+(e.getY()-n.getY())/(f+1));if(!this.isValid(c))return this.isValid(h)?h:null;if(!this.isValid(h))return c;var l=this.transitionsBetween(s,c)+this.transitionsBetween(u,c),d=this.transitionsBetween(s,h)+this.transitionsBetween(u,h);return l>d?c:h},r.prototype.shiftToModuleCenter=function(t){var e=t[0],n=t[1],i=t[2],o=t[3],a=this.transitionsBetween(e,o)+1,f=this.transitionsBetween(i,o)+1,s=r.shiftPoint(e,n,f*4),u=r.shiftPoint(i,n,a*4);a=this.transitionsBetween(s,o)+1,f=this.transitionsBetween(u,o)+1,(a&1)===1&&(a+=1),(f&1)===1&&(f+=1);var c=(e.getX()+n.getX()+i.getX()+o.getX())/4,h=(e.getY()+n.getY()+i.getY()+o.getY())/4;e=r.moveAway(e,c,h),n=r.moveAway(n,c,h),i=r.moveAway(i,c,h),o=r.moveAway(o,c,h);var l,d;return s=r.shiftPoint(e,n,f*4),s=r.shiftPoint(s,o,a*4),l=r.shiftPoint(n,e,f*4),l=r.shiftPoint(l,i,a*4),u=r.shiftPoint(i,o,f*4),u=r.shiftPoint(u,n,a*4),d=r.shiftPoint(o,i,f*4),d=r.shiftPoint(d,e,a*4),[s,l,u,d]},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,i,o,a,f){var s=de.getInstance();return s.sampleGrid(t,a,f,.5,.5,a-.5,.5,a-.5,f-.5,.5,f-.5,e.getX(),e.getY(),o.getX(),o.getY(),i.getX(),i.getY(),n.getX(),n.getY())},r.prototype.transitionsBetween=function(t,e){var n=Math.trunc(t.getX()),i=Math.trunc(t.getY()),o=Math.trunc(e.getX()),a=Math.trunc(e.getY()),f=Math.abs(a-i)>Math.abs(o-n);if(f){var s=n;n=i,i=s,s=o,o=a,a=s}for(var u=Math.abs(o-n),c=Math.abs(a-i),h=-u/2,l=i<a?1:-1,d=n<o?1:-1,p=0,v=this.image.get(f?i:n,f?n:i),g=n,y=i;g!==o;g+=d){var m=this.image.get(f?y:g,f?g:y);if(m!==v&&(p++,v=m),h+=c,h>0){if(y===a)break;y+=l,h-=u}}return p},r})(),Jn=Jf;var $f=(function(){function r(){this.decoder=new qn}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n,i;if(e!=null&&e.has(k.PURE_BARCODE)){var o=r.extractPureBits(t.getBlackMatrix());n=this.decoder.decode(o),i=r.NO_POINTS}else{var a=new Jn(t.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),i=a.getPoints()}var f=n.getRawBytes(),s=new Z(n.getText(),f,8*f.length,i,C.DATA_MATRIX,V.currentTimeMillis()),u=n.getByteSegments();u!=null&&s.putMetadata(ft.BYTE_SEGMENTS,u);var c=n.getECLevel();return c!=null&&s.putMetadata(ft.ERROR_CORRECTION_LEVEL,c),s},r.prototype.reset=function(){},r.extractPureBits=function(t){var e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e==null||n==null)throw new A;var i=this.moduleSize(e,t),o=e[1],a=n[1],f=e[0],s=n[0],u=(s-f+1)/i,c=(a-o+1)/i;if(u<=0||c<=0)throw new A;var h=i/2;o+=h,f+=h;for(var l=new at(u,c),d=0;d<c;d++)for(var p=o+d*i,v=0;v<u;v++)t.get(f+v*i,p)&&l.set(v,d);return l},r.moduleSize=function(t,e){for(var n=e.getWidth(),i=t[0],o=t[1];i<n&&e.get(i,o);)i++;if(i===n)throw new A;var a=i-t[0];if(a===0)throw new A;return a},r.NO_POINTS=[],r})(),oe=$f;var t1=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Iv=(function(r){t1(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new oe,e)||this}return t})(Mt);var Se;(function(r){r[r.L=0]="L",r[r.M=1]="M",r[r.Q=2]="Q",r[r.H=3]="H"})(Se||(Se={}));var e1=(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 st(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 O;return r.FOR_BITS.get(t)},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.L=new r(Se.L,"L",1),r.M=new r(Se.M,"M",0),r.Q=new r(Se.Q,"Q",3),r.H=new r(Se.H,"H",2),r})(),Nt=e1;var r1=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.")},n1=(function(){function r(t){this.errorCorrectionLevel=Nt.forBits(t>>3&3),this.dataMask=t&7}return r.numBitsDiffering=function(t,e){return M.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,i,o=Number.MAX_SAFE_INTEGER,a=0;try{for(var f=r1(r.FORMAT_INFO_DECODE_LOOKUP),s=f.next();!s.done;s=f.next()){var u=s.value,c=u[0];if(c===t||c===e)return new r(u[1]);var h=r.numBitsDiffering(t,c);h<o&&(a=u[1],o=h),t!==e&&(h=r.numBitsDiffering(e,c),h<o&&(a=u[1],o=h))}}catch(l){n={error:l}}finally{try{s&&!s.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}return o<=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})(),Xe=n1;var i1=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.")},o1=(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,i=this.ecBlocks;try{for(var o=i1(i),a=o.next();!a.done;a=o.next()){var f=a.value;n+=f.getCount()}}catch(s){t={error:s}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}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})(),E=o1;var a1=(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})(),x=a1;var f1=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.")},s1=(function(){function r(t,e){for(var n,i,o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];this.versionNumber=t,this.alignmentPatternCenters=e,this.ecBlocks=o;var f=0,s=o[0].getECCodewordsPerBlock(),u=o[0].getECBlocks();try{for(var c=f1(u),h=c.next();!h.done;h=c.next()){var l=h.value;f+=l.getCount()*(l.getDataCodewords()+s)}}catch(d){n={error:d}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}this.totalCodewords=f}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 S;try{return this.getVersionForNumber((t-17)/4)}catch{throw new S}},r.getVersionForNumber=function(t){if(t<1||t>40)throw new O;return r.VERSIONS[t-1]},r.decodeVersionInformation=function(t){for(var e=Number.MAX_SAFE_INTEGER,n=0,i=0;i<r.VERSION_DECODE_INFO.length;i++){var o=r.VERSION_DECODE_INFO[i];if(o===t)return r.getVersionForNumber(i+7);var a=Xe.numBitsDiffering(t,o);a<e&&(n=i+7,e=a)}return e<=3?r.getVersionForNumber(n):null},r.prototype.buildFunctionPattern=function(){var t=this.getDimensionForVersion(),e=new at(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,i=0;i<n;i++)for(var o=this.alignmentPatternCenters[i]-2,a=0;a<n;a++)i===0&&(a===0||a===n-1)||i===n-1&&a===0||e.setRegion(this.alignmentPatternCenters[a]-2,o,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 E(7,new x(1,19)),new E(10,new x(1,16)),new E(13,new x(1,13)),new E(17,new x(1,9))),new r(2,Int32Array.from([6,18]),new E(10,new x(1,34)),new E(16,new x(1,28)),new E(22,new x(1,22)),new E(28,new x(1,16))),new r(3,Int32Array.from([6,22]),new E(15,new x(1,55)),new E(26,new x(1,44)),new E(18,new x(2,17)),new E(22,new x(2,13))),new r(4,Int32Array.from([6,26]),new E(20,new x(1,80)),new E(18,new x(2,32)),new E(26,new x(2,24)),new E(16,new x(4,9))),new r(5,Int32Array.from([6,30]),new E(26,new x(1,108)),new E(24,new x(2,43)),new E(18,new x(2,15),new x(2,16)),new E(22,new x(2,11),new x(2,12))),new r(6,Int32Array.from([6,34]),new E(18,new x(2,68)),new E(16,new x(4,27)),new E(24,new x(4,19)),new E(28,new x(4,15))),new r(7,Int32Array.from([6,22,38]),new E(20,new x(2,78)),new E(18,new x(4,31)),new E(18,new x(2,14),new x(4,15)),new E(26,new x(4,13),new x(1,14))),new r(8,Int32Array.from([6,24,42]),new E(24,new x(2,97)),new E(22,new x(2,38),new x(2,39)),new E(22,new x(4,18),new x(2,19)),new E(26,new x(4,14),new x(2,15))),new r(9,Int32Array.from([6,26,46]),new E(30,new x(2,116)),new E(22,new x(3,36),new x(2,37)),new E(20,new x(4,16),new x(4,17)),new E(24,new x(4,12),new x(4,13))),new r(10,Int32Array.from([6,28,50]),new E(18,new x(2,68),new x(2,69)),new E(26,new x(4,43),new x(1,44)),new E(24,new x(6,19),new x(2,20)),new E(28,new x(6,15),new x(2,16))),new r(11,Int32Array.from([6,30,54]),new E(20,new x(4,81)),new E(30,new x(1,50),new x(4,51)),new E(28,new x(4,22),new x(4,23)),new E(24,new x(3,12),new x(8,13))),new r(12,Int32Array.from([6,32,58]),new E(24,new x(2,92),new x(2,93)),new E(22,new x(6,36),new x(2,37)),new E(26,new x(4,20),new x(6,21)),new E(28,new x(7,14),new x(4,15))),new r(13,Int32Array.from([6,34,62]),new E(26,new x(4,107)),new E(22,new x(8,37),new x(1,38)),new E(24,new x(8,20),new x(4,21)),new E(22,new x(12,11),new x(4,12))),new r(14,Int32Array.from([6,26,46,66]),new E(30,new x(3,115),new x(1,116)),new E(24,new x(4,40),new x(5,41)),new E(20,new x(11,16),new x(5,17)),new E(24,new x(11,12),new x(5,13))),new r(15,Int32Array.from([6,26,48,70]),new E(22,new x(5,87),new x(1,88)),new E(24,new x(5,41),new x(5,42)),new E(30,new x(5,24),new x(7,25)),new E(24,new x(11,12),new x(7,13))),new r(16,Int32Array.from([6,26,50,74]),new E(24,new x(5,98),new x(1,99)),new E(28,new x(7,45),new x(3,46)),new E(24,new x(15,19),new x(2,20)),new E(30,new x(3,15),new x(13,16))),new r(17,Int32Array.from([6,30,54,78]),new E(28,new x(1,107),new x(5,108)),new E(28,new x(10,46),new x(1,47)),new E(28,new x(1,22),new x(15,23)),new E(28,new x(2,14),new x(17,15))),new r(18,Int32Array.from([6,30,56,82]),new E(30,new x(5,120),new x(1,121)),new E(26,new x(9,43),new x(4,44)),new E(28,new x(17,22),new x(1,23)),new E(28,new x(2,14),new x(19,15))),new r(19,Int32Array.from([6,30,58,86]),new E(28,new x(3,113),new x(4,114)),new E(26,new x(3,44),new x(11,45)),new E(26,new x(17,21),new x(4,22)),new E(26,new x(9,13),new x(16,14))),new r(20,Int32Array.from([6,34,62,90]),new E(28,new x(3,107),new x(5,108)),new E(26,new x(3,41),new x(13,42)),new E(30,new x(15,24),new x(5,25)),new E(28,new x(15,15),new x(10,16))),new r(21,Int32Array.from([6,28,50,72,94]),new E(28,new x(4,116),new x(4,117)),new E(26,new x(17,42)),new E(28,new x(17,22),new x(6,23)),new E(30,new x(19,16),new x(6,17))),new r(22,Int32Array.from([6,26,50,74,98]),new E(28,new x(2,111),new x(7,112)),new E(28,new x(17,46)),new E(30,new x(7,24),new x(16,25)),new E(24,new x(34,13))),new r(23,Int32Array.from([6,30,54,78,102]),new E(30,new x(4,121),new x(5,122)),new E(28,new x(4,47),new x(14,48)),new E(30,new x(11,24),new x(14,25)),new E(30,new x(16,15),new x(14,16))),new r(24,Int32Array.from([6,28,54,80,106]),new E(30,new x(6,117),new x(4,118)),new E(28,new x(6,45),new x(14,46)),new E(30,new x(11,24),new x(16,25)),new E(30,new x(30,16),new x(2,17))),new r(25,Int32Array.from([6,32,58,84,110]),new E(26,new x(8,106),new x(4,107)),new E(28,new x(8,47),new x(13,48)),new E(30,new x(7,24),new x(22,25)),new E(30,new x(22,15),new x(13,16))),new r(26,Int32Array.from([6,30,58,86,114]),new E(28,new x(10,114),new x(2,115)),new E(28,new x(19,46),new x(4,47)),new E(28,new x(28,22),new x(6,23)),new E(30,new x(33,16),new x(4,17))),new r(27,Int32Array.from([6,34,62,90,118]),new E(30,new x(8,122),new x(4,123)),new E(28,new x(22,45),new x(3,46)),new E(30,new x(8,23),new x(26,24)),new E(30,new x(12,15),new x(28,16))),new r(28,Int32Array.from([6,26,50,74,98,122]),new E(30,new x(3,117),new x(10,118)),new E(28,new x(3,45),new x(23,46)),new E(30,new x(4,24),new x(31,25)),new E(30,new x(11,15),new x(31,16))),new r(29,Int32Array.from([6,30,54,78,102,126]),new E(30,new x(7,116),new x(7,117)),new E(28,new x(21,45),new x(7,46)),new E(30,new x(1,23),new x(37,24)),new E(30,new x(19,15),new x(26,16))),new r(30,Int32Array.from([6,26,52,78,104,130]),new E(30,new x(5,115),new x(10,116)),new E(28,new x(19,47),new x(10,48)),new E(30,new x(15,24),new x(25,25)),new E(30,new x(23,15),new x(25,16))),new r(31,Int32Array.from([6,30,56,82,108,134]),new E(30,new x(13,115),new x(3,116)),new E(28,new x(2,46),new x(29,47)),new E(30,new x(42,24),new x(1,25)),new E(30,new x(23,15),new x(28,16))),new r(32,Int32Array.from([6,34,60,86,112,138]),new E(30,new x(17,115)),new E(28,new x(10,46),new x(23,47)),new E(30,new x(10,24),new x(35,25)),new E(30,new x(19,15),new x(35,16))),new r(33,Int32Array.from([6,30,58,86,114,142]),new E(30,new x(17,115),new x(1,116)),new E(28,new x(14,46),new x(21,47)),new E(30,new x(29,24),new x(19,25)),new E(30,new x(11,15),new x(46,16))),new r(34,Int32Array.from([6,34,62,90,118,146]),new E(30,new x(13,115),new x(6,116)),new E(28,new x(14,46),new x(23,47)),new E(30,new x(44,24),new x(7,25)),new E(30,new x(59,16),new x(1,17))),new r(35,Int32Array.from([6,30,54,78,102,126,150]),new E(30,new x(12,121),new x(7,122)),new E(28,new x(12,47),new x(26,48)),new E(30,new x(39,24),new x(14,25)),new E(30,new x(22,15),new x(41,16))),new r(36,Int32Array.from([6,24,50,76,102,128,154]),new E(30,new x(6,121),new x(14,122)),new E(28,new x(6,47),new x(34,48)),new E(30,new x(46,24),new x(10,25)),new E(30,new x(2,15),new x(64,16))),new r(37,Int32Array.from([6,28,54,80,106,132,158]),new E(30,new x(17,122),new x(4,123)),new E(28,new x(29,46),new x(14,47)),new E(30,new x(49,24),new x(10,25)),new E(30,new x(24,15),new x(46,16))),new r(38,Int32Array.from([6,32,58,84,110,136,162]),new E(30,new x(4,122),new x(18,123)),new E(28,new x(13,46),new x(32,47)),new E(30,new x(48,24),new x(14,25)),new E(30,new x(42,15),new x(32,16))),new r(39,Int32Array.from([6,26,54,82,110,138,166]),new E(30,new x(20,117),new x(4,118)),new E(28,new x(40,47),new x(7,48)),new E(30,new x(43,24),new x(22,25)),new E(30,new x(10,15),new x(67,16))),new r(40,Int32Array.from([6,30,58,86,114,142,170]),new E(30,new x(19,118),new x(6,119)),new E(28,new x(18,47),new x(31,48)),new E(30,new x(34,24),new x(34,25)),new E(30,new x(20,15),new x(61,16)))],r})(),Vt=s1;var Et;(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"})(Et||(Et={}));var u1=(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 i=0;i<e;i++)this.isMasked(n,i)&&t.flip(i,n)},r.values=new Map([[Et.DATA_MASK_000,new r(Et.DATA_MASK_000,function(t,e){return(t+e&1)===0})],[Et.DATA_MASK_001,new r(Et.DATA_MASK_001,function(t,e){return(t&1)===0})],[Et.DATA_MASK_010,new r(Et.DATA_MASK_010,function(t,e){return e%3===0})],[Et.DATA_MASK_011,new r(Et.DATA_MASK_011,function(t,e){return(t+e)%3===0})],[Et.DATA_MASK_100,new r(Et.DATA_MASK_100,function(t,e){return(Math.floor(t/2)+Math.floor(e/3)&1)===0})],[Et.DATA_MASK_101,new r(Et.DATA_MASK_101,function(t,e){return t*e%6===0})],[Et.DATA_MASK_110,new r(Et.DATA_MASK_110,function(t,e){return t*e%6<3})],[Et.DATA_MASK_111,new r(Et.DATA_MASK_111,function(t,e){return(t+e+t*e%3&1)===0})]]),r})(),lr=u1;var c1=(function(){function r(t){var e=t.getHeight();if(e<21||(e&3)!==1)throw new S;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);for(var i=this.bitMatrix.getHeight(),o=0,a=i-7,n=i-1;n>=a;n--)o=this.copyBit(8,n,o);for(var e=i-8;e<i;e++)o=this.copyBit(e,8,o);if(this.parsedFormatInfo=Xe.decodeFormatInformation(t,o),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new S},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 Vt.getVersionForNumber(e);for(var n=0,i=t-11,o=5;o>=0;o--)for(var a=t-9;a>=i;a--)n=this.copyBit(a,o,n);var f=Vt.decodeVersionInformation(n);if(f!==null&&f.getDimensionForVersion()===t)return this.parsedVersion=f,f;n=0;for(var a=5;a>=0;a--)for(var o=t-9;o>=i;o--)n=this.copyBit(a,o,n);if(f=Vt.decodeVersionInformation(n),f!==null&&f.getDimensionForVersion()===t)return this.parsedVersion=f,f;throw new S},r.prototype.copyBit=function(t,e,n){var i=this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e);return i?n<<1|1:n<<1},r.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),n=lr.values.get(t.getDataMask()),i=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,i);for(var o=e.buildFunctionPattern(),a=!0,f=new Uint8Array(e.getTotalCodewords()),s=0,u=0,c=0,h=i-1;h>0;h-=2){h===6&&h--;for(var l=0;l<i;l++)for(var d=a?i-1-l:l,p=0;p<2;p++)o.get(h-p,d)||(c++,u<<=1,this.bitMatrix.get(h-p,d)&&(u|=1),c===8&&(f[s++]=u,c=0,u=0));a=!a}if(s!==e.getTotalCodewords())throw new S;return f},r.prototype.remask=function(){if(this.parsedFormatInfo!==null){var t=lr.values.get(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 i=e+1,o=t.getHeight();i<o;i++)t.get(e,i)!==t.get(i,e)&&(t.flip(i,e),t.flip(e,i))},r})(),$n=c1;var ti=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.")},h1=(function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e,n){var i,o,a,f;if(t.length!==e.getTotalCodewords())throw new O;var s=e.getECBlocksForLevel(n),u=0,c=s.getECBlocks();try{for(var h=ti(c),l=h.next();!l.done;l=h.next()){var d=l.value;u+=d.getCount()}}catch(ut){i={error:ut}}finally{try{l&&!l.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}var p=new Array(u),v=0;try{for(var g=ti(c),y=g.next();!y.done;y=g.next())for(var d=y.value,m=0;m<d.getCount();m++){var w=d.getDataCodewords(),_=s.getECCodewordsPerBlock()+w;p[v++]=new r(w,new Uint8Array(_))}}catch(ut){a={error:ut}}finally{try{y&&!y.done&&(f=g.return)&&f.call(g)}finally{if(a)throw a.error}}for(var I=p[0].codewords.length,T=p.length-1;T>=0;){var D=p[T].codewords.length;if(D===I)break;T--}T++;for(var b=I-s.getECCodewordsPerBlock(),L=0,m=0;m<b;m++)for(var B=0;B<v;B++)p[B].codewords[m]=t[L++];for(var B=T;B<v;B++)p[B].codewords[b]=t[L++];for(var vt=p[0].codewords.length,m=b;m<vt;m++)for(var B=0;B<v;B++){var z=B<T?m:m+1;p[B].codewords[z]=t[L++]}return p},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r})(),ei=h1;var Lt;(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"})(Lt||(Lt={}));var l1=(function(){function r(t,e,n,i){this.value=t,this.stringValue=e,this.characterCountBitsForVersions=n,this.bits=i,r.FOR_BITS.set(i,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 O;return e},r.prototype.getCharacterCountBits=function(t){var e=t.getVersionNumber(),n;return e<=9?n=0:e<=26?n=1:n=2,this.characterCountBitsForVersions[n]},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(Lt.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),r.NUMERIC=new r(Lt.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),r.ALPHANUMERIC=new r(Lt.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),r.STRUCTURED_APPEND=new r(Lt.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),r.BYTE=new r(Lt.BYTE,"BYTE",Int32Array.from([8,16,16]),4),r.ECI=new r(Lt.ECI,"ECI",Int32Array.from([0,0,0]),7),r.KANJI=new r(Lt.KANJI,"KANJI",Int32Array.from([8,10,12]),8),r.FNC1_FIRST_POSITION=new r(Lt.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),r.FNC1_SECOND_POSITION=new r(Lt.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),r.HANZI=new r(Lt.HANZI,"HANZI",Int32Array.from([8,10,12]),13),r})(),et=l1;var d1=(function(){function r(){}return r.decode=function(t,e,n,i){var o=new We(t),a=new P,f=new Array,s=-1,u=-1;try{var c=null,h=!1,l=void 0;do{if(o.available()<4)l=et.TERMINATOR;else{var d=o.readBits(4);l=et.forBits(d)}switch(l){case et.TERMINATOR:break;case et.FNC1_FIRST_POSITION:case et.FNC1_SECOND_POSITION:h=!0;break;case et.STRUCTURED_APPEND:if(o.available()<16)throw new S;s=o.readBits(8),u=o.readBits(8);break;case et.ECI:var p=r.parseECIValue(o);if(c=ot.getCharacterSetECIByValue(p),c===null)throw new S;break;case et.HANZI:var v=o.readBits(4),g=o.readBits(l.getCharacterCountBits(e));v===r.GB2312_SUBSET&&r.decodeHanziSegment(o,a,g);break;default:var y=o.readBits(l.getCharacterCountBits(e));switch(l){case et.NUMERIC:r.decodeNumericSegment(o,a,y);break;case et.ALPHANUMERIC:r.decodeAlphanumericSegment(o,a,y,h);break;case et.BYTE:r.decodeByteSegment(o,a,y,c,f,i);break;case et.KANJI:r.decodeKanjiSegment(o,a,y);break;default:throw new S}break}}while(l!==et.TERMINATOR)}catch{throw new S}return new Zt(t,a.toString(),f.length===0?null:f,n===null?null:n.toString(),s,u)},r.decodeHanziSegment=function(t,e,n){if(n*13>t.available())throw new S;for(var i=new Uint8Array(2*n),o=0;n>0;){var a=t.readBits(13),f=a/96<<8&4294967295|a%96;f<959?f+=41377:f+=42657,i[o]=f>>8&255,i[o+1]=f&255,o+=2,n--}try{e.append(yt.decode(i,F.GB2312))}catch(s){throw new S(s)}},r.decodeKanjiSegment=function(t,e,n){if(n*13>t.available())throw new S;for(var i=new Uint8Array(2*n),o=0;n>0;){var a=t.readBits(13),f=a/192<<8&4294967295|a%192;f<7936?f+=33088:f+=49472,i[o]=f>>8,i[o+1]=f,o+=2,n--}try{e.append(yt.decode(i,F.SHIFT_JIS))}catch(s){throw new S(s)}},r.decodeByteSegment=function(t,e,n,i,o,a){if(8*n>t.available())throw new S;for(var f=new Uint8Array(n),s=0;s<n;s++)f[s]=t.readBits(8);var u;i===null?u=F.guessEncoding(f,a):u=i.getName();try{e.append(yt.decode(f,u))}catch(c){throw new S(c)}o.push(f)},r.toAlphaNumericChar=function(t){if(t>=r.ALPHANUMERIC_CHARS.length)throw new S;return r.ALPHANUMERIC_CHARS[t]},r.decodeAlphanumericSegment=function(t,e,n,i){for(var o=e.length();n>1;){if(t.available()<11)throw new S;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 S;e.append(r.toAlphaNumericChar(t.readBits(6)))}if(i)for(var f=o;f<e.length();f++)e.charAt(f)==="%"&&(f<e.length()-1&&e.charAt(f+1)==="%"?e.deleteCharAt(f+1):e.setCharAt(f,""))},r.decodeNumericSegment=function(t,e,n){for(;n>=3;){if(t.available()<10)throw new S;var i=t.readBits(10);if(i>=1e3)throw new S;e.append(r.toAlphaNumericChar(Math.floor(i/100))),e.append(r.toAlphaNumericChar(Math.floor(i/10)%10)),e.append(r.toAlphaNumericChar(i%10)),n-=3}if(n===2){if(t.available()<7)throw new S;var o=t.readBits(7);if(o>=100)throw new S;e.append(r.toAlphaNumericChar(Math.floor(o/10))),e.append(r.toAlphaNumericChar(o%10))}else if(n===1){if(t.available()<4)throw new S;var a=t.readBits(4);if(a>=10)throw new S;e.append(r.toAlphaNumericChar(a))}},r.parseECIValue=function(t){var e=t.readBits(8);if((e&128)===0)return e&127;if((e&192)===128){var n=t.readBits(8);return(e&63)<<8&4294967295|n}if((e&224)===192){var i=t.readBits(16);return(e&31)<<16&4294967295|i}throw new S},r.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",r.GB2312_SUBSET=1,r})(),Jr=d1;var p1=(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})(),dr=p1;var 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.")},v1=(function(){function r(){this.rsDecoder=new jt(dt.QR_CODE_FIELD_256)}return r.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(at.parseFromBooleanArray(t),e)},r.prototype.decodeBitMatrix=function(t,e){var n=new $n(t),i=null;try{return this.decodeBitMatrixParser(n,e)}catch(a){i=a}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var o=this.decodeBitMatrixParser(n,e);return o.setOther(new dr(!0)),o}catch(a){throw i!==null?i:a}},r.prototype.decodeBitMatrixParser=function(t,e){var n,i,o,a,f=t.readVersion(),s=t.readFormatInformation().getErrorCorrectionLevel(),u=t.readCodewords(),c=ei.getDataBlocks(u,f,s),h=0;try{for(var l=ri(c),d=l.next();!d.done;d=l.next()){var p=d.value;h+=p.getNumDataCodewords()}}catch(T){n={error:T}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}var v=new Uint8Array(h),g=0;try{for(var y=ri(c),m=y.next();!m.done;m=y.next()){var p=m.value,w=p.getCodewords(),_=p.getNumDataCodewords();this.correctErrors(w,_);for(var I=0;I<_;I++)v[g++]=w[I]}}catch(T){o={error:T}}finally{try{m&&!m.done&&(a=y.return)&&a.call(y)}finally{if(o)throw o.error}}return Jr.decode(v,f,s,e)},r.prototype.correctErrors=function(t,e){var n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch{throw new j}for(var i=0;i<e;i++)t[i]=n[i]},r})(),ni=v1;var x1=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),g1=(function(r){x1(t,r);function t(e,n,i){var o=r.call(this,e,n)||this;return o.estimatedModuleSize=i,o}return t.prototype.aboutEquals=function(e,n,i){if(Math.abs(n-this.getY())<=e&&Math.abs(i-this.getX())<=e){var o=Math.abs(e-this.estimatedModuleSize);return o<=1||o<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,i){var o=(this.getX()+n)/2,a=(this.getY()+e)/2,f=(this.estimatedModuleSize+i)/2;return new t(o,a,f)},t})(R),ii=g1;var m1=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.")},y1=(function(){function r(t,e,n,i,o,a,f){this.image=t,this.startX=e,this.startY=n,this.width=i,this.height=o,this.moduleSize=a,this.resultPointCallback=f,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return r.prototype.find=function(){for(var t=this.startX,e=this.height,n=this.width,i=t+n,o=this.startY+e/2,a=new Int32Array(3),f=this.image,s=0;s<e;s++){var u=o+((s&1)===0?Math.floor((s+1)/2):-Math.floor((s+1)/2));a[0]=0,a[1]=0,a[2]=0;for(var c=t;c<i&&!f.get(c,u);)c++;for(var h=0;c<i;){if(f.get(c,u))if(h===1)a[1]++;else if(h===2){if(this.foundPatternCross(a)){var l=this.handlePossibleCenter(a,u,c);if(l!==null)return l}a[0]=a[2],a[1]=1,a[2]=0,h=1}else a[++h]++;else h===1&&h++,a[h]++;c++}if(this.foundPatternCross(a)){var l=this.handlePossibleCenter(a,u,i);if(l!==null)return l}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new A},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,i=0;i<3;i++)if(Math.abs(e-t[i])>=n)return!1;return!0},r.prototype.crossCheckVertical=function(t,e,n,i){var o=this.image,a=o.getHeight(),f=this.crossCheckStateCount;f[0]=0,f[1]=0,f[2]=0;for(var s=t;s>=0&&o.get(e,s)&&f[1]<=n;)f[1]++,s--;if(s<0||f[1]>n)return NaN;for(;s>=0&&!o.get(e,s)&&f[0]<=n;)f[0]++,s--;if(f[0]>n)return NaN;for(s=t+1;s<a&&o.get(e,s)&&f[1]<=n;)f[1]++,s++;if(s===a||f[1]>n)return NaN;for(;s<a&&!o.get(e,s)&&f[2]<=n;)f[2]++,s++;if(f[2]>n)return NaN;var u=f[0]+f[1]+f[2];return 5*Math.abs(u-i)>=2*i?NaN:this.foundPatternCross(f)?r.centerFromEnd(f,s):NaN},r.prototype.handlePossibleCenter=function(t,e,n){var i,o,a=t[0]+t[1]+t[2],f=r.centerFromEnd(t,n),s=this.crossCheckVertical(e,f,2*t[1],a);if(!isNaN(s)){var u=(t[0]+t[1]+t[2])/3;try{for(var c=m1(this.possibleCenters),h=c.next();!h.done;h=c.next()){var l=h.value;if(l.aboutEquals(u,s,f))return l.combineEstimate(s,f,u)}}catch(p){i={error:p}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}var d=new ii(f,s,u);this.possibleCenters.push(d),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(d)}return null},r})(),oi=y1;var w1=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),A1=(function(r){w1(t,r);function t(e,n,i,o){var a=r.call(this,e,n)||this;return a.estimatedModuleSize=i,a.count=o,o===void 0&&(a.count=1),a}return t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,n,i){if(Math.abs(n-this.getY())<=e&&Math.abs(i-this.getX())<=e){var o=Math.abs(e-this.estimatedModuleSize);return o<=1||o<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,i){var o=this.count+1,a=(this.count*this.getX()+n)/o,f=(this.count*this.getY()+e)/o,s=(this.count*this.estimatedModuleSize+i)/o;return new t(a,f,s,o)},t})(R),ai=A1;var E1=(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})(),fi=E1;var ze=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.")},_1=(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(k.TRY_HARDER)!==void 0,n=t!=null&&t.get(k.PURE_BARCODE)!==void 0,i=this.image,o=i.getHeight(),a=i.getWidth(),f=Math.floor(3*o/(4*r.MAX_MODULES));(f<r.MIN_SKIP||e)&&(f=r.MIN_SKIP);for(var s=!1,u=new Int32Array(5),c=f-1;c<o&&!s;c+=f){u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0;for(var h=0,l=0;l<a;l++)if(i.get(l,c))(h&1)===1&&h++,u[h]++;else if((h&1)===0)if(h===4)if(r.foundPatternCross(u)){var d=this.handlePossibleCenter(u,c,l,n);if(d===!0)if(f=2,this.hasSkipped===!0)s=this.haveMultiplyConfirmedCenters();else{var p=this.findRowSkip();p>u[2]&&(c+=p-u[2]-f,l=a-1)}else{u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,h=3;continue}h=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,h=3;else u[++h]++;else u[h]++;if(r.foundPatternCross(u)){var d=this.handlePossibleCenter(u,c,a,n);d===!0&&(f=u[0],this.hasSkipped&&(s=this.haveMultiplyConfirmedCenters()))}}var v=this.selectBestPatterns();return R.orderBestPatterns(v),new fi(v)},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 i=t[n];if(i===0)return!1;e+=i}if(e<7)return!1;var o=e/7,a=o/2;return Math.abs(o-t[0])<a&&Math.abs(o-t[1])<a&&Math.abs(3*o-t[2])<3*a&&Math.abs(o-t[3])<a&&Math.abs(o-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,i){for(var o=this.getCrossCheckStateCount(),a=0,f=this.image;t>=a&&e>=a&&f.get(e-a,t-a);)o[2]++,a++;if(t<a||e<a)return!1;for(;t>=a&&e>=a&&!f.get(e-a,t-a)&&o[1]<=n;)o[1]++,a++;if(t<a||e<a||o[1]>n)return!1;for(;t>=a&&e>=a&&f.get(e-a,t-a)&&o[0]<=n;)o[0]++,a++;if(o[0]>n)return!1;var s=f.getHeight(),u=f.getWidth();for(a=1;t+a<s&&e+a<u&&f.get(e+a,t+a);)o[2]++,a++;if(t+a>=s||e+a>=u)return!1;for(;t+a<s&&e+a<u&&!f.get(e+a,t+a)&&o[3]<n;)o[3]++,a++;if(t+a>=s||e+a>=u||o[3]>=n)return!1;for(;t+a<s&&e+a<u&&f.get(e+a,t+a)&&o[4]<n;)o[4]++,a++;if(o[4]>=n)return!1;var c=o[0]+o[1]+o[2]+o[3]+o[4];return Math.abs(c-i)<2*i&&r.foundPatternCross(o)},r.prototype.crossCheckVertical=function(t,e,n,i){for(var o=this.image,a=o.getHeight(),f=this.getCrossCheckStateCount(),s=t;s>=0&&o.get(e,s);)f[2]++,s--;if(s<0)return NaN;for(;s>=0&&!o.get(e,s)&&f[1]<=n;)f[1]++,s--;if(s<0||f[1]>n)return NaN;for(;s>=0&&o.get(e,s)&&f[0]<=n;)f[0]++,s--;if(f[0]>n)return NaN;for(s=t+1;s<a&&o.get(e,s);)f[2]++,s++;if(s===a)return NaN;for(;s<a&&!o.get(e,s)&&f[3]<n;)f[3]++,s++;if(s===a||f[3]>=n)return NaN;for(;s<a&&o.get(e,s)&&f[4]<n;)f[4]++,s++;if(f[4]>=n)return NaN;var u=f[0]+f[1]+f[2]+f[3]+f[4];return 5*Math.abs(u-i)>=2*i?NaN:r.foundPatternCross(f)?r.centerFromEnd(f,s):NaN},r.prototype.crossCheckHorizontal=function(t,e,n,i){for(var o=this.image,a=o.getWidth(),f=this.getCrossCheckStateCount(),s=t;s>=0&&o.get(s,e);)f[2]++,s--;if(s<0)return NaN;for(;s>=0&&!o.get(s,e)&&f[1]<=n;)f[1]++,s--;if(s<0||f[1]>n)return NaN;for(;s>=0&&o.get(s,e)&&f[0]<=n;)f[0]++,s--;if(f[0]>n)return NaN;for(s=t+1;s<a&&o.get(s,e);)f[2]++,s++;if(s===a)return NaN;for(;s<a&&!o.get(s,e)&&f[3]<n;)f[3]++,s++;if(s===a||f[3]>=n)return NaN;for(;s<a&&o.get(s,e)&&f[4]<n;)f[4]++,s++;if(f[4]>=n)return NaN;var u=f[0]+f[1]+f[2]+f[3]+f[4];return 5*Math.abs(u-i)>=i?NaN:r.foundPatternCross(f)?r.centerFromEnd(f,s):NaN},r.prototype.handlePossibleCenter=function(t,e,n,i){var o=t[0]+t[1]+t[2]+t[3]+t[4],a=r.centerFromEnd(t,n),f=this.crossCheckVertical(e,Math.floor(a),t[2],o);if(!isNaN(f)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(f),t[2],o),!isNaN(a)&&(!i||this.crossCheckDiagonal(Math.floor(f),Math.floor(a),t[2],o)))){for(var s=o/7,u=!1,c=this.possibleCenters,h=0,l=c.length;h<l;h++){var d=c[h];if(d.aboutEquals(s,f,a)){c[h]=d.combineEstimate(f,a,s),u=!0;break}}if(!u){var p=new ai(a,f,s);c.push(p),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(p)}return!0}return!1},r.prototype.findRowSkip=function(){var t,e,n=this.possibleCenters.length;if(n<=1)return 0;var i=null;try{for(var o=ze(this.possibleCenters),a=o.next();!a.done;a=o.next()){var f=a.value;if(f.getCount()>=r.CENTER_QUORUM)if(i==null)i=f;else return this.hasSkipped=!0,Math.floor((Math.abs(i.getX()-f.getX())-Math.abs(i.getY()-f.getY()))/2)}}catch(s){t={error:s}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return 0},r.prototype.haveMultiplyConfirmedCenters=function(){var t,e,n,i,o=0,a=0,f=this.possibleCenters.length;try{for(var s=ze(this.possibleCenters),u=s.next();!u.done;u=s.next()){var c=u.value;c.getCount()>=r.CENTER_QUORUM&&(o++,a+=c.getEstimatedModuleSize())}}catch(v){t={error:v}}finally{try{u&&!u.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}if(o<3)return!1;var h=a/f,l=0;try{for(var d=ze(this.possibleCenters),p=d.next();!p.done;p=d.next()){var c=p.value;l+=Math.abs(c.getEstimatedModuleSize()-h)}}catch(v){n={error:v}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}return l<=.05*a},r.prototype.selectBestPatterns=function(){var t,e,n,i,o=this.possibleCenters.length;if(o<3)throw new A;var a=this.possibleCenters,f;if(o>3){var s=0,u=0;try{for(var c=ze(this.possibleCenters),h=c.next();!h.done;h=c.next()){var l=h.value,d=l.getEstimatedModuleSize();s+=d,u+=d*d}}catch(I){t={error:I}}finally{try{h&&!h.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}f=s/o;var p=Math.sqrt(u/o-f*f);a.sort(function(I,T){var D=Math.abs(T.getEstimatedModuleSize()-f),b=Math.abs(I.getEstimatedModuleSize()-f);return D<b?-1:D>b?1:0});for(var v=Math.max(.2*f,p),g=0;g<a.length&&a.length>3;g++){var y=a[g];Math.abs(y.getEstimatedModuleSize()-f)>v&&(a.splice(g,1),g--)}}if(a.length>3){var s=0;try{for(var m=ze(a),w=m.next();!w.done;w=m.next()){var _=w.value;s+=_.getEstimatedModuleSize()}}catch(T){n={error:T}}finally{try{w&&!w.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}f=s/a.length,a.sort(function(T,D){if(D.getCount()===T.getCount()){var b=Math.abs(D.getEstimatedModuleSize()-f),L=Math.abs(T.getEstimatedModuleSize()-f);return b<L?1:b>L?-1:0}else return D.getCount()-T.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},r.CENTER_QUORUM=2,r.MIN_SKIP=3,r.MAX_MODULES=57,r})(),si=_1;var C1=(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(k.NEED_RESULT_POINT_CALLBACK);var e=new si(this.image,this.resultPointCallback),n=e.find(t);return this.processFinderPatternInfo(n)},r.prototype.processFinderPatternInfo=function(t){var e=t.getTopLeft(),n=t.getTopRight(),i=t.getBottomLeft(),o=this.calculateModuleSize(e,n,i);if(o<1)throw new A("No pattern found in proccess finder.");var a=r.computeDimension(e,n,i,o),f=Vt.getProvisionalVersionForDimension(a),s=f.getDimensionForVersion()-7,u=null;if(f.getAlignmentPatternCenters().length>0)for(var c=n.getX()-e.getX()+i.getX(),h=n.getY()-e.getY()+i.getY(),l=1-3/s,d=Math.floor(e.getX()+l*(c-e.getX())),p=Math.floor(e.getY()+l*(h-e.getY())),v=4;v<=16;v<<=1)try{u=this.findAlignmentInRegion(o,d,p,v);break}catch(w){if(!(w instanceof A))throw w}var g=r.createTransform(e,n,i,u,a),y=r.sampleGrid(this.image,g,a),m;return u===null?m=[i,e,n]:m=[i,e,n,u],new le(y,m)},r.createTransform=function(t,e,n,i,o){var a=o-3.5,f,s,u,c;return i!==null?(f=i.getX(),s=i.getY(),u=a-3,c=u):(f=e.getX()-t.getX()+n.getX(),s=e.getY()-t.getY()+n.getY(),u=a,c=a),Ve.quadrilateralToQuadrilateral(3.5,3.5,a,3.5,u,c,3.5,a,t.getX(),t.getY(),e.getX(),e.getY(),f,s,n.getX(),n.getY())},r.sampleGrid=function(t,e,n){var i=de.getInstance();return i.sampleGridWithTransform(t,n,n,e)},r.computeDimension=function(t,e,n,i){var o=G.round(R.distance(t,e)/i),a=G.round(R.distance(t,n)/i),f=Math.floor((o+a)/2)+7;switch(f&3){case 0:f++;break;case 2:f--;break;case 3:throw new A("Dimensions could be not found.")}return f},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())),i=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(n)?i/7:isNaN(i)?n/7:(n+i)/14},r.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,n,i){var o=this.sizeOfBlackWhiteBlackRun(t,e,n,i),a=1,f=t-(n-t);f<0?(a=t/(t-f),f=0):f>=this.image.getWidth()&&(a=(this.image.getWidth()-1-t)/(f-t),f=this.image.getWidth()-1);var s=Math.floor(e-(i-e)*a);return a=1,s<0?(a=e/(e-s),s=0):s>=this.image.getHeight()&&(a=(this.image.getHeight()-1-e)/(s-e),s=this.image.getHeight()-1),f=Math.floor(t+(f-t)*a),o+=this.sizeOfBlackWhiteBlackRun(t,e,f,s),o-1},r.prototype.sizeOfBlackWhiteBlackRun=function(t,e,n,i){var o=Math.abs(i-e)>Math.abs(n-t);if(o){var a=t;t=e,e=a,a=n,n=i,i=a}for(var f=Math.abs(n-t),s=Math.abs(i-e),u=-f/2,c=t<n?1:-1,h=e<i?1:-1,l=0,d=n+c,p=t,v=e;p!==d;p+=c){var g=o?v:p,y=o?p:v;if(l===1===this.image.get(g,y)){if(l===2)return G.distance(p,v,t,e);l++}if(u+=s,u>0){if(v===i)break;v+=h,u-=f}}return l===2?G.distance(n+c,i,t,e):NaN},r.prototype.findAlignmentInRegion=function(t,e,n,i){var o=Math.floor(i*t),a=Math.max(0,e-o),f=Math.min(this.image.getWidth()-1,e+o);if(f-a<t*3)throw new A("Alignment top exceeds estimated module size.");var s=Math.max(0,n-o),u=Math.min(this.image.getHeight()-1,n+o);if(u-s<t*3)throw new A("Alignment bottom exceeds estimated module size.");var c=new oi(this.image,a,s,f-a,u-s,t,this.resultPointCallback);return c.find()},r})(),ui=C1;var I1=(function(){function r(){this.decoder=new ni}return r.prototype.getDecoder=function(){return this.decoder},r.prototype.decode=function(t,e){var n,i;if(e!=null&&e.get(k.PURE_BARCODE)!==void 0){var o=r.extractPureBits(t.getBlackMatrix());n=this.decoder.decodeBitMatrix(o,e),i=r.NO_POINTS}else{var a=new ui(t.getBlackMatrix()).detect(e);n=this.decoder.decodeBitMatrix(a.getBits(),e),i=a.getPoints()}n.getOther()instanceof dr&&n.getOther().applyMirroredCorrection(i);var f=new Z(n.getText(),n.getRawBytes(),void 0,i,C.QR_CODE,void 0),s=n.getByteSegments();s!==null&&f.putMetadata(ft.BYTE_SEGMENTS,s);var u=n.getECLevel();return u!==null&&f.putMetadata(ft.ERROR_CORRECTION_LEVEL,u),n.hasStructuredAppend()&&(f.putMetadata(ft.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),f.putMetadata(ft.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),f},r.prototype.reset=function(){},r.extractPureBits=function(t){var e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e===null||n===null)throw new A;var i=this.moduleSize(e,t),o=e[1],a=n[1],f=e[0],s=n[0];if(f>=s||o>=a)throw new A;if(a-o!==s-f&&(s=f+(a-o),s>=t.getWidth()))throw new A;var u=Math.round((s-f+1)/i),c=Math.round((a-o+1)/i);if(u<=0||c<=0)throw new A;if(c!==u)throw new A;var h=Math.floor(i/2);o+=h,f+=h;var l=f+Math.floor((u-1)*i)-s;if(l>0){if(l>h)throw new A;f-=l}var d=o+Math.floor((c-1)*i)-a;if(d>0){if(d>h)throw new A;o-=d}for(var p=new at(u,c),v=0;v<c;v++)for(var g=o+Math.floor(v*i),y=0;y<u;y++)t.get(f+Math.floor(y*i),g)&&p.set(y,v);return p},r.moduleSize=function(t,e){for(var n=e.getHeight(),i=e.getWidth(),o=t[0],a=t[1],f=!0,s=0;o<i&&a<n;){if(f!==e.get(o,a)){if(++s===5)break;f=!f}o++,a++}if(o===i||a===n)throw new A;return(o-t[0])/7},r.NO_POINTS=new Array,r})(),ae=I1;var S1=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.")},O1=(function(){function r(){}return r.prototype.PDF417Common=function(){},r.getBitCountSum=function(t){return G.sum(t)},r.toIntArray=function(t){var e,n;if(t==null||!t.length)return r.EMPTY_INT_ARRAY;var i=new Int32Array(t.length),o=0;try{for(var a=S1(t),f=a.next();!f.done;f=a.next()){var s=f.value;i[o++]=s}}catch(u){e={error:u}}finally{try{f&&!f.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i},r.getCodeword=function(t){var e=Y.binarySearch(r.SYMBOL_TABLE,t&262143);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})(),W=O1;var T1=(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})(),ci=T1;var D1=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.")},R1=(function(){function r(){}return r.detectMultiple=function(t,e,n){var i=t.getBlackMatrix(),o=r.detect(n,i);return o.length||(i=i.clone(),i.rotate180(),o=r.detect(n,i)),new ci(i,o)},r.detect=function(t,e){for(var n,i,o=new Array,a=0,f=0,s=!1;a<e.getHeight();){var u=r.findVertices(e,a,f);if(u[0]==null&&u[3]==null){if(!s)break;s=!1,f=0;try{for(var c=(n=void 0,D1(o)),h=c.next();!h.done;h=c.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&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}a+=r.ROW_STEP;continue}if(s=!0,o.push(u),!t)break;u[2]!=null?(f=Math.trunc(u[2].getX()),a=Math.trunc(u[2].getY())):(f=Math.trunc(u[4].getX()),a=Math.trunc(u[4].getY()))}return o},r.findVertices=function(t,e,n){var i=t.getHeight(),o=t.getWidth(),a=new Array(8);return r.copyToResult(a,r.findRowsWithPattern(t,i,o,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,i,o,e,n,r.STOP_PATTERN),r.INDEXES_STOP_PATTERN),a},r.copyToResult=function(t,e,n){for(var i=0;i<n.length;i++)t[n[i]]=e[i]},r.findRowsWithPattern=function(t,e,n,i,o,a){for(var f=new Array(4),s=!1,u=new Int32Array(a.length);i<e;i+=r.ROW_STEP){var c=r.findGuardPattern(t,o,i,n,!1,a,u);if(c!=null){for(;i>0;){var h=r.findGuardPattern(t,o,--i,n,!1,a,u);if(h!=null)c=h;else{i++;break}}f[0]=new R(c[0],i),f[1]=new R(c[1],i),s=!0;break}}var l=i+1;if(s){for(var d=0,h=Int32Array.from([Math.trunc(f[0].getX()),Math.trunc(f[1].getX())]);l<e;l++){var c=r.findGuardPattern(t,h[0],l,n,!1,a,u);if(c!=null&&Math.abs(h[0]-c[0])<r.MAX_PATTERN_DRIFT&&Math.abs(h[1]-c[1])<r.MAX_PATTERN_DRIFT)h=c,d=0;else{if(d>r.SKIPPED_ROW_COUNT_MAX)break;d++}}l-=d+1,f[2]=new R(h[0],l),f[3]=new R(h[1],l)}return l-i<r.BARCODE_MIN_HEIGHT&&Y.fill(f,null),f},r.findGuardPattern=function(t,e,n,i,o,a,f){Y.fillWithin(f,0,f.length,0);for(var s=e,u=0;t.get(s,n)&&s>0&&u++<r.MAX_PIXEL_DRIFT;)s--;for(var c=s,h=0,l=a.length,d=o;c<i;c++){var p=t.get(c,n);if(p!==d)f[h]++;else{if(h===l-1){if(r.patternMatchVariance(f,a,r.MAX_INDIVIDUAL_VARIANCE)<r.MAX_AVG_VARIANCE)return new Int32Array([s,c]);s+=f[0]+f[1],V.arraycopy(f,2,f,0,h-1),f[h-1]=0,f[h]=0,h--}else h++;f[h]=1,d=!d}}return h===l-1&&r.patternMatchVariance(f,a,r.MAX_INDIVIDUAL_VARIANCE)<r.MAX_AVG_VARIANCE?new Int32Array([s,c-1]):null},r.patternMatchVariance=function(t,e,n){for(var i=t.length,o=0,a=0,f=0;f<i;f++)o+=t[f],a+=e[f];if(o<a)return 1/0;var s=o/a;n*=s;for(var u=0,c=0;c<i;c++){var h=t[c],l=e[c]*s,d=h>l?h-l:l-h;if(d>n)return 1/0;u+=d}return u/o},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})(),hi=R1;var N1=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.")},b1=(function(){function r(t,e){if(e.length===0)throw new O;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var i=1;i<n&&e[i]===0;)i++;i===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-i),V.arraycopy(e,i,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 i=0;try{for(var o=N1(this.coefficients),a=o.next();!a.done;a=o.next()){var f=a.value;i=this.field.add(i,f)}}catch(h){e={error:h}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i}for(var s=this.coefficients[0],u=this.coefficients.length,c=1;c<u;c++)s=this.field.add(this.field.multiply(t,s),this.coefficients[c]);return s},r.prototype.add=function(t){if(!this.field.equals(t.field))throw new O("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 i=e;e=n,n=i}var o=new Int32Array(n.length),a=n.length-e.length;V.arraycopy(n,0,o,0,a);for(var f=a;f<n.length;f++)o[f]=this.field.add(e[f-a],n[f]);return new r(this.field,o)},r.prototype.subtract=function(t){if(!this.field.equals(t.field))throw new O("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 O("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,i=t.coefficients,o=i.length,a=new Int32Array(n+o-1),f=0;f<n;f++)for(var s=e[f],u=0;u<o;u++)a[f+u]=this.field.add(a[f+u],this.field.multiply(s,i[u]));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),i=0;i<e;i++)n[i]=this.field.multiply(this.coefficients[i],t);return new r(this.field,n)},r.prototype.multiplyByMonomial=function(t,e){if(t<0)throw new O;if(e===0)return new r(this.field,new Int32Array([0]));for(var n=this.coefficients.length,i=new Int32Array(n+t),o=0;o<n;o++)i[o]=this.field.multiply(this.coefficients[o],e);return new r(this.field,i)},r.prototype.toString=function(){for(var t=new P,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})(),Qt=b1;var P1=(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 O;return this.logTable[t]},r.prototype.inverse=function(t){if(t===0)throw new Ue;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})(),li=P1;var M1=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),B1=(function(r){M1(t,r);function t(e,n){var i=r.call(this)||this;i.modulus=e,i.expTable=new Int32Array(e),i.logTable=new Int32Array(e);for(var o=1,a=0;a<e;a++)i.expTable[a]=o,o=o*n%e;for(var a=0;a<e-1;a++)i.logTable[i.expTable[a]]=a;return i.zero=new Qt(i,new Int32Array([0])),i.one=new Qt(i,new Int32Array([1])),i}return 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 O;if(n===0)return this.zero;var i=new Int32Array(e+1);return i[0]=n,new Qt(this,i)},t.PDF417_GF=new t(W.NUMBER_OF_CODEWORDS,3),t})(li),di=B1;var F1=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.")},L1=(function(){function r(){this.field=di.PDF417_GF}return r.prototype.decode=function(t,e,n){for(var i,o,a=new Qt(this.field,t),f=new Int32Array(e),s=!1,u=e;u>0;u--){var c=a.evaluateAt(this.field.exp(u));f[e-u]=c,c!==0&&(s=!0)}if(!s)return 0;var h=this.field.getOne();if(n!=null)try{for(var l=F1(n),d=l.next();!d.done;d=l.next()){var p=d.value,v=this.field.exp(t.length-1-p),g=new Qt(this.field,new Int32Array([this.field.subtract(0,v),1]));h=h.multiply(g)}}catch(b){i={error:b}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}for(var y=new Qt(this.field,f),m=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),y,e),w=m[0],_=m[1],I=this.findErrorLocations(w),T=this.findErrorMagnitudes(_,w,I),u=0;u<I.length;u++){var D=t.length-1-this.field.log(I[u]);if(D<0)throw j.getChecksumInstance();t[D]=this.field.subtract(t[D],T[u])}return I.length},r.prototype.runEuclideanAlgorithm=function(t,e,n){if(t.getDegree()<e.getDegree()){var i=t;t=e,e=i}for(var o=t,a=e,f=this.field.getZero(),s=this.field.getOne();a.getDegree()>=Math.round(n/2);){var u=o,c=f;if(o=a,f=s,o.isZero())throw j.getChecksumInstance();a=u;for(var h=this.field.getZero(),l=o.getCoefficient(o.getDegree()),d=this.field.inverse(l);a.getDegree()>=o.getDegree()&&!a.isZero();){var p=a.getDegree()-o.getDegree(),v=this.field.multiply(a.getCoefficient(a.getDegree()),d);h=h.add(this.field.buildMonomial(p,v)),a=a.subtract(o.multiplyByMonomial(p,v))}s=h.multiply(f).subtract(c).negative()}var g=s.getCoefficient(0);if(g===0)throw j.getChecksumInstance();var y=this.field.inverse(g),m=s.multiply(y),w=a.multiply(y);return[m,w]},r.prototype.findErrorLocations=function(t){for(var e=t.getDegree(),n=new Int32Array(e),i=0,o=1;o<this.field.getSize()&&i<e;o++)t.evaluateAt(o)===0&&(n[i]=this.field.inverse(o),i++);if(i!==e)throw j.getChecksumInstance();return n},r.prototype.findErrorMagnitudes=function(t,e,n){for(var i=e.getDegree(),o=new Int32Array(i),a=1;a<=i;a++)o[i-a]=this.field.multiply(a,e.getCoefficient(a));for(var f=new Qt(this.field,o),s=n.length,u=new Int32Array(s),a=0;a<s;a++){var c=this.field.inverse(n[a]),h=this.field.subtract(0,t.evaluateAt(c)),l=this.field.inverse(f.evaluateAt(c));u[a]=this.field.multiply(h,l)}return u},r})(),$r=L1;var k1=(function(){function r(t,e,n,i,o){t instanceof r?this.constructor_2(t):this.constructor_1(t,e,n,i,o)}return r.prototype.constructor_1=function(t,e,n,i,o){var a=e==null||n==null,f=i==null||o==null;if(a&&f)throw new A;a?(e=new R(0,i.getY()),n=new R(0,o.getY())):f&&(i=new R(t.getWidth()-1,e.getY()),o=new R(t.getWidth()-1,n.getY())),this.image=t,this.topLeft=e,this.bottomLeft=n,this.topRight=i,this.bottomRight=o,this.minX=Math.trunc(Math.min(e.getX(),n.getX())),this.maxX=Math.trunc(Math.max(i.getX(),o.getX())),this.minY=Math.trunc(Math.min(e.getY(),i.getY())),this.maxY=Math.trunc(Math.max(n.getY(),o.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 i=this.topLeft,o=this.bottomLeft,a=this.topRight,f=this.bottomRight;if(t>0){var s=n?this.topLeft:this.topRight,u=Math.trunc(s.getY()-t);u<0&&(u=0);var c=new R(s.getX(),u);n?i=c:a=c}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?o=d:f=d}return new r(this.image,i,o,a,f)},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})(),Ze=k1;var U1=(function(){function r(t,e,n,i){this.columnCount=t,this.errorCorrectionLevel=i,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})(),pi=U1;var H1=(function(){function r(){this.buffer=""}return r.form=function(t,e){var n=-1;function i(a,f,s,u,c,h){if(a==="%%")return"%";if(e[++n]!==void 0){a=u?parseInt(u.substr(1)):void 0;var l=c?parseInt(c.substr(1)):void 0,d;switch(h){case"s":d=e[n];break;case"c":d=e[n][0];break;case"f":d=parseFloat(e[n]).toFixed(a);break;case"p":d=parseFloat(e[n]).toPrecision(a);break;case"e":d=parseFloat(e[n]).toExponential(a);break;case"x":d=parseInt(e[n]).toString(l||16);break;case"d":d=parseFloat(parseInt(e[n],l||10).toPrecision(a)).toFixed(0);break}d=typeof d=="object"?JSON.stringify(d):(+d).toString(l);for(var p=parseInt(s),v=s&&s[0]+""=="0"?"0":" ";d.length<p;)d=f!==void 0?d+v:v+d;return d}}var o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(o,i)},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})(),Oe=H1;var V1=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.")},G1=(function(){function r(t){this.boundingBox=new Ze(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 i=this.imageRowToCodewordIndex(t)-n;if(i>=0&&(e=this.codewords[i],e!=null)||(i=this.imageRowToCodewordIndex(t)+n,i<this.codewords.length&&(e=this.codewords[i],e!=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 Oe,i=0;try{for(var o=V1(this.codewords),a=o.next();!a.done;a=o.next()){var f=a.value;if(f==null){n.format("%3d: | %n",i++);continue}n.format("%3d: %3d|%3d%n",i++,f.getRowNumber(),f.getValue())}}catch(s){t={error:s}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n.toString()},r.MAX_NEARBY_DISTANCE=5,r})(),pr=G1;var W1=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.")},X1=function(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(f){a={error:f}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(a)throw a.error}}return o},z1=(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,i=new Array,o=function(h,l){var d={getKey:function(){return h},getValue:function(){return l}};d.getValue()>n?(n=d.getValue(),i=[],i.push(d.getKey())):d.getValue()===n&&i.push(d.getKey())};try{for(var a=W1(this.values.entries()),f=a.next();!f.done;f=a.next()){var s=X1(f.value,2),u=s[0],c=s[1];o(u,c)}}catch(h){t={error:h}}finally{try{f&&!f.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return W.toIntArray(i)},r.prototype.getConfidence=function(t){return this.values.get(t)},r})(),xe=z1;var Z1=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),tn=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.")},j1=(function(r){Z1(t,r);function t(e,n){var i=r.call(this,e)||this;return i._isLeft=n,i}return t.prototype.setRowNumbers=function(){var e,n;try{for(var i=tn(this.getCodewords()),o=i.next();!o.done;o=i.next()){var a=o.value;a?.setRowNumberAsRowIndicatorColumn()}}catch(f){e={error:f}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var n=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(n,e);for(var i=this.getBoundingBox(),o=this._isLeft?i.getTopLeft():i.getTopRight(),a=this._isLeft?i.getBottomLeft():i.getBottomRight(),f=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=this.imageRowToCodewordIndex(Math.trunc(a.getY())),u=-1,c=1,h=0,l=f;l<s;l++)if(n[l]!=null){var d=n[l],p=d.getRowNumber()-u;if(p===0)h++;else if(p===1)c=Math.max(c,h),h=1,u=d.getRowNumber();else if(p<0||d.getRowNumber()>=e.getRowCount()||p>l)n[l]=null;else{var v=void 0;c>2?v=(c-2)*p:v=p;for(var g=v>=l,y=1;y<=v&&!g;y++)g=n[l-y]!=null;g?n[l]=null:(u=d.getRowNumber(),h=1)}}},t.prototype.getRowHeights=function(){var e,n,i=this.getBarcodeMetadata();if(i==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(i);var o=new Int32Array(i.getRowCount());try{for(var a=tn(this.getCodewords()),f=a.next();!f.done;f=a.next()){var s=f.value;if(s!=null){var u=s.getRowNumber();if(u>=o.length)continue;o[u]++}}}catch(c){e={error:c}}finally{try{f&&!f.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return o},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var n=this.getBoundingBox(),i=this._isLeft?n.getTopLeft():n.getTopRight(),o=this._isLeft?n.getBottomLeft():n.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(i.getY())),f=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=this.getCodewords(),u=-1,c=1,h=0,l=a;l<f;l++)if(s[l]!=null){var d=s[l];d.setRowNumberAsRowIndicatorColumn();var p=d.getRowNumber()-u;p===0?h++:p===1?(c=Math.max(c,h),h=1,u=d.getRowNumber()):d.getRowNumber()>=e.getRowCount()?s[l]=null:(u=d.getRowNumber(),h=1)}},t.prototype.getBarcodeMetadata=function(){var e,n,i=this.getCodewords(),o=new xe,a=new xe,f=new xe,s=new xe;try{for(var u=tn(i),c=u.next();!c.done;c=u.next()){var h=c.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(l*3+1);break;case 1:s.setValue(l/3),f.setValue(l%3);break;case 2:o.setValue(l+1);break}}}}catch(v){e={error:v}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}if(o.getValue().length===0||a.getValue().length===0||f.getValue().length===0||s.getValue().length===0||o.getValue()[0]<1||a.getValue()[0]+f.getValue()[0]<W.MIN_ROWS_IN_BARCODE||a.getValue()[0]+f.getValue()[0]>W.MAX_ROWS_IN_BARCODE)return null;var p=new pi(o.getValue()[0],a.getValue()[0],f.getValue()[0],s.getValue()[0]);return this.removeIncorrectCodewords(i,p),p},t.prototype.removeIncorrectCodewords=function(e,n){for(var i=0;i<e.length;i++){var o=e[i];if(e[i]!=null){var a=o.getValue()%30,f=o.getRowNumber();if(f>n.getRowCount()){e[i]=null;continue}switch(this._isLeft||(f+=2),f%3){case 0:a*3+1!==n.getRowCountUpperPart()&&(e[i]=null);break;case 1:(Math.trunc(a/3)!==n.getErrorCorrectionLevel()||a%3!==n.getRowCountLowerPart())&&(e[i]=null);break;case 2:a+1!==n.getColumnCount()&&(e[i]=null);break}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+`
7
- `+r.prototype.toString.call(this)},t})(pr),en=j1;var Y1=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.")},K1=(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=W.MAX_CODEWORDS_IN_BARCODE,e;do e=t,t=this.adjustRowNumbersAndGetCount();while(t>0&&t<e);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(),i=0;i<n.length;i++)n[i]!=null&&(n[i].hasValidRowNumber()||this.adjustRowNumbers(e,i,n));return t},r.prototype.adjustRowNumbersByRow=function(){this.adjustRowNumbersFromBothRI();var t=this.adjustRowNumbersFromLRI();return t+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 i=1;i<=this.barcodeColumnCount;i++){var o=this.detectionResultColumns[i].getCodewords()[n];o!=null&&(o.setRowNumber(t[n].getRowNumber()),o.hasValidRowNumber()||(this.detectionResultColumns[i].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 i=e[n].getRowNumber(),o=0,a=this.barcodeColumnCount+1;a>0&&o<this.ADJUST_ROW_NUMBER_SKIP;a--){var f=this.detectionResultColumns[a].getCodewords()[n];f!=null&&(o=r.adjustRowNumberIfValid(i,o,f),f.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 i=e[n].getRowNumber(),o=0,a=1;a<this.barcodeColumnCount+1&&o<this.ADJUST_ROW_NUMBER_SKIP;a++){var f=this.detectionResultColumns[a].getCodewords()[n];f!=null&&(o=r.adjustRowNumberIfValid(i,o,f),f.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 i,o;if(this.detectionResultColumns[t-1]!=null){var a=n[e],f=this.detectionResultColumns[t-1].getCodewords(),s=f;this.detectionResultColumns[t+1]!=null&&(s=this.detectionResultColumns[t+1].getCodewords());var u=new Array(14);u[2]=f[e],u[3]=s[e],e>0&&(u[0]=n[e-1],u[4]=f[e-1],u[5]=s[e-1]),e>1&&(u[8]=n[e-2],u[10]=f[e-2],u[11]=s[e-2]),e<n.length-1&&(u[1]=n[e+1],u[6]=f[e+1],u[7]=s[e+1]),e<n.length-2&&(u[9]=n[e+2],u[12]=f[e+2],u[13]=s[e+2]);try{for(var c=Y1(u),h=c.next();!h.done;h=c.next()){var l=h.value;if(r.adjustRowNumber(a,l))return}}catch(d){i={error:d}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}}},r.adjustRowNumber=function(t,e){return e==null?!1:e.hasValidRowNumber()&&e.getBucket()===t.getBucket()?(t.setRowNumber(e.getRowNumber()),!0):!1},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 Oe,n=0;n<t.getCodewords().length;n++){e.format("CW %3d:",n);for(var i=0;i<this.barcodeColumnCount+2;i++){if(this.detectionResultColumns[i]==null){e.format(" | ");continue}var o=this.detectionResultColumns[i].getCodewords()[n];if(o==null){e.format(" | ");continue}e.format(" %3d|%3d",o.getRowNumber(),o.getValue())}e.format("%n")}return e.toString()},r})(),vi=K1;var Q1=(function(){function r(t,e,n,i){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(i)}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(Math.trunc(this.value/30)*3+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})(),xi=Q1;var q1=(function(){function r(){}return r.initialize=function(){for(var t=0;t<W.SYMBOL_TABLE.length;t++)for(var e=W.SYMBOL_TABLE[t],n=e&1,i=0;i<W.BARS_IN_MODULE;i++){for(var o=0;(e&1)===n;)o+=1,e>>=1;n=e&1,r.RATIOS_TABLE[t]||(r.RATIOS_TABLE[t]=new Array(W.BARS_IN_MODULE)),r.RATIOS_TABLE[t][W.BARS_IN_MODULE-i-1]=Math.fround(o/W.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=G.sum(t),n=new Int32Array(W.BARS_IN_MODULE),i=0,o=0,a=0;a<W.MODULES_IN_CODEWORD;a++){var f=e/(2*W.MODULES_IN_CODEWORD)+a*e/W.MODULES_IN_CODEWORD;o+t[i]<=f&&(o+=t[i],i++),n[i]++}return n},r.getDecodedCodewordValue=function(t){var e=r.getBitValue(t);return W.getCodeword(e)===-1?-1:e},r.getBitValue=function(t){for(var e=0,n=0;n<t.length;n++)for(var i=0;i<t[n];i++)e=e<<1|(n%2===0?1:0);return Math.trunc(e)},r.getClosestDecodedValue=function(t){var e=G.sum(t),n=new Array(W.BARS_IN_MODULE);if(e>1)for(var i=0;i<n.length;i++)n[i]=Math.fround(t[i]/e);var o=He.MAX_VALUE,a=-1;this.bSymbolTableReady||r.initialize();for(var f=0;f<r.RATIOS_TABLE.length;f++){for(var s=0,u=r.RATIOS_TABLE[f],c=0;c<W.BARS_IN_MODULE;c++){var h=Math.fround(u[c]-n[c]);if(s+=Math.fround(h*h),s>=o)break}s<o&&(o=s,a=W.SYMBOL_TABLE[f])}return a},r.bSymbolTableReady=!1,r.RATIOS_TABLE=new Array(W.SYMBOL_TABLE.length).map(function(t){return t=new Array(W.BARS_IN_MODULE)}),r})(),gi=q1;var J1=(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})(),rn=J1;var $1=(function(){function r(){}return r.parseLong=function(t,e){return e===void 0&&(e=void 0),parseInt(t,e)},r})(),nn=$1;var ts=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),es=(function(r){ts(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="NullPointerException",t})($),mi=es;var rs=(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 mi;if(e<0||e>t.length||n<0||e+n>t.length||e+n<0)throw new ye;if(n===0)return;for(var i=0;i<n;i++)this.write(t[e+i])},r.prototype.flush=function(){},r.prototype.close=function(){},r})(),yi=rs;var ns=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),is=(function(r){ns(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t})($),wi=is;var os=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),as=(function(r){os(t,r);function t(e){e===void 0&&(e=32);var n=r.call(this)||this;if(n.count=0,e<0)throw new O("Negative initial size: "+e);return n.buf=new Uint8Array(e),n}return t.prototype.ensureCapacity=function(e){e-this.buf.length>0&&this.grow(e)},t.prototype.grow=function(e){var n=this.buf.length,i=n<<1;if(i-e<0&&(i=e),i<0){if(e<0)throw new wi;i=M.MAX_VALUE}this.buf=Y.copyOfUint8Array(this.buf,i)},t.prototype.write=function(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1},t.prototype.writeBytesOffset=function(e,n,i){if(n<0||n>e.length||i<0||n+i-e.length>0)throw new ye;this.ensureCapacity(this.count+i),V.arraycopy(e,n,this.buf,this.count,i),this.count+=i},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return Y.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),Ai=as;var rt;(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"})(rt||(rt={}));function Ei(){if(typeof window<"u")return window.BigInt||null;if(typeof global<"u")return global.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}var vr;function fe(r){if(typeof vr>"u"&&(vr=Ei()),vr===null)throw new Error("BigInt is not supported!");return vr(r)}function fs(){var r=[];r[0]=fe(1);var t=fe(900);r[1]=t;for(var e=2;e<16;e++)r[e]=r[e-1]*t;return r}var ss=(function(){function r(){}return r.decode=function(t,e){var n=new P(""),i=ot.ISO8859_1;n.enableDecoding(i);for(var o=1,a=t[o++],f=new rn;o<t[0];){switch(a){case r.TEXT_COMPACTION_MODE_LATCH:o=r.textCompaction(t,o,n);break;case r.BYTE_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:o=r.byteCompaction(a,t,i,o,n);break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(t[o++]);break;case r.NUMERIC_COMPACTION_MODE_LATCH:o=r.numericCompaction(t,o,n);break;case r.ECI_CHARSET:var s=ot.getCharacterSetECIByValue(t[o++]);break;case r.ECI_GENERAL_PURPOSE:o+=2;break;case r.ECI_USER_DEFINED:o++;break;case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:o=r.decodeMacroBlock(t,o,f);break;case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:throw new S;default:o--,o=r.textCompaction(t,o,n);break}if(o<t.length)a=t[o++];else throw S.getFormatInstance()}if(n.length()===0)throw S.getFormatInstance();var u=new Zt(null,n.toString(),null,e);return u.setOther(f),u},r.decodeMacroBlock=function(t,e,n){if(e+r.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw S.getFormatInstance();for(var i=new Int32Array(r.NUMBER_OF_SEQUENCE_CODEWORDS),o=0;o<r.NUMBER_OF_SEQUENCE_CODEWORDS;o++,e++)i[o]=t[e];n.setSegmentIndex(M.parseInt(r.decodeBase900toBase10(i,r.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new P;e=r.textCompaction(t,e,a),n.setFileId(a.toString());var f=-1;for(t[e]===r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(f=e+1);e<t[0];)switch(t[e]){case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(e++,t[e]){case r.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var s=new P;e=r.textCompaction(t,e+1,s),n.setFileName(s.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var u=new P;e=r.textCompaction(t,e+1,u),n.setSender(u.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var c=new P;e=r.textCompaction(t,e+1,c),n.setAddressee(c.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var h=new P;e=r.numericCompaction(t,e+1,h),n.setSegmentCount(M.parseInt(h.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var l=new P;e=r.numericCompaction(t,e+1,l),n.setTimestamp(nn.parseLong(l.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var d=new P;e=r.numericCompaction(t,e+1,d),n.setChecksum(M.parseInt(d.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var p=new P;e=r.numericCompaction(t,e+1,p),n.setFileSize(nn.parseLong(p.toString()));break;default:throw S.getFormatInstance()}break;case r.MACRO_PDF417_TERMINATOR:e++,n.setLastSegment(!0);break;default:throw S.getFormatInstance()}if(f!==-1){var v=e-f;n.isLastSegment()&&v--,n.setOptionalData(Y.copyOfRange(t,f,f+v))}return e},r.textCompaction=function(t,e,n){for(var i=new Int32Array((t[0]-e)*2),o=new Int32Array((t[0]-e)*2),a=0,f=!1;e<t[0]&&!f;){var s=t[e++];if(s<r.TEXT_COMPACTION_MODE_LATCH)i[a]=s/30,i[a+1]=s%30,a+=2;else switch(s){case r.TEXT_COMPACTION_MODE_LATCH:i[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--,f=!0;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i[a]=r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,s=t[e++],o[a]=s,a++;break}}return r.decodeTextCompaction(i,o,a,n),e},r.decodeTextCompaction=function(t,e,n,i){for(var o=rt.ALPHA,a=rt.ALPHA,f=0;f<n;){var s=t[f],u="";switch(o){case rt.ALPHA:if(s<26)u=String.fromCharCode(65+s);else switch(s){case 26:u=" ";break;case r.LL:o=rt.LOWER;break;case r.ML:o=rt.MIXED;break;case r.PS:a=o,o=rt.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(e[f]);break;case r.TEXT_COMPACTION_MODE_LATCH:o=rt.ALPHA;break}break;case rt.LOWER:if(s<26)u=String.fromCharCode(97+s);else switch(s){case 26:u=" ";break;case r.AS:a=o,o=rt.ALPHA_SHIFT;break;case r.ML:o=rt.MIXED;break;case r.PS:a=o,o=rt.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(e[f]);break;case r.TEXT_COMPACTION_MODE_LATCH:o=rt.ALPHA;break}break;case rt.MIXED:if(s<r.PL)u=r.MIXED_CHARS[s];else switch(s){case r.PL:o=rt.PUNCT;break;case 26:u=" ";break;case r.LL:o=rt.LOWER;break;case r.AL:o=rt.ALPHA;break;case r.PS:a=o,o=rt.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(e[f]);break;case r.TEXT_COMPACTION_MODE_LATCH:o=rt.ALPHA;break}break;case rt.PUNCT:if(s<r.PAL)u=r.PUNCT_CHARS[s];else switch(s){case r.PAL:o=rt.ALPHA;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(e[f]);break;case r.TEXT_COMPACTION_MODE_LATCH:o=rt.ALPHA;break}break;case rt.ALPHA_SHIFT:if(o=a,s<26)u=String.fromCharCode(65+s);else switch(s){case 26:u=" ";break;case r.TEXT_COMPACTION_MODE_LATCH:o=rt.ALPHA;break}break;case rt.PUNCT_SHIFT:if(o=a,s<r.PAL)u=r.PUNCT_CHARS[s];else switch(s){case r.PAL:o=rt.ALPHA;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(e[f]);break;case r.TEXT_COMPACTION_MODE_LATCH:o=rt.ALPHA;break}break}u!==""&&i.append(u),f++}},r.byteCompaction=function(t,e,n,i,o){var a=new Ai,f=0,s=0,u=!1;switch(t){case r.BYTE_COMPACTION_MODE_LATCH:for(var c=new Int32Array(6),h=e[i++];i<e[0]&&!u;)switch(c[f++]=h,s=900*s+h,h=e[i++],h){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:i--,u=!0;break;default:if(f%5===0&&f>0){for(var l=0;l<6;++l)a.write(Number(fe(s)>>fe(8*(5-l))));s=0,f=0}break}i===e[0]&&h<r.TEXT_COMPACTION_MODE_LATCH&&(c[f++]=h);for(var d=0;d<f;d++)a.write(c[d]);break;case r.BYTE_COMPACTION_MODE_LATCH_6:for(;i<e[0]&&!u;){var p=e[i++];if(p<r.TEXT_COMPACTION_MODE_LATCH)f++,s=900*s+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:i--,u=!0;break}if(f%5===0&&f>0){for(var l=0;l<6;++l)a.write(Number(fe(s)>>fe(8*(5-l))));s=0,f=0}}break}return o.append(yt.decode(a.toByteArray(),n)),i},r.numericCompaction=function(t,e,n){for(var i=0,o=!1,a=new Int32Array(r.MAX_NUMERIC_CODEWORDS);e<t[0]&&!o;){var f=t[e++];if(e===t[0]&&(o=!0),f<r.TEXT_COMPACTION_MODE_LATCH)a[i]=f,i++;else switch(f){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--,o=!0;break}(i%r.MAX_NUMERIC_CODEWORDS===0||f===r.NUMERIC_COMPACTION_MODE_LATCH||o)&&i>0&&(n.append(r.decodeBase900toBase10(a,i)),i=0)}return e},r.decodeBase900toBase10=function(t,e){for(var n=fe(0),i=0;i<e;i++)n+=r.EXP900[e-i-1]*fe(t[i]);var o=n.toString();if(o.charAt(0)!=="1")throw new S;return o.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 ,:
8
- -.$/"|*()?{}'`,r.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",r.EXP900=Ei()?fs():[],r.NUMBER_OF_SEQUENCE_CODEWORDS=2,r})(),on=ss;var 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.")},us=(function(){function r(){}return r.decode=function(t,e,n,i,o,a,f){for(var s=new Ze(t,e,n,i,o),u=null,c=null,h,l=!0;;l=!1){if(e!=null&&(u=r.getRowIndicatorColumn(t,s,e,!0,a,f)),i!=null&&(c=r.getRowIndicatorColumn(t,s,i,!1,a,f)),h=r.merge(u,c),h==null)throw A.getNotFoundInstance();var d=h.getBoundingBox();if(l&&d!=null&&(d.getMinY()<s.getMinY()||d.getMaxY()>s.getMaxY()))s=d;else break}h.setBoundingBox(s);var p=h.getBarcodeColumnCount()+1;h.setDetectionResultColumn(0,u),h.setDetectionResultColumn(p,c);for(var v=u!=null,g=1;g<=p;g++){var y=v?g:p-g;if(h.getDetectionResultColumn(y)===void 0){var m=void 0;y===0||y===p?m=new en(s,y===0):m=new pr(s),h.setDetectionResultColumn(y,m);for(var w=-1,_=w,I=s.getMinY();I<=s.getMaxY();I++){if(w=r.getStartColumn(h,y,I,v),w<0||w>s.getMaxX()){if(_===-1)continue;w=_}var T=r.detectCodeword(t,s.getMinX(),s.getMaxX(),v,w,I,a,f);T!=null&&(m.setCodeword(I,T),_=w,a=Math.min(a,T.getWidth()),f=Math.max(f,T.getWidth()))}}}return r.createDecoderResult(h)},r.merge=function(t,e){if(t==null&&e==null)return null;var n=r.getBarcodeMetadata(t,e);if(n==null)return null;var i=Ze.merge(r.adjustBoundingBox(t),r.adjustBoundingBox(e));return new vi(n,i)},r.adjustBoundingBox=function(t){var e,n;if(t==null)return null;var i=t.getRowHeights();if(i==null)return null;var o=r.getMax(i),a=0;try{for(var f=je(i),s=f.next();!s.done;s=f.next()){var u=s.value;if(a+=o-u,u>0)break}}catch(d){e={error:d}}finally{try{s&&!s.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}for(var c=t.getCodewords(),h=0;a>0&&c[h]==null;h++)a--;for(var l=0,h=i.length-1;h>=0&&(l+=o-i[h],!(i[h]>0));h--);for(var h=c.length-1;l>0&&c[h]==null;h--)l--;return t.getBoundingBox().addMissingRows(a,l,t.isLeft())},r.getMax=function(t){var e,n,i=-1;try{for(var o=je(t),a=o.next();!a.done;a=o.next()){var f=a.value;i=Math.max(i,f)}}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i},r.getBarcodeMetadata=function(t,e){var n;if(t==null||(n=t.getBarcodeMetadata())==null)return e==null?null:e.getBarcodeMetadata();var i;return e==null||(i=e.getBarcodeMetadata())==null?n:n.getColumnCount()!==i.getColumnCount()&&n.getErrorCorrectionLevel()!==i.getErrorCorrectionLevel()&&n.getRowCount()!==i.getRowCount()?null:n},r.getRowIndicatorColumn=function(t,e,n,i,o,a){for(var f=new en(e,i),s=0;s<2;s++)for(var u=s===0?1:-1,c=Math.trunc(Math.trunc(n.getX())),h=Math.trunc(Math.trunc(n.getY()));h<=e.getMaxY()&&h>=e.getMinY();h+=u){var l=r.detectCodeword(t,0,t.getWidth(),i,c,h,o,a);l!=null&&(f.setCodeword(h,l),i?c=l.getStartX():c=l.getEndX())}return f},r.adjustCodewordCount=function(t,e){var n=e[0][1],i=n.getValue(),o=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-r.getNumberOfECCodeWords(t.getBarcodeECLevel());if(i.length===0){if(o<1||o>W.MAX_CODEWORDS_IN_BARCODE)throw A.getNotFoundInstance();n.setValue(o)}else i[0]!==o&&n.setValue(o)},r.createDecoderResult=function(t){var e=r.createBarcodeMatrix(t);r.adjustCodewordCount(t,e);for(var n=new Array,i=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),o=[],a=new Array,f=0;f<t.getBarcodeRowCount();f++)for(var s=0;s<t.getBarcodeColumnCount();s++){var u=e[f][s+1].getValue(),c=f*t.getBarcodeColumnCount()+s;u.length===0?n.push(c):u.length===1?i[c]=u[0]:(a.push(c),o.push(u))}for(var h=new Array(o.length),l=0;l<h.length;l++)h[l]=o[l];return r.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),i,W.toIntArray(n),W.toIntArray(a),h)},r.createDecoderResultFromAmbiguousValues=function(t,e,n,i,o){for(var a=new Int32Array(i.length),f=100;f-- >0;){for(var s=0;s<a.length;s++)e[i[s]]=o[s][a[s]];try{return r.decodeCodewords(e,t,n)}catch(c){var u=c instanceof j;if(!u)throw c}if(a.length===0)throw j.getChecksumInstance();for(var s=0;s<a.length;s++)if(a[s]<o[s].length-1){a[s]++;break}else if(a[s]=0,s===a.length-1)throw j.getChecksumInstance()}throw j.getChecksumInstance()},r.createBarcodeMatrix=function(t){for(var e,n,i,o,a=Array.from({length:t.getBarcodeRowCount()},function(){return new Array(t.getBarcodeColumnCount()+2)}),f=0;f<a.length;f++)for(var s=0;s<a[f].length;s++)a[f][s]=new xe;var u=0;try{for(var c=je(t.getDetectionResultColumns()),h=c.next();!h.done;h=c.next()){var l=h.value;if(l!=null)try{for(var d=(i=void 0,je(l.getCodewords())),p=d.next();!p.done;p=d.next()){var v=p.value;if(v!=null){var g=v.getRowNumber();if(g>=0){if(g>=a.length)continue;a[g][u].setValue(v.getValue())}}}}catch(y){i={error:y}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}u++}}catch(y){e={error:y}}finally{try{h&&!h.done&&(n=c.return)&&n.call(c)}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,i){var o,a,f=i?1:-1,s=null;if(r.isValidBarcodeColumn(t,e-f)&&(s=t.getDetectionResultColumn(e-f).getCodeword(n)),s!=null)return i?s.getEndX():s.getStartX();if(s=t.getDetectionResultColumn(e).getCodewordNearby(n),s!=null)return i?s.getStartX():s.getEndX();if(r.isValidBarcodeColumn(t,e-f)&&(s=t.getDetectionResultColumn(e-f).getCodewordNearby(n)),s!=null)return i?s.getEndX():s.getStartX();for(var u=0;r.isValidBarcodeColumn(t,e-f);){e-=f;try{for(var c=(o=void 0,je(t.getDetectionResultColumn(e).getCodewords())),h=c.next();!h.done;h=c.next()){var l=h.value;if(l!=null)return(i?l.getEndX():l.getStartX())+f*u*(l.getEndX()-l.getStartX())}}catch(d){o={error:d}}finally{try{h&&!h.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}u++}return i?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},r.detectCodeword=function(t,e,n,i,o,a,f,s){o=r.adjustCodewordStartColumn(t,e,n,i,o,a);var u=r.getModuleBitCount(t,e,n,i,o,a);if(u==null)return null;var c,h=G.sum(u);if(i)c=o+h;else{for(var l=0;l<u.length/2;l++){var d=u[l];u[l]=u[u.length-1-l],u[u.length-1-l]=d}c=o,o=c-h}if(!r.checkCodewordSkew(h,f,s))return null;var p=gi.getDecodedValue(u),v=W.getCodeword(p);return v===-1?null:new xi(o,c,r.getCodewordBucketNumber(p),v)},r.getModuleBitCount=function(t,e,n,i,o,a){for(var f=o,s=new Int32Array(8),u=0,c=i?1:-1,h=i;(i?f<n:f>=e)&&u<s.length;)t.get(f,a)===h?(s[u]++,f+=c):(u++,h=!h);return u===s.length||f===(i?n:e)&&u===s.length-1?s:null},r.getNumberOfECCodeWords=function(t){return 2<<t},r.adjustCodewordStartColumn=function(t,e,n,i,o,a){for(var f=o,s=i?-1:1,u=0;u<2;u++){for(;(i?f>=e:f<n)&&i===t.get(f,a);){if(Math.abs(o-f)>r.CODEWORD_SKEW_SIZE)return o;f+=s}s=-s,i=!i}return f},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 S.getFormatInstance();var i=1<<e+1,o=r.correctErrors(t,n,i);r.verifyCodewordCount(t,i);var a=on.decode(t,""+e);return a.setErrorsCorrected(o),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 j.getChecksumInstance();return r.errorCorrection.decode(t,n,e)},r.verifyCodewordCount=function(t,e){if(t.length<4)throw S.getFormatInstance();var n=t[0];if(n>t.length)throw S.getFormatInstance();if(n===0)if(e<t.length)t[0]=t.length-e;else throw S.getFormatInstance()},r.getBitCountForCodeword=function(t){for(var e=new Int32Array(8),n=0,i=e.length-1;!((t&1)!==n&&(n=t&1,i--,i<0));)e[i]++,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 Oe,n=0;n<t.length;n++){e.format("Row %2d: ",n);for(var i=0;i<t[n].length;i++){var o=t[n][i];o.getValue().length===0?e.format(" ",null):e.format("%4d(%2d)",o.getValue()[0],o.getConfidence(o.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 $r,r})(),_i=us;var cs=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.")},hs=(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 A.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 S||n instanceof j?A.getNotFoundInstance():n}},r.decode=function(t,e,n){var i,o,a=new Array,f=hi.detectMultiple(t,e,n);try{for(var s=cs(f.getPoints()),u=s.next();!u.done;u=s.next()){var c=u.value,h=_i.decode(f.getBits(),c[4],c[5],c[6],c[7],r.getMinCodewordWidth(c),r.getMaxCodewordWidth(c)),l=new Z(h.getText(),h.getRawBytes(),void 0,c,C.PDF_417);l.putMetadata(ft.ERROR_CORRECTION_LEVEL,h.getECLevel());var d=h.getOther();d!=null&&l.putMetadata(ft.PDF417_EXTRA_METADATA,d),a.push(l)}}catch(p){i={error:p}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.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?M.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])*W.MODULES_IN_CODEWORD/W.MODULES_IN_STOP_PATTERN),Math.max(r.getMaxWidth(t[1],t[5]),r.getMaxWidth(t[7],t[3])*W.MODULES_IN_CODEWORD/W.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])*W.MODULES_IN_CODEWORD/W.MODULES_IN_STOP_PATTERN),Math.min(r.getMinWidth(t[1],t[5]),r.getMinWidth(t[7],t[3])*W.MODULES_IN_CODEWORD/W.MODULES_IN_STOP_PATTERN)))},r.prototype.reset=function(){},r})(),se=hs;var ls=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ds=(function(r){ls(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ReaderException",t})($),xr=ds;var 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.")},ps=(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(k.TRY_HARDER)!==void 0,n=t==null?null:t.get(k.POSSIBLE_FORMATS),i=new Array;if(n!=null){var o=n.some(function(a){return a===C.UPC_A||a===C.UPC_E||a===C.EAN_13||a===C.EAN_8||a===C.CODABAR||a===C.CODE_39||a===C.CODE_93||a===C.CODE_128||a===C.ITF||a===C.RSS_14||a===C.RSS_EXPANDED});o&&!e&&i.push(new Xt(t)),n.includes(C.QR_CODE)&&i.push(new ae),n.includes(C.DATA_MATRIX)&&i.push(new oe),n.includes(C.AZTEC)&&i.push(new te),n.includes(C.PDF_417)&&i.push(new se),o&&e&&i.push(new Xt(t))}i.length===0&&(e||i.push(new Xt(t)),i.push(new ae),i.push(new oe),i.push(new te),i.push(new se),e&&i.push(new Xt(t))),this.readers=i},r.prototype.reset=function(){var t,e;if(this.readers!==null)try{for(var n=Ci(this.readers),i=n.next();!i.done;i=n.next()){var o=i.value;o.reset()}}catch(a){t={error:a}}finally{try{i&&!i.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 xr("No readers where selected, nothing can be read.");try{for(var i=Ci(this.readers),o=i.next();!o.done;o=i.next()){var a=o.value;try{return a.decode(t,this.hints)}catch(f){if(f instanceof xr)continue}}}catch(f){e={error:f}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}throw new A("No MultiFormat Readers were able to detect the code.")},r})(),Ye=ps;var vs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),fy=(function(r){vs(t,r);function t(e,n){e===void 0&&(e=null),n===void 0&&(n=500);var i=this,o=new Ye;return o.setHints(e),i=r.call(this,o,n)||this,i}return t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t})(Mt);var xs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),hy=(function(r){xs(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new se,e)||this}return t})(Mt);var gs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),vy=(function(r){gs(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new ae,e)||this}return t})(Mt);var an;(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"})(an||(an={}));var H=an;var ms=(function(){function r(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new Bt(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],i=this.field,o=e.length;o<=t;o++){var a=n.multiply(new Bt(i,Int32Array.from([1,i.exp(o-1+i.getGeneratorBase())])));e.push(a),n=a}return e[t]},r.prototype.encode=function(t,e){if(e===0)throw new O("No error correction bytes");var n=t.length-e;if(n<=0)throw new O("No data bytes provided");var i=this.buildGenerator(e),o=new Int32Array(n);V.arraycopy(t,0,o,0,n);var a=new Bt(this.field,o);a=a.multiplyByMonomial(e,1);for(var f=a.divide(i)[1],s=f.getCoefficients(),u=e-s.length,c=0;c<u;c++)t[n+c]=0;V.arraycopy(s,0,t,n+u,s.length)},r})(),Ke=ms;var ys=(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(),i=t.getWidth(),o=t.getHeight(),a=0;a<o-1;a++)for(var f=n[a],s=0;s<i-1;s++){var u=f[s];u===f[s+1]&&u===n[a+1][s]&&u===n[a+1][s+1]&&e++}return r.N2*e},r.applyMaskPenaltyRule3=function(t){for(var e=0,n=t.getArray(),i=t.getWidth(),o=t.getHeight(),a=0;a<o;a++)for(var f=0;f<i;f++){var s=n[a];f+6<i&&s[f]===1&&s[f+1]===0&&s[f+2]===1&&s[f+3]===1&&s[f+4]===1&&s[f+5]===0&&s[f+6]===1&&(r.isWhiteHorizontal(s,f-4,f)||r.isWhiteHorizontal(s,f+7,f+11))&&e++,a+6<o&&n[a][f]===1&&n[a+1][f]===0&&n[a+2][f]===1&&n[a+3][f]===1&&n[a+4][f]===1&&n[a+5][f]===0&&n[a+6][f]===1&&(r.isWhiteVertical(n,f,a-4,a)||r.isWhiteVertical(n,f,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 i=e;i<n;i++)if(t[i]===1)return!1;return!0},r.isWhiteVertical=function(t,e,n,i){n=Math.max(n,0),i=Math.min(i,t.length);for(var o=n;o<i;o++)if(t[o][e]===1)return!1;return!0},r.applyMaskPenaltyRule4=function(t){for(var e=0,n=t.getArray(),i=t.getWidth(),o=t.getHeight(),a=0;a<o;a++)for(var f=n[a],s=0;s<i;s++)f[s]===1&&e++;var u=t.getHeight()*t.getWidth(),c=Math.floor(Math.abs(e*2-u)*10/u);return c*r.N4},r.getDataMaskBit=function(t,e,n){var i,o;switch(t){case 0:i=n+e&1;break;case 1:i=n&1;break;case 2:i=e%3;break;case 3:i=(n+e)%3;break;case 4:i=Math.floor(n/2)+Math.floor(e/3)&1;break;case 5:o=n*e,i=(o&1)+o%3;break;case 6:o=n*e,i=(o&1)+o%3&1;break;case 7:o=n*e,i=o%3+(n+e&1)&1;break;default:throw new O("Invalid mask pattern: "+t)}return i===0},r.applyMaskPenaltyRule1Internal=function(t,e){for(var n=0,i=e?t.getHeight():t.getWidth(),o=e?t.getWidth():t.getHeight(),a=t.getArray(),f=0;f<i;f++){for(var s=0,u=-1,c=0;c<o;c++){var h=e?a[f][c]:a[c][f];h===u?s++:(s>=5&&(n+=r.N1+(s-5)),s=1,u=h)}s>=5&&(n+=r.N1+(s-5))}return n},r.N1=3,r.N2=3,r.N3=40,r.N4=10,r})(),ue=ys;var ws=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.")},As=(function(){function r(t,e){this.width=t,this.height=e;for(var n=new Array(e),i=0;i!==e;i++)n[i]=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 i=ws(this.bytes),o=i.next();!o.done;o=i.next()){var a=o.value;Y.fill(a,t)}}catch(f){e={error:f}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}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,i=this.height;n<i;++n)for(var o=this.bytes[n],a=e.bytes[n],f=0,s=this.width;f<s;++f)if(o[f]!==a[f])return!1;return!0},r.prototype.toString=function(){for(var t=new P,e=0,n=this.height;e<n;++e){for(var i=this.bytes[e],o=0,a=this.width;o<a;++o)switch(i[o]){case 0:t.append(" 0");break;case 1:t.append(" 1");break;default:t.append(" ");break}t.append(`
6
+ `,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],r.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],r})(),er=ta;var ea=(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,i){var o=t-n,a=e-i;return Math.sqrt(o*o+a*a)},r.sum=function(t){for(var e=0,n=0,i=t.length;n!==i;n++){var o=t[n];e+=o}return e},r})(),G=ea;var ra=(function(){function r(){}return r.floatToIntBits=function(t){return t},r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r})(),He=ra;var na=(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*He.floatToIntBits(this.x)+He.floatToIntBits(this.y)},r.prototype.toString=function(){return"("+this.x+","+this.y+")"},r.orderBestPatterns=function(t){var e=this.distance(t[0],t[1]),n=this.distance(t[1],t[2]),i=this.distance(t[0],t[2]),o,a,f;if(n>=e&&n>=i?(a=t[0],o=t[1],f=t[2]):i>=n&&i>=e?(a=t[1],o=t[0],f=t[2]):(a=t[2],o=t[0],f=t[1]),this.crossProductZ(o,a,f)<0){var s=o;o=f,f=s}t[0]=o,t[1]=a,t[2]=f},r.distance=function(t,e){return G.distance(t.x,t.y,e.x,e.y)},r.crossProductZ=function(t,e,n){var i=e.x,o=e.y;return(n.x-i)*(t.y-o)-(n.y-o)*(t.x-i)},r})(),R=na;var ia=(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})(),he=ia;var oa=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),aa=(function(r){oa(t,r);function t(e,n,i,o,a){var f=r.call(this,e,n)||this;return f.compact=i,f.nbDatablocks=o,f.nbLayers=a,f}return t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t})(he),kr=aa;var fa=(function(){function r(t,e,n,i){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),e==null&&(e=r.INIT_SIZE),n==null&&(n=t.getWidth()/2|0),i==null&&(i=t.getHeight()/2|0);var o=e/2|0;if(this.leftInit=n-o,this.rightInit=n+o,this.upInit=i-o,this.downInit=i+o,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new A}return r.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,n=this.upInit,i=this.downInit,o=!1,a=!0,f=!1,s=!1,u=!1,c=!1,l=!1,h=this.width,d=this.height;a;){a=!1;for(var p=!0;(p||!s)&&e<h;)p=this.containsBlackPoint(n,i,e,!1),p?(e++,a=!0,s=!0):s||e++;if(e>=h){o=!0;break}for(var v=!0;(v||!u)&&i<d;)v=this.containsBlackPoint(t,e,i,!0),v?(i++,a=!0,u=!0):u||i++;if(i>=d){o=!0;break}for(var g=!0;(g||!c)&&t>=0;)g=this.containsBlackPoint(n,i,t,!1),g?(t--,a=!0,c=!0):c||t--;if(t<0){o=!0;break}for(var y=!0;(y||!l)&&n>=0;)y=this.containsBlackPoint(t,e,n,!0),y?(n--,a=!0,l=!0):l||n--;if(n<0){o=!0;break}a&&(f=!0)}if(!o&&f){for(var m=e-t,w=null,_=1;w===null&&_<m;_++)w=this.getBlackPointOnSegment(t,i-_,t+_,i);if(w==null)throw new A;for(var I=null,_=1;I===null&&_<m;_++)I=this.getBlackPointOnSegment(t,n+_,t+_,n);if(I==null)throw new A;for(var T=null,_=1;T===null&&_<m;_++)T=this.getBlackPointOnSegment(e,n+_,e-_,n);if(T==null)throw new A;for(var D=null,_=1;D===null&&_<m;_++)D=this.getBlackPointOnSegment(e,i-_,e-_,i);if(D==null)throw new A;return this.centerEdges(D,w,T,I)}else throw new A},r.prototype.getBlackPointOnSegment=function(t,e,n,i){for(var o=G.round(G.distance(t,e,n,i)),a=(n-t)/o,f=(i-e)/o,s=this.image,u=0;u<o;u++){var c=G.round(t+u*a),l=G.round(e+u*f);if(s.get(c,l))return new R(c,l)}return null},r.prototype.centerEdges=function(t,e,n,i){var o=t.getX(),a=t.getY(),f=e.getX(),s=e.getY(),u=n.getX(),c=n.getY(),l=i.getX(),h=i.getY(),d=r.CORR;return o<this.width/2?[new R(l-d,h+d),new R(f+d,s+d),new R(u-d,c-d),new R(o+d,a-d)]:[new R(l+d,h+d),new R(f+d,s-d),new R(u-d,c+d),new R(o-d,a-d)]},r.prototype.containsBlackPoint=function(t,e,n,i){var o=this.image;if(i){for(var a=t;a<=e;a++)if(o.get(a,n))return!0}else for(var f=t;f<=e;f++)if(o.get(n,f))return!0;return!1},r.INIT_SIZE=10,r.CORR=1,r})(),Ae=fa;var sa=(function(){function r(){}return r.checkAndNudgePoints=function(t,e){for(var n=t.getWidth(),i=t.getHeight(),o=!0,a=0;a<e.length&&o;a+=2){var f=Math.floor(e[a]),s=Math.floor(e[a+1]);if(f<-1||f>n||s<-1||s>i)throw new A;o=!1,f===-1?(e[a]=0,o=!0):f===n&&(e[a]=n-1,o=!0),s===-1?(e[a+1]=0,o=!0):s===i&&(e[a+1]=i-1,o=!0)}o=!0;for(var a=e.length-2;a>=0&&o;a-=2){var f=Math.floor(e[a]),s=Math.floor(e[a+1]);if(f<-1||f>n||s<-1||s>i)throw new A;o=!1,f===-1?(e[a]=0,o=!0):f===n&&(e[a]=n-1,o=!0),s===-1?(e[a+1]=0,o=!0):s===i&&(e[a+1]=i-1,o=!0)}},r})(),rr=sa;var ua=(function(){function r(t,e,n,i,o,a,f,s,u){this.a11=t,this.a21=e,this.a31=n,this.a12=i,this.a22=o,this.a32=a,this.a13=f,this.a23=s,this.a33=u}return r.quadrilateralToQuadrilateral=function(t,e,n,i,o,a,f,s,u,c,l,h,d,p,v,g){var y=r.quadrilateralToSquare(t,e,n,i,o,a,f,s),m=r.squareToQuadrilateral(u,c,l,h,d,p,v,g);return m.times(y)},r.prototype.transformPoints=function(t){for(var e=t.length,n=this.a11,i=this.a12,o=this.a13,a=this.a21,f=this.a22,s=this.a23,u=this.a31,c=this.a32,l=this.a33,h=0;h<e;h+=2){var d=t[h],p=t[h+1],v=o*d+s*p+l;t[h]=(n*d+a*p+u)/v,t[h+1]=(i*d+f*p+c)/v}},r.prototype.transformPointsWithValues=function(t,e){for(var n=this.a11,i=this.a12,o=this.a13,a=this.a21,f=this.a22,s=this.a23,u=this.a31,c=this.a32,l=this.a33,h=t.length,d=0;d<h;d++){var p=t[d],v=e[d],g=o*p+s*v+l;t[d]=(n*p+a*v+u)/g,e[d]=(i*p+f*v+c)/g}},r.squareToQuadrilateral=function(t,e,n,i,o,a,f,s){var u=t-n+o-f,c=e-i+a-s;if(u===0&&c===0)return new r(n-t,o-n,t,i-e,a-i,e,0,0,1);var l=n-o,h=f-o,d=i-a,p=s-a,v=l*p-h*d,g=(u*p-h*c)/v,y=(l*c-u*d)/v;return new r(n-t+g*n,f-t+y*f,t,i-e+g*i,s-e+y*s,e,g,y,1)},r.quadrilateralToSquare=function(t,e,n,i,o,a,f,s){return r.squareToQuadrilateral(t,e,n,i,o,a,f,s).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})(),Ve=ua;var ca=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),la=(function(r){ca(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.sampleGrid=function(e,n,i,o,a,f,s,u,c,l,h,d,p,v,g,y,m,w,_){var I=Ve.quadrilateralToQuadrilateral(o,a,f,s,u,c,l,h,d,p,v,g,y,m,w,_);return this.sampleGridWithTransform(e,n,i,I)},t.prototype.sampleGridWithTransform=function(e,n,i,o){if(n<=0||i<=0)throw new A;for(var a=new at(n,i),f=new Float32Array(2*n),s=0;s<i;s++){for(var u=f.length,c=s+.5,l=0;l<u;l+=2)f[l]=l/2+.5,f[l+1]=c;o.transformPoints(f),rr.checkAndNudgePoints(e,f);try{for(var l=0;l<u;l+=2)e.get(Math.floor(f[l]),Math.floor(f[l+1]))&&a.set(l/2,s)}catch{throw new A}}return a},t})(rr),Ur=la;var ha=(function(){function r(){}return r.setGridSampler=function(t){r.gridSampler=t},r.getInstance=function(){return r.gridSampler},r.gridSampler=new Ur,r})(),de=ha;var 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})();var da=(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 i=n[0];n[0]=n[2],n[2]=i}this.extractParameters(n);var o=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 kr(o,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 A;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 i=0,o=0;o<4;o++){var a=n[(this.shift+o)%4];this.compact?(i<<=7,i+=a>>1&127):(i<<=10,i+=(a>>2&992)+(a>>1&31))}var f=this.getCorrectedParameterData(i,this.compact);this.compact?(this.nbLayers=(f>>6)+1,this.nbDataBlocks=(f&63)+1):(this.nbLayers=(f>>11)+1,this.nbDataBlocks=(f&2047)+1)},r.prototype.getRotation=function(t,e){var n=0;t.forEach(function(o,a,f){var s=(o>>e-2<<1)+(o&1);n=(n<<3)+s}),n=((n&1)<<11)+(n>>1);for(var i=0;i<4;i++)if(M.bitCount(n^this.EXPECTED_CORNER_BITS[i])<=2)return i;throw new A},r.prototype.getCorrectedParameterData=function(t,e){var n,i;e?(n=7,i=2):(n=10,i=4);for(var o=n-i,a=new Int32Array(n),f=n-1;f>=0;--f)a[f]=t&15,t>>=4;try{var s=new jt(dt.AZTEC_PARAM);s.decode(a,o)}catch{throw new A}for(var u=0,f=0;f<i;f++)u=(u<<4)+a[f];return u},r.prototype.getBullsEyeCorners=function(t){var e=t,n=t,i=t,o=t,a=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var f=this.getFirstDifferent(e,a,1,-1),s=this.getFirstDifferent(n,a,1,1),u=this.getFirstDifferent(i,a,-1,1),c=this.getFirstDifferent(o,a,-1,-1);if(this.nbCenterLayers>2){var l=this.distancePoint(c,f)*this.nbCenterLayers/(this.distancePoint(o,e)*(this.nbCenterLayers+2));if(l<.75||l>1.25||!this.isWhiteOrBlackRectangle(f,s,u,c))break}e=f,n=s,i=u,o=c,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new A;this.compact=this.nbCenterLayers===5;var h=new R(e.getX()+.5,e.getY()-.5),d=new R(n.getX()+.5,n.getY()+.5),p=new R(i.getX()-.5,i.getY()+.5),v=new R(o.getX()-.5,o.getY()-.5);return this.expandSquare([h,d,p,v],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},r.prototype.getMatrixCenter=function(){var t,e,n,i;try{var o=new Ae(this.image).detect();t=o[0],e=o[1],n=o[2],i=o[3]}catch{var a=this.image.getWidth()/2,f=this.image.getHeight()/2;t=this.getFirstDifferent(new Dt(a+7,f-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Dt(a+7,f+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new Dt(a-7,f+7),!1,-1,1).toResultPoint(),i=this.getFirstDifferent(new Dt(a-7,f-7),!1,-1,-1).toResultPoint()}var s=G.round((t.getX()+i.getX()+e.getX()+n.getX())/4),u=G.round((t.getY()+i.getY()+e.getY()+n.getY())/4);try{var o=new Ae(this.image,15,s,u).detect();t=o[0],e=o[1],n=o[2],i=o[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(),i=this.getFirstDifferent(new Dt(s-7,u-7),!1,-1,-1).toResultPoint()}return s=G.round((t.getX()+i.getX()+e.getX()+n.getX())/4),u=G.round((t.getY()+i.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,i,o){var a=de.getInstance(),f=this.getDimension(),s=f/2-this.nbCenterLayers,u=f/2+this.nbCenterLayers;return a.sampleGrid(t,f,f,s,s,u,s,u,u,s,u,e.getX(),e.getY(),n.getX(),n.getY(),i.getX(),i.getY(),o.getX(),o.getY())},r.prototype.sampleLine=function(t,e,n){for(var i=0,o=this.distanceResultPoint(t,e),a=o/n,f=t.getX(),s=t.getY(),u=a*(e.getX()-t.getX())/o,c=a*(e.getY()-t.getY())/o,l=0;l<n;l++)this.image.get(G.round(f+l*u),G.round(s+l*c))&&(i|=1<<n-l-1);return i},r.prototype.isWhiteOrBlackRectangle=function(t,e,n,i){var o=3;t=new Dt(t.getX()-o,t.getY()+o),e=new Dt(e.getX()-o,e.getY()-o),n=new Dt(n.getX()+o,n.getY()-o),i=new Dt(i.getX()+o,i.getY()+o);var a=this.getColor(i,t);if(a===0)return!1;var f=this.getColor(t,e);return f!==a||(f=this.getColor(e,n),f!==a)?!1:(f=this.getColor(n,i),f===a)},r.prototype.getColor=function(t,e){for(var n=this.distancePoint(t,e),i=(e.getX()-t.getX())/n,o=(e.getY()-t.getY())/n,a=0,f=t.getX(),s=t.getY(),u=this.image.get(t.getX(),t.getY()),c=Math.ceil(n),l=0;l<c;l++)f+=i,s+=o,this.image.get(G.round(f),G.round(s))!==u&&a++;var h=a/n;return h>.1&&h<.9?0:h<=.1===u?1:-1},r.prototype.getFirstDifferent=function(t,e,n,i){for(var o=t.getX()+n,a=t.getY()+i;this.isValid(o,a)&&this.image.get(o,a)===e;)o+=n,a+=i;for(o-=n,a-=i;this.isValid(o,a)&&this.image.get(o,a)===e;)o+=n;for(o-=n;this.isValid(o,a)&&this.image.get(o,a)===e;)a+=i;return a-=i,new Dt(o,a)},r.prototype.expandSquare=function(t,e,n){var i=n/(2*e),o=t[0].getX()-t[2].getX(),a=t[0].getY()-t[2].getY(),f=(t[0].getX()+t[2].getX())/2,s=(t[0].getY()+t[2].getY())/2,u=new R(f+i*o,s+i*a),c=new R(f-i*o,s-i*a);o=t[1].getX()-t[3].getX(),a=t[1].getY()-t[3].getY(),f=(t[1].getX()+t[3].getX())/2,s=(t[1].getY()+t[3].getY())/2;var l=new R(f+i*o,s+i*a),h=new R(f-i*o,s-i*a),d=[u,l,c,h];return d},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=G.round(t.getX()),n=G.round(t.getY());return this.isValid(e,n)},r.prototype.distancePoint=function(t,e){return G.distance(t.getX(),t.getY(),e.getX(),e.getY())},r.prototype.distanceResultPoint=function(t,e){return G.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*(M.truncDivision(this.nbLayers-4,8)+1)+15},r})(),Hr=da;var pa=(function(){function r(){}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n=null,i=new Hr(t.getBlackMatrix()),o=null,a=null;try{var f=i.detectMirror(!1);o=f.getPoints(),this.reportFoundResultPoints(e,o),a=new er().decode(f)}catch(l){n=l}if(a==null)try{var f=i.detectMirror(!0);o=f.getPoints(),this.reportFoundResultPoints(e,o),a=new er().decode(f)}catch(l){throw n??l}var s=new Z(a.getText(),a.getRawBytes(),a.getNumBits(),o,C.AZTEC,V.currentTimeMillis()),u=a.getByteSegments();u!=null&&s.putMetadata(ft.BYTE_SEGMENTS,u);var c=a.getECLevel();return c!=null&&s.putMetadata(ft.ERROR_CORRECTION_LEVEL,c),s},r.prototype.reportFoundResultPoints=function(t,e){if(t!=null){var n=t.get(k.NEED_RESULT_POINT_CALLBACK);n!=null&&e.forEach(function(i,o,a){n.foundPossibleResultPoint(i)})}},r.prototype.reset=function(){},r})(),te=pa;var va=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),yl=(function(r){va(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new te,e)||this}return t})(Mt);var xa=(function(){function r(){}return r.prototype.decode=function(t,e){try{return this.doDecode(t,e)}catch{var n=e&&e.get(k.TRY_HARDER)===!0;if(n&&t.isRotateSupported()){var i=t.rotateCounterClockwise(),o=this.doDecode(i,e),a=o.getResultMetadata(),f=270;a!==null&&a.get(ft.ORIENTATION)===!0&&(f=f+a.get(ft.ORIENTATION)%360),o.putMetadata(ft.ORIENTATION,f);var s=o.getResultPoints();if(s!==null)for(var u=i.getHeight(),c=0;c<s.length;c++)s[c]=new R(u-s[c].getY()-1,s[c].getX());return o}else throw new A}},r.prototype.reset=function(){},r.prototype.doDecode=function(t,e){var n=t.getWidth(),i=t.getHeight(),o=new it(n),a=e&&e.get(k.TRY_HARDER)===!0,f=Math.max(1,i>>(a?8:5)),s;a?s=i:s=15;for(var u=Math.trunc(i/2),c=0;c<s;c++){var l=Math.trunc((c+1)/2),h=(c&1)===0,d=u+f*(h?l:-l);if(d<0||d>=i)break;try{o=t.getBlackRow(d,o)}catch{continue}for(var p=function(m){if(m===1&&(o.reverse(),e&&e.get(k.NEED_RESULT_POINT_CALLBACK)===!0)){var w=new Map;e.forEach(function(T,D){return w.set(D,T)}),w.delete(k.NEED_RESULT_POINT_CALLBACK),e=w}try{var _=v.decodeRow(d,o,e);if(m===1){_.putMetadata(ft.ORIENTATION,180);var I=_.getResultPoints();I!==null&&(I[0]=new R(n-I[0].getX()-1,I[0].getY()),I[1]=new R(n-I[1].getX()-1,I[1].getY()))}return{value:_}}catch{}},v=this,g=0;g<2;g++){var y=p(g);if(typeof y=="object")return y.value}}throw new A},r.recordPattern=function(t,e,n){for(var i=n.length,o=0;o<i;o++)n[o]=0;var a=t.getSize();if(e>=a)throw new A;for(var f=!t.get(e),s=0,u=e;u<a;){if(t.get(u)!==f)n[s]++;else{if(++s===i)break;n[s]=1,f=!f}u++}if(!(s===i||s===i-1&&u===a))throw new A},r.recordPatternInReverse=function(t,e,n){for(var i=n.length,o=t.get(e);e>0&&i>=0;)t.get(--e)!==o&&(i--,o=!o);if(i>=0)throw new A;r.recordPattern(t,e+1,n)},r.patternMatchVariance=function(t,e,n){for(var i=t.length,o=0,a=0,f=0;f<i;f++)o+=t[f],a+=e[f];if(o<a)return Number.POSITIVE_INFINITY;var s=o/a;n*=s;for(var u=0,c=0;c<i;c++){var l=t[c],h=e[c]*s,d=l>h?l-h:h-l;if(d>n)return Number.POSITIVE_INFINITY;u+=d}return u/o},r})(),q=xa;var ga=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ma=(function(r){ga(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.findStartPattern=function(e){for(var n=e.getSize(),i=e.getNextSet(0),o=0,a=Int32Array.from([0,0,0,0,0,0]),f=i,s=!1,u=6,c=i;c<n;c++)if(e.get(c)!==s)a[o]++;else{if(o===u-1){for(var l=t.MAX_AVG_VARIANCE,h=-1,d=t.CODE_START_A;d<=t.CODE_START_C;d++){var p=q.patternMatchVariance(a,t.CODE_PATTERNS[d],t.MAX_INDIVIDUAL_VARIANCE);p<l&&(l=p,h=d)}if(h>=0&&e.isRange(Math.max(0,f-(c-f)/2),f,!1))return Int32Array.from([f,c,h]);f+=a[0]+a[1],a=a.slice(2,a.length),a[o-1]=0,a[o]=0,o--}else o++;a[o]=1,s=!s}throw new A},t.decodeCode=function(e,n,i){q.recordPattern(e,i,n);for(var o=t.MAX_AVG_VARIANCE,a=-1,f=0;f<t.CODE_PATTERNS.length;f++){var s=t.CODE_PATTERNS[f],u=this.patternMatchVariance(n,s,t.MAX_INDIVIDUAL_VARIANCE);u<o&&(o=u,a=f)}if(a>=0)return a;throw new A},t.prototype.decodeRow=function(e,n,i){var o=i&&i.get(k.ASSUME_GS1)===!0,a=t.findStartPattern(n),f=a[2],s=0,u=new Uint8Array(20);u[s++]=f;var c;switch(f){case t.CODE_START_A:c=t.CODE_CODE_A;break;case t.CODE_START_B:c=t.CODE_CODE_B;break;case t.CODE_START_C:c=t.CODE_CODE_C;break;default:throw new S}for(var l=!1,h=!1,d="",p=a[0],v=a[1],g=Int32Array.from([0,0,0,0,0,0]),y=0,m=0,w=f,_=0,I=!0,T=!1,D=!1;!l;){var b=h;switch(h=!1,y=m,m=t.decodeCode(n,g,v),u[s++]=m,m!==t.CODE_STOP&&(I=!0),m!==t.CODE_STOP&&(_++,w+=_*m),p=v,v+=g.reduce(function(Rr,Nr){return Rr+Nr},0),m){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new S}switch(c){case t.CODE_CODE_A:if(m<64)D===T?d+=String.fromCharCode(32+m):d+=String.fromCharCode(32+m+128),D=!1;else if(m<96)D===T?d+=String.fromCharCode(m-64):d+=String.fromCharCode(m+64),D=!1;else switch(m!==t.CODE_STOP&&(I=!1),m){case t.CODE_FNC_1:o&&(d.length===0?d+="]C1":d+="");break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!T&&D?(T=!0,D=!1):T&&D?(T=!1,D=!1):D=!0;break;case t.CODE_SHIFT:h=!0,c=t.CODE_CODE_B;break;case t.CODE_CODE_B:c=t.CODE_CODE_B;break;case t.CODE_CODE_C:c=t.CODE_CODE_C;break;case t.CODE_STOP:l=!0;break}break;case t.CODE_CODE_B:if(m<96)D===T?d+=String.fromCharCode(32+m):d+=String.fromCharCode(32+m+128),D=!1;else switch(m!==t.CODE_STOP&&(I=!1),m){case t.CODE_FNC_1:o&&(d.length===0?d+="]C1":d+="");break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!T&&D?(T=!0,D=!1):T&&D?(T=!1,D=!1):D=!0;break;case t.CODE_SHIFT:h=!0,c=t.CODE_CODE_A;break;case t.CODE_CODE_A:c=t.CODE_CODE_A;break;case t.CODE_CODE_C:c=t.CODE_CODE_C;break;case t.CODE_STOP:l=!0;break}break;case t.CODE_CODE_C:if(m<100)m<10&&(d+="0"),d+=m;else switch(m!==t.CODE_STOP&&(I=!1),m){case t.CODE_FNC_1:o&&(d.length===0?d+="]C1":d+="");break;case t.CODE_CODE_A:c=t.CODE_CODE_A;break;case t.CODE_CODE_B:c=t.CODE_CODE_B;break;case t.CODE_STOP:l=!0;break}break}b&&(c=c===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var L=v-p;if(v=n.getNextUnset(v),!n.isRange(v,Math.min(n.getSize(),v+(v-p)/2),!1))throw new A;if(w-=_*y,w%103!==y)throw new j;var B=d.length;if(B===0)throw new A;B>0&&I&&(c===t.CODE_CODE_C?d=d.substring(0,B-2):d=d.substring(0,B-1));for(var vt=(a[1]+a[0])/2,z=p+L/2,ut=u.length,Pt=new Uint8Array(ut),$t=0;$t<ut;$t++)Pt[$t]=u[$t];var Dr=[new R(vt,e),new R(z,e)];return new Z(d,Pt,0,Dr,C.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})(q),nr=ma;var ya=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Vr=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.")},wa=(function(r){ya(t,r);function t(e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=r.call(this)||this;return i.usingCheckDigit=e,i.extendedMode=n,i.decodeRowResult="",i.counters=new Int32Array(9),i}return t.prototype.decodeRow=function(e,n,i){var o,a,f,s,u=this.counters;u.fill(0),this.decodeRowResult="";var c=t.findAsteriskPattern(n,u),l=n.getNextSet(c[1]),h=n.getSize(),d,p;do{t.recordPattern(n,l,u);var v=t.toNarrowWidePattern(u);if(v<0)throw new A;d=t.patternToChar(v),this.decodeRowResult+=d,p=l;try{for(var g=(o=void 0,Vr(u)),y=g.next();!y.done;y=g.next()){var m=y.value;l+=m}}catch(ut){o={error:ut}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}l=n.getNextSet(l)}while(d!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var w=0;try{for(var _=Vr(u),I=_.next();!I.done;I=_.next()){var m=I.value;w+=m}}catch(ut){f={error:ut}}finally{try{I&&!I.done&&(s=_.return)&&s.call(_)}finally{if(f)throw f.error}}var T=l-p-w;if(l!==h&&T*2<w)throw new A;if(this.usingCheckDigit){for(var D=this.decodeRowResult.length-1,b=0,L=0;L<D;L++)b+=t.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(L));if(this.decodeRowResult.charAt(D)!==t.ALPHABET_STRING.charAt(b%43))throw new j;this.decodeRowResult=this.decodeRowResult.substring(0,D)}if(this.decodeRowResult.length===0)throw new A;var B;this.extendedMode?B=t.decodeExtended(this.decodeRowResult):B=this.decodeRowResult;var vt=(c[1]+c[0])/2,z=p+w/2;return new Z(B,null,0,[new R(vt,e),new R(z,e)],C.CODE_39,new Date().getTime())},t.findAsteriskPattern=function(e,n){for(var i=e.getSize(),o=e.getNextSet(0),a=0,f=o,s=!1,u=n.length,c=o;c<i;c++)if(e.get(c)!==s)n[a]++;else{if(a===u-1){if(this.toNarrowWidePattern(n)===t.ASTERISK_ENCODING&&e.isRange(Math.max(0,f-Math.floor((c-f)/2)),f,!1))return[f,c];f+=n[0]+n[1],n.copyWithin(0,2,2+a-1),n[a-1]=0,n[a]=0,a--}else a++;n[a]=1,s=!s}throw new A},t.toNarrowWidePattern=function(e){var n,i,o=e.length,a=0,f;do{var s=2147483647;try{for(var u=(n=void 0,Vr(e)),c=u.next();!c.done;c=u.next()){var l=c.value;l<s&&l>a&&(s=l)}}catch(v){n={error:v}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}a=s,f=0;for(var h=0,d=0,p=0;p<o;p++){var l=e[p];l>a&&(d|=1<<o-1-p,f++,h+=l)}if(f===3){for(var p=0;p<o&&f>0;p++){var l=e[p];if(l>a&&(f--,l*2>=h))return-1}return d}}while(f>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 A},t.decodeExtended=function(e){for(var n=e.length,i="",o=0;o<n;o++){var a=e.charAt(o);if(a==="+"||a==="$"||a==="%"||a==="/"){var f=e.charAt(o+1),s="\0";switch(a){case"+":if(f>="A"&&f<="Z")s=String.fromCharCode(f.charCodeAt(0)+32);else throw new S;break;case"$":if(f>="A"&&f<="Z")s=String.fromCharCode(f.charCodeAt(0)-64);else throw new S;break;case"%":if(f>="A"&&f<="E")s=String.fromCharCode(f.charCodeAt(0)-38);else if(f>="F"&&f<="J")s=String.fromCharCode(f.charCodeAt(0)-11);else if(f>="K"&&f<="O")s=String.fromCharCode(f.charCodeAt(0)+16);else if(f>="P"&&f<="T")s=String.fromCharCode(f.charCodeAt(0)+43);else if(f==="U")s="\0";else if(f==="V")s="@";else if(f==="W")s="`";else if(f==="X"||f==="Y"||f==="Z")s="\x7F";else throw new S;break;case"/":if(f>="A"&&f<="O")s=String.fromCharCode(f.charCodeAt(0)-32);else if(f==="Z")s=":";else throw new S;break}i+=s,o++}else i+=a}return i},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})(q),ir=wa;var Aa=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),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.")},Ea=(function(r){Aa(t,r);function t(){var e=r.call(this)||this;return e.decodeRowResult="",e.counters=new Int32Array(6),e}return t.prototype.decodeRow=function(e,n,i){var o,a,f,s,u=this.findAsteriskPattern(n),c=n.getNextSet(u[1]),l=n.getSize(),h=this.counters;h.fill(0),this.decodeRowResult="";var d,p;do{t.recordPattern(n,c,h);var v=this.toPattern(h);if(v<0)throw new A;d=this.patternToChar(v),this.decodeRowResult+=d,p=c;try{for(var g=(o=void 0,Gr(h)),y=g.next();!y.done;y=g.next()){var m=y.value;c+=m}}catch(L){o={error:L}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}c=n.getNextSet(c)}while(d!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var w=0;try{for(var _=Gr(h),I=_.next();!I.done;I=_.next()){var m=I.value;w+=m}}catch(L){f={error:L}}finally{try{I&&!I.done&&(s=_.return)&&s.call(_)}finally{if(f)throw f.error}}if(c===l||!n.get(c))throw new A;if(this.decodeRowResult.length<2)throw new A;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var T=this.decodeExtended(this.decodeRowResult),D=(u[1]+u[0])/2,b=p+w/2;return new Z(T,null,0,[new R(D,e),new R(b,e)],C.CODE_93,new Date().getTime())},t.prototype.findAsteriskPattern=function(e){var n=e.getSize(),i=e.getNextSet(0);this.counters.fill(0);for(var o=this.counters,a=i,f=!1,s=o.length,u=0,c=i;c<n;c++)if(e.get(c)!==f)o[u]++;else{if(u===s-1){if(this.toPattern(o)===t.ASTERISK_ENCODING)return new Int32Array([a,c]);a+=o[0]+o[1],o.copyWithin(0,2,2+u-1),o[u-1]=0,o[u]=0,u--}else u++;o[u]=1,f=!f}throw new A},t.prototype.toPattern=function(e){var n,i,o=0;try{for(var a=Gr(e),f=a.next();!f.done;f=a.next()){var s=f.value;o+=s}}catch(p){n={error:p}}finally{try{f&&!f.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}for(var u=0,c=e.length,l=0;l<c;l++){var h=Math.round(e[l]*9/o);if(h<1||h>4)return-1;if((l&1)===0)for(var d=0;d<h;d++)u=u<<1|1;else u<<=h}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 A},t.prototype.decodeExtended=function(e){for(var n=e.length,i="",o=0;o<n;o++){var a=e.charAt(o);if(a>="a"&&a<="d"){if(o>=n-1)throw new S;var f=e.charAt(o+1),s="\0";switch(a){case"d":if(f>="A"&&f<="Z")s=String.fromCharCode(f.charCodeAt(0)+32);else throw new S;break;case"a":if(f>="A"&&f<="Z")s=String.fromCharCode(f.charCodeAt(0)-64);else throw new S;break;case"b":if(f>="A"&&f<="E")s=String.fromCharCode(f.charCodeAt(0)-38);else if(f>="F"&&f<="J")s=String.fromCharCode(f.charCodeAt(0)-11);else if(f>="K"&&f<="O")s=String.fromCharCode(f.charCodeAt(0)+16);else if(f>="P"&&f<="T")s=String.fromCharCode(f.charCodeAt(0)+43);else if(f==="U")s="\0";else if(f==="V")s="@";else if(f==="W")s="`";else if(f>="X"&&f<="Z")s="\x7F";else throw new S;break;case"c":if(f>="A"&&f<="O")s=String.fromCharCode(f.charCodeAt(0)-32);else if(f==="Z")s=":";else throw new S;break}i+=s,o++}else i+=a}return i},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,i){for(var o=1,a=0,f=n-1;f>=0;f--)a+=o*t.ALPHABET_STRING.indexOf(e.charAt(f)),++o>i&&(o=1);if(e.charAt(n)!==t.ALPHABET_STRING[a%47])throw new j},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})(q),or=Ea;var _a=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ca=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.")},Ia=(function(r){_a(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return t.prototype.decodeRow=function(e,n,i){var o,a,f=this.decodeStart(n),s=this.decodeEnd(n),u=new P;t.decodeMiddle(n,f[1],s[0],u);var c=u.toString(),l=null;i!=null&&(l=i.get(k.ALLOWED_LENGTHS)),l==null&&(l=t.DEFAULT_ALLOWED_LENGTHS);var h=c.length,d=!1,p=0;try{for(var v=Ca(l),g=v.next();!g.done;g=v.next()){var y=g.value;if(h===y){d=!0;break}y>p&&(p=y)}}catch(_){o={error:_}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}if(!d&&h>p&&(d=!0),!d)throw new S;var m=[new R(f[1],e),new R(s[0],e)],w=new Z(c,null,0,m,C.ITF,new Date().getTime());return w},t.decodeMiddle=function(e,n,i,o){var a=new Int32Array(10),f=new Int32Array(5),s=new Int32Array(5);for(a.fill(0),f.fill(0),s.fill(0);n<i;){q.recordPattern(e,n,a);for(var u=0;u<5;u++){var c=2*u;f[u]=a[c],s[u]=a[c+1]}var l=t.decodeDigit(f);o.append(l.toString()),l=this.decodeDigit(s),o.append(l.toString()),a.forEach(function(h){n+=h})}},t.prototype.decodeStart=function(e){var n=t.skipWhiteSpace(e),i=t.findGuardPattern(e,n,t.START_PATTERN);return this.narrowLineWidth=(i[1]-i[0])/4,this.validateQuietZone(e,i[0]),i},t.prototype.validateQuietZone=function(e,n){var i=this.narrowLineWidth*10;i=i<n?i:n;for(var o=n-1;i>0&&o>=0&&!e.get(o);o--)i--;if(i!==0)throw new A},t.skipWhiteSpace=function(e){var n=e.getSize(),i=e.getNextSet(0);if(i===n)throw new A;return i},t.prototype.decodeEnd=function(e){e.reverse();try{var n=t.skipWhiteSpace(e),i=void 0;try{i=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[0])}catch(a){a instanceof A&&(i=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,i[0]);var o=i[0];return i[0]=e.getSize()-i[1],i[1]=e.getSize()-o,i}finally{e.reverse()}},t.findGuardPattern=function(e,n,i){var o=i.length,a=new Int32Array(o),f=e.getSize(),s=!1,u=0,c=n;a.fill(0);for(var l=n;l<f;l++)if(e.get(l)!==s)a[u]++;else{if(u===o-1){if(q.patternMatchVariance(a,i,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return[c,l];c+=a[0]+a[1],V.arraycopy(a,2,a,0,u-1),a[u-1]=0,a[u]=0,u--}else u++;a[u]=1,s=!s}throw new A},t.decodeDigit=function(e){for(var n=t.MAX_AVG_VARIANCE,i=-1,o=t.PATTERNS.length,a=0;a<o;a++){var f=t.PATTERNS[a],s=q.patternMatchVariance(e,f,t.MAX_INDIVIDUAL_VARIANCE);s<n?(n=s,i=a):s===n&&(i=-1)}if(i>=0)return i%10;throw new A},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})(q),ar=Ia;var Sa=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Oa=(function(r){Sa(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return t.findStartGuardPattern=function(e){for(var n=!1,i,o=0,a=Int32Array.from([0,0,0]);!n;){a=Int32Array.from([0,0,0]),i=t.findGuardPattern(e,o,!1,this.START_END_PATTERN,a);var f=i[0];o=i[1];var s=f-(o-f);s>=0&&(n=e.isRange(s,f,!1))}return i},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var i=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===i},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,i=0,o=n-1;o>=0;o-=2){var a=e.charAt(o).charCodeAt(0)-48;if(a<0||a>9)throw new S;i+=a}i*=3;for(var o=n-2;o>=0;o-=2){var a=e.charAt(o).charCodeAt(0)-48;if(a<0||a>9)throw new S;i+=a}return(1e3-i)%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,i,o){return this.findGuardPattern(e,n,i,o,new Int32Array(o.length))},t.findGuardPattern=function(e,n,i,o,a){var f=e.getSize();n=i?e.getNextUnset(n):e.getNextSet(n);for(var s=0,u=n,c=o.length,l=i,h=n;h<f;h++)if(e.get(h)!==l)a[s]++;else{if(s===c-1){if(q.patternMatchVariance(a,o,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return Int32Array.from([u,h]);u+=a[0]+a[1];for(var d=a.slice(2,a.length),p=0;p<s-1;p++)a[p]=d[p];a[s-1]=0,a[s]=0,s--}else s++;a[s]=1,l=!l}throw new A},t.decodeDigit=function(e,n,i,o){this.recordPattern(e,i,n);for(var a=this.MAX_AVG_VARIANCE,f=-1,s=o.length,u=0;u<s;u++){var c=o[u],l=q.patternMatchVariance(n,c,t.MAX_INDIVIDUAL_VARIANCE);l<a&&(a=l,f=u)}if(f>=0)return f;throw new A},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})(q),Wt=Oa;var Ta=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.")},Da=(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 i=this.decodeRowStringBuffer,o=this.decodeMiddle(e,n,i),a=i.toString(),f=r.parseExtensionString(a),s=[new R((n[0]+n[1])/2,t),new R(o,t)],u=new Z(a,null,0,s,C.UPC_EAN_EXTENSION,new Date().getTime());return f!=null&&u.putAllMetadata(f),u},r.prototype.decodeMiddle=function(t,e,n){var i,o,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var f=t.getSize(),s=e[1],u=0,c=0;c<5&&s<f;c++){var l=Wt.decodeDigit(t,a,s,Wt.L_AND_G_PATTERNS);n+=String.fromCharCode(48+l%10);try{for(var h=(i=void 0,Ta(a)),d=h.next();!d.done;d=h.next()){var p=d.value;s+=p}}catch(g){i={error:g}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}l>=10&&(u|=1<<4-c),c!==4&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(n.length!==5)throw new A;var v=this.determineCheckDigit(u);if(r.extensionChecksum(n.toString())!==v)throw new A;return s},r.extensionChecksum=function(t){for(var e=t.length,n=0,i=e-2;i>=0;i-=2)n+=t.charAt(i).charCodeAt(0)-48;n*=3;for(var i=e-1;i>=0;i-=2)n+=t.charAt(i).charCodeAt(0)-48;return n*=3,n%10},r.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new A},r.parseExtensionString=function(t){if(t.length!==5)return null;var e=r.parseExtension5String(t);return e==null?null:new Map([[ft.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="";break}var n=parseInt(t.substring(1)),i=(n/100).toString(),o=n%100,a=o<10?"0"+o:o.toString();return e+i+"."+a},r})(),Rn=Da;var Ra=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.")},Na=(function(){function r(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(t,e,n){var i=this.decodeRowStringBuffer,o=this.decodeMiddle(e,n,i),a=i.toString(),f=r.parseExtensionString(a),s=[new R((n[0]+n[1])/2,t),new R(o,t)],u=new Z(a,null,0,s,C.UPC_EAN_EXTENSION,new Date().getTime());return f!=null&&u.putAllMetadata(f),u},r.prototype.decodeMiddle=function(t,e,n){var i,o,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var f=t.getSize(),s=e[1],u=0,c=0;c<2&&s<f;c++){var l=Wt.decodeDigit(t,a,s,Wt.L_AND_G_PATTERNS);n+=String.fromCharCode(48+l%10);try{for(var h=(i=void 0,Ra(a)),d=h.next();!d.done;d=h.next()){var p=d.value;s+=p}}catch(v){i={error:v}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}l>=10&&(u|=1<<1-c),c!==1&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(n.length!==2)throw new A;if(parseInt(n.toString())%4!==u)throw new A;return s},r.parseExtensionString=function(t){return t.length!==2?null:new Map([[ft.ISSUE_NUMBER,parseInt(t)]])},r})(),Nn=Na;var ba=(function(){function r(){}return r.decodeRow=function(t,e,n){var i=Wt.findGuardPattern(e,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{var o=new Rn;return o.decodeRow(t,e,i)}catch{var a=new Nn;return a.decodeRow(t,e,i)}},r.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),r})(),bn=ba;var Pa=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ma=(function(r){Pa(t,r);function t(){var e=r.call(this)||this;e.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(f){return Int32Array.from(f)});for(var n=10;n<20;n++){for(var i=t.L_PATTERNS[n-10],o=new Int32Array(i.length),a=0;a<i.length;a++)o[a]=i[i.length-a-1];t.L_AND_G_PATTERNS[n]=o}return e}return t.prototype.decodeRow=function(e,n,i){var o=t.findStartGuardPattern(n),a=i==null?null:i.get(k.NEED_RESULT_POINT_CALLBACK);if(a!=null){var f=new R((o[0]+o[1])/2,e);a.foundPossibleResultPoint(f)}var s=this.decodeMiddle(n,o,this.decodeRowStringBuffer),u=s.rowOffset,c=s.resultString;if(a!=null){var l=new R(u,e);a.foundPossibleResultPoint(l)}var h=t.decodeEnd(n,u);if(a!=null){var d=new R((h[0]+h[1])/2,e);a.foundPossibleResultPoint(d)}var p=h[1],v=p+(p-h[0]);if(v>=n.getSize()||!n.isRange(p,v,!1))throw new A;var g=c.toString();if(g.length<8)throw new S;if(!t.checkChecksum(g))throw new j;var y=(o[1]+o[0])/2,m=(h[1]+h[0])/2,w=this.getBarcodeFormat(),_=[new R(y,e),new R(m,e)],I=new Z(g,null,0,_,w,new Date().getTime()),T=0;try{var D=bn.decodeRow(e,n,h[1]);I.putMetadata(ft.UPC_EAN_EXTENSION,D.getText()),I.putAllMetadata(D.getResultMetadata()),I.addResultPoints(D.getResultPoints()),T=D.getText().length}catch{}var b=i==null?null:i.get(k.ALLOWED_EAN_EXTENSIONS);if(b!=null){var L=!1;for(var B in b)if(T.toString()===B){L=!0;break}if(!L)throw new A}return w===C.EAN_13||C.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 i=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===i},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,i=0,o=n-1;o>=0;o-=2){var a=e.charAt(o).charCodeAt(0)-48;if(a<0||a>9)throw new S;i+=a}i*=3;for(var o=n-2;o>=0;o-=2){var a=e.charAt(o).charCodeAt(0)-48;if(a<0||a>9)throw new S;i+=a}return(1e3-i)%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})(Wt),ct=Ma;var Ba=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Pn=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.")},Fa=(function(r){Ba(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return t.prototype.decodeMiddle=function(e,n,i){var o,a,f,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=e.getSize(),l=n[1],h=0,d=0;d<6&&l<c;d++){var p=ct.decodeDigit(e,u,l,ct.L_AND_G_PATTERNS);i+=String.fromCharCode(48+p%10);try{for(var v=(o=void 0,Pn(u)),g=v.next();!g.done;g=v.next()){var y=g.value;l+=y}}catch(I){o={error:I}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}p>=10&&(h|=1<<5-d)}i=t.determineFirstDigit(i,h);var m=ct.findGuardPattern(e,l,!0,ct.MIDDLE_PATTERN,new Int32Array(ct.MIDDLE_PATTERN.length).fill(0));l=m[1];for(var d=0;d<6&&l<c;d++){var p=ct.decodeDigit(e,u,l,ct.L_PATTERNS);i+=String.fromCharCode(48+p);try{for(var w=(f=void 0,Pn(u)),_=w.next();!_.done;_=w.next()){var y=_.value;l+=y}}catch(D){f={error:D}}finally{try{_&&!_.done&&(s=w.return)&&s.call(w)}finally{if(f)throw f.error}}}return{rowOffset:l,resultString:i}},t.prototype.getBarcodeFormat=function(){return C.EAN_13},t.determineFirstDigit=function(e,n){for(var i=0;i<10;i++)if(n===this.FIRST_DIGIT_ENCODINGS[i])return e=String.fromCharCode(48+i)+e,e;throw new A},t.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],t})(ct),Ee=Fa;var La=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),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.")},ka=(function(r){La(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return t.prototype.decodeMiddle=function(e,n,i){var o,a,f,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=e.getSize(),l=n[1],h=0;h<4&&l<c;h++){var d=ct.decodeDigit(e,u,l,ct.L_PATTERNS);i+=String.fromCharCode(48+d);try{for(var p=(o=void 0,Mn(u)),v=p.next();!v.done;v=p.next()){var g=v.value;l+=g}}catch(_){o={error:_}}finally{try{v&&!v.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}}var y=ct.findGuardPattern(e,l,!0,ct.MIDDLE_PATTERN,new Int32Array(ct.MIDDLE_PATTERN.length).fill(0));l=y[1];for(var h=0;h<4&&l<c;h++){var d=ct.decodeDigit(e,u,l,ct.L_PATTERNS);i+=String.fromCharCode(48+d);try{for(var m=(f=void 0,Mn(u)),w=m.next();!w.done;w=m.next()){var g=w.value;l+=g}}catch(T){f={error:T}}finally{try{w&&!w.done&&(s=m.return)&&s.call(m)}finally{if(f)throw f.error}}}return{rowOffset:l,resultString:i}},t.prototype.getBarcodeFormat=function(){return C.EAN_8},t})(ct),Wr=ka;var Ua=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ha=(function(r){Ua(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.ean13Reader=new Ee,e}return t.prototype.getBarcodeFormat=function(){return C.UPC_A},t.prototype.decode=function(e,n){return this.maybeReturnResult(this.ean13Reader.decode(e))},t.prototype.decodeRow=function(e,n,i){return this.maybeReturnResult(this.ean13Reader.decodeRow(e,n,i))},t.prototype.decodeMiddle=function(e,n,i){return this.ean13Reader.decodeMiddle(e,n,i)},t.prototype.maybeReturnResult=function(e){var n=e.getText();if(n.charAt(0)==="0"){var i=new Z(n.substring(1),null,null,e.getResultPoints(),C.UPC_A);return e.getResultMetadata()!=null&&i.putAllMetadata(e.getResultMetadata()),i}else throw new A},t.prototype.reset=function(){this.ean13Reader.reset()},t})(ct),Xr=Ha;var Va=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ga=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.")},Wa=(function(r){Va(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return t.prototype.decodeMiddle=function(e,n,i){var o,a,f=this.decodeMiddleCounters.map(function(g){return g});f[0]=0,f[1]=0,f[2]=0,f[3]=0;for(var s=e.getSize(),u=n[1],c=0,l=0;l<6&&u<s;l++){var h=t.decodeDigit(e,f,u,t.L_AND_G_PATTERNS);i+=String.fromCharCode(48+h%10);try{for(var d=(o=void 0,Ga(f)),p=d.next();!p.done;p=d.next()){var v=p.value;u+=v}}catch(g){o={error:g}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}h>=10&&(c|=1<<5-l)}return t.determineNumSysAndCheckDigit(new P(i),c),u},t.prototype.decodeEnd=function(e,n){return t.findGuardPatternWithoutCounters(e,n,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return ct.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,n){for(var i=0;i<=1;i++)for(var o=0;o<10;o++)if(n===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[i][o]){e.insert(0,"0"+i),e.append("0"+o);return}throw A.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return C.UPC_E},t.convertUPCEtoUPCA=function(e){var n=e.slice(1,7).split("").map(function(a){return a.charCodeAt(0)}),i=new P;i.append(e.charAt(0));var o=n[5];switch(o){case 0:case 1:case 2:i.appendChars(n,0,2),i.append(o),i.append("0000"),i.appendChars(n,2,3);break;case 3:i.appendChars(n,0,3),i.append("00000"),i.appendChars(n,3,2);break;case 4:i.appendChars(n,0,4),i.append("00000"),i.append(n[4]);break;default:i.appendChars(n,0,5),i.append("0000"),i.append(o);break}return e.length>=8&&i.append(e.charAt(7)),i.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})(ct),zr=Wa;var Xa=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}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.")},za=(function(r){Xa(t,r);function t(e){var n=r.call(this)||this,i=e==null?null:e.get(k.POSSIBLE_FORMATS),o=[];return i!=null&&(i.indexOf(C.EAN_13)>-1&&o.push(new Ee),i.indexOf(C.UPC_A)>-1&&o.push(new Xr),i.indexOf(C.EAN_8)>-1&&o.push(new Wr),i.indexOf(C.UPC_E)>-1&&o.push(new zr)),o.length===0&&(o.push(new Ee),o.push(new Xr),o.push(new Wr),o.push(new zr)),n.readers=o,n}return t.prototype.decodeRow=function(e,n,i){var o,a;try{for(var f=Bn(this.readers),s=f.next();!s.done;s=f.next()){var u=s.value;try{var c=u.decodeRow(e,n,i),l=c.getBarcodeFormat()===C.EAN_13&&c.getText().charAt(0)==="0",h=i==null?null:i.get(k.POSSIBLE_FORMATS),d=h==null||h.includes(C.UPC_A);if(l&&d){var p=c.getRawBytes(),v=new Z(c.getText().substring(1),p,p?p.length:null,c.getResultPoints(),C.UPC_A);return v.putAllMetadata(c.getResultMetadata()),v}return c}catch{}}}catch(g){o={error:g}}finally{try{s&&!s.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}throw new A},t.prototype.reset=function(){var e,n;try{for(var i=Bn(this.readers),o=i.next();!o.done;o=i.next()){var a=o.value;a.reset()}}catch(f){e={error:f}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t})(q),fr=za;var Za=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ja=(function(r){Za(t,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 t.prototype.decodeRow=function(e,n,i){var o=this.getValidRowData(n);if(!o)throw new A;var a=this.codaBarDecodeRow(o.row);if(!a)throw new A;return new Z(a,null,0,[new R(o.left,e),new R(o.right,e)],C.CODABAR,new Date().getTime())},t.prototype.getValidRowData=function(e){var n=e.toArray(),i=n.indexOf(!0);if(i===-1)return null;var o=n.lastIndexOf(!0);if(o<=i)return null;n=n.slice(i,o+1);for(var a=[],f=n[0],s=1,u=1;u<n.length;u++)n[u]===f?s++:(f=n[u],a.push(s),s=1);return a.push(s),a.length<23&&(a.length+1)%8!==0?null:{row:a,left:i,right:o}},t.prototype.codaBarDecodeRow=function(e){for(var n=[],i=Math.ceil(e.reduce(function(s,u){return(s+u)/2},0));e.length>0;){var o=e.splice(0,8).splice(0,7),a=o.map(function(s){return s<i?"n":"w"}).join("");if(this.CODA_BAR_CHAR_SET[a]===void 0)return null;n.push(this.CODA_BAR_CHAR_SET[a])}var f=n.join("");return this.validCodaBarString(f)?f:null},t.prototype.validCodaBarString=function(e){var n=/^[A-D].{1,}[A-D]$/;return n.test(e)},t})(q),Zr=ja;var Ya=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ka=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.")},Qa=(function(r){Ya(t,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 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 i=0;i<n.length;i++)if(q.patternMatchVariance(e,n[i],t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return i;throw new A},t.count=function(e){return G.sum(new Int32Array(e))},t.increment=function(e,n){for(var i=0,o=n[0],a=1;a<e.length;a++)n[a]>o&&(o=n[a],i=a);e[i]++},t.decrement=function(e,n){for(var i=0,o=n[0],a=1;a<e.length;a++)n[a]<o&&(o=n[a],i=a);e[i]--},t.isFinderPattern=function(e){var n,i,o=e[0]+e[1],a=o+e[2]+e[3],f=o/a;if(f>=t.MIN_FINDER_PATTERN_RATIO&&f<=t.MAX_FINDER_PATTERN_RATIO){var s=Number.MAX_SAFE_INTEGER,u=Number.MIN_SAFE_INTEGER;try{for(var c=Ka(e),l=c.next();!l.done;l=c.next()){var h=l.value;h>u&&(u=h),h<s&&(s=h)}}catch(d){n={error:d}}finally{try{l&&!l.done&&(i=c.return)&&i.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})(q),Yt=Qa;var qa=(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})(),pe=qa;var Ja=(function(){function r(t,e,n,i,o){this.value=t,this.startEnd=e,this.value=t,this.startEnd=e,this.resultPoints=new Array,this.resultPoints.push(new R(n,o)),this.resultPoints.push(new R(i,o))}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})(),sr=Ja;var $a=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.")},tf=(function(){function r(){}return r.getRSSvalue=function(t,e,n){var i,o,a=0;try{for(var f=$a(t),s=f.next();!s.done;s=f.next()){var u=s.value;a+=u}}catch(m){i={error:m}}finally{try{s&&!s.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}for(var c=0,l=0,h=t.length,d=0;d<h-1;d++){var p=void 0;for(p=1,l|=1<<d;p<t[d];p++,l&=~(1<<d)){var v=r.combins(a-p-1,h-d-2);if(n&&l===0&&a-p-(h-d-1)>=h-d-1&&(v-=r.combins(a-p-(h-d),h-d-2)),h-d-1>1){for(var g=0,y=a-p-(h-d-2);y>e;y--)g+=r.combins(a-p-y-1,h-d-3);v-=g*(h-1-d)}else a-p>e&&v--;c+=v}a-=p}return c},r.combins=function(t,e){var n,i;t-e>e?(i=e,n=t-e):(i=t-e,n=e);for(var o=1,a=1,f=t;f>n;f--)o*=f,a<=i&&(o/=a,a++);for(;a<=i;)o/=a,a++;return o},r})(),ee=tf;var ef=(function(){function r(){}return r.buildBitArray=function(t){var e=t.length*2-1;t[t.length-1].getRightChar()==null&&(e-=1);for(var n=12*e,i=new it(n),o=0,a=t[0],f=a.getRightChar().getValue(),s=11;s>=0;--s)(f&1<<s)!==0&&i.set(o),o++;for(var s=1;s<t.length;++s){for(var u=t[s],c=u.getLeftChar().getValue(),l=11;l>=0;--l)(c&1<<l)!==0&&i.set(o),o++;if(u.getRightChar()!==null)for(var h=u.getRightChar().getValue(),l=11;l>=0;--l)(h&1<<l)!==0&&i.set(o),o++}return i},r})(),Fn=ef;var rf=(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})(),re=rf;var nf=(function(){function r(t){this.newPosition=t}return r.prototype.getNewPosition=function(){return this.newPosition},r})(),_e=nf;var of=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),af=(function(r){of(t,r);function t(e,n){var i=r.call(this,e)||this;return i.value=n,i}return t.prototype.getValue=function(){return this.value},t.prototype.isFNC1=function(){return this.value===t.FNC1},t.FNC1="$",t})(_e),Ft=af;var ff=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),sf=(function(r){ff(t,r);function t(e,n,i){var o=r.call(this,e)||this;return i?(o.remaining=!0,o.remainingValue=o.remainingValue):(o.remaining=!1,o.remainingValue=0),o.newString=n,o}return t.prototype.getNewString=function(){return this.newString},t.prototype.isRemaining=function(){return this.remaining},t.prototype.getRemainingValue=function(){return this.remainingValue},t})(_e),ne=sf;var uf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),cf=(function(r){uf(t,r);function t(e,n,i){var o=r.call(this,e)||this;if(n<0||n>10||i<0||i>10)throw new S;return o.firstDigit=n,o.secondDigit=i,o}return t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return this.firstDigit*10+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})(_e),ve=cf;var ur=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.")},lf=(function(){function r(){}return r.parseFieldsInGeneralPurpose=function(t){var e,n,i,o,a,f,s,u;if(!t)return null;if(t.length<2)throw new A;var c=t.substring(0,2);try{for(var l=ur(r.TWO_DIGIT_DATA_LENGTH),h=l.next();!h.done;h=l.next()){var d=h.value;if(d[0]===c)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(2,d[2],t):r.processFixedAI(2,d[1],t)}}catch(T){e={error:T}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}if(t.length<3)throw new A;var p=t.substring(0,3);try{for(var v=ur(r.THREE_DIGIT_DATA_LENGTH),g=v.next();!g.done;g=v.next()){var d=g.value;if(d[0]===p)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(3,d[2],t):r.processFixedAI(3,d[1],t)}}catch(T){i={error:T}}finally{try{g&&!g.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}try{for(var y=ur(r.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),m=y.next();!m.done;m=y.next()){var d=m.value;if(d[0]===p)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,d[2],t):r.processFixedAI(4,d[1],t)}}catch(T){a={error:T}}finally{try{m&&!m.done&&(f=y.return)&&f.call(y)}finally{if(a)throw a.error}}if(t.length<4)throw new A;var w=t.substring(0,4);try{for(var _=ur(r.FOUR_DIGIT_DATA_LENGTH),I=_.next();!I.done;I=_.next()){var d=I.value;if(d[0]===w)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,d[2],t):r.processFixedAI(4,d[1],t)}}catch(T){s={error:T}}finally{try{I&&!I.done&&(u=_.return)&&u.call(_)}finally{if(s)throw s.error}}throw new A},r.processFixedAI=function(t,e,n){if(n.length<t)throw new A;var i=n.substring(0,t);if(n.length<t+e)throw new A;var o=n.substring(t,t+e),a=n.substring(t+e),f="("+i+")"+o,s=r.parseFieldsInGeneralPurpose(a);return s==null?f:f+s},r.processVariableAI=function(t,e,n){var i=n.substring(0,t),o;n.length<t+e?o=n.length:o=t+e;var a=n.substring(t,o),f=n.substring(o),s="("+i+")"+a,u=r.parseFieldsInGeneralPurpose(f);return u==null?s:s+u},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})(),Ln=lf;var hf=(function(){function r(t){this.buffer=new P,this.information=t}return r.prototype.decodeAllCodes=function(t,e){var n=e,i=null;do{var o=this.decodeGeneralPurposeField(n,i),a=Ln.parseFieldsInGeneralPurpose(o.getNewString());if(a!=null&&t.append(a),o.isRemaining()?i=""+o.getRemainingValue():i=null,n===o.getNewPosition())break;n=o.getNewPosition()}while(!0);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 e===0?new ve(this.information.getSize(),ve.FNC1,ve.FNC1):new ve(this.information.getSize(),e-1,ve.FNC1)}var n=this.extractNumericValueFromBitArray(t,7),i=(n-8)/11,o=(n-8)%11;return new ve(t+7,i,o)},r.prototype.extractNumericValueFromBitArray=function(t,e){return r.extractNumericValueFromBitArray(this.information,t,e)},r.extractNumericValueFromBitArray=function(t,e,n){for(var i=0,o=0;o<n;++o)t.get(e+o)&&(i|=1<<n-o-1);return i},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 ne(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new ne(this.current.getPosition(),this.buffer.toString())},r.prototype.parseBlocks=function(){var t,e;do{var n=this.current.getPosition();this.current.isAlpha()?(e=this.parseAlphaBlock(),t=e.isFinished()):this.current.isIsoIec646()?(e=this.parseIsoIec646Block(),t=e.isFinished()):(e=this.parseNumericBlock(),t=e.isFinished());var i=n!==this.current.getPosition();if(!i&&!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 t.isSecondDigitFNC1()?e=new ne(this.current.getPosition(),this.buffer.toString()):e=new ne(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()),new re(!0,e)}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1()){var e=new ne(this.current.getPosition(),this.buffer.toString());return new re(!0,e)}this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new re(!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 ne(this.current.getPosition(),this.buffer.toString());return new re(!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 re(!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 ne(this.current.getPosition(),this.buffer.toString());return new re(!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 re(!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 i=this.extractNumericValueFromBitArray(t,8);return i>=232&&i<253},r.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new Ft(t+5,Ft.FNC1);if(e>=5&&e<15)return new Ft(t+5,"0"+(e-5));var n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new Ft(t+7,""+(n+1));if(n>=90&&n<116)return new Ft(t+7,""+(n+7));var i=this.extractNumericValueFromBitArray(t,8),o;switch(i){case 232:o="!";break;case 233:o='"';break;case 234:o="%";break;case 235:o="&";break;case 236:o="'";break;case 237:o="(";break;case 238:o=")";break;case 239:o="*";break;case 240:o="+";break;case 241:o=",";break;case 242:o="-";break;case 243:o=".";break;case 244:o="/";break;case 245:o=":";break;case 246:o=";";break;case 247:o="<";break;case 248:o="=";break;case 249:o=">";break;case 250:o="?";break;case 251:o="_";break;case 252:o=" ";break;default:throw new S}return new Ft(t+8,o)},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 Ft(t+5,Ft.FNC1);if(e>=5&&e<15)return new Ft(t+5,"0"+(e-5));var n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new Ft(t+6,""+(n+33));var i;switch(n){case 58:i="*";break;case 59:i=",";break;case 60:i="-";break;case 61:i=".";break;case 62:i="/";break;default:throw new xt("Decoding invalid alphanumeric value: "+n)}return new Ft(t+6,i)},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})(),Ce=hf;var df=(function(){function r(t){this.information=t,this.generalDecoder=new Ce(t)}return r.prototype.getInformation=function(){return this.information},r.prototype.getGeneralDecoder=function(){return this.generalDecoder},r})(),Ge=df;var pf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),vf=(function(r){pf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.encodeCompressedGtin=function(e,n){e.append("(01)");var i=e.length();e.append("9"),this.encodeCompressedGtinWithoutAI(e,n,i)},t.prototype.encodeCompressedGtinWithoutAI=function(e,n,i){for(var o=0;o<4;++o){var a=this.getGeneralDecoder().extractNumericValueFromBitArray(n+10*o,10);a/100===0&&e.append("0"),a/10===0&&e.append("0"),e.append(a)}t.appendCheckDigit(e,i)},t.appendCheckDigit=function(e,n){for(var i=0,o=0;o<13;o++){var a=e.charAt(o+n).charCodeAt(0)-48;i+=(o&1)===0?3*a:a}i=10-i%10,i===10&&(i=0),e.append(i)},t.GTIN_SIZE=40,t})(Ge),Rt=vf;var xf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),gf=(function(r){xf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){var e=new P;e.append("(01)");var n=e.length(),i=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE,4);return e.append(i),this.encodeCompressedGtinWithoutAI(e,t.HEADER_SIZE+4,n),this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE+44)},t.HEADER_SIZE=4,t})(Rt),kn=gf;var mf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),yf=(function(r){mf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){var e=new P;return this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE)},t.HEADER_SIZE=5,t})(Ge),Un=yf;var wf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Af=(function(r){wf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.encodeCompressedWeight=function(e,n,i){var o=this.getGeneralDecoder().extractNumericValueFromBitArray(n,i);this.addWeightCode(e,o);for(var a=this.checkWeight(o),f=1e5,s=0;s<5;++s)a/f===0&&e.append("0"),f/=10;e.append(a)},t})(Rt),Ie=Af;var Ef=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),_f=(function(r){Ef(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+Ie.GTIN_SIZE+t.WEIGHT_SIZE)throw new A;var e=new P;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),cr=_f;var Cf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),If=(function(r){Cf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.addWeightCode=function(e,n){e.append("(3103)")},t.prototype.checkWeight=function(e){return e},t})(cr),Hn=If;var Sf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Of=(function(r){Sf(t,r);function t(e){return r.call(this,e)||this}return 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})(cr),Vn=Of;var Tf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Df=(function(r){Tf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+Rt.GTIN_SIZE)throw new A;var e=new P;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Rt.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(392"),e.append(n),e.append(")");var i=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+Rt.GTIN_SIZE+t.LAST_DIGIT_SIZE,null);return e.append(i.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t})(Rt),Gn=Df;var Rf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Nf=(function(r){Rf(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+Rt.GTIN_SIZE)throw new A;var e=new P;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Rt.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(393"),e.append(n),e.append(")");var i=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Rt.GTIN_SIZE+t.LAST_DIGIT_SIZE,t.FIRST_THREE_DIGITS_SIZE);i/100===0&&e.append("0"),i/10===0&&e.append("0"),e.append(i);var o=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+Rt.GTIN_SIZE+t.LAST_DIGIT_SIZE+t.FIRST_THREE_DIGITS_SIZE,null);return e.append(o.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t.FIRST_THREE_DIGITS_SIZE=10,t})(Rt),Wn=Nf;var bf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Pf=(function(r){bf(t,r);function t(e,n,i){var o=r.call(this,e)||this;return o.dateCode=i,o.firstAIdigits=n,o}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE+t.DATE_SIZE)throw new A;var e=new P;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 i=this.getGeneralDecoder().extractNumericValueFromBitArray(n,t.DATE_SIZE);if(i!==38400){e.append("("),e.append(this.dateCode),e.append(")");var o=i%32;i/=32;var a=i%12+1;i/=12;var f=i;f/10===0&&e.append("0"),e.append(f),a/10===0&&e.append("0"),e.append(a),o/10===0&&e.append("0"),e.append(o)}},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),Kt=Pf;function jr(r){try{if(r.get(1))return new kn(r);if(!r.get(2))return new Un(r);var t=Ce.extractNumericValueFromBitArray(r,1,4);switch(t){case 4:return new Hn(r);case 5:return new Vn(r)}var e=Ce.extractNumericValueFromBitArray(r,1,5);switch(e){case 12:return new Gn(r);case 13:return new Wn(r)}var n=Ce.extractNumericValueFromBitArray(r,1,7);switch(n){case 56:return new Kt(r,"310","11");case 57:return new Kt(r,"320","11");case 58:return new Kt(r,"310","13");case 59:return new Kt(r,"320","13");case 60:return new Kt(r,"310","15");case 61:return new Kt(r,"320","15");case 62:return new Kt(r,"310","17");case 63:return new Kt(r,"320","17")}}catch(i){throw console.log(i),new xt("unknown decoder: "+r)}}var Mf=(function(){function r(t,e,n,i){this.leftchar=t,this.rightchar=e,this.finderpattern=n,this.maybeLast=i}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):!1},r.equalsOrNull=function(t,e){return t===null?e===null:r.equals(t,e)},r.prototype.hashCode=function(){var t=this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue();return t},r})(),Yr=Mf;var Bf=(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:!1},r.prototype.checkEqualitity=function(t,e){if(!(!t||!e)){var n;return t.forEach(function(i,o){e.forEach(function(a){i.getLeftChar().getValue()===a.getLeftChar().getValue()&&i.getRightChar().getValue()===a.getRightChar().getValue()&&i.getFinderPatter().getValue()===a.getFinderPatter().getValue()&&(n=!0)})}),n}},r})(),Xn=Bf;var Ff=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ie=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.")},Lf=(function(r){Ff(t,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 t.prototype.decodeRow=function(e,n,i){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 i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(n,this.pairs,e))}catch(f){if(f instanceof A){if(!this.pairs.length)throw new A;i=!0}}if(this.checkChecksum())return this.pairs;var o;if(this.rows.length?o=!0:o=!1,this.storeRow(e,!1),o){var a=this.checkRowsBoolean(!1);if(a!=null||(a=this.checkRowsBoolean(!0),a!=null))return a}throw new A},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(i){console.log(i)}return e&&(this.rows=this.rows.reverse()),n},t.prototype.checkRows=function(e,n){for(var i,o,a=n;a<this.rows.length;a++){var f=this.rows[a];this.pairs.length=0;try{for(var s=(i=void 0,ie(e)),u=s.next();!u.done;u=s.next()){var c=u.value;this.pairs.push(c.getPairs())}}catch(h){i={error:h}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}if(this.pairs.push(f.getPairs()),!!t.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var l=new Array(e);l.push(f);try{return this.checkRows(l,a+1)}catch(h){console.log(h)}}}throw new A},t.isValidSequence=function(e){var n,i;try{for(var o=ie(t.FINDER_PATTERN_SEQUENCES),a=o.next();!a.done;a=o.next()){var f=a.value;if(!(e.length>f.length)){for(var s=!0,u=0;u<e.length;u++)if(e[u].getFinderPattern().getValue()!==f[u]){s=!1;break}if(s)return!0}}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return!1},t.prototype.storeRow=function(e,n){for(var i=0,o=!1,a=!1;i<this.rows.length;){var f=this.rows[i];if(f.getRowNumber()>e){a=f.isEquivalent(this.pairs);break}o=f.isEquivalent(this.pairs),i++}a||o||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(i,new Xn(this.pairs,e,n)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,n){var i,o,a,f,s,u;try{for(var c=ie(n),l=c.next();!l.done;l=c.next()){var h=l.value;if(h.getPairs().length!==e.length){var d=!0;try{for(var p=(a=void 0,ie(h.getPairs())),v=p.next();!v.done;v=p.next()){var g=v.value,y=!1;try{for(var m=(s=void 0,ie(e)),w=m.next();!w.done;w=m.next()){var _=w.value;if(Yr.equals(g,_)){y=!0;break}}}catch(I){s={error:I}}finally{try{w&&!w.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}y||(d=!1)}}catch(I){a={error:I}}finally{try{v&&!v.done&&(f=p.return)&&f.call(p)}finally{if(a)throw a.error}}}}}catch(I){i={error:I}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}},t.isPartialRow=function(e,n){var i,o,a,f,s,u;try{for(var c=ie(n),l=c.next();!l.done;l=c.next()){var h=l.value,d=!0;try{for(var p=(a=void 0,ie(e)),v=p.next();!v.done;v=p.next()){var g=v.value,y=!1;try{for(var m=(s=void 0,ie(h.getPairs())),w=m.next();!w.done;w=m.next()){var _=w.value;if(g.equals(_)){y=!0;break}}}catch(I){s={error:I}}finally{try{w&&!w.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(!y){d=!1;break}}}catch(I){a={error:I}}finally{try{v&&!v.done&&(f=p.return)&&f.call(p)}finally{if(a)throw a.error}}if(d)return!0}}catch(I){i={error:I}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(e){var n=Fn.buildBitArray(e),i=jr(n),o=i.parseInformation(),a=e[0].getFinderPattern().getResultPoints(),f=e[e.length-1].getFinderPattern().getResultPoints(),s=[a[0],a[1],f[0],f[1]];return new Z(o,null,null,s,C.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs.get(0),n=e.getLeftChar(),i=e.getRightChar();if(i===null)return!1;for(var o=i.getChecksumPortion(),a=2,f=1;f<this.pairs.size();++f){var s=this.pairs.get(f);o+=s.getLeftChar().getChecksumPortion(),a++;var u=s.getRightChar();u!=null&&(o+=u.getChecksumPortion(),a++)}o%=211;var c=211*(a-4)+o;return c===n.getValue()},t.getNextSecondBar=function(e,n){var i;return e.get(n)?(i=e.getNextUnset(n),i=e.getNextSet(i)):(i=e.getNextSet(n),i=e.getNextUnset(i)),i},t.prototype.retrieveNextPair=function(e,n,i){var o=n.length%2===0;this.startFromEven&&(o=!o);var a,f=!0,s=-1;do this.findNextPair(e,n,s),a=this.parseFoundFinderPattern(e,i,o),a===null?s=t.getNextSecondBar(e,this.startEnd[0]):f=!1;while(f);var u=this.decodeDataCharacter(e,a,o,!0);if(!this.isEmptyPair(n)&&n[n.length-1].mustBeLast())throw new A;var c;try{c=this.decodeDataCharacter(e,a,o,!1)}catch(l){c=null,console.log(l)}return new Yr(u,c,a,!0)},t.prototype.isEmptyPair=function(e){return e.length===0},t.prototype.findNextPair=function(e,n,i){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;var a=e.getSize(),f;if(i>=0)f=i;else if(this.isEmptyPair(n))f=0;else{var s=n[n.length-1];f=s.getFinderPattern().getStartEnd()[1]}var u=n.length%2!==0;this.startFromEven&&(u=!u);for(var c=!1;f<a&&(c=!e.get(f),!!c);)f++;for(var l=0,h=f,d=f;d<a;d++)if(e.get(d)!==c)o[l]++;else{if(l===3){if(u&&t.reverseCounters(o),t.isFinderPattern(o)){this.startEnd[0]=h,this.startEnd[1]=d;return}u&&t.reverseCounters(o),h+=o[0]+o[1],o[0]=o[2],o[1]=o[3],o[2]=0,o[3]=0,l--}else l++;o[l]=1,c=!c}throw new A},t.reverseCounters=function(e){for(var n=e.length,i=0;i<n/2;++i){var o=e[i];e[i]=e[n-i-1],e[n-i-1]=o}},t.prototype.parseFoundFinderPattern=function(e,n,i){var o,a,f;if(i){for(var s=this.startEnd[0]-1;s>=0&&!e.get(s);)s--;s++,o=this.startEnd[0]-s,a=s,f=this.startEnd[1]}else a=this.startEnd[0],f=e.getNextUnset(this.startEnd[1]+1),o=f-this.startEnd[1];var u=this.getDecodeFinderCounters();V.arraycopy(u,0,u,1,u.length-1),u[0]=o;var c;try{c=this.parseFinderValue(u,t.FINDER_PATTERNS)}catch{return null}return new sr(c,[a,f],a,f,n)},t.prototype.decodeDataCharacter=function(e,n,i,o){for(var a=this.getDataCharacterCounters(),f=0;f<a.length;f++)a[f]=0;if(o)t.recordPatternInReverse(e,n.getStartEnd()[0],a);else{t.recordPattern(e,n.getStartEnd()[1],a);for(var s=0,u=a.length-1;s<u;s++,u--){var c=a[s];a[s]=a[u],a[u]=c}}var l=17,h=G.sum(new Int32Array(a))/l,d=(n.getStartEnd()[1]-n.getStartEnd()[0])/15;if(Math.abs(h-d)/d>.3)throw new A;for(var p=this.getOddCounts(),v=this.getEvenCounts(),g=this.getOddRoundingErrors(),y=this.getEvenRoundingErrors(),s=0;s<a.length;s++){var m=1*a[s]/h,w=m+.5;if(w<1){if(m<.3)throw new A;w=1}else if(w>8){if(m>8.7)throw new A;w=8}var _=s/2;(s&1)===0?(p[_]=w,g[_]=m-w):(v[_]=w,y[_]=m-w)}this.adjustOddEvenCounts(l);for(var I=4*n.getValue()+(i?0:2)+(o?0:1)-1,T=0,D=0,s=p.length-1;s>=0;s--){if(t.isNotA1left(n,i,o)){var b=t.WEIGHTS[I][2*s];D+=p[s]*b}T+=p[s]}for(var L=0,s=v.length-1;s>=0;s--)if(t.isNotA1left(n,i,o)){var b=t.WEIGHTS[I][2*s+1];L+=v[s]*b}var B=D+L;if((T&1)!==0||T>13||T<4)throw new A;var vt=(13-T)/2,z=t.SYMBOL_WIDEST[vt],ut=9-z,Pt=ee.getRSSvalue(p,z,!0),$t=ee.getRSSvalue(v,ut,!1),Dr=t.EVEN_TOTAL_SUBSET[vt],Rr=t.GSUM[vt],Nr=Pt*Dr+$t+Rr;return new pe(Nr,B)},t.isNotA1left=function(e,n,i){return!(e.getValue()===0&&n&&i)},t.prototype.adjustOddEvenCounts=function(e){var n=G.sum(new Int32Array(this.getOddCounts())),i=G.sum(new Int32Array(this.getEvenCounts())),o=!1,a=!1;n>13?a=!0:n<4&&(o=!0);var f=!1,s=!1;i>13?s=!0:i<4&&(f=!0);var u=n+i-e,c=(n&1)===1,l=(i&1)===0;if(u===1)if(c){if(l)throw new A;a=!0}else{if(!l)throw new A;s=!0}else if(u===-1)if(c){if(l)throw new A;o=!0}else{if(!l)throw new A;f=!0}else if(u===0){if(c){if(!l)throw new A;n<i?(o=!0,s=!0):(a=!0,f=!0)}else if(l)throw new A}else throw new A;if(o){if(a)throw new A;t.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&t.decrement(this.getOddCounts(),this.getOddRoundingErrors()),f){if(s)throw new A;t.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&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})(Yt),Kr=Lf;var kf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Uf=(function(r){kf(t,r);function t(e,n,i){var o=r.call(this,e,n)||this;return o.count=0,o.finderPattern=i,o}return t.prototype.getFinderPattern=function(){return this.finderPattern},t.prototype.getCount=function(){return this.count},t.prototype.incrementCount=function(){this.count++},t})(pe),zn=Uf;var Hf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Qr=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.")},Vf=(function(r){Hf(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return t.prototype.decodeRow=function(e,n,i){var o,a,f,s,u=this.decodePair(n,!1,e,i);t.addOrTally(this.possibleLeftPairs,u),n.reverse();var c=this.decodePair(n,!0,e,i);t.addOrTally(this.possibleRightPairs,c),n.reverse();try{for(var l=Qr(this.possibleLeftPairs),h=l.next();!h.done;h=l.next()){var d=h.value;if(d.getCount()>1)try{for(var p=(f=void 0,Qr(this.possibleRightPairs)),v=p.next();!v.done;v=p.next()){var g=v.value;if(g.getCount()>1&&t.checkChecksum(d,g))return t.constructResult(d,g)}}catch(y){f={error:y}}finally{try{v&&!v.done&&(s=p.return)&&s.call(p)}finally{if(f)throw f.error}}}}catch(y){o={error:y}}finally{try{h&&!h.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}throw new A},t.addOrTally=function(e,n){var i,o;if(n!=null){var a=!1;try{for(var f=Qr(e),s=f.next();!s.done;s=f.next()){var u=s.value;if(u.getValue()===n.getValue()){u.incrementCount(),a=!0;break}}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}a||e.push(n)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,n){for(var i=4537077*e.getValue()+n.getValue(),o=new String(i).toString(),a=new P,f=13-o.length;f>0;f--)a.append("0");a.append(o);for(var s=0,f=0;f<13;f++){var u=a.charAt(f).charCodeAt(0)-48;s+=(f&1)===0?3*u:u}s=10-s%10,s===10&&(s=0),a.append(s.toString());var c=e.getFinderPattern().getResultPoints(),l=n.getFinderPattern().getResultPoints();return new Z(a.toString(),null,0,[c[0],c[1],l[0],l[1]],C.RSS_14,new Date().getTime())},t.checkChecksum=function(e,n){var i=(e.getChecksumPortion()+16*n.getChecksumPortion())%79,o=9*e.getFinderPattern().getValue()+n.getFinderPattern().getValue();return o>72&&o--,o>8&&o--,i===o},t.prototype.decodePair=function(e,n,i,o){try{var a=this.findFinderPattern(e,n),f=this.parseFoundFinderPattern(e,i,n,a),s=o==null?null:o.get(k.NEED_RESULT_POINT_CALLBACK);if(s!=null){var u=(a[0]+a[1])/2;n&&(u=e.getSize()-1-u),s.foundPossibleResultPoint(new R(u,i))}var c=this.decodeDataCharacter(e,f,!0),l=this.decodeDataCharacter(e,f,!1);return new zn(1597*c.getValue()+l.getValue(),c.getChecksumPortion()+4*l.getChecksumPortion(),f)}catch{return null}},t.prototype.decodeDataCharacter=function(e,n,i){for(var o=this.getDataCharacterCounters(),a=0;a<o.length;a++)o[a]=0;if(i)q.recordPatternInReverse(e,n.getStartEnd()[0],o);else{q.recordPattern(e,n.getStartEnd()[1]+1,o);for(var f=0,s=o.length-1;f<s;f++,s--){var u=o[f];o[f]=o[s],o[s]=u}}for(var c=i?16:15,l=G.sum(new Int32Array(o))/c,h=this.getOddCounts(),d=this.getEvenCounts(),p=this.getOddRoundingErrors(),v=this.getEvenRoundingErrors(),f=0;f<o.length;f++){var g=o[f]/l,y=Math.floor(g+.5);y<1?y=1:y>8&&(y=8);var m=Math.floor(f/2);(f&1)===0?(h[m]=y,p[m]=g-y):(d[m]=y,v[m]=g-y)}this.adjustOddEvenCounts(i,c);for(var w=0,_=0,f=h.length-1;f>=0;f--)_*=9,_+=h[f],w+=h[f];for(var I=0,T=0,f=d.length-1;f>=0;f--)I*=9,I+=d[f],T+=d[f];var D=_+3*I;if(i){if((w&1)!==0||w>12||w<4)throw new A;var b=(12-w)/2,L=t.OUTSIDE_ODD_WIDEST[b],B=9-L,vt=ee.getRSSvalue(h,L,!1),z=ee.getRSSvalue(d,B,!0),ut=t.OUTSIDE_EVEN_TOTAL_SUBSET[b],Pt=t.OUTSIDE_GSUM[b];return new pe(vt*ut+z+Pt,D)}else{if((T&1)!==0||T>10||T<4)throw new A;var b=(10-T)/2,L=t.INSIDE_ODD_WIDEST[b],B=9-L,vt=ee.getRSSvalue(h,L,!0),z=ee.getRSSvalue(d,B,!1),$t=t.INSIDE_ODD_TOTAL_SUBSET[b],Pt=t.INSIDE_GSUM[b];return new pe(z*$t+vt+Pt,D)}},t.prototype.findFinderPattern=function(e,n){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var o=e.getSize(),a=!1,f=0;f<o&&(a=!e.get(f),n!==a);)f++;for(var s=0,u=f,c=f;c<o;c++)if(e.get(c)!==a)i[s]++;else{if(s===3){if(Yt.isFinderPattern(i))return[u,c];u+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,s--}else s++;i[s]=1,a=!a}throw new A},t.prototype.parseFoundFinderPattern=function(e,n,i,o){for(var a=e.get(o[0]),f=o[0]-1;f>=0&&a!==e.get(f);)f--;f++;var s=o[0]-f,u=this.getDecodeFinderCounters(),c=new Int32Array(u.length);V.arraycopy(u,0,c,1,u.length-1),c[0]=s;var l=this.parseFinderValue(c,t.FINDER_PATTERNS),h=f,d=o[1];return i&&(h=e.getSize()-1-h,d=e.getSize()-1-d),new sr(l,[f,o[1]],h,d,n)},t.prototype.adjustOddEvenCounts=function(e,n){var i=G.sum(new Int32Array(this.getOddCounts())),o=G.sum(new Int32Array(this.getEvenCounts())),a=!1,f=!1,s=!1,u=!1;e?(i>12?f=!0:i<4&&(a=!0),o>12?u=!0:o<4&&(s=!0)):(i>11?f=!0:i<5&&(a=!0),o>10?u=!0:o<4&&(s=!0));var c=i+o-n,l=(i&1)===(e?1:0),h=(o&1)===1;if(c===1)if(l){if(h)throw new A;f=!0}else{if(!h)throw new A;u=!0}else if(c===-1)if(l){if(h)throw new A;a=!0}else{if(!h)throw new A;s=!0}else if(c===0){if(l){if(!h)throw new A;i<o?(a=!0,u=!0):(f=!0,s=!0)}else if(h)throw new A}else throw new A;if(a){if(f)throw new A;Yt.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(f&&Yt.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(u)throw new A;Yt.increment(this.getEvenCounts(),this.getOddRoundingErrors())}u&&Yt.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})(Yt),lr=Vf;var Gf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Wf=(function(r){Gf(t,r);function t(e){var n=r.call(this)||this;n.readers=[];var i=e?e.get(k.POSSIBLE_FORMATS):null,o=e&&e.get(k.ASSUME_CODE_39_CHECK_DIGIT)!==void 0,a=e&&e.get(k.ENABLE_CODE_39_EXTENDED_MODE)!==void 0;return i&&((i.includes(C.EAN_13)||i.includes(C.UPC_A)||i.includes(C.EAN_8)||i.includes(C.UPC_E))&&n.readers.push(new fr(e)),i.includes(C.CODE_39)&&n.readers.push(new ir(o,a)),i.includes(C.CODE_93)&&n.readers.push(new or),i.includes(C.CODE_128)&&n.readers.push(new nr),i.includes(C.ITF)&&n.readers.push(new ar),i.includes(C.CODABAR)&&n.readers.push(new Zr),i.includes(C.RSS_14)&&n.readers.push(new lr),i.includes(C.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),n.readers.push(new Kr))),n.readers.length===0&&(n.readers.push(new fr(e)),n.readers.push(new ir),n.readers.push(new or),n.readers.push(new fr(e)),n.readers.push(new nr),n.readers.push(new ar),n.readers.push(new lr)),n}return t.prototype.decodeRow=function(e,n,i){for(var o=0;o<this.readers.length;o++)try{return this.readers[o].decodeRow(e,n,i)}catch{}throw new A},t.prototype.reset=function(){this.readers.forEach(function(e){return e.reset()})},t})(q),Xt=Wf;var Xf=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),P2=(function(r){Xf(t,r);function t(e,n){return e===void 0&&(e=500),r.call(this,new Xt(n),e,n)||this}return t})(Mt);var 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.")},J=(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})();var K=(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})();var zf=(function(){function r(t,e,n,i,o,a){var f,s;this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=n,this.dataRegionSizeRows=i,this.dataRegionSizeColumns=o,this.ecBlocks=a;var u=0,c=a.getECCodewords(),l=a.getECBlocks();try{for(var h=Zn(l),d=h.next();!d.done;d=h.next()){var p=d.value;u+=p.getCount()*(p.getDataCodewords()+c)}}catch(v){f={error:v}}finally{try{d&&!d.done&&(s=h.return)&&s.call(h)}finally{if(f)throw f.error}}this.totalCodewords=u}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,i;if((t&1)!==0||(e&1)!==0)throw new S;try{for(var o=Zn(r.VERSIONS),a=o.next();!a.done;a=o.next()){var f=a.value;if(f.symbolSizeRows===t&&f.symbolSizeColumns===e)return f}}catch(s){n={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}throw new S},r.prototype.toString=function(){return""+this.versionNumber},r.buildVersions=function(){return[new r(1,10,10,8,8,new J(5,new K(1,3))),new r(2,12,12,10,10,new J(7,new K(1,5))),new r(3,14,14,12,12,new J(10,new K(1,8))),new r(4,16,16,14,14,new J(12,new K(1,12))),new r(5,18,18,16,16,new J(14,new K(1,18))),new r(6,20,20,18,18,new J(18,new K(1,22))),new r(7,22,22,20,20,new J(20,new K(1,30))),new r(8,24,24,22,22,new J(24,new K(1,36))),new r(9,26,26,24,24,new J(28,new K(1,44))),new r(10,32,32,14,14,new J(36,new K(1,62))),new r(11,36,36,16,16,new J(42,new K(1,86))),new r(12,40,40,18,18,new J(48,new K(1,114))),new r(13,44,44,20,20,new J(56,new K(1,144))),new r(14,48,48,22,22,new J(68,new K(1,174))),new r(15,52,52,24,24,new J(42,new K(2,102))),new r(16,64,64,14,14,new J(56,new K(2,140))),new r(17,72,72,16,16,new J(36,new K(4,92))),new r(18,80,80,18,18,new J(48,new K(4,114))),new r(19,88,88,20,20,new J(56,new K(4,144))),new r(20,96,96,22,22,new J(68,new K(4,174))),new r(21,104,104,24,24,new J(56,new K(6,136))),new r(22,120,120,18,18,new J(68,new K(6,175))),new r(23,132,132,20,20,new J(62,new K(8,163))),new r(24,144,144,22,22,new J(62,new K(8,156),new K(2,155))),new r(25,8,18,6,16,new J(7,new K(1,5))),new r(26,8,32,6,14,new J(11,new K(1,10))),new r(27,12,26,10,24,new J(14,new K(1,16))),new r(28,12,36,10,16,new J(18,new K(1,22))),new r(29,16,36,14,16,new J(24,new K(1,32))),new r(30,16,48,14,22,new J(28,new K(1,49)))]},r.VERSIONS=r.buildVersions(),r})(),jn=zf;var Zf=(function(){function r(t){var e=t.getHeight();if(e<8||e>144||(e&1)!==0)throw new S;this.version=r.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new at(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 jn.getVersionForDimensions(e,n)},r.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,n=4,i=0,o=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),f=!1,s=!1,u=!1,c=!1;do if(n===o&&i===0&&!f)t[e++]=this.readCorner1(o,a)&255,n-=2,i+=2,f=!0;else if(n===o-2&&i===0&&(a&3)!==0&&!s)t[e++]=this.readCorner2(o,a)&255,n-=2,i+=2,s=!0;else if(n===o+4&&i===2&&(a&7)===0&&!u)t[e++]=this.readCorner3(o,a)&255,n-=2,i+=2,u=!0;else if(n===o-2&&i===0&&(a&7)===4&&!c)t[e++]=this.readCorner4(o,a)&255,n-=2,i+=2,c=!0;else{do n<o&&i>=0&&!this.readMappingMatrix.get(i,n)&&(t[e++]=this.readUtah(n,i,o,a)&255),n-=2,i+=2;while(n>=0&&i<a);n+=1,i+=3;do n>=0&&i<a&&!this.readMappingMatrix.get(i,n)&&(t[e++]=this.readUtah(n,i,o,a)&255),n+=2,i-=2;while(n<o&&i>=0);n+=3,i+=1}while(n<o||i<a);if(e!==this.version.getTotalCodewords())throw new S;return t},r.prototype.readModule=function(t,e,n,i){return t<0&&(t+=n,e+=4-(n+4&7)),e<0&&(e+=i,t+=4-(i+4&7)),this.readMappingMatrix.set(e,t),this.mappingBitMatrix.get(e,t)},r.prototype.readUtah=function(t,e,n,i){var o=0;return this.readModule(t-2,e-2,n,i)&&(o|=1),o<<=1,this.readModule(t-2,e-1,n,i)&&(o|=1),o<<=1,this.readModule(t-1,e-2,n,i)&&(o|=1),o<<=1,this.readModule(t-1,e-1,n,i)&&(o|=1),o<<=1,this.readModule(t-1,e,n,i)&&(o|=1),o<<=1,this.readModule(t,e-2,n,i)&&(o|=1),o<<=1,this.readModule(t,e-1,n,i)&&(o|=1),o<<=1,this.readModule(t,e,n,i)&&(o|=1),o},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 O("Dimension of bitMatrix must match the version size");for(var i=this.version.getDataRegionSizeRows(),o=this.version.getDataRegionSizeColumns(),a=e/i|0,f=n/o|0,s=a*i,u=f*o,c=new at(u,s),l=0;l<a;++l)for(var h=l*i,d=0;d<f;++d)for(var p=d*o,v=0;v<i;++v)for(var g=l*(i+2)+1+v,y=h+v,m=0;m<o;++m){var w=d*(o+2)+1+m;if(t.get(w,g)){var _=p+m;c.set(_,y)}}return c},r})(),Yn=Zf;var Kn=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.")},jf=(function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e){var n,i,o,a,f=e.getECBlocks(),s=0,u=f.getECBlocks();try{for(var c=Kn(u),l=c.next();!l.done;l=c.next()){var h=l.value;s+=h.getCount()}}catch(Pt){n={error:Pt}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}var d=new Array(s),p=0;try{for(var v=Kn(u),g=v.next();!g.done;g=v.next())for(var h=g.value,y=0;y<h.getCount();y++){var m=h.getDataCodewords(),w=f.getECCodewords()+m;d[p++]=new r(m,new Uint8Array(w))}}catch(Pt){o={error:Pt}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}for(var _=d[0].codewords.length,I=_-f.getECCodewords(),T=I-1,D=0,y=0;y<T;y++)for(var b=0;b<p;b++)d[b].codewords[y]=t[D++];for(var L=e.getVersionNumber()===24,B=L?8:p,b=0;b<B;b++)d[b].codewords[I-1]=t[D++];for(var vt=d[0].codewords.length,y=I;y<vt;y++)for(var b=0;b<p;b++){var z=L?(b+8)%p:b,ut=L&&z>7?y-1:y;d[z].codewords[ut]=t[D++]}if(D!==t.length)throw new O;return d},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r})(),Qn=jf;var Yf=(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 O(""+t);var e=0,n=this.bitOffset,i=this.byteOffset,o=this.bytes;if(n>0){var a=8-n,f=t<a?t:a,s=a-f,u=255>>8-f<<s;e=(o[i]&u)>>s,t-=f,n+=f,n===8&&(n=0,i++)}if(t>0){for(;t>=8;)e=e<<8|o[i]&255,i++,t-=8;if(t>0){var s=8-t,u=255>>s<<s;e=e<<t|(o[i]&u)>>s,n+=t}}return this.bitOffset=n,this.byteOffset=i,e},r.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},r})(),We=Yf;var wt;(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"})(wt||(wt={}));var Kf=(function(){function r(){}return r.decode=function(t){var e=new We(t),n=new P,i=new P,o=new Array,a=wt.ASCII_ENCODE;do if(a===wt.ASCII_ENCODE)a=this.decodeAsciiSegment(e,n,i);else{switch(a){case wt.C40_ENCODE:this.decodeC40Segment(e,n);break;case wt.TEXT_ENCODE:this.decodeTextSegment(e,n);break;case wt.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,n);break;case wt.EDIFACT_ENCODE:this.decodeEdifactSegment(e,n);break;case wt.BASE256_ENCODE:this.decodeBase256Segment(e,n,o);break;default:throw new S}a=wt.ASCII_ENCODE}while(a!==wt.PAD_ENCODE&&e.available()>0);return i.length()>0&&n.append(i.toString()),new Zt(t,n.toString(),o.length===0?null:o,null)},r.decodeAsciiSegment=function(t,e,n){var i=!1;do{var o=t.readBits(8);if(o===0)throw new S;if(o<=128)return i&&(o+=128),e.append(String.fromCharCode(o-1)),wt.ASCII_ENCODE;if(o===129)return wt.PAD_ENCODE;if(o<=229){var a=o-130;a<10&&e.append("0"),e.append(""+a)}else switch(o){case 230:return wt.C40_ENCODE;case 231:return wt.BASE256_ENCODE;case 232:e.append("");break;case 233:case 234:break;case 235:i=!0;break;case 236:e.append("[)>05"),n.insert(0,"");break;case 237:e.append("[)>06"),n.insert(0,"");break;case 238:return wt.ANSIX12_ENCODE;case 239:return wt.TEXT_ENCODE;case 240:return wt.EDIFACT_ENCODE;case 241:break;default:if(o!==254||t.available()!==0)throw new S;break}}while(t.available()>0);return wt.ASCII_ENCODE},r.decodeC40Segment=function(t,e){var n=!1,i=[],o=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),i);for(var f=0;f<3;f++){var s=i[f];switch(o){case 0:if(s<3)o=s+1;else if(s<this.C40_BASIC_SET_CHARS.length){var u=this.C40_BASIC_SET_CHARS[s];n?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):e.append(u)}else throw new S;break;case 1:n?(e.append(String.fromCharCode(s+128)),n=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.C40_SHIFT2_SET_CHARS.length){var u=this.C40_SHIFT2_SET_CHARS[s];n?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):e.append(u)}else switch(s){case 27:e.append("");break;case 30:n=!0;break;default:throw new S}o=0;break;case 3:n?(e.append(String.fromCharCode(s+224)),n=!1):e.append(String.fromCharCode(s+96)),o=0;break;default:throw new S}}}while(t.available()>0)},r.decodeTextSegment=function(t,e){var n=!1,i=[],o=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),i);for(var f=0;f<3;f++){var s=i[f];switch(o){case 0:if(s<3)o=s+1;else if(s<this.TEXT_BASIC_SET_CHARS.length){var u=this.TEXT_BASIC_SET_CHARS[s];n?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):e.append(u)}else throw new S;break;case 1:n?(e.append(String.fromCharCode(s+128)),n=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.TEXT_SHIFT2_SET_CHARS.length){var u=this.TEXT_SHIFT2_SET_CHARS[s];n?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):e.append(u)}else switch(s){case 27:e.append("");break;case 30:n=!0;break;default:throw new S}o=0;break;case 3:if(s<this.TEXT_SHIFT3_SET_CHARS.length){var u=this.TEXT_SHIFT3_SET_CHARS[s];n?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):e.append(u),o=0}else throw new S;break;default:throw new S}}}while(t.available()>0)},r.decodeAnsiX12Segment=function(t,e){var n=[];do{if(t.available()===8)return;var i=t.readBits(8);if(i===254)return;this.parseTwoBytes(i,t.readBits(8),n);for(var o=0;o<3;o++){var a=n[o];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)e.append(String.fromCharCode(a+51));else throw new S;break}}}while(t.available()>0)},r.parseTwoBytes=function(t,e,n){var i=(t<<8)+e-1,o=Math.floor(i/1600);n[0]=o,i-=o*1600,o=Math.floor(i/40),n[1]=o,n[2]=i-o*40},r.decodeEdifactSegment=function(t,e){do{if(t.available()<=16)return;for(var n=0;n<4;n++){var i=t.readBits(6);if(i===31){var o=8-t.getBitOffset();o!==8&&t.readBits(o);return}(i&32)===0&&(i|=64),e.append(String.fromCharCode(i))}}while(t.available()>0)},r.decodeBase256Segment=function(t,e,n){var i=1+t.getByteOffset(),o=this.unrandomize255State(t.readBits(8),i++),a;if(o===0?a=t.available()/8|0:o<250?a=o:a=250*(o-249)+this.unrandomize255State(t.readBits(8),i++),a<0)throw new S;for(var f=new Uint8Array(a),s=0;s<a;s++){if(t.available()<8)throw new S;f[s]=this.unrandomize255State(t.readBits(8),i++)}n.push(f);try{e.append(yt.decode(f,F.ISO88591))}catch(u){throw new xt("Platform does not support required encoding: "+u.message)}},r.unrandomize255State=function(t,e){var n=149*e%255+1,i=t-n;return i>=0?i:i+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","{","|","}","~","\x7F"],r})(),qr=Kf;var Qf=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.")},qf=(function(){function r(){this.rsDecoder=new jt(dt.DATA_MATRIX_FIELD_256)}return r.prototype.decode=function(t){var e,n,i=new Yn(t),o=i.getVersion(),a=i.readCodewords(),f=Qn.getDataBlocks(a,o),s=0;try{for(var u=Qf(f),c=u.next();!c.done;c=u.next()){var l=c.value;s+=l.getNumDataCodewords()}}catch(w){e={error:w}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}for(var h=new Uint8Array(s),d=f.length,p=0;p<d;p++){var v=f[p],g=v.getCodewords(),y=v.getNumDataCodewords();this.correctErrors(g,y);for(var m=0;m<y;m++)h[m*d+p]=g[m]}return qr.decode(h)},r.prototype.correctErrors=function(t,e){var n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch{throw new j}for(var i=0;i<e;i++)t[i]=n[i]},r})(),qn=qf;var Jf=(function(){function r(t){this.image=t,this.rectangleDetector=new Ae(this.image)}return r.prototype.detect=function(){var t=this.rectangleDetector.detect(),e=this.detectSolid1(t);if(e=this.detectSolid2(e),e[3]=this.correctTopRight(e),!e[3])throw new A;e=this.shiftToModuleCenter(e);var n=e[0],i=e[1],o=e[2],a=e[3],f=this.transitionsBetween(n,a)+1,s=this.transitionsBetween(o,a)+1;(f&1)===1&&(f+=1),(s&1)===1&&(s+=1),4*f<7*s&&4*s<7*f&&(f=s=Math.max(f,s));var u=r.sampleGrid(this.image,n,i,o,a,f,s);return new he(u,[n,i,o,a])},r.shiftPoint=function(t,e,n){var i=(e.getX()-t.getX())/(n+1),o=(e.getY()-t.getY())/(n+1);return new R(t.getX()+i,t.getY()+o)},r.moveAway=function(t,e,n){var i=t.getX(),o=t.getY();return i<e?i-=1:i+=1,o<n?o-=1:o+=1,new R(i,o)},r.prototype.detectSolid1=function(t){var e=t[0],n=t[1],i=t[3],o=t[2],a=this.transitionsBetween(e,n),f=this.transitionsBetween(n,i),s=this.transitionsBetween(i,o),u=this.transitionsBetween(o,e),c=a,l=[o,e,n,i];return c>f&&(c=f,l[0]=e,l[1]=n,l[2]=i,l[3]=o),c>s&&(c=s,l[0]=n,l[1]=i,l[2]=o,l[3]=e),c>u&&(l[0]=i,l[1]=o,l[2]=e,l[3]=n),l},r.prototype.detectSolid2=function(t){var e=t[0],n=t[1],i=t[2],o=t[3],a=this.transitionsBetween(e,o),f=r.shiftPoint(n,i,(a+1)*4),s=r.shiftPoint(i,n,(a+1)*4),u=this.transitionsBetween(f,e),c=this.transitionsBetween(s,o);return u<c?(t[0]=e,t[1]=n,t[2]=i,t[3]=o):(t[0]=n,t[1]=i,t[2]=o,t[3]=e),t},r.prototype.correctTopRight=function(t){var e=t[0],n=t[1],i=t[2],o=t[3],a=this.transitionsBetween(e,o),f=this.transitionsBetween(n,o),s=r.shiftPoint(e,n,(f+1)*4),u=r.shiftPoint(i,n,(a+1)*4);a=this.transitionsBetween(s,o),f=this.transitionsBetween(u,o);var c=new R(o.getX()+(i.getX()-n.getX())/(a+1),o.getY()+(i.getY()-n.getY())/(a+1)),l=new R(o.getX()+(e.getX()-n.getX())/(f+1),o.getY()+(e.getY()-n.getY())/(f+1));if(!this.isValid(c))return this.isValid(l)?l:null;if(!this.isValid(l))return c;var h=this.transitionsBetween(s,c)+this.transitionsBetween(u,c),d=this.transitionsBetween(s,l)+this.transitionsBetween(u,l);return h>d?c:l},r.prototype.shiftToModuleCenter=function(t){var e=t[0],n=t[1],i=t[2],o=t[3],a=this.transitionsBetween(e,o)+1,f=this.transitionsBetween(i,o)+1,s=r.shiftPoint(e,n,f*4),u=r.shiftPoint(i,n,a*4);a=this.transitionsBetween(s,o)+1,f=this.transitionsBetween(u,o)+1,(a&1)===1&&(a+=1),(f&1)===1&&(f+=1);var c=(e.getX()+n.getX()+i.getX()+o.getX())/4,l=(e.getY()+n.getY()+i.getY()+o.getY())/4;e=r.moveAway(e,c,l),n=r.moveAway(n,c,l),i=r.moveAway(i,c,l),o=r.moveAway(o,c,l);var h,d;return s=r.shiftPoint(e,n,f*4),s=r.shiftPoint(s,o,a*4),h=r.shiftPoint(n,e,f*4),h=r.shiftPoint(h,i,a*4),u=r.shiftPoint(i,o,f*4),u=r.shiftPoint(u,n,a*4),d=r.shiftPoint(o,i,f*4),d=r.shiftPoint(d,e,a*4),[s,h,u,d]},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,i,o,a,f){var s=de.getInstance();return s.sampleGrid(t,a,f,.5,.5,a-.5,.5,a-.5,f-.5,.5,f-.5,e.getX(),e.getY(),o.getX(),o.getY(),i.getX(),i.getY(),n.getX(),n.getY())},r.prototype.transitionsBetween=function(t,e){var n=Math.trunc(t.getX()),i=Math.trunc(t.getY()),o=Math.trunc(e.getX()),a=Math.trunc(e.getY()),f=Math.abs(a-i)>Math.abs(o-n);if(f){var s=n;n=i,i=s,s=o,o=a,a=s}for(var u=Math.abs(o-n),c=Math.abs(a-i),l=-u/2,h=i<a?1:-1,d=n<o?1:-1,p=0,v=this.image.get(f?i:n,f?n:i),g=n,y=i;g!==o;g+=d){var m=this.image.get(f?y:g,f?g:y);if(m!==v&&(p++,v=m),l+=c,l>0){if(y===a)break;y+=h,l-=u}}return p},r})(),Jn=Jf;var $f=(function(){function r(){this.decoder=new qn}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n,i;if(e!=null&&e.has(k.PURE_BARCODE)){var o=r.extractPureBits(t.getBlackMatrix());n=this.decoder.decode(o),i=r.NO_POINTS}else{var a=new Jn(t.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),i=a.getPoints()}var f=n.getRawBytes(),s=new Z(n.getText(),f,8*f.length,i,C.DATA_MATRIX,V.currentTimeMillis()),u=n.getByteSegments();u!=null&&s.putMetadata(ft.BYTE_SEGMENTS,u);var c=n.getECLevel();return c!=null&&s.putMetadata(ft.ERROR_CORRECTION_LEVEL,c),s},r.prototype.reset=function(){},r.extractPureBits=function(t){var e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e==null||n==null)throw new A;var i=this.moduleSize(e,t),o=e[1],a=n[1],f=e[0],s=n[0],u=(s-f+1)/i,c=(a-o+1)/i;if(u<=0||c<=0)throw new A;var l=i/2;o+=l,f+=l;for(var h=new at(u,c),d=0;d<c;d++)for(var p=o+d*i,v=0;v<u;v++)t.get(f+v*i,p)&&h.set(v,d);return h},r.moduleSize=function(t,e){for(var n=e.getWidth(),i=t[0],o=t[1];i<n&&e.get(i,o);)i++;if(i===n)throw new A;var a=i-t[0];if(a===0)throw new A;return a},r.NO_POINTS=[],r})(),oe=$f;var t1=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Iv=(function(r){t1(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new oe,e)||this}return t})(Mt);var Se;(function(r){r[r.L=0]="L",r[r.M=1]="M",r[r.Q=2]="Q",r[r.H=3]="H"})(Se||(Se={}));var e1=(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 st(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 O;return r.FOR_BITS.get(t)},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.L=new r(Se.L,"L",1),r.M=new r(Se.M,"M",0),r.Q=new r(Se.Q,"Q",3),r.H=new r(Se.H,"H",2),r})(),Nt=e1;var r1=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.")},n1=(function(){function r(t){this.errorCorrectionLevel=Nt.forBits(t>>3&3),this.dataMask=t&7}return r.numBitsDiffering=function(t,e){return M.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,i,o=Number.MAX_SAFE_INTEGER,a=0;try{for(var f=r1(r.FORMAT_INFO_DECODE_LOOKUP),s=f.next();!s.done;s=f.next()){var u=s.value,c=u[0];if(c===t||c===e)return new r(u[1]);var l=r.numBitsDiffering(t,c);l<o&&(a=u[1],o=l),t!==e&&(l=r.numBitsDiffering(e,c),l<o&&(a=u[1],o=l))}}catch(h){n={error:h}}finally{try{s&&!s.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}return o<=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})(),Xe=n1;var i1=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.")},o1=(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,i=this.ecBlocks;try{for(var o=i1(i),a=o.next();!a.done;a=o.next()){var f=a.value;n+=f.getCount()}}catch(s){t={error:s}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}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})(),E=o1;var a1=(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})(),x=a1;var f1=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.")},s1=(function(){function r(t,e){for(var n,i,o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];this.versionNumber=t,this.alignmentPatternCenters=e,this.ecBlocks=o;var f=0,s=o[0].getECCodewordsPerBlock(),u=o[0].getECBlocks();try{for(var c=f1(u),l=c.next();!l.done;l=c.next()){var h=l.value;f+=h.getCount()*(h.getDataCodewords()+s)}}catch(d){n={error:d}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}this.totalCodewords=f}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 S;try{return this.getVersionForNumber((t-17)/4)}catch{throw new S}},r.getVersionForNumber=function(t){if(t<1||t>40)throw new O;return r.VERSIONS[t-1]},r.decodeVersionInformation=function(t){for(var e=Number.MAX_SAFE_INTEGER,n=0,i=0;i<r.VERSION_DECODE_INFO.length;i++){var o=r.VERSION_DECODE_INFO[i];if(o===t)return r.getVersionForNumber(i+7);var a=Xe.numBitsDiffering(t,o);a<e&&(n=i+7,e=a)}return e<=3?r.getVersionForNumber(n):null},r.prototype.buildFunctionPattern=function(){var t=this.getDimensionForVersion(),e=new at(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,i=0;i<n;i++)for(var o=this.alignmentPatternCenters[i]-2,a=0;a<n;a++)i===0&&(a===0||a===n-1)||i===n-1&&a===0||e.setRegion(this.alignmentPatternCenters[a]-2,o,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 E(7,new x(1,19)),new E(10,new x(1,16)),new E(13,new x(1,13)),new E(17,new x(1,9))),new r(2,Int32Array.from([6,18]),new E(10,new x(1,34)),new E(16,new x(1,28)),new E(22,new x(1,22)),new E(28,new x(1,16))),new r(3,Int32Array.from([6,22]),new E(15,new x(1,55)),new E(26,new x(1,44)),new E(18,new x(2,17)),new E(22,new x(2,13))),new r(4,Int32Array.from([6,26]),new E(20,new x(1,80)),new E(18,new x(2,32)),new E(26,new x(2,24)),new E(16,new x(4,9))),new r(5,Int32Array.from([6,30]),new E(26,new x(1,108)),new E(24,new x(2,43)),new E(18,new x(2,15),new x(2,16)),new E(22,new x(2,11),new x(2,12))),new r(6,Int32Array.from([6,34]),new E(18,new x(2,68)),new E(16,new x(4,27)),new E(24,new x(4,19)),new E(28,new x(4,15))),new r(7,Int32Array.from([6,22,38]),new E(20,new x(2,78)),new E(18,new x(4,31)),new E(18,new x(2,14),new x(4,15)),new E(26,new x(4,13),new x(1,14))),new r(8,Int32Array.from([6,24,42]),new E(24,new x(2,97)),new E(22,new x(2,38),new x(2,39)),new E(22,new x(4,18),new x(2,19)),new E(26,new x(4,14),new x(2,15))),new r(9,Int32Array.from([6,26,46]),new E(30,new x(2,116)),new E(22,new x(3,36),new x(2,37)),new E(20,new x(4,16),new x(4,17)),new E(24,new x(4,12),new x(4,13))),new r(10,Int32Array.from([6,28,50]),new E(18,new x(2,68),new x(2,69)),new E(26,new x(4,43),new x(1,44)),new E(24,new x(6,19),new x(2,20)),new E(28,new x(6,15),new x(2,16))),new r(11,Int32Array.from([6,30,54]),new E(20,new x(4,81)),new E(30,new x(1,50),new x(4,51)),new E(28,new x(4,22),new x(4,23)),new E(24,new x(3,12),new x(8,13))),new r(12,Int32Array.from([6,32,58]),new E(24,new x(2,92),new x(2,93)),new E(22,new x(6,36),new x(2,37)),new E(26,new x(4,20),new x(6,21)),new E(28,new x(7,14),new x(4,15))),new r(13,Int32Array.from([6,34,62]),new E(26,new x(4,107)),new E(22,new x(8,37),new x(1,38)),new E(24,new x(8,20),new x(4,21)),new E(22,new x(12,11),new x(4,12))),new r(14,Int32Array.from([6,26,46,66]),new E(30,new x(3,115),new x(1,116)),new E(24,new x(4,40),new x(5,41)),new E(20,new x(11,16),new x(5,17)),new E(24,new x(11,12),new x(5,13))),new r(15,Int32Array.from([6,26,48,70]),new E(22,new x(5,87),new x(1,88)),new E(24,new x(5,41),new x(5,42)),new E(30,new x(5,24),new x(7,25)),new E(24,new x(11,12),new x(7,13))),new r(16,Int32Array.from([6,26,50,74]),new E(24,new x(5,98),new x(1,99)),new E(28,new x(7,45),new x(3,46)),new E(24,new x(15,19),new x(2,20)),new E(30,new x(3,15),new x(13,16))),new r(17,Int32Array.from([6,30,54,78]),new E(28,new x(1,107),new x(5,108)),new E(28,new x(10,46),new x(1,47)),new E(28,new x(1,22),new x(15,23)),new E(28,new x(2,14),new x(17,15))),new r(18,Int32Array.from([6,30,56,82]),new E(30,new x(5,120),new x(1,121)),new E(26,new x(9,43),new x(4,44)),new E(28,new x(17,22),new x(1,23)),new E(28,new x(2,14),new x(19,15))),new r(19,Int32Array.from([6,30,58,86]),new E(28,new x(3,113),new x(4,114)),new E(26,new x(3,44),new x(11,45)),new E(26,new x(17,21),new x(4,22)),new E(26,new x(9,13),new x(16,14))),new r(20,Int32Array.from([6,34,62,90]),new E(28,new x(3,107),new x(5,108)),new E(26,new x(3,41),new x(13,42)),new E(30,new x(15,24),new x(5,25)),new E(28,new x(15,15),new x(10,16))),new r(21,Int32Array.from([6,28,50,72,94]),new E(28,new x(4,116),new x(4,117)),new E(26,new x(17,42)),new E(28,new x(17,22),new x(6,23)),new E(30,new x(19,16),new x(6,17))),new r(22,Int32Array.from([6,26,50,74,98]),new E(28,new x(2,111),new x(7,112)),new E(28,new x(17,46)),new E(30,new x(7,24),new x(16,25)),new E(24,new x(34,13))),new r(23,Int32Array.from([6,30,54,78,102]),new E(30,new x(4,121),new x(5,122)),new E(28,new x(4,47),new x(14,48)),new E(30,new x(11,24),new x(14,25)),new E(30,new x(16,15),new x(14,16))),new r(24,Int32Array.from([6,28,54,80,106]),new E(30,new x(6,117),new x(4,118)),new E(28,new x(6,45),new x(14,46)),new E(30,new x(11,24),new x(16,25)),new E(30,new x(30,16),new x(2,17))),new r(25,Int32Array.from([6,32,58,84,110]),new E(26,new x(8,106),new x(4,107)),new E(28,new x(8,47),new x(13,48)),new E(30,new x(7,24),new x(22,25)),new E(30,new x(22,15),new x(13,16))),new r(26,Int32Array.from([6,30,58,86,114]),new E(28,new x(10,114),new x(2,115)),new E(28,new x(19,46),new x(4,47)),new E(28,new x(28,22),new x(6,23)),new E(30,new x(33,16),new x(4,17))),new r(27,Int32Array.from([6,34,62,90,118]),new E(30,new x(8,122),new x(4,123)),new E(28,new x(22,45),new x(3,46)),new E(30,new x(8,23),new x(26,24)),new E(30,new x(12,15),new x(28,16))),new r(28,Int32Array.from([6,26,50,74,98,122]),new E(30,new x(3,117),new x(10,118)),new E(28,new x(3,45),new x(23,46)),new E(30,new x(4,24),new x(31,25)),new E(30,new x(11,15),new x(31,16))),new r(29,Int32Array.from([6,30,54,78,102,126]),new E(30,new x(7,116),new x(7,117)),new E(28,new x(21,45),new x(7,46)),new E(30,new x(1,23),new x(37,24)),new E(30,new x(19,15),new x(26,16))),new r(30,Int32Array.from([6,26,52,78,104,130]),new E(30,new x(5,115),new x(10,116)),new E(28,new x(19,47),new x(10,48)),new E(30,new x(15,24),new x(25,25)),new E(30,new x(23,15),new x(25,16))),new r(31,Int32Array.from([6,30,56,82,108,134]),new E(30,new x(13,115),new x(3,116)),new E(28,new x(2,46),new x(29,47)),new E(30,new x(42,24),new x(1,25)),new E(30,new x(23,15),new x(28,16))),new r(32,Int32Array.from([6,34,60,86,112,138]),new E(30,new x(17,115)),new E(28,new x(10,46),new x(23,47)),new E(30,new x(10,24),new x(35,25)),new E(30,new x(19,15),new x(35,16))),new r(33,Int32Array.from([6,30,58,86,114,142]),new E(30,new x(17,115),new x(1,116)),new E(28,new x(14,46),new x(21,47)),new E(30,new x(29,24),new x(19,25)),new E(30,new x(11,15),new x(46,16))),new r(34,Int32Array.from([6,34,62,90,118,146]),new E(30,new x(13,115),new x(6,116)),new E(28,new x(14,46),new x(23,47)),new E(30,new x(44,24),new x(7,25)),new E(30,new x(59,16),new x(1,17))),new r(35,Int32Array.from([6,30,54,78,102,126,150]),new E(30,new x(12,121),new x(7,122)),new E(28,new x(12,47),new x(26,48)),new E(30,new x(39,24),new x(14,25)),new E(30,new x(22,15),new x(41,16))),new r(36,Int32Array.from([6,24,50,76,102,128,154]),new E(30,new x(6,121),new x(14,122)),new E(28,new x(6,47),new x(34,48)),new E(30,new x(46,24),new x(10,25)),new E(30,new x(2,15),new x(64,16))),new r(37,Int32Array.from([6,28,54,80,106,132,158]),new E(30,new x(17,122),new x(4,123)),new E(28,new x(29,46),new x(14,47)),new E(30,new x(49,24),new x(10,25)),new E(30,new x(24,15),new x(46,16))),new r(38,Int32Array.from([6,32,58,84,110,136,162]),new E(30,new x(4,122),new x(18,123)),new E(28,new x(13,46),new x(32,47)),new E(30,new x(48,24),new x(14,25)),new E(30,new x(42,15),new x(32,16))),new r(39,Int32Array.from([6,26,54,82,110,138,166]),new E(30,new x(20,117),new x(4,118)),new E(28,new x(40,47),new x(7,48)),new E(30,new x(43,24),new x(22,25)),new E(30,new x(10,15),new x(67,16))),new r(40,Int32Array.from([6,30,58,86,114,142,170]),new E(30,new x(19,118),new x(6,119)),new E(28,new x(18,47),new x(31,48)),new E(30,new x(34,24),new x(34,25)),new E(30,new x(20,15),new x(61,16)))],r})(),Vt=s1;var Et;(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"})(Et||(Et={}));var u1=(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 i=0;i<e;i++)this.isMasked(n,i)&&t.flip(i,n)},r.values=new Map([[Et.DATA_MASK_000,new r(Et.DATA_MASK_000,function(t,e){return(t+e&1)===0})],[Et.DATA_MASK_001,new r(Et.DATA_MASK_001,function(t,e){return(t&1)===0})],[Et.DATA_MASK_010,new r(Et.DATA_MASK_010,function(t,e){return e%3===0})],[Et.DATA_MASK_011,new r(Et.DATA_MASK_011,function(t,e){return(t+e)%3===0})],[Et.DATA_MASK_100,new r(Et.DATA_MASK_100,function(t,e){return(Math.floor(t/2)+Math.floor(e/3)&1)===0})],[Et.DATA_MASK_101,new r(Et.DATA_MASK_101,function(t,e){return t*e%6===0})],[Et.DATA_MASK_110,new r(Et.DATA_MASK_110,function(t,e){return t*e%6<3})],[Et.DATA_MASK_111,new r(Et.DATA_MASK_111,function(t,e){return(t+e+t*e%3&1)===0})]]),r})(),hr=u1;var c1=(function(){function r(t){var e=t.getHeight();if(e<21||(e&3)!==1)throw new S;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);for(var i=this.bitMatrix.getHeight(),o=0,a=i-7,n=i-1;n>=a;n--)o=this.copyBit(8,n,o);for(var e=i-8;e<i;e++)o=this.copyBit(e,8,o);if(this.parsedFormatInfo=Xe.decodeFormatInformation(t,o),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new S},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 Vt.getVersionForNumber(e);for(var n=0,i=t-11,o=5;o>=0;o--)for(var a=t-9;a>=i;a--)n=this.copyBit(a,o,n);var f=Vt.decodeVersionInformation(n);if(f!==null&&f.getDimensionForVersion()===t)return this.parsedVersion=f,f;n=0;for(var a=5;a>=0;a--)for(var o=t-9;o>=i;o--)n=this.copyBit(a,o,n);if(f=Vt.decodeVersionInformation(n),f!==null&&f.getDimensionForVersion()===t)return this.parsedVersion=f,f;throw new S},r.prototype.copyBit=function(t,e,n){var i=this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e);return i?n<<1|1:n<<1},r.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),n=hr.values.get(t.getDataMask()),i=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,i);for(var o=e.buildFunctionPattern(),a=!0,f=new Uint8Array(e.getTotalCodewords()),s=0,u=0,c=0,l=i-1;l>0;l-=2){l===6&&l--;for(var h=0;h<i;h++)for(var d=a?i-1-h:h,p=0;p<2;p++)o.get(l-p,d)||(c++,u<<=1,this.bitMatrix.get(l-p,d)&&(u|=1),c===8&&(f[s++]=u,c=0,u=0));a=!a}if(s!==e.getTotalCodewords())throw new S;return f},r.prototype.remask=function(){if(this.parsedFormatInfo!==null){var t=hr.values.get(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 i=e+1,o=t.getHeight();i<o;i++)t.get(e,i)!==t.get(i,e)&&(t.flip(i,e),t.flip(e,i))},r})(),$n=c1;var ti=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.")},l1=(function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e,n){var i,o,a,f;if(t.length!==e.getTotalCodewords())throw new O;var s=e.getECBlocksForLevel(n),u=0,c=s.getECBlocks();try{for(var l=ti(c),h=l.next();!h.done;h=l.next()){var d=h.value;u+=d.getCount()}}catch(ut){i={error:ut}}finally{try{h&&!h.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}var p=new Array(u),v=0;try{for(var g=ti(c),y=g.next();!y.done;y=g.next())for(var d=y.value,m=0;m<d.getCount();m++){var w=d.getDataCodewords(),_=s.getECCodewordsPerBlock()+w;p[v++]=new r(w,new Uint8Array(_))}}catch(ut){a={error:ut}}finally{try{y&&!y.done&&(f=g.return)&&f.call(g)}finally{if(a)throw a.error}}for(var I=p[0].codewords.length,T=p.length-1;T>=0;){var D=p[T].codewords.length;if(D===I)break;T--}T++;for(var b=I-s.getECCodewordsPerBlock(),L=0,m=0;m<b;m++)for(var B=0;B<v;B++)p[B].codewords[m]=t[L++];for(var B=T;B<v;B++)p[B].codewords[b]=t[L++];for(var vt=p[0].codewords.length,m=b;m<vt;m++)for(var B=0;B<v;B++){var z=B<T?m:m+1;p[B].codewords[z]=t[L++]}return p},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r})(),ei=l1;var Lt;(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"})(Lt||(Lt={}));var h1=(function(){function r(t,e,n,i){this.value=t,this.stringValue=e,this.characterCountBitsForVersions=n,this.bits=i,r.FOR_BITS.set(i,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 O;return e},r.prototype.getCharacterCountBits=function(t){var e=t.getVersionNumber(),n;return e<=9?n=0:e<=26?n=1:n=2,this.characterCountBitsForVersions[n]},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(Lt.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),r.NUMERIC=new r(Lt.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),r.ALPHANUMERIC=new r(Lt.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),r.STRUCTURED_APPEND=new r(Lt.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),r.BYTE=new r(Lt.BYTE,"BYTE",Int32Array.from([8,16,16]),4),r.ECI=new r(Lt.ECI,"ECI",Int32Array.from([0,0,0]),7),r.KANJI=new r(Lt.KANJI,"KANJI",Int32Array.from([8,10,12]),8),r.FNC1_FIRST_POSITION=new r(Lt.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),r.FNC1_SECOND_POSITION=new r(Lt.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),r.HANZI=new r(Lt.HANZI,"HANZI",Int32Array.from([8,10,12]),13),r})(),et=h1;var d1=(function(){function r(){}return r.decode=function(t,e,n,i){var o=new We(t),a=new P,f=new Array,s=-1,u=-1;try{var c=null,l=!1,h=void 0;do{if(o.available()<4)h=et.TERMINATOR;else{var d=o.readBits(4);h=et.forBits(d)}switch(h){case et.TERMINATOR:break;case et.FNC1_FIRST_POSITION:case et.FNC1_SECOND_POSITION:l=!0;break;case et.STRUCTURED_APPEND:if(o.available()<16)throw new S;s=o.readBits(8),u=o.readBits(8);break;case et.ECI:var p=r.parseECIValue(o);if(c=ot.getCharacterSetECIByValue(p),c===null)throw new S;break;case et.HANZI:var v=o.readBits(4),g=o.readBits(h.getCharacterCountBits(e));v===r.GB2312_SUBSET&&r.decodeHanziSegment(o,a,g);break;default:var y=o.readBits(h.getCharacterCountBits(e));switch(h){case et.NUMERIC:r.decodeNumericSegment(o,a,y);break;case et.ALPHANUMERIC:r.decodeAlphanumericSegment(o,a,y,l);break;case et.BYTE:r.decodeByteSegment(o,a,y,c,f,i);break;case et.KANJI:r.decodeKanjiSegment(o,a,y);break;default:throw new S}break}}while(h!==et.TERMINATOR)}catch{throw new S}return new Zt(t,a.toString(),f.length===0?null:f,n===null?null:n.toString(),s,u)},r.decodeHanziSegment=function(t,e,n){if(n*13>t.available())throw new S;for(var i=new Uint8Array(2*n),o=0;n>0;){var a=t.readBits(13),f=a/96<<8&4294967295|a%96;f<959?f+=41377:f+=42657,i[o]=f>>8&255,i[o+1]=f&255,o+=2,n--}try{e.append(yt.decode(i,F.GB2312))}catch(s){throw new S(s)}},r.decodeKanjiSegment=function(t,e,n){if(n*13>t.available())throw new S;for(var i=new Uint8Array(2*n),o=0;n>0;){var a=t.readBits(13),f=a/192<<8&4294967295|a%192;f<7936?f+=33088:f+=49472,i[o]=f>>8,i[o+1]=f,o+=2,n--}try{e.append(yt.decode(i,F.SHIFT_JIS))}catch(s){throw new S(s)}},r.decodeByteSegment=function(t,e,n,i,o,a){if(8*n>t.available())throw new S;for(var f=new Uint8Array(n),s=0;s<n;s++)f[s]=t.readBits(8);var u;i===null?u=F.guessEncoding(f,a):u=i.getName();try{e.append(yt.decode(f,u))}catch(c){throw new S(c)}o.push(f)},r.toAlphaNumericChar=function(t){if(t>=r.ALPHANUMERIC_CHARS.length)throw new S;return r.ALPHANUMERIC_CHARS[t]},r.decodeAlphanumericSegment=function(t,e,n,i){for(var o=e.length();n>1;){if(t.available()<11)throw new S;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 S;e.append(r.toAlphaNumericChar(t.readBits(6)))}if(i)for(var f=o;f<e.length();f++)e.charAt(f)==="%"&&(f<e.length()-1&&e.charAt(f+1)==="%"?e.deleteCharAt(f+1):e.setCharAt(f,""))},r.decodeNumericSegment=function(t,e,n){for(;n>=3;){if(t.available()<10)throw new S;var i=t.readBits(10);if(i>=1e3)throw new S;e.append(r.toAlphaNumericChar(Math.floor(i/100))),e.append(r.toAlphaNumericChar(Math.floor(i/10)%10)),e.append(r.toAlphaNumericChar(i%10)),n-=3}if(n===2){if(t.available()<7)throw new S;var o=t.readBits(7);if(o>=100)throw new S;e.append(r.toAlphaNumericChar(Math.floor(o/10))),e.append(r.toAlphaNumericChar(o%10))}else if(n===1){if(t.available()<4)throw new S;var a=t.readBits(4);if(a>=10)throw new S;e.append(r.toAlphaNumericChar(a))}},r.parseECIValue=function(t){var e=t.readBits(8);if((e&128)===0)return e&127;if((e&192)===128){var n=t.readBits(8);return(e&63)<<8&4294967295|n}if((e&224)===192){var i=t.readBits(16);return(e&31)<<16&4294967295|i}throw new S},r.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",r.GB2312_SUBSET=1,r})(),Jr=d1;var p1=(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})(),dr=p1;var 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.")},v1=(function(){function r(){this.rsDecoder=new jt(dt.QR_CODE_FIELD_256)}return r.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(at.parseFromBooleanArray(t),e)},r.prototype.decodeBitMatrix=function(t,e){var n=new $n(t),i=null;try{return this.decodeBitMatrixParser(n,e)}catch(a){i=a}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var o=this.decodeBitMatrixParser(n,e);return o.setOther(new dr(!0)),o}catch(a){throw i!==null?i:a}},r.prototype.decodeBitMatrixParser=function(t,e){var n,i,o,a,f=t.readVersion(),s=t.readFormatInformation().getErrorCorrectionLevel(),u=t.readCodewords(),c=ei.getDataBlocks(u,f,s),l=0;try{for(var h=ri(c),d=h.next();!d.done;d=h.next()){var p=d.value;l+=p.getNumDataCodewords()}}catch(T){n={error:T}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}var v=new Uint8Array(l),g=0;try{for(var y=ri(c),m=y.next();!m.done;m=y.next()){var p=m.value,w=p.getCodewords(),_=p.getNumDataCodewords();this.correctErrors(w,_);for(var I=0;I<_;I++)v[g++]=w[I]}}catch(T){o={error:T}}finally{try{m&&!m.done&&(a=y.return)&&a.call(y)}finally{if(o)throw o.error}}return Jr.decode(v,f,s,e)},r.prototype.correctErrors=function(t,e){var n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch{throw new j}for(var i=0;i<e;i++)t[i]=n[i]},r})(),ni=v1;var x1=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),g1=(function(r){x1(t,r);function t(e,n,i){var o=r.call(this,e,n)||this;return o.estimatedModuleSize=i,o}return t.prototype.aboutEquals=function(e,n,i){if(Math.abs(n-this.getY())<=e&&Math.abs(i-this.getX())<=e){var o=Math.abs(e-this.estimatedModuleSize);return o<=1||o<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,i){var o=(this.getX()+n)/2,a=(this.getY()+e)/2,f=(this.estimatedModuleSize+i)/2;return new t(o,a,f)},t})(R),ii=g1;var m1=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.")},y1=(function(){function r(t,e,n,i,o,a,f){this.image=t,this.startX=e,this.startY=n,this.width=i,this.height=o,this.moduleSize=a,this.resultPointCallback=f,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return r.prototype.find=function(){for(var t=this.startX,e=this.height,n=this.width,i=t+n,o=this.startY+e/2,a=new Int32Array(3),f=this.image,s=0;s<e;s++){var u=o+((s&1)===0?Math.floor((s+1)/2):-Math.floor((s+1)/2));a[0]=0,a[1]=0,a[2]=0;for(var c=t;c<i&&!f.get(c,u);)c++;for(var l=0;c<i;){if(f.get(c,u))if(l===1)a[1]++;else if(l===2){if(this.foundPatternCross(a)){var h=this.handlePossibleCenter(a,u,c);if(h!==null)return h}a[0]=a[2],a[1]=1,a[2]=0,l=1}else a[++l]++;else l===1&&l++,a[l]++;c++}if(this.foundPatternCross(a)){var h=this.handlePossibleCenter(a,u,i);if(h!==null)return h}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new A},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,i=0;i<3;i++)if(Math.abs(e-t[i])>=n)return!1;return!0},r.prototype.crossCheckVertical=function(t,e,n,i){var o=this.image,a=o.getHeight(),f=this.crossCheckStateCount;f[0]=0,f[1]=0,f[2]=0;for(var s=t;s>=0&&o.get(e,s)&&f[1]<=n;)f[1]++,s--;if(s<0||f[1]>n)return NaN;for(;s>=0&&!o.get(e,s)&&f[0]<=n;)f[0]++,s--;if(f[0]>n)return NaN;for(s=t+1;s<a&&o.get(e,s)&&f[1]<=n;)f[1]++,s++;if(s===a||f[1]>n)return NaN;for(;s<a&&!o.get(e,s)&&f[2]<=n;)f[2]++,s++;if(f[2]>n)return NaN;var u=f[0]+f[1]+f[2];return 5*Math.abs(u-i)>=2*i?NaN:this.foundPatternCross(f)?r.centerFromEnd(f,s):NaN},r.prototype.handlePossibleCenter=function(t,e,n){var i,o,a=t[0]+t[1]+t[2],f=r.centerFromEnd(t,n),s=this.crossCheckVertical(e,f,2*t[1],a);if(!isNaN(s)){var u=(t[0]+t[1]+t[2])/3;try{for(var c=m1(this.possibleCenters),l=c.next();!l.done;l=c.next()){var h=l.value;if(h.aboutEquals(u,s,f))return h.combineEstimate(s,f,u)}}catch(p){i={error:p}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}var d=new ii(f,s,u);this.possibleCenters.push(d),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(d)}return null},r})(),oi=y1;var w1=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),A1=(function(r){w1(t,r);function t(e,n,i,o){var a=r.call(this,e,n)||this;return a.estimatedModuleSize=i,a.count=o,o===void 0&&(a.count=1),a}return t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,n,i){if(Math.abs(n-this.getY())<=e&&Math.abs(i-this.getX())<=e){var o=Math.abs(e-this.estimatedModuleSize);return o<=1||o<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,i){var o=this.count+1,a=(this.count*this.getX()+n)/o,f=(this.count*this.getY()+e)/o,s=(this.count*this.estimatedModuleSize+i)/o;return new t(a,f,s,o)},t})(R),ai=A1;var E1=(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})(),fi=E1;var ze=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.")},_1=(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(k.TRY_HARDER)!==void 0,n=t!=null&&t.get(k.PURE_BARCODE)!==void 0,i=this.image,o=i.getHeight(),a=i.getWidth(),f=Math.floor(3*o/(4*r.MAX_MODULES));(f<r.MIN_SKIP||e)&&(f=r.MIN_SKIP);for(var s=!1,u=new Int32Array(5),c=f-1;c<o&&!s;c+=f){u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0;for(var l=0,h=0;h<a;h++)if(i.get(h,c))(l&1)===1&&l++,u[l]++;else if((l&1)===0)if(l===4)if(r.foundPatternCross(u)){var d=this.handlePossibleCenter(u,c,h,n);if(d===!0)if(f=2,this.hasSkipped===!0)s=this.haveMultiplyConfirmedCenters();else{var p=this.findRowSkip();p>u[2]&&(c+=p-u[2]-f,h=a-1)}else{u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,l=3;continue}l=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,l=3;else u[++l]++;else u[l]++;if(r.foundPatternCross(u)){var d=this.handlePossibleCenter(u,c,a,n);d===!0&&(f=u[0],this.hasSkipped&&(s=this.haveMultiplyConfirmedCenters()))}}var v=this.selectBestPatterns();return R.orderBestPatterns(v),new fi(v)},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 i=t[n];if(i===0)return!1;e+=i}if(e<7)return!1;var o=e/7,a=o/2;return Math.abs(o-t[0])<a&&Math.abs(o-t[1])<a&&Math.abs(3*o-t[2])<3*a&&Math.abs(o-t[3])<a&&Math.abs(o-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,i){for(var o=this.getCrossCheckStateCount(),a=0,f=this.image;t>=a&&e>=a&&f.get(e-a,t-a);)o[2]++,a++;if(t<a||e<a)return!1;for(;t>=a&&e>=a&&!f.get(e-a,t-a)&&o[1]<=n;)o[1]++,a++;if(t<a||e<a||o[1]>n)return!1;for(;t>=a&&e>=a&&f.get(e-a,t-a)&&o[0]<=n;)o[0]++,a++;if(o[0]>n)return!1;var s=f.getHeight(),u=f.getWidth();for(a=1;t+a<s&&e+a<u&&f.get(e+a,t+a);)o[2]++,a++;if(t+a>=s||e+a>=u)return!1;for(;t+a<s&&e+a<u&&!f.get(e+a,t+a)&&o[3]<n;)o[3]++,a++;if(t+a>=s||e+a>=u||o[3]>=n)return!1;for(;t+a<s&&e+a<u&&f.get(e+a,t+a)&&o[4]<n;)o[4]++,a++;if(o[4]>=n)return!1;var c=o[0]+o[1]+o[2]+o[3]+o[4];return Math.abs(c-i)<2*i&&r.foundPatternCross(o)},r.prototype.crossCheckVertical=function(t,e,n,i){for(var o=this.image,a=o.getHeight(),f=this.getCrossCheckStateCount(),s=t;s>=0&&o.get(e,s);)f[2]++,s--;if(s<0)return NaN;for(;s>=0&&!o.get(e,s)&&f[1]<=n;)f[1]++,s--;if(s<0||f[1]>n)return NaN;for(;s>=0&&o.get(e,s)&&f[0]<=n;)f[0]++,s--;if(f[0]>n)return NaN;for(s=t+1;s<a&&o.get(e,s);)f[2]++,s++;if(s===a)return NaN;for(;s<a&&!o.get(e,s)&&f[3]<n;)f[3]++,s++;if(s===a||f[3]>=n)return NaN;for(;s<a&&o.get(e,s)&&f[4]<n;)f[4]++,s++;if(f[4]>=n)return NaN;var u=f[0]+f[1]+f[2]+f[3]+f[4];return 5*Math.abs(u-i)>=2*i?NaN:r.foundPatternCross(f)?r.centerFromEnd(f,s):NaN},r.prototype.crossCheckHorizontal=function(t,e,n,i){for(var o=this.image,a=o.getWidth(),f=this.getCrossCheckStateCount(),s=t;s>=0&&o.get(s,e);)f[2]++,s--;if(s<0)return NaN;for(;s>=0&&!o.get(s,e)&&f[1]<=n;)f[1]++,s--;if(s<0||f[1]>n)return NaN;for(;s>=0&&o.get(s,e)&&f[0]<=n;)f[0]++,s--;if(f[0]>n)return NaN;for(s=t+1;s<a&&o.get(s,e);)f[2]++,s++;if(s===a)return NaN;for(;s<a&&!o.get(s,e)&&f[3]<n;)f[3]++,s++;if(s===a||f[3]>=n)return NaN;for(;s<a&&o.get(s,e)&&f[4]<n;)f[4]++,s++;if(f[4]>=n)return NaN;var u=f[0]+f[1]+f[2]+f[3]+f[4];return 5*Math.abs(u-i)>=i?NaN:r.foundPatternCross(f)?r.centerFromEnd(f,s):NaN},r.prototype.handlePossibleCenter=function(t,e,n,i){var o=t[0]+t[1]+t[2]+t[3]+t[4],a=r.centerFromEnd(t,n),f=this.crossCheckVertical(e,Math.floor(a),t[2],o);if(!isNaN(f)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(f),t[2],o),!isNaN(a)&&(!i||this.crossCheckDiagonal(Math.floor(f),Math.floor(a),t[2],o)))){for(var s=o/7,u=!1,c=this.possibleCenters,l=0,h=c.length;l<h;l++){var d=c[l];if(d.aboutEquals(s,f,a)){c[l]=d.combineEstimate(f,a,s),u=!0;break}}if(!u){var p=new ai(a,f,s);c.push(p),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(p)}return!0}return!1},r.prototype.findRowSkip=function(){var t,e,n=this.possibleCenters.length;if(n<=1)return 0;var i=null;try{for(var o=ze(this.possibleCenters),a=o.next();!a.done;a=o.next()){var f=a.value;if(f.getCount()>=r.CENTER_QUORUM)if(i==null)i=f;else return this.hasSkipped=!0,Math.floor((Math.abs(i.getX()-f.getX())-Math.abs(i.getY()-f.getY()))/2)}}catch(s){t={error:s}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return 0},r.prototype.haveMultiplyConfirmedCenters=function(){var t,e,n,i,o=0,a=0,f=this.possibleCenters.length;try{for(var s=ze(this.possibleCenters),u=s.next();!u.done;u=s.next()){var c=u.value;c.getCount()>=r.CENTER_QUORUM&&(o++,a+=c.getEstimatedModuleSize())}}catch(v){t={error:v}}finally{try{u&&!u.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}if(o<3)return!1;var l=a/f,h=0;try{for(var d=ze(this.possibleCenters),p=d.next();!p.done;p=d.next()){var c=p.value;h+=Math.abs(c.getEstimatedModuleSize()-l)}}catch(v){n={error:v}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}return h<=.05*a},r.prototype.selectBestPatterns=function(){var t,e,n,i,o=this.possibleCenters.length;if(o<3)throw new A;var a=this.possibleCenters,f;if(o>3){var s=0,u=0;try{for(var c=ze(this.possibleCenters),l=c.next();!l.done;l=c.next()){var h=l.value,d=h.getEstimatedModuleSize();s+=d,u+=d*d}}catch(I){t={error:I}}finally{try{l&&!l.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}f=s/o;var p=Math.sqrt(u/o-f*f);a.sort(function(I,T){var D=Math.abs(T.getEstimatedModuleSize()-f),b=Math.abs(I.getEstimatedModuleSize()-f);return D<b?-1:D>b?1:0});for(var v=Math.max(.2*f,p),g=0;g<a.length&&a.length>3;g++){var y=a[g];Math.abs(y.getEstimatedModuleSize()-f)>v&&(a.splice(g,1),g--)}}if(a.length>3){var s=0;try{for(var m=ze(a),w=m.next();!w.done;w=m.next()){var _=w.value;s+=_.getEstimatedModuleSize()}}catch(T){n={error:T}}finally{try{w&&!w.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}f=s/a.length,a.sort(function(T,D){if(D.getCount()===T.getCount()){var b=Math.abs(D.getEstimatedModuleSize()-f),L=Math.abs(T.getEstimatedModuleSize()-f);return b<L?1:b>L?-1:0}else return D.getCount()-T.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},r.CENTER_QUORUM=2,r.MIN_SKIP=3,r.MAX_MODULES=57,r})(),si=_1;var C1=(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(k.NEED_RESULT_POINT_CALLBACK);var e=new si(this.image,this.resultPointCallback),n=e.find(t);return this.processFinderPatternInfo(n)},r.prototype.processFinderPatternInfo=function(t){var e=t.getTopLeft(),n=t.getTopRight(),i=t.getBottomLeft(),o=this.calculateModuleSize(e,n,i);if(o<1)throw new A("No pattern found in proccess finder.");var a=r.computeDimension(e,n,i,o),f=Vt.getProvisionalVersionForDimension(a),s=f.getDimensionForVersion()-7,u=null;if(f.getAlignmentPatternCenters().length>0)for(var c=n.getX()-e.getX()+i.getX(),l=n.getY()-e.getY()+i.getY(),h=1-3/s,d=Math.floor(e.getX()+h*(c-e.getX())),p=Math.floor(e.getY()+h*(l-e.getY())),v=4;v<=16;v<<=1)try{u=this.findAlignmentInRegion(o,d,p,v);break}catch(w){if(!(w instanceof A))throw w}var g=r.createTransform(e,n,i,u,a),y=r.sampleGrid(this.image,g,a),m;return u===null?m=[i,e,n]:m=[i,e,n,u],new he(y,m)},r.createTransform=function(t,e,n,i,o){var a=o-3.5,f,s,u,c;return i!==null?(f=i.getX(),s=i.getY(),u=a-3,c=u):(f=e.getX()-t.getX()+n.getX(),s=e.getY()-t.getY()+n.getY(),u=a,c=a),Ve.quadrilateralToQuadrilateral(3.5,3.5,a,3.5,u,c,3.5,a,t.getX(),t.getY(),e.getX(),e.getY(),f,s,n.getX(),n.getY())},r.sampleGrid=function(t,e,n){var i=de.getInstance();return i.sampleGridWithTransform(t,n,n,e)},r.computeDimension=function(t,e,n,i){var o=G.round(R.distance(t,e)/i),a=G.round(R.distance(t,n)/i),f=Math.floor((o+a)/2)+7;switch(f&3){case 0:f++;break;case 2:f--;break;case 3:throw new A("Dimensions could be not found.")}return f},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())),i=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(n)?i/7:isNaN(i)?n/7:(n+i)/14},r.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,n,i){var o=this.sizeOfBlackWhiteBlackRun(t,e,n,i),a=1,f=t-(n-t);f<0?(a=t/(t-f),f=0):f>=this.image.getWidth()&&(a=(this.image.getWidth()-1-t)/(f-t),f=this.image.getWidth()-1);var s=Math.floor(e-(i-e)*a);return a=1,s<0?(a=e/(e-s),s=0):s>=this.image.getHeight()&&(a=(this.image.getHeight()-1-e)/(s-e),s=this.image.getHeight()-1),f=Math.floor(t+(f-t)*a),o+=this.sizeOfBlackWhiteBlackRun(t,e,f,s),o-1},r.prototype.sizeOfBlackWhiteBlackRun=function(t,e,n,i){var o=Math.abs(i-e)>Math.abs(n-t);if(o){var a=t;t=e,e=a,a=n,n=i,i=a}for(var f=Math.abs(n-t),s=Math.abs(i-e),u=-f/2,c=t<n?1:-1,l=e<i?1:-1,h=0,d=n+c,p=t,v=e;p!==d;p+=c){var g=o?v:p,y=o?p:v;if(h===1===this.image.get(g,y)){if(h===2)return G.distance(p,v,t,e);h++}if(u+=s,u>0){if(v===i)break;v+=l,u-=f}}return h===2?G.distance(n+c,i,t,e):NaN},r.prototype.findAlignmentInRegion=function(t,e,n,i){var o=Math.floor(i*t),a=Math.max(0,e-o),f=Math.min(this.image.getWidth()-1,e+o);if(f-a<t*3)throw new A("Alignment top exceeds estimated module size.");var s=Math.max(0,n-o),u=Math.min(this.image.getHeight()-1,n+o);if(u-s<t*3)throw new A("Alignment bottom exceeds estimated module size.");var c=new oi(this.image,a,s,f-a,u-s,t,this.resultPointCallback);return c.find()},r})(),ui=C1;var I1=(function(){function r(){this.decoder=new ni}return r.prototype.getDecoder=function(){return this.decoder},r.prototype.decode=function(t,e){var n,i;if(e!=null&&e.get(k.PURE_BARCODE)!==void 0){var o=r.extractPureBits(t.getBlackMatrix());n=this.decoder.decodeBitMatrix(o,e),i=r.NO_POINTS}else{var a=new ui(t.getBlackMatrix()).detect(e);n=this.decoder.decodeBitMatrix(a.getBits(),e),i=a.getPoints()}n.getOther()instanceof dr&&n.getOther().applyMirroredCorrection(i);var f=new Z(n.getText(),n.getRawBytes(),void 0,i,C.QR_CODE,void 0),s=n.getByteSegments();s!==null&&f.putMetadata(ft.BYTE_SEGMENTS,s);var u=n.getECLevel();return u!==null&&f.putMetadata(ft.ERROR_CORRECTION_LEVEL,u),n.hasStructuredAppend()&&(f.putMetadata(ft.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),f.putMetadata(ft.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),f},r.prototype.reset=function(){},r.extractPureBits=function(t){var e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e===null||n===null)throw new A;var i=this.moduleSize(e,t),o=e[1],a=n[1],f=e[0],s=n[0];if(f>=s||o>=a)throw new A;if(a-o!==s-f&&(s=f+(a-o),s>=t.getWidth()))throw new A;var u=Math.round((s-f+1)/i),c=Math.round((a-o+1)/i);if(u<=0||c<=0)throw new A;if(c!==u)throw new A;var l=Math.floor(i/2);o+=l,f+=l;var h=f+Math.floor((u-1)*i)-s;if(h>0){if(h>l)throw new A;f-=h}var d=o+Math.floor((c-1)*i)-a;if(d>0){if(d>l)throw new A;o-=d}for(var p=new at(u,c),v=0;v<c;v++)for(var g=o+Math.floor(v*i),y=0;y<u;y++)t.get(f+Math.floor(y*i),g)&&p.set(y,v);return p},r.moduleSize=function(t,e){for(var n=e.getHeight(),i=e.getWidth(),o=t[0],a=t[1],f=!0,s=0;o<i&&a<n;){if(f!==e.get(o,a)){if(++s===5)break;f=!f}o++,a++}if(o===i||a===n)throw new A;return(o-t[0])/7},r.NO_POINTS=new Array,r})(),ae=I1;var S1=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.")},O1=(function(){function r(){}return r.prototype.PDF417Common=function(){},r.getBitCountSum=function(t){return G.sum(t)},r.toIntArray=function(t){var e,n;if(t==null||!t.length)return r.EMPTY_INT_ARRAY;var i=new Int32Array(t.length),o=0;try{for(var a=S1(t),f=a.next();!f.done;f=a.next()){var s=f.value;i[o++]=s}}catch(u){e={error:u}}finally{try{f&&!f.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i},r.getCodeword=function(t){var e=Y.binarySearch(r.SYMBOL_TABLE,t&262143);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})(),W=O1;var T1=(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})(),ci=T1;var D1=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.")},R1=(function(){function r(){}return r.detectMultiple=function(t,e,n){var i=t.getBlackMatrix(),o=r.detect(n,i);return o.length||(i=i.clone(),i.rotate180(),o=r.detect(n,i)),new ci(i,o)},r.detect=function(t,e){for(var n,i,o=new Array,a=0,f=0,s=!1;a<e.getHeight();){var u=r.findVertices(e,a,f);if(u[0]==null&&u[3]==null){if(!s)break;s=!1,f=0;try{for(var c=(n=void 0,D1(o)),l=c.next();!l.done;l=c.next()){var h=l.value;h[1]!=null&&(a=Math.trunc(Math.max(a,h[1].getY()))),h[3]!=null&&(a=Math.max(a,Math.trunc(h[3].getY())))}}catch(d){n={error:d}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}a+=r.ROW_STEP;continue}if(s=!0,o.push(u),!t)break;u[2]!=null?(f=Math.trunc(u[2].getX()),a=Math.trunc(u[2].getY())):(f=Math.trunc(u[4].getX()),a=Math.trunc(u[4].getY()))}return o},r.findVertices=function(t,e,n){var i=t.getHeight(),o=t.getWidth(),a=new Array(8);return r.copyToResult(a,r.findRowsWithPattern(t,i,o,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,i,o,e,n,r.STOP_PATTERN),r.INDEXES_STOP_PATTERN),a},r.copyToResult=function(t,e,n){for(var i=0;i<n.length;i++)t[n[i]]=e[i]},r.findRowsWithPattern=function(t,e,n,i,o,a){for(var f=new Array(4),s=!1,u=new Int32Array(a.length);i<e;i+=r.ROW_STEP){var c=r.findGuardPattern(t,o,i,n,!1,a,u);if(c!=null){for(;i>0;){var l=r.findGuardPattern(t,o,--i,n,!1,a,u);if(l!=null)c=l;else{i++;break}}f[0]=new R(c[0],i),f[1]=new R(c[1],i),s=!0;break}}var h=i+1;if(s){for(var d=0,l=Int32Array.from([Math.trunc(f[0].getX()),Math.trunc(f[1].getX())]);h<e;h++){var c=r.findGuardPattern(t,l[0],h,n,!1,a,u);if(c!=null&&Math.abs(l[0]-c[0])<r.MAX_PATTERN_DRIFT&&Math.abs(l[1]-c[1])<r.MAX_PATTERN_DRIFT)l=c,d=0;else{if(d>r.SKIPPED_ROW_COUNT_MAX)break;d++}}h-=d+1,f[2]=new R(l[0],h),f[3]=new R(l[1],h)}return h-i<r.BARCODE_MIN_HEIGHT&&Y.fill(f,null),f},r.findGuardPattern=function(t,e,n,i,o,a,f){Y.fillWithin(f,0,f.length,0);for(var s=e,u=0;t.get(s,n)&&s>0&&u++<r.MAX_PIXEL_DRIFT;)s--;for(var c=s,l=0,h=a.length,d=o;c<i;c++){var p=t.get(c,n);if(p!==d)f[l]++;else{if(l===h-1){if(r.patternMatchVariance(f,a,r.MAX_INDIVIDUAL_VARIANCE)<r.MAX_AVG_VARIANCE)return new Int32Array([s,c]);s+=f[0]+f[1],V.arraycopy(f,2,f,0,l-1),f[l-1]=0,f[l]=0,l--}else l++;f[l]=1,d=!d}}return l===h-1&&r.patternMatchVariance(f,a,r.MAX_INDIVIDUAL_VARIANCE)<r.MAX_AVG_VARIANCE?new Int32Array([s,c-1]):null},r.patternMatchVariance=function(t,e,n){for(var i=t.length,o=0,a=0,f=0;f<i;f++)o+=t[f],a+=e[f];if(o<a)return 1/0;var s=o/a;n*=s;for(var u=0,c=0;c<i;c++){var l=t[c],h=e[c]*s,d=l>h?l-h:h-l;if(d>n)return 1/0;u+=d}return u/o},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})(),li=R1;var N1=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.")},b1=(function(){function r(t,e){if(e.length===0)throw new O;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var i=1;i<n&&e[i]===0;)i++;i===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-i),V.arraycopy(e,i,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 i=0;try{for(var o=N1(this.coefficients),a=o.next();!a.done;a=o.next()){var f=a.value;i=this.field.add(i,f)}}catch(l){e={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i}for(var s=this.coefficients[0],u=this.coefficients.length,c=1;c<u;c++)s=this.field.add(this.field.multiply(t,s),this.coefficients[c]);return s},r.prototype.add=function(t){if(!this.field.equals(t.field))throw new O("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 i=e;e=n,n=i}var o=new Int32Array(n.length),a=n.length-e.length;V.arraycopy(n,0,o,0,a);for(var f=a;f<n.length;f++)o[f]=this.field.add(e[f-a],n[f]);return new r(this.field,o)},r.prototype.subtract=function(t){if(!this.field.equals(t.field))throw new O("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 O("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,i=t.coefficients,o=i.length,a=new Int32Array(n+o-1),f=0;f<n;f++)for(var s=e[f],u=0;u<o;u++)a[f+u]=this.field.add(a[f+u],this.field.multiply(s,i[u]));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),i=0;i<e;i++)n[i]=this.field.multiply(this.coefficients[i],t);return new r(this.field,n)},r.prototype.multiplyByMonomial=function(t,e){if(t<0)throw new O;if(e===0)return new r(this.field,new Int32Array([0]));for(var n=this.coefficients.length,i=new Int32Array(n+t),o=0;o<n;o++)i[o]=this.field.multiply(this.coefficients[o],e);return new r(this.field,i)},r.prototype.toString=function(){for(var t=new P,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})(),Qt=b1;var P1=(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 O;return this.logTable[t]},r.prototype.inverse=function(t){if(t===0)throw new Ue;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})(),hi=P1;var M1=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),B1=(function(r){M1(t,r);function t(e,n){var i=r.call(this)||this;i.modulus=e,i.expTable=new Int32Array(e),i.logTable=new Int32Array(e);for(var o=1,a=0;a<e;a++)i.expTable[a]=o,o=o*n%e;for(var a=0;a<e-1;a++)i.logTable[i.expTable[a]]=a;return i.zero=new Qt(i,new Int32Array([0])),i.one=new Qt(i,new Int32Array([1])),i}return 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 O;if(n===0)return this.zero;var i=new Int32Array(e+1);return i[0]=n,new Qt(this,i)},t.PDF417_GF=new t(W.NUMBER_OF_CODEWORDS,3),t})(hi),di=B1;var F1=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.")},L1=(function(){function r(){this.field=di.PDF417_GF}return r.prototype.decode=function(t,e,n){for(var i,o,a=new Qt(this.field,t),f=new Int32Array(e),s=!1,u=e;u>0;u--){var c=a.evaluateAt(this.field.exp(u));f[e-u]=c,c!==0&&(s=!0)}if(!s)return 0;var l=this.field.getOne();if(n!=null)try{for(var h=F1(n),d=h.next();!d.done;d=h.next()){var p=d.value,v=this.field.exp(t.length-1-p),g=new Qt(this.field,new Int32Array([this.field.subtract(0,v),1]));l=l.multiply(g)}}catch(b){i={error:b}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}for(var y=new Qt(this.field,f),m=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),y,e),w=m[0],_=m[1],I=this.findErrorLocations(w),T=this.findErrorMagnitudes(_,w,I),u=0;u<I.length;u++){var D=t.length-1-this.field.log(I[u]);if(D<0)throw j.getChecksumInstance();t[D]=this.field.subtract(t[D],T[u])}return I.length},r.prototype.runEuclideanAlgorithm=function(t,e,n){if(t.getDegree()<e.getDegree()){var i=t;t=e,e=i}for(var o=t,a=e,f=this.field.getZero(),s=this.field.getOne();a.getDegree()>=Math.round(n/2);){var u=o,c=f;if(o=a,f=s,o.isZero())throw j.getChecksumInstance();a=u;for(var l=this.field.getZero(),h=o.getCoefficient(o.getDegree()),d=this.field.inverse(h);a.getDegree()>=o.getDegree()&&!a.isZero();){var p=a.getDegree()-o.getDegree(),v=this.field.multiply(a.getCoefficient(a.getDegree()),d);l=l.add(this.field.buildMonomial(p,v)),a=a.subtract(o.multiplyByMonomial(p,v))}s=l.multiply(f).subtract(c).negative()}var g=s.getCoefficient(0);if(g===0)throw j.getChecksumInstance();var y=this.field.inverse(g),m=s.multiply(y),w=a.multiply(y);return[m,w]},r.prototype.findErrorLocations=function(t){for(var e=t.getDegree(),n=new Int32Array(e),i=0,o=1;o<this.field.getSize()&&i<e;o++)t.evaluateAt(o)===0&&(n[i]=this.field.inverse(o),i++);if(i!==e)throw j.getChecksumInstance();return n},r.prototype.findErrorMagnitudes=function(t,e,n){for(var i=e.getDegree(),o=new Int32Array(i),a=1;a<=i;a++)o[i-a]=this.field.multiply(a,e.getCoefficient(a));for(var f=new Qt(this.field,o),s=n.length,u=new Int32Array(s),a=0;a<s;a++){var c=this.field.inverse(n[a]),l=this.field.subtract(0,t.evaluateAt(c)),h=this.field.inverse(f.evaluateAt(c));u[a]=this.field.multiply(l,h)}return u},r})(),$r=L1;var k1=(function(){function r(t,e,n,i,o){t instanceof r?this.constructor_2(t):this.constructor_1(t,e,n,i,o)}return r.prototype.constructor_1=function(t,e,n,i,o){var a=e==null||n==null,f=i==null||o==null;if(a&&f)throw new A;a?(e=new R(0,i.getY()),n=new R(0,o.getY())):f&&(i=new R(t.getWidth()-1,e.getY()),o=new R(t.getWidth()-1,n.getY())),this.image=t,this.topLeft=e,this.bottomLeft=n,this.topRight=i,this.bottomRight=o,this.minX=Math.trunc(Math.min(e.getX(),n.getX())),this.maxX=Math.trunc(Math.max(i.getX(),o.getX())),this.minY=Math.trunc(Math.min(e.getY(),i.getY())),this.maxY=Math.trunc(Math.max(n.getY(),o.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 i=this.topLeft,o=this.bottomLeft,a=this.topRight,f=this.bottomRight;if(t>0){var s=n?this.topLeft:this.topRight,u=Math.trunc(s.getY()-t);u<0&&(u=0);var c=new R(s.getX(),u);n?i=c:a=c}if(e>0){var l=n?this.bottomLeft:this.bottomRight,h=Math.trunc(l.getY()+e);h>=this.image.getHeight()&&(h=this.image.getHeight()-1);var d=new R(l.getX(),h);n?o=d:f=d}return new r(this.image,i,o,a,f)},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})(),Ze=k1;var U1=(function(){function r(t,e,n,i){this.columnCount=t,this.errorCorrectionLevel=i,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})(),pi=U1;var H1=(function(){function r(){this.buffer=""}return r.form=function(t,e){var n=-1;function i(a,f,s,u,c,l){if(a==="%%")return"%";if(e[++n]!==void 0){a=u?parseInt(u.substr(1)):void 0;var h=c?parseInt(c.substr(1)):void 0,d;switch(l){case"s":d=e[n];break;case"c":d=e[n][0];break;case"f":d=parseFloat(e[n]).toFixed(a);break;case"p":d=parseFloat(e[n]).toPrecision(a);break;case"e":d=parseFloat(e[n]).toExponential(a);break;case"x":d=parseInt(e[n]).toString(h||16);break;case"d":d=parseFloat(parseInt(e[n],h||10).toPrecision(a)).toFixed(0);break}d=typeof d=="object"?JSON.stringify(d):(+d).toString(h);for(var p=parseInt(s),v=s&&s[0]+""=="0"?"0":" ";d.length<p;)d=f!==void 0?d+v:v+d;return d}}var o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(o,i)},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})(),Oe=H1;var V1=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.")},G1=(function(){function r(t){this.boundingBox=new Ze(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 i=this.imageRowToCodewordIndex(t)-n;if(i>=0&&(e=this.codewords[i],e!=null)||(i=this.imageRowToCodewordIndex(t)+n,i<this.codewords.length&&(e=this.codewords[i],e!=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 Oe,i=0;try{for(var o=V1(this.codewords),a=o.next();!a.done;a=o.next()){var f=a.value;if(f==null){n.format("%3d: | %n",i++);continue}n.format("%3d: %3d|%3d%n",i++,f.getRowNumber(),f.getValue())}}catch(s){t={error:s}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n.toString()},r.MAX_NEARBY_DISTANCE=5,r})(),pr=G1;var W1=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.")},X1=function(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(f){a={error:f}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(a)throw a.error}}return o},z1=(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,i=new Array,o=function(l,h){var d={getKey:function(){return l},getValue:function(){return h}};d.getValue()>n?(n=d.getValue(),i=[],i.push(d.getKey())):d.getValue()===n&&i.push(d.getKey())};try{for(var a=W1(this.values.entries()),f=a.next();!f.done;f=a.next()){var s=X1(f.value,2),u=s[0],c=s[1];o(u,c)}}catch(l){t={error:l}}finally{try{f&&!f.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return W.toIntArray(i)},r.prototype.getConfidence=function(t){return this.values.get(t)},r})(),xe=z1;var Z1=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),tn=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.")},j1=(function(r){Z1(t,r);function t(e,n){var i=r.call(this,e)||this;return i._isLeft=n,i}return t.prototype.setRowNumbers=function(){var e,n;try{for(var i=tn(this.getCodewords()),o=i.next();!o.done;o=i.next()){var a=o.value;a?.setRowNumberAsRowIndicatorColumn()}}catch(f){e={error:f}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var n=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(n,e);for(var i=this.getBoundingBox(),o=this._isLeft?i.getTopLeft():i.getTopRight(),a=this._isLeft?i.getBottomLeft():i.getBottomRight(),f=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=this.imageRowToCodewordIndex(Math.trunc(a.getY())),u=-1,c=1,l=0,h=f;h<s;h++)if(n[h]!=null){var d=n[h],p=d.getRowNumber()-u;if(p===0)l++;else if(p===1)c=Math.max(c,l),l=1,u=d.getRowNumber();else if(p<0||d.getRowNumber()>=e.getRowCount()||p>h)n[h]=null;else{var v=void 0;c>2?v=(c-2)*p:v=p;for(var g=v>=h,y=1;y<=v&&!g;y++)g=n[h-y]!=null;g?n[h]=null:(u=d.getRowNumber(),l=1)}}},t.prototype.getRowHeights=function(){var e,n,i=this.getBarcodeMetadata();if(i==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(i);var o=new Int32Array(i.getRowCount());try{for(var a=tn(this.getCodewords()),f=a.next();!f.done;f=a.next()){var s=f.value;if(s!=null){var u=s.getRowNumber();if(u>=o.length)continue;o[u]++}}}catch(c){e={error:c}}finally{try{f&&!f.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return o},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var n=this.getBoundingBox(),i=this._isLeft?n.getTopLeft():n.getTopRight(),o=this._isLeft?n.getBottomLeft():n.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(i.getY())),f=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=this.getCodewords(),u=-1,c=1,l=0,h=a;h<f;h++)if(s[h]!=null){var d=s[h];d.setRowNumberAsRowIndicatorColumn();var p=d.getRowNumber()-u;p===0?l++:p===1?(c=Math.max(c,l),l=1,u=d.getRowNumber()):d.getRowNumber()>=e.getRowCount()?s[h]=null:(u=d.getRowNumber(),l=1)}},t.prototype.getBarcodeMetadata=function(){var e,n,i=this.getCodewords(),o=new xe,a=new xe,f=new xe,s=new xe;try{for(var u=tn(i),c=u.next();!c.done;c=u.next()){var l=c.value;if(l!=null){l.setRowNumberAsRowIndicatorColumn();var h=l.getValue()%30,d=l.getRowNumber();switch(this._isLeft||(d+=2),d%3){case 0:a.setValue(h*3+1);break;case 1:s.setValue(h/3),f.setValue(h%3);break;case 2:o.setValue(h+1);break}}}}catch(v){e={error:v}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}if(o.getValue().length===0||a.getValue().length===0||f.getValue().length===0||s.getValue().length===0||o.getValue()[0]<1||a.getValue()[0]+f.getValue()[0]<W.MIN_ROWS_IN_BARCODE||a.getValue()[0]+f.getValue()[0]>W.MAX_ROWS_IN_BARCODE)return null;var p=new pi(o.getValue()[0],a.getValue()[0],f.getValue()[0],s.getValue()[0]);return this.removeIncorrectCodewords(i,p),p},t.prototype.removeIncorrectCodewords=function(e,n){for(var i=0;i<e.length;i++){var o=e[i];if(e[i]!=null){var a=o.getValue()%30,f=o.getRowNumber();if(f>n.getRowCount()){e[i]=null;continue}switch(this._isLeft||(f+=2),f%3){case 0:a*3+1!==n.getRowCountUpperPart()&&(e[i]=null);break;case 1:(Math.trunc(a/3)!==n.getErrorCorrectionLevel()||a%3!==n.getRowCountLowerPart())&&(e[i]=null);break;case 2:a+1!==n.getColumnCount()&&(e[i]=null);break}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+`
7
+ `+r.prototype.toString.call(this)},t})(pr),en=j1;var Y1=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.")},K1=(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=W.MAX_CODEWORDS_IN_BARCODE,e;do e=t,t=this.adjustRowNumbersAndGetCount();while(t>0&&t<e);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(),i=0;i<n.length;i++)n[i]!=null&&(n[i].hasValidRowNumber()||this.adjustRowNumbers(e,i,n));return t},r.prototype.adjustRowNumbersByRow=function(){this.adjustRowNumbersFromBothRI();var t=this.adjustRowNumbersFromLRI();return t+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 i=1;i<=this.barcodeColumnCount;i++){var o=this.detectionResultColumns[i].getCodewords()[n];o!=null&&(o.setRowNumber(t[n].getRowNumber()),o.hasValidRowNumber()||(this.detectionResultColumns[i].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 i=e[n].getRowNumber(),o=0,a=this.barcodeColumnCount+1;a>0&&o<this.ADJUST_ROW_NUMBER_SKIP;a--){var f=this.detectionResultColumns[a].getCodewords()[n];f!=null&&(o=r.adjustRowNumberIfValid(i,o,f),f.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 i=e[n].getRowNumber(),o=0,a=1;a<this.barcodeColumnCount+1&&o<this.ADJUST_ROW_NUMBER_SKIP;a++){var f=this.detectionResultColumns[a].getCodewords()[n];f!=null&&(o=r.adjustRowNumberIfValid(i,o,f),f.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 i,o;if(this.detectionResultColumns[t-1]!=null){var a=n[e],f=this.detectionResultColumns[t-1].getCodewords(),s=f;this.detectionResultColumns[t+1]!=null&&(s=this.detectionResultColumns[t+1].getCodewords());var u=new Array(14);u[2]=f[e],u[3]=s[e],e>0&&(u[0]=n[e-1],u[4]=f[e-1],u[5]=s[e-1]),e>1&&(u[8]=n[e-2],u[10]=f[e-2],u[11]=s[e-2]),e<n.length-1&&(u[1]=n[e+1],u[6]=f[e+1],u[7]=s[e+1]),e<n.length-2&&(u[9]=n[e+2],u[12]=f[e+2],u[13]=s[e+2]);try{for(var c=Y1(u),l=c.next();!l.done;l=c.next()){var h=l.value;if(r.adjustRowNumber(a,h))return}}catch(d){i={error:d}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}}},r.adjustRowNumber=function(t,e){return e==null?!1:e.hasValidRowNumber()&&e.getBucket()===t.getBucket()?(t.setRowNumber(e.getRowNumber()),!0):!1},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 Oe,n=0;n<t.getCodewords().length;n++){e.format("CW %3d:",n);for(var i=0;i<this.barcodeColumnCount+2;i++){if(this.detectionResultColumns[i]==null){e.format(" | ");continue}var o=this.detectionResultColumns[i].getCodewords()[n];if(o==null){e.format(" | ");continue}e.format(" %3d|%3d",o.getRowNumber(),o.getValue())}e.format("%n")}return e.toString()},r})(),vi=K1;var Q1=(function(){function r(t,e,n,i){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(i)}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(Math.trunc(this.value/30)*3+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})(),xi=Q1;var q1=(function(){function r(){}return r.initialize=function(){for(var t=0;t<W.SYMBOL_TABLE.length;t++)for(var e=W.SYMBOL_TABLE[t],n=e&1,i=0;i<W.BARS_IN_MODULE;i++){for(var o=0;(e&1)===n;)o+=1,e>>=1;n=e&1,r.RATIOS_TABLE[t]||(r.RATIOS_TABLE[t]=new Array(W.BARS_IN_MODULE)),r.RATIOS_TABLE[t][W.BARS_IN_MODULE-i-1]=Math.fround(o/W.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=G.sum(t),n=new Int32Array(W.BARS_IN_MODULE),i=0,o=0,a=0;a<W.MODULES_IN_CODEWORD;a++){var f=e/(2*W.MODULES_IN_CODEWORD)+a*e/W.MODULES_IN_CODEWORD;o+t[i]<=f&&(o+=t[i],i++),n[i]++}return n},r.getDecodedCodewordValue=function(t){var e=r.getBitValue(t);return W.getCodeword(e)===-1?-1:e},r.getBitValue=function(t){for(var e=0,n=0;n<t.length;n++)for(var i=0;i<t[n];i++)e=e<<1|(n%2===0?1:0);return Math.trunc(e)},r.getClosestDecodedValue=function(t){var e=G.sum(t),n=new Array(W.BARS_IN_MODULE);if(e>1)for(var i=0;i<n.length;i++)n[i]=Math.fround(t[i]/e);var o=He.MAX_VALUE,a=-1;this.bSymbolTableReady||r.initialize();for(var f=0;f<r.RATIOS_TABLE.length;f++){for(var s=0,u=r.RATIOS_TABLE[f],c=0;c<W.BARS_IN_MODULE;c++){var l=Math.fround(u[c]-n[c]);if(s+=Math.fround(l*l),s>=o)break}s<o&&(o=s,a=W.SYMBOL_TABLE[f])}return a},r.bSymbolTableReady=!1,r.RATIOS_TABLE=new Array(W.SYMBOL_TABLE.length).map(function(t){return t=new Array(W.BARS_IN_MODULE)}),r})(),gi=q1;var J1=(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})(),rn=J1;var $1=(function(){function r(){}return r.parseLong=function(t,e){return e===void 0&&(e=void 0),parseInt(t,e)},r})(),nn=$1;var ts=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),es=(function(r){ts(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="NullPointerException",t})($),mi=es;var rs=(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 mi;if(e<0||e>t.length||n<0||e+n>t.length||e+n<0)throw new ye;if(n===0)return;for(var i=0;i<n;i++)this.write(t[e+i])},r.prototype.flush=function(){},r.prototype.close=function(){},r})(),yi=rs;var ns=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),is=(function(r){ns(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t})($),wi=is;var os=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),as=(function(r){os(t,r);function t(e){e===void 0&&(e=32);var n=r.call(this)||this;if(n.count=0,e<0)throw new O("Negative initial size: "+e);return n.buf=new Uint8Array(e),n}return t.prototype.ensureCapacity=function(e){e-this.buf.length>0&&this.grow(e)},t.prototype.grow=function(e){var n=this.buf.length,i=n<<1;if(i-e<0&&(i=e),i<0){if(e<0)throw new wi;i=M.MAX_VALUE}this.buf=Y.copyOfUint8Array(this.buf,i)},t.prototype.write=function(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1},t.prototype.writeBytesOffset=function(e,n,i){if(n<0||n>e.length||i<0||n+i-e.length>0)throw new ye;this.ensureCapacity(this.count+i),V.arraycopy(e,n,this.buf,this.count,i),this.count+=i},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return Y.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),Ai=as;var rt;(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"})(rt||(rt={}));function Ei(){if(typeof window<"u")return window.BigInt||null;if(typeof global<"u")return global.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}var vr;function fe(r){if(typeof vr>"u"&&(vr=Ei()),vr===null)throw new Error("BigInt is not supported!");return vr(r)}function fs(){var r=[];r[0]=fe(1);var t=fe(900);r[1]=t;for(var e=2;e<16;e++)r[e]=r[e-1]*t;return r}var ss=(function(){function r(){}return r.decode=function(t,e){var n=new P(""),i=ot.ISO8859_1;n.enableDecoding(i);for(var o=1,a=t[o++],f=new rn;o<t[0];){switch(a){case r.TEXT_COMPACTION_MODE_LATCH:o=r.textCompaction(t,o,n);break;case r.BYTE_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:o=r.byteCompaction(a,t,i,o,n);break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(t[o++]);break;case r.NUMERIC_COMPACTION_MODE_LATCH:o=r.numericCompaction(t,o,n);break;case r.ECI_CHARSET:var s=ot.getCharacterSetECIByValue(t[o++]);break;case r.ECI_GENERAL_PURPOSE:o+=2;break;case r.ECI_USER_DEFINED:o++;break;case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:o=r.decodeMacroBlock(t,o,f);break;case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:throw new S;default:o--,o=r.textCompaction(t,o,n);break}if(o<t.length)a=t[o++];else throw S.getFormatInstance()}if(n.length()===0)throw S.getFormatInstance();var u=new Zt(null,n.toString(),null,e);return u.setOther(f),u},r.decodeMacroBlock=function(t,e,n){if(e+r.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw S.getFormatInstance();for(var i=new Int32Array(r.NUMBER_OF_SEQUENCE_CODEWORDS),o=0;o<r.NUMBER_OF_SEQUENCE_CODEWORDS;o++,e++)i[o]=t[e];n.setSegmentIndex(M.parseInt(r.decodeBase900toBase10(i,r.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new P;e=r.textCompaction(t,e,a),n.setFileId(a.toString());var f=-1;for(t[e]===r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(f=e+1);e<t[0];)switch(t[e]){case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(e++,t[e]){case r.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var s=new P;e=r.textCompaction(t,e+1,s),n.setFileName(s.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var u=new P;e=r.textCompaction(t,e+1,u),n.setSender(u.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var c=new P;e=r.textCompaction(t,e+1,c),n.setAddressee(c.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var l=new P;e=r.numericCompaction(t,e+1,l),n.setSegmentCount(M.parseInt(l.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var h=new P;e=r.numericCompaction(t,e+1,h),n.setTimestamp(nn.parseLong(h.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var d=new P;e=r.numericCompaction(t,e+1,d),n.setChecksum(M.parseInt(d.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var p=new P;e=r.numericCompaction(t,e+1,p),n.setFileSize(nn.parseLong(p.toString()));break;default:throw S.getFormatInstance()}break;case r.MACRO_PDF417_TERMINATOR:e++,n.setLastSegment(!0);break;default:throw S.getFormatInstance()}if(f!==-1){var v=e-f;n.isLastSegment()&&v--,n.setOptionalData(Y.copyOfRange(t,f,f+v))}return e},r.textCompaction=function(t,e,n){for(var i=new Int32Array((t[0]-e)*2),o=new Int32Array((t[0]-e)*2),a=0,f=!1;e<t[0]&&!f;){var s=t[e++];if(s<r.TEXT_COMPACTION_MODE_LATCH)i[a]=s/30,i[a+1]=s%30,a+=2;else switch(s){case r.TEXT_COMPACTION_MODE_LATCH:i[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--,f=!0;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i[a]=r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,s=t[e++],o[a]=s,a++;break}}return r.decodeTextCompaction(i,o,a,n),e},r.decodeTextCompaction=function(t,e,n,i){for(var o=rt.ALPHA,a=rt.ALPHA,f=0;f<n;){var s=t[f],u="";switch(o){case rt.ALPHA:if(s<26)u=String.fromCharCode(65+s);else switch(s){case 26:u=" ";break;case r.LL:o=rt.LOWER;break;case r.ML:o=rt.MIXED;break;case r.PS:a=o,o=rt.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(e[f]);break;case r.TEXT_COMPACTION_MODE_LATCH:o=rt.ALPHA;break}break;case rt.LOWER:if(s<26)u=String.fromCharCode(97+s);else switch(s){case 26:u=" ";break;case r.AS:a=o,o=rt.ALPHA_SHIFT;break;case r.ML:o=rt.MIXED;break;case r.PS:a=o,o=rt.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(e[f]);break;case r.TEXT_COMPACTION_MODE_LATCH:o=rt.ALPHA;break}break;case rt.MIXED:if(s<r.PL)u=r.MIXED_CHARS[s];else switch(s){case r.PL:o=rt.PUNCT;break;case 26:u=" ";break;case r.LL:o=rt.LOWER;break;case r.AL:o=rt.ALPHA;break;case r.PS:a=o,o=rt.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(e[f]);break;case r.TEXT_COMPACTION_MODE_LATCH:o=rt.ALPHA;break}break;case rt.PUNCT:if(s<r.PAL)u=r.PUNCT_CHARS[s];else switch(s){case r.PAL:o=rt.ALPHA;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(e[f]);break;case r.TEXT_COMPACTION_MODE_LATCH:o=rt.ALPHA;break}break;case rt.ALPHA_SHIFT:if(o=a,s<26)u=String.fromCharCode(65+s);else switch(s){case 26:u=" ";break;case r.TEXT_COMPACTION_MODE_LATCH:o=rt.ALPHA;break}break;case rt.PUNCT_SHIFT:if(o=a,s<r.PAL)u=r.PUNCT_CHARS[s];else switch(s){case r.PAL:o=rt.ALPHA;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(e[f]);break;case r.TEXT_COMPACTION_MODE_LATCH:o=rt.ALPHA;break}break}u!==""&&i.append(u),f++}},r.byteCompaction=function(t,e,n,i,o){var a=new Ai,f=0,s=0,u=!1;switch(t){case r.BYTE_COMPACTION_MODE_LATCH:for(var c=new Int32Array(6),l=e[i++];i<e[0]&&!u;)switch(c[f++]=l,s=900*s+l,l=e[i++],l){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:i--,u=!0;break;default:if(f%5===0&&f>0){for(var h=0;h<6;++h)a.write(Number(fe(s)>>fe(8*(5-h))));s=0,f=0}break}i===e[0]&&l<r.TEXT_COMPACTION_MODE_LATCH&&(c[f++]=l);for(var d=0;d<f;d++)a.write(c[d]);break;case r.BYTE_COMPACTION_MODE_LATCH_6:for(;i<e[0]&&!u;){var p=e[i++];if(p<r.TEXT_COMPACTION_MODE_LATCH)f++,s=900*s+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:i--,u=!0;break}if(f%5===0&&f>0){for(var h=0;h<6;++h)a.write(Number(fe(s)>>fe(8*(5-h))));s=0,f=0}}break}return o.append(yt.decode(a.toByteArray(),n)),i},r.numericCompaction=function(t,e,n){for(var i=0,o=!1,a=new Int32Array(r.MAX_NUMERIC_CODEWORDS);e<t[0]&&!o;){var f=t[e++];if(e===t[0]&&(o=!0),f<r.TEXT_COMPACTION_MODE_LATCH)a[i]=f,i++;else switch(f){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--,o=!0;break}(i%r.MAX_NUMERIC_CODEWORDS===0||f===r.NUMERIC_COMPACTION_MODE_LATCH||o)&&i>0&&(n.append(r.decodeBase900toBase10(a,i)),i=0)}return e},r.decodeBase900toBase10=function(t,e){for(var n=fe(0),i=0;i<e;i++)n+=r.EXP900[e-i-1]*fe(t[i]);var o=n.toString();if(o.charAt(0)!=="1")throw new S;return o.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 ,:
8
+ -.$/"|*()?{}'`,r.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",r.EXP900=Ei()?fs():[],r.NUMBER_OF_SEQUENCE_CODEWORDS=2,r})(),on=ss;var 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.")},us=(function(){function r(){}return r.decode=function(t,e,n,i,o,a,f){for(var s=new Ze(t,e,n,i,o),u=null,c=null,l,h=!0;;h=!1){if(e!=null&&(u=r.getRowIndicatorColumn(t,s,e,!0,a,f)),i!=null&&(c=r.getRowIndicatorColumn(t,s,i,!1,a,f)),l=r.merge(u,c),l==null)throw A.getNotFoundInstance();var d=l.getBoundingBox();if(h&&d!=null&&(d.getMinY()<s.getMinY()||d.getMaxY()>s.getMaxY()))s=d;else break}l.setBoundingBox(s);var p=l.getBarcodeColumnCount()+1;l.setDetectionResultColumn(0,u),l.setDetectionResultColumn(p,c);for(var v=u!=null,g=1;g<=p;g++){var y=v?g:p-g;if(l.getDetectionResultColumn(y)===void 0){var m=void 0;y===0||y===p?m=new en(s,y===0):m=new pr(s),l.setDetectionResultColumn(y,m);for(var w=-1,_=w,I=s.getMinY();I<=s.getMaxY();I++){if(w=r.getStartColumn(l,y,I,v),w<0||w>s.getMaxX()){if(_===-1)continue;w=_}var T=r.detectCodeword(t,s.getMinX(),s.getMaxX(),v,w,I,a,f);T!=null&&(m.setCodeword(I,T),_=w,a=Math.min(a,T.getWidth()),f=Math.max(f,T.getWidth()))}}}return r.createDecoderResult(l)},r.merge=function(t,e){if(t==null&&e==null)return null;var n=r.getBarcodeMetadata(t,e);if(n==null)return null;var i=Ze.merge(r.adjustBoundingBox(t),r.adjustBoundingBox(e));return new vi(n,i)},r.adjustBoundingBox=function(t){var e,n;if(t==null)return null;var i=t.getRowHeights();if(i==null)return null;var o=r.getMax(i),a=0;try{for(var f=je(i),s=f.next();!s.done;s=f.next()){var u=s.value;if(a+=o-u,u>0)break}}catch(d){e={error:d}}finally{try{s&&!s.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}for(var c=t.getCodewords(),l=0;a>0&&c[l]==null;l++)a--;for(var h=0,l=i.length-1;l>=0&&(h+=o-i[l],!(i[l]>0));l--);for(var l=c.length-1;h>0&&c[l]==null;l--)h--;return t.getBoundingBox().addMissingRows(a,h,t.isLeft())},r.getMax=function(t){var e,n,i=-1;try{for(var o=je(t),a=o.next();!a.done;a=o.next()){var f=a.value;i=Math.max(i,f)}}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i},r.getBarcodeMetadata=function(t,e){var n;if(t==null||(n=t.getBarcodeMetadata())==null)return e==null?null:e.getBarcodeMetadata();var i;return e==null||(i=e.getBarcodeMetadata())==null?n:n.getColumnCount()!==i.getColumnCount()&&n.getErrorCorrectionLevel()!==i.getErrorCorrectionLevel()&&n.getRowCount()!==i.getRowCount()?null:n},r.getRowIndicatorColumn=function(t,e,n,i,o,a){for(var f=new en(e,i),s=0;s<2;s++)for(var u=s===0?1:-1,c=Math.trunc(Math.trunc(n.getX())),l=Math.trunc(Math.trunc(n.getY()));l<=e.getMaxY()&&l>=e.getMinY();l+=u){var h=r.detectCodeword(t,0,t.getWidth(),i,c,l,o,a);h!=null&&(f.setCodeword(l,h),i?c=h.getStartX():c=h.getEndX())}return f},r.adjustCodewordCount=function(t,e){var n=e[0][1],i=n.getValue(),o=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-r.getNumberOfECCodeWords(t.getBarcodeECLevel());if(i.length===0){if(o<1||o>W.MAX_CODEWORDS_IN_BARCODE)throw A.getNotFoundInstance();n.setValue(o)}else i[0]!==o&&n.setValue(o)},r.createDecoderResult=function(t){var e=r.createBarcodeMatrix(t);r.adjustCodewordCount(t,e);for(var n=new Array,i=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),o=[],a=new Array,f=0;f<t.getBarcodeRowCount();f++)for(var s=0;s<t.getBarcodeColumnCount();s++){var u=e[f][s+1].getValue(),c=f*t.getBarcodeColumnCount()+s;u.length===0?n.push(c):u.length===1?i[c]=u[0]:(a.push(c),o.push(u))}for(var l=new Array(o.length),h=0;h<l.length;h++)l[h]=o[h];return r.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),i,W.toIntArray(n),W.toIntArray(a),l)},r.createDecoderResultFromAmbiguousValues=function(t,e,n,i,o){for(var a=new Int32Array(i.length),f=100;f-- >0;){for(var s=0;s<a.length;s++)e[i[s]]=o[s][a[s]];try{return r.decodeCodewords(e,t,n)}catch(c){var u=c instanceof j;if(!u)throw c}if(a.length===0)throw j.getChecksumInstance();for(var s=0;s<a.length;s++)if(a[s]<o[s].length-1){a[s]++;break}else if(a[s]=0,s===a.length-1)throw j.getChecksumInstance()}throw j.getChecksumInstance()},r.createBarcodeMatrix=function(t){for(var e,n,i,o,a=Array.from({length:t.getBarcodeRowCount()},function(){return new Array(t.getBarcodeColumnCount()+2)}),f=0;f<a.length;f++)for(var s=0;s<a[f].length;s++)a[f][s]=new xe;var u=0;try{for(var c=je(t.getDetectionResultColumns()),l=c.next();!l.done;l=c.next()){var h=l.value;if(h!=null)try{for(var d=(i=void 0,je(h.getCodewords())),p=d.next();!p.done;p=d.next()){var v=p.value;if(v!=null){var g=v.getRowNumber();if(g>=0){if(g>=a.length)continue;a[g][u].setValue(v.getValue())}}}}catch(y){i={error:y}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}u++}}catch(y){e={error:y}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}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,i){var o,a,f=i?1:-1,s=null;if(r.isValidBarcodeColumn(t,e-f)&&(s=t.getDetectionResultColumn(e-f).getCodeword(n)),s!=null)return i?s.getEndX():s.getStartX();if(s=t.getDetectionResultColumn(e).getCodewordNearby(n),s!=null)return i?s.getStartX():s.getEndX();if(r.isValidBarcodeColumn(t,e-f)&&(s=t.getDetectionResultColumn(e-f).getCodewordNearby(n)),s!=null)return i?s.getEndX():s.getStartX();for(var u=0;r.isValidBarcodeColumn(t,e-f);){e-=f;try{for(var c=(o=void 0,je(t.getDetectionResultColumn(e).getCodewords())),l=c.next();!l.done;l=c.next()){var h=l.value;if(h!=null)return(i?h.getEndX():h.getStartX())+f*u*(h.getEndX()-h.getStartX())}}catch(d){o={error:d}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}u++}return i?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},r.detectCodeword=function(t,e,n,i,o,a,f,s){o=r.adjustCodewordStartColumn(t,e,n,i,o,a);var u=r.getModuleBitCount(t,e,n,i,o,a);if(u==null)return null;var c,l=G.sum(u);if(i)c=o+l;else{for(var h=0;h<u.length/2;h++){var d=u[h];u[h]=u[u.length-1-h],u[u.length-1-h]=d}c=o,o=c-l}if(!r.checkCodewordSkew(l,f,s))return null;var p=gi.getDecodedValue(u),v=W.getCodeword(p);return v===-1?null:new xi(o,c,r.getCodewordBucketNumber(p),v)},r.getModuleBitCount=function(t,e,n,i,o,a){for(var f=o,s=new Int32Array(8),u=0,c=i?1:-1,l=i;(i?f<n:f>=e)&&u<s.length;)t.get(f,a)===l?(s[u]++,f+=c):(u++,l=!l);return u===s.length||f===(i?n:e)&&u===s.length-1?s:null},r.getNumberOfECCodeWords=function(t){return 2<<t},r.adjustCodewordStartColumn=function(t,e,n,i,o,a){for(var f=o,s=i?-1:1,u=0;u<2;u++){for(;(i?f>=e:f<n)&&i===t.get(f,a);){if(Math.abs(o-f)>r.CODEWORD_SKEW_SIZE)return o;f+=s}s=-s,i=!i}return f},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 S.getFormatInstance();var i=1<<e+1,o=r.correctErrors(t,n,i);r.verifyCodewordCount(t,i);var a=on.decode(t,""+e);return a.setErrorsCorrected(o),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 j.getChecksumInstance();return r.errorCorrection.decode(t,n,e)},r.verifyCodewordCount=function(t,e){if(t.length<4)throw S.getFormatInstance();var n=t[0];if(n>t.length)throw S.getFormatInstance();if(n===0)if(e<t.length)t[0]=t.length-e;else throw S.getFormatInstance()},r.getBitCountForCodeword=function(t){for(var e=new Int32Array(8),n=0,i=e.length-1;!((t&1)!==n&&(n=t&1,i--,i<0));)e[i]++,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 Oe,n=0;n<t.length;n++){e.format("Row %2d: ",n);for(var i=0;i<t[n].length;i++){var o=t[n][i];o.getValue().length===0?e.format(" ",null):e.format("%4d(%2d)",o.getValue()[0],o.getConfidence(o.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 $r,r})(),_i=us;var cs=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.")},ls=(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 A.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 S||n instanceof j?A.getNotFoundInstance():n}},r.decode=function(t,e,n){var i,o,a=new Array,f=li.detectMultiple(t,e,n);try{for(var s=cs(f.getPoints()),u=s.next();!u.done;u=s.next()){var c=u.value,l=_i.decode(f.getBits(),c[4],c[5],c[6],c[7],r.getMinCodewordWidth(c),r.getMaxCodewordWidth(c)),h=new Z(l.getText(),l.getRawBytes(),void 0,c,C.PDF_417);h.putMetadata(ft.ERROR_CORRECTION_LEVEL,l.getECLevel());var d=l.getOther();d!=null&&h.putMetadata(ft.PDF417_EXTRA_METADATA,d),a.push(h)}}catch(p){i={error:p}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.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?M.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])*W.MODULES_IN_CODEWORD/W.MODULES_IN_STOP_PATTERN),Math.max(r.getMaxWidth(t[1],t[5]),r.getMaxWidth(t[7],t[3])*W.MODULES_IN_CODEWORD/W.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])*W.MODULES_IN_CODEWORD/W.MODULES_IN_STOP_PATTERN),Math.min(r.getMinWidth(t[1],t[5]),r.getMinWidth(t[7],t[3])*W.MODULES_IN_CODEWORD/W.MODULES_IN_STOP_PATTERN)))},r.prototype.reset=function(){},r})(),se=ls;var hs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ds=(function(r){hs(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ReaderException",t})($),xr=ds;var 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.")},ps=(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(k.TRY_HARDER)!==void 0,n=t==null?null:t.get(k.POSSIBLE_FORMATS),i=new Array;if(n!=null){var o=n.some(function(a){return a===C.UPC_A||a===C.UPC_E||a===C.EAN_13||a===C.EAN_8||a===C.CODABAR||a===C.CODE_39||a===C.CODE_93||a===C.CODE_128||a===C.ITF||a===C.RSS_14||a===C.RSS_EXPANDED});o&&!e&&i.push(new Xt(t)),n.includes(C.QR_CODE)&&i.push(new ae),n.includes(C.DATA_MATRIX)&&i.push(new oe),n.includes(C.AZTEC)&&i.push(new te),n.includes(C.PDF_417)&&i.push(new se),o&&e&&i.push(new Xt(t))}i.length===0&&(e||i.push(new Xt(t)),i.push(new ae),i.push(new oe),i.push(new te),i.push(new se),e&&i.push(new Xt(t))),this.readers=i},r.prototype.reset=function(){var t,e;if(this.readers!==null)try{for(var n=Ci(this.readers),i=n.next();!i.done;i=n.next()){var o=i.value;o.reset()}}catch(a){t={error:a}}finally{try{i&&!i.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 xr("No readers where selected, nothing can be read.");try{for(var i=Ci(this.readers),o=i.next();!o.done;o=i.next()){var a=o.value;try{return a.decode(t,this.hints)}catch(f){if(f instanceof xr)continue}}}catch(f){e={error:f}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}throw new A("No MultiFormat Readers were able to detect the code.")},r})(),Ye=ps;var vs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),fy=(function(r){vs(t,r);function t(e,n){e===void 0&&(e=null),n===void 0&&(n=500);var i=this,o=new Ye;return o.setHints(e),i=r.call(this,o,n)||this,i}return t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t})(Mt);var xs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ly=(function(r){xs(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new se,e)||this}return t})(Mt);var gs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),vy=(function(r){gs(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new ae,e)||this}return t})(Mt);var an;(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"})(an||(an={}));var H=an;var ms=(function(){function r(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new Bt(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],i=this.field,o=e.length;o<=t;o++){var a=n.multiply(new Bt(i,Int32Array.from([1,i.exp(o-1+i.getGeneratorBase())])));e.push(a),n=a}return e[t]},r.prototype.encode=function(t,e){if(e===0)throw new O("No error correction bytes");var n=t.length-e;if(n<=0)throw new O("No data bytes provided");var i=this.buildGenerator(e),o=new Int32Array(n);V.arraycopy(t,0,o,0,n);var a=new Bt(this.field,o);a=a.multiplyByMonomial(e,1);for(var f=a.divide(i)[1],s=f.getCoefficients(),u=e-s.length,c=0;c<u;c++)t[n+c]=0;V.arraycopy(s,0,t,n+u,s.length)},r})(),Ke=ms;var ys=(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(),i=t.getWidth(),o=t.getHeight(),a=0;a<o-1;a++)for(var f=n[a],s=0;s<i-1;s++){var u=f[s];u===f[s+1]&&u===n[a+1][s]&&u===n[a+1][s+1]&&e++}return r.N2*e},r.applyMaskPenaltyRule3=function(t){for(var e=0,n=t.getArray(),i=t.getWidth(),o=t.getHeight(),a=0;a<o;a++)for(var f=0;f<i;f++){var s=n[a];f+6<i&&s[f]===1&&s[f+1]===0&&s[f+2]===1&&s[f+3]===1&&s[f+4]===1&&s[f+5]===0&&s[f+6]===1&&(r.isWhiteHorizontal(s,f-4,f)||r.isWhiteHorizontal(s,f+7,f+11))&&e++,a+6<o&&n[a][f]===1&&n[a+1][f]===0&&n[a+2][f]===1&&n[a+3][f]===1&&n[a+4][f]===1&&n[a+5][f]===0&&n[a+6][f]===1&&(r.isWhiteVertical(n,f,a-4,a)||r.isWhiteVertical(n,f,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 i=e;i<n;i++)if(t[i]===1)return!1;return!0},r.isWhiteVertical=function(t,e,n,i){n=Math.max(n,0),i=Math.min(i,t.length);for(var o=n;o<i;o++)if(t[o][e]===1)return!1;return!0},r.applyMaskPenaltyRule4=function(t){for(var e=0,n=t.getArray(),i=t.getWidth(),o=t.getHeight(),a=0;a<o;a++)for(var f=n[a],s=0;s<i;s++)f[s]===1&&e++;var u=t.getHeight()*t.getWidth(),c=Math.floor(Math.abs(e*2-u)*10/u);return c*r.N4},r.getDataMaskBit=function(t,e,n){var i,o;switch(t){case 0:i=n+e&1;break;case 1:i=n&1;break;case 2:i=e%3;break;case 3:i=(n+e)%3;break;case 4:i=Math.floor(n/2)+Math.floor(e/3)&1;break;case 5:o=n*e,i=(o&1)+o%3;break;case 6:o=n*e,i=(o&1)+o%3&1;break;case 7:o=n*e,i=o%3+(n+e&1)&1;break;default:throw new O("Invalid mask pattern: "+t)}return i===0},r.applyMaskPenaltyRule1Internal=function(t,e){for(var n=0,i=e?t.getHeight():t.getWidth(),o=e?t.getWidth():t.getHeight(),a=t.getArray(),f=0;f<i;f++){for(var s=0,u=-1,c=0;c<o;c++){var l=e?a[f][c]:a[c][f];l===u?s++:(s>=5&&(n+=r.N1+(s-5)),s=1,u=l)}s>=5&&(n+=r.N1+(s-5))}return n},r.N1=3,r.N2=3,r.N3=40,r.N4=10,r})(),ue=ys;var ws=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.")},As=(function(){function r(t,e){this.width=t,this.height=e;for(var n=new Array(e),i=0;i!==e;i++)n[i]=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 i=ws(this.bytes),o=i.next();!o.done;o=i.next()){var a=o.value;Y.fill(a,t)}}catch(f){e={error:f}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}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,i=this.height;n<i;++n)for(var o=this.bytes[n],a=e.bytes[n],f=0,s=this.width;f<s;++f)if(o[f]!==a[f])return!1;return!0},r.prototype.toString=function(){for(var t=new P,e=0,n=this.height;e<n;++e){for(var i=this.bytes[e],o=0,a=this.width;o<a;++o)switch(i[o]){case 0:t.append(" 0");break;case 1:t.append(" 1");break;default:t.append(" ");break}t.append(`
9
9
  `)}return t.toString()},r})(),Qe=As;var Es=(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 P;return t.append(`<<
10
10
  `),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append(`
11
11
  ecLevel: `),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append(`
@@ -15,7 +15,7 @@
15
15
  `),t.append(this.matrix.toString())):t.append(`
16
16
  matrix: null
17
17
  `),t.append(`>>
18
- `),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})(),Te=Es;var _s=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Cs=(function(r){_s(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="WriterException",t})($),nt=Cs;var Is=(function(){function r(){}return r.clearMatrix=function(t){t.clear(255)},r.buildMatrix=function(t,e,n,i,o){r.clearMatrix(o),r.embedBasicPatterns(n,o),r.embedTypeInfo(e,i,o),r.maybeEmbedVersionInfo(n,o),r.embedDataBits(t,i,o)},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 i=new it;r.makeTypeInfoBits(t,e,i);for(var o=0,a=i.getSize();o<a;++o){var f=i.get(i.getSize()-1-o),s=r.TYPE_INFO_COORDINATES[o],u=s[0],c=s[1];if(n.setBoolean(u,c,f),o<8){var h=n.getWidth()-o-1,l=8;n.setBoolean(h,l,f)}else{var h=8,l=n.getHeight()-7+(o-8);n.setBoolean(h,l,f)}}},r.maybeEmbedVersionInfo=function(t,e){if(!(t.getVersionNumber()<7)){var n=new it;r.makeVersionInfoBits(t,n);for(var i=17,o=0;o<6;++o)for(var a=0;a<3;++a){var f=n.get(i);i--,e.setBoolean(o,e.getHeight()-11+a,f),e.setBoolean(e.getHeight()-11+a,o,f)}}},r.embedDataBits=function(t,e,n){for(var i=0,o=-1,a=n.getWidth()-1,f=n.getHeight()-1;a>0;){for(a===6&&(a-=1);f>=0&&f<n.getHeight();){for(var s=0;s<2;++s){var u=a-s;if(r.isEmpty(n.get(u,f))){var c=void 0;i<t.getSize()?(c=t.get(i),++i):c=!1,e!==255&&ue.getDataMaskBit(e,u,f)&&(c=!c),n.setBoolean(u,f,c)}}f+=o}o=-o,f+=o,a-=2}if(i!==t.getSize())throw new nt("Not all bits consumed: "+i+"/"+t.getSize())},r.findMSBSet=function(t){return 32-M.numberOfLeadingZeros(t)},r.calculateBCHCode=function(t,e){if(e===0)throw new O("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(!Te.isValidMaskPattern(e))throw new nt("Invalid mask pattern");var i=t.getBits()<<3|e;n.appendBits(i,5);var o=r.calculateBCHCode(i,r.TYPE_INFO_POLY);n.appendBits(o,10);var a=new it;if(a.appendBits(r.TYPE_INFO_MASK_PATTERN,15),n.xor(a),n.getSize()!==15)throw new nt("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 nt("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 nt;t.setNumber(8,t.getHeight()-8,1)},r.embedHorizontalSeparationPattern=function(t,e,n){for(var i=0;i<8;++i){if(!r.isEmpty(n.get(t+i,e)))throw new nt;n.setNumber(t+i,e,0)}},r.embedVerticalSeparationPattern=function(t,e,n){for(var i=0;i<7;++i){if(!r.isEmpty(n.get(t,e+i)))throw new nt;n.setNumber(t,e+i,0)}},r.embedPositionAdjustmentPattern=function(t,e,n){for(var i=0;i<5;++i)for(var o=r.POSITION_ADJUSTMENT_PATTERN[i],a=0;a<5;++a)n.setNumber(t+a,e+i,o[a])},r.embedPositionDetectionPattern=function(t,e,n){for(var i=0;i<7;++i)for(var o=r.POSITION_DETECTION_PATTERN[i],a=0;a<7;++a)n.setNumber(t+a,e+i,o[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);var n=8;r.embedHorizontalSeparationPattern(0,n-1,t),r.embedHorizontalSeparationPattern(t.getWidth()-n,n-1,t),r.embedHorizontalSeparationPattern(0,t.getWidth()-n,t);var i=7;r.embedVerticalSeparationPattern(i,0,t),r.embedVerticalSeparationPattern(t.getHeight()-i-1,0,t),r.embedVerticalSeparationPattern(i,t.getHeight()-i,t)},r.maybeEmbedPositionAdjustmentPatterns=function(t,e){if(!(t.getVersionNumber()<2))for(var n=t.getVersionNumber()-1,i=r.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n],o=0,a=i.length;o!==a;o++){var f=i[o];if(f>=0)for(var s=0;s!==a;s++){var u=i[s];u>=0&&r.isEmpty(e.get(u,f))&&r.embedPositionAdjustmentPattern(u-2,f-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})(),gr=Is;var Ss=(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})(),Ii=Ss;var Si=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.")},Os=(function(){function r(){}return r.calculateMaskPenalty=function(t){return ue.applyMaskPenaltyRule1(t)+ue.applyMaskPenaltyRule2(t)+ue.applyMaskPenaltyRule3(t)+ue.applyMaskPenaltyRule4(t)},r.encode=function(t,e,n){n===void 0&&(n=null);var i=r.DEFAULT_BYTE_MODE_ENCODING,o=n!==null&&n.get(H.CHARACTER_SET)!==void 0;o&&(i=n.get(H.CHARACTER_SET).toString());var a=this.chooseMode(t,i),f=new it;if(a===et.BYTE&&(o||r.DEFAULT_BYTE_MODE_ENCODING!==i)){var s=ot.getCharacterSetECIByName(i);s!==void 0&&this.appendECI(s,f)}this.appendModeInfo(a,f);var u=new it;this.appendBytes(t,a,u,i);var c;if(n!==null&&n.get(H.QR_VERSION)!==void 0){var h=Number.parseInt(n.get(H.QR_VERSION).toString(),10);c=Vt.getVersionForNumber(h);var l=this.calculateBitsNeeded(a,f,u,c);if(!this.willFit(l,c,e))throw new nt("Data too big for requested version")}else c=this.recommendVersion(e,a,f,u);var d=new it;d.appendBitArray(f);var p=a===et.BYTE?u.getSizeInBytes():t.length;this.appendLengthInfo(p,c,a,d),d.appendBitArray(u);var v=c.getECBlocksForLevel(e),g=c.getTotalCodewords()-v.getTotalECCodewords();this.terminateBits(g,d);var y=this.interleaveWithECBytes(d,c.getTotalCodewords(),g,v.getNumBlocks()),m=new Te;m.setECLevel(e),m.setMode(a),m.setVersion(c);var w=c.getDimensionForVersion(),_=new Qe(w,w),I=this.chooseMaskPattern(y,e,c,_);return m.setMaskPattern(I),gr.buildMatrix(y,e,c,I,_),m.setMatrix(_),m},r.recommendVersion=function(t,e,n,i){var o=this.calculateBitsNeeded(e,n,i,Vt.getVersionForNumber(1)),a=this.chooseVersion(o,t),f=this.calculateBitsNeeded(e,n,i,a);return this.chooseVersion(f,t)},r.calculateBitsNeeded=function(t,e,n,i){return e.getSize()+t.getCharacterCountBits(i)+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),ot.SJIS.getName()===e&&this.isOnlyDoubleByteKanji(t))return et.KANJI;for(var n=!1,i=!1,o=0,a=t.length;o<a;++o){var f=t.charAt(o);if(r.isDigit(f))n=!0;else if(this.getAlphanumericCode(f.charCodeAt(0))!==-1)i=!0;else return et.BYTE}return i?et.ALPHANUMERIC:n?et.NUMERIC:et.BYTE},r.isOnlyDoubleByteKanji=function(t){var e;try{e=yt.encode(t,ot.SJIS)}catch{return!1}var n=e.length;if(n%2!==0)return!1;for(var i=0;i<n;i+=2){var o=e[i]&255;if((o<129||o>159)&&(o<224||o>235))return!1}return!0},r.chooseMaskPattern=function(t,e,n,i){for(var o=Number.MAX_SAFE_INTEGER,a=-1,f=0;f<Te.NUM_MASK_PATTERNS;f++){gr.buildMatrix(t,e,n,f,i);var s=this.calculateMaskPenalty(i);s<o&&(o=s,a=f)}return a},r.chooseVersion=function(t,e){for(var n=1;n<=40;n++){var i=Vt.getVersionForNumber(n);if(r.willFit(t,i,e))return i}throw new nt("Data too big")},r.willFit=function(t,e,n){var i=e.getTotalCodewords(),o=e.getECBlocksForLevel(n),a=o.getTotalECCodewords(),f=i-a,s=(t+7)/8;return f>=s},r.terminateBits=function(t,e){var n=t*8;if(e.getSize()>n)throw new nt("data bits cannot fit in the QR Code"+e.getSize()+" > "+n);for(var i=0;i<4&&e.getSize()<n;++i)e.appendBit(!1);var o=e.getSize()&7;if(o>0)for(var i=o;i<8;i++)e.appendBit(!1);for(var a=t-e.getSizeInBytes(),i=0;i<a;++i)e.appendBits((i&1)===0?236:17,8);if(e.getSize()!==n)throw new nt("Bits size does not equal capacity")},r.getNumDataBytesAndNumECBytesForBlockID=function(t,e,n,i,o,a){if(i>=n)throw new nt("Block ID too large");var f=t%n,s=n-f,u=Math.floor(t/n),c=u+1,h=Math.floor(e/n),l=h+1,d=u-h,p=c-l;if(d!==p)throw new nt("EC bytes mismatch");if(n!==s+f)throw new nt("RS blocks mismatch");if(t!==(h+d)*s+(l+p)*f)throw new nt("Total bytes mismatch");i<s?(o[0]=h,a[0]=d):(o[0]=l,a[0]=p)},r.interleaveWithECBytes=function(t,e,n,i){var o,a,f,s;if(t.getSizeInBytes()!==n)throw new nt("Number of bits and data bytes does not match");for(var u=0,c=0,h=0,l=new Array,d=0;d<i;++d){var p=new Int32Array(1),v=new Int32Array(1);r.getNumDataBytesAndNumECBytesForBlockID(e,n,i,d,p,v);var g=p[0],y=new Uint8Array(g);t.toBytes(8*u,y,0,g);var m=r.generateECBytes(y,v[0]);l.push(new Ii(y,m)),c=Math.max(c,g),h=Math.max(h,m.length),u+=p[0]}if(n!==u)throw new nt("Data bytes does not match offset");for(var w=new it,d=0;d<c;++d)try{for(var _=(o=void 0,Si(l)),I=_.next();!I.done;I=_.next()){var T=I.value,y=T.getDataBytes();d<y.length&&w.appendBits(y[d],8)}}catch(B){o={error:B}}finally{try{I&&!I.done&&(a=_.return)&&a.call(_)}finally{if(o)throw o.error}}for(var d=0;d<h;++d)try{for(var D=(f=void 0,Si(l)),b=D.next();!b.done;b=D.next()){var T=b.value,m=T.getErrorCorrectionBytes();d<m.length&&w.appendBits(m[d],8)}}catch(B){f={error:B}}finally{try{b&&!b.done&&(s=D.return)&&s.call(D)}finally{if(f)throw f.error}}if(e!==w.getSizeInBytes())throw new nt("Interleaving error: "+e+" and "+w.getSizeInBytes()+" differ.");return w},r.generateECBytes=function(t,e){for(var n=t.length,i=new Int32Array(n+e),o=0;o<n;o++)i[o]=t[o]&255;new Ke(dt.QR_CODE_FIELD_256).encode(i,e);for(var a=new Uint8Array(e),o=0;o<e;o++)a[o]=i[n+o];return a},r.appendModeInfo=function(t,e){e.appendBits(t.getBits(),4)},r.appendLengthInfo=function(t,e,n,i){var o=n.getCharacterCountBits(e);if(t>=1<<o)throw new nt(t+" is bigger than "+((1<<o)-1));i.appendBits(t,o)},r.appendBytes=function(t,e,n,i){switch(e){case et.NUMERIC:r.appendNumericBytes(t,n);break;case et.ALPHANUMERIC:r.appendAlphanumericBytes(t,n);break;case et.BYTE:r.append8BitBytes(t,n,i);break;case et.KANJI:r.appendKanjiBytes(t,n);break;default:throw new nt("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,i=0;i<n;){var o=r.getDigit(t.charAt(i));if(i+2<n){var a=r.getDigit(t.charAt(i+1)),f=r.getDigit(t.charAt(i+2));e.appendBits(o*100+a*10+f,10),i+=3}else if(i+1<n){var a=r.getDigit(t.charAt(i+1));e.appendBits(o*10+a,7),i+=2}else e.appendBits(o,4),i++}},r.appendAlphanumericBytes=function(t,e){for(var n=t.length,i=0;i<n;){var o=r.getAlphanumericCode(t.charCodeAt(i));if(o===-1)throw new nt;if(i+1<n){var a=r.getAlphanumericCode(t.charCodeAt(i+1));if(a===-1)throw new nt;e.appendBits(o*45+a,11),i+=2}else e.appendBits(o,6),i++}},r.append8BitBytes=function(t,e,n){var i;try{i=yt.encode(t,n)}catch(s){throw new nt(s)}for(var o=0,a=i.length;o!==a;o++){var f=i[o];e.appendBits(f,8)}},r.appendKanjiBytes=function(t,e){var n;try{n=yt.encode(t,ot.SJIS)}catch(h){throw new nt(h)}for(var i=n.length,o=0;o<i;o+=2){var a=n[o]&255,f=n[o+1]&255,s=a<<8&4294967295|f,u=-1;if(s>=33088&&s<=40956?u=s-33088:s>=57408&&s<=60351&&(u=s-49472),u===-1)throw new nt("Invalid byte sequence");var c=(u>>8)*192+(u&255);e.appendBits(c,13)}},r.appendECI=function(t,e){e.appendBits(et.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=ot.UTF8.getName(),r})(),qt=Os;var o3=(function(){function r(){}return r.prototype.write=function(t,e,n,i){if(i===void 0&&(i=null),t.length===0)throw new O("Found empty contents");if(e<0||n<0)throw new O("Requested dimensions are too small: "+e+"x"+n);var o=Nt.L,a=r.QUIET_ZONE_SIZE;i!==null&&(i.get(H.ERROR_CORRECTION)!==void 0&&(o=Nt.fromString(i.get(H.ERROR_CORRECTION).toString())),i.get(H.MARGIN)!==void 0&&(a=Number.parseInt(i.get(H.MARGIN).toString(),10)));var f=qt.encode(t,o,i);return this.renderResult(f,e,n,a)},r.prototype.writeToDom=function(t,e,n,i,o){o===void 0&&(o=null),typeof t=="string"&&(t=document.querySelector(t));var a=this.write(e,n,i,o);t&&t.appendChild(a)},r.prototype.renderResult=function(t,e,n,i){var o=t.getMatrix();if(o===null)throw new xt;for(var a=o.getWidth(),f=o.getHeight(),s=a+i*2,u=f+i*2,c=Math.max(e,s),h=Math.max(n,u),l=Math.min(Math.floor(c/s),Math.floor(h/u)),d=Math.floor((c-a*l)/2),p=Math.floor((h-f*l)/2),v=this.createSVGElement(c,h),g=0,y=p;g<f;g++,y+=l)for(var m=0,w=d;m<a;m++,w+=l)if(o.get(m,g)===1){var _=this.createSvgRectElement(w,y,l,l);v.appendChild(_)}return v},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,i){var o=document.createElementNS(r.SVG_NS,"rect");return o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",e.toString()),o.setAttributeNS(null,"height",n.toString()),o.setAttributeNS(null,"width",i.toString()),o.setAttributeNS(null,"fill","#000000"),o},r.QUIET_ZONE_SIZE=4,r.SVG_NS="http://www.w3.org/2000/svg",r})();var Ts=(function(){function r(){}return r.prototype.encode=function(t,e,n,i,o){if(t.length===0)throw new O("Found empty contents");if(e!==C.QR_CODE)throw new O("Can only encode QR_CODE, but got "+e);if(n<0||i<0)throw new O("Requested dimensions are too small: "+n+"x"+i);var a=Nt.L,f=r.QUIET_ZONE_SIZE;o!==null&&(o.get(H.ERROR_CORRECTION)!==void 0&&(a=Nt.fromString(o.get(H.ERROR_CORRECTION).toString())),o.get(H.MARGIN)!==void 0&&(f=Number.parseInt(o.get(H.MARGIN).toString(),10)));var s=qt.encode(t,a,o);return r.renderResult(s,n,i,f)},r.renderResult=function(t,e,n,i){var o=t.getMatrix();if(o===null)throw new xt;for(var a=o.getWidth(),f=o.getHeight(),s=a+i*2,u=f+i*2,c=Math.max(e,s),h=Math.max(n,u),l=Math.min(Math.floor(c/s),Math.floor(h/u)),d=Math.floor((c-a*l)/2),p=Math.floor((h-f*l)/2),v=new at(c,h),g=0,y=p;g<f;g++,y+=l)for(var m=0,w=d;m<a;m++,w+=l)o.get(m,g)===1&&v.setRegion(w,y,l,l);return v},r.QUIET_ZONE_SIZE=4,r})(),fn=Ts;var N3=(function(){function r(){}return r.prototype.encode=function(t,e,n,i,o){var a;switch(e){case C.QR_CODE:a=new fn;break;default:throw new O("No encoder available for format "+e)}return a.encode(t,e,n,i,o)},r})();var Ds=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),L3=(function(r){Ds(t,r);function t(e,n,i,o,a,f,s,u){var c=r.call(this,f,s)||this;if(c.yuvData=e,c.dataWidth=n,c.dataHeight=i,c.left=o,c.top=a,o+f>n||a+s>i)throw new O("Crop rectangle does not fit within image data.");return u&&c.reverseHorizontal(f,s),c}return t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new O("Requested row is outside the image: "+e);var i=this.getWidth();(n==null||n.length<i)&&(n=new Uint8ClampedArray(i));var o=(e+this.top)*this.dataWidth+this.left;return V.arraycopy(this.yuvData,o,n,0,i),n},t.prototype.getMatrix=function(){var e=this.getWidth(),n=this.getHeight();if(e===this.dataWidth&&n===this.dataHeight)return this.yuvData;var i=e*n,o=new Uint8ClampedArray(i),a=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return V.arraycopy(this.yuvData,a,o,0,i),o;for(var f=0;f<n;f++){var s=f*e;V.arraycopy(this.yuvData,a,o,s,e),a+=this.dataWidth}return o},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,i,o){return new t(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+n,i,o,!1)},t.prototype.renderThumbnail=function(){for(var e=this.getWidth()/t.THUMBNAIL_SCALE_FACTOR,n=this.getHeight()/t.THUMBNAIL_SCALE_FACTOR,i=new Int32Array(e*n),o=this.yuvData,a=this.top*this.dataWidth+this.left,f=0;f<n;f++){for(var s=f*e,u=0;u<e;u++){var c=o[a+u*t.THUMBNAIL_SCALE_FACTOR]&255;i[s+u]=4278190080|c*65793}a+=this.dataWidth*t.THUMBNAIL_SCALE_FACTOR}return i},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 i=this.yuvData,o=0,a=this.top*this.dataWidth+this.left;o<n;o++,a+=this.dataWidth)for(var f=a+e/2,s=a,u=a+e-1;s<f;s++,u--){var c=i[s];i[s]=i[u],i[u]=c}},t.prototype.invert=function(){return new zt(this)},t.THUMBNAIL_SCALE_FACTOR=2,t})(Ht);var Rs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),X3=(function(r){Rs(t,r);function t(e,n,i,o,a,f,s){var u=r.call(this,n,i)||this;if(u.dataWidth=o,u.dataHeight=a,u.left=f,u.top=s,e.BYTES_PER_ELEMENT===4){for(var c=n*i,h=new Uint8ClampedArray(c),l=0;l<c;l++){var d=e[l],p=d>>16&255,v=d>>7&510,g=d&255;h[l]=(p+v+g)/4&255}u.luminances=h}else u.luminances=e;if(o===void 0&&(u.dataWidth=n),a===void 0&&(u.dataHeight=i),f===void 0&&(u.left=0),s===void 0&&(u.top=0),u.left+n>u.dataWidth||u.top+i>u.dataHeight)throw new O("Crop rectangle does not fit within image data.");return u}return t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new O("Requested row is outside the image: "+e);var i=this.getWidth();(n==null||n.length<i)&&(n=new Uint8ClampedArray(i));var o=(e+this.top)*this.dataWidth+this.left;return V.arraycopy(this.luminances,o,n,0,i),n},t.prototype.getMatrix=function(){var e=this.getWidth(),n=this.getHeight();if(e===this.dataWidth&&n===this.dataHeight)return this.luminances;var i=e*n,o=new Uint8ClampedArray(i),a=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return V.arraycopy(this.luminances,a,o,0,i),o;for(var f=0;f<n;f++){var s=f*e;V.arraycopy(this.luminances,a,o,s,e),a+=this.dataWidth}return o},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,i,o){return new t(this.luminances,i,o,this.dataWidth,this.dataHeight,this.left+e,this.top+n)},t.prototype.invert=function(){return new zt(this)},t})(Ht);var Ns=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),bs=(function(r){Ns(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.forName=function(e){return this.getCharacterSetECIByName(e)},t})(ot),ge=bs;var Ps=(function(){function r(){}return r.ISO_8859_1=ot.ISO8859_1,r})(),qe=Ps;var Ms=(function(){function r(t,e,n){this.codewords=t,this.numcols=e,this.numrows=n,this.bits=new Uint8Array(e*n),Y.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,i){t<0&&(t+=this.numrows,e+=4-(this.numrows+4)%8),e<0&&(e+=this.numcols,t+=4-(this.numcols+4)%8);var o=this.codewords.charCodeAt(n);o&=1<<8-i,this.setBit(e,t,o!==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})(),mr=Ms;var sn,cn=[5,7,10,11,12,14,18,20,24,28,36,42,48,56,62,68],Oi=[[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]],Bs=301,Fs=function(r,t){for(var e=1,n=0;n<255;n++)t[n]=e,r[e]=n,e*=2,e>=256&&(e^=Bs);return{LOG:r,ALOG:t}},Je=(sn=Fs([],[]),sn.LOG),hn=sn.ALOG,un;(function(r){r[r.FORCE_NONE=0]="FORCE_NONE",r[r.FORCE_SQUARE=1]="FORCE_SQUARE",r[r.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"})(un||(un={}));var ln=129,yr=230,Ti=231,Di=235,Ri=236,Ni=237,bi=238,Pi=239,Mi=240,wr=254,Bi=254,De="[)>05",Re="[)>06",Ne="",X=0,mt=1,_t=2,pt=3,gt=4,At=5;var Ls=(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 P;n.append(t);var i=e.getInterleavedBlockCount();if(i===1){var o=this.createECCBlock(t,e.getErrorCodewords());n.append(o)}else{for(var a=[],f=[],s=0;s<i;s++)a[s]=e.getDataLengthForInterleavedBlock(s+1),f[s]=e.getErrorLengthForInterleavedBlock(s+1);for(var u=0;u<i;u++){for(var c=new P,h=u;h<e.getDataCapacity();h+=i)c.append(t.charAt(h));for(var o=this.createECCBlock(c.toString(),f[u]),l=0,d=u;d<f[u]*i;d+=i)n.setCharAt(e.getDataCapacity()+d,o.charAt(l++))}}return n.toString()},r.createECCBlock=function(t,e){for(var n=-1,i=0;i<cn.length;i++)if(cn[i]===e){n=i;break}if(n<0)throw new Error("Illegal number of error correction codewords specified: "+e);for(var o=Oi[n],a=[],i=0;i<e;i++)a[i]=0;for(var i=0;i<t.length;i++){for(var f=a[e-1]^t.charAt(i).charCodeAt(0),s=e-1;s>0;s--)f!==0&&o[s]!==0?a[s]=a[s-1]^hn[(Je[f]+Je[o[s]])%255]:a[s]=a[s-1];f!==0&&o[0]!==0?a[0]=hn[(Je[f]+Je[o[0]])%255]:a[0]=0}for(var u=[],i=0;i<e;i++)u[i]=a[e-i-1];return u.map(function(c){return String.fromCharCode(c)}).join("")},r})(),Ar=Ls;var dn=(function(){function r(){}return r.prototype.getEncodingMode=function(){return X},r.prototype.encode=function(t){var e=U.determineConsecutiveDigitCount(t.getMessage(),t.pos);if(e>=2)t.writeCodeword(this.encodeASCIIDigits(t.getMessage().charCodeAt(t.pos),t.getMessage().charCodeAt(t.pos+1))),t.pos+=2;else{var n=t.getCurrentChar(),i=U.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(i!==this.getEncodingMode())switch(i){case At:t.writeCodeword(Ti),t.signalEncoderChange(At);return;case mt:t.writeCodeword(yr),t.signalEncoderChange(mt);return;case pt:t.writeCodeword(bi),t.signalEncoderChange(pt);break;case _t:t.writeCodeword(Pi),t.signalEncoderChange(_t);break;case gt:t.writeCodeword(Mi),t.signalEncoderChange(gt);break;default:throw new Error("Illegal mode: "+i)}else U.isExtendedASCII(n)?(t.writeCodeword(Di),t.writeCodeword(n-128+1),t.pos++):(t.writeCodeword(n+1),t.pos++)}},r.prototype.encodeASCIIDigits=function(t,e){if(U.isDigit(t)&&U.isDigit(e)){var n=(t-48)*10+(e-48);return n+130}throw new Error("not digits: "+t+e)},r})();var pn=(function(){function r(){}return r.prototype.getEncodingMode=function(){return At},r.prototype.encode=function(t){var e=new P;for(e.append(0);t.hasMoreCharacters();){var n=t.getCurrentChar();e.append(n),t.pos++;var i=U.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(i!==this.getEncodingMode()){t.signalEncoderChange(X);break}}var o=e.length()-1,a=1,f=t.getCodewordCount()+o+a;t.updateSymbolInfo(f);var s=t.getSymbolInfo().getDataCapacity()-f>0;if(t.hasMoreCharacters()||s)if(o<=249)e.setCharAt(0,F.getCharAt(o));else if(o<=1555)e.setCharAt(0,F.getCharAt(Math.floor(o/250)+249)),e.insert(1,F.getCharAt(o%250));else throw new Error("Message length not in valid ranges: "+o);for(var u=0,n=e.length();u<n;u++)t.writeCodeword(this.randomize255State(e.charAt(u).charCodeAt(0),t.getCodewordCount()+1))},r.prototype.randomize255State=function(t,e){var n=149*e%255+1,i=t+n;return i<=255?i:i-256},r})();var me=(function(){function r(){}return r.prototype.getEncodingMode=function(){return mt},r.prototype.encodeMaximal=function(t){for(var e=new P,n=0,i=t.pos,o=0;t.hasMoreCharacters();){var a=t.getCurrentChar();t.pos++,n=this.encodeChar(a,e),e.length()%3===0&&(i=t.pos,o=e.length())}if(o!==e.length()){var f=Math.floor(e.length()/3*2),s=Math.floor(t.getCodewordCount()+f+1);t.updateSymbolInfo(s);var u=t.getSymbolInfo().getDataCapacity()-s,c=Math.floor(e.length()%3);(c===2&&u!==2||c===1&&(n>3||u!==1))&&(t.pos=i)}e.length()>0&&t.writeCodeword(yr),this.handleEOD(t,e)},r.prototype.encode=function(t){for(var e=new P;t.hasMoreCharacters();){var n=t.getCurrentChar();t.pos++;var i=this.encodeChar(n,e),o=Math.floor(e.length()/3)*2,a=t.getCodewordCount()+o;t.updateSymbolInfo(a);var f=t.getSymbolInfo().getDataCapacity()-a;if(!t.hasMoreCharacters()){var s=new P;for(e.length()%3===2&&f!==2&&(i=this.backtrackOneCharacter(t,e,s,i));e.length()%3===1&&(i>3||f!==1);)i=this.backtrackOneCharacter(t,e,s,i);break}var u=e.length();if(u%3===0){var c=U.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(c!==this.getEncodingMode()){t.signalEncoderChange(X);break}}}this.handleEOD(t,e)},r.prototype.backtrackOneCharacter=function(t,e,n,i){var o=e.length(),a=e.toString().substring(0,o-i);e.setLengthToZero(),e.append(a),t.pos--;var f=t.getCurrentChar();return i=this.encodeChar(f,n),t.resetSymbolInfo(),i},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),i=e.length()%3,o=t.getCodewordCount()+n;t.updateSymbolInfo(o);var a=t.getSymbolInfo().getDataCapacity()-o;if(i===2){for(e.append("\0");e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(wr)}else if(a===1&&i===1){for(;e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(wr),t.pos--}else if(i===0){for(;e.length()>=3;)this.writeNextTriplet(t,e);(a>0||t.hasMoreCharacters())&&t.writeCodeword(wr)}else throw new Error("Unexpected case. Please report!");t.signalEncoderChange(X)},r.prototype.encodeChar=function(t,e){if(t===32)return e.append(3),1;if(t>=48&&t<=57)return e.append(t-48+4),1;if(t>=65&&t<=90)return e.append(t-65+14),1;if(t<32)return e.append(0),e.append(t),2;if(t<=47)return e.append(1),e.append(t-33),2;if(t<=64)return e.append(1),e.append(t-58+15),2;if(t<=95)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),n},r.prototype.encodeToCodewords=function(t){var e=1600*t.charCodeAt(0)+40*t.charCodeAt(1)+t.charCodeAt(2)+1,n=e/256,i=e%256,o=new P;return o.append(n),o.append(i),o.toString()},r})();var vn=(function(){function r(){}return r.prototype.getEncodingMode=function(){return gt},r.prototype.encode=function(t){for(var e=new P;t.hasMoreCharacters();){var n=t.getCurrentChar();this.encodeChar(n,e),t.pos++;var i=e.length();if(i>=4){t.writeCodewords(this.encodeToCodewords(e.toString()));var o=e.toString().substring(4);e.setLengthToZero(),e.append(o);var a=U.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(a!==this.getEncodingMode()){t.signalEncoderChange(X);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 i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),o=t.getRemainingCharacters();if(o>i&&(t.updateSymbolInfo(t.getCodewordCount()+1),i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount()),o<=i&&i<=2)return}if(n>4)throw new Error("Count must not exceed 4");var a=n-1,f=this.encodeToCodewords(e.toString()),s=!t.hasMoreCharacters(),u=s&&a<=2;if(a<=2){t.updateSymbolInfo(t.getCodewordCount()+a);var i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount();i>=3&&(u=!1,t.updateSymbolInfo(t.getCodewordCount()+f.length))}u?(t.resetSymbolInfo(),t.pos-=a):t.writeCodewords(f)}finally{t.signalEncoderChange(X)}},r.prototype.encodeChar=function(t,e){t>=32&&t<=63?e.append(t):t>=64&&t<=94?e.append(F.getCharAt(t-64)):U.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),i=e>=2?t.charAt(1).charCodeAt(0):0,o=e>=3?t.charAt(2).charCodeAt(0):0,a=e>=4?t.charAt(3).charCodeAt(0):0,f=(n<<18)+(i<<12)+(o<<6)+a,s=f>>16&255,u=f>>8&255,c=f&255,h=new P;return h.append(s),e>=2&&h.append(u),e>=3&&h.append(c),h.toString()},r})();var ks=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Us=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.")},Q=(function(){function r(t,e,n,i,o,a,f,s){f===void 0&&(f=0),s===void 0&&(s=0),this.rectangular=t,this.dataCapacity=e,this.errorCodewords=n,this.matrixWidth=i,this.matrixHeight=o,this.dataRegions=a,this.rsBlockData=f,this.rsBlockError=s}return r.lookup=function(t,e,n,i,o){var a,f;e===void 0&&(e=0),n===void 0&&(n=null),i===void 0&&(i=null),o===void 0&&(o=!0);try{for(var s=Us(Vs),u=s.next();!u.done;u=s.next()){var c=u.value;if(!(e===1&&c.rectangular)&&!(e===2&&!c.rectangular)&&!(n!=null&&(c.getSymbolWidth()<n.getWidth()||c.getSymbolHeight()<n.getHeight()))&&!(i!=null&&(c.getSymbolWidth()>i.getWidth()||c.getSymbolHeight()>i.getHeight()))&&t<=c.dataCapacity)return c}}catch(h){a={error:h}}finally{try{u&&!u.done&&(f=s.return)&&f.call(s)}finally{if(a)throw a.error}}if(o)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()+this.getHorizontalDataRegions()*2},r.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+this.getVerticalDataRegions()*2},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})(),be=Q,Hs=(function(r){ks(t,r);function t(){return r.call(this,!1,1558,620,22,22,36,-1,62)||this}return t.prototype.getInterleavedBlockCount=function(){return 10},t.prototype.getDataLengthForInterleavedBlock=function(e){return e<=8?156:155},t})(Q),Vs=[new Q(!1,3,5,8,8,1),new Q(!1,5,7,10,10,1),new Q(!0,5,7,16,6,1),new Q(!1,8,10,12,12,1),new Q(!0,10,11,14,6,2),new Q(!1,12,12,14,14,1),new Q(!0,16,14,24,10,1),new Q(!1,18,14,16,16,1),new Q(!1,22,18,18,18,1),new Q(!0,22,18,16,10,2),new Q(!1,30,20,20,20,1),new Q(!0,32,24,16,14,2),new Q(!1,36,24,22,22,1),new Q(!1,44,28,24,24,1),new Q(!0,49,28,22,14,2),new Q(!1,62,36,14,14,4),new Q(!1,86,42,16,16,4),new Q(!1,114,48,18,18,4),new Q(!1,144,56,20,20,4),new Q(!1,174,68,22,22,4),new Q(!1,204,84,24,24,4,102,42),new Q(!1,280,112,14,14,16,140,56),new Q(!1,368,144,16,16,16,92,36),new Q(!1,456,192,18,18,16,114,48),new Q(!1,576,224,20,20,16,144,56),new Q(!1,696,272,22,22,16,174,68),new Q(!1,816,336,24,24,16,136,56),new Q(!1,1050,408,18,18,36,175,68),new Q(!1,1304,496,20,20,36,163,62),new Hs];var xn=(function(){function r(t){this.msg=t,this.pos=0,this.skipAtEnd=0;for(var e=t.split("").map(function(f){return f.charCodeAt(0)}),n=new P,i=0,o=e.length;i<o;i++){var a=String.fromCharCode(e[i]&255);if(a==="?"&&t.charAt(i)!=="?")throw new Error("Message contains characters outside ISO-8859-1 encoding.");n.append(a)}this.msg=n.toString(),this.shape=0,this.codewords=new P,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=be.lookup(t,this.shape,this.minSize,this.maxSize,!0))},r.prototype.resetSymbolInfo=function(){this.symbolInfo=null},r})();var Gs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),gn=(function(r){Gs(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return pt},t.prototype.encode=function(e){for(var n=new P;e.hasMoreCharacters();){var i=e.getCurrentChar();e.pos++,this.encodeChar(i,n);var o=n.length();if(o%3===0){this.writeNextTriplet(e,n);var a=U.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(a!==this.getEncodingMode()){e.signalEncoderChange(X);break}}}this.handleEOD(e,n)},t.prototype.encodeChar=function(e,n){switch(e){case 13:n.append(0);break;case 42:n.append(1);break;case 62:n.append(2);break;case 32:n.append(3);break;default:e>=48&&e<=57?n.append(e-48+4):e>=65&&e<=90?n.append(e-65+14):U.illegalCharacter(F.getCharAt(e));break}return 1},t.prototype.handleEOD=function(e,n){e.updateSymbolInfo();var i=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),o=n.length();e.pos-=o,(e.getRemainingCharacters()>1||i>1||e.getRemainingCharacters()!==i)&&e.writeCodeword(Bi),e.getNewEncoding()<0&&e.signalEncoderChange(X)},t})(me);var Ws=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),mn=(function(r){Ws(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return _t},t.prototype.encodeChar=function(e,n){if(e===32)return n.append(3),1;if(e>=48&&e<=57)return n.append(e-48+4),1;if(e>=97&&e<=122)return n.append(e-97+14),1;if(e<32)return n.append(0),n.append(e),2;if(e<=47)return n.append(1),n.append(e-33),2;if(e<=64)return n.append(1),n.append(e-58+15),2;if(e>=91&&e<=95)return n.append(1),n.append(e-91+22),2;if(e===96)return n.append(2),n.append(0),2;if(e<=90)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 i=2;return i+=this.encodeChar(e-128,n),i},t})(me);var Xs=(function(){function r(){}return r.randomize253State=function(t){var e=149*t%253+1,n=ln+e;return n<=254?n:n-254},r.encodeHighLevel=function(t,e,n,i,o){e===void 0&&(e=0),n===void 0&&(n=null),i===void 0&&(i=null),o===void 0&&(o=!1);var a=new me,f=[new dn,a,new mn,new gn,new vn,new pn],s=new xn(t);s.setSymbolShape(e),s.setSizeConstraints(n,i),t.startsWith(De)&&t.endsWith(Ne)?(s.writeCodeword(Ri),s.setSkipAtEnd(2),s.pos+=De.length):t.startsWith(Re)&&t.endsWith(Ne)&&(s.writeCodeword(Ni),s.setSkipAtEnd(2),s.pos+=Re.length);var u=X;for(o&&(a.encodeMaximal(s),u=s.getNewEncoding(),s.resetEncoderSignal());s.hasMoreCharacters();)f[u].encode(s),s.getNewEncoding()>=0&&(u=s.getNewEncoding(),s.resetEncoderSignal());var c=s.getCodewordCount();s.updateSymbolInfo();var h=s.getSymbolInfo().getDataCapacity();c<h&&u!==X&&u!==At&&u!==gt&&s.writeCodeword("\xFE");var l=s.getCodewords();for(l.length()<h&&l.append(ln);l.length()<h;)l.append(this.randomize253State(l.length()+1));return s.getCodewords().toString()},r.lookAheadTest=function(t,e,n){var i=this.lookAheadTestIntern(t,e,n);if(n===pt&&i===pt){for(var o=Math.min(e+3,t.length),a=e;a<o;a++)if(!this.isNativeX12(t.charCodeAt(a)))return X}else if(n===gt&&i===gt){for(var o=Math.min(e+4,t.length),a=e;a<o;a++)if(!this.isNativeEDIFACT(t.charCodeAt(a)))return X}return i},r.lookAheadTestIntern=function(t,e,n){if(e>=t.length)return n;var i;n===X?i=[0,1,1,1,1,1.25]:(i=[1,2,2,2,2,2.25],i[n]=0);for(var o=0,a=new Uint8Array(6),f=[];;){if(e+o===t.length){Y.fill(a,0),Y.fill(f,0);var s=this.findMinimums(i,f,M.MAX_VALUE,a),u=this.getMinimumCount(a);if(f[X]===s)return X;if(u===1){if(a[At]>0)return At;if(a[gt]>0)return gt;if(a[_t]>0)return _t;if(a[pt]>0)return pt}return mt}var c=t.charCodeAt(e+o);if(o++,this.isDigit(c)?i[X]+=.5:this.isExtendedASCII(c)?(i[X]=Math.ceil(i[X]),i[X]+=2):(i[X]=Math.ceil(i[X]),i[X]++),this.isNativeC40(c)?i[mt]+=2/3:this.isExtendedASCII(c)?i[mt]+=8/3:i[mt]+=4/3,this.isNativeText(c)?i[_t]+=2/3:this.isExtendedASCII(c)?i[_t]+=8/3:i[_t]+=4/3,this.isNativeX12(c)?i[pt]+=2/3:this.isExtendedASCII(c)?i[pt]+=13/3:i[pt]+=10/3,this.isNativeEDIFACT(c)?i[gt]+=3/4:this.isExtendedASCII(c)?i[gt]+=17/4:i[gt]+=13/4,this.isSpecialB256(c)?i[At]+=4:i[At]++,o>=4){if(Y.fill(a,0),Y.fill(f,0),this.findMinimums(i,f,M.MAX_VALUE,a),f[X]<this.min(f[At],f[mt],f[_t],f[pt],f[gt]))return X;if(f[At]<f[X]||f[At]+1<this.min(f[mt],f[_t],f[pt],f[gt]))return At;if(f[gt]+1<this.min(f[At],f[mt],f[_t],f[pt],f[X]))return gt;if(f[_t]+1<this.min(f[At],f[mt],f[gt],f[pt],f[X]))return _t;if(f[pt]+1<this.min(f[At],f[mt],f[gt],f[_t],f[X]))return pt;if(f[mt]+1<this.min(f[X],f[At],f[gt],f[_t])){if(f[mt]<f[pt])return mt;if(f[mt]===f[pt]){for(var h=e+o+1;h<t.length;){var l=t.charCodeAt(h);if(this.isX12TermSep(l))return pt;if(!this.isNativeX12(l))break;h++}return mt}}}}},r.min=function(t,e,n,i,o){var a=Math.min(t,Math.min(e,Math.min(n,i)));return o===void 0?a:Math.min(a,o)},r.findMinimums=function(t,e,n,i){for(var o=0;o<6;o++){var a=e[o]=Math.ceil(t[o]);n>a&&(n=a,Y.fill(i,0)),n===a&&(i[o]=i[o]+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>=48&&t<=57},r.isExtendedASCII=function(t){return t>=128&&t<=255},r.isNativeC40=function(t){return t===32||t>=48&&t<=57||t>=65&&t<=90},r.isNativeText=function(t){return t===32||t>=48&&t<=57||t>=97&&t<=122},r.isNativeX12=function(t){return this.isX12TermSep(t)||t===32||t>=48&&t<=57||t>=65&&t<=90},r.isX12TermSep=function(t){return t===13||t===42||t===62},r.isNativeEDIFACT=function(t){return t>=32&&t<=94},r.isSpecialB256=function(t){return!1},r.determineConsecutiveDigitCount=function(t,e){e===void 0&&(e=0);for(var n=t.length,i=e;i<n&&this.isDigit(t.charCodeAt(i));)i++;return i-e},r.illegalCharacter=function(t){var e=M.toHexString(t.charCodeAt(0));throw e="0000".substring(0,4-e.length)+e,new Error("Illegal character: "+t+" (0x"+e+")")},r})(),U=Xs;var yn=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){this.charset=t,this.name=t.name}return r.prototype.canEncode=function(t){try{return yt.encode(t,this.charset)!=null}catch{return!1}},r})(),Li=(function(){function r(t,e,n){var i,o,a,f,s,u;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(L){return new Fi(ge.forName(L))}),this.encoders=[];var c=[];c.push(new Fi(qe.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=(i=void 0,yn(c)),v=p.next();!v.done;v=p.next()){var g=v.value,y=t.charAt(l),m=y.charCodeAt(0);if(m===n||g.canEncode(y)){d=!0;break}}}catch(L){i={error:L}}finally{try{v&&!v.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}if(!d)try{for(var w=(a=void 0,yn(this.ENCODERS)),_=w.next();!_.done;_=w.next()){var g=_.value;if(g.canEncode(t.charAt(l))){c.push(g),d=!0;break}}}catch(L){a={error:L}}finally{try{_&&!_.done&&(f=w.return)&&f.call(w)}finally{if(a)throw a.error}}d||(h=!0)}if(c.length===1&&!h)this.encoders=[c[0]];else{this.encoders=[];var I=0;try{for(var T=yn(c),D=T.next();!D.done;D=T.next()){var g=D.value;this.encoders[I++]=g}}catch(L){s={error:L}}finally{try{D&&!D.done&&(u=T.return)&&u.call(T)}finally{if(s)throw s.error}}}var b=-1;if(e!=null){for(var l=0;l<this.encoders.length;l++)if(this.encoders[l]!=null&&e.name===this.encoders[l].name){b=l;break}}this.priorityEncoderIndex=b}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 yt.encode(F.getCharAt(t),this.encoders[e].name)},r})();var zs=3,Ui=(function(){function r(t,e,n){this.fnc1=n;var i=new Li(t,e,n);if(i.length()===1)for(var o=0;o<this.bytes.length;o++){var a=t.charAt(o).charCodeAt(0);this.bytes[o]=a===n?1e3:a}else this.bytes=this.encodeMinimally(t,i,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 P,i=t;i<e;i++){if(this.isECI(i))throw new Error("value at "+i+" is not a character but an ECI");n.append(this.charAt(i))}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,i,o,a){var f=t.charAt(i).charCodeAt(0),s=0,u=e.length();e.getPriorityEncoderIndex()>=0&&(f===a||e.canEncode(f,e.getPriorityEncoderIndex()))&&(s=e.getPriorityEncoderIndex(),u=s+1);for(var c=s;c<u;c++)(f===a||e.canEncode(f,c))&&this.addEdge(n,i+1,new ki(f,e,c,o,a))},r.prototype.encodeMinimally=function(t,e,n){var i=t.length,o=new ki[i+1][e.length()];this.addEdges(t,e,o,0,null,n);for(var a=1;a<=i;a++){for(var f=0;f<e.length();f++)o[a][f]!=null&&a<i&&this.addEdges(t,e,o,a,o[a][f],n);for(var f=0;f<e.length();f++)o[a-1][f]=null}for(var s=-1,u=M.MAX_VALUE,f=0;f<e.length();f++)if(o[i][f]!=null){var c=o[i][f];c.cachedTotalSize<u&&(u=c.cachedTotalSize,s=f)}if(s<0)throw new Error('Failed to encode "'+t+'"');for(var h=[],l=o[i][s];l!=null;){if(l.isFNC1())h.unshift(1e3);else for(var d=e.encode(l.c,l.encoderIndex),a=d.length-1;a>=0;a--)h.unshift(d[a]&255);var p=l.previous===null?0:l.previous.encoderIndex;p!==l.encoderIndex&&h.unshift(256+e.getECIValue(l.encoderIndex)),l=l.previous}for(var v=[],a=0;a<v.length;a++)v[a]=h[a];return v},r})();var ki=(function(){function r(t,e,n,i,o){this.c=t,this.encoderSet=e,this.encoderIndex=n,this.previous=i,this.fnc1=o,this.c=t===o?1e3:t;var a=this.isFNC1()?1:e.encode(t,n).length,f=i===null?0:i.encoderIndex;f!==n&&(a+=zs),i!=null&&(a+=i.cachedTotalSize),this.cachedTotalSize=a}return r.prototype.isFNC1=function(){return this.c===1e3},r})();var Zs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}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.")},js=function(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(f){a={error:f}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(a)throw a.error}}return o},Ys=function(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(js(arguments[t]));return r},N;(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"})(N||(N={}));var Ks=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],It=(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,i;try{for(var o=$e(Ks),a=o.next();!a.done;a=o.next()){var f=a.value;if(f.charCodeAt(0)===t)return!0}}catch(s){n={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}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,i){e===void 0&&(e=null),n===void 0&&(n=-1),i===void 0&&(i=0);var o=0;return t.startsWith(De)&&t.endsWith(Ne)?(o=5,t=t.substring(De.length,t.length-2)):t.startsWith(Re)&&t.endsWith(Ne)&&(o=6,t=t.substring(Re.length,t.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,Ys(this.encode(t,e,n,i,o)))))},r.encode=function(t,e,n,i,o){return this.encodeMinimally(new qs(t,e,n,i,o)).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,i){for(var o=0,a=e;a<t.length();a++){if(t.isECI(a))return i[0]=0,0;var f=t.charAt(a);if(n&&U.isNativeC40(f)||!n&&U.isNativeText(f))o++;else if(!r.isExtendedASCII(f,t.getFNC1Character()))o+=2;else{var s=f&255;s>=128&&(n&&U.isNativeC40(s-128)||!n&&U.isNativeText(s-128))?o+=3:o+=4}if(o%3===0||(o-2)%3===0&&a+1===t.length())return i[0]=a-e+1,Math.ceil(o/3)}return i[0]=0,0},r.addEdges=function(t,e,n,i){var o,a;if(t.isECI(n)){this.addEdge(e,new kt(t,N.ASCII,n,1,i));return}var f=t.charAt(n);if(i===null||i.getEndMode()!==N.EDF){U.isDigit(f)&&t.haveNCharacters(n,2)&&U.isDigit(t.charAt(n+1))?this.addEdge(e,new kt(t,N.ASCII,n,2,i)):this.addEdge(e,new kt(t,N.ASCII,n,1,i));var s=[N.C40,N.TEXT];try{for(var u=$e(s),c=u.next();!c.done;c=u.next()){var h=c.value,l=[];r.getNumberOfC40Words(t,n,h===N.C40,l)>0&&this.addEdge(e,new kt(t,h,n,l[0],i))}}catch(v){o={error:v}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}t.haveNCharacters(n,3)&&U.isNativeX12(t.charAt(n))&&U.isNativeX12(t.charAt(n+1))&&U.isNativeX12(t.charAt(n+2))&&this.addEdge(e,new kt(t,N.X12,n,3,i)),this.addEdge(e,new kt(t,N.B256,n,1,i))}var d;for(d=0;d<3;d++){var p=n+d;if(t.haveNCharacters(p,1)&&U.isNativeEDIFACT(t.charAt(p)))this.addEdge(e,new kt(t,N.EDF,n,d+1,i));else break}d===3&&t.haveNCharacters(n,4)&&U.isNativeEDIFACT(t.charAt(n+3))&&this.addEdge(e,new kt(t,N.EDF,n,4,i))},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 i=1;i<=e;i++){for(var o=0;o<6;o++)n[i][o]!==null&&i<e&&this.addEdges(t,n,i,n[i][o]);for(var o=0;o<6;o++)n[i-1][o]=null}for(var a=-1,f=M.MAX_VALUE,o=0;o<6;o++)if(n[e][o]!==null){var s=n[e][o],u=o>=1&&o<=3?s.cachedTotalSize+1:s.cachedTotalSize;u<f&&(f=u,a=o)}if(a<0)throw new Error('Failed to encode "'+t+'"');return new Qs(n[e][a])},r})();var Qs=(function(){function r(t){var e=t.input,n=0,i=[],o=[],a=[];(t.mode===N.C40||t.mode===N.TEXT||t.mode===N.X12)&&t.getEndMode()!==N.ASCII&&(n+=this.prepend(kt.getBytes(254),i));for(var f=t;f!==null;)n+=this.prepend(f.getDataBytes(),i),(f.previous===null||f.getPreviousStartMode()!==f.getMode())&&(f.getMode()===N.B256&&(n<=249?(i.unshift(n),n++):(i.unshift(n%250),i.unshift(n/250+249),n+=2),o.push(i.length),a.push(n)),this.prepend(f.getLatchBytes(),i),n=0),f=f.previous;e.getMacroId()===5?n+=this.prepend(kt.getBytes(236),i):e.getMacroId()===6&&(n+=this.prepend(kt.getBytes(237),i)),e.getFNC1Character()>0&&(n+=this.prepend(kt.getBytes(232),i));for(var s=0;s<o.length;s++)this.applyRandomPattern(i,i.length-o[s],a[s]);var u=t.getMinSymbolSize(i.length);for(i.length<u&&i.push(129);i.length<u;)i.push(this.randomize253State(i.length+1));this.bytes=new Uint8Array(i.length);for(var s=0;s<this.bytes.length;s++)this.bytes[s]=i[s]}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=149*t%253+1,n=129+e;return n<=254?n:n-254},r.prototype.applyRandomPattern=function(t,e,n){for(var i=0;i<n;i++){var o=e+i,a=t[o]&255,f=149*(o+1)%255+1,s=a+f;t[o]=s<=255?s:s-256}},r.prototype.getBytes=function(){return this.bytes},r})(),kt=(function(){function r(t,e,n,i,o){if(this.input=t,this.mode=e,this.fromPosition=n,this.characterLength=i,this.previous=o,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+i<=t.length()))throw new Error("Invalid edge");var a=o!==null?o.cachedTotalSize:0,f=this.getPreviousMode();switch(e){case N.ASCII:a++,(t.isECI(n)||It.isExtendedASCII(t.charAt(n),t.getFNC1Character()))&&a++,(f===N.C40||f===N.TEXT||f===N.X12)&&a++;break;case N.B256:a++,(f!==N.B256||this.getB256Size()===250)&&a++,f===N.ASCII?a++:(f===N.C40||f===N.TEXT||f===N.X12)&&(a+=2);break;case N.C40:case N.TEXT:case N.X12:if(e===N.X12)a+=2;else{var s=[];a+=It.getNumberOfC40Words(t,n,e===N.C40,s)*2}f===N.ASCII||f===N.B256?a++:f!==e&&(f===N.C40||f===N.TEXT||f===N.X12)&&(a+=2);break;case N.EDF:a+=3,f===N.ASCII||f===N.B256?a++:(f===N.C40||f===N.TEXT||f===N.X12)&&(a+=2);break}this.cachedTotalSize=a}return r.prototype.getB256Size=function(){for(var t=0,e=this;e!==null&&e.mode===N.B256&&t<=250;)t++,e=e.previous;return t},r.prototype.getPreviousStartMode=function(){return this.previous===null?N.ASCII:this.previous.mode},r.prototype.getPreviousMode=function(){return this.previous===null?N.ASCII:this.previous.getEndMode()},r.prototype.getEndMode=function(){if(this.mode===N.EDF){if(this.characterLength<4)return N.ASCII;var t=this.getLastASCII();if(t>0&&this.getCodewordsRemaining(this.cachedTotalSize+t)<=2-t)return N.ASCII}if(this.mode===N.C40||this.mode===N.TEXT||this.mode===N.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&this.getCodewordsRemaining(this.cachedTotalSize)===0)return N.ASCII;var t=this.getLastASCII();if(t===1&&this.getCodewordsRemaining(this.cachedTotalSize+1)===0)return N.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?It.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?0:1:t-e===2?It.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())||It.isExtendedASCII(this.input.charAt(e+1),this.input.getFNC1Character())?0:U.isDigit(this.input.charAt(e))&&U.isDigit(this.input.charAt(e+1))?1:2:t-e===3?U.isDigit(this.input.charAt(e))&&U.isDigit(this.input.charAt(e+1))&&!It.isExtendedASCII(this.input.charAt(e+2),this.input.getFNC1Character())||U.isDigit(this.input.charAt(e+1))&&U.isDigit(this.input.charAt(e+2))&&!It.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?2:0:U.isDigit(this.input.charAt(e))&&U.isDigit(this.input.charAt(e+1))&&U.isDigit(this.input.charAt(e+2))&&U.isDigit(this.input.charAt(e+3))?2:0},r.prototype.getMinSymbolSize=function(t){var e,n,i,o,a,f;switch(this.input.getShapeHint()){case 1:try{for(var s=$e(this.squareCodewordCapacities),u=s.next();!u.done;u=s.next()){var c=u.value;if(c>=t)return c}}catch(v){e={error:v}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}break;case 2:try{for(var h=$e(this.rectangularCodewordCapacities),l=h.next();!l.done;l=h.next()){var c=l.value;if(c>=t)return c}}catch(v){i={error:v}}finally{try{l&&!l.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}break}try{for(var d=$e(this.allCodewordCapacities),p=d.next();!p.done;p=d.next()){var c=p.value;if(c>=t)return c}}catch(v){a={error:v}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}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,i,o){var a=1600*(n&255)+40*(i&255)+(o&255)+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&&It.isInC40Shift1Set(t)||!e&&It.isInTextShift1Set(t)?0:e&&It.isInC40Shift2Set(t,n)||!e&&It.isInTextShift2Set(t,n)?1:2},r.prototype.getC40Value=function(t,e,n,i){if(n===i){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=[],i=0;i<this.characterLength;i++){var o=this.input.charAt(this.fromPosition+i);if(t&&U.isNativeC40(o)||!t&&U.isNativeText(o))n.push(this.getC40Value(t,0,o,e));else if(It.isExtendedASCII(o,e)){var f=(o&255)-128;if(t&&U.isNativeC40(f)||!t&&U.isNativeText(f))n.push(1),n.push(30),n.push(this.getC40Value(t,0,f,e));else{n.push(1),n.push(30);var a=this.getShiftValue(f,t,e);n.push(a),n.push(this.getC40Value(t,a,f,e))}}else{var a=this.getShiftValue(o,t,e);n.push(a),n.push(this.getC40Value(t,a,o,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)}for(var s=new Uint8Array(n.length/3*2),u=0,i=0;i<n.length;i+=3)this.setC40Word(s,u,n[i]&255,n[i+1]&255,n[i+2]&255),u+=2;return s},r.prototype.getEDFBytes=function(){for(var t=Math.ceil(this.characterLength/4),e=new Uint8Array(t*3),n=this.fromPosition,i=Math.min(this.fromPosition+this.characterLength-1,this.input.length()-1),o=0;o<t;o+=3){for(var a=[],f=0;f<4;f++)n<=i?a[f]=this.input.charAt(n++)&63:a[f]=n===i+1?31:0;var s=a[0]<<18;s|=a[1]<<12,s|=a[2]<<6,s|=a[3],e[o]=s>>16&255,e[o+1]=s>>8&255,e[o+2]=s&255}return e},r.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case N.ASCII:case N.B256:switch(this.mode){case N.B256:return r.getBytes(231);case N.C40:return r.getBytes(230);case N.TEXT:return r.getBytes(239);case N.X12:return r.getBytes(238);case N.EDF:return r.getBytes(240)}break;case N.C40:case N.TEXT:case N.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case N.ASCII:return r.getBytes(254);case N.B256:return r.getBytes(254,231);case N.C40:return r.getBytes(254,230);case N.TEXT:return r.getBytes(254,239);case N.X12:return r.getBytes(254,238);case N.EDF:return r.getBytes(254,240)}break;case N.EDF:if(this.mode!==N.EDF)throw new Error("Cannot switch from EDF to "+this.mode);break}return new Uint8Array(0)},r.prototype.getDataBytes=function(){switch(this.mode){case N.ASCII:return this.input.isECI(this.fromPosition)?r.getBytes(241,this.input.getECIValue(this.fromPosition)+1):It.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?r.getBytes(235,this.input.charAt(this.fromPosition)-127):this.characterLength===2?r.getBytes(this.input.charAt(this.fromPosition)*10+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?r.getBytes(232):r.getBytes(this.input.charAt(this.fromPosition)+1);case N.B256:return r.getBytes(this.input.charAt(this.fromPosition));case N.C40:return this.getC40Words(!0,this.input.getFNC1Character());case N.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case N.X12:return this.getX12Words();case N.EDF:return this.getEDFBytes()}},r})(),qs=(function(r){Zs(t,r);function t(e,n,i,o,a){var f=r.call(this,e,n,i)||this;return f.shape=o,f.macroId=a,f}return t.prototype.getMacroId=function(){return this.macroId},t.prototype.getShapeHint=function(){return this.shape},t})(Ui);var EA=(function(){function r(){}return r.prototype.encode=function(t,e,n,i,o){if(o===void 0&&(o=null),t.trim()==="")throw new Error("Found empty contents");if(e!==C.DATA_MATRIX)throw new Error("Can only encode DATA_MATRIX, but got "+e);if(n<0||i<0)throw new Error("Requested dimensions can't be negative: "+n+"x"+i);var a=0,f=null,s=null;if(o!=null){var u=o.get(H.DATA_MATRIX_SHAPE);u!=null&&(a=u);var c=o.get(H.MIN_SIZE);c!=null&&(f=c);var h=o.get(H.MAX_SIZE);h!=null&&(s=h)}var l,d=o!=null&&o.has(H.DATA_MATRIX_COMPACT)&&!!o.get(H.DATA_MATRIX_COMPACT).toString();if(d){var p=o.has(H.GS1_FORMAT)&&!!o.get(H.GS1_FORMAT).toString(),v=null,g=o.has(H.CHARACTER_SET);g&&(v=ge.forName(o.get(H.CHARACTER_SET).toString())),l=It.encodeHighLevel(t,v,p?29:-1,a)}else{var y=o!=null&&o.has(H.FORCE_C40)&&!!o.get(H.FORCE_C40).toString();l=U.encodeHighLevel(t,a,f,s,y)}var m=be.lookup(l.length,a,f,s,!0),w=Ar.encodeECC200(l,m),_=new mr(w,m.getSymbolDataWidth(),m.getSymbolDataHeight());return _.place(),this.encodeLowLevel(_,m,n,i)},r.prototype.encodeLowLevel=function(t,e,n,i){for(var o=e.getSymbolDataWidth(),a=e.getSymbolDataHeight(),f=new Qe(e.getSymbolWidth(),e.getSymbolHeight()),s=0,u=0;u<a;u++){var c=void 0;if(u%e.matrixHeight===0){c=0;for(var h=0;h<e.getSymbolWidth();h++)f.setBoolean(c,s,h%2===0),c++;s++}c=0;for(var h=0;h<o;h++)h%e.matrixWidth===0&&(f.setBoolean(c,s,!0),c++),f.setBoolean(c,s,t.getBit(h,u)),c++,h%e.matrixWidth===e.matrixWidth-1&&(f.setBoolean(c,s,u%2===0),c++);if(s++,u%e.matrixHeight===e.matrixHeight-1){c=0;for(var h=0;h<e.getSymbolWidth();h++)f.setBoolean(c,s,!0),c++;s++}}return this.convertByteMatrixToBitMatrix(f,n,i)},r.prototype.convertByteMatrixToBitMatrix=function(t,e,n){var i=t.getWidth(),o=t.getHeight(),a=Math.max(e,i),f=Math.max(n,o),s=Math.min(a/i,f/o),u=(a-i*s)/2,c=(f-o*s)/2,h;n<o||e<i?(u=0,c=0,h=new at(i,o)):h=new at(e,n),h.clear();for(var l=0,d=c;l<o;l++,d+=s)for(var p=0,v=u;p<i;p++,v+=s)t.get(p,l)===1&&h.setRegion(v,d,s,s);return h},r})();var Js=(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})(),wn=Js;var $s=(function(){function r(){}return r.singletonList=function(t){return[t]},r.min=function(t,e){return t.sort(e)[0]},r})(),An=$s;var t0=(function(){function r(t){this.previous=t}return r.prototype.getPrevious=function(){return this.previous},r})(),Hi=t0;var e0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),r0=(function(r){e0(t,r);function t(e,n,i){var o=r.call(this,e)||this;return o.value=n,o.bitCount=i,o}return 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,"<"+M.toBinaryString(e|1<<this.bitCount).substring(1)+">"},t})(Hi),Pe=r0;var n0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),i0=(function(r){n0(t,r);function t(e,n,i){var o=r.call(this,e,0,0)||this;return o.binaryShiftStart=n,o.binaryShiftByteCount=i,o}return t.prototype.appendTo=function(e,n){for(var i=0;i<this.binaryShiftByteCount;i++)(i===0||i===31&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?e.appendBits(this.binaryShiftByteCount-31,16):i===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(n[this.binaryShiftStart+i],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})(Pe),Vi=i0;function Gi(r,t,e){return new Vi(r,t,e)}function Me(r,t,e){return new Pe(r,t,e)}var Wi=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Gt=0,Be=1,St=2,Er=3,bt=4,Xi=new Pe(null,0,0);var Cr=[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])];var f0=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 s0(r){var t,e;try{for(var n=f0(r),i=n.next();!i.done;i=n.next()){var o=i.value;Y.fill(o,-1)}}catch(a){t={error:a}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r[Gt][bt]=0,r[Be][bt]=0,r[Be][Gt]=28,r[Er][bt]=0,r[St][bt]=0,r[St][Gt]=15,r}var Ir=s0(Y.createInt32Array(6,6));var u0=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.")},c0=(function(){function r(t,e,n,i){this.token=t,this.mode=e,this.binaryShiftByteCount=n,this.bitCount=i}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,i=this.token;if(t!==this.mode){var o=Cr[this.mode][t];i=Me(i,o&65535,o>>16),n+=o>>16}var a=t===St?4:5;return i=Me(i,e,a),new r(i,t,0,n+a)},r.prototype.shiftAndAppend=function(t,e){var n=this.token,i=this.mode===St?4:5;return n=Me(n,Ir[this.mode][t],i),n=Me(n,e,5),new r(n,this.mode,0,this.bitCount+i+5)},r.prototype.addBinaryShiftChar=function(t){var e=this.token,n=this.mode,i=this.bitCount;if(this.mode===bt||this.mode===St){var o=Cr[n][Gt];e=Me(e,o&65535,o>>16),i+=o>>16,n=Gt}var a=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,f=new r(e,n,this.binaryShiftByteCount+1,i+a);return f.binaryShiftByteCount===2078&&(f=f.endBinaryShift(t+1)),f},r.prototype.endBinaryShift=function(t){if(this.binaryShiftByteCount===0)return this;var e=this.token;return e=Gi(e,t-this.binaryShiftByteCount,this.binaryShiftByteCount),new r(e,this.mode,0,this.bitCount)},r.prototype.isBetterThanOrEqualTo=function(t){var e=this.bitCount+(Cr[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,i=[],o=this.endBinaryShift(t.length).token;o!==null;o=o.getPrevious())i.unshift(o);var a=new it;try{for(var f=u0(i),s=f.next();!s.done;s=f.next()){var u=s.value;u.appendTo(a,t)}}catch(c){e={error:c}}finally{try{s&&!s.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}return a},r.prototype.toString=function(){return F.format("%s bits=%d bytes=%d",Wi[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(Xi,Gt,0,0),r})(),Zi=c0;function h0(r){var t=F.getCharCode(" "),e=F.getCharCode("."),n=F.getCharCode(",");r[Gt][t]=1;for(var i=F.getCharCode("Z"),o=F.getCharCode("A"),a=o;a<=i;a++)r[Gt][a]=a-o+2;r[Be][t]=1;for(var f=F.getCharCode("z"),s=F.getCharCode("a"),a=s;a<=f;a++)r[Be][a]=a-s+2;r[St][t]=1;for(var u=F.getCharCode("9"),c=F.getCharCode("0"),a=c;a<=u;a++)r[St][a]=a-c+2;r[St][n]=12,r[St][e]=13;for(var h=["\0"," ","","","","","","","\x07","\b"," ",`
19
- `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~","\x7F"],l=0;l<h.length;l++)r[Er][F.getCharCode(h[l])]=l;for(var d=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"],l=0;l<d.length;l++)F.getCharCode(d[l])>0&&(r[bt][F.getCharCode(d[l])]=l);return r}var Sr=h0(Y.createInt32Array(5,256));var Or=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.")},d0=(function(){function r(t){this.text=t}return r.prototype.encode=function(){for(var t=F.getCharCode(" "),e=F.getCharCode(`
20
- `),n=An.singletonList(Zi.INITIAL_STATE),i=0;i<this.text.length;i++){var o=void 0,a=i+1<this.text.length?this.text[i+1]:0;switch(this.text[i]){case F.getCharCode("\r"):o=a===e?2:0;break;case F.getCharCode("."):o=a===t?3:0;break;case F.getCharCode(","):o=a===t?4:0;break;case F.getCharCode(":"):o=a===t?5:0;break;default:o=0}o>0?(n=r.updateStateListForPair(n,i,o),i++):n=this.updateStateListForChar(n,i)}var f=An.min(n,function(s,u){return s.getBitCount()-u.getBitCount()});return f.toBitArray(this.text)},r.prototype.updateStateListForChar=function(t,e){var n,i,o=[];try{for(var a=Or(t),f=a.next();!f.done;f=a.next()){var s=f.value;this.updateStateForChar(s,e,o)}}catch(u){n={error:u}}finally{try{f&&!f.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return r.simplifyStates(o)},r.prototype.updateStateForChar=function(t,e,n){for(var i=this.text[e]&255,o=Sr[t.getMode()][i]>0,a=null,f=0;f<=bt;f++){var s=Sr[f][i];if(s>0){if(a==null&&(a=t.endBinaryShift(e)),!o||f===t.getMode()||f===St){var u=a.latchAndAppend(f,s);n.push(u)}if(!o&&Ir[t.getMode()][f]>=0){var c=a.shiftAndAppend(f,s);n.push(c)}}}if(t.getBinaryShiftByteCount()>0||Sr[t.getMode()][i]===0){var h=t.addBinaryShiftChar(e);n.push(h)}},r.updateStateListForPair=function(t,e,n){var i,o,a=[];try{for(var f=Or(t),s=f.next();!s.done;s=f.next()){var u=s.value;this.updateStateForPair(u,e,n,a)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}return this.simplifyStates(a)},r.updateStateForPair=function(t,e,n,i){var o=t.endBinaryShift(e);if(i.push(o.latchAndAppend(bt,n)),t.getMode()!==bt&&i.push(o.shiftAndAppend(bt,n)),n===3||n===4){var a=o.latchAndAppend(St,16-n).latchAndAppend(St,1);i.push(a)}if(t.getBinaryShiftByteCount()>0){var f=t.addBinaryShiftChar(e).addBinaryShiftChar(e+1);i.push(f)}},r.simplifyStates=function(t){var e,n,i,o,a=[];try{for(var f=Or(t),s=f.next();!s.done;s=f.next()){var u=s.value,c=!0,h=function(g){if(g.isBetterThanOrEqualTo(u))return c=!1,"break";u.isBetterThanOrEqualTo(g)&&(a=a.filter(function(y){return y!==g}))};try{for(var l=(i=void 0,Or(a)),d=l.next();!d.done;d=l.next()){var p=d.value,v=h(p);if(v==="break")break}}catch(g){i={error:g}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}c&&a.push(u)}}catch(g){e={error:g}}finally{try{s&&!s.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}return a},r})(),En=d0;var p0=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.")},v0=(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 i=new En(t).encode(),o=M.truncDivision(i.getSize()*e,100)+11,a=i.getSize()+o,f,s,u,c,h;if(n!==r.DEFAULT_AZTEC_LAYERS){if(f=n<0,s=Math.abs(n),s>(f?r.MAX_NB_BITS_COMPACT:r.MAX_NB_BITS))throw new O(F.format("Illegal value %s for layers",n));u=r.totalBitsInLayer(s,f),c=r.WORD_SIZE[s];var l=u-u%c;if(h=r.stuffBits(i,c),h.getSize()+o>l)throw new O("Data to large for user specified layer");if(f&&h.getSize()>c*64)throw new O("Data to large for user specified layer")}else{c=0,h=null;for(var d=0;;d++){if(d>r.MAX_NB_BITS)throw new O("Data too large for an Aztec code");if(f=d<=3,s=f?d+1:d,u=r.totalBitsInLayer(s,f),!(a>u)){(h==null||c!==r.WORD_SIZE[s])&&(c=r.WORD_SIZE[s],h=r.stuffBits(i,c));var l=u-u%c;if(!(f&&h.getSize()>c*64)&&h.getSize()+o<=l)break}}}var p=r.generateCheckWords(h,u,c),v=h.getSize()/c,g=r.generateModeMessage(f,s,v),y=(f?11:14)+s*4,m=new Int32Array(y),w;if(f){w=y;for(var d=0;d<m.length;d++)m[d]=d}else{w=y+1+2*M.truncDivision(M.truncDivision(y,2)-1,15);for(var _=M.truncDivision(y,2),I=M.truncDivision(w,2),d=0;d<_;d++){var T=d+M.truncDivision(d,15);m[_-d-1]=I-T-1,m[_+d]=I+T+1}}for(var D=new at(w),d=0,b=0;d<s;d++){for(var L=(s-d)*4+(f?9:12),B=0;B<L;B++)for(var vt=B*2,z=0;z<2;z++)p.get(b+vt+z)&&D.set(m[d*2+z],m[d*2+B]),p.get(b+L*2+vt+z)&&D.set(m[d*2+B],m[y-1-d*2-z]),p.get(b+L*4+vt+z)&&D.set(m[y-1-d*2-z],m[y-1-d*2-B]),p.get(b+L*6+vt+z)&&D.set(m[y-1-d*2-B],m[d*2+z]);b+=L*8}if(r.drawModeMessage(D,f,w,g),f)r.drawBullsEye(D,M.truncDivision(w,2),5);else{r.drawBullsEye(D,M.truncDivision(w,2),7);for(var d=0,B=0;d<M.truncDivision(y,2)-1;d+=15,B+=16)for(var z=M.truncDivision(w,2)&1;z<w;z+=2)D.set(M.truncDivision(w,2)-B,z),D.set(M.truncDivision(w,2)+B,z),D.set(z,M.truncDivision(w,2)-B),D.set(z,M.truncDivision(w,2)+B)}var ut=new wn;return ut.setCompact(f),ut.setSize(w),ut.setLayers(s),ut.setCodeWords(v),ut.setMatrix(D),ut},r.drawBullsEye=function(t,e,n){for(var i=0;i<n;i+=2)for(var o=e-i;o<=e+i;o++)t.set(o,e-i),t.set(o,e+i),t.set(e-i,o),t.set(e+i,o);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 i=new it;return t?(i.appendBits(e-1,2),i.appendBits(n-1,6),i=r.generateCheckWords(i,28,4)):(i.appendBits(e-1,5),i.appendBits(n-1,11),i=r.generateCheckWords(i,40,4)),i},r.drawModeMessage=function(t,e,n,i){var o=M.truncDivision(n,2);if(e)for(var a=0;a<7;a++){var f=o-3+a;i.get(a)&&t.set(f,o-5),i.get(a+7)&&t.set(o+5,f),i.get(20-a)&&t.set(f,o+5),i.get(27-a)&&t.set(o-5,f)}else for(var a=0;a<10;a++){var f=o-5+a+M.truncDivision(a,5);i.get(a)&&t.set(f,o-7),i.get(a+10)&&t.set(o+7,f),i.get(29-a)&&t.set(f,o+7),i.get(39-a)&&t.set(o-7,f)}},r.generateCheckWords=function(t,e,n){var i,o,a=t.getSize()/n,f=new Ke(r.getGF(n)),s=M.truncDivision(e,n),u=r.bitsToWords(t,n,s);f.encode(u,s-a);var c=e%n,h=new it;h.appendBits(0,c);try{for(var l=p0(Array.from(u)),d=l.next();!d.done;d=l.next()){var p=d.value;h.appendBits(p,n)}}catch(v){i={error:v}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}return h},r.bitsToWords=function(t,e,n){var i=new Int32Array(n),o,a;for(o=0,a=t.getSize()/e;o<a;o++){for(var f=0,s=0;s<e;s++)f|=t.get(o*e+s)?1<<e-s-1:0;i[o]=f}return i},r.getGF=function(t){switch(t){case 4:return dt.AZTEC_PARAM;case 6:return dt.AZTEC_DATA_6;case 8:return dt.AZTEC_DATA_8;case 10:return dt.AZTEC_DATA_10;case 12:return dt.AZTEC_DATA_12;default:throw new O("Unsupported word size "+t)}},r.stuffBits=function(t,e){for(var n=new it,i=t.getSize(),o=(1<<e)-2,a=0;a<i;a+=e){for(var f=0,s=0;s<e;s++)(a+s>=i||t.get(a+s))&&(f|=1<<e-1-s);(f&o)===o?(n.appendBits(f&o,e),a--):(f&o)===0?(n.appendBits(f|1,e),a--):n.appendBits(f,e)}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})(),tr=v0;var hE=(function(){function r(){}return r.prototype.encode=function(t,e,n,i){return this.encodeWithHints(t,e,n,i,null)},r.prototype.encodeWithHints=function(t,e,n,i,o){var a=qe.ISO_8859_1,f=tr.DEFAULT_EC_PERCENT,s=tr.DEFAULT_AZTEC_LAYERS;return o!=null&&(o.has(H.CHARACTER_SET)&&(a=ge.forName(o.get(H.CHARACTER_SET).toString())),o.has(H.ERROR_CORRECTION)&&(f=M.parseInt(o.get(H.ERROR_CORRECTION).toString())),o.has(H.AZTEC_LAYERS)&&(s=M.parseInt(o.get(H.AZTEC_LAYERS).toString()))),r.encodeLayers(t,e,n,i,a,f,s)},r.encodeLayers=function(t,e,n,i,o,a,f){if(e!==C.AZTEC)throw new O("Can only encode AZTEC, but got "+e);var s=tr.encode(F.getBytes(t,o),a,f);return r.renderResult(s,n,i)},r.renderResult=function(t,e,n){var i=t.getMatrix();if(i==null)throw new xt;for(var o=i.getWidth(),a=i.getHeight(),f=Math.max(e,o),s=Math.max(n,a),u=Math.min(f/o,s/a),c=(f-o*u)/2,h=(s-a*u)/2,l=new at(f,s),d=0,p=h;d<a;d++,p+=u)for(var v=0,g=c;v<o;v++,g+=u)i.get(v,d)&&l.setRegion(g,p,u,u);return l},r})();var x0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ji=(function(r){x0(t,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 t.makeBufferFromCanvasImageData=function(e){var n;try{n=e.getContext("2d",{willReadFrequently:!0})}catch{n=e.getContext("2d")}if(!n)throw new Error("Couldn't get canvas context.");var i=n.getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(i.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,n,i){for(var o=new Uint8ClampedArray(n*i),a=0,f=0,s=e.length;a<s;a+=4,f++){var u=void 0,c=e[a+3];if(c===0)u=255;else{var h=e[a],l=e[a+1],d=e[a+2];u=306*h+601*l+117*d+512>>10}o[f]=u}return o},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new O("Requested row is outside the image: "+e);var i=this.getWidth(),o=e*i;return n===null?n=this.buffer.slice(o,o+i):(n.length<i&&(n=new Uint8ClampedArray(i)),n.set(this.buffer.slice(o,o+i))),n},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,i,o){return r.prototype.crop.call(this,e,n,i,o),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.invert=function(){return new zt(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();if(!n)throw new Error("Could not create a Canvas element.");var i=e*t.DEGREE_TO_RADIANS,o=this.canvas.width,a=this.canvas.height,f=Math.ceil(Math.abs(Math.cos(i))*o+Math.abs(Math.sin(i))*a),s=Math.ceil(Math.abs(Math.sin(i))*o+Math.abs(Math.cos(i))*a);n.width=f,n.height=s;var u=n.getContext("2d");if(!u)throw new Error("Could not create a Canvas Context element.");return u.translate(f/2,s/2),u.rotate(i),u.drawImage(this.canvas,o/-2,a/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.DEGREE_TO_RADIANS=Math.PI/180,t})(Ht);function _n(){return typeof navigator<"u"}function g0(){return _n()&&!!navigator.mediaDevices}function Yi(){return!!(g0()&&navigator.mediaDevices.enumerateDevices)}var Fe=function(){return Fe=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},Fe.apply(this,arguments)},ht=function(r,t,e,n){function i(o){return o instanceof e?o:new e(function(a){a(o)})}return new(e||(e=Promise))(function(o,a){function f(c){try{u(n.next(c))}catch(h){a(h)}}function s(c){try{u(n.throw(c))}catch(h){a(h)}}function u(c){c.done?o(c.value):i(c.value).then(f,s)}u((n=n.apply(r,t||[])).next())})},lt=function(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(u){return function(c){return s([u,c])}}function s(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){e.label=u[1];break}if(u[0]===6&&e.label<o[1]){e.label=o[1],o=u;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(u);break}o[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(c){u=[6,c],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Cn=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.")},m0={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},Ut=(function(){function r(t,e,n){e===void 0&&(e=new Map),n===void 0&&(n={}),this.reader=t,this.hints=e,this.options=Fe(Fe({},m0),n)}return Object.defineProperty(r.prototype,"possibleFormats",{set:function(t){this.hints.set(k.POSSIBLE_FORMATS,t)},enumerable:!1,configurable:!0}),r.addVideoSource=function(t,e){try{t.srcObject=e}catch{console.error("got interrupted by new loading request")}},r.mediaStreamSetTorch=function(t,e){return ht(this,void 0,void 0,function(){return lt(this,function(n){switch(n.label){case 0:return[4,t.applyConstraints({advanced:[{fillLightMode:e?"flash":"off",torch:!!e}]})];case 1:return n.sent(),[2]}})})},r.mediaStreamIsTorchCompatible=function(t){var e,n,i=t.getVideoTracks();try{for(var o=Cn(i),a=o.next();!a.done;a=o.next()){var f=a.value;if(r.mediaStreamIsTorchCompatibleTrack(f))return!0}}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return!1},r.mediaStreamIsTorchCompatibleTrack=function(t){try{var e=t.getCapabilities();return"torch"in e}catch(n){return console.error(n),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},r.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&t.readyState>2},r.getMediaElement=function(t,e){var n=document.getElementById(t);if(!n)throw new st("element with id '".concat(t,"' not found"));if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new st("element with id '".concat(t,"' must be an ").concat(e," element"));return n},r.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if(typeof t=="string")return r.getMediaElement(t,"video");if(!t&&typeof document<"u"){var e=document.createElement("video");return e.width=200,e.height=200,e}throw new Error("Couldn't get videoElement from videoSource!")},r.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if(typeof t=="string")return r.getMediaElement(t,"img");if(typeof t>"u"){var e=document.createElement("img");return e.width=200,e.height=200,e}throw new Error("Couldn't get imageElement from imageSource!")},r.prepareVideoElement=function(t){var e=r.createVideoElement(t);return e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},r.isImageLoaded=function(t){return!(!t.complete||t.naturalWidth===0)},r.createBinaryBitmapFromCanvas=function(t){var e=new ji(t),n=new ke(e);return new Le(n)},r.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)},r.getMediaElementDimensions=function(t){if(t instanceof HTMLVideoElement)return{height:t.videoHeight,width:t.videoWidth};if(t instanceof HTMLImageElement)return{height:t.naturalHeight||t.height,width:t.naturalWidth||t.width};throw new Error("Couldn't find the Source's dimensions!")},r.createCaptureCanvas=function(t){if(!t)throw new st("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var e=document.createElement("canvas"),n=r.getMediaElementDimensions(t),i=n.width,o=n.height;return e.style.width=i+"px",e.style.height=o+"px",e.width=i,e.height=o,e},r.tryPlayVideo=function(t){return ht(this,void 0,void 0,function(){var e;return lt(this,function(n){switch(n.label){case 0:if(t?.ended)return console.error("Trying to play video that has ended."),[2,!1];if(r.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[2,!0];case 3:return e=n.sent(),console.warn("It was not possible to play the video.",e),[2,!1];case 4:return[2]}})})},r.createCanvasFromMediaElement=function(t){var e=r.createCaptureCanvas(t),n=e.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return r.drawImageOnCanvas(n,t),e},r.createBinaryBitmapFromMediaElem=function(t){var e=r.createCanvasFromMediaElement(t);return r.createBinaryBitmapFromCanvas(e)},r.destroyImageElement=function(t){t.src="",t.removeAttribute("src"),t=void 0},r.listVideoInputDevices=function(){return ht(this,void 0,void 0,function(){var t,e,n,i,o,a,f,s,u,c,h,l;return lt(this,function(d){switch(d.label){case 0:if(!_n())throw new Error("Can't enumerate devices, navigator is not present.");if(!Yi())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=d.sent(),e=[];try{for(n=Cn(t),i=n.next();!i.done;i=n.next())o=i.value,a=o.kind==="video"?"videoinput":o.kind,a==="videoinput"&&(f=o.deviceId||o.id,s=o.label||"Video device ".concat(e.length+1),u=o.groupId,c={deviceId:f,label:s,kind:a,groupId:u},e.push(c))}catch(p){h={error:p}}finally{try{i&&!i.done&&(l=n.return)&&l.call(n)}finally{if(h)throw h.error}}return[2,e]}})})},r.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,r.listVideoInputDevices()];case 1:return e=n.sent(),e?[2,e.find(function(i){return i.deviceId===t})]:[2]}})})},r.cleanVideoSource=function(t){if(t){try{t.srcObject=null}catch{t.src=""}t&&t.removeAttribute("src")}},r.releaseAllStreams=function(){r.streamTracker.length!==0&&r.streamTracker.forEach(function(t){t.getTracks().forEach(function(e){return e.stop()})}),r.streamTracker=[]},r.playVideoOnLoadAsync=function(t,e){return ht(this,void 0,void 0,function(){var n;return lt(this,function(i){switch(i.label){case 0:return[4,r.tryPlayVideo(t)];case 1:return n=i.sent(),n?[2,!0]:[2,new Promise(function(o,a){var f=setTimeout(function(){r.isVideoPlaying(t)||(a(!1),t.removeEventListener("canplay",s))},e),s=function(){r.tryPlayVideo(t).then(function(u){clearTimeout(f),t.removeEventListener("canplay",s),o(u)})};t.addEventListener("canplay",s)})]}})})},r.attachStreamToVideo=function(t,e,n){return n===void 0&&(n=5e3),ht(this,void 0,void 0,function(){var i;return lt(this,function(o){switch(o.label){case 0:return i=r.prepareVideoElement(e),r.addVideoSource(i,t),[4,r.playVideoOnLoadAsync(i,n)];case 1:return o.sent(),[2,i]}})})},r._waitImageLoad=function(t){return new Promise(function(e,n){var i=1e4,o=setTimeout(function(){r.isImageLoaded(t)||(t.removeEventListener("load",a),n())},i),a=function(){clearTimeout(o),t.removeEventListener("load",a),e()};t.addEventListener("load",a)})},r.checkCallbackFnOrThrow=function(t){if(!t)throw new st("`callbackFn` is a required parameter, you cannot capture results without it.")},r.disposeMediaStream=function(t){t.getVideoTracks().forEach(function(e){return e.stop()}),t=void 0},r.prototype.decode=function(t){var e=r.createCanvasFromMediaElement(t);return this.decodeFromCanvas(e)},r.prototype.decodeBitmap=function(t){return this.reader.decode(t,this.hints)},r.prototype.decodeFromCanvas=function(t){var e=r.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(e)},r.prototype.decodeFromImageElement=function(t){return ht(this,void 0,void 0,function(){var e;return lt(this,function(n){switch(n.label){case 0:if(!t)throw new st("An image element must be provided.");return e=r.prepareImageElement(t),[4,this._decodeOnLoadImage(e)];case 1:return[2,n.sent()]}})})},r.prototype.decodeFromImageUrl=function(t){return ht(this,void 0,void 0,function(){var e;return lt(this,function(n){switch(n.label){case 0:if(!t)throw new st("An URL must be provided.");e=r.prepareImageElement(),e.src=t,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(e)];case 2:return[2,n.sent()];case 3:return r.destroyImageElement(e),[7];case 4:return[2]}})})},r.prototype.decodeFromConstraints=function(t,e,n){return ht(this,void 0,void 0,function(){var i,o;return lt(this,function(a){switch(a.label){case 0:return r.checkCallbackFnOrThrow(n),[4,this.getUserMedia(t)];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(i,e,n)];case 3:return[2,a.sent()];case 4:throw o=a.sent(),r.disposeMediaStream(i),o;case 5:return[2]}})})},r.prototype.decodeFromStream=function(t,e,n){return ht(this,void 0,void 0,function(){var i,o,a,f,s,u,c,h,l,d=this;return lt(this,function(p){switch(p.label){case 0:return r.checkCallbackFnOrThrow(n),i=this.options.tryPlayVideoTimeout,[4,r.attachStreamToVideo(t,e,i)];case 1:return o=p.sent(),a=function(){r.disposeMediaStream(t),r.cleanVideoSource(o)},f=this.scan(o,n,a),s=t.getVideoTracks(),u=Fe(Fe({},f),{stop:function(){f.stop()},streamVideoConstraintsApply:function(v,g){return ht(this,void 0,void 0,function(){var y,m,w,_,I,T,D;return lt(this,function(b){switch(b.label){case 0:y=g?s.filter(g):s,b.label=1;case 1:b.trys.push([1,6,7,8]),m=Cn(y),w=m.next(),b.label=2;case 2:return w.done?[3,5]:(_=w.value,[4,_.applyConstraints(v)]);case 3:b.sent(),b.label=4;case 4:return w=m.next(),[3,2];case 5:return[3,8];case 6:return I=b.sent(),T={error:I},[3,8];case 7:try{w&&!w.done&&(D=m.return)&&D.call(m)}finally{if(T)throw T.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(v){return s.find(v).getConstraints()},streamVideoSettingsGet:function(v){return s.find(v).getSettings()},streamVideoCapabilitiesGet:function(v){return s.find(v).getCapabilities()}}),c=r.mediaStreamIsTorchCompatible(t),c&&(h=s?.find(function(v){return r.mediaStreamIsTorchCompatibleTrack(v)}),l=function(v){return ht(d,void 0,void 0,function(){return lt(this,function(g){switch(g.label){case 0:return[4,r.mediaStreamSetTorch(h,v)];case 1:return g.sent(),[2]}})})},u.switchTorch=l,u.stop=function(){return ht(d,void 0,void 0,function(){return lt(this,function(v){switch(v.label){case 0:return f.stop(),[4,l(!1)];case 1:return v.sent(),[2]}})})}),[2,u]}})})},r.prototype.decodeFromVideoDevice=function(t,e,n){return ht(this,void 0,void 0,function(){var i,o;return lt(this,function(a){switch(a.label){case 0:return r.checkCallbackFnOrThrow(n),t?i={deviceId:{exact:t}}:i={facingMode:"environment"},o={video:i},[4,this.decodeFromConstraints(o,e,n)];case 1:return[2,a.sent()]}})})},r.prototype.decodeFromVideoElement=function(t,e){return ht(this,void 0,void 0,function(){var n,i;return lt(this,function(o){switch(o.label){case 0:if(r.checkCallbackFnOrThrow(e),!t)throw new st("A video element must be provided.");return n=r.prepareVideoElement(t),i=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(n,i)];case 1:return o.sent(),[2,this.scan(n,e)]}})})},r.prototype.decodeFromVideoUrl=function(t,e){return ht(this,void 0,void 0,function(){var n,i,o,a;return lt(this,function(f){switch(f.label){case 0:if(r.checkCallbackFnOrThrow(e),!t)throw new st("An URL must be provided.");return n=r.prepareVideoElement(),n.src=t,i=function(){r.cleanVideoSource(n)},o=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(n,o)];case 1:return f.sent(),a=this.scan(n,e,i),[2,a]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return ht(this,void 0,void 0,function(){var n;return lt(this,function(i){switch(i.label){case 0:return[4,this.getUserMedia(t)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,e)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(t,e){return ht(this,void 0,void 0,function(){var n,i,o;return lt(this,function(a){switch(a.label){case 0:return n=!!e,[4,r.attachStreamToVideo(t,e)];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,,4,5]),[4,this.scanOneResult(i)];case 3:return o=a.sent(),[2,o];case 4:return n||r.cleanVideoSource(i),[7];case 5:return[2]}})})},r.prototype.decodeOnceFromVideoDevice=function(t,e){return ht(this,void 0,void 0,function(){var n,i;return lt(this,function(o){switch(o.label){case 0:return t?n={deviceId:{exact:t}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,e)];case 1:return[2,o.sent()]}})})},r.prototype.decodeOnceFromVideoElement=function(t){return ht(this,void 0,void 0,function(){var e,n;return lt(this,function(i){switch(i.label){case 0:if(!t)throw new st("A video element must be provided.");return e=r.prepareVideoElement(t),n=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(e,n)];case 1:return i.sent(),[4,this.scanOneResult(e)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromVideoUrl=function(t){return ht(this,void 0,void 0,function(){var e,n;return lt(this,function(i){switch(i.label){case 0:if(!t)throw new st("An URL must be provided.");e=r.prepareVideoElement(),e.src=t,n=this.decodeOnceFromVideoElement(e),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,n];case 2:return[2,i.sent()];case 3:return r.cleanVideoSource(e),[7];case 4:return[2]}})})},r.prototype.scanOneResult=function(t,e,n,i){var o=this;return e===void 0&&(e=!0),n===void 0&&(n=!0),i===void 0&&(i=!0),new Promise(function(a,f){o.scan(t,function(s,u,c){if(s){a(s),c.stop();return}if(u){if(u instanceof A&&e||u instanceof j&&n||u instanceof S&&i)return;c.stop(),f(u)}})})},r.prototype.scan=function(t,e,n){var i=this;r.checkCallbackFnOrThrow(e);var o=r.createCaptureCanvas(t),a;try{a=o.getContext("2d",{willReadFrequently:!0})}catch{a=o.getContext("2d")}if(!a)throw new Error("Couldn't create canvas for visual element scan.");var f=function(){a=void 0,o=void 0},s=!1,u,c=function(){s=!0,clearTimeout(u),f(),n&&n()},h={stop:c},l=function(){if(!s)try{r.drawImageOnCanvas(a,t);var d=i.decodeFromCanvas(o);e(d,void 0,h),u=setTimeout(l,i.options.delayBetweenScanSuccess)}catch(y){e(void 0,y,h);var p=y instanceof j,v=y instanceof S,g=y instanceof A;if(p||v||g){u=setTimeout(l,i.options.delayBetweenScanAttempts);return}f(),n&&n(y)}};return l(),h},r.prototype._decodeOnLoadImage=function(t){return ht(this,void 0,void 0,function(){var e;return lt(this,function(n){switch(n.label){case 0:return e=r.isImageLoaded(t),e?[3,2]:[4,r._waitImageLoad(t)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(t)]}})})},r.prototype.getUserMedia=function(t){return ht(this,void 0,void 0,function(){var e;return lt(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return e=n.sent(),r.streamTracker.push(e),[2,e]}})})},r.streamTracker=[],r})();var y0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),yC=(function(r){y0(t,r);function t(e,n){return r.call(this,new te,e,n)||this}return t})(Ut);var w0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),_C=(function(r){w0(t,r);function t(e,n){return r.call(this,new Xt(e),e,n)||this}return t})(Ut);var A0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),OC=(function(r){A0(t,r);function t(e,n){return r.call(this,new oe,e,n)||this}return t})(Ut);var E0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ki=(function(r){E0(t,r);function t(e,n){var i=this,o=new Ye;return o.setHints(e),i=r.call(this,o,e,n)||this,i.reader=o,i}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(k.POSSIBLE_FORMATS,e),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t.prototype.setHints=function(e){this.hints=e,this.reader.setHints(this.hints)},t})(Ut);var _0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),MC=(function(r){_0(t,r);function t(e,n){return r.call(this,new se,e,n)||this}return t})(Ut);var C0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),kC=(function(r){C0(t,r);function t(e,n){return r.call(this,new ae,e,n)||this}return t})(Ut);var Jt="http://www.w3.org/2000/svg",VC=(function(){function r(t){if(typeof t=="string"){var e=document.getElementById(t);if(!e)throw new Error("Could not find a Container element with '".concat(t,"'."));this.containerElement=e}else this.containerElement=t}return r.prototype.write=function(t,e,n,i){if(t.length===0)throw new O("Found empty contents");if(e<0||n<0)throw new O("Requested dimensions are too small: "+e+"x"+n);var o=i&&i.get(H.MARGIN)!==void 0?Number.parseInt(i.get(H.MARGIN).toString(),10):r.QUIET_ZONE_SIZE,a=this.encode(i,t);return this.renderResult(a,e,n,o)},r.prototype.createSVGElement=function(t,e){var n=document.createElementNS(r.SVG_NS,"svg");return n.setAttributeNS(Jt,"width",e.toString()),n.setAttributeNS(Jt,"height",t.toString()),n},r.prototype.createSvgPathPlaceholderElement=function(t,e){var n=document.createElementNS(r.SVG_NS,"path");return n.setAttributeNS(Jt,"d","M0 0h".concat(t,"v").concat(e,"H0z")),n.setAttributeNS(Jt,"fill","none"),n},r.prototype.createSvgRectElement=function(t,e,n,i){var o=document.createElementNS(r.SVG_NS,"rect");return o.setAttributeNS(Jt,"x",t.toString()),o.setAttributeNS(Jt,"y",e.toString()),o.setAttributeNS(Jt,"height",n.toString()),o.setAttributeNS(Jt,"width",i.toString()),o.setAttributeNS(Jt,"fill","#000000"),o},r.prototype.encode=function(t,e){var n=Nt.L;if(t&&t.get(H.ERROR_CORRECTION)!==void 0){var i=t.get(H.ERROR_CORRECTION).toString();n=Nt.fromString(i)}var o=qt.encode(e,n,t);return o},r.prototype.renderResult=function(t,e,n,i){var o=t.getMatrix();if(o===null)throw new xt;var a=o.getWidth(),f=o.getHeight(),s=a+i*2,u=f+i*2,c=Math.max(e,s),h=Math.max(n,u),l=Math.min(Math.floor(c/s),Math.floor(h/u)),d=Math.floor((c-a*l)/2),p=Math.floor((h-f*l)/2),v=this.createSVGElement(c,h),g=this.createSvgPathPlaceholderElement(e,n);v.appendChild(g),this.containerElement.appendChild(v);for(var y=0,m=p;y<f;y++,m+=l)for(var w=0,_=d;w<a;w++,_+=l)if(o.get(w,y)===1){var I=this.createSvgRectElement(_,m,l,l);v.appendChild(I)}return v},r.QUIET_ZONE_SIZE=4,r.SVG_NS="http://www.w3.org/2000/svg",r})();var Qi="http://www.w3.org/2000/svg",XC=(function(){function r(){}return r.prototype.write=function(t,e,n,i){if(t.length===0)throw new O("Found empty contents");if(e<0||n<0)throw new O("Requested dimensions are too small: "+e+"x"+n);var o=Nt.L,a=r.QUIET_ZONE_SIZE;if(i){if(i.get(H.ERROR_CORRECTION)!==void 0){var f=i.get(H.ERROR_CORRECTION).toString();o=Nt.fromString(f)}i.get(H.MARGIN)!==void 0&&(a=Number.parseInt(i.get(H.MARGIN).toString(),10))}var s=qt.encode(t,o,i);return this.renderResult(s,e,n,a)},r.prototype.writeToDom=function(t,e,n,i,o){if(typeof t=="string"){var a=document.querySelector(t);if(!a)throw new Error("Could no find the target HTML element.");t=a}var f=this.write(e,n,i,o);t instanceof HTMLElement&&t.appendChild(f)},r.prototype.renderResult=function(t,e,n,i){var o=t.getMatrix();if(o===null)throw new xt;for(var a=o.getWidth(),f=o.getHeight(),s=a+i*2,u=f+i*2,c=Math.max(e,s),h=Math.max(n,u),l=Math.min(Math.floor(c/s),Math.floor(h/u)),d=Math.floor((c-a*l)/2),p=Math.floor((h-f*l)/2),v=this.createSVGElement(c,h),g=0,y=p;g<f;g++,y+=l)for(var m=0,w=d;m<a;m++,w+=l)if(o.get(m,g)===1){var _=this.createSvgRectElement(w,y,l,l);v.appendChild(_)}return v},r.prototype.createSVGElement=function(t,e){var n=document.createElementNS(Qi,"svg"),i=t.toString(),o=e.toString();return n.setAttribute("height",o),n.setAttribute("width",i),n.setAttribute("viewBox","0 0 "+i+" "+o),n},r.prototype.createSvgRectElement=function(t,e,n,i){var o=document.createElementNS(Qi,"rect");return o.setAttribute("x",t.toString()),o.setAttribute("y",e.toString()),o.setAttribute("height",n.toString()),o.setAttribute("width",i.toString()),o.setAttribute("fill","#000000"),o},r.QUIET_ZONE_SIZE=4,r})();var In={[C.AZTEC]:"aztec",[C.CODABAR]:"codabar",[C.CODE_39]:"code_39",[C.CODE_93]:"code_93",[C.CODE_128]:"code_128",[C.DATA_MATRIX]:"data_matrix",[C.EAN_8]:"ean_8",[C.EAN_13]:"ean_13",[C.ITF]:"itf",[C.PDF_417]:"pdf417",[C.QR_CODE]:"qr_code",[C.UPC_A]:"upc_a",[C.UPC_E]:"upc_e",[C.UPC_EAN_EXTENSION]:"unknown",[C.MAXICODE]:"unknown",[C.RSS_14]:"unknown",[C.RSS_EXPANDED]:"unknown"},Sn={aztec:C.AZTEC,codabar:C.CODABAR,code_39:C.CODE_39,code_93:C.CODE_93,code_128:C.CODE_128,data_matrix:C.DATA_MATRIX,ean_8:C.EAN_8,ean_13:C.EAN_13,itf:C.ITF,pdf417:C.PDF_417,qr_code:C.QR_CODE,upc_a:C.UPC_A,upc_e:C.UPC_E};var Tr=class{reader;constructor(t){let e=new Map([[k.TRY_HARDER,!0],[k.POSSIBLE_FORMATS,t?t.formats.map(n=>Sn[n]):Object.values(Sn)]]);this.reader=new Ki(e)}static getSupportedFormats(){return Promise.resolve(Object.values(In))}async detect(t){try{let e;if(t instanceof HTMLVideoElement||t instanceof HTMLImageElement)e=await this.reader.scanOneResult(t,!1);else if(t instanceof HTMLCanvasElement)e=this.reader.decodeFromCanvas(t);else if(t instanceof Blob){let n=await this.blobToImage(t);e=await this.reader.scanOneResult(n,!1)}else if(t instanceof ImageBitmap||t instanceof ImageData||t instanceof VideoFrame)e=this.reader.decodeFromCanvas(this.imageDataSourceToCanvas(t));else throw new TypeError("Image source is not supported");return[{rawValue:e.getText(),format:In[e.getBarcodeFormat()],boundingBox:new DOMRectReadOnly,cornerPoints:e.getResultPoints().map(n=>({x:n.getX(),y:n.getY()}))}]}catch(e){if(e&&!(e instanceof A))throw e;return[]}}async blobToImage(t){return new Promise((e,n)=>{let i=URL.createObjectURL(t),o=new Image;o.onload=()=>{URL.revokeObjectURL(i),e(o)},o.onerror=()=>n(),o.src=i})}imageDataSourceToCanvas(t){let e=document.createElement("canvas"),n=e.getContext("2d"),i=t instanceof VideoFrame?t.displayWidth:t.width,o=t instanceof VideoFrame?t.displayHeight:t.height;return n&&(t instanceof ImageData?n.putImageData(t,i,o):n.drawImage(t,i,o)),e}};"BarcodeDetector"in window||(window.BarcodeDetector=Tr);})();
18
+ `),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})(),Te=Es;var _s=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Cs=(function(r){_s(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="WriterException",t})($),nt=Cs;var Is=(function(){function r(){}return r.clearMatrix=function(t){t.clear(255)},r.buildMatrix=function(t,e,n,i,o){r.clearMatrix(o),r.embedBasicPatterns(n,o),r.embedTypeInfo(e,i,o),r.maybeEmbedVersionInfo(n,o),r.embedDataBits(t,i,o)},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 i=new it;r.makeTypeInfoBits(t,e,i);for(var o=0,a=i.getSize();o<a;++o){var f=i.get(i.getSize()-1-o),s=r.TYPE_INFO_COORDINATES[o],u=s[0],c=s[1];if(n.setBoolean(u,c,f),o<8){var l=n.getWidth()-o-1,h=8;n.setBoolean(l,h,f)}else{var l=8,h=n.getHeight()-7+(o-8);n.setBoolean(l,h,f)}}},r.maybeEmbedVersionInfo=function(t,e){if(!(t.getVersionNumber()<7)){var n=new it;r.makeVersionInfoBits(t,n);for(var i=17,o=0;o<6;++o)for(var a=0;a<3;++a){var f=n.get(i);i--,e.setBoolean(o,e.getHeight()-11+a,f),e.setBoolean(e.getHeight()-11+a,o,f)}}},r.embedDataBits=function(t,e,n){for(var i=0,o=-1,a=n.getWidth()-1,f=n.getHeight()-1;a>0;){for(a===6&&(a-=1);f>=0&&f<n.getHeight();){for(var s=0;s<2;++s){var u=a-s;if(r.isEmpty(n.get(u,f))){var c=void 0;i<t.getSize()?(c=t.get(i),++i):c=!1,e!==255&&ue.getDataMaskBit(e,u,f)&&(c=!c),n.setBoolean(u,f,c)}}f+=o}o=-o,f+=o,a-=2}if(i!==t.getSize())throw new nt("Not all bits consumed: "+i+"/"+t.getSize())},r.findMSBSet=function(t){return 32-M.numberOfLeadingZeros(t)},r.calculateBCHCode=function(t,e){if(e===0)throw new O("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(!Te.isValidMaskPattern(e))throw new nt("Invalid mask pattern");var i=t.getBits()<<3|e;n.appendBits(i,5);var o=r.calculateBCHCode(i,r.TYPE_INFO_POLY);n.appendBits(o,10);var a=new it;if(a.appendBits(r.TYPE_INFO_MASK_PATTERN,15),n.xor(a),n.getSize()!==15)throw new nt("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 nt("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 nt;t.setNumber(8,t.getHeight()-8,1)},r.embedHorizontalSeparationPattern=function(t,e,n){for(var i=0;i<8;++i){if(!r.isEmpty(n.get(t+i,e)))throw new nt;n.setNumber(t+i,e,0)}},r.embedVerticalSeparationPattern=function(t,e,n){for(var i=0;i<7;++i){if(!r.isEmpty(n.get(t,e+i)))throw new nt;n.setNumber(t,e+i,0)}},r.embedPositionAdjustmentPattern=function(t,e,n){for(var i=0;i<5;++i)for(var o=r.POSITION_ADJUSTMENT_PATTERN[i],a=0;a<5;++a)n.setNumber(t+a,e+i,o[a])},r.embedPositionDetectionPattern=function(t,e,n){for(var i=0;i<7;++i)for(var o=r.POSITION_DETECTION_PATTERN[i],a=0;a<7;++a)n.setNumber(t+a,e+i,o[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);var n=8;r.embedHorizontalSeparationPattern(0,n-1,t),r.embedHorizontalSeparationPattern(t.getWidth()-n,n-1,t),r.embedHorizontalSeparationPattern(0,t.getWidth()-n,t);var i=7;r.embedVerticalSeparationPattern(i,0,t),r.embedVerticalSeparationPattern(t.getHeight()-i-1,0,t),r.embedVerticalSeparationPattern(i,t.getHeight()-i,t)},r.maybeEmbedPositionAdjustmentPatterns=function(t,e){if(!(t.getVersionNumber()<2))for(var n=t.getVersionNumber()-1,i=r.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n],o=0,a=i.length;o!==a;o++){var f=i[o];if(f>=0)for(var s=0;s!==a;s++){var u=i[s];u>=0&&r.isEmpty(e.get(u,f))&&r.embedPositionAdjustmentPattern(u-2,f-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})(),gr=Is;var Ss=(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})(),Ii=Ss;var Si=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.")},Os=(function(){function r(){}return r.calculateMaskPenalty=function(t){return ue.applyMaskPenaltyRule1(t)+ue.applyMaskPenaltyRule2(t)+ue.applyMaskPenaltyRule3(t)+ue.applyMaskPenaltyRule4(t)},r.encode=function(t,e,n){n===void 0&&(n=null);var i=r.DEFAULT_BYTE_MODE_ENCODING,o=n!==null&&n.get(H.CHARACTER_SET)!==void 0;o&&(i=n.get(H.CHARACTER_SET).toString());var a=this.chooseMode(t,i),f=new it;if(a===et.BYTE&&(o||r.DEFAULT_BYTE_MODE_ENCODING!==i)){var s=ot.getCharacterSetECIByName(i);s!==void 0&&this.appendECI(s,f)}this.appendModeInfo(a,f);var u=new it;this.appendBytes(t,a,u,i);var c;if(n!==null&&n.get(H.QR_VERSION)!==void 0){var l=Number.parseInt(n.get(H.QR_VERSION).toString(),10);c=Vt.getVersionForNumber(l);var h=this.calculateBitsNeeded(a,f,u,c);if(!this.willFit(h,c,e))throw new nt("Data too big for requested version")}else c=this.recommendVersion(e,a,f,u);var d=new it;d.appendBitArray(f);var p=a===et.BYTE?u.getSizeInBytes():t.length;this.appendLengthInfo(p,c,a,d),d.appendBitArray(u);var v=c.getECBlocksForLevel(e),g=c.getTotalCodewords()-v.getTotalECCodewords();this.terminateBits(g,d);var y=this.interleaveWithECBytes(d,c.getTotalCodewords(),g,v.getNumBlocks()),m=new Te;m.setECLevel(e),m.setMode(a),m.setVersion(c);var w=c.getDimensionForVersion(),_=new Qe(w,w),I=this.chooseMaskPattern(y,e,c,_);return m.setMaskPattern(I),gr.buildMatrix(y,e,c,I,_),m.setMatrix(_),m},r.recommendVersion=function(t,e,n,i){var o=this.calculateBitsNeeded(e,n,i,Vt.getVersionForNumber(1)),a=this.chooseVersion(o,t),f=this.calculateBitsNeeded(e,n,i,a);return this.chooseVersion(f,t)},r.calculateBitsNeeded=function(t,e,n,i){return e.getSize()+t.getCharacterCountBits(i)+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),ot.SJIS.getName()===e&&this.isOnlyDoubleByteKanji(t))return et.KANJI;for(var n=!1,i=!1,o=0,a=t.length;o<a;++o){var f=t.charAt(o);if(r.isDigit(f))n=!0;else if(this.getAlphanumericCode(f.charCodeAt(0))!==-1)i=!0;else return et.BYTE}return i?et.ALPHANUMERIC:n?et.NUMERIC:et.BYTE},r.isOnlyDoubleByteKanji=function(t){var e;try{e=yt.encode(t,ot.SJIS)}catch{return!1}var n=e.length;if(n%2!==0)return!1;for(var i=0;i<n;i+=2){var o=e[i]&255;if((o<129||o>159)&&(o<224||o>235))return!1}return!0},r.chooseMaskPattern=function(t,e,n,i){for(var o=Number.MAX_SAFE_INTEGER,a=-1,f=0;f<Te.NUM_MASK_PATTERNS;f++){gr.buildMatrix(t,e,n,f,i);var s=this.calculateMaskPenalty(i);s<o&&(o=s,a=f)}return a},r.chooseVersion=function(t,e){for(var n=1;n<=40;n++){var i=Vt.getVersionForNumber(n);if(r.willFit(t,i,e))return i}throw new nt("Data too big")},r.willFit=function(t,e,n){var i=e.getTotalCodewords(),o=e.getECBlocksForLevel(n),a=o.getTotalECCodewords(),f=i-a,s=(t+7)/8;return f>=s},r.terminateBits=function(t,e){var n=t*8;if(e.getSize()>n)throw new nt("data bits cannot fit in the QR Code"+e.getSize()+" > "+n);for(var i=0;i<4&&e.getSize()<n;++i)e.appendBit(!1);var o=e.getSize()&7;if(o>0)for(var i=o;i<8;i++)e.appendBit(!1);for(var a=t-e.getSizeInBytes(),i=0;i<a;++i)e.appendBits((i&1)===0?236:17,8);if(e.getSize()!==n)throw new nt("Bits size does not equal capacity")},r.getNumDataBytesAndNumECBytesForBlockID=function(t,e,n,i,o,a){if(i>=n)throw new nt("Block ID too large");var f=t%n,s=n-f,u=Math.floor(t/n),c=u+1,l=Math.floor(e/n),h=l+1,d=u-l,p=c-h;if(d!==p)throw new nt("EC bytes mismatch");if(n!==s+f)throw new nt("RS blocks mismatch");if(t!==(l+d)*s+(h+p)*f)throw new nt("Total bytes mismatch");i<s?(o[0]=l,a[0]=d):(o[0]=h,a[0]=p)},r.interleaveWithECBytes=function(t,e,n,i){var o,a,f,s;if(t.getSizeInBytes()!==n)throw new nt("Number of bits and data bytes does not match");for(var u=0,c=0,l=0,h=new Array,d=0;d<i;++d){var p=new Int32Array(1),v=new Int32Array(1);r.getNumDataBytesAndNumECBytesForBlockID(e,n,i,d,p,v);var g=p[0],y=new Uint8Array(g);t.toBytes(8*u,y,0,g);var m=r.generateECBytes(y,v[0]);h.push(new Ii(y,m)),c=Math.max(c,g),l=Math.max(l,m.length),u+=p[0]}if(n!==u)throw new nt("Data bytes does not match offset");for(var w=new it,d=0;d<c;++d)try{for(var _=(o=void 0,Si(h)),I=_.next();!I.done;I=_.next()){var T=I.value,y=T.getDataBytes();d<y.length&&w.appendBits(y[d],8)}}catch(B){o={error:B}}finally{try{I&&!I.done&&(a=_.return)&&a.call(_)}finally{if(o)throw o.error}}for(var d=0;d<l;++d)try{for(var D=(f=void 0,Si(h)),b=D.next();!b.done;b=D.next()){var T=b.value,m=T.getErrorCorrectionBytes();d<m.length&&w.appendBits(m[d],8)}}catch(B){f={error:B}}finally{try{b&&!b.done&&(s=D.return)&&s.call(D)}finally{if(f)throw f.error}}if(e!==w.getSizeInBytes())throw new nt("Interleaving error: "+e+" and "+w.getSizeInBytes()+" differ.");return w},r.generateECBytes=function(t,e){for(var n=t.length,i=new Int32Array(n+e),o=0;o<n;o++)i[o]=t[o]&255;new Ke(dt.QR_CODE_FIELD_256).encode(i,e);for(var a=new Uint8Array(e),o=0;o<e;o++)a[o]=i[n+o];return a},r.appendModeInfo=function(t,e){e.appendBits(t.getBits(),4)},r.appendLengthInfo=function(t,e,n,i){var o=n.getCharacterCountBits(e);if(t>=1<<o)throw new nt(t+" is bigger than "+((1<<o)-1));i.appendBits(t,o)},r.appendBytes=function(t,e,n,i){switch(e){case et.NUMERIC:r.appendNumericBytes(t,n);break;case et.ALPHANUMERIC:r.appendAlphanumericBytes(t,n);break;case et.BYTE:r.append8BitBytes(t,n,i);break;case et.KANJI:r.appendKanjiBytes(t,n);break;default:throw new nt("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,i=0;i<n;){var o=r.getDigit(t.charAt(i));if(i+2<n){var a=r.getDigit(t.charAt(i+1)),f=r.getDigit(t.charAt(i+2));e.appendBits(o*100+a*10+f,10),i+=3}else if(i+1<n){var a=r.getDigit(t.charAt(i+1));e.appendBits(o*10+a,7),i+=2}else e.appendBits(o,4),i++}},r.appendAlphanumericBytes=function(t,e){for(var n=t.length,i=0;i<n;){var o=r.getAlphanumericCode(t.charCodeAt(i));if(o===-1)throw new nt;if(i+1<n){var a=r.getAlphanumericCode(t.charCodeAt(i+1));if(a===-1)throw new nt;e.appendBits(o*45+a,11),i+=2}else e.appendBits(o,6),i++}},r.append8BitBytes=function(t,e,n){var i;try{i=yt.encode(t,n)}catch(s){throw new nt(s)}for(var o=0,a=i.length;o!==a;o++){var f=i[o];e.appendBits(f,8)}},r.appendKanjiBytes=function(t,e){var n;try{n=yt.encode(t,ot.SJIS)}catch(l){throw new nt(l)}for(var i=n.length,o=0;o<i;o+=2){var a=n[o]&255,f=n[o+1]&255,s=a<<8&4294967295|f,u=-1;if(s>=33088&&s<=40956?u=s-33088:s>=57408&&s<=60351&&(u=s-49472),u===-1)throw new nt("Invalid byte sequence");var c=(u>>8)*192+(u&255);e.appendBits(c,13)}},r.appendECI=function(t,e){e.appendBits(et.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=ot.UTF8.getName(),r})(),qt=Os;var o3=(function(){function r(){}return r.prototype.write=function(t,e,n,i){if(i===void 0&&(i=null),t.length===0)throw new O("Found empty contents");if(e<0||n<0)throw new O("Requested dimensions are too small: "+e+"x"+n);var o=Nt.L,a=r.QUIET_ZONE_SIZE;i!==null&&(i.get(H.ERROR_CORRECTION)!==void 0&&(o=Nt.fromString(i.get(H.ERROR_CORRECTION).toString())),i.get(H.MARGIN)!==void 0&&(a=Number.parseInt(i.get(H.MARGIN).toString(),10)));var f=qt.encode(t,o,i);return this.renderResult(f,e,n,a)},r.prototype.writeToDom=function(t,e,n,i,o){o===void 0&&(o=null),typeof t=="string"&&(t=document.querySelector(t));var a=this.write(e,n,i,o);t&&t.appendChild(a)},r.prototype.renderResult=function(t,e,n,i){var o=t.getMatrix();if(o===null)throw new xt;for(var a=o.getWidth(),f=o.getHeight(),s=a+i*2,u=f+i*2,c=Math.max(e,s),l=Math.max(n,u),h=Math.min(Math.floor(c/s),Math.floor(l/u)),d=Math.floor((c-a*h)/2),p=Math.floor((l-f*h)/2),v=this.createSVGElement(c,l),g=0,y=p;g<f;g++,y+=h)for(var m=0,w=d;m<a;m++,w+=h)if(o.get(m,g)===1){var _=this.createSvgRectElement(w,y,h,h);v.appendChild(_)}return v},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,i){var o=document.createElementNS(r.SVG_NS,"rect");return o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",e.toString()),o.setAttributeNS(null,"height",n.toString()),o.setAttributeNS(null,"width",i.toString()),o.setAttributeNS(null,"fill","#000000"),o},r.QUIET_ZONE_SIZE=4,r.SVG_NS="http://www.w3.org/2000/svg",r})();var Ts=(function(){function r(){}return r.prototype.encode=function(t,e,n,i,o){if(t.length===0)throw new O("Found empty contents");if(e!==C.QR_CODE)throw new O("Can only encode QR_CODE, but got "+e);if(n<0||i<0)throw new O("Requested dimensions are too small: "+n+"x"+i);var a=Nt.L,f=r.QUIET_ZONE_SIZE;o!==null&&(o.get(H.ERROR_CORRECTION)!==void 0&&(a=Nt.fromString(o.get(H.ERROR_CORRECTION).toString())),o.get(H.MARGIN)!==void 0&&(f=Number.parseInt(o.get(H.MARGIN).toString(),10)));var s=qt.encode(t,a,o);return r.renderResult(s,n,i,f)},r.renderResult=function(t,e,n,i){var o=t.getMatrix();if(o===null)throw new xt;for(var a=o.getWidth(),f=o.getHeight(),s=a+i*2,u=f+i*2,c=Math.max(e,s),l=Math.max(n,u),h=Math.min(Math.floor(c/s),Math.floor(l/u)),d=Math.floor((c-a*h)/2),p=Math.floor((l-f*h)/2),v=new at(c,l),g=0,y=p;g<f;g++,y+=h)for(var m=0,w=d;m<a;m++,w+=h)o.get(m,g)===1&&v.setRegion(w,y,h,h);return v},r.QUIET_ZONE_SIZE=4,r})(),fn=Ts;var N3=(function(){function r(){}return r.prototype.encode=function(t,e,n,i,o){var a;if(e===C.QR_CODE)a=new fn;else throw new O("No encoder available for format "+e);return a.encode(t,e,n,i,o)},r})();var Ds=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),L3=(function(r){Ds(t,r);function t(e,n,i,o,a,f,s,u){var c=r.call(this,f,s)||this;if(c.yuvData=e,c.dataWidth=n,c.dataHeight=i,c.left=o,c.top=a,o+f>n||a+s>i)throw new O("Crop rectangle does not fit within image data.");return u&&c.reverseHorizontal(f,s),c}return t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new O("Requested row is outside the image: "+e);var i=this.getWidth();(n==null||n.length<i)&&(n=new Uint8ClampedArray(i));var o=(e+this.top)*this.dataWidth+this.left;return V.arraycopy(this.yuvData,o,n,0,i),n},t.prototype.getMatrix=function(){var e=this.getWidth(),n=this.getHeight();if(e===this.dataWidth&&n===this.dataHeight)return this.yuvData;var i=e*n,o=new Uint8ClampedArray(i),a=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return V.arraycopy(this.yuvData,a,o,0,i),o;for(var f=0;f<n;f++){var s=f*e;V.arraycopy(this.yuvData,a,o,s,e),a+=this.dataWidth}return o},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,i,o){return new t(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+n,i,o,!1)},t.prototype.renderThumbnail=function(){for(var e=this.getWidth()/t.THUMBNAIL_SCALE_FACTOR,n=this.getHeight()/t.THUMBNAIL_SCALE_FACTOR,i=new Int32Array(e*n),o=this.yuvData,a=this.top*this.dataWidth+this.left,f=0;f<n;f++){for(var s=f*e,u=0;u<e;u++){var c=o[a+u*t.THUMBNAIL_SCALE_FACTOR]&255;i[s+u]=4278190080|c*65793}a+=this.dataWidth*t.THUMBNAIL_SCALE_FACTOR}return i},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 i=this.yuvData,o=0,a=this.top*this.dataWidth+this.left;o<n;o++,a+=this.dataWidth)for(var f=a+e/2,s=a,u=a+e-1;s<f;s++,u--){var c=i[s];i[s]=i[u],i[u]=c}},t.prototype.invert=function(){return new zt(this)},t.THUMBNAIL_SCALE_FACTOR=2,t})(Ht);var Rs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),X3=(function(r){Rs(t,r);function t(e,n,i,o,a,f,s){var u=r.call(this,n,i)||this;if(u.dataWidth=o,u.dataHeight=a,u.left=f,u.top=s,e.BYTES_PER_ELEMENT===4){for(var c=n*i,l=new Uint8ClampedArray(c),h=0;h<c;h++){var d=e[h],p=d>>16&255,v=d>>7&510,g=d&255;l[h]=(p+v+g)/4&255}u.luminances=l}else u.luminances=e;if(o===void 0&&(u.dataWidth=n),a===void 0&&(u.dataHeight=i),f===void 0&&(u.left=0),s===void 0&&(u.top=0),u.left+n>u.dataWidth||u.top+i>u.dataHeight)throw new O("Crop rectangle does not fit within image data.");return u}return t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new O("Requested row is outside the image: "+e);var i=this.getWidth();(n==null||n.length<i)&&(n=new Uint8ClampedArray(i));var o=(e+this.top)*this.dataWidth+this.left;return V.arraycopy(this.luminances,o,n,0,i),n},t.prototype.getMatrix=function(){var e=this.getWidth(),n=this.getHeight();if(e===this.dataWidth&&n===this.dataHeight)return this.luminances;var i=e*n,o=new Uint8ClampedArray(i),a=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return V.arraycopy(this.luminances,a,o,0,i),o;for(var f=0;f<n;f++){var s=f*e;V.arraycopy(this.luminances,a,o,s,e),a+=this.dataWidth}return o},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,i,o){return new t(this.luminances,i,o,this.dataWidth,this.dataHeight,this.left+e,this.top+n)},t.prototype.invert=function(){return new zt(this)},t})(Ht);var Ns=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),bs=(function(r){Ns(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.forName=function(e){return this.getCharacterSetECIByName(e)},t})(ot),ge=bs;var Ps=(function(){function r(){}return r.ISO_8859_1=ot.ISO8859_1,r})(),qe=Ps;var Ms=(function(){function r(t,e,n){this.codewords=t,this.numcols=e,this.numrows=n,this.bits=new Uint8Array(e*n),Y.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,i){t<0&&(t+=this.numrows,e+=4-(this.numrows+4)%8),e<0&&(e+=this.numcols,t+=4-(this.numcols+4)%8);var o=this.codewords.charCodeAt(n);o&=1<<8-i,this.setBit(e,t,o!==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})(),mr=Ms;var sn,cn=[5,7,10,11,12,14,18,20,24,28,36,42,48,56,62,68],Oi=[[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]],Bs=301,Fs=function(r,t){for(var e=1,n=0;n<255;n++)t[n]=e,r[e]=n,e*=2,e>=256&&(e^=Bs);return{LOG:r,ALOG:t}},Je=(sn=Fs([],[]),sn.LOG),ln=sn.ALOG,un;(function(r){r[r.FORCE_NONE=0]="FORCE_NONE",r[r.FORCE_SQUARE=1]="FORCE_SQUARE",r[r.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"})(un||(un={}));var hn=129,yr=230,Ti=231,Di=235,Ri=236,Ni=237,bi=238,Pi=239,Mi=240,wr=254,Bi=254,De="[)>05",Re="[)>06",Ne="",X=0,mt=1,_t=2,pt=3,gt=4,At=5;var Ls=(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 P;n.append(t);var i=e.getInterleavedBlockCount();if(i===1){var o=this.createECCBlock(t,e.getErrorCodewords());n.append(o)}else{for(var a=[],f=[],s=0;s<i;s++)a[s]=e.getDataLengthForInterleavedBlock(s+1),f[s]=e.getErrorLengthForInterleavedBlock(s+1);for(var u=0;u<i;u++){for(var c=new P,l=u;l<e.getDataCapacity();l+=i)c.append(t.charAt(l));for(var o=this.createECCBlock(c.toString(),f[u]),h=0,d=u;d<f[u]*i;d+=i)n.setCharAt(e.getDataCapacity()+d,o.charAt(h++))}}return n.toString()},r.createECCBlock=function(t,e){for(var n=-1,i=0;i<cn.length;i++)if(cn[i]===e){n=i;break}if(n<0)throw new Error("Illegal number of error correction codewords specified: "+e);for(var o=Oi[n],a=[],i=0;i<e;i++)a[i]=0;for(var i=0;i<t.length;i++){for(var f=a[e-1]^t.charAt(i).charCodeAt(0),s=e-1;s>0;s--)f!==0&&o[s]!==0?a[s]=a[s-1]^ln[(Je[f]+Je[o[s]])%255]:a[s]=a[s-1];f!==0&&o[0]!==0?a[0]=ln[(Je[f]+Je[o[0]])%255]:a[0]=0}for(var u=[],i=0;i<e;i++)u[i]=a[e-i-1];return u.map(function(c){return String.fromCharCode(c)}).join("")},r})(),Ar=Ls;var dn=(function(){function r(){}return r.prototype.getEncodingMode=function(){return X},r.prototype.encode=function(t){var e=U.determineConsecutiveDigitCount(t.getMessage(),t.pos);if(e>=2)t.writeCodeword(this.encodeASCIIDigits(t.getMessage().charCodeAt(t.pos),t.getMessage().charCodeAt(t.pos+1))),t.pos+=2;else{var n=t.getCurrentChar(),i=U.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(i!==this.getEncodingMode())switch(i){case At:t.writeCodeword(Ti),t.signalEncoderChange(At);return;case mt:t.writeCodeword(yr),t.signalEncoderChange(mt);return;case pt:t.writeCodeword(bi),t.signalEncoderChange(pt);break;case _t:t.writeCodeword(Pi),t.signalEncoderChange(_t);break;case gt:t.writeCodeword(Mi),t.signalEncoderChange(gt);break;default:throw new Error("Illegal mode: "+i)}else U.isExtendedASCII(n)?(t.writeCodeword(Di),t.writeCodeword(n-128+1),t.pos++):(t.writeCodeword(n+1),t.pos++)}},r.prototype.encodeASCIIDigits=function(t,e){if(U.isDigit(t)&&U.isDigit(e)){var n=(t-48)*10+(e-48);return n+130}throw new Error("not digits: "+t+e)},r})();var pn=(function(){function r(){}return r.prototype.getEncodingMode=function(){return At},r.prototype.encode=function(t){var e=new P;for(e.append(0);t.hasMoreCharacters();){var n=t.getCurrentChar();e.append(n),t.pos++;var i=U.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(i!==this.getEncodingMode()){t.signalEncoderChange(X);break}}var o=e.length()-1,a=1,f=t.getCodewordCount()+o+a;t.updateSymbolInfo(f);var s=t.getSymbolInfo().getDataCapacity()-f>0;if(t.hasMoreCharacters()||s)if(o<=249)e.setCharAt(0,F.getCharAt(o));else if(o<=1555)e.setCharAt(0,F.getCharAt(Math.floor(o/250)+249)),e.insert(1,F.getCharAt(o%250));else throw new Error("Message length not in valid ranges: "+o);for(var u=0,n=e.length();u<n;u++)t.writeCodeword(this.randomize255State(e.charAt(u).charCodeAt(0),t.getCodewordCount()+1))},r.prototype.randomize255State=function(t,e){var n=149*e%255+1,i=t+n;return i<=255?i:i-256},r})();var me=(function(){function r(){}return r.prototype.getEncodingMode=function(){return mt},r.prototype.encodeMaximal=function(t){for(var e=new P,n=0,i=t.pos,o=0;t.hasMoreCharacters();){var a=t.getCurrentChar();t.pos++,n=this.encodeChar(a,e),e.length()%3===0&&(i=t.pos,o=e.length())}if(o!==e.length()){var f=Math.floor(e.length()/3*2),s=Math.floor(t.getCodewordCount()+f+1);t.updateSymbolInfo(s);var u=t.getSymbolInfo().getDataCapacity()-s,c=Math.floor(e.length()%3);(c===2&&u!==2||c===1&&(n>3||u!==1))&&(t.pos=i)}e.length()>0&&t.writeCodeword(yr),this.handleEOD(t,e)},r.prototype.encode=function(t){for(var e=new P;t.hasMoreCharacters();){var n=t.getCurrentChar();t.pos++;var i=this.encodeChar(n,e),o=Math.floor(e.length()/3)*2,a=t.getCodewordCount()+o;t.updateSymbolInfo(a);var f=t.getSymbolInfo().getDataCapacity()-a;if(!t.hasMoreCharacters()){var s=new P;for(e.length()%3===2&&f!==2&&(i=this.backtrackOneCharacter(t,e,s,i));e.length()%3===1&&(i>3||f!==1);)i=this.backtrackOneCharacter(t,e,s,i);break}var u=e.length();if(u%3===0){var c=U.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(c!==this.getEncodingMode()){t.signalEncoderChange(X);break}}}this.handleEOD(t,e)},r.prototype.backtrackOneCharacter=function(t,e,n,i){var o=e.length(),a=e.toString().substring(0,o-i);e.setLengthToZero(),e.append(a),t.pos--;var f=t.getCurrentChar();return i=this.encodeChar(f,n),t.resetSymbolInfo(),i},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),i=e.length()%3,o=t.getCodewordCount()+n;t.updateSymbolInfo(o);var a=t.getSymbolInfo().getDataCapacity()-o;if(i===2){for(e.append("\0");e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(wr)}else if(a===1&&i===1){for(;e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(wr),t.pos--}else if(i===0){for(;e.length()>=3;)this.writeNextTriplet(t,e);(a>0||t.hasMoreCharacters())&&t.writeCodeword(wr)}else throw new Error("Unexpected case. Please report!");t.signalEncoderChange(X)},r.prototype.encodeChar=function(t,e){if(t===32)return e.append(3),1;if(t>=48&&t<=57)return e.append(t-48+4),1;if(t>=65&&t<=90)return e.append(t-65+14),1;if(t<32)return e.append(0),e.append(t),2;if(t<=47)return e.append(1),e.append(t-33),2;if(t<=64)return e.append(1),e.append(t-58+15),2;if(t<=95)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),n},r.prototype.encodeToCodewords=function(t){var e=1600*t.charCodeAt(0)+40*t.charCodeAt(1)+t.charCodeAt(2)+1,n=e/256,i=e%256,o=new P;return o.append(n),o.append(i),o.toString()},r})();var vn=(function(){function r(){}return r.prototype.getEncodingMode=function(){return gt},r.prototype.encode=function(t){for(var e=new P;t.hasMoreCharacters();){var n=t.getCurrentChar();this.encodeChar(n,e),t.pos++;var i=e.length();if(i>=4){t.writeCodewords(this.encodeToCodewords(e.toString()));var o=e.toString().substring(4);e.setLengthToZero(),e.append(o);var a=U.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(a!==this.getEncodingMode()){t.signalEncoderChange(X);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 i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),o=t.getRemainingCharacters();if(o>i&&(t.updateSymbolInfo(t.getCodewordCount()+1),i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount()),o<=i&&i<=2)return}if(n>4)throw new Error("Count must not exceed 4");var a=n-1,f=this.encodeToCodewords(e.toString()),s=!t.hasMoreCharacters(),u=s&&a<=2;if(a<=2){t.updateSymbolInfo(t.getCodewordCount()+a);var i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount();i>=3&&(u=!1,t.updateSymbolInfo(t.getCodewordCount()+f.length))}u?(t.resetSymbolInfo(),t.pos-=a):t.writeCodewords(f)}finally{t.signalEncoderChange(X)}},r.prototype.encodeChar=function(t,e){t>=32&&t<=63?e.append(t):t>=64&&t<=94?e.append(F.getCharAt(t-64)):U.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),i=e>=2?t.charAt(1).charCodeAt(0):0,o=e>=3?t.charAt(2).charCodeAt(0):0,a=e>=4?t.charAt(3).charCodeAt(0):0,f=(n<<18)+(i<<12)+(o<<6)+a,s=f>>16&255,u=f>>8&255,c=f&255,l=new P;return l.append(s),e>=2&&l.append(u),e>=3&&l.append(c),l.toString()},r})();var ks=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Us=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.")},Q=(function(){function r(t,e,n,i,o,a,f,s){f===void 0&&(f=0),s===void 0&&(s=0),this.rectangular=t,this.dataCapacity=e,this.errorCodewords=n,this.matrixWidth=i,this.matrixHeight=o,this.dataRegions=a,this.rsBlockData=f,this.rsBlockError=s}return r.lookup=function(t,e,n,i,o){var a,f;e===void 0&&(e=0),n===void 0&&(n=null),i===void 0&&(i=null),o===void 0&&(o=!0);try{for(var s=Us(Vs),u=s.next();!u.done;u=s.next()){var c=u.value;if(!(e===1&&c.rectangular)&&!(e===2&&!c.rectangular)&&!(n!=null&&(c.getSymbolWidth()<n.getWidth()||c.getSymbolHeight()<n.getHeight()))&&!(i!=null&&(c.getSymbolWidth()>i.getWidth()||c.getSymbolHeight()>i.getHeight()))&&t<=c.dataCapacity)return c}}catch(l){a={error:l}}finally{try{u&&!u.done&&(f=s.return)&&f.call(s)}finally{if(a)throw a.error}}if(o)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()+this.getHorizontalDataRegions()*2},r.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+this.getVerticalDataRegions()*2},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})(),be=Q,Hs=(function(r){ks(t,r);function t(){return r.call(this,!1,1558,620,22,22,36,-1,62)||this}return t.prototype.getInterleavedBlockCount=function(){return 10},t.prototype.getDataLengthForInterleavedBlock=function(e){return e<=8?156:155},t})(Q),Vs=[new Q(!1,3,5,8,8,1),new Q(!1,5,7,10,10,1),new Q(!0,5,7,16,6,1),new Q(!1,8,10,12,12,1),new Q(!0,10,11,14,6,2),new Q(!1,12,12,14,14,1),new Q(!0,16,14,24,10,1),new Q(!1,18,14,16,16,1),new Q(!1,22,18,18,18,1),new Q(!0,22,18,16,10,2),new Q(!1,30,20,20,20,1),new Q(!0,32,24,16,14,2),new Q(!1,36,24,22,22,1),new Q(!1,44,28,24,24,1),new Q(!0,49,28,22,14,2),new Q(!1,62,36,14,14,4),new Q(!1,86,42,16,16,4),new Q(!1,114,48,18,18,4),new Q(!1,144,56,20,20,4),new Q(!1,174,68,22,22,4),new Q(!1,204,84,24,24,4,102,42),new Q(!1,280,112,14,14,16,140,56),new Q(!1,368,144,16,16,16,92,36),new Q(!1,456,192,18,18,16,114,48),new Q(!1,576,224,20,20,16,144,56),new Q(!1,696,272,22,22,16,174,68),new Q(!1,816,336,24,24,16,136,56),new Q(!1,1050,408,18,18,36,175,68),new Q(!1,1304,496,20,20,36,163,62),new Hs];var xn=(function(){function r(t){this.msg=t,this.pos=0,this.skipAtEnd=0;for(var e=t.split("").map(function(f){return f.charCodeAt(0)}),n=new P,i=0,o=e.length;i<o;i++){var a=String.fromCharCode(e[i]&255);if(a==="?"&&t.charAt(i)!=="?")throw new Error("Message contains characters outside ISO-8859-1 encoding.");n.append(a)}this.msg=n.toString(),this.shape=0,this.codewords=new P,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=be.lookup(t,this.shape,this.minSize,this.maxSize,!0))},r.prototype.resetSymbolInfo=function(){this.symbolInfo=null},r})();var Gs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),gn=(function(r){Gs(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return pt},t.prototype.encode=function(e){for(var n=new P;e.hasMoreCharacters();){var i=e.getCurrentChar();e.pos++,this.encodeChar(i,n);var o=n.length();if(o%3===0){this.writeNextTriplet(e,n);var a=U.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(a!==this.getEncodingMode()){e.signalEncoderChange(X);break}}}this.handleEOD(e,n)},t.prototype.encodeChar=function(e,n){switch(e){case 13:n.append(0);break;case 42:n.append(1);break;case 62:n.append(2);break;case 32:n.append(3);break;default:e>=48&&e<=57?n.append(e-48+4):e>=65&&e<=90?n.append(e-65+14):U.illegalCharacter(F.getCharAt(e));break}return 1},t.prototype.handleEOD=function(e,n){e.updateSymbolInfo();var i=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),o=n.length();e.pos-=o,(e.getRemainingCharacters()>1||i>1||e.getRemainingCharacters()!==i)&&e.writeCodeword(Bi),e.getNewEncoding()<0&&e.signalEncoderChange(X)},t})(me);var Ws=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),mn=(function(r){Ws(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return _t},t.prototype.encodeChar=function(e,n){if(e===32)return n.append(3),1;if(e>=48&&e<=57)return n.append(e-48+4),1;if(e>=97&&e<=122)return n.append(e-97+14),1;if(e<32)return n.append(0),n.append(e),2;if(e<=47)return n.append(1),n.append(e-33),2;if(e<=64)return n.append(1),n.append(e-58+15),2;if(e>=91&&e<=95)return n.append(1),n.append(e-91+22),2;if(e===96)return n.append(2),n.append(0),2;if(e<=90)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 i=2;return i+=this.encodeChar(e-128,n),i},t})(me);var Xs=(function(){function r(){}return r.randomize253State=function(t){var e=149*t%253+1,n=hn+e;return n<=254?n:n-254},r.encodeHighLevel=function(t,e,n,i,o){e===void 0&&(e=0),n===void 0&&(n=null),i===void 0&&(i=null),o===void 0&&(o=!1);var a=new me,f=[new dn,a,new mn,new gn,new vn,new pn],s=new xn(t);s.setSymbolShape(e),s.setSizeConstraints(n,i),t.startsWith(De)&&t.endsWith(Ne)?(s.writeCodeword(Ri),s.setSkipAtEnd(2),s.pos+=De.length):t.startsWith(Re)&&t.endsWith(Ne)&&(s.writeCodeword(Ni),s.setSkipAtEnd(2),s.pos+=Re.length);var u=X;for(o&&(a.encodeMaximal(s),u=s.getNewEncoding(),s.resetEncoderSignal());s.hasMoreCharacters();)f[u].encode(s),s.getNewEncoding()>=0&&(u=s.getNewEncoding(),s.resetEncoderSignal());var c=s.getCodewordCount();s.updateSymbolInfo();var l=s.getSymbolInfo().getDataCapacity();c<l&&u!==X&&u!==At&&u!==gt&&s.writeCodeword("\xFE");var h=s.getCodewords();for(h.length()<l&&h.append(hn);h.length()<l;)h.append(this.randomize253State(h.length()+1));return s.getCodewords().toString()},r.lookAheadTest=function(t,e,n){var i=this.lookAheadTestIntern(t,e,n);if(n===pt&&i===pt){for(var o=Math.min(e+3,t.length),a=e;a<o;a++)if(!this.isNativeX12(t.charCodeAt(a)))return X}else if(n===gt&&i===gt){for(var o=Math.min(e+4,t.length),a=e;a<o;a++)if(!this.isNativeEDIFACT(t.charCodeAt(a)))return X}return i},r.lookAheadTestIntern=function(t,e,n){if(e>=t.length)return n;var i;n===X?i=[0,1,1,1,1,1.25]:(i=[1,2,2,2,2,2.25],i[n]=0);for(var o=0,a=new Uint8Array(6),f=[];;){if(e+o===t.length){Y.fill(a,0),Y.fill(f,0);var s=this.findMinimums(i,f,M.MAX_VALUE,a),u=this.getMinimumCount(a);if(f[X]===s)return X;if(u===1){if(a[At]>0)return At;if(a[gt]>0)return gt;if(a[_t]>0)return _t;if(a[pt]>0)return pt}return mt}var c=t.charCodeAt(e+o);if(o++,this.isDigit(c)?i[X]+=.5:this.isExtendedASCII(c)?(i[X]=Math.ceil(i[X]),i[X]+=2):(i[X]=Math.ceil(i[X]),i[X]++),this.isNativeC40(c)?i[mt]+=2/3:this.isExtendedASCII(c)?i[mt]+=8/3:i[mt]+=4/3,this.isNativeText(c)?i[_t]+=2/3:this.isExtendedASCII(c)?i[_t]+=8/3:i[_t]+=4/3,this.isNativeX12(c)?i[pt]+=2/3:this.isExtendedASCII(c)?i[pt]+=13/3:i[pt]+=10/3,this.isNativeEDIFACT(c)?i[gt]+=3/4:this.isExtendedASCII(c)?i[gt]+=17/4:i[gt]+=13/4,this.isSpecialB256(c)?i[At]+=4:i[At]++,o>=4){if(Y.fill(a,0),Y.fill(f,0),this.findMinimums(i,f,M.MAX_VALUE,a),f[X]<this.min(f[At],f[mt],f[_t],f[pt],f[gt]))return X;if(f[At]<f[X]||f[At]+1<this.min(f[mt],f[_t],f[pt],f[gt]))return At;if(f[gt]+1<this.min(f[At],f[mt],f[_t],f[pt],f[X]))return gt;if(f[_t]+1<this.min(f[At],f[mt],f[gt],f[pt],f[X]))return _t;if(f[pt]+1<this.min(f[At],f[mt],f[gt],f[_t],f[X]))return pt;if(f[mt]+1<this.min(f[X],f[At],f[gt],f[_t])){if(f[mt]<f[pt])return mt;if(f[mt]===f[pt]){for(var l=e+o+1;l<t.length;){var h=t.charCodeAt(l);if(this.isX12TermSep(h))return pt;if(!this.isNativeX12(h))break;l++}return mt}}}}},r.min=function(t,e,n,i,o){var a=Math.min(t,Math.min(e,Math.min(n,i)));return o===void 0?a:Math.min(a,o)},r.findMinimums=function(t,e,n,i){for(var o=0;o<6;o++){var a=e[o]=Math.ceil(t[o]);n>a&&(n=a,Y.fill(i,0)),n===a&&(i[o]=i[o]+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>=48&&t<=57},r.isExtendedASCII=function(t){return t>=128&&t<=255},r.isNativeC40=function(t){return t===32||t>=48&&t<=57||t>=65&&t<=90},r.isNativeText=function(t){return t===32||t>=48&&t<=57||t>=97&&t<=122},r.isNativeX12=function(t){return this.isX12TermSep(t)||t===32||t>=48&&t<=57||t>=65&&t<=90},r.isX12TermSep=function(t){return t===13||t===42||t===62},r.isNativeEDIFACT=function(t){return t>=32&&t<=94},r.isSpecialB256=function(t){return!1},r.determineConsecutiveDigitCount=function(t,e){e===void 0&&(e=0);for(var n=t.length,i=e;i<n&&this.isDigit(t.charCodeAt(i));)i++;return i-e},r.illegalCharacter=function(t){var e=M.toHexString(t.charCodeAt(0));throw e="0000".substring(0,4-e.length)+e,new Error("Illegal character: "+t+" (0x"+e+")")},r})(),U=Xs;var yn=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){this.charset=t,this.name=t.name}return r.prototype.canEncode=function(t){try{return yt.encode(t,this.charset)!=null}catch{return!1}},r})(),Li=(function(){function r(t,e,n){var i,o,a,f,s,u;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(L){return new Fi(ge.forName(L))}),this.encoders=[];var c=[];c.push(new Fi(qe.ISO_8859_1));for(var l=e!=null&&e.name.startsWith("UTF"),h=0;h<t.length;h++){var d=!1;try{for(var p=(i=void 0,yn(c)),v=p.next();!v.done;v=p.next()){var g=v.value,y=t.charAt(h),m=y.charCodeAt(0);if(m===n||g.canEncode(y)){d=!0;break}}}catch(L){i={error:L}}finally{try{v&&!v.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}if(!d)try{for(var w=(a=void 0,yn(this.ENCODERS)),_=w.next();!_.done;_=w.next()){var g=_.value;if(g.canEncode(t.charAt(h))){c.push(g),d=!0;break}}}catch(L){a={error:L}}finally{try{_&&!_.done&&(f=w.return)&&f.call(w)}finally{if(a)throw a.error}}d||(l=!0)}if(c.length===1&&!l)this.encoders=[c[0]];else{this.encoders=[];var I=0;try{for(var T=yn(c),D=T.next();!D.done;D=T.next()){var g=D.value;this.encoders[I++]=g}}catch(L){s={error:L}}finally{try{D&&!D.done&&(u=T.return)&&u.call(T)}finally{if(s)throw s.error}}}var b=-1;if(e!=null){for(var h=0;h<this.encoders.length;h++)if(this.encoders[h]!=null&&e.name===this.encoders[h].name){b=h;break}}this.priorityEncoderIndex=b}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 yt.encode(F.getCharAt(t),this.encoders[e].name)},r})();var zs=3,Ui=(function(){function r(t,e,n){this.fnc1=n;var i=new Li(t,e,n);if(i.length()===1)for(var o=0;o<this.bytes.length;o++){var a=t.charAt(o).charCodeAt(0);this.bytes[o]=a===n?1e3:a}else this.bytes=this.encodeMinimally(t,i,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 P,i=t;i<e;i++){if(this.isECI(i))throw new Error("value at "+i+" is not a character but an ECI");n.append(this.charAt(i))}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,i,o,a){var f=t.charAt(i).charCodeAt(0),s=0,u=e.length();e.getPriorityEncoderIndex()>=0&&(f===a||e.canEncode(f,e.getPriorityEncoderIndex()))&&(s=e.getPriorityEncoderIndex(),u=s+1);for(var c=s;c<u;c++)(f===a||e.canEncode(f,c))&&this.addEdge(n,i+1,new ki(f,e,c,o,a))},r.prototype.encodeMinimally=function(t,e,n){var i=t.length,o=new ki[i+1][e.length()];this.addEdges(t,e,o,0,null,n);for(var a=1;a<=i;a++){for(var f=0;f<e.length();f++)o[a][f]!=null&&a<i&&this.addEdges(t,e,o,a,o[a][f],n);for(var f=0;f<e.length();f++)o[a-1][f]=null}for(var s=-1,u=M.MAX_VALUE,f=0;f<e.length();f++)if(o[i][f]!=null){var c=o[i][f];c.cachedTotalSize<u&&(u=c.cachedTotalSize,s=f)}if(s<0)throw new Error('Failed to encode "'+t+'"');for(var l=[],h=o[i][s];h!=null;){if(h.isFNC1())l.unshift(1e3);else for(var d=e.encode(h.c,h.encoderIndex),a=d.length-1;a>=0;a--)l.unshift(d[a]&255);var p=h.previous===null?0:h.previous.encoderIndex;p!==h.encoderIndex&&l.unshift(256+e.getECIValue(h.encoderIndex)),h=h.previous}for(var v=[],a=0;a<v.length;a++)v[a]=l[a];return v},r})();var ki=(function(){function r(t,e,n,i,o){this.c=t,this.encoderSet=e,this.encoderIndex=n,this.previous=i,this.fnc1=o,this.c=t===o?1e3:t;var a=this.isFNC1()?1:e.encode(t,n).length,f=i===null?0:i.encoderIndex;f!==n&&(a+=zs),i!=null&&(a+=i.cachedTotalSize),this.cachedTotalSize=a}return r.prototype.isFNC1=function(){return this.c===1e3},r})();var Zs=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}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.")},js=function(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(f){a={error:f}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(a)throw a.error}}return o},Ys=function(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(js(arguments[t]));return r},N;(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"})(N||(N={}));var Ks=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],It=(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,i;try{for(var o=$e(Ks),a=o.next();!a.done;a=o.next()){var f=a.value;if(f.charCodeAt(0)===t)return!0}}catch(s){n={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}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,i){e===void 0&&(e=null),n===void 0&&(n=-1),i===void 0&&(i=0);var o=0;return t.startsWith(De)&&t.endsWith(Ne)?(o=5,t=t.substring(De.length,t.length-2)):t.startsWith(Re)&&t.endsWith(Ne)&&(o=6,t=t.substring(Re.length,t.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,Ys(this.encode(t,e,n,i,o)))))},r.encode=function(t,e,n,i,o){return this.encodeMinimally(new qs(t,e,n,i,o)).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,i){for(var o=0,a=e;a<t.length();a++){if(t.isECI(a))return i[0]=0,0;var f=t.charAt(a);if(n&&U.isNativeC40(f)||!n&&U.isNativeText(f))o++;else if(!r.isExtendedASCII(f,t.getFNC1Character()))o+=2;else{var s=f&255;s>=128&&(n&&U.isNativeC40(s-128)||!n&&U.isNativeText(s-128))?o+=3:o+=4}if(o%3===0||(o-2)%3===0&&a+1===t.length())return i[0]=a-e+1,Math.ceil(o/3)}return i[0]=0,0},r.addEdges=function(t,e,n,i){var o,a;if(t.isECI(n)){this.addEdge(e,new kt(t,N.ASCII,n,1,i));return}var f=t.charAt(n);if(i===null||i.getEndMode()!==N.EDF){U.isDigit(f)&&t.haveNCharacters(n,2)&&U.isDigit(t.charAt(n+1))?this.addEdge(e,new kt(t,N.ASCII,n,2,i)):this.addEdge(e,new kt(t,N.ASCII,n,1,i));var s=[N.C40,N.TEXT];try{for(var u=$e(s),c=u.next();!c.done;c=u.next()){var l=c.value,h=[];r.getNumberOfC40Words(t,n,l===N.C40,h)>0&&this.addEdge(e,new kt(t,l,n,h[0],i))}}catch(v){o={error:v}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}t.haveNCharacters(n,3)&&U.isNativeX12(t.charAt(n))&&U.isNativeX12(t.charAt(n+1))&&U.isNativeX12(t.charAt(n+2))&&this.addEdge(e,new kt(t,N.X12,n,3,i)),this.addEdge(e,new kt(t,N.B256,n,1,i))}var d;for(d=0;d<3;d++){var p=n+d;if(t.haveNCharacters(p,1)&&U.isNativeEDIFACT(t.charAt(p)))this.addEdge(e,new kt(t,N.EDF,n,d+1,i));else break}d===3&&t.haveNCharacters(n,4)&&U.isNativeEDIFACT(t.charAt(n+3))&&this.addEdge(e,new kt(t,N.EDF,n,4,i))},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 i=1;i<=e;i++){for(var o=0;o<6;o++)n[i][o]!==null&&i<e&&this.addEdges(t,n,i,n[i][o]);for(var o=0;o<6;o++)n[i-1][o]=null}for(var a=-1,f=M.MAX_VALUE,o=0;o<6;o++)if(n[e][o]!==null){var s=n[e][o],u=o>=1&&o<=3?s.cachedTotalSize+1:s.cachedTotalSize;u<f&&(f=u,a=o)}if(a<0)throw new Error('Failed to encode "'+t+'"');return new Qs(n[e][a])},r})();var Qs=(function(){function r(t){var e=t.input,n=0,i=[],o=[],a=[];(t.mode===N.C40||t.mode===N.TEXT||t.mode===N.X12)&&t.getEndMode()!==N.ASCII&&(n+=this.prepend(kt.getBytes(254),i));for(var f=t;f!==null;)n+=this.prepend(f.getDataBytes(),i),(f.previous===null||f.getPreviousStartMode()!==f.getMode())&&(f.getMode()===N.B256&&(n<=249?(i.unshift(n),n++):(i.unshift(n%250),i.unshift(n/250+249),n+=2),o.push(i.length),a.push(n)),this.prepend(f.getLatchBytes(),i),n=0),f=f.previous;e.getMacroId()===5?n+=this.prepend(kt.getBytes(236),i):e.getMacroId()===6&&(n+=this.prepend(kt.getBytes(237),i)),e.getFNC1Character()>0&&(n+=this.prepend(kt.getBytes(232),i));for(var s=0;s<o.length;s++)this.applyRandomPattern(i,i.length-o[s],a[s]);var u=t.getMinSymbolSize(i.length);for(i.length<u&&i.push(129);i.length<u;)i.push(this.randomize253State(i.length+1));this.bytes=new Uint8Array(i.length);for(var s=0;s<this.bytes.length;s++)this.bytes[s]=i[s]}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=149*t%253+1,n=129+e;return n<=254?n:n-254},r.prototype.applyRandomPattern=function(t,e,n){for(var i=0;i<n;i++){var o=e+i,a=t[o]&255,f=149*(o+1)%255+1,s=a+f;t[o]=s<=255?s:s-256}},r.prototype.getBytes=function(){return this.bytes},r})(),kt=(function(){function r(t,e,n,i,o){if(this.input=t,this.mode=e,this.fromPosition=n,this.characterLength=i,this.previous=o,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+i<=t.length()))throw new Error("Invalid edge");var a=o!==null?o.cachedTotalSize:0,f=this.getPreviousMode();switch(e){case N.ASCII:a++,(t.isECI(n)||It.isExtendedASCII(t.charAt(n),t.getFNC1Character()))&&a++,(f===N.C40||f===N.TEXT||f===N.X12)&&a++;break;case N.B256:a++,(f!==N.B256||this.getB256Size()===250)&&a++,f===N.ASCII?a++:(f===N.C40||f===N.TEXT||f===N.X12)&&(a+=2);break;case N.C40:case N.TEXT:case N.X12:if(e===N.X12)a+=2;else{var s=[];a+=It.getNumberOfC40Words(t,n,e===N.C40,s)*2}f===N.ASCII||f===N.B256?a++:f!==e&&(f===N.C40||f===N.TEXT||f===N.X12)&&(a+=2);break;case N.EDF:a+=3,f===N.ASCII||f===N.B256?a++:(f===N.C40||f===N.TEXT||f===N.X12)&&(a+=2);break}this.cachedTotalSize=a}return r.prototype.getB256Size=function(){for(var t=0,e=this;e!==null&&e.mode===N.B256&&t<=250;)t++,e=e.previous;return t},r.prototype.getPreviousStartMode=function(){return this.previous===null?N.ASCII:this.previous.mode},r.prototype.getPreviousMode=function(){return this.previous===null?N.ASCII:this.previous.getEndMode()},r.prototype.getEndMode=function(){if(this.mode===N.EDF){if(this.characterLength<4)return N.ASCII;var t=this.getLastASCII();if(t>0&&this.getCodewordsRemaining(this.cachedTotalSize+t)<=2-t)return N.ASCII}if(this.mode===N.C40||this.mode===N.TEXT||this.mode===N.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&this.getCodewordsRemaining(this.cachedTotalSize)===0)return N.ASCII;var t=this.getLastASCII();if(t===1&&this.getCodewordsRemaining(this.cachedTotalSize+1)===0)return N.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?It.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?0:1:t-e===2?It.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())||It.isExtendedASCII(this.input.charAt(e+1),this.input.getFNC1Character())?0:U.isDigit(this.input.charAt(e))&&U.isDigit(this.input.charAt(e+1))?1:2:t-e===3?U.isDigit(this.input.charAt(e))&&U.isDigit(this.input.charAt(e+1))&&!It.isExtendedASCII(this.input.charAt(e+2),this.input.getFNC1Character())||U.isDigit(this.input.charAt(e+1))&&U.isDigit(this.input.charAt(e+2))&&!It.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?2:0:U.isDigit(this.input.charAt(e))&&U.isDigit(this.input.charAt(e+1))&&U.isDigit(this.input.charAt(e+2))&&U.isDigit(this.input.charAt(e+3))?2:0},r.prototype.getMinSymbolSize=function(t){var e,n,i,o,a,f;switch(this.input.getShapeHint()){case 1:try{for(var s=$e(this.squareCodewordCapacities),u=s.next();!u.done;u=s.next()){var c=u.value;if(c>=t)return c}}catch(v){e={error:v}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}break;case 2:try{for(var l=$e(this.rectangularCodewordCapacities),h=l.next();!h.done;h=l.next()){var c=h.value;if(c>=t)return c}}catch(v){i={error:v}}finally{try{h&&!h.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}break}try{for(var d=$e(this.allCodewordCapacities),p=d.next();!p.done;p=d.next()){var c=p.value;if(c>=t)return c}}catch(v){a={error:v}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}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,i,o){var a=1600*(n&255)+40*(i&255)+(o&255)+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&&It.isInC40Shift1Set(t)||!e&&It.isInTextShift1Set(t)?0:e&&It.isInC40Shift2Set(t,n)||!e&&It.isInTextShift2Set(t,n)?1:2},r.prototype.getC40Value=function(t,e,n,i){if(n===i){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=[],i=0;i<this.characterLength;i++){var o=this.input.charAt(this.fromPosition+i);if(t&&U.isNativeC40(o)||!t&&U.isNativeText(o))n.push(this.getC40Value(t,0,o,e));else if(It.isExtendedASCII(o,e)){var f=(o&255)-128;if(t&&U.isNativeC40(f)||!t&&U.isNativeText(f))n.push(1),n.push(30),n.push(this.getC40Value(t,0,f,e));else{n.push(1),n.push(30);var a=this.getShiftValue(f,t,e);n.push(a),n.push(this.getC40Value(t,a,f,e))}}else{var a=this.getShiftValue(o,t,e);n.push(a),n.push(this.getC40Value(t,a,o,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)}for(var s=new Uint8Array(n.length/3*2),u=0,i=0;i<n.length;i+=3)this.setC40Word(s,u,n[i]&255,n[i+1]&255,n[i+2]&255),u+=2;return s},r.prototype.getEDFBytes=function(){for(var t=Math.ceil(this.characterLength/4),e=new Uint8Array(t*3),n=this.fromPosition,i=Math.min(this.fromPosition+this.characterLength-1,this.input.length()-1),o=0;o<t;o+=3){for(var a=[],f=0;f<4;f++)n<=i?a[f]=this.input.charAt(n++)&63:a[f]=n===i+1?31:0;var s=a[0]<<18;s|=a[1]<<12,s|=a[2]<<6,s|=a[3],e[o]=s>>16&255,e[o+1]=s>>8&255,e[o+2]=s&255}return e},r.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case N.ASCII:case N.B256:switch(this.mode){case N.B256:return r.getBytes(231);case N.C40:return r.getBytes(230);case N.TEXT:return r.getBytes(239);case N.X12:return r.getBytes(238);case N.EDF:return r.getBytes(240)}break;case N.C40:case N.TEXT:case N.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case N.ASCII:return r.getBytes(254);case N.B256:return r.getBytes(254,231);case N.C40:return r.getBytes(254,230);case N.TEXT:return r.getBytes(254,239);case N.X12:return r.getBytes(254,238);case N.EDF:return r.getBytes(254,240)}break;case N.EDF:if(this.mode!==N.EDF)throw new Error("Cannot switch from EDF to "+this.mode);break}return new Uint8Array(0)},r.prototype.getDataBytes=function(){switch(this.mode){case N.ASCII:return this.input.isECI(this.fromPosition)?r.getBytes(241,this.input.getECIValue(this.fromPosition)+1):It.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?r.getBytes(235,this.input.charAt(this.fromPosition)-127):this.characterLength===2?r.getBytes(this.input.charAt(this.fromPosition)*10+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?r.getBytes(232):r.getBytes(this.input.charAt(this.fromPosition)+1);case N.B256:return r.getBytes(this.input.charAt(this.fromPosition));case N.C40:return this.getC40Words(!0,this.input.getFNC1Character());case N.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case N.X12:return this.getX12Words();case N.EDF:return this.getEDFBytes()}},r})(),qs=(function(r){Zs(t,r);function t(e,n,i,o,a){var f=r.call(this,e,n,i)||this;return f.shape=o,f.macroId=a,f}return t.prototype.getMacroId=function(){return this.macroId},t.prototype.getShapeHint=function(){return this.shape},t})(Ui);var EA=(function(){function r(){}return r.prototype.encode=function(t,e,n,i,o){if(o===void 0&&(o=null),t.trim()==="")throw new Error("Found empty contents");if(e!==C.DATA_MATRIX)throw new Error("Can only encode DATA_MATRIX, but got "+e);if(n<0||i<0)throw new Error("Requested dimensions can't be negative: "+n+"x"+i);var a=0,f=null,s=null;if(o!=null){var u=o.get(H.DATA_MATRIX_SHAPE);u!=null&&(a=u);var c=o.get(H.MIN_SIZE);c!=null&&(f=c);var l=o.get(H.MAX_SIZE);l!=null&&(s=l)}var h,d=o!=null&&o.has(H.DATA_MATRIX_COMPACT)&&!!o.get(H.DATA_MATRIX_COMPACT).toString();if(d){var p=o.has(H.GS1_FORMAT)&&!!o.get(H.GS1_FORMAT).toString(),v=null,g=o.has(H.CHARACTER_SET);g&&(v=ge.forName(o.get(H.CHARACTER_SET).toString())),h=It.encodeHighLevel(t,v,p?29:-1,a)}else{var y=o!=null&&o.has(H.FORCE_C40)&&!!o.get(H.FORCE_C40).toString();h=U.encodeHighLevel(t,a,f,s,y)}var m=be.lookup(h.length,a,f,s,!0),w=Ar.encodeECC200(h,m),_=new mr(w,m.getSymbolDataWidth(),m.getSymbolDataHeight());return _.place(),this.encodeLowLevel(_,m,n,i)},r.prototype.encodeLowLevel=function(t,e,n,i){for(var o=e.getSymbolDataWidth(),a=e.getSymbolDataHeight(),f=new Qe(e.getSymbolWidth(),e.getSymbolHeight()),s=0,u=0;u<a;u++){var c=void 0;if(u%e.matrixHeight===0){c=0;for(var l=0;l<e.getSymbolWidth();l++)f.setBoolean(c,s,l%2===0),c++;s++}c=0;for(var l=0;l<o;l++)l%e.matrixWidth===0&&(f.setBoolean(c,s,!0),c++),f.setBoolean(c,s,t.getBit(l,u)),c++,l%e.matrixWidth===e.matrixWidth-1&&(f.setBoolean(c,s,u%2===0),c++);if(s++,u%e.matrixHeight===e.matrixHeight-1){c=0;for(var l=0;l<e.getSymbolWidth();l++)f.setBoolean(c,s,!0),c++;s++}}return this.convertByteMatrixToBitMatrix(f,n,i)},r.prototype.convertByteMatrixToBitMatrix=function(t,e,n){var i=t.getWidth(),o=t.getHeight(),a=Math.max(e,i),f=Math.max(n,o),s=Math.min(a/i,f/o),u=(a-i*s)/2,c=(f-o*s)/2,l;n<o||e<i?(u=0,c=0,l=new at(i,o)):l=new at(e,n),l.clear();for(var h=0,d=c;h<o;h++,d+=s)for(var p=0,v=u;p<i;p++,v+=s)t.get(p,h)===1&&l.setRegion(v,d,s,s);return l},r})();var Js=(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})(),wn=Js;var $s=(function(){function r(){}return r.singletonList=function(t){return[t]},r.min=function(t,e){return t.sort(e)[0]},r})(),An=$s;var t0=(function(){function r(t){this.previous=t}return r.prototype.getPrevious=function(){return this.previous},r})(),Hi=t0;var e0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),r0=(function(r){e0(t,r);function t(e,n,i){var o=r.call(this,e)||this;return o.value=n,o.bitCount=i,o}return 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,"<"+M.toBinaryString(e|1<<this.bitCount).substring(1)+">"},t})(Hi),Pe=r0;var n0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),i0=(function(r){n0(t,r);function t(e,n,i){var o=r.call(this,e,0,0)||this;return o.binaryShiftStart=n,o.binaryShiftByteCount=i,o}return t.prototype.appendTo=function(e,n){for(var i=0;i<this.binaryShiftByteCount;i++)(i===0||i===31&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?e.appendBits(this.binaryShiftByteCount-31,16):i===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(n[this.binaryShiftStart+i],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})(Pe),Vi=i0;function Gi(r,t,e){return new Vi(r,t,e)}function Me(r,t,e){return new Pe(r,t,e)}var Wi=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Gt=0,Be=1,St=2,Er=3,bt=4,Xi=new Pe(null,0,0);var Cr=[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])];var f0=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 s0(r){var t,e;try{for(var n=f0(r),i=n.next();!i.done;i=n.next()){var o=i.value;Y.fill(o,-1)}}catch(a){t={error:a}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r[Gt][bt]=0,r[Be][bt]=0,r[Be][Gt]=28,r[Er][bt]=0,r[St][bt]=0,r[St][Gt]=15,r}var Ir=s0(Y.createInt32Array(6,6));var u0=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.")},c0=(function(){function r(t,e,n,i){this.token=t,this.mode=e,this.binaryShiftByteCount=n,this.bitCount=i}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,i=this.token;if(t!==this.mode){var o=Cr[this.mode][t];i=Me(i,o&65535,o>>16),n+=o>>16}var a=t===St?4:5;return i=Me(i,e,a),new r(i,t,0,n+a)},r.prototype.shiftAndAppend=function(t,e){var n=this.token,i=this.mode===St?4:5;return n=Me(n,Ir[this.mode][t],i),n=Me(n,e,5),new r(n,this.mode,0,this.bitCount+i+5)},r.prototype.addBinaryShiftChar=function(t){var e=this.token,n=this.mode,i=this.bitCount;if(this.mode===bt||this.mode===St){var o=Cr[n][Gt];e=Me(e,o&65535,o>>16),i+=o>>16,n=Gt}var a=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,f=new r(e,n,this.binaryShiftByteCount+1,i+a);return f.binaryShiftByteCount===2078&&(f=f.endBinaryShift(t+1)),f},r.prototype.endBinaryShift=function(t){if(this.binaryShiftByteCount===0)return this;var e=this.token;return e=Gi(e,t-this.binaryShiftByteCount,this.binaryShiftByteCount),new r(e,this.mode,0,this.bitCount)},r.prototype.isBetterThanOrEqualTo=function(t){var e=this.bitCount+(Cr[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,i=[],o=this.endBinaryShift(t.length).token;o!==null;o=o.getPrevious())i.unshift(o);var a=new it;try{for(var f=u0(i),s=f.next();!s.done;s=f.next()){var u=s.value;u.appendTo(a,t)}}catch(c){e={error:c}}finally{try{s&&!s.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}return a},r.prototype.toString=function(){return F.format("%s bits=%d bytes=%d",Wi[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(Xi,Gt,0,0),r})(),Zi=c0;function l0(r){var t=F.getCharCode(" "),e=F.getCharCode("."),n=F.getCharCode(",");r[Gt][t]=1;for(var i=F.getCharCode("Z"),o=F.getCharCode("A"),a=o;a<=i;a++)r[Gt][a]=a-o+2;r[Be][t]=1;for(var f=F.getCharCode("z"),s=F.getCharCode("a"),a=s;a<=f;a++)r[Be][a]=a-s+2;r[St][t]=1;for(var u=F.getCharCode("9"),c=F.getCharCode("0"),a=c;a<=u;a++)r[St][a]=a-c+2;r[St][n]=12,r[St][e]=13;for(var l=["\0"," ","","","","","","","\x07","\b"," ",`
19
+ `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~","\x7F"],h=0;h<l.length;h++)r[Er][F.getCharCode(l[h])]=h;for(var d=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"],h=0;h<d.length;h++)F.getCharCode(d[h])>0&&(r[bt][F.getCharCode(d[h])]=h);return r}var Sr=l0(Y.createInt32Array(5,256));var Or=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.")},d0=(function(){function r(t){this.text=t}return r.prototype.encode=function(){for(var t=F.getCharCode(" "),e=F.getCharCode(`
20
+ `),n=An.singletonList(Zi.INITIAL_STATE),i=0;i<this.text.length;i++){var o=void 0,a=i+1<this.text.length?this.text[i+1]:0;switch(this.text[i]){case F.getCharCode("\r"):o=a===e?2:0;break;case F.getCharCode("."):o=a===t?3:0;break;case F.getCharCode(","):o=a===t?4:0;break;case F.getCharCode(":"):o=a===t?5:0;break;default:o=0}o>0?(n=r.updateStateListForPair(n,i,o),i++):n=this.updateStateListForChar(n,i)}var f=An.min(n,function(s,u){return s.getBitCount()-u.getBitCount()});return f.toBitArray(this.text)},r.prototype.updateStateListForChar=function(t,e){var n,i,o=[];try{for(var a=Or(t),f=a.next();!f.done;f=a.next()){var s=f.value;this.updateStateForChar(s,e,o)}}catch(u){n={error:u}}finally{try{f&&!f.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return r.simplifyStates(o)},r.prototype.updateStateForChar=function(t,e,n){for(var i=this.text[e]&255,o=Sr[t.getMode()][i]>0,a=null,f=0;f<=bt;f++){var s=Sr[f][i];if(s>0){if(a==null&&(a=t.endBinaryShift(e)),!o||f===t.getMode()||f===St){var u=a.latchAndAppend(f,s);n.push(u)}if(!o&&Ir[t.getMode()][f]>=0){var c=a.shiftAndAppend(f,s);n.push(c)}}}if(t.getBinaryShiftByteCount()>0||Sr[t.getMode()][i]===0){var l=t.addBinaryShiftChar(e);n.push(l)}},r.updateStateListForPair=function(t,e,n){var i,o,a=[];try{for(var f=Or(t),s=f.next();!s.done;s=f.next()){var u=s.value;this.updateStateForPair(u,e,n,a)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}return this.simplifyStates(a)},r.updateStateForPair=function(t,e,n,i){var o=t.endBinaryShift(e);if(i.push(o.latchAndAppend(bt,n)),t.getMode()!==bt&&i.push(o.shiftAndAppend(bt,n)),n===3||n===4){var a=o.latchAndAppend(St,16-n).latchAndAppend(St,1);i.push(a)}if(t.getBinaryShiftByteCount()>0){var f=t.addBinaryShiftChar(e).addBinaryShiftChar(e+1);i.push(f)}},r.simplifyStates=function(t){var e,n,i,o,a=[];try{for(var f=Or(t),s=f.next();!s.done;s=f.next()){var u=s.value,c=!0,l=function(g){if(g.isBetterThanOrEqualTo(u))return c=!1,"break";u.isBetterThanOrEqualTo(g)&&(a=a.filter(function(y){return y!==g}))};try{for(var h=(i=void 0,Or(a)),d=h.next();!d.done;d=h.next()){var p=d.value,v=l(p);if(v==="break")break}}catch(g){i={error:g}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}c&&a.push(u)}}catch(g){e={error:g}}finally{try{s&&!s.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}return a},r})(),En=d0;var p0=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.")},v0=(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 i=new En(t).encode(),o=M.truncDivision(i.getSize()*e,100)+11,a=i.getSize()+o,f,s,u,c,l;if(n!==r.DEFAULT_AZTEC_LAYERS){if(f=n<0,s=Math.abs(n),s>(f?r.MAX_NB_BITS_COMPACT:r.MAX_NB_BITS))throw new O(F.format("Illegal value %s for layers",n));u=r.totalBitsInLayer(s,f),c=r.WORD_SIZE[s];var h=u-u%c;if(l=r.stuffBits(i,c),l.getSize()+o>h)throw new O("Data to large for user specified layer");if(f&&l.getSize()>c*64)throw new O("Data to large for user specified layer")}else{c=0,l=null;for(var d=0;;d++){if(d>r.MAX_NB_BITS)throw new O("Data too large for an Aztec code");if(f=d<=3,s=f?d+1:d,u=r.totalBitsInLayer(s,f),!(a>u)){(l==null||c!==r.WORD_SIZE[s])&&(c=r.WORD_SIZE[s],l=r.stuffBits(i,c));var h=u-u%c;if(!(f&&l.getSize()>c*64)&&l.getSize()+o<=h)break}}}var p=r.generateCheckWords(l,u,c),v=l.getSize()/c,g=r.generateModeMessage(f,s,v),y=(f?11:14)+s*4,m=new Int32Array(y),w;if(f){w=y;for(var d=0;d<m.length;d++)m[d]=d}else{w=y+1+2*M.truncDivision(M.truncDivision(y,2)-1,15);for(var _=M.truncDivision(y,2),I=M.truncDivision(w,2),d=0;d<_;d++){var T=d+M.truncDivision(d,15);m[_-d-1]=I-T-1,m[_+d]=I+T+1}}for(var D=new at(w),d=0,b=0;d<s;d++){for(var L=(s-d)*4+(f?9:12),B=0;B<L;B++)for(var vt=B*2,z=0;z<2;z++)p.get(b+vt+z)&&D.set(m[d*2+z],m[d*2+B]),p.get(b+L*2+vt+z)&&D.set(m[d*2+B],m[y-1-d*2-z]),p.get(b+L*4+vt+z)&&D.set(m[y-1-d*2-z],m[y-1-d*2-B]),p.get(b+L*6+vt+z)&&D.set(m[y-1-d*2-B],m[d*2+z]);b+=L*8}if(r.drawModeMessage(D,f,w,g),f)r.drawBullsEye(D,M.truncDivision(w,2),5);else{r.drawBullsEye(D,M.truncDivision(w,2),7);for(var d=0,B=0;d<M.truncDivision(y,2)-1;d+=15,B+=16)for(var z=M.truncDivision(w,2)&1;z<w;z+=2)D.set(M.truncDivision(w,2)-B,z),D.set(M.truncDivision(w,2)+B,z),D.set(z,M.truncDivision(w,2)-B),D.set(z,M.truncDivision(w,2)+B)}var ut=new wn;return ut.setCompact(f),ut.setSize(w),ut.setLayers(s),ut.setCodeWords(v),ut.setMatrix(D),ut},r.drawBullsEye=function(t,e,n){for(var i=0;i<n;i+=2)for(var o=e-i;o<=e+i;o++)t.set(o,e-i),t.set(o,e+i),t.set(e-i,o),t.set(e+i,o);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 i=new it;return t?(i.appendBits(e-1,2),i.appendBits(n-1,6),i=r.generateCheckWords(i,28,4)):(i.appendBits(e-1,5),i.appendBits(n-1,11),i=r.generateCheckWords(i,40,4)),i},r.drawModeMessage=function(t,e,n,i){var o=M.truncDivision(n,2);if(e)for(var a=0;a<7;a++){var f=o-3+a;i.get(a)&&t.set(f,o-5),i.get(a+7)&&t.set(o+5,f),i.get(20-a)&&t.set(f,o+5),i.get(27-a)&&t.set(o-5,f)}else for(var a=0;a<10;a++){var f=o-5+a+M.truncDivision(a,5);i.get(a)&&t.set(f,o-7),i.get(a+10)&&t.set(o+7,f),i.get(29-a)&&t.set(f,o+7),i.get(39-a)&&t.set(o-7,f)}},r.generateCheckWords=function(t,e,n){var i,o,a=t.getSize()/n,f=new Ke(r.getGF(n)),s=M.truncDivision(e,n),u=r.bitsToWords(t,n,s);f.encode(u,s-a);var c=e%n,l=new it;l.appendBits(0,c);try{for(var h=p0(Array.from(u)),d=h.next();!d.done;d=h.next()){var p=d.value;l.appendBits(p,n)}}catch(v){i={error:v}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}return l},r.bitsToWords=function(t,e,n){var i=new Int32Array(n),o,a;for(o=0,a=t.getSize()/e;o<a;o++){for(var f=0,s=0;s<e;s++)f|=t.get(o*e+s)?1<<e-s-1:0;i[o]=f}return i},r.getGF=function(t){switch(t){case 4:return dt.AZTEC_PARAM;case 6:return dt.AZTEC_DATA_6;case 8:return dt.AZTEC_DATA_8;case 10:return dt.AZTEC_DATA_10;case 12:return dt.AZTEC_DATA_12;default:throw new O("Unsupported word size "+t)}},r.stuffBits=function(t,e){for(var n=new it,i=t.getSize(),o=(1<<e)-2,a=0;a<i;a+=e){for(var f=0,s=0;s<e;s++)(a+s>=i||t.get(a+s))&&(f|=1<<e-1-s);(f&o)===o?(n.appendBits(f&o,e),a--):(f&o)===0?(n.appendBits(f|1,e),a--):n.appendBits(f,e)}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})(),tr=v0;var lE=(function(){function r(){}return r.prototype.encode=function(t,e,n,i){return this.encodeWithHints(t,e,n,i,null)},r.prototype.encodeWithHints=function(t,e,n,i,o){var a=qe.ISO_8859_1,f=tr.DEFAULT_EC_PERCENT,s=tr.DEFAULT_AZTEC_LAYERS;return o!=null&&(o.has(H.CHARACTER_SET)&&(a=ge.forName(o.get(H.CHARACTER_SET).toString())),o.has(H.ERROR_CORRECTION)&&(f=M.parseInt(o.get(H.ERROR_CORRECTION).toString())),o.has(H.AZTEC_LAYERS)&&(s=M.parseInt(o.get(H.AZTEC_LAYERS).toString()))),r.encodeLayers(t,e,n,i,a,f,s)},r.encodeLayers=function(t,e,n,i,o,a,f){if(e!==C.AZTEC)throw new O("Can only encode AZTEC, but got "+e);var s=tr.encode(F.getBytes(t,o),a,f);return r.renderResult(s,n,i)},r.renderResult=function(t,e,n){var i=t.getMatrix();if(i==null)throw new xt;for(var o=i.getWidth(),a=i.getHeight(),f=Math.max(e,o),s=Math.max(n,a),u=Math.min(f/o,s/a),c=(f-o*u)/2,l=(s-a*u)/2,h=new at(f,s),d=0,p=l;d<a;d++,p+=u)for(var v=0,g=c;v<o;v++,g+=u)i.get(v,d)&&h.setRegion(g,p,u,u);return h},r})();var x0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),ji=(function(r){x0(t,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 t.makeBufferFromCanvasImageData=function(e){var n;try{n=e.getContext("2d",{willReadFrequently:!0})}catch{n=e.getContext("2d")}if(!n)throw new Error("Couldn't get canvas context.");var i=n.getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(i.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,n,i){for(var o=new Uint8ClampedArray(n*i),a=0,f=0,s=e.length;a<s;a+=4,f++){var u=void 0,c=e[a+3];if(c===0)u=255;else{var l=e[a],h=e[a+1],d=e[a+2];u=306*l+601*h+117*d+512>>10}o[f]=u}return o},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new O("Requested row is outside the image: "+e);var i=this.getWidth(),o=e*i;return n===null?n=this.buffer.slice(o,o+i):(n.length<i&&(n=new Uint8ClampedArray(i)),n.set(this.buffer.slice(o,o+i))),n},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,i,o){return r.prototype.crop.call(this,e,n,i,o),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.invert=function(){return new zt(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();if(!n)throw new Error("Could not create a Canvas element.");var i=e*t.DEGREE_TO_RADIANS,o=this.canvas.width,a=this.canvas.height,f=Math.ceil(Math.abs(Math.cos(i))*o+Math.abs(Math.sin(i))*a),s=Math.ceil(Math.abs(Math.sin(i))*o+Math.abs(Math.cos(i))*a);n.width=f,n.height=s;var u=n.getContext("2d");if(!u)throw new Error("Could not create a Canvas Context element.");return u.translate(f/2,s/2),u.rotate(i),u.drawImage(this.canvas,o/-2,a/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.DEGREE_TO_RADIANS=Math.PI/180,t})(Ht);function _n(){return typeof navigator<"u"}function g0(){return _n()&&!!navigator.mediaDevices}function Yi(){return!!(g0()&&navigator.mediaDevices.enumerateDevices)}var Fe=function(){return Fe=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},Fe.apply(this,arguments)},lt=function(r,t,e,n){function i(o){return o instanceof e?o:new e(function(a){a(o)})}return new(e||(e=Promise))(function(o,a){function f(c){try{u(n.next(c))}catch(l){a(l)}}function s(c){try{u(n.throw(c))}catch(l){a(l)}}function u(c){c.done?o(c.value):i(c.value).then(f,s)}u((n=n.apply(r,t||[])).next())})},ht=function(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(u){return function(c){return s([u,c])}}function s(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){e.label=u[1];break}if(u[0]===6&&e.label<o[1]){e.label=o[1],o=u;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(u);break}o[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(c){u=[6,c],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Cn=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.")},m0={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},Ut=(function(){function r(t,e,n){e===void 0&&(e=new Map),n===void 0&&(n={}),this.reader=t,this.hints=e,this.options=Fe(Fe({},m0),n)}return Object.defineProperty(r.prototype,"possibleFormats",{set:function(t){this.hints.set(k.POSSIBLE_FORMATS,t)},enumerable:!1,configurable:!0}),r.addVideoSource=function(t,e){try{t.srcObject=e}catch{console.error("got interrupted by new loading request")}},r.mediaStreamSetTorch=function(t,e){return lt(this,void 0,void 0,function(){return ht(this,function(n){switch(n.label){case 0:return[4,t.applyConstraints({advanced:[{fillLightMode:e?"flash":"off",torch:!!e}]})];case 1:return n.sent(),[2]}})})},r.mediaStreamIsTorchCompatible=function(t){var e,n,i=t.getVideoTracks();try{for(var o=Cn(i),a=o.next();!a.done;a=o.next()){var f=a.value;if(r.mediaStreamIsTorchCompatibleTrack(f))return!0}}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return!1},r.mediaStreamIsTorchCompatibleTrack=function(t){try{var e=t.getCapabilities();return"torch"in e}catch(n){return console.error(n),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},r.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&t.readyState>2},r.getMediaElement=function(t,e){var n=document.getElementById(t);if(!n)throw new st("element with id '".concat(t,"' not found"));if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new st("element with id '".concat(t,"' must be an ").concat(e," element"));return n},r.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if(typeof t=="string")return r.getMediaElement(t,"video");if(!t&&typeof document<"u"){var e=document.createElement("video");return e.width=200,e.height=200,e}throw new Error("Couldn't get videoElement from videoSource!")},r.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if(typeof t=="string")return r.getMediaElement(t,"img");if(typeof t>"u"){var e=document.createElement("img");return e.width=200,e.height=200,e}throw new Error("Couldn't get imageElement from imageSource!")},r.prepareVideoElement=function(t){var e=r.createVideoElement(t);return e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},r.isImageLoaded=function(t){return!(!t.complete||t.naturalWidth===0)},r.createBinaryBitmapFromCanvas=function(t){var e=new ji(t),n=new ke(e);return new Le(n)},r.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)},r.getMediaElementDimensions=function(t){if(t instanceof HTMLVideoElement)return{height:t.videoHeight,width:t.videoWidth};if(t instanceof HTMLImageElement)return{height:t.naturalHeight||t.height,width:t.naturalWidth||t.width};throw new Error("Couldn't find the Source's dimensions!")},r.createCaptureCanvas=function(t){if(!t)throw new st("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var e=document.createElement("canvas"),n=r.getMediaElementDimensions(t),i=n.width,o=n.height;return e.style.width=i+"px",e.style.height=o+"px",e.width=i,e.height=o,e},r.tryPlayVideo=function(t){return lt(this,void 0,void 0,function(){var e;return ht(this,function(n){switch(n.label){case 0:if(t?.ended)return console.error("Trying to play video that has ended."),[2,!1];if(r.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[2,!0];case 3:return e=n.sent(),console.warn("It was not possible to play the video.",e),[2,!1];case 4:return[2]}})})},r.createCanvasFromMediaElement=function(t){var e=r.createCaptureCanvas(t),n=e.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return r.drawImageOnCanvas(n,t),e},r.createBinaryBitmapFromMediaElem=function(t){var e=r.createCanvasFromMediaElement(t);return r.createBinaryBitmapFromCanvas(e)},r.destroyImageElement=function(t){t.src="",t.removeAttribute("src"),t=void 0},r.listVideoInputDevices=function(){return lt(this,void 0,void 0,function(){var t,e,n,i,o,a,f,s,u,c,l,h;return ht(this,function(d){switch(d.label){case 0:if(!_n())throw new Error("Can't enumerate devices, navigator is not present.");if(!Yi())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=d.sent(),e=[];try{for(n=Cn(t),i=n.next();!i.done;i=n.next())o=i.value,a=o.kind==="video"?"videoinput":o.kind,a==="videoinput"&&(f=o.deviceId||o.id,s=o.label||"Video device ".concat(e.length+1),u=o.groupId,c={deviceId:f,label:s,kind:a,groupId:u},e.push(c))}catch(p){l={error:p}}finally{try{i&&!i.done&&(h=n.return)&&h.call(n)}finally{if(l)throw l.error}}return[2,e]}})})},r.findDeviceById=function(t){return lt(this,void 0,void 0,function(){var e;return ht(this,function(n){switch(n.label){case 0:return[4,r.listVideoInputDevices()];case 1:return e=n.sent(),e?[2,e.find(function(i){return i.deviceId===t})]:[2]}})})},r.cleanVideoSource=function(t){if(t){try{t.srcObject=null}catch{t.src=""}t&&t.removeAttribute("src")}},r.releaseAllStreams=function(){r.streamTracker.length!==0&&r.streamTracker.forEach(function(t){t.getTracks().forEach(function(e){return e.stop()})}),r.streamTracker=[]},r.playVideoOnLoadAsync=function(t,e){return lt(this,void 0,void 0,function(){var n;return ht(this,function(i){switch(i.label){case 0:return[4,r.tryPlayVideo(t)];case 1:return n=i.sent(),n?[2,!0]:[2,new Promise(function(o,a){var f=setTimeout(function(){r.isVideoPlaying(t)||(a(!1),t.removeEventListener("canplay",s))},e),s=function(){r.tryPlayVideo(t).then(function(u){clearTimeout(f),t.removeEventListener("canplay",s),o(u)})};t.addEventListener("canplay",s)})]}})})},r.attachStreamToVideo=function(t,e,n){return n===void 0&&(n=5e3),lt(this,void 0,void 0,function(){var i;return ht(this,function(o){switch(o.label){case 0:return i=r.prepareVideoElement(e),r.addVideoSource(i,t),[4,r.playVideoOnLoadAsync(i,n)];case 1:return o.sent(),[2,i]}})})},r._waitImageLoad=function(t){return new Promise(function(e,n){var i=1e4,o=setTimeout(function(){r.isImageLoaded(t)||(t.removeEventListener("load",a),n())},i),a=function(){clearTimeout(o),t.removeEventListener("load",a),e()};t.addEventListener("load",a)})},r.checkCallbackFnOrThrow=function(t){if(!t)throw new st("`callbackFn` is a required parameter, you cannot capture results without it.")},r.disposeMediaStream=function(t){t.getVideoTracks().forEach(function(e){return e.stop()}),t=void 0},r.prototype.decode=function(t){var e=r.createCanvasFromMediaElement(t);return this.decodeFromCanvas(e)},r.prototype.decodeBitmap=function(t){return this.reader.decode(t,this.hints)},r.prototype.decodeFromCanvas=function(t){var e=r.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(e)},r.prototype.decodeFromImageElement=function(t){return lt(this,void 0,void 0,function(){var e;return ht(this,function(n){switch(n.label){case 0:if(!t)throw new st("An image element must be provided.");return e=r.prepareImageElement(t),[4,this._decodeOnLoadImage(e)];case 1:return[2,n.sent()]}})})},r.prototype.decodeFromImageUrl=function(t){return lt(this,void 0,void 0,function(){var e;return ht(this,function(n){switch(n.label){case 0:if(!t)throw new st("An URL must be provided.");e=r.prepareImageElement(),e.src=t,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(e)];case 2:return[2,n.sent()];case 3:return r.destroyImageElement(e),[7];case 4:return[2]}})})},r.prototype.decodeFromConstraints=function(t,e,n){return lt(this,void 0,void 0,function(){var i,o;return ht(this,function(a){switch(a.label){case 0:return r.checkCallbackFnOrThrow(n),[4,this.getUserMedia(t)];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(i,e,n)];case 3:return[2,a.sent()];case 4:throw o=a.sent(),r.disposeMediaStream(i),o;case 5:return[2]}})})},r.prototype.decodeFromStream=function(t,e,n){return lt(this,void 0,void 0,function(){var i,o,a,f,s,u,c,l,h,d=this;return ht(this,function(p){switch(p.label){case 0:return r.checkCallbackFnOrThrow(n),i=this.options.tryPlayVideoTimeout,[4,r.attachStreamToVideo(t,e,i)];case 1:return o=p.sent(),a=function(){r.disposeMediaStream(t),r.cleanVideoSource(o)},f=this.scan(o,n,a),s=t.getVideoTracks(),u=Fe(Fe({},f),{stop:function(){f.stop()},streamVideoConstraintsApply:function(v,g){return lt(this,void 0,void 0,function(){var y,m,w,_,I,T,D;return ht(this,function(b){switch(b.label){case 0:y=g?s.filter(g):s,b.label=1;case 1:b.trys.push([1,6,7,8]),m=Cn(y),w=m.next(),b.label=2;case 2:return w.done?[3,5]:(_=w.value,[4,_.applyConstraints(v)]);case 3:b.sent(),b.label=4;case 4:return w=m.next(),[3,2];case 5:return[3,8];case 6:return I=b.sent(),T={error:I},[3,8];case 7:try{w&&!w.done&&(D=m.return)&&D.call(m)}finally{if(T)throw T.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(v){return s.find(v).getConstraints()},streamVideoSettingsGet:function(v){return s.find(v).getSettings()},streamVideoCapabilitiesGet:function(v){return s.find(v).getCapabilities()}}),c=r.mediaStreamIsTorchCompatible(t),c&&(l=s?.find(function(v){return r.mediaStreamIsTorchCompatibleTrack(v)}),h=function(v){return lt(d,void 0,void 0,function(){return ht(this,function(g){switch(g.label){case 0:return[4,r.mediaStreamSetTorch(l,v)];case 1:return g.sent(),[2]}})})},u.switchTorch=h,u.stop=function(){return lt(d,void 0,void 0,function(){return ht(this,function(v){switch(v.label){case 0:return f.stop(),[4,h(!1)];case 1:return v.sent(),[2]}})})}),[2,u]}})})},r.prototype.decodeFromVideoDevice=function(t,e,n){return lt(this,void 0,void 0,function(){var i,o;return ht(this,function(a){switch(a.label){case 0:return r.checkCallbackFnOrThrow(n),t?i={deviceId:{exact:t}}:i={facingMode:"environment"},o={video:i},[4,this.decodeFromConstraints(o,e,n)];case 1:return[2,a.sent()]}})})},r.prototype.decodeFromVideoElement=function(t,e){return lt(this,void 0,void 0,function(){var n,i;return ht(this,function(o){switch(o.label){case 0:if(r.checkCallbackFnOrThrow(e),!t)throw new st("A video element must be provided.");return n=r.prepareVideoElement(t),i=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(n,i)];case 1:return o.sent(),[2,this.scan(n,e)]}})})},r.prototype.decodeFromVideoUrl=function(t,e){return lt(this,void 0,void 0,function(){var n,i,o,a;return ht(this,function(f){switch(f.label){case 0:if(r.checkCallbackFnOrThrow(e),!t)throw new st("An URL must be provided.");return n=r.prepareVideoElement(),n.src=t,i=function(){r.cleanVideoSource(n)},o=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(n,o)];case 1:return f.sent(),a=this.scan(n,e,i),[2,a]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return lt(this,void 0,void 0,function(){var n;return ht(this,function(i){switch(i.label){case 0:return[4,this.getUserMedia(t)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,e)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(t,e){return lt(this,void 0,void 0,function(){var n,i,o;return ht(this,function(a){switch(a.label){case 0:return n=!!e,[4,r.attachStreamToVideo(t,e)];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,,4,5]),[4,this.scanOneResult(i)];case 3:return o=a.sent(),[2,o];case 4:return n||r.cleanVideoSource(i),[7];case 5:return[2]}})})},r.prototype.decodeOnceFromVideoDevice=function(t,e){return lt(this,void 0,void 0,function(){var n,i;return ht(this,function(o){switch(o.label){case 0:return t?n={deviceId:{exact:t}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,e)];case 1:return[2,o.sent()]}})})},r.prototype.decodeOnceFromVideoElement=function(t){return lt(this,void 0,void 0,function(){var e,n;return ht(this,function(i){switch(i.label){case 0:if(!t)throw new st("A video element must be provided.");return e=r.prepareVideoElement(t),n=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(e,n)];case 1:return i.sent(),[4,this.scanOneResult(e)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromVideoUrl=function(t){return lt(this,void 0,void 0,function(){var e,n;return ht(this,function(i){switch(i.label){case 0:if(!t)throw new st("An URL must be provided.");e=r.prepareVideoElement(),e.src=t,n=this.decodeOnceFromVideoElement(e),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,n];case 2:return[2,i.sent()];case 3:return r.cleanVideoSource(e),[7];case 4:return[2]}})})},r.prototype.scanOneResult=function(t,e,n,i){var o=this;return e===void 0&&(e=!0),n===void 0&&(n=!0),i===void 0&&(i=!0),new Promise(function(a,f){o.scan(t,function(s,u,c){if(s){a(s),c.stop();return}if(u){if(u instanceof A&&e||u instanceof j&&n||u instanceof S&&i)return;c.stop(),f(u)}})})},r.prototype.scan=function(t,e,n){var i=this;r.checkCallbackFnOrThrow(e);var o=r.createCaptureCanvas(t),a;try{a=o.getContext("2d",{willReadFrequently:!0})}catch{a=o.getContext("2d")}if(!a)throw new Error("Couldn't create canvas for visual element scan.");var f=function(){a=void 0,o=void 0},s=!1,u,c=function(){s=!0,clearTimeout(u),f(),n&&n()},l={stop:c},h=function(){if(!s)try{r.drawImageOnCanvas(a,t);var d=i.decodeFromCanvas(o);e(d,void 0,l),u=setTimeout(h,i.options.delayBetweenScanSuccess)}catch(y){e(void 0,y,l);var p=y instanceof j,v=y instanceof S,g=y instanceof A;if(p||v||g){u=setTimeout(h,i.options.delayBetweenScanAttempts);return}f(),n&&n(y)}};return h(),l},r.prototype._decodeOnLoadImage=function(t){return lt(this,void 0,void 0,function(){var e;return ht(this,function(n){switch(n.label){case 0:return e=r.isImageLoaded(t),e?[3,2]:[4,r._waitImageLoad(t)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(t)]}})})},r.prototype.getUserMedia=function(t){return lt(this,void 0,void 0,function(){var e;return ht(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return e=n.sent(),r.streamTracker.push(e),[2,e]}})})},r.streamTracker=[],r})();var y0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),yC=(function(r){y0(t,r);function t(e,n){return r.call(this,new te,e,n)||this}return t})(Ut);var w0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),_C=(function(r){w0(t,r);function t(e,n){return r.call(this,new Xt(e),e,n)||this}return t})(Ut);var A0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),OC=(function(r){A0(t,r);function t(e,n){return r.call(this,new oe,e,n)||this}return t})(Ut);var E0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),Ki=(function(r){E0(t,r);function t(e,n){var i=this,o=new Ye;return o.setHints(e),i=r.call(this,o,e,n)||this,i.reader=o,i}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(k.POSSIBLE_FORMATS,e),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t.prototype.setHints=function(e){this.hints=e,this.reader.setHints(this.hints)},t})(Ut);var _0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),MC=(function(r){_0(t,r);function t(e,n){return r.call(this,new se,e,n)||this}return t})(Ut);var C0=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),kC=(function(r){C0(t,r);function t(e,n){return r.call(this,new ae,e,n)||this}return t})(Ut);var Jt="http://www.w3.org/2000/svg",VC=(function(){function r(t){if(typeof t=="string"){var e=document.getElementById(t);if(!e)throw new Error("Could not find a Container element with '".concat(t,"'."));this.containerElement=e}else this.containerElement=t}return r.prototype.write=function(t,e,n,i){if(t.length===0)throw new O("Found empty contents");if(e<0||n<0)throw new O("Requested dimensions are too small: "+e+"x"+n);var o=i&&i.get(H.MARGIN)!==void 0?Number.parseInt(i.get(H.MARGIN).toString(),10):r.QUIET_ZONE_SIZE,a=this.encode(i,t);return this.renderResult(a,e,n,o)},r.prototype.createSVGElement=function(t,e){var n=document.createElementNS(r.SVG_NS,"svg");return n.setAttributeNS(Jt,"width",e.toString()),n.setAttributeNS(Jt,"height",t.toString()),n},r.prototype.createSvgPathPlaceholderElement=function(t,e){var n=document.createElementNS(r.SVG_NS,"path");return n.setAttributeNS(Jt,"d","M0 0h".concat(t,"v").concat(e,"H0z")),n.setAttributeNS(Jt,"fill","none"),n},r.prototype.createSvgRectElement=function(t,e,n,i){var o=document.createElementNS(r.SVG_NS,"rect");return o.setAttributeNS(Jt,"x",t.toString()),o.setAttributeNS(Jt,"y",e.toString()),o.setAttributeNS(Jt,"height",n.toString()),o.setAttributeNS(Jt,"width",i.toString()),o.setAttributeNS(Jt,"fill","#000000"),o},r.prototype.encode=function(t,e){var n=Nt.L;if(t&&t.get(H.ERROR_CORRECTION)!==void 0){var i=t.get(H.ERROR_CORRECTION).toString();n=Nt.fromString(i)}var o=qt.encode(e,n,t);return o},r.prototype.renderResult=function(t,e,n,i){var o=t.getMatrix();if(o===null)throw new xt;var a=o.getWidth(),f=o.getHeight(),s=a+i*2,u=f+i*2,c=Math.max(e,s),l=Math.max(n,u),h=Math.min(Math.floor(c/s),Math.floor(l/u)),d=Math.floor((c-a*h)/2),p=Math.floor((l-f*h)/2),v=this.createSVGElement(c,l),g=this.createSvgPathPlaceholderElement(e,n);v.appendChild(g),this.containerElement.appendChild(v);for(var y=0,m=p;y<f;y++,m+=h)for(var w=0,_=d;w<a;w++,_+=h)if(o.get(w,y)===1){var I=this.createSvgRectElement(_,m,h,h);v.appendChild(I)}return v},r.QUIET_ZONE_SIZE=4,r.SVG_NS="http://www.w3.org/2000/svg",r})();var Qi="http://www.w3.org/2000/svg",XC=(function(){function r(){}return r.prototype.write=function(t,e,n,i){if(t.length===0)throw new O("Found empty contents");if(e<0||n<0)throw new O("Requested dimensions are too small: "+e+"x"+n);var o=Nt.L,a=r.QUIET_ZONE_SIZE;if(i){if(i.get(H.ERROR_CORRECTION)!==void 0){var f=i.get(H.ERROR_CORRECTION).toString();o=Nt.fromString(f)}i.get(H.MARGIN)!==void 0&&(a=Number.parseInt(i.get(H.MARGIN).toString(),10))}var s=qt.encode(t,o,i);return this.renderResult(s,e,n,a)},r.prototype.writeToDom=function(t,e,n,i,o){if(typeof t=="string"){var a=document.querySelector(t);if(!a)throw new Error("Could no find the target HTML element.");t=a}var f=this.write(e,n,i,o);t instanceof HTMLElement&&t.appendChild(f)},r.prototype.renderResult=function(t,e,n,i){var o=t.getMatrix();if(o===null)throw new xt;for(var a=o.getWidth(),f=o.getHeight(),s=a+i*2,u=f+i*2,c=Math.max(e,s),l=Math.max(n,u),h=Math.min(Math.floor(c/s),Math.floor(l/u)),d=Math.floor((c-a*h)/2),p=Math.floor((l-f*h)/2),v=this.createSVGElement(c,l),g=0,y=p;g<f;g++,y+=h)for(var m=0,w=d;m<a;m++,w+=h)if(o.get(m,g)===1){var _=this.createSvgRectElement(w,y,h,h);v.appendChild(_)}return v},r.prototype.createSVGElement=function(t,e){var n=document.createElementNS(Qi,"svg"),i=t.toString(),o=e.toString();return n.setAttribute("height",o),n.setAttribute("width",i),n.setAttribute("viewBox","0 0 "+i+" "+o),n},r.prototype.createSvgRectElement=function(t,e,n,i){var o=document.createElementNS(Qi,"rect");return o.setAttribute("x",t.toString()),o.setAttribute("y",e.toString()),o.setAttribute("height",n.toString()),o.setAttribute("width",i.toString()),o.setAttribute("fill","#000000"),o},r.QUIET_ZONE_SIZE=4,r})();var In={[C.AZTEC]:"aztec",[C.CODABAR]:"codabar",[C.CODE_39]:"code_39",[C.CODE_93]:"code_93",[C.CODE_128]:"code_128",[C.DATA_MATRIX]:"data_matrix",[C.EAN_8]:"ean_8",[C.EAN_13]:"ean_13",[C.ITF]:"itf",[C.PDF_417]:"pdf417",[C.QR_CODE]:"qr_code",[C.UPC_A]:"upc_a",[C.UPC_E]:"upc_e",[C.UPC_EAN_EXTENSION]:"unknown",[C.MAXICODE]:"unknown",[C.RSS_14]:"unknown",[C.RSS_EXPANDED]:"unknown"},Sn={aztec:C.AZTEC,codabar:C.CODABAR,code_39:C.CODE_39,code_93:C.CODE_93,code_128:C.CODE_128,data_matrix:C.DATA_MATRIX,ean_8:C.EAN_8,ean_13:C.EAN_13,itf:C.ITF,pdf417:C.PDF_417,qr_code:C.QR_CODE,upc_a:C.UPC_A,upc_e:C.UPC_E};var Tr=class{reader;constructor(t){let e=new Map([[k.TRY_HARDER,!0],[k.POSSIBLE_FORMATS,t?t.formats.map(n=>Sn[n]):Object.values(Sn)]]);this.reader=new Ki(e)}static getSupportedFormats(){return Promise.resolve(Object.values(In))}async detect(t){try{let e;if(t instanceof HTMLVideoElement||t instanceof HTMLImageElement)e=await this.reader.scanOneResult(t,!1);else if(t instanceof HTMLCanvasElement)e=this.reader.decodeFromCanvas(t);else if(t instanceof Blob){let n=await this.blobToImage(t);e=await this.reader.scanOneResult(n,!1)}else if(t instanceof ImageBitmap||t instanceof ImageData||t instanceof VideoFrame)e=this.reader.decodeFromCanvas(this.imageDataSourceToCanvas(t));else throw new TypeError("Image source is not supported");return[{rawValue:e.getText(),format:In[e.getBarcodeFormat()],boundingBox:new DOMRectReadOnly,cornerPoints:e.getResultPoints().map(n=>({x:n.getX(),y:n.getY()}))}]}catch(e){if(e&&!(e instanceof A))throw e;return[]}}async blobToImage(t){return new Promise((e,n)=>{let i=URL.createObjectURL(t),o=new Image;o.onload=()=>{URL.revokeObjectURL(i),e(o)},o.onerror=()=>n(new Error("Failed to load image from blob")),o.src=i})}imageDataSourceToCanvas(t){let e=document.createElement("canvas"),n=e.getContext("2d"),i=t instanceof VideoFrame?t.displayWidth:t.width,o=t instanceof VideoFrame?t.displayHeight:t.height;return n&&(t instanceof ImageData?n.putImageData(t,i,o):n.drawImage(t,i,o)),e}};"BarcodeDetector"in window||(window.BarcodeDetector=Tr);})();
21
21
  //# sourceMappingURL=barcode-detector-polyfill.min.js.map