diff --git a/README.md b/README.md index d7d2e4f9..f1c03d25 100644 --- a/README.md +++ b/README.md @@ -117,14 +117,14 @@ Download or get the CDN link to the script: | Name | Supported barcodes | Size (gzip) | CDN / Download | |------|--------------------|:-----------:|---------------:| -| *All* | *All the barcodes!* | *7.3 kB* | *[JsBarcode.all.min.js][1]* | -| CODE128 | CODE128 (auto and force mode) | 5 kB | [JsBarcode.code128.min.js][2] | -| CODE39 | CODE39 | 4 kB | [JsBarcode.code39.min.js][3] | -| EAN / UPC | EAN-13, EAN-8, EAN-5, EAN-2, UPC (A) | 4.6 kB | [JsBarcode.ean-upc.min.js][4] | -| ITF-14 | ITF-14 | 3.8 kB | [JsBarcode.itf-14.min.js][5] | -| ITF | ITF | 3.7 kB | [JsBarcode.itf.min.js][6] | -| MSI | MSI, MSI10, MSI11, MSI1010, MSI1110 | 4.1 kB | [JsBarcode.msi.min.js][7] | -| Pharmacode | Pharmacode | 3.6 kB | [JsBarcode.pharmacode.min.js][8] | +| *All* | *All the barcodes!* | *7.7 kB* | *[JsBarcode.all.min.js][1]* | +| CODE128 | CODE128 (auto and force mode) | 5.3 kB | [JsBarcode.code128.min.js][2] | +| CODE39 | CODE39 | 4.6 kB | [JsBarcode.code39.min.js][3] | +| EAN / UPC | EAN-13, EAN-8, EAN-5, EAN-2, UPC (A) | 5.1 kB | [JsBarcode.ean-upc.min.js][4] | +| ITF-14 | ITF-14 | 4.3 kB | [JsBarcode.itf-14.min.js][5] | +| ITF | ITF | 4.3 kB | [JsBarcode.itf.min.js][6] | +| MSI | MSI, MSI10, MSI11, MSI1010, MSI1110 | 4.5 kB | [JsBarcode.msi.min.js][7] | +| Pharmacode | Pharmacode | 4.1 kB | [JsBarcode.pharmacode.min.js][8] | ### Step 2: Include the script in your code: diff --git a/bin/JsBarcode.js b/bin/JsBarcode.js index abdbbf28..b60e0670 100644 --- a/bin/JsBarcode.js +++ b/bin/JsBarcode.js @@ -20,6 +20,12 @@ var _getRenderProperties = require('./help/getRenderProperties.js'); var _getRenderProperties2 = _interopRequireDefault(_getRenderProperties); +var _ErrorHandler = require('./exceptions/ErrorHandler.js'); + +var _ErrorHandler2 = _interopRequireDefault(_ErrorHandler); + +var _exceptions = require('./exceptions/exceptions.js'); + var _defaults = require('./defaults/defaults.js'); var _defaults2 = _interopRequireDefault(_defaults); @@ -38,6 +44,9 @@ var API = function API() {}; // Default values +// Exceptions + + // Help functions var JsBarcode = function JsBarcode(element, text, options) { var api = new API(); @@ -50,6 +59,7 @@ var JsBarcode = function JsBarcode(element, text, options) { api._renderProperties = (0, _getRenderProperties2.default)(element); api._encodings = []; api._options = _defaults2.default; + api._errorHandler = new _ErrorHandler2.default(api); // If text is set, use the simple syntax (render the barcode directly) if (typeof text !== "undefined") { @@ -59,9 +69,7 @@ var JsBarcode = function JsBarcode(element, text, options) { options.format = autoSelectBarcode(); } - api.options(options); - api[options.format](text, options); - api.render(); + api.options(options)[options.format](text, options).render(); } return api; @@ -81,12 +89,15 @@ for (var name in _barcodes2.default) { } function registerBarcode(barcodes, name) { API.prototype[name] = API.prototype[name.toUpperCase()] = API.prototype[name.toLowerCase()] = function (text, options) { - var newOptions = (0, _merge2.default)(this._options, options); - var Encoder = barcodes[name]; - var encoded = encode(text, Encoder, newOptions); - this._encodings.push(encoded); - - return this; + var api = this; + return api._errorHandler.wrapBarcodeCall(function () { + var newOptions = (0, _merge2.default)(api._options, options); + var Encoder = barcodes[name]; + var encoded = encode(text, Encoder, newOptions); + api._encodings.push(encoded); + + return api; + }); }; } @@ -100,11 +111,7 @@ function encode(text, Encoder, options) { // If the input is not valid for the encoder, throw error. // If the valid callback option is set, call it instead of throwing error if (!encoder.valid()) { - if (options.valid === _defaults2.default.valid) { - throw new Error('"' + text + '" is not a valid input.'); - } else { - options.valid(false); - } + throw new _exceptions.InvalidInputException(encoder.constructor.name, text); } // Make a request for the binary data (and other infromation) that should be rendered @@ -182,11 +189,11 @@ API.prototype.render = function () { render(this._renderProperties, this._encodings, this._options); } - this._options.valid(true); - return this; }; +API.prototype._defaults = _defaults2.default; + // Prepares the encodings and calls the renderer function render(renderProperties, encodings, options) { encodings = (0, _linearizeEncodings2.default)(encodings); diff --git a/bin/barcodes/CODE128/CODE128.js b/bin/barcodes/CODE128/CODE128.js index 58c0d85e..d97cd023 100644 --- a/bin/barcodes/CODE128/CODE128.js +++ b/bin/barcodes/CODE128/CODE128.js @@ -8,7 +8,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons // This is the master class, it does require the start code to be // included in the string - var CODE128 = function () { function CODE128(string) { _classCallCheck(this, CODE128); diff --git a/bin/exceptions/ErrorHandler.js b/bin/exceptions/ErrorHandler.js new file mode 100644 index 00000000..69404a6d --- /dev/null +++ b/bin/exceptions/ErrorHandler.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/*eslint no-console: 0 */ + +var ErrorHandler = function () { + function ErrorHandler(api) { + _classCallCheck(this, ErrorHandler); + + this.api = api; + } + + ErrorHandler.prototype.handleCatch = function handleCatch(e) { + // If babel supported extending of Error in a correct way instanceof would be used here + if (e.name === "InvalidInputException") { + if (this.api._options.valid !== this.api._defaults.valid) { + this.api._options.valid(false); + } else { + throw e.message; + } + } else { + throw e; + } + + this.api.render = function () {}; + }; + + ErrorHandler.prototype.wrapBarcodeCall = function wrapBarcodeCall(func) { + try { + var result = func.apply(undefined, arguments); + this.api._options.valid(true); + return result; + } catch (e) { + this.handleCatch(e); + + return this.api; + } + }; + + return ErrorHandler; +}(); + +exports.default = ErrorHandler; \ No newline at end of file diff --git a/bin/exceptions/exceptions.js b/bin/exceptions/exceptions.js new file mode 100644 index 00000000..8453323e --- /dev/null +++ b/bin/exceptions/exceptions.js @@ -0,0 +1,67 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var InvalidInputException = function (_Error) { + _inherits(InvalidInputException, _Error); + + function InvalidInputException(symbology, input) { + _classCallCheck(this, InvalidInputException); + + var _this = _possibleConstructorReturn(this, _Error.call(this)); + + _this.name = "InvalidInputException"; + + _this.symbology = symbology; + _this.input = input; + + _this.message = '"' + _this.input + '" is not a valid input for ' + _this.symbology; + return _this; + } + + return InvalidInputException; +}(Error); + +var InvalidElementException = function (_Error2) { + _inherits(InvalidElementException, _Error2); + + function InvalidElementException() { + _classCallCheck(this, InvalidElementException); + + var _this2 = _possibleConstructorReturn(this, _Error2.call(this)); + + _this2.name = "InvalidElementException"; + _this2.message = "Not supported type to render on"; + return _this2; + } + + return InvalidElementException; +}(Error); + +var NoElementException = function (_Error3) { + _inherits(NoElementException, _Error3); + + function NoElementException() { + _classCallCheck(this, NoElementException); + + var _this3 = _possibleConstructorReturn(this, _Error3.call(this)); + + _this3.name = "NoElementException"; + _this3.message = "No element to render on."; + return _this3; + } + + return NoElementException; +}(Error); + +exports.InvalidInputException = InvalidInputException; +exports.InvalidElementException = InvalidElementException; +exports.NoElementException = NoElementException; \ No newline at end of file diff --git a/bin/help/getRenderProperties.js b/bin/help/getRenderProperties.js index 41d2ebde..edcd66f7 100644 --- a/bin/help/getRenderProperties.js +++ b/bin/help/getRenderProperties.js @@ -10,6 +10,8 @@ var _getOptionsFromElement2 = _interopRequireDefault(_getOptionsFromElement); var _renderers = require("../renderers"); +var _exceptions = require("../exceptions/exceptions.js"); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // Takes an element and returns an object with information about how @@ -23,10 +25,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de // options (optional): Options that can be defined in the element // } -/* global HTMLImageElement */ -/* global HTMLCanvasElement */ -/* global SVGElement */ - function getRenderProperties(element) { // If the element is a string, query select call again if (typeof element === "string") { @@ -67,14 +65,16 @@ function getRenderProperties(element) { renderer: (0, _renderers.getRendererClass)("canvas") }; } else { - throw new Error("Not supported type to render on."); + throw new _exceptions.InvalidElementException(); } -} +} /* global HTMLImageElement */ +/* global HTMLCanvasElement */ +/* global SVGElement */ function querySelectedRenderProperties(string) { var selector = document.querySelectorAll(string); if (selector.length === 0) { - throw new Error("No element found"); + throw new _exceptions.NoElementException(); } else { var returnArray = []; for (var i = 0; i < selector.length; i++) { diff --git a/bower.json b/bower.json index 2e11aef3..0e951680 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "JsBarcode", "main": "dist/JsBarcode.all.min.js", - "version": "3.3.18", + "version": "3.3.20", "homepage": "https://github.com/lindell/JsBarcode", "authors": [ "Johan Lindell " diff --git a/dist/JsBarcode.all.js b/dist/JsBarcode.all.js index 2fce9b0d..c860f17a 100644 --- a/dist/JsBarcode.all.js +++ b/dist/JsBarcode.all.js @@ -45,6 +45,15 @@ /******/ }); /******/ }; +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; + /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; @@ -52,7 +61,7 @@ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 37); +/******/ return __webpack_require__(__webpack_require__.s = 39); /******/ }) /************************************************************************/ /******/ ([ @@ -229,7 +238,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons // This is the master class, it does require the start code to be // included in the string - var CODE128 = function () { function CODE128(string) { _classCallCheck(this, CODE128); @@ -511,6 +519,79 @@ exports.default = defaults; /***/ }, /* 6 */ +/***/ function(module, exports) { + +"use strict"; +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var InvalidInputException = function (_Error) { + _inherits(InvalidInputException, _Error); + + function InvalidInputException(symbology, input) { + _classCallCheck(this, InvalidInputException); + + var _this = _possibleConstructorReturn(this, _Error.call(this)); + + _this.name = "InvalidInputException"; + + _this.symbology = symbology; + _this.input = input; + + _this.message = '"' + _this.input + '" is not a valid input for ' + _this.symbology; + return _this; + } + + return InvalidInputException; +}(Error); + +var InvalidElementException = function (_Error2) { + _inherits(InvalidElementException, _Error2); + + function InvalidElementException() { + _classCallCheck(this, InvalidElementException); + + var _this2 = _possibleConstructorReturn(this, _Error2.call(this)); + + _this2.name = "InvalidElementException"; + _this2.message = "Not supported type to render on"; + return _this2; + } + + return InvalidElementException; +}(Error); + +var NoElementException = function (_Error3) { + _inherits(NoElementException, _Error3); + + function NoElementException() { + _classCallCheck(this, NoElementException); + + var _this3 = _possibleConstructorReturn(this, _Error3.call(this)); + + _this3.name = "NoElementException"; + _this3.message = "No element to render on."; + return _this3; + } + + return NoElementException; +}(Error); + +exports.InvalidInputException = InvalidInputException; +exports.InvalidElementException = InvalidElementException; +exports.NoElementException = NoElementException; + +/***/ }, +/* 7 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -601,7 +682,7 @@ exports.calculateEncodingAttributes = calculateEncodingAttributes; exports.getTotalWidthOfEncodings = getTotalWidthOfEncodings; /***/ }, -/* 7 */ +/* 8 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -611,21 +692,21 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _CODE = __webpack_require__(16); +var _CODE = __webpack_require__(18); -var _CODE2 = __webpack_require__(15); +var _CODE2 = __webpack_require__(17); -var _EAN_UPC = __webpack_require__(22); +var _EAN_UPC = __webpack_require__(24); -var _ITF = __webpack_require__(25); +var _ITF = __webpack_require__(27); -var _ITF2 = __webpack_require__(24); +var _ITF2 = __webpack_require__(26); -var _MSI = __webpack_require__(30); +var _MSI = __webpack_require__(32); -var _pharmacode = __webpack_require__(31); +var _pharmacode = __webpack_require__(33); -var _GenericBarcode = __webpack_require__(23); +var _GenericBarcode = __webpack_require__(25); exports.default = { CODE39: _CODE.CODE39, @@ -639,7 +720,61 @@ exports.default = { }; /***/ }, -/* 8 */ +/* 9 */ +/***/ function(module, exports) { + +"use strict"; +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/*eslint no-console: 0 */ + +var ErrorHandler = function () { + function ErrorHandler(api) { + _classCallCheck(this, ErrorHandler); + + this.api = api; + } + + ErrorHandler.prototype.handleCatch = function handleCatch(e) { + // If babel supported extending of Error in a correct way instanceof would be used here + if (e.name === "InvalidInputException") { + if (this.api._options.valid !== this.api._defaults.valid) { + this.api._options.valid(false); + } else { + throw e.message; + } + } else { + throw e; + } + + this.api.render = function () {}; + }; + + ErrorHandler.prototype.wrapBarcodeCall = function wrapBarcodeCall(func) { + try { + var result = func.apply(undefined, arguments); + this.api._options.valid(true); + return result; + } catch (e) { + this.handleCatch(e); + + return this.api; + } + }; + + return ErrorHandler; +}(); + +exports.default = ErrorHandler; + +/***/ }, +/* 10 */ /***/ function(module, exports) { "use strict"; @@ -662,7 +797,7 @@ function fixOptions(options) { } /***/ }, -/* 9 */ +/* 11 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -672,11 +807,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _getOptionsFromElement = __webpack_require__(32); +var _getOptionsFromElement = __webpack_require__(34); var _getOptionsFromElement2 = _interopRequireDefault(_getOptionsFromElement); -var _renderers = __webpack_require__(35); +var _renderers = __webpack_require__(37); + +var _exceptions = __webpack_require__(6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -691,10 +828,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de // options (optional): Options that can be defined in the element // } -/* global HTMLImageElement */ -/* global HTMLCanvasElement */ -/* global SVGElement */ - function getRenderProperties(element) { // If the element is a string, query select call again if (typeof element === "string") { @@ -735,14 +868,16 @@ function getRenderProperties(element) { renderer: (0, _renderers.getRendererClass)("canvas") }; } else { - throw new Error("Not supported type to render on."); + throw new _exceptions.InvalidElementException(); } -} +} /* global HTMLImageElement */ +/* global HTMLCanvasElement */ +/* global SVGElement */ function querySelectedRenderProperties(string) { var selector = document.querySelectorAll(string); if (selector.length === 0) { - throw new Error("No element found"); + throw new _exceptions.NoElementException(); } else { var returnArray = []; for (var i = 0; i < selector.length; i++) { @@ -767,7 +902,7 @@ function newCanvasRenderProperties(imgElement) { exports.default = getRenderProperties; /***/ }, -/* 10 */ +/* 12 */ /***/ function(module, exports) { "use strict"; @@ -800,7 +935,7 @@ function linearizeEncodings(encodings) { } /***/ }, -/* 11 */ +/* 13 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -841,7 +976,7 @@ var CODE128A = function (_CODE) { exports.default = CODE128A; /***/ }, -/* 12 */ +/* 14 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -882,7 +1017,7 @@ var CODE128B = function (_CODE) { exports.default = CODE128B; /***/ }, -/* 13 */ +/* 15 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -923,7 +1058,7 @@ var CODE128C = function (_CODE) { exports.default = CODE128C; /***/ }, -/* 14 */ +/* 16 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -1043,7 +1178,7 @@ function autoSelectFromC(string) { exports.default = CODE128AUTO; /***/ }, -/* 15 */ +/* 17 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -1054,19 +1189,19 @@ Object.defineProperty(exports, "__esModule", { }); exports.CODE128C = exports.CODE128B = exports.CODE128A = exports.CODE128 = undefined; -var _CODE128_AUTO = __webpack_require__(14); +var _CODE128_AUTO = __webpack_require__(16); var _CODE128_AUTO2 = _interopRequireDefault(_CODE128_AUTO); -var _CODE128A = __webpack_require__(11); +var _CODE128A = __webpack_require__(13); var _CODE128A2 = _interopRequireDefault(_CODE128A); -var _CODE128B = __webpack_require__(12); +var _CODE128B = __webpack_require__(14); var _CODE128B2 = _interopRequireDefault(_CODE128B); -var _CODE128C = __webpack_require__(13); +var _CODE128C = __webpack_require__(15); var _CODE128C2 = _interopRequireDefault(_CODE128C); @@ -1078,7 +1213,7 @@ exports.CODE128B = _CODE128B2.default; exports.CODE128C = _CODE128C2.default; /***/ }, -/* 16 */ +/* 18 */ /***/ function(module, exports) { "use strict"; @@ -1173,7 +1308,7 @@ var CODE39 = function () { exports.CODE39 = CODE39; /***/ }, -/* 17 */ +/* 19 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -1316,7 +1451,7 @@ var EAN13 = function () { exports.default = EAN13; /***/ }, -/* 18 */ +/* 20 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -1372,7 +1507,7 @@ var EAN2 = function () { exports.default = EAN2; /***/ }, -/* 19 */ +/* 21 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -1439,7 +1574,7 @@ var EAN5 = function () { exports.default = EAN5; /***/ }, -/* 20 */ +/* 22 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -1531,7 +1666,7 @@ var EAN8 = function () { exports.default = EAN8; /***/ }, -/* 21 */ +/* 23 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -1659,7 +1794,7 @@ var UPC = function () { exports.default = UPC; /***/ }, -/* 22 */ +/* 24 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -1670,23 +1805,23 @@ Object.defineProperty(exports, "__esModule", { }); exports.UPC = exports.EAN2 = exports.EAN5 = exports.EAN8 = exports.EAN13 = undefined; -var _EAN = __webpack_require__(17); +var _EAN = __webpack_require__(19); var _EAN2 = _interopRequireDefault(_EAN); -var _EAN3 = __webpack_require__(20); +var _EAN3 = __webpack_require__(22); var _EAN4 = _interopRequireDefault(_EAN3); -var _EAN5 = __webpack_require__(19); +var _EAN5 = __webpack_require__(21); var _EAN6 = _interopRequireDefault(_EAN5); -var _EAN7 = __webpack_require__(18); +var _EAN7 = __webpack_require__(20); var _EAN8 = _interopRequireDefault(_EAN7); -var _UPC = __webpack_require__(21); +var _UPC = __webpack_require__(23); var _UPC2 = _interopRequireDefault(_UPC); @@ -1699,7 +1834,7 @@ exports.EAN2 = _EAN8.default; exports.UPC = _UPC2.default; /***/ }, -/* 23 */ +/* 25 */ /***/ function(module, exports) { "use strict"; @@ -1741,7 +1876,7 @@ var GenericBarcode = function () { exports.GenericBarcode = GenericBarcode; /***/ }, -/* 24 */ +/* 26 */ /***/ function(module, exports) { "use strict"; @@ -1819,7 +1954,7 @@ var ITF = function () { exports.ITF = ITF; /***/ }, -/* 25 */ +/* 27 */ /***/ function(module, exports) { "use strict"; @@ -1914,7 +2049,7 @@ var ITF14 = function () { exports.ITF14 = ITF14; /***/ }, -/* 26 */ +/* 28 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -1956,7 +2091,7 @@ var MSI10 = function (_MSI) { exports.default = MSI10; /***/ }, -/* 27 */ +/* 29 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -1999,7 +2134,7 @@ var MSI1010 = function (_MSI) { exports.default = MSI1010; /***/ }, -/* 28 */ +/* 30 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -2041,7 +2176,7 @@ var MSI11 = function (_MSI) { exports.default = MSI11; /***/ }, -/* 29 */ +/* 31 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -2084,7 +2219,7 @@ var MSI1110 = function (_MSI) { exports.default = MSI1110; /***/ }, -/* 30 */ +/* 32 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -2099,19 +2234,19 @@ var _MSI = __webpack_require__(1); var _MSI2 = _interopRequireDefault(_MSI); -var _MSI3 = __webpack_require__(26); +var _MSI3 = __webpack_require__(28); var _MSI4 = _interopRequireDefault(_MSI3); -var _MSI5 = __webpack_require__(28); +var _MSI5 = __webpack_require__(30); var _MSI6 = _interopRequireDefault(_MSI5); -var _MSI7 = __webpack_require__(27); +var _MSI7 = __webpack_require__(29); var _MSI8 = _interopRequireDefault(_MSI7); -var _MSI9 = __webpack_require__(29); +var _MSI9 = __webpack_require__(31); var _MSI10 = _interopRequireDefault(_MSI9); @@ -2124,7 +2259,7 @@ exports.MSI1010 = _MSI8.default; exports.MSI1110 = _MSI10.default; /***/ }, -/* 31 */ +/* 33 */ /***/ function(module, exports) { "use strict"; @@ -2183,7 +2318,7 @@ var pharmacode = function () { exports.pharmacode = pharmacode; /***/ }, -/* 32 */ +/* 34 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -2193,7 +2328,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _optionsFromStrings = __webpack_require__(33); +var _optionsFromStrings = __webpack_require__(35); var _optionsFromStrings2 = _interopRequireDefault(_optionsFromStrings); @@ -2230,7 +2365,7 @@ function getOptionsFromElement(element) { exports.default = getOptionsFromElement; /***/ }, -/* 33 */ +/* 35 */ /***/ function(module, exports) { "use strict"; @@ -2263,7 +2398,7 @@ function optionsFromStrings(options) { } /***/ }, -/* 34 */ +/* 36 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -2277,7 +2412,7 @@ var _merge = __webpack_require__(2); var _merge2 = _interopRequireDefault(_merge); -var _shared = __webpack_require__(6); +var _shared = __webpack_require__(7); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -2417,7 +2552,7 @@ var CanvasRenderer = function () { exports.default = CanvasRenderer; /***/ }, -/* 35 */ +/* 37 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -2428,11 +2563,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.getRendererClass = undefined; -var _canvas = __webpack_require__(34); +var _canvas = __webpack_require__(36); var _canvas2 = _interopRequireDefault(_canvas); -var _svg = __webpack_require__(36); +var _svg = __webpack_require__(38); var _svg2 = _interopRequireDefault(_svg); @@ -2452,7 +2587,7 @@ function getRendererClass(name) { exports.getRendererClass = getRendererClass; /***/ }, -/* 36 */ +/* 38 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -2466,7 +2601,7 @@ var _merge = __webpack_require__(2); var _merge2 = _interopRequireDefault(_merge); -var _shared = __webpack_require__(6); +var _shared = __webpack_require__(7); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -2633,13 +2768,13 @@ function drawLine(x, y, width, height, parent) { exports.default = SVGRenderer; /***/ }, -/* 37 */ +/* 39 */ /***/ function(module, exports, __webpack_require__) { "use strict"; 'use strict'; -var _barcodes = __webpack_require__(7); +var _barcodes = __webpack_require__(8); var _barcodes2 = _interopRequireDefault(_barcodes); @@ -2647,18 +2782,24 @@ var _merge = __webpack_require__(2); var _merge2 = _interopRequireDefault(_merge); -var _linearizeEncodings = __webpack_require__(10); +var _linearizeEncodings = __webpack_require__(12); var _linearizeEncodings2 = _interopRequireDefault(_linearizeEncodings); -var _fixOptions = __webpack_require__(8); +var _fixOptions = __webpack_require__(10); var _fixOptions2 = _interopRequireDefault(_fixOptions); -var _getRenderProperties = __webpack_require__(9); +var _getRenderProperties = __webpack_require__(11); var _getRenderProperties2 = _interopRequireDefault(_getRenderProperties); +var _ErrorHandler = __webpack_require__(9); + +var _ErrorHandler2 = _interopRequireDefault(_ErrorHandler); + +var _exceptions = __webpack_require__(6); + var _defaults = __webpack_require__(5); var _defaults2 = _interopRequireDefault(_defaults); @@ -2677,6 +2818,9 @@ var API = function API() {}; // Default values +// Exceptions + + // Help functions var JsBarcode = function JsBarcode(element, text, options) { var api = new API(); @@ -2689,6 +2833,7 @@ var JsBarcode = function JsBarcode(element, text, options) { api._renderProperties = (0, _getRenderProperties2.default)(element); api._encodings = []; api._options = _defaults2.default; + api._errorHandler = new _ErrorHandler2.default(api); // If text is set, use the simple syntax (render the barcode directly) if (typeof text !== "undefined") { @@ -2698,9 +2843,7 @@ var JsBarcode = function JsBarcode(element, text, options) { options.format = autoSelectBarcode(); } - api.options(options); - api[options.format](text, options); - api.render(); + api.options(options)[options.format](text, options).render(); } return api; @@ -2720,12 +2863,15 @@ for (var name in _barcodes2.default) { } function registerBarcode(barcodes, name) { API.prototype[name] = API.prototype[name.toUpperCase()] = API.prototype[name.toLowerCase()] = function (text, options) { - var newOptions = (0, _merge2.default)(this._options, options); - var Encoder = barcodes[name]; - var encoded = encode(text, Encoder, newOptions); - this._encodings.push(encoded); - - return this; + var api = this; + return api._errorHandler.wrapBarcodeCall(function () { + var newOptions = (0, _merge2.default)(api._options, options); + var Encoder = barcodes[name]; + var encoded = encode(text, Encoder, newOptions); + api._encodings.push(encoded); + + return api; + }); }; } @@ -2739,11 +2885,7 @@ function encode(text, Encoder, options) { // If the input is not valid for the encoder, throw error. // If the valid callback option is set, call it instead of throwing error if (!encoder.valid()) { - if (options.valid === _defaults2.default.valid) { - throw new Error('"' + text + '" is not a valid input.'); - } else { - options.valid(false); - } + throw new _exceptions.InvalidInputException(encoder.constructor.name, text); } // Make a request for the binary data (and other infromation) that should be rendered @@ -2821,11 +2963,11 @@ API.prototype.render = function () { render(this._renderProperties, this._encodings, this._options); } - this._options.valid(true); - return this; }; +API.prototype._defaults = _defaults2.default; + // Prepares the encodings and calls the renderer function render(renderProperties, encodings, options) { encodings = (0, _linearizeEncodings2.default)(encodings); diff --git a/dist/JsBarcode.all.min.js b/dist/JsBarcode.all.min.js index bc90da99..0f75a278 100644 --- a/dist/JsBarcode.all.min.js +++ b/dist/JsBarcode.all.min.js @@ -1,2 +1,2 @@ -!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,e,n){Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=37)}([function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){n(this,t),this.startBin="101",this.endBin="101",this.middleBin="01010",this.Lbinary=["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],this.Gbinary=["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],this.Rbinary=["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"]}return t.prototype.encode=function(t,e,n){var r="";n=n||"";for(var i=0;i=200)r=t[0]-105,t.shift(),99===r?n=this.nextC(t,e+1):100===r?n=this.nextB(t,e+1):98===r?(t[0]=t[0]>95?t[0]-96:t[0],n=this.nextA(t,e+1)):n=this.nextA(t,e+1);else{var i=t[0];r=i<32?i+64:i-32,t.shift(),n=this.nextA(t,e+1)}var o=this.getEncoding(r),s=r*e;return{result:o+n.result,checksum:s+n.checksum}},t.prototype.nextB=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;t[0]>=200?(r=t[0]-105,t.shift(),99===r?n=this.nextC(t,e+1):101===r?n=this.nextA(t,e+1):98===r?(t[0]=t[0]<32?t[0]+96:t[0],n=this.nextB(t,e+1)):n=this.nextB(t,e+1)):(r=t[0]-32,t.shift(),n=this.nextB(t,e+1));var i=this.getEncoding(r),o=r*e;return{result:i+n.result,checksum:o+n.checksum}},t.prototype.nextC=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;t[0]>=200?(r=t[0]-105,t.shift(),n=100===r?this.nextB(t,e+1):101===r?this.nextA(t,e+1):this.nextC(t,e+1)):(r=10*(t[0]-48)+t[1]-48,t.shift(),t.shift(),n=this.nextC(t,e+1));var i=this.getEncoding(r),o=r*e;return{result:i+n.result,checksum:o+n.checksum}},t}();e["default"]=r},function(t,e){"use strict";function n(t){for(var e=0,n=0;n0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function c(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t).width;return i}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var f=n(2),h=r(f);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=i,e.getBarcodePadding=o,e.calculateEncodingAttributes=s,e.getTotalWidthOfEncodings=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(16),i=n(15),o=n(22),s=n(25),a=n(24),u=n(30),c=n(31),f=n(23);e["default"]={CODE39:r.CODE39,CODE128:i.CODE128,CODE128A:i.CODE128A,CODE128B:i.CODE128B,CODE128C:i.CODE128C,EAN13:o.EAN13,EAN8:o.EAN8,EAN5:o.EAN5,EAN2:o.EAN2,UPC:o.UPC,ITF14:s.ITF14,ITF:a.ITF,MSI:u.MSI,MSI10:u.MSI10,MSI11:u.MSI11,MSI1010:u.MSI1010,MSI1110:u.MSI1110,pharmacode:c.pharmacode,GenericBarcode:f.GenericBarcode}},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n=2?String.fromCharCode(210)+f(t):n>r?String.fromCharCode(208)+u(t):String.fromCharCode(209)+c(t),e=e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,e){return String.fromCharCode(203)+e})}function u(t){var e=t.match(/^([\x00-\x5F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(e)return e[1]+String.fromCharCode(204)+f(t.substring(e[1].length));var n=t.match(/^[\x00-\x5F\xC8-\xCF]+/);return n[0].length===t.length?t:n[0]+String.fromCharCode(205)+c(t.substring(n[0].length))}function c(t){var e=t.match(/^([\x20-\x7F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(e)return e[1]+String.fromCharCode(204)+f(t.substring(e[1].length));var n=t.match(/^[\x20-\x7F\xC8-\xCF]+/);return n[0].length===t.length?t:n[0]+String.fromCharCode(206)+u(t.substring(n[0].length))}function f(t){var e=t.match(/^(\xCF*[0-9]{2}\xCF*)+/)[0],n=e.length;if(n===t.length)return t;t=t.substring(n);var r=t.match(/^[\x00-\x5F\xC8-\xCF]*/)[0].length,i=t.match(/^[\x20-\x7F\xC8-\xCF]*/)[0].length;return r>=i?e+String.fromCharCode(206)+u(t):e+String.fromCharCode(205)+c(t)}Object.defineProperty(e,"__esModule",{value:!0});var h=n(3),l=r(h),d=function(t){function e(n){if(i(this,e),n.search(/^[\x00-\x7F\xC8-\xD3]+$/)!==-1)var r=o(this,t.call(this,a(n)));else var r=o(this,t.call(this,n));return o(r)}return s(e,t),e}(l["default"]);e["default"]=d},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 i=n(14),o=r(i),s=n(11),a=r(s),u=n(12),c=r(u),f=n(13),h=r(f);e.CODE128=o["default"],e.CODE128A=a["default"],e.CODE128B=c["default"],e.CODE128C=h["default"]},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e,r){n(this,t),this.string=e.toUpperCase(),this.mod43Enabled=r.mod43||!1,this.characters=["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","-","."," ","$","/","+","%","*"],this.encodings=[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]}return t.prototype.getEncoding=function(t){return this.getBinary(this.characterValue(t))},t.prototype.getBinary=function(t){return this.encodings[t].toString(2)},t.prototype.getCharacter=function(t){return this.characters[t]},t.prototype.characterValue=function(t){return this.characters.indexOf(t)},t.prototype.encode=function(){for(var t=this.string,e=this.getEncoding("*"),n=0;n10*n.width?this.fontSize=10*n.width:this.fontSize=n.fontSize,this.guardHeight=n.height+this.fontSize/2+n.textMargin,this.lastChar=n.lastChar}return t.prototype.valid=function(){return this.string.search(/^[0-9]{13}$/)!==-1&&this.string[12]==this.checksum(this.string)},t.prototype.encode=function(){var t=new s["default"],e=[],n=this.structure[this.string[0]],r=this.string.substr(1,6),i=this.string.substr(7,6);return this.displayValue&&e.push({data:"000000000000",text:this.string[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),e.push({data:t.encode(r,n),text:r,options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:t.encode(i,"RRRRRR"),text:i,options:{fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),this.lastChar&&this.displayValue&&(e.push({data:"00"}),e.push({data:"00000",text:this.lastChar,options:{fontSize:this.fontSize}})),e},t.prototype.checksum=function(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},t}();e["default"]=a},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),s=r(o),a=function(){function t(e){i(this,t),this.string=e,this.structure=["LL","LG","GL","GG"]}return t.prototype.valid=function(){return this.string.search(/^[0-9]{2}$/)!==-1},t.prototype.encode=function(){var t=new s["default"],e=this.structure[parseInt(this.string)%4],n="1011";return n+=t.encode(this.string,e,"01"),{data:n,text:this.string}},t}();e["default"]=a},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),s=r(o),a=function(){function t(e){i(this,t),this.string=e,this.structure=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"]}return t.prototype.valid=function(){return this.string.search(/^[0-9]{5}$/)!==-1},t.prototype.encode=function(){var t=new s["default"],e=this.checksum(),n="1011";return n+=t.encode(this.string,this.structure[e],"01"),{data:n,text:this.string}},t.prototype.checksum=function(){var t=0;return t+=3*parseInt(this.string[0]),t+=9*parseInt(this.string[1]),t+=3*parseInt(this.string[2]),t+=9*parseInt(this.string[3]),t+=3*parseInt(this.string[4]),t%10},t}();e["default"]=a},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),s=r(o),a=function(){function t(e){i(this,t),e.search(/^[0-9]{7}$/)!==-1?this.string=e+this.checksum(e):this.string=e}return t.prototype.valid=function(){return this.string.search(/^[0-9]{8}$/)!==-1&&this.string[7]==this.checksum(this.string)},t.prototype.encode=function(){var t=new s["default"],e="",n=this.string.substr(0,4),r=this.string.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.string}},t.prototype.checksum=function(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},t}();e["default"]=a},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),s=r(o),a=function(){function t(e,n){i(this,t),e.search(/^[0-9]{11}$/)!==-1?this.string=e+this.checksum(e):this.string=e,this.displayValue=n.displayValue,n.fontSize>10*n.width?this.fontSize=10*n.width:this.fontSize=n.fontSize,this.guardHeight=n.height+this.fontSize/2+n.textMargin}return t.prototype.valid=function(){return this.string.search(/^[0-9]{12}$/)!==-1&&this.string[11]==this.checksum(this.string)},t.prototype.encode=function(){var t=new s["default"],e=[];return this.displayValue&&e.push({data:"00000000",text:this.string[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101"+t.encode(this.string[0],"L"),options:{height:this.guardHeight}}),e.push({data:t.encode(this.string.substr(1,5),"LLLLL"),text:this.string.substr(1,5),options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:t.encode(this.string.substr(6,5),"RRRRR"),text:this.string.substr(6,5),options:{fontSize:this.fontSize}}),e.push({data:t.encode(this.string[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&e.push({data:"00000000",text:this.string[11],options:{textAlign:"right",fontSize:this.fontSize}}),e},t.prototype.checksum=function(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},t}();e["default"]=a},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.UPC=e.EAN2=e.EAN5=e.EAN8=e.EAN13=void 0;var i=n(17),o=r(i),s=n(20),a=r(s),u=n(19),c=r(u),f=n(18),h=r(f),l=n(21),d=r(l);e.EAN13=o["default"],e.EAN8=a["default"],e.EAN5=c["default"],e.EAN2=h["default"],e.UPC=d["default"]},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.string=e}return t.prototype.encode=function(){return{data:"10101010101010101010101010101010101010101",text:this.string}},t.prototype.valid=function(){return!0},t}();e.GenericBarcode=r},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.string=e,this.binaryRepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"}}return t.prototype.valid=function(){return this.string.search(/^([0-9]{2})+$/)!==-1},t.prototype.encode=function(){for(var t="1010",e=0;e=3&&this.number<=131070},t}();e.pharmacode=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e={};for(var n in u["default"])u["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,s["default"])(e)}Object.defineProperty(e,"__esModule",{value:!0});var o=n(33),s=r(o),a=n(5),u=r(a);e["default"]=i},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),s=r(o),a=n(6),u=function(){function t(e,n,r){i(this,t),this.canvas=e,this.encodings=n,this.options=r}return t.prototype.render=function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t0?(i=0,n.textAlign="left"):"right"==t.textAlign?(i=e.width-1,n.textAlign="right"):(i=e.width/2,n.textAlign="center"),n.fillText(e.text,i,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){switch(t){case"canvas":return s["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(34),s=r(o),a=n(36),u=r(a);e.getRendererClass=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=document.createElementNS(h,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function s(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function a(t,e,n,r,i){ -var o=document.createElementNS(h,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(2),c=r(u),f=n(6),h="http://www.w3.org/2000/svg",l=function(){function t(e,n,r){i(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(a(s-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&a(s-e.width*(o-1),r,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(h,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",h),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){m.prototype[e]=m.prototype[e.toUpperCase()]=m.prototype[e.toLowerCase()]=function(n,r){var i=(0,h["default"])(this._options,r),s=t[e],a=o(n,s,i);return this._encodings.push(a),this}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid()){if(n.valid===x["default"].valid)throw new Error('"'+t+'" is not a valid input.');n.valid(!1)}var i=r.encode();i=(0,d["default"])(i);for(var o=0;o=200)r=t[0]-105,t.shift(),99===r?n=this.nextC(t,e+1):100===r?n=this.nextB(t,e+1):98===r?(t[0]=t[0]>95?t[0]-96:t[0],n=this.nextA(t,e+1)):n=this.nextA(t,e+1);else{var i=t[0];r=i<32?i+64:i-32,t.shift(),n=this.nextA(t,e+1)}var o=this.getEncoding(r),s=r*e;return{result:o+n.result,checksum:s+n.checksum}},t.prototype.nextB=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;t[0]>=200?(r=t[0]-105,t.shift(),99===r?n=this.nextC(t,e+1):101===r?n=this.nextA(t,e+1):98===r?(t[0]=t[0]<32?t[0]+96:t[0],n=this.nextB(t,e+1)):n=this.nextB(t,e+1)):(r=t[0]-32,t.shift(),n=this.nextB(t,e+1));var i=this.getEncoding(r),o=r*e;return{result:i+n.result,checksum:o+n.checksum}},t.prototype.nextC=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;t[0]>=200?(r=t[0]-105,t.shift(),n=100===r?this.nextB(t,e+1):101===r?this.nextA(t,e+1):this.nextC(t,e+1)):(r=10*(t[0]-48)+t[1]-48,t.shift(),t.shift(),n=this.nextC(t,e+1));var i=this.getEncoding(r),o=r*e;return{result:i+n.result,checksum:o+n.checksum}},t}();e["default"]=r},function(t,e){"use strict";function n(t){for(var e=0,n=0;n0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function c(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t).width;return i}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var f=n(2),h=r(f);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=i,e.getBarcodePadding=o,e.calculateEncodingAttributes=s,e.getTotalWidthOfEncodings=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(18),i=n(17),o=n(24),s=n(27),a=n(26),u=n(32),c=n(33),f=n(25);e["default"]={CODE39:r.CODE39,CODE128:i.CODE128,CODE128A:i.CODE128A,CODE128B:i.CODE128B,CODE128C:i.CODE128C,EAN13:o.EAN13,EAN8:o.EAN8,EAN5:o.EAN5,EAN2:o.EAN2,UPC:o.UPC,ITF14:s.ITF14,ITF:a.ITF,MSI:u.MSI,MSI10:u.MSI10,MSI11:u.MSI11,MSI1010:u.MSI1010,MSI1110:u.MSI1110,pharmacode:c.pharmacode,GenericBarcode:f.GenericBarcode}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.api=e}return t.prototype.handleCatch=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(){}},t.prototype.wrapBarcodeCall=function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(n){return this.handleCatch(n),this.api}},t}();e["default"]=r},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n=2?String.fromCharCode(210)+f(t):n>r?String.fromCharCode(208)+u(t):String.fromCharCode(209)+c(t),e=e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,e){return String.fromCharCode(203)+e})}function u(t){var e=t.match(/^([\x00-\x5F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(e)return e[1]+String.fromCharCode(204)+f(t.substring(e[1].length));var n=t.match(/^[\x00-\x5F\xC8-\xCF]+/);return n[0].length===t.length?t:n[0]+String.fromCharCode(205)+c(t.substring(n[0].length))}function c(t){var e=t.match(/^([\x20-\x7F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(e)return e[1]+String.fromCharCode(204)+f(t.substring(e[1].length));var n=t.match(/^[\x20-\x7F\xC8-\xCF]+/);return n[0].length===t.length?t:n[0]+String.fromCharCode(206)+u(t.substring(n[0].length))}function f(t){var e=t.match(/^(\xCF*[0-9]{2}\xCF*)+/)[0],n=e.length;if(n===t.length)return t;t=t.substring(n);var r=t.match(/^[\x00-\x5F\xC8-\xCF]*/)[0].length,i=t.match(/^[\x20-\x7F\xC8-\xCF]*/)[0].length;return r>=i?e+String.fromCharCode(206)+u(t):e+String.fromCharCode(205)+c(t)}Object.defineProperty(e,"__esModule",{value:!0});var h=n(3),l=r(h),d=function(t){function e(n){if(i(this,e),n.search(/^[\x00-\x7F\xC8-\xD3]+$/)!==-1)var r=o(this,t.call(this,a(n)));else var r=o(this,t.call(this,n));return o(r)}return s(e,t),e}(l["default"]);e["default"]=d},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 i=n(16),o=r(i),s=n(13),a=r(s),u=n(14),c=r(u),f=n(15),h=r(f);e.CODE128=o["default"],e.CODE128A=a["default"],e.CODE128B=c["default"],e.CODE128C=h["default"]},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e,r){n(this,t),this.string=e.toUpperCase(),this.mod43Enabled=r.mod43||!1,this.characters=["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","-","."," ","$","/","+","%","*"],this.encodings=[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]}return t.prototype.getEncoding=function(t){return this.getBinary(this.characterValue(t))},t.prototype.getBinary=function(t){return this.encodings[t].toString(2)},t.prototype.getCharacter=function(t){return this.characters[t]},t.prototype.characterValue=function(t){return this.characters.indexOf(t)},t.prototype.encode=function(){for(var t=this.string,e=this.getEncoding("*"),n=0;n10*n.width?this.fontSize=10*n.width:this.fontSize=n.fontSize,this.guardHeight=n.height+this.fontSize/2+n.textMargin,this.lastChar=n.lastChar}return t.prototype.valid=function(){return this.string.search(/^[0-9]{13}$/)!==-1&&this.string[12]==this.checksum(this.string)},t.prototype.encode=function(){var t=new s["default"],e=[],n=this.structure[this.string[0]],r=this.string.substr(1,6),i=this.string.substr(7,6);return this.displayValue&&e.push({data:"000000000000",text:this.string[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),e.push({data:t.encode(r,n),text:r,options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:t.encode(i,"RRRRRR"),text:i,options:{fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),this.lastChar&&this.displayValue&&(e.push({data:"00"}),e.push({data:"00000",text:this.lastChar,options:{fontSize:this.fontSize}})),e},t.prototype.checksum=function(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},t}();e["default"]=a},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),s=r(o),a=function(){function t(e){i(this,t),this.string=e,this.structure=["LL","LG","GL","GG"]}return t.prototype.valid=function(){return this.string.search(/^[0-9]{2}$/)!==-1},t.prototype.encode=function(){var t=new s["default"],e=this.structure[parseInt(this.string)%4],n="1011";return n+=t.encode(this.string,e,"01"),{data:n,text:this.string}},t}();e["default"]=a},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),s=r(o),a=function(){function t(e){i(this,t),this.string=e,this.structure=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"]}return t.prototype.valid=function(){return this.string.search(/^[0-9]{5}$/)!==-1},t.prototype.encode=function(){var t=new s["default"],e=this.checksum(),n="1011";return n+=t.encode(this.string,this.structure[e],"01"),{data:n,text:this.string}},t.prototype.checksum=function(){var t=0;return t+=3*parseInt(this.string[0]),t+=9*parseInt(this.string[1]),t+=3*parseInt(this.string[2]),t+=9*parseInt(this.string[3]),t+=3*parseInt(this.string[4]),t%10},t}();e["default"]=a},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),s=r(o),a=function(){function t(e){i(this,t),e.search(/^[0-9]{7}$/)!==-1?this.string=e+this.checksum(e):this.string=e}return t.prototype.valid=function(){return this.string.search(/^[0-9]{8}$/)!==-1&&this.string[7]==this.checksum(this.string)},t.prototype.encode=function(){var t=new s["default"],e="",n=this.string.substr(0,4),r=this.string.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.string}},t.prototype.checksum=function(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},t}();e["default"]=a},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),s=r(o),a=function(){function t(e,n){i(this,t),e.search(/^[0-9]{11}$/)!==-1?this.string=e+this.checksum(e):this.string=e,this.displayValue=n.displayValue,n.fontSize>10*n.width?this.fontSize=10*n.width:this.fontSize=n.fontSize,this.guardHeight=n.height+this.fontSize/2+n.textMargin}return t.prototype.valid=function(){return this.string.search(/^[0-9]{12}$/)!==-1&&this.string[11]==this.checksum(this.string)},t.prototype.encode=function(){var t=new s["default"],e=[];return this.displayValue&&e.push({data:"00000000",text:this.string[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101"+t.encode(this.string[0],"L"),options:{height:this.guardHeight}}),e.push({data:t.encode(this.string.substr(1,5),"LLLLL"),text:this.string.substr(1,5),options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:t.encode(this.string.substr(6,5),"RRRRR"),text:this.string.substr(6,5),options:{fontSize:this.fontSize}}),e.push({data:t.encode(this.string[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&e.push({data:"00000000",text:this.string[11],options:{textAlign:"right",fontSize:this.fontSize}}),e},t.prototype.checksum=function(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},t}();e["default"]=a},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.UPC=e.EAN2=e.EAN5=e.EAN8=e.EAN13=void 0;var i=n(19),o=r(i),s=n(22),a=r(s),u=n(21),c=r(u),f=n(20),h=r(f),l=n(23),d=r(l);e.EAN13=o["default"],e.EAN8=a["default"],e.EAN5=c["default"],e.EAN2=h["default"],e.UPC=d["default"]},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.string=e}return t.prototype.encode=function(){return{data:"10101010101010101010101010101010101010101",text:this.string}},t.prototype.valid=function(){return!0},t}();e.GenericBarcode=r},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.string=e,this.binaryRepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"}}return t.prototype.valid=function(){return this.string.search(/^([0-9]{2})+$/)!==-1},t.prototype.encode=function(){for(var t="1010",e=0;e=3&&this.number<=131070},t}();e.pharmacode=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e={};for(var n in u["default"])u["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,s["default"])(e)}Object.defineProperty(e,"__esModule",{value:!0});var o=n(35),s=r(o),a=n(5),u=r(a);e["default"]=i},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),s=r(o),a=n(7),u=function(){function t(e,n,r){i(this,t),this.canvas=e,this.encodings=n,this.options=r}return t.prototype.render=function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t0?(i=0,n.textAlign="left"):"right"==t.textAlign?(i=e.width-1,n.textAlign="right"):(i=e.width/2,n.textAlign="center"),n.fillText(e.text,i,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){switch(t){case"canvas":return s["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(36),s=r(o),a=n(38),u=r(a);e.getRendererClass=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=document.createElementNS(h,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function s(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function a(t,e,n,r,i){var o=document.createElementNS(h,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(2),c=r(u),f=n(7),h="http://www.w3.org/2000/svg",l=function(){function t(e,n,r){i(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(a(s-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&a(s-e.width*(o-1),r,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(h,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",h),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){C.prototype[e]=C.prototype[e.toUpperCase()]=C.prototype[e.toLowerCase()]=function(n,r){var i=this;return i._errorHandler.wrapBarcodeCall(function(){var s=(0,h["default"])(i._options,r),a=t[e],u=o(n,a,s);return i._encodings.push(u),i})}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid())throw new x.InvalidInputException(r.constructor.name,t);var i=r.encode();i=(0,d["default"])(i);for(var o=0;o=200)r=t[0]-105,t.shift(),99===r?n=this.nextC(t,e+1):100===r?n=this.nextB(t,e+1):98===r?(t[0]=t[0]>95?t[0]-96:t[0],n=this.nextA(t,e+1)):n=this.nextA(t,e+1);else{var i=t[0];r=i<32?i+64:i-32,t.shift(),n=this.nextA(t,e+1)}var o=this.getEncoding(r),a=r*e;return{result:o+n.result,checksum:a+n.checksum}},t.prototype.nextB=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;t[0]>=200?(r=t[0]-105,t.shift(),99===r?n=this.nextC(t,e+1):101===r?n=this.nextA(t,e+1):98===r?(t[0]=t[0]<32?t[0]+96:t[0],n=this.nextB(t,e+1)):n=this.nextB(t,e+1)):(r=t[0]-32,t.shift(),n=this.nextB(t,e+1));var i=this.getEncoding(r),o=r*e;return{result:i+n.result,checksum:o+n.checksum}},t.prototype.nextC=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;t[0]>=200?(r=t[0]-105,t.shift(),n=100===r?this.nextB(t,e+1):101===r?this.nextA(t,e+1):this.nextC(t,e+1)):(r=10*(t[0]-48)+t[1]-48,t.shift(),t.shift(),n=this.nextC(t,e+1));var i=this.getEncoding(r),o=r*e;return{result:i+n.result,checksum:o+n.checksum}},t}();e["default"]=r},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(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&&ee&&(e=t[n].height);return e}function f(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t).width;return i}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var c=n(0),d=r(c);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=i,e.getBarcodePadding=o,e.calculateEncodingAttributes=a,e.getTotalWidthOfEncodings=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12);e["default"]={CODE128:r.CODE128,CODE128A:r.CODE128A,CODE128B:r.CODE128B,CODE128C:r.CODE128C}},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n=2?String.fromCharCode(210)+c(t):n>r?String.fromCharCode(208)+u(t):String.fromCharCode(209)+f(t),e=e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,e){return String.fromCharCode(203)+e})}function u(t){var e=t.match(/^([\x00-\x5F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(e)return e[1]+String.fromCharCode(204)+c(t.substring(e[1].length));var n=t.match(/^[\x00-\x5F\xC8-\xCF]+/);return n[0].length===t.length?t:n[0]+String.fromCharCode(205)+f(t.substring(n[0].length))}function f(t){var e=t.match(/^([\x20-\x7F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(e)return e[1]+String.fromCharCode(204)+c(t.substring(e[1].length));var n=t.match(/^[\x20-\x7F\xC8-\xCF]+/);return n[0].length===t.length?t:n[0]+String.fromCharCode(206)+u(t.substring(n[0].length))}function c(t){var e=t.match(/^(\xCF*[0-9]{2}\xCF*)+/)[0],n=e.length;if(n===t.length)return t;t=t.substring(n);var r=t.match(/^[\x00-\x5F\xC8-\xCF]*/)[0].length,i=t.match(/^[\x20-\x7F\xC8-\xCF]*/)[0].length;return r>=i?e+String.fromCharCode(206)+u(t):e+String.fromCharCode(205)+f(t)}Object.defineProperty(e,"__esModule",{value:!0});var d=n(1),l=r(d),h=function(t){function e(n){if(i(this,e),n.search(/^[\x00-\x7F\xC8-\xD3]+$/)!==-1)var r=o(this,t.call(this,s(n)));else var r=o(this,t.call(this,n));return o(r)}return a(e,t),e}(l["default"]);e["default"]=h},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 i=n(11),o=r(i),a=n(8),s=r(a),u=n(9),f=r(u),c=n(10),d=r(c);e.CODE128=o["default"],e.CODE128A=s["default"],e.CODE128B=f["default"],e.CODE128C=d["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e={};for(var n in u["default"])u["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 o=n(14),a=r(o),s=n(2),u=r(s);e["default"]=i},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=r(o),s=n(3),u=function(){function t(e,n,r){i(this,t),this.canvas=e,this.encodings=n,this.options=r}return t.prototype.render=function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t0?(i=0,n.textAlign="left"):"right"==t.textAlign?(i=e.width-1,n.textAlign="right"):(i=e.width/2,n.textAlign="center"),n.fillText(e.text,i,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){switch(t){case"canvas":return a["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(15),a=r(o),s=n(17),u=r(s);e.getRendererClass=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=document.createElementNS(d,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function a(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function s(t,e,n,r,i){var o=document.createElementNS(d,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(0),f=r(u),c=n(3),d="http://www.w3.org/2000/svg",l=function(){function t(e,n,r){i(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(s(a-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&s(a-e.width*(o-1),r,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(d,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",d),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){m.prototype[e]=m.prototype[e.toUpperCase()]=m.prototype[e.toLowerCase()]=function(n,r){var i=(0,d["default"])(this._options,r),a=t[e],s=o(n,a,i);return this._encodings.push(s),this}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid()){if(n.valid===C["default"].valid)throw new Error('"'+t+'" is not a valid input.');n.valid(!1)}var i=r.encode();i=(0,h["default"])(i);for(var o=0;o=200)r=t[0]-105,t.shift(),99===r?n=this.nextC(t,e+1):100===r?n=this.nextB(t,e+1):98===r?(t[0]=t[0]>95?t[0]-96:t[0],n=this.nextA(t,e+1)):n=this.nextA(t,e+1);else{var i=t[0];r=i<32?i+64:i-32,t.shift(),n=this.nextA(t,e+1)}var o=this.getEncoding(r),a=r*e;return{result:o+n.result,checksum:a+n.checksum}},t.prototype.nextB=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;t[0]>=200?(r=t[0]-105,t.shift(),99===r?n=this.nextC(t,e+1):101===r?n=this.nextA(t,e+1):98===r?(t[0]=t[0]<32?t[0]+96:t[0],n=this.nextB(t,e+1)):n=this.nextB(t,e+1)):(r=t[0]-32,t.shift(),n=this.nextB(t,e+1));var i=this.getEncoding(r),o=r*e;return{result:i+n.result,checksum:o+n.checksum}},t.prototype.nextC=function(t,e){if(t.length<=0)return{result:"",checksum:0};var n,r;t[0]>=200?(r=t[0]-105,t.shift(),n=100===r?this.nextB(t,e+1):101===r?this.nextA(t,e+1):this.nextC(t,e+1)):(r=10*(t[0]-48)+t[1]-48,t.shift(),t.shift(),n=this.nextC(t,e+1));var i=this.getEncoding(r),o=r*e;return{result:i+n.result,checksum:o+n.checksum}},t}();e["default"]=r},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",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"]=n},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 o=function(t){function e(i,o){n(this,e);var a=r(this,t.call(this));return a.name="InvalidInputException",a.symbology=i,a.input=o,a.message='"'+a.input+'" is not a valid input for '+a.symbology,a}return i(e,t),e}(Error),a=function(t){function e(){n(this,e);var i=r(this,t.call(this));return i.name="InvalidElementException",i.message="Not supported type to render on",i}return i(e,t),e}(Error),s=function(t){function e(){n(this,e);var i=r(this,t.call(this));return i.name="NoElementException",i.message="No element to render on.",i}return i(e,t),e}(Error);e.InvalidInputException=o,e.InvalidElementException=a,e.NoElementException=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(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&&ee&&(e=t[n].height);return e}function f(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t).width;return i}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var c=n(0),l=r(c);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=i,e.getBarcodePadding=o,e.calculateEncodingAttributes=a,e.getTotalWidthOfEncodings=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(14);e["default"]={CODE128:r.CODE128,CODE128A:r.CODE128A,CODE128B:r.CODE128B,CODE128C:r.CODE128C}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.api=e}return t.prototype.handleCatch=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(){}},t.prototype.wrapBarcodeCall=function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(n){return this.handleCatch(n),this.api}},t}();e["default"]=r},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n=2?String.fromCharCode(210)+c(t):n>r?String.fromCharCode(208)+u(t):String.fromCharCode(209)+f(t),e=e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,e){return String.fromCharCode(203)+e})}function u(t){var e=t.match(/^([\x00-\x5F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(e)return e[1]+String.fromCharCode(204)+c(t.substring(e[1].length));var n=t.match(/^[\x00-\x5F\xC8-\xCF]+/);return n[0].length===t.length?t:n[0]+String.fromCharCode(205)+f(t.substring(n[0].length))}function f(t){var e=t.match(/^([\x20-\x7F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(e)return e[1]+String.fromCharCode(204)+c(t.substring(e[1].length));var n=t.match(/^[\x20-\x7F\xC8-\xCF]+/);return n[0].length===t.length?t:n[0]+String.fromCharCode(206)+u(t.substring(n[0].length))}function c(t){var e=t.match(/^(\xCF*[0-9]{2}\xCF*)+/)[0],n=e.length;if(n===t.length)return t;t=t.substring(n);var r=t.match(/^[\x00-\x5F\xC8-\xCF]*/)[0].length,i=t.match(/^[\x20-\x7F\xC8-\xCF]*/)[0].length;return r>=i?e+String.fromCharCode(206)+u(t):e+String.fromCharCode(205)+f(t)}Object.defineProperty(e,"__esModule",{value:!0});var l=n(1),d=r(l),h=function(t){function e(n){if(i(this,e),n.search(/^[\x00-\x7F\xC8-\xD3]+$/)!==-1)var r=o(this,t.call(this,s(n)));else var r=o(this,t.call(this,n));return o(r)}return a(e,t),e}(d["default"]);e["default"]=h},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 i=n(13),o=r(i),a=n(10),s=r(a),u=n(11),f=r(u),c=n(12),l=r(c);e.CODE128=o["default"],e.CODE128A=s["default"],e.CODE128B=f["default"],e.CODE128C=l["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e={};for(var n in u["default"])u["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 o=n(16),a=r(o),s=n(2),u=r(s);e["default"]=i},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=r(o),s=n(4),u=function(){function t(e,n,r){i(this,t),this.canvas=e,this.encodings=n,this.options=r}return t.prototype.render=function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t0?(i=0,n.textAlign="left"):"right"==t.textAlign?(i=e.width-1,n.textAlign="right"):(i=e.width/2,n.textAlign="center"),n.fillText(e.text,i,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){switch(t){case"canvas":return a["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(17),a=r(o),s=n(19),u=r(s);e.getRendererClass=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=document.createElementNS(l,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function a(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function s(t,e,n,r,i){var o=document.createElementNS(l,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(0),f=r(u),c=n(4),l="http://www.w3.org/2000/svg",d=function(){function t(e,n,r){i(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(s(a-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&s(a-e.width*(o-1),r,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(l,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",l),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=d},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){_.prototype[e]=_.prototype[e.toUpperCase()]=_.prototype[e.toLowerCase()]=function(n,r){var i=this;return i._errorHandler.wrapBarcodeCall(function(){var a=(0,l["default"])(i._options,r),s=t[e],u=o(n,s,a);return i._encodings.push(u),i})}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid())throw new C.InvalidInputException(r.constructor.name,t);var i=r.encode();i=(0,h["default"])(i);for(var o=0;o0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function d(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t).width;return i}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var f=n(0),c=r(f);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=i,e.getBarcodePadding=o,e.calculateEncodingAttributes=a,e.getTotalWidthOfEncodings=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7);e["default"]={CODE39:r.CODE39}},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n0?(i=0,n.textAlign="left"):"right"==t.textAlign?(i=e.width-1,n.textAlign="right"):(i=e.width/2,n.textAlign="center"),n.fillText(e.text,i,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){switch(t){case"canvas":return a["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(10),a=r(o),s=n(12),u=r(s);e.getRendererClass=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=document.createElementNS(c,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function a(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function s(t,e,n,r,i){var o=document.createElementNS(c,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(0),d=r(u),f=n(2),c="http://www.w3.org/2000/svg",h=function(){function t(e,n,r){i(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(s(a-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&s(a-e.width*(o-1),r,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(c,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",c),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){x.prototype[e]=x.prototype[e.toUpperCase()]=x.prototype[e.toLowerCase()]=function(n,r){var i=(0,c["default"])(this._options,r),a=t[e],s=o(n,a,i);return this._encodings.push(s),this}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid()){if(n.valid===w["default"].valid)throw new Error('"'+t+'" is not a valid input.');n.valid(!1)}var i=r.encode();i=(0,l["default"])(i);for(var o=0;o0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function d(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t).width;return i}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var f=n(0),c=r(f);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=i,e.getBarcodePadding=o,e.calculateEncodingAttributes=a,e.getTotalWidthOfEncodings=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9);e["default"]={CODE39:r.CODE39}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.api=e}return t.prototype.handleCatch=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(){}},t.prototype.wrapBarcodeCall=function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(n){return this.handleCatch(n),this.api}},t}();e["default"]=r},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n0?(i=0,n.textAlign="left"):"right"==t.textAlign?(i=e.width-1,n.textAlign="right"):(i=e.width/2,n.textAlign="center"),n.fillText(e.text,i,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){switch(t){case"canvas":return a["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(12),a=r(o),s=n(14),u=r(s);e.getRendererClass=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=document.createElementNS(c,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function a(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function s(t,e,n,r,i){var o=document.createElementNS(c,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(0),d=r(u),f=n(3),c="http://www.w3.org/2000/svg",l=function(){function t(e,n,r){i(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(s(a-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&s(a-e.width*(o-1),r,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(c,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",c),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){E.prototype[e]=E.prototype[e.toUpperCase()]=E.prototype[e.toLowerCase()]=function(n,r){var i=this;return i._errorHandler.wrapBarcodeCall(function(){var a=(0,c["default"])(i._options,r),s=t[e],u=o(n,s,a);return i._encodings.push(u),i})}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid())throw new x.InvalidInputException(r.constructor.name,t);var i=r.encode();i=(0,h["default"])(i);for(var o=0;o0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function d(t,e,n){var i;i="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,i.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var r=i.measureText(t).width;return r}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var f=n(1),h=i(f);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=r,e.getBarcodePadding=o,e.calculateEncodingAttributes=s,e.getTotalWidthOfEncodings=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(13);e["default"]={EAN13:i.EAN13,EAN8:i.EAN8,EAN5:i.EAN5,EAN2:i.EAN2,UPC:i.UPC}},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n10*n.width?this.fontSize=10*n.width:this.fontSize=n.fontSize,this.guardHeight=n.height+this.fontSize/2+n.textMargin,this.lastChar=n.lastChar}return t.prototype.valid=function(){return this.string.search(/^[0-9]{13}$/)!==-1&&this.string[12]==this.checksum(this.string)},t.prototype.encode=function(){var t=new s["default"],e=[],n=this.structure[this.string[0]],i=this.string.substr(1,6),r=this.string.substr(7,6);return this.displayValue&&e.push({data:"000000000000",text:this.string[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),e.push({data:t.encode(i,n),text:i,options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:t.encode(r,"RRRRRR"),text:r,options:{fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),this.lastChar&&this.displayValue&&(e.push({data:"00"}),e.push({data:"00000",text:this.lastChar,options:{fontSize:this.fontSize}})),e},t.prototype.checksum=function(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},t}();e["default"]=a},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}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=n(0),s=i(o),a=function(){function t(e){r(this,t),this.string=e,this.structure=["LL","LG","GL","GG"]}return t.prototype.valid=function(){return this.string.search(/^[0-9]{2}$/)!==-1},t.prototype.encode=function(){var t=new s["default"],e=this.structure[parseInt(this.string)%4],n="1011";return n+=t.encode(this.string,e,"01"),{data:n,text:this.string}},t}();e["default"]=a},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}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=n(0),s=i(o),a=function(){function t(e){r(this,t),this.string=e,this.structure=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"]}return t.prototype.valid=function(){return this.string.search(/^[0-9]{5}$/)!==-1},t.prototype.encode=function(){var t=new s["default"],e=this.checksum(),n="1011";return n+=t.encode(this.string,this.structure[e],"01"),{data:n,text:this.string}},t.prototype.checksum=function(){var t=0;return t+=3*parseInt(this.string[0]),t+=9*parseInt(this.string[1]),t+=3*parseInt(this.string[2]),t+=9*parseInt(this.string[3]),t+=3*parseInt(this.string[4]),t%10},t}();e["default"]=a},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}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=n(0),s=i(o),a=function(){function t(e){r(this,t),e.search(/^[0-9]{7}$/)!==-1?this.string=e+this.checksum(e):this.string=e}return t.prototype.valid=function(){return this.string.search(/^[0-9]{8}$/)!==-1&&this.string[7]==this.checksum(this.string)},t.prototype.encode=function(){var t=new s["default"],e="",n=this.string.substr(0,4),i=this.string.substr(4,4);return e+=t.startBin,e+=t.encode(n,"LLLL"),e+=t.middleBin,e+=t.encode(i,"RRRR"),e+=t.endBin,{data:e,text:this.string}},t.prototype.checksum=function(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},t}();e["default"]=a},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}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=n(0),s=i(o),a=function(){function t(e,n){r(this,t),e.search(/^[0-9]{11}$/)!==-1?this.string=e+this.checksum(e):this.string=e,this.displayValue=n.displayValue,n.fontSize>10*n.width?this.fontSize=10*n.width:this.fontSize=n.fontSize,this.guardHeight=n.height+this.fontSize/2+n.textMargin}return t.prototype.valid=function(){return this.string.search(/^[0-9]{12}$/)!==-1&&this.string[11]==this.checksum(this.string)},t.prototype.encode=function(){var t=new s["default"],e=[];return this.displayValue&&e.push({data:"00000000",text:this.string[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101"+t.encode(this.string[0],"L"),options:{height:this.guardHeight}}),e.push({data:t.encode(this.string.substr(1,5),"LLLLL"),text:this.string.substr(1,5),options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:t.encode(this.string.substr(6,5),"RRRRR"),text:this.string.substr(6,5),options:{fontSize:this.fontSize}}),e.push({data:t.encode(this.string[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&e.push({data:"00000000",text:this.string[11],options:{textAlign:"right",fontSize:this.fontSize}}),e},t.prototype.checksum=function(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},t}();e["default"]=a},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.UPC=e.EAN2=e.EAN5=e.EAN8=e.EAN13=void 0;var r=n(8),o=i(r),s=n(11),a=i(s),u=n(10),d=i(u),f=n(9),h=i(f),c=n(12),l=i(c);e.EAN13=o["default"],e.EAN8=a["default"],e.EAN5=d["default"],e.EAN2=h["default"],e.UPC=l["default"]},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){var e={};for(var n in u["default"])u["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,s["default"])(e)}Object.defineProperty(e,"__esModule",{value:!0});var o=n(15),s=i(o),a=n(2),u=i(a);e["default"]=r},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}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=n(1),s=i(o),a=n(3),u=function(){function t(e,n,i){r(this,t),this.canvas=e,this.encodings=n,this.options=i}return t.prototype.render=function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t0?(r=0,n.textAlign="left"):"right"==t.textAlign?(r=e.width-1,n.textAlign="right"):(r=e.width/2,n.textAlign="center"),n.fillText(e.text,r,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){switch(t){case"canvas":return s["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(16),s=i(o),a=n(18),u=i(a);e.getRendererClass=r},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var i=document.createElementNS(h,"g");return i.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(i),i}function s(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function a(t,e,n,i,r){var o=document.createElementNS(h,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",i),r.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(1),d=i(u),f=n(3),h="http://www.w3.org/2000/svg",c=function(){function t(e,n,i){r(this,t),this.svg=e,this.encodings=n,this.options=i}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(a(s-e.width*o,i,e.width*o,e.height,t),o=0);o>0&&a(s-e.width*(o-1),i,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var i=document.createElementNS(h,"text");if(e.displayValue){var r,o;i.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(r=0,i.setAttribute("text-anchor","start")):"right"==e.textAlign?(r=n.width-1,i.setAttribute("text-anchor","end")):(r=n.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",r),i.setAttribute("y",o),i.appendChild(document.createTextNode(n.text)),t.appendChild(i)}},t.prototype.setSvgAttributes=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",h),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=c},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){w.prototype[e]=w.prototype[e.toUpperCase()]=w.prototype[e.toLowerCase()]=function(n,i){var r=(0,h["default"])(this._options,i),s=t[e],a=o(n,s,r);return this._encodings.push(a),this}}function o(t,e,n){t=""+t;var i=new e(t,n);if(!i.valid()){if(n.valid===L["default"].valid)throw new Error('"'+t+'" is not a valid input.');n.valid(!1)}var r=i.encode();r=(0,l["default"])(r);for(var o=0;o0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function f(t,e,n){var i;i="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,i.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var r=i.measureText(t).width;return r}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var d=n(1),c=i(d);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=r,e.getBarcodePadding=o,e.calculateEncodingAttributes=s,e.getTotalWidthOfEncodings=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(15);e["default"]={EAN13:i.EAN13,EAN8:i.EAN8,EAN5:i.EAN5,EAN2:i.EAN2,UPC:i.UPC}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(e){n(this,t),this.api=e}return t.prototype.handleCatch=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(){}},t.prototype.wrapBarcodeCall=function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(n){return this.handleCatch(n),this.api}},t}();e["default"]=i},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n10*n.width?this.fontSize=10*n.width:this.fontSize=n.fontSize,this.guardHeight=n.height+this.fontSize/2+n.textMargin,this.lastChar=n.lastChar}return t.prototype.valid=function(){return this.string.search(/^[0-9]{13}$/)!==-1&&this.string[12]==this.checksum(this.string)},t.prototype.encode=function(){var t=new s["default"],e=[],n=this.structure[this.string[0]],i=this.string.substr(1,6),r=this.string.substr(7,6);return this.displayValue&&e.push({data:"000000000000",text:this.string[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),e.push({data:t.encode(i,n),text:i,options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:t.encode(r,"RRRRRR"),text:r,options:{fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),this.lastChar&&this.displayValue&&(e.push({data:"00"}),e.push({data:"00000",text:this.lastChar,options:{fontSize:this.fontSize}})),e},t.prototype.checksum=function(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},t}();e["default"]=a},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}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=n(0),s=i(o),a=function(){function t(e){r(this,t),this.string=e,this.structure=["LL","LG","GL","GG"]}return t.prototype.valid=function(){return this.string.search(/^[0-9]{2}$/)!==-1},t.prototype.encode=function(){var t=new s["default"],e=this.structure[parseInt(this.string)%4],n="1011";return n+=t.encode(this.string,e,"01"),{data:n,text:this.string}},t}();e["default"]=a},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}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=n(0),s=i(o),a=function(){function t(e){r(this,t),this.string=e,this.structure=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"]}return t.prototype.valid=function(){return this.string.search(/^[0-9]{5}$/)!==-1},t.prototype.encode=function(){var t=new s["default"],e=this.checksum(),n="1011";return n+=t.encode(this.string,this.structure[e],"01"),{data:n,text:this.string}},t.prototype.checksum=function(){var t=0;return t+=3*parseInt(this.string[0]),t+=9*parseInt(this.string[1]),t+=3*parseInt(this.string[2]),t+=9*parseInt(this.string[3]),t+=3*parseInt(this.string[4]),t%10},t}();e["default"]=a},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}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=n(0),s=i(o),a=function(){function t(e){r(this,t),e.search(/^[0-9]{7}$/)!==-1?this.string=e+this.checksum(e):this.string=e}return t.prototype.valid=function(){return this.string.search(/^[0-9]{8}$/)!==-1&&this.string[7]==this.checksum(this.string)},t.prototype.encode=function(){var t=new s["default"],e="",n=this.string.substr(0,4),i=this.string.substr(4,4);return e+=t.startBin,e+=t.encode(n,"LLLL"),e+=t.middleBin,e+=t.encode(i,"RRRR"),e+=t.endBin,{data:e,text:this.string}},t.prototype.checksum=function(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},t}();e["default"]=a},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}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=n(0),s=i(o),a=function(){function t(e,n){r(this,t),e.search(/^[0-9]{11}$/)!==-1?this.string=e+this.checksum(e):this.string=e,this.displayValue=n.displayValue,n.fontSize>10*n.width?this.fontSize=10*n.width:this.fontSize=n.fontSize,this.guardHeight=n.height+this.fontSize/2+n.textMargin}return t.prototype.valid=function(){return this.string.search(/^[0-9]{12}$/)!==-1&&this.string[11]==this.checksum(this.string)},t.prototype.encode=function(){var t=new s["default"],e=[];return this.displayValue&&e.push({data:"00000000",text:this.string[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101"+t.encode(this.string[0],"L"),options:{height:this.guardHeight}}),e.push({data:t.encode(this.string.substr(1,5),"LLLLL"),text:this.string.substr(1,5),options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:t.encode(this.string.substr(6,5),"RRRRR"),text:this.string.substr(6,5),options:{fontSize:this.fontSize}}),e.push({data:t.encode(this.string[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&e.push({data:"00000000",text:this.string[11],options:{textAlign:"right",fontSize:this.fontSize}}),e},t.prototype.checksum=function(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},t}();e["default"]=a},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.UPC=e.EAN2=e.EAN5=e.EAN8=e.EAN13=void 0;var r=n(10),o=i(r),s=n(13),a=i(s),u=n(12),f=i(u),d=n(11),c=i(d),h=n(14),l=i(h);e.EAN13=o["default"],e.EAN8=a["default"],e.EAN5=f["default"],e.EAN2=c["default"],e.UPC=l["default"]},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){var e={};for(var n in u["default"])u["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,s["default"])(e)}Object.defineProperty(e,"__esModule",{value:!0});var o=n(17),s=i(o),a=n(2),u=i(a);e["default"]=r},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}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=n(1),s=i(o),a=n(4),u=function(){function t(e,n,i){r(this,t),this.canvas=e,this.encodings=n,this.options=i}return t.prototype.render=function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t0?(r=0,n.textAlign="left"):"right"==t.textAlign?(r=e.width-1,n.textAlign="right"):(r=e.width/2,n.textAlign="center"),n.fillText(e.text,r,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){switch(t){case"canvas":return s["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(18),s=i(o),a=n(20),u=i(a);e.getRendererClass=r},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var i=document.createElementNS(c,"g");return i.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(i),i}function s(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function a(t,e,n,i,r){var o=document.createElementNS(c,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",i),r.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(1),f=i(u),d=n(4),c="http://www.w3.org/2000/svg",h=function(){function t(e,n,i){r(this,t),this.svg=e,this.encodings=n,this.options=i}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(a(s-e.width*o,i,e.width*o,e.height,t),o=0);o>0&&a(s-e.width*(o-1),i,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var i=document.createElementNS(c,"text");if(e.displayValue){var r,o;i.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(r=0,i.setAttribute("text-anchor","start")):"right"==e.textAlign?(r=n.width-1,i.setAttribute("text-anchor","end")):(r=n.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",r),i.setAttribute("y",o),i.appendChild(document.createTextNode(n.text)),t.appendChild(i)}},t.prototype.setSvgAttributes=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",c),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=h},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){L.prototype[e]=L.prototype[e.toUpperCase()]=L.prototype[e.toLowerCase()]=function(n,i){var r=this;return r._errorHandler.wrapBarcodeCall(function(){var s=(0,c["default"])(r._options,i),a=t[e],u=o(n,a,s);return r._encodings.push(u),r})}}function o(t,e,n){t=""+t;var i=new e(t,n);if(!i.valid())throw new _.InvalidInputException(i.constructor.name,t);var r=i.encode();r=(0,l["default"])(r);for(var o=0;o0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function d(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t).width;return i}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var f=n(0),c=r(f);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=i,e.getBarcodePadding=o,e.calculateEncodingAttributes=a,e.getTotalWidthOfEncodings=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7);e["default"]={ITF14:r.ITF14}},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n0?(i=0,n.textAlign="left"):"right"==t.textAlign?(i=e.width-1,n.textAlign="right"):(i=e.width/2,n.textAlign="center"),n.fillText(e.text,i,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){switch(t){case"canvas":return a["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(10),a=r(o),s=n(12),u=r(s);e.getRendererClass=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=document.createElementNS(c,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function a(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function s(t,e,n,r,i){var o=document.createElementNS(c,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(0),d=r(u),f=n(2),c="http://www.w3.org/2000/svg",l=function(){function t(e,n,r){i(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(s(a-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&s(a-e.width*(o-1),r,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(c,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",c),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){x.prototype[e]=x.prototype[e.toUpperCase()]=x.prototype[e.toLowerCase()]=function(n,r){var i=(0,c["default"])(this._options,r),a=t[e],s=o(n,a,i);return this._encodings.push(s),this}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid()){if(n.valid===w["default"].valid)throw new Error('"'+t+'" is not a valid input.');n.valid(!1)}var i=r.encode();i=(0,h["default"])(i);for(var o=0;o0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function f(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t).width;return i}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var d=n(0),c=r(d);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=i,e.getBarcodePadding=o,e.calculateEncodingAttributes=a,e.getTotalWidthOfEncodings=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9);e["default"]={ITF14:r.ITF14}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.api=e}return t.prototype.handleCatch=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(){}},t.prototype.wrapBarcodeCall=function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(n){return this.handleCatch(n),this.api}},t}();e["default"]=r},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n0?(i=0,n.textAlign="left"):"right"==t.textAlign?(i=e.width-1,n.textAlign="right"):(i=e.width/2,n.textAlign="center"),n.fillText(e.text,i,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){switch(t){case"canvas":return a["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(12),a=r(o),s=n(14),u=r(s);e.getRendererClass=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=document.createElementNS(c,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function a(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function s(t,e,n,r,i){var o=document.createElementNS(c,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(0),f=r(u),d=n(3),c="http://www.w3.org/2000/svg",l=function(){function t(e,n,r){i(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(s(a-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&s(a-e.width*(o-1),r,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(c,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",c),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){E.prototype[e]=E.prototype[e.toUpperCase()]=E.prototype[e.toLowerCase()]=function(n,r){var i=this;return i._errorHandler.wrapBarcodeCall(function(){var a=(0,c["default"])(i._options,r),s=t[e],u=o(n,s,a);return i._encodings.push(u),i})}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid())throw new b.InvalidInputException(r.constructor.name,t);var i=r.encode();i=(0,h["default"])(i);for(var o=0;o0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function d(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t).width;return i}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var f=n(0),c=r(f);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=i,e.getBarcodePadding=o,e.calculateEncodingAttributes=a,e.getTotalWidthOfEncodings=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7);e["default"]={ITF:r.ITF}},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n0?(i=0,n.textAlign="left"):"right"==t.textAlign?(i=e.width-1,n.textAlign="right"):(i=e.width/2,n.textAlign="center"),n.fillText(e.text,i,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){switch(t){case"canvas":return a["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(10),a=r(o),s=n(12),u=r(s);e.getRendererClass=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=document.createElementNS(c,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function a(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function s(t,e,n,r,i){var o=document.createElementNS(c,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(0),d=r(u),f=n(2),c="http://www.w3.org/2000/svg",l=function(){function t(e,n,r){i(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(s(a-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&s(a-e.width*(o-1),r,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(c,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",c),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){x.prototype[e]=x.prototype[e.toUpperCase()]=x.prototype[e.toLowerCase()]=function(n,r){var i=(0,c["default"])(this._options,r),a=t[e],s=o(n,a,i);return this._encodings.push(s),this}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid()){if(n.valid===w["default"].valid)throw new Error('"'+t+'" is not a valid input.');n.valid(!1)}var i=r.encode();i=(0,h["default"])(i);for(var o=0;o0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function f(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t).width;return i}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var d=n(0),c=r(d);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=i,e.getBarcodePadding=o,e.calculateEncodingAttributes=a,e.getTotalWidthOfEncodings=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9);e["default"]={ITF:r.ITF}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.api=e}return t.prototype.handleCatch=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(){}},t.prototype.wrapBarcodeCall=function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(n){return this.handleCatch(n),this.api}},t}();e["default"]=r},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n0?(i=0,n.textAlign="left"):"right"==t.textAlign?(i=e.width-1,n.textAlign="right"):(i=e.width/2,n.textAlign="center"),n.fillText(e.text,i,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){switch(t){case"canvas":return a["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(12),a=r(o),s=n(14),u=r(s);e.getRendererClass=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=document.createElementNS(c,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function a(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function s(t,e,n,r,i){var o=document.createElementNS(c,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(0),f=r(u),d=n(3),c="http://www.w3.org/2000/svg",l=function(){function t(e,n,r){i(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(s(a-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&s(a-e.width*(o-1),r,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(c,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",c),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){E.prototype[e]=E.prototype[e.toUpperCase()]=E.prototype[e.toLowerCase()]=function(n,r){var i=this;return i._errorHandler.wrapBarcodeCall(function(){var a=(0,c["default"])(i._options,r),s=t[e],u=o(n,s,a);return i._encodings.push(u),i})}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid())throw new b.InvalidInputException(r.constructor.name,t);var i=r.encode();i=(0,h["default"])(i);for(var o=0;o0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function i(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function f(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var o=r.measureText(t).width;return o}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var c=n(1),d=r(c);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=o,e.getBarcodePadding=i,e.calculateEncodingAttributes=a,e.getTotalWidthOfEncodings=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(13);e["default"]={MSI:r.MSI,MSI10:r.MSI10,MSI11:r.MSI11,MSI1010:r.MSI1010,MSI1110:r.MSI1110}},function(t,e){"use strict";function n(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"]=n},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;n0?(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)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){switch(t){case"canvas":return a["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var i=n(16),a=r(i),s=n(18),u=r(s);e.getRendererClass=o},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,n){var r=document.createElementNS(d,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function a(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function s(t,e,n,r,o){var i=document.createElementNS(d,"rect");i.setAttribute("x",t),i.setAttribute("y",e),i.setAttribute("width",n),i.setAttribute("height",r),o.appendChild(i)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(1),f=r(u),c=n(4),d="http://www.w3.org/2000/svg",l=function(){function t(e,n,r){o(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(s(a-e.width*i,r,e.width*i,e.height,t),i=0);i>0&&s(a-e.width*(i-1),r,e.width*i,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(d,"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(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",d),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){w.prototype[e]=w.prototype[e.toUpperCase()]=w.prototype[e.toLowerCase()]=function(n,r){var o=(0,d["default"])(this._options,r),a=t[e],s=i(n,a,o);return this._encodings.push(s),this}}function i(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid()){if(n.valid===m["default"].valid)throw new Error('"'+t+'" is not a valid input.');n.valid(!1)}var o=r.encode();o=(0,h["default"])(o);for(var i=0;i0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function i(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function f(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var o=r.measureText(t).width;return o}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var c=n(1),l=r(c);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=o,e.getBarcodePadding=i,e.calculateEncodingAttributes=a,e.getTotalWidthOfEncodings=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(15);e["default"]={MSI:r.MSI,MSI10:r.MSI10,MSI11:r.MSI11,MSI1010:r.MSI1010,MSI1110:r.MSI1110}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.api=e}return t.prototype.handleCatch=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(){}},t.prototype.wrapBarcodeCall=function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(n){return this.handleCatch(n),this.api}},t}();e["default"]=r},function(t,e){"use strict";function n(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"]=n},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;n0?(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)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){switch(t){case"canvas":return a["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var i=n(18),a=r(i),s=n(20),u=r(s);e.getRendererClass=o},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,n){var r=document.createElementNS(l,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function a(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function s(t,e,n,r,o){var i=document.createElementNS(l,"rect");i.setAttribute("x",t),i.setAttribute("y",e),i.setAttribute("width",n),i.setAttribute("height",r),o.appendChild(i)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(1),f=r(u),c=n(5),l="http://www.w3.org/2000/svg",d=function(){function t(e,n,r){o(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(s(a-e.width*i,r,e.width*i,e.height,t),i=0);i>0&&s(a-e.width*(i-1),r,e.width*i,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(l,"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(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",l),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=d},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){M.prototype[e]=M.prototype[e.toUpperCase()]=M.prototype[e.toLowerCase()]=function(n,r){var o=this;return o._errorHandler.wrapBarcodeCall(function(){var a=(0,l["default"])(o._options,r),s=t[e],u=i(n,s,a);return o._encodings.push(u),o})}}function i(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,p["default"])(o);for(var i=0;i0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function d(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t).width;return i}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var f=n(0),c=r(f);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=i,e.getBarcodePadding=o,e.calculateEncodingAttributes=a,e.getTotalWidthOfEncodings=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7);e["default"]={pharmacode:r.pharmacode}},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n=3&&this.number<=131070},t}();e.pharmacode=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e={};for(var n in u["default"])u["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 o=n(9),a=r(o),s=n(1),u=r(s);e["default"]=i},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=r(o),s=n(2),u=function(){function t(e,n,r){i(this,t),this.canvas=e,this.encodings=n,this.options=r}return t.prototype.render=function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t0?(i=0,n.textAlign="left"):"right"==t.textAlign?(i=e.width-1,n.textAlign="right"):(i=e.width/2,n.textAlign="center"),n.fillText(e.text,i,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){switch(t){case"canvas":return a["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(10),a=r(o),s=n(12),u=r(s);e.getRendererClass=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=document.createElementNS(c,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function a(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function s(t,e,n,r,i){var o=document.createElementNS(c,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(0),d=r(u),f=n(2),c="http://www.w3.org/2000/svg",l=function(){function t(e,n,r){i(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(s(a-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&s(a-e.width*(o-1),r,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(c,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",c),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){x.prototype[e]=x.prototype[e.toUpperCase()]=x.prototype[e.toLowerCase()]=function(n,r){var i=(0,c["default"])(this._options,r),a=t[e],s=o(n,a,i);return this._encodings.push(s),this}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid()){if(n.valid===w["default"].valid)throw new Error('"'+t+'" is not a valid input.');n.valid(!1)}var i=r.encode();i=(0,h["default"])(i);for(var o=0;o0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function f(t,e,n){var r;r="undefined"==typeof n?document.createElement("canvas").getContext("2d"):n,r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t).width;return i}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var d=n(0),c=r(d);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=i,e.getBarcodePadding=o,e.calculateEncodingAttributes=a,e.getTotalWidthOfEncodings=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9);e["default"]={pharmacode:r.pharmacode}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(e){n(this,t),this.api=e}return t.prototype.handleCatch=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(){}},t.prototype.wrapBarcodeCall=function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(n){return this.handleCatch(n),this.api}},t}();e["default"]=r},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if("string"==typeof t)return o(t);if(Array.isArray(t)){for(var e=[],n=0;n=3&&this.number<=131070},t}();e.pharmacode=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e={};for(var n in u["default"])u["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 o=n(11),a=r(o),s=n(1),u=r(s);e["default"]=i},function(t,e){"use strict";function n(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"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=r(o),s=n(3),u=function(){function t(e,n,r){i(this,t),this.canvas=e,this.encodings=n,this.options=r}return t.prototype.render=function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t0?(i=0,n.textAlign="left"):"right"==t.textAlign?(i=e.width-1,n.textAlign="right"):(i=e.width/2,n.textAlign="center"),n.fillText(e.text,i,o)}},t.prototype.moveCanvasDrawing=function(t){var e=this.canvas.getContext("2d");e.translate(t.width,0)},t.prototype.restoreCanvas=function(){var t=this.canvas.getContext("2d");t.restore()},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){switch(t){case"canvas":return a["default"];case"svg":return u["default"];default:throw new Error("Invalid rederer")}}Object.defineProperty(e,"__esModule",{value:!0}),e.getRendererClass=void 0;var o=n(12),a=r(o),s=n(14),u=r(s);e.getRendererClass=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=document.createElementNS(c,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}function a(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}function s(t,e,n,r,i){var o=document.createElementNS(c,"rect");o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(0),f=r(u),d=n(3),c="http://www.w3.org/2000/svg",l=function(){function t(e,n,r){i(this,t),this.svg=e,this.encodings=n,this.options=r}return t.prototype.render=function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e0&&(s(a-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&s(a-e.width*(o-1),r,e.width*o,e.height,t)},t.prototype.drawSVGText=function(t,e,n){var r=document.createElementNS(c,"text");if(e.displayValue){var i,o;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(i=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(i=n.width-1,r.setAttribute("text-anchor","end")):(i=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",i),r.setAttribute("y",o),r.appendChild(document.createTextNode(n.text)),t.appendChild(r)}},t.prototype.setSvgAttributes=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",c),n.setAttribute("version","1.1"),n.style.transform="translate(0,0)",this.options.background&&(n.style.background=this.options.background)},t}();e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){E.prototype[e]=E.prototype[e.toUpperCase()]=E.prototype[e.toLowerCase()]=function(n,r){var i=this;return i._errorHandler.wrapBarcodeCall(function(){var a=(0,c["default"])(i._options,r),s=t[e],u=o(n,s,a);return i._encodings.push(u),i})}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid())throw new b.InvalidInputException(r.constructor.name,t);var i=r.encode();i=(0,h["default"])(i);for(var o=0;o