@sekyro/react 0.1.0-rc.5 → 0.1.0-rc.6

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 (46) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/LICENSE +25 -16
  3. package/README.md +36 -4
  4. package/dist/chunk-3MBJZSJL.js +2 -0
  5. package/dist/chunk-4INDRENU.js +2 -0
  6. package/dist/chunk-4RUZQW5T.js +2 -0
  7. package/dist/chunk-63NUMQST.js +2 -0
  8. package/dist/chunk-65JA6YKG.js +2 -0
  9. package/dist/chunk-ADMDZLPM.js +2 -0
  10. package/dist/chunk-AMOZXMUP.js +2 -0
  11. package/dist/chunk-BENNJ4GV.js +2 -0
  12. package/dist/chunk-BJJZ4MO5.js +2 -0
  13. package/dist/chunk-BRA6F56P.js +2 -0
  14. package/dist/chunk-JAUZKPQO.js +2 -0
  15. package/dist/chunk-P2LX7BBE.js +2 -0
  16. package/dist/chunk-Q232JYNO.js +2 -0
  17. package/dist/chunk-YUNPD6ZB.js +2 -0
  18. package/dist/document-capture-view-SKFDM4AQ.js +2 -0
  19. package/dist/eid-view-WIK6KUTY.js +2 -0
  20. package/dist/email-otp-view-TYSBCGUY.js +2 -0
  21. package/dist/flow-views-PCBR5GYS.js +2 -0
  22. package/dist/fonts/Cairo-OFL.txt +93 -0
  23. package/dist/fonts/Geist-OFL.txt +93 -0
  24. package/dist/fonts/Inter-OFL.txt +93 -0
  25. package/dist/fonts/SekyroCairo-Bold.woff2 +0 -0
  26. package/dist/fonts/SekyroCairo-Regular.woff2 +0 -0
  27. package/dist/fonts/SekyroCairo-SemiBold.woff2 +0 -0
  28. package/dist/fonts/SekyroGeist-Bold.woff2 +0 -0
  29. package/dist/fonts/SekyroGeist-SemiBold.woff2 +0 -0
  30. package/dist/fonts/SekyroInter-Medium.woff2 +0 -0
  31. package/dist/fonts/SekyroInter-Regular.woff2 +0 -0
  32. package/dist/fonts/SekyroInter-SemiBold.woff2 +0 -0
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.cts +5 -437
  35. package/dist/index.d.ts +5 -437
  36. package/dist/index.js +1 -1
  37. package/dist/portrait-capture-view-HYOEOAF4.js +2 -0
  38. package/dist/theme-BpOuzcWh.d.cts +456 -0
  39. package/dist/theme-BpOuzcWh.d.ts +456 -0
  40. package/dist/verification/index.cjs +2 -0
  41. package/dist/verification/index.d.cts +524 -0
  42. package/dist/verification/index.d.ts +524 -0
  43. package/dist/verification/index.js +2 -0
  44. package/dist/verification.css +560 -0
  45. package/package.json +20 -6
  46. package/sbom.cdx.json +5 -5
package/dist/index.d.ts CHANGED
@@ -1,445 +1,13 @@
1
- import * as react from 'react';
2
- import { ReactNode, RefObject } from 'react';
3
- import { CaptureErrorKind, GateHint, ReasonCode, CameraPermissionState, CameraFacing, Verification, CaptureError, CapturedArtifacts, VerificationResult, CaptureState, HostedBranding } from '@sekyro/web';
4
-
5
- /** A built-in tip (copy `capture.tips.<id>`, built-in icon). */
6
- type BuiltInTipId = "light" | "uncover" | "eyeLevel" | "straight";
7
- /** A host-provided tip. `id` is the React key; `icon` is decorative (rendered aria-hidden). */
8
- interface IntroTip {
9
- id: string;
10
- text: ReactNode;
11
- icon?: ReactNode;
12
- }
13
- /** The tips shown when the host passes none. */
14
- declare const DEFAULT_TIPS: readonly BuiltInTipId[];
15
-
16
- /**
17
- * Every string the component renders, keyed like the hosted message catalog
18
- * (`capture.*`, `fcv2.err.*`, `fcv3.*`, `reasons.*`, `errors.*`, `common.*`).
19
- * The built-in ar/fr/en dictionaries are complete; `strings` overrides are
20
- * `Partial<Strings>`.
21
- */
22
- interface Strings {
23
- "capture.start": string;
24
- "capture.recordAgain": string;
25
- "capture.switchCamera": string;
26
- "capture.preparing.title": string;
27
- "capture.checking": string;
28
- "capture.checkingHint": string;
29
- "capture.securityNote": string;
30
- "capture.cameraOff": string;
31
- "capture.previewAlt": string;
32
- "capture.retryCoaching.title": string;
33
- "capture.retryCoaching.light": string;
34
- "capture.retryCoaching.eyeLevel": string;
35
- "capture.retryCoaching.head": string;
36
- /**
37
- * Remaining-attempts line per CLDR plural category (`Intl.PluralRules`),
38
- * `{count}` = the locale-formatted number. `one`/`other` are required; the
39
- * other categories fall back to `other` where the locale never selects them.
40
- */
41
- "capture.attemptsRemaining.one": string;
42
- "capture.attemptsRemaining.other": string;
43
- "capture.attemptsRemaining.zero"?: string;
44
- "capture.attemptsRemaining.two"?: string;
45
- "capture.attemptsRemaining.few"?: string;
46
- "capture.attemptsRemaining.many"?: string;
47
- "common.retry": string;
48
- "fcv2.err.permission": string;
49
- "fcv2.err.notfound": string;
50
- "fcv2.err.inuse": string;
51
- "fcv2.err.insecure": string;
52
- "fcv2.err.unsupported": string;
53
- "fcv2.err.generic": string;
54
- "fcv3.no_face": string;
55
- "fcv3.come_closer": string;
56
- "fcv3.move_back": string;
57
- "fcv3.center_face": string;
58
- "fcv3.straighten": string;
59
- "fcv3.more_light": string;
60
- "fcv3.too_bright": string;
61
- "fcv3.hold_still": string;
62
- "fcv3.steady_camera": string;
63
- "reasons.no_face": string;
64
- "reasons.media_unreadable": string;
65
- "reasons.clip_too_short": string;
66
- "reasons.spoof_detected": string;
67
- "reasons.review_band": string;
68
- "reasons.nni_not_found": string;
69
- "reasons.nni_invalid": string;
70
- "reasons.registry_unavailable": string;
71
- "reasons.result_from_cache": string;
72
- "reasons.no_face_source": string;
73
- "reasons.no_face_reference": string;
74
- "reasons.low_quality_reference": string;
75
- "reasons.below_threshold": string;
76
- "reasons.side_missing": string;
77
- "reasons.mrz_checksum_failed": string;
78
- "reasons.unreadable": string;
79
- "reasons.expired_document": string;
80
- "reasons.authenticity_review": string;
81
- "reasons.registry_mismatch": string;
82
- "reasons.document_nni_mismatch": string;
83
- "reasons.otp_mismatch": string;
84
- "reasons.otp_expired": string;
85
- "reasons.otp_send_failed": string;
86
- "reasons.uncalibrated_capture_channel": string;
87
- "reasons.location_not_allowed": string;
88
- "reasons.anonymizer_blocked": string;
89
- "reasons.nationality_not_allowed": string;
90
- "reasons.document_type_not_accepted": string;
91
- "reasons.underage": string;
92
- "reasons.age_unverifiable": string;
93
- "reasons.name_mismatch": string;
94
- "reasons.birth_date_mismatch": string;
95
- "reasons.nationality_mismatch": string;
96
- "reasons.document_number_mismatch": string;
97
- "reasons.liveness_inconclusive": string;
98
- "reasons.match_inconclusive": string;
99
- "reasons.document_authenticity": string;
100
- "reasons.mobile_required": string;
101
- "reasons.capture_tampered": string;
102
- "reasons.device_velocity_exceeded": string;
103
- /** `device_cooldown` without a usable `retryAfter`. */
104
- "reasons.device_cooldown": string;
105
- /** `device_cooldown`, `{time}` = a relative time ("in 5 minutes"). */
106
- "cooldown.retryIn": string;
107
- /** `device_cooldown`, `{time}` = a clock time (with the date when not today). */
108
- "cooldown.retryAt": string;
109
- /** The model service is busy and the SDK retries by itself. */
110
- "capture.busy": string;
111
- "errors.inference_unavailable": string;
112
- "method.title": string;
113
- "method.description": string;
114
- "method.national_number": string;
115
- "method.document_photo": string;
116
- "errors.method_required": string;
117
- "errors.attestation_invalid": string;
118
- "errors.network_error": string;
119
- "errors.session_expired": string;
120
- "errors.nni_unbound": string;
121
- "capture.tips.title": string;
122
- "capture.tips.light": string;
123
- "capture.tips.uncover": string;
124
- "capture.tips.eyeLevel": string;
125
- "capture.tips.straight": string;
126
- /** Spoken by the pre-capture "Listen" button (voice key `capture.tips.summary`); says what the built-in tips say. */
127
- "capture.tips.summary": string;
128
- "capture.tips.listen": string;
129
- /** The Listen button's label while the summary plays. */
130
- "capture.tips.stop": string;
131
- "capture.permission.granted": string;
132
- "capture.permission.prompt": string;
133
- "capture.permission.denied": string;
134
- "capture.permission.unknown": string;
135
- "capture.cameraLabel": string;
136
- "capture.facing.user": string;
137
- "capture.facing.environment": string;
138
- "capture.voiceGuidance": string;
139
- "capture.preparing.hint": string;
140
- "capture.ready": string;
141
- "fcv2.err.models": string;
142
- }
143
- /** Every string key the component renders. */
144
- type StringKey = keyof Strings;
145
- declare const en: Strings;
1
+ import { S as Strings, a as SekyroLocale } from './theme-BpOuzcWh.js';
2
+ export { B as BuiltInTipId, D as DEFAULT_THEME, b as DEFAULT_TIPS, I as IntroContext, c as IntroTip, L as LivenessCapture, d as LivenessCaptureProps, e as LivenessCaptureSlots, f as LivenessNotice, N as NO_FACE_DEBOUNCE_MS, g as SekyroTheme, h as SekyroThemeColors, i as SekyroThemeProvider, j as SekyroThemeProviderProps, k as StringKey, V as VOICE_KEYS, l as VoiceClipMap, m as VoiceClipResolver, n as VoiceClipSource, o as VoiceControl, p as VoiceKey, q as VoiceOptions, r as attemptsRemainingText, s as brandingToTheme, t as captureErrorStringKey, u as en, v as hintStringKey, w as mergeThemes, x as reasonStringKey, y as retryAfterTime, z as themeToCssVars } from './theme-BpOuzcWh.js';
3
+ import 'react';
4
+ import '@sekyro/web';
146
5
 
147
6
  declare const ar: Strings;
148
7
 
149
8
  declare const fr: Strings;
150
9
 
151
- /** Locales with a built-in dictionary. */
152
- type SekyroLocale = "ar" | "fr" | "en";
153
-
154
- /** Gate hint code → the guidance line's string key. */
155
- declare function hintStringKey(hint: GateHint): StringKey;
156
- /** Camera / engine failure kind → its copy key. */
157
- declare function captureErrorStringKey(kind: CaptureErrorKind): StringKey;
158
- /**
159
- * Result reason → copy key. SDK-side failure reasons map onto the existing
160
- * error copy (`no_recorder` is the browser's missing recorder = unsupported;
161
- * `attestation` / `network` reuse the hosted error copy); backend reasons use
162
- * `reasons.*`. Returns `null` for a reason without built-in copy.
163
- */
164
- declare function reasonStringKey(reason: ReasonCode): StringKey | null;
165
- /**
166
- * When a device in cooldown may verify again (`device_cooldown` +
167
- * `retryAfter`), as the copy key and its `{time}`: within the hour a relative
168
- * time ("in 5 minutes", minutes rounded up) for `cooldown.retryIn`; later a
169
- * clock time — with the date when it is not today — for `cooldown.retryAt`.
170
- * `null` when `retryAfter` is missing, invalid or already past (use
171
- * `reasons.device_cooldown`). Locale digits and wording come from `Intl`.
172
- */
173
- declare function retryAfterTime(locale: SekyroLocale, retryAfter: string | undefined, now?: Date): {
174
- key: "cooldown.retryIn" | "cooldown.retryAt";
175
- time: string;
176
- } | null;
177
- /**
178
- * The remaining-attempts line for `count`, pluralized with the locale's CLDR
179
- * rules (`Intl.PluralRules`) and the locale's digits (`Intl.NumberFormat`) —
180
- * the same rendering an ICU `{count, plural, …}` message produces.
181
- */
182
- declare function attemptsRemainingText(dictionary: Strings, locale: SekyroLocale, count: number): string;
183
-
184
- /**
185
- * Keys that can be spoken: the engine's `fcv3.*` gate hints, plus
186
- * `capture.tips.summary` — the pre-capture "Listen to the instructions" summary
187
- * (played only on an explicit tap, never during capture).
188
- */
189
- type VoiceKey = "fcv3.no_face" | "fcv3.come_closer" | "fcv3.move_back" | "fcv3.center_face" | "fcv3.straighten" | "fcv3.more_light" | "fcv3.too_bright" | "fcv3.hold_still" | "fcv3.steady_camera" | "capture.tips.summary";
190
- /** Every {@link VoiceKey}, in a stable order (e.g. to build a clip map). */
191
- declare const VOICE_KEYS: readonly VoiceKey[];
192
-
193
- /** Resolve a voice clip URL; `null`/`undefined` = no clip (speech fallback applies). */
194
- type VoiceClipResolver = (key: VoiceKey, locale: SekyroLocale) => string | null | undefined;
195
- /**
196
- * Clip URLs per locale and key — e.g. the map a backend hands the SDK in the
197
- * session view. A new object identity is the change signal.
198
- */
199
- type VoiceClipMap = {
200
- readonly [L in SekyroLocale]?: {
201
- readonly [K in VoiceKey]?: string | null | undefined;
202
- } | undefined;
203
- };
204
- /** `voice.clips`: a resolver function or a `{ [locale]: { [voiceKey]: url } }` map. */
205
- type VoiceClipSource = VoiceClipResolver | VoiceClipMap;
206
-
207
- /** Voice-guidance options of `<LivenessCapture voice>`. */
208
- interface VoiceOptions {
209
- /** Initial state when the viewer has no stored preference. Default `true`. */
210
- defaultEnabled?: boolean;
211
- /**
212
- * Clip source; replaces the default. Either a resolver `(key, locale) → url | null`
213
- * or a map `{ [locale]: { [voiceKey]: url } }` (e.g. delivered by your backend;
214
- * pass a new object to change it). A key without a URL — or a resolver that
215
- * throws — means "no clip" (speech fallback applies).
216
- *
217
- * Default: in verification mode, the Sekyro AI clip set delivered with the
218
- * session (`https://assets.sekyro.ai` — allow it in your CSP `media-src`);
219
- * in capture-only mode, none (device voice only).
220
- */
221
- clips?: VoiceClipSource;
222
- /** Locales where the device voice (speechSynthesis) may speak when no clip plays. Default `true` (all). */
223
- speechFallback?: boolean | readonly SekyroLocale[];
224
- /** localStorage key of the viewer's preference; `null` = do not persist. Default `"sekyro.voiceGuidance"`. */
225
- storageKey?: string | null;
226
- }
227
- /** The shared voice state the intro switch, the stage chip and the slots read. */
228
- interface VoiceControl {
229
- /** Something can speak for this locale (a resolvable clip, or a usable device voice). `false` on the server and with `voice={false}`. */
230
- readonly supported: boolean;
231
- /** The viewer's choice (persisted under `storageKey`). */
232
- readonly enabled: boolean;
233
- /** Turn voice on / off; call it from a click (turning on unlocks audio on iOS). */
234
- setEnabled(next: boolean): void;
235
- /** Flip `enabled` (same gesture rule as `setEnabled`). */
236
- toggle(): void;
237
- }
238
-
239
- /**
240
- * Display debounce before the no-face copy replaces another hint: detector
241
- * blips flash "we can't see your face" while the face is clearly visible, so
242
- * switching TO no-face must persist this long first. Any other hint renders
243
- * immediately and cancels a pending no-face. Chrome only — never gate input.
244
- */
245
- declare const NO_FACE_DEBOUNCE_MS = 800;
246
- /** A host message shown above the pre-capture screen (`notice` prop). */
247
- interface LivenessNotice {
248
- /** `info` is a polite status; `warning` / `danger` are announced as alerts. */
249
- tone: "info" | "warning" | "danger";
250
- text: ReactNode;
251
- }
252
- /** What `slots.intro` gets besides `start`: the state the built-in screen renders from. */
253
- interface IntroContext {
254
- /**
255
- * Detector preload gate: Start should wait for `ready`; `failed` offers `retryAssets`.
256
- * Also `loading` while `autoStart="when-permitted"` waits for the first camera-permission answer.
257
- */
258
- assets: "loading" | "ready" | "failed";
259
- retryAssets: () => void;
260
- permission: CameraPermissionState;
261
- /** The camera `start` opens (and the in-stage switch flips). */
262
- facing: CameraFacing;
263
- setFacing: (facing: CameraFacing) => void;
264
- /** A front/back choice makes sense on this device. */
265
- canChooseFacing: boolean;
266
- voice: VoiceControl;
267
- }
268
- /** Render slots — partners inject their own chrome around and inside the stage. */
269
- interface LivenessCaptureSlots {
270
- /** Above the stage (title, step indicator). */
271
- header?: ReactNode;
272
- /** Below everything (security note, help link). */
273
- footer?: ReactNode;
274
- /**
275
- * Replaces the built-in pre-capture screen while the capture is idle.
276
- * `start` begins the attempt with `context.facing` and unlocks audio — call
277
- * it from the click handler (iOS needs the user gesture). `context` carries
278
- * the preload gate, permission, facing and voice state the built-in screen
279
- * renders from.
280
- */
281
- intro?: (start: () => void, context: IntroContext) => ReactNode;
282
- /**
283
- * Rendered inside the stage box above the ring (measurement overlays,
284
- * watermarks); receives the ref of the component-owned `<video>`.
285
- */
286
- stageOverlay?: (videoRef: RefObject<HTMLVideoElement | null>) => ReactNode;
287
- /**
288
- * Replaces the built-in voice chip in the stage's start corner; receives the
289
- * current hint code, the on-screen text, the string key behind it and the
290
- * shared voice state. The component keeps speaking the guidance itself —
291
- * pass `voice={false}` if this slot plays its own audio (a development build
292
- * warns when this slot is set and `voice` is left undefined).
293
- */
294
- voicePrompt?: (hint: GateHint | null, text: string, key: StringKey | null, voice: VoiceControl) => ReactNode;
295
- /** Replaces the default camera-error notice. `retry` starts a fresh attempt. */
296
- errorPanel?: (error: CaptureError, retry: () => void) => ReactNode;
297
- }
298
- /** Props of {@link LivenessCapture}. */
299
- interface LivenessCaptureProps {
300
- /** From `createVerification()`. Absent → capture-only mode. */
301
- verification?: Verification;
302
- /** Built-in dictionary to use (`ar` | `fr` | `en`). */
303
- locale: SekyroLocale;
304
- /** Text direction; defaults to `rtl` for `ar`, `ltr` otherwise. */
305
- dir?: "ltr" | "rtl";
306
- /** Copy overrides merged on top of the built-in dictionary for `locale`. */
307
- strings?: Partial<Strings>;
308
- /** Render slots around / inside the stage. */
309
- slots?: LivenessCaptureSlots;
310
- /**
311
- * Start the camera instead of showing the pre-capture screen — at most once
312
- * per mount, once the detector preload is ready. `true` arms it (a host may
313
- * flip it later, once its own preconditions are met); `"when-permitted"`
314
- * arms it only while the camera permission is already `granted`. While armed
315
- * but not ready the screen shows its loader (or the retry on failure).
316
- *
317
- * An auto-start has no user gesture, so iOS keeps audio locked until the
318
- * person's first activating touch (`touchend`), click or key press (not
319
- * Escape) anywhere inside the component; the voice unlocks then (clips that
320
- * were due before stay silent).
321
- */
322
- autoStart?: boolean | "when-permitted";
323
- /** Host message above the pre-capture screen (or `slots.intro`); hidden once capture starts. */
324
- notice?: ReactNode | LivenessNotice;
325
- /**
326
- * Disable the built-in Start (e.g. a busy cooldown); pair with `startLabel`.
327
- * Gates only the pre-capture Start — not the error Retry, "record again" or
328
- * the retake button (gate those flows yourself, e.g. via `slots.errorPanel`).
329
- */
330
- startDisabled?: boolean;
331
- /** Built-in Start label; default `capture.start`. */
332
- startLabel?: ReactNode;
333
- /**
334
- * Tips on the pre-capture screen; default {@link DEFAULT_TIPS}; `false` hides the card.
335
- * The "Listen to the instructions" button (spoken `capture.tips.summary`)
336
- * shows with the built-in tips only — or with any tips when `voice.clips`
337
- * supplies a `capture.tips.summary` clip for the locale.
338
- */
339
- tips?: false | ReadonlyArray<BuiltInTipId | IntroTip>;
340
- /** Camera the attempt opens with; default `"user"` (front). */
341
- defaultFacing?: CameraFacing;
342
- /**
343
- * Voice guidance (on by default). Clips: `voice.clips` when given; else, in
344
- * verification mode, the Sekyro AI clip set delivered with the session (served
345
- * from `https://assets.sekyro.ai` — allow it in your CSP `media-src`); else
346
- * none. The device voice covers any key without a clip.
347
- * `false` = no speech, no voice switch, no stage chip, no "Listen" button.
348
- */
349
- voice?: false | VoiceOptions;
350
- /** Telemetry: once per change of the displayed, spoken-able (`fcv3.*`) guidance key. */
351
- onGuidance?: (key: StringKey) => void;
352
- /** Fires BEFORE any upload, with the engine's artifacts. */
353
- onCaptured?: (artifacts: CapturedArtifacts) => void;
354
- /** Verification mode only: the verdict for this session / capture. */
355
- onResult?: (result: VerificationResult) => void;
356
- /** Camera / engine failure. */
357
- onError?: (error: CaptureError) => void;
358
- /** Every capture-state transition (`starting` … `done`), for host chrome. */
359
- onStateChange?: (state: CaptureState) => void;
360
- /** Base URL of the detector assets (tasks-vision wasm + tflite); default `/models-v3`. */
361
- assetBaseUrl?: string;
362
- /** Extra class on the root element. */
363
- className?: string;
364
- }
365
- /**
366
- * Liveness capture UI over `@sekyro/web`: the mirrored camera stage with the
367
- * circular guide / progress ring / guidance line, the Start intro, the frozen
368
- * still + "checking" state, and the retry / error surfaces. Wrap in
369
- * {@link SekyroThemeProvider} (or set the `--sekyro-*` variables yourself) and
370
- * import `@sekyro/react/styles.css` once.
371
- */
372
- declare function LivenessCapture({ verification, locale, dir, strings, slots, autoStart, notice, startDisabled, startLabel, tips, defaultFacing, voice: voiceOption, onGuidance, onCaptured, onResult, onError, onStateChange, assetBaseUrl, className, }: LivenessCaptureProps): react.JSX.Element;
373
-
374
- /** Color tokens. Every value is any valid CSS `<color>`. */
375
- interface SekyroThemeColors {
376
- /** Primary action surface (buttons, filled ring ticks). */
377
- brand: string;
378
- /** Text on `brand`. */
379
- brandFg: string;
380
- /** Primary text; also the capture-stage scrim. */
381
- fg: string;
382
- /** Secondary text (hints, notes) — never essential instructions. */
383
- fgMuted: string;
384
- /** Page background behind the component. */
385
- bg: string;
386
- /** Card / panel surface the component sits on; also the text on the scrim. */
387
- surface: string;
388
- /** Focus ring. */
389
- ring: string;
390
- /** Error accents (notice border / tint). */
391
- danger: string;
392
- /** Gate-locked ring + success accents. */
393
- success: string;
394
- /** Draining-ring and retry-notice accents. */
395
- warning: string;
396
- }
397
- /** Theme shape accepted by {@link SekyroThemeProvider}. Partial: unset tokens keep the defaults. */
398
- interface SekyroTheme {
399
- /** Color tokens to override. */
400
- colors?: Partial<SekyroThemeColors>;
401
- /** Corner radius of panels and buttons (CSS length). */
402
- radius?: string;
403
- /** Font stack for all component text. */
404
- fontFamily?: string;
405
- }
406
- /**
407
- * Default theme. Every text pairing passes WCAG AAA (7:1) — fg/surface,
408
- * fg/bg, fgMuted/surface, brandFg/brand, surface/fg (the on-scrim guidance) —
409
- * and every UI accent passes 3:1 on surface (see test/contrast.test.ts).
410
- */
411
- declare const DEFAULT_THEME: Required<SekyroTheme> & {
412
- colors: SekyroThemeColors;
413
- };
414
- /** The CSS custom properties a theme resolves to (defaults filled in). */
415
- declare function themeToCssVars(theme?: SekyroTheme): Record<string, string>;
416
- /**
417
- * Map the session's org / app branding (`HostedSessionView.branding`, set in
418
- * the Sekyro dashboard) onto a {@link SekyroTheme}. Each colour maps to the
419
- * theme key of the same name and the focus ring follows `brand`. Values that
420
- * are not `#rrggbb` are ignored. Combine with your own theme through
421
- * {@link mergeThemes} — pass yours LAST so it wins:
422
- * `mergeThemes(brandingToTheme(view.branding), myTheme)`.
423
- */
424
- declare function brandingToTheme(branding: HostedBranding | undefined): SekyroTheme;
425
- /** Merge themes left to right: a later theme wins per token (colours merge per key). */
426
- declare function mergeThemes(...themes: (SekyroTheme | undefined)[]): SekyroTheme;
427
- /** Props of {@link SekyroThemeProvider}. */
428
- interface SekyroThemeProviderProps {
429
- /** Partial theme; unset tokens keep the {@link DEFAULT_THEME} values. */
430
- theme?: SekyroTheme;
431
- /** The subtree that reads the tokens. */
432
- children: ReactNode;
433
- /** Extra class on the wrapper (layout hooks for the host). */
434
- className?: string;
435
- }
436
- /**
437
- * Writes the theme's CSS variables on a wrapper `<div class="sekyro-root">`.
438
- * Nest inside your own layout; import `@sekyro/react/styles.css` once.
439
- */
440
- declare function SekyroThemeProvider({ theme, children, className }: SekyroThemeProviderProps): react.JSX.Element;
441
-
442
10
  /** The complete dictionary for `locale` with `overrides` merged on top. */
443
11
  declare function resolveStrings(locale: SekyroLocale, overrides?: Partial<Strings>): Strings;
444
12
 
445
- export { type BuiltInTipId, DEFAULT_THEME, DEFAULT_TIPS, type IntroContext, type IntroTip, LivenessCapture, type LivenessCaptureProps, type LivenessCaptureSlots, type LivenessNotice, NO_FACE_DEBOUNCE_MS, type SekyroLocale, type SekyroTheme, type SekyroThemeColors, SekyroThemeProvider, type SekyroThemeProviderProps, type StringKey, type Strings, VOICE_KEYS, type VoiceClipMap, type VoiceClipResolver, type VoiceClipSource, type VoiceControl, type VoiceKey, type VoiceOptions, ar, attemptsRemainingText, brandingToTheme, captureErrorStringKey, en, fr, hintStringKey, mergeThemes, reasonStringKey, resolveStrings, retryAfterTime, themeToCssVars };
13
+ export { SekyroLocale, Strings, ar, fr, resolveStrings };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var Zr=Object.defineProperty;var n=(e,t)=>Zr(e,"name",{value:t,configurable:!0});import{isValidElement as Yn,useCallback as We,useEffect as ce,useMemo as _e,useRef as ue,useState as Mr}from"react";import{forwardRef as Xr}from"react";import{jsx as Qr}from"react/jsx-runtime";var M=Xr(n(function({kind:t="primary",full:r=!1,className:s,type:o,...i},c){let u=["sekyro-btn",`sekyro-btn--${t}`];return r&&u.push("sekyro-btn--full"),s!==void 0&&u.push(s),Qr("button",{ref:c,type:o??"button",className:u.join(" "),...i})},"Button"));import{jsx as Re,jsxs as Mt}from"react/jsx-runtime";var Jr=Array.from({length:56},(e,t)=>{let r=t/56*2*Math.PI-Math.PI/2,s=Math.cos(r),o=Math.sin(r);return{id:`tick-${t}`,frac:t/55,x1:150+108*s,y1:150+108*o,x2:150+138*s,y2:150+138*o,style:{transitionDelay:`${t*6}ms`}}});function en(e,t,r,s){return r?"var(--sekyro-color-success)":e?s?"color-mix(in srgb, var(--sekyro-color-warning) 75%, transparent)":t<.33?"color-mix(in srgb, var(--sekyro-color-brand) 55%, transparent)":t<.66?"color-mix(in srgb, var(--sekyro-color-brand) 80%, transparent)":"var(--sekyro-color-brand)":"color-mix(in srgb, var(--sekyro-color-surface) 32%, transparent)"}n(en,"tickColor");var tn="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function zt({progress:e,phase:t,draining:r=!1}){let s=Math.min(1,Math.max(0,e)),o=Math.round(s*56),i=t==="checking",c=t==="recording",u=t==="frozen",d=i||u,C=i||c||u,T=t==="locked"||C,x=r&&!T;return Mt("svg",{"aria-hidden":"true",viewBox:"0 0 300 300",preserveAspectRatio:"xMidYMid meet",className:"sekyro-stage__arc","data-testid":"sekyro-capture-arc","data-phase":t,"data-filled":o,"data-recording":c?"":void 0,"data-draining":x?"":void 0,children:[Re("path",{fillRule:"evenodd",d:tn,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":d?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),Mt("g",{className:t==="locked"?"sekyro-capture-settle":void 0,children:[Re("g",{className:d?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:Jr.map((p,l)=>Re("line",{x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,stroke:en(l<o,p.frac,T,x),strokeWidth:3,strokeLinecap:"round",style:p.style,className:"sekyro-arc__tick"},p.id))}),Re("g",{className:t==="seeking"?"sekyro-capture-breathe":void 0,children:Re("circle",{cx:150,cy:150,r:100,fill:"none",stroke:T?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:T?3.5:2.5,className:C?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}n(zt,"CaptureArc");import{createContext as rn,useContext as nn}from"react";var pe={"capture.start":"Start camera","capture.recordAgain":"Start a new attempt","capture.switchCamera":"Switch camera","capture.preparing.title":"Preparing secure capture…","capture.checking":"We're checking your identity…","capture.checkingHint":"This usually takes a few seconds — keep this page open","capture.securityNote":"Your images are encrypted and used only for this verification","capture.cameraOff":"Camera off","capture.previewAlt":"Preview of the captured image of your face","capture.retryCoaching.title":"That attempt didn't work — a few adjustments will help:","capture.retryCoaching.light":"Find good lighting — light on your face, not behind you","capture.retryCoaching.eyeLevel":"Hold your phone at eye level","capture.retryCoaching.head":"Look straight at the camera and keep your head upright","capture.attemptsRemaining.one":"{count} attempt remaining","capture.attemptsRemaining.other":"{count} attempts remaining","common.retry":"Try again","fcv2.err.permission":"Allow camera access in your browser settings (the camera icon in the address bar), then try again","fcv2.err.notfound":"No camera detected — connect or enable a camera, then try again","fcv2.err.inuse":"Another app is using the camera — close it, then try again","fcv2.err.insecure":"The camera needs a secure connection (HTTPS) — reopen this page over HTTPS","fcv2.err.unsupported":"Your browser cannot capture in a supported format — open this page in a recent browser such as Chrome or Safari","fcv2.err.generic":"The camera is unavailable — try again, or contact support if it keeps failing","fcv3.no_face":"We can't see your face — hold the phone in front of you","fcv3.come_closer":"Bring the phone a little closer","fcv3.move_back":"Move the phone a little farther away","fcv3.center_face":"Center your face in the circle","fcv3.straighten":"Hold your head straight","fcv3.more_light":"Find a brighter spot — light your face","fcv3.too_bright":"Too much light — move out of direct light","fcv3.hold_still":"Perfect — hold still","fcv3.steady_camera":"Hold the phone steady","reasons.no_face":"No face could be detected during the check","reasons.media_unreadable":"The submitted capture could not be read","reasons.clip_too_short":"The capture was too short","reasons.spoof_detected":"The liveness check could not confirm a live person in front of the camera","reasons.review_band":"The automatic check was not conclusive, so it was sent to human review","reasons.nni_not_found":"The national identification number was not found in the civil registry","reasons.nni_invalid":"The national identification number is not a valid 10-digit NNI","reasons.registry_unavailable":"The civil registry could not be reached to confirm the NNI","reasons.result_from_cache":"The registry check was confirmed from a recent copy of the registry","reasons.no_face_source":"No face could be detected in the selfie photo","reasons.no_face_reference":"No reference photo was available to compare your selfie against — the requester needs to resolve this, so retaking your selfie will not help","reasons.low_quality_reference":"The reference photo on file was not clear enough to compare against","reasons.below_threshold":"The selfie did not match the photo on the identity document closely enough","reasons.side_missing":"One side of the identity document was not submitted","reasons.mrz_checksum_failed":"The machine-readable zone of the document could not be validated","reasons.unreadable":"The document photo was not clear enough to read","reasons.expired_document":"The identity document has expired","reasons.authenticity_review":"The document was sent to human review to confirm its authenticity","reasons.registry_mismatch":"The document's details did not match the civil registry — a reviewer will check","reasons.document_nni_mismatch":"This document belongs to a different person than the one this verification was created for","reasons.otp_mismatch":"The verification code did not match the one we sent","reasons.otp_expired":"The verification code expired before it was entered","reasons.otp_send_failed":"We could not send a verification code to your phone","reasons.uncalibrated_capture_channel":"Desktop/webcam captures are not yet auto-decided — your verification went to human review","reasons.location_not_allowed":"Verification isn't available in your region.","reasons.anonymizer_blocked":"Turn off your VPN or proxy, then open the link again.","reasons.nationality_not_allowed":"This service can't verify this document. Contact the organization for other options.","reasons.document_type_not_accepted":"This type of document isn't accepted. Choose another document.","reasons.underage":"You don't meet the minimum age for this service.","reasons.age_unverifiable":"We couldn't read your date of birth. Take a clearer photo of your document.","reasons.name_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.birth_date_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.nationality_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.document_number_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.liveness_inconclusive":"Let's try again: face a light source and hold still.","reasons.match_inconclusive":"We couldn't confirm it's you. Try again in good light, without glasses.","reasons.document_authenticity":"Use the original card, not a photo or a copy, and avoid reflections.","reasons.mobile_required":"Continue on your phone to take the selfie.","reasons.capture_tampered":"We couldn't verify this capture. Use your phone's built-in camera, without screen recording or camera apps.","reasons.device_velocity_exceeded":"This device can't be used for another verification right now. Contact the organization.","reasons.device_cooldown":"Too many attempts. Try again later.","cooldown.retryIn":"Too many attempts. Try again {time}.","cooldown.retryAt":"Too many attempts. Try again after {time}.","capture.busy":"Our service is busy. Trying again…","errors.inference_unavailable":"Try again in a moment.","method.title":"How do you want to verify?","method.description":"Choose one option to continue","method.national_number":"Enter my national number (NNI)","method.document_photo":"Photo of my document","errors.method_required":"Choose how you want to verify, then continue","errors.attestation_invalid":"We could not confirm this browser session is genuine — reload the page and try again","errors.network_error":"We could not reach the verification service — check your internet connection and try again","errors.session_expired":"This verification session has expired — ask the organisation that sent you here for a new link","errors.nni_unbound":"This link was created without your national ID number — ask the requester for a new link","capture.tips.title":"For a successful check:","capture.tips.light":"Face a light source — avoid strong light behind you","capture.tips.uncover":"Uncover your face — no glasses, mask or hand in front of it","capture.tips.eyeLevel":"Hold your phone at eye level","capture.tips.straight":"Look straight at the camera and keep still","capture.tips.summary":"Stand in a well-lit area. Uncover your face — no glasses, no mask. Once the camera starts, hold your phone at eye level, look straight at the camera and keep still.","capture.tips.listen":"Listen to the instructions","capture.tips.stop":"Stop","capture.permission.granted":"Camera access allowed","capture.permission.prompt":"Your browser will ask to use the camera — choose Allow","capture.permission.denied":"Camera access is blocked — allow it in your browser settings (the camera icon in the address bar), then reload this page","capture.permission.unknown":"We'll ask to use your camera when you start","capture.cameraLabel":"Camera","capture.facing.user":"Front camera","capture.facing.environment":"Back camera","capture.voiceGuidance":"Voice guidance","capture.preparing.hint":"Setting up on-device face detection — this can take a moment on a slow connection","capture.ready":"Ready — start when you are","fcv2.err.models":"The face-detection models could not be loaded — check your connection and try again"};var Ue={"capture.start":"تشغيل الكاميرا","capture.recordAgain":"ابدأ محاولة جديدة","capture.switchCamera":"تبديل الكاميرا","capture.preparing.title":"جارٍ تجهيز الالتقاط الآمن…","capture.checking":"نتحقق من هويتك…","capture.checkingHint":"يستغرق هذا عادةً بضع ثوانٍ — أبقِ هذه الصفحة مفتوحة","capture.securityNote":"تُشفَّر لقطاتك وتُستخدم فقط لهذا التحقق","capture.cameraOff":"الكاميرا مطفأة","capture.previewAlt":"معاينة الصورة الملتقطة لوجهك","capture.retryCoaching.title":"لم تنجح هذه المحاولة — بعض التعديلات ستساعد:","capture.retryCoaching.light":"اختر مكانًا جيد الإضاءة — الضوء على وجهك لا خلفك","capture.retryCoaching.eyeLevel":"أمسك هاتفك بمستوى العينين","capture.retryCoaching.head":"انظر مباشرة إلى الكاميرا وأبقِ رأسك مستقيمًا","capture.attemptsRemaining.zero":"لم تتبقَّ أي محاولة","capture.attemptsRemaining.one":"تبقّت محاولة واحدة","capture.attemptsRemaining.two":"تبقّت محاولتان","capture.attemptsRemaining.few":"تبقّت {count} محاولات","capture.attemptsRemaining.many":"تبقّت {count} محاولة","capture.attemptsRemaining.other":"تبقّت {count} محاولة","common.retry":"أعد المحاولة","fcv2.err.permission":"اسمح بالوصول إلى الكاميرا من إعدادات المتصفح (أيقونة الكاميرا في شريط العنوان) ثم أعد المحاولة","fcv2.err.notfound":"لم يتم العثور على كاميرا — وصِّل كاميرا أو فعِّلها ثم أعد المحاولة","fcv2.err.inuse":"تطبيق آخر يستخدم الكاميرا — أغلقه ثم أعد المحاولة","fcv2.err.insecure":"تتطلب الكاميرا اتصالًا آمنًا (HTTPS) — افتح هذه الصفحة عبر HTTPS","fcv2.err.unsupported":"متصفحك لا يستطيع الالتقاط بصيغة مدعومة — افتح هذه الصفحة في متصفح حديث مثل كروم أو سفاري","fcv2.err.generic":"الكاميرا غير متاحة — أعد المحاولة، وتواصل مع الدعم إذا استمرت المشكلة","fcv3.no_face":"لا نرى وجهك — أمسك الهاتف أمامك","fcv3.come_closer":"قرّب الهاتف قليلًا","fcv3.move_back":"أبعد الهاتف قليلًا","fcv3.center_face":"ضع وجهك في منتصف الدائرة","fcv3.straighten":"أبقِ رأسك مستقيمًا","fcv3.more_light":"انتقل إلى مكان أكثر إضاءة — أضئ وجهك","fcv3.too_bright":"الإضاءة قوية جدًا — تجنّب الضوء المباشر على وجهك","fcv3.hold_still":"ممتاز — لا تتحرك","fcv3.steady_camera":"أمسك الهاتف بثبات","reasons.no_face":"تعذّر اكتشاف أي وجه أثناء التحقق","reasons.media_unreadable":"تعذّرت قراءة اللقطة المُرسلة","reasons.clip_too_short":"كانت اللقطة أقصر من اللازم","reasons.spoof_detected":"لم يتمكن فحص الحضور الحي من تأكيد وجود شخص حقيقي أمام الكاميرا","reasons.review_band":"لم يكن الفحص التلقائي حاسمًا، لذا أُحيل إلى مراجعة بشرية","reasons.nni_not_found":"لم يُعثر على الرقم الوطني في سجل الحالة المدنية","reasons.nni_invalid":"الرقم الوطني ليس رقمًا صالحًا مكوّنًا من 10 أرقام","reasons.registry_unavailable":"تعذّر الوصول إلى سجل الحالة المدنية لتأكيد الرقم الوطني","reasons.result_from_cache":"أُكِّد فحص السجل استنادًا إلى نسخة حديثة من السجل","reasons.no_face_source":"تعذّر اكتشاف وجه في الصورة الذاتية","reasons.no_face_reference":"لم تتوفّر صورة مرجعية لمقارنة صورتك الذاتية بها — على الجهة الطالبة معالجة ذلك، وإعادة التقاط صورتك الذاتية لن تُجدي","reasons.low_quality_reference":"الصورة المرجعية المحفوظة لم تكن واضحة بما يكفي للمقارنة","reasons.below_threshold":"الصورة الذاتية لم تطابق صورة وثيقة الهوية بدرجة كافية","reasons.side_missing":"أحد وجهي وثيقة الهوية لم يُرسل","reasons.mrz_checksum_failed":"تعذّر التحقق من منطقة القراءة الآلية في الوثيقة","reasons.unreadable":"صورة الوثيقة لم تكن واضحة بما يكفي للقراءة","reasons.expired_document":"انتهت صلاحية وثيقة الهوية","reasons.authenticity_review":"أُحيلت الوثيقة إلى مراجعة بشرية للتأكد من صحتها","reasons.registry_mismatch":"بيانات الوثيقة لا تطابق السجل المدني — سيتحقق منها مراجع","reasons.document_nni_mismatch":"هذه الوثيقة تخص شخصًا آخر غير الشخص الذي أُنشئ له هذا التحقق","reasons.otp_mismatch":"رمز التحقّق لا يطابق الرمز الذي أرسلناه","reasons.otp_expired":"انتهت صلاحية رمز التحقّق قبل إدخاله","reasons.otp_send_failed":"تعذّر إرسال رمز التحقّق إلى هاتفك","reasons.uncalibrated_capture_channel":"جودة الكاميرا المكتبية غير معايَرة بعد — أُحيل تحققك إلى مراجعة بشرية","reasons.location_not_allowed":"التحقق غير متاح في منطقتك.","reasons.anonymizer_blocked":"أوقف تشغيل VPN أو الوكيل ثم افتح الرابط مجددًا.","reasons.nationality_not_allowed":"لا يمكن لهذه الخدمة التحقق من هذه الوثيقة. تواصل مع الجهة لمعرفة الخيارات الأخرى.","reasons.document_type_not_accepted":"هذا النوع من الوثائق غير مقبول. اختر وثيقة أخرى.","reasons.underage":"لا تستوفي الحد الأدنى للسن لهذه الخدمة.","reasons.age_unverifiable":"تعذّرت قراءة تاريخ ميلادك. التقط صورة أوضح لوثيقتك.","reasons.name_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.birth_date_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.nationality_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.document_number_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.liveness_inconclusive":"لنحاول مجددًا: اجعل وجهك مقابل مصدر ضوء وابقَ ثابتًا.","reasons.match_inconclusive":"لم نتمكّن من التأكد من أنك أنت. حاول مجددًا في إضاءة جيدة ومن دون نظارات.","reasons.document_authenticity":"استخدم البطاقة الأصلية، لا صورة لها ولا نسخة منها، وتجنّب الانعكاسات.","reasons.mobile_required":"تابع على هاتفك لالتقاط صورة لوجهك.","reasons.capture_tampered":"تعذّر التحقق من هذا الالتقاط. استخدم الكاميرا المدمجة في هاتفك، دون تسجيل الشاشة أو تطبيقات الكاميرا.","reasons.device_velocity_exceeded":"لا يمكن استخدام هذا الجهاز لعملية تحقق أخرى حاليًا. تواصل مع الجهة.","reasons.device_cooldown":"محاولات كثيرة. حاول مجددًا لاحقًا.","cooldown.retryIn":"محاولات كثيرة. حاول مجددًا {time}.","cooldown.retryAt":"محاولات كثيرة. حاول مجددًا بعد {time}.","capture.busy":"خدمتنا مشغولة حاليًا. نعيد المحاولة…","errors.inference_unavailable":"حاول مجددًا بعد لحظات.","method.title":"كيف تريد التحقق من هويتك؟","method.description":"اختر إحدى الطريقتين للمتابعة","method.national_number":"إدخال رقمي الوطني (NNI)","method.document_photo":"تصوير وثيقتي","errors.method_required":"اختر طريقة التحقق، ثم تابع","errors.attestation_invalid":"تعذّر التأكد من سلامة جلسة المتصفح — أعد تحميل الصفحة وحاول مجددًا","errors.network_error":"تعذّر الوصول إلى خدمة التحقق — تحقق من اتصالك بالإنترنت وأعد المحاولة","errors.session_expired":"انتهت صلاحية جلسة التحقق هذه — اطلب رابطًا جديدًا من الجهة التي أرسلتك إلى هنا","errors.nni_unbound":"أُنشئ هذا الرابط دون رقمك الوطني للتعريف — اطلب رابطًا جديدًا من الجهة الطالبة","capture.tips.title":"لتحقق ناجح:","capture.tips.light":"اجعل الضوء أمام وجهك — تجنّب الإضاءة القوية خلفك","capture.tips.uncover":"اكشف وجهك — بلا نظارات أو كمامة أو يد أمامه","capture.tips.eyeLevel":"أمسك هاتفك بمستوى العينين","capture.tips.straight":"انظر مباشرة إلى الكاميرا وابقَ ثابتًا","capture.tips.summary":"اختر مكانًا جيد الإضاءة. اكشف وجهك — بلا نظارات أو كمامة. بعد تشغيل الكاميرا، أمسك هاتفك بمستوى العينين، وانظر مباشرة إلى الكاميرا وابقَ ثابتًا.","capture.tips.listen":"استمع إلى التعليمات","capture.tips.stop":"إيقاف","capture.permission.granted":"تم السماح بالوصول إلى الكاميرا","capture.permission.prompt":"سيطلب متصفحك استخدام الكاميرا — اختر «السماح»","capture.permission.denied":"الوصول إلى الكاميرا محظور — اسمح به من إعدادات المتصفح (رمز الكاميرا في شريط العنوان)، ثم أعد تحميل الصفحة","capture.permission.unknown":"سنطلب استخدام الكاميرا عند البدء","capture.cameraLabel":"الكاميرا","capture.facing.user":"الكاميرا الأمامية","capture.facing.environment":"الكاميرا الخلفية","capture.voiceGuidance":"الإرشاد الصوتي","capture.preparing.hint":"يجري إعداد كشف الوجه على جهازك — قد يستغرق ذلك لحظة على اتصال بطيء","capture.ready":"جاهز — ابدأ عندما تكون مستعدًا","fcv2.err.models":"تعذّر تحميل نماذج التعرف على الوجه — تحقق من اتصالك ثم أعد المحاولة"};var Be={"capture.start":"Démarrer la caméra","capture.recordAgain":"Commencer une nouvelle tentative","capture.switchCamera":"Changer de caméra","capture.preparing.title":"Préparation de la capture sécurisée…","capture.checking":"Nous vérifions votre identité…","capture.checkingHint":"Cela prend généralement quelques secondes — gardez cette page ouverte","capture.securityNote":"Vos images sont chiffrées et utilisées uniquement pour cette vérification","capture.cameraOff":"Caméra éteinte","capture.previewAlt":"Aperçu de l’image capturée de votre visage","capture.retryCoaching.title":"Cette tentative n'a pas abouti — quelques ajustements vous aideront :","capture.retryCoaching.light":"Placez-vous dans un endroit bien éclairé — lumière sur le visage, pas derrière vous","capture.retryCoaching.eyeLevel":"Tenez votre téléphone à hauteur des yeux","capture.retryCoaching.head":"Regardez droit vers la caméra, la tête bien droite","capture.attemptsRemaining.one":"{count} tentative restante","capture.attemptsRemaining.other":"{count} tentatives restantes","common.retry":"Réessayer","fcv2.err.permission":"Autorisez la caméra dans les réglages du navigateur (icône caméra dans la barre d’adresse), puis réessayez","fcv2.err.notfound":"Aucune caméra détectée — branchez ou activez une caméra, puis réessayez","fcv2.err.inuse":"La caméra est utilisée par une autre application — fermez-la, puis réessayez","fcv2.err.insecure":"La caméra nécessite une connexion sécurisée (HTTPS) — rouvrez cette page en HTTPS","fcv2.err.unsupported":"Votre navigateur ne prend pas en charge un format de capture compatible — ouvrez cette page dans un navigateur récent comme Chrome ou Safari","fcv2.err.generic":"Caméra indisponible — réessayez, ou contactez le support si le problème persiste","fcv3.no_face":"Nous ne voyons pas votre visage — tenez le téléphone devant vous","fcv3.come_closer":"Rapprochez un peu le téléphone","fcv3.move_back":"Éloignez un peu le téléphone","fcv3.center_face":"Centrez votre visage dans le cercle","fcv3.straighten":"Tenez la tête droite","fcv3.more_light":"Cherchez un endroit plus lumineux — éclairez votre visage","fcv3.too_bright":"Trop de lumière — évitez la lumière directe sur le visage","fcv3.hold_still":"Parfait — ne bougez plus","fcv3.steady_camera":"Tenez le téléphone stable","reasons.no_face":"Aucun visage n’a pu être détecté pendant la vérification","reasons.media_unreadable":"La capture envoyée n’a pas pu être lue","reasons.clip_too_short":"La capture était trop courte","reasons.spoof_detected":"Le contrôle de présence n'a pas pu confirmer la présence d'une personne réelle devant la caméra","reasons.review_band":"Le contrôle automatique n'a pas été concluant, il a donc été transmis à un examen humain","reasons.nni_not_found":"Le numéro national d'identification n'a pas été trouvé dans le registre d'état civil","reasons.nni_invalid":"Le numéro national d'identification n'est pas un NNI valide à 10 chiffres","reasons.registry_unavailable":"Le registre d'état civil n'a pas pu être joint pour confirmer le NNI","reasons.result_from_cache":"Le contrôle du registre a été confirmé à partir d'une copie récente du registre","reasons.no_face_source":"Aucun visage n'a pu être détecté sur la photo selfie","reasons.no_face_reference":"Aucune photo de référence n'était disponible pour comparer votre selfie — c'est au demandeur de le résoudre, reprendre votre selfie n'y changera rien","reasons.low_quality_reference":"La photo de référence enregistrée n'était pas assez nette pour la comparaison","reasons.below_threshold":"Le selfie ne correspondait pas suffisamment à la photo de la pièce d'identité","reasons.side_missing":"Un côté de la pièce d'identité n'a pas été envoyé","reasons.mrz_checksum_failed":"La zone de lecture automatique du document n'a pas pu être validée","reasons.unreadable":"La photo du document n'était pas assez nette pour être lue","reasons.expired_document":"La pièce d'identité a expiré","reasons.authenticity_review":"Le document a été transmis à un examen humain pour confirmer son authenticité","reasons.registry_mismatch":"Les informations du document ne correspondent pas au registre civil — un examinateur va vérifier","reasons.document_nni_mismatch":"Ce document appartient à une autre personne que celle pour qui cette vérification a été créée","reasons.otp_mismatch":"Le code de vérification ne correspond pas à celui que nous avons envoyé","reasons.otp_expired":"Le code de vérification a expiré avant d'être saisi","reasons.otp_send_failed":"Nous n'avons pas pu envoyer de code de vérification à votre téléphone","reasons.uncalibrated_capture_channel":"Les captures webcam ne sont pas encore décidées automatiquement — votre vérification part en revue humaine","reasons.location_not_allowed":"La vérification n'est pas disponible dans votre région.","reasons.anonymizer_blocked":"Désactivez votre VPN ou proxy, puis rouvrez le lien.","reasons.nationality_not_allowed":"Ce service ne peut pas vérifier ce document. Contactez l'organisation pour d'autres options.","reasons.document_type_not_accepted":"Ce type de document n'est pas accepté. Choisissez un autre document.","reasons.underage":"Vous n'avez pas l'âge minimum requis pour ce service.","reasons.age_unverifiable":"Nous n'avons pas pu lire votre date de naissance. Prenez une photo plus nette de votre document.","reasons.name_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.birth_date_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.nationality_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.document_number_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.liveness_inconclusive":"Réessayons : placez-vous face à une source de lumière et restez immobile.","reasons.match_inconclusive":"Nous n'avons pas pu confirmer qu'il s'agit bien de vous. Réessayez dans un endroit bien éclairé, sans lunettes.","reasons.document_authenticity":"Utilisez la carte originale, pas une photo ni une copie, et évitez les reflets.","reasons.mobile_required":"Continuez sur votre téléphone pour prendre le selfie.","reasons.capture_tampered":"Nous n'avons pas pu vérifier cette capture. Utilisez l'appareil photo intégré de votre téléphone, sans enregistrement d'écran ni application de caméra.","reasons.device_velocity_exceeded":"Cet appareil ne peut pas servir à une autre vérification pour le moment. Contactez l'organisation.","reasons.device_cooldown":"Trop de tentatives. Réessayez plus tard.","cooldown.retryIn":"Trop de tentatives. Réessayez {time}.","cooldown.retryAt":"Trop de tentatives. Réessayez à partir de {time}.","capture.busy":"Notre service est très sollicité. Nouvel essai en cours…","errors.inference_unavailable":"Réessayez dans un instant.","method.title":"Comment souhaitez-vous vérifier votre identité ?","method.description":"Choisissez une option pour continuer","method.national_number":"Saisir mon numéro national (NNI)","method.document_photo":"Photographier mon document","errors.method_required":"Choisissez comment vérifier votre identité, puis continuez","errors.attestation_invalid":"Nous n'avons pas pu confirmer l'authenticité de cette session de navigateur — rechargez la page et réessayez","errors.network_error":"Nous n'avons pas pu joindre le service de vérification — vérifiez votre connexion internet et réessayez","errors.session_expired":"Cette session de vérification a expiré — demandez un nouveau lien à l'organisme qui vous a envoyé ici","errors.nni_unbound":"Ce lien a été créé sans votre numéro national d'identification — demandez un nouveau lien à l'organisme demandeur","capture.tips.title":"Pour une vérification réussie :","capture.tips.light":"Placez-vous face à la lumière — évitez une forte lumière derrière vous","capture.tips.uncover":"Dégagez votre visage — ni lunettes, ni masque, ni main devant","capture.tips.eyeLevel":"Tenez votre téléphone à hauteur des yeux","capture.tips.straight":"Regardez droit vers la caméra et restez immobile","capture.tips.summary":"Placez-vous dans une zone bien éclairée. Dégagez votre visage — ni lunettes, ni masque. Une fois la caméra démarrée, tenez votre téléphone à hauteur des yeux, regardez droit vers la caméra et restez immobile.","capture.tips.listen":"Écouter les instructions","capture.tips.stop":"Arrêter","capture.permission.granted":"Accès à la caméra autorisé","capture.permission.prompt":"Votre navigateur va demander l’accès à la caméra — choisissez « Autoriser »","capture.permission.denied":"L’accès à la caméra est bloqué — autorisez-le dans les réglages du navigateur (icône caméra dans la barre d’adresse), puis rechargez la page","capture.permission.unknown":"Nous demanderons l’accès à la caméra au démarrage","capture.cameraLabel":"Caméra","capture.facing.user":"Caméra avant","capture.facing.environment":"Caméra arrière","capture.voiceGuidance":"Guidage vocal","capture.preparing.hint":"Mise en place de la détection du visage sur l’appareil — cela peut prendre un instant sur une connexion lente","capture.ready":"Prêt — commencez quand vous voulez","fcv2.err.models":"Impossible de charger les modèles de détection du visage — vérifiez votre connexion puis réessayez"};function Je(e){switch(e){case"center":return"fcv3.center_face";case"closer":return"fcv3.come_closer";case"farther":return"fcv3.move_back";case"light":return"fcv3.more_light";case"still":case"hold":return"fcv3.hold_still";default:{let t=e;throw new Error(`hintStringKey: unhandled hint ${t}`)}}}n(Je,"hintStringKey");function et(e){return`fcv2.err.${e}`}n(et,"captureErrorStringKey");function tt(e){switch(e){case"no_recorder":return"fcv2.err.unsupported";case"attestation":return"errors.attestation_invalid";case"network":return"errors.network_error";case"nni_unbound":return"errors.nni_unbound";case"method_required":return"errors.method_required";case"inference_unavailable":return"errors.inference_unavailable";default:{let t=`reasons.${e}`;return Object.hasOwn(pe,t)?t:null}}}n(tt,"reasonStringKey");function rt(e,t,r=new Date){if(t===void 0)return null;let s=new Date(t),o=s.getTime()-r.getTime();if(!Number.isFinite(o)||o<=0)return null;if(o<36e5){let u=Math.max(1,Math.ceil(o/6e4));return{key:"cooldown.retryIn",time:new Intl.RelativeTimeFormat(e,{numeric:"always"}).format(u,"minute")}}let i=s.toDateString()===r.toDateString();return{key:"cooldown.retryAt",time:new Intl.DateTimeFormat(e,{...i?{}:{day:"numeric",month:"long"},hour:"2-digit",minute:"2-digit"}).format(s)}}n(rt,"retryAfterTime");function nt(e,t,r){let s=new Intl.PluralRules(t).select(r);return((s==="other"?void 0:e[`capture.attemptsRemaining.${s}`])??e["capture.attemptsRemaining.other"]).replace("{count}",new Intl.NumberFormat(t).format(r))}n(nt,"attemptsRemainingText");var on={ar:Ue,fr:Be,en:pe};function ot(e,t){let r=on[e];if(t===void 0)return r;let s={...r};for(let o of Object.keys(t)){let i=t[o];typeof i=="string"&&(s[o]=i)}return s}n(ot,"resolveStrings");var Kt=rn(e=>pe[e]??""),Ot=Kt.Provider;function I(){return nn(Kt)}n(I,"useStrings");import{jsx as O,jsxs as Te}from"react/jsx-runtime";function Ht({videoRef:e,guidanceText:t,guidanceHint:r,guidanceKey:s,progress:o,phase:i,draining:c=!1,stillUrl:u,showChecking:d,onSwitchCamera:C,canSwitchCamera:T,voicePrompt:x,overlay:p,reduceMotion:l=!1}){let y=I(),g=i==="checking",S=g||i==="frozen",f=S&&d?y("capture.checking"):t,_=x?.(r,f,s);return Te("div",{className:l?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[O("video",{ref:e,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),u!==null&&S?O("img",{src:u,alt:y("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,O(zt,{progress:o,phase:i,draining:c}),p?.(e),_!=null&&!S?O("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:_}):null,T?O(M,{kind:"chip",onClick:C,"aria-label":y("capture.switchCamera"),className:"sekyro-stage__corner-end","data-testid":"sekyro-switch-camera",children:O(sn,{})}):null,g&&d?Te("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[O(an,{}),y("capture.cameraOff")]}):null,Te("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[O("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:f},f),S&&d?O("span",{className:"sekyro-stage__guidance-hint",children:y("capture.checkingHint")}):null]})]})}n(Ht,"CaptureStage");function sn(){return Te("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[O("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),O("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),O("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}n(sn,"FlipCameraIcon");function an(){return Te("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon sekyro-icon--sm",children:[O("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),O("path",{d:"M3 3l18 18"})]})}n(an,"CameraOffIcon");import{useEffect as cn,useRef as un}from"react";import{jsx as fe,jsxs as st}from"react/jsx-runtime";function Ft({showCoaching:e,attemptsText:t,showRetake:r,onRetake:s}){let o=I(),i=un(null);return cn(()=>{r&&i.current?.focus()},[r]),!e&&!r?null:st("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?st("div",{className:"sekyro-stack sekyro-stack--1",children:[fe("p",{className:"sekyro-text-body",children:o("capture.retryCoaching.title")}),st("ul",{className:"sekyro-coaching",children:[fe("li",{children:o("capture.retryCoaching.light")}),fe("li",{children:o("capture.retryCoaching.eyeLevel")}),fe("li",{children:o("capture.retryCoaching.head")})]}),t!==null?fe("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:t}):null]}):null,r?fe(M,{ref:i,className:"sekyro-btn--start",onClick:s,children:o("capture.recordAgain")}):null]})}n(Ft,"CapturedPanel");function Ge(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}n(Ge,"isDevBuild");import{useCallback as rr,useEffect as nr,useRef as ge}from"react";import{jsx as ln}from"react/jsx-runtime";function F({tone:e,role:t,children:r,testId:s}){return ln("div",{role:t??(e==="info"?"status":"alert"),className:`sekyro-notice sekyro-notice--${e}`,"data-testid":s,children:r})}n(F,"Notice");import{useId as dn}from"react";import{jsx as De,jsxs as it}from"react/jsx-runtime";var pn=["user","environment"];function Ut({value:e,onChange:t}){let r=I(),s=dn();return it("fieldset",{className:"sekyro-segmented","data-testid":"sekyro-facing",children:[De("legend",{className:"sekyro-segmented__legend",children:r("capture.cameraLabel")}),De("div",{className:"sekyro-segmented__options",children:pn.map(o=>it("label",{className:"sekyro-segmented__option",children:[De("input",{type:"radio",className:"sekyro-segmented__input",name:s,value:o,checked:e===o,onChange:()=>t(o)}),it("span",{className:"sekyro-segmented__face",children:[De("span",{className:"sekyro-segmented__dot","aria-hidden":"true"}),r(`capture.facing.${o}`)]})]},o))})]})}n(Ut,"FacingPicker");import{Fragment as fn,jsx as R,jsxs as q}from"react/jsx-runtime";function $({className:e,children:t}){return R("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}n($,"Svg");var at="M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z";function Bt(e){return q($,{...e,children:[R("circle",{cx:"12",cy:"12",r:"4"}),R("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}n(Bt,"SunIcon");function Gt(e){return q($,{...e,children:[R("circle",{cx:"12",cy:"12",r:"9"}),R("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}n(Gt,"FaceUncoveredIcon");function Dt(e){return q($,{...e,children:[R("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),R("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),R("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}n(Dt,"PhoneEyeLevelIcon");function qt(e){return q($,{...e,children:[R("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),R("circle",{cx:"12",cy:"12",r:"2.8"})]})}n(qt,"LookStraightIcon");function $t(e){return q($,{...e,children:[R("path",{d:at}),R("path",{d:"M9 13l2 2 4-4"})]})}n($t,"CameraCheckIcon");function jt(e){return q($,{...e,children:[R("path",{d:at}),R("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}n(jt,"CameraAskIcon");function Wt(e){return q($,{...e,children:[R("path",{d:at}),R("path",{d:"M3 3l18 18"})]})}n(Wt,"CameraBlockedIcon");function me({off:e,className:t}){return q($,{...t!==void 0?{className:t}:{},children:[R("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?R("path",{d:"M4 4l16 16"}):q(fn,{children:[R("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),R("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}n(me,"SpeakerIcon");function Yt(e){return R($,{...e,children:R("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}n(Yt,"CheckIcon");function Zt(e){return q($,{className:e.className??"sekyro-spinner",children:[R("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),R("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}n(Zt,"SpinnerIcon");import{useEffect as mn,useState as gn}from"react";import{jsx as Le,jsxs as yn}from"react/jsx-runtime";function Xt({state:e}){let t=I(),[r,s]=gn(!1);mn(()=>{e!=="unknown"&&s(!0)},[e]);let o=e==="granted"?Le($t,{}):e==="denied"?Le(Wt,{}):Le(jt,{});return yn("div",{role:r?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[Le("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:o}),Le("span",{children:t(`capture.permission.${e}`)})]})}n(Xt,"PermissionRow");import{useId as hn}from"react";import{jsx as J,jsxs as Qt}from"react/jsx-runtime";var Ve=["light","uncover","eyeLevel","straight"],vn={light:{key:"capture.tips.light",icon:n(()=>J(Bt,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:n(()=>J(Gt,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:n(()=>J(Dt,{}),"icon")},straight:{key:"capture.tips.straight",icon:n(()=>J(qt,{}),"icon")}};function Jt({tips:e}){let t=I(),r=hn();return e.length===0?null:Qt("section",{className:"sekyro-tips","aria-labelledby":r,"data-testid":"sekyro-tips",children:[J("p",{className:"sekyro-tips__title",id:r,children:t("capture.tips.title")}),J("ul",{className:"sekyro-tips__list",children:e.map(s=>{let o=typeof s=="string"?vn[s]:void 0,i=typeof s=="string"?s:s.id,c=o!==void 0?o.icon():typeof s=="string"?void 0:s.icon,u=o!==void 0?t(o.key):typeof s=="string"?s:s.text;return Qt("li",{className:"sekyro-tips__item",children:[c!=null?J("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:c}):null,J("span",{children:u})]},i)})})]})}n(Jt,"TipList");import{jsx as qe,jsxs as er}from"react/jsx-runtime";function tr({voice:e}){let t=I();if(!e.supported)return null;let r=e.enabled;return er("button",{type:"button",role:"switch","aria-checked":r,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:()=>e.toggle(),children:[er("span",{className:"sekyro-switch__label",children:[qe(me,{off:!r}),t("capture.voiceGuidance")]}),qe("span",{className:"sekyro-switch__track","aria-hidden":"true",children:qe("span",{className:"sekyro-switch__thumb",children:r?qe(Yt,{className:"sekyro-switch__check"}):null})})]})}n(tr,"VoiceSwitch");import{Fragment as kn,jsx as U,jsxs as Ne}from"react/jsx-runtime";function or({assets:e,onRetryAssets:t,permission:r,canChooseFacing:s,facing:o,onFacingChange:i,voice:c,tips:u,summary:d,startLabel:C,startDisabled:T,onStart:x}){let p=I(),l=ge(d?.stop);l.current=d?.stop,nr(()=>()=>l.current?.(),[]);let y=ge(null),g=ge(null),v=ge(null),S=ge(e),f=ge(!1);nr(()=>{let A=S.current;if(S.current=e,A===e)return;let w=f.current;e!=="loading"&&(f.current=!1),_n(y.current)&&(e==="failed"?v.current?.focus():w&&g.current?.focus())},[e]);let _=rr(()=>{f.current=!0,t()},[t]),h=e==="loading",H=h||T,N=rr(()=>{H||(l.current?.(),x())},[H,x]),a;return e==="failed"?a=Ne(F,{tone:"danger",testId:"sekyro-assets-error",children:[U("p",{className:"sekyro-text-body",children:p("fcv2.err.models")}),U(M,{kind:"ghost",ref:v,className:"sekyro-btn--start",onClick:_,"data-testid":"sekyro-assets-retry",children:p("common.retry")})]}):a=Ne("div",{className:"sekyro-stack sekyro-stack--1",children:[U(M,{ref:g,full:!0,"data-testid":"sekyro-start","aria-disabled":H?"true":void 0,"aria-busy":h?"true":void 0,onClick:N,children:h?Ne(kn,{children:[U(Zt,{}),p("capture.preparing.title")]}):C??p("capture.start")}),h?U("p",{className:"sekyro-text-muted",children:p("capture.preparing.hint")}):null]}),Ne("div",{ref:y,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[u!==!1?U(Jt,{tips:u}):null,d!==void 0?Ne(M,{kind:"ghost",className:"sekyro-btn--start",onClick:d.toggle,"data-testid":"sekyro-tips-listen",children:[U(me,{off:!1}),p(d.playing?"capture.tips.stop":"capture.tips.listen")]}):null,U(Xt,{state:r}),s?U(Ut,{value:o,onChange:i}):null,U(tr,{voice:c}),U("p",{className:"sekyro-text-muted",children:p("capture.securityNote")}),a,U("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?p("capture.preparing.title"):e==="ready"?p("capture.ready"):""})]})}n(or,"PreCaptureScreen");function _n(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}n(_n,"focusIsOurs");import{useId as Cn}from"react";import{useCallback as bn}from"react";function $e(){return bn(e=>{e?.focus()},[])}n($e,"useFocusOnMount");import{jsx as ye,jsxs as sr}from"react/jsx-runtime";function ir({choice:e,busy:t,failed:r,focus:s,onSelect:o}){let i=I(),c=Cn(),u=$e();return sr("section",{className:"sekyro-stack sekyro-stack--4","aria-labelledby":c,"data-testid":"sekyro-method",children:[sr("div",{className:"sekyro-stack sekyro-stack--1",children:[ye("h2",{id:c,className:"sekyro-text-body",children:i("method.title")}),ye("p",{className:"sekyro-text-muted",children:i("method.description")})]}),r?ye(F,{tone:"danger",children:ye("span",{children:i("errors.network_error")})}):null,ye("div",{className:"sekyro-stack sekyro-stack--3",children:e.options.map((d,C)=>ye(M,{ref:C===0&&s?u:void 0,kind:C===0?"primary":"ghost",full:!0,disabled:t,"aria-busy":t||void 0,onClick:()=>o(d),children:i(`method.${d}`)},d))})]})}n(ir,"MethodScreen");import{hasMultipleCameras as Sn,subscribeCameraPermission as wn}from"@sekyro/web";import{useEffect as ar,useState as cr}from"react";function ur(){let[e,t]=cr({state:"unknown",settled:!1}),[r,s]=cr(!1);return ar(()=>wn(o=>t({state:o,settled:!0})),[]),ar(()=>{let o=!0;return Sn().then(i=>{o&&s(i)}),()=>{o=!1}},[]),{permission:e.state,permissionSettled:e.settled,canChooseFacing:r}}n(ur,"useCameraStatus");import{useEffect as lr,useState as dr}from"react";function pr(e){let[t,r]=dr({required:!1,settled:e===void 0});return lr(()=>{let s=e?.mobileRequired;if(e===void 0||typeof s!="function"){r({required:!1,settled:!0});return}let o=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>s.call(e)).then(i=>{o&&r({required:i===!0,settled:!0})},()=>{o&&r({required:!1,settled:!0})}),()=>{o=!1}},[e]),t}n(pr,"useMobileRequired");function fr(e){let[t,r]=dr(!1);return lr(()=>{if(r(!1),e===void 0)return;let s=e.on("busy",()=>r(!0)),o=e.on("result",()=>r(!1));return()=>{s(),o()}},[e]),t}n(fr,"useBusy");import{getLivenessAssetsStatus as xn,preloadLivenessAssets as Rn,subscribeLivenessAssets as Tn}from"@sekyro/web";import{useCallback as ct,useEffect as mr,useRef as gr,useState as Ln,useSyncExternalStore as Vn}from"react";var Nn=n(()=>"idle","serverSnapshot");function yr(e){return Rn(e!==void 0?{assetBaseUrl:e}:{})}n(yr,"preload");function hr(e,t=!0){let r=Vn(ct(x=>Tn(x,e),[e]),()=>xn(e),Nn),[s,o]=Ln(null),i=gr(!1),c=ct(()=>{yr(e).then(x=>{i.current&&x==="idle"&&o({base:e})})},[e]);mr(()=>(i.current=!0,c(),()=>{i.current=!1}),[c]);let u=gr(null);mr(()=>{if(r!=="idle"){u.current={base:e};return}!t||u.current===null||u.current.base!==e||(u.current=null,c())},[r,e,c,t]);let d=ct(()=>{yr(e)},[e]);return{gate:s!==null&&s.base===e&&r==="idle"||r==="ready"?"ready":r==="failed"?"failed":"loading",retry:d}}n(hr,"useLivenessAssets");import{createLivenessCapture as In}from"@sekyro/web";import{useCallback as ut,useEffect as An,useRef as Ie,useState as Z}from"react";var vr={progress:0,hint:null,faceDetected:!1};function _r(e){let{videoRef:t,assetBaseUrl:r}=e,o=Ie(e.verification).current,i=Ie(!1);e.verification!==o&&!i.current&&Ge()&&(i.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let c=Ie(null),[u,d]=Z("idle"),[C,T]=Z(vr),[x,p]=Z(!1),[l,y]=Z(!1),[g,v]=Z(null),[S,f]=Z(!1),[_,h]=Z(null),[H,N]=Z(null),[a,A]=Z(null),w=Ie(null),z=Ie(e);z.current=e,An(()=>{let E=t.current;if(E===null)return;let ee={video:E,...r!==void 0?{assetBaseUrl:r}:{}},k=o!==void 0?o.liveness(ee):In(ee);c.current=k;let K=[k.on("state",m=>{m==="starting"&&(h(null),N(null),T(vr),y(!1),p(!1),v(null),w.current=null),d(m),z.current.onStateChange?.(m)}),k.on("gate",m=>{let X=w.current;w.current=m.progress,p(X!==null&&m.progress<X-.001&&m.progress>0&&m.progress<1),m.progress>=1&&y(!0),T(m)}),k.on("frozen",({previewDataUrl:m})=>v(m)),k.on("profile",({animations:m})=>f(m==="reduced")),k.on("captured",m=>{h(m),A(null),z.current.onCaptured?.(m)}),k.on("error",m=>{N(m),z.current.onError?.(m)}),o?.on("result",m=>{A(m),z.current.onResult?.(m)})];return()=>{for(let m of K)m?.();c.current=null,k.destroy()}},[o,t,r]);let B=ut(E=>{c.current?.start(E)},[]),le=ut(()=>{c.current?.retry()},[]),P=ut(()=>{y(!1),p(!1),v(null),w.current=null,c.current?.switchCamera()},[]);return{state:u,gate:C,draining:x,gateLocked:l,frozenPreview:g,reduceMotion:S,artifacts:_,error:H,result:a,start:B,retry:le,switchCamera:P}}n(_r,"useLivenessHandle");import{useCallback as Pn,useEffect as En,useState as je}from"react";var Mn=new Set(["national_number"]);function kr(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(r=>Mn.has(r));return t.length>0?{...e,options:t}:null}n(kr,"pending");function br(e){let[t,r]=je(null),[s,o]=je(e===void 0),[i,c]=je(!1),[u,d]=je(!1);En(()=>{if(r(null),e===void 0){o(!0);return}let p=!0,l=e.methodChoice;typeof l=="function"?(o(!1),Promise.resolve().then(()=>l.call(e)).then(g=>{p&&r(kr(g))},()=>{}).finally(()=>{p&&o(!0)})):o(!0);let y=e.on("method",g=>r(kr(g)));return()=>{p=!1,y()}},[e]);let C=Pn(async p=>{if(e===void 0)return!1;c(!0),d(!1);try{return await e.selectMethod(p),r(null),!0}catch{return d(!0),!1}finally{c(!1)}},[e]),T=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:T==="national_number"&&!u?T:null,settled:s,busy:i,failed:u,select:C}}n(br,"useMethodChoice");import{useEffect as zn,useMemo as Kn,useState as On}from"react";var Ae=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","capture.tips.summary"];function ie(e){return e!==null&&Ae.includes(e)}n(ie,"isVoiceKey");var Hn=["ar","fr","en"];function Fn(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}n(Fn,"isClipUrl");function Un(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let r={};for(let s of Hn){let o=t[s];if(!(typeof o!="object"||o===null))for(let[i,c]of Object.entries(o))!ie(i)||!Fn(c)||((r[s]??(r[s]={}))[i]=c)}return Object.keys(r).length>0?r:null}n(Un,"toVoiceClipMap");function Cr(e){let[t,r]=On(null);zn(()=>{if(r(null),e===void 0)return;let o=!0,i=n(u=>{if(!o)return;let d=typeof u=="object"&&u!==null&&typeof u.setId=="string"?u:null;r(C=>C?.setId===d?.setId?C:d)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(i,()=>i(null))}catch{i(null)}let c=e.on("view",u=>i(u.voice));return()=>{o=!1,c()}},[e]);let s=Kn(()=>t!==null?Un(t):null,[t]);return e===void 0?null:s}n(Cr,"useServerVoiceClips");import{jsx as Sr}from"react/jsx-runtime";function wr({voice:e}){let t=I();return Sr(M,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:()=>e.toggle(),children:Sr(me,{off:!e.enabled,className:"sekyro-icon"})})}n(wr,"VoiceChip");import{useCallback as W,useEffect as ae,useLayoutEffect as qn,useMemo as $n,useRef as ve,useState as Ee}from"react";var Bn=n((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function he(e,t,r){let s;try{if(typeof e=="function")s=e(t,r);else{let o=e[r];s=o!=null&&Bn(o,t)?o[t]:null}}catch{return null}return typeof s=="string"&&s!==""?s:null}n(he,"resolveClip");var Gn="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",Tr={ar:"ar-SA",fr:"fr-FR",en:"en-US"};function j(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}n(j,"synth");function Dn(){return j()!==null&&typeof SpeechSynthesisUtterance=="function"}n(Dn,"speechAvailable");function xr(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}n(xr,"baseLang");function Lr(e,t){let r=n(o=>o.replace(/_/g,"-").toLowerCase(),"norm"),s=xr(t);return e.find(o=>r(o.lang)===r(t))??e.find(o=>xr(o.lang)===s)}n(Lr,"pickVoice");function Vr(e){if(!Dn())return!1;let t=[];try{t=j()?.getVoices()??[]}catch{return!0}return t.length===0||Lr(t,e)!==void 0}n(Vr,"speechUsable");function Nr(e){let t=j();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}n(Nr,"subscribeVoices");function Pe(e){try{let t=typeof location<"u"?location.href:"http://localhost/",r=new URL(e,t);return`clip:${r.origin}${r.pathname}`}catch{return`clip:${e}`}}n(Pe,"clipIdentity");function Rr(e){e.pause(),e.removeAttribute("src"),e.load()}n(Rr,"release");function Ir(){let e=null,t=null,r=0,s=null,o=[],i=new Map,c=n(()=>{o=j()?.getVoices()??[]},"loadVoices"),u=!1,d=n(()=>{let l=j();u||l===null||(u=!0,c(),l.addEventListener?.("voiceschanged",c))},"bindVoices"),C=n(()=>(e??(e=new Audio),e),"element"),T=n((l,y,g)=>{let v=j();if(v!==null&&l!==""&&typeof SpeechSynthesisUtterance=="function"){d();let S=Lr(o,y);if(o.length===0||S!==void 0){v.cancel();let f=new SpeechSynthesisUtterance(l);f.lang=y,S!==void 0&&(f.voice=S),f.rate=.95,g!==void 0&&(f.onend=f.onerror=g),v.speak(f);return}}g?.()},"speak"),x=n(()=>{r+=1,s=null,e!==null&&(e.pause(),e.currentTime=0),j()?.cancel()},"stop"),p=n(l=>{for(let y of l){let g=Pe(y);if(i.has(g))continue;let v=new Audio;v.preload="auto",v.src=y,i.set(g,v)}},"warmClips");return{say(l){let y=l.url!==null?Pe(l.url):`tts:${l.lang}:${l.text}`;if(y===s)return;s=y,r+=1;let g=r,v=l.onEnd,S=v!==void 0?()=>{g===r&&v()}:void 0;if(j()?.cancel(),l.url!==null){let f=C();f.pause(),f.muted=!1,f.src=l.url,f.currentTime=0,f.onended=S??null,f.play()?.catch(_=>{g===r&&_?.name!=="AbortError"&&(l.speech?T(l.text,l.lang,S):S?.())});return}l.speech?T(l.text,l.lang,S):S?.()},unlock({lang:l,speech:y,prefetch:g}){let v=C();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let _=Uint8Array.from(atob(Gn),h=>h.charCodeAt(0));t=URL.createObjectURL(new Blob([_],{type:"audio/wav"}))}let S=v.paused===!1&&t!==null&&v.src!==t;t!==null&&!S&&(v.muted=!0,v.onended=null,v.src=t,v.play()?.catch(()=>{}));let f=j();if(y&&f!==null&&typeof SpeechSynthesisUtterance=="function"){d();let _=new SpeechSynthesisUtterance(" ");_.volume=0,_.lang=l,f.speak(_)}p(g??[])},prefetch:p,stop:x,dispose(){x(),u&&j()?.removeEventListener?.("voiceschanged",c),u=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&Rr(e),e=null;for(let l of i.values())Rr(l);i.clear()}}}n(Ir,"createVoicePlayer");var Ar="sekyro.voiceGuidance";function Pr(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}n(Pr,"readVoicePreference");function Er(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}n(Er,"writeVoicePreference");var Me="capture.tips.summary",jn=typeof window<"u"?qn:ae,Wn=Object.freeze({});function lt(e,t){let r=new Set,s=[];for(let o of Ae){let i=o===Me?null:he(e,o,t);i===null||r.has(Pe(i))||(r.add(Pe(i)),s.push(i))}return s}n(lt,"resolvedClipUrls");function dt({locale:e,defaultClips:t,options:r}){let s=r===!1,o=s?{}:r??{},i=o.storageKey===void 0?Ar:o.storageKey,[c,u]=Ee(o.defaultEnabled??!0),d=ve(c),[C,T]=Ee(!1),[x,p]=Ee("none"),[l,y]=Ee(!1),g=ve(!1),[v,S]=Ee(0),f=ve(null),_=W(()=>(f.current??(f.current=Ir()),f.current),[]),h=Tr[e],H=o.speechFallback,N=H===void 0||H===!0?!0:H===!1?!1:H.includes(e),a=o.clips??t??Wn,A=ve(!1),w=ve(a);jn(()=>{w.current=a,d.current=c}),ae(()=>{if(s||i===null)return;let b=Pr(i);b!==null&&(d.current=b,u(b))},[s,i]),ae(()=>{if(!(s||!N))return Nr(()=>S(b=>b+1))},[s,N]);let z=o.clips;ae(()=>{if(s)return;let b=N&&Vr(h);T(lt(a,e).length>0||b),p(z!==void 0&&he(z,Me,e)!==null?"partner":he(a,Me,e)!==null||b?"default":"none")},[s,a,z,e,N,h,v]),ae(()=>{if(s||!c||!A.current)return;let b=lt(a,e);b.length>0&&_().prefetch(b)},[s,c,a,e,_]),ae(()=>()=>{f.current?.dispose(),f.current=null,A.current=!1},[]);let B=W(b=>{s||(A.current=!0,_().unlock({lang:h,speech:N,...b?{prefetch:lt(w.current,e)}:{}}))},[s,_,h,N,e]),le=W(()=>B(d.current),[B]),P=W(()=>{g.current=!1,y(!1)},[]),E=W(()=>{P(),f.current?.stop()},[P]),ee=W(()=>{g.current&&E()},[E]),k=W(b=>{if(s)return;if(g.current){E();return}let te=_();te.stop(),g.current=!0,y(!0),te.say({url:he(w.current,Me,e),text:b,lang:h,speech:N,onEnd:P})},[s,E,_,e,h,N,P]),K=W(b=>{s||(b?B(!0):E(),i!==null&&Er(i,b),d.current=b,u(b))},[s,B,E,i]),m=W(()=>K(!d.current),[K]),X=W((b,te)=>{if(s||!c)return;g.current&&P();let ze=he(w.current,b,e);_().say({url:ze,text:te,lang:h,speech:N})},[s,c,e,_,h,N,P]);return $n(()=>({supported:!s&&C,enabled:!s&&c,setEnabled:K,toggle:m,unlock:le,speakKey:X,stop:E,summary:s?"none":x,summaryPlaying:l,toggleSummary:k,stopSummary:ee}),[s,C,c,K,m,le,X,E,x,l,k,ee])}n(dt,"useVoiceGuidance");function pt(e,t,r,s){let{speakKey:o,stop:i,enabled:c}=e,u=ve(!1);ae(()=>{if(!s||!c){u.current&&i(),u.current=!1;return}u.current=!0,ie(t)&&t!==Me&&r!==""&&o(t,r)},[s,c,t,r,o,i])}n(pt,"useSpeakGuidance");import{Fragment as ro,jsx as V,jsxs as Ye}from"react/jsx-runtime";var zr=800;function Zn(e){return e===void 0||e!==!1&&e.length===Ve.length&&Ve.every(t=>e.includes(t))}n(Zn,"isDefaultTips");function Xn(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}n(Xn,"carriesActivation");function Qn(e){return typeof e=="object"&&e!==null&&!Yn(e)&&"tone"in e&&"text"in e}n(Qn,"isNoticeObject");function Jn(e){return e==="starting"||e==="gating"||e==="recording"}n(Jn,"isCapturing");function eo(e){return e==="captured"||e==="uploading"||e==="checking"}n(eo,"isPostCapture");function to({verification:e,locale:t,dir:r,strings:s,slots:o,autoStart:i=!1,notice:c,startDisabled:u=!1,startLabel:d,tips:C,defaultFacing:T,voice:x,onGuidance:p,onCaptured:l,onResult:y,onError:g,onStateChange:v,assetBaseUrl:S,className:f}){let _=_e(()=>ot(t,s),[t,s]),h=_e(()=>L=>_[L]??"",[_]),H=r??(t==="ar"?"rtl":"ltr"),N=ue(null),a=_r({verification:e,videoRef:N,assetBaseUrl:S,onCaptured:l,onResult:y,onError:g,onStateChange:v}),A=hr(S,a.state==="idle"&&a.error===null),w=br(e),z=w.choice!==null,B=pr(e),le=fr(e),P=ur(),E=x!==!1&&x?.clips===void 0,ee=Cr(E?e:void 0),k=dt({locale:t,defaultClips:ee,options:x}),[K,m]=Mr(T??"user"),X=ue(null),b=ue(!1),te=ue(k.unlock);te.current=k.unlock,ce(()=>{let L=X.current;if(L===null)return;let se=["pointerup","touchend","click","keydown"],Q=n(()=>{for(let xe of se)L.removeEventListener(xe,de,!0)},"disarm");function de(xe){if(b.current){Q();return}Xn(xe)&&(b.current=!0,Q(),te.current())}n(de,"onGesture");for(let xe of se)L.addEventListener(xe,de,{capture:!0,passive:!0});return Q},[]);let ze=We(()=>{b.current||(b.current=!0,k.unlock()),a.start({facing:K})},[k.unlock,a.start,K]),mt=We(()=>a.start({facing:K}),[a.start,K]),Ke=ue(!1),be=a.state==="idle"&&a.error===null,gt=!z&&!B.required&&(i===!0||i==="when-permitted"&&P.permission==="granted"),yt=gt&&w.settled&&B.settled,Or=i==="when-permitted"&&!P.permissionSettled&&!Ke.current,ht=gt&&be&&!Ke.current,Ze=(Or||ht)&&A.gate==="ready"?"loading":A.gate;ce(()=>{!yt||!be||A.gate!=="ready"||Ke.current||(Ke.current=!0,mt())},[yt,be,A.gate,mt]);let Hr=be&&!z&&!B.required&&!(ht&&A.gate==="ready"),Fr=We(()=>{m(L=>L==="user"?"environment":"user"),a.switchCamera()},[a.switchCamera]),Oe=_e(()=>a.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(a.artifacts.keyframe):null,[a.artifacts]);ce(()=>{if(Oe!==null)return()=>URL.revokeObjectURL(Oe)},[Oe]);let Ur=a.frozenPreview??Oe,vt=e!==void 0,G=Jn(a.state),re=eo(a.state),_t=G||re,D=a.result,kt=a.state==="done"&&D!==null,Br=a.state==="recording"&&a.frozenPreview!==null,Gr=re?"checking":Br?"frozen":a.state==="recording"?"recording":a.gateLocked||a.gate.progress>=1?"locked":a.gate.faceDetected?"aligning":"seeking",He=G?a.gate.hint:null,Fe=a.state==="starting"?"capture.preparing.title":He===null?null:He==="center"&&!a.gate.faceDetected?"fcv3.no_face":Je(He),[Dr,bt]=Mr(null);ce(()=>{if(Fe!=="fcv3.no_face"){bt(Fe);return}if(!G)return;let L=setTimeout(()=>bt(Fe),zr);return()=>clearTimeout(L)},[Fe,G]);let ne=G?Dr:null,Ct=ne===null?"":h(ne);pt(k,ne,Ct,G);let St=ue(p);St.current=p,ce(()=>{if(ie(ne))try{St.current?.(ne)}catch(L){console.error("[@sekyro/react] onGuidance threw:",L)}},[ne]);let Ce=_e(()=>({supported:k.supported,enabled:k.enabled,setEnabled:k.setEnabled,toggle:k.toggle}),[k.supported,k.enabled,k.setEnabled,k.toggle]),Xe=o?.voicePrompt,wt=Xe!==void 0,xt=x===void 0,Rt=ue(!1);ce(()=>{!wt||!xt||Rt.current||!Ge()||(Rt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[wt,xt]);let qr=Xe!==void 0?(L,se,Q)=>Xe(L,se,Q,Ce):k.supported?()=>V(wr,{voice:Ce}):void 0,{summary:Tt,summaryPlaying:Lt,toggleSummary:Vt,stopSummary:Nt}=k,It=h("capture.tips.summary"),At=Tt==="partner"||Tt==="default"&&Zn(C),Pt=_e(()=>At?{playing:Lt,toggle:n(()=>Vt(It),"toggle"),stop:Nt}:void 0,[At,Lt,Vt,It,Nt]),$r=_e(()=>({assets:Ze,retryAssets:A.retry,permission:P.permission,facing:K,setFacing:m,canChooseFacing:P.canChooseFacing,voice:Ce}),[Ze,A.retry,P.permission,P.canChooseFacing,K,Ce]),jr=Qn(c)?V(F,{tone:c.tone,testId:"sekyro-host-notice",children:V("span",{children:c.text})}):c??null,oe=D!==null&&D.status==="retry"?D:null,Y=kt&&D.status==="unavailable"&&!z?D:null,Se=kt&&(D.status==="approved"||D.status==="rejected"||D.status==="review")?D:null,we=n((L,se)=>{if(L===void 0)return null;if(L==="device_cooldown"){let de=rt(t,se);if(de!==null)return h(de.key).replace("{time}",de.time)}let Q=tt(L);return Q===null?null:h(Q)},"reasonText"),Wr=Y!==null&&Y.reason!==void 0&&Y.reason!=="nni_unbound"&&Y.reason!=="method_required"&&Y.reason!=="mobile_required"&&!(Y.reason==="no_recorder"&&a.artifacts?.degraded==="NO_RECORDER"),Et=$e(),Yr=z&&w.auto===null&&!G&&!re&&a.error===null,Qe=We(async L=>{await w.select(L)&&a.state==="done"&&a.retry()},[w.select,a.state,a.retry]);return ce(()=>{w.auto!==null&&!w.busy&&!G&&!re&&Qe(w.auto)},[w.auto,w.busy,G,re,Qe]),V(Ot,{value:h,children:Ye("div",{ref:X,className:f===void 0?"sekyro-capture":`sekyro-capture ${f}`,dir:H,lang:t,"data-testid":"sekyro-liveness-capture","data-state":a.state,children:[o?.header,oe!==null&&we(oe.reason)!==null?V(F,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:V("span",{children:we(oe.reason)})}):null,le&&re?V(F,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:V("span",{children:h("capture.busy")})}):null,B.required&&be?V(F,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:V("span",{children:h("reasons.mobile_required")})}):null,a.error!==null?o?.errorPanel!==void 0?o.errorPanel(a.error,a.retry):Ye(F,{tone:"danger",testId:"sekyro-error-notice",children:[V("span",{children:h(et(a.error.kind))}),a.error.retryable?V(M,{ref:Et,kind:"ghost",className:"sekyro-btn--start",onClick:a.retry,children:h("common.retry")}):null]}):null,Y!==null?Ye(F,{tone:"danger",testId:"sekyro-unavailable-notice",children:[V("span",{children:we(Y.reason)??h(Y.reason===void 0?"errors.session_expired":"errors.network_error")}),Wr?V(M,{ref:Et,kind:"ghost",className:"sekyro-btn--start",onClick:a.retry,children:h("capture.recordAgain")}):null]}):null,Se!==null&&we(Se.reason)!==null?V(F,{tone:Se.status==="rejected"?"danger":"info",testId:"sekyro-result-notice",children:V("span",{children:we(Se.reason,Se.retryAfter)})}):null,V("div",{className:_t?void 0:"sekyro-hidden","data-capture-live":_t?"":void 0,children:V(Ht,{videoRef:N,guidanceText:Ct,guidanceHint:He,guidanceKey:ne,progress:a.gate.progress,phase:Gr,draining:a.draining,stillUrl:Ur,showChecking:vt,onSwitchCamera:Fr,canSwitchCamera:G&&a.state!=="recording",voicePrompt:qr,overlay:o?.stageOverlay,reduceMotion:a.reduceMotion})}),Yr&&w.choice!==null?V(ir,{choice:w.choice,busy:w.busy,failed:w.failed,focus:a.state==="done",onSelect:L=>{Qe(L)}}):null,Hr?Ye(ro,{children:[jr,o?.intro!==void 0?o.intro(ze,$r):V(or,{assets:Ze,onRetryAssets:A.retry,permission:P.permission,canChooseFacing:P.canChooseFacing,facing:K,onFacingChange:m,voice:Ce,tips:C??Ve,...Pt!==void 0?{summary:Pt}:{},...d!==void 0?{startLabel:d}:{},startDisabled:u,onStart:ze})]}):null,V(Ft,{showCoaching:oe!==null,attemptsText:oe?.attemptsRemaining!==void 0?nt(_,t,oe.attemptsRemaining):null,showRetake:oe!==null&&!G&&!re||!vt&&a.state==="captured",onRetake:a.retry}),o?.footer]})})}n(to,"LivenessCapture");import{jsx as uo}from"react/jsx-runtime";var ke={colors:{brand:"#1e40af",brandFg:"#ffffff",fg:"#111827",fgMuted:"#4b5563",bg:"#f8fafc",surface:"#ffffff",ring:"#1e40af",danger:"#b91c1c",success:"#15803d",warning:"#a16207"},radius:"12px",fontFamily:'system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif'},ft={brand:"--sekyro-color-brand",brandFg:"--sekyro-color-brand-fg",fg:"--sekyro-color-fg",fgMuted:"--sekyro-color-fg-muted",bg:"--sekyro-color-bg",surface:"--sekyro-color-surface",ring:"--sekyro-color-ring",danger:"--sekyro-color-danger",success:"--sekyro-color-success",warning:"--sekyro-color-warning"};function Kr(e={}){let t={};for(let r of Object.keys(ft))t[ft[r]]=e.colors?.[r]??ke.colors[r];return t["--sekyro-radius"]=e.radius??ke.radius,t["--sekyro-font"]=e.fontFamily??ke.fontFamily,t}n(Kr,"themeToCssVars");var no=/^#[0-9a-f]{6}$/i,oo={none:"0px",sm:"4px",md:"8px",lg:"12px",full:"9999px"},so={system:"",inter:"Inter","ibm-plex-sans-arabic":'"IBM Plex Sans Arabic"',"noto-sans-arabic":'"Noto Sans Arabic"',roboto:"Roboto"};function io(e){let t={};if(!e)return t;let r={};for(let[i,c]of Object.entries(e.colors??{}))i in ft&&i!=="ring"&&no.test(c??"")&&(r[i]=c);r.brand&&(r.ring=r.brand),Object.keys(r).length&&(t.colors=r);let s=oo[e.radius];s&&(t.radius=s);let o=so[e.fontFamily];return o!==void 0&&(t.fontFamily=o?`${o}, ${ke.fontFamily}`:ke.fontFamily),t}n(io,"brandingToTheme");function ao(...e){let t={};for(let r of e)r?.colors&&(t.colors={...t.colors,...r.colors}),r?.radius&&(t.radius=r.radius),r?.fontFamily&&(t.fontFamily=r.fontFamily);return t}n(ao,"mergeThemes");function co({theme:e,children:t,className:r}){let s=Kr(e);return uo("div",{className:r===void 0?"sekyro-root":`sekyro-root ${r}`,style:s,children:t})}n(co,"SekyroThemeProvider");export{ke as DEFAULT_THEME,Ve as DEFAULT_TIPS,to as LivenessCapture,zr as NO_FACE_DEBOUNCE_MS,co as SekyroThemeProvider,Ae as VOICE_KEYS,Ue as ar,nt as attemptsRemainingText,io as brandingToTheme,et as captureErrorStringKey,pe as en,Be as fr,Je as hintStringKey,ao as mergeThemes,tt as reasonStringKey,ot as resolveStrings,rt as retryAfterTime,Kr as themeToCssVars};
2
+ import{a,b as c,c as l,d as E,e as g}from"./chunk-ADMDZLPM.js";import{b as m,d as S,e as T,f as C}from"./chunk-BRA6F56P.js";import{a as s}from"./chunk-65JA6YKG.js";import{c as e,d as r,e as t,f as o,g as p,h as i,i as y,j as n}from"./chunk-4RUZQW5T.js";export{a as DEFAULT_THEME,m as DEFAULT_TIPS,C as LivenessCapture,T as NO_FACE_DEBOUNCE_MS,g as SekyroThemeProvider,S as VOICE_KEYS,r as ar,n as attemptsRemainingText,l as brandingToTheme,p as captureErrorStringKey,e as en,t as fr,o as hintStringKey,E as mergeThemes,i as reasonStringKey,s as resolveStrings,y as retryAfterTime,c as themeToCssVars};