@sekyro/react 0.1.0-rc.27 → 0.1.0-rc.29
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 +20 -0
- package/README.md +2 -2
- package/dist/{chunk-ZTCQFWDM.js → chunk-4EAJF4AW.js} +1 -1
- package/dist/{chunk-A7UG6YDG.js → chunk-4P5ISU3M.js} +1 -1
- package/dist/{chunk-VN4C5C2R.js → chunk-5PJVSDBR.js} +1 -1
- package/dist/{chunk-HO5RMTZU.js → chunk-76RNF33U.js} +1 -1
- package/dist/{chunk-KGUF5KAK.js → chunk-7BZUPVX6.js} +1 -1
- package/dist/chunk-C2WE5DVD.js +2 -0
- package/dist/{chunk-WVYPT45I.js → chunk-DGZL42KX.js} +1 -1
- package/dist/{chunk-VOIZLJLI.js → chunk-DJDH4ZAM.js} +1 -1
- package/dist/{chunk-U5GKKEZQ.js → chunk-GKRVVHVX.js} +1 -1
- package/dist/{chunk-CBQYUAKA.js → chunk-HAR4ENMU.js} +1 -1
- package/dist/chunk-I3PYSGPF.js +2 -0
- package/dist/{chunk-5V26KZGZ.js → chunk-LKOJEU4D.js} +1 -1
- package/dist/{chunk-DTXKBOS4.js → chunk-PY5JTKRX.js} +1 -1
- package/dist/{document-capture-view-5FWUD45F.js → document-capture-view-QMXAAYA2.js} +1 -1
- package/dist/{eid-view-U2HL2IX7.js → eid-view-3QTJORA7.js} +1 -1
- package/dist/{email-otp-view-CMJHROOH.js → email-otp-view-6MD74OFN.js} +1 -1
- package/dist/{flow-views-O3KBN7YF.js → flow-views-AEVFAZOT.js} +1 -1
- package/dist/{form-view-WVPN7ZUY.js → form-view-YAGVGWMI.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-U5AM34SS.js +2 -0
- package/dist/overlay-es-LS4JWU5J.js +2 -0
- package/dist/overlay-pt-M4ZJJRFE.js +2 -0
- package/dist/{portrait-capture-view-UYISOXXV.js → portrait-capture-view-6EUUL2QA.js} +1 -1
- package/dist/portrait-review-view-TTVTYGLG.js +2 -0
- package/dist/{proof-of-address-view-EIQXYYM3.js → proof-of-address-view-5WWGRXJL.js} +1 -1
- package/dist/{theme-CMvkgsqM.d.cts → theme-DbHOQCyE.d.cts} +4 -3
- package/dist/{theme-CMvkgsqM.d.ts → theme-DbHOQCyE.d.ts} +4 -3
- package/dist/verification/index.cjs +1 -1
- package/dist/verification/index.d.cts +2 -2
- package/dist/verification/index.d.ts +2 -2
- package/dist/verification/index.js +1 -1
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/chunk-2UDX3MRT.js +0 -2
- package/dist/chunk-3MCTR3RI.js +0 -2
- package/dist/overlay-de-PVJMYZGV.js +0 -2
- package/dist/overlay-es-PZCE25XM.js +0 -2
- package/dist/overlay-pt-PZ3L6DR7.js +0 -2
- package/dist/portrait-review-view-67VI2Q6K.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-DbHOQCyE.cjs';
|
|
2
|
+
export { k as StringKey, A as retakeHintStringKey } from '../theme-DbHOQCyE.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';
|
|
@@ -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-DbHOQCyE.js';
|
|
2
|
+
export { k as StringKey, A as retakeHintStringKey } from '../theme-DbHOQCyE.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';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as ao}from"../chunk-DTXKBOS4.js";import{a as J,b as B,c as io}from"../chunk-A7UG6YDG.js";import{a as zt,b as Gt,d as qt,e as Yt}from"../chunk-ZARKJW2C.js";import{a as U,d as Mt,e as rt,f as Ke,g as Ht,h as Ut}from"../chunk-U5GKKEZQ.js";import{a as $t,b as Kt,c as eo}from"../chunk-GUTF3SPK.js";import{a as to,b as oo,c as no,d as ro,e as so,f as it}from"../chunk-VN4C5C2R.js";import{a as We}from"../chunk-WVYPT45I.js";import{d as nt,f as Vt,g as Ft,j as Dt}from"../chunk-2UDX3MRT.js";import{b as Lt}from"../chunk-KGUF5KAK.js";import{a as At}from"../chunk-7MMT5M4E.js";import{a as ue}from"../chunk-VRDPGOXM.js";import{a as Wo,b as Zo,c as Qo,d as Xo,e as Jo,f as Oe,g as C}from"../chunk-5V26KZGZ.js";import{a as D,b as Q,c as Wt,d as X,e as Zt,f as ze,g as Ge,h as st,i as Qt,k as qe,l as Xt,m as Jt,o as jt,p as x,q as Ye}from"../chunk-HO5RMTZU.js";import"../chunk-VOIZLJLI.js";import{a as h,c as ot,j as qo,l as Yo,n as Rt,o as Ot,p as Bt,r as Re,s as ke}from"../chunk-3MCTR3RI.js";import{a as i}from"../chunk-2KED7D2Q.js";import{useEffect as jo,useState as lo}from"react";function at(e){let[t,n]=lo(()=>e?.currentStep?.()??null),[r,a]=lo(null);return jo(()=>{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",l=>{s&&n(l)});return e.run().then(l=>{s&&n(u=>u??l)},l=>{s&&a(l)}),()=>{s=!1,o()}},[e]),{step:t,error:r}}i(at,"useVerificationStep");import{useEffect as co,useId as en,useMemo as tn,useRef as uo,useState as Se}from"react";import{Fragment as fo,jsx as b,jsxs as K}from"react/jsx-runtime";var po=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"),on=600,nn=30,rn=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),sn=["whatsapp","sms"],mo=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 an(e){let t=[];for(let n of e.phoneCountries??["MR"]){let r=e.phoneRules?.find(s=>s.code===n),a=r?.dial??zt(n);a!==void 0&&!t.some(s=>s.code===n)&&t.push({code:n,dial:`+${a}`,...r!==void 0?{rule:r}:{}})}return t}i(an,"phoneCountriesOf");function lt({step:e,locale:t,strings:n,className:r,defaultPhone:a,onError:s}){let o=C(t,n),{t:l}=o,u=tn(()=>an(e),[e.phoneCountries,e.phoneRules]),p=a??u[0]?.dial??"",f=e.phoneInternational===!0,g=qt({countries:u,international:f,closed:!!e.phoneRules?.length,defaultPhone:p}),[k,m]=Se(""),[y,w]=Se(!1),[N,O]=Se(null),[R,S]=Se(null),[I,_]=Se(!1),[W,M]=Se(null),H=uo(null),V=e.phase==="verify"&&!I,fe=e.phase==="verify",Ne=eo(fe),[Fe,De]=$t(e.reason==="otp_mismatch",e.attemptsRemaining,()=>m("")),$=en(),ie=uo(null);co(()=>{let v=setTimeout(()=>ie.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(v)},[V]);let ye=e.phase==="verify"?e.codeExpiresAt??"sent":null;co(()=>{ye!==null&&(_(!1),H.current!==null&&!mo.has(e.reason??"")&&M(H.current),H.current=null)},[ye]);let _e=i(async v=>{w(!0),S(null);try{await v()}catch(d){S(ue(d,o.strings)),s?.(d)}finally{w(!1),O(null)}},"run"),q=sn.filter(v=>(e.channels??[]).includes(v)),Pe=g.typed,te=!e.needsPhone||Pe!==null,ae=i((v,d=!1)=>{let P=e.needsPhone?d?W:{number:Pe??g.phone,shown:g.shown}:null;H.current=P,O(v??null),_e(async()=>{try{await e.send({...P!==null?{phone:P.number}:{},...v!==void 0?{channel:v}:{}})}catch(Z){throw H.current=null,Z}})},"send"),Me=i(v=>{_e(()=>e.verify(v))},"submitCode"),He=i(v=>{v.preventDefault(),V?Me(k):q.length<=1&&te&&ae(q[0])},"onSubmit"),xe=`${$}-phone`,oe=po(e.codeExpiresAt,Ne,on),ne=po(e.resendAvailableAt,Ne,nn),le=V&&e.codeExpiresAt!==void 0&&oe===0,ce=e.needsPhone&&!e.attemptsExhausted,Ie=fe&&(e.codeExpiresAt===void 0||oe>0),F=V&&ce?()=>_(!0):I&&Ie?()=>_(!1):null;ze(F===null?null:y?()=>{}:F);let re=i(v=>l(v==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),Ue=i(v=>y&&N!==null&&N===v,"busyFor"),[T,ge]=l("otp.sentTo",{channel:re(e.channel)}).split("{number}"),Te=e.context.simulation?.otpCode,$e=e.reason==="otp_mismatch"?K(x,{tone:"danger",children:[b("span",{children:l("otp.reason_otp_mismatch")}),b("span",{children:Ye(o,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&mo.has(e.reason)?b(x,{tone:"warning",children:b("span",{children:l(`otp.reason_${e.reason}`)})}):e.reason==="tester_phone_mismatch"?b(x,{tone:"warning",children:b("span",{children:l("reasons.tester_phone_mismatch")})}):null,Ee=K(fo,{children:[$e,R!==null?b(x,{tone:"danger",children:b("span",{children:l(R)})}):null]});if(V){let v=q.length===0;return K("form",{className:`sekyro-step sekyro-otp${r?` ${r}`:""}`,"aria-labelledby":$,onSubmit:He,noValidate:!0,children:[b(Q,{id:$,title:l("otp.verifyTitle"),lead:Te!==void 0?b(Jt,{template:l("sandbox.otpHint"),code:Te}):K(fo,{children:[T,b("bdi",{dir:"ltr",className:"sekyro-mono",children:W?.shown??e.sentToMasked}),ge]})}),Ee,K("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:`${$}-code`,children:l("otp.codeLabel")}),b(Kt,{id:`${$}-code`,value:k,invalid:Fe,onChange:d=>{d!==""&&De(),m(d),d.length===6&&k.length!==6&&!y&&!e.attemptsExhausted&&Me(d)}}),b("span",{className:`sekyro-help sekyro-otp-expiry${le?" is-danger":""}`,"aria-hidden":!le||void 0,children:le?l("otp.expired"):l("otp.expiresIn",{time:rn(oe)})})]}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:le?l("otp.expired"):""}),K(X,{children:[b(h,{type:"submit",full:!0,disabled:y||k.length!==6||e.attemptsExhausted,"aria-busy":y||void 0,children:l("otp.verify")}),K("div",{className:"sekyro-resend-row",children:[v?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y||ne>0,onClick:()=>ae(void 0,!0),children:ne>0?l("otp.resendIn",{seconds:ne}):l("otp.resend")}):ne>0?b("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:ne})}):q.map(d=>b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y,onClick:()=>ae(d,!0),children:l("otp.resendBy",{channel:re(d)})},d)),ce?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y,onClick:()=>_(!0),"data-testid":"sekyro-otp-change",children:l("otp.changeNumber")}):null]})]})]})}return K("form",{className:`sekyro-step sekyro-otp${r?` ${r}`:""}`,"aria-labelledby":$,onSubmit:He,noValidate:!0,children:[b(Q,{id:$,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),Ee,e.needsPhone?K("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:xe,children:l("otp.phoneLabel")}),b(Yt,{field:g,id:xe,locale:o.locale,t:l,inputRef:ie,ready:te})]}):b("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),K(X,{children:[q.length===1?b(h,{type:"submit",full:!0,disabled:y||!te,"aria-busy":Ue(q[0])||void 0,children:l("otp.sendBy",{channel:re(q[0])})}):q.length>1?K("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[b("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),b("div",{className:"sekyro-channel-row",children:q.map(v=>K(h,{kind:"primary",disabled:y||!te,"aria-busy":Ue(v)||void 0,onClick:()=>ae(v),children:[b(D,{name:v}),re(v)]},v))})]}):b(h,{type:"submit",full:!0,disabled:y||!te,"aria-busy":y||void 0,children:l("otp.send")}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:y&&N!==null?l("otp.sending",{channel:re(N)}):""}),I&&Ie?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y,onClick:()=>_(!1),"data-testid":"sekyro-otp-back-to-code",children:l("otp.backToCode")}):null]})]})}i(lt,"PhoneOtpStep");import{lazy as ln,Suspense as cn,useMemo as un,useState as dn}from"react";import{jsx as he,jsxs as mn}from"react/jsx-runtime";var pn={load:i(()=>import("../email-otp-view-CMJHROOH.js"),"load")};function ct({locale:e,strings:t,...n}){let r=C(e,t),[a,s]=dn(0),o=un(()=>ln(()=>pn.load().then(u=>({default:u.EmailOtpView}))),[a]),l=mn(x,{tone:"danger",children:[he("span",{children:r.t("errors.network_error")}),he(h,{kind:"secondary",onClick:()=>s(u=>u+1),children:r.t("common.retry")})]});return he(J,{fallback:l,children:he(cn,{fallback:he("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:he(o,{...n,i18n:r})})},a)}i(ct,"EmailOtpStep");import{lazy as fn,Suspense as yn,useMemo as gn,useState as kn}from"react";import{jsx as be,jsxs as hn}from"react/jsx-runtime";var Sn={load:i(()=>import("../eid-view-U2HL2IX7.js"),"load")};function ut({locale:e,strings:t,...n}){let r=C(e,t),[a,s]=kn(0),o=gn(()=>fn(()=>Sn.load().then(u=>({default:u.EidView}))),[a]),l=hn(x,{tone:"danger",children:[be("span",{children:r.t("errors.network_error")}),be(h,{kind:"secondary",onClick:()=>s(u=>u+1),children:r.t("common.retry")})]});return be(J,{fallback:l,children:be(yn,{fallback:be("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:be(o,{...n,i18n:r})})},a)}i(ut,"EidStep");import{useMemo as bn}from"react";import{jsx as dt,jsxs as vn}from"react/jsx-runtime";function pt({step:e,locale:t,strings:n,className:r,onError:a}){let s=C(t,n),{busy:o,error:l,run:u}=no(s,a),p=bn(()=>e.choice.options.flatMap(g=>{let k=oo(g,s),m=to[g.service];return k===null?[]:[{id:g.id,label:k,glyph:m&&dt(D,{name:m})}]}),[e.choice.options,s]),f=e.choice.options.find(g=>g.service==="national_eid");return vn("div",{className:r,children:[dt(Vt,{title:s.t("method.heading"),description:s.t("method.description"),options:p,busy:o,error:l,focus:!0,testId:"sekyro-method",onChoose:g=>u(()=>e.choose(g))}),f?.nationalEid?.afterPass==="continue"?dt(B,{view:"EidContinueHint",i18n:s,provider:f.nationalEid.providerName,quiet:!0}):null]})}i(pt,"MethodChoice");import{isValidNni as Cn,normalizeNni as yo}from"@sekyro/web";import{useId as wn,useState as mt}from"react";import{Fragment as xn,jsx as A,jsxs as ve}from"react/jsx-runtime";var Nn=new Set(["nni_not_found","registry_record_not_found"]),_n=new Set(["nni_invalid","id_number_invalid"]);function Ze({step:e,locale:t,strings:n,className:r,onError:a}){let s=C(t,n),{t:o}=s,[l,u]=mt(""),[p,f]=mt(!1),[g,k]=mt(null),m=wn(),y=e.attemptsExhausted,w=i(async H=>{f(!0),k(null);try{await H()}catch(V){k(ue(V,s.strings)),a?.(V)}finally{f(!1)}},"run"),N=i(H=>{if(H.preventDefault(),e.source!=="typed"){w(()=>e.confirm());return}let V=yo(l);if(!/^\d{10}$/.test(V))return k("population.invalid");if(!Cn(V))return k("population.reason_id_number_invalid");w(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(V):e.submitNni(V))},"onSubmit"),O=Ye(s,e.attemptsRemaining,y),R=e.reason!==void 0&&Nn.has(e.reason),S=e.reason!==void 0&&_n.has(e.reason),I=ve(xn,{children:[e.reason==="registry_unavailable"?ve(x,{tone:"warning",children:[A("span",{children:o("population.reason_registry_unavailable")}),A("span",{children:O})]}):null,R&&e.canUseDocument?ve(x,{tone:"warning",children:[A("span",{children:o("population.reason_registry_record_not_found_or_document")}),A("span",{children:O}),A(h,{kind:"secondary",disabled:p,onClick:()=>{w(()=>e.useDocument())},children:o("population.useDocument")})]}):null,R&&!e.canUseDocument||S?ve(x,{tone:"danger",children:[A("span",{children:o(R?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),A("span",{children:O})]}):null,y&&e.reason===void 0?A(x,{tone:"danger",children:A("span",{children:O})}):null,g!==null?A(x,{tone:"danger",children:A("span",{children:o(g)})}):null]}),[_,W,M]=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 ve("form",{className:`sekyro-step${r?` ${r}`:""}`,"aria-labelledby":m,onSubmit:N,noValidate:!0,children:[A(Q,{id:m,title:o(_),lead:o(W)}),I,e.source==="typed"?ve("div",{className:"sekyro-field",children:[A("label",{className:"sekyro-label",htmlFor:`${m}-id-number`,children:o("population.label")}),A("input",{id:`${m}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:o("population.placeholder"),value:l,"aria-describedby":`${m}-id-number-help`,"aria-invalid":g==="population.invalid"||g==="population.reason_id_number_invalid"||void 0,onChange:H=>{k(null),u(yo(H.target.value).replace(/\D/g,"").slice(0,10))}}),A("span",{id:`${m}-id-number-help`,className:"sekyro-help",children:o("population.helper")})]}):null,A(X,{children:y?null:A(h,{type:"submit",full:!0,disabled:p,"aria-busy":p||void 0,children:o(M)})})]})}i(Ze,"IdNumberEntry");function Pn(e){return Ze(e)}i(Pn,"NniEntry");import{acceptedIssuers as Rn,acceptedTypesFor as bo,warmDocumentCapture as On}from"@sekyro/web";import{lazy as Bn,Suspense as Ln,useEffect as An,useMemo as Vn,useState as yt}from"react";import{acceptedIssuers as In,acceptedTypesFor as ft}from"@sekyro/web";import{useEffect as go,useMemo as ko,useState as So}from"react";import{jsx as z,jsxs as Qe}from"react/jsx-runtime";var Tn=220;function En(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),l=i(u=>{if(u===r)return-1;let p=n.indexOf(u);return p<0?n.length:p},"rank");return s.sort((u,p)=>l(u.code)-l(p.code)||o.compare(u.name,p.name))}i(En,"countryNames");function ho({step:e,i18n:t,issuer:n,onPicked:r,ageStepUp:a=!1}){let{t:s,locale:o}=t,l=ko(()=>In(e.documents),[e.documents]),u=ko(()=>En(o,l,Object.keys(e.documents.byIssuer??{}),e.detectedCountry),[o,l,e.documents,e.detectedCountry]),p=l.length===1?l[0]:null,[f,g]=So(n??p),[k,m]=So(null),y=p===null?[]:ft(e.documents,p),w=p!==null&&y.length===1?y[0]:null;go(()=>{p!==null&&w!==null&&e.selectDocument(p,w)},[p,w]);let N=i((S,I)=>{e.selectDocument(S,I),r?.()},"pick"),O=i(S=>{let I=ft(e.documents,S);I.length===1?N(S,I[0]):g(S)},"chooseIssuer");if(go(()=>{if(k===null||f===null)return;let S=setTimeout(()=>N(f,k),Tn);return()=>clearTimeout(S)},[k]),ze(f!==null&&l.length>1&&n===void 0?()=>{g(null),m(null)}:null),w!==null)return null;if(f===null)return Qe("section",{className:"sekyro-step",children:[z(Q,{title:s("doc.countryTitle"),lead:s(a?"doc.ageStepUp":"doc.pickDescription")}),z(Gt,{countries:u,label:s("doc.countryLabel"),searchPlaceholder:s("doc.countrySearch"),noMatch:s("doc.noCountryMatch"),onPick:O}),z(X,{children:null})]});let R=ft(e.documents,f);return Qe("section",{className:"sekyro-step",children:[z(Q,{title:s("doc.pickTitle"),lead:s(a&&p!==null?"doc.ageStepUp":"native.doc.holdIt")}),z("div",{className:"sekyro-choices",children:R.map(S=>Qe("button",{type:"button",className:"sekyro-card","aria-pressed":k===S,disabled:k!==null&&k!==S,onClick:()=>m(S),children:[z("span",{className:"sekyro-card__tile",children:z(D,{name:S==="passport"?"passport":"card"})}),Qe("span",{className:"sekyro-card__body",children:[z("span",{className:"sekyro-card__title",children:s(`doc.type.${S}`)}),z("span",{className:"sekyro-card__sub",children:s(`doc.sub.${S}`)})]}),z("span",{className:"sekyro-radio","aria-hidden":"true"})]},S))}),l.length>1?z("button",{type:"button",className:"sekyro-link",onClick:()=>{g(null),m(null)},children:s("native.doc.changeCountry")}):null,z(X,{children:null})]})}i(ho,"DocumentPicker");import{jsx as se,jsxs as Dn}from"react/jsx-runtime";var Fn={load:i(()=>import("../document-capture-view-5FWUD45F.js"),"load")};function gt({step:e,locale:t,strings:n,className:r,liveMrz:a,barcodeAssetBaseUrl:s}){let o=C(t,n),[l,u]=yt(0),[p,f]=yt(null),g=Rn(e.documents),k=g.length>1,m=e.issuer!==null&&bo(e.documents,e.issuer).length>1,y=e.documentType===null||e.issuer===null||p!==null,w=g.length===1&&bo(e.documents,g[0]).length===1,[N]=yt(()=>y&&!w),O=e.ageStepUp===!0,R=Vn(()=>Bn(()=>Fn.load().then(I=>({default:I.DocumentCaptureView}))),[l]);An(()=>{On()},[]);let S=Dn(x,{tone:"danger",children:[se("span",{children:o.t("errors.network_error")}),se(h,{kind:"secondary",onClick:()=>u(I=>I+1),children:o.t("doc.retryCamera")})]});return se("div",{className:r,children:y?se(ho,{step:e,i18n:o,ageStepUp:O&&p===null&&N,...p==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>f(null)}):se(J,{fallback:S,children:se(Ln,{fallback:se("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:se(R,{step:e,i18n:o,ageLead:O&&!N,liveMrz:e.documentType==="drivers_license"?void 0:a,barcodeAssetBaseUrl:s,...k?{onChangeCountry:i(()=>f("country"),"onChangeCountry")}:{},...m?{onChangeDocument:i(()=>f("document"),"onChangeDocument")}:{}})})},l)})}i(gt,"DocumentCapture");import{warmPortraitCapture as Mn}from"@sekyro/web";import{Component as Hn,lazy as vo,Suspense as Co,useContext as Un,useEffect as $n,useMemo as wo,useState as No}from"react";import{jsx as E,jsxs as Je}from"react/jsx-runtime";var Kn={load:i(()=>import("../portrait-capture-view-UYISOXXV.js"),"load")},zn={load:i(()=>import("../portrait-review-view-67VI2Q6K.js"),"load")},St=class St extends Hn{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(St,"LoadBoundary");var Xe=St;function Gn({step:e,i18n:t}){let{t:n}=t,r=ke();return Je("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[E("h2",{ref:r,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?E("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?Je(x,{tone:"danger",children:[E("span",{children:n("portrait.uploadFailed")}),E(h,{kind:"secondary",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):E("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}i(Gn,"MatchPhase");function kt({step:e,locale:t,strings:n,className:r,assetBaseUrl:a,verification:s}){let o=C(t,n),l=Ft(s),u=Un(qe),[p,f]=No(0),[g,k]=No(null),m=wo(()=>vo(()=>Kn.load().then(M=>({default:M.PortraitCaptureView}))),[p]),y=wo(()=>vo(()=>zn.load().then(M=>({default:M.PortraitScreens}))),[p]),w=typeof e.uploadPortrait=="function",N=w?e.photo?.source??"camera":"camera",O=w&&N!=="camera"&&e.photo?.uploadOffered===!0,R=N!=="upload",S=N==="upload"?"upload":N==="choice"?g??e.photo?.pick??"source":"camera",I=e.phase==="capture"&&e.photo?.cameraOnPhone===!0;if($n(()=>{e.phase==="capture"&&S==="camera"&&!I&&Mn()},[e.phase,S,I]),e.phase==="match")return E("div",{className:r,children:E(Gn,{step:e,i18n:o})});let _=E("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"&&S==="camera")return Je("section",{className:`sekyro-step${r?` ${r}`:""}`,children:[E(Q,{title:o.t("session.steps.portrait.title")}),E(X,{children:E(h,{kind:"secondary",full:!0,disabled:u.busy,onClick:u.reset,children:o.t("portrait.retryCamera")})})]});if(e.phase==="review"||S!=="camera"||I)return E("div",{className:r,children:E(Xe,{fallback:E(h,{kind:"ghost",onClick:()=>f(M=>M+1),children:o.t("common.retry")}),children:E(Co,{fallback:_,children:E(y,{screen:e.phase==="review"?"review":I&&S==="camera"?"phone":S==="camera"?"review":S,step:e,i18n:o,...R?{onCamera:i(()=>k("camera"),"onCamera")}:{},onUpload:()=>k("upload"),onDeclined:()=>k(null)})})},p)});if(!l.settled)return E("div",{className:r,children:_});let W=Je(x,{tone:"danger",children:[E("span",{children:o.t("errors.network_error")}),E(h,{kind:"secondary",onClick:()=>f(M=>M+1),children:o.t("portrait.retryCamera")})]});return E("div",{className:r,children:E(Xe,{fallback:W,children:E(Co,{fallback:_,children:E(m,{step:e,i18n:o,...a!==void 0?{assetBaseUrl:a}:{},...O?{onUpload:i(()=>k("upload"),"onUpload")}:{}})})},p)})}i(kt,"PortraitCapture");import{lazy as qn,Suspense as Yn,useMemo as Wn,useState as Zn}from"react";import{jsx as de,jsxs as Xn}from"react/jsx-runtime";var Qn={load:i(()=>import("../proof-of-address-view-EIQXYYM3.js"),"load")};function ht({step:e,locale:t,strings:n,className:r}){let a=C(t,n),[s,o]=Zn(0),l=Wn(()=>qn(()=>Qn.load().then(p=>({default:p.ProofOfAddressView}))),[s]),u=Xn(x,{tone:"danger",children:[de("span",{children:a.t("errors.network_error")}),de(h,{kind:"secondary",onClick:()=>o(p=>p+1),children:a.t("common.retry")})]});return de("div",{className:r,children:de(J,{fallback:u,children:de(Yn,{fallback:de("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:a.t("common.loading")}),children:de(l,{step:e,i18n:a})})},s)})}i(ht,"ProofOfAddress");import{lazy as Jn,Suspense as jn,useMemo as er,useState as tr}from"react";import{jsx as pe,jsxs as nr}from"react/jsx-runtime";var or={load:i(()=>import("../form-view-WVPN7ZUY.js"),"load")};function bt({step:e,locale:t,strings:n,className:r,onError:a}){let s=C(t,n),[o,l]=tr(0),u=er(()=>Jn(()=>or.load().then(f=>({default:f.FormView}))),[o]),p=nr(x,{tone:"danger",children:[pe("span",{children:s.t("errors.network_error")}),pe(h,{kind:"secondary",onClick:()=>l(f=>f+1),children:s.t("common.retry")})]});return pe("div",{className:r,children:pe(J,{fallback:p,children:pe(jn,{fallback:pe("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:pe(u,{step:e,i18n:s,...a!==void 0?{onError:a}:{}})})},o)})}i(bt,"FormStep");import{cameraUnavailableCauseOf as Nr}from"@sekyro/web";import{useCallback as j,useContext as _r,useEffect as Ve,useId as Pr,useMemo as Tt,useRef as ee,useState as Y}from"react";var vt={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 Be={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"}}},rr=["danger","success","warning","info"];function Ct(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}i(Ct,"channel");function _o(e){let t=Ct(parseInt(e.slice(1,3),16)),n=Ct(parseInt(e.slice(3,5),16)),r=Ct(parseInt(e.slice(5,7),16));return .2126*t+.7152*n+.0722*r}i(_o,"luminance");function sr(e,t){let n=_o(e),r=_o(t),a=Math.max(n,r),s=Math.min(n,r);return(a+.05)/(s+.05)}i(sr,"contrastRatio");function Po(e,t){return Math.min(...rr.map(n=>sr(Be[e][n].fg,t)))}i(Po,"worstAgainst");function xo(e,t,n){return Math.min(Po(e,t),Po(e,n))}i(xo,"worstStatusContrast");function Io(e,t){return xo("light",e,t)>=xo("dark",e,t)?"light":"dark"}i(Io,"statusSchemeFor");import{useRef as lr,useState as cr}from"react";import{useEffect as ir,useId as ar,useRef as wt}from"react";import{jsx as Ce,jsxs as To}from"react/jsx-runtime";function je({open:e,title:t,closeLabel:n,onClose:r,children:a,actions:s,role:o,testId:l,returnFocus:u}){let p=wt(null),f=wt(null),g=wt(!1),k=ar();return ir(()=>{let m=p.current;if(m!==null){if(e&&!m.open?(f.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 y=u?.current??(f.current instanceof HTMLElement?f.current:null);f.current=null,y?.focus()}g.current=e}},[e,u]),Ce("dialog",{ref:p,className:"sekyro-dialog","aria-labelledby":k,...o==="alertdialog"?{role:o}:{},"data-testid":l,onCancel:m=>{m.preventDefault(),r()},onClick:m=>{m.target===m.currentTarget&&r()},children:To("div",{className:"sekyro-dialog__panel",children:[To("div",{className:"sekyro-dialog__head",children:[Ce("h2",{id:k,className:"sekyro-dialog__title",children:t}),n!==void 0?Ce("button",{type:"button",className:"sekyro-disc sekyro-dialog__close","aria-label":n,onClick:r,children:Ce(D,{name:"close"})}):null]}),a!==void 0?Ce("div",{className:"sekyro-dialog__body",children:a}):null,s!==void 0?Ce("div",{className:"sekyro-dialog__actions",children:s}):null]})})}i(je,"FlowDialog");import{jsx as Le,jsxs as Eo}from"react/jsx-runtime";var ur=["intro","data","processing","sharing","retention"];function Ro({i18n:e,purpose:t="identity"}){let{t:n}=e,[r,a]=cr(!1),s=lr(null),[o,l=""]=n("consent.short").split("{terms}");return Eo("div",{className:"sekyro-consent","data-testid":"sekyro-consent",children:[Eo("p",{className:"sekyro-consent__line",children:[o,Le("button",{ref:s,type:"button",className:"sekyro-link sekyro-link--inline","aria-haspopup":"dialog",onClick:()=>a(!0),children:n("consent.termsLink")}),l]}),Le(je,{open:r,title:n("consent.termsTitle"),closeLabel:n("native.close"),onClose:()=>a(!1),returnFocus:s,testId:"sekyro-consent-terms",children:Le("div",{className:"sekyro-stack sekyro-stack--3",children:t==="human"?Le(B,{view:"HumanConsentTerms",i18n:e,quiet:!0}):ur.map(u=>Le("p",{children:n(`consent.terms.${u}`)},u))})})]})}i(Ro,"ConsentNotice");function Oo(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(Oo,"initials");import{useSyncExternalStore as dr}from"react";var Ao=i(e=>({colors:{...e?U.dark:U.light},radius:U.radius,fontFamily:U.font}),"brandTheme"),Xi=Ao(!1),Bo=/^#[0-9a-f]{6}$/i;function Nt(e,t,n){if(t)return null;let r=rt(e).colors,a=n?.colors?.bg??r?.bg,s=n?.colors?.surface??r?.surface;return a===void 0&&s===void 0||a!==void 0&&!Bo.test(a)||s!==void 0&&!Bo.test(s)?null:Io(a??U.light.bg,s??U.light.surface)}i(Nt,"partnerStatusScheme");function et(e,t,n){let r=rt(e);if(n&&r.colors!==void 0){let{brand:a,brandFg:s}=r.colors;a!==void 0&&yr(a,U.dark.bg)>=3?r.colors={brand:a,ring:a,...s!==void 0?{brandFg:s}:{}}:delete r.colors}if(Nt(e,n,t)==="dark"){let a=Be.dark;r.colors={...r.colors,danger:a.danger.base,success:a.success.base,warning:a.warning.fg}}return Ke(Ao(n),r,Mt(t))}i(et,"verificationTheme");function tt(e){let t=dr(fr,mr,()=>!1);return e==="dark"||e==="system"&&t}i(tt,"useDarkScheme");var pr="(prefers-color-scheme: dark)",Vo=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(pr):null,"media"),mr=i(()=>Vo()?.matches??!1,"prefersDark");function fr(e){let t=Vo();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i(fr,"subscribe");function yr(e,t){let[n,r]=[Lo(e),Lo(t)];return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}i(yr,"contrast");function Lo(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(Lo,"luminance");var _t="sekyro.testerGate";function Pt(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}i(Pt,"store");function Fo(e=Date.now()){try{Pt()?.setItem(_t,String(e))}catch{}}i(Fo,"rememberTester");function Do(e=Date.now()){try{let t=Number(Pt()?.getItem(_t)??"");return Number.isFinite(t)&&t>0&&e-t<2592e6}catch{return!1}}i(Do,"rememberedTester");function Mo(){try{Pt()?.removeItem(_t)}catch{}}i(Mo,"forgetTester");import{useEffect as gr,useId as kr,useState as Sr}from"react";import{jsx as L,jsxs as me}from"react/jsx-runtime";var Ho=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]),hr={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 br({screen:e}){if(e==="verified")return me("svg",{className:"sekyro-outcome sekyro-outcome--approved",viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[L("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"54",pathLength:"1"}),L("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),L("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}=hr[e];return L("span",{className:`sekyro-tile sekyro-tile--${n} sekyro-outcome-tile`,"aria-hidden":"true","data-screen":e,children:L(D,{name:t})})}i(br,"OutcomeMark");function vr({label:e,id:t,copied:n}){let[r,a]=Sr(!1);return gr(()=>{if(!r)return;let s=setTimeout(()=>a(!1),1600);return()=>clearTimeout(s)},[r]),me("button",{type:"button",className:`sekyro-reference${r?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[L("span",{"aria-live":"polite",children:r?n:e}),L("bdi",{dir:"ltr",children:t}),L(D,{name:"copy"})]})}i(vr,"ReferenceLine");function Cr({step:e,t}){let n=e.context.sandbox?e.context.simulation?.reason:void 0;return n===void 0?null:me(Re,{tone:"warning",role:"status",testId:"sekyro-simulated-notice",children:[L("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:L(D,{name:"info"})}),me("div",{className:"sekyro-notice__body","data-reason":n,children:[L("strong",{children:t("sandbox.simulatedTitle")}),L("span",{children:t(n==="no_testers"?"sandbox.simulatedNoTesters":"sandbox.simulatedGate")})]})]})}i(Cr,"SimulationNotice");function wr(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(wr,"resultTitleKey");function xt({step:e,locale:t,strings:n,className:r,onClose:a}){let s=C(t,n),{t:o}=s,l=kr(),u=ke(),p=e.context.orgName,f=e.reasonCode??"",g=e.display==="platform_unsupported"?"policy":e.display,k=i(y=>(p!==""||y==="verified")&&y!=="cooldown"?o(`native.result.${y}`,{org:p}):o(`session.result.${y}.description`),"partnerLine"),m;switch(e.display){case"rejected":m=Ho.has(ot(f))?o("session.result.detailsMismatch",{org:p}):k("rejected");break;case"policy":{if(Ho.has(ot(f)))m=o("session.result.detailsMismatch",{org:p});else if(f==="device_velocity_exceeded")m=o("session.result.deviceVelocity",{org:p});else if(f==="capture_tampered")m=o("session.result.deviceStop");else if(f==="camera_unavailable")m=o("reasons.camera_unavailable",{org:p});else if(f==="underage_estimated")m=o("reasons.underage_estimated");else if(f==="starter_credit_claimed")m=o("reasons.starter_credit_claimed");else if(f==="blocked_by_org")m=o("reasons.blocked_by_org");else{let y=f===""?null:Ot(f);m=y!==null?o(y,{org:p}):k("policy")}break}case"cooldown":{let y=Bt(s.locale,e.retryAfter);m=y!==null?o(y.key,{time:y.time}):o("session.result.cooldown.description");break}case"platform_unsupported":m=o("result.platform_unsupported");break;default:m=k(g)}return me("section",{className:`sekyro-result${r?` ${r}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[me("div",{className:"sekyro-result__body",children:[L(br,{screen:g}),me("div",{className:"sekyro-heading",children:[L("h2",{id:l,ref:u,tabIndex:-1,className:"sekyro-text-body",children:o(wr(g,e.result))}),L("p",{className:"sekyro-text-muted",children:m})]}),L(Cr,{step:e,t:o}),L(vr,{label:o("result.referenceLabel"),id:e.context.sessionId,copied:o("native.result.copied")})]}),a!==void 0?L("div",{className:"sekyro-actions",children:L(h,{full:!0,onClick:a,children:o("native.result.continue",{org:p})})}):null]})}i(xt,"VerificationResultScreen");import{Fragment as Ae,jsx as c,jsxs as G}from"react/jsx-runtime";function xr(e,t,n){let r=t?U.dark:U.light,a=t?U.roles.dark:U.roles.light,s=e.colors??{},o={},l=s.fg===r.fg&&s.surface===r.surface;s.brand===r.brand&&s.surface===r.surface&&(o["--sekyro-color-brand-soft"]=a.brandSoft),l&&(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===U.font&&(o["--sekyro-font-display"]=U.fontDisplay);let u=t?vt.dark:vt.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=Be[n];for(let f of["danger","success","warning","info"])o[`--sekyro-color-${f}-soft`]=p[f].soft,o[`--sekyro-color-${f}-fg`]=p[f].fg;o["--sekyro-color-on-success"]=p.success.on,o["--sekyro-color-on-danger"]=p.danger.on}return o}i(xr,"flowRoles");function Et(e){let{verification:t,locale:n,strings:r,onStep:a,onResult:s}=e,{step:o,error:l}=at(t);Ve(()=>{o!==null&&a?.(o)},[o,a]),Ve(()=>s===void 0?void 0:t.on("result",s),[t,s]);let u=tt(e.colorScheme??"light"),p=o?.context.branding,f=et(p,e.theme,u),[g,k]=Y(!1),m=`sekyro-verification${u?" sekyro-verification--dark":""}${g?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,y=ee(e.onClose);y.current=e.onClose;let w=ee(o);w.current=o;let N=j(()=>{let _=w.current;y.current?.(_?.kind==="result"?{reason:"finished",result:_.result}:{reason:"cancelled"})},[]),[O,R]=Y(null),S=j(()=>{let _=w.current;_!==null&&_.kind!=="result"&&_.context.consentRecorded?R("close"):N()},[N]),I=Tt(()=>t.reportCaptureIssue===void 0?null:_=>t.reportCaptureIssue?.(_),[t]);return c(Ut,{theme:f,className:m,children:c(Oe,{locale:n,...r!==void 0?{strings:r}:{},children:c("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:xr(f,u,Nt(p,u,e.theme)),children:c(Qt.Provider,{value:k,children:c(st.Provider,{value:e.onClose!==void 0?N:void 0,children:c(Ge.Provider,{value:e.onClose!==void 0?S:void 0,children:G(At.Provider,{value:I,children:[c(Br,{...e,step:o,error:l,immersive:g,onLeaveAsk:()=>R("history"),onClosed:N}),c(Er,{open:O!==null,onStay:()=>{O==="history"&&It(),R(null)},onLeave:()=>{let _=O;R(null),_==="close"||e.onClose!==void 0?N():typeof window<"u"&&zo()}})]})})})})})})})}i(Et,"SekyroVerification");function Ir(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(Ir,"processingCopyOf");function Tr({error:e,retry:t}){let{t:n}=C(),r=ke();return G(Re,{tone:"danger",testId:"sekyro-error-notice",children:[c("span",{children:n(Rt(e))}),e.retryable?c(h,{ref:r,kind:"secondary",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}i(Tr,"CameraErrorNotice");var $o="sekyroFlow";function Ko(){let e=window.history.state;return typeof e=="object"&&e!==null&&e[$o]===!0}i(Ko,"onGuard");function It(){if(typeof window>"u"||Ko())return;let e=window.history.state;window.history.pushState({...typeof e=="object"&&e!==null?e:{},[$o]:!0},"")}i(It,"pushGuard");function zo(){window.history.back()}i(zo,"leaveHistory");function Er({open:e,onStay:t,onLeave:n}){let{t:r}=C();return c(je,{open:e,role:"alertdialog",title:r("leave.title"),onClose:t,testId:"sekyro-leave",actions:G(Ae,{children:[c(h,{full:!0,onClick:t,children:r("leave.stay")}),c(h,{full:!0,kind:"danger",onClick:n,children:r("leave.confirm")})]}),children:c("p",{className:"sekyro-text-muted",children:r("leave.body")})})}i(Er,"LeaveDialog");function Rr(e,t){let[n,r]=Y(!1),[a,s]=Y(null),o=e===null?void 0:e.skipCapture,l=ee(o);l.current=o;let u=ee(!1),p=e?.key;Ve(()=>s(null),[p]);let f=j(()=>{if(u.current)return;let y=l.current;y!==void 0&&(u.current=!0,r(!0),s(null),y().catch(w=>s(t.t(ue(w,t.strings)))).finally(()=>{u.current=!1,r(!1)}))},[t]),g=j(()=>s(null),[]),k=o!==void 0,m=t.t("sandbox.skipCapture");return Tt(()=>k?{label:m,busy:n,failed:a,run:f,reset:g}:null,[k,m,n,a,f,g])}i(Rr,"useSkipCapture");function Or({skip:e}){return G(Ae,{children:[e.failed!==null?c(x,{tone:"danger",children:c("span",{children:e.failed})}):null,c(h,{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(Or,"SkipAction");function Br(e){let{step:t,error:n,slots:r,immersive:a}=e,s=C(),{t:o}=s,[l,u]=Y(!1),[p,f]=Y([]),g=j(d=>(f(P=>[...P,d]),()=>f(P=>P.filter(Z=>Z!==d))),[]),[k,m]=Y(null),y=j(d=>m(()=>d),[]),[w,N]=Y(0),[O,R]=Y(null),S=Rr(t,s),I=t?.context.testerGate!==void 0,[_,W]=Y(!1),M=ee(null);Ve(()=>{!I||M.current!==null||(M.current=Do(),M.current&&W(!0))},[I]);let H=t?.context.purpose??"identity",V=t?.context.returning===!0,fe=e.verification,Ne=H==="human"||t?.context.cameraUnavailableHandled===!0,Fe=fe.reportCameraUnavailable!==void 0&&Ne?d=>fe.reportCameraUnavailable?.(d)??Promise.resolve():void 0,De=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,$=e.handoffUrl,ie=j((d,P)=>Fe===void 0?void 0:c(B,{view:"NoCameraView",i18n:s,quiet:!0,cause:P,onRetry:d,...De?{onContinue:Fe}:{},...$!==void 0?{handoffUrl:$}:{}}),[s,fe,Ne,De,$]),ye=Tt(()=>ro(t),[t]),_e=j((d,P)=>c(so,{start:d,context:P,human:H==="human",returning:V,notice:P.permissionSettled&&P.permission==="denied"?ie(d,"denied"):void 0,...ye!==void 0?{retry:ye}:{}}),[H,V,ie,ye]),q=j((d,P)=>{let Z=Nr(d.kind);return(Z!==void 0?ie(P,Z):void 0)??G(Ae,{children:[c(Tr,{error:d,retry:P}),Z!==void 0&&$!==void 0?c(B,{view:"DesktopHandoffView",i18n:s,quiet:!0,url:$}):null]})},[ie,$,s]),Pe=ee(""),te=e.livenessProps?.slots?.stageOverlay,ae=j(d=>(d.guidance!==""&&!d.coached&&(Pe.current=d.guidance),c(ao,{testId:"sekyro-capture-stage",video:c("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:Pe.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:te?.(d.videoRef),ramp:d.ramp?.colour??null,...d.settled?{}:{onClose:i(()=>N(P=>P+1),"onClose")},end:d.modeSwitch!=null?c(Lt,{view:d.modeSwitch,className:"sekyro-glass sekyro-glass--label"}):null,children:d.settled||!d.live?null:c(Xt,{onStop:()=>N(P=>P+1)})})),[o,te]),Me=Pr(),He=t,xe=t!==null&&O===t.key&&t.context.switchable!==void 0,oe=k??(t===null||t.kind==="result"?null:xe?()=>R(null):t.context.switchable!==void 0&&typeof He?.chooseOption=="function"?()=>R(t.key):null),ne=ee(oe);ne.current=oe;let le=ee(t);le.current=t;let ce=ee({ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0});ce.current={ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0};let Ie=e.backNavigation==="history";if(Ve(()=>{if(!Ie||typeof window>"u")return;It();let d=i(()=>{if(Ko())return;let P=le.current,Z=ne.current;Z!==null?(Z(),It()):P?.kind!=="result"&&P?.context.consentRecorded===!0?ce.current.ask():ce.current.hostClose?ce.current.closed():zo()},"onPop");return window.addEventListener("popstate",d),()=>window.removeEventListener("popstate",d)},[Ie]),n!==null)return c(Re,{tone:"danger",children:c("span",{children:o(ue(n,s.strings))})});if(t===null)return G("div",{className:"sekyro-skeleton",role:"status","aria-busy":"true",children:[c("span",{className:"sekyro-visually-hidden",children:o("common.loading")}),c("span",{className:"sekyro-skeleton__bar is-title"}),c("span",{className:"sekyro-skeleton__bar"}),c("span",{className:"sekyro-skeleton__bar is-short"}),c("span",{className:"sekyro-skeleton__bar is-block"})]});let{context:F}=t,re=i(d=>{u(!0),d().finally(()=>u(!1))},"refresh"),Ue=r?.header??c(Ar,{context:F,headerId:Me,end:r?.headerEnd,...oe!==null?{onBack:oe}:{}}),T,ge=xe;if(_&&e.verification.testerGate!==void 0)T=c(nt.Provider,{value:ae,children:c(B,{view:"TesterGateView",i18n:s,verification:e.verification,attemptsLeft:F.testerGate?.attemptsLeft??0,livenessProps:{...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:e.livenessProps?.slots?.intro??_e},locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice},onBound:()=>Fo(),onDone:d=>{d&&Mo(),W(!1)}})});else if(ge)T=c(B,{view:"LaneChoiceView",i18n:s,step:t,onClose:()=>R(null)});else switch(t.kind){case"phone_otp":T=c(lt,{step:t});break;case"email_otp":T=c(ct,{step:t});break;case"method":T=c(pt,{step:t});break;case"registry":T=c(Ze,{step:t});break;case"document":T=c(gt,{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,P={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??_e,...d===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:q}:{}},...w>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};T=c(nt.Provider,{value:ae,children:t.instructions==="icao"||t.livePhoto?.icao===!0?c(B,{view:"LivePhotoLiveness",i18n:s,step:t,livenessProps:P,sekyroIntro:d===void 0},w):c(Dt,{...P},w)});break}case"portrait":T=G(Ae,{children:[t.retakeOnly?c(B,{view:"PortraitRetakeNotice",i18n:s,quiet:!0}):null,c(kt,{step:t,verification:e.verification,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"proof_of_address":T=c(ht,{step:t});break;case"form":T=c(bt,{step:t});break;case"contact_choice":T=c(B,{view:"ContactChoiceView",i18n:s,step:t});break;case"choice":T=c(B,{view:"GenericChoiceView",i18n:s,step:t});break;case"identity_summary":T=c(B,{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;T=e.handoffUrl!==void 0?c(B,{view:"HandoffView",i18n:s,url:e.handoffUrl,refresh:t.refresh,...d!==void 0?{lead:d}:{}}):c(We,{tone:"brand",icon:"smartphone",title:o("handoff.title"),actions:c(h,{kind:"secondary",full:!0,disabled:l,onClick:()=>re(t.refresh),children:o("common.refresh")}),children:c("p",{children:d??o("reasons.mobile_required")})});break}case"native_app_required":T=c(B,{view:"NativeAppView",i18n:s,org:F.orgName,nativeApp:t.nativeApp,...e.handoffUrl!==void 0?{fallbackUrl:e.handoffUrl}:{},refresh:t.refresh,footer:c(Uo,{org:F.orgName})});break;case"processing":{let d=Ir(s.strings,t.service);T=c(We,{tone:"brand",icon:"pending",busy:!t.stalled,live:!0,title:d?.title??o("session.processing.title"),actions:t.stalled?c(h,{kind:"secondary",full:!0,disabled:l,onClick:()=>re(t.refresh),children:o("common.refresh")}):null,children:c("p",{children:d?.description??o("session.processing.description")})});break}case"eid":T=c(ut,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";T=c(We,{tone:"neutral",icon:"smartphone",title:o(d?"needsApp.title":"unsupported.title"),actions:c(Uo,{org:F.orgName}),children:c("p",{children:d?F.orgName!==""?o("needsApp.description",{org:F.orgName}):o("needsApp.descriptionNoOrg"):o("unsupported.description",{org:F.orgName})})});break}case"result":T=r?.result?.(t)??c(Lr,{step:t});break;default:{let d=t;T=null}}let Te=!a&&!F.consentRecorded&&t.kind!=="result"?c(Ro,{i18n:s,purpose:F.purpose}):null,$e=S!==null&&!a&&!ge&&!_?c(Or,{skip:S}):null,Ee=I&&!_&&!a&&!ge&&e.verification.testerGate!==void 0?c(B,{view:"TesterGateAction",i18n:s,quiet:!0,onOpen:()=>W(!0)}):null,v=$e===null&&Ee===null?Te:G(Ae,{children:[Ee,$e,Te]});return c(Zt.Provider,{value:y,children:c(qe.Provider,{value:S,children:c(io.Provider,{value:e.handoffUrl,children:G(Wt.Provider,{value:v===null?null:{node:v,owner:p[0]??null,claim:g},children:[a?null:Ue,!a&&t.kind!=="result"&&F.sections.length>1?c(Vr,{context:F,current:t.section,i18n:s}):null,c(jt,{pageKey:t.key,children:T}),!a&&!ge&&t.kind!=="result"&&t.context.switchable!==void 0?c(B,{view:"LaneSwitch",i18n:s,step:t,onOpen:()=>R(t.key),quiet:!0},t.key):null,p.length===0?v:null,a?null:r?.footer!==void 0?r.footer:F.branding?.hideAttribution===!0?null:G("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[c(D,{name:"lock"}),o("shell.verifiedBy")]})]})})})})}i(Br,"Body");function Uo({org:e}){let{t}=C(),n=_r(st);return n===void 0?null:c(h,{full:!0,onClick:n,children:t("native.result.continue",{org:e})})}i(Uo,"BackToOrg");function Lr({step:e}){return c(Ge.Consumer,{children:t=>c(xt,{step:e,...t!==void 0?{onClose:t}:{}})})}i(Lr,"ResultPage");function Ar({context:e,headerId:t,end:n,onBack:r}){let{t:a}=C(),[s,o]=Y(!1),l=s?void 0:e.branding?.logoUrl,u=e.orgName!==""?e.orgName:a(e.returning?"returning.heading":"session.title");return c("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:G("div",{className:"sekyro-org",children:[r!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__back","aria-label":a("common.back"),onClick:r,"data-testid":"sekyro-back",children:c(D,{name:"back"})}):null,c("span",{className:"sekyro-org__tile","aria-hidden":"true",children:l!==void 0?c("img",{className:"sekyro-org__logo",src:l,alt:"",onError:()=>o(!0)}):Oo(e.orgName)}),G("div",{className:"sekyro-org__text",children:[c("h1",{id:t,className:"sekyro-org__name",children:u}),c("p",{className:"sekyro-org__sub",children:a(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),e.sandbox?c("span",{className:"sekyro-sandbox-badge","data-testid":"sekyro-sandbox-badge",children:a("app.sandboxBadge")}):null,n!=null?c("div",{className:"sekyro-org__end",children:n}):null,c(Ge.Consumer,{children:p=>p!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":a("native.close"),onClick:p,children:c(D,{name:"close"})}):null})]})})}i(Ar,"OrgHeader");function Vr({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,l)=>({id:o,state:l<r?"done":l===r?"current":"upcoming"}));return c("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:s.map(({id:o,state:l})=>c("li",{className:`sekyro-progress__bar${l==="done"?" is-done":l==="current"?" is-current":""}`,...l==="current"?{"aria-current":"step"}:{},children:c("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${o}`]??o})},o))})}i(Vr,"SectionProgress");import{useEffect as Fr,useState as Go}from"react";import{jsx as we}from"react/jsx-runtime";function Dr(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i(Dr,"pageUrl");function Mr({hostedUrl:e,inAppBrowser:t,...n}){let[r,a]=Go(t===!0);Fr(()=>{t===void 0&&it()&&a(!0)},[t]);let[s,o]=Go(!1),l=tt(n.colorScheme??"light"),u=n.handoffUrl??e??Dr();return r&&!s?we(Ht,{theme:Ke(et(void 0,void 0,l),n.theme),className:`sekyro-verification${l?" sekyro-verification--dark":""}${n.className!==void 0?` ${n.className}`:""}`,children:we(Oe,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:we("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-flow",children:we(Hr,{url:u,onContinue:()=>o(!0)})})})}):we(Et,{...n,...u!==""?{handoffUrl:u}:{}})}i(Mr,"SekyroFlow");function Hr({url:e,onContinue:t}){let n=C();return we(B,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}i(Hr,"Prompt");export{gt as DocumentCapture,ut as EidStep,ct as EmailOtpStep,bt as FormStep,Ze as IdNumberEntry,pt as MethodChoice,Pn as NniEntry,lt as PhoneOtpStep,kt as PortraitCapture,ht as ProofOfAddress,Mr as SekyroFlow,Et as SekyroVerification,Oe as StepI18nProvider,xt as VerificationResultScreen,Wo as arSteps,Zo as enSteps,Xo as formatTemplate,Qo as frSteps,it as isInAppBrowser,qo as loadSekyroLocale,Jo as resolveSekyroStrings,Yo as retakeHintStringKey,C as useStepI18n,at as useVerificationStep};
|
|
2
|
+
import{a as ao}from"../chunk-PY5JTKRX.js";import{a as J,b as B,c as io}from"../chunk-4P5ISU3M.js";import{a as zt,b as Gt,d as qt,e as Yt}from"../chunk-ZARKJW2C.js";import{a as U,d as Mt,e as rt,f as Ke,g as Ht,h as Ut}from"../chunk-GKRVVHVX.js";import{a as $t,b as Kt,c as eo}from"../chunk-GUTF3SPK.js";import{a as to,b as oo,c as no,d as ro,e as so,f as it}from"../chunk-5PJVSDBR.js";import{a as We}from"../chunk-DGZL42KX.js";import{d as nt,f as Vt,g as Ft,j as Dt}from"../chunk-C2WE5DVD.js";import{b as Lt}from"../chunk-7BZUPVX6.js";import{a as At}from"../chunk-7MMT5M4E.js";import{a as ue}from"../chunk-VRDPGOXM.js";import{a as Wo,b as Zo,c as Qo,d as Xo,e as Jo,f as Oe,g as C}from"../chunk-LKOJEU4D.js";import{a as D,b as Q,c as Wt,d as X,e as Zt,f as ze,g as Ge,h as st,i as Qt,k as qe,l as Xt,m as Jt,o as jt,p as x,q as Ye}from"../chunk-76RNF33U.js";import"../chunk-DJDH4ZAM.js";import{a as h,c as ot,j as qo,l as Yo,n as Rt,o as Ot,p as Bt,r as Re,s as ke}from"../chunk-I3PYSGPF.js";import{a as i}from"../chunk-2KED7D2Q.js";import{useEffect as jo,useState as lo}from"react";function at(e){let[t,n]=lo(()=>e?.currentStep?.()??null),[r,a]=lo(null);return jo(()=>{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",l=>{s&&n(l)});return e.run().then(l=>{s&&n(u=>u??l)},l=>{s&&a(l)}),()=>{s=!1,o()}},[e]),{step:t,error:r}}i(at,"useVerificationStep");import{useEffect as co,useId as en,useMemo as tn,useRef as uo,useState as Se}from"react";import{Fragment as fo,jsx as b,jsxs as K}from"react/jsx-runtime";var po=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"),on=600,nn=30,rn=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),sn=["whatsapp","sms"],mo=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 an(e){let t=[];for(let n of e.phoneCountries??["MR"]){let r=e.phoneRules?.find(s=>s.code===n),a=r?.dial??zt(n);a!==void 0&&!t.some(s=>s.code===n)&&t.push({code:n,dial:`+${a}`,...r!==void 0?{rule:r}:{}})}return t}i(an,"phoneCountriesOf");function lt({step:e,locale:t,strings:n,className:r,defaultPhone:a,onError:s}){let o=C(t,n),{t:l}=o,u=tn(()=>an(e),[e.phoneCountries,e.phoneRules]),p=a??u[0]?.dial??"",f=e.phoneInternational===!0,g=qt({countries:u,international:f,closed:!!e.phoneRules?.length,defaultPhone:p}),[k,m]=Se(""),[y,w]=Se(!1),[N,O]=Se(null),[R,S]=Se(null),[I,_]=Se(!1),[W,M]=Se(null),H=uo(null),V=e.phase==="verify"&&!I,fe=e.phase==="verify",Ne=eo(fe),[Fe,De]=$t(e.reason==="otp_mismatch",e.attemptsRemaining,()=>m("")),$=en(),ie=uo(null);co(()=>{let v=setTimeout(()=>ie.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(v)},[V]);let ye=e.phase==="verify"?e.codeExpiresAt??"sent":null;co(()=>{ye!==null&&(_(!1),H.current!==null&&!mo.has(e.reason??"")&&M(H.current),H.current=null)},[ye]);let _e=i(async v=>{w(!0),S(null);try{await v()}catch(d){S(ue(d,o.strings)),s?.(d)}finally{w(!1),O(null)}},"run"),q=sn.filter(v=>(e.channels??[]).includes(v)),Pe=g.typed,te=!e.needsPhone||Pe!==null,ae=i((v,d=!1)=>{let P=e.needsPhone?d?W:{number:Pe??g.phone,shown:g.shown}:null;H.current=P,O(v??null),_e(async()=>{try{await e.send({...P!==null?{phone:P.number}:{},...v!==void 0?{channel:v}:{}})}catch(Z){throw H.current=null,Z}})},"send"),Me=i(v=>{_e(()=>e.verify(v))},"submitCode"),He=i(v=>{v.preventDefault(),V?Me(k):q.length<=1&&te&&ae(q[0])},"onSubmit"),xe=`${$}-phone`,oe=po(e.codeExpiresAt,Ne,on),ne=po(e.resendAvailableAt,Ne,nn),le=V&&e.codeExpiresAt!==void 0&&oe===0,ce=e.needsPhone&&!e.attemptsExhausted,Ie=fe&&(e.codeExpiresAt===void 0||oe>0),F=V&&ce?()=>_(!0):I&&Ie?()=>_(!1):null;ze(F===null?null:y?()=>{}:F);let re=i(v=>l(v==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),Ue=i(v=>y&&N!==null&&N===v,"busyFor"),[T,ge]=l("otp.sentTo",{channel:re(e.channel)}).split("{number}"),Te=e.context.simulation?.otpCode,$e=e.reason==="otp_mismatch"?K(x,{tone:"danger",children:[b("span",{children:l("otp.reason_otp_mismatch")}),b("span",{children:Ye(o,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&mo.has(e.reason)?b(x,{tone:"warning",children:b("span",{children:l(`otp.reason_${e.reason}`)})}):e.reason==="tester_phone_mismatch"?b(x,{tone:"warning",children:b("span",{children:l("reasons.tester_phone_mismatch")})}):null,Ee=K(fo,{children:[$e,R!==null?b(x,{tone:"danger",children:b("span",{children:l(R)})}):null]});if(V){let v=q.length===0;return K("form",{className:`sekyro-step sekyro-otp${r?` ${r}`:""}`,"aria-labelledby":$,onSubmit:He,noValidate:!0,children:[b(Q,{id:$,title:l("otp.verifyTitle"),lead:Te!==void 0?b(Jt,{template:l("sandbox.otpHint"),code:Te}):K(fo,{children:[T,b("bdi",{dir:"ltr",className:"sekyro-mono",children:W?.shown??e.sentToMasked}),ge]})}),Ee,K("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:`${$}-code`,children:l("otp.codeLabel")}),b(Kt,{id:`${$}-code`,value:k,invalid:Fe,onChange:d=>{d!==""&&De(),m(d),d.length===6&&k.length!==6&&!y&&!e.attemptsExhausted&&Me(d)}}),b("span",{className:`sekyro-help sekyro-otp-expiry${le?" is-danger":""}`,"aria-hidden":!le||void 0,children:le?l("otp.expired"):l("otp.expiresIn",{time:rn(oe)})})]}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:le?l("otp.expired"):""}),K(X,{children:[b(h,{type:"submit",full:!0,disabled:y||k.length!==6||e.attemptsExhausted,"aria-busy":y||void 0,children:l("otp.verify")}),K("div",{className:"sekyro-resend-row",children:[v?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y||ne>0,onClick:()=>ae(void 0,!0),children:ne>0?l("otp.resendIn",{seconds:ne}):l("otp.resend")}):ne>0?b("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:ne})}):q.map(d=>b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y,onClick:()=>ae(d,!0),children:l("otp.resendBy",{channel:re(d)})},d)),ce?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y,onClick:()=>_(!0),"data-testid":"sekyro-otp-change",children:l("otp.changeNumber")}):null]})]})]})}return K("form",{className:`sekyro-step sekyro-otp${r?` ${r}`:""}`,"aria-labelledby":$,onSubmit:He,noValidate:!0,children:[b(Q,{id:$,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),Ee,e.needsPhone?K("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:xe,children:l("otp.phoneLabel")}),b(Yt,{field:g,id:xe,locale:o.locale,t:l,inputRef:ie,ready:te})]}):b("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),K(X,{children:[q.length===1?b(h,{type:"submit",full:!0,disabled:y||!te,"aria-busy":Ue(q[0])||void 0,children:l("otp.sendBy",{channel:re(q[0])})}):q.length>1?K("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[b("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),b("div",{className:"sekyro-channel-row",children:q.map(v=>K(h,{kind:"primary",disabled:y||!te,"aria-busy":Ue(v)||void 0,onClick:()=>ae(v),children:[b(D,{name:v}),re(v)]},v))})]}):b(h,{type:"submit",full:!0,disabled:y||!te,"aria-busy":y||void 0,children:l("otp.send")}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:y&&N!==null?l("otp.sending",{channel:re(N)}):""}),I&&Ie?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y,onClick:()=>_(!1),"data-testid":"sekyro-otp-back-to-code",children:l("otp.backToCode")}):null]})]})}i(lt,"PhoneOtpStep");import{lazy as ln,Suspense as cn,useMemo as un,useState as dn}from"react";import{jsx as he,jsxs as mn}from"react/jsx-runtime";var pn={load:i(()=>import("../email-otp-view-6MD74OFN.js"),"load")};function ct({locale:e,strings:t,...n}){let r=C(e,t),[a,s]=dn(0),o=un(()=>ln(()=>pn.load().then(u=>({default:u.EmailOtpView}))),[a]),l=mn(x,{tone:"danger",children:[he("span",{children:r.t("errors.network_error")}),he(h,{kind:"secondary",onClick:()=>s(u=>u+1),children:r.t("common.retry")})]});return he(J,{fallback:l,children:he(cn,{fallback:he("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:he(o,{...n,i18n:r})})},a)}i(ct,"EmailOtpStep");import{lazy as fn,Suspense as yn,useMemo as gn,useState as kn}from"react";import{jsx as be,jsxs as hn}from"react/jsx-runtime";var Sn={load:i(()=>import("../eid-view-3QTJORA7.js"),"load")};function ut({locale:e,strings:t,...n}){let r=C(e,t),[a,s]=kn(0),o=gn(()=>fn(()=>Sn.load().then(u=>({default:u.EidView}))),[a]),l=hn(x,{tone:"danger",children:[be("span",{children:r.t("errors.network_error")}),be(h,{kind:"secondary",onClick:()=>s(u=>u+1),children:r.t("common.retry")})]});return be(J,{fallback:l,children:be(yn,{fallback:be("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:be(o,{...n,i18n:r})})},a)}i(ut,"EidStep");import{useMemo as bn}from"react";import{jsx as dt,jsxs as vn}from"react/jsx-runtime";function pt({step:e,locale:t,strings:n,className:r,onError:a}){let s=C(t,n),{busy:o,error:l,run:u}=no(s,a),p=bn(()=>e.choice.options.flatMap(g=>{let k=oo(g,s),m=to[g.service];return k===null?[]:[{id:g.id,label:k,glyph:m&&dt(D,{name:m})}]}),[e.choice.options,s]),f=e.choice.options.find(g=>g.service==="national_eid");return vn("div",{className:r,children:[dt(Vt,{title:s.t("method.heading"),description:s.t("method.description"),options:p,busy:o,error:l,focus:!0,testId:"sekyro-method",onChoose:g=>u(()=>e.choose(g))}),f?.nationalEid?.afterPass==="continue"?dt(B,{view:"EidContinueHint",i18n:s,provider:f.nationalEid.providerName,quiet:!0}):null]})}i(pt,"MethodChoice");import{isValidNni as Cn,normalizeNni as yo}from"@sekyro/web";import{useId as wn,useState as mt}from"react";import{Fragment as xn,jsx as A,jsxs as ve}from"react/jsx-runtime";var Nn=new Set(["nni_not_found","registry_record_not_found"]),_n=new Set(["nni_invalid","id_number_invalid"]);function Ze({step:e,locale:t,strings:n,className:r,onError:a}){let s=C(t,n),{t:o}=s,[l,u]=mt(""),[p,f]=mt(!1),[g,k]=mt(null),m=wn(),y=e.attemptsExhausted,w=i(async H=>{f(!0),k(null);try{await H()}catch(V){k(ue(V,s.strings)),a?.(V)}finally{f(!1)}},"run"),N=i(H=>{if(H.preventDefault(),e.source!=="typed"){w(()=>e.confirm());return}let V=yo(l);if(!/^\d{10}$/.test(V))return k("population.invalid");if(!Cn(V))return k("population.reason_id_number_invalid");w(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(V):e.submitNni(V))},"onSubmit"),O=Ye(s,e.attemptsRemaining,y),R=e.reason!==void 0&&Nn.has(e.reason),S=e.reason!==void 0&&_n.has(e.reason),I=ve(xn,{children:[e.reason==="registry_unavailable"?ve(x,{tone:"warning",children:[A("span",{children:o("population.reason_registry_unavailable")}),A("span",{children:O})]}):null,R&&e.canUseDocument?ve(x,{tone:"warning",children:[A("span",{children:o("population.reason_registry_record_not_found_or_document")}),A("span",{children:O}),A(h,{kind:"secondary",disabled:p,onClick:()=>{w(()=>e.useDocument())},children:o("population.useDocument")})]}):null,R&&!e.canUseDocument||S?ve(x,{tone:"danger",children:[A("span",{children:o(R?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),A("span",{children:O})]}):null,y&&e.reason===void 0?A(x,{tone:"danger",children:A("span",{children:O})}):null,g!==null?A(x,{tone:"danger",children:A("span",{children:o(g)})}):null]}),[_,W,M]=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 ve("form",{className:`sekyro-step${r?` ${r}`:""}`,"aria-labelledby":m,onSubmit:N,noValidate:!0,children:[A(Q,{id:m,title:o(_),lead:o(W)}),I,e.source==="typed"?ve("div",{className:"sekyro-field",children:[A("label",{className:"sekyro-label",htmlFor:`${m}-id-number`,children:o("population.label")}),A("input",{id:`${m}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:o("population.placeholder"),value:l,"aria-describedby":`${m}-id-number-help`,"aria-invalid":g==="population.invalid"||g==="population.reason_id_number_invalid"||void 0,onChange:H=>{k(null),u(yo(H.target.value).replace(/\D/g,"").slice(0,10))}}),A("span",{id:`${m}-id-number-help`,className:"sekyro-help",children:o("population.helper")})]}):null,A(X,{children:y?null:A(h,{type:"submit",full:!0,disabled:p,"aria-busy":p||void 0,children:o(M)})})]})}i(Ze,"IdNumberEntry");function Pn(e){return Ze(e)}i(Pn,"NniEntry");import{acceptedIssuers as Rn,acceptedTypesFor as bo,warmDocumentCapture as On}from"@sekyro/web";import{lazy as Bn,Suspense as Ln,useEffect as An,useMemo as Vn,useState as yt}from"react";import{acceptedIssuers as In,acceptedTypesFor as ft}from"@sekyro/web";import{useEffect as go,useMemo as ko,useState as So}from"react";import{jsx as z,jsxs as Qe}from"react/jsx-runtime";var Tn=220;function En(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),l=i(u=>{if(u===r)return-1;let p=n.indexOf(u);return p<0?n.length:p},"rank");return s.sort((u,p)=>l(u.code)-l(p.code)||o.compare(u.name,p.name))}i(En,"countryNames");function ho({step:e,i18n:t,issuer:n,onPicked:r,ageStepUp:a=!1}){let{t:s,locale:o}=t,l=ko(()=>In(e.documents),[e.documents]),u=ko(()=>En(o,l,Object.keys(e.documents.byIssuer??{}),e.detectedCountry),[o,l,e.documents,e.detectedCountry]),p=l.length===1?l[0]:null,[f,g]=So(n??p),[k,m]=So(null),y=p===null?[]:ft(e.documents,p),w=p!==null&&y.length===1?y[0]:null;go(()=>{p!==null&&w!==null&&e.selectDocument(p,w)},[p,w]);let N=i((S,I)=>{e.selectDocument(S,I),r?.()},"pick"),O=i(S=>{let I=ft(e.documents,S);I.length===1?N(S,I[0]):g(S)},"chooseIssuer");if(go(()=>{if(k===null||f===null)return;let S=setTimeout(()=>N(f,k),Tn);return()=>clearTimeout(S)},[k]),ze(f!==null&&l.length>1&&n===void 0?()=>{g(null),m(null)}:null),w!==null)return null;if(f===null)return Qe("section",{className:"sekyro-step",children:[z(Q,{title:s("doc.countryTitle"),lead:s(a?"doc.ageStepUp":"doc.pickDescription")}),z(Gt,{countries:u,label:s("doc.countryLabel"),searchPlaceholder:s("doc.countrySearch"),noMatch:s("doc.noCountryMatch"),onPick:O}),z(X,{children:null})]});let R=ft(e.documents,f);return Qe("section",{className:"sekyro-step",children:[z(Q,{title:s("doc.pickTitle"),lead:s(a&&p!==null?"doc.ageStepUp":"native.doc.holdIt")}),z("div",{className:"sekyro-choices",children:R.map(S=>Qe("button",{type:"button",className:"sekyro-card","aria-pressed":k===S,disabled:k!==null&&k!==S,onClick:()=>m(S),children:[z("span",{className:"sekyro-card__tile",children:z(D,{name:S==="passport"?"passport":"card"})}),Qe("span",{className:"sekyro-card__body",children:[z("span",{className:"sekyro-card__title",children:s(`doc.type.${S}`)}),z("span",{className:"sekyro-card__sub",children:s(`doc.sub.${S}`)})]}),z("span",{className:"sekyro-radio","aria-hidden":"true"})]},S))}),l.length>1?z("button",{type:"button",className:"sekyro-link",onClick:()=>{g(null),m(null)},children:s("native.doc.changeCountry")}):null,z(X,{children:null})]})}i(ho,"DocumentPicker");import{jsx as se,jsxs as Dn}from"react/jsx-runtime";var Fn={load:i(()=>import("../document-capture-view-QMXAAYA2.js"),"load")};function gt({step:e,locale:t,strings:n,className:r,liveMrz:a,barcodeAssetBaseUrl:s}){let o=C(t,n),[l,u]=yt(0),[p,f]=yt(null),g=Rn(e.documents),k=g.length>1,m=e.issuer!==null&&bo(e.documents,e.issuer).length>1,y=e.documentType===null||e.issuer===null||p!==null,w=g.length===1&&bo(e.documents,g[0]).length===1,[N]=yt(()=>y&&!w),O=e.ageStepUp===!0,R=Vn(()=>Bn(()=>Fn.load().then(I=>({default:I.DocumentCaptureView}))),[l]);An(()=>{On()},[]);let S=Dn(x,{tone:"danger",children:[se("span",{children:o.t("errors.network_error")}),se(h,{kind:"secondary",onClick:()=>u(I=>I+1),children:o.t("doc.retryCamera")})]});return se("div",{className:r,children:y?se(ho,{step:e,i18n:o,ageStepUp:O&&p===null&&N,...p==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>f(null)}):se(J,{fallback:S,children:se(Ln,{fallback:se("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:se(R,{step:e,i18n:o,ageLead:O&&!N,liveMrz:e.documentType==="drivers_license"?void 0:a,barcodeAssetBaseUrl:s,...k?{onChangeCountry:i(()=>f("country"),"onChangeCountry")}:{},...m?{onChangeDocument:i(()=>f("document"),"onChangeDocument")}:{}})})},l)})}i(gt,"DocumentCapture");import{warmPortraitCapture as Mn}from"@sekyro/web";import{Component as Hn,lazy as vo,Suspense as Co,useContext as Un,useEffect as $n,useMemo as wo,useState as No}from"react";import{jsx as E,jsxs as Je}from"react/jsx-runtime";var Kn={load:i(()=>import("../portrait-capture-view-6EUUL2QA.js"),"load")},zn={load:i(()=>import("../portrait-review-view-TTVTYGLG.js"),"load")},St=class St extends Hn{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(St,"LoadBoundary");var Xe=St;function Gn({step:e,i18n:t}){let{t:n}=t,r=ke();return Je("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[E("h2",{ref:r,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?E("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?Je(x,{tone:"danger",children:[E("span",{children:n("portrait.uploadFailed")}),E(h,{kind:"secondary",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):E("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}i(Gn,"MatchPhase");function kt({step:e,locale:t,strings:n,className:r,assetBaseUrl:a,verification:s}){let o=C(t,n),l=Ft(s),u=Un(qe),[p,f]=No(0),[g,k]=No(null),m=wo(()=>vo(()=>Kn.load().then(M=>({default:M.PortraitCaptureView}))),[p]),y=wo(()=>vo(()=>zn.load().then(M=>({default:M.PortraitScreens}))),[p]),w=typeof e.uploadPortrait=="function",N=w?e.photo?.source??"camera":"camera",O=w&&N!=="camera"&&e.photo?.uploadOffered===!0,R=N!=="upload",S=N==="upload"?"upload":N==="choice"?g??e.photo?.pick??"source":"camera",I=e.phase==="capture"&&e.photo?.cameraOnPhone===!0;if($n(()=>{e.phase==="capture"&&S==="camera"&&!I&&Mn()},[e.phase,S,I]),e.phase==="match")return E("div",{className:r,children:E(Gn,{step:e,i18n:o})});let _=E("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"&&S==="camera")return Je("section",{className:`sekyro-step${r?` ${r}`:""}`,children:[E(Q,{title:o.t("session.steps.portrait.title")}),E(X,{children:E(h,{kind:"secondary",full:!0,disabled:u.busy,onClick:u.reset,children:o.t("portrait.retryCamera")})})]});if(e.phase==="review"||S!=="camera"||I)return E("div",{className:r,children:E(Xe,{fallback:E(h,{kind:"ghost",onClick:()=>f(M=>M+1),children:o.t("common.retry")}),children:E(Co,{fallback:_,children:E(y,{screen:e.phase==="review"?"review":I&&S==="camera"?"phone":S==="camera"?"review":S,step:e,i18n:o,...R?{onCamera:i(()=>k("camera"),"onCamera")}:{},onUpload:()=>k("upload"),onDeclined:()=>k(null)})})},p)});if(!l.settled)return E("div",{className:r,children:_});let W=Je(x,{tone:"danger",children:[E("span",{children:o.t("errors.network_error")}),E(h,{kind:"secondary",onClick:()=>f(M=>M+1),children:o.t("portrait.retryCamera")})]});return E("div",{className:r,children:E(Xe,{fallback:W,children:E(Co,{fallback:_,children:E(m,{step:e,i18n:o,...a!==void 0?{assetBaseUrl:a}:{},...O?{onUpload:i(()=>k("upload"),"onUpload")}:{}})})},p)})}i(kt,"PortraitCapture");import{lazy as qn,Suspense as Yn,useMemo as Wn,useState as Zn}from"react";import{jsx as de,jsxs as Xn}from"react/jsx-runtime";var Qn={load:i(()=>import("../proof-of-address-view-5WWGRXJL.js"),"load")};function ht({step:e,locale:t,strings:n,className:r}){let a=C(t,n),[s,o]=Zn(0),l=Wn(()=>qn(()=>Qn.load().then(p=>({default:p.ProofOfAddressView}))),[s]),u=Xn(x,{tone:"danger",children:[de("span",{children:a.t("errors.network_error")}),de(h,{kind:"secondary",onClick:()=>o(p=>p+1),children:a.t("common.retry")})]});return de("div",{className:r,children:de(J,{fallback:u,children:de(Yn,{fallback:de("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:a.t("common.loading")}),children:de(l,{step:e,i18n:a})})},s)})}i(ht,"ProofOfAddress");import{lazy as Jn,Suspense as jn,useMemo as er,useState as tr}from"react";import{jsx as pe,jsxs as nr}from"react/jsx-runtime";var or={load:i(()=>import("../form-view-YAGVGWMI.js"),"load")};function bt({step:e,locale:t,strings:n,className:r,onError:a}){let s=C(t,n),[o,l]=tr(0),u=er(()=>Jn(()=>or.load().then(f=>({default:f.FormView}))),[o]),p=nr(x,{tone:"danger",children:[pe("span",{children:s.t("errors.network_error")}),pe(h,{kind:"secondary",onClick:()=>l(f=>f+1),children:s.t("common.retry")})]});return pe("div",{className:r,children:pe(J,{fallback:p,children:pe(jn,{fallback:pe("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:pe(u,{step:e,i18n:s,...a!==void 0?{onError:a}:{}})})},o)})}i(bt,"FormStep");import{cameraUnavailableCauseOf as Nr}from"@sekyro/web";import{useCallback as j,useContext as _r,useEffect as Ve,useId as Pr,useMemo as Tt,useRef as ee,useState as Y}from"react";var vt={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 Be={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"}}},rr=["danger","success","warning","info"];function Ct(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}i(Ct,"channel");function _o(e){let t=Ct(parseInt(e.slice(1,3),16)),n=Ct(parseInt(e.slice(3,5),16)),r=Ct(parseInt(e.slice(5,7),16));return .2126*t+.7152*n+.0722*r}i(_o,"luminance");function sr(e,t){let n=_o(e),r=_o(t),a=Math.max(n,r),s=Math.min(n,r);return(a+.05)/(s+.05)}i(sr,"contrastRatio");function Po(e,t){return Math.min(...rr.map(n=>sr(Be[e][n].fg,t)))}i(Po,"worstAgainst");function xo(e,t,n){return Math.min(Po(e,t),Po(e,n))}i(xo,"worstStatusContrast");function Io(e,t){return xo("light",e,t)>=xo("dark",e,t)?"light":"dark"}i(Io,"statusSchemeFor");import{useRef as lr,useState as cr}from"react";import{useEffect as ir,useId as ar,useRef as wt}from"react";import{jsx as Ce,jsxs as To}from"react/jsx-runtime";function je({open:e,title:t,closeLabel:n,onClose:r,children:a,actions:s,role:o,testId:l,returnFocus:u}){let p=wt(null),f=wt(null),g=wt(!1),k=ar();return ir(()=>{let m=p.current;if(m!==null){if(e&&!m.open?(f.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 y=u?.current??(f.current instanceof HTMLElement?f.current:null);f.current=null,y?.focus()}g.current=e}},[e,u]),Ce("dialog",{ref:p,className:"sekyro-dialog","aria-labelledby":k,...o==="alertdialog"?{role:o}:{},"data-testid":l,onCancel:m=>{m.preventDefault(),r()},onClick:m=>{m.target===m.currentTarget&&r()},children:To("div",{className:"sekyro-dialog__panel",children:[To("div",{className:"sekyro-dialog__head",children:[Ce("h2",{id:k,className:"sekyro-dialog__title",children:t}),n!==void 0?Ce("button",{type:"button",className:"sekyro-disc sekyro-dialog__close","aria-label":n,onClick:r,children:Ce(D,{name:"close"})}):null]}),a!==void 0?Ce("div",{className:"sekyro-dialog__body",children:a}):null,s!==void 0?Ce("div",{className:"sekyro-dialog__actions",children:s}):null]})})}i(je,"FlowDialog");import{jsx as Le,jsxs as Eo}from"react/jsx-runtime";var ur=["intro","data","processing","sharing","retention"];function Ro({i18n:e,purpose:t="identity"}){let{t:n}=e,[r,a]=cr(!1),s=lr(null),[o,l=""]=n("consent.short").split("{terms}");return Eo("div",{className:"sekyro-consent","data-testid":"sekyro-consent",children:[Eo("p",{className:"sekyro-consent__line",children:[o,Le("button",{ref:s,type:"button",className:"sekyro-link sekyro-link--inline","aria-haspopup":"dialog",onClick:()=>a(!0),children:n("consent.termsLink")}),l]}),Le(je,{open:r,title:n("consent.termsTitle"),closeLabel:n("native.close"),onClose:()=>a(!1),returnFocus:s,testId:"sekyro-consent-terms",children:Le("div",{className:"sekyro-stack sekyro-stack--3",children:t==="human"?Le(B,{view:"HumanConsentTerms",i18n:e,quiet:!0}):ur.map(u=>Le("p",{children:n(`consent.terms.${u}`)},u))})})]})}i(Ro,"ConsentNotice");function Oo(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(Oo,"initials");import{useSyncExternalStore as dr}from"react";var Ao=i(e=>({colors:{...e?U.dark:U.light},radius:U.radius,fontFamily:U.font}),"brandTheme"),Xi=Ao(!1),Bo=/^#[0-9a-f]{6}$/i;function Nt(e,t,n){if(t)return null;let r=rt(e).colors,a=n?.colors?.bg??r?.bg,s=n?.colors?.surface??r?.surface;return a===void 0&&s===void 0||a!==void 0&&!Bo.test(a)||s!==void 0&&!Bo.test(s)?null:Io(a??U.light.bg,s??U.light.surface)}i(Nt,"partnerStatusScheme");function et(e,t,n){let r=rt(e);if(n&&r.colors!==void 0){let{brand:a,brandFg:s}=r.colors;a!==void 0&&yr(a,U.dark.bg)>=3?r.colors={brand:a,ring:a,...s!==void 0?{brandFg:s}:{}}:delete r.colors}if(Nt(e,n,t)==="dark"){let a=Be.dark;r.colors={...r.colors,danger:a.danger.base,success:a.success.base,warning:a.warning.fg}}return Ke(Ao(n),r,Mt(t))}i(et,"verificationTheme");function tt(e){let t=dr(fr,mr,()=>!1);return e==="dark"||e==="system"&&t}i(tt,"useDarkScheme");var pr="(prefers-color-scheme: dark)",Vo=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(pr):null,"media"),mr=i(()=>Vo()?.matches??!1,"prefersDark");function fr(e){let t=Vo();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i(fr,"subscribe");function yr(e,t){let[n,r]=[Lo(e),Lo(t)];return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}i(yr,"contrast");function Lo(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(Lo,"luminance");var _t="sekyro.testerGate";function Pt(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}i(Pt,"store");function Fo(e=Date.now()){try{Pt()?.setItem(_t,String(e))}catch{}}i(Fo,"rememberTester");function Do(e=Date.now()){try{let t=Number(Pt()?.getItem(_t)??"");return Number.isFinite(t)&&t>0&&e-t<2592e6}catch{return!1}}i(Do,"rememberedTester");function Mo(){try{Pt()?.removeItem(_t)}catch{}}i(Mo,"forgetTester");import{useEffect as gr,useId as kr,useState as Sr}from"react";import{jsx as L,jsxs as me}from"react/jsx-runtime";var Ho=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]),hr={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 br({screen:e}){if(e==="verified")return me("svg",{className:"sekyro-outcome sekyro-outcome--approved",viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[L("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"54",pathLength:"1"}),L("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),L("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}=hr[e];return L("span",{className:`sekyro-tile sekyro-tile--${n} sekyro-outcome-tile`,"aria-hidden":"true","data-screen":e,children:L(D,{name:t})})}i(br,"OutcomeMark");function vr({label:e,id:t,copied:n}){let[r,a]=Sr(!1);return gr(()=>{if(!r)return;let s=setTimeout(()=>a(!1),1600);return()=>clearTimeout(s)},[r]),me("button",{type:"button",className:`sekyro-reference${r?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[L("span",{"aria-live":"polite",children:r?n:e}),L("bdi",{dir:"ltr",children:t}),L(D,{name:"copy"})]})}i(vr,"ReferenceLine");function Cr({step:e,t}){let n=e.context.sandbox?e.context.simulation?.reason:void 0;return n===void 0?null:me(Re,{tone:"warning",role:"status",testId:"sekyro-simulated-notice",children:[L("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:L(D,{name:"info"})}),me("div",{className:"sekyro-notice__body","data-reason":n,children:[L("strong",{children:t("sandbox.simulatedTitle")}),L("span",{children:t(n==="no_testers"?"sandbox.simulatedNoTesters":"sandbox.simulatedGate")})]})]})}i(Cr,"SimulationNotice");function wr(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(wr,"resultTitleKey");function xt({step:e,locale:t,strings:n,className:r,onClose:a}){let s=C(t,n),{t:o}=s,l=kr(),u=ke(),p=e.context.orgName,f=e.reasonCode??"",g=e.display==="platform_unsupported"?"policy":e.display,k=i(y=>(p!==""||y==="verified")&&y!=="cooldown"?o(`native.result.${y}`,{org:p}):o(`session.result.${y}.description`),"partnerLine"),m;switch(e.display){case"rejected":m=Ho.has(ot(f))?o("session.result.detailsMismatch",{org:p}):k("rejected");break;case"policy":{if(Ho.has(ot(f)))m=o("session.result.detailsMismatch",{org:p});else if(f==="device_velocity_exceeded")m=o("session.result.deviceVelocity",{org:p});else if(f==="capture_tampered")m=o("session.result.deviceStop");else if(f==="camera_unavailable")m=o("reasons.camera_unavailable",{org:p});else if(f==="underage_estimated")m=o("reasons.underage_estimated");else if(f==="starter_credit_claimed")m=o("reasons.starter_credit_claimed");else if(f==="blocked_by_org")m=o("reasons.blocked_by_org");else{let y=f===""?null:Ot(f);m=y!==null?o(y,{org:p}):k("policy")}break}case"cooldown":{let y=Bt(s.locale,e.retryAfter);m=y!==null?o(y.key,{time:y.time}):o("session.result.cooldown.description");break}case"platform_unsupported":m=o("result.platform_unsupported");break;default:m=k(g)}return me("section",{className:`sekyro-result${r?` ${r}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[me("div",{className:"sekyro-result__body",children:[L(br,{screen:g}),me("div",{className:"sekyro-heading",children:[L("h2",{id:l,ref:u,tabIndex:-1,className:"sekyro-text-body",children:o(wr(g,e.result))}),L("p",{className:"sekyro-text-muted",children:m})]}),L(Cr,{step:e,t:o}),L(vr,{label:o("result.referenceLabel"),id:e.context.sessionId,copied:o("native.result.copied")})]}),a!==void 0?L("div",{className:"sekyro-actions",children:L(h,{full:!0,onClick:a,children:o("native.result.continue",{org:p})})}):null]})}i(xt,"VerificationResultScreen");import{Fragment as Ae,jsx as c,jsxs as G}from"react/jsx-runtime";function xr(e,t,n){let r=t?U.dark:U.light,a=t?U.roles.dark:U.roles.light,s=e.colors??{},o={},l=s.fg===r.fg&&s.surface===r.surface;s.brand===r.brand&&s.surface===r.surface&&(o["--sekyro-color-brand-soft"]=a.brandSoft),l&&(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===U.font&&(o["--sekyro-font-display"]=U.fontDisplay);let u=t?vt.dark:vt.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=Be[n];for(let f of["danger","success","warning","info"])o[`--sekyro-color-${f}-soft`]=p[f].soft,o[`--sekyro-color-${f}-fg`]=p[f].fg;o["--sekyro-color-on-success"]=p.success.on,o["--sekyro-color-on-danger"]=p.danger.on}return o}i(xr,"flowRoles");function Et(e){let{verification:t,locale:n,strings:r,onStep:a,onResult:s}=e,{step:o,error:l}=at(t);Ve(()=>{o!==null&&a?.(o)},[o,a]),Ve(()=>s===void 0?void 0:t.on("result",s),[t,s]);let u=tt(e.colorScheme??"light"),p=o?.context.branding,f=et(p,e.theme,u),[g,k]=Y(!1),m=`sekyro-verification${u?" sekyro-verification--dark":""}${g?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,y=ee(e.onClose);y.current=e.onClose;let w=ee(o);w.current=o;let N=j(()=>{let _=w.current;y.current?.(_?.kind==="result"?{reason:"finished",result:_.result}:{reason:"cancelled"})},[]),[O,R]=Y(null),S=j(()=>{let _=w.current;_!==null&&_.kind!=="result"&&_.context.consentRecorded?R("close"):N()},[N]),I=Tt(()=>t.reportCaptureIssue===void 0?null:_=>t.reportCaptureIssue?.(_),[t]);return c(Ut,{theme:f,className:m,children:c(Oe,{locale:n,...r!==void 0?{strings:r}:{},children:c("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:xr(f,u,Nt(p,u,e.theme)),children:c(Qt.Provider,{value:k,children:c(st.Provider,{value:e.onClose!==void 0?N:void 0,children:c(Ge.Provider,{value:e.onClose!==void 0?S:void 0,children:G(At.Provider,{value:I,children:[c(Br,{...e,step:o,error:l,immersive:g,onLeaveAsk:()=>R("history"),onClosed:N}),c(Er,{open:O!==null,onStay:()=>{O==="history"&&It(),R(null)},onLeave:()=>{let _=O;R(null),_==="close"||e.onClose!==void 0?N():typeof window<"u"&&zo()}})]})})})})})})})}i(Et,"SekyroVerification");function Ir(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(Ir,"processingCopyOf");function Tr({error:e,retry:t}){let{t:n}=C(),r=ke();return G(Re,{tone:"danger",testId:"sekyro-error-notice",children:[c("span",{children:n(Rt(e))}),e.retryable?c(h,{ref:r,kind:"secondary",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}i(Tr,"CameraErrorNotice");var $o="sekyroFlow";function Ko(){let e=window.history.state;return typeof e=="object"&&e!==null&&e[$o]===!0}i(Ko,"onGuard");function It(){if(typeof window>"u"||Ko())return;let e=window.history.state;window.history.pushState({...typeof e=="object"&&e!==null?e:{},[$o]:!0},"")}i(It,"pushGuard");function zo(){window.history.back()}i(zo,"leaveHistory");function Er({open:e,onStay:t,onLeave:n}){let{t:r}=C();return c(je,{open:e,role:"alertdialog",title:r("leave.title"),onClose:t,testId:"sekyro-leave",actions:G(Ae,{children:[c(h,{full:!0,onClick:t,children:r("leave.stay")}),c(h,{full:!0,kind:"danger",onClick:n,children:r("leave.confirm")})]}),children:c("p",{className:"sekyro-text-muted",children:r("leave.body")})})}i(Er,"LeaveDialog");function Rr(e,t){let[n,r]=Y(!1),[a,s]=Y(null),o=e===null?void 0:e.skipCapture,l=ee(o);l.current=o;let u=ee(!1),p=e?.key;Ve(()=>s(null),[p]);let f=j(()=>{if(u.current)return;let y=l.current;y!==void 0&&(u.current=!0,r(!0),s(null),y().catch(w=>s(t.t(ue(w,t.strings)))).finally(()=>{u.current=!1,r(!1)}))},[t]),g=j(()=>s(null),[]),k=o!==void 0,m=t.t("sandbox.skipCapture");return Tt(()=>k?{label:m,busy:n,failed:a,run:f,reset:g}:null,[k,m,n,a,f,g])}i(Rr,"useSkipCapture");function Or({skip:e}){return G(Ae,{children:[e.failed!==null?c(x,{tone:"danger",children:c("span",{children:e.failed})}):null,c(h,{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(Or,"SkipAction");function Br(e){let{step:t,error:n,slots:r,immersive:a}=e,s=C(),{t:o}=s,[l,u]=Y(!1),[p,f]=Y([]),g=j(d=>(f(P=>[...P,d]),()=>f(P=>P.filter(Z=>Z!==d))),[]),[k,m]=Y(null),y=j(d=>m(()=>d),[]),[w,N]=Y(0),[O,R]=Y(null),S=Rr(t,s),I=t?.context.testerGate!==void 0,[_,W]=Y(!1),M=ee(null);Ve(()=>{!I||M.current!==null||(M.current=Do(),M.current&&W(!0))},[I]);let H=t?.context.purpose??"identity",V=t?.context.returning===!0,fe=e.verification,Ne=H==="human"||t?.context.cameraUnavailableHandled===!0,Fe=fe.reportCameraUnavailable!==void 0&&Ne?d=>fe.reportCameraUnavailable?.(d)??Promise.resolve():void 0,De=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,$=e.handoffUrl,ie=j((d,P)=>Fe===void 0?void 0:c(B,{view:"NoCameraView",i18n:s,quiet:!0,cause:P,onRetry:d,...De?{onContinue:Fe}:{},...$!==void 0?{handoffUrl:$}:{}}),[s,fe,Ne,De,$]),ye=Tt(()=>ro(t),[t]),_e=j((d,P)=>c(so,{start:d,context:P,human:H==="human",returning:V,notice:P.permissionSettled&&P.permission==="denied"?ie(d,"denied"):void 0,...ye!==void 0?{retry:ye}:{}}),[H,V,ie,ye]),q=j((d,P)=>{let Z=Nr(d.kind);return(Z!==void 0?ie(P,Z):void 0)??G(Ae,{children:[c(Tr,{error:d,retry:P}),Z!==void 0&&$!==void 0?c(B,{view:"DesktopHandoffView",i18n:s,quiet:!0,url:$}):null]})},[ie,$,s]),Pe=ee(""),te=e.livenessProps?.slots?.stageOverlay,ae=j(d=>(d.guidance!==""&&!d.coached&&(Pe.current=d.guidance),c(ao,{testId:"sekyro-capture-stage",video:c("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:Pe.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:te?.(d.videoRef),ramp:d.ramp?.colour??null,...d.settled?{}:{onClose:i(()=>N(P=>P+1),"onClose")},end:d.modeSwitch!=null?c(Lt,{view:d.modeSwitch,className:"sekyro-glass sekyro-glass--label"}):null,children:d.settled||!d.live?null:c(Xt,{onStop:()=>N(P=>P+1)})})),[o,te]),Me=Pr(),He=t,xe=t!==null&&O===t.key&&t.context.switchable!==void 0,oe=k??(t===null||t.kind==="result"?null:xe?()=>R(null):t.context.switchable!==void 0&&typeof He?.chooseOption=="function"?()=>R(t.key):null),ne=ee(oe);ne.current=oe;let le=ee(t);le.current=t;let ce=ee({ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0});ce.current={ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0};let Ie=e.backNavigation==="history";if(Ve(()=>{if(!Ie||typeof window>"u")return;It();let d=i(()=>{if(Ko())return;let P=le.current,Z=ne.current;Z!==null?(Z(),It()):P?.kind!=="result"&&P?.context.consentRecorded===!0?ce.current.ask():ce.current.hostClose?ce.current.closed():zo()},"onPop");return window.addEventListener("popstate",d),()=>window.removeEventListener("popstate",d)},[Ie]),n!==null)return c(Re,{tone:"danger",children:c("span",{children:o(ue(n,s.strings))})});if(t===null)return G("div",{className:"sekyro-skeleton",role:"status","aria-busy":"true",children:[c("span",{className:"sekyro-visually-hidden",children:o("common.loading")}),c("span",{className:"sekyro-skeleton__bar is-title"}),c("span",{className:"sekyro-skeleton__bar"}),c("span",{className:"sekyro-skeleton__bar is-short"}),c("span",{className:"sekyro-skeleton__bar is-block"})]});let{context:F}=t,re=i(d=>{u(!0),d().finally(()=>u(!1))},"refresh"),Ue=r?.header??c(Ar,{context:F,headerId:Me,end:r?.headerEnd,...oe!==null?{onBack:oe}:{}}),T,ge=xe;if(_&&e.verification.testerGate!==void 0)T=c(nt.Provider,{value:ae,children:c(B,{view:"TesterGateView",i18n:s,verification:e.verification,attemptsLeft:F.testerGate?.attemptsLeft??0,livenessProps:{...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:e.livenessProps?.slots?.intro??_e},locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice},onBound:()=>Fo(),onDone:d=>{d&&Mo(),W(!1)}})});else if(ge)T=c(B,{view:"LaneChoiceView",i18n:s,step:t,onClose:()=>R(null)});else switch(t.kind){case"phone_otp":T=c(lt,{step:t});break;case"email_otp":T=c(ct,{step:t});break;case"method":T=c(pt,{step:t});break;case"registry":T=c(Ze,{step:t});break;case"document":T=c(gt,{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,P={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??_e,...d===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:q}:{}},...w>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};T=c(nt.Provider,{value:ae,children:t.instructions==="icao"||t.livePhoto?.icao===!0?c(B,{view:"LivePhotoLiveness",i18n:s,step:t,livenessProps:P,sekyroIntro:d===void 0},w):c(Dt,{...P},w)});break}case"portrait":T=G(Ae,{children:[t.retakeOnly?c(B,{view:"PortraitRetakeNotice",i18n:s,quiet:!0}):null,c(kt,{step:t,verification:e.verification,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"proof_of_address":T=c(ht,{step:t});break;case"form":T=c(bt,{step:t});break;case"contact_choice":T=c(B,{view:"ContactChoiceView",i18n:s,step:t});break;case"choice":T=c(B,{view:"GenericChoiceView",i18n:s,step:t});break;case"identity_summary":T=c(B,{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;T=e.handoffUrl!==void 0?c(B,{view:"HandoffView",i18n:s,url:e.handoffUrl,refresh:t.refresh,...d!==void 0?{lead:d}:{}}):c(We,{tone:"brand",icon:"smartphone",title:o("handoff.title"),actions:c(h,{kind:"secondary",full:!0,disabled:l,onClick:()=>re(t.refresh),children:o("common.refresh")}),children:c("p",{children:d??o("reasons.mobile_required")})});break}case"native_app_required":T=c(B,{view:"NativeAppView",i18n:s,org:F.orgName,nativeApp:t.nativeApp,...e.handoffUrl!==void 0?{fallbackUrl:e.handoffUrl}:{},refresh:t.refresh,footer:c(Uo,{org:F.orgName})});break;case"processing":{let d=Ir(s.strings,t.service);T=c(We,{tone:"brand",icon:"pending",busy:!t.stalled,live:!0,title:d?.title??o("session.processing.title"),actions:t.stalled?c(h,{kind:"secondary",full:!0,disabled:l,onClick:()=>re(t.refresh),children:o("common.refresh")}):null,children:c("p",{children:d?.description??o("session.processing.description")})});break}case"eid":T=c(ut,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";T=c(We,{tone:"neutral",icon:"smartphone",title:o(d?"needsApp.title":"unsupported.title"),actions:c(Uo,{org:F.orgName}),children:c("p",{children:d?F.orgName!==""?o("needsApp.description",{org:F.orgName}):o("needsApp.descriptionNoOrg"):o("unsupported.description",{org:F.orgName})})});break}case"result":T=r?.result?.(t)??c(Lr,{step:t});break;default:{let d=t;T=null}}let Te=!a&&!F.consentRecorded&&t.kind!=="result"?c(Ro,{i18n:s,purpose:F.purpose}):null,$e=S!==null&&!a&&!ge&&!_?c(Or,{skip:S}):null,Ee=I&&!_&&!a&&!ge&&e.verification.testerGate!==void 0?c(B,{view:"TesterGateAction",i18n:s,quiet:!0,onOpen:()=>W(!0)}):null,v=$e===null&&Ee===null?Te:G(Ae,{children:[Ee,$e,Te]});return c(Zt.Provider,{value:y,children:c(qe.Provider,{value:S,children:c(io.Provider,{value:e.handoffUrl,children:G(Wt.Provider,{value:v===null?null:{node:v,owner:p[0]??null,claim:g},children:[a?null:Ue,!a&&t.kind!=="result"&&F.sections.length>1?c(Vr,{context:F,current:t.section,i18n:s}):null,c(jt,{pageKey:t.key,children:T}),!a&&!ge&&t.kind!=="result"&&t.context.switchable!==void 0?c(B,{view:"LaneSwitch",i18n:s,step:t,onOpen:()=>R(t.key),quiet:!0},t.key):null,p.length===0?v:null,a?null:r?.footer!==void 0?r.footer:F.branding?.hideAttribution===!0?null:G("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[c(D,{name:"lock"}),o("shell.verifiedBy")]})]})})})})}i(Br,"Body");function Uo({org:e}){let{t}=C(),n=_r(st);return n===void 0?null:c(h,{full:!0,onClick:n,children:t("native.result.continue",{org:e})})}i(Uo,"BackToOrg");function Lr({step:e}){return c(Ge.Consumer,{children:t=>c(xt,{step:e,...t!==void 0?{onClose:t}:{}})})}i(Lr,"ResultPage");function Ar({context:e,headerId:t,end:n,onBack:r}){let{t:a}=C(),[s,o]=Y(!1),l=s?void 0:e.branding?.logoUrl,u=e.orgName!==""?e.orgName:a(e.returning?"returning.heading":"session.title");return c("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:G("div",{className:"sekyro-org",children:[r!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__back","aria-label":a("common.back"),onClick:r,"data-testid":"sekyro-back",children:c(D,{name:"back"})}):null,c("span",{className:"sekyro-org__tile","aria-hidden":"true",children:l!==void 0?c("img",{className:"sekyro-org__logo",src:l,alt:"",onError:()=>o(!0)}):Oo(e.orgName)}),G("div",{className:"sekyro-org__text",children:[c("h1",{id:t,className:"sekyro-org__name",children:u}),c("p",{className:"sekyro-org__sub",children:a(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),e.sandbox?c("span",{className:"sekyro-sandbox-badge","data-testid":"sekyro-sandbox-badge",children:a("app.sandboxBadge")}):null,n!=null?c("div",{className:"sekyro-org__end",children:n}):null,c(Ge.Consumer,{children:p=>p!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":a("native.close"),onClick:p,children:c(D,{name:"close"})}):null})]})})}i(Ar,"OrgHeader");function Vr({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,l)=>({id:o,state:l<r?"done":l===r?"current":"upcoming"}));return c("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:s.map(({id:o,state:l})=>c("li",{className:`sekyro-progress__bar${l==="done"?" is-done":l==="current"?" is-current":""}`,...l==="current"?{"aria-current":"step"}:{},children:c("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${o}`]??o})},o))})}i(Vr,"SectionProgress");import{useEffect as Fr,useState as Go}from"react";import{jsx as we}from"react/jsx-runtime";function Dr(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i(Dr,"pageUrl");function Mr({hostedUrl:e,inAppBrowser:t,...n}){let[r,a]=Go(t===!0);Fr(()=>{t===void 0&&it()&&a(!0)},[t]);let[s,o]=Go(!1),l=tt(n.colorScheme??"light"),u=n.handoffUrl??e??Dr();return r&&!s?we(Ht,{theme:Ke(et(void 0,void 0,l),n.theme),className:`sekyro-verification${l?" sekyro-verification--dark":""}${n.className!==void 0?` ${n.className}`:""}`,children:we(Oe,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:we("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-flow",children:we(Hr,{url:u,onContinue:()=>o(!0)})})})}):we(Et,{...n,...u!==""?{handoffUrl:u}:{}})}i(Mr,"SekyroFlow");function Hr({url:e,onContinue:t}){let n=C();return we(B,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}i(Hr,"Prompt");export{gt as DocumentCapture,ut as EidStep,ct as EmailOtpStep,bt as FormStep,Ze as IdNumberEntry,pt as MethodChoice,Pn as NniEntry,lt as PhoneOtpStep,kt as PortraitCapture,ht as ProofOfAddress,Mr as SekyroFlow,Et as SekyroVerification,Oe as StepI18nProvider,xt as VerificationResultScreen,Wo as arSteps,Zo as enSteps,Xo as formatTemplate,Qo as frSteps,it as isInAppBrowser,qo as loadSekyroLocale,Jo as resolveSekyroStrings,Yo as retakeHintStringKey,C as useStepI18n,at as useVerificationStep};
|
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.29",
|
|
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.31 || ^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.29",
|
|
101
|
+
"bom-ref": "@sekyro/react@0.1.0-rc.29",
|
|
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.29?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.29"
|
|
151
151
|
}
|
|
152
152
|
]
|
|
153
153
|
}
|
package/dist/chunk-2UDX3MRT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{a as sn,c as cn}from"./chunk-KGUF5KAK.js";import{b as an,c as Qe}from"./chunk-7MMT5M4E.js";import{a as nn,b as rn,c as on,d as $}from"./chunk-VOIZLJLI.js";import{a as F,k as Wt,l as Qt,n as Jt,o as Xt,p as en,q as tn,r as D,s as Je}from"./chunk-3MCTR3RI.js";import{a as n}from"./chunk-2KED7D2Q.js";import{useId as Cr}from"react";import{Fragment as vr,jsx as M,jsxs as ee}from"react/jsx-runtime";function te({className:e,children:t}){return M("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}n(te,"Svg");var gt="M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z";function ln(e){return ee(te,{...e,children:[M("circle",{cx:"12",cy:"12",r:"4"}),M("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}n(ln,"SunIcon");function un(e){return ee(te,{...e,children:[M("circle",{cx:"12",cy:"12",r:"9"}),M("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}n(un,"FaceUncoveredIcon");function dn(e){return ee(te,{...e,children:[M("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),M("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),M("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}n(dn,"PhoneEyeLevelIcon");function pn(e){return ee(te,{...e,children:[M("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),M("circle",{cx:"12",cy:"12",r:"2.8"})]})}n(pn,"LookStraightIcon");function fn(e){return ee(te,{...e,children:[M("path",{d:gt}),M("path",{d:"M9 13l2 2 4-4"})]})}n(fn,"CameraCheckIcon");function mn(e){return ee(te,{...e,children:[M("path",{d:gt}),M("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}n(mn,"CameraAskIcon");function yn(e){return ee(te,{...e,children:[M("path",{d:gt}),M("path",{d:"M3 3l18 18"})]})}n(yn,"CameraBlockedIcon");function Ve({off:e,className:t}){return ee(te,{className:t,children:[M("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?M("path",{d:"M4 4l16 16"}):ee(vr,{children:[M("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),M("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}n(Ve,"SpeakerIcon");function gn(e){return M(te,{...e,children:M("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}n(gn,"CheckIcon");function hn(e){return ee(te,{className:e.className??"sekyro-spinner",children:[M("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),M("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}n(hn,"SpinnerIcon");import{jsx as pe,jsxs as vn}from"react/jsx-runtime";var Xe=["light","uncover","eyeLevel","straight"],kr={light:{key:"capture.tips.light",icon:n(()=>pe(ln,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:n(()=>pe(un,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:n(()=>pe(dn,{}),"icon")},straight:{key:"capture.tips.straight",icon:n(()=>pe(pn,{}),"icon")}};function Cn({tips:e}){let t=$(),o=Cr();return e.length===0?null:vn("section",{className:"sekyro-tips","aria-labelledby":o,"data-testid":"sekyro-tips",children:[pe("p",{className:"sekyro-tips__title",id:o,children:t("capture.tips.title")}),pe("ul",{className:"sekyro-tips__list",children:e.map(r=>{let s=typeof r=="string"?kr[r]:void 0,c=typeof r=="string"?r:r.id,i=s!==void 0?s.icon():typeof r=="string"?void 0:r.icon,u=s!==void 0?t(s.key):typeof r=="string"?r:r.text;return vn("li",{className:"sekyro-tips__item",children:[i!=null?pe("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:i}):null,pe("span",{children:u})]},c)})})]})}n(Cn,"TipList");import{useEffect as kn,useId as br,useRef as Sr,useState as Rr}from"react";import{jsx as W,jsxs as et}from"react/jsx-runtime";var Vr=220;function bn({title:e,description:t,options:o,busy:r,error:s,focus:c,testId:i,look:u="cards",marked:k,onChoose:b}){let y=br(),w=Je(),[S,d]=Rr(null),C=Sr(null);kn(()=>{s!==null&&d(null)},[s]),kn(()=>()=>{C.current!==null&&clearTimeout(C.current)},[]);let v=n(l=>{r||S!==null||(d(l),C.current=setTimeout(()=>{C.current=null,d(null),b(l)},Vr))},"choose");return et("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":y,"data-testid":i,children:[et("div",{className:u==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[W("h2",{id:y,ref:c?w:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?W("p",{className:"sekyro-text-muted",children:t}):null]}),s!==null?W(D,{tone:"danger",children:W("span",{children:s})}):null,u==="buttons"?W("div",{className:"sekyro-stack sekyro-stack--3",children:o.map((l,L)=>W(F,{kind:L===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:()=>b(l.id),children:l.label},l.id))}):W("div",{className:"sekyro-choices",children:o.map(l=>et("button",{type:"button",className:"sekyro-card","aria-pressed":(S??k)===l.id,"aria-busy":r||void 0,disabled:r||S!==null&&S!==l.id,onClick:()=>v(l.id),children:[l.glyph!==void 0?W("span",{className:"sekyro-card__tile",children:l.glyph}):null,et("span",{className:"sekyro-card__body",children:[W("span",{className:"sekyro-card__title",children:l.label}),l.sub!==void 0?W("span",{className:"sekyro-card__sub",children:l.sub}):null]}),W("span",{className:"sekyro-radio","aria-hidden":"true"})]},l.id))})]})}n(bn,"ChoiceScreen");var tt=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","fcv3.one_face","capture.tips.summary"];function he(e){return e!==null&&tt.includes(e)}n(he,"isVoiceKey");import{useCallback as re,useEffect as ve,useLayoutEffect as _r,useMemo as Ir,useRef as we,useState as Oe}from"react";var Mr=n((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function Me(e,t,o){let r;try{if(typeof e=="function")r=e(t,o);else{let s=e[o];r=s!=null&&Mr(s,t)?s[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}n(Me,"resolveClip");var wr="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",Vn={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ne(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}n(ne,"synth");function Lr(){return ne()!==null&&typeof SpeechSynthesisUtterance=="function"}n(Lr,"speechAvailable");function Sn(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}n(Sn,"baseLang");function Mn(e,t){let o=n(s=>s.replace(/_/g,"-").toLowerCase(),"norm"),r=Sn(t);return e.find(s=>o(s.lang)===o(t))??e.find(s=>Sn(s.lang)===r)}n(Mn,"pickVoice");function wn(e){if(!Lr())return!1;let t=[];try{t=ne()?.getVoices()??[]}catch{return!0}return t.length===0||Mn(t,e)!==void 0}n(wn,"speechUsable");function Ln(e){let t=ne();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}n(Ln,"subscribeVoices");function Ke(e){try{let t=typeof location<"u"?location.href:"http://localhost/",o=new URL(e,t);return`clip:${o.origin}${o.pathname}`}catch{return`clip:${e}`}}n(Ke,"clipIdentity");function Rn(e){e.pause(),e.removeAttribute("src"),e.load()}n(Rn,"release");function _n(){let e=null,t=null,o=0,r=null,s=[],c=new Map,i=n(()=>{s=ne()?.getVoices()??[]},"loadVoices"),u=!1,k=n(()=>{let d=ne();u||d===null||(u=!0,i(),d.addEventListener?.("voiceschanged",i))},"bindVoices"),b=n(()=>(e??(e=new Audio),e),"element"),y=n((d,C,v)=>{let l=ne();if(l!==null&&d!==""&&typeof SpeechSynthesisUtterance=="function"){k();let L=Mn(s,C);if(s.length===0||L!==void 0){l.cancel();let g=new SpeechSynthesisUtterance(d);g.lang=C,L!==void 0&&(g.voice=L),g.rate=.95,v!==void 0&&(g.onend=g.onerror=v),l.speak(g);return}}v?.()},"speak"),w=n(()=>{o+=1,r=null,e!==null&&(e.pause(),e.currentTime=0),ne()?.cancel()},"stop"),S=n(d=>{for(let C of d){let v=Ke(C);if(c.has(v))continue;let l=new Audio;l.preload="auto",l.src=C,c.set(v,l)}},"warmClips");return{say(d){let C=d.url!==null?Ke(d.url):`tts:${d.lang}:${d.text}`;if(C===r)return;r=C,o+=1;let v=o,l=d.onEnd,L=l!==void 0?()=>{v===o&&l()}:void 0;if(ne()?.cancel(),d.url!==null){let g=b();g.pause(),g.muted=!1,g.src=d.url,g.currentTime=0,g.onended=L??null,g.play()?.catch(V=>{v===o&&V?.name!=="AbortError"&&(d.speech?y(d.text,d.lang,L):L?.())});return}d.speech?y(d.text,d.lang,L):L?.()},unlock({lang:d,speech:C,prefetch:v}){let l=b();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let V=Uint8Array.from(atob(wr),E=>E.charCodeAt(0));t=URL.createObjectURL(new Blob([V],{type:"audio/wav"}))}let L=l.paused===!1&&t!==null&&l.src!==t;t!==null&&!L&&(l.muted=!0,l.onended=null,l.src=t,l.play()?.catch(()=>{}));let g=ne();if(C&&g!==null&&typeof SpeechSynthesisUtterance=="function"){k();let V=new SpeechSynthesisUtterance(" ");V.volume=0,V.lang=d,g.speak(V)}S(v??[])},prefetch:S,stop:w,dispose(){w(),u&&ne()?.removeEventListener?.("voiceschanged",i),u=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&Rn(e),e=null;for(let d of c.values())Rn(d);c.clear()}}}n(_n,"createVoicePlayer");var In="sekyro.voiceGuidance";function xn(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}n(xn,"readVoicePreference");function En(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}n(En,"writeVoicePreference");var Ue="capture.tips.summary",xr=typeof window<"u"?_r:ve,Er=Object.freeze({});function ht(e,t){let o=new Set,r=[];for(let s of tt){let c=s===Ue?null:Me(e,s,t);c===null||o.has(Ke(c))||(o.add(Ke(c)),r.push(c))}return r}n(ht,"resolvedClipUrls");function vt({locale:e,defaultClips:t,options:o}){let r=o===!1,s=r?{}:o??{},c=s.storageKey===void 0?In:s.storageKey,[i,u]=Oe(s.defaultEnabled??!0),k=we(i),[b,y]=Oe(!1),[w,S]=Oe("none"),[d,C]=Oe(!1),v=we(!1),[l,L]=Oe(0),g=we(null),V=re(()=>(g.current??(g.current=_n()),g.current),[]),E=Vn[e],K=s.speechFallback,p=K===void 0||K===!0?!0:K===!1?!1:K.includes(e),U=s.clips??t??Er,H=we(!1),se=we(U);xr(()=>{se.current=U,k.current=i}),ve(()=>{if(r||c===null)return;let h=xn(c);h!==null&&(k.current=h,u(h))},[r,c]),ve(()=>{if(!(r||!p))return Ln(()=>L(h=>h+1))},[r,p]);let a=s.clips;ve(()=>{if(r)return;let h=p&&wn(E);y(ht(U,e).length>0||h),S(a!==void 0&&Me(a,Ue,e)!==null?"partner":Me(U,Ue,e)!==null||h?"default":"none")},[r,U,a,e,p,E,l]),ve(()=>{if(r||!i||!H.current)return;let h=ht(U,e);h.length>0&&V().prefetch(h)},[r,i,U,e,V]),ve(()=>()=>{g.current?.dispose(),g.current=null,H.current=!1},[]);let A=re(h=>{r||(H.current=!0,V().unlock({lang:E,speech:p,...h?{prefetch:ht(se.current,e)}:{}}))},[r,V,E,p,e]),_=re(()=>A(k.current),[A]),B=re(()=>{v.current=!1,C(!1)},[]),N=re(()=>{B(),g.current?.stop()},[B]),ie=re(()=>{v.current&&N()},[N]),ae=re((h,me)=>{if(r)return;if(v.current){N();return}let ce=V();ce.stop(),v.current=!0,C(!0);let I=me?.clip===!1?null:Me(se.current,Ue,e);ce.say({url:I,text:h,lang:E,speech:p,onEnd:B})},[r,N,V,e,E,p,B]),P=re(h=>{r||(h?A(!0):N(),c!==null&&En(c,h),k.current=h,u(h))},[r,A,N,c]),O=re(()=>P(!k.current),[P]),fe=re((h,me)=>{if(r||!i)return;v.current&&B();let ce=Me(se.current,h,e);V().say({url:ce,text:me,lang:E,speech:p})},[r,i,e,V,E,p,B]);return Ir(()=>({supported:!r&&b,enabled:!r&&i,setEnabled:P,toggle:O,unlock:_,speakKey:fe,stop:N,summary:r?"none":w,summaryPlaying:d,toggleSummary:ae,stopSummary:ie}),[r,b,i,P,O,_,fe,N,w,d,ae,ie])}n(vt,"useVoiceGuidance");function Ct(e,t,o,r){let{speakKey:s,stop:c,enabled:i}=e,u=we(!1);ve(()=>{if(!r||!i){u.current&&c(),u.current=!1;return}u.current=!0,he(t)&&t!==Ue&&o!==""&&s(t,o)},[r,i,t,o,s,c])}n(Ct,"useSpeakGuidance");import{isValidElement as ao,useCallback as it,useContext as co,useEffect as oe,useMemo as Ie,useRef as ke,useState as ir}from"react";import{useEffect as Nr,useRef as Pr}from"react";import{jsx as He,jsxs as Pn}from"react/jsx-runtime";function An(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}n(An,"retryCoachingOf");var Nn={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function Tn({showCoaching:e,coaching:t="face",attemptsText:o,showRetake:r,onRetake:s}){let c=$(),i=Pr(null);return Nr(()=>{r&&i.current?.focus()},[r]),!e&&!r?null:Pn("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?Pn("div",{className:"sekyro-stack sekyro-stack--1",children:[He("p",{className:"sekyro-text-body",children:c(Nn[t].title)}),He("ul",{className:"sekyro-coaching",children:Nn[t].tips.map(u=>He("li",{children:c(u)},u))}),o!==null?He("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:o}):null]}):null,r?He(F,{ref:i,className:"sekyro-btn--start",onClick:s,children:c("capture.recordAgain")}):null]})}n(Tn,"CapturedPanel");function nt(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}n(nt,"isDevBuild");import{createContext as Ar}from"react";var Kn=Ar(null);import{useCallback as Bn,useEffect as Gn,useRef as Le}from"react";import{useEffect as Tr,useState as Kr}from"react";import{jsx as Be,jsxs as Or}from"react/jsx-runtime";function On({state:e}){let t=$(),[o,r]=Kr(!1);Tr(()=>{e!=="unknown"&&r(!0)},[e]);let s=e==="granted"?Be(fn,{}):e==="denied"?Be(yn,{}):Be(mn,{});return Or("div",{role:o?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[Be("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:s}),Be("span",{children:t(`capture.permission.${e}`)})]})}n(On,"PermissionRow");import{jsx as rt,jsxs as Un}from"react/jsx-runtime";function Hn({voice:e}){let t=$();if(!e.supported)return null;let o=e.enabled;return Un("button",{type:"button",role:"switch","aria-checked":o,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:()=>e.toggle(),children:[Un("span",{className:"sekyro-switch__label",children:[rt(Ve,{off:!o}),t("capture.voiceGuidance")]}),rt("span",{className:"sekyro-switch__track","aria-hidden":"true",children:rt("span",{className:"sekyro-switch__thumb",children:o?rt(gn,{className:"sekyro-switch__check"}):null})})]})}n(Hn,"VoiceSwitch");import{Fragment as Hr,jsx as q,jsxs as _e}from"react/jsx-runtime";function Fn({assets:e,onRetryAssets:t,permission:o,captureMode:r="self",voice:s,tips:c,summary:i,startLabel:u,startDisabled:k,onStart:b}){let y=$(),w=Le(i?.stop);w.current=i?.stop,Gn(()=>()=>w.current?.(),[]);let S=Le(null),d=Le(null),C=Le(null),v=Le(e),l=Le(!1);Gn(()=>{let U=v.current;if(v.current=e,U===e)return;let H=l.current;e!=="loading"&&(l.current=!1),Ur(S.current)&&(e==="failed"?C.current?.focus():H&&d.current?.focus())},[e]);let L=Bn(()=>{l.current=!0,t()},[t]),g=e==="loading",V=g||k,E=Bn(()=>{V||(w.current?.(),b())},[V,b]),K;return e==="failed"?K=_e(D,{tone:"danger",testId:"sekyro-assets-error",children:[q("p",{className:"sekyro-text-body",children:y("fcv2.err.models")}),q(F,{kind:"ghost",ref:C,className:"sekyro-btn--start",onClick:L,"data-testid":"sekyro-assets-retry",children:y("common.retry")})]}):K=_e("div",{className:"sekyro-stack sekyro-stack--1",children:[q(F,{ref:d,full:!0,"data-testid":"sekyro-start","aria-disabled":V?"true":void 0,"aria-busy":g?"true":void 0,onClick:E,children:g?_e(Hr,{children:[q(hn,{}),y("capture.preparing.title")]}):u??y("capture.start")}),g?q("p",{className:"sekyro-text-muted",children:y("capture.preparing.hint")}):null]}),_e("div",{ref:S,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?_e("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[q("h2",{className:"sekyro-text-body",children:y("capture.assisted.title")}),q("p",{className:"sekyro-text-muted",children:y("capture.assisted.lead")})]}):null,c!==!1?q(Cn,{tips:c}):null,i!==void 0?_e(F,{kind:"ghost",className:"sekyro-btn--start",onClick:i.toggle,"data-testid":"sekyro-tips-listen",children:[q(Ve,{off:!1}),y(i.playing?"capture.tips.stop":"capture.tips.listen")]}):null,q(On,{state:o}),q(Hn,{voice:s}),q("p",{className:"sekyro-text-muted",children:y("capture.securityNote")}),K,q("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?y("capture.preparing.title"):e==="ready"?y("capture.ready"):""})]})}n(Fn,"PreCaptureScreen");function Ur(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}n(Ur,"focusIsOurs");import{subscribeCameraPermission as Br}from"@sekyro/web";import{useEffect as Gr,useState as Fr}from"react";function Dn(){let[e,t]=Fr({state:"unknown",settled:!1});return Gr(()=>Br(o=>t({state:o,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}n(Dn,"useCameraStatus");import{useCallback as Dr,useEffect as kt,useState as bt}from"react";function qn(e){return Yn(e,"mobileRequired")}n(qn,"useMobileRequired");function jn(e){return Yn(e,"returning").required}n(jn,"useReturning");function Yn(e,t){let[o,r]=bt({required:!1,settled:e===void 0});return kt(()=>{let s=e?.[t];if(e===void 0||typeof s!="function"){r({required:!1,settled:!0});return}let c=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>s.call(e)).then(i=>{c&&r({required:i===!0,settled:!0})},()=>{c&&r({required:!1,settled:!0})}),()=>{c=!1}},[e,t]),o}n(Yn,"useFlag");function $n(e){let t=n(()=>e?.captureChoice??null,"initialChoice"),[o,r]=bt(()=>({session:"self",choice:t(),settled:e===void 0}));kt(()=>{let i=e?.captureMode,u=e?.captureChoice??null;if(e===void 0||typeof i!="function"){r({session:"self",choice:u,settled:!0});return}let k=!0;return r({session:"self",choice:u,settled:!1}),Promise.resolve().then(()=>i.call(e)).then(b=>{let y=e.captureChoice??null;k&&r({session:y!==null&&b===y?"choice":b==="assisted"||b==="choice"?b:"self",choice:y,settled:!0})},()=>{k&&r({session:"self",choice:null,settled:!0})}),()=>{k=!1}},[e]);let s=Dr(i=>{e?.chooseCaptureMode?.(i),r(u=>({...u,choice:i}))},[e]);return{mode:o.session==="choice"?o.choice??"self":o.session==="assisted"?"assisted":"self",session:o.session,choice:o.choice,settled:o.settled,choose:s}}n($n,"useCaptureMode");function zn(e){let[t,o]=bt(!1);return kt(()=>{if(o(!1),e===void 0)return;let r=e.on("busy",()=>o(!0)),s=e.on("result",()=>o(!1));return()=>{r(),s()}},[e]),t}n(zn,"useBusy");import{getLivenessAssetsStatus as qr,preloadLivenessAssets as jr,subscribeLivenessAssets as Yr}from"@sekyro/web";import{useCallback as St,useEffect as Zn,useRef as Wn,useState as $r,useSyncExternalStore as zr}from"react";var Zr=n(()=>"idle","serverSnapshot");function Qn(e){return jr(e!==void 0?{assetBaseUrl:e}:{})}n(Qn,"preload");function Jn(e,t=!0){let o=zr(St(w=>Yr(w,e),[e]),()=>qr(e),Zr),[r,s]=$r(null),c=Wn(!1),i=St(()=>{Qn(e).then(w=>{c.current&&w==="idle"&&s({base:e})})},[e]);Zn(()=>(c.current=!0,i(),()=>{c.current=!1}),[i]);let u=Wn(null);Zn(()=>{if(o!=="idle"){u.current={base:e};return}!t||u.current===null||u.current.base!==e||(u.current=null,i())},[o,e,i,t]);let k=St(()=>{Qn(e)},[e]);return{gate:r!==null&&r.base===e&&o==="idle"||o==="ready"?"ready":o==="failed"?"failed":"loading",retry:k}}n(Jn,"useLivenessAssets");import{createLivenessCapture as Wr}from"@sekyro/web";import{useCallback as ot,useEffect as Qr,useRef as Ce,useState as j}from"react";var Xn={progress:0,hint:null,faceDetected:!1};function er(e){let{videoRef:t,assetBaseUrl:o}=e,s=Ce(e.verification).current,c=Ce(!1);e.verification!==s&&!c.current&&nt()&&(c.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let i=Ce(null),[u,k]=j("idle"),[b,y]=j(Xn),[w,S]=j(!1),[d,C]=j(!1),[v,l]=j(null),[L,g]=j(!1),[V,E]=j(null),[K,p]=j(null),[U,H]=j(null),[se,a]=j(null),[A,_]=j(null),[B,N]=j(!1),ie=Ce(null),ae=Ce("idle"),P=Ce(-1),[O,fe]=j(0),h=Ce(e);h.current=e,Qr(()=>{let z=t.current;if(z===null)return;let Q={video:z,...o!==void 0?{assetBaseUrl:o}:{}},x=s!==void 0?s.liveness(Q):Wr(Q);i.current=x;let Ne=n(()=>_(x.facingMode??null),"readFacing");Ne();let Ge=[x.on("state",m=>{m==="mode_switch"?N(!0):m!=="starting"&&m!=="gating"&&N(!1),m==="starting"?(ae.current!=="starting"&&(P.current+=1,fe(Math.max(0,P.current))),p(null),H(null),y(Xn),C(!1),S(!1),l(null),E(null),ie.current=null):m==="gating"&&ae.current==="recording"&&(C(!1),S(!1),l(null),ie.current=null),ae.current=m,Ne(),k(m),h.current.onStateChange?.(m)}),x.on("gate",m=>{let J=ie.current;ie.current=m.progress,S(J!==null&&m.progress<J-.001&&m.progress>0&&m.progress<1),m.progress>=1&&C(!0),y(m)}),x.on("frozen",({previewDataUrl:m})=>l(m)),x.on("profile",({animations:m})=>g(m==="reduced")),x.on("ramp",({colour:m})=>E(m)),x.on("captured",m=>{p(m),a(null),h.current.onCaptured?.(m)}),x.on("error",m=>{H(m);let J=s?.reportCaptureIssue;J!==void 0&&Qe(ye=>J.call(s,ye),an("liveness",m,Math.max(0,P.current))),h.current.onError?.(m)}),s?.on("result",m=>{a(m),h.current.onResult?.(m)})];return()=>{for(let m of Ge)m?.();i.current=null,x.destroy()}},[s,t,o]);let me=ot(()=>{i.current?.start()},[]),ce=ot(()=>{i.current?.retry()},[]),I=ot(async()=>{let z=i.current;return z===null||typeof z.canSwitchCaptureMode!="function"?!1:await z.canSwitchCaptureMode().catch(()=>!1)===!0},[]),Ee=ot(async z=>{let Q=i.current;if(Q===null||typeof Q.setCaptureMode!="function")return!1;let x=await Q.setCaptureMode(z).catch(()=>!1)===!0;return x&&_(Q.facingMode??null),x},[]);return{state:u,gate:b,draining:w,gateLocked:d,frozenPreview:v,reduceMotion:L,rampColour:V,artifacts:K,error:U,result:se,facingMode:A,start:me,retry:ce,canSwitchCaptureMode:I,setCaptureMode:Ee,modeRestarted:B,attempt:O}}n(er,"useLivenessHandle");import{useCallback as Jr,useEffect as Xr,useState as st}from"react";var eo=new Set(["national_number"]);function tr(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(o=>eo.has(o));return t.length>0?{...e,options:t}:null}n(tr,"pending");function nr(e){let[t,o]=st(null),[r,s]=st(e===void 0),[c,i]=st(!1),[u,k]=st(!1);Xr(()=>{if(o(null),e===void 0){s(!0);return}let S=!0,d=e.methodChoice;typeof d=="function"?(s(!1),Promise.resolve().then(()=>d.call(e)).then(v=>{S&&o(tr(v))},()=>{}).finally(()=>{S&&s(!0)})):s(!0);let C=e.on("method",v=>o(tr(v)));return()=>{S=!1,C()}},[e]);let b=Jr(async S=>{if(e===void 0)return!1;i(!0),k(!1);try{return await e.selectMethod(S),o(null),!0}catch{return k(!0),!1}finally{i(!1)}},[e]),y=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:y==="national_number"&&!u?y:null,settled:r,busy:c,failed:u,select:b}}n(nr,"useMethodChoice");import{useEffect as to,useMemo as no,useState as ro}from"react";var oo=["ar","fr","en"];function so(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}n(so,"isClipUrl");function io(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let o={};for(let r of oo){let s=t[r];if(!(typeof s!="object"||s===null))for(let[c,i]of Object.entries(s))!he(c)||!so(i)||((o[r]??(o[r]={}))[c]=i)}return Object.keys(o).length>0?o:null}n(io,"toVoiceClipMap");function rr(e){let[t,o]=ro(null);to(()=>{if(o(null),e===void 0)return;let s=!0,c=n(u=>{if(!s)return;let k=typeof u=="object"&&u!==null&&typeof u.setId=="string"?u:null;o(b=>b?.setId===k?.setId?b:k)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(c,()=>c(null))}catch{c(null)}let i=e.on("view",u=>c(u.voice));return()=>{s=!1,i()}},[e]);let r=no(()=>t!==null?io(t):null,[t]);return e===void 0?null:r}n(rr,"useServerVoiceClips");import{jsx as or}from"react/jsx-runtime";function sr({voice:e}){let t=$();return or(F,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:()=>e.toggle(),children:or(Ve,{off:!e.enabled,className:"sekyro-icon"})})}n(sr,"VoiceChip");import{Fragment as ar,jsx as R,jsxs as xe}from"react/jsx-runtime";var lo=new Set(["abandoned","not_opened","cancelled","superseded"]),uo=800,po="capture.lookAtColours";function fo(e){return e===void 0||e!==!1&&e.length===Xe.length&&Xe.every(t=>e.includes(t))}n(fo,"isDefaultTips");function mo(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}n(mo,"carriesActivation");function yo(e){return typeof e=="object"&&e!==null&&!ao(e)&&"tone"in e&&"text"in e}n(yo,"isNoticeObject");var go=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function ho(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}n(ho,"isCapturing");function vo(e){return e==="captured"||e==="uploading"||e==="checking"}n(vo,"isPostCapture");function xi({verification:e,locale:t,dir:o,strings:r,slots:s,autoStart:c=!1,notice:i,startDisabled:u=!1,startLabel:k,tips:b,tipsSummary:y,coach:w,voice:S,onGuidance:d,onCaptured:C,onResult:v,onError:l,onStateChange:L,assetBaseUrl:g,className:V}){let E=rn(t),K=Ie(()=>nn(t,r),[t,r,E]),p=Ie(()=>f=>K[f]??"",[K]),U=o??(t==="ar"?"rtl":"ltr"),H=ke(null),se=co(Kn),a=er({verification:e,videoRef:H,assetBaseUrl:g,onCaptured:C,onResult:v,onError:l,onStateChange:L}),A=Jn(g,a.state==="idle"&&a.error===null),_=nr(e),B=_.choice!==null,N=qn(e),ie=jn(e),ae=zn(e),P=Dn(),O=$n(e),fe=O.session==="choice",h=O.mode==="assisted",me=S!==!1&&S?.clips===void 0,ce=rr(me?e:void 0),I=vt({locale:t,defaultClips:ce,options:S}),Ee=h?"environment":"user",z=O.settled,Q=ke(null),x=ke(!1),Ne=ke(I.unlock);Ne.current=I.unlock,oe(()=>{let f=Q.current;if(f===null)return;let Y=["pointerup","touchend","click","keydown"],de=n(()=>{for(let Te of Y)f.removeEventListener(Te,Re,!0)},"disarm");function Re(Te){if(x.current){de();return}mo(Te)&&(x.current=!0,de(),Ne.current())}n(Re,"onGesture");for(let Te of Y)f.addEventListener(Te,Re,{capture:!0,passive:!0});return de},[]);let Ge=it(()=>{x.current||(x.current=!0,I.unlock()),a.start()},[I.unlock,a.start]),m=it(()=>a.start(),[a.start]),J=ke(!1),ye=a.state==="idle"&&a.error===null,Rt=!B&&!N.required&&(c===!0||c==="when-permitted"&&P.permission==="granted"),Vt=Rt&&_.settled&&N.settled&&z,cr=c==="when-permitted"&&!P.permissionSettled&&!J.current,Mt=Rt&&ye&&!J.current,at=(cr||Mt||!z)&&A.gate==="ready"?"loading":A.gate;oe(()=>{!Vt||!ye||A.gate!=="ready"||J.current||(J.current=!0,m())},[Vt,ye,A.gate,m]);let lr=ye&&!B&&!N.required&&!(Mt&&A.gate==="ready"),[wt,Lt]=ir(!1),{canSwitchCaptureMode:_t,setCaptureMode:It}=a;oe(()=>{if(!O.settled||!fe){Lt(!1);return}let f=!0;return _t().then(Y=>{f&&Lt(Y)}),()=>{f=!1}},[O.settled,fe,_t]);let{choose:xt}=O,be=h?"self":"assisted",ur=it(async()=>{await It(be)&&xt(be)},[It,xt,be]),Et=a.state!=="idle"&&a.facingMode!==null?a.facingMode:Ee;oe(()=>{let f=H.current?.style;Et==="user"?f?.removeProperty("transform"):f&&(f.transform="none")},[Et]);let Fe=Ie(()=>a.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(a.artifacts.keyframe):null,[a.artifacts]);oe(()=>{if(Fe!==null)return()=>URL.revokeObjectURL(Fe)},[Fe]);let Nt=a.frozenPreview??Fe,Se=e!==void 0,T=ho(a.state),le=vo(a.state),De=T||le,Z=a.result,Pt=a.state==="done"&&Z!==null,qe=T&&a.rampColour!==null,ct=a.state==="recording"&&a.frozenPreview!==null&&!qe,je=se!==null,At=wt&&T&&!ct?{to:be,label:p(be==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:p(be==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:n(()=>{ur()},"onSwitch")}:null,Ye=a.modeRestarted&&T?p("capture.modeSwitch.restarted"):null,Pe=le||ct,Tt=le?"checking":ct?"frozen":a.state==="recording"||qe?"recording":a.gateLocked||a.gate.progress>=1?"locked":a.gate.faceDetected?"aligning":"seeking",$e=T?a.gate.hint:null,ze=a.state==="starting"?"capture.preparing.title":$e===null?null:$e==="center"&&!a.gate.faceDetected?"fcv3.no_face":Wt($e),[dr,Kt]=ir(null);oe(()=>{if(ze!=="fcv3.no_face"){Kt(ze);return}if(!T)return;let f=setTimeout(()=>Kt(ze),uo);return()=>clearTimeout(f)},[ze,T]);let lt=T&&!qe&&typeof w=="string"&&w!=="",Ot=h&&T?p("capture.assisted.stage"):null,ge=T&&!lt?qe?po:dr:null,ut=lt?w:ge===null?"":p(ge);Ct(I,ge,ut,T);let Ut=ke(d);Ut.current=d,oe(()=>{if(he(ge))try{Ut.current?.(ge)}catch(f){console.error("[@sekyro/react] onGuidance threw:",f)}},[ge]);let Ae=Ie(()=>({supported:I.supported,enabled:I.enabled,setEnabled:I.setEnabled,toggle:I.toggle}),[I.supported,I.enabled,I.setEnabled,I.toggle]),dt=s?.voicePrompt,Ht=dt!==void 0,Bt=S===void 0,Gt=ke(!1);oe(()=>{!Ht||!Bt||Gt.current||!nt()||(Gt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[Ht,Bt]);let pr=dt!==void 0?(f,Y,de)=>dt(f,Y,de,Ae):I.supported?()=>R(sr,{voice:Ae}):void 0,{summary:pt,summaryPlaying:Ft,toggleSummary:Dt,stopSummary:qt}=I,Ze=y!==void 0&&y!=="",jt=Ze?y:p("capture.tips.summary"),Yt=Ze?pt!=="none":pt==="partner"||pt==="default"&&fo(b),fr=Ie(()=>Yt?{playing:Ft,toggle:n(()=>Dt(jt,{clip:!Ze}),"toggle"),stop:qt}:void 0,[Yt,Ft,Dt,jt,qt,Ze]),mr=Ie(()=>({assets:at,retryAssets:A.retry,permission:P.permission,permissionSettled:P.permissionSettled,captureMode:O.mode,facing:Ee,voice:Ae}),[at,A.retry,P.permission,P.permissionSettled,O.mode,Ee,Ae]),yr=yo(i)?R(D,{tone:i.tone,testId:"sekyro-host-notice",children:R("span",{children:i.text})}):i??null,X=Z!==null&&Z.status==="retry"?Z:null,G=Pt&&Z.status==="unavailable"&&!B&&Z.reasonCode!=="portrait_required"?Z:null,ue=Pt&&(Z.status==="verified"||Z.status==="not_verified"||Z.status==="review")?Z:null,ft=n((f,Y)=>{if(f===void 0)return null;if(f==="device_cooldown"){let Re=en(t,Y);if(Re!==null)return p(Re.key).replace("{time}",Re.time)}let de=Xt(f);return de===null?null:p(de)},"reasonText"),mt=n(f=>{let Y=f.retakeHint===void 0?null:Qt(f.retakeHint);return Y===null?ft(f.reasonCode):p(Y)},"retryText"),$t=ue===null?null:ft(ue.reasonCode,ue.retryAfter)??(ue.status==="not_verified"&&ue.reason!==void 0&&lo.has(ue.reason)?p("errors.session_expired"):null),gr=G!==null&&G.reasonCode!==void 0&&G.reasonCode!=="nni_unbound"&&G.reasonCode!=="id_number_unbound"&&G.reasonCode!=="method_required"&&G.reasonCode!=="mobile_required"&&!(G.reasonCode==="no_recorder"&&a.artifacts?.degraded==="NO_RECORDER"),We=G?.reasonCode,zt=a.attempt;oe(()=>{G===null||We===void 0||e?.reportCaptureIssue===void 0||go.has(We)||Qe(f=>e.reportCaptureIssue?.(f),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:We,attempt:Math.min(1e3,zt)})},[G,We,zt,e]);let Zt=Je(),hr=B&&_.auto===null&&!T&&!le&&a.error===null,yt=it(async f=>{await _.select(f)&&a.state==="done"&&a.retry()},[_.select,a.state,a.retry]);return oe(()=>{_.auto!==null&&!_.busy&&!T&&!le&&yt(_.auto)},[_.auto,_.busy,T,le,yt]),R(on,{value:p,children:xe("div",{ref:Q,className:V===void 0?"sekyro-capture":`sekyro-capture ${V}`,dir:U,lang:t,"data-testid":"sekyro-liveness-capture","data-state":a.state,children:[s?.header,X!==null&&mt(X)!==null&&!(je&&De)?R(D,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:R("span",{children:mt(X)})}):null,Ye!==null&&!je?R(D,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:R("span",{children:Ye})}):null,ae&&le&&!je?R(D,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:R("span",{children:p("capture.busy")})}):null,N.required&&ye?R(D,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:R("span",{children:p("reasons.mobile_required")})}):null,a.error!==null?s?.errorPanel!==void 0?s.errorPanel(a.error,a.retry):xe(D,{tone:"danger",testId:"sekyro-error-notice",children:[R("span",{children:p(Jt(a.error))}),a.error.retryable?R(F,{ref:Zt,kind:"ghost",className:"sekyro-btn--start",onClick:a.retry,children:p("common.retry")}):null]}):null,G!==null?xe(D,{tone:"danger",testId:"sekyro-unavailable-notice",children:[R("span",{children:ft(G.reasonCode)??p(G.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),gr?R(F,{ref:Zt,kind:"ghost",className:"sekyro-btn--start",onClick:a.retry,children:p("capture.recordAgain")}):null]}):null,$t!==null&&ue!==null?R(D,{tone:ue.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:R("span",{children:$t})}):null,R("div",{className:De?void 0:"sekyro-hidden","data-capture-live":De?"":void 0,children:je?se({videoRef:H,guidance:Pe&&Se?p("capture.checking"):ut,coached:lt&&!(Pe&&Se),note:Pe?Se?p(ae?"capture.busy":"capture.checkingHint"):null:Ye??(X!==null?mt(X):Ot),settled:Pe&&Se,progress:a.gate.progress,phase:Tt,still:Pe?Nt:null,live:De,modeSwitch:At,...wt?{status:Ye}:{},ramp:a.rampColour===null?null:{colour:a.rampColour}}):R(sn,{videoRef:H,guidanceText:ut,guidanceHint:$e,guidanceKey:ge,progress:a.gate.progress,phase:Tt,draining:a.draining,stillUrl:Nt,showChecking:Se,operatorText:Ot,voicePrompt:pr,overlay:f=>xe(ar,{children:[s?.stageOverlay?.(f),R(cn,{colour:a.rampColour})]}),reduceMotion:a.reduceMotion,modeSwitch:At})}),hr&&_.choice!==null?R(bn,{title:p("method.title"),description:p("method.description"),options:_.choice.options.map(f=>({id:f,label:p(`method.${f}`)})),busy:_.busy,error:_.failed?p("errors.network_error"):null,focus:a.state==="done",testId:"sekyro-method",look:"buttons",onChoose:f=>{yt(f)}}):null,lr?xe(ar,{children:[ie&&s?.header===void 0&&s?.intro===void 0?xe("div",{className:"sekyro-stack sekyro-stack--1",children:[R("h2",{className:"sekyro-text-body",children:p("returning.title")}),R("p",{className:"sekyro-text-muted",children:p("returning.description")})]}):null,yr,s?.intro!==void 0?s.intro(Ge,mr):R(Fn,{assets:at,onRetryAssets:A.retry,permission:P.permission,captureMode:O.mode,voice:Ae,tips:b??Xe,summary:fr,startLabel:k,startDisabled:u,onStart:Ge})]}):null,R(Tn,{showCoaching:X!==null,coaching:An(X?.reasonCode),attemptsText:X?.attemptsRemaining!==void 0?tn(K,t,X.attemptsRemaining):null,showRetake:X!==null&&!T&&!le||!Se&&a.state==="captured",onRetake:a.retry}),s?.footer]})})}n(xi,"LivenessCapture");export{An as a,Nn as b,nt as c,Kn as d,Xe as e,bn as f,$n as g,tt as h,uo as i,xi as j};
|
package/dist/chunk-3MCTR3RI.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{a as r}from"./chunk-2KED7D2Q.js";import{forwardRef as h}from"react";import{jsx as g}from"react/jsx-runtime";var C=h(r(function({kind:t="primary",full:n=!1,className:a,type:o,...s},c){let i=["sekyro-btn",`sekyro-btn--${t}`];return n&&i.push("sekyro-btn--full"),a!==void 0&&i.push(a),g("button",{ref:c,type:o??"button",className:i.join(" "),...s})},"Button"));var p={"capture.start":"Start camera","capture.recordAgain":"Start a new attempt","capture.switchCamera":"Switch camera","capture.preparing.title":"Preparing secure capture…","capture.checking":"We're checking your identity…","capture.checkingHint":"This usually takes a few seconds. Keep this page open","capture.securityNote":"Your images are encrypted and used only for this verification","capture.cameraOff":"Camera off","capture.previewAlt":"Preview of the captured image of your face","capture.retryCoaching.title":"That attempt didn't work. A few adjustments will help:","capture.retryCoaching.light":"Find good lighting, with the light on your face and not behind you","capture.retryCoaching.eyeLevel":"Hold your phone at eye level","capture.retryCoaching.head":"Look straight at the camera and keep your head upright","capture.retryTips.title":"Before you film again:","capture.retryOneFace.alone":"Make sure nobody is next to or behind the person being verified","capture.retryOneFace.screens":"Keep photos and screens that show a face out of view","capture.retryFrontCamera.screenSide":"The front camera is the one on the screen side, so you can see yourself","capture.retryBackCamera.backSide":"The back camera is the one on the side without the screen","capture.retryBackCamera.circle":"Hold the phone upright in front of the person, with their face in the circle","capture.retryUpright.vertical":"Hold the phone straight up and down, with the camera at the top","capture.retryUpright.untilEnd":"Keep it that way until the recording ends","capture.retryRecording.cameraOn":"Keep the camera on until the recording finishes","capture.retryRecording.stay":"Stay on this screen. Don't switch apps or lock your phone","capture.retryRecording.network":"Use a stable internet connection","capture.retryDevice.screenRecording":"Stop any screen recording or screen sharing","capture.retryDevice.phone":"Use the app on a phone, not on an emulator","capture.attemptsRemaining.one":"{count} attempt remaining","capture.attemptsRemaining.other":"{count} attempts remaining","common.retry":"Try again","fcv2.err.permission":"Allow camera access in your browser settings (the camera icon in the address bar), then try again","fcv2.err.notfound":"No camera detected. Connect or enable a camera, then try again","fcv2.err.inuse":"Another app is using the camera. Close it, then try again","fcv2.err.insecure":"The camera needs a secure connection (HTTPS). Reopen this page over HTTPS","fcv2.err.unsupported":"Your browser cannot capture in a supported format. Open this page in a recent browser such as Chrome or Safari","fcv2.err.generic":"The camera is unavailable. Try again, or contact support if it keeps failing","fcv3.no_face":"We can't see your face. Hold the phone in front of you","fcv3.come_closer":"Bring the phone a little closer","fcv3.move_back":"Move the phone a little farther away","fcv3.center_face":"Center your face in the circle","fcv3.straighten":"Hold your head straight","fcv3.more_light":"Find a brighter spot. Light your face","fcv3.too_bright":"Too much light. Move out of direct light","fcv3.hold_still":"Perfect, hold still","fcv3.steady_camera":"Hold the phone steady","fcv3.hold_upright":"Hold the phone upright","fcv3.one_face":"Only one person should be in the frame","reasons.no_face":"No face could be detected during the check","reasons.media_unreadable":"The submitted capture could not be read","reasons.clip_too_short":"The capture was too short","reasons.spoof_detected":"The liveness check could not confirm a live person in front of the camera","reasons.review_band":"The automatic check was not conclusive, so it was sent to human review","reasons.nni_not_found":"The national identification number was not found in the civil registry","reasons.nni_invalid":"The national identification number is not a valid 10-digit NNI","reasons.registry_unavailable":"The civil registry could not be reached to confirm your number","reasons.no_face_source":"No face could be detected in the selfie photo","reasons.no_face_reference":"No reference photo was available to compare your selfie against. The requester needs to resolve this, so retaking your selfie will not help","reasons.low_quality_reference":"The reference photo on file was not clear enough to compare against","reasons.below_threshold":"The selfie did not match the photo on the identity document closely enough","reasons.side_missing":"One side of the identity document was not submitted","reasons.mrz_checksum_failed":"The machine-readable zone of the document could not be validated","reasons.unreadable":"The document photo was not clear enough to read","reasons.expired_document":"The identity document has expired","reasons.authenticity_review":"The document was sent to human review to confirm its authenticity","reasons.registry_mismatch":"The document's details did not match the civil registry. A reviewer will check","reasons.document_nni_mismatch":"This document belongs to a different person than the one this verification was created for","reasons.id_number_invalid":"The ID number is not valid","reasons.registry_record_not_found":"No record was found in the registry for this ID number","reasons.document_id_number_mismatch":"This document belongs to a different person than the one this verification was created for","reasons.otp_mismatch":"The verification code did not match the one we sent","reasons.otp_expired":"The verification code expired before it was entered","reasons.otp_send_failed":"We could not send a verification code to your phone","reasons.uncalibrated_capture_channel":"Desktop/webcam captures are not yet auto-decided, so your verification went to human review","reasons.capture_back_camera":"Use the front camera. Hold the phone in front of your face and try again","reasons.capture_not_upright":"Hold your phone upright, not sideways, and try again","reasons.capture_front_camera":"Use the back camera. Point it at the person's face and try again","reasons.multiple_faces":"Someone else appeared in the video. Film again with only one person in the frame","reasons.location_not_allowed":"Verification isn't available in your region.","reasons.anonymizer_blocked":"Turn off your VPN or proxy, then open the link again.","reasons.nationality_not_allowed":"This service can't verify this document. Contact the organization for other options.","reasons.document_type_not_accepted":"This type of document isn't accepted. Choose another document.","reasons.underage":"You don't meet the minimum age for this service.","reasons.age_unverifiable":"We couldn't read your date of birth. Take a clearer photo of your document.","reasons.nationality_unreadable":"We couldn't read your nationality. Take a clearer photo of your document.","reasons.name_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.birth_date_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.nationality_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.document_number_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.liveness_inconclusive":"Let's try again: face a light source and hold still.","reasons.match_inconclusive":"We couldn't confirm it's you. Try again in good light, without glasses.","hints.appearance":"Let's try again: face a light source and hold still.","hints.motion":"Hold still and keep the phone steady, then try again.","hints.lighting":"Face a window or a lamp so your face is well lit, then try again.","hints.framing":"Move closer so your face fills the frame, then try again.","reasons.subject_revoked":"The identity on file for this check is no longer available. The requester needs to run a full verification, so retrying will not help","reasons.probe_not_from_liveness":"The same person needs to be on camera from start to finish. Record the video again","reasons.document_authenticity":"Use the original card, not a photo or a copy, and avoid reflections.","reasons.mobile_required":"Continue on your phone to take the selfie.","reasons.capture_tampered":"We couldn't verify this capture. Use your phone's built-in camera, without screen recording or camera apps.","reasons.device_velocity_exceeded":"This device can't be used for another verification right now. Contact the organization.","reasons.device_cooldown":"Too many attempts. Try again later.","cooldown.retryIn":"Too many attempts. Try again {time}.","cooldown.retryAt":"Too many attempts. Try again after {time}.","capture.busy":"Our service is busy. Trying again…","errors.inference_unavailable":"Try again in a moment.","method.title":"How do you want to verify?","method.description":"Choose one option to continue","returning.title":"Confirm it's you","returning.description":"You verified your identity before. One short face capture confirms it's still you.","method.national_number":"Enter my Mauritanian national ID number (NNI)","method.document_photo":"Photo of my document","errors.method_required":"Choose how you want to verify, then continue","errors.attestation_invalid":"We could not confirm this browser session is genuine. Reload the page and try again","errors.network_error":"We could not reach the verification service. Check your internet connection and try again","errors.session_expired":"This verification session has expired. Ask the organisation that sent you here for a new link","errors.nni_unbound":"This link was created without your national ID number. Ask the requester for a new link","errors.id_number_unbound":"This link was created without your ID number. Ask the requester for a new link","capture.tips.title":"For a successful check:","capture.tips.light":"Face a light source and avoid strong light behind you","capture.tips.uncover":"Uncover your face: no glasses, mask or hand in front of it","capture.tips.eyeLevel":"Hold your phone at eye level","capture.tips.straight":"Look straight at the camera and keep still","capture.tips.summary":"Stand in a well-lit area. Uncover your face: no glasses, no mask. Once the camera starts, hold your phone at eye level, look straight at the camera and keep still.","capture.tips.listen":"Listen to the instructions","capture.tips.stop":"Stop","capture.permission.granted":"Camera access allowed","capture.permission.prompt":"Your browser will ask to use the camera. Choose Allow","capture.permission.denied":"Camera access is blocked. Allow it in your browser settings (the camera icon in the address bar), then reload this page","capture.permission.unknown":"We'll ask to use your camera when you start","capture.cameraLabel":"Camera","capture.facing.user":"Front camera","capture.facing.environment":"Back camera","capture.assisted.title":"Capture the person's face","capture.assisted.lead":"Point the back camera at the person's face and hold the phone upright. The voice guidance speaks to the person being filmed.","capture.assisted.stage":"Point the camera at the person's face","capture.modeSwitch.toAssisted":"Someone is helping me","capture.modeSwitch.toSelf":"I film myself","capture.modeSwitch.toAssistedLabel":"Switch to assisted capture: another person holds the phone and films you","capture.modeSwitch.toSelfLabel":"Switch to self capture: you film yourself with the front camera","capture.modeSwitch.restarted":"Camera switched. Start again when you are ready","capture.lookAtColours":"Look at the colours","capture.voiceGuidance":"Voice guidance","capture.preparing.hint":"Setting up on-device face detection. This can take a moment on a slow connection","capture.ready":"Ready. Start when you are","fcv2.err.models":"The face-detection models could not be loaded. Check your connection and try again","fcv2.err.backcamera":"The back camera could not be opened, and assisted capture needs it. Try again, or continue on another phone"};var f={"capture.start":"تشغيل الكاميرا","capture.recordAgain":"ابدأ محاولة جديدة","capture.switchCamera":"تبديل الكاميرا","capture.preparing.title":"جارٍ تجهيز الالتقاط الآمن…","capture.checking":"نتحقق من هويتك…","capture.checkingHint":"يستغرق هذا عادةً بضع ثوانٍ. أبقِ هذه الصفحة مفتوحة","capture.securityNote":"تُشفَّر لقطاتك وتُستخدم فقط لهذا التحقق","capture.cameraOff":"الكاميرا مطفأة","capture.previewAlt":"معاينة الصورة الملتقطة لوجهك","capture.retryCoaching.title":"لم تنجح هذه المحاولة. بعض التعديلات ستساعد:","capture.retryCoaching.light":"اختر مكانًا جيد الإضاءة، بحيث يكون الضوء على وجهك لا خلفك","capture.retryCoaching.eyeLevel":"أمسك هاتفك بمستوى العينين","capture.retryCoaching.head":"انظر مباشرة إلى الكاميرا وأبقِ رأسك مستقيمًا","capture.retryTips.title":"قبل التصوير مرة أخرى:","capture.retryOneFace.alone":"تأكد من عدم وجود أي شخص بجانب الشخص الذي يتم التحقق منه أو خلفه","capture.retryOneFace.screens":"أبعد عن الإطار الصور والشاشات التي يظهر فيها وجه","capture.retryFrontCamera.screenSide":"الكاميرا الأمامية هي التي في جهة الشاشة، حيث ترى نفسك","capture.retryBackCamera.backSide":"الكاميرا الخلفية هي التي في الجهة المقابلة للشاشة","capture.retryBackCamera.circle":"أمسك الهاتف بشكل عمودي أمام الشخص، مع إبقاء وجهه داخل الدائرة","capture.retryUpright.vertical":"أمسك الهاتف بشكل عمودي، والكاميرا في الأعلى","capture.retryUpright.untilEnd":"أبقِه كذلك حتى ينتهي التسجيل","capture.retryRecording.cameraOn":"أبقِ الكاميرا تعمل حتى ينتهي التسجيل","capture.retryRecording.stay":"ابقَ في هذه الشاشة. لا تنتقل إلى تطبيق آخر ولا تقفل هاتفك","capture.retryRecording.network":"استخدم اتصال إنترنت مستقرًا","capture.retryDevice.screenRecording":"أوقف أي تسجيل للشاشة أو مشاركة لها","capture.retryDevice.phone":"استخدم التطبيق على هاتف، لا على محاكي","capture.attemptsRemaining.zero":"لم تتبقَّ أي محاولة","capture.attemptsRemaining.one":"تبقّت محاولة واحدة","capture.attemptsRemaining.two":"تبقّت محاولتان","capture.attemptsRemaining.few":"تبقّت {count} محاولات","capture.attemptsRemaining.many":"تبقّت {count} محاولة","capture.attemptsRemaining.other":"تبقّت {count} محاولة","common.retry":"أعد المحاولة","fcv2.err.permission":"اسمح بالوصول إلى الكاميرا من إعدادات المتصفح (أيقونة الكاميرا في شريط العنوان) ثم أعد المحاولة","fcv2.err.notfound":"لم يتم العثور على كاميرا. وصِّل كاميرا أو فعِّلها ثم أعد المحاولة","fcv2.err.inuse":"تطبيق آخر يستخدم الكاميرا. أغلقه ثم أعد المحاولة","fcv2.err.insecure":"تتطلب الكاميرا اتصالًا آمنًا (HTTPS). افتح هذه الصفحة عبر HTTPS","fcv2.err.unsupported":"متصفحك لا يستطيع الالتقاط بصيغة مدعومة. افتح هذه الصفحة في متصفح حديث مثل كروم أو سفاري","fcv2.err.generic":"الكاميرا غير متاحة. أعد المحاولة، وتواصل مع الدعم إذا استمرت المشكلة","fcv3.no_face":"لا نرى وجهك. أمسك الهاتف أمامك","fcv3.come_closer":"قرّب الهاتف قليلًا","fcv3.move_back":"أبعد الهاتف قليلًا","fcv3.center_face":"ضع وجهك في منتصف الدائرة","fcv3.straighten":"أبقِ رأسك مستقيمًا","fcv3.more_light":"انتقل إلى مكان أكثر إضاءة. أضئ وجهك","fcv3.too_bright":"الإضاءة قوية جدًا. تجنّب الضوء المباشر على وجهك","fcv3.hold_still":"ممتاز، لا تتحرك","fcv3.steady_camera":"أمسك الهاتف بثبات","fcv3.hold_upright":"أمسك الهاتف بشكل عمودي","fcv3.one_face":"يجب أن يظهر شخص واحد فقط في الإطار","reasons.no_face":"تعذّر اكتشاف أي وجه أثناء التحقق","reasons.media_unreadable":"تعذّرت قراءة اللقطة المُرسلة","reasons.clip_too_short":"كانت اللقطة أقصر من اللازم","reasons.spoof_detected":"لم يتمكن فحص الحضور الحي من تأكيد وجود شخص حقيقي أمام الكاميرا","reasons.review_band":"لم يكن الفحص التلقائي حاسمًا، لذا أُحيل إلى مراجعة بشرية","reasons.nni_not_found":"لم يُعثر على الرقم الوطني في سجل الحالة المدنية","reasons.nni_invalid":"الرقم الوطني ليس رقمًا صالحًا مكوّنًا من 10 أرقام","reasons.registry_unavailable":"تعذّر الوصول إلى سجل الحالة المدنية لتأكيد رقمك","reasons.no_face_source":"تعذّر اكتشاف وجه في الصورة الذاتية","reasons.no_face_reference":"لم تتوفّر صورة مرجعية لمقارنة صورتك الذاتية بها. على الجهة الطالبة معالجة ذلك، وإعادة التقاط صورتك الذاتية لن تُجدي","reasons.low_quality_reference":"الصورة المرجعية المحفوظة لم تكن واضحة بما يكفي للمقارنة","reasons.below_threshold":"الصورة الذاتية لم تطابق صورة وثيقة الهوية بدرجة كافية","reasons.side_missing":"أحد وجهي وثيقة الهوية لم يُرسل","reasons.mrz_checksum_failed":"تعذّر التحقق من منطقة القراءة الآلية في الوثيقة","reasons.unreadable":"صورة الوثيقة لم تكن واضحة بما يكفي للقراءة","reasons.expired_document":"انتهت صلاحية وثيقة الهوية","reasons.authenticity_review":"أُحيلت الوثيقة إلى مراجعة بشرية للتأكد من صحتها","reasons.registry_mismatch":"بيانات الوثيقة لا تطابق السجل المدني. سيتحقق منها مراجع","reasons.document_nni_mismatch":"هذه الوثيقة تخص شخصًا آخر غير الشخص الذي أُنشئ له هذا التحقق","reasons.id_number_invalid":"رقم الهوية غير صالح","reasons.registry_record_not_found":"لم يُعثر على أي سجل لرقم الهوية هذا في السجل","reasons.document_id_number_mismatch":"هذه الوثيقة تخص شخصًا آخر غير الشخص الذي أُنشئ له هذا التحقق","reasons.otp_mismatch":"رمز التحقّق لا يطابق الرمز الذي أرسلناه","reasons.otp_expired":"انتهت صلاحية رمز التحقّق قبل إدخاله","reasons.otp_send_failed":"تعذّر إرسال رمز التحقّق إلى هاتفك","reasons.uncalibrated_capture_channel":"جودة الكاميرا المكتبية غير معايَرة بعد، لذا أُحيل تحققك إلى مراجعة بشرية","reasons.capture_back_camera":"استخدم الكاميرا الأمامية. أمسك الهاتف أمام وجهك وحاول مرة أخرى","reasons.capture_not_upright":"أمسك هاتفك بشكل عمودي وليس أفقيًا، ثم حاول مرة أخرى","reasons.capture_front_camera":"استخدم الكاميرا الخلفية. وجّهها نحو وجه الشخص وحاول مرة أخرى","reasons.multiple_faces":"ظهر شخص آخر في الفيديو. صوّر مرة أخرى مع وجود شخص واحد فقط في الإطار","reasons.location_not_allowed":"التحقق غير متاح في منطقتك.","reasons.anonymizer_blocked":"أوقف تشغيل VPN أو الوكيل ثم افتح الرابط مجددًا.","reasons.nationality_not_allowed":"لا يمكن لهذه الخدمة التحقق من هذه الوثيقة. تواصل مع الجهة لمعرفة الخيارات الأخرى.","reasons.document_type_not_accepted":"هذا النوع من الوثائق غير مقبول. اختر وثيقة أخرى.","reasons.underage":"لا تستوفي الحد الأدنى للسن لهذه الخدمة.","reasons.age_unverifiable":"تعذّرت قراءة تاريخ ميلادك. التقط صورة أوضح لوثيقتك.","reasons.nationality_unreadable":"تعذّرت قراءة جنسيتك. التقط صورة أوضح لوثيقتك.","reasons.name_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.birth_date_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.nationality_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.document_number_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.liveness_inconclusive":"لنحاول مجددًا: اجعل وجهك مقابل مصدر ضوء وابقَ ثابتًا.","reasons.match_inconclusive":"لم نتمكّن من التأكد من أنك أنت. حاول مجددًا في إضاءة جيدة ومن دون نظارات.","hints.appearance":"لنحاول مجددًا: اجعل وجهك مقابل مصدر ضوء وابقَ ثابتًا.","hints.motion":"ابقَ ثابتًا وأمسك الهاتف بثبات، ثم حاول مجددًا.","hints.lighting":"اجعل وجهك مقابل نافذة أو مصباح حتى يكون مضاءً جيدًا، ثم حاول مجددًا.","hints.framing":"اقترب أكثر حتى يملأ وجهك الإطار، ثم حاول مجددًا.","reasons.subject_revoked":"لم تعد الهوية المحفوظة لهذا التحقق متاحة. على الجهة الطالبة إجراء تحقق كامل، وإعادة المحاولة لن تُجدي","reasons.probe_not_from_liveness":"يجب أن يظهر الشخص نفسه أمام الكاميرا من البداية إلى النهاية. سجّل الفيديو مرة أخرى","reasons.document_authenticity":"استخدم البطاقة الأصلية، لا صورة لها ولا نسخة منها، وتجنّب الانعكاسات.","reasons.mobile_required":"تابع على هاتفك لالتقاط صورة لوجهك.","reasons.capture_tampered":"تعذّر التحقق من هذا الالتقاط. استخدم الكاميرا المدمجة في هاتفك، دون تسجيل الشاشة أو تطبيقات الكاميرا.","reasons.device_velocity_exceeded":"لا يمكن استخدام هذا الجهاز لعملية تحقق أخرى حاليًا. تواصل مع الجهة.","reasons.device_cooldown":"محاولات كثيرة. حاول مجددًا لاحقًا.","cooldown.retryIn":"محاولات كثيرة. حاول مجددًا {time}.","cooldown.retryAt":"محاولات كثيرة. حاول مجددًا بعد {time}.","capture.busy":"خدمتنا مشغولة حاليًا. نعيد المحاولة…","errors.inference_unavailable":"حاول مجددًا بعد لحظات.","method.title":"كيف تريد التحقق من هويتك؟","method.description":"اختر إحدى الطريقتين للمتابعة","returning.title":"أكّد أنك أنت","returning.description":"سبق أن تحقّقت من هويتك. التقاط قصير لوجهك يكفي لتأكيد أنك أنت.","method.national_number":"إدخال الرقم الوطني للتعريف الموريتاني (NNI)","method.document_photo":"تصوير وثيقتي","errors.method_required":"اختر طريقة التحقق، ثم تابع","errors.attestation_invalid":"تعذّر التأكد من سلامة جلسة المتصفح. أعد تحميل الصفحة وحاول مجددًا","errors.network_error":"تعذّر الوصول إلى خدمة التحقق. تحقق من اتصالك بالإنترنت وأعد المحاولة","errors.session_expired":"انتهت صلاحية جلسة التحقق هذه. اطلب رابطًا جديدًا من الجهة التي أرسلتك إلى هنا","errors.nni_unbound":"أُنشئ هذا الرابط دون رقمك الوطني للتعريف. اطلب رابطًا جديدًا من الجهة الطالبة","errors.id_number_unbound":"أُنشئ هذا الرابط دون رقم هويتك. اطلب رابطًا جديدًا من الجهة الطالبة","capture.tips.title":"لتحقق ناجح:","capture.tips.light":"اجعل الضوء أمام وجهك وتجنّب الإضاءة القوية خلفك","capture.tips.uncover":"اكشف وجهك: بلا نظارات أو كمامة أو يد أمامه","capture.tips.eyeLevel":"أمسك هاتفك بمستوى العينين","capture.tips.straight":"انظر مباشرة إلى الكاميرا وابقَ ثابتًا","capture.tips.summary":"اختر مكانًا جيد الإضاءة. اكشف وجهك: بلا نظارات أو كمامة. بعد تشغيل الكاميرا، أمسك هاتفك بمستوى العينين، وانظر مباشرة إلى الكاميرا وابقَ ثابتًا.","capture.tips.listen":"استمع إلى التعليمات","capture.tips.stop":"إيقاف","capture.permission.granted":"تم السماح بالوصول إلى الكاميرا","capture.permission.prompt":"سيطلب متصفحك استخدام الكاميرا. اختر «السماح»","capture.permission.denied":"الوصول إلى الكاميرا محظور. اسمح به من إعدادات المتصفح (رمز الكاميرا في شريط العنوان)، ثم أعد تحميل الصفحة","capture.permission.unknown":"سنطلب استخدام الكاميرا عند البدء","capture.cameraLabel":"الكاميرا","capture.facing.user":"الكاميرا الأمامية","capture.facing.environment":"الكاميرا الخلفية","capture.assisted.title":"صوّر وجه الشخص","capture.assisted.lead":"وجّه الكاميرا الخلفية نحو وجه الشخص وأمسك الهاتف بشكل عمودي. الإرشادات الصوتية تخاطب الشخص الذي تصوّره.","capture.assisted.stage":"وجّه الكاميرا نحو وجه الشخص","capture.modeSwitch.toAssisted":"شخص يساعدني","capture.modeSwitch.toSelf":"أصوّر نفسي","capture.modeSwitch.toAssistedLabel":"التبديل إلى التصوير بمساعدة شخص آخر يحمل الهاتف ويصوّرك","capture.modeSwitch.toSelfLabel":"التبديل إلى التصوير الذاتي بالكاميرا الأمامية","capture.modeSwitch.restarted":"تم تبديل الكاميرا. ابدأ من جديد عندما تكون جاهزًا","capture.lookAtColours":"انظر إلى الألوان","capture.voiceGuidance":"الإرشاد الصوتي","capture.preparing.hint":"يجري إعداد كشف الوجه على جهازك. قد يستغرق ذلك لحظة على اتصال بطيء","capture.ready":"جاهز. ابدأ عندما تكون مستعدًا","fcv2.err.models":"تعذّر تحميل نماذج التعرف على الوجه. تحقق من اتصالك ثم أعد المحاولة","fcv2.err.backcamera":"تعذّر فتح الكاميرا الخلفية، والالتقاط المساعَد يحتاج إليها. أعد المحاولة أو تابع على هاتف آخر"};var v={"capture.start":"Démarrer la caméra","capture.recordAgain":"Commencer une nouvelle tentative","capture.switchCamera":"Changer de caméra","capture.preparing.title":"Préparation de la capture sécurisée…","capture.checking":"Nous vérifions votre identité…","capture.checkingHint":"Cela prend généralement quelques secondes. Gardez cette page ouverte","capture.securityNote":"Vos images sont chiffrées et utilisées uniquement pour cette vérification","capture.cameraOff":"Caméra éteinte","capture.previewAlt":"Aperçu de l’image capturée de votre visage","capture.retryCoaching.title":"Cette tentative n'a pas abouti. Quelques ajustements vous aideront :","capture.retryCoaching.light":"Placez-vous dans un endroit bien éclairé, avec la lumière sur le visage et non derrière vous","capture.retryCoaching.eyeLevel":"Tenez votre téléphone à hauteur des yeux","capture.retryCoaching.head":"Regardez droit vers la caméra, la tête bien droite","capture.retryTips.title":"Avant de filmer à nouveau :","capture.retryOneFace.alone":"Assurez-vous que personne ne se trouve à côté ou derrière la personne vérifiée","capture.retryOneFace.screens":"Gardez hors du cadre les photos et les écrans qui montrent un visage","capture.retryFrontCamera.screenSide":"La caméra avant est celle du côté de l'écran : vous vous voyez à l'écran","capture.retryBackCamera.backSide":"La caméra arrière est celle du côté opposé à l'écran","capture.retryBackCamera.circle":"Tenez le téléphone droit face à la personne, son visage dans le cercle","capture.retryUpright.vertical":"Tenez le téléphone bien droit, la caméra en haut","capture.retryUpright.untilEnd":"Gardez-le ainsi jusqu'à la fin de l'enregistrement","capture.retryRecording.cameraOn":"Laissez la caméra allumée jusqu'à la fin de l'enregistrement","capture.retryRecording.stay":"Restez sur cet écran. Ne changez pas d'application et ne verrouillez pas votre téléphone","capture.retryRecording.network":"Utilisez une connexion internet stable","capture.retryDevice.screenRecording":"Arrêtez tout enregistrement ou partage d'écran","capture.retryDevice.phone":"Utilisez l'application sur un téléphone, pas sur un émulateur","capture.attemptsRemaining.one":"{count} tentative restante","capture.attemptsRemaining.other":"{count} tentatives restantes","common.retry":"Réessayer","fcv2.err.permission":"Autorisez la caméra dans les réglages du navigateur (icône caméra dans la barre d’adresse), puis réessayez","fcv2.err.notfound":"Aucune caméra détectée. Branchez ou activez une caméra, puis réessayez","fcv2.err.inuse":"La caméra est utilisée par une autre application. Fermez-la, puis réessayez","fcv2.err.insecure":"La caméra nécessite une connexion sécurisée (HTTPS). Rouvrez cette page en HTTPS","fcv2.err.unsupported":"Votre navigateur ne prend pas en charge un format de capture compatible. Ouvrez cette page dans un navigateur récent comme Chrome ou Safari","fcv2.err.generic":"Caméra indisponible. Réessayez, ou contactez le support si le problème persiste","fcv3.no_face":"Nous ne voyons pas votre visage. Tenez le téléphone devant vous","fcv3.come_closer":"Rapprochez un peu le téléphone","fcv3.move_back":"Éloignez un peu le téléphone","fcv3.center_face":"Centrez votre visage dans le cercle","fcv3.straighten":"Tenez la tête droite","fcv3.more_light":"Cherchez un endroit plus lumineux. Éclairez votre visage","fcv3.too_bright":"Trop de lumière. Évitez la lumière directe sur le visage","fcv3.hold_still":"Parfait, ne bougez plus","fcv3.steady_camera":"Tenez le téléphone stable","fcv3.hold_upright":"Tenez le téléphone à la verticale","fcv3.one_face":"Une seule personne doit être dans le cadre","reasons.no_face":"Aucun visage n’a pu être détecté pendant la vérification","reasons.media_unreadable":"La capture envoyée n’a pas pu être lue","reasons.clip_too_short":"La capture était trop courte","reasons.spoof_detected":"Le contrôle de présence n'a pas pu confirmer la présence d'une personne réelle devant la caméra","reasons.review_band":"Le contrôle automatique n'a pas été concluant, il a donc été transmis à un examen humain","reasons.nni_not_found":"Le numéro national d'identification n'a pas été trouvé dans le registre d'état civil","reasons.nni_invalid":"Le numéro national d'identification n'est pas un NNI valide à 10 chiffres","reasons.registry_unavailable":"Le registre d'état civil n'a pas pu être joint pour confirmer votre numéro","reasons.no_face_source":"Aucun visage n'a pu être détecté sur la photo selfie","reasons.no_face_reference":"Aucune photo de référence n'était disponible pour comparer votre selfie. C'est au demandeur de le résoudre : reprendre votre selfie n'y changera rien","reasons.low_quality_reference":"La photo de référence enregistrée n'était pas assez nette pour la comparaison","reasons.below_threshold":"Le selfie ne correspondait pas suffisamment à la photo de la pièce d'identité","reasons.side_missing":"Un côté de la pièce d'identité n'a pas été envoyé","reasons.mrz_checksum_failed":"La zone de lecture automatique du document n'a pas pu être validée","reasons.unreadable":"La photo du document n'était pas assez nette pour être lue","reasons.expired_document":"La pièce d'identité a expiré","reasons.authenticity_review":"Le document a été transmis à un examen humain pour confirmer son authenticité","reasons.registry_mismatch":"Les informations du document ne correspondent pas au registre civil. Un examinateur va vérifier","reasons.document_nni_mismatch":"Ce document appartient à une autre personne que celle pour qui cette vérification a été créée","reasons.id_number_invalid":"Le numéro d'identité n'est pas valide","reasons.registry_record_not_found":"Aucun dossier n'a été trouvé dans le registre pour ce numéro d'identité","reasons.document_id_number_mismatch":"Ce document appartient à une autre personne que celle pour qui cette vérification a été créée","reasons.otp_mismatch":"Le code de vérification ne correspond pas à celui que nous avons envoyé","reasons.otp_expired":"Le code de vérification a expiré avant d'être saisi","reasons.otp_send_failed":"Nous n'avons pas pu envoyer de code de vérification à votre téléphone","reasons.uncalibrated_capture_channel":"Les captures webcam ne sont pas encore décidées automatiquement, votre vérification part donc en revue humaine","reasons.capture_back_camera":"Utilisez la caméra avant. Tenez le téléphone devant votre visage et réessayez","reasons.capture_not_upright":"Tenez votre téléphone à la verticale, pas à l'horizontale, et réessayez","reasons.capture_front_camera":"Utilisez la caméra arrière. Dirigez-la vers le visage de la personne et réessayez","reasons.multiple_faces":"Une autre personne est apparue dans la vidéo. Filmez à nouveau avec une seule personne dans le cadre","reasons.location_not_allowed":"La vérification n'est pas disponible dans votre région.","reasons.anonymizer_blocked":"Désactivez votre VPN ou proxy, puis rouvrez le lien.","reasons.nationality_not_allowed":"Ce service ne peut pas vérifier ce document. Contactez l'organisation pour d'autres options.","reasons.document_type_not_accepted":"Ce type de document n'est pas accepté. Choisissez un autre document.","reasons.underage":"Vous n'avez pas l'âge minimum requis pour ce service.","reasons.age_unverifiable":"Nous n'avons pas pu lire votre date de naissance. Prenez une photo plus nette de votre document.","reasons.nationality_unreadable":"Nous n'avons pas pu lire votre nationalité. Prenez une photo plus nette de votre document.","reasons.name_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.birth_date_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.nationality_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.document_number_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.liveness_inconclusive":"Réessayons : placez-vous face à une source de lumière et restez immobile.","reasons.match_inconclusive":"Nous n'avons pas pu confirmer qu'il s'agit bien de vous. Réessayez dans un endroit bien éclairé, sans lunettes.","hints.appearance":"Réessayons : placez-vous face à une source de lumière et restez immobile.","hints.motion":"Restez immobile et tenez le téléphone bien stable, puis réessayez.","hints.lighting":"Placez-vous face à une fenêtre ou une lampe pour que votre visage soit bien éclairé, puis réessayez.","hints.framing":"Rapprochez-vous pour que votre visage remplisse le cadre, puis réessayez.","reasons.subject_revoked":"L'identité enregistrée pour cette vérification n'est plus disponible. Le demandeur doit lancer une vérification complète : réessayer n'y changera rien","reasons.probe_not_from_liveness":"La même personne doit être devant la caméra du début à la fin. Enregistrez à nouveau la vidéo","reasons.document_authenticity":"Utilisez la carte originale, pas une photo ni une copie, et évitez les reflets.","reasons.mobile_required":"Continuez sur votre téléphone pour prendre le selfie.","reasons.capture_tampered":"Nous n'avons pas pu vérifier cette capture. Utilisez l'appareil photo intégré de votre téléphone, sans enregistrement d'écran ni application de caméra.","reasons.device_velocity_exceeded":"Cet appareil ne peut pas servir à une autre vérification pour le moment. Contactez l'organisation.","reasons.device_cooldown":"Trop de tentatives. Réessayez plus tard.","cooldown.retryIn":"Trop de tentatives. Réessayez {time}.","cooldown.retryAt":"Trop de tentatives. Réessayez à partir de {time}.","capture.busy":"Notre service est très sollicité. Nouvel essai en cours…","errors.inference_unavailable":"Réessayez dans un instant.","method.title":"Comment souhaitez-vous vérifier votre identité ?","method.description":"Choisissez une option pour continuer","returning.title":"Confirmez qu'il s'agit bien de vous","returning.description":"Vous avez déjà vérifié votre identité. Une courte capture du visage confirme qu'il s'agit toujours de vous.","method.national_number":"Saisir mon numéro national d'identification mauritanien (NNI)","method.document_photo":"Photographier mon document","errors.method_required":"Choisissez comment vérifier votre identité, puis continuez","errors.attestation_invalid":"Nous n'avons pas pu confirmer l'authenticité de cette session de navigateur. Rechargez la page et réessayez","errors.network_error":"Nous n'avons pas pu joindre le service de vérification. Vérifiez votre connexion internet et réessayez","errors.session_expired":"Cette session de vérification a expiré. Demandez un nouveau lien à l'organisme qui vous a envoyé ici","errors.nni_unbound":"Ce lien a été créé sans votre numéro national d'identification. Demandez un nouveau lien à l'organisme demandeur","errors.id_number_unbound":"Ce lien a été créé sans votre numéro d'identité. Demandez un nouveau lien à l'organisme demandeur","capture.tips.title":"Pour une vérification réussie :","capture.tips.light":"Placez-vous face à la lumière et évitez une forte lumière derrière vous","capture.tips.uncover":"Dégagez votre visage : ni lunettes, ni masque, ni main devant","capture.tips.eyeLevel":"Tenez votre téléphone à hauteur des yeux","capture.tips.straight":"Regardez droit vers la caméra et restez immobile","capture.tips.summary":"Placez-vous dans une zone bien éclairée. Dégagez votre visage : ni lunettes, ni masque. Une fois la caméra démarrée, tenez votre téléphone à hauteur des yeux, regardez droit vers la caméra et restez immobile.","capture.tips.listen":"Écouter les instructions","capture.tips.stop":"Arrêter","capture.permission.granted":"Accès à la caméra autorisé","capture.permission.prompt":"Votre navigateur va demander l’accès à la caméra. Choisissez « Autoriser »","capture.permission.denied":"L’accès à la caméra est bloqué. Autorisez-le dans les réglages du navigateur (icône caméra dans la barre d’adresse), puis rechargez la page","capture.permission.unknown":"Nous demanderons l’accès à la caméra au démarrage","capture.cameraLabel":"Caméra","capture.facing.user":"Caméra avant","capture.facing.environment":"Caméra arrière","capture.assisted.title":"Filmez le visage de la personne","capture.assisted.lead":"Pointez la caméra arrière vers le visage de la personne et tenez le téléphone à la verticale. Le guidage vocal s'adresse à la personne filmée.","capture.assisted.stage":"Pointez la caméra vers le visage de la personne","capture.modeSwitch.toAssisted":"Quelqu'un m'aide","capture.modeSwitch.toSelf":"Je me filme","capture.modeSwitch.toAssistedLabel":"Passer à la capture assistée : une autre personne tient le téléphone et vous filme","capture.modeSwitch.toSelfLabel":"Passer à la capture seule : vous vous filmez avec la caméra avant","capture.modeSwitch.restarted":"Caméra changée. Recommencez quand vous le souhaitez","capture.lookAtColours":"Regardez les couleurs","capture.voiceGuidance":"Guidage vocal","capture.preparing.hint":"Mise en place de la détection du visage sur l’appareil. Cela peut prendre un instant sur une connexion lente","capture.ready":"Prêt. Commencez quand vous voulez","fcv2.err.models":"Impossible de charger les modèles de détection du visage. Vérifiez votre connexion puis réessayez","fcv2.err.backcamera":"La caméra arrière n'a pas pu s'ouvrir, et la capture assistée en a besoin. Réessayez ou continuez sur un autre téléphone"};var u={},l=r(e=>e==="es"||e==="pt"||e==="de","isOverlayLocale");function q(e){return l(e)?"en":e}r(q,"baseLocale");function N(e){return l(e)?u[e]:void 0}r(N,"overlayOf");function _(e){return l(e)&&u[e]===void 0}r(_,"overlayPending");function O(e){return _(e)?(e==="es"?import("./overlay-es-PZCE25XM.js"):e==="pt"?import("./overlay-pt-PZ3L6DR7.js"):import("./overlay-de-PVJMYZGV.js")).then(n=>{u[e]=n.overlay},()=>{u[e]={}}):Promise.resolve()}r(O,"loadSekyroLocale");var d=Object.freeze({"reasons.id_number_invalid":"reasons.nni_invalid","reasons.registry_record_not_found":"reasons.nni_not_found","reasons.document_id_number_mismatch":"reasons.document_nni_mismatch","errors.id_number_unbound":"errors.nni_unbound","population.reason_id_number_invalid":"population.reason_nni_invalid","population.reason_registry_record_not_found":"population.reason_nni_not_found","population.reason_registry_record_not_found_or_document":"population.reason_nni_not_found_or_document","summary.id_number":"summary.nni"}),y=new Map(Object.entries(d).filter(([e])=>e.startsWith("reasons.")).map(([e,t])=>[t.slice(8),e.slice(8)]));function m(e){return y.get(e)??e}r(m,"genericReason");function D(e,t){let n=e,a=t;for(let[o,s]of Object.entries(d)){let c=a[o],i=a[s];typeof c!="string"&&typeof i=="string"?n[o]=i:typeof i!="string"&&typeof c=="string"&&(n[s]=c)}}r(D,"aliasRenamedKeys");function E(e){switch(e){case"center":return"fcv3.center_face";case"closer":return"fcv3.come_closer";case"farther":return"fcv3.move_back";case"light":return"fcv3.more_light";case"still":case"hold":return"fcv3.hold_still";case"upright":return"fcv3.hold_upright";case"one_face":return"fcv3.one_face";default:{let t=e;throw new Error(`hintStringKey: unhandled hint ${t}`)}}}r(E,"hintStringKey");function B(e){let t=`hints.${e}`;return Object.hasOwn(p,t)?t:null}r(B,"retakeHintStringKey");function b(e){return`fcv2.err.${e}`}r(b,"captureErrorStringKey");function M(e){return e.detail?.engineKind==="backcamera"?"fcv2.err.backcamera":b(e.kind)}r(M,"captureErrorCopyKey");function j(e){switch(e){case"no_recorder":return"fcv2.err.unsupported";case"attestation":return"errors.attestation_invalid";case"network":return"errors.network_error";case"nni_unbound":case"id_number_unbound":return"errors.id_number_unbound";case"method_required":return"errors.method_required";case"inference_unavailable":return"errors.inference_unavailable";default:{let t=`reasons.${m(e)}`;return Object.hasOwn(p,t)?t:null}}}r(j,"reasonStringKey");function V(e,t,n=new Date){if(t===void 0)return null;let a=new Date(t),o=a.getTime()-n.getTime();if(!Number.isFinite(o)||o<=0)return null;if(o<36e5){let i=Math.max(1,Math.ceil(o/6e4));return{key:"cooldown.retryIn",time:new Intl.RelativeTimeFormat(e,{numeric:"always"}).format(i,"minute")}}let s=a.toDateString()===n.toDateString();return{key:"cooldown.retryAt",time:new Intl.DateTimeFormat(e,{...s?{}:{day:"numeric",month:"long"},hour:"2-digit",minute:"2-digit"}).format(a)}}r(V,"retryAfterTime");function G(e,t,n){let a=new Intl.PluralRules(t).select(n);return((a==="other"?void 0:e[`capture.attemptsRemaining.${a}`])??e["capture.attemptsRemaining.other"]).replace("{count}",new Intl.NumberFormat(t).format(n))}r(G,"attemptsRemainingText");import{useCallback as w}from"react";function X(){return w(e=>{e?.focus()},[])}r(X,"useFocusOnMount");import{jsx as k}from"react/jsx-runtime";function re({tone:e,role:t,children:n,testId:a}){return k("div",{role:t??(e==="info"?"status":"alert"),className:`sekyro-notice sekyro-notice--${e}`,"data-testid":a,children:n})}r(re,"Notice");export{C as a,p as b,m as c,D as d,f as e,v as f,q as g,N as h,_ as i,O as j,E as k,B as l,b as m,M as n,j as o,V as p,G as q,re as r,X as s};
|