@sekyro/react 0.1.0-rc.38 → 0.1.0-rc.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/chunk-5NAOIKDI.js +2 -0
- package/dist/{chunk-DZA3S24Q.js → chunk-6LBVEW6H.js} +1 -1
- package/dist/{chunk-ZBHKQPZ4.js → chunk-6RAQ52LO.js} +1 -1
- package/dist/{chunk-VRDPGOXM.js → chunk-A7C3KQ7K.js} +1 -1
- package/dist/chunk-AN74BL27.js +2 -0
- package/dist/chunk-BB5BRNVU.js +2 -0
- package/dist/{chunk-YZSIT56Y.js → chunk-CYG47FWI.js} +1 -1
- package/dist/{chunk-Z2UJ4T5A.js → chunk-DUJHBDLD.js} +1 -1
- package/dist/{chunk-3L3CY2H4.js → chunk-E3RFBNKZ.js} +1 -1
- package/dist/{chunk-B7IE2KTU.js → chunk-EJV7N22H.js} +1 -1
- package/dist/chunk-KKSEGXMM.js +2 -0
- package/dist/{chunk-JNBOOG7O.js → chunk-NNCBKWTI.js} +1 -1
- package/dist/{chunk-Q5SUS22Q.js → chunk-PUID2LKA.js} +1 -1
- package/dist/{chunk-OB3DHB57.js → chunk-U4X4OLJV.js} +1 -1
- package/dist/document-capture-view-NI4452T4.js +2 -0
- package/dist/{eid-view-6DXZ5ELB.js → eid-view-GAIQODI5.js} +1 -1
- package/dist/{email-otp-view-3UJPJOQ6.js → email-otp-view-SM2POPMA.js} +1 -1
- package/dist/{flow-views-ZVDXJZWH.js → flow-views-NBUWHG7J.js} +1 -1
- package/dist/{form-view-4NKEHYNF.js → form-view-GOFXOQJO.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/overlay-de-YLCWZB42.js +2 -0
- package/dist/overlay-es-YIPBOMXT.js +2 -0
- package/dist/overlay-pt-JSDCAYVA.js +2 -0
- package/dist/{portrait-capture-view-QDUJ36UH.js → portrait-capture-view-TTUVVA7L.js} +1 -1
- package/dist/portrait-review-view-BCIENGKR.js +2 -0
- package/dist/{proof-of-address-view-E6WJTTIV.js → proof-of-address-view-SS2TIV3D.js} +1 -1
- package/dist/{theme-BASMEql8.d.cts → theme-BhxSZSbp.d.cts} +2 -2
- package/dist/{theme-BASMEql8.d.ts → theme-BhxSZSbp.d.ts} +2 -2
- package/dist/verification/index.cjs +1 -1
- package/dist/verification/index.d.cts +4 -2
- package/dist/verification/index.d.ts +4 -2
- package/dist/verification/index.js +1 -1
- package/dist/verification.css +2 -0
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/chunk-TYJNROSC.js +0 -2
- package/dist/chunk-U3ARWENR.js +0 -2
- package/dist/chunk-V4ZZVMGQ.js +0 -2
- package/dist/chunk-VHHSMO63.js +0 -2
- package/dist/document-capture-view-25EASYV7.js +0 -2
- package/dist/overlay-de-64ABPD3N.js +0 -2
- package/dist/overlay-es-VIMXYK2Q.js +0 -2
- package/dist/overlay-pt-3IBDZBAW.js +0 -2
- package/dist/portrait-review-view-LW5DBF3L.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-
|
|
2
|
-
export { k as StringKey, A as retakeHintStringKey } from '../theme-
|
|
1
|
+
import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-BhxSZSbp.cjs';
|
|
2
|
+
export { k as StringKey, A as retakeHintStringKey } from '../theme-BhxSZSbp.cjs';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import { Verification, VerificationStep, PhoneOtpStepHandle, EmailOtpStepHandle, EidStepHandle, MethodStepHandle, RegistryStepHandle, DocumentStepHandle, DocumentLiveMrzOptions, PortraitStepHandle, ProofOfAddressStepHandle, FormStepHandle, VerificationResult, ResultStepHandle, CapturedArtifacts } from '@sekyro/web';
|
|
@@ -285,6 +285,7 @@ interface StepStrings {
|
|
|
285
285
|
"doc.pageCaptured": string;
|
|
286
286
|
"doc.progressFront": string;
|
|
287
287
|
"doc.progressBack": string;
|
|
288
|
+
"doc.sideReceived": string;
|
|
288
289
|
"doc.progressPage": string;
|
|
289
290
|
"doc.shutter": string;
|
|
290
291
|
"doc.torchOn": string;
|
|
@@ -575,6 +576,7 @@ interface StepStrings {
|
|
|
575
576
|
"native.scan.showInstead.passport"?: string;
|
|
576
577
|
"native.scan.showInstead.residence_permit"?: string;
|
|
577
578
|
"native.scan.showInstead.drivers_license"?: string;
|
|
579
|
+
"native.scan.expired"?: string;
|
|
578
580
|
"consent.human.terms.intro"?: string;
|
|
579
581
|
"consent.human.terms.data"?: string;
|
|
580
582
|
"consent.human.terms.processing"?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-
|
|
2
|
-
export { k as StringKey, A as retakeHintStringKey } from '../theme-
|
|
1
|
+
import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-BhxSZSbp.js';
|
|
2
|
+
export { k as StringKey, A as retakeHintStringKey } from '../theme-BhxSZSbp.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import { Verification, VerificationStep, PhoneOtpStepHandle, EmailOtpStepHandle, EidStepHandle, MethodStepHandle, RegistryStepHandle, DocumentStepHandle, DocumentLiveMrzOptions, PortraitStepHandle, ProofOfAddressStepHandle, FormStepHandle, VerificationResult, ResultStepHandle, CapturedArtifacts } from '@sekyro/web';
|
|
@@ -285,6 +285,7 @@ interface StepStrings {
|
|
|
285
285
|
"doc.pageCaptured": string;
|
|
286
286
|
"doc.progressFront": string;
|
|
287
287
|
"doc.progressBack": string;
|
|
288
|
+
"doc.sideReceived": string;
|
|
288
289
|
"doc.progressPage": string;
|
|
289
290
|
"doc.shutter": string;
|
|
290
291
|
"doc.torchOn": string;
|
|
@@ -575,6 +576,7 @@ interface StepStrings {
|
|
|
575
576
|
"native.scan.showInstead.passport"?: string;
|
|
576
577
|
"native.scan.showInstead.residence_permit"?: string;
|
|
577
578
|
"native.scan.showInstead.drivers_license"?: string;
|
|
579
|
+
"native.scan.expired"?: string;
|
|
578
580
|
"consent.human.terms.intro"?: string;
|
|
579
581
|
"consent.human.terms.data"?: string;
|
|
580
582
|
"consent.human.terms.processing"?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as go}from"../chunk-Q5SUS22Q.js";import{a as oe,b as V,c as yo}from"../chunk-B7IE2KTU.js";import{a as Jt,b as jt,d as eo,e as to}from"../chunk-ZARKJW2C.js";import{a as q,d as Yt,e as dt,f as We,g as Wt,h as Zt}from"../chunk-Z2UJ4T5A.js";import{a as Qt,b as Xt,c as lo}from"../chunk-GUTF3SPK.js";import{a as co,b as uo,c as et,d as po,e as mo,f as fo,g as mt}from"../chunk-TYJNROSC.js";import{a as tt}from"../chunk-OB3DHB57.js";import{d as ut,f as zt,g as Gt,j as qt}from"../chunk-V4ZZVMGQ.js";import{b as $t}from"../chunk-3L3CY2H4.js";import{a as Kt}from"../chunk-7MMT5M4E.js";import{a as pe}from"../chunk-VRDPGOXM.js";import{a as on,b as nn,c as rn,d as sn,e as an,f as De,g as C}from"../chunk-U3ARWENR.js";import{a as H,b as ee,c as oo,d as te,e as Ze,f as no,g as Qe,h as Xe,i as pt,j as ro,l as Je,m as so,n as io,p as ao,q as P,r as je}from"../chunk-DZA3S24Q.js";import"../chunk-JNBOOG7O.js";import{a as S,c as ct,j as en,l as tn,n as Mt,o as Ht,p as Ut,r as Fe,s as Se}from"../chunk-VHHSMO63.js";import{a as i}from"../chunk-2KED7D2Q.js";import{useEffect as ln,useState as ko}from"react";function ft(e){let[t,n]=ko(()=>e?.currentStep?.()??null),[r,a]=ko(null);return ln(()=>{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 s=!0,o=e.on("step",c=>{s&&n(c)});return e.run().then(c=>{s&&n(u=>u??c)},c=>{s&&a(c)}),()=>{s=!1,o()}},[e]),{step:t,error:r}}i(ft,"useVerificationStep");import{useEffect as ho,useId as cn,useMemo as un,useRef as So,useState as be}from"react";import{Fragment as Co,jsx as b,jsxs as Z}from"react/jsx-runtime";var bo=i((e,t,n)=>{if(e===void 0)return 0;let r=Date.parse(e)-t;return Number.isFinite(r)?Math.min(n,Math.max(0,Math.ceil(r/1e3))):0},"secondsUntil"),dn=600,pn=30,mn=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),fn=["whatsapp","sms"],vo=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 yn(e){let t=[];for(let n of e.phoneCountries??["MR"]){let r=e.phoneRules?.find(s=>s.code===n),a=r?.dial??Jt(n);a!==void 0&&!t.some(s=>s.code===n)&&t.push({code:n,dial:`+${a}`,...r!==void 0?{rule:r}:{}})}return t}i(yn,"phoneCountriesOf");function yt({step:e,locale:t,strings:n,className:r,defaultPhone:a,onError:s}){let o=C(t,n),{t:c}=o,u=un(()=>yn(e),[e.phoneCountries,e.phoneRules]),p=a??u[0]?.dial??"",y=e.phoneInternational===!0,g=eo({countries:u,international:y,closed:!!e.phoneRules?.length,defaultPhone:p}),[k,m]=be(""),[f,x]=be(!1),[N,T]=be(null),[E,O]=be(null),[L,v]=be(!1),[M,A]=be(null),B=So(null),F=e.phase==="verify"&&!L,h=e.phase==="verify",W=lo(h),[xe,Ke]=Qt(e.reason==="otp_mismatch",e.attemptsRemaining,()=>m("")),J=cn(),Ie=So(null);ho(()=>{let w=setTimeout(()=>Ie.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(w)},[F]);let se=e.phase==="verify"?e.codeExpiresAt??"sent":null;ho(()=>{se!==null&&(v(!1),B.current!==null&&!vo.has(e.reason??"")&&A(B.current),B.current=null)},[se]);let ze=i(async w=>{x(!0),O(null);try{await w()}catch($){O(pe($,o.strings)),s?.($)}finally{x(!1),T(null)}},"run"),Y=fn.filter(w=>(e.channels??[]).includes(w)),ge=g.typed,ie=!e.needsPhone||ge!==null,ke=i((w,$=!1)=>{let he=e.needsPhone?$?M:{number:ge??g.phone,shown:g.shown}:null;B.current=he,T(w??null),ze(async()=>{try{await e.send({...he!==null?{phone:he.number}:{},...w!==void 0?{channel:w}:{}})}catch(Ae){throw B.current=null,Ae}})},"send"),Te=i(w=>{ze(()=>e.verify(w))},"submitCode"),Ee=i(w=>{w.preventDefault(),F?Te(k):Y.length<=1&&ie&&ke(Y[0])},"onSubmit"),Oe=`${J}-phone`,Re=bo(e.codeExpiresAt,W,dn),le=bo(e.resendAvailableAt,W,pn),ce=F&&e.codeExpiresAt!==void 0&&Re===0,ue=e.needsPhone&&!e.attemptsExhausted,Le=h&&(e.codeExpiresAt===void 0||Re>0),Be=F&&ue?()=>v(!0):L&&Le?()=>v(!1):null;Qe(Be===null?null:f?()=>{}:Be);let j=i(w=>c(w==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),Ve=i(w=>f&&N!==null&&N===w,"busyFor"),[z,Ge]=c("otp.sentTo",{channel:j(e.channel)}).split("{number}"),qe=e.context.simulation?.otpCode,I=e.reason==="otp_mismatch"?Z(P,{tone:"danger",children:[b("span",{children:c("otp.reason_otp_mismatch")}),b("span",{children:je(o,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&vo.has(e.reason)?b(P,{tone:"warning",children:b("span",{children:c(`otp.reason_${e.reason}`)})}):e.reason==="tester_phone_mismatch"?b(P,{tone:"warning",children:b("span",{children:c("reasons.tester_phone_mismatch")})}):null,de=Z(Co,{children:[I,E!==null?b(P,{tone:"danger",children:b("span",{children:c(E)})}):null]});if(F){let w=Y.length===0;return Z("form",{className:`sekyro-step sekyro-otp${r?` ${r}`:""}`,"aria-labelledby":J,onSubmit:Ee,noValidate:!0,children:[b(ee,{id:J,title:c("otp.verifyTitle"),lead:qe!==void 0?b(io,{template:c("sandbox.otpHint"),code:qe}):Z(Co,{children:[z,b("bdi",{dir:"ltr",className:"sekyro-mono",children:M?.shown??e.sentToMasked}),Ge]})}),de,Z("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:`${J}-code`,children:c("otp.codeLabel")}),b(Xt,{id:`${J}-code`,value:k,invalid:xe,onChange:$=>{$!==""&&Ke(),m($),$.length===6&&k.length!==6&&!f&&!e.attemptsExhausted&&Te($)}}),b("span",{className:`sekyro-help sekyro-otp-expiry${ce?" is-danger":""}`,"aria-hidden":!ce||void 0,children:ce?c("otp.expired"):c("otp.expiresIn",{time:mn(Re)})})]}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:ce?c("otp.expired"):""}),Z(te,{children:[b(S,{type:"submit",full:!0,disabled:f||k.length!==6||e.attemptsExhausted,"aria-busy":f||void 0,children:c("otp.verify")}),Z("div",{className:"sekyro-resend-row",children:[w?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:f||le>0,onClick:()=>ke(void 0,!0),children:le>0?c("otp.resendIn",{seconds:le}):c("otp.resend")}):le>0?b("p",{className:"sekyro-resend is-waiting",children:c("otp.resendIn",{seconds:le})}):Y.map($=>b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:f,onClick:()=>ke($,!0),children:c("otp.resendBy",{channel:j($)})},$)),ue?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:f,onClick:()=>v(!0),"data-testid":"sekyro-otp-change",children:c("otp.changeNumber")}):null]})]})]})}return Z("form",{className:`sekyro-step sekyro-otp${r?` ${r}`:""}`,"aria-labelledby":J,onSubmit:Ee,noValidate:!0,children:[b(ee,{id:J,title:c("otp.sendTitle"),lead:c("otp.sendDescription")}),de,e.needsPhone?Z("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:Oe,children:c("otp.phoneLabel")}),b(to,{field:g,id:Oe,locale:o.locale,t:c,inputRef:Ie,ready:ie})]}):b("p",{className:"sekyro-text-muted",children:c("otp.prefilledNotice")}),Z(te,{children:[Y.length===1?b(S,{type:"submit",full:!0,disabled:f||!ie,"aria-busy":Ve(Y[0])||void 0,children:c("otp.sendBy",{channel:j(Y[0])})}):Y.length>1?Z("div",{className:"sekyro-actions__group",role:"group","aria-label":c("otp.chooseChannel"),children:[b("p",{className:"sekyro-label","aria-hidden":"true",children:c("otp.chooseChannel")}),b("div",{className:"sekyro-channel-row",children:Y.map(w=>Z(S,{kind:"primary",disabled:f||!ie,"aria-busy":Ve(w)||void 0,onClick:()=>ke(w),children:[b(H,{name:w}),j(w)]},w))})]}):b(S,{type:"submit",full:!0,disabled:f||!ie,"aria-busy":f||void 0,children:c("otp.send")}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:f&&N!==null?c("otp.sending",{channel:j(N)}):""}),L&&Le?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:f,onClick:()=>v(!1),"data-testid":"sekyro-otp-back-to-code",children:c("otp.backToCode")}):null]})]})}i(yt,"PhoneOtpStep");import{lazy as gn,Suspense as kn,useMemo as hn,useState as Sn}from"react";import{jsx as ve,jsxs as vn}from"react/jsx-runtime";var bn={load:i(()=>import("../email-otp-view-3UJPJOQ6.js"),"load")};function gt({locale:e,strings:t,...n}){let r=C(e,t),[a,s]=Sn(0),o=hn(()=>gn(()=>bn.load().then(u=>({default:u.EmailOtpView}))),[a]),c=vn(P,{tone:"danger",children:[ve("span",{children:r.t("errors.network_error")}),ve(S,{kind:"secondary",onClick:()=>s(u=>u+1),children:r.t("common.retry")})]});return ve(oe,{fallback:c,children:ve(kn,{fallback:ve("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:ve(o,{...n,i18n:r})})},a)}i(gt,"EmailOtpStep");import{lazy as Cn,Suspense as wn,useMemo as Nn,useState as _n}from"react";import{jsx as Ce,jsxs as xn}from"react/jsx-runtime";var Pn={load:i(()=>import("../eid-view-6DXZ5ELB.js"),"load")};function kt({locale:e,strings:t,...n}){let r=C(e,t),[a,s]=_n(0),o=Nn(()=>Cn(()=>Pn.load().then(u=>({default:u.EidView}))),[a]),c=xn(P,{tone:"danger",children:[Ce("span",{children:r.t("errors.network_error")}),Ce(S,{kind:"secondary",onClick:()=>s(u=>u+1),children:r.t("common.retry")})]});return Ce(oe,{fallback:c,children:Ce(wn,{fallback:Ce("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:Ce(o,{...n,i18n:r})})},a)}i(kt,"EidStep");import{useMemo as In}from"react";import{jsx as ht,jsxs as Tn}from"react/jsx-runtime";function St({step:e,locale:t,strings:n,className:r,onError:a}){let s=C(t,n),{busy:o,error:c,run:u}=po(s,a),p=In(()=>e.choice.options.flatMap(g=>{let k=et(g,s),m=co[g.service];return k===null?[]:[{id:g.id,label:k,glyph:m&&ht(H,{name:m})}]}),[e.choice.options,s]),y=e.choice.options.find(g=>g.service==="national_eid");return Tn("div",{className:r,children:[ht(zt,{title:s.t("method.heading"),description:s.t("method.description"),options:p,busy:o,error:c,focus:!0,testId:"sekyro-method",onChoose:g=>u(()=>e.choose(g))}),y?.nationalEid?.afterPass==="continue"?ht(V,{view:"EidContinueHint",i18n:s,provider:y.nationalEid.providerName,quiet:!0}):null]})}i(St,"MethodChoice");import{isValidNni as En,normalizeNni as wo}from"@sekyro/web";import{useId as On,useState as bt}from"react";import{Fragment as Vn,jsx as U,jsxs as we}from"react/jsx-runtime";var Rn=new Set(["nni_not_found","registry_record_not_found"]),Ln=new Set(["nni_invalid","id_number_invalid"]);function ot({step:e,locale:t,strings:n,className:r,onError:a}){let s=C(t,n),{t:o}=s,[c,u]=bt(""),[p,y]=bt(!1),[g,k]=bt(null),m=On(),f=e.attemptsExhausted,x=i(async B=>{y(!0),k(null);try{await B()}catch(F){k(pe(F,s.strings)),a?.(F)}finally{y(!1)}},"run"),N=i(B=>{if(B.preventDefault(),e.source!=="typed"){x(()=>e.confirm());return}let F=wo(c);if(!/^\d{10}$/.test(F))return k("population.invalid");if(!En(F))return k("population.reason_id_number_invalid");x(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(F):e.submitNni(F))},"onSubmit"),T=je(s,e.attemptsRemaining,f),E=e.reason!==void 0&&Rn.has(e.reason),O=e.reason!==void 0&&Ln.has(e.reason),L=we(Vn,{children:[e.reason==="registry_unavailable"?we(P,{tone:"warning",children:[U("span",{children:o("population.reason_registry_unavailable")}),U("span",{children:T})]}):null,E&&e.canUseDocument?we(P,{tone:"warning",children:[U("span",{children:o("population.reason_registry_record_not_found_or_document")}),U("span",{children:T}),U(S,{kind:"secondary",disabled:p,onClick:()=>{x(()=>e.useDocument())},children:o("population.useDocument")})]}):null,E&&!e.canUseDocument||O?we(P,{tone:"danger",children:[U("span",{children:o(E?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),U("span",{children:T})]}):null,f&&e.reason===void 0?U(P,{tone:"danger",children:U("span",{children:T})}):null,g!==null?U(P,{tone:"danger",children:U("span",{children:o(g)})}):null]}),[v,M,A]=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 we("form",{className:`sekyro-step${r?` ${r}`:""}`,"aria-labelledby":m,onSubmit:N,noValidate:!0,children:[U(ee,{id:m,title:o(v),lead:o(M)}),L,e.source==="typed"?we("div",{className:"sekyro-field",children:[U("label",{className:"sekyro-label",htmlFor:`${m}-id-number`,children:o("population.label")}),U("input",{id:`${m}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:o("population.placeholder"),value:c,"aria-describedby":`${m}-id-number-help`,"aria-invalid":g==="population.invalid"||g==="population.reason_id_number_invalid"||void 0,onChange:B=>{k(null),u(wo(B.target.value).replace(/\D/g,"").slice(0,10))}}),U("span",{id:`${m}-id-number-help`,className:"sekyro-help",children:o("population.helper")})]}):null,U(te,{children:f?null:U(S,{type:"submit",full:!0,disabled:p,"aria-busy":p||void 0,children:o(A)})})]})}i(ot,"IdNumberEntry");function Bn(e){return ot(e)}i(Bn,"NniEntry");import{acceptedIssuers as $n,acceptedTypesFor as xo,warmDocumentCapture as Kn}from"@sekyro/web";import{lazy as zn,Suspense as Gn,useEffect as qn,useMemo as Yn,useState as wt}from"react";import{acceptedIssuers as An,acceptedTypesFor as vt,laneCountries as Fn,laneOptionsFor as Dn,optionNameFor as Mn}from"@sekyro/web";import{useContext as Hn,useEffect as nt,useMemo as No,useState as Ct}from"react";import{jsx as K,jsxs as Ne}from"react/jsx-runtime";var _o=220;function Un(e,t,n=[],r){let a=null;try{a=new Intl.DisplayNames([e],{type:"region"})}catch{}let s=t.map(u=>({code:u,name:a?.of(u)??u})),o=new Intl.Collator(e),c=i(u=>{if(u===r)return-1;let p=n.indexOf(u);return p<0?n.length:p},"rank");return s.sort((u,p)=>c(u.code)-c(p.code)||o.compare(u.name,p.name))}i(Un,"countryNames");function Po({step:e,i18n:t,issuer:n,onPicked:r,ageStepUp:a=!1}){let{t:s,locale:o}=t,c=e.context.switchable,u=No(()=>[...new Set([...An(e.documents),...Fn(c)])].sort(),[e.documents,c]),p=i(h=>c===void 0||h===null||e.chooseOption===void 0?[]:Dn(c,h).methods,"methodsOf"),y=No(()=>Un(o,u,Object.keys(e.documents.byIssuer??{}),e.detectedCountry),[o,u,e.documents,e.detectedCountry]),g=u.length===1?u[0]:null,[k,m]=Ct(n??g),[f,x]=Ct(null),N=g===null?[]:vt(e.documents,g),T=g!==null&&N.length===1&&p(g).length===0?N[0]:null;nt(()=>{g!==null&&T!==null&&e.selectDocument(g,T)},[g,T]);let E=i((h,W)=>{e.selectDocument(h,W),r?.()},"pick"),O=i(h=>{let W=vt(e.documents,h);W.length===1&&p(h).length===0?E(h,W[0]):m(h)},"chooseIssuer");nt(()=>{if(f===null||k===null)return;let h=setTimeout(()=>E(k,f),_o);return()=>clearTimeout(h)},[f]),Qe(k!==null&&u.length>1&&n===void 0?()=>{m(null),x(null)}:null);let L=Hn(Ze),v=p(k);nt(()=>{L.set(k,v.map(h=>h.id))},[k,v.map(h=>h.id).join()]);let[M,A]=Ct(null);nt(()=>{if(M===null)return;let h=e.chooseOption;if(h===void 0)return;let W=setTimeout(()=>{h.call(e,M).catch(()=>A(null))},_o);return()=>clearTimeout(W)},[M]);let B=f!==null||M!==null;if(T!==null)return null;if(k===null)return Ne("section",{className:"sekyro-step",children:[K(ee,{title:s("doc.countryTitle"),lead:s(a?"doc.ageStepUp":"doc.pickDescription")}),K(jt,{countries:y,label:s("doc.countryLabel"),searchPlaceholder:s("doc.countrySearch"),noMatch:s("doc.noCountryMatch"),onPick:O}),K(te,{children:null})]});let F=vt(e.documents,k);return Ne("section",{className:"sekyro-step",children:[K(ee,{title:s("doc.pickTitle"),lead:s(a&&g!==null?"doc.ageStepUp":"native.doc.holdIt")}),Ne("div",{className:"sekyro-choices",children:[v.map(h=>Ne("button",{type:"button",className:"sekyro-card","data-testid":"sekyro-type-method","aria-pressed":M===h.id,disabled:B&&M!==h.id,onClick:()=>{B||A(h.id)},children:[K("span",{className:"sekyro-card__tile",children:K(H,{name:uo[h.service]??"id"})}),K("span",{className:"sekyro-card__body",children:K("span",{className:"sekyro-card__title",children:Mn(h,k,o)??et(h,t)})}),K("span",{className:"sekyro-radio","aria-hidden":"true"})]},h.id)),F.map(h=>Ne("button",{type:"button",className:"sekyro-card","aria-pressed":f===h,disabled:B&&f!==h,onClick:()=>{B||x(h)},children:[K("span",{className:"sekyro-card__tile",children:K(H,{name:h==="passport"?"passport":"card"})}),Ne("span",{className:"sekyro-card__body",children:[K("span",{className:"sekyro-card__title",children:s(`doc.type.${h}`)}),K("span",{className:"sekyro-card__sub",children:s(`doc.sub.${h}`)})]}),K("span",{className:"sekyro-radio","aria-hidden":"true"})]},h))]}),u.length>1?K("button",{type:"button",className:"sekyro-link",onClick:()=>{m(null),x(null),A(null)},children:s("native.doc.changeCountry")}):null,K(te,{children:null})]})}i(Po,"DocumentPicker");import{jsx as ae,jsxs as Zn}from"react/jsx-runtime";var Wn={load:i(()=>import("../document-capture-view-25EASYV7.js"),"load")};function Nt({step:e,locale:t,strings:n,className:r,liveMrz:a,barcodeAssetBaseUrl:s}){let o=C(t,n),[c,u]=wt(0),[p,y]=wt(null),g=$n(e.documents),k=g.length>1,m=e.issuer!==null&&xo(e.documents,e.issuer).length>1,f=e.documentType===null||e.issuer===null||p!==null,x=g.length===1&&xo(e.documents,g[0]).length===1,[N]=wt(()=>f&&!x),T=e.ageStepUp===!0,E=Yn(()=>zn(()=>Wn.load().then(L=>({default:L.DocumentCaptureView}))),[c]);qn(()=>{Kn()},[]);let O=Zn(P,{tone:"danger",children:[ae("span",{children:o.t("errors.network_error")}),ae(S,{kind:"secondary",onClick:()=>u(L=>L+1),children:o.t("doc.retryCamera")})]});return ae("div",{className:r,children:f?ae(Po,{step:e,i18n:o,ageStepUp:T&&p===null&&N,...p==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>y(null)}):ae(oe,{fallback:O,children:ae(Gn,{fallback:ae("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:ae(E,{step:e,i18n:o,ageLead:T&&!N,liveMrz:e.documentType==="drivers_license"?void 0:a,barcodeAssetBaseUrl:s,...k?{onChangeCountry:i(()=>y("country"),"onChangeCountry")}:{},...m?{onChangeDocument:i(()=>y("document"),"onChangeDocument")}:{}})})},c)})}i(Nt,"DocumentCapture");import{warmPortraitCapture as Qn}from"@sekyro/web";import{Component as Xn,lazy as Io,Suspense as To,useContext as Jn,useEffect as jn,useMemo as Eo,useState as Oo}from"react";import{jsx as R,jsxs as st}from"react/jsx-runtime";var er={load:i(()=>import("../portrait-capture-view-QDUJ36UH.js"),"load")},tr={load:i(()=>import("../portrait-review-view-LW5DBF3L.js"),"load")},Pt=class Pt extends Xn{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(Pt,"LoadBoundary");var rt=Pt;function or({step:e,i18n:t}){let{t:n}=t,r=Se();return st("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[R("h2",{ref:r,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?st(P,{tone:"danger",children:[R("span",{children:n("portrait.uploadFailed")}),R(S,{kind:"secondary",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")})]})}i(or,"MatchPhase");function _t({step:e,locale:t,strings:n,className:r,assetBaseUrl:a,verification:s}){let o=C(t,n),c=Gt(s),u=Jn(Je),[p,y]=Oo(0),[g,k]=Oo(null),m=Eo(()=>Io(()=>er.load().then(A=>({default:A.PortraitCaptureView}))),[p]),f=Eo(()=>Io(()=>tr.load().then(A=>({default:A.PortraitScreens}))),[p]),x=typeof e.uploadPortrait=="function",N=x?e.photo?.source??"camera":"camera",T=x&&N!=="camera"&&e.photo?.uploadOffered===!0,E=N!=="upload",O=N==="upload"?"upload":N==="choice"?g??e.photo?.pick??"source":"camera",L=e.phase==="capture"&&e.photo?.cameraOnPhone===!0;if(jn(()=>{e.phase==="capture"&&O==="camera"&&!L&&Qn()},[e.phase,O,L]),e.phase==="match")return R("div",{className:r,children:R(or,{step:e,i18n:o})});let v=R("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")});if(u!==null&&(u.busy||u.failed!==null)&&e.phase==="capture"&&O==="camera")return st("section",{className:`sekyro-step${r?` ${r}`:""}`,children:[R(ee,{title:o.t("session.steps.portrait.title")}),R(te,{children:R(S,{kind:"secondary",full:!0,disabled:u.busy,onClick:u.reset,children:o.t("portrait.retryCamera")})})]});if(e.phase==="review"||O!=="camera"||L)return R("div",{className:r,children:R(rt,{fallback:R(S,{kind:"ghost",onClick:()=>y(A=>A+1),children:o.t("common.retry")}),children:R(To,{fallback:v,children:R(f,{screen:e.phase==="review"?"review":L&&O==="camera"?"phone":O==="camera"?"review":O,step:e,i18n:o,...E?{onCamera:i(()=>k("camera"),"onCamera")}:{},onUpload:()=>k("upload"),onDeclined:()=>k(null)})})},p)});if(!c.settled)return R("div",{className:r,children:v});let M=st(P,{tone:"danger",children:[R("span",{children:o.t("errors.network_error")}),R(S,{kind:"secondary",onClick:()=>y(A=>A+1),children:o.t("portrait.retryCamera")})]});return R("div",{className:r,children:R(rt,{fallback:M,children:R(To,{fallback:v,children:R(m,{step:e,i18n:o,...a!==void 0?{assetBaseUrl:a}:{},...T?{onUpload:i(()=>k("upload"),"onUpload")}:{}})})},p)})}i(_t,"PortraitCapture");import{lazy as nr,Suspense as rr,useMemo as sr,useState as ir}from"react";import{jsx as me,jsxs as lr}from"react/jsx-runtime";var ar={load:i(()=>import("../proof-of-address-view-E6WJTTIV.js"),"load")};function xt({step:e,locale:t,strings:n,className:r}){let a=C(t,n),[s,o]=ir(0),c=sr(()=>nr(()=>ar.load().then(p=>({default:p.ProofOfAddressView}))),[s]),u=lr(P,{tone:"danger",children:[me("span",{children:a.t("errors.network_error")}),me(S,{kind:"secondary",onClick:()=>o(p=>p+1),children:a.t("common.retry")})]});return me("div",{className:r,children:me(oe,{fallback:u,children:me(rr,{fallback:me("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:a.t("common.loading")}),children:me(c,{step:e,i18n:a})})},s)})}i(xt,"ProofOfAddress");import{lazy as cr,Suspense as ur,useMemo as dr,useState as pr}from"react";import{jsx as fe,jsxs as fr}from"react/jsx-runtime";var mr={load:i(()=>import("../form-view-4NKEHYNF.js"),"load")};function It({step:e,locale:t,strings:n,className:r,onError:a}){let s=C(t,n),[o,c]=pr(0),u=dr(()=>cr(()=>mr.load().then(y=>({default:y.FormView}))),[o]),p=fr(P,{tone:"danger",children:[fe("span",{children:s.t("errors.network_error")}),fe(S,{kind:"secondary",onClick:()=>c(y=>y+1),children:s.t("common.retry")})]});return fe("div",{className:r,children:fe(oe,{fallback:p,children:fe(ur,{fallback:fe("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:fe(u,{step:e,i18n:s,...a!==void 0?{onError:a}:{}})})},o)})}i(It,"FormStep");import{cameraUnavailableCauseOf as Vr}from"@sekyro/web";import{useCallback as ne,useContext as Ar,useEffect as $e,useId as Fr,useMemo as Ft,useRef as re,useState as Q}from"react";var Tt={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 Me={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"}}},yr=["danger","success","warning","info"];function Et(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}i(Et,"channel");function Ro(e){let t=Et(parseInt(e.slice(1,3),16)),n=Et(parseInt(e.slice(3,5),16)),r=Et(parseInt(e.slice(5,7),16));return .2126*t+.7152*n+.0722*r}i(Ro,"luminance");function gr(e,t){let n=Ro(e),r=Ro(t),a=Math.max(n,r),s=Math.min(n,r);return(a+.05)/(s+.05)}i(gr,"contrastRatio");function Lo(e,t){return Math.min(...yr.map(n=>gr(Me[e][n].fg,t)))}i(Lo,"worstAgainst");function Bo(e,t,n){return Math.min(Lo(e,t),Lo(e,n))}i(Bo,"worstStatusContrast");function Vo(e,t){return Bo("light",e,t)>=Bo("dark",e,t)?"light":"dark"}i(Vo,"statusSchemeFor");import{useRef as Sr,useState as br}from"react";import{useEffect as kr,useId as hr,useRef as Ot}from"react";import{jsx as _e,jsxs as Ao}from"react/jsx-runtime";function it({open:e,title:t,closeLabel:n,onClose:r,children:a,actions:s,role:o,testId:c,returnFocus:u}){let p=Ot(null),y=Ot(null),g=Ot(!1),k=hr();return kr(()=>{let m=p.current;if(m!==null){if(e&&!m.open?(y.current=typeof document>"u"?null:document.activeElement,typeof m.showModal=="function"?m.showModal():m.setAttribute("open","")):!e&&m.open&&(typeof m.close=="function"?m.close():m.removeAttribute("open")),!e&&g.current){let f=u?.current??(y.current instanceof HTMLElement?y.current:null);y.current=null,f?.focus()}g.current=e}},[e,u]),_e("dialog",{ref:p,className:"sekyro-dialog","aria-labelledby":k,...o==="alertdialog"?{role:o}:{},"data-testid":c,onCancel:m=>{m.preventDefault(),r()},onClick:m=>{m.target===m.currentTarget&&r()},children:Ao("div",{className:"sekyro-dialog__panel",children:[Ao("div",{className:"sekyro-dialog__head",children:[_e("h2",{id:k,className:"sekyro-dialog__title",children:t}),n!==void 0?_e("button",{type:"button",className:"sekyro-disc sekyro-dialog__close","aria-label":n,onClick:r,children:_e(H,{name:"close"})}):null]}),a!==void 0?_e("div",{className:"sekyro-dialog__body",children:a}):null,s!==void 0?_e("div",{className:"sekyro-dialog__actions",children:s}):null]})})}i(it,"FlowDialog");import{jsx as He,jsxs as Fo}from"react/jsx-runtime";var vr=["intro","data","processing","sharing","retention"];function Do({i18n:e,purpose:t="identity"}){let{t:n}=e,[r,a]=br(!1),s=Sr(null),[o,c=""]=n("consent.short").split("{terms}");return Fo("div",{className:"sekyro-consent","data-testid":"sekyro-consent",children:[Fo("p",{className:"sekyro-consent__line",children:[o,He("button",{ref:s,type:"button",className:"sekyro-link sekyro-link--inline","aria-haspopup":"dialog",onClick:()=>a(!0),children:n("consent.termsLink")}),c]}),He(it,{open:r,title:n("consent.termsTitle"),closeLabel:n("native.close"),onClose:()=>a(!1),returnFocus:s,testId:"sekyro-consent-terms",children:He("div",{className:"sekyro-stack sekyro-stack--3",children:t==="human"?He(V,{view:"HumanConsentTerms",i18n:e,quiet:!0}):vr.map(u=>He("p",{children:n(`consent.terms.${u}`)},u))})})]})}i(Do,"ConsentNotice");function Mo(e){let t=e.trim().split(/\s+/).filter(r=>r!=="");return(t.length>=2?[t[0],t[1]].map(r=>Array.from(r??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}i(Mo,"initials");import{useSyncExternalStore as Cr}from"react";var $o=i(e=>({colors:{...e?q.dark:q.light},radius:q.radius,fontFamily:q.font}),"brandTheme"),ua=$o(!1),Ho=/^#[0-9a-f]{6}$/i;function Rt(e,t,n){if(t)return null;let r=dt(e).colors,a=n?.colors?.bg??r?.bg,s=n?.colors?.surface??r?.surface;return a===void 0&&s===void 0||a!==void 0&&!Ho.test(a)||s!==void 0&&!Ho.test(s)?null:Vo(a??q.light.bg,s??q.light.surface)}i(Rt,"partnerStatusScheme");function at(e,t,n){let r=dt(e);if(n&&r.colors!==void 0){let{brand:a,brandFg:s}=r.colors;a!==void 0&&Pr(a,q.dark.bg)>=3?r.colors={brand:a,ring:a,...s!==void 0?{brandFg:s}:{}}:delete r.colors}if(Rt(e,n,t)==="dark"){let a=Me.dark;r.colors={...r.colors,danger:a.danger.base,success:a.success.base,warning:a.warning.fg}}return We($o(n),r,Yt(t))}i(at,"verificationTheme");function lt(e){let t=Cr(_r,Nr,()=>!1);return e==="dark"||e==="system"&&t}i(lt,"useDarkScheme");var wr="(prefers-color-scheme: dark)",Ko=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(wr):null,"media"),Nr=i(()=>Ko()?.matches??!1,"prefersDark");function _r(e){let t=Ko();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i(_r,"subscribe");function Pr(e,t){let[n,r]=[Uo(e),Uo(t)];return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}i(Pr,"contrast");function Uo(e){let t=[1,3,5].map(n=>{let r=Number.parseInt(e.slice(n,n+2),16)/255;return r<=.03928?r/12.92:((r+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}i(Uo,"luminance");var Lt="sekyro.testerGate";function Bt(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}i(Bt,"store");function zo(e=Date.now()){try{Bt()?.setItem(Lt,String(e))}catch{}}i(zo,"rememberTester");function Go(e=Date.now()){try{let t=Number(Bt()?.getItem(Lt)??"");return Number.isFinite(t)&&t>0&&e-t<2592e6}catch{return!1}}i(Go,"rememberedTester");function qo(){try{Bt()?.removeItem(Lt)}catch{}}i(qo,"forgetTester");import{useEffect as xr,useId as Ir,useState as Tr}from"react";import{jsx as D,jsxs as ye}from"react/jsx-runtime";var Yo=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]),Er={review:{icon:"pending",tone:"info"},cooldown:{icon:"timer",tone:"info"},rejected:{icon:"close",tone:"neutral"},policy:{icon:"close",tone:"neutral"},inconclusive:{icon:"warning",tone:"neutral"},unavailable:{icon:"timer",tone:"neutral"},expired:{icon:"timer",tone:"neutral"}};function Or({screen:e}){if(e==="verified")return ye("svg",{className:"sekyro-outcome sekyro-outcome--approved",viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[D("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"54",pathLength:"1"}),D("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),D("path",{className:"sekyro-outcome__glyph",d:"M6.5 12.5l3.6 3.6 7.4-8.2",pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]});let{icon:t,tone:n}=Er[e];return D("span",{className:`sekyro-tile sekyro-tile--${n} sekyro-outcome-tile`,"aria-hidden":"true","data-screen":e,children:D(H,{name:t})})}i(Or,"OutcomeMark");function Rr({label:e,id:t,copied:n}){let[r,a]=Tr(!1);return xr(()=>{if(!r)return;let s=setTimeout(()=>a(!1),1600);return()=>clearTimeout(s)},[r]),ye("button",{type:"button",className:`sekyro-reference${r?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[D("span",{"aria-live":"polite",children:r?n:e}),D("bdi",{dir:"ltr",children:t}),D(H,{name:"copy"})]})}i(Rr,"ReferenceLine");function Lr({step:e,t}){let n=e.context.sandbox?e.context.simulation?.reason:void 0;return n===void 0?null:ye(Fe,{tone:"warning",role:"status",testId:"sekyro-simulated-notice",children:[D("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:D(H,{name:"info"})}),ye("div",{className:"sekyro-notice__body","data-reason":n,children:[D("strong",{children:t("sandbox.simulatedTitle")}),D("span",{children:t(n==="no_testers"?"sandbox.simulatedNoTesters":"sandbox.simulatedGate")})]})]})}i(Lr,"SimulationNotice");function Br(e,t){return e==="expired"?"native.result.expiredTitle":e!=="verified"?`session.result.${e}.title`:t.level===3?"session.result.verified.title":t.level===1&&t.assurance==="contact_phone"?"session.result.verified.titlePhone":t.level===1&&t.assurance==="contact_email"?"session.result.verified.titleEmail":t.level===1?"session.result.verified.titleContact":"session.result.verified.titleHuman"}i(Br,"resultTitleKey");function Vt({step:e,locale:t,strings:n,className:r,onClose:a}){let s=C(t,n),{t:o}=s,c=Ir(),u=Se(),p=e.context.orgName,y=e.reasonCode??"",g=e.display==="platform_unsupported"?"policy":e.display,k=i(f=>(p!==""||f==="verified")&&f!=="cooldown"?o(`native.result.${f}`,{org:p}):o(`session.result.${f}.description`),"partnerLine"),m;switch(e.display){case"rejected":y==="identity_not_verified"?m=p!==""?o("reasons.identity_not_verified",{org:p}):o("session.result.identityNotVerified"):m=Yo.has(ct(y))?o("session.result.detailsMismatch",{org:p}):k("rejected");break;case"policy":{if(Yo.has(ct(y)))m=o("session.result.detailsMismatch",{org:p});else if(y==="device_velocity_exceeded")m=o("session.result.deviceVelocity",{org:p});else if(y==="capture_tampered")m=o("session.result.deviceStop");else if(y==="camera_unavailable")m=o("reasons.camera_unavailable",{org:p});else if(y==="underage_estimated")m=o("reasons.underage_estimated");else if(y==="starter_credit_claimed")m=o("reasons.starter_credit_claimed");else if(y==="blocked_by_org")m=o("reasons.blocked_by_org");else{let f=y===""?null:Ht(y);m=f!==null?o(f,{org:p}):k("policy")}break}case"cooldown":{let f=Ut(s.locale,e.retryAfter);m=f!==null?o(f.key,{time:f.time}):o("session.result.cooldown.description");break}case"platform_unsupported":m=o("result.platform_unsupported");break;default:m=k(g)}return ye("section",{className:`sekyro-result${r?` ${r}`:""}`,"aria-labelledby":c,"data-testid":"sekyro-result",children:[ye("div",{className:"sekyro-result__body",children:[D(Or,{screen:g}),ye("div",{className:"sekyro-heading",children:[D("h2",{id:c,ref:u,tabIndex:-1,className:"sekyro-text-body",children:o(Br(g,e.result))}),D("p",{className:"sekyro-text-muted",children:m})]}),D(Lr,{step:e,t:o}),D(Rr,{label:o("result.referenceLabel"),id:e.context.sessionId,copied:o("native.result.copied")})]}),a!==void 0?D("div",{className:"sekyro-actions",children:D(S,{full:!0,onClick:a,children:o("native.result.continue",{org:p})})}):null]})}i(Vt,"VerificationResultScreen");import{Fragment as Ue,jsx as l,jsxs as X}from"react/jsx-runtime";function Dr(e,t,n){let r=t?q.dark:q.light,a=t?q.roles.dark:q.roles.light,s=e.colors??{},o={},c=s.fg===r.fg&&s.surface===r.surface;s.brand===r.brand&&s.surface===r.surface&&(o["--sekyro-color-brand-soft"]=a.brandSoft),c&&(o["--sekyro-color-line"]=a.line,o["--sekyro-color-line-subtle"]=a.lineSubtle,o["--sekyro-color-line-strong"]=a.lineStrong,o["--sekyro-color-sunken"]=a.sunken),s.fgMuted===r.fgMuted&&s.surface===r.surface&&(o["--sekyro-color-fg-subtle"]=a.fgSubtle),e.fontFamily===q.font&&(o["--sekyro-font-display"]=q.fontDisplay);let u=t?Tt.dark:Tt.light;if(o["--sekyro-color-success-soft"]=u.successSoft,o["--sekyro-color-success-fg"]=u.successFg,o["--sekyro-color-on-success"]=u.onSuccess,o["--sekyro-color-warning-soft"]=u.warningSoft,o["--sekyro-color-warning-fg"]=u.warningFg,o["--sekyro-color-danger-soft"]=u.dangerSoft,o["--sekyro-color-danger-fg"]=u.dangerFg,o["--sekyro-color-on-danger"]=u.onDanger,o["--sekyro-color-info-soft"]=u.infoSoft,o["--sekyro-color-info-fg"]=u.infoFg,s.brand===r.brand&&(o["--sekyro-color-line-brand"]=u.lineBrand),n!==null){let p=Me[n];for(let y of["danger","success","warning","info"])o[`--sekyro-color-${y}-soft`]=p[y].soft,o[`--sekyro-color-${y}-fg`]=p[y].fg;o["--sekyro-color-on-success"]=p.success.on,o["--sekyro-color-on-danger"]=p.danger.on}return o}i(Dr,"flowRoles");function Dt(e){let{verification:t,locale:n,strings:r,onStep:a,onResult:s}=e,{step:o,error:c}=ft(t);$e(()=>{o!==null&&a?.(o)},[o,a]),$e(()=>s===void 0?void 0:t.on("result",s),[t,s]);let u=lt(e.colorScheme??"light"),p=o?.context.branding,y=at(p,e.theme,u),[g,k]=Q(!1),m=`sekyro-verification${u?" sekyro-verification--dark":""}${g?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,f=re(e.onClose);f.current=e.onClose;let x=re(o);x.current=o;let N=ne(()=>{let v=x.current;f.current?.(v?.kind==="result"?{reason:"finished",result:v.result}:{reason:"cancelled"})},[]),[T,E]=Q(null),O=ne(()=>{let v=x.current;v!==null&&v.kind!=="result"&&v.context.consentRecorded?E("close"):N()},[N]),L=Ft(()=>t.reportCaptureIssue===void 0?null:v=>t.reportCaptureIssue?.(v),[t]);return l(Zt,{theme:y,className:m,children:l(De,{locale:n,...r!==void 0?{strings:r}:{},children:l("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:Dr(y,u,Rt(p,u,e.theme)),children:l(ro.Provider,{value:k,children:l(pt.Provider,{value:e.onClose!==void 0?N:void 0,children:l(Xe.Provider,{value:e.onClose!==void 0?O:void 0,children:X(Kt.Provider,{value:L,children:[l(zr,{...e,step:o,error:c,immersive:g,onLeaveAsk:()=>E("history"),onClosed:N}),l(Ur,{open:T!==null,onStay:()=>{T==="history"&&At(),E(null)},onLeave:()=>{let v=T;E(null),v==="close"||e.onClose!==void 0?N():typeof window<"u"&&Xo()}})]})})})})})})})}i(Dt,"SekyroVerification");function Mr(e,t){if(t===void 0||t==="aml_screening")return null;let n=e,r=n[`session.processing.${t}.title`],a=n[`session.processing.${t}.description`];return typeof r=="string"&&r!==""&&typeof a=="string"&&a!==""?{title:r,description:a}:null}i(Mr,"processingCopyOf");function Hr({error:e,retry:t}){let{t:n}=C(),r=Se();return X(Fe,{tone:"danger",testId:"sekyro-error-notice",children:[l("span",{children:n(Mt(e))}),e.retryable?l(S,{ref:r,kind:"secondary",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}i(Hr,"CameraErrorNotice");var Zo="sekyroFlow";function Qo(){let e=window.history.state;return typeof e=="object"&&e!==null&&e[Zo]===!0}i(Qo,"onGuard");function At(){if(typeof window>"u"||Qo())return;let e=window.history.state;window.history.pushState({...typeof e=="object"&&e!==null?e:{},[Zo]:!0},"")}i(At,"pushGuard");function Xo(){window.history.back()}i(Xo,"leaveHistory");function Ur({open:e,onStay:t,onLeave:n}){let{t:r}=C();return l(it,{open:e,role:"alertdialog",title:r("leave.title"),onClose:t,testId:"sekyro-leave",actions:X(Ue,{children:[l(S,{full:!0,onClick:t,children:r("leave.stay")}),l(S,{full:!0,kind:"danger",onClick:n,children:r("leave.confirm")})]}),children:l("p",{className:"sekyro-text-muted",children:r("leave.body")})})}i(Ur,"LeaveDialog");function $r(e,t){let[n,r]=Q(!1),[a,s]=Q(null),o=e===null?void 0:e.skipCapture,c=re(o);c.current=o;let u=re(!1),p=e?.key;$e(()=>s(null),[p]);let y=ne(()=>{if(u.current)return;let f=c.current;f!==void 0&&(u.current=!0,r(!0),s(null),f().catch(x=>s(t.t(pe(x,t.strings)))).finally(()=>{u.current=!1,r(!1)}))},[t]),g=ne(()=>s(null),[]),k=o!==void 0,m=t.t("sandbox.skipCapture");return Ft(()=>k?{label:m,busy:n,failed:a,run:y,reset:g}:null,[k,m,n,a,y,g])}i($r,"useSkipCapture");function Kr({skip:e}){return X(Ue,{children:[e.failed!==null?l(P,{tone:"danger",children:l("span",{children:e.failed})}):null,l(S,{kind:"ghost",full:!0,disabled:e.busy,"aria-busy":e.busy||void 0,onClick:e.run,"data-testid":"sekyro-skip-capture",children:e.label})]})}i(Kr,"SkipAction");function zr(e){let{step:t,error:n,slots:r,immersive:a}=e,s=C(),{t:o}=s,[c,u]=Q(!1),[p,y]=Q([]),g=ne(d=>(y(_=>[..._,d]),()=>y(_=>_.filter(G=>G!==d))),[]),[k,m]=Q(null),f=ne(d=>m(()=>d),[]),[x,N]=Q(0),[T,E]=Q(null),[O,L]=Q(null),v=$r(t,s),M=t?.context.testerGate!==void 0,[A,B]=Q(!1),F=re(null);$e(()=>{!M||F.current!==null||(F.current=Go(),F.current&&B(!0))},[M]);let h=t?.context.purpose??"identity",W=t?.context.returning===!0,xe=e.verification,Ke=h==="human"||t?.context.cameraUnavailableHandled===!0,J=xe.reportCameraUnavailable!==void 0&&Ke?d=>xe.reportCameraUnavailable?.(d)??Promise.resolve():void 0,Ie=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,se=e.handoffUrl,ze=re({last:null,count:0}),Y=ne((d,_,G=!1)=>J===void 0&&_!=="denied"?void 0:l(V,{view:"NoCameraView",i18n:s,quiet:!0,cause:_,onRetry:d,repeated:G,...Ie&&J!==void 0?{onContinue:J}:{},...se!==void 0?{handoffUrl:se}:{}}),[s,xe,Ke,Ie,se]),ge=Ft(()=>mo(t),[t]),ie=ne((d,_)=>l(fo,{start:d,context:_,human:h==="human",returning:W,notice:_.permissionSettled&&_.permission==="denied"?Y(d,"denied"):void 0,...ge!==void 0?{retry:ge}:{}}),[h,W,Y,ge]),ke=ne((d,_)=>{let G=Vr(d.kind),Ye=ze.current;d.kind==="permission"&&d!==Ye.last&&(Ye.last=d,Ye.count+=1);let jo=d.kind==="permission"&&Ye.count>1;return(G!==void 0?Y(_,G,jo):void 0)??X(Ue,{children:[l(Hr,{error:d,retry:_}),G!==void 0&&se!==void 0?l(V,{view:"DesktopHandoffView",i18n:s,quiet:!0,url:se}):null]})},[Y,se,s]),Te=re(""),Ee=e.livenessProps?.slots?.stageOverlay,Oe=ne(d=>(d.guidance!==""&&!d.coached&&(Te.current=d.guidance),l(go,{testId:"sekyro-capture-stage",video:l("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.settled?o("capture.checkingTitle"):d.guidance!==""?d.guidance:Te.current,note:d.note,status:d.status,busy:d.settled,progress:d.phase==="seeking"||d.phase==="aligning"?d.progress:1,still:d.still,live:d.live,closeLabel:o("native.close"),overlay:Ee?.(d.videoRef),ramp:d.ramp?.colour??null,...d.settled?{}:{onClose:i(()=>N(_=>_+1),"onClose")},end:d.modeSwitch!=null?l($t,{view:d.modeSwitch,className:"sekyro-glass sekyro-glass--label"}):null,children:d.settled||!d.live?null:l(so,{onStop:()=>N(_=>_+1)})})),[o,Ee]),Re=Fr(),le=t,ce=t!==null&&T===t.key&&t.context.switchable!==void 0,ue=k??(t===null||t.kind==="result"?null:ce?()=>E(null):t.context.switchable!==void 0&&typeof le?.chooseOption=="function"?()=>E(t.key):null),Le=re(ue);Le.current=ue;let Be=re(t);Be.current=t;let j=re({ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0});j.current={ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0};let Ve=e.backNavigation==="history";if($e(()=>{if(!Ve||typeof window>"u")return;At();let d=i(()=>{if(Qo())return;let _=Be.current,G=Le.current;G!==null?(G(),At()):_?.kind!=="result"&&_?.context.consentRecorded===!0?j.current.ask():j.current.hostClose?j.current.closed():Xo()},"onPop");return window.addEventListener("popstate",d),()=>window.removeEventListener("popstate",d)},[Ve]),n!==null)return l(Fe,{tone:"danger",children:l("span",{children:o(pe(n,s.strings))})});if(t===null)return X("div",{className:"sekyro-skeleton",role:"status","aria-busy":"true",children:[l("span",{className:"sekyro-visually-hidden",children:o("common.loading")}),l("span",{className:"sekyro-skeleton__bar is-title"}),l("span",{className:"sekyro-skeleton__bar"}),l("span",{className:"sekyro-skeleton__bar is-short"}),l("span",{className:"sekyro-skeleton__bar is-block"})]});let{context:z}=t,Ge=i(d=>{u(!0),d().finally(()=>u(!1))},"refresh"),qe=r?.header??l(Yr,{context:z,headerId:Re,end:r?.headerEnd,...ue!==null?{onBack:ue}:{}}),I,de=ce;if(A&&e.verification.testerGate!==void 0)I=l(ut.Provider,{value:Oe,children:l(V,{view:"TesterGateView",i18n:s,verification:e.verification,attemptsLeft:z.testerGate?.attemptsLeft??0,livenessProps:{...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:e.livenessProps?.slots?.intro??ie},locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice},onBound:()=>zo(),onDone:d=>{d&&qo(),B(!1)}})});else if(de)I=l(V,{view:"LaneChoiceView",i18n:s,step:t,onClose:()=>E(null)});else switch(t.kind){case"phone_otp":I=l(yt,{step:t});break;case"email_otp":I=l(gt,{step:t});break;case"method":I=l(St,{step:t});break;case"registry":I=l(ot,{step:t});break;case"document":I=l(Nt,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{},...e.documentBarcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:e.documentBarcodeAssetBaseUrl}:{}});break;case"liveness":{let d=e.livenessProps?.slots?.intro,_={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??ie,...d===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:ke}:{}},...x>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};I=l(ut.Provider,{value:Oe,children:t.instructions==="icao"||t.livePhoto?.icao===!0?l(V,{view:"LivePhotoLiveness",i18n:s,step:t,livenessProps:_,sekyroIntro:d===void 0},x):l(qt,{..._},x)});break}case"portrait":I=X(Ue,{children:[t.retakeOnly?l(V,{view:"PortraitRetakeNotice",i18n:s,quiet:!0}):null,l(_t,{step:t,verification:e.verification,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"proof_of_address":I=l(xt,{step:t});break;case"form":I=l(It,{step:t});break;case"contact_choice":I=l(V,{view:"ContactChoiceView",i18n:s,step:t});break;case"choice":I=l(V,{view:"GenericChoiceView",i18n:s,step:t});break;case"identity_summary":I=l(V,{view:"IdentitySummaryView",i18n:s,step:t});break;case"mobile_required":{let d=t.checkType==="doc_ocr"?o("handoff.lead.document"):t.checkType==="portrait_icao"?o("handoff.lead.portrait"):t.checkType==="poa"?o("handoff.lead.poa"):void 0;I=e.handoffUrl!==void 0?l(V,{view:"HandoffView",i18n:s,url:e.handoffUrl,refresh:t.refresh,...d!==void 0?{lead:d}:{}}):l(tt,{tone:"brand",icon:"smartphone",title:o("handoff.title"),actions:l(S,{kind:"secondary",full:!0,disabled:c,onClick:()=>Ge(t.refresh),children:o("common.refresh")}),children:l("p",{children:d??o("reasons.mobile_required")})});break}case"native_app_required":I=l(V,{view:"NativeAppView",i18n:s,org:z.orgName,nativeApp:t.nativeApp,...e.handoffUrl!==void 0?{fallbackUrl:e.handoffUrl}:{},refresh:t.refresh,footer:l(Wo,{org:z.orgName})});break;case"processing":{let d=Mr(s.strings,t.service);I=l(tt,{tone:"brand",icon:"pending",busy:!t.stalled,live:!0,title:d?.title??o("session.processing.title"),actions:t.stalled?l(S,{kind:"secondary",full:!0,disabled:c,onClick:()=>Ge(t.refresh),children:o("common.refresh")}):null,children:l("p",{children:d?.description??o("session.processing.description")})});break}case"eid":I=l(kt,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";I=l(tt,{tone:"neutral",icon:"smartphone",title:o(d?"needsApp.title":"unsupported.title"),actions:l(Wo,{org:z.orgName}),children:l("p",{children:d?z.orgName!==""?o("needsApp.description",{org:z.orgName}):o("needsApp.descriptionNoOrg"):o("unsupported.description",{org:z.orgName})})});break}case"result":I=r?.result?.(t)??l(Gr,{step:t});break;default:{let d=t;I=null}}let w=!a&&!z.consentRecorded&&t.kind!=="result"?l(Do,{i18n:s,purpose:z.purpose}):null,$=v!==null&&!a&&!de&&!A?l(Kr,{skip:v}):null,he=M&&!A&&!a&&!de&&e.verification.testerGate!==void 0?l(V,{view:"TesterGateAction",i18n:s,quiet:!0,onOpen:()=>B(!0)}):null,Ae=$===null&&he===null?w:X(Ue,{children:[he,$,w]});return l(Ze.Provider,{value:{issuer:O?.key===t.key?O.issuer:null,listed:O?.key===t.key?O.listed:[],set:i((d,_=[])=>L(G=>G?.key===t.key&&G.issuer===d&&G.listed.join()===_.join()?G:{key:t.key,issuer:d,listed:_}),"set")},children:l(no.Provider,{value:f,children:l(Je.Provider,{value:v,children:l(yo.Provider,{value:e.handoffUrl,children:X(oo.Provider,{value:Ae===null?null:{node:Ae,owner:p[0]??null,claim:g},children:[a?null:qe,!a&&t.kind!=="result"&&z.sections.length>1?l(Wr,{context:z,current:t.section,i18n:s}):null,l(ao,{pageKey:t.key,children:I}),!a&&!de&&t.kind!=="result"&&t.context.switchable!==void 0?l(V,{view:"LaneSwitch",i18n:s,step:t,onOpen:()=>E(t.key),quiet:!0},t.key):null,p.length===0?Ae:null,a?null:r?.footer!==void 0?r.footer:z.branding?.hideAttribution===!0?null:X("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[l(H,{name:"lock"}),o("shell.verifiedBy")]})]})})})})})}i(zr,"Body");function Wo({org:e}){let{t}=C(),n=Ar(pt);return n===void 0?null:l(S,{full:!0,onClick:n,children:t("native.result.continue",{org:e})})}i(Wo,"BackToOrg");function Gr({step:e}){return l(Xe.Consumer,{children:t=>l(Vt,{step:e,...t!==void 0?{onClose:t}:{}})})}i(Gr,"ResultPage");function qr(e){let t=e.levelName??e.purpose;return t==="contact"?"shell.subtitleContact":t==="human"?"shell.subtitleHuman":"shell.subtitle"}i(qr,"subtitleKeyOf");function Yr({context:e,headerId:t,end:n,onBack:r}){let{t:a}=C(),[s,o]=Q(!1),c=s?void 0:e.branding?.logoUrl,u=e.orgName!==""?e.orgName:a(e.returning?"returning.heading":"session.title");return l("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:X("div",{className:"sekyro-org",children:[r!==void 0?l("button",{type:"button",className:"sekyro-disc sekyro-org__back","aria-label":a("common.back"),onClick:r,"data-testid":"sekyro-back",children:l(H,{name:"back"})}):null,l("span",{className:"sekyro-org__tile","aria-hidden":"true",children:c!==void 0?l("img",{className:"sekyro-org__logo",src:c,alt:"",onError:()=>o(!0)}):Mo(e.orgName)}),X("div",{className:"sekyro-org__text",children:[l("h1",{id:t,className:"sekyro-org__name",children:u}),l("p",{className:"sekyro-org__sub",children:a(qr(e))})]}),e.sandbox?l("span",{className:"sekyro-sandbox-badge","data-testid":"sekyro-sandbox-badge",children:a("app.sandboxBadge")}):null,n!=null?l("div",{className:"sekyro-org__end",children:n}):null,l(Xe.Consumer,{children:p=>p!==void 0?l("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":a("native.close"),onClick:p,children:l(H,{name:"close"})}):null})]})})}i(Yr,"OrgHeader");function Wr({context:e,current:t,i18n:n}){let r=t===null?-1:e.sections.indexOf(t),a=e.progress,s=a!==void 0&&a.length===e.sections.length?a:e.sections.map((o,c)=>({id:o,state:c<r?"done":c===r?"current":"upcoming"}));return l("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:s.map(({id:o,state:c})=>l("li",{className:`sekyro-progress__bar${c==="done"?" is-done":c==="current"?" is-current":""}`,...c==="current"?{"aria-current":"step"}:{},children:l("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${o}`]??o})},o))})}i(Wr,"SectionProgress");import{useEffect as Zr,useState as Jo}from"react";import{jsx as Pe}from"react/jsx-runtime";function Qr(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i(Qr,"pageUrl");function Xr({hostedUrl:e,inAppBrowser:t,...n}){let[r,a]=Jo(t===!0);Zr(()=>{t===void 0&&mt()&&a(!0)},[t]);let[s,o]=Jo(!1),c=lt(n.colorScheme??"light"),u=n.handoffUrl??e??Qr();return r&&!s?Pe(Wt,{theme:We(at(void 0,void 0,c),n.theme),className:`sekyro-verification${c?" sekyro-verification--dark":""}${n.className!==void 0?` ${n.className}`:""}`,children:Pe(De,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:Pe("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-flow",children:Pe(Jr,{url:u,onContinue:()=>o(!0)})})})}):Pe(Dt,{...n,...u!==""?{handoffUrl:u}:{}})}i(Xr,"SekyroFlow");function Jr({url:e,onContinue:t}){let n=C();return Pe(V,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}i(Jr,"Prompt");export{Nt as DocumentCapture,kt as EidStep,gt as EmailOtpStep,It as FormStep,ot as IdNumberEntry,St as MethodChoice,Bn as NniEntry,yt as PhoneOtpStep,_t as PortraitCapture,xt as ProofOfAddress,Xr as SekyroFlow,Dt as SekyroVerification,De as StepI18nProvider,Vt as VerificationResultScreen,on as arSteps,nn as enSteps,sn as formatTemplate,rn as frSteps,mt as isInAppBrowser,en as loadSekyroLocale,an as resolveSekyroStrings,tn as retakeHintStringKey,C as useStepI18n,ft as useVerificationStep};
|
|
2
|
+
import{a as go}from"../chunk-PUID2LKA.js";import{a as oe,b as V,c as yo}from"../chunk-EJV7N22H.js";import{a as Jt,b as jt,d as eo,e as to}from"../chunk-ZARKJW2C.js";import{a as q,d as Yt,e as dt,f as We,g as Wt,h as Zt}from"../chunk-DUJHBDLD.js";import{a as Qt,b as Xt,c as lo}from"../chunk-GUTF3SPK.js";import{a as co,b as uo,c as et,d as po,e as mo,f as fo,g as mt}from"../chunk-AN74BL27.js";import{a as tt}from"../chunk-U4X4OLJV.js";import{d as ut,f as zt,g as Gt,j as qt}from"../chunk-5NAOIKDI.js";import{b as $t}from"../chunk-E3RFBNKZ.js";import{a as Kt}from"../chunk-7MMT5M4E.js";import{a as pe}from"../chunk-A7C3KQ7K.js";import{a as on,b as nn,c as rn,d as sn,e as an,f as De,g as C}from"../chunk-KKSEGXMM.js";import{a as H,b as ee,c as oo,d as te,e as Ze,f as no,g as Qe,h as Xe,i as pt,j as ro,l as Je,m as so,n as io,p as ao,q as P,r as je}from"../chunk-6LBVEW6H.js";import"../chunk-NNCBKWTI.js";import{a as S,c as ct,j as en,l as tn,n as Mt,o as Ht,p as Ut,r as Fe,s as Se}from"../chunk-BB5BRNVU.js";import{a as i}from"../chunk-2KED7D2Q.js";import{useEffect as ln,useState as ko}from"react";function ft(e){let[t,n]=ko(()=>e?.currentStep?.()??null),[r,a]=ko(null);return ln(()=>{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 s=!0,o=e.on("step",c=>{s&&n(c)});return e.run().then(c=>{s&&n(u=>u??c)},c=>{s&&a(c)}),()=>{s=!1,o()}},[e]),{step:t,error:r}}i(ft,"useVerificationStep");import{useEffect as ho,useId as cn,useMemo as un,useRef as So,useState as be}from"react";import{Fragment as Co,jsx as b,jsxs as Z}from"react/jsx-runtime";var bo=i((e,t,n)=>{if(e===void 0)return 0;let r=Date.parse(e)-t;return Number.isFinite(r)?Math.min(n,Math.max(0,Math.ceil(r/1e3))):0},"secondsUntil"),dn=600,pn=30,mn=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),fn=["whatsapp","sms"],vo=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 yn(e){let t=[];for(let n of e.phoneCountries??["MR"]){let r=e.phoneRules?.find(s=>s.code===n),a=r?.dial??Jt(n);a!==void 0&&!t.some(s=>s.code===n)&&t.push({code:n,dial:`+${a}`,...r!==void 0?{rule:r}:{}})}return t}i(yn,"phoneCountriesOf");function yt({step:e,locale:t,strings:n,className:r,defaultPhone:a,onError:s}){let o=C(t,n),{t:c}=o,u=un(()=>yn(e),[e.phoneCountries,e.phoneRules]),p=a??u[0]?.dial??"",y=e.phoneInternational===!0,g=eo({countries:u,international:y,closed:!!e.phoneRules?.length,defaultPhone:p}),[k,m]=be(""),[f,x]=be(!1),[N,T]=be(null),[E,O]=be(null),[L,v]=be(!1),[M,A]=be(null),B=So(null),F=e.phase==="verify"&&!L,h=e.phase==="verify",W=lo(h),[xe,Ke]=Qt(e.reason==="otp_mismatch",e.attemptsRemaining,()=>m("")),J=cn(),Ie=So(null);ho(()=>{let w=setTimeout(()=>Ie.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(w)},[F]);let se=e.phase==="verify"?e.codeExpiresAt??"sent":null;ho(()=>{se!==null&&(v(!1),B.current!==null&&!vo.has(e.reason??"")&&A(B.current),B.current=null)},[se]);let ze=i(async w=>{x(!0),O(null);try{await w()}catch($){O(pe($,o.strings)),s?.($)}finally{x(!1),T(null)}},"run"),Y=fn.filter(w=>(e.channels??[]).includes(w)),ge=g.typed,ie=!e.needsPhone||ge!==null,ke=i((w,$=!1)=>{let he=e.needsPhone?$?M:{number:ge??g.phone,shown:g.shown}:null;B.current=he,T(w??null),ze(async()=>{try{await e.send({...he!==null?{phone:he.number}:{},...w!==void 0?{channel:w}:{}})}catch(Ae){throw B.current=null,Ae}})},"send"),Te=i(w=>{ze(()=>e.verify(w))},"submitCode"),Ee=i(w=>{w.preventDefault(),F?Te(k):Y.length<=1&&ie&&ke(Y[0])},"onSubmit"),Oe=`${J}-phone`,Re=bo(e.codeExpiresAt,W,dn),le=bo(e.resendAvailableAt,W,pn),ce=F&&e.codeExpiresAt!==void 0&&Re===0,ue=e.needsPhone&&!e.attemptsExhausted,Le=h&&(e.codeExpiresAt===void 0||Re>0),Be=F&&ue?()=>v(!0):L&&Le?()=>v(!1):null;Qe(Be===null?null:f?()=>{}:Be);let j=i(w=>c(w==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),Ve=i(w=>f&&N!==null&&N===w,"busyFor"),[z,Ge]=c("otp.sentTo",{channel:j(e.channel)}).split("{number}"),qe=e.context.simulation?.otpCode,I=e.reason==="otp_mismatch"?Z(P,{tone:"danger",children:[b("span",{children:c("otp.reason_otp_mismatch")}),b("span",{children:je(o,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&vo.has(e.reason)?b(P,{tone:"warning",children:b("span",{children:c(`otp.reason_${e.reason}`)})}):e.reason==="tester_phone_mismatch"?b(P,{tone:"warning",children:b("span",{children:c("reasons.tester_phone_mismatch")})}):null,de=Z(Co,{children:[I,E!==null?b(P,{tone:"danger",children:b("span",{children:c(E)})}):null]});if(F){let w=Y.length===0;return Z("form",{className:`sekyro-step sekyro-otp${r?` ${r}`:""}`,"aria-labelledby":J,onSubmit:Ee,noValidate:!0,children:[b(ee,{id:J,title:c("otp.verifyTitle"),lead:qe!==void 0?b(io,{template:c("sandbox.otpHint"),code:qe}):Z(Co,{children:[z,b("bdi",{dir:"ltr",className:"sekyro-mono",children:M?.shown??e.sentToMasked}),Ge]})}),de,Z("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:`${J}-code`,children:c("otp.codeLabel")}),b(Xt,{id:`${J}-code`,value:k,invalid:xe,onChange:$=>{$!==""&&Ke(),m($),$.length===6&&k.length!==6&&!f&&!e.attemptsExhausted&&Te($)}}),b("span",{className:`sekyro-help sekyro-otp-expiry${ce?" is-danger":""}`,"aria-hidden":!ce||void 0,children:ce?c("otp.expired"):c("otp.expiresIn",{time:mn(Re)})})]}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:ce?c("otp.expired"):""}),Z(te,{children:[b(S,{type:"submit",full:!0,disabled:f||k.length!==6||e.attemptsExhausted,"aria-busy":f||void 0,children:c("otp.verify")}),Z("div",{className:"sekyro-resend-row",children:[w?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:f||le>0,onClick:()=>ke(void 0,!0),children:le>0?c("otp.resendIn",{seconds:le}):c("otp.resend")}):le>0?b("p",{className:"sekyro-resend is-waiting",children:c("otp.resendIn",{seconds:le})}):Y.map($=>b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:f,onClick:()=>ke($,!0),children:c("otp.resendBy",{channel:j($)})},$)),ue?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:f,onClick:()=>v(!0),"data-testid":"sekyro-otp-change",children:c("otp.changeNumber")}):null]})]})]})}return Z("form",{className:`sekyro-step sekyro-otp${r?` ${r}`:""}`,"aria-labelledby":J,onSubmit:Ee,noValidate:!0,children:[b(ee,{id:J,title:c("otp.sendTitle"),lead:c("otp.sendDescription")}),de,e.needsPhone?Z("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:Oe,children:c("otp.phoneLabel")}),b(to,{field:g,id:Oe,locale:o.locale,t:c,inputRef:Ie,ready:ie})]}):b("p",{className:"sekyro-text-muted",children:c("otp.prefilledNotice")}),Z(te,{children:[Y.length===1?b(S,{type:"submit",full:!0,disabled:f||!ie,"aria-busy":Ve(Y[0])||void 0,children:c("otp.sendBy",{channel:j(Y[0])})}):Y.length>1?Z("div",{className:"sekyro-actions__group",role:"group","aria-label":c("otp.chooseChannel"),children:[b("p",{className:"sekyro-label","aria-hidden":"true",children:c("otp.chooseChannel")}),b("div",{className:"sekyro-channel-row",children:Y.map(w=>Z(S,{kind:"primary",disabled:f||!ie,"aria-busy":Ve(w)||void 0,onClick:()=>ke(w),children:[b(H,{name:w}),j(w)]},w))})]}):b(S,{type:"submit",full:!0,disabled:f||!ie,"aria-busy":f||void 0,children:c("otp.send")}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:f&&N!==null?c("otp.sending",{channel:j(N)}):""}),L&&Le?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:f,onClick:()=>v(!1),"data-testid":"sekyro-otp-back-to-code",children:c("otp.backToCode")}):null]})]})}i(yt,"PhoneOtpStep");import{lazy as gn,Suspense as kn,useMemo as hn,useState as Sn}from"react";import{jsx as ve,jsxs as vn}from"react/jsx-runtime";var bn={load:i(()=>import("../email-otp-view-SM2POPMA.js"),"load")};function gt({locale:e,strings:t,...n}){let r=C(e,t),[a,s]=Sn(0),o=hn(()=>gn(()=>bn.load().then(u=>({default:u.EmailOtpView}))),[a]),c=vn(P,{tone:"danger",children:[ve("span",{children:r.t("errors.network_error")}),ve(S,{kind:"secondary",onClick:()=>s(u=>u+1),children:r.t("common.retry")})]});return ve(oe,{fallback:c,children:ve(kn,{fallback:ve("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:ve(o,{...n,i18n:r})})},a)}i(gt,"EmailOtpStep");import{lazy as Cn,Suspense as wn,useMemo as Nn,useState as _n}from"react";import{jsx as Ce,jsxs as xn}from"react/jsx-runtime";var Pn={load:i(()=>import("../eid-view-GAIQODI5.js"),"load")};function kt({locale:e,strings:t,...n}){let r=C(e,t),[a,s]=_n(0),o=Nn(()=>Cn(()=>Pn.load().then(u=>({default:u.EidView}))),[a]),c=xn(P,{tone:"danger",children:[Ce("span",{children:r.t("errors.network_error")}),Ce(S,{kind:"secondary",onClick:()=>s(u=>u+1),children:r.t("common.retry")})]});return Ce(oe,{fallback:c,children:Ce(wn,{fallback:Ce("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:Ce(o,{...n,i18n:r})})},a)}i(kt,"EidStep");import{useMemo as In}from"react";import{jsx as ht,jsxs as Tn}from"react/jsx-runtime";function St({step:e,locale:t,strings:n,className:r,onError:a}){let s=C(t,n),{busy:o,error:c,run:u}=po(s,a),p=In(()=>e.choice.options.flatMap(g=>{let k=et(g,s),m=co[g.service];return k===null?[]:[{id:g.id,label:k,glyph:m&&ht(H,{name:m})}]}),[e.choice.options,s]),y=e.choice.options.find(g=>g.service==="national_eid");return Tn("div",{className:r,children:[ht(zt,{title:s.t("method.heading"),description:s.t("method.description"),options:p,busy:o,error:c,focus:!0,testId:"sekyro-method",onChoose:g=>u(()=>e.choose(g))}),y?.nationalEid?.afterPass==="continue"?ht(V,{view:"EidContinueHint",i18n:s,provider:y.nationalEid.providerName,quiet:!0}):null]})}i(St,"MethodChoice");import{isValidNni as En,normalizeNni as wo}from"@sekyro/web";import{useId as On,useState as bt}from"react";import{Fragment as Vn,jsx as U,jsxs as we}from"react/jsx-runtime";var Rn=new Set(["nni_not_found","registry_record_not_found"]),Ln=new Set(["nni_invalid","id_number_invalid"]);function ot({step:e,locale:t,strings:n,className:r,onError:a}){let s=C(t,n),{t:o}=s,[c,u]=bt(""),[p,y]=bt(!1),[g,k]=bt(null),m=On(),f=e.attemptsExhausted,x=i(async B=>{y(!0),k(null);try{await B()}catch(F){k(pe(F,s.strings)),a?.(F)}finally{y(!1)}},"run"),N=i(B=>{if(B.preventDefault(),e.source!=="typed"){x(()=>e.confirm());return}let F=wo(c);if(!/^\d{10}$/.test(F))return k("population.invalid");if(!En(F))return k("population.reason_id_number_invalid");x(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(F):e.submitNni(F))},"onSubmit"),T=je(s,e.attemptsRemaining,f),E=e.reason!==void 0&&Rn.has(e.reason),O=e.reason!==void 0&&Ln.has(e.reason),L=we(Vn,{children:[e.reason==="registry_unavailable"?we(P,{tone:"warning",children:[U("span",{children:o("population.reason_registry_unavailable")}),U("span",{children:T})]}):null,E&&e.canUseDocument?we(P,{tone:"warning",children:[U("span",{children:o("population.reason_registry_record_not_found_or_document")}),U("span",{children:T}),U(S,{kind:"secondary",disabled:p,onClick:()=>{x(()=>e.useDocument())},children:o("population.useDocument")})]}):null,E&&!e.canUseDocument||O?we(P,{tone:"danger",children:[U("span",{children:o(E?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),U("span",{children:T})]}):null,f&&e.reason===void 0?U(P,{tone:"danger",children:U("span",{children:T})}):null,g!==null?U(P,{tone:"danger",children:U("span",{children:o(g)})}):null]}),[v,M,A]=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 we("form",{className:`sekyro-step${r?` ${r}`:""}`,"aria-labelledby":m,onSubmit:N,noValidate:!0,children:[U(ee,{id:m,title:o(v),lead:o(M)}),L,e.source==="typed"?we("div",{className:"sekyro-field",children:[U("label",{className:"sekyro-label",htmlFor:`${m}-id-number`,children:o("population.label")}),U("input",{id:`${m}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:o("population.placeholder"),value:c,"aria-describedby":`${m}-id-number-help`,"aria-invalid":g==="population.invalid"||g==="population.reason_id_number_invalid"||void 0,onChange:B=>{k(null),u(wo(B.target.value).replace(/\D/g,"").slice(0,10))}}),U("span",{id:`${m}-id-number-help`,className:"sekyro-help",children:o("population.helper")})]}):null,U(te,{children:f?null:U(S,{type:"submit",full:!0,disabled:p,"aria-busy":p||void 0,children:o(A)})})]})}i(ot,"IdNumberEntry");function Bn(e){return ot(e)}i(Bn,"NniEntry");import{acceptedIssuers as $n,acceptedTypesFor as xo,warmDocumentCapture as Kn}from"@sekyro/web";import{lazy as zn,Suspense as Gn,useEffect as qn,useMemo as Yn,useState as wt}from"react";import{acceptedIssuers as An,acceptedTypesFor as vt,laneCountries as Fn,laneOptionsFor as Dn,optionNameFor as Mn}from"@sekyro/web";import{useContext as Hn,useEffect as nt,useMemo as No,useState as Ct}from"react";import{jsx as K,jsxs as Ne}from"react/jsx-runtime";var _o=220;function Un(e,t,n=[],r){let a=null;try{a=new Intl.DisplayNames([e],{type:"region"})}catch{}let s=t.map(u=>({code:u,name:a?.of(u)??u})),o=new Intl.Collator(e),c=i(u=>{if(u===r)return-1;let p=n.indexOf(u);return p<0?n.length:p},"rank");return s.sort((u,p)=>c(u.code)-c(p.code)||o.compare(u.name,p.name))}i(Un,"countryNames");function Po({step:e,i18n:t,issuer:n,onPicked:r,ageStepUp:a=!1}){let{t:s,locale:o}=t,c=e.context.switchable,u=No(()=>[...new Set([...An(e.documents),...Fn(c)])].sort(),[e.documents,c]),p=i(h=>c===void 0||h===null||e.chooseOption===void 0?[]:Dn(c,h).methods,"methodsOf"),y=No(()=>Un(o,u,Object.keys(e.documents.byIssuer??{}),e.detectedCountry),[o,u,e.documents,e.detectedCountry]),g=u.length===1?u[0]:null,[k,m]=Ct(n??g),[f,x]=Ct(null),N=g===null?[]:vt(e.documents,g),T=g!==null&&N.length===1&&p(g).length===0?N[0]:null;nt(()=>{g!==null&&T!==null&&e.selectDocument(g,T)},[g,T]);let E=i((h,W)=>{e.selectDocument(h,W),r?.()},"pick"),O=i(h=>{let W=vt(e.documents,h);W.length===1&&p(h).length===0?E(h,W[0]):m(h)},"chooseIssuer");nt(()=>{if(f===null||k===null)return;let h=setTimeout(()=>E(k,f),_o);return()=>clearTimeout(h)},[f]),Qe(k!==null&&u.length>1&&n===void 0?()=>{m(null),x(null)}:null);let L=Hn(Ze),v=p(k);nt(()=>{L.set(k,v.map(h=>h.id))},[k,v.map(h=>h.id).join()]);let[M,A]=Ct(null);nt(()=>{if(M===null)return;let h=e.chooseOption;if(h===void 0)return;let W=setTimeout(()=>{h.call(e,M).catch(()=>A(null))},_o);return()=>clearTimeout(W)},[M]);let B=f!==null||M!==null;if(T!==null)return null;if(k===null)return Ne("section",{className:"sekyro-step",children:[K(ee,{title:s("doc.countryTitle"),lead:s(a?"doc.ageStepUp":"doc.pickDescription")}),K(jt,{countries:y,label:s("doc.countryLabel"),searchPlaceholder:s("doc.countrySearch"),noMatch:s("doc.noCountryMatch"),onPick:O}),K(te,{children:null})]});let F=vt(e.documents,k);return Ne("section",{className:"sekyro-step",children:[K(ee,{title:s("doc.pickTitle"),lead:s(a&&g!==null?"doc.ageStepUp":"native.doc.holdIt")}),Ne("div",{className:"sekyro-choices",children:[v.map(h=>Ne("button",{type:"button",className:"sekyro-card","data-testid":"sekyro-type-method","aria-pressed":M===h.id,disabled:B&&M!==h.id,onClick:()=>{B||A(h.id)},children:[K("span",{className:"sekyro-card__tile",children:K(H,{name:uo[h.service]??"id"})}),K("span",{className:"sekyro-card__body",children:K("span",{className:"sekyro-card__title",children:Mn(h,k,o)??et(h,t)})}),K("span",{className:"sekyro-radio","aria-hidden":"true"})]},h.id)),F.map(h=>Ne("button",{type:"button",className:"sekyro-card","aria-pressed":f===h,disabled:B&&f!==h,onClick:()=>{B||x(h)},children:[K("span",{className:"sekyro-card__tile",children:K(H,{name:h==="passport"?"passport":"card"})}),Ne("span",{className:"sekyro-card__body",children:[K("span",{className:"sekyro-card__title",children:s(`doc.type.${h}`)}),K("span",{className:"sekyro-card__sub",children:s(`doc.sub.${h}`)})]}),K("span",{className:"sekyro-radio","aria-hidden":"true"})]},h))]}),u.length>1?K("button",{type:"button",className:"sekyro-link",onClick:()=>{m(null),x(null),A(null)},children:s("native.doc.changeCountry")}):null,K(te,{children:null})]})}i(Po,"DocumentPicker");import{jsx as ae,jsxs as Zn}from"react/jsx-runtime";var Wn={load:i(()=>import("../document-capture-view-NI4452T4.js"),"load")};function Nt({step:e,locale:t,strings:n,className:r,liveMrz:a,barcodeAssetBaseUrl:s}){let o=C(t,n),[c,u]=wt(0),[p,y]=wt(null),g=$n(e.documents),k=g.length>1,m=e.issuer!==null&&xo(e.documents,e.issuer).length>1,f=e.documentType===null||e.issuer===null||p!==null,x=g.length===1&&xo(e.documents,g[0]).length===1,[N]=wt(()=>f&&!x),T=e.ageStepUp===!0,E=Yn(()=>zn(()=>Wn.load().then(L=>({default:L.DocumentCaptureView}))),[c]);qn(()=>{Kn()},[]);let O=Zn(P,{tone:"danger",children:[ae("span",{children:o.t("errors.network_error")}),ae(S,{kind:"secondary",onClick:()=>u(L=>L+1),children:o.t("doc.retryCamera")})]});return ae("div",{className:r,children:f?ae(Po,{step:e,i18n:o,ageStepUp:T&&p===null&&N,...p==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>y(null)}):ae(oe,{fallback:O,children:ae(Gn,{fallback:ae("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:ae(E,{step:e,i18n:o,ageLead:T&&!N,liveMrz:e.documentType==="drivers_license"?void 0:a,barcodeAssetBaseUrl:s,...k?{onChangeCountry:i(()=>y("country"),"onChangeCountry")}:{},...m?{onChangeDocument:i(()=>y("document"),"onChangeDocument")}:{}})})},c)})}i(Nt,"DocumentCapture");import{warmPortraitCapture as Qn}from"@sekyro/web";import{Component as Xn,lazy as Io,Suspense as To,useContext as Jn,useEffect as jn,useMemo as Eo,useState as Oo}from"react";import{jsx as R,jsxs as st}from"react/jsx-runtime";var er={load:i(()=>import("../portrait-capture-view-TTUVVA7L.js"),"load")},tr={load:i(()=>import("../portrait-review-view-BCIENGKR.js"),"load")},Pt=class Pt extends Xn{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(Pt,"LoadBoundary");var rt=Pt;function or({step:e,i18n:t}){let{t:n}=t,r=Se();return st("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[R("h2",{ref:r,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?st(P,{tone:"danger",children:[R("span",{children:n("portrait.uploadFailed")}),R(S,{kind:"secondary",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")})]})}i(or,"MatchPhase");function _t({step:e,locale:t,strings:n,className:r,assetBaseUrl:a,verification:s}){let o=C(t,n),c=Gt(s),u=Jn(Je),[p,y]=Oo(0),[g,k]=Oo(null),m=Eo(()=>Io(()=>er.load().then(A=>({default:A.PortraitCaptureView}))),[p]),f=Eo(()=>Io(()=>tr.load().then(A=>({default:A.PortraitScreens}))),[p]),x=typeof e.uploadPortrait=="function",N=x?e.photo?.source??"camera":"camera",T=x&&N!=="camera"&&e.photo?.uploadOffered===!0,E=N!=="upload",O=N==="upload"?"upload":N==="choice"?g??e.photo?.pick??"source":"camera",L=e.phase==="capture"&&e.photo?.cameraOnPhone===!0;if(jn(()=>{e.phase==="capture"&&O==="camera"&&!L&&Qn()},[e.phase,O,L]),e.phase==="match")return R("div",{className:r,children:R(or,{step:e,i18n:o})});let v=R("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")});if(u!==null&&(u.busy||u.failed!==null)&&e.phase==="capture"&&O==="camera")return st("section",{className:`sekyro-step${r?` ${r}`:""}`,children:[R(ee,{title:o.t("session.steps.portrait.title")}),R(te,{children:R(S,{kind:"secondary",full:!0,disabled:u.busy,onClick:u.reset,children:o.t("portrait.retryCamera")})})]});if(e.phase==="review"||O!=="camera"||L)return R("div",{className:r,children:R(rt,{fallback:R(S,{kind:"ghost",onClick:()=>y(A=>A+1),children:o.t("common.retry")}),children:R(To,{fallback:v,children:R(f,{screen:e.phase==="review"?"review":L&&O==="camera"?"phone":O==="camera"?"review":O,step:e,i18n:o,...E?{onCamera:i(()=>k("camera"),"onCamera")}:{},onUpload:()=>k("upload"),onDeclined:()=>k(null)})})},p)});if(!c.settled)return R("div",{className:r,children:v});let M=st(P,{tone:"danger",children:[R("span",{children:o.t("errors.network_error")}),R(S,{kind:"secondary",onClick:()=>y(A=>A+1),children:o.t("portrait.retryCamera")})]});return R("div",{className:r,children:R(rt,{fallback:M,children:R(To,{fallback:v,children:R(m,{step:e,i18n:o,...a!==void 0?{assetBaseUrl:a}:{},...T?{onUpload:i(()=>k("upload"),"onUpload")}:{}})})},p)})}i(_t,"PortraitCapture");import{lazy as nr,Suspense as rr,useMemo as sr,useState as ir}from"react";import{jsx as me,jsxs as lr}from"react/jsx-runtime";var ar={load:i(()=>import("../proof-of-address-view-SS2TIV3D.js"),"load")};function xt({step:e,locale:t,strings:n,className:r}){let a=C(t,n),[s,o]=ir(0),c=sr(()=>nr(()=>ar.load().then(p=>({default:p.ProofOfAddressView}))),[s]),u=lr(P,{tone:"danger",children:[me("span",{children:a.t("errors.network_error")}),me(S,{kind:"secondary",onClick:()=>o(p=>p+1),children:a.t("common.retry")})]});return me("div",{className:r,children:me(oe,{fallback:u,children:me(rr,{fallback:me("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:a.t("common.loading")}),children:me(c,{step:e,i18n:a})})},s)})}i(xt,"ProofOfAddress");import{lazy as cr,Suspense as ur,useMemo as dr,useState as pr}from"react";import{jsx as fe,jsxs as fr}from"react/jsx-runtime";var mr={load:i(()=>import("../form-view-GOFXOQJO.js"),"load")};function It({step:e,locale:t,strings:n,className:r,onError:a}){let s=C(t,n),[o,c]=pr(0),u=dr(()=>cr(()=>mr.load().then(y=>({default:y.FormView}))),[o]),p=fr(P,{tone:"danger",children:[fe("span",{children:s.t("errors.network_error")}),fe(S,{kind:"secondary",onClick:()=>c(y=>y+1),children:s.t("common.retry")})]});return fe("div",{className:r,children:fe(oe,{fallback:p,children:fe(ur,{fallback:fe("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:fe(u,{step:e,i18n:s,...a!==void 0?{onError:a}:{}})})},o)})}i(It,"FormStep");import{cameraUnavailableCauseOf as Vr}from"@sekyro/web";import{useCallback as ne,useContext as Ar,useEffect as $e,useId as Fr,useMemo as Ft,useRef as re,useState as Q}from"react";var Tt={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 Me={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"}}},yr=["danger","success","warning","info"];function Et(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}i(Et,"channel");function Ro(e){let t=Et(parseInt(e.slice(1,3),16)),n=Et(parseInt(e.slice(3,5),16)),r=Et(parseInt(e.slice(5,7),16));return .2126*t+.7152*n+.0722*r}i(Ro,"luminance");function gr(e,t){let n=Ro(e),r=Ro(t),a=Math.max(n,r),s=Math.min(n,r);return(a+.05)/(s+.05)}i(gr,"contrastRatio");function Lo(e,t){return Math.min(...yr.map(n=>gr(Me[e][n].fg,t)))}i(Lo,"worstAgainst");function Bo(e,t,n){return Math.min(Lo(e,t),Lo(e,n))}i(Bo,"worstStatusContrast");function Vo(e,t){return Bo("light",e,t)>=Bo("dark",e,t)?"light":"dark"}i(Vo,"statusSchemeFor");import{useRef as Sr,useState as br}from"react";import{useEffect as kr,useId as hr,useRef as Ot}from"react";import{jsx as _e,jsxs as Ao}from"react/jsx-runtime";function it({open:e,title:t,closeLabel:n,onClose:r,children:a,actions:s,role:o,testId:c,returnFocus:u}){let p=Ot(null),y=Ot(null),g=Ot(!1),k=hr();return kr(()=>{let m=p.current;if(m!==null){if(e&&!m.open?(y.current=typeof document>"u"?null:document.activeElement,typeof m.showModal=="function"?m.showModal():m.setAttribute("open","")):!e&&m.open&&(typeof m.close=="function"?m.close():m.removeAttribute("open")),!e&&g.current){let f=u?.current??(y.current instanceof HTMLElement?y.current:null);y.current=null,f?.focus()}g.current=e}},[e,u]),_e("dialog",{ref:p,className:"sekyro-dialog","aria-labelledby":k,...o==="alertdialog"?{role:o}:{},"data-testid":c,onCancel:m=>{m.preventDefault(),r()},onClick:m=>{m.target===m.currentTarget&&r()},children:Ao("div",{className:"sekyro-dialog__panel",children:[Ao("div",{className:"sekyro-dialog__head",children:[_e("h2",{id:k,className:"sekyro-dialog__title",children:t}),n!==void 0?_e("button",{type:"button",className:"sekyro-disc sekyro-dialog__close","aria-label":n,onClick:r,children:_e(H,{name:"close"})}):null]}),a!==void 0?_e("div",{className:"sekyro-dialog__body",children:a}):null,s!==void 0?_e("div",{className:"sekyro-dialog__actions",children:s}):null]})})}i(it,"FlowDialog");import{jsx as He,jsxs as Fo}from"react/jsx-runtime";var vr=["intro","data","processing","sharing","retention"];function Do({i18n:e,purpose:t="identity"}){let{t:n}=e,[r,a]=br(!1),s=Sr(null),[o,c=""]=n("consent.short").split("{terms}");return Fo("div",{className:"sekyro-consent","data-testid":"sekyro-consent",children:[Fo("p",{className:"sekyro-consent__line",children:[o,He("button",{ref:s,type:"button",className:"sekyro-link sekyro-link--inline","aria-haspopup":"dialog",onClick:()=>a(!0),children:n("consent.termsLink")}),c]}),He(it,{open:r,title:n("consent.termsTitle"),closeLabel:n("native.close"),onClose:()=>a(!1),returnFocus:s,testId:"sekyro-consent-terms",children:He("div",{className:"sekyro-stack sekyro-stack--3",children:t==="human"?He(V,{view:"HumanConsentTerms",i18n:e,quiet:!0}):vr.map(u=>He("p",{children:n(`consent.terms.${u}`)},u))})})]})}i(Do,"ConsentNotice");function Mo(e){let t=e.trim().split(/\s+/).filter(r=>r!=="");return(t.length>=2?[t[0],t[1]].map(r=>Array.from(r??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}i(Mo,"initials");import{useSyncExternalStore as Cr}from"react";var $o=i(e=>({colors:{...e?q.dark:q.light},radius:q.radius,fontFamily:q.font}),"brandTheme"),ua=$o(!1),Ho=/^#[0-9a-f]{6}$/i;function Rt(e,t,n){if(t)return null;let r=dt(e).colors,a=n?.colors?.bg??r?.bg,s=n?.colors?.surface??r?.surface;return a===void 0&&s===void 0||a!==void 0&&!Ho.test(a)||s!==void 0&&!Ho.test(s)?null:Vo(a??q.light.bg,s??q.light.surface)}i(Rt,"partnerStatusScheme");function at(e,t,n){let r=dt(e);if(n&&r.colors!==void 0){let{brand:a,brandFg:s}=r.colors;a!==void 0&&Pr(a,q.dark.bg)>=3?r.colors={brand:a,ring:a,...s!==void 0?{brandFg:s}:{}}:delete r.colors}if(Rt(e,n,t)==="dark"){let a=Me.dark;r.colors={...r.colors,danger:a.danger.base,success:a.success.base,warning:a.warning.fg}}return We($o(n),r,Yt(t))}i(at,"verificationTheme");function lt(e){let t=Cr(_r,Nr,()=>!1);return e==="dark"||e==="system"&&t}i(lt,"useDarkScheme");var wr="(prefers-color-scheme: dark)",Ko=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(wr):null,"media"),Nr=i(()=>Ko()?.matches??!1,"prefersDark");function _r(e){let t=Ko();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i(_r,"subscribe");function Pr(e,t){let[n,r]=[Uo(e),Uo(t)];return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}i(Pr,"contrast");function Uo(e){let t=[1,3,5].map(n=>{let r=Number.parseInt(e.slice(n,n+2),16)/255;return r<=.03928?r/12.92:((r+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}i(Uo,"luminance");var Lt="sekyro.testerGate";function Bt(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}i(Bt,"store");function zo(e=Date.now()){try{Bt()?.setItem(Lt,String(e))}catch{}}i(zo,"rememberTester");function Go(e=Date.now()){try{let t=Number(Bt()?.getItem(Lt)??"");return Number.isFinite(t)&&t>0&&e-t<2592e6}catch{return!1}}i(Go,"rememberedTester");function qo(){try{Bt()?.removeItem(Lt)}catch{}}i(qo,"forgetTester");import{useEffect as xr,useId as Ir,useState as Tr}from"react";import{jsx as D,jsxs as ye}from"react/jsx-runtime";var Yo=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]),Er={review:{icon:"pending",tone:"info"},cooldown:{icon:"timer",tone:"info"},rejected:{icon:"close",tone:"neutral"},policy:{icon:"close",tone:"neutral"},inconclusive:{icon:"warning",tone:"neutral"},unavailable:{icon:"timer",tone:"neutral"},expired:{icon:"timer",tone:"neutral"}};function Or({screen:e}){if(e==="verified")return ye("svg",{className:"sekyro-outcome sekyro-outcome--approved",viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[D("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"54",pathLength:"1"}),D("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),D("path",{className:"sekyro-outcome__glyph",d:"M6.5 12.5l3.6 3.6 7.4-8.2",pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]});let{icon:t,tone:n}=Er[e];return D("span",{className:`sekyro-tile sekyro-tile--${n} sekyro-outcome-tile`,"aria-hidden":"true","data-screen":e,children:D(H,{name:t})})}i(Or,"OutcomeMark");function Rr({label:e,id:t,copied:n}){let[r,a]=Tr(!1);return xr(()=>{if(!r)return;let s=setTimeout(()=>a(!1),1600);return()=>clearTimeout(s)},[r]),ye("button",{type:"button",className:`sekyro-reference${r?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[D("span",{"aria-live":"polite",children:r?n:e}),D("bdi",{dir:"ltr",children:t}),D(H,{name:"copy"})]})}i(Rr,"ReferenceLine");function Lr({step:e,t}){let n=e.context.sandbox?e.context.simulation?.reason:void 0;return n===void 0?null:ye(Fe,{tone:"warning",role:"status",testId:"sekyro-simulated-notice",children:[D("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:D(H,{name:"info"})}),ye("div",{className:"sekyro-notice__body","data-reason":n,children:[D("strong",{children:t("sandbox.simulatedTitle")}),D("span",{children:t(n==="no_testers"?"sandbox.simulatedNoTesters":"sandbox.simulatedGate")})]})]})}i(Lr,"SimulationNotice");function Br(e,t){return e==="expired"?"native.result.expiredTitle":e!=="verified"?`session.result.${e}.title`:t.level===3?"session.result.verified.title":t.level===1&&t.assurance==="contact_phone"?"session.result.verified.titlePhone":t.level===1&&t.assurance==="contact_email"?"session.result.verified.titleEmail":t.level===1?"session.result.verified.titleContact":"session.result.verified.titleHuman"}i(Br,"resultTitleKey");function Vt({step:e,locale:t,strings:n,className:r,onClose:a}){let s=C(t,n),{t:o}=s,c=Ir(),u=Se(),p=e.context.orgName,y=e.reasonCode??"",g=e.display==="platform_unsupported"?"policy":e.display,k=i(f=>(p!==""||f==="verified")&&f!=="cooldown"?o(`native.result.${f}`,{org:p}):o(`session.result.${f}.description`),"partnerLine"),m;switch(e.display){case"rejected":y==="identity_not_verified"?m=p!==""?o("reasons.identity_not_verified",{org:p}):o("session.result.identityNotVerified"):m=Yo.has(ct(y))?o("session.result.detailsMismatch",{org:p}):k("rejected");break;case"policy":{if(Yo.has(ct(y)))m=o("session.result.detailsMismatch",{org:p});else if(y==="device_velocity_exceeded")m=o("session.result.deviceVelocity",{org:p});else if(y==="capture_tampered")m=o("session.result.deviceStop");else if(y==="camera_unavailable")m=o("reasons.camera_unavailable",{org:p});else if(y==="underage_estimated")m=o("reasons.underage_estimated");else if(y==="starter_credit_claimed")m=o("reasons.starter_credit_claimed");else if(y==="blocked_by_org")m=o("reasons.blocked_by_org");else{let f=y===""?null:Ht(y);m=f!==null?o(f,{org:p}):k("policy")}break}case"cooldown":{let f=Ut(s.locale,e.retryAfter);m=f!==null?o(f.key,{time:f.time}):o("session.result.cooldown.description");break}case"platform_unsupported":m=o("result.platform_unsupported");break;default:m=k(g)}return ye("section",{className:`sekyro-result${r?` ${r}`:""}`,"aria-labelledby":c,"data-testid":"sekyro-result",children:[ye("div",{className:"sekyro-result__body",children:[D(Or,{screen:g}),ye("div",{className:"sekyro-heading",children:[D("h2",{id:c,ref:u,tabIndex:-1,className:"sekyro-text-body",children:o(Br(g,e.result))}),D("p",{className:"sekyro-text-muted",children:m})]}),D(Lr,{step:e,t:o}),D(Rr,{label:o("result.referenceLabel"),id:e.context.sessionId,copied:o("native.result.copied")})]}),a!==void 0?D("div",{className:"sekyro-actions",children:D(S,{full:!0,onClick:a,children:o("native.result.continue",{org:p})})}):null]})}i(Vt,"VerificationResultScreen");import{Fragment as Ue,jsx as l,jsxs as X}from"react/jsx-runtime";function Dr(e,t,n){let r=t?q.dark:q.light,a=t?q.roles.dark:q.roles.light,s=e.colors??{},o={},c=s.fg===r.fg&&s.surface===r.surface;s.brand===r.brand&&s.surface===r.surface&&(o["--sekyro-color-brand-soft"]=a.brandSoft),c&&(o["--sekyro-color-line"]=a.line,o["--sekyro-color-line-subtle"]=a.lineSubtle,o["--sekyro-color-line-strong"]=a.lineStrong,o["--sekyro-color-sunken"]=a.sunken),s.fgMuted===r.fgMuted&&s.surface===r.surface&&(o["--sekyro-color-fg-subtle"]=a.fgSubtle),e.fontFamily===q.font&&(o["--sekyro-font-display"]=q.fontDisplay);let u=t?Tt.dark:Tt.light;if(o["--sekyro-color-success-soft"]=u.successSoft,o["--sekyro-color-success-fg"]=u.successFg,o["--sekyro-color-on-success"]=u.onSuccess,o["--sekyro-color-warning-soft"]=u.warningSoft,o["--sekyro-color-warning-fg"]=u.warningFg,o["--sekyro-color-danger-soft"]=u.dangerSoft,o["--sekyro-color-danger-fg"]=u.dangerFg,o["--sekyro-color-on-danger"]=u.onDanger,o["--sekyro-color-info-soft"]=u.infoSoft,o["--sekyro-color-info-fg"]=u.infoFg,s.brand===r.brand&&(o["--sekyro-color-line-brand"]=u.lineBrand),n!==null){let p=Me[n];for(let y of["danger","success","warning","info"])o[`--sekyro-color-${y}-soft`]=p[y].soft,o[`--sekyro-color-${y}-fg`]=p[y].fg;o["--sekyro-color-on-success"]=p.success.on,o["--sekyro-color-on-danger"]=p.danger.on}return o}i(Dr,"flowRoles");function Dt(e){let{verification:t,locale:n,strings:r,onStep:a,onResult:s}=e,{step:o,error:c}=ft(t);$e(()=>{o!==null&&a?.(o)},[o,a]),$e(()=>s===void 0?void 0:t.on("result",s),[t,s]);let u=lt(e.colorScheme??"light"),p=o?.context.branding,y=at(p,e.theme,u),[g,k]=Q(!1),m=`sekyro-verification${u?" sekyro-verification--dark":""}${g?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,f=re(e.onClose);f.current=e.onClose;let x=re(o);x.current=o;let N=ne(()=>{let v=x.current;f.current?.(v?.kind==="result"?{reason:"finished",result:v.result}:{reason:"cancelled"})},[]),[T,E]=Q(null),O=ne(()=>{let v=x.current;v!==null&&v.kind!=="result"&&v.context.consentRecorded?E("close"):N()},[N]),L=Ft(()=>t.reportCaptureIssue===void 0?null:v=>t.reportCaptureIssue?.(v),[t]);return l(Zt,{theme:y,className:m,children:l(De,{locale:n,...r!==void 0?{strings:r}:{},children:l("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:Dr(y,u,Rt(p,u,e.theme)),children:l(ro.Provider,{value:k,children:l(pt.Provider,{value:e.onClose!==void 0?N:void 0,children:l(Xe.Provider,{value:e.onClose!==void 0?O:void 0,children:X(Kt.Provider,{value:L,children:[l(zr,{...e,step:o,error:c,immersive:g,onLeaveAsk:()=>E("history"),onClosed:N}),l(Ur,{open:T!==null,onStay:()=>{T==="history"&&At(),E(null)},onLeave:()=>{let v=T;E(null),v==="close"||e.onClose!==void 0?N():typeof window<"u"&&Xo()}})]})})})})})})})}i(Dt,"SekyroVerification");function Mr(e,t){if(t===void 0||t==="aml_screening")return null;let n=e,r=n[`session.processing.${t}.title`],a=n[`session.processing.${t}.description`];return typeof r=="string"&&r!==""&&typeof a=="string"&&a!==""?{title:r,description:a}:null}i(Mr,"processingCopyOf");function Hr({error:e,retry:t}){let{t:n}=C(),r=Se();return X(Fe,{tone:"danger",testId:"sekyro-error-notice",children:[l("span",{children:n(Mt(e))}),e.retryable?l(S,{ref:r,kind:"secondary",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}i(Hr,"CameraErrorNotice");var Zo="sekyroFlow";function Qo(){let e=window.history.state;return typeof e=="object"&&e!==null&&e[Zo]===!0}i(Qo,"onGuard");function At(){if(typeof window>"u"||Qo())return;let e=window.history.state;window.history.pushState({...typeof e=="object"&&e!==null?e:{},[Zo]:!0},"")}i(At,"pushGuard");function Xo(){window.history.back()}i(Xo,"leaveHistory");function Ur({open:e,onStay:t,onLeave:n}){let{t:r}=C();return l(it,{open:e,role:"alertdialog",title:r("leave.title"),onClose:t,testId:"sekyro-leave",actions:X(Ue,{children:[l(S,{full:!0,onClick:t,children:r("leave.stay")}),l(S,{full:!0,kind:"danger",onClick:n,children:r("leave.confirm")})]}),children:l("p",{className:"sekyro-text-muted",children:r("leave.body")})})}i(Ur,"LeaveDialog");function $r(e,t){let[n,r]=Q(!1),[a,s]=Q(null),o=e===null?void 0:e.skipCapture,c=re(o);c.current=o;let u=re(!1),p=e?.key;$e(()=>s(null),[p]);let y=ne(()=>{if(u.current)return;let f=c.current;f!==void 0&&(u.current=!0,r(!0),s(null),f().catch(x=>s(t.t(pe(x,t.strings)))).finally(()=>{u.current=!1,r(!1)}))},[t]),g=ne(()=>s(null),[]),k=o!==void 0,m=t.t("sandbox.skipCapture");return Ft(()=>k?{label:m,busy:n,failed:a,run:y,reset:g}:null,[k,m,n,a,y,g])}i($r,"useSkipCapture");function Kr({skip:e}){return X(Ue,{children:[e.failed!==null?l(P,{tone:"danger",children:l("span",{children:e.failed})}):null,l(S,{kind:"ghost",full:!0,disabled:e.busy,"aria-busy":e.busy||void 0,onClick:e.run,"data-testid":"sekyro-skip-capture",children:e.label})]})}i(Kr,"SkipAction");function zr(e){let{step:t,error:n,slots:r,immersive:a}=e,s=C(),{t:o}=s,[c,u]=Q(!1),[p,y]=Q([]),g=ne(d=>(y(_=>[..._,d]),()=>y(_=>_.filter(G=>G!==d))),[]),[k,m]=Q(null),f=ne(d=>m(()=>d),[]),[x,N]=Q(0),[T,E]=Q(null),[O,L]=Q(null),v=$r(t,s),M=t?.context.testerGate!==void 0,[A,B]=Q(!1),F=re(null);$e(()=>{!M||F.current!==null||(F.current=Go(),F.current&&B(!0))},[M]);let h=t?.context.purpose??"identity",W=t?.context.returning===!0,xe=e.verification,Ke=h==="human"||t?.context.cameraUnavailableHandled===!0,J=xe.reportCameraUnavailable!==void 0&&Ke?d=>xe.reportCameraUnavailable?.(d)??Promise.resolve():void 0,Ie=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,se=e.handoffUrl,ze=re({last:null,count:0}),Y=ne((d,_,G=!1)=>J===void 0&&_!=="denied"?void 0:l(V,{view:"NoCameraView",i18n:s,quiet:!0,cause:_,onRetry:d,repeated:G,...Ie&&J!==void 0?{onContinue:J}:{},...se!==void 0?{handoffUrl:se}:{}}),[s,xe,Ke,Ie,se]),ge=Ft(()=>mo(t),[t]),ie=ne((d,_)=>l(fo,{start:d,context:_,human:h==="human",returning:W,notice:_.permissionSettled&&_.permission==="denied"?Y(d,"denied"):void 0,...ge!==void 0?{retry:ge}:{}}),[h,W,Y,ge]),ke=ne((d,_)=>{let G=Vr(d.kind),Ye=ze.current;d.kind==="permission"&&d!==Ye.last&&(Ye.last=d,Ye.count+=1);let jo=d.kind==="permission"&&Ye.count>1;return(G!==void 0?Y(_,G,jo):void 0)??X(Ue,{children:[l(Hr,{error:d,retry:_}),G!==void 0&&se!==void 0?l(V,{view:"DesktopHandoffView",i18n:s,quiet:!0,url:se}):null]})},[Y,se,s]),Te=re(""),Ee=e.livenessProps?.slots?.stageOverlay,Oe=ne(d=>(d.guidance!==""&&!d.coached&&(Te.current=d.guidance),l(go,{testId:"sekyro-capture-stage",video:l("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.settled?o("capture.checkingTitle"):d.guidance!==""?d.guidance:Te.current,note:d.note,status:d.status,busy:d.settled,progress:d.phase==="seeking"||d.phase==="aligning"?d.progress:1,still:d.still,live:d.live,closeLabel:o("native.close"),overlay:Ee?.(d.videoRef),ramp:d.ramp?.colour??null,...d.settled?{}:{onClose:i(()=>N(_=>_+1),"onClose")},end:d.modeSwitch!=null?l($t,{view:d.modeSwitch,className:"sekyro-glass sekyro-glass--label"}):null,children:d.settled||!d.live?null:l(so,{onStop:()=>N(_=>_+1)})})),[o,Ee]),Re=Fr(),le=t,ce=t!==null&&T===t.key&&t.context.switchable!==void 0,ue=k??(t===null||t.kind==="result"?null:ce?()=>E(null):t.context.switchable!==void 0&&typeof le?.chooseOption=="function"?()=>E(t.key):null),Le=re(ue);Le.current=ue;let Be=re(t);Be.current=t;let j=re({ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0});j.current={ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0};let Ve=e.backNavigation==="history";if($e(()=>{if(!Ve||typeof window>"u")return;At();let d=i(()=>{if(Qo())return;let _=Be.current,G=Le.current;G!==null?(G(),At()):_?.kind!=="result"&&_?.context.consentRecorded===!0?j.current.ask():j.current.hostClose?j.current.closed():Xo()},"onPop");return window.addEventListener("popstate",d),()=>window.removeEventListener("popstate",d)},[Ve]),n!==null)return l(Fe,{tone:"danger",children:l("span",{children:o(pe(n,s.strings))})});if(t===null)return X("div",{className:"sekyro-skeleton",role:"status","aria-busy":"true",children:[l("span",{className:"sekyro-visually-hidden",children:o("common.loading")}),l("span",{className:"sekyro-skeleton__bar is-title"}),l("span",{className:"sekyro-skeleton__bar"}),l("span",{className:"sekyro-skeleton__bar is-short"}),l("span",{className:"sekyro-skeleton__bar is-block"})]});let{context:z}=t,Ge=i(d=>{u(!0),d().finally(()=>u(!1))},"refresh"),qe=r?.header??l(Yr,{context:z,headerId:Re,end:r?.headerEnd,...ue!==null?{onBack:ue}:{}}),I,de=ce;if(A&&e.verification.testerGate!==void 0)I=l(ut.Provider,{value:Oe,children:l(V,{view:"TesterGateView",i18n:s,verification:e.verification,attemptsLeft:z.testerGate?.attemptsLeft??0,livenessProps:{...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:e.livenessProps?.slots?.intro??ie},locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice},onBound:()=>zo(),onDone:d=>{d&&qo(),B(!1)}})});else if(de)I=l(V,{view:"LaneChoiceView",i18n:s,step:t,onClose:()=>E(null)});else switch(t.kind){case"phone_otp":I=l(yt,{step:t});break;case"email_otp":I=l(gt,{step:t});break;case"method":I=l(St,{step:t});break;case"registry":I=l(ot,{step:t});break;case"document":I=l(Nt,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{},...e.documentBarcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:e.documentBarcodeAssetBaseUrl}:{}});break;case"liveness":{let d=e.livenessProps?.slots?.intro,_={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??ie,...d===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:ke}:{}},...x>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};I=l(ut.Provider,{value:Oe,children:t.instructions==="icao"||t.livePhoto?.icao===!0?l(V,{view:"LivePhotoLiveness",i18n:s,step:t,livenessProps:_,sekyroIntro:d===void 0},x):l(qt,{..._},x)});break}case"portrait":I=X(Ue,{children:[t.retakeOnly?l(V,{view:"PortraitRetakeNotice",i18n:s,quiet:!0}):null,l(_t,{step:t,verification:e.verification,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"proof_of_address":I=l(xt,{step:t});break;case"form":I=l(It,{step:t});break;case"contact_choice":I=l(V,{view:"ContactChoiceView",i18n:s,step:t});break;case"choice":I=l(V,{view:"GenericChoiceView",i18n:s,step:t});break;case"identity_summary":I=l(V,{view:"IdentitySummaryView",i18n:s,step:t});break;case"mobile_required":{let d=t.checkType==="doc_ocr"?o("handoff.lead.document"):t.checkType==="portrait_icao"?o("handoff.lead.portrait"):t.checkType==="poa"?o("handoff.lead.poa"):void 0;I=e.handoffUrl!==void 0?l(V,{view:"HandoffView",i18n:s,url:e.handoffUrl,refresh:t.refresh,...d!==void 0?{lead:d}:{}}):l(tt,{tone:"brand",icon:"smartphone",title:o("handoff.title"),actions:l(S,{kind:"secondary",full:!0,disabled:c,onClick:()=>Ge(t.refresh),children:o("common.refresh")}),children:l("p",{children:d??o("reasons.mobile_required")})});break}case"native_app_required":I=l(V,{view:"NativeAppView",i18n:s,org:z.orgName,nativeApp:t.nativeApp,...e.handoffUrl!==void 0?{fallbackUrl:e.handoffUrl}:{},refresh:t.refresh,footer:l(Wo,{org:z.orgName})});break;case"processing":{let d=Mr(s.strings,t.service);I=l(tt,{tone:"brand",icon:"pending",busy:!t.stalled,live:!0,title:d?.title??o("session.processing.title"),actions:t.stalled?l(S,{kind:"secondary",full:!0,disabled:c,onClick:()=>Ge(t.refresh),children:o("common.refresh")}):null,children:l("p",{children:d?.description??o("session.processing.description")})});break}case"eid":I=l(kt,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";I=l(tt,{tone:"neutral",icon:"smartphone",title:o(d?"needsApp.title":"unsupported.title"),actions:l(Wo,{org:z.orgName}),children:l("p",{children:d?z.orgName!==""?o("needsApp.description",{org:z.orgName}):o("needsApp.descriptionNoOrg"):o("unsupported.description",{org:z.orgName})})});break}case"result":I=r?.result?.(t)??l(Gr,{step:t});break;default:{let d=t;I=null}}let w=!a&&!z.consentRecorded&&t.kind!=="result"?l(Do,{i18n:s,purpose:z.purpose}):null,$=v!==null&&!a&&!de&&!A?l(Kr,{skip:v}):null,he=M&&!A&&!a&&!de&&e.verification.testerGate!==void 0?l(V,{view:"TesterGateAction",i18n:s,quiet:!0,onOpen:()=>B(!0)}):null,Ae=$===null&&he===null?w:X(Ue,{children:[he,$,w]});return l(Ze.Provider,{value:{issuer:O?.key===t.key?O.issuer:null,listed:O?.key===t.key?O.listed:[],set:i((d,_=[])=>L(G=>G?.key===t.key&&G.issuer===d&&G.listed.join()===_.join()?G:{key:t.key,issuer:d,listed:_}),"set")},children:l(no.Provider,{value:f,children:l(Je.Provider,{value:v,children:l(yo.Provider,{value:e.handoffUrl,children:X(oo.Provider,{value:Ae===null?null:{node:Ae,owner:p[0]??null,claim:g},children:[a?null:qe,!a&&t.kind!=="result"&&z.sections.length>1?l(Wr,{context:z,current:t.section,i18n:s}):null,l(ao,{pageKey:t.key,children:I}),!a&&!de&&t.kind!=="result"&&t.context.switchable!==void 0?l(V,{view:"LaneSwitch",i18n:s,step:t,onOpen:()=>E(t.key),quiet:!0},t.key):null,p.length===0?Ae:null,a?null:r?.footer!==void 0?r.footer:z.branding?.hideAttribution===!0?null:X("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[l(H,{name:"lock"}),o("shell.verifiedBy")]})]})})})})})}i(zr,"Body");function Wo({org:e}){let{t}=C(),n=Ar(pt);return n===void 0?null:l(S,{full:!0,onClick:n,children:t("native.result.continue",{org:e})})}i(Wo,"BackToOrg");function Gr({step:e}){return l(Xe.Consumer,{children:t=>l(Vt,{step:e,...t!==void 0?{onClose:t}:{}})})}i(Gr,"ResultPage");function qr(e){let t=e.levelName??e.purpose;return t==="contact"?"shell.subtitleContact":t==="human"?"shell.subtitleHuman":"shell.subtitle"}i(qr,"subtitleKeyOf");function Yr({context:e,headerId:t,end:n,onBack:r}){let{t:a}=C(),[s,o]=Q(!1),c=s?void 0:e.branding?.logoUrl,u=e.orgName!==""?e.orgName:a(e.returning?"returning.heading":"session.title");return l("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:X("div",{className:"sekyro-org",children:[r!==void 0?l("button",{type:"button",className:"sekyro-disc sekyro-org__back","aria-label":a("common.back"),onClick:r,"data-testid":"sekyro-back",children:l(H,{name:"back"})}):null,l("span",{className:"sekyro-org__tile","aria-hidden":"true",children:c!==void 0?l("img",{className:"sekyro-org__logo",src:c,alt:"",onError:()=>o(!0)}):Mo(e.orgName)}),X("div",{className:"sekyro-org__text",children:[l("h1",{id:t,className:"sekyro-org__name",children:u}),l("p",{className:"sekyro-org__sub",children:a(qr(e))})]}),e.sandbox?l("span",{className:"sekyro-sandbox-badge","data-testid":"sekyro-sandbox-badge",children:a("app.sandboxBadge")}):null,n!=null?l("div",{className:"sekyro-org__end",children:n}):null,l(Xe.Consumer,{children:p=>p!==void 0?l("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":a("native.close"),onClick:p,children:l(H,{name:"close"})}):null})]})})}i(Yr,"OrgHeader");function Wr({context:e,current:t,i18n:n}){let r=t===null?-1:e.sections.indexOf(t),a=e.progress,s=a!==void 0&&a.length===e.sections.length?a:e.sections.map((o,c)=>({id:o,state:c<r?"done":c===r?"current":"upcoming"}));return l("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:s.map(({id:o,state:c})=>l("li",{className:`sekyro-progress__bar${c==="done"?" is-done":c==="current"?" is-current":""}`,...c==="current"?{"aria-current":"step"}:{},children:l("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${o}`]??o})},o))})}i(Wr,"SectionProgress");import{useEffect as Zr,useState as Jo}from"react";import{jsx as Pe}from"react/jsx-runtime";function Qr(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i(Qr,"pageUrl");function Xr({hostedUrl:e,inAppBrowser:t,...n}){let[r,a]=Jo(t===!0);Zr(()=>{t===void 0&&mt()&&a(!0)},[t]);let[s,o]=Jo(!1),c=lt(n.colorScheme??"light"),u=n.handoffUrl??e??Qr();return r&&!s?Pe(Wt,{theme:We(at(void 0,void 0,c),n.theme),className:`sekyro-verification${c?" sekyro-verification--dark":""}${n.className!==void 0?` ${n.className}`:""}`,children:Pe(De,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:Pe("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-flow",children:Pe(Jr,{url:u,onContinue:()=>o(!0)})})})}):Pe(Dt,{...n,...u!==""?{handoffUrl:u}:{}})}i(Xr,"SekyroFlow");function Jr({url:e,onContinue:t}){let n=C();return Pe(V,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}i(Jr,"Prompt");export{Nt as DocumentCapture,kt as EidStep,gt as EmailOtpStep,It as FormStep,ot as IdNumberEntry,St as MethodChoice,Bn as NniEntry,yt as PhoneOtpStep,_t as PortraitCapture,xt as ProofOfAddress,Xr as SekyroFlow,Dt as SekyroVerification,De as StepI18nProvider,Vt as VerificationResultScreen,on as arSteps,nn as enSteps,sn as formatTemplate,rn as frSteps,mt as isInAppBrowser,en as loadSekyroLocale,an as resolveSekyroStrings,tn as retakeHintStringKey,C as useStepI18n,ft as useVerificationStep};
|
package/dist/verification.css
CHANGED
|
@@ -734,6 +734,8 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
|
|
|
734
734
|
animation: sekyro-fill 400ms var(--sekyro-spring) both;
|
|
735
735
|
}
|
|
736
736
|
.sekyro-lm-thumb > img { inline-size: 100%; block-size: 100%; object-fit: cover; border-radius: 4.5px; }
|
|
737
|
+
.sekyro-lm-thumb > .sekyro-glyph { position: absolute; inset: 0; margin: auto; inline-size: 22px; block-size: 22px; fill: currentColor; }
|
|
738
|
+
.sekyro-lm-received { font: var(--sekyro-type-flow-caption) var(--sekyro-font); color: var(--sekyro-color-on-camera-success); }
|
|
737
739
|
.sekyro-lm-check {
|
|
738
740
|
position: absolute; inset-block-start: -6px; inset-inline-end: -6px; inline-size: 18px; block-size: 18px; border-radius: 50%;
|
|
739
741
|
background: var(--sekyro-color-on-camera-success); fill: none; stroke: var(--sekyro-color-on-stage); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sekyro/react",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.39",
|
|
4
4
|
"description": "Sekyro AI React SDK — the themeable, accessible <LivenessCapture /> component over @sekyro/web (Arabic, French, English, Spanish, Portuguese and German, RTL-safe, WCAG AAA defaults)",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"strings:steps": "node scripts/gen-step-strings.mjs"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@sekyro/web": "^0.1.0-rc.
|
|
78
|
+
"@sekyro/web": "^0.1.0-rc.41 || ^0.2.0-rc.0",
|
|
79
79
|
"react": ">=18.2",
|
|
80
80
|
"react-dom": ">=18.2"
|
|
81
81
|
},
|
package/sbom.cdx.json
CHANGED
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"type": "application",
|
|
98
98
|
"name": "react",
|
|
99
99
|
"group": "@sekyro",
|
|
100
|
-
"version": "0.1.0-rc.
|
|
101
|
-
"bom-ref": "@sekyro/react@0.1.0-rc.
|
|
100
|
+
"version": "0.1.0-rc.39",
|
|
101
|
+
"bom-ref": "@sekyro/react@0.1.0-rc.39",
|
|
102
102
|
"description": "Sekyro AI React SDK — the themeable, accessible <LivenessCapture /> component over @sekyro/web (Arabic, French, English, Spanish, Portuguese and German, RTL-safe, WCAG AAA defaults)",
|
|
103
103
|
"licenses": [
|
|
104
104
|
{
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
],
|
|
111
|
-
"purl": "pkg:npm/%40sekyro/react@0.1.0-rc.
|
|
111
|
+
"purl": "pkg:npm/%40sekyro/react@0.1.0-rc.39?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-react",
|
|
112
112
|
"externalReferences": [
|
|
113
113
|
{
|
|
114
114
|
"url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"components": [],
|
|
148
148
|
"dependencies": [
|
|
149
149
|
{
|
|
150
|
-
"ref": "@sekyro/react@0.1.0-rc.
|
|
150
|
+
"ref": "@sekyro/react@0.1.0-rc.39"
|
|
151
151
|
}
|
|
152
152
|
]
|
|
153
153
|
}
|
package/dist/chunk-TYJNROSC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{a as v,b as _}from"./chunk-V4ZZVMGQ.js";import{a as x}from"./chunk-VRDPGOXM.js";import{g as S}from"./chunk-U3ARWENR.js";import{a as p,b as y,d as N,l as C,q as b,r as w}from"./chunk-DZA3S24Q.js";import{a as k,l as I,o as R}from"./chunk-VHHSMO63.js";import{a as i}from"./chunk-2KED7D2Q.js";import{useState as E}from"react";var U={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"},Y={population_registry:"hashtag",national_eid:"key"};function D(e,r){switch(e.service){case"document":return r.t("method.document_photo");case"population_registry":return r.t("method.national_number");case"national_eid":{let a=e.nationalEid?.providerName;return a?r.t("method.national_eid",{provider:a}):r.t("method.national_eidGeneric")}default:return null}}i(D,"identityLabel");function q(e,r){let[a,n]=E(!1),[c,m]=E(null);return{busy:a,error:c,run:i(u=>{n(!0),m(null),u().then(()=>n(!1),f=>{n(!1),m(e.t(x(f,e.strings))),r?.(f)})},"run")}}i(q,"useChoiceAction");import{useContext as H,useId as L}from"react";import{Fragment as M,jsx as t,jsxs as s}from"react/jsx-runtime";function O(){let e=`sekyro-face-light-${L().replace(/[^A-Za-z0-9_-]/g,"")}`;return s("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[t("defs",{children:t("mask",{id:e,children:t("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),t("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),t("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),t("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),t("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}i(O,"FaceMark");var B={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function ne(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}i(ne,"faceIntroRetryOf");var T={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function re({start:e,context:r,tips:a,tipsTitle:n,human:c=!1,returning:m=!1,notice:d,retry:u}){let f=S(),{t:o}=f,g=u===void 0?"face":v(u.reason),h=g==="face"?null:_[g].tips,A=H(C)?.busy===!0;return s("section",{className:"sekyro-step",children:[t(O,{}),r.captureMode==="assisted"?t(y,{title:o("capture.assisted.heading"),lead:o("capture.assisted.lead")}):m?t(y,{title:o("returning.heading"),lead:o("returning.description")}):t(y,{title:o(c?"native.face.humanIntroTitle":"native.face.introTitle"),lead:o(c?"native.face.humanIntroLead":"native.face.introLead")}),u!==void 0?t(K,{retry:u,title:_[g].title}):null,n!==void 0&&h===null?t("p",{className:"sekyro-section-label",children:n}):null,t("ul",{className:"sekyro-tiprows",children:h!==null?h.map(l=>s("li",{children:[t(p,{name:T[l]??"face"}),o(l)]},l)):a!==void 0?a.map(l=>s("li",{children:[t(p,{name:B[l.id]??"face"}),l.text]},l.id)):s(M,{children:[s("li",{children:[t(p,{name:"light"}),o("capture.tips.light")]}),s("li",{children:[t(p,{name:"jGlasses"}),o("capture.tips.uncover")]}),s("li",{children:[t(p,{name:"smartphone"}),o("capture.tips.eyeLevel")]})]})}),d??null,d!==void 0?null:r.assets==="failed"?t(k,{kind:"secondary",full:!0,onClick:r.retryAssets,children:o("common.retry")}):null,d!==void 0?null:t(N,{children:s(k,{full:!0,disabled:r.assets!=="ready"||A,"aria-busy":r.assets==="loading"||void 0,onClick:e,children:[t(p,{name:"camera"}),o("capture.start")]})})]})}i(re,"FaceIntro");var F=new Set(["match_inconclusive","no_face_source","below_threshold"]);function K({retry:e,title:r}){let a=S(),n=e.retakeHint===void 0?null:I(e.retakeHint),c=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":F.has(e.reason)?"capture.retryMatch.message":R(e.reason);return s(b,{tone:"warning",children:[n!==null?t("span",{children:a.t(n)}):c!==null?t("span",{children:a.t(c)}):null,n===null?t("span",{children:a.t(r)}):null,t("span",{children:w(a,e.attemptsRemaining,e.attemptsExhausted)})]})}i(K,"RetryNotice");import{isInAppBrowser as $}from"@sekyro/web/client";function ce(e){return $(e)}i(ce,"isInAppBrowser");function le(e,r){let a=r??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(a))return null;let n;try{n=new URL(e)}catch{return null}if(n.protocol!=="https:"&&n.protocol!=="http:")return null;let c=n.protocol.slice(0,-1);return`intent://${n.host}${n.pathname}${n.search}#Intent;scheme=${c};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}i(le,"androidBrowserIntent");export{U as a,Y as b,D as c,q as d,ne as e,re as f,ce as g,le as h};
|