@nice2dev/ui-security 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,7 +1,8 @@
1
1
  import { jsx as c, jsxs as P, Fragment as Pe } from "react/jsx-runtime";
2
- import { useContext as Ee, createContext as Fe, useRef as ee, useState as _, useCallback as G, useEffect as ne, useMemo as ae } from "react";
3
- import { NtdBackspace as ze, NtdArrowLeft as Ne, NtdArrowRight as Le } from "@nice2dev/icons";
4
- const $e = {
2
+ import { useContext as Ee, createContext as Fe, useRef as V, useState as j, useCallback as K, useEffect as ne, useMemo as ae } from "react";
3
+ import { useNiceTranslation as ze } from "@nice2dev/ui-core";
4
+ import { NtdBackspace as Ne, NtdArrowLeft as Le, NtdArrowRight as $e } from "@nice2dev/icons";
5
+ const je = {
5
6
  low: 0.7,
6
7
  medium: 0.8,
7
8
  high: 0.85,
@@ -21,7 +22,7 @@ const $e = {
21
22
  };
22
23
  function fe(e) {
23
24
  const t = { ..._e, ...e };
24
- return e != null && e.matchThreshold || (t.matchThreshold = $e[t.securityLevel]), t;
25
+ return e != null && e.matchThreshold || (t.matchThreshold = je[t.securityLevel]), t;
25
26
  }
26
27
  async function ue(e) {
27
28
  const t = new TextEncoder().encode(e), r = await crypto.subtle.digest("SHA-256", t);
@@ -31,11 +32,11 @@ function ye(e = 8) {
31
32
  const t = new Uint8Array(e);
32
33
  return crypto.getRandomValues(t), Array.from(t).map((r) => r.toString(36).padStart(2, "0")).join("").slice(0, e);
33
34
  }
34
- function je(e) {
35
+ function Be(e) {
35
36
  const t = new Uint32Array(1);
36
37
  return crypto.getRandomValues(t), t[0] % e;
37
38
  }
38
- function Be(e, t) {
39
+ function We(e, t) {
39
40
  return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
40
41
  }
41
42
  async function pe(e = "user") {
@@ -45,143 +46,143 @@ async function pe(e = "user") {
45
46
  });
46
47
  }
47
48
  function le(e, t, r) {
48
- const n = t ?? e.videoWidth, s = r ?? e.videoHeight, i = document.createElement("canvas");
49
- i.width = n, i.height = s;
50
- const o = i.getContext("2d");
51
- o.drawImage(e, 0, 0, n, s);
52
- const a = o.getImageData(0, 0, n, s);
53
- return { canvas: i, ctx: o, imageData: a };
49
+ const n = t ?? e.videoWidth, o = r ?? e.videoHeight, s = document.createElement("canvas");
50
+ s.width = n, s.height = o;
51
+ const a = s.getContext("2d");
52
+ a.drawImage(e, 0, 0, n, o);
53
+ const i = a.getImageData(0, 0, n, o);
54
+ return { canvas: s, ctx: a, imageData: i };
54
55
  }
55
56
  function ce(e) {
56
57
  const t = new Uint8Array(e.width * e.height), r = e.data;
57
58
  for (let n = 0; n < t.length; n++) {
58
- const s = n * 4;
59
- t[n] = Math.round(0.299 * r[s] + 0.587 * r[s + 1] + 0.114 * r[s + 2]);
59
+ const o = n * 4;
60
+ t[n] = Math.round(0.299 * r[o] + 0.587 * r[o + 1] + 0.114 * r[o + 2]);
60
61
  }
61
62
  return t;
62
63
  }
63
64
  function Ae(e, t, r) {
64
- const n = new Uint8Array(t * r), s = [1, 2, 1, 2, 4, 2, 1, 2, 1], i = 16;
65
- for (let o = 1; o < r - 1; o++)
66
- for (let a = 1; a < t - 1; a++) {
67
- let g = 0, v = 0;
65
+ const n = new Uint8Array(t * r), o = [1, 2, 1, 2, 4, 2, 1, 2, 1], s = 16;
66
+ for (let a = 1; a < r - 1; a++)
67
+ for (let i = 1; i < t - 1; i++) {
68
+ let y = 0, b = 0;
68
69
  for (let f = -1; f <= 1; f++)
69
- for (let m = -1; m <= 1; m++)
70
- g += e[(o + f) * t + (a + m)] * s[v++];
71
- n[o * t + a] = Math.round(g / i);
70
+ for (let x = -1; x <= 1; x++)
71
+ y += e[(a + f) * t + (i + x)] * o[b++];
72
+ n[a * t + i] = Math.round(y / s);
72
73
  }
73
74
  return n;
74
75
  }
75
- function We(e, t, r) {
76
+ function He(e, t, r) {
76
77
  const n = new Uint8Array(t * r);
77
- for (let s = 1; s < r - 1; s++)
78
- for (let i = 1; i < t - 1; i++) {
79
- const o = -e[(s - 1) * t + (i - 1)] + e[(s - 1) * t + (i + 1)] + -2 * e[s * t + (i - 1)] + 2 * e[s * t + (i + 1)] + -e[(s + 1) * t + (i - 1)] + e[(s + 1) * t + (i + 1)], a = -e[(s - 1) * t + (i - 1)] - 2 * e[(s - 1) * t + i] - e[(s - 1) * t + (i + 1)] + e[(s + 1) * t + (i - 1)] + 2 * e[(s + 1) * t + i] + e[(s + 1) * t + (i + 1)];
80
- n[s * t + i] = Math.min(255, Math.round(Math.sqrt(o * o + a * a)));
78
+ for (let o = 1; o < r - 1; o++)
79
+ for (let s = 1; s < t - 1; s++) {
80
+ const a = -e[(o - 1) * t + (s - 1)] + e[(o - 1) * t + (s + 1)] + -2 * e[o * t + (s - 1)] + 2 * e[o * t + (s + 1)] + -e[(o + 1) * t + (s - 1)] + e[(o + 1) * t + (s + 1)], i = -e[(o - 1) * t + (s - 1)] - 2 * e[(o - 1) * t + s] - e[(o - 1) * t + (s + 1)] + e[(o + 1) * t + (s - 1)] + 2 * e[(o + 1) * t + s] + e[(o + 1) * t + (s + 1)];
81
+ n[o * t + s] = Math.min(255, Math.round(Math.sqrt(a * a + i * i)));
81
82
  }
82
83
  return n;
83
84
  }
84
85
  function Oe(e) {
85
86
  const t = new Array(256).fill(0);
86
- for (const v of e)
87
- t[v]++;
87
+ for (const b of e)
88
+ t[b]++;
88
89
  const r = e.length;
89
90
  let n = 0;
90
- for (let v = 0; v < 256; v++)
91
- n += v * t[v];
92
- let s = 0, i = 0, o = 0, a = 0;
93
- for (let v = 0; v < 256; v++) {
94
- if (i += t[v], i === 0)
91
+ for (let b = 0; b < 256; b++)
92
+ n += b * t[b];
93
+ let o = 0, s = 0, a = 0, i = 0;
94
+ for (let b = 0; b < 256; b++) {
95
+ if (s += t[b], s === 0)
95
96
  continue;
96
- const f = r - i;
97
+ const f = r - s;
97
98
  if (f === 0)
98
99
  break;
99
- s += v * t[v];
100
- const m = s / i, k = (n - s) / f, y = i * f * (m - k) ** 2;
101
- y > o && (o = y, a = v);
100
+ o += b * t[b];
101
+ const x = o / s, A = (n - o) / f, g = s * f * (x - A) ** 2;
102
+ g > a && (a = g, i = b);
102
103
  }
103
- const g = new Uint8Array(e.length);
104
- for (let v = 0; v < e.length; v++)
105
- g[v] = e[v] > a ? 255 : 0;
106
- return { threshold: a, binary: g };
104
+ const y = new Uint8Array(e.length);
105
+ for (let b = 0; b < e.length; b++)
106
+ y[b] = e[b] > i ? 255 : 0;
107
+ return { threshold: i, binary: y };
107
108
  }
108
109
  function Ue(e, t = 0.3) {
109
- var p;
110
- const r = e.width, n = e.height, s = ce(e), i = Ae(s, r, n), o = We(i, r, n), { binary: a } = Oe(o), g = [], v = [], f = [];
111
- for (let S = 2; S < n - 2; S++)
112
- for (let u = 2; u < r - 2; u++) {
113
- if (a[S * r + u] === 0)
110
+ var S;
111
+ const r = e.width, n = e.height, o = ce(e), s = Ae(o, r, n), a = He(s, r, n), { binary: i } = Oe(a), y = [], b = [], f = [];
112
+ for (let v = 2; v < n - 2; v++)
113
+ for (let l = 2; l < r - 2; l++) {
114
+ if (i[v * r + l] === 0)
114
115
  continue;
115
116
  const w = [
116
- a[(S - 1) * r + u],
117
- a[(S - 1) * r + (u + 1)],
118
- a[S * r + (u + 1)],
119
- a[(S + 1) * r + (u + 1)],
120
- a[(S + 1) * r + u],
121
- a[(S + 1) * r + (u - 1)],
122
- a[S * r + (u - 1)],
123
- a[(S - 1) * r + (u - 1)]
117
+ i[(v - 1) * r + l],
118
+ i[(v - 1) * r + (l + 1)],
119
+ i[v * r + (l + 1)],
120
+ i[(v + 1) * r + (l + 1)],
121
+ i[(v + 1) * r + l],
122
+ i[(v + 1) * r + (l - 1)],
123
+ i[v * r + (l - 1)],
124
+ i[(v - 1) * r + (l - 1)]
124
125
  ];
125
- let l = 0;
126
- for (let B = 0; B < 8; B++) {
127
- const U = w[B] > 0 ? 1 : 0, J = w[(B + 1) % 8] > 0 ? 1 : 0;
128
- l += Math.abs(U - J);
126
+ let u = 0;
127
+ for (let W = 0; W < 8; W++) {
128
+ const O = w[W] > 0 ? 1 : 0, Y = w[(W + 1) % 8] > 0 ? 1 : 0;
129
+ u += Math.abs(O - Y);
129
130
  }
130
- l /= 2;
131
- let h = 0, L = 0;
132
- for (let B = -2; B <= 2; B++)
133
- for (let U = -2; U <= 2; U++)
134
- h += o[(S + B) * r + (u + U)], L++;
135
- const q = h / L / 255;
136
- if (q < t)
131
+ u /= 2;
132
+ let h = 0, R = 0;
133
+ for (let W = -2; W <= 2; W++)
134
+ for (let O = -2; O <= 2; O++)
135
+ h += a[(v + W) * r + (l + O)], R++;
136
+ const G = h / R / 255;
137
+ if (G < t)
137
138
  continue;
138
- const Y = Math.atan2(
139
- s[(S + 1) * r + u] - s[(S - 1) * r + u],
140
- s[S * r + (u + 1)] - s[S * r + (u - 1)]
139
+ const J = Math.atan2(
140
+ o[(v + 1) * r + l] - o[(v - 1) * r + l],
141
+ o[v * r + (l + 1)] - o[v * r + (l - 1)]
141
142
  );
142
- l === 1 ? g.push({ x: u / r, y: S / n, angle: Y, type: "ending", quality: q }) : l === 3 && g.push({ x: u / r, y: S / n, angle: Y, type: "bifurcation", quality: q });
143
+ u === 1 ? y.push({ x: l / r, y: v / n, angle: J, type: "ending", quality: G }) : u === 3 && y.push({ x: l / r, y: v / n, angle: J, type: "bifurcation", quality: G });
143
144
  }
144
- g.sort((S, u) => u.quality - S.quality);
145
- const m = g.slice(0, 120);
146
- if (m.length > 5) {
147
- const S = m.reduce((w, l) => w + l.x, 0) / m.length, u = m.reduce((w, l) => w + l.y, 0) / m.length;
148
- v.push({ x: S, y: u });
145
+ y.sort((v, l) => l.quality - v.quality);
146
+ const x = y.slice(0, 120);
147
+ if (x.length > 5) {
148
+ const v = x.reduce((w, u) => w + u.x, 0) / x.length, l = x.reduce((w, u) => w + u.y, 0) / x.length;
149
+ b.push({ x: v, y: l });
149
150
  }
150
- const k = m.length, y = m.filter((S) => S.type === "ending").length, M = m.filter((S) => S.type === "bifurcation").length / (y + 1);
151
- let b = "loop-right";
152
- M > 1.5 ? b = "whorl" : M < 0.5 ? b = "arch" : ((p = v[0]) == null ? void 0 : p.x) < 0.45 && (b = "loop-left");
153
- const T = m.length > 20 ? m.reduce((S, u) => S + u.quality, 0) / m.length : 0;
151
+ const A = x.length, g = x.filter((v) => v.type === "ending").length, L = x.filter((v) => v.type === "bifurcation").length / (g + 1);
152
+ let p = "loop-right";
153
+ L > 1.5 ? p = "whorl" : L < 0.5 ? p = "arch" : ((S = b[0]) == null ? void 0 : S.x) < 0.45 && (p = "loop-left");
154
+ const C = x.length > 20 ? x.reduce((v, l) => v + l.quality, 0) / x.length : 0;
154
155
  return {
155
- minutiae: m,
156
- corePoints: v,
156
+ minutiae: x,
157
+ corePoints: b,
157
158
  deltaPoints: f,
158
- ridgeCount: k,
159
- patternType: b,
160
- quality: T
159
+ ridgeCount: A,
160
+ patternType: p,
161
+ quality: C
161
162
  };
162
163
  }
163
- function He(e, t) {
164
+ function qe(e, t) {
164
165
  if (e.minutiae.length < 5 || t.minutiae.length < 5)
165
166
  return 0;
166
167
  let r = 0;
167
- const n = 0.05, s = 0.5, i = /* @__PURE__ */ new Set();
168
- for (const a of e.minutiae) {
169
- let g = 1 / 0, v = -1;
168
+ const n = 0.05, o = 0.5, s = /* @__PURE__ */ new Set();
169
+ for (const i of e.minutiae) {
170
+ let y = 1 / 0, b = -1;
170
171
  for (let f = 0; f < t.minutiae.length; f++) {
171
- if (i.has(f))
172
+ if (s.has(f))
172
173
  continue;
173
- const m = t.minutiae[f];
174
- if (a.type !== m.type)
174
+ const x = t.minutiae[f];
175
+ if (i.type !== x.type)
175
176
  continue;
176
- const k = Be(a, m), y = Math.abs(a.angle - m.angle);
177
- k < n && y < s && k < g && (g = k, v = f);
177
+ const A = We(i, x), g = Math.abs(i.angle - x.angle);
178
+ A < n && g < o && A < y && (y = A, b = f);
178
179
  }
179
- v >= 0 && (r++, i.add(v));
180
+ b >= 0 && (r++, s.add(b));
180
181
  }
181
- const o = Math.min(e.minutiae.length, t.minutiae.length);
182
- return o > 0 ? r / o : 0;
182
+ const a = Math.min(e.minutiae.length, t.minutiae.length);
183
+ return a > 0 ? r / a : 0;
183
184
  }
184
- async function qe(e, t) {
185
+ async function Ke(e, t) {
185
186
  const r = JSON.stringify(e), n = await ue(r);
186
187
  return {
187
188
  id: `fp_${Date.now()}_${ye()}`,
@@ -192,65 +193,65 @@ async function qe(e, t) {
192
193
  hash: n
193
194
  };
194
195
  }
195
- function Ke(e) {
196
+ function Ge(e) {
196
197
  return JSON.parse(atob(e.templateData));
197
198
  }
198
- function Ge(e, t = "left") {
199
- const r = e.width, n = e.height, s = ce(e), i = Ae(s, r, n);
200
- let o = { cx: r / 2, cy: n / 2, r: Math.min(r, n) * 0.08, score: 1 / 0 };
201
- for (let D = Math.round(n * 0.3); D < Math.round(n * 0.7); D += 2)
202
- for (let M = Math.round(r * 0.3); M < Math.round(r * 0.7); M += 2)
203
- for (let b = Math.round(Math.min(r, n) * 0.04); b < Math.round(Math.min(r, n) * 0.15); b += 2) {
204
- let T = 0, p = 0;
205
- for (let l = 0; l < Math.PI * 2; l += 0.3) {
206
- const h = Math.round(M + b * Math.cos(l)), L = Math.round(D + b * Math.sin(l));
207
- h >= 0 && h < r && L >= 0 && L < n && (T += i[L * r + h], p++);
199
+ function Je(e, t = "left") {
200
+ const r = e.width, n = e.height, o = ce(e), s = Ae(o, r, n);
201
+ let a = { cx: r / 2, cy: n / 2, r: Math.min(r, n) * 0.08, score: 1 / 0 };
202
+ for (let I = Math.round(n * 0.3); I < Math.round(n * 0.7); I += 2)
203
+ for (let L = Math.round(r * 0.3); L < Math.round(r * 0.7); L += 2)
204
+ for (let p = Math.round(Math.min(r, n) * 0.04); p < Math.round(Math.min(r, n) * 0.15); p += 2) {
205
+ let C = 0, S = 0;
206
+ for (let u = 0; u < Math.PI * 2; u += 0.3) {
207
+ const h = Math.round(L + p * Math.cos(u)), R = Math.round(I + p * Math.sin(u));
208
+ h >= 0 && h < r && R >= 0 && R < n && (C += s[R * r + h], S++);
208
209
  }
209
- const S = p > 0 ? T / p : 255, u = i[D * r + M], w = S * 0.5 + u * 0.5;
210
- w < o.score && (o = { cx: M, cy: D, r: b, score: w });
210
+ const v = S > 0 ? C / S : 255, l = s[I * r + L], w = v * 0.5 + l * 0.5;
211
+ w < a.score && (a = { cx: L, cy: I, r: p, score: w });
211
212
  }
212
- const a = o.r * 3, g = {
213
- cx: o.cx,
214
- cy: o.cy,
215
- r: Math.min(a, Math.min(r, n) * 0.4)
216
- }, v = 256, f = [];
217
- for (let D = 0; D < v; D++) {
218
- const M = D / v * Math.PI * 2, b = o.r + (g.r - o.r) * 0.5, T = Math.round(o.cx + b * Math.cos(M)), p = Math.round(o.cy + b * Math.sin(M));
219
- if (T >= 0 && T < r && p >= 0 && p < n) {
220
- const S = Math.round(o.cx + b * Math.cos(M + 0.1)), u = Math.round(o.cy + b * Math.sin(M + 0.1)), w = i[p * r + T], l = S >= 0 && S < r && u >= 0 && u < n ? i[u * r + S] : w;
221
- f.push(w > l ? 1 : 0);
213
+ const i = a.r * 3, y = {
214
+ cx: a.cx,
215
+ cy: a.cy,
216
+ r: Math.min(i, Math.min(r, n) * 0.4)
217
+ }, b = 256, f = [];
218
+ for (let I = 0; I < b; I++) {
219
+ const L = I / b * Math.PI * 2, p = a.r + (y.r - a.r) * 0.5, C = Math.round(a.cx + p * Math.cos(L)), S = Math.round(a.cy + p * Math.sin(L));
220
+ if (C >= 0 && C < r && S >= 0 && S < n) {
221
+ const v = Math.round(a.cx + p * Math.cos(L + 0.1)), l = Math.round(a.cy + p * Math.sin(L + 0.1)), w = s[S * r + C], u = v >= 0 && v < r && l >= 0 && l < n ? s[l * r + v] : w;
222
+ f.push(w > u ? 1 : 0);
222
223
  } else
223
224
  f.push(0);
224
225
  }
225
- const m = f.join(""), k = Math.PI * o.r ** 2, y = Math.min(1, Math.max(0, k / (r * n) * 100));
226
+ const x = f.join(""), A = Math.PI * a.r ** 2, g = Math.min(1, Math.max(0, A / (r * n) * 100));
226
227
  return {
227
- irisCode: m,
228
- pupil: o,
229
- iris: g,
230
- quality: y,
228
+ irisCode: x,
229
+ pupil: a,
230
+ iris: y,
231
+ quality: g,
231
232
  eye: t
232
233
  };
233
234
  }
234
- function Je(e, t) {
235
+ function Ye(e, t) {
235
236
  if (!e.irisCode || !t.irisCode)
236
237
  return 0;
237
238
  const r = Math.min(e.irisCode.length, t.irisCode.length);
238
239
  if (r === 0)
239
240
  return 0;
240
- let n = 0, s = r;
241
- for (let o = -8; o <= 8; o++) {
242
- let a = 0;
243
- for (let g = 0; g < r; g++) {
244
- const v = (g + o + r) % r;
245
- e.irisCode[g] !== t.irisCode[v] && a++;
241
+ let n = 0, o = r;
242
+ for (let a = -8; a <= 8; a++) {
243
+ let i = 0;
244
+ for (let y = 0; y < r; y++) {
245
+ const b = (y + a + r) % r;
246
+ e.irisCode[y] !== t.irisCode[b] && i++;
246
247
  }
247
- a < s && (s = a);
248
+ i < o && (o = i);
248
249
  }
249
- n = s;
250
- const i = n / r;
251
- return Math.max(0, 1 - i * 2.5);
250
+ n = o;
251
+ const s = n / r;
252
+ return Math.max(0, 1 - s * 2.5);
252
253
  }
253
- async function Ye(e, t) {
254
+ async function Ze(e, t) {
254
255
  const r = JSON.stringify(e), n = await ue(r);
255
256
  return {
256
257
  id: `iris_${Date.now()}_${ye()}`,
@@ -261,59 +262,59 @@ async function Ye(e, t) {
261
262
  hash: n
262
263
  };
263
264
  }
264
- function Ze(e) {
265
+ function Xe(e) {
265
266
  return JSON.parse(atob(e.templateData));
266
267
  }
267
268
  function he(e) {
268
- const t = e.width, r = e.height, n = e.data, s = new Uint8Array(t * r);
269
- for (let u = 0; u < t * r; u++) {
270
- const w = u * 4, l = n[w], h = n[w + 1], L = n[w + 2], q = 0.299 * l + 0.587 * h + 0.114 * L, Y = 128 - 0.169 * l - 0.331 * h + 0.5 * L, B = 128 + 0.5 * l - 0.419 * h - 0.081 * L;
271
- Y >= 77 && Y <= 127 && B >= 133 && B <= 173 && q > 80 && (s[u] = 1);
269
+ const t = e.width, r = e.height, n = e.data, o = new Uint8Array(t * r);
270
+ for (let l = 0; l < t * r; l++) {
271
+ const w = l * 4, u = n[w], h = n[w + 1], R = n[w + 2], G = 0.299 * u + 0.587 * h + 0.114 * R, J = 128 - 0.169 * u - 0.331 * h + 0.5 * R, W = 128 + 0.5 * u - 0.419 * h - 0.081 * R;
272
+ J >= 77 && J <= 127 && W >= 133 && W <= 173 && G > 80 && (o[l] = 1);
272
273
  }
273
- let i = t, o = r, a = 0, g = 0, v = 0;
274
- for (let u = 0; u < r; u++)
274
+ let s = t, a = r, i = 0, y = 0, b = 0;
275
+ for (let l = 0; l < r; l++)
275
276
  for (let w = 0; w < t; w++)
276
- s[u * t + w] && (v++, w < i && (i = w), w > a && (a = w), u < o && (o = u), u > g && (g = u));
277
- const f = a - i, m = g - o;
278
- if (f < t * 0.1 || m < r * 0.1)
277
+ o[l * t + w] && (b++, w < s && (s = w), w > i && (i = w), l < a && (a = l), l > y && (y = l));
278
+ const f = i - s, x = y - a;
279
+ if (f < t * 0.1 || x < r * 0.1)
279
280
  return null;
280
- const k = { x: i, y: o, width: f, height: m }, y = [], D = ce(e), M = Math.max(1, Math.floor(f / 8)), b = Math.max(1, Math.floor(m / 16));
281
- for (let u = 0; u < 16; u++)
281
+ const A = { x: s, y: a, width: f, height: x }, g = [], I = ce(e), L = Math.max(1, Math.floor(f / 8)), p = Math.max(1, Math.floor(x / 16));
282
+ for (let l = 0; l < 16; l++)
282
283
  for (let w = 0; w < 8; w++) {
283
- const l = i + w * M + Math.floor(M / 2), h = o + u * b + Math.floor(b / 2);
284
- l < t && h < r ? y.push(D[h * t + l] / 255) : y.push(0);
284
+ const u = s + w * L + Math.floor(L / 2), h = a + l * p + Math.floor(p / 2);
285
+ u < t && h < r ? g.push(I[h * t + u] / 255) : g.push(0);
285
286
  }
286
- const T = [], p = { x: i + f / 2, y: o + m / 2 };
287
- for (let u = 0; u < 68; u++) {
288
- const w = u / 68 * Math.PI * 2, l = f * 0.4 * Math.cos(w), h = m * 0.45 * Math.sin(w);
289
- T.push({
290
- x: (p.x + l) / t,
291
- y: (p.y + h) / r
287
+ const C = [], S = { x: s + f / 2, y: a + x / 2 };
288
+ for (let l = 0; l < 68; l++) {
289
+ const w = l / 68 * Math.PI * 2, u = f * 0.4 * Math.cos(w), h = x * 0.45 * Math.sin(w);
290
+ C.push({
291
+ x: (S.x + u) / t,
292
+ y: (S.y + h) / r
292
293
  });
293
294
  }
294
- const S = Math.min(1, v / (f * m) * 2);
295
+ const v = Math.min(1, b / (f * x) * 2);
295
296
  return {
296
- embedding: y,
297
- boundingBox: k,
298
- landmarks: T,
297
+ embedding: g,
298
+ boundingBox: A,
299
+ landmarks: C,
299
300
  headPose: { yaw: 0, pitch: 0, roll: 0 },
300
- quality: S
301
+ quality: v
301
302
  };
302
303
  }
303
304
  function Te(e, t) {
304
305
  if (e.embedding.length !== t.embedding.length)
305
306
  return 0;
306
- let r = 0, n = 0, s = 0;
307
- for (let o = 0; o < e.embedding.length; o++)
308
- r += e.embedding[o] * t.embedding[o], n += e.embedding[o] ** 2, s += t.embedding[o] ** 2;
309
- const i = Math.sqrt(n) * Math.sqrt(s);
310
- return i > 0 ? (r / i + 1) / 2 : 0;
307
+ let r = 0, n = 0, o = 0;
308
+ for (let a = 0; a < e.embedding.length; a++)
309
+ r += e.embedding[a] * t.embedding[a], n += e.embedding[a] ** 2, o += t.embedding[a] ** 2;
310
+ const s = Math.sqrt(n) * Math.sqrt(o);
311
+ return s > 0 ? (r / s + 1) / 2 : 0;
311
312
  }
312
- function Xe(e, t) {
313
+ function Qe(e, t) {
313
314
  const r = he(e), n = he(t);
314
315
  return !r || !n ? { similarity: 0, cameraFeatures: r, refFeatures: n } : { similarity: Te(r, n), cameraFeatures: r, refFeatures: n };
315
316
  }
316
- async function Qe(e, t) {
317
+ async function Ve(e, t) {
317
318
  const r = JSON.stringify(e), n = await ue(r);
318
319
  return {
319
320
  id: `face_${Date.now()}_${ye()}`,
@@ -324,10 +325,10 @@ async function Qe(e, t) {
324
325
  hash: n
325
326
  };
326
327
  }
327
- function Ve(e) {
328
+ function et(e) {
328
329
  return JSON.parse(atob(e.templateData));
329
330
  }
330
- function Ft() {
331
+ function zt() {
331
332
  const e = [
332
333
  "blink",
333
334
  "smile",
@@ -335,7 +336,7 @@ function Ft() {
335
336
  "turn-right",
336
337
  "nod",
337
338
  "raise-eyebrows"
338
- ], t = e[je(e.length)];
339
+ ], t = e[Be(e.length)];
339
340
  return { type: t, instruction: {
340
341
  blink: "Please blink your eyes",
341
342
  smile: "Please smile",
@@ -349,17 +350,17 @@ function Ie(e, t = 0.02) {
349
350
  if (e.length < 2)
350
351
  return { isLive: !1, confidence: 0, motionScore: 0 };
351
352
  let r = 0;
352
- for (let o = 1; o < e.length; o++) {
353
- const a = ce(e[o - 1]), g = ce(e[o]);
354
- let v = 0;
355
- for (let f = 0; f < a.length; f++)
356
- v += Math.abs(a[f] - g[f]);
357
- r += v / (a.length * 255);
353
+ for (let a = 1; a < e.length; a++) {
354
+ const i = ce(e[a - 1]), y = ce(e[a]);
355
+ let b = 0;
356
+ for (let f = 0; f < i.length; f++)
357
+ b += Math.abs(i[f] - y[f]);
358
+ r += b / (i.length * 255);
358
359
  }
359
- const n = r / (e.length - 1), s = n > t, i = Math.min(1, n / (t * 3));
360
- return { isLive: s, confidence: i, motionScore: n };
360
+ const n = r / (e.length - 1), o = n > t, s = Math.min(1, n / (t * 3));
361
+ return { isLive: o, confidence: s, motionScore: n };
361
362
  }
362
- function De() {
363
+ function Ce() {
363
364
  return {
364
365
  userAgent: navigator.userAgent,
365
366
  platform: navigator.platform,
@@ -371,14 +372,14 @@ function De() {
371
372
  };
372
373
  }
373
374
  async function de() {
374
- const e = De(), t = JSON.stringify(e);
375
+ const e = Ce(), t = JSON.stringify(e);
375
376
  return ue(t);
376
377
  }
377
- function Ce() {
378
+ function De() {
378
379
  return typeof window < "u" && !!window.PublicKeyCredential;
379
380
  }
380
- async function et() {
381
- if (!Ce())
381
+ async function tt() {
382
+ if (!De())
382
383
  return !1;
383
384
  try {
384
385
  return await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();
@@ -386,7 +387,7 @@ async function et() {
386
387
  return !1;
387
388
  }
388
389
  }
389
- async function tt(e) {
390
+ async function rt(e) {
390
391
  const t = {
391
392
  rp: { name: e.rpName, id: e.rpId },
392
393
  user: {
@@ -402,21 +403,21 @@ async function tt(e) {
402
403
  // RS256
403
404
  ],
404
405
  authenticatorSelection: {
405
- authenticatorAttachment: "platform",
406
- userVerification: "required",
407
- residentKey: "preferred"
406
+ authenticatorAttachment: e.authenticatorAttachment ?? "platform",
407
+ userVerification: e.userVerification ?? "required",
408
+ residentKey: e.residentKey ?? "preferred"
408
409
  },
409
410
  timeout: e.timeout ?? 6e4,
410
- attestation: "none"
411
+ attestation: e.attestation ?? "none"
411
412
  };
412
413
  return await navigator.credentials.create({ publicKey: t });
413
414
  }
414
- async function rt(e) {
415
+ async function nt(e) {
415
416
  const t = {
416
417
  rpId: e.rpId,
417
418
  challenge: e.challenge,
418
419
  allowCredentials: e.allowCredentials,
419
- userVerification: "required",
420
+ userVerification: e.userVerification ?? "required",
420
421
  timeout: e.timeout ?? 6e4
421
422
  };
422
423
  return await navigator.credentials.get({ publicKey: t });
@@ -424,140 +425,141 @@ async function rt(e) {
424
425
  async function ge(e, t, r) {
425
426
  const n = { "Content-Type": "application/json" };
426
427
  r && (n.Authorization = `Bearer ${r}`);
427
- const s = await fetch(e, {
428
+ const o = await fetch(e, {
428
429
  method: "POST",
429
430
  headers: n,
430
431
  body: JSON.stringify(t)
431
432
  });
432
- return s.ok ? s.json() : { verified: !1, message: `Server error: ${s.status}` };
433
+ return o.ok ? o.json() : { verified: !1, message: `Server error: ${o.status}` };
433
434
  }
434
435
  function re(e, t) {
435
- var o;
436
+ var a;
436
437
  const r = e.trim().match(/^var\(\s*([^,\s)]+)\s*(?:,\s*(.+))?\)$/);
437
438
  if (!r)
438
439
  return e;
439
- const n = (o = r[2]) == null ? void 0 : o.trim();
440
+ const n = (a = r[2]) == null ? void 0 : a.trim();
440
441
  if (typeof document > "u" || typeof getComputedStyle > "u")
441
442
  return n ? re(n) : e;
442
- const s = typeof Element < "u" && t instanceof Element && t.isConnected ? t : document.documentElement, i = getComputedStyle(s).getPropertyValue(r[1]).trim();
443
- return i || (n ? re(n, t) : e);
443
+ const o = typeof Element < "u" && t instanceof Element && t.isConnected ? t : document.documentElement, s = getComputedStyle(o).getPropertyValue(r[1]).trim();
444
+ return s || (n ? re(n, t) : e);
444
445
  }
445
- const nt = (e, t) => t, Me = /* @__PURE__ */ Fe(nt), zt = ({ t: e, children: t }) => /* @__PURE__ */ c(Me.Provider, { value: e, children: t });
446
+ const Re = /* @__PURE__ */ Fe(null), Nt = ({ t: e, children: t }) => /* @__PURE__ */ c(Re.Provider, { value: e, children: t });
446
447
  function te() {
447
- return { t: Ee(Me) };
448
+ const e = Ee(Re), { t } = ze();
449
+ return { t: e ?? t };
448
450
  }
449
- const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
451
+ const it = { sm: 200, md: 280, lg: 380 }, Lt = (e) => {
450
452
  const {
451
453
  mode: t,
452
454
  enrolledTemplates: r = [],
453
455
  fingerPosition: n = "right-index",
454
- onEnroll: s,
455
- onVerify: i,
456
- onStatusChange: o,
457
- onError: a,
458
- className: g,
459
- size: v = "md",
456
+ onEnroll: o,
457
+ onVerify: s,
458
+ onStatusChange: a,
459
+ onError: i,
460
+ className: y,
461
+ size: b = "md",
460
462
  label: f,
461
- showQuality: m = !0,
462
- showMinutiae: k = !1,
463
- instructionText: y,
464
- cameraFacing: D = "environment",
465
- ...M
466
- } = e, { t: b } = te(), T = fe(M), p = it[v], S = ee(null), u = ee(null), w = ee(null), [l, h] = _("idle"), [L, q] = _(0), [Y, B] = _(null), [U, J] = _(0), [W, $] = _(""), j = G(
463
+ showQuality: x = !0,
464
+ showMinutiae: A = !1,
465
+ instructionText: g,
466
+ cameraFacing: I = "environment",
467
+ ...L
468
+ } = e, { t: p } = te(), C = fe(L), S = it[b], v = V(null), l = V(null), w = V(null), [u, h] = j("idle"), [R, G] = j(0), [J, W] = j(null), [O, Y] = j(0), [_, $] = j(""), B = K(
467
469
  (E) => {
468
- h(E), o == null || o(E);
470
+ h(E), a == null || a(E);
469
471
  },
470
- [o]
471
- ), F = G(async () => {
472
+ [a]
473
+ ), F = K(async () => {
472
474
  try {
473
- const E = await pe(D);
474
- w.current = E, S.current && (S.current.srcObject = E, await S.current.play()), j("idle"), $(b("security.fingerprint.placeFingerPrompt", "Place your finger on the scanner"));
475
+ const E = await pe(I);
476
+ w.current = E, v.current && (v.current.srcObject = E, await v.current.play()), B("idle"), $(p("security.fingerprint.placeFingerPrompt", "Place your finger on the scanner"));
475
477
  } catch (E) {
476
- a == null || a(E instanceof Error ? E : new Error(String(E))), $(b("security.fingerprint.cameraError", "Camera access denied")), j("error");
478
+ i == null || i(E instanceof Error ? E : new Error(String(E))), $(p("security.fingerprint.cameraError", "Camera access denied")), B("error");
477
479
  }
478
- }, [D, b, j, a]), K = G(() => {
480
+ }, [I, p, B, i]), q = K(() => {
479
481
  var E;
480
- (E = w.current) == null || E.getTracks().forEach((C) => C.stop()), w.current = null;
482
+ (E = w.current) == null || E.getTracks().forEach((z) => z.stop()), w.current = null;
481
483
  }, []);
482
- ne(() => (F(), K), [F, K]);
483
- const O = G(async () => {
484
- if (!(!S.current || l === "processing" || l === "success")) {
485
- j("scanning"), $(b("security.fingerprint.scanning", "Scanning…"));
484
+ ne(() => (F(), q), [F, q]);
485
+ const H = K(async () => {
486
+ if (!(!v.current || u === "processing" || u === "success")) {
487
+ B("scanning"), $(p("security.fingerprint.scanning", "Scanning…"));
486
488
  try {
487
- const { imageData: E } = le(S.current);
488
- j("processing"), $(b("security.fingerprint.processing", "Processing fingerprint…"));
489
- const C = Ue(E);
490
- if (B(C), q(C.quality), C.quality < 0.2) {
491
- $(b("security.fingerprint.lowQuality", "Low quality — try again")), j("idle");
489
+ const { imageData: E } = le(v.current);
490
+ B("processing"), $(p("security.fingerprint.processing", "Processing fingerprint…"));
491
+ const z = Ue(E);
492
+ if (W(z), G(z.quality), z.quality < 0.2) {
493
+ $(p("security.fingerprint.lowQuality", "Low quality — try again")), B("idle");
492
494
  return;
493
495
  }
494
496
  if (t === "enroll") {
495
- const z = await qe(C, f ?? n);
496
- s == null || s(z, C), $(b("security.fingerprint.enrolled", "Fingerprint enrolled successfully")), j("success");
497
+ const D = await Ke(z, f ?? n);
498
+ o == null || o(D, z), $(p("security.fingerprint.enrolled", "Fingerprint enrolled successfully")), B("success");
497
499
  } else {
498
- let z = 0;
500
+ let D = 0;
499
501
  for (const d of r) {
500
- const A = Ke(d), N = He(C, A);
501
- N > z && (z = N);
502
+ const k = Ge(d), N = qe(z, k);
503
+ N > D && (D = N);
502
504
  }
503
- const I = z >= T.matchThreshold, x = {
504
- success: I,
505
- confidence: z,
505
+ const T = D >= C.matchThreshold, m = {
506
+ success: T,
507
+ confidence: D,
506
508
  method: "fingerprint",
507
509
  timestamp: Date.now(),
508
510
  duration: 0,
509
- payload: btoa(JSON.stringify(C))
511
+ payload: btoa(JSON.stringify(z))
510
512
  };
511
- if (I && T.verifyEndpoint) {
512
- const d = await de(), A = await ge(
513
- T.verifyEndpoint,
513
+ if (T && C.verifyEndpoint) {
514
+ const d = await de(), k = await ge(
515
+ C.verifyEndpoint,
514
516
  {
515
517
  method: "fingerprint",
516
- templateData: x.payload,
517
- matchScore: z,
518
+ templateData: m.payload,
519
+ matchScore: D,
518
520
  deviceFingerprint: d
519
521
  },
520
- T.authToken
522
+ C.authToken
521
523
  );
522
- x.success = A.verified;
524
+ m.success = k.verified;
523
525
  }
524
- x.success ? ($(b("security.fingerprint.verified", "Fingerprint verified")), j("success")) : (J((d) => d + 1), U + 1 >= T.maxRetries ? ($(b("security.fingerprint.maxAttempts", "Maximum attempts reached")), j("failure")) : ($(b("security.fingerprint.noMatch", "No match — try again")), j("idle"))), i == null || i(x);
526
+ m.success ? ($(p("security.fingerprint.verified", "Fingerprint verified")), B("success")) : (Y((d) => d + 1), O + 1 >= C.maxRetries ? ($(p("security.fingerprint.maxAttempts", "Maximum attempts reached")), B("failure")) : ($(p("security.fingerprint.noMatch", "No match — try again")), B("idle"))), s == null || s(m);
525
527
  }
526
528
  } catch (E) {
527
- a == null || a(E instanceof Error ? E : new Error(String(E))), $(b("security.fingerprint.error", "Scan error — try again")), j("error");
529
+ i == null || i(E instanceof Error ? E : new Error(String(E))), $(p("security.fingerprint.error", "Scan error — try again")), B("error");
528
530
  }
529
531
  }
530
532
  }, [
531
- l,
533
+ u,
532
534
  t,
533
535
  r,
534
- T,
535
- b,
536
- j,
536
+ C,
537
+ p,
538
+ B,
539
+ o,
537
540
  s,
538
541
  i,
539
- a,
540
542
  f,
541
543
  n,
542
- U
544
+ O
543
545
  ]);
544
546
  ne(() => {
545
- if (!k || !Y || !u.current)
547
+ if (!A || !J || !l.current)
546
548
  return;
547
- const E = u.current.getContext("2d");
549
+ const E = l.current.getContext("2d");
548
550
  if (!E)
549
551
  return;
550
- E.clearRect(0, 0, p, p);
551
- const C = re("var(--nice-success, #10b981)", E.canvas), z = re("var(--nice-warning, #f59e0b)", E.canvas);
552
- Y.minutiae.forEach((I) => {
553
- E.beginPath(), E.arc(I.x * p, I.y * p, 2, 0, Math.PI * 2), E.fillStyle = I.type === "ending" ? C : z, E.fill(), E.beginPath(), E.moveTo(I.x * p, I.y * p), E.lineTo(I.x * p + Math.cos(I.angle) * 8, I.y * p + Math.sin(I.angle) * 8), E.strokeStyle = E.fillStyle, E.lineWidth = 1, E.stroke();
552
+ E.clearRect(0, 0, S, S);
553
+ const z = re("var(--nice-success, #10b981)", E.canvas), D = re("var(--nice-warning, #f59e0b)", E.canvas);
554
+ J.minutiae.forEach((T) => {
555
+ E.beginPath(), E.arc(T.x * S, T.y * S, 2, 0, Math.PI * 2), E.fillStyle = T.type === "ending" ? z : D, E.fill(), E.beginPath(), E.moveTo(T.x * S, T.y * S), E.lineTo(T.x * S + Math.cos(T.angle) * 8, T.y * S + Math.sin(T.angle) * 8), E.strokeStyle = E.fillStyle, E.lineWidth = 1, E.stroke();
554
556
  });
555
- }, [Y, k, p]);
556
- const Q = l === "success" ? "var(--security-success)" : l === "failure" || l === "error" ? "var(--security-error)" : l === "scanning" || l === "processing" ? "var(--security-biometric)" : "var(--security-border)";
557
+ }, [J, A, S]);
558
+ const Q = u === "success" ? "var(--security-success)" : u === "failure" || u === "error" ? "var(--security-error)" : u === "scanning" || u === "processing" ? "var(--security-biometric)" : "var(--security-border)";
557
559
  return /* @__PURE__ */ P(
558
560
  "div",
559
561
  {
560
- className: g,
562
+ className: y,
561
563
  style: { display: "inline-flex", flexDirection: "column", alignItems: "center", gap: 12 },
562
564
  children: [
563
565
  f && /* @__PURE__ */ c("div", { style: { fontSize: 14, fontWeight: 600, color: "var(--security-text)" }, children: f }),
@@ -565,31 +567,31 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
565
567
  "div",
566
568
  {
567
569
  style: {
568
- width: p,
569
- height: p,
570
+ width: S,
571
+ height: S,
570
572
  position: "relative",
571
573
  borderRadius: "var(--security-radius-lg)",
572
574
  overflow: "hidden",
573
575
  border: `3px solid ${Q}`,
574
- boxShadow: l === "scanning" ? `0 0 20px ${Q}` : "var(--security-shadow)",
576
+ boxShadow: u === "scanning" ? `0 0 20px ${Q}` : "var(--security-shadow)",
575
577
  transition: "border-color 0.3s, box-shadow 0.3s"
576
578
  },
577
579
  children: [
578
580
  /* @__PURE__ */ c(
579
581
  "video",
580
582
  {
581
- ref: S,
583
+ ref: v,
582
584
  style: { width: "100%", height: "100%", objectFit: "cover" },
583
585
  playsInline: !0,
584
586
  muted: !0
585
587
  }
586
588
  ),
587
- k && /* @__PURE__ */ c(
589
+ A && /* @__PURE__ */ c(
588
590
  "canvas",
589
591
  {
590
- ref: u,
591
- width: p,
592
- height: p,
592
+ ref: l,
593
+ width: S,
594
+ height: S,
593
595
  style: { position: "absolute", inset: 0, pointerEvents: "none" }
594
596
  }
595
597
  ),
@@ -635,7 +637,7 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
635
637
  ]
636
638
  }
637
639
  ),
638
- (l === "scanning" || l === "processing") && /* @__PURE__ */ c(
640
+ (u === "scanning" || u === "processing") && /* @__PURE__ */ c(
639
641
  "div",
640
642
  {
641
643
  style: {
@@ -664,11 +666,11 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
664
666
  ]
665
667
  }
666
668
  ),
667
- m && L > 0 && /* @__PURE__ */ c(
669
+ x && R > 0 && /* @__PURE__ */ c(
668
670
  "div",
669
671
  {
670
672
  style: {
671
- width: p,
673
+ width: S,
672
674
  height: 4,
673
675
  background: "var(--security-bg-panel)",
674
676
  borderRadius: 2,
@@ -678,9 +680,9 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
678
680
  "div",
679
681
  {
680
682
  style: {
681
- width: `${L * 100}%`,
683
+ width: `${R * 100}%`,
682
684
  height: "100%",
683
- background: L > 0.6 ? "var(--security-success)" : L > 0.3 ? "var(--security-warning)" : "var(--security-error)",
685
+ background: R > 0.6 ? "var(--security-success)" : R > 0.3 ? "var(--security-warning)" : "var(--security-error)",
684
686
  transition: "width 0.3s"
685
687
  }
686
688
  }
@@ -696,14 +698,14 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
696
698
  textAlign: "center",
697
699
  minHeight: 20
698
700
  },
699
- children: y ?? W
701
+ children: g ?? _
700
702
  }
701
703
  ),
702
- l !== "success" && l !== "failure" && /* @__PURE__ */ c(
704
+ u !== "success" && u !== "failure" && /* @__PURE__ */ c(
703
705
  "button",
704
706
  {
705
- onClick: O,
706
- disabled: l === "scanning" || l === "processing",
707
+ onClick: H,
708
+ disabled: u === "scanning" || u === "processing",
707
709
  style: {
708
710
  padding: "10px 24px",
709
711
  fontSize: 14,
@@ -713,16 +715,16 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
713
715
  border: "none",
714
716
  borderRadius: "var(--security-radius)",
715
717
  cursor: "pointer",
716
- opacity: l === "scanning" || l === "processing" ? 0.6 : 1
718
+ opacity: u === "scanning" || u === "processing" ? 0.6 : 1
717
719
  },
718
- children: t === "enroll" ? b("security.fingerprint.captureBtn", "Capture Fingerprint") : b("security.fingerprint.verifyBtn", "Verify Fingerprint")
720
+ children: t === "enroll" ? p("security.fingerprint.captureBtn", "Capture Fingerprint") : p("security.fingerprint.verifyBtn", "Verify Fingerprint")
719
721
  }
720
722
  ),
721
- (l === "failure" || l === "error") && /* @__PURE__ */ c(
723
+ (u === "failure" || u === "error") && /* @__PURE__ */ c(
722
724
  "button",
723
725
  {
724
726
  onClick: () => {
725
- J(0), j("idle"), $("");
727
+ Y(0), B("idle"), $("");
726
728
  },
727
729
  style: {
728
730
  padding: "8px 20px",
@@ -733,149 +735,149 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
733
735
  borderRadius: "var(--security-radius)",
734
736
  cursor: "pointer"
735
737
  },
736
- children: b("security.common.retry", "Try Again")
738
+ children: p("security.common.retry", "Try Again")
737
739
  }
738
740
  ),
739
741
  /* @__PURE__ */ c("style", { children: "@keyframes spin { to { transform: rotate(360deg); } }" })
740
742
  ]
741
743
  }
742
744
  );
743
- }, st = { sm: 220, md: 300, lg: 400 }, Lt = (e) => {
745
+ }, st = { sm: 220, md: 300, lg: 400 }, $t = (e) => {
744
746
  const {
745
747
  mode: t,
746
748
  enrolledTemplates: r = [],
747
749
  eye: n = "right",
748
- onEnroll: s,
749
- onVerify: i,
750
- onStatusChange: o,
751
- onError: a,
752
- className: g,
753
- size: v = "md",
750
+ onEnroll: o,
751
+ onVerify: s,
752
+ onStatusChange: a,
753
+ onError: i,
754
+ className: y,
755
+ size: b = "md",
754
756
  label: f,
755
- showQuality: m = !0,
756
- showSegmentation: k = !0,
757
- showGuide: y = !0,
758
- instructionText: D,
759
- ...M
760
- } = e, { t: b } = te(), T = fe(M), p = st[v], S = ee(null), u = ee(null), w = ee(null), l = ee([]), [h, L] = _("idle"), [q, Y] = _(0), [B, U] = _(null), [J, W] = _(0), [$, j] = _(""), F = G(
761
- (C) => {
762
- L(C), o == null || o(C);
757
+ showQuality: x = !0,
758
+ showSegmentation: A = !0,
759
+ showGuide: g = !0,
760
+ instructionText: I,
761
+ ...L
762
+ } = e, { t: p } = te(), C = fe(L), S = st[b], v = V(null), l = V(null), w = V(null), u = V([]), [h, R] = j("idle"), [G, J] = j(0), [W, O] = j(null), [Y, _] = j(0), [$, B] = j(""), F = K(
763
+ (z) => {
764
+ R(z), a == null || a(z);
763
765
  },
764
- [o]
765
- ), K = G(async () => {
766
+ [a]
767
+ ), q = K(async () => {
766
768
  try {
767
- const C = await pe("user");
768
- w.current = C, S.current && (S.current.srcObject = C, await S.current.play()), F("idle"), j(b("security.iris.alignEyePrompt", "Align your eye with the circle"));
769
- } catch (C) {
770
- a == null || a(C instanceof Error ? C : new Error(String(C))), j(b("security.iris.cameraError", "Camera access denied")), F("error");
769
+ const z = await pe("user");
770
+ w.current = z, v.current && (v.current.srcObject = z, await v.current.play()), F("idle"), B(p("security.iris.alignEyePrompt", "Align your eye with the circle"));
771
+ } catch (z) {
772
+ i == null || i(z instanceof Error ? z : new Error(String(z))), B(p("security.iris.cameraError", "Camera access denied")), F("error");
771
773
  }
772
- }, [b, F, a]), O = G(() => {
773
- var C;
774
- (C = w.current) == null || C.getTracks().forEach((z) => z.stop()), w.current = null;
774
+ }, [p, F, i]), H = K(() => {
775
+ var z;
776
+ (z = w.current) == null || z.getTracks().forEach((D) => D.stop()), w.current = null;
775
777
  }, []);
776
- ne(() => (K(), O), [K, O]);
777
- const Q = G(async () => {
778
- if (!(!S.current || h === "processing" || h === "success")) {
779
- F("scanning"), j(b("security.iris.scanning", "Scanning iris…"));
778
+ ne(() => (q(), H), [q, H]);
779
+ const Q = K(async () => {
780
+ if (!(!v.current || h === "processing" || h === "success")) {
781
+ F("scanning"), B(p("security.iris.scanning", "Scanning iris…"));
780
782
  try {
781
- const C = [];
782
- for (let x = 0; x < 5; x++) {
783
- const { imageData: d } = le(S.current);
784
- C.push(d), await new Promise((A) => setTimeout(A, 200));
783
+ const z = [];
784
+ for (let m = 0; m < 5; m++) {
785
+ const { imageData: d } = le(v.current);
786
+ z.push(d), await new Promise((k) => setTimeout(k, 200));
785
787
  }
786
- if (l.current = C, T.livenessDetection && !Ie(C).isLive) {
787
- j(
788
- b("security.iris.notLive", "Liveness check failed — please blink or move slightly")
788
+ if (u.current = z, C.livenessDetection && !Ie(z).isLive) {
789
+ B(
790
+ p("security.iris.notLive", "Liveness check failed — please blink or move slightly")
789
791
  ), F("idle");
790
792
  return;
791
793
  }
792
- F("processing"), j(b("security.iris.processing", "Processing iris pattern…"));
793
- const z = C[C.length - 1], I = Ge(z, n === "both" ? "left" : n);
794
- if (!I) {
795
- j(b("security.iris.noIrisDetected", "No iris detected — adjust position")), F("idle");
794
+ F("processing"), B(p("security.iris.processing", "Processing iris pattern…"));
795
+ const D = z[z.length - 1], T = Je(D, n === "both" ? "left" : n);
796
+ if (!T) {
797
+ B(p("security.iris.noIrisDetected", "No iris detected — adjust position")), F("idle");
796
798
  return;
797
799
  }
798
- if (U(I), Y(I.quality), I.quality < 0.1) {
799
- j(b("security.iris.lowQuality", "Low quality — move closer")), F("idle");
800
+ if (O(T), J(T.quality), T.quality < 0.1) {
801
+ B(p("security.iris.lowQuality", "Low quality — move closer")), F("idle");
800
802
  return;
801
803
  }
802
- if (k && u.current) {
803
- const x = u.current.getContext("2d");
804
- if (x) {
805
- x.clearRect(0, 0, p, p);
806
- const d = p / z.width, A = p / z.height;
807
- x.beginPath(), x.arc(
808
- I.pupil.cx * d,
809
- I.pupil.cy * A,
810
- I.pupil.r * d,
804
+ if (A && l.current) {
805
+ const m = l.current.getContext("2d");
806
+ if (m) {
807
+ m.clearRect(0, 0, S, S);
808
+ const d = S / D.width, k = S / D.height;
809
+ m.beginPath(), m.arc(
810
+ T.pupil.cx * d,
811
+ T.pupil.cy * k,
812
+ T.pupil.r * d,
811
813
  0,
812
814
  Math.PI * 2
813
- ), x.strokeStyle = re("var(--nice-danger, #ef4444)", x.canvas), x.lineWidth = 2, x.stroke(), x.beginPath(), x.arc(
814
- I.iris.cx * d,
815
- I.iris.cy * A,
816
- I.iris.r * d,
815
+ ), m.strokeStyle = re("var(--nice-danger, #ef4444)", m.canvas), m.lineWidth = 2, m.stroke(), m.beginPath(), m.arc(
816
+ T.iris.cx * d,
817
+ T.iris.cy * k,
818
+ T.iris.r * d,
817
819
  0,
818
820
  Math.PI * 2
819
- ), x.strokeStyle = re("var(--nice-primary, #3b82f6)", x.canvas), x.lineWidth = 2, x.stroke();
821
+ ), m.strokeStyle = re("var(--nice-primary, #3b82f6)", m.canvas), m.lineWidth = 2, m.stroke();
820
822
  }
821
823
  }
822
824
  if (t === "enroll") {
823
- const x = await Ye(I, f ?? `${n} eye`);
824
- s == null || s(x, I), j(b("security.iris.enrolled", "Iris enrolled successfully")), F("success");
825
+ const m = await Ze(T, f ?? `${n} eye`);
826
+ o == null || o(m, T), B(p("security.iris.enrolled", "Iris enrolled successfully")), F("success");
825
827
  } else {
826
- let x = 0;
828
+ let m = 0;
827
829
  for (const N of r) {
828
- const R = Ze(N), H = Je(I, R);
829
- H > x && (x = H);
830
+ const M = Xe(N), U = Ye(T, M);
831
+ U > m && (m = U);
830
832
  }
831
- const d = x >= T.matchThreshold, A = {
833
+ const d = m >= C.matchThreshold, k = {
832
834
  success: d,
833
- confidence: x,
835
+ confidence: m,
834
836
  method: "iris",
835
837
  timestamp: Date.now(),
836
838
  duration: 0,
837
- livenessPassed: T.livenessDetection ? !0 : void 0,
838
- payload: btoa(JSON.stringify(I))
839
+ livenessPassed: C.livenessDetection ? !0 : void 0,
840
+ payload: btoa(JSON.stringify(T))
839
841
  };
840
- if (d && T.verifyEndpoint) {
841
- const N = await de(), R = await ge(
842
- T.verifyEndpoint,
842
+ if (d && C.verifyEndpoint) {
843
+ const N = await de(), M = await ge(
844
+ C.verifyEndpoint,
843
845
  {
844
846
  method: "iris",
845
- templateData: A.payload,
846
- matchScore: x,
847
+ templateData: k.payload,
848
+ matchScore: m,
847
849
  deviceFingerprint: N
848
850
  },
849
- T.authToken
851
+ C.authToken
850
852
  );
851
- A.success = R.verified;
853
+ k.success = M.verified;
852
854
  }
853
- A.success ? (j(b("security.iris.verified", "Iris verified")), F("success")) : (W((N) => N + 1), J + 1 >= T.maxRetries ? (j(b("security.iris.maxAttempts", "Maximum attempts reached")), F("failure")) : (j(b("security.iris.noMatch", "No match — try again")), F("idle"))), i == null || i(A);
855
+ k.success ? (B(p("security.iris.verified", "Iris verified")), F("success")) : (_((N) => N + 1), Y + 1 >= C.maxRetries ? (B(p("security.iris.maxAttempts", "Maximum attempts reached")), F("failure")) : (B(p("security.iris.noMatch", "No match — try again")), F("idle"))), s == null || s(k);
854
856
  }
855
- } catch (C) {
856
- a == null || a(C instanceof Error ? C : new Error(String(C))), j(b("security.iris.error", "Scan error")), F("error");
857
+ } catch (z) {
858
+ i == null || i(z instanceof Error ? z : new Error(String(z))), B(p("security.iris.error", "Scan error")), F("error");
857
859
  }
858
860
  }
859
861
  }, [
860
862
  h,
861
863
  t,
862
864
  r,
863
- T,
864
- b,
865
+ C,
866
+ p,
865
867
  F,
868
+ o,
866
869
  s,
867
870
  i,
868
- a,
869
871
  f,
870
872
  n,
871
- J,
872
- k,
873
- p
873
+ Y,
874
+ A,
875
+ S
874
876
  ]), E = h === "success" ? "var(--security-success)" : h === "failure" || h === "error" ? "var(--security-error)" : h === "scanning" || h === "processing" ? "var(--security-biometric)" : "var(--security-border)";
875
877
  return /* @__PURE__ */ P(
876
878
  "div",
877
879
  {
878
- className: g,
880
+ className: y,
879
881
  style: { display: "inline-flex", flexDirection: "column", alignItems: "center", gap: 12 },
880
882
  children: [
881
883
  f && /* @__PURE__ */ c("div", { style: { fontSize: 14, fontWeight: 600, color: "var(--security-text)" }, children: f }),
@@ -883,8 +885,8 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
883
885
  "div",
884
886
  {
885
887
  style: {
886
- width: p,
887
- height: p,
888
+ width: S,
889
+ height: S,
888
890
  position: "relative",
889
891
  borderRadius: "50%",
890
892
  overflow: "hidden",
@@ -896,22 +898,22 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
896
898
  /* @__PURE__ */ c(
897
899
  "video",
898
900
  {
899
- ref: S,
901
+ ref: v,
900
902
  style: { width: "100%", height: "100%", objectFit: "cover" },
901
903
  playsInline: !0,
902
904
  muted: !0
903
905
  }
904
906
  ),
905
- k && /* @__PURE__ */ c(
907
+ A && /* @__PURE__ */ c(
906
908
  "canvas",
907
909
  {
908
- ref: u,
909
- width: p,
910
- height: p,
910
+ ref: l,
911
+ width: S,
912
+ height: S,
911
913
  style: { position: "absolute", inset: 0, pointerEvents: "none" }
912
914
  }
913
915
  ),
914
- y && h === "idle" && /* @__PURE__ */ P(
916
+ g && h === "idle" && /* @__PURE__ */ P(
915
917
  "svg",
916
918
  {
917
919
  viewBox: "0 0 100 100",
@@ -970,7 +972,7 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
970
972
  "div",
971
973
  {
972
974
  style: {
973
- width: p * 0.7,
975
+ width: S * 0.7,
974
976
  height: 3,
975
977
  background: E,
976
978
  animation: "irisLineAnim 1.5s ease-in-out infinite",
@@ -993,14 +995,14 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
993
995
  textTransform: "uppercase",
994
996
  letterSpacing: 1
995
997
  },
996
- children: n === "both" ? b("security.iris.bothEyes", "Both eyes") : n === "left" ? b("security.iris.leftEye", "Left eye") : b("security.iris.rightEye", "Right eye")
998
+ children: n === "both" ? p("security.iris.bothEyes", "Both eyes") : n === "left" ? p("security.iris.leftEye", "Left eye") : p("security.iris.rightEye", "Right eye")
997
999
  }
998
1000
  ),
999
- m && q > 0 && /* @__PURE__ */ c(
1001
+ x && G > 0 && /* @__PURE__ */ c(
1000
1002
  "div",
1001
1003
  {
1002
1004
  style: {
1003
- width: p * 0.6,
1005
+ width: S * 0.6,
1004
1006
  height: 4,
1005
1007
  background: "var(--security-bg-panel)",
1006
1008
  borderRadius: 2,
@@ -1010,9 +1012,9 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1010
1012
  "div",
1011
1013
  {
1012
1014
  style: {
1013
- width: `${Math.min(100, q * 300)}%`,
1015
+ width: `${Math.min(100, G * 300)}%`,
1014
1016
  height: "100%",
1015
- background: q > 0.3 ? "var(--security-success)" : q > 0.1 ? "var(--security-warning)" : "var(--security-error)",
1017
+ background: G > 0.3 ? "var(--security-success)" : G > 0.1 ? "var(--security-warning)" : "var(--security-error)",
1016
1018
  transition: "width 0.3s"
1017
1019
  }
1018
1020
  }
@@ -1028,7 +1030,7 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1028
1030
  textAlign: "center",
1029
1031
  minHeight: 20
1030
1032
  },
1031
- children: D ?? $
1033
+ children: I ?? $
1032
1034
  }
1033
1035
  ),
1034
1036
  h !== "success" && h !== "failure" && /* @__PURE__ */ c(
@@ -1047,14 +1049,14 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1047
1049
  cursor: "pointer",
1048
1050
  opacity: h === "scanning" || h === "processing" ? 0.6 : 1
1049
1051
  },
1050
- children: t === "enroll" ? b("security.iris.captureBtn", "Capture Iris") : b("security.iris.verifyBtn", "Verify Iris")
1052
+ children: t === "enroll" ? p("security.iris.captureBtn", "Capture Iris") : p("security.iris.verifyBtn", "Verify Iris")
1051
1053
  }
1052
1054
  ),
1053
1055
  (h === "failure" || h === "error") && /* @__PURE__ */ c(
1054
1056
  "button",
1055
1057
  {
1056
1058
  onClick: () => {
1057
- W(0), F("idle"), j("");
1059
+ _(0), F("idle"), B("");
1058
1060
  },
1059
1061
  style: {
1060
1062
  padding: "8px 20px",
@@ -1065,151 +1067,156 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1065
1067
  borderRadius: "var(--security-radius)",
1066
1068
  cursor: "pointer"
1067
1069
  },
1068
- children: b("security.common.retry", "Try Again")
1070
+ children: p("security.common.retry", "Try Again")
1069
1071
  }
1070
1072
  ),
1071
1073
  /* @__PURE__ */ c("style", { children: `
1072
1074
  @keyframes irisLineAnim {
1073
- 0%, 100% { transform: translateY(-${p * 0.3}px); opacity: 0.3; }
1074
- 50% { transform: translateY(${p * 0.3}px); opacity: 0.8; }
1075
+ 0%, 100% { transform: translateY(-${S * 0.3}px); opacity: 0.3; }
1076
+ 50% { transform: translateY(${S * 0.3}px); opacity: 0.8; }
1075
1077
  }
1076
1078
  ` })
1077
1079
  ]
1078
1080
  }
1079
1081
  );
1080
- }, ot = { sm: 240, md: 320, lg: 440 }, $t = (e) => {
1082
+ }, ot = { sm: 240, md: 320, lg: 440 }, jt = (e) => {
1081
1083
  const {
1082
1084
  mode: t,
1083
1085
  enrolledTemplates: r = [],
1084
1086
  referencePhoto: n,
1085
- onEnroll: s,
1086
- onVerify: i,
1087
- onStatusChange: o,
1088
- onError: a,
1089
- className: g,
1090
- size: v = "md",
1087
+ onEnroll: o,
1088
+ onVerify: s,
1089
+ onStatusChange: a,
1090
+ onError: i,
1091
+ className: y,
1092
+ size: b = "md",
1091
1093
  label: f,
1092
- showQuality: m = !0,
1093
- showBoundingBox: k = !0,
1094
- livenessSteps: y = 1,
1095
- showReference: D = !0,
1096
- instructionText: M,
1097
- ...b
1098
- } = e, { t: T } = te(), p = fe(b), S = ot[v], u = ee(null), w = ee(null), l = ee(null), [h, L] = _("idle"), [q, Y] = _(0), [B, U] = _(0), [J, W] = _(""), [$, j] = _(null), [F, K] = _(0), O = G(
1099
- (x) => {
1100
- L(x), o == null || o(x);
1094
+ showQuality: x = !0,
1095
+ showBoundingBox: A = !0,
1096
+ livenessSteps: g = 1,
1097
+ showReference: I = !0,
1098
+ instructionText: L,
1099
+ ...p
1100
+ } = e, { t: C } = te(), S = fe(p), v = ot[b], l = V(null), w = V(null), u = V(null), [h, R] = j("idle"), [G, J] = j(0), [W, O] = j(0), [Y, _] = j(""), [$, B] = j(null), [F, q] = j(0), H = K(
1101
+ (m) => {
1102
+ R(m), a == null || a(m);
1101
1103
  },
1102
- [o]
1103
- ), Q = G(async () => {
1104
+ [a]
1105
+ ), Q = K(async () => {
1104
1106
  try {
1105
- const x = await pe("user");
1106
- l.current = x, u.current && (u.current.srcObject = x, await u.current.play()), O("idle"), W(T("security.face.lookAtCamera", "Look at the camera"));
1107
- } catch (x) {
1108
- a == null || a(x instanceof Error ? x : new Error(String(x))), W(T("security.face.cameraError", "Camera access denied")), O("error");
1107
+ const m = await pe("user");
1108
+ u.current = m, l.current && (l.current.srcObject = m, await l.current.play()), H("idle"), _(C("security.face.lookAtCamera", "Look at the camera"));
1109
+ } catch (m) {
1110
+ i == null || i(m instanceof Error ? m : new Error(String(m))), _(C("security.face.cameraError", "Camera access denied")), H("error");
1109
1111
  }
1110
- }, [T, O, a]), E = G(() => {
1111
- var x;
1112
- (x = l.current) == null || x.getTracks().forEach((d) => d.stop()), l.current = null;
1112
+ }, [C, H, i]), E = K(() => {
1113
+ var m;
1114
+ (m = u.current) == null || m.getTracks().forEach((d) => d.stop()), u.current = null;
1113
1115
  }, []);
1114
1116
  ne(() => (Q(), E), [Q, E]);
1115
- const C = G(
1116
- (x) => {
1117
+ const z = K(
1118
+ (m) => {
1117
1119
  var ie, ve, be;
1118
1120
  const d = (ie = w.current) == null ? void 0 : ie.getContext("2d");
1119
1121
  if (!d)
1120
1122
  return;
1121
- const A = w.current.width, N = w.current.height;
1122
- if (d.clearRect(0, 0, A, N), !x || !k)
1123
+ const k = w.current.width, N = w.current.height;
1124
+ if (d.clearRect(0, 0, k, N), !m || !A)
1123
1125
  return;
1124
- const R = x.boundingBox, H = A / (((ve = u.current) == null ? void 0 : ve.videoWidth) ?? A), Z = N / (((be = u.current) == null ? void 0 : be.videoHeight) ?? N);
1126
+ const M = m.boundingBox, U = k / (((ve = l.current) == null ? void 0 : ve.videoWidth) ?? k), Z = N / (((be = l.current) == null ? void 0 : be.videoHeight) ?? N);
1125
1127
  d.strokeStyle = re(
1126
1128
  h === "success" ? "var(--nice-success, #10b981)" : "var(--nice-primary, #3b82f6)",
1127
1129
  d.canvas
1128
- ), d.lineWidth = 2, d.setLineDash([6, 4]), d.strokeRect(R.x * H, R.y * Z, R.width * H, R.height * Z), d.setLineDash([]);
1129
- const V = [
1130
- [R.x * H, R.y * Z],
1131
- [(R.x + R.width) * H, R.y * Z],
1132
- [R.x * H, (R.y + R.height) * Z],
1133
- [(R.x + R.width) * H, (R.y + R.height) * Z]
1130
+ ), d.lineWidth = 2, d.setLineDash([6, 4]), d.strokeRect(M.x * U, M.y * Z, M.width * U, M.height * Z), d.setLineDash([]);
1131
+ const ee = [
1132
+ [M.x * U, M.y * Z],
1133
+ [(M.x + M.width) * U, M.y * Z],
1134
+ [M.x * U, (M.y + M.height) * Z],
1135
+ [(M.x + M.width) * U, (M.y + M.height) * Z]
1134
1136
  ], X = 12;
1135
1137
  d.lineWidth = 3;
1136
- for (const [se, oe] of V)
1137
- d.beginPath(), d.moveTo(se === R.x * H ? se : se - X, oe), d.lineTo(se, oe), d.lineTo(se, oe === R.y * Z ? oe + X : oe - X), d.stroke();
1138
+ for (const [se, oe] of ee)
1139
+ d.beginPath(), d.moveTo(se === M.x * U ? se : se - X, oe), d.lineTo(se, oe), d.lineTo(se, oe === M.y * Z ? oe + X : oe - X), d.stroke();
1138
1140
  },
1139
- [k, h]
1140
- ), z = G(async () => {
1141
- if (!(!u.current || h === "processing" || h === "success")) {
1142
- O("scanning"), W(T("security.face.scanning", "Scanning face…"));
1141
+ [A, h]
1142
+ ), D = K(async () => {
1143
+ if (!(!l.current || h === "processing" || h === "success")) {
1144
+ H("scanning"), _(C("security.face.scanning", "Scanning face…"));
1143
1145
  try {
1144
- if (p.livenessDetection) {
1145
- const A = [];
1146
- for (let R = 0; R < 8; R++)
1147
- A.push(le(u.current).imageData), await new Promise((H) => setTimeout(H, 200));
1148
- if (!Ie(A).isLive) {
1149
- W(T("security.face.notLive", "Liveness check failed — move naturally")), O("idle");
1146
+ if (S.livenessDetection) {
1147
+ const k = [];
1148
+ for (let M = 0; M < 8; M++)
1149
+ k.push(le(l.current).imageData), await new Promise((U) => setTimeout(U, 200));
1150
+ if (!Ie(k).isLive) {
1151
+ _(C("security.face.notLive", "Liveness check failed — move naturally")), H("idle");
1150
1152
  return;
1151
1153
  }
1152
1154
  }
1153
- O("processing"), W(T("security.face.processing", "Analysing face…"));
1154
- const { imageData: x } = le(u.current);
1155
+ H("processing"), _(C("security.face.processing", "Analysing face…"));
1156
+ const { imageData: m } = le(l.current);
1155
1157
  if (t === "compare" && n) {
1156
- const A = typeof n == "string" ? await at(n) : ct(n), {
1158
+ const k = typeof n == "string" ? await at(n) : ct(n), {
1157
1159
  similarity: N,
1158
- cameraFeatures: R,
1159
- refFeatures: H
1160
- } = Xe(x, A);
1161
- K(N), Y((R == null ? void 0 : R.quality) ?? 0), C(R);
1162
- const V = {
1163
- success: N >= p.matchThreshold,
1160
+ cameraFeatures: M,
1161
+ refFeatures: U
1162
+ } = Qe(m, k);
1163
+ q(N), J((M == null ? void 0 : M.quality) ?? 0), z(M);
1164
+ const ee = {
1165
+ success: N >= S.matchThreshold,
1164
1166
  confidence: N,
1165
1167
  method: "face",
1166
1168
  timestamp: Date.now(),
1167
1169
  duration: 0,
1168
- livenessPassed: p.livenessDetection
1170
+ livenessPassed: S.livenessDetection
1169
1171
  };
1170
- V.success ? (W(T("security.face.matchFound", `Match: ${(N * 100).toFixed(0)}%`)), O("success")) : (U((X) => X + 1), B + 1 >= p.maxRetries ? (W(T("security.face.maxAttempts", "Maximum attempts reached")), O("failure")) : (W(T("security.face.noMatch", "No match — try again")), O("idle"))), i == null || i(V);
1172
+ ee.success ? (_(
1173
+ C("security.face.matchFound", "Match: {percent}%").replace(
1174
+ "{percent}",
1175
+ (N * 100).toFixed(0)
1176
+ )
1177
+ ), H("success")) : (O((X) => X + 1), W + 1 >= S.maxRetries ? (_(C("security.face.maxAttempts", "Maximum attempts reached")), H("failure")) : (_(C("security.face.noMatch", "No match — try again")), H("idle"))), s == null || s(ee);
1171
1178
  return;
1172
1179
  }
1173
- const d = he(x);
1180
+ const d = he(m);
1174
1181
  if (!d) {
1175
- W(T("security.face.noFaceDetected", "No face detected")), O("idle");
1182
+ _(C("security.face.noFaceDetected", "No face detected")), H("idle");
1176
1183
  return;
1177
1184
  }
1178
- if (Y(d.quality), C(d), t === "enroll") {
1179
- const A = await Qe(d, f ?? "face");
1180
- s == null || s(A, d), W(T("security.face.enrolled", "Face enrolled successfully")), O("success");
1185
+ if (J(d.quality), z(d), t === "enroll") {
1186
+ const k = await Ve(d, f ?? "face");
1187
+ o == null || o(k, d), _(C("security.face.enrolled", "Face enrolled successfully")), H("success");
1181
1188
  } else {
1182
- let A = 0;
1183
- for (const H of r) {
1184
- const Z = Ve(H), V = Te(d, Z);
1185
- V > A && (A = V);
1189
+ let k = 0;
1190
+ for (const U of r) {
1191
+ const Z = et(U), ee = Te(d, Z);
1192
+ ee > k && (k = ee);
1186
1193
  }
1187
- K(A);
1188
- const N = A >= p.matchThreshold, R = {
1194
+ q(k);
1195
+ const N = k >= S.matchThreshold, M = {
1189
1196
  success: N,
1190
- confidence: A,
1197
+ confidence: k,
1191
1198
  method: "face",
1192
1199
  timestamp: Date.now(),
1193
1200
  duration: 0,
1194
- livenessPassed: p.livenessDetection
1201
+ livenessPassed: S.livenessDetection
1195
1202
  };
1196
- if (N && p.verifyEndpoint) {
1197
- const H = await de(), Z = await ge(
1198
- p.verifyEndpoint,
1203
+ if (N && S.verifyEndpoint) {
1204
+ const U = await de(), Z = await ge(
1205
+ S.verifyEndpoint,
1199
1206
  {
1200
1207
  method: "face",
1201
1208
  templateData: btoa(JSON.stringify(d)),
1202
- matchScore: A,
1203
- deviceFingerprint: H
1209
+ matchScore: k,
1210
+ deviceFingerprint: U
1204
1211
  },
1205
- p.authToken
1212
+ S.authToken
1206
1213
  );
1207
- R.success = Z.verified;
1214
+ M.success = Z.verified;
1208
1215
  }
1209
- R.success ? (W(T("security.face.verified", "Face verified")), O("success")) : (U((H) => H + 1), B + 1 >= p.maxRetries ? (W(T("security.face.maxAttempts", "Maximum attempts reached")), O("failure")) : (W(T("security.face.noMatch", "No match — try again")), O("idle"))), i == null || i(R);
1216
+ M.success ? (_(C("security.face.verified", "Face verified")), H("success")) : (O((U) => U + 1), W + 1 >= S.maxRetries ? (_(C("security.face.maxAttempts", "Maximum attempts reached")), H("failure")) : (_(C("security.face.noMatch", "No match — try again")), H("idle"))), s == null || s(M);
1210
1217
  }
1211
- } catch (x) {
1212
- a == null || a(x instanceof Error ? x : new Error(String(x))), W(T("security.face.error", "Error — try again")), O("error");
1218
+ } catch (m) {
1219
+ i == null || i(m instanceof Error ? m : new Error(String(m))), _(C("security.face.error", "Error — try again")), H("error");
1213
1220
  }
1214
1221
  }
1215
1222
  }, [
@@ -1217,20 +1224,20 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1217
1224
  t,
1218
1225
  r,
1219
1226
  n,
1220
- p,
1221
- T,
1222
- O,
1227
+ S,
1228
+ C,
1229
+ H,
1230
+ o,
1223
1231
  s,
1224
1232
  i,
1225
- a,
1226
1233
  f,
1227
- B,
1228
- C
1229
- ]), I = h === "success" ? "var(--security-success)" : h === "failure" || h === "error" ? "var(--security-error)" : h === "scanning" || h === "processing" ? "var(--security-biometric)" : "var(--security-border)";
1234
+ W,
1235
+ z
1236
+ ]), T = h === "success" ? "var(--security-success)" : h === "failure" || h === "error" ? "var(--security-error)" : h === "scanning" || h === "processing" ? "var(--security-biometric)" : "var(--security-border)";
1230
1237
  return /* @__PURE__ */ P(
1231
1238
  "div",
1232
1239
  {
1233
- className: g,
1240
+ className: y,
1234
1241
  style: {
1235
1242
  display: "inline-flex",
1236
1243
  flexDirection: "column",
@@ -1244,20 +1251,20 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1244
1251
  "div",
1245
1252
  {
1246
1253
  style: {
1247
- width: S,
1248
- height: S * 0.75,
1254
+ width: v,
1255
+ height: v * 0.75,
1249
1256
  position: "relative",
1250
1257
  borderRadius: "var(--security-radius-lg)",
1251
1258
  overflow: "hidden",
1252
- border: `3px solid ${I}`,
1253
- boxShadow: h === "scanning" ? `0 0 20px ${I}` : "var(--security-shadow)",
1259
+ border: `3px solid ${T}`,
1260
+ boxShadow: h === "scanning" ? `0 0 20px ${T}` : "var(--security-shadow)",
1254
1261
  transition: "border-color 0.3s, box-shadow 0.3s"
1255
1262
  },
1256
1263
  children: [
1257
1264
  /* @__PURE__ */ c(
1258
1265
  "video",
1259
1266
  {
1260
- ref: u,
1267
+ ref: l,
1261
1268
  style: { width: "100%", height: "100%", objectFit: "cover", transform: "scaleX(-1)" },
1262
1269
  playsInline: !0,
1263
1270
  muted: !0
@@ -1267,8 +1274,8 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1267
1274
  "canvas",
1268
1275
  {
1269
1276
  ref: w,
1270
- width: S,
1271
- height: S * 0.75,
1277
+ width: v,
1278
+ height: v * 0.75,
1272
1279
  style: {
1273
1280
  position: "absolute",
1274
1281
  inset: 0,
@@ -1323,7 +1330,7 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1323
1330
  height: 50,
1324
1331
  borderRadius: "50%",
1325
1332
  border: "3px solid transparent",
1326
- borderTopColor: I,
1333
+ borderTopColor: T,
1327
1334
  animation: "spin 0.8s linear infinite"
1328
1335
  }
1329
1336
  }
@@ -1333,12 +1340,12 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1333
1340
  ]
1334
1341
  }
1335
1342
  ),
1336
- t === "compare" && D && n && /* @__PURE__ */ P(
1343
+ t === "compare" && I && n && /* @__PURE__ */ P(
1337
1344
  "div",
1338
1345
  {
1339
1346
  style: {
1340
- width: S * 0.4,
1341
- height: S * 0.5,
1347
+ width: v * 0.4,
1348
+ height: v * 0.5,
1342
1349
  borderRadius: "var(--security-radius)",
1343
1350
  overflow: "hidden",
1344
1351
  border: "2px solid var(--security-border)"
@@ -1348,7 +1355,7 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1348
1355
  "img",
1349
1356
  {
1350
1357
  src: typeof n == "string" ? n : void 0,
1351
- alt: T("security.face.referenceAlt", "Reference"),
1358
+ alt: C("security.face.referenceAlt", "Reference"),
1352
1359
  style: { width: "100%", height: "100%", objectFit: "cover" }
1353
1360
  }
1354
1361
  ),
@@ -1362,7 +1369,7 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1362
1369
  color: "var(--security-text-muted)",
1363
1370
  background: "var(--security-bg-panel)"
1364
1371
  },
1365
- children: T("security.face.reference", "Reference")
1372
+ children: C("security.face.reference", "Reference")
1366
1373
  }
1367
1374
  )
1368
1375
  ]
@@ -1371,7 +1378,7 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1371
1378
  ] }),
1372
1379
  F > 0 && /* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: 8, fontSize: 13 }, children: [
1373
1380
  /* @__PURE__ */ P("span", { style: { color: "var(--security-text-secondary)" }, children: [
1374
- T("security.face.confidence", "Confidence"),
1381
+ C("security.face.confidence", "Confidence"),
1375
1382
  ":"
1376
1383
  ] }),
1377
1384
  /* @__PURE__ */ c(
@@ -1390,7 +1397,7 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1390
1397
  style: {
1391
1398
  width: `${F * 100}%`,
1392
1399
  height: "100%",
1393
- background: F >= p.matchThreshold ? "var(--security-success)" : "var(--security-warning)"
1400
+ background: F >= S.matchThreshold ? "var(--security-success)" : "var(--security-warning)"
1394
1401
  }
1395
1402
  }
1396
1403
  )
@@ -1401,7 +1408,7 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1401
1408
  {
1402
1409
  style: {
1403
1410
  fontWeight: 600,
1404
- color: F >= p.matchThreshold ? "var(--security-success)" : "var(--security-warning)"
1411
+ color: F >= S.matchThreshold ? "var(--security-success)" : "var(--security-warning)"
1405
1412
  },
1406
1413
  children: [
1407
1414
  (F * 100).toFixed(0),
@@ -1419,13 +1426,13 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1419
1426
  textAlign: "center",
1420
1427
  minHeight: 20
1421
1428
  },
1422
- children: M ?? J
1429
+ children: L ?? Y
1423
1430
  }
1424
1431
  ),
1425
1432
  h !== "success" && h !== "failure" && /* @__PURE__ */ c(
1426
1433
  "button",
1427
1434
  {
1428
- onClick: z,
1435
+ onClick: D,
1429
1436
  disabled: h === "scanning" || h === "processing",
1430
1437
  style: {
1431
1438
  padding: "10px 24px",
@@ -1438,14 +1445,14 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1438
1445
  cursor: "pointer",
1439
1446
  opacity: h === "scanning" || h === "processing" ? 0.6 : 1
1440
1447
  },
1441
- children: t === "enroll" ? T("security.face.captureBtn", "Capture Face") : t === "compare" ? T("security.face.compareBtn", "Compare") : T("security.face.verifyBtn", "Verify Face")
1448
+ children: t === "enroll" ? C("security.face.captureBtn", "Capture Face") : t === "compare" ? C("security.face.compareBtn", "Compare") : C("security.face.verifyBtn", "Verify Face")
1442
1449
  }
1443
1450
  ),
1444
1451
  (h === "failure" || h === "error") && /* @__PURE__ */ c(
1445
1452
  "button",
1446
1453
  {
1447
1454
  onClick: () => {
1448
- U(0), K(0), O("idle"), W("");
1455
+ O(0), q(0), H("idle"), _("");
1449
1456
  },
1450
1457
  style: {
1451
1458
  padding: "8px 20px",
@@ -1456,7 +1463,7 @@ const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
1456
1463
  borderRadius: "var(--security-radius)",
1457
1464
  cursor: "pointer"
1458
1465
  },
1459
- children: T("security.common.retry", "Try Again")
1466
+ children: C("security.common.retry", "Try Again")
1460
1467
  }
1461
1468
  ),
1462
1469
  /* @__PURE__ */ c("style", { children: "@keyframes spin { to { transform: rotate(360deg); } }" })
@@ -1468,10 +1475,10 @@ async function at(e) {
1468
1475
  return new Promise((t, r) => {
1469
1476
  const n = new Image();
1470
1477
  n.crossOrigin = "anonymous", n.onload = () => {
1471
- const s = document.createElement("canvas");
1472
- s.width = n.naturalWidth, s.height = n.naturalHeight;
1473
- const i = s.getContext("2d");
1474
- i.drawImage(n, 0, 0), t(i.getImageData(0, 0, s.width, s.height));
1478
+ const o = document.createElement("canvas");
1479
+ o.width = n.naturalWidth, o.height = n.naturalHeight;
1480
+ const s = o.getContext("2d");
1481
+ s.drawImage(n, 0, 0), t(s.getImageData(0, 0, o.width, o.height));
1475
1482
  }, n.onerror = () => r(new Error("Failed to load reference image")), n.src = e;
1476
1483
  });
1477
1484
  }
@@ -1486,115 +1493,115 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
1486
1493
  length: t = lt,
1487
1494
  scramble: r = !1,
1488
1495
  showDigits: n = !1,
1489
- maxAttempts: s = ut,
1490
- lockoutDuration: i = dt,
1491
- keySize: o = 64,
1492
- haptic: a = !0,
1493
- keyLabels: g,
1494
- expectedHash: v,
1496
+ maxAttempts: o = ut,
1497
+ lockoutDuration: s = dt,
1498
+ keySize: a = 64,
1499
+ haptic: i = !0,
1500
+ keyLabels: y,
1501
+ expectedHash: b,
1495
1502
  expectedPin: f,
1496
- mode: m = "verify",
1497
- onComplete: k,
1498
- onVerify: y,
1499
- onStatusChange: D,
1500
- onError: M,
1501
- showBiometricFallback: b = !1,
1502
- onBiometricFallback: T,
1503
- label: p,
1504
- className: S
1505
- } = e, { t: u } = te(), [w, l] = _([]), [h, L] = _("idle"), [q, Y] = _(0), [B, U] = _(0), [J, W] = _(null), $ = ee(void 0), j = ae(() => {
1506
- const z = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "", "0", "back"];
1503
+ mode: x = "verify",
1504
+ onComplete: A,
1505
+ onVerify: g,
1506
+ onStatusChange: I,
1507
+ onError: L,
1508
+ showBiometricFallback: p = !1,
1509
+ onBiometricFallback: C,
1510
+ label: S,
1511
+ className: v
1512
+ } = e, { t: l } = te(), [w, u] = j([]), [h, R] = j("idle"), [G, J] = j(0), [W, O] = j(0), [Y, _] = j(null), $ = V(void 0), B = ae(() => {
1513
+ const D = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "", "0", "back"];
1507
1514
  if (!r)
1508
- return z;
1509
- const I = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
1510
- for (let x = I.length - 1; x > 0; x--) {
1515
+ return D;
1516
+ const T = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
1517
+ for (let m = T.length - 1; m > 0; m--) {
1511
1518
  const d = new Uint32Array(1);
1512
1519
  crypto.getRandomValues(d);
1513
- const A = d[0] % (x + 1);
1514
- [I[x], I[A]] = [I[A], I[x]];
1520
+ const k = d[0] % (m + 1);
1521
+ [T[m], T[k]] = [T[k], T[m]];
1515
1522
  }
1516
1523
  return [
1517
- I[0],
1518
- I[1],
1519
- I[2],
1520
- I[3],
1521
- I[4],
1522
- I[5],
1523
- I[6],
1524
- I[7],
1525
- I[8],
1524
+ T[0],
1525
+ T[1],
1526
+ T[2],
1527
+ T[3],
1528
+ T[4],
1529
+ T[5],
1530
+ T[6],
1531
+ T[7],
1532
+ T[8],
1526
1533
  "",
1527
- I[9],
1534
+ T[9],
1528
1535
  "back"
1529
1536
  ];
1530
- }, [r, h]), F = G(
1531
- (z) => {
1532
- L(z), D == null || D(z);
1537
+ }, [r, h]), F = K(
1538
+ (D) => {
1539
+ R(D), I == null || I(D);
1533
1540
  },
1534
- [D]
1541
+ [I]
1535
1542
  );
1536
1543
  ne(() => {
1537
- if (!(B <= Date.now()))
1544
+ if (!(W <= Date.now()))
1538
1545
  return $.current = setInterval(() => {
1539
- Date.now() >= B && (clearInterval($.current), F("idle"), Y(0), l([]));
1546
+ Date.now() >= W && (clearInterval($.current), F("idle"), J(0), u([]));
1540
1547
  }, 500), () => clearInterval($.current);
1541
- }, [B, F]);
1542
- const K = B > Date.now(), O = G(() => {
1543
- a && navigator.vibrate && navigator.vibrate(20);
1544
- }, [a]), Q = G(
1545
- async (z) => {
1546
- if (K || h === "success")
1548
+ }, [W, F]);
1549
+ const q = W > Date.now(), H = K(() => {
1550
+ i && navigator.vibrate && navigator.vibrate(20);
1551
+ }, [i]), Q = K(
1552
+ async (D) => {
1553
+ if (q || h === "success")
1547
1554
  return;
1548
- if (O(), z === "back") {
1549
- l((A) => A.slice(0, -1));
1555
+ if (H(), D === "back") {
1556
+ u((k) => k.slice(0, -1));
1550
1557
  return;
1551
1558
  }
1552
- if (z === "")
1559
+ if (D === "")
1553
1560
  return;
1554
- const I = [...w, z];
1555
- if (l(I), I.length < t)
1561
+ const T = [...w, D];
1562
+ if (u(T), T.length < t)
1556
1563
  return;
1557
- const x = I.join("");
1558
- if (F("processing"), m === "set") {
1559
- if (J === null) {
1560
- W(x), l([]), F("idle");
1564
+ const m = T.join("");
1565
+ if (F("processing"), x === "set") {
1566
+ if (Y === null) {
1567
+ _(m), u([]), F("idle");
1561
1568
  return;
1562
1569
  }
1563
- if (J !== x) {
1564
- W(null), l([]), F("failure"), setTimeout(() => F("idle"), 1200);
1570
+ if (Y !== m) {
1571
+ _(null), u([]), F("failure"), setTimeout(() => F("idle"), 1200);
1565
1572
  return;
1566
1573
  }
1567
- k == null || k(x), F("success");
1574
+ A == null || A(m), F("success");
1568
1575
  return;
1569
1576
  }
1570
1577
  let d = !1;
1571
- if (v) {
1572
- const A = new TextEncoder(), N = await crypto.subtle.digest("SHA-256", A.encode(x));
1573
- d = Array.from(new Uint8Array(N)).map((H) => H.toString(16).padStart(2, "0")).join("") === v;
1578
+ if (b) {
1579
+ const k = new TextEncoder(), N = await crypto.subtle.digest("SHA-256", k.encode(m));
1580
+ d = Array.from(new Uint8Array(N)).map((U) => U.toString(16).padStart(2, "0")).join("") === b;
1574
1581
  } else if (f)
1575
- d = x === f;
1582
+ d = m === f;
1576
1583
  else {
1577
- k == null || k(x), F("success");
1584
+ A == null || A(m), F("success");
1578
1585
  return;
1579
1586
  }
1580
1587
  if (d)
1581
- F("success"), y == null || y({
1588
+ F("success"), g == null || g({
1582
1589
  success: !0,
1583
1590
  confidence: 1,
1584
1591
  method: "pin",
1585
1592
  timestamp: Date.now(),
1586
1593
  duration: 0
1587
- }), k == null || k(x);
1594
+ }), A == null || A(m);
1588
1595
  else {
1589
- const A = q + 1;
1590
- if (Y(A), A >= s) {
1591
- const N = Date.now() + i;
1592
- U(N), F("failure"), M == null || M(new Error("Too many failed PIN attempts"));
1596
+ const k = G + 1;
1597
+ if (J(k), k >= o) {
1598
+ const N = Date.now() + s;
1599
+ O(N), F("failure"), L == null || L(new Error("Too many failed PIN attempts"));
1593
1600
  } else
1594
1601
  F("failure"), setTimeout(() => {
1595
- F("idle"), l([]);
1602
+ F("idle"), u([]);
1596
1603
  }, 800);
1597
- y == null || y({
1604
+ g == null || g({
1598
1605
  success: !1,
1599
1606
  confidence: 0,
1600
1607
  method: "pin",
@@ -1606,26 +1613,26 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
1606
1613
  [
1607
1614
  w,
1608
1615
  t,
1609
- K,
1616
+ q,
1610
1617
  h,
1611
- m,
1612
- J,
1613
- v,
1618
+ x,
1619
+ Y,
1620
+ b,
1614
1621
  f,
1615
- q,
1622
+ G,
1623
+ o,
1616
1624
  s,
1617
- i,
1618
- O,
1625
+ H,
1619
1626
  F,
1620
- k,
1621
- y,
1622
- M
1627
+ A,
1628
+ g,
1629
+ L
1623
1630
  ]
1624
- ), E = Math.max(0, Math.ceil((B - Date.now()) / 1e3)), C = h === "success" ? "var(--security-success)" : h === "failure" ? "var(--security-error)" : "var(--security-border)";
1631
+ ), E = Math.max(0, Math.ceil((W - Date.now()) / 1e3)), z = h === "success" ? "var(--security-success)" : h === "failure" ? "var(--security-error)" : "var(--security-border)";
1625
1632
  return /* @__PURE__ */ P(
1626
1633
  "div",
1627
1634
  {
1628
- className: S,
1635
+ className: v,
1629
1636
  style: {
1630
1637
  display: "inline-flex",
1631
1638
  flexDirection: "column",
@@ -1635,7 +1642,7 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
1635
1642
  color: "var(--security-text)"
1636
1643
  },
1637
1644
  children: [
1638
- p && /* @__PURE__ */ c("div", { style: { fontSize: 14, fontWeight: 600 }, children: p }),
1645
+ S && /* @__PURE__ */ c("div", { style: { fontSize: 14, fontWeight: 600 }, children: S }),
1639
1646
  /* @__PURE__ */ c(
1640
1647
  "div",
1641
1648
  {
@@ -1645,51 +1652,54 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
1645
1652
  minHeight: 18,
1646
1653
  textAlign: "center"
1647
1654
  },
1648
- children: K ? u("security.pin.locked", `Locked — try again in ${E}s`) : m === "set" && J !== null ? u("security.pin.confirm", "Confirm your PIN") : m === "set" ? u("security.pin.setNew", "Enter a new PIN") : u("security.pin.enter", "Enter your PIN")
1655
+ children: q ? l("security.pin.locked", "Locked — try again in {seconds}s").replace(
1656
+ "{seconds}",
1657
+ String(E)
1658
+ ) : x === "set" && Y !== null ? l("security.pin.confirm", "Confirm your PIN") : x === "set" ? l("security.pin.setNew", "Enter a new PIN") : l("security.pin.enter", "Enter your PIN")
1649
1659
  }
1650
1660
  ),
1651
- /* @__PURE__ */ c("div", { style: { display: "flex", gap: 12 }, children: Array.from({ length: t }, (z, I) => /* @__PURE__ */ c(
1661
+ /* @__PURE__ */ c("div", { style: { display: "flex", gap: 12 }, children: Array.from({ length: t }, (D, T) => /* @__PURE__ */ c(
1652
1662
  "div",
1653
1663
  {
1654
1664
  style: {
1655
1665
  width: 16,
1656
1666
  height: 16,
1657
1667
  borderRadius: "50%",
1658
- border: `2px solid ${C}`,
1659
- background: I < w.length ? C : "transparent",
1668
+ border: `2px solid ${z}`,
1669
+ background: T < w.length ? z : "transparent",
1660
1670
  transition: "background 0.15s, border-color 0.15s"
1661
1671
  }
1662
1672
  },
1663
- I
1673
+ T
1664
1674
  )) }),
1665
1675
  /* @__PURE__ */ c(
1666
1676
  "div",
1667
1677
  {
1668
1678
  style: {
1669
1679
  display: "grid",
1670
- gridTemplateColumns: `repeat(3, ${o}px)`,
1680
+ gridTemplateColumns: `repeat(3, ${a}px)`,
1671
1681
  gap: 10,
1672
- opacity: K ? 0.4 : 1,
1673
- pointerEvents: K ? "none" : "auto"
1682
+ opacity: q ? 0.4 : 1,
1683
+ pointerEvents: q ? "none" : "auto"
1674
1684
  },
1675
- children: j.map((z, I) => {
1676
- if (z === "")
1677
- return /* @__PURE__ */ c("div", {}, I);
1678
- const x = z === "back";
1685
+ children: B.map((D, T) => {
1686
+ if (D === "")
1687
+ return /* @__PURE__ */ c("div", {}, T);
1688
+ const m = D === "back";
1679
1689
  return /* @__PURE__ */ c(
1680
1690
  "button",
1681
1691
  {
1682
- onClick: () => Q(z),
1683
- disabled: K || h === "success",
1684
- "aria-label": x ? "Backspace" : z,
1692
+ onClick: () => Q(D),
1693
+ disabled: q || h === "success",
1694
+ "aria-label": m ? l("security.pin.backspace", "Backspace") : D,
1685
1695
  style: {
1686
- width: o,
1687
- height: o,
1696
+ width: a,
1697
+ height: a,
1688
1698
  borderRadius: "var(--security-key-border-radius, 50%)",
1689
1699
  border: "1px solid var(--security-key-border, var(--security-border))",
1690
1700
  background: "var(--security-key-bg, var(--security-bg-panel))",
1691
1701
  color: "var(--security-key-text, var(--security-text))",
1692
- fontSize: x ? 20 : 22,
1702
+ fontSize: m ? 20 : 22,
1693
1703
  fontWeight: 600,
1694
1704
  cursor: "pointer",
1695
1705
  display: "flex",
@@ -1707,9 +1717,9 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
1707
1717
  onMouseLeave: (d) => {
1708
1718
  d.currentTarget.style.transform = "";
1709
1719
  },
1710
- children: x ? /* @__PURE__ */ c(ze, { size: 22 }) : (g == null ? void 0 : g[z]) ?? z
1720
+ children: m ? /* @__PURE__ */ c(Ne, { size: 22 }) : (y == null ? void 0 : y[D]) ?? D
1711
1721
  },
1712
- I
1722
+ T
1713
1723
  );
1714
1724
  })
1715
1725
  }
@@ -1717,7 +1727,7 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
1717
1727
  w.length > 0 && h !== "success" && /* @__PURE__ */ c(
1718
1728
  "button",
1719
1729
  {
1720
- onClick: () => l([]),
1730
+ onClick: () => u([]),
1721
1731
  style: {
1722
1732
  fontSize: 12,
1723
1733
  background: "none",
@@ -1726,13 +1736,13 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
1726
1736
  cursor: "pointer",
1727
1737
  textDecoration: "underline"
1728
1738
  },
1729
- children: u("security.pin.clear", "Clear")
1739
+ children: l("security.pin.clear", "Clear")
1730
1740
  }
1731
1741
  ),
1732
- b && /* @__PURE__ */ c(
1742
+ p && /* @__PURE__ */ c(
1733
1743
  "button",
1734
1744
  {
1735
- onClick: T,
1745
+ onClick: C,
1736
1746
  style: {
1737
1747
  fontSize: 13,
1738
1748
  padding: "8px 16px",
@@ -1742,158 +1752,158 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
1742
1752
  color: "var(--security-biometric)",
1743
1753
  cursor: "pointer"
1744
1754
  },
1745
- children: u("security.pin.biometricFallback", "Use biometrics instead")
1755
+ children: l("security.pin.biometricFallback", "Use biometrics instead")
1746
1756
  }
1747
1757
  ),
1748
- q > 0 && h !== "success" && !K && /* @__PURE__ */ c("div", { style: { fontSize: 11, color: "var(--security-warning)" }, children: u("security.pin.attempts", `${q}/${s} attempts`) })
1758
+ G > 0 && h !== "success" && !q && /* @__PURE__ */ c("div", { style: { fontSize: 11, color: "var(--security-warning)" }, children: l("security.pin.attempts", "{attempts}/{max} attempts").replace("{attempts}", String(G)).replace("{max}", String(o)) })
1749
1759
  ]
1750
1760
  }
1751
1761
  );
1752
- }, ht = 3, ft = 4, yt = 5, pt = 14, jt = (e) => {
1762
+ }, ht = 3, ft = 4, yt = 5, pt = 14, Bt = (e) => {
1753
1763
  const {
1754
1764
  gridSize: t = ht,
1755
1765
  minLength: r = ft,
1756
1766
  showTrail: n = !0,
1757
- showError: s = !0,
1758
- maxAttempts: i = yt,
1759
- dotSize: o = pt,
1760
- trailColor: a,
1761
- mode: g = "verify",
1762
- expectedHash: v,
1767
+ showError: o = !0,
1768
+ maxAttempts: s = yt,
1769
+ dotSize: a = pt,
1770
+ trailColor: i,
1771
+ mode: y = "verify",
1772
+ expectedHash: b,
1763
1773
  expectedPattern: f,
1764
- onComplete: m,
1765
- onVerify: k,
1766
- onStatusChange: y,
1767
- onError: D,
1768
- label: M,
1769
- className: b,
1770
- canvasSize: T
1771
- } = e, { t: p } = te(), S = ee(null), [u, w] = _([]), [l, h] = _(!1), [L, q] = _("idle"), [Y, B] = _(0), [U, J] = _(null), [W, $] = _(null), j = T ?? t * 80, F = j / t, K = G(
1774
+ onComplete: x,
1775
+ onVerify: A,
1776
+ onStatusChange: g,
1777
+ onError: I,
1778
+ label: L,
1779
+ className: p,
1780
+ canvasSize: C
1781
+ } = e, { t: S } = te(), v = V(null), [l, w] = j([]), [u, h] = j(!1), [R, G] = j("idle"), [J, W] = j(0), [O, Y] = j(null), [_, $] = j(null), B = C ?? t * 80, F = B / t, q = K(
1772
1782
  (d) => {
1773
- q(d), y == null || y(d);
1783
+ G(d), g == null || g(d);
1774
1784
  },
1775
- [y]
1776
- ), O = G(() => {
1785
+ [g]
1786
+ ), H = K(() => {
1777
1787
  const d = [];
1778
- for (let A = 0; A < t; A++)
1788
+ for (let k = 0; k < t; k++)
1779
1789
  for (let N = 0; N < t; N++)
1780
- d.push({ x: N * F + F / 2, y: A * F + F / 2 });
1790
+ d.push({ x: N * F + F / 2, y: k * F + F / 2 });
1781
1791
  return d;
1782
- }, [t, F]), Q = G((d) => {
1783
- const A = S.current.getBoundingClientRect(), N = "touches" in d ? d.touches[0].clientX : d.clientX, R = "touches" in d ? d.touches[0].clientY : d.clientY;
1784
- return { x: N - A.left, y: R - A.top };
1785
- }, []), E = G(
1786
- (d, A) => {
1787
- const N = O(), R = F * 0.38;
1788
- for (let H = 0; H < N.length; H++) {
1789
- const Z = N[H].x - d, V = N[H].y - A;
1790
- if (Z * Z + V * V < R * R)
1791
- return H;
1792
+ }, [t, F]), Q = K((d) => {
1793
+ const k = v.current.getBoundingClientRect(), N = "touches" in d ? d.touches[0].clientX : d.clientX, M = "touches" in d ? d.touches[0].clientY : d.clientY;
1794
+ return { x: N - k.left, y: M - k.top };
1795
+ }, []), E = K(
1796
+ (d, k) => {
1797
+ const N = H(), M = F * 0.38;
1798
+ for (let U = 0; U < N.length; U++) {
1799
+ const Z = N[U].x - d, ee = N[U].y - k;
1800
+ if (Z * Z + ee * ee < M * M)
1801
+ return U;
1792
1802
  }
1793
1803
  return -1;
1794
1804
  },
1795
- [O, F]
1796
- ), C = G(() => {
1797
- var V;
1798
- const d = (V = S.current) == null ? void 0 : V.getContext("2d");
1805
+ [H, F]
1806
+ ), z = K(() => {
1807
+ var ee;
1808
+ const d = (ee = v.current) == null ? void 0 : ee.getContext("2d");
1799
1809
  if (!d)
1800
1810
  return;
1801
- d.clearRect(0, 0, j, j);
1802
- const A = O(), N = L === "failure", R = d.canvas, H = re(
1803
- N && s ? "var(--security-error)" : a ?? "var(--security-biometric)",
1804
- R
1805
- ), Z = re("var(--security-border)", R);
1806
- for (let X = 0; X < A.length; X++) {
1807
- const ie = u.includes(X);
1808
- d.beginPath(), d.arc(A[X].x, A[X].y, ie ? o * 0.75 : o * 0.5, 0, Math.PI * 2), d.fillStyle = ie ? H : Z, d.fill(), ie && (d.beginPath(), d.arc(A[X].x, A[X].y, o * 1.2, 0, Math.PI * 2), d.strokeStyle = H, d.lineWidth = 1.5, d.globalAlpha = 0.3, d.stroke(), d.globalAlpha = 1);
1811
+ d.clearRect(0, 0, B, B);
1812
+ const k = H(), N = R === "failure", M = d.canvas, U = re(
1813
+ N && o ? "var(--security-error)" : i ?? "var(--security-biometric)",
1814
+ M
1815
+ ), Z = re("var(--security-border)", M);
1816
+ for (let X = 0; X < k.length; X++) {
1817
+ const ie = l.includes(X);
1818
+ d.beginPath(), d.arc(k[X].x, k[X].y, ie ? a * 0.75 : a * 0.5, 0, Math.PI * 2), d.fillStyle = ie ? U : Z, d.fill(), ie && (d.beginPath(), d.arc(k[X].x, k[X].y, a * 1.2, 0, Math.PI * 2), d.strokeStyle = U, d.lineWidth = 1.5, d.globalAlpha = 0.3, d.stroke(), d.globalAlpha = 1);
1809
1819
  }
1810
- if (n && u.length > 1) {
1811
- d.beginPath(), d.moveTo(A[u[0]].x, A[u[0]].y);
1812
- for (let X = 1; X < u.length; X++)
1813
- d.lineTo(A[u[X]].x, A[u[X]].y);
1814
- l && W && d.lineTo(W.x, W.y), d.strokeStyle = H, d.lineWidth = 3, d.lineCap = "round", d.lineJoin = "round", d.globalAlpha = 0.5, d.stroke(), d.globalAlpha = 1;
1815
- } else n && u.length === 1 && l && W && (d.beginPath(), d.moveTo(A[u[0]].x, A[u[0]].y), d.lineTo(W.x, W.y), d.strokeStyle = re(a ?? "var(--security-biometric)", R), d.lineWidth = 3, d.globalAlpha = 0.4, d.stroke(), d.globalAlpha = 1);
1820
+ if (n && l.length > 1) {
1821
+ d.beginPath(), d.moveTo(k[l[0]].x, k[l[0]].y);
1822
+ for (let X = 1; X < l.length; X++)
1823
+ d.lineTo(k[l[X]].x, k[l[X]].y);
1824
+ u && _ && d.lineTo(_.x, _.y), d.strokeStyle = U, d.lineWidth = 3, d.lineCap = "round", d.lineJoin = "round", d.globalAlpha = 0.5, d.stroke(), d.globalAlpha = 1;
1825
+ } else n && l.length === 1 && u && _ && (d.beginPath(), d.moveTo(k[l[0]].x, k[l[0]].y), d.lineTo(_.x, _.y), d.strokeStyle = re(i ?? "var(--security-biometric)", M), d.lineWidth = 3, d.globalAlpha = 0.4, d.stroke(), d.globalAlpha = 1);
1816
1826
  }, [
1817
- j,
1818
- O,
1819
- o,
1820
- u,
1827
+ B,
1828
+ H,
1829
+ a,
1821
1830
  l,
1822
- W,
1823
- L,
1831
+ u,
1832
+ _,
1833
+ R,
1824
1834
  n,
1825
- s,
1826
- a
1835
+ o,
1836
+ i
1827
1837
  ]);
1828
1838
  ne(() => {
1829
- C();
1830
- }, [C]);
1831
- const z = G(
1839
+ z();
1840
+ }, [z]);
1841
+ const D = K(
1832
1842
  (d) => {
1833
- if (L === "success" || L === "failure")
1843
+ if (R === "success" || R === "failure")
1834
1844
  return;
1835
1845
  d.preventDefault();
1836
- const { x: A, y: N } = Q(d), R = E(A, N);
1837
- R >= 0 && (h(!0), w([R]), $({ x: A, y: N }));
1846
+ const { x: k, y: N } = Q(d), M = E(k, N);
1847
+ M >= 0 && (h(!0), w([M]), $({ x: k, y: N }));
1838
1848
  },
1839
- [L, Q, E]
1840
- ), I = G(
1849
+ [R, Q, E]
1850
+ ), T = K(
1841
1851
  (d) => {
1842
- if (!l)
1852
+ if (!u)
1843
1853
  return;
1844
1854
  d.preventDefault();
1845
- const { x: A, y: N } = Q(d);
1846
- $({ x: A, y: N });
1847
- const R = E(A, N);
1848
- R >= 0 && !u.includes(R) && w((H) => [...H, R]);
1855
+ const { x: k, y: N } = Q(d);
1856
+ $({ x: k, y: N });
1857
+ const M = E(k, N);
1858
+ M >= 0 && !l.includes(M) && w((U) => [...U, M]);
1849
1859
  },
1850
- [l, Q, E, u]
1851
- ), x = G(async () => {
1852
- if (!l)
1860
+ [u, Q, E, l]
1861
+ ), m = K(async () => {
1862
+ if (!u)
1853
1863
  return;
1854
- if (h(!1), $(null), u.length < r) {
1864
+ if (h(!1), $(null), l.length < r) {
1855
1865
  w([]);
1856
1866
  return;
1857
1867
  }
1858
- const d = u.join(",");
1859
- if (g === "set") {
1860
- if (U === null) {
1861
- J([...u]), w([]);
1868
+ const d = l.join(",");
1869
+ if (y === "set") {
1870
+ if (O === null) {
1871
+ Y([...l]), w([]);
1862
1872
  return;
1863
1873
  }
1864
- if (U.join(",") !== d) {
1865
- J(null), K("failure"), setTimeout(() => {
1866
- K("idle"), w([]);
1874
+ if (O.join(",") !== d) {
1875
+ Y(null), q("failure"), setTimeout(() => {
1876
+ q("idle"), w([]);
1867
1877
  }, 800);
1868
1878
  return;
1869
1879
  }
1870
- m == null || m([...u]), K("success");
1880
+ x == null || x([...l]), q("success");
1871
1881
  return;
1872
1882
  }
1873
- K("processing");
1874
- let A = !1;
1875
- if (v) {
1876
- const N = new TextEncoder(), R = await crypto.subtle.digest("SHA-256", N.encode(d));
1877
- A = Array.from(new Uint8Array(R)).map((Z) => Z.toString(16).padStart(2, "0")).join("") === v;
1883
+ q("processing");
1884
+ let k = !1;
1885
+ if (b) {
1886
+ const N = new TextEncoder(), M = await crypto.subtle.digest("SHA-256", N.encode(d));
1887
+ k = Array.from(new Uint8Array(M)).map((Z) => Z.toString(16).padStart(2, "0")).join("") === b;
1878
1888
  } else if (f)
1879
- A = d === f;
1889
+ k = d === f;
1880
1890
  else {
1881
- m == null || m([...u]), K("success");
1891
+ x == null || x([...l]), q("success");
1882
1892
  return;
1883
1893
  }
1884
- if (A)
1885
- K("success"), k == null || k({
1894
+ if (k)
1895
+ q("success"), A == null || A({
1886
1896
  success: !0,
1887
1897
  confidence: 1,
1888
1898
  method: "pattern",
1889
1899
  timestamp: Date.now(),
1890
1900
  duration: 0
1891
- }), m == null || m([...u]);
1901
+ }), x == null || x([...l]);
1892
1902
  else {
1893
- const N = Y + 1;
1894
- B(N), K("failure"), N >= i && (D == null || D(new Error("Too many failed pattern attempts"))), setTimeout(() => {
1895
- K("idle"), w([]);
1896
- }, 900), k == null || k({
1903
+ const N = J + 1;
1904
+ W(N), q("failure"), N >= s && (I == null || I(new Error("Too many failed pattern attempts"))), setTimeout(() => {
1905
+ q("idle"), w([]);
1906
+ }, 900), A == null || A({
1897
1907
  success: !1,
1898
1908
  confidence: 0,
1899
1909
  method: "pattern",
@@ -1902,24 +1912,24 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
1902
1912
  });
1903
1913
  }
1904
1914
  }, [
1905
- l,
1906
1915
  u,
1916
+ l,
1907
1917
  r,
1908
- g,
1909
- U,
1910
- v,
1918
+ y,
1919
+ O,
1920
+ b,
1911
1921
  f,
1912
- Y,
1913
- i,
1914
- K,
1915
- m,
1916
- k,
1917
- D
1922
+ J,
1923
+ s,
1924
+ q,
1925
+ x,
1926
+ A,
1927
+ I
1918
1928
  ]);
1919
1929
  return /* @__PURE__ */ P(
1920
1930
  "div",
1921
1931
  {
1922
- className: b,
1932
+ className: p,
1923
1933
  style: {
1924
1934
  display: "inline-flex",
1925
1935
  flexDirection: "column",
@@ -1929,7 +1939,7 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
1929
1939
  color: "var(--security-text)"
1930
1940
  },
1931
1941
  children: [
1932
- M && /* @__PURE__ */ c("div", { style: { fontSize: 14, fontWeight: 600 }, children: M }),
1942
+ L && /* @__PURE__ */ c("div", { style: { fontSize: 14, fontWeight: 600 }, children: L }),
1933
1943
  /* @__PURE__ */ c(
1934
1944
  "div",
1935
1945
  {
@@ -1939,37 +1949,37 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
1939
1949
  minHeight: 18,
1940
1950
  textAlign: "center"
1941
1951
  },
1942
- children: L === "success" ? p("security.pattern.success", "Pattern accepted") : L === "failure" ? p("security.pattern.wrong", "Wrong pattern") : g === "set" && U !== null ? p("security.pattern.confirm", "Draw pattern again to confirm") : g === "set" ? p("security.pattern.setNew", "Draw a new pattern") : p("security.pattern.draw", "Draw your pattern")
1952
+ children: R === "success" ? S("security.pattern.success", "Pattern accepted") : R === "failure" ? S("security.pattern.wrong", "Wrong pattern") : y === "set" && O !== null ? S("security.pattern.confirm", "Draw pattern again to confirm") : y === "set" ? S("security.pattern.setNew", "Draw a new pattern") : S("security.pattern.draw", "Draw your pattern")
1943
1953
  }
1944
1954
  ),
1945
1955
  /* @__PURE__ */ c(
1946
1956
  "canvas",
1947
1957
  {
1948
- ref: S,
1949
- width: j,
1950
- height: j,
1958
+ ref: v,
1959
+ width: B,
1960
+ height: B,
1951
1961
  style: {
1952
1962
  touchAction: "none",
1953
1963
  borderRadius: "var(--security-radius-lg)",
1954
1964
  background: "var(--security-bg-panel)",
1955
- border: `1px solid ${L === "failure" ? "var(--security-error)" : "var(--security-border)"}`,
1965
+ border: `1px solid ${R === "failure" ? "var(--security-error)" : "var(--security-border)"}`,
1956
1966
  cursor: "pointer",
1957
1967
  transition: "border-color 0.3s"
1958
1968
  },
1959
- onMouseDown: z,
1960
- onMouseMove: I,
1961
- onMouseUp: x,
1962
- onMouseLeave: x,
1963
- onTouchStart: z,
1964
- onTouchMove: I,
1965
- onTouchEnd: x
1969
+ onMouseDown: D,
1970
+ onMouseMove: T,
1971
+ onMouseUp: m,
1972
+ onMouseLeave: m,
1973
+ onTouchStart: D,
1974
+ onTouchMove: T,
1975
+ onTouchEnd: m
1966
1976
  }
1967
1977
  ),
1968
- (L === "failure" || L === "success") && /* @__PURE__ */ c(
1978
+ (R === "failure" || R === "success") && /* @__PURE__ */ c(
1969
1979
  "button",
1970
1980
  {
1971
1981
  onClick: () => {
1972
- w([]), B(0), J(null), K("idle");
1982
+ w([]), W(0), Y(null), q("idle");
1973
1983
  },
1974
1984
  style: {
1975
1985
  fontSize: 13,
@@ -1980,70 +1990,79 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
1980
1990
  color: "var(--security-text)",
1981
1991
  cursor: "pointer"
1982
1992
  },
1983
- children: p("security.common.retry", "Try Again")
1993
+ children: S("security.common.retry", "Try Again")
1984
1994
  }
1985
1995
  ),
1986
- Y > 0 && L !== "success" && /* @__PURE__ */ c("div", { style: { fontSize: 11, color: "var(--security-warning)" }, children: p("security.pattern.attempts", `${Y}/${i} attempts`) })
1996
+ J > 0 && R !== "success" && /* @__PURE__ */ c("div", { style: { fontSize: 11, color: "var(--security-warning)" }, children: S("security.pattern.attempts", "{attempts}/{max} attempts").replace("{attempts}", String(J)).replace("{max}", String(s)) })
1987
1997
  ]
1988
1998
  }
1989
1999
  );
1990
- }, gt = { sm: "8px 16px", md: "12px 24px", lg: "14px 32px" }, mt = { sm: 13, md: 14, lg: 16 }, Bt = (e) => {
2000
+ }, gt = { sm: "8px 16px", md: "12px 24px", lg: "14px 32px" }, mt = { sm: 13, md: 14, lg: 16 }, Wt = (e) => {
1991
2001
  const {
1992
2002
  mode: t,
1993
2003
  credentialIds: r = [],
1994
2004
  challenge: n,
1995
- rpName: s = window.location.hostname,
1996
- rpId: i = window.location.hostname,
1997
- user: o,
1998
- attestation: a = "none",
1999
- authenticatorAttachment: g,
2000
- residentKey: v = "preferred",
2001
- userVerification: f = "preferred",
2002
- onRegister: m,
2003
- onAuthenticate: k,
2004
- onVerify: y,
2005
- onStatusChange: D,
2006
- onError: M,
2007
- label: b,
2008
- className: T,
2009
- variant: p = "primary",
2010
- size: S = "md",
2011
- fullWidth: u = !1,
2012
- icon: w
2013
- } = e, { t: l } = te(), [h, L] = _("idle"), [q, Y] = _(!0), [B, U] = _(!1), J = G(
2014
- (C) => {
2015
- L(C), D == null || D(C);
2005
+ rpName: o = window.location.hostname,
2006
+ rpId: s = window.location.hostname,
2007
+ user: a,
2008
+ // no defaults here: the engine applies the documented ones (WebAuthnConfig). Until 1.2.2
2009
+ // these four were read and never passed on — the registration always used the engine's
2010
+ // fixed values, whatever the props said.
2011
+ attestation: i,
2012
+ authenticatorAttachment: y,
2013
+ residentKey: b,
2014
+ userVerification: f,
2015
+ timeout: x,
2016
+ onRegister: A,
2017
+ onAuthenticate: g,
2018
+ onVerify: I,
2019
+ onStatusChange: L,
2020
+ onError: p,
2021
+ label: C,
2022
+ className: S,
2023
+ variant: v = "primary",
2024
+ size: l = "md",
2025
+ fullWidth: w = !1,
2026
+ icon: u
2027
+ } = e, { t: h } = te(), [R, G] = j("idle"), [J, W] = j(!0), [O, Y] = j(!1), _ = K(
2028
+ (D) => {
2029
+ G(D), L == null || L(D);
2016
2030
  },
2017
- [D]
2031
+ [L]
2018
2032
  );
2019
2033
  ne(() => {
2020
- Y(Ce()), et().then(U);
2034
+ W(De()), tt().then(Y);
2021
2035
  }, []);
2022
- const W = G(() => {
2036
+ const $ = K(() => {
2023
2037
  if (n) {
2024
- const C = atob(n.replace(/-/g, "+").replace(/_/g, "/")), z = new Uint8Array(C.length);
2025
- for (let I = 0; I < C.length; I++)
2026
- z[I] = C.charCodeAt(I);
2027
- return z.buffer;
2038
+ const D = atob(n.replace(/-/g, "+").replace(/_/g, "/")), T = new Uint8Array(D.length);
2039
+ for (let m = 0; m < D.length; m++)
2040
+ T[m] = D.charCodeAt(m);
2041
+ return T.buffer;
2028
2042
  }
2029
2043
  return crypto.getRandomValues(new Uint8Array(32)).buffer;
2030
- }, [n]), $ = G(async () => {
2031
- if (!q) {
2032
- M == null || M(new Error("WebAuthn not available"));
2044
+ }, [n]), B = K(async () => {
2045
+ if (!J) {
2046
+ p == null || p(new Error("WebAuthn not available"));
2033
2047
  return;
2034
2048
  }
2035
- J("processing");
2049
+ _("processing");
2036
2050
  try {
2037
2051
  if (t === "register") {
2038
- const C = (o == null ? void 0 : o.id) ?? crypto.getRandomValues(new Uint8Array(16)), z = (o == null ? void 0 : o.name) ?? "user", I = (o == null ? void 0 : o.displayName) ?? z, x = W(), d = await tt({
2039
- rpName: s,
2040
- rpId: i,
2041
- userId: typeof C == "string" ? C : Array.from(C).join(""),
2042
- userName: z,
2043
- userDisplayName: I,
2044
- challenge: x
2052
+ const D = (a == null ? void 0 : a.id) ?? crypto.getRandomValues(new Uint8Array(16)), T = (a == null ? void 0 : a.name) ?? "user", m = (a == null ? void 0 : a.displayName) ?? T, d = $(), k = await rt({
2053
+ rpName: o,
2054
+ rpId: s,
2055
+ userId: typeof D == "string" ? D : Array.from(D).join(""),
2056
+ userName: T,
2057
+ userDisplayName: m,
2058
+ challenge: d,
2059
+ timeout: x,
2060
+ attestation: i,
2061
+ authenticatorAttachment: y,
2062
+ residentKey: b,
2063
+ userVerification: f
2045
2064
  });
2046
- J("success"), d && (m == null || m(d)), y == null || y({
2065
+ _("success"), k && (A == null || A(k)), I == null || I({
2047
2066
  success: !0,
2048
2067
  confidence: 1,
2049
2068
  method: "webauthn",
@@ -2051,15 +2070,17 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2051
2070
  duration: 0
2052
2071
  });
2053
2072
  } else {
2054
- const C = await rt({
2055
- rpId: i,
2056
- challenge: W(),
2057
- allowCredentials: r == null ? void 0 : r.map((z) => ({
2058
- id: new TextEncoder().encode(z),
2073
+ const D = await nt({
2074
+ rpId: s,
2075
+ challenge: $(),
2076
+ allowCredentials: r == null ? void 0 : r.map((T) => ({
2077
+ id: new TextEncoder().encode(T),
2059
2078
  type: "public-key"
2060
- }))
2079
+ })),
2080
+ timeout: x,
2081
+ userVerification: f
2061
2082
  });
2062
- J("success"), C && (k == null || k(C)), y == null || y({
2083
+ _("success"), D && (g == null || g(D)), I == null || I({
2063
2084
  success: !0,
2064
2085
  confidence: 1,
2065
2086
  method: "webauthn",
@@ -2067,9 +2088,9 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2067
2088
  duration: 0
2068
2089
  });
2069
2090
  }
2070
- } catch (C) {
2071
- const z = C instanceof Error ? C : new Error(String(C));
2072
- z.name === "NotAllowedError" ? J("idle") : (J("error"), M == null || M(z), y == null || y({
2091
+ } catch (D) {
2092
+ const T = D instanceof Error ? D : new Error(String(D));
2093
+ T.name === "NotAllowedError" ? _("idle") : (_("error"), p == null || p(T), I == null || I({
2073
2094
  success: !1,
2074
2095
  confidence: 0,
2075
2096
  method: "webauthn",
@@ -2078,59 +2099,60 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2078
2099
  }));
2079
2100
  }
2080
2101
  }, [
2081
- q,
2102
+ J,
2082
2103
  t,
2083
2104
  r,
2105
+ a,
2084
2106
  o,
2085
2107
  s,
2086
2108
  i,
2087
- a,
2088
- g,
2089
- v,
2090
- f,
2091
- W,
2092
- J,
2093
- m,
2094
- k,
2095
2109
  y,
2096
- M
2097
- ]), j = t === "register" ? B ? l("security.webauthn.registerPasskey", "Register Passkey") : l("security.webauthn.register", "Register Security Key") : B ? l("security.webauthn.signInPasskey", "Sign in with Passkey") : l("security.webauthn.signIn", "Sign in with Security Key"), F = b ?? j, K = {
2110
+ b,
2111
+ f,
2112
+ x,
2113
+ $,
2114
+ _,
2115
+ A,
2116
+ g,
2117
+ I,
2118
+ p
2119
+ ]), F = t === "register" ? O ? h("security.webauthn.registerPasskey", "Register Passkey") : h("security.webauthn.register", "Register Security Key") : O ? h("security.webauthn.signInPasskey", "Sign in with Passkey") : h("security.webauthn.signIn", "Sign in with Security Key"), q = C ?? F, H = {
2098
2120
  primary: "var(--security-biometric)",
2099
2121
  outline: "transparent",
2100
2122
  ghost: "transparent"
2101
- }, O = {
2123
+ }, Q = {
2102
2124
  primary: "none",
2103
2125
  outline: "2px solid var(--security-biometric)",
2104
2126
  ghost: "none"
2105
- }, Q = {
2127
+ }, E = {
2106
2128
  // Label on the brand-coloured button: the on-primary text token, not a surface token.
2107
2129
  primary: "var(--nice-color-white, #fff)",
2108
2130
  outline: "var(--security-biometric)",
2109
2131
  ghost: "var(--security-biometric)"
2110
- }, E = !q || h === "processing" || h === "success";
2132
+ }, z = !J || R === "processing" || R === "success";
2111
2133
  return /* @__PURE__ */ P(
2112
2134
  "div",
2113
2135
  {
2114
- className: T,
2115
- style: { display: u ? "block" : "inline-block", textAlign: "center" },
2136
+ className: S,
2137
+ style: { display: w ? "block" : "inline-block", textAlign: "center" },
2116
2138
  children: [
2117
2139
  /* @__PURE__ */ P(
2118
2140
  "button",
2119
2141
  {
2120
- onClick: $,
2121
- disabled: E,
2142
+ onClick: B,
2143
+ disabled: z,
2122
2144
  style: {
2123
- width: u ? "100%" : "auto",
2124
- padding: gt[S],
2125
- fontSize: mt[S],
2145
+ width: w ? "100%" : "auto",
2146
+ padding: gt[l],
2147
+ fontSize: mt[l],
2126
2148
  fontWeight: 600,
2127
2149
  fontFamily: "var(--security-font)",
2128
- background: K[p],
2129
- color: Q[p],
2130
- border: O[p],
2150
+ background: H[v],
2151
+ color: E[v],
2152
+ border: Q[v],
2131
2153
  borderRadius: "var(--security-radius)",
2132
- cursor: E ? "not-allowed" : "pointer",
2133
- opacity: E ? 0.6 : 1,
2154
+ cursor: z ? "not-allowed" : "pointer",
2155
+ opacity: z ? 0.6 : 1,
2134
2156
  display: "inline-flex",
2135
2157
  alignItems: "center",
2136
2158
  justifyContent: "center",
@@ -2138,7 +2160,7 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2138
2160
  transition: "opacity 0.2s, transform 0.1s"
2139
2161
  },
2140
2162
  children: [
2141
- h === "processing" && /* @__PURE__ */ c(
2163
+ R === "processing" && /* @__PURE__ */ c(
2142
2164
  "span",
2143
2165
  {
2144
2166
  style: {
@@ -2152,7 +2174,7 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2152
2174
  }
2153
2175
  }
2154
2176
  ),
2155
- h === "success" && /* @__PURE__ */ c(
2177
+ R === "success" && /* @__PURE__ */ c(
2156
2178
  "span",
2157
2179
  {
2158
2180
  "aria-hidden": "true",
@@ -2167,33 +2189,33 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2167
2189
  }
2168
2190
  }
2169
2191
  ),
2170
- w && h !== "processing" && h !== "success" && w,
2171
- F
2192
+ u && R !== "processing" && R !== "success" && u,
2193
+ q
2172
2194
  ]
2173
2195
  }
2174
2196
  ),
2175
- !q && /* @__PURE__ */ c("div", { style: { fontSize: 11, marginTop: 6, color: "var(--security-warning)" }, children: l("security.webauthn.notAvailable", "WebAuthn is not supported in this browser") }),
2176
- h === "error" && /* @__PURE__ */ c("div", { style: { fontSize: 11, marginTop: 6, color: "var(--security-error)" }, children: l("security.webauthn.error", "Authentication failed — try again") }),
2197
+ !J && /* @__PURE__ */ c("div", { style: { fontSize: 11, marginTop: 6, color: "var(--security-warning)" }, children: h("security.webauthn.notAvailable", "WebAuthn is not supported in this browser") }),
2198
+ R === "error" && /* @__PURE__ */ c("div", { style: { fontSize: 11, marginTop: 6, color: "var(--security-error)" }, children: h("security.webauthn.error", "Authentication failed — try again") }),
2177
2199
  /* @__PURE__ */ c("style", { children: "@keyframes spin { to { transform: rotate(360deg); } }" })
2178
2200
  ]
2179
2201
  }
2180
2202
  );
2181
- }, vt = [], bt = (e) => e >= 80 ? "var(--security-error)" : e >= 50 ? "var(--security-warning)" : "var(--security-success)", Wt = ({
2203
+ }, vt = [], bt = (e) => e >= 80 ? "var(--security-error)" : e >= 50 ? "var(--security-warning)" : "var(--security-success)", Ht = ({
2182
2204
  entries: e = vt,
2183
2205
  pageSize: t = 20,
2184
2206
  showExport: r = !0,
2185
2207
  filterMethods: n,
2186
- onEntryClick: s,
2187
- className: i,
2188
- label: o
2208
+ onEntryClick: o,
2209
+ className: s,
2210
+ label: a
2189
2211
  }) => {
2190
- const { t: a } = te(), [g, v] = _("all"), [f, m] = _("all"), [k, y] = _(0), D = ae(() => {
2191
- let l = [...e];
2192
- return g !== "all" && (l = l.filter((h) => h.method === g)), f !== "all" && (l = l.filter((h) => h.status === f)), l.sort((h, L) => L.timestamp - h.timestamp), l;
2193
- }, [e, g, f]), M = Math.max(1, Math.ceil(D.length / t)), b = D.slice(k * t, (k + 1) * t), T = ae(() => n || Array.from(new Set(e.map((l) => l.method))), [e, n]), p = ae(() => Array.from(new Set(e.map((l) => l.status))), [e]), S = G(() => {
2194
- const l = new Blob([JSON.stringify(D, null, 2)], { type: "application/json" }), h = URL.createObjectURL(l), L = document.createElement("a");
2195
- L.href = h, L.download = `security-audit-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.json`, L.click(), URL.revokeObjectURL(h);
2196
- }, [D]), u = (l) => new Date(l).toLocaleString(), w = {
2212
+ const { t: i } = te(), [y, b] = j("all"), [f, x] = j("all"), [A, g] = j(0), I = ae(() => {
2213
+ let u = [...e];
2214
+ return y !== "all" && (u = u.filter((h) => h.method === y)), f !== "all" && (u = u.filter((h) => h.status === f)), u.sort((h, R) => R.timestamp - h.timestamp), u;
2215
+ }, [e, y, f]), L = Math.max(1, Math.ceil(I.length / t)), p = I.slice(A * t, (A + 1) * t), C = ae(() => n || Array.from(new Set(e.map((u) => u.method))), [e, n]), S = ae(() => Array.from(new Set(e.map((u) => u.status))), [e]), v = K(() => {
2216
+ const u = new Blob([JSON.stringify(I, null, 2)], { type: "application/json" }), h = URL.createObjectURL(u), R = document.createElement("a");
2217
+ R.href = h, R.download = `security-audit-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.json`, R.click(), URL.revokeObjectURL(h);
2218
+ }, [I]), l = (u) => new Date(u).toLocaleString(), w = {
2197
2219
  padding: "8px 12px",
2198
2220
  borderBottom: "1px solid var(--security-border)",
2199
2221
  fontSize: 13,
@@ -2202,7 +2224,7 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2202
2224
  return /* @__PURE__ */ P(
2203
2225
  "div",
2204
2226
  {
2205
- className: i,
2227
+ className: s,
2206
2228
  style: {
2207
2229
  fontFamily: "var(--security-font)",
2208
2230
  color: "var(--security-text)",
@@ -2224,19 +2246,19 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2224
2246
  borderBottom: "1px solid var(--security-border)"
2225
2247
  },
2226
2248
  children: [
2227
- /* @__PURE__ */ c("div", { style: { fontWeight: 600, fontSize: 15 }, children: o ?? a("security.audit.title", "Security Audit Log") }),
2249
+ /* @__PURE__ */ c("div", { style: { fontWeight: 600, fontSize: 15 }, children: a ?? i("security.audit.title", "Security Audit Log") }),
2228
2250
  /* @__PURE__ */ P("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
2229
2251
  /* @__PURE__ */ P(
2230
2252
  "select",
2231
2253
  {
2232
- value: g,
2233
- onChange: (l) => {
2234
- v(l.target.value), y(0);
2254
+ value: y,
2255
+ onChange: (u) => {
2256
+ b(u.target.value), g(0);
2235
2257
  },
2236
2258
  style: xe,
2237
2259
  children: [
2238
- /* @__PURE__ */ c("option", { value: "all", children: a("security.audit.allMethods", "All methods") }),
2239
- T.map((l) => /* @__PURE__ */ c("option", { value: l, children: l }, l))
2260
+ /* @__PURE__ */ c("option", { value: "all", children: i("security.audit.allMethods", "All methods") }),
2261
+ C.map((u) => /* @__PURE__ */ c("option", { value: u, children: u }, u))
2240
2262
  ]
2241
2263
  }
2242
2264
  ),
@@ -2244,23 +2266,23 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2244
2266
  "select",
2245
2267
  {
2246
2268
  value: f,
2247
- onChange: (l) => {
2248
- m(l.target.value), y(0);
2269
+ onChange: (u) => {
2270
+ x(u.target.value), g(0);
2249
2271
  },
2250
2272
  style: xe,
2251
2273
  children: [
2252
- /* @__PURE__ */ c("option", { value: "all", children: a("security.audit.allStatuses", "All statuses") }),
2253
- p.map((l) => /* @__PURE__ */ c("option", { value: l, children: l }, l))
2274
+ /* @__PURE__ */ c("option", { value: "all", children: i("security.audit.allStatuses", "All statuses") }),
2275
+ S.map((u) => /* @__PURE__ */ c("option", { value: u, children: u }, u))
2254
2276
  ]
2255
2277
  }
2256
2278
  ),
2257
2279
  r && /* @__PURE__ */ c(
2258
2280
  "button",
2259
2281
  {
2260
- onClick: S,
2282
+ onClick: v,
2261
2283
  style: xt,
2262
- title: a("security.audit.exportJson", "Export JSON"),
2263
- children: a("security.json", "JSON")
2284
+ title: i("security.audit.exportJson", "Export JSON"),
2285
+ children: i("security.json", "JSON")
2264
2286
  }
2265
2287
  )
2266
2288
  ] })
@@ -2279,17 +2301,17 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2279
2301
  letterSpacing: 0.5
2280
2302
  },
2281
2303
  children: [
2282
- /* @__PURE__ */ c("th", { style: { ...w, textAlign: "left" }, children: a("security.audit.time", "Time") }),
2283
- /* @__PURE__ */ c("th", { style: { ...w, textAlign: "left" }, children: a("security.audit.action", "Action") }),
2284
- /* @__PURE__ */ c("th", { style: { ...w, textAlign: "center" }, children: a("security.audit.method", "Method") }),
2285
- /* @__PURE__ */ c("th", { style: { ...w, textAlign: "center" }, children: a("security.audit.status", "Status") }),
2286
- /* @__PURE__ */ c("th", { style: { ...w, textAlign: "center" }, children: a("security.audit.risk", "Risk") }),
2287
- /* @__PURE__ */ c("th", { style: { ...w, textAlign: "left" }, children: a("security.audit.device", "Device") })
2304
+ /* @__PURE__ */ c("th", { style: { ...w, textAlign: "left" }, children: i("security.audit.time", "Time") }),
2305
+ /* @__PURE__ */ c("th", { style: { ...w, textAlign: "left" }, children: i("security.audit.action", "Action") }),
2306
+ /* @__PURE__ */ c("th", { style: { ...w, textAlign: "center" }, children: i("security.audit.method", "Method") }),
2307
+ /* @__PURE__ */ c("th", { style: { ...w, textAlign: "center" }, children: i("security.audit.status", "Status") }),
2308
+ /* @__PURE__ */ c("th", { style: { ...w, textAlign: "center" }, children: i("security.audit.risk", "Risk") }),
2309
+ /* @__PURE__ */ c("th", { style: { ...w, textAlign: "left" }, children: i("security.audit.device", "Device") })
2288
2310
  ]
2289
2311
  }
2290
2312
  ) }),
2291
2313
  /* @__PURE__ */ P("tbody", { children: [
2292
- b.length === 0 && /* @__PURE__ */ c("tr", { children: /* @__PURE__ */ c(
2314
+ p.length === 0 && /* @__PURE__ */ c("tr", { children: /* @__PURE__ */ c(
2293
2315
  "td",
2294
2316
  {
2295
2317
  colSpan: 6,
@@ -2299,14 +2321,14 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2299
2321
  color: "var(--security-text-muted)",
2300
2322
  padding: 24
2301
2323
  },
2302
- children: a("security.audit.noEntries", "No entries to show")
2324
+ children: i("security.audit.noEntries", "No entries to show")
2303
2325
  }
2304
2326
  ) }),
2305
- b.map((l) => /* @__PURE__ */ P(
2327
+ p.map((u) => /* @__PURE__ */ P(
2306
2328
  "tr",
2307
2329
  {
2308
- onClick: () => s == null ? void 0 : s(l),
2309
- style: { cursor: s ? "pointer" : "default" },
2330
+ onClick: () => o == null ? void 0 : o(u),
2331
+ style: { cursor: o ? "pointer" : "default" },
2310
2332
  onMouseEnter: (h) => {
2311
2333
  h.currentTarget.style.background = "var(--security-bg-panel)";
2312
2334
  },
@@ -2314,8 +2336,8 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2314
2336
  h.currentTarget.style.background = "";
2315
2337
  },
2316
2338
  children: [
2317
- /* @__PURE__ */ c("td", { style: w, children: u(l.timestamp) }),
2318
- /* @__PURE__ */ c("td", { style: w, children: l.action }),
2339
+ /* @__PURE__ */ c("td", { style: w, children: l(u.timestamp) }),
2340
+ /* @__PURE__ */ c("td", { style: w, children: u.action }),
2319
2341
  /* @__PURE__ */ c("td", { style: { ...w, textAlign: "center" }, children: /* @__PURE__ */ c(
2320
2342
  "span",
2321
2343
  {
@@ -2327,11 +2349,11 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2327
2349
  background: "var(--security-bg-panel)",
2328
2350
  border: "1px solid var(--security-border)"
2329
2351
  },
2330
- children: l.method
2352
+ children: u.method
2331
2353
  }
2332
2354
  ) }),
2333
- /* @__PURE__ */ c("td", { style: { ...w, textAlign: "center" }, children: l.status }),
2334
- /* @__PURE__ */ c("td", { style: { ...w, textAlign: "center" }, children: l.riskScore != null && /* @__PURE__ */ c("span", { style: { color: bt(l.riskScore), fontWeight: 600 }, children: l.riskScore }) }),
2355
+ /* @__PURE__ */ c("td", { style: { ...w, textAlign: "center" }, children: u.status }),
2356
+ /* @__PURE__ */ c("td", { style: { ...w, textAlign: "center" }, children: u.riskScore != null && /* @__PURE__ */ c("span", { style: { color: bt(u.riskScore), fontWeight: 600 }, children: u.riskScore }) }),
2335
2357
  /* @__PURE__ */ c(
2336
2358
  "td",
2337
2359
  {
@@ -2341,16 +2363,16 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2341
2363
  overflow: "hidden",
2342
2364
  textOverflow: "ellipsis"
2343
2365
  },
2344
- children: l.device ?? "—"
2366
+ children: u.device ?? "—"
2345
2367
  }
2346
2368
  )
2347
2369
  ]
2348
2370
  },
2349
- l.id
2371
+ u.id
2350
2372
  ))
2351
2373
  ] })
2352
2374
  ] }) }),
2353
- M > 1 && /* @__PURE__ */ P(
2375
+ L > 1 && /* @__PURE__ */ P(
2354
2376
  "div",
2355
2377
  {
2356
2378
  style: {
@@ -2364,26 +2386,26 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2364
2386
  borderTop: "1px solid var(--security-border)"
2365
2387
  },
2366
2388
  children: [
2367
- /* @__PURE__ */ P("button", { disabled: k === 0, onClick: () => y(k - 1), style: we, children: [
2368
- /* @__PURE__ */ c(Ne, { size: 14, style: { verticalAlign: "-2px" } }),
2389
+ /* @__PURE__ */ P("button", { disabled: A === 0, onClick: () => g(A - 1), style: we, children: [
2390
+ /* @__PURE__ */ c(Le, { size: 14, style: { verticalAlign: "-2px" } }),
2369
2391
  " ",
2370
- a("security.audit.prev", "Prev")
2392
+ i("security.audit.prev", "Prev")
2371
2393
  ] }),
2372
2394
  /* @__PURE__ */ P("span", { children: [
2373
- k + 1,
2395
+ A + 1,
2374
2396
  " / ",
2375
- M
2397
+ L
2376
2398
  ] }),
2377
2399
  /* @__PURE__ */ P(
2378
2400
  "button",
2379
2401
  {
2380
- disabled: k >= M - 1,
2381
- onClick: () => y(k + 1),
2402
+ disabled: A >= L - 1,
2403
+ onClick: () => g(A + 1),
2382
2404
  style: we,
2383
2405
  children: [
2384
- a("security.audit.next", "Next"),
2406
+ i("security.audit.next", "Next"),
2385
2407
  " ",
2386
- /* @__PURE__ */ c(Le, { size: 14, style: { verticalAlign: "-2px" } })
2408
+ /* @__PURE__ */ c($e, { size: 14, style: { verticalAlign: "-2px" } })
2387
2409
  ]
2388
2410
  }
2389
2411
  )
@@ -2399,7 +2421,10 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2399
2421
  color: "var(--security-text-muted)",
2400
2422
  textAlign: "right"
2401
2423
  },
2402
- children: a("security.audit.total", `${D.length} entries`)
2424
+ children: i("security.audit.total", "{count} entries").replace(
2425
+ "{count}",
2426
+ String(I.length)
2427
+ )
2403
2428
  }
2404
2429
  )
2405
2430
  ]
@@ -2439,15 +2464,15 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2439
2464
  requiredCount: t = 1,
2440
2465
  onSelect: r,
2441
2466
  onComplete: n,
2442
- className: s,
2443
- label: i,
2444
- layout: o = "grid"
2467
+ className: o,
2468
+ label: s,
2469
+ layout: a = "grid"
2445
2470
  }) => {
2446
- const { t: a } = te(), g = e.filter((f) => f.verified).length, v = g >= t;
2471
+ const { t: i } = te(), y = e.filter((f) => f.verified).length, b = y >= t;
2447
2472
  return /* @__PURE__ */ P(
2448
2473
  "div",
2449
2474
  {
2450
- className: s,
2475
+ className: o,
2451
2476
  style: {
2452
2477
  fontFamily: "var(--security-font)",
2453
2478
  color: "var(--security-text)",
@@ -2456,40 +2481,40 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2456
2481
  gap: 16
2457
2482
  },
2458
2483
  children: [
2459
- i && /* @__PURE__ */ c("div", { style: { fontSize: 15, fontWeight: 600 }, children: i }),
2460
- t > 1 && /* @__PURE__ */ c("div", { style: { fontSize: 13, color: "var(--security-text-secondary)" }, children: a("security.mfa.progress", `Verified ${g} of ${t} required`) }),
2484
+ s && /* @__PURE__ */ c("div", { style: { fontSize: 15, fontWeight: 600 }, children: s }),
2485
+ t > 1 && /* @__PURE__ */ c("div", { style: { fontSize: 13, color: "var(--security-text-secondary)" }, children: i("security.mfa.progress", "Verified {verified} of {required} required").replace("{verified}", String(y)).replace("{required}", String(t)) }),
2461
2486
  /* @__PURE__ */ c(
2462
2487
  "div",
2463
2488
  {
2464
2489
  style: {
2465
- display: o === "grid" ? "grid" : "flex",
2466
- gridTemplateColumns: o === "grid" ? "repeat(auto-fill, minmax(140px, 1fr))" : void 0,
2467
- flexDirection: o === "list" ? "column" : void 0,
2490
+ display: a === "grid" ? "grid" : "flex",
2491
+ gridTemplateColumns: a === "grid" ? "repeat(auto-fill, minmax(140px, 1fr))" : void 0,
2492
+ flexDirection: a === "list" ? "column" : void 0,
2468
2493
  gap: 12
2469
2494
  },
2470
2495
  children: e.map((f) => {
2471
- const m = f.verified ?? !1, k = f.disabled || v;
2496
+ const x = f.verified ?? !1, A = f.disabled || b;
2472
2497
  return /* @__PURE__ */ P(
2473
2498
  "button",
2474
2499
  {
2475
- onClick: () => !k && !m && (r == null ? void 0 : r(f.method)),
2476
- disabled: k || m,
2500
+ onClick: () => !A && !x && (r == null ? void 0 : r(f.method)),
2501
+ disabled: A || x,
2477
2502
  style: {
2478
2503
  display: "flex",
2479
- flexDirection: o === "grid" ? "column" : "row",
2504
+ flexDirection: a === "grid" ? "column" : "row",
2480
2505
  alignItems: "center",
2481
- gap: o === "grid" ? 8 : 12,
2482
- padding: o === "grid" ? "20px 16px" : "12px 16px",
2483
- background: m ? "color-mix(in srgb, var(--nice-color-success, #10b981) 8%, transparent)" : "var(--security-bg-panel)",
2484
- border: `2px solid ${m ? "var(--security-success)" : "var(--security-border)"}`,
2506
+ gap: a === "grid" ? 8 : 12,
2507
+ padding: a === "grid" ? "20px 16px" : "12px 16px",
2508
+ background: x ? "color-mix(in srgb, var(--nice-color-success, #10b981) 8%, transparent)" : "var(--security-bg-panel)",
2509
+ border: `2px solid ${x ? "var(--security-success)" : "var(--security-border)"}`,
2485
2510
  borderRadius: "var(--security-radius-lg)",
2486
- cursor: k || m ? "default" : "pointer",
2487
- opacity: k && !m ? 0.5 : 1,
2511
+ cursor: A || x ? "default" : "pointer",
2512
+ opacity: A && !x ? 0.5 : 1,
2488
2513
  transition: "border-color 0.2s, background 0.2s",
2489
- textAlign: o === "grid" ? "center" : "left"
2514
+ textAlign: a === "grid" ? "center" : "left"
2490
2515
  },
2491
2516
  children: [
2492
- /* @__PURE__ */ c("span", { style: { fontSize: 28 }, children: m ? /* @__PURE__ */ c(
2517
+ /* @__PURE__ */ c("span", { style: { fontSize: 28 }, children: x ? /* @__PURE__ */ c(
2493
2518
  "span",
2494
2519
  {
2495
2520
  "aria-label": "verified",
@@ -2507,7 +2532,7 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2507
2532
  })
2508
2533
  }
2509
2534
  ),
2510
- v && /* @__PURE__ */ P(
2535
+ b && /* @__PURE__ */ P(
2511
2536
  "div",
2512
2537
  {
2513
2538
  style: {
@@ -2519,7 +2544,7 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2519
2544
  },
2520
2545
  children: [
2521
2546
  /* @__PURE__ */ c("span", { "aria-hidden": "true", style: Se }),
2522
- a("security.mfa.complete", "All factors verified")
2547
+ i("security.mfa.complete", "All factors verified")
2523
2548
  ]
2524
2549
  }
2525
2550
  )
@@ -2531,25 +2556,25 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2531
2556
  onRevoke: t,
2532
2557
  onRevokeAll: r,
2533
2558
  onTrust: n,
2534
- className: s,
2535
- label: i,
2536
- showRevokeAll: o = !0
2559
+ className: o,
2560
+ label: s,
2561
+ showRevokeAll: a = !0
2537
2562
  }) => {
2538
- const { t: a } = te(), [g, v] = _(/* @__PURE__ */ new Set()), f = ae(
2563
+ const { t: i } = te(), [y, b] = j(/* @__PURE__ */ new Set()), f = ae(
2539
2564
  () => [...e].sort(
2540
- (y, D) => (D.current ? 1 : 0) - (y.current ? 1 : 0) || D.lastActive - y.lastActive
2565
+ (g, I) => (I.current ? 1 : 0) - (g.current ? 1 : 0) || I.lastActive - g.lastActive
2541
2566
  ),
2542
2567
  [e]
2543
- ), m = (y) => {
2544
- const D = new Date(y), b = Date.now() - y;
2545
- return b < 6e4 ? a("security.session.justNow", "Just now") : b < 36e5 ? `${Math.floor(b / 6e4)}m ago` : b < 864e5 ? `${Math.floor(b / 36e5)}h ago` : D.toLocaleDateString();
2546
- }, k = (y) => {
2547
- v((D) => new Set(D).add(y)), t == null || t(y);
2568
+ ), x = (g) => {
2569
+ const I = new Date(g), p = Date.now() - g;
2570
+ return p < 6e4 ? i("security.session.justNow", "Just now") : p < 36e5 ? `${Math.floor(p / 6e4)}m ago` : p < 864e5 ? `${Math.floor(p / 36e5)}h ago` : I.toLocaleDateString();
2571
+ }, A = (g) => {
2572
+ b((I) => new Set(I).add(g)), t == null || t(g);
2548
2573
  };
2549
2574
  return /* @__PURE__ */ P(
2550
2575
  "div",
2551
2576
  {
2552
- className: s,
2577
+ className: o,
2553
2578
  style: {
2554
2579
  fontFamily: "var(--security-font)",
2555
2580
  color: "var(--security-text)",
@@ -2571,8 +2596,8 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2571
2596
  borderBottom: "1px solid var(--security-border)"
2572
2597
  },
2573
2598
  children: [
2574
- /* @__PURE__ */ c("div", { style: { fontSize: 15, fontWeight: 600 }, children: i ?? a("security.session.title", "Active Sessions") }),
2575
- o && e.length > 1 && /* @__PURE__ */ c(
2599
+ /* @__PURE__ */ c("div", { style: { fontSize: 15, fontWeight: 600 }, children: s ?? i("security.session.title", "Active Sessions") }),
2600
+ a && e.length > 1 && /* @__PURE__ */ c(
2576
2601
  "button",
2577
2602
  {
2578
2603
  onClick: r,
@@ -2585,14 +2610,14 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2585
2610
  color: "var(--security-error)",
2586
2611
  cursor: "pointer"
2587
2612
  },
2588
- children: a("security.session.revokeAll", "Revoke all others")
2613
+ children: i("security.session.revokeAll", "Revoke all others")
2589
2614
  }
2590
2615
  )
2591
2616
  ]
2592
2617
  }
2593
2618
  ),
2594
2619
  /* @__PURE__ */ P("div", { children: [
2595
- f.map((y) => /* @__PURE__ */ P(
2620
+ f.map((g) => /* @__PURE__ */ P(
2596
2621
  "div",
2597
2622
  {
2598
2623
  style: {
@@ -2601,8 +2626,8 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2601
2626
  justifyContent: "space-between",
2602
2627
  padding: "12px 16px",
2603
2628
  borderBottom: "1px solid var(--security-border)",
2604
- opacity: g.has(y.id) ? 0.5 : 1,
2605
- background: y.current ? "color-mix(in srgb, var(--nice-color-primary, #3b82f6) 4%, transparent)" : void 0
2629
+ opacity: y.has(g.id) ? 0.5 : 1,
2630
+ background: g.current ? "color-mix(in srgb, var(--nice-color-primary, #3b82f6) 4%, transparent)" : void 0
2606
2631
  },
2607
2632
  children: [
2608
2633
  /* @__PURE__ */ P("div", { style: { display: "flex", gap: 12, alignItems: "center" }, children: [
@@ -2616,13 +2641,13 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2616
2641
  color: "var(--security-text-muted)",
2617
2642
  minWidth: 48
2618
2643
  },
2619
- children: y.device.toLowerCase().includes("mobile") ? a("security.session.mobile", "Mobile") : a("security.session.desktop", "Desktop")
2644
+ children: g.device.toLowerCase().includes("mobile") ? i("security.session.mobile", "Mobile") : i("security.session.desktop", "Desktop")
2620
2645
  }
2621
2646
  ),
2622
2647
  /* @__PURE__ */ P("div", { children: [
2623
2648
  /* @__PURE__ */ P("div", { style: { fontSize: 14, fontWeight: 500 }, children: [
2624
- y.device,
2625
- y.current && /* @__PURE__ */ c(
2649
+ g.device,
2650
+ g.current && /* @__PURE__ */ c(
2626
2651
  "span",
2627
2652
  {
2628
2653
  style: {
@@ -2633,10 +2658,10 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2633
2658
  color: "var(--nice-color-white, #fff)",
2634
2659
  borderRadius: 8
2635
2660
  },
2636
- children: a("security.session.current", "Current")
2661
+ children: i("security.session.current", "Current")
2637
2662
  }
2638
2663
  ),
2639
- y.trusted && /* @__PURE__ */ c(
2664
+ g.trusted && /* @__PURE__ */ c(
2640
2665
  "span",
2641
2666
  {
2642
2667
  style: {
@@ -2650,24 +2675,24 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2650
2675
  color: "var(--nice-success-text, #065f46)",
2651
2676
  borderRadius: 8
2652
2677
  },
2653
- children: a("security.session.trusted", "Trusted")
2678
+ children: i("security.session.trusted", "Trusted")
2654
2679
  }
2655
2680
  )
2656
2681
  ] }),
2657
- /* @__PURE__ */ c("div", { style: { fontSize: 12, color: "var(--security-text-muted)", marginTop: 2 }, children: [y.browser, y.os, y.location].filter(Boolean).join(" · ") }),
2682
+ /* @__PURE__ */ c("div", { style: { fontSize: 12, color: "var(--security-text-muted)", marginTop: 2 }, children: [g.browser, g.os, g.location].filter(Boolean).join(" · ") }),
2658
2683
  /* @__PURE__ */ P("div", { style: { fontSize: 11, color: "var(--security-text-muted)", marginTop: 1 }, children: [
2659
- a("security.session.lastActive", "Last active"),
2684
+ i("security.session.lastActive", "Last active"),
2660
2685
  ":",
2661
2686
  " ",
2662
- m(y.lastActive)
2687
+ x(g.lastActive)
2663
2688
  ] })
2664
2689
  ] })
2665
2690
  ] }),
2666
2691
  /* @__PURE__ */ P("div", { style: { display: "flex", gap: 6 }, children: [
2667
- n && !y.current && /* @__PURE__ */ c(
2692
+ n && !g.current && /* @__PURE__ */ c(
2668
2693
  "button",
2669
2694
  {
2670
- onClick: () => n(y.id, !y.trusted),
2695
+ onClick: () => n(g.id, !g.trusted),
2671
2696
  style: {
2672
2697
  fontSize: 11,
2673
2698
  padding: "4px 8px",
@@ -2677,14 +2702,14 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2677
2702
  cursor: "pointer",
2678
2703
  color: "var(--security-text-secondary)"
2679
2704
  },
2680
- children: y.trusted ? a("security.session.untrust", "Untrust") : a("security.session.trust", "Trust")
2705
+ children: g.trusted ? i("security.session.untrust", "Untrust") : i("security.session.trust", "Trust")
2681
2706
  }
2682
2707
  ),
2683
- !y.current && /* @__PURE__ */ c(
2708
+ !g.current && /* @__PURE__ */ c(
2684
2709
  "button",
2685
2710
  {
2686
- onClick: () => k(y.id),
2687
- disabled: g.has(y.id),
2711
+ onClick: () => A(g.id),
2712
+ disabled: y.has(g.id),
2688
2713
  style: {
2689
2714
  fontSize: 11,
2690
2715
  padding: "4px 10px",
@@ -2694,13 +2719,13 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2694
2719
  cursor: "pointer",
2695
2720
  color: "var(--security-error)"
2696
2721
  },
2697
- children: a("security.session.revoke", "Revoke")
2722
+ children: i("security.session.revoke", "Revoke")
2698
2723
  }
2699
2724
  )
2700
2725
  ] })
2701
2726
  ]
2702
2727
  },
2703
- y.id
2728
+ g.id
2704
2729
  )),
2705
2730
  e.length === 0 && /* @__PURE__ */ c(
2706
2731
  "div",
@@ -2711,98 +2736,103 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2711
2736
  color: "var(--security-text-muted)",
2712
2737
  fontSize: 13
2713
2738
  },
2714
- children: a("security.session.noSessions", "No active sessions")
2739
+ children: i("security.session.noSessions", "No active sessions")
2715
2740
  }
2716
2741
  )
2717
2742
  ] })
2718
2743
  ]
2719
2744
  }
2720
2745
  );
2721
- }, Ht = ({
2746
+ }, qt = ({
2722
2747
  trustScore: e,
2723
2748
  onScoreComputed: t,
2724
2749
  trustThreshold: r = 60,
2725
2750
  showFactors: n = !0,
2726
- showFingerprint: s = !1,
2727
- className: i,
2728
- label: o
2751
+ showFingerprint: o = !1,
2752
+ className: s,
2753
+ label: a
2729
2754
  }) => {
2730
- const { t: a } = te(), [g, v] = _(e ?? null), [f, m] = _(!e), k = G(async () => {
2731
- var D;
2732
- m(!0);
2755
+ const { t: i } = te(), [y, b] = j(e ?? null), [f, x] = j(!e), A = V(t);
2756
+ A.current = t;
2757
+ const g = K(async () => {
2758
+ var L, p;
2759
+ x(!0);
2733
2760
  try {
2734
- const M = De(), b = await de(), T = [];
2735
- let p = 50;
2736
- M.platform && !M.platform.includes("Linux") && (T.push({
2737
- name: "Known platform",
2761
+ const C = Ce(), S = await de(), v = [];
2762
+ let l = 50;
2763
+ C.platform && !C.platform.includes("Linux") && (v.push({
2764
+ name: i("security.trust.knownPlatform", "Known platform"),
2738
2765
  score: 5,
2739
- description: "Running on a recognized platform",
2766
+ description: i("security.trust.knownPlatformHint", "Running on a recognized platform"),
2740
2767
  weight: 0.05
2741
- }), p += 5), navigator.cookieEnabled && (T.push({
2742
- name: "Cookies enabled",
2768
+ }), l += 5), navigator.cookieEnabled && (v.push({
2769
+ name: i("security.trust.cookiesEnabled", "Cookies enabled"),
2743
2770
  score: 5,
2744
- description: "Browser cookies are enabled",
2771
+ description: i("security.trust.cookiesEnabledHint", "Browser cookies are enabled"),
2745
2772
  weight: 0.05
2746
- }), p += 5), M.screenResolution[0] >= 360 && M.screenResolution[1] >= 640 && (T.push({
2747
- name: "Standard resolution",
2773
+ }), l += 5), C.screenResolution[0] >= 360 && C.screenResolution[1] >= 640 && (v.push({
2774
+ name: i("security.trust.standardResolution", "Standard resolution"),
2748
2775
  score: 5,
2749
- description: "Screen resolution within normal range",
2776
+ description: i(
2777
+ "security.trust.standardResolutionHint",
2778
+ "Screen resolution within normal range"
2779
+ ),
2750
2780
  weight: 0.05
2751
- }), p += 5), typeof window < "u" && window.isSecureContext && (T.push({
2752
- name: "Secure context",
2781
+ }), l += 5), typeof window < "u" && window.isSecureContext && (v.push({
2782
+ name: i("security.trust.secureContext", "Secure context"),
2753
2783
  score: 10,
2754
- description: "Running in HTTPS secure context",
2784
+ description: i("security.trust.secureContextHint", "Running in HTTPS secure context"),
2755
2785
  weight: 0.1
2756
- }), p += 10), ((D = navigator.languages) == null ? void 0 : D.length) > 0 && (T.push({
2757
- name: "Language configured",
2786
+ }), l += 10), ((L = navigator.languages) == null ? void 0 : L.length) > 0 && (v.push({
2787
+ name: i("security.trust.languageConfigured", "Language configured"),
2758
2788
  score: 5,
2759
- description: "Browser language is set",
2789
+ description: i("security.trust.languageConfiguredHint", "Browser language is set"),
2760
2790
  weight: 0.05
2761
- }), p += 5), M.touchSupport && (T.push({
2762
- name: "Touch device",
2791
+ }), l += 5), C.touchSupport && (v.push({
2792
+ name: i("security.trust.touchDevice", "Touch device"),
2763
2793
  score: 5,
2764
- description: "Touch input is supported",
2794
+ description: i("security.trust.touchDeviceHint", "Touch input is supported"),
2765
2795
  weight: 0.05
2766
- }), p += 5);
2796
+ }), l += 5);
2767
2797
  try {
2768
- const l = document.createElement("canvas").getContext("webgl");
2769
- l && l.getExtension("WEBGL_debug_renderer_info") && (T.push({
2770
- name: "Hardware GPU",
2798
+ const R = document.createElement("canvas").getContext("webgl");
2799
+ R && R.getExtension("WEBGL_debug_renderer_info") && (v.push({
2800
+ name: i("security.trust.hardwareGpu", "Hardware GPU"),
2771
2801
  score: 10,
2772
- description: "Hardware GPU detected",
2802
+ description: i("security.trust.hardwareGpuHint", "Hardware GPU detected"),
2773
2803
  weight: 0.1
2774
- }), p += 10);
2804
+ }), l += 10);
2775
2805
  } catch {
2776
2806
  }
2777
- navigator.credentials && (T.push({
2778
- name: "Credential API",
2807
+ navigator.credentials && (v.push({
2808
+ name: i("security.trust.credentialApi", "Credential API"),
2779
2809
  score: 5,
2780
- description: "Credential Management API available",
2810
+ description: i("security.trust.credentialApiHint", "Credential Management API available"),
2781
2811
  weight: 0.05
2782
- }), p += 5), p = Math.min(100, Math.max(0, p));
2783
- const S = Date.now(), u = {
2784
- score: p,
2785
- factors: T,
2786
- trusted: p >= r,
2787
- firstSeen: S,
2788
- lastSeen: S,
2789
- fingerprint: b
2812
+ }), l += 5), l = Math.min(100, Math.max(0, l));
2813
+ const w = Date.now(), u = {
2814
+ score: l,
2815
+ factors: v,
2816
+ trusted: l >= r,
2817
+ firstSeen: w,
2818
+ lastSeen: w,
2819
+ fingerprint: S
2790
2820
  };
2791
- v(u), t == null || t(u);
2821
+ b(u), (p = A.current) == null || p.call(A, u);
2792
2822
  } finally {
2793
- m(!1);
2823
+ x(!1);
2794
2824
  }
2795
- }, [r, t]);
2825
+ }, [r, i]);
2796
2826
  ne(() => {
2797
- e || k();
2798
- }, [e, k]), ne(() => {
2799
- e && v(e);
2827
+ e || g();
2828
+ }, [e, g]), ne(() => {
2829
+ e && b(e);
2800
2830
  }, [e]);
2801
- const y = g ? g.score >= 80 ? "var(--security-success)" : g.score >= 50 ? "var(--security-warning)" : "var(--security-error)" : "var(--security-text-muted)";
2831
+ const I = y ? y.score >= 80 ? "var(--security-success)" : y.score >= 50 ? "var(--security-warning)" : "var(--security-error)" : "var(--security-text-muted)";
2802
2832
  return /* @__PURE__ */ P(
2803
2833
  "div",
2804
2834
  {
2805
- className: i,
2835
+ className: s,
2806
2836
  style: {
2807
2837
  fontFamily: "var(--security-font)",
2808
2838
  color: "var(--security-text)",
@@ -2816,8 +2846,8 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2816
2846
  alignItems: "center"
2817
2847
  },
2818
2848
  children: [
2819
- /* @__PURE__ */ c("div", { style: { fontSize: 15, fontWeight: 600 }, children: o ?? a("security.trust.title", "Device Trust") }),
2820
- f ? /* @__PURE__ */ c("div", { style: { fontSize: 13, color: "var(--security-text-muted)" }, children: a("security.trust.computing", "Analysing device…") }) : g ? /* @__PURE__ */ P(Pe, { children: [
2849
+ /* @__PURE__ */ c("div", { style: { fontSize: 15, fontWeight: 600 }, children: a ?? i("security.trust.title", "Device Trust") }),
2850
+ f ? /* @__PURE__ */ c("div", { style: { fontSize: 13, color: "var(--security-text-muted)" }, children: i("security.trust.computing", "Analysing device…") }) : y ? /* @__PURE__ */ P(Pe, { children: [
2821
2851
  /* @__PURE__ */ P("div", { style: { position: "relative", width: 100, height: 100 }, children: [
2822
2852
  /* @__PURE__ */ P(
2823
2853
  "svg",
@@ -2843,9 +2873,9 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2843
2873
  cy: "18",
2844
2874
  r: "15.9",
2845
2875
  fill: "none",
2846
- stroke: y,
2876
+ stroke: I,
2847
2877
  strokeWidth: "2.5",
2848
- strokeDasharray: `${g.score}, 100`,
2878
+ strokeDasharray: `${y.score}, 100`,
2849
2879
  strokeLinecap: "round"
2850
2880
  }
2851
2881
  )
@@ -2864,7 +2894,7 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2864
2894
  justifyContent: "center"
2865
2895
  },
2866
2896
  children: [
2867
- /* @__PURE__ */ c("span", { style: { fontSize: 24, fontWeight: 700, color: y }, children: g.score }),
2897
+ /* @__PURE__ */ c("span", { style: { fontSize: 24, fontWeight: 700, color: I }, children: y.score }),
2868
2898
  /* @__PURE__ */ c("span", { style: { fontSize: 10, color: "var(--security-text-muted)" }, children: "/100" })
2869
2899
  ]
2870
2900
  }
@@ -2876,12 +2906,12 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2876
2906
  style: {
2877
2907
  fontSize: 14,
2878
2908
  fontWeight: 600,
2879
- color: g.trusted ? "var(--security-success)" : "var(--security-warning)"
2909
+ color: y.trusted ? "var(--security-success)" : "var(--security-warning)"
2880
2910
  },
2881
- children: g.trusted ? a("security.trust.trusted", "Device Trusted") : a("security.trust.untrusted", "Low Trust Score")
2911
+ children: y.trusted ? i("security.trust.trusted", "Device Trusted") : i("security.trust.untrusted", "Low Trust Score")
2882
2912
  }
2883
2913
  ),
2884
- n && g.factors.length > 0 && /* @__PURE__ */ P("div", { style: { width: "100%", fontSize: 12 }, children: [
2914
+ n && y.factors.length > 0 && /* @__PURE__ */ P("div", { style: { width: "100%", fontSize: 12 }, children: [
2885
2915
  /* @__PURE__ */ P(
2886
2916
  "div",
2887
2917
  {
@@ -2891,14 +2921,14 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2891
2921
  color: "var(--security-text-secondary)"
2892
2922
  },
2893
2923
  children: [
2894
- a("security.trust.factors", "Contributing factors"),
2924
+ i("security.trust.factors", "Contributing factors"),
2895
2925
  ":"
2896
2926
  ]
2897
2927
  }
2898
2928
  ),
2899
- /* @__PURE__ */ c("ul", { style: { margin: 0, paddingLeft: 18, color: "var(--security-text-muted)" }, children: g.factors.map((D, M) => /* @__PURE__ */ c("li", { style: { marginBottom: 2 }, children: D.name }, M)) })
2929
+ /* @__PURE__ */ c("ul", { style: { margin: 0, paddingLeft: 18, color: "var(--security-text-muted)" }, children: y.factors.map((L, p) => /* @__PURE__ */ c("li", { style: { marginBottom: 2 }, children: L.name }, p)) })
2900
2930
  ] }),
2901
- s && g.fingerprint && /* @__PURE__ */ c(
2931
+ o && y.fingerprint && /* @__PURE__ */ c(
2902
2932
  "div",
2903
2933
  {
2904
2934
  style: {
@@ -2909,7 +2939,7 @@ const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
2909
2939
  maxWidth: 280,
2910
2940
  fontFamily: "monospace"
2911
2941
  },
2912
- children: g.fingerprint
2942
+ children: y.fingerprint
2913
2943
  }
2914
2944
  )
2915
2945
  ] }) : null
@@ -2929,56 +2959,61 @@ const At = ["Very weak", "Weak", "Fair", "Strong", "Very strong"], ke = [
2929
2959
  "var(--nice-warning, #eab308)",
2930
2960
  "var(--nice-success, #22c55e)",
2931
2961
  "var(--nice-success, #10b981)"
2932
- ], qt = ({
2962
+ ], Kt = ({
2933
2963
  mode: e = "verify",
2934
2964
  expectedHash: t,
2935
2965
  minStrength: r = 2,
2936
2966
  minLength: n = 8,
2937
- onComplete: s,
2938
- onVerify: i,
2939
- onStatusChange: o,
2940
- onError: a,
2941
- label: g,
2942
- placeholder: v,
2967
+ onComplete: o,
2968
+ onVerify: s,
2969
+ onStatusChange: a,
2970
+ onError: i,
2971
+ label: y,
2972
+ placeholder: b,
2943
2973
  className: f,
2944
- showStrength: m = !0,
2945
- maxAttempts: k = 5
2974
+ showStrength: x = !0,
2975
+ maxAttempts: A = 5
2946
2976
  }) => {
2947
- const { t: y } = te(), [D, M] = _(""), [b, T] = _(""), [p, S] = _(!1), [u, w] = _("idle"), [l, h] = _(0), [L, q] = _(""), Y = ee(null), B = kt(D), U = G(
2977
+ const { t: g } = te(), [I, L] = j(""), [p, C] = j(""), [S, v] = j(!1), [l, w] = j("idle"), [u, h] = j(0), [R, G] = j(""), J = V(null), W = kt(I), O = K(
2948
2978
  ($) => {
2949
- w($), o == null || o($);
2979
+ w($), a == null || a($);
2950
2980
  },
2951
- [o]
2952
- ), J = G(async () => {
2953
- if (q(""), U("processing"), e === "set") {
2954
- if (D.length < n) {
2955
- q(y("security.passphrase.tooShort", `Minimum ${n} characters`)), U("idle");
2981
+ [a]
2982
+ ), Y = K(async () => {
2983
+ if (G(""), O("processing"), e === "set") {
2984
+ if (I.length < n) {
2985
+ G(
2986
+ g("security.passphrase.tooShort", "Minimum {min} characters").replace(
2987
+ "{min}",
2988
+ String(n)
2989
+ )
2990
+ ), O("idle");
2956
2991
  return;
2957
2992
  }
2958
- if (B < r) {
2959
- q(y("security.passphrase.tooWeak", "Passphrase is too weak")), U("idle");
2993
+ if (W < r) {
2994
+ G(g("security.passphrase.tooWeak", "Passphrase is too weak")), O("idle");
2960
2995
  return;
2961
2996
  }
2962
- if (D !== b) {
2963
- q(y("security.passphrase.noMatch", "Passphrases do not match")), U("failure"), setTimeout(() => U("idle"), 1e3);
2997
+ if (I !== p) {
2998
+ G(g("security.passphrase.noMatch", "Passphrases do not match")), O("failure"), setTimeout(() => O("idle"), 1e3);
2964
2999
  return;
2965
3000
  }
2966
- s == null || s(D), U("success");
3001
+ o == null || o(I), O("success");
2967
3002
  return;
2968
3003
  }
2969
3004
  if (t) {
2970
- const $ = new TextEncoder(), j = await crypto.subtle.digest("SHA-256", $.encode(D));
2971
- if (Array.from(new Uint8Array(j)).map((O) => O.toString(16).padStart(2, "0")).join("") === t)
2972
- U("success"), i == null || i({
3005
+ const $ = new TextEncoder(), B = await crypto.subtle.digest("SHA-256", $.encode(I));
3006
+ if (Array.from(new Uint8Array(B)).map((H) => H.toString(16).padStart(2, "0")).join("") === t)
3007
+ O("success"), s == null || s({
2973
3008
  success: !0,
2974
3009
  confidence: 1,
2975
3010
  method: "passphrase",
2976
3011
  timestamp: Date.now(),
2977
3012
  duration: 0
2978
- }), s == null || s(D);
3013
+ }), o == null || o(I);
2979
3014
  else {
2980
- const O = l + 1;
2981
- h(O), O >= k ? (U("failure"), a == null || a(new Error("Too many failed attempts"))) : (q(y("security.passphrase.incorrect", "Incorrect passphrase")), U("idle")), i == null || i({
3015
+ const H = u + 1;
3016
+ h(H), H >= A ? (O("failure"), i == null || i(new Error("Too many failed attempts"))) : (G(g("security.passphrase.incorrect", "Incorrect passphrase")), O("idle")), s == null || s({
2982
3017
  success: !1,
2983
3018
  confidence: 0,
2984
3019
  method: "passphrase",
@@ -2987,29 +3022,29 @@ const At = ["Very weak", "Weak", "Fair", "Strong", "Very strong"], ke = [
2987
3022
  });
2988
3023
  }
2989
3024
  } else
2990
- s == null || s(D), U("success");
3025
+ o == null || o(I), O("success");
2991
3026
  }, [
2992
- D,
2993
- b,
3027
+ I,
3028
+ p,
2994
3029
  e,
2995
3030
  t,
2996
- B,
3031
+ W,
2997
3032
  r,
2998
3033
  n,
2999
- l,
3000
- k,
3001
- y,
3002
- U,
3034
+ u,
3035
+ A,
3036
+ g,
3037
+ O,
3038
+ o,
3003
3039
  s,
3004
- i,
3005
- a
3006
- ]), W = {
3040
+ i
3041
+ ]), _ = {
3007
3042
  width: "100%",
3008
3043
  padding: "10px 14px",
3009
3044
  fontSize: 14,
3010
3045
  background: "var(--security-bg)",
3011
3046
  color: "var(--security-text)",
3012
- border: `1px solid ${u === "failure" ? "var(--security-error)" : "var(--security-border)"}`,
3047
+ border: `1px solid ${l === "failure" ? "var(--security-error)" : "var(--security-border)"}`,
3013
3048
  borderRadius: "var(--security-radius)",
3014
3049
  boxSizing: "border-box",
3015
3050
  fontFamily: "var(--security-font)"
@@ -3027,26 +3062,26 @@ const At = ["Very weak", "Weak", "Fair", "Strong", "Very strong"], ke = [
3027
3062
  color: "var(--security-text)"
3028
3063
  },
3029
3064
  children: [
3030
- g && /* @__PURE__ */ c("label", { style: { fontSize: 14, fontWeight: 600 }, children: g }),
3065
+ y && /* @__PURE__ */ c("label", { style: { fontSize: 14, fontWeight: 600 }, children: y }),
3031
3066
  /* @__PURE__ */ P("div", { style: { position: "relative" }, children: [
3032
3067
  /* @__PURE__ */ c(
3033
3068
  "input",
3034
3069
  {
3035
- ref: Y,
3036
- type: p ? "text" : "password",
3037
- value: D,
3038
- onChange: ($) => M($.target.value),
3039
- placeholder: v ?? y("security.passphrase.placeholder", "Enter passphrase"),
3040
- style: W,
3041
- disabled: u === "success",
3042
- onKeyDown: ($) => $.key === "Enter" && J()
3070
+ ref: J,
3071
+ type: S ? "text" : "password",
3072
+ value: I,
3073
+ onChange: ($) => L($.target.value),
3074
+ placeholder: b ?? g("security.passphrase.placeholder", "Enter passphrase"),
3075
+ style: _,
3076
+ disabled: l === "success",
3077
+ onKeyDown: ($) => $.key === "Enter" && Y()
3043
3078
  }
3044
3079
  ),
3045
3080
  /* @__PURE__ */ c(
3046
3081
  "button",
3047
3082
  {
3048
3083
  type: "button",
3049
- onClick: () => S(!p),
3084
+ onClick: () => v(!S),
3050
3085
  style: {
3051
3086
  position: "absolute",
3052
3087
  right: 8,
@@ -3059,64 +3094,64 @@ const At = ["Very weak", "Weak", "Fair", "Strong", "Very strong"], ke = [
3059
3094
  color: "var(--security-text-muted)"
3060
3095
  },
3061
3096
  tabIndex: -1,
3062
- children: p ? y("security.passphrase.hide", "Hide") : y("security.passphrase.show", "Show")
3097
+ children: S ? g("security.passphrase.hide", "Hide") : g("security.passphrase.show", "Show")
3063
3098
  }
3064
3099
  )
3065
3100
  ] }),
3066
- e === "set" && m && D.length > 0 && /* @__PURE__ */ P("div", { children: [
3101
+ e === "set" && x && I.length > 0 && /* @__PURE__ */ P("div", { children: [
3067
3102
  /* @__PURE__ */ c("div", { style: { display: "flex", gap: 3, height: 4 }, children: [0, 1, 2, 3].map(($) => /* @__PURE__ */ c(
3068
3103
  "div",
3069
3104
  {
3070
3105
  style: {
3071
3106
  flex: 1,
3072
3107
  borderRadius: 2,
3073
- background: $ < B ? ke[B] : "var(--security-border)",
3108
+ background: $ < W ? ke[W] : "var(--security-border)",
3074
3109
  transition: "background 0.2s"
3075
3110
  }
3076
3111
  },
3077
3112
  $
3078
3113
  )) }),
3079
- /* @__PURE__ */ c("div", { style: { fontSize: 11, marginTop: 4, color: ke[B] }, children: y(`security.passphrase.strength${B}`, At[B]) })
3114
+ /* @__PURE__ */ c("div", { style: { fontSize: 11, marginTop: 4, color: ke[W] }, children: g(`security.passphrase.strength${W}`, At[W]) })
3080
3115
  ] }),
3081
3116
  e === "set" && /* @__PURE__ */ c(
3082
3117
  "input",
3083
3118
  {
3084
- type: p ? "text" : "password",
3085
- value: b,
3086
- onChange: ($) => T($.target.value),
3087
- placeholder: y("security.passphrase.confirmPlaceholder", "Confirm passphrase"),
3088
- style: W,
3089
- disabled: u === "success",
3090
- onKeyDown: ($) => $.key === "Enter" && J(),
3119
+ type: S ? "text" : "password",
3120
+ value: p,
3121
+ onChange: ($) => C($.target.value),
3122
+ placeholder: g("security.passphrase.confirmPlaceholder", "Confirm passphrase"),
3123
+ style: _,
3124
+ disabled: l === "success",
3125
+ onKeyDown: ($) => $.key === "Enter" && Y(),
3091
3126
  onPaste: ($) => $.preventDefault()
3092
3127
  }
3093
3128
  ),
3094
- L && /* @__PURE__ */ c("div", { style: { fontSize: 12, color: "var(--security-error)" }, children: L }),
3129
+ R && /* @__PURE__ */ c("div", { style: { fontSize: 12, color: "var(--security-error)" }, children: R }),
3095
3130
  /* @__PURE__ */ c(
3096
3131
  "button",
3097
3132
  {
3098
- onClick: J,
3099
- disabled: !D || u === "processing" || u === "success",
3133
+ onClick: Y,
3134
+ disabled: !I || l === "processing" || l === "success",
3100
3135
  style: {
3101
3136
  padding: "10px 20px",
3102
3137
  fontSize: 14,
3103
3138
  fontWeight: 600,
3104
- background: u === "success" ? "var(--security-success)" : "var(--security-biometric)",
3139
+ background: l === "success" ? "var(--security-success)" : "var(--security-biometric)",
3105
3140
  color: "var(--nice-color-white, #fff)",
3106
3141
  border: "none",
3107
3142
  borderRadius: "var(--security-radius)",
3108
- cursor: u === "success" ? "default" : "pointer",
3109
- opacity: !D || u === "processing" ? 0.6 : 1
3143
+ cursor: l === "success" ? "default" : "pointer",
3144
+ opacity: !I || l === "processing" ? 0.6 : 1
3110
3145
  },
3111
- children: u === "success" ? y("security.passphrase.accepted", "Accepted") : e === "set" ? y("security.passphrase.setBtn", "Set Passphrase") : y("security.passphrase.verifyBtn", "Verify")
3146
+ children: l === "success" ? g("security.passphrase.accepted", "Accepted") : e === "set" ? g("security.passphrase.setBtn", "Set Passphrase") : g("security.passphrase.verifyBtn", "Verify")
3112
3147
  }
3113
3148
  ),
3114
- l > 0 && u !== "success" && /* @__PURE__ */ c("div", { style: { fontSize: 11, color: "var(--security-warning)" }, children: y("security.passphrase.attempts", `${l}/${k} attempts`) })
3149
+ u > 0 && l !== "success" && /* @__PURE__ */ c("div", { style: { fontSize: 11, color: "var(--security-warning)" }, children: g("security.passphrase.attempts", "{attempts}/{max} attempts").replace("{attempts}", String(u)).replace("{max}", String(A)) })
3115
3150
  ]
3116
3151
  }
3117
3152
  );
3118
3153
  };
3119
- function Kt(e) {
3154
+ function Gt(e) {
3120
3155
  const t = [], r = {
3121
3156
  defaultSrc: "default-src",
3122
3157
  scriptSrc: "script-src",
@@ -3137,21 +3172,21 @@ function Kt(e) {
3137
3172
  upgradeInsecureRequests: "upgrade-insecure-requests",
3138
3173
  blockAllMixedContent: "block-all-mixed-content"
3139
3174
  };
3140
- return Object.entries(e.directives).forEach(([n, s]) => {
3141
- const i = r[n];
3142
- if (i) {
3143
- if (typeof s == "boolean")
3144
- s && t.push(i);
3145
- else if (typeof s == "string")
3146
- t.push(`${i} ${s}`);
3147
- else if (Array.isArray(s)) {
3148
- let o = s;
3149
- e.nonce && (n === "scriptSrc" || n === "styleSrc") && (o = [...o, `'nonce-${e.nonce}'`]), t.push(`${i} ${o.join(" ")}`);
3175
+ return Object.entries(e.directives).forEach(([n, o]) => {
3176
+ const s = r[n];
3177
+ if (s) {
3178
+ if (typeof o == "boolean")
3179
+ o && t.push(s);
3180
+ else if (typeof o == "string")
3181
+ t.push(`${s} ${o}`);
3182
+ else if (Array.isArray(o)) {
3183
+ let a = o;
3184
+ e.nonce && (n === "scriptSrc" || n === "styleSrc") && (a = [...a, `'nonce-${e.nonce}'`]), t.push(`${s} ${a.join(" ")}`);
3150
3185
  }
3151
3186
  }
3152
3187
  }), t.join("; ");
3153
3188
  }
3154
- function Gt(e) {
3189
+ function Jt(e) {
3155
3190
  const t = "'self'";
3156
3191
  return {
3157
3192
  defaultSrc: [t],
@@ -3170,7 +3205,7 @@ function Gt(e) {
3170
3205
  reportUri: e == null ? void 0 : e.reportUri
3171
3206
  };
3172
3207
  }
3173
- function Jt() {
3208
+ function Yt() {
3174
3209
  return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID().replace(/-/g, "") : Math.random().toString(36).substring(2) + Date.now().toString(36);
3175
3210
  }
3176
3211
  const Tt = {
@@ -3186,11 +3221,11 @@ const Tt = {
3186
3221
  function It(e) {
3187
3222
  return e.replace(/[&<>"'`=/]/g, (t) => Tt[t] || t);
3188
3223
  }
3189
- function Yt(e, t) {
3224
+ function Zt(e, t) {
3190
3225
  let r = It(e);
3191
3226
  return t != null && t.maxLength && r.length > t.maxLength && (r = r.substring(0, t.maxLength)), r;
3192
3227
  }
3193
- function Zt(e) {
3228
+ function Xt(e) {
3194
3229
  if (!e)
3195
3230
  return null;
3196
3231
  try {
@@ -3200,25 +3235,25 @@ function Zt(e) {
3200
3235
  return null;
3201
3236
  }
3202
3237
  }
3203
- function Xt(e) {
3238
+ function Qt(e) {
3204
3239
  const t = ["script", "iframe", "object", "embed", "form"];
3205
3240
  let r = e;
3206
- t.forEach((i) => {
3207
- const o = new RegExp(`<${i}[^>]*>.*?</${i}>`, "gi");
3208
- r = r.replace(o, "");
3209
- const a = new RegExp(`<${i}[^>]*/>`, "gi");
3241
+ t.forEach((s) => {
3242
+ const a = new RegExp(`<${s}[^>]*>.*?</${s}>`, "gi");
3210
3243
  r = r.replace(a, "");
3244
+ const i = new RegExp(`<${s}[^>]*/>`, "gi");
3245
+ r = r.replace(i, "");
3211
3246
  });
3212
3247
  const n = /\s+on\w+\s*=/gi;
3213
3248
  r = r.replace(n, " data-removed=");
3214
- const s = /javascript:/gi;
3215
- return r = r.replace(s, ""), r;
3249
+ const o = /javascript:/gi;
3250
+ return r = r.replace(o, ""), r;
3216
3251
  }
3217
- function Qt(e, t) {
3252
+ function Vt(e, t) {
3218
3253
  let r = e;
3219
3254
  if (t != null && t.allowedTags) {
3220
3255
  const n = /<\/?([a-z][a-z0-9]*)[^>]*>/gi;
3221
- r = r.replace(n, (s, i) => t.allowedTags.includes(i.toLowerCase()) ? s : "");
3256
+ r = r.replace(n, (o, s) => t.allowedTags.includes(s.toLowerCase()) ? o : "");
3222
3257
  }
3223
3258
  return r = r.replace(/\s+on\w+\s*=/gi, " data-removed="), r = r.replace(/javascript:/gi, ""), { __html: r };
3224
3259
  }
@@ -3227,29 +3262,29 @@ const me = {
3227
3262
  cookieName: "XSRF-TOKEN",
3228
3263
  fieldName: "_csrf"
3229
3264
  };
3230
- function Vt() {
3265
+ function er() {
3231
3266
  if (typeof crypto < "u") {
3232
3267
  const e = new Uint8Array(32);
3233
3268
  return crypto.getRandomValues(e), Array.from(e, (t) => t.toString(16).padStart(2, "0")).join("");
3234
3269
  }
3235
3270
  return Math.random().toString(36).substring(2) + Date.now().toString(36);
3236
3271
  }
3237
- function Re(e = me.cookieName) {
3272
+ function Me(e = me.cookieName) {
3238
3273
  if (typeof document > "u")
3239
3274
  return null;
3240
3275
  const t = document.cookie.match(new RegExp(`(^| )${e}=([^;]+)`));
3241
3276
  return t ? decodeURIComponent(t[2]) : null;
3242
3277
  }
3243
- function er(e = me) {
3278
+ function tr(e = me) {
3244
3279
  return async function(r, n = {}) {
3245
- const s = Re(e.cookieName);
3246
- s || console.warn("CSRF token not found");
3247
- const i = new Headers(n.headers);
3248
- return s && e.headerName && i.set(e.headerName, s), fetch(r, { ...n, headers: i });
3280
+ const o = Me(e.cookieName);
3281
+ o || console.warn("CSRF token not found");
3282
+ const s = new Headers(n.headers);
3283
+ return o && e.headerName && s.set(e.headerName, o), fetch(r, { ...n, headers: s });
3249
3284
  };
3250
3285
  }
3251
- function tr(e = me) {
3252
- const t = Re(e.cookieName);
3286
+ function rr(e = me) {
3287
+ const t = Me(e.cookieName);
3253
3288
  return {
3254
3289
  token: t,
3255
3290
  inputProps: {
@@ -3260,46 +3295,46 @@ function tr(e = me) {
3260
3295
  headerName: e.headerName
3261
3296
  };
3262
3297
  }
3263
- function Dt(e) {
3264
- const t = /* @__PURE__ */ new Map(), r = e.keyGenerator || ((i) => i.url);
3265
- function n(i) {
3266
- const o = r(i), a = Date.now();
3267
- let g = t.get(o);
3268
- (!g || a > g.resetAt) && (g = {
3298
+ function Ct(e) {
3299
+ const t = /* @__PURE__ */ new Map(), r = e.keyGenerator || ((s) => s.url);
3300
+ function n(s) {
3301
+ const a = r(s), i = Date.now();
3302
+ let y = t.get(a);
3303
+ (!y || i > y.resetAt) && (y = {
3269
3304
  count: 0,
3270
- resetAt: a + e.windowMs
3271
- }), g.count++, t.set(o, g);
3272
- const v = g.count <= e.maxRequests, f = Math.max(0, e.maxRequests - g.count);
3273
- return { allowed: v, remaining: f, resetAt: g.resetAt };
3305
+ resetAt: i + e.windowMs
3306
+ }), y.count++, t.set(a, y);
3307
+ const b = y.count <= e.maxRequests, f = Math.max(0, e.maxRequests - y.count);
3308
+ return { allowed: b, remaining: f, resetAt: y.resetAt };
3274
3309
  }
3275
- function s(i) {
3276
- i ? t.delete(i) : t.clear();
3310
+ function o(s) {
3311
+ s ? t.delete(s) : t.clear();
3277
3312
  }
3278
- return { checkLimit: n, reset: s };
3279
- }
3280
- function rr(e) {
3281
- const t = Dt(e);
3282
- return { checkAndFetch: async (n, s) => {
3283
- const i = t.checkLimit({ url: n, method: s == null ? void 0 : s.method });
3284
- if (!i.allowed) {
3285
- const o = Math.ceil((i.resetAt - Date.now()) / 1e3);
3286
- throw new Error(`Rate limit exceeded. Retry after ${o} seconds.`);
3313
+ return { checkLimit: n, reset: o };
3314
+ }
3315
+ function nr(e) {
3316
+ const t = Ct(e);
3317
+ return { checkAndFetch: async (n, o) => {
3318
+ const s = t.checkLimit({ url: n, method: o == null ? void 0 : o.method });
3319
+ if (!s.allowed) {
3320
+ const a = Math.ceil((s.resetAt - Date.now()) / 1e3);
3321
+ throw new Error(`Rate limit exceeded. Retry after ${a} seconds.`);
3287
3322
  }
3288
- return fetch(n, s);
3323
+ return fetch(n, o);
3289
3324
  }, checkLimit: t.checkLimit, reset: t.reset };
3290
3325
  }
3291
- function Ct(e, t) {
3326
+ function Dt(e, t) {
3292
3327
  const r = [];
3293
3328
  if (t.allowedTypes && t.allowedTypes.length > 0 && (t.allowedTypes.includes(e.type) || r.push(
3294
3329
  `File type '${e.type}' is not allowed. Allowed types: ${t.allowedTypes.join(", ")}`
3295
3330
  )), t.maxSize && e.size > t.maxSize) {
3296
- const i = (t.maxSize / 1048576).toFixed(2), o = (e.size / (1024 * 1024)).toFixed(2);
3297
- r.push(`File size (${o}MB) exceeds maximum allowed size (${i}MB)`);
3331
+ const s = (t.maxSize / 1048576).toFixed(2), a = (e.size / (1024 * 1024)).toFixed(2);
3332
+ r.push(`File size (${a}MB) exceeds maximum allowed size (${s}MB)`);
3298
3333
  }
3299
- const n = [".exe", ".bat", ".cmd", ".sh", ".ps1", ".vbs", ".js", ".jar"], s = e.name.toLowerCase();
3300
- for (const i of n)
3301
- if (s.includes(i + ".") || s.endsWith(i)) {
3302
- r.push(`File extension '${i}' is not allowed`);
3334
+ const n = [".exe", ".bat", ".cmd", ".sh", ".ps1", ".vbs", ".js", ".jar"], o = e.name.toLowerCase();
3335
+ for (const s of n)
3336
+ if (o.includes(s + ".") || o.endsWith(s)) {
3337
+ r.push(`File extension '${s}' is not allowed`);
3303
3338
  break;
3304
3339
  }
3305
3340
  return {
@@ -3308,25 +3343,25 @@ function Ct(e, t) {
3308
3343
  file: r.length === 0 ? e : void 0
3309
3344
  };
3310
3345
  }
3311
- function nr(e, t) {
3312
- const r = [], n = [], s = [];
3346
+ function ir(e, t) {
3347
+ const r = [], n = [], o = [];
3313
3348
  t.maxFiles && e.length > t.maxFiles && r.push(`Too many files. Maximum allowed: ${t.maxFiles}`);
3314
- const i = e.reduce((o, a) => o + a.size, 0);
3315
- if (t.maxTotalSize && i > t.maxTotalSize) {
3316
- const o = (t.maxTotalSize / 1048576).toFixed(2), a = (i / (1024 * 1024)).toFixed(2);
3317
- r.push(`Total file size (${a}MB) exceeds maximum (${o}MB)`);
3349
+ const s = e.reduce((a, i) => a + i.size, 0);
3350
+ if (t.maxTotalSize && s > t.maxTotalSize) {
3351
+ const a = (t.maxTotalSize / 1048576).toFixed(2), i = (s / (1024 * 1024)).toFixed(2);
3352
+ r.push(`Total file size (${i}MB) exceeds maximum (${a}MB)`);
3318
3353
  }
3319
- return e.forEach((o) => {
3320
- const a = Ct(o, t);
3321
- a.valid ? n.push(o) : s.push({ file: o, errors: a.errors });
3354
+ return e.forEach((a) => {
3355
+ const i = Dt(a, t);
3356
+ i.valid ? n.push(a) : o.push({ file: a, errors: i.errors });
3322
3357
  }), {
3323
- valid: r.length === 0 && s.length === 0,
3324
- errors: [...r, ...s.flatMap((o) => o.errors)],
3358
+ valid: r.length === 0 && o.length === 0,
3359
+ errors: [...r, ...o.flatMap((a) => a.errors)],
3325
3360
  validFiles: n,
3326
- invalidFiles: s
3361
+ invalidFiles: o
3327
3362
  };
3328
3363
  }
3329
- async function ir(e, t) {
3364
+ async function sr(e, t) {
3330
3365
  const r = new FormData();
3331
3366
  r.append("file", e);
3332
3367
  try {
@@ -3341,7 +3376,7 @@ async function ir(e, t) {
3341
3376
  return console.error("Virus scan error:", n), { clean: !1, threat: "Scan failed" };
3342
3377
  }
3343
3378
  }
3344
- function Mt() {
3379
+ function Rt() {
3345
3380
  if (typeof localStorage > "u")
3346
3381
  return null;
3347
3382
  const e = localStorage.getItem("nice2dev_consent");
@@ -3353,7 +3388,7 @@ function Mt() {
3353
3388
  return null;
3354
3389
  }
3355
3390
  }
3356
- function sr(e) {
3391
+ function or(e) {
3357
3392
  typeof localStorage > "u" || localStorage.setItem(
3358
3393
  "nice2dev_consent",
3359
3394
  JSON.stringify({
@@ -3364,11 +3399,11 @@ function sr(e) {
3364
3399
  })
3365
3400
  );
3366
3401
  }
3367
- function or(e) {
3368
- const t = Mt();
3402
+ function ar(e) {
3403
+ const t = Rt();
3369
3404
  return t ? t[e] === !0 : !1;
3370
3405
  }
3371
- function ar(e) {
3406
+ function cr(e) {
3372
3407
  if (typeof document > "u")
3373
3408
  return;
3374
3409
  document.cookie.split(";").forEach((r) => {
@@ -3376,23 +3411,23 @@ function ar(e) {
3376
3411
  e.includes(n) || (document.cookie = `${n}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`);
3377
3412
  });
3378
3413
  }
3379
- async function cr(e, t, r = fetch) {
3414
+ async function lr(e, t, r = fetch) {
3380
3415
  const n = {
3381
3416
  exportDate: (/* @__PURE__ */ new Date()).toISOString(),
3382
3417
  userId: e
3383
3418
  };
3384
3419
  return await Promise.all(
3385
- Object.entries(t).map(async ([s, i]) => {
3420
+ Object.entries(t).map(async ([o, s]) => {
3386
3421
  try {
3387
- const o = await r(i);
3388
- o.ok && (n[s] = await o.json());
3389
- } catch (o) {
3390
- console.error(`Failed to fetch ${s} data:`, o), n[s] = { error: "Failed to retrieve data" };
3422
+ const a = await r(s);
3423
+ a.ok && (n[o] = await a.json());
3424
+ } catch (a) {
3425
+ console.error(`Failed to fetch ${o} data:`, a), n[o] = { error: "Failed to retrieve data" };
3391
3426
  }
3392
3427
  })
3393
3428
  ), n;
3394
3429
  }
3395
- async function lr(e, t, r = fetch) {
3430
+ async function ur(e, t, r = fetch) {
3396
3431
  try {
3397
3432
  const n = await r(t, {
3398
3433
  method: "DELETE",
@@ -3404,7 +3439,7 @@ async function lr(e, t, r = fetch) {
3404
3439
  return { success: !1, error: String(n) };
3405
3440
  }
3406
3441
  }
3407
- function ur(e, t) {
3442
+ function dr(e, t) {
3408
3443
  var n;
3409
3444
  const r = {
3410
3445
  ...e,
@@ -3417,119 +3452,119 @@ function ur(e, t) {
3417
3452
  body: JSON.stringify(r)
3418
3453
  }).catch(console.error), process.env.NODE_ENV === "development" && console.warn("[HIPAA] PHI Access:", r), r;
3419
3454
  }
3420
- function dr(e) {
3455
+ function hr(e) {
3421
3456
  let t = null, r = null, n = Date.now();
3422
- const s = e.timeoutMinutes * 60 * 1e3, i = e.warningBeforeMs || 6e4;
3423
- function o() {
3457
+ const o = e.timeoutMinutes * 60 * 1e3, s = e.warningBeforeMs || 6e4;
3458
+ function a() {
3424
3459
  n = Date.now(), t && clearTimeout(t), r && clearTimeout(r), e.onWarning && (r = setTimeout(() => {
3425
3460
  var f;
3426
- const v = s - (Date.now() - n);
3427
- (f = e.onWarning) == null || f.call(e, v);
3428
- }, s - i)), t = setTimeout(e.onTimeout, s);
3461
+ const b = o - (Date.now() - n);
3462
+ (f = e.onWarning) == null || f.call(e, b);
3463
+ }, o - s)), t = setTimeout(e.onTimeout, o);
3429
3464
  }
3430
- function a() {
3465
+ function i() {
3431
3466
  t && clearTimeout(t), r && clearTimeout(r);
3432
3467
  }
3433
- function g() {
3434
- return Math.max(0, s - (Date.now() - n));
3468
+ function y() {
3469
+ return Math.max(0, o - (Date.now() - n));
3435
3470
  }
3436
- return o(), typeof window < "u" && ["mousedown", "keypress", "touchstart", "scroll"].forEach((f) => {
3437
- window.addEventListener(f, o, { passive: !0 });
3438
- }), { resetTimer: o, destroy: a, getTimeRemaining: g };
3439
- }
3440
- function hr(e, t) {
3441
- const r = (o) => {
3442
- const a = o.replace("#", ""), g = parseInt(a.substr(0, 2), 16) / 255, v = parseInt(a.substr(2, 2), 16) / 255, f = parseInt(a.substr(4, 2), 16) / 255, m = (k) => k <= 0.03928 ? k / 12.92 : Math.pow((k + 0.055) / 1.055, 2.4);
3443
- return 0.2126 * m(g) + 0.7152 * m(v) + 0.0722 * m(f);
3444
- }, n = r(e), s = r(t), i = (Math.max(n, s) + 0.05) / (Math.min(n, s) + 0.05);
3471
+ return a(), typeof window < "u" && ["mousedown", "keypress", "touchstart", "scroll"].forEach((f) => {
3472
+ window.addEventListener(f, a, { passive: !0 });
3473
+ }), { resetTimer: a, destroy: i, getTimeRemaining: y };
3474
+ }
3475
+ function fr(e, t) {
3476
+ const r = (a) => {
3477
+ const i = a.replace("#", ""), y = parseInt(i.substr(0, 2), 16) / 255, b = parseInt(i.substr(2, 2), 16) / 255, f = parseInt(i.substr(4, 2), 16) / 255, x = (A) => A <= 0.03928 ? A / 12.92 : Math.pow((A + 0.055) / 1.055, 2.4);
3478
+ return 0.2126 * x(y) + 0.7152 * x(b) + 0.0722 * x(f);
3479
+ }, n = r(e), o = r(t), s = (Math.max(n, o) + 0.05) / (Math.min(n, o) + 0.05);
3445
3480
  return {
3446
- ratio: Math.round(i * 100) / 100,
3447
- passesAA: i >= 4.5,
3481
+ ratio: Math.round(s * 100) / 100,
3482
+ passesAA: s >= 4.5,
3448
3483
  // Normal text
3449
- passesAAA: i >= 7,
3484
+ passesAAA: s >= 7,
3450
3485
  // Normal text enhanced
3451
- passesAALarge: i >= 3,
3486
+ passesAALarge: s >= 3,
3452
3487
  // Large text (18pt+ or 14pt bold)
3453
- passesAAALarge: i >= 4.5
3488
+ passesAAALarge: s >= 4.5
3454
3489
  // Large text enhanced
3455
3490
  };
3456
3491
  }
3457
- function fr(e) {
3458
- var r, n, s;
3492
+ function yr(e) {
3493
+ var r, n, o;
3459
3494
  if (e.getAttribute("aria-label"))
3460
3495
  return !0;
3461
3496
  const t = e.getAttribute("aria-labelledby");
3462
3497
  if (t) {
3463
- const i = document.getElementById(t);
3464
- if ((r = i == null ? void 0 : i.textContent) != null && r.trim())
3498
+ const s = document.getElementById(t);
3499
+ if ((r = s == null ? void 0 : s.textContent) != null && r.trim())
3465
3500
  return !0;
3466
3501
  }
3467
3502
  if (e.id) {
3468
- const i = document.querySelector(`label[for="${e.id}"]`);
3469
- if ((n = i == null ? void 0 : i.textContent) != null && n.trim())
3503
+ const s = document.querySelector(`label[for="${e.id}"]`);
3504
+ if ((n = s == null ? void 0 : s.textContent) != null && n.trim())
3470
3505
  return !0;
3471
3506
  }
3472
- return !!((s = e.textContent) != null && s.trim() || e.getAttribute("title") || e.placeholder);
3507
+ return !!((o = e.textContent) != null && o.trim() || e.getAttribute("title") || e.placeholder);
3473
3508
  }
3474
- function yr(e) {
3509
+ function pr(e) {
3475
3510
  const r = (e || document.body).querySelectorAll("h1, h2, h3, h4, h5, h6"), n = [];
3476
- let s = 0, i = !1;
3477
- return r.forEach((o) => {
3478
- const a = parseInt(o.tagName[1]);
3479
- a === 1 && (i && n.push({
3480
- level: a,
3481
- element: o,
3511
+ let o = 0, s = !1;
3512
+ return r.forEach((a) => {
3513
+ const i = parseInt(a.tagName[1]);
3514
+ i === 1 && (s && n.push({
3515
+ level: i,
3516
+ element: a,
3482
3517
  issue: "Multiple H1 elements found"
3483
- }), i = !0), a > s + 1 && s !== 0 && n.push({
3484
- level: a,
3485
- element: o,
3486
- issue: `Skipped heading level: H${s} to H${a}`
3487
- }), s = a;
3488
- }), !i && r.length > 0 && n.push({
3518
+ }), s = !0), i > o + 1 && o !== 0 && n.push({
3519
+ level: i,
3520
+ element: a,
3521
+ issue: `Skipped heading level: H${o} to H${i}`
3522
+ }), o = i;
3523
+ }), !s && r.length > 0 && n.push({
3489
3524
  level: 0,
3490
3525
  element: r[0],
3491
3526
  issue: "Missing H1 element"
3492
3527
  }), { valid: n.length === 0, issues: n };
3493
3528
  }
3494
- function pr(e) {
3529
+ function gr(e) {
3495
3530
  const t = [];
3496
3531
  let r = null;
3497
- const n = e.batchSize || 10, s = e.flushInterval || 5e3;
3498
- async function i() {
3532
+ const n = e.batchSize || 10, o = e.flushInterval || 5e3;
3533
+ async function s() {
3499
3534
  if (t.length === 0)
3500
3535
  return;
3501
- const v = t.splice(0, n);
3536
+ const b = t.splice(0, n);
3502
3537
  try {
3503
3538
  await fetch(e.endpoint, {
3504
3539
  method: "POST",
3505
3540
  headers: { "Content-Type": "application/json" },
3506
- body: JSON.stringify({ entries: v })
3541
+ body: JSON.stringify({ entries: b })
3507
3542
  });
3508
3543
  } catch (f) {
3509
- console.error("Failed to send audit logs:", f), t.unshift(...v);
3544
+ console.error("Failed to send audit logs:", f), t.unshift(...b);
3510
3545
  }
3511
3546
  }
3512
- function o() {
3547
+ function a() {
3513
3548
  r || (r = setTimeout(() => {
3514
- r = null, i();
3515
- }, s));
3549
+ r = null, s();
3550
+ }, o));
3516
3551
  }
3517
- function a(v) {
3518
- var m;
3552
+ function i(b) {
3553
+ var x;
3519
3554
  const f = {
3520
- ...v,
3521
- id: ((m = crypto.randomUUID) == null ? void 0 : m.call(crypto)) || Math.random().toString(36),
3555
+ ...b,
3556
+ id: ((x = crypto.randomUUID) == null ? void 0 : x.call(crypto)) || Math.random().toString(36),
3522
3557
  timestamp: /* @__PURE__ */ new Date(),
3523
3558
  userAgent: e.includeUserAgent && typeof navigator < "u" ? navigator.userAgent : void 0
3524
3559
  };
3525
- t.push(f), t.length >= n ? i() : o();
3560
+ t.push(f), t.length >= n ? s() : a();
3526
3561
  }
3527
- function g() {
3528
- r && clearTimeout(r), i();
3562
+ function y() {
3563
+ r && clearTimeout(r), s();
3529
3564
  }
3530
- return { log: a, flush: i, destroy: g };
3565
+ return { log: i, flush: s, destroy: y };
3531
3566
  }
3532
- function gr() {
3567
+ function mr() {
3533
3568
  return [
3534
3569
  // Security
3535
3570
  {
@@ -3607,7 +3642,7 @@ function gr() {
3607
3642
  }
3608
3643
  ];
3609
3644
  }
3610
- const mr = {
3645
+ const vr = {
3611
3646
  // Hardcoded secrets
3612
3647
  hardcodedSecrets: [
3613
3648
  { pattern: /password\s*[:=]\s*["'][^"']+["']/gi, name: "Hardcoded password" },
@@ -3644,7 +3679,7 @@ const mr = {
3644
3679
  { pattern: /TODO.*password/gi, name: "TODO mentioning password" }
3645
3680
  ]
3646
3681
  };
3647
- function vr() {
3682
+ function br() {
3648
3683
  return `# .github/workflows/sast.yml
3649
3684
  name: Security Scan (SAST)
3650
3685
 
@@ -3695,7 +3730,7 @@ jobs:
3695
3730
  uses: github/codeql-action/analyze@v3
3696
3731
  `;
3697
3732
  }
3698
- function br() {
3733
+ function xr() {
3699
3734
  return `# .github/workflows/sca.yml
3700
3735
  name: Dependency Security (SCA)
3701
3736
 
@@ -3761,7 +3796,7 @@ jobs:
3761
3796
  args: --severity-threshold=high
3762
3797
  `;
3763
3798
  }
3764
- const xr = [
3799
+ const wr = [
3765
3800
  // API Keys
3766
3801
  { name: "AWS Access Key ID", pattern: /AKIA[0-9A-Z]{16}/g, severity: "critical" },
3767
3802
  { name: "AWS Secret Access Key", pattern: /[A-Za-z0-9/+=]{40}/g, severity: "critical" },
@@ -3792,7 +3827,7 @@ const xr = [
3792
3827
  { name: "Bearer Token", pattern: /bearer [a-zA-Z0-9_\-.=]+/gi, severity: "high" },
3793
3828
  { name: "Connection String", pattern: /[a-z]+:\/\/[^:]+:[^@]+@[^/]+/gi, severity: "critical" }
3794
3829
  ];
3795
- function wr() {
3830
+ function Sr() {
3796
3831
  return `#!/bin/sh
3797
3832
  # .git/hooks/pre-commit
3798
3833
 
@@ -3823,7 +3858,7 @@ echo "No secrets detected."
3823
3858
  exit 0
3824
3859
  `;
3825
3860
  }
3826
- function Sr() {
3861
+ function kr() {
3827
3862
  return `# .github/workflows/secret-scanning.yml
3828
3863
  name: Secret Scanning
3829
3864
 
@@ -3861,7 +3896,7 @@ jobs:
3861
3896
  head: HEAD
3862
3897
  `;
3863
3898
  }
3864
- function kr(e) {
3899
+ function Ar(e) {
3865
3900
  return `# Security Advisory
3866
3901
 
3867
3902
  ## ${e.cves.join(", ")} - ${e.description}
@@ -3909,7 +3944,7 @@ ${e.cves.map((t) => `- [${t}](https://www.cve.org/CVERecord?id=${t})`).join(`
3909
3944
  `)}
3910
3945
  `;
3911
3946
  }
3912
- function Ar() {
3947
+ function Tr() {
3913
3948
  return `# Security Policy
3914
3949
 
3915
3950
  ## Supported Versions
@@ -3980,80 +4015,80 @@ We will not pursue legal action against researchers who:
3980
4015
  `;
3981
4016
  }
3982
4017
  export {
3983
- Ht as NiceDeviceTrust,
3984
- $t as NiceFaceRecognition,
3985
- Nt as NiceFingerprintScanner,
3986
- zt as NiceI18nProvider,
3987
- Lt as NiceIrisScanner,
4018
+ qt as NiceDeviceTrust,
4019
+ jt as NiceFaceRecognition,
4020
+ Lt as NiceFingerprintScanner,
4021
+ Nt as NiceI18nProvider,
4022
+ $t as NiceIrisScanner,
3988
4023
  Ot as NiceMfaSelector,
3989
- qt as NicePassphraseInput,
3990
- jt as NicePatternLock,
4024
+ Kt as NicePassphraseInput,
4025
+ Bt as NicePatternLock,
3991
4026
  _t as NicePinKeypad,
3992
- Wt as NiceSecurityAuditLog,
4027
+ Ht as NiceSecurityAuditLog,
3993
4028
  Ut as NiceSessionManager,
3994
- Bt as NiceWebAuthnButton,
3995
- xr as SECRET_PATTERNS,
3996
- mr as SECURITY_PATTERNS,
3997
- rt as authenticateWebAuthn,
4029
+ Wt as NiceWebAuthnButton,
4030
+ wr as SECRET_PATTERNS,
4031
+ vr as SECURITY_PATTERNS,
4032
+ nt as authenticateWebAuthn,
3998
4033
  le as captureFrame,
3999
- hr as checkColorContrast,
4000
- yr as checkHeadingHierarchy,
4034
+ fr as checkColorContrast,
4035
+ pr as checkHeadingHierarchy,
4001
4036
  Ie as checkLiveness,
4002
- ar as clearNonEssentialCookies,
4003
- De as collectDeviceInfo,
4004
- Xe as compareFaceToPhoto,
4005
- pr as createAuditLogger,
4006
- er as createCSRFFetch,
4007
- dr as createHIPAASession,
4008
- Dt as createRateLimiter,
4009
- Qt as createSafeHtml,
4010
- Ge as detectIris,
4037
+ cr as clearNonEssentialCookies,
4038
+ Ce as collectDeviceInfo,
4039
+ Qe as compareFaceToPhoto,
4040
+ gr as createAuditLogger,
4041
+ tr as createCSRFFetch,
4042
+ hr as createHIPAASession,
4043
+ Ct as createRateLimiter,
4044
+ Vt as createSafeHtml,
4045
+ Je as detectIris,
4011
4046
  It as escapeHtml,
4012
4047
  he as extractFaceFeatures,
4013
4048
  Ue as extractMinutiae,
4014
- Qe as faceToTemplate,
4015
- qe as fingerprintToTemplate,
4016
- Kt as generateCSPHeader,
4017
- Vt as generateCSRFToken,
4018
- cr as generateDataExport,
4049
+ Ve as faceToTemplate,
4050
+ Ke as fingerprintToTemplate,
4051
+ Gt as generateCSPHeader,
4052
+ er as generateCSRFToken,
4053
+ lr as generateDataExport,
4019
4054
  de as generateDeviceFingerprint,
4020
- Ft as generateLivenessChallenge,
4021
- Jt as generateNonce,
4022
- wr as generatePreCommitHook,
4023
- vr as generateSASTConfig,
4024
- br as generateSCAConfig,
4025
- Sr as generateSecretScanningConfig,
4026
- kr as generateSecurityAdvisory,
4027
- Ar as generateSecurityMd,
4028
- Re as getCSRFTokenFromCookie,
4055
+ zt as generateLivenessChallenge,
4056
+ Yt as generateNonce,
4057
+ Sr as generatePreCommitHook,
4058
+ br as generateSASTConfig,
4059
+ xr as generateSCAConfig,
4060
+ kr as generateSecretScanningConfig,
4061
+ Ar as generateSecurityAdvisory,
4062
+ Tr as generateSecurityMd,
4063
+ Me as getCSRFTokenFromCookie,
4029
4064
  pe as getCameraStream,
4030
- Mt as getConsentPreferences,
4031
- Gt as getRecommendedCSP,
4032
- gr as getSOC2Checklist,
4033
- fr as hasAccessibleName,
4034
- or as hasConsent,
4035
- Ye as irisToTemplate,
4036
- et as isPasskeyAvailable,
4037
- Ce as isWebAuthnAvailable,
4038
- ur as logPHIAccess,
4065
+ Rt as getConsentPreferences,
4066
+ Jt as getRecommendedCSP,
4067
+ mr as getSOC2Checklist,
4068
+ yr as hasAccessibleName,
4069
+ ar as hasConsent,
4070
+ Ze as irisToTemplate,
4071
+ tt as isPasskeyAvailable,
4072
+ De as isWebAuthnAvailable,
4073
+ dr as logPHIAccess,
4039
4074
  Te as matchFaces,
4040
- He as matchFingerprints,
4041
- Je as matchIris,
4042
- tt as registerWebAuthn,
4043
- lr as requestDataDeletion,
4075
+ qe as matchFingerprints,
4076
+ Ye as matchIris,
4077
+ rt as registerWebAuthn,
4078
+ ur as requestDataDeletion,
4044
4079
  fe as resolveConfig,
4045
- Yt as sanitizeInput,
4046
- Xt as sanitizeSvg,
4047
- Zt as sanitizeUrl,
4048
- sr as saveConsentPreferences,
4049
- ir as scanFileForViruses,
4050
- Ve as templateToFace,
4051
- Ke as templateToFingerprint,
4052
- Ze as templateToIris,
4053
- tr as useCSRFToken,
4080
+ Zt as sanitizeInput,
4081
+ Qt as sanitizeSvg,
4082
+ Xt as sanitizeUrl,
4083
+ or as saveConsentPreferences,
4084
+ sr as scanFileForViruses,
4085
+ et as templateToFace,
4086
+ Ge as templateToFingerprint,
4087
+ Xe as templateToIris,
4088
+ rr as useCSRFToken,
4054
4089
  te as useNiceTranslation,
4055
- rr as useRateLimiter,
4056
- Ct as validateFile,
4057
- nr as validateFiles,
4090
+ nr as useRateLimiter,
4091
+ Dt as validateFile,
4092
+ ir as validateFiles,
4058
4093
  ge as verifyWithBackend
4059
4094
  };