schangxiang@126.com
2025-09-19 0821aa23eabe557c0d9ef5dbe6989c68be35d1fe
1
2
3
4
5
6
7
8
9
10
(window.webpackJsonp=window.webpackJsonp||[]).push([["q+Mi"],{"q+Mi":function(t,e,n){"use strict";
/*!
 * vue-barcode v1.0.0
 * https://xkeshi.github.io/vue-barcode
 *
 * Copyright 2017-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2018-06-20T05:51:52.635Z
 */var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},h=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0},c=function(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)},f=function(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},l=function t(e,n){o(this,t),this.data=e,this.text=n.text||e,this.options=n},d=function(t){function e(t,n){return o(this,e),t=t.toUpperCase(),n.mod43&&(t+=function(t){return p[t]}(function(t){for(var e=0,n=0;n<t.length;n++)e+=y(t[n]);return e%=43}(t))),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return c(e,l),a(e,[{key:"encode",value:function(){for(var t=v("*"),e=0;e<this.data.length;e++)t+=v(this.data[e])+"0";return{data:t+=v("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),e}(),p=["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","-","."," ","$","/","+","%","*"],g=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function v(t){return function(t){return g[t].toString(2)}(y(t))}function y(t){return p.indexOf(t)}var _=(s(r={},103,0),s(r,104,1),s(r,105,2),r),x={101:0,100:1,99:2},O=String.fromCharCode(208),b=String.fromCharCode(209),m=String.fromCharCode(210),E="[\0-_È-Ï]",w="[ -È-Ï]",L=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011],k=function(t){function e(t,n){o(this,e);var r=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.substring(1),n));return r.bytes=t.split("").map(function(t){return t.charCodeAt(0)}),r}return c(e,l),a(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var t=this.bytes,n=t.shift()-105,r=_[n];if(void 0===r)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&t.unshift(207);var i=e.next(t,1,r);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(n)+i.result+e.getBar((i.checksum+n)%103)+e.getBar(106)}}},{key:"shouldEncodeAsEan128",value:function(){var t=this.options.ean128||!1;return"string"==typeof t&&(t="true"===t.toLowerCase()),t}}],[{key:"getBar",value:function(t){return L[t]?L[t].toString():""}},{key:"correctIndex",value:function(t,e){if(0===e){var n=t.shift();return n<32?n+64:n-32}return 1===e?t.shift()-32:10*(t.shift()-48)+t.shift()-48}},{key:"next",value:function(t,n,r){if(!t.length)return{result:"",checksum:0};var i=void 0,o=void 0;if(t[0]>=200){o=t.shift()-105;var a=x[o];void 0!==a?i=e.next(t,n+1,a):(0!==r&&1!==r||98!==o||(t[0]=0===r?t[0]>95?t[0]-96:t[0]:t[0]<32?t[0]+96:t[0]),i=e.next(t,n+1,r))}else o=e.correctIndex(t,r),i=e.next(t,n+1,r);var s=o*n;return{result:e.getBar(o)+i.result,checksum:s+i.checksum}}}]),e}(),C=function(t){return t.match(new RegExp("^"+E+"*"))[0].length},S=function(t){return t.match(new RegExp("^"+w+"*"))[0].length},A=function(t){return t.match(new RegExp("^(Ï*[0-9]{2}Ï*)*"))[0]};function P(t,e){var n=e?E:w,r=t.match(new RegExp("^("+n+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(r)return r[1]+String.fromCharCode(204)+G(t.substring(r[1].length));var i=t.match(new RegExp("^"+n+"+"))[0];return i.length===t.length?t:i+String.fromCharCode(e?205:206)+P(t.substring(i.length),!e)}function G(t){var e=A(t),n=e.length;if(n===t.length)return t;t=t.substring(n);var r=C(t)>=S(t);return e+String.fromCharCode(r?206:205)+P(t,r)}var R=function(t){var e=void 0;if(A(t).length>=2)e=m+G(t);else{var n=C(t)>S(t);e=(n?O:b)+P(t,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,e){return String.fromCharCode(203)+e})},j=function(t){function e(t,n){if(o(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var r=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,R(t),n));else r=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return f(r)}return c(e,k),e}(),X=function(t){function e(t,n){return o(this,e),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,O+t,n))}return c(e,k),a(e,[{key:"valid",value:function(){return new RegExp("^"+E+"+$").test(this.data)}}]),e}(),z=function(t){function e(t,n){return o(this,e),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,b+t,n))}return c(e,k),a(e,[{key:"valid",value:function(){return new RegExp("^"+w+"+$").test(this.data)}}]),e}(),T=function(t){function e(t,n){return o(this,e),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,m+t,n))}return c(e,k),a(e,[{key:"valid",value:function(){return new RegExp("^(Ï*[0-9]{2}Ï*)+$").test(this.data)}}]),e}(),M={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},V=["LL","LG","GL","GG"],$=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],D=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"],I=function(t,e,n){var r=t.split("").map(function(t,n){return M[e[n]]}).map(function(e,n){return e?e[t[n]]:""});if(n){var i=t.length-1;r=r.map(function(t,e){return e<i?t+n:t})}return r.join("")},B=function(t){function e(t,n){o(this,e);var r=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.fontSize=!n.flat&&n.fontSize>10*n.width?10*n.width:n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return c(e,l),a(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(t,e){return this.text.substr(t,e)}},{key:"leftEncode",value:function(t,e){return I(t,e)}},{key:"rightText",value:function(t,e){return this.text.substr(t,e)}},{key:"rightEncode",value:function(t,e){return I(t,e)}},{key:"encodeGuarded",value:function(){var t={fontSize:this.fontSize},e={height:this.guardHeight};return[{data:"101",options:e},{data:this.leftEncode(),text:this.leftText(),options:t},{data:"01010",options:e},{data:this.rightEncode(),text:this.rightText(),options:t},{data:"101",options:e}]}},{key:"encodeFlat",value:function(){return{data:["101",this.leftEncode(),"01010",this.rightEncode(),"101"].join(""),text:this.text}}}]),e}(),H=function(t){return(10-t.substr(0,12).split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+3*e:t+e},0)%10)%10},N=function(t){function e(t,n){o(this,e),-1!==t.search(/^[0-9]{12}$/)&&(t+=H(t));var r=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.lastChar=n.lastChar,r}return c(e,B),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===H(this.data)}},{key:"leftText",value:function(){return h(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var t=this.data.substr(1,6),n=D[this.data[0]];return h(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,t,n)}},{key:"rightText",value:function(){return h(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var t=this.data.substr(7,6);return h(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,t,"RRRRRR")}},{key:"encodeGuarded",value:function(){var t=h(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(t.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(t.push({data:"00"}),t.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),t}}]),e}(),F=function(t){return(10-t.substr(0,7).split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+e:t+3*e},0)%10)%10},U=function(t){function e(t,n){return o(this,e),-1!==t.search(/^[0-9]{7}$/)&&(t+=F(t)),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return c(e,B),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===F(this.data)}},{key:"leftText",value:function(){return h(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var t=this.data.substr(0,4);return h(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,t,"LLLL")}},{key:"rightText",value:function(){return h(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var t=this.data.substr(4,4);return h(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,t,"RRRR")}}]),e}(),J=function(t){function e(t,n){return o(this,e),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return c(e,l),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var t=$[function(t){return t.split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+9*e:t+3*e},0)%10}(this.data)];return{data:"1011"+I(this.data,t,"01"),text:this.text}}}]),e}(),Q=function(t){function e(t,n){return o(this,e),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return c(e,l),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var t=V[parseInt(this.data)%4];return{data:"1011"+I(this.data,t,"01"),text:this.text}}}]),e}(),q=function(t){function e(t,n){o(this,e),-1!==t.search(/^[0-9]{11}$/)&&(t+=Z(t));var r=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return c(e,l),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==Z(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=I(this.data.substr(0,6),"LLLLLL"),t+="01010",t+=I(this.data.substr(6,6),"RRRRRR"),{data:t+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101"+I(this.data[0],"L"),options:{height:this.guardHeight}}),t.push({data:I(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),t.push({data:"01010",options:{height:this.guardHeight}}),t.push({data:I(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),t.push({data:I(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),t}}]),e}();function Z(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}var K=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],W=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],Y=function(t){function e(t,n){o(this,e);var r=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if(r.isValid=!1,-1!==t.search(/^[0-9]{6}$/))r.middleDigits=t,r.upcA=tt(t,"0"),r.text=n.text||""+r.upcA[0]+t+r.upcA[r.upcA.length-1],r.isValid=!0;else{if(-1===t.search(/^[01][0-9]{7}$/))return f(r);if(r.middleDigits=t.substring(1,t.length-1),r.upcA=tt(r.middleDigits,t[0]),r.upcA[r.upcA.length-1]!==t[t.length-1])return f(r);r.isValid=!0}return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return c(e,l),a(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=this.encodeMiddleDigits(),{data:t+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101",options:{height:this.guardHeight}}),t.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),t.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),t}},{key:"encodeMiddleDigits",value:function(){var t=this.upcA[0],e=this.upcA[this.upcA.length-1],n=W[parseInt(e)][parseInt(t)];return I(this.middleDigits,n)}}]),e}();function tt(t,e){for(var n=parseInt(t[t.length-1]),r=K[n],i="",o=0,a=0;a<r.length;a++){var s=r[a];i+="X"===s?t[o++]:s}return""+(i=""+e+i)+Z(i)}var et=function(t){function e(t,n){o(this,e),-1!==t.search(/^[0-9]{13}$/)&&(t+=nt(t));var r=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.binaryRepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"},r}return c(e,l),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&this.data[13]==nt(this.data)}},{key:"encode",value:function(){for(var t="1010",e=0;e<14;e+=2)t+=this.calculatePair(this.data.substr(e,2));return{data:t+="11101",text:this.text}}},{key:"calculatePair",value:function(t){for(var e="",n=this.binaryRepresentation[t[0]],r=this.binaryRepresentation[t[1]],i=0;i<5;i++)e+="1"==n[i]?"111":"1",e+="1"==r[i]?"000":"0";return e}}]),e}();function nt(t){for(var e=0,n=0;n<13;n++)e+=parseInt(t[n])*(3-n%2*2);return 10*Math.ceil(e/10)-e}var rt=function(t){function e(t,n){o(this,e);var r=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.binaryRepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"},r}return c(e,l),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){for(var t="1010",e=0;e<this.data.length;e+=2)t+=this.calculatePair(this.data.substr(e,2));return{data:t+="11101",text:this.text}}},{key:"calculatePair",value:function(t){for(var e="",n=this.binaryRepresentation[t[0]],r=this.binaryRepresentation[t[1]],i=0;i<5;i++)e+="1"==n[i]?"111":"1",e+="1"==r[i]?"000":"0";return e}}]),e}(),it=function(t){function e(t,n){return o(this,e),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return c(e,l),a(e,[{key:"encode",value:function(){for(var t="110",e=0;e<this.data.length;e++){var n=parseInt(this.data[e]).toString(2);n=ot(n,4-n.length);for(var r=0;r<n.length;r++)t+="0"==n[r]?"100":"110"}return{data:t+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),e}();function ot(t,e){for(var n=0;n<e;n++)t="0"+t;return t}function at(t){for(var e=0,n=0;n<t.length;n++){var r=parseInt(t[n]);(n+t.length)%2==0?e+=r:e+=2*r%10+Math.floor(2*r/10)}return(10-e%10)%10}function st(t){for(var e=0,n=[2,3,4,5,6,7],r=0;r<t.length;r++){var i=parseInt(t[t.length-1-r]);e+=n[r%n.length]*i}return(11-e%11)%11}var ut={CODE39:d,CODE128:j,CODE128A:X,CODE128B:z,CODE128C:T,EAN13:N,EAN8:U,EAN5:J,EAN2:Q,UPC:q,UPCE:Y,ITF14:et,ITF:rt,MSI:it,MSI10:function(t){function e(t,n){return o(this,e),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+at(t),n))}return c(e,it),e}(),MSI11:function(t){function e(t,n){return o(this,e),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+st(t),n))}return c(e,it),e}(),MSI1010:function(t){function e(t,n){return o(this,e),t+=at(t),t+=at(t),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return c(e,it),e}(),MSI1110:function(t){function e(t,n){return o(this,e),t+=st(t),t+=at(t),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return c(e,it),e}(),pharmacode:function(t){function e(t,n){o(this,e);var r=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.number=parseInt(t,10),r}return c(e,l),a(e,[{key:"encode",value:function(){for(var t=this.number,e="";!isNaN(t)&&0!=t;)t%2==0?(e="11100"+e,t=(t-2)/2):(e="100"+e,t=(t-1)/2);return{data:e=e.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(),codabar:function(t){function e(t,n){o(this,e),0===t.search(/^[0-9\-\$\:\.\+\/]+$/)&&(t="A"+t+"A");var r=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),n));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return c(e,l),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var t=[],e=this.getEncodings(),n=0;n<this.data.length;n++)t.push(e[this.data.charAt(n)]),n!==this.data.length-1&&t.push("0");return{text:this.text,data:t.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"101100110011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e}(),GenericBarcode:function(t){function e(t,n){return o(this,e),f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return c(e,l),a(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}()},ht=function(t,e){return u({},t,e)};function ct(t){var e=[];return function t(n){if(Array.isArray(n))for(var r=0;r<n.length;r++)t(n[r]);else n.text=n.text||"",n.data=n.data||"",e.push(n)}(t),e}function ft(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}function lt(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in e)e.hasOwnProperty(n)&&"string"==typeof t[n=e[n]]&&(t[n]=parseInt(t[n],10));return"string"==typeof t.displayValue&&(t.displayValue="false"!=t.displayValue),t}var dt={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};function pt(t){var e={};for(var n in dt)dt.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=lt(e)}function gt(t,e){return e.height+(e.displayValue&&t.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function vt(t,e,n){if(n.displayValue&&e<t){if("center"==n.textAlign)return Math.floor((t-e)/2);if("left"==n.textAlign)return 0;if("right"==n.textAlign)return Math.floor(t-e)}return 0}function yt(t,e,n){for(var r=0;r<t.length;r++){var i,o=t[r],a=ht(e,o.options);i=a.displayValue?Ot(o.text,a,n):0;var s=o.data.length*a.width;o.width=Math.ceil(Math.max(i,s)),o.height=gt(o,a),o.barcodePadding=vt(i,s,a)}}function _t(t){for(var e=0,n=0;n<t.length;n++)e+=t[n].width;return e}function xt(t){for(var e=0,n=0;n<t.length;n++)t[n].height>e&&(e=t[n].height);return e}function Ot(t,e,n){var r;if(n)r=n;else{if("undefined"==typeof document)return 0;r=document.createElement("canvas").getContext("2d")}return r.font=e.fontOptions+" "+e.fontSize+"px "+e.font,r.measureText(t).width}var bt="http://www.w3.org/2000/svg",mt={CanvasRenderer:function(){function t(e,n,r){o(this,t),this.canvas=e,this.encodings=n,this.options=r}return a(t,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t<this.encodings.length;t++){var e=ht(this.options,this.encodings[t].options);this.drawCanvasBarcode(e,this.encodings[t]),this.drawCanvasText(e,this.encodings[t]),this.moveCanvasDrawing(this.encodings[t])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var t=this.canvas.getContext("2d");t.save(),yt(this.encodings,this.options,t);var e=_t(this.encodings),n=xt(this.encodings);this.canvas.width=e+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,t.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(t.fillStyle=this.options.background,t.fillRect(0,0,this.canvas.width,this.canvas.height)),t.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(t,e){var n,r=this.canvas.getContext("2d"),i=e.data;n="top"==t.textPosition?t.marginTop+t.fontSize+t.textMargin:t.marginTop,r.fillStyle=t.lineColor;for(var o=0;o<i.length;o++){var a=o*t.width+e.barcodePadding;"1"===i[o]?r.fillRect(a,n,t.width,t.height):i[o]&&r.fillRect(a,n,t.width,t.height*i[o])}}},{key:"drawCanvasText",value:function(t,e){var n,r,i=this.canvas.getContext("2d"),o=t.fontOptions+" "+t.fontSize+"px "+t.font;t.displayValue&&(r="top"==t.textPosition?t.marginTop+t.fontSize-t.textMargin:t.height+t.textMargin+t.marginTop+t.fontSize,i.font=o,"left"==t.textAlign||e.barcodePadding>0?(n=0,i.textAlign="left"):"right"==t.textAlign?(n=e.width-1,i.textAlign="right"):(n=e.width/2,i.textAlign="center"),i.fillText(e.text,n,r))}},{key:"moveCanvasDrawing",value:function(t){this.canvas.getContext("2d").translate(t.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),t}(),SVGRenderer:function(){function t(e,n,r){o(this,t),this.svg=e,this.encodings=n,this.options=r,this.document=r.xmlDocument||document}return a(t,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e<this.encodings.length;e++){var n=this.encodings[e],r=ht(this.options,n.options),i=this.createGroup(t,r.marginTop,this.svg);this.setGroupOptions(i,r),this.drawSvgBarcode(i,r,n),this.drawSVGText(i,r,n),t+=n.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);yt(this.encodings,this.options);var t=_t(this.encodings),e=xt(this.encodings),n=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,e),this.options.background&&this.drawRect(0,0,n,e,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(t,e,n){var r,i=n.data;r="top"==e.textPosition?e.fontSize+e.textMargin:0;for(var o=0,a=0,s=0;s<i.length;s++)a=s*e.width+n.barcodePadding,"1"===i[s]?o++:o>0&&(this.drawRect(a-e.width*o,r,e.width*o,e.height,t),o=0);o>0&&this.drawRect(a-e.width*(o-1),r,e.width*o,e.height,t)}},{key:"drawSVGText",value:function(t,e,n){var r,i,o=this.document.createElementNS(bt,"text");e.displayValue&&(o.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?(r=0,o.setAttribute("text-anchor","start")):"right"==e.textAlign?(r=n.width-1,o.setAttribute("text-anchor","end")):(r=n.width/2,o.setAttribute("text-anchor","middle")),o.setAttribute("x",r),o.setAttribute("y",i),o.appendChild(this.document.createTextNode(n.text)),t.appendChild(o))}},{key:"setSvgAttributes",value:function(t,e){var n=this.svg;n.setAttribute("width",t+"px"),n.setAttribute("height",e+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+t+" "+e),n.setAttribute("xmlns",bt),n.setAttribute("version","1.1"),n.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(t,e,n){var r=this.document.createElementNS(bt,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}},{key:"setGroupOptions",value:function(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}},{key:"drawRect",value:function(t,e,n,r,i){var o=this.document.createElementNS(bt,"rect");return o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",r),i.appendChild(o),o}}]),t}(),ObjectRenderer:function(){function t(e,n,r){o(this,t),this.object=e,this.encodings=n,this.options=r}return a(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}()},Et=function(t){function e(t,n){o(this,e);var r=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="InvalidInputException",r.symbology=t,r.input=n,r.message='"'+r.input+'" is not a valid input for '+r.symbology,r}return c(e,t),e}(Error),wt=function(t){function e(){o(this,e);var t=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="InvalidElementException",t.message="Not supported type to render on",t}return c(e,t),e}(Error),Lt=function(t){function e(){o(this,e);var t=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="NoElementException",t.message="No element to render on.",t}return c(e,t),e}(Error);function kt(t){if("string"==typeof t)return function(t){var e=document.querySelectorAll(t);if(0===e.length)return;for(var n=[],r=0;r<e.length;r++)n.push(kt(e[r]));return n}(t);if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(kt(t[n]));return e}if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLImageElement)return function(t){var e=document.createElement("canvas");return{element:e,options:pt(t),renderer:mt.CanvasRenderer,afterRender:function(){t.setAttribute("src",e.toDataURL())}}}(t);if(t&&"svg"===t.nodeName||"undefined"!=typeof SVGElement&&t instanceof SVGElement)return{element:t,options:pt(t),renderer:mt.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)return{element:t,options:pt(t),renderer:mt.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:mt.CanvasRenderer};if(t&&"object"===(void 0===t?"undefined":i(t))&&!t.nodeName)return{element:t,renderer:mt.ObjectRenderer};throw new wt}var Ct=function(){function t(e){o(this,t),this.api=e}return a(t,[{key:"handleCatch",value:function(t){if("InvalidInputException"!==t.name)throw t;if(this.api._options.valid===this.api._defaults.valid)throw t.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(t){return this.handleCatch(t),this.api}}}]),t}(),St=function(){},At=function(t,e,n){var r=new St;if(void 0===t)throw Error("No element to render on was provided.");return r._renderProperties=kt(t),r._encodings=[],r._options=dt,r._errorHandler=new Ct(r),void 0!==e&&((n=n||{}).format||(n.format=jt()),r.options(n)[n.format](e,n).render()),r};for(var Pt in At.getModule=function(t){return ut[t]},ut)ut.hasOwnProperty(Pt)&&Gt(ut,Pt);function Gt(t,e){St.prototype[e]=St.prototype[e.toUpperCase()]=St.prototype[e.toLowerCase()]=function(n,r){var i=this;return i._errorHandler.wrapBarcodeCall(function(){r.text=void 0===r.text?void 0:""+r.text;var o=ht(i._options,r);o=lt(o);var a=t[e],s=Rt(n,a,o);return i._encodings.push(s),i})}}function Rt(t,e,n){var r=new e(t=""+t,n);if(!r.valid())throw new Et(r.constructor.name,t);var i=r.encode();i=ct(i);for(var o=0;o<i.length;o++)i[o].options=ht(n,i[o].options);return i}function jt(){return ut.CODE128?"CODE128":Object.keys(ut)[0]}function Xt(t,e,n){e=ct(e);for(var r=0;r<e.length;r++)e[r].options=ht(n,e[r].options),ft(e[r].options);ft(n),new(0,t.renderer)(t.element,e,n).render(),t.afterRender&&t.afterRender()}St.prototype.options=function(t){return this._options=ht(this._options,t),this},St.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this},St.prototype.init=function(){var t;if(this._renderProperties)for(var e in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){t=this._renderProperties[e];var n=ht(this._options,t.options);"auto"==n.format&&(n.format=jt()),this._errorHandler.wrapBarcodeCall(function(){var e=Rt(n.value,ut[n.format.toUpperCase()],n);Xt(t,e,n)})}},St.prototype.render=function(){if(!this._renderProperties)throw new Lt;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)Xt(this._renderProperties[t],this._encodings,this._options);else Xt(this._renderProperties,this._encodings,this._options);return this},St.prototype._defaults=dt,"undefined"!=typeof window&&(window.JsBarcode=At),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(t,e){var n=[];return jQuery(this).each(function(){n.push(this)}),At(n,t,e)});var zt={name:"barcode",props:{options:Object,tag:{type:String,default:"canvas"},value:{type:null,default:""}},render:function(t){return t(this.tag,this.$slots.default)},watch:{value:function(){this.generate()},options:function(){this.generate()}},methods:{generate:function(){this.$el&&At(this.$el,String(this.value),this.options)}},mounted:function(){this.generate()}};e.a=zt}}]);