@plattar/plattar-qrcode 1.112.2 → 1.119.2
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.
|
@@ -100,9 +100,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
100
100
|
_createClass(BaseElement, [{
|
|
101
101
|
key: "connectedCallback",
|
|
102
102
|
value: function connectedCallback() {
|
|
103
|
+
var _this = this;
|
|
104
|
+
|
|
103
105
|
if (this.hasAttribute("url")) {
|
|
104
106
|
this.renderQRCode();
|
|
105
107
|
}
|
|
108
|
+
|
|
109
|
+
var observer = new MutationObserver(function (mutations) {
|
|
110
|
+
mutations.forEach(function (mutation) {
|
|
111
|
+
if (mutation.type === "attributes") {
|
|
112
|
+
_this.renderQRCode();
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
observer.observe(this, {
|
|
117
|
+
attributes: true
|
|
118
|
+
});
|
|
106
119
|
}
|
|
107
120
|
}, {
|
|
108
121
|
key: "download",
|
|
@@ -125,11 +138,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
125
138
|
throw new Error("BaseElement.renderQRCode() - required attribute \"url\" is missing or invalid");
|
|
126
139
|
}
|
|
127
140
|
|
|
128
|
-
var width = this.hasAttribute("width") ? this.getAttribute("width") : 512;
|
|
129
|
-
var height = this.hasAttribute("height") ? this.getAttribute("height") : 512;
|
|
141
|
+
var width = this.hasAttribute("width") ? parseInt(this.getAttribute("width")) : 512;
|
|
142
|
+
var height = this.hasAttribute("height") ? parseInt(this.getAttribute("height")) : 512;
|
|
130
143
|
var margin = this.hasAttribute("margin") ? this.getAttribute("margin") : 0;
|
|
131
144
|
var image = this.hasAttribute("image") ? this.getAttribute("image") : undefined;
|
|
132
145
|
var color = this.hasAttribute("color") ? this.getAttribute("color") : "#000000";
|
|
146
|
+
var style = this.hasAttribute("qr-type") ? this.getAttribute("qr-type") : "default";
|
|
133
147
|
this._options = this._options || {
|
|
134
148
|
imageOptions: {
|
|
135
149
|
hideBackgroundDots: true,
|
|
@@ -201,8 +215,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
201
215
|
}
|
|
202
216
|
}
|
|
203
217
|
};
|
|
204
|
-
this._options.width =
|
|
205
|
-
this._options.height =
|
|
218
|
+
this._options.width = 2048;
|
|
219
|
+
this._options.height = 2048;
|
|
206
220
|
this._options.data = url;
|
|
207
221
|
this._options.margin = margin;
|
|
208
222
|
this._options.image = image; // set the colors
|
|
@@ -210,20 +224,58 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
210
224
|
this._options.dotsOptions.color = color;
|
|
211
225
|
this._options.cornersDotOptions.color = color;
|
|
212
226
|
this._options.cornersSquareOptions.color = color;
|
|
227
|
+
|
|
228
|
+
switch (style) {
|
|
229
|
+
case "dots":
|
|
230
|
+
this._options.dotsOptions.type = "dots";
|
|
231
|
+
break;
|
|
232
|
+
|
|
233
|
+
case "default":
|
|
234
|
+
default:
|
|
235
|
+
this._options.dotsOptions.type = "rounded";
|
|
236
|
+
}
|
|
237
|
+
|
|
213
238
|
var shadow = this.shadowRoot || this.attachShadow({
|
|
214
239
|
mode: 'open'
|
|
215
240
|
});
|
|
216
241
|
var qrCode = this._qrCode;
|
|
217
242
|
|
|
218
243
|
if (!qrCode) {
|
|
244
|
+
var div = document.createElement("div");
|
|
245
|
+
shadow.appendChild(div);
|
|
246
|
+
this._divContainer = div;
|
|
219
247
|
this._qrCode = new QRCodeStyling(this._options);
|
|
220
248
|
|
|
221
|
-
this._qrCode.append(
|
|
249
|
+
this._qrCode.append(div);
|
|
250
|
+
|
|
251
|
+
this._UpdateCanvas(width, height);
|
|
222
252
|
|
|
223
253
|
return;
|
|
224
254
|
}
|
|
225
255
|
|
|
226
256
|
this._qrCode.update(this._options);
|
|
257
|
+
|
|
258
|
+
this._UpdateCanvas(width, height);
|
|
259
|
+
}
|
|
260
|
+
}, {
|
|
261
|
+
key: "_UpdateCanvas",
|
|
262
|
+
value: function _UpdateCanvas(width, height) {
|
|
263
|
+
if (!this._qrCode) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
var canvas = this._qrCode._canvas;
|
|
268
|
+
|
|
269
|
+
if (canvas) {
|
|
270
|
+
canvas.style.width = "100%";
|
|
271
|
+
canvas.style.height = "100%";
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (this._divContainer) {
|
|
275
|
+
var div = this._divContainer;
|
|
276
|
+
div.style.width = width + "px";
|
|
277
|
+
div.style.height = height + "px";
|
|
278
|
+
}
|
|
227
279
|
}
|
|
228
280
|
}]);
|
|
229
281
|
|
|
@@ -288,8 +340,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
288
340
|
i = 0,
|
|
289
341
|
u = null,
|
|
290
342
|
v = [],
|
|
291
|
-
|
|
292
|
-
|
|
343
|
+
w = {},
|
|
344
|
+
m = function m(t, e) {
|
|
293
345
|
o = function (t) {
|
|
294
346
|
for (var e = new Array(t), r = 0; r < t; r += 1) {
|
|
295
347
|
e[r] = new Array(t);
|
|
@@ -300,16 +352,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
300
352
|
}
|
|
301
353
|
|
|
302
354
|
return e;
|
|
303
|
-
}(i = 4 * r + 17),
|
|
355
|
+
}(i = 4 * r + 17), b(0, 0), b(i - 7, 0), b(0, i - 7), x(), _(), M(t, e), r >= 7 && S(t), null == u && (u = A(r, n, v)), C(u, e);
|
|
304
356
|
},
|
|
305
|
-
|
|
357
|
+
b = function b(t, e) {
|
|
306
358
|
for (var r = -1; r <= 7; r += 1) {
|
|
307
359
|
if (!(t + r <= -1 || i <= t + r)) for (var n = -1; n <= 7; n += 1) {
|
|
308
360
|
e + n <= -1 || i <= e + n || (o[t + r][e + n] = 0 <= r && r <= 6 && (0 == n || 6 == n) || 0 <= n && n <= 6 && (0 == r || 6 == r) || 2 <= r && r <= 4 && 2 <= n && n <= 4);
|
|
309
361
|
}
|
|
310
362
|
}
|
|
311
363
|
},
|
|
312
|
-
|
|
364
|
+
_ = function _() {
|
|
313
365
|
for (var t = 8; t < i - 8; t += 1) {
|
|
314
366
|
null == o[t][6] && (o[t][6] = t % 2 == 0);
|
|
315
367
|
}
|
|
@@ -324,14 +376,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
324
376
|
var i = t[e],
|
|
325
377
|
a = t[n];
|
|
326
378
|
if (null == o[i][a]) for (var u = -2; u <= 2; u += 1) {
|
|
327
|
-
for (var
|
|
328
|
-
o[i + u][a +
|
|
379
|
+
for (var h = -2; h <= 2; h += 1) {
|
|
380
|
+
o[i + u][a + h] = -2 == u || 2 == u || -2 == h || 2 == h || 0 == u && 0 == h;
|
|
329
381
|
}
|
|
330
382
|
}
|
|
331
383
|
}
|
|
332
384
|
}
|
|
333
385
|
},
|
|
334
|
-
|
|
386
|
+
S = function S(t) {
|
|
335
387
|
for (var e = s.getBCHTypeNumber(r), n = 0; n < 18; n += 1) {
|
|
336
388
|
var a = !t && 1 == (e >> n & 1);
|
|
337
389
|
o[Math.floor(n / 3)][n % 3 + i - 8 - 3] = a;
|
|
@@ -341,25 +393,25 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
341
393
|
a = !t && 1 == (e >> n & 1), o[n % 3 + i - 8 - 3][Math.floor(n / 3)] = a;
|
|
342
394
|
}
|
|
343
395
|
},
|
|
344
|
-
|
|
396
|
+
M = function M(t, e) {
|
|
345
397
|
for (var r = n << 3 | e, a = s.getBCHTypeInfo(r), u = 0; u < 15; u += 1) {
|
|
346
|
-
var
|
|
347
|
-
u < 6 ? o[u][8] =
|
|
398
|
+
var h = !t && 1 == (a >> u & 1);
|
|
399
|
+
u < 6 ? o[u][8] = h : u < 8 ? o[u + 1][8] = h : o[i - 15 + u][8] = h;
|
|
348
400
|
}
|
|
349
401
|
|
|
350
402
|
for (u = 0; u < 15; u += 1) {
|
|
351
|
-
|
|
403
|
+
h = !t && 1 == (a >> u & 1), u < 8 ? o[8][i - u - 1] = h : u < 9 ? o[8][15 - u - 1 + 1] = h : o[8][15 - u - 1] = h;
|
|
352
404
|
}
|
|
353
405
|
|
|
354
406
|
o[i - 8][8] = !t;
|
|
355
407
|
},
|
|
356
408
|
C = function C(t, e) {
|
|
357
|
-
for (var r = -1, n = i - 1, a = 7, u = 0,
|
|
358
|
-
for (6 ==
|
|
359
|
-
for (var
|
|
360
|
-
if (null == o[n][
|
|
361
|
-
var
|
|
362
|
-
u < t.length && (
|
|
409
|
+
for (var r = -1, n = i - 1, a = 7, u = 0, h = s.getMaskFunction(e), c = i - 1; c > 0; c -= 2) {
|
|
410
|
+
for (6 == c && (c -= 1);;) {
|
|
411
|
+
for (var l = 0; l < 2; l += 1) {
|
|
412
|
+
if (null == o[n][c - l]) {
|
|
413
|
+
var d = !1;
|
|
414
|
+
u < t.length && (d = 1 == (t[u] >>> a & 1)), h(n, c - l) && (d = !d), o[n][c - l] = d, -1 == (a -= 1) && (u += 1, a = 7);
|
|
363
415
|
}
|
|
364
416
|
}
|
|
365
417
|
|
|
@@ -370,8 +422,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
370
422
|
}
|
|
371
423
|
}
|
|
372
424
|
},
|
|
373
|
-
|
|
374
|
-
for (var n =
|
|
425
|
+
A = function A(t, e, r) {
|
|
426
|
+
for (var n = c.getRSBlocks(t, e), o = l(), i = 0; i < r.length; i += 1) {
|
|
375
427
|
var a = r[i];
|
|
376
428
|
o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
|
|
377
429
|
}
|
|
@@ -394,55 +446,55 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
394
446
|
|
|
395
447
|
return function (t, e) {
|
|
396
448
|
for (var r = 0, n = 0, o = 0, i = new Array(e.length), a = new Array(e.length), u = 0; u < e.length; u += 1) {
|
|
397
|
-
var
|
|
398
|
-
|
|
399
|
-
n = Math.max(n,
|
|
449
|
+
var c = e[u].dataCount,
|
|
450
|
+
l = e[u].totalCount - c;
|
|
451
|
+
n = Math.max(n, c), o = Math.max(o, l), i[u] = new Array(c);
|
|
400
452
|
|
|
401
|
-
for (var
|
|
402
|
-
i[u][
|
|
453
|
+
for (var d = 0; d < i[u].length; d += 1) {
|
|
454
|
+
i[u][d] = 255 & t.getBuffer()[d + r];
|
|
403
455
|
}
|
|
404
456
|
|
|
405
|
-
r +=
|
|
406
|
-
var f = s.getErrorCorrectPolynomial(
|
|
407
|
-
|
|
457
|
+
r += c;
|
|
458
|
+
var f = s.getErrorCorrectPolynomial(l),
|
|
459
|
+
g = h(i[u], f.getLength() - 1).mod(f);
|
|
408
460
|
|
|
409
|
-
for (a[u] = new Array(f.getLength() - 1),
|
|
410
|
-
var
|
|
411
|
-
a[u][
|
|
461
|
+
for (a[u] = new Array(f.getLength() - 1), d = 0; d < a[u].length; d += 1) {
|
|
462
|
+
var p = d + g.getLength() - a[u].length;
|
|
463
|
+
a[u][d] = p >= 0 ? g.getAt(p) : 0;
|
|
412
464
|
}
|
|
413
465
|
}
|
|
414
466
|
|
|
415
467
|
var v = 0;
|
|
416
468
|
|
|
417
|
-
for (
|
|
418
|
-
v += e[
|
|
469
|
+
for (d = 0; d < e.length; d += 1) {
|
|
470
|
+
v += e[d].totalCount;
|
|
419
471
|
}
|
|
420
472
|
|
|
421
|
-
var
|
|
422
|
-
|
|
473
|
+
var w = new Array(v),
|
|
474
|
+
y = 0;
|
|
423
475
|
|
|
424
|
-
for (
|
|
476
|
+
for (d = 0; d < n; d += 1) {
|
|
425
477
|
for (u = 0; u < e.length; u += 1) {
|
|
426
|
-
|
|
478
|
+
d < i[u].length && (w[y] = i[u][d], y += 1);
|
|
427
479
|
}
|
|
428
480
|
}
|
|
429
481
|
|
|
430
|
-
for (
|
|
482
|
+
for (d = 0; d < o; d += 1) {
|
|
431
483
|
for (u = 0; u < e.length; u += 1) {
|
|
432
|
-
|
|
484
|
+
d < a[u].length && (w[y] = a[u][d], y += 1);
|
|
433
485
|
}
|
|
434
486
|
}
|
|
435
487
|
|
|
436
|
-
return
|
|
488
|
+
return w;
|
|
437
489
|
}(o, n);
|
|
438
490
|
};
|
|
439
491
|
|
|
440
|
-
|
|
492
|
+
w.addData = function (t, e) {
|
|
441
493
|
var r = null;
|
|
442
494
|
|
|
443
495
|
switch (e = e || "Byte") {
|
|
444
496
|
case "Numeric":
|
|
445
|
-
r =
|
|
497
|
+
r = d(t);
|
|
446
498
|
break;
|
|
447
499
|
|
|
448
500
|
case "Alphanumeric":
|
|
@@ -450,11 +502,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
450
502
|
break;
|
|
451
503
|
|
|
452
504
|
case "Byte":
|
|
453
|
-
r =
|
|
505
|
+
r = g(t);
|
|
454
506
|
break;
|
|
455
507
|
|
|
456
508
|
case "Kanji":
|
|
457
|
-
r =
|
|
509
|
+
r = p(t);
|
|
458
510
|
break;
|
|
459
511
|
|
|
460
512
|
default:
|
|
@@ -462,15 +514,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
462
514
|
}
|
|
463
515
|
|
|
464
516
|
v.push(r), u = null;
|
|
465
|
-
},
|
|
517
|
+
}, w.isDark = function (t, e) {
|
|
466
518
|
if (t < 0 || i <= t || e < 0 || i <= e) throw t + "," + e;
|
|
467
519
|
return o[t][e];
|
|
468
|
-
},
|
|
520
|
+
}, w.getModuleCount = function () {
|
|
469
521
|
return i;
|
|
470
|
-
},
|
|
522
|
+
}, w.make = function () {
|
|
471
523
|
if (r < 1) {
|
|
472
524
|
for (var t = 1; t < 40; t++) {
|
|
473
|
-
for (var e =
|
|
525
|
+
for (var e = c.getRSBlocks(t, n), o = l(), i = 0; i < v.length; i++) {
|
|
474
526
|
var a = v[i];
|
|
475
527
|
o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
|
|
476
528
|
}
|
|
@@ -487,33 +539,32 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
487
539
|
r = t;
|
|
488
540
|
}
|
|
489
541
|
|
|
490
|
-
|
|
542
|
+
m(!1, function () {
|
|
491
543
|
for (var t = 0, e = 0, r = 0; r < 8; r += 1) {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
var n = s.getLostPoint(y);
|
|
544
|
+
m(!0, r);
|
|
545
|
+
var n = s.getLostPoint(w);
|
|
495
546
|
(0 == r || t > n) && (t = n, e = r);
|
|
496
547
|
}
|
|
497
548
|
|
|
498
549
|
return e;
|
|
499
550
|
}());
|
|
500
|
-
},
|
|
551
|
+
}, w.createTableTag = function (t, e) {
|
|
501
552
|
t = t || 2;
|
|
502
553
|
var r = "";
|
|
503
554
|
r += '<table style="', r += " border-width: 0px; border-style: none;", r += " border-collapse: collapse;", r += " padding: 0px; margin: " + (e = void 0 === e ? 4 * t : e) + "px;", r += '">', r += "<tbody>";
|
|
504
555
|
|
|
505
|
-
for (var n = 0; n <
|
|
556
|
+
for (var n = 0; n < w.getModuleCount(); n += 1) {
|
|
506
557
|
r += "<tr>";
|
|
507
558
|
|
|
508
|
-
for (var o = 0; o <
|
|
509
|
-
r += '<td style="', r += " border-width: 0px; border-style: none;", r += " border-collapse: collapse;", r += " padding: 0px; margin: 0px;", r += " width: " + t + "px;", r += " height: " + t + "px;", r += " background-color: ", r +=
|
|
559
|
+
for (var o = 0; o < w.getModuleCount(); o += 1) {
|
|
560
|
+
r += '<td style="', r += " border-width: 0px; border-style: none;", r += " border-collapse: collapse;", r += " padding: 0px; margin: 0px;", r += " width: " + t + "px;", r += " height: " + t + "px;", r += " background-color: ", r += w.isDark(n, o) ? "#000000" : "#ffffff", r += ";", r += '"/>';
|
|
510
561
|
}
|
|
511
562
|
|
|
512
563
|
r += "</tr>";
|
|
513
564
|
}
|
|
514
565
|
|
|
515
566
|
return (r += "</tbody>") + "</table>";
|
|
516
|
-
},
|
|
567
|
+
}, w.createSvgTag = function (t, e, r, n) {
|
|
517
568
|
var o = {};
|
|
518
569
|
"object" == _typeof(arguments[0]) && (t = (o = arguments[0]).cellSize, e = o.margin, r = o.alt, n = o.title), t = t || 2, e = void 0 === e ? 4 * t : e, (r = "string" == typeof r ? {
|
|
519
570
|
text: r
|
|
@@ -524,38 +575,38 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
524
575
|
a,
|
|
525
576
|
s,
|
|
526
577
|
u,
|
|
527
|
-
|
|
528
|
-
|
|
578
|
+
h = w.getModuleCount() * t + 2 * e,
|
|
579
|
+
c = "";
|
|
529
580
|
|
|
530
|
-
for (u = "l" + t + ",0 0," + t + " -" + t + ",0 0,-" + t + "z ",
|
|
531
|
-
for (s = a * t + e, i = 0; i <
|
|
532
|
-
|
|
581
|
+
for (u = "l" + t + ",0 0," + t + " -" + t + ",0 0,-" + t + "z ", c += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"', c += o.scalable ? "" : ' width="' + h + 'px" height="' + h + 'px"', c += ' viewBox="0 0 ' + h + " " + h + '" ', c += ' preserveAspectRatio="xMinYMin meet"', c += n.text || r.text ? ' role="img" aria-labelledby="' + k([n.id, r.id].join(" ").trim()) + '"' : "", c += ">", c += n.text ? '<title id="' + k(n.id) + '">' + k(n.text) + "</title>" : "", c += r.text ? '<description id="' + k(r.id) + '">' + k(r.text) + "</description>" : "", c += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>', c += '<path d="', a = 0; a < w.getModuleCount(); a += 1) {
|
|
582
|
+
for (s = a * t + e, i = 0; i < w.getModuleCount(); i += 1) {
|
|
583
|
+
w.isDark(a, i) && (c += "M" + (i * t + e) + "," + s + u);
|
|
533
584
|
}
|
|
534
585
|
}
|
|
535
586
|
|
|
536
|
-
return (
|
|
537
|
-
},
|
|
587
|
+
return (c += '" stroke="transparent" fill="black"/>') + "</svg>";
|
|
588
|
+
}, w.createDataURL = function (t, e) {
|
|
538
589
|
t = t || 2, e = void 0 === e ? 4 * t : e;
|
|
539
|
-
var r =
|
|
590
|
+
var r = w.getModuleCount() * t + 2 * e,
|
|
540
591
|
n = e,
|
|
541
592
|
o = r - e;
|
|
542
|
-
return
|
|
593
|
+
return y(r, r, function (e, r) {
|
|
543
594
|
if (n <= e && e < o && n <= r && r < o) {
|
|
544
595
|
var i = Math.floor((e - n) / t),
|
|
545
596
|
a = Math.floor((r - n) / t);
|
|
546
|
-
return
|
|
597
|
+
return w.isDark(a, i) ? 0 : 1;
|
|
547
598
|
}
|
|
548
599
|
|
|
549
600
|
return 1;
|
|
550
601
|
});
|
|
551
|
-
},
|
|
602
|
+
}, w.createImgTag = function (t, e, r) {
|
|
552
603
|
t = t || 2, e = void 0 === e ? 4 * t : e;
|
|
553
|
-
var n =
|
|
604
|
+
var n = w.getModuleCount() * t + 2 * e,
|
|
554
605
|
o = "";
|
|
555
|
-
return o += "<img", o += ' src="', o +=
|
|
606
|
+
return o += "<img", o += ' src="', o += w.createDataURL(t, e), o += '"', o += ' width="', o += n, o += '"', o += ' height="', o += n, o += '"', r && (o += ' alt="', o += k(r), o += '"'), o + "/>";
|
|
556
607
|
};
|
|
557
608
|
|
|
558
|
-
var
|
|
609
|
+
var k = function k(t) {
|
|
559
610
|
for (var e = "", r = 0; r < t.length; r += 1) {
|
|
560
611
|
var n = t.charAt(r);
|
|
561
612
|
|
|
@@ -584,7 +635,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
584
635
|
return e;
|
|
585
636
|
};
|
|
586
637
|
|
|
587
|
-
return
|
|
638
|
+
return w.createASCII = function (t, e) {
|
|
588
639
|
if ((t = t || 1) < 2) return function (t) {
|
|
589
640
|
t = void 0 === t ? 2 : t;
|
|
590
641
|
var e,
|
|
@@ -592,66 +643,66 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
592
643
|
n,
|
|
593
644
|
o,
|
|
594
645
|
i,
|
|
595
|
-
a = 1 *
|
|
646
|
+
a = 1 * w.getModuleCount() + 2 * t,
|
|
596
647
|
s = t,
|
|
597
648
|
u = a - t,
|
|
598
|
-
|
|
649
|
+
h = {
|
|
599
650
|
"██": "█",
|
|
600
651
|
"█ ": "▀",
|
|
601
652
|
" █": "▄",
|
|
602
653
|
" ": " "
|
|
603
654
|
},
|
|
604
|
-
|
|
655
|
+
c = {
|
|
605
656
|
"██": "▀",
|
|
606
657
|
"█ ": "▀",
|
|
607
658
|
" █": " ",
|
|
608
659
|
" ": " "
|
|
609
660
|
},
|
|
610
|
-
|
|
661
|
+
l = "";
|
|
611
662
|
|
|
612
663
|
for (e = 0; e < a; e += 2) {
|
|
613
664
|
for (n = Math.floor((e - s) / 1), o = Math.floor((e + 1 - s) / 1), r = 0; r < a; r += 1) {
|
|
614
|
-
i = "█", s <= r && r < u && s <= e && e < u &&
|
|
665
|
+
i = "█", s <= r && r < u && s <= e && e < u && w.isDark(n, Math.floor((r - s) / 1)) && (i = " "), s <= r && r < u && s <= e + 1 && e + 1 < u && w.isDark(o, Math.floor((r - s) / 1)) ? i += " " : i += "█", l += t < 1 && e + 1 >= u ? c[i] : h[i];
|
|
615
666
|
}
|
|
616
667
|
|
|
617
|
-
|
|
668
|
+
l += "\n";
|
|
618
669
|
}
|
|
619
670
|
|
|
620
|
-
return a % 2 && t > 0 ?
|
|
671
|
+
return a % 2 && t > 0 ? l.substring(0, l.length - a - 1) + Array(a + 1).join("▀") : l.substring(0, l.length - 1);
|
|
621
672
|
}(e);
|
|
622
673
|
t -= 1, e = void 0 === e ? 2 * t : e;
|
|
623
674
|
var r,
|
|
624
675
|
n,
|
|
625
676
|
o,
|
|
626
677
|
i,
|
|
627
|
-
a =
|
|
678
|
+
a = w.getModuleCount() * t + 2 * e,
|
|
628
679
|
s = e,
|
|
629
680
|
u = a - e,
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
681
|
+
h = Array(t + 1).join("██"),
|
|
682
|
+
c = Array(t + 1).join(" "),
|
|
683
|
+
l = "",
|
|
684
|
+
d = "";
|
|
634
685
|
|
|
635
686
|
for (r = 0; r < a; r += 1) {
|
|
636
|
-
for (o = Math.floor((r - s) / t),
|
|
637
|
-
i = 1, s <= n && n < u && s <= r && r < u &&
|
|
687
|
+
for (o = Math.floor((r - s) / t), d = "", n = 0; n < a; n += 1) {
|
|
688
|
+
i = 1, s <= n && n < u && s <= r && r < u && w.isDark(o, Math.floor((n - s) / t)) && (i = 0), d += i ? h : c;
|
|
638
689
|
}
|
|
639
690
|
|
|
640
691
|
for (o = 0; o < t; o += 1) {
|
|
641
|
-
|
|
692
|
+
l += d + "\n";
|
|
642
693
|
}
|
|
643
694
|
}
|
|
644
695
|
|
|
645
|
-
return
|
|
646
|
-
},
|
|
696
|
+
return l.substring(0, l.length - 1);
|
|
697
|
+
}, w.renderTo2dContext = function (t, e) {
|
|
647
698
|
e = e || 2;
|
|
648
699
|
|
|
649
|
-
for (var r =
|
|
700
|
+
for (var r = w.getModuleCount(), n = 0; n < r; n++) {
|
|
650
701
|
for (var o = 0; o < r; o++) {
|
|
651
|
-
t.fillStyle =
|
|
702
|
+
t.fillStyle = w.isDark(n, o) ? "black" : "white", t.fillRect(n * e, o * e, e, e);
|
|
652
703
|
}
|
|
653
704
|
}
|
|
654
|
-
},
|
|
705
|
+
}, w;
|
|
655
706
|
};
|
|
656
707
|
|
|
657
708
|
t.stringToBytes = (t.stringToBytesFuncs = {
|
|
@@ -665,7 +716,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
665
716
|
}
|
|
666
717
|
})["default"], t.createStringToBytes = function (t, e) {
|
|
667
718
|
var r = function () {
|
|
668
|
-
for (var r =
|
|
719
|
+
for (var r = w(t), n = function n() {
|
|
669
720
|
var t = r.read();
|
|
670
721
|
if (-1 == t) throw "eof";
|
|
671
722
|
return t;
|
|
@@ -772,8 +823,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
772
823
|
throw "bad maskPattern:" + t;
|
|
773
824
|
}
|
|
774
825
|
}, o.getErrorCorrectPolynomial = function (t) {
|
|
775
|
-
for (var e =
|
|
776
|
-
e = e.multiply(
|
|
826
|
+
for (var e = h([1], 0), r = 0; r < t; r += 1) {
|
|
827
|
+
e = e.multiply(h([1, u.gexp(r)], 0));
|
|
777
828
|
}
|
|
778
829
|
|
|
779
830
|
return e;
|
|
@@ -841,8 +892,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
841
892
|
|
|
842
893
|
for (n = 0; n < e - 1; n += 1) {
|
|
843
894
|
for (o = 0; o < e - 1; o += 1) {
|
|
844
|
-
var
|
|
845
|
-
t.isDark(n, o) && (
|
|
895
|
+
var h = 0;
|
|
896
|
+
t.isDark(n, o) && (h += 1), t.isDark(n + 1, o) && (h += 1), t.isDark(n, o + 1) && (h += 1), t.isDark(n + 1, o + 1) && (h += 1), 0 != h && 4 != h || (r += 3);
|
|
846
897
|
}
|
|
847
898
|
}
|
|
848
899
|
|
|
@@ -858,15 +909,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
858
909
|
}
|
|
859
910
|
}
|
|
860
911
|
|
|
861
|
-
var
|
|
912
|
+
var c = 0;
|
|
862
913
|
|
|
863
914
|
for (o = 0; o < e; o += 1) {
|
|
864
915
|
for (n = 0; n < e; n += 1) {
|
|
865
|
-
t.isDark(n, o) && (
|
|
916
|
+
t.isDark(n, o) && (c += 1);
|
|
866
917
|
}
|
|
867
918
|
}
|
|
868
919
|
|
|
869
|
-
return r + Math.abs(100 *
|
|
920
|
+
return r + Math.abs(100 * c / e / e - 50) / 5 * 10;
|
|
870
921
|
}, o),
|
|
871
922
|
u = function () {
|
|
872
923
|
for (var t = new Array(256), e = new Array(256), r = 0; r < 8; r += 1) {
|
|
@@ -900,7 +951,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
900
951
|
};
|
|
901
952
|
}();
|
|
902
953
|
|
|
903
|
-
function
|
|
954
|
+
function h(t, e) {
|
|
904
955
|
if (void 0 === t.length) throw t.length + "/" + e;
|
|
905
956
|
|
|
906
957
|
var r = function () {
|
|
@@ -928,7 +979,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
928
979
|
}
|
|
929
980
|
}
|
|
930
981
|
|
|
931
|
-
return
|
|
982
|
+
return h(e, 0);
|
|
932
983
|
},
|
|
933
984
|
mod: function mod(t) {
|
|
934
985
|
if (n.getLength() - t.getLength() < 0) return n;
|
|
@@ -941,14 +992,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
941
992
|
r[o] ^= u.gexp(u.glog(t.getAt(o)) + e);
|
|
942
993
|
}
|
|
943
994
|
|
|
944
|
-
return
|
|
995
|
+
return h(r, 0).mod(t);
|
|
945
996
|
}
|
|
946
997
|
};
|
|
947
998
|
|
|
948
999
|
return n;
|
|
949
1000
|
}
|
|
950
1001
|
|
|
951
|
-
var
|
|
1002
|
+
var c = function () {
|
|
952
1003
|
var t = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12, 7, 37, 13], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]],
|
|
953
1004
|
e = function e(t, _e) {
|
|
954
1005
|
var r = {};
|
|
@@ -978,8 +1029,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
978
1029
|
if (void 0 === o) throw "bad rs block @ typeNumber:" + r + "/errorCorrectionLevel:" + n;
|
|
979
1030
|
|
|
980
1031
|
for (var i = o.length / 3, s = [], u = 0; u < i; u += 1) {
|
|
981
|
-
for (var
|
|
982
|
-
s.push(e(
|
|
1032
|
+
for (var h = o[3 * u + 0], c = o[3 * u + 1], l = o[3 * u + 2], d = 0; d < h; d += 1) {
|
|
1033
|
+
s.push(e(c, l));
|
|
983
1034
|
}
|
|
984
1035
|
}
|
|
985
1036
|
|
|
@@ -989,7 +1040,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
989
1040
|
|
|
990
1041
|
return r;
|
|
991
1042
|
}(),
|
|
992
|
-
|
|
1043
|
+
l = function l() {
|
|
993
1044
|
var t = [],
|
|
994
1045
|
e = 0,
|
|
995
1046
|
r = {
|
|
@@ -1015,7 +1066,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1015
1066
|
};
|
|
1016
1067
|
return r;
|
|
1017
1068
|
},
|
|
1018
|
-
|
|
1069
|
+
d = function d(t) {
|
|
1019
1070
|
var e = t,
|
|
1020
1071
|
r = {
|
|
1021
1072
|
getMode: function getMode() {
|
|
@@ -1102,7 +1153,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1102
1153
|
|
|
1103
1154
|
return r;
|
|
1104
1155
|
},
|
|
1105
|
-
|
|
1156
|
+
g = function g(e) {
|
|
1106
1157
|
var r = t.stringToBytes(e);
|
|
1107
1158
|
return {
|
|
1108
1159
|
getMode: function getMode() {
|
|
@@ -1118,7 +1169,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1118
1169
|
}
|
|
1119
1170
|
};
|
|
1120
1171
|
},
|
|
1121
|
-
|
|
1172
|
+
p = function p(e) {
|
|
1122
1173
|
var r = t.stringToBytesFuncs.SJIS;
|
|
1123
1174
|
if (!r) throw "sjis not supported.";
|
|
1124
1175
|
!function (t, e) {
|
|
@@ -1184,7 +1235,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1184
1235
|
};
|
|
1185
1236
|
return e;
|
|
1186
1237
|
},
|
|
1187
|
-
|
|
1238
|
+
w = function w(t) {
|
|
1188
1239
|
var e = t,
|
|
1189
1240
|
r = 0,
|
|
1190
1241
|
n = 0,
|
|
@@ -1217,7 +1268,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1217
1268
|
|
|
1218
1269
|
return i;
|
|
1219
1270
|
},
|
|
1220
|
-
|
|
1271
|
+
y = function y(t, e, r) {
|
|
1221
1272
|
for (var n = function (t, e) {
|
|
1222
1273
|
var r = t,
|
|
1223
1274
|
n = e,
|
|
@@ -1245,33 +1296,33 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1245
1296
|
|
|
1246
1297
|
i.add(String.fromCharCode(e)), i.add(String.fromCharCode(r));
|
|
1247
1298
|
var u,
|
|
1248
|
-
c,
|
|
1249
1299
|
h,
|
|
1250
|
-
|
|
1251
|
-
l = (
|
|
1300
|
+
c,
|
|
1301
|
+
l = v(),
|
|
1302
|
+
d = (u = l, h = 0, c = 0, {
|
|
1252
1303
|
write: function write(t, e) {
|
|
1253
1304
|
if (t >>> e != 0) throw "length over";
|
|
1254
1305
|
|
|
1255
|
-
for (;
|
|
1256
|
-
u.writeByte(255 & (t <<
|
|
1306
|
+
for (; h + e >= 8;) {
|
|
1307
|
+
u.writeByte(255 & (t << h | c)), e -= 8 - h, t >>>= 8 - h, c = 0, h = 0;
|
|
1257
1308
|
}
|
|
1258
1309
|
|
|
1259
|
-
|
|
1310
|
+
c |= t << h, h += e;
|
|
1260
1311
|
},
|
|
1261
1312
|
flush: function flush() {
|
|
1262
|
-
|
|
1313
|
+
h > 0 && u.writeByte(c);
|
|
1263
1314
|
}
|
|
1264
1315
|
});
|
|
1265
|
-
|
|
1316
|
+
d.write(e, n);
|
|
1266
1317
|
var f = 0,
|
|
1267
|
-
|
|
1318
|
+
g = String.fromCharCode(o[f]);
|
|
1268
1319
|
|
|
1269
1320
|
for (f += 1; f < o.length;) {
|
|
1270
|
-
var
|
|
1271
|
-
f += 1, i.contains(
|
|
1321
|
+
var p = String.fromCharCode(o[f]);
|
|
1322
|
+
f += 1, i.contains(g + p) ? g += p : (d.write(i.indexOf(g), n), i.size() < 4095 && (i.size() == 1 << n && (n += 1), i.add(g + p)), g = p);
|
|
1272
1323
|
}
|
|
1273
1324
|
|
|
1274
|
-
return
|
|
1325
|
+
return d.write(i.indexOf(g), n), d.write(r, n), d.flush(), l.toByteArray();
|
|
1275
1326
|
},
|
|
1276
1327
|
s = function s() {
|
|
1277
1328
|
var t = {},
|
|
@@ -1335,8 +1386,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1335
1386
|
}, o.toString = function () {
|
|
1336
1387
|
return n;
|
|
1337
1388
|
}, o;
|
|
1338
|
-
}(), u = a.toByteArray(),
|
|
1339
|
-
s.writeByte(u[
|
|
1389
|
+
}(), u = a.toByteArray(), h = 0; h < u.length; h += 1) {
|
|
1390
|
+
s.writeByte(u[h]);
|
|
1340
1391
|
}
|
|
1341
1392
|
|
|
1342
1393
|
return s.flush(), "data:image/gif;base64," + s;
|
|
@@ -1358,12 +1409,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1358
1409
|
return o;
|
|
1359
1410
|
}) ? r.apply(e, []) : r) || (t.exports = n);
|
|
1360
1411
|
},
|
|
1361
|
-
|
|
1412
|
+
676: function _(t, e, r) {
|
|
1362
1413
|
"use strict";
|
|
1363
1414
|
|
|
1364
1415
|
r.d(e, {
|
|
1365
1416
|
"default": function _default() {
|
|
1366
|
-
return
|
|
1417
|
+
return q;
|
|
1367
1418
|
}
|
|
1368
1419
|
});
|
|
1369
1420
|
|
|
@@ -1418,49 +1469,148 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1418
1469
|
}
|
|
1419
1470
|
|
|
1420
1471
|
function u(t) {
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1472
|
+
return e = this, r = void 0, o = function o() {
|
|
1473
|
+
return function (t, e) {
|
|
1474
|
+
var r,
|
|
1475
|
+
n,
|
|
1476
|
+
o,
|
|
1477
|
+
i,
|
|
1478
|
+
a = {
|
|
1479
|
+
label: 0,
|
|
1480
|
+
sent: function sent() {
|
|
1481
|
+
if (1 & o[0]) throw o[1];
|
|
1482
|
+
return o[1];
|
|
1483
|
+
},
|
|
1484
|
+
trys: [],
|
|
1485
|
+
ops: []
|
|
1486
|
+
};
|
|
1487
|
+
return i = {
|
|
1488
|
+
next: s(0),
|
|
1489
|
+
"throw": s(1),
|
|
1490
|
+
"return": s(2)
|
|
1491
|
+
}, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
|
|
1492
|
+
return this;
|
|
1493
|
+
}), i;
|
|
1494
|
+
|
|
1495
|
+
function s(i) {
|
|
1496
|
+
return function (s) {
|
|
1497
|
+
return function (i) {
|
|
1498
|
+
if (r) throw new TypeError("Generator is already executing.");
|
|
1499
|
+
|
|
1500
|
+
for (; a;) {
|
|
1501
|
+
try {
|
|
1502
|
+
if (r = 1, n && (o = 2 & i[0] ? n["return"] : i[0] ? n["throw"] || ((o = n["return"]) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o;
|
|
1503
|
+
|
|
1504
|
+
switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
|
|
1505
|
+
case 0:
|
|
1506
|
+
case 1:
|
|
1507
|
+
o = i;
|
|
1508
|
+
break;
|
|
1509
|
+
|
|
1510
|
+
case 4:
|
|
1511
|
+
return a.label++, {
|
|
1512
|
+
value: i[1],
|
|
1513
|
+
done: !1
|
|
1514
|
+
};
|
|
1515
|
+
|
|
1516
|
+
case 5:
|
|
1517
|
+
a.label++, n = i[1], i = [0];
|
|
1518
|
+
continue;
|
|
1519
|
+
|
|
1520
|
+
case 7:
|
|
1521
|
+
i = a.ops.pop(), a.trys.pop();
|
|
1522
|
+
continue;
|
|
1523
|
+
|
|
1524
|
+
default:
|
|
1525
|
+
if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
|
|
1526
|
+
a = 0;
|
|
1527
|
+
continue;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
|
|
1531
|
+
a.label = i[1];
|
|
1532
|
+
break;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
if (6 === i[0] && a.label < o[1]) {
|
|
1536
|
+
a.label = o[1], o = i;
|
|
1537
|
+
break;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
if (o && a.label < o[2]) {
|
|
1541
|
+
a.label = o[2], a.ops.push(i);
|
|
1542
|
+
break;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
o[2] && a.ops.pop(), a.trys.pop();
|
|
1546
|
+
continue;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
i = e.call(t, a);
|
|
1550
|
+
} catch (t) {
|
|
1551
|
+
i = [6, t], n = 0;
|
|
1552
|
+
} finally {
|
|
1553
|
+
r = o = 0;
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
if (5 & i[0]) throw i[1];
|
|
1558
|
+
return {
|
|
1559
|
+
value: i[0] ? i[1] : void 0,
|
|
1560
|
+
done: !0
|
|
1561
|
+
};
|
|
1562
|
+
}([i, s]);
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1565
|
+
}(this, function (e) {
|
|
1566
|
+
return [2, new Promise(function (e) {
|
|
1567
|
+
var r = new XMLHttpRequest();
|
|
1568
|
+
r.onload = function () {
|
|
1569
|
+
var t = new FileReader();
|
|
1570
|
+
t.onloadend = function () {
|
|
1571
|
+
e(t.result);
|
|
1572
|
+
}, t.readAsDataURL(r.response);
|
|
1573
|
+
}, r.open("GET", t), r.responseType = "blob", r.send();
|
|
1574
|
+
})];
|
|
1575
|
+
});
|
|
1576
|
+
}, new ((n = void 0) || (n = Promise))(function (t, i) {
|
|
1577
|
+
function a(t) {
|
|
1578
|
+
try {
|
|
1579
|
+
u(o.next(t));
|
|
1580
|
+
} catch (t) {
|
|
1581
|
+
i(t);
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
function s(t) {
|
|
1586
|
+
try {
|
|
1587
|
+
u(o["throw"](t));
|
|
1588
|
+
} catch (t) {
|
|
1589
|
+
i(t);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
function u(e) {
|
|
1594
|
+
var r;
|
|
1595
|
+
e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
|
|
1596
|
+
t(r);
|
|
1597
|
+
})).then(a, s);
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
u((o = o.apply(e, r || [])).next());
|
|
1601
|
+
});
|
|
1602
|
+
var e, r, n, o;
|
|
1447
1603
|
}
|
|
1448
1604
|
|
|
1449
|
-
var
|
|
1605
|
+
var h = {
|
|
1450
1606
|
L: .07,
|
|
1451
1607
|
M: .15,
|
|
1452
1608
|
Q: .25,
|
|
1453
1609
|
H: .3
|
|
1454
|
-
}
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
f = "classy-rounded",
|
|
1459
|
-
p = "square",
|
|
1460
|
-
g = "extra-rounded";
|
|
1461
|
-
|
|
1462
|
-
var _v = function v() {
|
|
1463
|
-
return (_v = Object.assign || function (t) {
|
|
1610
|
+
};
|
|
1611
|
+
|
|
1612
|
+
var _c = function c() {
|
|
1613
|
+
return (_c = Object.assign || function (t) {
|
|
1464
1614
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
1465
1615
|
for (var o in e = arguments[r]) {
|
|
1466
1616
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
@@ -1471,39 +1621,38 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1471
1621
|
}).apply(this, arguments);
|
|
1472
1622
|
};
|
|
1473
1623
|
|
|
1474
|
-
var
|
|
1624
|
+
var l = function () {
|
|
1475
1625
|
function t(t) {
|
|
1476
|
-
var e = t.
|
|
1626
|
+
var e = t.svg,
|
|
1477
1627
|
r = t.type;
|
|
1478
|
-
this.
|
|
1628
|
+
this._svg = e, this._type = r;
|
|
1479
1629
|
}
|
|
1480
1630
|
|
|
1481
1631
|
return t.prototype.draw = function (t, e, r, n) {
|
|
1482
|
-
var o
|
|
1483
|
-
i = this._context;
|
|
1632
|
+
var o;
|
|
1484
1633
|
|
|
1485
1634
|
switch (this._type) {
|
|
1486
|
-
case
|
|
1635
|
+
case "dots":
|
|
1487
1636
|
o = this._drawDot;
|
|
1488
1637
|
break;
|
|
1489
1638
|
|
|
1490
|
-
case
|
|
1639
|
+
case "classy":
|
|
1491
1640
|
o = this._drawClassy;
|
|
1492
1641
|
break;
|
|
1493
1642
|
|
|
1494
|
-
case
|
|
1643
|
+
case "classy-rounded":
|
|
1495
1644
|
o = this._drawClassyRounded;
|
|
1496
1645
|
break;
|
|
1497
1646
|
|
|
1498
|
-
case
|
|
1647
|
+
case "rounded":
|
|
1499
1648
|
o = this._drawRounded;
|
|
1500
1649
|
break;
|
|
1501
1650
|
|
|
1502
|
-
case
|
|
1651
|
+
case "extra-rounded":
|
|
1503
1652
|
o = this._drawExtraRounded;
|
|
1504
1653
|
break;
|
|
1505
1654
|
|
|
1506
|
-
case
|
|
1655
|
+
case "square":
|
|
1507
1656
|
default:
|
|
1508
1657
|
o = this._drawSquare;
|
|
1509
1658
|
}
|
|
@@ -1512,276 +1661,251 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1512
1661
|
x: t,
|
|
1513
1662
|
y: e,
|
|
1514
1663
|
size: r,
|
|
1515
|
-
context: i,
|
|
1516
1664
|
getNeighbor: n
|
|
1517
1665
|
});
|
|
1518
1666
|
}, t.prototype._rotateFigure = function (t) {
|
|
1519
|
-
var e
|
|
1520
|
-
r = t.
|
|
1521
|
-
n = t.
|
|
1522
|
-
o = t.
|
|
1667
|
+
var e,
|
|
1668
|
+
r = t.x,
|
|
1669
|
+
n = t.y,
|
|
1670
|
+
o = t.size,
|
|
1523
1671
|
i = t.rotation,
|
|
1524
1672
|
a = void 0 === i ? 0 : i,
|
|
1525
|
-
s =
|
|
1526
|
-
u =
|
|
1527
|
-
|
|
1528
|
-
o.translate(u, c), a && o.rotate(a), s(), o.closePath(), a && o.rotate(-a), o.translate(-u, -c);
|
|
1673
|
+
s = r + o / 2,
|
|
1674
|
+
u = n + o / 2;
|
|
1675
|
+
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
1529
1676
|
}, t.prototype._basicDot = function (t) {
|
|
1530
|
-
var e =
|
|
1531
|
-
r = t.
|
|
1677
|
+
var e = this,
|
|
1678
|
+
r = t.size,
|
|
1679
|
+
n = t.x,
|
|
1680
|
+
o = t.y;
|
|
1532
1681
|
|
|
1533
|
-
this._rotateFigure(
|
|
1682
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1534
1683
|
draw: function draw() {
|
|
1535
|
-
|
|
1684
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "circle"), e._element.setAttribute("cx", String(n + r / 2)), e._element.setAttribute("cy", String(o + r / 2)), e._element.setAttribute("r", String(r / 2));
|
|
1536
1685
|
}
|
|
1537
1686
|
}));
|
|
1538
1687
|
}, t.prototype._basicSquare = function (t) {
|
|
1539
|
-
var e =
|
|
1540
|
-
r = t.
|
|
1688
|
+
var e = this,
|
|
1689
|
+
r = t.size,
|
|
1690
|
+
n = t.x,
|
|
1691
|
+
o = t.y;
|
|
1541
1692
|
|
|
1542
|
-
this._rotateFigure(
|
|
1693
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1543
1694
|
draw: function draw() {
|
|
1544
|
-
|
|
1695
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "rect"), e._element.setAttribute("x", String(n)), e._element.setAttribute("y", String(o)), e._element.setAttribute("width", String(r)), e._element.setAttribute("height", String(r));
|
|
1545
1696
|
}
|
|
1546
1697
|
}));
|
|
1547
1698
|
}, t.prototype._basicSideRounded = function (t) {
|
|
1548
|
-
var e =
|
|
1549
|
-
r = t.
|
|
1699
|
+
var e = this,
|
|
1700
|
+
r = t.size,
|
|
1701
|
+
n = t.x,
|
|
1702
|
+
o = t.y;
|
|
1550
1703
|
|
|
1551
|
-
this._rotateFigure(
|
|
1704
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1552
1705
|
draw: function draw() {
|
|
1553
|
-
|
|
1706
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, 0 " + -r);
|
|
1554
1707
|
}
|
|
1555
1708
|
}));
|
|
1556
1709
|
}, t.prototype._basicCornerRounded = function (t) {
|
|
1557
|
-
var e =
|
|
1558
|
-
r = t.
|
|
1710
|
+
var e = this,
|
|
1711
|
+
r = t.size,
|
|
1712
|
+
n = t.x,
|
|
1713
|
+
o = t.y;
|
|
1559
1714
|
|
|
1560
|
-
this._rotateFigure(
|
|
1715
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1561
1716
|
draw: function draw() {
|
|
1562
|
-
|
|
1717
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "v " + -r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + -r / 2 + " " + -r / 2);
|
|
1563
1718
|
}
|
|
1564
1719
|
}));
|
|
1565
1720
|
}, t.prototype._basicCornerExtraRounded = function (t) {
|
|
1566
|
-
var e =
|
|
1567
|
-
r = t.
|
|
1721
|
+
var e = this,
|
|
1722
|
+
r = t.size,
|
|
1723
|
+
n = t.x,
|
|
1724
|
+
o = t.y;
|
|
1568
1725
|
|
|
1569
|
-
this._rotateFigure(
|
|
1726
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1570
1727
|
draw: function draw() {
|
|
1571
|
-
|
|
1728
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "a " + r + " " + r + ", 0, 0, 0, " + -r + " " + -r);
|
|
1572
1729
|
}
|
|
1573
1730
|
}));
|
|
1574
1731
|
}, t.prototype._basicCornersRounded = function (t) {
|
|
1575
|
-
var e =
|
|
1576
|
-
r = t.
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
draw: function draw() {
|
|
1580
|
-
r.arc(0, 0, e / 2, -Math.PI / 2, 0), r.lineTo(e / 2, e / 2), r.lineTo(0, e / 2), r.arc(0, 0, e / 2, Math.PI / 2, Math.PI), r.lineTo(-e / 2, -e / 2), r.lineTo(0, -e / 2);
|
|
1581
|
-
}
|
|
1582
|
-
}));
|
|
1583
|
-
}, t.prototype._basicCornersExtraRounded = function (t) {
|
|
1584
|
-
var e = t.size,
|
|
1585
|
-
r = t.context;
|
|
1732
|
+
var e = this,
|
|
1733
|
+
r = t.size,
|
|
1734
|
+
n = t.x,
|
|
1735
|
+
o = t.y;
|
|
1586
1736
|
|
|
1587
|
-
this._rotateFigure(
|
|
1737
|
+
this._rotateFigure(_c(_c({}, t), {
|
|
1588
1738
|
draw: function draw() {
|
|
1589
|
-
|
|
1739
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + r / 2 + " " + r / 2 + "h " + r / 2 + "v " + -r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + -r / 2 + " " + -r / 2);
|
|
1590
1740
|
}
|
|
1591
1741
|
}));
|
|
1592
1742
|
}, t.prototype._drawDot = function (t) {
|
|
1593
1743
|
var e = t.x,
|
|
1594
1744
|
r = t.y,
|
|
1595
|
-
n = t.size
|
|
1596
|
-
o = t.context;
|
|
1745
|
+
n = t.size;
|
|
1597
1746
|
|
|
1598
1747
|
this._basicDot({
|
|
1599
1748
|
x: e,
|
|
1600
1749
|
y: r,
|
|
1601
1750
|
size: n,
|
|
1602
|
-
context: o,
|
|
1603
1751
|
rotation: 0
|
|
1604
1752
|
});
|
|
1605
1753
|
}, t.prototype._drawSquare = function (t) {
|
|
1606
1754
|
var e = t.x,
|
|
1607
1755
|
r = t.y,
|
|
1608
|
-
n = t.size
|
|
1609
|
-
o = t.context;
|
|
1756
|
+
n = t.size;
|
|
1610
1757
|
|
|
1611
1758
|
this._basicSquare({
|
|
1612
1759
|
x: e,
|
|
1613
1760
|
y: r,
|
|
1614
1761
|
size: n,
|
|
1615
|
-
context: o,
|
|
1616
1762
|
rotation: 0
|
|
1617
1763
|
});
|
|
1618
1764
|
}, t.prototype._drawRounded = function (t) {
|
|
1619
1765
|
var e = t.x,
|
|
1620
1766
|
r = t.y,
|
|
1621
1767
|
n = t.size,
|
|
1622
|
-
o = t.
|
|
1623
|
-
i =
|
|
1624
|
-
a =
|
|
1625
|
-
s =
|
|
1626
|
-
u =
|
|
1627
|
-
|
|
1628
|
-
h = a + s + u + c;
|
|
1768
|
+
o = t.getNeighbor,
|
|
1769
|
+
i = o ? +o(-1, 0) : 0,
|
|
1770
|
+
a = o ? +o(1, 0) : 0,
|
|
1771
|
+
s = o ? +o(0, -1) : 0,
|
|
1772
|
+
u = o ? +o(0, 1) : 0,
|
|
1773
|
+
h = i + a + s + u;
|
|
1629
1774
|
if (0 !== h) {
|
|
1630
|
-
if (h > 2 ||
|
|
1775
|
+
if (h > 2 || i && a || s && u) this._basicSquare({
|
|
1631
1776
|
x: e,
|
|
1632
1777
|
y: r,
|
|
1633
1778
|
size: n,
|
|
1634
|
-
context: o,
|
|
1635
1779
|
rotation: 0
|
|
1636
1780
|
});else {
|
|
1637
1781
|
if (2 === h) {
|
|
1638
|
-
var
|
|
1639
|
-
return
|
|
1782
|
+
var c = 0;
|
|
1783
|
+
return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerRounded({
|
|
1640
1784
|
x: e,
|
|
1641
1785
|
y: r,
|
|
1642
1786
|
size: n,
|
|
1643
|
-
|
|
1644
|
-
rotation: d
|
|
1787
|
+
rotation: c
|
|
1645
1788
|
});
|
|
1646
1789
|
}
|
|
1647
1790
|
|
|
1648
|
-
if (1 === h) return
|
|
1791
|
+
if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
|
|
1649
1792
|
x: e,
|
|
1650
1793
|
y: r,
|
|
1651
1794
|
size: n,
|
|
1652
|
-
|
|
1653
|
-
rotation: d
|
|
1795
|
+
rotation: c
|
|
1654
1796
|
});
|
|
1655
1797
|
}
|
|
1656
1798
|
} else this._basicDot({
|
|
1657
1799
|
x: e,
|
|
1658
1800
|
y: r,
|
|
1659
1801
|
size: n,
|
|
1660
|
-
context: o,
|
|
1661
1802
|
rotation: 0
|
|
1662
1803
|
});
|
|
1663
1804
|
}, t.prototype._drawExtraRounded = function (t) {
|
|
1664
1805
|
var e = t.x,
|
|
1665
1806
|
r = t.y,
|
|
1666
1807
|
n = t.size,
|
|
1667
|
-
o = t.
|
|
1668
|
-
i =
|
|
1669
|
-
a =
|
|
1670
|
-
s =
|
|
1671
|
-
u =
|
|
1672
|
-
|
|
1673
|
-
h = a + s + u + c;
|
|
1808
|
+
o = t.getNeighbor,
|
|
1809
|
+
i = o ? +o(-1, 0) : 0,
|
|
1810
|
+
a = o ? +o(1, 0) : 0,
|
|
1811
|
+
s = o ? +o(0, -1) : 0,
|
|
1812
|
+
u = o ? +o(0, 1) : 0,
|
|
1813
|
+
h = i + a + s + u;
|
|
1674
1814
|
if (0 !== h) {
|
|
1675
|
-
if (h > 2 ||
|
|
1815
|
+
if (h > 2 || i && a || s && u) this._basicSquare({
|
|
1676
1816
|
x: e,
|
|
1677
1817
|
y: r,
|
|
1678
1818
|
size: n,
|
|
1679
|
-
context: o,
|
|
1680
1819
|
rotation: 0
|
|
1681
1820
|
});else {
|
|
1682
1821
|
if (2 === h) {
|
|
1683
|
-
var
|
|
1684
|
-
return
|
|
1822
|
+
var c = 0;
|
|
1823
|
+
return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerExtraRounded({
|
|
1685
1824
|
x: e,
|
|
1686
1825
|
y: r,
|
|
1687
1826
|
size: n,
|
|
1688
|
-
|
|
1689
|
-
rotation: d
|
|
1827
|
+
rotation: c
|
|
1690
1828
|
});
|
|
1691
1829
|
}
|
|
1692
1830
|
|
|
1693
|
-
if (1 === h) return
|
|
1831
|
+
if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
|
|
1694
1832
|
x: e,
|
|
1695
1833
|
y: r,
|
|
1696
1834
|
size: n,
|
|
1697
|
-
|
|
1698
|
-
rotation: d
|
|
1835
|
+
rotation: c
|
|
1699
1836
|
});
|
|
1700
1837
|
}
|
|
1701
1838
|
} else this._basicDot({
|
|
1702
1839
|
x: e,
|
|
1703
1840
|
y: r,
|
|
1704
1841
|
size: n,
|
|
1705
|
-
context: o,
|
|
1706
1842
|
rotation: 0
|
|
1707
1843
|
});
|
|
1708
1844
|
}, t.prototype._drawClassy = function (t) {
|
|
1709
1845
|
var e = t.x,
|
|
1710
1846
|
r = t.y,
|
|
1711
1847
|
n = t.size,
|
|
1712
|
-
o = t.
|
|
1713
|
-
i =
|
|
1714
|
-
a =
|
|
1715
|
-
s =
|
|
1716
|
-
u =
|
|
1717
|
-
|
|
1718
|
-
0 !== a + s + u + c ? a || u ? s || c ? this._basicSquare({
|
|
1848
|
+
o = t.getNeighbor,
|
|
1849
|
+
i = o ? +o(-1, 0) : 0,
|
|
1850
|
+
a = o ? +o(1, 0) : 0,
|
|
1851
|
+
s = o ? +o(0, -1) : 0,
|
|
1852
|
+
u = o ? +o(0, 1) : 0;
|
|
1853
|
+
0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
|
|
1719
1854
|
x: e,
|
|
1720
1855
|
y: r,
|
|
1721
1856
|
size: n,
|
|
1722
|
-
context: o,
|
|
1723
1857
|
rotation: 0
|
|
1724
1858
|
}) : this._basicCornerRounded({
|
|
1725
1859
|
x: e,
|
|
1726
1860
|
y: r,
|
|
1727
1861
|
size: n,
|
|
1728
|
-
context: o,
|
|
1729
1862
|
rotation: Math.PI / 2
|
|
1730
1863
|
}) : this._basicCornerRounded({
|
|
1731
1864
|
x: e,
|
|
1732
1865
|
y: r,
|
|
1733
1866
|
size: n,
|
|
1734
|
-
context: o,
|
|
1735
1867
|
rotation: -Math.PI / 2
|
|
1736
1868
|
}) : this._basicCornersRounded({
|
|
1737
1869
|
x: e,
|
|
1738
1870
|
y: r,
|
|
1739
1871
|
size: n,
|
|
1740
|
-
context: o,
|
|
1741
1872
|
rotation: Math.PI / 2
|
|
1742
1873
|
});
|
|
1743
1874
|
}, t.prototype._drawClassyRounded = function (t) {
|
|
1744
1875
|
var e = t.x,
|
|
1745
1876
|
r = t.y,
|
|
1746
1877
|
n = t.size,
|
|
1747
|
-
o = t.
|
|
1748
|
-
i =
|
|
1749
|
-
a =
|
|
1750
|
-
s =
|
|
1751
|
-
u =
|
|
1752
|
-
|
|
1753
|
-
0 !== a + s + u + c ? a || u ? s || c ? this._basicSquare({
|
|
1878
|
+
o = t.getNeighbor,
|
|
1879
|
+
i = o ? +o(-1, 0) : 0,
|
|
1880
|
+
a = o ? +o(1, 0) : 0,
|
|
1881
|
+
s = o ? +o(0, -1) : 0,
|
|
1882
|
+
u = o ? +o(0, 1) : 0;
|
|
1883
|
+
0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
|
|
1754
1884
|
x: e,
|
|
1755
1885
|
y: r,
|
|
1756
1886
|
size: n,
|
|
1757
|
-
context: o,
|
|
1758
1887
|
rotation: 0
|
|
1759
1888
|
}) : this._basicCornerExtraRounded({
|
|
1760
1889
|
x: e,
|
|
1761
1890
|
y: r,
|
|
1762
1891
|
size: n,
|
|
1763
|
-
context: o,
|
|
1764
1892
|
rotation: Math.PI / 2
|
|
1765
1893
|
}) : this._basicCornerExtraRounded({
|
|
1766
1894
|
x: e,
|
|
1767
1895
|
y: r,
|
|
1768
1896
|
size: n,
|
|
1769
|
-
context: o,
|
|
1770
1897
|
rotation: -Math.PI / 2
|
|
1771
1898
|
}) : this._basicCornersRounded({
|
|
1772
1899
|
x: e,
|
|
1773
1900
|
y: r,
|
|
1774
1901
|
size: n,
|
|
1775
|
-
context: o,
|
|
1776
1902
|
rotation: Math.PI / 2
|
|
1777
1903
|
});
|
|
1778
1904
|
}, t;
|
|
1779
|
-
}()
|
|
1780
|
-
w = "square",
|
|
1781
|
-
_ = "extra-rounded";
|
|
1905
|
+
}();
|
|
1782
1906
|
|
|
1783
|
-
var
|
|
1784
|
-
return (
|
|
1907
|
+
var _d = function d() {
|
|
1908
|
+
return (_d = Object.assign || function (t) {
|
|
1785
1909
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
1786
1910
|
for (var o in e = arguments[r]) {
|
|
1787
1911
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
@@ -1792,23 +1916,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1792
1916
|
}).apply(this, arguments);
|
|
1793
1917
|
};
|
|
1794
1918
|
|
|
1795
|
-
var
|
|
1919
|
+
var f = function () {
|
|
1796
1920
|
function t(t) {
|
|
1797
|
-
var e = t.
|
|
1921
|
+
var e = t.svg,
|
|
1798
1922
|
r = t.type;
|
|
1799
|
-
this.
|
|
1923
|
+
this._svg = e, this._type = r;
|
|
1800
1924
|
}
|
|
1801
1925
|
|
|
1802
1926
|
return t.prototype.draw = function (t, e, r, n) {
|
|
1803
|
-
var o
|
|
1804
|
-
i = this._context;
|
|
1927
|
+
var o;
|
|
1805
1928
|
|
|
1806
1929
|
switch (this._type) {
|
|
1807
|
-
case
|
|
1930
|
+
case "square":
|
|
1808
1931
|
o = this._drawSquare;
|
|
1809
1932
|
break;
|
|
1810
1933
|
|
|
1811
|
-
case
|
|
1934
|
+
case "extra-rounded":
|
|
1812
1935
|
o = this._drawExtraRounded;
|
|
1813
1936
|
break;
|
|
1814
1937
|
|
|
@@ -1821,98 +1944,95 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1821
1944
|
x: t,
|
|
1822
1945
|
y: e,
|
|
1823
1946
|
size: r,
|
|
1824
|
-
context: i,
|
|
1825
1947
|
rotation: n
|
|
1826
1948
|
});
|
|
1827
1949
|
}, t.prototype._rotateFigure = function (t) {
|
|
1828
|
-
var e
|
|
1829
|
-
r = t.
|
|
1830
|
-
n = t.
|
|
1831
|
-
o = t.
|
|
1950
|
+
var e,
|
|
1951
|
+
r = t.x,
|
|
1952
|
+
n = t.y,
|
|
1953
|
+
o = t.size,
|
|
1832
1954
|
i = t.rotation,
|
|
1833
1955
|
a = void 0 === i ? 0 : i,
|
|
1834
|
-
s =
|
|
1835
|
-
u =
|
|
1836
|
-
|
|
1837
|
-
o.translate(u, c), a && o.rotate(a), s(), o.closePath(), a && o.rotate(-a), o.translate(-u, -c);
|
|
1956
|
+
s = r + o / 2,
|
|
1957
|
+
u = n + o / 2;
|
|
1958
|
+
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
1838
1959
|
}, t.prototype._basicDot = function (t) {
|
|
1839
|
-
var e =
|
|
1840
|
-
r = t.
|
|
1841
|
-
n =
|
|
1960
|
+
var e = this,
|
|
1961
|
+
r = t.size,
|
|
1962
|
+
n = t.x,
|
|
1963
|
+
o = t.y,
|
|
1964
|
+
i = r / 7;
|
|
1842
1965
|
|
|
1843
|
-
this._rotateFigure(
|
|
1966
|
+
this._rotateFigure(_d(_d({}, t), {
|
|
1844
1967
|
draw: function draw() {
|
|
1845
|
-
|
|
1968
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + (n + r / 2) + " " + o + "a " + r / 2 + " " + r / 2 + " 0 1 0 0.1 0zm 0 " + i + "a " + (r / 2 - i) + " " + (r / 2 - i) + " 0 1 1 -0.1 0Z");
|
|
1846
1969
|
}
|
|
1847
1970
|
}));
|
|
1848
1971
|
}, t.prototype._basicSquare = function (t) {
|
|
1849
|
-
var e =
|
|
1850
|
-
r = t.
|
|
1851
|
-
n =
|
|
1972
|
+
var e = this,
|
|
1973
|
+
r = t.size,
|
|
1974
|
+
n = t.x,
|
|
1975
|
+
o = t.y,
|
|
1976
|
+
i = r / 7;
|
|
1852
1977
|
|
|
1853
|
-
this._rotateFigure(
|
|
1978
|
+
this._rotateFigure(_d(_d({}, t), {
|
|
1854
1979
|
draw: function draw() {
|
|
1855
|
-
|
|
1980
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "v " + -r + "zM " + (n + i) + " " + (o + i) + "h " + (r - 2 * i) + "v " + (r - 2 * i) + "h " + (2 * i - r) + "z");
|
|
1856
1981
|
}
|
|
1857
1982
|
}));
|
|
1858
1983
|
}, t.prototype._basicExtraRounded = function (t) {
|
|
1859
|
-
var e =
|
|
1860
|
-
r = t.
|
|
1861
|
-
n =
|
|
1984
|
+
var e = this,
|
|
1985
|
+
r = t.size,
|
|
1986
|
+
n = t.x,
|
|
1987
|
+
o = t.y,
|
|
1988
|
+
i = r / 7;
|
|
1862
1989
|
|
|
1863
|
-
this._rotateFigure(
|
|
1990
|
+
this._rotateFigure(_d(_d({}, t), {
|
|
1864
1991
|
draw: function draw() {
|
|
1865
|
-
|
|
1992
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + n + " " + (o + 2.5 * i) + "v " + 2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * i + " " + 2.5 * i + "h " + 2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * i + " " + 2.5 * -i + "v " + -2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * -i + " " + 2.5 * -i + "h " + -2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * -i + " " + 2.5 * i + "M " + (n + 2.5 * i) + " " + (o + i) + "h " + 2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * i + " " + 1.5 * i + "v " + 2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * -i + " " + 1.5 * i + "h " + -2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * -i + " " + 1.5 * -i + "v " + -2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * i + " " + 1.5 * -i);
|
|
1866
1993
|
}
|
|
1867
1994
|
}));
|
|
1868
1995
|
}, t.prototype._drawDot = function (t) {
|
|
1869
1996
|
var e = t.x,
|
|
1870
1997
|
r = t.y,
|
|
1871
1998
|
n = t.size,
|
|
1872
|
-
o = t.
|
|
1873
|
-
i = t.rotation;
|
|
1999
|
+
o = t.rotation;
|
|
1874
2000
|
|
|
1875
2001
|
this._basicDot({
|
|
1876
2002
|
x: e,
|
|
1877
2003
|
y: r,
|
|
1878
2004
|
size: n,
|
|
1879
|
-
|
|
1880
|
-
rotation: i
|
|
2005
|
+
rotation: o
|
|
1881
2006
|
});
|
|
1882
2007
|
}, t.prototype._drawSquare = function (t) {
|
|
1883
2008
|
var e = t.x,
|
|
1884
2009
|
r = t.y,
|
|
1885
2010
|
n = t.size,
|
|
1886
|
-
o = t.
|
|
1887
|
-
i = t.rotation;
|
|
2011
|
+
o = t.rotation;
|
|
1888
2012
|
|
|
1889
2013
|
this._basicSquare({
|
|
1890
2014
|
x: e,
|
|
1891
2015
|
y: r,
|
|
1892
2016
|
size: n,
|
|
1893
|
-
|
|
1894
|
-
rotation: i
|
|
2017
|
+
rotation: o
|
|
1895
2018
|
});
|
|
1896
2019
|
}, t.prototype._drawExtraRounded = function (t) {
|
|
1897
2020
|
var e = t.x,
|
|
1898
2021
|
r = t.y,
|
|
1899
2022
|
n = t.size,
|
|
1900
|
-
o = t.
|
|
1901
|
-
i = t.rotation;
|
|
2023
|
+
o = t.rotation;
|
|
1902
2024
|
|
|
1903
2025
|
this._basicExtraRounded({
|
|
1904
2026
|
x: e,
|
|
1905
2027
|
y: r,
|
|
1906
2028
|
size: n,
|
|
1907
|
-
|
|
1908
|
-
rotation: i
|
|
2029
|
+
rotation: o
|
|
1909
2030
|
});
|
|
1910
2031
|
}, t;
|
|
1911
|
-
}()
|
|
1912
|
-
x = "square";
|
|
2032
|
+
}();
|
|
1913
2033
|
|
|
1914
|
-
var
|
|
1915
|
-
return (
|
|
2034
|
+
var _g = function g() {
|
|
2035
|
+
return (_g = Object.assign || function (t) {
|
|
1916
2036
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
1917
2037
|
for (var o in e = arguments[r]) {
|
|
1918
2038
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
@@ -1923,19 +2043,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1923
2043
|
}).apply(this, arguments);
|
|
1924
2044
|
};
|
|
1925
2045
|
|
|
1926
|
-
var
|
|
2046
|
+
var p = function () {
|
|
1927
2047
|
function t(t) {
|
|
1928
|
-
var e = t.
|
|
2048
|
+
var e = t.svg,
|
|
1929
2049
|
r = t.type;
|
|
1930
|
-
this.
|
|
2050
|
+
this._svg = e, this._type = r;
|
|
1931
2051
|
}
|
|
1932
2052
|
|
|
1933
2053
|
return t.prototype.draw = function (t, e, r, n) {
|
|
1934
|
-
var o
|
|
1935
|
-
i = this._context;
|
|
2054
|
+
var o;
|
|
1936
2055
|
|
|
1937
2056
|
switch (this._type) {
|
|
1938
|
-
case
|
|
2057
|
+
case "square":
|
|
1939
2058
|
o = this._drawSquare;
|
|
1940
2059
|
break;
|
|
1941
2060
|
|
|
@@ -1948,1041 +2067,193 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1948
2067
|
x: t,
|
|
1949
2068
|
y: e,
|
|
1950
2069
|
size: r,
|
|
1951
|
-
context: i,
|
|
1952
2070
|
rotation: n
|
|
1953
2071
|
});
|
|
1954
2072
|
}, t.prototype._rotateFigure = function (t) {
|
|
1955
|
-
var e
|
|
1956
|
-
r = t.
|
|
1957
|
-
n = t.
|
|
1958
|
-
o = t.
|
|
2073
|
+
var e,
|
|
2074
|
+
r = t.x,
|
|
2075
|
+
n = t.y,
|
|
2076
|
+
o = t.size,
|
|
1959
2077
|
i = t.rotation,
|
|
1960
2078
|
a = void 0 === i ? 0 : i,
|
|
1961
|
-
s =
|
|
1962
|
-
u =
|
|
1963
|
-
|
|
1964
|
-
o.translate(u, c), a && o.rotate(a), s(), o.closePath(), a && o.rotate(-a), o.translate(-u, -c);
|
|
2079
|
+
s = r + o / 2,
|
|
2080
|
+
u = n + o / 2;
|
|
2081
|
+
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
1965
2082
|
}, t.prototype._basicDot = function (t) {
|
|
1966
|
-
var e =
|
|
1967
|
-
r = t.
|
|
2083
|
+
var e = this,
|
|
2084
|
+
r = t.size,
|
|
2085
|
+
n = t.x,
|
|
2086
|
+
o = t.y;
|
|
1968
2087
|
|
|
1969
|
-
this._rotateFigure(
|
|
2088
|
+
this._rotateFigure(_g(_g({}, t), {
|
|
1970
2089
|
draw: function draw() {
|
|
1971
|
-
|
|
2090
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "circle"), e._element.setAttribute("cx", String(n + r / 2)), e._element.setAttribute("cy", String(o + r / 2)), e._element.setAttribute("r", String(r / 2));
|
|
1972
2091
|
}
|
|
1973
2092
|
}));
|
|
1974
2093
|
}, t.prototype._basicSquare = function (t) {
|
|
1975
|
-
var e =
|
|
1976
|
-
r = t.
|
|
2094
|
+
var e = this,
|
|
2095
|
+
r = t.size,
|
|
2096
|
+
n = t.x,
|
|
2097
|
+
o = t.y;
|
|
1977
2098
|
|
|
1978
|
-
this._rotateFigure(
|
|
2099
|
+
this._rotateFigure(_g(_g({}, t), {
|
|
1979
2100
|
draw: function draw() {
|
|
1980
|
-
|
|
2101
|
+
e._element = document.createElementNS("http://www.w3.org/2000/svg", "rect"), e._element.setAttribute("x", String(n)), e._element.setAttribute("y", String(o)), e._element.setAttribute("width", String(r)), e._element.setAttribute("height", String(r));
|
|
1981
2102
|
}
|
|
1982
2103
|
}));
|
|
1983
2104
|
}, t.prototype._drawDot = function (t) {
|
|
1984
2105
|
var e = t.x,
|
|
1985
2106
|
r = t.y,
|
|
1986
2107
|
n = t.size,
|
|
1987
|
-
o = t.
|
|
1988
|
-
i = t.rotation;
|
|
2108
|
+
o = t.rotation;
|
|
1989
2109
|
|
|
1990
2110
|
this._basicDot({
|
|
1991
2111
|
x: e,
|
|
1992
2112
|
y: r,
|
|
1993
2113
|
size: n,
|
|
1994
|
-
|
|
1995
|
-
rotation: i
|
|
2114
|
+
rotation: o
|
|
1996
2115
|
});
|
|
1997
2116
|
}, t.prototype._drawSquare = function (t) {
|
|
1998
2117
|
var e = t.x,
|
|
1999
2118
|
r = t.y,
|
|
2000
2119
|
n = t.size,
|
|
2001
|
-
o = t.
|
|
2002
|
-
i = t.rotation;
|
|
2120
|
+
o = t.rotation;
|
|
2003
2121
|
|
|
2004
2122
|
this._basicSquare({
|
|
2005
2123
|
x: e,
|
|
2006
2124
|
y: r,
|
|
2007
2125
|
size: n,
|
|
2008
|
-
|
|
2009
|
-
rotation: i
|
|
2126
|
+
rotation: o
|
|
2010
2127
|
});
|
|
2011
2128
|
}, t;
|
|
2012
2129
|
}(),
|
|
2013
|
-
|
|
2130
|
+
v = "circle";
|
|
2014
2131
|
|
|
2015
|
-
var
|
|
2016
|
-
|
|
2132
|
+
var w = function w(t, e, r, n) {
|
|
2133
|
+
return new (r || (r = Promise))(function (o, i) {
|
|
2134
|
+
function a(t) {
|
|
2135
|
+
try {
|
|
2136
|
+
u(n.next(t));
|
|
2137
|
+
} catch (t) {
|
|
2138
|
+
i(t);
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2017
2141
|
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2142
|
+
function s(t) {
|
|
2143
|
+
try {
|
|
2144
|
+
u(n["throw"](t));
|
|
2145
|
+
} catch (t) {
|
|
2146
|
+
i(t);
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2022
2149
|
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
configurable: !0
|
|
2029
|
-
}), Object.defineProperty(t.prototype, "width", {
|
|
2030
|
-
get: function get() {
|
|
2031
|
-
return this._canvas.width;
|
|
2032
|
-
},
|
|
2033
|
-
enumerable: !1,
|
|
2034
|
-
configurable: !0
|
|
2035
|
-
}), Object.defineProperty(t.prototype, "height", {
|
|
2036
|
-
get: function get() {
|
|
2037
|
-
return this._canvas.height;
|
|
2038
|
-
},
|
|
2039
|
-
enumerable: !1,
|
|
2040
|
-
configurable: !0
|
|
2041
|
-
}), t.prototype.getCanvas = function () {
|
|
2042
|
-
return this._canvas;
|
|
2043
|
-
}, t.prototype.clear = function () {
|
|
2044
|
-
var t = this.context;
|
|
2045
|
-
t && t.clearRect(0, 0, this._canvas.width, this._canvas.height);
|
|
2046
|
-
}, t.prototype.drawQR = function (t) {
|
|
2047
|
-
return e = this, r = void 0, o = function o() {
|
|
2048
|
-
var e,
|
|
2049
|
-
r,
|
|
2050
|
-
n,
|
|
2051
|
-
o,
|
|
2052
|
-
i,
|
|
2053
|
-
a,
|
|
2054
|
-
s,
|
|
2055
|
-
h,
|
|
2056
|
-
d,
|
|
2057
|
-
l = this;
|
|
2058
|
-
return function (t, e) {
|
|
2059
|
-
var r,
|
|
2060
|
-
n,
|
|
2061
|
-
o,
|
|
2062
|
-
i,
|
|
2063
|
-
a = {
|
|
2064
|
-
label: 0,
|
|
2065
|
-
sent: function sent() {
|
|
2066
|
-
if (1 & o[0]) throw o[1];
|
|
2067
|
-
return o[1];
|
|
2068
|
-
},
|
|
2069
|
-
trys: [],
|
|
2070
|
-
ops: []
|
|
2071
|
-
};
|
|
2072
|
-
return i = {
|
|
2073
|
-
next: s(0),
|
|
2074
|
-
"throw": s(1),
|
|
2075
|
-
"return": s(2)
|
|
2076
|
-
}, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
|
|
2077
|
-
return this;
|
|
2078
|
-
}), i;
|
|
2079
|
-
|
|
2080
|
-
function s(i) {
|
|
2081
|
-
return function (s) {
|
|
2082
|
-
return function (i) {
|
|
2083
|
-
if (r) throw new TypeError("Generator is already executing.");
|
|
2084
|
-
|
|
2085
|
-
for (; a;) {
|
|
2086
|
-
try {
|
|
2087
|
-
if (r = 1, n && (o = 2 & i[0] ? n["return"] : i[0] ? n["throw"] || ((o = n["return"]) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o;
|
|
2088
|
-
|
|
2089
|
-
switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
|
|
2090
|
-
case 0:
|
|
2091
|
-
case 1:
|
|
2092
|
-
o = i;
|
|
2093
|
-
break;
|
|
2094
|
-
|
|
2095
|
-
case 4:
|
|
2096
|
-
return a.label++, {
|
|
2097
|
-
value: i[1],
|
|
2098
|
-
done: !1
|
|
2099
|
-
};
|
|
2100
|
-
|
|
2101
|
-
case 5:
|
|
2102
|
-
a.label++, n = i[1], i = [0];
|
|
2103
|
-
continue;
|
|
2104
|
-
|
|
2105
|
-
case 7:
|
|
2106
|
-
i = a.ops.pop(), a.trys.pop();
|
|
2107
|
-
continue;
|
|
2108
|
-
|
|
2109
|
-
default:
|
|
2110
|
-
if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
|
|
2111
|
-
a = 0;
|
|
2112
|
-
continue;
|
|
2113
|
-
}
|
|
2114
|
-
|
|
2115
|
-
if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
|
|
2116
|
-
a.label = i[1];
|
|
2117
|
-
break;
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
if (6 === i[0] && a.label < o[1]) {
|
|
2121
|
-
a.label = o[1], o = i;
|
|
2122
|
-
break;
|
|
2123
|
-
}
|
|
2124
|
-
|
|
2125
|
-
if (o && a.label < o[2]) {
|
|
2126
|
-
a.label = o[2], a.ops.push(i);
|
|
2127
|
-
break;
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
o[2] && a.ops.pop(), a.trys.pop();
|
|
2131
|
-
continue;
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
i = e.call(t, a);
|
|
2135
|
-
} catch (t) {
|
|
2136
|
-
i = [6, t], n = 0;
|
|
2137
|
-
} finally {
|
|
2138
|
-
r = o = 0;
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
if (5 & i[0]) throw i[1];
|
|
2143
|
-
return {
|
|
2144
|
-
value: i[0] ? i[1] : void 0,
|
|
2145
|
-
done: !0
|
|
2146
|
-
};
|
|
2147
|
-
}([i, s]);
|
|
2148
|
-
};
|
|
2149
|
-
}
|
|
2150
|
-
}(this, function (f) {
|
|
2151
|
-
switch (f.label) {
|
|
2152
|
-
case 0:
|
|
2153
|
-
return e = t.getModuleCount(), r = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n = Math.floor(r / e), o = {
|
|
2154
|
-
hideXDots: 0,
|
|
2155
|
-
hideYDots: 0,
|
|
2156
|
-
width: 0,
|
|
2157
|
-
height: 0
|
|
2158
|
-
}, this._qr = t, this._options.image ? [4, this.loadImage()] : [3, 2];
|
|
2159
|
-
|
|
2160
|
-
case 1:
|
|
2161
|
-
if (f.sent(), !this._image) return [2];
|
|
2162
|
-
i = this._options, a = i.imageOptions, s = i.qrOptions, h = a.imageSize * c[s.errorCorrectionLevel], d = Math.floor(h * e * e), o = u({
|
|
2163
|
-
originalWidth: this._image.width,
|
|
2164
|
-
originalHeight: this._image.height,
|
|
2165
|
-
maxHiddenDots: d,
|
|
2166
|
-
maxHiddenAxisDots: e - 14,
|
|
2167
|
-
dotSize: n
|
|
2168
|
-
}), f.label = 2;
|
|
2169
|
-
|
|
2170
|
-
case 2:
|
|
2171
|
-
return this.clear(), this.drawBackground(), this.drawDots(function (t, r) {
|
|
2172
|
-
var n, i, a, s, u, c;
|
|
2173
|
-
return !(l._options.imageOptions.hideBackgroundDots && t >= (e - o.hideXDots) / 2 && t < (e + o.hideXDots) / 2 && r >= (e - o.hideYDots) / 2 && r < (e + o.hideYDots) / 2 || (null === (n = P[t]) || void 0 === n ? void 0 : n[r]) || (null === (i = P[t - e + 7]) || void 0 === i ? void 0 : i[r]) || (null === (a = P[t]) || void 0 === a ? void 0 : a[r - e + 7]) || (null === (s = O[t]) || void 0 === s ? void 0 : s[r]) || (null === (u = O[t - e + 7]) || void 0 === u ? void 0 : u[r]) || (null === (c = O[t]) || void 0 === c ? void 0 : c[r - e + 7]));
|
|
2174
|
-
}), this.drawCorners(), this._options.image && this.drawImage({
|
|
2175
|
-
width: o.width,
|
|
2176
|
-
height: o.height,
|
|
2177
|
-
count: e,
|
|
2178
|
-
dotSize: n
|
|
2179
|
-
}), [2];
|
|
2180
|
-
}
|
|
2181
|
-
});
|
|
2182
|
-
}, new ((n = void 0) || (n = Promise))(function (t, i) {
|
|
2183
|
-
function a(t) {
|
|
2184
|
-
try {
|
|
2185
|
-
u(o.next(t));
|
|
2186
|
-
} catch (t) {
|
|
2187
|
-
i(t);
|
|
2188
|
-
}
|
|
2189
|
-
}
|
|
2190
|
-
|
|
2191
|
-
function s(t) {
|
|
2192
|
-
try {
|
|
2193
|
-
u(o["throw"](t));
|
|
2194
|
-
} catch (t) {
|
|
2195
|
-
i(t);
|
|
2196
|
-
}
|
|
2197
|
-
}
|
|
2198
|
-
|
|
2199
|
-
function u(e) {
|
|
2200
|
-
var r;
|
|
2201
|
-
e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
|
|
2202
|
-
t(r);
|
|
2203
|
-
})).then(a, s);
|
|
2204
|
-
}
|
|
2205
|
-
|
|
2206
|
-
u((o = o.apply(e, r || [])).next());
|
|
2207
|
-
});
|
|
2208
|
-
var e, r, n, o;
|
|
2209
|
-
}, t.prototype.drawBackground = function () {
|
|
2210
|
-
var t = this.context,
|
|
2211
|
-
e = this._options;
|
|
2212
|
-
|
|
2213
|
-
if (t) {
|
|
2214
|
-
if (e.backgroundOptions.gradient) {
|
|
2215
|
-
var r = e.backgroundOptions.gradient,
|
|
2216
|
-
n = this._createGradient({
|
|
2217
|
-
context: t,
|
|
2218
|
-
options: r,
|
|
2219
|
-
additionalRotation: 0,
|
|
2220
|
-
x: 0,
|
|
2221
|
-
y: 0,
|
|
2222
|
-
size: this._canvas.width > this._canvas.height ? this._canvas.width : this._canvas.height
|
|
2223
|
-
});
|
|
2224
|
-
|
|
2225
|
-
r.colorStops.forEach(function (t) {
|
|
2226
|
-
var e = t.offset,
|
|
2227
|
-
r = t.color;
|
|
2228
|
-
n.addColorStop(e, r);
|
|
2229
|
-
}), t.fillStyle = n;
|
|
2230
|
-
} else e.backgroundOptions.color && (t.fillStyle = e.backgroundOptions.color);
|
|
2231
|
-
|
|
2232
|
-
t.fillRect(0, 0, this._canvas.width, this._canvas.height);
|
|
2233
|
-
}
|
|
2234
|
-
}, t.prototype.drawDots = function (t) {
|
|
2235
|
-
var e = this;
|
|
2236
|
-
if (!this._qr) throw "QR code is not defined";
|
|
2237
|
-
var r = this.context;
|
|
2238
|
-
if (!r) throw "QR code is not defined";
|
|
2239
|
-
|
|
2240
|
-
var n = this._options,
|
|
2241
|
-
o = this._qr.getModuleCount();
|
|
2242
|
-
|
|
2243
|
-
if (o > n.width || o > n.height) throw "The canvas is too small.";
|
|
2244
|
-
var i = Math.min(n.width, n.height) - 2 * n.margin,
|
|
2245
|
-
a = Math.floor(i / o),
|
|
2246
|
-
s = Math.floor((n.width - o * a) / 2),
|
|
2247
|
-
u = Math.floor((n.height - o * a) / 2),
|
|
2248
|
-
c = new y({
|
|
2249
|
-
context: r,
|
|
2250
|
-
type: n.dotsOptions.type
|
|
2251
|
-
});
|
|
2252
|
-
r.beginPath();
|
|
2253
|
-
|
|
2254
|
-
for (var h = function h(r) {
|
|
2255
|
-
for (var n = function n(_n2) {
|
|
2256
|
-
return t && !t(r, _n2) ? "continue" : d._qr.isDark(r, _n2) ? void c.draw(s + r * a, u + _n2 * a, a, function (i, a) {
|
|
2257
|
-
return !(r + i < 0 || _n2 + a < 0 || r + i >= o || _n2 + a >= o) && !(t && !t(r + i, _n2 + a)) && !!e._qr && e._qr.isDark(r + i, _n2 + a);
|
|
2258
|
-
}) : "continue";
|
|
2259
|
-
}, i = 0; i < o; i++) {
|
|
2260
|
-
n(i);
|
|
2261
|
-
}
|
|
2262
|
-
}, d = this, l = 0; l < o; l++) {
|
|
2263
|
-
h(l);
|
|
2264
|
-
}
|
|
2265
|
-
|
|
2266
|
-
if (n.dotsOptions.gradient) {
|
|
2267
|
-
var f = n.dotsOptions.gradient,
|
|
2268
|
-
p = this._createGradient({
|
|
2269
|
-
context: r,
|
|
2270
|
-
options: f,
|
|
2271
|
-
additionalRotation: 0,
|
|
2272
|
-
x: s,
|
|
2273
|
-
y: u,
|
|
2274
|
-
size: o * a
|
|
2275
|
-
});
|
|
2276
|
-
|
|
2277
|
-
f.colorStops.forEach(function (t) {
|
|
2278
|
-
var e = t.offset,
|
|
2279
|
-
r = t.color;
|
|
2280
|
-
p.addColorStop(e, r);
|
|
2281
|
-
}), r.fillStyle = r.strokeStyle = p;
|
|
2282
|
-
} else n.dotsOptions.color && (r.fillStyle = r.strokeStyle = n.dotsOptions.color);
|
|
2283
|
-
|
|
2284
|
-
r.fill("evenodd");
|
|
2285
|
-
}, t.prototype.drawCorners = function (t) {
|
|
2286
|
-
var e = this;
|
|
2287
|
-
if (!this._qr) throw "QR code is not defined";
|
|
2288
|
-
var r = this.context;
|
|
2289
|
-
if (!r) throw "QR code is not defined";
|
|
2290
|
-
|
|
2291
|
-
var n = this._options,
|
|
2292
|
-
o = this._qr.getModuleCount(),
|
|
2293
|
-
i = Math.min(n.width, n.height) - 2 * n.margin,
|
|
2294
|
-
a = Math.floor(i / o),
|
|
2295
|
-
s = 7 * a,
|
|
2296
|
-
u = 3 * a,
|
|
2297
|
-
c = Math.floor((n.width - o * a) / 2),
|
|
2298
|
-
h = Math.floor((n.height - o * a) / 2);
|
|
2299
|
-
|
|
2300
|
-
[[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function (i) {
|
|
2301
|
-
var d,
|
|
2302
|
-
l,
|
|
2303
|
-
f,
|
|
2304
|
-
p,
|
|
2305
|
-
g,
|
|
2306
|
-
v,
|
|
2307
|
-
w,
|
|
2308
|
-
_,
|
|
2309
|
-
m,
|
|
2310
|
-
x,
|
|
2311
|
-
M = i[0],
|
|
2312
|
-
C = i[1],
|
|
2313
|
-
z = i[2];
|
|
2314
|
-
|
|
2315
|
-
if (!t || t(M, C)) {
|
|
2316
|
-
var D = c + M * a * (o - 7),
|
|
2317
|
-
I = h + C * a * (o - 7);
|
|
2318
|
-
|
|
2319
|
-
if (null === (d = n.cornersSquareOptions) || void 0 === d ? void 0 : d.type) {
|
|
2320
|
-
var A = new b({
|
|
2321
|
-
context: r,
|
|
2322
|
-
type: null === (l = n.cornersSquareOptions) || void 0 === l ? void 0 : l.type
|
|
2323
|
-
});
|
|
2324
|
-
r.beginPath(), A.draw(D, I, s, z);
|
|
2325
|
-
} else {
|
|
2326
|
-
var k = new y({
|
|
2327
|
-
context: r,
|
|
2328
|
-
type: n.dotsOptions.type
|
|
2329
|
-
});
|
|
2330
|
-
r.beginPath();
|
|
2331
|
-
|
|
2332
|
-
for (var q = function q(t) {
|
|
2333
|
-
for (var e = function e(_e2) {
|
|
2334
|
-
if (!(null === (f = P[t]) || void 0 === f ? void 0 : f[_e2])) return "continue";
|
|
2335
|
-
k.draw(D + t * a, I + _e2 * a, a, function (r, n) {
|
|
2336
|
-
var o;
|
|
2337
|
-
return !!(null === (o = P[t + r]) || void 0 === o ? void 0 : o[_e2 + n]);
|
|
2338
|
-
});
|
|
2339
|
-
}, r = 0; r < P[t].length; r++) {
|
|
2340
|
-
e(r);
|
|
2341
|
-
}
|
|
2342
|
-
}, R = 0; R < P.length; R++) {
|
|
2343
|
-
q(R);
|
|
2344
|
-
}
|
|
2345
|
-
}
|
|
2346
|
-
|
|
2347
|
-
if (null === (p = n.cornersSquareOptions) || void 0 === p ? void 0 : p.gradient) {
|
|
2348
|
-
var B = n.cornersSquareOptions.gradient,
|
|
2349
|
-
E = e._createGradient({
|
|
2350
|
-
context: r,
|
|
2351
|
-
options: B,
|
|
2352
|
-
additionalRotation: z,
|
|
2353
|
-
x: D,
|
|
2354
|
-
y: I,
|
|
2355
|
-
size: s
|
|
2356
|
-
});
|
|
2357
|
-
|
|
2358
|
-
B.colorStops.forEach(function (t) {
|
|
2359
|
-
var e = t.offset,
|
|
2360
|
-
r = t.color;
|
|
2361
|
-
E.addColorStop(e, r);
|
|
2362
|
-
}), r.fillStyle = r.strokeStyle = E;
|
|
2363
|
-
} else (null === (g = n.cornersSquareOptions) || void 0 === g ? void 0 : g.color) && (r.fillStyle = r.strokeStyle = n.cornersSquareOptions.color);
|
|
2364
|
-
|
|
2365
|
-
if (r.fill("evenodd"), null === (v = n.cornersDotOptions) || void 0 === v ? void 0 : v.type) {
|
|
2366
|
-
var L = new S({
|
|
2367
|
-
context: r,
|
|
2368
|
-
type: null === (w = n.cornersDotOptions) || void 0 === w ? void 0 : w.type
|
|
2369
|
-
});
|
|
2370
|
-
r.beginPath(), L.draw(D + 2 * a, I + 2 * a, u, z);
|
|
2371
|
-
} else {
|
|
2372
|
-
k = new y({
|
|
2373
|
-
context: r,
|
|
2374
|
-
type: n.dotsOptions.type
|
|
2375
|
-
}), r.beginPath();
|
|
2376
|
-
|
|
2377
|
-
var N = function N(t) {
|
|
2378
|
-
for (var e = function e(_e3) {
|
|
2379
|
-
if (!(null === (_ = O[t]) || void 0 === _ ? void 0 : _[_e3])) return "continue";
|
|
2380
|
-
k.draw(D + t * a, I + _e3 * a, a, function (r, n) {
|
|
2381
|
-
var o;
|
|
2382
|
-
return !!(null === (o = O[t + r]) || void 0 === o ? void 0 : o[_e3 + n]);
|
|
2383
|
-
});
|
|
2384
|
-
}, r = 0; r < O[t].length; r++) {
|
|
2385
|
-
e(r);
|
|
2386
|
-
}
|
|
2387
|
-
};
|
|
2388
|
-
|
|
2389
|
-
for (R = 0; R < O.length; R++) {
|
|
2390
|
-
N(R);
|
|
2391
|
-
}
|
|
2392
|
-
}
|
|
2393
|
-
|
|
2394
|
-
if (null === (m = n.cornersDotOptions) || void 0 === m ? void 0 : m.gradient) {
|
|
2395
|
-
B = n.cornersDotOptions.gradient;
|
|
2396
|
-
|
|
2397
|
-
var T = e._createGradient({
|
|
2398
|
-
context: r,
|
|
2399
|
-
options: B,
|
|
2400
|
-
additionalRotation: z,
|
|
2401
|
-
x: D + 2 * a,
|
|
2402
|
-
y: I + 2 * a,
|
|
2403
|
-
size: u
|
|
2404
|
-
});
|
|
2405
|
-
|
|
2406
|
-
B.colorStops.forEach(function (t) {
|
|
2407
|
-
var e = t.offset,
|
|
2408
|
-
r = t.color;
|
|
2409
|
-
T.addColorStop(e, r);
|
|
2410
|
-
}), r.fillStyle = r.strokeStyle = T;
|
|
2411
|
-
} else (null === (x = n.cornersDotOptions) || void 0 === x ? void 0 : x.color) && (r.fillStyle = r.strokeStyle = n.cornersDotOptions.color);
|
|
2412
|
-
|
|
2413
|
-
r.fill("evenodd");
|
|
2414
|
-
}
|
|
2415
|
-
});
|
|
2416
|
-
}, t.prototype.loadImage = function () {
|
|
2417
|
-
var t = this;
|
|
2418
|
-
return new Promise(function (e, r) {
|
|
2419
|
-
var n = t._options,
|
|
2420
|
-
o = new Image();
|
|
2421
|
-
if (!n.image) return r("Image is not defined");
|
|
2422
|
-
"string" == typeof n.imageOptions.crossOrigin && (o.crossOrigin = n.imageOptions.crossOrigin), t._image = o, o.onload = function () {
|
|
2423
|
-
e();
|
|
2424
|
-
}, o.src = n.image;
|
|
2425
|
-
});
|
|
2426
|
-
}, t.prototype.drawImage = function (t) {
|
|
2427
|
-
var e = t.width,
|
|
2428
|
-
r = t.height,
|
|
2429
|
-
n = t.count,
|
|
2430
|
-
o = t.dotSize,
|
|
2431
|
-
i = this.context;
|
|
2432
|
-
if (!i) throw "canvasContext is not defined";
|
|
2433
|
-
if (!this._image) throw "image is not defined";
|
|
2434
|
-
var a = this._options,
|
|
2435
|
-
s = Math.floor((a.width - n * o) / 2),
|
|
2436
|
-
u = Math.floor((a.height - n * o) / 2),
|
|
2437
|
-
c = s + a.imageOptions.margin + (n * o - e) / 2,
|
|
2438
|
-
h = u + a.imageOptions.margin + (n * o - r) / 2,
|
|
2439
|
-
d = e - 2 * a.imageOptions.margin,
|
|
2440
|
-
l = r - 2 * a.imageOptions.margin;
|
|
2441
|
-
i.drawImage(this._image, c, h, d < 0 ? 0 : d, l < 0 ? 0 : l);
|
|
2442
|
-
}, t.prototype._createGradient = function (t) {
|
|
2443
|
-
var e,
|
|
2444
|
-
r = t.context,
|
|
2445
|
-
n = t.options,
|
|
2446
|
-
o = t.additionalRotation,
|
|
2447
|
-
i = t.x,
|
|
2448
|
-
a = t.y,
|
|
2449
|
-
s = t.size;
|
|
2450
|
-
if (n.type === C) e = r.createRadialGradient(i + s / 2, a + s / 2, 0, i + s / 2, a + s / 2, s / 2);else {
|
|
2451
|
-
var u = ((n.rotation || 0) + o) % (2 * Math.PI),
|
|
2452
|
-
c = (u + 2 * Math.PI) % (2 * Math.PI),
|
|
2453
|
-
h = i + s / 2,
|
|
2454
|
-
d = a + s / 2,
|
|
2455
|
-
l = i + s / 2,
|
|
2456
|
-
f = a + s / 2;
|
|
2457
|
-
c >= 0 && c <= .25 * Math.PI || c > 1.75 * Math.PI && c <= 2 * Math.PI ? (h -= s / 2, d -= s / 2 * Math.tan(u), l += s / 2, f += s / 2 * Math.tan(u)) : c > .25 * Math.PI && c <= .75 * Math.PI ? (d -= s / 2, h -= s / 2 / Math.tan(u), f += s / 2, l += s / 2 / Math.tan(u)) : c > .75 * Math.PI && c <= 1.25 * Math.PI ? (h += s / 2, d += s / 2 * Math.tan(u), l -= s / 2, f -= s / 2 * Math.tan(u)) : c > 1.25 * Math.PI && c <= 1.75 * Math.PI && (d += s / 2, h += s / 2 / Math.tan(u), f -= s / 2, l -= s / 2 / Math.tan(u)), e = r.createLinearGradient(Math.round(h), Math.round(d), Math.round(l), Math.round(f));
|
|
2458
|
-
}
|
|
2459
|
-
return e;
|
|
2460
|
-
}, t;
|
|
2461
|
-
}();
|
|
2462
|
-
|
|
2463
|
-
var _D = function D() {
|
|
2464
|
-
return (_D = Object.assign || function (t) {
|
|
2465
|
-
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
2466
|
-
for (var o in e = arguments[r]) {
|
|
2467
|
-
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
2468
|
-
}
|
|
2469
|
-
}
|
|
2470
|
-
|
|
2471
|
-
return t;
|
|
2472
|
-
}).apply(this, arguments);
|
|
2473
|
-
};
|
|
2474
|
-
|
|
2475
|
-
var I = function () {
|
|
2476
|
-
function t(t) {
|
|
2477
|
-
var e = t.svg,
|
|
2478
|
-
r = t.type;
|
|
2479
|
-
this._svg = e, this._type = r;
|
|
2480
|
-
}
|
|
2481
|
-
|
|
2482
|
-
return t.prototype.draw = function (t, e, r, n) {
|
|
2483
|
-
var o;
|
|
2484
|
-
|
|
2485
|
-
switch (this._type) {
|
|
2486
|
-
case h:
|
|
2487
|
-
o = this._drawDot;
|
|
2488
|
-
break;
|
|
2489
|
-
|
|
2490
|
-
case l:
|
|
2491
|
-
o = this._drawClassy;
|
|
2492
|
-
break;
|
|
2493
|
-
|
|
2494
|
-
case f:
|
|
2495
|
-
o = this._drawClassyRounded;
|
|
2496
|
-
break;
|
|
2497
|
-
|
|
2498
|
-
case d:
|
|
2499
|
-
o = this._drawRounded;
|
|
2500
|
-
break;
|
|
2501
|
-
|
|
2502
|
-
case g:
|
|
2503
|
-
o = this._drawExtraRounded;
|
|
2504
|
-
break;
|
|
2505
|
-
|
|
2506
|
-
case p:
|
|
2507
|
-
default:
|
|
2508
|
-
o = this._drawSquare;
|
|
2509
|
-
}
|
|
2510
|
-
|
|
2511
|
-
o.call(this, {
|
|
2512
|
-
x: t,
|
|
2513
|
-
y: e,
|
|
2514
|
-
size: r,
|
|
2515
|
-
getNeighbor: n
|
|
2516
|
-
});
|
|
2517
|
-
}, t.prototype._rotateFigure = function (t) {
|
|
2518
|
-
var e,
|
|
2519
|
-
r = t.x,
|
|
2520
|
-
n = t.y,
|
|
2521
|
-
o = t.size,
|
|
2522
|
-
i = t.rotation,
|
|
2523
|
-
a = void 0 === i ? 0 : i,
|
|
2524
|
-
s = r + o / 2,
|
|
2525
|
-
u = n + o / 2;
|
|
2526
|
-
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
2527
|
-
}, t.prototype._basicDot = function (t) {
|
|
2528
|
-
var e = this,
|
|
2529
|
-
r = t.size,
|
|
2530
|
-
n = t.x,
|
|
2531
|
-
o = t.y;
|
|
2532
|
-
|
|
2533
|
-
this._rotateFigure(_D(_D({}, t), {
|
|
2534
|
-
draw: function draw() {
|
|
2535
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "circle"), e._element.setAttribute("cx", String(n + r / 2)), e._element.setAttribute("cy", String(o + r / 2)), e._element.setAttribute("r", String(r / 2));
|
|
2536
|
-
}
|
|
2537
|
-
}));
|
|
2538
|
-
}, t.prototype._basicSquare = function (t) {
|
|
2539
|
-
var e = this,
|
|
2540
|
-
r = t.size,
|
|
2541
|
-
n = t.x,
|
|
2542
|
-
o = t.y;
|
|
2543
|
-
|
|
2544
|
-
this._rotateFigure(_D(_D({}, t), {
|
|
2545
|
-
draw: function draw() {
|
|
2546
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "rect"), e._element.setAttribute("x", String(n)), e._element.setAttribute("y", String(o)), e._element.setAttribute("width", String(r)), e._element.setAttribute("height", String(r));
|
|
2547
|
-
}
|
|
2548
|
-
}));
|
|
2549
|
-
}, t.prototype._basicSideRounded = function (t) {
|
|
2550
|
-
var e = this,
|
|
2551
|
-
r = t.size,
|
|
2552
|
-
n = t.x,
|
|
2553
|
-
o = t.y;
|
|
2554
|
-
|
|
2555
|
-
this._rotateFigure(_D(_D({}, t), {
|
|
2556
|
-
draw: function draw() {
|
|
2557
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, 0 " + -r);
|
|
2558
|
-
}
|
|
2559
|
-
}));
|
|
2560
|
-
}, t.prototype._basicCornerRounded = function (t) {
|
|
2561
|
-
var e = this,
|
|
2562
|
-
r = t.size,
|
|
2563
|
-
n = t.x,
|
|
2564
|
-
o = t.y;
|
|
2565
|
-
|
|
2566
|
-
this._rotateFigure(_D(_D({}, t), {
|
|
2567
|
-
draw: function draw() {
|
|
2568
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "v " + -r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + -r / 2 + " " + -r / 2);
|
|
2569
|
-
}
|
|
2570
|
-
}));
|
|
2571
|
-
}, t.prototype._basicCornerExtraRounded = function (t) {
|
|
2572
|
-
var e = this,
|
|
2573
|
-
r = t.size,
|
|
2574
|
-
n = t.x,
|
|
2575
|
-
o = t.y;
|
|
2576
|
-
|
|
2577
|
-
this._rotateFigure(_D(_D({}, t), {
|
|
2578
|
-
draw: function draw() {
|
|
2579
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "a " + r + " " + r + ", 0, 0, 0, " + -r + " " + -r);
|
|
2580
|
-
}
|
|
2581
|
-
}));
|
|
2582
|
-
}, t.prototype._basicCornersRounded = function (t) {
|
|
2583
|
-
var e = this,
|
|
2584
|
-
r = t.size,
|
|
2585
|
-
n = t.x,
|
|
2586
|
-
o = t.y;
|
|
2587
|
-
|
|
2588
|
-
this._rotateFigure(_D(_D({}, t), {
|
|
2589
|
-
draw: function draw() {
|
|
2590
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + r / 2 + " " + r / 2 + "h " + r / 2 + "v " + -r / 2 + "a " + r / 2 + " " + r / 2 + ", 0, 0, 0, " + -r / 2 + " " + -r / 2);
|
|
2591
|
-
}
|
|
2592
|
-
}));
|
|
2593
|
-
}, t.prototype._drawDot = function (t) {
|
|
2594
|
-
var e = t.x,
|
|
2595
|
-
r = t.y,
|
|
2596
|
-
n = t.size;
|
|
2597
|
-
|
|
2598
|
-
this._basicDot({
|
|
2599
|
-
x: e,
|
|
2600
|
-
y: r,
|
|
2601
|
-
size: n,
|
|
2602
|
-
rotation: 0
|
|
2603
|
-
});
|
|
2604
|
-
}, t.prototype._drawSquare = function (t) {
|
|
2605
|
-
var e = t.x,
|
|
2606
|
-
r = t.y,
|
|
2607
|
-
n = t.size;
|
|
2608
|
-
|
|
2609
|
-
this._basicSquare({
|
|
2610
|
-
x: e,
|
|
2611
|
-
y: r,
|
|
2612
|
-
size: n,
|
|
2613
|
-
rotation: 0
|
|
2614
|
-
});
|
|
2615
|
-
}, t.prototype._drawRounded = function (t) {
|
|
2616
|
-
var e = t.x,
|
|
2617
|
-
r = t.y,
|
|
2618
|
-
n = t.size,
|
|
2619
|
-
o = t.getNeighbor,
|
|
2620
|
-
i = o ? +o(-1, 0) : 0,
|
|
2621
|
-
a = o ? +o(1, 0) : 0,
|
|
2622
|
-
s = o ? +o(0, -1) : 0,
|
|
2623
|
-
u = o ? +o(0, 1) : 0,
|
|
2624
|
-
c = i + a + s + u;
|
|
2625
|
-
if (0 !== c) {
|
|
2626
|
-
if (c > 2 || i && a || s && u) this._basicSquare({
|
|
2627
|
-
x: e,
|
|
2628
|
-
y: r,
|
|
2629
|
-
size: n,
|
|
2630
|
-
rotation: 0
|
|
2631
|
-
});else {
|
|
2632
|
-
if (2 === c) {
|
|
2633
|
-
var h = 0;
|
|
2634
|
-
return i && s ? h = Math.PI / 2 : s && a ? h = Math.PI : a && u && (h = -Math.PI / 2), void this._basicCornerRounded({
|
|
2635
|
-
x: e,
|
|
2636
|
-
y: r,
|
|
2637
|
-
size: n,
|
|
2638
|
-
rotation: h
|
|
2639
|
-
});
|
|
2640
|
-
}
|
|
2641
|
-
|
|
2642
|
-
if (1 === c) return h = 0, s ? h = Math.PI / 2 : a ? h = Math.PI : u && (h = -Math.PI / 2), void this._basicSideRounded({
|
|
2643
|
-
x: e,
|
|
2644
|
-
y: r,
|
|
2645
|
-
size: n,
|
|
2646
|
-
rotation: h
|
|
2647
|
-
});
|
|
2648
|
-
}
|
|
2649
|
-
} else this._basicDot({
|
|
2650
|
-
x: e,
|
|
2651
|
-
y: r,
|
|
2652
|
-
size: n,
|
|
2653
|
-
rotation: 0
|
|
2654
|
-
});
|
|
2655
|
-
}, t.prototype._drawExtraRounded = function (t) {
|
|
2656
|
-
var e = t.x,
|
|
2657
|
-
r = t.y,
|
|
2658
|
-
n = t.size,
|
|
2659
|
-
o = t.getNeighbor,
|
|
2660
|
-
i = o ? +o(-1, 0) : 0,
|
|
2661
|
-
a = o ? +o(1, 0) : 0,
|
|
2662
|
-
s = o ? +o(0, -1) : 0,
|
|
2663
|
-
u = o ? +o(0, 1) : 0,
|
|
2664
|
-
c = i + a + s + u;
|
|
2665
|
-
if (0 !== c) {
|
|
2666
|
-
if (c > 2 || i && a || s && u) this._basicSquare({
|
|
2667
|
-
x: e,
|
|
2668
|
-
y: r,
|
|
2669
|
-
size: n,
|
|
2670
|
-
rotation: 0
|
|
2671
|
-
});else {
|
|
2672
|
-
if (2 === c) {
|
|
2673
|
-
var h = 0;
|
|
2674
|
-
return i && s ? h = Math.PI / 2 : s && a ? h = Math.PI : a && u && (h = -Math.PI / 2), void this._basicCornerExtraRounded({
|
|
2675
|
-
x: e,
|
|
2676
|
-
y: r,
|
|
2677
|
-
size: n,
|
|
2678
|
-
rotation: h
|
|
2679
|
-
});
|
|
2680
|
-
}
|
|
2681
|
-
|
|
2682
|
-
if (1 === c) return h = 0, s ? h = Math.PI / 2 : a ? h = Math.PI : u && (h = -Math.PI / 2), void this._basicSideRounded({
|
|
2683
|
-
x: e,
|
|
2684
|
-
y: r,
|
|
2685
|
-
size: n,
|
|
2686
|
-
rotation: h
|
|
2687
|
-
});
|
|
2688
|
-
}
|
|
2689
|
-
} else this._basicDot({
|
|
2690
|
-
x: e,
|
|
2691
|
-
y: r,
|
|
2692
|
-
size: n,
|
|
2693
|
-
rotation: 0
|
|
2694
|
-
});
|
|
2695
|
-
}, t.prototype._drawClassy = function (t) {
|
|
2696
|
-
var e = t.x,
|
|
2697
|
-
r = t.y,
|
|
2698
|
-
n = t.size,
|
|
2699
|
-
o = t.getNeighbor,
|
|
2700
|
-
i = o ? +o(-1, 0) : 0,
|
|
2701
|
-
a = o ? +o(1, 0) : 0,
|
|
2702
|
-
s = o ? +o(0, -1) : 0,
|
|
2703
|
-
u = o ? +o(0, 1) : 0;
|
|
2704
|
-
0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
|
|
2705
|
-
x: e,
|
|
2706
|
-
y: r,
|
|
2707
|
-
size: n,
|
|
2708
|
-
rotation: 0
|
|
2709
|
-
}) : this._basicCornerRounded({
|
|
2710
|
-
x: e,
|
|
2711
|
-
y: r,
|
|
2712
|
-
size: n,
|
|
2713
|
-
rotation: Math.PI / 2
|
|
2714
|
-
}) : this._basicCornerRounded({
|
|
2715
|
-
x: e,
|
|
2716
|
-
y: r,
|
|
2717
|
-
size: n,
|
|
2718
|
-
rotation: -Math.PI / 2
|
|
2719
|
-
}) : this._basicCornersRounded({
|
|
2720
|
-
x: e,
|
|
2721
|
-
y: r,
|
|
2722
|
-
size: n,
|
|
2723
|
-
rotation: Math.PI / 2
|
|
2724
|
-
});
|
|
2725
|
-
}, t.prototype._drawClassyRounded = function (t) {
|
|
2726
|
-
var e = t.x,
|
|
2727
|
-
r = t.y,
|
|
2728
|
-
n = t.size,
|
|
2729
|
-
o = t.getNeighbor,
|
|
2730
|
-
i = o ? +o(-1, 0) : 0,
|
|
2731
|
-
a = o ? +o(1, 0) : 0,
|
|
2732
|
-
s = o ? +o(0, -1) : 0,
|
|
2733
|
-
u = o ? +o(0, 1) : 0;
|
|
2734
|
-
0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
|
|
2735
|
-
x: e,
|
|
2736
|
-
y: r,
|
|
2737
|
-
size: n,
|
|
2738
|
-
rotation: 0
|
|
2739
|
-
}) : this._basicCornerExtraRounded({
|
|
2740
|
-
x: e,
|
|
2741
|
-
y: r,
|
|
2742
|
-
size: n,
|
|
2743
|
-
rotation: Math.PI / 2
|
|
2744
|
-
}) : this._basicCornerExtraRounded({
|
|
2745
|
-
x: e,
|
|
2746
|
-
y: r,
|
|
2747
|
-
size: n,
|
|
2748
|
-
rotation: -Math.PI / 2
|
|
2749
|
-
}) : this._basicCornersRounded({
|
|
2750
|
-
x: e,
|
|
2751
|
-
y: r,
|
|
2752
|
-
size: n,
|
|
2753
|
-
rotation: Math.PI / 2
|
|
2754
|
-
});
|
|
2755
|
-
}, t;
|
|
2756
|
-
}();
|
|
2757
|
-
|
|
2758
|
-
var _A = function A() {
|
|
2759
|
-
return (_A = Object.assign || function (t) {
|
|
2760
|
-
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
2761
|
-
for (var o in e = arguments[r]) {
|
|
2762
|
-
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
2763
|
-
}
|
|
2764
|
-
}
|
|
2765
|
-
|
|
2766
|
-
return t;
|
|
2767
|
-
}).apply(this, arguments);
|
|
2768
|
-
};
|
|
2769
|
-
|
|
2770
|
-
var k = function () {
|
|
2771
|
-
function t(t) {
|
|
2772
|
-
var e = t.svg,
|
|
2773
|
-
r = t.type;
|
|
2774
|
-
this._svg = e, this._type = r;
|
|
2775
|
-
}
|
|
2776
|
-
|
|
2777
|
-
return t.prototype.draw = function (t, e, r, n) {
|
|
2778
|
-
var o;
|
|
2779
|
-
|
|
2780
|
-
switch (this._type) {
|
|
2781
|
-
case w:
|
|
2782
|
-
o = this._drawSquare;
|
|
2783
|
-
break;
|
|
2784
|
-
|
|
2785
|
-
case _:
|
|
2786
|
-
o = this._drawExtraRounded;
|
|
2787
|
-
break;
|
|
2788
|
-
|
|
2789
|
-
case "dot":
|
|
2790
|
-
default:
|
|
2791
|
-
o = this._drawDot;
|
|
2150
|
+
function u(t) {
|
|
2151
|
+
var e;
|
|
2152
|
+
t.done ? o(t.value) : (e = t.value, e instanceof r ? e : new r(function (t) {
|
|
2153
|
+
t(e);
|
|
2154
|
+
})).then(a, s);
|
|
2792
2155
|
}
|
|
2793
2156
|
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
}
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
draw: function draw() {
|
|
2819
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + (n + r / 2) + " " + o + "a " + r / 2 + " " + r / 2 + " 0 1 0 0.1 0zm 0 " + i + "a " + (r / 2 - i) + " " + (r / 2 - i) + " 0 1 1 -0.1 0Z");
|
|
2820
|
-
}
|
|
2821
|
-
}));
|
|
2822
|
-
}, t.prototype._basicSquare = function (t) {
|
|
2823
|
-
var e = this,
|
|
2824
|
-
r = t.size,
|
|
2825
|
-
n = t.x,
|
|
2826
|
-
o = t.y,
|
|
2827
|
-
i = r / 7;
|
|
2828
|
-
|
|
2829
|
-
this._rotateFigure(_A(_A({}, t), {
|
|
2830
|
-
draw: function draw() {
|
|
2831
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + n + " " + o + "v " + r + "h " + r + "v " + -r + "zM " + (n + i) + " " + (o + i) + "h " + (r - 2 * i) + "v " + (r - 2 * i) + "h " + (2 * i - r) + "z");
|
|
2832
|
-
}
|
|
2833
|
-
}));
|
|
2834
|
-
}, t.prototype._basicExtraRounded = function (t) {
|
|
2835
|
-
var e = this,
|
|
2836
|
-
r = t.size,
|
|
2837
|
-
n = t.x,
|
|
2838
|
-
o = t.y,
|
|
2839
|
-
i = r / 7;
|
|
2840
|
-
|
|
2841
|
-
this._rotateFigure(_A(_A({}, t), {
|
|
2842
|
-
draw: function draw() {
|
|
2843
|
-
e._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e._element.setAttribute("clip-rule", "evenodd"), e._element.setAttribute("d", "M " + n + " " + (o + 2.5 * i) + "v " + 2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * i + " " + 2.5 * i + "h " + 2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * i + " " + 2.5 * -i + "v " + -2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * -i + " " + 2.5 * -i + "h " + -2 * i + "a " + 2.5 * i + " " + 2.5 * i + ", 0, 0, 0, " + 2.5 * -i + " " + 2.5 * i + "M " + (n + 2.5 * i) + " " + (o + i) + "h " + 2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * i + " " + 1.5 * i + "v " + 2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * -i + " " + 1.5 * i + "h " + -2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * -i + " " + 1.5 * -i + "v " + -2 * i + "a " + 1.5 * i + " " + 1.5 * i + ", 0, 0, 1, " + 1.5 * i + " " + 1.5 * -i);
|
|
2844
|
-
}
|
|
2845
|
-
}));
|
|
2846
|
-
}, t.prototype._drawDot = function (t) {
|
|
2847
|
-
var e = t.x,
|
|
2848
|
-
r = t.y,
|
|
2849
|
-
n = t.size,
|
|
2850
|
-
o = t.rotation;
|
|
2851
|
-
|
|
2852
|
-
this._basicDot({
|
|
2853
|
-
x: e,
|
|
2854
|
-
y: r,
|
|
2855
|
-
size: n,
|
|
2856
|
-
rotation: o
|
|
2857
|
-
});
|
|
2858
|
-
}, t.prototype._drawSquare = function (t) {
|
|
2859
|
-
var e = t.x,
|
|
2860
|
-
r = t.y,
|
|
2861
|
-
n = t.size,
|
|
2862
|
-
o = t.rotation;
|
|
2863
|
-
|
|
2864
|
-
this._basicSquare({
|
|
2865
|
-
x: e,
|
|
2866
|
-
y: r,
|
|
2867
|
-
size: n,
|
|
2868
|
-
rotation: o
|
|
2869
|
-
});
|
|
2870
|
-
}, t.prototype._drawExtraRounded = function (t) {
|
|
2871
|
-
var e = t.x,
|
|
2872
|
-
r = t.y,
|
|
2873
|
-
n = t.size,
|
|
2874
|
-
o = t.rotation;
|
|
2157
|
+
u((n = n.apply(t, e || [])).next());
|
|
2158
|
+
});
|
|
2159
|
+
},
|
|
2160
|
+
y = function y(t, e) {
|
|
2161
|
+
var r,
|
|
2162
|
+
n,
|
|
2163
|
+
o,
|
|
2164
|
+
i,
|
|
2165
|
+
a = {
|
|
2166
|
+
label: 0,
|
|
2167
|
+
sent: function sent() {
|
|
2168
|
+
if (1 & o[0]) throw o[1];
|
|
2169
|
+
return o[1];
|
|
2170
|
+
},
|
|
2171
|
+
trys: [],
|
|
2172
|
+
ops: []
|
|
2173
|
+
};
|
|
2174
|
+
return i = {
|
|
2175
|
+
next: s(0),
|
|
2176
|
+
"throw": s(1),
|
|
2177
|
+
"return": s(2)
|
|
2178
|
+
}, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
|
|
2179
|
+
return this;
|
|
2180
|
+
}), i;
|
|
2875
2181
|
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
rotation: o
|
|
2881
|
-
});
|
|
2882
|
-
}, t;
|
|
2883
|
-
}();
|
|
2182
|
+
function s(i) {
|
|
2183
|
+
return function (s) {
|
|
2184
|
+
return function (i) {
|
|
2185
|
+
if (r) throw new TypeError("Generator is already executing.");
|
|
2884
2186
|
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
for (var o in e = arguments[r]) {
|
|
2889
|
-
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
2890
|
-
}
|
|
2891
|
-
}
|
|
2187
|
+
for (; a;) {
|
|
2188
|
+
try {
|
|
2189
|
+
if (r = 1, n && (o = 2 & i[0] ? n["return"] : i[0] ? n["throw"] || ((o = n["return"]) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o;
|
|
2892
2190
|
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2191
|
+
switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
|
|
2192
|
+
case 0:
|
|
2193
|
+
case 1:
|
|
2194
|
+
o = i;
|
|
2195
|
+
break;
|
|
2896
2196
|
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
}
|
|
2197
|
+
case 4:
|
|
2198
|
+
return a.label++, {
|
|
2199
|
+
value: i[1],
|
|
2200
|
+
done: !1
|
|
2201
|
+
};
|
|
2903
2202
|
|
|
2904
|
-
|
|
2905
|
-
|
|
2203
|
+
case 5:
|
|
2204
|
+
a.label++, n = i[1], i = [0];
|
|
2205
|
+
continue;
|
|
2906
2206
|
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
break;
|
|
2207
|
+
case 7:
|
|
2208
|
+
i = a.ops.pop(), a.trys.pop();
|
|
2209
|
+
continue;
|
|
2911
2210
|
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2211
|
+
default:
|
|
2212
|
+
if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
|
|
2213
|
+
a = 0;
|
|
2214
|
+
continue;
|
|
2215
|
+
}
|
|
2916
2216
|
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
rotation: n
|
|
2922
|
-
});
|
|
2923
|
-
}, t.prototype._rotateFigure = function (t) {
|
|
2924
|
-
var e,
|
|
2925
|
-
r = t.x,
|
|
2926
|
-
n = t.y,
|
|
2927
|
-
o = t.size,
|
|
2928
|
-
i = t.rotation,
|
|
2929
|
-
a = void 0 === i ? 0 : i,
|
|
2930
|
-
s = r + o / 2,
|
|
2931
|
-
u = n + o / 2;
|
|
2932
|
-
(0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
|
|
2933
|
-
}, t.prototype._basicDot = function (t) {
|
|
2934
|
-
var e = this,
|
|
2935
|
-
r = t.size,
|
|
2936
|
-
n = t.x,
|
|
2937
|
-
o = t.y;
|
|
2217
|
+
if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
|
|
2218
|
+
a.label = i[1];
|
|
2219
|
+
break;
|
|
2220
|
+
}
|
|
2938
2221
|
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
}));
|
|
2944
|
-
}, t.prototype._basicSquare = function (t) {
|
|
2945
|
-
var e = this,
|
|
2946
|
-
r = t.size,
|
|
2947
|
-
n = t.x,
|
|
2948
|
-
o = t.y;
|
|
2222
|
+
if (6 === i[0] && a.label < o[1]) {
|
|
2223
|
+
a.label = o[1], o = i;
|
|
2224
|
+
break;
|
|
2225
|
+
}
|
|
2949
2226
|
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
}));
|
|
2955
|
-
}, t.prototype._drawDot = function (t) {
|
|
2956
|
-
var e = t.x,
|
|
2957
|
-
r = t.y,
|
|
2958
|
-
n = t.size,
|
|
2959
|
-
o = t.rotation;
|
|
2227
|
+
if (o && a.label < o[2]) {
|
|
2228
|
+
a.label = o[2], a.ops.push(i);
|
|
2229
|
+
break;
|
|
2230
|
+
}
|
|
2960
2231
|
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
size: n,
|
|
2965
|
-
rotation: o
|
|
2966
|
-
});
|
|
2967
|
-
}, t.prototype._drawSquare = function (t) {
|
|
2968
|
-
var e = t.x,
|
|
2969
|
-
r = t.y,
|
|
2970
|
-
n = t.size,
|
|
2971
|
-
o = t.rotation;
|
|
2232
|
+
o[2] && a.ops.pop(), a.trys.pop();
|
|
2233
|
+
continue;
|
|
2234
|
+
}
|
|
2972
2235
|
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
}();
|
|
2236
|
+
i = e.call(t, a);
|
|
2237
|
+
} catch (t) {
|
|
2238
|
+
i = [6, t], n = 0;
|
|
2239
|
+
} finally {
|
|
2240
|
+
r = o = 0;
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2981
2243
|
|
|
2982
|
-
|
|
2983
|
-
|
|
2244
|
+
if (5 & i[0]) throw i[1];
|
|
2245
|
+
return {
|
|
2246
|
+
value: i[0] ? i[1] : void 0,
|
|
2247
|
+
done: !0
|
|
2248
|
+
};
|
|
2249
|
+
}([i, s]);
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
},
|
|
2253
|
+
m = [[1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1]],
|
|
2254
|
+
b = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
|
|
2984
2255
|
|
|
2985
|
-
var
|
|
2256
|
+
var _ = function () {
|
|
2986
2257
|
function t(t) {
|
|
2987
2258
|
this._element = document.createElementNS("http://www.w3.org/2000/svg", "svg"), this._element.setAttribute("width", String(t.width)), this._element.setAttribute("height", String(t.height)), this._defs = document.createElementNS("http://www.w3.org/2000/svg", "defs"), this._element.appendChild(this._defs), this._options = t;
|
|
2988
2259
|
}
|
|
@@ -3001,12 +2272,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3001
2272
|
configurable: !0
|
|
3002
2273
|
}), t.prototype.getElement = function () {
|
|
3003
2274
|
return this._element;
|
|
3004
|
-
}, t.prototype.clear = function () {
|
|
3005
|
-
var t,
|
|
3006
|
-
e = this._element;
|
|
3007
|
-
this._element = e.cloneNode(!1), null === (t = null == e ? void 0 : e.parentNode) || void 0 === t || t.replaceChild(this._element, e), this._defs = document.createElementNS("http://www.w3.org/2000/svg", "defs"), this._element.appendChild(this._defs);
|
|
3008
2275
|
}, t.prototype.drawQR = function (t) {
|
|
3009
|
-
return
|
|
2276
|
+
return w(this, void 0, void 0, function () {
|
|
3010
2277
|
var e,
|
|
3011
2278
|
r,
|
|
3012
2279
|
n,
|
|
@@ -3014,105 +2281,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3014
2281
|
i,
|
|
3015
2282
|
a,
|
|
3016
2283
|
s,
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
l
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
n,
|
|
3023
|
-
o,
|
|
3024
|
-
i,
|
|
3025
|
-
a = {
|
|
3026
|
-
label: 0,
|
|
3027
|
-
sent: function sent() {
|
|
3028
|
-
if (1 & o[0]) throw o[1];
|
|
3029
|
-
return o[1];
|
|
3030
|
-
},
|
|
3031
|
-
trys: [],
|
|
3032
|
-
ops: []
|
|
3033
|
-
};
|
|
3034
|
-
return i = {
|
|
3035
|
-
next: s(0),
|
|
3036
|
-
"throw": s(1),
|
|
3037
|
-
"return": s(2)
|
|
3038
|
-
}, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
|
|
3039
|
-
return this;
|
|
3040
|
-
}), i;
|
|
3041
|
-
|
|
3042
|
-
function s(i) {
|
|
3043
|
-
return function (s) {
|
|
3044
|
-
return function (i) {
|
|
3045
|
-
if (r) throw new TypeError("Generator is already executing.");
|
|
3046
|
-
|
|
3047
|
-
for (; a;) {
|
|
3048
|
-
try {
|
|
3049
|
-
if (r = 1, n && (o = 2 & i[0] ? n["return"] : i[0] ? n["throw"] || ((o = n["return"]) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o;
|
|
3050
|
-
|
|
3051
|
-
switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
|
|
3052
|
-
case 0:
|
|
3053
|
-
case 1:
|
|
3054
|
-
o = i;
|
|
3055
|
-
break;
|
|
3056
|
-
|
|
3057
|
-
case 4:
|
|
3058
|
-
return a.label++, {
|
|
3059
|
-
value: i[1],
|
|
3060
|
-
done: !1
|
|
3061
|
-
};
|
|
3062
|
-
|
|
3063
|
-
case 5:
|
|
3064
|
-
a.label++, n = i[1], i = [0];
|
|
3065
|
-
continue;
|
|
3066
|
-
|
|
3067
|
-
case 7:
|
|
3068
|
-
i = a.ops.pop(), a.trys.pop();
|
|
3069
|
-
continue;
|
|
3070
|
-
|
|
3071
|
-
default:
|
|
3072
|
-
if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
|
|
3073
|
-
a = 0;
|
|
3074
|
-
continue;
|
|
3075
|
-
}
|
|
3076
|
-
|
|
3077
|
-
if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
|
|
3078
|
-
a.label = i[1];
|
|
3079
|
-
break;
|
|
3080
|
-
}
|
|
3081
|
-
|
|
3082
|
-
if (6 === i[0] && a.label < o[1]) {
|
|
3083
|
-
a.label = o[1], o = i;
|
|
3084
|
-
break;
|
|
3085
|
-
}
|
|
3086
|
-
|
|
3087
|
-
if (o && a.label < o[2]) {
|
|
3088
|
-
a.label = o[2], a.ops.push(i);
|
|
3089
|
-
break;
|
|
3090
|
-
}
|
|
3091
|
-
|
|
3092
|
-
o[2] && a.ops.pop(), a.trys.pop();
|
|
3093
|
-
continue;
|
|
3094
|
-
}
|
|
3095
|
-
|
|
3096
|
-
i = e.call(t, a);
|
|
3097
|
-
} catch (t) {
|
|
3098
|
-
i = [6, t], n = 0;
|
|
3099
|
-
} finally {
|
|
3100
|
-
r = o = 0;
|
|
3101
|
-
}
|
|
3102
|
-
}
|
|
3103
|
-
|
|
3104
|
-
if (5 & i[0]) throw i[1];
|
|
3105
|
-
return {
|
|
3106
|
-
value: i[0] ? i[1] : void 0,
|
|
3107
|
-
done: !0
|
|
3108
|
-
};
|
|
3109
|
-
}([i, s]);
|
|
3110
|
-
};
|
|
3111
|
-
}
|
|
3112
|
-
}(this, function (f) {
|
|
2284
|
+
u,
|
|
2285
|
+
c,
|
|
2286
|
+
l,
|
|
2287
|
+
d = this;
|
|
2288
|
+
return y(this, function (f) {
|
|
3113
2289
|
switch (f.label) {
|
|
3114
2290
|
case 0:
|
|
3115
|
-
return e = t.getModuleCount(), r = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n = Math.
|
|
2291
|
+
return e = t.getModuleCount(), r = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n = this._options.shape === v ? r / Math.sqrt(2) : r, o = Math.floor(n / e), i = {
|
|
3116
2292
|
hideXDots: 0,
|
|
3117
2293
|
hideYDots: 0,
|
|
3118
2294
|
width: 0,
|
|
@@ -3121,72 +2297,85 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3121
2297
|
|
|
3122
2298
|
case 1:
|
|
3123
2299
|
if (f.sent(), !this._image) return [2];
|
|
3124
|
-
|
|
2300
|
+
a = this._options, s = a.imageOptions, u = a.qrOptions, c = s.imageSize * h[u.errorCorrectionLevel], l = Math.floor(c * e * e), i = function (t) {
|
|
2301
|
+
var e = t.originalHeight,
|
|
2302
|
+
r = t.originalWidth,
|
|
2303
|
+
n = t.maxHiddenDots,
|
|
2304
|
+
o = t.maxHiddenAxisDots,
|
|
2305
|
+
i = t.dotSize,
|
|
2306
|
+
a = {
|
|
2307
|
+
x: 0,
|
|
2308
|
+
y: 0
|
|
2309
|
+
},
|
|
2310
|
+
s = {
|
|
2311
|
+
x: 0,
|
|
2312
|
+
y: 0
|
|
2313
|
+
};
|
|
2314
|
+
if (e <= 0 || r <= 0 || n <= 0 || i <= 0) return {
|
|
2315
|
+
height: 0,
|
|
2316
|
+
width: 0,
|
|
2317
|
+
hideYDots: 0,
|
|
2318
|
+
hideXDots: 0
|
|
2319
|
+
};
|
|
2320
|
+
var u = e / r;
|
|
2321
|
+
return a.x = Math.floor(Math.sqrt(n / u)), a.x <= 0 && (a.x = 1), o && o < a.x && (a.x = o), a.x % 2 == 0 && a.x--, s.x = a.x * i, a.y = 1 + 2 * Math.ceil((a.x * u - 1) / 2), s.y = Math.round(s.x * u), (a.y * a.x > n || o && o < a.y) && (o && o < a.y ? (a.y = o, a.y % 2 == 0 && a.x--) : a.y -= 2, s.y = a.y * i, a.x = 1 + 2 * Math.ceil((a.y / u - 1) / 2), s.x = Math.round(s.y / u)), {
|
|
2322
|
+
height: s.y,
|
|
2323
|
+
width: s.x,
|
|
2324
|
+
hideYDots: a.y,
|
|
2325
|
+
hideXDots: a.x
|
|
2326
|
+
};
|
|
2327
|
+
}({
|
|
3125
2328
|
originalWidth: this._image.width,
|
|
3126
2329
|
originalHeight: this._image.height,
|
|
3127
|
-
maxHiddenDots:
|
|
2330
|
+
maxHiddenDots: l,
|
|
3128
2331
|
maxHiddenAxisDots: e - 14,
|
|
3129
|
-
dotSize:
|
|
2332
|
+
dotSize: o
|
|
3130
2333
|
}), f.label = 2;
|
|
3131
2334
|
|
|
3132
2335
|
case 2:
|
|
3133
|
-
return this.
|
|
3134
|
-
var n,
|
|
3135
|
-
return !(
|
|
3136
|
-
}), this.drawCorners(), this._options.image
|
|
3137
|
-
width:
|
|
3138
|
-
height:
|
|
2336
|
+
return this.drawBackground(), this.drawDots(function (t, r) {
|
|
2337
|
+
var n, o, a, s, u, h;
|
|
2338
|
+
return !(d._options.imageOptions.hideBackgroundDots && t >= (e - i.hideXDots) / 2 && t < (e + i.hideXDots) / 2 && r >= (e - i.hideYDots) / 2 && r < (e + i.hideYDots) / 2 || (null === (n = m[t]) || void 0 === n ? void 0 : n[r]) || (null === (o = m[t - e + 7]) || void 0 === o ? void 0 : o[r]) || (null === (a = m[t]) || void 0 === a ? void 0 : a[r - e + 7]) || (null === (s = b[t]) || void 0 === s ? void 0 : s[r]) || (null === (u = b[t - e + 7]) || void 0 === u ? void 0 : u[r]) || (null === (h = b[t]) || void 0 === h ? void 0 : h[r - e + 7]));
|
|
2339
|
+
}), this.drawCorners(), this._options.image ? [4, this.drawImage({
|
|
2340
|
+
width: i.width,
|
|
2341
|
+
height: i.height,
|
|
3139
2342
|
count: e,
|
|
3140
|
-
dotSize:
|
|
3141
|
-
}),
|
|
3142
|
-
}
|
|
3143
|
-
});
|
|
3144
|
-
}, new ((n = void 0) || (n = Promise))(function (t, i) {
|
|
3145
|
-
function a(t) {
|
|
3146
|
-
try {
|
|
3147
|
-
u(o.next(t));
|
|
3148
|
-
} catch (t) {
|
|
3149
|
-
i(t);
|
|
3150
|
-
}
|
|
3151
|
-
}
|
|
3152
|
-
|
|
3153
|
-
function s(t) {
|
|
3154
|
-
try {
|
|
3155
|
-
u(o["throw"](t));
|
|
3156
|
-
} catch (t) {
|
|
3157
|
-
i(t);
|
|
3158
|
-
}
|
|
3159
|
-
}
|
|
2343
|
+
dotSize: o
|
|
2344
|
+
})] : [3, 4];
|
|
3160
2345
|
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
|
|
3164
|
-
t(r);
|
|
3165
|
-
})).then(a, s);
|
|
3166
|
-
}
|
|
2346
|
+
case 3:
|
|
2347
|
+
f.sent(), f.label = 4;
|
|
3167
2348
|
|
|
3168
|
-
|
|
2349
|
+
case 4:
|
|
2350
|
+
return [2];
|
|
2351
|
+
}
|
|
2352
|
+
});
|
|
3169
2353
|
});
|
|
3170
|
-
var e, r, n, o;
|
|
3171
2354
|
}, t.prototype.drawBackground = function () {
|
|
3172
2355
|
var t,
|
|
3173
2356
|
e,
|
|
3174
|
-
r
|
|
3175
|
-
n = this.
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
2357
|
+
r,
|
|
2358
|
+
n = this._element,
|
|
2359
|
+
o = this._options;
|
|
2360
|
+
|
|
2361
|
+
if (n) {
|
|
2362
|
+
var i = null === (t = o.backgroundOptions) || void 0 === t ? void 0 : t.gradient,
|
|
2363
|
+
a = null === (e = o.backgroundOptions) || void 0 === e ? void 0 : e.color;
|
|
2364
|
+
|
|
2365
|
+
if ((i || a) && this._createColor({
|
|
2366
|
+
options: i,
|
|
2367
|
+
color: a,
|
|
3183
2368
|
additionalRotation: 0,
|
|
3184
2369
|
x: 0,
|
|
3185
2370
|
y: 0,
|
|
3186
|
-
height:
|
|
3187
|
-
width:
|
|
2371
|
+
height: o.height,
|
|
2372
|
+
width: o.width,
|
|
3188
2373
|
name: "background-color"
|
|
3189
|
-
})
|
|
2374
|
+
}), null === (r = o.backgroundOptions) || void 0 === r ? void 0 : r.round) {
|
|
2375
|
+
var s = Math.min(o.width, o.height),
|
|
2376
|
+
u = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2377
|
+
this._backgroundClipPath = document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), this._backgroundClipPath.setAttribute("id", "clip-path-background-color"), this._defs.appendChild(this._backgroundClipPath), u.setAttribute("x", String((o.width - s) / 2)), u.setAttribute("y", String((o.height - s) / 2)), u.setAttribute("width", String(s)), u.setAttribute("height", String(s)), u.setAttribute("rx", String(s / 2 * o.backgroundOptions.round)), this._backgroundClipPath.appendChild(u);
|
|
2378
|
+
}
|
|
3190
2379
|
}
|
|
3191
2380
|
}, t.prototype.drawDots = function (t) {
|
|
3192
2381
|
var e,
|
|
@@ -3199,10 +2388,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3199
2388
|
|
|
3200
2389
|
if (i > o.width || i > o.height) throw "The canvas is too small.";
|
|
3201
2390
|
var a = Math.min(o.width, o.height) - 2 * o.margin,
|
|
3202
|
-
s =
|
|
3203
|
-
u = Math.floor(
|
|
3204
|
-
|
|
3205
|
-
|
|
2391
|
+
s = o.shape === v ? a / Math.sqrt(2) : a,
|
|
2392
|
+
u = Math.floor(s / i),
|
|
2393
|
+
h = Math.floor((o.width - i * u) / 2),
|
|
2394
|
+
c = Math.floor((o.height - i * u) / 2),
|
|
2395
|
+
d = new l({
|
|
3206
2396
|
svg: this._element,
|
|
3207
2397
|
type: o.dotsOptions.type
|
|
3208
2398
|
});
|
|
@@ -3210,23 +2400,57 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3210
2400
|
options: null === (e = o.dotsOptions) || void 0 === e ? void 0 : e.gradient,
|
|
3211
2401
|
color: o.dotsOptions.color,
|
|
3212
2402
|
additionalRotation: 0,
|
|
3213
|
-
x:
|
|
3214
|
-
y:
|
|
3215
|
-
height:
|
|
3216
|
-
width:
|
|
2403
|
+
x: 0,
|
|
2404
|
+
y: 0,
|
|
2405
|
+
height: o.height,
|
|
2406
|
+
width: o.width,
|
|
3217
2407
|
name: "dot-color"
|
|
3218
2408
|
});
|
|
3219
2409
|
|
|
3220
|
-
for (var
|
|
2410
|
+
for (var f = function f(e) {
|
|
3221
2411
|
for (var o = function o(_o) {
|
|
3222
|
-
return t && !t(e, _o) ? "continue" : (null === (r =
|
|
2412
|
+
return t && !t(e, _o) ? "continue" : (null === (r = g._qr) || void 0 === r ? void 0 : r.isDark(e, _o)) ? (d.draw(h + e * u, c + _o * u, u, function (r, a) {
|
|
3223
2413
|
return !(e + r < 0 || _o + a < 0 || e + r >= i || _o + a >= i) && !(t && !t(e + r, _o + a)) && !!n._qr && n._qr.isDark(e + r, _o + a);
|
|
3224
|
-
}), void (
|
|
2414
|
+
}), void (d._element && g._dotsClipPath && g._dotsClipPath.appendChild(d._element))) : "continue";
|
|
3225
2415
|
}, a = 0; a < i; a++) {
|
|
3226
2416
|
o(a);
|
|
3227
2417
|
}
|
|
3228
|
-
},
|
|
3229
|
-
|
|
2418
|
+
}, g = this, p = 0; p < i; p++) {
|
|
2419
|
+
f(p);
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
if (o.shape === v) {
|
|
2423
|
+
var w = Math.floor((a / u - i) / 2),
|
|
2424
|
+
y = i + 2 * w,
|
|
2425
|
+
m = h - w * u,
|
|
2426
|
+
b = c - w * u,
|
|
2427
|
+
_ = [],
|
|
2428
|
+
x = Math.floor(y / 2);
|
|
2429
|
+
|
|
2430
|
+
for (p = 0; p < y; p++) {
|
|
2431
|
+
_[p] = [];
|
|
2432
|
+
|
|
2433
|
+
for (var S = 0; S < y; S++) {
|
|
2434
|
+
p >= w - 1 && p <= y - w && S >= w - 1 && S <= y - w || Math.sqrt((p - x) * (p - x) + (S - x) * (S - x)) > x ? _[p][S] = 0 : _[p][S] = this._qr.isDark(S - 2 * w < 0 ? S : S >= i ? S - 2 * w : S - w, p - 2 * w < 0 ? p : p >= i ? p - 2 * w : p - w) ? 1 : 0;
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
var M = function M(t) {
|
|
2439
|
+
for (var e = function e(_e2) {
|
|
2440
|
+
if (!_[t][_e2]) return "continue";
|
|
2441
|
+
d.draw(m + t * u, b + _e2 * u, u, function (r, n) {
|
|
2442
|
+
var o;
|
|
2443
|
+
return !!(null === (o = _[t + r]) || void 0 === o ? void 0 : o[_e2 + n]);
|
|
2444
|
+
}), d._element && C._dotsClipPath && C._dotsClipPath.appendChild(d._element);
|
|
2445
|
+
}, r = 0; r < y; r++) {
|
|
2446
|
+
e(r);
|
|
2447
|
+
}
|
|
2448
|
+
},
|
|
2449
|
+
C = this;
|
|
2450
|
+
|
|
2451
|
+
for (p = 0; p < y; p++) {
|
|
2452
|
+
M(p);
|
|
2453
|
+
}
|
|
3230
2454
|
}
|
|
3231
2455
|
}, t.prototype.drawCorners = function () {
|
|
3232
2456
|
var t = this;
|
|
@@ -3237,100 +2461,101 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3237
2461
|
|
|
3238
2462
|
var n = this._qr.getModuleCount(),
|
|
3239
2463
|
o = Math.min(r.width, r.height) - 2 * r.margin,
|
|
3240
|
-
i =
|
|
3241
|
-
a =
|
|
3242
|
-
s =
|
|
3243
|
-
u =
|
|
3244
|
-
|
|
2464
|
+
i = r.shape === v ? o / Math.sqrt(2) : o,
|
|
2465
|
+
a = Math.floor(i / n),
|
|
2466
|
+
s = 7 * a,
|
|
2467
|
+
u = 3 * a,
|
|
2468
|
+
h = Math.floor((r.width - n * a) / 2),
|
|
2469
|
+
c = Math.floor((r.height - n * a) / 2);
|
|
3245
2470
|
|
|
3246
2471
|
[[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function (e) {
|
|
3247
2472
|
var o,
|
|
3248
|
-
|
|
2473
|
+
i,
|
|
3249
2474
|
d,
|
|
3250
|
-
l,
|
|
3251
|
-
f,
|
|
3252
|
-
p,
|
|
3253
2475
|
g,
|
|
3254
2476
|
v,
|
|
3255
|
-
y,
|
|
3256
2477
|
w,
|
|
2478
|
+
y,
|
|
3257
2479
|
_,
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
2480
|
+
x,
|
|
2481
|
+
S,
|
|
2482
|
+
M,
|
|
2483
|
+
C,
|
|
2484
|
+
A = e[0],
|
|
2485
|
+
k = e[1],
|
|
2486
|
+
O = e[2],
|
|
2487
|
+
D = h + A * a * (n - 7),
|
|
2488
|
+
P = c + k * a * (n - 7),
|
|
2489
|
+
z = t._dotsClipPath,
|
|
2490
|
+
B = t._dotsClipPath;
|
|
2491
|
+
|
|
2492
|
+
if (((null === (o = r.cornersSquareOptions) || void 0 === o ? void 0 : o.gradient) || (null === (i = r.cornersSquareOptions) || void 0 === i ? void 0 : i.color)) && ((z = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-square-color-" + A + "-" + k), t._defs.appendChild(z), t._cornersSquareClipPath = t._cornersDotClipPath = B = z, t._createColor({
|
|
3268
2493
|
options: null === (d = r.cornersSquareOptions) || void 0 === d ? void 0 : d.gradient,
|
|
3269
|
-
color: null === (
|
|
3270
|
-
additionalRotation:
|
|
3271
|
-
x:
|
|
3272
|
-
y:
|
|
3273
|
-
height:
|
|
3274
|
-
width:
|
|
3275
|
-
name: "corners-square-color-" +
|
|
3276
|
-
})), null === (
|
|
3277
|
-
var
|
|
2494
|
+
color: null === (g = r.cornersSquareOptions) || void 0 === g ? void 0 : g.color,
|
|
2495
|
+
additionalRotation: O,
|
|
2496
|
+
x: D,
|
|
2497
|
+
y: P,
|
|
2498
|
+
height: s,
|
|
2499
|
+
width: s,
|
|
2500
|
+
name: "corners-square-color-" + A + "-" + k
|
|
2501
|
+
})), null === (v = r.cornersSquareOptions) || void 0 === v ? void 0 : v.type) {
|
|
2502
|
+
var q = new f({
|
|
3278
2503
|
svg: t._element,
|
|
3279
2504
|
type: r.cornersSquareOptions.type
|
|
3280
2505
|
});
|
|
3281
|
-
|
|
3282
|
-
} else for (var
|
|
2506
|
+
q.draw(D, P, s, O), q._element && z && z.appendChild(q._element);
|
|
2507
|
+
} else for (var I = new l({
|
|
3283
2508
|
svg: t._element,
|
|
3284
2509
|
type: r.dotsOptions.type
|
|
3285
|
-
}),
|
|
3286
|
-
for (var e = function e(
|
|
3287
|
-
if (!(null === (
|
|
3288
|
-
|
|
2510
|
+
}), E = function E(t) {
|
|
2511
|
+
for (var e = function e(_e3) {
|
|
2512
|
+
if (!(null === (w = m[t]) || void 0 === w ? void 0 : w[_e3])) return "continue";
|
|
2513
|
+
I.draw(D + t * a, P + _e3 * a, a, function (r, n) {
|
|
3289
2514
|
var o;
|
|
3290
|
-
return !!(null === (o =
|
|
3291
|
-
}),
|
|
3292
|
-
}, r = 0; r <
|
|
2515
|
+
return !!(null === (o = m[t + r]) || void 0 === o ? void 0 : o[_e3 + n]);
|
|
2516
|
+
}), I._element && z && z.appendChild(I._element);
|
|
2517
|
+
}, r = 0; r < m[t].length; r++) {
|
|
3293
2518
|
e(r);
|
|
3294
2519
|
}
|
|
3295
|
-
},
|
|
3296
|
-
|
|
3297
|
-
}
|
|
3298
|
-
|
|
3299
|
-
if (((null === (
|
|
3300
|
-
options: null === (
|
|
3301
|
-
color: null === (
|
|
3302
|
-
additionalRotation:
|
|
3303
|
-
x:
|
|
3304
|
-
y:
|
|
3305
|
-
height:
|
|
3306
|
-
width:
|
|
3307
|
-
name: "corners-dot-color-" +
|
|
3308
|
-
})), null === (
|
|
3309
|
-
var
|
|
2520
|
+
}, L = 0; L < m.length; L++) {
|
|
2521
|
+
E(L);
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
if (((null === (y = r.cornersDotOptions) || void 0 === y ? void 0 : y.gradient) || (null === (_ = r.cornersDotOptions) || void 0 === _ ? void 0 : _.color)) && ((B = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-dot-color-" + A + "-" + k), t._defs.appendChild(B), t._cornersDotClipPath = B, t._createColor({
|
|
2525
|
+
options: null === (x = r.cornersDotOptions) || void 0 === x ? void 0 : x.gradient,
|
|
2526
|
+
color: null === (S = r.cornersDotOptions) || void 0 === S ? void 0 : S.color,
|
|
2527
|
+
additionalRotation: O,
|
|
2528
|
+
x: D + 2 * a,
|
|
2529
|
+
y: P + 2 * a,
|
|
2530
|
+
height: u,
|
|
2531
|
+
width: u,
|
|
2532
|
+
name: "corners-dot-color-" + A + "-" + k
|
|
2533
|
+
})), null === (M = r.cornersDotOptions) || void 0 === M ? void 0 : M.type) {
|
|
2534
|
+
var R = new p({
|
|
3310
2535
|
svg: t._element,
|
|
3311
2536
|
type: r.cornersDotOptions.type
|
|
3312
2537
|
});
|
|
3313
|
-
|
|
2538
|
+
R.draw(D + 2 * a, P + 2 * a, u, O), R._element && B && B.appendChild(R._element);
|
|
3314
2539
|
} else {
|
|
3315
|
-
|
|
2540
|
+
I = new l({
|
|
3316
2541
|
svg: t._element,
|
|
3317
2542
|
type: r.dotsOptions.type
|
|
3318
2543
|
});
|
|
3319
2544
|
|
|
3320
2545
|
var N = function N(t) {
|
|
3321
|
-
for (var e = function e(
|
|
3322
|
-
if (!(null === (
|
|
3323
|
-
|
|
2546
|
+
for (var e = function e(_e4) {
|
|
2547
|
+
if (!(null === (C = b[t]) || void 0 === C ? void 0 : C[_e4])) return "continue";
|
|
2548
|
+
I.draw(D + t * a, P + _e4 * a, a, function (r, n) {
|
|
3324
2549
|
var o;
|
|
3325
|
-
return !!(null === (o =
|
|
3326
|
-
}),
|
|
3327
|
-
}, r = 0; r <
|
|
2550
|
+
return !!(null === (o = b[t + r]) || void 0 === o ? void 0 : o[_e4 + n]);
|
|
2551
|
+
}), I._element && B && B.appendChild(I._element);
|
|
2552
|
+
}, r = 0; r < b[t].length; r++) {
|
|
3328
2553
|
e(r);
|
|
3329
2554
|
}
|
|
3330
2555
|
};
|
|
3331
2556
|
|
|
3332
|
-
for (
|
|
3333
|
-
N(
|
|
2557
|
+
for (L = 0; L < b.length; L++) {
|
|
2558
|
+
N(L);
|
|
3334
2559
|
}
|
|
3335
2560
|
}
|
|
3336
2561
|
});
|
|
@@ -3348,16 +2573,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3348
2573
|
var e = t.width,
|
|
3349
2574
|
r = t.height,
|
|
3350
2575
|
n = t.count,
|
|
3351
|
-
o = t.dotSize
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
2576
|
+
o = t.dotSize;
|
|
2577
|
+
return w(this, void 0, void 0, function () {
|
|
2578
|
+
var t, i, a, s, h, c, l, d, f;
|
|
2579
|
+
return y(this, function (g) {
|
|
2580
|
+
switch (g.label) {
|
|
2581
|
+
case 0:
|
|
2582
|
+
return t = this._options, i = Math.floor((t.width - n * o) / 2), a = Math.floor((t.height - n * o) / 2), s = i + t.imageOptions.margin + (n * o - e) / 2, h = a + t.imageOptions.margin + (n * o - r) / 2, c = e - 2 * t.imageOptions.margin, l = r - 2 * t.imageOptions.margin, (d = document.createElementNS("http://www.w3.org/2000/svg", "image")).setAttribute("x", String(s)), d.setAttribute("y", String(h)), d.setAttribute("width", c + "px"), d.setAttribute("height", l + "px"), [4, u(t.image || "")];
|
|
2583
|
+
|
|
2584
|
+
case 1:
|
|
2585
|
+
return f = g.sent(), d.setAttribute("href", f || ""), this._element.appendChild(d), [2];
|
|
2586
|
+
}
|
|
2587
|
+
});
|
|
2588
|
+
});
|
|
3361
2589
|
}, t.prototype._createColor = function (t) {
|
|
3362
2590
|
var e = t.options,
|
|
3363
2591
|
r = t.color,
|
|
@@ -3367,45 +2595,46 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3367
2595
|
a = t.height,
|
|
3368
2596
|
s = t.width,
|
|
3369
2597
|
u = t.name,
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
if (
|
|
3374
|
-
var
|
|
3375
|
-
if (e.type
|
|
3376
|
-
var
|
|
3377
|
-
f = (
|
|
3378
|
-
|
|
3379
|
-
|
|
2598
|
+
h = s > a ? s : a,
|
|
2599
|
+
c = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2600
|
+
|
|
2601
|
+
if (c.setAttribute("x", String(o)), c.setAttribute("y", String(i)), c.setAttribute("height", String(a)), c.setAttribute("width", String(s)), c.setAttribute("clip-path", "url('#clip-path-" + u + "')"), e) {
|
|
2602
|
+
var l;
|
|
2603
|
+
if ("radial" === e.type) (l = document.createElementNS("http://www.w3.org/2000/svg", "radialGradient")).setAttribute("id", u), l.setAttribute("gradientUnits", "userSpaceOnUse"), l.setAttribute("fx", String(o + s / 2)), l.setAttribute("fy", String(i + a / 2)), l.setAttribute("cx", String(o + s / 2)), l.setAttribute("cy", String(i + a / 2)), l.setAttribute("r", String(h / 2));else {
|
|
2604
|
+
var d = ((e.rotation || 0) + n) % (2 * Math.PI),
|
|
2605
|
+
f = (d + 2 * Math.PI) % (2 * Math.PI),
|
|
2606
|
+
g = o + s / 2,
|
|
2607
|
+
p = i + a / 2,
|
|
3380
2608
|
v = o + s / 2,
|
|
3381
|
-
|
|
3382
|
-
f >= 0 && f <= .25 * Math.PI || f > 1.75 * Math.PI && f <= 2 * Math.PI ? (
|
|
2609
|
+
w = i + a / 2;
|
|
2610
|
+
f >= 0 && f <= .25 * Math.PI || f > 1.75 * Math.PI && f <= 2 * Math.PI ? (g -= s / 2, p -= a / 2 * Math.tan(d), v += s / 2, w += a / 2 * Math.tan(d)) : f > .25 * Math.PI && f <= .75 * Math.PI ? (p -= a / 2, g -= s / 2 / Math.tan(d), w += a / 2, v += s / 2 / Math.tan(d)) : f > .75 * Math.PI && f <= 1.25 * Math.PI ? (g += s / 2, p += a / 2 * Math.tan(d), v -= s / 2, w -= a / 2 * Math.tan(d)) : f > 1.25 * Math.PI && f <= 1.75 * Math.PI && (p += a / 2, g += s / 2 / Math.tan(d), w -= a / 2, v -= s / 2 / Math.tan(d)), (l = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient")).setAttribute("id", u), l.setAttribute("gradientUnits", "userSpaceOnUse"), l.setAttribute("x1", String(Math.round(g))), l.setAttribute("y1", String(Math.round(p))), l.setAttribute("x2", String(Math.round(v))), l.setAttribute("y2", String(Math.round(w)));
|
|
3383
2611
|
}
|
|
3384
2612
|
e.colorStops.forEach(function (t) {
|
|
3385
2613
|
var e = t.offset,
|
|
3386
2614
|
r = t.color,
|
|
3387
2615
|
n = document.createElementNS("http://www.w3.org/2000/svg", "stop");
|
|
3388
|
-
n.setAttribute("offset", 100 * e + "%"), n.setAttribute("stop-color", r),
|
|
3389
|
-
}),
|
|
3390
|
-
} else r &&
|
|
2616
|
+
n.setAttribute("offset", 100 * e + "%"), n.setAttribute("stop-color", r), l.appendChild(n);
|
|
2617
|
+
}), c.setAttribute("fill", "url('#" + u + "')"), this._defs.appendChild(l);
|
|
2618
|
+
} else r && c.setAttribute("fill", r);
|
|
3391
2619
|
|
|
3392
|
-
this._element.appendChild(
|
|
2620
|
+
this._element.appendChild(c);
|
|
3393
2621
|
}, t;
|
|
3394
2622
|
}(),
|
|
3395
|
-
|
|
2623
|
+
x = "canvas";
|
|
3396
2624
|
|
|
3397
|
-
for (var
|
|
3398
|
-
|
|
2625
|
+
for (var S = {}, M = 0; M <= 40; M++) {
|
|
2626
|
+
S[M] = M;
|
|
3399
2627
|
}
|
|
3400
2628
|
|
|
3401
|
-
var
|
|
3402
|
-
type:
|
|
2629
|
+
var C = {
|
|
2630
|
+
type: x,
|
|
2631
|
+
shape: "square",
|
|
3403
2632
|
width: 300,
|
|
3404
2633
|
height: 300,
|
|
3405
2634
|
data: "",
|
|
3406
2635
|
margin: 0,
|
|
3407
2636
|
qrOptions: {
|
|
3408
|
-
typeNumber:
|
|
2637
|
+
typeNumber: S[0],
|
|
3409
2638
|
mode: void 0,
|
|
3410
2639
|
errorCorrectionLevel: "Q"
|
|
3411
2640
|
},
|
|
@@ -3420,12 +2649,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3420
2649
|
color: "#000"
|
|
3421
2650
|
},
|
|
3422
2651
|
backgroundOptions: {
|
|
2652
|
+
round: 0,
|
|
3423
2653
|
color: "#fff"
|
|
3424
2654
|
}
|
|
3425
2655
|
};
|
|
3426
2656
|
|
|
3427
|
-
var
|
|
3428
|
-
return (
|
|
2657
|
+
var _A = function A() {
|
|
2658
|
+
return (_A = Object.assign || function (t) {
|
|
3429
2659
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
3430
2660
|
for (var o in e = arguments[r]) {
|
|
3431
2661
|
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
@@ -3436,30 +2666,30 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3436
2666
|
}).apply(this, arguments);
|
|
3437
2667
|
};
|
|
3438
2668
|
|
|
3439
|
-
function
|
|
3440
|
-
var e =
|
|
2669
|
+
function k(t) {
|
|
2670
|
+
var e = _A({}, t);
|
|
3441
2671
|
|
|
3442
2672
|
if (!e.colorStops || !e.colorStops.length) throw "Field 'colorStops' is required in gradient";
|
|
3443
2673
|
return e.rotation ? e.rotation = Number(e.rotation) : e.rotation = 0, e.colorStops = e.colorStops.map(function (t) {
|
|
3444
|
-
return
|
|
2674
|
+
return _A(_A({}, t), {
|
|
3445
2675
|
offset: Number(t.offset)
|
|
3446
2676
|
});
|
|
3447
2677
|
}), e;
|
|
3448
2678
|
}
|
|
3449
2679
|
|
|
3450
|
-
function
|
|
3451
|
-
var e =
|
|
2680
|
+
function O(t) {
|
|
2681
|
+
var e = _A({}, t);
|
|
3452
2682
|
|
|
3453
|
-
return e.width = Number(e.width), e.height = Number(e.height), e.margin = Number(e.margin), e.imageOptions =
|
|
2683
|
+
return e.width = Number(e.width), e.height = Number(e.height), e.margin = Number(e.margin), e.imageOptions = _A(_A({}, e.imageOptions), {
|
|
3454
2684
|
hideBackgroundDots: Boolean(e.imageOptions.hideBackgroundDots),
|
|
3455
2685
|
imageSize: Number(e.imageOptions.imageSize),
|
|
3456
2686
|
margin: Number(e.imageOptions.margin)
|
|
3457
|
-
}), e.margin > Math.min(e.width, e.height) && (e.margin = Math.min(e.width, e.height)), e.dotsOptions =
|
|
2687
|
+
}), e.margin > Math.min(e.width, e.height) && (e.margin = Math.min(e.width, e.height)), e.dotsOptions = _A({}, e.dotsOptions), e.dotsOptions.gradient && (e.dotsOptions.gradient = k(e.dotsOptions.gradient)), e.cornersSquareOptions && (e.cornersSquareOptions = _A({}, e.cornersSquareOptions), e.cornersSquareOptions.gradient && (e.cornersSquareOptions.gradient = k(e.cornersSquareOptions.gradient))), e.cornersDotOptions && (e.cornersDotOptions = _A({}, e.cornersDotOptions), e.cornersDotOptions.gradient && (e.cornersDotOptions.gradient = k(e.cornersDotOptions.gradient))), e.backgroundOptions && (e.backgroundOptions = _A({}, e.backgroundOptions), e.backgroundOptions.gradient && (e.backgroundOptions.gradient = k(e.backgroundOptions.gradient))), e;
|
|
3458
2688
|
}
|
|
3459
2689
|
|
|
3460
|
-
var
|
|
3461
|
-
|
|
3462
|
-
|
|
2690
|
+
var D = r(192),
|
|
2691
|
+
P = r.n(D),
|
|
2692
|
+
z = function z(t, e, r, n) {
|
|
3463
2693
|
return new (r || (r = Promise))(function (o, i) {
|
|
3464
2694
|
function a(t) {
|
|
3465
2695
|
try {
|
|
@@ -3487,7 +2717,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3487
2717
|
u((n = n.apply(t, e || [])).next());
|
|
3488
2718
|
});
|
|
3489
2719
|
},
|
|
3490
|
-
|
|
2720
|
+
B = function B(t, e) {
|
|
3491
2721
|
var r,
|
|
3492
2722
|
n,
|
|
3493
2723
|
o,
|
|
@@ -3581,35 +2811,61 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3581
2811
|
}
|
|
3582
2812
|
};
|
|
3583
2813
|
|
|
3584
|
-
var
|
|
2814
|
+
var q = function () {
|
|
3585
2815
|
function t(t) {
|
|
3586
|
-
this._options = t ?
|
|
2816
|
+
this._options = t ? O(a(C, t)) : C, this.update();
|
|
3587
2817
|
}
|
|
3588
2818
|
|
|
3589
2819
|
return t._clearContainer = function (t) {
|
|
3590
2820
|
t && (t.innerHTML = "");
|
|
3591
|
-
}, t.prototype.
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
2821
|
+
}, t.prototype._setupSvg = function () {
|
|
2822
|
+
var t = this;
|
|
2823
|
+
|
|
2824
|
+
if (this._qr) {
|
|
2825
|
+
var e = new _(this._options);
|
|
2826
|
+
this._svg = e.getElement(), this._svgDrawingPromise = e.drawQR(this._qr).then(function () {
|
|
2827
|
+
var r;
|
|
2828
|
+
t._svg && (null === (r = t._extension) || void 0 === r || r.call(t, e.getElement(), t._options));
|
|
2829
|
+
});
|
|
2830
|
+
}
|
|
2831
|
+
}, t.prototype._setupCanvas = function () {
|
|
2832
|
+
var t,
|
|
2833
|
+
e = this;
|
|
2834
|
+
this._qr && (this._canvas = document.createElement("canvas"), this._canvas.width = this._options.width, this._canvas.height = this._options.height, this._setupSvg(), this._canvasDrawingPromise = null === (t = this._svgDrawingPromise) || void 0 === t ? void 0 : t.then(function () {
|
|
2835
|
+
if (e._svg) {
|
|
2836
|
+
var t = e._svg,
|
|
2837
|
+
r = new XMLSerializer().serializeToString(t),
|
|
2838
|
+
n = "data:image/svg+xml;base64," + btoa(r),
|
|
2839
|
+
o = new Image();
|
|
2840
|
+
return new Promise(function (t) {
|
|
2841
|
+
o.onload = function () {
|
|
2842
|
+
var r, n;
|
|
2843
|
+
null === (n = null === (r = e._canvas) || void 0 === r ? void 0 : r.getContext("2d")) || void 0 === n || n.drawImage(o, 0, 0), t();
|
|
2844
|
+
}, o.src = n;
|
|
2845
|
+
});
|
|
2846
|
+
}
|
|
2847
|
+
}));
|
|
2848
|
+
}, t.prototype._getElement = function (t) {
|
|
2849
|
+
return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
|
|
2850
|
+
return B(this, function (e) {
|
|
2851
|
+
switch (e.label) {
|
|
3596
2852
|
case 0:
|
|
3597
2853
|
if (!this._qr) throw "QR code is empty";
|
|
3598
|
-
return "svg" !== t.toLowerCase() ? [3, 2] : (
|
|
2854
|
+
return "svg" !== t.toLowerCase() ? [3, 2] : (this._svg && this._svgDrawingPromise || this._setupSvg(), [4, this._svgDrawingPromise]);
|
|
3599
2855
|
|
|
3600
2856
|
case 1:
|
|
3601
|
-
return
|
|
2857
|
+
return e.sent(), [2, this._svg];
|
|
3602
2858
|
|
|
3603
2859
|
case 2:
|
|
3604
|
-
return
|
|
2860
|
+
return this._canvas && this._canvasDrawingPromise || this._setupCanvas(), [4, this._canvasDrawingPromise];
|
|
3605
2861
|
|
|
3606
2862
|
case 3:
|
|
3607
|
-
return
|
|
2863
|
+
return e.sent(), [2, this._canvas];
|
|
3608
2864
|
}
|
|
3609
2865
|
});
|
|
3610
2866
|
});
|
|
3611
2867
|
}, t.prototype.update = function (e) {
|
|
3612
|
-
t._clearContainer(this._container), this._options = e ?
|
|
2868
|
+
t._clearContainer(this._container), this._options = e ? O(a(this._options, e)) : this._options, this._options.data && (this._qr = P()(this._options.qrOptions.typeNumber, this._options.qrOptions.errorCorrectionLevel), this._qr.addData(this._options.data, this._options.qrOptions.mode || function (t) {
|
|
3613
2869
|
switch (!0) {
|
|
3614
2870
|
case /^[0-9]*$/.test(t):
|
|
3615
2871
|
return "Numeric";
|
|
@@ -3620,41 +2876,46 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3620
2876
|
default:
|
|
3621
2877
|
return "Byte";
|
|
3622
2878
|
}
|
|
3623
|
-
}(this._options.data)), this._qr.make(), this._options.type ===
|
|
2879
|
+
}(this._options.data)), this._qr.make(), this._options.type === x ? this._setupCanvas() : this._setupSvg(), this.append(this._container));
|
|
3624
2880
|
}, t.prototype.append = function (t) {
|
|
3625
2881
|
if (t) {
|
|
3626
2882
|
if ("function" != typeof t.appendChild) throw "Container should be a single DOM node";
|
|
3627
|
-
this._options.type ===
|
|
2883
|
+
this._options.type === x ? this._canvas && t.appendChild(this._canvas) : this._svg && t.appendChild(this._svg), this._container = t;
|
|
3628
2884
|
}
|
|
2885
|
+
}, t.prototype.applyExtension = function (t) {
|
|
2886
|
+
if (!t) throw "Extension function should be defined.";
|
|
2887
|
+
this._extension = t, this.update();
|
|
2888
|
+
}, t.prototype.deleteExtension = function () {
|
|
2889
|
+
this._extension = void 0, this.update();
|
|
3629
2890
|
}, t.prototype.getRawData = function (t) {
|
|
3630
|
-
return void 0 === t && (t = "png"),
|
|
2891
|
+
return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
|
|
3631
2892
|
var e, r, n;
|
|
3632
|
-
return
|
|
2893
|
+
return B(this, function (o) {
|
|
3633
2894
|
switch (o.label) {
|
|
3634
2895
|
case 0:
|
|
3635
2896
|
if (!this._qr) throw "QR code is empty";
|
|
3636
|
-
return [4, this.
|
|
2897
|
+
return [4, this._getElement(t)];
|
|
3637
2898
|
|
|
3638
2899
|
case 1:
|
|
3639
|
-
return e = o.sent()
|
|
2900
|
+
return (e = o.sent()) ? "svg" === t.toLowerCase() ? (r = new XMLSerializer(), n = r.serializeToString(e), [2, new Blob(['<?xml version="1.0" standalone="no"?>\r\n' + n], {
|
|
3640
2901
|
type: "image/svg+xml"
|
|
3641
2902
|
})]) : [2, new Promise(function (r) {
|
|
3642
|
-
return e.
|
|
3643
|
-
})];
|
|
2903
|
+
return e.toBlob(r, "image/" + t, 1);
|
|
2904
|
+
})] : [2, null];
|
|
3644
2905
|
}
|
|
3645
2906
|
});
|
|
3646
2907
|
});
|
|
3647
2908
|
}, t.prototype.download = function (t) {
|
|
3648
|
-
return
|
|
2909
|
+
return z(this, void 0, void 0, function () {
|
|
3649
2910
|
var e, r, n, o, i;
|
|
3650
|
-
return
|
|
2911
|
+
return B(this, function (a) {
|
|
3651
2912
|
switch (a.label) {
|
|
3652
2913
|
case 0:
|
|
3653
2914
|
if (!this._qr) throw "QR code is empty";
|
|
3654
|
-
return e = "png", r = "qr", "string" == typeof t ? (e = t, console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")) : "object" == _typeof(t) && null !== t && (t.name && (r = t.name), t.extension && (e = t.extension)), [4, this.
|
|
2915
|
+
return e = "png", r = "qr", "string" == typeof t ? (e = t, console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")) : "object" == _typeof(t) && null !== t && (t.name && (r = t.name), t.extension && (e = t.extension)), [4, this._getElement(e)];
|
|
3655
2916
|
|
|
3656
2917
|
case 1:
|
|
3657
|
-
return n = a.sent()
|
|
2918
|
+
return (n = a.sent()) ? ("svg" === e.toLowerCase() ? (o = new XMLSerializer(), i = '<?xml version="1.0" standalone="no"?>\r\n' + (i = o.serializeToString(n)), s("data:image/svg+xml;charset=utf-8," + encodeURIComponent(i), r + ".svg")) : s(n.toDataURL("image/" + e), r + "." + e), [2]) : [2];
|
|
3658
2919
|
}
|
|
3659
2920
|
});
|
|
3660
2921
|
});
|
|
@@ -3690,12 +2951,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3690
2951
|
}
|
|
3691
2952
|
}, r.o = function (t, e) {
|
|
3692
2953
|
return Object.prototype.hasOwnProperty.call(t, e);
|
|
3693
|
-
}, r(
|
|
2954
|
+
}, r(676);
|
|
3694
2955
|
}()["default"];
|
|
3695
2956
|
});
|
|
3696
2957
|
}, {}],
|
|
3697
2958
|
5: [function (require, module, exports) {
|
|
3698
|
-
module.exports = "1.
|
|
2959
|
+
module.exports = "1.119.2";
|
|
3699
2960
|
}, {}]
|
|
3700
2961
|
}, {}, [3])(3);
|
|
3701
2962
|
});
|