@abaxx_tech/v-integration-react 1.2.0-dev.5 → 1.2.0-dev.7
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/README.md +37 -1
- package/dist/v-integration-react.css +1 -1
- package/dist/v-integration-react.d.ts +326 -1
- package/dist/v-integration-react.js +652 -580
- package/dist/v-integration-react.umd.cjs +3 -3
- package/package.json +1 -1
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const $e =
|
|
4
|
-
clientId:
|
|
5
|
-
apiUrl:
|
|
1
|
+
import { jsx as T, jsxs as se, Fragment as We } from "react/jsx-runtime";
|
|
2
|
+
import qt, { createContext as $r, useState as ge, useContext as Ze, useRef as Ge, useCallback as Ie, useEffect as je, Component as Fr } from "react";
|
|
3
|
+
const $e = $r({}), Ur = ({
|
|
4
|
+
clientId: k,
|
|
5
|
+
apiUrl: Q,
|
|
6
6
|
children: ee
|
|
7
7
|
}) => {
|
|
8
|
-
const [
|
|
9
|
-
|
|
8
|
+
const [Z, j] = ge(""), [X, F] = ge(""), [M, x] = ge(!1), [g, m] = ge(""), [E, $] = ge(""), [D, V] = ge(/* @__PURE__ */ new Date()), [N, O] = ge(""), [W, G] = ge(null), [Y, q] = ge(null), p = qt.useCallback(() => {
|
|
9
|
+
j(""), F(""), x(!1), m(""), $(""), O(""), V(/* @__PURE__ */ new Date()), G(null), q(null);
|
|
10
10
|
}, []);
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ T(
|
|
12
12
|
$e.Provider,
|
|
13
13
|
{
|
|
14
14
|
value: {
|
|
15
|
-
apiUrl:
|
|
16
|
-
clientId:
|
|
17
|
-
identity:
|
|
18
|
-
setIdentity:
|
|
15
|
+
apiUrl: Q,
|
|
16
|
+
clientId: k,
|
|
17
|
+
identity: Z,
|
|
18
|
+
setIdentity: j,
|
|
19
19
|
authRequestId: X,
|
|
20
20
|
setAuthRequestId: F,
|
|
21
21
|
isAuthenticating: M,
|
|
22
22
|
setIsAuthenticating: x,
|
|
23
23
|
codeVerifier: g,
|
|
24
24
|
setCodeVerifier: m,
|
|
25
|
-
codeChallenge:
|
|
25
|
+
codeChallenge: E,
|
|
26
26
|
setCodeChallenge: $,
|
|
27
|
-
authCode:
|
|
28
|
-
setAuthCode:
|
|
27
|
+
authCode: N,
|
|
28
|
+
setAuthCode: O,
|
|
29
29
|
authRequestIdExpires: D,
|
|
30
|
-
setAuthRequestIdExpires:
|
|
31
|
-
token:
|
|
32
|
-
setToken:
|
|
33
|
-
authError:
|
|
34
|
-
setAuthError:
|
|
30
|
+
setAuthRequestIdExpires: V,
|
|
31
|
+
token: W,
|
|
32
|
+
setToken: G,
|
|
33
|
+
authError: Y,
|
|
34
|
+
setAuthError: q,
|
|
35
35
|
resetState: p
|
|
36
36
|
},
|
|
37
37
|
children: ee
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
return window.crypto.getRandomValues(
|
|
41
|
+
function Hr(k) {
|
|
42
|
+
const Q = new Uint8Array(k);
|
|
43
|
+
return window.crypto.getRandomValues(Q), Q;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
const
|
|
47
|
-
return btoa(String.fromCharCode(...
|
|
45
|
+
function kt(k) {
|
|
46
|
+
const Q = Array.from(k);
|
|
47
|
+
return btoa(String.fromCharCode(...Q)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
48
48
|
}
|
|
49
|
-
function it(
|
|
50
|
-
if (
|
|
49
|
+
function it(k, Q) {
|
|
50
|
+
if (k)
|
|
51
51
|
try {
|
|
52
|
-
|
|
52
|
+
Q && Q.forEach(({ event: ee, handler: Z }) => {
|
|
53
53
|
try {
|
|
54
|
-
|
|
55
|
-
} catch (
|
|
56
|
-
console.warn(`Failed to remove event listener for "${ee}":`,
|
|
54
|
+
k.removeEventListener(ee, Z);
|
|
55
|
+
} catch (j) {
|
|
56
|
+
console.warn(`Failed to remove event listener for "${ee}":`, j);
|
|
57
57
|
}
|
|
58
|
-
}),
|
|
58
|
+
}), k.onopen = null, k.onmessage = null, k.onerror = null, k.readyState !== EventSource.CLOSED && k.close();
|
|
59
59
|
} catch (ee) {
|
|
60
60
|
console.error("Error cleaning up EventSource:", ee);
|
|
61
61
|
}
|
|
@@ -66,14 +66,14 @@ const qe = {
|
|
|
66
66
|
maxDelayMs: 3e4,
|
|
67
67
|
backoffMultiplier: 2
|
|
68
68
|
};
|
|
69
|
-
function
|
|
69
|
+
function Vr() {
|
|
70
70
|
const {
|
|
71
|
-
apiUrl:
|
|
72
|
-
clientId:
|
|
71
|
+
apiUrl: k,
|
|
72
|
+
clientId: Q,
|
|
73
73
|
authRequestId: ee,
|
|
74
74
|
// results of the successful auth
|
|
75
|
-
setIdentity:
|
|
76
|
-
authCode:
|
|
75
|
+
setIdentity: Z,
|
|
76
|
+
authCode: j,
|
|
77
77
|
setAuthCode: X,
|
|
78
78
|
// results of the successful begin auth
|
|
79
79
|
setAuthRequestId: F,
|
|
@@ -81,12 +81,12 @@ function Ur() {
|
|
|
81
81
|
setCodeChallenge: x,
|
|
82
82
|
setCodeVerifier: g,
|
|
83
83
|
codeChallenge: m,
|
|
84
|
-
codeVerifier:
|
|
84
|
+
codeVerifier: E,
|
|
85
85
|
setIsAuthenticating: $,
|
|
86
86
|
token: D,
|
|
87
|
-
setToken:
|
|
88
|
-
setAuthError:
|
|
89
|
-
} = Ze($e),
|
|
87
|
+
setToken: V,
|
|
88
|
+
setAuthError: N
|
|
89
|
+
} = Ze($e), O = Ge(null), W = Ge(""), G = Ge(0), Y = Ge(null), q = Ge(null), p = Ie((a) => {
|
|
90
90
|
try {
|
|
91
91
|
let s;
|
|
92
92
|
try {
|
|
@@ -96,16 +96,16 @@ function Ur() {
|
|
|
96
96
|
}
|
|
97
97
|
switch (a.type) {
|
|
98
98
|
case "start": {
|
|
99
|
-
s.request_id && s.expires && (F(s.request_id),
|
|
99
|
+
s.request_id && s.expires && (F(s.request_id), W.current = s.request_id, M(new Date(s.expires)));
|
|
100
100
|
break;
|
|
101
101
|
}
|
|
102
102
|
case "approved": {
|
|
103
|
-
if (s.code && s.identity && s.approved && s.request_id && s.request_id ==
|
|
104
|
-
const n =
|
|
103
|
+
if (s.code && s.identity && s.approved && s.request_id && s.request_id == W.current) {
|
|
104
|
+
const n = O.current, t = q.current;
|
|
105
105
|
n && (console.info("Closing SSE connection after approval"), it(n, t ? [
|
|
106
106
|
{ event: "start", handler: t },
|
|
107
107
|
{ event: "approved", handler: t }
|
|
108
|
-
] : void 0),
|
|
108
|
+
] : void 0), O.current = null), X(s.code), Z(s.identity), $(!0);
|
|
109
109
|
}
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
@@ -115,17 +115,17 @@ function Ur() {
|
|
|
115
115
|
} catch (s) {
|
|
116
116
|
console.error("Error parsing SSE message:", s);
|
|
117
117
|
}
|
|
118
|
-
}, [F, M, X,
|
|
118
|
+
}, [F, M, X, Z, $]);
|
|
119
119
|
je(() => {
|
|
120
|
-
|
|
120
|
+
q.current = p;
|
|
121
121
|
}, [p]), je(() => {
|
|
122
122
|
if (m)
|
|
123
123
|
return;
|
|
124
124
|
let a = !1;
|
|
125
125
|
return (async () => {
|
|
126
|
-
const n =
|
|
126
|
+
const n = Hr(64), t = await window.crypto.subtle.digest("SHA-256", n);
|
|
127
127
|
if (!a) {
|
|
128
|
-
const v =
|
|
128
|
+
const v = kt(new Uint8Array(t)), o = kt(n);
|
|
129
129
|
x(v), g(o);
|
|
130
130
|
}
|
|
131
131
|
})(), () => {
|
|
@@ -136,62 +136,62 @@ function Ur() {
|
|
|
136
136
|
const s = qe.initialDelayMs * Math.pow(qe.backoffMultiplier, a);
|
|
137
137
|
return Math.min(s, qe.maxDelayMs);
|
|
138
138
|
}, []), d = Ie(() => {
|
|
139
|
-
if (!(D ||
|
|
140
|
-
|
|
139
|
+
if (!(D || O.current)) {
|
|
140
|
+
N(null);
|
|
141
141
|
try {
|
|
142
|
-
const a = `${
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
const a = `${k}/v-plus/auth/start?cid=${Q}`, s = new EventSource(a);
|
|
143
|
+
O.current = s, s.onopen = () => {
|
|
144
|
+
G.current = 0, N(null), console.info("SSE connection established");
|
|
145
145
|
}, s.onmessage = p, s.addEventListener("start", p), s.addEventListener("approved", p), s.onerror = () => {
|
|
146
|
-
const n =
|
|
146
|
+
const n = O.current, t = q.current;
|
|
147
147
|
if (n && (it(n, t ? [
|
|
148
148
|
{ event: "start", handler: t },
|
|
149
149
|
{ event: "approved", handler: t }
|
|
150
|
-
] : void 0),
|
|
150
|
+
] : void 0), O.current = null), D) {
|
|
151
151
|
console.info("SSE connection closed - already authenticated");
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
const v =
|
|
154
|
+
const v = G.current;
|
|
155
155
|
if (v < qe.maxRetries) {
|
|
156
156
|
const o = b(v);
|
|
157
|
-
|
|
157
|
+
G.current = v + 1, console.info(
|
|
158
158
|
`SSE connection error. Retrying in ${o}ms (attempt ${v + 1}/${qe.maxRetries})`
|
|
159
|
-
),
|
|
159
|
+
), N(
|
|
160
160
|
`Connection lost. Reconnecting... (attempt ${v + 1}/${qe.maxRetries})`
|
|
161
|
-
),
|
|
161
|
+
), Y.current = setTimeout(() => {
|
|
162
162
|
d();
|
|
163
163
|
}, o);
|
|
164
164
|
} else
|
|
165
|
-
console.error("SSE connection failed after maximum retry attempts"),
|
|
165
|
+
console.error("SSE connection failed after maximum retry attempts"), N(
|
|
166
166
|
"Unable to establish connection. Please check your network and try again."
|
|
167
167
|
);
|
|
168
168
|
};
|
|
169
169
|
} catch (a) {
|
|
170
|
-
console.error("SSE connection setup failed:", a),
|
|
170
|
+
console.error("SSE connection setup failed:", a), N(`Connection setup failed: ${a}`), O.current = null;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
}, [D,
|
|
173
|
+
}, [D, k, Q, p, b, N]);
|
|
174
174
|
je(() => {
|
|
175
175
|
if (D) {
|
|
176
|
-
const a =
|
|
176
|
+
const a = O.current, s = q.current;
|
|
177
177
|
a && (console.info("Closing existing SSE connection"), it(a, s ? [
|
|
178
178
|
{ event: "start", handler: s },
|
|
179
179
|
{ event: "approved", handler: s }
|
|
180
|
-
] : void 0),
|
|
180
|
+
] : void 0), O.current = null), Y.current && (clearTimeout(Y.current), Y.current = null);
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
|
-
if (!(!m ||
|
|
183
|
+
if (!(!m || O.current))
|
|
184
184
|
return d(), () => {
|
|
185
|
-
const a =
|
|
185
|
+
const a = O.current, s = q.current;
|
|
186
186
|
a && (console.info("Cleaning up SSE connection on unmount"), it(a, s ? [
|
|
187
187
|
{ event: "start", handler: s },
|
|
188
188
|
{ event: "approved", handler: s }
|
|
189
|
-
] : void 0),
|
|
189
|
+
] : void 0), O.current = null), Y.current && (clearTimeout(Y.current), Y.current = null), G.current = 0;
|
|
190
190
|
};
|
|
191
191
|
}, [D, m, d, p]);
|
|
192
192
|
const w = Ie(async (a, s, n) => {
|
|
193
193
|
try {
|
|
194
|
-
const v = await (await fetch(`${
|
|
194
|
+
const v = await (await fetch(`${k}/v-plus/auth/token?cid=${Q}`, {
|
|
195
195
|
method: "POST",
|
|
196
196
|
headers: {
|
|
197
197
|
"Content-Type": "application/json"
|
|
@@ -203,39 +203,39 @@ function Ur() {
|
|
|
203
203
|
})
|
|
204
204
|
})).json();
|
|
205
205
|
if (v.token)
|
|
206
|
-
|
|
206
|
+
V(v.token), $(!1);
|
|
207
207
|
else
|
|
208
208
|
throw new Error("No token received");
|
|
209
209
|
} catch (t) {
|
|
210
|
-
console.error("Error fetching token:", t), $(!1),
|
|
210
|
+
console.error("Error fetching token:", t), $(!1), N(`Failed to obtain auth token: ${t}`), X("");
|
|
211
211
|
}
|
|
212
|
-
}, [
|
|
212
|
+
}, [k, Q, V, $, N, X]);
|
|
213
213
|
return je(() => {
|
|
214
|
-
|
|
215
|
-
}, [
|
|
214
|
+
j && w(j, ee, E);
|
|
215
|
+
}, [j, E, ee, w]), null;
|
|
216
216
|
}
|
|
217
|
-
const
|
|
218
|
-
clientId:
|
|
219
|
-
apiUrl:
|
|
217
|
+
const zr = ({
|
|
218
|
+
clientId: k,
|
|
219
|
+
apiUrl: Q,
|
|
220
220
|
children: ee
|
|
221
|
-
}) => /* @__PURE__ */
|
|
222
|
-
/* @__PURE__ */
|
|
221
|
+
}) => /* @__PURE__ */ se(Ur, { apiUrl: Q, clientId: k, children: [
|
|
222
|
+
/* @__PURE__ */ T(Vr, {}),
|
|
223
223
|
ee
|
|
224
224
|
] });
|
|
225
225
|
var ot = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Ce = {}, Ke = { exports: {} };
|
|
226
226
|
Ke.exports;
|
|
227
|
-
var
|
|
228
|
-
function
|
|
229
|
-
return
|
|
230
|
-
var ee = 200,
|
|
231
|
-
|
|
232
|
-
var
|
|
227
|
+
var Nt;
|
|
228
|
+
function Qr() {
|
|
229
|
+
return Nt || (Nt = 1, function(k, Q) {
|
|
230
|
+
var ee = 200, Z = "__lodash_hash_undefined__", j = 1, X = 2, F = 9007199254740991, M = "[object Arguments]", x = "[object Array]", g = "[object AsyncFunction]", m = "[object Boolean]", E = "[object Date]", $ = "[object Error]", D = "[object Function]", V = "[object GeneratorFunction]", N = "[object Map]", O = "[object Number]", W = "[object Null]", G = "[object Object]", Y = "[object Promise]", q = "[object Proxy]", p = "[object RegExp]", b = "[object Set]", d = "[object String]", w = "[object Symbol]", a = "[object Undefined]", s = "[object WeakMap]", n = "[object ArrayBuffer]", t = "[object DataView]", v = "[object Float32Array]", o = "[object Float64Array]", y = "[object Int8Array]", S = "[object Int16Array]", C = "[object Int32Array]", J = "[object Uint8Array]", U = "[object Uint8ClampedArray]", ne = "[object Uint16Array]", oe = "[object Uint32Array]", L = /[\\^$.*+?()[\]{}|]/g, P = /^\[object .+?Constructor\]$/, le = /^(?:0|[1-9]\d*)$/, K = {};
|
|
231
|
+
K[v] = K[o] = K[y] = K[S] = K[C] = K[J] = K[U] = K[ne] = K[oe] = !0, K[M] = K[x] = K[n] = K[m] = K[t] = K[E] = K[$] = K[D] = K[N] = K[O] = K[G] = K[p] = K[b] = K[d] = K[s] = !1;
|
|
232
|
+
var fe = typeof ot == "object" && ot && ot.Object === Object && ot, _e = typeof self == "object" && self && self.Object === Object && self, f = fe || _e || Function("return this")(), u = Q && !Q.nodeType && Q, i = u && !0 && k && !k.nodeType && k, l = i && i.exports === u, h = l && fe.process, _ = function() {
|
|
233
233
|
try {
|
|
234
234
|
return h && h.binding && h.binding("util");
|
|
235
235
|
} catch {
|
|
236
236
|
}
|
|
237
|
-
}(),
|
|
238
|
-
function
|
|
237
|
+
}(), R = _ && _.isTypedArray;
|
|
238
|
+
function I(e, r) {
|
|
239
239
|
for (var c = -1, A = e == null ? 0 : e.length, re = 0, H = []; ++c < A; ) {
|
|
240
240
|
var ie = e[c];
|
|
241
241
|
r(ie, c, e) && (H[re++] = ie);
|
|
@@ -258,18 +258,18 @@ function Hr() {
|
|
|
258
258
|
A[c] = r(c);
|
|
259
259
|
return A;
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function ce(e) {
|
|
262
262
|
return function(r) {
|
|
263
263
|
return e(r);
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function ve(e, r) {
|
|
267
267
|
return e.has(r);
|
|
268
268
|
}
|
|
269
269
|
function ke(e, r) {
|
|
270
270
|
return e == null ? void 0 : e[r];
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function Ne(e) {
|
|
273
273
|
var r = -1, c = Array(e.size);
|
|
274
274
|
return e.forEach(function(A, re) {
|
|
275
275
|
c[++r] = [re, A];
|
|
@@ -286,12 +286,12 @@ function Hr() {
|
|
|
286
286
|
c[++r] = A;
|
|
287
287
|
}), c;
|
|
288
288
|
}
|
|
289
|
-
var
|
|
289
|
+
var Be = Array.prototype, Ft = Function.prototype, Ye = Object.prototype, st = f["__core-js_shared__"], pt = Ft.toString, be = Ye.hasOwnProperty, yt = function() {
|
|
290
290
|
var e = /[^.]+$/.exec(st && st.keys && st.keys.IE_PROTO || "");
|
|
291
291
|
return e ? "Symbol(src)_1." + e : "";
|
|
292
|
-
}(),
|
|
293
|
-
"^" +
|
|
294
|
-
),
|
|
292
|
+
}(), xt = Ye.toString, Ut = RegExp(
|
|
293
|
+
"^" + pt.call(be).replace(L, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
294
|
+
), wt = l ? f.Buffer : void 0, Xe = f.Symbol, bt = f.Uint8Array, _t = Ye.propertyIsEnumerable, Ht = Be.splice, Re = Xe ? Xe.toStringTag : void 0, mt = Object.getOwnPropertySymbols, Vt = wt ? wt.isBuffer : void 0, Qt = Je(Object.keys, Object), ft = Oe(f, "DataView"), Ue = Oe(f, "Map"), ut = Oe(f, "Promise"), lt = Oe(f, "Set"), ct = Oe(f, "WeakMap"), He = Oe(Object, "create"), Gt = Le(ft), Kt = Le(Ue), Wt = Le(ut), Zt = Le(lt), Jt = Le(ct), At = Xe ? Xe.prototype : void 0, vt = At ? At.valueOf : void 0;
|
|
295
295
|
function Se(e) {
|
|
296
296
|
var r = -1, c = e == null ? 0 : e.length;
|
|
297
297
|
for (this.clear(); ++r < c; ) {
|
|
@@ -299,30 +299,30 @@ function Hr() {
|
|
|
299
299
|
this.set(A[0], A[1]);
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function Yt() {
|
|
303
303
|
this.__data__ = He ? He(null) : {}, this.size = 0;
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function Xt(e) {
|
|
306
306
|
var r = this.has(e) && delete this.__data__[e];
|
|
307
307
|
return this.size -= r ? 1 : 0, r;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function zt(e) {
|
|
310
310
|
var r = this.__data__;
|
|
311
311
|
if (He) {
|
|
312
312
|
var c = r[e];
|
|
313
|
-
return c ===
|
|
313
|
+
return c === Z ? void 0 : c;
|
|
314
314
|
}
|
|
315
315
|
return be.call(r, e) ? r[e] : void 0;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function er(e) {
|
|
318
318
|
var r = this.__data__;
|
|
319
319
|
return He ? r[e] !== void 0 : be.call(r, e);
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function tr(e, r) {
|
|
322
322
|
var c = this.__data__;
|
|
323
|
-
return this.size += this.has(e) ? 0 : 1, c[e] = He && r === void 0 ?
|
|
323
|
+
return this.size += this.has(e) ? 0 : 1, c[e] = He && r === void 0 ? Z : r, this;
|
|
324
324
|
}
|
|
325
|
-
Se.prototype.clear =
|
|
325
|
+
Se.prototype.clear = Yt, Se.prototype.delete = Xt, Se.prototype.get = zt, Se.prototype.has = er, Se.prototype.set = tr;
|
|
326
326
|
function me(e) {
|
|
327
327
|
var r = -1, c = e == null ? 0 : e.length;
|
|
328
328
|
for (this.clear(); ++r < c; ) {
|
|
@@ -330,28 +330,28 @@ function Hr() {
|
|
|
330
330
|
this.set(A[0], A[1]);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function rr() {
|
|
334
334
|
this.__data__ = [], this.size = 0;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function nr(e) {
|
|
337
337
|
var r = this.__data__, c = et(r, e);
|
|
338
338
|
if (c < 0)
|
|
339
339
|
return !1;
|
|
340
340
|
var A = r.length - 1;
|
|
341
|
-
return c == A ? r.pop() :
|
|
341
|
+
return c == A ? r.pop() : Ht.call(r, c, 1), --this.size, !0;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function ar(e) {
|
|
344
344
|
var r = this.__data__, c = et(r, e);
|
|
345
345
|
return c < 0 ? void 0 : r[c][1];
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function ir(e) {
|
|
348
348
|
return et(this.__data__, e) > -1;
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function or(e, r) {
|
|
351
351
|
var c = this.__data__, A = et(c, e);
|
|
352
352
|
return A < 0 ? (++this.size, c.push([e, r])) : c[A][1] = r, this;
|
|
353
353
|
}
|
|
354
|
-
me.prototype.clear =
|
|
354
|
+
me.prototype.clear = rr, me.prototype.delete = nr, me.prototype.get = ar, me.prototype.has = ir, me.prototype.set = or;
|
|
355
355
|
function De(e) {
|
|
356
356
|
var r = -1, c = e == null ? 0 : e.length;
|
|
357
357
|
for (this.clear(); ++r < c; ) {
|
|
@@ -359,58 +359,58 @@ function Hr() {
|
|
|
359
359
|
this.set(A[0], A[1]);
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function sr() {
|
|
363
363
|
this.size = 0, this.__data__ = {
|
|
364
364
|
hash: new Se(),
|
|
365
365
|
map: new (Ue || me)(),
|
|
366
366
|
string: new Se()
|
|
367
367
|
};
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function fr(e) {
|
|
370
370
|
var r = tt(this, e).delete(e);
|
|
371
371
|
return this.size -= r ? 1 : 0, r;
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function ur(e) {
|
|
374
374
|
return tt(this, e).get(e);
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function lr(e) {
|
|
377
377
|
return tt(this, e).has(e);
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function cr(e, r) {
|
|
380
380
|
var c = tt(this, e), A = c.size;
|
|
381
381
|
return c.set(e, r), this.size += c.size == A ? 0 : 1, this;
|
|
382
382
|
}
|
|
383
|
-
De.prototype.clear =
|
|
383
|
+
De.prototype.clear = sr, De.prototype.delete = fr, De.prototype.get = ur, De.prototype.has = lr, De.prototype.set = cr;
|
|
384
384
|
function ze(e) {
|
|
385
385
|
var r = -1, c = e == null ? 0 : e.length;
|
|
386
386
|
for (this.__data__ = new De(); ++r < c; )
|
|
387
387
|
this.add(e[r]);
|
|
388
388
|
}
|
|
389
|
-
function cr(e) {
|
|
390
|
-
return this.__data__.set(e, W), this;
|
|
391
|
-
}
|
|
392
389
|
function vr(e) {
|
|
390
|
+
return this.__data__.set(e, Z), this;
|
|
391
|
+
}
|
|
392
|
+
function hr(e) {
|
|
393
393
|
return this.__data__.has(e);
|
|
394
394
|
}
|
|
395
|
-
ze.prototype.add = ze.prototype.push =
|
|
395
|
+
ze.prototype.add = ze.prototype.push = vr, ze.prototype.has = hr;
|
|
396
396
|
function Te(e) {
|
|
397
397
|
var r = this.__data__ = new me(e);
|
|
398
398
|
this.size = r.size;
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function dr() {
|
|
401
401
|
this.__data__ = new me(), this.size = 0;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function gr(e) {
|
|
404
404
|
var r = this.__data__, c = r.delete(e);
|
|
405
405
|
return this.size = r.size, c;
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function pr(e) {
|
|
408
408
|
return this.__data__.get(e);
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function yr(e) {
|
|
411
411
|
return this.__data__.has(e);
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function xr(e, r) {
|
|
414
414
|
var c = this.__data__;
|
|
415
415
|
if (c instanceof me) {
|
|
416
416
|
var A = c.__data__;
|
|
@@ -420,94 +420,94 @@ function Hr() {
|
|
|
420
420
|
}
|
|
421
421
|
return c.set(e, r), this.size = c.size, this;
|
|
422
422
|
}
|
|
423
|
-
Te.prototype.clear =
|
|
424
|
-
function
|
|
425
|
-
var c = rt(e), A = !c &&
|
|
423
|
+
Te.prototype.clear = dr, Te.prototype.delete = gr, Te.prototype.get = pr, Te.prototype.has = yr, Te.prototype.set = xr;
|
|
424
|
+
function wr(e, r) {
|
|
425
|
+
var c = rt(e), A = !c && kr(e), re = !c && !A && ht(e), H = !c && !A && !re && Lt(e), ie = c || A || re || H, ue = ie ? B(e.length, String) : [], he = ue.length;
|
|
426
426
|
for (var ae in e)
|
|
427
427
|
be.call(e, ae) && !(ie && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
428
428
|
(ae == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
429
429
|
re && (ae == "offset" || ae == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
430
430
|
H && (ae == "buffer" || ae == "byteLength" || ae == "byteOffset") || // Skip index properties.
|
|
431
|
-
|
|
432
|
-
return
|
|
431
|
+
Rr(ae, he))) && ue.push(ae);
|
|
432
|
+
return ue;
|
|
433
433
|
}
|
|
434
434
|
function et(e, r) {
|
|
435
435
|
for (var c = e.length; c--; )
|
|
436
|
-
if (
|
|
436
|
+
if (It(e[c][0], r))
|
|
437
437
|
return c;
|
|
438
438
|
return -1;
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function br(e, r, c) {
|
|
441
441
|
var A = r(e);
|
|
442
442
|
return rt(e) ? A : z(A, c(e));
|
|
443
443
|
}
|
|
444
|
-
function
|
|
445
|
-
return e == null ? e === void 0 ? a :
|
|
444
|
+
function Ve(e) {
|
|
445
|
+
return e == null ? e === void 0 ? a : W : Re && Re in Object(e) ? Mr(e) : Pr(e);
|
|
446
446
|
}
|
|
447
|
-
function
|
|
448
|
-
return Qe(e) &&
|
|
447
|
+
function Ct(e) {
|
|
448
|
+
return Qe(e) && Ve(e) == M;
|
|
449
449
|
}
|
|
450
|
-
function
|
|
451
|
-
return e === r ? !0 : e == null || r == null || !Qe(e) && !Qe(r) ? e !== e && r !== r :
|
|
450
|
+
function Tt(e, r, c, A, re) {
|
|
451
|
+
return e === r ? !0 : e == null || r == null || !Qe(e) && !Qe(r) ? e !== e && r !== r : _r(e, r, c, A, Tt, re);
|
|
452
452
|
}
|
|
453
|
-
function
|
|
454
|
-
var ie = rt(e),
|
|
455
|
-
|
|
456
|
-
var pe =
|
|
453
|
+
function _r(e, r, c, A, re, H) {
|
|
454
|
+
var ie = rt(e), ue = rt(r), he = ie ? x : Ee(e), ae = ue ? x : Ee(r);
|
|
455
|
+
he = he == M ? G : he, ae = ae == M ? G : ae;
|
|
456
|
+
var pe = he == G, we = ae == G, de = he == ae;
|
|
457
457
|
if (de && ht(e)) {
|
|
458
458
|
if (!ht(r))
|
|
459
459
|
return !1;
|
|
460
460
|
ie = !0, pe = !1;
|
|
461
461
|
}
|
|
462
462
|
if (de && !pe)
|
|
463
|
-
return H || (H = new Te()), ie ||
|
|
464
|
-
if (!(c &
|
|
463
|
+
return H || (H = new Te()), ie || Lt(e) ? Et(e, r, c, A, re, H) : Tr(e, r, he, c, A, re, H);
|
|
464
|
+
if (!(c & j)) {
|
|
465
465
|
var ye = pe && be.call(e, "__wrapped__"), xe = we && be.call(r, "__wrapped__");
|
|
466
466
|
if (ye || xe) {
|
|
467
|
-
var
|
|
468
|
-
return H || (H = new Te()), re(
|
|
467
|
+
var Me = ye ? e.value() : e, Ae = xe ? r.value() : r;
|
|
468
|
+
return H || (H = new Te()), re(Me, Ae, c, A, H);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
return de ? (H || (H = new Te()),
|
|
471
|
+
return de ? (H || (H = new Te()), Er(e, r, c, A, re, H)) : !1;
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
if (!
|
|
473
|
+
function mr(e) {
|
|
474
|
+
if (!Dt(e) || Dr(e))
|
|
475
475
|
return !1;
|
|
476
|
-
var r =
|
|
476
|
+
var r = Rt(e) ? Ut : P;
|
|
477
477
|
return r.test(Le(e));
|
|
478
478
|
}
|
|
479
|
-
function mr(e) {
|
|
480
|
-
return Qe(e) && Rt(e.length) && !!V[Ge(e)];
|
|
481
|
-
}
|
|
482
479
|
function Ar(e) {
|
|
483
|
-
|
|
484
|
-
|
|
480
|
+
return Qe(e) && St(e.length) && !!K[Ve(e)];
|
|
481
|
+
}
|
|
482
|
+
function Cr(e) {
|
|
483
|
+
if (!Lr(e))
|
|
484
|
+
return Qt(e);
|
|
485
485
|
var r = [];
|
|
486
486
|
for (var c in Object(e))
|
|
487
487
|
be.call(e, c) && c != "constructor" && r.push(c);
|
|
488
488
|
return r;
|
|
489
489
|
}
|
|
490
|
-
function
|
|
491
|
-
var ie = c &
|
|
492
|
-
if (
|
|
490
|
+
function Et(e, r, c, A, re, H) {
|
|
491
|
+
var ie = c & j, ue = e.length, he = r.length;
|
|
492
|
+
if (ue != he && !(ie && he > ue))
|
|
493
493
|
return !1;
|
|
494
494
|
var ae = H.get(e);
|
|
495
495
|
if (ae && H.get(r))
|
|
496
496
|
return ae == r;
|
|
497
497
|
var pe = -1, we = !0, de = c & X ? new ze() : void 0;
|
|
498
|
-
for (H.set(e, r), H.set(r, e); ++pe <
|
|
498
|
+
for (H.set(e, r), H.set(r, e); ++pe < ue; ) {
|
|
499
499
|
var ye = e[pe], xe = r[pe];
|
|
500
500
|
if (A)
|
|
501
|
-
var
|
|
502
|
-
if (
|
|
503
|
-
if (
|
|
501
|
+
var Me = ie ? A(xe, ye, pe, r, e, H) : A(ye, xe, pe, e, r, H);
|
|
502
|
+
if (Me !== void 0) {
|
|
503
|
+
if (Me)
|
|
504
504
|
continue;
|
|
505
505
|
we = !1;
|
|
506
506
|
break;
|
|
507
507
|
}
|
|
508
508
|
if (de) {
|
|
509
509
|
if (!te(r, function(Ae, Pe) {
|
|
510
|
-
if (!
|
|
510
|
+
if (!ve(de, Pe) && (ye === Ae || re(ye, Ae, c, A, H)))
|
|
511
511
|
return de.push(Pe);
|
|
512
512
|
})) {
|
|
513
513
|
we = !1;
|
|
@@ -520,34 +520,34 @@ function Hr() {
|
|
|
520
520
|
}
|
|
521
521
|
return H.delete(e), H.delete(r), we;
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function Tr(e, r, c, A, re, H, ie) {
|
|
524
524
|
switch (c) {
|
|
525
525
|
case t:
|
|
526
526
|
if (e.byteLength != r.byteLength || e.byteOffset != r.byteOffset)
|
|
527
527
|
return !1;
|
|
528
528
|
e = e.buffer, r = r.buffer;
|
|
529
529
|
case n:
|
|
530
|
-
return !(e.byteLength != r.byteLength || !H(new
|
|
530
|
+
return !(e.byteLength != r.byteLength || !H(new bt(e), new bt(r)));
|
|
531
531
|
case m:
|
|
532
|
-
case
|
|
533
|
-
case
|
|
534
|
-
return
|
|
532
|
+
case E:
|
|
533
|
+
case O:
|
|
534
|
+
return It(+e, +r);
|
|
535
535
|
case $:
|
|
536
536
|
return e.name == r.name && e.message == r.message;
|
|
537
537
|
case p:
|
|
538
538
|
case d:
|
|
539
539
|
return e == r + "";
|
|
540
|
-
case
|
|
541
|
-
var
|
|
540
|
+
case N:
|
|
541
|
+
var ue = Ne;
|
|
542
542
|
case b:
|
|
543
|
-
var
|
|
544
|
-
if (
|
|
543
|
+
var he = A & j;
|
|
544
|
+
if (ue || (ue = Fe), e.size != r.size && !he)
|
|
545
545
|
return !1;
|
|
546
546
|
var ae = ie.get(e);
|
|
547
547
|
if (ae)
|
|
548
548
|
return ae == r;
|
|
549
549
|
A |= X, ie.set(e, r);
|
|
550
|
-
var pe =
|
|
550
|
+
var pe = Et(ue(e), ue(r), A, re, H, ie);
|
|
551
551
|
return ie.delete(e), pe;
|
|
552
552
|
case w:
|
|
553
553
|
if (vt)
|
|
@@ -555,12 +555,12 @@ function Hr() {
|
|
|
555
555
|
}
|
|
556
556
|
return !1;
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
var ie = c &
|
|
560
|
-
if (
|
|
558
|
+
function Er(e, r, c, A, re, H) {
|
|
559
|
+
var ie = c & j, ue = Mt(e), he = ue.length, ae = Mt(r), pe = ae.length;
|
|
560
|
+
if (he != pe && !ie)
|
|
561
561
|
return !1;
|
|
562
|
-
for (var we =
|
|
563
|
-
var de =
|
|
562
|
+
for (var we = he; we--; ) {
|
|
563
|
+
var de = ue[we];
|
|
564
564
|
if (!(ie ? de in r : be.call(r, de)))
|
|
565
565
|
return !1;
|
|
566
566
|
}
|
|
@@ -569,33 +569,33 @@ function Hr() {
|
|
|
569
569
|
return ye == r;
|
|
570
570
|
var xe = !0;
|
|
571
571
|
H.set(e, r), H.set(r, e);
|
|
572
|
-
for (var
|
|
573
|
-
de =
|
|
572
|
+
for (var Me = ie; ++we < he; ) {
|
|
573
|
+
de = ue[we];
|
|
574
574
|
var Ae = e[de], Pe = r[de];
|
|
575
575
|
if (A)
|
|
576
|
-
var
|
|
577
|
-
if (!(
|
|
576
|
+
var Pt = ie ? A(Pe, Ae, de, r, e, H) : A(Ae, Pe, de, e, r, H);
|
|
577
|
+
if (!(Pt === void 0 ? Ae === Pe || re(Ae, Pe, c, A, H) : Pt)) {
|
|
578
578
|
xe = !1;
|
|
579
579
|
break;
|
|
580
580
|
}
|
|
581
|
-
|
|
581
|
+
Me || (Me = de == "constructor");
|
|
582
582
|
}
|
|
583
|
-
if (xe && !
|
|
583
|
+
if (xe && !Me) {
|
|
584
584
|
var nt = e.constructor, at = r.constructor;
|
|
585
585
|
nt != at && "constructor" in e && "constructor" in r && !(typeof nt == "function" && nt instanceof nt && typeof at == "function" && at instanceof at) && (xe = !1);
|
|
586
586
|
}
|
|
587
587
|
return H.delete(e), H.delete(r), xe;
|
|
588
588
|
}
|
|
589
589
|
function Mt(e) {
|
|
590
|
-
return
|
|
590
|
+
return br(e, Or, Ir);
|
|
591
591
|
}
|
|
592
592
|
function tt(e, r) {
|
|
593
593
|
var c = e.__data__;
|
|
594
|
-
return
|
|
594
|
+
return Sr(r) ? c[typeof r == "string" ? "string" : "hash"] : c.map;
|
|
595
595
|
}
|
|
596
596
|
function Oe(e, r) {
|
|
597
597
|
var c = ke(e, r);
|
|
598
|
-
return
|
|
598
|
+
return mr(c) ? c : void 0;
|
|
599
599
|
}
|
|
600
600
|
function Mr(e) {
|
|
601
601
|
var r = be.call(e, Re), c = e[Re];
|
|
@@ -604,52 +604,52 @@ function Hr() {
|
|
|
604
604
|
var A = !0;
|
|
605
605
|
} catch {
|
|
606
606
|
}
|
|
607
|
-
var re =
|
|
607
|
+
var re = xt.call(e);
|
|
608
608
|
return A && (r ? e[Re] = c : delete e[Re]), re;
|
|
609
609
|
}
|
|
610
|
-
var
|
|
611
|
-
return e == null ? [] : (e = Object(e),
|
|
612
|
-
return
|
|
610
|
+
var Ir = mt ? function(e) {
|
|
611
|
+
return e == null ? [] : (e = Object(e), I(mt(e), function(r) {
|
|
612
|
+
return _t.call(e, r);
|
|
613
613
|
}));
|
|
614
|
-
} :
|
|
615
|
-
(ft &&
|
|
616
|
-
var r =
|
|
614
|
+
} : qr, Ee = Ve;
|
|
615
|
+
(ft && Ee(new ft(new ArrayBuffer(1))) != t || Ue && Ee(new Ue()) != N || ut && Ee(ut.resolve()) != Y || lt && Ee(new lt()) != b || ct && Ee(new ct()) != s) && (Ee = function(e) {
|
|
616
|
+
var r = Ve(e), c = r == G ? e.constructor : void 0, A = c ? Le(c) : "";
|
|
617
617
|
if (A)
|
|
618
618
|
switch (A) {
|
|
619
|
-
case
|
|
619
|
+
case Gt:
|
|
620
620
|
return t;
|
|
621
|
-
case Vt:
|
|
622
|
-
return k;
|
|
623
621
|
case Kt:
|
|
624
|
-
return
|
|
622
|
+
return N;
|
|
625
623
|
case Wt:
|
|
626
|
-
return
|
|
624
|
+
return Y;
|
|
627
625
|
case Zt:
|
|
626
|
+
return b;
|
|
627
|
+
case Jt:
|
|
628
628
|
return s;
|
|
629
629
|
}
|
|
630
630
|
return r;
|
|
631
631
|
});
|
|
632
|
-
function
|
|
633
|
-
return r = r ?? F, !!r && (typeof e == "number" ||
|
|
632
|
+
function Rr(e, r) {
|
|
633
|
+
return r = r ?? F, !!r && (typeof e == "number" || le.test(e)) && e > -1 && e % 1 == 0 && e < r;
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function Sr(e) {
|
|
636
636
|
var r = typeof e;
|
|
637
637
|
return r == "string" || r == "number" || r == "symbol" || r == "boolean" ? e !== "__proto__" : e === null;
|
|
638
638
|
}
|
|
639
|
-
function Sr(e) {
|
|
640
|
-
return !!pt && pt in e;
|
|
641
|
-
}
|
|
642
639
|
function Dr(e) {
|
|
640
|
+
return !!yt && yt in e;
|
|
641
|
+
}
|
|
642
|
+
function Lr(e) {
|
|
643
643
|
var r = e && e.constructor, c = typeof r == "function" && r.prototype || Ye;
|
|
644
644
|
return e === c;
|
|
645
645
|
}
|
|
646
|
-
function
|
|
647
|
-
return
|
|
646
|
+
function Pr(e) {
|
|
647
|
+
return xt.call(e);
|
|
648
648
|
}
|
|
649
649
|
function Le(e) {
|
|
650
650
|
if (e != null) {
|
|
651
651
|
try {
|
|
652
|
-
return
|
|
652
|
+
return pt.call(e);
|
|
653
653
|
} catch {
|
|
654
654
|
}
|
|
655
655
|
try {
|
|
@@ -659,56 +659,56 @@ function Hr() {
|
|
|
659
659
|
}
|
|
660
660
|
return "";
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function It(e, r) {
|
|
663
663
|
return e === r || e !== e && r !== r;
|
|
664
664
|
}
|
|
665
|
-
var
|
|
665
|
+
var kr = Ct(/* @__PURE__ */ function() {
|
|
666
666
|
return arguments;
|
|
667
|
-
}()) ?
|
|
668
|
-
return Qe(e) && be.call(e, "callee") && !
|
|
667
|
+
}()) ? Ct : function(e) {
|
|
668
|
+
return Qe(e) && be.call(e, "callee") && !_t.call(e, "callee");
|
|
669
669
|
}, rt = Array.isArray;
|
|
670
|
-
function
|
|
671
|
-
return e != null &&
|
|
670
|
+
function Nr(e) {
|
|
671
|
+
return e != null && St(e.length) && !Rt(e);
|
|
672
672
|
}
|
|
673
|
-
var ht =
|
|
673
|
+
var ht = Vt || jr;
|
|
674
674
|
function Br(e, r) {
|
|
675
|
-
return
|
|
675
|
+
return Tt(e, r);
|
|
676
676
|
}
|
|
677
|
-
function
|
|
678
|
-
if (!
|
|
677
|
+
function Rt(e) {
|
|
678
|
+
if (!Dt(e))
|
|
679
679
|
return !1;
|
|
680
|
-
var r =
|
|
681
|
-
return r == D || r ==
|
|
680
|
+
var r = Ve(e);
|
|
681
|
+
return r == D || r == V || r == g || r == q;
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function St(e) {
|
|
684
684
|
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= F;
|
|
685
685
|
}
|
|
686
|
-
function
|
|
686
|
+
function Dt(e) {
|
|
687
687
|
var r = typeof e;
|
|
688
688
|
return e != null && (r == "object" || r == "function");
|
|
689
689
|
}
|
|
690
690
|
function Qe(e) {
|
|
691
691
|
return e != null && typeof e == "object";
|
|
692
692
|
}
|
|
693
|
-
var
|
|
694
|
-
function
|
|
695
|
-
return
|
|
693
|
+
var Lt = R ? ce(R) : Ar;
|
|
694
|
+
function Or(e) {
|
|
695
|
+
return Nr(e) ? wr(e) : Cr(e);
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function qr() {
|
|
698
698
|
return [];
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function jr() {
|
|
701
701
|
return !1;
|
|
702
702
|
}
|
|
703
|
-
|
|
703
|
+
k.exports = Br;
|
|
704
704
|
}(Ke, Ke.exports)), Ke.exports;
|
|
705
705
|
}
|
|
706
706
|
var dt = { exports: {} }, Bt;
|
|
707
707
|
function Gr() {
|
|
708
|
-
return Bt || (Bt = 1, function(
|
|
708
|
+
return Bt || (Bt = 1, function(k, Q) {
|
|
709
709
|
var ee = function() {
|
|
710
|
-
var
|
|
711
|
-
var d = 236, w = 17, a = p, s = X[b], n = null, t = 0, v = null, o = [], y = {},
|
|
710
|
+
var Z = function(p, b) {
|
|
711
|
+
var d = 236, w = 17, a = p, s = X[b], n = null, t = 0, v = null, o = [], y = {}, S = function(f, u) {
|
|
712
712
|
t = a * 4 + 17, n = function(i) {
|
|
713
713
|
for (var l = new Array(i), h = 0; h < i; h += 1) {
|
|
714
714
|
l[h] = new Array(i);
|
|
@@ -716,15 +716,15 @@ function Gr() {
|
|
|
716
716
|
l[h][_] = null;
|
|
717
717
|
}
|
|
718
718
|
return l;
|
|
719
|
-
}(t), C(0, 0), C(t - 7, 0), C(0, t - 7), ne(), U(), L(f, u), a >= 7 && oe(f), v == null && (v =
|
|
719
|
+
}(t), C(0, 0), C(t - 7, 0), C(0, t - 7), ne(), U(), L(f, u), a >= 7 && oe(f), v == null && (v = K(a, s, o)), P(v, u);
|
|
720
720
|
}, C = function(f, u) {
|
|
721
721
|
for (var i = -1; i <= 7; i += 1)
|
|
722
722
|
if (!(f + i <= -1 || t <= f + i))
|
|
723
723
|
for (var l = -1; l <= 7; l += 1)
|
|
724
724
|
u + l <= -1 || t <= u + l || (0 <= i && i <= 6 && (l == 0 || l == 6) || 0 <= l && l <= 6 && (i == 0 || i == 6) || 2 <= i && i <= 4 && 2 <= l && l <= 4 ? n[f + i][u + l] = !0 : n[f + i][u + l] = !1);
|
|
725
|
-
},
|
|
725
|
+
}, J = function() {
|
|
726
726
|
for (var f = 0, u = 0, i = 0; i < 8; i += 1) {
|
|
727
|
-
|
|
727
|
+
S(!0, i);
|
|
728
728
|
var l = M.getLostPoint(y);
|
|
729
729
|
(i == 0 || f > l) && (f = l, u = i);
|
|
730
730
|
}
|
|
@@ -740,8 +740,8 @@ function Gr() {
|
|
|
740
740
|
var l = f[u], h = f[i];
|
|
741
741
|
if (n[l][h] == null)
|
|
742
742
|
for (var _ = -2; _ <= 2; _ += 1)
|
|
743
|
-
for (var
|
|
744
|
-
_ == -2 || _ == 2 ||
|
|
743
|
+
for (var R = -2; R <= 2; R += 1)
|
|
744
|
+
_ == -2 || _ == 2 || R == -2 || R == 2 || _ == 0 && R == 0 ? n[l + _][h + R] = !0 : n[l + _][h + R] = !1;
|
|
745
745
|
}
|
|
746
746
|
}, oe = function(f) {
|
|
747
747
|
for (var u = M.getBCHTypeNumber(a), i = 0; i < 18; i += 1) {
|
|
@@ -763,57 +763,57 @@ function Gr() {
|
|
|
763
763
|
}
|
|
764
764
|
n[t - 8][8] = !f;
|
|
765
765
|
}, P = function(f, u) {
|
|
766
|
-
for (var i = -1, l = t - 1, h = 7, _ = 0,
|
|
767
|
-
for (
|
|
766
|
+
for (var i = -1, l = t - 1, h = 7, _ = 0, R = M.getMaskFunction(u), I = t - 1; I > 0; I -= 2)
|
|
767
|
+
for (I == 6 && (I -= 1); ; ) {
|
|
768
768
|
for (var z = 0; z < 2; z += 1)
|
|
769
|
-
if (n[l][
|
|
769
|
+
if (n[l][I - z] == null) {
|
|
770
770
|
var te = !1;
|
|
771
771
|
_ < f.length && (te = (f[_] >>> h & 1) == 1);
|
|
772
|
-
var B =
|
|
773
|
-
B && (te = !te), n[l][
|
|
772
|
+
var B = R(l, I - z);
|
|
773
|
+
B && (te = !te), n[l][I - z] = te, h -= 1, h == -1 && (_ += 1, h = 7);
|
|
774
774
|
}
|
|
775
775
|
if (l += i, l < 0 || t <= l) {
|
|
776
776
|
l -= i, i = -i;
|
|
777
777
|
break;
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
|
-
},
|
|
781
|
-
for (var i = 0, l = 0, h = 0, _ = new Array(u.length),
|
|
782
|
-
var z = u[
|
|
783
|
-
l = Math.max(l, z), h = Math.max(h, te), _[
|
|
784
|
-
for (var B = 0; B < _[
|
|
785
|
-
_[
|
|
780
|
+
}, le = function(f, u) {
|
|
781
|
+
for (var i = 0, l = 0, h = 0, _ = new Array(u.length), R = new Array(u.length), I = 0; I < u.length; I += 1) {
|
|
782
|
+
var z = u[I].dataCount, te = u[I].totalCount - z;
|
|
783
|
+
l = Math.max(l, z), h = Math.max(h, te), _[I] = new Array(z);
|
|
784
|
+
for (var B = 0; B < _[I].length; B += 1)
|
|
785
|
+
_[I][B] = 255 & f.getBuffer()[B + i];
|
|
786
786
|
i += z;
|
|
787
|
-
var
|
|
788
|
-
I
|
|
789
|
-
for (var B = 0; B < I
|
|
790
|
-
var
|
|
791
|
-
I
|
|
787
|
+
var ce = M.getErrorCorrectPolynomial(te), ve = g(_[I], ce.getLength() - 1), ke = ve.mod(ce);
|
|
788
|
+
R[I] = new Array(ce.getLength() - 1);
|
|
789
|
+
for (var B = 0; B < R[I].length; B += 1) {
|
|
790
|
+
var Ne = B + ke.getLength() - R[I].length;
|
|
791
|
+
R[I][B] = Ne >= 0 ? ke.getAt(Ne) : 0;
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
for (var Je = 0, B = 0; B < u.length; B += 1)
|
|
795
795
|
Je += u[B].totalCount;
|
|
796
|
-
for (var Fe = new Array(Je),
|
|
797
|
-
for (var
|
|
798
|
-
B < _[
|
|
796
|
+
for (var Fe = new Array(Je), Be = 0, B = 0; B < l; B += 1)
|
|
797
|
+
for (var I = 0; I < u.length; I += 1)
|
|
798
|
+
B < _[I].length && (Fe[Be] = _[I][B], Be += 1);
|
|
799
799
|
for (var B = 0; B < h; B += 1)
|
|
800
|
-
for (var
|
|
801
|
-
B < I
|
|
800
|
+
for (var I = 0; I < u.length; I += 1)
|
|
801
|
+
B < R[I].length && (Fe[Be] = R[I][B], Be += 1);
|
|
802
802
|
return Fe;
|
|
803
|
-
},
|
|
804
|
-
for (var l = m.getRSBlocks(f, u), h =
|
|
805
|
-
var
|
|
806
|
-
h.put(
|
|
803
|
+
}, K = function(f, u, i) {
|
|
804
|
+
for (var l = m.getRSBlocks(f, u), h = E(), _ = 0; _ < i.length; _ += 1) {
|
|
805
|
+
var R = i[_];
|
|
806
|
+
h.put(R.getMode(), 4), h.put(R.getLength(), M.getLengthInBits(R.getMode(), f)), R.write(h);
|
|
807
807
|
}
|
|
808
|
-
for (var
|
|
809
|
-
|
|
810
|
-
if (h.getLengthInBits() >
|
|
811
|
-
throw "code length overflow. (" + h.getLengthInBits() + ">" +
|
|
812
|
-
for (h.getLengthInBits() + 4 <=
|
|
808
|
+
for (var I = 0, _ = 0; _ < l.length; _ += 1)
|
|
809
|
+
I += l[_].dataCount;
|
|
810
|
+
if (h.getLengthInBits() > I * 8)
|
|
811
|
+
throw "code length overflow. (" + h.getLengthInBits() + ">" + I * 8 + ")";
|
|
812
|
+
for (h.getLengthInBits() + 4 <= I * 8 && h.put(0, 4); h.getLengthInBits() % 8 != 0; )
|
|
813
813
|
h.putBit(!1);
|
|
814
|
-
for (; !(h.getLengthInBits() >=
|
|
814
|
+
for (; !(h.getLengthInBits() >= I * 8 || (h.put(d, 8), h.getLengthInBits() >= I * 8)); )
|
|
815
815
|
h.put(w, 8);
|
|
816
|
-
return
|
|
816
|
+
return le(h, l);
|
|
817
817
|
};
|
|
818
818
|
y.addData = function(f, u) {
|
|
819
819
|
u = u || "Byte";
|
|
@@ -826,10 +826,10 @@ function Gr() {
|
|
|
826
826
|
i = D(f);
|
|
827
827
|
break;
|
|
828
828
|
case "Byte":
|
|
829
|
-
i =
|
|
829
|
+
i = V(f);
|
|
830
830
|
break;
|
|
831
831
|
case "Kanji":
|
|
832
|
-
i =
|
|
832
|
+
i = N(f);
|
|
833
833
|
break;
|
|
834
834
|
default:
|
|
835
835
|
throw "mode:" + u;
|
|
@@ -844,7 +844,7 @@ function Gr() {
|
|
|
844
844
|
}, y.make = function() {
|
|
845
845
|
if (a < 1) {
|
|
846
846
|
for (var f = 1; f < 40; f++) {
|
|
847
|
-
for (var u = m.getRSBlocks(f, s), i =
|
|
847
|
+
for (var u = m.getRSBlocks(f, s), i = E(), l = 0; l < o.length; l++) {
|
|
848
848
|
var h = o[l];
|
|
849
849
|
i.put(h.getMode(), 4), i.put(h.getLength(), M.getLengthInBits(h.getMode(), f)), h.write(i);
|
|
850
850
|
}
|
|
@@ -855,7 +855,7 @@ function Gr() {
|
|
|
855
855
|
}
|
|
856
856
|
a = f;
|
|
857
857
|
}
|
|
858
|
-
|
|
858
|
+
S(!1, J());
|
|
859
859
|
}, y.createTableTag = function(f, u) {
|
|
860
860
|
f = f || 2, u = typeof u > "u" ? f * 4 : u;
|
|
861
861
|
var i = "";
|
|
@@ -870,27 +870,27 @@ function Gr() {
|
|
|
870
870
|
}, y.createSvgTag = function(f, u, i, l) {
|
|
871
871
|
var h = {};
|
|
872
872
|
typeof arguments[0] == "object" && (h = arguments[0], f = h.cellSize, u = h.margin, i = h.alt, l = h.title), f = f || 2, u = typeof u > "u" ? f * 4 : u, i = typeof i == "string" ? { text: i } : i || {}, i.text = i.text || null, i.id = i.text ? i.id || "qrcode-description" : null, l = typeof l == "string" ? { text: l } : l || {}, l.text = l.text || null, l.id = l.text ? l.id || "qrcode-title" : null;
|
|
873
|
-
var _ = y.getModuleCount() * f + u * 2,
|
|
874
|
-
for (
|
|
875
|
-
for (te = z * f + u,
|
|
876
|
-
y.isDark(z,
|
|
873
|
+
var _ = y.getModuleCount() * f + u * 2, R, I, z, te, B = "", ce;
|
|
874
|
+
for (ce = "l" + f + ",0 0," + f + " -" + f + ",0 0,-" + f + "z ", B += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"', B += h.scalable ? "" : ' width="' + _ + 'px" height="' + _ + 'px"', B += ' viewBox="0 0 ' + _ + " " + _ + '" ', B += ' preserveAspectRatio="xMinYMin meet"', B += l.text || i.text ? ' role="img" aria-labelledby="' + fe([l.id, i.id].join(" ").trim()) + '"' : "", B += ">", B += l.text ? '<title id="' + fe(l.id) + '">' + fe(l.text) + "</title>" : "", B += i.text ? '<description id="' + fe(i.id) + '">' + fe(i.text) + "</description>" : "", B += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>', B += '<path d="', z = 0; z < y.getModuleCount(); z += 1)
|
|
875
|
+
for (te = z * f + u, R = 0; R < y.getModuleCount(); R += 1)
|
|
876
|
+
y.isDark(z, R) && (I = R * f + u, B += "M" + I + "," + te + ce);
|
|
877
877
|
return B += '" stroke="transparent" fill="black"/>', B += "</svg>", B;
|
|
878
878
|
}, y.createDataURL = function(f, u) {
|
|
879
879
|
f = f || 2, u = typeof u > "u" ? f * 4 : u;
|
|
880
880
|
var i = y.getModuleCount() * f + u * 2, l = u, h = i - u;
|
|
881
|
-
return
|
|
882
|
-
if (l <= _ && _ < h && l <=
|
|
883
|
-
var
|
|
884
|
-
return y.isDark(z,
|
|
881
|
+
return q(i, i, function(_, R) {
|
|
882
|
+
if (l <= _ && _ < h && l <= R && R < h) {
|
|
883
|
+
var I = Math.floor((_ - l) / f), z = Math.floor((R - l) / f);
|
|
884
|
+
return y.isDark(z, I) ? 0 : 1;
|
|
885
885
|
} else
|
|
886
886
|
return 1;
|
|
887
887
|
});
|
|
888
888
|
}, y.createImgTag = function(f, u, i) {
|
|
889
889
|
f = f || 2, u = typeof u > "u" ? f * 4 : u;
|
|
890
890
|
var l = y.getModuleCount() * f + u * 2, h = "";
|
|
891
|
-
return h += "<img", h += ' src="', h += y.createDataURL(f, u), h += '"', h += ' width="', h += l, h += '"', h += ' height="', h += l, h += '"', i && (h += ' alt="', h +=
|
|
891
|
+
return h += "<img", h += ' src="', h += y.createDataURL(f, u), h += '"', h += ' width="', h += l, h += '"', h += ' height="', h += l, h += '"', i && (h += ' alt="', h += fe(i), h += '"'), h += "/>", h;
|
|
892
892
|
};
|
|
893
|
-
var
|
|
893
|
+
var fe = function(f) {
|
|
894
894
|
for (var u = "", i = 0; i < f.length; i += 1) {
|
|
895
895
|
var l = f.charAt(i);
|
|
896
896
|
switch (l) {
|
|
@@ -915,38 +915,38 @@ function Gr() {
|
|
|
915
915
|
}, _e = function(f) {
|
|
916
916
|
var u = 1;
|
|
917
917
|
f = typeof f > "u" ? u * 2 : f;
|
|
918
|
-
var i = y.getModuleCount() * u + f * 2, l = f, h = i - f, _,
|
|
918
|
+
var i = y.getModuleCount() * u + f * 2, l = f, h = i - f, _, R, I, z, te, B = {
|
|
919
919
|
"██": "█",
|
|
920
920
|
"█ ": "▀",
|
|
921
921
|
" █": "▄",
|
|
922
922
|
" ": " "
|
|
923
|
-
},
|
|
923
|
+
}, ce = {
|
|
924
924
|
"██": "▀",
|
|
925
925
|
"█ ": "▀",
|
|
926
926
|
" █": " ",
|
|
927
927
|
" ": " "
|
|
928
|
-
},
|
|
928
|
+
}, ve = "";
|
|
929
929
|
for (_ = 0; _ < i; _ += 2) {
|
|
930
|
-
for (
|
|
931
|
-
te = "█", l <=
|
|
932
|
-
|
|
930
|
+
for (I = Math.floor((_ - l) / u), z = Math.floor((_ + 1 - l) / u), R = 0; R < i; R += 1)
|
|
931
|
+
te = "█", l <= R && R < h && l <= _ && _ < h && y.isDark(I, Math.floor((R - l) / u)) && (te = " "), l <= R && R < h && l <= _ + 1 && _ + 1 < h && y.isDark(z, Math.floor((R - l) / u)) ? te += " " : te += "█", ve += f < 1 && _ + 1 >= h ? ce[te] : B[te];
|
|
932
|
+
ve += `
|
|
933
933
|
`;
|
|
934
934
|
}
|
|
935
|
-
return i % 2 && f > 0 ?
|
|
935
|
+
return i % 2 && f > 0 ? ve.substring(0, ve.length - i - 1) + Array(i + 1).join("▀") : ve.substring(0, ve.length - 1);
|
|
936
936
|
};
|
|
937
937
|
return y.createASCII = function(f, u) {
|
|
938
938
|
if (f = f || 1, f < 2)
|
|
939
939
|
return _e(u);
|
|
940
940
|
f -= 1, u = typeof u > "u" ? f * 2 : u;
|
|
941
|
-
var i = y.getModuleCount() * f + u * 2, l = u, h = i - u, _,
|
|
941
|
+
var i = y.getModuleCount() * f + u * 2, l = u, h = i - u, _, R, I, z, te = Array(f + 1).join("██"), B = Array(f + 1).join(" "), ce = "", ve = "";
|
|
942
942
|
for (_ = 0; _ < i; _ += 1) {
|
|
943
|
-
for (
|
|
944
|
-
z = 1, l <=
|
|
945
|
-
for (
|
|
946
|
-
|
|
943
|
+
for (I = Math.floor((_ - l) / f), ve = "", R = 0; R < i; R += 1)
|
|
944
|
+
z = 1, l <= R && R < h && l <= _ && _ < h && y.isDark(I, Math.floor((R - l) / f)) && (z = 0), ve += z ? te : B;
|
|
945
|
+
for (I = 0; I < f; I += 1)
|
|
946
|
+
ce += ve + `
|
|
947
947
|
`;
|
|
948
948
|
}
|
|
949
|
-
return
|
|
949
|
+
return ce.substring(0, ce.length - 1);
|
|
950
950
|
}, y.renderTo2dContext = function(f, u) {
|
|
951
951
|
u = u || 2;
|
|
952
952
|
for (var i = y.getModuleCount(), l = 0; l < i; l++)
|
|
@@ -954,7 +954,7 @@ function Gr() {
|
|
|
954
954
|
f.fillStyle = y.isDark(l, h) ? "black" : "white", f.fillRect(l * u, h * u, u, u);
|
|
955
955
|
}, y;
|
|
956
956
|
};
|
|
957
|
-
|
|
957
|
+
Z.stringToBytesFuncs = {
|
|
958
958
|
default: function(p) {
|
|
959
959
|
for (var b = [], d = 0; d < p.length; d += 1) {
|
|
960
960
|
var w = p.charCodeAt(d);
|
|
@@ -962,17 +962,17 @@ function Gr() {
|
|
|
962
962
|
}
|
|
963
963
|
return b;
|
|
964
964
|
}
|
|
965
|
-
},
|
|
965
|
+
}, Z.stringToBytes = Z.stringToBytesFuncs.default, Z.createStringToBytes = function(p, b) {
|
|
966
966
|
var d = function() {
|
|
967
|
-
for (var a =
|
|
967
|
+
for (var a = G(p), s = function() {
|
|
968
968
|
var U = a.read();
|
|
969
969
|
if (U == -1) throw "eof";
|
|
970
970
|
return U;
|
|
971
971
|
}, n = 0, t = {}; ; ) {
|
|
972
972
|
var v = a.read();
|
|
973
973
|
if (v == -1) break;
|
|
974
|
-
var o = s(), y = s(),
|
|
975
|
-
t[C] =
|
|
974
|
+
var o = s(), y = s(), S = s(), C = String.fromCharCode(v << 8 | o), J = y << 8 | S;
|
|
975
|
+
t[C] = J, n += 1;
|
|
976
976
|
}
|
|
977
977
|
if (n != b)
|
|
978
978
|
throw n + " != " + b;
|
|
@@ -991,7 +991,7 @@ function Gr() {
|
|
|
991
991
|
return s;
|
|
992
992
|
};
|
|
993
993
|
};
|
|
994
|
-
var
|
|
994
|
+
var j = {
|
|
995
995
|
MODE_NUMBER: 1,
|
|
996
996
|
MODE_ALPHA_NUM: 2,
|
|
997
997
|
MODE_8BIT_BYTE: 4,
|
|
@@ -1111,39 +1111,39 @@ function Gr() {
|
|
|
1111
1111
|
}, a.getLengthInBits = function(n, t) {
|
|
1112
1112
|
if (1 <= t && t < 10)
|
|
1113
1113
|
switch (n) {
|
|
1114
|
-
case
|
|
1114
|
+
case j.MODE_NUMBER:
|
|
1115
1115
|
return 10;
|
|
1116
|
-
case
|
|
1116
|
+
case j.MODE_ALPHA_NUM:
|
|
1117
1117
|
return 9;
|
|
1118
|
-
case
|
|
1118
|
+
case j.MODE_8BIT_BYTE:
|
|
1119
1119
|
return 8;
|
|
1120
|
-
case
|
|
1120
|
+
case j.MODE_KANJI:
|
|
1121
1121
|
return 8;
|
|
1122
1122
|
default:
|
|
1123
1123
|
throw "mode:" + n;
|
|
1124
1124
|
}
|
|
1125
1125
|
else if (t < 27)
|
|
1126
1126
|
switch (n) {
|
|
1127
|
-
case
|
|
1127
|
+
case j.MODE_NUMBER:
|
|
1128
1128
|
return 12;
|
|
1129
|
-
case
|
|
1129
|
+
case j.MODE_ALPHA_NUM:
|
|
1130
1130
|
return 11;
|
|
1131
|
-
case
|
|
1131
|
+
case j.MODE_8BIT_BYTE:
|
|
1132
1132
|
return 16;
|
|
1133
|
-
case
|
|
1133
|
+
case j.MODE_KANJI:
|
|
1134
1134
|
return 10;
|
|
1135
1135
|
default:
|
|
1136
1136
|
throw "mode:" + n;
|
|
1137
1137
|
}
|
|
1138
1138
|
else if (t < 41)
|
|
1139
1139
|
switch (n) {
|
|
1140
|
-
case
|
|
1140
|
+
case j.MODE_NUMBER:
|
|
1141
1141
|
return 14;
|
|
1142
|
-
case
|
|
1142
|
+
case j.MODE_ALPHA_NUM:
|
|
1143
1143
|
return 13;
|
|
1144
|
-
case
|
|
1144
|
+
case j.MODE_8BIT_BYTE:
|
|
1145
1145
|
return 16;
|
|
1146
|
-
case
|
|
1146
|
+
case j.MODE_KANJI:
|
|
1147
1147
|
return 12;
|
|
1148
1148
|
default:
|
|
1149
1149
|
throw "mode:" + n;
|
|
@@ -1153,11 +1153,11 @@ function Gr() {
|
|
|
1153
1153
|
}, a.getLostPoint = function(n) {
|
|
1154
1154
|
for (var t = n.getModuleCount(), v = 0, o = 0; o < t; o += 1)
|
|
1155
1155
|
for (var y = 0; y < t; y += 1) {
|
|
1156
|
-
for (var
|
|
1157
|
-
if (!(o +
|
|
1156
|
+
for (var S = 0, C = n.isDark(o, y), J = -1; J <= 1; J += 1)
|
|
1157
|
+
if (!(o + J < 0 || t <= o + J))
|
|
1158
1158
|
for (var U = -1; U <= 1; U += 1)
|
|
1159
|
-
y + U < 0 || t <= y + U ||
|
|
1160
|
-
|
|
1159
|
+
y + U < 0 || t <= y + U || J == 0 && U == 0 || C == n.isDark(o + J, y + U) && (S += 1);
|
|
1160
|
+
S > 5 && (v += 3 + S - 5);
|
|
1161
1161
|
}
|
|
1162
1162
|
for (var o = 0; o < t - 1; o += 1)
|
|
1163
1163
|
for (var y = 0; y < t - 1; y += 1) {
|
|
@@ -1453,11 +1453,11 @@ function Gr() {
|
|
|
1453
1453
|
if (typeof n > "u")
|
|
1454
1454
|
throw "bad rs block @ typeNumber:" + a + "/errorCorrectionLevel:" + s;
|
|
1455
1455
|
for (var t = n.length / 3, v = [], o = 0; o < t; o += 1)
|
|
1456
|
-
for (var y = n[o * 3 + 0],
|
|
1457
|
-
v.push(b(
|
|
1456
|
+
for (var y = n[o * 3 + 0], S = n[o * 3 + 1], C = n[o * 3 + 2], J = 0; J < y; J += 1)
|
|
1457
|
+
v.push(b(S, C));
|
|
1458
1458
|
return v;
|
|
1459
1459
|
}, d;
|
|
1460
|
-
}(),
|
|
1460
|
+
}(), E = function() {
|
|
1461
1461
|
var p = [], b = 0, d = {};
|
|
1462
1462
|
return d.getBuffer = function() {
|
|
1463
1463
|
return p;
|
|
@@ -1474,7 +1474,7 @@ function Gr() {
|
|
|
1474
1474
|
p.length <= a && p.push(0), w && (p[a] |= 128 >>> b % 8), b += 1;
|
|
1475
1475
|
}, d;
|
|
1476
1476
|
}, $ = function(p) {
|
|
1477
|
-
var b =
|
|
1477
|
+
var b = j.MODE_NUMBER, d = p, w = {};
|
|
1478
1478
|
w.getMode = function() {
|
|
1479
1479
|
return b;
|
|
1480
1480
|
}, w.getLength = function(n) {
|
|
@@ -1495,7 +1495,7 @@ function Gr() {
|
|
|
1495
1495
|
};
|
|
1496
1496
|
return w;
|
|
1497
1497
|
}, D = function(p) {
|
|
1498
|
-
var b =
|
|
1498
|
+
var b = j.MODE_ALPHA_NUM, d = p, w = {};
|
|
1499
1499
|
w.getMode = function() {
|
|
1500
1500
|
return b;
|
|
1501
1501
|
}, w.getLength = function(s) {
|
|
@@ -1537,8 +1537,8 @@ function Gr() {
|
|
|
1537
1537
|
}
|
|
1538
1538
|
};
|
|
1539
1539
|
return w;
|
|
1540
|
-
},
|
|
1541
|
-
var b =
|
|
1540
|
+
}, V = function(p) {
|
|
1541
|
+
var b = j.MODE_8BIT_BYTE, d = Z.stringToBytes(p), w = {};
|
|
1542
1542
|
return w.getMode = function() {
|
|
1543
1543
|
return b;
|
|
1544
1544
|
}, w.getLength = function(a) {
|
|
@@ -1547,8 +1547,8 @@ function Gr() {
|
|
|
1547
1547
|
for (var s = 0; s < d.length; s += 1)
|
|
1548
1548
|
a.put(d[s], 8);
|
|
1549
1549
|
}, w;
|
|
1550
|
-
},
|
|
1551
|
-
var b =
|
|
1550
|
+
}, N = function(p) {
|
|
1551
|
+
var b = j.MODE_KANJI, d = Z.stringToBytesFuncs.SJIS;
|
|
1552
1552
|
if (!d)
|
|
1553
1553
|
throw "sjis not supported.";
|
|
1554
1554
|
(function(s, n) {
|
|
@@ -1575,7 +1575,7 @@ function Gr() {
|
|
|
1575
1575
|
if (t < n.length)
|
|
1576
1576
|
throw "illegal char at " + (t + 1);
|
|
1577
1577
|
}, a;
|
|
1578
|
-
},
|
|
1578
|
+
}, O = function() {
|
|
1579
1579
|
var p = [], b = {};
|
|
1580
1580
|
return b.writeByte = function(d) {
|
|
1581
1581
|
p.push(d & 255);
|
|
@@ -1597,7 +1597,7 @@ function Gr() {
|
|
|
1597
1597
|
w > 0 && (d += ","), d += p[w];
|
|
1598
1598
|
return d += "]", d;
|
|
1599
1599
|
}, b;
|
|
1600
|
-
},
|
|
1600
|
+
}, W = function() {
|
|
1601
1601
|
var p = 0, b = 0, d = 0, w = "", a = {}, s = function(t) {
|
|
1602
1602
|
w += String.fromCharCode(n(t & 63));
|
|
1603
1603
|
}, n = function(t) {
|
|
@@ -1625,7 +1625,7 @@ function Gr() {
|
|
|
1625
1625
|
}, a.toString = function() {
|
|
1626
1626
|
return w;
|
|
1627
1627
|
}, a;
|
|
1628
|
-
},
|
|
1628
|
+
}, G = function(p) {
|
|
1629
1629
|
var b = p, d = 0, w = 0, a = 0, s = {};
|
|
1630
1630
|
s.read = function() {
|
|
1631
1631
|
for (; a < 8; ) {
|
|
@@ -1658,71 +1658,71 @@ function Gr() {
|
|
|
1658
1658
|
throw "c:" + t;
|
|
1659
1659
|
};
|
|
1660
1660
|
return s;
|
|
1661
|
-
},
|
|
1661
|
+
}, Y = function(p, b) {
|
|
1662
1662
|
var d = p, w = b, a = new Array(p * b), s = {};
|
|
1663
|
-
s.setPixel = function(o, y,
|
|
1664
|
-
a[y * d + o] =
|
|
1663
|
+
s.setPixel = function(o, y, S) {
|
|
1664
|
+
a[y * d + o] = S;
|
|
1665
1665
|
}, s.write = function(o) {
|
|
1666
1666
|
o.writeString("GIF87a"), o.writeShort(d), o.writeShort(w), o.writeByte(128), o.writeByte(0), o.writeByte(0), o.writeByte(0), o.writeByte(0), o.writeByte(0), o.writeByte(255), o.writeByte(255), o.writeByte(255), o.writeString(","), o.writeShort(0), o.writeShort(0), o.writeShort(d), o.writeShort(w), o.writeByte(0);
|
|
1667
|
-
var y = 2,
|
|
1667
|
+
var y = 2, S = t(y);
|
|
1668
1668
|
o.writeByte(y);
|
|
1669
|
-
for (var C = 0;
|
|
1670
|
-
o.writeByte(255), o.writeBytes(
|
|
1671
|
-
o.writeByte(
|
|
1669
|
+
for (var C = 0; S.length - C > 255; )
|
|
1670
|
+
o.writeByte(255), o.writeBytes(S, C, 255), C += 255;
|
|
1671
|
+
o.writeByte(S.length - C), o.writeBytes(S, C, S.length - C), o.writeByte(0), o.writeString(";");
|
|
1672
1672
|
};
|
|
1673
1673
|
var n = function(o) {
|
|
1674
|
-
var y = o,
|
|
1675
|
-
return
|
|
1674
|
+
var y = o, S = 0, C = 0, J = {};
|
|
1675
|
+
return J.write = function(U, ne) {
|
|
1676
1676
|
if (U >>> ne)
|
|
1677
1677
|
throw "length over";
|
|
1678
|
-
for (;
|
|
1679
|
-
y.writeByte(255 & (U <<
|
|
1680
|
-
C = U <<
|
|
1681
|
-
},
|
|
1682
|
-
|
|
1683
|
-
},
|
|
1678
|
+
for (; S + ne >= 8; )
|
|
1679
|
+
y.writeByte(255 & (U << S | C)), ne -= 8 - S, U >>>= 8 - S, C = 0, S = 0;
|
|
1680
|
+
C = U << S | C, S = S + ne;
|
|
1681
|
+
}, J.flush = function() {
|
|
1682
|
+
S > 0 && y.writeByte(C);
|
|
1683
|
+
}, J;
|
|
1684
1684
|
}, t = function(o) {
|
|
1685
|
-
for (var y = 1 << o,
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
var ne =
|
|
1685
|
+
for (var y = 1 << o, S = (1 << o) + 1, C = o + 1, J = v(), U = 0; U < y; U += 1)
|
|
1686
|
+
J.add(String.fromCharCode(U));
|
|
1687
|
+
J.add(String.fromCharCode(y)), J.add(String.fromCharCode(S));
|
|
1688
|
+
var ne = O(), oe = n(ne);
|
|
1689
1689
|
oe.write(y, C);
|
|
1690
1690
|
var L = 0, P = String.fromCharCode(a[L]);
|
|
1691
1691
|
for (L += 1; L < a.length; ) {
|
|
1692
|
-
var
|
|
1693
|
-
L += 1,
|
|
1692
|
+
var le = String.fromCharCode(a[L]);
|
|
1693
|
+
L += 1, J.contains(P + le) ? P = P + le : (oe.write(J.indexOf(P), C), J.size() < 4095 && (J.size() == 1 << C && (C += 1), J.add(P + le)), P = le);
|
|
1694
1694
|
}
|
|
1695
|
-
return oe.write(
|
|
1695
|
+
return oe.write(J.indexOf(P), C), oe.write(S, C), oe.flush(), ne.toByteArray();
|
|
1696
1696
|
}, v = function() {
|
|
1697
|
-
var o = {}, y = 0,
|
|
1698
|
-
return
|
|
1699
|
-
if (
|
|
1697
|
+
var o = {}, y = 0, S = {};
|
|
1698
|
+
return S.add = function(C) {
|
|
1699
|
+
if (S.contains(C))
|
|
1700
1700
|
throw "dup key:" + C;
|
|
1701
1701
|
o[C] = y, y += 1;
|
|
1702
|
-
},
|
|
1702
|
+
}, S.size = function() {
|
|
1703
1703
|
return y;
|
|
1704
|
-
},
|
|
1704
|
+
}, S.indexOf = function(C) {
|
|
1705
1705
|
return o[C];
|
|
1706
|
-
},
|
|
1706
|
+
}, S.contains = function(C) {
|
|
1707
1707
|
return typeof o[C] < "u";
|
|
1708
|
-
},
|
|
1708
|
+
}, S;
|
|
1709
1709
|
};
|
|
1710
1710
|
return s;
|
|
1711
|
-
},
|
|
1712
|
-
for (var w =
|
|
1711
|
+
}, q = function(p, b, d) {
|
|
1712
|
+
for (var w = Y(p, b), a = 0; a < b; a += 1)
|
|
1713
1713
|
for (var s = 0; s < p; s += 1)
|
|
1714
1714
|
w.setPixel(s, a, d(s, a));
|
|
1715
|
-
var n =
|
|
1715
|
+
var n = O();
|
|
1716
1716
|
w.write(n);
|
|
1717
|
-
for (var t =
|
|
1717
|
+
for (var t = W(), v = n.toByteArray(), o = 0; o < v.length; o += 1)
|
|
1718
1718
|
t.writeByte(v[o]);
|
|
1719
1719
|
return t.flush(), "data:image/gif;base64," + t;
|
|
1720
1720
|
};
|
|
1721
|
-
return
|
|
1721
|
+
return Z;
|
|
1722
1722
|
}();
|
|
1723
1723
|
(function() {
|
|
1724
|
-
ee.stringToBytesFuncs["UTF-8"] = function(
|
|
1725
|
-
function
|
|
1724
|
+
ee.stringToBytesFuncs["UTF-8"] = function(Z) {
|
|
1725
|
+
function j(X) {
|
|
1726
1726
|
for (var F = [], M = 0; M < X.length; M++) {
|
|
1727
1727
|
var x = X.charCodeAt(M);
|
|
1728
1728
|
x < 128 ? F.push(x) : x < 2048 ? F.push(
|
|
@@ -1741,25 +1741,25 @@ function Gr() {
|
|
|
1741
1741
|
}
|
|
1742
1742
|
return F;
|
|
1743
1743
|
}
|
|
1744
|
-
return
|
|
1744
|
+
return j(Z);
|
|
1745
1745
|
};
|
|
1746
|
-
})(), function(
|
|
1747
|
-
|
|
1746
|
+
})(), function(Z) {
|
|
1747
|
+
k.exports = Z();
|
|
1748
1748
|
}(function() {
|
|
1749
1749
|
return ee;
|
|
1750
1750
|
});
|
|
1751
1751
|
}(dt)), dt.exports;
|
|
1752
1752
|
}
|
|
1753
|
-
var
|
|
1754
|
-
function
|
|
1755
|
-
if (
|
|
1756
|
-
|
|
1757
|
-
var
|
|
1753
|
+
var Ot;
|
|
1754
|
+
function Kr() {
|
|
1755
|
+
if (Ot) return Ce;
|
|
1756
|
+
Ot = 1;
|
|
1757
|
+
var k = Ce && Ce.__extends || /* @__PURE__ */ function() {
|
|
1758
1758
|
var F = function(M, x) {
|
|
1759
1759
|
return F = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(g, m) {
|
|
1760
1760
|
g.__proto__ = m;
|
|
1761
1761
|
} || function(g, m) {
|
|
1762
|
-
for (var
|
|
1762
|
+
for (var E in m) Object.prototype.hasOwnProperty.call(m, E) && (g[E] = m[E]);
|
|
1763
1763
|
}, F(M, x);
|
|
1764
1764
|
};
|
|
1765
1765
|
return function(M, x) {
|
|
@@ -1771,23 +1771,23 @@ function Qr() {
|
|
|
1771
1771
|
}
|
|
1772
1772
|
M.prototype = x === null ? Object.create(x) : (g.prototype = x.prototype, new g());
|
|
1773
1773
|
};
|
|
1774
|
-
}(),
|
|
1775
|
-
return
|
|
1774
|
+
}(), Q = Ce && Ce.__assign || function() {
|
|
1775
|
+
return Q = Object.assign || function(F) {
|
|
1776
1776
|
for (var M, x = 1, g = arguments.length; x < g; x++) {
|
|
1777
1777
|
M = arguments[x];
|
|
1778
1778
|
for (var m in M) Object.prototype.hasOwnProperty.call(M, m) && (F[m] = M[m]);
|
|
1779
1779
|
}
|
|
1780
1780
|
return F;
|
|
1781
|
-
},
|
|
1781
|
+
}, Q.apply(this, arguments);
|
|
1782
1782
|
};
|
|
1783
1783
|
Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.QRCode = void 0;
|
|
1784
|
-
var ee =
|
|
1784
|
+
var ee = Qr(), Z = Gr(), j = qt, X = (
|
|
1785
1785
|
/** @class */
|
|
1786
1786
|
function(F) {
|
|
1787
|
-
|
|
1787
|
+
k(M, F);
|
|
1788
1788
|
function M(x) {
|
|
1789
1789
|
var g = F.call(this, x) || this;
|
|
1790
|
-
return g.canvasRef =
|
|
1790
|
+
return g.canvasRef = j.createRef(), g;
|
|
1791
1791
|
}
|
|
1792
1792
|
return M.prototype.download = function(x, g) {
|
|
1793
1793
|
if (this.canvasRef.current) {
|
|
@@ -1804,38 +1804,38 @@ function Qr() {
|
|
|
1804
1804
|
m = "image/png";
|
|
1805
1805
|
break;
|
|
1806
1806
|
}
|
|
1807
|
-
var
|
|
1808
|
-
$.download = g ?? "react-qrcode-logo", $.href =
|
|
1807
|
+
var E = this.canvasRef.current.toDataURL(m, 1), $ = document.createElement("a");
|
|
1808
|
+
$.download = g ?? "react-qrcode-logo", $.href = E, $.click();
|
|
1809
1809
|
}
|
|
1810
1810
|
}, M.prototype.utf16to8 = function(x) {
|
|
1811
|
-
var g = "", m,
|
|
1811
|
+
var g = "", m, E, $ = x.length;
|
|
1812
1812
|
for (m = 0; m < $; m++)
|
|
1813
|
-
|
|
1813
|
+
E = x.charCodeAt(m), E >= 1 && E <= 127 ? g += x.charAt(m) : E > 2047 ? (g += String.fromCharCode(224 | E >> 12 & 15), g += String.fromCharCode(128 | E >> 6 & 63), g += String.fromCharCode(128 | E >> 0 & 63)) : (g += String.fromCharCode(192 | E >> 6 & 31), g += String.fromCharCode(128 | E >> 0 & 63));
|
|
1814
1814
|
return g;
|
|
1815
|
-
}, M.prototype.drawRoundedSquare = function(x, g, m,
|
|
1816
|
-
|
|
1817
|
-
return
|
|
1815
|
+
}, M.prototype.drawRoundedSquare = function(x, g, m, E, $, D, V, N) {
|
|
1816
|
+
N.lineWidth = x, N.fillStyle = $, N.strokeStyle = $, m += x / 2, g += x / 2, E -= x, Array.isArray(D) || (D = [D, D, D, D]), D = D.map(function(q) {
|
|
1817
|
+
return q = Math.min(q, E / 2), q < 0 ? 0 : q;
|
|
1818
1818
|
});
|
|
1819
|
-
var
|
|
1820
|
-
|
|
1821
|
-
}, M.prototype.drawPositioningPattern = function(x, g, m,
|
|
1822
|
-
|
|
1823
|
-
var
|
|
1824
|
-
typeof
|
|
1825
|
-
var
|
|
1826
|
-
typeof D != "string" ? (
|
|
1827
|
-
var
|
|
1828
|
-
this.drawRoundedSquare(
|
|
1819
|
+
var O = D[0] || 0, W = D[1] || 0, G = D[2] || 0, Y = D[3] || 0;
|
|
1820
|
+
N.beginPath(), N.moveTo(g + O, m), N.lineTo(g + E - W, m), W && N.quadraticCurveTo(g + E, m, g + E, m + W), N.lineTo(g + E, m + E - G), G && N.quadraticCurveTo(g + E, m + E, g + E - G, m + E), N.lineTo(g + Y, m + E), Y && N.quadraticCurveTo(g, m + E, g, m + E - Y), N.lineTo(g, m + O), O && N.quadraticCurveTo(g, m, g + O, m), N.closePath(), N.stroke(), V && N.fill();
|
|
1821
|
+
}, M.prototype.drawPositioningPattern = function(x, g, m, E, $, D, V) {
|
|
1822
|
+
V === void 0 && (V = [0, 0, 0, 0]);
|
|
1823
|
+
var N = Math.ceil(g), O, W;
|
|
1824
|
+
typeof V != "number" && !Array.isArray(V) ? (O = V.outer || 0, W = V.inner || 0) : (O = V, W = O);
|
|
1825
|
+
var G, Y;
|
|
1826
|
+
typeof D != "string" ? (G = D.outer, Y = D.inner) : (G = D, Y = D);
|
|
1827
|
+
var q = E * g + m, p = $ * g + m, b = g * 7;
|
|
1828
|
+
this.drawRoundedSquare(N, p, q, b, G, O, !1, x), b = g * 3, q += g * 2, p += g * 2, this.drawRoundedSquare(N, p, q, b, Y, W, !0, x);
|
|
1829
1829
|
}, M.prototype.isInPositioninZone = function(x, g, m) {
|
|
1830
|
-
return m.some(function(
|
|
1831
|
-
return g >=
|
|
1830
|
+
return m.some(function(E) {
|
|
1831
|
+
return g >= E.row && g <= E.row + 7 && x >= E.col && x <= E.col + 7;
|
|
1832
1832
|
});
|
|
1833
1833
|
}, M.prototype.transformPixelLengthIntoNumberOfCells = function(x, g) {
|
|
1834
1834
|
return x / g;
|
|
1835
|
-
}, M.prototype.isCoordinateInImage = function(x, g, m,
|
|
1836
|
-
if (
|
|
1837
|
-
var
|
|
1838
|
-
return g >=
|
|
1835
|
+
}, M.prototype.isCoordinateInImage = function(x, g, m, E, $, D, V, N) {
|
|
1836
|
+
if (N) {
|
|
1837
|
+
var O = 2, W = this.transformPixelLengthIntoNumberOfCells($, V), G = this.transformPixelLengthIntoNumberOfCells(D, V), Y = this.transformPixelLengthIntoNumberOfCells(m, V) - 1, q = this.transformPixelLengthIntoNumberOfCells(E, V) - 1;
|
|
1838
|
+
return g >= W - O && g <= W + Y + O && x >= G - O && x <= G + q + O;
|
|
1839
1839
|
} else
|
|
1840
1840
|
return !1;
|
|
1841
1841
|
}, M.prototype.shouldComponentUpdate = function(x) {
|
|
@@ -1845,61 +1845,61 @@ function Qr() {
|
|
|
1845
1845
|
}, M.prototype.componentDidUpdate = function() {
|
|
1846
1846
|
this.update();
|
|
1847
1847
|
}, M.prototype.update = function() {
|
|
1848
|
-
var x, g = this.props, m = g.value,
|
|
1848
|
+
var x, g = this.props, m = g.value, E = g.ecLevel, $ = g.enableCORS, D = g.bgColor, V = g.fgColor, N = g.logoImage, O = g.logoOpacity, W = g.logoOnLoad, G = g.removeQrCodeBehindLogo, Y = g.qrStyle, q = g.eyeRadius, p = g.eyeColor, b = g.logoPaddingStyle, d = +this.props.size, w = +this.props.quietZone, a = this.props.logoWidth ? +this.props.logoWidth : 0, s = this.props.logoHeight ? +this.props.logoHeight : 0, n = this.props.logoPadding ? +this.props.logoPadding : 0, t = Z(0, E);
|
|
1849
1849
|
t.addData(this.utf16to8(m)), t.make();
|
|
1850
|
-
var v = (x = this.canvasRef) === null || x === void 0 ? void 0 : x.current, o = v.getContext("2d"), y = d + 2 * w,
|
|
1851
|
-
v.height = v.width = y *
|
|
1850
|
+
var v = (x = this.canvasRef) === null || x === void 0 ? void 0 : x.current, o = v.getContext("2d"), y = d + 2 * w, S = t.getModuleCount(), C = d / S, J = window.devicePixelRatio || 1;
|
|
1851
|
+
v.height = v.width = y * J, o.scale(J, J), o.fillStyle = D, o.fillRect(0, 0, y, y);
|
|
1852
1852
|
var U = w, ne = [
|
|
1853
1853
|
{ row: 0, col: 0 },
|
|
1854
|
-
{ row: 0, col:
|
|
1855
|
-
{ row:
|
|
1854
|
+
{ row: 0, col: S - 7 },
|
|
1855
|
+
{ row: S - 7, col: 0 }
|
|
1856
1856
|
];
|
|
1857
|
-
if (o.strokeStyle =
|
|
1858
|
-
o.fillStyle =
|
|
1859
|
-
for (var oe = C / 2, L = 0; L <
|
|
1860
|
-
for (var P = 0; P <
|
|
1857
|
+
if (o.strokeStyle = V, Y === "dots") {
|
|
1858
|
+
o.fillStyle = V;
|
|
1859
|
+
for (var oe = C / 2, L = 0; L < S; L++)
|
|
1860
|
+
for (var P = 0; P < S; P++)
|
|
1861
1861
|
t.isDark(L, P) && !this.isInPositioninZone(L, P, ne) && (o.beginPath(), o.arc(Math.round(P * C) + oe + U, Math.round(L * C) + oe + U, oe / 100 * 75, 0, 2 * Math.PI, !1), o.closePath(), o.fill());
|
|
1862
|
-
} else if (
|
|
1863
|
-
for (var oe = Math.ceil(C / 2), L = 0; L <
|
|
1864
|
-
for (var P = 0; P <
|
|
1862
|
+
} else if (Y === "fluid") {
|
|
1863
|
+
for (var oe = Math.ceil(C / 2), L = 0; L < S; L++)
|
|
1864
|
+
for (var P = 0; P < S; P++)
|
|
1865
1865
|
if (t.isDark(L, P) && !this.isInPositioninZone(L, P, ne)) {
|
|
1866
|
-
var
|
|
1867
|
-
L > 0 && !t.isDark(L - 1, P) && P > 0 && !t.isDark(L, P - 1) && (
|
|
1868
|
-
var
|
|
1869
|
-
o.fillStyle =
|
|
1866
|
+
var le = [!1, !1, !1, !1];
|
|
1867
|
+
L > 0 && !t.isDark(L - 1, P) && P > 0 && !t.isDark(L, P - 1) && (le[0] = !0), L > 0 && !t.isDark(L - 1, P) && P < S - 1 && !t.isDark(L, P + 1) && (le[1] = !0), L < S - 1 && !t.isDark(L + 1, P) && P < S - 1 && !t.isDark(L, P + 1) && (le[2] = !0), L < S - 1 && !t.isDark(L + 1, P) && P > 0 && !t.isDark(L, P - 1) && (le[3] = !0);
|
|
1868
|
+
var K = Math.ceil((P + 1) * C) - Math.floor(P * C), fe = Math.ceil((L + 1) * C) - Math.floor(L * C);
|
|
1869
|
+
o.fillStyle = V, o.beginPath(), o.arc(Math.round(P * C) + oe + U, Math.round(L * C) + oe + U, oe, 0, 2 * Math.PI, !1), o.closePath(), o.fill(), le[0] || o.fillRect(Math.round(P * C) + U, Math.round(L * C) + U, K / 2, fe / 2), le[1] || o.fillRect(Math.round(P * C) + U + Math.floor(K / 2), Math.round(L * C) + U, K / 2, fe / 2), le[2] || o.fillRect(Math.round(P * C) + U + Math.floor(K / 2), Math.round(L * C) + U + Math.floor(fe / 2), K / 2, fe / 2), le[3] || o.fillRect(Math.round(P * C) + U, Math.round(L * C) + U + Math.floor(fe / 2), K / 2, fe / 2);
|
|
1870
1870
|
}
|
|
1871
1871
|
} else
|
|
1872
|
-
for (var L = 0; L <
|
|
1873
|
-
for (var P = 0; P <
|
|
1872
|
+
for (var L = 0; L < S; L++)
|
|
1873
|
+
for (var P = 0; P < S; P++)
|
|
1874
1874
|
if (t.isDark(L, P) && !this.isInPositioninZone(L, P, ne)) {
|
|
1875
|
-
o.fillStyle =
|
|
1876
|
-
var
|
|
1877
|
-
o.fillRect(Math.round(P * C) + U, Math.round(L * C) + U,
|
|
1875
|
+
o.fillStyle = V;
|
|
1876
|
+
var K = Math.ceil((P + 1) * C) - Math.floor(P * C), fe = Math.ceil((L + 1) * C) - Math.floor(L * C);
|
|
1877
|
+
o.fillRect(Math.round(P * C) + U, Math.round(L * C) + U, K, fe);
|
|
1878
1878
|
}
|
|
1879
1879
|
for (var _e = 0; _e < 3; _e++) {
|
|
1880
|
-
var f = ne[_e], L = f.row, P = f.col, u =
|
|
1881
|
-
Array.isArray(u) && (u = u[_e]), typeof u == "number" && (u = [u, u, u, u]), p ? Array.isArray(p) ? i = p[_e] : i = p : i =
|
|
1880
|
+
var f = ne[_e], L = f.row, P = f.col, u = q, i = void 0;
|
|
1881
|
+
Array.isArray(u) && (u = u[_e]), typeof u == "number" && (u = [u, u, u, u]), p ? Array.isArray(p) ? i = p[_e] : i = p : i = V, this.drawPositioningPattern(o, C, U, L, P, i, u);
|
|
1882
1882
|
}
|
|
1883
|
-
if (
|
|
1883
|
+
if (N) {
|
|
1884
1884
|
var l = new Image();
|
|
1885
1885
|
$ && (l.crossOrigin = "Anonymous"), l.onload = function(h) {
|
|
1886
1886
|
o.save();
|
|
1887
|
-
var _ = a || d * 0.2,
|
|
1888
|
-
if (
|
|
1887
|
+
var _ = a || d * 0.2, R = s || _, I = (d - _) / 2, z = (d - R) / 2;
|
|
1888
|
+
if (G || n) {
|
|
1889
1889
|
o.beginPath(), o.strokeStyle = D, o.fillStyle = D;
|
|
1890
|
-
var te = _ + 2 * n, B =
|
|
1890
|
+
var te = _ + 2 * n, B = R + 2 * n, ce = I + U - n, ve = z + U - n;
|
|
1891
1891
|
if (b === "circle") {
|
|
1892
|
-
var ke =
|
|
1893
|
-
o.ellipse(ke,
|
|
1892
|
+
var ke = ce + te / 2, Ne = ve + B / 2;
|
|
1893
|
+
o.ellipse(ke, Ne, te / 2, B / 2, 0, 0, 2 * Math.PI), o.stroke(), o.fill();
|
|
1894
1894
|
} else
|
|
1895
|
-
o.fillRect(
|
|
1895
|
+
o.fillRect(ce, ve, te, B);
|
|
1896
1896
|
}
|
|
1897
|
-
o.globalAlpha =
|
|
1898
|
-
}, l.src =
|
|
1897
|
+
o.globalAlpha = O, o.drawImage(l, I + U, z + U, _, R), o.restore(), W && W(h);
|
|
1898
|
+
}, l.src = N;
|
|
1899
1899
|
}
|
|
1900
1900
|
}, M.prototype.render = function() {
|
|
1901
1901
|
var x, g = +this.props.size + 2 * +this.props.quietZone;
|
|
1902
|
-
return
|
|
1902
|
+
return j.createElement("canvas", { id: (x = this.props.id) !== null && x !== void 0 ? x : "react-qrcode-logo", height: g, width: g, style: Q({ height: g + "px", width: g + "px" }, this.props.style), ref: this.canvasRef });
|
|
1903
1903
|
}, M.defaultProps = {
|
|
1904
1904
|
value: "https://reactjs.org/",
|
|
1905
1905
|
ecLevel: "M",
|
|
@@ -1913,19 +1913,19 @@ function Qr() {
|
|
|
1913
1913
|
eyeRadius: [0, 0, 0],
|
|
1914
1914
|
logoPaddingStyle: "square"
|
|
1915
1915
|
}, M;
|
|
1916
|
-
}(
|
|
1916
|
+
}(j.Component)
|
|
1917
1917
|
);
|
|
1918
1918
|
return Ce.QRCode = X, Ce;
|
|
1919
1919
|
}
|
|
1920
|
-
var
|
|
1921
|
-
const
|
|
1922
|
-
/* @__PURE__ */
|
|
1920
|
+
var jt = Kr();
|
|
1921
|
+
const $t = () => /* @__PURE__ */ se("div", { className: "v-flex v-items-center v-justify-center", children: [
|
|
1922
|
+
/* @__PURE__ */ T(
|
|
1923
1923
|
"svg",
|
|
1924
1924
|
{
|
|
1925
1925
|
className: "v-h-16 v-w-16 v-animate-circular-rotate",
|
|
1926
1926
|
viewBox: "25 25 50 50",
|
|
1927
1927
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1928
|
-
children: /* @__PURE__ */
|
|
1928
|
+
children: /* @__PURE__ */ T(
|
|
1929
1929
|
"circle",
|
|
1930
1930
|
{
|
|
1931
1931
|
className: "v-circular-path",
|
|
@@ -1938,7 +1938,7 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
1938
1938
|
)
|
|
1939
1939
|
}
|
|
1940
1940
|
),
|
|
1941
|
-
/* @__PURE__ */
|
|
1941
|
+
/* @__PURE__ */ T("style", { children: `
|
|
1942
1942
|
@keyframes v-circular-rotate {
|
|
1943
1943
|
100% {
|
|
1944
1944
|
transform: rotate(360deg);
|
|
@@ -1970,29 +1970,101 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
1970
1970
|
animation: v-circular-dash 1.4s ease-in-out infinite;
|
|
1971
1971
|
}
|
|
1972
1972
|
` })
|
|
1973
|
-
] })
|
|
1974
|
-
|
|
1975
|
-
|
|
1973
|
+
] });
|
|
1974
|
+
class gt extends Fr {
|
|
1975
|
+
constructor(Q) {
|
|
1976
|
+
super(Q), this.state = {
|
|
1977
|
+
hasError: !1,
|
|
1978
|
+
error: null
|
|
1979
|
+
};
|
|
1980
|
+
}
|
|
1981
|
+
/**
|
|
1982
|
+
* Static method called when an error is thrown in a child component.
|
|
1983
|
+
* Updates the state to indicate an error has occurred.
|
|
1984
|
+
*
|
|
1985
|
+
* @param {Error} error - The error that was thrown
|
|
1986
|
+
* @returns {State} The new state with error information
|
|
1987
|
+
*/
|
|
1988
|
+
static getDerivedStateFromError(Q) {
|
|
1989
|
+
return {
|
|
1990
|
+
hasError: !0,
|
|
1991
|
+
error: Q
|
|
1992
|
+
};
|
|
1993
|
+
}
|
|
1994
|
+
/**
|
|
1995
|
+
* Called after an error has been thrown by a descendant component.
|
|
1996
|
+
* Logs the error for debugging purposes.
|
|
1997
|
+
*
|
|
1998
|
+
* @param {Error} error - The error that was thrown
|
|
1999
|
+
* @param {ErrorInfo} errorInfo - Additional error information
|
|
2000
|
+
*/
|
|
2001
|
+
componentDidCatch(Q, ee) {
|
|
2002
|
+
console.error("Authentication component error:", Q, ee);
|
|
2003
|
+
}
|
|
2004
|
+
render() {
|
|
2005
|
+
return this.state.hasError ? /* @__PURE__ */ se(
|
|
2006
|
+
"div",
|
|
2007
|
+
{
|
|
2008
|
+
className: "v-fixed v-inset-0 v-flex v-flex-col v-items-center v-justify-center v-p-6 v-text-center v-bg-white",
|
|
2009
|
+
style: {
|
|
2010
|
+
position: "fixed",
|
|
2011
|
+
top: 0,
|
|
2012
|
+
left: 0,
|
|
2013
|
+
right: 0,
|
|
2014
|
+
bottom: 0,
|
|
2015
|
+
zIndex: 9999
|
|
2016
|
+
},
|
|
2017
|
+
children: [
|
|
2018
|
+
/* @__PURE__ */ T("div", { className: "v-mb-4", children: /* @__PURE__ */ se(
|
|
2019
|
+
"svg",
|
|
2020
|
+
{
|
|
2021
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2022
|
+
width: "24",
|
|
2023
|
+
height: "24",
|
|
2024
|
+
viewBox: "0 0 24 24",
|
|
2025
|
+
fill: "none",
|
|
2026
|
+
stroke: "#ef4444",
|
|
2027
|
+
strokeWidth: "2",
|
|
2028
|
+
strokeLinecap: "round",
|
|
2029
|
+
strokeLinejoin: "round",
|
|
2030
|
+
className: "v-w-16 v-h-16",
|
|
2031
|
+
children: [
|
|
2032
|
+
/* @__PURE__ */ T("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2033
|
+
/* @__PURE__ */ T("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
2034
|
+
/* @__PURE__ */ T("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
2035
|
+
]
|
|
2036
|
+
}
|
|
2037
|
+
) }),
|
|
2038
|
+
/* @__PURE__ */ T("h2", { className: "v-text-xl v-font-semibold v-text-black v-mb-2", children: "Something went wrong" }),
|
|
2039
|
+
/* @__PURE__ */ T("p", { className: "v-text-gray-600 v-text-sm", children: "An unexpected error occurred during authentication. Please try again." })
|
|
2040
|
+
]
|
|
2041
|
+
}
|
|
2042
|
+
) : this.props.children;
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
const Wr = ({
|
|
2046
|
+
title: k,
|
|
2047
|
+
containerClass: Q
|
|
1976
2048
|
}) => {
|
|
1977
|
-
const ee = (/* @__PURE__ */ new Date()).getFullYear(), [
|
|
2049
|
+
const ee = (/* @__PURE__ */ new Date()).getFullYear(), [Z, j] = ge(""), [X, F] = ge(""), [M, x] = ge(!1), {
|
|
1978
2050
|
apiUrl: g,
|
|
1979
2051
|
clientId: m,
|
|
1980
|
-
codeChallenge:
|
|
2052
|
+
codeChallenge: E,
|
|
1981
2053
|
authRequestId: $,
|
|
1982
2054
|
authRequestIdExpires: D,
|
|
1983
|
-
setIsAuthenticating:
|
|
1984
|
-
isAuthenticating:
|
|
1985
|
-
token:
|
|
1986
|
-
setAuthError:
|
|
2055
|
+
setIsAuthenticating: V,
|
|
2056
|
+
isAuthenticating: N,
|
|
2057
|
+
token: O,
|
|
2058
|
+
setAuthError: W
|
|
1987
2059
|
} = Ze($e);
|
|
1988
2060
|
je(() => {
|
|
1989
|
-
if (
|
|
1990
|
-
const
|
|
2061
|
+
if (E && $ && D) {
|
|
2062
|
+
const q = D.getTime() / 1e3, p = `c=${E},r=${$},e=${q},a=${m}`;
|
|
1991
2063
|
F(p);
|
|
1992
2064
|
}
|
|
1993
|
-
}, [m, $, D,
|
|
1994
|
-
const
|
|
1995
|
-
async (
|
|
2065
|
+
}, [m, $, D, E]);
|
|
2066
|
+
const G = Ie(
|
|
2067
|
+
async (q) => {
|
|
1996
2068
|
try {
|
|
1997
2069
|
const p = await fetch(
|
|
1998
2070
|
`${g}/v-plus/auth/req?cid=${m}`,
|
|
@@ -2002,52 +2074,52 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2002
2074
|
Accept: "application/json",
|
|
2003
2075
|
"Content-Type": "application/json"
|
|
2004
2076
|
},
|
|
2005
|
-
body: JSON.stringify(
|
|
2077
|
+
body: JSON.stringify(q)
|
|
2006
2078
|
}
|
|
2007
2079
|
), b = await p.json();
|
|
2008
2080
|
if (!p.ok || b.ok === !1) {
|
|
2009
|
-
|
|
2081
|
+
W(
|
|
2010
2082
|
`Auth request failed: ${b.message || p.status}`
|
|
2011
2083
|
);
|
|
2012
2084
|
return;
|
|
2013
2085
|
}
|
|
2014
2086
|
return b;
|
|
2015
2087
|
} catch (p) {
|
|
2016
|
-
|
|
2088
|
+
W(`Auth request failed: ${p}`);
|
|
2017
2089
|
}
|
|
2018
2090
|
},
|
|
2019
|
-
[g, m,
|
|
2020
|
-
),
|
|
2091
|
+
[g, m, W]
|
|
2092
|
+
), Y = Ie(async () => {
|
|
2021
2093
|
x(!0);
|
|
2022
2094
|
try {
|
|
2023
|
-
if (!
|
|
2024
|
-
|
|
2095
|
+
if (!Z) {
|
|
2096
|
+
W("Invalid login. Email or Abaxx ID is required.");
|
|
2025
2097
|
return;
|
|
2026
2098
|
}
|
|
2027
|
-
const
|
|
2028
|
-
alias:
|
|
2029
|
-
code_challenge:
|
|
2099
|
+
const q = await G({
|
|
2100
|
+
alias: Z,
|
|
2101
|
+
code_challenge: E,
|
|
2030
2102
|
request_id: $
|
|
2031
2103
|
});
|
|
2032
|
-
|
|
2033
|
-
} catch (
|
|
2034
|
-
|
|
2104
|
+
q != null && q.ok ? V(!0) : !(q != null && q.ok) && (q == null ? void 0 : q.message) === "Unable to request auth." && W("Invalid login. Please use your existing Email or Abaxx ID.");
|
|
2105
|
+
} catch (q) {
|
|
2106
|
+
W("Something went wrong. Please try again later."), console.error(q);
|
|
2035
2107
|
}
|
|
2036
2108
|
x(!1);
|
|
2037
|
-
}, [
|
|
2038
|
-
return /* @__PURE__ */
|
|
2109
|
+
}, [E, $, Z, x, V, G, W]);
|
|
2110
|
+
return /* @__PURE__ */ T(We, { children: /* @__PURE__ */ se(
|
|
2039
2111
|
"div",
|
|
2040
2112
|
{
|
|
2041
|
-
className: `v-auth-container v-grid v-grid-responsive v-h-screen v-bg-white ${
|
|
2113
|
+
className: `v-auth-container v-grid v-grid-responsive v-h-screen v-bg-white ${Q}`,
|
|
2042
2114
|
children: [
|
|
2043
|
-
/* @__PURE__ */
|
|
2115
|
+
/* @__PURE__ */ T(
|
|
2044
2116
|
"div",
|
|
2045
2117
|
{
|
|
2046
2118
|
className: "v-relative v-bg-left v-bg-cover v-bg-no-repeat v-h-full",
|
|
2047
2119
|
style: {
|
|
2048
2120
|
backgroundImage: "url('https://content.abaxx.com/assets/static/email-bg-1.png')"
|
|
2049
2121
|
},
|
|
2050
|
-
children: /* @__PURE__ */
|
|
2122
|
+
children: /* @__PURE__ */ T(
|
|
2051
2123
|
"div",
|
|
2052
2124
|
{
|
|
2053
2125
|
className: "divider v-h-full v-absolute v-bg-white",
|
|
@@ -2056,8 +2128,8 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2056
2128
|
)
|
|
2057
2129
|
}
|
|
2058
2130
|
),
|
|
2059
|
-
/* @__PURE__ */
|
|
2060
|
-
/* @__PURE__ */
|
|
2131
|
+
/* @__PURE__ */ se("div", { className: "v-flex v-flex-col v-items-center v-justify-center v-px-4", children: [
|
|
2132
|
+
/* @__PURE__ */ T(
|
|
2061
2133
|
"img",
|
|
2062
2134
|
{
|
|
2063
2135
|
src: "https://content.abaxx.com/assets/static/abaxx-logo.png",
|
|
@@ -2067,9 +2139,9 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2067
2139
|
height: 56
|
|
2068
2140
|
}
|
|
2069
2141
|
),
|
|
2070
|
-
!
|
|
2071
|
-
/* @__PURE__ */
|
|
2072
|
-
|
|
2142
|
+
!O && !N ? /* @__PURE__ */ se(We, { children: [
|
|
2143
|
+
/* @__PURE__ */ T("div", { className: "v-mb-8", children: $ && X ? /* @__PURE__ */ T(
|
|
2144
|
+
jt.QRCode,
|
|
2073
2145
|
{
|
|
2074
2146
|
value: X,
|
|
2075
2147
|
size: 130,
|
|
@@ -2080,29 +2152,29 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2080
2152
|
logoHeight: 20,
|
|
2081
2153
|
quietZone: 0
|
|
2082
2154
|
}
|
|
2083
|
-
) : /* @__PURE__ */
|
|
2084
|
-
/* @__PURE__ */
|
|
2085
|
-
/* @__PURE__ */
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
/* @__PURE__ */
|
|
2155
|
+
) : /* @__PURE__ */ T("div", { className: "v-w-130 v-h-130 v-flex v-items-center v-justify-center", children: /* @__PURE__ */ T($t, {}) }) }),
|
|
2156
|
+
/* @__PURE__ */ T("h1", { className: "v-text-black v-text-xl v-tracking-wide v-mb-4 v-font-medium", children: k || "Verifier+ Login" }),
|
|
2157
|
+
/* @__PURE__ */ T("p", { className: "v-text-gray-400 v-font-semibold v-mb-6 v-text-sm", children: "Sign in using the latest version of Verifier+ or enter Abaxx ID" }),
|
|
2158
|
+
/* @__PURE__ */ se("div", { className: "v-min-w-300", children: [
|
|
2159
|
+
/* @__PURE__ */ T(
|
|
2088
2160
|
"input",
|
|
2089
2161
|
{
|
|
2090
2162
|
type: "text",
|
|
2091
2163
|
className: "v-input v-w-full v-h-10 v-mb-4 v-rounded v-bg-transparent v-text-gray-600 v-border-gray-400 v-border v-px-2 v-text-center",
|
|
2092
2164
|
placeholder: "Enter Email or Abaxx ID",
|
|
2093
|
-
value:
|
|
2094
|
-
onChange: (
|
|
2165
|
+
value: Z,
|
|
2166
|
+
onChange: (q) => j(q.target.value),
|
|
2095
2167
|
disabled: M
|
|
2096
2168
|
}
|
|
2097
2169
|
),
|
|
2098
|
-
/* @__PURE__ */
|
|
2170
|
+
/* @__PURE__ */ se(
|
|
2099
2171
|
"button",
|
|
2100
2172
|
{
|
|
2101
2173
|
className: "v-button v-h-10 v-w-full v-bg-red v-text-white v-text-base v-font-semibold v-flex v-items-center v-gap-2 v-justify-center",
|
|
2102
|
-
disabled: M || !
|
|
2103
|
-
onClick:
|
|
2174
|
+
disabled: M || !Z || !$,
|
|
2175
|
+
onClick: Y,
|
|
2104
2176
|
children: [
|
|
2105
|
-
M && /* @__PURE__ */
|
|
2177
|
+
M && /* @__PURE__ */ T(
|
|
2106
2178
|
"svg",
|
|
2107
2179
|
{
|
|
2108
2180
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2115,7 +2187,7 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2115
2187
|
strokeLinecap: "round",
|
|
2116
2188
|
strokeLinejoin: "round",
|
|
2117
2189
|
className: "v-h-4 v-w-4 v-animate-spin",
|
|
2118
|
-
children: /* @__PURE__ */
|
|
2190
|
+
children: /* @__PURE__ */ T("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
2119
2191
|
}
|
|
2120
2192
|
),
|
|
2121
2193
|
"Sign In"
|
|
@@ -2123,8 +2195,8 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2123
2195
|
}
|
|
2124
2196
|
)
|
|
2125
2197
|
] })
|
|
2126
|
-
] }) : /* @__PURE__ */
|
|
2127
|
-
/* @__PURE__ */
|
|
2198
|
+
] }) : /* @__PURE__ */ se("div", { className: "v-fade-in v-flex v-items-center v-flex-col", children: [
|
|
2199
|
+
/* @__PURE__ */ T(
|
|
2128
2200
|
"svg",
|
|
2129
2201
|
{
|
|
2130
2202
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2137,18 +2209,18 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2137
2209
|
strokeLinecap: "round",
|
|
2138
2210
|
strokeLinejoin: "round",
|
|
2139
2211
|
className: "v-mb-5 v-w-20 v-h-20",
|
|
2140
|
-
children: /* @__PURE__ */
|
|
2212
|
+
children: /* @__PURE__ */ T("path", { d: "M20 6 9 17l-5-5" })
|
|
2141
2213
|
}
|
|
2142
2214
|
),
|
|
2143
|
-
|
|
2144
|
-
/* @__PURE__ */
|
|
2145
|
-
/* @__PURE__ */
|
|
2215
|
+
O ? /* @__PURE__ */ T("div", { className: "v-text-2xl v-mb-3 v-text-black", children: /* @__PURE__ */ T("span", { children: "Login success!" }) }) : /* @__PURE__ */ se(We, { children: [
|
|
2216
|
+
/* @__PURE__ */ T("div", { className: "v-text-2xl v-mb-3 v-text-black", children: /* @__PURE__ */ T("span", { children: "Authorization requested!" }) }),
|
|
2217
|
+
/* @__PURE__ */ T("div", { className: "v-text-center v-rounded v-bg-slate-100 v-text-slate-800 v-p-3 v-my-4", children: /* @__PURE__ */ T("span", { children: "Please check the Abaxx Verifier App" }) })
|
|
2146
2218
|
] })
|
|
2147
2219
|
] }),
|
|
2148
|
-
/* @__PURE__ */
|
|
2149
|
-
/* @__PURE__ */
|
|
2150
|
-
/* @__PURE__ */
|
|
2151
|
-
/* @__PURE__ */
|
|
2220
|
+
/* @__PURE__ */ se("div", { className: "v-text-center v-text-sm v-p-6 v-font-semibold", children: [
|
|
2221
|
+
/* @__PURE__ */ T("span", { className: "v-text-gray-400", children: `© ${ee} ` }),
|
|
2222
|
+
/* @__PURE__ */ T("span", { className: "v-text-gray-800", children: "Abaxx Technologies" }),
|
|
2223
|
+
/* @__PURE__ */ se("span", { className: "v-text-gray-400", children: [
|
|
2152
2224
|
" ",
|
|
2153
2225
|
"| All rights reserved"
|
|
2154
2226
|
] })
|
|
@@ -2157,51 +2229,51 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2157
2229
|
]
|
|
2158
2230
|
}
|
|
2159
2231
|
) });
|
|
2160
|
-
},
|
|
2161
|
-
size:
|
|
2162
|
-
qrColor:
|
|
2232
|
+
}, en = (k) => /* @__PURE__ */ T(gt, { children: /* @__PURE__ */ T(Wr, { ...k }) }), Zr = ({
|
|
2233
|
+
size: k = 130,
|
|
2234
|
+
qrColor: Q = "#e60100",
|
|
2163
2235
|
logoImage: ee = "https://content.abaxx.com/assets/static/qr-logo.png",
|
|
2164
|
-
logoWidth:
|
|
2165
|
-
logoHeight:
|
|
2236
|
+
logoWidth: Z = 40,
|
|
2237
|
+
logoHeight: j = 20,
|
|
2166
2238
|
quietZone: X = 0,
|
|
2167
2239
|
containerClass: F = "",
|
|
2168
2240
|
showStatus: M = !0,
|
|
2169
2241
|
checkmarkColor: x = "#c40808"
|
|
2170
2242
|
}) => {
|
|
2171
2243
|
const [g, m] = ge(""), {
|
|
2172
|
-
clientId:
|
|
2244
|
+
clientId: E,
|
|
2173
2245
|
codeChallenge: $,
|
|
2174
2246
|
authRequestId: D,
|
|
2175
|
-
authRequestIdExpires:
|
|
2176
|
-
isAuthenticating:
|
|
2177
|
-
token:
|
|
2247
|
+
authRequestIdExpires: V,
|
|
2248
|
+
isAuthenticating: N,
|
|
2249
|
+
token: O
|
|
2178
2250
|
} = Ze($e);
|
|
2179
2251
|
return je(() => {
|
|
2180
|
-
if ($ && D &&
|
|
2181
|
-
const
|
|
2182
|
-
m(
|
|
2252
|
+
if ($ && D && V) {
|
|
2253
|
+
const W = V.getTime() / 1e3, G = `c=${$},r=${D},e=${W},a=${E}`;
|
|
2254
|
+
m(G);
|
|
2183
2255
|
}
|
|
2184
|
-
}, [
|
|
2185
|
-
|
|
2256
|
+
}, [E, D, V, $]), /* @__PURE__ */ T("div", { className: `v-auth-qr-container ${F}`, children: !O && !N ? /* @__PURE__ */ T("div", { className: "v-qr-wrapper", children: D && g ? /* @__PURE__ */ T(
|
|
2257
|
+
jt.QRCode,
|
|
2186
2258
|
{
|
|
2187
2259
|
value: g,
|
|
2188
|
-
size:
|
|
2189
|
-
fgColor:
|
|
2260
|
+
size: k,
|
|
2261
|
+
fgColor: Q,
|
|
2190
2262
|
qrStyle: "dots",
|
|
2191
2263
|
logoImage: ee,
|
|
2192
|
-
logoWidth:
|
|
2193
|
-
logoHeight:
|
|
2264
|
+
logoWidth: Z,
|
|
2265
|
+
logoHeight: j,
|
|
2194
2266
|
quietZone: X
|
|
2195
2267
|
}
|
|
2196
|
-
) : /* @__PURE__ */
|
|
2268
|
+
) : /* @__PURE__ */ T(
|
|
2197
2269
|
"div",
|
|
2198
2270
|
{
|
|
2199
2271
|
className: "v-flex v-items-center v-justify-center",
|
|
2200
|
-
style: { width:
|
|
2201
|
-
children: /* @__PURE__ */
|
|
2272
|
+
style: { width: k, height: k },
|
|
2273
|
+
children: /* @__PURE__ */ T($t, {})
|
|
2202
2274
|
}
|
|
2203
|
-
) }) : M ? /* @__PURE__ */
|
|
2204
|
-
/* @__PURE__ */
|
|
2275
|
+
) }) : M ? /* @__PURE__ */ se("div", { className: "v-fade-in v-flex v-items-center v-flex-col", children: [
|
|
2276
|
+
/* @__PURE__ */ T(
|
|
2205
2277
|
"svg",
|
|
2206
2278
|
{
|
|
2207
2279
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2214,35 +2286,35 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2214
2286
|
strokeLinecap: "round",
|
|
2215
2287
|
strokeLinejoin: "round",
|
|
2216
2288
|
className: "v-mb-5",
|
|
2217
|
-
style: { width:
|
|
2218
|
-
children: /* @__PURE__ */
|
|
2289
|
+
style: { width: k * 0.6, height: k * 0.6 },
|
|
2290
|
+
children: /* @__PURE__ */ T("path", { d: "M20 6 9 17l-5-5" })
|
|
2219
2291
|
}
|
|
2220
2292
|
),
|
|
2221
|
-
|
|
2222
|
-
/* @__PURE__ */
|
|
2223
|
-
/* @__PURE__ */
|
|
2293
|
+
O ? /* @__PURE__ */ T("div", { className: "v-text-lg v-mb-3 v-text-black", children: /* @__PURE__ */ T("span", { children: "Login success!" }) }) : /* @__PURE__ */ se(We, { children: [
|
|
2294
|
+
/* @__PURE__ */ T("div", { className: "v-text-lg v-mb-3 v-text-black", children: /* @__PURE__ */ T("span", { children: "Authorization requested!" }) }),
|
|
2295
|
+
/* @__PURE__ */ T("div", { className: "v-text-center v-rounded v-bg-slate-100 v-text-slate-800 v-p-3 v-my-4", children: /* @__PURE__ */ T("span", { children: "Please check the Abaxx Verifier App" }) })
|
|
2224
2296
|
] })
|
|
2225
2297
|
] }) : null });
|
|
2226
|
-
},
|
|
2227
|
-
inputPlaceholder:
|
|
2228
|
-
buttonText:
|
|
2298
|
+
}, tn = (k) => /* @__PURE__ */ T(gt, { children: /* @__PURE__ */ T(Zr, { ...k }) }), Jr = ({
|
|
2299
|
+
inputPlaceholder: k = "Enter Email or Abaxx ID",
|
|
2300
|
+
buttonText: Q = "Sign In",
|
|
2229
2301
|
inputHeight: ee = "v-h-10",
|
|
2230
|
-
inputWidth:
|
|
2231
|
-
inputTextColor:
|
|
2302
|
+
inputWidth: Z = "v-w-full",
|
|
2303
|
+
inputTextColor: j = "v-text-gray-600",
|
|
2232
2304
|
inputBorderColor: X = "v-border-gray-400",
|
|
2233
2305
|
inputBackgroundColor: F = "v-bg-transparent",
|
|
2234
2306
|
buttonHeight: M = "v-h-10",
|
|
2235
2307
|
buttonWidth: x = "v-w-full",
|
|
2236
2308
|
buttonBackgroundColor: g = "v-bg-red",
|
|
2237
2309
|
buttonTextColor: m = "v-text-white",
|
|
2238
|
-
containerClass:
|
|
2310
|
+
containerClass: E = "",
|
|
2239
2311
|
checkmarkColor: $ = "#c40808"
|
|
2240
2312
|
}) => {
|
|
2241
|
-
const [D,
|
|
2242
|
-
apiUrl:
|
|
2243
|
-
clientId:
|
|
2244
|
-
codeChallenge:
|
|
2245
|
-
authRequestId:
|
|
2313
|
+
const [D, V] = ge(""), [N, O] = ge(!1), {
|
|
2314
|
+
apiUrl: W,
|
|
2315
|
+
clientId: G,
|
|
2316
|
+
codeChallenge: Y,
|
|
2317
|
+
authRequestId: q,
|
|
2246
2318
|
setIsAuthenticating: p,
|
|
2247
2319
|
setAuthError: b,
|
|
2248
2320
|
isAuthenticating: d,
|
|
@@ -2251,7 +2323,7 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2251
2323
|
async (n) => {
|
|
2252
2324
|
try {
|
|
2253
2325
|
const t = await fetch(
|
|
2254
|
-
`${
|
|
2326
|
+
`${W}/v-plus/auth/req?cid=${G}`,
|
|
2255
2327
|
{
|
|
2256
2328
|
method: "POST",
|
|
2257
2329
|
headers: {
|
|
@@ -2272,9 +2344,9 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2272
2344
|
b(`Auth request failed: ${t}`);
|
|
2273
2345
|
}
|
|
2274
2346
|
},
|
|
2275
|
-
[
|
|
2347
|
+
[W, G, b]
|
|
2276
2348
|
), s = Ie(async () => {
|
|
2277
|
-
|
|
2349
|
+
O(!0);
|
|
2278
2350
|
try {
|
|
2279
2351
|
if (!D) {
|
|
2280
2352
|
b("Invalid login. Email or Abaxx ID is required.");
|
|
@@ -2282,33 +2354,33 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2282
2354
|
}
|
|
2283
2355
|
const n = await a({
|
|
2284
2356
|
alias: D,
|
|
2285
|
-
code_challenge:
|
|
2286
|
-
request_id:
|
|
2357
|
+
code_challenge: Y,
|
|
2358
|
+
request_id: q
|
|
2287
2359
|
});
|
|
2288
2360
|
n != null && n.ok ? p(!0) : !(n != null && n.ok) && (n == null ? void 0 : n.message) === "Unable to request auth." && b("Invalid login. Please use your existing Email or Abaxx ID.");
|
|
2289
2361
|
} catch (n) {
|
|
2290
2362
|
b("Something went wrong. Please try again later."), console.error(n);
|
|
2291
2363
|
}
|
|
2292
|
-
|
|
2293
|
-
}, [
|
|
2294
|
-
return /* @__PURE__ */
|
|
2295
|
-
/* @__PURE__ */
|
|
2364
|
+
O(!1);
|
|
2365
|
+
}, [Y, q, D, O, p, a, b]);
|
|
2366
|
+
return /* @__PURE__ */ T("div", { className: `v-auth-email-container ${E}`, children: !w && !d ? /* @__PURE__ */ se("div", { className: "v-min-w-300", children: [
|
|
2367
|
+
/* @__PURE__ */ T(
|
|
2296
2368
|
"input",
|
|
2297
2369
|
{
|
|
2298
2370
|
type: "text",
|
|
2299
|
-
className: `v-input ${
|
|
2371
|
+
className: `v-input ${Z} ${ee} v-mb-4 v-rounded v-border v-px-2 v-text-center`,
|
|
2300
2372
|
style: {
|
|
2301
2373
|
backgroundColor: F.startsWith("#") ? F : F === "v-bg-transparent" ? "transparent" : F === "v-bg-white" ? "#ffffff" : "transparent",
|
|
2302
|
-
color:
|
|
2374
|
+
color: j.startsWith("#") ? j : j === "v-text-gray-600" ? "#6b7280" : j === "v-text-black" ? "#000000" : j === "v-text-white" ? "#ffffff" : "#6b7280",
|
|
2303
2375
|
borderColor: X.startsWith("#") ? X : X === "v-border-gray-400" ? "#9ca3af" : X === "v-border-blue-400" ? "#60a5fa" : "#9ca3af"
|
|
2304
2376
|
},
|
|
2305
|
-
placeholder:
|
|
2377
|
+
placeholder: k,
|
|
2306
2378
|
value: D,
|
|
2307
|
-
onChange: (n) =>
|
|
2308
|
-
disabled:
|
|
2379
|
+
onChange: (n) => V(n.target.value),
|
|
2380
|
+
disabled: N
|
|
2309
2381
|
}
|
|
2310
2382
|
),
|
|
2311
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ se(
|
|
2312
2384
|
"button",
|
|
2313
2385
|
{
|
|
2314
2386
|
className: `v-button ${M} ${x} v-text-base v-font-semibold v-flex v-items-center v-gap-2 v-justify-center`,
|
|
@@ -2316,10 +2388,10 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2316
2388
|
backgroundColor: g.startsWith("#") ? g : g === "v-bg-blue" ? "#3b82f6" : g === "v-bg-red" ? "#ef4444" : g === "v-bg-green" ? "#10b981" : g === "v-bg-purple" ? "#8b5cf6" : g === "v-bg-yellow" ? "#f59e0b" : g === "v-bg-gray" ? "#6b7280" : "#ef4444",
|
|
2317
2389
|
color: m.startsWith("#") ? m : m === "v-text-white" ? "#ffffff" : m === "v-text-black" ? "#000000" : m === "v-text-gray-600" ? "#6b7280" : "#ffffff"
|
|
2318
2390
|
},
|
|
2319
|
-
disabled:
|
|
2391
|
+
disabled: N || !D || !q,
|
|
2320
2392
|
onClick: s,
|
|
2321
2393
|
children: [
|
|
2322
|
-
|
|
2394
|
+
N && /* @__PURE__ */ T(
|
|
2323
2395
|
"svg",
|
|
2324
2396
|
{
|
|
2325
2397
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2332,15 +2404,15 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2332
2404
|
strokeLinecap: "round",
|
|
2333
2405
|
strokeLinejoin: "round",
|
|
2334
2406
|
className: "v-h-4 v-w-4 v-animate-spin",
|
|
2335
|
-
children: /* @__PURE__ */
|
|
2407
|
+
children: /* @__PURE__ */ T("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
2336
2408
|
}
|
|
2337
2409
|
),
|
|
2338
|
-
|
|
2410
|
+
Q
|
|
2339
2411
|
]
|
|
2340
2412
|
}
|
|
2341
2413
|
)
|
|
2342
|
-
] }) : /* @__PURE__ */
|
|
2343
|
-
/* @__PURE__ */
|
|
2414
|
+
] }) : /* @__PURE__ */ se("div", { className: "v-fade-in v-flex v-items-center v-flex-col", children: [
|
|
2415
|
+
/* @__PURE__ */ T(
|
|
2344
2416
|
"svg",
|
|
2345
2417
|
{
|
|
2346
2418
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2353,31 +2425,31 @@ const jt = () => /* @__PURE__ */ he("div", { className: "v-flex v-items-center v
|
|
|
2353
2425
|
strokeLinecap: "round",
|
|
2354
2426
|
strokeLinejoin: "round",
|
|
2355
2427
|
className: "v-mb-5 v-w-20 v-h-20",
|
|
2356
|
-
children: /* @__PURE__ */
|
|
2428
|
+
children: /* @__PURE__ */ T("path", { d: "M20 6 9 17l-5-5" })
|
|
2357
2429
|
}
|
|
2358
2430
|
),
|
|
2359
|
-
w ? /* @__PURE__ */
|
|
2360
|
-
/* @__PURE__ */
|
|
2361
|
-
/* @__PURE__ */
|
|
2431
|
+
w ? /* @__PURE__ */ T("div", { className: "v-text-2xl v-mb-3 v-text-black", children: /* @__PURE__ */ T("span", { children: "Login success!" }) }) : /* @__PURE__ */ se(We, { children: [
|
|
2432
|
+
/* @__PURE__ */ T("div", { className: "v-text-2xl v-mb-3 v-text-black", children: /* @__PURE__ */ T("span", { children: "Authorization requested!" }) }),
|
|
2433
|
+
/* @__PURE__ */ T("div", { className: "v-text-center v-rounded v-bg-slate-100 v-text-slate-800 v-p-3 v-my-4", children: /* @__PURE__ */ T("span", { children: "Please check the Abaxx Verifier App" }) })
|
|
2362
2434
|
] })
|
|
2363
2435
|
] }) });
|
|
2364
|
-
};
|
|
2365
|
-
function
|
|
2366
|
-
const { resetState:
|
|
2367
|
-
return
|
|
2436
|
+
}, rn = (k) => /* @__PURE__ */ T(gt, { children: /* @__PURE__ */ T(Jr, { ...k }) });
|
|
2437
|
+
function nn() {
|
|
2438
|
+
const { resetState: k } = Ze($e);
|
|
2439
|
+
return k;
|
|
2368
2440
|
}
|
|
2369
|
-
function
|
|
2370
|
-
|
|
2441
|
+
function an(k) {
|
|
2442
|
+
k.resetState();
|
|
2371
2443
|
}
|
|
2372
2444
|
export {
|
|
2373
2445
|
$e as VContext,
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2446
|
+
Ur as VContextProvider,
|
|
2447
|
+
en as VerifierAuth,
|
|
2448
|
+
rn as VerifierAuthEmail,
|
|
2449
|
+
tn as VerifierAuthQr,
|
|
2450
|
+
zr as VerifierProvider,
|
|
2451
|
+
kt as base64urlEncode,
|
|
2452
|
+
Hr as generateCodeVerifier,
|
|
2453
|
+
an as resetVerifierStateUnsafe,
|
|
2454
|
+
nn as useVerifierReset
|
|
2383
2455
|
};
|