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