ex4nicegui 0.8.4__py3-none-any.whl → 0.8.5__py3-none-any.whl
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.
- ex4nicegui/reactive/EChartsComponent/events.py +11 -10
- ex4nicegui/reactive/EChartsComponent/utils.py +2 -14
- ex4nicegui/reactive/__init__.py +6 -1
- ex4nicegui/reactive/officials/input.py +23 -0
- ex4nicegui/reactive/officials/radio.py +13 -2
- ex4nicegui/reactive/officials/range.py +42 -0
- ex4nicegui/reactive/officials/select.py +1 -3
- ex4nicegui/reactive/officials/spinner.py +43 -0
- ex4nicegui/reactive/officials/toggle.py +5 -3
- ex4nicegui/reactive/officials/tree.py +86 -0
- ex4nicegui/reactive/systems/reactive_system.py +13 -2
- ex4nicegui/toolbox/__init__.py +5 -0
- ex4nicegui/toolbox/core/VueUse.js +2031 -0
- ex4nicegui/toolbox/core/vue_use.py +32 -0
- ex4nicegui/toolbox/functions/breakpoint.py +114 -0
- ex4nicegui/toolbox/functions/dark.py +97 -0
- ex4nicegui/toolbox/functions/qr_code.py +83 -0
- {ex4nicegui-0.8.4.dist-info → ex4nicegui-0.8.5.dist-info}/METADATA +88 -1
- {ex4nicegui-0.8.4.dist-info → ex4nicegui-0.8.5.dist-info}/RECORD +21 -13
- {ex4nicegui-0.8.4.dist-info → ex4nicegui-0.8.5.dist-info}/LICENSE +0 -0
- {ex4nicegui-0.8.4.dist-info → ex4nicegui-0.8.5.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,2031 @@
|
|
|
1
|
+
var ne = Object.defineProperty;
|
|
2
|
+
var re = (t, e, r) => e in t ? ne(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var Bt = (t, e, r) => (re(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
const oe = Vue.isRef;
|
|
5
|
+
const L = Vue.ref;
|
|
6
|
+
const ie = Vue.getCurrentScope;
|
|
7
|
+
const se = Vue.onScopeDispose;
|
|
8
|
+
const ue = Vue.unref;
|
|
9
|
+
const It = Vue.toRef;
|
|
10
|
+
const ht = Vue.readonly;
|
|
11
|
+
const Rt = Vue.customRef;
|
|
12
|
+
const Pt = Vue.onMounted;
|
|
13
|
+
const gt = Vue.nextTick;
|
|
14
|
+
const Lt = Vue.getCurrentInstance;
|
|
15
|
+
const k = Vue.watch;
|
|
16
|
+
const _ = Vue.computed;
|
|
17
|
+
const ae = Vue.watchEffect;
|
|
18
|
+
const ce = Vue.shallowRef;
|
|
19
|
+
const le = Vue.defineComponent;
|
|
20
|
+
|
|
21
|
+
function Dt(t) {
|
|
22
|
+
return ie() ? (se(t), !0) : !1;
|
|
23
|
+
}
|
|
24
|
+
function U(t) {
|
|
25
|
+
return typeof t == "function" ? t() : ue(t);
|
|
26
|
+
}
|
|
27
|
+
const fe = typeof window < "u" && typeof document < "u";
|
|
28
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
29
|
+
const de = Object.prototype.toString, he = (t) => de.call(t) === "[object Object]", _t = () => {
|
|
30
|
+
};
|
|
31
|
+
function ge(t, e) {
|
|
32
|
+
function r(...o) {
|
|
33
|
+
return new Promise((n, i) => {
|
|
34
|
+
Promise.resolve(t(() => e.apply(this, o), { fn: e, thisArg: this, args: o })).then(n).catch(i);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return r;
|
|
38
|
+
}
|
|
39
|
+
const kt = (t) => t();
|
|
40
|
+
function me(t = kt) {
|
|
41
|
+
const e = L(!0);
|
|
42
|
+
function r() {
|
|
43
|
+
e.value = !1;
|
|
44
|
+
}
|
|
45
|
+
function o() {
|
|
46
|
+
e.value = !0;
|
|
47
|
+
}
|
|
48
|
+
const n = (...i) => {
|
|
49
|
+
e.value && t(...i);
|
|
50
|
+
};
|
|
51
|
+
return { isActive: ht(e), pause: r, resume: o, eventFilter: n };
|
|
52
|
+
}
|
|
53
|
+
function we(t, e) {
|
|
54
|
+
var r;
|
|
55
|
+
if (typeof t == "number")
|
|
56
|
+
return t + e;
|
|
57
|
+
const o = ((r = t.match(/^-?\d+\.?\d*/)) == null ? void 0 : r[0]) || "", n = t.slice(o.length), i = Number.parseFloat(o) + e;
|
|
58
|
+
return Number.isNaN(i) ? t : i + n;
|
|
59
|
+
}
|
|
60
|
+
function pe(t) {
|
|
61
|
+
return t || Lt();
|
|
62
|
+
}
|
|
63
|
+
function ye(...t) {
|
|
64
|
+
if (t.length !== 1)
|
|
65
|
+
return It(...t);
|
|
66
|
+
const e = t[0];
|
|
67
|
+
return typeof e == "function" ? ht(Rt(() => ({ get: e, set: _t }))) : L(e);
|
|
68
|
+
}
|
|
69
|
+
function Ce(t, e, r = {}) {
|
|
70
|
+
const {
|
|
71
|
+
eventFilter: o = kt,
|
|
72
|
+
...n
|
|
73
|
+
} = r;
|
|
74
|
+
return k(
|
|
75
|
+
t,
|
|
76
|
+
ge(
|
|
77
|
+
o,
|
|
78
|
+
e
|
|
79
|
+
),
|
|
80
|
+
n
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
function Ee(t, e, r = {}) {
|
|
84
|
+
const {
|
|
85
|
+
eventFilter: o,
|
|
86
|
+
...n
|
|
87
|
+
} = r, { eventFilter: i, pause: s, resume: u, isActive: a } = me(o);
|
|
88
|
+
return { stop: Ce(
|
|
89
|
+
t,
|
|
90
|
+
e,
|
|
91
|
+
{
|
|
92
|
+
...n,
|
|
93
|
+
eventFilter: i
|
|
94
|
+
}
|
|
95
|
+
), pause: s, resume: u, isActive: a };
|
|
96
|
+
}
|
|
97
|
+
function Ut(t, e = !0, r) {
|
|
98
|
+
pe() ? Pt(t, r) : e ? t() : gt(t);
|
|
99
|
+
}
|
|
100
|
+
function be(t = !1, e = {}) {
|
|
101
|
+
const {
|
|
102
|
+
truthyValue: r = !0,
|
|
103
|
+
falsyValue: o = !1
|
|
104
|
+
} = e, n = oe(t), i = L(t);
|
|
105
|
+
function s(u) {
|
|
106
|
+
if (arguments.length)
|
|
107
|
+
return i.value = u, i.value;
|
|
108
|
+
{
|
|
109
|
+
const a = U(r);
|
|
110
|
+
return i.value = i.value === a ? U(o) : a, i.value;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return n ? s : [i, s];
|
|
114
|
+
}
|
|
115
|
+
function Ft(t) {
|
|
116
|
+
var e;
|
|
117
|
+
const r = U(t);
|
|
118
|
+
return (e = r == null ? void 0 : r.$el) != null ? e : r;
|
|
119
|
+
}
|
|
120
|
+
const O = fe ? window : void 0;
|
|
121
|
+
function Mt(...t) {
|
|
122
|
+
let e, r, o, n;
|
|
123
|
+
if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([r, o, n] = t, e = O) : [e, r, o, n] = t, !e)
|
|
124
|
+
return _t;
|
|
125
|
+
Array.isArray(r) || (r = [r]), Array.isArray(o) || (o = [o]);
|
|
126
|
+
const i = [], s = () => {
|
|
127
|
+
i.forEach((c) => c()), i.length = 0;
|
|
128
|
+
}, u = (c, h, g, d) => (c.addEventListener(h, g, d), () => c.removeEventListener(h, g, d)), a = k(
|
|
129
|
+
() => [Ft(e), U(n)],
|
|
130
|
+
([c, h]) => {
|
|
131
|
+
if (s(), !c)
|
|
132
|
+
return;
|
|
133
|
+
const g = he(h) ? { ...h } : h;
|
|
134
|
+
i.push(
|
|
135
|
+
...r.flatMap((d) => o.map((w) => u(c, d, w, g)))
|
|
136
|
+
);
|
|
137
|
+
},
|
|
138
|
+
{ immediate: !0, flush: "post" }
|
|
139
|
+
), l = () => {
|
|
140
|
+
a(), s();
|
|
141
|
+
};
|
|
142
|
+
return Dt(l), l;
|
|
143
|
+
}
|
|
144
|
+
function Be() {
|
|
145
|
+
const t = L(!1), e = Lt();
|
|
146
|
+
return e && Pt(() => {
|
|
147
|
+
t.value = !0;
|
|
148
|
+
}, e), t;
|
|
149
|
+
}
|
|
150
|
+
function Me(t) {
|
|
151
|
+
const e = Be();
|
|
152
|
+
return _(() => (e.value, !!t()));
|
|
153
|
+
}
|
|
154
|
+
function z(t, e = {}) {
|
|
155
|
+
const { window: r = O } = e, o = Me(() => r && "matchMedia" in r && typeof r.matchMedia == "function");
|
|
156
|
+
let n;
|
|
157
|
+
const i = L(!1), s = (l) => {
|
|
158
|
+
i.value = l.matches;
|
|
159
|
+
}, u = () => {
|
|
160
|
+
n && ("removeEventListener" in n ? n.removeEventListener("change", s) : n.removeListener(s));
|
|
161
|
+
}, a = ae(() => {
|
|
162
|
+
o.value && (u(), n = r.matchMedia(U(t)), "addEventListener" in n ? n.addEventListener("change", s) : n.addListener(s), i.value = n.matches);
|
|
163
|
+
});
|
|
164
|
+
return Dt(() => {
|
|
165
|
+
a(), u(), n = void 0;
|
|
166
|
+
}), i;
|
|
167
|
+
}
|
|
168
|
+
function Se(t, e = {}) {
|
|
169
|
+
function r(c, h) {
|
|
170
|
+
let g = U(t[U(c)]);
|
|
171
|
+
return h != null && (g = we(g, h)), typeof g == "number" && (g = `${g}px`), g;
|
|
172
|
+
}
|
|
173
|
+
const { window: o = O, strategy: n = "min-width" } = e;
|
|
174
|
+
function i(c) {
|
|
175
|
+
return o ? o.matchMedia(c).matches : !1;
|
|
176
|
+
}
|
|
177
|
+
const s = (c) => z(() => `(min-width: ${r(c)})`, e), u = (c) => z(() => `(max-width: ${r(c)})`, e), a = Object.keys(t).reduce((c, h) => (Object.defineProperty(c, h, {
|
|
178
|
+
get: () => n === "min-width" ? s(h) : u(h),
|
|
179
|
+
enumerable: !0,
|
|
180
|
+
configurable: !0
|
|
181
|
+
}), c), {});
|
|
182
|
+
function l() {
|
|
183
|
+
const c = Object.keys(t).map((h) => [h, s(h)]);
|
|
184
|
+
return _(() => c.filter(([, h]) => h.value).map(([h]) => h));
|
|
185
|
+
}
|
|
186
|
+
return Object.assign(a, {
|
|
187
|
+
greaterOrEqual: s,
|
|
188
|
+
smallerOrEqual: u,
|
|
189
|
+
greater(c) {
|
|
190
|
+
return z(() => `(min-width: ${r(c, 0.1)})`, e);
|
|
191
|
+
},
|
|
192
|
+
smaller(c) {
|
|
193
|
+
return z(() => `(max-width: ${r(c, -0.1)})`, e);
|
|
194
|
+
},
|
|
195
|
+
between(c, h) {
|
|
196
|
+
return z(() => `(min-width: ${r(c)}) and (max-width: ${r(h, -0.1)})`, e);
|
|
197
|
+
},
|
|
198
|
+
isGreater(c) {
|
|
199
|
+
return i(`(min-width: ${r(c, 0.1)})`);
|
|
200
|
+
},
|
|
201
|
+
isGreaterOrEqual(c) {
|
|
202
|
+
return i(`(min-width: ${r(c)})`);
|
|
203
|
+
},
|
|
204
|
+
isSmaller(c) {
|
|
205
|
+
return i(`(max-width: ${r(c, -0.1)})`);
|
|
206
|
+
},
|
|
207
|
+
isSmallerOrEqual(c) {
|
|
208
|
+
return i(`(max-width: ${r(c)})`);
|
|
209
|
+
},
|
|
210
|
+
isInBetween(c, h) {
|
|
211
|
+
return i(`(min-width: ${r(c)}) and (max-width: ${r(h, -0.1)})`);
|
|
212
|
+
},
|
|
213
|
+
current: l,
|
|
214
|
+
active() {
|
|
215
|
+
const c = l();
|
|
216
|
+
return _(() => c.value.length === 0 ? "" : c.value.at(-1));
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
const G = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, q = "__vueuse_ssr_handlers__", Ae = /* @__PURE__ */ ve();
|
|
221
|
+
function ve() {
|
|
222
|
+
return q in G || (G[q] = G[q] || {}), G[q];
|
|
223
|
+
}
|
|
224
|
+
function Ot(t, e) {
|
|
225
|
+
return Ae[t] || e;
|
|
226
|
+
}
|
|
227
|
+
function Ne(t) {
|
|
228
|
+
return t == null ? "any" : t instanceof Set ? "set" : t instanceof Map ? "map" : t instanceof Date ? "date" : typeof t == "boolean" ? "boolean" : typeof t == "string" ? "string" : typeof t == "object" ? "object" : Number.isNaN(t) ? "any" : "number";
|
|
229
|
+
}
|
|
230
|
+
const Te = {
|
|
231
|
+
boolean: {
|
|
232
|
+
read: (t) => t === "true",
|
|
233
|
+
write: (t) => String(t)
|
|
234
|
+
},
|
|
235
|
+
object: {
|
|
236
|
+
read: (t) => JSON.parse(t),
|
|
237
|
+
write: (t) => JSON.stringify(t)
|
|
238
|
+
},
|
|
239
|
+
number: {
|
|
240
|
+
read: (t) => Number.parseFloat(t),
|
|
241
|
+
write: (t) => String(t)
|
|
242
|
+
},
|
|
243
|
+
any: {
|
|
244
|
+
read: (t) => t,
|
|
245
|
+
write: (t) => String(t)
|
|
246
|
+
},
|
|
247
|
+
string: {
|
|
248
|
+
read: (t) => t,
|
|
249
|
+
write: (t) => String(t)
|
|
250
|
+
},
|
|
251
|
+
map: {
|
|
252
|
+
read: (t) => new Map(JSON.parse(t)),
|
|
253
|
+
write: (t) => JSON.stringify(Array.from(t.entries()))
|
|
254
|
+
},
|
|
255
|
+
set: {
|
|
256
|
+
read: (t) => new Set(JSON.parse(t)),
|
|
257
|
+
write: (t) => JSON.stringify(Array.from(t))
|
|
258
|
+
},
|
|
259
|
+
date: {
|
|
260
|
+
read: (t) => new Date(t),
|
|
261
|
+
write: (t) => t.toISOString()
|
|
262
|
+
}
|
|
263
|
+
}, St = "vueuse-storage";
|
|
264
|
+
function Ie(t, e, r, o = {}) {
|
|
265
|
+
var n;
|
|
266
|
+
const {
|
|
267
|
+
flush: i = "pre",
|
|
268
|
+
deep: s = !0,
|
|
269
|
+
listenToStorageChanges: u = !0,
|
|
270
|
+
writeDefaults: a = !0,
|
|
271
|
+
mergeDefaults: l = !1,
|
|
272
|
+
shallow: c,
|
|
273
|
+
window: h = O,
|
|
274
|
+
eventFilter: g,
|
|
275
|
+
onError: d = (C) => {
|
|
276
|
+
console.error(C);
|
|
277
|
+
},
|
|
278
|
+
initOnMounted: w
|
|
279
|
+
} = o, p = (c ? ce : L)(typeof e == "function" ? e() : e);
|
|
280
|
+
if (!r)
|
|
281
|
+
try {
|
|
282
|
+
r = Ot("getDefaultStorage", () => {
|
|
283
|
+
var C;
|
|
284
|
+
return (C = O) == null ? void 0 : C.localStorage;
|
|
285
|
+
})();
|
|
286
|
+
} catch (C) {
|
|
287
|
+
d(C);
|
|
288
|
+
}
|
|
289
|
+
if (!r)
|
|
290
|
+
return p;
|
|
291
|
+
const B = U(e), y = Ne(B), E = (n = o.serializer) != null ? n : Te[y], { pause: m, resume: f } = Ee(
|
|
292
|
+
p,
|
|
293
|
+
() => M(p.value),
|
|
294
|
+
{ flush: i, deep: s, eventFilter: g }
|
|
295
|
+
);
|
|
296
|
+
h && u && Ut(() => {
|
|
297
|
+
Mt(h, "storage", A), Mt(h, St, N), w && A();
|
|
298
|
+
}), w || A();
|
|
299
|
+
function b(C, v) {
|
|
300
|
+
h && h.dispatchEvent(new CustomEvent(St, {
|
|
301
|
+
detail: {
|
|
302
|
+
key: t,
|
|
303
|
+
oldValue: C,
|
|
304
|
+
newValue: v,
|
|
305
|
+
storageArea: r
|
|
306
|
+
}
|
|
307
|
+
}));
|
|
308
|
+
}
|
|
309
|
+
function M(C) {
|
|
310
|
+
try {
|
|
311
|
+
const v = r.getItem(t);
|
|
312
|
+
if (C == null)
|
|
313
|
+
b(v, null), r.removeItem(t);
|
|
314
|
+
else {
|
|
315
|
+
const I = E.write(C);
|
|
316
|
+
v !== I && (r.setItem(t, I), b(v, I));
|
|
317
|
+
}
|
|
318
|
+
} catch (v) {
|
|
319
|
+
d(v);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
function S(C) {
|
|
323
|
+
const v = C ? C.newValue : r.getItem(t);
|
|
324
|
+
if (v == null)
|
|
325
|
+
return a && B != null && r.setItem(t, E.write(B)), B;
|
|
326
|
+
if (!C && l) {
|
|
327
|
+
const I = E.read(v);
|
|
328
|
+
return typeof l == "function" ? l(I, B) : y === "object" && !Array.isArray(I) ? { ...B, ...I } : I;
|
|
329
|
+
} else
|
|
330
|
+
return typeof v != "string" ? v : E.read(v);
|
|
331
|
+
}
|
|
332
|
+
function A(C) {
|
|
333
|
+
if (!(C && C.storageArea !== r)) {
|
|
334
|
+
if (C && C.key == null) {
|
|
335
|
+
p.value = B;
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
if (!(C && C.key !== t)) {
|
|
339
|
+
m();
|
|
340
|
+
try {
|
|
341
|
+
(C == null ? void 0 : C.newValue) !== E.write(p.value) && (p.value = S(C));
|
|
342
|
+
} catch (v) {
|
|
343
|
+
d(v);
|
|
344
|
+
} finally {
|
|
345
|
+
C ? gt(f) : f();
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function N(C) {
|
|
351
|
+
A(C.detail);
|
|
352
|
+
}
|
|
353
|
+
return p;
|
|
354
|
+
}
|
|
355
|
+
function zt(t) {
|
|
356
|
+
return z("(prefers-color-scheme: dark)", t);
|
|
357
|
+
}
|
|
358
|
+
function Re(t = {}) {
|
|
359
|
+
const {
|
|
360
|
+
selector: e = "html",
|
|
361
|
+
attribute: r = "class",
|
|
362
|
+
initialValue: o = "auto",
|
|
363
|
+
window: n = O,
|
|
364
|
+
storage: i,
|
|
365
|
+
storageKey: s = "vueuse-color-scheme",
|
|
366
|
+
listenToStorageChanges: u = !0,
|
|
367
|
+
storageRef: a,
|
|
368
|
+
emitAuto: l,
|
|
369
|
+
disableTransition: c = !0
|
|
370
|
+
} = t, h = {
|
|
371
|
+
auto: "",
|
|
372
|
+
light: "light",
|
|
373
|
+
dark: "dark",
|
|
374
|
+
...t.modes || {}
|
|
375
|
+
}, g = zt({ window: n }), d = _(() => g.value ? "dark" : "light"), w = a || (s == null ? ye(o) : Ie(s, o, i, { window: n, listenToStorageChanges: u })), p = _(() => w.value === "auto" ? d.value : w.value), B = Ot(
|
|
376
|
+
"updateHTMLAttrs",
|
|
377
|
+
(f, b, M) => {
|
|
378
|
+
const S = typeof f == "string" ? n == null ? void 0 : n.document.querySelector(f) : Ft(f);
|
|
379
|
+
if (!S)
|
|
380
|
+
return;
|
|
381
|
+
let A;
|
|
382
|
+
if (c) {
|
|
383
|
+
A = n.document.createElement("style");
|
|
384
|
+
const N = "*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";
|
|
385
|
+
A.appendChild(document.createTextNode(N)), n.document.head.appendChild(A);
|
|
386
|
+
}
|
|
387
|
+
if (b === "class") {
|
|
388
|
+
const N = M.split(/\s/g);
|
|
389
|
+
Object.values(h).flatMap((C) => (C || "").split(/\s/g)).filter(Boolean).forEach((C) => {
|
|
390
|
+
N.includes(C) ? S.classList.add(C) : S.classList.remove(C);
|
|
391
|
+
});
|
|
392
|
+
} else
|
|
393
|
+
S.setAttribute(b, M);
|
|
394
|
+
c && (n.getComputedStyle(A).opacity, document.head.removeChild(A));
|
|
395
|
+
}
|
|
396
|
+
);
|
|
397
|
+
function y(f) {
|
|
398
|
+
var b;
|
|
399
|
+
B(e, r, (b = h[f]) != null ? b : f);
|
|
400
|
+
}
|
|
401
|
+
function E(f) {
|
|
402
|
+
t.onChanged ? t.onChanged(f, y) : y(f);
|
|
403
|
+
}
|
|
404
|
+
k(p, E, { flush: "post", immediate: !0 }), Ut(() => E(p.value));
|
|
405
|
+
const m = _({
|
|
406
|
+
get() {
|
|
407
|
+
return l ? w.value : p.value;
|
|
408
|
+
},
|
|
409
|
+
set(f) {
|
|
410
|
+
w.value = f;
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
try {
|
|
414
|
+
return Object.assign(m, { store: w, system: d, state: p });
|
|
415
|
+
} catch {
|
|
416
|
+
return m;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
function Pe(t = {}) {
|
|
420
|
+
const {
|
|
421
|
+
valueDark: e = "dark",
|
|
422
|
+
valueLight: r = "",
|
|
423
|
+
window: o = O
|
|
424
|
+
} = t, n = Re({
|
|
425
|
+
...t,
|
|
426
|
+
onChanged: (u, a) => {
|
|
427
|
+
var l;
|
|
428
|
+
t.onChanged ? (l = t.onChanged) == null || l.call(t, u === "dark", a, u) : a(u);
|
|
429
|
+
},
|
|
430
|
+
modes: {
|
|
431
|
+
dark: e,
|
|
432
|
+
light: r
|
|
433
|
+
}
|
|
434
|
+
}), i = _(() => n.system ? n.system.value : zt({ window: o }).value ? "dark" : "light");
|
|
435
|
+
return _({
|
|
436
|
+
get() {
|
|
437
|
+
return n.value === "dark";
|
|
438
|
+
},
|
|
439
|
+
set(u) {
|
|
440
|
+
const a = u ? "dark" : "light";
|
|
441
|
+
i.value === a ? n.value = "auto" : n.value = a;
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
function mt(t) {
|
|
446
|
+
gt(() => {
|
|
447
|
+
window.socket.on("connect", t);
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
function Le(t, e) {
|
|
451
|
+
const r = Se(t), o = r.active(), n = () => {
|
|
452
|
+
e("change", {
|
|
453
|
+
eventName: "activeWithMounted",
|
|
454
|
+
value: o.value
|
|
455
|
+
});
|
|
456
|
+
}, i = new bt();
|
|
457
|
+
return i.addMethod("active", () => o.value), i.addMethod(
|
|
458
|
+
"between",
|
|
459
|
+
(s, u) => r.between(s, u).value
|
|
460
|
+
), i.addMethod(
|
|
461
|
+
"betweenReactively",
|
|
462
|
+
(s, u, a) => {
|
|
463
|
+
const l = r.between(s, u);
|
|
464
|
+
k(l, (c) => {
|
|
465
|
+
e("change", {
|
|
466
|
+
eventName: a,
|
|
467
|
+
value: c
|
|
468
|
+
});
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
), mt(n), k(o, (s) => {
|
|
472
|
+
e("change", {
|
|
473
|
+
eventName: "active",
|
|
474
|
+
value: s
|
|
475
|
+
}), n();
|
|
476
|
+
}), i;
|
|
477
|
+
}
|
|
478
|
+
function De(t, e, r) {
|
|
479
|
+
const o = Pe(t);
|
|
480
|
+
o.value = e;
|
|
481
|
+
const n = () => {
|
|
482
|
+
r("change", {
|
|
483
|
+
eventName: "isDarkWithMounted",
|
|
484
|
+
value: o.value
|
|
485
|
+
});
|
|
486
|
+
}, i = be(o), s = new bt();
|
|
487
|
+
return s.addMethod("toggleDark", (u) => {
|
|
488
|
+
if (o.value !== u) {
|
|
489
|
+
if (u === null) {
|
|
490
|
+
i();
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
i(u);
|
|
494
|
+
}
|
|
495
|
+
}), mt(n), k(o, (u) => {
|
|
496
|
+
r("change", {
|
|
497
|
+
eventName: "isDark",
|
|
498
|
+
value: u
|
|
499
|
+
}), n();
|
|
500
|
+
}), s;
|
|
501
|
+
}
|
|
502
|
+
const _e = typeof window < "u" && typeof document < "u";
|
|
503
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
504
|
+
const ke = () => {
|
|
505
|
+
};
|
|
506
|
+
function Ue(...t) {
|
|
507
|
+
if (t.length !== 1)
|
|
508
|
+
return It(...t);
|
|
509
|
+
const e = t[0];
|
|
510
|
+
return typeof e == "function" ? ht(Rt(() => ({ get: e, set: ke }))) : L(e);
|
|
511
|
+
}
|
|
512
|
+
var W = {}, Fe = function() {
|
|
513
|
+
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
514
|
+
}, Vt = {}, T = {};
|
|
515
|
+
let wt;
|
|
516
|
+
const Oe = [
|
|
517
|
+
0,
|
|
518
|
+
// Not used
|
|
519
|
+
26,
|
|
520
|
+
44,
|
|
521
|
+
70,
|
|
522
|
+
100,
|
|
523
|
+
134,
|
|
524
|
+
172,
|
|
525
|
+
196,
|
|
526
|
+
242,
|
|
527
|
+
292,
|
|
528
|
+
346,
|
|
529
|
+
404,
|
|
530
|
+
466,
|
|
531
|
+
532,
|
|
532
|
+
581,
|
|
533
|
+
655,
|
|
534
|
+
733,
|
|
535
|
+
815,
|
|
536
|
+
901,
|
|
537
|
+
991,
|
|
538
|
+
1085,
|
|
539
|
+
1156,
|
|
540
|
+
1258,
|
|
541
|
+
1364,
|
|
542
|
+
1474,
|
|
543
|
+
1588,
|
|
544
|
+
1706,
|
|
545
|
+
1828,
|
|
546
|
+
1921,
|
|
547
|
+
2051,
|
|
548
|
+
2185,
|
|
549
|
+
2323,
|
|
550
|
+
2465,
|
|
551
|
+
2611,
|
|
552
|
+
2761,
|
|
553
|
+
2876,
|
|
554
|
+
3034,
|
|
555
|
+
3196,
|
|
556
|
+
3362,
|
|
557
|
+
3532,
|
|
558
|
+
3706
|
|
559
|
+
];
|
|
560
|
+
T.getSymbolSize = function(e) {
|
|
561
|
+
if (!e)
|
|
562
|
+
throw new Error('"version" cannot be null or undefined');
|
|
563
|
+
if (e < 1 || e > 40)
|
|
564
|
+
throw new Error('"version" should be in range from 1 to 40');
|
|
565
|
+
return e * 4 + 17;
|
|
566
|
+
};
|
|
567
|
+
T.getSymbolTotalCodewords = function(e) {
|
|
568
|
+
return Oe[e];
|
|
569
|
+
};
|
|
570
|
+
T.getBCHDigit = function(t) {
|
|
571
|
+
let e = 0;
|
|
572
|
+
for (; t !== 0; )
|
|
573
|
+
e++, t >>>= 1;
|
|
574
|
+
return e;
|
|
575
|
+
};
|
|
576
|
+
T.setToSJISFunction = function(e) {
|
|
577
|
+
if (typeof e != "function")
|
|
578
|
+
throw new Error('"toSJISFunc" is not a valid function.');
|
|
579
|
+
wt = e;
|
|
580
|
+
};
|
|
581
|
+
T.isKanjiModeEnabled = function() {
|
|
582
|
+
return typeof wt < "u";
|
|
583
|
+
};
|
|
584
|
+
T.toSJIS = function(e) {
|
|
585
|
+
return wt(e);
|
|
586
|
+
};
|
|
587
|
+
var tt = {};
|
|
588
|
+
(function(t) {
|
|
589
|
+
t.L = { bit: 1 }, t.M = { bit: 0 }, t.Q = { bit: 3 }, t.H = { bit: 2 };
|
|
590
|
+
function e(r) {
|
|
591
|
+
if (typeof r != "string")
|
|
592
|
+
throw new Error("Param is not a string");
|
|
593
|
+
switch (r.toLowerCase()) {
|
|
594
|
+
case "l":
|
|
595
|
+
case "low":
|
|
596
|
+
return t.L;
|
|
597
|
+
case "m":
|
|
598
|
+
case "medium":
|
|
599
|
+
return t.M;
|
|
600
|
+
case "q":
|
|
601
|
+
case "quartile":
|
|
602
|
+
return t.Q;
|
|
603
|
+
case "h":
|
|
604
|
+
case "high":
|
|
605
|
+
return t.H;
|
|
606
|
+
default:
|
|
607
|
+
throw new Error("Unknown EC Level: " + r);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
t.isValid = function(o) {
|
|
611
|
+
return o && typeof o.bit < "u" && o.bit >= 0 && o.bit < 4;
|
|
612
|
+
}, t.from = function(o, n) {
|
|
613
|
+
if (t.isValid(o))
|
|
614
|
+
return o;
|
|
615
|
+
try {
|
|
616
|
+
return e(o);
|
|
617
|
+
} catch {
|
|
618
|
+
return n;
|
|
619
|
+
}
|
|
620
|
+
};
|
|
621
|
+
})(tt);
|
|
622
|
+
function $t() {
|
|
623
|
+
this.buffer = [], this.length = 0;
|
|
624
|
+
}
|
|
625
|
+
$t.prototype = {
|
|
626
|
+
get: function(t) {
|
|
627
|
+
const e = Math.floor(t / 8);
|
|
628
|
+
return (this.buffer[e] >>> 7 - t % 8 & 1) === 1;
|
|
629
|
+
},
|
|
630
|
+
put: function(t, e) {
|
|
631
|
+
for (let r = 0; r < e; r++)
|
|
632
|
+
this.putBit((t >>> e - r - 1 & 1) === 1);
|
|
633
|
+
},
|
|
634
|
+
getLengthInBits: function() {
|
|
635
|
+
return this.length;
|
|
636
|
+
},
|
|
637
|
+
putBit: function(t) {
|
|
638
|
+
const e = Math.floor(this.length / 8);
|
|
639
|
+
this.buffer.length <= e && this.buffer.push(0), t && (this.buffer[e] |= 128 >>> this.length % 8), this.length++;
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
var ze = $t;
|
|
643
|
+
function Y(t) {
|
|
644
|
+
if (!t || t < 1)
|
|
645
|
+
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
646
|
+
this.size = t, this.data = new Uint8Array(t * t), this.reservedBit = new Uint8Array(t * t);
|
|
647
|
+
}
|
|
648
|
+
Y.prototype.set = function(t, e, r, o) {
|
|
649
|
+
const n = t * this.size + e;
|
|
650
|
+
this.data[n] = r, o && (this.reservedBit[n] = !0);
|
|
651
|
+
};
|
|
652
|
+
Y.prototype.get = function(t, e) {
|
|
653
|
+
return this.data[t * this.size + e];
|
|
654
|
+
};
|
|
655
|
+
Y.prototype.xor = function(t, e, r) {
|
|
656
|
+
this.data[t * this.size + e] ^= r;
|
|
657
|
+
};
|
|
658
|
+
Y.prototype.isReserved = function(t, e) {
|
|
659
|
+
return this.reservedBit[t * this.size + e];
|
|
660
|
+
};
|
|
661
|
+
var Ve = Y, jt = {};
|
|
662
|
+
(function(t) {
|
|
663
|
+
const e = T.getSymbolSize;
|
|
664
|
+
t.getRowColCoords = function(o) {
|
|
665
|
+
if (o === 1)
|
|
666
|
+
return [];
|
|
667
|
+
const n = Math.floor(o / 7) + 2, i = e(o), s = i === 145 ? 26 : Math.ceil((i - 13) / (2 * n - 2)) * 2, u = [i - 7];
|
|
668
|
+
for (let a = 1; a < n - 1; a++)
|
|
669
|
+
u[a] = u[a - 1] - s;
|
|
670
|
+
return u.push(6), u.reverse();
|
|
671
|
+
}, t.getPositions = function(o) {
|
|
672
|
+
const n = [], i = t.getRowColCoords(o), s = i.length;
|
|
673
|
+
for (let u = 0; u < s; u++)
|
|
674
|
+
for (let a = 0; a < s; a++)
|
|
675
|
+
u === 0 && a === 0 || // top-left
|
|
676
|
+
u === 0 && a === s - 1 || // bottom-left
|
|
677
|
+
u === s - 1 && a === 0 || n.push([i[u], i[a]]);
|
|
678
|
+
return n;
|
|
679
|
+
};
|
|
680
|
+
})(jt);
|
|
681
|
+
var Ht = {};
|
|
682
|
+
const $e = T.getSymbolSize, At = 7;
|
|
683
|
+
Ht.getPositions = function(e) {
|
|
684
|
+
const r = $e(e);
|
|
685
|
+
return [
|
|
686
|
+
// top-left
|
|
687
|
+
[0, 0],
|
|
688
|
+
// top-right
|
|
689
|
+
[r - At, 0],
|
|
690
|
+
// bottom-left
|
|
691
|
+
[0, r - At]
|
|
692
|
+
];
|
|
693
|
+
};
|
|
694
|
+
var Jt = {};
|
|
695
|
+
(function(t) {
|
|
696
|
+
t.Patterns = {
|
|
697
|
+
PATTERN000: 0,
|
|
698
|
+
PATTERN001: 1,
|
|
699
|
+
PATTERN010: 2,
|
|
700
|
+
PATTERN011: 3,
|
|
701
|
+
PATTERN100: 4,
|
|
702
|
+
PATTERN101: 5,
|
|
703
|
+
PATTERN110: 6,
|
|
704
|
+
PATTERN111: 7
|
|
705
|
+
};
|
|
706
|
+
const e = {
|
|
707
|
+
N1: 3,
|
|
708
|
+
N2: 3,
|
|
709
|
+
N3: 40,
|
|
710
|
+
N4: 10
|
|
711
|
+
};
|
|
712
|
+
t.isValid = function(n) {
|
|
713
|
+
return n != null && n !== "" && !isNaN(n) && n >= 0 && n <= 7;
|
|
714
|
+
}, t.from = function(n) {
|
|
715
|
+
return t.isValid(n) ? parseInt(n, 10) : void 0;
|
|
716
|
+
}, t.getPenaltyN1 = function(n) {
|
|
717
|
+
const i = n.size;
|
|
718
|
+
let s = 0, u = 0, a = 0, l = null, c = null;
|
|
719
|
+
for (let h = 0; h < i; h++) {
|
|
720
|
+
u = a = 0, l = c = null;
|
|
721
|
+
for (let g = 0; g < i; g++) {
|
|
722
|
+
let d = n.get(h, g);
|
|
723
|
+
d === l ? u++ : (u >= 5 && (s += e.N1 + (u - 5)), l = d, u = 1), d = n.get(g, h), d === c ? a++ : (a >= 5 && (s += e.N1 + (a - 5)), c = d, a = 1);
|
|
724
|
+
}
|
|
725
|
+
u >= 5 && (s += e.N1 + (u - 5)), a >= 5 && (s += e.N1 + (a - 5));
|
|
726
|
+
}
|
|
727
|
+
return s;
|
|
728
|
+
}, t.getPenaltyN2 = function(n) {
|
|
729
|
+
const i = n.size;
|
|
730
|
+
let s = 0;
|
|
731
|
+
for (let u = 0; u < i - 1; u++)
|
|
732
|
+
for (let a = 0; a < i - 1; a++) {
|
|
733
|
+
const l = n.get(u, a) + n.get(u, a + 1) + n.get(u + 1, a) + n.get(u + 1, a + 1);
|
|
734
|
+
(l === 4 || l === 0) && s++;
|
|
735
|
+
}
|
|
736
|
+
return s * e.N2;
|
|
737
|
+
}, t.getPenaltyN3 = function(n) {
|
|
738
|
+
const i = n.size;
|
|
739
|
+
let s = 0, u = 0, a = 0;
|
|
740
|
+
for (let l = 0; l < i; l++) {
|
|
741
|
+
u = a = 0;
|
|
742
|
+
for (let c = 0; c < i; c++)
|
|
743
|
+
u = u << 1 & 2047 | n.get(l, c), c >= 10 && (u === 1488 || u === 93) && s++, a = a << 1 & 2047 | n.get(c, l), c >= 10 && (a === 1488 || a === 93) && s++;
|
|
744
|
+
}
|
|
745
|
+
return s * e.N3;
|
|
746
|
+
}, t.getPenaltyN4 = function(n) {
|
|
747
|
+
let i = 0;
|
|
748
|
+
const s = n.data.length;
|
|
749
|
+
for (let a = 0; a < s; a++)
|
|
750
|
+
i += n.data[a];
|
|
751
|
+
return Math.abs(Math.ceil(i * 100 / s / 5) - 10) * e.N4;
|
|
752
|
+
};
|
|
753
|
+
function r(o, n, i) {
|
|
754
|
+
switch (o) {
|
|
755
|
+
case t.Patterns.PATTERN000:
|
|
756
|
+
return (n + i) % 2 === 0;
|
|
757
|
+
case t.Patterns.PATTERN001:
|
|
758
|
+
return n % 2 === 0;
|
|
759
|
+
case t.Patterns.PATTERN010:
|
|
760
|
+
return i % 3 === 0;
|
|
761
|
+
case t.Patterns.PATTERN011:
|
|
762
|
+
return (n + i) % 3 === 0;
|
|
763
|
+
case t.Patterns.PATTERN100:
|
|
764
|
+
return (Math.floor(n / 2) + Math.floor(i / 3)) % 2 === 0;
|
|
765
|
+
case t.Patterns.PATTERN101:
|
|
766
|
+
return n * i % 2 + n * i % 3 === 0;
|
|
767
|
+
case t.Patterns.PATTERN110:
|
|
768
|
+
return (n * i % 2 + n * i % 3) % 2 === 0;
|
|
769
|
+
case t.Patterns.PATTERN111:
|
|
770
|
+
return (n * i % 3 + (n + i) % 2) % 2 === 0;
|
|
771
|
+
default:
|
|
772
|
+
throw new Error("bad maskPattern:" + o);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
t.applyMask = function(n, i) {
|
|
776
|
+
const s = i.size;
|
|
777
|
+
for (let u = 0; u < s; u++)
|
|
778
|
+
for (let a = 0; a < s; a++)
|
|
779
|
+
i.isReserved(a, u) || i.xor(a, u, r(n, a, u));
|
|
780
|
+
}, t.getBestMask = function(n, i) {
|
|
781
|
+
const s = Object.keys(t.Patterns).length;
|
|
782
|
+
let u = 0, a = 1 / 0;
|
|
783
|
+
for (let l = 0; l < s; l++) {
|
|
784
|
+
i(l), t.applyMask(l, n);
|
|
785
|
+
const c = t.getPenaltyN1(n) + t.getPenaltyN2(n) + t.getPenaltyN3(n) + t.getPenaltyN4(n);
|
|
786
|
+
t.applyMask(l, n), c < a && (a = c, u = l);
|
|
787
|
+
}
|
|
788
|
+
return u;
|
|
789
|
+
};
|
|
790
|
+
})(Jt);
|
|
791
|
+
var et = {};
|
|
792
|
+
const D = tt, Q = [
|
|
793
|
+
// L M Q H
|
|
794
|
+
1,
|
|
795
|
+
1,
|
|
796
|
+
1,
|
|
797
|
+
1,
|
|
798
|
+
1,
|
|
799
|
+
1,
|
|
800
|
+
1,
|
|
801
|
+
1,
|
|
802
|
+
1,
|
|
803
|
+
1,
|
|
804
|
+
2,
|
|
805
|
+
2,
|
|
806
|
+
1,
|
|
807
|
+
2,
|
|
808
|
+
2,
|
|
809
|
+
4,
|
|
810
|
+
1,
|
|
811
|
+
2,
|
|
812
|
+
4,
|
|
813
|
+
4,
|
|
814
|
+
2,
|
|
815
|
+
4,
|
|
816
|
+
4,
|
|
817
|
+
4,
|
|
818
|
+
2,
|
|
819
|
+
4,
|
|
820
|
+
6,
|
|
821
|
+
5,
|
|
822
|
+
2,
|
|
823
|
+
4,
|
|
824
|
+
6,
|
|
825
|
+
6,
|
|
826
|
+
2,
|
|
827
|
+
5,
|
|
828
|
+
8,
|
|
829
|
+
8,
|
|
830
|
+
4,
|
|
831
|
+
5,
|
|
832
|
+
8,
|
|
833
|
+
8,
|
|
834
|
+
4,
|
|
835
|
+
5,
|
|
836
|
+
8,
|
|
837
|
+
11,
|
|
838
|
+
4,
|
|
839
|
+
8,
|
|
840
|
+
10,
|
|
841
|
+
11,
|
|
842
|
+
4,
|
|
843
|
+
9,
|
|
844
|
+
12,
|
|
845
|
+
16,
|
|
846
|
+
4,
|
|
847
|
+
9,
|
|
848
|
+
16,
|
|
849
|
+
16,
|
|
850
|
+
6,
|
|
851
|
+
10,
|
|
852
|
+
12,
|
|
853
|
+
18,
|
|
854
|
+
6,
|
|
855
|
+
10,
|
|
856
|
+
17,
|
|
857
|
+
16,
|
|
858
|
+
6,
|
|
859
|
+
11,
|
|
860
|
+
16,
|
|
861
|
+
19,
|
|
862
|
+
6,
|
|
863
|
+
13,
|
|
864
|
+
18,
|
|
865
|
+
21,
|
|
866
|
+
7,
|
|
867
|
+
14,
|
|
868
|
+
21,
|
|
869
|
+
25,
|
|
870
|
+
8,
|
|
871
|
+
16,
|
|
872
|
+
20,
|
|
873
|
+
25,
|
|
874
|
+
8,
|
|
875
|
+
17,
|
|
876
|
+
23,
|
|
877
|
+
25,
|
|
878
|
+
9,
|
|
879
|
+
17,
|
|
880
|
+
23,
|
|
881
|
+
34,
|
|
882
|
+
9,
|
|
883
|
+
18,
|
|
884
|
+
25,
|
|
885
|
+
30,
|
|
886
|
+
10,
|
|
887
|
+
20,
|
|
888
|
+
27,
|
|
889
|
+
32,
|
|
890
|
+
12,
|
|
891
|
+
21,
|
|
892
|
+
29,
|
|
893
|
+
35,
|
|
894
|
+
12,
|
|
895
|
+
23,
|
|
896
|
+
34,
|
|
897
|
+
37,
|
|
898
|
+
12,
|
|
899
|
+
25,
|
|
900
|
+
34,
|
|
901
|
+
40,
|
|
902
|
+
13,
|
|
903
|
+
26,
|
|
904
|
+
35,
|
|
905
|
+
42,
|
|
906
|
+
14,
|
|
907
|
+
28,
|
|
908
|
+
38,
|
|
909
|
+
45,
|
|
910
|
+
15,
|
|
911
|
+
29,
|
|
912
|
+
40,
|
|
913
|
+
48,
|
|
914
|
+
16,
|
|
915
|
+
31,
|
|
916
|
+
43,
|
|
917
|
+
51,
|
|
918
|
+
17,
|
|
919
|
+
33,
|
|
920
|
+
45,
|
|
921
|
+
54,
|
|
922
|
+
18,
|
|
923
|
+
35,
|
|
924
|
+
48,
|
|
925
|
+
57,
|
|
926
|
+
19,
|
|
927
|
+
37,
|
|
928
|
+
51,
|
|
929
|
+
60,
|
|
930
|
+
19,
|
|
931
|
+
38,
|
|
932
|
+
53,
|
|
933
|
+
63,
|
|
934
|
+
20,
|
|
935
|
+
40,
|
|
936
|
+
56,
|
|
937
|
+
66,
|
|
938
|
+
21,
|
|
939
|
+
43,
|
|
940
|
+
59,
|
|
941
|
+
70,
|
|
942
|
+
22,
|
|
943
|
+
45,
|
|
944
|
+
62,
|
|
945
|
+
74,
|
|
946
|
+
24,
|
|
947
|
+
47,
|
|
948
|
+
65,
|
|
949
|
+
77,
|
|
950
|
+
25,
|
|
951
|
+
49,
|
|
952
|
+
68,
|
|
953
|
+
81
|
|
954
|
+
], Z = [
|
|
955
|
+
// L M Q H
|
|
956
|
+
7,
|
|
957
|
+
10,
|
|
958
|
+
13,
|
|
959
|
+
17,
|
|
960
|
+
10,
|
|
961
|
+
16,
|
|
962
|
+
22,
|
|
963
|
+
28,
|
|
964
|
+
15,
|
|
965
|
+
26,
|
|
966
|
+
36,
|
|
967
|
+
44,
|
|
968
|
+
20,
|
|
969
|
+
36,
|
|
970
|
+
52,
|
|
971
|
+
64,
|
|
972
|
+
26,
|
|
973
|
+
48,
|
|
974
|
+
72,
|
|
975
|
+
88,
|
|
976
|
+
36,
|
|
977
|
+
64,
|
|
978
|
+
96,
|
|
979
|
+
112,
|
|
980
|
+
40,
|
|
981
|
+
72,
|
|
982
|
+
108,
|
|
983
|
+
130,
|
|
984
|
+
48,
|
|
985
|
+
88,
|
|
986
|
+
132,
|
|
987
|
+
156,
|
|
988
|
+
60,
|
|
989
|
+
110,
|
|
990
|
+
160,
|
|
991
|
+
192,
|
|
992
|
+
72,
|
|
993
|
+
130,
|
|
994
|
+
192,
|
|
995
|
+
224,
|
|
996
|
+
80,
|
|
997
|
+
150,
|
|
998
|
+
224,
|
|
999
|
+
264,
|
|
1000
|
+
96,
|
|
1001
|
+
176,
|
|
1002
|
+
260,
|
|
1003
|
+
308,
|
|
1004
|
+
104,
|
|
1005
|
+
198,
|
|
1006
|
+
288,
|
|
1007
|
+
352,
|
|
1008
|
+
120,
|
|
1009
|
+
216,
|
|
1010
|
+
320,
|
|
1011
|
+
384,
|
|
1012
|
+
132,
|
|
1013
|
+
240,
|
|
1014
|
+
360,
|
|
1015
|
+
432,
|
|
1016
|
+
144,
|
|
1017
|
+
280,
|
|
1018
|
+
408,
|
|
1019
|
+
480,
|
|
1020
|
+
168,
|
|
1021
|
+
308,
|
|
1022
|
+
448,
|
|
1023
|
+
532,
|
|
1024
|
+
180,
|
|
1025
|
+
338,
|
|
1026
|
+
504,
|
|
1027
|
+
588,
|
|
1028
|
+
196,
|
|
1029
|
+
364,
|
|
1030
|
+
546,
|
|
1031
|
+
650,
|
|
1032
|
+
224,
|
|
1033
|
+
416,
|
|
1034
|
+
600,
|
|
1035
|
+
700,
|
|
1036
|
+
224,
|
|
1037
|
+
442,
|
|
1038
|
+
644,
|
|
1039
|
+
750,
|
|
1040
|
+
252,
|
|
1041
|
+
476,
|
|
1042
|
+
690,
|
|
1043
|
+
816,
|
|
1044
|
+
270,
|
|
1045
|
+
504,
|
|
1046
|
+
750,
|
|
1047
|
+
900,
|
|
1048
|
+
300,
|
|
1049
|
+
560,
|
|
1050
|
+
810,
|
|
1051
|
+
960,
|
|
1052
|
+
312,
|
|
1053
|
+
588,
|
|
1054
|
+
870,
|
|
1055
|
+
1050,
|
|
1056
|
+
336,
|
|
1057
|
+
644,
|
|
1058
|
+
952,
|
|
1059
|
+
1110,
|
|
1060
|
+
360,
|
|
1061
|
+
700,
|
|
1062
|
+
1020,
|
|
1063
|
+
1200,
|
|
1064
|
+
390,
|
|
1065
|
+
728,
|
|
1066
|
+
1050,
|
|
1067
|
+
1260,
|
|
1068
|
+
420,
|
|
1069
|
+
784,
|
|
1070
|
+
1140,
|
|
1071
|
+
1350,
|
|
1072
|
+
450,
|
|
1073
|
+
812,
|
|
1074
|
+
1200,
|
|
1075
|
+
1440,
|
|
1076
|
+
480,
|
|
1077
|
+
868,
|
|
1078
|
+
1290,
|
|
1079
|
+
1530,
|
|
1080
|
+
510,
|
|
1081
|
+
924,
|
|
1082
|
+
1350,
|
|
1083
|
+
1620,
|
|
1084
|
+
540,
|
|
1085
|
+
980,
|
|
1086
|
+
1440,
|
|
1087
|
+
1710,
|
|
1088
|
+
570,
|
|
1089
|
+
1036,
|
|
1090
|
+
1530,
|
|
1091
|
+
1800,
|
|
1092
|
+
570,
|
|
1093
|
+
1064,
|
|
1094
|
+
1590,
|
|
1095
|
+
1890,
|
|
1096
|
+
600,
|
|
1097
|
+
1120,
|
|
1098
|
+
1680,
|
|
1099
|
+
1980,
|
|
1100
|
+
630,
|
|
1101
|
+
1204,
|
|
1102
|
+
1770,
|
|
1103
|
+
2100,
|
|
1104
|
+
660,
|
|
1105
|
+
1260,
|
|
1106
|
+
1860,
|
|
1107
|
+
2220,
|
|
1108
|
+
720,
|
|
1109
|
+
1316,
|
|
1110
|
+
1950,
|
|
1111
|
+
2310,
|
|
1112
|
+
750,
|
|
1113
|
+
1372,
|
|
1114
|
+
2040,
|
|
1115
|
+
2430
|
|
1116
|
+
];
|
|
1117
|
+
et.getBlocksCount = function(e, r) {
|
|
1118
|
+
switch (r) {
|
|
1119
|
+
case D.L:
|
|
1120
|
+
return Q[(e - 1) * 4 + 0];
|
|
1121
|
+
case D.M:
|
|
1122
|
+
return Q[(e - 1) * 4 + 1];
|
|
1123
|
+
case D.Q:
|
|
1124
|
+
return Q[(e - 1) * 4 + 2];
|
|
1125
|
+
case D.H:
|
|
1126
|
+
return Q[(e - 1) * 4 + 3];
|
|
1127
|
+
default:
|
|
1128
|
+
return;
|
|
1129
|
+
}
|
|
1130
|
+
};
|
|
1131
|
+
et.getTotalCodewordsCount = function(e, r) {
|
|
1132
|
+
switch (r) {
|
|
1133
|
+
case D.L:
|
|
1134
|
+
return Z[(e - 1) * 4 + 0];
|
|
1135
|
+
case D.M:
|
|
1136
|
+
return Z[(e - 1) * 4 + 1];
|
|
1137
|
+
case D.Q:
|
|
1138
|
+
return Z[(e - 1) * 4 + 2];
|
|
1139
|
+
case D.H:
|
|
1140
|
+
return Z[(e - 1) * 4 + 3];
|
|
1141
|
+
default:
|
|
1142
|
+
return;
|
|
1143
|
+
}
|
|
1144
|
+
};
|
|
1145
|
+
var Kt = {}, nt = {};
|
|
1146
|
+
const J = new Uint8Array(512), X = new Uint8Array(256);
|
|
1147
|
+
(function() {
|
|
1148
|
+
let e = 1;
|
|
1149
|
+
for (let r = 0; r < 255; r++)
|
|
1150
|
+
J[r] = e, X[e] = r, e <<= 1, e & 256 && (e ^= 285);
|
|
1151
|
+
for (let r = 255; r < 512; r++)
|
|
1152
|
+
J[r] = J[r - 255];
|
|
1153
|
+
})();
|
|
1154
|
+
nt.log = function(e) {
|
|
1155
|
+
if (e < 1)
|
|
1156
|
+
throw new Error("log(" + e + ")");
|
|
1157
|
+
return X[e];
|
|
1158
|
+
};
|
|
1159
|
+
nt.exp = function(e) {
|
|
1160
|
+
return J[e];
|
|
1161
|
+
};
|
|
1162
|
+
nt.mul = function(e, r) {
|
|
1163
|
+
return e === 0 || r === 0 ? 0 : J[X[e] + X[r]];
|
|
1164
|
+
};
|
|
1165
|
+
(function(t) {
|
|
1166
|
+
const e = nt;
|
|
1167
|
+
t.mul = function(o, n) {
|
|
1168
|
+
const i = new Uint8Array(o.length + n.length - 1);
|
|
1169
|
+
for (let s = 0; s < o.length; s++)
|
|
1170
|
+
for (let u = 0; u < n.length; u++)
|
|
1171
|
+
i[s + u] ^= e.mul(o[s], n[u]);
|
|
1172
|
+
return i;
|
|
1173
|
+
}, t.mod = function(o, n) {
|
|
1174
|
+
let i = new Uint8Array(o);
|
|
1175
|
+
for (; i.length - n.length >= 0; ) {
|
|
1176
|
+
const s = i[0];
|
|
1177
|
+
for (let a = 0; a < n.length; a++)
|
|
1178
|
+
i[a] ^= e.mul(n[a], s);
|
|
1179
|
+
let u = 0;
|
|
1180
|
+
for (; u < i.length && i[u] === 0; )
|
|
1181
|
+
u++;
|
|
1182
|
+
i = i.slice(u);
|
|
1183
|
+
}
|
|
1184
|
+
return i;
|
|
1185
|
+
}, t.generateECPolynomial = function(o) {
|
|
1186
|
+
let n = new Uint8Array([1]);
|
|
1187
|
+
for (let i = 0; i < o; i++)
|
|
1188
|
+
n = t.mul(n, new Uint8Array([1, e.exp(i)]));
|
|
1189
|
+
return n;
|
|
1190
|
+
};
|
|
1191
|
+
})(Kt);
|
|
1192
|
+
const Wt = Kt;
|
|
1193
|
+
function pt(t) {
|
|
1194
|
+
this.genPoly = void 0, this.degree = t, this.degree && this.initialize(this.degree);
|
|
1195
|
+
}
|
|
1196
|
+
pt.prototype.initialize = function(e) {
|
|
1197
|
+
this.degree = e, this.genPoly = Wt.generateECPolynomial(this.degree);
|
|
1198
|
+
};
|
|
1199
|
+
pt.prototype.encode = function(e) {
|
|
1200
|
+
if (!this.genPoly)
|
|
1201
|
+
throw new Error("Encoder not initialized");
|
|
1202
|
+
const r = new Uint8Array(e.length + this.degree);
|
|
1203
|
+
r.set(e);
|
|
1204
|
+
const o = Wt.mod(r, this.genPoly), n = this.degree - o.length;
|
|
1205
|
+
if (n > 0) {
|
|
1206
|
+
const i = new Uint8Array(this.degree);
|
|
1207
|
+
return i.set(o, n), i;
|
|
1208
|
+
}
|
|
1209
|
+
return o;
|
|
1210
|
+
};
|
|
1211
|
+
var je = pt, Yt = {}, F = {}, yt = {};
|
|
1212
|
+
yt.isValid = function(e) {
|
|
1213
|
+
return !isNaN(e) && e >= 1 && e <= 40;
|
|
1214
|
+
};
|
|
1215
|
+
var R = {};
|
|
1216
|
+
const Gt = "[0-9]+", He = "[A-Z $%*+\\-./:]+";
|
|
1217
|
+
let K = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
1218
|
+
K = K.replace(/u/g, "\\u");
|
|
1219
|
+
const Je = "(?:(?![A-Z0-9 $%*+\\-./:]|" + K + `)(?:.|[\r
|
|
1220
|
+
]))+`;
|
|
1221
|
+
R.KANJI = new RegExp(K, "g");
|
|
1222
|
+
R.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
|
|
1223
|
+
R.BYTE = new RegExp(Je, "g");
|
|
1224
|
+
R.NUMERIC = new RegExp(Gt, "g");
|
|
1225
|
+
R.ALPHANUMERIC = new RegExp(He, "g");
|
|
1226
|
+
const Ke = new RegExp("^" + K + "$"), We = new RegExp("^" + Gt + "$"), Ye = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
1227
|
+
R.testKanji = function(e) {
|
|
1228
|
+
return Ke.test(e);
|
|
1229
|
+
};
|
|
1230
|
+
R.testNumeric = function(e) {
|
|
1231
|
+
return We.test(e);
|
|
1232
|
+
};
|
|
1233
|
+
R.testAlphanumeric = function(e) {
|
|
1234
|
+
return Ye.test(e);
|
|
1235
|
+
};
|
|
1236
|
+
(function(t) {
|
|
1237
|
+
const e = yt, r = R;
|
|
1238
|
+
t.NUMERIC = {
|
|
1239
|
+
id: "Numeric",
|
|
1240
|
+
bit: 1,
|
|
1241
|
+
ccBits: [10, 12, 14]
|
|
1242
|
+
}, t.ALPHANUMERIC = {
|
|
1243
|
+
id: "Alphanumeric",
|
|
1244
|
+
bit: 2,
|
|
1245
|
+
ccBits: [9, 11, 13]
|
|
1246
|
+
}, t.BYTE = {
|
|
1247
|
+
id: "Byte",
|
|
1248
|
+
bit: 4,
|
|
1249
|
+
ccBits: [8, 16, 16]
|
|
1250
|
+
}, t.KANJI = {
|
|
1251
|
+
id: "Kanji",
|
|
1252
|
+
bit: 8,
|
|
1253
|
+
ccBits: [8, 10, 12]
|
|
1254
|
+
}, t.MIXED = {
|
|
1255
|
+
bit: -1
|
|
1256
|
+
}, t.getCharCountIndicator = function(i, s) {
|
|
1257
|
+
if (!i.ccBits)
|
|
1258
|
+
throw new Error("Invalid mode: " + i);
|
|
1259
|
+
if (!e.isValid(s))
|
|
1260
|
+
throw new Error("Invalid version: " + s);
|
|
1261
|
+
return s >= 1 && s < 10 ? i.ccBits[0] : s < 27 ? i.ccBits[1] : i.ccBits[2];
|
|
1262
|
+
}, t.getBestModeForData = function(i) {
|
|
1263
|
+
return r.testNumeric(i) ? t.NUMERIC : r.testAlphanumeric(i) ? t.ALPHANUMERIC : r.testKanji(i) ? t.KANJI : t.BYTE;
|
|
1264
|
+
}, t.toString = function(i) {
|
|
1265
|
+
if (i && i.id)
|
|
1266
|
+
return i.id;
|
|
1267
|
+
throw new Error("Invalid mode");
|
|
1268
|
+
}, t.isValid = function(i) {
|
|
1269
|
+
return i && i.bit && i.ccBits;
|
|
1270
|
+
};
|
|
1271
|
+
function o(n) {
|
|
1272
|
+
if (typeof n != "string")
|
|
1273
|
+
throw new Error("Param is not a string");
|
|
1274
|
+
switch (n.toLowerCase()) {
|
|
1275
|
+
case "numeric":
|
|
1276
|
+
return t.NUMERIC;
|
|
1277
|
+
case "alphanumeric":
|
|
1278
|
+
return t.ALPHANUMERIC;
|
|
1279
|
+
case "kanji":
|
|
1280
|
+
return t.KANJI;
|
|
1281
|
+
case "byte":
|
|
1282
|
+
return t.BYTE;
|
|
1283
|
+
default:
|
|
1284
|
+
throw new Error("Unknown mode: " + n);
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
t.from = function(i, s) {
|
|
1288
|
+
if (t.isValid(i))
|
|
1289
|
+
return i;
|
|
1290
|
+
try {
|
|
1291
|
+
return o(i);
|
|
1292
|
+
} catch {
|
|
1293
|
+
return s;
|
|
1294
|
+
}
|
|
1295
|
+
};
|
|
1296
|
+
})(F);
|
|
1297
|
+
(function(t) {
|
|
1298
|
+
const e = T, r = et, o = tt, n = F, i = yt, s = 7973, u = e.getBCHDigit(s);
|
|
1299
|
+
function a(g, d, w) {
|
|
1300
|
+
for (let p = 1; p <= 40; p++)
|
|
1301
|
+
if (d <= t.getCapacity(p, w, g))
|
|
1302
|
+
return p;
|
|
1303
|
+
}
|
|
1304
|
+
function l(g, d) {
|
|
1305
|
+
return n.getCharCountIndicator(g, d) + 4;
|
|
1306
|
+
}
|
|
1307
|
+
function c(g, d) {
|
|
1308
|
+
let w = 0;
|
|
1309
|
+
return g.forEach(function(p) {
|
|
1310
|
+
const B = l(p.mode, d);
|
|
1311
|
+
w += B + p.getBitsLength();
|
|
1312
|
+
}), w;
|
|
1313
|
+
}
|
|
1314
|
+
function h(g, d) {
|
|
1315
|
+
for (let w = 1; w <= 40; w++)
|
|
1316
|
+
if (c(g, w) <= t.getCapacity(w, d, n.MIXED))
|
|
1317
|
+
return w;
|
|
1318
|
+
}
|
|
1319
|
+
t.from = function(d, w) {
|
|
1320
|
+
return i.isValid(d) ? parseInt(d, 10) : w;
|
|
1321
|
+
}, t.getCapacity = function(d, w, p) {
|
|
1322
|
+
if (!i.isValid(d))
|
|
1323
|
+
throw new Error("Invalid QR Code version");
|
|
1324
|
+
typeof p > "u" && (p = n.BYTE);
|
|
1325
|
+
const B = e.getSymbolTotalCodewords(d), y = r.getTotalCodewordsCount(d, w), E = (B - y) * 8;
|
|
1326
|
+
if (p === n.MIXED)
|
|
1327
|
+
return E;
|
|
1328
|
+
const m = E - l(p, d);
|
|
1329
|
+
switch (p) {
|
|
1330
|
+
case n.NUMERIC:
|
|
1331
|
+
return Math.floor(m / 10 * 3);
|
|
1332
|
+
case n.ALPHANUMERIC:
|
|
1333
|
+
return Math.floor(m / 11 * 2);
|
|
1334
|
+
case n.KANJI:
|
|
1335
|
+
return Math.floor(m / 13);
|
|
1336
|
+
case n.BYTE:
|
|
1337
|
+
default:
|
|
1338
|
+
return Math.floor(m / 8);
|
|
1339
|
+
}
|
|
1340
|
+
}, t.getBestVersionForData = function(d, w) {
|
|
1341
|
+
let p;
|
|
1342
|
+
const B = o.from(w, o.M);
|
|
1343
|
+
if (Array.isArray(d)) {
|
|
1344
|
+
if (d.length > 1)
|
|
1345
|
+
return h(d, B);
|
|
1346
|
+
if (d.length === 0)
|
|
1347
|
+
return 1;
|
|
1348
|
+
p = d[0];
|
|
1349
|
+
} else
|
|
1350
|
+
p = d;
|
|
1351
|
+
return a(p.mode, p.getLength(), B);
|
|
1352
|
+
}, t.getEncodedBits = function(d) {
|
|
1353
|
+
if (!i.isValid(d) || d < 7)
|
|
1354
|
+
throw new Error("Invalid QR Code version");
|
|
1355
|
+
let w = d << 12;
|
|
1356
|
+
for (; e.getBCHDigit(w) - u >= 0; )
|
|
1357
|
+
w ^= s << e.getBCHDigit(w) - u;
|
|
1358
|
+
return d << 12 | w;
|
|
1359
|
+
};
|
|
1360
|
+
})(Yt);
|
|
1361
|
+
var qt = {};
|
|
1362
|
+
const ct = T, Qt = 1335, Ge = 21522, vt = ct.getBCHDigit(Qt);
|
|
1363
|
+
qt.getEncodedBits = function(e, r) {
|
|
1364
|
+
const o = e.bit << 3 | r;
|
|
1365
|
+
let n = o << 10;
|
|
1366
|
+
for (; ct.getBCHDigit(n) - vt >= 0; )
|
|
1367
|
+
n ^= Qt << ct.getBCHDigit(n) - vt;
|
|
1368
|
+
return (o << 10 | n) ^ Ge;
|
|
1369
|
+
};
|
|
1370
|
+
var Zt = {};
|
|
1371
|
+
const qe = F;
|
|
1372
|
+
function V(t) {
|
|
1373
|
+
this.mode = qe.NUMERIC, this.data = t.toString();
|
|
1374
|
+
}
|
|
1375
|
+
V.getBitsLength = function(e) {
|
|
1376
|
+
return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0);
|
|
1377
|
+
};
|
|
1378
|
+
V.prototype.getLength = function() {
|
|
1379
|
+
return this.data.length;
|
|
1380
|
+
};
|
|
1381
|
+
V.prototype.getBitsLength = function() {
|
|
1382
|
+
return V.getBitsLength(this.data.length);
|
|
1383
|
+
};
|
|
1384
|
+
V.prototype.write = function(e) {
|
|
1385
|
+
let r, o, n;
|
|
1386
|
+
for (r = 0; r + 3 <= this.data.length; r += 3)
|
|
1387
|
+
o = this.data.substr(r, 3), n = parseInt(o, 10), e.put(n, 10);
|
|
1388
|
+
const i = this.data.length - r;
|
|
1389
|
+
i > 0 && (o = this.data.substr(r), n = parseInt(o, 10), e.put(n, i * 3 + 1));
|
|
1390
|
+
};
|
|
1391
|
+
var Qe = V;
|
|
1392
|
+
const Ze = F, ot = [
|
|
1393
|
+
"0",
|
|
1394
|
+
"1",
|
|
1395
|
+
"2",
|
|
1396
|
+
"3",
|
|
1397
|
+
"4",
|
|
1398
|
+
"5",
|
|
1399
|
+
"6",
|
|
1400
|
+
"7",
|
|
1401
|
+
"8",
|
|
1402
|
+
"9",
|
|
1403
|
+
"A",
|
|
1404
|
+
"B",
|
|
1405
|
+
"C",
|
|
1406
|
+
"D",
|
|
1407
|
+
"E",
|
|
1408
|
+
"F",
|
|
1409
|
+
"G",
|
|
1410
|
+
"H",
|
|
1411
|
+
"I",
|
|
1412
|
+
"J",
|
|
1413
|
+
"K",
|
|
1414
|
+
"L",
|
|
1415
|
+
"M",
|
|
1416
|
+
"N",
|
|
1417
|
+
"O",
|
|
1418
|
+
"P",
|
|
1419
|
+
"Q",
|
|
1420
|
+
"R",
|
|
1421
|
+
"S",
|
|
1422
|
+
"T",
|
|
1423
|
+
"U",
|
|
1424
|
+
"V",
|
|
1425
|
+
"W",
|
|
1426
|
+
"X",
|
|
1427
|
+
"Y",
|
|
1428
|
+
"Z",
|
|
1429
|
+
" ",
|
|
1430
|
+
"$",
|
|
1431
|
+
"%",
|
|
1432
|
+
"*",
|
|
1433
|
+
"+",
|
|
1434
|
+
"-",
|
|
1435
|
+
".",
|
|
1436
|
+
"/",
|
|
1437
|
+
":"
|
|
1438
|
+
];
|
|
1439
|
+
function $(t) {
|
|
1440
|
+
this.mode = Ze.ALPHANUMERIC, this.data = t;
|
|
1441
|
+
}
|
|
1442
|
+
$.getBitsLength = function(e) {
|
|
1443
|
+
return 11 * Math.floor(e / 2) + 6 * (e % 2);
|
|
1444
|
+
};
|
|
1445
|
+
$.prototype.getLength = function() {
|
|
1446
|
+
return this.data.length;
|
|
1447
|
+
};
|
|
1448
|
+
$.prototype.getBitsLength = function() {
|
|
1449
|
+
return $.getBitsLength(this.data.length);
|
|
1450
|
+
};
|
|
1451
|
+
$.prototype.write = function(e) {
|
|
1452
|
+
let r;
|
|
1453
|
+
for (r = 0; r + 2 <= this.data.length; r += 2) {
|
|
1454
|
+
let o = ot.indexOf(this.data[r]) * 45;
|
|
1455
|
+
o += ot.indexOf(this.data[r + 1]), e.put(o, 11);
|
|
1456
|
+
}
|
|
1457
|
+
this.data.length % 2 && e.put(ot.indexOf(this.data[r]), 6);
|
|
1458
|
+
};
|
|
1459
|
+
var Xe = $;
|
|
1460
|
+
const xe = F;
|
|
1461
|
+
function j(t) {
|
|
1462
|
+
this.mode = xe.BYTE, typeof t == "string" ? this.data = new TextEncoder().encode(t) : this.data = new Uint8Array(t);
|
|
1463
|
+
}
|
|
1464
|
+
j.getBitsLength = function(e) {
|
|
1465
|
+
return e * 8;
|
|
1466
|
+
};
|
|
1467
|
+
j.prototype.getLength = function() {
|
|
1468
|
+
return this.data.length;
|
|
1469
|
+
};
|
|
1470
|
+
j.prototype.getBitsLength = function() {
|
|
1471
|
+
return j.getBitsLength(this.data.length);
|
|
1472
|
+
};
|
|
1473
|
+
j.prototype.write = function(t) {
|
|
1474
|
+
for (let e = 0, r = this.data.length; e < r; e++)
|
|
1475
|
+
t.put(this.data[e], 8);
|
|
1476
|
+
};
|
|
1477
|
+
var tn = j;
|
|
1478
|
+
const en = F, nn = T;
|
|
1479
|
+
function H(t) {
|
|
1480
|
+
this.mode = en.KANJI, this.data = t;
|
|
1481
|
+
}
|
|
1482
|
+
H.getBitsLength = function(e) {
|
|
1483
|
+
return e * 13;
|
|
1484
|
+
};
|
|
1485
|
+
H.prototype.getLength = function() {
|
|
1486
|
+
return this.data.length;
|
|
1487
|
+
};
|
|
1488
|
+
H.prototype.getBitsLength = function() {
|
|
1489
|
+
return H.getBitsLength(this.data.length);
|
|
1490
|
+
};
|
|
1491
|
+
H.prototype.write = function(t) {
|
|
1492
|
+
let e;
|
|
1493
|
+
for (e = 0; e < this.data.length; e++) {
|
|
1494
|
+
let r = nn.toSJIS(this.data[e]);
|
|
1495
|
+
if (r >= 33088 && r <= 40956)
|
|
1496
|
+
r -= 33088;
|
|
1497
|
+
else if (r >= 57408 && r <= 60351)
|
|
1498
|
+
r -= 49472;
|
|
1499
|
+
else
|
|
1500
|
+
throw new Error(
|
|
1501
|
+
"Invalid SJIS character: " + this.data[e] + `
|
|
1502
|
+
Make sure your charset is UTF-8`
|
|
1503
|
+
);
|
|
1504
|
+
r = (r >>> 8 & 255) * 192 + (r & 255), t.put(r, 13);
|
|
1505
|
+
}
|
|
1506
|
+
};
|
|
1507
|
+
var rn = H, Xt = { exports: {} };
|
|
1508
|
+
(function(t) {
|
|
1509
|
+
var e = {
|
|
1510
|
+
single_source_shortest_paths: function(r, o, n) {
|
|
1511
|
+
var i = {}, s = {};
|
|
1512
|
+
s[o] = 0;
|
|
1513
|
+
var u = e.PriorityQueue.make();
|
|
1514
|
+
u.push(o, 0);
|
|
1515
|
+
for (var a, l, c, h, g, d, w, p, B; !u.empty(); ) {
|
|
1516
|
+
a = u.pop(), l = a.value, h = a.cost, g = r[l] || {};
|
|
1517
|
+
for (c in g)
|
|
1518
|
+
g.hasOwnProperty(c) && (d = g[c], w = h + d, p = s[c], B = typeof s[c] > "u", (B || p > w) && (s[c] = w, u.push(c, w), i[c] = l));
|
|
1519
|
+
}
|
|
1520
|
+
if (typeof n < "u" && typeof s[n] > "u") {
|
|
1521
|
+
var y = ["Could not find a path from ", o, " to ", n, "."].join("");
|
|
1522
|
+
throw new Error(y);
|
|
1523
|
+
}
|
|
1524
|
+
return i;
|
|
1525
|
+
},
|
|
1526
|
+
extract_shortest_path_from_predecessor_list: function(r, o) {
|
|
1527
|
+
for (var n = [], i = o; i; )
|
|
1528
|
+
n.push(i), r[i], i = r[i];
|
|
1529
|
+
return n.reverse(), n;
|
|
1530
|
+
},
|
|
1531
|
+
find_path: function(r, o, n) {
|
|
1532
|
+
var i = e.single_source_shortest_paths(r, o, n);
|
|
1533
|
+
return e.extract_shortest_path_from_predecessor_list(
|
|
1534
|
+
i,
|
|
1535
|
+
n
|
|
1536
|
+
);
|
|
1537
|
+
},
|
|
1538
|
+
/**
|
|
1539
|
+
* A very naive priority queue implementation.
|
|
1540
|
+
*/
|
|
1541
|
+
PriorityQueue: {
|
|
1542
|
+
make: function(r) {
|
|
1543
|
+
var o = e.PriorityQueue, n = {}, i;
|
|
1544
|
+
r = r || {};
|
|
1545
|
+
for (i in o)
|
|
1546
|
+
o.hasOwnProperty(i) && (n[i] = o[i]);
|
|
1547
|
+
return n.queue = [], n.sorter = r.sorter || o.default_sorter, n;
|
|
1548
|
+
},
|
|
1549
|
+
default_sorter: function(r, o) {
|
|
1550
|
+
return r.cost - o.cost;
|
|
1551
|
+
},
|
|
1552
|
+
/**
|
|
1553
|
+
* Add a new item to the queue and ensure the highest priority element
|
|
1554
|
+
* is at the front of the queue.
|
|
1555
|
+
*/
|
|
1556
|
+
push: function(r, o) {
|
|
1557
|
+
var n = { value: r, cost: o };
|
|
1558
|
+
this.queue.push(n), this.queue.sort(this.sorter);
|
|
1559
|
+
},
|
|
1560
|
+
/**
|
|
1561
|
+
* Return the highest priority element in the queue.
|
|
1562
|
+
*/
|
|
1563
|
+
pop: function() {
|
|
1564
|
+
return this.queue.shift();
|
|
1565
|
+
},
|
|
1566
|
+
empty: function() {
|
|
1567
|
+
return this.queue.length === 0;
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
};
|
|
1571
|
+
t.exports = e;
|
|
1572
|
+
})(Xt);
|
|
1573
|
+
var on = Xt.exports;
|
|
1574
|
+
(function(t) {
|
|
1575
|
+
const e = F, r = Qe, o = Xe, n = tn, i = rn, s = R, u = T, a = on;
|
|
1576
|
+
function l(y) {
|
|
1577
|
+
return unescape(encodeURIComponent(y)).length;
|
|
1578
|
+
}
|
|
1579
|
+
function c(y, E, m) {
|
|
1580
|
+
const f = [];
|
|
1581
|
+
let b;
|
|
1582
|
+
for (; (b = y.exec(m)) !== null; )
|
|
1583
|
+
f.push({
|
|
1584
|
+
data: b[0],
|
|
1585
|
+
index: b.index,
|
|
1586
|
+
mode: E,
|
|
1587
|
+
length: b[0].length
|
|
1588
|
+
});
|
|
1589
|
+
return f;
|
|
1590
|
+
}
|
|
1591
|
+
function h(y) {
|
|
1592
|
+
const E = c(s.NUMERIC, e.NUMERIC, y), m = c(s.ALPHANUMERIC, e.ALPHANUMERIC, y);
|
|
1593
|
+
let f, b;
|
|
1594
|
+
return u.isKanjiModeEnabled() ? (f = c(s.BYTE, e.BYTE, y), b = c(s.KANJI, e.KANJI, y)) : (f = c(s.BYTE_KANJI, e.BYTE, y), b = []), E.concat(m, f, b).sort(function(S, A) {
|
|
1595
|
+
return S.index - A.index;
|
|
1596
|
+
}).map(function(S) {
|
|
1597
|
+
return {
|
|
1598
|
+
data: S.data,
|
|
1599
|
+
mode: S.mode,
|
|
1600
|
+
length: S.length
|
|
1601
|
+
};
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1604
|
+
function g(y, E) {
|
|
1605
|
+
switch (E) {
|
|
1606
|
+
case e.NUMERIC:
|
|
1607
|
+
return r.getBitsLength(y);
|
|
1608
|
+
case e.ALPHANUMERIC:
|
|
1609
|
+
return o.getBitsLength(y);
|
|
1610
|
+
case e.KANJI:
|
|
1611
|
+
return i.getBitsLength(y);
|
|
1612
|
+
case e.BYTE:
|
|
1613
|
+
return n.getBitsLength(y);
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
function d(y) {
|
|
1617
|
+
return y.reduce(function(E, m) {
|
|
1618
|
+
const f = E.length - 1 >= 0 ? E[E.length - 1] : null;
|
|
1619
|
+
return f && f.mode === m.mode ? (E[E.length - 1].data += m.data, E) : (E.push(m), E);
|
|
1620
|
+
}, []);
|
|
1621
|
+
}
|
|
1622
|
+
function w(y) {
|
|
1623
|
+
const E = [];
|
|
1624
|
+
for (let m = 0; m < y.length; m++) {
|
|
1625
|
+
const f = y[m];
|
|
1626
|
+
switch (f.mode) {
|
|
1627
|
+
case e.NUMERIC:
|
|
1628
|
+
E.push([
|
|
1629
|
+
f,
|
|
1630
|
+
{ data: f.data, mode: e.ALPHANUMERIC, length: f.length },
|
|
1631
|
+
{ data: f.data, mode: e.BYTE, length: f.length }
|
|
1632
|
+
]);
|
|
1633
|
+
break;
|
|
1634
|
+
case e.ALPHANUMERIC:
|
|
1635
|
+
E.push([
|
|
1636
|
+
f,
|
|
1637
|
+
{ data: f.data, mode: e.BYTE, length: f.length }
|
|
1638
|
+
]);
|
|
1639
|
+
break;
|
|
1640
|
+
case e.KANJI:
|
|
1641
|
+
E.push([
|
|
1642
|
+
f,
|
|
1643
|
+
{ data: f.data, mode: e.BYTE, length: l(f.data) }
|
|
1644
|
+
]);
|
|
1645
|
+
break;
|
|
1646
|
+
case e.BYTE:
|
|
1647
|
+
E.push([
|
|
1648
|
+
{ data: f.data, mode: e.BYTE, length: l(f.data) }
|
|
1649
|
+
]);
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
return E;
|
|
1653
|
+
}
|
|
1654
|
+
function p(y, E) {
|
|
1655
|
+
const m = {}, f = { start: {} };
|
|
1656
|
+
let b = ["start"];
|
|
1657
|
+
for (let M = 0; M < y.length; M++) {
|
|
1658
|
+
const S = y[M], A = [];
|
|
1659
|
+
for (let N = 0; N < S.length; N++) {
|
|
1660
|
+
const C = S[N], v = "" + M + N;
|
|
1661
|
+
A.push(v), m[v] = { node: C, lastCount: 0 }, f[v] = {};
|
|
1662
|
+
for (let I = 0; I < b.length; I++) {
|
|
1663
|
+
const P = b[I];
|
|
1664
|
+
m[P] && m[P].node.mode === C.mode ? (f[P][v] = g(m[P].lastCount + C.length, C.mode) - g(m[P].lastCount, C.mode), m[P].lastCount += C.length) : (m[P] && (m[P].lastCount = C.length), f[P][v] = g(C.length, C.mode) + 4 + e.getCharCountIndicator(C.mode, E));
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
b = A;
|
|
1668
|
+
}
|
|
1669
|
+
for (let M = 0; M < b.length; M++)
|
|
1670
|
+
f[b[M]].end = 0;
|
|
1671
|
+
return { map: f, table: m };
|
|
1672
|
+
}
|
|
1673
|
+
function B(y, E) {
|
|
1674
|
+
let m;
|
|
1675
|
+
const f = e.getBestModeForData(y);
|
|
1676
|
+
if (m = e.from(E, f), m !== e.BYTE && m.bit < f.bit)
|
|
1677
|
+
throw new Error('"' + y + '" cannot be encoded with mode ' + e.toString(m) + `.
|
|
1678
|
+
Suggested mode is: ` + e.toString(f));
|
|
1679
|
+
switch (m === e.KANJI && !u.isKanjiModeEnabled() && (m = e.BYTE), m) {
|
|
1680
|
+
case e.NUMERIC:
|
|
1681
|
+
return new r(y);
|
|
1682
|
+
case e.ALPHANUMERIC:
|
|
1683
|
+
return new o(y);
|
|
1684
|
+
case e.KANJI:
|
|
1685
|
+
return new i(y);
|
|
1686
|
+
case e.BYTE:
|
|
1687
|
+
return new n(y);
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
t.fromArray = function(E) {
|
|
1691
|
+
return E.reduce(function(m, f) {
|
|
1692
|
+
return typeof f == "string" ? m.push(B(f, null)) : f.data && m.push(B(f.data, f.mode)), m;
|
|
1693
|
+
}, []);
|
|
1694
|
+
}, t.fromString = function(E, m) {
|
|
1695
|
+
const f = h(E, u.isKanjiModeEnabled()), b = w(f), M = p(b, m), S = a.find_path(M.map, "start", "end"), A = [];
|
|
1696
|
+
for (let N = 1; N < S.length - 1; N++)
|
|
1697
|
+
A.push(M.table[S[N]].node);
|
|
1698
|
+
return t.fromArray(d(A));
|
|
1699
|
+
}, t.rawSplit = function(E) {
|
|
1700
|
+
return t.fromArray(
|
|
1701
|
+
h(E, u.isKanjiModeEnabled())
|
|
1702
|
+
);
|
|
1703
|
+
};
|
|
1704
|
+
})(Zt);
|
|
1705
|
+
const rt = T, it = tt, sn = ze, un = Ve, an = jt, cn = Ht, lt = Jt, ft = et, ln = je, x = Yt, fn = qt, dn = F, st = Zt;
|
|
1706
|
+
function hn(t, e) {
|
|
1707
|
+
const r = t.size, o = cn.getPositions(e);
|
|
1708
|
+
for (let n = 0; n < o.length; n++) {
|
|
1709
|
+
const i = o[n][0], s = o[n][1];
|
|
1710
|
+
for (let u = -1; u <= 7; u++)
|
|
1711
|
+
if (!(i + u <= -1 || r <= i + u))
|
|
1712
|
+
for (let a = -1; a <= 7; a++)
|
|
1713
|
+
s + a <= -1 || r <= s + a || (u >= 0 && u <= 6 && (a === 0 || a === 6) || a >= 0 && a <= 6 && (u === 0 || u === 6) || u >= 2 && u <= 4 && a >= 2 && a <= 4 ? t.set(i + u, s + a, !0, !0) : t.set(i + u, s + a, !1, !0));
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
function gn(t) {
|
|
1717
|
+
const e = t.size;
|
|
1718
|
+
for (let r = 8; r < e - 8; r++) {
|
|
1719
|
+
const o = r % 2 === 0;
|
|
1720
|
+
t.set(r, 6, o, !0), t.set(6, r, o, !0);
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
function mn(t, e) {
|
|
1724
|
+
const r = an.getPositions(e);
|
|
1725
|
+
for (let o = 0; o < r.length; o++) {
|
|
1726
|
+
const n = r[o][0], i = r[o][1];
|
|
1727
|
+
for (let s = -2; s <= 2; s++)
|
|
1728
|
+
for (let u = -2; u <= 2; u++)
|
|
1729
|
+
s === -2 || s === 2 || u === -2 || u === 2 || s === 0 && u === 0 ? t.set(n + s, i + u, !0, !0) : t.set(n + s, i + u, !1, !0);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
function wn(t, e) {
|
|
1733
|
+
const r = t.size, o = x.getEncodedBits(e);
|
|
1734
|
+
let n, i, s;
|
|
1735
|
+
for (let u = 0; u < 18; u++)
|
|
1736
|
+
n = Math.floor(u / 3), i = u % 3 + r - 8 - 3, s = (o >> u & 1) === 1, t.set(n, i, s, !0), t.set(i, n, s, !0);
|
|
1737
|
+
}
|
|
1738
|
+
function ut(t, e, r) {
|
|
1739
|
+
const o = t.size, n = fn.getEncodedBits(e, r);
|
|
1740
|
+
let i, s;
|
|
1741
|
+
for (i = 0; i < 15; i++)
|
|
1742
|
+
s = (n >> i & 1) === 1, i < 6 ? t.set(i, 8, s, !0) : i < 8 ? t.set(i + 1, 8, s, !0) : t.set(o - 15 + i, 8, s, !0), i < 8 ? t.set(8, o - i - 1, s, !0) : i < 9 ? t.set(8, 15 - i - 1 + 1, s, !0) : t.set(8, 15 - i - 1, s, !0);
|
|
1743
|
+
t.set(o - 8, 8, 1, !0);
|
|
1744
|
+
}
|
|
1745
|
+
function pn(t, e) {
|
|
1746
|
+
const r = t.size;
|
|
1747
|
+
let o = -1, n = r - 1, i = 7, s = 0;
|
|
1748
|
+
for (let u = r - 1; u > 0; u -= 2)
|
|
1749
|
+
for (u === 6 && u--; ; ) {
|
|
1750
|
+
for (let a = 0; a < 2; a++)
|
|
1751
|
+
if (!t.isReserved(n, u - a)) {
|
|
1752
|
+
let l = !1;
|
|
1753
|
+
s < e.length && (l = (e[s] >>> i & 1) === 1), t.set(n, u - a, l), i--, i === -1 && (s++, i = 7);
|
|
1754
|
+
}
|
|
1755
|
+
if (n += o, n < 0 || r <= n) {
|
|
1756
|
+
n -= o, o = -o;
|
|
1757
|
+
break;
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
function yn(t, e, r) {
|
|
1762
|
+
const o = new sn();
|
|
1763
|
+
r.forEach(function(a) {
|
|
1764
|
+
o.put(a.mode.bit, 4), o.put(a.getLength(), dn.getCharCountIndicator(a.mode, t)), a.write(o);
|
|
1765
|
+
});
|
|
1766
|
+
const n = rt.getSymbolTotalCodewords(t), i = ft.getTotalCodewordsCount(t, e), s = (n - i) * 8;
|
|
1767
|
+
for (o.getLengthInBits() + 4 <= s && o.put(0, 4); o.getLengthInBits() % 8 !== 0; )
|
|
1768
|
+
o.putBit(0);
|
|
1769
|
+
const u = (s - o.getLengthInBits()) / 8;
|
|
1770
|
+
for (let a = 0; a < u; a++)
|
|
1771
|
+
o.put(a % 2 ? 17 : 236, 8);
|
|
1772
|
+
return Cn(o, t, e);
|
|
1773
|
+
}
|
|
1774
|
+
function Cn(t, e, r) {
|
|
1775
|
+
const o = rt.getSymbolTotalCodewords(e), n = ft.getTotalCodewordsCount(e, r), i = o - n, s = ft.getBlocksCount(e, r), u = o % s, a = s - u, l = Math.floor(o / s), c = Math.floor(i / s), h = c + 1, g = l - c, d = new ln(g);
|
|
1776
|
+
let w = 0;
|
|
1777
|
+
const p = new Array(s), B = new Array(s);
|
|
1778
|
+
let y = 0;
|
|
1779
|
+
const E = new Uint8Array(t.buffer);
|
|
1780
|
+
for (let S = 0; S < s; S++) {
|
|
1781
|
+
const A = S < a ? c : h;
|
|
1782
|
+
p[S] = E.slice(w, w + A), B[S] = d.encode(p[S]), w += A, y = Math.max(y, A);
|
|
1783
|
+
}
|
|
1784
|
+
const m = new Uint8Array(o);
|
|
1785
|
+
let f = 0, b, M;
|
|
1786
|
+
for (b = 0; b < y; b++)
|
|
1787
|
+
for (M = 0; M < s; M++)
|
|
1788
|
+
b < p[M].length && (m[f++] = p[M][b]);
|
|
1789
|
+
for (b = 0; b < g; b++)
|
|
1790
|
+
for (M = 0; M < s; M++)
|
|
1791
|
+
m[f++] = B[M][b];
|
|
1792
|
+
return m;
|
|
1793
|
+
}
|
|
1794
|
+
function En(t, e, r, o) {
|
|
1795
|
+
let n;
|
|
1796
|
+
if (Array.isArray(t))
|
|
1797
|
+
n = st.fromArray(t);
|
|
1798
|
+
else if (typeof t == "string") {
|
|
1799
|
+
let l = e;
|
|
1800
|
+
if (!l) {
|
|
1801
|
+
const c = st.rawSplit(t);
|
|
1802
|
+
l = x.getBestVersionForData(c, r);
|
|
1803
|
+
}
|
|
1804
|
+
n = st.fromString(t, l || 40);
|
|
1805
|
+
} else
|
|
1806
|
+
throw new Error("Invalid data");
|
|
1807
|
+
const i = x.getBestVersionForData(n, r);
|
|
1808
|
+
if (!i)
|
|
1809
|
+
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
1810
|
+
if (!e)
|
|
1811
|
+
e = i;
|
|
1812
|
+
else if (e < i)
|
|
1813
|
+
throw new Error(
|
|
1814
|
+
`
|
|
1815
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
1816
|
+
Minimum version required to store current data is: ` + i + `.
|
|
1817
|
+
`
|
|
1818
|
+
);
|
|
1819
|
+
const s = yn(e, r, n), u = rt.getSymbolSize(e), a = new un(u);
|
|
1820
|
+
return hn(a, e), gn(a), mn(a, e), ut(a, r, 0), e >= 7 && wn(a, e), pn(a, s), isNaN(o) && (o = lt.getBestMask(
|
|
1821
|
+
a,
|
|
1822
|
+
ut.bind(null, a, r)
|
|
1823
|
+
)), lt.applyMask(o, a), ut(a, r, o), {
|
|
1824
|
+
modules: a,
|
|
1825
|
+
version: e,
|
|
1826
|
+
errorCorrectionLevel: r,
|
|
1827
|
+
maskPattern: o,
|
|
1828
|
+
segments: n
|
|
1829
|
+
};
|
|
1830
|
+
}
|
|
1831
|
+
Vt.create = function(e, r) {
|
|
1832
|
+
if (typeof e > "u" || e === "")
|
|
1833
|
+
throw new Error("No input text");
|
|
1834
|
+
let o = it.M, n, i;
|
|
1835
|
+
return typeof r < "u" && (o = it.from(r.errorCorrectionLevel, it.M), n = x.from(r.version), i = lt.from(r.maskPattern), r.toSJISFunc && rt.setToSJISFunction(r.toSJISFunc)), En(e, n, o, i);
|
|
1836
|
+
};
|
|
1837
|
+
var xt = {}, Ct = {};
|
|
1838
|
+
(function(t) {
|
|
1839
|
+
function e(r) {
|
|
1840
|
+
if (typeof r == "number" && (r = r.toString()), typeof r != "string")
|
|
1841
|
+
throw new Error("Color should be defined as hex string");
|
|
1842
|
+
let o = r.slice().replace("#", "").split("");
|
|
1843
|
+
if (o.length < 3 || o.length === 5 || o.length > 8)
|
|
1844
|
+
throw new Error("Invalid hex color: " + r);
|
|
1845
|
+
(o.length === 3 || o.length === 4) && (o = Array.prototype.concat.apply([], o.map(function(i) {
|
|
1846
|
+
return [i, i];
|
|
1847
|
+
}))), o.length === 6 && o.push("F", "F");
|
|
1848
|
+
const n = parseInt(o.join(""), 16);
|
|
1849
|
+
return {
|
|
1850
|
+
r: n >> 24 & 255,
|
|
1851
|
+
g: n >> 16 & 255,
|
|
1852
|
+
b: n >> 8 & 255,
|
|
1853
|
+
a: n & 255,
|
|
1854
|
+
hex: "#" + o.slice(0, 6).join("")
|
|
1855
|
+
};
|
|
1856
|
+
}
|
|
1857
|
+
t.getOptions = function(o) {
|
|
1858
|
+
o || (o = {}), o.color || (o.color = {});
|
|
1859
|
+
const n = typeof o.margin > "u" || o.margin === null || o.margin < 0 ? 4 : o.margin, i = o.width && o.width >= 21 ? o.width : void 0, s = o.scale || 4;
|
|
1860
|
+
return {
|
|
1861
|
+
width: i,
|
|
1862
|
+
scale: i ? 4 : s,
|
|
1863
|
+
margin: n,
|
|
1864
|
+
color: {
|
|
1865
|
+
dark: e(o.color.dark || "#000000ff"),
|
|
1866
|
+
light: e(o.color.light || "#ffffffff")
|
|
1867
|
+
},
|
|
1868
|
+
type: o.type,
|
|
1869
|
+
rendererOpts: o.rendererOpts || {}
|
|
1870
|
+
};
|
|
1871
|
+
}, t.getScale = function(o, n) {
|
|
1872
|
+
return n.width && n.width >= o + n.margin * 2 ? n.width / (o + n.margin * 2) : n.scale;
|
|
1873
|
+
}, t.getImageWidth = function(o, n) {
|
|
1874
|
+
const i = t.getScale(o, n);
|
|
1875
|
+
return Math.floor((o + n.margin * 2) * i);
|
|
1876
|
+
}, t.qrToImageData = function(o, n, i) {
|
|
1877
|
+
const s = n.modules.size, u = n.modules.data, a = t.getScale(s, i), l = Math.floor((s + i.margin * 2) * a), c = i.margin * a, h = [i.color.light, i.color.dark];
|
|
1878
|
+
for (let g = 0; g < l; g++)
|
|
1879
|
+
for (let d = 0; d < l; d++) {
|
|
1880
|
+
let w = (g * l + d) * 4, p = i.color.light;
|
|
1881
|
+
if (g >= c && d >= c && g < l - c && d < l - c) {
|
|
1882
|
+
const B = Math.floor((g - c) / a), y = Math.floor((d - c) / a);
|
|
1883
|
+
p = h[u[B * s + y] ? 1 : 0];
|
|
1884
|
+
}
|
|
1885
|
+
o[w++] = p.r, o[w++] = p.g, o[w++] = p.b, o[w] = p.a;
|
|
1886
|
+
}
|
|
1887
|
+
};
|
|
1888
|
+
})(Ct);
|
|
1889
|
+
(function(t) {
|
|
1890
|
+
const e = Ct;
|
|
1891
|
+
function r(n, i, s) {
|
|
1892
|
+
n.clearRect(0, 0, i.width, i.height), i.style || (i.style = {}), i.height = s, i.width = s, i.style.height = s + "px", i.style.width = s + "px";
|
|
1893
|
+
}
|
|
1894
|
+
function o() {
|
|
1895
|
+
try {
|
|
1896
|
+
return document.createElement("canvas");
|
|
1897
|
+
} catch {
|
|
1898
|
+
throw new Error("You need to specify a canvas element");
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
t.render = function(i, s, u) {
|
|
1902
|
+
let a = u, l = s;
|
|
1903
|
+
typeof a > "u" && (!s || !s.getContext) && (a = s, s = void 0), s || (l = o()), a = e.getOptions(a);
|
|
1904
|
+
const c = e.getImageWidth(i.modules.size, a), h = l.getContext("2d"), g = h.createImageData(c, c);
|
|
1905
|
+
return e.qrToImageData(g.data, i, a), r(h, l, c), h.putImageData(g, 0, 0), l;
|
|
1906
|
+
}, t.renderToDataURL = function(i, s, u) {
|
|
1907
|
+
let a = u;
|
|
1908
|
+
typeof a > "u" && (!s || !s.getContext) && (a = s, s = void 0), a || (a = {});
|
|
1909
|
+
const l = t.render(i, s, a), c = a.type || "image/png", h = a.rendererOpts || {};
|
|
1910
|
+
return l.toDataURL(c, h.quality);
|
|
1911
|
+
};
|
|
1912
|
+
})(xt);
|
|
1913
|
+
var te = {};
|
|
1914
|
+
const bn = Ct;
|
|
1915
|
+
function Nt(t, e) {
|
|
1916
|
+
const r = t.a / 255, o = e + '="' + t.hex + '"';
|
|
1917
|
+
return r < 1 ? o + " " + e + '-opacity="' + r.toFixed(2).slice(1) + '"' : o;
|
|
1918
|
+
}
|
|
1919
|
+
function at(t, e, r) {
|
|
1920
|
+
let o = t + e;
|
|
1921
|
+
return typeof r < "u" && (o += " " + r), o;
|
|
1922
|
+
}
|
|
1923
|
+
function Bn(t, e, r) {
|
|
1924
|
+
let o = "", n = 0, i = !1, s = 0;
|
|
1925
|
+
for (let u = 0; u < t.length; u++) {
|
|
1926
|
+
const a = Math.floor(u % e), l = Math.floor(u / e);
|
|
1927
|
+
!a && !i && (i = !0), t[u] ? (s++, u > 0 && a > 0 && t[u - 1] || (o += i ? at("M", a + r, 0.5 + l + r) : at("m", n, 0), n = 0, i = !1), a + 1 < e && t[u + 1] || (o += at("h", s), s = 0)) : n++;
|
|
1928
|
+
}
|
|
1929
|
+
return o;
|
|
1930
|
+
}
|
|
1931
|
+
te.render = function(e, r, o) {
|
|
1932
|
+
const n = bn.getOptions(r), i = e.modules.size, s = e.modules.data, u = i + n.margin * 2, a = n.color.light.a ? "<path " + Nt(n.color.light, "fill") + ' d="M0 0h' + u + "v" + u + 'H0z"/>' : "", l = "<path " + Nt(n.color.dark, "stroke") + ' d="' + Bn(s, i, n.margin) + '"/>', c = 'viewBox="0 0 ' + u + " " + u + '"', g = '<svg xmlns="http://www.w3.org/2000/svg" ' + (n.width ? 'width="' + n.width + '" height="' + n.width + '" ' : "") + c + ' shape-rendering="crispEdges">' + a + l + `</svg>
|
|
1933
|
+
`;
|
|
1934
|
+
return typeof o == "function" && o(null, g), g;
|
|
1935
|
+
};
|
|
1936
|
+
const Mn = Fe, dt = Vt, ee = xt, Sn = te;
|
|
1937
|
+
function Et(t, e, r, o, n) {
|
|
1938
|
+
const i = [].slice.call(arguments, 1), s = i.length, u = typeof i[s - 1] == "function";
|
|
1939
|
+
if (!u && !Mn())
|
|
1940
|
+
throw new Error("Callback required as last argument");
|
|
1941
|
+
if (u) {
|
|
1942
|
+
if (s < 2)
|
|
1943
|
+
throw new Error("Too few arguments provided");
|
|
1944
|
+
s === 2 ? (n = r, r = e, e = o = void 0) : s === 3 && (e.getContext && typeof n > "u" ? (n = o, o = void 0) : (n = o, o = r, r = e, e = void 0));
|
|
1945
|
+
} else {
|
|
1946
|
+
if (s < 1)
|
|
1947
|
+
throw new Error("Too few arguments provided");
|
|
1948
|
+
return s === 1 ? (r = e, e = o = void 0) : s === 2 && !e.getContext && (o = r, r = e, e = void 0), new Promise(function(a, l) {
|
|
1949
|
+
try {
|
|
1950
|
+
const c = dt.create(r, o);
|
|
1951
|
+
a(t(c, e, o));
|
|
1952
|
+
} catch (c) {
|
|
1953
|
+
l(c);
|
|
1954
|
+
}
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
try {
|
|
1958
|
+
const a = dt.create(r, o);
|
|
1959
|
+
n(null, t(a, e, o));
|
|
1960
|
+
} catch (a) {
|
|
1961
|
+
n(a);
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
W.create = dt.create;
|
|
1965
|
+
W.toCanvas = Et.bind(null, ee.render);
|
|
1966
|
+
W.toDataURL = Et.bind(null, ee.renderToDataURL);
|
|
1967
|
+
W.toString = Et.bind(null, function(t, e, r) {
|
|
1968
|
+
return Sn.render(t, r);
|
|
1969
|
+
});
|
|
1970
|
+
function An(t, e) {
|
|
1971
|
+
const r = Ue(t), o = L("");
|
|
1972
|
+
return k(
|
|
1973
|
+
r,
|
|
1974
|
+
async (n) => {
|
|
1975
|
+
r.value && _e && (o.value = await W.toDataURL(n, e));
|
|
1976
|
+
},
|
|
1977
|
+
{ immediate: !0 }
|
|
1978
|
+
), o;
|
|
1979
|
+
}
|
|
1980
|
+
function vn(t, e) {
|
|
1981
|
+
const r = L(t), o = An(r), n = new bt();
|
|
1982
|
+
return n.addMethod("updateText", (i) => {
|
|
1983
|
+
r.value = i;
|
|
1984
|
+
}), n.addMethod("getQRCode", () => o.value), mt(() => {
|
|
1985
|
+
e("change", {
|
|
1986
|
+
eventName: "qrcode",
|
|
1987
|
+
value: o.value
|
|
1988
|
+
});
|
|
1989
|
+
}), k(o, (i) => {
|
|
1990
|
+
e("change", {
|
|
1991
|
+
eventName: "qrcode",
|
|
1992
|
+
value: i
|
|
1993
|
+
});
|
|
1994
|
+
}), n;
|
|
1995
|
+
}
|
|
1996
|
+
class bt {
|
|
1997
|
+
constructor() {
|
|
1998
|
+
Bt(this, "methods", /* @__PURE__ */ new Map());
|
|
1999
|
+
}
|
|
2000
|
+
addMethod(e, r) {
|
|
2001
|
+
this.methods.set(e, r);
|
|
2002
|
+
}
|
|
2003
|
+
getAllMethods() {
|
|
2004
|
+
return Object.fromEntries(this.methods.entries());
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
const Tt = /* @__PURE__ */ new Map([
|
|
2008
|
+
["useBreakpoints", Le],
|
|
2009
|
+
["useDark", De],
|
|
2010
|
+
["useQRCode", vn]
|
|
2011
|
+
]);
|
|
2012
|
+
function Nn(t, e = [], r) {
|
|
2013
|
+
if (!Tt.has(t))
|
|
2014
|
+
throw new Error(`Method ${t} not found`);
|
|
2015
|
+
return Tt.get(t)(...e, r);
|
|
2016
|
+
}
|
|
2017
|
+
const Rn = /* @__PURE__ */ le({
|
|
2018
|
+
__name: "VueUse",
|
|
2019
|
+
props: {
|
|
2020
|
+
method: {},
|
|
2021
|
+
args: {}
|
|
2022
|
+
},
|
|
2023
|
+
emits: ["change"],
|
|
2024
|
+
setup(t, { expose: e, emit: r }) {
|
|
2025
|
+
const o = t, n = r, i = Nn(o.method, o.args, n);
|
|
2026
|
+
return e(i.getAllMethods()), (s, u) => null;
|
|
2027
|
+
}
|
|
2028
|
+
});
|
|
2029
|
+
export {
|
|
2030
|
+
Rn as default
|
|
2031
|
+
};
|