@mescius/wijmo.barcode.common 5.20261.45-nightly.d20251218.t163151 → 5.20261.45-nightly.d20260105.t163143

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.
package/es5-esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20261.45-nightly.d20251218.t163151
3
+ * Wijmo Library 5.20261.45-nightly.d20260105.t163143
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
@@ -11,4 +11,4 @@
11
11
  *
12
12
  */
13
13
 
14
- var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}();import{asEnum,addClass,_registerModule}from"@mescius/wijmo";import{OneDimensionalBarcode,Utils,InvalidTextException,InvalidOptionsException,Barcode,InvalidCharacterException,Constants,TextTooLongException,BitBuffer,TwoDimensionalBarcode,BarcodeBase,_LabelPositionConvertor,_NarrowWideRatioConvertor}from"@mescius/wijmo.barcode";import*as selfModule from"@mescius/wijmo.barcode.common";for(var EXP_TABLE=new Array(256),i=0;i<8;i++)EXP_TABLE[i]=1<<i;for(i=8;i<256;i++)EXP_TABLE[i]=EXP_TABLE[i-4]^EXP_TABLE[i-5]^EXP_TABLE[i-6]^EXP_TABLE[i-8];var LOG_TABLE=new Array(256);for(i=0;i<255;i+=1)LOG_TABLE[EXP_TABLE[i]]=i;var RS_COEFFICIENTS=[null,null,null,null,null,null,null,[0,87,229,146,149,238,102,21],null,null,[0,251,67,46,61,118,70,64,94,32,45],null,null,[0,74,152,176,100,86,100,106,104,130,218,206,140,78],null,[0,8,183,61,91,202,37,51,58,58,237,140,124,5,99,105],[0,120,104,107,109,102,161,76,3,91,191,147,169,182,194,225,120],[0,43,139,206,78,43,239,123,206,214,147,24,99,150,39,243,163,136],[0,215,234,158,94,184,97,118,170,79,187,152,148,252,179,5,98,96,153],null,[0,17,60,79,50,61,163,26,187,202,180,221,225,83,239,156,164,212,212,188,190],null,[0,210,171,247,242,93,230,14,109,221,53,200,74,8,172,98,80,219,134,160,105,165,231],null,[0,229,121,135,48,211,117,251,126,159,180,169,152,192,226,228,218,111,0,117,232,87,96,227,21],null,[0,173,125,158,2,103,182,118,17,145,201,111,28,165,53,161,21,245,142,13,102,48,227,153,145,218,70],null,[0,168,223,200,104,224,234,108,180,110,190,195,147,205,27,232,201,21,43,245,87,42,195,212,119,242,37,9,123],null,[0,41,173,145,152,216,31,179,182,50,48,110,86,239,96,222,125,42,173,226,193,224,130,156,37,251,216,238,40,192,180],null,[0,10,6,106,190,249,167,4,67,209,138,138,32,242,123,89,27,120,185,80,156,38,69,171,60,28,222,80,52,254,185,220,241],null,[0,111,77,146,94,26,21,108,19,105,94,113,193,86,140,163,125,58,158,229,239,218,103,56,70,114,61,183,129,167,13,98,62,129,51],null,[0,200,183,98,16,172,31,246,234,60,152,115,0,167,152,113,248,238,107,18,63,218,37,87,210,105,177,120,74,121,196,117,251,113,233,30,120],null,null,null,[0,59,116,79,161,252,98,128,205,128,161,247,57,163,56,235,106,53,26,187,174,226,104,170,7,175,35,181,114,88,41,47,163,125,134,72,20,232,53,35,15],null,[0,250,103,221,230,25,18,137,231,0,3,58,242,221,191,110,84,230,8,188,106,96,147,15,131,139,34,101,223,39,101,213,199,237,254,201,123,171,162,194,117,50,96],null,[0,190,7,61,121,71,246,69,55,168,188,89,243,191,25,72,123,9,145,14,247,1,238,44,78,143,62,224,126,118,114,68,163,52,194,217,147,204,169,37,130,113,102,73,181],null,[0,112,94,88,112,253,224,202,115,187,99,89,5,54,113,129,44,58,16,135,216,169,211,36,1,4,96,60,241,73,104,234,8,249,245,119,174,52,25,157,224,43,202,223,19,82,15],null,[0,228,25,196,130,211,146,60,24,251,90,39,102,240,61,178,63,46,123,115,18,221,111,135,160,182,205,107,206,95,150,120,184,91,21,247,156,140,238,191,11,94,227,84,50,163,39,34,108],null,[0,232,125,157,161,164,9,118,46,209,99,203,193,35,3,209,111,195,242,203,225,46,13,32,160,126,209,130,160,242,215,242,75,77,42,189,32,113,65,124,69,228,114,235,175,124,170,215,232,133,205],null,[0,116,50,86,186,50,220,251,89,192,46,86,127,124,19,184,233,151,215,22,14,59,145,37,242,203,134,254,89,190,94,59,65,124,113,100,233,235,121,22,76,86,97,39,242,200,220,101,33,239,254,116,51],null,[0,183,26,201,87,210,221,113,21,46,65,45,50,238,184,249,225,102,58,209,218,109,165,26,95,184,192,52,245,35,254,238,175,172,79,123,25,122,43,120,108,215,80,128,201,235,8,153,59,101,31,198,76,31,156],null,[0,106,120,107,157,164,216,112,116,2,91,248,163,36,201,202,229,6,144,254,155,135,208,170,209,12,139,127,142,182,249,177,174,190,28,10,85,239,184,101,124,152,206,96,23,163,61,27,196,247,151,154,202,207,20,61,10],null,[0,82,116,26,247,66,27,62,107,252,182,200,185,235,55,251,242,210,144,154,237,176,141,192,248,152,249,206,85,253,142,65,165,125,23,24,30,122,240,214,6,129,218,29,145,127,134,206,245,117,29,41,63,159,142,233,125,148,123],null,[0,107,140,26,12,9,141,243,197,226,197,219,45,211,101,219,120,28,181,127,6,100,247,2,205,198,57,115,219,101,109,160,82,37,38,238,49,160,209,121,86,11,124,30,181,84,25,194,87,65,102,190,220,70,27,209,16,89,7,33,240],null,[0,65,202,113,98,71,223,248,118,214,94,1,122,37,23,2,228,58,121,7,105,135,78,243,118,70,76,223,89,72,50,70,111,194,17,212,126,181,35,221,117,235,11,229,149,147,123,213,40,115,6,200,100,26,246,182,218,127,215,36,186,110,106],null,[0,45,51,175,9,7,158,159,49,68,119,92,123,177,204,187,254,200,78,141,149,119,26,127,53,160,93,199,212,29,24,145,156,208,150,218,209,4,216,91,47,184,146,47,140,195,195,125,242,238,63,99,108,140,230,242,31,204,11,178,243,217,156,213,231],null,[0,5,118,222,180,136,136,162,51,46,117,13,215,81,17,139,247,197,171,95,173,65,137,178,68,111,95,101,41,72,214,169,197,95,7,44,154,77,111,236,40,121,143,63,87,80,253,240,126,217,77,34,232,106,50,168,82,76,146,67,106,171,25,132,93,45,105],null,[0,247,159,223,33,224,93,77,70,90,160,32,254,43,150,84,101,190,205,133,52,60,202,165,220,203,151,93,84,15,84,253,173,160,89,227,52,199,97,95,231,52,177,41,125,137,241,166,225,118,2,54,32,82,215,175,198,43,238,235,27,101,184,127,3,5,8,163,238],null];export function generateErrorCorrectionCode(e,t,o){for(var r=[],n=RS_COEFFICIENTS[t],a=e.slice(0),s=0;s<o;s++){if(0!=a[0]){for(var c=LOG_TABLE[a[0]],d=0;d<=n.length-1;d++){for(var u=n[d]+c;u>=255;)u-=255;r[d]=EXP_TABLE[u]}for(var l=0;l<=n.length-1;l++)a[l]=a[l]^r[l]}for(var h=1;h<a.length;h++)a[h-1]=a[h];a[a.length-1]=0}return a.slice(0,t)}var G15=1335,G18=7973,MODEL2_G15_MASK=21522,MODEL1_G15_MASK=10277;function getBCHDigit(e){for(var t=0;0!=e;){t+=1;e>>>=1}return t}export function getBCH15(e,t){for(var o=2===t?MODEL2_G15_MASK:MODEL1_G15_MASK,r=e<<10;getBCHDigit(r)-getBCHDigit(G15)>=0;)r^=G15<<getBCHDigit(r)-getBCHDigit(G15);return(e<<10|r)^o}export function getBCH18(e){for(var t=e<<12;getBCHDigit(t)-getBCHDigit(G18)>=0;)t^=G18<<getBCHDigit(t)-getBCHDigit(G18);return e<<12|t}export var MODE_INDICATOR={ECI:7,Numeric:1,Alphanumeric:2,"8BitByte":4,Kanji:8,StructuredAppend:3,FNC1First:5,FNC2Second:9,Terminator:0};export var EC_INDICATOR={L:1,M:0,Q:3,H:2};function isNumericMode(e){return e>=48&&e<=57}function isAlphanumericMode(e){return-1!=" $%*+-./:".indexOf(String.fromCharCode(e))||(e>=48&&e<=57||e>=65&&e<=90)}function is8BitByteMode(e){return e>=0&&e<=255}function isKanjiMode(e){return e>=33087&&e<=64587}var checkFns={Numeric:isNumericMode,Alphanumeric:isAlphanumericMode,"8BitByte":is8BitByteMode,Kanji:isKanjiMode};export function isMode(e,t){var o=checkFns[e];return 1===t.length?o(t):t.every((function(e){return o(e)}))}export function getCharMode(e,t){void 0===t&&(t="UTF-8");return isNumericMode(e)?"Numeric":isAlphanumericMode(e)?"Alphanumeric":"Shift_JIS"===t&&isKanjiMode(e)?"Kanji":"8BitByte"}export var getSizeByVersion=function(e){return 4*e+17};export function getCharacterCountIndicatorbitsNumber(e){return e>=1&&e<=9?{Numeric:10,Alphanumeric:9,"8BitByte":8,Kanji:8}:e>=10&&e<=26?{Numeric:12,Alphanumeric:11,"8BitByte":16,Kanji:10}:{Numeric:14,Alphanumeric:13,"8BitByte":16,Kanji:12}}var SYMBOL_MAP={" ":36,$:37,"%":38,"*":39,"+":40,"-":41,".":42,"/":43,":":44};export function getAlphanumericCharValue(e){if(e>=48&&e<=57)return+String.fromCharCode(e);if(e>=65&&e<=90)return e-65+10;var t=SYMBOL_MAP[String.fromCharCode(e)];if(t)return t;throw new InvalidTextException(String.fromCharCode(e))}export function createModules(e){for(var t=[],o=0;o<e;o++)t.push(Utils.fillArray(new Array(e),null));return t}var alignmentPatterns=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]];export function getAlignmentPattersPos(e){return alignmentPatterns[e-1]}export var padCodewords0=236;export var padCodewords1=17;export var maskFuncs=[function(e,t){return(e+t)%2==0},function(e){return e%2==0},function(e,t){return t%3==0},function(e,t){return(e+t)%3==0},function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0},function(e,t){return e*t%2+e*t%3==0},function(e,t){return(e*t%2+e*t%3)%2==0},function(e,t){return(e*t%3+(e+t)%2)%2==0}];var MODEL2_1ERROR_CORRECTION_CHARACTERISTICS=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],MODEL1_ERROR_CORRECTION_CHARACTERISTICS=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,46,36],[1,46,30],[1,46,24],[1,46,16],[1,72,57],[1,72,44],[1,72,36],[1,72,24],[1,100,80],[1,100,60],[1,100,50],[1,100,34],[1,134,108],[1,134,82],[1,134,68],[2,67,23],[1,170,136],[2,85,53],[2,85,43],[2,85,29],[1,212,170],[2,106,66],[2,106,54],[3,70,24],[2,128,104],[2,128,80],[2,128,64],[3,85,29],[2,153,123],[2,153,93],[3,102,52],[3,102,34],[2,179,145],[2,179,111],[3,119,61],[4,89,31],[2,208,168],[4,104,64],[4,104,52],[5,83,29],[2,238,192],[4,119,73],[4,119,61],[5,95,33],[3,180,144],[4,135,83],[4,135,69],[6,90,32],[3,203,163],[4,152,92],[5,122,62],[6,101,35]];export function getErrorCorrectionCharacteristics(e,t,o){void 0===o&&(o=2);var r;switch(t){case 1:r=0;break;case 0:r=1;break;case 3:r=2;break;case 2:r=3}for(var n=(2===o?MODEL2_1ERROR_CORRECTION_CHARACTERISTICS:MODEL1_ERROR_CORRECTION_CHARACTERISTICS)[4*(e-1)+r],a=[],s=n.length/3,c=0;c<s;c++)for(var d=n[3*c],u=0;u<d;u++)a.push({total:n[3*c+1],data:n[3*c+2],ec:n[3*c+1]-n[3*c+2]});return a}export function getMaskFunc(e){return maskFuncs[e]}function cloneModules(e){return e.reduce((function(e,t){e.push(t.slice(0));return e}),[])}export function getMaskScore(e){for(var t=e.length,o=0,r=0;r<t;r++)for(var n=0;n<t;n++){for(var a=0,s=e[r][n],c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(var d=-1;d<=1;d++)n+d<0||t<=n+d||0==c&&0==d||s==e[r+c][n+d]&&(a+=1);a>5&&(o+=3+a-5)}for(r=0;r<t-1;r++)for(n=0;n<t-1;n++){var u=0;e[r][n]&&(u+=1);e[r+1][n]&&(u+=1);e[r][n+1]&&(u+=1);e[r+1][n+1]&&(u+=1);0!=u&&4!=u||(o+=3)}for(r=0;r<t;r++)for(n=0;n<t-6;n++)e[r][n]&&!e[r][n+1]&&e[r][n+2]&&e[r][n+3]&&e[r][n+4]&&!e[r][n+5]&&e[r][n+6]&&(o+=40);for(n=0;n<t;n++)for(r=0;r<t-6;r++)e[r][n]&&!e[r+1][n]&&e[r+2][n]&&e[r+3][n]&&e[r+4][n]&&!e[r+5][n]&&e[r+6][n]&&(o+=40);var l=0;for(n=0;n<t;n++)for(r=0;r<t;r++)e[r][n]&&(l+=1);return o+=10*(Math.abs(100*l/t/t-50)/5)}export function addFormatInformation(e,t,o,r){var n=e.length,a=cloneModules(e),s=Utils.strPadStart(Utils.convertRadix(o,2),2,0),c=Utils.strPadStart(Utils.convertRadix(t,2),3,0),d=getBCH15(parseInt(s+c,2),r);a[n-8][8]=1;for(var u=15;u>0;u--){var l=d>>u-1&1;if(u>9){a[8][15-u]=l;a[n-1-15+u][8]=l}else if(u>8){a[8][15-u+1]=l;a[n-1-15+u][8]=l}else if(u>6){a[u][8]=l;a[8][n-u]=l}else{a[u-1][8]=l;a[8][n-u]=l}}return a}export function getEstimatedVersion(e,t,o){var r=0,n=0,a=0,s=0;t.forEach((function(e){isNumericMode(e)?r++:isAlphanumericMode(e)?n++:isKanjiMode(e)?s++:is8BitByteMode(e)&&a++}));for(var c=Math.ceil((5*n+3*r+13*s+8*a)/8),d=1;d<=40;d++){if(c<=getErrorCorrectionCharacteristics(d,e,o).reduce((function(e,t){return e+t.data}),0))return d}throw new TextTooLongException}var MODE_CHECK_INFO={Alphanumeric:[[6,11],[7,15],[8,16]],Numeric:[[4,6,6,13],[4,7,8,15],[5,8,9,17]]};export function getModeCheckInfo(e,t){var o=MODE_CHECK_INFO[e];return t<=9?o[0]:t<=26?o[1]:o[2]}export function utf8Encode(e){for(var t=[],o=0,r=e.length;o<r;o++){var n=e[o];if(n<128)t.push(n);else if(n<2048)t.push(192|n>>6,128|63&n);else if(n<55296||n>=57344)t.push(224|n>>12,128|n>>6&63,128|63&n);else{n=65536+((1023&n)<<10|1023&e[++o]);t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)}}return t}export function getParityData(e){for(var t=utf8Encode(e),o=t[0],r=1,n=t.length;r<n;r++)o^=t[r];return o}export function getCharCode(e){var t=[];Utils.sliceString(e,1,(function(e){t.push(e.charCodeAt(0))}));return t}var ModeKanji=function(){function ModeKanji(e){this.mode="Kanji";this.data=e}ModeKanji.prototype.getMode=function(){return MODE_INDICATOR.Kanji};ModeKanji.prototype.getLength=function(){return this.data.length};ModeKanji.prototype.write=function(e){this.data.forEach((function(t){var o;if(t>33088&&t<40956){o=192*((t-=33088)>>>8)+(255&t)}else if(t>57408&&t<60351){o=192*((t-=49472)>>>8)+(255&t)}e.put(o,13)}))};return ModeKanji}();export{ModeKanji};var ModeAlphanumeric=function(){function ModeAlphanumeric(e){this.mode="Alphanumeric";this.data=e}ModeAlphanumeric.prototype.getMode=function(){return MODE_INDICATOR.Alphanumeric};ModeAlphanumeric.prototype.getLength=function(){return this.data.length};ModeAlphanumeric.prototype.write=function(e){Utils.sliceArray(this.data,2,(function(t){var o=getAlphanumericCharValue(t[0]);if(2===t.length){var r=45*o+getAlphanumericCharValue(t[1]);e.put(r,11)}else e.put(o,6)}))};return ModeAlphanumeric}();export{ModeAlphanumeric};var ModeNumeric=function(){function ModeNumeric(e){this.mode="Numeric";this.data=e}ModeNumeric.prototype.getMode=function(){return MODE_INDICATOR.Numeric};ModeNumeric.prototype.getLength=function(){return this.data.length};ModeNumeric.prototype.write=function(e){Utils.sliceArray(this.data,3,(function(t){var o=parseInt(t.reduce((function(e,t){return e+String.fromCharCode(t)}),""));switch(t.length){case 1:e.put(o,4);return;case 2:e.put(o,7);return;default:e.put(o,10);return}}))};return ModeNumeric}();export{ModeNumeric};var Mode8BitByte=function(){function Mode8BitByte(e){this.mode="8BitByte";this.data=e;this.bytes=utf8Encode(e)}Mode8BitByte.prototype.getMode=function(){return MODE_INDICATOR["8BitByte"]};Mode8BitByte.prototype.getLength=function(){return this.bytes.length};Mode8BitByte.prototype.write=function(e){this.bytes.forEach((function(t){e.put(t,8)}))};return Mode8BitByte}();export{Mode8BitByte};var QRCodeBase=function(){function QRCodeBase(e,t){var o=t.version,r=t.model,n=t.charCode;this.charCode=n||getCharCode(e);var a=EC_INDICATOR[t.errorCorrectionLevel];this.config=t;this.errorCorrectionLevel=a;this.model=+r;o="auto"===o?this.getAutoVersion():+o;this.version=o;this.modulesCount=getSizeByVersion(o);this.charCountIndicatorBitsNumber=getCharacterCountIndicatorbitsNumber(o);this.errorCorrectionCharacteristics=getErrorCorrectionCharacteristics(o,a,this.model);this.totalDataCount=this.errorCorrectionCharacteristics.reduce((function(e,t){return e+t.data}),0);this.totalDataBits=8*this.totalDataCount}QRCodeBase.prototype.getConnections=function(){for(var e=this.totalDataBits,t=this.charCode,o=e-20,r=t.length,n=0,a=1,s=[],c=t[0];a<=r;){var d=t.slice(n,a),u=this.analysisData(d);if(this.encodeData(u).length>o){s.push(c);n=a-1}else a===r&&s.push(d);c=d;a++}return s};QRCodeBase.prototype.processConnection=function(e){var t=this.totalDataBits,o=this.config,r=o.connection,n=o.connectionNo;n=+n;if(r){var a=Math.ceil(e.length/(t-20));if(n>a-1)throw new InvalidOptionsException({connectionNo:n},"Max connection number is "+(a-1));var s=this.getConnections()[n],c=this.analysisData(s);return this.encodeData(c,{connectionNo:n,connectionCnt:a})}if(e.length>t)throw new TextTooLongException;return e};QRCodeBase.prototype.padBuffer=function(e){var t=this.totalDataBits;e.length+4<=t&&e.put(MODE_INDICATOR.Terminator,4);for(;e.length%8!=0;)e.putBit(!1);for(;!(e.length>=t);){e.put(padCodewords0,8);if(e.length>=t)break;e.put(padCodewords1,8)}};QRCodeBase.prototype.getAutoVersion=function(){for(var e=this.errorCorrectionLevel,t=this.charCode,o=getEstimatedVersion(e,t,this.model);o<40;o++){this.version=o;this.modulesCount=getSizeByVersion(this.version);this.charCountIndicatorBitsNumber=getCharacterCountIndicatorbitsNumber(this.version);this.errorCorrectionCharacteristics=getErrorCorrectionCharacteristics(this.version,e);this.totalDataCount=this.errorCorrectionCharacteristics.reduce((function(e,t){return e+t.data}),0);this.totalDataBits=8*this.totalDataCount;var r=this.analysisData(t);if(!(this.encodeData(r).length>this.totalDataBits))return o}throw new TextTooLongException};QRCodeBase.prototype.analysisData=function(e){var t=this.version,o=this.config.charset,r=getCharMode(e[0],o);switch(r){case"Alphanumeric":var n=getModeCheckInfo(r,t);isMode("8BitByte",e.slice(1,1+n[0]))&&(r="8BitByte");break;case"Numeric":var a=getModeCheckInfo(r,t),s=e.slice(1,1+a[0]),c=e.slice(1,1+a[1]);isMode("8BitByte",s)?r="8BitByte":isMode("Alphanumeric",c)&&(r="Alphanumeric")}var d={mode:r,code:[]},u=[d];e.forEach((function(r,n){var a=getCharMode(r,o);if(d.mode===a)d.code.push(r);else if("8BitByte"===d.mode)if("Kanji"===a){d={mode:a,code:[r]};u.push(d)}else if("Numeric"===a){var s=getModeCheckInfo(a,t);if(isMode(a,e.slice(n,n+s[2]))){d={mode:a,code:[r]};u.push(d)}else d.code.push(r)}else if("Alphanumeric"===a){s=getModeCheckInfo(a,t);if(isMode(a,e.slice(n,n+s[1]))){d={mode:a,code:[r]};u.push(d)}else d.code.push(r)}else d.code.push(r);else if("Alphanumeric"===d.mode)if("Kanji"===a||"8BitByte"===a){d={mode:a,code:[r]};u.push(d)}else if("Numeric"===a){s=getModeCheckInfo(a,t);if(isMode(a,e.slice(n,n+s[2]))){d={mode:a,code:[r]};u.push(d)}else d.code.push(r)}else d.code.push(r);else{d={mode:a,code:[r]};u.push(d)}}));return u};QRCodeBase.prototype.generateErrorCorrectionCode=function(e){var t=this.errorCorrectionCharacteristics,o=[],r=0;t.forEach((function(t){var n=e.getBuffer().slice(r,r+t.data);o.push({data:n,ec:generateErrorCorrectionCode(n,t.ec,t.data)});r+=t.data}));return o};QRCodeBase.prototype.addRectModule=function(e,t,o,r,n){void 0===n&&(n=!1);for(var a=this.modules,s=r+t,c=o+e;t<s;t++)for(var d=e;d<c;d++)a[t][d]=+n};QRCodeBase.prototype.addPositionDetectionPattern=function(){var e=this.modules.length;this.addPattern(0,0,7);this.addRectModule(7,0,1,8,!1);this.addRectModule(0,7,8,1,!1);var t=e-7;this.addPattern(t,0,7);this.addRectModule(t-1,0,1,8,!1);this.addRectModule(t-1,7,8,1,!1);var o=e-7;this.addPattern(0,o,7);this.addRectModule(7,o-1,1,8,!1);this.addRectModule(0,o-1,8,1,!1)};QRCodeBase.prototype.addTimingPattern=function(){for(var e=this.modules,t=e.length,o=!0,r=8;r<t-7;r++){e[6][r]=+o;e[r][6]=+o;o=!o}};QRCodeBase.prototype.addPattern=function(e,t,o){this.addRectModule(e,t,o,o,!0);this.addRectModule(e+1,t+1,o-2,o-2,!1);this.addRectModule(e+2,t+2,o-4,o-4,!0)};return QRCodeBase}();export{QRCodeBase};var QRCodeModel2=function(e){__extends(QRCodeModel2,e);function QRCodeModel2(){return null!==e&&e.apply(this,arguments)||this}QRCodeModel2.prototype.encodeData=function(e,t){var o=this.charCountIndicatorBitsNumber,r=this.charCode,n=new BitBuffer;if(t){n.put(MODE_INDICATOR.StructuredAppend,4);n.put(t.connectionNo,4);n.put(t.connectionCnt-1,4);n.put(getParityData(r),8)}e.forEach((function(e){if(e.code){var t;switch(e.mode){case"Numeric":t=new ModeNumeric(e.code);break;case"Alphanumeric":t=new ModeAlphanumeric(e.code);break;case"8BitByte":t=new Mode8BitByte(e.code);break;case"Kanji":t=new ModeKanji(e.code)}n.put(t.getMode(),4);n.put(t.getLength(),o[t.mode]);t.write(n)}}));return n};QRCodeModel2.prototype.getFinalMessage=function(e){for(var t=[],o=e.map((function(e){return e.data})),r=e.map((function(e){return e.ec})),n=Utils.getMaxValue(o),a=Utils.getMaxValue(r),_loop_1=function(e){o.forEach((function(o){Utils.isDefined(o[e])&&t.push(o[e])}))},s=0;s<n;s++)_loop_1(s);var _loop_2=function(e){r.forEach((function(o){Utils.isDefined(o[e])&&t.push(o[e])}))};for(s=0;s<a;s++)_loop_2(s);return t};QRCodeModel2.prototype.setModules=function(e){var t=this.modulesCount,o=this.version;this.modules=createModules(t);this.addPositionDetectionPattern();this.addAlignmentPattern();this.addTimingPattern();o>6&&this.addVersionInformation();this.maskModules(e)};QRCodeModel2.prototype.maskModules=function(e){var t=this.modules,o=this.errorCorrectionLevel,r=this.model,n=this.config.mask;if("auto"===n)this.autoMask(e);else{var a=getMaskFunc(n);this.maskPattern=n;var s=addFormatInformation(t,n,o,r);this.modules=this.fillDataModules(s,e,a)}};QRCodeModel2.prototype.autoMask=function(e){var t,o,r,n=this,a=this.modules,s=this.errorCorrectionLevel,c=this.model;maskFuncs.forEach((function(d,u){var l=addFormatInformation(a,u,s,c),h=n.fillDataModules(l,e,d),C=getMaskScore(h);if(!o||C<o){t=h;o=C;r=u}}));this.modules=t;this.maskPattern=r};QRCodeModel2.prototype.addAlignmentPattern=function(){var e=this,t=this.modules,o=getAlignmentPattersPos(this.version);o.forEach((function(r){o.forEach((function(o){null===t[r][o]&&e.addPattern(o-2,r-2,5)}))}))};QRCodeModel2.prototype.addVersionInformation=function(){for(var e=this.modulesCount,t=this.modules,o=getBCH18(this.version),r=0;r<18;r++){var n=o>>r&1;t[Math.floor(r/3)][r%3+e-8-3]=n;t[r%3+e-8-3][Math.floor(r/3)]=n}};QRCodeModel2.prototype.fillDataModules=function(e,t,o){for(var r=e.length,n=-1,a=r-1,s=7,c=0,d=r-1;d>0;d-=2){6==d&&(d-=1);for(;;){for(var u=0;u<2;u+=1)if(null==e[a][d-u]){var l=!1;c<t.length&&(l=1==(t[c]>>>s&1));o(a,d-u)&&(l=!l);e[a][d-u]=+l;if(-1==(s-=1)){c+=1;s=7}}if((a+=n)<0||r<=a){a-=n;n=-n;break}}}return e};QRCodeModel2.prototype.getMatrix=function(){var e=this.charCode,t=this.analysisData(e),o=this.encodeData(t),r=this.processConnection(o);this.padBuffer(r);var n=this.generateErrorCorrectionCode(r),a=this.getFinalMessage(n);this.setModules(a);return this.modules};return QRCodeModel2}(QRCodeBase);export{QRCodeModel2};var QRCodeModel1=function(e){__extends(QRCodeModel1,e);function QRCodeModel1(){return null!==e&&e.apply(this,arguments)||this}QRCodeModel1.prototype.encodeData=function(e,t){var o=this.charCountIndicatorBitsNumber,r=this.charCode,n=new BitBuffer;n.put(0,4);if(t){n.put(MODE_INDICATOR.StructuredAppend,4);n.put(t.connectionNo,4);n.put(t.connectionCnt-1,4);n.put(getParityData(r),8)}e.forEach((function(e){if(e.code){var t;switch(e.mode){case"Numeric":t=new ModeNumeric(e.code);break;case"Alphanumeric":t=new ModeAlphanumeric(e.code);break;case"8BitByte":t=new Mode8BitByte(e.code);break;case"Kanji":t=new ModeKanji(e.code)}n.put(t.getMode(),4);n.put(t.getLength(),o[t.mode]);t.write(n)}}));return n};QRCodeModel1.prototype.getFinalMessage=function(e){var t=[],o=e.map((function(e){return e.data})),r=e.map((function(e){return e.ec}));o.forEach((function(e){return t=t.concat(e)}));r.forEach((function(e){return t=t.concat(e)}));return t};QRCodeModel1.prototype.setModules=function(e){var t=this.modulesCount;this.modules=createModules(t);this.addPositionDetectionPattern();this.addExtensionPattern();this.addTimingPattern();this.maskModules(e)};QRCodeModel1.prototype.maskModules=function(e){var t=this.modules,o=this.errorCorrectionLevel,r=this.model,n=this.config.mask;if("auto"===n)this.autoMask(e);else{var a=getMaskFunc(n);this.maskPattern=n;var s=addFormatInformation(t,n,o,r);this.modules=this.fillDataModules(s,e,a)}};QRCodeModel1.prototype.autoMask=function(e){var t,o,r,n=this,a=this.modules,s=this.errorCorrectionLevel,c=this.model;maskFuncs.forEach((function(d,u){var l=addFormatInformation(a,u,s,c),h=n.fillDataModules(l,e,d),C=getMaskScore(h);if(!o||C<o){t=h;o=C;r=u}}));this.modules=t;this.maskPattern=r};QRCodeModel1.prototype.addExtensionPattern=function(){var e=this.modules,t=this.version,o=e.length;e[o-1][o-1]=1;e[o-2][o-1]=0;e[o-1][o-2]=0;e[o-2][o-2]=0;var r=Math.floor(t/2);if(Utils.isEven(t))for(var n=0;n<r;n++){this.addBaseExtension(13+8*n);this.addRightExtension(13+8*n)}else for(n=0;n<r;n++){this.addBaseExtension(17+8*n);this.addRightExtension(17+8*n)}};QRCodeModel1.prototype.addBaseExtension=function(e){var t=this.modules,o=t.length,r=o-2,n=o-1;t[r][e]=0;t[r][e+1]=0;t[r][e+2]=0;t[r][e+3]=0;t[n][e]=1;t[n][e+1]=1;t[n][e+2]=1;t[n][e+3]=1};QRCodeModel1.prototype.addRightExtension=function(e){var t=this.modules,o=t.length,r=o-2,n=o-1;t[e][r]=0;t[e+1][r]=0;t[e+2][r]=0;t[e+3][r]=0;t[e][n]=1;t[e+1][n]=1;t[e+2][n]=1;t[e+3][n]=1};QRCodeModel1.prototype.fillDataModules=function(e,t,o){var r,n,a=e.length;r=n=a-1;var s=2,c=new BitBuffer(t);c.next();c.next();c.next();c.next();for(;r>=0;){if(r==a-5)s=4;else if(8==r)s=2;else if(6==r){r--;continue}for(;n>=0;)if(null===e[n][r]){for(var d=0;d<s;d++){var u=c.next();o(n,r-d)&&(u=!u);e[n][r-d]=+u}n--}else n--;r-=s;n=a-1}return e};QRCodeModel1.prototype.getMatrix=function(){var e=this.charCode,t=this.analysisData(e),o=this.encodeData(t),r=this.processConnection(o);this.padBuffer(r);var n=this.generateErrorCorrectionCode(r),a=this.getFinalMessage(n);this.setModules(a);return this.modules};return QRCodeModel1}(QRCodeBase);export{QRCodeModel1};var QRCodeEncoder=function(e){__extends(QRCodeEncoder,e);function QRCodeEncoder(t){var o=this;t.merge(QRCodeEncoder.DefaultConfig);var r,n=o=e.call(this,t)||this,a=n.encodeConfig.text,s=n.config;r="2"==s.model?new QRCodeModel2(a,s):new QRCodeModel1(a,s);o.innerQRCode=r;return o}QRCodeEncoder.prototype.calculateData=function(){return this.innerQRCode.getMatrix()};QRCodeEncoder.prototype.validate=function(){var e=this.config,t=e.version,o=e.model,r=e.charset,n=e.charCode,a=e.connectionNo,s=this.encodeConfig.text;if(!(s||n&&0!==n.length))throw new InvalidTextException(s);if("1"!=o&&"2"!=o)throw new InvalidOptionsException({model:o});if("UTF-8"!=r&&"Shift_JIS"!=r)throw new InvalidOptionsException({charset:r});if("1"==o&&Utils.isNumberLike(t)&&(t<1||t>14))throw new InvalidOptionsException({version:t},"Model 1 only support version 1 - 14.");if("2"==o&&Utils.isNumberLike(t)&&(t<1||t>40))throw new InvalidOptionsException({version:t},"Model 2 only support version 1 - 40.");if(a>15||a<0)throw new InvalidOptionsException({connectionNo:a},"ConnectionNo is in range 0 - 15.")};QRCodeEncoder.DefaultConfig={version:"auto",errorCorrectionLevel:"L",model:2,mask:"auto",connection:!1,connectionNo:0,charCode:void 0,charset:"UTF-8",quietZone:{top:4,left:4,right:4,bottom:4}};return QRCodeEncoder}(TwoDimensionalBarcode);export{QRCodeEncoder};Barcode.registerEncoder("QRCode",QRCodeEncoder);var TableCode128A=[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","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","[","\\","]","^","_","\0","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","","","","","","","","","","","","",""," "," "," "," "," "," "," "," "," "," "],TableCode128B=[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","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","[","\\","]","^","_","`","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","{","|","}","~",""," "," "," "," "," "," "," "," "," "," "],TableCode128Data=["212222","222122","222221","121223","121322","131222","122213","122312","132212","221213","221312","231212","112232","122132","122231","113222","123122","123221","223211","221132","221231","213212","223112","312131","311222","321122","321221","312212","322112","322211","212123","212321","232121","111323","131123","131321","112313","132113","132311","211313","231113","231311","112133","112331","132131","113123","113321","133121","313121","211331","231131","213113","213311","213131","311123","311321","331121","312113","312311","332111","314111","221411","431111","111224","111422","121124","121421","141122","141221","112214","112412","122114","122411","142112","142211","241211","221114","413111","241112","134111","111242","121142","121241","114212","124112","124211","411212","421112","421211","212141","214121","412121","111143","111341","131141","114113","114311","411113","411311","113141","114131","311141","411131","211412","211214","211232"];export var stopPattern="2331112";export var Code128Sym={CodeC:99,CodeB:100,CodeA:101,FNC1:102,FNC2:97,FNC3:96,StartA:103,StartB:104,StartC:105};export var Code128Char={CodeC:String.fromCharCode(204),CodeB:String.fromCharCode(205),CodeA:String.fromCharCode(206),FNC1:Constants.FNC1,FNC2:Constants.FNC2,FNC3:Constants.FNC3,StartA:String.fromCharCode(208),StartB:String.fromCharCode(209),StartC:String.fromCharCode(210)};export function getCharValue(e,t){if(e===Code128Char.FNC1)return Code128Sym.FNC1;if(e===Code128Char.FNC2)return Code128Sym.FNC2;if(e===Code128Char.FNC3)return Code128Sym.FNC3;switch(t){case"A":return TableCode128A.indexOf(e);case"B":return TableCode128B.indexOf(e);case"C":return+e}}export function getCharPattern(e,t){var o=TableCode128Data[getCharValue(e,t)];if(!o)throw new InvalidCharacterException(e);return o}export function getPatternByIndex(e){return TableCode128Data[e]}export function encode(e){var t="";Utils.str2Array(e).forEach((function(e,o){Utils.isEven(o)?t+=Utils.strRepeat("1",+e):t+=Utils.strRepeat("0",+e)}));return t}var CODE_SET_A="A",CODE_SET_B="B",CODE_SET_C="C",Code128Auto=function(){function Code128Auto(e,t){void 0===t&&(t=!1);this.text=e;this.isUccEan128=t;this.validate()}Code128Auto.prototype.validate=function(){var e=this.text;if(!/^[\x00-\x7F\xC8-\xD3]+$/.test(e))throw new InvalidTextException(e)};Code128Auto.prototype.calculateGroup=function(){var e=this.text,t={code:this.isUccEan128?CODE_SET_C:CODE_SET_B,text:""},o=[];o.push(t);for(var r=0,n=e.length;r<n;r++){var a=t.code,s=e[r];if(t.code!==CODE_SET_C&&r+3<n&&Utils.isNumberString(e.substr(r,4))||t.code===CODE_SET_C&&r+1<n&&Utils.isNumberString(e.substr(r,2))){a=CODE_SET_C;s+=e[++r]}else if(getCharValue(s,a=t.code===CODE_SET_C?CODE_SET_B:t.code)<0&&getCharValue(s,a=t.code===CODE_SET_A?CODE_SET_B:CODE_SET_A)<0)continue;if(t.code!==a){t={code:a,text:s};o.push(t)}else t.text+=s}return o.filter((function(e){return e.text}))};Code128Auto.prototype.getData=function(){var e=this.calculateGroup(),t=this.checksum(e),o="";e.forEach((function(e,t){if(0===t){var r=getPatternByIndex(Code128Sym["Start"+e.code]);o+=encode(r)}else{r=getPatternByIndex(Code128Sym["Code"+e.code]);o+=encode(r)}e.code===CODE_SET_C?Utils.sliceString(e.text,2,(function(t){o+=encode(getCharPattern(t,e.code))})):Utils.sliceString(e.text,1,(function(t){o+=encode(getCharPattern(t,e.code))}))}));o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)};Code128Auto.prototype.checksum=function(e){var t=0,o=0;e.forEach((function(e,r){var n=e.code,a=e.text;if(0===r)o+=Code128Sym["Start"+n];else{var s=Code128Sym["Code"+n];o+=s*++t}n===CODE_SET_C?Utils.sliceString(a,2,(function(e){o+=getCharValue(e,n)*++t})):Utils.sliceString(a,1,(function(e){o+=getCharValue(e,n)*++t}))}));return o%103};return Code128Auto}();export{Code128Auto};var Code128C=function(){function Code128C(e){this.text=e;this.validate()}Code128C.prototype.validate=function(){var e=this.text;if(!/^(\xCF*[0-9]{2}\xCF*)+$/.test(e))throw new InvalidTextException(e)};Code128C.prototype.getData=function(){var e=this.text,t=this.checksum(),o="",r=getPatternByIndex(Code128Sym.StartC);o+=encode(r);Utils.sliceString(e,2,(function(e){var t=getCharPattern(e,"C");o+=encode(t)}));o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)};Code128C.prototype.checksum=function(){var e=this.text,t=0,o=0;Utils.sliceString(e,2,(function(e){o+=getCharValue(e,"C")*++t}));return(o+=Code128Sym.StartC)%103};return Code128C}();export{Code128C};var Code128B=function(){function Code128B(e){this.text=e;this.validate()}Code128B.prototype.validate=function(){var e=this.text;if(!/^[\x20-\x7F\xC8-\xCF]+$/.test(e))throw new InvalidTextException(e)};Code128B.prototype.getData=function(){var e=this.text,t=this.checksum(),o="",r=getPatternByIndex(Code128Sym.StartB);o+=encode(r);Utils.sliceString(e,1,(function(e){var t=getCharPattern(e,"B");o+=encode(t)}));o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)};Code128B.prototype.checksum=function(){var e=this.text,t=0,o=0;Utils.sliceString(e,1,(function(e){o+=getCharValue(e,"B")*++t}));return(o+=Code128Sym.StartB)%103};return Code128B}();export{Code128B};var Code128A=function(){function Code128A(e){this.text=e;this.validate()}Code128A.prototype.validate=function(){var e=this.text;if(!/^[\x00-\x5F\xC8-\xCF]+$/.test(e))throw new InvalidTextException(e)};Code128A.prototype.getData=function(){var e=this.text,t=this.checksum(),o="",r=getPatternByIndex(Code128Sym.StartA);o+=encode(r);Utils.sliceString(e,1,(function(e){var t=getCharPattern(e,"A");o+=encode(t)}));o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)};Code128A.prototype.checksum=function(){var e=this.text,t=0,o=0;Utils.sliceString(e,1,(function(e){o+=getCharValue(e,"A")*++t}));return(o+=Code128Sym.StartA)%103};return Code128A}();export{Code128A};var Code128Encoder=function(e){__extends(Code128Encoder,e);function Code128Encoder(t,o){void 0===o&&(o=!1);var r=this;t.merge(Code128Encoder.DefaultConfig);var n=(r=e.call(this,t)||this).encodeConfig.text;r.isUccEan128=o;o&&n[0]!==Code128Char.FNC1&&(n=Code128Char.FNC1+n);r.text=n;r.label=n.replace(/[^\x20-\x7E]/g,"");return r}Code128Encoder.prototype.validate=function(){};Code128Encoder.prototype.calculateData=function(){var e,t=this.config.codeSet,o=this.text;if(this.isUccEan128)e=new Code128Auto(o);else switch(t){case"A":e=new Code128A(o);break;case"B":e=new Code128B(o);break;case"C":e=new Code128C(o);break;default:e=new Code128Auto(o)}return e.getData()};Code128Encoder.DefaultConfig={codeSet:"auto",quietZone:{right:10,left:10}};return Code128Encoder}(OneDimensionalBarcode);export{Code128Encoder};var GS1_128Encoder=function(e){__extends(GS1_128Encoder,e);function GS1_128Encoder(t){return e.call(this,t,!0)||this}return GS1_128Encoder}(Code128Encoder);export{GS1_128Encoder};Barcode.registerEncoder("GS1_128",GS1_128Encoder);Barcode.registerEncoder("Code128",Code128Encoder);var EncodeTable_Code39=function(){function EncodeTable_Code39(){}EncodeTable_Code39.getMod43Val=function(e){var t=0;Utils.sliceString(e,1,(function(e){t+=EncodeTable_Code39.MODULO_43_CHECK_TABLE.indexOf(e)}));return EncodeTable_Code39.MODULO_43_CHECK_TABLE[t%43]};EncodeTable_Code39.getFullASCIIChar=function(e){var t="";Utils.sliceString(e,1,(function(o){var r=EncodeTable_Code39.FULL_ASCII_TABLE[o.charCodeAt(0)];if(!r)throw new InvalidTextException(e);t+=r}));return t};EncodeTable_Code39.TABLE={0:"000110100",1:"100100001",2:"001100001",3:"101100000",4:"000110001",5:"100110000",6:"001110000",7:"000100101",8:"100100100",9:"001100100",A:"100001001",B:"001001001",C:"101001000",D:"000011001",E:"100011000",F:"001011000",G:"000001101",H:"100001100",I:"001001100",J:"000011100",K:"100000011",L:"001000011",M:"101000010",N:"000010011",O:"100010010",P:"001010010",Q:"000000111",R:"100000110",S:"001000110",T:"000010110",U:"110000001",V:"011000001",W:"111000000",X:"010010001",Y:"110010000",Z:"011010000","-":"010000101",".":"110000100"," ":"011000100",$:"010101000","/":"010100010","+":"010001010","%":"000101010","*":"010010100"};EncodeTable_Code39.MODULO_43_CHECK_TABLE=Utils.str2Array("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%");EncodeTable_Code39.FULL_ASCII_TABLE=["%U","$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","%A","%B","%C","%D","%E"," ","/A","/B","/C","/D","/E","/F","/G","/H","/I","/J","/K","/L","-",".","/O","0","1","2","3","4","5","6","7","8","9","/Z","%F","%G","%H","%I","%J","%V","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","%K","%L","%M","%N","%O","%W","+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","%P","%Q","%R","%S","%T"];return EncodeTable_Code39}();export{EncodeTable_Code39};var Code39Encoder=function(e){__extends(Code39Encoder,e);function Code39Encoder(t){var o=this;t.merge(Code39Encoder.DefaultConfig);var r=o=e.call(this,t)||this,n=r.encodeConfig,a=n.text,s=n.hideExtraChecksum,c=r.config,d=c.checkDigit,u=c.fullASCII,l=c.nwRatio,h=c.labelWithStartAndStopCharacter,C=u?EncodeTable_Code39.getFullASCIIChar(a):a;if(d){var f=EncodeTable_Code39.getMod43Val(C);o.text=Code39Encoder.START_STOP_CHARACTERS+C+f+Code39Encoder.START_STOP_CHARACTERS;var p=s?a:a+f,E=Code39Encoder.START_STOP_CHARACTERS+p+Code39Encoder.START_STOP_CHARACTERS;o.label=h?E:p}else{o.text=Code39Encoder.START_STOP_CHARACTERS+C+Code39Encoder.START_STOP_CHARACTERS;p=a,E=Code39Encoder.START_STOP_CHARACTERS+p+Code39Encoder.START_STOP_CHARACTERS;o.label=h?E:p}o.nwRatio=+l;return o}Code39Encoder.prototype.validate=function(){var e=this.encodeConfig.text,t=this.config,o=t.fullASCII,r=t.nwRatio;if(!o&&!/^[0-9A-Z\-\.\ \$\/\+\%]+$/.test(e))throw new InvalidTextException(e);if(2!=r&&3!=r)throw new InvalidOptionsException({nwRatio:r},"NwRatio is 2 or 3")};Code39Encoder.prototype.encode=function(e){var t=this.nwRatio,o="",r=Utils.strRepeat("1",t),n=Utils.strRepeat("0",t);Utils.str2Array(e).forEach((function(e,t){Utils.isEven(t)?o+="1"===e?r:"1":o+="1"===e?n:"0"}));return o};Code39Encoder.prototype.calculateData=function(){var e=this,t=this.text,o="";Utils.sliceString(t,1,(function(t){o=o+e.encode(EncodeTable_Code39.TABLE[t])+"0"}));return o=o.substr(0,o.length-1)};Code39Encoder.DefaultConfig={checkDigit:!1,fullASCII:!1,nwRatio:3,labelWithStartAndStopCharacter:!1,quietZone:{right:10,left:10}};Code39Encoder.START_STOP_CHARACTERS="*";return Code39Encoder}(OneDimensionalBarcode);export{Code39Encoder};Barcode.registerEncoder("Code39",Code39Encoder);var EncodeTable=function(){function EncodeTable(){}EncodeTable.encodeCharByTable=function(e,t){return EncodeTable.TABLE[t][e]};EncodeTable.encodeByStructure=function(e,t){return Utils.str2Array(e).reduce((function(e,o,r){return e+=EncodeTable.encodeCharByTable(o,t[r])}),"")};EncodeTable.encodeByTable=function(e,t){if(e.length>1){return Utils.str2Array(e).reduce((function(e,o){return e+=EncodeTable.encodeCharByTable(o,t)}),"")}return EncodeTable.encodeCharByTable(e,t)};EncodeTable.TABLE={A:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],B:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],C:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"]};return EncodeTable}();export{EncodeTable};var AddOnSymbol=function(){function AddOnSymbol(e,t,o,r){this.isTextGroup=o;this.addOn=""+e;if("auto"!==t)if(Utils.isNumberLike(t))t=+t;else{t=Utils.convertUnit(Utils.fixSize2PixelDefault(t));t/=r}this.addOnHeight=t;this.validate()}AddOnSymbol.get2DigitAddOnTable=function(e){switch((e=parseInt(e))%4){case 0:return{leftStructure:"A",rightStructure:"A"};case 1:return{leftStructure:"A",rightStructure:"B"};case 2:return{leftStructure:"B",rightStructure:"A"};case 3:return{leftStructure:"B",rightStructure:"B"}}};AddOnSymbol.get5DigitAddOnTable=function(e){var t=3*(+(e+="")[0]+ +e[2]+ +e[4])+9*(+e[1]+ +e[3]);return AddOnSymbol.fiveDigitAddOnStructure[t%10]};AddOnSymbol.prototype.validate=function(){var e=this.addOn;if(2!==e.length&&5!==e.length)throw new InvalidOptionsException({addOn:e},"Add on length should be 2 or 5.")};AddOnSymbol.prototype._encode2DigitAddOn=function(){var e,t,o,r=this.addOn,n=this.isTextGroup,a=[];e=AddOnSymbol.get2DigitAddOnTable(r);t=EncodeTable.encodeByTable(r[0],e.leftStructure[0]);o=EncodeTable.encodeByTable(r[1],e.rightStructure[0]);if(n){a.push({binary:AddOnSymbol.ADD_ON_GUARD,role:"ADDON"});a.push({binary:t,text:r[0],role:"ADDON"});a.push({binary:AddOnSymbol.ADD_ON_DELINEATOR,role:"ADDON"});a.push({binary:o,text:r[1],role:"ADDON"})}else a.push({binary:AddOnSymbol.ADD_ON_GUARD+t+AddOnSymbol.ADD_ON_DELINEATOR+o,text:r,role:"ADDON"});return a};AddOnSymbol.prototype._encode5DigitAddOn=function(){var e=this.addOn,t=this.isTextGroup,o=[],r=AddOnSymbol.get5DigitAddOnTable(e);if(t){o.push({binary:AddOnSymbol.ADD_ON_GUARD,role:"ADDON"});Utils.str2Array(e).forEach((function(t,n){o.push({binary:EncodeTable.encodeByTable(t,r[n]),text:t,role:"ADDON"});n<e.length-1&&o.push({binary:AddOnSymbol.ADD_ON_DELINEATOR,role:"ADDON"})}))}else{var n=Utils.str2Array(e).reduce((function(t,o,n){t+=EncodeTable.encodeByTable(o,r[n]);n<e.length-1&&(t+=AddOnSymbol.ADD_ON_DELINEATOR);return t}),"");o.push({binary:AddOnSymbol.ADD_ON_GUARD+n,text:e,role:"ADDON"})}return o};AddOnSymbol.prototype.calculateData=function(){var e=this.addOn,t=[];2===e.length?t=this._encode2DigitAddOn():5===e.length&&(t=this._encode5DigitAddOn());t.push({text:">",role:"ADDON_RIGHT_QUIET_ZONE"});return t};AddOnSymbol.fiveDigitAddOnStructure=["BBAAA","BABAA","BAABA","BAAAB","ABBAA","AABBA","AAABB","ABABA","ABAAB","AABAB"];AddOnSymbol.ADD_ON_GUARD="1011";AddOnSymbol.ADD_ON_DELINEATOR="01";return AddOnSymbol}();export{AddOnSymbol};var EANBase=function(e){__extends(EANBase,e);function EANBase(t){var o=this;t.merge(EANBase.DefaultConfig);var r=o=e.call(this,t)||this,n=r.style,a=n.textAlign,s=n.unitValue,c=r.config,d=c.addOnLabelPosition,u=c.addOn,l=c.addOnHeight;o.isTextGroup="group"===a;o.isAddOnLabelBottom="top"!==d;o._setAddOn(u,l,s);return o}EANBase.prototype._setAddOn=function(e,t,o){if(Utils.isDefined(e)){this.addOn=new AddOnSymbol(e,t,this.isTextGroup,o);this.addOnHeight=this.addOn.addOnHeight}else this.addOnHeight=0};EANBase.prototype.checksum=function(e,t){void 0===t&&(t=!1);var o=Utils.str2Array(e),r=t?Utils.isOdd:Utils.isEven,n=o.reduce((function(e,t,o){t=+t;return e+=r(o)?t:3*t}),0)%10;return 0===n?0:10-n};EANBase.prototype.convertToShape=function(e){var t=this,o=t.isTextGroup,r=t.addOnHeight,n=t.isAddOnLabelBottom,a=t.style.textAlign,s=t.encodeConfig,c=s.isLabelBottom,d=s.height,u=s.quietZone,l=s.showLabel,h=s.fontSizeInUnit;l||(h=0);r=r||0;var C,f,p,E,g,_,A,b=[],m=u.left,v=u.top;if(c){C=d+5;f=v+d;p=l?d+h:C;if(n)g=(E=v)+(_="auto"===r?l?d:C:r);else{g=v;E=v+h;_="auto"===r?C-h:r}}else{C=d;d-=5;f=v;v+=h;p=l?C+h:C;if(n){E=u.top;g=E+(_="auto"===r?l?d:C:r)}else{g=u.top;E=u.top+h;_="auto"===r?C:r}}A=l?_+h:_;e.forEach((function(e){var t,r=v,n=d,s=f,c=o?"center":a,h=m;switch(e.role){case"GUARD":n=C;t=e.binary.length;break;case"ADDON":r=E;n=_;s=g;t=e.binary.length;break;case"LEFT_QUIET_ZONE":c="left";t=u.left;h=0;break;case"RIGHT_QUIET_ZONE":case"NO_ADDON_RIGHT_QUIET_ZONE":c="right";t=u.right;break;case"ADDON_QUIET_ZONE":t=u.addOn;break;case"ADDON_RIGHT_QUIET_ZONE":c="right";s=g;t=u.right;break;default:t=e.binary.length}if(l&&e.text){switch(c){case"center":h+=t/2;break;case"right":h+=t}var p={type:"text",x:h,y:s,text:e.text,textAlign:c,maxWidth:t};if("NO_ADDON_RIGHT_QUIET_ZONE"===e.role||"ADDON_RIGHT_QUIET_ZONE"===e.role){p.fontStyle="normal";p.fontWeight="normal";p.textDecoration="none"}b.push(p)}e.binary?Utils.combineTruthy(e.binary).forEach((function(e){if(0!==e){b.push({type:"rect",x:m,y:r,width:e,height:n});m+=e}else m++})):"ADDON_QUIET_ZONE"===e.role&&(m+=t)}));this.size={width:m+u.right,height:Math.max(p,A)+u.top+u.bottom};this.shapes=b};EANBase.prototype.afterApplyDesiredSize=function(){var e=this.config,t=e.addOn,o=e.addOnHeight,r=this.style.unitValue;this._setAddOn(t,o,r);this.addOnHeight>this.encodeConfig.height&&(this.addOnHeight=this.encodeConfig.height)};EANBase.NORMAL_GUARD="101";EANBase.CENTRE_GUARD="01010";EANBase.DefaultConfig={quietZone:{right:7,left:11}};return EANBase}(OneDimensionalBarcode);export{EANBase};var UPC_E=function(e){__extends(UPC_E,e);function UPC_E(t,o,r){var n=this;t.merge(UPC_E.DefaultConfig);var a=(n=e.call(this,t)||this).encodeConfig,s=a.text,c=a.hideExtraChecksum;n.prefix=o;var d=s;if(s.length<7){s+=n.checksum(s);c||(d=s)}n.label=d;n.text=s;n.tableStructure=r;return n}UPC_E.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^(\d{6}|\d{7})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 6 or 7.");if(7===e.length){if(this.checksum(e.substr(0,6))!=e[6])throw new InvalidTextException(e,"Check digit is invalid.")}};UPC_E.prototype.checksum=function(t){var o;switch(t[5]){case"0":case"1":case"2":o=t.substr(0,2)+t[5]+"0000"+t.substr(2,3);break;case"3":o=t.substr(0,3)+"00000"+t.substr(3,2);break;case"4":o=t.substr(0,4)+"00000"+t[4];break;default:o=t.substr(0,5)+"0000"+t[5]}o=this.prefix+o;return e.prototype.checksum.call(this,o,!0)};UPC_E.prototype.calculateData=function(){var e=this,t=e.text,o=e.addOn,r=e.isTextGroup,n=e.prefix,a=e.tableStructure,s=e.label,c=t[6],d=s[6];t=t.substr(0,6);var u=s.substr(0,6),l=a[c],h=[];h.push({text:n,role:"LEFT_QUIET_ZONE"});h.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});r?Utils.str2Array(t).forEach((function(e,t){h.push({binary:EncodeTable.encodeByTable(e,l[t]),text:u[t]})})):h.push({binary:EncodeTable.encodeByStructure(t,l),text:u});h.push({binary:UPC_E.SPECIAL_GUARD,role:"GUARD"});if(o){h.push({text:d,role:"ADDON_QUIET_ZONE"});h=h.concat(o.calculateData())}else h.push({text:d,role:"NO_ADDON_RIGHT_QUIET_ZONE"});return h};UPC_E.DefaultConfig={addOnHeight:"auto",addOnLabelPosition:"top",quietZone:{left:9,addOn:5}};UPC_E.SPECIAL_GUARD="010101";return UPC_E}(EANBase);export{UPC_E};var UPC_E1_Encoder=function(e){__extends(UPC_E1_Encoder,e);function UPC_E1_Encoder(t){return e.call(this,t,"1",UPC_E1_Encoder.structure)||this}UPC_E1_Encoder.structure=["AAABBB","AABABB","AABBAB","AABBBA","ABAABB","ABBAAB","ABBBAA","ABABAB","ABABBA","ABBABA"];return UPC_E1_Encoder}(UPC_E);export{UPC_E1_Encoder};var UPC_E0_Encoder=function(e){__extends(UPC_E0_Encoder,e);function UPC_E0_Encoder(t){return e.call(this,t,"0",UPC_E0_Encoder.structure)||this}UPC_E0_Encoder.structure=["BBBAAA","BBABAA","BBAABA","BBAAAB","BABBAA","BAABBA","BAAABB","BABABA","BABAAB","BAABAB"];return UPC_E0_Encoder}(UPC_E);export{UPC_E0_Encoder};var UPC_A_Encoder=function(e){__extends(UPC_A_Encoder,e);function UPC_A_Encoder(t){var o=this;t.merge(UPC_A_Encoder.DefaultConfig);var r=(o=e.call(this,t)||this).encodeConfig,n=r.text,a=r.hideExtraChecksum,s=n;if(n.length<12){n+=o.checksum(n,!0);a||(s=n)}o.label=s;o.text=n;return o}UPC_A_Encoder.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^(\d{11}|\d{12})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 11 or 12.");if(12===e.length){if(this.checksum(e.substr(0,11),!0)!=e[11])throw new InvalidTextException(e,"Check digit is invalid.")}};UPC_A_Encoder.prototype.calculateData=function(){var e=this.text,t=this.addOn,o=this.isTextGroup,r=this.label,n=e[0],a=e[11],s=r[11],c=e.substr(1,5),d=e.substr(6,5),u=r.substr(1,5),l=r.substr(6,5),h=[];h.push({text:n,role:"LEFT_QUIET_ZONE"});h.push({binary:EANBase.NORMAL_GUARD+EncodeTable.encodeByTable(n,"A"),role:"GUARD"});o?Utils.str2Array(c).forEach((function(e,t){h.push({binary:EncodeTable.encodeByTable(e,"A"),text:u[t]})})):h.push({binary:EncodeTable.encodeByTable(c,"A"),text:u});h.push({binary:EANBase.CENTRE_GUARD,role:"GUARD"});o?Utils.str2Array(d).forEach((function(e,t){h.push({binary:EncodeTable.encodeByTable(e,"C"),text:l[t]})})):h.push({binary:EncodeTable.encodeByTable(d,"C"),text:l});h.push({binary:EncodeTable.encodeByTable(a,"C")+EANBase.NORMAL_GUARD,role:"GUARD"});if(t){h.push({text:s,role:"ADDON_QUIET_ZONE"});h=h.concat(t.calculateData())}else h.push({text:s,role:"NO_ADDON_RIGHT_QUIET_ZONE"});return h};UPC_A_Encoder.DefaultConfig={addOnHeight:"auto",addOnLabelPosition:"top",quietZone:{right:9,left:9,addOn:5}};return UPC_A_Encoder}(EANBase);export{UPC_A_Encoder};Barcode.registerEncoder("UPC-A",UPC_A_Encoder);Barcode.registerEncoder("UPC-E0",UPC_E0_Encoder);Barcode.registerEncoder("UPC-E1",UPC_E1_Encoder);var EAN13Encoder=function(e){__extends(EAN13Encoder,e);function EAN13Encoder(t){var o=this;t.merge(EAN13Encoder.DefaultConfig);var r=(o=e.call(this,t)||this).encodeConfig,n=r.text,a=r.hideExtraChecksum,s=n;if(n.length<13){n+=o.checksum(n);a||(s=n)}o.label=s;o.text=n;return o}EAN13Encoder.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^[1-9](\d{11}|\d{12})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. And it should not start with 0. The length should be 12 or 13.");if(13===e.length){if(this.checksum(e.substr(0,12))!=e[12])throw new InvalidTextException(e,"Check digit is invalid.")}};EAN13Encoder.prototype.calculateData=function(){var e=this.text,t=this.addOn,o=this.isTextGroup,r=this.label,n=e.substr(1,6),a=e.substr(7,6),s=r.substr(1,6),c=r.substr(7,6),d=EAN13Encoder.leftStructure[e[0]],u=[];u.push({text:e[0],role:"LEFT_QUIET_ZONE"});u.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});o?Utils.str2Array(n).forEach((function(e,t){u.push({binary:EncodeTable.encodeByTable(e,d[t]),text:s[t]})})):u.push({binary:EncodeTable.encodeByStructure(n,d),text:s});u.push({binary:EANBase.CENTRE_GUARD,role:"GUARD"});o?Utils.str2Array(a).forEach((function(e,t){u.push({binary:EncodeTable.encodeByTable(e,"C"),text:c[t]})})):u.push({binary:EncodeTable.encodeByTable(a,"C"),text:c});u.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});if(t){u.push({role:"ADDON_QUIET_ZONE"});u=u.concat(t.calculateData())}else u.push({text:">",role:"NO_ADDON_RIGHT_QUIET_ZONE"});return u};EAN13Encoder.leftStructure=["AAAAAA","AABABB","AABBAB","AABBBA","ABAABB","ABBAAB","ABBBAA","ABABAB","ABABBA","ABBABA"];EAN13Encoder.DefaultConfig={addOnHeight:"auto",addOnLabelPosition:"top",quietZone:{addOn:5}};return EAN13Encoder}(EANBase);export{EAN13Encoder};var EAN8Encoder=function(e){__extends(EAN8Encoder,e);function EAN8Encoder(t){var o=this;t.merge(EAN8Encoder.DefaultConfig);var r=(o=e.call(this,t)||this).encodeConfig,n=r.text,a=r.hideExtraChecksum,s=n;if(n.length<8){n+=o.checksum(n,!0);a||(s=n)}o.label=s;o.text=n;return o}EAN8Encoder.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^[0-9](\d{6}|\d{7})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 7 or 8.");if(8===e.length){if(this.checksum(e.substr(0,7),!0)!=e[7])throw new InvalidTextException(e,"Check digit is invalid.")}};EAN8Encoder.prototype.calculateData=function(){var e=this.text,t=this.label,o=this.isTextGroup,r=e.substr(0,4),n=e.substr(4,4),a=t.substr(0,4),s=t.substr(4,4),c=[];c.push({text:"<",role:"LEFT_QUIET_ZONE"});c.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});o?Utils.str2Array(r).forEach((function(e,t){c.push({binary:EncodeTable.encodeByTable(e,"A"),text:a[t]})})):c.push({binary:EncodeTable.encodeByTable(r,"A"),text:a});c.push({binary:EANBase.CENTRE_GUARD,role:"GUARD"});o?Utils.str2Array(n).forEach((function(e,t){c.push({binary:EncodeTable.encodeByTable(e,"C"),text:s[t]})})):c.push({binary:EncodeTable.encodeByTable(n,"C"),text:s});c.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});c.push({text:">",role:"RIGHT_QUIET_ZONE"});return c};EAN8Encoder.DefaultConfig={quietZone:{left:7}};return EAN8Encoder}(EANBase);export{EAN8Encoder};Barcode.registerEncoder("EAN8",EAN8Encoder);Barcode.registerEncoder("EAN13",EAN13Encoder);var REG=/^([A-D]?)([0-9\-\$\:\.\+\/]+)([A-D]?)$/,CodabarEncoder=function(e){__extends(CodabarEncoder,e);function CodabarEncoder(t){var o=this;t.merge(CodabarEncoder.DefaultConfig);var r=o=e.call(this,t)||this,n=r.config,a=n.checkDigit,s=n.nwRatio,c=r.encodeConfig,d=c.text,u=c.hideExtraChecksum,l=o.getTextEntity(d),h=l.originStartPattern,C=l.startPattern,f=l.content,p=l.originStopPattern,E=l.stopPattern;o.label=d;if(a){var g=o.checksum(f);o.text=C+f+g+E;u||(o.label=h+f+g+p)}else o.text=C+f+E;o.nwRatio=+s;return o}CodabarEncoder.prototype.validate=function(){var e=this.config.nwRatio,t=this.encodeConfig.text;if(!REG.test(t))throw new InvalidTextException(t);if(2!=e&&3!=e)throw new InvalidOptionsException({nwRatio:e},"NwRatio is 2 or 3")};CodabarEncoder.prototype.getTextEntity=function(e){var t=REG.exec(e);if(!t)throw new InvalidTextException(e);var o=t[1],r=o||"A",n=t[2],a=t[3];return{originStartPattern:o,startPattern:r,content:n,originStopPattern:a,stopPattern:a||"B"}};CodabarEncoder.prototype.encode=function(e){var t=this.nwRatio,o="",r=Utils.strRepeat("1",t),n=Utils.strRepeat("0",t);Utils.str2Array(e).forEach((function(e,t){Utils.isEven(t)?o+="1"===e?r:"1":o+="1"===e?n:"0"}));return o};CodabarEncoder.prototype.calculateData=function(){var e=this,t=this.text,o="";Utils.sliceString(t,1,(function(t){o=o+e.encode(CodabarEncoder.TABLE[t])+"0"}));return o=o.substr(0,o.length-1)};CodabarEncoder.prototype.checksum=function(e){var t=Utils.str2Array(e).filter((function(e){return Utils.isInteger(+e)})).reverse().reduce((function(e,t,o){var r=Utils.toNumber(t);if(Utils.isEven(o)){var n=2*r;e+=n>9?n-9:n}else e+=r;return e}),0)%10;0!==t&&(t=10-t);return t};CodabarEncoder.DefaultConfig={checkDigit:!1,quietZone:{right:10,left:10},nwRatio:3};CodabarEncoder.TABLE={0:"0000011",1:"0000110",2:"0001001",3:"1100000",4:"0010010",5:"1000010",6:"0100001",7:"0100100",8:"0110000",9:"1001000","-":"0001100",$:"0011000",":":"1000101","/":"1010001",".":"1010100","+":"0010101",A:"0011010",B:"0101001",C:"0001011",D:"0001110"};return CodabarEncoder}(OneDimensionalBarcode);export{CodabarEncoder};Barcode.registerEncoder("Codabar",CodabarEncoder);export var CodabarClsNames={hostElement:"wj-barcode-codabar"};export var Code128ClsNames={hostElement:"wj-barcode-code128"};export var Code39ClsNames={hostElement:"wj-barcode-code39"};export var Ean13ClsNames={hostElement:"wj-barcode-ean13"};export var Ean8ClsNames={hostElement:"wj-barcode-ean8"};export var EanBaseClsNames={hostElement:"wj-barcode-ean"};export var Gs1_128ClsNames={hostElement:"wj-barcode-gs1_128"};export var QrCodeClsNames={hostElement:"wj-barcode-qrcode"};export var UpcAClsNames={hostElement:"wj-barcode-upca"};export var UpcBaseClsNames={hostElement:"wj-barcode-upc"};export var UpcE0ClsNames={hostElement:"wj-barcode-upce0"};export var UpcE1ClsNames={hostElement:"wj-barcode-upce1"};export var QrCodeCharset;!function(e){e[e.Utf8=0]="Utf8";e[e.ShiftJis=1]="ShiftJis"}(QrCodeCharset||(QrCodeCharset={}));export var QrCodeCorrectionLevel;!function(e){e[e.Low=0]="Low";e[e.Medium=1]="Medium";e[e.Quartile=2]="Quartile";e[e.High=3]="High"}(QrCodeCorrectionLevel||(QrCodeCorrectionLevel={}));export var QrCodeModel;!function(e){e[e.Model1=0]="Model1";e[e.Model2=1]="Model2"}(QrCodeModel||(QrCodeModel={}));export var Code128CodeSet;!function(e){e[e.Auto=0]="Auto";e[e.A=1]="A";e[e.B=2]="B";e[e.C=3]="C"}(Code128CodeSet||(Code128CodeSet={}));var _QrCodeModelConvertor=function(){function _QrCodeModelConvertor(){}_QrCodeModelConvertor.stringToEnum=function(e){switch(e.toString()){case"1":return QrCodeModel.Model1;case"2":return QrCodeModel.Model2}throw"Unknown QRCode internal model '"+e+"'"};_QrCodeModelConvertor.enumToString=function(e){var t=QrCodeModel[asEnum(e,QrCodeModel)];return t.charAt(t.length-1)};return _QrCodeModelConvertor}();export{_QrCodeModelConvertor};var _CharsetTypeConvertor=function(){function _CharsetTypeConvertor(){}_CharsetTypeConvertor.stringToEnum=function(e){switch(e){case"UTF-8":return QrCodeCharset.Utf8;case"Shift_JIS":return QrCodeCharset.ShiftJis}throw"Unknown Barcode internal charset '"+e+"'"};_CharsetTypeConvertor.enumToString=function(e){var t;switch(asEnum(e,QrCodeCharset)){case QrCodeCharset.Utf8:t="UTF-8";break;case QrCodeCharset.ShiftJis:t="Shift_JIS"}return t};return _CharsetTypeConvertor}();export{_CharsetTypeConvertor};var _CorrectionLevelConvertor=function(){function _CorrectionLevelConvertor(){}_CorrectionLevelConvertor.stringToEnum=function(e){switch(e){case"L":return QrCodeCorrectionLevel.Low;case"M":return QrCodeCorrectionLevel.Medium;case"Q":return QrCodeCorrectionLevel.Quartile;case"H":return QrCodeCorrectionLevel.High}throw"Unknown barcode internal errorCorrectionLevel '"+e+"'"};_CorrectionLevelConvertor.enumToString=function(e){return QrCodeCorrectionLevel[asEnum(e,QrCodeCorrectionLevel)].charAt(0)};return _CorrectionLevelConvertor}();export{_CorrectionLevelConvertor};var _CodeSetTypeConvertor=function(){function _CodeSetTypeConvertor(){}_CodeSetTypeConvertor.stringToEnum=function(e){switch(e){case"auto":return Code128CodeSet.Auto;case"A":return Code128CodeSet.A;case"B":return Code128CodeSet.B;case"C":return Code128CodeSet.C}throw"Unknown barcode internal codeSet '"+e+"'"};_CodeSetTypeConvertor.enumToString=function(e){var t,o=asEnum(e,Code128CodeSet);switch(o){case Code128CodeSet.Auto:t="auto";break;case Code128CodeSet.A:case Code128CodeSet.B:case Code128CodeSet.C:t=Code128CodeSet[o]}return t};return _CodeSetTypeConvertor}();export{_CodeSetTypeConvertor};var Codabar=function(e){__extends(Codabar,e);function Codabar(t,o){var r=e.call(this,t)||this;addClass(r.hostElement,CodabarClsNames.hostElement);r._setAw(!0);r.initialize(o);return r}Object.defineProperty(Codabar,"controlTemplate",{get:function(){Codabar._ctrlTemplate||(Codabar._ctrlTemplate=BarcodeBase.controlTemplate);return Codabar._ctrlTemplate},set:function(e){Codabar._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"checkDigit",{get:function(){return this._getProp("checkDigit")},set:function(e){this._setProp("checkDigit",e)},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"nwRatio",{get:function(){return _NarrowWideRatioConvertor.stringToEnum(this._getProp("nwRatio"))},set:function(e){this._setProp("nwRatio",_NarrowWideRatioConvertor.enumToString(e))},enumerable:!0,configurable:!0});Codabar.type="Codabar";Codabar._ctrlTemplate="";return Codabar}(BarcodeBase);export{Codabar};var EanBase=function(e){__extends(EanBase,e);function EanBase(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,EanBaseClsNames.hostElement);return r}Object.defineProperty(EanBase.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(EanBase.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});return EanBase}(BarcodeBase);export{EanBase};var Ean8=function(e){__extends(Ean8,e);function Ean8(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,Ean8ClsNames.hostElement);return r}Ean8.type="EAN8";return Ean8}(EanBase);export{Ean8};var Ean13=function(e){__extends(Ean13,e);function Ean13(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,Ean13ClsNames.hostElement);return r}Object.defineProperty(Ean13.prototype,"addOn",{get:function(){return this._getProp("addOn")},set:function(e){this._setProp("addOn",e)},enumerable:!0,configurable:!0});Object.defineProperty(Ean13.prototype,"addOnHeight",{get:function(){return this._getProp("addOnHeight")},set:function(e){this._setProp("addOnHeight",e)},enumerable:!0,configurable:!0});Object.defineProperty(Ean13.prototype,"addOnLabelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("addOnLabelPosition"))},set:function(e){this._setProp("addOnLabelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Ean13.prototype,"quietZone",{get:function(){return this._getProp("quietZone")},set:function(e){this._setProp("quietZone",e)},enumerable:!0,configurable:!0});Ean13.type="EAN13";return Ean13}(EanBase);export{Ean13};var Code39=function(e){__extends(Code39,e);function Code39(t,o){var r=e.call(this,t)||this;addClass(r.hostElement,Code39ClsNames.hostElement);r._setAw(!0);r.initialize(o);return r}Object.defineProperty(Code39,"controlTemplate",{get:function(){Code39._ctrlTemplate||(Code39._ctrlTemplate=BarcodeBase.controlTemplate);return Code39._ctrlTemplate},set:function(e){Code39._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"checkDigit",{get:function(){return this._getProp("checkDigit")},set:function(e){this._setProp("checkDigit",e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"fullAscii",{get:function(){return this._getProp("fullASCII")},set:function(e){this._setProp("fullASCII",e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"nwRatio",{get:function(){return _NarrowWideRatioConvertor.stringToEnum(this._getProp("nwRatio"))},set:function(e){this._setProp("nwRatio",_NarrowWideRatioConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"labelWithStartAndStopCharacter",{get:function(){return this._getProp("labelWithStartAndStopCharacter")},set:function(e){this._setProp("labelWithStartAndStopCharacter",e)},enumerable:!0,configurable:!0});Code39.type="Code39";Code39._ctrlTemplate="";return Code39}(BarcodeBase);export{Code39};var Code128=function(e){__extends(Code128,e);function Code128(t,o){var r=e.call(this,t)||this;addClass(r.hostElement,Code128ClsNames.hostElement);r._setAw(!0);r.initialize(o);return r}Object.defineProperty(Code128,"controlTemplate",{get:function(){Code128._ctrlTemplate||(Code128._ctrlTemplate=BarcodeBase.controlTemplate);return Code128._ctrlTemplate},set:function(e){Code128._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"codeSet",{get:function(){return _CodeSetTypeConvertor.stringToEnum(this._getProp("codeSet"))},set:function(e){this._setProp("codeSet",_CodeSetTypeConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Code128.type="Code128";Code128._ctrlTemplate="";return Code128}(BarcodeBase);export{Code128};var Gs1_128=function(e){__extends(Gs1_128,e);function Gs1_128(t,o){var r=e.call(this,t)||this;addClass(r.hostElement,Gs1_128ClsNames.hostElement);r._setAw(!0);r.initialize(o);return r}Object.defineProperty(Gs1_128,"controlTemplate",{get:function(){Gs1_128._ctrlTemplate||(Gs1_128._ctrlTemplate=BarcodeBase.controlTemplate);return Gs1_128._ctrlTemplate},set:function(e){Gs1_128._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(Gs1_128.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1_128.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1_128.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1_128.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Gs1_128.type="GS1_128";Gs1_128._ctrlTemplate="";return Gs1_128}(BarcodeBase);export{Gs1_128};var UpcBase=function(e){__extends(UpcBase,e);function UpcBase(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,UpcBaseClsNames.hostElement);return r}Object.defineProperty(UpcBase,"controlTemplate",{get:function(){UpcBase._ctrlTemplate||(UpcBase._ctrlTemplate=BarcodeBase.controlTemplate);return UpcBase._ctrlTemplate},set:function(e){UpcBase._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"addOn",{get:function(){return this._getProp("addOn")},set:function(e){this._setProp("addOn",e)},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"addOnHeight",{get:function(){return this._getProp("addOnHeight")},set:function(e){this._setProp("addOnHeight",e)},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"addOnLabelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("addOnLabelPosition"))},set:function(e){this._setProp("addOnLabelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"quietZone",{get:function(){return this._getProp("quietZone")},set:function(e){this._setProp("quietZone",e)},enumerable:!0,configurable:!0});UpcBase._ctrlTemplate="";return UpcBase}(BarcodeBase);export{UpcBase};var UpcA=function(e){__extends(UpcA,e);function UpcA(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,UpcAClsNames.hostElement);return r}UpcA.type="UPC-A";return UpcA}(UpcBase);export{UpcA};var UpcE0=function(e){__extends(UpcE0,e);function UpcE0(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,UpcE0ClsNames.hostElement);return r}UpcE0.type="UPC-E0";return UpcE0}(UpcBase);export{UpcE0};var UpcE1=function(e){__extends(UpcE1,e);function UpcE1(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,UpcE1ClsNames.hostElement);return r}UpcE1.type="UPC-E1";return UpcE1}(UpcBase);export{UpcE1};var QrCode=function(e){__extends(QrCode,e);function QrCode(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,QrCodeClsNames.hostElement);return r}Object.defineProperty(QrCode.prototype,"charCode",{get:function(){return this._getProp("charCode")},set:function(e){this._setProp("charCode",e)},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"charset",{get:function(){return _CharsetTypeConvertor.stringToEnum(this._getProp("charset"))},set:function(e){this._setProp("charset",_CharsetTypeConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"model",{get:function(){return _QrCodeModelConvertor.stringToEnum(this._getProp("model"))},set:function(e){this._setProp("model",_QrCodeModelConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"version",{get:function(){var e=this._getProp("version");return"auto"===e?null:e},set:function(e){this._setProp("version",null==e?"auto":e)},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"errorCorrectionLevel",{get:function(){return _CorrectionLevelConvertor.stringToEnum(this._getProp("errorCorrectionLevel"))},set:function(e){this._setProp("errorCorrectionLevel",_CorrectionLevelConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"mask",{get:function(){var e=this._getProp("mask");return"auto"===e?null:e},set:function(e){this._setProp("mask",null==e?"auto":e)},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"connection",{get:function(){return this._getProp("connection")},set:function(e){this._setProp("connection",e)},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"connectionIndex",{get:function(){return this._getProp("connectionNo")},set:function(e){this._setProp("connectionNo",e)},enumerable:!0,configurable:!0});QrCode.type="QRCode";return QrCode}(BarcodeBase);export{QrCode};_registerModule("wijmo.barcode.common",selfModule);
14
+ var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}();import{asEnum,addClass,_registerModule}from"@mescius/wijmo";import{OneDimensionalBarcode,Utils,InvalidTextException,InvalidOptionsException,Barcode,InvalidCharacterException,Constants,TextTooLongException,BitBuffer,TwoDimensionalBarcode,BarcodeBase,_LabelPositionConvertor,_NarrowWideRatioConvertor}from"@mescius/wijmo.barcode";import*as selfModule from"@mescius/wijmo.barcode.common";for(var EXP_TABLE=new Array(256),i=0;i<8;i++)EXP_TABLE[i]=1<<i;for(i=8;i<256;i++)EXP_TABLE[i]=EXP_TABLE[i-4]^EXP_TABLE[i-5]^EXP_TABLE[i-6]^EXP_TABLE[i-8];var LOG_TABLE=new Array(256);for(i=0;i<255;i+=1)LOG_TABLE[EXP_TABLE[i]]=i;var RS_COEFFICIENTS=[null,null,null,null,null,null,null,[0,87,229,146,149,238,102,21],null,null,[0,251,67,46,61,118,70,64,94,32,45],null,null,[0,74,152,176,100,86,100,106,104,130,218,206,140,78],null,[0,8,183,61,91,202,37,51,58,58,237,140,124,5,99,105],[0,120,104,107,109,102,161,76,3,91,191,147,169,182,194,225,120],[0,43,139,206,78,43,239,123,206,214,147,24,99,150,39,243,163,136],[0,215,234,158,94,184,97,118,170,79,187,152,148,252,179,5,98,96,153],null,[0,17,60,79,50,61,163,26,187,202,180,221,225,83,239,156,164,212,212,188,190],null,[0,210,171,247,242,93,230,14,109,221,53,200,74,8,172,98,80,219,134,160,105,165,231],null,[0,229,121,135,48,211,117,251,126,159,180,169,152,192,226,228,218,111,0,117,232,87,96,227,21],null,[0,173,125,158,2,103,182,118,17,145,201,111,28,165,53,161,21,245,142,13,102,48,227,153,145,218,70],null,[0,168,223,200,104,224,234,108,180,110,190,195,147,205,27,232,201,21,43,245,87,42,195,212,119,242,37,9,123],null,[0,41,173,145,152,216,31,179,182,50,48,110,86,239,96,222,125,42,173,226,193,224,130,156,37,251,216,238,40,192,180],null,[0,10,6,106,190,249,167,4,67,209,138,138,32,242,123,89,27,120,185,80,156,38,69,171,60,28,222,80,52,254,185,220,241],null,[0,111,77,146,94,26,21,108,19,105,94,113,193,86,140,163,125,58,158,229,239,218,103,56,70,114,61,183,129,167,13,98,62,129,51],null,[0,200,183,98,16,172,31,246,234,60,152,115,0,167,152,113,248,238,107,18,63,218,37,87,210,105,177,120,74,121,196,117,251,113,233,30,120],null,null,null,[0,59,116,79,161,252,98,128,205,128,161,247,57,163,56,235,106,53,26,187,174,226,104,170,7,175,35,181,114,88,41,47,163,125,134,72,20,232,53,35,15],null,[0,250,103,221,230,25,18,137,231,0,3,58,242,221,191,110,84,230,8,188,106,96,147,15,131,139,34,101,223,39,101,213,199,237,254,201,123,171,162,194,117,50,96],null,[0,190,7,61,121,71,246,69,55,168,188,89,243,191,25,72,123,9,145,14,247,1,238,44,78,143,62,224,126,118,114,68,163,52,194,217,147,204,169,37,130,113,102,73,181],null,[0,112,94,88,112,253,224,202,115,187,99,89,5,54,113,129,44,58,16,135,216,169,211,36,1,4,96,60,241,73,104,234,8,249,245,119,174,52,25,157,224,43,202,223,19,82,15],null,[0,228,25,196,130,211,146,60,24,251,90,39,102,240,61,178,63,46,123,115,18,221,111,135,160,182,205,107,206,95,150,120,184,91,21,247,156,140,238,191,11,94,227,84,50,163,39,34,108],null,[0,232,125,157,161,164,9,118,46,209,99,203,193,35,3,209,111,195,242,203,225,46,13,32,160,126,209,130,160,242,215,242,75,77,42,189,32,113,65,124,69,228,114,235,175,124,170,215,232,133,205],null,[0,116,50,86,186,50,220,251,89,192,46,86,127,124,19,184,233,151,215,22,14,59,145,37,242,203,134,254,89,190,94,59,65,124,113,100,233,235,121,22,76,86,97,39,242,200,220,101,33,239,254,116,51],null,[0,183,26,201,87,210,221,113,21,46,65,45,50,238,184,249,225,102,58,209,218,109,165,26,95,184,192,52,245,35,254,238,175,172,79,123,25,122,43,120,108,215,80,128,201,235,8,153,59,101,31,198,76,31,156],null,[0,106,120,107,157,164,216,112,116,2,91,248,163,36,201,202,229,6,144,254,155,135,208,170,209,12,139,127,142,182,249,177,174,190,28,10,85,239,184,101,124,152,206,96,23,163,61,27,196,247,151,154,202,207,20,61,10],null,[0,82,116,26,247,66,27,62,107,252,182,200,185,235,55,251,242,210,144,154,237,176,141,192,248,152,249,206,85,253,142,65,165,125,23,24,30,122,240,214,6,129,218,29,145,127,134,206,245,117,29,41,63,159,142,233,125,148,123],null,[0,107,140,26,12,9,141,243,197,226,197,219,45,211,101,219,120,28,181,127,6,100,247,2,205,198,57,115,219,101,109,160,82,37,38,238,49,160,209,121,86,11,124,30,181,84,25,194,87,65,102,190,220,70,27,209,16,89,7,33,240],null,[0,65,202,113,98,71,223,248,118,214,94,1,122,37,23,2,228,58,121,7,105,135,78,243,118,70,76,223,89,72,50,70,111,194,17,212,126,181,35,221,117,235,11,229,149,147,123,213,40,115,6,200,100,26,246,182,218,127,215,36,186,110,106],null,[0,45,51,175,9,7,158,159,49,68,119,92,123,177,204,187,254,200,78,141,149,119,26,127,53,160,93,199,212,29,24,145,156,208,150,218,209,4,216,91,47,184,146,47,140,195,195,125,242,238,63,99,108,140,230,242,31,204,11,178,243,217,156,213,231],null,[0,5,118,222,180,136,136,162,51,46,117,13,215,81,17,139,247,197,171,95,173,65,137,178,68,111,95,101,41,72,214,169,197,95,7,44,154,77,111,236,40,121,143,63,87,80,253,240,126,217,77,34,232,106,50,168,82,76,146,67,106,171,25,132,93,45,105],null,[0,247,159,223,33,224,93,77,70,90,160,32,254,43,150,84,101,190,205,133,52,60,202,165,220,203,151,93,84,15,84,253,173,160,89,227,52,199,97,95,231,52,177,41,125,137,241,166,225,118,2,54,32,82,215,175,198,43,238,235,27,101,184,127,3,5,8,163,238],null];export function generateErrorCorrectionCode(e,t,o){for(var r=[],n=RS_COEFFICIENTS[t],a=e.slice(0),s=0;s<o;s++){if(0!=a[0]){for(var c=LOG_TABLE[a[0]],d=0;d<=n.length-1;d++){for(var u=n[d]+c;u>=255;)u-=255;r[d]=EXP_TABLE[u]}for(var l=0;l<=n.length-1;l++)a[l]=a[l]^r[l]}for(var h=1;h<a.length;h++)a[h-1]=a[h];a[a.length-1]=0}return a.slice(0,t)}var G15=1335,G18=7973,MODEL2_G15_MASK=21522,MODEL1_G15_MASK=10277;function getBCHDigit(e){for(var t=0;0!=e;){t+=1;e>>>=1}return t}export function getBCH15(e,t){for(var o=2===t?MODEL2_G15_MASK:MODEL1_G15_MASK,r=e<<10;getBCHDigit(r)-getBCHDigit(G15)>=0;)r^=G15<<getBCHDigit(r)-getBCHDigit(G15);return(e<<10|r)^o}export function getBCH18(e){for(var t=e<<12;getBCHDigit(t)-getBCHDigit(G18)>=0;)t^=G18<<getBCHDigit(t)-getBCHDigit(G18);return e<<12|t}export var MODE_INDICATOR={ECI:7,Numeric:1,Alphanumeric:2,"8BitByte":4,Kanji:8,StructuredAppend:3,FNC1First:5,FNC2Second:9,Terminator:0};export var EC_INDICATOR={L:1,M:0,Q:3,H:2};function isNumericMode(e){return e>=48&&e<=57}function isAlphanumericMode(e){return-1!=" $%*+-./:".indexOf(String.fromCharCode(e))||(e>=48&&e<=57||e>=65&&e<=90)}function is8BitByteMode(e){return e>=0&&e<=255}function isKanjiMode(e){return e>=33087&&e<=64587}var checkFns={Numeric:isNumericMode,Alphanumeric:isAlphanumericMode,"8BitByte":is8BitByteMode,Kanji:isKanjiMode};export function isMode(e,t){var o=checkFns[e];return 1===t.length?o(t):t.every((function(e){return o(e)}))}export function getCharMode(e,t){void 0===t&&(t="UTF-8");return isNumericMode(e)?"Numeric":isAlphanumericMode(e)?"Alphanumeric":"Shift_JIS"===t&&isKanjiMode(e)?"Kanji":"8BitByte"}export var getSizeByVersion=function(e){return 4*e+17};export function getCharacterCountIndicatorbitsNumber(e){return e>=1&&e<=9?{Numeric:10,Alphanumeric:9,"8BitByte":8,Kanji:8}:e>=10&&e<=26?{Numeric:12,Alphanumeric:11,"8BitByte":16,Kanji:10}:{Numeric:14,Alphanumeric:13,"8BitByte":16,Kanji:12}}var SYMBOL_MAP={" ":36,$:37,"%":38,"*":39,"+":40,"-":41,".":42,"/":43,":":44};export function getAlphanumericCharValue(e){if(e>=48&&e<=57)return+String.fromCharCode(e);if(e>=65&&e<=90)return e-65+10;var t=SYMBOL_MAP[String.fromCharCode(e)];if(t)return t;throw new InvalidTextException(String.fromCharCode(e))}export function createModules(e){for(var t=[],o=0;o<e;o++)t.push(Utils.fillArray(new Array(e),null));return t}var alignmentPatterns=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]];export function getAlignmentPattersPos(e){return alignmentPatterns[e-1]}export var padCodewords0=236;export var padCodewords1=17;export var maskFuncs=[function(e,t){return(e+t)%2==0},function(e){return e%2==0},function(e,t){return t%3==0},function(e,t){return(e+t)%3==0},function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0},function(e,t){return e*t%2+e*t%3==0},function(e,t){return(e*t%2+e*t%3)%2==0},function(e,t){return(e*t%3+(e+t)%2)%2==0}];var MODEL2_1ERROR_CORRECTION_CHARACTERISTICS=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],MODEL1_ERROR_CORRECTION_CHARACTERISTICS=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,46,36],[1,46,30],[1,46,24],[1,46,16],[1,72,57],[1,72,44],[1,72,36],[1,72,24],[1,100,80],[1,100,60],[1,100,50],[1,100,34],[1,134,108],[1,134,82],[1,134,68],[2,67,23],[1,170,136],[2,85,53],[2,85,43],[2,85,29],[1,212,170],[2,106,66],[2,106,54],[3,70,24],[2,128,104],[2,128,80],[2,128,64],[3,85,29],[2,153,123],[2,153,93],[3,102,52],[3,102,34],[2,179,145],[2,179,111],[3,119,61],[4,89,31],[2,208,168],[4,104,64],[4,104,52],[5,83,29],[2,238,192],[4,119,73],[4,119,61],[5,95,33],[3,180,144],[4,135,83],[4,135,69],[6,90,32],[3,203,163],[4,152,92],[5,122,62],[6,101,35]];export function getErrorCorrectionCharacteristics(e,t,o){void 0===o&&(o=2);var r;switch(t){case 1:r=0;break;case 0:r=1;break;case 3:r=2;break;case 2:r=3}for(var n=(2===o?MODEL2_1ERROR_CORRECTION_CHARACTERISTICS:MODEL1_ERROR_CORRECTION_CHARACTERISTICS)[4*(e-1)+r],a=[],s=n.length/3,c=0;c<s;c++)for(var d=n[3*c],u=0;u<d;u++)a.push({total:n[3*c+1],data:n[3*c+2],ec:n[3*c+1]-n[3*c+2]});return a}export function getMaskFunc(e){return maskFuncs[e]}function cloneModules(e){return e.reduce((function(e,t){e.push(t.slice(0));return e}),[])}export function getMaskScore(e){for(var t=e.length,o=0,r=0;r<t;r++)for(var n=0;n<t;n++){for(var a=0,s=e[r][n],c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(var d=-1;d<=1;d++)n+d<0||t<=n+d||0==c&&0==d||s==e[r+c][n+d]&&(a+=1);a>5&&(o+=3+a-5)}for(r=0;r<t-1;r++)for(n=0;n<t-1;n++){var u=0;e[r][n]&&(u+=1);e[r+1][n]&&(u+=1);e[r][n+1]&&(u+=1);e[r+1][n+1]&&(u+=1);0!=u&&4!=u||(o+=3)}for(r=0;r<t;r++)for(n=0;n<t-6;n++)e[r][n]&&!e[r][n+1]&&e[r][n+2]&&e[r][n+3]&&e[r][n+4]&&!e[r][n+5]&&e[r][n+6]&&(o+=40);for(n=0;n<t;n++)for(r=0;r<t-6;r++)e[r][n]&&!e[r+1][n]&&e[r+2][n]&&e[r+3][n]&&e[r+4][n]&&!e[r+5][n]&&e[r+6][n]&&(o+=40);var l=0;for(n=0;n<t;n++)for(r=0;r<t;r++)e[r][n]&&(l+=1);return o+=10*(Math.abs(100*l/t/t-50)/5)}export function addFormatInformation(e,t,o,r){var n=e.length,a=cloneModules(e),s=Utils.strPadStart(Utils.convertRadix(o,2),2,0),c=Utils.strPadStart(Utils.convertRadix(t,2),3,0),d=getBCH15(parseInt(s+c,2),r);a[n-8][8]=1;for(var u=15;u>0;u--){var l=d>>u-1&1;if(u>9){a[8][15-u]=l;a[n-1-15+u][8]=l}else if(u>8){a[8][15-u+1]=l;a[n-1-15+u][8]=l}else if(u>6){a[u][8]=l;a[8][n-u]=l}else{a[u-1][8]=l;a[8][n-u]=l}}return a}export function getEstimatedVersion(e,t,o){var r=0,n=0,a=0,s=0;t.forEach((function(e){isNumericMode(e)?r++:isAlphanumericMode(e)?n++:isKanjiMode(e)?s++:is8BitByteMode(e)&&a++}));for(var c=Math.ceil((5*n+3*r+13*s+8*a)/8),d=1;d<=40;d++){if(c<=getErrorCorrectionCharacteristics(d,e,o).reduce((function(e,t){return e+t.data}),0))return d}throw new TextTooLongException}var MODE_CHECK_INFO={Alphanumeric:[[6,11],[7,15],[8,16]],Numeric:[[4,6,6,13],[4,7,8,15],[5,8,9,17]]};export function getModeCheckInfo(e,t){var o=MODE_CHECK_INFO[e];return t<=9?o[0]:t<=26?o[1]:o[2]}export function utf8Encode(e){for(var t=[],o=0,r=e.length;o<r;o++){var n=e[o];if(n<128)t.push(n);else if(n<2048)t.push(192|n>>6,128|63&n);else if(n<55296||n>=57344)t.push(224|n>>12,128|n>>6&63,128|63&n);else{n=65536+((1023&n)<<10|1023&e[++o]);t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)}}return t}export function getParityData(e){for(var t=utf8Encode(e),o=t[0],r=1,n=t.length;r<n;r++)o^=t[r];return o}export function getCharCode(e){var t=[];Utils.sliceString(e,1,(function(e){t.push(e.charCodeAt(0))}));return t}var ModeKanji=function(){function ModeKanji(e){this.mode="Kanji";this.data=e}ModeKanji.prototype.getMode=function(){return MODE_INDICATOR.Kanji};ModeKanji.prototype.getLength=function(){return this.data.length};ModeKanji.prototype.write=function(e){this.data.forEach((function(t){var o;if(t>33088&&t<40956){o=192*((t-=33088)>>>8)+(255&t)}else if(t>57408&&t<60351){o=192*((t-=49472)>>>8)+(255&t)}e.put(o,13)}))};return ModeKanji}();export{ModeKanji};var ModeAlphanumeric=function(){function ModeAlphanumeric(e){this.mode="Alphanumeric";this.data=e}ModeAlphanumeric.prototype.getMode=function(){return MODE_INDICATOR.Alphanumeric};ModeAlphanumeric.prototype.getLength=function(){return this.data.length};ModeAlphanumeric.prototype.write=function(e){Utils.sliceArray(this.data,2,(function(t){var o=getAlphanumericCharValue(t[0]);if(2===t.length){var r=45*o+getAlphanumericCharValue(t[1]);e.put(r,11)}else e.put(o,6)}))};return ModeAlphanumeric}();export{ModeAlphanumeric};var ModeNumeric=function(){function ModeNumeric(e){this.mode="Numeric";this.data=e}ModeNumeric.prototype.getMode=function(){return MODE_INDICATOR.Numeric};ModeNumeric.prototype.getLength=function(){return this.data.length};ModeNumeric.prototype.write=function(e){Utils.sliceArray(this.data,3,(function(t){var o=parseInt(t.reduce((function(e,t){return e+String.fromCharCode(t)}),""));switch(t.length){case 1:e.put(o,4);return;case 2:e.put(o,7);return;default:e.put(o,10);return}}))};return ModeNumeric}();export{ModeNumeric};var Mode8BitByte=function(){function Mode8BitByte(e){this.mode="8BitByte";this.data=e;this.bytes=utf8Encode(e)}Mode8BitByte.prototype.getMode=function(){return MODE_INDICATOR["8BitByte"]};Mode8BitByte.prototype.getLength=function(){return this.bytes.length};Mode8BitByte.prototype.write=function(e){this.bytes.forEach((function(t){e.put(t,8)}))};return Mode8BitByte}();export{Mode8BitByte};var QRCodeBase=function(){function QRCodeBase(e,t){var o=t.version,r=t.model,n=t.charCode;this.charCode=n||getCharCode(e);var a=EC_INDICATOR[t.errorCorrectionLevel];this.config=t;this.errorCorrectionLevel=a;this.model=+r;o="auto"===o?this.getAutoVersion():+o;this.version=o;this.modulesCount=getSizeByVersion(o);this.charCountIndicatorBitsNumber=getCharacterCountIndicatorbitsNumber(o);this.errorCorrectionCharacteristics=getErrorCorrectionCharacteristics(o,a,this.model);this.totalDataCount=this.errorCorrectionCharacteristics.reduce((function(e,t){return e+t.data}),0);this.totalDataBits=8*this.totalDataCount}QRCodeBase.prototype.getConnections=function(){for(var e=this.totalDataBits,t=this.charCode,o=e-20,r=t.length,n=0,a=1,s=[],c=t[0];a<=r;){var d=t.slice(n,a),u=this.analysisData(d);if(this.encodeData(u).length>o){s.push(c);n=a-1}else a===r&&s.push(d);c=d;a++}return s};QRCodeBase.prototype.processConnection=function(e){var t=this.totalDataBits,o=this.config,r=o.connection,n=o.connectionNo;n=+n;if(r){var a=Math.ceil(e.length/(t-20));if(n>a-1)throw new InvalidOptionsException({connectionNo:n},"Max connection number is "+(a-1));var s=this.getConnections()[n],c=this.analysisData(s);return this.encodeData(c,{connectionNo:n,connectionCnt:a})}if(e.length>t)throw new TextTooLongException;return e};QRCodeBase.prototype.padBuffer=function(e){var t=this.totalDataBits;e.length+4<=t&&e.put(MODE_INDICATOR.Terminator,4);for(;e.length%8!=0;)e.putBit(!1);for(;!(e.length>=t);){e.put(padCodewords0,8);if(e.length>=t)break;e.put(padCodewords1,8)}};QRCodeBase.prototype.getAutoVersion=function(){for(var e=this.errorCorrectionLevel,t=this.charCode,o=getEstimatedVersion(e,t,this.model);o<40;o++){this.version=o;this.modulesCount=getSizeByVersion(this.version);this.charCountIndicatorBitsNumber=getCharacterCountIndicatorbitsNumber(this.version);this.errorCorrectionCharacteristics=getErrorCorrectionCharacteristics(this.version,e);this.totalDataCount=this.errorCorrectionCharacteristics.reduce((function(e,t){return e+t.data}),0);this.totalDataBits=8*this.totalDataCount;var r=this.analysisData(t);if(!(this.encodeData(r).length>this.totalDataBits))return o}throw new TextTooLongException};QRCodeBase.prototype.analysisData=function(e){var t=this.version,o=this.config.charset,r=getCharMode(e[0],o);switch(r){case"Alphanumeric":var n=getModeCheckInfo(r,t);isMode("8BitByte",e.slice(1,1+n[0]))&&(r="8BitByte");break;case"Numeric":var a=getModeCheckInfo(r,t),s=e.slice(1,1+a[0]),c=e.slice(1,1+a[1]);isMode("8BitByte",s)?r="8BitByte":isMode("Alphanumeric",c)&&(r="Alphanumeric")}var d={mode:r,code:[]},u=[d];e.forEach((function(r,n){var a=getCharMode(r,o);if(d.mode===a)d.code.push(r);else if("8BitByte"===d.mode)if("Kanji"===a){d={mode:a,code:[r]};u.push(d)}else if("Numeric"===a){var s=getModeCheckInfo(a,t);if(isMode(a,e.slice(n,n+s[2]))){d={mode:a,code:[r]};u.push(d)}else d.code.push(r)}else if("Alphanumeric"===a){s=getModeCheckInfo(a,t);if(isMode(a,e.slice(n,n+s[1]))){d={mode:a,code:[r]};u.push(d)}else d.code.push(r)}else d.code.push(r);else if("Alphanumeric"===d.mode)if("Kanji"===a||"8BitByte"===a){d={mode:a,code:[r]};u.push(d)}else if("Numeric"===a){s=getModeCheckInfo(a,t);if(isMode(a,e.slice(n,n+s[2]))){d={mode:a,code:[r]};u.push(d)}else d.code.push(r)}else d.code.push(r);else{d={mode:a,code:[r]};u.push(d)}}));return u};QRCodeBase.prototype.generateErrorCorrectionCode=function(e){var t=this.errorCorrectionCharacteristics,o=[],r=0;t.forEach((function(t){var n=e.getBuffer().slice(r,r+t.data);o.push({data:n,ec:generateErrorCorrectionCode(n,t.ec,t.data)});r+=t.data}));return o};QRCodeBase.prototype.addRectModule=function(e,t,o,r,n){void 0===n&&(n=!1);for(var a=this.modules,s=r+t,c=o+e;t<s;t++)for(var d=e;d<c;d++)a[t][d]=+n};QRCodeBase.prototype.addPositionDetectionPattern=function(){var e=this.modules.length;this.addPattern(0,0,7);this.addRectModule(7,0,1,8,!1);this.addRectModule(0,7,8,1,!1);var t=e-7;this.addPattern(t,0,7);this.addRectModule(t-1,0,1,8,!1);this.addRectModule(t-1,7,8,1,!1);var o=e-7;this.addPattern(0,o,7);this.addRectModule(7,o-1,1,8,!1);this.addRectModule(0,o-1,8,1,!1)};QRCodeBase.prototype.addTimingPattern=function(){for(var e=this.modules,t=e.length,o=!0,r=8;r<t-7;r++){e[6][r]=+o;e[r][6]=+o;o=!o}};QRCodeBase.prototype.addPattern=function(e,t,o){this.addRectModule(e,t,o,o,!0);this.addRectModule(e+1,t+1,o-2,o-2,!1);this.addRectModule(e+2,t+2,o-4,o-4,!0)};return QRCodeBase}();export{QRCodeBase};var QRCodeModel2=function(e){__extends(QRCodeModel2,e);function QRCodeModel2(){return null!==e&&e.apply(this,arguments)||this}QRCodeModel2.prototype.encodeData=function(e,t){var o=this.charCountIndicatorBitsNumber,r=this.charCode,n=new BitBuffer;if(t){n.put(MODE_INDICATOR.StructuredAppend,4);n.put(t.connectionNo,4);n.put(t.connectionCnt-1,4);n.put(getParityData(r),8)}e.forEach((function(e){if(e.code){var t;switch(e.mode){case"Numeric":t=new ModeNumeric(e.code);break;case"Alphanumeric":t=new ModeAlphanumeric(e.code);break;case"8BitByte":t=new Mode8BitByte(e.code);break;case"Kanji":t=new ModeKanji(e.code)}n.put(t.getMode(),4);n.put(t.getLength(),o[t.mode]);t.write(n)}}));return n};QRCodeModel2.prototype.getFinalMessage=function(e){for(var t=[],o=e.map((function(e){return e.data})),r=e.map((function(e){return e.ec})),n=Utils.getMaxValue(o),a=Utils.getMaxValue(r),_loop_1=function(e){o.forEach((function(o){Utils.isDefined(o[e])&&t.push(o[e])}))},s=0;s<n;s++)_loop_1(s);var _loop_2=function(e){r.forEach((function(o){Utils.isDefined(o[e])&&t.push(o[e])}))};for(s=0;s<a;s++)_loop_2(s);return t};QRCodeModel2.prototype.setModules=function(e){var t=this.modulesCount,o=this.version;this.modules=createModules(t);this.addPositionDetectionPattern();this.addAlignmentPattern();this.addTimingPattern();o>6&&this.addVersionInformation();this.maskModules(e)};QRCodeModel2.prototype.maskModules=function(e){var t=this.modules,o=this.errorCorrectionLevel,r=this.model,n=this.config.mask;if("auto"===n)this.autoMask(e);else{var a=getMaskFunc(n);this.maskPattern=n;var s=addFormatInformation(t,n,o,r);this.modules=this.fillDataModules(s,e,a)}};QRCodeModel2.prototype.autoMask=function(e){var t,o,r,n=this,a=this.modules,s=this.errorCorrectionLevel,c=this.model;maskFuncs.forEach((function(d,u){var l=addFormatInformation(a,u,s,c),h=n.fillDataModules(l,e,d),C=getMaskScore(h);if(!o||C<o){t=h;o=C;r=u}}));this.modules=t;this.maskPattern=r};QRCodeModel2.prototype.addAlignmentPattern=function(){var e=this,t=this.modules,o=getAlignmentPattersPos(this.version);o.forEach((function(r){o.forEach((function(o){null===t[r][o]&&e.addPattern(o-2,r-2,5)}))}))};QRCodeModel2.prototype.addVersionInformation=function(){for(var e=this.modulesCount,t=this.modules,o=getBCH18(this.version),r=0;r<18;r++){var n=o>>r&1;t[Math.floor(r/3)][r%3+e-8-3]=n;t[r%3+e-8-3][Math.floor(r/3)]=n}};QRCodeModel2.prototype.fillDataModules=function(e,t,o){for(var r=e.length,n=-1,a=r-1,s=7,c=0,d=r-1;d>0;d-=2){6==d&&(d-=1);for(;;){for(var u=0;u<2;u+=1)if(null==e[a][d-u]){var l=!1;c<t.length&&(l=1==(t[c]>>>s&1));o(a,d-u)&&(l=!l);e[a][d-u]=+l;if(-1==(s-=1)){c+=1;s=7}}if((a+=n)<0||r<=a){a-=n;n=-n;break}}}return e};QRCodeModel2.prototype.getMatrix=function(){var e=this.charCode,t=this.analysisData(e),o=this.encodeData(t),r=this.processConnection(o);this.padBuffer(r);var n=this.generateErrorCorrectionCode(r),a=this.getFinalMessage(n);this.setModules(a);return this.modules};return QRCodeModel2}(QRCodeBase);export{QRCodeModel2};var QRCodeModel1=function(e){__extends(QRCodeModel1,e);function QRCodeModel1(){return null!==e&&e.apply(this,arguments)||this}QRCodeModel1.prototype.encodeData=function(e,t){var o=this.charCountIndicatorBitsNumber,r=this.charCode,n=new BitBuffer;n.put(0,4);if(t){n.put(MODE_INDICATOR.StructuredAppend,4);n.put(t.connectionNo,4);n.put(t.connectionCnt-1,4);n.put(getParityData(r),8)}e.forEach((function(e){if(e.code){var t;switch(e.mode){case"Numeric":t=new ModeNumeric(e.code);break;case"Alphanumeric":t=new ModeAlphanumeric(e.code);break;case"8BitByte":t=new Mode8BitByte(e.code);break;case"Kanji":t=new ModeKanji(e.code)}n.put(t.getMode(),4);n.put(t.getLength(),o[t.mode]);t.write(n)}}));return n};QRCodeModel1.prototype.getFinalMessage=function(e){var t=[],o=e.map((function(e){return e.data})),r=e.map((function(e){return e.ec}));o.forEach((function(e){t=t.concat(e)}));r.forEach((function(e){t=t.concat(e)}));return t};QRCodeModel1.prototype.setModules=function(e){var t=this.modulesCount;this.modules=createModules(t);this.addPositionDetectionPattern();this.addExtensionPattern();this.addTimingPattern();this.maskModules(e)};QRCodeModel1.prototype.maskModules=function(e){var t=this.modules,o=this.errorCorrectionLevel,r=this.model,n=this.config.mask;if("auto"===n)this.autoMask(e);else{var a=getMaskFunc(n);this.maskPattern=n;var s=addFormatInformation(t,n,o,r);this.modules=this.fillDataModules(s,e,a)}};QRCodeModel1.prototype.autoMask=function(e){var t,o,r,n=this,a=this.modules,s=this.errorCorrectionLevel,c=this.model;maskFuncs.forEach((function(d,u){var l=addFormatInformation(a,u,s,c),h=n.fillDataModules(l,e,d),C=getMaskScore(h);if(!o||C<o){t=h;o=C;r=u}}));this.modules=t;this.maskPattern=r};QRCodeModel1.prototype.addExtensionPattern=function(){var e=this.modules,t=this.version,o=e.length;e[o-1][o-1]=1;e[o-2][o-1]=0;e[o-1][o-2]=0;e[o-2][o-2]=0;var r=Math.floor(t/2);if(Utils.isEven(t))for(var n=0;n<r;n++){this.addBaseExtension(13+8*n);this.addRightExtension(13+8*n)}else for(n=0;n<r;n++){this.addBaseExtension(17+8*n);this.addRightExtension(17+8*n)}};QRCodeModel1.prototype.addBaseExtension=function(e){var t=this.modules,o=t.length,r=o-2,n=o-1;t[r][e]=0;t[r][e+1]=0;t[r][e+2]=0;t[r][e+3]=0;t[n][e]=1;t[n][e+1]=1;t[n][e+2]=1;t[n][e+3]=1};QRCodeModel1.prototype.addRightExtension=function(e){var t=this.modules,o=t.length,r=o-2,n=o-1;t[e][r]=0;t[e+1][r]=0;t[e+2][r]=0;t[e+3][r]=0;t[e][n]=1;t[e+1][n]=1;t[e+2][n]=1;t[e+3][n]=1};QRCodeModel1.prototype.fillDataModules=function(e,t,o){var r,n,a=e.length;r=n=a-1;var s=2,c=new BitBuffer(t);c.next();c.next();c.next();c.next();for(;r>=0;){if(r==a-5)s=4;else if(8==r)s=2;else if(6==r){r--;continue}for(;n>=0;)if(null===e[n][r]){for(var d=0;d<s;d++){var u=c.next();o(n,r-d)&&(u=!u);e[n][r-d]=+u}n--}else n--;r-=s;n=a-1}return e};QRCodeModel1.prototype.getMatrix=function(){var e=this.charCode,t=this.analysisData(e),o=this.encodeData(t),r=this.processConnection(o);this.padBuffer(r);var n=this.generateErrorCorrectionCode(r),a=this.getFinalMessage(n);this.setModules(a);return this.modules};return QRCodeModel1}(QRCodeBase);export{QRCodeModel1};var QRCodeEncoder=function(e){__extends(QRCodeEncoder,e);function QRCodeEncoder(t){var o=this;t.merge(QRCodeEncoder.DefaultConfig);var r,n=o=e.call(this,t)||this,a=n.encodeConfig.text,s=n.config;r="2"==s.model?new QRCodeModel2(a,s):new QRCodeModel1(a,s);o.innerQRCode=r;return o}QRCodeEncoder.prototype.calculateData=function(){return this.innerQRCode.getMatrix()};QRCodeEncoder.prototype.validate=function(){var e=this.config,t=e.version,o=e.model,r=e.charset,n=e.charCode,a=e.connectionNo,s=this.encodeConfig.text;if(!(s||n&&0!==n.length))throw new InvalidTextException(s);if("1"!=o&&"2"!=o)throw new InvalidOptionsException({model:o});if("UTF-8"!=r&&"Shift_JIS"!=r)throw new InvalidOptionsException({charset:r});if("1"==o&&Utils.isNumberLike(t)&&(t<1||t>14))throw new InvalidOptionsException({version:t},"Model 1 only support version 1 - 14.");if("2"==o&&Utils.isNumberLike(t)&&(t<1||t>40))throw new InvalidOptionsException({version:t},"Model 2 only support version 1 - 40.");if(a>15||a<0)throw new InvalidOptionsException({connectionNo:a},"ConnectionNo is in range 0 - 15.")};QRCodeEncoder.DefaultConfig={version:"auto",errorCorrectionLevel:"L",model:2,mask:"auto",connection:!1,connectionNo:0,charCode:void 0,charset:"UTF-8",quietZone:{top:4,left:4,right:4,bottom:4}};return QRCodeEncoder}(TwoDimensionalBarcode);export{QRCodeEncoder};Barcode.registerEncoder("QRCode",QRCodeEncoder);var TableCode128A=[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","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","[","\\","]","^","_","\0","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","","","","","","","","","","","","",""," "," "," "," "," "," "," "," "," "," "],TableCode128B=[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","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","[","\\","]","^","_","`","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","{","|","}","~",""," "," "," "," "," "," "," "," "," "," "],TableCode128Data=["212222","222122","222221","121223","121322","131222","122213","122312","132212","221213","221312","231212","112232","122132","122231","113222","123122","123221","223211","221132","221231","213212","223112","312131","311222","321122","321221","312212","322112","322211","212123","212321","232121","111323","131123","131321","112313","132113","132311","211313","231113","231311","112133","112331","132131","113123","113321","133121","313121","211331","231131","213113","213311","213131","311123","311321","331121","312113","312311","332111","314111","221411","431111","111224","111422","121124","121421","141122","141221","112214","112412","122114","122411","142112","142211","241211","221114","413111","241112","134111","111242","121142","121241","114212","124112","124211","411212","421112","421211","212141","214121","412121","111143","111341","131141","114113","114311","411113","411311","113141","114131","311141","411131","211412","211214","211232"];export var stopPattern="2331112";export var Code128Sym={CodeC:99,CodeB:100,CodeA:101,FNC1:102,FNC2:97,FNC3:96,StartA:103,StartB:104,StartC:105};export var Code128Char={CodeC:String.fromCharCode(204),CodeB:String.fromCharCode(205),CodeA:String.fromCharCode(206),FNC1:Constants.FNC1,FNC2:Constants.FNC2,FNC3:Constants.FNC3,StartA:String.fromCharCode(208),StartB:String.fromCharCode(209),StartC:String.fromCharCode(210)};export function getCharValue(e,t){if(e===Code128Char.FNC1)return Code128Sym.FNC1;if(e===Code128Char.FNC2)return Code128Sym.FNC2;if(e===Code128Char.FNC3)return Code128Sym.FNC3;switch(t){case"A":return TableCode128A.indexOf(e);case"B":return TableCode128B.indexOf(e);case"C":return+e}}export function getCharPattern(e,t){var o=TableCode128Data[getCharValue(e,t)];if(!o)throw new InvalidCharacterException(e);return o}export function getPatternByIndex(e){return TableCode128Data[e]}export function encode(e){var t="";Utils.str2Array(e).forEach((function(e,o){Utils.isEven(o)?t+=Utils.strRepeat("1",+e):t+=Utils.strRepeat("0",+e)}));return t}var CODE_SET_A="A",CODE_SET_B="B",CODE_SET_C="C",Code128Auto=function(){function Code128Auto(e,t){void 0===t&&(t=!1);this.text=e;this.isUccEan128=t;this.validate()}Code128Auto.prototype.validate=function(){var e=this.text;if(!/^[\x00-\x7F\xC8-\xD3]+$/.test(e))throw new InvalidTextException(e)};Code128Auto.prototype.calculateGroup=function(){var e=this.text,t={code:this.isUccEan128?CODE_SET_C:CODE_SET_B,text:""},o=[];o.push(t);for(var r=0,n=e.length;r<n;r++){var a=t.code,s=e[r];if(t.code!==CODE_SET_C&&r+3<n&&Utils.isNumberString(e.substr(r,4))||t.code===CODE_SET_C&&r+1<n&&Utils.isNumberString(e.substr(r,2))){a=CODE_SET_C;s+=e[++r]}else if(getCharValue(s,a=t.code===CODE_SET_C?CODE_SET_B:t.code)<0&&getCharValue(s,a=t.code===CODE_SET_A?CODE_SET_B:CODE_SET_A)<0)continue;if(t.code!==a){t={code:a,text:s};o.push(t)}else t.text+=s}return o.filter((function(e){return e.text}))};Code128Auto.prototype.getData=function(){var e=this.calculateGroup(),t=this.checksum(e),o="";e.forEach((function(e,t){if(0===t){var r=getPatternByIndex(Code128Sym["Start"+e.code]);o+=encode(r)}else{r=getPatternByIndex(Code128Sym["Code"+e.code]);o+=encode(r)}e.code===CODE_SET_C?Utils.sliceString(e.text,2,(function(t){o+=encode(getCharPattern(t,e.code))})):Utils.sliceString(e.text,1,(function(t){o+=encode(getCharPattern(t,e.code))}))}));o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)};Code128Auto.prototype.checksum=function(e){var t=0,o=0;e.forEach((function(e,r){var n=e.code,a=e.text;if(0===r)o+=Code128Sym["Start"+n];else{var s=Code128Sym["Code"+n];o+=s*++t}n===CODE_SET_C?Utils.sliceString(a,2,(function(e){o+=getCharValue(e,n)*++t})):Utils.sliceString(a,1,(function(e){o+=getCharValue(e,n)*++t}))}));return o%103};return Code128Auto}();export{Code128Auto};var Code128C=function(){function Code128C(e){this.text=e;this.validate()}Code128C.prototype.validate=function(){var e=this.text;if(!/^(\xCF*[0-9]{2}\xCF*)+$/.test(e))throw new InvalidTextException(e)};Code128C.prototype.getData=function(){var e=this.text,t=this.checksum(),o="",r=getPatternByIndex(Code128Sym.StartC);o+=encode(r);Utils.sliceString(e,2,(function(e){var t=getCharPattern(e,"C");o+=encode(t)}));o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)};Code128C.prototype.checksum=function(){var e=this.text,t=0,o=0;Utils.sliceString(e,2,(function(e){o+=getCharValue(e,"C")*++t}));return(o+=Code128Sym.StartC)%103};return Code128C}();export{Code128C};var Code128B=function(){function Code128B(e){this.text=e;this.validate()}Code128B.prototype.validate=function(){var e=this.text;if(!/^[\x20-\x7F\xC8-\xCF]+$/.test(e))throw new InvalidTextException(e)};Code128B.prototype.getData=function(){var e=this.text,t=this.checksum(),o="",r=getPatternByIndex(Code128Sym.StartB);o+=encode(r);Utils.sliceString(e,1,(function(e){var t=getCharPattern(e,"B");o+=encode(t)}));o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)};Code128B.prototype.checksum=function(){var e=this.text,t=0,o=0;Utils.sliceString(e,1,(function(e){o+=getCharValue(e,"B")*++t}));return(o+=Code128Sym.StartB)%103};return Code128B}();export{Code128B};var Code128A=function(){function Code128A(e){this.text=e;this.validate()}Code128A.prototype.validate=function(){var e=this.text;if(!/^[\x00-\x5F\xC8-\xCF]+$/.test(e))throw new InvalidTextException(e)};Code128A.prototype.getData=function(){var e=this.text,t=this.checksum(),o="",r=getPatternByIndex(Code128Sym.StartA);o+=encode(r);Utils.sliceString(e,1,(function(e){var t=getCharPattern(e,"A");o+=encode(t)}));o+=encode(getPatternByIndex(t));return o+=encode(stopPattern)};Code128A.prototype.checksum=function(){var e=this.text,t=0,o=0;Utils.sliceString(e,1,(function(e){o+=getCharValue(e,"A")*++t}));return(o+=Code128Sym.StartA)%103};return Code128A}();export{Code128A};var Code128Encoder=function(e){__extends(Code128Encoder,e);function Code128Encoder(t,o){void 0===o&&(o=!1);var r=this;t.merge(Code128Encoder.DefaultConfig);var n=(r=e.call(this,t)||this).encodeConfig.text;r.isUccEan128=o;o&&n[0]!==Code128Char.FNC1&&(n=Code128Char.FNC1+n);r.text=n;r.label=n.replace(/[^\x20-\x7E]/g,"");return r}Code128Encoder.prototype.validate=function(){};Code128Encoder.prototype.calculateData=function(){var e,t=this.config.codeSet,o=this.text;if(this.isUccEan128)e=new Code128Auto(o);else switch(t){case"A":e=new Code128A(o);break;case"B":e=new Code128B(o);break;case"C":e=new Code128C(o);break;default:e=new Code128Auto(o)}return e.getData()};Code128Encoder.DefaultConfig={codeSet:"auto",quietZone:{right:10,left:10}};return Code128Encoder}(OneDimensionalBarcode);export{Code128Encoder};var GS1_128Encoder=function(e){__extends(GS1_128Encoder,e);function GS1_128Encoder(t){return e.call(this,t,!0)||this}return GS1_128Encoder}(Code128Encoder);export{GS1_128Encoder};Barcode.registerEncoder("GS1_128",GS1_128Encoder);Barcode.registerEncoder("Code128",Code128Encoder);var EncodeTable_Code39=function(){function EncodeTable_Code39(){}EncodeTable_Code39.getMod43Val=function(e){var t=0;Utils.sliceString(e,1,(function(e){t+=EncodeTable_Code39.MODULO_43_CHECK_TABLE.indexOf(e)}));return EncodeTable_Code39.MODULO_43_CHECK_TABLE[t%43]};EncodeTable_Code39.getFullASCIIChar=function(e){var t="";Utils.sliceString(e,1,(function(o){var r=EncodeTable_Code39.FULL_ASCII_TABLE[o.charCodeAt(0)];if(!r)throw new InvalidTextException(e);t+=r}));return t};EncodeTable_Code39.TABLE={0:"000110100",1:"100100001",2:"001100001",3:"101100000",4:"000110001",5:"100110000",6:"001110000",7:"000100101",8:"100100100",9:"001100100",A:"100001001",B:"001001001",C:"101001000",D:"000011001",E:"100011000",F:"001011000",G:"000001101",H:"100001100",I:"001001100",J:"000011100",K:"100000011",L:"001000011",M:"101000010",N:"000010011",O:"100010010",P:"001010010",Q:"000000111",R:"100000110",S:"001000110",T:"000010110",U:"110000001",V:"011000001",W:"111000000",X:"010010001",Y:"110010000",Z:"011010000","-":"010000101",".":"110000100"," ":"011000100",$:"010101000","/":"010100010","+":"010001010","%":"000101010","*":"010010100"};EncodeTable_Code39.MODULO_43_CHECK_TABLE=Utils.str2Array("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%");EncodeTable_Code39.FULL_ASCII_TABLE=["%U","$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","%A","%B","%C","%D","%E"," ","/A","/B","/C","/D","/E","/F","/G","/H","/I","/J","/K","/L","-",".","/O","0","1","2","3","4","5","6","7","8","9","/Z","%F","%G","%H","%I","%J","%V","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","%K","%L","%M","%N","%O","%W","+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","%P","%Q","%R","%S","%T"];return EncodeTable_Code39}();export{EncodeTable_Code39};var Code39Encoder=function(e){__extends(Code39Encoder,e);function Code39Encoder(t){var o=this;t.merge(Code39Encoder.DefaultConfig);var r=o=e.call(this,t)||this,n=r.encodeConfig,a=n.text,s=n.hideExtraChecksum,c=r.config,d=c.checkDigit,u=c.fullASCII,l=c.nwRatio,h=c.labelWithStartAndStopCharacter,C=u?EncodeTable_Code39.getFullASCIIChar(a):a;if(d){var f=EncodeTable_Code39.getMod43Val(C);o.text=Code39Encoder.START_STOP_CHARACTERS+C+f+Code39Encoder.START_STOP_CHARACTERS;var p=s?a:a+f,E=Code39Encoder.START_STOP_CHARACTERS+p+Code39Encoder.START_STOP_CHARACTERS;o.label=h?E:p}else{o.text=Code39Encoder.START_STOP_CHARACTERS+C+Code39Encoder.START_STOP_CHARACTERS;p=a,E=Code39Encoder.START_STOP_CHARACTERS+p+Code39Encoder.START_STOP_CHARACTERS;o.label=h?E:p}o.nwRatio=+l;return o}Code39Encoder.prototype.validate=function(){var e=this.encodeConfig.text,t=this.config,o=t.fullASCII,r=t.nwRatio;if(!o&&!/^[0-9A-Z\-. $/+%]+$/.test(e))throw new InvalidTextException(e);if(2!=r&&3!=r)throw new InvalidOptionsException({nwRatio:r},"NwRatio is 2 or 3")};Code39Encoder.prototype.encode=function(e){var t=this.nwRatio,o="",r=Utils.strRepeat("1",t),n=Utils.strRepeat("0",t);Utils.str2Array(e).forEach((function(e,t){Utils.isEven(t)?o+="1"===e?r:"1":o+="1"===e?n:"0"}));return o};Code39Encoder.prototype.calculateData=function(){var e=this,t=this.text,o="";Utils.sliceString(t,1,(function(t){o=o+e.encode(EncodeTable_Code39.TABLE[t])+"0"}));return o=o.substr(0,o.length-1)};Code39Encoder.DefaultConfig={checkDigit:!1,fullASCII:!1,nwRatio:3,labelWithStartAndStopCharacter:!1,quietZone:{right:10,left:10}};Code39Encoder.START_STOP_CHARACTERS="*";return Code39Encoder}(OneDimensionalBarcode);export{Code39Encoder};Barcode.registerEncoder("Code39",Code39Encoder);var EncodeTable=function(){function EncodeTable(){}EncodeTable.encodeCharByTable=function(e,t){return EncodeTable.TABLE[t][e]};EncodeTable.encodeByStructure=function(e,t){return Utils.str2Array(e).reduce((function(e,o,r){return e+=EncodeTable.encodeCharByTable(o,t[r])}),"")};EncodeTable.encodeByTable=function(e,t){if(e.length>1){return Utils.str2Array(e).reduce((function(e,o){return e+=EncodeTable.encodeCharByTable(o,t)}),"")}return EncodeTable.encodeCharByTable(e,t)};EncodeTable.TABLE={A:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],B:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],C:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"]};return EncodeTable}();export{EncodeTable};var AddOnSymbol=function(){function AddOnSymbol(e,t,o,r){this.isTextGroup=o;this.addOn=""+e;if("auto"!==t)if(Utils.isNumberLike(t))t=+t;else{t=Utils.convertUnit(Utils.fixSize2PixelDefault(t));t/=r}this.addOnHeight=t;this.validate()}AddOnSymbol.get2DigitAddOnTable=function(e){switch((e=parseInt(e))%4){case 0:return{leftStructure:"A",rightStructure:"A"};case 1:return{leftStructure:"A",rightStructure:"B"};case 2:return{leftStructure:"B",rightStructure:"A"};case 3:return{leftStructure:"B",rightStructure:"B"}}};AddOnSymbol.get5DigitAddOnTable=function(e){var t=3*(+(e+="")[0]+ +e[2]+ +e[4])+9*(+e[1]+ +e[3]);return AddOnSymbol.fiveDigitAddOnStructure[t%10]};AddOnSymbol.prototype.validate=function(){var e=this.addOn;if(2!==e.length&&5!==e.length)throw new InvalidOptionsException({addOn:e},"Add on length should be 2 or 5.")};AddOnSymbol.prototype._encode2DigitAddOn=function(){var e,t,o,r=this.addOn,n=this.isTextGroup,a=[];e=AddOnSymbol.get2DigitAddOnTable(r);t=EncodeTable.encodeByTable(r[0],e.leftStructure[0]);o=EncodeTable.encodeByTable(r[1],e.rightStructure[0]);if(n){a.push({binary:AddOnSymbol.ADD_ON_GUARD,role:"ADDON"});a.push({binary:t,text:r[0],role:"ADDON"});a.push({binary:AddOnSymbol.ADD_ON_DELINEATOR,role:"ADDON"});a.push({binary:o,text:r[1],role:"ADDON"})}else a.push({binary:AddOnSymbol.ADD_ON_GUARD+t+AddOnSymbol.ADD_ON_DELINEATOR+o,text:r,role:"ADDON"});return a};AddOnSymbol.prototype._encode5DigitAddOn=function(){var e=this.addOn,t=this.isTextGroup,o=[],r=AddOnSymbol.get5DigitAddOnTable(e);if(t){o.push({binary:AddOnSymbol.ADD_ON_GUARD,role:"ADDON"});Utils.str2Array(e).forEach((function(t,n){o.push({binary:EncodeTable.encodeByTable(t,r[n]),text:t,role:"ADDON"});n<e.length-1&&o.push({binary:AddOnSymbol.ADD_ON_DELINEATOR,role:"ADDON"})}))}else{var n=Utils.str2Array(e).reduce((function(t,o,n){t+=EncodeTable.encodeByTable(o,r[n]);n<e.length-1&&(t+=AddOnSymbol.ADD_ON_DELINEATOR);return t}),"");o.push({binary:AddOnSymbol.ADD_ON_GUARD+n,text:e,role:"ADDON"})}return o};AddOnSymbol.prototype.calculateData=function(){var e=this.addOn,t=[];2===e.length?t=this._encode2DigitAddOn():5===e.length&&(t=this._encode5DigitAddOn());t.push({text:">",role:"ADDON_RIGHT_QUIET_ZONE"});return t};AddOnSymbol.fiveDigitAddOnStructure=["BBAAA","BABAA","BAABA","BAAAB","ABBAA","AABBA","AAABB","ABABA","ABAAB","AABAB"];AddOnSymbol.ADD_ON_GUARD="1011";AddOnSymbol.ADD_ON_DELINEATOR="01";return AddOnSymbol}();export{AddOnSymbol};var EANBase=function(e){__extends(EANBase,e);function EANBase(t){var o=this;t.merge(EANBase.DefaultConfig);var r=o=e.call(this,t)||this,n=r.style,a=n.textAlign,s=n.unitValue,c=r.config,d=c.addOnLabelPosition,u=c.addOn,l=c.addOnHeight;o.isTextGroup="group"===a;o.isAddOnLabelBottom="top"!==d;o._setAddOn(u,l,s);return o}EANBase.prototype._setAddOn=function(e,t,o){if(Utils.isDefined(e)){this.addOn=new AddOnSymbol(e,t,this.isTextGroup,o);this.addOnHeight=this.addOn.addOnHeight}else this.addOnHeight=0};EANBase.prototype.checksum=function(e,t){void 0===t&&(t=!1);var o=Utils.str2Array(e),r=t?Utils.isOdd:Utils.isEven,n=o.reduce((function(e,t,o){t=+t;return e+=r(o)?t:3*t}),0)%10;return 0===n?0:10-n};EANBase.prototype.convertToShape=function(e){var t=this,o=t.isTextGroup,r=t.addOnHeight,n=t.isAddOnLabelBottom,a=t.style.textAlign,s=t.encodeConfig,c=s.isLabelBottom,d=s.height,u=s.quietZone,l=s.showLabel,h=s.fontSizeInUnit;l||(h=0);r=r||0;var C,f,p,E,g,_,A,b=[],m=u.left,v=u.top;if(c){C=d+5;f=v+d;p=l?d+h:C;if(n)g=(E=v)+(_="auto"===r?l?d:C:r);else{g=v;E=v+h;_="auto"===r?C-h:r}}else{C=d;d-=5;f=v;v+=h;p=l?C+h:C;if(n){E=u.top;g=E+(_="auto"===r?l?d:C:r)}else{g=u.top;E=u.top+h;_="auto"===r?C:r}}A=l?_+h:_;e.forEach((function(e){var t,r=v,n=d,s=f,c=o?"center":a,h=m;switch(e.role){case"GUARD":n=C;t=e.binary.length;break;case"ADDON":r=E;n=_;s=g;t=e.binary.length;break;case"LEFT_QUIET_ZONE":c="left";t=u.left;h=0;break;case"RIGHT_QUIET_ZONE":case"NO_ADDON_RIGHT_QUIET_ZONE":c="right";t=u.right;break;case"ADDON_QUIET_ZONE":t=u.addOn;break;case"ADDON_RIGHT_QUIET_ZONE":c="right";s=g;t=u.right;break;default:t=e.binary.length}if(l&&e.text){switch(c){case"center":h+=t/2;break;case"right":h+=t}var p={type:"text",x:h,y:s,text:e.text,textAlign:c,maxWidth:t};if("NO_ADDON_RIGHT_QUIET_ZONE"===e.role||"ADDON_RIGHT_QUIET_ZONE"===e.role){p.fontStyle="normal";p.fontWeight="normal";p.textDecoration="none"}b.push(p)}e.binary?Utils.combineTruthy(e.binary).forEach((function(e){if(0!==e){b.push({type:"rect",x:m,y:r,width:e,height:n});m+=e}else m++})):"ADDON_QUIET_ZONE"===e.role&&(m+=t)}));this.size={width:m+u.right,height:Math.max(p,A)+u.top+u.bottom};this.shapes=b};EANBase.prototype.afterApplyDesiredSize=function(){var e=this.config,t=e.addOn,o=e.addOnHeight,r=this.style.unitValue;this._setAddOn(t,o,r);this.addOnHeight>this.encodeConfig.height&&(this.addOnHeight=this.encodeConfig.height)};EANBase.NORMAL_GUARD="101";EANBase.CENTRE_GUARD="01010";EANBase.DefaultConfig={quietZone:{right:7,left:11}};return EANBase}(OneDimensionalBarcode);export{EANBase};var UPC_E=function(e){__extends(UPC_E,e);function UPC_E(t,o,r){var n=this;t.merge(UPC_E.DefaultConfig);var a=(n=e.call(this,t)||this).encodeConfig,s=a.text,c=a.hideExtraChecksum;n.prefix=o;var d=s;if(s.length<7){s+=n.checksum(s);c||(d=s)}n.label=d;n.text=s;n.tableStructure=r;return n}UPC_E.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^(\d{6}|\d{7})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 6 or 7.");if(7===e.length){if(this.checksum(e.substr(0,6))!=e[6])throw new InvalidTextException(e,"Check digit is invalid.")}};UPC_E.prototype.checksum=function(t){var o;switch(t[5]){case"0":case"1":case"2":o=""+t.substr(0,2)+t[5]+"0000"+t.substr(2,3);break;case"3":o=t.substr(0,3)+"00000"+t.substr(3,2);break;case"4":o=t.substr(0,4)+"00000"+t[4];break;default:o=t.substr(0,5)+"0000"+t[5]}o=this.prefix+o;return e.prototype.checksum.call(this,o,!0)};UPC_E.prototype.calculateData=function(){var e=this,t=e.text,o=e.addOn,r=e.isTextGroup,n=e.prefix,a=e.tableStructure,s=e.label,c=t[6],d=s[6];t=t.substr(0,6);var u=s.substr(0,6),l=a[c],h=[];h.push({text:n,role:"LEFT_QUIET_ZONE"});h.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});r?Utils.str2Array(t).forEach((function(e,t){h.push({binary:EncodeTable.encodeByTable(e,l[t]),text:u[t]})})):h.push({binary:EncodeTable.encodeByStructure(t,l),text:u});h.push({binary:UPC_E.SPECIAL_GUARD,role:"GUARD"});if(o){h.push({text:d,role:"ADDON_QUIET_ZONE"});h=h.concat(o.calculateData())}else h.push({text:d,role:"NO_ADDON_RIGHT_QUIET_ZONE"});return h};UPC_E.DefaultConfig={addOnHeight:"auto",addOnLabelPosition:"top",quietZone:{left:9,addOn:5}};UPC_E.SPECIAL_GUARD="010101";return UPC_E}(EANBase);export{UPC_E};var UPC_E1_Encoder=function(e){__extends(UPC_E1_Encoder,e);function UPC_E1_Encoder(t){return e.call(this,t,"1",UPC_E1_Encoder.structure)||this}UPC_E1_Encoder.structure=["AAABBB","AABABB","AABBAB","AABBBA","ABAABB","ABBAAB","ABBBAA","ABABAB","ABABBA","ABBABA"];return UPC_E1_Encoder}(UPC_E);export{UPC_E1_Encoder};var UPC_E0_Encoder=function(e){__extends(UPC_E0_Encoder,e);function UPC_E0_Encoder(t){return e.call(this,t,"0",UPC_E0_Encoder.structure)||this}UPC_E0_Encoder.structure=["BBBAAA","BBABAA","BBAABA","BBAAAB","BABBAA","BAABBA","BAAABB","BABABA","BABAAB","BAABAB"];return UPC_E0_Encoder}(UPC_E);export{UPC_E0_Encoder};var UPC_A_Encoder=function(e){__extends(UPC_A_Encoder,e);function UPC_A_Encoder(t){var o=this;t.merge(UPC_A_Encoder.DefaultConfig);var r=(o=e.call(this,t)||this).encodeConfig,n=r.text,a=r.hideExtraChecksum,s=n;if(n.length<12){n+=o.checksum(n,!0);a||(s=n)}o.label=s;o.text=n;return o}UPC_A_Encoder.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^(\d{11}|\d{12})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 11 or 12.");if(12===e.length){if(this.checksum(e.substr(0,11),!0)!=e[11])throw new InvalidTextException(e,"Check digit is invalid.")}};UPC_A_Encoder.prototype.calculateData=function(){var e=this.text,t=this.addOn,o=this.isTextGroup,r=this.label,n=e[0],a=e[11],s=r[11],c=e.substr(1,5),d=e.substr(6,5),u=r.substr(1,5),l=r.substr(6,5),h=[];h.push({text:n,role:"LEFT_QUIET_ZONE"});h.push({binary:EANBase.NORMAL_GUARD+EncodeTable.encodeByTable(n,"A"),role:"GUARD"});o?Utils.str2Array(c).forEach((function(e,t){h.push({binary:EncodeTable.encodeByTable(e,"A"),text:u[t]})})):h.push({binary:EncodeTable.encodeByTable(c,"A"),text:u});h.push({binary:EANBase.CENTRE_GUARD,role:"GUARD"});o?Utils.str2Array(d).forEach((function(e,t){h.push({binary:EncodeTable.encodeByTable(e,"C"),text:l[t]})})):h.push({binary:EncodeTable.encodeByTable(d,"C"),text:l});h.push({binary:EncodeTable.encodeByTable(a,"C")+EANBase.NORMAL_GUARD,role:"GUARD"});if(t){h.push({text:s,role:"ADDON_QUIET_ZONE"});h=h.concat(t.calculateData())}else h.push({text:s,role:"NO_ADDON_RIGHT_QUIET_ZONE"});return h};UPC_A_Encoder.DefaultConfig={addOnHeight:"auto",addOnLabelPosition:"top",quietZone:{right:9,left:9,addOn:5}};return UPC_A_Encoder}(EANBase);export{UPC_A_Encoder};Barcode.registerEncoder("UPC-A",UPC_A_Encoder);Barcode.registerEncoder("UPC-E0",UPC_E0_Encoder);Barcode.registerEncoder("UPC-E1",UPC_E1_Encoder);var EAN13Encoder=function(e){__extends(EAN13Encoder,e);function EAN13Encoder(t){var o=this;t.merge(EAN13Encoder.DefaultConfig);var r=(o=e.call(this,t)||this).encodeConfig,n=r.text,a=r.hideExtraChecksum,s=n;if(n.length<13){n+=o.checksum(n);a||(s=n)}o.label=s;o.text=n;return o}EAN13Encoder.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^[1-9](\d{11}|\d{12})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. And it should not start with 0. The length should be 12 or 13.");if(13===e.length){if(this.checksum(e.substr(0,12))!=e[12])throw new InvalidTextException(e,"Check digit is invalid.")}};EAN13Encoder.prototype.calculateData=function(){var e=this.text,t=this.addOn,o=this.isTextGroup,r=this.label,n=e.substr(1,6),a=e.substr(7,6),s=r.substr(1,6),c=r.substr(7,6),d=EAN13Encoder.leftStructure[e[0]],u=[];u.push({text:e[0],role:"LEFT_QUIET_ZONE"});u.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});o?Utils.str2Array(n).forEach((function(e,t){u.push({binary:EncodeTable.encodeByTable(e,d[t]),text:s[t]})})):u.push({binary:EncodeTable.encodeByStructure(n,d),text:s});u.push({binary:EANBase.CENTRE_GUARD,role:"GUARD"});o?Utils.str2Array(a).forEach((function(e,t){u.push({binary:EncodeTable.encodeByTable(e,"C"),text:c[t]})})):u.push({binary:EncodeTable.encodeByTable(a,"C"),text:c});u.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});if(t){u.push({role:"ADDON_QUIET_ZONE"});u=u.concat(t.calculateData())}else u.push({text:">",role:"NO_ADDON_RIGHT_QUIET_ZONE"});return u};EAN13Encoder.leftStructure=["AAAAAA","AABABB","AABBAB","AABBBA","ABAABB","ABBAAB","ABBBAA","ABABAB","ABABBA","ABBABA"];EAN13Encoder.DefaultConfig={addOnHeight:"auto",addOnLabelPosition:"top",quietZone:{addOn:5}};return EAN13Encoder}(EANBase);export{EAN13Encoder};var EAN8Encoder=function(e){__extends(EAN8Encoder,e);function EAN8Encoder(t){var o=this;t.merge(EAN8Encoder.DefaultConfig);var r=(o=e.call(this,t)||this).encodeConfig,n=r.text,a=r.hideExtraChecksum,s=n;if(n.length<8){n+=o.checksum(n,!0);a||(s=n)}o.label=s;o.text=n;return o}EAN8Encoder.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^[0-9](\d{6}|\d{7})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 7 or 8.");if(8===e.length){if(this.checksum(e.substr(0,7),!0)!=e[7])throw new InvalidTextException(e,"Check digit is invalid.")}};EAN8Encoder.prototype.calculateData=function(){var e=this.text,t=this.label,o=this.isTextGroup,r=e.substr(0,4),n=e.substr(4,4),a=t.substr(0,4),s=t.substr(4,4),c=[];c.push({text:"<",role:"LEFT_QUIET_ZONE"});c.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});o?Utils.str2Array(r).forEach((function(e,t){c.push({binary:EncodeTable.encodeByTable(e,"A"),text:a[t]})})):c.push({binary:EncodeTable.encodeByTable(r,"A"),text:a});c.push({binary:EANBase.CENTRE_GUARD,role:"GUARD"});o?Utils.str2Array(n).forEach((function(e,t){c.push({binary:EncodeTable.encodeByTable(e,"C"),text:s[t]})})):c.push({binary:EncodeTable.encodeByTable(n,"C"),text:s});c.push({binary:EANBase.NORMAL_GUARD,role:"GUARD"});c.push({text:">",role:"RIGHT_QUIET_ZONE"});return c};EAN8Encoder.DefaultConfig={quietZone:{left:7}};return EAN8Encoder}(EANBase);export{EAN8Encoder};Barcode.registerEncoder("EAN8",EAN8Encoder);Barcode.registerEncoder("EAN13",EAN13Encoder);var REG=/^([A-D]?)([0-9\-$:.+/]+)([A-D]?)$/,CodabarEncoder=function(e){__extends(CodabarEncoder,e);function CodabarEncoder(t){var o=this;t.merge(CodabarEncoder.DefaultConfig);var r=o=e.call(this,t)||this,n=r.config,a=n.checkDigit,s=n.nwRatio,c=r.encodeConfig,d=c.text,u=c.hideExtraChecksum,l=o.getTextEntity(d),h=l.originStartPattern,C=l.startPattern,f=l.content,p=l.originStopPattern,E=l.stopPattern;o.label=d;if(a){var g=o.checksum(f);o.text=C+f+g+E;u||(o.label=h+f+g+p)}else o.text=C+f+E;o.nwRatio=+s;return o}CodabarEncoder.prototype.validate=function(){var e=this.config.nwRatio,t=this.encodeConfig.text;if(!REG.test(t))throw new InvalidTextException(t);if(2!=e&&3!=e)throw new InvalidOptionsException({nwRatio:e},"NwRatio is 2 or 3")};CodabarEncoder.prototype.getTextEntity=function(e){var t=REG.exec(e);if(!t)throw new InvalidTextException(e);var o=t[1],r=o||"A",n=t[2],a=t[3];return{originStartPattern:o,startPattern:r,content:n,originStopPattern:a,stopPattern:a||"B"}};CodabarEncoder.prototype.encode=function(e){var t=this.nwRatio,o="",r=Utils.strRepeat("1",t),n=Utils.strRepeat("0",t);Utils.str2Array(e).forEach((function(e,t){Utils.isEven(t)?o+="1"===e?r:"1":o+="1"===e?n:"0"}));return o};CodabarEncoder.prototype.calculateData=function(){var e=this,t=this.text,o="";Utils.sliceString(t,1,(function(t){o=o+e.encode(CodabarEncoder.TABLE[t])+"0"}));return o=o.substr(0,o.length-1)};CodabarEncoder.prototype.checksum=function(e){var t=Utils.str2Array(e).filter((function(e){return Utils.isInteger(+e)})).reverse().reduce((function(e,t,o){var r=Utils.toNumber(t);if(Utils.isEven(o)){var n=2*r;e+=n>9?n-9:n}else e+=r;return e}),0)%10;0!==t&&(t=10-t);return t};CodabarEncoder.DefaultConfig={checkDigit:!1,quietZone:{right:10,left:10},nwRatio:3};CodabarEncoder.TABLE={0:"0000011",1:"0000110",2:"0001001",3:"1100000",4:"0010010",5:"1000010",6:"0100001",7:"0100100",8:"0110000",9:"1001000","-":"0001100",$:"0011000",":":"1000101","/":"1010001",".":"1010100","+":"0010101",A:"0011010",B:"0101001",C:"0001011",D:"0001110"};return CodabarEncoder}(OneDimensionalBarcode);export{CodabarEncoder};Barcode.registerEncoder("Codabar",CodabarEncoder);export var CodabarClsNames={hostElement:"wj-barcode-codabar"};export var Code128ClsNames={hostElement:"wj-barcode-code128"};export var Code39ClsNames={hostElement:"wj-barcode-code39"};export var Ean13ClsNames={hostElement:"wj-barcode-ean13"};export var Ean8ClsNames={hostElement:"wj-barcode-ean8"};export var EanBaseClsNames={hostElement:"wj-barcode-ean"};export var Gs1_128ClsNames={hostElement:"wj-barcode-gs1_128"};export var QrCodeClsNames={hostElement:"wj-barcode-qrcode"};export var UpcAClsNames={hostElement:"wj-barcode-upca"};export var UpcBaseClsNames={hostElement:"wj-barcode-upc"};export var UpcE0ClsNames={hostElement:"wj-barcode-upce0"};export var UpcE1ClsNames={hostElement:"wj-barcode-upce1"};export var QrCodeCharset;!function(e){e[e.Utf8=0]="Utf8";e[e.ShiftJis=1]="ShiftJis"}(QrCodeCharset||(QrCodeCharset={}));export var QrCodeCorrectionLevel;!function(e){e[e.Low=0]="Low";e[e.Medium=1]="Medium";e[e.Quartile=2]="Quartile";e[e.High=3]="High"}(QrCodeCorrectionLevel||(QrCodeCorrectionLevel={}));export var QrCodeModel;!function(e){e[e.Model1=0]="Model1";e[e.Model2=1]="Model2"}(QrCodeModel||(QrCodeModel={}));export var Code128CodeSet;!function(e){e[e.Auto=0]="Auto";e[e.A=1]="A";e[e.B=2]="B";e[e.C=3]="C"}(Code128CodeSet||(Code128CodeSet={}));var _QrCodeModelConvertor=function(){function _QrCodeModelConvertor(){}_QrCodeModelConvertor.stringToEnum=function(e){switch(e.toString()){case"1":return QrCodeModel.Model1;case"2":return QrCodeModel.Model2}throw"Unknown QRCode internal model '"+e+"'"};_QrCodeModelConvertor.enumToString=function(e){var t=QrCodeModel[asEnum(e,QrCodeModel)];return t.charAt(t.length-1)};return _QrCodeModelConvertor}();export{_QrCodeModelConvertor};var _CharsetTypeConvertor=function(){function _CharsetTypeConvertor(){}_CharsetTypeConvertor.stringToEnum=function(e){switch(e){case"UTF-8":return QrCodeCharset.Utf8;case"Shift_JIS":return QrCodeCharset.ShiftJis}throw"Unknown Barcode internal charset '"+e+"'"};_CharsetTypeConvertor.enumToString=function(e){var t;switch(asEnum(e,QrCodeCharset)){case QrCodeCharset.Utf8:t="UTF-8";break;case QrCodeCharset.ShiftJis:t="Shift_JIS"}return t};return _CharsetTypeConvertor}();export{_CharsetTypeConvertor};var _CorrectionLevelConvertor=function(){function _CorrectionLevelConvertor(){}_CorrectionLevelConvertor.stringToEnum=function(e){switch(e){case"L":return QrCodeCorrectionLevel.Low;case"M":return QrCodeCorrectionLevel.Medium;case"Q":return QrCodeCorrectionLevel.Quartile;case"H":return QrCodeCorrectionLevel.High}throw"Unknown barcode internal errorCorrectionLevel '"+e+"'"};_CorrectionLevelConvertor.enumToString=function(e){return QrCodeCorrectionLevel[asEnum(e,QrCodeCorrectionLevel)].charAt(0)};return _CorrectionLevelConvertor}();export{_CorrectionLevelConvertor};var _CodeSetTypeConvertor=function(){function _CodeSetTypeConvertor(){}_CodeSetTypeConvertor.stringToEnum=function(e){switch(e){case"auto":return Code128CodeSet.Auto;case"A":return Code128CodeSet.A;case"B":return Code128CodeSet.B;case"C":return Code128CodeSet.C}throw"Unknown barcode internal codeSet '"+e+"'"};_CodeSetTypeConvertor.enumToString=function(e){var t,o=asEnum(e,Code128CodeSet);switch(o){case Code128CodeSet.Auto:t="auto";break;case Code128CodeSet.A:case Code128CodeSet.B:case Code128CodeSet.C:t=Code128CodeSet[o]}return t};return _CodeSetTypeConvertor}();export{_CodeSetTypeConvertor};var Codabar=function(e){__extends(Codabar,e);function Codabar(t,o){var r=e.call(this,t)||this;addClass(r.hostElement,CodabarClsNames.hostElement);r._setAw(!0);r.initialize(o);return r}Object.defineProperty(Codabar,"controlTemplate",{get:function(){Codabar._ctrlTemplate||(Codabar._ctrlTemplate=BarcodeBase.controlTemplate);return Codabar._ctrlTemplate},set:function(e){Codabar._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"checkDigit",{get:function(){return this._getProp("checkDigit")},set:function(e){this._setProp("checkDigit",e)},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Codabar.prototype,"nwRatio",{get:function(){return _NarrowWideRatioConvertor.stringToEnum(this._getProp("nwRatio"))},set:function(e){this._setProp("nwRatio",_NarrowWideRatioConvertor.enumToString(e))},enumerable:!0,configurable:!0});Codabar.type="Codabar";Codabar._ctrlTemplate="";return Codabar}(BarcodeBase);export{Codabar};var EanBase=function(e){__extends(EanBase,e);function EanBase(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,EanBaseClsNames.hostElement);return r}Object.defineProperty(EanBase.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(EanBase.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});return EanBase}(BarcodeBase);export{EanBase};var Ean8=function(e){__extends(Ean8,e);function Ean8(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,Ean8ClsNames.hostElement);return r}Ean8.type="EAN8";return Ean8}(EanBase);export{Ean8};var Ean13=function(e){__extends(Ean13,e);function Ean13(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,Ean13ClsNames.hostElement);return r}Object.defineProperty(Ean13.prototype,"addOn",{get:function(){return this._getProp("addOn")},set:function(e){this._setProp("addOn",e)},enumerable:!0,configurable:!0});Object.defineProperty(Ean13.prototype,"addOnHeight",{get:function(){return this._getProp("addOnHeight")},set:function(e){this._setProp("addOnHeight",e)},enumerable:!0,configurable:!0});Object.defineProperty(Ean13.prototype,"addOnLabelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("addOnLabelPosition"))},set:function(e){this._setProp("addOnLabelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Ean13.prototype,"quietZone",{get:function(){return this._getProp("quietZone")},set:function(e){this._setProp("quietZone",e)},enumerable:!0,configurable:!0});Ean13.type="EAN13";return Ean13}(EanBase);export{Ean13};var Code39=function(e){__extends(Code39,e);function Code39(t,o){var r=e.call(this,t)||this;addClass(r.hostElement,Code39ClsNames.hostElement);r._setAw(!0);r.initialize(o);return r}Object.defineProperty(Code39,"controlTemplate",{get:function(){Code39._ctrlTemplate||(Code39._ctrlTemplate=BarcodeBase.controlTemplate);return Code39._ctrlTemplate},set:function(e){Code39._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"checkDigit",{get:function(){return this._getProp("checkDigit")},set:function(e){this._setProp("checkDigit",e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"fullAscii",{get:function(){return this._getProp("fullASCII")},set:function(e){this._setProp("fullASCII",e)},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"nwRatio",{get:function(){return _NarrowWideRatioConvertor.stringToEnum(this._getProp("nwRatio"))},set:function(e){this._setProp("nwRatio",_NarrowWideRatioConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Code39.prototype,"labelWithStartAndStopCharacter",{get:function(){return this._getProp("labelWithStartAndStopCharacter")},set:function(e){this._setProp("labelWithStartAndStopCharacter",e)},enumerable:!0,configurable:!0});Code39.type="Code39";Code39._ctrlTemplate="";return Code39}(BarcodeBase);export{Code39};var Code128=function(e){__extends(Code128,e);function Code128(t,o){var r=e.call(this,t)||this;addClass(r.hostElement,Code128ClsNames.hostElement);r._setAw(!0);r.initialize(o);return r}Object.defineProperty(Code128,"controlTemplate",{get:function(){Code128._ctrlTemplate||(Code128._ctrlTemplate=BarcodeBase.controlTemplate);return Code128._ctrlTemplate},set:function(e){Code128._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"codeSet",{get:function(){return _CodeSetTypeConvertor.stringToEnum(this._getProp("codeSet"))},set:function(e){this._setProp("codeSet",_CodeSetTypeConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Code128.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Code128.type="Code128";Code128._ctrlTemplate="";return Code128}(BarcodeBase);export{Code128};var Gs1_128=function(e){__extends(Gs1_128,e);function Gs1_128(t,o){var r=e.call(this,t)||this;addClass(r.hostElement,Gs1_128ClsNames.hostElement);r._setAw(!0);r.initialize(o);return r}Object.defineProperty(Gs1_128,"controlTemplate",{get:function(){Gs1_128._ctrlTemplate||(Gs1_128._ctrlTemplate=BarcodeBase.controlTemplate);return Gs1_128._ctrlTemplate},set:function(e){Gs1_128._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(Gs1_128.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1_128.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1_128.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1_128.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Gs1_128.type="GS1_128";Gs1_128._ctrlTemplate="";return Gs1_128}(BarcodeBase);export{Gs1_128};var UpcBase=function(e){__extends(UpcBase,e);function UpcBase(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,UpcBaseClsNames.hostElement);return r}Object.defineProperty(UpcBase,"controlTemplate",{get:function(){UpcBase._ctrlTemplate||(UpcBase._ctrlTemplate=BarcodeBase.controlTemplate);return UpcBase._ctrlTemplate},set:function(e){UpcBase._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"addOn",{get:function(){return this._getProp("addOn")},set:function(e){this._setProp("addOn",e)},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"addOnHeight",{get:function(){return this._getProp("addOnHeight")},set:function(e){this._setProp("addOnHeight",e)},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"addOnLabelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("addOnLabelPosition"))},set:function(e){this._setProp("addOnLabelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(UpcBase.prototype,"quietZone",{get:function(){return this._getProp("quietZone")},set:function(e){this._setProp("quietZone",e)},enumerable:!0,configurable:!0});UpcBase._ctrlTemplate="";return UpcBase}(BarcodeBase);export{UpcBase};var UpcA=function(e){__extends(UpcA,e);function UpcA(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,UpcAClsNames.hostElement);return r}UpcA.type="UPC-A";return UpcA}(UpcBase);export{UpcA};var UpcE0=function(e){__extends(UpcE0,e);function UpcE0(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,UpcE0ClsNames.hostElement);return r}UpcE0.type="UPC-E0";return UpcE0}(UpcBase);export{UpcE0};var UpcE1=function(e){__extends(UpcE1,e);function UpcE1(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,UpcE1ClsNames.hostElement);return r}UpcE1.type="UPC-E1";return UpcE1}(UpcBase);export{UpcE1};var QrCode=function(e){__extends(QrCode,e);function QrCode(t,o){var r=e.call(this,t,o)||this;addClass(r.hostElement,QrCodeClsNames.hostElement);return r}Object.defineProperty(QrCode.prototype,"charCode",{get:function(){return this._getProp("charCode")},set:function(e){this._setProp("charCode",e)},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"charset",{get:function(){return _CharsetTypeConvertor.stringToEnum(this._getProp("charset"))},set:function(e){this._setProp("charset",_CharsetTypeConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"model",{get:function(){return _QrCodeModelConvertor.stringToEnum(this._getProp("model"))},set:function(e){this._setProp("model",_QrCodeModelConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"version",{get:function(){var e=this._getProp("version");return"auto"===e?null:e},set:function(e){this._setProp("version",null==e?"auto":e)},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"errorCorrectionLevel",{get:function(){return _CorrectionLevelConvertor.stringToEnum(this._getProp("errorCorrectionLevel"))},set:function(e){this._setProp("errorCorrectionLevel",_CorrectionLevelConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"mask",{get:function(){var e=this._getProp("mask");return"auto"===e?null:e},set:function(e){this._setProp("mask",null==e?"auto":e)},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"connection",{get:function(){return this._getProp("connection")},set:function(e){this._setProp("connection",e)},enumerable:!0,configurable:!0});Object.defineProperty(QrCode.prototype,"connectionIndex",{get:function(){return this._getProp("connectionNo")},set:function(e){this._setProp("connectionNo",e)},enumerable:!0,configurable:!0});QrCode.type="QRCode";return QrCode}(BarcodeBase);export{QrCode};_registerModule("wijmo.barcode.common",selfModule);
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20261.45-nightly.d20251218.t163151
3
+ * Wijmo Library 5.20261.45-nightly.d20260105.t163143
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
@@ -198,7 +198,7 @@ export declare const Code128Char: {
198
198
  StartB: string;
199
199
  StartC: string;
200
200
  };
201
- export declare function getCharValue(str: any, table: any): any;
201
+ export declare function getCharValue(str: any, table: any): number;
202
202
  export declare function getCharPattern(str: any, table: any): string;
203
203
  export declare function getPatternByIndex(index: any): string;
204
204
  export declare function encode(str: any): string;
@@ -260,36 +260,36 @@ export declare class EncodeTable_Code39 {
260
260
  '7': string;
261
261
  '8': string;
262
262
  '9': string;
263
- 'A': string;
264
- 'B': string;
265
- 'C': string;
266
- 'D': string;
267
- 'E': string;
268
- 'F': string;
269
- 'G': string;
270
- 'H': string;
271
- 'I': string;
272
- 'J': string;
273
- 'K': string;
274
- 'L': string;
275
- 'M': string;
276
- 'N': string;
277
- 'O': string;
278
- 'P': string;
279
- 'Q': string;
280
- 'R': string;
281
- 'S': string;
282
- 'T': string;
283
- 'U': string;
284
- 'V': string;
285
- 'W': string;
286
- 'X': string;
287
- 'Y': string;
288
- 'Z': string;
263
+ A: string;
264
+ B: string;
265
+ C: string;
266
+ D: string;
267
+ E: string;
268
+ F: string;
269
+ G: string;
270
+ H: string;
271
+ I: string;
272
+ J: string;
273
+ K: string;
274
+ L: string;
275
+ M: string;
276
+ N: string;
277
+ O: string;
278
+ P: string;
279
+ Q: string;
280
+ R: string;
281
+ S: string;
282
+ T: string;
283
+ U: string;
284
+ V: string;
285
+ W: string;
286
+ X: string;
287
+ Y: string;
288
+ Z: string;
289
289
  '-': string;
290
290
  '.': string;
291
291
  ' ': string;
292
- '$': string;
292
+ $: string;
293
293
  '/': string;
294
294
  '+': string;
295
295
  '%': string;
@@ -437,15 +437,15 @@ export declare class CodabarEncoder extends OneDimensionalBarcode {
437
437
  '8': string;
438
438
  '9': string;
439
439
  '-': string;
440
- '$': string;
440
+ $: string;
441
441
  ':': string;
442
442
  '/': string;
443
443
  '.': string;
444
444
  '+': string;
445
- 'A': string;
446
- 'B': string;
447
- 'C': string;
448
- 'D': string;
445
+ A: string;
446
+ B: string;
447
+ C: string;
448
+ D: string;
449
449
  };
450
450
  private nwRatio;
451
451
  constructor(option: any);
@@ -524,12 +524,12 @@ export declare enum QrCodeCorrectionLevel {
524
524
  export declare enum QrCodeModel {
525
525
  /** QRCode model1:Original model. Model1 is the prototype of Model2 and
526
526
  * Micro QR.1 to 14 versions are registered to the AIMI standard.
527
- */
527
+ */
528
528
  Model1 = 0,
529
529
  /** QRCode model2:Extended model. Model2 has an alignment pattern for better
530
530
  * position adjustment and contains larger data than Model 1.
531
531
  * 1 to 40 version are registered to the AIMI standard.
532
- */
532
+ */
533
533
  Model2 = 1
534
534
  }
535
535
  /**