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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @sekyro/react
2
2
 
3
+ ## 0.1.0-rc.7
4
+
5
+ ### Minor Changes
6
+
7
+ - 1639f8a: Sekyro flows: one choice screen for every choice of the flow plan (`plan.choice`).
8
+
9
+ - `ChoiceScreen` (DESIGN.md Choice Cards: line glyph, label, radio; one tap picks and moves on after 220 ms) replaces the method screen and the contact choice: `<MethodChoice>` (identity method, `method.*` copy), the contact choice (`contact.*`) and the new generic choice step (`choice.*`, ar/fr/en) all render it, options in the server's order, labelled by their service (`nfc` and unknown services are never shown on the web). The 0.1 `<LivenessCapture>` method step uses the same component with its 0.1 buttons look (styles.css unchanged).
10
+ - The section progress follows `plan.sections` (`done | current | upcoming`); `section.screening` copy added.
11
+ - The identity summary is the `summary_confirm` step (no API change).
12
+ - In-lane switch on every step screen while the session's choice is open (C4 rule §5 item 6): one other option → a direct quiet action labelled by it (phone ⇄ email, « Use my document instead », the eID camera action, or the target's method label); two or more → « Use another option » (`choice.switch`, ar/fr/en), which re-opens the ChoiceScreen with the current option marked.
13
+ - Flow-view chunk budget 10 240 → 10 752 B gzip (the generic choice copy, then the in-lane switch views).
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [8dbdcf3]
18
+ - @sekyro/web@0.1.0-rc.9
19
+
3
20
  ## 0.1.0-rc.6
4
21
 
5
22
  ### Minor Changes
package/README.md CHANGED
@@ -1,20 +1,31 @@
1
1
  # @sekyro/react
2
2
 
3
- React component for [Sekyro AI](https://sekyro.ai) liveness capture: the hosted page's
4
- capture UI (`<LivenessCapture />`), extracted onto the public `@sekyro/web` API with
5
- no private design-system or framework dependency. Themeable through CSS variables,
6
- ar / fr / en built in, RTL-safe (logical CSS only), WCAG AAA defaults.
3
+ React components for [Sekyro AI](https://sekyro.ai) identity verification, built on the
4
+ public `@sekyro/web` API with no private design-system or framework dependency:
7
5
 
8
- > Release candidate (`npm i @sekyro/react@next @sekyro/web@next`). Sekyro AI's own hosted page dogfoods it.
6
+ - `@sekyro/react`: `<LivenessCapture />`, the hosted page's liveness capture UI;
7
+ - `@sekyro/react/verification`: `<SekyroVerification />`, which renders every step of the
8
+ session's Sekyro flow (codes, choices, national number, document, identity summary,
9
+ liveness and face match, ICAO portrait, national eID, result), and the single step
10
+ components.
11
+
12
+ Themeable through CSS variables, ar / fr / en built in, RTL-safe (logical CSS only),
13
+ WCAG AAA defaults. Sekyro AI's own hosted page uses the same components.
9
14
 
10
15
  ## Install
11
16
 
12
17
  ```sh
13
- npm install @sekyro/react @sekyro/web react react-dom
18
+ npm install @sekyro/react@next @sekyro/web@next react react-dom
14
19
  ```
15
20
 
16
- Peer dependencies: `react >=18.2`, `react-dom >=18.2`, `@sekyro/web ^0.1.0-rc.8 || ^0.2.0-rc.0`.
17
- No other runtime dependencies.
21
+ Peer dependencies: `react >=18.2`, `react-dom >=18.2`, `@sekyro/web ^0.1.0-rc.9 || ^0.2.0-rc.0`.
22
+ No other runtime dependencies. Use of the SDK is governed by the
23
+ [Sekyro AI SDK License](https://sekyro.ai/legal/sdk-license) (summarised in `LICENSE`)
24
+ and your Sekyro AI customer agreement.
25
+
26
+ The full guide (sessions and flows, the whole flow with `<SekyroVerification>`, CSP,
27
+ model assets, reason codes) is the
28
+ [web SDK guide](https://docs.sekyro.ai/en/web/embedded-sdk).
18
29
 
19
30
  ## Usage
20
31
 
@@ -42,7 +53,7 @@ const verification = createVerification({ clientToken, locale: "ar" });
42
53
  retry coaching and the remaining attempts; with `createVerification({ rearm: 'manual' })`
43
54
  the component instead offers a focused "Start a new attempt" button.
44
55
  - The still freezes the stage the instant recording stops (the handle's `frozen`
45
- event) — before the clip finalizes; the "camera off" pill only appears once the
56
+ event), before the clip finalizes; the "camera off" pill only appears once the
46
57
  tracks are actually stopped (`captured`). A LOW device profile (`profile` event)
47
58
  drops the decorative animations.
48
59
  - **Capture-only mode** (no `verification`): `createLivenessCapture()`; the component
@@ -58,9 +69,9 @@ const verification = createVerification({ clientToken, locale: "ar" });
58
69
  | `dir?` | `"ltr" \| "rtl"` | Defaults to `rtl` for `ar`. |
59
70
  | `strings?` | `Partial<Strings>` | Per-key overrides on top of the built-ins. |
60
71
  | `slots?` | `{ header, footer, intro(start, context), stageOverlay(videoRef), voicePrompt(hint, text, key, voice), errorPanel(err, retry) }` | `intro` replaces the built-in pre-capture screen (see below); `stageOverlay` renders inside the stage box above the ring (overlays, debug HUDs); `voicePrompt` replaces the built-in voice chip in the stage's start corner; `errorPanel` replaces the camera-error notice. |
61
- | `autoStart?` | `boolean \| "when-permitted"` | Skip the pre-capture screen and start once the detector preload is ready — at most once per mount. `true` arms it (flip it when your own preconditions are met); `"when-permitted"` arms it only when the camera permission is already `granted` (until the permission probe answers, the screen shows its loader). |
72
+ | `autoStart?` | `boolean \| "when-permitted"` | Skip the pre-capture screen and start once the detector preload is ready, at most once per mount. `true` arms it (flip it when your own preconditions are met); `"when-permitted"` arms it only when the camera permission is already `granted` (until the permission probe answers, the screen shows its loader). |
62
73
  | `notice?` | `ReactNode \| { tone, text }` | Host message above the pre-capture screen (busy service, previous failure). Pre-capture only. |
63
- | `startDisabled?` / `startLabel?` | `boolean` / `ReactNode` | Disable the built-in Start and relabel it (e.g. a cooldown: "Retry in 12 s"). It gates only the pre-capture Start — not the error Retry, "record again" or the retake button. |
74
+ | `startDisabled?` / `startLabel?` | `boolean` / `ReactNode` | Disable the built-in Start and relabel it (e.g. a cooldown: "Retry in 12 s"). It gates only the pre-capture Start, not the error Retry, "record again" or the retake button. |
64
75
  | `tips?` | `false \| (BuiltInTipId \| IntroTip)[]` | Tips card; default `DEFAULT_TIPS`; `false` hides it. |
65
76
  | `defaultFacing?` | `"user" \| "environment"` | Camera the attempt opens with (default front). |
66
77
  | `voice?` | `false \| VoiceOptions` | Voice guidance; on by default. `false` = no speech, no switch, no chip. |
@@ -84,7 +95,7 @@ is ready at once.
84
95
 
85
96
  `slots.intro(start, context)` replaces the whole screen. `context` is
86
97
  `{ assets: "loading" | "ready" | "failed", retryAssets, permission, facing,
87
- setFacing, canChooseFacing, voice }`; call `start` from your click handler — it
98
+ setFacing, canChooseFacing, voice }`; call `start` from your click handler: it
88
99
  opens `context.facing` and unlocks audio inside the gesture (iOS). The `notice`
89
100
  still renders above your intro.
90
101
 
@@ -101,21 +112,21 @@ still renders above your intro.
101
112
 
102
113
  ### Voice guidance
103
114
 
104
- During capture the component speaks the displayed (debounced) guidance — the
105
- `fcv3.*` gate hints — through one `<audio>` element, falling back to the
115
+ During capture the component speaks the displayed (debounced) guidance (the
116
+ `fcv3.*` gate hints) through one `<audio>` element, falling back to the
106
117
  device voice (`speechSynthesis`). A stage chip (`aria-pressed`) and the intro
107
118
  switch toggle it; the viewer's choice persists in `localStorage`.
108
119
 
109
120
  | `VoiceOptions` | Default | Notes |
110
121
  |---|---|---|
111
122
  | `defaultEnabled?` | `true` | Used when the viewer has no stored preference. |
112
- | `clips?` | verification mode: Sekyro AI clips from the session (add `https://assets.sekyro.ai` to `media-src`); capture-only: none | `VoiceClipSource`: a resolver `(key, locale) => url \| null` **or** a map `{ [locale]: { [voiceKey]: url } }` (e.g. delivered by your backend — pass a new object to change it). Yours always wins over the Sekyro AI clips. A missing URL or a throwing resolver = no clip → device voice. |
123
+ | `clips?` | verification mode: Sekyro AI clips from the session (add `https://assets.sekyro.ai` to `media-src`); capture-only: none | `VoiceClipSource`: a resolver `(key, locale) => url \| null` **or** a map `{ [locale]: { [voiceKey]: url } }` (for example delivered by your backend; pass a new object to change it). Yours always wins over the Sekyro AI clips. A missing URL or a throwing resolver = no clip → device voice. |
113
124
  | `speechFallback?` | `true` | `false`, or the locales where the device voice may speak. A device with no voice for the language stays silent rather than read Arabic in a French voice. |
114
125
  | `storageKey?` | `"sekyro.voiceGuidance"` | `null` = do not persist. |
115
126
 
116
127
  **Sekyro AI clips.** In verification mode the component speaks the recorded
117
128
  ar/fr clip set that arrives with the session (`verification.voiceClips()`),
118
- served from `https://assets.sekyro.ai` — a page with a Content-Security-Policy
129
+ served from `https://assets.sekyro.ai`: a page with a Content-Security-Policy
119
130
  must allow that origin in `media-src`. Until the set arrives, when the session
120
131
  has none, or when it cannot be fetched, the device voice speaks. The package
121
132
  ships no audio. `VOICE_KEYS` lists the nine `fcv3.*` guidance keys plus
@@ -145,7 +156,7 @@ when `slots.voicePrompt` is set and `voice` is undefined (pass `voice={{}}` to k
145
156
  the built-in voice and silence it).
146
157
 
147
158
  **CSP.** Clips and the unlock use `media-src 'self' blob:` (the silent unlock WAV
148
- is a `blob:` URL — no `data:` needed); add your clip host if `clips` points off-origin.
159
+ is a `blob:` URL, no `data:` needed); add your clip host if `clips` points off-origin.
149
160
 
150
161
  ### Theme
151
162
 
@@ -161,7 +172,7 @@ Contrast rules the component relies on (checked for the default theme in
161
172
  - `fg` on `surface` / `bg`, `brandFg` on `brand`: text → 7:1 (AAA);
162
173
  - `surface` on `fg`: the stage scrim is `fg` and the guidance line is `surface`, so the
163
174
  on-camera text inherits the same ratio;
164
- - `fgMuted` on `surface`: secondary text only (security note, checking hint) — AA
175
+ - `fgMuted` on `surface`: secondary text only (security note, checking hint): AA
165
176
  (4.5:1) is the floor, AAA recommended;
166
177
  - `brand`, `ring`, `danger`, `warning`, `success` on `surface`: non-text UI → 3:1.
167
178
 
@@ -184,12 +195,13 @@ Keys follow the hosted message catalog (`capture.*`, `fcv2.err.*`, `fcv3.*`,
184
195
 
185
196
  ## Entries: `@sekyro/react` and `@sekyro/react/verification`
186
197
 
187
- The main entry is the 0.1 liveness component above. The profile v2 steps
188
- (`<SekyroVerification>`, `<PhoneOtpStep>`, `<MethodChoice>`, `<NniEntry>`,
189
- `<DocumentCapture>`, `<VerificationResultScreen>`) live on a second entry,
190
- `@sekyro/react/verification`, with its own stylesheet
191
- (`import "@sekyro/react/verification.css"` next to `styles.css`). It needs
192
- `@sekyro/web` 0.1.0-rc.8 or later (the plan runner).
198
+ The main entry is the liveness component above. The flow steps
199
+ (`<SekyroVerification>`, `<SekyroFlow>`, `<PhoneOtpStep>`, `<EmailOtpStep>`,
200
+ `<MethodChoice>`, `<EidStep>`, `<NniEntry>`, `<DocumentCapture>`, `<PortraitCapture>`,
201
+ `<VerificationResultScreen>`) live on a second entry, `@sekyro/react/verification`, with
202
+ its own stylesheet (`import "@sekyro/react/verification.css"` next to `styles.css`). It
203
+ needs `@sekyro/web` 0.1.0-rc.8 or later (the step runner). The server decides the steps
204
+ from the session's flow; the component renders whichever step comes next.
193
205
 
194
206
  `verification.css` loads the SDK's fonts (subset Inter, Geist and Cairo,
195
207
  woff2, OFL) from `fonts/` beside it: your bundler emits them as assets (allow
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a}from"./chunk-65JA6YKG.js";import{a as i}from"./chunk-4RUZQW5T.js";var s={"session.title":"تحقّق من هويتك","session.requestedBy":"تطلب {orgName} منك التحقق من هويتك","returning.requestedBy":"تطلب {orgName} منك تأكيد أنك أنت","consent.notice":"بإكمال عملية التحقق من الهوية، فإنك توافق على معالجة بياناتك الشخصية والبيومترية للتحقق من هويتك.","consent.details":"التفاصيل","consent.terms.intro":"تتحقق Sekyro AI من هويتك نيابةً عن الجهة التي أرسلت إليك هذا الرابط. قبل البدء، اطّلع على كيفية استخدام بياناتك.","consent.terms.data":"أثناء التحقق، تجمع Sekyro AI صور وثيقة هويتك، ومقطع فيديو ذاتيًا قصيرًا، وصورة ذاتية، ورقم تعريفك الوطني.","consent.terms.processing":"تُستخدم هذه البيانات للتحقق من هويتك فقط: يُقارَن وجهك بالصورة الموجودة على وثيقتك، ويُطابَق رقمك الوطني مع سجل الحالة المدنية. وقد يفحص بعض الخطوات مراجع بشري مخوَّل.","consent.terms.sharing":"تُبلَّغ الجهة التي طلبت هذا التحقق بنتيجته.","consent.terms.retention":"تُخزَّن بياناتك مشفّرة ولا يُحتفظ بها إلا للمدة التي يقتضيها القانون. لممارسة حقوقك المتعلقة بحماية البيانات، تواصل مع الجهة التي طلبت هذا التحقق.","otp.sendTitle":"تحقّق من رقم هاتفك","otp.sendDescription":"سنرسل إليك رمزًا يُستخدم مرة واحدة لتأكيد أن هذا الرقم يخصّك","otp.prefilledNotice":"سنرسل رمز تحقّق إلى رقم هاتفك المسجّل.","otp.phoneLabel":"رقم الهاتف","otp.phoneHelper":"سنرسل رمزًا يُستخدم مرة واحدة إلى هذا الرقم","otp.phonePlaceholder":"+222 36 00 00 00","otp.send":"إرسال الرمز","otp.channelSms":"رسالة نصية","otp.channelWhatsapp":"واتساب","otp.verifyTitle":"أدخل رمز التحقّق","otp.verifyDescription":"أدخل الرمز المكوّن من 6 أرقام الذي أرسلناه إليك لإتمام التحقّق من رقمك","otp.sentTo":"أرسلنا رمزًا مكوّنًا من 6 أرقام إلى {number} عبر {channel}","otp.codeLabel":"رمز التحقّق","otp.codeHelper":"أدخل الرمز المكوّن من 6 أرقام الذي أرسلناه إليك","otp.verify":"تحقّق من الرمز","otp.resend":"إعادة إرسال الرمز","otp.resendIn":"إعادة إرسال الرمز خلال {seconds} ثانية","otp.expiresIn":"ينتهي الرمز خلال {time}","otp.expired":"انتهت صلاحية الرمز — أعد إرسال رمز جديد","otp.reason_otp_mismatch":"الرمز غير صحيح — تحقّق منه وأعد إدخاله","otp.reason_otp_expired":"انتهت صلاحية الرمز — أعد إرسال رمز جديد للمتابعة","otp.reason_otp_send_failed":"تعذّر إرسال الرمز — أعد المحاولة بعد قليل","otp.chooseChannel":"كيف تريد أن تتلقّى رمزك؟","otp.sendBy":"إرسال الرمز عبر {channel}","otp.resendBy":"إعادة الإرسال عبر {channel}","otp.reason_otp_channel_unavailable":"هذه الوسيلة غير متاحة — اختر طريقة أخرى لتلقّي رمزك","otp.reason_otp_destination_not_allowed":"لا يمكننا إرسال الرموز إلى أرقام هذا البلد — أدخل رقمًا آخر","otp.reason_otp_destination_unknown":"تعذّر التعرّف على هذا الرقم — تحقّق منه وأعد إدخاله مع رمز البلد","otp.reason_otp_rate_limited":"طلبت رموزًا كثيرة — انتظر قليلًا ثم أعد المحاولة","session.steps.population.title":"أدخل رقم تعريفك الوطني","session.steps.population.description":"يُطابَق رقمك الوطني المكوّن من 10 أرقام مع سجل الحالة المدنية","population.label":"الرقم الوطني للتعريف (NNI)","population.helper":"رقم التعريف الوطني المكوّن من 10 أرقام كما هو مطبوع على بطاقتك","population.placeholder":"3501234567","population.submit":"تحقّق من رقمي","population.invalid":"أدخل الأرقام العشرة للرقم الوطني كما هو مطبوع على بطاقة هويتك","population.reason_registry_unavailable":"سجل الحالة المدنية غير متاح مؤقتًا — لم يُتحقَّق من رقمك. أعد المحاولة بعد قليل","population.reason_nni_not_found":"لم يُعثر على هذا الرقم في سجل الحالة المدنية — تأكد من مطابقته تمامًا لبطاقتك","population.reason_nni_invalid":"هذا الرقم ليس رقمًا وطنيًا صالحًا — تحقق من الأرقام العشرة المطبوعة على بطاقة هويتك","population.bound.description":"قدّمت الجهة الطالبة رقمك الوطني للتعريف مسبقًا — أكّد للتحقق منه في سجل الحالة المدنية","population.bound.confirm":"تأكيد ومتابعة","population.reason_nni_not_found_or_document":"لم نعثر على هذا الرقم. تأكّد منه، أو استخدم وثيقتك بدلًا منه.","population.useDocument":"استخدام وثيقتي بدلًا من ذلك","population.fromDocument.title":"التحقق في السجل المدني","population.fromDocument.description":"نتحقق من الرقم الوطني المقروء من وثيقتك في السجل المدني","population.fromDocument.continue":"متابعة","session.steps.doc.titleRecto":"صوّر الوجه الأمامي لوثيقة هويتك","session.steps.doc.titleVerso":"صوّر الوجه الخلفي لوثيقة هويتك","session.steps.doc.description":"استخدم إضاءة جيدة وأبقِ البطاقة كاملة داخل الإطار","doc.pickTitle":"أي وثيقة ستستخدم؟","doc.pickDescription":"اختر وثيقة الهوية التي بحوزتك — ستمسحها بالكاميرا","doc.pickLabel":"نوع الوثيقة","doc.startScan":"بدء المسح","doc.titlePassport":"امسح صفحة بيانات جواز سفرك","doc.reason_side_missing":"حُفظ أحد الوجهين — صوّر الآن الوجه المتبقي من الوثيقة","doc.reason_unreadable":"تعذّرت قراءة الوثيقة — أعد التقاط الصورة بحيث تكون البطاقة كاملة وواضحة داخل الإطار","doc.process_failed":"تعذّرت معالجة هذه الصورة — التقط صورة جديدة وأعد المحاولة","doc.uploading":"جارٍ رفع وثيقتك…","doc.cameraBlocked":"نحتاج إلى الكاميرا لمسح الوثيقة — الوصول إلى الكاميرا محظور أو غير متاح","doc.cameraBlockedHint":"اسمح بالوصول إلى الكاميرا لهذا الموقع من إعدادات المتصفح ثم أعد المحاولة","doc.retryCamera":"إعادة تجربة الكاميرا","doc.holdUpright":"ضع الوثيقة داخل الإطار — سيتم الالتقاط تلقائيًا. للحصول على صورة أوضح، أدر هاتفك أفقيًا","dcv2.sensing":"جارٍ البحث عن الوثيقة — ضعها داخل الإطار","dcv2.too_far":"قرّب الوثيقة حتى تملأ الإطار","dcv2.too_close":"ابتعد قليلًا — أبقِ الوثيقة كاملة داخل الإطار","dcv2.edge_clipped":"أدخل الوثيقة كاملة داخل الإطار — أبقِ الحواف ظاهرة","dcv2.wrong_shape":"هذا لا يبدو صحيحًا — ضع الوثيقة مسطحة باتجاه الكاميرا مباشرة","dcv2.tilted":"أمسك الهاتف بشكل مستوٍ فوق الوثيقة — الزاوية كبيرة جدًا","dcv2.too_dark":"ابحث عن مكان أكثر إضاءة — أنر الوثيقة","dcv2.too_bright":"الإضاءة قوية جدًا — أمل الوثيقة بعيدًا عن الانعكاس","dcv2.blurry":"ثبّت هاتفك — الصورة غير واضحة","dcv2.focus_far":"قريب جدًا للتركيز — أبعد الهاتف قليلًا","dcv2.glare":"الضوء ينعكس على الوثيقة — أملها قليلًا","dcv2.hold_still":"ممتاز — لا تتحرك","dcv2.processing":"جارٍ الالتقاط…","dcv2.side_captured":"تم التقاط هذا الوجه — اقلب الوثيقة إلى الوجه الخلفي","dcv2.captured":"تم الالتقاط","session.processing.title":"جارٍ معالجة عمليات التحقق","session.processing.description":"يستغرق ذلك عادةً بضع ثوانٍ — وستظهر النتيجة هنا","handoff.title":"تابع على هاتفك","session.result.approved.title":"تم التحقق من هويتك","session.result.approved.description":"انتهيت — يمكنك إغلاق هذه الصفحة","session.result.review.title":"تحققك قيد المراجعة","session.result.review.description":"سيتم إرسال النتيجة إلى الجهة التي أرسلت لك هذا الرابط — لا حاجة لأي إجراء آخر.","session.result.rejected.title":"تعذّر التحقق من هويتك","session.result.rejected.description":"تواصل مع الجهة التي أرسلت إليك هذا الرابط إذا كنت تعتقد أن الأمر خطأ","session.result.expired.title":"انتهت صلاحية جلسة التحقق هذه","session.result.expired.description":"اطلب رابطًا جديدًا من الجهة التي أرسلته، ثم ابدأ من جديد","session.result.detailsMismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى {org}. تواصل مع {org}.","session.result.deviceVelocity":"لا يمكن استخدام هذا الجهاز لعملية تحقق أخرى حاليًا. تواصل مع {org}.","result.referenceLabel":"الرمز المرجعي","common.loading":"جارٍ تحميل جلسة التحقق","common.refresh":"حدّث الحالة","common.noAttemptsLeft":"لم تتبقَّ أي محاولة","session.steps.portrait.title":"التقط صورة الهوية","session.steps.portrait.description":"انظر مباشرة إلى الكاميرا بملامح محايدة، أمام جدار سادة وفاتح","portrait.coach.no_face":"ضع وجهك داخل الإطار البيضاوي","portrait.coach.multiple_faces":"تأكد من عدم وجود أي شخص آخر في الصورة","portrait.coach.center":"ضع وجهك في وسط الإطار البيضاوي","portrait.coach.too_close":"ابتعد قليلاً","portrait.coach.pose":"انظر مباشرة إلى الكاميرا","portrait.coach.eyes":"افتح عينيك أكثر قليلاً","portrait.coach.mouth":"أغلق فمك، بتعبير محايد","portrait.coach.glare":"أمِل نظارتك أو انزعها","portrait.coach.lighting":"اجعل وجهك مقابل نافذة أو مصباح","portrait.coach.lighting_side":"تجنّب الإضاءة من جانب واحد","portrait.coach.background":"قف أمام جدار فاتح اللون وسادة","portrait.coach.resolution":"اقترب قليلاً","portrait.coach.hold_still":"لا تتحرك","portrait.coach.hold":"ممتاز — لا تتحرك","portrait.criteria.face":"الوجه داخل الإطار","portrait.criteria.framing":"في الوسط","portrait.criteria.pose":"النظر مباشرة","portrait.criteria.eyes":"العينان مفتوحتان","portrait.criteria.mouth":"تعبير محايد","portrait.criteria.glare":"بلا انعكاس","portrait.criteria.lighting":"إضاءة متساوية","portrait.criteria.background":"خلفية سادة","portrait.criteria.resolution":"قريب بما يكفي","portrait.criteria.sharpness":"ثابت","portrait.report.pose":"وضعية الرأس","portrait.report.eyes":"العينان","portrait.report.mouth":"تعبير الوجه","portrait.report.occlusion":"الوجه مكشوف","portrait.report.glare":"انعكاس النظارة","portrait.report.lighting":"الإضاءة","portrait.report.background":"الخلفية","portrait.report.resolution":"المسافة","portrait.checksLabel":"فحوصات الصورة","portrait.met":"تم","portrait.notMet":"ليس بعد","portrait.starting":"جارٍ تشغيل الكاميرا…","portrait.taken":"تم التقاط الصورة","portrait.uploading":"جارٍ إرسال صورتك…","portrait.checking":"جارٍ التحقق من صورتك…","portrait.retryTitle":"لنلتقط صورتك مرة أخرى","portrait.reportTitle":"ما يجب تصحيحه","portrait.retake":"التقط الصورة مرة أخرى","portrait.uploadFailed":"تعذّر إرسال صورتك. تحقّق من اتصالك ثم أعد المحاولة.","portrait.sendAgain":"أرسل الصورة مرة أخرى","portrait.matching":"جارٍ مقارنة صورتك بوثيقة هويتك…","portrait.reviewTitle":"سنراجع صورتك","portrait.reviewDescription":"سيتحقق أحد أعضاء فريقنا من صورتك. يمكنك المتابعة.","portrait.cameraBlocked":"نحتاج إلى الكاميرا لالتقاط صورة الهوية — الوصول إلى الكاميرا محظور أو غير متاح","portrait.cameraBlockedHint":"اسمح بالوصول إلى الكاميرا لهذا الموقع من إعدادات المتصفح ثم أعد المحاولة","portrait.retryCamera":"إعادة تجربة الكاميرا","reasons.icao_pose":"انظر مباشرة إلى الكاميرا","reasons.icao_eyes":"افتح عينيك أكثر قليلاً","reasons.icao_mouth":"أغلق فمك وحافظ على ملامح محايدة","reasons.icao_occlusion":"أزل ما يغطي وجهك، وأمِل نظارتك أو انزعها","reasons.icao_lighting":"قف مقابل نافذة أو مصباح، وتجنب الضوء من جهة واحدة","reasons.icao_background":"قف أمام جدار سادة وفاتح","reasons.icao_resolution":"اقترب قليلاً من الكاميرا","reasons.portrait_not_from_liveness":"يجب أن تكون الصورة للشخص نفسه الذي أجرى فحص الوجه. التقطها بنفسك مرة أخرى","method.national_eid":"التحقق عبر {provider}","method.national_eidGeneric":"التحقق عبر هويتك الرقمية الوطنية","consent.short":"بالمتابعة، فإنك توافق على {terms}.","consent.termsLink":"الشروط","session.progressLabel":"تقدّم التحقق","section.contact":"تحقق من وسيلة التواصل","section.identity":"تحقق من هويتك","section.live_photo":"التقط صورة حية","section.screening":"فحوصات إضافية","handoff.copied":"تم نسخ الرابط — افتحه على هاتفك","needsApp.title":"يتطلب هذا التحقق تطبيقًا على الهاتف","needsApp.description":"تطلب {org} قراءة شريحة مستندك. افتح تطبيق {org} على هاتف يدعم NFC للمتابعة.","needsApp.descriptionNoOrg":"يقرأ هذا التحقق شريحة مستندك. افتح التطبيق على هاتف يدعم NFC للمتابعة.","population.recheck.title":"تحقّق من رقمك الوطني","population.recheck.description":"لم يتطابق وجهك مع السجل الخاص بهذا الرقم. تحقّق من الرقم وأدخله مرة أخرى.","otp.phoneInvalid":"أدخل رقم هاتفك مع رمز البلد، مثل ‎+222 36 00 00 00","otp.codeInvalid":"أدخل الرمز المكوّن من 6 أرقام","doc.countryTitle":"ما البلد الذي أصدر وثيقتك؟","doc.countryLabel":"بلد الإصدار","doc.countrySearch":"ابحث عن بلد","doc.noCountryMatch":"لا يوجد بلد يطابق بحثك","doc.type.carte_identite":"بطاقة الهوية","doc.type.residence_permit":"بطاقة الإقامة","doc.type.passport":"جواز السفر","doc.showSide":"اعرض أحد وجهي البطاقة","doc.showPage":"اعرض صفحة الصورة","doc.flip":"اقلب البطاقة","doc.sameFace":"الوجه نفسه · اقلب البطاقة","doc.reaskRecto":"اعرض الوجه الأمامي مرة أخرى","doc.reread":"تعذّرت قراءة هذا الوجه · ثبّت البطاقة في إضاءة جيدة","doc.photoTaken":"تم التقاط الصورة","doc.frontCaptured":"تم التقاط الوجه الأمامي","doc.backCaptured":"تم التقاط الوجه الخلفي","doc.pageCaptured":"تم التقاط الصفحة","doc.progressFront":"الأمام","doc.progressBack":"الخلف","doc.progressPage":"صفحة الصورة","doc.shutter":"التقط الصورة","doc.torchOn":"شغّل الضوء","doc.torchOff":"أطفئ الضوء","result.platform_unsupported":"يتطلب هذا التحقق تطبيقًا على الهاتف.","unsupported.title":"يلزم التحديث","unsupported.description":"تتطلب هذه الخطوة إصدارًا أحدث من هذه الصفحة. تواصل مع {org}.","shell.subtitle":"التحقق من الهوية","shell.verifiedBy":"تم التحقق بواسطة Sekyro AI","doc.sub.carte_identite":"الوجه والظهر","doc.sub.residence_permit":"الوجه والظهر","doc.sub.passport":"الصفحة التي تحمل صورتك","native.close":"إغلاق","native.face.introTitle":"لنتحقق الآن من وجهك","native.face.introLead":"لقطة واحدة دون أي حركة خاصة: انظر إلى الشاشة فقط.","native.doc.holdIt":"احتفظ بوثيقتك في متناول يدك.","native.doc.changeCountry":"تغيير البلد","native.result.approved":"اكتمل التحقق. يمكنك العودة إلى {org}.","native.result.review":"ستُرسل النتيجة إلى {org}. لا يلزمك فعل أي شيء آخر.","native.result.rejected":"تواصل مع {org} إذا كنت تعتقد أن هذا خطأ.","native.result.expired":"ابدأ من جديد من {org} للحصول على جلسة جديدة.","native.result.copied":"تم النسخ","native.result.back":"العودة إلى {org}"};var c={"session.title":"Verify your identity","session.requestedBy":"{orgName} asks you to verify your identity","returning.requestedBy":"{orgName} asks you to confirm it's you","consent.notice":"By completing this identity verification, you consent to the processing of your personal and biometric data to verify your identity.","consent.details":"Learn more","consent.terms.intro":"Sekyro AI verifies your identity on behalf of the organization that sent you this link. Before you start, review how your data is used.","consent.terms.data":"During verification, Sekyro AI collects photos of your identity document, a short selfie video, a selfie photo, and your national identification number (NNI).","consent.terms.processing":"This data is used only to verify your identity: your face is compared with the photo on your document, and your NNI is checked against the civil registry. Some steps may be examined by an authorized human reviewer.","consent.terms.sharing":"The organization that requested this verification is informed of its outcome.","consent.terms.retention":"Your data is stored encrypted and kept only as long as the law requires. To exercise your data-protection rights, contact the organization that requested this verification.","otp.sendTitle":"Verify your phone number","otp.sendDescription":"We'll send you a one-time code to confirm this number is yours","otp.prefilledNotice":"We'll send a verification code to your registered phone number.","otp.phoneLabel":"Phone number","otp.phoneHelper":"We'll send a one-time code to this number","otp.phonePlaceholder":"+222 36 00 00 00","otp.send":"Send code","otp.channelSms":"SMS","otp.channelWhatsapp":"WhatsApp","otp.verifyTitle":"Enter the verification code","otp.verifyDescription":"Type the 6-digit code we sent you to finish verifying your number","otp.sentTo":"We sent a 6-digit code to {number} via {channel}","otp.codeLabel":"Verification code","otp.codeHelper":"Enter the 6-digit code we sent you","otp.verify":"Verify code","otp.resend":"Resend code","otp.resendIn":"Resend code in {seconds}s","otp.expiresIn":"Code expires in {time}","otp.expired":"That code has expired — resend a new one","otp.reason_otp_mismatch":"That code was incorrect — check it and enter it again","otp.reason_otp_expired":"That code has expired — resend a new code to continue","otp.reason_otp_send_failed":"We couldn't send the code — try again in a moment","otp.chooseChannel":"How should we send your code?","otp.sendBy":"Send code by {channel}","otp.resendBy":"Resend by {channel}","otp.reason_otp_channel_unavailable":"That channel isn't available — choose another way to get your code","otp.reason_otp_destination_not_allowed":"We can't send codes to numbers from this country — enter another number","otp.reason_otp_destination_unknown":"We couldn't recognise this number — check it and enter it again with the country code","otp.reason_otp_rate_limited":"Too many codes requested — wait a moment, then try again","session.steps.population.title":"Enter your national ID number","session.steps.population.description":"Your 10-digit NNI is checked against the civil registry","population.label":"National ID (NNI)","population.helper":"10-digit national identification number, exactly as printed on your ID","population.placeholder":"3501234567","population.submit":"Verify my number","population.invalid":"Enter the 10-digit NNI printed on your national ID","population.reason_registry_unavailable":"The civil registry is temporarily unreachable — your number was not checked. Try again in a moment","population.reason_nni_not_found":"This number was not found in the civil registry — check that it matches your ID exactly","population.reason_nni_invalid":"This is not a valid NNI — check the 10 digits printed on your national ID","population.bound.description":"The requester already provided your national ID number — confirm to check it against the civil registry","population.bound.confirm":"Confirm and continue","population.reason_nni_not_found_or_document":"We couldn't find this number. Check it, or use your document instead.","population.useDocument":"Use my document instead","population.fromDocument.title":"Checking the civil registry","population.fromDocument.description":"We're checking the national number from your document against the civil registry","population.fromDocument.continue":"Continue","session.steps.doc.titleRecto":"Photograph the front of your ID document","session.steps.doc.titleVerso":"Photograph the back of your ID document","session.steps.doc.description":"Use good lighting and keep the whole card inside the frame","doc.pickTitle":"Which document will you use?","doc.pickDescription":"Choose the identity document you have with you — you will scan it with your camera","doc.pickLabel":"Document type","doc.startScan":"Start scanning","doc.titlePassport":"Scan your passport data page","doc.reason_side_missing":"One side is saved — now photograph the remaining side of the document","doc.reason_unreadable":"We could not read the document — retake the photo with the whole card sharp and inside the frame","doc.process_failed":"We could not process this photo — take a new one and try again","doc.uploading":"Uploading your document…","doc.cameraBlocked":"We need your camera to scan the document — camera access is blocked or unavailable","doc.cameraBlockedHint":"Allow camera access for this site in your browser settings, then try again","doc.retryCamera":"Try the camera again","doc.holdUpright":"Fit the document inside the frame — it captures by itself. For a sharper photo, turn your phone sideways","dcv2.sensing":"Looking for the document — fit it inside the frame","dcv2.too_far":"Bring the document closer so it fills the frame","dcv2.too_close":"Move back a little — keep the whole document in the frame","dcv2.edge_clipped":"Fit the whole document inside the frame — keep the edges visible","dcv2.wrong_shape":"That doesn't look right — lay the document flat, straight toward the camera","dcv2.tilted":"Hold the phone flat above the document — too much angle","dcv2.too_dark":"Find a brighter spot — light the document","dcv2.too_bright":"Too much light — tilt the document away from the glare","dcv2.blurry":"Hold your phone steady — the image is blurry","dcv2.focus_far":"Too close to focus — move the phone a little farther","dcv2.glare":"Light is reflecting off the document — tilt it slightly","dcv2.hold_still":"Perfect — hold still","dcv2.processing":"Capturing…","dcv2.side_captured":"Side captured — flip the document to the back","dcv2.captured":"Captured","session.processing.title":"Your checks are being processed","session.processing.description":"This usually takes a few seconds — the result will appear here","handoff.title":"Continue on your phone","session.result.approved.title":"Your identity is verified","session.result.approved.description":"You are done — you can close this page","session.result.review.title":"Your verification is under review","session.result.review.description":"The result will be sent to the organization that gave you this link — you don't need to do anything else.","session.result.rejected.title":"Your identity could not be verified","session.result.rejected.description":"Contact the organization that sent you this link if you believe this is a mistake","session.result.expired.title":"This verification session has expired","session.result.expired.description":"Request a new link from the organization that sent it, then start again","session.result.detailsMismatch":"The details don't match the information {org} has. Contact {org}.","session.result.deviceVelocity":"This device can't be used for another verification right now. Contact {org}.","result.referenceLabel":"Reference code","common.loading":"Loading your verification session","common.refresh":"Refresh status","common.noAttemptsLeft":"No attempts left","session.steps.portrait.title":"Take your ID photo","session.steps.portrait.description":"Look straight at the camera with a neutral expression, in front of a plain, light wall","portrait.coach.no_face":"Place your face inside the oval","portrait.coach.multiple_faces":"Make sure no one else is in the picture","portrait.coach.center":"Center your face in the oval","portrait.coach.too_close":"Move back a little","portrait.coach.pose":"Look straight at the camera","portrait.coach.eyes":"Open your eyes a little more","portrait.coach.mouth":"Close your mouth, neutral expression","portrait.coach.glare":"Tilt your glasses or remove them","portrait.coach.lighting":"Face a window or a lamp","portrait.coach.lighting_side":"Avoid light from one side","portrait.coach.background":"Stand in front of a plain, light wall","portrait.coach.resolution":"Come a little closer","portrait.coach.hold_still":"Hold still","portrait.coach.hold":"Perfect — hold still","portrait.criteria.face":"Face in the oval","portrait.criteria.framing":"Centered","portrait.criteria.pose":"Looking straight","portrait.criteria.eyes":"Eyes open","portrait.criteria.mouth":"Neutral expression","portrait.criteria.glare":"No glare","portrait.criteria.lighting":"Even light","portrait.criteria.background":"Plain background","portrait.criteria.resolution":"Close enough","portrait.criteria.sharpness":"Steady","portrait.report.pose":"Head position","portrait.report.eyes":"Eyes","portrait.report.mouth":"Expression","portrait.report.occlusion":"Face uncovered","portrait.report.glare":"Glasses glare","portrait.report.lighting":"Lighting","portrait.report.background":"Background","portrait.report.resolution":"Distance","portrait.checksLabel":"Photo checks","portrait.met":"done","portrait.notMet":"not yet","portrait.starting":"Starting the camera…","portrait.taken":"Photo taken","portrait.uploading":"Sending your photo…","portrait.checking":"Checking your photo…","portrait.retryTitle":"Let's take your photo again","portrait.reportTitle":"What to fix","portrait.retake":"Take the photo again","portrait.uploadFailed":"We couldn't send your photo. Check your connection, then try again.","portrait.sendAgain":"Send the photo again","portrait.matching":"Comparing your photo with your identity document…","portrait.reviewTitle":"We'll review your photo","portrait.reviewDescription":"A member of our team will check your photo. You can continue.","portrait.cameraBlocked":"We need your camera to take your ID photo — camera access is blocked or unavailable","portrait.cameraBlockedHint":"Allow camera access for this site in your browser settings, then try again","portrait.retryCamera":"Try the camera again","reasons.icao_pose":"Look straight at the camera","reasons.icao_eyes":"Open your eyes a little more","reasons.icao_mouth":"Close your mouth and keep a neutral expression","reasons.icao_occlusion":"Remove anything covering your face, and tilt or remove your glasses","reasons.icao_lighting":"Face a window or a lamp, and avoid light from one side","reasons.icao_background":"Stand in front of a plain, light wall","reasons.icao_resolution":"Come a little closer to the camera","reasons.portrait_not_from_liveness":"The photo must be of the same person who did the face check. Take it again yourself","method.national_eid":"Verify with {provider}","method.national_eidGeneric":"Verify with your national eID","consent.short":"By continuing, you agree to the {terms}.","consent.termsLink":"terms","session.progressLabel":"Verification progress","section.contact":"Verify your contact","section.identity":"Verify your identity","section.live_photo":"Take a live photo","section.screening":"Additional checks","handoff.copied":"Link copied — open it on your phone","needsApp.title":"This verification needs a phone app","needsApp.description":"{org} asks to read your document's chip. Open {org}'s app on a phone with NFC to continue.","needsApp.descriptionNoOrg":"This verification reads your document's chip. Open the app on a phone with NFC to continue.","population.recheck.title":"Check your national number","population.recheck.description":"Your face didn't match the record for this number. Check the number and enter it again.","otp.phoneInvalid":"Enter your phone number with the country code, for example +222 36 00 00 00","otp.codeInvalid":"Enter the 6-digit code","doc.countryTitle":"Which country issued your document?","doc.countryLabel":"Issuing country","doc.countrySearch":"Search for a country","doc.noCountryMatch":"No country matches your search","doc.type.carte_identite":"Identity card","doc.type.residence_permit":"Residence permit","doc.type.passport":"Passport","doc.showSide":"Show one side of the card","doc.showPage":"Show the photo page","doc.flip":"Turn the card over","doc.sameFace":"Same side · turn the card over","doc.reaskRecto":"Show the front again","doc.reread":"We couldn't read this side · hold it steady in good light","doc.photoTaken":"Photo taken","doc.frontCaptured":"Front captured","doc.backCaptured":"Back captured","doc.pageCaptured":"Page captured","doc.progressFront":"Front","doc.progressBack":"Back","doc.progressPage":"Photo page","doc.shutter":"Take the photo","doc.torchOn":"Turn on the light","doc.torchOff":"Turn off the light","result.platform_unsupported":"This verification needs a phone app.","unsupported.title":"Update required","unsupported.description":"This step needs a newer version of this page. Contact {org}.","shell.subtitle":"Identity verification","shell.verifiedBy":"Verified by Sekyro AI","doc.sub.carte_identite":"Front and back","doc.sub.residence_permit":"Front and back","doc.sub.passport":"The page with your photo","native.close":"Close","native.face.introTitle":"Now let's check your face","native.face.introLead":"One capture, no special movement: just look at the screen.","native.doc.holdIt":"Keep your document within reach.","native.doc.changeCountry":"Change country","native.result.approved":"Your verification is complete. You can go back to {org}.","native.result.review":"The result will be sent to {org}. There's nothing else you need to do.","native.result.rejected":"Contact {org} if you think this is a mistake.","native.result.expired":"Start again from {org} to get a new session.","native.result.copied":"Copied","native.result.back":"Back to {org}"};var p={"session.title":"Vérifiez votre identité","session.requestedBy":"{orgName} vous demande de vérifier votre identité","returning.requestedBy":"{orgName} vous demande de confirmer qu'il s'agit bien de vous","consent.notice":"En poursuivant la vérification d'identité, vous consentez au traitement de vos données personnelles et biométriques afin de vérifier votre identité.","consent.details":"En savoir plus","consent.terms.intro":"Sekyro AI vérifie votre identité pour le compte de l'organisme qui vous a envoyé ce lien. Avant de commencer, consultez la façon dont vos données sont utilisées.","consent.terms.data":"Pendant la vérification, Sekyro AI recueille les photos de votre pièce d'identité, une courte vidéo selfie, une photo selfie et votre numéro national d'identification (NNI).","consent.terms.processing":"Ces données servent uniquement à vérifier votre identité : votre visage est comparé à la photo de votre document et votre NNI est vérifié auprès du registre d'état civil. Certaines étapes peuvent être examinées par un examinateur humain habilité.","consent.terms.sharing":"L'organisme qui a demandé cette vérification est informé de son résultat.","consent.terms.retention":"Vos données sont stockées chiffrées et conservées uniquement pendant la durée exigée par la loi. Pour exercer vos droits en matière de protection des données, contactez l'organisme qui a demandé cette vérification.","otp.sendTitle":"Vérifiez votre numéro de téléphone","otp.sendDescription":"Nous vous enverrons un code à usage unique pour confirmer que ce numéro vous appartient","otp.prefilledNotice":"Nous enverrons un code de vérification à votre numéro de téléphone enregistré.","otp.phoneLabel":"Numéro de téléphone","otp.phoneHelper":"Nous enverrons un code à usage unique à ce numéro","otp.phonePlaceholder":"+222 36 00 00 00","otp.send":"Envoyer le code","otp.channelSms":"SMS","otp.channelWhatsapp":"WhatsApp","otp.verifyTitle":"Saisissez le code de vérification","otp.verifyDescription":"Saisissez le code à 6 chiffres que nous vous avons envoyé pour finaliser la vérification de votre numéro","otp.sentTo":"Nous avons envoyé un code à 6 chiffres au {number} par {channel}","otp.codeLabel":"Code de vérification","otp.codeHelper":"Saisissez le code à 6 chiffres que nous vous avons envoyé","otp.verify":"Vérifier le code","otp.resend":"Renvoyer le code","otp.resendIn":"Renvoyer le code dans {seconds} s","otp.expiresIn":"Le code expire dans {time}","otp.expired":"Ce code a expiré — renvoyez-en un nouveau","otp.reason_otp_mismatch":"Ce code est incorrect — vérifiez-le et saisissez-le à nouveau","otp.reason_otp_expired":"Ce code a expiré — renvoyez un nouveau code pour continuer","otp.reason_otp_send_failed":"Nous n'avons pas pu envoyer le code — réessayez dans un instant","otp.chooseChannel":"Comment souhaitez-vous recevoir votre code ?","otp.sendBy":"Envoyer le code par {channel}","otp.resendBy":"Renvoyer par {channel}","otp.reason_otp_channel_unavailable":"Ce moyen d'envoi n'est pas disponible — choisissez une autre façon de recevoir votre code","otp.reason_otp_destination_not_allowed":"Nous ne pouvons pas envoyer de code aux numéros de ce pays — saisissez un autre numéro","otp.reason_otp_destination_unknown":"Nous n'avons pas reconnu ce numéro — vérifiez-le et saisissez-le à nouveau avec l'indicatif du pays","otp.reason_otp_rate_limited":"Trop de codes demandés — patientez un instant, puis réessayez","session.steps.population.title":"Saisissez votre numéro national d'identification","session.steps.population.description":"Votre NNI à 10 chiffres est vérifié auprès du registre d'état civil","population.label":"Numéro national d'identification (NNI)","population.helper":"Numéro national d'identification à 10 chiffres, tel qu'imprimé sur votre pièce","population.placeholder":"3501234567","population.submit":"Vérifier mon numéro","population.invalid":"Saisissez les 10 chiffres du NNI imprimé sur votre pièce d'identité","population.reason_registry_unavailable":"Le registre d'état civil est temporairement inaccessible — votre numéro n'a pas été vérifié. Réessayez dans un instant","population.reason_nni_not_found":"Ce numéro est introuvable dans le registre d'état civil — vérifiez qu'il correspond exactement à votre pièce","population.reason_nni_invalid":"Ce numéro n'est pas un NNI valide — vérifiez les 10 chiffres imprimés sur votre pièce d'identité","population.bound.description":"L'organisme demandeur a déjà fourni votre numéro national d'identification — confirmez pour le vérifier auprès de l'état civil","population.bound.confirm":"Confirmer et continuer","population.reason_nni_not_found_or_document":"Nous n'avons pas trouvé ce numéro. Vérifiez-le, ou utilisez plutôt votre document.","population.useDocument":"Utiliser plutôt mon document","population.fromDocument.title":"Vérification auprès du registre civil","population.fromDocument.description":"Nous vérifions le numéro national lu sur votre document auprès du registre civil","population.fromDocument.continue":"Continuer","session.steps.doc.titleRecto":"Photographiez le recto de votre pièce d'identité","session.steps.doc.titleVerso":"Photographiez le verso de votre pièce d'identité","session.steps.doc.description":"Utilisez un bon éclairage et gardez la carte entière dans le cadre","doc.pickTitle":"Quel document allez-vous utiliser ?","doc.pickDescription":"Choisissez la pièce d'identité en votre possession — vous la scannerez avec votre caméra","doc.pickLabel":"Type de document","doc.startScan":"Commencer le scan","doc.titlePassport":"Scannez la page de données de votre passeport","doc.reason_side_missing":"Une face est enregistrée — photographiez maintenant l'autre face du document","doc.reason_unreadable":"Nous n'avons pas pu lire le document — reprenez la photo avec la carte entière, nette et dans le cadre","doc.process_failed":"Nous n'avons pas pu traiter cette photo — prenez-en une nouvelle et réessayez","doc.uploading":"Envoi de votre document…","doc.cameraBlocked":"Nous avons besoin de votre caméra pour scanner le document — l'accès est bloqué ou indisponible","doc.cameraBlockedHint":"Autorisez l'accès à la caméra pour ce site dans les réglages du navigateur, puis réessayez","doc.retryCamera":"Réessayer la caméra","doc.holdUpright":"Placez le document dans le cadre — la capture est automatique. Pour une photo plus nette, tournez votre téléphone à l'horizontale","dcv2.sensing":"Recherche du document — placez-le dans le cadre","dcv2.too_far":"Rapprochez le document pour qu'il remplisse le cadre","dcv2.too_close":"Reculez un peu — gardez tout le document dans le cadre","dcv2.edge_clipped":"Placez tout le document dans le cadre — gardez les bords visibles","dcv2.wrong_shape":"Cela ne semble pas correct — posez le document à plat, face à la caméra","dcv2.tilted":"Tenez le téléphone à plat au-dessus du document — trop d'angle","dcv2.too_dark":"Trouvez un endroit plus lumineux — éclairez le document","dcv2.too_bright":"Trop de lumière — inclinez le document pour éviter les reflets","dcv2.blurry":"Tenez votre téléphone immobile — l'image est floue","dcv2.focus_far":"Trop près pour la mise au point — éloignez un peu le téléphone","dcv2.glare":"La lumière se reflète sur le document — inclinez-le légèrement","dcv2.hold_still":"Parfait — ne bougez plus","dcv2.processing":"Capture…","dcv2.side_captured":"Face capturée — retournez le document","dcv2.captured":"Capturé","session.processing.title":"Vos vérifications sont en cours de traitement","session.processing.description":"Cela prend généralement quelques secondes — le résultat s'affichera ici","handoff.title":"Continuez sur votre téléphone","session.result.approved.title":"Votre identité est vérifiée","session.result.approved.description":"C'est terminé — vous pouvez fermer cette page","session.result.review.title":"Votre vérification est en cours d'examen","session.result.review.description":"Le résultat sera transmis à l'organisation qui vous a envoyé ce lien — vous n'avez rien d'autre à faire.","session.result.rejected.title":"Votre identité n'a pas pu être vérifiée","session.result.rejected.description":"Contactez l'organisme qui vous a envoyé ce lien si vous pensez qu'il s'agit d'une erreur","session.result.expired.title":"Cette session de vérification a expiré","session.result.expired.description":"Demandez un nouveau lien à l'organisme qui l'a envoyé, puis recommencez","session.result.detailsMismatch":"Ces informations ne correspondent pas à celles dont dispose {org}. Contactez {org}.","session.result.deviceVelocity":"Cet appareil ne peut pas servir à une autre vérification pour le moment. Contactez {org}.","result.referenceLabel":"Code de référence","common.loading":"Chargement de votre session de vérification","common.refresh":"Actualiser le statut","common.noAttemptsLeft":"Plus aucune tentative","session.steps.portrait.title":"Prenez votre photo d’identité","session.steps.portrait.description":"Regardez la caméra bien en face, l’expression neutre, devant un mur uni et clair","portrait.coach.no_face":"Placez votre visage dans l'ovale","portrait.coach.multiple_faces":"Assurez-vous d'être seul sur la photo","portrait.coach.center":"Centrez votre visage dans l'ovale","portrait.coach.too_close":"Reculez un peu","portrait.coach.pose":"Regardez droit vers la caméra","portrait.coach.eyes":"Ouvrez un peu plus les yeux","portrait.coach.mouth":"Fermez la bouche, expression neutre","portrait.coach.glare":"Inclinez vos lunettes ou retirez-les","portrait.coach.lighting":"Placez-vous face à une fenêtre ou une lampe","portrait.coach.lighting_side":"Évitez la lumière venant d'un seul côté","portrait.coach.background":"Placez-vous devant un mur uni et clair","portrait.coach.resolution":"Rapprochez-vous un peu","portrait.coach.hold_still":"Ne bougez plus","portrait.coach.hold":"Parfait — ne bougez plus","portrait.criteria.face":"Visage dans l'ovale","portrait.criteria.framing":"Centré","portrait.criteria.pose":"Regard droit","portrait.criteria.eyes":"Yeux ouverts","portrait.criteria.mouth":"Expression neutre","portrait.criteria.glare":"Sans reflet","portrait.criteria.lighting":"Lumière uniforme","portrait.criteria.background":"Fond uni","portrait.criteria.resolution":"Assez proche","portrait.criteria.sharpness":"Stable","portrait.report.pose":"Position de la tête","portrait.report.eyes":"Yeux","portrait.report.mouth":"Expression","portrait.report.occlusion":"Visage dégagé","portrait.report.glare":"Reflets des lunettes","portrait.report.lighting":"Éclairage","portrait.report.background":"Arrière-plan","portrait.report.resolution":"Distance","portrait.checksLabel":"Contrôles de la photo","portrait.met":"validé","portrait.notMet":"pas encore","portrait.starting":"Démarrage de la caméra…","portrait.taken":"Photo prise","portrait.uploading":"Envoi de votre photo…","portrait.checking":"Vérification de votre photo…","portrait.retryTitle":"Reprenons votre photo","portrait.reportTitle":"À corriger","portrait.retake":"Reprendre la photo","portrait.uploadFailed":"Nous n'avons pas pu envoyer votre photo. Vérifiez votre connexion, puis réessayez.","portrait.sendAgain":"Renvoyer la photo","portrait.matching":"Comparaison de votre photo avec votre pièce d'identité…","portrait.reviewTitle":"Nous allons vérifier votre photo","portrait.reviewDescription":"Un membre de notre équipe vérifiera votre photo. Vous pouvez continuer.","portrait.cameraBlocked":"Nous avons besoin de votre caméra pour prendre votre photo d'identité — l'accès à la caméra est bloqué ou indisponible","portrait.cameraBlockedHint":"Autorisez l'accès à la caméra pour ce site dans les réglages du navigateur, puis réessayez","portrait.retryCamera":"Réessayer la caméra","reasons.icao_pose":"Regardez la caméra bien en face","reasons.icao_eyes":"Ouvrez un peu plus les yeux","reasons.icao_mouth":"Fermez la bouche et gardez une expression neutre","reasons.icao_occlusion":"Retirez ce qui couvre votre visage, et inclinez ou retirez vos lunettes","reasons.icao_lighting":"Placez-vous face à une fenêtre ou une lampe, sans lumière d’un seul côté","reasons.icao_background":"Placez-vous devant un mur uni et clair","reasons.icao_resolution":"Rapprochez-vous un peu de la caméra","reasons.portrait_not_from_liveness":"La photo doit être celle de la personne qui a fait le contrôle du visage. Reprenez-la vous-même","method.national_eid":"Vérifier avec {provider}","method.national_eidGeneric":"Vérifier avec votre eID national","consent.short":"En continuant, vous acceptez les {terms}.","consent.termsLink":"conditions","session.progressLabel":"Progression de la vérification","section.contact":"Vérifiez votre contact","section.identity":"Vérifiez votre identité","section.live_photo":"Prenez une photo en direct","section.screening":"Contrôles complémentaires","handoff.copied":"Lien copié — ouvrez-le sur votre téléphone","needsApp.title":"Cette vérification nécessite une application mobile","needsApp.description":"{org} demande de lire la puce de votre document. Ouvrez l'application de {org} sur un téléphone avec NFC pour continuer.","needsApp.descriptionNoOrg":"Cette vérification lit la puce de votre document. Ouvrez l'application sur un téléphone avec NFC pour continuer.","population.recheck.title":"Vérifiez votre numéro national","population.recheck.description":"Votre visage ne correspond pas au dossier de ce numéro. Vérifiez le numéro et saisissez-le à nouveau.","otp.phoneInvalid":"Saisissez votre numéro avec l'indicatif du pays, par exemple +222 36 00 00 00","otp.codeInvalid":"Saisissez le code à 6 chiffres","doc.countryTitle":"Quel pays a délivré votre document ?","doc.countryLabel":"Pays de délivrance","doc.countrySearch":"Rechercher un pays","doc.noCountryMatch":"Aucun pays ne correspond à votre recherche","doc.type.carte_identite":"Carte d'identité","doc.type.residence_permit":"Titre de séjour","doc.type.passport":"Passeport","doc.showSide":"Montrez une face de la carte","doc.showPage":"Montrez la page avec la photo","doc.flip":"Retournez la carte","doc.sameFace":"Même face · retournez la carte","doc.reaskRecto":"Remontrez le recto","doc.reread":"Lecture impossible · tenez la carte stable, bien éclairée","doc.photoTaken":"Photo prise","doc.frontCaptured":"Recto capturé","doc.backCaptured":"Verso capturé","doc.pageCaptured":"Page capturée","doc.progressFront":"Recto","doc.progressBack":"Verso","doc.progressPage":"Page photo","doc.shutter":"Prendre la photo","doc.torchOn":"Allumer la lampe","doc.torchOff":"Éteindre la lampe","result.platform_unsupported":"Cette vérification nécessite une application mobile.","unsupported.title":"Mise à jour requise","unsupported.description":"Cette étape nécessite une version plus récente de cette page. Contactez {org}.","shell.subtitle":"Vérification d'identité","shell.verifiedBy":"Vérifié par Sekyro AI","doc.sub.carte_identite":"Recto et verso","doc.sub.residence_permit":"Recto et verso","doc.sub.passport":"La page avec votre photo","native.close":"Fermer","native.face.introTitle":"Vérifions maintenant votre visage","native.face.introLead":"Une seule prise, sans geste particulier : regardez simplement l'écran.","native.doc.holdIt":"Gardez votre document à portée de main.","native.doc.changeCountry":"Changer de pays","native.result.approved":"Votre vérification est terminée. Vous pouvez retourner à {org}.","native.result.review":"Le résultat sera transmis à {org}. Vous n'avez rien d'autre à faire.","native.result.rejected":"Contactez {org} si vous pensez qu'il s'agit d'une erreur.","native.result.expired":"Recommencez depuis {org} pour obtenir une nouvelle session.","native.result.copied":"Copiée","native.result.back":"Revenir à {org}"};import{createContext as h,useContext as m,useMemo as d}from"react";import{jsx as y}from"react/jsx-runtime";var v={en:c,fr:p,ar:s};function g(t,e){return e===void 0?t:t.replace(/\{(\w+)\}/g,(o,r)=>Object.hasOwn(e,r)?String(e[r]):o)}i(g,"formatTemplate");function f(t,e){let o={...a(t),...v[t]};if(e!==void 0)for(let r of Object.keys(e)){let n=e[r];typeof n=="string"&&(o[r]=n)}return o}i(f,"resolveSekyroStrings");var l=h(null);function u(t,e){let o=f(t,e);return{locale:t,strings:o,t:i((r,n)=>g(o[r]??"",n),"t")}}i(u,"build");function x({locale:t,strings:e,children:o}){let r=d(()=>u(t,e),[t,e]);return y(l.Provider,{value:r,children:o})}i(x,"StepI18nProvider");function N(t,e){let o=m(l);return d(()=>o!==null&&t===void 0&&e===void 0?o:u(t??o?.locale??"en",e),[o,t,e])}i(N,"useStepI18n");export{s as a,c as b,p as c,g as d,f as e,x as f,N as g};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a as d}from"./chunk-P2LX7BBE.js";import{g as u}from"./chunk-5SVCGLYS.js";import{a as c}from"./chunk-Q232JYNO.js";import{a as y,b as f}from"./chunk-63NUMQST.js";import{a,b as m}from"./chunk-4RUZQW5T.js";import{useState as k}from"react";var C={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function b(r,t){switch(r.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let s=r.nationalEid?.providerName;return s?t.t("method.national_eid",{provider:s}):t.t("method.national_eidGeneric")}default:return null}}a(b,"identityLabel");function L(r,t){let[s,i]=k(!1),[o,l]=k(null);return{busy:s,error:o,run:a(h=>{i(!0),l(null),h().then(()=>i(!1),p=>{i(!1),l(r.t(d(p,r.strings))),t?.(p)})},"run")}}a(L,"useChoiceAction");import{useId as g}from"react";import{Fragment as v,jsx as e,jsxs as n}from"react/jsx-runtime";function _(){let r=`sekyro-face-light-${g().replace(/[^A-Za-z0-9_-]/g,"")}`;return n("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[e("defs",{children:e("mask",{id:r,children:e("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),e("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),e("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),e("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),e("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${r})`})]})}a(_,"FaceMark");var I={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function H({start:r,context:t,tips:s,tipsTitle:i}){let{t:o}=u();return n("section",{className:"sekyro-step",children:[e(_,{}),e(y,{title:o("native.face.introTitle"),lead:o("native.face.introLead")}),i!==void 0?e("p",{className:"sekyro-section-label",children:i}):null,e("ul",{className:"sekyro-tiprows",children:s!==void 0?s.map(l=>n("li",{children:[e(c,{name:I[l.id]??"face"}),l.text]},l.id)):n(v,{children:[n("li",{children:[e(c,{name:"light"}),o("capture.tips.light")]}),n("li",{children:[e(c,{name:"jGlasses"}),o("capture.tips.uncover")]}),n("li",{children:[e(c,{name:"smartphone"}),o("capture.tips.eyeLevel")]})]})}),t.assets==="failed"?e(m,{kind:"ghost",onClick:t.retryAssets,children:o("common.refresh")}):null,e(f,{children:n(m,{full:!0,disabled:t.assets!=="ready","aria-busy":t.assets==="loading"||void 0,onClick:r,children:[e(c,{name:"camera"}),o("capture.start")]})})]})}a(H,"FaceIntro");export{C as a,b,L as c,H as d};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a as Ft,b as Bt,c as E}from"./chunk-65JA6YKG.js";import{a as n,b as T,f as Kt,g as Ot,h as Ut,i as Gt,j as Ht,k as D,l as $e}from"./chunk-4RUZQW5T.js";import{useId as nr}from"react";import{Fragment as tr,jsx as I,jsxs as z}from"react/jsx-runtime";function W({className:e,children:t}){return I("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(W,"Svg");var it="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 Dt(e){return z(W,{...e,children:[I("circle",{cx:"12",cy:"12",r:"4"}),I("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(Dt,"SunIcon");function $t(e){return z(W,{...e,children:[I("circle",{cx:"12",cy:"12",r:"9"}),I("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}n($t,"FaceUncoveredIcon");function qt(e){return z(W,{...e,children:[I("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),I("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),I("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}n(qt,"PhoneEyeLevelIcon");function jt(e){return z(W,{...e,children:[I("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"}),I("circle",{cx:"12",cy:"12",r:"2.8"})]})}n(jt,"LookStraightIcon");function zt(e){return z(W,{...e,children:[I("path",{d:it}),I("path",{d:"M9 13l2 2 4-4"})]})}n(zt,"CameraCheckIcon");function Wt(e){return z(W,{...e,children:[I("path",{d:it}),I("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(Wt,"CameraAskIcon");function Yt(e){return z(W,{...e,children:[I("path",{d:it}),I("path",{d:"M3 3l18 18"})]})}n(Yt,"CameraBlockedIcon");function ge({off:e,className:t}){return z(W,{...t!==void 0?{className:t}:{},children:[I("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?I("path",{d:"M4 4l16 16"}):z(tr,{children:[I("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),I("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}n(ge,"SpeakerIcon");function Zt(e){return I(W,{...e,children:I("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}n(Zt,"CheckIcon");function Xt(e){return z(W,{className:e.className??"sekyro-spinner",children:[I("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),I("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}n(Xt,"SpinnerIcon");import{jsx as oe,jsxs as Qt}from"react/jsx-runtime";var qe=["light","uncover","eyeLevel","straight"],rr={light:{key:"capture.tips.light",icon:n(()=>oe(Dt,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:n(()=>oe($t,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:n(()=>oe(qt,{}),"icon")},straight:{key:"capture.tips.straight",icon:n(()=>oe(jt,{}),"icon")}};function Jt({tips:e}){let t=E(),s=nr();return e.length===0?null:Qt("section",{className:"sekyro-tips","aria-labelledby":s,"data-testid":"sekyro-tips",children:[oe("p",{className:"sekyro-tips__title",id:s,children:t("capture.tips.title")}),oe("ul",{className:"sekyro-tips__list",children:e.map(o=>{let r=typeof o=="string"?rr[o]:void 0,i=typeof o=="string"?o:o.id,c=r!==void 0?r.icon():typeof o=="string"?void 0:o.icon,d=r!==void 0?t(r.key):typeof o=="string"?o:o.text;return Qt("li",{className:"sekyro-tips__item",children:[c!=null?oe("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:c}):null,oe("span",{children:d})]},i)})})]})}n(Jt,"TipList");import{useEffect as en,useId as or,useRef as sr,useState as ir}from"react";import{jsx as Y,jsxs as je}from"react/jsx-runtime";var ar=220;function tn({title:e,description:t,options:s,busy:o,error:r,focus:i,testId:c,look:d="cards",marked:y,onChoose:V}){let C=or(),R=$e(),[p,l]=ir(null),m=sr(null);en(()=>{r!==null&&l(null)},[r]),en(()=>()=>{m.current!==null&&clearTimeout(m.current)},[]);let k=n(u=>{o||p!==null||(l(u),m.current=setTimeout(()=>{m.current=null,l(null),V(u)},ar))},"choose");return je("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":C,"data-testid":c,children:[je("div",{className:"sekyro-stack sekyro-stack--1",children:[Y("h2",{id:C,ref:i?R:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?Y("p",{className:"sekyro-text-muted",children:t}):null]}),r!==null?Y(D,{tone:"danger",children:Y("span",{children:r})}):null,d==="buttons"?Y("div",{className:"sekyro-stack sekyro-stack--3",children:s.map((u,b)=>Y(T,{kind:b===0?"primary":"ghost",full:!0,disabled:o,"aria-busy":o||void 0,onClick:()=>V(u.id),children:u.label},u.id))}):Y("div",{className:"sekyro-choices",children:s.map(u=>je("button",{type:"button",className:"sekyro-card","aria-pressed":(p??y)===u.id,"aria-busy":o||void 0,disabled:o||p!==null&&p!==u.id,onClick:()=>k(u.id),children:[u.glyph,je("span",{className:"sekyro-card__body",children:[Y("span",{className:"sekyro-card__title",children:u.label}),u.sub!==void 0?Y("span",{className:"sekyro-card__sub",children:u.sub}):null]}),Y("span",{className:"sekyro-radio","aria-hidden":"true"})]},u.id))})]})}n(tn,"ChoiceScreen");var ze=["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 le(e){return e!==null&&ze.includes(e)}n(le,"isVoiceKey");import{useCallback as X,useEffect as ue,useLayoutEffect as dr,useMemo as pr,useRef as ke,useState as Le}from"react";var cr=n((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function he(e,t,s){let o;try{if(typeof e=="function")o=e(t,s);else{let r=e[s];o=r!=null&&cr(r,t)?r[t]:null}}catch{return null}return typeof o=="string"&&o!==""?o:null}n(he,"resolveClip");var lr="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",on={ar:"ar-SA",fr:"fr-FR",en:"en-US"};function Z(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}n(Z,"synth");function ur(){return Z()!==null&&typeof SpeechSynthesisUtterance=="function"}n(ur,"speechAvailable");function nn(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}n(nn,"baseLang");function sn(e,t){let s=n(r=>r.replace(/_/g,"-").toLowerCase(),"norm"),o=nn(t);return e.find(r=>s(r.lang)===s(t))??e.find(r=>nn(r.lang)===o)}n(sn,"pickVoice");function an(e){if(!ur())return!1;let t=[];try{t=Z()?.getVoices()??[]}catch{return!0}return t.length===0||sn(t,e)!==void 0}n(an,"speechUsable");function cn(e){let t=Z();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}n(cn,"subscribeVoices");function xe(e){try{let t=typeof location<"u"?location.href:"http://localhost/",s=new URL(e,t);return`clip:${s.origin}${s.pathname}`}catch{return`clip:${e}`}}n(xe,"clipIdentity");function rn(e){e.pause(),e.removeAttribute("src"),e.load()}n(rn,"release");function ln(){let e=null,t=null,s=0,o=null,r=[],i=new Map,c=n(()=>{r=Z()?.getVoices()??[]},"loadVoices"),d=!1,y=n(()=>{let l=Z();d||l===null||(d=!0,c(),l.addEventListener?.("voiceschanged",c))},"bindVoices"),V=n(()=>(e??(e=new Audio),e),"element"),C=n((l,m,k)=>{let u=Z();if(u!==null&&l!==""&&typeof SpeechSynthesisUtterance=="function"){y();let b=sn(r,m);if(r.length===0||b!==void 0){u.cancel();let g=new SpeechSynthesisUtterance(l);g.lang=m,b!==void 0&&(g.voice=b),g.rate=.95,k!==void 0&&(g.onend=g.onerror=k),u.speak(g);return}}k?.()},"speak"),R=n(()=>{s+=1,o=null,e!==null&&(e.pause(),e.currentTime=0),Z()?.cancel()},"stop"),p=n(l=>{for(let m of l){let k=xe(m);if(i.has(k))continue;let u=new Audio;u.preload="auto",u.src=m,i.set(k,u)}},"warmClips");return{say(l){let m=l.url!==null?xe(l.url):`tts:${l.lang}:${l.text}`;if(m===o)return;o=m,s+=1;let k=s,u=l.onEnd,b=u!==void 0?()=>{k===s&&u()}:void 0;if(Z()?.cancel(),l.url!==null){let g=V();g.pause(),g.muted=!1,g.src=l.url,g.currentTime=0,g.onended=b??null,g.play()?.catch(S=>{k===s&&S?.name!=="AbortError"&&(l.speech?C(l.text,l.lang,b):b?.())});return}l.speech?C(l.text,l.lang,b):b?.()},unlock({lang:l,speech:m,prefetch:k}){let u=V();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let S=Uint8Array.from(atob(lr),L=>L.charCodeAt(0));t=URL.createObjectURL(new Blob([S],{type:"audio/wav"}))}let b=u.paused===!1&&t!==null&&u.src!==t;t!==null&&!b&&(u.muted=!0,u.onended=null,u.src=t,u.play()?.catch(()=>{}));let g=Z();if(m&&g!==null&&typeof SpeechSynthesisUtterance=="function"){y();let S=new SpeechSynthesisUtterance(" ");S.volume=0,S.lang=l,g.speak(S)}p(k??[])},prefetch:p,stop:R,dispose(){R(),d&&Z()?.removeEventListener?.("voiceschanged",c),d=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&rn(e),e=null;for(let l of i.values())rn(l);i.clear()}}}n(ln,"createVoicePlayer");var un="sekyro.voiceGuidance";function dn(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(dn,"readVoicePreference");function pn(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}n(pn,"writeVoicePreference");var Ne="capture.tips.summary",fr=typeof window<"u"?dr:ue,yr=Object.freeze({});function at(e,t){let s=new Set,o=[];for(let r of ze){let i=r===Ne?null:he(e,r,t);i===null||s.has(xe(i))||(s.add(xe(i)),o.push(i))}return o}n(at,"resolvedClipUrls");function ct({locale:e,defaultClips:t,options:s}){let o=s===!1,r=o?{}:s??{},i=r.storageKey===void 0?un:r.storageKey,[c,d]=Le(r.defaultEnabled??!0),y=ke(c),[V,C]=Le(!1),[R,p]=Le("none"),[l,m]=Le(!1),k=ke(!1),[u,b]=Le(0),g=ke(null),S=X(()=>(g.current??(g.current=ln()),g.current),[]),L=on[e],K=r.speechFallback,h=K===void 0||K===!0?!0:K===!1?!1:K.includes(e),M=r.clips??t??yr,F=ke(!1),O=ke(M);fr(()=>{O.current=M,y.current=c}),ue(()=>{if(o||i===null)return;let f=dn(i);f!==null&&(y.current=f,d(f))},[o,i]),ue(()=>{if(!(o||!h))return cn(()=>b(f=>f+1))},[o,h]);let a=r.clips;ue(()=>{if(o)return;let f=h&&an(L);C(at(M,e).length>0||f),p(a!==void 0&&he(a,Ne,e)!==null?"partner":he(M,Ne,e)!==null||f?"default":"none")},[o,M,a,e,h,L,u]),ue(()=>{if(o||!c||!F.current)return;let f=at(M,e);f.length>0&&S().prefetch(f)},[o,c,M,e,S]),ue(()=>()=>{g.current?.dispose(),g.current=null,F.current=!1},[]);let A=X(f=>{o||(F.current=!0,S().unlock({lang:L,speech:h,...f?{prefetch:at(O.current,e)}:{}}))},[o,S,L,h,e]),N=X(()=>A(y.current),[A]),H=X(()=>{k.current=!1,m(!1)},[]),w=X(()=>{H(),g.current?.stop()},[H]),se=X(()=>{k.current&&w()},[w]),U=X((f,q)=>{if(o)return;if(k.current){w();return}let te=S();te.stop(),k.current=!0,m(!0);let Ke=q?.clip===!1?null:he(O.current,Ne,e);te.say({url:Ke,text:f,lang:L,speech:h,onEnd:H})},[o,w,S,e,L,h,H]),P=X(f=>{o||(f?A(!0):w(),i!==null&&pn(i,f),y.current=f,d(f))},[o,A,w,i]),v=X(()=>P(!y.current),[P]),ie=X((f,q)=>{if(o||!c)return;k.current&&H();let te=he(O.current,f,e);S().say({url:te,text:q,lang:L,speech:h})},[o,c,e,S,L,h,H]);return pr(()=>({supported:!o&&V,enabled:!o&&c,setEnabled:P,toggle:v,unlock:N,speakKey:ie,stop:w,summary:o?"none":R,summaryPlaying:l,toggleSummary:U,stopSummary:se}),[o,V,c,P,v,N,ie,w,R,l,U,se])}n(ct,"useVoiceGuidance");function lt(e,t,s,o){let{speakKey:r,stop:i,enabled:c}=e,d=ke(!1);ue(()=>{if(!o||!c){d.current&&i(),d.current=!1;return}d.current=!0,le(t)&&t!==Ne&&s!==""&&r(t,s)},[o,c,t,s,r,i])}n(lt,"useSpeakGuidance");import{isValidElement as Yr,useCallback as Qe,useContext as Zr,useEffect as de,useMemo as be,useRef as pe,useState as qn}from"react";import{jsx as we,jsxs as fn}from"react/jsx-runtime";var mr=Array.from({length:56},(e,t)=>{let s=t/56*2*Math.PI-Math.PI/2,o=Math.cos(s),r=Math.sin(s);return{id:`tick-${t}`,frac:t/55,x1:150+108*o,y1:150+108*r,x2:150+138*o,y2:150+138*r,style:{transitionDelay:`${t*6}ms`}}});function gr(e,t,s,o){return s?"var(--sekyro-color-success)":e?o?"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(gr,"tickColor");var hr="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function yn({progress:e,phase:t,draining:s=!1}){let o=Math.min(1,Math.max(0,e)),r=Math.round(o*56),i=t==="checking",c=t==="recording",d=t==="frozen",y=i||d,V=i||c||d,C=t==="locked"||V,R=s&&!C;return fn("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":r,"data-recording":c?"":void 0,"data-draining":R?"":void 0,children:[we("path",{fillRule:"evenodd",d:hr,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":y?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),fn("g",{className:t==="locked"?"sekyro-capture-settle":void 0,children:[we("g",{className:y?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:mr.map((p,l)=>we("line",{x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,stroke:gr(l<r,p.frac,C,R),strokeWidth:3,strokeLinecap:"round",style:p.style,className:"sekyro-arc__tick"},p.id))}),we("g",{className:t==="seeking"?"sekyro-capture-breathe":void 0,children:we("circle",{cx:150,cy:150,r:100,fill:"none",stroke:C?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:C?3.5:2.5,className:V?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}n(yn,"CaptureArc");import{jsx as G,jsxs as Ee}from"react/jsx-runtime";function mn({videoRef:e,guidanceText:t,guidanceHint:s,guidanceKey:o,progress:r,phase:i,draining:c=!1,stillUrl:d,showChecking:y,onSwitchCamera:V,canSwitchCamera:C,voicePrompt:R,overlay:p,reduceMotion:l=!1}){let m=E(),k=i==="checking",b=k||i==="frozen",g=b&&y?m("capture.checking"):t,S=R?.(s,g,o);return Ee("div",{className:l?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[G("video",{ref:e,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),d!==null&&b?G("img",{src:d,alt:m("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,G(yn,{progress:r,phase:i,draining:c}),p?.(e),S!=null&&!b?G("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:S}):null,C?G(T,{kind:"chip",onClick:V,"aria-label":m("capture.switchCamera"),className:"sekyro-stage__corner-end","data-testid":"sekyro-switch-camera",children:G(kr,{})}):null,k&&y?Ee("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[G(vr,{}),m("capture.cameraOff")]}):null,Ee("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[G("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:g},g),b&&y?G("span",{className:"sekyro-stage__guidance-hint",children:m("capture.checkingHint")}):null]})]})}n(mn,"CaptureStage");function kr(){return Ee("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[G("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"}),G("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),G("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(kr,"FlipCameraIcon");function vr(){return Ee("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:[G("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"}),G("path",{d:"M3 3l18 18"})]})}n(vr,"CameraOffIcon");import{useEffect as Cr,useRef as br}from"react";import{jsx as ve,jsxs as ut}from"react/jsx-runtime";function gn({showCoaching:e,attemptsText:t,showRetake:s,onRetake:o}){let r=E(),i=br(null);return Cr(()=>{s&&i.current?.focus()},[s]),!e&&!s?null:ut("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?ut("div",{className:"sekyro-stack sekyro-stack--1",children:[ve("p",{className:"sekyro-text-body",children:r("capture.retryCoaching.title")}),ut("ul",{className:"sekyro-coaching",children:[ve("li",{children:r("capture.retryCoaching.light")}),ve("li",{children:r("capture.retryCoaching.eyeLevel")}),ve("li",{children:r("capture.retryCoaching.head")})]}),t!==null?ve("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:t}):null]}):null,s?ve(T,{ref:i,className:"sekyro-btn--start",onClick:o,children:r("capture.recordAgain")}):null]})}n(gn,"CapturedPanel");function We(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}n(We,"isDevBuild");import{createContext as Sr}from"react";var hn=Sr(null);import{useCallback as Sn,useEffect as Vn,useRef as Ce}from"react";import{useId as Vr}from"react";import{jsx as Ye,jsxs as dt}from"react/jsx-runtime";var Rr=["user","environment"];function kn({value:e,onChange:t}){let s=E(),o=Vr();return dt("fieldset",{className:"sekyro-segmented","data-testid":"sekyro-facing",children:[Ye("legend",{className:"sekyro-segmented__legend",children:s("capture.cameraLabel")}),Ye("div",{className:"sekyro-segmented__options",children:Rr.map(r=>dt("label",{className:"sekyro-segmented__option",children:[Ye("input",{type:"radio",className:"sekyro-segmented__input",name:o,value:r,checked:e===r,onChange:()=>t(r)}),dt("span",{className:"sekyro-segmented__face",children:[Ye("span",{className:"sekyro-segmented__dot","aria-hidden":"true"}),s(`capture.facing.${r}`)]})]},r))})]})}n(kn,"FacingPicker");import{useEffect as _r,useState as Ir}from"react";import{jsx as Me,jsxs as xr}from"react/jsx-runtime";function vn({state:e}){let t=E(),[s,o]=Ir(!1);_r(()=>{e!=="unknown"&&o(!0)},[e]);let r=e==="granted"?Me(zt,{}):e==="denied"?Me(Yt,{}):Me(Wt,{});return xr("div",{role:s?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[Me("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:r}),Me("span",{children:t(`capture.permission.${e}`)})]})}n(vn,"PermissionRow");import{jsx as Ze,jsxs as Cn}from"react/jsx-runtime";function bn({voice:e}){let t=E();if(!e.supported)return null;let s=e.enabled;return Cn("button",{type:"button",role:"switch","aria-checked":s,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:()=>e.toggle(),children:[Cn("span",{className:"sekyro-switch__label",children:[Ze(ge,{off:!s}),t("capture.voiceGuidance")]}),Ze("span",{className:"sekyro-switch__track","aria-hidden":"true",children:Ze("span",{className:"sekyro-switch__thumb",children:s?Ze(Zt,{className:"sekyro-switch__check"}):null})})]})}n(bn,"VoiceSwitch");import{Fragment as Nr,jsx as $,jsxs as Ae}from"react/jsx-runtime";function Rn({assets:e,onRetryAssets:t,permission:s,canChooseFacing:o,facing:r,onFacingChange:i,voice:c,tips:d,summary:y,startLabel:V,startDisabled:C,onStart:R}){let p=E(),l=Ce(y?.stop);l.current=y?.stop,Vn(()=>()=>l.current?.(),[]);let m=Ce(null),k=Ce(null),u=Ce(null),b=Ce(e),g=Ce(!1);Vn(()=>{let F=b.current;if(b.current=e,F===e)return;let O=g.current;e!=="loading"&&(g.current=!1),Lr(m.current)&&(e==="failed"?u.current?.focus():O&&k.current?.focus())},[e]);let S=Sn(()=>{g.current=!0,t()},[t]),L=e==="loading",K=L||C,h=Sn(()=>{K||(l.current?.(),R())},[K,R]),M;return e==="failed"?M=Ae(D,{tone:"danger",testId:"sekyro-assets-error",children:[$("p",{className:"sekyro-text-body",children:p("fcv2.err.models")}),$(T,{kind:"ghost",ref:u,className:"sekyro-btn--start",onClick:S,"data-testid":"sekyro-assets-retry",children:p("common.retry")})]}):M=Ae("div",{className:"sekyro-stack sekyro-stack--1",children:[$(T,{ref:k,full:!0,"data-testid":"sekyro-start","aria-disabled":K?"true":void 0,"aria-busy":L?"true":void 0,onClick:h,children:L?Ae(Nr,{children:[$(Xt,{}),p("capture.preparing.title")]}):V??p("capture.start")}),L?$("p",{className:"sekyro-text-muted",children:p("capture.preparing.hint")}):null]}),Ae("div",{ref:m,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[d!==!1?$(Jt,{tips:d}):null,y!==void 0?Ae(T,{kind:"ghost",className:"sekyro-btn--start",onClick:y.toggle,"data-testid":"sekyro-tips-listen",children:[$(ge,{off:!1}),p(y.playing?"capture.tips.stop":"capture.tips.listen")]}):null,$(vn,{state:s}),o?$(kn,{value:r,onChange:i}):null,$(bn,{voice:c}),$("p",{className:"sekyro-text-muted",children:p("capture.securityNote")}),M,$("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(Rn,"PreCaptureScreen");function Lr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}n(Lr,"focusIsOurs");import{hasMultipleCameras as wr,subscribeCameraPermission as Er}from"@sekyro/web";import{useEffect as _n,useState as In}from"react";function xn(){let[e,t]=In({state:"unknown",settled:!1}),[s,o]=In(!1);return _n(()=>Er(r=>t({state:r,settled:!0})),[]),_n(()=>{let r=!0;return wr().then(i=>{r&&o(i)}),()=>{r=!1}},[]),{permission:e.state,permissionSettled:e.settled,canChooseFacing:s}}n(xn,"useCameraStatus");import{useEffect as Ln,useState as Nn}from"react";function wn(e){return Mn(e,"mobileRequired")}n(wn,"useMobileRequired");function En(e){return Mn(e,"returning").required}n(En,"useReturning");function Mn(e,t){let[s,o]=Nn({required:!1,settled:e===void 0});return Ln(()=>{let r=e?.[t];if(e===void 0||typeof r!="function"){o({required:!1,settled:!0});return}let i=!0;return o({required:!1,settled:!1}),Promise.resolve().then(()=>r.call(e)).then(c=>{i&&o({required:c===!0,settled:!0})},()=>{i&&o({required:!1,settled:!0})}),()=>{i=!1}},[e,t]),s}n(Mn,"useFlag");function An(e){let[t,s]=Nn(!1);return Ln(()=>{if(s(!1),e===void 0)return;let o=e.on("busy",()=>s(!0)),r=e.on("result",()=>s(!1));return()=>{o(),r()}},[e]),t}n(An,"useBusy");import{getLivenessAssetsStatus as Mr,preloadLivenessAssets as Ar,subscribeLivenessAssets as Pr}from"@sekyro/web";import{useCallback as pt,useEffect as Pn,useRef as Tn,useState as Tr,useSyncExternalStore as Kr}from"react";var Or=n(()=>"idle","serverSnapshot");function Kn(e){return Ar(e!==void 0?{assetBaseUrl:e}:{})}n(Kn,"preload");function On(e,t=!0){let s=Kr(pt(R=>Pr(R,e),[e]),()=>Mr(e),Or),[o,r]=Tr(null),i=Tn(!1),c=pt(()=>{Kn(e).then(R=>{i.current&&R==="idle"&&r({base:e})})},[e]);Pn(()=>(i.current=!0,c(),()=>{i.current=!1}),[c]);let d=Tn(null);Pn(()=>{if(s!=="idle"){d.current={base:e};return}!t||d.current===null||d.current.base!==e||(d.current=null,c())},[s,e,c,t]);let y=pt(()=>{Kn(e)},[e]);return{gate:o!==null&&o.base===e&&s==="idle"||s==="ready"?"ready":s==="failed"?"failed":"loading",retry:y}}n(On,"useLivenessAssets");import{createLivenessCapture as Ur}from"@sekyro/web";import{useCallback as ft,useEffect as Gr,useRef as Pe,useState as ee}from"react";var Un={progress:0,hint:null,faceDetected:!1};function Gn(e){let{videoRef:t,assetBaseUrl:s}=e,r=Pe(e.verification).current,i=Pe(!1);e.verification!==r&&!i.current&&We()&&(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=Pe(null),[d,y]=ee("idle"),[V,C]=ee(Un),[R,p]=ee(!1),[l,m]=ee(!1),[k,u]=ee(null),[b,g]=ee(!1),[S,L]=ee(null),[K,h]=ee(null),[M,F]=ee(null),O=Pe(null),a=Pe(e);a.current=e,Gr(()=>{let w=t.current;if(w===null)return;let se={video:w,...s!==void 0?{assetBaseUrl:s}:{}},U=r!==void 0?r.liveness(se):Ur(se);c.current=U;let P=[U.on("state",v=>{v==="starting"&&(L(null),h(null),C(Un),m(!1),p(!1),u(null),O.current=null),y(v),a.current.onStateChange?.(v)}),U.on("gate",v=>{let ie=O.current;O.current=v.progress,p(ie!==null&&v.progress<ie-.001&&v.progress>0&&v.progress<1),v.progress>=1&&m(!0),C(v)}),U.on("frozen",({previewDataUrl:v})=>u(v)),U.on("profile",({animations:v})=>g(v==="reduced")),U.on("captured",v=>{L(v),F(null),a.current.onCaptured?.(v)}),U.on("error",v=>{h(v),a.current.onError?.(v)}),r?.on("result",v=>{F(v),a.current.onResult?.(v)})];return()=>{for(let v of P)v?.();c.current=null,U.destroy()}},[r,t,s]);let A=ft(w=>{c.current?.start(w)},[]),N=ft(()=>{c.current?.retry()},[]),H=ft(()=>{m(!1),p(!1),u(null),O.current=null,c.current?.switchCamera()},[]);return{state:d,gate:V,draining:R,gateLocked:l,frozenPreview:k,reduceMotion:b,artifacts:S,error:K,result:M,start:A,retry:N,switchCamera:H}}n(Gn,"useLivenessHandle");import{useCallback as Hr,useEffect as Fr,useState as Xe}from"react";var Br=new Set(["national_number"]);function Hn(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(s=>Br.has(s));return t.length>0?{...e,options:t}:null}n(Hn,"pending");function Fn(e){let[t,s]=Xe(null),[o,r]=Xe(e===void 0),[i,c]=Xe(!1),[d,y]=Xe(!1);Fr(()=>{if(s(null),e===void 0){r(!0);return}let p=!0,l=e.methodChoice;typeof l=="function"?(r(!1),Promise.resolve().then(()=>l.call(e)).then(k=>{p&&s(Hn(k))},()=>{}).finally(()=>{p&&r(!0)})):r(!0);let m=e.on("method",k=>s(Hn(k)));return()=>{p=!1,m()}},[e]);let V=Hr(async p=>{if(e===void 0)return!1;c(!0),y(!1);try{return await e.selectMethod(p),s(null),!0}catch{return y(!0),!1}finally{c(!1)}},[e]),C=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:C==="national_number"&&!d?C:null,settled:o,busy:i,failed:d,select:V}}n(Fn,"useMethodChoice");import{useEffect as Dr,useMemo as $r,useState as qr}from"react";var jr=["ar","fr","en"];function zr(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(zr,"isClipUrl");function Wr(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let s={};for(let o of jr){let r=t[o];if(!(typeof r!="object"||r===null))for(let[i,c]of Object.entries(r))!le(i)||!zr(c)||((s[o]??(s[o]={}))[i]=c)}return Object.keys(s).length>0?s:null}n(Wr,"toVoiceClipMap");function Bn(e){let[t,s]=qr(null);Dr(()=>{if(s(null),e===void 0)return;let r=!0,i=n(d=>{if(!r)return;let y=typeof d=="object"&&d!==null&&typeof d.setId=="string"?d:null;s(V=>V?.setId===y?.setId?V:y)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(i,()=>i(null))}catch{i(null)}let c=e.on("view",d=>i(d.voice));return()=>{r=!1,c()}},[e]);let o=$r(()=>t!==null?Wr(t):null,[t]);return e===void 0?null:o}n(Bn,"useServerVoiceClips");import{jsx as Dn}from"react/jsx-runtime";function $n({voice:e}){let t=E();return Dn(T,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:()=>e.toggle(),children:Dn(ge,{off:!e.enabled,className:"sekyro-icon"})})}n($n,"VoiceChip");import{Fragment as ro,jsx as x,jsxs as Te}from"react/jsx-runtime";var Xr=800;function Qr(e){return e===void 0||e!==!1&&e.length===qe.length&&qe.every(t=>e.includes(t))}n(Qr,"isDefaultTips");function Jr(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(Jr,"carriesActivation");function eo(e){return typeof e=="object"&&e!==null&&!Yr(e)&&"tone"in e&&"text"in e}n(eo,"isNoticeObject");function to(e){return e==="starting"||e==="gating"||e==="recording"}n(to,"isCapturing");function no(e){return e==="captured"||e==="uploading"||e==="checking"}n(no,"isPostCapture");function Li({verification:e,locale:t,dir:s,strings:o,slots:r,autoStart:i=!1,notice:c,startDisabled:d=!1,startLabel:y,tips:V,tipsSummary:C,coach:R,defaultFacing:p,voice:l,onGuidance:m,onCaptured:k,onResult:u,onError:b,onStateChange:g,assetBaseUrl:S,className:L}){let K=be(()=>Ft(t,o),[t,o]),h=be(()=>_=>K[_]??"",[K]),M=s??(t==="ar"?"rtl":"ltr"),F=pe(null),O=Zr(hn),a=Gn({verification:e,videoRef:F,assetBaseUrl:S,onCaptured:k,onResult:u,onError:b,onStateChange:g}),A=On(S,a.state==="idle"&&a.error===null),N=Fn(e),H=N.choice!==null,w=wn(e),se=En(e),U=An(e),P=xn(),v=l!==!1&&l?.clips===void 0,ie=Bn(v?e:void 0),f=ct({locale:t,defaultClips:ie,options:l}),[q,te]=qn(p??"user"),Ke=pe(null),Oe=pe(!1),yt=pe(f.unlock);yt.current=f.unlock,de(()=>{let _=Ke.current;if(_===null)return;let ce=["pointerup","touchend","click","keydown"],re=n(()=>{for(let Ie of ce)_.removeEventListener(Ie,me,!0)},"disarm");function me(Ie){if(Oe.current){re();return}Jr(Ie)&&(Oe.current=!0,re(),yt.current())}n(me,"onGesture");for(let Ie of ce)_.addEventListener(Ie,me,{capture:!0,passive:!0});return re},[]);let mt=Qe(()=>{Oe.current||(Oe.current=!0,f.unlock()),a.start({facing:q})},[f.unlock,a.start,q]),gt=Qe(()=>a.start({facing:q}),[a.start,q]),Ue=pe(!1),Se=a.state==="idle"&&a.error===null,ht=!H&&!w.required&&(i===!0||i==="when-permitted"&&P.permission==="granted"),kt=ht&&N.settled&&w.settled,jn=i==="when-permitted"&&!P.permissionSettled&&!Ue.current,vt=ht&&Se&&!Ue.current,Je=(jn||vt)&&A.gate==="ready"?"loading":A.gate;de(()=>{!kt||!Se||A.gate!=="ready"||Ue.current||(Ue.current=!0,gt())},[kt,Se,A.gate,gt]);let zn=Se&&!H&&!w.required&&!(vt&&A.gate==="ready"),Wn=Qe(()=>{te(_=>_==="user"?"environment":"user"),a.switchCamera()},[a.switchCamera]),Ge=be(()=>a.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(a.artifacts.keyframe):null,[a.artifacts]);de(()=>{if(Ge!==null)return()=>URL.revokeObjectURL(Ge)},[Ge]);let Ct=a.frozenPreview??Ge,fe=e!==void 0,B=to(a.state),ne=no(a.state),He=B||ne,j=a.result,bt=a.state==="done"&&j!==null,St=a.state==="recording"&&a.frozenPreview!==null,et=O!==null,Ve=ne||St,Vt=ne?"checking":St?"frozen":a.state==="recording"?"recording":a.gateLocked||a.gate.progress>=1?"locked":a.gate.faceDetected?"aligning":"seeking",Fe=B?a.gate.hint:null,Be=a.state==="starting"?"capture.preparing.title":Fe===null?null:Fe==="center"&&!a.gate.faceDetected?"fcv3.no_face":Kt(Fe),[Yn,Rt]=qn(null);de(()=>{if(Be!=="fcv3.no_face"){Rt(Be);return}if(!B)return;let _=setTimeout(()=>Rt(Be),Xr);return()=>clearTimeout(_)},[Be,B]);let tt=B&&typeof R=="string"&&R!=="",ae=B&&!tt?Yn:null,nt=tt?R:ae===null?"":h(ae);lt(f,ae,nt,B);let _t=pe(m);_t.current=m,de(()=>{if(le(ae))try{_t.current?.(ae)}catch(_){console.error("[@sekyro/react] onGuidance threw:",_)}},[ae]);let Re=be(()=>({supported:f.supported,enabled:f.enabled,setEnabled:f.setEnabled,toggle:f.toggle}),[f.supported,f.enabled,f.setEnabled,f.toggle]),rt=r?.voicePrompt,It=rt!==void 0,xt=l===void 0,Lt=pe(!1);de(()=>{!It||!xt||Lt.current||!We()||(Lt.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."))},[It,xt]);let Zn=rt!==void 0?(_,ce,re)=>rt(_,ce,re,Re):f.supported?()=>x($n,{voice:Re}):void 0,{summary:ot,summaryPlaying:Nt,toggleSummary:wt,stopSummary:Et}=f,De=C!==void 0&&C!=="",Mt=De?C:h("capture.tips.summary"),At=De?ot!=="none":ot==="partner"||ot==="default"&&Qr(V),Pt=be(()=>At?{playing:Nt,toggle:n(()=>wt(Mt,{clip:!De}),"toggle"),stop:Et}:void 0,[At,Nt,wt,Mt,Et,De]),Xn=be(()=>({assets:Je,retryAssets:A.retry,permission:P.permission,facing:q,setFacing:te,canChooseFacing:P.canChooseFacing,voice:Re}),[Je,A.retry,P.permission,P.canChooseFacing,q,Re]),Qn=eo(c)?x(D,{tone:c.tone,testId:"sekyro-host-notice",children:x("span",{children:c.text})}):c??null,Q=j!==null&&j.status==="retry"?j:null,J=bt&&j.status==="unavailable"&&!H&&j.reason!=="portrait_required"?j:null,_e=bt&&(j.status==="approved"||j.status==="rejected"||j.status==="review")?j:null,ye=n((_,ce)=>{if(_===void 0)return null;if(_==="device_cooldown"){let me=Gt(t,ce);if(me!==null)return h(me.key).replace("{time}",me.time)}let re=Ut(_);return re===null?null:h(re)},"reasonText"),Jn=J!==null&&J.reason!==void 0&&J.reason!=="nni_unbound"&&J.reason!=="method_required"&&J.reason!=="mobile_required"&&!(J.reason==="no_recorder"&&a.artifacts?.degraded==="NO_RECORDER"),Tt=$e(),er=H&&N.auto===null&&!B&&!ne&&a.error===null,st=Qe(async _=>{await N.select(_)&&a.state==="done"&&a.retry()},[N.select,a.state,a.retry]);return de(()=>{N.auto!==null&&!N.busy&&!B&&!ne&&st(N.auto)},[N.auto,N.busy,B,ne,st]),x(Bt,{value:h,children:Te("div",{ref:Ke,className:L===void 0?"sekyro-capture":`sekyro-capture ${L}`,dir:M,lang:t,"data-testid":"sekyro-liveness-capture","data-state":a.state,children:[r?.header,Q!==null&&ye(Q.reason)!==null&&!(et&&He)?x(D,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:x("span",{children:ye(Q.reason)})}):null,U&&ne&&!et?x(D,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:x("span",{children:h("capture.busy")})}):null,w.required&&Se?x(D,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:x("span",{children:h("reasons.mobile_required")})}):null,a.error!==null?r?.errorPanel!==void 0?r.errorPanel(a.error,a.retry):Te(D,{tone:"danger",testId:"sekyro-error-notice",children:[x("span",{children:h(Ot(a.error.kind))}),a.error.retryable?x(T,{ref:Tt,kind:"ghost",className:"sekyro-btn--start",onClick:a.retry,children:h("common.retry")}):null]}):null,J!==null?Te(D,{tone:"danger",testId:"sekyro-unavailable-notice",children:[x("span",{children:ye(J.reason)??h(J.reason===void 0?"errors.session_expired":"errors.network_error")}),Jn?x(T,{ref:Tt,kind:"ghost",className:"sekyro-btn--start",onClick:a.retry,children:h("capture.recordAgain")}):null]}):null,_e!==null&&ye(_e.reason)!==null?x(D,{tone:_e.status==="rejected"?"danger":"info",testId:"sekyro-result-notice",children:x("span",{children:ye(_e.reason,_e.retryAfter)})}):null,x("div",{className:He?void 0:"sekyro-hidden","data-capture-live":He?"":void 0,children:et?O({videoRef:F,guidance:Ve&&fe?h("capture.checking"):nt,coached:tt&&!(Ve&&fe),note:Ve?fe?h(U?"capture.busy":"capture.checkingHint"):null:Q!==null?ye(Q.reason):null,settled:Ve&&fe,progress:a.gate.progress,phase:Vt,still:Ve?Ct:null,live:He}):x(mn,{videoRef:F,guidanceText:nt,guidanceHint:Fe,guidanceKey:ae,progress:a.gate.progress,phase:Vt,draining:a.draining,stillUrl:Ct,showChecking:fe,onSwitchCamera:Wn,canSwitchCamera:B&&a.state!=="recording",voicePrompt:Zn,overlay:r?.stageOverlay,reduceMotion:a.reduceMotion})}),er&&N.choice!==null?x(tn,{title:h("method.title"),description:h("method.description"),options:N.choice.options.map(_=>({id:_,label:h(`method.${_}`)})),busy:N.busy,error:N.failed?h("errors.network_error"):null,focus:a.state==="done",testId:"sekyro-method",look:"buttons",onChoose:_=>{st(_)}}):null,zn?Te(ro,{children:[se&&r?.header===void 0?Te("div",{className:"sekyro-stack sekyro-stack--1",children:[x("h2",{className:"sekyro-text-body",children:h("returning.title")}),x("p",{className:"sekyro-text-muted",children:h("returning.description")})]}):null,Qn,r?.intro!==void 0?r.intro(mt,Xn):x(Rn,{assets:Je,onRetryAssets:A.retry,permission:P.permission,canChooseFacing:P.canChooseFacing,facing:q,onFacingChange:te,voice:Re,tips:V??qe,...Pt!==void 0?{summary:Pt}:{},...y!==void 0?{startLabel:y}:{},startDisabled:d,onStart:mt})]}):null,x(gn,{showCoaching:Q!==null,attemptsText:Q?.attemptsRemaining!==void 0?Ht(K,t,Q.attemptsRemaining):null,showRetake:Q!==null&&!B&&!ne||!fe&&a.state==="captured",onRetake:a.retry}),r?.footer]})})}n(Li,"LivenessCapture");export{hn as a,qe as b,tn as c,ze as d,Xr as e,Li as f};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{d as me}from"./chunk-BJJZ4MO5.js";import"./chunk-65JA6YKG.js";import{a as A}from"./chunk-Q232JYNO.js";import{a as pe,b as he,e as fe,f as ve}from"./chunk-63NUMQST.js";import{a as Se,b as X}from"./chunk-BENNJ4GV.js";import{a as h,b as G,h as de}from"./chunk-4RUZQW5T.js";import{useEffect as R,useLayoutEffect as Ue,useRef as Q,useState as g}from"react";var ge={image:'<path d="M2 12C2 7.29 2 4.93 3.46 3.46C4.93 2 7.29 2 12 2C16.71 2 19.07 2 20.54 3.46C22 4.93 22 7.29 22 12C22 16.71 22 19.07 20.54 20.54C19.07 22 16.71 22 12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 12Z" stroke="currentColor"/><path d="M14 8A2 2 0 1 0 18 8A2 2 0 1 0 14 8Z" stroke="currentColor"/><path d="M2 12.5L3.75 10.97C4.66 10.17 6.04 10.22 6.89 11.07L11.18 15.36C11.87 16.05 12.95 16.14 13.75 15.58L14.04 15.37C15.19 14.57 16.74 14.66 17.78 15.6L21 18.5" stroke="currentColor" stroke-linecap="round"/>',flashlight:'<path d="M9 11.66V19C9 19.93 9 20.4 9.15 20.77C9.36 21.26 9.74 21.64 10.23 21.85C10.6 22 11.07 22 12 22C12.93 22 13.4 22 13.77 21.85C14.26 21.64 14.64 21.26 14.85 20.77C15 20.4 15 19.93 15 19V11.66C15 10.84 15 10.43 15.15 10.06C15.3 9.7 15.59 9.41 16.17 8.83L16.17 8.83L19.41 5.59C19.7 5.3 19.85 5.15 19.92 4.97C20 4.78 20 4.58 20 4.17V4C20 3.06 20 2.59 19.71 2.29C19.41 2 18.94 2 18 2H6C5.06 2 4.59 2 4.29 2.29C4 2.59 4 3.06 4 4V4.17C4 4.58 4 4.78 4.08 4.97C4.15 5.15 4.3 5.3 4.59 5.59L7.83 8.83C8.41 9.41 8.7 9.7 8.85 10.06C9 10.43 9 10.84 9 11.66Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 10H9" stroke="currentColor" stroke-linecap="round"/><path d="M12 13V15" stroke="currentColor" stroke-linecap="round"/><path d="M4.5 5H19.5" stroke="currentColor" stroke-linecap="round"/>'};var ye={"dcv3.mrz.searching":"ضع صفحة جواز السفر كاملة داخل الإطار","dcv3.mrz.showMrzSide":"اعرض الوجه الذي يحتوي على سطرين أو ثلاثة أسطر من الحروف","dcv3.mrz.reading":"جارٍ قراءة الوثيقة… ثبّتها","dcv3.mrz.moveCloser":"اقترب حتى تملأ أسطر الحروف الإطار","dcv3.mrz.turnSideways":"أدر هاتفك أفقيًا لقراءة أسطر الحروف","dcv3.mrz.glare":"أمِل الوثيقة لإزالة الانعكاس","dcv3.mrz.holdStill":"لا تتحرك","dcv3.mrz.valid":"تمت قراءة الوثيقة — جارٍ التقاط الصورة","dcv3.mrz.looksLikePassport":"يبدو أن هذا جواز سفر","dcv3.mrz.looksLikeCard":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"};var ke={"dcv3.mrz.searching":"Fit the whole passport page in the frame","dcv3.mrz.showMrzSide":"Show the side with the two or three lines of characters","dcv3.mrz.reading":"Reading the document… hold it steady","dcv3.mrz.moveCloser":"Move closer so the lines of characters fill the frame","dcv3.mrz.turnSideways":"Turn your phone sideways to read the lines of characters","dcv3.mrz.glare":"Tilt the document to remove the reflection","dcv3.mrz.holdStill":"Hold still","dcv3.mrz.valid":"Document read — taking the photo","dcv3.mrz.looksLikePassport":"This looks like a passport","dcv3.mrz.looksLikeCard":"This looks like an identity card or residence permit"};var we={"dcv3.mrz.searching":"Cadrez toute la page du passeport","dcv3.mrz.showMrzSide":"Montrez la face avec les deux ou trois lignes de caractères","dcv3.mrz.reading":"Lecture du document… tenez-le immobile","dcv3.mrz.moveCloser":"Rapprochez-vous pour que les lignes de caractères remplissent le cadre","dcv3.mrz.turnSideways":"Tournez votre téléphone à l’horizontale pour lire les lignes de caractères","dcv3.mrz.glare":"Inclinez le document pour supprimer le reflet","dcv3.mrz.holdStill":"Ne bougez plus","dcv3.mrz.valid":"Document lu — prise de la photo","dcv3.mrz.looksLikePassport":"Ceci ressemble à un passeport","dcv3.mrz.looksLikeCard":"Ceci ressemble à une carte d’identité ou un titre de séjour"};var be={"native.doc.introTitle":"سنلتقط صورة لوثيقتك","native.doc.introLead":"ستُفتح كاميرا هاتفك، وتُلتقط الصورة تلقائيًا بمجرد أن تكون الوثيقة داخل الإطار.","native.doc.tip.flat":"ضع الوثيقة مسطحة على سطح داكن.","native.doc.tip.glare":"تجنّب انعكاسات المصابيح أو الشمس.","native.doc.tip.frame":"أبقِ الوثيقة كاملة داخل الإطار.","native.doc.openCamera":"افتح الكاميرا","native.doc.changeDocument":"تغيير الوثيقة","native.scan.closer":"اقترب قليلًا","native.scan.farther":"ابتعد قليلًا","native.scan.glare":"أمِل البطاقة قليلًا","native.scan.dark":"الإضاءة ضعيفة. شغّل المصباح.","native.scan.blurry":"الصورة غير واضحة. ثبّت الهاتف.","native.scan.holdStill":"لا تتحرك","native.scan.reading":"جارٍ التحقق من وثيقتك…","native.scan.putDown":"يمكنك وضع وثيقتك جانبًا.","native.scan.retry":"لنحاول مرة أخرى"};var Ce={"native.doc.introTitle":"We'll photograph your document","native.doc.introLead":"Your phone's camera will open. The photo is taken by itself as soon as the document is well framed.","native.doc.tip.flat":"Lay the document flat on a dark surface.","native.doc.tip.glare":"Avoid glare from lamps or sunlight.","native.doc.tip.frame":"Keep the whole document in the frame.","native.doc.openCamera":"Open the camera","native.doc.changeDocument":"Change document","native.scan.closer":"Move a little closer","native.scan.farther":"Move back a little","native.scan.glare":"Tilt the card a little","native.scan.dark":"Too dark. Turn on the light.","native.scan.blurry":"Blurry image. Hold the phone still.","native.scan.holdStill":"Hold still","native.scan.reading":"Checking your document…","native.scan.putDown":"You can put your document down.","native.scan.retry":"Let's try that again"};var ze={"native.doc.introTitle":"Nous allons photographier votre pièce","native.doc.introLead":"La caméra de votre téléphone va s'ouvrir. La photo est prise automatiquement dès que la pièce est bien cadrée.","native.doc.tip.flat":"Posez la pièce à plat, sur une surface sombre.","native.doc.tip.glare":"Évitez les reflets de lampe ou de soleil.","native.doc.tip.frame":"Gardez toute la pièce dans le cadre.","native.doc.openCamera":"Ouvrir la caméra","native.doc.changeDocument":"Changer de document","native.scan.closer":"Approchez un peu","native.scan.farther":"Reculez un peu","native.scan.glare":"Inclinez un peu la carte","native.scan.dark":"Trop sombre. Allumez la lampe.","native.scan.blurry":"Image floue. Tenez le téléphone immobile.","native.scan.holdStill":"Ne bougez plus","native.scan.reading":"Vérification de votre document…","native.scan.putDown":"Vous pouvez poser votre pièce.","native.scan.retry":"Réessayons"};var Be=["locking","capturing"],W=class W{constructor(){this.shown={hint:null,locking:!1,card:null,manualShutter:!1};this.candidate=null;this.candidateSince=0;this.hintShownAt=0;this.lockLostAt=null;this.detectedSince=null;this.lostSince=null;this.shutterSince=null}present(e,r){return this.presentHint(e,r),this.presentLock(e,r),this.presentCard(e,r),this.shutterSince=e.manualShutter?this.shutterSince??r:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&r-this.shutterSince>=1e3},this.shown}presentHint(e,r){let a=e.phase==="framing"&&!(e.hint==="blurry"&&e.card===null)?e.hint:null;if(e.phase!=="framing"){this.shown={...this.shown,hint:null},this.candidate=null;return}if(a!==this.candidate&&(this.candidate=a,this.candidateSince=r),a===this.shown.hint)return;let s=r-this.candidateSince>=(a===null?0:350),u=this.shown.hint===null||r-this.hintShownAt>=1200;s&&u&&(this.shown={...this.shown,hint:a},this.hintShownAt=r)}presentLock(e,r){if(Be.includes(e.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(e.phase!=="framing"){this.shown={...this.shown,locking:!1},this.lockLostAt=null;return}this.lockLostAt??(this.lockLostAt=r),r-this.lockLostAt>=300&&(this.shown={...this.shown,locking:!1},this.lockLostAt=null)}}presentCard(e,r){let a=e.card;if(a===null||e.phase!=="framing"){if(e.phase!=="framing"){this.shown={...this.shown,card:null},this.detectedSince=null,this.lostSince=null;return}this.detectedSince=null,this.lostSince??(this.lostSince=r),r-this.lostSince>=300&&(this.shown={...this.shown,card:null});return}if(this.lostSince=null,this.detectedSince??(this.detectedSince=r),r-this.detectedSince<250)return;let s=this.shown.card;if(s===null){this.shown={...this.shown,card:{...a}};return}let u=.35;this.shown={...this.shown,card:{fill:s.fill+(a.fill-s.fill)*u,offsetX:s.offsetX+(a.offsetX-s.offsetX)*u,offsetY:s.offsetY+(a.offsetY-s.offsetY)*u}}}};h(W,"ScanPresenter");var P=W;import{Fragment as at,jsx as t,jsxs as m}from"react/jsx-runtime";var Fe={en:Ce,fr:ze,ar:be},Ge=450,De=h(n=>e=>me(n.strings[e]??Fe[n.locale][e]??""),"useScanCopy");function Ne({name:n}){return t("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:ge[n]}})}h(Ne,"ScanGlyph");var Xe={en:ke,fr:we,ar:ye};function We(n,e){return n===null||n.state==="fallback"||n.state==="mismatch"?null:n.state==="searching"?e?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":n.state==="valid"?"dcv3.mrz.valid":n.coach!==void 0?`dcv3.mrz.${n.coach}`:"dcv3.mrz.reading"}h(We,"mrzInstruction");function Me(n){return n.reason==="unreadable"?"doc.reason_unreadable":n.reason!==void 0&&n.reason!=="side_missing"?de(n.reason):null}h(Me,"reasonOf");function xt({step:n,i18n:e,liveMrz:r,...a}){let[s,u]=g(!1);return s?t(et,{step:n,i18n:e,...r!==void 0?{liveMrz:r}:{},onClose:()=>u(!1)}):t(qe,{step:n,i18n:e,onOpen:()=>u(!0),...a})}h(xt,"DocumentCaptureView");function Qe({passport:n}){let r=Math.round(228/(n?1.42:1.586));return m("svg",{className:"sekyro-mark sekyro-mark--card",viewBox:`-12 -12 252 ${r+24}`,"aria-hidden":"true",focusable:"false",children:[t("defs",{children:t("clipPath",{id:"sekyro-card-clip",children:t("rect",{width:228,height:r,rx:"12.5"})})}),t("rect",{className:"sekyro-mark__card",width:228,height:r,rx:"12.5"}),t("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:r*.52,rx:"6"}),[0,1,2].map(a=>t("rect",{className:"sekyro-mark__text",x:"88",y:23+a*r*.12,width:100-a*20,height:"6",rx:"3"},a)),[0,1].map(a=>t("rect",{className:"sekyro-mark__text",x:"17",y:r*.74+a*9,width:194,height:"4",rx:"2"},a)),t("g",{clipPath:"url(#sekyro-card-clip)",children:t("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:t("rect",{x:"-1",width:"2",height:r,className:"sekyro-mark__beam"})})}),t("path",{className:"sekyro-mark__brackets",d:Ze(-10,-10,248,r+20,16,30)})]})}h(Qe,"ScanMark");function Ze(n,e,r,a,s,u){let w=Math.min(s,u*.6);return[[n,e,1,1],[n+r,e,-1,1],[n,e+a,1,-1],[n+r,e+a,-1,-1]].map(([C,_,f,E])=>`M${C} ${_+E*u}V${_+E*w}Q${C} ${_} ${C+f*w} ${_}H${C+f*u}`).join("")}h(Ze,"brackets");function qe({step:n,i18n:e,onOpen:r,onChangeCountry:a,onChangeDocument:s}){let u=De(e),w=n.documentType==="passport",y=Me(n);return m("section",{className:"sekyro-step","data-testid":"sekyro-document",children:[t(Qe,{passport:w}),t(pe,{title:u("native.doc.introTitle"),lead:u("native.doc.introLead")}),y!==null?m(Se,{tone:"warning",children:[t("span",{children:e.t(y)}),t("span",{children:X(e,n.attemptsRemaining,n.attemptsExhausted)})]}):null,m("ul",{className:"sekyro-tiprows",children:[m("li",{children:[t(A,{name:w?"passport":"card"}),u("native.doc.tip.flat")]}),m("li",{children:[t(A,{name:"light"}),u("native.doc.tip.glare")]}),m("li",{children:[t(Ne,{name:"image"}),u("native.doc.tip.frame")]})]}),s!==void 0||a!==void 0?m("div",{className:"sekyro-links",children:[s!==void 0?t("button",{type:"button",className:"sekyro-link",onClick:s,children:u("native.doc.changeDocument")}):null,a!==void 0?t("button",{type:"button",className:"sekyro-link",onClick:a,children:e.t("native.doc.changeCountry")}):null]}):null,t(he,{children:m(G,{full:!0,onClick:r,children:[t(A,{name:"camera"}),u("native.doc.openCamera")]})})]})}h(qe,"DocumentIntro");function Le(n,e,r){let a=n*.88,s=a/r;return{x:(n-a)/2,y:e*.42-s/2,w:a,h:s}}h(Le,"guideRect");var je={too_far:"native.scan.closer",too_close:"native.scan.farther",focus_far:"native.scan.farther",glare:"native.scan.glare",too_bright:"native.scan.glare",too_dark:"native.scan.dark",blurry:"native.scan.blurry"},Je=h(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function et({step:n,i18n:e,liveMrz:r,onClose:a}){let s=De(e),u=Q(null),w=Q(null),y=Q(null),[C,_]=g("idle"),[f,E]=g(null),[xe,Z]=g(null),[p,$e]=g({w:0,h:0}),[z,_e]=g({hint:null,locking:!1,card:null,manualShutter:!1}),[q,Te]=g({}),[j,He]=g(null),[J,Re]=g(null),[ee,te]=g(0),[ne,re]=g(null),[O,ae]=g(null),L=n.documentType==="passport",K=L?1.42:1.586;fe(!0),Ue(()=>{let i=u.current;if(i===null)return;let c=h(()=>$e({w:i.clientWidth,h:i.clientHeight}),"measure");if(c(),typeof ResizeObserver>"u")return;let l=new ResizeObserver(c);return l.observe(i),()=>l.disconnect()},[]);let o=Le(p.w,p.h,K);R(()=>{p.w===0||p.h===0||y.current?.setGuide?.({viewAspect:p.w/p.h,rect:{x:o.x/p.w,y:o.y/p.h,width:o.w/p.w,height:o.h/p.h}})},[p.w,p.h,o.x,o.y,o.w,o.h]),R(()=>{let i=w.current;if(i===null)return;let c=n.capture({video:i,...r!==void 0?{liveMrz:r}:{}});y.current=c;let l=u.current;if(l!==null&&l.clientWidth>0&&l.clientHeight>0){let d=Le(l.clientWidth,l.clientHeight,K);c.setGuide?.({viewAspect:l.clientWidth/l.clientHeight,rect:{x:d.x/l.clientWidth,y:d.y/l.clientHeight,width:d.w/l.clientWidth,height:d.h/l.clientHeight}})}let b=new P,S={scan:null,feedback:null,gate:null},N=h(d=>{S={...S,...d};let M=S.gate?.guide,Ye={phase:S.scan?.phase??"framing",hint:S.feedback?.reticle==="coaching"?S.feedback.key:null,card:M?.detected?{fill:M.fill,offsetX:M.offsetX,offsetY:M.offsetY}:null,manualShutter:S.scan?.manualShutter??!1},x=b.present(Ye,performance.now());_e($=>$.hint===x.hint&&$.locking===x.locking&&$.manualShutter===x.manualShutter&&$.card?.fill===x.card?.fill&&$.card?.offsetX===x.card?.offsetX&&$.card?.offsetY===x.card?.offsetY?$:x)},"present"),Ve=[c.on("state",_),c.on("feedback",d=>N({feedback:d})),c.on("gate",d=>N({gate:d})),c.on("scan",d=>{E(d),N({scan:d})}),c.on("captured",d=>{Te(M=>({...M,[tt(d.side,L,M)]:d.previewDataUrl})),He(d.previewDataUrl),Re(rt(i))}),c.on("error",Z),c.on("mrz",d=>{d.state==="mismatch"?ae(d.format??null):re(d)})];return c.start().catch(()=>{}),()=>{for(let d of Ve)d();c.destroy(),y.current=null}},[n.issuer,n.documentType]);let k=f?.phase??"framing",D=k==="reading"||k==="result",V=k==="flipCue"||k==="reaskRecto",T=z.locking,se=f?.captured.length??0;R(()=>{T&&te(i=>i+1)},[T]),R(()=>{se>0&&te(i=>i+1)},[se]);let Ae=f?.expected??null;R(()=>{re(null)},[Ae]),R(()=>{if(O===null)return;let i=setTimeout(()=>ae(null),2e3);return()=>clearTimeout(i)},[O]);let oe=V||D?null:We(ne,L),Y=O!==null?O==="TD3"?"dcv3.mrz.looksLikePassport":"dcv3.mrz.looksLikeCard":oe,Ee=Y===null?null:e.strings[Y]??Xe[e.locale][Y],ie=Me(n),le=z.hint===null?null:je[z.hint]??`dcv2.${z.hint}`,Oe=le??(k==="flipCue"?f?.notice==="same_face"?"doc.sameFace":"doc.flip":k==="reaskRecto"?"doc.reaskRecto":D?"native.scan.reading":k==="locking"||k==="capturing"||T?"native.scan.holdStill":f?.notice==="reread"?"doc.reread":f?.notice==="technical"?"native.scan.retry":f?.notice==="blurry"?"native.scan.blurry":ie??(L?"doc.showPage":"doc.showSide")),B=Ee??s(Oe),H=z.card,v=o;if(!T&&H!==null&&H.fill>=.45&&H.fill<=1.25&&!Je()){let i=o.w*H.fill,c=i/K,l=o.x+o.w/2+o.w*Math.max(-.25,Math.min(.25,H.offsetX)),b=o.y+o.h/2+o.h*Math.max(-.25,Math.min(.25,H.offsetY));v={x:l-i/2,y:b-c/2,w:i,h:c}}let I=o.w*.045,U=28,ce=Math.min(I,U*.6),Ke=[[v.x,v.y,1,1],[v.x+v.w,v.y,-1,1],[v.x,v.y+v.h,1,-1],[v.x+v.w,v.y+v.h,-1,-1]],Ie=T?"is-locked":z.hint!==null?"is-coaching":"",Pe=L?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],ue=o.y+o.h+48,F={insetInlineStart:o.x,insetBlockStart:o.y,inlineSize:o.w,blockSize:o.h,borderRadius:I};return t("section",{className:"sekyro-lm","aria-label":B,"data-testid":"sekyro-document",children:m("div",{ref:u,className:`sekyro-lm-stage${D?" is-reading":""}${V?" is-flip":""}`,style:{"--sekyro-guide-w":`${o.w}px`},children:[t("video",{ref:w,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:i=>{let c=i.currentTarget,l=c.getBoundingClientRect(),b=Math.max(l.width/(c.videoWidth||1),l.height/(c.videoHeight||1)),S=c.videoWidth*b,N=c.videoHeight*b;S>0&&N>0&&y.current?.focusAt((i.clientX-l.left+(S-l.width)/2)/S,(i.clientY-l.top+(N-l.height)/2)/N)}}),p.w>0?m(at,{children:[D&&J!==null?t("img",{className:"sekyro-lm-scene",src:J,alt:""}):null,D&&j!==null?t("img",{className:"sekyro-lm-frozen",src:j,alt:"",style:F}):null,m("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${p.w} ${p.h}`,"aria-hidden":"true",focusable:"false",children:[m("defs",{children:[m("linearGradient",{id:"sekyro-lm-top",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),t("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),m("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),t("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),t("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${p.w}V${p.h}H0Z${nt(o,I)}`}),t("rect",{width:p.w,height:Math.max(0,o.y),fill:"url(#sekyro-lm-top)"}),t("rect",{y:o.y+o.h,width:p.w,height:Math.max(0,p.h-o.y-o.h),fill:"url(#sekyro-lm-bottom)"}),t("g",{className:`sekyro-lm-brackets ${Ie}`,children:Ke.map(([i,c,l,b],S)=>t("path",{style:{transform:`translate(${i}px, ${c}px) scale(${l}, ${b})`},d:`M0 ${U}V${ce}Q0 0 ${ce} 0H${U}`},S))}),T?t("rect",{className:"sekyro-lm-trace",x:o.x,y:o.y,width:o.w,height:o.h,rx:I,pathLength:"1",style:{animationDuration:`${Ge}ms`}}):null]}),t("div",{className:"sekyro-lm-slot",style:F,"aria-hidden":"true",children:D?t("span",{className:"sekyro-lm-read is-repeating"}):ee>0?t("span",{className:"sekyro-lm-read"},ee):null})]}):null,oe!==null?t("div",{className:"sekyro-lm-slot",style:F,"aria-hidden":"true",children:t("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${L?" is-page":""}${ne?.state==="valid"?" is-valid":""}`})}):null,m("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:o.y-64},children:[t("div",{role:"status","aria-live":"polite",children:t(ve,{swapKey:B,className:"sekyro-lm-line",children:B})}),ie!==null&&k==="framing"&&le===null?t("p",{className:"sekyro-lm-attempts",children:X(e,n.attemptsRemaining,n.attemptsExhausted)}):null]}),D?m("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:ue-12},children:[t("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),s("native.scan.putDown")]}):V?t("div",{className:`sekyro-lm-under sekyro-lm-flip${k==="reaskRecto"?" is-toFront":""}`,style:{insetBlockStart:ue-20},"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:m("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(K)},children:[t("span",{className:"sekyro-lm-flip-front"}),t("span",{className:"sekyro-lm-flip-back"})]})}):null,m("div",{className:"sekyro-lm-controls",children:[m("div",{className:"sekyro-lm-bar",children:[t("button",{type:"button",className:"sekyro-glass","aria-label":e.t("native.close"),onClick:a,children:t(A,{name:"close"})}),f?.torchAvailable?t("button",{type:"button",className:`sekyro-glass${f.torch?" is-on":""}`,"aria-label":e.t("doc.torchOn"),"aria-pressed":f.torch,onClick:()=>y.current?.setTorch(!f.torch),children:t(Ne,{name:"flashlight"})}):null]}),xe!==null?m("div",{className:"sekyro-lm-error",role:"alert",children:[t("p",{children:e.t("doc.cameraBlocked")}),t("p",{children:e.t("doc.cameraBlockedHint")}),t(G,{onClick:()=>{Z(null),y.current?.retry()},children:e.t("doc.retryCamera")})]}):null,z.manualShutter?t("button",{type:"button",className:"sekyro-shutter","aria-label":e.t("doc.shutter"),onClick:()=>y.current?.shutter()}):null,t("ol",{className:"sekyro-lm-tray",children:Pe.map(({side:i,label:c})=>{let l=f?.captured.includes(i)??!1;return m("li",{className:l?"is-done":void 0,"aria-current":!l&&(L||f?.expected===i)?"step":void 0,children:[l?m("span",{className:"sekyro-lm-thumb",children:[q[i]!==void 0?t("img",{src:q[i],alt:""}):null,t("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:t("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,s(c)]},i)})})]}),C==="uploading"||C==="checking"?t("span",{className:"sekyro-visually-hidden",role:"status",children:e.t("doc.uploading")}):null]})})}h(et,"LumiereScan");function tt(n,e,r){return e?"single":n==="recto"||n==="verso"?n:r.recto===void 0?"recto":"verso"}h(tt,"slotOf");function nt({x:n,y:e,w:r,h:a},s){return`M${n+s} ${e}H${n+r-s}Q${n+r} ${e} ${n+r} ${e+s}V${e+a-s}Q${n+r} ${e+a} ${n+r-s} ${e+a}H${n+s}Q${n} ${e+a} ${n} ${e+a-s}V${e+s}Q${n} ${e} ${n+s} ${e}Z`}h(nt,"roundedRect");function rt(n){let e=Math.round(n.videoWidth/4),r=Math.round(n.videoHeight/4);if(e===0||r===0||typeof document>"u")return null;try{let a=document.createElement("canvas");a.width=e,a.height=r;let s=a.getContext("2d");return s===null?null:(s.drawImage(n,0,0,e,r),a.toDataURL("image/jpeg",.7))}catch{return null}}h(rt,"sceneSnapshot");export{xt as DocumentCaptureView,Ge as LOCK_TRACE_MS,Le as guideRect,We as mrzInstruction,tt as slotOf};
2
+ import{d as me}from"./chunk-5SVCGLYS.js";import"./chunk-65JA6YKG.js";import{a as A}from"./chunk-Q232JYNO.js";import{a as pe,b as he,e as fe,f as ve}from"./chunk-63NUMQST.js";import{a as Se,b as X}from"./chunk-BENNJ4GV.js";import{a as h,b as G,h as de}from"./chunk-4RUZQW5T.js";import{useEffect as R,useLayoutEffect as Ue,useRef as Q,useState as g}from"react";var ge={image:'<path d="M2 12C2 7.29 2 4.93 3.46 3.46C4.93 2 7.29 2 12 2C16.71 2 19.07 2 20.54 3.46C22 4.93 22 7.29 22 12C22 16.71 22 19.07 20.54 20.54C19.07 22 16.71 22 12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 12Z" stroke="currentColor"/><path d="M14 8A2 2 0 1 0 18 8A2 2 0 1 0 14 8Z" stroke="currentColor"/><path d="M2 12.5L3.75 10.97C4.66 10.17 6.04 10.22 6.89 11.07L11.18 15.36C11.87 16.05 12.95 16.14 13.75 15.58L14.04 15.37C15.19 14.57 16.74 14.66 17.78 15.6L21 18.5" stroke="currentColor" stroke-linecap="round"/>',flashlight:'<path d="M9 11.66V19C9 19.93 9 20.4 9.15 20.77C9.36 21.26 9.74 21.64 10.23 21.85C10.6 22 11.07 22 12 22C12.93 22 13.4 22 13.77 21.85C14.26 21.64 14.64 21.26 14.85 20.77C15 20.4 15 19.93 15 19V11.66C15 10.84 15 10.43 15.15 10.06C15.3 9.7 15.59 9.41 16.17 8.83L16.17 8.83L19.41 5.59C19.7 5.3 19.85 5.15 19.92 4.97C20 4.78 20 4.58 20 4.17V4C20 3.06 20 2.59 19.71 2.29C19.41 2 18.94 2 18 2H6C5.06 2 4.59 2 4.29 2.29C4 2.59 4 3.06 4 4V4.17C4 4.58 4 4.78 4.08 4.97C4.15 5.15 4.3 5.3 4.59 5.59L7.83 8.83C8.41 9.41 8.7 9.7 8.85 10.06C9 10.43 9 10.84 9 11.66Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 10H9" stroke="currentColor" stroke-linecap="round"/><path d="M12 13V15" stroke="currentColor" stroke-linecap="round"/><path d="M4.5 5H19.5" stroke="currentColor" stroke-linecap="round"/>'};var ye={"dcv3.mrz.searching":"ضع صفحة جواز السفر كاملة داخل الإطار","dcv3.mrz.showMrzSide":"اعرض الوجه الذي يحتوي على سطرين أو ثلاثة أسطر من الحروف","dcv3.mrz.reading":"جارٍ قراءة الوثيقة… ثبّتها","dcv3.mrz.moveCloser":"اقترب حتى تملأ أسطر الحروف الإطار","dcv3.mrz.turnSideways":"أدر هاتفك أفقيًا لقراءة أسطر الحروف","dcv3.mrz.glare":"أمِل الوثيقة لإزالة الانعكاس","dcv3.mrz.holdStill":"لا تتحرك","dcv3.mrz.valid":"تمت قراءة الوثيقة — جارٍ التقاط الصورة","dcv3.mrz.looksLikePassport":"يبدو أن هذا جواز سفر","dcv3.mrz.looksLikeCard":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"};var ke={"dcv3.mrz.searching":"Fit the whole passport page in the frame","dcv3.mrz.showMrzSide":"Show the side with the two or three lines of characters","dcv3.mrz.reading":"Reading the document… hold it steady","dcv3.mrz.moveCloser":"Move closer so the lines of characters fill the frame","dcv3.mrz.turnSideways":"Turn your phone sideways to read the lines of characters","dcv3.mrz.glare":"Tilt the document to remove the reflection","dcv3.mrz.holdStill":"Hold still","dcv3.mrz.valid":"Document read — taking the photo","dcv3.mrz.looksLikePassport":"This looks like a passport","dcv3.mrz.looksLikeCard":"This looks like an identity card or residence permit"};var we={"dcv3.mrz.searching":"Cadrez toute la page du passeport","dcv3.mrz.showMrzSide":"Montrez la face avec les deux ou trois lignes de caractères","dcv3.mrz.reading":"Lecture du document… tenez-le immobile","dcv3.mrz.moveCloser":"Rapprochez-vous pour que les lignes de caractères remplissent le cadre","dcv3.mrz.turnSideways":"Tournez votre téléphone à l’horizontale pour lire les lignes de caractères","dcv3.mrz.glare":"Inclinez le document pour supprimer le reflet","dcv3.mrz.holdStill":"Ne bougez plus","dcv3.mrz.valid":"Document lu — prise de la photo","dcv3.mrz.looksLikePassport":"Ceci ressemble à un passeport","dcv3.mrz.looksLikeCard":"Ceci ressemble à une carte d’identité ou un titre de séjour"};var be={"native.doc.introTitle":"سنلتقط صورة لوثيقتك","native.doc.introLead":"ستُفتح كاميرا هاتفك، وتُلتقط الصورة تلقائيًا بمجرد أن تكون الوثيقة داخل الإطار.","native.doc.tip.flat":"ضع الوثيقة مسطحة على سطح داكن.","native.doc.tip.glare":"تجنّب انعكاسات المصابيح أو الشمس.","native.doc.tip.frame":"أبقِ الوثيقة كاملة داخل الإطار.","native.doc.openCamera":"افتح الكاميرا","native.doc.changeDocument":"تغيير الوثيقة","native.scan.closer":"اقترب قليلًا","native.scan.farther":"ابتعد قليلًا","native.scan.glare":"أمِل البطاقة قليلًا","native.scan.dark":"الإضاءة ضعيفة. شغّل المصباح.","native.scan.blurry":"الصورة غير واضحة. ثبّت الهاتف.","native.scan.holdStill":"لا تتحرك","native.scan.reading":"جارٍ التحقق من وثيقتك…","native.scan.putDown":"يمكنك وضع وثيقتك جانبًا.","native.scan.retry":"لنحاول مرة أخرى"};var Ce={"native.doc.introTitle":"We'll photograph your document","native.doc.introLead":"Your phone's camera will open. The photo is taken by itself as soon as the document is well framed.","native.doc.tip.flat":"Lay the document flat on a dark surface.","native.doc.tip.glare":"Avoid glare from lamps or sunlight.","native.doc.tip.frame":"Keep the whole document in the frame.","native.doc.openCamera":"Open the camera","native.doc.changeDocument":"Change document","native.scan.closer":"Move a little closer","native.scan.farther":"Move back a little","native.scan.glare":"Tilt the card a little","native.scan.dark":"Too dark. Turn on the light.","native.scan.blurry":"Blurry image. Hold the phone still.","native.scan.holdStill":"Hold still","native.scan.reading":"Checking your document…","native.scan.putDown":"You can put your document down.","native.scan.retry":"Let's try that again"};var ze={"native.doc.introTitle":"Nous allons photographier votre pièce","native.doc.introLead":"La caméra de votre téléphone va s'ouvrir. La photo est prise automatiquement dès que la pièce est bien cadrée.","native.doc.tip.flat":"Posez la pièce à plat, sur une surface sombre.","native.doc.tip.glare":"Évitez les reflets de lampe ou de soleil.","native.doc.tip.frame":"Gardez toute la pièce dans le cadre.","native.doc.openCamera":"Ouvrir la caméra","native.doc.changeDocument":"Changer de document","native.scan.closer":"Approchez un peu","native.scan.farther":"Reculez un peu","native.scan.glare":"Inclinez un peu la carte","native.scan.dark":"Trop sombre. Allumez la lampe.","native.scan.blurry":"Image floue. Tenez le téléphone immobile.","native.scan.holdStill":"Ne bougez plus","native.scan.reading":"Vérification de votre document…","native.scan.putDown":"Vous pouvez poser votre pièce.","native.scan.retry":"Réessayons"};var Be=["locking","capturing"],W=class W{constructor(){this.shown={hint:null,locking:!1,card:null,manualShutter:!1};this.candidate=null;this.candidateSince=0;this.hintShownAt=0;this.lockLostAt=null;this.detectedSince=null;this.lostSince=null;this.shutterSince=null}present(e,r){return this.presentHint(e,r),this.presentLock(e,r),this.presentCard(e,r),this.shutterSince=e.manualShutter?this.shutterSince??r:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&r-this.shutterSince>=1e3},this.shown}presentHint(e,r){let a=e.phase==="framing"&&!(e.hint==="blurry"&&e.card===null)?e.hint:null;if(e.phase!=="framing"){this.shown={...this.shown,hint:null},this.candidate=null;return}if(a!==this.candidate&&(this.candidate=a,this.candidateSince=r),a===this.shown.hint)return;let s=r-this.candidateSince>=(a===null?0:350),u=this.shown.hint===null||r-this.hintShownAt>=1200;s&&u&&(this.shown={...this.shown,hint:a},this.hintShownAt=r)}presentLock(e,r){if(Be.includes(e.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(e.phase!=="framing"){this.shown={...this.shown,locking:!1},this.lockLostAt=null;return}this.lockLostAt??(this.lockLostAt=r),r-this.lockLostAt>=300&&(this.shown={...this.shown,locking:!1},this.lockLostAt=null)}}presentCard(e,r){let a=e.card;if(a===null||e.phase!=="framing"){if(e.phase!=="framing"){this.shown={...this.shown,card:null},this.detectedSince=null,this.lostSince=null;return}this.detectedSince=null,this.lostSince??(this.lostSince=r),r-this.lostSince>=300&&(this.shown={...this.shown,card:null});return}if(this.lostSince=null,this.detectedSince??(this.detectedSince=r),r-this.detectedSince<250)return;let s=this.shown.card;if(s===null){this.shown={...this.shown,card:{...a}};return}let u=.35;this.shown={...this.shown,card:{fill:s.fill+(a.fill-s.fill)*u,offsetX:s.offsetX+(a.offsetX-s.offsetX)*u,offsetY:s.offsetY+(a.offsetY-s.offsetY)*u}}}};h(W,"ScanPresenter");var P=W;import{Fragment as at,jsx as t,jsxs as m}from"react/jsx-runtime";var Fe={en:Ce,fr:ze,ar:be},Ge=450,De=h(n=>e=>me(n.strings[e]??Fe[n.locale][e]??""),"useScanCopy");function Ne({name:n}){return t("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:ge[n]}})}h(Ne,"ScanGlyph");var Xe={en:ke,fr:we,ar:ye};function We(n,e){return n===null||n.state==="fallback"||n.state==="mismatch"?null:n.state==="searching"?e?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":n.state==="valid"?"dcv3.mrz.valid":n.coach!==void 0?`dcv3.mrz.${n.coach}`:"dcv3.mrz.reading"}h(We,"mrzInstruction");function Me(n){return n.reason==="unreadable"?"doc.reason_unreadable":n.reason!==void 0&&n.reason!=="side_missing"?de(n.reason):null}h(Me,"reasonOf");function xt({step:n,i18n:e,liveMrz:r,...a}){let[s,u]=g(!1);return s?t(et,{step:n,i18n:e,...r!==void 0?{liveMrz:r}:{},onClose:()=>u(!1)}):t(qe,{step:n,i18n:e,onOpen:()=>u(!0),...a})}h(xt,"DocumentCaptureView");function Qe({passport:n}){let r=Math.round(228/(n?1.42:1.586));return m("svg",{className:"sekyro-mark sekyro-mark--card",viewBox:`-12 -12 252 ${r+24}`,"aria-hidden":"true",focusable:"false",children:[t("defs",{children:t("clipPath",{id:"sekyro-card-clip",children:t("rect",{width:228,height:r,rx:"12.5"})})}),t("rect",{className:"sekyro-mark__card",width:228,height:r,rx:"12.5"}),t("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:r*.52,rx:"6"}),[0,1,2].map(a=>t("rect",{className:"sekyro-mark__text",x:"88",y:23+a*r*.12,width:100-a*20,height:"6",rx:"3"},a)),[0,1].map(a=>t("rect",{className:"sekyro-mark__text",x:"17",y:r*.74+a*9,width:194,height:"4",rx:"2"},a)),t("g",{clipPath:"url(#sekyro-card-clip)",children:t("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:t("rect",{x:"-1",width:"2",height:r,className:"sekyro-mark__beam"})})}),t("path",{className:"sekyro-mark__brackets",d:Ze(-10,-10,248,r+20,16,30)})]})}h(Qe,"ScanMark");function Ze(n,e,r,a,s,u){let w=Math.min(s,u*.6);return[[n,e,1,1],[n+r,e,-1,1],[n,e+a,1,-1],[n+r,e+a,-1,-1]].map(([C,_,f,E])=>`M${C} ${_+E*u}V${_+E*w}Q${C} ${_} ${C+f*w} ${_}H${C+f*u}`).join("")}h(Ze,"brackets");function qe({step:n,i18n:e,onOpen:r,onChangeCountry:a,onChangeDocument:s}){let u=De(e),w=n.documentType==="passport",y=Me(n);return m("section",{className:"sekyro-step","data-testid":"sekyro-document",children:[t(Qe,{passport:w}),t(pe,{title:u("native.doc.introTitle"),lead:u("native.doc.introLead")}),y!==null?m(Se,{tone:"warning",children:[t("span",{children:e.t(y)}),t("span",{children:X(e,n.attemptsRemaining,n.attemptsExhausted)})]}):null,m("ul",{className:"sekyro-tiprows",children:[m("li",{children:[t(A,{name:w?"passport":"card"}),u("native.doc.tip.flat")]}),m("li",{children:[t(A,{name:"light"}),u("native.doc.tip.glare")]}),m("li",{children:[t(Ne,{name:"image"}),u("native.doc.tip.frame")]})]}),s!==void 0||a!==void 0?m("div",{className:"sekyro-links",children:[s!==void 0?t("button",{type:"button",className:"sekyro-link",onClick:s,children:u("native.doc.changeDocument")}):null,a!==void 0?t("button",{type:"button",className:"sekyro-link",onClick:a,children:e.t("native.doc.changeCountry")}):null]}):null,t(he,{children:m(G,{full:!0,onClick:r,children:[t(A,{name:"camera"}),u("native.doc.openCamera")]})})]})}h(qe,"DocumentIntro");function Le(n,e,r){let a=n*.88,s=a/r;return{x:(n-a)/2,y:e*.42-s/2,w:a,h:s}}h(Le,"guideRect");var je={too_far:"native.scan.closer",too_close:"native.scan.farther",focus_far:"native.scan.farther",glare:"native.scan.glare",too_bright:"native.scan.glare",too_dark:"native.scan.dark",blurry:"native.scan.blurry"},Je=h(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function et({step:n,i18n:e,liveMrz:r,onClose:a}){let s=De(e),u=Q(null),w=Q(null),y=Q(null),[C,_]=g("idle"),[f,E]=g(null),[xe,Z]=g(null),[p,$e]=g({w:0,h:0}),[z,_e]=g({hint:null,locking:!1,card:null,manualShutter:!1}),[q,Te]=g({}),[j,He]=g(null),[J,Re]=g(null),[ee,te]=g(0),[ne,re]=g(null),[O,ae]=g(null),L=n.documentType==="passport",K=L?1.42:1.586;fe(!0),Ue(()=>{let i=u.current;if(i===null)return;let c=h(()=>$e({w:i.clientWidth,h:i.clientHeight}),"measure");if(c(),typeof ResizeObserver>"u")return;let l=new ResizeObserver(c);return l.observe(i),()=>l.disconnect()},[]);let o=Le(p.w,p.h,K);R(()=>{p.w===0||p.h===0||y.current?.setGuide?.({viewAspect:p.w/p.h,rect:{x:o.x/p.w,y:o.y/p.h,width:o.w/p.w,height:o.h/p.h}})},[p.w,p.h,o.x,o.y,o.w,o.h]),R(()=>{let i=w.current;if(i===null)return;let c=n.capture({video:i,...r!==void 0?{liveMrz:r}:{}});y.current=c;let l=u.current;if(l!==null&&l.clientWidth>0&&l.clientHeight>0){let d=Le(l.clientWidth,l.clientHeight,K);c.setGuide?.({viewAspect:l.clientWidth/l.clientHeight,rect:{x:d.x/l.clientWidth,y:d.y/l.clientHeight,width:d.w/l.clientWidth,height:d.h/l.clientHeight}})}let b=new P,S={scan:null,feedback:null,gate:null},N=h(d=>{S={...S,...d};let M=S.gate?.guide,Ye={phase:S.scan?.phase??"framing",hint:S.feedback?.reticle==="coaching"?S.feedback.key:null,card:M?.detected?{fill:M.fill,offsetX:M.offsetX,offsetY:M.offsetY}:null,manualShutter:S.scan?.manualShutter??!1},x=b.present(Ye,performance.now());_e($=>$.hint===x.hint&&$.locking===x.locking&&$.manualShutter===x.manualShutter&&$.card?.fill===x.card?.fill&&$.card?.offsetX===x.card?.offsetX&&$.card?.offsetY===x.card?.offsetY?$:x)},"present"),Ve=[c.on("state",_),c.on("feedback",d=>N({feedback:d})),c.on("gate",d=>N({gate:d})),c.on("scan",d=>{E(d),N({scan:d})}),c.on("captured",d=>{Te(M=>({...M,[tt(d.side,L,M)]:d.previewDataUrl})),He(d.previewDataUrl),Re(rt(i))}),c.on("error",Z),c.on("mrz",d=>{d.state==="mismatch"?ae(d.format??null):re(d)})];return c.start().catch(()=>{}),()=>{for(let d of Ve)d();c.destroy(),y.current=null}},[n.issuer,n.documentType]);let k=f?.phase??"framing",D=k==="reading"||k==="result",V=k==="flipCue"||k==="reaskRecto",T=z.locking,se=f?.captured.length??0;R(()=>{T&&te(i=>i+1)},[T]),R(()=>{se>0&&te(i=>i+1)},[se]);let Ae=f?.expected??null;R(()=>{re(null)},[Ae]),R(()=>{if(O===null)return;let i=setTimeout(()=>ae(null),2e3);return()=>clearTimeout(i)},[O]);let oe=V||D?null:We(ne,L),Y=O!==null?O==="TD3"?"dcv3.mrz.looksLikePassport":"dcv3.mrz.looksLikeCard":oe,Ee=Y===null?null:e.strings[Y]??Xe[e.locale][Y],ie=Me(n),le=z.hint===null?null:je[z.hint]??`dcv2.${z.hint}`,Oe=le??(k==="flipCue"?f?.notice==="same_face"?"doc.sameFace":"doc.flip":k==="reaskRecto"?"doc.reaskRecto":D?"native.scan.reading":k==="locking"||k==="capturing"||T?"native.scan.holdStill":f?.notice==="reread"?"doc.reread":f?.notice==="technical"?"native.scan.retry":f?.notice==="blurry"?"native.scan.blurry":ie??(L?"doc.showPage":"doc.showSide")),B=Ee??s(Oe),H=z.card,v=o;if(!T&&H!==null&&H.fill>=.45&&H.fill<=1.25&&!Je()){let i=o.w*H.fill,c=i/K,l=o.x+o.w/2+o.w*Math.max(-.25,Math.min(.25,H.offsetX)),b=o.y+o.h/2+o.h*Math.max(-.25,Math.min(.25,H.offsetY));v={x:l-i/2,y:b-c/2,w:i,h:c}}let I=o.w*.045,U=28,ce=Math.min(I,U*.6),Ke=[[v.x,v.y,1,1],[v.x+v.w,v.y,-1,1],[v.x,v.y+v.h,1,-1],[v.x+v.w,v.y+v.h,-1,-1]],Ie=T?"is-locked":z.hint!==null?"is-coaching":"",Pe=L?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],ue=o.y+o.h+48,F={insetInlineStart:o.x,insetBlockStart:o.y,inlineSize:o.w,blockSize:o.h,borderRadius:I};return t("section",{className:"sekyro-lm","aria-label":B,"data-testid":"sekyro-document",children:m("div",{ref:u,className:`sekyro-lm-stage${D?" is-reading":""}${V?" is-flip":""}`,style:{"--sekyro-guide-w":`${o.w}px`},children:[t("video",{ref:w,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:i=>{let c=i.currentTarget,l=c.getBoundingClientRect(),b=Math.max(l.width/(c.videoWidth||1),l.height/(c.videoHeight||1)),S=c.videoWidth*b,N=c.videoHeight*b;S>0&&N>0&&y.current?.focusAt((i.clientX-l.left+(S-l.width)/2)/S,(i.clientY-l.top+(N-l.height)/2)/N)}}),p.w>0?m(at,{children:[D&&J!==null?t("img",{className:"sekyro-lm-scene",src:J,alt:""}):null,D&&j!==null?t("img",{className:"sekyro-lm-frozen",src:j,alt:"",style:F}):null,m("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${p.w} ${p.h}`,"aria-hidden":"true",focusable:"false",children:[m("defs",{children:[m("linearGradient",{id:"sekyro-lm-top",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),t("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),m("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),t("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),t("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${p.w}V${p.h}H0Z${nt(o,I)}`}),t("rect",{width:p.w,height:Math.max(0,o.y),fill:"url(#sekyro-lm-top)"}),t("rect",{y:o.y+o.h,width:p.w,height:Math.max(0,p.h-o.y-o.h),fill:"url(#sekyro-lm-bottom)"}),t("g",{className:`sekyro-lm-brackets ${Ie}`,children:Ke.map(([i,c,l,b],S)=>t("path",{style:{transform:`translate(${i}px, ${c}px) scale(${l}, ${b})`},d:`M0 ${U}V${ce}Q0 0 ${ce} 0H${U}`},S))}),T?t("rect",{className:"sekyro-lm-trace",x:o.x,y:o.y,width:o.w,height:o.h,rx:I,pathLength:"1",style:{animationDuration:`${Ge}ms`}}):null]}),t("div",{className:"sekyro-lm-slot",style:F,"aria-hidden":"true",children:D?t("span",{className:"sekyro-lm-read is-repeating"}):ee>0?t("span",{className:"sekyro-lm-read"},ee):null})]}):null,oe!==null?t("div",{className:"sekyro-lm-slot",style:F,"aria-hidden":"true",children:t("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${L?" is-page":""}${ne?.state==="valid"?" is-valid":""}`})}):null,m("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:o.y-64},children:[t("div",{role:"status","aria-live":"polite",children:t(ve,{swapKey:B,className:"sekyro-lm-line",children:B})}),ie!==null&&k==="framing"&&le===null?t("p",{className:"sekyro-lm-attempts",children:X(e,n.attemptsRemaining,n.attemptsExhausted)}):null]}),D?m("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:ue-12},children:[t("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),s("native.scan.putDown")]}):V?t("div",{className:`sekyro-lm-under sekyro-lm-flip${k==="reaskRecto"?" is-toFront":""}`,style:{insetBlockStart:ue-20},"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:m("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(K)},children:[t("span",{className:"sekyro-lm-flip-front"}),t("span",{className:"sekyro-lm-flip-back"})]})}):null,m("div",{className:"sekyro-lm-controls",children:[m("div",{className:"sekyro-lm-bar",children:[t("button",{type:"button",className:"sekyro-glass","aria-label":e.t("native.close"),onClick:a,children:t(A,{name:"close"})}),f?.torchAvailable?t("button",{type:"button",className:`sekyro-glass${f.torch?" is-on":""}`,"aria-label":e.t("doc.torchOn"),"aria-pressed":f.torch,onClick:()=>y.current?.setTorch(!f.torch),children:t(Ne,{name:"flashlight"})}):null]}),xe!==null?m("div",{className:"sekyro-lm-error",role:"alert",children:[t("p",{children:e.t("doc.cameraBlocked")}),t("p",{children:e.t("doc.cameraBlockedHint")}),t(G,{onClick:()=>{Z(null),y.current?.retry()},children:e.t("doc.retryCamera")})]}):null,z.manualShutter?t("button",{type:"button",className:"sekyro-shutter","aria-label":e.t("doc.shutter"),onClick:()=>y.current?.shutter()}):null,t("ol",{className:"sekyro-lm-tray",children:Pe.map(({side:i,label:c})=>{let l=f?.captured.includes(i)??!1;return m("li",{className:l?"is-done":void 0,"aria-current":!l&&(L||f?.expected===i)?"step":void 0,children:[l?m("span",{className:"sekyro-lm-thumb",children:[q[i]!==void 0?t("img",{src:q[i],alt:""}):null,t("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:t("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,s(c)]},i)})})]}),C==="uploading"||C==="checking"?t("span",{className:"sekyro-visually-hidden",role:"status",children:e.t("doc.uploading")}):null]})})}h(et,"LumiereScan");function tt(n,e,r){return e?"single":n==="recto"||n==="verso"?n:r.recto===void 0?"recto":"verso"}h(tt,"slotOf");function nt({x:n,y:e,w:r,h:a},s){return`M${n+s} ${e}H${n+r-s}Q${n+r} ${e} ${n+r} ${e+s}V${e+a-s}Q${n+r} ${e+a} ${n+r-s} ${e+a}H${n+s}Q${n} ${e+a} ${n} ${e+a-s}V${e+s}Q${n} ${e} ${n+s} ${e}Z`}h(nt,"roundedRect");function rt(n){let e=Math.round(n.videoWidth/4),r=Math.round(n.videoHeight/4);if(e===0||r===0||typeof document>"u")return null;try{let a=document.createElement("canvas");a.width=e,a.height=r;let s=a.getContext("2d");return s===null?null:(s.drawImage(n,0,0,e,r),a.toDataURL("image/jpeg",.7))}catch{return null}}h(rt,"sceneSnapshot");export{xt as DocumentCaptureView,Ge as LOCK_TRACE_MS,Le as guideRect,We as mrzInstruction,tt as slotOf};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as K}from"./chunk-4INDRENU.js";import{a as O,b as U,c as z}from"./chunk-YUNPD6ZB.js";import{a as G}from"./chunk-P2LX7BBE.js";import{d as h}from"./chunk-BJJZ4MO5.js";import"./chunk-65JA6YKG.js";import{a as E}from"./chunk-BENNJ4GV.js";import{a,b as f,l as V}from"./chunk-4RUZQW5T.js";import{isValidNni as oe,normalizeNni as _}from"@sekyro/web";import{useEffect as x,useId as re,useRef as W,useState as N}from"react";import{Fragment as R,jsx as i,jsxs as l}from"react/jsx-runtime";var Y={en:U,fr:z,ar:O},$=6,de=new Set(["eid_identifier_invalid","eid_code_invalid","eid_locked","eid_not_enrolled"]),q=a((e,o)=>{if(e===void 0)return 0;let p=Date.parse(e)-o;return Number.isFinite(p)?Math.max(0,Math.ceil(p/1e3)):0},"secondsUntil"),se=a(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss");function be({step:e,i18n:o,className:p,onError:J}){let A=o.strings,n=a((t,d)=>h(A[t]??Y[o.locale][t]??"",d),"t"),B=a((t,d)=>{let ne=new Intl.PluralRules(o.locale).select(d),L=`${t}.${ne}`,te=A[L]??Y[o.locale][L]??n(`${t}.other`);return h(te,{count:new Intl.NumberFormat(o.locale).format(d)})},"plural"),y=a(t=>e.providerName?n(`eid.${t}`,{provider:e.providerName}):n(`eid.${t}Generic`),"named"),[C,Q]=N(""),[g,w]=N(""),[c,I]=N(!1),[v,u]=N(null),r=e.phase==="code",P=K(r),s=re(),X=V(),m=a(async t=>{I(!0),u(null);try{await t()}catch(d){u(G(d,o.strings)),J?.(d)}finally{I(!1)}},"run"),D=W(!1);x(()=>{!e.identifierBound||r||e.reason!==void 0||D.current||(D.current=!0,m(()=>e.start()))},[e.identifierBound,r,e.reason]),x(()=>{(e.reason==="eid_code_invalid"||e.codeExpiresAt!==void 0)&&w("")},[e.reason,e.codeExpiresAt,e.codeAttemptsRemaining]);let F=W(r);x(()=>{r&&!F.current&&document.getElementById(`${s}-code`)?.focus(),F.current=r},[r,s]);let k=e.reason==="eid_locked",M=q(e.codeExpiresAt,P),T=r&&e.codeExpiresAt!==void 0&&M===0,S=q(e.resendAvailableAt,P),H=e.resendsRemaining===0||e.reason==="eid_resend_limit",Z=a(t=>{if(t.preventDefault(),r){g.length===$&&!k&&m(()=>e.verify(g));return}if(e.identifierBound){m(()=>e.start());return}let d=_(C);if(e.country==="MR"){if(!/^\d{10}$/.test(d))return u("population.invalid");if(!oe(d))return u("population.reason_nni_invalid")}m(()=>e.start(d))},"onSubmit"),b=e.reason?.startsWith("eid_")?e.reason:void 0,j=l(R,{children:[b!==void 0?l(E,{tone:de.has(b)?"danger":"warning",children:[i("span",{children:n(`reasons.${b}`)}),b==="eid_code_invalid"&&e.codeAttemptsRemaining!==void 0?i("span",{children:B("eid.codeAttemptsRemaining",e.codeAttemptsRemaining)}):null,e.canUseCamera?i(f,{kind:"ghost",disabled:c,onClick:()=>{m(()=>e.useCamera())},children:n("eid.useCamera")}):null]}):null,v!==null?i(E,{tone:"danger",children:i("span",{children:o.t(v)})}):null]}),[ee,ie]=r?[y("codeTitle"),y("codeHelp")]:[y("identifierTitle"),y(e.identifierBound?"boundDescription":"identifierDescription")];return l("form",{className:`sekyro-stack sekyro-stack--4 sekyro-otp${p?` ${p}`:""}`,"aria-labelledby":s,onSubmit:Z,noValidate:!0,"data-testid":"sekyro-eid",children:[l("div",{className:"sekyro-stack sekyro-stack--1",children:[i("h2",{id:s,ref:X,tabIndex:-1,className:"sekyro-text-body",children:ee}),i("p",{className:"sekyro-text-muted",children:ie}),e.afterPass==="continue"?i("p",{className:"sekyro-text-muted","data-testid":"sekyro-eid-continue",children:e.providerName?n("eid.continueHint",{provider:e.providerName}):n("eid.continueHintGeneric")}):null]}),j,r?l(R,{children:[l("div",{className:"sekyro-field",children:[i("label",{className:"sekyro-label",htmlFor:`${s}-code`,children:n("eid.codeLabel")}),i("input",{id:`${s}-code`,className:"sekyro-input sekyro-input--code",dir:"ltr",inputMode:"numeric",autoComplete:"one-time-code",value:g,disabled:k,onChange:t=>{u(null),w(_(t.target.value).replace(/\D/g,"").slice(0,$))}})]}),l("div",{className:"sekyro-row",children:[e.codeExpiresAt!==void 0?i("span",{className:"sekyro-text-muted",children:T?n("eid.expired"):n("eid.expiresIn",{time:se(M)})}):null,H?i("span",{className:"sekyro-text-muted",children:n("eid.noResendsLeft")}):i(f,{kind:"ghost",disabled:c||S>0||k,onClick:()=>{m(()=>e.resend())},children:S>0?n("eid.resendIn",{seconds:S}):n("eid.resend")})]}),!H&&e.resendsRemaining!==void 0?i("p",{className:"sekyro-text-muted",children:B("eid.resendsRemaining",e.resendsRemaining)}):null,i("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:T?n("eid.expired"):""}),i(f,{type:"submit",full:!0,disabled:c||g.length!==$||k,"aria-busy":c||void 0,children:n("eid.verify")})]}):l(R,{children:[e.identifierBound?null:l("div",{className:"sekyro-field",children:[i("label",{className:"sekyro-label",htmlFor:`${s}-nni`,children:o.t("population.label")}),i("input",{id:`${s}-nni`,className:"sekyro-input sekyro-mono",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:o.t("population.placeholder"),value:C,"aria-describedby":`${s}-nni-help`,"aria-invalid":v==="population.invalid"||v==="population.reason_nni_invalid"||void 0,onChange:t=>{u(null),Q(_(t.target.value).replace(/\D/g,"").slice(0,10))}}),i("span",{id:`${s}-nni-help`,className:"sekyro-help",children:o.t("population.helper")})]}),i(f,{type:"submit",full:!0,disabled:c,"aria-busy":c||void 0,children:n("eid.start")})]})]})}a(be,"EidView");export{be as EidView};
2
+ import{a as K}from"./chunk-4INDRENU.js";import{a as O,b as U,c as z}from"./chunk-YUNPD6ZB.js";import{a as G}from"./chunk-P2LX7BBE.js";import{d as h}from"./chunk-5SVCGLYS.js";import"./chunk-65JA6YKG.js";import{a as E}from"./chunk-BENNJ4GV.js";import{a,b as f,l as V}from"./chunk-4RUZQW5T.js";import{isValidNni as oe,normalizeNni as _}from"@sekyro/web";import{useEffect as x,useId as re,useRef as W,useState as N}from"react";import{Fragment as R,jsx as i,jsxs as l}from"react/jsx-runtime";var Y={en:U,fr:z,ar:O},$=6,de=new Set(["eid_identifier_invalid","eid_code_invalid","eid_locked","eid_not_enrolled"]),q=a((e,o)=>{if(e===void 0)return 0;let p=Date.parse(e)-o;return Number.isFinite(p)?Math.max(0,Math.ceil(p/1e3)):0},"secondsUntil"),se=a(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss");function be({step:e,i18n:o,className:p,onError:J}){let A=o.strings,n=a((t,d)=>h(A[t]??Y[o.locale][t]??"",d),"t"),B=a((t,d)=>{let ne=new Intl.PluralRules(o.locale).select(d),L=`${t}.${ne}`,te=A[L]??Y[o.locale][L]??n(`${t}.other`);return h(te,{count:new Intl.NumberFormat(o.locale).format(d)})},"plural"),y=a(t=>e.providerName?n(`eid.${t}`,{provider:e.providerName}):n(`eid.${t}Generic`),"named"),[C,Q]=N(""),[g,w]=N(""),[c,I]=N(!1),[v,u]=N(null),r=e.phase==="code",P=K(r),s=re(),X=V(),m=a(async t=>{I(!0),u(null);try{await t()}catch(d){u(G(d,o.strings)),J?.(d)}finally{I(!1)}},"run"),D=W(!1);x(()=>{!e.identifierBound||r||e.reason!==void 0||D.current||(D.current=!0,m(()=>e.start()))},[e.identifierBound,r,e.reason]),x(()=>{(e.reason==="eid_code_invalid"||e.codeExpiresAt!==void 0)&&w("")},[e.reason,e.codeExpiresAt,e.codeAttemptsRemaining]);let F=W(r);x(()=>{r&&!F.current&&document.getElementById(`${s}-code`)?.focus(),F.current=r},[r,s]);let k=e.reason==="eid_locked",M=q(e.codeExpiresAt,P),T=r&&e.codeExpiresAt!==void 0&&M===0,S=q(e.resendAvailableAt,P),H=e.resendsRemaining===0||e.reason==="eid_resend_limit",Z=a(t=>{if(t.preventDefault(),r){g.length===$&&!k&&m(()=>e.verify(g));return}if(e.identifierBound){m(()=>e.start());return}let d=_(C);if(e.country==="MR"){if(!/^\d{10}$/.test(d))return u("population.invalid");if(!oe(d))return u("population.reason_nni_invalid")}m(()=>e.start(d))},"onSubmit"),b=e.reason?.startsWith("eid_")?e.reason:void 0,j=l(R,{children:[b!==void 0?l(E,{tone:de.has(b)?"danger":"warning",children:[i("span",{children:n(`reasons.${b}`)}),b==="eid_code_invalid"&&e.codeAttemptsRemaining!==void 0?i("span",{children:B("eid.codeAttemptsRemaining",e.codeAttemptsRemaining)}):null,e.canUseCamera?i(f,{kind:"ghost",disabled:c,onClick:()=>{m(()=>e.useCamera())},children:n("eid.useCamera")}):null]}):null,v!==null?i(E,{tone:"danger",children:i("span",{children:o.t(v)})}):null]}),[ee,ie]=r?[y("codeTitle"),y("codeHelp")]:[y("identifierTitle"),y(e.identifierBound?"boundDescription":"identifierDescription")];return l("form",{className:`sekyro-stack sekyro-stack--4 sekyro-otp${p?` ${p}`:""}`,"aria-labelledby":s,onSubmit:Z,noValidate:!0,"data-testid":"sekyro-eid",children:[l("div",{className:"sekyro-stack sekyro-stack--1",children:[i("h2",{id:s,ref:X,tabIndex:-1,className:"sekyro-text-body",children:ee}),i("p",{className:"sekyro-text-muted",children:ie}),e.afterPass==="continue"?i("p",{className:"sekyro-text-muted","data-testid":"sekyro-eid-continue",children:e.providerName?n("eid.continueHint",{provider:e.providerName}):n("eid.continueHintGeneric")}):null]}),j,r?l(R,{children:[l("div",{className:"sekyro-field",children:[i("label",{className:"sekyro-label",htmlFor:`${s}-code`,children:n("eid.codeLabel")}),i("input",{id:`${s}-code`,className:"sekyro-input sekyro-input--code",dir:"ltr",inputMode:"numeric",autoComplete:"one-time-code",value:g,disabled:k,onChange:t=>{u(null),w(_(t.target.value).replace(/\D/g,"").slice(0,$))}})]}),l("div",{className:"sekyro-row",children:[e.codeExpiresAt!==void 0?i("span",{className:"sekyro-text-muted",children:T?n("eid.expired"):n("eid.expiresIn",{time:se(M)})}):null,H?i("span",{className:"sekyro-text-muted",children:n("eid.noResendsLeft")}):i(f,{kind:"ghost",disabled:c||S>0||k,onClick:()=>{m(()=>e.resend())},children:S>0?n("eid.resendIn",{seconds:S}):n("eid.resend")})]}),!H&&e.resendsRemaining!==void 0?i("p",{className:"sekyro-text-muted",children:B("eid.resendsRemaining",e.resendsRemaining)}):null,i("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:T?n("eid.expired"):""}),i(f,{type:"submit",full:!0,disabled:c||g.length!==$||k,"aria-busy":c||void 0,children:n("eid.verify")})]}):l(R,{children:[e.identifierBound?null:l("div",{className:"sekyro-field",children:[i("label",{className:"sekyro-label",htmlFor:`${s}-nni`,children:o.t("population.label")}),i("input",{id:`${s}-nni`,className:"sekyro-input sekyro-mono",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:o.t("population.placeholder"),value:C,"aria-describedby":`${s}-nni-help`,"aria-invalid":v==="population.invalid"||v==="population.reason_nni_invalid"||void 0,onChange:t=>{u(null),Q(_(t.target.value).replace(/\D/g,"").slice(0,10))}}),i("span",{id:`${s}-nni-help`,className:"sekyro-help",children:o.t("population.helper")})]}),i(f,{type:"submit",full:!0,disabled:c,"aria-busy":c||void 0,children:n("eid.start")})]})]})}a(be,"EidView");export{be as EidView};