@sekyro/react 0.1.0-rc.16 → 0.1.0-rc.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/{chunk-IUQTOOBI.js → chunk-3GCHNE7R.js} +1 -1
  3. package/dist/chunk-3H6KQ6BP.js +2 -0
  4. package/dist/chunk-455FWUKU.js +2 -0
  5. package/dist/chunk-55NNQK5P.js +2 -0
  6. package/dist/chunk-AGIBFSCL.js +2 -0
  7. package/dist/chunk-GUTF3SPK.js +2 -0
  8. package/dist/chunk-IAJAM4I6.js +2 -0
  9. package/dist/chunk-JTDARDD6.js +2 -0
  10. package/dist/chunk-T7C7Q4AN.js +2 -0
  11. package/dist/chunk-VBIVDLBE.js +2 -0
  12. package/dist/chunk-W3GLUWQ5.js +2 -0
  13. package/dist/chunk-ZFGI5LKP.js +2 -0
  14. package/dist/{chunk-IT66PZDO.js → chunk-ZZIBCKKC.js} +1 -1
  15. package/dist/document-capture-view-ZNZQMJBX.js +2 -0
  16. package/dist/eid-view-VYUU65A3.js +2 -0
  17. package/dist/email-otp-view-DUHRTUGD.js +2 -0
  18. package/dist/flow-views-VJPCIWEJ.js +2 -0
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/overlay-de-TSLNGALH.js +2 -0
  22. package/dist/overlay-es-44JQULK7.js +2 -0
  23. package/dist/overlay-pt-D5TKF7PI.js +2 -0
  24. package/dist/portrait-capture-view-XUWOHJTS.js +2 -0
  25. package/dist/portrait-review-view-SJXQZTAK.js +2 -0
  26. package/dist/verification/index.cjs +1 -1
  27. package/dist/verification/index.d.cts +69 -4
  28. package/dist/verification/index.d.ts +69 -4
  29. package/dist/verification/index.js +1 -1
  30. package/dist/verification.css +215 -72
  31. package/package.json +2 -2
  32. package/sbom.cdx.json +4 -4
  33. package/dist/chunk-5TOBG5R2.js +0 -2
  34. package/dist/chunk-EZ5TVL6P.js +0 -2
  35. package/dist/chunk-FNBG3472.js +0 -2
  36. package/dist/chunk-GGTRTUW3.js +0 -2
  37. package/dist/chunk-H2KIOYQU.js +0 -2
  38. package/dist/chunk-KHBM3P4C.js +0 -2
  39. package/dist/chunk-NXVTUTKS.js +0 -2
  40. package/dist/chunk-OUG465K6.js +0 -2
  41. package/dist/chunk-PYAJMHZH.js +0 -2
  42. package/dist/chunk-XDPCJAYO.js +0 -2
  43. package/dist/chunk-YY76AMUA.js +0 -2
  44. package/dist/document-capture-view-PUGWMQAP.js +0 -2
  45. package/dist/eid-view-IMKKBPQV.js +0 -2
  46. package/dist/email-otp-view-YLMRRLC3.js +0 -2
  47. package/dist/flow-views-HFQJ45NS.js +0 -2
  48. package/dist/overlay-de-ZICWH4MW.js +0 -2
  49. package/dist/overlay-es-2ETCIRV4.js +0 -2
  50. package/dist/overlay-pt-2DX57E2U.js +0 -2
  51. package/dist/portrait-capture-view-M5OLPMMO.js +0 -2
@@ -16,6 +16,8 @@ interface StepStrings {
16
16
  "consent.terms.processing": string;
17
17
  "consent.terms.sharing": string;
18
18
  "consent.terms.retention": string;
19
+ "capture.modePicker.legendPhoto": string;
20
+ "capture.modePicker.helpPhoto": string;
19
21
  "reasons.camera_unavailable": string;
20
22
  "otp.sendTitle": string;
21
23
  "otp.sendDescription": string;
@@ -96,6 +98,7 @@ interface StepStrings {
96
98
  "doc.ageStepUp": string;
97
99
  "reasons.underage_estimated": string;
98
100
  "reasons.starter_credit_claimed": string;
101
+ "reasons.blocked_by_org": string;
99
102
  "dcv2.sensing": string;
100
103
  "dcv2.too_far": string;
101
104
  "dcv2.too_close": string;
@@ -116,8 +119,6 @@ interface StepStrings {
116
119
  "handoff.title": string;
117
120
  "session.processing.age_estimation.title": string;
118
121
  "session.processing.age_estimation.description": string;
119
- "session.processing.aml_screening.title": string;
120
- "session.processing.aml_screening.description": string;
121
122
  "session.result.approved.title": string;
122
123
  "session.result.approved.description": string;
123
124
  "session.result.review.title": string;
@@ -208,6 +209,22 @@ interface StepStrings {
208
209
  "needsApp.title": string;
209
210
  "needsApp.description": string;
210
211
  "needsApp.descriptionNoOrg": string;
212
+ "consent.termsTitle": string;
213
+ "leave.title": string;
214
+ "leave.body": string;
215
+ "leave.confirm": string;
216
+ "leave.stay": string;
217
+ "otp.changeNumber": string;
218
+ "otp.backToCode": string;
219
+ "otp.reason_otp_resend_limit": string;
220
+ "reasons.otp_resend_limit": string;
221
+ "common.back": string;
222
+ "capture.assisted.heading": string;
223
+ "returning.heading": string;
224
+ "capture.checkingTitle": string;
225
+ "method.heading": string;
226
+ "sandbox.otpHint": string;
227
+ "sandbox.skipCapture": string;
211
228
  "population.recheck.title": string;
212
229
  "population.recheck.description": string;
213
230
  "otp.phoneInvalid": string;
@@ -282,6 +299,9 @@ interface StepStrings {
282
299
  "emailOtp.reason_otp_rate_limited"?: string;
283
300
  "emailOtp.reason_email_invalid"?: string;
284
301
  "emailOtp.reason_email_disposable"?: string;
302
+ "emailOtp.changeEmail"?: string;
303
+ "emailOtp.backToCode"?: string;
304
+ "emailOtp.reason_otp_resend_limit"?: string;
285
305
  "eid.identifierTitle"?: string;
286
306
  "eid.identifierTitleGeneric"?: string;
287
307
  "eid.identifierDescription"?: string;
@@ -333,6 +353,42 @@ interface StepStrings {
333
353
  "dcv3.mrz.valid"?: string;
334
354
  "dcv3.mrz.looksLikePassport"?: string;
335
355
  "dcv3.mrz.looksLikeCard"?: string;
356
+ "portrait.source.title"?: string;
357
+ "portrait.source.description"?: string;
358
+ "portrait.source.camera"?: string;
359
+ "portrait.source.upload"?: string;
360
+ "portrait.source.uploadInstead"?: string;
361
+ "portrait.upload.title"?: string;
362
+ "portrait.upload.hint"?: string;
363
+ "portrait.upload.choose"?: string;
364
+ "portrait.upload.unsupported"?: string;
365
+ "portrait.upload.failed"?: string;
366
+ "portrait.review.title"?: string;
367
+ "portrait.review.description"?: string;
368
+ "portrait.review.original"?: string;
369
+ "portrait.review.fixed"?: string;
370
+ "portrait.review.fixesTitle"?: string;
371
+ "portrait.review.accept"?: string;
372
+ "portrait.review.retake"?: string;
373
+ "portrait.review.uploadAnother"?: string;
374
+ "portrait.fixes.crop"?: string;
375
+ "portrait.fixes.scale"?: string;
376
+ "portrait.fixes.straighten"?: string;
377
+ "portrait.fixes.background"?: string;
378
+ "portrait.fixes.exposure"?: string;
379
+ "portrait.fixes.white_balance"?: string;
380
+ "reasons.portrait_morph_suspected"?: string;
381
+ "reasons.portrait_reference_mismatch"?: string;
382
+ "reasons.portrait_declined_fix"?: string;
383
+ "doc.uploadInstead"?: string;
384
+ "doc.uploadTitle"?: string;
385
+ "doc.uploadHint"?: string;
386
+ "doc.uploadUnsupported"?: string;
387
+ "doc.uploadFailed"?: string;
388
+ "doc.source.title"?: string;
389
+ "doc.source.description"?: string;
390
+ "doc.source.camera"?: string;
391
+ "doc.source.upload"?: string;
336
392
  "native.doc.introTitle"?: string;
337
393
  "native.doc.introLead"?: string;
338
394
  "native.doc.tip.flat"?: string;
@@ -409,6 +465,7 @@ interface StepStrings {
409
465
  "inApp.copied"?: string;
410
466
  "inApp.copyFailed"?: string;
411
467
  "inApp.continueAnyway"?: string;
468
+ "inApp.openBrowser"?: string;
412
469
  }
413
470
 
414
471
  /**
@@ -558,11 +615,19 @@ interface SekyroVerificationProps {
558
615
  * SDKs). Take them back to your page. Without it, neither button is shown.
559
616
  */
560
617
  onClose?: (event: SekyroCloseEvent) => void;
618
+ /**
619
+ * The browser's back button (UX refresh 2026-11-05 decision 2). `history`: the flow
620
+ * keeps one history entry of its own, so back goes one screen back where the screen has a way back (the camera to
621
+ * its intro, the code to the number), else asks "Leave verification?" once anything was sent, and leaves when
622
+ * nothing was. `none` (the default, of `<SekyroFlow>` too): the flow never touches the page's history. The hosted
623
+ * page passes `history`; a partner page passes it only when the flow owns the page's back button.
624
+ */
625
+ backNavigation?: "history" | "none";
561
626
  /** Fires before the liveness upload (SDK spec §7.5 shadow hook). */
562
627
  onLivenessCaptured?: (artifacts: CapturedArtifacts) => void;
563
628
  /**
564
629
  * The link a desktop shows as a QR code when the live photo needs a phone
565
- * (the session's `hosted_url`); absent = a "continue on your phone" notice.
630
+ * (the session's `hostedUrl`); absent = a "continue on your phone" notice.
566
631
  * `<SekyroFlow>` defaults it to this page's address.
567
632
  */
568
633
  handoffUrl?: string;
@@ -571,7 +636,7 @@ interface SekyroVerificationProps {
571
636
  declare function SekyroVerification(props: SekyroVerificationProps): react.JSX.Element;
572
637
 
573
638
  interface SekyroFlowProps extends SekyroVerificationProps {
574
- /** The session's `hosted_url` (create result): the QR code and the "open in your browser" link. Default: this page's address. */
639
+ /** The session's `hostedUrl` (create result): the QR code and the "open in your browser" link. Default: this page's address. */
575
640
  hostedUrl?: string;
576
641
  /** Override the in-app browser detection (tests / hosts that know better). */
577
642
  inAppBrowser?: boolean;
@@ -16,6 +16,8 @@ interface StepStrings {
16
16
  "consent.terms.processing": string;
17
17
  "consent.terms.sharing": string;
18
18
  "consent.terms.retention": string;
19
+ "capture.modePicker.legendPhoto": string;
20
+ "capture.modePicker.helpPhoto": string;
19
21
  "reasons.camera_unavailable": string;
20
22
  "otp.sendTitle": string;
21
23
  "otp.sendDescription": string;
@@ -96,6 +98,7 @@ interface StepStrings {
96
98
  "doc.ageStepUp": string;
97
99
  "reasons.underage_estimated": string;
98
100
  "reasons.starter_credit_claimed": string;
101
+ "reasons.blocked_by_org": string;
99
102
  "dcv2.sensing": string;
100
103
  "dcv2.too_far": string;
101
104
  "dcv2.too_close": string;
@@ -116,8 +119,6 @@ interface StepStrings {
116
119
  "handoff.title": string;
117
120
  "session.processing.age_estimation.title": string;
118
121
  "session.processing.age_estimation.description": string;
119
- "session.processing.aml_screening.title": string;
120
- "session.processing.aml_screening.description": string;
121
122
  "session.result.approved.title": string;
122
123
  "session.result.approved.description": string;
123
124
  "session.result.review.title": string;
@@ -208,6 +209,22 @@ interface StepStrings {
208
209
  "needsApp.title": string;
209
210
  "needsApp.description": string;
210
211
  "needsApp.descriptionNoOrg": string;
212
+ "consent.termsTitle": string;
213
+ "leave.title": string;
214
+ "leave.body": string;
215
+ "leave.confirm": string;
216
+ "leave.stay": string;
217
+ "otp.changeNumber": string;
218
+ "otp.backToCode": string;
219
+ "otp.reason_otp_resend_limit": string;
220
+ "reasons.otp_resend_limit": string;
221
+ "common.back": string;
222
+ "capture.assisted.heading": string;
223
+ "returning.heading": string;
224
+ "capture.checkingTitle": string;
225
+ "method.heading": string;
226
+ "sandbox.otpHint": string;
227
+ "sandbox.skipCapture": string;
211
228
  "population.recheck.title": string;
212
229
  "population.recheck.description": string;
213
230
  "otp.phoneInvalid": string;
@@ -282,6 +299,9 @@ interface StepStrings {
282
299
  "emailOtp.reason_otp_rate_limited"?: string;
283
300
  "emailOtp.reason_email_invalid"?: string;
284
301
  "emailOtp.reason_email_disposable"?: string;
302
+ "emailOtp.changeEmail"?: string;
303
+ "emailOtp.backToCode"?: string;
304
+ "emailOtp.reason_otp_resend_limit"?: string;
285
305
  "eid.identifierTitle"?: string;
286
306
  "eid.identifierTitleGeneric"?: string;
287
307
  "eid.identifierDescription"?: string;
@@ -333,6 +353,42 @@ interface StepStrings {
333
353
  "dcv3.mrz.valid"?: string;
334
354
  "dcv3.mrz.looksLikePassport"?: string;
335
355
  "dcv3.mrz.looksLikeCard"?: string;
356
+ "portrait.source.title"?: string;
357
+ "portrait.source.description"?: string;
358
+ "portrait.source.camera"?: string;
359
+ "portrait.source.upload"?: string;
360
+ "portrait.source.uploadInstead"?: string;
361
+ "portrait.upload.title"?: string;
362
+ "portrait.upload.hint"?: string;
363
+ "portrait.upload.choose"?: string;
364
+ "portrait.upload.unsupported"?: string;
365
+ "portrait.upload.failed"?: string;
366
+ "portrait.review.title"?: string;
367
+ "portrait.review.description"?: string;
368
+ "portrait.review.original"?: string;
369
+ "portrait.review.fixed"?: string;
370
+ "portrait.review.fixesTitle"?: string;
371
+ "portrait.review.accept"?: string;
372
+ "portrait.review.retake"?: string;
373
+ "portrait.review.uploadAnother"?: string;
374
+ "portrait.fixes.crop"?: string;
375
+ "portrait.fixes.scale"?: string;
376
+ "portrait.fixes.straighten"?: string;
377
+ "portrait.fixes.background"?: string;
378
+ "portrait.fixes.exposure"?: string;
379
+ "portrait.fixes.white_balance"?: string;
380
+ "reasons.portrait_morph_suspected"?: string;
381
+ "reasons.portrait_reference_mismatch"?: string;
382
+ "reasons.portrait_declined_fix"?: string;
383
+ "doc.uploadInstead"?: string;
384
+ "doc.uploadTitle"?: string;
385
+ "doc.uploadHint"?: string;
386
+ "doc.uploadUnsupported"?: string;
387
+ "doc.uploadFailed"?: string;
388
+ "doc.source.title"?: string;
389
+ "doc.source.description"?: string;
390
+ "doc.source.camera"?: string;
391
+ "doc.source.upload"?: string;
336
392
  "native.doc.introTitle"?: string;
337
393
  "native.doc.introLead"?: string;
338
394
  "native.doc.tip.flat"?: string;
@@ -409,6 +465,7 @@ interface StepStrings {
409
465
  "inApp.copied"?: string;
410
466
  "inApp.copyFailed"?: string;
411
467
  "inApp.continueAnyway"?: string;
468
+ "inApp.openBrowser"?: string;
412
469
  }
413
470
 
414
471
  /**
@@ -558,11 +615,19 @@ interface SekyroVerificationProps {
558
615
  * SDKs). Take them back to your page. Without it, neither button is shown.
559
616
  */
560
617
  onClose?: (event: SekyroCloseEvent) => void;
618
+ /**
619
+ * The browser's back button (UX refresh 2026-11-05 decision 2). `history`: the flow
620
+ * keeps one history entry of its own, so back goes one screen back where the screen has a way back (the camera to
621
+ * its intro, the code to the number), else asks "Leave verification?" once anything was sent, and leaves when
622
+ * nothing was. `none` (the default, of `<SekyroFlow>` too): the flow never touches the page's history. The hosted
623
+ * page passes `history`; a partner page passes it only when the flow owns the page's back button.
624
+ */
625
+ backNavigation?: "history" | "none";
561
626
  /** Fires before the liveness upload (SDK spec §7.5 shadow hook). */
562
627
  onLivenessCaptured?: (artifacts: CapturedArtifacts) => void;
563
628
  /**
564
629
  * The link a desktop shows as a QR code when the live photo needs a phone
565
- * (the session's `hosted_url`); absent = a "continue on your phone" notice.
630
+ * (the session's `hostedUrl`); absent = a "continue on your phone" notice.
566
631
  * `<SekyroFlow>` defaults it to this page's address.
567
632
  */
568
633
  handoffUrl?: string;
@@ -571,7 +636,7 @@ interface SekyroVerificationProps {
571
636
  declare function SekyroVerification(props: SekyroVerificationProps): react.JSX.Element;
572
637
 
573
638
  interface SekyroFlowProps extends SekyroVerificationProps {
574
- /** The session's `hosted_url` (create result): the QR code and the "open in your browser" link. Default: this page's address. */
639
+ /** The session's `hostedUrl` (create result): the QR code and the "open in your browser" link. Default: this page's address. */
575
640
  hostedUrl?: string;
576
641
  /** Override the in-app browser detection (tests / hosts that know better). */
577
642
  inAppBrowser?: boolean;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as Qt}from"../chunk-OUG465K6.js";import{a as B,d as Ht,e as Ce,f as Le,g as Ut,h as $t}from"../chunk-IT66PZDO.js";import{a as Kt}from"../chunk-EZ5TVL6P.js";import{a as zt}from"../chunk-YY76AMUA.js";import{a as Yt,b as Zt,c as qt,d as Jt}from"../chunk-FNBG3472.js";import{a as q}from"../chunk-PYAJMHZH.js";import{b as Lt,c as Ot,d as Vt,f as Dt,g as Bt,j as Ft}from"../chunk-5TOBG5R2.js";import{a as At}from"../chunk-7MMT5M4E.js";import{b as Rt}from"../chunk-KHBM3P4C.js";import{a as oe,b as ne,c as Oe,d as Gt,g as Wt}from"../chunk-NXVTUTKS.js";import{a as ce}from"../chunk-VRDPGOXM.js";import{a as Ho,b as Uo,c as $o,d as Ko,e as Go,f as Ne,g as _}from"../chunk-GGTRTUW3.js";import{a as T,b as Ve}from"../chunk-XDPCJAYO.js";import{a as P,c as xt,i as Bo,k as Fo,l as It,m as Et,n as Tt,r as Mt,t as Ae,u as le}from"../chunk-IUQTOOBI.js";import{a as s}from"../chunk-2KED7D2Q.js";import{useEffect as Wo,useState as Xt}from"react";function Ge(e){let[t,n]=Xt(()=>e?.currentStep?.()??null),[o,l]=Xt(null);return Wo(()=>{if(e===void 0)return;if(typeof e.run!="function"){l(new Error("The step components need @sekyro/web 0.2 or later (Verification.run)."));return}let i=!0,r=e.on("step",a=>{i&&n(a)});return e.run().then(a=>{i&&n(c=>c??a)},a=>{i&&l(a)}),()=>{i=!1,r()}},[e]),{step:t,error:o}}s(Ge,"useVerificationStep");import{useEffect as so,useId as Zo,useMemo as qo,useRef as io,useState as ie}from"react";var zo="AC247 AD376 AE971/0 AF93/0 AG1/1 AI1/1 AL355/0 AM374/0 AO244 AR54/0 AS1/1 AT43/0 AU61/0 AW297 AX358/0 AZ994/0 BA387/0 BB1/1 BD880/0 BE32/0 BF226 BG359/0 BH973 BI257 BJ229 BL590/0 BM1/1 BN673 BO591/0 BQ599 BR55/0 BS1/1 BT975 BW267 BY375/8 BZ501 CA1/1 CC61/0 CD243/0 CF236 CG242 CH41/0 CI225 CK682 CL56 CM237 CN86/0 CO57/0 CR506 CU53/0 CV238 CW599 CX61/0 CY357 CZ420 DE49/0 DJ253 DK45 DM1/1 DO1/1 DZ213/0 EC593/0 EE372 EG20/0 EH212/0 ER291/0 ES34 ET251/0 FI358/0 FJ679 FK500 FM691 FO298 FR33/0 GA241 GB44/0 GD1/1 GE995/0 GF594/0 GG44/0 GH233/0 GI350 GL299 GM220 GN224 GP590/0 GQ240 GR30 GT502 GU1/1 GW245 GY592 HK852 HN504 HR385/0 HT509 HU36/06 ID62/0 IE353/0 IL972/0 IM44/0 IN91/0 IO246 IQ964/0 IR98/0 IS354 IT39 JE44/0 JM1/1 JO962/0 JP81/0 KE254/0 KG996/0 KH855/0 KI686/0 KM269 KN1/1 KP850/0 KR82/0 KW965 KY1/1 KZ7/8 LA856/0 LB961/0 LC1/1 LI423/0 LK94/0 LR231/0 LS266 LT370/0 LU352 LV371 LY218/0 MA212/0 MC377/0 MD373/0 ME382/0 MF590/0 MG261/0 MH692/1 MK389/0 ML223 MM95/0 MN976/0 MO853 MP1/1 MQ596/0 MR222 MS1/1 MT356 MU230 MV960 MW265/0 MX52 MY60/0 MZ258 NA264/0 NC687 NE227 NF672 NG234/0 NI505 NL31/0 NO47 NP977/0 NR674 NU683 NZ64/0 OM968 PA507 PE51/0 PF689 PG675 PH63/0 PK92/0 PL48 PM508/0 PR1/1 PS970/0 PT351 PW680 PY595/0 QA974 RE262/0 RO40/0 RS381/0 RU7/8 RW250/0 SA966/0 SB677 SC248 SD249/0 SE46/0 SG65 SH290 SI386/0 SJ47 SK421/0 SL232/0 SM378 SN221 SO252/0 SR597 SS211/0 ST239 SV503 SX1/1 SY963/0 SZ268 TA290 TC1/1 TD235 TG228 TH66/0 TJ992 TK690 TL670 TM993/8 TN216 TO676 TR90/0 TT1/1 TV688 TW886/0 TZ255/0 UA380/0 UG256/0 US1/1 UY598/0 UZ998 VA39 VC1/1 VE58/0 VG1/1 VI1/1 VN84/0 VU678 WF681 WS685 XK383/0 YE967/0 YT262/0 ZA27/0 ZM260/0 ZW263/0",jt;function eo(e){return jt??(jt=new Map(zo.split(" ").map(t=>{let[n,o]=t.slice(2).split("/");return[t.slice(0,2),[n,o]]}))),jt.get(e.toUpperCase())}s(eo,"entryOf");function to(e){return eo(e)?.[0]}s(to,"dialCodeOf");function oo(e){return eo(e)?.[1]}s(oo,"nationalPrefixOf");import{normalizeNni as Yo}from"@sekyro/web";function De(e){let t=Yo(e).replace(/\D/g,"");return/^\D*\+/.test(e)?`+${t}`:t.startsWith("00")?`+${t.slice(2)}`:t}s(De,"digitsOf");var We=s((e,t)=>(t.trunk!==void 0&&e.startsWith(t.trunk)?e.slice(t.trunk.length):e).slice(0,Math.max(...t.lengths)),"fitDigits");function ze(e,t){let n="",o=0;for(let l of t?.formats?.find(i=>new RegExp(`^(?:${i.leading})`).test(e))?.groups??[])o<e.length&&(n+=(o>0?" ":"")+e.slice(o,o+l)),o+=l;return n+e.slice(o)}s(ze,"groupDigits");function no(e,t){let n=0;for(let o=t;o>0&&n<e.length;n+=1)e[n]!==" "&&(o-=1);return n}s(no,"caretAfter");var Ye=s((e,t)=>t.find(n=>e.startsWith(n.dial)),"countryOfNumber"),ro=s((e,t)=>e.lengths.join(", ").replace(/, (\d+)$/,` ${t} $1`),"lengthsLabel");import{Fragment as uo,jsx as k,jsxs as F}from"react/jsx-runtime";var ao=s((e,t)=>{if(e===void 0)return 0;let n=Date.parse(e)-t;return Number.isFinite(n)?Math.max(0,Math.ceil(n/1e3)):0},"secondsUntil"),Jo=s(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),Qo=["whatsapp","sms"],Xo=new Set(["otp_daily_cap_reached","payment_method_required","spend_cap_reached","insufficient_balance","otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited","otp_number_invalid","otp_number_not_mobile"]);function lo(e){let t=De(e).replace("+","");return/^\d{8,15}$/.test(t)?`+${t}`:null}s(lo,"normalizedPhone");var jo=s(e=>String.fromCodePoint(...Array.from(e,t=>127397+t.charCodeAt(0))),"flagOf");function en(e){let t=[];for(let n of e.phoneCountries??["MR"]){let o=e.phoneRules?.find(i=>i.code===n),l=o?.dial??to(n);l!==void 0&&!t.some(i=>i.code===n)&&t.push({code:n,dial:`+${l}`,...o!==void 0?{rule:o}:{}})}return t}s(en,"phoneCountriesOf");function tn(e,t){if(t===null||!e.startsWith(t.dial))return lo(e);let n=e.slice(t.dial.length).replace(/\D/g,""),o=oo(t.code);return o!==void 0&&n.startsWith(o)&&(n=n.slice(o.length)),lo(t.dial+n)}s(tn,"e164Of");var co=s((e,t)=>(Ye(e,t)??t[0])?.code??null,"countryFor");function on(e){let t=null;try{t=new Intl.DisplayNames([e],{type:"region"})}catch{}return n=>`${t?.of(n.code)??n.code} (${n.dial})`}s(on,"countryLabels");var po="other";function Ze({step:e,locale:t,strings:n,className:o,defaultPhone:l,onError:i}){let r=_(t,n),{t:a}=r,c=qo(()=>en(e),[e.phoneCountries,e.phoneRules]),f=l??c[0]?.dial??"",[S,y]=ie(()=>co(f,c)),g=c.map(m=>m.code).join(",");so(()=>{if(S===null||!c.some(m=>m.code===S)){let m=co(f,c);y(m);let h=x.current,te=c.find(Y=>Y.code===m)?.dial;te!==void 0&&O(Y=>h!==null&&Y.startsWith(h.dial)?te+Y.slice(h.dial.length):Y.startsWith("+")?Y:te)}},[g,f]);let u=c.find(m=>m.code===S)??null,x=io(u);u!==null&&(x.current=u);let[b,O]=ie(f),[I,v]=ie(!1),[D,G]=ie(!1),[W,C]=ie(""),[E,M]=ie(!1),[H,U]=ie(null),J=e.phase==="verify",Ie=zt(J),N=Zo(),ge=io(null);so(()=>{let m=setTimeout(()=>ge.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(m)},[J]);let d=s(async m=>{M(!0),U(null);try{await m()}catch(h){U(ce(h,r.strings)),i?.(h)}finally{M(!1)}},"run"),w=Qo.filter(m=>(e.channels??[]).includes(m)),Q=e.phoneInternational===!0,he=I||u===null,X=he||b.startsWith("+")&&!b.startsWith(u.dial),se=X?void 0:u.rule,gt=X?b:b.replace(u.dial,"").replace(/\D/g,""),j=se?We(gt,se):gt,ht=X&&!he&&!Q&&e.phoneRules?.length&&!c.some(m=>m.dial.startsWith(b)),He=ht?null:se?se.lengths.includes(j.length)?u.dial+j:null:he&&!b.startsWith("+")?null:tn(b,I?null:u),Ee=!e.needsPhone||He!==null,Te=s((m,h=!1)=>{d(()=>e.send({...e.needsPhone&&(!h||b!==f)?{phone:He??b}:{},...m!==void 0?{channel:m}:{}}))},"send"),St=s(m=>{d(()=>e.verify(m))},"submitCode"),kt=s(m=>{m.preventDefault(),J?St(W):w.length<=1&&Ee&&Te(w[0])},"onSubmit"),Lo=s(m=>{let h=m.target,te=m.nativeEvent.inputType,Y=Math.max(0,h.value.lastIndexOf("+")),ae=De(h.value.slice(Y)),ke=Ye(ae,c),be=De(h.value.slice(Y,h.selectionStart)).length,$e=ae,Pt=ae;if(G(!1),!ke&&(he||ae.startsWith("+")))Q&&v(!0);else{let ve=ke??u,Z=ke?ae.slice(ke.dial.length):ae;if(y(ve.code),v(!1),Z===j&&te?.startsWith("delete")&&(te.endsWith("Forward")||(be-=1),Z=Z.slice(0,be)+Z.slice(be+1)),ve.rule){let Ke=We(Z,ve.rule),_t=Z.length-Ke.length;be-=_t,Z=_t>0&&!ke&&j.length===Ke.length?j:Ke}Pt=ve.dial+Z,$e=ze(Z,ve.rule)}O(Pt),h.value=$e;let wt=no($e,be);h.setSelectionRange(wt,wt)},"onNumber"),Me=ht?a("otp.reason_otp_destination_not_allowed"):D&&se?a("otp.phoneLengthError",{digits:ro(se,a("otp.or"))}):"",bt=c.length>1||Q,ee=`${N}-phone`,vt=ao(e.codeExpiresAt,Ie),Se=ao(e.resendAvailableAt,Ie),Re=J&&e.codeExpiresAt!==void 0&&vt===0,Ue=s(m=>a(m==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[Oo,Vo]=a("otp.sentTo",{channel:Ue(e.channel)}).split("{number}"),Do=e.reason==="otp_mismatch"?F(T,{tone:"danger",children:[k("span",{children:a("otp.reason_otp_mismatch")}),k("span",{children:Ve(r,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Xo.has(e.reason)?k(T,{tone:"warning",children:k("span",{children:a(`otp.reason_${e.reason}`)})}):null,Ct=F(uo,{children:[Do,H!==null?k(T,{tone:"danger",children:k("span",{children:a(H)})}):null]});if(J){let m=w.length===0;return F("form",{className:`sekyro-step sekyro-otp${o?` ${o}`:""}`,"aria-labelledby":N,onSubmit:kt,noValidate:!0,children:[k(oe,{id:N,title:a("otp.verifyTitle"),lead:F(uo,{children:[Oo,k("bdi",{dir:"ltr",className:"sekyro-mono",children:e.sentToMasked}),Vo]})}),Ct,F("div",{className:"sekyro-field",children:[k("label",{className:"sekyro-label",htmlFor:`${N}-code`,children:a("otp.codeLabel")}),k(Kt,{id:`${N}-code`,value:W,invalid:e.reason==="otp_mismatch",onChange:h=>{C(h),h.length===6&&W.length!==6&&!E&&!e.attemptsExhausted&&St(h)}}),k("span",{className:`sekyro-help sekyro-otp-expiry${Re?" is-danger":""}`,"aria-hidden":!Re||void 0,children:Re?a("otp.expired"):a("otp.expiresIn",{time:Jo(vt)})})]}),k("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:Re?a("otp.expired"):""}),F(ne,{children:[k(P,{type:"submit",full:!0,disabled:E||W.length!==6||e.attemptsExhausted,"aria-busy":E||void 0,children:a("otp.verify")}),m?k("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:E||Se>0,onClick:()=>Te(void 0,!0),children:Se>0?a("otp.resendIn",{seconds:Se}):a("otp.resend")}):Se>0?k("p",{className:"sekyro-resend is-waiting",children:a("otp.resendIn",{seconds:Se})}):k("div",{className:"sekyro-resend-row",children:w.map(h=>k("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:E,onClick:()=>Te(h,!0),children:a("otp.resendBy",{channel:Ue(h)})},h))})]})]})}let Nt=on(r.locale);return F("form",{className:`sekyro-step sekyro-otp${o?` ${o}`:""}`,"aria-labelledby":N,onSubmit:kt,noValidate:!0,children:[k(oe,{id:N,title:a("otp.sendTitle"),lead:a("otp.sendDescription")}),Ct,e.needsPhone?F("div",{className:"sekyro-field",children:[k("label",{className:"sekyro-label",htmlFor:ee,children:a("otp.phoneLabel")}),F("div",{className:"sekyro-phone",dir:"ltr",children:[u===null||X&&!I?null:F("div",{className:"sekyro-phone__lead",children:[bt?F("select",{className:"sekyro-phone__country",dir:r.locale==="ar"?"rtl":"ltr","aria-label":`${a("otp.countryLabel")}: ${I?a("otp.otherCountry"):Nt(u)}`,value:I?po:u.code,onChange:m=>{G(!1);let h=c.find(te=>te.code===m.target.value);v(h===void 0),h!==void 0&&y(h.code),O(h===void 0?"":h.dial+(X?"":j))},children:[c.map(m=>k("option",{value:m.code,children:Nt(m)},m.code)),Q?k("option",{value:po,children:a("otp.otherCountry")}):null]}):null,F("span",{className:"sekyro-phone__dial",id:`${ee}-dial`,"aria-hidden":bt||void 0,children:[k("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:I?"🌐":jo(u.code)}),I?null:u.dial]})]}),k("input",{ref:ge,id:ee,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel","aria-describedby":`${X?"":`${ee}-dial ${ee}-hint `}${Me?`${ee}-error`:""}`.trim()||void 0,"aria-invalid":!!Me||void 0,placeholder:he?"+":void 0,value:X?b:ze(j,se),onChange:Lo,onKeyDown:m=>{m.key==="Enter"&&!Ee&&G(!0)},onBlur:m=>{m.relatedTarget?.tagName!=="SELECT"&&G(j!==""&&He===null)}})]}),X?null:k("span",{className:"sekyro-help",id:`${ee}-hint`,children:a("otp.phonePlaceholderGeneric")}),Me?k("span",{className:"sekyro-help is-danger",id:`${ee}-error`,role:"alert",children:Me}):null]}):k("p",{className:"sekyro-text-muted",children:a("otp.prefilledNotice")}),k(ne,{children:w.length>0?F("div",{className:"sekyro-actions__group",role:"group","aria-label":a("otp.chooseChannel"),children:[k("p",{className:"sekyro-label","aria-hidden":"true",children:a("otp.chooseChannel")}),w.map((m,h)=>k(P,{kind:h===0?"primary":"ghost",full:!0,disabled:E||!Ee,"aria-busy":h===0&&E||void 0,onClick:()=>Te(m),children:a("otp.sendBy",{channel:Ue(m)})},m))]}):k(P,{type:"submit",full:!0,disabled:E||!Ee,"aria-busy":E||void 0,children:a("otp.send")})})]})}s(Ze,"PhoneOtpStep");import{lazy as rn,Suspense as sn,useMemo as an,useState as ln}from"react";import{Component as nn}from"react";var qe=class qe extends nn{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};s(qe,"LoadBoundary");var z=qe;import{jsx as pe,jsxs as pn}from"react/jsx-runtime";var cn={load:s(()=>import("../email-otp-view-YLMRRLC3.js"),"load")};function Je({locale:e,strings:t,...n}){let o=_(e,t),[l,i]=ln(0),r=an(()=>rn(()=>cn.load().then(c=>({default:c.EmailOtpView}))),[l]),a=pn(T,{tone:"danger",children:[pe("span",{children:o.t("errors.network_error")}),pe(P,{kind:"ghost",onClick:()=>i(c=>c+1),children:o.t("common.retry")})]});return pe(z,{fallback:a,children:pe(sn,{fallback:pe("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:pe(r,{...n,i18n:o})})},l)}s(Je,"EmailOtpStep");import{lazy as un,Suspense as dn,useMemo as mn,useState as fn}from"react";import{jsx as ue,jsxs as gn}from"react/jsx-runtime";var yn={load:s(()=>import("../eid-view-IMKKBPQV.js"),"load")};function Qe({locale:e,strings:t,...n}){let o=_(e,t),[l,i]=fn(0),r=mn(()=>un(()=>yn.load().then(c=>({default:c.EidView}))),[l]),a=gn(T,{tone:"danger",children:[ue("span",{children:o.t("errors.network_error")}),ue(P,{kind:"ghost",onClick:()=>i(c=>c+1),children:o.t("common.retry")})]});return ue(z,{fallback:a,children:ue(dn,{fallback:ue("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:ue(r,{...n,i18n:o})})},l)}s(Qe,"EidStep");import{useMemo as Nn}from"react";import{lazy as hn,Suspense as Sn,useMemo as kn,useState as bn}from"react";import{jsx as de,jsxs as Cn}from"react/jsx-runtime";var vn={load:s(()=>import("../flow-views-HFQJ45NS.js"),"load")};function A({view:e,i18n:t,quiet:n,...o}){let[l,i]=bn(0),r=kn(()=>hn(()=>vn.load().then(c=>({default:c[e]}))),[e,l]),a=Cn(T,{tone:"danger",children:[de("span",{children:t.t("errors.network_error")}),de(P,{kind:"ghost",onClick:()=>i(c=>c+1),children:t.t("common.retry")})]});return de(z,{fallback:a,children:de(Sn,{fallback:n===!0?null:de("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:de(r,{...o,i18n:t})})},l)}s(A,"Flow");import{jsx as Xe,jsxs as Pn}from"react/jsx-runtime";function je({step:e,locale:t,strings:n,className:o,onError:l}){let i=_(t,n),{busy:r,error:a,run:c}=qt(i,l),f=Nn(()=>e.choice.options.flatMap(y=>{let g=Zt(y,i),u=Yt[y.service];return g===null?[]:[{id:y.id,label:g,glyph:u&&Xe(q,{name:u})}]}),[e.choice.options,i]),S=e.choice.options.find(y=>y.service==="national_eid");return Pn("div",{className:o,children:[Xe(Dt,{title:i.t("method.title"),description:i.t("method.description"),options:f,busy:r,error:a,focus:!0,testId:"sekyro-method",onChoose:y=>c(()=>e.choose(y))}),S?.nationalEid?.afterPass==="continue"?Xe(A,{view:"EidContinueHint",i18n:i,provider:S.nationalEid.providerName,quiet:!0}):null]})}s(je,"MethodChoice");import{isValidNni as wn,normalizeNni as mo}from"@sekyro/web";import{useId as _n,useState as et}from"react";import{Fragment as Tn,jsx as L,jsxs as me}from"react/jsx-runtime";var xn=new Set(["nni_not_found","registry_record_not_found"]),In=new Set(["nni_invalid","id_number_invalid"]);function Be({step:e,locale:t,strings:n,className:o,onError:l}){let i=_(t,n),{t:r}=i,[a,c]=et(""),[f,S]=et(!1),[y,g]=et(null),u=_n(),x=e.attemptsExhausted,b=s(async M=>{S(!0),g(null);try{await M()}catch(H){g(ce(H,i.strings)),l?.(H)}finally{S(!1)}},"run"),O=s(M=>{if(M.preventDefault(),e.source!=="typed"){b(()=>e.confirm());return}let H=mo(a);if(!/^\d{10}$/.test(H))return g("population.invalid");if(!wn(H))return g("population.reason_id_number_invalid");b(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(H):e.submitNni(H))},"onSubmit"),I=Ve(i,e.attemptsRemaining,x),v=e.reason!==void 0&&xn.has(e.reason),D=e.reason!==void 0&&In.has(e.reason),G=me(Tn,{children:[e.reason==="registry_unavailable"?me(T,{tone:"warning",children:[L("span",{children:r("population.reason_registry_unavailable")}),L("span",{children:I})]}):null,v&&e.canUseDocument?me(T,{tone:"warning",children:[L("span",{children:r("population.reason_registry_record_not_found_or_document")}),L("span",{children:I}),L(P,{kind:"ghost",disabled:f,onClick:()=>{b(()=>e.useDocument())},children:r("population.useDocument")})]}):null,v&&!e.canUseDocument||D?me(T,{tone:"danger",children:[L("span",{children:r(v?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),L("span",{children:I})]}):null,x&&e.reason===void 0?L(T,{tone:"danger",children:L("span",{children:I})}):null,y!==null?L(T,{tone:"danger",children:L("span",{children:r(y)})}):null]}),[W,C,E]=e.source==="document"?["population.fromDocument.title","population.fromDocument.description","population.fromDocument.continue"]:e.source==="bound"?["session.steps.population.title","population.bound.description","population.bound.confirm"]:e.recheck?["population.recheck.title","population.recheck.description","population.submit"]:["session.steps.population.title","session.steps.population.description","population.submit"];return me("form",{className:`sekyro-step${o?` ${o}`:""}`,"aria-labelledby":u,onSubmit:O,noValidate:!0,children:[L(oe,{id:u,title:r(W),lead:r(C)}),G,e.source==="typed"?me("div",{className:"sekyro-field",children:[L("label",{className:"sekyro-label",htmlFor:`${u}-id-number`,children:r("population.label")}),L("input",{id:`${u}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:r("population.placeholder"),value:a,"aria-describedby":`${u}-id-number-help`,"aria-invalid":y==="population.invalid"||y==="population.reason_id_number_invalid"||void 0,onChange:M=>{g(null),c(mo(M.target.value).replace(/\D/g,"").slice(0,10))}}),L("span",{id:`${u}-id-number-help`,className:"sekyro-help",children:r("population.helper")})]}):null,L(ne,{children:x?null:L(P,{type:"submit",full:!0,disabled:f,"aria-busy":f||void 0,children:r(E)})})]})}s(Be,"IdNumberEntry");function En(e){return Be(e)}s(En,"NniEntry");import{acceptedIssuers as Vn,acceptedTypesFor as So,warmDocumentCapture as Dn}from"@sekyro/web";import{lazy as Bn,Suspense as Fn,useEffect as Hn,useMemo as Un,useState as nt}from"react";import{acceptedIssuers as Mn,acceptedTypesFor as tt}from"@sekyro/web";import{useEffect as fo,useId as Rn,useMemo as yo,useState as ot}from"react";import{jsx as V,jsxs as fe}from"react/jsx-runtime";var go=s(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),An=s(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),Ln=220;function On(e,t,n=[]){let o=null;try{o=new Intl.DisplayNames([e],{type:"region"})}catch{}let l=t.map(a=>({code:a,name:o?.of(a)??a})),i=new Intl.Collator(e),r=s(a=>{let c=n.indexOf(a);return c<0?n.length:c},"rank");return l.sort((a,c)=>r(a.code)-r(c.code)||i.compare(a.name,c.name))}s(On,"countryNames");function ho({step:e,i18n:t,issuer:n,onPicked:o,ageStepUp:l=!1}){let{t:i,locale:r}=t,a=yo(()=>Mn(e.documents),[e.documents]),c=yo(()=>On(r,a,Object.keys(e.documents.byIssuer??{})),[r,a,e.documents]),f=a.length===1?a[0]:null,[S,y]=ot(n??f),[g,u]=ot(""),[x,b]=ot(null),O=Rn(),I=f===null?[]:tt(e.documents,f),v=f!==null&&I.length===1?I[0]:null;fo(()=>{f!==null&&v!==null&&e.selectDocument(f,v)},[f,v]);let D=s((C,E)=>{e.selectDocument(C,E),o?.()},"pick"),G=s(C=>{let E=tt(e.documents,C);E.length===1?D(C,E[0]):y(C)},"chooseIssuer");if(fo(()=>{if(x===null||S===null)return;let C=setTimeout(()=>D(S,x),Ln);return()=>clearTimeout(C)},[x]),v!==null)return null;if(S===null){let C=go(g.trim()),E=C===""?c:c.filter(M=>go(M.name).includes(C)||M.code.toLowerCase()===C);return fe("section",{className:"sekyro-step",children:[V(oe,{title:i("doc.countryTitle"),lead:i(l?"doc.ageStepUp":"doc.pickDescription")}),fe("div",{className:"sekyro-field",children:[V("label",{className:"sekyro-label",htmlFor:O,children:i("doc.countryLabel")}),V("input",{id:O,type:"search",className:"sekyro-input",placeholder:i("doc.countrySearch"),value:g,onChange:M=>u(M.target.value)})]}),E.length===0?V("p",{className:"sekyro-text-muted",children:i("doc.noCountryMatch")}):V("ul",{className:"sekyro-rows",children:E.map(M=>V("li",{children:fe("button",{type:"button",className:"sekyro-row-btn",onClick:()=>G(M.code),children:[V("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:An(M.code)}),M.name]})},M.code))}),V(ne,{children:null})]})}let W=tt(e.documents,S);return fe("section",{className:"sekyro-step",children:[V(oe,{title:i("doc.pickTitle"),lead:i(l&&f!==null?"doc.ageStepUp":"native.doc.holdIt")}),V("div",{className:"sekyro-choices",children:W.map(C=>fe("button",{type:"button",className:"sekyro-card","aria-pressed":x===C,disabled:x!==null&&x!==C,onClick:()=>b(C),children:[V(q,{name:C==="passport"?"passport":"card"}),fe("span",{className:"sekyro-card__body",children:[V("span",{className:"sekyro-card__title",children:i(`doc.type.${C}`)}),V("span",{className:"sekyro-card__sub",children:i(`doc.sub.${C}`)})]}),V("span",{className:"sekyro-radio","aria-hidden":"true"})]},C))}),a.length>1?V("button",{type:"button",className:"sekyro-link",onClick:()=>{y(null),b(null)},children:i("native.doc.changeCountry")}):null,V(ne,{children:null})]})}s(ho,"DocumentPicker");import{jsx as re,jsxs as Kn}from"react/jsx-runtime";var $n={load:s(()=>import("../document-capture-view-PUGWMQAP.js"),"load")};function rt({step:e,locale:t,strings:n,className:o,liveMrz:l}){let i=_(t,n),[r,a]=nt(0),[c,f]=nt(null),S=Vn(e.documents),y=S.length>1,g=e.issuer!==null&&So(e.documents,e.issuer).length>1,u=e.documentType===null||e.issuer===null||c!==null,x=S.length===1&&So(e.documents,S[0]).length===1,[b]=nt(()=>u&&!x),O=e.ageStepUp===!0,I=Un(()=>Bn(()=>$n.load().then(D=>({default:D.DocumentCaptureView}))),[r]);Hn(()=>{Dn()},[]);let v=Kn(T,{tone:"danger",children:[re("span",{children:i.t("errors.network_error")}),re(P,{kind:"ghost",onClick:()=>a(D=>D+1),children:i.t("doc.retryCamera")})]});return re("div",{className:o,children:u?re(ho,{step:e,i18n:i,ageStepUp:O&&c===null&&b,...c==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>f(null)}):re(z,{fallback:v,children:re(Fn,{fallback:re("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:i.t("common.loading")}),children:re(I,{step:e,i18n:i,ageLead:O&&!b,liveMrz:l,...y?{onChangeCountry:s(()=>f("country"),"onChangeCountry")}:{},...g?{onChangeDocument:s(()=>f("document"),"onChangeDocument")}:{}})})},r)})}s(rt,"DocumentCapture");import{warmPortraitCapture as Gn}from"@sekyro/web";import{Component as Wn,lazy as zn,Suspense as Yn,useEffect as Zn,useMemo as qn,useState as Jn}from"react";import{jsx as R,jsxs as it}from"react/jsx-runtime";var Qn={load:s(()=>import("../portrait-capture-view-M5OLPMMO.js"),"load")},lt=class lt extends Wn{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};s(lt,"LoadBoundary");var st=lt;function Xn({step:e,i18n:t}){let{t:n}=t,o=le();return it("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[R("h2",{ref:o,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?R("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?it(T,{tone:"danger",children:[R("span",{children:n("portrait.uploadFailed")}),R(P,{kind:"ghost",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):R("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}s(Xn,"MatchPhase");function at({step:e,locale:t,strings:n,className:o,assetBaseUrl:l,verification:i}){let r=_(t,n),a=Bt(i),[c,f]=Jn(0),S=qn(()=>zn(()=>Qn.load().then(u=>({default:u.PortraitCaptureView}))),[c]);if(Zn(()=>{e.phase==="capture"&&Gn()},[e.phase]),e.phase==="match")return R("div",{className:o,children:R(Xn,{step:e,i18n:r})});let y=R("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")});if(!a.settled)return R("div",{className:o,children:y});if(a.session==="choice"&&a.choice===null)return R("div",{className:o,children:R(Mt,{value:u=>r.t(u),children:R(Ot,{onChoose:a.choose})})});let g=it(T,{tone:"danger",children:[R("span",{children:r.t("errors.network_error")}),R(P,{kind:"ghost",onClick:()=>f(u=>u+1),children:r.t("portrait.retryCamera")})]});return R("div",{className:o,children:R(st,{fallback:g,children:R(Yn,{fallback:y,children:R(S,{step:e,i18n:r,...l!==void 0?{assetBaseUrl:l}:{}})})},c)})}s(at,"PortraitCapture");import{cameraUnavailableCauseOf as gr}from"@sekyro/web";import{useCallback as _e,useEffect as Ro,useId as hr,useMemo as Sr,useRef as mt,useState as xe}from"react";var Pe={light:{danger:{base:"#ca0f07",soft:"#ffdada",fg:"#ca0f07",on:"#ffffff"},success:{base:"#007a5e",soft:"#d5f0e8",fg:"#005341",on:"#ffffff"},warning:{base:"#ffab00",soft:"#fff7e6",fg:"#735003",on:"#191a1b"},info:{base:"#0563d4",soft:"#d3e5ff",fg:"#064da5",on:"#ffffff"}},dark:{danger:{base:"#ff7c7c",soft:"#9c1008",fg:"#ffbbbb",on:"#030303"},success:{base:"#00c897",soft:"#002c23",fg:"#53ffd4",on:"#030303"},warning:{base:"#ffbb2e",soft:"#463102",fg:"#ffd98a",on:"#030303"},info:{base:"#5da9ff",soft:"#063778",fg:"#acd0ff",on:"#030303"}}},jn=["danger","success","warning","info"];function ct(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}s(ct,"channel");function ko(e){let t=ct(parseInt(e.slice(1,3),16)),n=ct(parseInt(e.slice(3,5),16)),o=ct(parseInt(e.slice(5,7),16));return .2126*t+.7152*n+.0722*o}s(ko,"luminance");function er(e,t){let n=ko(e),o=ko(t),l=Math.max(n,o),i=Math.min(n,o);return(l+.05)/(i+.05)}s(er,"contrastRatio");function bo(e,t){return Math.min(...jn.map(n=>er(Pe[e][n].fg,t)))}s(bo,"worstAgainst");function vo(e,t,n){return Math.min(bo(e,t),bo(e,n))}s(vo,"worstStatusContrast");function Co(e,t){return vo("light",e,t)>=vo("dark",e,t)?"light":"dark"}s(Co,"statusSchemeFor");import{useId as tr,useState as or}from"react";import{jsx as Fe,jsxs as No}from"react/jsx-runtime";var nr=["intro","data","processing","sharing","retention"];function Po({i18n:e,purpose:t="identity"}){let{t:n}=e,[o,l]=or(!1),i=tr(),[r,a=""]=n("consent.short").split("{terms}");return No("section",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-consent",children:[No("p",{className:"sekyro-text-muted",children:[r,Fe("button",{type:"button",className:"sekyro-link","aria-expanded":o,"aria-controls":i,onClick:()=>l(c=>!c),children:n("consent.termsLink")}),a]}),Fe("div",{id:i,hidden:!o,className:"sekyro-stack sekyro-stack--1 sekyro-text-muted","data-testid":"sekyro-consent-terms",children:t==="human"?Fe(A,{view:"HumanConsentTerms",i18n:e,quiet:!0}):nr.map(c=>Fe("p",{children:n(`consent.terms.${c}`)},c))})]})}s(Po,"ConsentNotice");function wo(e){let t=e.trim().split(/\s+/).filter(o=>o!=="");return(t.length>=2?[t[0],t[1]].map(o=>Array.from(o??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}s(wo,"initials");import{useSyncExternalStore as rr}from"react";var Io=s(e=>({colors:{...e?B.dark:B.light},radius:B.radiusLg,fontFamily:B.font}),"brandTheme"),Ri=Io(!1),_o=/^#[0-9a-f]{6}$/i;function pt(e,t,n){if(t)return null;let o=Ce(e).colors,l=n?.colors?.bg??o?.bg,i=n?.colors?.surface??o?.surface;return l===void 0&&i===void 0||l!==void 0&&!_o.test(l)||i!==void 0&&!_o.test(i)?null:Co(l??B.light.bg,i??B.light.surface)}s(pt,"partnerStatusScheme");function Eo(e,t,n){let o=Ce(e);if(n&&o.colors!==void 0){let{brand:l,brandFg:i}=o.colors;l!==void 0&&lr(l,B.dark.bg)>=3?o.colors={brand:l,ring:l,...i!==void 0?{brandFg:i}:{}}:delete o.colors}if(pt(e,n,t)==="dark"){let l=Pe.dark;o.colors={...o.colors,danger:l.danger.base,success:l.success.base,warning:l.warning.fg}}return Le(Io(n),o,Ht(t))}s(Eo,"verificationTheme");function To(e){let t=rr(ar,ir,()=>!1);return e==="dark"||e==="system"&&t}s(To,"useDarkScheme");var sr="(prefers-color-scheme: dark)",Mo=s(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(sr):null,"media"),ir=s(()=>Mo()?.matches??!1,"prefersDark");function ar(e){let t=Mo();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}s(ar,"subscribe");function lr(e,t){let[n,o]=[xo(e),xo(t)];return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}s(lr,"contrast");function xo(e){let t=[1,3,5].map(n=>{let o=Number.parseInt(e.slice(n,n+2),16)/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}s(xo,"luminance");import{useEffect as cr,useId as pr,useState as ur}from"react";import{jsx as $,jsxs as we}from"react/jsx-runtime";var dr=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]),mr={approved:"M6.5 12.5l3.6 3.6 7.4-8.2",review:"M12 7v5l3.2 2",expired:"M8 5h8M8 19h8M9 5c0 4 6 5 6 7s-6 3-6 7M15 5c0 4-6 5-6 7s6 3 6 7",rejected:"M8 8l8 8M16 8l-8 8"};function fr({outcome:e}){return we("svg",{className:`sekyro-outcome sekyro-outcome--${e}`,viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[$("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"57",pathLength:"1"}),$("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),$("path",{className:"sekyro-outcome__glyph",d:mr[e],pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]})}s(fr,"OutcomeMark");function yr({label:e,id:t,copied:n}){let[o,l]=ur(!1);return cr(()=>{if(!o)return;let i=setTimeout(()=>l(!1),1600);return()=>clearTimeout(i)},[o]),we("button",{type:"button",className:`sekyro-reference${o?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>l(!0),()=>{})},children:[$("span",{"aria-live":"polite",children:o?n:e}),$("bdi",{dir:"ltr",children:t}),$(q,{name:"copy"})]})}s(yr,"ReferenceLine");function ut({step:e,locale:t,strings:n,className:o,onClose:l}){let i=_(t,n),{t:r}=i,a=pr(),c=le(),f=e.context.orgName,S=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",y;switch(e.display){case"policy_stop":{let g=e.failureReason??"";if(dr.has(xt(g)))y=r("session.result.detailsMismatch",{org:f});else if(g==="device_velocity_exceeded")y=r("session.result.deviceVelocity",{org:f});else if(g==="capture_tampered")y=r("session.result.deviceStop");else if(g==="camera_unavailable")y=r("reasons.camera_unavailable",{org:f});else if(g==="underage_estimated")y=r("reasons.underage_estimated");else if(g==="starter_credit_claimed")y=r("reasons.starter_credit_claimed");else{let u=Et(g);y=u!==null?r(u,{org:f}):r("session.result.rejected.description")}break}case"cooldown":{let g=Tt(i.locale,e.retryAfter);y=g!==null?r(g.key,{time:g.time}):r("reasons.device_cooldown");break}case"platform_unsupported":y=r("result.platform_unsupported");break;case"attempts_exhausted":y=r("common.noAttemptsLeft");break;default:y=f!==""?r(`native.result.${S}`,{org:f}):r(`session.result.${S}.description`)}return we("section",{className:`sekyro-result${o?` ${o}`:""}`,"aria-labelledby":a,"data-testid":"sekyro-result",children:[we("div",{className:"sekyro-result__body",children:[$(fr,{outcome:e.display==="cooldown"?"review":S}),we("div",{className:"sekyro-heading",children:[$("h2",{id:a,ref:c,tabIndex:-1,className:"sekyro-text-body",children:r(`session.result.${S}.title`)}),$("p",{className:"sekyro-text-muted",children:y})]}),$(yr,{label:r("result.referenceLabel"),id:e.context.sessionId,copied:r("native.result.copied")})]}),l!==void 0?$("div",{className:"sekyro-actions",children:$(P,{full:!0,onClick:l,children:f!==""?r("native.result.back",{org:f}):r("native.close")})}):null]})}s(ut,"VerificationResultScreen");import{Fragment as dt,jsx as p,jsxs as K}from"react/jsx-runtime";function kr(e,t,n){let o=t?B.dark:B.light,l=t?B.roles.dark:B.roles.light,i=e.colors??{},r={},a=i.fg===o.fg&&i.surface===o.surface;if(i.brand===o.brand&&i.surface===o.surface&&(r["--sekyro-color-brand-soft"]=l.brandSoft),a&&(r["--sekyro-color-line"]=l.line,r["--sekyro-color-line-subtle"]=l.lineSubtle,r["--sekyro-color-line-strong"]=l.lineStrong,r["--sekyro-color-sunken"]=l.sunken),i.fgMuted===o.fgMuted&&i.surface===o.surface&&(r["--sekyro-color-fg-subtle"]=l.fgSubtle),e.fontFamily===B.font&&(r["--sekyro-font-display"]=B.fontDisplay),n!==null){let c=Pe[n];r["--sekyro-color-danger-soft"]=c.danger.soft,r["--sekyro-color-success-soft"]=c.success.soft,r["--sekyro-color-warning-soft"]=c.warning.soft}return r}s(kr,"flowRoles");function ft(e){let{verification:t,locale:n,strings:o,onStep:l,onResult:i}=e,{step:r,error:a}=Ge(t);Ro(()=>{r!==null&&l?.(r)},[r,l]),Ro(()=>i===void 0?void 0:t.on("result",i),[t,i]);let c=To(e.colorScheme??"light"),f=r?.context.branding,S=Eo(f,e.theme,c),[y,g]=xe(!1),u=`sekyro-verification${c?" sekyro-verification--dark":""}${y?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,x=mt(e.onClose);x.current=e.onClose;let b=mt(r);b.current=r;let O=_e(()=>{let v=b.current;x.current?.(v?.kind==="result"?{reason:"finished",result:v.result}:{reason:"cancelled"})},[]),I=Sr(()=>t.reportCaptureIssue===void 0?null:v=>t.reportCaptureIssue?.(v),[t]);return p($t,{theme:S,className:u,children:p(Ne,{locale:n,...o!==void 0?{strings:o}:{},children:p("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:kr(S,c,pt(f,c,e.theme)),children:p(Gt.Provider,{value:g,children:p(Oe.Provider,{value:e.onClose!==void 0?O:void 0,children:p(At.Provider,{value:I,children:p(Cr,{...e,step:r,error:a,immersive:y})})})})})})})}s(ft,"SekyroVerification");function br(e,t){if(t===void 0)return null;let n=e,o=n[`session.processing.${t}.title`],l=n[`session.processing.${t}.description`];return typeof o=="string"&&o!==""&&typeof l=="string"&&l!==""?{title:o,description:l}:null}s(br,"processingCopyOf");function vr({error:e,retry:t}){let{t:n}=_(),o=le();return K(Ae,{tone:"danger",testId:"sekyro-error-notice",children:[p("span",{children:n(It(e.kind))}),e.retryable?p(P,{ref:o,kind:"ghost",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}s(vr,"CameraErrorNotice");function Cr(e){let{step:t,error:n,slots:o,immersive:l}=e,i=_(),{t:r}=i,[a,c]=xe(!1),[f,S]=xe(0),[y,g]=xe(null),u=t?.context.purpose??"identity",x=e.verification,b=u==="human"||t?.context.cameraUnavailableHandled===!0,O=x.reportCameraUnavailable!==void 0&&b?d=>x.reportCameraUnavailable?.(d)??Promise.resolve():void 0,I=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,v=e.handoffUrl,D=_e((d,w)=>O===void 0?void 0:p(A,{view:"NoCameraView",i18n:i,quiet:!0,cause:w,onRetry:d,...I?{onContinue:O}:{},...v!==void 0?{handoffUrl:v}:{}}),[i,x,b,I,v]),G=_e((d,w)=>p(Jt,{start:d,context:w,human:u==="human",extra:w.canChooseFacing&&p(Vt,{value:w.facing,onChange:w.setFacing}),notice:w.permissionSettled&&w.permission==="denied"?D(d,"denied"):void 0}),[u,D]),W=_e((d,w)=>{let Q=gr(d.kind);return(Q!==void 0?D(w,Q):void 0)??K(dt,{children:[p(vr,{error:d,retry:w}),Q!==void 0&&v!==void 0?p(A,{view:"DesktopHandoffView",i18n:i,quiet:!0,url:v}):null]})},[D,v,i]),C=mt(""),E=e.livenessProps?.slots?.stageOverlay,M=_e(d=>(d.guidance!==""&&!d.coached&&(C.current=d.guidance),p(Qt,{testId:"sekyro-capture-stage",video:p("video",{ref:d.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:d.guidance!==""?d.guidance:C.current,note:d.note,busy:d.settled,progress:d.phase==="seeking"||d.phase==="aligning"?d.progress:1,still:d.still,live:d.live,closeLabel:r("native.close"),overlay:E?.(d.videoRef),ramp:d.ramp?.colour??null,...d.settled?{}:{onClose:s(()=>S(w=>w+1),"onClose")},end:d.switchCamera&&p("button",{type:"button",className:"sekyro-glass",onClick:d.switchCamera,"aria-label":r("capture.switchCamera"),children:p(Rt,{})})})),[r,E]),H=hr();if(n!==null)return p(Ae,{tone:"danger",children:p("span",{children:r(ce(n,i.strings))})});if(t===null)return p("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r("common.loading")});let{context:U}=t,J=s(d=>{c(!0),d().finally(()=>c(!1))},"refresh"),Ie=o?.header??p(Pr,{context:U,headerId:H,end:o?.headerEnd}),N,ge=y===t.key&&t.context.switchable!==void 0;if(ge)N=p(A,{view:"LaneChoiceView",i18n:i,step:t,onClose:()=>g(null)});else switch(t.kind){case"phone_otp":N=p(Ze,{step:t});break;case"email_otp":N=p(Je,{step:t});break;case"method":N=p(je,{step:t});break;case"registry":N=p(Be,{step:t});break;case"document":N=p(rt,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let d=e.livenessProps?.slots?.intro,w={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??G,...d===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:W}:{}},...f>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:i.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};N=p(Lt.Provider,{value:M,children:t.instructions==="icao"||t.livePhoto?.icao===!0?p(A,{view:"LivePhotoLiveness",i18n:i,step:t,livenessProps:w,sekyroIntro:d===void 0},f):p(Ft,{...w},f)});break}case"portrait":N=K(dt,{children:[t.retakeOnly?p(A,{view:"PortraitRetakeNotice",i18n:i,quiet:!0}):null,p(at,{step:t,verification:e.verification,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":N=p(A,{view:"ContactChoiceView",i18n:i,step:t});break;case"choice":N=p(A,{view:"GenericChoiceView",i18n:i,step:t});break;case"identity_summary":N=p(A,{view:"IdentitySummaryView",i18n:i,step:t});break;case"mobile_required":N=e.handoffUrl!==void 0?p(A,{view:"HandoffView",i18n:i,url:e.handoffUrl,refresh:t.refresh}):K(Ae,{tone:"info",children:[p("strong",{children:r("handoff.title")}),p("span",{children:r("reasons.mobile_required")}),p(P,{kind:"ghost",disabled:a,onClick:()=>J(t.refresh),children:r("common.refresh")})]});break;case"processing":{let d=br(i.strings,t.service);N=K("section",{className:"sekyro-stack sekyro-stack--1",role:"status","aria-live":"polite",children:[p("h2",{className:"sekyro-text-body",children:d?.title??r("session.processing.title")}),p("p",{className:"sekyro-text-muted",children:d?.description??r("session.processing.description")}),t.stalled?p(P,{kind:"ghost",disabled:a,onClick:()=>J(t.refresh),children:r("common.refresh")}):null]});break}case"eid":N=p(Qe,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";N=K("section",{className:"sekyro-stack sekyro-stack--1",children:[p("h2",{className:"sekyro-text-body",children:r(d?"needsApp.title":"unsupported.title")}),p("p",{children:d?U.orgName!==""?r("needsApp.description",{org:U.orgName}):r("needsApp.descriptionNoOrg"):r("unsupported.description",{org:U.orgName})})]});break}case"result":N=o?.result?.(t)??p(Nr,{step:t});break;default:{let d=t;N=null}}return K(dt,{children:[l?null:Ie,!l&&t.kind!=="result"&&U.sections.length>1?p(wr,{context:U,current:t.section,i18n:i}):null,!l&&!U.consentRecorded&&t.kind!=="result"?p(Po,{i18n:i,purpose:U.purpose}):null,p(Wt,{pageKey:t.key,children:N}),!l&&!ge&&t.kind!=="result"&&t.context.switchable!==void 0?p(A,{view:"LaneSwitch",i18n:i,step:t,onOpen:()=>g(t.key),quiet:!0},t.key):null,l?null:o?.footer!==void 0?o.footer:U.branding?.hideAttribution===!0?null:K("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[p(q,{name:"lock"}),r("shell.verifiedBy")]})]})}s(Cr,"Body");function Nr({step:e}){return p(Oe.Consumer,{children:t=>p(ut,{step:e,...t!==void 0?{onClose:t}:{}})})}s(Nr,"ResultPage");function Pr({context:e,headerId:t,end:n}){let{t:o}=_(),[l,i]=xe(!1),r=l?void 0:e.branding?.logoUrl,a=e.orgName!==""?e.orgName:o(e.returning?"returning.title":"session.title");return K("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:[K("div",{className:"sekyro-org",children:[p("span",{className:"sekyro-org__tile","aria-hidden":"true",children:r!==void 0?p("img",{className:"sekyro-org__logo",src:r,alt:"",onError:()=>i(!0)}):wo(e.orgName)}),K("div",{className:"sekyro-org__text",children:[p("h1",{id:t,className:"sekyro-org__name",children:a}),p("p",{className:"sekyro-org__sub",children:o(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),n!=null?p("div",{className:"sekyro-org__end",children:n}):null,p(Oe.Consumer,{children:c=>c!==void 0?p("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":o("native.close"),onClick:c,children:p(q,{name:"close"})}):null})]}),e.returning?p("p",{className:"sekyro-text-muted",children:o("returning.description")}):null]})}s(Pr,"OrgHeader");function wr({context:e,current:t,i18n:n}){let o=t===null?-1:e.sections.indexOf(t),l=e.progress,i=l!==void 0&&l.length===e.sections.length?l:e.sections.map((r,a)=>({id:r,state:a<o?"done":a===o?"current":"upcoming"}));return p("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:i.map(({id:r,state:a})=>p("li",{className:`sekyro-progress__bar${a==="done"?" is-done":a==="current"?" is-current":""}`,...a==="current"?{"aria-current":"step"}:{},children:p("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${r}`]??r})},r))})}s(wr,"SectionProgress");import{useEffect as xr,useState as Ao}from"react";var _r=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function yt(e){let t=e??(typeof navigator>"u"?"":String(navigator.userAgent??""));return _r.test(t)}s(yt,"isInAppBrowser");import{jsx as ye}from"react/jsx-runtime";function Ir(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}s(Ir,"pageUrl");function Er({hostedUrl:e,inAppBrowser:t,...n}){let[o,l]=Ao(t===!0);xr(()=>{t===void 0&&yt()&&l(!0)},[t]);let[i,r]=Ao(!1),a=n.handoffUrl??e??Ir();return o&&!i?ye(Ut,{theme:Le(Ce(void 0),n.theme),...n.className!==void 0?{className:n.className}:{},children:ye(Ne,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:ye("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-stack sekyro-stack--4",children:ye(Tr,{url:a,onContinue:()=>r(!0)})})})}):ye(ft,{...n,...a!==""?{handoffUrl:a}:{}})}s(Er,"SekyroFlow");function Tr({url:e,onContinue:t}){let n=_();return ye(A,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}s(Tr,"Prompt");export{rt as DocumentCapture,Qe as EidStep,Je as EmailOtpStep,Be as IdNumberEntry,je as MethodChoice,En as NniEntry,Ze as PhoneOtpStep,at as PortraitCapture,Er as SekyroFlow,ft as SekyroVerification,Ne as StepI18nProvider,ut as VerificationResultScreen,Ho as arSteps,Uo as enSteps,Ko as formatTemplate,$o as frSteps,yt as isInAppBrowser,Bo as loadSekyroLocale,Go as resolveSekyroStrings,Fo as retakeHintStringKey,_ as useStepI18n,Ge as useVerificationStep};
2
+ import{a as Rn}from"../chunk-3H6KQ6BP.js";import{a as K,d as yn,e as yt,f as qe,g as gn,h as hn}from"../chunk-ZZIBCKKC.js";import{a as kn,b as Sn,c as _n}from"../chunk-GUTF3SPK.js";import{a as xn,b as En,c as In,d as Tn,e as ht,g as je}from"../chunk-IAJAM4I6.js";import{b as ln,c as cn,d as un,e as dn,f as pn,h as fn,k as mn}from"../chunk-JTDARDD6.js";import{b as sn}from"../chunk-AGIBFSCL.js";import{a as an}from"../chunk-7MMT5M4E.js";import{a as ke}from"../chunk-VRDPGOXM.js";import{a as Po,b as _o,c as xo,d as Eo,e as Io,f as De,g as R}from"../chunk-455FWUKU.js";import{a as B,b as ne,c as bn,d as oe,e as vn,f as Ze,g as Je,h as gt,i as Cn,k as Qe,l as Nn,m as wn,o as Pn,p as O,q as Xe}from"../chunk-T7C7Q4AN.js";import{c as rn}from"../chunk-VBIVDLBE.js";import{a as v,c as en,j as No,l as wo,m as tn,n as nn,o as on,q as mt,r as ve}from"../chunk-3GCHNE7R.js";import{a as s}from"../chunk-2KED7D2Q.js";import{useEffect as To,useState as Ln}from"react";function kt(e){let[t,o]=Ln(()=>e?.currentStep?.()??null),[n,a]=Ln(null);return To(()=>{if(e===void 0)return;if(typeof e.run!="function"){a(new Error("The step components need @sekyro/web 0.2 or later (Verification.run)."));return}let i=!0,r=e.on("step",l=>{i&&o(l)});return e.run().then(l=>{i&&o(c=>c??l)},l=>{i&&a(l)}),()=>{i=!1,r()}},[e]),{step:t,error:n}}s(kt,"useVerificationStep");import{useEffect as vt,useId as Mo,useMemo as Oo,useRef as Ct,useState as ce}from"react";var Ro="AC247 AD376 AE971/0 AF93/0 AG1/1 AI1/1 AL355/0 AM374/0 AO244 AR54/0 AS1/1 AT43/0 AU61/0 AW297 AX358/0 AZ994/0 BA387/0 BB1/1 BD880/0 BE32/0 BF226 BG359/0 BH973 BI257 BJ229 BL590/0 BM1/1 BN673 BO591/0 BQ599 BR55/0 BS1/1 BT975 BW267 BY375/8 BZ501 CA1/1 CC61/0 CD243/0 CF236 CG242 CH41/0 CI225 CK682 CL56 CM237 CN86/0 CO57/0 CR506 CU53/0 CV238 CW599 CX61/0 CY357 CZ420 DE49/0 DJ253 DK45 DM1/1 DO1/1 DZ213/0 EC593/0 EE372 EG20/0 EH212/0 ER291/0 ES34 ET251/0 FI358/0 FJ679 FK500 FM691 FO298 FR33/0 GA241 GB44/0 GD1/1 GE995/0 GF594/0 GG44/0 GH233/0 GI350 GL299 GM220 GN224 GP590/0 GQ240 GR30 GT502 GU1/1 GW245 GY592 HK852 HN504 HR385/0 HT509 HU36/06 ID62/0 IE353/0 IL972/0 IM44/0 IN91/0 IO246 IQ964/0 IR98/0 IS354 IT39 JE44/0 JM1/1 JO962/0 JP81/0 KE254/0 KG996/0 KH855/0 KI686/0 KM269 KN1/1 KP850/0 KR82/0 KW965 KY1/1 KZ7/8 LA856/0 LB961/0 LC1/1 LI423/0 LK94/0 LR231/0 LS266 LT370/0 LU352 LV371 LY218/0 MA212/0 MC377/0 MD373/0 ME382/0 MF590/0 MG261/0 MH692/1 MK389/0 ML223 MM95/0 MN976/0 MO853 MP1/1 MQ596/0 MR222 MS1/1 MT356 MU230 MV960 MW265/0 MX52 MY60/0 MZ258 NA264/0 NC687 NE227 NF672 NG234/0 NI505 NL31/0 NO47 NP977/0 NR674 NU683 NZ64/0 OM968 PA507 PE51/0 PF689 PG675 PH63/0 PK92/0 PL48 PM508/0 PR1/1 PS970/0 PT351 PW680 PY595/0 QA974 RE262/0 RO40/0 RS381/0 RU7/8 RW250/0 SA966/0 SB677 SC248 SD249/0 SE46/0 SG65 SH290 SI386/0 SJ47 SK421/0 SL232/0 SM378 SN221 SO252/0 SR597 SS211/0 ST239 SV503 SX1/1 SY963/0 SZ268 TA290 TC1/1 TD235 TG228 TH66/0 TJ992 TK690 TL670 TM993/8 TN216 TO676 TR90/0 TT1/1 TV688 TW886/0 TZ255/0 UA380/0 UG256/0 US1/1 UY598/0 UZ998 VA39 VC1/1 VE58/0 VG1/1 VI1/1 VN84/0 VU678 WF681 WS685 XK383/0 YE967/0 YT262/0 ZA27/0 ZM260/0 ZW263/0",Mn;function On(e){return Mn??(Mn=new Map(Ro.split(" ").map(t=>{let[o,n]=t.slice(2).split("/");return[t.slice(0,2),[o,n]]}))),Mn.get(e.toUpperCase())}s(On,"entryOf");function An(e){return On(e)?.[0]}s(An,"dialCodeOf");function Dn(e){return On(e)?.[1]}s(Dn,"nationalPrefixOf");import{normalizeNni as Lo}from"@sekyro/web";function et(e){let t=Lo(e).replace(/\D/g,"");return/^\D*\+/.test(e)?`+${t}`:t.startsWith("00")?`+${t.slice(2)}`:t}s(et,"digitsOf");var St=s((e,t)=>(t.trunk!==void 0&&e.startsWith(t.trunk)?e.slice(t.trunk.length):e).slice(0,Math.max(...t.lengths)),"fitDigits");function tt(e,t){let o="",n=0;for(let a of t?.formats?.find(i=>new RegExp(`^(?:${i.leading})`).test(e))?.groups??[])n<e.length&&(o+=(n>0?" ":"")+e.slice(n,n+a)),n+=a;return o+e.slice(n)}s(tt,"groupDigits");function Fn(e,t){let o=0;for(let n=t;n>0&&o<e.length;o+=1)e[o]!==" "&&(n-=1);return o}s(Fn,"caretAfter");var bt=s((e,t)=>t.find(o=>e.startsWith(o.dial)),"countryOfNumber"),Bn=s((e,t)=>e.lengths.join(", ").replace(/, (\d+)$/,` ${t} $1`),"lengthsLabel");import{Fragment as Gn,jsx as b,jsxs as $}from"react/jsx-runtime";var Vn=s((e,t,o)=>{if(e===void 0)return 0;let n=Date.parse(e)-t;return Number.isFinite(n)?Math.min(o,Math.max(0,Math.ceil(n/1e3))):0},"secondsUntil"),Ao=600,Do=30,Fo=s(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),Bo=["whatsapp","sms"],Hn=new Set(["otp_daily_cap_reached","payment_method_required","spend_cap_reached","insufficient_balance","otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited","otp_resend_limit","otp_number_invalid","otp_number_not_mobile"]);function Un(e){let t=et(e).replace("+","");return/^\d{8,15}$/.test(t)?`+${t}`:null}s(Un,"normalizedPhone");var Vo=s(e=>String.fromCodePoint(...Array.from(e,t=>127397+t.charCodeAt(0))),"flagOf");function Ho(e){let t=[];for(let o of e.phoneCountries??["MR"]){let n=e.phoneRules?.find(i=>i.code===o),a=n?.dial??An(o);a!==void 0&&!t.some(i=>i.code===o)&&t.push({code:o,dial:`+${a}`,...n!==void 0?{rule:n}:{}})}return t}s(Ho,"phoneCountriesOf");function Uo(e,t){if(t===null||!e.startsWith(t.dial))return Un(e);let o=e.slice(t.dial.length).replace(/\D/g,""),n=Dn(t.code);return n!==void 0&&o.startsWith(n)&&(o=o.slice(n.length)),Un(t.dial+o)}s(Uo,"e164Of");var $n=s((e,t)=>(bt(e,t)??t[0])?.code??null,"countryFor");function $o(e){let t=null;try{t=new Intl.DisplayNames([e],{type:"region"})}catch{}return o=>`${t?.of(o.code)??o.code} (${o.dial})`}s($o,"countryLabels");var Kn="other";function Nt({step:e,locale:t,strings:o,className:n,defaultPhone:a,onError:i}){let r=R(t,o),{t:l}=r,c=Oo(()=>Ho(e),[e.phoneCountries,e.phoneRules]),d=a??c[0]?.dial??"",[y,m]=ce(()=>$n(d,c)),h=c.map(g=>g.code).join(",");vt(()=>{if(y===null||!c.some(g=>g.code===y)){let g=$n(d,c);m(g);let N=w.current,q=c.find(j=>j.code===g)?.dial;q!==void 0&&I(j=>N!==null&&j.startsWith(N.dial)?q+j.slice(N.dial.length):j.startsWith("+")?j:q)}},[h,d]);let p=c.find(g=>g.code===y)??null,w=Ct(p);p!==null&&(w.current=p);let[S,I]=ce(d),[T,x]=ce(!1),[M,D]=ce(!1),[L,k]=ce(""),[P,A]=ce(!1),[W,ae]=ce(null),[ee,te]=ce(!1),[Ue,ct]=ce(null),ue=Ct(null),de=e.phase==="verify"&&!ee,$e=e.phase==="verify",Ke=_n($e),[ut,Ge]=kn(e.reason==="otp_mismatch",e.attemptsRemaining,()=>k("")),z=Mo(),Ie=Ct(null);vt(()=>{let g=setTimeout(()=>Ie.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(g)},[de]);let Te=e.phase==="verify"?e.codeExpiresAt??"sent":null;vt(()=>{Te!==null&&(te(!1),ue.current!==null&&!Hn.has(e.reason??"")&&ct(ue.current),ue.current=null)},[Te]);let he=s(async g=>{A(!0),ae(null);try{await g()}catch(N){ae(ke(N,r.strings)),i?.(N)}finally{A(!1)}},"run"),J=Bo.filter(g=>(e.channels??[]).includes(g)),F=e.phoneInternational===!0,pe=T||p===null,Q=pe||S.startsWith("+")&&!S.startsWith(p.dial),_=Q?void 0:p.rule,Se=Q?S:S.replace(p.dial,"").replace(/\D/g,""),Y=_?St(Se,_):Se,Re=Q&&!pe&&!F&&e.phoneRules?.length&&!c.some(g=>g.dial.startsWith(S)),fe=Re?null:_?_.lengths.includes(Y.length)?p.dial+Y:null:pe&&!S.startsWith("+")?null:Uo(S,T?null:p),f=!e.needsPhone||fe!==null,C=s((g,N=!1)=>{let q=e.needsPhone?N?Ue:{number:fe??S,shown:Q||p===null?fe??S:`${p.dial} ${tt(Y,_)}`}:null;ue.current=q,he(async()=>{try{await e.send({...q!==null?{phone:q.number}:{},...g!==void 0?{channel:g}:{}})}catch(j){throw ue.current=null,j}})},"send"),X=s(g=>{he(()=>e.verify(g))},"submitCode"),Kt=s(g=>{g.preventDefault(),de?X(L):J.length<=1&&f&&C(J[0])},"onSubmit"),So=s(g=>{let N=g.target,q=g.nativeEvent.inputType,j=Math.max(0,N.value.lastIndexOf("+")),be=et(N.value.slice(j)),Me=bt(be,c),Oe=et(N.value.slice(j,N.selectionStart)).length,pt=be,Qt=be;if(D(!1),!Me&&(pe||be.startsWith("+")))F&&x(!0);else{let Ae=Me??p,le=Me?be.slice(Me.dial.length):be;if(m(Ae.code),x(!1),le===Y&&q?.startsWith("delete")&&(q.endsWith("Forward")||(Oe-=1),le=le.slice(0,Oe)+le.slice(Oe+1)),Ae.rule){let ft=St(le,Ae.rule),jt=le.length-ft.length;Oe-=jt,le=jt>0&&!Me&&Y.length===ft.length?Y:ft}Qt=Ae.dial+le,pt=tt(le,Ae.rule)}I(Qt),N.value=pt;let Xt=Fn(pt,Oe);N.setSelectionRange(Xt,Xt)},"onNumber"),We=Re?l("otp.reason_otp_destination_not_allowed"):M&&_?l("otp.phoneLengthError",{digits:Bn(_,l("otp.or"))}):"",Gt=c.length>1||F,me=`${z}-phone`,dt=Vn(e.codeExpiresAt,Ke,Ao),Le=Vn(e.resendAvailableAt,Ke,Do),ze=de&&e.codeExpiresAt!==void 0&&dt===0,Wt=e.needsPhone&&!e.attemptsExhausted,zt=$e&&(e.codeExpiresAt===void 0||dt>0),Yt=de&&Wt?()=>te(!0):ee&&zt?()=>te(!1):null;Ze(Yt===null?null:P?()=>{}:Yt);let Ye=s(g=>l(g==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[bo,vo]=l("otp.sentTo",{channel:Ye(e.channel)}).split("{number}"),qt=e.context.simulation?.otpCode,Co=e.reason==="otp_mismatch"?$(O,{tone:"danger",children:[b("span",{children:l("otp.reason_otp_mismatch")}),b("span",{children:Xe(r,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Hn.has(e.reason)?b(O,{tone:"warning",children:b("span",{children:l(`otp.reason_${e.reason}`)})}):null,Zt=$(Gn,{children:[Co,W!==null?b(O,{tone:"danger",children:b("span",{children:l(W)})}):null]});if(de){let g=J.length===0;return $("form",{className:`sekyro-step sekyro-otp${n?` ${n}`:""}`,"aria-labelledby":z,onSubmit:Kt,noValidate:!0,children:[b(ne,{id:z,title:l("otp.verifyTitle"),lead:qt!==void 0?b(wn,{template:l("sandbox.otpHint"),code:qt}):$(Gn,{children:[bo,b("bdi",{dir:"ltr",className:"sekyro-mono",children:Ue?.shown??e.sentToMasked}),vo]})}),Zt,$("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:`${z}-code`,children:l("otp.codeLabel")}),b(Sn,{id:`${z}-code`,value:L,invalid:ut,onChange:N=>{N!==""&&Ge(),k(N),N.length===6&&L.length!==6&&!P&&!e.attemptsExhausted&&X(N)}}),b("span",{className:`sekyro-help sekyro-otp-expiry${ze?" is-danger":""}`,"aria-hidden":!ze||void 0,children:ze?l("otp.expired"):l("otp.expiresIn",{time:Fo(dt)})})]}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:ze?l("otp.expired"):""}),$(oe,{children:[b(v,{type:"submit",full:!0,disabled:P||L.length!==6||e.attemptsExhausted,"aria-busy":P||void 0,children:l("otp.verify")}),$("div",{className:"sekyro-resend-row",children:[g?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:P||Le>0,onClick:()=>C(void 0,!0),children:Le>0?l("otp.resendIn",{seconds:Le}):l("otp.resend")}):Le>0?b("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:Le})}):J.map(N=>b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:P,onClick:()=>C(N,!0),children:l("otp.resendBy",{channel:Ye(N)})},N)),Wt?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:P,onClick:()=>te(!0),"data-testid":"sekyro-otp-change",children:l("otp.changeNumber")}):null]})]})]})}let Jt=$o(r.locale);return $("form",{className:`sekyro-step sekyro-otp${n?` ${n}`:""}`,"aria-labelledby":z,onSubmit:Kt,noValidate:!0,children:[b(ne,{id:z,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),Zt,e.needsPhone?$("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:me,children:l("otp.phoneLabel")}),$("div",{className:"sekyro-phone",dir:"ltr",children:[p===null||Q&&!T?null:$("div",{className:"sekyro-phone__lead",children:[Gt?$("select",{className:"sekyro-phone__country",dir:r.locale==="ar"?"rtl":"ltr","aria-label":`${l("otp.countryLabel")}: ${T?l("otp.otherCountry"):Jt(p)}`,value:T?Kn:p.code,onChange:g=>{D(!1);let N=c.find(q=>q.code===g.target.value);x(N===void 0),N!==void 0&&m(N.code),I(N===void 0?"":N.dial+(Q?"":Y))},children:[c.map(g=>b("option",{value:g.code,children:Jt(g)},g.code)),F?b("option",{value:Kn,children:l("otp.otherCountry")}):null]}):null,$("span",{className:"sekyro-phone__dial",id:`${me}-dial`,"aria-hidden":Gt||void 0,children:[b("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:T?"🌐":Vo(p.code)}),T?null:p.dial]})]}),b("input",{ref:Ie,id:me,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel","aria-describedby":`${Q?"":`${me}-dial ${me}-hint `}${We?`${me}-error`:""}`.trim()||void 0,"aria-invalid":!!We||void 0,placeholder:pe?"+":void 0,value:Q?S:tt(Y,_),onChange:So,onKeyDown:g=>{g.key==="Enter"&&!f&&D(!0)},onBlur:g=>{g.relatedTarget?.tagName!=="SELECT"&&D(Y!==""&&fe===null)}})]}),Q?null:b("span",{className:"sekyro-help",id:`${me}-hint`,children:l("otp.phonePlaceholderGeneric")}),We?b("span",{className:"sekyro-help is-danger",id:`${me}-error`,role:"alert",children:We}):null]}):b("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),$(oe,{children:[J.length===1?b(v,{type:"submit",full:!0,disabled:P||!f,"aria-busy":P||void 0,children:l("otp.sendBy",{channel:Ye(J[0])})}):J.length>1?$("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[b("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),b("div",{className:"sekyro-channel-row",children:J.map(g=>$(v,{kind:"primary",disabled:P||!f,"aria-busy":P||void 0,onClick:()=>C(g),children:[b(B,{name:g}),Ye(g)]},g))})]}):b(v,{type:"submit",full:!0,disabled:P||!f,"aria-busy":P||void 0,children:l("otp.send")}),ee&&zt?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:P,onClick:()=>te(!1),"data-testid":"sekyro-otp-back-to-code",children:l("otp.backToCode")}):null]})]})}s(Nt,"PhoneOtpStep");import{lazy as Go,Suspense as Wo,useMemo as zo,useState as Yo}from"react";import{Component as Ko}from"react";var wt=class wt extends Ko{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};s(wt,"LoadBoundary");var re=wt;import{jsx as Ce,jsxs as Zo}from"react/jsx-runtime";var qo={load:s(()=>import("../email-otp-view-DUHRTUGD.js"),"load")};function Pt({locale:e,strings:t,...o}){let n=R(e,t),[a,i]=Yo(0),r=zo(()=>Go(()=>qo.load().then(c=>({default:c.EmailOtpView}))),[a]),l=Zo(O,{tone:"danger",children:[Ce("span",{children:n.t("errors.network_error")}),Ce(v,{kind:"secondary",onClick:()=>i(c=>c+1),children:n.t("common.retry")})]});return Ce(re,{fallback:l,children:Ce(Wo,{fallback:Ce("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:n.t("common.loading")}),children:Ce(r,{...o,i18n:n})})},a)}s(Pt,"EmailOtpStep");import{lazy as Jo,Suspense as Qo,useMemo as Xo,useState as jo}from"react";import{jsx as Ne,jsxs as tr}from"react/jsx-runtime";var er={load:s(()=>import("../eid-view-VYUU65A3.js"),"load")};function _t({locale:e,strings:t,...o}){let n=R(e,t),[a,i]=jo(0),r=Xo(()=>Jo(()=>er.load().then(c=>({default:c.EidView}))),[a]),l=tr(O,{tone:"danger",children:[Ne("span",{children:n.t("errors.network_error")}),Ne(v,{kind:"secondary",onClick:()=>i(c=>c+1),children:n.t("common.retry")})]});return Ne(re,{fallback:l,children:Ne(Qo,{fallback:Ne("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:n.t("common.loading")}),children:Ne(r,{...o,i18n:n})})},a)}s(_t,"EidStep");import{useMemo as lr}from"react";import{lazy as nr,Suspense as or,useMemo as rr,useState as sr}from"react";import{jsx as we,jsxs as ar}from"react/jsx-runtime";var ir={load:s(()=>import("../flow-views-VJPCIWEJ.js"),"load")};function V({view:e,i18n:t,quiet:o,...n}){let[a,i]=sr(0),r=rr(()=>nr(()=>ir.load().then(c=>({default:c[e]}))),[e,a]),l=ar(O,{tone:"danger",children:[we("span",{children:t.t("errors.network_error")}),we(v,{kind:"secondary",onClick:()=>i(c=>c+1),children:t.t("common.retry")})]});return we(re,{fallback:l,children:we(or,{fallback:o===!0?null:we("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:we(r,{...n,i18n:t})})},a)}s(V,"Flow");import{jsx as xt,jsxs as cr}from"react/jsx-runtime";function Et({step:e,locale:t,strings:o,className:n,onError:a}){let i=R(t,o),{busy:r,error:l,run:c}=In(i,a),d=lr(()=>e.choice.options.flatMap(m=>{let h=En(m,i),p=xn[m.service];return h===null?[]:[{id:m.id,label:h,glyph:p&&xt(B,{name:p})}]}),[e.choice.options,i]),y=e.choice.options.find(m=>m.service==="national_eid");return cr("div",{className:n,children:[xt(un,{title:i.t("method.heading"),description:i.t("method.description"),options:d,busy:r,error:l,focus:!0,testId:"sekyro-method",onChoose:m=>c(()=>e.choose(m))}),y?.nationalEid?.afterPass==="continue"?xt(V,{view:"EidContinueHint",i18n:i,provider:y.nationalEid.providerName,quiet:!0}):null]})}s(Et,"MethodChoice");import{isValidNni as ur,normalizeNni as Wn}from"@sekyro/web";import{useId as dr,useState as It}from"react";import{Fragment as yr,jsx as H,jsxs as Pe}from"react/jsx-runtime";var pr=new Set(["nni_not_found","registry_record_not_found"]),fr=new Set(["nni_invalid","id_number_invalid"]);function nt({step:e,locale:t,strings:o,className:n,onError:a}){let i=R(t,o),{t:r}=i,[l,c]=It(""),[d,y]=It(!1),[m,h]=It(null),p=dr(),w=e.attemptsExhausted,S=s(async A=>{y(!0),h(null);try{await A()}catch(W){h(ke(W,i.strings)),a?.(W)}finally{y(!1)}},"run"),I=s(A=>{if(A.preventDefault(),e.source!=="typed"){S(()=>e.confirm());return}let W=Wn(l);if(!/^\d{10}$/.test(W))return h("population.invalid");if(!ur(W))return h("population.reason_id_number_invalid");S(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(W):e.submitNni(W))},"onSubmit"),T=Xe(i,e.attemptsRemaining,w),x=e.reason!==void 0&&pr.has(e.reason),M=e.reason!==void 0&&fr.has(e.reason),D=Pe(yr,{children:[e.reason==="registry_unavailable"?Pe(O,{tone:"warning",children:[H("span",{children:r("population.reason_registry_unavailable")}),H("span",{children:T})]}):null,x&&e.canUseDocument?Pe(O,{tone:"warning",children:[H("span",{children:r("population.reason_registry_record_not_found_or_document")}),H("span",{children:T}),H(v,{kind:"secondary",disabled:d,onClick:()=>{S(()=>e.useDocument())},children:r("population.useDocument")})]}):null,x&&!e.canUseDocument||M?Pe(O,{tone:"danger",children:[H("span",{children:r(x?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),H("span",{children:T})]}):null,w&&e.reason===void 0?H(O,{tone:"danger",children:H("span",{children:T})}):null,m!==null?H(O,{tone:"danger",children:H("span",{children:r(m)})}):null]}),[L,k,P]=e.source==="document"?["population.fromDocument.title","population.fromDocument.description","population.fromDocument.continue"]:e.source==="bound"?["session.steps.population.title","population.bound.description","population.bound.confirm"]:e.recheck?["population.recheck.title","population.recheck.description","population.submit"]:["session.steps.population.title","session.steps.population.description","population.submit"];return Pe("form",{className:`sekyro-step${n?` ${n}`:""}`,"aria-labelledby":p,onSubmit:I,noValidate:!0,children:[H(ne,{id:p,title:r(L),lead:r(k)}),D,e.source==="typed"?Pe("div",{className:"sekyro-field",children:[H("label",{className:"sekyro-label",htmlFor:`${p}-id-number`,children:r("population.label")}),H("input",{id:`${p}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:r("population.placeholder"),value:l,"aria-describedby":`${p}-id-number-help`,"aria-invalid":m==="population.invalid"||m==="population.reason_id_number_invalid"||void 0,onChange:A=>{h(null),c(Wn(A.target.value).replace(/\D/g,"").slice(0,10))}}),H("span",{id:`${p}-id-number-help`,className:"sekyro-help",children:r("population.helper")})]}):null,H(oe,{children:w?null:H(v,{type:"submit",full:!0,disabled:d,"aria-busy":d||void 0,children:r(P)})})]})}s(nt,"IdNumberEntry");function mr(e){return nt(e)}s(mr,"NniEntry");import{acceptedIssuers as vr,acceptedTypesFor as Jn,warmDocumentCapture as Cr}from"@sekyro/web";import{lazy as Nr,Suspense as wr,useEffect as Pr,useMemo as _r,useState as Lt}from"react";import{acceptedIssuers as gr,acceptedTypesFor as Tt}from"@sekyro/web";import{useEffect as zn,useId as hr,useMemo as Yn,useState as Rt}from"react";import{jsx as U,jsxs as _e}from"react/jsx-runtime";var qn=s(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),kr=s(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),Sr=220;function br(e,t,o=[],n){let a=null;try{a=new Intl.DisplayNames([e],{type:"region"})}catch{}let i=t.map(c=>({code:c,name:a?.of(c)??c})),r=new Intl.Collator(e),l=s(c=>{if(c===n)return-1;let d=o.indexOf(c);return d<0?o.length:d},"rank");return i.sort((c,d)=>l(c.code)-l(d.code)||r.compare(c.name,d.name))}s(br,"countryNames");function Zn({step:e,i18n:t,issuer:o,onPicked:n,ageStepUp:a=!1}){let{t:i,locale:r}=t,l=Yn(()=>gr(e.documents),[e.documents]),c=Yn(()=>br(r,l,Object.keys(e.documents.byIssuer??{}),e.detectedCountry),[r,l,e.documents,e.detectedCountry]),d=l.length===1?l[0]:null,[y,m]=Rt(o??d),[h,p]=Rt(""),[w,S]=Rt(null),I=hr(),T=d===null?[]:Tt(e.documents,d),x=d!==null&&T.length===1?T[0]:null;zn(()=>{d!==null&&x!==null&&e.selectDocument(d,x)},[d,x]);let M=s((k,P)=>{e.selectDocument(k,P),n?.()},"pick"),D=s(k=>{let P=Tt(e.documents,k);P.length===1?M(k,P[0]):m(k)},"chooseIssuer");if(zn(()=>{if(w===null||y===null)return;let k=setTimeout(()=>M(y,w),Sr);return()=>clearTimeout(k)},[w]),Ze(y!==null&&l.length>1&&o===void 0?()=>{m(null),S(null)}:null),x!==null)return null;if(y===null){let k=qn(h.trim()),P=k===""?c:c.filter(A=>qn(A.name).includes(k)||A.code.toLowerCase()===k);return _e("section",{className:"sekyro-step",children:[U(ne,{title:i("doc.countryTitle"),lead:i(a?"doc.ageStepUp":"doc.pickDescription")}),_e("div",{className:"sekyro-field",children:[U("label",{className:"sekyro-label",htmlFor:I,children:i("doc.countryLabel")}),U("input",{id:I,type:"search",className:"sekyro-input",placeholder:i("doc.countrySearch"),value:h,onChange:A=>p(A.target.value)})]}),P.length===0?U("p",{className:"sekyro-text-muted",children:i("doc.noCountryMatch")}):U("ul",{className:"sekyro-rows",children:P.map(A=>U("li",{children:_e("button",{type:"button",className:"sekyro-row-btn",onClick:()=>D(A.code),children:[U("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:kr(A.code)}),A.name]})},A.code))}),U(oe,{children:null})]})}let L=Tt(e.documents,y);return _e("section",{className:"sekyro-step",children:[U(ne,{title:i("doc.pickTitle"),lead:i(a&&d!==null?"doc.ageStepUp":"native.doc.holdIt")}),U("div",{className:"sekyro-choices",children:L.map(k=>_e("button",{type:"button",className:"sekyro-card","aria-pressed":w===k,disabled:w!==null&&w!==k,onClick:()=>S(k),children:[U("span",{className:"sekyro-card__tile",children:U(B,{name:k==="passport"?"passport":"card"})}),_e("span",{className:"sekyro-card__body",children:[U("span",{className:"sekyro-card__title",children:i(`doc.type.${k}`)}),U("span",{className:"sekyro-card__sub",children:i(`doc.sub.${k}`)})]}),U("span",{className:"sekyro-radio","aria-hidden":"true"})]},k))}),l.length>1?U("button",{type:"button",className:"sekyro-link",onClick:()=>{m(null),S(null)},children:i("native.doc.changeCountry")}):null,U(oe,{children:null})]})}s(Zn,"DocumentPicker");import{jsx as ye,jsxs as Er}from"react/jsx-runtime";var xr={load:s(()=>import("../document-capture-view-ZNZQMJBX.js"),"load")};function Mt({step:e,locale:t,strings:o,className:n,liveMrz:a}){let i=R(t,o),[r,l]=Lt(0),[c,d]=Lt(null),y=vr(e.documents),m=y.length>1,h=e.issuer!==null&&Jn(e.documents,e.issuer).length>1,p=e.documentType===null||e.issuer===null||c!==null,w=y.length===1&&Jn(e.documents,y[0]).length===1,[S]=Lt(()=>p&&!w),I=e.ageStepUp===!0,T=_r(()=>Nr(()=>xr.load().then(M=>({default:M.DocumentCaptureView}))),[r]);Pr(()=>{Cr()},[]);let x=Er(O,{tone:"danger",children:[ye("span",{children:i.t("errors.network_error")}),ye(v,{kind:"secondary",onClick:()=>l(M=>M+1),children:i.t("doc.retryCamera")})]});return ye("div",{className:n,children:p?ye(Zn,{step:e,i18n:i,ageStepUp:I&&c===null&&S,...c==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>d(null)}):ye(re,{fallback:x,children:ye(wr,{fallback:ye("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:i.t("common.loading")}),children:ye(T,{step:e,i18n:i,ageLead:I&&!S,liveMrz:a,...m?{onChangeCountry:s(()=>d("country"),"onChangeCountry")}:{},...h?{onChangeDocument:s(()=>d("document"),"onChangeDocument")}:{}})})},r)})}s(Mt,"DocumentCapture");import{warmPortraitCapture as Ir}from"@sekyro/web";import{Component as Tr,lazy as Qn,Suspense as Xn,useContext as Rr,useEffect as Lr,useMemo as jn,useState as eo}from"react";import{jsx as E,jsxs as rt}from"react/jsx-runtime";var Mr={load:s(()=>import("../portrait-capture-view-XUWOHJTS.js"),"load")},Or={load:s(()=>import("../portrait-review-view-SJXQZTAK.js"),"load")},At=class At extends Tr{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};s(At,"LoadBoundary");var ot=At;function Ar({step:e,i18n:t}){let{t:o}=t,n=ve();return rt("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[E("h2",{ref:n,tabIndex:-1,className:"sekyro-text-body",children:o(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?E("p",{className:"sekyro-text-muted",children:o("portrait.reviewDescription")}):null,e.uploadFailed?rt(O,{tone:"danger",children:[E("span",{children:o("portrait.uploadFailed")}),E(v,{kind:"secondary",onClick:()=>{e.resubmit()},children:o("portrait.sendAgain")})]}):E("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:o("portrait.matching")})]})}s(Ar,"MatchPhase");function Ot({step:e,locale:t,strings:o,className:n,assetBaseUrl:a,verification:i}){let r=R(t,o),l=fn(i),c=Rr(Qe),[d,y]=eo(0),[m,h]=eo(null),p=jn(()=>Qn(()=>Mr.load().then(k=>({default:k.PortraitCaptureView}))),[d]),w=jn(()=>Qn(()=>Or.load().then(k=>({default:k.PortraitScreens}))),[d]),S=typeof e.uploadPortrait=="function",I=S?e.photo?.source??"camera":"camera",T=S&&I!=="camera"&&e.photo?.uploadOffered===!0,x=I!=="upload",M=I==="upload"?"upload":I==="choice"?m??e.photo?.pick??"source":"camera";if(Lr(()=>{e.phase==="capture"&&M==="camera"&&Ir()},[e.phase,M]),e.phase==="match")return E("div",{className:n,children:E(Ar,{step:e,i18n:r})});let D=E("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")});if(c!==null&&(c.busy||c.failed!==null)&&e.phase==="capture"&&M==="camera")return rt("section",{className:`sekyro-step${n?` ${n}`:""}`,children:[E(ne,{title:r.t("session.steps.portrait.title")}),E(oe,{children:E(v,{kind:"secondary",full:!0,disabled:c.busy,onClick:c.reset,children:r.t("portrait.retryCamera")})})]});if(e.phase==="review"||M!=="camera")return E("div",{className:n,children:E(ot,{fallback:E(v,{kind:"ghost",onClick:()=>y(k=>k+1),children:r.t("common.retry")}),children:E(Xn,{fallback:D,children:E(w,{screen:e.phase==="review"||M==="camera"?"review":M,step:e,i18n:r,...x?{onCamera:s(()=>h("camera"),"onCamera")}:{},onUpload:()=>h("upload"),onDeclined:()=>h(null)})})},d)});if(!l.settled)return E("div",{className:n,children:D});if((e.captureMode??l.session)==="choice"&&l.choice===null)return E("div",{className:n,children:E(rn,{value:k=>r.t(k),children:E(dn,{onChoose:l.choose,legend:r.t("capture.modePicker.legendPhoto"),help:r.t("capture.modePicker.helpPhoto")})})});let L=rt(O,{tone:"danger",children:[E("span",{children:r.t("errors.network_error")}),E(v,{kind:"secondary",onClick:()=>y(k=>k+1),children:r.t("portrait.retryCamera")})]});return E("div",{className:n,children:E(ot,{fallback:L,children:E(Xn,{fallback:D,children:E(p,{step:e,i18n:r,...a!==void 0?{assetBaseUrl:a}:{},...T?{onUpload:s(()=>h("upload"),"onUpload")}:{}})})},d)})}s(Ot,"PortraitCapture");import{cameraUnavailableCauseOf as es}from"@sekyro/web";import{useCallback as se,useContext as ts,useEffect as lt,useId as ns,useMemo as mo,useRef as ge,useState as ie}from"react";var Dt={light:{lineBrand:"#0d3b66",successSoft:"#d5f0e8",successFg:"#005341",onSuccess:"#ffffff",warningSoft:"#fff7e6",warningFg:"#735003",onWarning:"#191a1b",dangerSoft:"#ffdada",dangerFg:"#ca0f07",onDanger:"#ffffff",info:"#0563d4",infoSoft:"#d3e5ff",infoFg:"#064da5",onInfo:"#ffffff"},dark:{lineBrand:"#3f80bf",successSoft:"#002c23",successFg:"#53ffd4",onSuccess:"#030303",warningSoft:"#463102",warningFg:"#ffd98a",onWarning:"#030303",dangerSoft:"#9c1008",dangerFg:"#ffbbbb",onDanger:"#030303",info:"#5da9ff",infoSoft:"#063778",infoFg:"#acd0ff",onInfo:"#030303"},sizes:{buttonHeight:"52px",controlRadius:"10px",cardRadius:"16px",fieldRadius:"10px",iconTile:"56px",iconTileRadius:"16px",headerTile:"40px",choiceTile:"40px",tileRadius:"10px",resultDisc:"64px",resultRing:"8px",progressHeight:"4px",focusRing:"2px",focusRingOffset:"2px",otpBox:"60px",choiceMinHeight:"76px",stepGap:"32px",headingGap:"12px"},motion:{page:"320ms",easeOut:"cubic-bezier(0.16, 1, 0.3, 1)"}};var Fe={light:{danger:{base:"#ca0f07",soft:"#ffdada",fg:"#ca0f07",on:"#ffffff"},success:{base:"#007a5e",soft:"#d5f0e8",fg:"#005341",on:"#ffffff"},warning:{base:"#ffab00",soft:"#fff7e6",fg:"#735003",on:"#191a1b"},info:{base:"#0563d4",soft:"#d3e5ff",fg:"#064da5",on:"#ffffff"}},dark:{danger:{base:"#ff7c7c",soft:"#9c1008",fg:"#ffbbbb",on:"#030303"},success:{base:"#00c897",soft:"#002c23",fg:"#53ffd4",on:"#030303"},warning:{base:"#ffbb2e",soft:"#463102",fg:"#ffd98a",on:"#030303"},info:{base:"#5da9ff",soft:"#063778",fg:"#acd0ff",on:"#030303"}}},Dr=["danger","success","warning","info"];function Ft(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}s(Ft,"channel");function to(e){let t=Ft(parseInt(e.slice(1,3),16)),o=Ft(parseInt(e.slice(3,5),16)),n=Ft(parseInt(e.slice(5,7),16));return .2126*t+.7152*o+.0722*n}s(to,"luminance");function Fr(e,t){let o=to(e),n=to(t),a=Math.max(o,n),i=Math.min(o,n);return(a+.05)/(i+.05)}s(Fr,"contrastRatio");function no(e,t){return Math.min(...Dr.map(o=>Fr(Fe[e][o].fg,t)))}s(no,"worstAgainst");function oo(e,t,o){return Math.min(no(e,t),no(e,o))}s(oo,"worstStatusContrast");function ro(e,t){return oo("light",e,t)>=oo("dark",e,t)?"light":"dark"}s(ro,"statusSchemeFor");import{useRef as Hr,useState as Ur}from"react";import{useEffect as Br,useId as Vr,useRef as Bt}from"react";import{jsx as xe,jsxs as so}from"react/jsx-runtime";function st({open:e,title:t,closeLabel:o,onClose:n,children:a,actions:i,role:r,testId:l,returnFocus:c}){let d=Bt(null),y=Bt(null),m=Bt(!1),h=Vr();return Br(()=>{let p=d.current;if(p!==null){if(e&&!p.open?(y.current=typeof document>"u"?null:document.activeElement,typeof p.showModal=="function"?p.showModal():p.setAttribute("open","")):!e&&p.open&&(typeof p.close=="function"?p.close():p.removeAttribute("open")),!e&&m.current){let w=c?.current??(y.current instanceof HTMLElement?y.current:null);y.current=null,w?.focus()}m.current=e}},[e,c]),xe("dialog",{ref:d,className:"sekyro-dialog","aria-labelledby":h,...r==="alertdialog"?{role:r}:{},"data-testid":l,onCancel:p=>{p.preventDefault(),n()},onClick:p=>{p.target===p.currentTarget&&n()},children:so("div",{className:"sekyro-dialog__panel",children:[so("div",{className:"sekyro-dialog__head",children:[xe("h2",{id:h,className:"sekyro-dialog__title",children:t}),o!==void 0?xe("button",{type:"button",className:"sekyro-disc sekyro-dialog__close","aria-label":o,onClick:n,children:xe(B,{name:"close"})}):null]}),a!==void 0?xe("div",{className:"sekyro-dialog__body",children:a}):null,i!==void 0?xe("div",{className:"sekyro-dialog__actions",children:i}):null]})})}s(st,"FlowDialog");import{jsx as Be,jsxs as io}from"react/jsx-runtime";var $r=["intro","data","processing","sharing","retention"];function ao({i18n:e,purpose:t="identity"}){let{t:o}=e,[n,a]=Ur(!1),i=Hr(null),[r,l=""]=o("consent.short").split("{terms}");return io("div",{className:"sekyro-consent","data-testid":"sekyro-consent",children:[io("p",{className:"sekyro-consent__line",children:[r,Be("button",{ref:i,type:"button",className:"sekyro-link sekyro-link--inline","aria-haspopup":"dialog",onClick:()=>a(!0),children:o("consent.termsLink")}),l]}),Be(st,{open:n,title:o("consent.termsTitle"),closeLabel:o("native.close"),onClose:()=>a(!1),returnFocus:i,testId:"sekyro-consent-terms",children:Be("div",{className:"sekyro-stack sekyro-stack--3",children:t==="human"?Be(V,{view:"HumanConsentTerms",i18n:e,quiet:!0}):$r.map(c=>Be("p",{children:o(`consent.terms.${c}`)},c))})})]})}s(ao,"ConsentNotice");function lo(e){let t=e.trim().split(/\s+/).filter(n=>n!=="");return(t.length>=2?[t[0],t[1]].map(n=>Array.from(n??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}s(lo,"initials");import{useSyncExternalStore as Kr}from"react";var po=s(e=>({colors:{...e?K.dark:K.light},radius:K.radius,fontFamily:K.font}),"brandTheme"),Ia=po(!1),co=/^#[0-9a-f]{6}$/i;function Vt(e,t,o){if(t)return null;let n=yt(e).colors,a=o?.colors?.bg??n?.bg,i=o?.colors?.surface??n?.surface;return a===void 0&&i===void 0||a!==void 0&&!co.test(a)||i!==void 0&&!co.test(i)?null:ro(a??K.light.bg,i??K.light.surface)}s(Vt,"partnerStatusScheme");function it(e,t,o){let n=yt(e);if(o&&n.colors!==void 0){let{brand:a,brandFg:i}=n.colors;a!==void 0&&Yr(a,K.dark.bg)>=3?n.colors={brand:a,ring:a,...i!==void 0?{brandFg:i}:{}}:delete n.colors}if(Vt(e,o,t)==="dark"){let a=Fe.dark;n.colors={...n.colors,danger:a.danger.base,success:a.success.base,warning:a.warning.fg}}return qe(po(o),n,yn(t))}s(it,"verificationTheme");function at(e){let t=Kr(zr,Wr,()=>!1);return e==="dark"||e==="system"&&t}s(at,"useDarkScheme");var Gr="(prefers-color-scheme: dark)",fo=s(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Gr):null,"media"),Wr=s(()=>fo()?.matches??!1,"prefersDark");function zr(e){let t=fo();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}s(zr,"subscribe");function Yr(e,t){let[o,n]=[uo(e),uo(t)];return(Math.max(o,n)+.05)/(Math.min(o,n)+.05)}s(Yr,"contrast");function uo(e){let t=[1,3,5].map(o=>{let n=Number.parseInt(e.slice(o,o+2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}s(uo,"luminance");import{useEffect as qr,useId as Zr,useState as Jr}from"react";import{jsx as G,jsxs as Ve}from"react/jsx-runtime";var Qr=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]);function Xr({outcome:e}){return e==="approved"?Ve("svg",{className:"sekyro-outcome sekyro-outcome--approved",viewBox:"0 0 80 80","aria-hidden":"true",focusable:"false",children:[G("circle",{className:"sekyro-outcome__ring",cx:"40",cy:"40",r:"40"}),G("circle",{className:"sekyro-outcome__disc",cx:"40",cy:"40",r:"32"}),G("path",{className:"sekyro-outcome__glyph",d:"M6.5 12.5l3.6 3.6 7.4-8.2",pathLength:"1",transform:"translate(22 22) scale(1.5)"})]}):G("span",{className:`sekyro-tile sekyro-tile--${e==="review"?"info":"neutral"} sekyro-outcome-tile`,"aria-hidden":"true",children:G(B,{name:e==="review"?"pending":e==="expired"?"timer":"close"})})}s(Xr,"OutcomeMark");function jr({label:e,id:t,copied:o}){let[n,a]=Jr(!1);return qr(()=>{if(!n)return;let i=setTimeout(()=>a(!1),1600);return()=>clearTimeout(i)},[n]),Ve("button",{type:"button",className:`sekyro-reference${n?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[G("span",{"aria-live":"polite",children:n?o:e}),G("bdi",{dir:"ltr",children:t}),G(B,{name:"copy"})]})}s(jr,"ReferenceLine");function Ht({step:e,locale:t,strings:o,className:n,onClose:a}){let i=R(t,o),{t:r}=i,l=Zr(),c=ve(),d=e.context.orgName,y=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",m;switch(e.display){case"policy_stop":{let h=e.failureReason??"";if(Qr.has(en(h)))m=r("session.result.detailsMismatch",{org:d});else if(h==="device_velocity_exceeded")m=r("session.result.deviceVelocity",{org:d});else if(h==="capture_tampered")m=r("session.result.deviceStop");else if(h==="camera_unavailable")m=r("reasons.camera_unavailable",{org:d});else if(h==="underage_estimated")m=r("reasons.underage_estimated");else if(h==="starter_credit_claimed")m=r("reasons.starter_credit_claimed");else if(h==="blocked_by_org")m=r("reasons.blocked_by_org");else{let p=nn(h);m=p!==null?r(p,{org:d}):r("session.result.rejected.description")}break}case"cooldown":{let h=on(i.locale,e.retryAfter);m=h!==null?r(h.key,{time:h.time}):r("reasons.device_cooldown");break}case"platform_unsupported":m=r("result.platform_unsupported");break;case"attempts_exhausted":m=r("common.noAttemptsLeft");break;default:m=d!==""?r(`native.result.${y}`,{org:d}):r(`session.result.${y}.description`)}return Ve("section",{className:`sekyro-result${n?` ${n}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[Ve("div",{className:"sekyro-result__body",children:[G(Xr,{outcome:e.display==="cooldown"?"review":y}),Ve("div",{className:"sekyro-heading",children:[G("h2",{id:l,ref:c,tabIndex:-1,className:"sekyro-text-body",children:r(`session.result.${y}.title`)}),G("p",{className:"sekyro-text-muted",children:m})]}),G(jr,{label:r("result.referenceLabel"),id:e.context.sessionId,copied:r("native.result.copied")})]}),a!==void 0?G("div",{className:"sekyro-actions",children:G(v,{full:!0,onClick:a,children:d!==""?r("native.result.back",{org:d}):r("native.close")})}):null]})}s(Ht,"VerificationResultScreen");import{Fragment as He,jsx as u,jsxs as Z}from"react/jsx-runtime";function os(e,t,o){let n=t?K.dark:K.light,a=t?K.roles.dark:K.roles.light,i=e.colors??{},r={},l=i.fg===n.fg&&i.surface===n.surface;i.brand===n.brand&&i.surface===n.surface&&(r["--sekyro-color-brand-soft"]=a.brandSoft),l&&(r["--sekyro-color-line"]=a.line,r["--sekyro-color-line-subtle"]=a.lineSubtle,r["--sekyro-color-line-strong"]=a.lineStrong,r["--sekyro-color-sunken"]=a.sunken),i.fgMuted===n.fgMuted&&i.surface===n.surface&&(r["--sekyro-color-fg-subtle"]=a.fgSubtle),e.fontFamily===K.font&&(r["--sekyro-font-display"]=K.fontDisplay);let c=t?Dt.dark:Dt.light;if(r["--sekyro-color-success-soft"]=c.successSoft,r["--sekyro-color-success-fg"]=c.successFg,r["--sekyro-color-on-success"]=c.onSuccess,r["--sekyro-color-warning-soft"]=c.warningSoft,r["--sekyro-color-warning-fg"]=c.warningFg,r["--sekyro-color-danger-soft"]=c.dangerSoft,r["--sekyro-color-danger-fg"]=c.dangerFg,r["--sekyro-color-on-danger"]=c.onDanger,r["--sekyro-color-info-soft"]=c.infoSoft,r["--sekyro-color-info-fg"]=c.infoFg,i.brand===n.brand&&(r["--sekyro-color-line-brand"]=c.lineBrand),o!==null){let d=Fe[o];for(let y of["danger","success","warning","info"])r[`--sekyro-color-${y}-soft`]=d[y].soft,r[`--sekyro-color-${y}-fg`]=d[y].fg;r["--sekyro-color-on-success"]=d.success.on,r["--sekyro-color-on-danger"]=d.danger.on}return r}s(os,"flowRoles");function $t(e){let{verification:t,locale:o,strings:n,onStep:a,onResult:i}=e,{step:r,error:l}=kt(t);lt(()=>{r!==null&&a?.(r)},[r,a]),lt(()=>i===void 0?void 0:t.on("result",i),[t,i]);let c=at(e.colorScheme??"light"),d=r?.context.branding,y=it(d,e.theme,c),[m,h]=ie(!1),p=`sekyro-verification${c?" sekyro-verification--dark":""}${m?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,w=ge(e.onClose);w.current=e.onClose;let S=ge(r);S.current=r;let I=se(()=>{let L=S.current;w.current?.(L?.kind==="result"?{reason:"finished",result:L.result}:{reason:"cancelled"})},[]),[T,x]=ie(null),M=se(()=>{let L=S.current;L!==null&&L.kind!=="result"&&L.context.consentRecorded?x("close"):I()},[I]),D=mo(()=>t.reportCaptureIssue===void 0?null:L=>t.reportCaptureIssue?.(L),[t]);return u(hn,{theme:y,className:p,children:u(De,{locale:o,...n!==void 0?{strings:n}:{},children:u("div",{dir:e.dir??(o==="ar"?"rtl":"ltr"),lang:o,className:"sekyro-flow",style:os(y,c,Vt(d,c,e.theme)),children:u(Cn.Provider,{value:h,children:u(gt.Provider,{value:e.onClose!==void 0?I:void 0,children:u(Je.Provider,{value:e.onClose!==void 0?M:void 0,children:u(an.Provider,{value:D,children:Z(cn.Provider,{value:rs,children:[u(us,{...e,step:r,error:l,immersive:m,onLeaveAsk:()=>x("history"),onClosed:I}),u(as,{open:T!==null,onStay:()=>{T==="history"&&Ut(),x(null)},onLeave:()=>{let L=T;x(null),L==="close"||e.onClose!==void 0?I():typeof window<"u"&&ho()}})]})})})})})})})})}s($t,"SekyroVerification");var rs={self:u(B,{name:"face"}),assisted:u(B,{name:"camera"})};function ss(e,t){if(t===void 0||t==="aml_screening")return null;let o=e,n=o[`session.processing.${t}.title`],a=o[`session.processing.${t}.description`];return typeof n=="string"&&n!==""&&typeof a=="string"&&a!==""?{title:n,description:a}:null}s(ss,"processingCopyOf");function is({error:e,retry:t}){let{t:o}=R(),n=ve();return Z(mt,{tone:"danger",testId:"sekyro-error-notice",children:[u("span",{children:o(tn(e.kind))}),e.retryable?u(v,{ref:n,kind:"secondary",className:"sekyro-btn--start",onClick:t,children:o("common.retry")}):null]})}s(is,"CameraErrorNotice");var yo="sekyroFlow";function go(){let e=window.history.state;return typeof e=="object"&&e!==null&&e[yo]===!0}s(go,"onGuard");function Ut(){if(typeof window>"u"||go())return;let e=window.history.state;window.history.pushState({...typeof e=="object"&&e!==null?e:{},[yo]:!0},"")}s(Ut,"pushGuard");function ho(){window.history.back()}s(ho,"leaveHistory");function as({open:e,onStay:t,onLeave:o}){let{t:n}=R();return u(st,{open:e,role:"alertdialog",title:n("leave.title"),onClose:t,testId:"sekyro-leave",actions:Z(He,{children:[u(v,{full:!0,onClick:t,children:n("leave.stay")}),u(v,{full:!0,kind:"danger",onClick:o,children:n("leave.confirm")})]}),children:u("p",{className:"sekyro-text-muted",children:n("leave.body")})})}s(as,"LeaveDialog");function ls(e,t){let[o,n]=ie(!1),[a,i]=ie(null),r=e===null?void 0:e.skipCapture,l=ge(r);l.current=r;let c=ge(!1),d=e?.key;lt(()=>i(null),[d]);let y=se(()=>{if(c.current)return;let w=l.current;w!==void 0&&(c.current=!0,n(!0),i(null),w().catch(S=>i(t.t(ke(S,t.strings)))).finally(()=>{c.current=!1,n(!1)}))},[t]),m=se(()=>i(null),[]),h=r!==void 0,p=t.t("sandbox.skipCapture");return mo(()=>h?{label:p,busy:o,failed:a,run:y,reset:m}:null,[h,p,o,a,y,m])}s(ls,"useSkipCapture");function cs({skip:e}){return Z(He,{children:[e.failed!==null?u(O,{tone:"danger",children:u("span",{children:e.failed})}):null,u(v,{kind:"ghost",full:!0,disabled:e.busy,"aria-busy":e.busy||void 0,onClick:e.run,"data-testid":"sekyro-skip-capture",children:e.label})]})}s(cs,"SkipAction");function us(e){let{step:t,error:o,slots:n,immersive:a}=e,i=R(),{t:r}=i,[l,c]=ie(!1),[d,y]=ie([]),m=se(f=>(y(C=>[...C,f]),()=>y(C=>C.filter(X=>X!==f))),[]),[h,p]=ie(null),w=se(f=>p(()=>f),[]),[S,I]=ie(0),[T,x]=ie(null),M=ls(t,i),D=t?.context.purpose??"identity",L=t?.context.returning===!0,k=e.verification,P=D==="human"||t?.context.cameraUnavailableHandled===!0,A=k.reportCameraUnavailable!==void 0&&P?f=>k.reportCameraUnavailable?.(f)??Promise.resolve():void 0,W=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,ae=e.handoffUrl,ee=t?.context.branding?.logoUrl,te=se((f,C)=>A===void 0?void 0:u(V,{view:"NoCameraView",i18n:i,quiet:!0,cause:C,onRetry:f,...W?{onContinue:A}:{},...ae!==void 0?{handoffUrl:ae}:{},...ee!==void 0?{logoUrl:ee}:{}}),[i,k,P,W,ae,ee]),Ue=se((f,C)=>u(Tn,{start:f,context:C,human:D==="human",returning:L,extra:C.canChooseFacing&&u(pn,{value:C.facing,onChange:C.setFacing}),notice:C.permissionSettled&&C.permission==="denied"?te(f,"denied"):void 0}),[D,L,te]),ct=se((f,C)=>{let X=es(f.kind);return(X!==void 0?te(C,X):void 0)??Z(He,{children:[u(is,{error:f,retry:C}),X!==void 0&&ae!==void 0?u(V,{view:"DesktopHandoffView",i18n:i,quiet:!0,url:ae,...ee!==void 0?{logoUrl:ee}:{}}):null]})},[te,ae,ee,i]),ue=ge(""),de=e.livenessProps?.slots?.stageOverlay,$e=se(f=>(f.guidance!==""&&!f.coached&&(ue.current=f.guidance),u(Rn,{testId:"sekyro-capture-stage",video:u("video",{ref:f.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:f.settled?r("capture.checkingTitle"):f.guidance!==""?f.guidance:ue.current,note:f.note,busy:f.settled,progress:f.phase==="seeking"||f.phase==="aligning"?f.progress:1,still:f.still,live:f.live,closeLabel:r("native.close"),overlay:de?.(f.videoRef),ramp:f.ramp?.colour??null,...f.settled?{}:{onClose:s(()=>I(C=>C+1),"onClose")},end:f.switchCamera&&u("button",{type:"button",className:"sekyro-glass",onClick:f.switchCamera,"aria-label":r("capture.switchCamera"),children:u(sn,{})}),children:f.settled||!f.live?null:u(Nn,{onStop:()=>I(C=>C+1)})})),[r,de]),Ke=ns(),ut=t,Ge=t!==null&&T===t.key&&t.context.switchable!==void 0,z=h??(t===null||t.kind==="result"?null:Ge?()=>x(null):t.context.switchable!==void 0&&typeof ut?.chooseOption=="function"?()=>x(t.key):null),Ie=ge(z);Ie.current=z;let Te=ge(t);Te.current=t;let he=ge({ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0});he.current={ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0};let J=e.backNavigation==="history";if(lt(()=>{if(!J||typeof window>"u")return;Ut();let f=s(()=>{if(go())return;let C=Te.current,X=Ie.current;X!==null?(X(),Ut()):C?.kind!=="result"&&C?.context.consentRecorded===!0?he.current.ask():he.current.hostClose?he.current.closed():ho()},"onPop");return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[J]),o!==null)return u(mt,{tone:"danger",children:u("span",{children:r(ke(o,i.strings))})});if(t===null)return Z("div",{className:"sekyro-skeleton",role:"status","aria-busy":"true",children:[u("span",{className:"sekyro-visually-hidden",children:r("common.loading")}),u("span",{className:"sekyro-skeleton__bar is-title"}),u("span",{className:"sekyro-skeleton__bar"}),u("span",{className:"sekyro-skeleton__bar is-short"}),u("span",{className:"sekyro-skeleton__bar is-block"})]});let{context:F}=t,pe=s(f=>{c(!0),f().finally(()=>c(!1))},"refresh"),Q=n?.header??u(fs,{context:F,headerId:Ke,end:n?.headerEnd,...z!==null?{onBack:z}:{}}),_,Se=Ge;if(Se)_=u(V,{view:"LaneChoiceView",i18n:i,step:t,onClose:()=>x(null)});else switch(t.kind){case"phone_otp":_=u(Nt,{step:t});break;case"email_otp":_=u(Pt,{step:t});break;case"method":_=u(Et,{step:t});break;case"registry":_=u(nt,{step:t});break;case"document":_=u(Mt,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let f=e.livenessProps?.slots?.intro,C={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:f??Ue,...f===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:ct}:{}},...S>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:i.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};_=u(ln.Provider,{value:$e,children:t.instructions==="icao"||t.livePhoto?.icao===!0?u(V,{view:"LivePhotoLiveness",i18n:i,step:t,livenessProps:C,sekyroIntro:f===void 0},S):u(mn,{...C},S)});break}case"portrait":_=Z(He,{children:[t.retakeOnly?u(V,{view:"PortraitRetakeNotice",i18n:i,quiet:!0}):null,u(Ot,{step:t,verification:e.verification,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":_=u(V,{view:"ContactChoiceView",i18n:i,step:t});break;case"choice":_=u(V,{view:"GenericChoiceView",i18n:i,step:t});break;case"identity_summary":_=u(V,{view:"IdentitySummaryView",i18n:i,step:t});break;case"mobile_required":_=e.handoffUrl!==void 0?u(V,{view:"HandoffView",i18n:i,url:e.handoffUrl,refresh:t.refresh,...F.branding?.logoUrl!==void 0?{logoUrl:F.branding.logoUrl}:{}}):u(je,{tone:"brand",icon:"smartphone",title:r("handoff.title"),actions:u(v,{kind:"secondary",full:!0,disabled:l,onClick:()=>pe(t.refresh),children:r("common.refresh")}),children:u("p",{children:r("reasons.mobile_required")})});break;case"processing":{let f=ss(i.strings,t.service);_=u(je,{tone:"brand",icon:"pending",busy:!t.stalled,live:!0,title:f?.title??r("session.processing.title"),actions:t.stalled?u(v,{kind:"secondary",full:!0,disabled:l,onClick:()=>pe(t.refresh),children:r("common.refresh")}):null,children:u("p",{children:f?.description??r("session.processing.description")})});break}case"eid":_=u(_t,{step:t});break;case"unsupported":{let f=t.reason==="platform_unsupported";_=u(je,{tone:"neutral",icon:"smartphone",title:r(f?"needsApp.title":"unsupported.title"),actions:u(ds,{org:F.orgName}),children:u("p",{children:f?F.orgName!==""?r("needsApp.description",{org:F.orgName}):r("needsApp.descriptionNoOrg"):r("unsupported.description",{org:F.orgName})})});break}case"result":_=n?.result?.(t)??u(ps,{step:t});break;default:{let f=t;_=null}}let Y=!a&&!F.consentRecorded&&t.kind!=="result"?u(ao,{i18n:i,purpose:F.purpose}):null,Re=M!==null&&!a&&!Se?u(cs,{skip:M}):null,fe=Re===null?Y:Z(He,{children:[Re,Y]});return u(vn.Provider,{value:w,children:u(Qe.Provider,{value:M,children:Z(bn.Provider,{value:fe===null?null:{node:fe,owner:d[0]??null,claim:m},children:[a?null:Q,!a&&t.kind!=="result"&&F.sections.length>1?u(ms,{context:F,current:t.section,i18n:i}):null,u(Pn,{pageKey:t.key,children:_}),!a&&!Se&&t.kind!=="result"&&t.context.switchable!==void 0?u(V,{view:"LaneSwitch",i18n:i,step:t,onOpen:()=>x(t.key),quiet:!0},t.key):null,d.length===0?fe:null,a?null:n?.footer!==void 0?n.footer:F.branding?.hideAttribution===!0?null:Z("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[u(B,{name:"lock"}),r("shell.verifiedBy")]})]})})})}s(us,"Body");function ds({org:e}){let{t}=R(),o=ts(gt);return o===void 0?null:u(v,{full:!0,onClick:o,children:e!==""?t("native.result.back",{org:e}):t("native.close")})}s(ds,"BackToOrg");function ps({step:e}){return u(Je.Consumer,{children:t=>u(Ht,{step:e,...t!==void 0?{onClose:t}:{}})})}s(ps,"ResultPage");function fs({context:e,headerId:t,end:o,onBack:n}){let{t:a}=R(),[i,r]=ie(!1),l=i?void 0:e.branding?.logoUrl,c=e.orgName!==""?e.orgName:a(e.returning?"returning.heading":"session.title");return u("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:Z("div",{className:"sekyro-org",children:[n!==void 0?u("button",{type:"button",className:"sekyro-disc sekyro-org__back","aria-label":a("common.back"),onClick:n,"data-testid":"sekyro-back",children:u(B,{name:"back"})}):null,u("span",{className:"sekyro-org__tile","aria-hidden":"true",children:l!==void 0?u("img",{className:"sekyro-org__logo",src:l,alt:"",onError:()=>r(!0)}):lo(e.orgName)}),Z("div",{className:"sekyro-org__text",children:[u("h1",{id:t,className:"sekyro-org__name",children:c}),u("p",{className:"sekyro-org__sub",children:a(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),o!=null?u("div",{className:"sekyro-org__end",children:o}):null,u(Je.Consumer,{children:d=>d!==void 0?u("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":a("native.close"),onClick:d,children:u(B,{name:"close"})}):null})]})})}s(fs,"OrgHeader");function ms({context:e,current:t,i18n:o}){let n=t===null?-1:e.sections.indexOf(t),a=e.progress,i=a!==void 0&&a.length===e.sections.length?a:e.sections.map((r,l)=>({id:r,state:l<n?"done":l===n?"current":"upcoming"}));return u("ol",{className:"sekyro-progress__bars","aria-label":o.t("session.progressLabel"),children:i.map(({id:r,state:l})=>u("li",{className:`sekyro-progress__bar${l==="done"?" is-done":l==="current"?" is-current":""}`,...l==="current"?{"aria-current":"step"}:{},children:u("span",{className:"sekyro-visually-hidden",children:o.strings[`section.${r}`]??r})},r))})}s(ms,"SectionProgress");import{useEffect as ys,useState as ko}from"react";import{jsx as Ee}from"react/jsx-runtime";function gs(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}s(gs,"pageUrl");function hs({hostedUrl:e,inAppBrowser:t,...o}){let[n,a]=ko(t===!0);ys(()=>{t===void 0&&ht()&&a(!0)},[t]);let[i,r]=ko(!1),l=at(o.colorScheme??"light"),c=o.handoffUrl??e??gs();return n&&!i?Ee(gn,{theme:qe(it(void 0,void 0,l),o.theme),className:`sekyro-verification${l?" sekyro-verification--dark":""}${o.className!==void 0?` ${o.className}`:""}`,children:Ee(De,{locale:o.locale,...o.strings!==void 0?{strings:o.strings}:{},children:Ee("div",{dir:o.dir??(o.locale==="ar"?"rtl":"ltr"),lang:o.locale,className:"sekyro-flow",children:Ee(ks,{url:c,onContinue:()=>r(!0)})})})}):Ee($t,{...o,...c!==""?{handoffUrl:c}:{}})}s(hs,"SekyroFlow");function ks({url:e,onContinue:t}){let o=R();return Ee(V,{view:"InAppBrowserPrompt",i18n:o,url:e,onContinue:t})}s(ks,"Prompt");export{Mt as DocumentCapture,_t as EidStep,Pt as EmailOtpStep,nt as IdNumberEntry,Et as MethodChoice,mr as NniEntry,Nt as PhoneOtpStep,Ot as PortraitCapture,hs as SekyroFlow,$t as SekyroVerification,De as StepI18nProvider,Ht as VerificationResultScreen,Po as arSteps,_o as enSteps,Eo as formatTemplate,xo as frSteps,ht as isInAppBrowser,No as loadSekyroLocale,Io as resolveSekyroStrings,wo as retakeHintStringKey,R as useStepI18n,kt as useVerificationStep};