2 lines
57 KiB
JavaScript
2 lines
57 KiB
JavaScript
(r=>{var n={};function o(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};r[e].call(t.exports,t,t.exports,o);t.l=!0;return t.exports}o.m=r;o.c=n;o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})};o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});Object.defineProperty(e,"__esModule",{value:!0})};o.t=function(t,e){1&e&&(t=o(t));if(8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);o.r(r);Object.defineProperty(r,"default",{enumerable:!0,value:t});if(2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r};o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};o.d(t,"a",t);return t};o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};o.p="";o(o.s=0)})([function(e,t,r){var n=r(1),o=d(n),n=r(36),u=d(n),n=r(37),a=d(n),n=r(38),i=d(n),n=r(39),l=d(n),n=r(41),s=d(n),n=r(49),f=d(n),c=r(48),n=r(42),p=d(n);function d(e){return e&&e.__esModule?e:{default:e}}function h(){}function y(e,t,r){var n=new h;if(void 0===e)throw Error("No element to render on was provided.");n._renderProperties=(0,l.default)(e);n._encodings=[];n._options=p.default;n._errorHandler=new f.default(n);if(void 0!==t){r=r||{};r.format||(r.format=_());n.options(r)[r.format](t,r).render()}return n}y.getModule=function(e){return o.default[e]};for(var v in o.default)o.default.hasOwnProperty(v)&&((i,a)=>{h.prototype[a]=h.prototype[a.toUpperCase()]=h.prototype[a.toLowerCase()]=function(r,n){var o=this;return o._errorHandler.wrapBarcodeCall(function(){n.text=void 0===n.text?void 0:""+n.text;var e=(0,u.default)(o._options,n),e=(0,s.default)(e),t=i[a],t=b(r,t,e);o._encodings.push(t);return o})}})(o.default,v);function b(e,t,r){e=""+e;var n=new t(e,r);if(!n.valid())throw new c.InvalidInputException(n.constructor.name,e);for(var o=n.encode(),o=(0,a.default)(o),i=0;i<o.length;i++)o[i].options=(0,u.default)(r,o[i].options);return o}function _(){return o.default.CODE128?"CODE128":Object.keys(o.default)[0]}h.prototype.options=function(e){this._options=(0,u.default)(this._options,e);return this};h.prototype.blank=function(e){var t=new Array(e+1).join("0");this._encodings.push({data:t});return this};h.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);for(var e in this._renderProperties){var r=this._renderProperties[e],n=(0,u.default)(this._options,r.options);"auto"==n.format&&(n.format=_());this._errorHandler.wrapBarcodeCall(function(){var e=n.value,t=o.default[n.format.toUpperCase()],e=b(e,t,n);g(r,e,n)})}}};h.prototype.render=function(){if(!this._renderProperties)throw new c.NoElementException;if(Array.isArray(this._renderProperties))for(var e=0;e<this._renderProperties.length;e++)g(this._renderProperties[e],this._encodings,this._options);else g(this._renderProperties,this._encodings,this._options);return this};h.prototype._defaults=p.default;function g(e,t,r){t=(0,a.default)(t);for(var n=0;n<t.length;n++){t[n].options=(0,u.default)(r,t[n].options);(0,i.default)(t[n].options)}(0,i.default)(r);var o=e.renderer,o=new o(e.element,t,r);o.render();e.afterRender&&e.afterRender()}"undefined"!=typeof window&&(window.JsBarcode=y);"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(e,t){var r=[];jQuery(this).each(function(){r.push(this)});return y(r,e,t)});e.exports=y},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=r(4),i=r(12),a=r(22),u=r(26),l=r(33),s=r(34),f=r(35);t.default={CODE39:n.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:a.ITF,MSI:u.MSI,MSI10:u.MSI10,MSI11:u.MSI11,MSI1010:u.MSI1010,MSI1110:u.MSI1110,pharmacode:l.pharmacode,codabar:s.codabar,GenericBarcode:f.GenericBarcode}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.CODE39=void 0;var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i=r(3),i=(r=i,r&&r.__esModule?r:{default:r});var i=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");e=e.toUpperCase();t.mod43&&(e+=(r=(e=>{for(var t=0,r=0;r<e.length;r++)t+=s(e[r]);t%=43;return t})(e),a[r]));n=this,r=(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t);if(n)return!r||"object"!=typeof r&&"function"!=typeof r?n:r;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}n(o,[{key:"encode",value:function(){for(var e=l("*"),t=0;t<this.data.length;t++)e+=l(this.data[t])+"0";e+=l("*");return{data:e,text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]);return o})(i.default),a=["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","-","."," ","$","/","+","%","*"],u=[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];function l(e){e=s(e);return u[e].toString(2)}function s(e){return a.indexOf(e)}t.CODE39=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});function o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");this.data=e;this.text=t.text||e;this.options=t}t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.CODE128C=t.CODE128B=t.CODE128A=t.CODE128=void 0;var n=r(5),n=u(n),o=r(9),o=u(o),i=r(10),i=u(i),a=r(11),a=u(a);function u(e){return e&&e.__esModule?e:{default:e}}t.CODE128=n.default;t.CODE128A=o.default;t.CODE128B=i.default;t.CODE128C=a.default},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(6),n=i(n),o=r(8),a=i(o);function i(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}o=(e=>{var t=i;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 i(e,t){var r,n=this,o=i;if(!(n instanceof o))throw new TypeError("Cannot call a class as a function");r=/^[\x00-\x7F\xC8-\xD3]+$/.test(e)?u(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,(0,a.default)(e),t)):u(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));return u(r)}return i})(n.default);t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i,a=r(3),a=(i=a,i&&i.__esModule?i:{default:i}),u=r(7);a=(e=>{var t=a;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(e,t){var r=this,n=a;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");var o=((e,t)=>{if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")})(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e.substring(1),t));o.bytes=e.split("").map(function(e){return e.charCodeAt(0)});return o}n(a,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var e=this.bytes,t=e.shift()-105,r=u.SET_BY_CODE[t];if(void 0===r)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&e.unshift(u.FNC1);e=a.next(e,1,r);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:a.getBar(t)+e.result+a.getBar((e.checksum+t)%u.MODULO)+a.getBar(u.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var e=this.options.ean128||!1;"string"==typeof e&&(e="true"===e.toLowerCase());return e}}],[{key:"getBar",value:function(e){return u.BARS[e]?u.BARS[e].toString():""}},{key:"correctIndex",value:function(e,t){var r;return t===u.SET_A?(r=e.shift(),r<32?r+64:r-32):t===u.SET_B?e.shift()-32:10*(e.shift()-48)+e.shift()-48}},{key:"next",value:function(e,t,r){if(!e.length)return{result:"",checksum:0};var n=void 0,o=void 0;if(200<=e[0]){var o=e.shift()-105,i=u.SWAP[o];if(void 0!==i)n=a.next(e,t+1,i);else{r!==u.SET_A&&r!==u.SET_B||o!==u.SHIFT||(e[0]=r===u.SET_A?95<e[0]?e[0]-96:e[0]:e[0]<32?e[0]+96:e[0]);n=a.next(e,t+1,r)}}else{o=a.correctIndex(e,r);n=a.next(e,t+1,r)}i=a.getBar(o),o*=t;return{result:i+n.result,checksum:o+n.checksum}}}]);return a})(a.default);t.default=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n;function o(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}t.SET_A=0,t.SET_B=1,t.SET_C=2,t.SHIFT=98,t.START_A=103,t.START_B=104,t.START_C=105,t.MODULO=103,t.STOP=106,t.FNC1=207,t.SET_BY_CODE=(n={},o(n,103,0),o(n,104,1),o(n,105,2),n),t.SWAP={101:0,100:1,99:2},t.A_START_CHAR=String.fromCharCode(208),t.B_START_CHAR=String.fromCharCode(209),t.C_START_CHAR=String.fromCharCode(210),t.A_CHARS="[\0-_È-Ï]",t.B_CHARS="[ -È-Ï]",t.C_CHARS="(Ï*[0-9]{2}Ï*)",t.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(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});function n(e){return e.match(new RegExp("^"+a.A_CHARS+"*"))[0].length}function o(e){return e.match(new RegExp("^"+a.B_CHARS+"*"))[0].length}function i(e){return e.match(new RegExp("^"+a.C_CHARS+"*"))[0]}var a=r(7);function u(e,t){var r=t?a.A_CHARS:a.B_CHARS,n=e.match(new RegExp("^("+r+"+?)(([0-9]{2}){2,})([^0-9]|$)"));return n?n[1]+String.fromCharCode(204)+l(e.substring(n[1].length)):(n=e.match(new RegExp("^"+r+"+"))[0],n.length===e.length?e:n+String.fromCharCode(t?205:206)+u(e.substring(n.length),!t))}function l(e){var t=i(e),r=t.length;if(r===e.length)return e;e=e.substring(r);r=n(e)>=o(e);return t+String.fromCharCode(r?206:205)+u(e,r)}t.default=function(e){var t=void 0,r=i(e).length;t=2<=r?a.C_START_CHAR+l(e):(r=n(e)>o(e),(r?a.A_START_CHAR:a.B_START_CHAR)+u(e,r));return t.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(e,t){return String.fromCharCode(203)+t})}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i,a=r(6),a=(i=a,i&&i.__esModule?i:{default:i}),u=r(7);a=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,u.A_START_CHAR+e,t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}n(o,[{key:"valid",value:function(){return new RegExp("^"+u.A_CHARS+"+$").test(this.data)}}]);return o})(a.default);t.default=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i,a=r(6),a=(i=a,i&&i.__esModule?i:{default:i}),u=r(7);a=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,u.B_START_CHAR+e,t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}n(o,[{key:"valid",value:function(){return new RegExp("^"+u.B_CHARS+"+$").test(this.data)}}]);return o})(a.default);t.default=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i,a=r(6),a=(i=a,i&&i.__esModule?i:{default:i}),u=r(7);a=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,u.C_START_CHAR+e,t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}n(o,[{key:"valid",value:function(){return new RegExp("^"+u.C_CHARS+"+$").test(this.data)}}]);return o})(a.default);t.default=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.UPCE=t.UPC=t.EAN2=t.EAN5=t.EAN8=t.EAN13=void 0;var n=r(13),n=s(n),o=r(17),o=s(o),i=r(18),i=s(i),a=r(19),a=s(a),u=r(20),u=s(u),l=r(21),l=s(l);function s(e){return e&&e.__esModule?e:{default:e}}t.EAN13=n.default;t.EAN8=o.default;t.EAN5=i.default;t.EAN2=a.default;t.UPC=u.default;t.UPCE=l.default},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}function a(e,t,r){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,t);return void 0!==n?"value"in n?n.value:(n=n.get,void 0!==n?n.call(r):void 0):(n=Object.getPrototypeOf(e),null!==n?a(n,t,r):void 0)}var u=r(14),i=r(15),i=(r=i,r&&r.__esModule?r:{default:r});function l(e){var t=e.substr(0,12).split("").map(function(e){return+e}).reduce(function(e,t,r){return r%2?e+3*t:e+t},0);return(10-t%10)%10}i=(e=>{var t=i;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 i(e,t){var r=this,n=i;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");-1!==e.search(/^[0-9]{12}$/)&&(e+=l(e));var o=((e,t)=>{if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")})(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));o.lastChar=t.lastChar;return o}n(i,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===l(this.data)}},{key:"leftText",value:function(){return a(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var e=this.data.substr(1,6),t=u.EAN13_STRUCTURE[this.data[0]];return a(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"leftEncode",this).call(this,e,t)}},{key:"rightText",value:function(){return a(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var e=this.data.substr(7,6);return a(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"rightEncode",this).call(this,e,"RRRRRR")}},{key:"encodeGuarded",value:function(){var e=a(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"encodeGuarded",this).call(this);if(this.options.displayValue){e.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}});if(this.options.lastChar){e.push({data:"00"});e.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}})}}return e}}]);return i})(i.default);t.default=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.SIDE_BIN="101",t.MIDDLE_BIN="01010",t.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"]},t.EAN2_STRUCTURE=["LL","LG","GL","GG"],t.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],t.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var a=r(14),i=r(16),u=l(i),i=r(3),i=l(i);function l(e){return e&&e.__esModule?e:{default:e}}i=(e=>{var t=i;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 i(e,t){var r=this,n=i;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");var o=((e,t)=>{if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")})(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));o.fontSize=!t.flat&&t.fontSize>10*t.width?10*t.width:t.fontSize;o.guardHeight=t.height+o.fontSize/2+t.textMargin;return o}n(i,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(e,t){return this.text.substr(e,t)}},{key:"leftEncode",value:function(e,t){return(0,u.default)(e,t)}},{key:"rightText",value:function(e,t){return this.text.substr(e,t)}},{key:"rightEncode",value:function(e,t){return(0,u.default)(e,t)}},{key:"encodeGuarded",value:function(){var e={fontSize:this.fontSize},t={height:this.guardHeight};return[{data:a.SIDE_BIN,options:t},{data:this.leftEncode(),text:this.leftText(),options:e},{data:a.MIDDLE_BIN,options:t},{data:this.rightEncode(),text:this.rightText(),options:e},{data:a.SIDE_BIN,options:t}]}},{key:"encodeFlat",value:function(){var e=[a.SIDE_BIN,this.leftEncode(),a.MIDDLE_BIN,this.rightEncode(),a.SIDE_BIN];return{data:e.join(""),text:this.text}}}]);return i})(i.default);t.default=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var a=r(14);t.default=function(r,n,o){var i,e=r.split("").map(function(e,t){return a.BINARIES[n[t]]}).map(function(e,t){return e?e[r[t]]:""});o&&(i=r.length-1,e=e.map(function(e,t){return t<i?e+o:e}));return e.join("")}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}function i(e,t,r){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,t);return void 0!==n?"value"in n?n.value:(n=n.get,void 0!==n?n.call(r):void 0):(n=Object.getPrototypeOf(e),null!==n?i(n,t,r):void 0)}var a=r(15),a=(r=a,r&&r.__esModule?r:{default:r});function u(e){var t=e.substr(0,7).split("").map(function(e){return+e}).reduce(function(e,t,r){return r%2?e+t:e+3*t},0);return(10-t%10)%10}a=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");-1!==e.search(/^[0-9]{7}$/)&&(e+=u(e));r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}n(o,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===u(this.data)}},{key:"leftText",value:function(){return i(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var e=this.data.substr(0,4);return i(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"leftEncode",this).call(this,e,"LLLL")}},{key:"rightText",value:function(){return i(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var e=this.data.substr(4,4);return i(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"rightEncode",this).call(this,e,"RRRR")}}]);return o})(a.default);t.default=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i=r(14),a=r(16),u=l(a),a=r(3),a=l(a);function l(e){return e&&e.__esModule?e:{default:e}}a=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}n(o,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var e,t=i.EAN5_STRUCTURE[e=this.data,t=e.split("").map(function(e){return+e}).reduce(function(e,t,r){return r%2?e+9*t:e+3*t},0),t%10];return{data:"1011"+(0,u.default)(this.data,t,"01"),text:this.text}}}]);return o})(a.default);t.default=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i=r(14),a=r(16),u=l(a),a=r(3),a=l(a);function l(e){return e&&e.__esModule?e:{default:e}}a=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}n(o,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var e=i.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,u.default)(this.data,e,"01"),text:this.text}}}]);return o})(a.default);t.default=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}t.checksum=l;var i=r(16),a=u(i),i=r(3),i=u(i);function u(e){return e&&e.__esModule?e:{default:e}}i=(e=>{var t=i;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 i(e,t){var r=this,n=i;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");-1!==e.search(/^[0-9]{11}$/)&&(e+=l(e));var o=((e,t)=>{if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")})(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));o.displayValue=t.displayValue;o.fontSize=10*t.width<t.fontSize?10*t.width:t.fontSize;o.guardHeight=t.height+o.fontSize/2+t.textMargin;return o}n(i,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==l(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var e="";e+="101";e+=(0,a.default)(this.data.substr(0,6),"LLLLLL");e+="01010";e+=(0,a.default)(this.data.substr(6,6),"RRRRRR");e+="101";return{data:e,text:this.text}}},{key:"guardedEncoding",value:function(){var e=[];this.displayValue&&e.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}});e.push({data:"101"+(0,a.default)(this.data[0],"L"),options:{height:this.guardHeight}});e.push({data:(0,a.default)(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:(0,a.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}});e.push({data:(0,a.default)(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}});return e}}]);return i})(i.default);function l(e){for(var t=0,r=1;r<11;r+=2)t+=parseInt(e[r]);for(r=0;r<11;r+=2)t+=3*parseInt(e[r]);return(10-t%10)%10}t.default=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i=r(16),a=u(i),i=r(3),i=u(i),l=r(20);function u(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}var f=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],c=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],i=(e=>{var t=i;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 i(e,t){var r=this,n=i;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");var o=s(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));o.isValid=!1;if(-1!==e.search(/^[0-9]{6}$/)){o.middleDigits=e;o.upcA=p(e,"0");o.text=t.text||""+o.upcA[0]+e+o.upcA[o.upcA.length-1]}else{if(-1===e.search(/^[01][0-9]{7}$/))return s(o);o.middleDigits=e.substring(1,e.length-1);o.upcA=p(o.middleDigits,e[0]);if(o.upcA[o.upcA.length-1]!==e[e.length-1])return s(o)}o.isValid=!0;o.displayValue=t.displayValue;o.fontSize=10*t.width<t.fontSize?10*t.width:t.fontSize;o.guardHeight=t.height+o.fontSize/2+t.textMargin;return o}n(i,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var e="";e+="101";e+=this.encodeMiddleDigits();e+="010101";return{data:e,text:this.text}}},{key:"guardedEncoding",value:function(){var e=[];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(),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}});return e}},{key:"encodeMiddleDigits",value:function(){var e=this.upcA[0],t=this.upcA[this.upcA.length-1],t=c[parseInt(t)][parseInt(e)];return(0,a.default)(this.middleDigits,t)}}]);return i})(i.default);function p(e,t){for(var r=parseInt(e[e.length-1]),n=f[r],o="",i=0,a=0;a<n.length;a++){var u=n[a];o+="X"===u?e[i++]:u}o=""+t+o;return""+o+(0,l.checksum)(o)}t.default=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.ITF14=t.ITF=void 0;var n=r(23),n=i(n),o=r(25),o=i(o);function i(e){return e&&e.__esModule?e:{default:e}}t.ITF=n.default;t.ITF14=o.default},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i=r(24),a=r(3),a=(r=a,r&&r.__esModule?r:{default:r});a=(e=>{var t=r;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 r(){var e=this,t=r;if(!(e instanceof t))throw new TypeError("Cannot call a class as a function");e=this,t=(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments);if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}n(r,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var t=this,e=this.data.match(/.{2}/g).map(function(e){return t.encodePair(e)}).join("");return{data:i.START_BIN+e+i.END_BIN,text:this.text}}},{key:"encodePair",value:function(e){var r=i.BINARIES[e[1]];return i.BINARIES[e[0]].split("").map(function(e,t){return("1"===e?"111":"1")+("1"===r[t]?"000":"0")}).join("")}}]);return r})(a.default);t.default=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.START_BIN="1010",t.END_BIN="11101",t.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i=r(23),i=(r=i,r&&r.__esModule?r:{default:r});function a(e){var t=e.substr(0,13).split("").map(function(e){return parseInt(e,10)}).reduce(function(e,t,r){return e+t*(3-r%2*2)},0);return 10*Math.ceil(t/10)-t}i=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");-1!==e.search(/^[0-9]{13}$/)&&(e+=a(e));r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}n(o,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===a(this.data)}}]);return o})(i.default);t.default=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.MSI1110=t.MSI1010=t.MSI11=t.MSI10=t.MSI=void 0;var n=r(27),n=l(n),o=r(28),o=l(o),i=r(30),i=l(i),a=r(31),a=l(a),u=r(32),u=l(u);function l(e){return e&&e.__esModule?e:{default:e}}t.MSI=n.default;t.MSI10=o.default;t.MSI11=i.default;t.MSI1010=a.default;t.MSI1110=u.default},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i=r(3),i=(r=i,r&&r.__esModule?r:{default:r});i=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}n(o,[{key:"encode",value:function(){for(var e="110",t=0;t<this.data.length;t++)for(var r=parseInt(this.data[t]),n=r.toString(2),n=((e,t)=>{for(var r=0;r<t;r++)e="0"+e;return e})(n,4-n.length),o=0;o<n.length;o++)e+="0"==n[o]?"100":"110";e+="1001";return{data:e,text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]);return o})(i.default);t.default=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o=r(27),o=(n=o,n&&n.__esModule?n:{default:n}),i=r(29);o=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,e+(0,i.mod10)(e),t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return o})(o.default);t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.mod10=function(e){for(var t=0,r=0;r<e.length;r++){var n=parseInt(e[r]);(r+e.length)%2==0?t+=n:t+=2*n%10+Math.floor(2*n/10)}return(10-t%10)%10};t.mod11=function(e){for(var t=0,r=[2,3,4,5,6,7],n=0;n<e.length;n++){var o=parseInt(e[e.length-1-n]);t+=r[n%r.length]*o}return(11-t%11)%11}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o=r(27),o=(n=o,n&&n.__esModule?n:{default:n}),i=r(29);o=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,e+(0,i.mod11)(e),t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return o})(o.default);t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o=r(27),o=(n=o,n&&n.__esModule?n:{default:n}),i=r(29);o=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");e+=(0,i.mod10)(e);e+=(0,i.mod10)(e);r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return o})(o.default);t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o=r(27),o=(n=o,n&&n.__esModule?n:{default:n}),i=r(29);o=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");e+=(0,i.mod11)(e);e+=(0,i.mod10)(e);r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return o})(o.default);t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.pharmacode=void 0;var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i=r(3),i=(r=i,r&&r.__esModule?r:{default:r});i=(e=>{var t=i;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 i(e,t){var r=this,n=i;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");var o=((e,t)=>{if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")})(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));o.number=parseInt(e,10);return o}n(i,[{key:"encode",value:function(){for(var e=this.number,t="";!isNaN(e)&&0!=e;)if(e%2==0){t="11100"+t;e=(e-2)/2}else{t="100"+t;e=(e-1)/2}t=t.slice(0,-2);return{data:t,text:this.text}}},{key:"valid",value:function(){return 3<=this.number&&this.number<=131070}}]);return i})(i.default);t.pharmacode=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.codabar=void 0;var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i=r(3),i=(r=i,r&&r.__esModule?r:{default:r});i=(e=>{var t=i;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 i(e,t){var r=this,n=i;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");0===e.search(/^[0-9\-\$\:\.\+\/]+$/)&&(e="A"+e+"A");var o=((e,t)=>{if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")})(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e.toUpperCase(),t));o.text=o.options.text||o.text.replace(/[A-D]/g,"");return o}n(i,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var e=[],t=this.getEncodings(),r=0;r<this.data.length;r++){e.push(t[this.data.charAt(r)]);r!==this.data.length-1&&e.push("0")}return{text:this.text,data:e.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:"1001001011",C:"1010010011",D:"1010011001"}}}]);return i})(i.default);t.codabar=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.GenericBarcode=void 0;var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i=r(3),i=(r=i,r&&r.__esModule?r:{default:r});i=(e=>{var t=o;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 o(e,t){var r=this,n=o;if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");r=this,n=(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t);if(r)return!n||"object"!=typeof n&&"function"!=typeof n?r:n;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}n(o,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]);return o})(i.default);t.GenericBarcode=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(e,t){return n({},e,t)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var n=[];!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)}}(e);return n}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){e.marginTop=e.marginTop||e.margin;e.marginBottom=e.marginBottom||e.margin;e.marginRight=e.marginRight||e.margin;e.marginLeft=e.marginLeft||e.margin;return e}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=r(40),f=o(n),n=r(43),c=o(n),p=r(48);function o(e){return e&&e.__esModule?e:{default:e}}function d(e){if("string"!=typeof e){if(Array.isArray(e)){for(var t=[],r=0;r<e.length;r++)t.push(d(e[r]));return t}if("undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLImageElement)return n=e,o=document.createElement("canvas"),{element:o,options:(0,f.default)(n),renderer:c.default.CanvasRenderer,afterRender:function(){n.setAttribute("src",o.toDataURL())}};if(e&&e.nodeName&&"svg"===e.nodeName.toLowerCase()||"undefined"!=typeof SVGElement&&e instanceof SVGElement)return{element:e,options:(0,f.default)(e),renderer:c.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement)return{element:e,options:(0,f.default)(e),renderer:c.default.CanvasRenderer};if(e&&e.getContext)return{element:e,renderer:c.default.CanvasRenderer};if(e&&"object"===(void 0===e?"undefined":s(e))&&!e.nodeName)return{element:e,renderer:c.default.ObjectRenderer};throw new p.InvalidElementException}var n,o,i=e,a=document.querySelectorAll(i);if(0!==a.length){for(var u=[],l=0;l<a.length;l++)u.push(d(a[l]));return u}}t.default=d},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(41),o=a(n),n=r(42),i=a(n);function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t,r={};for(t in i.default)if(i.default.hasOwnProperty(t)){e.hasAttribute("jsbarcode-"+t.toLowerCase())&&(r[t]=e.getAttribute("jsbarcode-"+t.toLowerCase()));e.hasAttribute("data-"+t.toLowerCase())&&(r[t]=e.getAttribute("data-"+t.toLowerCase()))}r.value=e.getAttribute("jsbarcode-value")||e.getAttribute("data-value");r=(0,o.default)(r);return r}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t,r=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(t in r)if(r.hasOwnProperty(t)){t=r[t];"string"==typeof e[t]&&(e[t]=parseInt(e[t],10))}"string"==typeof e.displayValue&&(e.displayValue="false"!=e.displayValue);return e}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n={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(){}};t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(44),n=a(n),o=r(46),o=a(o),i=r(47),i=a(i);function a(e){return e&&e.__esModule?e:{default:e}}t.default={CanvasRenderer:n.default,SVGRenderer:o.default,ObjectRenderer:i.default}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i,a=r(36),u=(i=a,i&&i.__esModule?i:{default:i}),l=r(45);a=(()=>{function i(e,t,r){var n=this,o=i;if(!(n instanceof o))throw new TypeError("Cannot call a class as a function");this.canvas=e;this.encodings=t;this.options=r}n(i,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var e=0;e<this.encodings.length;e++){var t=(0,u.default)(this.options,this.encodings[e].options);this.drawCanvasBarcode(t,this.encodings[e]);this.drawCanvasText(t,this.encodings[e]);this.moveCanvasDrawing(this.encodings[e])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var e=this.canvas.getContext("2d");e.save();(0,l.calculateEncodingAttributes)(this.encodings,this.options,e);var t=(0,l.getTotalWidthOfEncodings)(this.encodings),r=(0,l.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=t+this.options.marginLeft+this.options.marginRight;this.canvas.height=r;e.clearRect(0,0,this.canvas.width,this.canvas.height);if(this.options.background){e.fillStyle=this.options.background;e.fillRect(0,0,this.canvas.width,this.canvas.height)}e.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(e,t){var r=this.canvas.getContext("2d"),n=t.data,o="top"==e.textPosition?e.marginTop+e.fontSize+e.textMargin:e.marginTop;r.fillStyle=e.lineColor;for(var i=0;i<n.length;i++){var a=i*e.width+t.barcodePadding;"1"===n[i]?r.fillRect(a,o,e.width,e.height):n[i]&&r.fillRect(a,o,e.width,e.height*n[i])}}},{key:"drawCanvasText",value:function(e,t){var r=this.canvas.getContext("2d"),n=e.fontOptions+" "+e.fontSize+"px "+e.font;if(e.displayValue){var o,i="top"==e.textPosition?e.marginTop+e.fontSize-e.textMargin:e.height+e.textMargin+e.marginTop+e.fontSize;r.font=n;if("left"==e.textAlign||0<t.barcodePadding){o=0;r.textAlign="left"}else if("right"==e.textAlign){o=t.width-1;r.textAlign="right"}else{o=t.width/2;r.textAlign="center"}r.fillText(t.text,o,i)}}},{key:"moveCanvasDrawing",value:function(e){var t=this.canvas.getContext("2d");t.translate(e.width,0)}},{key:"restoreCanvas",value:function(){var e=this.canvas.getContext("2d");e.restore()}}]);return i})();t.default=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});t.getTotalWidthOfEncodings=t.calculateEncodingAttributes=t.getBarcodePadding=t.getEncodingHeight=t.getMaximumHeightOfEncodings=void 0;var n=r(36),l=(r=n,r&&r.__esModule?r:{default:r});function s(e,t){return t.height+(t.displayValue&&0<e.text.length?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function f(e,t,r){if(r.displayValue&&t<e){if("center"==r.textAlign)return Math.floor((e-t)/2);if("left"==r.textAlign)return 0;if("right"==r.textAlign)return Math.floor(e-t)}return 0}t.getMaximumHeightOfEncodings=function(e){for(var t=0,r=0;r<e.length;r++)e[r].height>t&&(t=e[r].height);return t};t.getEncodingHeight=s;t.getBarcodePadding=f;t.calculateEncodingAttributes=function(e,t,r){for(var n=0;n<e.length;n++){var o=e[n],i=(0,l.default)(t,o.options),a=i.displayValue?((e,t,r)=>{if(r)n=r;else{if("undefined"==typeof document)return 0;n=document.createElement("canvas").getContext("2d")}n.font=t.fontOptions+" "+t.fontSize+"px "+t.font;var n=n.measureText(e);return n?(n=n.width,n):0})(o.text,i,r):0,u=o.data.length*i.width;o.width=Math.ceil(Math.max(a,u));o.height=s(o,i);o.barcodePadding=f(a,u,i)}};t.getTotalWidthOfEncodings=function(e){for(var t=0,r=0;r<e.length;r++)t+=e[r].width;return t}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i,a=r(36),u=(i=a,i&&i.__esModule?i:{default:i}),l=r(45);var s="http://www.w3.org/2000/svg",a=(()=>{function i(e,t,r){var n=this,o=i;if(!(n instanceof o))throw new TypeError("Cannot call a class as a function");this.svg=e;this.encodings=t;this.options=r;this.document=r.xmlDocument||document}n(i,[{key:"render",value:function(){var e=this.options.marginLeft;this.prepareSVG();for(var t=0;t<this.encodings.length;t++){var r=this.encodings[t],n=(0,u.default)(this.options,r.options),o=this.createGroup(e,n.marginTop,this.svg);this.setGroupOptions(o,n);this.drawSvgBarcode(o,n,r);this.drawSVGText(o,n,r);e+=r.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,l.calculateEncodingAttributes)(this.encodings,this.options);var e=(0,l.getTotalWidthOfEncodings)(this.encodings),t=(0,l.getMaximumHeightOfEncodings)(this.encodings),e=e+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(e,t);this.options.background&&this.drawRect(0,0,e,t,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(e,t,r){for(var n=r.data,o="top"==t.textPosition?t.fontSize+t.textMargin:0,i=0,a=0,u=0;u<n.length;u++){a=u*t.width+r.barcodePadding;if("1"===n[u])i++;else if(0<i){this.drawRect(a-t.width*i,o,t.width*i,t.height,e);i=0}}0<i&&this.drawRect(a-t.width*(i-1),o,t.width*i,t.height,e)}},{key:"drawSVGText",value:function(e,t,r){var n,o,i=this.document.createElementNS(s,"text");if(t.displayValue){i.setAttribute("style","font:"+t.fontOptions+" "+t.fontSize+"px "+t.font);o="top"==t.textPosition?t.fontSize-t.textMargin:t.height+t.textMargin+t.fontSize;if("left"==t.textAlign||0<r.barcodePadding){n=0;i.setAttribute("text-anchor","start")}else if("right"==t.textAlign){n=r.width-1;i.setAttribute("text-anchor","end")}else{n=r.width/2;i.setAttribute("text-anchor","middle")}i.setAttribute("x",n);i.setAttribute("y",o);i.appendChild(this.document.createTextNode(r.text));e.appendChild(i)}}},{key:"setSvgAttributes",value:function(e,t){var r=this.svg;r.setAttribute("width",e+"px");r.setAttribute("height",t+"px");r.setAttribute("x","0px");r.setAttribute("y","0px");r.setAttribute("viewBox","0 0 "+e+" "+t);r.setAttribute("xmlns",s);r.setAttribute("version","1.1");r.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(e,t,r){var n=this.document.createElementNS(s,"g");n.setAttribute("transform","translate("+e+", "+t+")");r.appendChild(n);return n}},{key:"setGroupOptions",value:function(e,t){e.setAttribute("style","fill:"+t.lineColor+";")}},{key:"drawRect",value:function(e,t,r,n,o){var i=this.document.createElementNS(s,"rect");i.setAttribute("x",e);i.setAttribute("y",t);i.setAttribute("width",r);i.setAttribute("height",n);o.appendChild(i);return i}}]);return i})();t.default=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){t&&o(e.prototype,t);r&&o(e,r);return e};function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i=(()=>{function i(e,t,r){var n=this,o=i;if(!(n instanceof o))throw new TypeError("Cannot call a class as a function");this.object=e;this.encodings=t;this.options=r}n(i,[{key:"render",value:function(){this.object.encodings=this.encodings}}]);return i})();t.default=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var n=(e=>{a(n,e);function n(e,t){o(this,n);var r=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));r.name="InvalidInputException";r.symbology=e;r.input=t;r.message='"'+r.input+'" is not a valid input for '+r.symbology;return r}return n})(Error),u=(e=>{a(t,e);function t(){o(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.name="InvalidElementException";e.message="Not supported type to render on";return e}return t})(Error),l=(e=>{a(t,e);function t(){o(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.name="NoElementException";e.message="No element to render on.";return e}return t})(Error);t.InvalidInputException=n;t.InvalidElementException=u;t.NoElementException=l},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t,r){t&&n(e.prototype,t);r&&n(e,r);return e};function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}var i=(()=>{function n(e){var t=this,r=n;if(!(t instanceof r))throw new TypeError("Cannot call a class as a function");this.api=e}o(n,[{key:"handleCatch",value:function(e){if("InvalidInputException"!==e.name)throw e;if(this.api._options.valid===this.api._defaults.valid)throw e.message;this.api._options.valid(!1);this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(e){try{var t=e.apply(void 0,arguments);this.api._options.valid(!0);return t}catch(e){this.handleCatch(e);return this.api}}}]);return n})();t.default=i}]);
|
|
//# sourceMappingURL=JsBarcode.all.js.map
|