@baas-id/react 0.2.3 → 0.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.
Files changed (59) hide show
  1. package/LICENSE.md +1 -3
  2. package/README.md +8 -4
  3. package/THIRD_PARTY_NOTICES.md +8 -5
  4. package/dist/esm/baas-id-react.css +1 -1
  5. package/dist/esm/chunks/ContinueFlow-vn9wv0tZ.js +9147 -0
  6. package/dist/esm/continue.js +1 -1
  7. package/dist/esm/index.js +129 -147
  8. package/dist/esm/preview.js +183 -225
  9. package/dist/esm/workers/{detector.worker-DtuL8TFY.js → detector.worker-DrerkwUk.js} +1054 -1054
  10. package/dist/types/continue.d.ts +1 -1
  11. package/dist/types/index.d.ts +2 -2
  12. package/dist/types/preview.d.ts +2 -1
  13. package/dist/types/react/DocumentCapture.d.ts +1 -0
  14. package/dist/types/react/capture/api.d.ts +18 -0
  15. package/dist/types/react/capture/camera.d.ts +1 -0
  16. package/dist/types/react/capture/debugCapture.d.ts +31 -0
  17. package/dist/types/react/capture/debugLog.d.ts +25 -0
  18. package/dist/types/react/capture/index.d.ts +2 -2
  19. package/dist/types/react/document/DocumentParts.d.ts +4 -0
  20. package/dist/types/react/document/cornerOrder.d.ts +38 -0
  21. package/dist/types/react/document/gate.d.ts +5 -1
  22. package/dist/types/react/document/mrz.d.ts +4 -1
  23. package/dist/types/react/document/mrzMap.d.ts +19 -0
  24. package/dist/types/react/document/review.d.ts +29 -0
  25. package/dist/types/react/document/stats.d.ts +20 -0
  26. package/dist/types/react/document/steady.d.ts +90 -0
  27. package/dist/types/react/document/track.d.ts +5 -0
  28. package/dist/types/react/document/upright.d.ts +5 -0
  29. package/dist/types/react/document/useDocumentCapture.d.ts +5 -0
  30. package/dist/types/react/face/FaceGuide.d.ts +2 -2
  31. package/dist/types/react/face/faceFollow.d.ts +32 -0
  32. package/dist/types/react/face/scanState.d.ts +0 -1
  33. package/dist/types/react/flows/FlowResult.d.ts +3 -2
  34. package/dist/types/react/flows/FlowShell.d.ts +6 -3
  35. package/dist/types/react/flows/types.d.ts +5 -1
  36. package/dist/types/react/flows/useFlowSession.d.ts +2 -1
  37. package/dist/types/react/handoff/ContinueFlow.d.ts +5 -2
  38. package/dist/types/react/handoff/ContinueOnPhone.d.ts +18 -2
  39. package/dist/types/react/handoff/api.d.ts +18 -4
  40. package/dist/types/react/handoff/phoneLink.d.ts +7 -0
  41. package/dist/types/react/i18n/es-419-formal.d.ts +3 -0
  42. package/dist/types/react/i18n/index.d.ts +6 -4
  43. package/dist/types/react/i18n/types.d.ts +22 -1
  44. package/dist/types/react/preview/FlowPreview.d.ts +4 -1
  45. package/dist/types/react/telemetry/bus.d.ts +1 -1
  46. package/dist/types/react/theme/appearance.d.ts +4 -2
  47. package/dist/types/react/theme/scheme.d.ts +23 -0
  48. package/dist/types/react/version.d.ts +1 -1
  49. package/dist/types/react/vision/cardEvidence.d.ts +29 -0
  50. package/dist/types/react/vision/corners.d.ts +1 -0
  51. package/dist/types/react/vision/modelsCdn.d.ts +2 -2
  52. package/dist/types/react/vision/tinyCore.d.ts +7 -4
  53. package/dist/types/react/vision/tinyDetector.d.ts +5 -2
  54. package/dist/types/react/vision/types.d.ts +6 -0
  55. package/package.json +1 -1
  56. package/dist/esm/chunks/ContinueFlow-BaQtq48R.js +0 -7500
  57. package/dist/types/react/face/faceMesh.d.ts +0 -68
  58. package/dist/types/react/face/meshBench.d.ts +0 -7
  59. package/dist/types/react/face/meshCanvas.d.ts +0 -20
@@ -1,187 +1,179 @@
1
1
  import "./baas-id-react.css";
2
2
  /* empty css */
3
- import { jsxs as k, jsx as f } from "react/jsx-runtime";
4
- import { useMemo as b, useRef as F, useState as W, useEffect as U } from "react";
5
- import { t as K, n as Q, a as Y, m as J, b as X, g as D, i as Z, c as ee, F as B, H as te, d as ne, e as oe, S as re, E as se, f as ie, h as ae, j as ce, k as le, l as O, o as de, p as G, q as ue, G as H, P as fe, s as pe, u as ye, v as he, w as me } from "./chunks/ContinueFlow-BaQtq48R.js";
6
- import { x as Ne, L as Ue, y as Ge, z as He, A as $e, B as je } from "./chunks/ContinueFlow-BaQtq48R.js";
7
- function ve(e) {
8
- let s = e >>> 0;
9
- return () => (s = s * 1664525 + 1013904223 >>> 0, s / 4294967296);
3
+ import { jsxs as R, jsx as p } from "react/jsx-runtime";
4
+ import { useMemo as E, useRef as M, useState as W, useEffect as U } from "react";
5
+ import { t as $, n as K, a as Q, m as Y, b as J, g as O, f as X, i as Z, c as ee, F as B, H as te, d as oe, e as ne, S as re, E as se, h as ie, j as ae, k as le, l as ce, o as L, p as de, q as G, s as fe, G as H, u as ue, v as pe, w as he, x as ye } from "./chunks/ContinueFlow-vn9wv0tZ.js";
6
+ import { y as we, z as xe, A as De, B as Oe, I as Be, L as Le, J as Ne, K as Ue, N as Ge, O as He, P as je, Q as qe, R as Ve, T as ze } from "./chunks/ContinueFlow-vn9wv0tZ.js";
7
+ function me(e) {
8
+ let r = e >>> 0;
9
+ return () => (r = r * 1664525 + 1013904223 >>> 0, r / 4294967296);
10
10
  }
11
- function $(e, s) {
12
- const n = K(e, s, 0.8), r = 0.012;
11
+ function j(e, r) {
12
+ const n = $(e, r, 0.8), s = 0.012;
13
13
  return [
14
- { x: n[0].x + r, y: n[0].y + r * 0.6 },
15
- { x: n[1].x - r * 0.4, y: n[1].y },
16
- { x: n[2].x, y: n[2].y - r * 0.3 },
17
- { x: n[3].x + r * 0.5, y: n[3].y - r * 0.8 }
14
+ { x: n[0].x + s, y: n[0].y + s * 0.6 },
15
+ { x: n[1].x - s * 0.4, y: n[1].y },
16
+ { x: n[2].x, y: n[2].y - s * 0.3 },
17
+ { x: n[3].x + s * 0.5, y: n[3].y - s * 0.8 }
18
18
  ];
19
19
  }
20
- function P(e, s, n, r, i, t) {
21
- e.beginPath(), e.moveTo(s + t, n), e.arcTo(s + r, n, s + r, n + i, t), e.arcTo(s + r, n + i, s, n + i, t), e.arcTo(s, n + i, s, n, t), e.arcTo(s, n, s + r, n, t), e.closePath();
20
+ function A(e, r, n, s, i, t) {
21
+ e.beginPath(), e.moveTo(r + t, n), e.arcTo(r + s, n, r + s, n + i, t), e.arcTo(r + s, n + i, r, n + i, t), e.arcTo(r, n + i, r, n, t), e.arcTo(r, n, r + s, n, t), e.closePath();
22
22
  }
23
- function j(e, s, n, r) {
23
+ function q(e, r, n, s) {
24
24
  const i = n * 0.037;
25
- P(e, 0, 0, n, r, i), e.save(), e.clip();
26
- const t = e.createLinearGradient(0, 0, n, r);
27
- t.addColorStop(0, "#E8EEEC"), t.addColorStop(1, "#D5DFDC"), e.fillStyle = t, e.fillRect(0, 0, n, r), e.strokeStyle = "rgba(19, 94, 110, 0.13)", e.lineWidth = Math.max(0.6, n * 16e-4);
25
+ A(e, 0, 0, n, s, i), e.save(), e.clip();
26
+ const t = e.createLinearGradient(0, 0, n, s);
27
+ t.addColorStop(0, "#E8EEEC"), t.addColorStop(1, "#D5DFDC"), e.fillStyle = t, e.fillRect(0, 0, n, s), e.strokeStyle = "rgba(19, 94, 110, 0.13)", e.lineWidth = Math.max(0.6, n * 16e-4);
28
28
  for (let o = 0; o < 26; o++)
29
- e.beginPath(), e.ellipse(n * 0.72, r * 0.55, n * (0.08 + o * 0.012), r * (0.12 + o * 0.016), o * 0.11, 0, Math.PI * 2), e.stroke();
30
- e.fillStyle = "#135E6E", e.fillRect(0, 0, n, r * 0.13), e.fillStyle = "rgba(255,255,255,0.9)", e.font = `600 ${Math.round(r * 0.06)}px system-ui, sans-serif`, e.textBaseline = "middle", e.fillText(s === "front" ? "IDENTITY CARD · SPECIMEN" : "SPECIMEN", n * 0.05, r * 0.066);
31
- const c = "rgba(22, 35, 44, 0.55)";
32
- if (s === "front") {
33
- const o = n * 0.05, a = r * 0.2, l = n * 0.27, u = r * 0.62;
34
- e.fillStyle = "#B9C7CE", P(e, o, a, l, u, n * 0.012), e.fill(), e.fillStyle = "#8EA2AC", e.beginPath(), e.ellipse(o + l / 2, a + u * 0.38, l * 0.22, u * 0.2, 0, 0, Math.PI * 2), e.fill(), e.beginPath(), e.ellipse(o + l / 2, a + u * 0.98, l * 0.42, u * 0.3, 0, Math.PI, 0), e.fill(), e.fillStyle = c;
35
- const p = n * 0.37;
36
- [[0.24, 0.3], [0.32, 0.45], [0.44, 0.2], [0.52, 0.38], [0.64, 0.22], [0.72, 0.42]].forEach(([g, S], d) => {
37
- e.globalAlpha = d % 2 ? 1 : 0.55, e.fillRect(p, r * g, n * S, r * (d % 2 ? 0.045 : 0.03));
29
+ e.beginPath(), e.ellipse(n * 0.72, s * 0.55, n * (0.08 + o * 0.012), s * (0.12 + o * 0.016), o * 0.11, 0, Math.PI * 2), e.stroke();
30
+ e.fillStyle = "#135E6E", e.fillRect(0, 0, n, s * 0.13), e.fillStyle = "rgba(255,255,255,0.9)", e.font = `600 ${Math.round(s * 0.06)}px system-ui, sans-serif`, e.textBaseline = "middle", e.fillText(r === "front" ? "IDENTITY CARD · SPECIMEN" : "SPECIMEN", n * 0.05, s * 0.066);
31
+ const l = "rgba(22, 35, 44, 0.55)";
32
+ if (r === "front") {
33
+ const o = n * 0.05, a = s * 0.2, c = n * 0.27, d = s * 0.62;
34
+ e.fillStyle = "#B9C7CE", A(e, o, a, c, d, n * 0.012), e.fill(), e.fillStyle = "#8EA2AC", e.beginPath(), e.ellipse(o + c / 2, a + d * 0.38, c * 0.22, d * 0.2, 0, 0, Math.PI * 2), e.fill(), e.beginPath(), e.ellipse(o + c / 2, a + d * 0.98, c * 0.42, d * 0.3, 0, Math.PI, 0), e.fill(), e.fillStyle = l;
35
+ const u = n * 0.37;
36
+ [[0.24, 0.3], [0.32, 0.45], [0.44, 0.2], [0.52, 0.38], [0.64, 0.22], [0.72, 0.42]].forEach(([m, g], h) => {
37
+ e.globalAlpha = h % 2 ? 1 : 0.55, e.fillRect(u, s * m, n * g, s * (h % 2 ? 0.045 : 0.03));
38
38
  }), e.globalAlpha = 1;
39
39
  } else {
40
- const o = ve(41), a = n * 0.05, l = r * 0.2, u = n * 0.9, p = r * 0.3;
40
+ const o = me(41), a = n * 0.05, c = s * 0.2, d = n * 0.9, u = s * 0.3;
41
41
  e.fillStyle = "#16232C";
42
- const g = 64, S = 10;
43
- for (let d = 0; d < g; d++) for (let y = 0; y < S; y++)
44
- o() > 0.5 && e.fillRect(a + d * u / g, l + y * p / S, u / g + 0.4, p / S + 0.4);
45
- e.fillStyle = c;
46
- for (let d = 0; d < 3; d++) e.fillRect(n * 0.05, r * (0.62 + d * 0.11), n * 0.9, r * 0.055);
42
+ const m = 64, g = 10;
43
+ for (let h = 0; h < m; h++) for (let f = 0; f < g; f++)
44
+ o() > 0.5 && e.fillRect(a + h * d / m, c + f * u / g, d / m + 0.4, u / g + 0.4);
45
+ e.fillStyle = l;
46
+ for (let h = 0; h < 3; h++) e.fillRect(n * 0.05, s * (0.62 + h * 0.11), n * 0.9, s * 0.055);
47
47
  }
48
- e.save(), e.translate(n / 2, r / 2), e.rotate(-0.2), e.fillStyle = "rgba(178, 67, 78, 0.22)", e.font = `800 ${Math.round(r * 0.2)}px system-ui, sans-serif`, e.textAlign = "center", e.textBaseline = "middle", e.fillText("SPECIMEN", 0, 0), e.restore(), e.restore();
48
+ e.save(), e.translate(n / 2, s / 2), e.rotate(-0.2), e.fillStyle = "rgba(178, 67, 78, 0.22)", e.font = `800 ${Math.round(s * 0.2)}px system-ui, sans-serif`, e.textAlign = "center", e.textBaseline = "middle", e.fillText("SPECIMEN", 0, 0), e.restore(), e.restore();
49
49
  }
50
- function ge(e, s) {
51
- const n = e.getBoundingClientRect(), r = Math.max(1, n.width || 390), i = Math.max(1, n.height || 300), t = Math.min(2, typeof devicePixelRatio == "number" ? devicePixelRatio : 1);
52
- e.width = Math.round(r * t), e.height = Math.round(i * t);
53
- const c = e.getContext("2d");
54
- if (!c) return;
55
- c.setTransform(t, 0, 0, t, 0, 0);
56
- const o = c.createRadialGradient(r * 0.5, i * 0.2, 10, r * 0.5, i * 0.6, r);
57
- o.addColorStop(0, "#2B3A44"), o.addColorStop(1, "#141D23"), c.fillStyle = o, c.fillRect(0, 0, r, i);
58
- const a = $(r, i).map((p) => ({ x: p.x * r, y: p.y * i })), l = Math.hypot(a[1].x - a[0].x, a[1].y - a[0].y), u = Math.hypot(a[3].x - a[0].x, a[3].y - a[0].y);
59
- c.save(), c.transform((a[1].x - a[0].x) / l, (a[1].y - a[0].y) / l, (a[3].x - a[0].x) / u, (a[3].y - a[0].y) / u, a[0].x, a[0].y), c.shadowColor = "rgba(0,0,0,0.45)", c.shadowBlur = 18, c.shadowOffsetY = 6, c.fillStyle = "#000", P(c, 0, 0, l, u, l * 0.037), c.fill(), c.shadowColor = "transparent", j(c, s, l, u), c.restore();
50
+ function ve(e, r) {
51
+ const n = e.getBoundingClientRect(), s = Math.max(1, n.width || 390), i = Math.max(1, n.height || 300), t = Math.min(2, typeof devicePixelRatio == "number" ? devicePixelRatio : 1);
52
+ e.width = Math.round(s * t), e.height = Math.round(i * t);
53
+ const l = e.getContext("2d");
54
+ if (!l) return;
55
+ l.setTransform(t, 0, 0, t, 0, 0);
56
+ const o = l.createRadialGradient(s * 0.5, i * 0.2, 10, s * 0.5, i * 0.6, s);
57
+ o.addColorStop(0, "#2B3A44"), o.addColorStop(1, "#141D23"), l.fillStyle = o, l.fillRect(0, 0, s, i);
58
+ const a = j(s, i).map((u) => ({ x: u.x * s, y: u.y * i })), c = Math.hypot(a[1].x - a[0].x, a[1].y - a[0].y), d = Math.hypot(a[3].x - a[0].x, a[3].y - a[0].y);
59
+ l.save(), l.transform((a[1].x - a[0].x) / c, (a[1].y - a[0].y) / c, (a[3].x - a[0].x) / d, (a[3].y - a[0].y) / d, a[0].x, a[0].y), l.shadowColor = "rgba(0,0,0,0.45)", l.shadowBlur = 18, l.shadowOffsetY = 6, l.fillStyle = "#000", A(l, 0, 0, c, d, c * 0.037), l.fill(), l.shadowColor = "transparent", q(l, r, c, d), l.restore();
60
60
  }
61
- function L(e) {
61
+ function N(e) {
62
62
  if (typeof document > "u") return;
63
- const s = document.createElement("canvas");
64
- s.width = 254, s.height = 160;
65
- const n = s.getContext("2d");
63
+ const r = document.createElement("canvas");
64
+ r.width = 254, r.height = 160;
65
+ const n = r.getContext("2d");
66
66
  if (n) {
67
- j(n, e, 254, 160);
67
+ q(n, e, 254, 160);
68
68
  try {
69
- return s.toDataURL("image/png");
69
+ return r.toDataURL("image/png");
70
70
  } catch {
71
71
  return;
72
72
  }
73
73
  }
74
74
  }
75
- const C = { w: 720, h: 1280 };
76
- function q(e = 0, s = 1) {
77
- const { w: n, h: r } = C, i = n / 2 + e * 26, t = r * 0.44, c = 160 * s, o = 205 * s, a = e * c * 0.32;
75
+ const b = { w: 720, h: 1280 };
76
+ function ge(e = 0, r = 1) {
77
+ const { w: n, h: s } = b, i = n / 2 + e * 26, t = s * 0.44, l = 160 * r, o = 205 * r, a = e * l * 0.32;
78
78
  return {
79
79
  cx: i,
80
80
  cy: t,
81
- rx: c,
81
+ rx: l,
82
82
  ry: o,
83
- eyes: [{ x: i - c * 0.36 + a, y: t - o * 0.12 }, { x: i + c * 0.36 + a, y: t - o * 0.12 }],
83
+ eyes: [{ x: i - l * 0.36 + a, y: t - o * 0.12 }, { x: i + l * 0.36 + a, y: t - o * 0.12 }],
84
84
  nose: { x: i + a * 1.25, y: t + o * 0.12 },
85
85
  mouth: { x: i + a * 1.1, y: t + o * 0.43 },
86
- ears: [{ x: i - c * 0.98 + a * 0.3, y: t }, { x: i + c * 0.98 + a * 0.3, y: t }]
86
+ ears: [{ x: i - l * 0.98 + a * 0.3, y: t }, { x: i + l * 0.98 + a * 0.3, y: t }]
87
87
  };
88
88
  }
89
- function Se(e = 0, s = 1) {
90
- const n = q(e, s), r = (i) => ({ x: i.x / C.w, y: i.y / C.h });
91
- return [
92
- r({ x: n.cx - n.rx, y: n.cy - n.ry }),
93
- r({ x: n.cx + n.rx, y: n.cy + n.ry }),
94
- r(n.eyes[0]),
95
- r(n.eyes[1]),
96
- r(n.nose),
97
- r(n.mouth),
98
- r(n.ears[0]),
99
- r(n.ears[1])
100
- ];
101
- }
102
- function Ce(e, s = 0, n = 1) {
103
- const { w: r, h: i } = C;
104
- e.width = r, e.height = i;
89
+ function Se(e, r = 0, n = 1) {
90
+ const { w: s, h: i } = b;
91
+ e.width = s, e.height = i;
105
92
  const t = e.getContext("2d");
106
93
  if (!t) return;
107
- const c = t.createLinearGradient(0, 0, 0, i);
108
- c.addColorStop(0, "#5D6E77"), c.addColorStop(1, "#2E3B43"), t.fillStyle = c, t.fillRect(0, 0, r, i);
109
- const o = q(s, n);
110
- t.fillStyle = "#24343E", t.beginPath(), t.ellipse(r / 2 + s * 10, i * 0.98, r * 0.56 * n, i * 0.28 * n, 0, Math.PI, 0), t.fill(), t.fillStyle = "#B88C73", t.fillRect(o.cx - o.rx * 0.36, o.cy + o.ry * 0.6, o.rx * 0.72, o.ry * 0.65);
94
+ const l = t.createLinearGradient(0, 0, 0, i);
95
+ l.addColorStop(0, "#5D6E77"), l.addColorStop(1, "#2E3B43"), t.fillStyle = l, t.fillRect(0, 0, s, i);
96
+ const o = ge(r, n);
97
+ t.fillStyle = "#24343E", t.beginPath(), t.ellipse(s / 2 + r * 10, i * 0.98, s * 0.56 * n, i * 0.28 * n, 0, Math.PI, 0), t.fill(), t.fillStyle = "#B88C73", t.fillRect(o.cx - o.rx * 0.36, o.cy + o.ry * 0.6, o.rx * 0.72, o.ry * 0.65);
111
98
  const a = t.createRadialGradient(o.cx - o.rx * 0.3, o.cy - o.ry * 0.3, 10, o.cx, o.cy, o.ry * 1.1);
112
99
  a.addColorStop(0, "#D8AE92"), a.addColorStop(1, "#B98A6E"), t.fillStyle = a, t.beginPath(), t.ellipse(o.cx, o.cy, o.rx, o.ry, 0, 0, Math.PI * 2), t.fill(), t.fillStyle = "#B4856A";
113
- for (const l of o.ears)
114
- t.beginPath(), t.ellipse(l.x, l.y, o.rx * 0.11, o.ry * 0.14, 0, 0, Math.PI * 2), t.fill();
100
+ for (const c of o.ears)
101
+ t.beginPath(), t.ellipse(c.x, c.y, o.rx * 0.11, o.ry * 0.14, 0, 0, Math.PI * 2), t.fill();
115
102
  t.fillStyle = "#2A211C", t.beginPath(), t.ellipse(o.cx, o.cy - o.ry * 0.42, o.rx * 1.04, o.ry * 0.62, 0, Math.PI * 1.02, Math.PI * 1.98), t.fill(), t.strokeStyle = "#3A2B22", t.lineWidth = 9, t.lineCap = "round";
116
- for (const l of o.eyes)
117
- t.beginPath(), t.moveTo(l.x - 30, l.y - 34), t.quadraticCurveTo(l.x, l.y - 46, l.x + 30, l.y - 34), t.stroke();
103
+ for (const c of o.eyes)
104
+ t.beginPath(), t.moveTo(c.x - 30, c.y - 34), t.quadraticCurveTo(c.x, c.y - 46, c.x + 30, c.y - 34), t.stroke();
118
105
  t.fillStyle = "#F4F1EC";
119
- for (const l of o.eyes)
120
- t.beginPath(), t.ellipse(l.x, l.y, 24, 13, 0, 0, Math.PI * 2), t.fill();
106
+ for (const c of o.eyes)
107
+ t.beginPath(), t.ellipse(c.x, c.y, 24, 13, 0, 0, Math.PI * 2), t.fill();
121
108
  t.fillStyle = "#3B2A20";
122
- for (const l of o.eyes)
123
- t.beginPath(), t.arc(l.x + s * 6, l.y, 9, 0, Math.PI * 2), t.fill();
109
+ for (const c of o.eyes)
110
+ t.beginPath(), t.arc(c.x + r * 6, c.y, 9, 0, Math.PI * 2), t.fill();
124
111
  t.strokeStyle = "rgba(120, 78, 58, 0.7)", t.lineWidth = 6, t.beginPath(), t.moveTo(o.nose.x - 4, o.nose.y - 60), t.quadraticCurveTo(o.nose.x + 10, o.nose.y, o.nose.x - 12, o.nose.y + 6), t.stroke(), t.strokeStyle = "#8A4C42", t.lineWidth = 8, t.beginPath(), t.moveTo(o.mouth.x - 46, o.mouth.y), t.quadraticCurveTo(o.mouth.x, o.mouth.y + 22, o.mouth.x + 46, o.mouth.y), t.stroke();
125
112
  }
126
- const R = "k7qxm2dpa4vbn6tr3hsy5ecwz2";
127
- function be(e) {
128
- const s = e && typeof e == "object" ? e : null;
129
- if (!s) return;
130
- const n = s.reasons && typeof s.reasons == "object" ? s.reasons : null;
131
- if (!n) return O(s);
132
- const r = {};
113
+ const P = "k7qxm2dpa4vbn6tr3hsy5ecwz2";
114
+ function Ce(e) {
115
+ const r = e && typeof e == "object" ? e : null;
116
+ if (!r) return;
117
+ const n = r.reasons && typeof r.reasons == "object" ? r.reasons : null;
118
+ if (!n) return L(r);
119
+ const s = {};
133
120
  for (const [i, t] of Object.entries(n))
134
- for (const [c, o] of Object.entries(t ?? {})) (r[c] ?? (r[c] = {}))[i] = o;
135
- return O(r);
121
+ for (const [l, o] of Object.entries(t ?? {})) (s[l] ?? (s[l] = {}))[i] = o;
122
+ return L(s);
136
123
  }
137
- const Ee = {
124
+ const be = {
138
125
  enrollment: { verdict: "VERIFIED", purpose: "enrollment", reason: null, score: 0.8412, assurance: "pilot", policy_version: "preview" },
139
126
  signin: { verdict: "VERIFIED", purpose: "signin", reason: null, score: 0.8806, assurance: "pilot", policy_version: "preview" },
140
127
  reverification: { verdict: "VERIFIED", purpose: "reverification", reason: null, score: 0.8517, assurance: "pilot", policy_version: "preview" },
141
128
  identify: { verdict: "VERIFIED", purpose: "identify", reason: null, score: 0.8633, assurance: "pilot", policy_version: "preview" }
142
129
  };
143
- function _e(e) {
130
+ function Fe(e) {
144
131
  const {
145
- screen: s,
132
+ screen: r,
146
133
  step: n = "front",
147
- challenge: r = "center",
134
+ challenge: s = "center",
148
135
  purpose: i = "enrollment",
149
136
  locale: t,
150
- errorCode: c = "FACE_MISMATCH",
137
+ errorCode: l = "FACE_MISMATCH",
151
138
  documentSides: o,
152
139
  document: a = !0,
153
- challenges: l = 2,
154
- privacyNote: u
155
- } = e, p = b(() => Q(e.appearance), [e.appearance]), g = b(() => Y(e.instructions), [e.instructions]), S = b(() => be(e.messages), [e.messages]), d = b(() => {
156
- const v = J(X(S, t, D(t)));
157
- return { t: D(t, v), overrides: v };
158
- }, [S, t]), y = de(i, { document: a, documentSides: o }), h = y.includes(n) ? n : y[0], m = s === "success" ? { k: "done", result: Ee[i] } : s === "error" ? { k: "failed", reason: c } : h === "face" ? { k: "face" } : { k: "doc", side: h }, E = s === "intro" && Z(h, g), x = ee(h, t, d.t, g), I = m.k === "doc" || m.k === "face", A = y.length > 1, M = b(() => ({
159
- front: h !== "front" && y.includes("front") ? L("front") : void 0,
160
- back: h === "face" && y.includes("back") ? L("back") : void 0
161
- }), [h, y.join()]);
162
- if (s === "handoff" || s === "continue" || s === "continueDone") {
163
- const v = e.handoff ?? {}, w = v.copy?.[t] ?? null, T = v.tenant || "Acme", _ = R.slice(-4).toUpperCase(), V = v.continueUrl ? v.continueUrl.includes("{code}") ? v.continueUrl.replace("{code}", R) : `${v.continueUrl}${v.continueUrl.includes("?") ? "&" : "?"}h=${R}` : `https://baaslatam.com/c/${R}`, z = s === "handoff" ? w?.title || d.t.handoff.title : s === "continue" ? d.t.handoff.phoneTitle : d.t.handoff.doneTitle;
164
- return /* @__PURE__ */ k(
140
+ challenges: c = 2,
141
+ privacyNote: d,
142
+ formality: u = "informal"
143
+ } = e, m = E(() => K(e.appearance), [e.appearance]), g = E(() => Q(e.instructions), [e.instructions]), h = E(() => Ce(e.messages), [e.messages]), f = E(() => {
144
+ const y = Y(
145
+ X(t, u),
146
+ J(h, t, O(t, void 0, u))
147
+ );
148
+ return { t: O(t, y, u), overrides: y };
149
+ }, [h, t, u]), C = de(i, { document: a, documentSides: o }), S = C.includes(n) ? n : C[0], v = r === "success" ? { k: "done", result: be[i] } : r === "error" ? { k: "failed", reason: l } : S === "face" ? { k: "face" } : { k: "doc", side: S }, k = r === "intro" && Z(S, g), F = ee(S, t, f.t, g), T = v.k === "doc" || v.k === "face", _ = C.length > 1, I = E(() => ({
150
+ front: S !== "front" && C.includes("front") ? N("front") : void 0,
151
+ back: S === "face" && C.includes("back") ? N("back") : void 0
152
+ }), [S, C.join()]);
153
+ if (r === "handoff" || r === "continue" || r === "continueDone") {
154
+ const y = e.handoff ?? {}, w = y.copy?.[t] ?? null, x = y.tenant || "Acme", D = P.slice(-4).toUpperCase(), V = y.continueUrl ? y.continueUrl.includes("{code}") ? y.continueUrl.replace("{code}", P) : `${y.continueUrl}${y.continueUrl.includes("?") ? "&" : "?"}h=${P}` : `https://baaslatam.com/c/${P}`, z = r === "handoff" ? w?.title || f.t.handoff.title : r === "continue" ? f.t.handoff.phoneTitle : f.t.handoff.doneTitle;
155
+ return /* @__PURE__ */ R(
165
156
  B,
166
157
  {
167
158
  step: { k: "opening" },
168
159
  purpose: i,
169
- t: d.t,
170
- privacy: u,
171
- appearance: p,
160
+ t: f.t,
161
+ privacy: d,
162
+ appearance: m,
172
163
  forceAppearance: !0,
173
164
  manageFocus: !1,
174
- screen: s === "handoff" ? "handoff" : s === "continue" ? "confirm" : "done",
165
+ colorScheme: e.colorScheme,
166
+ screen: r === "handoff" ? "handoff" : r === "continue" ? "confirm" : "done",
175
167
  title: z,
176
168
  children: [
177
- s === "handoff" && /* @__PURE__ */ f(
169
+ r === "handoff" && /* @__PURE__ */ p(
178
170
  te,
179
171
  {
180
- t: d.t,
181
- mode: v.mode ?? "suggest",
172
+ t: f.t,
173
+ mode: y.mode ?? "suggest",
182
174
  copy: w,
183
- link: { url: V, codeHint: _, tenant: T },
184
- leftMs: (v.ttlMinutes ?? 10) * 6e4 - 18e3,
175
+ link: { url: V, codeHint: D, tenant: x },
176
+ leftMs: (y.ttlMinutes ?? 10) * 6e4 - 18e3,
185
177
  expired: !1,
186
178
  failed: !1,
187
179
  phase: null,
@@ -191,178 +183,144 @@ function _e(e) {
191
183
  }
192
184
  }
193
185
  ),
194
- s === "continue" && /* @__PURE__ */ f(ne, { t: d.t, tenant: T, codeHint: _ }),
195
- s === "continueDone" && /* @__PURE__ */ f(oe, { t: d.t })
186
+ r === "continue" && /* @__PURE__ */ p(oe, { t: f.t, tenant: x, codeHint: D }),
187
+ r === "continueDone" && /* @__PURE__ */ p(ne, { t: f.t })
196
188
  ]
197
189
  }
198
190
  );
199
191
  }
200
- return /* @__PURE__ */ k(
192
+ return /* @__PURE__ */ R(
201
193
  B,
202
194
  {
203
- step: m,
195
+ step: v,
204
196
  purpose: i,
205
- t: d.t,
206
- privacy: u,
207
- appearance: p,
197
+ t: f.t,
198
+ privacy: d,
199
+ appearance: m,
208
200
  forceAppearance: !0,
209
201
  manageFocus: !1,
210
- screen: E ? "intro" : void 0,
211
- title: E ? x.title : le(m, i, d.t),
202
+ colorScheme: e.colorScheme,
203
+ screen: k ? "intro" : void 0,
204
+ title: k ? F.title : ce(v, i, f.t),
212
205
  children: [
213
- I && A && /* @__PURE__ */ f(re, { step: m, t: d.t, plan: y }),
214
- I && A && (M.front || M.back) && /* @__PURE__ */ f(se, { thumbs: M, t: d.t, plan: y }),
215
- E && /* @__PURE__ */ f(
206
+ T && _ && /* @__PURE__ */ p(re, { step: v, t: f.t, plan: C }),
207
+ T && _ && (I.front || I.back) && /* @__PURE__ */ p(se, { thumbs: I, t: f.t, plan: C }),
208
+ k && /* @__PURE__ */ p(
216
209
  ie,
217
210
  {
218
- step: h,
219
- body: x.body,
220
- t: d.t,
221
- movements: h === "face" ? l : void 0,
222
- sessionMinutes: y.indexOf(h) === 0 ? 15 : null,
211
+ step: S,
212
+ body: F.body,
213
+ t: f.t,
214
+ movements: S === "face" ? c : void 0,
215
+ sessionMinutes: C.indexOf(S) === 0 ? 15 : null,
223
216
  onStart: () => {
224
217
  }
225
218
  }
226
219
  ),
227
- !E && m.k === "doc" && /* @__PURE__ */ f(ke, { side: m.side, t: d.t }),
228
- !E && m.k === "face" && /* @__PURE__ */ f(Fe, { challenge: r, count: l, t: d.t }),
229
- m.k === "done" && /* @__PURE__ */ f(ae, { result: m.result, t: d.t }),
230
- m.k === "failed" && /* @__PURE__ */ f(ce, { reason: c, locale: t, t: d.t, overrides: d.overrides, onRestart: () => {
220
+ !k && v.k === "doc" && /* @__PURE__ */ p(Ee, { side: v.side, t: f.t }),
221
+ !k && v.k === "face" && /* @__PURE__ */ p(Re, { challenge: s, count: c, t: f.t }),
222
+ v.k === "done" && /* @__PURE__ */ p(ae, { result: v.result, t: f.t }),
223
+ v.k === "failed" && /* @__PURE__ */ p(le, { reason: l, locale: t, t: f.t, overrides: f.overrides, onRestart: () => {
231
224
  }, takeFocus: !1 })
232
225
  ]
233
226
  }
234
227
  );
235
228
  }
236
- function ke({ side: e, t: s }) {
237
- const n = F(null), r = F(null), [i, t] = W({ w: 0, h: 0 });
229
+ function Ee({ side: e, t: r }) {
230
+ const n = M(null), s = M(null), [i, t] = W({ w: 0, h: 0 });
238
231
  U(() => {
239
- const o = r.current;
232
+ const o = s.current;
240
233
  if (!o) return;
241
234
  const a = () => {
242
- const u = o.getBoundingClientRect();
243
- t((p) => Math.abs(p.w - u.width) < 0.5 && Math.abs(p.h - u.height) < 0.5 ? p : { w: u.width, h: u.height }), ge(o, e);
235
+ const d = o.getBoundingClientRect();
236
+ t((u) => Math.abs(u.w - d.width) < 0.5 && Math.abs(u.h - d.height) < 0.5 ? u : { w: d.width, h: d.height }), ve(o, e);
244
237
  };
245
238
  if (a(), typeof ResizeObserver > "u") return;
246
- const l = new ResizeObserver(a);
247
- return l.observe(o), () => l.disconnect();
239
+ const c = new ResizeObserver(a);
240
+ return c.observe(o), () => c.disconnect();
248
241
  }, [e]);
249
- const c = b(() => {
250
- const o = $(i.w || 4, i.h || 3);
242
+ const l = E(() => {
243
+ const o = j(i.w || 4, i.h || 3);
251
244
  return { at: () => o, info: () => ({ kind: "edges", locks: [!0, !0, !0, !0] }) };
252
245
  }, [i.w, i.h]);
253
- return /* @__PURE__ */ f("div", { className: "baas-id-scope rpid-doc-capture", "data-rpid-preview": !0, children: /* @__PURE__ */ k(
246
+ return /* @__PURE__ */ p("div", { className: "baas-id-scope rpid-doc-capture", "data-rpid-preview": !0, children: /* @__PURE__ */ R(
254
247
  G,
255
248
  {
256
249
  className: "rpid-viewport rpid-doc rpid-locked",
257
250
  attrs: { "data-rpid-side": e, "data-rpid-frame": "holding" },
258
251
  source: "demo",
259
252
  videoRef: n,
260
- canvasRef: r,
253
+ canvasRef: s,
261
254
  children: [
262
- /* @__PURE__ */ f(ue, { source: i.w ? c : null, pct: 0.62, state: "holding", t: s }),
263
- /* @__PURE__ */ f(H, { tone: "ok", children: /* @__PURE__ */ f("span", { className: "rpid-guide-line", children: s.guide.steady }) })
255
+ /* @__PURE__ */ p(fe, { source: i.w ? l : null, pct: 0.62, state: "holding", t: r }),
256
+ /* @__PURE__ */ p(H, { tone: "ok", children: /* @__PURE__ */ p("span", { className: "rpid-guide-line", children: r.guide.steady }) })
264
257
  ]
265
258
  }
266
259
  ) });
267
260
  }
268
- const Re = {
261
+ const ke = {
269
262
  center: ["turn_left", "move_closer"],
270
263
  turn_left: ["turn_left", "move_closer"],
271
264
  turn_right: ["turn_right", "move_closer"],
272
265
  move_closer: ["turn_left", "move_closer"]
273
266
  };
274
- function Fe({ challenge: e, count: s, t: n }) {
275
- const r = F(null), i = F(null), t = Re[e].slice(0, Math.max(1, Math.min(3, s)));
267
+ function Re({ challenge: e, count: r, t: n }) {
268
+ const s = M(null), i = M(null), t = ke[e].slice(0, Math.max(1, Math.min(3, r)));
276
269
  e !== "center" && !t.includes(e) && (t[t.length - 1] = e);
277
- const c = e === "center" ? -1 : t.indexOf(e), o = e === "turn_left" ? -0.55 : e === "turn_right" ? 0.55 : 0, a = e === "move_closer" ? 1.12 : 1, l = b(() => new fe(), []);
270
+ const l = e === "center" ? -1 : t.indexOf(e), o = e === "turn_left" ? -0.55 : e === "turn_right" ? 0.55 : 0, a = e === "move_closer" ? 1.12 : 1;
278
271
  U(() => {
279
- i.current && Ce(i.current, o, a);
280
- const h = Se(o, a);
281
- l.reset(), l.seen(h, performance.now());
282
- const m = setInterval(() => l.seen(h, performance.now()), 300);
283
- return () => clearInterval(m);
284
- }, [o, a, l]);
285
- const u = pe({ videoWidth: C.w, videoHeight: C.h }), p = e === "center" ? null : e, g = e === "center" ? "perfect" : e === "move_closer" ? "closer_more" : e, S = e === "center" ? 0 : 0.45, d = ye({ step: c, total: t.length, hold: 0.65, progress: S, done: !1 }), y = { "--rpid-video-ar": (C.w / C.h).toFixed(4) };
286
- return /* @__PURE__ */ k("div", { className: "baas-id-scope", "data-rpid-preview": !0, children: [
287
- /* @__PURE__ */ k(
272
+ i.current && Se(i.current, o, a);
273
+ }, [o, a]);
274
+ const c = ue({ videoWidth: b.w, videoHeight: b.h }), d = e === "center" ? null : e, u = e === "center" ? "perfect" : e === "move_closer" ? "closer_more" : e, m = e === "center" ? 0 : 0.45, g = pe({ step: l, total: t.length, hold: 0.65, progress: m, done: !1 }), h = { "--rpid-video-ar": (b.w / b.h).toFixed(4) };
275
+ return /* @__PURE__ */ R("div", { className: "baas-id-scope", "data-rpid-preview": !0, children: [
276
+ /* @__PURE__ */ R(
288
277
  G,
289
278
  {
290
279
  className: `rpid-viewport rpid-face rpid-${e === "center" ? "searching" : "locked"}`,
291
280
  attrs: { "data-rpid-guide-state": e === "center" ? "aligned" : "capturing" },
292
- style: y,
281
+ style: h,
293
282
  source: "demo",
294
- videoRef: r,
283
+ videoRef: s,
295
284
  canvasRef: i,
296
285
  mirror: !0,
297
286
  children: [
298
- /* @__PURE__ */ f(
287
+ /* @__PURE__ */ p(
299
288
  he,
300
289
  {
301
- src: C,
302
- oval: u,
303
- motion: l,
290
+ src: b,
291
+ oval: c,
304
292
  state: e === "center" ? "aligned" : "capturing",
305
293
  scan: e === "center" ? "aligned" : "challenge",
306
- fills: d,
307
- progress: S,
308
- cue: p,
309
- guide: g,
294
+ fills: g,
295
+ progress: m,
296
+ cue: d,
297
+ guide: u,
310
298
  t: n
311
299
  }
312
300
  ),
313
- /* @__PURE__ */ f(H, { tone: "ok", marker: !0, children: e === "center" ? n.guide.perfect : n.guide[g] })
301
+ /* @__PURE__ */ p(H, { tone: "ok", marker: !0, children: e === "center" ? n.guide.perfect : n.guide[u] })
314
302
  ]
315
303
  }
316
304
  ),
317
- /* @__PURE__ */ f(me, { script: t, step: c, t: n })
305
+ /* @__PURE__ */ p(ye, { script: t, step: l, t: n })
318
306
  ] });
319
307
  }
320
- const Me = {
321
- primary: "#135E6E",
322
- positive: "#177E54",
323
- caution: "#99671C",
324
- danger: "#B2434E",
325
- surface: "#FFFFFF",
326
- text: "#16232C",
327
- overlay: "#080D11"
328
- }, De = 12, Pe = [
329
- { fg: "text", bg: "surface", min: 4.5 },
330
- { fg: "primary", bg: "surface", min: 4.5 },
331
- { fg: "danger", bg: "surface", min: 4.5 },
332
- { fg: "positive", bg: "surface", min: 3 },
333
- { fg: "caution", bg: "surface", min: 3 }
334
- ];
335
- function N(e) {
336
- const s = (n) => {
337
- const r = parseInt(e.slice(n, n + 2), 16) / 255;
338
- return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
339
- };
340
- return 0.2126 * s(1) + 0.7152 * s(3) + 0.0722 * s(5);
341
- }
342
- function xe(e, s) {
343
- const [n, r] = [N(e), N(s)].sort((i, t) => t - i);
344
- return Math.round((n + 0.05) / (r + 0.05) * 100) / 100;
345
- }
346
- function Be(e) {
347
- const s = { ...Me, ...e?.colors ?? {} };
348
- return Pe.map(({ fg: n, bg: r, min: i }) => {
349
- const t = /^#[0-9a-fA-F]{6}$/.test(s[n]) && /^#[0-9a-fA-F]{6}$/.test(s[r]) ? xe(s[n], s[r]) : 21;
350
- return { fg: n, bg: r, ratio: t, min: i, pass: t >= i };
351
- });
352
- }
353
308
  export {
354
- Pe as CONTRAST_PAIRS,
355
- Me as DEFAULT_COLORS,
356
- De as DEFAULT_RADIUS,
357
- Ne as FONT_STACKS,
358
- _e as FlowPreview,
359
- Ue as LOCALES,
360
- Ge as SDK_DEFAULTS,
361
- He as appearanceGroups,
362
- $e as appearanceStyle,
363
- Be as contrastChecks,
364
- xe as contrastRatio,
365
- D as getStrings,
309
+ we as CONTRAST_PAIRS,
310
+ xe as DARK,
311
+ De as DEFAULT_COLORS,
312
+ Oe as DEFAULT_RADIUS,
313
+ Be as FONT_STACKS,
314
+ Fe as FlowPreview,
315
+ Le as LOCALES,
316
+ Ne as SDK_DEFAULTS,
317
+ Ue as appearanceGroups,
318
+ Ge as appearanceStyle,
319
+ He as contrastChecks,
320
+ je as contrastRatio,
321
+ qe as darkPalette,
322
+ O as getStrings,
366
323
  ee as introFor,
367
- je as parseIntroBody
324
+ Ve as liftOn,
325
+ ze as parseIntroBody
368
326
  };