@syncfusion/ej2-barcode-generator
Version:
Barcode generator component is a pure JavaScript library which will convert a string to Barcode and show it to the user. This supports major 1D and 2D barcodes including coda bar, code 128, QR Code.
10 lines • 151 kB
JavaScript
/*!
* filename: ej2-barcode-generator.umd.min.js
* version : 30.2.4
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base"],e):e((t=t||self).ej={},t.ej2Base)}(this,function(x,a){"use strict";(e=x.BarcodeEvent||(x.BarcodeEvent={}))[e.invalid=0]="invalid",(e=x.QuietZone||(x.QuietZone={}))[e.All=2]="All",(e=x.DataMatrixSize||(x.DataMatrixSize={}))[e.Auto=0]="Auto",e[e.Size10x10=1]="Size10x10",e[e.Size12x12=2]="Size12x12",e[e.Size14x14=3]="Size14x14",e[e.Size16x16=4]="Size16x16",e[e.Size18x18=5]="Size18x18",e[e.Size20x20=6]="Size20x20",e[e.Size22x22=7]="Size22x22",e[e.Size24x24=8]="Size24x24",e[e.Size26x26=9]="Size26x26",e[e.Size32x32=10]="Size32x32",e[e.Size36x36=11]="Size36x36",e[e.Size40x40=12]="Size40x40",e[e.Size44x44=13]="Size44x44",e[e.Size48x48=14]="Size48x48",e[e.Size52x52=15]="Size52x52",e[e.Size64x64=16]="Size64x64",e[e.Size72x72=17]="Size72x72",e[e.Size80x80=18]="Size80x80",e[e.Size88x88=19]="Size88x88",e[e.Size96x96=20]="Size96x96",e[e.Size104x104=21]="Size104x104",e[e.Size120x120=22]="Size120x120",e[e.Size132x132=23]="Size132x132",e[e.Size144x144=24]="Size144x144",e[e.Size8x18=25]="Size8x18",e[e.Size8x32=26]="Size8x32",e[e.Size12x26=27]="Size12x26",e[e.Size12x36=28]="Size12x36",e[e.Size16x36=29]="Size16x36",e[e.Size16x48=30]="Size16x48",(e=x.QRCodeVersion||(x.QRCodeVersion={}))[e.Auto=0]="Auto",e[e.Version01=1]="Version01",e[e.Version02=2]="Version02",e[e.Version03=3]="Version03",e[e.Version04=4]="Version04",e[e.Version05=5]="Version05",e[e.Version06=6]="Version06",e[e.Version07=7]="Version07",e[e.Version08=8]="Version08",e[e.Version09=9]="Version09",e[e.Version10=10]="Version10",e[e.Version11=11]="Version11",e[e.Version12=12]="Version12",e[e.Version13=13]="Version13",e[e.Version14=14]="Version14",e[e.Version15=15]="Version15",e[e.Version16=16]="Version16",e[e.Version17=17]="Version17",e[e.Version18=18]="Version18",e[e.Version19=19]="Version19",e[e.Version20=20]="Version20",e[e.Version21=21]="Version21",e[e.Version22=22]="Version22",e[e.Version23=23]="Version23",e[e.Version24=24]="Version24",e[e.Version25=25]="Version25",e[e.Version26=26]="Version26",e[e.Version27=27]="Version27",e[e.Version28=28]="Version28",e[e.Version29=29]="Version29",e[e.Version30=30]="Version30",e[e.Version31=31]="Version31",e[e.Version32=32]="Version32",e[e.Version33=33]="Version33",e[e.Version34=34]="Version34",e[e.Version35=35]="Version35",e[e.Version36=36]="Version36",e[e.Version37=37]="Version37",e[e.Version38=38]="Version38",e[e.Version39=39]="Version39",e[e.Version40=40]="Version40",(e=x.ErrorCorrectionLevel||(x.ErrorCorrectionLevel={}))[e.Low=7]="Low",e[e.Medium=15]="Medium",e[e.Quartile=25]="Quartile",e[e.High=30]="High";var _=function(t,e){this.width=t,this.height=e};function o(t,e){t=a.createElement(t);return e&&T(t,e),t}function R(t){var e,r=[];if("msie"===a.Browser.info.name||"edge"===a.Browser.info.name)for(var i=0;i<t.childNodes.length;i++)1===(e=t.childNodes[parseInt(i.toString(),10)]).nodeType&&r.push(e);else r=t.children;return r}function O(t){var e="barcodeMeasureElement";window[e].style.visibility="visible";var r=R(window[e].children[1])[0],t=(r.textContent=t.string,r.style.fontSize=t.stringSize+"px",r.style.fontFamily=t.fontStyle,r.style.fontWeight="",new _(0,0));return t.width=r.getBBox().width,t.height=r.getBBox().height,window[e].style.visibility="hidden",t}function T(r,i){for(var t=Object.keys(i),e=0;e<t.length;e++)t.forEach(function(t){var e=i[t];"style"===t&&"string"==typeof e?e.split(";").forEach(function(t){var t=t.split(":"),e=t[0],t=t[1];e&&t&&r.style.setProperty(e.trim(),t.trim())}):r.setAttribute(t,e)})}function z(t,e){t=document.createElementNS("http://www.w3.org/2000/svg",t);return T(t,e),t}function j(){var t,e,r,i="barcodeMeasureElement";window[i]?window[i].usageCount+=1:(t=o("div",{id:"barcodeMeasureElement",class:"barcodeMeasureElement",style:"visibility:hidden ; height: 0px ; width: 0px; overflow: hidden;"}),e=o("span",{style:"display:inline-block ; line-height: normal"}),t.appendChild(e),(e=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("xlink","http://www.w3.org/1999/xlink"),t.appendChild(e),(r=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.appendChild(r),window[i]=t,window[i].usageCount=1,document.body.appendChild(t))}t.getContext=function(t){return t.getContext("2d")},t.prototype.renderRootElement=function(t,e,r,i){var t=o("canvas",t),a=t.getContext("2d");return a.fillStyle=e,a.fillRect(0,0,r,i),t},t.prototype.renderRect=function(t,e){var r,i=t.getContext("2d");return e.imageSource?((r=new Image).src=e.imageSource,r.onload=function(){i.drawImage(r,e.x,e.y,e.width,e.height)}):(i.fillStyle=e.color,i.fillRect(e.x,e.y,e.width,e.height)),t},t.prototype.renderText=function(t,e){var r=t.getContext("2d");return r.save(),r.font=e.stringSize+"px "+e.fontStyle,r.fillStyle=e.color,r.fillText(e.string,e.x,e.y),t};var Q=t;function t(){}X.prototype.renderRootElement=function(t,e){t=z("svg",t);return t.style.background=e,t},X.prototype.renderRect=function(t,e){var r;return e.imageSource?this.renderImage(t,e):((r=document.createElementNS("http://www.w3.org/2000/svg","rect")).setAttribute("x",e.x.toString()),r.setAttribute("y",e.y.toString()),r.setAttribute("width",e.width.toString()),r.setAttribute("height",e.height.toString()),r.setAttribute("fill",e.color),r.style.shapeRendering="crispEdges",t.appendChild(r),t)},X.prototype.renderText=function(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg","text");return r.setAttribute("x",e.x.toString()),r.setAttribute("y",e.y.toString()),r.setAttribute("fill",e.color),r.style.fontSize=e.stringSize.toString()+"px",r.style.fontFamily=e.fontStyle,r.textContent=e.string,t.appendChild(r),t},X.prototype.renderImage=function(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg","image");return r.setAttribute("x",e.x.toString()),r.setAttribute("y",e.y.toString()),r.setAttribute("width",e.width.toString()),r.setAttribute("height",e.height.toString()),r.setAttribute("href",e.imageSource),r.setAttribute("preserveAspectRatio","none"),t.appendChild(r),t};var F=X;function X(){}G.prototype.renderRootElement=function(t,e,r,i){return this.renderer.renderRootElement(t,e,r,i)},G.prototype.renderRectElement=function(t,e){return this.renderer.renderRect(t,e)},G.prototype.renderTextElement=function(t,e){return this.renderer.renderText(t,e)};var s=G;function G(t,e){this.renderer=null,this.isSvgMode=null,this.isSvgMode=e,this.renderer=new(e?F:Q)}function U(){}var W=function(t,e,r,i){this.x=Number.MAX_VALUE,this.y=Number.MAX_VALUE,this.width=0,this.height=0,this.x=t,this.y=e,this.width=r,this.height=i};$=function(t,e){return($=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}$(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(r,H=U),r.prototype.getInstance=function(t){t=document.getElementById(t);return new s(t.id,this.isSvgMode)},r.prototype.getDrawableSize=function(t,e,r){var i=(this.isSvgMode?t.bottom:1.5*t.bottom)+(this.isSvgMode?t.top:1.5*t.top),a=(this.isSvgMode?t.right:1.5*t.right)+(this.isSvgMode?t.left:1.5*t.left);return new W(t.left,t.top,e-a,r-i)},r.prototype.getBaseAttributes=function(t,e,r,i,a,o,s,n,c){t={width:t,height:e,x:r,y:i,color:a,string:o,stringSize:s,visibility:n,fontStyle:c};return this.isSvgMode||(t.height=t.height/1.5),o&&!this.isSvgMode&&(e=1.5*this.margin.bottom-this.margin.bottom,t.y+=e),t},r.prototype.getBarLineRatio=function(t,e){var r=this.type;if("Code39"===r||"Code32"===r||"Code39Extension"===r||"Code11"===r)return c=t.length*("Code39"===r||"Code32"===r||"Code39Extension"===r?6:3),e/(t.length*("Code39"===r||"Code32"===r||"Code39Extension"===r?3:2)*2+c+t.length-1);if("Code128A"===r||"Code128B"===r||"Code128C"===r||"Code128"===r)return e/((n=t[0].length)+t.length-1);if("Code93Extension"===r){for(var i=0,a=0;a<t.length;a++)for(var o=t[parseInt(a.toString(),10)],s=0;s<o.length;s++)i+=Number(o[parseInt(s.toString(),10)]);return e/i}for(var n=0,a=0;a<t.length;a++)n+=o=t[parseInt(a.toString(),10)].length;var c=void 0;return"Ean8"===r||"Ean13"===r||"UpcA"===r?c=2:"Code93"===r&&(c=1-t.length),e/(c?n+t.length-1+c:n+t.length-1)},r.prototype.multipleWidth=function(t,e,r){return"1"===t[parseInt(e.toString(),10)]&&"1"===t[e+1]?this.multipleWidth(t,e+1,r+1):r},r.prototype.barCodeType=function(t){return"Code39"===t||"UpcE"===t||"Code39Extension"===t?"twoBars":"UpcA"===t||"Ean13"===t||"Ean8"===t?"threeBars":"noBars"},r.prototype.checkStartValueCondition=function(t,e,r,i){return 1===t&&0===e&&"twoBars"===i&&"UpcE"!==this.type||(0===t&&e===r-1||2===t&&e===r-2)&&("Ean8"===this.type||"Ean13"===this.type)||"UpcE"===this.type&&2===t&&0===e||"UpcA"!==this.type&&"threeBars"===i&&2===t&&e===r-1||"UpcA"===this.type&&(1===t&&e===r-2||3===t&&e===r-2)||"noBars"===i&&0===t&&0===e},r.prototype.checkEndValueCondition=function(t,e,r,i,a,o){var s=this.type;return t===r&&e===i.length-2&&("Code39"===s||"Code39Extension"===s)||"Code11"===s&&e===i.length-1&&t===r-1||"Code93Extension"===s&&e===i.length-1&&t===r-1||"Ean8"===s&&(1===e&&t===r||e===i.length-2&&t===r)||"Ean13"===this.type&&(2===e&&1===t||e===i.length-2&&t===r)||"UpcA"===s&&(3===e&&0===t||5===e&&(a?t===o:1===t))||"UpcE"===s&&e===i.length-2&&1===t||"Code93"===s&&e===i.length-1&&t===r-1||"Code39"!==s&&"Code39Extension"!==s&&"Ean8"!==s&&"Ean13"!==s&&e===i.length-1&&t===r},r.prototype.getDisplayText=function(t,e){t="Ean8"===this.type?1===t?this.value.substring(0,4):this.value.substring(4,8):"Ean13"===this.type?2===t?this.value.substring(1,7):this.value.substring(7):"UpcA"===this.type?3===t?this.value.substring(0,6):this.value.substring(6,12):e.text||this.value;return t},r.prototype.checkExtraHeight=function(t,e,r){return!(0!==t&&t!==r.length-1||"Code39"!==e&&"Code39Extension"!==e)||!("Ean8"!==e&&"Ean13"!==e||0!==t&&2!==t&&t!==r.length-1)||"UpcA"===e&&(1===t||t===r.length-2||t===r.length-4)||"UpcE"===e&&(1===t||t===r.length-2||t===r.length-4)},r.prototype.getWidthValue=function(t,e,r){return"Code93Extension"!==this.type&&(e=!t||t%("Code32"===r?3:2)?1:2),e="Code93Extension"===this.type?!t||t%4?!t||t%2?!t||t%3?1:3:2:4:e},r.prototype.calculateBarCodeAttributes=function(t,e,r){var i,a=!1,o=this.getDrawableSize(this.margin,this.width,this.height);if(0<o.height&&0<o.width){for(var s=void 0,n=[],c=o.x,h=this.getBarLineRatio(t,o.width),h=this.isSvgMode?h:h/1.5,l=0,u=void 0,p=this.type,d=this.displayText.position,m=this.isSvgMode?1:1.5,g=void 0,b=void 0,y=void 0,f=void 0,v=0;v<t.length;v++)for(var k=t[parseInt(v.toString(),10)],S="UpcA"!==p&&"UpcE"!==p&&"Code11"!==p&&"Code93"!==p&&"Code93Extension"!==p,C=this.barCodeType(this.type),w=this.checkExtraHeight(v,p,t),I=k.length,a=!1,x=0;S?x<=I:x<I;x++){var V=!1;this.checkStartValueCondition(v,x,I,C)?l=c:this.checkEndValueCondition(x,v,I,t,a,i)&&(u=c,"UpcA"===this.type&&a&&i&&(u-=i*h),V=!0);var E,A,M="Code39"===p||"Code93Extension"===p||"Code32"===p||"Code11"===p||"Code39Extension"===p?!(x%2):"1"===k[parseInt(x.toString(),10)],D=k.toString(),D=Number(D[parseInt(x.toString(),10)]),B=void 0,B=this.getWidthValue(D,void 0,p),f=(B*=h,this.displayText),D=this.getDisplayText(v,f),g=this.getBaseAttributes(void 0,void 0,l,"Bottom"===d?o.y+o.height+2:o.y+y-2,this.foreColor,r||D,f.size,f.visibility,f.font);y||(j(),y=(b=O(g)).height/2+2),w&&(s=this.getBaseAttributes(B,"Top"===d&&"noBars"!==C?o.height-y-this.displayText.margin.top:o.height,c,"Bottom"===d?o.y:o.y+y+this.displayText.margin.top,this.foreColor)),"Ean13"===p&&0===x&&0===v&&f.visibility&&((g=this.getBaseAttributes(void 0,void 0,l,"Bottom"===d?o.y+o.height+2:o.y+y+this.displayText.margin.top-2-this.displayText.margin.bottom,this.foreColor,r||D,f.size,f.visibility,f.font)).string=this.value[0],this.drawText(e,g)),(!w||V||"UpcA"===p&&w)&&(D=0<(D=o.height)-y*m?D-y*m:0,!(A="Code39"===p||"Code32"===p||"Code93Extension"===p||"Code39Extension"===p||"Code11"===p)&&"Ean8"!==p&&"Ean13"!==p||(D="Top"===d&&"noBars"!==C?D-y:D,E=w?o.height:D,"Code39"!==this.type&&(E="Top"===d&&"noBars"!==C?E-this.displayText.margin.top-y:E),s=this.getBaseAttributes(B,E,c,"Bottom"===d?o.y:o.y+y+this.displayText.margin.top,this.foreColor)),A&&(V||A)||V&&"UpcE"===this.type||(x+=(i=this.multipleWidth(k,x,1))-1,1<i&&(a=!0),D=o.height-y*m,E=w?o.height:D,E="Top"===d&&"noBars"!==C?E-this.displayText.margin.top-y:E,s=this.getBaseAttributes(1<i?i*B:B,E,c,"Bottom"===d?o.y:o.y+y+this.displayText.margin.top,this.foreColor),c=1<i?c+i*B:c+B),!V&&w||this.verticalTextMargin(f,s,g),f.visibility)&&(u&&"Ean8"!==p&&"Ean13"!==p&&"UpcA"!==p&&"UpcE"!==p||("Ean8"===p||"UpcA"===p||"UpcE"===p||"Ean13"===p)&&V)&&(f.margin.left||f.margin.right||!f.text&&"UpcA"!==p?this.getAlignmentPosition(g,u,l,b):this.updateOverlappedTextPosition(u-l,g,b,l,f,u),"UpcA"===p&&(A=g.string===this.value.substr(0,6),g.string=A?this.value.substr(0,1):g.string.substr(0,5),D=A?n[0].x/2:n[n.length-1].x+g.stringSize,V=0,A?(A=g.x,g.x=D,V=g.y,this.drawText(e,g),g.x=A,this.isSvgMode||(g.y=V),g.string=this.value.substr(1,5),this.updateOverlappedTextPosition(u-l,g,b,l,f,u)):(this.updateOverlappedTextPosition(u-l,g,b,l,f,u),V=g.y,this.drawText(e,g),this.isSvgMode||(g.y=V),g.string=this.value.substr(11,12),g.x=D)),this.alignDisplayText(g,f,l,u,b),this.drawText(e,g)),M&&n.push(s),this.canIncrementCheck(p,v,t)&&(c+=B)}this.drawImage(e,n)}},r.prototype.canIncrementCheck=function(t,e,r){return"Code39"===t||"Code32"===t||"Code39Extension"===t||"Code93Extension"===t||"Code11"===t||"UpcE"===t&&(1===e||e===r.length-2)||!("Ean8"!==t&&"Ean13"!==t||0!==e&&e!==r.length-1&&2!==e)},r.prototype.verticalTextMargin=function(t,e,r){t.margin.top&&0<e.height-t.margin.top&&(0<t.margin.top&&"Bottom"===t.position?e.height-=t.margin.top:r.y+=t.margin.top),t.margin.bottom&&0<e.height-t.margin.bottom&&(0<t.margin.bottom?(r.y-=t.margin.bottom,"Bottom"===this.displayText.position&&(e.height-=t.margin.bottom)):r.y-=t.margin.bottom)},r.prototype.getAlignmentPosition=function(t,e,r,i){"Center"===this.displayText.alignment?t.x+=(e-r)/2-.5*i.width:"Left"===this.displayText.alignment?t.x=r:t.x=e-i.width},r.prototype.drawImage=function(t,e){for(var r=this.getInstance(t.id),i=0;i<e.length;i++)r.renderRectElement(t,e[parseInt(i.toString(),10)])},r.prototype.updateDisplayTextSize=function(t,e,r,i,a){var o;(t.x+e.width>r||t.x<i&&2<t.stringSize)&&(t.x<i&&a.margin.right,t.x<i)&&a.margin.right&&(t.stringSize-=2,o=O(t),t.x+=(r-i)/2-.5*o.width,e=a.margin.right-(r-(t.x+e.width)),t.x-=e,this.updateDisplayTextSize(t,o,r,i,a))},r.prototype.alignDisplayText=function(t,e,r,i,a){var o,s=!1;(e.margin.left||e.margin.right)&&(t.x-r<e.margin.left&&e.margin.left&&(s=!0,o=e.margin.left-(t.x-r),t.x+=o,this.updateDisplayTextSize(t,a,i,r,e)),i-(t.x+a.width)<e.margin.right&&e.margin.right&&!s?(o=e.margin.right-(i-(t.x+a.width)),t.x-=o,this.updateDisplayTextSize(t,a,i,r,e)):i-(t.x+a.width)<e.margin.right&&(s=O(t),this.updateOverlappedTextPosition(i-r,t,s,r,e,i),this.updateDisplayTextSize(t,s,i,r,e)))},r.prototype.updateOverlappedTextPosition=function(t,e,r,i,a,o){var s;(r.width>t||a)&&o-(e.x+r.width)<=a.margin.right&&2<e.stringSize?(e.stringSize-=a?.2:2,s=O(e),this.updateOverlappedTextPosition(t,e,s,i,a,o)):!a.margin.left&&!a.margin.right&&2<e.stringSize&&this.getAlignmentPosition(e,o,i,r)},r.prototype.drawText=function(t,e){this.isSvgMode||(e.y/=1.5),this.getInstance(t.id).renderTextElement(t,e)};var $,H,e=r;function r(){return null!==H&&H.apply(this,arguments)||this}Z=function(t,e){return(Z=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}Z(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(i,J=e),i.prototype.validateInput=function(t){if(-1===t.search(/^[0-9A-Za-z\-\.\ \@\$\/\+\%\!\@\#\$\%\&\*\^\(\)\_\+\=\<\>\?\{\}\[\]\~\-\Ê]+$/))return"Supports only 128 characters of ASCII."},i.prototype.getCodeValue=function(){return[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},i.prototype.getBytes=function(t){for(var e=[],r=0;r<t.length;r++)e.push(t[parseInt(r.toString(),10)].charCodeAt(0));return e},i.prototype.appendStartStopCharacters=function(t){var e;return"Code128A"===this.type?e=String.fromCharCode(208):"Code128B"===this.type?e=String.fromCharCode(209):"Code128C"===this.type&&(e=String.fromCharCode(210)),e+t},i.prototype.check128C=function(t){return t.match(new RegExp("^(Ï*[0-9]{2}Ï*)*"))[0]},i.prototype.check128A=function(t){return t.match(new RegExp("^[\0-_È-Ï]*"))[0]},i.prototype.check128B=function(t){return t.match(new RegExp("^[ -È-Ï]*"))[0]},i.prototype.clipAB=function(t,e){var e=e?"[\0-_È-Ï]":"[ -È-Ï]",r=t.match(new RegExp("^("+e+"+?)(([0-9]{2}){2,})([^0-9]|$)"));return r?r[1]+String.fromCharCode(204)+this.clipC(t.substring(r[1].length)):(t.match(new RegExp("^"+e+"+"))[0].length,t.length,t)},i.prototype.code128Clip=function(){var t;return 2<=this.check128C(this.value).length?String.fromCharCode(210)+this.clipC(this.value):((t=this.check128A(this.value)>this.check128B(this.value))?String.fromCharCode(208):String.fromCharCode(209))+this.clipAB(this.value,t)},i.prototype.clipC=function(t){var e=this.check128C(t),r=e.length;if(r===t.length)return t;t=t.substring(r);r=this.check128A(t)>=this.check128B(t);return e+String.fromCharCode(r?206:205)+this.clipAB(t,r)},i.prototype.draw=function(t){this.code128(t)},i.prototype.code128=function(t){var e=this.value,e="Code128"!==this.type?this.appendStartStopCharacters(e):this.code128Clip(),e=this.getBytes(e),r=e.shift()-105,i=103==r?"0":104==r?"1":"2",e=this.encodeData(e,1,i),i=this.encode(r,e),r=[];r.push(i),this.calculateBarCodeAttributes(r,t)},i.prototype.encodeData=function(t,e,r){var i,a,o;return t.length?(200<=t[0]?(a=t.shift()-105,void 0!==(o=this.swap(a))&&(i=this.encodeData(t,e+1,o))):(a=this.correctIndex(t,r),i=this.encodeData(t,e+1,r)),{result:this.getCodes(a)+i.result,checksum:a*e+i.checksum}):{result:"",checksum:0}},i.prototype.swap=function(t){return 99===t?"2":100===t?"1":"0"},i.prototype.encode=function(t,e){var r=this.getCodes(t)+e.result;return this.enableCheckSum&&(r+=this.getCodes((e.checksum+t)%103)),r+=this.getCodes(106)},i.prototype.correctIndex=function(t,e){var r;return"0"===e?(r=t.shift())<32?r+64:r-32:"1"===e?t.shift()-32:10*(t.shift()-48)+t.shift()-48},i.prototype.getCodes=function(t){var e=this.getCodeValue();return e[parseInt(t.toString(),10)]?e[parseInt(t.toString(),10)].toString():""};var Z,J,K=i;function i(){return null!==J&&J.apply(this,arguments)||this}Y=function(t,e){return(Y=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}Y(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(et,q=K),et.prototype.validateInput=function(t){if(!new RegExp("^[ -È-Ï]+$").test(t))return"Supports only ASCII characters 32 to 127 (0–9, A–Z, a–z), and special characters."},et.prototype.draw=function(t){this.code128(t)};var Y,q,tt=et;function et(){return null!==q&&q.apply(this,arguments)||this}rt=function(t,e){return(rt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}rt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(ot,it=K),ot.prototype.validateInput=function(t){if(!new RegExp("^(Ï*[0-9]{2}Ï*)+$").test(t))return"Supports even number of numeric characters (00-99)."},ot.prototype.draw=function(t){this.code128(t)};var rt,it,at=ot;function ot(){return null!==it&&it.apply(this,arguments)||this}st=function(t,e){return(st=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};var st,nt,n=function(t,e){function r(){this.constructor=t}st(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},c=function(t,e,r,i){var a,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var n=t.length-1;0<=n;n--)(a=t[n])&&(s=(o<3?a(s):3<o?a(e,r,s):a(e,r))||s);return 3<o&&s&&Object.defineProperty(e,r,s),s},n=(nt=a.ChildProperty,n(h,nt),c([a.Property(10)],h.prototype,"left",void 0),c([a.Property(10)],h.prototype,"right",void 0),c([a.Property(10)],h.prototype,"top",void 0),c([a.Property(10)],h.prototype,"bottom",void 0),h);function h(){return null!==nt&&nt.apply(this,arguments)||this}ct=function(t,e){return(ct=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};var ct,ht,c=function(t,e){function r(){this.constructor=t}ct(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},l=function(t,e,r,i){var a,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var n=t.length-1;0<=n;n--)(a=t[n])&&(s=(o<3?a(s):3<o?a(e,r,s):a(e,r))||s);return 3<o&&s&&Object.defineProperty(e,r,s),s},c=(ht=a.ChildProperty,c(u,ht),l([a.Property("")],u.prototype,"text",void 0),l([a.Property(!0)],u.prototype,"visibility",void 0),l([a.Property("monospace")],u.prototype,"font",void 0),l([a.Property(20)],u.prototype,"size",void 0),l([a.Complex({left:0,right:0,top:0,bottom:0},n)],u.prototype,"margin",void 0),l([a.Property("Center")],u.prototype,"alignment",void 0),l([a.Property("Bottom")],u.prototype,"position",void 0),u);function u(){return null!==ht&&ht.apply(this,arguments)||this}lt=function(t,e){return(lt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}lt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(p,ut=e),p.prototype.getCodeValue=function(){return["111221211","211211112","112211112","212211111","111221112","211221111","112221111","111211212","211211211","112211211","211112112","112112112","212112111","111122112","211122111","112122111","111112212","211112211","112112211","111122211","211111122","112111122","212111121","111121122","211121121","112121121","111111222","211111221","112111221","111121221","221111112","122111112","222111111","121121112","221121111","122121111","121111212","221111211","122111211","121121211","121212111","121211121","121112121","111212121"]},p.prototype.getCharacter=function(){return"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%"},p.prototype.checkSum=function(t,e){for(var r=0,i=0;i<t.length;i++)r+=e.indexOf(t[parseInt(i.toString(),10)]);return r%=43},p.prototype.validateInput=function(t){if(-1===t.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/))return"Supports A-Z, 0-9, and symbols ( - . $ / + % SPACE)."},p.prototype.getPatternCollection=function(t,e){for(var r,i=[],a=this.getCodeValue(),o=0;o<t.length;o++)r=e.indexOf(t.charAt(o)),i.push(a[parseInt(r.toString(),10)]);return i},p.prototype.appendStartStopCharacters=function(t){return"*"+t+"*"},p.prototype.drawCode39Extension=function(t,e){this.draw(t,e)},p.prototype.draw=function(t,e){var e=e||this.value,r=this.getCharacter(),e=(this.enableCheckSum&&(e+=this.checkSum(e,r)),e=this.appendStartStopCharacters(e),this.getPatternCollection(e,r));this.calculateBarCodeAttributes(e,t)};var lt,ut,pt=p;function p(){return null!==ut&&ut.apply(this,arguments)||this}dt=function(t,e){return(dt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}dt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(d,mt=e),d.prototype.validateInput=function(t){if(-1===t.search(/^[0-9A-D\-\.\$\/\+\%\:]+$/))return"Supports 0-9, A-D and symbols (-,$, /, ., +)."},d.prototype.getCodeValue=function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"101100110011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}},d.prototype.appendStartStopCharacters=function(t){return"A"+t+"A"},d.prototype.getPatternCollection=function(t,e){for(var r=[],i=0;i<t.length;i++){var a=t[parseInt(i.toString(),10)];r.push(e[""+a])}return r},d.prototype.draw=function(t){var e=this.getCodeValue(),r=this.value,r=this.appendStartStopCharacters(r),r=this.getPatternCollection(r,e);this.calculateBarCodeAttributes(r,t)};var dt,mt,gt=d;function d(){return null!==mt&&mt.apply(this,arguments)||this}bt=function(t,e){return(bt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}bt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(vt,yt=K),vt.prototype.validateInput=function(t){if(!new RegExp("^[\0-_È-Ï]+$").test(t))return"Supports only ASCII characters 00 to 95 (0–9, A–Z and control codes) and special characters."},vt.prototype.draw=function(t){this.code128(t)};var bt,yt,ft=vt;function vt(){return null!==yt&&yt.apply(this,arguments)||this}kt=function(t,e){return(kt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}kt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(m,St=e),m.prototype.validateInput=function(t){if(-1===t.search(/^[0-9]{8}$/)||Number(t[7])!==this.checkSumData(t))return"Accepts 8 numeric characters."},m.prototype.getCodeValueRight=function(t){t=t?{0:"0001101",1:"0011001",2:"0010011",3:"0111101",4:"0100011",5:"0110001",6:"0101111",7:"0111011",8:"0110111",9:"0001011"}:{0:"1110010",1:"1100110",2:"1101100",3:"1000010",4:"1011100",5:"1001110",6:"1010000",7:"1000100",8:"1001000",9:"1110100"};return t},m.prototype.checkSumData=function(t){for(var e=0;e<t.length;e++){var r=10-(Number(t[1])+Number(t[3])+Number(t[5])+3*(Number(t[0])+Number(t[2])+Number(t[4])+Number(t[6])))%10;return 0===r?0:r}return 0},m.prototype.draw=function(t){var e=this.getCodeValueRight(!0),r=[];r.push("101"),r.push(this.leftValue(e,!0)),r.push("01010"),e=this.getCodeValueRight(!1),r.push(this.leftValue(e,!1)),r.push("101"),this.calculateBarCodeAttributes(r,t)},m.prototype.leftValue=function(t,e){for(var r,i=e?0:this.value.length-4;i<(e?this.value.length-4:this.value.length);i++)0===i||4===i?r=t[this.value[parseInt(i.toString(),10)]]:r+=t[this.value[parseInt(i.toString(),10)]];return r};var kt,St,Ct=m;function m(){return null!==St&&St.apply(this,arguments)||this}wt=function(t,e){return(wt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}wt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(g,It=e),g.prototype.validateInput=function(t){var e=this.checksumValue(t);if(-1===t.search(/^[0-9]{13}$/)||Number(t[12])!==this.checkSumData(t)&&Number(t[12])!==e){if(-1===t.search(/^[0-9]{12}$/))return"Accepts 12 numeric characters.";t+=this.checkSumData(t),this.value=t}},g.prototype.checksumValue=function(t){return(10-t.substr(0,12).split("").map(function(t){return+t}).reduce(function(t,e,r){return r%2?t+3*e:t+e},0)%10)%10},g.prototype.checkSumData=function(t){t=3*(Number(t[11])+Number(t[9])+Number(t[7])+Number(t[5])+Number(t[3])+Number(t[1]))+(Number(t[10])+Number(t[8])+Number(t[6])+Number(t[4])+Number(t[2])+Number(t[0]));return 10*Math.round(t/10)-t},g.prototype.getStructure=function(){return{0:"LLLLLL",1:"LLGLGG",2:"LLGGLG",3:"LLGGGL",4:"LGLLGG",5:"LGGLLG",6:"LGGGLL",7:"LGLGLG",8:"LGLGGL",9:"LGGLGL"}},g.prototype.getBinaries=function(){return{L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]}},g.prototype.draw=function(t){var e=[],r=this.getStructure()[this.value[0]],i=(e.push("101"),this.value.substr(1,6));e.push(this.leftValue(!0,r,i)),e.push("01010"),i=this.value.substr(7,6),e.push(this.leftValue(!1,"RRRRRR",i)),e.push("101"),this.calculateBarCodeAttributes(e,t)},g.prototype.leftValue=function(t,e,r){for(var i,a,o=this.getBinaries(),s=0;s<r.length;s++)a=o[e[parseInt(s.toString(),10)]],0===s?i=a[r[parseInt(s.toString(),10)]]:i+=a[r[parseInt(s.toString(),10)]];return i};var wt,It,xt=g;function g(){return null!==It&&It.apply(this,arguments)||this}Vt=function(t,e){return(Vt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}Vt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(b,Et=e),b.prototype.validateInput=function(t){if(-1===t.search(/^[0-9]{6}$/))return"Accepts 6 numeric characters."},b.prototype.checkSum=function(t){for(var e=0,r=1;r<11;r+=2)e+=parseInt(t[r],void 0);for(r=0;r<11;r+=2)e+=3*parseInt(t[r],void 0);return(10-e%10)%10},b.prototype.getStructure=function(){return{0:"EEEOOO",1:"EEOEOO",2:"EEOOEO",3:"EEOOOE",4:"EOEEOO",5:"EOOEEO",6:"EOOOEE",7:"EOEOEO",8:"EOEOOE",9:"EOOEOE"}},b.prototype.getValue=function(){return["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"]},b.prototype.getExpansion=function(t){return this.getValue()[""+t]},b.prototype.getUpcValue=function(){for(var t=this.value[this.value.length-1],e=this.getExpansion(t),r="",i=0,a=0;a<e.length;a++){var o=e[parseInt(a.toString(),10)];r+="X"===o?this.value[i++]:o}t=""+(r="0"+r);return this.enableCheckSum&&(t+=this.checkSum(r)),t},b.prototype.getBinaries=function(){return{O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]}},b.prototype.encoding=function(t,e,r){for(var i,a,o=this.getBinaries(),s=0;s<e.length;s++)a=o[r[parseInt(s.toString(),10)]],0===s?i=a[e[parseInt(s.toString(),10)]]:i+=a[e[parseInt(s.toString(),10)]];return i},b.prototype.draw=function(t){var e="00000000",r=[],i=this.getUpcValue(),a=this.getStructure()[i[i.length-1]],a=(r.push(e),r.push("101"),r.push(this.encoding(i,this.value,a)),r.push("010101"),r.push(e),i[0]+this.value+i[i.length-1]);this.calculateBarCodeAttributes(r,t,""===this.displayText.text?a:void 0)};var Vt,Et,At=b;function b(){return null!==Et&&Et.apply(this,arguments)||this}Mt=function(t,e){return(Mt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}Mt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(y,Dt=e),y.prototype.validateInput=function(t){if(-1!==t.search(/^[0-9]{11}$/)&&this.enableCheckSum&&(this.value+=this.checkSumData(this.value)),-1===this.value.search(/^[0-9]{12}$/)||Number(this.value[11])!==this.checkSumData(this.value))return"Accepts 11 numeric characters."},y.prototype.checkSumData=function(t){return(10-(3*(Number(t[0])+Number(t[2])+Number(t[4])+Number(t[6])+Number(t[8])+Number(t[10]))+(Number(t[9])+Number(t[7])+Number(t[5])+Number(t[3])+Number(t[1])))%10)%10},y.prototype.getBinaries=function(){return{L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"]}},y.prototype.draw=function(t){var e="00000000",r=[];r.push(e),r.push("101"+this.leftValue(!0,"L",this.value[0])),r.push(this.leftValue(!0,"LLLLL",this.value.substr(1,5))),r.push("01010"),r.push(this.leftValue(!0,"RRRRR",this.value.substr(6,5))),r.push(this.leftValue(!0,"R",this.value[11])+"101"),r.push(e),this.calculateBarCodeAttributes(r,t)},y.prototype.leftValue=function(t,e,r){for(var i,a,o=this.getBinaries(),s=0;s<r.length;s++)a=o[e[parseInt(s.toString(),10)]],0===s?i=a[r[parseInt(s.toString(),10)]]:i+=a[r[parseInt(s.toString(),10)]];return i};var Mt,Dt,Bt=y;function y(){return null!==Dt&&Dt.apply(this,arguments)||this}Ot=function(t,e){return(Ot=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}Ot(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(f,Pt=e),f.prototype.validateInput=function(t){if(-1===t.search(/^[0-9\-\*]+$/))return"This bar code support 0-9 , * , -"},f.prototype.getCodeValue=function(){return{0:"111121",1:"211121",2:"121121",3:"221111",4:"112121",5:"212111",6:"122111",7:"111221",8:"211211",9:"211111","-":"112111","*":"112211"}},f.prototype.getPatternCollection=function(t){for(var e=[],r=this.getCodeValue(),i=0;i<t.length;i++)e.push(r[t[parseInt(i.toString(),10)]]);return e},f.prototype.draw=function(t){var e="*"+this.value+"*",e=this.getPatternCollection(e);this.calculateBarCodeAttributes(e,t)};var Ot,Pt,Lt=f;function f(){return null!==Pt&&Pt.apply(this,arguments)||this}Nt=function(t,e){return(Nt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}Nt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(v,_t=e),v.prototype.validateInput=function(t){if(-1===t.search(/^[0-9A-Z\-\.\*\$\/\+\ %\ ]+$/))return"Supports A-Z, 0-9, and symbols ( - . $ / + % SPACE)."},v.prototype.getCharacterWeight=function(){return{0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",A:"10",B:"11",C:"12",D:"13",E:"14",F:"15",G:"16",H:"17",I:"18",J:"19",K:"20",L:"21",M:"22",N:"23",O:"24",P:"25",Q:"26",R:"27",S:"28",T:"29",U:"30",V:"31",W:"32",X:"33",Y:"34",Z:"35","-":"36",".":"37"," ":"38",$:"39","/":"40","+":"41","%":"42","($)":"43","(/)":"44","(+)":"45","(%)":"46"}},v.prototype.getCodeValue=function(){return{0:"100010100",1:"101001000",2:"101000100",3:"101000010",4:"100101000",5:"100100100",6:"100100010",7:"101010000",8:"100010010",9:"100001010",A:"110101000",B:"110100100",C:"110100010",D:"110010100",E:"110010010",F:"110001010",G:"101101000",H:"101100100",I:"101100010",J:"100110100",K:"100011010",L:"101011000",M:"101001100",N:"101000110",O:"100101100",P:"100010110",Q:"110110100",R:"110110010",S:"110101100",T:"110100110",U:"110010110",V:"110011010",W:"101101100",X:"101100110",Y:"100110110",Z:"100111010","-":"100101110",".":"111010100"," ":"111010010",$:"111001010","/":"101101110","+":"101110110","%":"110101110","($)":"100100110","(/)":"111010110","(+)":"100110010","(%)":"111011010"}},v.prototype.getPatternCollection=function(t,e,r){for(var i=r,a=0;a<t.length;a++){var o=t[parseInt(a.toString(),10)];i.push(e[""+o])}},v.prototype.calculateCheckSum=function(t){for(var e=t,r=0,i=0,a=this.getCharacterWeight(),o=e.length;0<o;o--)r+=a[e[parseInt(i.toString(),10)]]*o,i++;t=r%47;return Object.keys(a)[parseInt(t.toString(),10)]},v.prototype.draw=function(t){var e=this.getCodeValue(),r=[],i=this.value,a="101011110";this.enableCheckSum&&(i=(i+=this.calculateCheckSum(i))+this.calculateCheckSum(i)),r.push(a),this.getPatternCollection(i,e,r),r.push(a),r.push("1"),this.calculateBarCodeAttributes(r,t)};var Nt,_t,Rt=v;function v(){return null!==_t&&_t.apply(this,arguments)||this}Tt=function(t,e){return(Tt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}Tt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(k,zt=Rt),k.prototype.validateInput=function(t){t=this.getValue(t);if(!t)return"Supports 128 characters of ASCII."},k.prototype.getValue=function(t){for(var e=0;e<t.length;e++)if(127<t.charCodeAt(e))return!1;return!0},k.prototype.getBars=function(){this.barcodeSymbols[0]={value:"",checkDigit:0,bars:"111213"},this.barcodeSymbols[1]={value:"1",checkDigit:1,bars:"111213"},this.barcodeSymbols[2]={value:"2",checkDigit:2,bars:"111312 "},this.barcodeSymbols[3]={value:"3",checkDigit:3,bars:"111411 "},this.barcodeSymbols[4]={value:"4",checkDigit:4,bars:"121113"},this.barcodeSymbols[5]={value:"5",checkDigit:5,bars:"121212"},this.barcodeSymbols[6]={value:"6",checkDigit:6,bars:"121311"},this.barcodeSymbols[7]={value:"7",checkDigit:7,bars:"111114"},this.barcodeSymbols[8]={value:"8",checkDigit:8,bars:"131211"},this.barcodeSymbols[9]={value:"9",checkDigit:9,bars:"141111"},this.barcodeSymbols[10]={value:"A",checkDigit:10,bars:"211113"},this.barcodeSymbols[11]={value:"B",checkDigit:11,bars:"211212"},this.barcodeSymbols[12]={value:"C",checkDigit:12,bars:"211311"},this.barcodeSymbols[13]={value:"D",checkDigit:13,bars:"221112"},this.barcodeSymbols[14]={value:"E",checkDigit:14,bars:"221211 "},this.barcodeSymbols[15]={value:"F",checkDigit:15,bars:"231111"},this.barcodeSymbols[16]={value:"G",checkDigit:16,bars:"112113"},this.barcodeSymbols[17]={value:"H",checkDigit:17,bars:"112212"},this.barcodeSymbols[18]={value:"I",checkDigit:18,bars:"112311"},this.barcodeSymbols[19]={value:"J",checkDigit:19,bars:"122112"},this.barcodeSymbols[20]={value:"K",checkDigit:20,bars:"132111 "},this.barcodeSymbols[21]={value:"L",checkDigit:21,bars:"111123"},this.barcodeSymbols[22]={value:"M",checkDigit:22,bars:"111222"},this.barcodeSymbols[23]={value:"N",checkDigit:23,bars:"111321"},this.barcodeSymbols[24]={value:"O",checkDigit:24,bars:"121122 "},this.barcodeSymbols[25]={value:"P",checkDigit:25,bars:"131121 "},this.barcodeSymbols[26]={value:"Q",checkDigit:26,bars:"212112 "},this.barcodeSymbols[27]={value:"R",checkDigit:27,bars:" 212211 "},this.barcodeSymbols[28]={value:"S",checkDigit:28,bars:"211122"},this.barcodeSymbols[29]={value:"T",checkDigit:29,bars:"211221"},this.barcodeSymbols[30]={value:"U",checkDigit:30,bars:"221121"},this.barcodeSymbols[31]={value:"V",checkDigit:31,bars:"222111"},this.barcodeSymbols[32]={value:"W",checkDigit:32,bars:"112122"},this.barcodeSymbols[33]={value:"X",checkDigit:33,bars:"112221"},this.barcodeSymbols[34]={value:"Y",checkDigit:34,bars:"122121"},this.barcodeSymbols[35]={value:"Z",checkDigit:35,bars:" 123111"},this.barcodeSymbols[36]={value:"-",checkDigit:36,bars:"121131"},this.barcodeSymbols[37]={value:".",checkDigit:37,bars:"311112"},this.barcodeSymbols[38]={value:" ",checkDigit:38,bars:"311211"},this.barcodeSymbols[39]={value:"$",checkDigit:39,bars:"321111"},this.barcodeSymbols[40]={value:"/",checkDigit:40,bars:"112131"},this.barcodeSymbols[41]={value:"+",checkDigit:41,bars:"113121"},this.barcodeSymbols[42]={value:"%",checkDigit:42,bars:"211131"},this.barcodeSymbols[43]={value:"*",checkDigit:42,bars:"111141"},this.barcodeSymbols[44]={value:"ÿ",checkDigit:47,bars:"1111411"},this.barcodeSymbols[45]={value:"û",checkDigit:43,bars:"121220"},this.barcodeSymbols[46]={value:"ü",checkDigit:44,bars:"312111 "},this.barcodeSymbols[47]={value:"ý",checkDigit:45,bars:"311121"},this.barcodeSymbols[48]={value:"þ",checkDigit:46,bars:"122211"}},k.prototype.GetExtendedText=function(t){var e,r=this.value;this.extendedText="";for(var i=0;i<r.length;i++){for(var a=t.length-1;0<a;a--)if(t[parseInt(a.toString(),10)]&&t[parseInt(a.toString(),10)].value&&t[parseInt(a.toString(),10)].character===r[parseInt(i.toString(),10)]){e=t[parseInt(a.toString(),10)];break}e.keyword&&e.value?this.extendedText+=e.keyword+e.value:e.value&&e.value&&(this.extendedText+=e.value)}},k.prototype.drawCode93=function(t){this.getBars();for(var e=[],r=this.getArrayValue(),i=(this.GetExtendedText(r),this.CalculateCheckDigit()),a=0;a<i.length;a++)this.extendedText+=i[parseInt(a.toString(),10)];e[0]="*"+this.extendedText+"ÿ";r=this.encoding(e);this.calculateBarCodeAttributes(r,t)},k.prototype.GetCheckSumSymbols=function(){for(var t,e=this.extendedText,r=[],i=0,a=e.length,o=0;o<a;o++){0===(l=(a-o)%20)&&(l=20);for(var s=0;s<this.barcodeSymbols.length;s++)e[parseInt(o.toString(),10)]===this.barcodeSymbols[parseInt(s.toString(),10)].value&&(t=this.barcodeSymbols[parseInt(s.toString(),10)].checkDigit);i+=t*l}i%=47;for(var n="",c=0;c<this.barcodeSymbols.length;c++)if(i===this.barcodeSymbols[parseInt(c.toString(),10)].checkDigit){n=this.barcodeSymbols[parseInt(c.toString(),10)].value;break}var h=this.extendedText;h+=n,r[0]=n;for(var l,i=0,a=(e=h).length,o=0;o<a;o++){0===(l=(a-o)%15)&&(l=15);for(var u=0;u<this.barcodeSymbols.length;u++)e[parseInt(o.toString(),10)]===this.barcodeSymbols[parseInt(u.toString(),10)].value&&(i+=this.barcodeSymbols[parseInt(u.toString(),10)].checkDigit*l)}i%=47;for(var p=" ",o=0;o<this.barcodeSymbols.length;o++)if(i===this.barcodeSymbols[parseInt(o.toString(),10)].checkDigit){p=this.barcodeSymbols[parseInt(o.toString(),10)].value;break}return h+=p,r[1]=p,r},k.prototype.CalculateCheckDigit=function(){for(var t=this.extendedText,e=0;e<t.length;e++)for(var r=0;r<this.barcodeSymbols.length;r++)t[parseInt(e.toString(),10)]===this.barcodeSymbols[parseInt(r.toString(),10)].value&&this.barcodeSymbols[r].checkDigit;return this.GetCheckSumSymbols()},k.prototype.getArrayValue=function(){var t=[];return t[0]={character:"\0",keyword:"ü",value:"U"},t[1]={character:"\x0001",keyword:"û",value:"A"},t[2]={character:"\x0002",keyword:"x00fb",value:"B"},t[3]={character:"\x0003",keyword:"û",value:"C"},t[4]={character:"\x0004",keyword:"û",value:"D"},t[5]={character:"\x0005",keyword:"û",value:"E"},t[6]={character:"\x0006",keyword:"û",value:"F"},t[7]={character:"a",keyword:"û",value:"G"},t[8]={character:"\b",keyword:"û",value:"H"},t[9]={character:"\t",keyword:"û",value:"I"},t[10]={character:"\n",keyword:"û",value:"J"},t[12]={character:"\v",keyword:"û",value:"K"},t[13]={character:"\f",keyword:"û",value:"L"},t[14]={character:"\r",keyword:"û",value:"M"},t[15]={character:"\x000e",keyword:"û",value:"N"},t[16]={character:"\x000f",keyword:"û",value:"O"},t[17]={character:"\x0010",keyword:"û",value:"P"},t[18]={character:"\x0011",keyword:"û",value:"Q"},t[19]={character:"\x0012",keyword:"û",value:"R"},t[20]={character:"\x0013",keyword:"û",value:"S"},t[21]={character:"\x0014",keyword:"û",value:"T"},t[22]={character:"\x0015",keyword:"û",value:"U"},t[23]={character:"\x0016",keyword:"û",value:"V"},t[24]={character:"\x0017",keyword:"û",value:"W"},t[25]={character:"\x0018",keyword:"û",value:"X"},t[26]={character:"\x0019",keyword:"û",value:"Y"},t[27]={character:"\x001a",keyword:"û",value:"Z"},t[28]={character:"\x001b",keyword:"ü",value:"A"},t[29]={character:"\x001c",keyword:"ü",value:"B"},t[30]={character:"\x001d",keyword:"ü",value:"C"},t[31]={character:"\x001e",keyword:"ü",value:"D"},t[32]={character:"\x001f",keyword:"ü",value:"E"},t[33]={character:" ",keyword:" "},t[34]={character:"!",keyword:"ý",value:"A"},t[35]={character:'"',keyword:"ý",value:"B"},t[36]={character:"#",keyword:"ý",value:"C"},t[37]={character:"$",keyword:"ý",value:"D"},t[38]={character:"%",keyword:"ý",value:"E"},t[39]={character:"&",keyword:"ý",value:"F"},t[40]={character:"'",keyword:"ý",value:"G"},t[41]={character:"(",keyword:"ý",value:"H"},t[42]={character:")",keyword:"ý",value:"I"},t[43]={character:"*",keyword:"ý",value:"J"},t[44]={character:"+",keyword:"ý",value:"K"},t[45]={character:",",keyword:"ý",value:"L"},t[46]={character:"-",keyword:"ý",value:"M"},t[47]={character:".",keyword:"ý",value:"N"},t[48]={character:"/",keyword:"ý",value:"O"},t[49]={character:"0",value:"0"},t[50]={character:"1",value:"1"},t[51]={character:"2",value:"2"},t[52]={character:"3",value:"3"},t[53]={character:"4",value:"4"},t[54]={character:"5",value:"5"},t[55]={character:"6",value:"6"},t[56]={character:"7",value:"7"},t[57]={character:"8",value:"8"},t[58]={character:"9",value:"9"},t[59]={character:":",keyword:"ý",value:"Z"},t[60]={character:";",keyword:"ü",value:"F"},t[61]={character:"<",keyword:"ü",value:"G"},t[62]={character:"=",keyword:"ü",value:"H"},t[63]={character:">",keyword:"ü",value:"I"},t[64]={character:"?",keyword:"ü",value:"J"},t[65]={character:"@",keyword:"ü",value:"V"},t[66]={character:"A",value:"A"},t[67]={character:"B",value:"B"},t[68]={character:"C",value:"C"},t[69]={character:"D",value:"D"},t[70]={character:"E",value:"E"},t[71]={character:"F",value:"F"},t[72]={character:"G",value:"G"},t[73]={character:"H",value:"H"},t[74]={character:"I",value:"I"},t[75]={character:"J",value:"J"},t[76]={character:"K",value:"K"},t[77]={character:"L",value:"L"},t[78]={character:"M",value:"M"},t[79]={character:"N",value:"N"},t[80]={character:"O",value:"O"},t[81]={character:"P",value:"P"},t[82]={character:"Q",value:"Q"},t[83]={character:"R",value:"R"},t[84]={character:"S",value:"S"},t[85]={character:"T",value:"T"},t[86]={character:"U",value:"U"},t[87]={character:"V",value:"V"},t[88]={character:"W",value:"W"},t[88]={character:"X",value:"X"},t[89]={character:"Y",value:"Y"},t[90]={character:"Z",value:"Z"},t[91]={character:"[",keyword:"ü",value:"K"},t[92]={character:"\\",keyword:"ü",value:"L"},t[93]={character:"]",keyword:"ü",value:"M"},t[94]={character:"^",keyword:"ü",value:"N"},t[95]={character:"_",keyword:"ü",value:"O"},t[96]={character:"`",keyword:"ü",value:"W"},t[97]={character:"a",keyword:"þ",value:"A"},t[98]={character:"b",keyword:"þ",value:"B"},t[99]={character:"c",keyword:"þ",value:"C"},t[100]={character:"d",keyword:"þ",value:"D"},t[101]={character:"e",keyword:"þ",value:"E"},t[102]={character:"f",keyword:"þ",value:"F"},t[103]={character:"g",keyword:"þ",value:"G"},t[104]={character:"h",keyword:"þ",value:"H"},t[105]={character:"i",keyword:"þ",value:"I"},t[106]={character:"j",keyword:"þ",value:"J"},t[107]={character:"k",keyword:"þ",value:"K"},t[108]={character:"l",keyword:"þ",value:"L"},t[109]={character:"m",keyword:"þ",value:"M"},t[110]={character:"n",keyword:"þ",value:"N"},t[111]={character:"o",keyword:"þ",value:"O"},t[112]={character:"p",keyword:"þ",value:"P"},t[113]={character:"q",keyword:"þ",value:"Q"},t[114]={character:"r",keyword:"þ",value:"R"},t[115]={character:"s",keyword:"þ",value:"S"},t[116]={character:"t",keyword:"þ",value:"T"},t[117]={character:"u",keyword:"þ",value:"U"},t[118]={character:"v",keyword:"þ",value:"V"},t[119]={character:"w",keyword:"þ",value:"W"},t[120]={character:"x",keyword:"þ",value:"X"},t[121]={character:"y",keyword:"þ",value:"Y"},t[122]={character:"z",keyword:"þ",value:"Z"},t[123]={character:"{",keyword:"ü",value:"P"},t[124]={character:"|",keyword:"ü",value:"Q"},t[125]={character:"}",keyword:"ü",value:"R"},t[126]={character:"~",keyword:"ü",value:"S"},t},k.prototype.encoding=function(t){for(var e=[],r=0;r<t.length;r++)for(var i=0;i<t[parseInt(r.toString(),10)].length;i++)for(var a=0;a<this.barcodeSymbols.length;a++)t[parseInt(r.toString(),10)][parseInt(i.toString(),10)]===this.barcodeSymbols[parseInt(a.toString(),10)].value&&(e[parseInt(i.toString(),10)]=this.barcodeSymbols[parseInt(a.toString(),10)].bars);return e};var Tt,zt,jt=k;function k(){var t=null!==zt&&zt.apply(this,arguments)||this;return t.barcodeSymbols=[],t}Qt=function(t,e){return(Qt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}))(t,e)};(function(t,e){function r(){this.constructor=t}Qt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(S,Ft=e),S.prototype.validateInput=function(t){if(8!==t.length||!t.match(/^[0-9]+$/))ret