当前位置: 移动技术网 > IT编程>开发语言>JavaScript > js生成条形码

js生成条形码

2019年11月23日  | 移动技术网IT编程  | 我要评论

生成条形码

<body>
	<div>
		<img id="ma"/>
	</div>
</body>
</html>
<script src="jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/jsbarcode/3.8.0/jsbarcode.all.min.js"></script>    
<script>
$(function(){
    $("#ma").jsbarcode("12345678", {
        width:2,// 设置条之间的宽度
        height:50,// 高度
       // displayvalue:true, // 是否在条形码上下方显示文字
       // fontoptions:"bold italic", // 使文字加粗体或变斜体
       // font:"fantasy", // 设置文本的字体
       // textalign:"left", // 设置文本的水平对齐方式
       // textposition:"top", // 设置文本的垂直位置
       // textmargin:5, // 设置条形码和文本之间的间距
       // fontsize:15, // 设置文本的大小
       // background:"#eee", // 设置条形码的背景
       // linecolor:"#2196f3", // 设置条和文本的颜色。
       // margin:15 // 设置条形码周围的空白边距
   });
});
</script>

  附:jsbarcode.js

/*! jsbarcode v3.8.0 | (c) johan lindell | mit license */
!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||object.defineproperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esmodule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return object.prototype.hasownproperty.call(t,e)},e.p="",e(e.s=17)}([function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}object.defineproperty(e,"__esmodule",{value:!0});var o=function t(e,n){r(this,t),this.data=e,this.text=n.text||e,this.options=n};e.default=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}object.defineproperty(e,"__esmodule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(){r(this,t),this.startbin="101",this.endbin="101",this.middlebin="01010",this.binaries={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"]}}return o(t,[{key:"encode",value:function(t,e,n){var r="";n=n||"";for(var o=0;o<t.length;o++){var i=this.binaries[e[o]];i&&(r+=i[t[o]]),o<t.length-1&&(r+=n)}return r}}]),t}();e.default=i},function(t,e,n){"use strict";function r(t,e,n){return e in t?object.defineproperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}object.defineproperty(e,"__esmodule",{value:!0});var o,i=e.set_a=0,a=e.set_b=1,u=e.set_c=2,s=(e.shift=98,e.start_a=103),f=e.start_b=104,c=e.start_c=105;e.modulo=103,e.stop=106,e.set_by_code=(o={},r(o,s,i),r(o,f,a),r(o,c,u),o),e.swap={101:i,100:a,99:u},e.a_start_char=string.fromcharcode(208),e.b_start_char=string.fromcharcode(209),e.c_start_char=string.fromcharcode(210),e.a_chars="[\0-_è-ï]",e.b_chars="[ -è-ï]",e.c_chars="(ï*[0-9]{2}ï*)",e.bars=[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]},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}function a(t,e){for(var n=0;n<e;n++)t="0"+t;return t}object.defineproperty(e,"__esmodule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(0),f=function(t){return t&&t.__esmodule?t:{default:t}}(s),c=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n))}return i(e,t),u(e,[{key:"encode",value:function(){for(var t="110",e=0;e<this.data.length;e++){var n=parseint(this.data[e]),r=n.tostring(2);r=a(r,4-r.length);for(var o=0;o<r.length;o++)t+="0"==r[o]?"100":"110"}return t+="1001",{data:t,text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),e}(f.default);e.default=c},function(t,e,n){"use strict";object.defineproperty(e,"__esmodule",{value:!0});var r=object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)object.prototype.hasownproperty.call(n,r)&&(t[r]=n[r])}return t};e.default=function(t,e){return r({},t,e)}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(0),s=function(t){return t&&t.__esmodule?t:{default:t}}(u),f=n(2),c=function(t){function e(t,n){r(this,e);var i=o(this,(e.__proto__||object.getprototypeof(e)).call(this,t.substring(1),n));return i.bytes=t.split("").map(function(t){return t.charcodeat(0)}),i}return i(e,t),a(e,[{key:"valid",value:function(){return/^[\x00-\x7f\xc8-\xd3]+$/.test(this.data)}},{key:"encode",value:function(){var t=this.bytes,n=t.shift()-105,r=f.set_by_code[n];if(void 0===r)throw new rangeerror("the encoding does not start with a start character.");var o=e.next(t,1,r);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7e]/g,""):this.text,data:e.getbar(n)+o.result+e.getbar((o.checksum+n)%f.modulo)+e.getbar(f.stop)}}}],[{key:"getbar",value:function(t){return f.bars[t]?f.bars[t].tostring():""}},{key:"correctindex",value:function(t,e){if(e===f.set_a){var n=t.shift();return n<32?n+64:n-32}return e===f.set_b?t.shift()-32:10*(t.shift()-48)+t.shift()-48}},{key:"next",value:function(t,n,r){if(!t.length)return{result:"",checksum:0};var o=void 0,i=void 0;if(t[0]>=200){i=t.shift()-105;var a=f.swap[i];void 0!==a?o=e.next(t,n+1,a):(r!==f.set_a&&r!==f.set_b||i!==f.shift||(t[0]=r===f.set_a?t[0]>95?t[0]-96:t[0]:t[0]<32?t[0]+96:t[0]),o=e.next(t,n+1,r))}else i=e.correctindex(t,r),o=e.next(t,n+1,r);var u=e.getbar(i),s=i*n;return{result:u+o.result,checksum:s+o.checksum}}}]),e}(s.default);e.default=c},function(t,e,n){"use strict";function r(t){for(var e=0,n=0;n<t.length;n++){var r=parseint(t[n]);(n+t.length)%2==0?e+=r:e+=2*r%10+math.floor(2*r/10)}return(10-e%10)%10}function o(t){for(var e=0,n=[2,3,4,5,6,7],r=0;r<t.length;r++){e+=n[r%n.length]*parseint(t[t.length-1-r])}return(11-e%11)%11}object.defineproperty(e,"__esmodule",{value:!0}),e.mod10=r,e.mod11=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0});var a=function(t){function e(t,n){r(this,e);var i=o(this,(e.__proto__||object.getprototypeof(e)).call(this));return i.name="invalidinputexception",i.symbology=t,i.input=n,i.message='"'+i.input+'" is not a valid input for '+i.symbology,i}return i(e,t),e}(error),u=function(t){function e(){r(this,e);var t=o(this,(e.__proto__||object.getprototypeof(e)).call(this));return t.name="invalidelementexception",t.message="not supported type to render on",t}return i(e,t),e}(error),s=function(t){function e(){r(this,e);var t=o(this,(e.__proto__||object.getprototypeof(e)).call(this));return t.name="noelementexception",t.message="no element to render on.",t}return i(e,t),e}(error);e.invalidinputexception=a,e.invalidelementexception=u,e.noelementexception=s},function(t,e,n){"use strict";function r(t){var e=["width","height","textmargin","fontsize","margin","margintop","marginbottom","marginleft","marginright"];for(var n in e)e.hasownproperty(n)&&(n=e[n],"string"==typeof t[n]&&(t[n]=parseint(t[n],10)));return"string"==typeof t.displayvalue&&(t.displayvalue="false"!=t.displayvalue),t}object.defineproperty(e,"__esmodule",{value:!0}),e.default=r},function(t,e,n){"use strict";object.defineproperty(e,"__esmodule",{value:!0});var r={width:2,height:100,format:"auto",displayvalue:!0,fontoptions:"",font:"monospace",text:void 0,textalign:"center",textposition:"bottom",textmargin:2,fontsize:20,background:"#ffffff",linecolor:"#000000",margin:10,margintop:void 0,marginbottom:void 0,marginleft:void 0,marginright:void 0,valid:function(){}};e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function i(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}function u(t){var e,n=0;for(e=1;e<11;e+=2)n+=parseint(t[e]);for(e=0;e<11;e+=2)n+=3*parseint(t[e]);return(10-n%10)%10}object.defineproperty(e,"__esmodule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e.checksum=u;var f=n(1),c=r(f),l=n(0),d=r(l),p=function(t){function e(t,n){o(this,e),-1!==t.search(/^[0-9]{11}$/)&&(t+=u(t));var r=i(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n));return r.displayvalue=n.displayvalue,n.fontsize>10*n.width?r.fontsize=10*n.width:r.fontsize=n.fontsize,r.guardheight=n.height+r.fontsize/2+n.textmargin,r}return a(e,t),s(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==u(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatencoding():this.guardedencoding()}},{key:"flatencoding",value:function(){var t=new c.default,e="";return e+="101",e+=t.encode(this.data.substr(0,6),"llllll"),e+="01010",e+=t.encode(this.data.substr(6,6),"rrrrrr"),e+="101",{data:e,text:this.text}}},{key:"guardedencoding",value:function(){var t=new c.default,e=[];return this.displayvalue&&e.push({data:"00000000",text:this.text.substr(0,1),options:{textalign:"left",fontsize:this.fontsize}}),e.push({data:"101"+t.encode(this.data[0],"l"),options:{height:this.guardheight}}),e.push({data:t.encode(this.data.substr(1,5),"lllll"),text:this.text.substr(1,5),options:{fontsize:this.fontsize}}),e.push({data:"01010",options:{height:this.guardheight}}),e.push({data:t.encode(this.data.substr(6,5),"rrrrr"),text:this.text.substr(6,5),options:{fontsize:this.fontsize}}),e.push({data:t.encode(this.data[11],"r")+"101",options:{height:this.guardheight}}),this.displayvalue&&e.push({data:"00000000",text:this.text.substr(11,1),options:{textalign:"right",fontsize:this.fontsize}}),e}}]),e}(d.default);e.default=p},function(t,e,n){"use strict";function r(t,e){return e.height+(e.displayvalue&&t.text.length>0?e.fontsize+e.textmargin:0)+e.margintop+e.marginbottom}function o(t,e,n){if(n.displayvalue&&e<t){if("center"==n.textalign)return math.floor((t-e)/2);if("left"==n.textalign)return 0;if("right"==n.textalign)return math.floor(t-e)}return 0}function i(t,e,n){for(var i=0;i<t.length;i++){var a,u=t[i],f=(0,c.default)(e,u.options);a=f.displayvalue?s(u.text,f,n):0;var l=u.data.length*f.width;u.width=math.ceil(math.max(a,l)),u.height=r(u,f),u.barcodepadding=o(a,l,f)}}function a(t){for(var e=0,n=0;n<t.length;n++)e+=t[n].width;return e}function u(t){for(var e=0,n=0;n<t.length;n++)t[n].height>e&&(e=t[n].height);return e}function s(t,e,n){var r;if(n)r=n;else{if("undefined"==typeof document)return 0;r=document.createelement("canvas").getcontext("2d")}return r.font=e.fontoptions+" "+e.fontsize+"px "+e.font,r.measuretext(t).width}object.defineproperty(e,"__esmodule",{value:!0}),e.gettotalwidthofencodings=e.calculateencodingattributes=e.getbarcodepadding=e.getencodingheight=e.getmaximumheightofencodings=void 0;var f=n(4),c=function(t){return t&&t.__esmodule?t:{default:t}}(f);e.getmaximumheightofencodings=u,e.getencodingheight=r,e.getbarcodepadding=o,e.calculateencodingattributes=i,e.gettotalwidthofencodings=a},function(t,e,n){"use strict";object.defineproperty(e,"__esmodule",{value:!0});var r=n(24),o=n(23),i=n(30),a=n(33),u=n(32),s=n(38),f=n(40),c=n(39),l=n(31);e.default={code39:r.code39,code128:o.code128,code128a:o.code128a,code128b:o.code128b,code128c:o.code128c,ean13:i.ean13,ean8:i.ean8,ean5:i.ean5,ean2:i.ean2,upc:i.upc,upce:i.upce,itf14:a.itf14,itf:u.itf,msi:s.msi,msi10:s.msi10,msi11:s.msi11,msi1010:s.msi1010,msi1110:s.msi1110,pharmacode:f.pharmacode,codabar:c.codabar,genericbarcode:l.genericbarcode}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}object.defineproperty(e,"__esmodule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(e){r(this,t),this.api=e}return o(t,[{key:"handlecatch",value:function(t){if("invalidinputexception"!==t.name)throw t;if(this.api._options.valid===this.api._defaults.valid)throw t.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapbarcodecall",value:function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(t){return this.handlecatch(t),this.api}}}]),t}();e.default=i},function(t,e,n){"use strict";function r(t){return t.margintop=t.margintop||t.margin,t.marginbottom=t.marginbottom||t.margin,t.marginright=t.marginright||t.margin,t.marginleft=t.marginleft||t.margin,t}object.defineproperty(e,"__esmodule",{value:!0}),e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}function o(t){if("string"==typeof t)return i(t);if(array.isarray(t)){for(var e=[],n=0;n<t.length;n++)e.push(o(t[n]));return e}if("undefined"!=typeof htmlcanvaselement&&t instanceof htmlimageelement)return a(t);if(t&&"svg"===t.nodename||"undefined"!=typeof svgelement&&t instanceof svgelement)return{element:t,options:(0,f.default)(t),renderer:l.default.svgrenderer};if("undefined"!=typeof htmlcanvaselement&&t instanceof htmlcanvaselement)return{element:t,options:(0,f.default)(t),renderer:l.default.canvasrenderer};if(t&&t.getcontext)return{element:t,renderer:l.default.canvasrenderer};if(t&&"object"===(void 0===t?"undefined":u(t))&&!t.nodename)return{element:t,renderer:l.default.objectrenderer};throw new d.invalidelementexception}function i(t){var e=document.queryselectorall(t);if(0!==e.length){for(var n=[],r=0;r<e.length;r++)n.push(o(e[r]));return n}}function a(t){var e=document.createelement("canvas");return{element:e,options:(0,f.default)(t),renderer:l.default.canvasrenderer,afterrender:function(){t.setattribute("src",e.todataurl())}}}object.defineproperty(e,"__esmodule",{value:!0});var u="function"==typeof symbol&&"symbol"==typeof symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof symbol&&t.constructor===symbol&&t!==symbol.prototype?"symbol":typeof t},s=n(41),f=r(s),c=n(43),l=r(c),d=n(7);e.default=o},function(t,e,n){"use strict";function r(t){function e(t){if(array.isarray(t))for(var r=0;r<t.length;r++)e(t[r]);else t.text=t.text||"",t.data=t.data||"",n.push(t)}var n=[];return e(t),n}object.defineproperty(e,"__esmodule",{value:!0}),e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid())throw new w.invalidinputexception(r.constructor.name,t);var o=r.encode();o=(0,d.default)(o);for(var i=0;i<o.length;i++)o[i].options=(0,c.default)(n,o[i].options);return o}function i(){return s.default.code128?"code128":object.keys(s.default)[0]}function a(t,e,n){e=(0,d.default)(e);for(var r=0;r<e.length;r++)e[r].options=(0,c.default)(n,e[r].options),(0,h.default)(e[r].options);(0,h.default)(n),new(0,t.renderer)(t.element,e,n).render(),t.afterrender&&t.afterrender()}var u=n(12),s=r(u),f=n(4),c=r(f),l=n(16),d=r(l),p=n(14),h=r(p),y=n(15),b=r(y),v=n(8),g=r(v),_=n(13),o=r(_),w=n(7),e=n(9),m=r(e),x=function(){},j=function(t,e,n){var r=new x;if(void 0===t)throw error("no element to render on was provided.");return r._renderproperties=(0,b.default)(t),r._encodings=[],r._options=m.default,r._errorhandler=new o.default(r),void 0!==e&&(n=n||{},n.format||(n.format=i()),r.options(n)[n.format](e,n).render()),r};j.getmodule=function(t){return s.default[t]};for(var p in s.default)s.default.hasownproperty(p)&&function(t,e){x.prototype[e]=x.prototype[e.touppercase()]=x.prototype[e.tolowercase()]=function(n,r){var i=this;return i._errorhandler.wrapbarcodecall(function(){r.text=void 0===r.text?void 0:""+r.text;var a=(0,c.default)(i._options,r);a=(0,g.default)(a);var u=t[e],s=o(n,u,a);return i._encodings.push(s),i})}}(s.default,p);x.prototype.options=function(t){return this._options=(0,c.default)(this._options,t),this},x.prototype.blank=function(t){var e=new array(t+1).join("0");return this._encodings.push({data:e}),this},x.prototype.init=function(){if(this._renderproperties){array.isarray(this._renderproperties)||(this._renderproperties=[this._renderproperties]);var t;for(var e in this._renderproperties){t=this._renderproperties[e];var n=(0,c.default)(this._options,t.options);"auto"==n.format&&(n.format=i()),this._errorhandler.wrapbarcodecall(function(){var e=n.value,r=s.default[n.format.touppercase()],i=o(e,r,n);a(t,i,n)})}}},x.prototype.render=function(){if(!this._renderproperties)throw new w.noelementexception;if(array.isarray(this._renderproperties))for(var t=0;t<this._renderproperties.length;t++)a(this._renderproperties[t],this._encodings,this._options);else a(this._renderproperties,this._encodings,this._options);return this},x.prototype._defaults=m.default,"undefined"!=typeof window&&(window.jsbarcode=j),"undefined"!=typeof jquery&&(jquery.fn.jsbarcode=function(t,e){var n=[];return jquery(this).each(function(){n.push(this)}),j(n,t,e)}),t.exports=j},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(5),s=function(t){return t&&t.__esmodule?t:{default:t}}(u),f=n(2),c=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||object.getprototypeof(e)).call(this,f.a_start_char+t,n))}return i(e,t),a(e,[{key:"valid",value:function(){return new regexp("^"+f.a_chars+"+$").test(this.data)}}]),e}(s.default);e.default=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(5),s=function(t){return t&&t.__esmodule?t:{default:t}}(u),f=n(2),c=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||object.getprototypeof(e)).call(this,f.b_start_char+t,n))}return i(e,t),a(e,[{key:"valid",value:function(){return new regexp("^"+f.b_chars+"+$").test(this.data)}}]),e}(s.default);e.default=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(5),s=function(t){return t&&t.__esmodule?t:{default:t}}(u),f=n(2),c=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||object.getprototypeof(e)).call(this,f.c_start_char+t,n))}return i(e,t),a(e,[{key:"valid",value:function(){return new regexp("^"+f.c_chars+"+$").test(this.data)}}]),e}(s.default);e.default=c},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function i(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0});var u=n(5),s=r(u),f=n(22),c=r(f),l=function(t){function e(t,n){if(o(this,e),/^[\x00-\x7f\xc8-\xd3]+$/.test(t))var r=i(this,(e.__proto__||object.getprototypeof(e)).call(this,(0,c.default)(t),n));else var r=i(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n));return i(r)}return a(e,t),e}(s.default);e.default=l},function(t,e,n){"use strict";function r(t,e){var n=e?i.a_chars:i.b_chars,a=t.match(new regexp("^("+n+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(a)return a[1]+string.fromcharcode(204)+o(t.substring(a[1].length));var u=t.match(new regexp("^"+n+"+"))[0];return u.length===t.length?t:u+string.fromcharcode(e?205:206)+r(t.substring(u.length),!e)}function o(t){var e=s(t),n=e.length;if(n===t.length)return t;t=t.substring(n);var o=a(t)>=u(t);return e+string.fromcharcode(o?206:205)+r(t,o)}object.defineproperty(e,"__esmodule",{value:!0});var i=n(2),a=function(t){return t.match(new regexp("^"+i.a_chars+"*"))[0].length},u=function(t){return t.match(new regexp("^"+i.b_chars+"*"))[0].length},s=function(t){return t.match(new regexp("^"+i.c_chars+"*"))[0]};e.default=function(t){var e=void 0;if(s(t).length>=2)e=i.c_start_char+o(t);else{var n=a(t)>u(t);e=(n?i.a_start_char:i.b_start_char)+r(t,n)}return e.replace(/[\xcd\xce]([^])[\xcd\xce]/,function(t,e){return string.fromcharcode(203)+e})}},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}object.defineproperty(e,"__esmodule",{value:!0}),e.code128c=e.code128b=e.code128a=e.code128=void 0;var o=n(21),i=r(o),a=n(18),u=r(a),s=n(19),f=r(s),c=n(20),l=r(c);e.code128=i.default,e.code128a=u.default,e.code128b=f.default,e.code128c=l.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}function a(t){return u(f(t))}function u(t){return b[t].tostring(2)}function s(t){return y[t]}function f(t){return y.indexof(t)}function c(t){for(var e=0,n=0;n<t.length;n++)e+=f(t[n]);return e%=43}object.defineproperty(e,"__esmodule",{value:!0}),e.code39=void 0;var l=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),d=n(0),p=function(t){return t&&t.__esmodule?t:{default:t}}(d),h=function(t){function e(t,n){return r(this,e),t=t.touppercase(),n.mod43&&(t+=s(c(t))),o(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n))}return i(e,t),l(e,[{key:"encode",value:function(){for(var t=a("*"),e=0;e<this.data.length;e++)t+=a(this.data[e])+"0";return t+=a("*"),{data:t,text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9a-z\-\.\ \$\/\+\%]+$/)}}]),e}(p.default),y=["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","-","."," ","$","/","+","%","*"],b=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];e.code39=h},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function i(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}function u(t){var e,n=0;for(e=0;e<12;e+=2)n+=parseint(t[e]);for(e=1;e<12;e+=2)n+=3*parseint(t[e]);return(10-n%10)%10}object.defineproperty(e,"__esmodule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(1),c=r(f),l=n(0),d=r(l),p=function(t){function e(t,n){o(this,e),-1!==t.search(/^[0-9]{12}$/)&&(t+=u(t));var r=i(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n));return!n.flat&&n.fontsize>10*n.width?r.fontsize=10*n.width:r.fontsize=n.fontsize,r.guardheight=n.height+r.fontsize/2+n.textmargin,r.lastchar=n.lastchar,r}return a(e,t),s(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&this.data[12]==u(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatencoding():this.guardedencoding()}},{key:"getstructure",value:function(){return["llllll","llglgg","llgglg","llgggl","lgllgg","lggllg","lgggll","lglglg","lglggl","lgglgl"]}},{key:"guardedencoding",value:function(){var t=new c.default,e=[],n=this.getstructure()[this.data[0]],r=this.data.substr(1,6),o=this.data.substr(7,6);return this.options.displayvalue&&e.push({data:"000000000000",text:this.text.substr(0,1),options:{textalign:"left",fontsize:this.fontsize}}),e.push({data:"101",options:{height:this.guardheight}}),e.push({data:t.encode(r,n),text:this.text.substr(1,6),options:{fontsize:this.fontsize}}),e.push({data:"01010",options:{height:this.guardheight}}),e.push({data:t.encode(o,"rrrrrr"),text:this.text.substr(7,6),options:{fontsize:this.fontsize}}),e.push({data:"101",options:{height:this.guardheight}}),this.options.lastchar&&this.options.displayvalue&&(e.push({data:"00"}),e.push({data:"00000",text:this.options.lastchar,options:{fontsize:this.fontsize}})),e}},{key:"flatencoding",value:function(){var t=new c.default,e="",n=this.getstructure()[this.data[0]];return e+="101",e+=t.encode(this.data.substr(1,6),n),e+="01010",e+=t.encode(this.data.substr(7,6),"rrrrrr"),e+="101",{data:e,text:this.text}}}]),e}(d.default);e.default=p},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function i(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),f=r(s),c=n(0),l=r(c),d=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n));return r.structure=["ll","lg","gl","gg"],r}return a(e,t),u(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var t=new f.default,e=this.structure[parseint(this.data)%4],n="1011";return n+=t.encode(this.data,e,"01"),{data:n,text:this.text}}}]),e}(l.default);e.default=d},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function i(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),f=r(s),c=n(0),l=r(c),d=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n));return r.structure=["gglll","glgll","gllgl","glllg","lggll","llggl","lllgg","lglgl","lgllg","llglg"],r}return a(e,t),u(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var t=new f.default,e=this.checksum(),n="1011";return n+=t.encode(this.data,this.structure[e],"01"),{data:n,text:this.text}}},{key:"checksum",value:function(){var t=0;return t+=3*parseint(this.data[0]),t+=9*parseint(this.data[1]),t+=3*parseint(this.data[2]),t+=9*parseint(this.data[3]),(t+=3*parseint(this.data[4]))%10}}]),e}(l.default);e.default=d},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function i(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}function u(t){var e,n=0;for(e=0;e<7;e+=2)n+=3*parseint(t[e]);for(e=1;e<7;e+=2)n+=parseint(t[e]);return(10-n%10)%10}object.defineproperty(e,"__esmodule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(1),c=r(f),l=n(0),d=r(l),p=function(t){function e(t,n){return o(this,e),-1!==t.search(/^[0-9]{7}$/)&&(t+=u(t)),i(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n))}return a(e,t),s(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&this.data[7]==u(this.data)}},{key:"encode",value:function(){var t=new c.default,e="",n=this.data.substr(0,4),r=this.data.substr(4,4);return e+=t.startbin,e+=t.encode(n,"llll"),e+=t.middlebin,e+=t.encode(r,"rrrr"),e+=t.endbin,{data:e,text:this.text}}}]),e}(d.default);e.default=p},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function i(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}function u(t,e){for(var n=parseint(t[t.length-1]),r=h[n],o="",i=0,a=0;a<r.length;a++){var u=r[a];o+="x"===u?t[i++]:u}return""+(o=""+e+o)+(0,p.checksum)(o)}object.defineproperty(e,"__esmodule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(1),c=r(f),l=n(0),d=r(l),p=n(10),h=["xx00000xxx","xx10000xxx","xx20000xxx","xxx00000xx","xxxx00000x","xxxxx00005","xxxxx00006","xxxxx00007","xxxxx00008","xxxxx00009"],y=[["eeeooo","oooeee"],["eeoeoo","ooeoee"],["eeooeo","ooeeoe"],["eeoooe","ooeeeo"],["eoeeoo","oeooee"],["eooeeo","oeeooe"],["eoooee","oeeeoo"],["eoeoeo","oeoeoe"],["eoeooe","oeoeeo"],["eooeoe","oeeoeo"]],b=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n));if(r.isvalid=!1,-1!==t.search(/^[0-9]{6}$/))r.middledigits=t,r.upca=u(t,"0"),r.text=n.text||""+r.upca[0]+t+r.upca[r.upca.length-1],r.isvalid=!0;else{if(-1===t.search(/^[01][0-9]{7}$/))return i(r);if(r.middledigits=t.substring(1,t.length-1),r.upca=u(r.middledigits,t[0]),r.upca[r.upca.length-1]!==t[t.length-1])return i(r);r.isvalid=!0}return r.displayvalue=n.displayvalue,n.fontsize>10*n.width?r.fontsize=10*n.width:r.fontsize=n.fontsize,r.guardheight=n.height+r.fontsize/2+n.textmargin,r}return a(e,t),s(e,[{key:"valid",value:function(){return this.isvalid}},{key:"encode",value:function(){return this.options.flat?this.flatencoding():this.guardedencoding()}},{key:"flatencoding",value:function(){var t=new c.default,e="";return e+="101",e+=this.encodemiddledigits(t),e+="010101",{data:e,text:this.text}}},{key:"guardedencoding",value:function(){var t=new c.default,e=[];return this.displayvalue&&e.push({data:"00000000",text:this.text[0],options:{textalign:"left",fontsize:this.fontsize}}),e.push({data:"101",options:{height:this.guardheight}}),e.push({data:this.encodemiddledigits(t),text:this.text.substring(1,7),options:{fontsize:this.fontsize}}),e.push({data:"010101",options:{height:this.guardheight}}),this.displayvalue&&e.push({data:"00000000",text:this.text[7],options:{textalign:"right",fontsize:this.fontsize}}),e}},{key:"encodemiddledigits",value:function(t){var e=this.upca[0],n=this.upca[this.upca.length-1],r=y[parseint(n)][parseint(e)];return t.encode(this.middledigits,r)}}]),e}(d.default);e.default=b},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}object.defineproperty(e,"__esmodule",{value:!0}),e.upce=e.upc=e.ean2=e.ean5=e.ean8=e.ean13=void 0;var o=n(25),i=r(o),a=n(28),u=r(a),s=n(27),f=r(s),c=n(26),l=r(c),d=n(10),p=r(d),h=n(29),y=r(h);e.ean13=i.default,e.ean8=u.default,e.ean5=f.default,e.ean2=l.default,e.upc=p.default,e.upce=y.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0}),e.genericbarcode=void 0;var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(0),s=function(t){return t&&t.__esmodule?t:{default:t}}(u),f=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n))}return i(e,t),a(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(s.default);e.genericbarcode=f},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0}),e.itf=void 0;var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(0),s=function(t){return t&&t.__esmodule?t:{default:t}}(u),f=function(t){function e(t,n){r(this,e);var i=o(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n));return i.binaryrepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"},i}return i(e,t),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){for(var t="1010",e=0;e<this.data.length;e+=2)t+=this.calculatepair(this.data.substr(e,2));return t+="11101",{data:t,text:this.text}}},{key:"calculatepair",value:function(t){for(var e="",n=this.binaryrepresentation[t[0]],r=this.binaryrepresentation[t[1]],o=0;o<5;o++)e+="1"==n[o]?"111":"1",e+="1"==r[o]?"000":"0";return e}}]),e}(s.default);e.itf=f},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}function a(t){for(var e=0,n=0;n<13;n++)e+=parseint(t[n])*(3-n%2*2);return 10*math.ceil(e/10)-e}object.defineproperty(e,"__esmodule",{value:!0}),e.itf14=void 0;var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(0),f=function(t){return t&&t.__esmodule?t:{default:t}}(s),c=function(t){function e(t,n){r(this,e),-1!==t.search(/^[0-9]{13}$/)&&(t+=a(t));var i=o(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n));return i.binaryrepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"},i}return i(e,t),u(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&this.data[13]==a(this.data)}},{key:"encode",value:function(){for(var t="1010",e=0;e<14;e+=2)t+=this.calculatepair(this.data.substr(e,2));return t+="11101",{data:t,text:this.text}}},{key:"calculatepair",value:function(t){for(var e="",n=this.binaryrepresentation[t[0]],r=this.binaryrepresentation[t[1]],o=0;o<5;o++)e+="1"==n[o]?"111":"1",e+="1"==r[o]?"000":"0";return e}}]),e}(f.default);e.itf14=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0});var a=n(3),u=function(t){return t&&t.__esmodule?t:{default:t}}(a),s=n(6),f=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||object.getprototypeof(e)).call(this,t+(0,s.mod10)(t),n))}return i(e,t),e}(u.default);e.default=f},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0});var a=n(3),u=function(t){return t&&t.__esmodule?t:{default:t}}(a),s=n(6),f=function(t){function e(t,n){return r(this,e),t+=(0,s.mod10)(t),t+=(0,s.mod10)(t),o(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n))}return i(e,t),e}(u.default);e.default=f},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0});var a=n(3),u=function(t){return t&&t.__esmodule?t:{default:t}}(a),s=n(6),f=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||object.getprototypeof(e)).call(this,t+(0,s.mod11)(t),n))}return i(e,t),e}(u.default);e.default=f},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0});var a=n(3),u=function(t){return t&&t.__esmodule?t:{default:t}}(a),s=n(6),f=function(t){function e(t,n){return r(this,e),t+=(0,s.mod11)(t),t+=(0,s.mod10)(t),o(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n))}return i(e,t),e}(u.default);e.default=f},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}object.defineproperty(e,"__esmodule",{value:!0}),e.msi1110=e.msi1010=e.msi11=e.msi10=e.msi=void 0;var o=n(3),i=r(o),a=n(34),u=r(a),s=n(36),f=r(s),c=n(35),l=r(c),d=n(37),p=r(d);e.msi=i.default,e.msi10=u.default,e.msi11=f.default,e.msi1010=l.default,e.msi1110=p.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0}),e.codabar=void 0;var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(0),s=function(t){return t&&t.__esmodule?t:{default:t}}(u),f=function(t){function e(t,n){r(this,e),0===t.search(/^[0-9\-\$\:\.\+\/]+$/)&&(t="a"+t+"a");var i=o(this,(e.__proto__||object.getprototypeof(e)).call(this,t.touppercase(),n));return i.text=i.options.text||i.text.replace(/[a-d]/g,""),i}return i(e,t),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[a-d][0-9\-\$\:\.\+\/]+[a-d]$/)}},{key:"encode",value:function(){for(var t=[],e=this.getencodings(),n=0;n<this.data.length;n++)t.push(e[this.data.charat(n)]),n!==this.data.length-1&&t.push("0");return{text:this.text,data:t.join("")}}},{key:"getencodings",value: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:"1010010011",c:"1001001011",d:"1010011001"}}}]),e}(s.default);e.codabar=f},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}function o(t,e){if(!t)throw new referenceerror("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new typeerror("super expression must either be null or a function, not "+typeof e);t.prototype=object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(object.setprototypeof?object.setprototypeof(t,e):t.__proto__=e)}object.defineproperty(e,"__esmodule",{value:!0}),e.pharmacode=void 0;var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(0),s=function(t){return t&&t.__esmodule?t:{default:t}}(u),f=function(t){function e(t,n){r(this,e);var i=o(this,(e.__proto__||object.getprototypeof(e)).call(this,t,n));return i.number=parseint(t,10),i}return i(e,t),a(e,[{key:"encode",value:function(){for(var t=this.number,e="";!isnan(t)&&0!=t;)t%2==0?(e="11100"+e,t=(t-2)/2):(e="100"+e,t=(t-1)/2);return e=e.slice(0,-2),{data:e,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(s.default);e.pharmacode=f},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}function o(t){var e={};for(var n in s.default)s.default.hasownproperty(n)&&(t.hasattribute("jsbarcode-"+n.tolowercase())&&(e[n]=t.getattribute("jsbarcode-"+n.tolowercase())),t.hasattribute("data-"+n.tolowercase())&&(e[n]=t.getattribute("data-"+n.tolowercase())));return e.value=t.getattribute("jsbarcode-value")||t.getattribute("data-value"),e=(0,a.default)(e)}object.defineproperty(e,"__esmodule",{value:!0});var i=n(8),a=r(i),u=n(9),s=r(u);e.default=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}object.defineproperty(e,"__esmodule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(4),a=function(t){return t&&t.__esmodule?t:{default:t}}(i),u=n(11),s=function(){function t(e,n,o){r(this,t),this.canvas=e,this.encodings=n,this.options=o}return o(t,[{key:"render",value:function(){if(!this.canvas.getcontext)throw new error("the browser does not support canvas.");this.preparecanvas();for(var t=0;t<this.encodings.length;t++){var e=(0,a.default)(this.options,this.encodings[t].options);this.drawcanvasbarcode(e,this.encodings[t]),this.drawcanvastext(e,this.encodings[t]),this.movecanvasdrawing(this.encodings[t])}this.restorecanvas()}},{key:"preparecanvas",value:function(){var t=this.canvas.getcontext("2d");t.save(),(0,u.calculateencodingattributes)(this.encodings,this.options,t);var e=(0,u.gettotalwidthofencodings)(this.encodings),n=(0,u.getmaximumheightofencodings)(this.encodings);this.canvas.width=e+this.options.marginleft+this.options.marginright,this.canvas.height=n,t.clearrect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(t.fillstyle=this.options.background,t.fillrect(0,0,this.canvas.width,this.canvas.height)),t.translate(this.options.marginleft,0)}},{key:"drawcanvasbarcode",value:function(t,e){var n,r=this.canvas.getcontext("2d"),o=e.data;n="top"==t.textposition?t.margintop+t.fontsize+t.textmargin:t.margintop,r.fillstyle=t.linecolor;for(var i=0;i<o.length;i++){var a=i*t.width+e.barcodepadding;"1"===o[i]?r.fillrect(a,n,t.width,t.height):o[i]&&r.fillrect(a,n,t.width,t.height*o[i])}}},{key:"drawcanvastext",value:function(t,e){var n=this.canvas.getcontext("2d"),r=t.fontoptions+" "+t.fontsize+"px "+t.font;if(t.displayvalue){var o,i;i="top"==t.textposition?t.margintop+t.fontsize-t.textmargin:t.height+t.textmargin+t.margintop+t.fontsize,n.font=r,"left"==t.textalign||e.barcodepadding>0?(o=0,n.textalign="left"):"right"==t.textalign?(o=e.width-1,n.textalign="right"):(o=e.width/2,n.textalign="center"),n.filltext(e.text,o,i)}}},{key:"movecanvasdrawing",value:function(t){this.canvas.getcontext("2d").translate(t.width,0)}},{key:"restorecanvas",value:function(){this.canvas.getcontext("2d").restore()}}]),t}();e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esmodule?t:{default:t}}object.defineproperty(e,"__esmodule",{value:!0});var o=n(42),i=r(o),a=n(45),u=r(a),s=n(44),f=r(s);e.default={canvasrenderer:i.default,svgrenderer:u.default,objectrenderer:f.default}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}object.defineproperty(e,"__esmodule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(e,n,o){r(this,t),this.object=e,this.encodings=n,this.options=o}return o(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();e.default=i},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}object.defineproperty(e,"__esmodule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),object.defineproperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(4),a=function(t){return t&&t.__esmodule?t:{default:t}}(i),u=n(11),s="http://www.w3.org/2000/svg",f=function(){function t(e,n,o){r(this,t),this.svg=e,this.encodings=n,this.options=o,this.document=o.xmldocument||document}return o(t,[{key:"render",value:function(){var t=this.options.marginleft;this.preparesvg();for(var e=0;e<this.encodings.length;e++){var n=this.encodings[e],r=(0,a.default)(this.options,n.options),o=this.creategroup(t,r.margintop,this.svg);this.setgroupoptions(o,r),this.drawsvgbarcode(o,r,n),this.drawsvgtext(o,r,n),t+=n.width}}},{key:"preparesvg",value:function(){for(;this.svg.firstchild;)this.svg.removechild(this.svg.firstchild);(0,u.calculateencodingattributes)(this.encodings,this.options);var t=(0,u.gettotalwidthofencodings)(this.encodings),e=(0,u.getmaximumheightofencodings)(this.encodings),n=t+this.options.marginleft+this.options.marginright;this.setsvgattributes(n,e),this.options.background&&this.drawrect(0,0,n,e,this.svg).setattribute("style","fill:"+this.options.background+";")}},{key:"drawsvgbarcode",value:function(t,e,n){var r,o=n.data;r="top"==e.textposition?e.fontsize+e.textmargin:0;for(var i=0,a=0,u=0;u<o.length;u++)a=u*e.width+n.barcodepadding,"1"===o[u]?i++:i>0&&(this.drawrect(a-e.width*i,r,e.width*i,e.height,t),i=0);i>0&&this.drawrect(a-e.width*(i-1),r,e.width*i,e.height,t)}},{key:"drawsvgtext",value:function(t,e,n){var r=this.document.createelementns(s,"text");if(e.displayvalue){var o,i;r.setattribute("style","font:"+e.fontoptions+" "+e.fontsize+"px "+e.font),i="top"==e.textposition?e.fontsize-e.textmargin:e.height+e.textmargin+e.fontsize,"left"==e.textalign||n.barcodepadding>0?(o=0,r.setattribute("text-anchor","start")):"right"==e.textalign?(o=n.width-1,r.setattribute("text-anchor","end")):(o=n.width/2,r.setattribute("text-anchor","middle")),r.setattribute("x",o),r.setattribute("y",i),r.appendchild(this.document.createtextnode(n.text)),t.appendchild(r)}}},{key:"setsvgattributes",value:function(t,e){var n=this.svg;n.setattribute("width",t+"px"),n.setattribute("height",e+"px"),n.setattribute("x","0px"),n.setattribute("y","0px"),n.setattribute("viewbox","0 0 "+t+" "+e),n.setattribute("xmlns",s),n.setattribute("version","1.1"),n.setattribute("style","transform: translate(0,0)")}},{key:"creategroup",value:function(t,e,n){var r=this.document.createelementns(s,"g");return r.setattribute("transform","translate("+t+", "+e+")"),n.appendchild(r),r}},{key:"setgroupoptions",value:function(t,e){t.setattribute("style","fill:"+e.linecolor+";")}},{key:"drawrect",value:function(t,e,n,r,o){var i=this.document.createelementns(s,"rect");return i.setattribute("x",t),i.setattribute("y",e),i.setattribute("width",n),i.setattribute("height",r),o.appendchild(i),i}}]),t}();e.default=f}]);

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网