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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/LICENSE +25 -16
  3. package/README.md +36 -4
  4. package/dist/chunk-3MBJZSJL.js +2 -0
  5. package/dist/chunk-4INDRENU.js +2 -0
  6. package/dist/chunk-4RUZQW5T.js +2 -0
  7. package/dist/chunk-63NUMQST.js +2 -0
  8. package/dist/chunk-65JA6YKG.js +2 -0
  9. package/dist/chunk-ADMDZLPM.js +2 -0
  10. package/dist/chunk-AMOZXMUP.js +2 -0
  11. package/dist/chunk-BENNJ4GV.js +2 -0
  12. package/dist/chunk-BJJZ4MO5.js +2 -0
  13. package/dist/chunk-BRA6F56P.js +2 -0
  14. package/dist/chunk-JAUZKPQO.js +2 -0
  15. package/dist/chunk-P2LX7BBE.js +2 -0
  16. package/dist/chunk-Q232JYNO.js +2 -0
  17. package/dist/chunk-YUNPD6ZB.js +2 -0
  18. package/dist/document-capture-view-SKFDM4AQ.js +2 -0
  19. package/dist/eid-view-WIK6KUTY.js +2 -0
  20. package/dist/email-otp-view-TYSBCGUY.js +2 -0
  21. package/dist/flow-views-PCBR5GYS.js +2 -0
  22. package/dist/fonts/Cairo-OFL.txt +93 -0
  23. package/dist/fonts/Geist-OFL.txt +93 -0
  24. package/dist/fonts/Inter-OFL.txt +93 -0
  25. package/dist/fonts/SekyroCairo-Bold.woff2 +0 -0
  26. package/dist/fonts/SekyroCairo-Regular.woff2 +0 -0
  27. package/dist/fonts/SekyroCairo-SemiBold.woff2 +0 -0
  28. package/dist/fonts/SekyroGeist-Bold.woff2 +0 -0
  29. package/dist/fonts/SekyroGeist-SemiBold.woff2 +0 -0
  30. package/dist/fonts/SekyroInter-Medium.woff2 +0 -0
  31. package/dist/fonts/SekyroInter-Regular.woff2 +0 -0
  32. package/dist/fonts/SekyroInter-SemiBold.woff2 +0 -0
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.cts +5 -437
  35. package/dist/index.d.ts +5 -437
  36. package/dist/index.js +1 -1
  37. package/dist/portrait-capture-view-HYOEOAF4.js +2 -0
  38. package/dist/theme-BpOuzcWh.d.cts +456 -0
  39. package/dist/theme-BpOuzcWh.d.ts +456 -0
  40. package/dist/verification/index.cjs +2 -0
  41. package/dist/verification/index.d.cts +524 -0
  42. package/dist/verification/index.d.ts +524 -0
  43. package/dist/verification/index.js +2 -0
  44. package/dist/verification.css +560 -0
  45. package/package.json +20 -6
  46. package/sbom.cdx.json +5 -5
@@ -0,0 +1,524 @@
1
+ import { S as Strings, a as SekyroLocale, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-BpOuzcWh.js';
2
+ import * as react from 'react';
3
+ import { ReactNode } from 'react';
4
+ import { Verification, VerificationStep, PhoneOtpStepHandle, EmailOtpStepHandle, EidStepHandle, MethodStepHandle, RegistryStepHandle, DocumentStepHandle, DocumentLiveMrzOptions, PortraitStepHandle, VerificationResult, ResultStepHandle, CapturedArtifacts } from '@sekyro/web';
5
+
6
+ /** Copy of the `@sekyro/react/verification` steps (hosted catalog paths; the optional keys load with their step). */
7
+ interface StepStrings {
8
+ "session.title": string;
9
+ "session.requestedBy": string;
10
+ "returning.requestedBy": string;
11
+ "consent.notice": string;
12
+ "consent.details": string;
13
+ "consent.terms.intro": string;
14
+ "consent.terms.data": string;
15
+ "consent.terms.processing": string;
16
+ "consent.terms.sharing": string;
17
+ "consent.terms.retention": string;
18
+ "otp.sendTitle": string;
19
+ "otp.sendDescription": string;
20
+ "otp.prefilledNotice": string;
21
+ "otp.phoneLabel": string;
22
+ "otp.phoneHelper": string;
23
+ "otp.phonePlaceholder": string;
24
+ "otp.send": string;
25
+ "otp.channelSms": string;
26
+ "otp.channelWhatsapp": string;
27
+ "otp.verifyTitle": string;
28
+ "otp.verifyDescription": string;
29
+ "otp.sentTo": string;
30
+ "otp.codeLabel": string;
31
+ "otp.codeHelper": string;
32
+ "otp.verify": string;
33
+ "otp.resend": string;
34
+ "otp.resendIn": string;
35
+ "otp.expiresIn": string;
36
+ "otp.expired": string;
37
+ "otp.reason_otp_mismatch": string;
38
+ "otp.reason_otp_expired": string;
39
+ "otp.reason_otp_send_failed": string;
40
+ "otp.chooseChannel": string;
41
+ "otp.sendBy": string;
42
+ "otp.resendBy": string;
43
+ "otp.reason_otp_channel_unavailable": string;
44
+ "otp.reason_otp_destination_not_allowed": string;
45
+ "otp.reason_otp_destination_unknown": string;
46
+ "otp.reason_otp_rate_limited": string;
47
+ "session.steps.population.title": string;
48
+ "session.steps.population.description": string;
49
+ "population.label": string;
50
+ "population.helper": string;
51
+ "population.placeholder": string;
52
+ "population.submit": string;
53
+ "population.invalid": string;
54
+ "population.reason_registry_unavailable": string;
55
+ "population.reason_nni_not_found": string;
56
+ "population.reason_nni_invalid": string;
57
+ "population.bound.description": string;
58
+ "population.bound.confirm": string;
59
+ "population.reason_nni_not_found_or_document": string;
60
+ "population.useDocument": string;
61
+ "population.fromDocument.title": string;
62
+ "population.fromDocument.description": string;
63
+ "population.fromDocument.continue": string;
64
+ "session.steps.doc.titleRecto": string;
65
+ "session.steps.doc.titleVerso": string;
66
+ "session.steps.doc.description": string;
67
+ "doc.pickTitle": string;
68
+ "doc.pickDescription": string;
69
+ "doc.pickLabel": string;
70
+ "doc.startScan": string;
71
+ "doc.titlePassport": string;
72
+ "doc.reason_side_missing": string;
73
+ "doc.reason_unreadable": string;
74
+ "doc.process_failed": string;
75
+ "doc.uploading": string;
76
+ "doc.cameraBlocked": string;
77
+ "doc.cameraBlockedHint": string;
78
+ "doc.retryCamera": string;
79
+ "doc.holdUpright": string;
80
+ "dcv2.sensing": string;
81
+ "dcv2.too_far": string;
82
+ "dcv2.too_close": string;
83
+ "dcv2.edge_clipped": string;
84
+ "dcv2.wrong_shape": string;
85
+ "dcv2.tilted": string;
86
+ "dcv2.too_dark": string;
87
+ "dcv2.too_bright": string;
88
+ "dcv2.blurry": string;
89
+ "dcv2.focus_far": string;
90
+ "dcv2.glare": string;
91
+ "dcv2.hold_still": string;
92
+ "dcv2.processing": string;
93
+ "dcv2.side_captured": string;
94
+ "dcv2.captured": string;
95
+ "session.processing.title": string;
96
+ "session.processing.description": string;
97
+ "handoff.title": string;
98
+ "session.result.approved.title": string;
99
+ "session.result.approved.description": string;
100
+ "session.result.review.title": string;
101
+ "session.result.review.description": string;
102
+ "session.result.rejected.title": string;
103
+ "session.result.rejected.description": string;
104
+ "session.result.expired.title": string;
105
+ "session.result.expired.description": string;
106
+ "session.result.detailsMismatch": string;
107
+ "session.result.deviceVelocity": string;
108
+ "result.referenceLabel": string;
109
+ "common.loading": string;
110
+ "common.refresh": string;
111
+ "common.noAttemptsLeft": string;
112
+ "session.steps.portrait.title": string;
113
+ "session.steps.portrait.description": string;
114
+ "portrait.coach.no_face": string;
115
+ "portrait.coach.multiple_faces": string;
116
+ "portrait.coach.center": string;
117
+ "portrait.coach.too_close": string;
118
+ "portrait.coach.pose": string;
119
+ "portrait.coach.eyes": string;
120
+ "portrait.coach.mouth": string;
121
+ "portrait.coach.glare": string;
122
+ "portrait.coach.lighting": string;
123
+ "portrait.coach.lighting_side": string;
124
+ "portrait.coach.background": string;
125
+ "portrait.coach.resolution": string;
126
+ "portrait.coach.hold_still": string;
127
+ "portrait.coach.hold": string;
128
+ "portrait.criteria.face": string;
129
+ "portrait.criteria.framing": string;
130
+ "portrait.criteria.pose": string;
131
+ "portrait.criteria.eyes": string;
132
+ "portrait.criteria.mouth": string;
133
+ "portrait.criteria.glare": string;
134
+ "portrait.criteria.lighting": string;
135
+ "portrait.criteria.background": string;
136
+ "portrait.criteria.resolution": string;
137
+ "portrait.criteria.sharpness": string;
138
+ "portrait.report.pose": string;
139
+ "portrait.report.eyes": string;
140
+ "portrait.report.mouth": string;
141
+ "portrait.report.occlusion": string;
142
+ "portrait.report.glare": string;
143
+ "portrait.report.lighting": string;
144
+ "portrait.report.background": string;
145
+ "portrait.report.resolution": string;
146
+ "portrait.checksLabel": string;
147
+ "portrait.met": string;
148
+ "portrait.notMet": string;
149
+ "portrait.starting": string;
150
+ "portrait.taken": string;
151
+ "portrait.uploading": string;
152
+ "portrait.checking": string;
153
+ "portrait.retryTitle": string;
154
+ "portrait.reportTitle": string;
155
+ "portrait.retake": string;
156
+ "portrait.uploadFailed": string;
157
+ "portrait.sendAgain": string;
158
+ "portrait.matching": string;
159
+ "portrait.reviewTitle": string;
160
+ "portrait.reviewDescription": string;
161
+ "portrait.cameraBlocked": string;
162
+ "portrait.cameraBlockedHint": string;
163
+ "portrait.retryCamera": string;
164
+ "reasons.icao_pose": string;
165
+ "reasons.icao_eyes": string;
166
+ "reasons.icao_mouth": string;
167
+ "reasons.icao_occlusion": string;
168
+ "reasons.icao_lighting": string;
169
+ "reasons.icao_background": string;
170
+ "reasons.icao_resolution": string;
171
+ "reasons.portrait_not_from_liveness": string;
172
+ "method.national_eid": string;
173
+ "method.national_eidGeneric": string;
174
+ "consent.short": string;
175
+ "consent.termsLink": string;
176
+ "session.progressLabel": string;
177
+ "section.contact": string;
178
+ "section.identity": string;
179
+ "section.live_photo": string;
180
+ "handoff.copied": string;
181
+ "needsApp.title": string;
182
+ "needsApp.description": string;
183
+ "needsApp.descriptionNoOrg": string;
184
+ "population.recheck.title": string;
185
+ "population.recheck.description": string;
186
+ "otp.phoneInvalid": string;
187
+ "otp.codeInvalid": string;
188
+ "doc.countryTitle": string;
189
+ "doc.countryLabel": string;
190
+ "doc.countrySearch": string;
191
+ "doc.noCountryMatch": string;
192
+ "doc.type.carte_identite": string;
193
+ "doc.type.residence_permit": string;
194
+ "doc.type.passport": string;
195
+ "doc.showSide": string;
196
+ "doc.showPage": string;
197
+ "doc.flip": string;
198
+ "doc.sameFace": string;
199
+ "doc.reaskRecto": string;
200
+ "doc.reread": string;
201
+ "doc.photoTaken": string;
202
+ "doc.frontCaptured": string;
203
+ "doc.backCaptured": string;
204
+ "doc.pageCaptured": string;
205
+ "doc.progressFront": string;
206
+ "doc.progressBack": string;
207
+ "doc.progressPage": string;
208
+ "doc.shutter": string;
209
+ "doc.torchOn": string;
210
+ "doc.torchOff": string;
211
+ "result.platform_unsupported": string;
212
+ "unsupported.title": string;
213
+ "unsupported.description": string;
214
+ "shell.subtitle": string;
215
+ "shell.verifiedBy": string;
216
+ "doc.sub.carte_identite": string;
217
+ "doc.sub.residence_permit": string;
218
+ "doc.sub.passport": string;
219
+ "native.close": string;
220
+ "native.face.introTitle": string;
221
+ "native.face.introLead": string;
222
+ "native.doc.holdIt": string;
223
+ "native.doc.changeCountry": string;
224
+ "native.result.approved": string;
225
+ "native.result.review": string;
226
+ "native.result.rejected": string;
227
+ "native.result.expired": string;
228
+ "native.result.copied": string;
229
+ "native.result.back": string;
230
+ "emailOtp.sendTitle"?: string;
231
+ "emailOtp.sendDescription"?: string;
232
+ "emailOtp.prefilledNotice"?: string;
233
+ "emailOtp.emailLabel"?: string;
234
+ "emailOtp.emailHelper"?: string;
235
+ "emailOtp.emailPlaceholder"?: string;
236
+ "emailOtp.emailInvalid"?: string;
237
+ "emailOtp.send"?: string;
238
+ "emailOtp.verifyTitle"?: string;
239
+ "emailOtp.verifyDescription"?: string;
240
+ "emailOtp.sentTo"?: string;
241
+ "emailOtp.codeLabel"?: string;
242
+ "emailOtp.codeHelper"?: string;
243
+ "emailOtp.verify"?: string;
244
+ "emailOtp.resend"?: string;
245
+ "emailOtp.resendIn"?: string;
246
+ "emailOtp.expiresIn"?: string;
247
+ "emailOtp.expired"?: string;
248
+ "emailOtp.reason_otp_mismatch"?: string;
249
+ "emailOtp.reason_otp_expired"?: string;
250
+ "emailOtp.reason_otp_send_failed"?: string;
251
+ "emailOtp.reason_otp_rate_limited"?: string;
252
+ "emailOtp.reason_email_invalid"?: string;
253
+ "emailOtp.reason_email_disposable"?: string;
254
+ "eid.identifierTitle"?: string;
255
+ "eid.identifierTitleGeneric"?: string;
256
+ "eid.identifierDescription"?: string;
257
+ "eid.identifierDescriptionGeneric"?: string;
258
+ "eid.boundDescription"?: string;
259
+ "eid.boundDescriptionGeneric"?: string;
260
+ "eid.start"?: string;
261
+ "eid.codeTitle"?: string;
262
+ "eid.codeTitleGeneric"?: string;
263
+ "eid.codeHelp"?: string;
264
+ "eid.codeHelpGeneric"?: string;
265
+ "eid.codeLabel"?: string;
266
+ "eid.verify"?: string;
267
+ "eid.resend"?: string;
268
+ "eid.resendIn"?: string;
269
+ "eid.noResendsLeft"?: string;
270
+ "eid.expiresIn"?: string;
271
+ "eid.expired"?: string;
272
+ "eid.useCamera"?: string;
273
+ "reasons.eid_identifier_invalid"?: string;
274
+ "reasons.eid_code_invalid"?: string;
275
+ "reasons.eid_code_expired"?: string;
276
+ "reasons.eid_locked"?: string;
277
+ "reasons.eid_not_enrolled"?: string;
278
+ "reasons.eid_unavailable"?: string;
279
+ "reasons.eid_resend_too_soon"?: string;
280
+ "reasons.eid_resend_limit"?: string;
281
+ "eid.continueHint"?: string;
282
+ "eid.continueHintGeneric"?: string;
283
+ "eid.resendsRemaining.zero"?: string;
284
+ "eid.resendsRemaining.one"?: string;
285
+ "eid.resendsRemaining.two"?: string;
286
+ "eid.resendsRemaining.few"?: string;
287
+ "eid.resendsRemaining.many"?: string;
288
+ "eid.resendsRemaining.other"?: string;
289
+ "eid.codeAttemptsRemaining.zero"?: string;
290
+ "eid.codeAttemptsRemaining.one"?: string;
291
+ "eid.codeAttemptsRemaining.two"?: string;
292
+ "eid.codeAttemptsRemaining.few"?: string;
293
+ "eid.codeAttemptsRemaining.many"?: string;
294
+ "eid.codeAttemptsRemaining.other"?: string;
295
+ "dcv3.mrz.searching"?: string;
296
+ "dcv3.mrz.showMrzSide"?: string;
297
+ "dcv3.mrz.reading"?: string;
298
+ "dcv3.mrz.moveCloser"?: string;
299
+ "dcv3.mrz.turnSideways"?: string;
300
+ "dcv3.mrz.glare"?: string;
301
+ "dcv3.mrz.holdStill"?: string;
302
+ "dcv3.mrz.valid"?: string;
303
+ "dcv3.mrz.looksLikePassport"?: string;
304
+ "dcv3.mrz.looksLikeCard"?: string;
305
+ "native.doc.introTitle"?: string;
306
+ "native.doc.introLead"?: string;
307
+ "native.doc.tip.flat"?: string;
308
+ "native.doc.tip.glare"?: string;
309
+ "native.doc.tip.frame"?: string;
310
+ "native.doc.openCamera"?: string;
311
+ "native.doc.changeDocument"?: string;
312
+ "native.scan.closer"?: string;
313
+ "native.scan.farther"?: string;
314
+ "native.scan.glare"?: string;
315
+ "native.scan.dark"?: string;
316
+ "native.scan.blurry"?: string;
317
+ "native.scan.holdStill"?: string;
318
+ "native.scan.reading"?: string;
319
+ "native.scan.putDown"?: string;
320
+ "native.scan.retry"?: string;
321
+ "contact.title"?: string;
322
+ "contact.description"?: string;
323
+ "contact.phone"?: string;
324
+ "contact.email"?: string;
325
+ "contact.switch"?: string;
326
+ "summary.title"?: string;
327
+ "summary.description"?: string;
328
+ "summary.fullName"?: string;
329
+ "summary.birthDate"?: string;
330
+ "summary.nationality"?: string;
331
+ "summary.documentType"?: string;
332
+ "summary.documentNumber"?: string;
333
+ "summary.nni"?: string;
334
+ "summary.expiryDate"?: string;
335
+ "summary.portraitAlt"?: string;
336
+ "summary.source.registry"?: string;
337
+ "summary.source.document"?: string;
338
+ "summary.source.chip"?: string;
339
+ "summary.name"?: string;
340
+ "summary.birthYear"?: string;
341
+ "summary.confirm"?: string;
342
+ "summary.retakeDocument"?: string;
343
+ "summary.retakeNationalNumber"?: string;
344
+ "summary.noRetake"?: string;
345
+ "capture.tipsIcao.title"?: string;
346
+ "capture.tipsIcao.glasses"?: string;
347
+ "capture.tipsIcao.headwear"?: string;
348
+ "capture.tipsIcao.expression"?: string;
349
+ "capture.tipsIcao.faceCamera"?: string;
350
+ "capture.tipsIcao.background"?: string;
351
+ "capture.tipsIcao.lighting"?: string;
352
+ "capture.tipsIcao.hair"?: string;
353
+ "capture.tipsIcao.summary"?: string;
354
+ "portrait.retakeOnly"?: string;
355
+ "portrait.keepCamera"?: string;
356
+ "handoff.description"?: string;
357
+ "handoff.qrAlt"?: string;
358
+ "handoff.copyLink"?: string;
359
+ "handoff.copyFailed"?: string;
360
+ "handoff.waiting"?: string;
361
+ "inApp.title"?: string;
362
+ "inApp.description"?: string;
363
+ "inApp.copyLink"?: string;
364
+ "inApp.copied"?: string;
365
+ "inApp.copyFailed"?: string;
366
+ "inApp.continueAnyway"?: string;
367
+ }
368
+
369
+ declare const arSteps: StepStrings;
370
+
371
+ declare const enSteps: StepStrings;
372
+
373
+ declare const frSteps: StepStrings;
374
+
375
+ type SekyroStrings = Strings & StepStrings;
376
+ type SekyroStringKey = keyof SekyroStrings;
377
+ type StepTranslate = (key: SekyroStringKey, vars?: Record<string, string | number>) => string;
378
+ declare function formatTemplate(template: string, vars?: Record<string, string | number>): string;
379
+ declare function resolveSekyroStrings(locale: SekyroLocale, overrides?: Partial<SekyroStrings>): SekyroStrings;
380
+ interface StepI18n {
381
+ locale: SekyroLocale;
382
+ strings: SekyroStrings;
383
+ t: StepTranslate;
384
+ }
385
+ declare function StepI18nProvider({ locale, strings, children }: {
386
+ locale: SekyroLocale;
387
+ strings?: Partial<SekyroStrings>;
388
+ children: ReactNode;
389
+ }): react.JSX.Element;
390
+ /** Props win over the surrounding provider; default English. */
391
+ declare function useStepI18n(locale?: SekyroLocale, strings?: Partial<SekyroStrings>): StepI18n;
392
+
393
+ /** Runs the verification's plan runner and returns the current step. */
394
+ declare function useVerificationStep(verification: Verification | undefined): {
395
+ step: VerificationStep | null;
396
+ error: unknown;
397
+ };
398
+
399
+ /** Props shared by every step component. */
400
+ interface StepComponentProps {
401
+ /** Default: the surrounding <SekyroVerification>'s locale, else `en`. */
402
+ locale?: SekyroLocale;
403
+ strings?: Partial<SekyroStrings>;
404
+ className?: string;
405
+ /** Every failed action (local validation and API errors) — for host telemetry. */
406
+ onError?: (error: unknown) => void;
407
+ }
408
+
409
+ interface PhoneOtpStepProps extends StepComponentProps {
410
+ step: PhoneOtpStepHandle;
411
+ /** Initial value of the number field (default `+222`). */
412
+ defaultPhone?: string;
413
+ }
414
+ declare function PhoneOtpStep({ step, locale, strings, className, defaultPhone, onError }: PhoneOtpStepProps): react.JSX.Element;
415
+
416
+ interface EmailOtpStepProps extends StepComponentProps {
417
+ step: EmailOtpStepHandle;
418
+ /** Initial value of the address field (default empty). */
419
+ defaultEmail?: string;
420
+ }
421
+ declare function EmailOtpStep({ locale, strings, ...props }: EmailOtpStepProps): react.JSX.Element;
422
+
423
+ interface EidStepProps extends StepComponentProps {
424
+ step: EidStepHandle;
425
+ }
426
+ declare function EidStep({ locale, strings, ...props }: EidStepProps): react.JSX.Element;
427
+
428
+ declare function MethodChoice({ step, locale, strings, className, onError }: StepComponentProps & {
429
+ step: MethodStepHandle;
430
+ }): react.JSX.Element;
431
+
432
+ declare function NniEntry({ step, locale, strings, className, onError }: StepComponentProps & {
433
+ step: RegistryStepHandle;
434
+ }): react.JSX.Element;
435
+
436
+ declare function DocumentCapture({ step, locale, strings, className, liveMrz, }: StepComponentProps & {
437
+ step: DocumentStepHandle;
438
+ /** Web live MRZ (on-device MRZ read on MRZ faces; obeys the session's server tuning). */
439
+ liveMrz?: DocumentLiveMrzOptions;
440
+ }): react.JSX.Element;
441
+
442
+ declare function PortraitCapture({ step, locale, strings, className, assetBaseUrl, }: StepComponentProps & {
443
+ step: PortraitStepHandle;
444
+ /** Self-hosted MediaPipe assets (wasm fileset + `face_landmarker.task`); default `/models-v3`. */
445
+ assetBaseUrl?: string;
446
+ }): react.JSX.Element;
447
+
448
+ /** `system` follows the device (prefers-color-scheme). */
449
+ type SekyroColorScheme = "light" | "dark" | "system";
450
+
451
+ /** What {@link SekyroVerificationProps.onClose} reports. */
452
+ interface SekyroCloseEvent {
453
+ /**
454
+ * `finished`: the person is done (the result's "Back to <partner>" button, or the close button on the result page);
455
+ * `cancelled`: they closed the flow before its result.
456
+ */
457
+ reason: "finished" | "cancelled";
458
+ /** The verdict shown on the result page (`finished` only). Display only: read the real outcome on your server. */
459
+ result?: VerificationResult;
460
+ }
461
+ interface SekyroVerificationProps {
462
+ verification: Verification;
463
+ locale: SekyroLocale;
464
+ dir?: "ltr" | "rtl";
465
+ strings?: Partial<SekyroStrings>;
466
+ /** Runtime theme — wins over the session's branding (SDK spec §6.4). */
467
+ theme?: SekyroTheme;
468
+ /** Light (default: the component sits in your page), dark, or the device's setting. */
469
+ colorScheme?: SekyroColorScheme;
470
+ assetBaseUrl?: string;
471
+ /**
472
+ * Web live MRZ for the document step: `workerUrl` (where your bundler serves `@sekyro/web/core/ocr/worker`),
473
+ * `assetBaseUrl` (self-hosted OCR assets) or `mode: "off"`. The session's server tuning decides when it runs.
474
+ */
475
+ documentLiveMrz?: DocumentLiveMrzOptions;
476
+ voice?: false | VoiceOptions;
477
+ livenessProps?: Omit<LivenessCaptureProps, "verification" | "locale" | "dir" | "strings" | "assetBaseUrl" | "voice" | "onCaptured" | "onResult">;
478
+ /**
479
+ * `header` and `footer` replace the partner header and the "Verified by Sekyro AI" line (`footer: null` hides it);
480
+ * `headerEnd` sits at the inline end of the partner header (a language menu), before the close button.
481
+ */
482
+ slots?: {
483
+ header?: ReactNode;
484
+ headerEnd?: ReactNode;
485
+ footer?: ReactNode;
486
+ result?: (step: ResultStepHandle) => ReactNode;
487
+ };
488
+ onStep?: (step: VerificationStep) => void;
489
+ onResult?: (result: VerificationResult) => void;
490
+ /**
491
+ * The person closes the flow: the header's close button, or the result's "Back to <partner>" button (as on the native
492
+ * SDKs). Take them back to your page. Without it, neither button is shown.
493
+ */
494
+ onClose?: (event: SekyroCloseEvent) => void;
495
+ /** Fires before the liveness upload (SDK spec §7.5 shadow hook). */
496
+ onLivenessCaptured?: (artifacts: CapturedArtifacts) => void;
497
+ /**
498
+ * The link a desktop shows as a QR code when the live photo needs a phone
499
+ * (the session's `hosted_url`); absent = a "continue on your phone" notice.
500
+ * `<SekyroFlow>` defaults it to this page's address.
501
+ */
502
+ handoffUrl?: string;
503
+ className?: string;
504
+ }
505
+ declare function SekyroVerification(props: SekyroVerificationProps): react.JSX.Element;
506
+
507
+ interface SekyroFlowProps extends SekyroVerificationProps {
508
+ /** The session's `hosted_url` (create result): the QR code and the "open in your browser" link. Default: this page's address. */
509
+ hostedUrl?: string;
510
+ /** Override the in-app browser detection (tests / hosts that know better). */
511
+ inAppBrowser?: boolean;
512
+ }
513
+ declare function SekyroFlow({ hostedUrl, inAppBrowser, ...props }: SekyroFlowProps): react.JSX.Element;
514
+
515
+ /** The page runs inside an app's WebView (WhatsApp, Instagram, Facebook, TikTok, Snapchat, LINE, LinkedIn, WeChat, an Android WebView…). */
516
+ declare function isInAppBrowser(userAgent?: string): boolean;
517
+
518
+ declare function VerificationResultScreen({ step, locale, strings, className, onClose, }: StepComponentProps & {
519
+ step: ResultStepHandle;
520
+ /** Shows the primary action, "Back to <partner>" ("Close" without a partner name), as on the native SDKs. */
521
+ onClose?: () => void;
522
+ }): react.JSX.Element;
523
+
524
+ export { DocumentCapture, EidStep, type EidStepProps, EmailOtpStep, type EmailOtpStepProps, MethodChoice, NniEntry, PhoneOtpStep, type PhoneOtpStepProps, PortraitCapture, type SekyroCloseEvent, type SekyroColorScheme, SekyroFlow, type SekyroFlowProps, SekyroLocale, type SekyroStringKey, type SekyroStrings, SekyroVerification, type SekyroVerificationProps, type StepComponentProps, type StepI18n, StepI18nProvider, type StepStrings, type StepTranslate, Strings, VerificationResultScreen, arSteps, enSteps, formatTemplate, frSteps, isInAppBrowser, resolveSekyroStrings, useStepI18n, useVerificationStep };
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{c as re,d as se,e as ie}from"../chunk-ADMDZLPM.js";import{a as We}from"../chunk-AMOZXMUP.js";import{a as Ye}from"../chunk-4INDRENU.js";import{a as Qe}from"../chunk-JAUZKPQO.js";import{a as Ue,c as Ke,f as ze}from"../chunk-BRA6F56P.js";import{a as q}from"../chunk-P2LX7BBE.js";import{a as Nt,b as Ct,c as wt,d as Pt,e as _t,f as ee,g as N}from"../chunk-BJJZ4MO5.js";import{b as $e}from"../chunk-65JA6YKG.js";import{a as Je}from"../chunk-3MBJZSJL.js";import{a as z}from"../chunk-Q232JYNO.js";import{a as $,b as U,c as ae,d as qe,g as Ge}from"../chunk-63NUMQST.js";import{a as w,b as le}from"../chunk-BENNJ4GV.js";import{a as i,b as v,h as Oe,i as He,k as ue,l as ne}from"../chunk-4RUZQW5T.js";import{useEffect as xt,useState as Xe}from"react";function me(e){let[t,o]=Xe(()=>e?.currentStep?.()??null),[s,a]=Xe(null);return xt(()=>{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 r=!0,n=e.on("step",l=>{r&&o(l)});return e.run().then(l=>{r&&o(c=>c??l)},l=>{r&&a(l)}),()=>{r=!1,n()}},[e]),{step:t,error:s}}i(me,"useVerificationStep");import{useEffect as It,useId as Et,useRef as Vt,useState as pe}from"react";import{Fragment as je,jsx as g,jsxs as M}from"react/jsx-runtime";var Ze=i((e,t)=>{if(e===void 0)return 0;let o=Date.parse(e)-t;return Number.isFinite(o)?Math.max(0,Math.ceil(o/1e3)):0},"secondsUntil"),Tt=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),Lt=["whatsapp","sms"],Rt=new Set(["otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited"]),W="+222";function At(e){let t=e.replace(/[\s-]/g,""),o=t.startsWith("+")?t.slice(1):t;return/^\d{8,15}$/.test(o)?`+${o}`:null}i(At,"normalizedPhone");function Dt({id:e,label:t,value:o,onChange:s,placeholder:a}){let r=o.startsWith("+")&&!o.startsWith(W),n=r?o:o.slice(o.startsWith(W)?W.length:0).trim(),l=Vt(null);return It(()=>{let c=setTimeout(()=>l.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(c)},[]),M("div",{className:"sekyro-field",children:[g("label",{className:"sekyro-label",htmlFor:e,children:t}),M("div",{className:"sekyro-phone",dir:"ltr",children:[r?null:M("span",{className:"sekyro-phone__dial",id:`${e}-dial`,children:[g("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:"🇲🇷"}),W]}),g("input",{ref:l,id:e,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",...r?{}:{"aria-describedby":`${e}-dial`},placeholder:a,value:n,onChange:c=>{let d=c.target.value.replace(/[^\d +]/g,"");s(d.startsWith("+")?d:W+d.replace(/\D/g,""))}})]})]})}i(Dt,"PhoneField");function fe({step:e,locale:t,strings:o,className:s,defaultPhone:a=W,onError:r}){let n=N(t,o),{t:l}=n,[c,d]=pe(a),[y,S]=pe(""),[m,k]=pe(!1),[h,V]=pe(null),P=e.phase==="verify",T=Ye(P),R=Et(),b=i(async _=>{k(!0),V(null);try{await _()}catch(L){V(q(L,n.strings)),r?.(L)}finally{k(!1)}},"run"),u=Lt.filter(_=>(e.channels??[]).includes(_)),f=At(c),x=!e.needsPhone||f!==null,C=i((_,L=!1)=>{b(()=>e.send({...e.needsPhone&&(!L||c!==a)?{phone:f??c}:{},..._!==void 0?{channel:_}:{}}))},"send"),De=i(_=>{b(()=>e.verify(_))},"submitCode"),Be=i(_=>{_.preventDefault(),P?De(y):u.length<=1&&x&&C(u[0])},"onSubmit"),Me=Ze(e.codeExpiresAt,T),j=Ze(e.resendAvailableAt,T),oe=P&&e.codeExpiresAt!==void 0&&Me===0,de=i(_=>l(_==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[ht,bt]=l("otp.sentTo",{channel:de(e.channel)}).split("{number}"),vt=e.reason==="otp_mismatch"?M(w,{tone:"danger",children:[g("span",{children:l("otp.reason_otp_mismatch")}),g("span",{children:le(n,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Rt.has(e.reason)?g(w,{tone:"warning",children:g("span",{children:l(`otp.reason_${e.reason}`)})}):null,Fe=M(je,{children:[vt,h!==null?g(w,{tone:"danger",children:g("span",{children:l(h)})}):null]});if(P){let _=u.length===0;return M("form",{className:`sekyro-step sekyro-otp${s?` ${s}`:""}`,"aria-labelledby":R,onSubmit:Be,noValidate:!0,children:[g($,{id:R,title:l("otp.verifyTitle"),lead:M(je,{children:[ht,g("bdi",{dir:"ltr",className:"sekyro-mono",children:e.sentToMasked}),bt]})}),Fe,M("div",{className:"sekyro-field",children:[g("label",{className:"sekyro-label",htmlFor:`${R}-code`,children:l("otp.codeLabel")}),g(We,{id:`${R}-code`,value:y,invalid:e.reason==="otp_mismatch",onChange:L=>{S(L),L.length===6&&y.length!==6&&!m&&!e.attemptsExhausted&&De(L)}}),g("span",{className:`sekyro-help sekyro-otp-expiry${oe?" is-danger":""}`,"aria-hidden":!oe||void 0,children:oe?l("otp.expired"):l("otp.expiresIn",{time:Tt(Me)})})]}),g("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:oe?l("otp.expired"):""}),M(U,{children:[g(v,{type:"submit",full:!0,disabled:m||y.length!==6||e.attemptsExhausted,"aria-busy":m||void 0,children:l("otp.verify")}),_?g("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:m||j>0,onClick:()=>C(void 0,!0),children:j>0?l("otp.resendIn",{seconds:j}):l("otp.resend")}):j>0?g("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:j})}):g("div",{className:"sekyro-resend-row",children:u.map(L=>g("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:m,onClick:()=>C(L,!0),children:l("otp.resendBy",{channel:de(L)})},L))})]})]})}return M("form",{className:`sekyro-step sekyro-otp${s?` ${s}`:""}`,"aria-labelledby":R,onSubmit:Be,noValidate:!0,children:[g($,{id:R,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),Fe,e.needsPhone?g(Dt,{id:`${R}-phone`,label:l("otp.phoneLabel"),value:c,onChange:d,placeholder:l("otp.phonePlaceholder").replace(W,"").trim()}):g("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),g(U,{children:u.length>0?M("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[g("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),u.map((_,L)=>g(v,{kind:L===0?"primary":"ghost",full:!0,disabled:m||!x,"aria-busy":L===0&&m||void 0,onClick:()=>C(_),children:l("otp.sendBy",{channel:de(_)})},_))]}):g(v,{type:"submit",full:!0,disabled:m||!x,"aria-busy":m||void 0,children:l("otp.send")})})]})}i(fe,"PhoneOtpStep");import{lazy as Mt,Suspense as Ft,useMemo as Ot,useState as Ht}from"react";import{Component as Bt}from"react";var ye=class ye extends Bt{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(ye,"LoadBoundary");var O=ye;import{jsx as G,jsxs as Ut}from"react/jsx-runtime";var $t={load:i(()=>import("../email-otp-view-TYSBCGUY.js"),"load")};function ke({locale:e,strings:t,...o}){let s=N(e,t),[a,r]=Ht(0),n=Ot(()=>Mt(()=>$t.load().then(c=>({default:c.EmailOtpView}))),[a]),l=Ut(w,{tone:"danger",children:[G("span",{children:s.t("errors.network_error")}),G(v,{kind:"ghost",onClick:()=>r(c=>c+1),children:s.t("common.retry")})]});return G(O,{fallback:l,children:G(Ft,{fallback:G("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:G(n,{...o,i18n:s})})},a)}i(ke,"EmailOtpStep");import{lazy as Kt,Suspense as zt,useMemo as Wt,useState as qt}from"react";import{jsx as Y,jsxs as Yt}from"react/jsx-runtime";var Gt={load:i(()=>import("../eid-view-WIK6KUTY.js"),"load")};function Se({locale:e,strings:t,...o}){let s=N(e,t),[a,r]=qt(0),n=Wt(()=>Kt(()=>Gt.load().then(c=>({default:c.EidView}))),[a]),l=Yt(w,{tone:"danger",children:[Y("span",{children:s.t("errors.network_error")}),Y(v,{kind:"ghost",onClick:()=>r(c=>c+1),children:s.t("common.retry")})]});return Y(O,{fallback:l,children:Y(zt,{fallback:Y("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:Y(n,{...o,i18n:s})})},a)}i(Se,"EidStep");import{useMemo as et,useState as tt}from"react";import{lazy as Qt,Suspense as Jt,useMemo as Xt,useState as Zt}from"react";import{jsx as Q,jsxs as eo}from"react/jsx-runtime";var jt={load:i(()=>import("../flow-views-PCBR5GYS.js"),"load")};function F({view:e,i18n:t,quiet:o,...s}){let[a,r]=Zt(0),n=Xt(()=>Qt(()=>jt.load().then(c=>({default:c[e]}))),[e,a]),l=eo(w,{tone:"danger",children:[Q("span",{children:t.t("errors.network_error")}),Q(v,{kind:"ghost",onClick:()=>r(c=>c+1),children:t.t("common.retry")})]});return Q(O,{fallback:l,children:Q(Jt,{fallback:o===!0?null:Q("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:Q(n,{...s,i18n:t})})},a)}i(F,"Flow");import{jsx as ge,jsxs as to}from"react/jsx-runtime";function he({step:e,locale:t,strings:o,className:s,onError:a}){let r=N(t,o),[n,l]=tt(!1),[c,d]=tt(!1),y=et(()=>e.options.filter(h=>h!=="document_chip"),[e.options]),S=e.nationalEid?.providerName,m=S?r.t("method.national_eid",{provider:S}):r.t("method.national_eidGeneric"),k=et(()=>h=>r.strings[h]??"",[r]);return to("div",{className:s,children:[ge($e,{value:k,children:ge(Ke,{choice:{available:!0,selected:null,options:y},busy:n,failed:c,focus:!0,eidLabel:m,onSelect:h=>{l(!0),d(!1),e.select(h).then(()=>l(!1),V=>{l(!1),d(!0),a?.(V)})}})}),e.nationalEid?.afterPass==="continue"&&y.includes("national_eid")?ge(F,{view:"EidContinueHint",i18n:r,provider:S,quiet:!0}):null]})}i(he,"MethodChoice");import{isValidNni as oo,normalizeNni as ot}from"@sekyro/web";import{useId as no,useState as be}from"react";import{Fragment as ro,jsx as I,jsxs as J}from"react/jsx-runtime";function ve({step:e,locale:t,strings:o,className:s,onError:a}){let r=N(t,o),{t:n}=r,[l,c]=be(""),[d,y]=be(!1),[S,m]=be(null),k=no(),h=e.attemptsExhausted,V=i(async x=>{y(!0),m(null);try{await x()}catch(C){m(q(C,r.strings)),a?.(C)}finally{y(!1)}},"run"),P=i(x=>{if(x.preventDefault(),e.source!=="typed"){V(()=>e.confirm());return}let C=ot(l);if(!/^\d{10}$/.test(C))return m("population.invalid");if(!oo(C))return m("population.reason_nni_invalid");V(()=>e.submitNni(C))},"onSubmit"),T=le(r,e.attemptsRemaining,h),R=J(ro,{children:[e.reason==="registry_unavailable"?J(w,{tone:"warning",children:[I("span",{children:n("population.reason_registry_unavailable")}),I("span",{children:T})]}):null,e.reason==="nni_not_found"&&e.canUseDocument?J(w,{tone:"warning",children:[I("span",{children:n("population.reason_nni_not_found_or_document")}),I("span",{children:T}),I(v,{kind:"ghost",disabled:d,onClick:()=>{V(()=>e.useDocument())},children:n("population.useDocument")})]}):null,e.reason==="nni_not_found"&&!e.canUseDocument||e.reason==="nni_invalid"?J(w,{tone:"danger",children:[I("span",{children:n(e.reason==="nni_not_found"?"population.reason_nni_not_found":"population.reason_nni_invalid")}),I("span",{children:T})]}):null,h&&e.reason===void 0?I(w,{tone:"danger",children:I("span",{children:T})}):null,S!==null?I(w,{tone:"danger",children:I("span",{children:n(S)})}):null]}),[b,u,f]=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 J("form",{className:`sekyro-step${s?` ${s}`:""}`,"aria-labelledby":k,onSubmit:P,noValidate:!0,children:[I($,{id:k,title:n(b),lead:n(u)}),R,e.source==="typed"?J("div",{className:"sekyro-field",children:[I("label",{className:"sekyro-label",htmlFor:`${k}-nni`,children:n("population.label")}),I("input",{id:`${k}-nni`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:n("population.placeholder"),value:l,"aria-describedby":`${k}-nni-help`,"aria-invalid":S==="population.invalid"||S==="population.reason_nni_invalid"||void 0,onChange:x=>{m(null),c(ot(x.target.value).replace(/\D/g,"").slice(0,10))}}),I("span",{id:`${k}-nni-help`,className:"sekyro-help",children:n("population.helper")})]}):null,I(U,{children:h?null:I(v,{type:"submit",full:!0,disabled:d,"aria-busy":d||void 0,children:n(f)})})]})}i(ve,"NniEntry");import{acceptedIssuers as co,acceptedTypesFor as uo,warmDocumentCapture as mo}from"@sekyro/web";import{lazy as fo,Suspense as yo,useEffect as ko,useMemo as So,useState as at}from"react";import{acceptedIssuers as so,acceptedTypesFor as Ne}from"@sekyro/web";import{useEffect as nt,useId as io,useMemo as rt,useState as Ce}from"react";import{jsx as E,jsxs as X}from"react/jsx-runtime";var st=i(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),ao=i(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),lo=220;function po(e,t){let o=null;try{o=new Intl.DisplayNames([e],{type:"region"})}catch{}let s=t.map(r=>({code:r,name:o?.of(r)??r})),a=new Intl.Collator(e);return s.sort((r,n)=>r.code==="MR"?-1:n.code==="MR"?1:a.compare(r.name,n.name))}i(po,"countryNames");function it({step:e,i18n:t,issuer:o,onPicked:s}){let{t:a,locale:r}=t,n=rt(()=>so(e.documents),[e.documents]),l=rt(()=>po(r,n),[r,n]),c=n.length===1?n[0]:null,[d,y]=Ce(o??c),[S,m]=Ce(""),[k,h]=Ce(null),V=io(),P=c===null?[]:Ne(e.documents,c),T=c!==null&&P.length===1?P[0]:null;nt(()=>{c!==null&&T!==null&&e.selectDocument(c,T)},[c,T]);let R=i((f,x)=>{e.selectDocument(f,x),s?.()},"pick"),b=i(f=>{let x=Ne(e.documents,f);x.length===1?R(f,x[0]):y(f)},"chooseIssuer");if(nt(()=>{if(k===null||d===null)return;let f=setTimeout(()=>R(d,k),lo);return()=>clearTimeout(f)},[k]),T!==null)return null;if(d===null){let f=st(S.trim()),x=f===""?l:l.filter(C=>st(C.name).includes(f)||C.code.toLowerCase()===f);return X("section",{className:"sekyro-step",children:[E($,{title:a("doc.countryTitle"),lead:a("doc.pickDescription")}),X("div",{className:"sekyro-field",children:[E("label",{className:"sekyro-label",htmlFor:V,children:a("doc.countryLabel")}),E("input",{id:V,type:"search",className:"sekyro-input",placeholder:a("doc.countrySearch"),value:S,onChange:C=>m(C.target.value)})]}),x.length===0?E("p",{className:"sekyro-text-muted",children:a("doc.noCountryMatch")}):E("ul",{className:"sekyro-rows",children:x.map(C=>E("li",{children:X("button",{type:"button",className:"sekyro-row-btn",onClick:()=>b(C.code),children:[E("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:ao(C.code)}),C.name]})},C.code))}),E(U,{children:null})]})}let u=Ne(e.documents,d);return X("section",{className:"sekyro-step",children:[E($,{title:a("doc.pickTitle"),lead:a("native.doc.holdIt")}),E("div",{className:"sekyro-choices",children:u.map(f=>X("button",{type:"button",className:"sekyro-card","aria-pressed":k===f,disabled:k!==null&&k!==f,onClick:()=>h(f),children:[E(z,{name:f==="passport"?"passport":"card"}),X("span",{className:"sekyro-card__body",children:[E("span",{className:"sekyro-card__title",children:a(`doc.type.${f}`)}),E("span",{className:"sekyro-card__sub",children:a(`doc.sub.${f}`)})]}),E("span",{className:"sekyro-radio","aria-hidden":"true"})]},f))}),n.length>1?E("button",{type:"button",className:"sekyro-link",onClick:()=>{y(null),h(null)},children:a("native.doc.changeCountry")}):null,E(U,{children:null})]})}i(it,"DocumentPicker");import{jsx as K,jsxs as ho}from"react/jsx-runtime";var go={load:i(()=>import("../document-capture-view-SKFDM4AQ.js"),"load")};function we({step:e,locale:t,strings:o,className:s,liveMrz:a}){let r=N(t,o),[n,l]=at(0),[c,d]=at(null),y=co(e.documents).length>1,S=e.issuer!==null&&uo(e.documents,e.issuer).length>1,m=So(()=>fo(()=>go.load().then(h=>({default:h.DocumentCaptureView}))),[n]);ko(()=>{mo()},[]);let k=ho(w,{tone:"danger",children:[K("span",{children:r.t("errors.network_error")}),K(v,{kind:"ghost",onClick:()=>l(h=>h+1),children:r.t("doc.retryCamera")})]});return K("div",{className:s,children:e.documentType===null||e.issuer===null||c!==null?K(it,{step:e,i18n:r,...c==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>d(null)}):K(O,{fallback:k,children:K(yo,{fallback:K("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:K(m,{step:e,i18n:r,...a!==void 0?{liveMrz:a}:{},...y?{onChangeCountry:i(()=>d("country"),"onChangeCountry")}:{},...S?{onChangeDocument:i(()=>d("document"),"onChangeDocument")}:{}})})},n)})}i(we,"DocumentCapture");import{warmPortraitCapture as bo}from"@sekyro/web";import{Component as vo,lazy as No,Suspense as Co,useEffect as wo,useMemo as Po,useState as _o}from"react";import{jsx as A,jsxs as _e}from"react/jsx-runtime";var xo={load:i(()=>import("../portrait-capture-view-HYOEOAF4.js"),"load")},Ie=class Ie extends vo{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(Ie,"LoadBoundary");var Pe=Ie;function Io({step:e,i18n:t}){let{t:o}=t,s=ne();return _e("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[A("h2",{ref:s,tabIndex:-1,className:"sekyro-text-body",children:o(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?A("p",{className:"sekyro-text-muted",children:o("portrait.reviewDescription")}):null,e.uploadFailed?_e(w,{tone:"danger",children:[A("span",{children:o("portrait.uploadFailed")}),A(v,{kind:"ghost",onClick:()=>{e.resubmit()},children:o("portrait.sendAgain")})]}):A("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:o("portrait.matching")})]})}i(Io,"MatchPhase");function xe({step:e,locale:t,strings:o,className:s,assetBaseUrl:a}){let r=N(t,o),[n,l]=_o(0),c=Po(()=>No(()=>xo.load().then(y=>({default:y.PortraitCaptureView}))),[n]);if(wo(()=>{e.phase==="capture"&&bo()},[e.phase]),e.phase==="match")return A("div",{className:s,children:A(Io,{step:e,i18n:r})});let d=_e(w,{tone:"danger",children:[A("span",{children:r.t("errors.network_error")}),A(v,{kind:"ghost",onClick:()=>l(y=>y+1),children:r.t("portrait.retryCamera")})]});return A("div",{className:s,children:A(Pe,{fallback:d,children:A(Co,{fallback:A("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:A(c,{step:e,i18n:r,...a!==void 0?{assetBaseUrl:a}:{}})})},n)})}i(xe,"PortraitCapture");import{useCallback as Te,useEffect as kt,useId as zo,useRef as Le,useState as ce}from"react";var D={light:{brand:"#0d3b66",brandFg:"#ffffff",fg:"#13141f",fgMuted:"#4e5270",bg:"#f6f7fb",surface:"#ffffff",ring:"#0d3b66",danger:"#ca0f07",success:"#007a5e",warning:"#735003"},dark:{brand:"#6ea2d3",brandFg:"#051a2e",fg:"#f6f7fb",fgMuted:"#cbcedc",bg:"#13141f",surface:"#1d1e2c",ring:"#6ea2d3",danger:"#ff7c7c",success:"#00c897",warning:"#ffd98a"},roles:{light:{brandSoft:"#eaf2fa",line:"#cbcedc",lineSubtle:"#e2e4ee",lineStrong:"#8c91a9",sunken:"#eeeff5",fgSubtle:"#686d8a"},dark:{brandSoft:"#092b4b",line:"#4e5270",lineSubtle:"#2b2d40",lineStrong:"#686d8a",sunken:"#0b0c14",fgSubtle:"#8c91a9"}},stage:"#051a2e",stageAccent:"#69dfef",radius:"10px",radiusLg:"16px",font:'"Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontDisplay:'"Sekyro Geist", Geist, "Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontArabic:'"Sekyro Cairo", Cairo, "Sekyro Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif'};import{useId as Eo,useState as Vo}from"react";import{jsx as Ee,jsxs as lt}from"react/jsx-runtime";var To=["intro","data","processing","sharing","retention"];function pt({i18n:e}){let{t}=e,[o,s]=Vo(!1),a=Eo(),[r,n=""]=t("consent.short").split("{terms}");return lt("section",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-consent",children:[lt("p",{className:"sekyro-text-muted",children:[r,Ee("button",{type:"button",className:"sekyro-link","aria-expanded":o,"aria-controls":a,onClick:()=>s(l=>!l),children:t("consent.termsLink")}),n]}),Ee("div",{id:a,hidden:!o,className:"sekyro-stack sekyro-stack--1 sekyro-text-muted","data-testid":"sekyro-consent-terms",children:To.map(l=>Ee("p",{children:t(`consent.terms.${l}`)},l))})]})}i(pt,"ConsentNotice");function ct(e){let t=e.trim().split(/\s+/).filter(s=>s!=="");return(t.length>=2?[t[0],t[1]].map(s=>Array.from(s??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}i(ct,"initials");import{useSyncExternalStore as Lo}from"react";var ut=i(e=>({colors:{...e?D.dark:D.light},radius:D.radiusLg,fontFamily:D.font}),"brandTheme"),Ur=ut(!1);function mt(e,t,o){let s=re(e);if(o&&s.colors!==void 0){let{brand:a,brandFg:r}=s.colors;a!==void 0&&Bo(a,D.dark.bg)>=3?s.colors={brand:a,ring:a,...r!==void 0?{brandFg:r}:{}}:delete s.colors}return se(ut(o),s,t)}i(mt,"verificationTheme");function ft(e){let t=Lo(Do,Ao,()=>!1);return e==="dark"||e==="system"&&t}i(ft,"useDarkScheme");var Ro="(prefers-color-scheme: dark)",yt=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Ro):null,"media"),Ao=i(()=>yt()?.matches??!1,"prefersDark");function Do(e){let t=yt();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i(Do,"subscribe");function Bo(e,t){let[o,s]=[dt(e),dt(t)];return(Math.max(o,s)+.05)/(Math.min(o,s)+.05)}i(Bo,"contrast");function dt(e){let t=[1,3,5].map(o=>{let s=Number.parseInt(e.slice(o,o+2),16)/255;return s<=.03928?s/12.92:((s+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}i(dt,"luminance");import{useEffect as Mo,useId as Fo,useState as Oo}from"react";import{jsx as B,jsxs as te}from"react/jsx-runtime";var Ho=new Set(["document_nni_mismatch","name_mismatch","birth_date_mismatch"]),$o={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 Uo({outcome:e}){return te("svg",{className:`sekyro-outcome sekyro-outcome--${e}`,viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[B("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"57",pathLength:"1"}),B("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),B("path",{className:"sekyro-outcome__glyph",d:$o[e],pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]})}i(Uo,"OutcomeMark");function Ko({label:e,id:t,copied:o}){let[s,a]=Oo(!1);return Mo(()=>{if(!s)return;let r=setTimeout(()=>a(!1),1600);return()=>clearTimeout(r)},[s]),te("button",{type:"button",className:`sekyro-reference${s?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[B("span",{"aria-live":"polite",children:s?o:e}),B("bdi",{dir:"ltr",children:t}),B(z,{name:"copy"})]})}i(Ko,"ReferenceLine");function Ve({step:e,locale:t,strings:o,className:s,onClose:a}){let r=N(t,o),{t:n}=r,l=Fo(),c=ne(),d=e.context.orgName,y=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",S;switch(e.display){case"policy_stop":{let m=e.failureReason??"";if(Ho.has(m))S=n("session.result.detailsMismatch",{org:d});else if(m==="device_velocity_exceeded")S=n("session.result.deviceVelocity",{org:d});else{let k=Oe(m);S=k!==null?n(k,{org:d}):n("session.result.rejected.description")}break}case"cooldown":{let m=He(r.locale,e.retryAfter);S=m!==null?n(m.key,{time:m.time}):n("reasons.device_cooldown");break}case"platform_unsupported":S=n("result.platform_unsupported");break;case"attempts_exhausted":S=n("common.noAttemptsLeft");break;default:S=d!==""?n(`native.result.${y}`,{org:d}):n(`session.result.${y}.description`)}return te("section",{className:`sekyro-result${s?` ${s}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[te("div",{className:"sekyro-result__body",children:[B(Uo,{outcome:e.display==="cooldown"?"review":y}),te("div",{className:"sekyro-heading",children:[B("h2",{id:l,ref:c,tabIndex:-1,className:"sekyro-text-body",children:n(`session.result.${y}.title`)}),B("p",{className:"sekyro-text-muted",children:S})]}),B(Ko,{label:n("result.referenceLabel"),id:e.context.sessionId,copied:n("native.result.copied")})]}),a!==void 0?B("div",{className:"sekyro-actions",children:B(v,{full:!0,onClick:a,children:d!==""?n("native.result.back",{org:d}):n("native.close")})}):null]})}i(Ve,"VerificationResultScreen");import{Fragment as St,jsx as p,jsxs as H}from"react/jsx-runtime";function Wo(e,t){let o=t?D.dark:D.light,s=t?D.roles.dark:D.roles.light,a=e.colors??{},r={},n=a.fg===o.fg&&a.surface===o.surface;return a.brand===o.brand&&a.surface===o.surface&&(r["--sekyro-color-brand-soft"]=s.brandSoft),n&&(r["--sekyro-color-line"]=s.line,r["--sekyro-color-line-subtle"]=s.lineSubtle,r["--sekyro-color-line-strong"]=s.lineStrong,r["--sekyro-color-sunken"]=s.sunken),a.fgMuted===o.fgMuted&&a.surface===o.surface&&(r["--sekyro-color-fg-subtle"]=s.fgSubtle),e.fontFamily===D.font&&(r["--sekyro-font-display"]=D.fontDisplay),r}i(Wo,"flowRoles");function Re(e){let{verification:t,locale:o,strings:s,onStep:a,onResult:r}=e,{step:n,error:l}=me(t);kt(()=>{n!==null&&a?.(n)},[n,a]),kt(()=>r===void 0?void 0:t.on("result",r),[t,r]);let c=ft(e.colorScheme??"light"),d=mt(n?.context.branding,e.theme,c),[y,S]=ce(!1),m=`sekyro-verification${c?" sekyro-verification--dark":""}${y?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,k=Le(e.onClose);k.current=e.onClose;let h=Le(n);h.current=n;let V=Te(()=>{let P=h.current;k.current?.(P?.kind==="result"?{reason:"finished",result:P.result}:{reason:"cancelled"})},[]);return p(ie,{theme:d,className:m,children:p(ee,{locale:o,...s!==void 0?{strings:s}:{},children:p("div",{dir:e.dir??(o==="ar"?"rtl":"ltr"),lang:o,className:"sekyro-flow",style:Wo(d,c),children:p(qe.Provider,{value:S,children:p(ae.Provider,{value:e.onClose!==void 0?V:void 0,children:p(qo,{...e,step:n,error:l,immersive:y})})})})})})}i(Re,"SekyroVerification");function qo(e){let{step:t,error:o,slots:s,immersive:a}=e,r=N(),{t:n}=r,[l,c]=ce(!1),[d,y]=ce(0),S=Te((u,f)=>p(Qe,{start:u,context:f}),[]),m=Le(""),k=e.livenessProps?.slots?.stageOverlay,h=Te(u=>(u.guidance!==""&&!u.coached&&(m.current=u.guidance),p(Je,{testId:"sekyro-capture-stage",video:p("video",{ref:u.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:u.guidance!==""?u.guidance:m.current,note:u.note,busy:u.settled,progress:u.phase==="seeking"||u.phase==="aligning"?u.progress:1,still:u.still,live:u.live,closeLabel:n("native.close"),overlay:k?.(u.videoRef),...u.settled?{}:{onClose:i(()=>y(f=>f+1),"onClose")}})),[n,k]),V=zo();if(o!==null)return p(ue,{tone:"danger",children:p("span",{children:n(q(o,r.strings))})});if(t===null)return p("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:n("common.loading")});let{context:P}=t,T=i(u=>{c(!0),u().finally(()=>c(!1))},"refresh"),R=s?.header??p(Yo,{context:P,headerId:V,end:s?.headerEnd}),b;switch(t.kind){case"phone_otp":b=p(fe,{step:t});break;case"email_otp":b=p(ke,{step:t});break;case"method":b=p(he,{step:t});break;case"registry":b=p(ve,{step:t});break;case"document":b=p(we,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let u=e.livenessProps?.slots?.intro,f={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:u??S},...d>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,...e.dir!==void 0?{dir:e.dir}:{},strings:r.strings,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{},...e.voice!==void 0?{voice:e.voice}:{},...e.onLivenessCaptured!==void 0?{onCaptured:e.onLivenessCaptured}:{}};b=p(Ue.Provider,{value:h,children:t.instructions==="icao"||t.livePhoto?.icao===!0?p(F,{view:"LivePhotoLiveness",i18n:r,step:t,livenessProps:f,sekyroIntro:u===void 0},d):p(ze,{...f},d)});break}case"portrait":b=H(St,{children:[t.retakeOnly?p(F,{view:"PortraitRetakeNotice",i18n:r,quiet:!0}):null,p(xe,{step:t,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":b=p(F,{view:"ContactChoiceView",i18n:r,step:t});break;case"identity_summary":b=p(F,{view:"IdentitySummaryView",i18n:r,step:t});break;case"mobile_required":b=e.handoffUrl!==void 0?p(F,{view:"HandoffView",i18n:r,url:e.handoffUrl,refresh:t.refresh}):H(ue,{tone:"info",children:[p("strong",{children:n("handoff.title")}),p("span",{children:n("reasons.mobile_required")}),p(v,{kind:"ghost",disabled:l,onClick:()=>T(t.refresh),children:n("common.refresh")})]});break;case"processing":b=H("section",{className:"sekyro-stack sekyro-stack--1",role:"status","aria-live":"polite",children:[p("h2",{className:"sekyro-text-body",children:n("session.processing.title")}),p("p",{className:"sekyro-text-muted",children:n("session.processing.description")}),t.stalled?p(v,{kind:"ghost",disabled:l,onClick:()=>T(t.refresh),children:n("common.refresh")}):null]});break;case"eid":b=p(Se,{step:t});break;case"unsupported":{let u=t.reason==="platform_unsupported";b=H("section",{className:"sekyro-stack sekyro-stack--1",children:[p("h2",{className:"sekyro-text-body",children:n(u?"needsApp.title":"unsupported.title")}),p("p",{children:u?P.orgName!==""?n("needsApp.description",{org:P.orgName}):n("needsApp.descriptionNoOrg"):n("unsupported.description",{org:P.orgName})})]});break}case"result":b=s?.result?.(t)??p(Go,{step:t});break;default:{let u=t;b=null}}return H(St,{children:[a?null:R,!a&&t.kind!=="result"&&P.sections.length>1?p(Qo,{sections:P.sections,current:t.section,i18n:r}):null,!a&&!P.consentRecorded&&t.kind!=="result"?p(pt,{i18n:r}):null,p(Ge,{pageKey:t.key,children:b}),!a&&(t.kind==="phone_otp"||t.kind==="email_otp")&&t.canSwitch?p(F,{view:"ContactSwitch",i18n:r,step:t,quiet:!0},t.key):null,a?null:s?.footer!==void 0?s.footer:H("p",{className:"sekyro-footer",children:[p(z,{name:"lock"}),n("shell.verifiedBy")]})]})}i(qo,"Body");function Go({step:e}){return p(ae.Consumer,{children:t=>p(Ve,{step:e,...t!==void 0?{onClose:t}:{}})})}i(Go,"ResultPage");function Yo({context:e,headerId:t,end:o}){let{t:s}=N(),[a,r]=ce(!1),n=a?void 0:e.branding?.logoUrl,l=e.orgName!==""?e.orgName:s(e.returning?"returning.title":"session.title");return H("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:[H("div",{className:"sekyro-org",children:[p("span",{className:"sekyro-org__tile","aria-hidden":"true",children:n!==void 0?p("img",{className:"sekyro-org__logo",src:n,alt:"",onError:()=>r(!0)}):ct(e.orgName)}),H("div",{className:"sekyro-org__text",children:[p("h1",{id:t,className:"sekyro-org__name",children:l}),p("p",{className:"sekyro-org__sub",children:s("shell.subtitle")})]}),o!=null?p("div",{className:"sekyro-org__end",children:o}):null,p(ae.Consumer,{children:c=>c!==void 0?p("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":s("native.close"),onClick:c,children:p(z,{name:"close"})}):null})]}),e.returning?p("p",{className:"sekyro-text-muted",children:s("returning.description")}):null]})}i(Yo,"OrgHeader");function Qo({sections:e,current:t,i18n:o}){let s=t===null?-1:e.indexOf(t);return p("ol",{className:"sekyro-progress__bars","aria-label":o.t("session.progressLabel"),children:e.map((a,r)=>p("li",{className:`sekyro-progress__bar${r<s?" is-done":r===s?" is-current":""}`,...r===s?{"aria-current":"step"}:{},children:p("span",{className:"sekyro-visually-hidden",children:o.strings[`section.${a}`]??a})},a))})}i(Qo,"SectionProgress");import{useEffect as Xo,useState as gt}from"react";var Jo=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function Ae(e){let t=e??(typeof navigator>"u"?"":String(navigator.userAgent??""));return Jo.test(t)}i(Ae,"isInAppBrowser");import{jsx as Z}from"react/jsx-runtime";function Zo(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i(Zo,"pageUrl");function jo({hostedUrl:e,inAppBrowser:t,...o}){let[s,a]=gt(t===!0);Xo(()=>{t===void 0&&Ae()&&a(!0)},[t]);let[r,n]=gt(!1),l=o.handoffUrl??e??Zo();return s&&!r?Z(ie,{theme:se(re(void 0),o.theme),...o.className!==void 0?{className:o.className}:{},children:Z(ee,{locale:o.locale,...o.strings!==void 0?{strings:o.strings}:{},children:Z("div",{dir:o.dir??(o.locale==="ar"?"rtl":"ltr"),lang:o.locale,className:"sekyro-stack sekyro-stack--4",children:Z(en,{url:l,onContinue:()=>n(!0)})})})}):Z(Re,{...o,...l!==""?{handoffUrl:l}:{}})}i(jo,"SekyroFlow");function en({url:e,onContinue:t}){let o=N();return Z(F,{view:"InAppBrowserPrompt",i18n:o,url:e,onContinue:t})}i(en,"Prompt");export{we as DocumentCapture,Se as EidStep,ke as EmailOtpStep,he as MethodChoice,ve as NniEntry,fe as PhoneOtpStep,xe as PortraitCapture,jo as SekyroFlow,Re as SekyroVerification,ee as StepI18nProvider,Ve as VerificationResultScreen,Nt as arSteps,Ct as enSteps,Pt as formatTemplate,wt as frSteps,Ae as isInAppBrowser,_t as resolveSekyroStrings,N as useStepI18n,me as useVerificationStep};