@andy-defer/react-pdf-builder 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/JsBarcode-ImX-0ZxL.js +2648 -0
- package/dist/components/Badge.d.ts +11 -0
- package/dist/components/Barcode.d.ts +24 -0
- package/dist/components/Box.d.ts +13 -0
- package/dist/components/Divider.d.ts +10 -0
- package/dist/components/Flex.d.ts +13 -0
- package/dist/components/Grid.d.ts +10 -0
- package/dist/components/Heading.d.ts +13 -0
- package/dist/components/Image.d.ts +14 -0
- package/dist/components/PDFGenerator.d.ts +19 -0
- package/dist/components/Page.d.ts +8 -0
- package/dist/components/QRCode.d.ts +19 -0
- package/dist/components/Table.d.ts +18 -0
- package/dist/components/TableCell.d.ts +9 -0
- package/dist/components/TableRow.d.ts +8 -0
- package/dist/components/Text.d.ts +13 -0
- package/dist/components/TotalBox.d.ts +13 -0
- package/dist/components/index.d.ts +32 -0
- package/dist/context/PDFContext.d.ts +22 -0
- package/dist/context/index.d.ts +2 -0
- package/dist/hooks/usePDF.d.ts +12 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.es.js +1629 -0
- package/dist/index.umd.js +9 -0
- package/dist/style.css +1 -0
- package/dist/templates/stripe.d.ts +3 -0
- package/dist/types/index.d.ts +46 -0
- package/dist/types/pdf.d.ts +18 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/pdfGenerator.d.ts +15 -0
- package/dist/utils/renderer.d.ts +4 -0
- package/package.json +68 -0
|
@@ -0,0 +1,2648 @@
|
|
|
1
|
+
function jt(t, e) {
|
|
2
|
+
for (var r = 0; r < e.length; r++) {
|
|
3
|
+
const n = e[r];
|
|
4
|
+
if (typeof n != "string" && !Array.isArray(n)) {
|
|
5
|
+
for (const a in n)
|
|
6
|
+
if (a !== "default" && !(a in t)) {
|
|
7
|
+
const i = Object.getOwnPropertyDescriptor(n, a);
|
|
8
|
+
i && Object.defineProperty(t, a, i.get ? i : {
|
|
9
|
+
enumerable: !0,
|
|
10
|
+
get: () => n[a]
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
|
|
16
|
+
}
|
|
17
|
+
function Bt(t) {
|
|
18
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
19
|
+
}
|
|
20
|
+
var ve = {}, J = {}, c = {};
|
|
21
|
+
Object.defineProperty(c, "__esModule", {
|
|
22
|
+
value: !0
|
|
23
|
+
});
|
|
24
|
+
function Lt(t, e) {
|
|
25
|
+
if (!(t instanceof e))
|
|
26
|
+
throw new TypeError("Cannot call a class as a function");
|
|
27
|
+
}
|
|
28
|
+
var Ct = function t(e, r) {
|
|
29
|
+
Lt(this, t), this.data = e, this.text = r.text || e, this.options = r;
|
|
30
|
+
};
|
|
31
|
+
c.default = Ct;
|
|
32
|
+
Object.defineProperty(J, "__esModule", {
|
|
33
|
+
value: !0
|
|
34
|
+
});
|
|
35
|
+
J.CODE39 = void 0;
|
|
36
|
+
var Nt = /* @__PURE__ */ function() {
|
|
37
|
+
function t(e, r) {
|
|
38
|
+
for (var n = 0; n < r.length; n++) {
|
|
39
|
+
var a = r[n];
|
|
40
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return function(e, r, n) {
|
|
44
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
45
|
+
};
|
|
46
|
+
}(), Gt = c, Ft = Ht(Gt);
|
|
47
|
+
function Ht(t) {
|
|
48
|
+
return t && t.__esModule ? t : { default: t };
|
|
49
|
+
}
|
|
50
|
+
function zt(t, e) {
|
|
51
|
+
if (!(t instanceof e))
|
|
52
|
+
throw new TypeError("Cannot call a class as a function");
|
|
53
|
+
}
|
|
54
|
+
function Xt(t, e) {
|
|
55
|
+
if (!t)
|
|
56
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
57
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
58
|
+
}
|
|
59
|
+
function Ut(t, e) {
|
|
60
|
+
if (typeof e != "function" && e !== null)
|
|
61
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
62
|
+
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);
|
|
63
|
+
}
|
|
64
|
+
var Vt = function(t) {
|
|
65
|
+
Ut(e, t);
|
|
66
|
+
function e(r, n) {
|
|
67
|
+
return zt(this, e), r = r.toUpperCase(), n.mod43 && (r += Yt(Qt(r))), Xt(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
68
|
+
}
|
|
69
|
+
return Nt(e, [{
|
|
70
|
+
key: "encode",
|
|
71
|
+
value: function() {
|
|
72
|
+
for (var n = ie("*"), a = 0; a < this.data.length; a++)
|
|
73
|
+
n += ie(this.data[a]) + "0";
|
|
74
|
+
return n += ie("*"), {
|
|
75
|
+
data: n,
|
|
76
|
+
text: this.text
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
key: "valid",
|
|
81
|
+
value: function() {
|
|
82
|
+
return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/) !== -1;
|
|
83
|
+
}
|
|
84
|
+
}]), e;
|
|
85
|
+
}(Ft.default), ut = ["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", "-", ".", " ", "$", "/", "+", "%", "*"], qt = [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];
|
|
86
|
+
function ie(t) {
|
|
87
|
+
return Jt(ft(t));
|
|
88
|
+
}
|
|
89
|
+
function Jt(t) {
|
|
90
|
+
return qt[t].toString(2);
|
|
91
|
+
}
|
|
92
|
+
function Yt(t) {
|
|
93
|
+
return ut[t];
|
|
94
|
+
}
|
|
95
|
+
function ft(t) {
|
|
96
|
+
return ut.indexOf(t);
|
|
97
|
+
}
|
|
98
|
+
function Qt(t) {
|
|
99
|
+
for (var e = 0, r = 0; r < t.length; r++)
|
|
100
|
+
e += ft(t[r]);
|
|
101
|
+
return e = e % 43, e;
|
|
102
|
+
}
|
|
103
|
+
J.CODE39 = Vt;
|
|
104
|
+
var s = {}, ye = {}, T = {}, f = {};
|
|
105
|
+
Object.defineProperty(f, "__esModule", {
|
|
106
|
+
value: !0
|
|
107
|
+
});
|
|
108
|
+
var D;
|
|
109
|
+
function oe(t, e, r) {
|
|
110
|
+
return e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
111
|
+
}
|
|
112
|
+
var ct = f.SET_A = 0, lt = f.SET_B = 1, dt = f.SET_C = 2;
|
|
113
|
+
f.SHIFT = 98;
|
|
114
|
+
var Wt = f.START_A = 103, Zt = f.START_B = 104, Kt = f.START_C = 105;
|
|
115
|
+
f.MODULO = 103;
|
|
116
|
+
f.STOP = 106;
|
|
117
|
+
f.FNC1 = 207;
|
|
118
|
+
f.SET_BY_CODE = (D = {}, oe(D, Wt, ct), oe(D, Zt, lt), oe(D, Kt, dt), D);
|
|
119
|
+
f.SWAP = {
|
|
120
|
+
101: ct,
|
|
121
|
+
100: lt,
|
|
122
|
+
99: dt
|
|
123
|
+
};
|
|
124
|
+
f.A_START_CHAR = "Ð";
|
|
125
|
+
f.B_START_CHAR = "Ñ";
|
|
126
|
+
f.C_START_CHAR = "Ò";
|
|
127
|
+
f.A_CHARS = "[\0-_È-Ï]";
|
|
128
|
+
f.B_CHARS = "[ -È-Ï]";
|
|
129
|
+
f.C_CHARS = "(Ï*[0-9]{2}Ï*)";
|
|
130
|
+
f.BARS = [11011001100, 11001101100, 11001100110, 10010011e3, 10010001100, 10001001100, 10011001e3, 10011000100, 10001100100, 11001001e3, 11001000100, 11000100100, 10110011100, 10011011100, 10011001110, 10111001100, 10011101100, 10011100110, 11001110010, 11001011100, 11001001110, 11011100100, 11001110100, 11101101110, 11101001100, 11100101100, 11100100110, 11101100100, 11100110100, 11100110010, 11011011e3, 11011000110, 11000110110, 10100011e3, 10001011e3, 10001000110, 10110001e3, 10001101e3, 10001100010, 11010001e3, 11000101e3, 11000100010, 10110111e3, 10110001110, 10001101110, 10111011e3, 10111000110, 10001110110, 11101110110, 11010001110, 11000101110, 11011101e3, 11011100010, 11011101110, 11101011e3, 11101000110, 11100010110, 11101101e3, 11101100010, 11100011010, 11101111010, 11001000010, 11110001010, 1010011e4, 10100001100, 1001011e4, 10010000110, 10000101100, 10000100110, 1011001e4, 10110000100, 1001101e4, 10011000010, 10000110100, 10000110010, 11000010010, 1100101e4, 11110111010, 11000010100, 10001111010, 10100111100, 10010111100, 10010011110, 10111100100, 10011110100, 10011110010, 11110100100, 11110010100, 11110010010, 11011011110, 11011110110, 11110110110, 10101111e3, 10100011110, 10001011110, 10111101e3, 10111100010, 11110101e3, 11110100010, 10111011110, 10111101110, 11101011110, 11110101110, 11010000100, 1101001e4, 11010011100, 1100011101011];
|
|
131
|
+
Object.defineProperty(T, "__esModule", {
|
|
132
|
+
value: !0
|
|
133
|
+
});
|
|
134
|
+
var en = /* @__PURE__ */ function() {
|
|
135
|
+
function t(e, r) {
|
|
136
|
+
for (var n = 0; n < r.length; n++) {
|
|
137
|
+
var a = r[n];
|
|
138
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return function(e, r, n) {
|
|
142
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
143
|
+
};
|
|
144
|
+
}(), tn = c, nn = rn(tn), d = f;
|
|
145
|
+
function rn(t) {
|
|
146
|
+
return t && t.__esModule ? t : { default: t };
|
|
147
|
+
}
|
|
148
|
+
function an(t, e) {
|
|
149
|
+
if (!(t instanceof e))
|
|
150
|
+
throw new TypeError("Cannot call a class as a function");
|
|
151
|
+
}
|
|
152
|
+
function on(t, e) {
|
|
153
|
+
if (!t)
|
|
154
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
155
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
156
|
+
}
|
|
157
|
+
function un(t, e) {
|
|
158
|
+
if (typeof e != "function" && e !== null)
|
|
159
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
160
|
+
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);
|
|
161
|
+
}
|
|
162
|
+
var fn = function(t) {
|
|
163
|
+
un(e, t);
|
|
164
|
+
function e(r, n) {
|
|
165
|
+
an(this, e);
|
|
166
|
+
var a = on(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r.substring(1), n));
|
|
167
|
+
return a.bytes = r.split("").map(function(i) {
|
|
168
|
+
return i.charCodeAt(0);
|
|
169
|
+
}), a;
|
|
170
|
+
}
|
|
171
|
+
return en(e, [{
|
|
172
|
+
key: "valid",
|
|
173
|
+
value: function() {
|
|
174
|
+
return /^[\x00-\x7F\xC8-\xD3]+$/.test(this.data);
|
|
175
|
+
}
|
|
176
|
+
// The public encoding function
|
|
177
|
+
}, {
|
|
178
|
+
key: "encode",
|
|
179
|
+
value: function() {
|
|
180
|
+
var n = this.bytes, a = n.shift() - 105, i = d.SET_BY_CODE[a];
|
|
181
|
+
if (i === void 0)
|
|
182
|
+
throw new RangeError("The encoding does not start with a start character.");
|
|
183
|
+
this.shouldEncodeAsEan128() === !0 && n.unshift(d.FNC1);
|
|
184
|
+
var o = e.next(n, 1, i);
|
|
185
|
+
return {
|
|
186
|
+
text: this.text === this.data ? this.text.replace(/[^\x20-\x7E]/g, "") : this.text,
|
|
187
|
+
data: (
|
|
188
|
+
// Add the start bits
|
|
189
|
+
e.getBar(a) + // Add the encoded bits
|
|
190
|
+
o.result + // Add the checksum
|
|
191
|
+
e.getBar((o.checksum + a) % d.MODULO) + // Add the end bits
|
|
192
|
+
e.getBar(d.STOP)
|
|
193
|
+
)
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
// GS1-128/EAN-128
|
|
197
|
+
}, {
|
|
198
|
+
key: "shouldEncodeAsEan128",
|
|
199
|
+
value: function() {
|
|
200
|
+
var n = this.options.ean128 || !1;
|
|
201
|
+
return typeof n == "string" && (n = n.toLowerCase() === "true"), n;
|
|
202
|
+
}
|
|
203
|
+
// Get a bar symbol by index
|
|
204
|
+
}], [{
|
|
205
|
+
key: "getBar",
|
|
206
|
+
value: function(n) {
|
|
207
|
+
return d.BARS[n] ? d.BARS[n].toString() : "";
|
|
208
|
+
}
|
|
209
|
+
// Correct an index by a set and shift it from the bytes array
|
|
210
|
+
}, {
|
|
211
|
+
key: "correctIndex",
|
|
212
|
+
value: function(n, a) {
|
|
213
|
+
if (a === d.SET_A) {
|
|
214
|
+
var i = n.shift();
|
|
215
|
+
return i < 32 ? i + 64 : i - 32;
|
|
216
|
+
} else return a === d.SET_B ? n.shift() - 32 : (n.shift() - 48) * 10 + n.shift() - 48;
|
|
217
|
+
}
|
|
218
|
+
}, {
|
|
219
|
+
key: "next",
|
|
220
|
+
value: function(n, a, i) {
|
|
221
|
+
if (!n.length)
|
|
222
|
+
return { result: "", checksum: 0 };
|
|
223
|
+
var o = void 0, u = void 0;
|
|
224
|
+
if (n[0] >= 200) {
|
|
225
|
+
u = n.shift() - 105;
|
|
226
|
+
var y = d.SWAP[u];
|
|
227
|
+
y !== void 0 ? o = e.next(n, a + 1, y) : ((i === d.SET_A || i === d.SET_B) && u === d.SHIFT && (n[0] = i === d.SET_A ? n[0] > 95 ? n[0] - 96 : n[0] : n[0] < 32 ? n[0] + 96 : n[0]), o = e.next(n, a + 1, i));
|
|
228
|
+
} else
|
|
229
|
+
u = e.correctIndex(n, i), o = e.next(n, a + 1, i);
|
|
230
|
+
var g = e.getBar(u), Dt = u * a;
|
|
231
|
+
return {
|
|
232
|
+
result: g + o.result,
|
|
233
|
+
checksum: Dt + o.checksum
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}]), e;
|
|
237
|
+
}(nn.default);
|
|
238
|
+
T.default = fn;
|
|
239
|
+
var se = {};
|
|
240
|
+
Object.defineProperty(se, "__esModule", {
|
|
241
|
+
value: !0
|
|
242
|
+
});
|
|
243
|
+
var O = f, ht = function(e) {
|
|
244
|
+
return e.match(new RegExp("^" + O.A_CHARS + "*"))[0].length;
|
|
245
|
+
}, _t = function(e) {
|
|
246
|
+
return e.match(new RegExp("^" + O.B_CHARS + "*"))[0].length;
|
|
247
|
+
}, vt = function(e) {
|
|
248
|
+
return e.match(new RegExp("^" + O.C_CHARS + "*"))[0];
|
|
249
|
+
};
|
|
250
|
+
function pe(t, e) {
|
|
251
|
+
var r = e ? O.A_CHARS : O.B_CHARS, n = t.match(new RegExp("^(" + r + "+?)(([0-9]{2}){2,})([^0-9]|$)"));
|
|
252
|
+
if (n)
|
|
253
|
+
return n[1] + "Ì" + yt(t.substring(n[1].length));
|
|
254
|
+
var a = t.match(new RegExp("^" + r + "+"))[0];
|
|
255
|
+
return a.length === t.length ? t : a + String.fromCharCode(e ? 205 : 206) + pe(t.substring(a.length), !e);
|
|
256
|
+
}
|
|
257
|
+
function yt(t) {
|
|
258
|
+
var e = vt(t), r = e.length;
|
|
259
|
+
if (r === t.length)
|
|
260
|
+
return t;
|
|
261
|
+
t = t.substring(r);
|
|
262
|
+
var n = ht(t) >= _t(t);
|
|
263
|
+
return e + String.fromCharCode(n ? 206 : 205) + pe(t, n);
|
|
264
|
+
}
|
|
265
|
+
se.default = function(t) {
|
|
266
|
+
var e = void 0, r = vt(t).length;
|
|
267
|
+
if (r >= 2)
|
|
268
|
+
e = O.C_START_CHAR + yt(t);
|
|
269
|
+
else {
|
|
270
|
+
var n = ht(t) > _t(t);
|
|
271
|
+
e = (n ? O.A_START_CHAR : O.B_START_CHAR) + pe(t, n);
|
|
272
|
+
}
|
|
273
|
+
return e.replace(
|
|
274
|
+
/[\xCD\xCE]([^])[\xCD\xCE]/,
|
|
275
|
+
// Any sequence between 205 and 206 characters
|
|
276
|
+
function(a, i) {
|
|
277
|
+
return "Ë" + i;
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
};
|
|
281
|
+
Object.defineProperty(ye, "__esModule", {
|
|
282
|
+
value: !0
|
|
283
|
+
});
|
|
284
|
+
var cn = T, ln = st(cn), dn = se, hn = st(dn);
|
|
285
|
+
function st(t) {
|
|
286
|
+
return t && t.__esModule ? t : { default: t };
|
|
287
|
+
}
|
|
288
|
+
function _n(t, e) {
|
|
289
|
+
if (!(t instanceof e))
|
|
290
|
+
throw new TypeError("Cannot call a class as a function");
|
|
291
|
+
}
|
|
292
|
+
function ue(t, e) {
|
|
293
|
+
if (!t)
|
|
294
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
295
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
296
|
+
}
|
|
297
|
+
function vn(t, e) {
|
|
298
|
+
if (typeof e != "function" && e !== null)
|
|
299
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
300
|
+
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);
|
|
301
|
+
}
|
|
302
|
+
var yn = function(t) {
|
|
303
|
+
vn(e, t);
|
|
304
|
+
function e(r, n) {
|
|
305
|
+
if (_n(this, e), /^[\x00-\x7F\xC8-\xD3]+$/.test(r))
|
|
306
|
+
var a = ue(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, (0, hn.default)(r), n));
|
|
307
|
+
else
|
|
308
|
+
var a = ue(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
309
|
+
return ue(a);
|
|
310
|
+
}
|
|
311
|
+
return e;
|
|
312
|
+
}(ln.default);
|
|
313
|
+
ye.default = yn;
|
|
314
|
+
var ge = {};
|
|
315
|
+
Object.defineProperty(ge, "__esModule", {
|
|
316
|
+
value: !0
|
|
317
|
+
});
|
|
318
|
+
var sn = /* @__PURE__ */ function() {
|
|
319
|
+
function t(e, r) {
|
|
320
|
+
for (var n = 0; n < r.length; n++) {
|
|
321
|
+
var a = r[n];
|
|
322
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return function(e, r, n) {
|
|
326
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
327
|
+
};
|
|
328
|
+
}(), pn = T, gn = On(pn), Ve = f;
|
|
329
|
+
function On(t) {
|
|
330
|
+
return t && t.__esModule ? t : { default: t };
|
|
331
|
+
}
|
|
332
|
+
function En(t, e) {
|
|
333
|
+
if (!(t instanceof e))
|
|
334
|
+
throw new TypeError("Cannot call a class as a function");
|
|
335
|
+
}
|
|
336
|
+
function bn(t, e) {
|
|
337
|
+
if (!t)
|
|
338
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
339
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
340
|
+
}
|
|
341
|
+
function wn(t, e) {
|
|
342
|
+
if (typeof e != "function" && e !== null)
|
|
343
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
344
|
+
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);
|
|
345
|
+
}
|
|
346
|
+
var mn = function(t) {
|
|
347
|
+
wn(e, t);
|
|
348
|
+
function e(r, n) {
|
|
349
|
+
return En(this, e), bn(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, Ve.A_START_CHAR + r, n));
|
|
350
|
+
}
|
|
351
|
+
return sn(e, [{
|
|
352
|
+
key: "valid",
|
|
353
|
+
value: function() {
|
|
354
|
+
return new RegExp("^" + Ve.A_CHARS + "+$").test(this.data);
|
|
355
|
+
}
|
|
356
|
+
}]), e;
|
|
357
|
+
}(gn.default);
|
|
358
|
+
ge.default = mn;
|
|
359
|
+
var Oe = {};
|
|
360
|
+
Object.defineProperty(Oe, "__esModule", {
|
|
361
|
+
value: !0
|
|
362
|
+
});
|
|
363
|
+
var $n = /* @__PURE__ */ function() {
|
|
364
|
+
function t(e, r) {
|
|
365
|
+
for (var n = 0; n < r.length; n++) {
|
|
366
|
+
var a = r[n];
|
|
367
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return function(e, r, n) {
|
|
371
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
372
|
+
};
|
|
373
|
+
}(), xn = T, Sn = An(xn), qe = f;
|
|
374
|
+
function An(t) {
|
|
375
|
+
return t && t.__esModule ? t : { default: t };
|
|
376
|
+
}
|
|
377
|
+
function Rn(t, e) {
|
|
378
|
+
if (!(t instanceof e))
|
|
379
|
+
throw new TypeError("Cannot call a class as a function");
|
|
380
|
+
}
|
|
381
|
+
function Pn(t, e) {
|
|
382
|
+
if (!t)
|
|
383
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
384
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
385
|
+
}
|
|
386
|
+
function Tn(t, e) {
|
|
387
|
+
if (typeof e != "function" && e !== null)
|
|
388
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
389
|
+
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);
|
|
390
|
+
}
|
|
391
|
+
var Mn = function(t) {
|
|
392
|
+
Tn(e, t);
|
|
393
|
+
function e(r, n) {
|
|
394
|
+
return Rn(this, e), Pn(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, qe.B_START_CHAR + r, n));
|
|
395
|
+
}
|
|
396
|
+
return $n(e, [{
|
|
397
|
+
key: "valid",
|
|
398
|
+
value: function() {
|
|
399
|
+
return new RegExp("^" + qe.B_CHARS + "+$").test(this.data);
|
|
400
|
+
}
|
|
401
|
+
}]), e;
|
|
402
|
+
}(Sn.default);
|
|
403
|
+
Oe.default = Mn;
|
|
404
|
+
var Ee = {};
|
|
405
|
+
Object.defineProperty(Ee, "__esModule", {
|
|
406
|
+
value: !0
|
|
407
|
+
});
|
|
408
|
+
var In = /* @__PURE__ */ function() {
|
|
409
|
+
function t(e, r) {
|
|
410
|
+
for (var n = 0; n < r.length; n++) {
|
|
411
|
+
var a = r[n];
|
|
412
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return function(e, r, n) {
|
|
416
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
417
|
+
};
|
|
418
|
+
}(), kn = T, Dn = jn(kn), Je = f;
|
|
419
|
+
function jn(t) {
|
|
420
|
+
return t && t.__esModule ? t : { default: t };
|
|
421
|
+
}
|
|
422
|
+
function Bn(t, e) {
|
|
423
|
+
if (!(t instanceof e))
|
|
424
|
+
throw new TypeError("Cannot call a class as a function");
|
|
425
|
+
}
|
|
426
|
+
function Ln(t, e) {
|
|
427
|
+
if (!t)
|
|
428
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
429
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
430
|
+
}
|
|
431
|
+
function Cn(t, e) {
|
|
432
|
+
if (typeof e != "function" && e !== null)
|
|
433
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
434
|
+
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);
|
|
435
|
+
}
|
|
436
|
+
var Nn = function(t) {
|
|
437
|
+
Cn(e, t);
|
|
438
|
+
function e(r, n) {
|
|
439
|
+
return Bn(this, e), Ln(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, Je.C_START_CHAR + r, n));
|
|
440
|
+
}
|
|
441
|
+
return In(e, [{
|
|
442
|
+
key: "valid",
|
|
443
|
+
value: function() {
|
|
444
|
+
return new RegExp("^" + Je.C_CHARS + "+$").test(this.data);
|
|
445
|
+
}
|
|
446
|
+
}]), e;
|
|
447
|
+
}(Dn.default);
|
|
448
|
+
Ee.default = Nn;
|
|
449
|
+
Object.defineProperty(s, "__esModule", {
|
|
450
|
+
value: !0
|
|
451
|
+
});
|
|
452
|
+
s.CODE128C = s.CODE128B = s.CODE128A = s.CODE128 = void 0;
|
|
453
|
+
var Gn = ye, Fn = Y(Gn), Hn = ge, zn = Y(Hn), Xn = Oe, Un = Y(Xn), Vn = Ee, qn = Y(Vn);
|
|
454
|
+
function Y(t) {
|
|
455
|
+
return t && t.__esModule ? t : { default: t };
|
|
456
|
+
}
|
|
457
|
+
s.CODE128 = Fn.default;
|
|
458
|
+
s.CODE128A = zn.default;
|
|
459
|
+
s.CODE128B = Un.default;
|
|
460
|
+
s.CODE128C = qn.default;
|
|
461
|
+
var l = {}, be = {}, v = {};
|
|
462
|
+
Object.defineProperty(v, "__esModule", {
|
|
463
|
+
value: !0
|
|
464
|
+
});
|
|
465
|
+
v.SIDE_BIN = "101";
|
|
466
|
+
v.MIDDLE_BIN = "01010";
|
|
467
|
+
v.BINARIES = {
|
|
468
|
+
L: [
|
|
469
|
+
// The L (left) type of encoding
|
|
470
|
+
"0001101",
|
|
471
|
+
"0011001",
|
|
472
|
+
"0010011",
|
|
473
|
+
"0111101",
|
|
474
|
+
"0100011",
|
|
475
|
+
"0110001",
|
|
476
|
+
"0101111",
|
|
477
|
+
"0111011",
|
|
478
|
+
"0110111",
|
|
479
|
+
"0001011"
|
|
480
|
+
],
|
|
481
|
+
G: [
|
|
482
|
+
// The G type of encoding
|
|
483
|
+
"0100111",
|
|
484
|
+
"0110011",
|
|
485
|
+
"0011011",
|
|
486
|
+
"0100001",
|
|
487
|
+
"0011101",
|
|
488
|
+
"0111001",
|
|
489
|
+
"0000101",
|
|
490
|
+
"0010001",
|
|
491
|
+
"0001001",
|
|
492
|
+
"0010111"
|
|
493
|
+
],
|
|
494
|
+
R: [
|
|
495
|
+
// The R (right) type of encoding
|
|
496
|
+
"1110010",
|
|
497
|
+
"1100110",
|
|
498
|
+
"1101100",
|
|
499
|
+
"1000010",
|
|
500
|
+
"1011100",
|
|
501
|
+
"1001110",
|
|
502
|
+
"1010000",
|
|
503
|
+
"1000100",
|
|
504
|
+
"1001000",
|
|
505
|
+
"1110100"
|
|
506
|
+
],
|
|
507
|
+
O: [
|
|
508
|
+
// The O (odd) encoding for UPC-E
|
|
509
|
+
"0001101",
|
|
510
|
+
"0011001",
|
|
511
|
+
"0010011",
|
|
512
|
+
"0111101",
|
|
513
|
+
"0100011",
|
|
514
|
+
"0110001",
|
|
515
|
+
"0101111",
|
|
516
|
+
"0111011",
|
|
517
|
+
"0110111",
|
|
518
|
+
"0001011"
|
|
519
|
+
],
|
|
520
|
+
E: [
|
|
521
|
+
// The E (even) encoding for UPC-E
|
|
522
|
+
"0100111",
|
|
523
|
+
"0110011",
|
|
524
|
+
"0011011",
|
|
525
|
+
"0100001",
|
|
526
|
+
"0011101",
|
|
527
|
+
"0111001",
|
|
528
|
+
"0000101",
|
|
529
|
+
"0010001",
|
|
530
|
+
"0001001",
|
|
531
|
+
"0010111"
|
|
532
|
+
]
|
|
533
|
+
};
|
|
534
|
+
v.EAN2_STRUCTURE = ["LL", "LG", "GL", "GG"];
|
|
535
|
+
v.EAN5_STRUCTURE = ["GGLLL", "GLGLL", "GLLGL", "GLLLG", "LGGLL", "LLGGL", "LLLGG", "LGLGL", "LGLLG", "LLGLG"];
|
|
536
|
+
v.EAN13_STRUCTURE = ["LLLLLL", "LLGLGG", "LLGGLG", "LLGGGL", "LGLLGG", "LGGLLG", "LGGGLL", "LGLGLG", "LGLGGL", "LGGLGL"];
|
|
537
|
+
var Q = {}, w = {};
|
|
538
|
+
Object.defineProperty(w, "__esModule", {
|
|
539
|
+
value: !0
|
|
540
|
+
});
|
|
541
|
+
var Jn = v, Yn = function(e, r, n) {
|
|
542
|
+
var a = e.split("").map(function(o, u) {
|
|
543
|
+
return Jn.BINARIES[r[u]];
|
|
544
|
+
}).map(function(o, u) {
|
|
545
|
+
return o ? o[e[u]] : "";
|
|
546
|
+
});
|
|
547
|
+
if (n) {
|
|
548
|
+
var i = e.length - 1;
|
|
549
|
+
a = a.map(function(o, u) {
|
|
550
|
+
return u < i ? o + n : o;
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
return a.join("");
|
|
554
|
+
};
|
|
555
|
+
w.default = Yn;
|
|
556
|
+
Object.defineProperty(Q, "__esModule", {
|
|
557
|
+
value: !0
|
|
558
|
+
});
|
|
559
|
+
var Qn = /* @__PURE__ */ function() {
|
|
560
|
+
function t(e, r) {
|
|
561
|
+
for (var n = 0; n < r.length; n++) {
|
|
562
|
+
var a = r[n];
|
|
563
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return function(e, r, n) {
|
|
567
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
568
|
+
};
|
|
569
|
+
}(), x = v, Wn = w, Ye = pt(Wn), Zn = c, Kn = pt(Zn);
|
|
570
|
+
function pt(t) {
|
|
571
|
+
return t && t.__esModule ? t : { default: t };
|
|
572
|
+
}
|
|
573
|
+
function er(t, e) {
|
|
574
|
+
if (!(t instanceof e))
|
|
575
|
+
throw new TypeError("Cannot call a class as a function");
|
|
576
|
+
}
|
|
577
|
+
function tr(t, e) {
|
|
578
|
+
if (!t)
|
|
579
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
580
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
581
|
+
}
|
|
582
|
+
function nr(t, e) {
|
|
583
|
+
if (typeof e != "function" && e !== null)
|
|
584
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
585
|
+
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);
|
|
586
|
+
}
|
|
587
|
+
var rr = function(t) {
|
|
588
|
+
nr(e, t);
|
|
589
|
+
function e(r, n) {
|
|
590
|
+
er(this, e);
|
|
591
|
+
var a = tr(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
592
|
+
return a.fontSize = !n.flat && n.fontSize > n.width * 10 ? n.width * 10 : n.fontSize, a.guardHeight = n.height + a.fontSize / 2 + n.textMargin, a;
|
|
593
|
+
}
|
|
594
|
+
return Qn(e, [{
|
|
595
|
+
key: "encode",
|
|
596
|
+
value: function() {
|
|
597
|
+
return this.options.flat ? this.encodeFlat() : this.encodeGuarded();
|
|
598
|
+
}
|
|
599
|
+
}, {
|
|
600
|
+
key: "leftText",
|
|
601
|
+
value: function(n, a) {
|
|
602
|
+
return this.text.substr(n, a);
|
|
603
|
+
}
|
|
604
|
+
}, {
|
|
605
|
+
key: "leftEncode",
|
|
606
|
+
value: function(n, a) {
|
|
607
|
+
return (0, Ye.default)(n, a);
|
|
608
|
+
}
|
|
609
|
+
}, {
|
|
610
|
+
key: "rightText",
|
|
611
|
+
value: function(n, a) {
|
|
612
|
+
return this.text.substr(n, a);
|
|
613
|
+
}
|
|
614
|
+
}, {
|
|
615
|
+
key: "rightEncode",
|
|
616
|
+
value: function(n, a) {
|
|
617
|
+
return (0, Ye.default)(n, a);
|
|
618
|
+
}
|
|
619
|
+
}, {
|
|
620
|
+
key: "encodeGuarded",
|
|
621
|
+
value: function() {
|
|
622
|
+
var n = { fontSize: this.fontSize }, a = { height: this.guardHeight };
|
|
623
|
+
return [{ data: x.SIDE_BIN, options: a }, { data: this.leftEncode(), text: this.leftText(), options: n }, { data: x.MIDDLE_BIN, options: a }, { data: this.rightEncode(), text: this.rightText(), options: n }, { data: x.SIDE_BIN, options: a }];
|
|
624
|
+
}
|
|
625
|
+
}, {
|
|
626
|
+
key: "encodeFlat",
|
|
627
|
+
value: function() {
|
|
628
|
+
var n = [x.SIDE_BIN, this.leftEncode(), x.MIDDLE_BIN, this.rightEncode(), x.SIDE_BIN];
|
|
629
|
+
return {
|
|
630
|
+
data: n.join(""),
|
|
631
|
+
text: this.text
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
}]), e;
|
|
635
|
+
}(Kn.default);
|
|
636
|
+
Q.default = rr;
|
|
637
|
+
Object.defineProperty(be, "__esModule", {
|
|
638
|
+
value: !0
|
|
639
|
+
});
|
|
640
|
+
var ar = /* @__PURE__ */ function() {
|
|
641
|
+
function t(e, r) {
|
|
642
|
+
for (var n = 0; n < r.length; n++) {
|
|
643
|
+
var a = r[n];
|
|
644
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
return function(e, r, n) {
|
|
648
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
649
|
+
};
|
|
650
|
+
}(), j = function t(e, r, n) {
|
|
651
|
+
e === null && (e = Function.prototype);
|
|
652
|
+
var a = Object.getOwnPropertyDescriptor(e, r);
|
|
653
|
+
if (a === void 0) {
|
|
654
|
+
var i = Object.getPrototypeOf(e);
|
|
655
|
+
return i === null ? void 0 : t(i, r, n);
|
|
656
|
+
} else {
|
|
657
|
+
if ("value" in a)
|
|
658
|
+
return a.value;
|
|
659
|
+
var o = a.get;
|
|
660
|
+
return o === void 0 ? void 0 : o.call(n);
|
|
661
|
+
}
|
|
662
|
+
}, ir = v, or = Q, ur = fr(or);
|
|
663
|
+
function fr(t) {
|
|
664
|
+
return t && t.__esModule ? t : { default: t };
|
|
665
|
+
}
|
|
666
|
+
function cr(t, e) {
|
|
667
|
+
if (!(t instanceof e))
|
|
668
|
+
throw new TypeError("Cannot call a class as a function");
|
|
669
|
+
}
|
|
670
|
+
function lr(t, e) {
|
|
671
|
+
if (!t)
|
|
672
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
673
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
674
|
+
}
|
|
675
|
+
function dr(t, e) {
|
|
676
|
+
if (typeof e != "function" && e !== null)
|
|
677
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
678
|
+
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);
|
|
679
|
+
}
|
|
680
|
+
var Qe = function(e) {
|
|
681
|
+
var r = e.substr(0, 12).split("").map(function(n) {
|
|
682
|
+
return +n;
|
|
683
|
+
}).reduce(function(n, a, i) {
|
|
684
|
+
return i % 2 ? n + a * 3 : n + a;
|
|
685
|
+
}, 0);
|
|
686
|
+
return (10 - r % 10) % 10;
|
|
687
|
+
}, hr = function(t) {
|
|
688
|
+
dr(e, t);
|
|
689
|
+
function e(r, n) {
|
|
690
|
+
cr(this, e), r.search(/^[0-9]{12}$/) !== -1 && (r += Qe(r));
|
|
691
|
+
var a = lr(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
692
|
+
return a.lastChar = n.lastChar, a;
|
|
693
|
+
}
|
|
694
|
+
return ar(e, [{
|
|
695
|
+
key: "valid",
|
|
696
|
+
value: function() {
|
|
697
|
+
return this.data.search(/^[0-9]{13}$/) !== -1 && +this.data[12] === Qe(this.data);
|
|
698
|
+
}
|
|
699
|
+
}, {
|
|
700
|
+
key: "leftText",
|
|
701
|
+
value: function() {
|
|
702
|
+
return j(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "leftText", this).call(this, 1, 6);
|
|
703
|
+
}
|
|
704
|
+
}, {
|
|
705
|
+
key: "leftEncode",
|
|
706
|
+
value: function() {
|
|
707
|
+
var n = this.data.substr(1, 6), a = ir.EAN13_STRUCTURE[this.data[0]];
|
|
708
|
+
return j(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "leftEncode", this).call(this, n, a);
|
|
709
|
+
}
|
|
710
|
+
}, {
|
|
711
|
+
key: "rightText",
|
|
712
|
+
value: function() {
|
|
713
|
+
return j(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "rightText", this).call(this, 7, 6);
|
|
714
|
+
}
|
|
715
|
+
}, {
|
|
716
|
+
key: "rightEncode",
|
|
717
|
+
value: function() {
|
|
718
|
+
var n = this.data.substr(7, 6);
|
|
719
|
+
return j(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "rightEncode", this).call(this, n, "RRRRRR");
|
|
720
|
+
}
|
|
721
|
+
// The "standard" way of printing EAN13 barcodes with guard bars
|
|
722
|
+
}, {
|
|
723
|
+
key: "encodeGuarded",
|
|
724
|
+
value: function() {
|
|
725
|
+
var n = j(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "encodeGuarded", this).call(this);
|
|
726
|
+
return this.options.displayValue && (n.unshift({
|
|
727
|
+
data: "000000000000",
|
|
728
|
+
text: this.text.substr(0, 1),
|
|
729
|
+
options: { textAlign: "left", fontSize: this.fontSize }
|
|
730
|
+
}), this.options.lastChar && (n.push({
|
|
731
|
+
data: "00"
|
|
732
|
+
}), n.push({
|
|
733
|
+
data: "00000",
|
|
734
|
+
text: this.options.lastChar,
|
|
735
|
+
options: { fontSize: this.fontSize }
|
|
736
|
+
}))), n;
|
|
737
|
+
}
|
|
738
|
+
}]), e;
|
|
739
|
+
}(ur.default);
|
|
740
|
+
be.default = hr;
|
|
741
|
+
var we = {};
|
|
742
|
+
Object.defineProperty(we, "__esModule", {
|
|
743
|
+
value: !0
|
|
744
|
+
});
|
|
745
|
+
var _r = /* @__PURE__ */ function() {
|
|
746
|
+
function t(e, r) {
|
|
747
|
+
for (var n = 0; n < r.length; n++) {
|
|
748
|
+
var a = r[n];
|
|
749
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
return function(e, r, n) {
|
|
753
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
754
|
+
};
|
|
755
|
+
}(), z = function t(e, r, n) {
|
|
756
|
+
e === null && (e = Function.prototype);
|
|
757
|
+
var a = Object.getOwnPropertyDescriptor(e, r);
|
|
758
|
+
if (a === void 0) {
|
|
759
|
+
var i = Object.getPrototypeOf(e);
|
|
760
|
+
return i === null ? void 0 : t(i, r, n);
|
|
761
|
+
} else {
|
|
762
|
+
if ("value" in a)
|
|
763
|
+
return a.value;
|
|
764
|
+
var o = a.get;
|
|
765
|
+
return o === void 0 ? void 0 : o.call(n);
|
|
766
|
+
}
|
|
767
|
+
}, vr = Q, yr = sr(vr);
|
|
768
|
+
function sr(t) {
|
|
769
|
+
return t && t.__esModule ? t : { default: t };
|
|
770
|
+
}
|
|
771
|
+
function pr(t, e) {
|
|
772
|
+
if (!(t instanceof e))
|
|
773
|
+
throw new TypeError("Cannot call a class as a function");
|
|
774
|
+
}
|
|
775
|
+
function gr(t, e) {
|
|
776
|
+
if (!t)
|
|
777
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
778
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
779
|
+
}
|
|
780
|
+
function Or(t, e) {
|
|
781
|
+
if (typeof e != "function" && e !== null)
|
|
782
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
783
|
+
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);
|
|
784
|
+
}
|
|
785
|
+
var We = function(e) {
|
|
786
|
+
var r = e.substr(0, 7).split("").map(function(n) {
|
|
787
|
+
return +n;
|
|
788
|
+
}).reduce(function(n, a, i) {
|
|
789
|
+
return i % 2 ? n + a : n + a * 3;
|
|
790
|
+
}, 0);
|
|
791
|
+
return (10 - r % 10) % 10;
|
|
792
|
+
}, Er = function(t) {
|
|
793
|
+
Or(e, t);
|
|
794
|
+
function e(r, n) {
|
|
795
|
+
return pr(this, e), r.search(/^[0-9]{7}$/) !== -1 && (r += We(r)), gr(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
796
|
+
}
|
|
797
|
+
return _r(e, [{
|
|
798
|
+
key: "valid",
|
|
799
|
+
value: function() {
|
|
800
|
+
return this.data.search(/^[0-9]{8}$/) !== -1 && +this.data[7] === We(this.data);
|
|
801
|
+
}
|
|
802
|
+
}, {
|
|
803
|
+
key: "leftText",
|
|
804
|
+
value: function() {
|
|
805
|
+
return z(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "leftText", this).call(this, 0, 4);
|
|
806
|
+
}
|
|
807
|
+
}, {
|
|
808
|
+
key: "leftEncode",
|
|
809
|
+
value: function() {
|
|
810
|
+
var n = this.data.substr(0, 4);
|
|
811
|
+
return z(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "leftEncode", this).call(this, n, "LLLL");
|
|
812
|
+
}
|
|
813
|
+
}, {
|
|
814
|
+
key: "rightText",
|
|
815
|
+
value: function() {
|
|
816
|
+
return z(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "rightText", this).call(this, 4, 4);
|
|
817
|
+
}
|
|
818
|
+
}, {
|
|
819
|
+
key: "rightEncode",
|
|
820
|
+
value: function() {
|
|
821
|
+
var n = this.data.substr(4, 4);
|
|
822
|
+
return z(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "rightEncode", this).call(this, n, "RRRR");
|
|
823
|
+
}
|
|
824
|
+
}]), e;
|
|
825
|
+
}(yr.default);
|
|
826
|
+
we.default = Er;
|
|
827
|
+
var me = {};
|
|
828
|
+
Object.defineProperty(me, "__esModule", {
|
|
829
|
+
value: !0
|
|
830
|
+
});
|
|
831
|
+
var br = /* @__PURE__ */ function() {
|
|
832
|
+
function t(e, r) {
|
|
833
|
+
for (var n = 0; n < r.length; n++) {
|
|
834
|
+
var a = r[n];
|
|
835
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
return function(e, r, n) {
|
|
839
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
840
|
+
};
|
|
841
|
+
}(), wr = v, mr = w, $r = gt(mr), xr = c, Sr = gt(xr);
|
|
842
|
+
function gt(t) {
|
|
843
|
+
return t && t.__esModule ? t : { default: t };
|
|
844
|
+
}
|
|
845
|
+
function Ar(t, e) {
|
|
846
|
+
if (!(t instanceof e))
|
|
847
|
+
throw new TypeError("Cannot call a class as a function");
|
|
848
|
+
}
|
|
849
|
+
function Rr(t, e) {
|
|
850
|
+
if (!t)
|
|
851
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
852
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
853
|
+
}
|
|
854
|
+
function Pr(t, e) {
|
|
855
|
+
if (typeof e != "function" && e !== null)
|
|
856
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
857
|
+
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);
|
|
858
|
+
}
|
|
859
|
+
var Tr = function(e) {
|
|
860
|
+
var r = e.split("").map(function(n) {
|
|
861
|
+
return +n;
|
|
862
|
+
}).reduce(function(n, a, i) {
|
|
863
|
+
return i % 2 ? n + a * 9 : n + a * 3;
|
|
864
|
+
}, 0);
|
|
865
|
+
return r % 10;
|
|
866
|
+
}, Mr = function(t) {
|
|
867
|
+
Pr(e, t);
|
|
868
|
+
function e(r, n) {
|
|
869
|
+
return Ar(this, e), Rr(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
870
|
+
}
|
|
871
|
+
return br(e, [{
|
|
872
|
+
key: "valid",
|
|
873
|
+
value: function() {
|
|
874
|
+
return this.data.search(/^[0-9]{5}$/) !== -1;
|
|
875
|
+
}
|
|
876
|
+
}, {
|
|
877
|
+
key: "encode",
|
|
878
|
+
value: function() {
|
|
879
|
+
var n = wr.EAN5_STRUCTURE[Tr(this.data)];
|
|
880
|
+
return {
|
|
881
|
+
data: "1011" + (0, $r.default)(this.data, n, "01"),
|
|
882
|
+
text: this.text
|
|
883
|
+
};
|
|
884
|
+
}
|
|
885
|
+
}]), e;
|
|
886
|
+
}(Sr.default);
|
|
887
|
+
me.default = Mr;
|
|
888
|
+
var $e = {};
|
|
889
|
+
Object.defineProperty($e, "__esModule", {
|
|
890
|
+
value: !0
|
|
891
|
+
});
|
|
892
|
+
var Ir = /* @__PURE__ */ function() {
|
|
893
|
+
function t(e, r) {
|
|
894
|
+
for (var n = 0; n < r.length; n++) {
|
|
895
|
+
var a = r[n];
|
|
896
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
return function(e, r, n) {
|
|
900
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
901
|
+
};
|
|
902
|
+
}(), kr = v, Dr = w, jr = Ot(Dr), Br = c, Lr = Ot(Br);
|
|
903
|
+
function Ot(t) {
|
|
904
|
+
return t && t.__esModule ? t : { default: t };
|
|
905
|
+
}
|
|
906
|
+
function Cr(t, e) {
|
|
907
|
+
if (!(t instanceof e))
|
|
908
|
+
throw new TypeError("Cannot call a class as a function");
|
|
909
|
+
}
|
|
910
|
+
function Nr(t, e) {
|
|
911
|
+
if (!t)
|
|
912
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
913
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
914
|
+
}
|
|
915
|
+
function Gr(t, e) {
|
|
916
|
+
if (typeof e != "function" && e !== null)
|
|
917
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
918
|
+
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);
|
|
919
|
+
}
|
|
920
|
+
var Fr = function(t) {
|
|
921
|
+
Gr(e, t);
|
|
922
|
+
function e(r, n) {
|
|
923
|
+
return Cr(this, e), Nr(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
924
|
+
}
|
|
925
|
+
return Ir(e, [{
|
|
926
|
+
key: "valid",
|
|
927
|
+
value: function() {
|
|
928
|
+
return this.data.search(/^[0-9]{2}$/) !== -1;
|
|
929
|
+
}
|
|
930
|
+
}, {
|
|
931
|
+
key: "encode",
|
|
932
|
+
value: function() {
|
|
933
|
+
var n = kr.EAN2_STRUCTURE[parseInt(this.data) % 4];
|
|
934
|
+
return {
|
|
935
|
+
// Start bits + Encode the two digits with 01 in between
|
|
936
|
+
data: "1011" + (0, jr.default)(this.data, n, "01"),
|
|
937
|
+
text: this.text
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
}]), e;
|
|
941
|
+
}(Lr.default);
|
|
942
|
+
$e.default = Fr;
|
|
943
|
+
var C = {};
|
|
944
|
+
Object.defineProperty(C, "__esModule", {
|
|
945
|
+
value: !0
|
|
946
|
+
});
|
|
947
|
+
var Hr = /* @__PURE__ */ function() {
|
|
948
|
+
function t(e, r) {
|
|
949
|
+
for (var n = 0; n < r.length; n++) {
|
|
950
|
+
var a = r[n];
|
|
951
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
return function(e, r, n) {
|
|
955
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
956
|
+
};
|
|
957
|
+
}();
|
|
958
|
+
C.checksum = de;
|
|
959
|
+
var zr = w, S = Et(zr), Xr = c, Ur = Et(Xr);
|
|
960
|
+
function Et(t) {
|
|
961
|
+
return t && t.__esModule ? t : { default: t };
|
|
962
|
+
}
|
|
963
|
+
function Vr(t, e) {
|
|
964
|
+
if (!(t instanceof e))
|
|
965
|
+
throw new TypeError("Cannot call a class as a function");
|
|
966
|
+
}
|
|
967
|
+
function qr(t, e) {
|
|
968
|
+
if (!t)
|
|
969
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
970
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
971
|
+
}
|
|
972
|
+
function Jr(t, e) {
|
|
973
|
+
if (typeof e != "function" && e !== null)
|
|
974
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
975
|
+
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);
|
|
976
|
+
}
|
|
977
|
+
var Yr = function(t) {
|
|
978
|
+
Jr(e, t);
|
|
979
|
+
function e(r, n) {
|
|
980
|
+
Vr(this, e), r.search(/^[0-9]{11}$/) !== -1 && (r += de(r));
|
|
981
|
+
var a = qr(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
982
|
+
return a.displayValue = n.displayValue, n.fontSize > n.width * 10 ? a.fontSize = n.width * 10 : a.fontSize = n.fontSize, a.guardHeight = n.height + a.fontSize / 2 + n.textMargin, a;
|
|
983
|
+
}
|
|
984
|
+
return Hr(e, [{
|
|
985
|
+
key: "valid",
|
|
986
|
+
value: function() {
|
|
987
|
+
return this.data.search(/^[0-9]{12}$/) !== -1 && this.data[11] == de(this.data);
|
|
988
|
+
}
|
|
989
|
+
}, {
|
|
990
|
+
key: "encode",
|
|
991
|
+
value: function() {
|
|
992
|
+
return this.options.flat ? this.flatEncoding() : this.guardedEncoding();
|
|
993
|
+
}
|
|
994
|
+
}, {
|
|
995
|
+
key: "flatEncoding",
|
|
996
|
+
value: function() {
|
|
997
|
+
var n = "";
|
|
998
|
+
return n += "101", n += (0, S.default)(this.data.substr(0, 6), "LLLLLL"), n += "01010", n += (0, S.default)(this.data.substr(6, 6), "RRRRRR"), n += "101", {
|
|
999
|
+
data: n,
|
|
1000
|
+
text: this.text
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
}, {
|
|
1004
|
+
key: "guardedEncoding",
|
|
1005
|
+
value: function() {
|
|
1006
|
+
var n = [];
|
|
1007
|
+
return this.displayValue && n.push({
|
|
1008
|
+
data: "00000000",
|
|
1009
|
+
text: this.text.substr(0, 1),
|
|
1010
|
+
options: { textAlign: "left", fontSize: this.fontSize }
|
|
1011
|
+
}), n.push({
|
|
1012
|
+
data: "101" + (0, S.default)(this.data[0], "L"),
|
|
1013
|
+
options: { height: this.guardHeight }
|
|
1014
|
+
}), n.push({
|
|
1015
|
+
data: (0, S.default)(this.data.substr(1, 5), "LLLLL"),
|
|
1016
|
+
text: this.text.substr(1, 5),
|
|
1017
|
+
options: { fontSize: this.fontSize }
|
|
1018
|
+
}), n.push({
|
|
1019
|
+
data: "01010",
|
|
1020
|
+
options: { height: this.guardHeight }
|
|
1021
|
+
}), n.push({
|
|
1022
|
+
data: (0, S.default)(this.data.substr(6, 5), "RRRRR"),
|
|
1023
|
+
text: this.text.substr(6, 5),
|
|
1024
|
+
options: { fontSize: this.fontSize }
|
|
1025
|
+
}), n.push({
|
|
1026
|
+
data: (0, S.default)(this.data[11], "R") + "101",
|
|
1027
|
+
options: { height: this.guardHeight }
|
|
1028
|
+
}), this.displayValue && n.push({
|
|
1029
|
+
data: "00000000",
|
|
1030
|
+
text: this.text.substr(11, 1),
|
|
1031
|
+
options: { textAlign: "right", fontSize: this.fontSize }
|
|
1032
|
+
}), n;
|
|
1033
|
+
}
|
|
1034
|
+
}]), e;
|
|
1035
|
+
}(Ur.default);
|
|
1036
|
+
function de(t) {
|
|
1037
|
+
var e = 0, r;
|
|
1038
|
+
for (r = 1; r < 11; r += 2)
|
|
1039
|
+
e += parseInt(t[r]);
|
|
1040
|
+
for (r = 0; r < 11; r += 2)
|
|
1041
|
+
e += parseInt(t[r]) * 3;
|
|
1042
|
+
return (10 - e % 10) % 10;
|
|
1043
|
+
}
|
|
1044
|
+
C.default = Yr;
|
|
1045
|
+
var xe = {};
|
|
1046
|
+
Object.defineProperty(xe, "__esModule", {
|
|
1047
|
+
value: !0
|
|
1048
|
+
});
|
|
1049
|
+
var Qr = /* @__PURE__ */ function() {
|
|
1050
|
+
function t(e, r) {
|
|
1051
|
+
for (var n = 0; n < r.length; n++) {
|
|
1052
|
+
var a = r[n];
|
|
1053
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
return function(e, r, n) {
|
|
1057
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
1058
|
+
};
|
|
1059
|
+
}(), Wr = w, Zr = bt(Wr), Kr = c, ea = bt(Kr), ta = C;
|
|
1060
|
+
function bt(t) {
|
|
1061
|
+
return t && t.__esModule ? t : { default: t };
|
|
1062
|
+
}
|
|
1063
|
+
function na(t, e) {
|
|
1064
|
+
if (!(t instanceof e))
|
|
1065
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1066
|
+
}
|
|
1067
|
+
function fe(t, e) {
|
|
1068
|
+
if (!t)
|
|
1069
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1070
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1071
|
+
}
|
|
1072
|
+
function ra(t, e) {
|
|
1073
|
+
if (typeof e != "function" && e !== null)
|
|
1074
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1075
|
+
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);
|
|
1076
|
+
}
|
|
1077
|
+
var aa = ["XX00000XXX", "XX10000XXX", "XX20000XXX", "XXX00000XX", "XXXX00000X", "XXXXX00005", "XXXXX00006", "XXXXX00007", "XXXXX00008", "XXXXX00009"], ia = [["EEEOOO", "OOOEEE"], ["EEOEOO", "OOEOEE"], ["EEOOEO", "OOEEOE"], ["EEOOOE", "OOEEEO"], ["EOEEOO", "OEOOEE"], ["EOOEEO", "OEEOOE"], ["EOOOEE", "OEEEOO"], ["EOEOEO", "OEOEOE"], ["EOEOOE", "OEOEEO"], ["EOOEOE", "OEEOEO"]], oa = function(t) {
|
|
1078
|
+
ra(e, t);
|
|
1079
|
+
function e(r, n) {
|
|
1080
|
+
na(this, e);
|
|
1081
|
+
var a = fe(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
1082
|
+
if (a.isValid = !1, r.search(/^[0-9]{6}$/) !== -1)
|
|
1083
|
+
a.middleDigits = r, a.upcA = Ze(r, "0"), a.text = n.text || "" + a.upcA[0] + r + a.upcA[a.upcA.length - 1], a.isValid = !0;
|
|
1084
|
+
else if (r.search(/^[01][0-9]{7}$/) !== -1)
|
|
1085
|
+
if (a.middleDigits = r.substring(1, r.length - 1), a.upcA = Ze(a.middleDigits, r[0]), a.upcA[a.upcA.length - 1] === r[r.length - 1])
|
|
1086
|
+
a.isValid = !0;
|
|
1087
|
+
else
|
|
1088
|
+
return fe(a);
|
|
1089
|
+
else
|
|
1090
|
+
return fe(a);
|
|
1091
|
+
return a.displayValue = n.displayValue, n.fontSize > n.width * 10 ? a.fontSize = n.width * 10 : a.fontSize = n.fontSize, a.guardHeight = n.height + a.fontSize / 2 + n.textMargin, a;
|
|
1092
|
+
}
|
|
1093
|
+
return Qr(e, [{
|
|
1094
|
+
key: "valid",
|
|
1095
|
+
value: function() {
|
|
1096
|
+
return this.isValid;
|
|
1097
|
+
}
|
|
1098
|
+
}, {
|
|
1099
|
+
key: "encode",
|
|
1100
|
+
value: function() {
|
|
1101
|
+
return this.options.flat ? this.flatEncoding() : this.guardedEncoding();
|
|
1102
|
+
}
|
|
1103
|
+
}, {
|
|
1104
|
+
key: "flatEncoding",
|
|
1105
|
+
value: function() {
|
|
1106
|
+
var n = "";
|
|
1107
|
+
return n += "101", n += this.encodeMiddleDigits(), n += "010101", {
|
|
1108
|
+
data: n,
|
|
1109
|
+
text: this.text
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
}, {
|
|
1113
|
+
key: "guardedEncoding",
|
|
1114
|
+
value: function() {
|
|
1115
|
+
var n = [];
|
|
1116
|
+
return this.displayValue && n.push({
|
|
1117
|
+
data: "00000000",
|
|
1118
|
+
text: this.text[0],
|
|
1119
|
+
options: { textAlign: "left", fontSize: this.fontSize }
|
|
1120
|
+
}), n.push({
|
|
1121
|
+
data: "101",
|
|
1122
|
+
options: { height: this.guardHeight }
|
|
1123
|
+
}), n.push({
|
|
1124
|
+
data: this.encodeMiddleDigits(),
|
|
1125
|
+
text: this.text.substring(1, 7),
|
|
1126
|
+
options: { fontSize: this.fontSize }
|
|
1127
|
+
}), n.push({
|
|
1128
|
+
data: "010101",
|
|
1129
|
+
options: { height: this.guardHeight }
|
|
1130
|
+
}), this.displayValue && n.push({
|
|
1131
|
+
data: "00000000",
|
|
1132
|
+
text: this.text[7],
|
|
1133
|
+
options: { textAlign: "right", fontSize: this.fontSize }
|
|
1134
|
+
}), n;
|
|
1135
|
+
}
|
|
1136
|
+
}, {
|
|
1137
|
+
key: "encodeMiddleDigits",
|
|
1138
|
+
value: function() {
|
|
1139
|
+
var n = this.upcA[0], a = this.upcA[this.upcA.length - 1], i = ia[parseInt(a)][parseInt(n)];
|
|
1140
|
+
return (0, Zr.default)(this.middleDigits, i);
|
|
1141
|
+
}
|
|
1142
|
+
}]), e;
|
|
1143
|
+
}(ea.default);
|
|
1144
|
+
function Ze(t, e) {
|
|
1145
|
+
for (var r = parseInt(t[t.length - 1]), n = aa[r], a = "", i = 0, o = 0; o < n.length; o++) {
|
|
1146
|
+
var u = n[o];
|
|
1147
|
+
u === "X" ? a += t[i++] : a += u;
|
|
1148
|
+
}
|
|
1149
|
+
return a = "" + e + a, "" + a + (0, ta.checksum)(a);
|
|
1150
|
+
}
|
|
1151
|
+
xe.default = oa;
|
|
1152
|
+
Object.defineProperty(l, "__esModule", {
|
|
1153
|
+
value: !0
|
|
1154
|
+
});
|
|
1155
|
+
l.UPCE = l.UPC = l.EAN2 = l.EAN5 = l.EAN8 = l.EAN13 = void 0;
|
|
1156
|
+
var ua = be, fa = M(ua), ca = we, la = M(ca), da = me, ha = M(da), _a = $e, va = M(_a), ya = C, sa = M(ya), pa = xe, ga = M(pa);
|
|
1157
|
+
function M(t) {
|
|
1158
|
+
return t && t.__esModule ? t : { default: t };
|
|
1159
|
+
}
|
|
1160
|
+
l.EAN13 = fa.default;
|
|
1161
|
+
l.EAN8 = la.default;
|
|
1162
|
+
l.EAN5 = ha.default;
|
|
1163
|
+
l.EAN2 = va.default;
|
|
1164
|
+
l.UPC = sa.default;
|
|
1165
|
+
l.UPCE = ga.default;
|
|
1166
|
+
var R = {}, W = {}, N = {};
|
|
1167
|
+
Object.defineProperty(N, "__esModule", {
|
|
1168
|
+
value: !0
|
|
1169
|
+
});
|
|
1170
|
+
N.START_BIN = "1010";
|
|
1171
|
+
N.END_BIN = "11101";
|
|
1172
|
+
N.BINARIES = ["00110", "10001", "01001", "11000", "00101", "10100", "01100", "00011", "10010", "01010"];
|
|
1173
|
+
Object.defineProperty(W, "__esModule", {
|
|
1174
|
+
value: !0
|
|
1175
|
+
});
|
|
1176
|
+
var Oa = /* @__PURE__ */ function() {
|
|
1177
|
+
function t(e, r) {
|
|
1178
|
+
for (var n = 0; n < r.length; n++) {
|
|
1179
|
+
var a = r[n];
|
|
1180
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
return function(e, r, n) {
|
|
1184
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
1185
|
+
};
|
|
1186
|
+
}(), X = N, Ea = c, ba = wa(Ea);
|
|
1187
|
+
function wa(t) {
|
|
1188
|
+
return t && t.__esModule ? t : { default: t };
|
|
1189
|
+
}
|
|
1190
|
+
function ma(t, e) {
|
|
1191
|
+
if (!(t instanceof e))
|
|
1192
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1193
|
+
}
|
|
1194
|
+
function $a(t, e) {
|
|
1195
|
+
if (!t)
|
|
1196
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1197
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1198
|
+
}
|
|
1199
|
+
function xa(t, e) {
|
|
1200
|
+
if (typeof e != "function" && e !== null)
|
|
1201
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1202
|
+
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);
|
|
1203
|
+
}
|
|
1204
|
+
var Sa = function(t) {
|
|
1205
|
+
xa(e, t);
|
|
1206
|
+
function e() {
|
|
1207
|
+
return ma(this, e), $a(this, (e.__proto__ || Object.getPrototypeOf(e)).apply(this, arguments));
|
|
1208
|
+
}
|
|
1209
|
+
return Oa(e, [{
|
|
1210
|
+
key: "valid",
|
|
1211
|
+
value: function() {
|
|
1212
|
+
return this.data.search(/^([0-9]{2})+$/) !== -1;
|
|
1213
|
+
}
|
|
1214
|
+
}, {
|
|
1215
|
+
key: "encode",
|
|
1216
|
+
value: function() {
|
|
1217
|
+
var n = this, a = this.data.match(/.{2}/g).map(function(i) {
|
|
1218
|
+
return n.encodePair(i);
|
|
1219
|
+
}).join("");
|
|
1220
|
+
return {
|
|
1221
|
+
data: X.START_BIN + a + X.END_BIN,
|
|
1222
|
+
text: this.text
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1225
|
+
// Calculate the data of a number pair
|
|
1226
|
+
}, {
|
|
1227
|
+
key: "encodePair",
|
|
1228
|
+
value: function(n) {
|
|
1229
|
+
var a = X.BINARIES[n[1]];
|
|
1230
|
+
return X.BINARIES[n[0]].split("").map(function(i, o) {
|
|
1231
|
+
return (i === "1" ? "111" : "1") + (a[o] === "1" ? "000" : "0");
|
|
1232
|
+
}).join("");
|
|
1233
|
+
}
|
|
1234
|
+
}]), e;
|
|
1235
|
+
}(ba.default);
|
|
1236
|
+
W.default = Sa;
|
|
1237
|
+
var Se = {};
|
|
1238
|
+
Object.defineProperty(Se, "__esModule", {
|
|
1239
|
+
value: !0
|
|
1240
|
+
});
|
|
1241
|
+
var Aa = /* @__PURE__ */ function() {
|
|
1242
|
+
function t(e, r) {
|
|
1243
|
+
for (var n = 0; n < r.length; n++) {
|
|
1244
|
+
var a = r[n];
|
|
1245
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
return function(e, r, n) {
|
|
1249
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
1250
|
+
};
|
|
1251
|
+
}(), Ra = W, Pa = Ta(Ra);
|
|
1252
|
+
function Ta(t) {
|
|
1253
|
+
return t && t.__esModule ? t : { default: t };
|
|
1254
|
+
}
|
|
1255
|
+
function Ma(t, e) {
|
|
1256
|
+
if (!(t instanceof e))
|
|
1257
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1258
|
+
}
|
|
1259
|
+
function Ia(t, e) {
|
|
1260
|
+
if (!t)
|
|
1261
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1262
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1263
|
+
}
|
|
1264
|
+
function ka(t, e) {
|
|
1265
|
+
if (typeof e != "function" && e !== null)
|
|
1266
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1267
|
+
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);
|
|
1268
|
+
}
|
|
1269
|
+
var Ke = function(e) {
|
|
1270
|
+
var r = e.substr(0, 13).split("").map(function(n) {
|
|
1271
|
+
return parseInt(n, 10);
|
|
1272
|
+
}).reduce(function(n, a, i) {
|
|
1273
|
+
return n + a * (3 - i % 2 * 2);
|
|
1274
|
+
}, 0);
|
|
1275
|
+
return Math.ceil(r / 10) * 10 - r;
|
|
1276
|
+
}, Da = function(t) {
|
|
1277
|
+
ka(e, t);
|
|
1278
|
+
function e(r, n) {
|
|
1279
|
+
return Ma(this, e), r.search(/^[0-9]{13}$/) !== -1 && (r += Ke(r)), Ia(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
1280
|
+
}
|
|
1281
|
+
return Aa(e, [{
|
|
1282
|
+
key: "valid",
|
|
1283
|
+
value: function() {
|
|
1284
|
+
return this.data.search(/^[0-9]{14}$/) !== -1 && +this.data[13] === Ke(this.data);
|
|
1285
|
+
}
|
|
1286
|
+
}]), e;
|
|
1287
|
+
}(Pa.default);
|
|
1288
|
+
Se.default = Da;
|
|
1289
|
+
Object.defineProperty(R, "__esModule", {
|
|
1290
|
+
value: !0
|
|
1291
|
+
});
|
|
1292
|
+
R.ITF14 = R.ITF = void 0;
|
|
1293
|
+
var ja = W, Ba = wt(ja), La = Se, Ca = wt(La);
|
|
1294
|
+
function wt(t) {
|
|
1295
|
+
return t && t.__esModule ? t : { default: t };
|
|
1296
|
+
}
|
|
1297
|
+
R.ITF = Ba.default;
|
|
1298
|
+
R.ITF14 = Ca.default;
|
|
1299
|
+
var _ = {}, m = {};
|
|
1300
|
+
Object.defineProperty(m, "__esModule", {
|
|
1301
|
+
value: !0
|
|
1302
|
+
});
|
|
1303
|
+
var Na = /* @__PURE__ */ function() {
|
|
1304
|
+
function t(e, r) {
|
|
1305
|
+
for (var n = 0; n < r.length; n++) {
|
|
1306
|
+
var a = r[n];
|
|
1307
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
return function(e, r, n) {
|
|
1311
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
1312
|
+
};
|
|
1313
|
+
}(), Ga = c, Fa = Ha(Ga);
|
|
1314
|
+
function Ha(t) {
|
|
1315
|
+
return t && t.__esModule ? t : { default: t };
|
|
1316
|
+
}
|
|
1317
|
+
function za(t, e) {
|
|
1318
|
+
if (!(t instanceof e))
|
|
1319
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1320
|
+
}
|
|
1321
|
+
function Xa(t, e) {
|
|
1322
|
+
if (!t)
|
|
1323
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1324
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1325
|
+
}
|
|
1326
|
+
function Ua(t, e) {
|
|
1327
|
+
if (typeof e != "function" && e !== null)
|
|
1328
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1329
|
+
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);
|
|
1330
|
+
}
|
|
1331
|
+
var Va = function(t) {
|
|
1332
|
+
Ua(e, t);
|
|
1333
|
+
function e(r, n) {
|
|
1334
|
+
return za(this, e), Xa(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
1335
|
+
}
|
|
1336
|
+
return Na(e, [{
|
|
1337
|
+
key: "encode",
|
|
1338
|
+
value: function() {
|
|
1339
|
+
for (var n = "110", a = 0; a < this.data.length; a++) {
|
|
1340
|
+
var i = parseInt(this.data[a]), o = i.toString(2);
|
|
1341
|
+
o = qa(o, 4 - o.length);
|
|
1342
|
+
for (var u = 0; u < o.length; u++)
|
|
1343
|
+
n += o[u] == "0" ? "100" : "110";
|
|
1344
|
+
}
|
|
1345
|
+
return n += "1001", {
|
|
1346
|
+
data: n,
|
|
1347
|
+
text: this.text
|
|
1348
|
+
};
|
|
1349
|
+
}
|
|
1350
|
+
}, {
|
|
1351
|
+
key: "valid",
|
|
1352
|
+
value: function() {
|
|
1353
|
+
return this.data.search(/^[0-9]+$/) !== -1;
|
|
1354
|
+
}
|
|
1355
|
+
}]), e;
|
|
1356
|
+
}(Fa.default);
|
|
1357
|
+
function qa(t, e) {
|
|
1358
|
+
for (var r = 0; r < e; r++)
|
|
1359
|
+
t = "0" + t;
|
|
1360
|
+
return t;
|
|
1361
|
+
}
|
|
1362
|
+
m.default = Va;
|
|
1363
|
+
var Ae = {}, $ = {};
|
|
1364
|
+
Object.defineProperty($, "__esModule", {
|
|
1365
|
+
value: !0
|
|
1366
|
+
});
|
|
1367
|
+
$.mod10 = Ja;
|
|
1368
|
+
$.mod11 = Ya;
|
|
1369
|
+
function Ja(t) {
|
|
1370
|
+
for (var e = 0, r = 0; r < t.length; r++) {
|
|
1371
|
+
var n = parseInt(t[r]);
|
|
1372
|
+
(r + t.length) % 2 === 0 ? e += n : e += n * 2 % 10 + Math.floor(n * 2 / 10);
|
|
1373
|
+
}
|
|
1374
|
+
return (10 - e % 10) % 10;
|
|
1375
|
+
}
|
|
1376
|
+
function Ya(t) {
|
|
1377
|
+
for (var e = 0, r = [2, 3, 4, 5, 6, 7], n = 0; n < t.length; n++) {
|
|
1378
|
+
var a = parseInt(t[t.length - 1 - n]);
|
|
1379
|
+
e += r[n % r.length] * a;
|
|
1380
|
+
}
|
|
1381
|
+
return (11 - e % 11) % 11;
|
|
1382
|
+
}
|
|
1383
|
+
Object.defineProperty(Ae, "__esModule", {
|
|
1384
|
+
value: !0
|
|
1385
|
+
});
|
|
1386
|
+
var Qa = m, Wa = Ka(Qa), Za = $;
|
|
1387
|
+
function Ka(t) {
|
|
1388
|
+
return t && t.__esModule ? t : { default: t };
|
|
1389
|
+
}
|
|
1390
|
+
function ei(t, e) {
|
|
1391
|
+
if (!(t instanceof e))
|
|
1392
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1393
|
+
}
|
|
1394
|
+
function ti(t, e) {
|
|
1395
|
+
if (!t)
|
|
1396
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1397
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1398
|
+
}
|
|
1399
|
+
function ni(t, e) {
|
|
1400
|
+
if (typeof e != "function" && e !== null)
|
|
1401
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1402
|
+
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);
|
|
1403
|
+
}
|
|
1404
|
+
var ri = function(t) {
|
|
1405
|
+
ni(e, t);
|
|
1406
|
+
function e(r, n) {
|
|
1407
|
+
return ei(this, e), ti(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r + (0, Za.mod10)(r), n));
|
|
1408
|
+
}
|
|
1409
|
+
return e;
|
|
1410
|
+
}(Wa.default);
|
|
1411
|
+
Ae.default = ri;
|
|
1412
|
+
var Re = {};
|
|
1413
|
+
Object.defineProperty(Re, "__esModule", {
|
|
1414
|
+
value: !0
|
|
1415
|
+
});
|
|
1416
|
+
var ai = m, ii = ui(ai), oi = $;
|
|
1417
|
+
function ui(t) {
|
|
1418
|
+
return t && t.__esModule ? t : { default: t };
|
|
1419
|
+
}
|
|
1420
|
+
function fi(t, e) {
|
|
1421
|
+
if (!(t instanceof e))
|
|
1422
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1423
|
+
}
|
|
1424
|
+
function ci(t, e) {
|
|
1425
|
+
if (!t)
|
|
1426
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1427
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1428
|
+
}
|
|
1429
|
+
function li(t, e) {
|
|
1430
|
+
if (typeof e != "function" && e !== null)
|
|
1431
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1432
|
+
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);
|
|
1433
|
+
}
|
|
1434
|
+
var di = function(t) {
|
|
1435
|
+
li(e, t);
|
|
1436
|
+
function e(r, n) {
|
|
1437
|
+
return fi(this, e), ci(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r + (0, oi.mod11)(r), n));
|
|
1438
|
+
}
|
|
1439
|
+
return e;
|
|
1440
|
+
}(ii.default);
|
|
1441
|
+
Re.default = di;
|
|
1442
|
+
var Pe = {};
|
|
1443
|
+
Object.defineProperty(Pe, "__esModule", {
|
|
1444
|
+
value: !0
|
|
1445
|
+
});
|
|
1446
|
+
var hi = m, _i = vi(hi), et = $;
|
|
1447
|
+
function vi(t) {
|
|
1448
|
+
return t && t.__esModule ? t : { default: t };
|
|
1449
|
+
}
|
|
1450
|
+
function yi(t, e) {
|
|
1451
|
+
if (!(t instanceof e))
|
|
1452
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1453
|
+
}
|
|
1454
|
+
function si(t, e) {
|
|
1455
|
+
if (!t)
|
|
1456
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1457
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1458
|
+
}
|
|
1459
|
+
function pi(t, e) {
|
|
1460
|
+
if (typeof e != "function" && e !== null)
|
|
1461
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1462
|
+
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);
|
|
1463
|
+
}
|
|
1464
|
+
var gi = function(t) {
|
|
1465
|
+
pi(e, t);
|
|
1466
|
+
function e(r, n) {
|
|
1467
|
+
return yi(this, e), r += (0, et.mod10)(r), r += (0, et.mod10)(r), si(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
1468
|
+
}
|
|
1469
|
+
return e;
|
|
1470
|
+
}(_i.default);
|
|
1471
|
+
Pe.default = gi;
|
|
1472
|
+
var Te = {};
|
|
1473
|
+
Object.defineProperty(Te, "__esModule", {
|
|
1474
|
+
value: !0
|
|
1475
|
+
});
|
|
1476
|
+
var Oi = m, Ei = bi(Oi), tt = $;
|
|
1477
|
+
function bi(t) {
|
|
1478
|
+
return t && t.__esModule ? t : { default: t };
|
|
1479
|
+
}
|
|
1480
|
+
function wi(t, e) {
|
|
1481
|
+
if (!(t instanceof e))
|
|
1482
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1483
|
+
}
|
|
1484
|
+
function mi(t, e) {
|
|
1485
|
+
if (!t)
|
|
1486
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1487
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1488
|
+
}
|
|
1489
|
+
function $i(t, e) {
|
|
1490
|
+
if (typeof e != "function" && e !== null)
|
|
1491
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1492
|
+
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);
|
|
1493
|
+
}
|
|
1494
|
+
var xi = function(t) {
|
|
1495
|
+
$i(e, t);
|
|
1496
|
+
function e(r, n) {
|
|
1497
|
+
return wi(this, e), r += (0, tt.mod11)(r), r += (0, tt.mod10)(r), mi(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
1498
|
+
}
|
|
1499
|
+
return e;
|
|
1500
|
+
}(Ei.default);
|
|
1501
|
+
Te.default = xi;
|
|
1502
|
+
Object.defineProperty(_, "__esModule", {
|
|
1503
|
+
value: !0
|
|
1504
|
+
});
|
|
1505
|
+
_.MSI1110 = _.MSI1010 = _.MSI11 = _.MSI10 = _.MSI = void 0;
|
|
1506
|
+
var Si = m, Ai = G(Si), Ri = Ae, Pi = G(Ri), Ti = Re, Mi = G(Ti), Ii = Pe, ki = G(Ii), Di = Te, ji = G(Di);
|
|
1507
|
+
function G(t) {
|
|
1508
|
+
return t && t.__esModule ? t : { default: t };
|
|
1509
|
+
}
|
|
1510
|
+
_.MSI = Ai.default;
|
|
1511
|
+
_.MSI10 = Pi.default;
|
|
1512
|
+
_.MSI11 = Mi.default;
|
|
1513
|
+
_.MSI1010 = ki.default;
|
|
1514
|
+
_.MSI1110 = ji.default;
|
|
1515
|
+
var Z = {};
|
|
1516
|
+
Object.defineProperty(Z, "__esModule", {
|
|
1517
|
+
value: !0
|
|
1518
|
+
});
|
|
1519
|
+
Z.pharmacode = void 0;
|
|
1520
|
+
var Bi = /* @__PURE__ */ function() {
|
|
1521
|
+
function t(e, r) {
|
|
1522
|
+
for (var n = 0; n < r.length; n++) {
|
|
1523
|
+
var a = r[n];
|
|
1524
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
return function(e, r, n) {
|
|
1528
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
1529
|
+
};
|
|
1530
|
+
}(), Li = c, Ci = Ni(Li);
|
|
1531
|
+
function Ni(t) {
|
|
1532
|
+
return t && t.__esModule ? t : { default: t };
|
|
1533
|
+
}
|
|
1534
|
+
function Gi(t, e) {
|
|
1535
|
+
if (!(t instanceof e))
|
|
1536
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1537
|
+
}
|
|
1538
|
+
function Fi(t, e) {
|
|
1539
|
+
if (!t)
|
|
1540
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1541
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1542
|
+
}
|
|
1543
|
+
function Hi(t, e) {
|
|
1544
|
+
if (typeof e != "function" && e !== null)
|
|
1545
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1546
|
+
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);
|
|
1547
|
+
}
|
|
1548
|
+
var zi = function(t) {
|
|
1549
|
+
Hi(e, t);
|
|
1550
|
+
function e(r, n) {
|
|
1551
|
+
Gi(this, e);
|
|
1552
|
+
var a = Fi(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
1553
|
+
return a.number = parseInt(r, 10), a;
|
|
1554
|
+
}
|
|
1555
|
+
return Bi(e, [{
|
|
1556
|
+
key: "encode",
|
|
1557
|
+
value: function() {
|
|
1558
|
+
for (var n = this.number, a = ""; !isNaN(n) && n != 0; )
|
|
1559
|
+
n % 2 === 0 ? (a = "11100" + a, n = (n - 2) / 2) : (a = "100" + a, n = (n - 1) / 2);
|
|
1560
|
+
return a = a.slice(0, -2), {
|
|
1561
|
+
data: a,
|
|
1562
|
+
text: this.text
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1565
|
+
}, {
|
|
1566
|
+
key: "valid",
|
|
1567
|
+
value: function() {
|
|
1568
|
+
return this.number >= 3 && this.number <= 131070;
|
|
1569
|
+
}
|
|
1570
|
+
}]), e;
|
|
1571
|
+
}(Ci.default);
|
|
1572
|
+
Z.pharmacode = zi;
|
|
1573
|
+
var K = {};
|
|
1574
|
+
Object.defineProperty(K, "__esModule", {
|
|
1575
|
+
value: !0
|
|
1576
|
+
});
|
|
1577
|
+
K.codabar = void 0;
|
|
1578
|
+
var Xi = /* @__PURE__ */ function() {
|
|
1579
|
+
function t(e, r) {
|
|
1580
|
+
for (var n = 0; n < r.length; n++) {
|
|
1581
|
+
var a = r[n];
|
|
1582
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
return function(e, r, n) {
|
|
1586
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
1587
|
+
};
|
|
1588
|
+
}(), Ui = c, Vi = qi(Ui);
|
|
1589
|
+
function qi(t) {
|
|
1590
|
+
return t && t.__esModule ? t : { default: t };
|
|
1591
|
+
}
|
|
1592
|
+
function Ji(t, e) {
|
|
1593
|
+
if (!(t instanceof e))
|
|
1594
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1595
|
+
}
|
|
1596
|
+
function Yi(t, e) {
|
|
1597
|
+
if (!t)
|
|
1598
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1599
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1600
|
+
}
|
|
1601
|
+
function Qi(t, e) {
|
|
1602
|
+
if (typeof e != "function" && e !== null)
|
|
1603
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1604
|
+
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);
|
|
1605
|
+
}
|
|
1606
|
+
var Wi = function(t) {
|
|
1607
|
+
Qi(e, t);
|
|
1608
|
+
function e(r, n) {
|
|
1609
|
+
Ji(this, e), r.search(/^[0-9\-\$\:\.\+\/]+$/) === 0 && (r = "A" + r + "A");
|
|
1610
|
+
var a = Yi(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r.toUpperCase(), n));
|
|
1611
|
+
return a.text = a.options.text || a.text.replace(/[A-D]/g, ""), a;
|
|
1612
|
+
}
|
|
1613
|
+
return Xi(e, [{
|
|
1614
|
+
key: "valid",
|
|
1615
|
+
value: function() {
|
|
1616
|
+
return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/) !== -1;
|
|
1617
|
+
}
|
|
1618
|
+
}, {
|
|
1619
|
+
key: "encode",
|
|
1620
|
+
value: function() {
|
|
1621
|
+
for (var n = [], a = this.getEncodings(), i = 0; i < this.data.length; i++)
|
|
1622
|
+
n.push(a[this.data.charAt(i)]), i !== this.data.length - 1 && n.push("0");
|
|
1623
|
+
return {
|
|
1624
|
+
text: this.text,
|
|
1625
|
+
data: n.join("")
|
|
1626
|
+
};
|
|
1627
|
+
}
|
|
1628
|
+
}, {
|
|
1629
|
+
key: "getEncodings",
|
|
1630
|
+
value: function() {
|
|
1631
|
+
return {
|
|
1632
|
+
0: "101010011",
|
|
1633
|
+
1: "101011001",
|
|
1634
|
+
2: "101001011",
|
|
1635
|
+
3: "110010101",
|
|
1636
|
+
4: "101101001",
|
|
1637
|
+
5: "110101001",
|
|
1638
|
+
6: "100101011",
|
|
1639
|
+
7: "100101101",
|
|
1640
|
+
8: "100110101",
|
|
1641
|
+
9: "110100101",
|
|
1642
|
+
"-": "101001101",
|
|
1643
|
+
$: "101100101",
|
|
1644
|
+
":": "1101011011",
|
|
1645
|
+
"/": "1101101011",
|
|
1646
|
+
".": "1101101101",
|
|
1647
|
+
"+": "1011011011",
|
|
1648
|
+
A: "1011001001",
|
|
1649
|
+
B: "1001001011",
|
|
1650
|
+
C: "1010010011",
|
|
1651
|
+
D: "1010011001"
|
|
1652
|
+
};
|
|
1653
|
+
}
|
|
1654
|
+
}]), e;
|
|
1655
|
+
}(Vi.default);
|
|
1656
|
+
K.codabar = Wi;
|
|
1657
|
+
var P = {}, ee = {}, F = {};
|
|
1658
|
+
Object.defineProperty(F, "__esModule", {
|
|
1659
|
+
value: !0
|
|
1660
|
+
});
|
|
1661
|
+
F.SYMBOLS = [
|
|
1662
|
+
"0",
|
|
1663
|
+
"1",
|
|
1664
|
+
"2",
|
|
1665
|
+
"3",
|
|
1666
|
+
"4",
|
|
1667
|
+
"5",
|
|
1668
|
+
"6",
|
|
1669
|
+
"7",
|
|
1670
|
+
"8",
|
|
1671
|
+
"9",
|
|
1672
|
+
"A",
|
|
1673
|
+
"B",
|
|
1674
|
+
"C",
|
|
1675
|
+
"D",
|
|
1676
|
+
"E",
|
|
1677
|
+
"F",
|
|
1678
|
+
"G",
|
|
1679
|
+
"H",
|
|
1680
|
+
"I",
|
|
1681
|
+
"J",
|
|
1682
|
+
"K",
|
|
1683
|
+
"L",
|
|
1684
|
+
"M",
|
|
1685
|
+
"N",
|
|
1686
|
+
"O",
|
|
1687
|
+
"P",
|
|
1688
|
+
"Q",
|
|
1689
|
+
"R",
|
|
1690
|
+
"S",
|
|
1691
|
+
"T",
|
|
1692
|
+
"U",
|
|
1693
|
+
"V",
|
|
1694
|
+
"W",
|
|
1695
|
+
"X",
|
|
1696
|
+
"Y",
|
|
1697
|
+
"Z",
|
|
1698
|
+
"-",
|
|
1699
|
+
".",
|
|
1700
|
+
" ",
|
|
1701
|
+
"$",
|
|
1702
|
+
"/",
|
|
1703
|
+
"+",
|
|
1704
|
+
"%",
|
|
1705
|
+
// Only used for csum and multi-symbols character encodings
|
|
1706
|
+
"($)",
|
|
1707
|
+
"(%)",
|
|
1708
|
+
"(/)",
|
|
1709
|
+
"(+)",
|
|
1710
|
+
// Start/Stop
|
|
1711
|
+
"ÿ"
|
|
1712
|
+
];
|
|
1713
|
+
F.BINARIES = ["100010100", "101001000", "101000100", "101000010", "100101000", "100100100", "100100010", "101010000", "100010010", "100001010", "110101000", "110100100", "110100010", "110010100", "110010010", "110001010", "101101000", "101100100", "101100010", "100110100", "100011010", "101011000", "101001100", "101000110", "100101100", "100010110", "110110100", "110110010", "110101100", "110100110", "110010110", "110011010", "101101100", "101100110", "100110110", "100111010", "100101110", "111010100", "111010010", "111001010", "101101110", "101110110", "110101110", "100100110", "111011010", "111010110", "100110010", "101011110"];
|
|
1714
|
+
F.MULTI_SYMBOLS = {
|
|
1715
|
+
"\0": ["(%)", "U"],
|
|
1716
|
+
"": ["($)", "A"],
|
|
1717
|
+
"": ["($)", "B"],
|
|
1718
|
+
"": ["($)", "C"],
|
|
1719
|
+
"": ["($)", "D"],
|
|
1720
|
+
"": ["($)", "E"],
|
|
1721
|
+
"": ["($)", "F"],
|
|
1722
|
+
"\x07": ["($)", "G"],
|
|
1723
|
+
"\b": ["($)", "H"],
|
|
1724
|
+
" ": ["($)", "I"],
|
|
1725
|
+
"\n": ["($)", "J"],
|
|
1726
|
+
"\v": ["($)", "K"],
|
|
1727
|
+
"\f": ["($)", "L"],
|
|
1728
|
+
"\r": ["($)", "M"],
|
|
1729
|
+
"": ["($)", "N"],
|
|
1730
|
+
"": ["($)", "O"],
|
|
1731
|
+
"": ["($)", "P"],
|
|
1732
|
+
"": ["($)", "Q"],
|
|
1733
|
+
"": ["($)", "R"],
|
|
1734
|
+
"": ["($)", "S"],
|
|
1735
|
+
"": ["($)", "T"],
|
|
1736
|
+
"": ["($)", "U"],
|
|
1737
|
+
"": ["($)", "V"],
|
|
1738
|
+
"": ["($)", "W"],
|
|
1739
|
+
"": ["($)", "X"],
|
|
1740
|
+
"": ["($)", "Y"],
|
|
1741
|
+
"": ["($)", "Z"],
|
|
1742
|
+
"\x1B": ["(%)", "A"],
|
|
1743
|
+
"": ["(%)", "B"],
|
|
1744
|
+
"": ["(%)", "C"],
|
|
1745
|
+
"": ["(%)", "D"],
|
|
1746
|
+
"": ["(%)", "E"],
|
|
1747
|
+
"!": ["(/)", "A"],
|
|
1748
|
+
'"': ["(/)", "B"],
|
|
1749
|
+
"#": ["(/)", "C"],
|
|
1750
|
+
"&": ["(/)", "F"],
|
|
1751
|
+
"'": ["(/)", "G"],
|
|
1752
|
+
"(": ["(/)", "H"],
|
|
1753
|
+
")": ["(/)", "I"],
|
|
1754
|
+
"*": ["(/)", "J"],
|
|
1755
|
+
",": ["(/)", "L"],
|
|
1756
|
+
":": ["(/)", "Z"],
|
|
1757
|
+
";": ["(%)", "F"],
|
|
1758
|
+
"<": ["(%)", "G"],
|
|
1759
|
+
"=": ["(%)", "H"],
|
|
1760
|
+
">": ["(%)", "I"],
|
|
1761
|
+
"?": ["(%)", "J"],
|
|
1762
|
+
"@": ["(%)", "V"],
|
|
1763
|
+
"[": ["(%)", "K"],
|
|
1764
|
+
"\\": ["(%)", "L"],
|
|
1765
|
+
"]": ["(%)", "M"],
|
|
1766
|
+
"^": ["(%)", "N"],
|
|
1767
|
+
_: ["(%)", "O"],
|
|
1768
|
+
"`": ["(%)", "W"],
|
|
1769
|
+
a: ["(+)", "A"],
|
|
1770
|
+
b: ["(+)", "B"],
|
|
1771
|
+
c: ["(+)", "C"],
|
|
1772
|
+
d: ["(+)", "D"],
|
|
1773
|
+
e: ["(+)", "E"],
|
|
1774
|
+
f: ["(+)", "F"],
|
|
1775
|
+
g: ["(+)", "G"],
|
|
1776
|
+
h: ["(+)", "H"],
|
|
1777
|
+
i: ["(+)", "I"],
|
|
1778
|
+
j: ["(+)", "J"],
|
|
1779
|
+
k: ["(+)", "K"],
|
|
1780
|
+
l: ["(+)", "L"],
|
|
1781
|
+
m: ["(+)", "M"],
|
|
1782
|
+
n: ["(+)", "N"],
|
|
1783
|
+
o: ["(+)", "O"],
|
|
1784
|
+
p: ["(+)", "P"],
|
|
1785
|
+
q: ["(+)", "Q"],
|
|
1786
|
+
r: ["(+)", "R"],
|
|
1787
|
+
s: ["(+)", "S"],
|
|
1788
|
+
t: ["(+)", "T"],
|
|
1789
|
+
u: ["(+)", "U"],
|
|
1790
|
+
v: ["(+)", "V"],
|
|
1791
|
+
w: ["(+)", "W"],
|
|
1792
|
+
x: ["(+)", "X"],
|
|
1793
|
+
y: ["(+)", "Y"],
|
|
1794
|
+
z: ["(+)", "Z"],
|
|
1795
|
+
"{": ["(%)", "P"],
|
|
1796
|
+
"|": ["(%)", "Q"],
|
|
1797
|
+
"}": ["(%)", "R"],
|
|
1798
|
+
"~": ["(%)", "S"],
|
|
1799
|
+
"": ["(%)", "T"]
|
|
1800
|
+
};
|
|
1801
|
+
Object.defineProperty(ee, "__esModule", {
|
|
1802
|
+
value: !0
|
|
1803
|
+
});
|
|
1804
|
+
var Zi = /* @__PURE__ */ function() {
|
|
1805
|
+
function t(e, r) {
|
|
1806
|
+
for (var n = 0; n < r.length; n++) {
|
|
1807
|
+
var a = r[n];
|
|
1808
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
return function(e, r, n) {
|
|
1812
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
1813
|
+
};
|
|
1814
|
+
}(), U = F, Ki = c, eo = to(Ki);
|
|
1815
|
+
function to(t) {
|
|
1816
|
+
return t && t.__esModule ? t : { default: t };
|
|
1817
|
+
}
|
|
1818
|
+
function no(t, e) {
|
|
1819
|
+
if (!(t instanceof e))
|
|
1820
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1821
|
+
}
|
|
1822
|
+
function ro(t, e) {
|
|
1823
|
+
if (!t)
|
|
1824
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1825
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1826
|
+
}
|
|
1827
|
+
function ao(t, e) {
|
|
1828
|
+
if (typeof e != "function" && e !== null)
|
|
1829
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1830
|
+
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);
|
|
1831
|
+
}
|
|
1832
|
+
var io = function(t) {
|
|
1833
|
+
ao(e, t);
|
|
1834
|
+
function e(r, n) {
|
|
1835
|
+
return no(this, e), ro(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
1836
|
+
}
|
|
1837
|
+
return Zi(e, [{
|
|
1838
|
+
key: "valid",
|
|
1839
|
+
value: function() {
|
|
1840
|
+
return /^[0-9A-Z\-. $/+%]+$/.test(this.data);
|
|
1841
|
+
}
|
|
1842
|
+
}, {
|
|
1843
|
+
key: "encode",
|
|
1844
|
+
value: function() {
|
|
1845
|
+
var n = this.data.split("").flatMap(function(u) {
|
|
1846
|
+
return U.MULTI_SYMBOLS[u] || u;
|
|
1847
|
+
}), a = n.map(function(u) {
|
|
1848
|
+
return e.getEncoding(u);
|
|
1849
|
+
}).join(""), i = e.checksum(n, 20), o = e.checksum(n.concat(i), 15);
|
|
1850
|
+
return {
|
|
1851
|
+
text: this.text,
|
|
1852
|
+
data: (
|
|
1853
|
+
// Add the start bits
|
|
1854
|
+
e.getEncoding("ÿ") + // Add the encoded bits
|
|
1855
|
+
a + // Add the checksum
|
|
1856
|
+
e.getEncoding(i) + e.getEncoding(o) + // Add the stop bits
|
|
1857
|
+
e.getEncoding("ÿ") + // Add the termination bit
|
|
1858
|
+
"1"
|
|
1859
|
+
)
|
|
1860
|
+
};
|
|
1861
|
+
}
|
|
1862
|
+
// Get the binary encoding of a symbol
|
|
1863
|
+
}], [{
|
|
1864
|
+
key: "getEncoding",
|
|
1865
|
+
value: function(n) {
|
|
1866
|
+
return U.BINARIES[e.symbolValue(n)];
|
|
1867
|
+
}
|
|
1868
|
+
// Get the symbol for a symbol value
|
|
1869
|
+
}, {
|
|
1870
|
+
key: "getSymbol",
|
|
1871
|
+
value: function(n) {
|
|
1872
|
+
return U.SYMBOLS[n];
|
|
1873
|
+
}
|
|
1874
|
+
// Get the symbol value of a symbol
|
|
1875
|
+
}, {
|
|
1876
|
+
key: "symbolValue",
|
|
1877
|
+
value: function(n) {
|
|
1878
|
+
return U.SYMBOLS.indexOf(n);
|
|
1879
|
+
}
|
|
1880
|
+
// Calculate a checksum symbol
|
|
1881
|
+
}, {
|
|
1882
|
+
key: "checksum",
|
|
1883
|
+
value: function(n, a) {
|
|
1884
|
+
var i = n.slice().reverse().reduce(function(o, u, y) {
|
|
1885
|
+
var g = y % a + 1;
|
|
1886
|
+
return o + e.symbolValue(u) * g;
|
|
1887
|
+
}, 0);
|
|
1888
|
+
return e.getSymbol(i % 47);
|
|
1889
|
+
}
|
|
1890
|
+
}]), e;
|
|
1891
|
+
}(eo.default);
|
|
1892
|
+
ee.default = io;
|
|
1893
|
+
var Me = {};
|
|
1894
|
+
Object.defineProperty(Me, "__esModule", {
|
|
1895
|
+
value: !0
|
|
1896
|
+
});
|
|
1897
|
+
var oo = /* @__PURE__ */ function() {
|
|
1898
|
+
function t(e, r) {
|
|
1899
|
+
for (var n = 0; n < r.length; n++) {
|
|
1900
|
+
var a = r[n];
|
|
1901
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
return function(e, r, n) {
|
|
1905
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
1906
|
+
};
|
|
1907
|
+
}(), uo = ee, fo = co(uo);
|
|
1908
|
+
function co(t) {
|
|
1909
|
+
return t && t.__esModule ? t : { default: t };
|
|
1910
|
+
}
|
|
1911
|
+
function lo(t, e) {
|
|
1912
|
+
if (!(t instanceof e))
|
|
1913
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1914
|
+
}
|
|
1915
|
+
function ho(t, e) {
|
|
1916
|
+
if (!t)
|
|
1917
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1918
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1919
|
+
}
|
|
1920
|
+
function _o(t, e) {
|
|
1921
|
+
if (typeof e != "function" && e !== null)
|
|
1922
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1923
|
+
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);
|
|
1924
|
+
}
|
|
1925
|
+
var vo = function(t) {
|
|
1926
|
+
_o(e, t);
|
|
1927
|
+
function e(r, n) {
|
|
1928
|
+
return lo(this, e), ho(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
1929
|
+
}
|
|
1930
|
+
return oo(e, [{
|
|
1931
|
+
key: "valid",
|
|
1932
|
+
value: function() {
|
|
1933
|
+
return /^[\x00-\x7f]+$/.test(this.data);
|
|
1934
|
+
}
|
|
1935
|
+
}]), e;
|
|
1936
|
+
}(fo.default);
|
|
1937
|
+
Me.default = vo;
|
|
1938
|
+
Object.defineProperty(P, "__esModule", {
|
|
1939
|
+
value: !0
|
|
1940
|
+
});
|
|
1941
|
+
P.CODE93FullASCII = P.CODE93 = void 0;
|
|
1942
|
+
var yo = ee, so = mt(yo), po = Me, go = mt(po);
|
|
1943
|
+
function mt(t) {
|
|
1944
|
+
return t && t.__esModule ? t : { default: t };
|
|
1945
|
+
}
|
|
1946
|
+
P.CODE93 = so.default;
|
|
1947
|
+
P.CODE93FullASCII = go.default;
|
|
1948
|
+
var te = {};
|
|
1949
|
+
Object.defineProperty(te, "__esModule", {
|
|
1950
|
+
value: !0
|
|
1951
|
+
});
|
|
1952
|
+
te.GenericBarcode = void 0;
|
|
1953
|
+
var Oo = /* @__PURE__ */ function() {
|
|
1954
|
+
function t(e, r) {
|
|
1955
|
+
for (var n = 0; n < r.length; n++) {
|
|
1956
|
+
var a = r[n];
|
|
1957
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
return function(e, r, n) {
|
|
1961
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
1962
|
+
};
|
|
1963
|
+
}(), Eo = c, bo = wo(Eo);
|
|
1964
|
+
function wo(t) {
|
|
1965
|
+
return t && t.__esModule ? t : { default: t };
|
|
1966
|
+
}
|
|
1967
|
+
function mo(t, e) {
|
|
1968
|
+
if (!(t instanceof e))
|
|
1969
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1970
|
+
}
|
|
1971
|
+
function $o(t, e) {
|
|
1972
|
+
if (!t)
|
|
1973
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1974
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
1975
|
+
}
|
|
1976
|
+
function xo(t, e) {
|
|
1977
|
+
if (typeof e != "function" && e !== null)
|
|
1978
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
1979
|
+
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);
|
|
1980
|
+
}
|
|
1981
|
+
var So = function(t) {
|
|
1982
|
+
xo(e, t);
|
|
1983
|
+
function e(r, n) {
|
|
1984
|
+
return mo(this, e), $o(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r, n));
|
|
1985
|
+
}
|
|
1986
|
+
return Oo(e, [{
|
|
1987
|
+
key: "encode",
|
|
1988
|
+
value: function() {
|
|
1989
|
+
return {
|
|
1990
|
+
data: "10101010101010101010101010101010101010101",
|
|
1991
|
+
text: this.text
|
|
1992
|
+
};
|
|
1993
|
+
}
|
|
1994
|
+
// Resturn true/false if the string provided is valid for this encoder
|
|
1995
|
+
}, {
|
|
1996
|
+
key: "valid",
|
|
1997
|
+
value: function() {
|
|
1998
|
+
return !0;
|
|
1999
|
+
}
|
|
2000
|
+
}]), e;
|
|
2001
|
+
}(bo.default);
|
|
2002
|
+
te.GenericBarcode = So;
|
|
2003
|
+
Object.defineProperty(ve, "__esModule", {
|
|
2004
|
+
value: !0
|
|
2005
|
+
});
|
|
2006
|
+
var Ao = J, V = s, A = l, nt = R, B = _, Ro = Z, Po = K, rt = P, To = te;
|
|
2007
|
+
ve.default = {
|
|
2008
|
+
CODE39: Ao.CODE39,
|
|
2009
|
+
CODE128: V.CODE128,
|
|
2010
|
+
CODE128A: V.CODE128A,
|
|
2011
|
+
CODE128B: V.CODE128B,
|
|
2012
|
+
CODE128C: V.CODE128C,
|
|
2013
|
+
EAN13: A.EAN13,
|
|
2014
|
+
EAN8: A.EAN8,
|
|
2015
|
+
EAN5: A.EAN5,
|
|
2016
|
+
EAN2: A.EAN2,
|
|
2017
|
+
UPC: A.UPC,
|
|
2018
|
+
UPCE: A.UPCE,
|
|
2019
|
+
ITF14: nt.ITF14,
|
|
2020
|
+
ITF: nt.ITF,
|
|
2021
|
+
MSI: B.MSI,
|
|
2022
|
+
MSI10: B.MSI10,
|
|
2023
|
+
MSI11: B.MSI11,
|
|
2024
|
+
MSI1010: B.MSI1010,
|
|
2025
|
+
MSI1110: B.MSI1110,
|
|
2026
|
+
pharmacode: Ro.pharmacode,
|
|
2027
|
+
codabar: Po.codabar,
|
|
2028
|
+
CODE93: rt.CODE93,
|
|
2029
|
+
CODE93FullASCII: rt.CODE93FullASCII,
|
|
2030
|
+
GenericBarcode: To.GenericBarcode
|
|
2031
|
+
};
|
|
2032
|
+
var I = {};
|
|
2033
|
+
Object.defineProperty(I, "__esModule", {
|
|
2034
|
+
value: !0
|
|
2035
|
+
});
|
|
2036
|
+
var Mo = Object.assign || function(t) {
|
|
2037
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
2038
|
+
var r = arguments[e];
|
|
2039
|
+
for (var n in r)
|
|
2040
|
+
Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]);
|
|
2041
|
+
}
|
|
2042
|
+
return t;
|
|
2043
|
+
};
|
|
2044
|
+
I.default = function(t, e) {
|
|
2045
|
+
return Mo({}, t, e);
|
|
2046
|
+
};
|
|
2047
|
+
var Ie = {};
|
|
2048
|
+
Object.defineProperty(Ie, "__esModule", {
|
|
2049
|
+
value: !0
|
|
2050
|
+
});
|
|
2051
|
+
Ie.default = Io;
|
|
2052
|
+
function Io(t) {
|
|
2053
|
+
var e = [];
|
|
2054
|
+
function r(n) {
|
|
2055
|
+
if (Array.isArray(n))
|
|
2056
|
+
for (var a = 0; a < n.length; a++)
|
|
2057
|
+
r(n[a]);
|
|
2058
|
+
else
|
|
2059
|
+
n.text = n.text || "", n.data = n.data || "", e.push(n);
|
|
2060
|
+
}
|
|
2061
|
+
return r(t), e;
|
|
2062
|
+
}
|
|
2063
|
+
var ke = {};
|
|
2064
|
+
Object.defineProperty(ke, "__esModule", {
|
|
2065
|
+
value: !0
|
|
2066
|
+
});
|
|
2067
|
+
ke.default = ko;
|
|
2068
|
+
function ko(t) {
|
|
2069
|
+
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;
|
|
2070
|
+
}
|
|
2071
|
+
var De = {}, je = {}, ne = {};
|
|
2072
|
+
Object.defineProperty(ne, "__esModule", {
|
|
2073
|
+
value: !0
|
|
2074
|
+
});
|
|
2075
|
+
ne.default = Do;
|
|
2076
|
+
function Do(t) {
|
|
2077
|
+
var e = ["width", "height", "textMargin", "fontSize", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight"];
|
|
2078
|
+
for (var r in e)
|
|
2079
|
+
e.hasOwnProperty(r) && (r = e[r], typeof t[r] == "string" && (t[r] = parseInt(t[r], 10)));
|
|
2080
|
+
return typeof t.displayValue == "string" && (t.displayValue = t.displayValue != "false"), t;
|
|
2081
|
+
}
|
|
2082
|
+
var re = {};
|
|
2083
|
+
Object.defineProperty(re, "__esModule", {
|
|
2084
|
+
value: !0
|
|
2085
|
+
});
|
|
2086
|
+
var jo = {
|
|
2087
|
+
width: 2,
|
|
2088
|
+
height: 100,
|
|
2089
|
+
format: "auto",
|
|
2090
|
+
displayValue: !0,
|
|
2091
|
+
fontOptions: "",
|
|
2092
|
+
font: "monospace",
|
|
2093
|
+
text: void 0,
|
|
2094
|
+
textAlign: "center",
|
|
2095
|
+
textPosition: "bottom",
|
|
2096
|
+
textMargin: 2,
|
|
2097
|
+
fontSize: 20,
|
|
2098
|
+
background: "#ffffff",
|
|
2099
|
+
lineColor: "#000000",
|
|
2100
|
+
margin: 10,
|
|
2101
|
+
marginTop: void 0,
|
|
2102
|
+
marginBottom: void 0,
|
|
2103
|
+
marginLeft: void 0,
|
|
2104
|
+
marginRight: void 0,
|
|
2105
|
+
valid: function() {
|
|
2106
|
+
}
|
|
2107
|
+
};
|
|
2108
|
+
re.default = jo;
|
|
2109
|
+
Object.defineProperty(je, "__esModule", {
|
|
2110
|
+
value: !0
|
|
2111
|
+
});
|
|
2112
|
+
var Bo = ne, Lo = $t(Bo), Co = re, at = $t(Co);
|
|
2113
|
+
function $t(t) {
|
|
2114
|
+
return t && t.__esModule ? t : { default: t };
|
|
2115
|
+
}
|
|
2116
|
+
function No(t) {
|
|
2117
|
+
var e = {};
|
|
2118
|
+
for (var r in at.default)
|
|
2119
|
+
at.default.hasOwnProperty(r) && (t.hasAttribute("jsbarcode-" + r.toLowerCase()) && (e[r] = t.getAttribute("jsbarcode-" + r.toLowerCase())), t.hasAttribute("data-" + r.toLowerCase()) && (e[r] = t.getAttribute("data-" + r.toLowerCase())));
|
|
2120
|
+
return e.value = t.getAttribute("jsbarcode-value") || t.getAttribute("data-value"), e = (0, Lo.default)(e), e;
|
|
2121
|
+
}
|
|
2122
|
+
je.default = No;
|
|
2123
|
+
var Be = {}, Le = {}, h = {};
|
|
2124
|
+
Object.defineProperty(h, "__esModule", {
|
|
2125
|
+
value: !0
|
|
2126
|
+
});
|
|
2127
|
+
h.getTotalWidthOfEncodings = h.calculateEncodingAttributes = h.getBarcodePadding = h.getEncodingHeight = h.getMaximumHeightOfEncodings = void 0;
|
|
2128
|
+
var Go = I, Fo = Ho(Go);
|
|
2129
|
+
function Ho(t) {
|
|
2130
|
+
return t && t.__esModule ? t : { default: t };
|
|
2131
|
+
}
|
|
2132
|
+
function xt(t, e) {
|
|
2133
|
+
return e.height + (e.displayValue && t.text.length > 0 ? e.fontSize + e.textMargin : 0) + e.marginTop + e.marginBottom;
|
|
2134
|
+
}
|
|
2135
|
+
function St(t, e, r) {
|
|
2136
|
+
if (r.displayValue && e < t) {
|
|
2137
|
+
if (r.textAlign == "center")
|
|
2138
|
+
return Math.floor((t - e) / 2);
|
|
2139
|
+
if (r.textAlign == "left")
|
|
2140
|
+
return 0;
|
|
2141
|
+
if (r.textAlign == "right")
|
|
2142
|
+
return Math.floor(t - e);
|
|
2143
|
+
}
|
|
2144
|
+
return 0;
|
|
2145
|
+
}
|
|
2146
|
+
function zo(t, e, r) {
|
|
2147
|
+
for (var n = 0; n < t.length; n++) {
|
|
2148
|
+
var a = t[n], i = (0, Fo.default)(e, a.options), o;
|
|
2149
|
+
i.displayValue ? o = Vo(a.text, i, r) : o = 0;
|
|
2150
|
+
var u = a.data.length * i.width;
|
|
2151
|
+
a.width = Math.ceil(Math.max(o, u)), a.height = xt(a, i), a.barcodePadding = St(o, u, i);
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
function Xo(t) {
|
|
2155
|
+
for (var e = 0, r = 0; r < t.length; r++)
|
|
2156
|
+
e += t[r].width;
|
|
2157
|
+
return e;
|
|
2158
|
+
}
|
|
2159
|
+
function Uo(t) {
|
|
2160
|
+
for (var e = 0, r = 0; r < t.length; r++)
|
|
2161
|
+
t[r].height > e && (e = t[r].height);
|
|
2162
|
+
return e;
|
|
2163
|
+
}
|
|
2164
|
+
function Vo(t, e, r) {
|
|
2165
|
+
var n;
|
|
2166
|
+
if (r)
|
|
2167
|
+
n = r;
|
|
2168
|
+
else if (typeof document < "u")
|
|
2169
|
+
n = document.createElement("canvas").getContext("2d");
|
|
2170
|
+
else
|
|
2171
|
+
return 0;
|
|
2172
|
+
n.font = e.fontOptions + " " + e.fontSize + "px " + e.font;
|
|
2173
|
+
var a = n.measureText(t);
|
|
2174
|
+
if (!a)
|
|
2175
|
+
return 0;
|
|
2176
|
+
var i = a.width;
|
|
2177
|
+
return i;
|
|
2178
|
+
}
|
|
2179
|
+
h.getMaximumHeightOfEncodings = Uo;
|
|
2180
|
+
h.getEncodingHeight = xt;
|
|
2181
|
+
h.getBarcodePadding = St;
|
|
2182
|
+
h.calculateEncodingAttributes = zo;
|
|
2183
|
+
h.getTotalWidthOfEncodings = Xo;
|
|
2184
|
+
Object.defineProperty(Le, "__esModule", {
|
|
2185
|
+
value: !0
|
|
2186
|
+
});
|
|
2187
|
+
var qo = /* @__PURE__ */ function() {
|
|
2188
|
+
function t(e, r) {
|
|
2189
|
+
for (var n = 0; n < r.length; n++) {
|
|
2190
|
+
var a = r[n];
|
|
2191
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
return function(e, r, n) {
|
|
2195
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
2196
|
+
};
|
|
2197
|
+
}(), Jo = I, Yo = Qo(Jo), ce = h;
|
|
2198
|
+
function Qo(t) {
|
|
2199
|
+
return t && t.__esModule ? t : { default: t };
|
|
2200
|
+
}
|
|
2201
|
+
function Wo(t, e) {
|
|
2202
|
+
if (!(t instanceof e))
|
|
2203
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2204
|
+
}
|
|
2205
|
+
var Zo = function() {
|
|
2206
|
+
function t(e, r, n) {
|
|
2207
|
+
Wo(this, t), this.canvas = e, this.encodings = r, this.options = n;
|
|
2208
|
+
}
|
|
2209
|
+
return qo(t, [{
|
|
2210
|
+
key: "render",
|
|
2211
|
+
value: function() {
|
|
2212
|
+
if (!this.canvas.getContext)
|
|
2213
|
+
throw new Error("The browser does not support canvas.");
|
|
2214
|
+
this.prepareCanvas();
|
|
2215
|
+
for (var r = 0; r < this.encodings.length; r++) {
|
|
2216
|
+
var n = (0, Yo.default)(this.options, this.encodings[r].options);
|
|
2217
|
+
this.drawCanvasBarcode(n, this.encodings[r]), this.drawCanvasText(n, this.encodings[r]), this.moveCanvasDrawing(this.encodings[r]);
|
|
2218
|
+
}
|
|
2219
|
+
this.restoreCanvas();
|
|
2220
|
+
}
|
|
2221
|
+
}, {
|
|
2222
|
+
key: "prepareCanvas",
|
|
2223
|
+
value: function() {
|
|
2224
|
+
var r = this.canvas.getContext("2d");
|
|
2225
|
+
r.save(), (0, ce.calculateEncodingAttributes)(this.encodings, this.options, r);
|
|
2226
|
+
var n = (0, ce.getTotalWidthOfEncodings)(this.encodings), a = (0, ce.getMaximumHeightOfEncodings)(this.encodings);
|
|
2227
|
+
this.canvas.width = n + this.options.marginLeft + this.options.marginRight, this.canvas.height = a, r.clearRect(0, 0, this.canvas.width, this.canvas.height), this.options.background && (r.fillStyle = this.options.background, r.fillRect(0, 0, this.canvas.width, this.canvas.height)), r.translate(this.options.marginLeft, 0);
|
|
2228
|
+
}
|
|
2229
|
+
}, {
|
|
2230
|
+
key: "drawCanvasBarcode",
|
|
2231
|
+
value: function(r, n) {
|
|
2232
|
+
var a = this.canvas.getContext("2d"), i = n.data, o;
|
|
2233
|
+
r.textPosition == "top" ? o = r.marginTop + r.fontSize + r.textMargin : o = r.marginTop, a.fillStyle = r.lineColor;
|
|
2234
|
+
for (var u = 0; u < i.length; u++) {
|
|
2235
|
+
var y = u * r.width + n.barcodePadding;
|
|
2236
|
+
i[u] === "1" ? a.fillRect(y, o, r.width, r.height) : i[u] && a.fillRect(y, o, r.width, r.height * i[u]);
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
}, {
|
|
2240
|
+
key: "drawCanvasText",
|
|
2241
|
+
value: function(r, n) {
|
|
2242
|
+
var a = this.canvas.getContext("2d"), i = r.fontOptions + " " + r.fontSize + "px " + r.font;
|
|
2243
|
+
if (r.displayValue) {
|
|
2244
|
+
var o, u;
|
|
2245
|
+
r.textPosition == "top" ? u = r.marginTop + r.fontSize - r.textMargin : u = r.height + r.textMargin + r.marginTop + r.fontSize, a.font = i, r.textAlign == "left" || n.barcodePadding > 0 ? (o = 0, a.textAlign = "left") : r.textAlign == "right" ? (o = n.width - 1, a.textAlign = "right") : (o = n.width / 2, a.textAlign = "center"), a.fillText(n.text, o, u);
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
}, {
|
|
2249
|
+
key: "moveCanvasDrawing",
|
|
2250
|
+
value: function(r) {
|
|
2251
|
+
var n = this.canvas.getContext("2d");
|
|
2252
|
+
n.translate(r.width, 0);
|
|
2253
|
+
}
|
|
2254
|
+
}, {
|
|
2255
|
+
key: "restoreCanvas",
|
|
2256
|
+
value: function() {
|
|
2257
|
+
var r = this.canvas.getContext("2d");
|
|
2258
|
+
r.restore();
|
|
2259
|
+
}
|
|
2260
|
+
}]), t;
|
|
2261
|
+
}();
|
|
2262
|
+
Le.default = Zo;
|
|
2263
|
+
var Ce = {};
|
|
2264
|
+
Object.defineProperty(Ce, "__esModule", {
|
|
2265
|
+
value: !0
|
|
2266
|
+
});
|
|
2267
|
+
var Ko = /* @__PURE__ */ function() {
|
|
2268
|
+
function t(e, r) {
|
|
2269
|
+
for (var n = 0; n < r.length; n++) {
|
|
2270
|
+
var a = r[n];
|
|
2271
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
return function(e, r, n) {
|
|
2275
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
2276
|
+
};
|
|
2277
|
+
}(), eu = I, tu = nu(eu), le = h;
|
|
2278
|
+
function nu(t) {
|
|
2279
|
+
return t && t.__esModule ? t : { default: t };
|
|
2280
|
+
}
|
|
2281
|
+
function ru(t, e) {
|
|
2282
|
+
if (!(t instanceof e))
|
|
2283
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2284
|
+
}
|
|
2285
|
+
var q = "http://www.w3.org/2000/svg", au = function() {
|
|
2286
|
+
function t(e, r, n) {
|
|
2287
|
+
ru(this, t), this.svg = e, this.encodings = r, this.options = n, this.document = n.xmlDocument || document;
|
|
2288
|
+
}
|
|
2289
|
+
return Ko(t, [{
|
|
2290
|
+
key: "render",
|
|
2291
|
+
value: function() {
|
|
2292
|
+
var r = this.options.marginLeft;
|
|
2293
|
+
this.prepareSVG();
|
|
2294
|
+
for (var n = 0; n < this.encodings.length; n++) {
|
|
2295
|
+
var a = this.encodings[n], i = (0, tu.default)(this.options, a.options), o = this.createGroup(r, i.marginTop, this.svg);
|
|
2296
|
+
this.setGroupOptions(o, i), this.drawSvgBarcode(o, i, a), this.drawSVGText(o, i, a), r += a.width;
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
}, {
|
|
2300
|
+
key: "prepareSVG",
|
|
2301
|
+
value: function() {
|
|
2302
|
+
for (; this.svg.firstChild; )
|
|
2303
|
+
this.svg.removeChild(this.svg.firstChild);
|
|
2304
|
+
(0, le.calculateEncodingAttributes)(this.encodings, this.options);
|
|
2305
|
+
var r = (0, le.getTotalWidthOfEncodings)(this.encodings), n = (0, le.getMaximumHeightOfEncodings)(this.encodings), a = r + this.options.marginLeft + this.options.marginRight;
|
|
2306
|
+
this.setSvgAttributes(a, n), this.options.background && this.drawRect(0, 0, a, n, this.svg).setAttribute("fill", this.options.background);
|
|
2307
|
+
}
|
|
2308
|
+
}, {
|
|
2309
|
+
key: "drawSvgBarcode",
|
|
2310
|
+
value: function(r, n, a) {
|
|
2311
|
+
var i = a.data, o;
|
|
2312
|
+
n.textPosition == "top" ? o = n.fontSize + n.textMargin : o = 0;
|
|
2313
|
+
for (var u = 0, y = 0, g = 0; g < i.length; g++)
|
|
2314
|
+
y = g * n.width + a.barcodePadding, i[g] === "1" ? u++ : u > 0 && (this.drawRect(y - n.width * u, o, n.width * u, n.height, r), u = 0);
|
|
2315
|
+
u > 0 && this.drawRect(y - n.width * (u - 1), o, n.width * u, n.height, r);
|
|
2316
|
+
}
|
|
2317
|
+
}, {
|
|
2318
|
+
key: "drawSVGText",
|
|
2319
|
+
value: function(r, n, a) {
|
|
2320
|
+
var i = this.document.createElementNS(q, "text");
|
|
2321
|
+
if (n.displayValue) {
|
|
2322
|
+
var o, u;
|
|
2323
|
+
i.setAttribute("font-family", n.font), i.setAttribute("font-size", n.fontSize), n.fontOptions.includes("bold") && i.setAttribute("font-weight", "bold"), n.fontOptions.includes("italic") && i.setAttribute("font-style", "italic"), n.textPosition == "top" ? u = n.fontSize - n.textMargin : u = n.height + n.textMargin + n.fontSize, n.textAlign == "left" || a.barcodePadding > 0 ? (o = 0, i.setAttribute("text-anchor", "start")) : n.textAlign == "right" ? (o = a.width - 1, i.setAttribute("text-anchor", "end")) : (o = a.width / 2, i.setAttribute("text-anchor", "middle")), i.setAttribute("x", o), i.setAttribute("y", u), i.appendChild(this.document.createTextNode(a.text)), r.appendChild(i);
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
2326
|
+
}, {
|
|
2327
|
+
key: "setSvgAttributes",
|
|
2328
|
+
value: function(r, n) {
|
|
2329
|
+
var a = this.svg;
|
|
2330
|
+
a.setAttribute("width", r + "px"), a.setAttribute("height", n + "px"), a.setAttribute("x", "0px"), a.setAttribute("y", "0px"), a.setAttribute("viewBox", "0 0 " + r + " " + n), a.setAttribute("xmlns", q), a.setAttribute("version", "1.1");
|
|
2331
|
+
}
|
|
2332
|
+
}, {
|
|
2333
|
+
key: "createGroup",
|
|
2334
|
+
value: function(r, n, a) {
|
|
2335
|
+
var i = this.document.createElementNS(q, "g");
|
|
2336
|
+
return i.setAttribute("transform", "translate(" + r + ", " + n + ")"), a.appendChild(i), i;
|
|
2337
|
+
}
|
|
2338
|
+
}, {
|
|
2339
|
+
key: "setGroupOptions",
|
|
2340
|
+
value: function(r, n) {
|
|
2341
|
+
r.setAttribute("fill", n.lineColor);
|
|
2342
|
+
}
|
|
2343
|
+
}, {
|
|
2344
|
+
key: "drawRect",
|
|
2345
|
+
value: function(r, n, a, i, o) {
|
|
2346
|
+
var u = this.document.createElementNS(q, "rect");
|
|
2347
|
+
return u.setAttribute("x", r), u.setAttribute("y", n), u.setAttribute("width", a), u.setAttribute("height", i), o.appendChild(u), u;
|
|
2348
|
+
}
|
|
2349
|
+
}]), t;
|
|
2350
|
+
}();
|
|
2351
|
+
Ce.default = au;
|
|
2352
|
+
var Ne = {};
|
|
2353
|
+
Object.defineProperty(Ne, "__esModule", {
|
|
2354
|
+
value: !0
|
|
2355
|
+
});
|
|
2356
|
+
var iu = /* @__PURE__ */ function() {
|
|
2357
|
+
function t(e, r) {
|
|
2358
|
+
for (var n = 0; n < r.length; n++) {
|
|
2359
|
+
var a = r[n];
|
|
2360
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
return function(e, r, n) {
|
|
2364
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
2365
|
+
};
|
|
2366
|
+
}();
|
|
2367
|
+
function ou(t, e) {
|
|
2368
|
+
if (!(t instanceof e))
|
|
2369
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2370
|
+
}
|
|
2371
|
+
var uu = function() {
|
|
2372
|
+
function t(e, r, n) {
|
|
2373
|
+
ou(this, t), this.object = e, this.encodings = r, this.options = n;
|
|
2374
|
+
}
|
|
2375
|
+
return iu(t, [{
|
|
2376
|
+
key: "render",
|
|
2377
|
+
value: function() {
|
|
2378
|
+
this.object.encodings = this.encodings;
|
|
2379
|
+
}
|
|
2380
|
+
}]), t;
|
|
2381
|
+
}();
|
|
2382
|
+
Ne.default = uu;
|
|
2383
|
+
Object.defineProperty(Be, "__esModule", {
|
|
2384
|
+
value: !0
|
|
2385
|
+
});
|
|
2386
|
+
var fu = Le, cu = Ge(fu), lu = Ce, du = Ge(lu), hu = Ne, _u = Ge(hu);
|
|
2387
|
+
function Ge(t) {
|
|
2388
|
+
return t && t.__esModule ? t : { default: t };
|
|
2389
|
+
}
|
|
2390
|
+
Be.default = { CanvasRenderer: cu.default, SVGRenderer: du.default, ObjectRenderer: _u.default };
|
|
2391
|
+
var k = {};
|
|
2392
|
+
Object.defineProperty(k, "__esModule", {
|
|
2393
|
+
value: !0
|
|
2394
|
+
});
|
|
2395
|
+
function Fe(t, e) {
|
|
2396
|
+
if (!(t instanceof e))
|
|
2397
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2398
|
+
}
|
|
2399
|
+
function He(t, e) {
|
|
2400
|
+
if (!t)
|
|
2401
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2402
|
+
return e && (typeof e == "object" || typeof e == "function") ? e : t;
|
|
2403
|
+
}
|
|
2404
|
+
function ze(t, e) {
|
|
2405
|
+
if (typeof e != "function" && e !== null)
|
|
2406
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
|
|
2407
|
+
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);
|
|
2408
|
+
}
|
|
2409
|
+
var vu = function(t) {
|
|
2410
|
+
ze(e, t);
|
|
2411
|
+
function e(r, n) {
|
|
2412
|
+
Fe(this, e);
|
|
2413
|
+
var a = He(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
|
|
2414
|
+
return a.name = "InvalidInputException", a.symbology = r, a.input = n, a.message = '"' + a.input + '" is not a valid input for ' + a.symbology, a;
|
|
2415
|
+
}
|
|
2416
|
+
return e;
|
|
2417
|
+
}(Error), yu = function(t) {
|
|
2418
|
+
ze(e, t);
|
|
2419
|
+
function e() {
|
|
2420
|
+
Fe(this, e);
|
|
2421
|
+
var r = He(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
|
|
2422
|
+
return r.name = "InvalidElementException", r.message = "Not supported type to render on", r;
|
|
2423
|
+
}
|
|
2424
|
+
return e;
|
|
2425
|
+
}(Error), su = function(t) {
|
|
2426
|
+
ze(e, t);
|
|
2427
|
+
function e() {
|
|
2428
|
+
Fe(this, e);
|
|
2429
|
+
var r = He(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
|
|
2430
|
+
return r.name = "NoElementException", r.message = "No element to render on.", r;
|
|
2431
|
+
}
|
|
2432
|
+
return e;
|
|
2433
|
+
}(Error);
|
|
2434
|
+
k.InvalidInputException = vu;
|
|
2435
|
+
k.InvalidElementException = yu;
|
|
2436
|
+
k.NoElementException = su;
|
|
2437
|
+
Object.defineProperty(De, "__esModule", {
|
|
2438
|
+
value: !0
|
|
2439
|
+
});
|
|
2440
|
+
var pu = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
2441
|
+
return typeof t;
|
|
2442
|
+
} : function(t) {
|
|
2443
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2444
|
+
}, gu = je, he = At(gu), Ou = Be, L = At(Ou), Eu = k;
|
|
2445
|
+
function At(t) {
|
|
2446
|
+
return t && t.__esModule ? t : { default: t };
|
|
2447
|
+
}
|
|
2448
|
+
function Xe(t) {
|
|
2449
|
+
if (typeof t == "string")
|
|
2450
|
+
return bu(t);
|
|
2451
|
+
if (Array.isArray(t)) {
|
|
2452
|
+
for (var e = [], r = 0; r < t.length; r++)
|
|
2453
|
+
e.push(Xe(t[r]));
|
|
2454
|
+
return e;
|
|
2455
|
+
} else {
|
|
2456
|
+
if (typeof HTMLCanvasElement < "u" && t instanceof HTMLImageElement)
|
|
2457
|
+
return wu(t);
|
|
2458
|
+
if (t && t.nodeName && t.nodeName.toLowerCase() === "svg" || typeof SVGElement < "u" && t instanceof SVGElement)
|
|
2459
|
+
return {
|
|
2460
|
+
element: t,
|
|
2461
|
+
options: (0, he.default)(t),
|
|
2462
|
+
renderer: L.default.SVGRenderer
|
|
2463
|
+
};
|
|
2464
|
+
if (typeof HTMLCanvasElement < "u" && t instanceof HTMLCanvasElement)
|
|
2465
|
+
return {
|
|
2466
|
+
element: t,
|
|
2467
|
+
options: (0, he.default)(t),
|
|
2468
|
+
renderer: L.default.CanvasRenderer
|
|
2469
|
+
};
|
|
2470
|
+
if (t && t.getContext)
|
|
2471
|
+
return {
|
|
2472
|
+
element: t,
|
|
2473
|
+
renderer: L.default.CanvasRenderer
|
|
2474
|
+
};
|
|
2475
|
+
if (t && (typeof t > "u" ? "undefined" : pu(t)) === "object" && !t.nodeName)
|
|
2476
|
+
return {
|
|
2477
|
+
element: t,
|
|
2478
|
+
renderer: L.default.ObjectRenderer
|
|
2479
|
+
};
|
|
2480
|
+
throw new Eu.InvalidElementException();
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
function bu(t) {
|
|
2484
|
+
var e = document.querySelectorAll(t);
|
|
2485
|
+
if (e.length !== 0) {
|
|
2486
|
+
for (var r = [], n = 0; n < e.length; n++)
|
|
2487
|
+
r.push(Xe(e[n]));
|
|
2488
|
+
return r;
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
function wu(t) {
|
|
2492
|
+
var e = document.createElement("canvas");
|
|
2493
|
+
return {
|
|
2494
|
+
element: e,
|
|
2495
|
+
options: (0, he.default)(t),
|
|
2496
|
+
renderer: L.default.CanvasRenderer,
|
|
2497
|
+
afterRender: function() {
|
|
2498
|
+
t.setAttribute("src", e.toDataURL());
|
|
2499
|
+
}
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
2502
|
+
De.default = Xe;
|
|
2503
|
+
var Ue = {};
|
|
2504
|
+
Object.defineProperty(Ue, "__esModule", {
|
|
2505
|
+
value: !0
|
|
2506
|
+
});
|
|
2507
|
+
var mu = /* @__PURE__ */ function() {
|
|
2508
|
+
function t(e, r) {
|
|
2509
|
+
for (var n = 0; n < r.length; n++) {
|
|
2510
|
+
var a = r[n];
|
|
2511
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2514
|
+
return function(e, r, n) {
|
|
2515
|
+
return r && t(e.prototype, r), n && t(e, n), e;
|
|
2516
|
+
};
|
|
2517
|
+
}();
|
|
2518
|
+
function $u(t, e) {
|
|
2519
|
+
if (!(t instanceof e))
|
|
2520
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2521
|
+
}
|
|
2522
|
+
var xu = function() {
|
|
2523
|
+
function t(e) {
|
|
2524
|
+
$u(this, t), this.api = e;
|
|
2525
|
+
}
|
|
2526
|
+
return mu(t, [{
|
|
2527
|
+
key: "handleCatch",
|
|
2528
|
+
value: function(r) {
|
|
2529
|
+
if (r.name === "InvalidInputException")
|
|
2530
|
+
if (this.api._options.valid !== this.api._defaults.valid)
|
|
2531
|
+
this.api._options.valid(!1);
|
|
2532
|
+
else
|
|
2533
|
+
throw r.message;
|
|
2534
|
+
else
|
|
2535
|
+
throw r;
|
|
2536
|
+
this.api.render = function() {
|
|
2537
|
+
};
|
|
2538
|
+
}
|
|
2539
|
+
}, {
|
|
2540
|
+
key: "wrapBarcodeCall",
|
|
2541
|
+
value: function(r) {
|
|
2542
|
+
try {
|
|
2543
|
+
var n = r.apply(void 0, arguments);
|
|
2544
|
+
return this.api._options.valid(!0), n;
|
|
2545
|
+
} catch (a) {
|
|
2546
|
+
return this.handleCatch(a), this.api;
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
}]), t;
|
|
2550
|
+
}();
|
|
2551
|
+
Ue.default = xu;
|
|
2552
|
+
var Su = ve, b = E(Su), Au = I, H = E(Au), Ru = Ie, Rt = E(Ru), Pu = ke, it = E(Pu), Tu = De, Mu = E(Tu), Iu = ne, ku = E(Iu), Du = Ue, ju = E(Du), Pt = k, Bu = re, Tt = E(Bu);
|
|
2553
|
+
function E(t) {
|
|
2554
|
+
return t && t.__esModule ? t : { default: t };
|
|
2555
|
+
}
|
|
2556
|
+
var p = function() {
|
|
2557
|
+
}, ae = function(e, r, n) {
|
|
2558
|
+
var a = new p();
|
|
2559
|
+
if (typeof e > "u")
|
|
2560
|
+
throw Error("No element to render on was provided.");
|
|
2561
|
+
return a._renderProperties = (0, Mu.default)(e), a._encodings = [], a._options = Tt.default, a._errorHandler = new ju.default(a), typeof r < "u" && (n = n || {}, n.format || (n.format = It()), a.options(n)[n.format](r, n).render()), a;
|
|
2562
|
+
};
|
|
2563
|
+
ae.getModule = function(t) {
|
|
2564
|
+
return b.default[t];
|
|
2565
|
+
};
|
|
2566
|
+
for (var ot in b.default)
|
|
2567
|
+
b.default.hasOwnProperty(ot) && Lu(b.default, ot);
|
|
2568
|
+
function Lu(t, e) {
|
|
2569
|
+
p.prototype[e] = p.prototype[e.toUpperCase()] = p.prototype[e.toLowerCase()] = function(r, n) {
|
|
2570
|
+
var a = this;
|
|
2571
|
+
return a._errorHandler.wrapBarcodeCall(function() {
|
|
2572
|
+
n.text = typeof n.text > "u" ? void 0 : "" + n.text;
|
|
2573
|
+
var i = (0, H.default)(a._options, n);
|
|
2574
|
+
i = (0, ku.default)(i);
|
|
2575
|
+
var o = t[e], u = Mt(r, o, i);
|
|
2576
|
+
return a._encodings.push(u), a;
|
|
2577
|
+
});
|
|
2578
|
+
};
|
|
2579
|
+
}
|
|
2580
|
+
function Mt(t, e, r) {
|
|
2581
|
+
t = "" + t;
|
|
2582
|
+
var n = new e(t, r);
|
|
2583
|
+
if (!n.valid())
|
|
2584
|
+
throw new Pt.InvalidInputException(n.constructor.name, t);
|
|
2585
|
+
var a = n.encode();
|
|
2586
|
+
a = (0, Rt.default)(a);
|
|
2587
|
+
for (var i = 0; i < a.length; i++)
|
|
2588
|
+
a[i].options = (0, H.default)(r, a[i].options);
|
|
2589
|
+
return a;
|
|
2590
|
+
}
|
|
2591
|
+
function It() {
|
|
2592
|
+
return b.default.CODE128 ? "CODE128" : Object.keys(b.default)[0];
|
|
2593
|
+
}
|
|
2594
|
+
p.prototype.options = function(t) {
|
|
2595
|
+
return this._options = (0, H.default)(this._options, t), this;
|
|
2596
|
+
};
|
|
2597
|
+
p.prototype.blank = function(t) {
|
|
2598
|
+
var e = new Array(t + 1).join("0");
|
|
2599
|
+
return this._encodings.push({ data: e }), this;
|
|
2600
|
+
};
|
|
2601
|
+
p.prototype.init = function() {
|
|
2602
|
+
if (this._renderProperties) {
|
|
2603
|
+
Array.isArray(this._renderProperties) || (this._renderProperties = [this._renderProperties]);
|
|
2604
|
+
var t;
|
|
2605
|
+
for (var e in this._renderProperties) {
|
|
2606
|
+
t = this._renderProperties[e];
|
|
2607
|
+
var r = (0, H.default)(this._options, t.options);
|
|
2608
|
+
r.format == "auto" && (r.format = It()), this._errorHandler.wrapBarcodeCall(function() {
|
|
2609
|
+
var n = r.value, a = b.default[r.format.toUpperCase()], i = Mt(n, a, r);
|
|
2610
|
+
_e(t, i, r);
|
|
2611
|
+
});
|
|
2612
|
+
}
|
|
2613
|
+
}
|
|
2614
|
+
};
|
|
2615
|
+
p.prototype.render = function() {
|
|
2616
|
+
if (!this._renderProperties)
|
|
2617
|
+
throw new Pt.NoElementException();
|
|
2618
|
+
if (Array.isArray(this._renderProperties))
|
|
2619
|
+
for (var t = 0; t < this._renderProperties.length; t++)
|
|
2620
|
+
_e(this._renderProperties[t], this._encodings, this._options);
|
|
2621
|
+
else
|
|
2622
|
+
_e(this._renderProperties, this._encodings, this._options);
|
|
2623
|
+
return this;
|
|
2624
|
+
};
|
|
2625
|
+
p.prototype._defaults = Tt.default;
|
|
2626
|
+
function _e(t, e, r) {
|
|
2627
|
+
e = (0, Rt.default)(e);
|
|
2628
|
+
for (var n = 0; n < e.length; n++)
|
|
2629
|
+
e[n].options = (0, H.default)(r, e[n].options), (0, it.default)(e[n].options);
|
|
2630
|
+
(0, it.default)(r);
|
|
2631
|
+
var a = t.renderer, i = new a(t.element, e, r);
|
|
2632
|
+
i.render(), t.afterRender && t.afterRender();
|
|
2633
|
+
}
|
|
2634
|
+
typeof window < "u" && (window.JsBarcode = ae);
|
|
2635
|
+
typeof jQuery < "u" && (jQuery.fn.JsBarcode = function(t, e) {
|
|
2636
|
+
var r = [];
|
|
2637
|
+
return jQuery(this).each(function() {
|
|
2638
|
+
r.push(this);
|
|
2639
|
+
}), ae(r, t, e);
|
|
2640
|
+
});
|
|
2641
|
+
var kt = ae;
|
|
2642
|
+
const Cu = /* @__PURE__ */ Bt(kt), Nu = /* @__PURE__ */ jt({
|
|
2643
|
+
__proto__: null,
|
|
2644
|
+
default: Cu
|
|
2645
|
+
}, [kt]);
|
|
2646
|
+
export {
|
|
2647
|
+
Nu as J
|
|
2648
|
+
};
|