@agendize/vue-tools 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -1
- package/dist/bloc/Bloc.d.ts +0 -11
- package/dist/bloc/useBlocState.d.ts +0 -3
- package/dist/index.d.ts +0 -7
- package/dist/presentation/component/qr-code/View.vue.d.ts +0 -48
- package/dist/style.css +0 -1
- package/dist/utils/date.d.ts +0 -1
- package/dist/utils/file.d.ts +0 -9
- package/dist/utils/format.d.ts +0 -4
- package/dist/vue-tools.es.js +0 -2092
- package/dist/vue-tools.umd.js +0 -5
package/dist/vue-tools.es.js
DELETED
|
@@ -1,2092 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => {
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
|
-
import { ref, onMounted, onUnmounted, readonly, defineComponent, watch, openBlock, createElementBlock, createElementVNode, toDisplayString, normalizeStyle } from "vue";
|
|
8
|
-
function useBlocState(bloc) {
|
|
9
|
-
const state = ref(bloc.state);
|
|
10
|
-
const stateSubscription = (newState) => {
|
|
11
|
-
state.value = newState;
|
|
12
|
-
};
|
|
13
|
-
onMounted(() => {
|
|
14
|
-
bloc.subscribe(stateSubscription);
|
|
15
|
-
});
|
|
16
|
-
onUnmounted(() => {
|
|
17
|
-
bloc.unsubscribe(stateSubscription);
|
|
18
|
-
});
|
|
19
|
-
return readonly(state);
|
|
20
|
-
}
|
|
21
|
-
function dateToString(date, short = false) {
|
|
22
|
-
var year = date.getFullYear();
|
|
23
|
-
var month = date.getMonth() + 1;
|
|
24
|
-
var day = date.getDate();
|
|
25
|
-
var hours = date.getHours();
|
|
26
|
-
var minutes = date.getMinutes();
|
|
27
|
-
var seconds = date.getSeconds();
|
|
28
|
-
if (short) {
|
|
29
|
-
return (day < 10 ? "0" + day : day) + "/" + (month < 10 ? "0" + month : month) + "/" + year;
|
|
30
|
-
} else {
|
|
31
|
-
return year + "-" + (month < 10 ? "0" + month : month) + "-" + (day < 10 ? "0" + day : day) + "T" + (hours < 10 ? "0" + hours : hours) + ":" + (minutes < 10 ? "0" + minutes : minutes) + ":" + (seconds < 10 ? "0" + seconds : seconds);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
function onPictureUpdated(item, objectDefinition) {
|
|
35
|
-
objectDefinition.urlPicture.value = void 0;
|
|
36
|
-
objectDefinition.pictureAsData.value = "";
|
|
37
|
-
objectDefinition.filePicture.value = void 0;
|
|
38
|
-
if (!item)
|
|
39
|
-
return;
|
|
40
|
-
toBase64(item).then((data) => {
|
|
41
|
-
if (!data)
|
|
42
|
-
return;
|
|
43
|
-
if (typeof data === "string")
|
|
44
|
-
objectDefinition.pictureAsData.value = data;
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
const toBase64 = (file) => new Promise((resolve, reject) => {
|
|
48
|
-
const reader = new FileReader();
|
|
49
|
-
reader.readAsDataURL(file);
|
|
50
|
-
reader.onload = () => resolve(reader.result);
|
|
51
|
-
reader.onerror = (error) => reject(error);
|
|
52
|
-
});
|
|
53
|
-
function readBlobFromUrl(url, callback) {
|
|
54
|
-
let xhr = new XMLHttpRequest();
|
|
55
|
-
xhr.open("get", url);
|
|
56
|
-
xhr.responseType = "blob";
|
|
57
|
-
xhr.onload = function() {
|
|
58
|
-
let fr = new FileReader();
|
|
59
|
-
fr.onload = function() {
|
|
60
|
-
if (!callback && fr.result)
|
|
61
|
-
return;
|
|
62
|
-
let value;
|
|
63
|
-
if (typeof fr.result === "string")
|
|
64
|
-
value = fr.result;
|
|
65
|
-
else
|
|
66
|
-
value = Buffer.from(String.fromCharCode(...new Uint8Array(fr.result)), "base64").toString();
|
|
67
|
-
callback(value);
|
|
68
|
-
};
|
|
69
|
-
fr.readAsDataURL(xhr.response);
|
|
70
|
-
};
|
|
71
|
-
xhr.send();
|
|
72
|
-
}
|
|
73
|
-
function parseToInt(value) {
|
|
74
|
-
try {
|
|
75
|
-
return parseInt(value);
|
|
76
|
-
} catch (e) {
|
|
77
|
-
return 0;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function pad(value, size = 2) {
|
|
81
|
-
let s = value + "";
|
|
82
|
-
while (s.length < size)
|
|
83
|
-
s = "0" + s;
|
|
84
|
-
return s;
|
|
85
|
-
}
|
|
86
|
-
function getDefaultExportFromCjs(x) {
|
|
87
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
88
|
-
}
|
|
89
|
-
var qrCodeStyling = { exports: {} };
|
|
90
|
-
(function(module, exports) {
|
|
91
|
-
!function(t, e) {
|
|
92
|
-
module.exports = e();
|
|
93
|
-
}(self, function() {
|
|
94
|
-
return (() => {
|
|
95
|
-
var t = { 192: (t2, e2) => {
|
|
96
|
-
var r2, n, o = function() {
|
|
97
|
-
var t3 = function(t4, e4) {
|
|
98
|
-
var r4 = t4, n3 = a[e4], o3 = null, i2 = 0, u2 = null, v2 = [], y2 = {}, _ = function(t5, e5) {
|
|
99
|
-
o3 = function(t6) {
|
|
100
|
-
for (var e6 = new Array(t6), r5 = 0; r5 < t6; r5 += 1) {
|
|
101
|
-
e6[r5] = new Array(t6);
|
|
102
|
-
for (var n4 = 0; n4 < t6; n4 += 1)
|
|
103
|
-
e6[r5][n4] = null;
|
|
104
|
-
}
|
|
105
|
-
return e6;
|
|
106
|
-
}(i2 = 4 * r4 + 17), m(0, 0), m(i2 - 7, 0), m(0, i2 - 7), x(), b(), S(t5, e5), r4 >= 7 && M(t5), null == u2 && (u2 = P(r4, n3, v2)), C(u2, e5);
|
|
107
|
-
}, m = function(t5, e5) {
|
|
108
|
-
for (var r5 = -1; r5 <= 7; r5 += 1)
|
|
109
|
-
if (!(t5 + r5 <= -1 || i2 <= t5 + r5))
|
|
110
|
-
for (var n4 = -1; n4 <= 7; n4 += 1)
|
|
111
|
-
e5 + n4 <= -1 || i2 <= e5 + n4 || (o3[t5 + r5][e5 + n4] = 0 <= r5 && r5 <= 6 && (0 == n4 || 6 == n4) || 0 <= n4 && n4 <= 6 && (0 == r5 || 6 == r5) || 2 <= r5 && r5 <= 4 && 2 <= n4 && n4 <= 4);
|
|
112
|
-
}, b = function() {
|
|
113
|
-
for (var t5 = 8; t5 < i2 - 8; t5 += 1)
|
|
114
|
-
null == o3[t5][6] && (o3[t5][6] = t5 % 2 == 0);
|
|
115
|
-
for (var e5 = 8; e5 < i2 - 8; e5 += 1)
|
|
116
|
-
null == o3[6][e5] && (o3[6][e5] = e5 % 2 == 0);
|
|
117
|
-
}, x = function() {
|
|
118
|
-
for (var t5 = s.getPatternPosition(r4), e5 = 0; e5 < t5.length; e5 += 1)
|
|
119
|
-
for (var n4 = 0; n4 < t5.length; n4 += 1) {
|
|
120
|
-
var i3 = t5[e5], a2 = t5[n4];
|
|
121
|
-
if (null == o3[i3][a2])
|
|
122
|
-
for (var u3 = -2; u3 <= 2; u3 += 1)
|
|
123
|
-
for (var c2 = -2; c2 <= 2; c2 += 1)
|
|
124
|
-
o3[i3 + u3][a2 + c2] = -2 == u3 || 2 == u3 || -2 == c2 || 2 == c2 || 0 == u3 && 0 == c2;
|
|
125
|
-
}
|
|
126
|
-
}, M = function(t5) {
|
|
127
|
-
for (var e5 = s.getBCHTypeNumber(r4), n4 = 0; n4 < 18; n4 += 1) {
|
|
128
|
-
var a2 = !t5 && 1 == (e5 >> n4 & 1);
|
|
129
|
-
o3[Math.floor(n4 / 3)][n4 % 3 + i2 - 8 - 3] = a2;
|
|
130
|
-
}
|
|
131
|
-
for (n4 = 0; n4 < 18; n4 += 1)
|
|
132
|
-
a2 = !t5 && 1 == (e5 >> n4 & 1), o3[n4 % 3 + i2 - 8 - 3][Math.floor(n4 / 3)] = a2;
|
|
133
|
-
}, S = function(t5, e5) {
|
|
134
|
-
for (var r5 = n3 << 3 | e5, a2 = s.getBCHTypeInfo(r5), u3 = 0; u3 < 15; u3 += 1) {
|
|
135
|
-
var c2 = !t5 && 1 == (a2 >> u3 & 1);
|
|
136
|
-
u3 < 6 ? o3[u3][8] = c2 : u3 < 8 ? o3[u3 + 1][8] = c2 : o3[i2 - 15 + u3][8] = c2;
|
|
137
|
-
}
|
|
138
|
-
for (u3 = 0; u3 < 15; u3 += 1)
|
|
139
|
-
c2 = !t5 && 1 == (a2 >> u3 & 1), u3 < 8 ? o3[8][i2 - u3 - 1] = c2 : u3 < 9 ? o3[8][15 - u3 - 1 + 1] = c2 : o3[8][15 - u3 - 1] = c2;
|
|
140
|
-
o3[i2 - 8][8] = !t5;
|
|
141
|
-
}, C = function(t5, e5) {
|
|
142
|
-
for (var r5 = -1, n4 = i2 - 1, a2 = 7, u3 = 0, c2 = s.getMaskFunction(e5), h2 = i2 - 1; h2 > 0; h2 -= 2)
|
|
143
|
-
for (6 == h2 && (h2 -= 1); ; ) {
|
|
144
|
-
for (var d2 = 0; d2 < 2; d2 += 1)
|
|
145
|
-
if (null == o3[n4][h2 - d2]) {
|
|
146
|
-
var l2 = false;
|
|
147
|
-
u3 < t5.length && (l2 = 1 == (t5[u3] >>> a2 & 1)), c2(n4, h2 - d2) && (l2 = !l2), o3[n4][h2 - d2] = l2, -1 == (a2 -= 1) && (u3 += 1, a2 = 7);
|
|
148
|
-
}
|
|
149
|
-
if ((n4 += r5) < 0 || i2 <= n4) {
|
|
150
|
-
n4 -= r5, r5 = -r5;
|
|
151
|
-
break;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}, P = function(t5, e5, r5) {
|
|
155
|
-
for (var n4 = h.getRSBlocks(t5, e5), o4 = d(), i3 = 0; i3 < r5.length; i3 += 1) {
|
|
156
|
-
var a2 = r5[i3];
|
|
157
|
-
o4.put(a2.getMode(), 4), o4.put(a2.getLength(), s.getLengthInBits(a2.getMode(), t5)), a2.write(o4);
|
|
158
|
-
}
|
|
159
|
-
var u3 = 0;
|
|
160
|
-
for (i3 = 0; i3 < n4.length; i3 += 1)
|
|
161
|
-
u3 += n4[i3].dataCount;
|
|
162
|
-
if (o4.getLengthInBits() > 8 * u3)
|
|
163
|
-
throw "code length overflow. (" + o4.getLengthInBits() + ">" + 8 * u3 + ")";
|
|
164
|
-
for (o4.getLengthInBits() + 4 <= 8 * u3 && o4.put(0, 4); o4.getLengthInBits() % 8 != 0; )
|
|
165
|
-
o4.putBit(false);
|
|
166
|
-
for (; !(o4.getLengthInBits() >= 8 * u3 || (o4.put(236, 8), o4.getLengthInBits() >= 8 * u3)); )
|
|
167
|
-
o4.put(17, 8);
|
|
168
|
-
return function(t6, e6) {
|
|
169
|
-
for (var r6 = 0, n5 = 0, o5 = 0, i4 = new Array(e6.length), a3 = new Array(e6.length), u4 = 0; u4 < e6.length; u4 += 1) {
|
|
170
|
-
var h2 = e6[u4].dataCount, d2 = e6[u4].totalCount - h2;
|
|
171
|
-
n5 = Math.max(n5, h2), o5 = Math.max(o5, d2), i4[u4] = new Array(h2);
|
|
172
|
-
for (var l2 = 0; l2 < i4[u4].length; l2 += 1)
|
|
173
|
-
i4[u4][l2] = 255 & t6.getBuffer()[l2 + r6];
|
|
174
|
-
r6 += h2;
|
|
175
|
-
var f2 = s.getErrorCorrectPolynomial(d2), p2 = c(i4[u4], f2.getLength() - 1).mod(f2);
|
|
176
|
-
for (a3[u4] = new Array(f2.getLength() - 1), l2 = 0; l2 < a3[u4].length; l2 += 1) {
|
|
177
|
-
var g2 = l2 + p2.getLength() - a3[u4].length;
|
|
178
|
-
a3[u4][l2] = g2 >= 0 ? p2.getAt(g2) : 0;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
var v3 = 0;
|
|
182
|
-
for (l2 = 0; l2 < e6.length; l2 += 1)
|
|
183
|
-
v3 += e6[l2].totalCount;
|
|
184
|
-
var y3 = new Array(v3), w2 = 0;
|
|
185
|
-
for (l2 = 0; l2 < n5; l2 += 1)
|
|
186
|
-
for (u4 = 0; u4 < e6.length; u4 += 1)
|
|
187
|
-
l2 < i4[u4].length && (y3[w2] = i4[u4][l2], w2 += 1);
|
|
188
|
-
for (l2 = 0; l2 < o5; l2 += 1)
|
|
189
|
-
for (u4 = 0; u4 < e6.length; u4 += 1)
|
|
190
|
-
l2 < a3[u4].length && (y3[w2] = a3[u4][l2], w2 += 1);
|
|
191
|
-
return y3;
|
|
192
|
-
}(o4, n4);
|
|
193
|
-
};
|
|
194
|
-
y2.addData = function(t5, e5) {
|
|
195
|
-
var r5 = null;
|
|
196
|
-
switch (e5 = e5 || "Byte") {
|
|
197
|
-
case "Numeric":
|
|
198
|
-
r5 = l(t5);
|
|
199
|
-
break;
|
|
200
|
-
case "Alphanumeric":
|
|
201
|
-
r5 = f(t5);
|
|
202
|
-
break;
|
|
203
|
-
case "Byte":
|
|
204
|
-
r5 = p(t5);
|
|
205
|
-
break;
|
|
206
|
-
case "Kanji":
|
|
207
|
-
r5 = g(t5);
|
|
208
|
-
break;
|
|
209
|
-
default:
|
|
210
|
-
throw "mode:" + e5;
|
|
211
|
-
}
|
|
212
|
-
v2.push(r5), u2 = null;
|
|
213
|
-
}, y2.isDark = function(t5, e5) {
|
|
214
|
-
if (t5 < 0 || i2 <= t5 || e5 < 0 || i2 <= e5)
|
|
215
|
-
throw t5 + "," + e5;
|
|
216
|
-
return o3[t5][e5];
|
|
217
|
-
}, y2.getModuleCount = function() {
|
|
218
|
-
return i2;
|
|
219
|
-
}, y2.make = function() {
|
|
220
|
-
if (r4 < 1) {
|
|
221
|
-
for (var t5 = 1; t5 < 40; t5++) {
|
|
222
|
-
for (var e5 = h.getRSBlocks(t5, n3), o4 = d(), i3 = 0; i3 < v2.length; i3++) {
|
|
223
|
-
var a2 = v2[i3];
|
|
224
|
-
o4.put(a2.getMode(), 4), o4.put(a2.getLength(), s.getLengthInBits(a2.getMode(), t5)), a2.write(o4);
|
|
225
|
-
}
|
|
226
|
-
var u3 = 0;
|
|
227
|
-
for (i3 = 0; i3 < e5.length; i3++)
|
|
228
|
-
u3 += e5[i3].dataCount;
|
|
229
|
-
if (o4.getLengthInBits() <= 8 * u3)
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
232
|
-
r4 = t5;
|
|
233
|
-
}
|
|
234
|
-
_(false, function() {
|
|
235
|
-
for (var t6 = 0, e6 = 0, r5 = 0; r5 < 8; r5 += 1) {
|
|
236
|
-
_(true, r5);
|
|
237
|
-
var n4 = s.getLostPoint(y2);
|
|
238
|
-
(0 == r5 || t6 > n4) && (t6 = n4, e6 = r5);
|
|
239
|
-
}
|
|
240
|
-
return e6;
|
|
241
|
-
}());
|
|
242
|
-
}, y2.createTableTag = function(t5, e5) {
|
|
243
|
-
t5 = t5 || 2;
|
|
244
|
-
var r5 = "";
|
|
245
|
-
r5 += '<table style="', r5 += " border-width: 0px; border-style: none;", r5 += " border-collapse: collapse;", r5 += " padding: 0px; margin: " + (e5 = void 0 === e5 ? 4 * t5 : e5) + "px;", r5 += '">', r5 += "<tbody>";
|
|
246
|
-
for (var n4 = 0; n4 < y2.getModuleCount(); n4 += 1) {
|
|
247
|
-
r5 += "<tr>";
|
|
248
|
-
for (var o4 = 0; o4 < y2.getModuleCount(); o4 += 1)
|
|
249
|
-
r5 += '<td style="', r5 += " border-width: 0px; border-style: none;", r5 += " border-collapse: collapse;", r5 += " padding: 0px; margin: 0px;", r5 += " width: " + t5 + "px;", r5 += " height: " + t5 + "px;", r5 += " background-color: ", r5 += y2.isDark(n4, o4) ? "#000000" : "#ffffff", r5 += ";", r5 += '"/>';
|
|
250
|
-
r5 += "</tr>";
|
|
251
|
-
}
|
|
252
|
-
return (r5 += "</tbody>") + "</table>";
|
|
253
|
-
}, y2.createSvgTag = function(t5, e5, r5, n4) {
|
|
254
|
-
var o4 = {};
|
|
255
|
-
"object" == typeof arguments[0] && (t5 = (o4 = arguments[0]).cellSize, e5 = o4.margin, r5 = o4.alt, n4 = o4.title), t5 = t5 || 2, e5 = void 0 === e5 ? 4 * t5 : e5, (r5 = "string" == typeof r5 ? { text: r5 } : r5 || {}).text = r5.text || null, r5.id = r5.text ? r5.id || "qrcode-description" : null, (n4 = "string" == typeof n4 ? { text: n4 } : n4 || {}).text = n4.text || null, n4.id = n4.text ? n4.id || "qrcode-title" : null;
|
|
256
|
-
var i3, a2, s2, u3, c2 = y2.getModuleCount() * t5 + 2 * e5, h2 = "";
|
|
257
|
-
for (u3 = "l" + t5 + ",0 0," + t5 + " -" + t5 + ",0 0,-" + t5 + "z ", h2 += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"', h2 += o4.scalable ? "" : ' width="' + c2 + 'px" height="' + c2 + 'px"', h2 += ' viewBox="0 0 ' + c2 + " " + c2 + '" ', h2 += ' preserveAspectRatio="xMinYMin meet"', h2 += n4.text || r5.text ? ' role="img" aria-labelledby="' + O([n4.id, r5.id].join(" ").trim()) + '"' : "", h2 += ">", h2 += n4.text ? '<title id="' + O(n4.id) + '">' + O(n4.text) + "</title>" : "", h2 += r5.text ? '<description id="' + O(r5.id) + '">' + O(r5.text) + "</description>" : "", h2 += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>', h2 += '<path d="', a2 = 0; a2 < y2.getModuleCount(); a2 += 1)
|
|
258
|
-
for (s2 = a2 * t5 + e5, i3 = 0; i3 < y2.getModuleCount(); i3 += 1)
|
|
259
|
-
y2.isDark(a2, i3) && (h2 += "M" + (i3 * t5 + e5) + "," + s2 + u3);
|
|
260
|
-
return (h2 += '" stroke="transparent" fill="black"/>') + "</svg>";
|
|
261
|
-
}, y2.createDataURL = function(t5, e5) {
|
|
262
|
-
t5 = t5 || 2, e5 = void 0 === e5 ? 4 * t5 : e5;
|
|
263
|
-
var r5 = y2.getModuleCount() * t5 + 2 * e5, n4 = e5, o4 = r5 - e5;
|
|
264
|
-
return w(r5, r5, function(e6, r6) {
|
|
265
|
-
if (n4 <= e6 && e6 < o4 && n4 <= r6 && r6 < o4) {
|
|
266
|
-
var i3 = Math.floor((e6 - n4) / t5), a2 = Math.floor((r6 - n4) / t5);
|
|
267
|
-
return y2.isDark(a2, i3) ? 0 : 1;
|
|
268
|
-
}
|
|
269
|
-
return 1;
|
|
270
|
-
});
|
|
271
|
-
}, y2.createImgTag = function(t5, e5, r5) {
|
|
272
|
-
t5 = t5 || 2, e5 = void 0 === e5 ? 4 * t5 : e5;
|
|
273
|
-
var n4 = y2.getModuleCount() * t5 + 2 * e5, o4 = "";
|
|
274
|
-
return o4 += "<img", o4 += ' src="', o4 += y2.createDataURL(t5, e5), o4 += '"', o4 += ' width="', o4 += n4, o4 += '"', o4 += ' height="', o4 += n4, o4 += '"', r5 && (o4 += ' alt="', o4 += O(r5), o4 += '"'), o4 + "/>";
|
|
275
|
-
};
|
|
276
|
-
var O = function(t5) {
|
|
277
|
-
for (var e5 = "", r5 = 0; r5 < t5.length; r5 += 1) {
|
|
278
|
-
var n4 = t5.charAt(r5);
|
|
279
|
-
switch (n4) {
|
|
280
|
-
case "<":
|
|
281
|
-
e5 += "<";
|
|
282
|
-
break;
|
|
283
|
-
case ">":
|
|
284
|
-
e5 += ">";
|
|
285
|
-
break;
|
|
286
|
-
case "&":
|
|
287
|
-
e5 += "&";
|
|
288
|
-
break;
|
|
289
|
-
case '"':
|
|
290
|
-
e5 += """;
|
|
291
|
-
break;
|
|
292
|
-
default:
|
|
293
|
-
e5 += n4;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
return e5;
|
|
297
|
-
};
|
|
298
|
-
return y2.createASCII = function(t5, e5) {
|
|
299
|
-
if ((t5 = t5 || 1) < 2)
|
|
300
|
-
return function(t6) {
|
|
301
|
-
t6 = void 0 === t6 ? 2 : t6;
|
|
302
|
-
var e6, r6, n5, o5, i4, a3 = 1 * y2.getModuleCount() + 2 * t6, s3 = t6, u4 = a3 - t6, c3 = { "\u2588\u2588": "\u2588", "\u2588 ": "\u2580", " \u2588": "\u2584", " ": " " }, h3 = { "\u2588\u2588": "\u2580", "\u2588 ": "\u2580", " \u2588": " ", " ": " " }, d3 = "";
|
|
303
|
-
for (e6 = 0; e6 < a3; e6 += 2) {
|
|
304
|
-
for (n5 = Math.floor((e6 - s3) / 1), o5 = Math.floor((e6 + 1 - s3) / 1), r6 = 0; r6 < a3; r6 += 1)
|
|
305
|
-
i4 = "\u2588", s3 <= r6 && r6 < u4 && s3 <= e6 && e6 < u4 && y2.isDark(n5, Math.floor((r6 - s3) / 1)) && (i4 = " "), s3 <= r6 && r6 < u4 && s3 <= e6 + 1 && e6 + 1 < u4 && y2.isDark(o5, Math.floor((r6 - s3) / 1)) ? i4 += " " : i4 += "\u2588", d3 += t6 < 1 && e6 + 1 >= u4 ? h3[i4] : c3[i4];
|
|
306
|
-
d3 += "\n";
|
|
307
|
-
}
|
|
308
|
-
return a3 % 2 && t6 > 0 ? d3.substring(0, d3.length - a3 - 1) + Array(a3 + 1).join("\u2580") : d3.substring(0, d3.length - 1);
|
|
309
|
-
}(e5);
|
|
310
|
-
t5 -= 1, e5 = void 0 === e5 ? 2 * t5 : e5;
|
|
311
|
-
var r5, n4, o4, i3, a2 = y2.getModuleCount() * t5 + 2 * e5, s2 = e5, u3 = a2 - e5, c2 = Array(t5 + 1).join("\u2588\u2588"), h2 = Array(t5 + 1).join(" "), d2 = "", l2 = "";
|
|
312
|
-
for (r5 = 0; r5 < a2; r5 += 1) {
|
|
313
|
-
for (o4 = Math.floor((r5 - s2) / t5), l2 = "", n4 = 0; n4 < a2; n4 += 1)
|
|
314
|
-
i3 = 1, s2 <= n4 && n4 < u3 && s2 <= r5 && r5 < u3 && y2.isDark(o4, Math.floor((n4 - s2) / t5)) && (i3 = 0), l2 += i3 ? c2 : h2;
|
|
315
|
-
for (o4 = 0; o4 < t5; o4 += 1)
|
|
316
|
-
d2 += l2 + "\n";
|
|
317
|
-
}
|
|
318
|
-
return d2.substring(0, d2.length - 1);
|
|
319
|
-
}, y2.renderTo2dContext = function(t5, e5) {
|
|
320
|
-
e5 = e5 || 2;
|
|
321
|
-
for (var r5 = y2.getModuleCount(), n4 = 0; n4 < r5; n4++)
|
|
322
|
-
for (var o4 = 0; o4 < r5; o4++)
|
|
323
|
-
t5.fillStyle = y2.isDark(n4, o4) ? "black" : "white", t5.fillRect(n4 * e5, o4 * e5, e5, e5);
|
|
324
|
-
}, y2;
|
|
325
|
-
};
|
|
326
|
-
t3.stringToBytes = (t3.stringToBytesFuncs = { default: function(t4) {
|
|
327
|
-
for (var e4 = [], r4 = 0; r4 < t4.length; r4 += 1) {
|
|
328
|
-
var n3 = t4.charCodeAt(r4);
|
|
329
|
-
e4.push(255 & n3);
|
|
330
|
-
}
|
|
331
|
-
return e4;
|
|
332
|
-
} }).default, t3.createStringToBytes = function(t4, e4) {
|
|
333
|
-
var r4 = function() {
|
|
334
|
-
for (var r5 = y(t4), n4 = function() {
|
|
335
|
-
var t5 = r5.read();
|
|
336
|
-
if (-1 == t5)
|
|
337
|
-
throw "eof";
|
|
338
|
-
return t5;
|
|
339
|
-
}, o3 = 0, i2 = {}; ; ) {
|
|
340
|
-
var a2 = r5.read();
|
|
341
|
-
if (-1 == a2)
|
|
342
|
-
break;
|
|
343
|
-
var s2 = n4(), u2 = n4() << 8 | n4();
|
|
344
|
-
i2[String.fromCharCode(a2 << 8 | s2)] = u2, o3 += 1;
|
|
345
|
-
}
|
|
346
|
-
if (o3 != e4)
|
|
347
|
-
throw o3 + " != " + e4;
|
|
348
|
-
return i2;
|
|
349
|
-
}(), n3 = "?".charCodeAt(0);
|
|
350
|
-
return function(t5) {
|
|
351
|
-
for (var e5 = [], o3 = 0; o3 < t5.length; o3 += 1) {
|
|
352
|
-
var i2 = t5.charCodeAt(o3);
|
|
353
|
-
if (i2 < 128)
|
|
354
|
-
e5.push(i2);
|
|
355
|
-
else {
|
|
356
|
-
var a2 = r4[t5.charAt(o3)];
|
|
357
|
-
"number" == typeof a2 ? (255 & a2) == a2 ? e5.push(a2) : (e5.push(a2 >>> 8), e5.push(255 & a2)) : e5.push(n3);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
return e5;
|
|
361
|
-
};
|
|
362
|
-
};
|
|
363
|
-
var e3, r3, n2, o2, i, a = { L: 1, M: 0, Q: 3, H: 2 }, s = (e3 = [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]], r3 = 1335, n2 = 7973, i = function(t4) {
|
|
364
|
-
for (var e4 = 0; 0 != t4; )
|
|
365
|
-
e4 += 1, t4 >>>= 1;
|
|
366
|
-
return e4;
|
|
367
|
-
}, (o2 = {}).getBCHTypeInfo = function(t4) {
|
|
368
|
-
for (var e4 = t4 << 10; i(e4) - i(r3) >= 0; )
|
|
369
|
-
e4 ^= r3 << i(e4) - i(r3);
|
|
370
|
-
return 21522 ^ (t4 << 10 | e4);
|
|
371
|
-
}, o2.getBCHTypeNumber = function(t4) {
|
|
372
|
-
for (var e4 = t4 << 12; i(e4) - i(n2) >= 0; )
|
|
373
|
-
e4 ^= n2 << i(e4) - i(n2);
|
|
374
|
-
return t4 << 12 | e4;
|
|
375
|
-
}, o2.getPatternPosition = function(t4) {
|
|
376
|
-
return e3[t4 - 1];
|
|
377
|
-
}, o2.getMaskFunction = function(t4) {
|
|
378
|
-
switch (t4) {
|
|
379
|
-
case 0:
|
|
380
|
-
return function(t5, e4) {
|
|
381
|
-
return (t5 + e4) % 2 == 0;
|
|
382
|
-
};
|
|
383
|
-
case 1:
|
|
384
|
-
return function(t5, e4) {
|
|
385
|
-
return t5 % 2 == 0;
|
|
386
|
-
};
|
|
387
|
-
case 2:
|
|
388
|
-
return function(t5, e4) {
|
|
389
|
-
return e4 % 3 == 0;
|
|
390
|
-
};
|
|
391
|
-
case 3:
|
|
392
|
-
return function(t5, e4) {
|
|
393
|
-
return (t5 + e4) % 3 == 0;
|
|
394
|
-
};
|
|
395
|
-
case 4:
|
|
396
|
-
return function(t5, e4) {
|
|
397
|
-
return (Math.floor(t5 / 2) + Math.floor(e4 / 3)) % 2 == 0;
|
|
398
|
-
};
|
|
399
|
-
case 5:
|
|
400
|
-
return function(t5, e4) {
|
|
401
|
-
return t5 * e4 % 2 + t5 * e4 % 3 == 0;
|
|
402
|
-
};
|
|
403
|
-
case 6:
|
|
404
|
-
return function(t5, e4) {
|
|
405
|
-
return (t5 * e4 % 2 + t5 * e4 % 3) % 2 == 0;
|
|
406
|
-
};
|
|
407
|
-
case 7:
|
|
408
|
-
return function(t5, e4) {
|
|
409
|
-
return (t5 * e4 % 3 + (t5 + e4) % 2) % 2 == 0;
|
|
410
|
-
};
|
|
411
|
-
default:
|
|
412
|
-
throw "bad maskPattern:" + t4;
|
|
413
|
-
}
|
|
414
|
-
}, o2.getErrorCorrectPolynomial = function(t4) {
|
|
415
|
-
for (var e4 = c([1], 0), r4 = 0; r4 < t4; r4 += 1)
|
|
416
|
-
e4 = e4.multiply(c([1, u.gexp(r4)], 0));
|
|
417
|
-
return e4;
|
|
418
|
-
}, o2.getLengthInBits = function(t4, e4) {
|
|
419
|
-
if (1 <= e4 && e4 < 10)
|
|
420
|
-
switch (t4) {
|
|
421
|
-
case 1:
|
|
422
|
-
return 10;
|
|
423
|
-
case 2:
|
|
424
|
-
return 9;
|
|
425
|
-
case 4:
|
|
426
|
-
case 8:
|
|
427
|
-
return 8;
|
|
428
|
-
default:
|
|
429
|
-
throw "mode:" + t4;
|
|
430
|
-
}
|
|
431
|
-
else if (e4 < 27)
|
|
432
|
-
switch (t4) {
|
|
433
|
-
case 1:
|
|
434
|
-
return 12;
|
|
435
|
-
case 2:
|
|
436
|
-
return 11;
|
|
437
|
-
case 4:
|
|
438
|
-
return 16;
|
|
439
|
-
case 8:
|
|
440
|
-
return 10;
|
|
441
|
-
default:
|
|
442
|
-
throw "mode:" + t4;
|
|
443
|
-
}
|
|
444
|
-
else {
|
|
445
|
-
if (!(e4 < 41))
|
|
446
|
-
throw "type:" + e4;
|
|
447
|
-
switch (t4) {
|
|
448
|
-
case 1:
|
|
449
|
-
return 14;
|
|
450
|
-
case 2:
|
|
451
|
-
return 13;
|
|
452
|
-
case 4:
|
|
453
|
-
return 16;
|
|
454
|
-
case 8:
|
|
455
|
-
return 12;
|
|
456
|
-
default:
|
|
457
|
-
throw "mode:" + t4;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
}, o2.getLostPoint = function(t4) {
|
|
461
|
-
for (var e4 = t4.getModuleCount(), r4 = 0, n3 = 0; n3 < e4; n3 += 1)
|
|
462
|
-
for (var o3 = 0; o3 < e4; o3 += 1) {
|
|
463
|
-
for (var i2 = 0, a2 = t4.isDark(n3, o3), s2 = -1; s2 <= 1; s2 += 1)
|
|
464
|
-
if (!(n3 + s2 < 0 || e4 <= n3 + s2))
|
|
465
|
-
for (var u2 = -1; u2 <= 1; u2 += 1)
|
|
466
|
-
o3 + u2 < 0 || e4 <= o3 + u2 || 0 == s2 && 0 == u2 || a2 == t4.isDark(n3 + s2, o3 + u2) && (i2 += 1);
|
|
467
|
-
i2 > 5 && (r4 += 3 + i2 - 5);
|
|
468
|
-
}
|
|
469
|
-
for (n3 = 0; n3 < e4 - 1; n3 += 1)
|
|
470
|
-
for (o3 = 0; o3 < e4 - 1; o3 += 1) {
|
|
471
|
-
var c2 = 0;
|
|
472
|
-
t4.isDark(n3, o3) && (c2 += 1), t4.isDark(n3 + 1, o3) && (c2 += 1), t4.isDark(n3, o3 + 1) && (c2 += 1), t4.isDark(n3 + 1, o3 + 1) && (c2 += 1), 0 != c2 && 4 != c2 || (r4 += 3);
|
|
473
|
-
}
|
|
474
|
-
for (n3 = 0; n3 < e4; n3 += 1)
|
|
475
|
-
for (o3 = 0; o3 < e4 - 6; o3 += 1)
|
|
476
|
-
t4.isDark(n3, o3) && !t4.isDark(n3, o3 + 1) && t4.isDark(n3, o3 + 2) && t4.isDark(n3, o3 + 3) && t4.isDark(n3, o3 + 4) && !t4.isDark(n3, o3 + 5) && t4.isDark(n3, o3 + 6) && (r4 += 40);
|
|
477
|
-
for (o3 = 0; o3 < e4; o3 += 1)
|
|
478
|
-
for (n3 = 0; n3 < e4 - 6; n3 += 1)
|
|
479
|
-
t4.isDark(n3, o3) && !t4.isDark(n3 + 1, o3) && t4.isDark(n3 + 2, o3) && t4.isDark(n3 + 3, o3) && t4.isDark(n3 + 4, o3) && !t4.isDark(n3 + 5, o3) && t4.isDark(n3 + 6, o3) && (r4 += 40);
|
|
480
|
-
var h2 = 0;
|
|
481
|
-
for (o3 = 0; o3 < e4; o3 += 1)
|
|
482
|
-
for (n3 = 0; n3 < e4; n3 += 1)
|
|
483
|
-
t4.isDark(n3, o3) && (h2 += 1);
|
|
484
|
-
return r4 + Math.abs(100 * h2 / e4 / e4 - 50) / 5 * 10;
|
|
485
|
-
}, o2), u = function() {
|
|
486
|
-
for (var t4 = new Array(256), e4 = new Array(256), r4 = 0; r4 < 8; r4 += 1)
|
|
487
|
-
t4[r4] = 1 << r4;
|
|
488
|
-
for (r4 = 8; r4 < 256; r4 += 1)
|
|
489
|
-
t4[r4] = t4[r4 - 4] ^ t4[r4 - 5] ^ t4[r4 - 6] ^ t4[r4 - 8];
|
|
490
|
-
for (r4 = 0; r4 < 255; r4 += 1)
|
|
491
|
-
e4[t4[r4]] = r4;
|
|
492
|
-
return { glog: function(t5) {
|
|
493
|
-
if (t5 < 1)
|
|
494
|
-
throw "glog(" + t5 + ")";
|
|
495
|
-
return e4[t5];
|
|
496
|
-
}, gexp: function(e5) {
|
|
497
|
-
for (; e5 < 0; )
|
|
498
|
-
e5 += 255;
|
|
499
|
-
for (; e5 >= 256; )
|
|
500
|
-
e5 -= 255;
|
|
501
|
-
return t4[e5];
|
|
502
|
-
} };
|
|
503
|
-
}();
|
|
504
|
-
function c(t4, e4) {
|
|
505
|
-
if (void 0 === t4.length)
|
|
506
|
-
throw t4.length + "/" + e4;
|
|
507
|
-
var r4 = function() {
|
|
508
|
-
for (var r5 = 0; r5 < t4.length && 0 == t4[r5]; )
|
|
509
|
-
r5 += 1;
|
|
510
|
-
for (var n4 = new Array(t4.length - r5 + e4), o3 = 0; o3 < t4.length - r5; o3 += 1)
|
|
511
|
-
n4[o3] = t4[o3 + r5];
|
|
512
|
-
return n4;
|
|
513
|
-
}(), n3 = { getAt: function(t5) {
|
|
514
|
-
return r4[t5];
|
|
515
|
-
}, getLength: function() {
|
|
516
|
-
return r4.length;
|
|
517
|
-
}, multiply: function(t5) {
|
|
518
|
-
for (var e5 = new Array(n3.getLength() + t5.getLength() - 1), r5 = 0; r5 < n3.getLength(); r5 += 1)
|
|
519
|
-
for (var o3 = 0; o3 < t5.getLength(); o3 += 1)
|
|
520
|
-
e5[r5 + o3] ^= u.gexp(u.glog(n3.getAt(r5)) + u.glog(t5.getAt(o3)));
|
|
521
|
-
return c(e5, 0);
|
|
522
|
-
}, mod: function(t5) {
|
|
523
|
-
if (n3.getLength() - t5.getLength() < 0)
|
|
524
|
-
return n3;
|
|
525
|
-
for (var e5 = u.glog(n3.getAt(0)) - u.glog(t5.getAt(0)), r5 = new Array(n3.getLength()), o3 = 0; o3 < n3.getLength(); o3 += 1)
|
|
526
|
-
r5[o3] = n3.getAt(o3);
|
|
527
|
-
for (o3 = 0; o3 < t5.getLength(); o3 += 1)
|
|
528
|
-
r5[o3] ^= u.gexp(u.glog(t5.getAt(o3)) + e5);
|
|
529
|
-
return c(r5, 0).mod(t5);
|
|
530
|
-
} };
|
|
531
|
-
return n3;
|
|
532
|
-
}
|
|
533
|
-
var h = function() {
|
|
534
|
-
var t4 = [[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]], e4 = function(t5, e5) {
|
|
535
|
-
var r5 = {};
|
|
536
|
-
return r5.totalCount = t5, r5.dataCount = e5, r5;
|
|
537
|
-
}, r4 = { getRSBlocks: function(r5, n3) {
|
|
538
|
-
var o3 = function(e5, r6) {
|
|
539
|
-
switch (r6) {
|
|
540
|
-
case a.L:
|
|
541
|
-
return t4[4 * (e5 - 1) + 0];
|
|
542
|
-
case a.M:
|
|
543
|
-
return t4[4 * (e5 - 1) + 1];
|
|
544
|
-
case a.Q:
|
|
545
|
-
return t4[4 * (e5 - 1) + 2];
|
|
546
|
-
case a.H:
|
|
547
|
-
return t4[4 * (e5 - 1) + 3];
|
|
548
|
-
default:
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
}(r5, n3);
|
|
552
|
-
if (void 0 === o3)
|
|
553
|
-
throw "bad rs block @ typeNumber:" + r5 + "/errorCorrectionLevel:" + n3;
|
|
554
|
-
for (var i2 = o3.length / 3, s2 = [], u2 = 0; u2 < i2; u2 += 1)
|
|
555
|
-
for (var c2 = o3[3 * u2 + 0], h2 = o3[3 * u2 + 1], d2 = o3[3 * u2 + 2], l2 = 0; l2 < c2; l2 += 1)
|
|
556
|
-
s2.push(e4(h2, d2));
|
|
557
|
-
return s2;
|
|
558
|
-
} };
|
|
559
|
-
return r4;
|
|
560
|
-
}(), d = function() {
|
|
561
|
-
var t4 = [], e4 = 0, r4 = { getBuffer: function() {
|
|
562
|
-
return t4;
|
|
563
|
-
}, getAt: function(e5) {
|
|
564
|
-
var r5 = Math.floor(e5 / 8);
|
|
565
|
-
return 1 == (t4[r5] >>> 7 - e5 % 8 & 1);
|
|
566
|
-
}, put: function(t5, e5) {
|
|
567
|
-
for (var n3 = 0; n3 < e5; n3 += 1)
|
|
568
|
-
r4.putBit(1 == (t5 >>> e5 - n3 - 1 & 1));
|
|
569
|
-
}, getLengthInBits: function() {
|
|
570
|
-
return e4;
|
|
571
|
-
}, putBit: function(r5) {
|
|
572
|
-
var n3 = Math.floor(e4 / 8);
|
|
573
|
-
t4.length <= n3 && t4.push(0), r5 && (t4[n3] |= 128 >>> e4 % 8), e4 += 1;
|
|
574
|
-
} };
|
|
575
|
-
return r4;
|
|
576
|
-
}, l = function(t4) {
|
|
577
|
-
var e4 = t4, r4 = { getMode: function() {
|
|
578
|
-
return 1;
|
|
579
|
-
}, getLength: function(t5) {
|
|
580
|
-
return e4.length;
|
|
581
|
-
}, write: function(t5) {
|
|
582
|
-
for (var r5 = e4, o4 = 0; o4 + 2 < r5.length; )
|
|
583
|
-
t5.put(n3(r5.substring(o4, o4 + 3)), 10), o4 += 3;
|
|
584
|
-
o4 < r5.length && (r5.length - o4 == 1 ? t5.put(n3(r5.substring(o4, o4 + 1)), 4) : r5.length - o4 == 2 && t5.put(n3(r5.substring(o4, o4 + 2)), 7));
|
|
585
|
-
} }, n3 = function(t5) {
|
|
586
|
-
for (var e5 = 0, r5 = 0; r5 < t5.length; r5 += 1)
|
|
587
|
-
e5 = 10 * e5 + o3(t5.charAt(r5));
|
|
588
|
-
return e5;
|
|
589
|
-
}, o3 = function(t5) {
|
|
590
|
-
if ("0" <= t5 && t5 <= "9")
|
|
591
|
-
return t5.charCodeAt(0) - "0".charCodeAt(0);
|
|
592
|
-
throw "illegal char :" + t5;
|
|
593
|
-
};
|
|
594
|
-
return r4;
|
|
595
|
-
}, f = function(t4) {
|
|
596
|
-
var e4 = t4, r4 = { getMode: function() {
|
|
597
|
-
return 2;
|
|
598
|
-
}, getLength: function(t5) {
|
|
599
|
-
return e4.length;
|
|
600
|
-
}, write: function(t5) {
|
|
601
|
-
for (var r5 = e4, o3 = 0; o3 + 1 < r5.length; )
|
|
602
|
-
t5.put(45 * n3(r5.charAt(o3)) + n3(r5.charAt(o3 + 1)), 11), o3 += 2;
|
|
603
|
-
o3 < r5.length && t5.put(n3(r5.charAt(o3)), 6);
|
|
604
|
-
} }, n3 = function(t5) {
|
|
605
|
-
if ("0" <= t5 && t5 <= "9")
|
|
606
|
-
return t5.charCodeAt(0) - "0".charCodeAt(0);
|
|
607
|
-
if ("A" <= t5 && t5 <= "Z")
|
|
608
|
-
return t5.charCodeAt(0) - "A".charCodeAt(0) + 10;
|
|
609
|
-
switch (t5) {
|
|
610
|
-
case " ":
|
|
611
|
-
return 36;
|
|
612
|
-
case "$":
|
|
613
|
-
return 37;
|
|
614
|
-
case "%":
|
|
615
|
-
return 38;
|
|
616
|
-
case "*":
|
|
617
|
-
return 39;
|
|
618
|
-
case "+":
|
|
619
|
-
return 40;
|
|
620
|
-
case "-":
|
|
621
|
-
return 41;
|
|
622
|
-
case ".":
|
|
623
|
-
return 42;
|
|
624
|
-
case "/":
|
|
625
|
-
return 43;
|
|
626
|
-
case ":":
|
|
627
|
-
return 44;
|
|
628
|
-
default:
|
|
629
|
-
throw "illegal char :" + t5;
|
|
630
|
-
}
|
|
631
|
-
};
|
|
632
|
-
return r4;
|
|
633
|
-
}, p = function(e4) {
|
|
634
|
-
var r4 = t3.stringToBytes(e4);
|
|
635
|
-
return { getMode: function() {
|
|
636
|
-
return 4;
|
|
637
|
-
}, getLength: function(t4) {
|
|
638
|
-
return r4.length;
|
|
639
|
-
}, write: function(t4) {
|
|
640
|
-
for (var e5 = 0; e5 < r4.length; e5 += 1)
|
|
641
|
-
t4.put(r4[e5], 8);
|
|
642
|
-
} };
|
|
643
|
-
}, g = function(e4) {
|
|
644
|
-
var r4 = t3.stringToBytesFuncs.SJIS;
|
|
645
|
-
if (!r4)
|
|
646
|
-
throw "sjis not supported.";
|
|
647
|
-
!function(t4, e5) {
|
|
648
|
-
var n4 = r4("\u53CB");
|
|
649
|
-
if (2 != n4.length || 38726 != (n4[0] << 8 | n4[1]))
|
|
650
|
-
throw "sjis not supported.";
|
|
651
|
-
}();
|
|
652
|
-
var n3 = r4(e4);
|
|
653
|
-
return { getMode: function() {
|
|
654
|
-
return 8;
|
|
655
|
-
}, getLength: function(t4) {
|
|
656
|
-
return ~~(n3.length / 2);
|
|
657
|
-
}, write: function(t4) {
|
|
658
|
-
for (var e5 = n3, r5 = 0; r5 + 1 < e5.length; ) {
|
|
659
|
-
var o3 = (255 & e5[r5]) << 8 | 255 & e5[r5 + 1];
|
|
660
|
-
if (33088 <= o3 && o3 <= 40956)
|
|
661
|
-
o3 -= 33088;
|
|
662
|
-
else {
|
|
663
|
-
if (!(57408 <= o3 && o3 <= 60351))
|
|
664
|
-
throw "illegal char at " + (r5 + 1) + "/" + o3;
|
|
665
|
-
o3 -= 49472;
|
|
666
|
-
}
|
|
667
|
-
o3 = 192 * (o3 >>> 8 & 255) + (255 & o3), t4.put(o3, 13), r5 += 2;
|
|
668
|
-
}
|
|
669
|
-
if (r5 < e5.length)
|
|
670
|
-
throw "illegal char at " + (r5 + 1);
|
|
671
|
-
} };
|
|
672
|
-
}, v = function() {
|
|
673
|
-
var t4 = [], e4 = { writeByte: function(e5) {
|
|
674
|
-
t4.push(255 & e5);
|
|
675
|
-
}, writeShort: function(t5) {
|
|
676
|
-
e4.writeByte(t5), e4.writeByte(t5 >>> 8);
|
|
677
|
-
}, writeBytes: function(t5, r4, n3) {
|
|
678
|
-
r4 = r4 || 0, n3 = n3 || t5.length;
|
|
679
|
-
for (var o3 = 0; o3 < n3; o3 += 1)
|
|
680
|
-
e4.writeByte(t5[o3 + r4]);
|
|
681
|
-
}, writeString: function(t5) {
|
|
682
|
-
for (var r4 = 0; r4 < t5.length; r4 += 1)
|
|
683
|
-
e4.writeByte(t5.charCodeAt(r4));
|
|
684
|
-
}, toByteArray: function() {
|
|
685
|
-
return t4;
|
|
686
|
-
}, toString: function() {
|
|
687
|
-
var e5 = "";
|
|
688
|
-
e5 += "[";
|
|
689
|
-
for (var r4 = 0; r4 < t4.length; r4 += 1)
|
|
690
|
-
r4 > 0 && (e5 += ","), e5 += t4[r4];
|
|
691
|
-
return e5 + "]";
|
|
692
|
-
} };
|
|
693
|
-
return e4;
|
|
694
|
-
}, y = function(t4) {
|
|
695
|
-
var e4 = t4, r4 = 0, n3 = 0, o3 = 0, i2 = { read: function() {
|
|
696
|
-
for (; o3 < 8; ) {
|
|
697
|
-
if (r4 >= e4.length) {
|
|
698
|
-
if (0 == o3)
|
|
699
|
-
return -1;
|
|
700
|
-
throw "unexpected end of file./" + o3;
|
|
701
|
-
}
|
|
702
|
-
var t5 = e4.charAt(r4);
|
|
703
|
-
if (r4 += 1, "=" == t5)
|
|
704
|
-
return o3 = 0, -1;
|
|
705
|
-
t5.match(/^\s$/) || (n3 = n3 << 6 | a2(t5.charCodeAt(0)), o3 += 6);
|
|
706
|
-
}
|
|
707
|
-
var i3 = n3 >>> o3 - 8 & 255;
|
|
708
|
-
return o3 -= 8, i3;
|
|
709
|
-
} }, a2 = function(t5) {
|
|
710
|
-
if (65 <= t5 && t5 <= 90)
|
|
711
|
-
return t5 - 65;
|
|
712
|
-
if (97 <= t5 && t5 <= 122)
|
|
713
|
-
return t5 - 97 + 26;
|
|
714
|
-
if (48 <= t5 && t5 <= 57)
|
|
715
|
-
return t5 - 48 + 52;
|
|
716
|
-
if (43 == t5)
|
|
717
|
-
return 62;
|
|
718
|
-
if (47 == t5)
|
|
719
|
-
return 63;
|
|
720
|
-
throw "c:" + t5;
|
|
721
|
-
};
|
|
722
|
-
return i2;
|
|
723
|
-
}, w = function(t4, e4, r4) {
|
|
724
|
-
for (var n3 = function(t5, e5) {
|
|
725
|
-
var r5 = t5, n4 = e5, o4 = new Array(t5 * e5), i3 = { setPixel: function(t6, e6, n5) {
|
|
726
|
-
o4[e6 * r5 + t6] = n5;
|
|
727
|
-
}, write: function(t6) {
|
|
728
|
-
t6.writeString("GIF87a"), t6.writeShort(r5), t6.writeShort(n4), t6.writeByte(128), t6.writeByte(0), t6.writeByte(0), t6.writeByte(0), t6.writeByte(0), t6.writeByte(0), t6.writeByte(255), t6.writeByte(255), t6.writeByte(255), t6.writeString(","), t6.writeShort(0), t6.writeShort(0), t6.writeShort(r5), t6.writeShort(n4), t6.writeByte(0);
|
|
729
|
-
var e6 = a3(2);
|
|
730
|
-
t6.writeByte(2);
|
|
731
|
-
for (var o5 = 0; e6.length - o5 > 255; )
|
|
732
|
-
t6.writeByte(255), t6.writeBytes(e6, o5, 255), o5 += 255;
|
|
733
|
-
t6.writeByte(e6.length - o5), t6.writeBytes(e6, o5, e6.length - o5), t6.writeByte(0), t6.writeString(";");
|
|
734
|
-
} }, a3 = function(t6) {
|
|
735
|
-
for (var e6 = 1 << t6, r6 = 1 + (1 << t6), n5 = t6 + 1, i4 = s3(), a4 = 0; a4 < e6; a4 += 1)
|
|
736
|
-
i4.add(String.fromCharCode(a4));
|
|
737
|
-
i4.add(String.fromCharCode(e6)), i4.add(String.fromCharCode(r6));
|
|
738
|
-
var u3, c3, h2, d2 = v(), l2 = (u3 = d2, c3 = 0, h2 = 0, { write: function(t7, e7) {
|
|
739
|
-
if (t7 >>> e7 != 0)
|
|
740
|
-
throw "length over";
|
|
741
|
-
for (; c3 + e7 >= 8; )
|
|
742
|
-
u3.writeByte(255 & (t7 << c3 | h2)), e7 -= 8 - c3, t7 >>>= 8 - c3, h2 = 0, c3 = 0;
|
|
743
|
-
h2 |= t7 << c3, c3 += e7;
|
|
744
|
-
}, flush: function() {
|
|
745
|
-
c3 > 0 && u3.writeByte(h2);
|
|
746
|
-
} });
|
|
747
|
-
l2.write(e6, n5);
|
|
748
|
-
var f2 = 0, p2 = String.fromCharCode(o4[f2]);
|
|
749
|
-
for (f2 += 1; f2 < o4.length; ) {
|
|
750
|
-
var g2 = String.fromCharCode(o4[f2]);
|
|
751
|
-
f2 += 1, i4.contains(p2 + g2) ? p2 += g2 : (l2.write(i4.indexOf(p2), n5), i4.size() < 4095 && (i4.size() == 1 << n5 && (n5 += 1), i4.add(p2 + g2)), p2 = g2);
|
|
752
|
-
}
|
|
753
|
-
return l2.write(i4.indexOf(p2), n5), l2.write(r6, n5), l2.flush(), d2.toByteArray();
|
|
754
|
-
}, s3 = function() {
|
|
755
|
-
var t6 = {}, e6 = 0, r6 = { add: function(n5) {
|
|
756
|
-
if (r6.contains(n5))
|
|
757
|
-
throw "dup key:" + n5;
|
|
758
|
-
t6[n5] = e6, e6 += 1;
|
|
759
|
-
}, size: function() {
|
|
760
|
-
return e6;
|
|
761
|
-
}, indexOf: function(e7) {
|
|
762
|
-
return t6[e7];
|
|
763
|
-
}, contains: function(e7) {
|
|
764
|
-
return void 0 !== t6[e7];
|
|
765
|
-
} };
|
|
766
|
-
return r6;
|
|
767
|
-
};
|
|
768
|
-
return i3;
|
|
769
|
-
}(t4, e4), o3 = 0; o3 < e4; o3 += 1)
|
|
770
|
-
for (var i2 = 0; i2 < t4; i2 += 1)
|
|
771
|
-
n3.setPixel(i2, o3, r4(i2, o3));
|
|
772
|
-
var a2 = v();
|
|
773
|
-
n3.write(a2);
|
|
774
|
-
for (var s2 = function() {
|
|
775
|
-
var t5 = 0, e5 = 0, r5 = 0, n4 = "", o4 = {}, i3 = function(t6) {
|
|
776
|
-
n4 += String.fromCharCode(a3(63 & t6));
|
|
777
|
-
}, a3 = function(t6) {
|
|
778
|
-
if (t6 < 0)
|
|
779
|
-
;
|
|
780
|
-
else {
|
|
781
|
-
if (t6 < 26)
|
|
782
|
-
return 65 + t6;
|
|
783
|
-
if (t6 < 52)
|
|
784
|
-
return t6 - 26 + 97;
|
|
785
|
-
if (t6 < 62)
|
|
786
|
-
return t6 - 52 + 48;
|
|
787
|
-
if (62 == t6)
|
|
788
|
-
return 43;
|
|
789
|
-
if (63 == t6)
|
|
790
|
-
return 47;
|
|
791
|
-
}
|
|
792
|
-
throw "n:" + t6;
|
|
793
|
-
};
|
|
794
|
-
return o4.writeByte = function(n5) {
|
|
795
|
-
for (t5 = t5 << 8 | 255 & n5, e5 += 8, r5 += 1; e5 >= 6; )
|
|
796
|
-
i3(t5 >>> e5 - 6), e5 -= 6;
|
|
797
|
-
}, o4.flush = function() {
|
|
798
|
-
if (e5 > 0 && (i3(t5 << 6 - e5), t5 = 0, e5 = 0), r5 % 3 != 0)
|
|
799
|
-
for (var o5 = 3 - r5 % 3, a4 = 0; a4 < o5; a4 += 1)
|
|
800
|
-
n4 += "=";
|
|
801
|
-
}, o4.toString = function() {
|
|
802
|
-
return n4;
|
|
803
|
-
}, o4;
|
|
804
|
-
}(), u2 = a2.toByteArray(), c2 = 0; c2 < u2.length; c2 += 1)
|
|
805
|
-
s2.writeByte(u2[c2]);
|
|
806
|
-
return s2.flush(), "data:image/gif;base64," + s2;
|
|
807
|
-
};
|
|
808
|
-
return t3;
|
|
809
|
-
}();
|
|
810
|
-
o.stringToBytesFuncs["UTF-8"] = function(t3) {
|
|
811
|
-
return function(t4) {
|
|
812
|
-
for (var e3 = [], r3 = 0; r3 < t4.length; r3++) {
|
|
813
|
-
var n2 = t4.charCodeAt(r3);
|
|
814
|
-
n2 < 128 ? e3.push(n2) : n2 < 2048 ? e3.push(192 | n2 >> 6, 128 | 63 & n2) : n2 < 55296 || n2 >= 57344 ? e3.push(224 | n2 >> 12, 128 | n2 >> 6 & 63, 128 | 63 & n2) : (r3++, n2 = 65536 + ((1023 & n2) << 10 | 1023 & t4.charCodeAt(r3)), e3.push(240 | n2 >> 18, 128 | n2 >> 12 & 63, 128 | n2 >> 6 & 63, 128 | 63 & n2));
|
|
815
|
-
}
|
|
816
|
-
return e3;
|
|
817
|
-
}(t3);
|
|
818
|
-
}, void 0 === (n = "function" == typeof (r2 = function() {
|
|
819
|
-
return o;
|
|
820
|
-
}) ? r2.apply(e2, []) : r2) || (t2.exports = n);
|
|
821
|
-
}, 796: (t2, e2, r2) => {
|
|
822
|
-
r2.d(e2, { default: () => W });
|
|
823
|
-
var n = function() {
|
|
824
|
-
return (n = Object.assign || function(t3) {
|
|
825
|
-
for (var e3, r3 = 1, n2 = arguments.length; r3 < n2; r3++)
|
|
826
|
-
for (var o2 in e3 = arguments[r3])
|
|
827
|
-
Object.prototype.hasOwnProperty.call(e3, o2) && (t3[o2] = e3[o2]);
|
|
828
|
-
return t3;
|
|
829
|
-
}).apply(this, arguments);
|
|
830
|
-
}, o = function() {
|
|
831
|
-
for (var t3 = 0, e3 = 0, r3 = arguments.length; e3 < r3; e3++)
|
|
832
|
-
t3 += arguments[e3].length;
|
|
833
|
-
var n2 = Array(t3), o2 = 0;
|
|
834
|
-
for (e3 = 0; e3 < r3; e3++)
|
|
835
|
-
for (var i2 = arguments[e3], a2 = 0, s2 = i2.length; a2 < s2; a2++, o2++)
|
|
836
|
-
n2[o2] = i2[a2];
|
|
837
|
-
return n2;
|
|
838
|
-
}, i = function(t3) {
|
|
839
|
-
return !!t3 && "object" == typeof t3 && !Array.isArray(t3);
|
|
840
|
-
};
|
|
841
|
-
function a(t3) {
|
|
842
|
-
for (var e3 = [], r3 = 1; r3 < arguments.length; r3++)
|
|
843
|
-
e3[r3 - 1] = arguments[r3];
|
|
844
|
-
if (!e3.length)
|
|
845
|
-
return t3;
|
|
846
|
-
var s2 = e3.shift();
|
|
847
|
-
return void 0 !== s2 && i(t3) && i(s2) ? (t3 = n({}, t3), Object.keys(s2).forEach(function(e4) {
|
|
848
|
-
var r4 = t3[e4], n2 = s2[e4];
|
|
849
|
-
Array.isArray(r4) && Array.isArray(n2) ? t3[e4] = n2 : i(r4) && i(n2) ? t3[e4] = a(Object.assign({}, r4), n2) : t3[e4] = n2;
|
|
850
|
-
}), a.apply(void 0, o([t3], e3))) : t3;
|
|
851
|
-
}
|
|
852
|
-
function s(t3, e3) {
|
|
853
|
-
var r3 = document.createElement("a");
|
|
854
|
-
r3.download = e3, r3.href = t3, document.body.appendChild(r3), r3.click(), document.body.removeChild(r3);
|
|
855
|
-
}
|
|
856
|
-
function u(t3) {
|
|
857
|
-
var e3 = t3.originalHeight, r3 = t3.originalWidth, n2 = t3.maxHiddenDots, o2 = t3.maxHiddenAxisDots, i2 = t3.dotSize, a2 = { x: 0, y: 0 }, s2 = { x: 0, y: 0 };
|
|
858
|
-
if (e3 <= 0 || r3 <= 0 || n2 <= 0 || i2 <= 0)
|
|
859
|
-
return { height: 0, width: 0, hideYDots: 0, hideXDots: 0 };
|
|
860
|
-
var u2 = e3 / r3;
|
|
861
|
-
return a2.x = Math.floor(Math.sqrt(n2 / u2)), a2.x <= 0 && (a2.x = 1), o2 && o2 < a2.x && (a2.x = o2), a2.x % 2 == 0 && a2.x--, s2.x = a2.x * i2, a2.y = 1 + 2 * Math.ceil((a2.x * u2 - 1) / 2), s2.y = Math.round(s2.x * u2), (a2.y * a2.x > n2 || o2 && o2 < a2.y) && (o2 && o2 < a2.y ? (a2.y = o2, a2.y % 2 == 0 && a2.x--) : a2.y -= 2, s2.y = a2.y * i2, a2.x = 1 + 2 * Math.ceil((a2.y / u2 - 1) / 2), s2.x = Math.round(s2.y / u2)), { height: s2.y, width: s2.x, hideYDots: a2.y, hideXDots: a2.x };
|
|
862
|
-
}
|
|
863
|
-
const c = { L: 0.07, M: 0.15, Q: 0.25, H: 0.3 }, h = "dots", d = "rounded", l = "classy", f = "classy-rounded", p = "square", g = "extra-rounded";
|
|
864
|
-
var v = function() {
|
|
865
|
-
return (v = Object.assign || function(t3) {
|
|
866
|
-
for (var e3, r3 = 1, n2 = arguments.length; r3 < n2; r3++)
|
|
867
|
-
for (var o2 in e3 = arguments[r3])
|
|
868
|
-
Object.prototype.hasOwnProperty.call(e3, o2) && (t3[o2] = e3[o2]);
|
|
869
|
-
return t3;
|
|
870
|
-
}).apply(this, arguments);
|
|
871
|
-
};
|
|
872
|
-
const y = function() {
|
|
873
|
-
function t3(t4) {
|
|
874
|
-
var e3 = t4.context, r3 = t4.type;
|
|
875
|
-
this._context = e3, this._type = r3;
|
|
876
|
-
}
|
|
877
|
-
return t3.prototype.draw = function(t4, e3, r3, n2) {
|
|
878
|
-
var o2, i2 = this._context;
|
|
879
|
-
switch (this._type) {
|
|
880
|
-
case h:
|
|
881
|
-
o2 = this._drawDot;
|
|
882
|
-
break;
|
|
883
|
-
case l:
|
|
884
|
-
o2 = this._drawClassy;
|
|
885
|
-
break;
|
|
886
|
-
case f:
|
|
887
|
-
o2 = this._drawClassyRounded;
|
|
888
|
-
break;
|
|
889
|
-
case d:
|
|
890
|
-
o2 = this._drawRounded;
|
|
891
|
-
break;
|
|
892
|
-
case g:
|
|
893
|
-
o2 = this._drawExtraRounded;
|
|
894
|
-
break;
|
|
895
|
-
case p:
|
|
896
|
-
default:
|
|
897
|
-
o2 = this._drawSquare;
|
|
898
|
-
}
|
|
899
|
-
o2.call(this, { x: t4, y: e3, size: r3, context: i2, getNeighbor: n2 });
|
|
900
|
-
}, t3.prototype._rotateFigure = function(t4) {
|
|
901
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context, i2 = t4.rotation, a2 = void 0 === i2 ? 0 : i2, s2 = t4.draw, u2 = e3 + n2 / 2, c2 = r3 + n2 / 2;
|
|
902
|
-
o2.translate(u2, c2), a2 && o2.rotate(a2), s2(), o2.closePath(), a2 && o2.rotate(-a2), o2.translate(-u2, -c2);
|
|
903
|
-
}, t3.prototype._basicDot = function(t4) {
|
|
904
|
-
var e3 = t4.size, r3 = t4.context;
|
|
905
|
-
this._rotateFigure(v(v({}, t4), { draw: function() {
|
|
906
|
-
r3.arc(0, 0, e3 / 2, 0, 2 * Math.PI);
|
|
907
|
-
} }));
|
|
908
|
-
}, t3.prototype._basicSquare = function(t4) {
|
|
909
|
-
var e3 = t4.size, r3 = t4.context;
|
|
910
|
-
this._rotateFigure(v(v({}, t4), { draw: function() {
|
|
911
|
-
r3.rect(-e3 / 2, -e3 / 2, e3, e3);
|
|
912
|
-
} }));
|
|
913
|
-
}, t3.prototype._basicSideRounded = function(t4) {
|
|
914
|
-
var e3 = t4.size, r3 = t4.context;
|
|
915
|
-
this._rotateFigure(v(v({}, t4), { draw: function() {
|
|
916
|
-
r3.arc(0, 0, e3 / 2, -Math.PI / 2, Math.PI / 2), r3.lineTo(-e3 / 2, e3 / 2), r3.lineTo(-e3 / 2, -e3 / 2), r3.lineTo(0, -e3 / 2);
|
|
917
|
-
} }));
|
|
918
|
-
}, t3.prototype._basicCornerRounded = function(t4) {
|
|
919
|
-
var e3 = t4.size, r3 = t4.context;
|
|
920
|
-
this._rotateFigure(v(v({}, t4), { draw: function() {
|
|
921
|
-
r3.arc(0, 0, e3 / 2, -Math.PI / 2, 0), r3.lineTo(e3 / 2, e3 / 2), r3.lineTo(-e3 / 2, e3 / 2), r3.lineTo(-e3 / 2, -e3 / 2), r3.lineTo(0, -e3 / 2);
|
|
922
|
-
} }));
|
|
923
|
-
}, t3.prototype._basicCornerExtraRounded = function(t4) {
|
|
924
|
-
var e3 = t4.size, r3 = t4.context;
|
|
925
|
-
this._rotateFigure(v(v({}, t4), { draw: function() {
|
|
926
|
-
r3.arc(-e3 / 2, e3 / 2, e3, -Math.PI / 2, 0), r3.lineTo(-e3 / 2, e3 / 2), r3.lineTo(-e3 / 2, -e3 / 2);
|
|
927
|
-
} }));
|
|
928
|
-
}, t3.prototype._basicCornersRounded = function(t4) {
|
|
929
|
-
var e3 = t4.size, r3 = t4.context;
|
|
930
|
-
this._rotateFigure(v(v({}, t4), { draw: function() {
|
|
931
|
-
r3.arc(0, 0, e3 / 2, -Math.PI / 2, 0), r3.lineTo(e3 / 2, e3 / 2), r3.lineTo(0, e3 / 2), r3.arc(0, 0, e3 / 2, Math.PI / 2, Math.PI), r3.lineTo(-e3 / 2, -e3 / 2), r3.lineTo(0, -e3 / 2);
|
|
932
|
-
} }));
|
|
933
|
-
}, t3.prototype._basicCornersExtraRounded = function(t4) {
|
|
934
|
-
var e3 = t4.size, r3 = t4.context;
|
|
935
|
-
this._rotateFigure(v(v({}, t4), { draw: function() {
|
|
936
|
-
r3.arc(-e3 / 2, e3 / 2, e3, -Math.PI / 2, 0), r3.arc(e3 / 2, -e3 / 2, e3, Math.PI / 2, Math.PI);
|
|
937
|
-
} }));
|
|
938
|
-
}, t3.prototype._drawDot = function(t4) {
|
|
939
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context;
|
|
940
|
-
this._basicDot({ x: e3, y: r3, size: n2, context: o2, rotation: 0 });
|
|
941
|
-
}, t3.prototype._drawSquare = function(t4) {
|
|
942
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context;
|
|
943
|
-
this._basicSquare({ x: e3, y: r3, size: n2, context: o2, rotation: 0 });
|
|
944
|
-
}, t3.prototype._drawRounded = function(t4) {
|
|
945
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context, i2 = t4.getNeighbor, a2 = i2 ? +i2(-1, 0) : 0, s2 = i2 ? +i2(1, 0) : 0, u2 = i2 ? +i2(0, -1) : 0, c2 = i2 ? +i2(0, 1) : 0, h2 = a2 + s2 + u2 + c2;
|
|
946
|
-
if (0 !== h2)
|
|
947
|
-
if (h2 > 2 || a2 && s2 || u2 && c2)
|
|
948
|
-
this._basicSquare({ x: e3, y: r3, size: n2, context: o2, rotation: 0 });
|
|
949
|
-
else {
|
|
950
|
-
if (2 === h2) {
|
|
951
|
-
var d2 = 0;
|
|
952
|
-
return a2 && u2 ? d2 = Math.PI / 2 : u2 && s2 ? d2 = Math.PI : s2 && c2 && (d2 = -Math.PI / 2), void this._basicCornerRounded({ x: e3, y: r3, size: n2, context: o2, rotation: d2 });
|
|
953
|
-
}
|
|
954
|
-
if (1 === h2)
|
|
955
|
-
return d2 = 0, u2 ? d2 = Math.PI / 2 : s2 ? d2 = Math.PI : c2 && (d2 = -Math.PI / 2), void this._basicSideRounded({ x: e3, y: r3, size: n2, context: o2, rotation: d2 });
|
|
956
|
-
}
|
|
957
|
-
else
|
|
958
|
-
this._basicDot({ x: e3, y: r3, size: n2, context: o2, rotation: 0 });
|
|
959
|
-
}, t3.prototype._drawExtraRounded = function(t4) {
|
|
960
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context, i2 = t4.getNeighbor, a2 = i2 ? +i2(-1, 0) : 0, s2 = i2 ? +i2(1, 0) : 0, u2 = i2 ? +i2(0, -1) : 0, c2 = i2 ? +i2(0, 1) : 0, h2 = a2 + s2 + u2 + c2;
|
|
961
|
-
if (0 !== h2)
|
|
962
|
-
if (h2 > 2 || a2 && s2 || u2 && c2)
|
|
963
|
-
this._basicSquare({ x: e3, y: r3, size: n2, context: o2, rotation: 0 });
|
|
964
|
-
else {
|
|
965
|
-
if (2 === h2) {
|
|
966
|
-
var d2 = 0;
|
|
967
|
-
return a2 && u2 ? d2 = Math.PI / 2 : u2 && s2 ? d2 = Math.PI : s2 && c2 && (d2 = -Math.PI / 2), void this._basicCornerExtraRounded({ x: e3, y: r3, size: n2, context: o2, rotation: d2 });
|
|
968
|
-
}
|
|
969
|
-
if (1 === h2)
|
|
970
|
-
return d2 = 0, u2 ? d2 = Math.PI / 2 : s2 ? d2 = Math.PI : c2 && (d2 = -Math.PI / 2), void this._basicSideRounded({ x: e3, y: r3, size: n2, context: o2, rotation: d2 });
|
|
971
|
-
}
|
|
972
|
-
else
|
|
973
|
-
this._basicDot({ x: e3, y: r3, size: n2, context: o2, rotation: 0 });
|
|
974
|
-
}, t3.prototype._drawClassy = function(t4) {
|
|
975
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context, i2 = t4.getNeighbor, a2 = i2 ? +i2(-1, 0) : 0, s2 = i2 ? +i2(1, 0) : 0, u2 = i2 ? +i2(0, -1) : 0, c2 = i2 ? +i2(0, 1) : 0;
|
|
976
|
-
0 !== a2 + s2 + u2 + c2 ? a2 || u2 ? s2 || c2 ? this._basicSquare({ x: e3, y: r3, size: n2, context: o2, rotation: 0 }) : this._basicCornerRounded({ x: e3, y: r3, size: n2, context: o2, rotation: Math.PI / 2 }) : this._basicCornerRounded({ x: e3, y: r3, size: n2, context: o2, rotation: -Math.PI / 2 }) : this._basicCornersRounded({ x: e3, y: r3, size: n2, context: o2, rotation: Math.PI / 2 });
|
|
977
|
-
}, t3.prototype._drawClassyRounded = function(t4) {
|
|
978
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context, i2 = t4.getNeighbor, a2 = i2 ? +i2(-1, 0) : 0, s2 = i2 ? +i2(1, 0) : 0, u2 = i2 ? +i2(0, -1) : 0, c2 = i2 ? +i2(0, 1) : 0;
|
|
979
|
-
0 !== a2 + s2 + u2 + c2 ? a2 || u2 ? s2 || c2 ? this._basicSquare({ x: e3, y: r3, size: n2, context: o2, rotation: 0 }) : this._basicCornerExtraRounded({ x: e3, y: r3, size: n2, context: o2, rotation: Math.PI / 2 }) : this._basicCornerExtraRounded({ x: e3, y: r3, size: n2, context: o2, rotation: -Math.PI / 2 }) : this._basicCornersRounded({ x: e3, y: r3, size: n2, context: o2, rotation: Math.PI / 2 });
|
|
980
|
-
}, t3;
|
|
981
|
-
}(), w = "square", _ = "extra-rounded";
|
|
982
|
-
var m = function() {
|
|
983
|
-
return (m = Object.assign || function(t3) {
|
|
984
|
-
for (var e3, r3 = 1, n2 = arguments.length; r3 < n2; r3++)
|
|
985
|
-
for (var o2 in e3 = arguments[r3])
|
|
986
|
-
Object.prototype.hasOwnProperty.call(e3, o2) && (t3[o2] = e3[o2]);
|
|
987
|
-
return t3;
|
|
988
|
-
}).apply(this, arguments);
|
|
989
|
-
};
|
|
990
|
-
const b = function() {
|
|
991
|
-
function t3(t4) {
|
|
992
|
-
var e3 = t4.context, r3 = t4.type;
|
|
993
|
-
this._context = e3, this._type = r3;
|
|
994
|
-
}
|
|
995
|
-
return t3.prototype.draw = function(t4, e3, r3, n2) {
|
|
996
|
-
var o2, i2 = this._context;
|
|
997
|
-
switch (this._type) {
|
|
998
|
-
case w:
|
|
999
|
-
o2 = this._drawSquare;
|
|
1000
|
-
break;
|
|
1001
|
-
case _:
|
|
1002
|
-
o2 = this._drawExtraRounded;
|
|
1003
|
-
break;
|
|
1004
|
-
case "dot":
|
|
1005
|
-
default:
|
|
1006
|
-
o2 = this._drawDot;
|
|
1007
|
-
}
|
|
1008
|
-
o2.call(this, { x: t4, y: e3, size: r3, context: i2, rotation: n2 });
|
|
1009
|
-
}, t3.prototype._rotateFigure = function(t4) {
|
|
1010
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context, i2 = t4.rotation, a2 = void 0 === i2 ? 0 : i2, s2 = t4.draw, u2 = e3 + n2 / 2, c2 = r3 + n2 / 2;
|
|
1011
|
-
o2.translate(u2, c2), a2 && o2.rotate(a2), s2(), o2.closePath(), a2 && o2.rotate(-a2), o2.translate(-u2, -c2);
|
|
1012
|
-
}, t3.prototype._basicDot = function(t4) {
|
|
1013
|
-
var e3 = t4.size, r3 = t4.context, n2 = e3 / 7;
|
|
1014
|
-
this._rotateFigure(m(m({}, t4), { draw: function() {
|
|
1015
|
-
r3.arc(0, 0, e3 / 2, 0, 2 * Math.PI), r3.arc(0, 0, e3 / 2 - n2, 0, 2 * Math.PI);
|
|
1016
|
-
} }));
|
|
1017
|
-
}, t3.prototype._basicSquare = function(t4) {
|
|
1018
|
-
var e3 = t4.size, r3 = t4.context, n2 = e3 / 7;
|
|
1019
|
-
this._rotateFigure(m(m({}, t4), { draw: function() {
|
|
1020
|
-
r3.rect(-e3 / 2, -e3 / 2, e3, e3), r3.rect(-e3 / 2 + n2, -e3 / 2 + n2, e3 - 2 * n2, e3 - 2 * n2);
|
|
1021
|
-
} }));
|
|
1022
|
-
}, t3.prototype._basicExtraRounded = function(t4) {
|
|
1023
|
-
var e3 = t4.size, r3 = t4.context, n2 = e3 / 7;
|
|
1024
|
-
this._rotateFigure(m(m({}, t4), { draw: function() {
|
|
1025
|
-
r3.arc(-n2, -n2, 2.5 * n2, Math.PI, -Math.PI / 2), r3.lineTo(n2, -3.5 * n2), r3.arc(n2, -n2, 2.5 * n2, -Math.PI / 2, 0), r3.lineTo(3.5 * n2, -n2), r3.arc(n2, n2, 2.5 * n2, 0, Math.PI / 2), r3.lineTo(-n2, 3.5 * n2), r3.arc(-n2, n2, 2.5 * n2, Math.PI / 2, Math.PI), r3.lineTo(-3.5 * n2, -n2), r3.arc(-n2, -n2, 1.5 * n2, Math.PI, -Math.PI / 2), r3.lineTo(n2, -2.5 * n2), r3.arc(n2, -n2, 1.5 * n2, -Math.PI / 2, 0), r3.lineTo(2.5 * n2, -n2), r3.arc(n2, n2, 1.5 * n2, 0, Math.PI / 2), r3.lineTo(-n2, 2.5 * n2), r3.arc(-n2, n2, 1.5 * n2, Math.PI / 2, Math.PI), r3.lineTo(-2.5 * n2, -n2);
|
|
1026
|
-
} }));
|
|
1027
|
-
}, t3.prototype._drawDot = function(t4) {
|
|
1028
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context, i2 = t4.rotation;
|
|
1029
|
-
this._basicDot({ x: e3, y: r3, size: n2, context: o2, rotation: i2 });
|
|
1030
|
-
}, t3.prototype._drawSquare = function(t4) {
|
|
1031
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context, i2 = t4.rotation;
|
|
1032
|
-
this._basicSquare({ x: e3, y: r3, size: n2, context: o2, rotation: i2 });
|
|
1033
|
-
}, t3.prototype._drawExtraRounded = function(t4) {
|
|
1034
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context, i2 = t4.rotation;
|
|
1035
|
-
this._basicExtraRounded({ x: e3, y: r3, size: n2, context: o2, rotation: i2 });
|
|
1036
|
-
}, t3;
|
|
1037
|
-
}(), x = "square";
|
|
1038
|
-
var M = function() {
|
|
1039
|
-
return (M = Object.assign || function(t3) {
|
|
1040
|
-
for (var e3, r3 = 1, n2 = arguments.length; r3 < n2; r3++)
|
|
1041
|
-
for (var o2 in e3 = arguments[r3])
|
|
1042
|
-
Object.prototype.hasOwnProperty.call(e3, o2) && (t3[o2] = e3[o2]);
|
|
1043
|
-
return t3;
|
|
1044
|
-
}).apply(this, arguments);
|
|
1045
|
-
};
|
|
1046
|
-
const S = function() {
|
|
1047
|
-
function t3(t4) {
|
|
1048
|
-
var e3 = t4.context, r3 = t4.type;
|
|
1049
|
-
this._context = e3, this._type = r3;
|
|
1050
|
-
}
|
|
1051
|
-
return t3.prototype.draw = function(t4, e3, r3, n2) {
|
|
1052
|
-
var o2, i2 = this._context;
|
|
1053
|
-
switch (this._type) {
|
|
1054
|
-
case x:
|
|
1055
|
-
o2 = this._drawSquare;
|
|
1056
|
-
break;
|
|
1057
|
-
case "dot":
|
|
1058
|
-
default:
|
|
1059
|
-
o2 = this._drawDot;
|
|
1060
|
-
}
|
|
1061
|
-
o2.call(this, { x: t4, y: e3, size: r3, context: i2, rotation: n2 });
|
|
1062
|
-
}, t3.prototype._rotateFigure = function(t4) {
|
|
1063
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context, i2 = t4.rotation, a2 = void 0 === i2 ? 0 : i2, s2 = t4.draw, u2 = e3 + n2 / 2, c2 = r3 + n2 / 2;
|
|
1064
|
-
o2.translate(u2, c2), a2 && o2.rotate(a2), s2(), o2.closePath(), a2 && o2.rotate(-a2), o2.translate(-u2, -c2);
|
|
1065
|
-
}, t3.prototype._basicDot = function(t4) {
|
|
1066
|
-
var e3 = t4.size, r3 = t4.context;
|
|
1067
|
-
this._rotateFigure(M(M({}, t4), { draw: function() {
|
|
1068
|
-
r3.arc(0, 0, e3 / 2, 0, 2 * Math.PI);
|
|
1069
|
-
} }));
|
|
1070
|
-
}, t3.prototype._basicSquare = function(t4) {
|
|
1071
|
-
var e3 = t4.size, r3 = t4.context;
|
|
1072
|
-
this._rotateFigure(M(M({}, t4), { draw: function() {
|
|
1073
|
-
r3.rect(-e3 / 2, -e3 / 2, e3, e3);
|
|
1074
|
-
} }));
|
|
1075
|
-
}, t3.prototype._drawDot = function(t4) {
|
|
1076
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context, i2 = t4.rotation;
|
|
1077
|
-
this._basicDot({ x: e3, y: r3, size: n2, context: o2, rotation: i2 });
|
|
1078
|
-
}, t3.prototype._drawSquare = function(t4) {
|
|
1079
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.context, i2 = t4.rotation;
|
|
1080
|
-
this._basicSquare({ x: e3, y: r3, size: n2, context: o2, rotation: i2 });
|
|
1081
|
-
}, t3;
|
|
1082
|
-
}(), C = "radial";
|
|
1083
|
-
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]], 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]];
|
|
1084
|
-
const z = function() {
|
|
1085
|
-
function t3(t4) {
|
|
1086
|
-
this._canvas = document.createElement("canvas"), this._canvas.width = t4.width, this._canvas.height = t4.height, this._options = t4;
|
|
1087
|
-
}
|
|
1088
|
-
return Object.defineProperty(t3.prototype, "context", { get: function() {
|
|
1089
|
-
return this._canvas.getContext("2d");
|
|
1090
|
-
}, enumerable: false, configurable: true }), Object.defineProperty(t3.prototype, "width", { get: function() {
|
|
1091
|
-
return this._canvas.width;
|
|
1092
|
-
}, enumerable: false, configurable: true }), Object.defineProperty(t3.prototype, "height", { get: function() {
|
|
1093
|
-
return this._canvas.height;
|
|
1094
|
-
}, enumerable: false, configurable: true }), t3.prototype.getCanvas = function() {
|
|
1095
|
-
return this._canvas;
|
|
1096
|
-
}, t3.prototype.clear = function() {
|
|
1097
|
-
var t4 = this.context;
|
|
1098
|
-
t4 && t4.clearRect(0, 0, this._canvas.width, this._canvas.height);
|
|
1099
|
-
}, t3.prototype.drawQR = function(t4) {
|
|
1100
|
-
return e3 = this, r3 = void 0, o2 = function() {
|
|
1101
|
-
var e4, r4, n3, o3, i2, a2, s2, h2, d2, l2 = this;
|
|
1102
|
-
return function(t5, e5) {
|
|
1103
|
-
var r5, n4, o4, i3, a3 = { label: 0, sent: function() {
|
|
1104
|
-
if (1 & o4[0])
|
|
1105
|
-
throw o4[1];
|
|
1106
|
-
return o4[1];
|
|
1107
|
-
}, trys: [], ops: [] };
|
|
1108
|
-
return i3 = { next: s3(0), throw: s3(1), return: s3(2) }, "function" == typeof Symbol && (i3[Symbol.iterator] = function() {
|
|
1109
|
-
return this;
|
|
1110
|
-
}), i3;
|
|
1111
|
-
function s3(i4) {
|
|
1112
|
-
return function(s4) {
|
|
1113
|
-
return function(i5) {
|
|
1114
|
-
if (r5)
|
|
1115
|
-
throw new TypeError("Generator is already executing.");
|
|
1116
|
-
for (; a3; )
|
|
1117
|
-
try {
|
|
1118
|
-
if (r5 = 1, n4 && (o4 = 2 & i5[0] ? n4.return : i5[0] ? n4.throw || ((o4 = n4.return) && o4.call(n4), 0) : n4.next) && !(o4 = o4.call(n4, i5[1])).done)
|
|
1119
|
-
return o4;
|
|
1120
|
-
switch (n4 = 0, o4 && (i5 = [2 & i5[0], o4.value]), i5[0]) {
|
|
1121
|
-
case 0:
|
|
1122
|
-
case 1:
|
|
1123
|
-
o4 = i5;
|
|
1124
|
-
break;
|
|
1125
|
-
case 4:
|
|
1126
|
-
return a3.label++, { value: i5[1], done: false };
|
|
1127
|
-
case 5:
|
|
1128
|
-
a3.label++, n4 = i5[1], i5 = [0];
|
|
1129
|
-
continue;
|
|
1130
|
-
case 7:
|
|
1131
|
-
i5 = a3.ops.pop(), a3.trys.pop();
|
|
1132
|
-
continue;
|
|
1133
|
-
default:
|
|
1134
|
-
if (!((o4 = (o4 = a3.trys).length > 0 && o4[o4.length - 1]) || 6 !== i5[0] && 2 !== i5[0])) {
|
|
1135
|
-
a3 = 0;
|
|
1136
|
-
continue;
|
|
1137
|
-
}
|
|
1138
|
-
if (3 === i5[0] && (!o4 || i5[1] > o4[0] && i5[1] < o4[3])) {
|
|
1139
|
-
a3.label = i5[1];
|
|
1140
|
-
break;
|
|
1141
|
-
}
|
|
1142
|
-
if (6 === i5[0] && a3.label < o4[1]) {
|
|
1143
|
-
a3.label = o4[1], o4 = i5;
|
|
1144
|
-
break;
|
|
1145
|
-
}
|
|
1146
|
-
if (o4 && a3.label < o4[2]) {
|
|
1147
|
-
a3.label = o4[2], a3.ops.push(i5);
|
|
1148
|
-
break;
|
|
1149
|
-
}
|
|
1150
|
-
o4[2] && a3.ops.pop(), a3.trys.pop();
|
|
1151
|
-
continue;
|
|
1152
|
-
}
|
|
1153
|
-
i5 = e5.call(t5, a3);
|
|
1154
|
-
} catch (t6) {
|
|
1155
|
-
i5 = [6, t6], n4 = 0;
|
|
1156
|
-
} finally {
|
|
1157
|
-
r5 = o4 = 0;
|
|
1158
|
-
}
|
|
1159
|
-
if (5 & i5[0])
|
|
1160
|
-
throw i5[1];
|
|
1161
|
-
return { value: i5[0] ? i5[1] : void 0, done: true };
|
|
1162
|
-
}([i4, s4]);
|
|
1163
|
-
};
|
|
1164
|
-
}
|
|
1165
|
-
}(this, function(f2) {
|
|
1166
|
-
switch (f2.label) {
|
|
1167
|
-
case 0:
|
|
1168
|
-
return e4 = t4.getModuleCount(), r4 = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n3 = Math.floor(r4 / e4), o3 = { hideXDots: 0, hideYDots: 0, width: 0, height: 0 }, this._qr = t4, this._options.image ? [4, this.loadImage()] : [3, 2];
|
|
1169
|
-
case 1:
|
|
1170
|
-
if (f2.sent(), !this._image)
|
|
1171
|
-
return [2];
|
|
1172
|
-
i2 = this._options, a2 = i2.imageOptions, s2 = i2.qrOptions, h2 = a2.imageSize * c[s2.errorCorrectionLevel], d2 = Math.floor(h2 * e4 * e4), o3 = u({ originalWidth: this._image.width, originalHeight: this._image.height, maxHiddenDots: d2, maxHiddenAxisDots: e4 - 14, dotSize: n3 }), f2.label = 2;
|
|
1173
|
-
case 2:
|
|
1174
|
-
return this.clear(), this.drawBackground(), this.drawDots(function(t5, r5) {
|
|
1175
|
-
var n4, i3, a3, s3, u2, c2;
|
|
1176
|
-
return !(l2._options.imageOptions.hideBackgroundDots && t5 >= (e4 - o3.hideXDots) / 2 && t5 < (e4 + o3.hideXDots) / 2 && r5 >= (e4 - o3.hideYDots) / 2 && r5 < (e4 + o3.hideYDots) / 2 || (null === (n4 = P[t5]) || void 0 === n4 ? void 0 : n4[r5]) || (null === (i3 = P[t5 - e4 + 7]) || void 0 === i3 ? void 0 : i3[r5]) || (null === (a3 = P[t5]) || void 0 === a3 ? void 0 : a3[r5 - e4 + 7]) || (null === (s3 = O[t5]) || void 0 === s3 ? void 0 : s3[r5]) || (null === (u2 = O[t5 - e4 + 7]) || void 0 === u2 ? void 0 : u2[r5]) || (null === (c2 = O[t5]) || void 0 === c2 ? void 0 : c2[r5 - e4 + 7]));
|
|
1177
|
-
}), this.drawCorners(), this._options.image && this.drawImage({ width: o3.width, height: o3.height, count: e4, dotSize: n3 }), [2];
|
|
1178
|
-
}
|
|
1179
|
-
});
|
|
1180
|
-
}, new ((n2 = void 0) || (n2 = Promise))(function(t5, i2) {
|
|
1181
|
-
function a2(t6) {
|
|
1182
|
-
try {
|
|
1183
|
-
u2(o2.next(t6));
|
|
1184
|
-
} catch (t7) {
|
|
1185
|
-
i2(t7);
|
|
1186
|
-
}
|
|
1187
|
-
}
|
|
1188
|
-
function s2(t6) {
|
|
1189
|
-
try {
|
|
1190
|
-
u2(o2.throw(t6));
|
|
1191
|
-
} catch (t7) {
|
|
1192
|
-
i2(t7);
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
function u2(e4) {
|
|
1196
|
-
var r4;
|
|
1197
|
-
e4.done ? t5(e4.value) : (r4 = e4.value, r4 instanceof n2 ? r4 : new n2(function(t6) {
|
|
1198
|
-
t6(r4);
|
|
1199
|
-
})).then(a2, s2);
|
|
1200
|
-
}
|
|
1201
|
-
u2((o2 = o2.apply(e3, r3 || [])).next());
|
|
1202
|
-
});
|
|
1203
|
-
var e3, r3, n2, o2;
|
|
1204
|
-
}, t3.prototype.drawBackground = function() {
|
|
1205
|
-
var t4 = this.context, e3 = this._options;
|
|
1206
|
-
if (t4) {
|
|
1207
|
-
if (e3.backgroundOptions.gradient) {
|
|
1208
|
-
var r3 = e3.backgroundOptions.gradient, n2 = this._createGradient({ context: t4, options: r3, additionalRotation: 0, x: 0, y: 0, size: this._canvas.width > this._canvas.height ? this._canvas.width : this._canvas.height });
|
|
1209
|
-
r3.colorStops.forEach(function(t5) {
|
|
1210
|
-
var e4 = t5.offset, r4 = t5.color;
|
|
1211
|
-
n2.addColorStop(e4, r4);
|
|
1212
|
-
}), t4.fillStyle = n2;
|
|
1213
|
-
} else
|
|
1214
|
-
e3.backgroundOptions.color && (t4.fillStyle = e3.backgroundOptions.color);
|
|
1215
|
-
t4.fillRect(0, 0, this._canvas.width, this._canvas.height);
|
|
1216
|
-
}
|
|
1217
|
-
}, t3.prototype.drawDots = function(t4) {
|
|
1218
|
-
var e3 = this;
|
|
1219
|
-
if (!this._qr)
|
|
1220
|
-
throw "QR code is not defined";
|
|
1221
|
-
var r3 = this.context;
|
|
1222
|
-
if (!r3)
|
|
1223
|
-
throw "QR code is not defined";
|
|
1224
|
-
var n2 = this._options, o2 = this._qr.getModuleCount();
|
|
1225
|
-
if (o2 > n2.width || o2 > n2.height)
|
|
1226
|
-
throw "The canvas is too small.";
|
|
1227
|
-
var i2 = Math.min(n2.width, n2.height) - 2 * n2.margin, a2 = Math.floor(i2 / o2), s2 = Math.floor((n2.width - o2 * a2) / 2), u2 = Math.floor((n2.height - o2 * a2) / 2), c2 = new y({ context: r3, type: n2.dotsOptions.type });
|
|
1228
|
-
r3.beginPath();
|
|
1229
|
-
for (var h2 = function(r4) {
|
|
1230
|
-
for (var n3 = function(n4) {
|
|
1231
|
-
return t4 && !t4(r4, n4) ? "continue" : d2._qr.isDark(r4, n4) ? void c2.draw(s2 + r4 * a2, u2 + n4 * a2, a2, function(i4, a3) {
|
|
1232
|
-
return !(r4 + i4 < 0 || n4 + a3 < 0 || r4 + i4 >= o2 || n4 + a3 >= o2) && !(t4 && !t4(r4 + i4, n4 + a3)) && !!e3._qr && e3._qr.isDark(r4 + i4, n4 + a3);
|
|
1233
|
-
}) : "continue";
|
|
1234
|
-
}, i3 = 0; i3 < o2; i3++)
|
|
1235
|
-
n3(i3);
|
|
1236
|
-
}, d2 = this, l2 = 0; l2 < o2; l2++)
|
|
1237
|
-
h2(l2);
|
|
1238
|
-
if (n2.dotsOptions.gradient) {
|
|
1239
|
-
var f2 = n2.dotsOptions.gradient, p2 = this._createGradient({ context: r3, options: f2, additionalRotation: 0, x: s2, y: u2, size: o2 * a2 });
|
|
1240
|
-
f2.colorStops.forEach(function(t5) {
|
|
1241
|
-
var e4 = t5.offset, r4 = t5.color;
|
|
1242
|
-
p2.addColorStop(e4, r4);
|
|
1243
|
-
}), r3.fillStyle = r3.strokeStyle = p2;
|
|
1244
|
-
} else
|
|
1245
|
-
n2.dotsOptions.color && (r3.fillStyle = r3.strokeStyle = n2.dotsOptions.color);
|
|
1246
|
-
r3.fill("evenodd");
|
|
1247
|
-
}, t3.prototype.drawCorners = function(t4) {
|
|
1248
|
-
var e3 = this;
|
|
1249
|
-
if (!this._qr)
|
|
1250
|
-
throw "QR code is not defined";
|
|
1251
|
-
var r3 = this.context;
|
|
1252
|
-
if (!r3)
|
|
1253
|
-
throw "QR code is not defined";
|
|
1254
|
-
var n2 = this._options, o2 = this._qr.getModuleCount(), i2 = Math.min(n2.width, n2.height) - 2 * n2.margin, a2 = Math.floor(i2 / o2), s2 = 7 * a2, u2 = 3 * a2, c2 = Math.floor((n2.width - o2 * a2) / 2), h2 = Math.floor((n2.height - o2 * a2) / 2);
|
|
1255
|
-
[[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function(i3) {
|
|
1256
|
-
var d2, l2, f2, p2, g2, v2, w2, _2, m2, x2, M2 = i3[0], C2 = i3[1], z2 = i3[2];
|
|
1257
|
-
if (!t4 || t4(M2, C2)) {
|
|
1258
|
-
var D2 = c2 + M2 * a2 * (o2 - 7), I2 = h2 + C2 * a2 * (o2 - 7);
|
|
1259
|
-
if (null === (d2 = n2.cornersSquareOptions) || void 0 === d2 ? void 0 : d2.type) {
|
|
1260
|
-
var A2 = new b({ context: r3, type: null === (l2 = n2.cornersSquareOptions) || void 0 === l2 ? void 0 : l2.type });
|
|
1261
|
-
r3.beginPath(), A2.draw(D2, I2, s2, z2);
|
|
1262
|
-
} else {
|
|
1263
|
-
var k2 = new y({ context: r3, type: n2.dotsOptions.type });
|
|
1264
|
-
r3.beginPath();
|
|
1265
|
-
for (var q2 = function(t5) {
|
|
1266
|
-
for (var e4 = function(e5) {
|
|
1267
|
-
if (!(null === (f2 = P[t5]) || void 0 === f2 ? void 0 : f2[e5]))
|
|
1268
|
-
return "continue";
|
|
1269
|
-
k2.draw(D2 + t5 * a2, I2 + e5 * a2, a2, function(r5, n3) {
|
|
1270
|
-
var o3;
|
|
1271
|
-
return !!(null === (o3 = P[t5 + r5]) || void 0 === o3 ? void 0 : o3[e5 + n3]);
|
|
1272
|
-
});
|
|
1273
|
-
}, r4 = 0; r4 < P[t5].length; r4++)
|
|
1274
|
-
e4(r4);
|
|
1275
|
-
}, R2 = 0; R2 < P.length; R2++)
|
|
1276
|
-
q2(R2);
|
|
1277
|
-
}
|
|
1278
|
-
if (null === (p2 = n2.cornersSquareOptions) || void 0 === p2 ? void 0 : p2.gradient) {
|
|
1279
|
-
var B2 = n2.cornersSquareOptions.gradient, E2 = e3._createGradient({ context: r3, options: B2, additionalRotation: z2, x: D2, y: I2, size: s2 });
|
|
1280
|
-
B2.colorStops.forEach(function(t5) {
|
|
1281
|
-
var e4 = t5.offset, r4 = t5.color;
|
|
1282
|
-
E2.addColorStop(e4, r4);
|
|
1283
|
-
}), r3.fillStyle = r3.strokeStyle = E2;
|
|
1284
|
-
} else
|
|
1285
|
-
(null === (g2 = n2.cornersSquareOptions) || void 0 === g2 ? void 0 : g2.color) && (r3.fillStyle = r3.strokeStyle = n2.cornersSquareOptions.color);
|
|
1286
|
-
if (r3.fill("evenodd"), null === (v2 = n2.cornersDotOptions) || void 0 === v2 ? void 0 : v2.type) {
|
|
1287
|
-
var L2 = new S({ context: r3, type: null === (w2 = n2.cornersDotOptions) || void 0 === w2 ? void 0 : w2.type });
|
|
1288
|
-
r3.beginPath(), L2.draw(D2 + 2 * a2, I2 + 2 * a2, u2, z2);
|
|
1289
|
-
} else {
|
|
1290
|
-
k2 = new y({ context: r3, type: n2.dotsOptions.type }), r3.beginPath();
|
|
1291
|
-
var N2 = function(t5) {
|
|
1292
|
-
for (var e4 = function(e5) {
|
|
1293
|
-
if (!(null === (_2 = O[t5]) || void 0 === _2 ? void 0 : _2[e5]))
|
|
1294
|
-
return "continue";
|
|
1295
|
-
k2.draw(D2 + t5 * a2, I2 + e5 * a2, a2, function(r5, n3) {
|
|
1296
|
-
var o3;
|
|
1297
|
-
return !!(null === (o3 = O[t5 + r5]) || void 0 === o3 ? void 0 : o3[e5 + n3]);
|
|
1298
|
-
});
|
|
1299
|
-
}, r4 = 0; r4 < O[t5].length; r4++)
|
|
1300
|
-
e4(r4);
|
|
1301
|
-
};
|
|
1302
|
-
for (R2 = 0; R2 < O.length; R2++)
|
|
1303
|
-
N2(R2);
|
|
1304
|
-
}
|
|
1305
|
-
if (null === (m2 = n2.cornersDotOptions) || void 0 === m2 ? void 0 : m2.gradient) {
|
|
1306
|
-
B2 = n2.cornersDotOptions.gradient;
|
|
1307
|
-
var T2 = e3._createGradient({ context: r3, options: B2, additionalRotation: z2, x: D2 + 2 * a2, y: I2 + 2 * a2, size: u2 });
|
|
1308
|
-
B2.colorStops.forEach(function(t5) {
|
|
1309
|
-
var e4 = t5.offset, r4 = t5.color;
|
|
1310
|
-
T2.addColorStop(e4, r4);
|
|
1311
|
-
}), r3.fillStyle = r3.strokeStyle = T2;
|
|
1312
|
-
} else
|
|
1313
|
-
(null === (x2 = n2.cornersDotOptions) || void 0 === x2 ? void 0 : x2.color) && (r3.fillStyle = r3.strokeStyle = n2.cornersDotOptions.color);
|
|
1314
|
-
r3.fill("evenodd");
|
|
1315
|
-
}
|
|
1316
|
-
});
|
|
1317
|
-
}, t3.prototype.loadImage = function() {
|
|
1318
|
-
var t4 = this;
|
|
1319
|
-
return new Promise(function(e3, r3) {
|
|
1320
|
-
var n2 = t4._options, o2 = new Image();
|
|
1321
|
-
if (!n2.image)
|
|
1322
|
-
return r3("Image is not defined");
|
|
1323
|
-
"string" == typeof n2.imageOptions.crossOrigin && (o2.crossOrigin = n2.imageOptions.crossOrigin), t4._image = o2, o2.onload = function() {
|
|
1324
|
-
e3();
|
|
1325
|
-
}, o2.src = n2.image;
|
|
1326
|
-
});
|
|
1327
|
-
}, t3.prototype.drawImage = function(t4) {
|
|
1328
|
-
var e3 = t4.width, r3 = t4.height, n2 = t4.count, o2 = t4.dotSize, i2 = this.context;
|
|
1329
|
-
if (!i2)
|
|
1330
|
-
throw "canvasContext is not defined";
|
|
1331
|
-
if (!this._image)
|
|
1332
|
-
throw "image is not defined";
|
|
1333
|
-
var a2 = this._options, s2 = Math.floor((a2.width - n2 * o2) / 2), u2 = Math.floor((a2.height - n2 * o2) / 2), c2 = s2 + a2.imageOptions.margin + (n2 * o2 - e3) / 2, h2 = u2 + a2.imageOptions.margin + (n2 * o2 - r3) / 2, d2 = e3 - 2 * a2.imageOptions.margin, l2 = r3 - 2 * a2.imageOptions.margin;
|
|
1334
|
-
i2.drawImage(this._image, c2, h2, d2 < 0 ? 0 : d2, l2 < 0 ? 0 : l2);
|
|
1335
|
-
}, t3.prototype._createGradient = function(t4) {
|
|
1336
|
-
var e3, r3 = t4.context, n2 = t4.options, o2 = t4.additionalRotation, i2 = t4.x, a2 = t4.y, s2 = t4.size;
|
|
1337
|
-
if (n2.type === C)
|
|
1338
|
-
e3 = r3.createRadialGradient(i2 + s2 / 2, a2 + s2 / 2, 0, i2 + s2 / 2, a2 + s2 / 2, s2 / 2);
|
|
1339
|
-
else {
|
|
1340
|
-
var u2 = ((n2.rotation || 0) + o2) % (2 * Math.PI), c2 = (u2 + 2 * Math.PI) % (2 * Math.PI), h2 = i2 + s2 / 2, d2 = a2 + s2 / 2, l2 = i2 + s2 / 2, f2 = a2 + s2 / 2;
|
|
1341
|
-
c2 >= 0 && c2 <= 0.25 * Math.PI || c2 > 1.75 * Math.PI && c2 <= 2 * Math.PI ? (h2 -= s2 / 2, d2 -= s2 / 2 * Math.tan(u2), l2 += s2 / 2, f2 += s2 / 2 * Math.tan(u2)) : c2 > 0.25 * Math.PI && c2 <= 0.75 * Math.PI ? (d2 -= s2 / 2, h2 -= s2 / 2 / Math.tan(u2), f2 += s2 / 2, l2 += s2 / 2 / Math.tan(u2)) : c2 > 0.75 * Math.PI && c2 <= 1.25 * Math.PI ? (h2 += s2 / 2, d2 += s2 / 2 * Math.tan(u2), l2 -= s2 / 2, f2 -= s2 / 2 * Math.tan(u2)) : c2 > 1.25 * Math.PI && c2 <= 1.75 * Math.PI && (d2 += s2 / 2, h2 += s2 / 2 / Math.tan(u2), f2 -= s2 / 2, l2 -= s2 / 2 / Math.tan(u2)), e3 = r3.createLinearGradient(Math.round(h2), Math.round(d2), Math.round(l2), Math.round(f2));
|
|
1342
|
-
}
|
|
1343
|
-
return e3;
|
|
1344
|
-
}, t3;
|
|
1345
|
-
}();
|
|
1346
|
-
var D = function() {
|
|
1347
|
-
return (D = Object.assign || function(t3) {
|
|
1348
|
-
for (var e3, r3 = 1, n2 = arguments.length; r3 < n2; r3++)
|
|
1349
|
-
for (var o2 in e3 = arguments[r3])
|
|
1350
|
-
Object.prototype.hasOwnProperty.call(e3, o2) && (t3[o2] = e3[o2]);
|
|
1351
|
-
return t3;
|
|
1352
|
-
}).apply(this, arguments);
|
|
1353
|
-
};
|
|
1354
|
-
const I = function() {
|
|
1355
|
-
function t3(t4) {
|
|
1356
|
-
var e3 = t4.svg, r3 = t4.type;
|
|
1357
|
-
this._svg = e3, this._type = r3;
|
|
1358
|
-
}
|
|
1359
|
-
return t3.prototype.draw = function(t4, e3, r3, n2) {
|
|
1360
|
-
var o2;
|
|
1361
|
-
switch (this._type) {
|
|
1362
|
-
case h:
|
|
1363
|
-
o2 = this._drawDot;
|
|
1364
|
-
break;
|
|
1365
|
-
case l:
|
|
1366
|
-
o2 = this._drawClassy;
|
|
1367
|
-
break;
|
|
1368
|
-
case f:
|
|
1369
|
-
o2 = this._drawClassyRounded;
|
|
1370
|
-
break;
|
|
1371
|
-
case d:
|
|
1372
|
-
o2 = this._drawRounded;
|
|
1373
|
-
break;
|
|
1374
|
-
case g:
|
|
1375
|
-
o2 = this._drawExtraRounded;
|
|
1376
|
-
break;
|
|
1377
|
-
case p:
|
|
1378
|
-
default:
|
|
1379
|
-
o2 = this._drawSquare;
|
|
1380
|
-
}
|
|
1381
|
-
o2.call(this, { x: t4, y: e3, size: r3, getNeighbor: n2 });
|
|
1382
|
-
}, t3.prototype._rotateFigure = function(t4) {
|
|
1383
|
-
var e3, r3 = t4.x, n2 = t4.y, o2 = t4.size, i2 = t4.rotation, a2 = void 0 === i2 ? 0 : i2, s2 = r3 + o2 / 2, u2 = n2 + o2 / 2;
|
|
1384
|
-
(0, t4.draw)(), null === (e3 = this._element) || void 0 === e3 || e3.setAttribute("transform", "rotate(" + 180 * a2 / Math.PI + "," + s2 + "," + u2 + ")");
|
|
1385
|
-
}, t3.prototype._basicDot = function(t4) {
|
|
1386
|
-
var e3 = this, r3 = t4.size, n2 = t4.x, o2 = t4.y;
|
|
1387
|
-
this._rotateFigure(D(D({}, t4), { draw: function() {
|
|
1388
|
-
e3._element = document.createElementNS("http://www.w3.org/2000/svg", "circle"), e3._element.setAttribute("cx", String(n2 + r3 / 2)), e3._element.setAttribute("cy", String(o2 + r3 / 2)), e3._element.setAttribute("r", String(r3 / 2));
|
|
1389
|
-
} }));
|
|
1390
|
-
}, t3.prototype._basicSquare = function(t4) {
|
|
1391
|
-
var e3 = this, r3 = t4.size, n2 = t4.x, o2 = t4.y;
|
|
1392
|
-
this._rotateFigure(D(D({}, t4), { draw: function() {
|
|
1393
|
-
e3._element = document.createElementNS("http://www.w3.org/2000/svg", "rect"), e3._element.setAttribute("x", String(n2)), e3._element.setAttribute("y", String(o2)), e3._element.setAttribute("width", String(r3)), e3._element.setAttribute("height", String(r3));
|
|
1394
|
-
} }));
|
|
1395
|
-
}, t3.prototype._basicSideRounded = function(t4) {
|
|
1396
|
-
var e3 = this, r3 = t4.size, n2 = t4.x, o2 = t4.y;
|
|
1397
|
-
this._rotateFigure(D(D({}, t4), { draw: function() {
|
|
1398
|
-
e3._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e3._element.setAttribute("d", "M " + n2 + " " + o2 + "v " + r3 + "h " + r3 / 2 + "a " + r3 / 2 + " " + r3 / 2 + ", 0, 0, 0, 0 " + -r3);
|
|
1399
|
-
} }));
|
|
1400
|
-
}, t3.prototype._basicCornerRounded = function(t4) {
|
|
1401
|
-
var e3 = this, r3 = t4.size, n2 = t4.x, o2 = t4.y;
|
|
1402
|
-
this._rotateFigure(D(D({}, t4), { draw: function() {
|
|
1403
|
-
e3._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e3._element.setAttribute("d", "M " + n2 + " " + o2 + "v " + r3 + "h " + r3 + "v " + -r3 / 2 + "a " + r3 / 2 + " " + r3 / 2 + ", 0, 0, 0, " + -r3 / 2 + " " + -r3 / 2);
|
|
1404
|
-
} }));
|
|
1405
|
-
}, t3.prototype._basicCornerExtraRounded = function(t4) {
|
|
1406
|
-
var e3 = this, r3 = t4.size, n2 = t4.x, o2 = t4.y;
|
|
1407
|
-
this._rotateFigure(D(D({}, t4), { draw: function() {
|
|
1408
|
-
e3._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e3._element.setAttribute("d", "M " + n2 + " " + o2 + "v " + r3 + "h " + r3 + "a " + r3 + " " + r3 + ", 0, 0, 0, " + -r3 + " " + -r3);
|
|
1409
|
-
} }));
|
|
1410
|
-
}, t3.prototype._basicCornersRounded = function(t4) {
|
|
1411
|
-
var e3 = this, r3 = t4.size, n2 = t4.x, o2 = t4.y;
|
|
1412
|
-
this._rotateFigure(D(D({}, t4), { draw: function() {
|
|
1413
|
-
e3._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e3._element.setAttribute("d", "M " + n2 + " " + o2 + "v " + r3 / 2 + "a " + r3 / 2 + " " + r3 / 2 + ", 0, 0, 0, " + r3 / 2 + " " + r3 / 2 + "h " + r3 / 2 + "v " + -r3 / 2 + "a " + r3 / 2 + " " + r3 / 2 + ", 0, 0, 0, " + -r3 / 2 + " " + -r3 / 2);
|
|
1414
|
-
} }));
|
|
1415
|
-
}, t3.prototype._drawDot = function(t4) {
|
|
1416
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size;
|
|
1417
|
-
this._basicDot({ x: e3, y: r3, size: n2, rotation: 0 });
|
|
1418
|
-
}, t3.prototype._drawSquare = function(t4) {
|
|
1419
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size;
|
|
1420
|
-
this._basicSquare({ x: e3, y: r3, size: n2, rotation: 0 });
|
|
1421
|
-
}, t3.prototype._drawRounded = function(t4) {
|
|
1422
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.getNeighbor, i2 = o2 ? +o2(-1, 0) : 0, a2 = o2 ? +o2(1, 0) : 0, s2 = o2 ? +o2(0, -1) : 0, u2 = o2 ? +o2(0, 1) : 0, c2 = i2 + a2 + s2 + u2;
|
|
1423
|
-
if (0 !== c2)
|
|
1424
|
-
if (c2 > 2 || i2 && a2 || s2 && u2)
|
|
1425
|
-
this._basicSquare({ x: e3, y: r3, size: n2, rotation: 0 });
|
|
1426
|
-
else {
|
|
1427
|
-
if (2 === c2) {
|
|
1428
|
-
var h2 = 0;
|
|
1429
|
-
return i2 && s2 ? h2 = Math.PI / 2 : s2 && a2 ? h2 = Math.PI : a2 && u2 && (h2 = -Math.PI / 2), void this._basicCornerRounded({ x: e3, y: r3, size: n2, rotation: h2 });
|
|
1430
|
-
}
|
|
1431
|
-
if (1 === c2)
|
|
1432
|
-
return h2 = 0, s2 ? h2 = Math.PI / 2 : a2 ? h2 = Math.PI : u2 && (h2 = -Math.PI / 2), void this._basicSideRounded({ x: e3, y: r3, size: n2, rotation: h2 });
|
|
1433
|
-
}
|
|
1434
|
-
else
|
|
1435
|
-
this._basicDot({ x: e3, y: r3, size: n2, rotation: 0 });
|
|
1436
|
-
}, t3.prototype._drawExtraRounded = function(t4) {
|
|
1437
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.getNeighbor, i2 = o2 ? +o2(-1, 0) : 0, a2 = o2 ? +o2(1, 0) : 0, s2 = o2 ? +o2(0, -1) : 0, u2 = o2 ? +o2(0, 1) : 0, c2 = i2 + a2 + s2 + u2;
|
|
1438
|
-
if (0 !== c2)
|
|
1439
|
-
if (c2 > 2 || i2 && a2 || s2 && u2)
|
|
1440
|
-
this._basicSquare({ x: e3, y: r3, size: n2, rotation: 0 });
|
|
1441
|
-
else {
|
|
1442
|
-
if (2 === c2) {
|
|
1443
|
-
var h2 = 0;
|
|
1444
|
-
return i2 && s2 ? h2 = Math.PI / 2 : s2 && a2 ? h2 = Math.PI : a2 && u2 && (h2 = -Math.PI / 2), void this._basicCornerExtraRounded({ x: e3, y: r3, size: n2, rotation: h2 });
|
|
1445
|
-
}
|
|
1446
|
-
if (1 === c2)
|
|
1447
|
-
return h2 = 0, s2 ? h2 = Math.PI / 2 : a2 ? h2 = Math.PI : u2 && (h2 = -Math.PI / 2), void this._basicSideRounded({ x: e3, y: r3, size: n2, rotation: h2 });
|
|
1448
|
-
}
|
|
1449
|
-
else
|
|
1450
|
-
this._basicDot({ x: e3, y: r3, size: n2, rotation: 0 });
|
|
1451
|
-
}, t3.prototype._drawClassy = function(t4) {
|
|
1452
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.getNeighbor, i2 = o2 ? +o2(-1, 0) : 0, a2 = o2 ? +o2(1, 0) : 0, s2 = o2 ? +o2(0, -1) : 0, u2 = o2 ? +o2(0, 1) : 0;
|
|
1453
|
-
0 !== i2 + a2 + s2 + u2 ? i2 || s2 ? a2 || u2 ? this._basicSquare({ x: e3, y: r3, size: n2, rotation: 0 }) : this._basicCornerRounded({ x: e3, y: r3, size: n2, rotation: Math.PI / 2 }) : this._basicCornerRounded({ x: e3, y: r3, size: n2, rotation: -Math.PI / 2 }) : this._basicCornersRounded({ x: e3, y: r3, size: n2, rotation: Math.PI / 2 });
|
|
1454
|
-
}, t3.prototype._drawClassyRounded = function(t4) {
|
|
1455
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.getNeighbor, i2 = o2 ? +o2(-1, 0) : 0, a2 = o2 ? +o2(1, 0) : 0, s2 = o2 ? +o2(0, -1) : 0, u2 = o2 ? +o2(0, 1) : 0;
|
|
1456
|
-
0 !== i2 + a2 + s2 + u2 ? i2 || s2 ? a2 || u2 ? this._basicSquare({ x: e3, y: r3, size: n2, rotation: 0 }) : this._basicCornerExtraRounded({ x: e3, y: r3, size: n2, rotation: Math.PI / 2 }) : this._basicCornerExtraRounded({ x: e3, y: r3, size: n2, rotation: -Math.PI / 2 }) : this._basicCornersRounded({ x: e3, y: r3, size: n2, rotation: Math.PI / 2 });
|
|
1457
|
-
}, t3;
|
|
1458
|
-
}();
|
|
1459
|
-
var A = function() {
|
|
1460
|
-
return (A = Object.assign || function(t3) {
|
|
1461
|
-
for (var e3, r3 = 1, n2 = arguments.length; r3 < n2; r3++)
|
|
1462
|
-
for (var o2 in e3 = arguments[r3])
|
|
1463
|
-
Object.prototype.hasOwnProperty.call(e3, o2) && (t3[o2] = e3[o2]);
|
|
1464
|
-
return t3;
|
|
1465
|
-
}).apply(this, arguments);
|
|
1466
|
-
};
|
|
1467
|
-
const k = function() {
|
|
1468
|
-
function t3(t4) {
|
|
1469
|
-
var e3 = t4.svg, r3 = t4.type;
|
|
1470
|
-
this._svg = e3, this._type = r3;
|
|
1471
|
-
}
|
|
1472
|
-
return t3.prototype.draw = function(t4, e3, r3, n2) {
|
|
1473
|
-
var o2;
|
|
1474
|
-
switch (this._type) {
|
|
1475
|
-
case w:
|
|
1476
|
-
o2 = this._drawSquare;
|
|
1477
|
-
break;
|
|
1478
|
-
case _:
|
|
1479
|
-
o2 = this._drawExtraRounded;
|
|
1480
|
-
break;
|
|
1481
|
-
case "dot":
|
|
1482
|
-
default:
|
|
1483
|
-
o2 = this._drawDot;
|
|
1484
|
-
}
|
|
1485
|
-
o2.call(this, { x: t4, y: e3, size: r3, rotation: n2 });
|
|
1486
|
-
}, t3.prototype._rotateFigure = function(t4) {
|
|
1487
|
-
var e3, r3 = t4.x, n2 = t4.y, o2 = t4.size, i2 = t4.rotation, a2 = void 0 === i2 ? 0 : i2, s2 = r3 + o2 / 2, u2 = n2 + o2 / 2;
|
|
1488
|
-
(0, t4.draw)(), null === (e3 = this._element) || void 0 === e3 || e3.setAttribute("transform", "rotate(" + 180 * a2 / Math.PI + "," + s2 + "," + u2 + ")");
|
|
1489
|
-
}, t3.prototype._basicDot = function(t4) {
|
|
1490
|
-
var e3 = this, r3 = t4.size, n2 = t4.x, o2 = t4.y, i2 = r3 / 7;
|
|
1491
|
-
this._rotateFigure(A(A({}, t4), { draw: function() {
|
|
1492
|
-
e3._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e3._element.setAttribute("clip-rule", "evenodd"), e3._element.setAttribute("d", "M " + (n2 + r3 / 2) + " " + o2 + "a " + r3 / 2 + " " + r3 / 2 + " 0 1 0 0.1 0zm 0 " + i2 + "a " + (r3 / 2 - i2) + " " + (r3 / 2 - i2) + " 0 1 1 -0.1 0Z");
|
|
1493
|
-
} }));
|
|
1494
|
-
}, t3.prototype._basicSquare = function(t4) {
|
|
1495
|
-
var e3 = this, r3 = t4.size, n2 = t4.x, o2 = t4.y, i2 = r3 / 7;
|
|
1496
|
-
this._rotateFigure(A(A({}, t4), { draw: function() {
|
|
1497
|
-
e3._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e3._element.setAttribute("clip-rule", "evenodd"), e3._element.setAttribute("d", "M " + n2 + " " + o2 + "v " + r3 + "h " + r3 + "v " + -r3 + "zM " + (n2 + i2) + " " + (o2 + i2) + "h " + (r3 - 2 * i2) + "v " + (r3 - 2 * i2) + "h " + (2 * i2 - r3) + "z");
|
|
1498
|
-
} }));
|
|
1499
|
-
}, t3.prototype._basicExtraRounded = function(t4) {
|
|
1500
|
-
var e3 = this, r3 = t4.size, n2 = t4.x, o2 = t4.y, i2 = r3 / 7;
|
|
1501
|
-
this._rotateFigure(A(A({}, t4), { draw: function() {
|
|
1502
|
-
e3._element = document.createElementNS("http://www.w3.org/2000/svg", "path"), e3._element.setAttribute("clip-rule", "evenodd"), e3._element.setAttribute("d", "M " + n2 + " " + (o2 + 2.5 * i2) + "v " + 2 * i2 + "a " + 2.5 * i2 + " " + 2.5 * i2 + ", 0, 0, 0, " + 2.5 * i2 + " " + 2.5 * i2 + "h " + 2 * i2 + "a " + 2.5 * i2 + " " + 2.5 * i2 + ", 0, 0, 0, " + 2.5 * i2 + " " + 2.5 * -i2 + "v " + -2 * i2 + "a " + 2.5 * i2 + " " + 2.5 * i2 + ", 0, 0, 0, " + 2.5 * -i2 + " " + 2.5 * -i2 + "h " + -2 * i2 + "a " + 2.5 * i2 + " " + 2.5 * i2 + ", 0, 0, 0, " + 2.5 * -i2 + " " + 2.5 * i2 + "M " + (n2 + 2.5 * i2) + " " + (o2 + i2) + "h " + 2 * i2 + "a " + 1.5 * i2 + " " + 1.5 * i2 + ", 0, 0, 1, " + 1.5 * i2 + " " + 1.5 * i2 + "v " + 2 * i2 + "a " + 1.5 * i2 + " " + 1.5 * i2 + ", 0, 0, 1, " + 1.5 * -i2 + " " + 1.5 * i2 + "h " + -2 * i2 + "a " + 1.5 * i2 + " " + 1.5 * i2 + ", 0, 0, 1, " + 1.5 * -i2 + " " + 1.5 * -i2 + "v " + -2 * i2 + "a " + 1.5 * i2 + " " + 1.5 * i2 + ", 0, 0, 1, " + 1.5 * i2 + " " + 1.5 * -i2);
|
|
1503
|
-
} }));
|
|
1504
|
-
}, t3.prototype._drawDot = function(t4) {
|
|
1505
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.rotation;
|
|
1506
|
-
this._basicDot({ x: e3, y: r3, size: n2, rotation: o2 });
|
|
1507
|
-
}, t3.prototype._drawSquare = function(t4) {
|
|
1508
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.rotation;
|
|
1509
|
-
this._basicSquare({ x: e3, y: r3, size: n2, rotation: o2 });
|
|
1510
|
-
}, t3.prototype._drawExtraRounded = function(t4) {
|
|
1511
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.rotation;
|
|
1512
|
-
this._basicExtraRounded({ x: e3, y: r3, size: n2, rotation: o2 });
|
|
1513
|
-
}, t3;
|
|
1514
|
-
}();
|
|
1515
|
-
var q = function() {
|
|
1516
|
-
return (q = Object.assign || function(t3) {
|
|
1517
|
-
for (var e3, r3 = 1, n2 = arguments.length; r3 < n2; r3++)
|
|
1518
|
-
for (var o2 in e3 = arguments[r3])
|
|
1519
|
-
Object.prototype.hasOwnProperty.call(e3, o2) && (t3[o2] = e3[o2]);
|
|
1520
|
-
return t3;
|
|
1521
|
-
}).apply(this, arguments);
|
|
1522
|
-
};
|
|
1523
|
-
const R = function() {
|
|
1524
|
-
function t3(t4) {
|
|
1525
|
-
var e3 = t4.svg, r3 = t4.type;
|
|
1526
|
-
this._svg = e3, this._type = r3;
|
|
1527
|
-
}
|
|
1528
|
-
return t3.prototype.draw = function(t4, e3, r3, n2) {
|
|
1529
|
-
var o2;
|
|
1530
|
-
switch (this._type) {
|
|
1531
|
-
case x:
|
|
1532
|
-
o2 = this._drawSquare;
|
|
1533
|
-
break;
|
|
1534
|
-
case "dot":
|
|
1535
|
-
default:
|
|
1536
|
-
o2 = this._drawDot;
|
|
1537
|
-
}
|
|
1538
|
-
o2.call(this, { x: t4, y: e3, size: r3, rotation: n2 });
|
|
1539
|
-
}, t3.prototype._rotateFigure = function(t4) {
|
|
1540
|
-
var e3, r3 = t4.x, n2 = t4.y, o2 = t4.size, i2 = t4.rotation, a2 = void 0 === i2 ? 0 : i2, s2 = r3 + o2 / 2, u2 = n2 + o2 / 2;
|
|
1541
|
-
(0, t4.draw)(), null === (e3 = this._element) || void 0 === e3 || e3.setAttribute("transform", "rotate(" + 180 * a2 / Math.PI + "," + s2 + "," + u2 + ")");
|
|
1542
|
-
}, t3.prototype._basicDot = function(t4) {
|
|
1543
|
-
var e3 = this, r3 = t4.size, n2 = t4.x, o2 = t4.y;
|
|
1544
|
-
this._rotateFigure(q(q({}, t4), { draw: function() {
|
|
1545
|
-
e3._element = document.createElementNS("http://www.w3.org/2000/svg", "circle"), e3._element.setAttribute("cx", String(n2 + r3 / 2)), e3._element.setAttribute("cy", String(o2 + r3 / 2)), e3._element.setAttribute("r", String(r3 / 2));
|
|
1546
|
-
} }));
|
|
1547
|
-
}, t3.prototype._basicSquare = function(t4) {
|
|
1548
|
-
var e3 = this, r3 = t4.size, n2 = t4.x, o2 = t4.y;
|
|
1549
|
-
this._rotateFigure(q(q({}, t4), { draw: function() {
|
|
1550
|
-
e3._element = document.createElementNS("http://www.w3.org/2000/svg", "rect"), e3._element.setAttribute("x", String(n2)), e3._element.setAttribute("y", String(o2)), e3._element.setAttribute("width", String(r3)), e3._element.setAttribute("height", String(r3));
|
|
1551
|
-
} }));
|
|
1552
|
-
}, t3.prototype._drawDot = function(t4) {
|
|
1553
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.rotation;
|
|
1554
|
-
this._basicDot({ x: e3, y: r3, size: n2, rotation: o2 });
|
|
1555
|
-
}, t3.prototype._drawSquare = function(t4) {
|
|
1556
|
-
var e3 = t4.x, r3 = t4.y, n2 = t4.size, o2 = t4.rotation;
|
|
1557
|
-
this._basicSquare({ x: e3, y: r3, size: n2, rotation: o2 });
|
|
1558
|
-
}, t3;
|
|
1559
|
-
}();
|
|
1560
|
-
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]], 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]];
|
|
1561
|
-
const L = function() {
|
|
1562
|
-
function t3(t4) {
|
|
1563
|
-
this._element = document.createElementNS("http://www.w3.org/2000/svg", "svg"), this._element.setAttribute("width", String(t4.width)), this._element.setAttribute("height", String(t4.height)), this._defs = document.createElementNS("http://www.w3.org/2000/svg", "defs"), this._element.appendChild(this._defs), this._options = t4;
|
|
1564
|
-
}
|
|
1565
|
-
return Object.defineProperty(t3.prototype, "width", { get: function() {
|
|
1566
|
-
return this._options.width;
|
|
1567
|
-
}, enumerable: false, configurable: true }), Object.defineProperty(t3.prototype, "height", { get: function() {
|
|
1568
|
-
return this._options.height;
|
|
1569
|
-
}, enumerable: false, configurable: true }), t3.prototype.getElement = function() {
|
|
1570
|
-
return this._element;
|
|
1571
|
-
}, t3.prototype.clear = function() {
|
|
1572
|
-
var t4, e3 = this._element;
|
|
1573
|
-
this._element = e3.cloneNode(false), null === (t4 = null == e3 ? void 0 : e3.parentNode) || void 0 === t4 || t4.replaceChild(this._element, e3), this._defs = document.createElementNS("http://www.w3.org/2000/svg", "defs"), this._element.appendChild(this._defs);
|
|
1574
|
-
}, t3.prototype.drawQR = function(t4) {
|
|
1575
|
-
return e3 = this, r3 = void 0, o2 = function() {
|
|
1576
|
-
var e4, r4, n3, o3, i2, a2, s2, h2, d2, l2 = this;
|
|
1577
|
-
return function(t5, e5) {
|
|
1578
|
-
var r5, n4, o4, i3, a3 = { label: 0, sent: function() {
|
|
1579
|
-
if (1 & o4[0])
|
|
1580
|
-
throw o4[1];
|
|
1581
|
-
return o4[1];
|
|
1582
|
-
}, trys: [], ops: [] };
|
|
1583
|
-
return i3 = { next: s3(0), throw: s3(1), return: s3(2) }, "function" == typeof Symbol && (i3[Symbol.iterator] = function() {
|
|
1584
|
-
return this;
|
|
1585
|
-
}), i3;
|
|
1586
|
-
function s3(i4) {
|
|
1587
|
-
return function(s4) {
|
|
1588
|
-
return function(i5) {
|
|
1589
|
-
if (r5)
|
|
1590
|
-
throw new TypeError("Generator is already executing.");
|
|
1591
|
-
for (; a3; )
|
|
1592
|
-
try {
|
|
1593
|
-
if (r5 = 1, n4 && (o4 = 2 & i5[0] ? n4.return : i5[0] ? n4.throw || ((o4 = n4.return) && o4.call(n4), 0) : n4.next) && !(o4 = o4.call(n4, i5[1])).done)
|
|
1594
|
-
return o4;
|
|
1595
|
-
switch (n4 = 0, o4 && (i5 = [2 & i5[0], o4.value]), i5[0]) {
|
|
1596
|
-
case 0:
|
|
1597
|
-
case 1:
|
|
1598
|
-
o4 = i5;
|
|
1599
|
-
break;
|
|
1600
|
-
case 4:
|
|
1601
|
-
return a3.label++, { value: i5[1], done: false };
|
|
1602
|
-
case 5:
|
|
1603
|
-
a3.label++, n4 = i5[1], i5 = [0];
|
|
1604
|
-
continue;
|
|
1605
|
-
case 7:
|
|
1606
|
-
i5 = a3.ops.pop(), a3.trys.pop();
|
|
1607
|
-
continue;
|
|
1608
|
-
default:
|
|
1609
|
-
if (!((o4 = (o4 = a3.trys).length > 0 && o4[o4.length - 1]) || 6 !== i5[0] && 2 !== i5[0])) {
|
|
1610
|
-
a3 = 0;
|
|
1611
|
-
continue;
|
|
1612
|
-
}
|
|
1613
|
-
if (3 === i5[0] && (!o4 || i5[1] > o4[0] && i5[1] < o4[3])) {
|
|
1614
|
-
a3.label = i5[1];
|
|
1615
|
-
break;
|
|
1616
|
-
}
|
|
1617
|
-
if (6 === i5[0] && a3.label < o4[1]) {
|
|
1618
|
-
a3.label = o4[1], o4 = i5;
|
|
1619
|
-
break;
|
|
1620
|
-
}
|
|
1621
|
-
if (o4 && a3.label < o4[2]) {
|
|
1622
|
-
a3.label = o4[2], a3.ops.push(i5);
|
|
1623
|
-
break;
|
|
1624
|
-
}
|
|
1625
|
-
o4[2] && a3.ops.pop(), a3.trys.pop();
|
|
1626
|
-
continue;
|
|
1627
|
-
}
|
|
1628
|
-
i5 = e5.call(t5, a3);
|
|
1629
|
-
} catch (t6) {
|
|
1630
|
-
i5 = [6, t6], n4 = 0;
|
|
1631
|
-
} finally {
|
|
1632
|
-
r5 = o4 = 0;
|
|
1633
|
-
}
|
|
1634
|
-
if (5 & i5[0])
|
|
1635
|
-
throw i5[1];
|
|
1636
|
-
return { value: i5[0] ? i5[1] : void 0, done: true };
|
|
1637
|
-
}([i4, s4]);
|
|
1638
|
-
};
|
|
1639
|
-
}
|
|
1640
|
-
}(this, function(f2) {
|
|
1641
|
-
switch (f2.label) {
|
|
1642
|
-
case 0:
|
|
1643
|
-
return e4 = t4.getModuleCount(), r4 = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, n3 = Math.floor(r4 / e4), o3 = { hideXDots: 0, hideYDots: 0, width: 0, height: 0 }, this._qr = t4, this._options.image ? [4, this.loadImage()] : [3, 2];
|
|
1644
|
-
case 1:
|
|
1645
|
-
if (f2.sent(), !this._image)
|
|
1646
|
-
return [2];
|
|
1647
|
-
i2 = this._options, a2 = i2.imageOptions, s2 = i2.qrOptions, h2 = a2.imageSize * c[s2.errorCorrectionLevel], d2 = Math.floor(h2 * e4 * e4), o3 = u({ originalWidth: this._image.width, originalHeight: this._image.height, maxHiddenDots: d2, maxHiddenAxisDots: e4 - 14, dotSize: n3 }), f2.label = 2;
|
|
1648
|
-
case 2:
|
|
1649
|
-
return this.clear(), this.drawBackground(), this.drawDots(function(t5, r5) {
|
|
1650
|
-
var n4, i3, a3, s3, u2, c2;
|
|
1651
|
-
return !(l2._options.imageOptions.hideBackgroundDots && t5 >= (e4 - o3.hideXDots) / 2 && t5 < (e4 + o3.hideXDots) / 2 && r5 >= (e4 - o3.hideYDots) / 2 && r5 < (e4 + o3.hideYDots) / 2 || (null === (n4 = B[t5]) || void 0 === n4 ? void 0 : n4[r5]) || (null === (i3 = B[t5 - e4 + 7]) || void 0 === i3 ? void 0 : i3[r5]) || (null === (a3 = B[t5]) || void 0 === a3 ? void 0 : a3[r5 - e4 + 7]) || (null === (s3 = E[t5]) || void 0 === s3 ? void 0 : s3[r5]) || (null === (u2 = E[t5 - e4 + 7]) || void 0 === u2 ? void 0 : u2[r5]) || (null === (c2 = E[t5]) || void 0 === c2 ? void 0 : c2[r5 - e4 + 7]));
|
|
1652
|
-
}), this.drawCorners(), this._options.image && this.drawImage({ width: o3.width, height: o3.height, count: e4, dotSize: n3 }), [2];
|
|
1653
|
-
}
|
|
1654
|
-
});
|
|
1655
|
-
}, new ((n2 = void 0) || (n2 = Promise))(function(t5, i2) {
|
|
1656
|
-
function a2(t6) {
|
|
1657
|
-
try {
|
|
1658
|
-
u2(o2.next(t6));
|
|
1659
|
-
} catch (t7) {
|
|
1660
|
-
i2(t7);
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
function s2(t6) {
|
|
1664
|
-
try {
|
|
1665
|
-
u2(o2.throw(t6));
|
|
1666
|
-
} catch (t7) {
|
|
1667
|
-
i2(t7);
|
|
1668
|
-
}
|
|
1669
|
-
}
|
|
1670
|
-
function u2(e4) {
|
|
1671
|
-
var r4;
|
|
1672
|
-
e4.done ? t5(e4.value) : (r4 = e4.value, r4 instanceof n2 ? r4 : new n2(function(t6) {
|
|
1673
|
-
t6(r4);
|
|
1674
|
-
})).then(a2, s2);
|
|
1675
|
-
}
|
|
1676
|
-
u2((o2 = o2.apply(e3, r3 || [])).next());
|
|
1677
|
-
});
|
|
1678
|
-
var e3, r3, n2, o2;
|
|
1679
|
-
}, t3.prototype.drawBackground = function() {
|
|
1680
|
-
var t4, e3, r3 = this._element, n2 = this._options;
|
|
1681
|
-
if (r3) {
|
|
1682
|
-
var o2 = null === (t4 = n2.backgroundOptions) || void 0 === t4 ? void 0 : t4.gradient, i2 = null === (e3 = n2.backgroundOptions) || void 0 === e3 ? void 0 : e3.color;
|
|
1683
|
-
(o2 || i2) && this._createColor({ options: o2, color: i2, additionalRotation: 0, x: 0, y: 0, height: n2.height, width: n2.width, name: "background-color" });
|
|
1684
|
-
}
|
|
1685
|
-
}, t3.prototype.drawDots = function(t4) {
|
|
1686
|
-
var e3, r3, n2 = this;
|
|
1687
|
-
if (!this._qr)
|
|
1688
|
-
throw "QR code is not defined";
|
|
1689
|
-
var o2 = this._options, i2 = this._qr.getModuleCount();
|
|
1690
|
-
if (i2 > o2.width || i2 > o2.height)
|
|
1691
|
-
throw "The canvas is too small.";
|
|
1692
|
-
var a2 = Math.min(o2.width, o2.height) - 2 * o2.margin, s2 = Math.floor(a2 / i2), u2 = Math.floor((o2.width - i2 * s2) / 2), c2 = Math.floor((o2.height - i2 * s2) / 2), h2 = new I({ svg: this._element, type: o2.dotsOptions.type });
|
|
1693
|
-
this._dotsClipPath = document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), this._dotsClipPath.setAttribute("id", "clip-path-dot-color"), this._defs.appendChild(this._dotsClipPath), this._createColor({ options: null === (e3 = o2.dotsOptions) || void 0 === e3 ? void 0 : e3.gradient, color: o2.dotsOptions.color, additionalRotation: 0, x: u2, y: c2, height: i2 * s2, width: i2 * s2, name: "dot-color" });
|
|
1694
|
-
for (var d2 = function(e4) {
|
|
1695
|
-
for (var o3 = function(o4) {
|
|
1696
|
-
return t4 && !t4(e4, o4) ? "continue" : (null === (r3 = l2._qr) || void 0 === r3 ? void 0 : r3.isDark(e4, o4)) ? (h2.draw(u2 + e4 * s2, c2 + o4 * s2, s2, function(r4, a4) {
|
|
1697
|
-
return !(e4 + r4 < 0 || o4 + a4 < 0 || e4 + r4 >= i2 || o4 + a4 >= i2) && !(t4 && !t4(e4 + r4, o4 + a4)) && !!n2._qr && n2._qr.isDark(e4 + r4, o4 + a4);
|
|
1698
|
-
}), void (h2._element && l2._dotsClipPath && l2._dotsClipPath.appendChild(h2._element))) : "continue";
|
|
1699
|
-
}, a3 = 0; a3 < i2; a3++)
|
|
1700
|
-
o3(a3);
|
|
1701
|
-
}, l2 = this, f2 = 0; f2 < i2; f2++)
|
|
1702
|
-
d2(f2);
|
|
1703
|
-
}, t3.prototype.drawCorners = function() {
|
|
1704
|
-
var t4 = this;
|
|
1705
|
-
if (!this._qr)
|
|
1706
|
-
throw "QR code is not defined";
|
|
1707
|
-
var e3 = this._element, r3 = this._options;
|
|
1708
|
-
if (!e3)
|
|
1709
|
-
throw "Element code is not defined";
|
|
1710
|
-
var n2 = this._qr.getModuleCount(), o2 = Math.min(r3.width, r3.height) - 2 * r3.margin, i2 = Math.floor(o2 / n2), a2 = 7 * i2, s2 = 3 * i2, u2 = Math.floor((r3.width - n2 * i2) / 2), c2 = Math.floor((r3.height - n2 * i2) / 2);
|
|
1711
|
-
[[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function(e4) {
|
|
1712
|
-
var o3, h2, d2, l2, f2, p2, g2, v2, y2, w2, _2, m2, b2 = e4[0], x2 = e4[1], M2 = e4[2], S2 = u2 + b2 * i2 * (n2 - 7), C2 = c2 + x2 * i2 * (n2 - 7), P2 = t4._dotsClipPath, O2 = t4._dotsClipPath;
|
|
1713
|
-
if (((null === (o3 = r3.cornersSquareOptions) || void 0 === o3 ? void 0 : o3.gradient) || (null === (h2 = r3.cornersSquareOptions) || void 0 === h2 ? void 0 : h2.color)) && ((P2 = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-square-color-" + b2 + "-" + x2), t4._defs.appendChild(P2), t4._cornersSquareClipPath = t4._cornersDotClipPath = O2 = P2, t4._createColor({ options: null === (d2 = r3.cornersSquareOptions) || void 0 === d2 ? void 0 : d2.gradient, color: null === (l2 = r3.cornersSquareOptions) || void 0 === l2 ? void 0 : l2.color, additionalRotation: M2, x: S2, y: C2, height: a2, width: a2, name: "corners-square-color-" + b2 + "-" + x2 })), null === (f2 = r3.cornersSquareOptions) || void 0 === f2 ? void 0 : f2.type) {
|
|
1714
|
-
var z2 = new k({ svg: t4._element, type: r3.cornersSquareOptions.type });
|
|
1715
|
-
z2.draw(S2, C2, a2, M2), z2._element && P2 && P2.appendChild(z2._element);
|
|
1716
|
-
} else
|
|
1717
|
-
for (var D2 = new I({ svg: t4._element, type: r3.dotsOptions.type }), A2 = function(t5) {
|
|
1718
|
-
for (var e5 = function(e6) {
|
|
1719
|
-
if (!(null === (p2 = B[t5]) || void 0 === p2 ? void 0 : p2[e6]))
|
|
1720
|
-
return "continue";
|
|
1721
|
-
D2.draw(S2 + t5 * i2, C2 + e6 * i2, i2, function(r5, n3) {
|
|
1722
|
-
var o4;
|
|
1723
|
-
return !!(null === (o4 = B[t5 + r5]) || void 0 === o4 ? void 0 : o4[e6 + n3]);
|
|
1724
|
-
}), D2._element && P2 && P2.appendChild(D2._element);
|
|
1725
|
-
}, r4 = 0; r4 < B[t5].length; r4++)
|
|
1726
|
-
e5(r4);
|
|
1727
|
-
}, q2 = 0; q2 < B.length; q2++)
|
|
1728
|
-
A2(q2);
|
|
1729
|
-
if (((null === (g2 = r3.cornersDotOptions) || void 0 === g2 ? void 0 : g2.gradient) || (null === (v2 = r3.cornersDotOptions) || void 0 === v2 ? void 0 : v2.color)) && ((O2 = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-dot-color-" + b2 + "-" + x2), t4._defs.appendChild(O2), t4._cornersDotClipPath = O2, t4._createColor({ options: null === (y2 = r3.cornersDotOptions) || void 0 === y2 ? void 0 : y2.gradient, color: null === (w2 = r3.cornersDotOptions) || void 0 === w2 ? void 0 : w2.color, additionalRotation: M2, x: S2 + 2 * i2, y: C2 + 2 * i2, height: s2, width: s2, name: "corners-dot-color-" + b2 + "-" + x2 })), null === (_2 = r3.cornersDotOptions) || void 0 === _2 ? void 0 : _2.type) {
|
|
1730
|
-
var L2 = new R({ svg: t4._element, type: r3.cornersDotOptions.type });
|
|
1731
|
-
L2.draw(S2 + 2 * i2, C2 + 2 * i2, s2, M2), L2._element && O2 && O2.appendChild(L2._element);
|
|
1732
|
-
} else {
|
|
1733
|
-
D2 = new I({ svg: t4._element, type: r3.dotsOptions.type });
|
|
1734
|
-
var N2 = function(t5) {
|
|
1735
|
-
for (var e5 = function(e6) {
|
|
1736
|
-
if (!(null === (m2 = E[t5]) || void 0 === m2 ? void 0 : m2[e6]))
|
|
1737
|
-
return "continue";
|
|
1738
|
-
D2.draw(S2 + t5 * i2, C2 + e6 * i2, i2, function(r5, n3) {
|
|
1739
|
-
var o4;
|
|
1740
|
-
return !!(null === (o4 = E[t5 + r5]) || void 0 === o4 ? void 0 : o4[e6 + n3]);
|
|
1741
|
-
}), D2._element && O2 && O2.appendChild(D2._element);
|
|
1742
|
-
}, r4 = 0; r4 < E[t5].length; r4++)
|
|
1743
|
-
e5(r4);
|
|
1744
|
-
};
|
|
1745
|
-
for (q2 = 0; q2 < E.length; q2++)
|
|
1746
|
-
N2(q2);
|
|
1747
|
-
}
|
|
1748
|
-
});
|
|
1749
|
-
}, t3.prototype.loadImage = function() {
|
|
1750
|
-
var t4 = this;
|
|
1751
|
-
return new Promise(function(e3, r3) {
|
|
1752
|
-
var n2 = t4._options, o2 = new Image();
|
|
1753
|
-
if (!n2.image)
|
|
1754
|
-
return r3("Image is not defined");
|
|
1755
|
-
"string" == typeof n2.imageOptions.crossOrigin && (o2.crossOrigin = n2.imageOptions.crossOrigin), t4._image = o2, o2.onload = function() {
|
|
1756
|
-
e3();
|
|
1757
|
-
}, o2.src = n2.image;
|
|
1758
|
-
});
|
|
1759
|
-
}, t3.prototype.drawImage = function(t4) {
|
|
1760
|
-
var e3 = t4.width, r3 = t4.height, n2 = t4.count, o2 = t4.dotSize, i2 = this._options, a2 = Math.floor((i2.width - n2 * o2) / 2), s2 = Math.floor((i2.height - n2 * o2) / 2), u2 = a2 + i2.imageOptions.margin + (n2 * o2 - e3) / 2, c2 = s2 + i2.imageOptions.margin + (n2 * o2 - r3) / 2, h2 = e3 - 2 * i2.imageOptions.margin, d2 = r3 - 2 * i2.imageOptions.margin, l2 = document.createElementNS("http://www.w3.org/2000/svg", "image");
|
|
1761
|
-
l2.setAttribute("href", i2.image || ""), l2.setAttribute("x", String(u2)), l2.setAttribute("y", String(c2)), l2.setAttribute("width", h2 + "px"), l2.setAttribute("height", d2 + "px"), this._element.appendChild(l2);
|
|
1762
|
-
}, t3.prototype._createColor = function(t4) {
|
|
1763
|
-
var e3 = t4.options, r3 = t4.color, n2 = t4.additionalRotation, o2 = t4.x, i2 = t4.y, a2 = t4.height, s2 = t4.width, u2 = t4.name, c2 = s2 > a2 ? s2 : a2, h2 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
1764
|
-
if (h2.setAttribute("x", String(o2)), h2.setAttribute("y", String(i2)), h2.setAttribute("height", String(a2)), h2.setAttribute("width", String(s2)), h2.setAttribute("clip-path", "url('#clip-path-" + u2 + "')"), e3) {
|
|
1765
|
-
var d2;
|
|
1766
|
-
if (e3.type === C)
|
|
1767
|
-
(d2 = document.createElementNS("http://www.w3.org/2000/svg", "radialGradient")).setAttribute("id", u2), d2.setAttribute("gradientUnits", "userSpaceOnUse"), d2.setAttribute("fx", String(o2 + s2 / 2)), d2.setAttribute("fy", String(i2 + a2 / 2)), d2.setAttribute("cx", String(o2 + s2 / 2)), d2.setAttribute("cy", String(i2 + a2 / 2)), d2.setAttribute("r", String(c2 / 2));
|
|
1768
|
-
else {
|
|
1769
|
-
var l2 = ((e3.rotation || 0) + n2) % (2 * Math.PI), f2 = (l2 + 2 * Math.PI) % (2 * Math.PI), p2 = o2 + s2 / 2, g2 = i2 + a2 / 2, v2 = o2 + s2 / 2, y2 = i2 + a2 / 2;
|
|
1770
|
-
f2 >= 0 && f2 <= 0.25 * Math.PI || f2 > 1.75 * Math.PI && f2 <= 2 * Math.PI ? (p2 -= s2 / 2, g2 -= a2 / 2 * Math.tan(l2), v2 += s2 / 2, y2 += a2 / 2 * Math.tan(l2)) : f2 > 0.25 * Math.PI && f2 <= 0.75 * Math.PI ? (g2 -= a2 / 2, p2 -= s2 / 2 / Math.tan(l2), y2 += a2 / 2, v2 += s2 / 2 / Math.tan(l2)) : f2 > 0.75 * Math.PI && f2 <= 1.25 * Math.PI ? (p2 += s2 / 2, g2 += a2 / 2 * Math.tan(l2), v2 -= s2 / 2, y2 -= a2 / 2 * Math.tan(l2)) : f2 > 1.25 * Math.PI && f2 <= 1.75 * Math.PI && (g2 += a2 / 2, p2 += s2 / 2 / Math.tan(l2), y2 -= a2 / 2, v2 -= s2 / 2 / Math.tan(l2)), (d2 = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient")).setAttribute("id", u2), d2.setAttribute("gradientUnits", "userSpaceOnUse"), d2.setAttribute("x1", String(Math.round(p2))), d2.setAttribute("y1", String(Math.round(g2))), d2.setAttribute("x2", String(Math.round(v2))), d2.setAttribute("y2", String(Math.round(y2)));
|
|
1771
|
-
}
|
|
1772
|
-
e3.colorStops.forEach(function(t5) {
|
|
1773
|
-
var e4 = t5.offset, r4 = t5.color, n3 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
|
|
1774
|
-
n3.setAttribute("offset", 100 * e4 + "%"), n3.setAttribute("stop-color", r4), d2.appendChild(n3);
|
|
1775
|
-
}), h2.setAttribute("fill", "url('#" + u2 + "')"), this._defs.appendChild(d2);
|
|
1776
|
-
} else
|
|
1777
|
-
r3 && h2.setAttribute("fill", r3);
|
|
1778
|
-
this._element.appendChild(h2);
|
|
1779
|
-
}, t3;
|
|
1780
|
-
}(), N = "canvas";
|
|
1781
|
-
for (var T = {}, j = 0; j <= 40; j++)
|
|
1782
|
-
T[j] = j;
|
|
1783
|
-
const F = { type: N, width: 300, height: 300, data: "", margin: 0, qrOptions: { typeNumber: T[0], mode: void 0, errorCorrectionLevel: "Q" }, imageOptions: { hideBackgroundDots: true, imageSize: 0.4, crossOrigin: void 0, margin: 0 }, dotsOptions: { type: "square", color: "#000" }, backgroundOptions: { color: "#fff" } };
|
|
1784
|
-
var Q = function() {
|
|
1785
|
-
return (Q = Object.assign || function(t3) {
|
|
1786
|
-
for (var e3, r3 = 1, n2 = arguments.length; r3 < n2; r3++)
|
|
1787
|
-
for (var o2 in e3 = arguments[r3])
|
|
1788
|
-
Object.prototype.hasOwnProperty.call(e3, o2) && (t3[o2] = e3[o2]);
|
|
1789
|
-
return t3;
|
|
1790
|
-
}).apply(this, arguments);
|
|
1791
|
-
};
|
|
1792
|
-
function H(t3) {
|
|
1793
|
-
var e3 = Q({}, t3);
|
|
1794
|
-
if (!e3.colorStops || !e3.colorStops.length)
|
|
1795
|
-
throw "Field 'colorStops' is required in gradient";
|
|
1796
|
-
return e3.rotation ? e3.rotation = Number(e3.rotation) : e3.rotation = 0, e3.colorStops = e3.colorStops.map(function(t4) {
|
|
1797
|
-
return Q(Q({}, t4), { offset: Number(t4.offset) });
|
|
1798
|
-
}), e3;
|
|
1799
|
-
}
|
|
1800
|
-
function G(t3) {
|
|
1801
|
-
var e3 = Q({}, t3);
|
|
1802
|
-
return e3.width = Number(e3.width), e3.height = Number(e3.height), e3.margin = Number(e3.margin), e3.imageOptions = Q(Q({}, e3.imageOptions), { hideBackgroundDots: Boolean(e3.imageOptions.hideBackgroundDots), imageSize: Number(e3.imageOptions.imageSize), margin: Number(e3.imageOptions.margin) }), e3.margin > Math.min(e3.width, e3.height) && (e3.margin = Math.min(e3.width, e3.height)), e3.dotsOptions = Q({}, e3.dotsOptions), e3.dotsOptions.gradient && (e3.dotsOptions.gradient = H(e3.dotsOptions.gradient)), e3.cornersSquareOptions && (e3.cornersSquareOptions = Q({}, e3.cornersSquareOptions), e3.cornersSquareOptions.gradient && (e3.cornersSquareOptions.gradient = H(e3.cornersSquareOptions.gradient))), e3.cornersDotOptions && (e3.cornersDotOptions = Q({}, e3.cornersDotOptions), e3.cornersDotOptions.gradient && (e3.cornersDotOptions.gradient = H(e3.cornersDotOptions.gradient))), e3.backgroundOptions && (e3.backgroundOptions = Q({}, e3.backgroundOptions), e3.backgroundOptions.gradient && (e3.backgroundOptions.gradient = H(e3.backgroundOptions.gradient))), e3;
|
|
1803
|
-
}
|
|
1804
|
-
var X = r2(192), U = r2.n(X), Y = function(t3, e3, r3, n2) {
|
|
1805
|
-
return new (r3 || (r3 = Promise))(function(o2, i2) {
|
|
1806
|
-
function a2(t4) {
|
|
1807
|
-
try {
|
|
1808
|
-
u2(n2.next(t4));
|
|
1809
|
-
} catch (t5) {
|
|
1810
|
-
i2(t5);
|
|
1811
|
-
}
|
|
1812
|
-
}
|
|
1813
|
-
function s2(t4) {
|
|
1814
|
-
try {
|
|
1815
|
-
u2(n2.throw(t4));
|
|
1816
|
-
} catch (t5) {
|
|
1817
|
-
i2(t5);
|
|
1818
|
-
}
|
|
1819
|
-
}
|
|
1820
|
-
function u2(t4) {
|
|
1821
|
-
var e4;
|
|
1822
|
-
t4.done ? o2(t4.value) : (e4 = t4.value, e4 instanceof r3 ? e4 : new r3(function(t5) {
|
|
1823
|
-
t5(e4);
|
|
1824
|
-
})).then(a2, s2);
|
|
1825
|
-
}
|
|
1826
|
-
u2((n2 = n2.apply(t3, e3 || [])).next());
|
|
1827
|
-
});
|
|
1828
|
-
}, $ = function(t3, e3) {
|
|
1829
|
-
var r3, n2, o2, i2, a2 = { label: 0, sent: function() {
|
|
1830
|
-
if (1 & o2[0])
|
|
1831
|
-
throw o2[1];
|
|
1832
|
-
return o2[1];
|
|
1833
|
-
}, trys: [], ops: [] };
|
|
1834
|
-
return i2 = { next: s2(0), throw: s2(1), return: s2(2) }, "function" == typeof Symbol && (i2[Symbol.iterator] = function() {
|
|
1835
|
-
return this;
|
|
1836
|
-
}), i2;
|
|
1837
|
-
function s2(i3) {
|
|
1838
|
-
return function(s3) {
|
|
1839
|
-
return function(i4) {
|
|
1840
|
-
if (r3)
|
|
1841
|
-
throw new TypeError("Generator is already executing.");
|
|
1842
|
-
for (; a2; )
|
|
1843
|
-
try {
|
|
1844
|
-
if (r3 = 1, n2 && (o2 = 2 & i4[0] ? n2.return : i4[0] ? n2.throw || ((o2 = n2.return) && o2.call(n2), 0) : n2.next) && !(o2 = o2.call(n2, i4[1])).done)
|
|
1845
|
-
return o2;
|
|
1846
|
-
switch (n2 = 0, o2 && (i4 = [2 & i4[0], o2.value]), i4[0]) {
|
|
1847
|
-
case 0:
|
|
1848
|
-
case 1:
|
|
1849
|
-
o2 = i4;
|
|
1850
|
-
break;
|
|
1851
|
-
case 4:
|
|
1852
|
-
return a2.label++, { value: i4[1], done: false };
|
|
1853
|
-
case 5:
|
|
1854
|
-
a2.label++, n2 = i4[1], i4 = [0];
|
|
1855
|
-
continue;
|
|
1856
|
-
case 7:
|
|
1857
|
-
i4 = a2.ops.pop(), a2.trys.pop();
|
|
1858
|
-
continue;
|
|
1859
|
-
default:
|
|
1860
|
-
if (!((o2 = (o2 = a2.trys).length > 0 && o2[o2.length - 1]) || 6 !== i4[0] && 2 !== i4[0])) {
|
|
1861
|
-
a2 = 0;
|
|
1862
|
-
continue;
|
|
1863
|
-
}
|
|
1864
|
-
if (3 === i4[0] && (!o2 || i4[1] > o2[0] && i4[1] < o2[3])) {
|
|
1865
|
-
a2.label = i4[1];
|
|
1866
|
-
break;
|
|
1867
|
-
}
|
|
1868
|
-
if (6 === i4[0] && a2.label < o2[1]) {
|
|
1869
|
-
a2.label = o2[1], o2 = i4;
|
|
1870
|
-
break;
|
|
1871
|
-
}
|
|
1872
|
-
if (o2 && a2.label < o2[2]) {
|
|
1873
|
-
a2.label = o2[2], a2.ops.push(i4);
|
|
1874
|
-
break;
|
|
1875
|
-
}
|
|
1876
|
-
o2[2] && a2.ops.pop(), a2.trys.pop();
|
|
1877
|
-
continue;
|
|
1878
|
-
}
|
|
1879
|
-
i4 = e3.call(t3, a2);
|
|
1880
|
-
} catch (t4) {
|
|
1881
|
-
i4 = [6, t4], n2 = 0;
|
|
1882
|
-
} finally {
|
|
1883
|
-
r3 = o2 = 0;
|
|
1884
|
-
}
|
|
1885
|
-
if (5 & i4[0])
|
|
1886
|
-
throw i4[1];
|
|
1887
|
-
return { value: i4[0] ? i4[1] : void 0, done: true };
|
|
1888
|
-
}([i3, s3]);
|
|
1889
|
-
};
|
|
1890
|
-
}
|
|
1891
|
-
};
|
|
1892
|
-
const W = function() {
|
|
1893
|
-
function t3(t4) {
|
|
1894
|
-
this._options = t4 ? G(a(F, t4)) : F, this.update();
|
|
1895
|
-
}
|
|
1896
|
-
return t3._clearContainer = function(t4) {
|
|
1897
|
-
t4 && (t4.innerHTML = "");
|
|
1898
|
-
}, t3.prototype._getQRStylingElement = function(t4) {
|
|
1899
|
-
return void 0 === t4 && (t4 = "png"), Y(this, void 0, void 0, function() {
|
|
1900
|
-
var e3, r3, n2;
|
|
1901
|
-
return $(this, function(o2) {
|
|
1902
|
-
switch (o2.label) {
|
|
1903
|
-
case 0:
|
|
1904
|
-
if (!this._qr)
|
|
1905
|
-
throw "QR code is empty";
|
|
1906
|
-
return "svg" !== t4.toLowerCase() ? [3, 2] : (r3 = void 0, e3 = void 0, this._svg && this._svgDrawingPromise ? (e3 = this._svg, r3 = this._svgDrawingPromise) : (e3 = new L(this._options), r3 = e3.drawQR(this._qr)), [4, r3]);
|
|
1907
|
-
case 1:
|
|
1908
|
-
return o2.sent(), [2, e3];
|
|
1909
|
-
case 2:
|
|
1910
|
-
return r3 = void 0, n2 = void 0, this._canvas && this._canvasDrawingPromise ? (n2 = this._canvas, r3 = this._canvasDrawingPromise) : (n2 = new z(this._options), r3 = n2.drawQR(this._qr)), [4, r3];
|
|
1911
|
-
case 3:
|
|
1912
|
-
return o2.sent(), [2, n2];
|
|
1913
|
-
}
|
|
1914
|
-
});
|
|
1915
|
-
});
|
|
1916
|
-
}, t3.prototype.update = function(e3) {
|
|
1917
|
-
t3._clearContainer(this._container), this._options = e3 ? G(a(this._options, e3)) : 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(t4) {
|
|
1918
|
-
switch (true) {
|
|
1919
|
-
case /^[0-9]*$/.test(t4):
|
|
1920
|
-
return "Numeric";
|
|
1921
|
-
case /^[0-9A-Z $%*+\-./:]*$/.test(t4):
|
|
1922
|
-
return "Alphanumeric";
|
|
1923
|
-
default:
|
|
1924
|
-
return "Byte";
|
|
1925
|
-
}
|
|
1926
|
-
}(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));
|
|
1927
|
-
}, t3.prototype.append = function(t4) {
|
|
1928
|
-
if (t4) {
|
|
1929
|
-
if ("function" != typeof t4.appendChild)
|
|
1930
|
-
throw "Container should be a single DOM node";
|
|
1931
|
-
this._options.type === N ? this._canvas && t4.appendChild(this._canvas.getCanvas()) : this._svg && t4.appendChild(this._svg.getElement()), this._container = t4;
|
|
1932
|
-
}
|
|
1933
|
-
}, t3.prototype.getRawData = function(t4) {
|
|
1934
|
-
return void 0 === t4 && (t4 = "png"), Y(this, void 0, void 0, function() {
|
|
1935
|
-
var e3, r3, n2;
|
|
1936
|
-
return $(this, function(o2) {
|
|
1937
|
-
switch (o2.label) {
|
|
1938
|
-
case 0:
|
|
1939
|
-
if (!this._qr)
|
|
1940
|
-
throw "QR code is empty";
|
|
1941
|
-
return [4, this._getQRStylingElement(t4)];
|
|
1942
|
-
case 1:
|
|
1943
|
-
return e3 = o2.sent(), "svg" === t4.toLowerCase() ? (r3 = new XMLSerializer(), n2 = r3.serializeToString(e3.getElement()), [2, new Blob(['<?xml version="1.0" standalone="no"?>\r\n' + n2], { type: "image/svg+xml" })]) : [2, new Promise(function(r4) {
|
|
1944
|
-
return e3.getCanvas().toBlob(r4, "image/" + t4, 1);
|
|
1945
|
-
})];
|
|
1946
|
-
}
|
|
1947
|
-
});
|
|
1948
|
-
});
|
|
1949
|
-
}, t3.prototype.download = function(t4) {
|
|
1950
|
-
return Y(this, void 0, void 0, function() {
|
|
1951
|
-
var e3, r3, n2, o2, i2;
|
|
1952
|
-
return $(this, function(a2) {
|
|
1953
|
-
switch (a2.label) {
|
|
1954
|
-
case 0:
|
|
1955
|
-
if (!this._qr)
|
|
1956
|
-
throw "QR code is empty";
|
|
1957
|
-
return e3 = "png", r3 = "qr", "string" == typeof t4 ? (e3 = t4, console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")) : "object" == typeof t4 && null !== t4 && (t4.name && (r3 = t4.name), t4.extension && (e3 = t4.extension)), [4, this._getQRStylingElement(e3)];
|
|
1958
|
-
case 1:
|
|
1959
|
-
return n2 = a2.sent(), "svg" === e3.toLowerCase() ? (o2 = new XMLSerializer(), i2 = '<?xml version="1.0" standalone="no"?>\r\n' + (i2 = o2.serializeToString(n2.getElement())), s("data:image/svg+xml;charset=utf-8," + encodeURIComponent(i2), r3 + ".svg")) : s(n2.getCanvas().toDataURL("image/" + e3), r3 + "." + e3), [2];
|
|
1960
|
-
}
|
|
1961
|
-
});
|
|
1962
|
-
});
|
|
1963
|
-
}, t3;
|
|
1964
|
-
}();
|
|
1965
|
-
} }, e = {};
|
|
1966
|
-
function r(n) {
|
|
1967
|
-
if (e[n])
|
|
1968
|
-
return e[n].exports;
|
|
1969
|
-
var o = e[n] = { exports: {} };
|
|
1970
|
-
return t[n](o, o.exports, r), o.exports;
|
|
1971
|
-
}
|
|
1972
|
-
return r.n = (t2) => {
|
|
1973
|
-
var e2 = t2 && t2.__esModule ? () => t2.default : () => t2;
|
|
1974
|
-
return r.d(e2, { a: e2 }), e2;
|
|
1975
|
-
}, r.d = (t2, e2) => {
|
|
1976
|
-
for (var n in e2)
|
|
1977
|
-
r.o(e2, n) && !r.o(t2, n) && Object.defineProperty(t2, n, { enumerable: true, get: e2[n] });
|
|
1978
|
-
}, r.o = (t2, e2) => Object.prototype.hasOwnProperty.call(t2, e2), r(796);
|
|
1979
|
-
})().default;
|
|
1980
|
-
});
|
|
1981
|
-
})(qrCodeStyling);
|
|
1982
|
-
var QRCodeStyling = /* @__PURE__ */ getDefaultExportFromCjs(qrCodeStyling.exports);
|
|
1983
|
-
var View_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
1984
|
-
var _export_sfc = (sfc, props) => {
|
|
1985
|
-
const target = sfc.__vccOpts || sfc;
|
|
1986
|
-
for (const [key, val] of props) {
|
|
1987
|
-
target[key] = val;
|
|
1988
|
-
}
|
|
1989
|
-
return target;
|
|
1990
|
-
};
|
|
1991
|
-
const _hoisted_1 = { class: "az-qrcode" };
|
|
1992
|
-
const _hoisted_2 = { class: "az-qrcode-left" };
|
|
1993
|
-
const _hoisted_3 = { class: "az-qrcode-right" };
|
|
1994
|
-
const _hoisted_4 = { class: "az-qrcode-bottom" };
|
|
1995
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1996
|
-
__name: "View",
|
|
1997
|
-
props: {
|
|
1998
|
-
width: null,
|
|
1999
|
-
height: null,
|
|
2000
|
-
bgColor: null,
|
|
2001
|
-
dotsColor: null,
|
|
2002
|
-
value: null,
|
|
2003
|
-
outlineValue: null
|
|
2004
|
-
},
|
|
2005
|
-
setup(__props) {
|
|
2006
|
-
var _a, _b, _c, _d;
|
|
2007
|
-
const props = __props;
|
|
2008
|
-
const options = ref(
|
|
2009
|
-
{
|
|
2010
|
-
width: props.width,
|
|
2011
|
-
height: props.height,
|
|
2012
|
-
type: "svg",
|
|
2013
|
-
data: props.value,
|
|
2014
|
-
qrOptions: {
|
|
2015
|
-
typeNumber: 0,
|
|
2016
|
-
mode: "Byte",
|
|
2017
|
-
errorCorrectionLevel: "H"
|
|
2018
|
-
},
|
|
2019
|
-
backgroundOptions: {
|
|
2020
|
-
color: (_a = props.bgColor) != null ? _a : "white"
|
|
2021
|
-
},
|
|
2022
|
-
dotsOptions: {
|
|
2023
|
-
color: (_b = props.dotsColor) != null ? _b : "black",
|
|
2024
|
-
type: "square"
|
|
2025
|
-
},
|
|
2026
|
-
cornersSquareOptions: {
|
|
2027
|
-
color: (_c = props.dotsColor) != null ? _c : "black",
|
|
2028
|
-
type: "square"
|
|
2029
|
-
},
|
|
2030
|
-
cornersDotOptions: {
|
|
2031
|
-
color: (_d = props.dotsColor) != null ? _d : "black",
|
|
2032
|
-
type: "square"
|
|
2033
|
-
}
|
|
2034
|
-
}
|
|
2035
|
-
);
|
|
2036
|
-
const qrCodeStyling2 = new QRCodeStyling(options.value);
|
|
2037
|
-
const qrCode = ref();
|
|
2038
|
-
onMounted(() => {
|
|
2039
|
-
qrCodeStyling2.append(qrCode.value);
|
|
2040
|
-
});
|
|
2041
|
-
watch(() => props.value, (currentValue) => {
|
|
2042
|
-
options.value.data = currentValue;
|
|
2043
|
-
qrCodeStyling2.update(options.value);
|
|
2044
|
-
});
|
|
2045
|
-
return (_ctx, _cache) => {
|
|
2046
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
2047
|
-
createElementVNode("div", null, toDisplayString(__props.outlineValue), 1),
|
|
2048
|
-
createElementVNode("div", {
|
|
2049
|
-
class: "az-qrcode-center",
|
|
2050
|
-
style: normalizeStyle(`grid-template-columns: auto ${props.width}px auto;`)
|
|
2051
|
-
}, [
|
|
2052
|
-
createElementVNode("div", _hoisted_2, toDisplayString(__props.outlineValue), 1),
|
|
2053
|
-
createElementVNode("div", null, [
|
|
2054
|
-
createElementVNode("div", {
|
|
2055
|
-
ref_key: "qrCode",
|
|
2056
|
-
ref: qrCode
|
|
2057
|
-
}, null, 512)
|
|
2058
|
-
]),
|
|
2059
|
-
createElementVNode("div", _hoisted_3, toDisplayString(__props.outlineValue), 1)
|
|
2060
|
-
], 4),
|
|
2061
|
-
createElementVNode("div", _hoisted_4, toDisplayString(__props.outlineValue), 1)
|
|
2062
|
-
]);
|
|
2063
|
-
};
|
|
2064
|
-
}
|
|
2065
|
-
});
|
|
2066
|
-
var View = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-da2a1ac4"]]);
|
|
2067
|
-
class Bloc {
|
|
2068
|
-
constructor(initialState) {
|
|
2069
|
-
__publicField(this, "internalState");
|
|
2070
|
-
__publicField(this, "listeners", []);
|
|
2071
|
-
this.internalState = initialState;
|
|
2072
|
-
}
|
|
2073
|
-
get state() {
|
|
2074
|
-
return this.internalState;
|
|
2075
|
-
}
|
|
2076
|
-
changeState(state) {
|
|
2077
|
-
this.internalState = state;
|
|
2078
|
-
if (this.listeners.length > 0) {
|
|
2079
|
-
this.listeners.forEach((listener) => listener(this.state));
|
|
2080
|
-
}
|
|
2081
|
-
}
|
|
2082
|
-
subscribe(listener) {
|
|
2083
|
-
this.listeners.push(listener);
|
|
2084
|
-
}
|
|
2085
|
-
unsubscribe(listener) {
|
|
2086
|
-
const index = this.listeners.indexOf(listener);
|
|
2087
|
-
if (index > -1) {
|
|
2088
|
-
this.listeners.splice(index, 1);
|
|
2089
|
-
}
|
|
2090
|
-
}
|
|
2091
|
-
}
|
|
2092
|
-
export { Bloc, View as QRCode, dateToString, onPictureUpdated, pad, parseToInt, readBlobFromUrl, useBlocState };
|