@camstack/addon-export-hap 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@mf-types/compiled-types/page/HomeKitOverviewPage.d.ts +24 -0
- package/dist/@mf-types/compiled-types/page/HomeKitOverviewPage.d.ts.map +1 -0
- package/dist/@mf-types/compiled-types/page/page.d.ts +12 -0
- package/dist/@mf-types/compiled-types/page/page.d.ts.map +1 -0
- package/dist/@mf-types/page.d.ts +2 -0
- package/dist/@mf-types.d.ts +3 -0
- package/dist/@mf-types.zip +0 -0
- package/dist/__mfe_internal__addon_export_hap_page__loadShare___mf_0_camstack_mf_1_sdk__loadShare__.mjs-B7qZNHZC.mjs +12 -0
- package/dist/__mfe_internal__addon_export_hap_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.mjs-B3wGuKgV.mjs +12 -0
- package/dist/__mfe_internal__addon_export_hap_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-D4zYQtXk.mjs +73 -0
- package/dist/__mfe_internal__addon_export_hap_page__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs-DrrRnQpW.mjs +42 -0
- package/dist/__mfe_internal__addon_export_hap_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-BEeMNLCX.mjs +46 -0
- package/dist/__mfe_internal__addon_export_hap_page__loadShare__react__loadShare__.mjs-BPYrKf_3.mjs +56 -0
- package/dist/__mfe_internal__addon_export_hap_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-x684zh94.mjs +18 -0
- package/dist/__mfe_internal__addon_export_hap_page__loadShare__react_mf_2_dom__loadShare__.mjs-CHMNar3q.mjs +28 -0
- package/dist/__mfe_internal__addon_export_hap_page__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-CM8j15CX.mjs +18 -0
- package/dist/_stub.js +3223 -0
- package/dist/_virtual_mf-localSharedImportMap___mfe_internal__addon_export_hap_page-Cq9F5QFd.mjs +156 -0
- package/dist/addon-export-hap.css +3 -0
- package/dist/browser-i_dCVxwk.mjs +1227 -0
- package/dist/client-COVrSAyU.mjs +7592 -0
- package/dist/dist-BLWGlNFD.mjs +2483 -0
- package/dist/dist-Bna6cbWX.mjs +17192 -0
- package/dist/dist-C_M8X1vZ.mjs +1260 -0
- package/dist/dist-C_kcZj9a.mjs +12848 -0
- package/dist/dist-DOK7aZoj.mjs +662 -0
- package/dist/dist-RCwIG6iQ.mjs +2229 -0
- package/dist/export-hap.addon.js +57821 -0
- package/dist/export-hap.addon.js.map +1 -0
- package/dist/export-hap.addon.mjs +57807 -0
- package/dist/export-hap.addon.mjs.map +1 -0
- package/dist/getErrorShape-BPSzUA7W-m6tLWUI0.mjs +189 -0
- package/dist/hostInit-CPk5kMR8.mjs +144 -0
- package/dist/index.js +9 -0
- package/dist/index.mjs +2 -0
- package/dist/jsx-runtime-C-bO5vlp.mjs +22 -0
- package/dist/modern-DN59UY0v.mjs +2184 -0
- package/dist/react-Bl6eCS2o.mjs +293 -0
- package/dist/react-dom-lYY58-MR.mjs +131 -0
- package/dist/remoteEntry.js +83 -0
- package/dist/rolldown-runtime-DC4cgjXG.mjs +20 -0
- package/dist/schemas-DswVYZsq.mjs +3483 -0
- package/dist/virtualExposes-Biq8M5a-.mjs +27 -0
- package/package.json +93 -0
|
@@ -0,0 +1,1227 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-DC4cgjXG.mjs";
|
|
2
|
+
//#region ../../node_modules/qrcode/lib/can-promise.js
|
|
3
|
+
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
|
+
t.exports = function() {
|
|
5
|
+
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
6
|
+
};
|
|
7
|
+
})), n = /* @__PURE__ */ e(((e) => {
|
|
8
|
+
var t, n = [
|
|
9
|
+
0,
|
|
10
|
+
26,
|
|
11
|
+
44,
|
|
12
|
+
70,
|
|
13
|
+
100,
|
|
14
|
+
134,
|
|
15
|
+
172,
|
|
16
|
+
196,
|
|
17
|
+
242,
|
|
18
|
+
292,
|
|
19
|
+
346,
|
|
20
|
+
404,
|
|
21
|
+
466,
|
|
22
|
+
532,
|
|
23
|
+
581,
|
|
24
|
+
655,
|
|
25
|
+
733,
|
|
26
|
+
815,
|
|
27
|
+
901,
|
|
28
|
+
991,
|
|
29
|
+
1085,
|
|
30
|
+
1156,
|
|
31
|
+
1258,
|
|
32
|
+
1364,
|
|
33
|
+
1474,
|
|
34
|
+
1588,
|
|
35
|
+
1706,
|
|
36
|
+
1828,
|
|
37
|
+
1921,
|
|
38
|
+
2051,
|
|
39
|
+
2185,
|
|
40
|
+
2323,
|
|
41
|
+
2465,
|
|
42
|
+
2611,
|
|
43
|
+
2761,
|
|
44
|
+
2876,
|
|
45
|
+
3034,
|
|
46
|
+
3196,
|
|
47
|
+
3362,
|
|
48
|
+
3532,
|
|
49
|
+
3706
|
|
50
|
+
];
|
|
51
|
+
e.getSymbolSize = function(e) {
|
|
52
|
+
if (!e) throw Error("\"version\" cannot be null or undefined");
|
|
53
|
+
if (e < 1 || e > 40) throw Error("\"version\" should be in range from 1 to 40");
|
|
54
|
+
return e * 4 + 17;
|
|
55
|
+
}, e.getSymbolTotalCodewords = function(e) {
|
|
56
|
+
return n[e];
|
|
57
|
+
}, e.getBCHDigit = function(e) {
|
|
58
|
+
let t = 0;
|
|
59
|
+
for (; e !== 0;) t++, e >>>= 1;
|
|
60
|
+
return t;
|
|
61
|
+
}, e.setToSJISFunction = function(e) {
|
|
62
|
+
if (typeof e != "function") throw Error("\"toSJISFunc\" is not a valid function.");
|
|
63
|
+
t = e;
|
|
64
|
+
}, e.isKanjiModeEnabled = function() {
|
|
65
|
+
return t !== void 0;
|
|
66
|
+
}, e.toSJIS = function(e) {
|
|
67
|
+
return t(e);
|
|
68
|
+
};
|
|
69
|
+
})), r = /* @__PURE__ */ e(((e) => {
|
|
70
|
+
e.L = { bit: 1 }, e.M = { bit: 0 }, e.Q = { bit: 3 }, e.H = { bit: 2 };
|
|
71
|
+
function t(t) {
|
|
72
|
+
if (typeof t != "string") throw Error("Param is not a string");
|
|
73
|
+
switch (t.toLowerCase()) {
|
|
74
|
+
case "l":
|
|
75
|
+
case "low": return e.L;
|
|
76
|
+
case "m":
|
|
77
|
+
case "medium": return e.M;
|
|
78
|
+
case "q":
|
|
79
|
+
case "quartile": return e.Q;
|
|
80
|
+
case "h":
|
|
81
|
+
case "high": return e.H;
|
|
82
|
+
default: throw Error("Unknown EC Level: " + t);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
e.isValid = function(e) {
|
|
86
|
+
return e && e.bit !== void 0 && e.bit >= 0 && e.bit < 4;
|
|
87
|
+
}, e.from = function(n, r) {
|
|
88
|
+
if (e.isValid(n)) return n;
|
|
89
|
+
try {
|
|
90
|
+
return t(n);
|
|
91
|
+
} catch {
|
|
92
|
+
return r;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
})), i = /* @__PURE__ */ e(((e, t) => {
|
|
96
|
+
function n() {
|
|
97
|
+
this.buffer = [], this.length = 0;
|
|
98
|
+
}
|
|
99
|
+
n.prototype = {
|
|
100
|
+
get: function(e) {
|
|
101
|
+
let t = Math.floor(e / 8);
|
|
102
|
+
return (this.buffer[t] >>> 7 - e % 8 & 1) == 1;
|
|
103
|
+
},
|
|
104
|
+
put: function(e, t) {
|
|
105
|
+
for (let n = 0; n < t; n++) this.putBit((e >>> t - n - 1 & 1) == 1);
|
|
106
|
+
},
|
|
107
|
+
getLengthInBits: function() {
|
|
108
|
+
return this.length;
|
|
109
|
+
},
|
|
110
|
+
putBit: function(e) {
|
|
111
|
+
let t = Math.floor(this.length / 8);
|
|
112
|
+
this.buffer.length <= t && this.buffer.push(0), e && (this.buffer[t] |= 128 >>> this.length % 8), this.length++;
|
|
113
|
+
}
|
|
114
|
+
}, t.exports = n;
|
|
115
|
+
})), a = /* @__PURE__ */ e(((e, t) => {
|
|
116
|
+
function n(e) {
|
|
117
|
+
if (!e || e < 1) throw Error("BitMatrix size must be defined and greater than 0");
|
|
118
|
+
this.size = e, this.data = new Uint8Array(e * e), this.reservedBit = new Uint8Array(e * e);
|
|
119
|
+
}
|
|
120
|
+
n.prototype.set = function(e, t, n, r) {
|
|
121
|
+
let i = e * this.size + t;
|
|
122
|
+
this.data[i] = n, r && (this.reservedBit[i] = !0);
|
|
123
|
+
}, n.prototype.get = function(e, t) {
|
|
124
|
+
return this.data[e * this.size + t];
|
|
125
|
+
}, n.prototype.xor = function(e, t, n) {
|
|
126
|
+
this.data[e * this.size + t] ^= n;
|
|
127
|
+
}, n.prototype.isReserved = function(e, t) {
|
|
128
|
+
return this.reservedBit[e * this.size + t];
|
|
129
|
+
}, t.exports = n;
|
|
130
|
+
})), o = /* @__PURE__ */ e(((e) => {
|
|
131
|
+
var t = n().getSymbolSize;
|
|
132
|
+
e.getRowColCoords = function(e) {
|
|
133
|
+
if (e === 1) return [];
|
|
134
|
+
let n = Math.floor(e / 7) + 2, r = t(e), i = r === 145 ? 26 : Math.ceil((r - 13) / (2 * n - 2)) * 2, a = [r - 7];
|
|
135
|
+
for (let e = 1; e < n - 1; e++) a[e] = a[e - 1] - i;
|
|
136
|
+
return a.push(6), a.reverse();
|
|
137
|
+
}, e.getPositions = function(t) {
|
|
138
|
+
let n = [], r = e.getRowColCoords(t), i = r.length;
|
|
139
|
+
for (let e = 0; e < i; e++) for (let t = 0; t < i; t++) e === 0 && t === 0 || e === 0 && t === i - 1 || e === i - 1 && t === 0 || n.push([r[e], r[t]]);
|
|
140
|
+
return n;
|
|
141
|
+
};
|
|
142
|
+
})), s = /* @__PURE__ */ e(((e) => {
|
|
143
|
+
var t = n().getSymbolSize, r = 7;
|
|
144
|
+
e.getPositions = function(e) {
|
|
145
|
+
let n = t(e);
|
|
146
|
+
return [
|
|
147
|
+
[0, 0],
|
|
148
|
+
[n - r, 0],
|
|
149
|
+
[0, n - r]
|
|
150
|
+
];
|
|
151
|
+
};
|
|
152
|
+
})), c = /* @__PURE__ */ e(((e) => {
|
|
153
|
+
e.Patterns = {
|
|
154
|
+
PATTERN000: 0,
|
|
155
|
+
PATTERN001: 1,
|
|
156
|
+
PATTERN010: 2,
|
|
157
|
+
PATTERN011: 3,
|
|
158
|
+
PATTERN100: 4,
|
|
159
|
+
PATTERN101: 5,
|
|
160
|
+
PATTERN110: 6,
|
|
161
|
+
PATTERN111: 7
|
|
162
|
+
};
|
|
163
|
+
var t = {
|
|
164
|
+
N1: 3,
|
|
165
|
+
N2: 3,
|
|
166
|
+
N3: 40,
|
|
167
|
+
N4: 10
|
|
168
|
+
};
|
|
169
|
+
e.isValid = function(e) {
|
|
170
|
+
return e != null && e !== "" && !isNaN(e) && e >= 0 && e <= 7;
|
|
171
|
+
}, e.from = function(t) {
|
|
172
|
+
return e.isValid(t) ? parseInt(t, 10) : void 0;
|
|
173
|
+
}, e.getPenaltyN1 = function(e) {
|
|
174
|
+
let n = e.size, r = 0, i = 0, a = 0, o = null, s = null;
|
|
175
|
+
for (let c = 0; c < n; c++) {
|
|
176
|
+
i = a = 0, o = s = null;
|
|
177
|
+
for (let l = 0; l < n; l++) {
|
|
178
|
+
let n = e.get(c, l);
|
|
179
|
+
n === o ? i++ : (i >= 5 && (r += t.N1 + (i - 5)), o = n, i = 1), n = e.get(l, c), n === s ? a++ : (a >= 5 && (r += t.N1 + (a - 5)), s = n, a = 1);
|
|
180
|
+
}
|
|
181
|
+
i >= 5 && (r += t.N1 + (i - 5)), a >= 5 && (r += t.N1 + (a - 5));
|
|
182
|
+
}
|
|
183
|
+
return r;
|
|
184
|
+
}, e.getPenaltyN2 = function(e) {
|
|
185
|
+
let n = e.size, r = 0;
|
|
186
|
+
for (let t = 0; t < n - 1; t++) for (let i = 0; i < n - 1; i++) {
|
|
187
|
+
let n = e.get(t, i) + e.get(t, i + 1) + e.get(t + 1, i) + e.get(t + 1, i + 1);
|
|
188
|
+
(n === 4 || n === 0) && r++;
|
|
189
|
+
}
|
|
190
|
+
return r * t.N2;
|
|
191
|
+
}, e.getPenaltyN3 = function(e) {
|
|
192
|
+
let n = e.size, r = 0, i = 0, a = 0;
|
|
193
|
+
for (let t = 0; t < n; t++) {
|
|
194
|
+
i = a = 0;
|
|
195
|
+
for (let o = 0; o < n; o++) i = i << 1 & 2047 | e.get(t, o), o >= 10 && (i === 1488 || i === 93) && r++, a = a << 1 & 2047 | e.get(o, t), o >= 10 && (a === 1488 || a === 93) && r++;
|
|
196
|
+
}
|
|
197
|
+
return r * t.N3;
|
|
198
|
+
}, e.getPenaltyN4 = function(e) {
|
|
199
|
+
let n = 0, r = e.data.length;
|
|
200
|
+
for (let t = 0; t < r; t++) n += e.data[t];
|
|
201
|
+
return Math.abs(Math.ceil(n * 100 / r / 5) - 10) * t.N4;
|
|
202
|
+
};
|
|
203
|
+
function n(t, n, r) {
|
|
204
|
+
switch (t) {
|
|
205
|
+
case e.Patterns.PATTERN000: return (n + r) % 2 == 0;
|
|
206
|
+
case e.Patterns.PATTERN001: return n % 2 == 0;
|
|
207
|
+
case e.Patterns.PATTERN010: return r % 3 == 0;
|
|
208
|
+
case e.Patterns.PATTERN011: return (n + r) % 3 == 0;
|
|
209
|
+
case e.Patterns.PATTERN100: return (Math.floor(n / 2) + Math.floor(r / 3)) % 2 == 0;
|
|
210
|
+
case e.Patterns.PATTERN101: return n * r % 2 + n * r % 3 == 0;
|
|
211
|
+
case e.Patterns.PATTERN110: return (n * r % 2 + n * r % 3) % 2 == 0;
|
|
212
|
+
case e.Patterns.PATTERN111: return (n * r % 3 + (n + r) % 2) % 2 == 0;
|
|
213
|
+
default: throw Error("bad maskPattern:" + t);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
e.applyMask = function(e, t) {
|
|
217
|
+
let r = t.size;
|
|
218
|
+
for (let i = 0; i < r; i++) for (let a = 0; a < r; a++) t.isReserved(a, i) || t.xor(a, i, n(e, a, i));
|
|
219
|
+
}, e.getBestMask = function(t, n) {
|
|
220
|
+
let r = Object.keys(e.Patterns).length, i = 0, a = Infinity;
|
|
221
|
+
for (let o = 0; o < r; o++) {
|
|
222
|
+
n(o), e.applyMask(o, t);
|
|
223
|
+
let r = e.getPenaltyN1(t) + e.getPenaltyN2(t) + e.getPenaltyN3(t) + e.getPenaltyN4(t);
|
|
224
|
+
e.applyMask(o, t), r < a && (a = r, i = o);
|
|
225
|
+
}
|
|
226
|
+
return i;
|
|
227
|
+
};
|
|
228
|
+
})), l = /* @__PURE__ */ e(((e) => {
|
|
229
|
+
var t = r(), n = [
|
|
230
|
+
1,
|
|
231
|
+
1,
|
|
232
|
+
1,
|
|
233
|
+
1,
|
|
234
|
+
1,
|
|
235
|
+
1,
|
|
236
|
+
1,
|
|
237
|
+
1,
|
|
238
|
+
1,
|
|
239
|
+
1,
|
|
240
|
+
2,
|
|
241
|
+
2,
|
|
242
|
+
1,
|
|
243
|
+
2,
|
|
244
|
+
2,
|
|
245
|
+
4,
|
|
246
|
+
1,
|
|
247
|
+
2,
|
|
248
|
+
4,
|
|
249
|
+
4,
|
|
250
|
+
2,
|
|
251
|
+
4,
|
|
252
|
+
4,
|
|
253
|
+
4,
|
|
254
|
+
2,
|
|
255
|
+
4,
|
|
256
|
+
6,
|
|
257
|
+
5,
|
|
258
|
+
2,
|
|
259
|
+
4,
|
|
260
|
+
6,
|
|
261
|
+
6,
|
|
262
|
+
2,
|
|
263
|
+
5,
|
|
264
|
+
8,
|
|
265
|
+
8,
|
|
266
|
+
4,
|
|
267
|
+
5,
|
|
268
|
+
8,
|
|
269
|
+
8,
|
|
270
|
+
4,
|
|
271
|
+
5,
|
|
272
|
+
8,
|
|
273
|
+
11,
|
|
274
|
+
4,
|
|
275
|
+
8,
|
|
276
|
+
10,
|
|
277
|
+
11,
|
|
278
|
+
4,
|
|
279
|
+
9,
|
|
280
|
+
12,
|
|
281
|
+
16,
|
|
282
|
+
4,
|
|
283
|
+
9,
|
|
284
|
+
16,
|
|
285
|
+
16,
|
|
286
|
+
6,
|
|
287
|
+
10,
|
|
288
|
+
12,
|
|
289
|
+
18,
|
|
290
|
+
6,
|
|
291
|
+
10,
|
|
292
|
+
17,
|
|
293
|
+
16,
|
|
294
|
+
6,
|
|
295
|
+
11,
|
|
296
|
+
16,
|
|
297
|
+
19,
|
|
298
|
+
6,
|
|
299
|
+
13,
|
|
300
|
+
18,
|
|
301
|
+
21,
|
|
302
|
+
7,
|
|
303
|
+
14,
|
|
304
|
+
21,
|
|
305
|
+
25,
|
|
306
|
+
8,
|
|
307
|
+
16,
|
|
308
|
+
20,
|
|
309
|
+
25,
|
|
310
|
+
8,
|
|
311
|
+
17,
|
|
312
|
+
23,
|
|
313
|
+
25,
|
|
314
|
+
9,
|
|
315
|
+
17,
|
|
316
|
+
23,
|
|
317
|
+
34,
|
|
318
|
+
9,
|
|
319
|
+
18,
|
|
320
|
+
25,
|
|
321
|
+
30,
|
|
322
|
+
10,
|
|
323
|
+
20,
|
|
324
|
+
27,
|
|
325
|
+
32,
|
|
326
|
+
12,
|
|
327
|
+
21,
|
|
328
|
+
29,
|
|
329
|
+
35,
|
|
330
|
+
12,
|
|
331
|
+
23,
|
|
332
|
+
34,
|
|
333
|
+
37,
|
|
334
|
+
12,
|
|
335
|
+
25,
|
|
336
|
+
34,
|
|
337
|
+
40,
|
|
338
|
+
13,
|
|
339
|
+
26,
|
|
340
|
+
35,
|
|
341
|
+
42,
|
|
342
|
+
14,
|
|
343
|
+
28,
|
|
344
|
+
38,
|
|
345
|
+
45,
|
|
346
|
+
15,
|
|
347
|
+
29,
|
|
348
|
+
40,
|
|
349
|
+
48,
|
|
350
|
+
16,
|
|
351
|
+
31,
|
|
352
|
+
43,
|
|
353
|
+
51,
|
|
354
|
+
17,
|
|
355
|
+
33,
|
|
356
|
+
45,
|
|
357
|
+
54,
|
|
358
|
+
18,
|
|
359
|
+
35,
|
|
360
|
+
48,
|
|
361
|
+
57,
|
|
362
|
+
19,
|
|
363
|
+
37,
|
|
364
|
+
51,
|
|
365
|
+
60,
|
|
366
|
+
19,
|
|
367
|
+
38,
|
|
368
|
+
53,
|
|
369
|
+
63,
|
|
370
|
+
20,
|
|
371
|
+
40,
|
|
372
|
+
56,
|
|
373
|
+
66,
|
|
374
|
+
21,
|
|
375
|
+
43,
|
|
376
|
+
59,
|
|
377
|
+
70,
|
|
378
|
+
22,
|
|
379
|
+
45,
|
|
380
|
+
62,
|
|
381
|
+
74,
|
|
382
|
+
24,
|
|
383
|
+
47,
|
|
384
|
+
65,
|
|
385
|
+
77,
|
|
386
|
+
25,
|
|
387
|
+
49,
|
|
388
|
+
68,
|
|
389
|
+
81
|
|
390
|
+
], i = [
|
|
391
|
+
7,
|
|
392
|
+
10,
|
|
393
|
+
13,
|
|
394
|
+
17,
|
|
395
|
+
10,
|
|
396
|
+
16,
|
|
397
|
+
22,
|
|
398
|
+
28,
|
|
399
|
+
15,
|
|
400
|
+
26,
|
|
401
|
+
36,
|
|
402
|
+
44,
|
|
403
|
+
20,
|
|
404
|
+
36,
|
|
405
|
+
52,
|
|
406
|
+
64,
|
|
407
|
+
26,
|
|
408
|
+
48,
|
|
409
|
+
72,
|
|
410
|
+
88,
|
|
411
|
+
36,
|
|
412
|
+
64,
|
|
413
|
+
96,
|
|
414
|
+
112,
|
|
415
|
+
40,
|
|
416
|
+
72,
|
|
417
|
+
108,
|
|
418
|
+
130,
|
|
419
|
+
48,
|
|
420
|
+
88,
|
|
421
|
+
132,
|
|
422
|
+
156,
|
|
423
|
+
60,
|
|
424
|
+
110,
|
|
425
|
+
160,
|
|
426
|
+
192,
|
|
427
|
+
72,
|
|
428
|
+
130,
|
|
429
|
+
192,
|
|
430
|
+
224,
|
|
431
|
+
80,
|
|
432
|
+
150,
|
|
433
|
+
224,
|
|
434
|
+
264,
|
|
435
|
+
96,
|
|
436
|
+
176,
|
|
437
|
+
260,
|
|
438
|
+
308,
|
|
439
|
+
104,
|
|
440
|
+
198,
|
|
441
|
+
288,
|
|
442
|
+
352,
|
|
443
|
+
120,
|
|
444
|
+
216,
|
|
445
|
+
320,
|
|
446
|
+
384,
|
|
447
|
+
132,
|
|
448
|
+
240,
|
|
449
|
+
360,
|
|
450
|
+
432,
|
|
451
|
+
144,
|
|
452
|
+
280,
|
|
453
|
+
408,
|
|
454
|
+
480,
|
|
455
|
+
168,
|
|
456
|
+
308,
|
|
457
|
+
448,
|
|
458
|
+
532,
|
|
459
|
+
180,
|
|
460
|
+
338,
|
|
461
|
+
504,
|
|
462
|
+
588,
|
|
463
|
+
196,
|
|
464
|
+
364,
|
|
465
|
+
546,
|
|
466
|
+
650,
|
|
467
|
+
224,
|
|
468
|
+
416,
|
|
469
|
+
600,
|
|
470
|
+
700,
|
|
471
|
+
224,
|
|
472
|
+
442,
|
|
473
|
+
644,
|
|
474
|
+
750,
|
|
475
|
+
252,
|
|
476
|
+
476,
|
|
477
|
+
690,
|
|
478
|
+
816,
|
|
479
|
+
270,
|
|
480
|
+
504,
|
|
481
|
+
750,
|
|
482
|
+
900,
|
|
483
|
+
300,
|
|
484
|
+
560,
|
|
485
|
+
810,
|
|
486
|
+
960,
|
|
487
|
+
312,
|
|
488
|
+
588,
|
|
489
|
+
870,
|
|
490
|
+
1050,
|
|
491
|
+
336,
|
|
492
|
+
644,
|
|
493
|
+
952,
|
|
494
|
+
1110,
|
|
495
|
+
360,
|
|
496
|
+
700,
|
|
497
|
+
1020,
|
|
498
|
+
1200,
|
|
499
|
+
390,
|
|
500
|
+
728,
|
|
501
|
+
1050,
|
|
502
|
+
1260,
|
|
503
|
+
420,
|
|
504
|
+
784,
|
|
505
|
+
1140,
|
|
506
|
+
1350,
|
|
507
|
+
450,
|
|
508
|
+
812,
|
|
509
|
+
1200,
|
|
510
|
+
1440,
|
|
511
|
+
480,
|
|
512
|
+
868,
|
|
513
|
+
1290,
|
|
514
|
+
1530,
|
|
515
|
+
510,
|
|
516
|
+
924,
|
|
517
|
+
1350,
|
|
518
|
+
1620,
|
|
519
|
+
540,
|
|
520
|
+
980,
|
|
521
|
+
1440,
|
|
522
|
+
1710,
|
|
523
|
+
570,
|
|
524
|
+
1036,
|
|
525
|
+
1530,
|
|
526
|
+
1800,
|
|
527
|
+
570,
|
|
528
|
+
1064,
|
|
529
|
+
1590,
|
|
530
|
+
1890,
|
|
531
|
+
600,
|
|
532
|
+
1120,
|
|
533
|
+
1680,
|
|
534
|
+
1980,
|
|
535
|
+
630,
|
|
536
|
+
1204,
|
|
537
|
+
1770,
|
|
538
|
+
2100,
|
|
539
|
+
660,
|
|
540
|
+
1260,
|
|
541
|
+
1860,
|
|
542
|
+
2220,
|
|
543
|
+
720,
|
|
544
|
+
1316,
|
|
545
|
+
1950,
|
|
546
|
+
2310,
|
|
547
|
+
750,
|
|
548
|
+
1372,
|
|
549
|
+
2040,
|
|
550
|
+
2430
|
|
551
|
+
];
|
|
552
|
+
e.getBlocksCount = function(e, r) {
|
|
553
|
+
switch (r) {
|
|
554
|
+
case t.L: return n[(e - 1) * 4 + 0];
|
|
555
|
+
case t.M: return n[(e - 1) * 4 + 1];
|
|
556
|
+
case t.Q: return n[(e - 1) * 4 + 2];
|
|
557
|
+
case t.H: return n[(e - 1) * 4 + 3];
|
|
558
|
+
default: return;
|
|
559
|
+
}
|
|
560
|
+
}, e.getTotalCodewordsCount = function(e, n) {
|
|
561
|
+
switch (n) {
|
|
562
|
+
case t.L: return i[(e - 1) * 4 + 0];
|
|
563
|
+
case t.M: return i[(e - 1) * 4 + 1];
|
|
564
|
+
case t.Q: return i[(e - 1) * 4 + 2];
|
|
565
|
+
case t.H: return i[(e - 1) * 4 + 3];
|
|
566
|
+
default: return;
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
})), u = /* @__PURE__ */ e(((e) => {
|
|
570
|
+
var t = new Uint8Array(512), n = new Uint8Array(256);
|
|
571
|
+
(function() {
|
|
572
|
+
let e = 1;
|
|
573
|
+
for (let r = 0; r < 255; r++) t[r] = e, n[e] = r, e <<= 1, e & 256 && (e ^= 285);
|
|
574
|
+
for (let e = 255; e < 512; e++) t[e] = t[e - 255];
|
|
575
|
+
})(), e.log = function(e) {
|
|
576
|
+
if (e < 1) throw Error("log(" + e + ")");
|
|
577
|
+
return n[e];
|
|
578
|
+
}, e.exp = function(e) {
|
|
579
|
+
return t[e];
|
|
580
|
+
}, e.mul = function(e, r) {
|
|
581
|
+
return e === 0 || r === 0 ? 0 : t[n[e] + n[r]];
|
|
582
|
+
};
|
|
583
|
+
})), d = /* @__PURE__ */ e(((e) => {
|
|
584
|
+
var t = u();
|
|
585
|
+
e.mul = function(e, n) {
|
|
586
|
+
let r = new Uint8Array(e.length + n.length - 1);
|
|
587
|
+
for (let i = 0; i < e.length; i++) for (let a = 0; a < n.length; a++) r[i + a] ^= t.mul(e[i], n[a]);
|
|
588
|
+
return r;
|
|
589
|
+
}, e.mod = function(e, n) {
|
|
590
|
+
let r = new Uint8Array(e);
|
|
591
|
+
for (; r.length - n.length >= 0;) {
|
|
592
|
+
let e = r[0];
|
|
593
|
+
for (let i = 0; i < n.length; i++) r[i] ^= t.mul(n[i], e);
|
|
594
|
+
let i = 0;
|
|
595
|
+
for (; i < r.length && r[i] === 0;) i++;
|
|
596
|
+
r = r.slice(i);
|
|
597
|
+
}
|
|
598
|
+
return r;
|
|
599
|
+
}, e.generateECPolynomial = function(n) {
|
|
600
|
+
let r = new Uint8Array([1]);
|
|
601
|
+
for (let i = 0; i < n; i++) r = e.mul(r, new Uint8Array([1, t.exp(i)]));
|
|
602
|
+
return r;
|
|
603
|
+
};
|
|
604
|
+
})), f = /* @__PURE__ */ e(((e, t) => {
|
|
605
|
+
var n = d();
|
|
606
|
+
function r(e) {
|
|
607
|
+
this.genPoly = void 0, this.degree = e, this.degree && this.initialize(this.degree);
|
|
608
|
+
}
|
|
609
|
+
r.prototype.initialize = function(e) {
|
|
610
|
+
this.degree = e, this.genPoly = n.generateECPolynomial(this.degree);
|
|
611
|
+
}, r.prototype.encode = function(e) {
|
|
612
|
+
if (!this.genPoly) throw Error("Encoder not initialized");
|
|
613
|
+
let t = new Uint8Array(e.length + this.degree);
|
|
614
|
+
t.set(e);
|
|
615
|
+
let r = n.mod(t, this.genPoly), i = this.degree - r.length;
|
|
616
|
+
if (i > 0) {
|
|
617
|
+
let e = new Uint8Array(this.degree);
|
|
618
|
+
return e.set(r, i), e;
|
|
619
|
+
}
|
|
620
|
+
return r;
|
|
621
|
+
}, t.exports = r;
|
|
622
|
+
})), p = /* @__PURE__ */ e(((e) => {
|
|
623
|
+
e.isValid = function(e) {
|
|
624
|
+
return !isNaN(e) && e >= 1 && e <= 40;
|
|
625
|
+
};
|
|
626
|
+
})), m = /* @__PURE__ */ e(((e) => {
|
|
627
|
+
var t = "[0-9]+", n = "[A-Z $%*+\\-./:]+", r = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
628
|
+
r = r.replace(/u/g, "\\u");
|
|
629
|
+
var i = "(?:(?![A-Z0-9 $%*+\\-./:]|" + r + ")(?:.|[\r\n]))+";
|
|
630
|
+
e.KANJI = new RegExp(r, "g"), e.BYTE_KANJI = /* @__PURE__ */ RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), e.BYTE = new RegExp(i, "g"), e.NUMERIC = new RegExp(t, "g"), e.ALPHANUMERIC = new RegExp(n, "g");
|
|
631
|
+
var a = RegExp("^" + r + "$"), o = RegExp("^" + t + "$"), s = /* @__PURE__ */ RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
632
|
+
e.testKanji = function(e) {
|
|
633
|
+
return a.test(e);
|
|
634
|
+
}, e.testNumeric = function(e) {
|
|
635
|
+
return o.test(e);
|
|
636
|
+
}, e.testAlphanumeric = function(e) {
|
|
637
|
+
return s.test(e);
|
|
638
|
+
};
|
|
639
|
+
})), h = /* @__PURE__ */ e(((e) => {
|
|
640
|
+
var t = p(), n = m();
|
|
641
|
+
e.NUMERIC = {
|
|
642
|
+
id: "Numeric",
|
|
643
|
+
bit: 1,
|
|
644
|
+
ccBits: [
|
|
645
|
+
10,
|
|
646
|
+
12,
|
|
647
|
+
14
|
|
648
|
+
]
|
|
649
|
+
}, e.ALPHANUMERIC = {
|
|
650
|
+
id: "Alphanumeric",
|
|
651
|
+
bit: 2,
|
|
652
|
+
ccBits: [
|
|
653
|
+
9,
|
|
654
|
+
11,
|
|
655
|
+
13
|
|
656
|
+
]
|
|
657
|
+
}, e.BYTE = {
|
|
658
|
+
id: "Byte",
|
|
659
|
+
bit: 4,
|
|
660
|
+
ccBits: [
|
|
661
|
+
8,
|
|
662
|
+
16,
|
|
663
|
+
16
|
|
664
|
+
]
|
|
665
|
+
}, e.KANJI = {
|
|
666
|
+
id: "Kanji",
|
|
667
|
+
bit: 8,
|
|
668
|
+
ccBits: [
|
|
669
|
+
8,
|
|
670
|
+
10,
|
|
671
|
+
12
|
|
672
|
+
]
|
|
673
|
+
}, e.MIXED = { bit: -1 }, e.getCharCountIndicator = function(e, n) {
|
|
674
|
+
if (!e.ccBits) throw Error("Invalid mode: " + e);
|
|
675
|
+
if (!t.isValid(n)) throw Error("Invalid version: " + n);
|
|
676
|
+
return n >= 1 && n < 10 ? e.ccBits[0] : n < 27 ? e.ccBits[1] : e.ccBits[2];
|
|
677
|
+
}, e.getBestModeForData = function(t) {
|
|
678
|
+
return n.testNumeric(t) ? e.NUMERIC : n.testAlphanumeric(t) ? e.ALPHANUMERIC : n.testKanji(t) ? e.KANJI : e.BYTE;
|
|
679
|
+
}, e.toString = function(e) {
|
|
680
|
+
if (e && e.id) return e.id;
|
|
681
|
+
throw Error("Invalid mode");
|
|
682
|
+
}, e.isValid = function(e) {
|
|
683
|
+
return e && e.bit && e.ccBits;
|
|
684
|
+
};
|
|
685
|
+
function r(t) {
|
|
686
|
+
if (typeof t != "string") throw Error("Param is not a string");
|
|
687
|
+
switch (t.toLowerCase()) {
|
|
688
|
+
case "numeric": return e.NUMERIC;
|
|
689
|
+
case "alphanumeric": return e.ALPHANUMERIC;
|
|
690
|
+
case "kanji": return e.KANJI;
|
|
691
|
+
case "byte": return e.BYTE;
|
|
692
|
+
default: throw Error("Unknown mode: " + t);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
e.from = function(t, n) {
|
|
696
|
+
if (e.isValid(t)) return t;
|
|
697
|
+
try {
|
|
698
|
+
return r(t);
|
|
699
|
+
} catch {
|
|
700
|
+
return n;
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
})), g = /* @__PURE__ */ e(((e) => {
|
|
704
|
+
var t = n(), i = l(), a = r(), o = h(), s = p(), c = 7973, u = t.getBCHDigit(c);
|
|
705
|
+
function d(t, n, r) {
|
|
706
|
+
for (let i = 1; i <= 40; i++) if (n <= e.getCapacity(i, r, t)) return i;
|
|
707
|
+
}
|
|
708
|
+
function f(e, t) {
|
|
709
|
+
return o.getCharCountIndicator(e, t) + 4;
|
|
710
|
+
}
|
|
711
|
+
function m(e, t) {
|
|
712
|
+
let n = 0;
|
|
713
|
+
return e.forEach(function(e) {
|
|
714
|
+
let r = f(e.mode, t);
|
|
715
|
+
n += r + e.getBitsLength();
|
|
716
|
+
}), n;
|
|
717
|
+
}
|
|
718
|
+
function g(t, n) {
|
|
719
|
+
for (let r = 1; r <= 40; r++) if (m(t, r) <= e.getCapacity(r, n, o.MIXED)) return r;
|
|
720
|
+
}
|
|
721
|
+
e.from = function(e, t) {
|
|
722
|
+
return s.isValid(e) ? parseInt(e, 10) : t;
|
|
723
|
+
}, e.getCapacity = function(e, n, r) {
|
|
724
|
+
if (!s.isValid(e)) throw Error("Invalid QR Code version");
|
|
725
|
+
r === void 0 && (r = o.BYTE);
|
|
726
|
+
let a = (t.getSymbolTotalCodewords(e) - i.getTotalCodewordsCount(e, n)) * 8;
|
|
727
|
+
if (r === o.MIXED) return a;
|
|
728
|
+
let c = a - f(r, e);
|
|
729
|
+
switch (r) {
|
|
730
|
+
case o.NUMERIC: return Math.floor(c / 10 * 3);
|
|
731
|
+
case o.ALPHANUMERIC: return Math.floor(c / 11 * 2);
|
|
732
|
+
case o.KANJI: return Math.floor(c / 13);
|
|
733
|
+
case o.BYTE:
|
|
734
|
+
default: return Math.floor(c / 8);
|
|
735
|
+
}
|
|
736
|
+
}, e.getBestVersionForData = function(e, t) {
|
|
737
|
+
let n, r = a.from(t, a.M);
|
|
738
|
+
if (Array.isArray(e)) {
|
|
739
|
+
if (e.length > 1) return g(e, r);
|
|
740
|
+
if (e.length === 0) return 1;
|
|
741
|
+
n = e[0];
|
|
742
|
+
} else n = e;
|
|
743
|
+
return d(n.mode, n.getLength(), r);
|
|
744
|
+
}, e.getEncodedBits = function(e) {
|
|
745
|
+
if (!s.isValid(e) || e < 7) throw Error("Invalid QR Code version");
|
|
746
|
+
let n = e << 12;
|
|
747
|
+
for (; t.getBCHDigit(n) - u >= 0;) n ^= c << t.getBCHDigit(n) - u;
|
|
748
|
+
return e << 12 | n;
|
|
749
|
+
};
|
|
750
|
+
})), _ = /* @__PURE__ */ e(((e) => {
|
|
751
|
+
var t = n(), r = 1335, i = 21522, a = t.getBCHDigit(r);
|
|
752
|
+
e.getEncodedBits = function(e, n) {
|
|
753
|
+
let o = e.bit << 3 | n, s = o << 10;
|
|
754
|
+
for (; t.getBCHDigit(s) - a >= 0;) s ^= r << t.getBCHDigit(s) - a;
|
|
755
|
+
return (o << 10 | s) ^ i;
|
|
756
|
+
};
|
|
757
|
+
})), v = /* @__PURE__ */ e(((e, t) => {
|
|
758
|
+
var n = h();
|
|
759
|
+
function r(e) {
|
|
760
|
+
this.mode = n.NUMERIC, this.data = e.toString();
|
|
761
|
+
}
|
|
762
|
+
r.getBitsLength = function(e) {
|
|
763
|
+
return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0);
|
|
764
|
+
}, r.prototype.getLength = function() {
|
|
765
|
+
return this.data.length;
|
|
766
|
+
}, r.prototype.getBitsLength = function() {
|
|
767
|
+
return r.getBitsLength(this.data.length);
|
|
768
|
+
}, r.prototype.write = function(e) {
|
|
769
|
+
let t, n, r;
|
|
770
|
+
for (t = 0; t + 3 <= this.data.length; t += 3) n = this.data.substr(t, 3), r = parseInt(n, 10), e.put(r, 10);
|
|
771
|
+
let i = this.data.length - t;
|
|
772
|
+
i > 0 && (n = this.data.substr(t), r = parseInt(n, 10), e.put(r, i * 3 + 1));
|
|
773
|
+
}, t.exports = r;
|
|
774
|
+
})), y = /* @__PURE__ */ e(((e, t) => {
|
|
775
|
+
var n = h(), r = /* @__PURE__ */ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");
|
|
776
|
+
function i(e) {
|
|
777
|
+
this.mode = n.ALPHANUMERIC, this.data = e;
|
|
778
|
+
}
|
|
779
|
+
i.getBitsLength = function(e) {
|
|
780
|
+
return 11 * Math.floor(e / 2) + e % 2 * 6;
|
|
781
|
+
}, i.prototype.getLength = function() {
|
|
782
|
+
return this.data.length;
|
|
783
|
+
}, i.prototype.getBitsLength = function() {
|
|
784
|
+
return i.getBitsLength(this.data.length);
|
|
785
|
+
}, i.prototype.write = function(e) {
|
|
786
|
+
let t;
|
|
787
|
+
for (t = 0; t + 2 <= this.data.length; t += 2) {
|
|
788
|
+
let n = r.indexOf(this.data[t]) * 45;
|
|
789
|
+
n += r.indexOf(this.data[t + 1]), e.put(n, 11);
|
|
790
|
+
}
|
|
791
|
+
this.data.length % 2 && e.put(r.indexOf(this.data[t]), 6);
|
|
792
|
+
}, t.exports = i;
|
|
793
|
+
})), b = /* @__PURE__ */ e(((e, t) => {
|
|
794
|
+
var n = h();
|
|
795
|
+
function r(e) {
|
|
796
|
+
this.mode = n.BYTE, typeof e == "string" ? this.data = new TextEncoder().encode(e) : this.data = new Uint8Array(e);
|
|
797
|
+
}
|
|
798
|
+
r.getBitsLength = function(e) {
|
|
799
|
+
return e * 8;
|
|
800
|
+
}, r.prototype.getLength = function() {
|
|
801
|
+
return this.data.length;
|
|
802
|
+
}, r.prototype.getBitsLength = function() {
|
|
803
|
+
return r.getBitsLength(this.data.length);
|
|
804
|
+
}, r.prototype.write = function(e) {
|
|
805
|
+
for (let t = 0, n = this.data.length; t < n; t++) e.put(this.data[t], 8);
|
|
806
|
+
}, t.exports = r;
|
|
807
|
+
})), x = /* @__PURE__ */ e(((e, t) => {
|
|
808
|
+
var r = h(), i = n();
|
|
809
|
+
function a(e) {
|
|
810
|
+
this.mode = r.KANJI, this.data = e;
|
|
811
|
+
}
|
|
812
|
+
a.getBitsLength = function(e) {
|
|
813
|
+
return e * 13;
|
|
814
|
+
}, a.prototype.getLength = function() {
|
|
815
|
+
return this.data.length;
|
|
816
|
+
}, a.prototype.getBitsLength = function() {
|
|
817
|
+
return a.getBitsLength(this.data.length);
|
|
818
|
+
}, a.prototype.write = function(e) {
|
|
819
|
+
let t;
|
|
820
|
+
for (t = 0; t < this.data.length; t++) {
|
|
821
|
+
let n = i.toSJIS(this.data[t]);
|
|
822
|
+
if (n >= 33088 && n <= 40956) n -= 33088;
|
|
823
|
+
else if (n >= 57408 && n <= 60351) n -= 49472;
|
|
824
|
+
else throw Error("Invalid SJIS character: " + this.data[t] + "\nMake sure your charset is UTF-8");
|
|
825
|
+
n = (n >>> 8 & 255) * 192 + (n & 255), e.put(n, 13);
|
|
826
|
+
}
|
|
827
|
+
}, t.exports = a;
|
|
828
|
+
})), S = /* @__PURE__ */ e(((e, t) => {
|
|
829
|
+
var n = {
|
|
830
|
+
single_source_shortest_paths: function(e, t, r) {
|
|
831
|
+
var i = {}, a = {};
|
|
832
|
+
a[t] = 0;
|
|
833
|
+
var o = n.PriorityQueue.make();
|
|
834
|
+
o.push(t, 0);
|
|
835
|
+
for (var s, c, l, u, d, f, p, m, h; !o.empty();) for (l in s = o.pop(), c = s.value, u = s.cost, d = e[c] || {}, d) d.hasOwnProperty(l) && (f = d[l], p = u + f, m = a[l], h = a[l] === void 0, (h || m > p) && (a[l] = p, o.push(l, p), i[l] = c));
|
|
836
|
+
if (r !== void 0 && a[r] === void 0) {
|
|
837
|
+
var g = [
|
|
838
|
+
"Could not find a path from ",
|
|
839
|
+
t,
|
|
840
|
+
" to ",
|
|
841
|
+
r,
|
|
842
|
+
"."
|
|
843
|
+
].join("");
|
|
844
|
+
throw Error(g);
|
|
845
|
+
}
|
|
846
|
+
return i;
|
|
847
|
+
},
|
|
848
|
+
extract_shortest_path_from_predecessor_list: function(e, t) {
|
|
849
|
+
for (var n = [], r = t; r;) n.push(r), e[r], r = e[r];
|
|
850
|
+
return n.reverse(), n;
|
|
851
|
+
},
|
|
852
|
+
find_path: function(e, t, r) {
|
|
853
|
+
var i = n.single_source_shortest_paths(e, t, r);
|
|
854
|
+
return n.extract_shortest_path_from_predecessor_list(i, r);
|
|
855
|
+
},
|
|
856
|
+
PriorityQueue: {
|
|
857
|
+
make: function(e) {
|
|
858
|
+
var t = n.PriorityQueue, r = {}, i;
|
|
859
|
+
for (i in e ||= {}, t) t.hasOwnProperty(i) && (r[i] = t[i]);
|
|
860
|
+
return r.queue = [], r.sorter = e.sorter || t.default_sorter, r;
|
|
861
|
+
},
|
|
862
|
+
default_sorter: function(e, t) {
|
|
863
|
+
return e.cost - t.cost;
|
|
864
|
+
},
|
|
865
|
+
push: function(e, t) {
|
|
866
|
+
var n = {
|
|
867
|
+
value: e,
|
|
868
|
+
cost: t
|
|
869
|
+
};
|
|
870
|
+
this.queue.push(n), this.queue.sort(this.sorter);
|
|
871
|
+
},
|
|
872
|
+
pop: function() {
|
|
873
|
+
return this.queue.shift();
|
|
874
|
+
},
|
|
875
|
+
empty: function() {
|
|
876
|
+
return this.queue.length === 0;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
t !== void 0 && (t.exports = n);
|
|
881
|
+
})), C = /* @__PURE__ */ e(((e) => {
|
|
882
|
+
var t = h(), r = v(), i = y(), a = b(), o = x(), s = m(), c = n(), l = S();
|
|
883
|
+
function u(e) {
|
|
884
|
+
return unescape(encodeURIComponent(e)).length;
|
|
885
|
+
}
|
|
886
|
+
function d(e, t, n) {
|
|
887
|
+
let r = [], i;
|
|
888
|
+
for (; (i = e.exec(n)) !== null;) r.push({
|
|
889
|
+
data: i[0],
|
|
890
|
+
index: i.index,
|
|
891
|
+
mode: t,
|
|
892
|
+
length: i[0].length
|
|
893
|
+
});
|
|
894
|
+
return r;
|
|
895
|
+
}
|
|
896
|
+
function f(e) {
|
|
897
|
+
let n = d(s.NUMERIC, t.NUMERIC, e), r = d(s.ALPHANUMERIC, t.ALPHANUMERIC, e), i, a;
|
|
898
|
+
return c.isKanjiModeEnabled() ? (i = d(s.BYTE, t.BYTE, e), a = d(s.KANJI, t.KANJI, e)) : (i = d(s.BYTE_KANJI, t.BYTE, e), a = []), n.concat(r, i, a).sort(function(e, t) {
|
|
899
|
+
return e.index - t.index;
|
|
900
|
+
}).map(function(e) {
|
|
901
|
+
return {
|
|
902
|
+
data: e.data,
|
|
903
|
+
mode: e.mode,
|
|
904
|
+
length: e.length
|
|
905
|
+
};
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
function p(e, n) {
|
|
909
|
+
switch (n) {
|
|
910
|
+
case t.NUMERIC: return r.getBitsLength(e);
|
|
911
|
+
case t.ALPHANUMERIC: return i.getBitsLength(e);
|
|
912
|
+
case t.KANJI: return o.getBitsLength(e);
|
|
913
|
+
case t.BYTE: return a.getBitsLength(e);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
function g(e) {
|
|
917
|
+
return e.reduce(function(e, t) {
|
|
918
|
+
let n = e.length - 1 >= 0 ? e[e.length - 1] : null;
|
|
919
|
+
return n && n.mode === t.mode ? (e[e.length - 1].data += t.data, e) : (e.push(t), e);
|
|
920
|
+
}, []);
|
|
921
|
+
}
|
|
922
|
+
function _(e) {
|
|
923
|
+
let n = [];
|
|
924
|
+
for (let r = 0; r < e.length; r++) {
|
|
925
|
+
let i = e[r];
|
|
926
|
+
switch (i.mode) {
|
|
927
|
+
case t.NUMERIC:
|
|
928
|
+
n.push([
|
|
929
|
+
i,
|
|
930
|
+
{
|
|
931
|
+
data: i.data,
|
|
932
|
+
mode: t.ALPHANUMERIC,
|
|
933
|
+
length: i.length
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
data: i.data,
|
|
937
|
+
mode: t.BYTE,
|
|
938
|
+
length: i.length
|
|
939
|
+
}
|
|
940
|
+
]);
|
|
941
|
+
break;
|
|
942
|
+
case t.ALPHANUMERIC:
|
|
943
|
+
n.push([i, {
|
|
944
|
+
data: i.data,
|
|
945
|
+
mode: t.BYTE,
|
|
946
|
+
length: i.length
|
|
947
|
+
}]);
|
|
948
|
+
break;
|
|
949
|
+
case t.KANJI:
|
|
950
|
+
n.push([i, {
|
|
951
|
+
data: i.data,
|
|
952
|
+
mode: t.BYTE,
|
|
953
|
+
length: u(i.data)
|
|
954
|
+
}]);
|
|
955
|
+
break;
|
|
956
|
+
case t.BYTE: n.push([{
|
|
957
|
+
data: i.data,
|
|
958
|
+
mode: t.BYTE,
|
|
959
|
+
length: u(i.data)
|
|
960
|
+
}]);
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
return n;
|
|
964
|
+
}
|
|
965
|
+
function C(e, n) {
|
|
966
|
+
let r = {}, i = { start: {} }, a = ["start"];
|
|
967
|
+
for (let o = 0; o < e.length; o++) {
|
|
968
|
+
let s = e[o], c = [];
|
|
969
|
+
for (let e = 0; e < s.length; e++) {
|
|
970
|
+
let l = s[e], u = "" + o + e;
|
|
971
|
+
c.push(u), r[u] = {
|
|
972
|
+
node: l,
|
|
973
|
+
lastCount: 0
|
|
974
|
+
}, i[u] = {};
|
|
975
|
+
for (let e = 0; e < a.length; e++) {
|
|
976
|
+
let o = a[e];
|
|
977
|
+
r[o] && r[o].node.mode === l.mode ? (i[o][u] = p(r[o].lastCount + l.length, l.mode) - p(r[o].lastCount, l.mode), r[o].lastCount += l.length) : (r[o] && (r[o].lastCount = l.length), i[o][u] = p(l.length, l.mode) + 4 + t.getCharCountIndicator(l.mode, n));
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
a = c;
|
|
981
|
+
}
|
|
982
|
+
for (let e = 0; e < a.length; e++) i[a[e]].end = 0;
|
|
983
|
+
return {
|
|
984
|
+
map: i,
|
|
985
|
+
table: r
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
function w(e, n) {
|
|
989
|
+
let s, l = t.getBestModeForData(e);
|
|
990
|
+
if (s = t.from(n, l), s !== t.BYTE && s.bit < l.bit) throw Error("\"" + e + "\" cannot be encoded with mode " + t.toString(s) + ".\n Suggested mode is: " + t.toString(l));
|
|
991
|
+
switch (s === t.KANJI && !c.isKanjiModeEnabled() && (s = t.BYTE), s) {
|
|
992
|
+
case t.NUMERIC: return new r(e);
|
|
993
|
+
case t.ALPHANUMERIC: return new i(e);
|
|
994
|
+
case t.KANJI: return new o(e);
|
|
995
|
+
case t.BYTE: return new a(e);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
e.fromArray = function(e) {
|
|
999
|
+
return e.reduce(function(e, t) {
|
|
1000
|
+
return typeof t == "string" ? e.push(w(t, null)) : t.data && e.push(w(t.data, t.mode)), e;
|
|
1001
|
+
}, []);
|
|
1002
|
+
}, e.fromString = function(t, n) {
|
|
1003
|
+
let r = C(_(f(t, c.isKanjiModeEnabled())), n), i = l.find_path(r.map, "start", "end"), a = [];
|
|
1004
|
+
for (let e = 1; e < i.length - 1; e++) a.push(r.table[i[e]].node);
|
|
1005
|
+
return e.fromArray(g(a));
|
|
1006
|
+
}, e.rawSplit = function(t) {
|
|
1007
|
+
return e.fromArray(f(t, c.isKanjiModeEnabled()));
|
|
1008
|
+
};
|
|
1009
|
+
})), w = /* @__PURE__ */ e(((e) => {
|
|
1010
|
+
var t = n(), u = r(), d = i(), p = a(), m = o(), v = s(), y = c(), b = l(), x = f(), S = g(), w = _(), T = h(), E = C();
|
|
1011
|
+
function D(e, t) {
|
|
1012
|
+
let n = e.size, r = v.getPositions(t);
|
|
1013
|
+
for (let t = 0; t < r.length; t++) {
|
|
1014
|
+
let i = r[t][0], a = r[t][1];
|
|
1015
|
+
for (let t = -1; t <= 7; t++) if (!(i + t <= -1 || n <= i + t)) for (let r = -1; r <= 7; r++) a + r <= -1 || n <= a + r || (t >= 0 && t <= 6 && (r === 0 || r === 6) || r >= 0 && r <= 6 && (t === 0 || t === 6) || t >= 2 && t <= 4 && r >= 2 && r <= 4 ? e.set(i + t, a + r, !0, !0) : e.set(i + t, a + r, !1, !0));
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
function O(e) {
|
|
1019
|
+
let t = e.size;
|
|
1020
|
+
for (let n = 8; n < t - 8; n++) {
|
|
1021
|
+
let t = n % 2 == 0;
|
|
1022
|
+
e.set(n, 6, t, !0), e.set(6, n, t, !0);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
function k(e, t) {
|
|
1026
|
+
let n = m.getPositions(t);
|
|
1027
|
+
for (let t = 0; t < n.length; t++) {
|
|
1028
|
+
let r = n[t][0], i = n[t][1];
|
|
1029
|
+
for (let t = -2; t <= 2; t++) for (let n = -2; n <= 2; n++) t === -2 || t === 2 || n === -2 || n === 2 || t === 0 && n === 0 ? e.set(r + t, i + n, !0, !0) : e.set(r + t, i + n, !1, !0);
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
function A(e, t) {
|
|
1033
|
+
let n = e.size, r = S.getEncodedBits(t), i, a, o;
|
|
1034
|
+
for (let t = 0; t < 18; t++) i = Math.floor(t / 3), a = t % 3 + n - 8 - 3, o = (r >> t & 1) == 1, e.set(i, a, o, !0), e.set(a, i, o, !0);
|
|
1035
|
+
}
|
|
1036
|
+
function j(e, t, n) {
|
|
1037
|
+
let r = e.size, i = w.getEncodedBits(t, n), a, o;
|
|
1038
|
+
for (a = 0; a < 15; a++) o = (i >> a & 1) == 1, a < 6 ? e.set(a, 8, o, !0) : a < 8 ? e.set(a + 1, 8, o, !0) : e.set(r - 15 + a, 8, o, !0), a < 8 ? e.set(8, r - a - 1, o, !0) : a < 9 ? e.set(8, 15 - a - 1 + 1, o, !0) : e.set(8, 15 - a - 1, o, !0);
|
|
1039
|
+
e.set(r - 8, 8, 1, !0);
|
|
1040
|
+
}
|
|
1041
|
+
function M(e, t) {
|
|
1042
|
+
let n = e.size, r = -1, i = n - 1, a = 7, o = 0;
|
|
1043
|
+
for (let s = n - 1; s > 0; s -= 2) for (s === 6 && s--;;) {
|
|
1044
|
+
for (let n = 0; n < 2; n++) if (!e.isReserved(i, s - n)) {
|
|
1045
|
+
let r = !1;
|
|
1046
|
+
o < t.length && (r = (t[o] >>> a & 1) == 1), e.set(i, s - n, r), a--, a === -1 && (o++, a = 7);
|
|
1047
|
+
}
|
|
1048
|
+
if (i += r, i < 0 || n <= i) {
|
|
1049
|
+
i -= r, r = -r;
|
|
1050
|
+
break;
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
function N(e, n, r) {
|
|
1055
|
+
let i = new d();
|
|
1056
|
+
r.forEach(function(t) {
|
|
1057
|
+
i.put(t.mode.bit, 4), i.put(t.getLength(), T.getCharCountIndicator(t.mode, e)), t.write(i);
|
|
1058
|
+
});
|
|
1059
|
+
let a = (t.getSymbolTotalCodewords(e) - b.getTotalCodewordsCount(e, n)) * 8;
|
|
1060
|
+
for (i.getLengthInBits() + 4 <= a && i.put(0, 4); i.getLengthInBits() % 8 != 0;) i.putBit(0);
|
|
1061
|
+
let o = (a - i.getLengthInBits()) / 8;
|
|
1062
|
+
for (let e = 0; e < o; e++) i.put(e % 2 ? 17 : 236, 8);
|
|
1063
|
+
return P(i, e, n);
|
|
1064
|
+
}
|
|
1065
|
+
function P(e, n, r) {
|
|
1066
|
+
let i = t.getSymbolTotalCodewords(n), a = i - b.getTotalCodewordsCount(n, r), o = b.getBlocksCount(n, r), s = o - i % o, c = Math.floor(i / o), l = Math.floor(a / o), u = l + 1, d = c - l, f = new x(d), p = 0, m = Array(o), h = Array(o), g = 0, _ = new Uint8Array(e.buffer);
|
|
1067
|
+
for (let e = 0; e < o; e++) {
|
|
1068
|
+
let t = e < s ? l : u;
|
|
1069
|
+
m[e] = _.slice(p, p + t), h[e] = f.encode(m[e]), p += t, g = Math.max(g, t);
|
|
1070
|
+
}
|
|
1071
|
+
let v = new Uint8Array(i), y = 0, S, C;
|
|
1072
|
+
for (S = 0; S < g; S++) for (C = 0; C < o; C++) S < m[C].length && (v[y++] = m[C][S]);
|
|
1073
|
+
for (S = 0; S < d; S++) for (C = 0; C < o; C++) v[y++] = h[C][S];
|
|
1074
|
+
return v;
|
|
1075
|
+
}
|
|
1076
|
+
function F(e, n, r, i) {
|
|
1077
|
+
let a;
|
|
1078
|
+
if (Array.isArray(e)) a = E.fromArray(e);
|
|
1079
|
+
else if (typeof e == "string") {
|
|
1080
|
+
let t = n;
|
|
1081
|
+
if (!t) {
|
|
1082
|
+
let n = E.rawSplit(e);
|
|
1083
|
+
t = S.getBestVersionForData(n, r);
|
|
1084
|
+
}
|
|
1085
|
+
a = E.fromString(e, t || 40);
|
|
1086
|
+
} else throw Error("Invalid data");
|
|
1087
|
+
let o = S.getBestVersionForData(a, r);
|
|
1088
|
+
if (!o) throw Error("The amount of data is too big to be stored in a QR Code");
|
|
1089
|
+
if (!n) n = o;
|
|
1090
|
+
else if (n < o) throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + o + ".\n");
|
|
1091
|
+
let s = N(n, r, a), c = new p(t.getSymbolSize(n));
|
|
1092
|
+
return D(c, n), O(c), k(c, n), j(c, r, 0), n >= 7 && A(c, n), M(c, s), isNaN(i) && (i = y.getBestMask(c, j.bind(null, c, r))), y.applyMask(i, c), j(c, r, i), {
|
|
1093
|
+
modules: c,
|
|
1094
|
+
version: n,
|
|
1095
|
+
errorCorrectionLevel: r,
|
|
1096
|
+
maskPattern: i,
|
|
1097
|
+
segments: a
|
|
1098
|
+
};
|
|
1099
|
+
}
|
|
1100
|
+
e.create = function(e, n) {
|
|
1101
|
+
if (e === void 0 || e === "") throw Error("No input text");
|
|
1102
|
+
let r = u.M, i, a;
|
|
1103
|
+
return n !== void 0 && (r = u.from(n.errorCorrectionLevel, u.M), i = S.from(n.version), a = y.from(n.maskPattern), n.toSJISFunc && t.setToSJISFunction(n.toSJISFunc)), F(e, i, r, a);
|
|
1104
|
+
};
|
|
1105
|
+
})), T = /* @__PURE__ */ e(((e) => {
|
|
1106
|
+
function t(e) {
|
|
1107
|
+
if (typeof e == "number" && (e = e.toString()), typeof e != "string") throw Error("Color should be defined as hex string");
|
|
1108
|
+
let t = e.slice().replace("#", "").split("");
|
|
1109
|
+
if (t.length < 3 || t.length === 5 || t.length > 8) throw Error("Invalid hex color: " + e);
|
|
1110
|
+
(t.length === 3 || t.length === 4) && (t = Array.prototype.concat.apply([], t.map(function(e) {
|
|
1111
|
+
return [e, e];
|
|
1112
|
+
}))), t.length === 6 && t.push("F", "F");
|
|
1113
|
+
let n = parseInt(t.join(""), 16);
|
|
1114
|
+
return {
|
|
1115
|
+
r: n >> 24 & 255,
|
|
1116
|
+
g: n >> 16 & 255,
|
|
1117
|
+
b: n >> 8 & 255,
|
|
1118
|
+
a: n & 255,
|
|
1119
|
+
hex: "#" + t.slice(0, 6).join("")
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
e.getOptions = function(e) {
|
|
1123
|
+
e ||= {}, e.color ||= {};
|
|
1124
|
+
let n = e.margin === void 0 || e.margin === null || e.margin < 0 ? 4 : e.margin, r = e.width && e.width >= 21 ? e.width : void 0, i = e.scale || 4;
|
|
1125
|
+
return {
|
|
1126
|
+
width: r,
|
|
1127
|
+
scale: r ? 4 : i,
|
|
1128
|
+
margin: n,
|
|
1129
|
+
color: {
|
|
1130
|
+
dark: t(e.color.dark || "#000000ff"),
|
|
1131
|
+
light: t(e.color.light || "#ffffffff")
|
|
1132
|
+
},
|
|
1133
|
+
type: e.type,
|
|
1134
|
+
rendererOpts: e.rendererOpts || {}
|
|
1135
|
+
};
|
|
1136
|
+
}, e.getScale = function(e, t) {
|
|
1137
|
+
return t.width && t.width >= e + t.margin * 2 ? t.width / (e + t.margin * 2) : t.scale;
|
|
1138
|
+
}, e.getImageWidth = function(t, n) {
|
|
1139
|
+
let r = e.getScale(t, n);
|
|
1140
|
+
return Math.floor((t + n.margin * 2) * r);
|
|
1141
|
+
}, e.qrToImageData = function(t, n, r) {
|
|
1142
|
+
let i = n.modules.size, a = n.modules.data, o = e.getScale(i, r), s = Math.floor((i + r.margin * 2) * o), c = r.margin * o, l = [r.color.light, r.color.dark];
|
|
1143
|
+
for (let e = 0; e < s; e++) for (let n = 0; n < s; n++) {
|
|
1144
|
+
let u = (e * s + n) * 4, d = r.color.light;
|
|
1145
|
+
if (e >= c && n >= c && e < s - c && n < s - c) {
|
|
1146
|
+
let t = Math.floor((e - c) / o), r = Math.floor((n - c) / o);
|
|
1147
|
+
d = l[+!!a[t * i + r]];
|
|
1148
|
+
}
|
|
1149
|
+
t[u++] = d.r, t[u++] = d.g, t[u++] = d.b, t[u] = d.a;
|
|
1150
|
+
}
|
|
1151
|
+
};
|
|
1152
|
+
})), E = /* @__PURE__ */ e(((e) => {
|
|
1153
|
+
var t = T();
|
|
1154
|
+
function n(e, t, n) {
|
|
1155
|
+
e.clearRect(0, 0, t.width, t.height), t.style ||= {}, t.height = n, t.width = n, t.style.height = n + "px", t.style.width = n + "px";
|
|
1156
|
+
}
|
|
1157
|
+
function r() {
|
|
1158
|
+
try {
|
|
1159
|
+
return document.createElement("canvas");
|
|
1160
|
+
} catch {
|
|
1161
|
+
throw Error("You need to specify a canvas element");
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
e.render = function(e, i, a) {
|
|
1165
|
+
let o = a, s = i;
|
|
1166
|
+
o === void 0 && (!i || !i.getContext) && (o = i, i = void 0), i || (s = r()), o = t.getOptions(o);
|
|
1167
|
+
let c = t.getImageWidth(e.modules.size, o), l = s.getContext("2d"), u = l.createImageData(c, c);
|
|
1168
|
+
return t.qrToImageData(u.data, e, o), n(l, s, c), l.putImageData(u, 0, 0), s;
|
|
1169
|
+
}, e.renderToDataURL = function(t, n, r) {
|
|
1170
|
+
let i = r;
|
|
1171
|
+
i === void 0 && (!n || !n.getContext) && (i = n, n = void 0), i ||= {};
|
|
1172
|
+
let a = e.render(t, n, i), o = i.type || "image/png", s = i.rendererOpts || {};
|
|
1173
|
+
return a.toDataURL(o, s.quality);
|
|
1174
|
+
};
|
|
1175
|
+
})), D = /* @__PURE__ */ e(((e) => {
|
|
1176
|
+
var t = T();
|
|
1177
|
+
function n(e, t) {
|
|
1178
|
+
let n = e.a / 255, r = t + "=\"" + e.hex + "\"";
|
|
1179
|
+
return n < 1 ? r + " " + t + "-opacity=\"" + n.toFixed(2).slice(1) + "\"" : r;
|
|
1180
|
+
}
|
|
1181
|
+
function r(e, t, n) {
|
|
1182
|
+
let r = e + t;
|
|
1183
|
+
return n !== void 0 && (r += " " + n), r;
|
|
1184
|
+
}
|
|
1185
|
+
function i(e, t, n) {
|
|
1186
|
+
let i = "", a = 0, o = !1, s = 0;
|
|
1187
|
+
for (let c = 0; c < e.length; c++) {
|
|
1188
|
+
let l = Math.floor(c % t), u = Math.floor(c / t);
|
|
1189
|
+
!l && !o && (o = !0), e[c] ? (s++, c > 0 && l > 0 && e[c - 1] || (i += o ? r("M", l + n, .5 + u + n) : r("m", a, 0), a = 0, o = !1), l + 1 < t && e[c + 1] || (i += r("h", s), s = 0)) : a++;
|
|
1190
|
+
}
|
|
1191
|
+
return i;
|
|
1192
|
+
}
|
|
1193
|
+
e.render = function(e, r, a) {
|
|
1194
|
+
let o = t.getOptions(r), s = e.modules.size, c = e.modules.data, l = s + o.margin * 2, u = o.color.light.a ? "<path " + n(o.color.light, "fill") + " d=\"M0 0h" + l + "v" + l + "H0z\"/>" : "", d = "<path " + n(o.color.dark, "stroke") + " d=\"" + i(c, s, o.margin) + "\"/>", f = "viewBox=\"0 0 " + l + " " + l + "\"", p = "<svg xmlns=\"http://www.w3.org/2000/svg\" " + (o.width ? "width=\"" + o.width + "\" height=\"" + o.width + "\" " : "") + f + " shape-rendering=\"crispEdges\">" + u + d + "</svg>\n";
|
|
1195
|
+
return typeof a == "function" && a(null, p), p;
|
|
1196
|
+
};
|
|
1197
|
+
})), O = /* @__PURE__ */ e(((e) => {
|
|
1198
|
+
var n = t(), r = w(), i = E(), a = D();
|
|
1199
|
+
function o(e, t, i, a, o) {
|
|
1200
|
+
let s = [].slice.call(arguments, 1), c = s.length, l = typeof s[c - 1] == "function";
|
|
1201
|
+
if (!l && !n()) throw Error("Callback required as last argument");
|
|
1202
|
+
if (l) {
|
|
1203
|
+
if (c < 2) throw Error("Too few arguments provided");
|
|
1204
|
+
c === 2 ? (o = i, i = t, t = a = void 0) : c === 3 && (t.getContext && o === void 0 ? (o = a, a = void 0) : (o = a, a = i, i = t, t = void 0));
|
|
1205
|
+
} else {
|
|
1206
|
+
if (c < 1) throw Error("Too few arguments provided");
|
|
1207
|
+
return c === 1 ? (i = t, t = a = void 0) : c === 2 && !t.getContext && (a = i, i = t, t = void 0), new Promise(function(n, o) {
|
|
1208
|
+
try {
|
|
1209
|
+
n(e(r.create(i, a), t, a));
|
|
1210
|
+
} catch (e) {
|
|
1211
|
+
o(e);
|
|
1212
|
+
}
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
try {
|
|
1216
|
+
let n = r.create(i, a);
|
|
1217
|
+
o(null, e(n, t, a));
|
|
1218
|
+
} catch (e) {
|
|
1219
|
+
o(e);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
e.create = r.create, e.toCanvas = o.bind(null, i.render), e.toDataURL = o.bind(null, i.renderToDataURL), e.toString = o.bind(null, function(e, t, n) {
|
|
1223
|
+
return a.render(e, n);
|
|
1224
|
+
});
|
|
1225
|
+
}));
|
|
1226
|
+
//#endregion
|
|
1227
|
+
export default O();
|