@plattar/plattar-qrcode 1.118.1 → 1.119.1

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.
@@ -202,8 +202,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
202
202
  }
203
203
  }
204
204
  };
205
- this._options.width = width || 512;
206
- this._options.height = height || 512;
205
+ this._options.width = 2048;
206
+ this._options.height = 2048;
207
207
  this._options.data = url;
208
208
  this._options.margin = margin;
209
209
  this._options.image = image; // set the colors
@@ -228,9 +228,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
228
228
  var qrCode = this._qrCode;
229
229
 
230
230
  if (!qrCode) {
231
+ var div = document.createElement("div");
232
+ div.style.width = width + "px";
233
+ div.style.height = height + "px";
234
+ shadow.appendChild(div);
231
235
  this._qrCode = new QRCodeStyling(this._options);
232
236
 
233
- this._qrCode.append(shadow);
237
+ this._qrCode.append(div);
238
+
239
+ var canvas = this._qrCode._canvas;
240
+
241
+ if (canvas) {
242
+ canvas.style.width = "100%";
243
+ canvas.style.height = "100%";
244
+ }
234
245
 
235
246
  return;
236
247
  }
@@ -300,8 +311,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
300
311
  i = 0,
301
312
  u = null,
302
313
  v = [],
303
- y = {},
304
- _ = function _(t, e) {
314
+ w = {},
315
+ m = function m(t, e) {
305
316
  o = function (t) {
306
317
  for (var e = new Array(t), r = 0; r < t; r += 1) {
307
318
  e[r] = new Array(t);
@@ -312,16 +323,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
312
323
  }
313
324
 
314
325
  return e;
315
- }(i = 4 * r + 17), m(0, 0), m(i - 7, 0), m(0, i - 7), x(), b(), S(t, e), r >= 7 && M(t), null == u && (u = P(r, n, v)), C(u, e);
326
+ }(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);
316
327
  },
317
- m = function m(t, e) {
328
+ b = function b(t, e) {
318
329
  for (var r = -1; r <= 7; r += 1) {
319
330
  if (!(t + r <= -1 || i <= t + r)) for (var n = -1; n <= 7; n += 1) {
320
331
  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);
321
332
  }
322
333
  }
323
334
  },
324
- b = function b() {
335
+ _ = function _() {
325
336
  for (var t = 8; t < i - 8; t += 1) {
326
337
  null == o[t][6] && (o[t][6] = t % 2 == 0);
327
338
  }
@@ -336,14 +347,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
336
347
  var i = t[e],
337
348
  a = t[n];
338
349
  if (null == o[i][a]) for (var u = -2; u <= 2; u += 1) {
339
- for (var c = -2; c <= 2; c += 1) {
340
- o[i + u][a + c] = -2 == u || 2 == u || -2 == c || 2 == c || 0 == u && 0 == c;
350
+ for (var h = -2; h <= 2; h += 1) {
351
+ o[i + u][a + h] = -2 == u || 2 == u || -2 == h || 2 == h || 0 == u && 0 == h;
341
352
  }
342
353
  }
343
354
  }
344
355
  }
345
356
  },
346
- M = function M(t) {
357
+ S = function S(t) {
347
358
  for (var e = s.getBCHTypeNumber(r), n = 0; n < 18; n += 1) {
348
359
  var a = !t && 1 == (e >> n & 1);
349
360
  o[Math.floor(n / 3)][n % 3 + i - 8 - 3] = a;
@@ -353,25 +364,25 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
353
364
  a = !t && 1 == (e >> n & 1), o[n % 3 + i - 8 - 3][Math.floor(n / 3)] = a;
354
365
  }
355
366
  },
356
- S = function S(t, e) {
367
+ M = function M(t, e) {
357
368
  for (var r = n << 3 | e, a = s.getBCHTypeInfo(r), u = 0; u < 15; u += 1) {
358
- var c = !t && 1 == (a >> u & 1);
359
- u < 6 ? o[u][8] = c : u < 8 ? o[u + 1][8] = c : o[i - 15 + u][8] = c;
369
+ var h = !t && 1 == (a >> u & 1);
370
+ u < 6 ? o[u][8] = h : u < 8 ? o[u + 1][8] = h : o[i - 15 + u][8] = h;
360
371
  }
361
372
 
362
373
  for (u = 0; u < 15; u += 1) {
363
- c = !t && 1 == (a >> u & 1), u < 8 ? o[8][i - u - 1] = c : u < 9 ? o[8][15 - u - 1 + 1] = c : o[8][15 - u - 1] = c;
374
+ 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;
364
375
  }
365
376
 
366
377
  o[i - 8][8] = !t;
367
378
  },
368
379
  C = function C(t, e) {
369
- for (var r = -1, n = i - 1, a = 7, u = 0, c = s.getMaskFunction(e), h = i - 1; h > 0; h -= 2) {
370
- for (6 == h && (h -= 1);;) {
371
- for (var d = 0; d < 2; d += 1) {
372
- if (null == o[n][h - d]) {
373
- var l = !1;
374
- u < t.length && (l = 1 == (t[u] >>> a & 1)), c(n, h - d) && (l = !l), o[n][h - d] = l, -1 == (a -= 1) && (u += 1, a = 7);
380
+ for (var r = -1, n = i - 1, a = 7, u = 0, h = s.getMaskFunction(e), c = i - 1; c > 0; c -= 2) {
381
+ for (6 == c && (c -= 1);;) {
382
+ for (var l = 0; l < 2; l += 1) {
383
+ if (null == o[n][c - l]) {
384
+ var d = !1;
385
+ 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);
375
386
  }
376
387
  }
377
388
 
@@ -382,8 +393,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
382
393
  }
383
394
  }
384
395
  },
385
- P = function P(t, e, r) {
386
- for (var n = h.getRSBlocks(t, e), o = d(), i = 0; i < r.length; i += 1) {
396
+ A = function A(t, e, r) {
397
+ for (var n = c.getRSBlocks(t, e), o = l(), i = 0; i < r.length; i += 1) {
387
398
  var a = r[i];
388
399
  o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
389
400
  }
@@ -406,55 +417,55 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
406
417
 
407
418
  return function (t, e) {
408
419
  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) {
409
- var h = e[u].dataCount,
410
- d = e[u].totalCount - h;
411
- n = Math.max(n, h), o = Math.max(o, d), i[u] = new Array(h);
420
+ var c = e[u].dataCount,
421
+ l = e[u].totalCount - c;
422
+ n = Math.max(n, c), o = Math.max(o, l), i[u] = new Array(c);
412
423
 
413
- for (var l = 0; l < i[u].length; l += 1) {
414
- i[u][l] = 255 & t.getBuffer()[l + r];
424
+ for (var d = 0; d < i[u].length; d += 1) {
425
+ i[u][d] = 255 & t.getBuffer()[d + r];
415
426
  }
416
427
 
417
- r += h;
418
- var f = s.getErrorCorrectPolynomial(d),
419
- p = c(i[u], f.getLength() - 1).mod(f);
428
+ r += c;
429
+ var f = s.getErrorCorrectPolynomial(l),
430
+ g = h(i[u], f.getLength() - 1).mod(f);
420
431
 
421
- for (a[u] = new Array(f.getLength() - 1), l = 0; l < a[u].length; l += 1) {
422
- var g = l + p.getLength() - a[u].length;
423
- a[u][l] = g >= 0 ? p.getAt(g) : 0;
432
+ for (a[u] = new Array(f.getLength() - 1), d = 0; d < a[u].length; d += 1) {
433
+ var p = d + g.getLength() - a[u].length;
434
+ a[u][d] = p >= 0 ? g.getAt(p) : 0;
424
435
  }
425
436
  }
426
437
 
427
438
  var v = 0;
428
439
 
429
- for (l = 0; l < e.length; l += 1) {
430
- v += e[l].totalCount;
440
+ for (d = 0; d < e.length; d += 1) {
441
+ v += e[d].totalCount;
431
442
  }
432
443
 
433
- var y = new Array(v),
434
- w = 0;
444
+ var w = new Array(v),
445
+ y = 0;
435
446
 
436
- for (l = 0; l < n; l += 1) {
447
+ for (d = 0; d < n; d += 1) {
437
448
  for (u = 0; u < e.length; u += 1) {
438
- l < i[u].length && (y[w] = i[u][l], w += 1);
449
+ d < i[u].length && (w[y] = i[u][d], y += 1);
439
450
  }
440
451
  }
441
452
 
442
- for (l = 0; l < o; l += 1) {
453
+ for (d = 0; d < o; d += 1) {
443
454
  for (u = 0; u < e.length; u += 1) {
444
- l < a[u].length && (y[w] = a[u][l], w += 1);
455
+ d < a[u].length && (w[y] = a[u][d], y += 1);
445
456
  }
446
457
  }
447
458
 
448
- return y;
459
+ return w;
449
460
  }(o, n);
450
461
  };
451
462
 
452
- y.addData = function (t, e) {
463
+ w.addData = function (t, e) {
453
464
  var r = null;
454
465
 
455
466
  switch (e = e || "Byte") {
456
467
  case "Numeric":
457
- r = l(t);
468
+ r = d(t);
458
469
  break;
459
470
 
460
471
  case "Alphanumeric":
@@ -462,11 +473,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
462
473
  break;
463
474
 
464
475
  case "Byte":
465
- r = p(t);
476
+ r = g(t);
466
477
  break;
467
478
 
468
479
  case "Kanji":
469
- r = g(t);
480
+ r = p(t);
470
481
  break;
471
482
 
472
483
  default:
@@ -474,15 +485,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
474
485
  }
475
486
 
476
487
  v.push(r), u = null;
477
- }, y.isDark = function (t, e) {
488
+ }, w.isDark = function (t, e) {
478
489
  if (t < 0 || i <= t || e < 0 || i <= e) throw t + "," + e;
479
490
  return o[t][e];
480
- }, y.getModuleCount = function () {
491
+ }, w.getModuleCount = function () {
481
492
  return i;
482
- }, y.make = function () {
493
+ }, w.make = function () {
483
494
  if (r < 1) {
484
495
  for (var t = 1; t < 40; t++) {
485
- for (var e = h.getRSBlocks(t, n), o = d(), i = 0; i < v.length; i++) {
496
+ for (var e = c.getRSBlocks(t, n), o = l(), i = 0; i < v.length; i++) {
486
497
  var a = v[i];
487
498
  o.put(a.getMode(), 4), o.put(a.getLength(), s.getLengthInBits(a.getMode(), t)), a.write(o);
488
499
  }
@@ -499,33 +510,32 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
499
510
  r = t;
500
511
  }
501
512
 
502
- _(!1, function () {
513
+ m(!1, function () {
503
514
  for (var t = 0, e = 0, r = 0; r < 8; r += 1) {
504
- _(!0, r);
505
-
506
- var n = s.getLostPoint(y);
515
+ m(!0, r);
516
+ var n = s.getLostPoint(w);
507
517
  (0 == r || t > n) && (t = n, e = r);
508
518
  }
509
519
 
510
520
  return e;
511
521
  }());
512
- }, y.createTableTag = function (t, e) {
522
+ }, w.createTableTag = function (t, e) {
513
523
  t = t || 2;
514
524
  var r = "";
515
525
  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>";
516
526
 
517
- for (var n = 0; n < y.getModuleCount(); n += 1) {
527
+ for (var n = 0; n < w.getModuleCount(); n += 1) {
518
528
  r += "<tr>";
519
529
 
520
- for (var o = 0; o < y.getModuleCount(); o += 1) {
521
- 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 += y.isDark(n, o) ? "#000000" : "#ffffff", r += ";", r += '"/>';
530
+ for (var o = 0; o < w.getModuleCount(); o += 1) {
531
+ 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 += '"/>';
522
532
  }
523
533
 
524
534
  r += "</tr>";
525
535
  }
526
536
 
527
537
  return (r += "</tbody>") + "</table>";
528
- }, y.createSvgTag = function (t, e, r, n) {
538
+ }, w.createSvgTag = function (t, e, r, n) {
529
539
  var o = {};
530
540
  "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 ? {
531
541
  text: r
@@ -536,38 +546,38 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
536
546
  a,
537
547
  s,
538
548
  u,
539
- c = y.getModuleCount() * t + 2 * e,
540
- h = "";
549
+ h = w.getModuleCount() * t + 2 * e,
550
+ c = "";
541
551
 
542
- for (u = "l" + t + ",0 0," + t + " -" + t + ",0 0,-" + t + "z ", h += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"', h += o.scalable ? "" : ' width="' + c + 'px" height="' + c + 'px"', h += ' viewBox="0 0 ' + c + " " + c + '" ', h += ' preserveAspectRatio="xMinYMin meet"', h += n.text || r.text ? ' role="img" aria-labelledby="' + O([n.id, r.id].join(" ").trim()) + '"' : "", h += ">", h += n.text ? '<title id="' + O(n.id) + '">' + O(n.text) + "</title>" : "", h += r.text ? '<description id="' + O(r.id) + '">' + O(r.text) + "</description>" : "", h += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>', h += '<path d="', a = 0; a < y.getModuleCount(); a += 1) {
543
- for (s = a * t + e, i = 0; i < y.getModuleCount(); i += 1) {
544
- y.isDark(a, i) && (h += "M" + (i * t + e) + "," + s + u);
552
+ 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) {
553
+ for (s = a * t + e, i = 0; i < w.getModuleCount(); i += 1) {
554
+ w.isDark(a, i) && (c += "M" + (i * t + e) + "," + s + u);
545
555
  }
546
556
  }
547
557
 
548
- return (h += '" stroke="transparent" fill="black"/>') + "</svg>";
549
- }, y.createDataURL = function (t, e) {
558
+ return (c += '" stroke="transparent" fill="black"/>') + "</svg>";
559
+ }, w.createDataURL = function (t, e) {
550
560
  t = t || 2, e = void 0 === e ? 4 * t : e;
551
- var r = y.getModuleCount() * t + 2 * e,
561
+ var r = w.getModuleCount() * t + 2 * e,
552
562
  n = e,
553
563
  o = r - e;
554
- return w(r, r, function (e, r) {
564
+ return y(r, r, function (e, r) {
555
565
  if (n <= e && e < o && n <= r && r < o) {
556
566
  var i = Math.floor((e - n) / t),
557
567
  a = Math.floor((r - n) / t);
558
- return y.isDark(a, i) ? 0 : 1;
568
+ return w.isDark(a, i) ? 0 : 1;
559
569
  }
560
570
 
561
571
  return 1;
562
572
  });
563
- }, y.createImgTag = function (t, e, r) {
573
+ }, w.createImgTag = function (t, e, r) {
564
574
  t = t || 2, e = void 0 === e ? 4 * t : e;
565
- var n = y.getModuleCount() * t + 2 * e,
575
+ var n = w.getModuleCount() * t + 2 * e,
566
576
  o = "";
567
- return o += "<img", o += ' src="', o += y.createDataURL(t, e), o += '"', o += ' width="', o += n, o += '"', o += ' height="', o += n, o += '"', r && (o += ' alt="', o += O(r), o += '"'), o + "/>";
577
+ 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 + "/>";
568
578
  };
569
579
 
570
- var O = function O(t) {
580
+ var k = function k(t) {
571
581
  for (var e = "", r = 0; r < t.length; r += 1) {
572
582
  var n = t.charAt(r);
573
583
 
@@ -596,7 +606,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
596
606
  return e;
597
607
  };
598
608
 
599
- return y.createASCII = function (t, e) {
609
+ return w.createASCII = function (t, e) {
600
610
  if ((t = t || 1) < 2) return function (t) {
601
611
  t = void 0 === t ? 2 : t;
602
612
  var e,
@@ -604,66 +614,66 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
604
614
  n,
605
615
  o,
606
616
  i,
607
- a = 1 * y.getModuleCount() + 2 * t,
617
+ a = 1 * w.getModuleCount() + 2 * t,
608
618
  s = t,
609
619
  u = a - t,
610
- c = {
620
+ h = {
611
621
  "██": "█",
612
622
  "█ ": "▀",
613
623
  " █": "▄",
614
624
  " ": " "
615
625
  },
616
- h = {
626
+ c = {
617
627
  "██": "▀",
618
628
  "█ ": "▀",
619
629
  " █": " ",
620
630
  " ": " "
621
631
  },
622
- d = "";
632
+ l = "";
623
633
 
624
634
  for (e = 0; e < a; e += 2) {
625
635
  for (n = Math.floor((e - s) / 1), o = Math.floor((e + 1 - s) / 1), r = 0; r < a; r += 1) {
626
- i = "█", s <= r && r < u && s <= e && e < u && y.isDark(n, Math.floor((r - s) / 1)) && (i = " "), s <= r && r < u && s <= e + 1 && e + 1 < u && y.isDark(o, Math.floor((r - s) / 1)) ? i += " " : i += "█", d += t < 1 && e + 1 >= u ? h[i] : c[i];
636
+ 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];
627
637
  }
628
638
 
629
- d += "\n";
639
+ l += "\n";
630
640
  }
631
641
 
632
- return a % 2 && t > 0 ? d.substring(0, d.length - a - 1) + Array(a + 1).join("▀") : d.substring(0, d.length - 1);
642
+ return a % 2 && t > 0 ? l.substring(0, l.length - a - 1) + Array(a + 1).join("▀") : l.substring(0, l.length - 1);
633
643
  }(e);
634
644
  t -= 1, e = void 0 === e ? 2 * t : e;
635
645
  var r,
636
646
  n,
637
647
  o,
638
648
  i,
639
- a = y.getModuleCount() * t + 2 * e,
649
+ a = w.getModuleCount() * t + 2 * e,
640
650
  s = e,
641
651
  u = a - e,
642
- c = Array(t + 1).join("██"),
643
- h = Array(t + 1).join(" "),
644
- d = "",
645
- l = "";
652
+ h = Array(t + 1).join("██"),
653
+ c = Array(t + 1).join(" "),
654
+ l = "",
655
+ d = "";
646
656
 
647
657
  for (r = 0; r < a; r += 1) {
648
- for (o = Math.floor((r - s) / t), l = "", n = 0; n < a; n += 1) {
649
- i = 1, s <= n && n < u && s <= r && r < u && y.isDark(o, Math.floor((n - s) / t)) && (i = 0), l += i ? c : h;
658
+ for (o = Math.floor((r - s) / t), d = "", n = 0; n < a; n += 1) {
659
+ i = 1, s <= n && n < u && s <= r && r < u && w.isDark(o, Math.floor((n - s) / t)) && (i = 0), d += i ? h : c;
650
660
  }
651
661
 
652
662
  for (o = 0; o < t; o += 1) {
653
- d += l + "\n";
663
+ l += d + "\n";
654
664
  }
655
665
  }
656
666
 
657
- return d.substring(0, d.length - 1);
658
- }, y.renderTo2dContext = function (t, e) {
667
+ return l.substring(0, l.length - 1);
668
+ }, w.renderTo2dContext = function (t, e) {
659
669
  e = e || 2;
660
670
 
661
- for (var r = y.getModuleCount(), n = 0; n < r; n++) {
671
+ for (var r = w.getModuleCount(), n = 0; n < r; n++) {
662
672
  for (var o = 0; o < r; o++) {
663
- t.fillStyle = y.isDark(n, o) ? "black" : "white", t.fillRect(n * e, o * e, e, e);
673
+ t.fillStyle = w.isDark(n, o) ? "black" : "white", t.fillRect(n * e, o * e, e, e);
664
674
  }
665
675
  }
666
- }, y;
676
+ }, w;
667
677
  };
668
678
 
669
679
  t.stringToBytes = (t.stringToBytesFuncs = {
@@ -677,7 +687,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
677
687
  }
678
688
  })["default"], t.createStringToBytes = function (t, e) {
679
689
  var r = function () {
680
- for (var r = y(t), n = function n() {
690
+ for (var r = w(t), n = function n() {
681
691
  var t = r.read();
682
692
  if (-1 == t) throw "eof";
683
693
  return t;
@@ -784,8 +794,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
784
794
  throw "bad maskPattern:" + t;
785
795
  }
786
796
  }, o.getErrorCorrectPolynomial = function (t) {
787
- for (var e = c([1], 0), r = 0; r < t; r += 1) {
788
- e = e.multiply(c([1, u.gexp(r)], 0));
797
+ for (var e = h([1], 0), r = 0; r < t; r += 1) {
798
+ e = e.multiply(h([1, u.gexp(r)], 0));
789
799
  }
790
800
 
791
801
  return e;
@@ -853,8 +863,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
853
863
 
854
864
  for (n = 0; n < e - 1; n += 1) {
855
865
  for (o = 0; o < e - 1; o += 1) {
856
- var c = 0;
857
- t.isDark(n, o) && (c += 1), t.isDark(n + 1, o) && (c += 1), t.isDark(n, o + 1) && (c += 1), t.isDark(n + 1, o + 1) && (c += 1), 0 != c && 4 != c || (r += 3);
866
+ var h = 0;
867
+ 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);
858
868
  }
859
869
  }
860
870
 
@@ -870,15 +880,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
870
880
  }
871
881
  }
872
882
 
873
- var h = 0;
883
+ var c = 0;
874
884
 
875
885
  for (o = 0; o < e; o += 1) {
876
886
  for (n = 0; n < e; n += 1) {
877
- t.isDark(n, o) && (h += 1);
887
+ t.isDark(n, o) && (c += 1);
878
888
  }
879
889
  }
880
890
 
881
- return r + Math.abs(100 * h / e / e - 50) / 5 * 10;
891
+ return r + Math.abs(100 * c / e / e - 50) / 5 * 10;
882
892
  }, o),
883
893
  u = function () {
884
894
  for (var t = new Array(256), e = new Array(256), r = 0; r < 8; r += 1) {
@@ -912,7 +922,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
912
922
  };
913
923
  }();
914
924
 
915
- function c(t, e) {
925
+ function h(t, e) {
916
926
  if (void 0 === t.length) throw t.length + "/" + e;
917
927
 
918
928
  var r = function () {
@@ -940,7 +950,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
940
950
  }
941
951
  }
942
952
 
943
- return c(e, 0);
953
+ return h(e, 0);
944
954
  },
945
955
  mod: function mod(t) {
946
956
  if (n.getLength() - t.getLength() < 0) return n;
@@ -953,14 +963,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
953
963
  r[o] ^= u.gexp(u.glog(t.getAt(o)) + e);
954
964
  }
955
965
 
956
- return c(r, 0).mod(t);
966
+ return h(r, 0).mod(t);
957
967
  }
958
968
  };
959
969
 
960
970
  return n;
961
971
  }
962
972
 
963
- var h = function () {
973
+ var c = function () {
964
974
  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]],
965
975
  e = function e(t, _e) {
966
976
  var r = {};
@@ -990,8 +1000,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
990
1000
  if (void 0 === o) throw "bad rs block @ typeNumber:" + r + "/errorCorrectionLevel:" + n;
991
1001
 
992
1002
  for (var i = o.length / 3, s = [], u = 0; u < i; u += 1) {
993
- for (var c = o[3 * u + 0], h = o[3 * u + 1], d = o[3 * u + 2], l = 0; l < c; l += 1) {
994
- s.push(e(h, d));
1003
+ for (var h = o[3 * u + 0], c = o[3 * u + 1], l = o[3 * u + 2], d = 0; d < h; d += 1) {
1004
+ s.push(e(c, l));
995
1005
  }
996
1006
  }
997
1007
 
@@ -1001,7 +1011,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1001
1011
 
1002
1012
  return r;
1003
1013
  }(),
1004
- d = function d() {
1014
+ l = function l() {
1005
1015
  var t = [],
1006
1016
  e = 0,
1007
1017
  r = {
@@ -1027,7 +1037,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1027
1037
  };
1028
1038
  return r;
1029
1039
  },
1030
- l = function l(t) {
1040
+ d = function d(t) {
1031
1041
  var e = t,
1032
1042
  r = {
1033
1043
  getMode: function getMode() {
@@ -1114,7 +1124,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1114
1124
 
1115
1125
  return r;
1116
1126
  },
1117
- p = function p(e) {
1127
+ g = function g(e) {
1118
1128
  var r = t.stringToBytes(e);
1119
1129
  return {
1120
1130
  getMode: function getMode() {
@@ -1130,7 +1140,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1130
1140
  }
1131
1141
  };
1132
1142
  },
1133
- g = function g(e) {
1143
+ p = function p(e) {
1134
1144
  var r = t.stringToBytesFuncs.SJIS;
1135
1145
  if (!r) throw "sjis not supported.";
1136
1146
  !function (t, e) {
@@ -1196,7 +1206,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1196
1206
  };
1197
1207
  return e;
1198
1208
  },
1199
- y = function y(t) {
1209
+ w = function w(t) {
1200
1210
  var e = t,
1201
1211
  r = 0,
1202
1212
  n = 0,
@@ -1229,7 +1239,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1229
1239
 
1230
1240
  return i;
1231
1241
  },
1232
- w = function w(t, e, r) {
1242
+ y = function y(t, e, r) {
1233
1243
  for (var n = function (t, e) {
1234
1244
  var r = t,
1235
1245
  n = e,
@@ -1257,33 +1267,33 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1257
1267
 
1258
1268
  i.add(String.fromCharCode(e)), i.add(String.fromCharCode(r));
1259
1269
  var u,
1260
- c,
1261
1270
  h,
1262
- d = v(),
1263
- l = (u = d, c = 0, h = 0, {
1271
+ c,
1272
+ l = v(),
1273
+ d = (u = l, h = 0, c = 0, {
1264
1274
  write: function write(t, e) {
1265
1275
  if (t >>> e != 0) throw "length over";
1266
1276
 
1267
- for (; c + e >= 8;) {
1268
- u.writeByte(255 & (t << c | h)), e -= 8 - c, t >>>= 8 - c, h = 0, c = 0;
1277
+ for (; h + e >= 8;) {
1278
+ u.writeByte(255 & (t << h | c)), e -= 8 - h, t >>>= 8 - h, c = 0, h = 0;
1269
1279
  }
1270
1280
 
1271
- h |= t << c, c += e;
1281
+ c |= t << h, h += e;
1272
1282
  },
1273
1283
  flush: function flush() {
1274
- c > 0 && u.writeByte(h);
1284
+ h > 0 && u.writeByte(c);
1275
1285
  }
1276
1286
  });
1277
- l.write(e, n);
1287
+ d.write(e, n);
1278
1288
  var f = 0,
1279
- p = String.fromCharCode(o[f]);
1289
+ g = String.fromCharCode(o[f]);
1280
1290
 
1281
1291
  for (f += 1; f < o.length;) {
1282
- var g = String.fromCharCode(o[f]);
1283
- f += 1, i.contains(p + g) ? p += g : (l.write(i.indexOf(p), n), i.size() < 4095 && (i.size() == 1 << n && (n += 1), i.add(p + g)), p = g);
1292
+ var p = String.fromCharCode(o[f]);
1293
+ 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);
1284
1294
  }
1285
1295
 
1286
- return l.write(i.indexOf(p), n), l.write(r, n), l.flush(), d.toByteArray();
1296
+ return d.write(i.indexOf(g), n), d.write(r, n), d.flush(), l.toByteArray();
1287
1297
  },
1288
1298
  s = function s() {
1289
1299
  var t = {},
@@ -1347,8 +1357,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1347
1357
  }, o.toString = function () {
1348
1358
  return n;
1349
1359
  }, o;
1350
- }(), u = a.toByteArray(), c = 0; c < u.length; c += 1) {
1351
- s.writeByte(u[c]);
1360
+ }(), u = a.toByteArray(), h = 0; h < u.length; h += 1) {
1361
+ s.writeByte(u[h]);
1352
1362
  }
1353
1363
 
1354
1364
  return s.flush(), "data:image/gif;base64," + s;
@@ -1370,12 +1380,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1370
1380
  return o;
1371
1381
  }) ? r.apply(e, []) : r) || (t.exports = n);
1372
1382
  },
1373
- 796: function _(t, e, r) {
1383
+ 676: function _(t, e, r) {
1374
1384
  "use strict";
1375
1385
 
1376
1386
  r.d(e, {
1377
1387
  "default": function _default() {
1378
- return W;
1388
+ return q;
1379
1389
  }
1380
1390
  });
1381
1391
 
@@ -1430,49 +1440,148 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1430
1440
  }
1431
1441
 
1432
1442
  function u(t) {
1433
- var e = t.originalHeight,
1434
- r = t.originalWidth,
1435
- n = t.maxHiddenDots,
1436
- o = t.maxHiddenAxisDots,
1437
- i = t.dotSize,
1438
- a = {
1439
- x: 0,
1440
- y: 0
1441
- },
1442
- s = {
1443
- x: 0,
1444
- y: 0
1445
- };
1446
- if (e <= 0 || r <= 0 || n <= 0 || i <= 0) return {
1447
- height: 0,
1448
- width: 0,
1449
- hideYDots: 0,
1450
- hideXDots: 0
1451
- };
1452
- var u = e / r;
1453
- 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)), {
1454
- height: s.y,
1455
- width: s.x,
1456
- hideYDots: a.y,
1457
- hideXDots: a.x
1458
- };
1443
+ return e = this, r = void 0, o = function o() {
1444
+ return function (t, e) {
1445
+ var r,
1446
+ n,
1447
+ o,
1448
+ i,
1449
+ a = {
1450
+ label: 0,
1451
+ sent: function sent() {
1452
+ if (1 & o[0]) throw o[1];
1453
+ return o[1];
1454
+ },
1455
+ trys: [],
1456
+ ops: []
1457
+ };
1458
+ return i = {
1459
+ next: s(0),
1460
+ "throw": s(1),
1461
+ "return": s(2)
1462
+ }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
1463
+ return this;
1464
+ }), i;
1465
+
1466
+ function s(i) {
1467
+ return function (s) {
1468
+ return function (i) {
1469
+ if (r) throw new TypeError("Generator is already executing.");
1470
+
1471
+ for (; a;) {
1472
+ try {
1473
+ 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;
1474
+
1475
+ switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
1476
+ case 0:
1477
+ case 1:
1478
+ o = i;
1479
+ break;
1480
+
1481
+ case 4:
1482
+ return a.label++, {
1483
+ value: i[1],
1484
+ done: !1
1485
+ };
1486
+
1487
+ case 5:
1488
+ a.label++, n = i[1], i = [0];
1489
+ continue;
1490
+
1491
+ case 7:
1492
+ i = a.ops.pop(), a.trys.pop();
1493
+ continue;
1494
+
1495
+ default:
1496
+ if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
1497
+ a = 0;
1498
+ continue;
1499
+ }
1500
+
1501
+ if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
1502
+ a.label = i[1];
1503
+ break;
1504
+ }
1505
+
1506
+ if (6 === i[0] && a.label < o[1]) {
1507
+ a.label = o[1], o = i;
1508
+ break;
1509
+ }
1510
+
1511
+ if (o && a.label < o[2]) {
1512
+ a.label = o[2], a.ops.push(i);
1513
+ break;
1514
+ }
1515
+
1516
+ o[2] && a.ops.pop(), a.trys.pop();
1517
+ continue;
1518
+ }
1519
+
1520
+ i = e.call(t, a);
1521
+ } catch (t) {
1522
+ i = [6, t], n = 0;
1523
+ } finally {
1524
+ r = o = 0;
1525
+ }
1526
+ }
1527
+
1528
+ if (5 & i[0]) throw i[1];
1529
+ return {
1530
+ value: i[0] ? i[1] : void 0,
1531
+ done: !0
1532
+ };
1533
+ }([i, s]);
1534
+ };
1535
+ }
1536
+ }(this, function (e) {
1537
+ return [2, new Promise(function (e) {
1538
+ var r = new XMLHttpRequest();
1539
+ r.onload = function () {
1540
+ var t = new FileReader();
1541
+ t.onloadend = function () {
1542
+ e(t.result);
1543
+ }, t.readAsDataURL(r.response);
1544
+ }, r.open("GET", t), r.responseType = "blob", r.send();
1545
+ })];
1546
+ });
1547
+ }, new ((n = void 0) || (n = Promise))(function (t, i) {
1548
+ function a(t) {
1549
+ try {
1550
+ u(o.next(t));
1551
+ } catch (t) {
1552
+ i(t);
1553
+ }
1554
+ }
1555
+
1556
+ function s(t) {
1557
+ try {
1558
+ u(o["throw"](t));
1559
+ } catch (t) {
1560
+ i(t);
1561
+ }
1562
+ }
1563
+
1564
+ function u(e) {
1565
+ var r;
1566
+ e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
1567
+ t(r);
1568
+ })).then(a, s);
1569
+ }
1570
+
1571
+ u((o = o.apply(e, r || [])).next());
1572
+ });
1573
+ var e, r, n, o;
1459
1574
  }
1460
1575
 
1461
- var c = {
1576
+ var h = {
1462
1577
  L: .07,
1463
1578
  M: .15,
1464
1579
  Q: .25,
1465
1580
  H: .3
1466
- },
1467
- h = "dots",
1468
- d = "rounded",
1469
- l = "classy",
1470
- f = "classy-rounded",
1471
- p = "square",
1472
- g = "extra-rounded";
1473
-
1474
- var _v = function v() {
1475
- return (_v = Object.assign || function (t) {
1581
+ };
1582
+
1583
+ var _c = function c() {
1584
+ return (_c = Object.assign || function (t) {
1476
1585
  for (var e, r = 1, n = arguments.length; r < n; r++) {
1477
1586
  for (var o in e = arguments[r]) {
1478
1587
  Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
@@ -1483,39 +1592,38 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1483
1592
  }).apply(this, arguments);
1484
1593
  };
1485
1594
 
1486
- var y = function () {
1595
+ var l = function () {
1487
1596
  function t(t) {
1488
- var e = t.context,
1597
+ var e = t.svg,
1489
1598
  r = t.type;
1490
- this._context = e, this._type = r;
1599
+ this._svg = e, this._type = r;
1491
1600
  }
1492
1601
 
1493
1602
  return t.prototype.draw = function (t, e, r, n) {
1494
- var o,
1495
- i = this._context;
1603
+ var o;
1496
1604
 
1497
1605
  switch (this._type) {
1498
- case h:
1606
+ case "dots":
1499
1607
  o = this._drawDot;
1500
1608
  break;
1501
1609
 
1502
- case l:
1610
+ case "classy":
1503
1611
  o = this._drawClassy;
1504
1612
  break;
1505
1613
 
1506
- case f:
1614
+ case "classy-rounded":
1507
1615
  o = this._drawClassyRounded;
1508
1616
  break;
1509
1617
 
1510
- case d:
1618
+ case "rounded":
1511
1619
  o = this._drawRounded;
1512
1620
  break;
1513
1621
 
1514
- case g:
1622
+ case "extra-rounded":
1515
1623
  o = this._drawExtraRounded;
1516
1624
  break;
1517
1625
 
1518
- case p:
1626
+ case "square":
1519
1627
  default:
1520
1628
  o = this._drawSquare;
1521
1629
  }
@@ -1524,276 +1632,251 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1524
1632
  x: t,
1525
1633
  y: e,
1526
1634
  size: r,
1527
- context: i,
1528
1635
  getNeighbor: n
1529
1636
  });
1530
1637
  }, t.prototype._rotateFigure = function (t) {
1531
- var e = t.x,
1532
- r = t.y,
1533
- n = t.size,
1534
- o = t.context,
1638
+ var e,
1639
+ r = t.x,
1640
+ n = t.y,
1641
+ o = t.size,
1535
1642
  i = t.rotation,
1536
1643
  a = void 0 === i ? 0 : i,
1537
- s = t.draw,
1538
- u = e + n / 2,
1539
- c = r + n / 2;
1540
- o.translate(u, c), a && o.rotate(a), s(), o.closePath(), a && o.rotate(-a), o.translate(-u, -c);
1644
+ s = r + o / 2,
1645
+ u = n + o / 2;
1646
+ (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
1541
1647
  }, t.prototype._basicDot = function (t) {
1542
- var e = t.size,
1543
- r = t.context;
1648
+ var e = this,
1649
+ r = t.size,
1650
+ n = t.x,
1651
+ o = t.y;
1544
1652
 
1545
- this._rotateFigure(_v(_v({}, t), {
1653
+ this._rotateFigure(_c(_c({}, t), {
1546
1654
  draw: function draw() {
1547
- r.arc(0, 0, e / 2, 0, 2 * Math.PI);
1655
+ 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));
1548
1656
  }
1549
1657
  }));
1550
1658
  }, t.prototype._basicSquare = function (t) {
1551
- var e = t.size,
1552
- r = t.context;
1659
+ var e = this,
1660
+ r = t.size,
1661
+ n = t.x,
1662
+ o = t.y;
1553
1663
 
1554
- this._rotateFigure(_v(_v({}, t), {
1664
+ this._rotateFigure(_c(_c({}, t), {
1555
1665
  draw: function draw() {
1556
- r.rect(-e / 2, -e / 2, e, e);
1666
+ 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));
1557
1667
  }
1558
1668
  }));
1559
1669
  }, t.prototype._basicSideRounded = function (t) {
1560
- var e = t.size,
1561
- r = t.context;
1670
+ var e = this,
1671
+ r = t.size,
1672
+ n = t.x,
1673
+ o = t.y;
1562
1674
 
1563
- this._rotateFigure(_v(_v({}, t), {
1675
+ this._rotateFigure(_c(_c({}, t), {
1564
1676
  draw: function draw() {
1565
- r.arc(0, 0, e / 2, -Math.PI / 2, Math.PI / 2), r.lineTo(-e / 2, e / 2), r.lineTo(-e / 2, -e / 2), r.lineTo(0, -e / 2);
1677
+ 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);
1566
1678
  }
1567
1679
  }));
1568
1680
  }, t.prototype._basicCornerRounded = function (t) {
1569
- var e = t.size,
1570
- r = t.context;
1681
+ var e = this,
1682
+ r = t.size,
1683
+ n = t.x,
1684
+ o = t.y;
1571
1685
 
1572
- this._rotateFigure(_v(_v({}, t), {
1686
+ this._rotateFigure(_c(_c({}, t), {
1573
1687
  draw: function draw() {
1574
- r.arc(0, 0, e / 2, -Math.PI / 2, 0), r.lineTo(e / 2, e / 2), r.lineTo(-e / 2, e / 2), r.lineTo(-e / 2, -e / 2), r.lineTo(0, -e / 2);
1688
+ 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);
1575
1689
  }
1576
1690
  }));
1577
1691
  }, t.prototype._basicCornerExtraRounded = function (t) {
1578
- var e = t.size,
1579
- r = t.context;
1692
+ var e = this,
1693
+ r = t.size,
1694
+ n = t.x,
1695
+ o = t.y;
1580
1696
 
1581
- this._rotateFigure(_v(_v({}, t), {
1697
+ this._rotateFigure(_c(_c({}, t), {
1582
1698
  draw: function draw() {
1583
- r.arc(-e / 2, e / 2, e, -Math.PI / 2, 0), r.lineTo(-e / 2, e / 2), r.lineTo(-e / 2, -e / 2);
1699
+ 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);
1584
1700
  }
1585
1701
  }));
1586
1702
  }, t.prototype._basicCornersRounded = function (t) {
1587
- var e = t.size,
1588
- r = t.context;
1589
-
1590
- this._rotateFigure(_v(_v({}, t), {
1591
- draw: function draw() {
1592
- 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);
1593
- }
1594
- }));
1595
- }, t.prototype._basicCornersExtraRounded = function (t) {
1596
- var e = t.size,
1597
- r = t.context;
1703
+ var e = this,
1704
+ r = t.size,
1705
+ n = t.x,
1706
+ o = t.y;
1598
1707
 
1599
- this._rotateFigure(_v(_v({}, t), {
1708
+ this._rotateFigure(_c(_c({}, t), {
1600
1709
  draw: function draw() {
1601
- r.arc(-e / 2, e / 2, e, -Math.PI / 2, 0), r.arc(e / 2, -e / 2, e, Math.PI / 2, Math.PI);
1710
+ 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);
1602
1711
  }
1603
1712
  }));
1604
1713
  }, t.prototype._drawDot = function (t) {
1605
1714
  var e = t.x,
1606
1715
  r = t.y,
1607
- n = t.size,
1608
- o = t.context;
1716
+ n = t.size;
1609
1717
 
1610
1718
  this._basicDot({
1611
1719
  x: e,
1612
1720
  y: r,
1613
1721
  size: n,
1614
- context: o,
1615
1722
  rotation: 0
1616
1723
  });
1617
1724
  }, t.prototype._drawSquare = function (t) {
1618
1725
  var e = t.x,
1619
1726
  r = t.y,
1620
- n = t.size,
1621
- o = t.context;
1727
+ n = t.size;
1622
1728
 
1623
1729
  this._basicSquare({
1624
1730
  x: e,
1625
1731
  y: r,
1626
1732
  size: n,
1627
- context: o,
1628
1733
  rotation: 0
1629
1734
  });
1630
1735
  }, t.prototype._drawRounded = function (t) {
1631
1736
  var e = t.x,
1632
1737
  r = t.y,
1633
1738
  n = t.size,
1634
- o = t.context,
1635
- i = t.getNeighbor,
1636
- a = i ? +i(-1, 0) : 0,
1637
- s = i ? +i(1, 0) : 0,
1638
- u = i ? +i(0, -1) : 0,
1639
- c = i ? +i(0, 1) : 0,
1640
- h = a + s + u + c;
1739
+ o = t.getNeighbor,
1740
+ i = o ? +o(-1, 0) : 0,
1741
+ a = o ? +o(1, 0) : 0,
1742
+ s = o ? +o(0, -1) : 0,
1743
+ u = o ? +o(0, 1) : 0,
1744
+ h = i + a + s + u;
1641
1745
  if (0 !== h) {
1642
- if (h > 2 || a && s || u && c) this._basicSquare({
1746
+ if (h > 2 || i && a || s && u) this._basicSquare({
1643
1747
  x: e,
1644
1748
  y: r,
1645
1749
  size: n,
1646
- context: o,
1647
1750
  rotation: 0
1648
1751
  });else {
1649
1752
  if (2 === h) {
1650
- var d = 0;
1651
- return a && u ? d = Math.PI / 2 : u && s ? d = Math.PI : s && c && (d = -Math.PI / 2), void this._basicCornerRounded({
1753
+ var c = 0;
1754
+ return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerRounded({
1652
1755
  x: e,
1653
1756
  y: r,
1654
1757
  size: n,
1655
- context: o,
1656
- rotation: d
1758
+ rotation: c
1657
1759
  });
1658
1760
  }
1659
1761
 
1660
- if (1 === h) return d = 0, u ? d = Math.PI / 2 : s ? d = Math.PI : c && (d = -Math.PI / 2), void this._basicSideRounded({
1762
+ if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
1661
1763
  x: e,
1662
1764
  y: r,
1663
1765
  size: n,
1664
- context: o,
1665
- rotation: d
1766
+ rotation: c
1666
1767
  });
1667
1768
  }
1668
1769
  } else this._basicDot({
1669
1770
  x: e,
1670
1771
  y: r,
1671
1772
  size: n,
1672
- context: o,
1673
1773
  rotation: 0
1674
1774
  });
1675
1775
  }, t.prototype._drawExtraRounded = function (t) {
1676
1776
  var e = t.x,
1677
1777
  r = t.y,
1678
1778
  n = t.size,
1679
- o = t.context,
1680
- i = t.getNeighbor,
1681
- a = i ? +i(-1, 0) : 0,
1682
- s = i ? +i(1, 0) : 0,
1683
- u = i ? +i(0, -1) : 0,
1684
- c = i ? +i(0, 1) : 0,
1685
- h = a + s + u + c;
1779
+ o = t.getNeighbor,
1780
+ i = o ? +o(-1, 0) : 0,
1781
+ a = o ? +o(1, 0) : 0,
1782
+ s = o ? +o(0, -1) : 0,
1783
+ u = o ? +o(0, 1) : 0,
1784
+ h = i + a + s + u;
1686
1785
  if (0 !== h) {
1687
- if (h > 2 || a && s || u && c) this._basicSquare({
1786
+ if (h > 2 || i && a || s && u) this._basicSquare({
1688
1787
  x: e,
1689
1788
  y: r,
1690
1789
  size: n,
1691
- context: o,
1692
1790
  rotation: 0
1693
1791
  });else {
1694
1792
  if (2 === h) {
1695
- var d = 0;
1696
- return a && u ? d = Math.PI / 2 : u && s ? d = Math.PI : s && c && (d = -Math.PI / 2), void this._basicCornerExtraRounded({
1793
+ var c = 0;
1794
+ return i && s ? c = Math.PI / 2 : s && a ? c = Math.PI : a && u && (c = -Math.PI / 2), void this._basicCornerExtraRounded({
1697
1795
  x: e,
1698
1796
  y: r,
1699
1797
  size: n,
1700
- context: o,
1701
- rotation: d
1798
+ rotation: c
1702
1799
  });
1703
1800
  }
1704
1801
 
1705
- if (1 === h) return d = 0, u ? d = Math.PI / 2 : s ? d = Math.PI : c && (d = -Math.PI / 2), void this._basicSideRounded({
1802
+ if (1 === h) return c = 0, s ? c = Math.PI / 2 : a ? c = Math.PI : u && (c = -Math.PI / 2), void this._basicSideRounded({
1706
1803
  x: e,
1707
1804
  y: r,
1708
1805
  size: n,
1709
- context: o,
1710
- rotation: d
1806
+ rotation: c
1711
1807
  });
1712
1808
  }
1713
1809
  } else this._basicDot({
1714
1810
  x: e,
1715
1811
  y: r,
1716
1812
  size: n,
1717
- context: o,
1718
1813
  rotation: 0
1719
1814
  });
1720
1815
  }, t.prototype._drawClassy = function (t) {
1721
1816
  var e = t.x,
1722
1817
  r = t.y,
1723
1818
  n = t.size,
1724
- o = t.context,
1725
- i = t.getNeighbor,
1726
- a = i ? +i(-1, 0) : 0,
1727
- s = i ? +i(1, 0) : 0,
1728
- u = i ? +i(0, -1) : 0,
1729
- c = i ? +i(0, 1) : 0;
1730
- 0 !== a + s + u + c ? a || u ? s || c ? this._basicSquare({
1819
+ o = t.getNeighbor,
1820
+ i = o ? +o(-1, 0) : 0,
1821
+ a = o ? +o(1, 0) : 0,
1822
+ s = o ? +o(0, -1) : 0,
1823
+ u = o ? +o(0, 1) : 0;
1824
+ 0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
1731
1825
  x: e,
1732
1826
  y: r,
1733
1827
  size: n,
1734
- context: o,
1735
1828
  rotation: 0
1736
1829
  }) : this._basicCornerRounded({
1737
1830
  x: e,
1738
1831
  y: r,
1739
1832
  size: n,
1740
- context: o,
1741
1833
  rotation: Math.PI / 2
1742
1834
  }) : this._basicCornerRounded({
1743
1835
  x: e,
1744
1836
  y: r,
1745
1837
  size: n,
1746
- context: o,
1747
1838
  rotation: -Math.PI / 2
1748
1839
  }) : this._basicCornersRounded({
1749
1840
  x: e,
1750
1841
  y: r,
1751
1842
  size: n,
1752
- context: o,
1753
1843
  rotation: Math.PI / 2
1754
1844
  });
1755
1845
  }, t.prototype._drawClassyRounded = function (t) {
1756
1846
  var e = t.x,
1757
1847
  r = t.y,
1758
1848
  n = t.size,
1759
- o = t.context,
1760
- i = t.getNeighbor,
1761
- a = i ? +i(-1, 0) : 0,
1762
- s = i ? +i(1, 0) : 0,
1763
- u = i ? +i(0, -1) : 0,
1764
- c = i ? +i(0, 1) : 0;
1765
- 0 !== a + s + u + c ? a || u ? s || c ? this._basicSquare({
1849
+ o = t.getNeighbor,
1850
+ i = o ? +o(-1, 0) : 0,
1851
+ a = o ? +o(1, 0) : 0,
1852
+ s = o ? +o(0, -1) : 0,
1853
+ u = o ? +o(0, 1) : 0;
1854
+ 0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
1766
1855
  x: e,
1767
1856
  y: r,
1768
1857
  size: n,
1769
- context: o,
1770
1858
  rotation: 0
1771
1859
  }) : this._basicCornerExtraRounded({
1772
1860
  x: e,
1773
1861
  y: r,
1774
1862
  size: n,
1775
- context: o,
1776
1863
  rotation: Math.PI / 2
1777
1864
  }) : this._basicCornerExtraRounded({
1778
1865
  x: e,
1779
1866
  y: r,
1780
1867
  size: n,
1781
- context: o,
1782
1868
  rotation: -Math.PI / 2
1783
1869
  }) : this._basicCornersRounded({
1784
1870
  x: e,
1785
1871
  y: r,
1786
1872
  size: n,
1787
- context: o,
1788
1873
  rotation: Math.PI / 2
1789
1874
  });
1790
1875
  }, t;
1791
- }(),
1792
- w = "square",
1793
- _ = "extra-rounded";
1876
+ }();
1794
1877
 
1795
- var _m = function m() {
1796
- return (_m = Object.assign || function (t) {
1878
+ var _d = function d() {
1879
+ return (_d = Object.assign || function (t) {
1797
1880
  for (var e, r = 1, n = arguments.length; r < n; r++) {
1798
1881
  for (var o in e = arguments[r]) {
1799
1882
  Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
@@ -1804,23 +1887,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1804
1887
  }).apply(this, arguments);
1805
1888
  };
1806
1889
 
1807
- var b = function () {
1890
+ var f = function () {
1808
1891
  function t(t) {
1809
- var e = t.context,
1892
+ var e = t.svg,
1810
1893
  r = t.type;
1811
- this._context = e, this._type = r;
1894
+ this._svg = e, this._type = r;
1812
1895
  }
1813
1896
 
1814
1897
  return t.prototype.draw = function (t, e, r, n) {
1815
- var o,
1816
- i = this._context;
1898
+ var o;
1817
1899
 
1818
1900
  switch (this._type) {
1819
- case w:
1901
+ case "square":
1820
1902
  o = this._drawSquare;
1821
1903
  break;
1822
1904
 
1823
- case _:
1905
+ case "extra-rounded":
1824
1906
  o = this._drawExtraRounded;
1825
1907
  break;
1826
1908
 
@@ -1833,98 +1915,95 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1833
1915
  x: t,
1834
1916
  y: e,
1835
1917
  size: r,
1836
- context: i,
1837
1918
  rotation: n
1838
1919
  });
1839
1920
  }, t.prototype._rotateFigure = function (t) {
1840
- var e = t.x,
1841
- r = t.y,
1842
- n = t.size,
1843
- o = t.context,
1921
+ var e,
1922
+ r = t.x,
1923
+ n = t.y,
1924
+ o = t.size,
1844
1925
  i = t.rotation,
1845
1926
  a = void 0 === i ? 0 : i,
1846
- s = t.draw,
1847
- u = e + n / 2,
1848
- c = r + n / 2;
1849
- o.translate(u, c), a && o.rotate(a), s(), o.closePath(), a && o.rotate(-a), o.translate(-u, -c);
1927
+ s = r + o / 2,
1928
+ u = n + o / 2;
1929
+ (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
1850
1930
  }, t.prototype._basicDot = function (t) {
1851
- var e = t.size,
1852
- r = t.context,
1853
- n = e / 7;
1931
+ var e = this,
1932
+ r = t.size,
1933
+ n = t.x,
1934
+ o = t.y,
1935
+ i = r / 7;
1854
1936
 
1855
- this._rotateFigure(_m(_m({}, t), {
1937
+ this._rotateFigure(_d(_d({}, t), {
1856
1938
  draw: function draw() {
1857
- r.arc(0, 0, e / 2, 0, 2 * Math.PI), r.arc(0, 0, e / 2 - n, 0, 2 * Math.PI);
1939
+ 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");
1858
1940
  }
1859
1941
  }));
1860
1942
  }, t.prototype._basicSquare = function (t) {
1861
- var e = t.size,
1862
- r = t.context,
1863
- n = e / 7;
1943
+ var e = this,
1944
+ r = t.size,
1945
+ n = t.x,
1946
+ o = t.y,
1947
+ i = r / 7;
1864
1948
 
1865
- this._rotateFigure(_m(_m({}, t), {
1949
+ this._rotateFigure(_d(_d({}, t), {
1866
1950
  draw: function draw() {
1867
- r.rect(-e / 2, -e / 2, e, e), r.rect(-e / 2 + n, -e / 2 + n, e - 2 * n, e - 2 * n);
1951
+ 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");
1868
1952
  }
1869
1953
  }));
1870
1954
  }, t.prototype._basicExtraRounded = function (t) {
1871
- var e = t.size,
1872
- r = t.context,
1873
- n = e / 7;
1955
+ var e = this,
1956
+ r = t.size,
1957
+ n = t.x,
1958
+ o = t.y,
1959
+ i = r / 7;
1874
1960
 
1875
- this._rotateFigure(_m(_m({}, t), {
1961
+ this._rotateFigure(_d(_d({}, t), {
1876
1962
  draw: function draw() {
1877
- r.arc(-n, -n, 2.5 * n, Math.PI, -Math.PI / 2), r.lineTo(n, -3.5 * n), r.arc(n, -n, 2.5 * n, -Math.PI / 2, 0), r.lineTo(3.5 * n, -n), r.arc(n, n, 2.5 * n, 0, Math.PI / 2), r.lineTo(-n, 3.5 * n), r.arc(-n, n, 2.5 * n, Math.PI / 2, Math.PI), r.lineTo(-3.5 * n, -n), r.arc(-n, -n, 1.5 * n, Math.PI, -Math.PI / 2), r.lineTo(n, -2.5 * n), r.arc(n, -n, 1.5 * n, -Math.PI / 2, 0), r.lineTo(2.5 * n, -n), r.arc(n, n, 1.5 * n, 0, Math.PI / 2), r.lineTo(-n, 2.5 * n), r.arc(-n, n, 1.5 * n, Math.PI / 2, Math.PI), r.lineTo(-2.5 * n, -n);
1963
+ 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);
1878
1964
  }
1879
1965
  }));
1880
1966
  }, t.prototype._drawDot = function (t) {
1881
1967
  var e = t.x,
1882
1968
  r = t.y,
1883
1969
  n = t.size,
1884
- o = t.context,
1885
- i = t.rotation;
1970
+ o = t.rotation;
1886
1971
 
1887
1972
  this._basicDot({
1888
1973
  x: e,
1889
1974
  y: r,
1890
1975
  size: n,
1891
- context: o,
1892
- rotation: i
1976
+ rotation: o
1893
1977
  });
1894
1978
  }, t.prototype._drawSquare = function (t) {
1895
1979
  var e = t.x,
1896
1980
  r = t.y,
1897
1981
  n = t.size,
1898
- o = t.context,
1899
- i = t.rotation;
1982
+ o = t.rotation;
1900
1983
 
1901
1984
  this._basicSquare({
1902
1985
  x: e,
1903
1986
  y: r,
1904
1987
  size: n,
1905
- context: o,
1906
- rotation: i
1988
+ rotation: o
1907
1989
  });
1908
1990
  }, t.prototype._drawExtraRounded = function (t) {
1909
1991
  var e = t.x,
1910
1992
  r = t.y,
1911
1993
  n = t.size,
1912
- o = t.context,
1913
- i = t.rotation;
1994
+ o = t.rotation;
1914
1995
 
1915
1996
  this._basicExtraRounded({
1916
1997
  x: e,
1917
1998
  y: r,
1918
1999
  size: n,
1919
- context: o,
1920
- rotation: i
2000
+ rotation: o
1921
2001
  });
1922
2002
  }, t;
1923
- }(),
1924
- x = "square";
2003
+ }();
1925
2004
 
1926
- var _M = function M() {
1927
- return (_M = Object.assign || function (t) {
2005
+ var _g = function g() {
2006
+ return (_g = Object.assign || function (t) {
1928
2007
  for (var e, r = 1, n = arguments.length; r < n; r++) {
1929
2008
  for (var o in e = arguments[r]) {
1930
2009
  Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
@@ -1935,19 +2014,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1935
2014
  }).apply(this, arguments);
1936
2015
  };
1937
2016
 
1938
- var S = function () {
2017
+ var p = function () {
1939
2018
  function t(t) {
1940
- var e = t.context,
2019
+ var e = t.svg,
1941
2020
  r = t.type;
1942
- this._context = e, this._type = r;
2021
+ this._svg = e, this._type = r;
1943
2022
  }
1944
2023
 
1945
2024
  return t.prototype.draw = function (t, e, r, n) {
1946
- var o,
1947
- i = this._context;
2025
+ var o;
1948
2026
 
1949
2027
  switch (this._type) {
1950
- case x:
2028
+ case "square":
1951
2029
  o = this._drawSquare;
1952
2030
  break;
1953
2031
 
@@ -1960,1041 +2038,193 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1960
2038
  x: t,
1961
2039
  y: e,
1962
2040
  size: r,
1963
- context: i,
1964
2041
  rotation: n
1965
2042
  });
1966
2043
  }, t.prototype._rotateFigure = function (t) {
1967
- var e = t.x,
1968
- r = t.y,
1969
- n = t.size,
1970
- o = t.context,
2044
+ var e,
2045
+ r = t.x,
2046
+ n = t.y,
2047
+ o = t.size,
1971
2048
  i = t.rotation,
1972
2049
  a = void 0 === i ? 0 : i,
1973
- s = t.draw,
1974
- u = e + n / 2,
1975
- c = r + n / 2;
1976
- o.translate(u, c), a && o.rotate(a), s(), o.closePath(), a && o.rotate(-a), o.translate(-u, -c);
2050
+ s = r + o / 2,
2051
+ u = n + o / 2;
2052
+ (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
1977
2053
  }, t.prototype._basicDot = function (t) {
1978
- var e = t.size,
1979
- r = t.context;
2054
+ var e = this,
2055
+ r = t.size,
2056
+ n = t.x,
2057
+ o = t.y;
1980
2058
 
1981
- this._rotateFigure(_M(_M({}, t), {
2059
+ this._rotateFigure(_g(_g({}, t), {
1982
2060
  draw: function draw() {
1983
- r.arc(0, 0, e / 2, 0, 2 * Math.PI);
2061
+ 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));
1984
2062
  }
1985
2063
  }));
1986
2064
  }, t.prototype._basicSquare = function (t) {
1987
- var e = t.size,
1988
- r = t.context;
2065
+ var e = this,
2066
+ r = t.size,
2067
+ n = t.x,
2068
+ o = t.y;
1989
2069
 
1990
- this._rotateFigure(_M(_M({}, t), {
2070
+ this._rotateFigure(_g(_g({}, t), {
1991
2071
  draw: function draw() {
1992
- r.rect(-e / 2, -e / 2, e, e);
2072
+ 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));
1993
2073
  }
1994
2074
  }));
1995
2075
  }, t.prototype._drawDot = function (t) {
1996
2076
  var e = t.x,
1997
2077
  r = t.y,
1998
2078
  n = t.size,
1999
- o = t.context,
2000
- i = t.rotation;
2079
+ o = t.rotation;
2001
2080
 
2002
2081
  this._basicDot({
2003
2082
  x: e,
2004
2083
  y: r,
2005
2084
  size: n,
2006
- context: o,
2007
- rotation: i
2085
+ rotation: o
2008
2086
  });
2009
2087
  }, t.prototype._drawSquare = function (t) {
2010
2088
  var e = t.x,
2011
2089
  r = t.y,
2012
2090
  n = t.size,
2013
- o = t.context,
2014
- i = t.rotation;
2091
+ o = t.rotation;
2015
2092
 
2016
2093
  this._basicSquare({
2017
2094
  x: e,
2018
2095
  y: r,
2019
2096
  size: n,
2020
- context: o,
2021
- rotation: i
2097
+ rotation: o
2022
2098
  });
2023
2099
  }, t;
2024
2100
  }(),
2025
- C = "radial";
2101
+ v = "circle";
2026
2102
 
2027
- var P = [[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]],
2028
- O = [[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]];
2103
+ var w = function w(t, e, r, n) {
2104
+ return new (r || (r = Promise))(function (o, i) {
2105
+ function a(t) {
2106
+ try {
2107
+ u(n.next(t));
2108
+ } catch (t) {
2109
+ i(t);
2110
+ }
2111
+ }
2029
2112
 
2030
- var z = function () {
2031
- function t(t) {
2032
- this._canvas = document.createElement("canvas"), this._canvas.width = t.width, this._canvas.height = t.height, this._options = t;
2033
- }
2113
+ function s(t) {
2114
+ try {
2115
+ u(n["throw"](t));
2116
+ } catch (t) {
2117
+ i(t);
2118
+ }
2119
+ }
2034
2120
 
2035
- return Object.defineProperty(t.prototype, "context", {
2036
- get: function get() {
2037
- return this._canvas.getContext("2d");
2038
- },
2039
- enumerable: !1,
2040
- configurable: !0
2041
- }), Object.defineProperty(t.prototype, "width", {
2042
- get: function get() {
2043
- return this._canvas.width;
2044
- },
2045
- enumerable: !1,
2046
- configurable: !0
2047
- }), Object.defineProperty(t.prototype, "height", {
2048
- get: function get() {
2049
- return this._canvas.height;
2121
+ function u(t) {
2122
+ var e;
2123
+ t.done ? o(t.value) : (e = t.value, e instanceof r ? e : new r(function (t) {
2124
+ t(e);
2125
+ })).then(a, s);
2126
+ }
2127
+
2128
+ u((n = n.apply(t, e || [])).next());
2129
+ });
2130
+ },
2131
+ y = function y(t, e) {
2132
+ var r,
2133
+ n,
2134
+ o,
2135
+ i,
2136
+ a = {
2137
+ label: 0,
2138
+ sent: function sent() {
2139
+ if (1 & o[0]) throw o[1];
2140
+ return o[1];
2050
2141
  },
2051
- enumerable: !1,
2052
- configurable: !0
2053
- }), t.prototype.getCanvas = function () {
2054
- return this._canvas;
2055
- }, t.prototype.clear = function () {
2056
- var t = this.context;
2057
- t && t.clearRect(0, 0, this._canvas.width, this._canvas.height);
2058
- }, t.prototype.drawQR = function (t) {
2059
- return e = this, r = void 0, o = function o() {
2060
- var e,
2061
- r,
2062
- n,
2063
- o,
2064
- i,
2065
- a,
2066
- s,
2067
- h,
2068
- d,
2069
- l = this;
2070
- return function (t, e) {
2071
- var r,
2072
- n,
2073
- o,
2074
- i,
2075
- a = {
2076
- label: 0,
2077
- sent: function sent() {
2078
- if (1 & o[0]) throw o[1];
2079
- return o[1];
2080
- },
2081
- trys: [],
2082
- ops: []
2083
- };
2084
- return i = {
2085
- next: s(0),
2086
- "throw": s(1),
2087
- "return": s(2)
2088
- }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
2089
- return this;
2090
- }), i;
2091
-
2092
- function s(i) {
2093
- return function (s) {
2094
- return function (i) {
2095
- if (r) throw new TypeError("Generator is already executing.");
2096
-
2097
- for (; a;) {
2098
- try {
2099
- 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;
2100
-
2101
- switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
2102
- case 0:
2103
- case 1:
2104
- o = i;
2105
- break;
2106
-
2107
- case 4:
2108
- return a.label++, {
2109
- value: i[1],
2110
- done: !1
2111
- };
2112
-
2113
- case 5:
2114
- a.label++, n = i[1], i = [0];
2115
- continue;
2116
-
2117
- case 7:
2118
- i = a.ops.pop(), a.trys.pop();
2119
- continue;
2120
-
2121
- default:
2122
- if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
2123
- a = 0;
2124
- continue;
2125
- }
2126
-
2127
- if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
2128
- a.label = i[1];
2129
- break;
2130
- }
2131
-
2132
- if (6 === i[0] && a.label < o[1]) {
2133
- a.label = o[1], o = i;
2134
- break;
2135
- }
2136
-
2137
- if (o && a.label < o[2]) {
2138
- a.label = o[2], a.ops.push(i);
2139
- break;
2140
- }
2141
-
2142
- o[2] && a.ops.pop(), a.trys.pop();
2143
- continue;
2144
- }
2145
-
2146
- i = e.call(t, a);
2147
- } catch (t) {
2148
- i = [6, t], n = 0;
2149
- } finally {
2150
- r = o = 0;
2151
- }
2152
- }
2153
-
2154
- if (5 & i[0]) throw i[1];
2155
- return {
2156
- value: i[0] ? i[1] : void 0,
2157
- done: !0
2158
- };
2159
- }([i, s]);
2160
- };
2161
- }
2162
- }(this, function (f) {
2163
- switch (f.label) {
2164
- case 0:
2165
- return e = t.getModuleCount(), r = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n = Math.floor(r / e), o = {
2166
- hideXDots: 0,
2167
- hideYDots: 0,
2168
- width: 0,
2169
- height: 0
2170
- }, this._qr = t, this._options.image ? [4, this.loadImage()] : [3, 2];
2171
-
2172
- case 1:
2173
- if (f.sent(), !this._image) return [2];
2174
- i = this._options, a = i.imageOptions, s = i.qrOptions, h = a.imageSize * c[s.errorCorrectionLevel], d = Math.floor(h * e * e), o = u({
2175
- originalWidth: this._image.width,
2176
- originalHeight: this._image.height,
2177
- maxHiddenDots: d,
2178
- maxHiddenAxisDots: e - 14,
2179
- dotSize: n
2180
- }), f.label = 2;
2181
-
2182
- case 2:
2183
- return this.clear(), this.drawBackground(), this.drawDots(function (t, r) {
2184
- var n, i, a, s, u, c;
2185
- 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]));
2186
- }), this.drawCorners(), this._options.image && this.drawImage({
2187
- width: o.width,
2188
- height: o.height,
2189
- count: e,
2190
- dotSize: n
2191
- }), [2];
2192
- }
2193
- });
2194
- }, new ((n = void 0) || (n = Promise))(function (t, i) {
2195
- function a(t) {
2196
- try {
2197
- u(o.next(t));
2198
- } catch (t) {
2199
- i(t);
2200
- }
2201
- }
2202
-
2203
- function s(t) {
2204
- try {
2205
- u(o["throw"](t));
2206
- } catch (t) {
2207
- i(t);
2208
- }
2209
- }
2210
-
2211
- function u(e) {
2212
- var r;
2213
- e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
2214
- t(r);
2215
- })).then(a, s);
2216
- }
2217
-
2218
- u((o = o.apply(e, r || [])).next());
2219
- });
2220
- var e, r, n, o;
2221
- }, t.prototype.drawBackground = function () {
2222
- var t = this.context,
2223
- e = this._options;
2224
-
2225
- if (t) {
2226
- if (e.backgroundOptions.gradient) {
2227
- var r = e.backgroundOptions.gradient,
2228
- n = this._createGradient({
2229
- context: t,
2230
- options: r,
2231
- additionalRotation: 0,
2232
- x: 0,
2233
- y: 0,
2234
- size: this._canvas.width > this._canvas.height ? this._canvas.width : this._canvas.height
2235
- });
2236
-
2237
- r.colorStops.forEach(function (t) {
2238
- var e = t.offset,
2239
- r = t.color;
2240
- n.addColorStop(e, r);
2241
- }), t.fillStyle = n;
2242
- } else e.backgroundOptions.color && (t.fillStyle = e.backgroundOptions.color);
2243
-
2244
- t.fillRect(0, 0, this._canvas.width, this._canvas.height);
2245
- }
2246
- }, t.prototype.drawDots = function (t) {
2247
- var e = this;
2248
- if (!this._qr) throw "QR code is not defined";
2249
- var r = this.context;
2250
- if (!r) throw "QR code is not defined";
2251
-
2252
- var n = this._options,
2253
- o = this._qr.getModuleCount();
2254
-
2255
- if (o > n.width || o > n.height) throw "The canvas is too small.";
2256
- var i = Math.min(n.width, n.height) - 2 * n.margin,
2257
- a = Math.floor(i / o),
2258
- s = Math.floor((n.width - o * a) / 2),
2259
- u = Math.floor((n.height - o * a) / 2),
2260
- c = new y({
2261
- context: r,
2262
- type: n.dotsOptions.type
2263
- });
2264
- r.beginPath();
2265
-
2266
- for (var h = function h(r) {
2267
- for (var n = function n(_n2) {
2268
- return t && !t(r, _n2) ? "continue" : d._qr.isDark(r, _n2) ? void c.draw(s + r * a, u + _n2 * a, a, function (i, a) {
2269
- 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);
2270
- }) : "continue";
2271
- }, i = 0; i < o; i++) {
2272
- n(i);
2273
- }
2274
- }, d = this, l = 0; l < o; l++) {
2275
- h(l);
2276
- }
2277
-
2278
- if (n.dotsOptions.gradient) {
2279
- var f = n.dotsOptions.gradient,
2280
- p = this._createGradient({
2281
- context: r,
2282
- options: f,
2283
- additionalRotation: 0,
2284
- x: s,
2285
- y: u,
2286
- size: o * a
2287
- });
2288
-
2289
- f.colorStops.forEach(function (t) {
2290
- var e = t.offset,
2291
- r = t.color;
2292
- p.addColorStop(e, r);
2293
- }), r.fillStyle = r.strokeStyle = p;
2294
- } else n.dotsOptions.color && (r.fillStyle = r.strokeStyle = n.dotsOptions.color);
2295
-
2296
- r.fill("evenodd");
2297
- }, t.prototype.drawCorners = function (t) {
2298
- var e = this;
2299
- if (!this._qr) throw "QR code is not defined";
2300
- var r = this.context;
2301
- if (!r) throw "QR code is not defined";
2302
-
2303
- var n = this._options,
2304
- o = this._qr.getModuleCount(),
2305
- i = Math.min(n.width, n.height) - 2 * n.margin,
2306
- a = Math.floor(i / o),
2307
- s = 7 * a,
2308
- u = 3 * a,
2309
- c = Math.floor((n.width - o * a) / 2),
2310
- h = Math.floor((n.height - o * a) / 2);
2311
-
2312
- [[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function (i) {
2313
- var d,
2314
- l,
2315
- f,
2316
- p,
2317
- g,
2318
- v,
2319
- w,
2320
- _,
2321
- m,
2322
- x,
2323
- M = i[0],
2324
- C = i[1],
2325
- z = i[2];
2326
-
2327
- if (!t || t(M, C)) {
2328
- var D = c + M * a * (o - 7),
2329
- I = h + C * a * (o - 7);
2330
-
2331
- if (null === (d = n.cornersSquareOptions) || void 0 === d ? void 0 : d.type) {
2332
- var A = new b({
2333
- context: r,
2334
- type: null === (l = n.cornersSquareOptions) || void 0 === l ? void 0 : l.type
2335
- });
2336
- r.beginPath(), A.draw(D, I, s, z);
2337
- } else {
2338
- var k = new y({
2339
- context: r,
2340
- type: n.dotsOptions.type
2341
- });
2342
- r.beginPath();
2343
-
2344
- for (var q = function q(t) {
2345
- for (var e = function e(_e2) {
2346
- if (!(null === (f = P[t]) || void 0 === f ? void 0 : f[_e2])) return "continue";
2347
- k.draw(D + t * a, I + _e2 * a, a, function (r, n) {
2348
- var o;
2349
- return !!(null === (o = P[t + r]) || void 0 === o ? void 0 : o[_e2 + n]);
2350
- });
2351
- }, r = 0; r < P[t].length; r++) {
2352
- e(r);
2353
- }
2354
- }, R = 0; R < P.length; R++) {
2355
- q(R);
2356
- }
2357
- }
2358
-
2359
- if (null === (p = n.cornersSquareOptions) || void 0 === p ? void 0 : p.gradient) {
2360
- var B = n.cornersSquareOptions.gradient,
2361
- E = e._createGradient({
2362
- context: r,
2363
- options: B,
2364
- additionalRotation: z,
2365
- x: D,
2366
- y: I,
2367
- size: s
2368
- });
2369
-
2370
- B.colorStops.forEach(function (t) {
2371
- var e = t.offset,
2372
- r = t.color;
2373
- E.addColorStop(e, r);
2374
- }), r.fillStyle = r.strokeStyle = E;
2375
- } else (null === (g = n.cornersSquareOptions) || void 0 === g ? void 0 : g.color) && (r.fillStyle = r.strokeStyle = n.cornersSquareOptions.color);
2376
-
2377
- if (r.fill("evenodd"), null === (v = n.cornersDotOptions) || void 0 === v ? void 0 : v.type) {
2378
- var L = new S({
2379
- context: r,
2380
- type: null === (w = n.cornersDotOptions) || void 0 === w ? void 0 : w.type
2381
- });
2382
- r.beginPath(), L.draw(D + 2 * a, I + 2 * a, u, z);
2383
- } else {
2384
- k = new y({
2385
- context: r,
2386
- type: n.dotsOptions.type
2387
- }), r.beginPath();
2388
-
2389
- var N = function N(t) {
2390
- for (var e = function e(_e3) {
2391
- if (!(null === (_ = O[t]) || void 0 === _ ? void 0 : _[_e3])) return "continue";
2392
- k.draw(D + t * a, I + _e3 * a, a, function (r, n) {
2393
- var o;
2394
- return !!(null === (o = O[t + r]) || void 0 === o ? void 0 : o[_e3 + n]);
2395
- });
2396
- }, r = 0; r < O[t].length; r++) {
2397
- e(r);
2398
- }
2399
- };
2400
-
2401
- for (R = 0; R < O.length; R++) {
2402
- N(R);
2403
- }
2404
- }
2405
-
2406
- if (null === (m = n.cornersDotOptions) || void 0 === m ? void 0 : m.gradient) {
2407
- B = n.cornersDotOptions.gradient;
2408
-
2409
- var T = e._createGradient({
2410
- context: r,
2411
- options: B,
2412
- additionalRotation: z,
2413
- x: D + 2 * a,
2414
- y: I + 2 * a,
2415
- size: u
2416
- });
2417
-
2418
- B.colorStops.forEach(function (t) {
2419
- var e = t.offset,
2420
- r = t.color;
2421
- T.addColorStop(e, r);
2422
- }), r.fillStyle = r.strokeStyle = T;
2423
- } else (null === (x = n.cornersDotOptions) || void 0 === x ? void 0 : x.color) && (r.fillStyle = r.strokeStyle = n.cornersDotOptions.color);
2424
-
2425
- r.fill("evenodd");
2426
- }
2427
- });
2428
- }, t.prototype.loadImage = function () {
2429
- var t = this;
2430
- return new Promise(function (e, r) {
2431
- var n = t._options,
2432
- o = new Image();
2433
- if (!n.image) return r("Image is not defined");
2434
- "string" == typeof n.imageOptions.crossOrigin && (o.crossOrigin = n.imageOptions.crossOrigin), t._image = o, o.onload = function () {
2435
- e();
2436
- }, o.src = n.image;
2437
- });
2438
- }, t.prototype.drawImage = function (t) {
2439
- var e = t.width,
2440
- r = t.height,
2441
- n = t.count,
2442
- o = t.dotSize,
2443
- i = this.context;
2444
- if (!i) throw "canvasContext is not defined";
2445
- if (!this._image) throw "image is not defined";
2446
- var a = this._options,
2447
- s = Math.floor((a.width - n * o) / 2),
2448
- u = Math.floor((a.height - n * o) / 2),
2449
- c = s + a.imageOptions.margin + (n * o - e) / 2,
2450
- h = u + a.imageOptions.margin + (n * o - r) / 2,
2451
- d = e - 2 * a.imageOptions.margin,
2452
- l = r - 2 * a.imageOptions.margin;
2453
- i.drawImage(this._image, c, h, d < 0 ? 0 : d, l < 0 ? 0 : l);
2454
- }, t.prototype._createGradient = function (t) {
2455
- var e,
2456
- r = t.context,
2457
- n = t.options,
2458
- o = t.additionalRotation,
2459
- i = t.x,
2460
- a = t.y,
2461
- s = t.size;
2462
- if (n.type === C) e = r.createRadialGradient(i + s / 2, a + s / 2, 0, i + s / 2, a + s / 2, s / 2);else {
2463
- var u = ((n.rotation || 0) + o) % (2 * Math.PI),
2464
- c = (u + 2 * Math.PI) % (2 * Math.PI),
2465
- h = i + s / 2,
2466
- d = a + s / 2,
2467
- l = i + s / 2,
2468
- f = a + s / 2;
2469
- 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));
2470
- }
2471
- return e;
2472
- }, t;
2473
- }();
2474
-
2475
- var _D = function D() {
2476
- return (_D = Object.assign || function (t) {
2477
- for (var e, r = 1, n = arguments.length; r < n; r++) {
2478
- for (var o in e = arguments[r]) {
2479
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
2480
- }
2481
- }
2482
-
2483
- return t;
2484
- }).apply(this, arguments);
2485
- };
2486
-
2487
- var I = function () {
2488
- function t(t) {
2489
- var e = t.svg,
2490
- r = t.type;
2491
- this._svg = e, this._type = r;
2492
- }
2493
-
2494
- return t.prototype.draw = function (t, e, r, n) {
2495
- var o;
2496
-
2497
- switch (this._type) {
2498
- case h:
2499
- o = this._drawDot;
2500
- break;
2501
-
2502
- case l:
2503
- o = this._drawClassy;
2504
- break;
2505
-
2506
- case f:
2507
- o = this._drawClassyRounded;
2508
- break;
2509
-
2510
- case d:
2511
- o = this._drawRounded;
2512
- break;
2513
-
2514
- case g:
2515
- o = this._drawExtraRounded;
2516
- break;
2517
-
2518
- case p:
2519
- default:
2520
- o = this._drawSquare;
2521
- }
2522
-
2523
- o.call(this, {
2524
- x: t,
2525
- y: e,
2526
- size: r,
2527
- getNeighbor: n
2528
- });
2529
- }, t.prototype._rotateFigure = function (t) {
2530
- var e,
2531
- r = t.x,
2532
- n = t.y,
2533
- o = t.size,
2534
- i = t.rotation,
2535
- a = void 0 === i ? 0 : i,
2536
- s = r + o / 2,
2537
- u = n + o / 2;
2538
- (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
2539
- }, t.prototype._basicDot = function (t) {
2540
- var e = this,
2541
- r = t.size,
2542
- n = t.x,
2543
- o = t.y;
2544
-
2545
- this._rotateFigure(_D(_D({}, t), {
2546
- draw: function draw() {
2547
- 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));
2548
- }
2549
- }));
2550
- }, t.prototype._basicSquare = function (t) {
2551
- var e = this,
2552
- r = t.size,
2553
- n = t.x,
2554
- o = t.y;
2555
-
2556
- this._rotateFigure(_D(_D({}, t), {
2557
- draw: function draw() {
2558
- 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));
2559
- }
2560
- }));
2561
- }, t.prototype._basicSideRounded = function (t) {
2562
- var e = this,
2563
- r = t.size,
2564
- n = t.x,
2565
- o = t.y;
2566
-
2567
- this._rotateFigure(_D(_D({}, t), {
2568
- draw: function draw() {
2569
- 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);
2570
- }
2571
- }));
2572
- }, t.prototype._basicCornerRounded = function (t) {
2573
- var e = this,
2574
- r = t.size,
2575
- n = t.x,
2576
- o = t.y;
2577
-
2578
- this._rotateFigure(_D(_D({}, t), {
2579
- draw: function draw() {
2580
- 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);
2581
- }
2582
- }));
2583
- }, t.prototype._basicCornerExtraRounded = function (t) {
2584
- var e = this,
2585
- r = t.size,
2586
- n = t.x,
2587
- o = t.y;
2588
-
2589
- this._rotateFigure(_D(_D({}, t), {
2590
- draw: function draw() {
2591
- 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);
2592
- }
2593
- }));
2594
- }, t.prototype._basicCornersRounded = function (t) {
2595
- var e = this,
2596
- r = t.size,
2597
- n = t.x,
2598
- o = t.y;
2599
-
2600
- this._rotateFigure(_D(_D({}, t), {
2601
- draw: function draw() {
2602
- 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);
2603
- }
2604
- }));
2605
- }, t.prototype._drawDot = function (t) {
2606
- var e = t.x,
2607
- r = t.y,
2608
- n = t.size;
2609
-
2610
- this._basicDot({
2611
- x: e,
2612
- y: r,
2613
- size: n,
2614
- rotation: 0
2615
- });
2616
- }, t.prototype._drawSquare = function (t) {
2617
- var e = t.x,
2618
- r = t.y,
2619
- n = t.size;
2620
-
2621
- this._basicSquare({
2622
- x: e,
2623
- y: r,
2624
- size: n,
2625
- rotation: 0
2626
- });
2627
- }, t.prototype._drawRounded = function (t) {
2628
- var e = t.x,
2629
- r = t.y,
2630
- n = t.size,
2631
- o = t.getNeighbor,
2632
- i = o ? +o(-1, 0) : 0,
2633
- a = o ? +o(1, 0) : 0,
2634
- s = o ? +o(0, -1) : 0,
2635
- u = o ? +o(0, 1) : 0,
2636
- c = i + a + s + u;
2637
- if (0 !== c) {
2638
- if (c > 2 || i && a || s && u) this._basicSquare({
2639
- x: e,
2640
- y: r,
2641
- size: n,
2642
- rotation: 0
2643
- });else {
2644
- if (2 === c) {
2645
- var h = 0;
2646
- return i && s ? h = Math.PI / 2 : s && a ? h = Math.PI : a && u && (h = -Math.PI / 2), void this._basicCornerRounded({
2647
- x: e,
2648
- y: r,
2649
- size: n,
2650
- rotation: h
2651
- });
2652
- }
2653
-
2654
- if (1 === c) return h = 0, s ? h = Math.PI / 2 : a ? h = Math.PI : u && (h = -Math.PI / 2), void this._basicSideRounded({
2655
- x: e,
2656
- y: r,
2657
- size: n,
2658
- rotation: h
2659
- });
2660
- }
2661
- } else this._basicDot({
2662
- x: e,
2663
- y: r,
2664
- size: n,
2665
- rotation: 0
2666
- });
2667
- }, t.prototype._drawExtraRounded = function (t) {
2668
- var e = t.x,
2669
- r = t.y,
2670
- n = t.size,
2671
- o = t.getNeighbor,
2672
- i = o ? +o(-1, 0) : 0,
2673
- a = o ? +o(1, 0) : 0,
2674
- s = o ? +o(0, -1) : 0,
2675
- u = o ? +o(0, 1) : 0,
2676
- c = i + a + s + u;
2677
- if (0 !== c) {
2678
- if (c > 2 || i && a || s && u) this._basicSquare({
2679
- x: e,
2680
- y: r,
2681
- size: n,
2682
- rotation: 0
2683
- });else {
2684
- if (2 === c) {
2685
- var h = 0;
2686
- return i && s ? h = Math.PI / 2 : s && a ? h = Math.PI : a && u && (h = -Math.PI / 2), void this._basicCornerExtraRounded({
2687
- x: e,
2688
- y: r,
2689
- size: n,
2690
- rotation: h
2691
- });
2692
- }
2693
-
2694
- if (1 === c) return h = 0, s ? h = Math.PI / 2 : a ? h = Math.PI : u && (h = -Math.PI / 2), void this._basicSideRounded({
2695
- x: e,
2696
- y: r,
2697
- size: n,
2698
- rotation: h
2699
- });
2700
- }
2701
- } else this._basicDot({
2702
- x: e,
2703
- y: r,
2704
- size: n,
2705
- rotation: 0
2706
- });
2707
- }, t.prototype._drawClassy = function (t) {
2708
- var e = t.x,
2709
- r = t.y,
2710
- n = t.size,
2711
- o = t.getNeighbor,
2712
- i = o ? +o(-1, 0) : 0,
2713
- a = o ? +o(1, 0) : 0,
2714
- s = o ? +o(0, -1) : 0,
2715
- u = o ? +o(0, 1) : 0;
2716
- 0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
2717
- x: e,
2718
- y: r,
2719
- size: n,
2720
- rotation: 0
2721
- }) : this._basicCornerRounded({
2722
- x: e,
2723
- y: r,
2724
- size: n,
2725
- rotation: Math.PI / 2
2726
- }) : this._basicCornerRounded({
2727
- x: e,
2728
- y: r,
2729
- size: n,
2730
- rotation: -Math.PI / 2
2731
- }) : this._basicCornersRounded({
2732
- x: e,
2733
- y: r,
2734
- size: n,
2735
- rotation: Math.PI / 2
2736
- });
2737
- }, t.prototype._drawClassyRounded = function (t) {
2738
- var e = t.x,
2739
- r = t.y,
2740
- n = t.size,
2741
- o = t.getNeighbor,
2742
- i = o ? +o(-1, 0) : 0,
2743
- a = o ? +o(1, 0) : 0,
2744
- s = o ? +o(0, -1) : 0,
2745
- u = o ? +o(0, 1) : 0;
2746
- 0 !== i + a + s + u ? i || s ? a || u ? this._basicSquare({
2747
- x: e,
2748
- y: r,
2749
- size: n,
2750
- rotation: 0
2751
- }) : this._basicCornerExtraRounded({
2752
- x: e,
2753
- y: r,
2754
- size: n,
2755
- rotation: Math.PI / 2
2756
- }) : this._basicCornerExtraRounded({
2757
- x: e,
2758
- y: r,
2759
- size: n,
2760
- rotation: -Math.PI / 2
2761
- }) : this._basicCornersRounded({
2762
- x: e,
2763
- y: r,
2764
- size: n,
2765
- rotation: Math.PI / 2
2766
- });
2767
- }, t;
2768
- }();
2769
-
2770
- var _A = function A() {
2771
- return (_A = Object.assign || function (t) {
2772
- for (var e, r = 1, n = arguments.length; r < n; r++) {
2773
- for (var o in e = arguments[r]) {
2774
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
2775
- }
2776
- }
2777
-
2778
- return t;
2779
- }).apply(this, arguments);
2780
- };
2781
-
2782
- var k = function () {
2783
- function t(t) {
2784
- var e = t.svg,
2785
- r = t.type;
2786
- this._svg = e, this._type = r;
2787
- }
2788
-
2789
- return t.prototype.draw = function (t, e, r, n) {
2790
- var o;
2791
-
2792
- switch (this._type) {
2793
- case w:
2794
- o = this._drawSquare;
2795
- break;
2796
-
2797
- case _:
2798
- o = this._drawExtraRounded;
2799
- break;
2800
-
2801
- case "dot":
2802
- default:
2803
- o = this._drawDot;
2804
- }
2805
-
2806
- o.call(this, {
2807
- x: t,
2808
- y: e,
2809
- size: r,
2810
- rotation: n
2811
- });
2812
- }, t.prototype._rotateFigure = function (t) {
2813
- var e,
2814
- r = t.x,
2815
- n = t.y,
2816
- o = t.size,
2817
- i = t.rotation,
2818
- a = void 0 === i ? 0 : i,
2819
- s = r + o / 2,
2820
- u = n + o / 2;
2821
- (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
2822
- }, t.prototype._basicDot = 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 + 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");
2832
- }
2833
- }));
2834
- }, t.prototype._basicSquare = 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 + "v " + r + "h " + r + "v " + -r + "zM " + (n + i) + " " + (o + i) + "h " + (r - 2 * i) + "v " + (r - 2 * i) + "h " + (2 * i - r) + "z");
2844
- }
2845
- }));
2846
- }, t.prototype._basicExtraRounded = function (t) {
2847
- var e = this,
2848
- r = t.size,
2849
- n = t.x,
2850
- o = t.y,
2851
- i = r / 7;
2852
-
2853
- this._rotateFigure(_A(_A({}, t), {
2854
- draw: function draw() {
2855
- 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);
2856
- }
2857
- }));
2858
- }, t.prototype._drawDot = function (t) {
2859
- var e = t.x,
2860
- r = t.y,
2861
- n = t.size,
2862
- o = t.rotation;
2863
-
2864
- this._basicDot({
2865
- x: e,
2866
- y: r,
2867
- size: n,
2868
- rotation: o
2869
- });
2870
- }, t.prototype._drawSquare = function (t) {
2871
- var e = t.x,
2872
- r = t.y,
2873
- n = t.size,
2874
- o = t.rotation;
2875
-
2876
- this._basicSquare({
2877
- x: e,
2878
- y: r,
2879
- size: n,
2880
- rotation: o
2881
- });
2882
- }, t.prototype._drawExtraRounded = function (t) {
2883
- var e = t.x,
2884
- r = t.y,
2885
- n = t.size,
2886
- o = t.rotation;
2142
+ trys: [],
2143
+ ops: []
2144
+ };
2145
+ return i = {
2146
+ next: s(0),
2147
+ "throw": s(1),
2148
+ "return": s(2)
2149
+ }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
2150
+ return this;
2151
+ }), i;
2887
2152
 
2888
- this._basicExtraRounded({
2889
- x: e,
2890
- y: r,
2891
- size: n,
2892
- rotation: o
2893
- });
2894
- }, t;
2895
- }();
2153
+ function s(i) {
2154
+ return function (s) {
2155
+ return function (i) {
2156
+ if (r) throw new TypeError("Generator is already executing.");
2896
2157
 
2897
- var _q = function q() {
2898
- return (_q = Object.assign || function (t) {
2899
- for (var e, r = 1, n = arguments.length; r < n; r++) {
2900
- for (var o in e = arguments[r]) {
2901
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
2902
- }
2903
- }
2158
+ for (; a;) {
2159
+ try {
2160
+ 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;
2904
2161
 
2905
- return t;
2906
- }).apply(this, arguments);
2907
- };
2162
+ switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
2163
+ case 0:
2164
+ case 1:
2165
+ o = i;
2166
+ break;
2908
2167
 
2909
- var R = function () {
2910
- function t(t) {
2911
- var e = t.svg,
2912
- r = t.type;
2913
- this._svg = e, this._type = r;
2914
- }
2168
+ case 4:
2169
+ return a.label++, {
2170
+ value: i[1],
2171
+ done: !1
2172
+ };
2915
2173
 
2916
- return t.prototype.draw = function (t, e, r, n) {
2917
- var o;
2174
+ case 5:
2175
+ a.label++, n = i[1], i = [0];
2176
+ continue;
2918
2177
 
2919
- switch (this._type) {
2920
- case x:
2921
- o = this._drawSquare;
2922
- break;
2178
+ case 7:
2179
+ i = a.ops.pop(), a.trys.pop();
2180
+ continue;
2923
2181
 
2924
- case "dot":
2925
- default:
2926
- o = this._drawDot;
2927
- }
2182
+ default:
2183
+ if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
2184
+ a = 0;
2185
+ continue;
2186
+ }
2928
2187
 
2929
- o.call(this, {
2930
- x: t,
2931
- y: e,
2932
- size: r,
2933
- rotation: n
2934
- });
2935
- }, t.prototype._rotateFigure = function (t) {
2936
- var e,
2937
- r = t.x,
2938
- n = t.y,
2939
- o = t.size,
2940
- i = t.rotation,
2941
- a = void 0 === i ? 0 : i,
2942
- s = r + o / 2,
2943
- u = n + o / 2;
2944
- (0, t.draw)(), null === (e = this._element) || void 0 === e || e.setAttribute("transform", "rotate(" + 180 * a / Math.PI + "," + s + "," + u + ")");
2945
- }, t.prototype._basicDot = function (t) {
2946
- var e = this,
2947
- r = t.size,
2948
- n = t.x,
2949
- o = t.y;
2188
+ if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
2189
+ a.label = i[1];
2190
+ break;
2191
+ }
2950
2192
 
2951
- this._rotateFigure(_q(_q({}, t), {
2952
- draw: function draw() {
2953
- 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));
2954
- }
2955
- }));
2956
- }, t.prototype._basicSquare = function (t) {
2957
- var e = this,
2958
- r = t.size,
2959
- n = t.x,
2960
- o = t.y;
2193
+ if (6 === i[0] && a.label < o[1]) {
2194
+ a.label = o[1], o = i;
2195
+ break;
2196
+ }
2961
2197
 
2962
- this._rotateFigure(_q(_q({}, t), {
2963
- draw: function draw() {
2964
- 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));
2965
- }
2966
- }));
2967
- }, t.prototype._drawDot = function (t) {
2968
- var e = t.x,
2969
- r = t.y,
2970
- n = t.size,
2971
- o = t.rotation;
2198
+ if (o && a.label < o[2]) {
2199
+ a.label = o[2], a.ops.push(i);
2200
+ break;
2201
+ }
2972
2202
 
2973
- this._basicDot({
2974
- x: e,
2975
- y: r,
2976
- size: n,
2977
- rotation: o
2978
- });
2979
- }, t.prototype._drawSquare = function (t) {
2980
- var e = t.x,
2981
- r = t.y,
2982
- n = t.size,
2983
- o = t.rotation;
2203
+ o[2] && a.ops.pop(), a.trys.pop();
2204
+ continue;
2205
+ }
2984
2206
 
2985
- this._basicSquare({
2986
- x: e,
2987
- y: r,
2988
- size: n,
2989
- rotation: o
2990
- });
2991
- }, t;
2992
- }();
2207
+ i = e.call(t, a);
2208
+ } catch (t) {
2209
+ i = [6, t], n = 0;
2210
+ } finally {
2211
+ r = o = 0;
2212
+ }
2213
+ }
2993
2214
 
2994
- var B = [[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]],
2995
- E = [[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]];
2215
+ if (5 & i[0]) throw i[1];
2216
+ return {
2217
+ value: i[0] ? i[1] : void 0,
2218
+ done: !0
2219
+ };
2220
+ }([i, s]);
2221
+ };
2222
+ }
2223
+ },
2224
+ 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]],
2225
+ 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]];
2996
2226
 
2997
- var L = function () {
2227
+ var _ = function () {
2998
2228
  function t(t) {
2999
2229
  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;
3000
2230
  }
@@ -3013,12 +2243,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3013
2243
  configurable: !0
3014
2244
  }), t.prototype.getElement = function () {
3015
2245
  return this._element;
3016
- }, t.prototype.clear = function () {
3017
- var t,
3018
- e = this._element;
3019
- 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);
3020
2246
  }, t.prototype.drawQR = function (t) {
3021
- return e = this, r = void 0, o = function o() {
2247
+ return w(this, void 0, void 0, function () {
3022
2248
  var e,
3023
2249
  r,
3024
2250
  n,
@@ -3026,105 +2252,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3026
2252
  i,
3027
2253
  a,
3028
2254
  s,
3029
- h,
3030
- d,
3031
- l = this;
3032
- return function (t, e) {
3033
- var r,
3034
- n,
3035
- o,
3036
- i,
3037
- a = {
3038
- label: 0,
3039
- sent: function sent() {
3040
- if (1 & o[0]) throw o[1];
3041
- return o[1];
3042
- },
3043
- trys: [],
3044
- ops: []
3045
- };
3046
- return i = {
3047
- next: s(0),
3048
- "throw": s(1),
3049
- "return": s(2)
3050
- }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
3051
- return this;
3052
- }), i;
3053
-
3054
- function s(i) {
3055
- return function (s) {
3056
- return function (i) {
3057
- if (r) throw new TypeError("Generator is already executing.");
3058
-
3059
- for (; a;) {
3060
- try {
3061
- 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;
3062
-
3063
- switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) {
3064
- case 0:
3065
- case 1:
3066
- o = i;
3067
- break;
3068
-
3069
- case 4:
3070
- return a.label++, {
3071
- value: i[1],
3072
- done: !1
3073
- };
3074
-
3075
- case 5:
3076
- a.label++, n = i[1], i = [0];
3077
- continue;
3078
-
3079
- case 7:
3080
- i = a.ops.pop(), a.trys.pop();
3081
- continue;
3082
-
3083
- default:
3084
- if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) {
3085
- a = 0;
3086
- continue;
3087
- }
3088
-
3089
- if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {
3090
- a.label = i[1];
3091
- break;
3092
- }
3093
-
3094
- if (6 === i[0] && a.label < o[1]) {
3095
- a.label = o[1], o = i;
3096
- break;
3097
- }
3098
-
3099
- if (o && a.label < o[2]) {
3100
- a.label = o[2], a.ops.push(i);
3101
- break;
3102
- }
3103
-
3104
- o[2] && a.ops.pop(), a.trys.pop();
3105
- continue;
3106
- }
3107
-
3108
- i = e.call(t, a);
3109
- } catch (t) {
3110
- i = [6, t], n = 0;
3111
- } finally {
3112
- r = o = 0;
3113
- }
3114
- }
3115
-
3116
- if (5 & i[0]) throw i[1];
3117
- return {
3118
- value: i[0] ? i[1] : void 0,
3119
- done: !0
3120
- };
3121
- }([i, s]);
3122
- };
3123
- }
3124
- }(this, function (f) {
2255
+ u,
2256
+ c,
2257
+ l,
2258
+ d = this;
2259
+ return y(this, function (f) {
3125
2260
  switch (f.label) {
3126
2261
  case 0:
3127
- return e = t.getModuleCount(), r = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n = Math.floor(r / e), o = {
2262
+ 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 = {
3128
2263
  hideXDots: 0,
3129
2264
  hideYDots: 0,
3130
2265
  width: 0,
@@ -3133,72 +2268,85 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3133
2268
 
3134
2269
  case 1:
3135
2270
  if (f.sent(), !this._image) return [2];
3136
- i = this._options, a = i.imageOptions, s = i.qrOptions, h = a.imageSize * c[s.errorCorrectionLevel], d = Math.floor(h * e * e), o = u({
2271
+ a = this._options, s = a.imageOptions, u = a.qrOptions, c = s.imageSize * h[u.errorCorrectionLevel], l = Math.floor(c * e * e), i = function (t) {
2272
+ var e = t.originalHeight,
2273
+ r = t.originalWidth,
2274
+ n = t.maxHiddenDots,
2275
+ o = t.maxHiddenAxisDots,
2276
+ i = t.dotSize,
2277
+ a = {
2278
+ x: 0,
2279
+ y: 0
2280
+ },
2281
+ s = {
2282
+ x: 0,
2283
+ y: 0
2284
+ };
2285
+ if (e <= 0 || r <= 0 || n <= 0 || i <= 0) return {
2286
+ height: 0,
2287
+ width: 0,
2288
+ hideYDots: 0,
2289
+ hideXDots: 0
2290
+ };
2291
+ var u = e / r;
2292
+ 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)), {
2293
+ height: s.y,
2294
+ width: s.x,
2295
+ hideYDots: a.y,
2296
+ hideXDots: a.x
2297
+ };
2298
+ }({
3137
2299
  originalWidth: this._image.width,
3138
2300
  originalHeight: this._image.height,
3139
- maxHiddenDots: d,
2301
+ maxHiddenDots: l,
3140
2302
  maxHiddenAxisDots: e - 14,
3141
- dotSize: n
2303
+ dotSize: o
3142
2304
  }), f.label = 2;
3143
2305
 
3144
2306
  case 2:
3145
- return this.clear(), this.drawBackground(), this.drawDots(function (t, r) {
3146
- var n, i, a, s, u, c;
3147
- 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 = B[t]) || void 0 === n ? void 0 : n[r]) || (null === (i = B[t - e + 7]) || void 0 === i ? void 0 : i[r]) || (null === (a = B[t]) || void 0 === a ? void 0 : a[r - e + 7]) || (null === (s = E[t]) || void 0 === s ? void 0 : s[r]) || (null === (u = E[t - e + 7]) || void 0 === u ? void 0 : u[r]) || (null === (c = E[t]) || void 0 === c ? void 0 : c[r - e + 7]));
3148
- }), this.drawCorners(), this._options.image && this.drawImage({
3149
- width: o.width,
3150
- height: o.height,
2307
+ return this.drawBackground(), this.drawDots(function (t, r) {
2308
+ var n, o, a, s, u, h;
2309
+ 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]));
2310
+ }), this.drawCorners(), this._options.image ? [4, this.drawImage({
2311
+ width: i.width,
2312
+ height: i.height,
3151
2313
  count: e,
3152
- dotSize: n
3153
- }), [2];
3154
- }
3155
- });
3156
- }, new ((n = void 0) || (n = Promise))(function (t, i) {
3157
- function a(t) {
3158
- try {
3159
- u(o.next(t));
3160
- } catch (t) {
3161
- i(t);
3162
- }
3163
- }
3164
-
3165
- function s(t) {
3166
- try {
3167
- u(o["throw"](t));
3168
- } catch (t) {
3169
- i(t);
3170
- }
3171
- }
2314
+ dotSize: o
2315
+ })] : [3, 4];
3172
2316
 
3173
- function u(e) {
3174
- var r;
3175
- e.done ? t(e.value) : (r = e.value, r instanceof n ? r : new n(function (t) {
3176
- t(r);
3177
- })).then(a, s);
3178
- }
2317
+ case 3:
2318
+ f.sent(), f.label = 4;
3179
2319
 
3180
- u((o = o.apply(e, r || [])).next());
2320
+ case 4:
2321
+ return [2];
2322
+ }
2323
+ });
3181
2324
  });
3182
- var e, r, n, o;
3183
2325
  }, t.prototype.drawBackground = function () {
3184
2326
  var t,
3185
2327
  e,
3186
- r = this._element,
3187
- n = this._options;
3188
-
3189
- if (r) {
3190
- var o = null === (t = n.backgroundOptions) || void 0 === t ? void 0 : t.gradient,
3191
- i = null === (e = n.backgroundOptions) || void 0 === e ? void 0 : e.color;
3192
- (o || i) && this._createColor({
3193
- options: o,
3194
- color: i,
2328
+ r,
2329
+ n = this._element,
2330
+ o = this._options;
2331
+
2332
+ if (n) {
2333
+ var i = null === (t = o.backgroundOptions) || void 0 === t ? void 0 : t.gradient,
2334
+ a = null === (e = o.backgroundOptions) || void 0 === e ? void 0 : e.color;
2335
+
2336
+ if ((i || a) && this._createColor({
2337
+ options: i,
2338
+ color: a,
3195
2339
  additionalRotation: 0,
3196
2340
  x: 0,
3197
2341
  y: 0,
3198
- height: n.height,
3199
- width: n.width,
2342
+ height: o.height,
2343
+ width: o.width,
3200
2344
  name: "background-color"
3201
- });
2345
+ }), null === (r = o.backgroundOptions) || void 0 === r ? void 0 : r.round) {
2346
+ var s = Math.min(o.width, o.height),
2347
+ u = document.createElementNS("http://www.w3.org/2000/svg", "rect");
2348
+ 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);
2349
+ }
3202
2350
  }
3203
2351
  }, t.prototype.drawDots = function (t) {
3204
2352
  var e,
@@ -3211,10 +2359,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3211
2359
 
3212
2360
  if (i > o.width || i > o.height) throw "The canvas is too small.";
3213
2361
  var a = Math.min(o.width, o.height) - 2 * o.margin,
3214
- s = Math.floor(a / i),
3215
- u = Math.floor((o.width - i * s) / 2),
3216
- c = Math.floor((o.height - i * s) / 2),
3217
- h = new I({
2362
+ s = o.shape === v ? a / Math.sqrt(2) : a,
2363
+ u = Math.floor(s / i),
2364
+ h = Math.floor((o.width - i * u) / 2),
2365
+ c = Math.floor((o.height - i * u) / 2),
2366
+ d = new l({
3218
2367
  svg: this._element,
3219
2368
  type: o.dotsOptions.type
3220
2369
  });
@@ -3222,23 +2371,57 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3222
2371
  options: null === (e = o.dotsOptions) || void 0 === e ? void 0 : e.gradient,
3223
2372
  color: o.dotsOptions.color,
3224
2373
  additionalRotation: 0,
3225
- x: u,
3226
- y: c,
3227
- height: i * s,
3228
- width: i * s,
2374
+ x: 0,
2375
+ y: 0,
2376
+ height: o.height,
2377
+ width: o.width,
3229
2378
  name: "dot-color"
3230
2379
  });
3231
2380
 
3232
- for (var d = function d(e) {
2381
+ for (var f = function f(e) {
3233
2382
  for (var o = function o(_o) {
3234
- return t && !t(e, _o) ? "continue" : (null === (r = l._qr) || void 0 === r ? void 0 : r.isDark(e, _o)) ? (h.draw(u + e * s, c + _o * s, s, function (r, a) {
2383
+ 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) {
3235
2384
  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);
3236
- }), void (h._element && l._dotsClipPath && l._dotsClipPath.appendChild(h._element))) : "continue";
2385
+ }), void (d._element && g._dotsClipPath && g._dotsClipPath.appendChild(d._element))) : "continue";
3237
2386
  }, a = 0; a < i; a++) {
3238
2387
  o(a);
3239
2388
  }
3240
- }, l = this, f = 0; f < i; f++) {
3241
- d(f);
2389
+ }, g = this, p = 0; p < i; p++) {
2390
+ f(p);
2391
+ }
2392
+
2393
+ if (o.shape === v) {
2394
+ var w = Math.floor((a / u - i) / 2),
2395
+ y = i + 2 * w,
2396
+ m = h - w * u,
2397
+ b = c - w * u,
2398
+ _ = [],
2399
+ x = Math.floor(y / 2);
2400
+
2401
+ for (p = 0; p < y; p++) {
2402
+ _[p] = [];
2403
+
2404
+ for (var S = 0; S < y; S++) {
2405
+ 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;
2406
+ }
2407
+ }
2408
+
2409
+ var M = function M(t) {
2410
+ for (var e = function e(_e2) {
2411
+ if (!_[t][_e2]) return "continue";
2412
+ d.draw(m + t * u, b + _e2 * u, u, function (r, n) {
2413
+ var o;
2414
+ return !!(null === (o = _[t + r]) || void 0 === o ? void 0 : o[_e2 + n]);
2415
+ }), d._element && C._dotsClipPath && C._dotsClipPath.appendChild(d._element);
2416
+ }, r = 0; r < y; r++) {
2417
+ e(r);
2418
+ }
2419
+ },
2420
+ C = this;
2421
+
2422
+ for (p = 0; p < y; p++) {
2423
+ M(p);
2424
+ }
3242
2425
  }
3243
2426
  }, t.prototype.drawCorners = function () {
3244
2427
  var t = this;
@@ -3249,100 +2432,101 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3249
2432
 
3250
2433
  var n = this._qr.getModuleCount(),
3251
2434
  o = Math.min(r.width, r.height) - 2 * r.margin,
3252
- i = Math.floor(o / n),
3253
- a = 7 * i,
3254
- s = 3 * i,
3255
- u = Math.floor((r.width - n * i) / 2),
3256
- c = Math.floor((r.height - n * i) / 2);
2435
+ i = r.shape === v ? o / Math.sqrt(2) : o,
2436
+ a = Math.floor(i / n),
2437
+ s = 7 * a,
2438
+ u = 3 * a,
2439
+ h = Math.floor((r.width - n * a) / 2),
2440
+ c = Math.floor((r.height - n * a) / 2);
3257
2441
 
3258
2442
  [[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function (e) {
3259
2443
  var o,
3260
- h,
2444
+ i,
3261
2445
  d,
3262
- l,
3263
- f,
3264
- p,
3265
2446
  g,
3266
2447
  v,
3267
- y,
3268
2448
  w,
2449
+ y,
3269
2450
  _,
3270
- m,
3271
- b = e[0],
3272
- x = e[1],
3273
- M = e[2],
3274
- S = u + b * i * (n - 7),
3275
- C = c + x * i * (n - 7),
3276
- P = t._dotsClipPath,
3277
- O = t._dotsClipPath;
3278
-
3279
- if (((null === (o = r.cornersSquareOptions) || void 0 === o ? void 0 : o.gradient) || (null === (h = r.cornersSquareOptions) || void 0 === h ? void 0 : h.color)) && ((P = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-square-color-" + b + "-" + x), t._defs.appendChild(P), t._cornersSquareClipPath = t._cornersDotClipPath = O = P, t._createColor({
2451
+ x,
2452
+ S,
2453
+ M,
2454
+ C,
2455
+ A = e[0],
2456
+ k = e[1],
2457
+ O = e[2],
2458
+ D = h + A * a * (n - 7),
2459
+ P = c + k * a * (n - 7),
2460
+ z = t._dotsClipPath,
2461
+ B = t._dotsClipPath;
2462
+
2463
+ 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({
3280
2464
  options: null === (d = r.cornersSquareOptions) || void 0 === d ? void 0 : d.gradient,
3281
- color: null === (l = r.cornersSquareOptions) || void 0 === l ? void 0 : l.color,
3282
- additionalRotation: M,
3283
- x: S,
3284
- y: C,
3285
- height: a,
3286
- width: a,
3287
- name: "corners-square-color-" + b + "-" + x
3288
- })), null === (f = r.cornersSquareOptions) || void 0 === f ? void 0 : f.type) {
3289
- var z = new k({
2465
+ color: null === (g = r.cornersSquareOptions) || void 0 === g ? void 0 : g.color,
2466
+ additionalRotation: O,
2467
+ x: D,
2468
+ y: P,
2469
+ height: s,
2470
+ width: s,
2471
+ name: "corners-square-color-" + A + "-" + k
2472
+ })), null === (v = r.cornersSquareOptions) || void 0 === v ? void 0 : v.type) {
2473
+ var q = new f({
3290
2474
  svg: t._element,
3291
2475
  type: r.cornersSquareOptions.type
3292
2476
  });
3293
- z.draw(S, C, a, M), z._element && P && P.appendChild(z._element);
3294
- } else for (var D = new I({
2477
+ q.draw(D, P, s, O), q._element && z && z.appendChild(q._element);
2478
+ } else for (var I = new l({
3295
2479
  svg: t._element,
3296
2480
  type: r.dotsOptions.type
3297
- }), A = function A(t) {
3298
- for (var e = function e(_e4) {
3299
- if (!(null === (p = B[t]) || void 0 === p ? void 0 : p[_e4])) return "continue";
3300
- D.draw(S + t * i, C + _e4 * i, i, function (r, n) {
2481
+ }), E = function E(t) {
2482
+ for (var e = function e(_e3) {
2483
+ if (!(null === (w = m[t]) || void 0 === w ? void 0 : w[_e3])) return "continue";
2484
+ I.draw(D + t * a, P + _e3 * a, a, function (r, n) {
3301
2485
  var o;
3302
- return !!(null === (o = B[t + r]) || void 0 === o ? void 0 : o[_e4 + n]);
3303
- }), D._element && P && P.appendChild(D._element);
3304
- }, r = 0; r < B[t].length; r++) {
2486
+ return !!(null === (o = m[t + r]) || void 0 === o ? void 0 : o[_e3 + n]);
2487
+ }), I._element && z && z.appendChild(I._element);
2488
+ }, r = 0; r < m[t].length; r++) {
3305
2489
  e(r);
3306
2490
  }
3307
- }, q = 0; q < B.length; q++) {
3308
- A(q);
3309
- }
3310
-
3311
- if (((null === (g = r.cornersDotOptions) || void 0 === g ? void 0 : g.gradient) || (null === (v = r.cornersDotOptions) || void 0 === v ? void 0 : v.color)) && ((O = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-dot-color-" + b + "-" + x), t._defs.appendChild(O), t._cornersDotClipPath = O, t._createColor({
3312
- options: null === (y = r.cornersDotOptions) || void 0 === y ? void 0 : y.gradient,
3313
- color: null === (w = r.cornersDotOptions) || void 0 === w ? void 0 : w.color,
3314
- additionalRotation: M,
3315
- x: S + 2 * i,
3316
- y: C + 2 * i,
3317
- height: s,
3318
- width: s,
3319
- name: "corners-dot-color-" + b + "-" + x
3320
- })), null === (_ = r.cornersDotOptions) || void 0 === _ ? void 0 : _.type) {
3321
- var L = new R({
2491
+ }, L = 0; L < m.length; L++) {
2492
+ E(L);
2493
+ }
2494
+
2495
+ 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({
2496
+ options: null === (x = r.cornersDotOptions) || void 0 === x ? void 0 : x.gradient,
2497
+ color: null === (S = r.cornersDotOptions) || void 0 === S ? void 0 : S.color,
2498
+ additionalRotation: O,
2499
+ x: D + 2 * a,
2500
+ y: P + 2 * a,
2501
+ height: u,
2502
+ width: u,
2503
+ name: "corners-dot-color-" + A + "-" + k
2504
+ })), null === (M = r.cornersDotOptions) || void 0 === M ? void 0 : M.type) {
2505
+ var R = new p({
3322
2506
  svg: t._element,
3323
2507
  type: r.cornersDotOptions.type
3324
2508
  });
3325
- L.draw(S + 2 * i, C + 2 * i, s, M), L._element && O && O.appendChild(L._element);
2509
+ R.draw(D + 2 * a, P + 2 * a, u, O), R._element && B && B.appendChild(R._element);
3326
2510
  } else {
3327
- D = new I({
2511
+ I = new l({
3328
2512
  svg: t._element,
3329
2513
  type: r.dotsOptions.type
3330
2514
  });
3331
2515
 
3332
2516
  var N = function N(t) {
3333
- for (var e = function e(_e5) {
3334
- if (!(null === (m = E[t]) || void 0 === m ? void 0 : m[_e5])) return "continue";
3335
- D.draw(S + t * i, C + _e5 * i, i, function (r, n) {
2517
+ for (var e = function e(_e4) {
2518
+ if (!(null === (C = b[t]) || void 0 === C ? void 0 : C[_e4])) return "continue";
2519
+ I.draw(D + t * a, P + _e4 * a, a, function (r, n) {
3336
2520
  var o;
3337
- return !!(null === (o = E[t + r]) || void 0 === o ? void 0 : o[_e5 + n]);
3338
- }), D._element && O && O.appendChild(D._element);
3339
- }, r = 0; r < E[t].length; r++) {
2521
+ return !!(null === (o = b[t + r]) || void 0 === o ? void 0 : o[_e4 + n]);
2522
+ }), I._element && B && B.appendChild(I._element);
2523
+ }, r = 0; r < b[t].length; r++) {
3340
2524
  e(r);
3341
2525
  }
3342
2526
  };
3343
2527
 
3344
- for (q = 0; q < E.length; q++) {
3345
- N(q);
2528
+ for (L = 0; L < b.length; L++) {
2529
+ N(L);
3346
2530
  }
3347
2531
  }
3348
2532
  });
@@ -3360,16 +2544,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3360
2544
  var e = t.width,
3361
2545
  r = t.height,
3362
2546
  n = t.count,
3363
- o = t.dotSize,
3364
- i = this._options,
3365
- a = Math.floor((i.width - n * o) / 2),
3366
- s = Math.floor((i.height - n * o) / 2),
3367
- u = a + i.imageOptions.margin + (n * o - e) / 2,
3368
- c = s + i.imageOptions.margin + (n * o - r) / 2,
3369
- h = e - 2 * i.imageOptions.margin,
3370
- d = r - 2 * i.imageOptions.margin,
3371
- l = document.createElementNS("http://www.w3.org/2000/svg", "image");
3372
- l.setAttribute("href", i.image || ""), l.setAttribute("x", String(u)), l.setAttribute("y", String(c)), l.setAttribute("width", h + "px"), l.setAttribute("height", d + "px"), this._element.appendChild(l);
2547
+ o = t.dotSize;
2548
+ return w(this, void 0, void 0, function () {
2549
+ var t, i, a, s, h, c, l, d, f;
2550
+ return y(this, function (g) {
2551
+ switch (g.label) {
2552
+ case 0:
2553
+ 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 || "")];
2554
+
2555
+ case 1:
2556
+ return f = g.sent(), d.setAttribute("href", f || ""), this._element.appendChild(d), [2];
2557
+ }
2558
+ });
2559
+ });
3373
2560
  }, t.prototype._createColor = function (t) {
3374
2561
  var e = t.options,
3375
2562
  r = t.color,
@@ -3379,45 +2566,46 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3379
2566
  a = t.height,
3380
2567
  s = t.width,
3381
2568
  u = t.name,
3382
- c = s > a ? s : a,
3383
- h = document.createElementNS("http://www.w3.org/2000/svg", "rect");
3384
-
3385
- if (h.setAttribute("x", String(o)), h.setAttribute("y", String(i)), h.setAttribute("height", String(a)), h.setAttribute("width", String(s)), h.setAttribute("clip-path", "url('#clip-path-" + u + "')"), e) {
3386
- var d;
3387
- if (e.type === C) (d = document.createElementNS("http://www.w3.org/2000/svg", "radialGradient")).setAttribute("id", u), d.setAttribute("gradientUnits", "userSpaceOnUse"), d.setAttribute("fx", String(o + s / 2)), d.setAttribute("fy", String(i + a / 2)), d.setAttribute("cx", String(o + s / 2)), d.setAttribute("cy", String(i + a / 2)), d.setAttribute("r", String(c / 2));else {
3388
- var l = ((e.rotation || 0) + n) % (2 * Math.PI),
3389
- f = (l + 2 * Math.PI) % (2 * Math.PI),
3390
- p = o + s / 2,
3391
- g = i + a / 2,
2569
+ h = s > a ? s : a,
2570
+ c = document.createElementNS("http://www.w3.org/2000/svg", "rect");
2571
+
2572
+ 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) {
2573
+ var l;
2574
+ 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 {
2575
+ var d = ((e.rotation || 0) + n) % (2 * Math.PI),
2576
+ f = (d + 2 * Math.PI) % (2 * Math.PI),
2577
+ g = o + s / 2,
2578
+ p = i + a / 2,
3392
2579
  v = o + s / 2,
3393
- y = i + a / 2;
3394
- f >= 0 && f <= .25 * Math.PI || f > 1.75 * Math.PI && f <= 2 * Math.PI ? (p -= s / 2, g -= a / 2 * Math.tan(l), v += s / 2, y += a / 2 * Math.tan(l)) : f > .25 * Math.PI && f <= .75 * Math.PI ? (g -= a / 2, p -= s / 2 / Math.tan(l), y += a / 2, v += s / 2 / Math.tan(l)) : f > .75 * Math.PI && f <= 1.25 * Math.PI ? (p += s / 2, g += a / 2 * Math.tan(l), v -= s / 2, y -= a / 2 * Math.tan(l)) : f > 1.25 * Math.PI && f <= 1.75 * Math.PI && (g += a / 2, p += s / 2 / Math.tan(l), y -= a / 2, v -= s / 2 / Math.tan(l)), (d = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient")).setAttribute("id", u), d.setAttribute("gradientUnits", "userSpaceOnUse"), d.setAttribute("x1", String(Math.round(p))), d.setAttribute("y1", String(Math.round(g))), d.setAttribute("x2", String(Math.round(v))), d.setAttribute("y2", String(Math.round(y)));
2580
+ w = i + a / 2;
2581
+ 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)));
3395
2582
  }
3396
2583
  e.colorStops.forEach(function (t) {
3397
2584
  var e = t.offset,
3398
2585
  r = t.color,
3399
2586
  n = document.createElementNS("http://www.w3.org/2000/svg", "stop");
3400
- n.setAttribute("offset", 100 * e + "%"), n.setAttribute("stop-color", r), d.appendChild(n);
3401
- }), h.setAttribute("fill", "url('#" + u + "')"), this._defs.appendChild(d);
3402
- } else r && h.setAttribute("fill", r);
2587
+ n.setAttribute("offset", 100 * e + "%"), n.setAttribute("stop-color", r), l.appendChild(n);
2588
+ }), c.setAttribute("fill", "url('#" + u + "')"), this._defs.appendChild(l);
2589
+ } else r && c.setAttribute("fill", r);
3403
2590
 
3404
- this._element.appendChild(h);
2591
+ this._element.appendChild(c);
3405
2592
  }, t;
3406
2593
  }(),
3407
- N = "canvas";
2594
+ x = "canvas";
3408
2595
 
3409
- for (var T = {}, j = 0; j <= 40; j++) {
3410
- T[j] = j;
2596
+ for (var S = {}, M = 0; M <= 40; M++) {
2597
+ S[M] = M;
3411
2598
  }
3412
2599
 
3413
- var F = {
3414
- type: N,
2600
+ var C = {
2601
+ type: x,
2602
+ shape: "square",
3415
2603
  width: 300,
3416
2604
  height: 300,
3417
2605
  data: "",
3418
2606
  margin: 0,
3419
2607
  qrOptions: {
3420
- typeNumber: T[0],
2608
+ typeNumber: S[0],
3421
2609
  mode: void 0,
3422
2610
  errorCorrectionLevel: "Q"
3423
2611
  },
@@ -3432,12 +2620,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3432
2620
  color: "#000"
3433
2621
  },
3434
2622
  backgroundOptions: {
2623
+ round: 0,
3435
2624
  color: "#fff"
3436
2625
  }
3437
2626
  };
3438
2627
 
3439
- var _Q = function Q() {
3440
- return (_Q = Object.assign || function (t) {
2628
+ var _A = function A() {
2629
+ return (_A = Object.assign || function (t) {
3441
2630
  for (var e, r = 1, n = arguments.length; r < n; r++) {
3442
2631
  for (var o in e = arguments[r]) {
3443
2632
  Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
@@ -3448,30 +2637,30 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3448
2637
  }).apply(this, arguments);
3449
2638
  };
3450
2639
 
3451
- function H(t) {
3452
- var e = _Q({}, t);
2640
+ function k(t) {
2641
+ var e = _A({}, t);
3453
2642
 
3454
2643
  if (!e.colorStops || !e.colorStops.length) throw "Field 'colorStops' is required in gradient";
3455
2644
  return e.rotation ? e.rotation = Number(e.rotation) : e.rotation = 0, e.colorStops = e.colorStops.map(function (t) {
3456
- return _Q(_Q({}, t), {
2645
+ return _A(_A({}, t), {
3457
2646
  offset: Number(t.offset)
3458
2647
  });
3459
2648
  }), e;
3460
2649
  }
3461
2650
 
3462
- function G(t) {
3463
- var e = _Q({}, t);
2651
+ function O(t) {
2652
+ var e = _A({}, t);
3464
2653
 
3465
- return e.width = Number(e.width), e.height = Number(e.height), e.margin = Number(e.margin), e.imageOptions = _Q(_Q({}, e.imageOptions), {
2654
+ return e.width = Number(e.width), e.height = Number(e.height), e.margin = Number(e.margin), e.imageOptions = _A(_A({}, e.imageOptions), {
3466
2655
  hideBackgroundDots: Boolean(e.imageOptions.hideBackgroundDots),
3467
2656
  imageSize: Number(e.imageOptions.imageSize),
3468
2657
  margin: Number(e.imageOptions.margin)
3469
- }), e.margin > Math.min(e.width, e.height) && (e.margin = Math.min(e.width, e.height)), e.dotsOptions = _Q({}, e.dotsOptions), e.dotsOptions.gradient && (e.dotsOptions.gradient = H(e.dotsOptions.gradient)), e.cornersSquareOptions && (e.cornersSquareOptions = _Q({}, e.cornersSquareOptions), e.cornersSquareOptions.gradient && (e.cornersSquareOptions.gradient = H(e.cornersSquareOptions.gradient))), e.cornersDotOptions && (e.cornersDotOptions = _Q({}, e.cornersDotOptions), e.cornersDotOptions.gradient && (e.cornersDotOptions.gradient = H(e.cornersDotOptions.gradient))), e.backgroundOptions && (e.backgroundOptions = _Q({}, e.backgroundOptions), e.backgroundOptions.gradient && (e.backgroundOptions.gradient = H(e.backgroundOptions.gradient))), e;
2658
+ }), 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;
3470
2659
  }
3471
2660
 
3472
- var X = r(192),
3473
- U = r.n(X),
3474
- Y = function Y(t, e, r, n) {
2661
+ var D = r(192),
2662
+ P = r.n(D),
2663
+ z = function z(t, e, r, n) {
3475
2664
  return new (r || (r = Promise))(function (o, i) {
3476
2665
  function a(t) {
3477
2666
  try {
@@ -3499,7 +2688,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3499
2688
  u((n = n.apply(t, e || [])).next());
3500
2689
  });
3501
2690
  },
3502
- $ = function $(t, e) {
2691
+ B = function B(t, e) {
3503
2692
  var r,
3504
2693
  n,
3505
2694
  o,
@@ -3593,35 +2782,61 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3593
2782
  }
3594
2783
  };
3595
2784
 
3596
- var W = function () {
2785
+ var q = function () {
3597
2786
  function t(t) {
3598
- this._options = t ? G(a(F, t)) : F, this.update();
2787
+ this._options = t ? O(a(C, t)) : C, this.update();
3599
2788
  }
3600
2789
 
3601
2790
  return t._clearContainer = function (t) {
3602
2791
  t && (t.innerHTML = "");
3603
- }, t.prototype._getQRStylingElement = function (t) {
3604
- return void 0 === t && (t = "png"), Y(this, void 0, void 0, function () {
3605
- var e, r, n;
3606
- return $(this, function (o) {
3607
- switch (o.label) {
2792
+ }, t.prototype._setupSvg = function () {
2793
+ var t = this;
2794
+
2795
+ if (this._qr) {
2796
+ var e = new _(this._options);
2797
+ this._svg = e.getElement(), this._svgDrawingPromise = e.drawQR(this._qr).then(function () {
2798
+ var r;
2799
+ t._svg && (null === (r = t._extension) || void 0 === r || r.call(t, e.getElement(), t._options));
2800
+ });
2801
+ }
2802
+ }, t.prototype._setupCanvas = function () {
2803
+ var t,
2804
+ e = this;
2805
+ 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 () {
2806
+ if (e._svg) {
2807
+ var t = e._svg,
2808
+ r = new XMLSerializer().serializeToString(t),
2809
+ n = "data:image/svg+xml;base64," + btoa(r),
2810
+ o = new Image();
2811
+ return new Promise(function (t) {
2812
+ o.onload = function () {
2813
+ var r, n;
2814
+ null === (n = null === (r = e._canvas) || void 0 === r ? void 0 : r.getContext("2d")) || void 0 === n || n.drawImage(o, 0, 0), t();
2815
+ }, o.src = n;
2816
+ });
2817
+ }
2818
+ }));
2819
+ }, t.prototype._getElement = function (t) {
2820
+ return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
2821
+ return B(this, function (e) {
2822
+ switch (e.label) {
3608
2823
  case 0:
3609
2824
  if (!this._qr) throw "QR code is empty";
3610
- return "svg" !== t.toLowerCase() ? [3, 2] : (r = void 0, e = void 0, this._svg && this._svgDrawingPromise ? (e = this._svg, r = this._svgDrawingPromise) : (e = new L(this._options), r = e.drawQR(this._qr)), [4, r]);
2825
+ return "svg" !== t.toLowerCase() ? [3, 2] : (this._svg && this._svgDrawingPromise || this._setupSvg(), [4, this._svgDrawingPromise]);
3611
2826
 
3612
2827
  case 1:
3613
- return o.sent(), [2, e];
2828
+ return e.sent(), [2, this._svg];
3614
2829
 
3615
2830
  case 2:
3616
- return r = void 0, n = void 0, this._canvas && this._canvasDrawingPromise ? (n = this._canvas, r = this._canvasDrawingPromise) : (n = new z(this._options), r = n.drawQR(this._qr)), [4, r];
2831
+ return this._canvas && this._canvasDrawingPromise || this._setupCanvas(), [4, this._canvasDrawingPromise];
3617
2832
 
3618
2833
  case 3:
3619
- return o.sent(), [2, n];
2834
+ return e.sent(), [2, this._canvas];
3620
2835
  }
3621
2836
  });
3622
2837
  });
3623
2838
  }, t.prototype.update = function (e) {
3624
- t._clearContainer(this._container), this._options = e ? G(a(this._options, e)) : this._options, this._options.data && (this._qr = U()(this._options.qrOptions.typeNumber, this._options.qrOptions.errorCorrectionLevel), this._qr.addData(this._options.data, this._options.qrOptions.mode || function (t) {
2839
+ 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) {
3625
2840
  switch (!0) {
3626
2841
  case /^[0-9]*$/.test(t):
3627
2842
  return "Numeric";
@@ -3632,41 +2847,46 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3632
2847
  default:
3633
2848
  return "Byte";
3634
2849
  }
3635
- }(this._options.data)), this._qr.make(), this._options.type === N ? (this._canvas = new z(this._options), this._canvasDrawingPromise = this._canvas.drawQR(this._qr), this._svgDrawingPromise = void 0, this._svg = void 0) : (this._svg = new L(this._options), this._svgDrawingPromise = this._svg.drawQR(this._qr), this._canvasDrawingPromise = void 0, this._canvas = void 0), this.append(this._container));
2850
+ }(this._options.data)), this._qr.make(), this._options.type === x ? this._setupCanvas() : this._setupSvg(), this.append(this._container));
3636
2851
  }, t.prototype.append = function (t) {
3637
2852
  if (t) {
3638
2853
  if ("function" != typeof t.appendChild) throw "Container should be a single DOM node";
3639
- this._options.type === N ? this._canvas && t.appendChild(this._canvas.getCanvas()) : this._svg && t.appendChild(this._svg.getElement()), this._container = t;
2854
+ this._options.type === x ? this._canvas && t.appendChild(this._canvas) : this._svg && t.appendChild(this._svg), this._container = t;
3640
2855
  }
2856
+ }, t.prototype.applyExtension = function (t) {
2857
+ if (!t) throw "Extension function should be defined.";
2858
+ this._extension = t, this.update();
2859
+ }, t.prototype.deleteExtension = function () {
2860
+ this._extension = void 0, this.update();
3641
2861
  }, t.prototype.getRawData = function (t) {
3642
- return void 0 === t && (t = "png"), Y(this, void 0, void 0, function () {
2862
+ return void 0 === t && (t = "png"), z(this, void 0, void 0, function () {
3643
2863
  var e, r, n;
3644
- return $(this, function (o) {
2864
+ return B(this, function (o) {
3645
2865
  switch (o.label) {
3646
2866
  case 0:
3647
2867
  if (!this._qr) throw "QR code is empty";
3648
- return [4, this._getQRStylingElement(t)];
2868
+ return [4, this._getElement(t)];
3649
2869
 
3650
2870
  case 1:
3651
- return e = o.sent(), "svg" === t.toLowerCase() ? (r = new XMLSerializer(), n = r.serializeToString(e.getElement()), [2, new Blob(['<?xml version="1.0" standalone="no"?>\r\n' + n], {
2871
+ 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], {
3652
2872
  type: "image/svg+xml"
3653
2873
  })]) : [2, new Promise(function (r) {
3654
- return e.getCanvas().toBlob(r, "image/" + t, 1);
3655
- })];
2874
+ return e.toBlob(r, "image/" + t, 1);
2875
+ })] : [2, null];
3656
2876
  }
3657
2877
  });
3658
2878
  });
3659
2879
  }, t.prototype.download = function (t) {
3660
- return Y(this, void 0, void 0, function () {
2880
+ return z(this, void 0, void 0, function () {
3661
2881
  var e, r, n, o, i;
3662
- return $(this, function (a) {
2882
+ return B(this, function (a) {
3663
2883
  switch (a.label) {
3664
2884
  case 0:
3665
2885
  if (!this._qr) throw "QR code is empty";
3666
- 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._getQRStylingElement(e)];
2886
+ 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)];
3667
2887
 
3668
2888
  case 1:
3669
- return n = a.sent(), "svg" === e.toLowerCase() ? (o = new XMLSerializer(), i = '<?xml version="1.0" standalone="no"?>\r\n' + (i = o.serializeToString(n.getElement())), s("data:image/svg+xml;charset=utf-8," + encodeURIComponent(i), r + ".svg")) : s(n.getCanvas().toDataURL("image/" + e), r + "." + e), [2];
2889
+ 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];
3670
2890
  }
3671
2891
  });
3672
2892
  });
@@ -3702,12 +2922,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3702
2922
  }
3703
2923
  }, r.o = function (t, e) {
3704
2924
  return Object.prototype.hasOwnProperty.call(t, e);
3705
- }, r(796);
2925
+ }, r(676);
3706
2926
  }()["default"];
3707
2927
  });
3708
2928
  }, {}],
3709
2929
  5: [function (require, module, exports) {
3710
- module.exports = "1.118.1";
2930
+ module.exports = "1.119.1";
3711
2931
  }, {}]
3712
2932
  }, {}, [3])(3);
3713
2933
  });