@sekyro/elements 0.1.0-rc.2 → 0.1.0-rc.20
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 +168 -0
- package/README.md +8 -9
- package/custom-elements.json +2 -2
- package/dist/cdn/chunks/barcode-detect-C5IOXMKI-ZOZ2WOWU.js +1 -0
- package/dist/cdn/chunks/{camera-trait-V4UAOPIQ-TFCPOCSU.js → camera-trait-DELAK3YN-4I2GHAFU.js} +1 -1
- package/dist/cdn/chunks/capture-session-doc-HIN3YZG2-ZOYOVMIF.js +1 -0
- package/dist/cdn/chunks/challenge-frame-YBTLAQ5G-NN763UU5.js +1 -0
- package/dist/cdn/chunks/chunk-2GVFM77I.js +33 -0
- package/dist/cdn/chunks/chunk-32CNXSJQ.js +1 -0
- package/dist/cdn/chunks/{chunk-UQKRYXN5.js → chunk-5JSOPXYS.js} +1 -1
- package/dist/cdn/chunks/{chunk-HTLQX2R3.js → chunk-677IJRH3.js} +1 -1
- package/dist/cdn/chunks/chunk-6MYG4HWP.js +1 -0
- package/dist/cdn/chunks/chunk-BMTTAXWY.js +25 -0
- package/dist/cdn/chunks/{chunk-NQHMZQZA.js → chunk-BO327WCQ.js} +1 -1
- package/dist/cdn/chunks/chunk-BWOTZKA7.js +1 -0
- package/dist/cdn/chunks/{chunk-JAIRD73U.js → chunk-CYEDFGUG.js} +1 -1
- package/dist/cdn/chunks/chunk-F4Q2Q4OC.js +1 -0
- package/dist/cdn/chunks/{chunk-KQQ6BZAH.js → chunk-FQHV53QQ.js} +1 -1
- package/dist/cdn/chunks/chunk-FZP5NLDQ.js +1 -0
- package/dist/cdn/chunks/chunk-HOBGJOBT.js +1 -0
- package/dist/cdn/chunks/{chunk-WQW232LA.js → chunk-HPTNANWX.js} +1 -1
- package/dist/cdn/chunks/{chunk-Y27EXTAY.js → chunk-IWZRAEUN.js} +1 -1
- package/dist/cdn/chunks/{chunk-M2F5OJOZ.js → chunk-K67DQTFL.js} +1 -1
- package/dist/cdn/chunks/{chunk-Y7VOIKUK.js → chunk-L7I27OCG.js} +1 -1
- package/dist/cdn/chunks/chunk-LHYSCL4T.js +1 -0
- package/dist/cdn/chunks/chunk-MINBJAVX.js +1 -0
- package/dist/cdn/chunks/chunk-MXMEO2IW.js +1 -0
- package/dist/cdn/chunks/chunk-PND4F7JQ.js +1 -0
- package/dist/cdn/chunks/chunk-PZVVXMQ6.js +1 -0
- package/dist/cdn/chunks/chunk-RH466MDF.js +3 -0
- package/dist/cdn/chunks/chunk-SIBJ56BG.js +1 -0
- package/dist/cdn/chunks/chunk-SLLJX5QK.js +1 -0
- package/dist/cdn/chunks/chunk-U7QPOSFH.js +1 -0
- package/dist/cdn/chunks/{chunk-SVIHEXDZ.js → chunk-X6LDVTUQ.js} +1 -1
- package/dist/cdn/chunks/chunk-YZWLMKXA.js +1 -0
- package/dist/cdn/chunks/{chunk-4ECYTYEB.js → chunk-Z6OYPC4S.js} +1 -1
- package/dist/cdn/chunks/chunk-ZJNLNYA5.js +1 -0
- package/dist/cdn/chunks/create-document-capture-Z3UK34XH-J7HHUVQU.js +1 -0
- package/dist/cdn/chunks/{create-portrait-capture-5VGYZUOK-N3333DJC.js → create-portrait-capture-5VGYZUOK-KTCFCHTN.js} +1 -1
- package/dist/cdn/chunks/{detector-scanic-YCDNLCGV-FH6NWNXC.js → detector-scanic-P2RTEQUV-A5WTP2Q7.js} +1 -1
- package/dist/cdn/chunks/document-capture-view-NI4452T4-UL6ELWE6.js +1 -0
- package/dist/cdn/chunks/eid-view-GAIQODI5-AH3LJYP4.js +1 -0
- package/dist/cdn/chunks/email-otp-view-SM2POPMA-XEEHDST5.js +1 -0
- package/dist/cdn/chunks/flow-views-NBUWHG7J-HB57IJYX.js +1 -0
- package/dist/cdn/chunks/form-view-GOFXOQJO-6K34NRBN.js +1 -0
- package/dist/cdn/chunks/overlay-de-YLCWZB42-REI3GVKV.js +1 -0
- package/dist/cdn/chunks/overlay-es-YIPBOMXT-5DHSESGX.js +1 -0
- package/dist/cdn/chunks/overlay-pt-JSDCAYVA-MQHVGOHK.js +1 -0
- package/dist/cdn/chunks/plan-runner-JSLWPJ6D-7PE72QOP.js +1 -0
- package/dist/cdn/chunks/portrait-capture-view-TTUVVA7L-ENQSXXXH.js +1 -0
- package/dist/cdn/chunks/{portrait-review-view-XUWQ5LIN-M5WOPF2E.js → portrait-review-view-BCIENGKR-SHYX5FRE.js} +1 -1
- package/dist/cdn/chunks/print-DCYX3CZD-DLQCPZZE.js +11 -0
- package/dist/cdn/chunks/proof-of-address-view-SS2TIV3D-GFY3THLT.js +1 -0
- package/dist/cdn/chunks/reader-652D2CK6.js +2 -0
- package/dist/cdn/chunks/upload-file-EGXXM6TQ-NNVVB5QQ.js +1 -0
- package/dist/cdn/define.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/{chunk-IQ7FLSNW.js → chunk-2TOYHI7F.js} +1 -1
- package/dist/{chunk-INKK6CKB.js → chunk-2ZWLZDO2.js} +1 -1
- package/dist/{chunk-IFHBX74I.js → chunk-3NYC5YLB.js} +1 -1
- package/dist/chunk-3T7JA7T7.js +1 -0
- package/dist/chunk-47ELGOCA.js +1 -0
- package/dist/{chunk-LREBBPJW.js → chunk-7FYJ4XL4.js} +1 -1
- package/dist/{chunk-LHD2PSUM.js → chunk-AUISCZAL.js} +1 -1
- package/dist/{chunk-OQUTKFRP.js → chunk-GXENE4GQ.js} +1 -1
- package/dist/{chunk-GTN3SYJJ.js → chunk-HRJ5PESP.js} +1 -1
- package/dist/chunk-IYLMNTY5.js +33 -0
- package/dist/chunk-P223YKM3.js +1 -0
- package/dist/chunk-TBECC5OK.js +1 -0
- package/dist/{chunk-6LR6LY2U.js → chunk-UJM3T4QD.js} +1 -1
- package/dist/{chunk-S6JGFCOP.js → chunk-V4USJ5ZA.js} +1 -1
- package/dist/chunk-XXCBLQ53.js +1 -0
- package/dist/chunk-YUZW7NSK.js +25 -0
- package/dist/define.cjs +6 -6
- package/dist/define.js +1 -1
- package/dist/document-capture-view-NI4452T4-VZHREVJN.js +1 -0
- package/dist/{eid-view-ERVRHLLD-NLA6CQL7.js → eid-view-GAIQODI5-KCEO3AZS.js} +1 -1
- package/dist/email-otp-view-SM2POPMA-O7WM3ZEZ.js +1 -0
- package/dist/flow-views-NBUWHG7J-PO2CMTIF.js +1 -0
- package/dist/form-view-GOFXOQJO-CRQWOLQA.js +1 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +189 -8
- package/dist/index.d.ts +189 -8
- package/dist/index.js +1 -1
- package/dist/overlay-de-YLCWZB42-XINMWIXZ.js +1 -0
- package/dist/overlay-es-YIPBOMXT-MS7EN5ZX.js +1 -0
- package/dist/overlay-pt-JSDCAYVA-27WQ3BLB.js +1 -0
- package/dist/{portrait-capture-view-TMHG2UX2-4DHDNWRH.js → portrait-capture-view-TTUVVA7L-6BGZEV6C.js} +1 -1
- package/dist/{portrait-review-view-XUWQ5LIN-7GZ3GF2B.js → portrait-review-view-BCIENGKR-WZ7GCBEX.js} +1 -1
- package/dist/proof-of-address-view-SS2TIV3D-C6YD4BRC.js +1 -0
- package/dist/styles.css +131 -20
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/cdn/chunks/capture-session-doc-O33KRXH7-X5MKSSBA.js +0 -1
- package/dist/cdn/chunks/challenge-frame-NUGPTWFP-V3GGQN65.js +0 -1
- package/dist/cdn/chunks/chunk-2FETDQV5.js +0 -1
- package/dist/cdn/chunks/chunk-3NAYOW43.js +0 -1
- package/dist/cdn/chunks/chunk-CSM63KBJ.js +0 -3
- package/dist/cdn/chunks/chunk-CW56KMMH.js +0 -1
- package/dist/cdn/chunks/chunk-EPEHFY6J.js +0 -1
- package/dist/cdn/chunks/chunk-FAQCPBKF.js +0 -1
- package/dist/cdn/chunks/chunk-GRJNZG6Y.js +0 -33
- package/dist/cdn/chunks/chunk-KVTY4E6J.js +0 -1
- package/dist/cdn/chunks/chunk-LNQJGD3J.js +0 -1
- package/dist/cdn/chunks/chunk-OTGSYUHN.js +0 -25
- package/dist/cdn/chunks/chunk-OVRHETMK.js +0 -1
- package/dist/cdn/chunks/chunk-P3OIDL7Y.js +0 -1
- package/dist/cdn/chunks/chunk-UJSGILV7.js +0 -1
- package/dist/cdn/chunks/chunk-UQ5AELS3.js +0 -1
- package/dist/cdn/chunks/chunk-YF5BWIHV.js +0 -1
- package/dist/cdn/chunks/create-document-capture-OLKNUVTU-Q3AGV6QB.js +0 -1
- package/dist/cdn/chunks/document-capture-view-GZX5JJ7N-PRYTX37D.js +0 -1
- package/dist/cdn/chunks/eid-view-ERVRHLLD-ONTAYXU7.js +0 -1
- package/dist/cdn/chunks/email-otp-view-B7UQ5CHL-GWHWAR75.js +0 -1
- package/dist/cdn/chunks/flow-views-IGQ5MYS2-3UXKITDZ.js +0 -1
- package/dist/cdn/chunks/overlay-de-5KYN4JFO-I4ESJMAS.js +0 -1
- package/dist/cdn/chunks/overlay-es-6CAERCCN-SPFAX3SD.js +0 -1
- package/dist/cdn/chunks/overlay-pt-UBGXJ3C3-MWW4QOSN.js +0 -1
- package/dist/cdn/chunks/plan-runner-VKPRZ3AD-VYRGIMQG.js +0 -1
- package/dist/cdn/chunks/portrait-capture-view-TMHG2UX2-N44IPYHU.js +0 -1
- package/dist/cdn/chunks/print-SEWS3VHQ-HWJTHADG.js +0 -11
- package/dist/cdn/chunks/upload-file-UYXOHCRG-MBYCMRP2.js +0 -1
- package/dist/chunk-4QKQAQKO.js +0 -1
- package/dist/chunk-GRQ3QAMU.js +0 -33
- package/dist/chunk-KXJRO6VZ.js +0 -1
- package/dist/chunk-SBJNQYEL.js +0 -25
- package/dist/chunk-YZ6YGLNN.js +0 -1
- package/dist/document-capture-view-GZX5JJ7N-ZW55IE6H.js +0 -1
- package/dist/email-otp-view-B7UQ5CHL-67LKMWBY.js +0 -1
- package/dist/flow-views-IGQ5MYS2-DVYTE4D2.js +0 -1
- package/dist/overlay-de-5KYN4JFO-MYA62T4Z.js +0 -1
- package/dist/overlay-es-6CAERCCN-QPH54AX7.js +0 -1
- package/dist/overlay-pt-UBGXJ3C3-VG6FOOCX.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{A as Qe,B as Xe,C as et,H as me,I as ee,J as tt,K as nt,L as rt,a as U,b as je,c as Ke,f as Be,g as Ve,h as He,i as $e,j as pe,k as ze,m as F,o as N,p as q,q as $,r as X,s as D,t as fe,v as Ze,w as We,x as Je,y as Ye}from"./chunk-PZVVXMQ6.js";import{g as at}from"./chunk-32CNXSJQ.js";import{b as Ge}from"./chunk-U7QPOSFH.js";import{b as qe,c as de,e as it}from"./chunk-6MYG4HWP.js";import{a as t}from"./chunk-4FHWXBOB.js";function Ot(n){let i=n.now??(()=>Date.now()),f=n.setTimer??((A,c)=>setTimeout(A,c)),m=n.clearTimer??(A=>clearTimeout(A)),_=null,b=!1,d=!1,M=!1,j=0,P=null,C=t(()=>{P!==null&&m(P),P=null},"_"),S=t(()=>{let A=n.armRamp;A===void 0||b||d||M||i()<j||(b=!0,A().catch(()=>{}).then(c=>{if(b=!1,!M){if(c===void 0){j=i()+2e3;return}if(c.challenge===void 0){d=!0;return}_={challenge:c.challenge,expiresAt:c.expiresAt},C(),P=f(()=>{P=null,!M&&_!==null&&n.waiting()&&S()},Math.max(1e3,c.expiresAt-i()-2e4))}}))},"R");return{arm(){_!==null&&_.expiresAt-i()>2e4||S()},take(){let A=_;return _=null,C(),A!==null&&A.expiresAt-i()>=12e3?A.challenge:void 0},stop(){M=!0,_=null,C()}}}t(Ot,"St");function Dt(n){return n.idNumberBound??n.nniBound}t(Dt,"ue");function ot(n){return n===void 0?void 0:n.idNumberFromDocument??n.nniFromDocument}t(ot,"ee");var ct="https://api.sekyro.ai",Lt=5e3,Ut=24e4,dt=3e4,pt=9e4;function st(n,i){return n==="portrait_icao"||n==="poa"||n==="doc_ocr"&&i.source==="upload"?pt:dt}t(st,"kt");var Ft=25*6e4,qt=20*6e4,Gt=3,jt=3e3,Kt=1500,Bt=10;function lt(n){return n instanceof Error&&n.name==="ChallengeError"&&n.code||"challenge_failed"}t(lt,"Ct");var ut=new Set(["aborted","embedder_opaque","site_key_rejected","clock_wrong"]);function Vt(n){return new Promise(i=>setTimeout(i,n))}t(Vt,"pn");function Ht(){let n=globalThis.crypto;if(n!==void 0&&typeof n.randomUUID=="function")return n.randomUUID();let i=new Uint8Array(16);if(n!==void 0&&typeof n.getRandomValues=="function")n.getRandomValues(i);else for(let m=0;m<16;m+=1)i[m]=Math.floor(Math.random()*256);i[6]=(i[6]??0)&15|64,i[8]=(i[8]??0)&63|128;let f=[...i].map(m=>m.toString(16).padStart(2,"0")).join("");return`${f.slice(0,8)}-${f.slice(8,12)}-${f.slice(12,16)}-${f.slice(16,20)}-${f.slice(20)}`}t(Ht,"fn");function $t(n){return zt(n,{})}t($t,"Oo");function zt(n,i){let f=n.apiOrigin??ct,m=n.autoRetry??!0,_=n.rearm??"auto",b=i.client??new Ke({apiOrigin:f,sessionToken:n.clientToken,fetch:n.fetch,locale:n.locale}),d=new Proxy(b,{get(e,r){if(r==="submitCheck")return wt;let a=Reflect.get(e,r,e);return typeof a=="function"?a.bind(e):a}}),M=i.sleep??Vt,j=i.uuid??Ht,P=i.getChallengeToken??((e,r)=>import("./challenge-frame-YBTLAQ5G-NN763UU5.js").then(a=>a.executeChallenge({frameUrl:e.url,siteKey:e.siteKey,action:"liveness",subject:r.subject,signal:r.signal}))),C=it(),S=null,A=null,c=!1,ve=new AbortController,h=null,z=null,Z=null,W=t(()=>Z??tt(h),"ne"),J=t(()=>nt(ee(h),W()),"oe"),T=t(e=>{h=e,!N(e)&&(Re(qt)||bt(e))&&ue(e),C.emit("view",e),S?.onView(e)},"I"),k=t(()=>h!==null?Promise.resolve(h):(z??(z=d.getSession().then(e=>(T(e),e)).finally(()=>{z=null})),z),"P"),x=t(async()=>{let e=await d.getSession();return T(e),e},"v"),te=t(async(e,r)=>{e.plan!==void 0?T(e):await x()},"le"),Y=null,ge=t(async e=>{let r=await k();if(e||!r.consentRecorded){let a=await d.recordConsent(n.locale);a.plan!==void 0?T(a):h!==null&&T({...h,consentRecorded:!0})}Q()&&ue(r)},"Me"),R=t(e=>e?.force===!0?ge(!0):(Y??(Y=ge(!1).finally(()=>{Y=null})),Y),"N"),ne={client:d,ensureConsent:t(e=>R(e),"ensureConsent"),sleep:M,uuid:j,...i.random!==void 0?{random:i.random}:{},onBusy:t(e=>{c||C.emit("busy",e)},"onBusy")},_e=!1,be=null,re=t(e=>{if(e.status==="verified"||e.status==="not_verified"||e.status==="review"){if(_e)return;_e=!0}be=JSON.stringify(e),C.emit("result",e)},"me"),vt=t(e=>{be!==JSON.stringify(e)&&re(e)},"Ut"),ke=t(async e=>{let r=h;e&&(r=await x().catch(()=>h));let a=r===null?null:F(r);return a!==null&&!c&&C.emit("method",a),a!==null},"Ie"),ie=null,we=!1,Ae=!1,Ce=t(()=>Qe(ne,(e,r)=>e.submitCheck("population_registry",{},{idempotencyKey:r})),"Fe"),Me=t(e=>Dt(e)===!0||ot($(e,"population_registry"))===!0,"Ne"),gt=t(async()=>{try{let e=await k();if(N(e)||F(e)!==null||q(e)?.checkType!=="population_registry")return;if(!Me(e)&&ot($(e,"population_registry"))===void 0&&(e=await x()),!Me(e)){Ae=!0;return}await R(),await te(await Ce(),"population_registry");let r=h===null?void 0:$(h,"population_registry");if(r?.state==="input_required"&&r.reason==="registry_unavailable"&&ze(r)>0){if(await M(Lt),c)return;await te(await Ce(),"population_registry")}}catch(e){if(e instanceof U&&(e.code==="check_not_active"||e.code==="step_not_on_path")){await x().catch(()=>{});return}we=!0;return}h!==null&&N(h)&&re(fe(h,{autoRetry:m}))},"Bt"),Se=t(()=>(ie??(ie=gt()),ie),"He"),I=i.now??Date.now,L=null,K,ae,_t=0,oe=t((e,r)=>`${e.url}
|
|
2
|
+
${e.siteKey}
|
|
3
|
+
${r}`,"ye"),Te=0,se,le=t((e,r)=>{Te+=1;let a=I(),u=P(e,{signal:ve.signal,subject:r}),s={key:oe(e,r),at:a,token:u};return u.then(()=>{s.issuedAt=I(),ae=void 0},p=>{let l=lt(p);if(s.failed=l,c||l==="aborted")return;ae=l;let{detail:y,readyMs:o}=p;B({check:"attestation",kind:"unavailable",engineKind:l,attempt:_t++,challengeMs:I()-a,readyMs:o,detail:y,inApp:Ge()})}),u.catch(()=>{}),s},"Se"),xe=t((e,r)=>e!==null&&e.key===r&&(e.issuedAt===void 0||I()-e.issuedAt<Ut),"De"),ue=t((e,r={})=>{let a=e?.challenge??null;if(e===null||a===null||c)return;let u=X(e.sessionId),s=L;(r.replaceFailed===!0&&s?.failed!==void 0&&!ut.has(s.failed)||!xe(s,oe(a,u)))&&(L=le(a,u))},"_e"),Ie=t(async(e,r,a)=>{let u=oe(e,r),s=L;L=null;let p=xe(s,u)?s:le(e,r),l=p===s?0:1,y,o=new Promise(v=>{y=setTimeout(()=>v("late"),a)});try{for(;;){let v=await Promise.race([p.token.then(w=>({token:w}),w=>({error:lt(w)})),o]);if(v==="late")return!c&&L===null&&(L=p),{error:ae??"timeout"};if("token"in v)return se=Math.max(0,Math.round((p.issuedAt??I())-p.at)),v;if(c||ut.has(v.error)||l>=Gt||l>0&&await Promise.race([M(jt*l),o])==="late")return v;if(c)return{error:"aborted"};l+=1,p=le(e,r)}}finally{clearTimeout(y)}},"Ue"),O=null,bt=t(e=>pe(e).some(r=>(r.checkType==="phone_otp"||r.checkType==="email_otp")&&r.state!=="passed"&&r.state!=="skipped"),"Gt"),Re=t(e=>O===null||I()-O>=e,"Be"),Q=t(()=>Re(Ft),"re"),kt=t(e=>{let r=e.attestation;return typeof r?.turnstileToken=="string"&&r.turnstileToken.length>0},"Kt"),Ee=new Map,Ne=t(async e=>{let r=await k(),a=r.challenge;if(a==null||r.simulation!==void 0)return;let u=await Ie(a,X(r.sessionId),e);if(!("token"in u))throw Ye(u.error);return u.token},"Ge"),wt=t(async(e,r,a={})=>{let u=r;if("attestation"in u)try{let o=await b.submitCheck(e,r,a);return kt(u)&&(O=I()),o}catch(o){throw o instanceof U&&o.code==="attestation_invalid"&&(O=null),o}let s=(e==="phone_otp"||e==="email_otp")&&u.action!=="verify",p=a.idempotencyKey,l=p!==void 0?Ee.get(p):void 0;l===void 0&&(s||Q())&&(l=await Ne(st(e,u)),p!==void 0&&l!==void 0&&Ee.set(p,l));let y=t((o,v)=>o!==void 0?{...v,browserCheckToken:o}:v,"b");try{let o=await b.submitCheck(e,r,y(l,a));return l!==void 0&&(O=I()),o}catch(o){if(!(o instanceof U)||o.code!=="attestation_invalid"||(O=null,l!==void 0))throw o;let v=await Ne(st(e,u)),w=p!==void 0?{...a,idempotencyKey:j()}:a,E=await b.submitCheck(e,r,y(v,w));return v!==void 0&&(O=I()),E}},"jt"),Pe=t(async(e={})=>{if(K=void 0,e.always!==!0&&!Q())return{};let r=await k(),a=r.challenge;if(a==null)return{};let u=e.always===!0?pt:dt,s=await Ie(a,X(r.sessionId),u);if("token"in s)return{channel:"hosted_web",turnstileToken:s.token};if(K=s.error,r.simulation!==void 0)return{channel:"hosted_web"};throw new Je(s.error)},"Ke"),At=t(()=>K,"Yt"),Ct=t(()=>({checks:Math.min(50,Te),...se!==void 0?{challengeMs:Math.min(6e5,se)}:{}}),"Wt"),B=t(e=>{if(c)return;let r=d.reportCaptureIssue;if(r===void 0)return;let a=e.formFactor;try{a??(a=qe())}catch{}try{Promise.resolve(r.call(d,{...e,...a!==void 0?{formFactor:a}:{}})).catch(()=>{})}catch{}},"Y"),g=null,V=null,Oe=new WeakMap,De=Promise.resolve(),H=0,Mt=t(async()=>{let e=await k();for(let r=0;r<Bt&&!c&&!N(e)&&q(e)===void 0&&pe(e).some(a=>a.state==="processing")&&(await M(Kt),!c);r+=1)e=await x();return e},"$t"),St=t(async(e,r,a)=>{let{capture:u}=e,s=t(()=>c,"m"),p=t(()=>e.alive&&e.attempt===a,"C"),l=t(o=>{p()&&u.setFlowState(o)},"h"),y=t(o=>{if(!s()&&(o.status==="unavailable"&&o.reasonCode!==void 0&&!Be(o.reasonCode)&&B({check:"liveness",kind:"unavailable",phase:"upload",engineKind:o.reasonCode,attempt:Math.max(0,e.issues.value)}),re(o),!!p())){if(o.status==="retry"&&_==="auto"){u.handle.retry();return}u.setFlowState("done")}},"b");if(r.degraded==="NO_RECORDER"){let o=h?.sessionId??(await k().catch(()=>null))?.sessionId??"";y(D(o,"no_recorder"));return}l("uploading");try{if(await Se(),s())return;let o=await k(),v;if(!N(o)&&F(o)!==null){await ke(!1),y(D(o.sessionId,"method_required"));return}if(!N(o)){if(q(o)?.checkType==="population_registry"){y(D(o.sessionId,Ae?"nni_unbound":we?"network":"registry_unavailable"));return}if(await R(),s())return;v=h??o;let w=await Xe({...ne,artifacts:r,getAttestation:Pe,attestationError:At,attestationFacts:Ct,clipKeys:{get:t(()=>Oe.get(r)??null,"get"),set:t(E=>{Oe.set(r,E)},"set")},getView:t(()=>h??o,"getView"),refreshView:x,applySubmit:te,onPhase:l,isCancelled:s,onKeyframePromoted:t(E=>{A=E},"onKeyframePromoted")});if(s())return;if(w.kind==="unavailable"){w.reason==="attestation"&&(V={bound:e,artifacts:r});let E=D(o.sessionId,w.reason),Fe=w.reason==="attestation"?K:void 0;y(Fe!==void 0?{...E,attestationError:Fe}:E);return}if(w.kind==="resync"&&await x(),h!==null&&F(h)!==null){await ke(!1),y(D(o.sessionId,"method_required"));return}o=await Mt()}y(fe(o,{autoRetry:m,previous:v}))}catch{if(s())return;y(D(h?.sessionId??"","network"))}},"Qt"),Le=t((e,r)=>{let a=e.attempt;H>0&&e.alive&&e.capture.setFlowState("uploading"),H+=1,De=De.then(()=>St(e,r,a)).finally(()=>{H-=1,H===0&&S?.onChainIdle()}).catch(()=>{})},"We"),Ue=t(e=>{g?.capture.handle.destroy(),g!==null&&(g.alive=!1,g.ramp.stop());let r=Ot({armRamp:typeof d.armRamp=="function"?()=>d.armRamp():void 0,waiting:t(()=>s.alive&&J()==="self"&&(u.handle.state==="starting"||u.handle.state==="gating"),"waiting")}),a=Promise.resolve(),u=at(e,S?.captureInternals?.(e)??i.capture,()=>h?.capture?.liveness?.keyframe?.rank===!0,J,()=>r.take()??h?.capture?.liveness?.screenRamp,{session:t(()=>ee(h),"session"),onModeChange:t(l=>{Z=l},"onModeChange")}),s={capture:u,alive:!0,ramp:r,attempt:0,issues:He()};g=s,u.handle.on("error",l=>{B(Ve("liveness",l,s.issues.value))}),u.handle.on("state",l=>{if(s.issues.note(l),l==="starting"){s.attempt+=1,V?.bound===s&&(V=null),Q()&&ue(h,{replaceFailed:!0});let y=h===null?void 0:q(h)?.checkType;a=y==="liveness"||y==="face_match"?R().catch(()=>{}):Promise.resolve()}(l==="starting"||l==="gating")&&J()==="self"&&a.then(()=>{s.alive&&r.arm()})}),u.handle.on("captured",l=>{Promise.resolve().then(()=>Le(s,l))});let p=u.handle;return{get state(){return p.state},get captureMode(){return p.captureMode},get facingMode(){return p.facingMode},on:t((l,y)=>p.on(l,y),"on"),start:t(async l=>{if(h===null&&await k().catch(()=>{}),!!s.alive)return p.start(l)},"start"),retry:t(()=>{let l=V;if(l!==null&&l.bound===s&&s.alive){V=null,Le(s,l.artifacts);return}p.retry()},"retry"),switchCamera:t(()=>p.switchCamera(),"switchCamera"),canSwitchCaptureMode:t(()=>p.canSwitchCaptureMode(),"canSwitchCaptureMode"),setCaptureMode:t(l=>p.setCaptureMode(l),"setCaptureMode"),destroy:t(()=>{s.alive=!1,r.stop(),g===s&&(g=null),p.destroy()},"destroy")}},"$e"),Tt=t(async()=>{if(c)return null;try{let e=await k();return c?null:F(e)}catch{return null}},"Zt"),xt=t(async()=>{if(c)return"self";try{let e=await k();if(c)return"self";let r=ee(e);return r==="choice"?W()??r:r}catch{return"self"}},"Jt"),It=t(async()=>{if(c)return!1;try{let e=await k();return c||N(e)||de()?!1:me(e,q(e))==="phone"||me(e,$(e,"liveness"))==="phone"}catch{return!1}},"Xt"),Rt=t(async()=>{if(c)return!1;try{let e=await k();return!c&&e.returning===!0}catch{return!1}},"zt"),Et=t(async e=>{let r=(await k()).plan?.choice,a=r?.options.find(s=>$e[s.service]===e);if(!a)throw new RangeError(`method ${String(e)} is not offered`);let u=await d.choose(r.nodeId,a.id);c||T(u)},"en"),ce=null,Nt=t(()=>(ce??(ce=import("./plan-runner-JSLWPJ6D-7PE72QOP.js").then(e=>{let r=e.createPlanRunner({runtime:ne,currentView:t(()=>h,"currentView"),cameraMode:J,captureModeSwitch:{pick:W,choose:t(a=>{Z=a},"choose")},ensureView:k,refreshView:x,ensureConsent:t(()=>R(),"ensureConsent"),liveness:Ue,stopLiveness:t(()=>{g!==null&&(g.alive=!1,g.ramp.stop(),g.capture.handle.destroy(),g=null)},"stopLiveness"),chainBusy:t(()=>H>0,"chainBusy"),destroyed:t(()=>c,"destroyed"),sleep:M,isMobile:de,now:i.now??Date.now,keptFaceKey:t(()=>A,"keptFaceKey"),setView:T,baseCapture:i.capture,emitStep:t(a=>{c||C.emit("step",a)},"emitStep"),emitResult:vt,reportCaptureIssue:B,documentInternals:i.document,documentFacts:i.documentFacts,portraitInternals:i.portrait,livePhotoInternals:i.livePhoto,uploadInternals:i.upload,pageCameraInternals:i.pageCamera});return S=r,r})),ce),"tn");return{consent:t(()=>R(),"consent"),startRegistry:Se,methodChoice:Tt,selectMethod:Et,reportCameraUnavailable:t(async e=>{await R();let r=d.reportCameraUnavailable;if(r===void 0)throw new TypeError("this client cannot report a missing camera");let a=await r.call(d,e).catch(u=>{if(u instanceof U&&u.code==="check_out_of_order")return d.getSession();throw u});c||T(a)},"reportCameraUnavailable"),reportCaptureIssue:B,testerGate:t(async e=>{let r=d.testerGate;if(r===void 0)throw new TypeError("this client cannot run the tester gate");let a=e.clip,u=je(e.clipMime??"");if(a===void 0||!We.includes(u))throw new TypeError("the capture has no clip");await R();let s=await Ze(d,"clip",u,a.size,{engine:e.engine,durationMs:e.clipMs});await d.uploadToSpaces(s.uploadUrl,a,u);let{key:p}=await d.completeMedia(s.key),l=await Pe({always:!0}),y=await r.call(d,{clipKey:p,attestation:l,captureChannel:e.captureChannel,capture:{...et(e),attestationError:K}}),{bound:o,missReason:v,...w}=y;return c||(w.plan!==void 0?T(w):await x()),o===!0||v===void 0?{bound:o===!0}:{bound:!1,missReason:v}},"testerGate"),mobileRequired:It,captureMode:xt,chooseCaptureMode:t(e=>{Z=e},"chooseCaptureMode"),get captureChoice(){return W()},returning:Rt,liveness:Ue,run:t(async()=>{if(c)throw new Error("verification destroyed");return(await Nt()).run()},"run"),currentStep:t(()=>S?.current()??null,"currentStep"),voiceClips:t(async()=>{if(c)return null;try{let e=await k();return c?null:e.voice??null}catch{return null}},"voiceClips"),on:t((e,r)=>C.on(e,r),"on"),destroy:t(()=>{c=!0,ve.abort(),S?.destroy(),g!==null&&(g.alive=!1,g.capture.handle.destroy(),g=null),C.clear()},"destroy")}}t(zt,"mn");var ft=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"],mt=["carte_identite","passport","residence_permit","drivers_license"],Zt=["carte_identite","passport","residence_permit"];function he(n,i){let f=n.byIssuer?.[i]??n.default;return mt.filter(m=>f==="*"?Zt.includes(m):f.includes(m))}t(he,"gn");function ht(n,i=ft){return[...new Set([...i,...Object.keys(n.byIssuer??{})])].filter(f=>he(n,f).length>0).sort()}t(ht,"Vo");var G={fullNameMin:2,fullName:200,email:254,occupation:120,shortText:120,longText:1e3,addressLine:120,addressLines:4,city:80,postcode:16,number:1e12,dateMin:"1900-01-01",dateMax:"2100-12-31"};var An={full_name:G.fullName,occupation:G.occupation,email:G.email,short_text:G.shortText,long_text:G.longText},yt=Object.freeze({nni_invalid:"id_number_invalid",nni_not_found:"registry_record_not_found",nni_recheck:"id_number_recheck",document_nni_mismatch:"document_id_number_mismatch",nni_locked:"id_number_locked",nni_unbound:"id_number_unbound",missing_nni:"missing_id_number",registry_needs_nni_source:"registry_needs_id_number_source"}),Cn=new Map(Object.entries(yt)),Mn=new Map(Object.entries(yt).map(([n,i])=>[i,n]));function Wt(n,i){let f=n.options.filter(d=>d.id!==n.current);if(i===void 0)return{switchTo:f,methods:[]};let m=t(d=>d.countries!==void 0&&d.countries.length>0,"i");if(i===null)return{switchTo:f.filter(d=>!m(d)),methods:[]};let _=i.toUpperCase(),b=t(d=>!m(d)||d.countries.includes(_),"u");return{switchTo:f.filter(b),methods:f.filter(d=>m(d)&&b(d))}}t(Wt,"Zo");function Jt(n,i,f){let m=n.names?.[i.toUpperCase()],_=m?.[f]??m?.en;if(_!==void 0&&_!=="")return _;let b=n.nationalEid?.providerName;return b!==void 0&&b!==""?b:void 0}t(Jt,"Jo");function Yt(n){return n===void 0?[]:[...new Set(n.options.filter(i=>i.id!==n.current).flatMap(i=>i.countries??[]).map(i=>i.toUpperCase()))]}t(Yt,"Xo");var Sn=10*1024*1024;function dr(n){if(n==="permission")return"denied";if(n==="notfound"||n==="insecure"||n==="unsupported")return"no_camera"}t(dr,"Ce");var Qt=/^[A-Z0-9][A-Z0-9 -]{0,39}$/,Xt=Object.freeze({normalize:t(n=>n.trim().toUpperCase().replace(/\s+/g," "),"normalize"),check:t(n=>Qt.test(n),"check"),registrySources:Object.freeze([]),describe:"number must be 1 to 40 letters, digits, spaces or hyphens"}),en=/^[A-Z0-9]{4,20}$/,ye=t(n=>n.trim().toUpperCase().replace(/[\s-]+/g,""),"m"),tn=Object.freeze({normalize:ye,check:t(n=>en.test(ye(n)),"check"),registrySources:Object.freeze([]),describe:"number must be 4 to 20 letters or digits"});function nn(n){return typeof n=="string"&&/^\d{10}$/.test(n)&&Number(n)%97===1}t(nn,"he");var rn={trim:t(n=>n.trim(),"trim"),upper_single_space:t(n=>n.trim().toUpperCase().replace(/\s+/g," "),"upper_single_space"),upper_no_space_or_hyphen:ye},an={mr_nni_mod97:t(n=>nn(n),"mr_nni_mod97")};function on(n){let i=new RegExp(n.pattern,"u"),f=n.check===null?void 0:an[n.check];return Object.freeze({normalize:rn[n.normalize],check:t(m=>i.test(m.trim())&&(f===void 0||f(m)),"check"),registrySources:Object.freeze([...n.registrySources]),describe:n.describe})}t(on,"ge");var sn=Object.freeze(Object.fromEntries(Object.entries(rt).map(([n,i])=>[n,on(i)])));function ln(n,i){return sn[`${n.toUpperCase()}:${i}`]??(i==="drivers_license"?tn:Xt)}t(ln,"C");var pr=Object.freeze({JPN:"JP",MRT:"MR"});function fr(n){return ln("MR","national_id").check(n)}t(fr,"Ae");function un(n){let i="";for(let f of n){let m=f.codePointAt(0)??0;m>=1632&&m<=1641?i+=String(m-1632):m>=1776&&m<=1785?i+=String(m-1776):f!==" "&&f!=="-"&&f!==" "&&(i+=f)}return i}t(un,"H");function mr(n){return un(n)}t(mr,"De");var hr=he,yr=ht;var cn=t(()=>import("./create-document-capture-Z3UK34XH-J7HHUVQU.js"),"E");function dn(){cn().then(n=>n.warmDocumentCapture()).catch(()=>{})}t(dn,"D");function vr(){dn()}t(vr,"rt");var pn=t(()=>import("./create-portrait-capture-5VGYZUOK-KTCFCHTN.js"),"O");function fn(){pn().then(n=>n.warmPortraitCapture()).catch(()=>{})}t(fn,"b");function gr(){fn()}t(gr,"dt");export{$t as a,Wt as b,Jt as c,Yt as d,dr as e,fr as f,mr as g,hr as h,yr as i,vr as j,gr as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-5QL6W6FW.js";import{a}from"./chunk-4FHWXBOB.js";function i(e,o){try{let t=new Intl.DisplayNames([o],{type:"region",fallback:"code"}).of(e);return t!==void 0&&t!==""?t:e}catch{return e}}a(i,"i");r(i,"regionName");export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-4FHWXBOB.js";var D="zoom torch focusMode focusDistance exposureMode exposureCompensation exposureTime whiteBalanceMode colorTemperature iso facingMode frameRate width height aspectRatio resizeMode deviceId groupId".split(" "),P=/^(portrait|landscape)-(primary|secondary)$/,R=1e3;function b(e,t=80){return typeof e=="string"&&e.replace(/[^A-Za-z0-9 ()\-._,]/g,"").trim().slice(0,t)||void 0}r(b,"g");var u=r(e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.round(e):void 0,"u"),M=r(e=>typeof e=="boolean"?e:void 0,"h"),g=r(e=>Math.round(e*1e4)/1e4,"b");function d(e){try{return e()}catch{return}}r(d,"c");function v(e){let t={};for(let[i,o]of Object.entries(e))o!==void 0&&(t[i]=o);return Object.keys(t).length>0?t:void 0}r(v,"m");var l;function N(e,t){l=v({renderer:b(e),vendor:b(t)})??l}r(N,"R");function L(e){return l===void 0&&(l=null,d(()=>{let t=e?.createElement("canvas").getContext("webgl");if(t){let i=t.getExtension("WEBGL_debug_renderer_info");N(t.getParameter(i?i.UNMASKED_RENDERER_WEBGL:t.RENDERER),t.getParameter(i?i.UNMASKED_VENDOR_WEBGL:t.VENDOR)),t.getExtension("WEBGL_lose_context")?.loseContext()}})),l??void 0}r(L,"T");var x=r((e,t)=>d(()=>e.matchMedia?.(t).matches),"y");function _(e){let t=e.navigator,i=e.screen?.orientation?.type,o=e.devicePixelRatio;return v({touchPoints:u(t?.maxTouchPoints),webdriver:M(t?.webdriver),uaMobile:M(t?.userAgentData?.mobile),uaPlatform:b(t?.userAgentData?.platform,32),screenW:u(e.screen?.width),screenH:u(e.screen?.height),dpr:typeof o=="number"&&o>0&&Number.isFinite(o)?g(o):void 0,coarse:x(e,"(pointer: coarse)"),noHover:x(e,"(hover: none)"),orientation:P.test(i)?i:void 0})}r(_,"P");function W(e,t){let i=d(()=>e.getCapabilities?.()),o=r(s=>{let n=s;return typeof n?.min=="number"&&typeof n.max=="number"?n.max>n.min:void 0},"i");return v({inputs:t,capabilities:i?D.filter(s=>s in i):void 0,frameRateRange:o(i?.frameRate),widthRange:o(i?.width)})}r(W,"N");async function C(e,t=globalThis){let i=new Promise(n=>{let a=r(()=>n(L(t.document)),"r");l!==void 0?a():typeof t.requestIdleCallback=="function"?t.requestIdleCallback(a,{timeout:R}):setTimeout(a,0)}),o=Promise.race([Promise.resolve().then(()=>t.navigator?.mediaDevices?.enumerateDevices?.()).then(n=>n?.filter(a=>a.kind==="videoinput").length,()=>{}),new Promise(n=>setTimeout(n,R))]),s=d(()=>_(t));return v({gpu:await i,device:s,camera:W(e,await o)})??{}}r(C,"D");function w(){let e=0,t=0,i=0;return{add(o,s,n){if(typeof o!="number"||typeof s!="number"||typeof n!="number")return;let a=Math.hypot(o,s,n);if(!Number.isFinite(a))return;e+=1;let m=a-t;t+=m/e,i+=m*(a-t)},std:r(()=>e<2?void 0:g(Math.sqrt(i/(e-1))),"std")}}r(w,"x");function T(e=globalThis){let t=e.DeviceMotionEvent,i=typeof t=="function"&&typeof t.requestPermission!="function"&&typeof e.addEventListener=="function",o=0,s,n=w(),a=w(),m=r(c=>{o+=1,typeof c.interval=="number"&&c.interval>=0&&Number.isFinite(c.interval)&&(s=g(c.interval));let f=c.accelerationIncludingGravity;f&&n.add(f.x,f.y,f.z);let p=c.rotationRate;p&&a.add(p.alpha,p.beta,p.gamma)},"l"),y=0,E=r(()=>{y+=1},"k");d(()=>{i&&e.addEventListener("devicemotion",m),e.document?.addEventListener("visibilitychange",E)});let h;return{stop(){return h!==void 0||(d(()=>{i&&e.removeEventListener?.("devicemotion",m),e.document?.removeEventListener("visibilitychange",E)}),h={motion:i?{available:i,events:o,...v({intervalMs:s,accelStd:n.std(),rotationStd:a.std()})}:{available:i},page:v({visibilityChanges:y,outerW:u(e.outerWidth),outerH:u(e.outerHeight),innerW:u(e.innerWidth),innerH:u(e.innerHeight)})}),h}}}r(T,"L");export{N as a,C as b,T as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-4FHWXBOB.js";var S="0.1.0-rc.41",k=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function O(t){let e=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));return k.test(e)}n(O,"p");var f="sekyro.did",C=1e4,w=n(()=>globalThis.process?.versions?.node,"v"),l;function y(){let t=globalThis.crypto;try{if(typeof t?.randomUUID=="function")return t.randomUUID()}catch{}try{if(typeof t?.getRandomValues=="function"){let e=t.getRandomValues(new Uint8Array(16));return Array.from(e,a=>a.toString(16).padStart(2,"0")).join("")}}catch{}}n(y,"b");function H(){try{let t=localStorage.getItem(f);if(t)return t;let e=y();return e!==void 0&&localStorage.setItem(f,e),e}catch{return l??(l=y()),l}}n(H,"I");async function M(){let t=globalThis.crypto?.subtle;if(!t)return"";let e=navigator,a=JSON.stringify([e.userAgent,e.platform,e.hardwareConcurrency??null,e.deviceMemory??null,e.maxTouchPoints??0,screen.width,screen.height,screen.colorDepth,globalThis.devicePixelRatio??1,Intl.DateTimeFormat().resolvedOptions().timeZone,e.languages?.join(",")??e.language]),i=await t.digest("SHA-256",new TextEncoder().encode(a));return Array.from(new Uint8Array(i),s=>s.toString(16).padStart(2,"0")).join("").slice(0,32)}n(M,"w");function x(){try{let t=Number(navigator.maxTouchPoints);return Number.isFinite(t)&&t>=0?{touch:Math.min(64,Math.trunc(t))}:{}}catch{return{}}}n(x,"k");function W(t){let e=new TextEncoder().encode(t),a="";for(let i of e)a+=String.fromCharCode(i);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}n(W,"x");function j(t){let e,a,i,s,c,d,m=n(()=>d?.readyState==="live","u"),T=n(()=>{c!==void 0||!globalThis.crypto?.subtle||w()||m()||(c=Promise.race([import("./print-DCYX3CZD-DLQCPZZE.js"),new Promise(r=>setTimeout(r,C))]).then(r=>r?.computePrint(m)).then(r=>{r==="busy"?c=void 0:s=r}).catch(()=>{}))},"_");return{timezone(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone?.slice(0,64)||void 0}catch{return}},noteCameraLabel(r){r&&(e=r.slice(0,128))},noteCamera(r){a=r},noteCameraTrack(r){d=r},async deviceHeader(){try{i??(i=M().catch(()=>""));let r=[];navigator.webdriver&&r.push("webdriver"),/HeadlessChrome/.test(navigator.userAgent)&&r.push("headless");let p=await i,g=H(),A={v:1,platform:"web",sdk:t.sdk.slice(0,64),caps:["session_proof"],rampAtArm:!0,ids:[...g?[{kind:"web_local",value:g.slice(0,128)}]:[],...p?[{kind:"web_fp",value:p}]:[]],screen:{w:screen.width,h:screen.height,dpr:globalThis.devicePixelRatio??1},...x(),...e?{cameraLabel:e}:{},...r.length?{signals:r}:{},...s?{print:{v:2,...s,...a?{camera:a}:{}}}:{},...O()?{inApp:!0}:{}},I=W(JSON.stringify(A));return T(),I}catch{return}},printReady(){return c??Promise.resolve()}}}n(j,"A");var v=Symbol.for("sekyro.web.clientContext"),b=globalThis,u=b[v]??(b[v]=j({sdk:`@sekyro/web@${S}`}));function z(t){try{let e=t.getVideoTracks?.()[0];if(e){if(u.noteCameraLabel(e.label),u.noteCameraTrack(e),w())return;import("./camera-trait-DELAK3YN-4I2GHAFU.js").then(a=>a.noteCameraTrait(e,u)).catch(()=>{})}}catch{}}n(z,"M");var P=Object.freeze({LOW:Object.freeze({cadenceHz:5,inputWidth:128,animations:"reduced"}),MID:Object.freeze({cadenceHz:8,inputWidth:160,animations:"full"}),HIGH:Object.freeze({cadenceHz:10,inputWidth:192,animations:"full"})}),L=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function F(){let t=typeof navigator>"u"?void 0:navigator,e=!1;try{e=typeof WebAssembly<"u"&&WebAssembly.validate(L)}catch{e=!1}return{cores:t?.hardwareConcurrency??2,memGB:t?.deviceMemory??null,simd:e}}n(F,"o");function U(t){let e=t.memGB??4;return t.cores<4||e<3?"LOW":t.cores>=8&&e>=6?"HIGH":"MID"}n(U,"l");var h=["LOW","MID","HIGH"],o,_=(o=class{constructor(e){this.samples=[],this.adjusted=!1,this.current=e}get deviceClass(){return this.current}get profile(){return P[this.current]}record(e){if(this.adjusted||this.samples.length>=10)return this.current;if(this.samples.push(e),this.samples.length<10)return this.current;this.adjusted=!0;let a=this.samples.reduce((i,s)=>i+s,0)/this.samples.length;if(a>70)this.current="LOW";else if(a<25){let i=h.indexOf(this.current);this.current=h[Math.min(h.length-1,i+1)]??this.current}return this.current}},n(o,"i"),o);export{S as a,O as b,u as c,z as d,F as e,U as f,_ as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
1
|
+
import{a as g}from"./chunk-Z6OYPC4S.js";import{L as b,a as k,b as y,c as x}from"./chunk-BMTTAXWY.js";import{a as n}from"./chunk-5QL6W6FW.js";import{a as c,c as f}from"./chunk-4FHWXBOB.js";var l=f(k(),1),t=f(k(),1),w=f(k(),1),r=f(y(),1),e=f(y(),1);var i,C=(i=class extends w.Component{constructor(){super(...arguments),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}},c(i,"c"),i);n(C,"LoadBoundary");var j=C,F={load:n(()=>import("./flow-views-NBUWHG7J-HB57IJYX.js"),"load")};function S({view:s,i18n:a,quiet:o,...m}){let[d,h]=(0,t.useState)(0),u=(0,t.useMemo)(()=>(0,t.lazy)(()=>F.load().then(v=>({default:v[s]}))),[s,d]),p=(0,r.jsxs)(b,{tone:"danger",children:[(0,r.jsx)("span",{children:a.t("errors.network_error")}),(0,r.jsx)(x,{kind:"secondary",onClick:c(()=>h(v=>v+1),"onClick"),children:a.t("common.retry")})]});return(0,r.jsx)(j,{fallback:p,children:(0,r.jsx)(t.Suspense,{fallback:o===!0?null:(0,r.jsx)("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:a.t("common.loading")}),children:(0,r.jsx)(u,{...m,i18n:a})})},d)}c(S,"k");n(S,"Flow");var q=(0,l.createContext)(void 0);function B({i18n:s,lead:a,refresh:o,actions:m}){let d=(0,l.useContext)(q),[h,u]=(0,l.useState)(!1);if(d!==void 0)return(0,e.jsx)(S,{view:"HandoffView",i18n:s,url:d,lead:a,...o!==void 0?{refresh:o}:{},footer:m});let p=n(()=>{o!==void 0&&(u(!0),o().catch(()=>{}).finally(()=>u(!1)))},"again");return(0,e.jsx)(g,{tone:"brand",icon:"smartphone",title:s.t("handoff.title"),testId:"sekyro-phone-handoff",actions:(0,e.jsxs)(e.Fragment,{children:[m,o!==void 0?(0,e.jsx)(x,{kind:"secondary",full:!0,disabled:h,onClick:p,children:s.t("common.refresh")}):null]}),children:(0,e.jsx)("p",{children:a})})}c(B,"K");n(B,"PhoneHandoff");export{j as a,S as b,q as c,B as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-4FHWXBOB.js";function e(n){return Array.from(new Uint8Array(n),t=>t.toString(16).padStart(2,"0")).join("")}r(e,"e");async function o(n){return e(await crypto.subtle.digest("SHA-256",n))}r(o,"o");export{o as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b,t as r,v as l,y as o}from"./chunk-
|
|
1
|
+
import{b,t as r,v as l,y as o}from"./chunk-BMTTAXWY.js";import{a as i}from"./chunk-5QL6W6FW.js";import{a,c as p}from"./chunk-4FHWXBOB.js";var s=p(b(),1);function f({tone:d,icon:n,busy:c,title:m,titleId:e,children:u,actions:t,live:y,testId:h}){let k=r();return(0,s.jsxs)("section",{className:"sekyro-step sekyro-status",...e!==void 0?{"aria-labelledby":e}:{},...y?{role:"status","aria-live":"polite"}:{},"data-testid":h,children:[(0,s.jsxs)("div",{className:"sekyro-status__body",children:[(0,s.jsx)("span",{className:`sekyro-tile sekyro-tile--${d}${c?" is-busy":""}`,"aria-hidden":"true",children:(0,s.jsx)(l,{name:n})}),(0,s.jsxs)("div",{className:"sekyro-heading sekyro-status__text",children:[(0,s.jsx)("h2",{id:e,ref:k,tabIndex:-1,className:"sekyro-text-body",children:m}),u]})]}),t!=null&&t!==!1?(0,s.jsx)(o,{children:t}):null]})}a(f,"g");i(f,"StatusPage");export{f as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Nr}from"./chunk-BWOTZKA7.js";import{c as _t}from"./chunk-MXMEO2IW.js";import{b as kr,d as br}from"./chunk-BO327WCQ.js";import{b as xr,c as Ct}from"./chunk-CYEDFGUG.js";import{a as yr,b as gr,c as vr,d as Me}from"./chunk-FQHV53QQ.js";import{G as _r,L as wr,M as Sr,a as K,b as de,c as te,m as pr,n as Je,p as hr,q as et,r as fr,s as mr,t as bt,u as le,v as Ee,w as tt,y as Cr}from"./chunk-BMTTAXWY.js";import{c as ir,d as cr,e as ur,h as dr}from"./chunk-32CNXSJQ.js";import{b as kt}from"./chunk-U7QPOSFH.js";import{a as s}from"./chunk-5QL6W6FW.js";import{g as lr}from"./chunk-6MYG4HWP.js";import{a as o,c as U}from"./chunk-4FHWXBOB.js";var Ar=U(K(),1),y=U(de(),1),re=U(de(),1),ye=U(K(),1),$=U(de(),1),C=U(K(),1),m=U(K(),1),at=U(K(),1),fe=U(de(),1),Qr=U(K(),1),X=U(K(),1),lt=U(K(),1),we=U(de(),1),Se=U(de(),1),P=U(de(),1);var it=U(K(),1),pe=U(K(),1);var Q=U(K(),1);var E=U(K(),1),me=U(K(),1),Te=U(K(),1),At=U(de(),1),v=U(de(),1);function ce({className:e,children:t}){return(0,y.jsx)("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})}o(ce,"ne");s(ce,"Svg");var Mt="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 Mr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,y.jsx)("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"})]})}o(Mr,"ln");s(Mr,"SunIcon");function Er(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,y.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}o(Er,"un");s(Er,"FaceUncoveredIcon");function Lr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,y.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,y.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}o(Lr,"dn");s(Lr,"PhoneEyeLevelIcon");function Ir(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("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"}),(0,y.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}o(Ir,"pn");s(Ir,"LookStraightIcon");function Ur(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M9 13l2 2 4-4"})]})}o(Ur,"fn");s(Ur,"CameraCheckIcon");function jr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("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"})]})}o(jr,"mn");s(jr,"CameraAskIcon");function Tr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M3 3l18 18"})]})}o(Tr,"yn");s(Tr,"CameraBlockedIcon");function nt({off:e,className:t}){return(0,y.jsxs)(ce,{className:t,children:[(0,y.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,y.jsx)("path",{d:"M4 4l16 16"}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,y.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}o(nt,"Ve");s(nt,"SpeakerIcon");function Or(e){return(0,y.jsx)(ce,{...e,children:(0,y.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}o(Or,"gn");s(Or,"CheckIcon");function Pr(e){return(0,y.jsxs)(ce,{className:e.className??"sekyro-spinner",children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,y.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}o(Pr,"hn");s(Pr,"SpinnerIcon");var wt=["light","uncover","eyeLevel","straight"],In={light:{key:"capture.tips.light",icon:s(()=>(0,re.jsx)(Mr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:s(()=>(0,re.jsx)(Er,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:s(()=>(0,re.jsx)(Lr,{}),"icon")},straight:{key:"capture.tips.straight",icon:s(()=>(0,re.jsx)(Ir,{}),"icon")}};function Br({tips:e}){let t=Me(),n=(0,Ar.useId)();return e.length===0?null:(0,re.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,re.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,re.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let a=typeof r=="string"?In[r]:void 0,l=typeof r=="string"?r:r.id,c=a!==void 0?a.icon():typeof r=="string"?void 0:r.icon,d=a!==void 0?t(a.key):typeof r=="string"?r:r.text;return(0,re.jsxs)("li",{className:"sekyro-tips__item",children:[c!=null?(0,re.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:c}):null,(0,re.jsx)("span",{children:d})]},l)})})]})}o(Br,"Cn");s(Br,"TipList");var Un=220;function qr({title:e,description:t,options:n,busy:r,error:a,focus:l,testId:c,look:d="cards",marked:S,onChoose:p}){let w=(0,ye.useId)(),N=bt(),[j,R]=(0,ye.useState)(null),B=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{a!==null&&R(null)},[a]),(0,ye.useEffect)(()=>()=>{B.current!==null&&clearTimeout(B.current)},[]);let q=s(A=>{r||j!==null||(R(A),B.current=setTimeout(()=>{B.current=null,R(null),p(A)},Un))},"choose");return(0,$.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":c,children:[(0,$.jsxs)("div",{className:d==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,$.jsx)("h2",{id:w,ref:l?N:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,$.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),a!==null?(0,$.jsx)(le,{tone:"danger",children:(0,$.jsx)("span",{children:a})}):null,d==="buttons"?(0,$.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((A,J)=>(0,$.jsx)(te,{kind:J===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:o(()=>p(A.id),"onClick"),children:A.label},A.id))}):(0,$.jsx)("div",{className:"sekyro-choices",children:n.map(A=>(0,$.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(j??S)===A.id,"aria-busy":r||void 0,disabled:r||j!==null&&j!==A.id,onClick:o(()=>q(A.id),"onClick"),children:[A.glyph!==void 0?(0,$.jsx)("span",{className:"sekyro-card__tile",children:A.glyph}):null,(0,$.jsxs)("span",{className:"sekyro-card__body",children:[(0,$.jsx)("span",{className:"sekyro-card__title",children:A.label}),A.sub!==void 0?(0,$.jsx)("span",{className:"sekyro-card__sub",children:A.sub}):null]}),(0,$.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},A.id))})]})}o(qr,"bn");s(qr,"ChoiceScreen");var Vr=["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","capture.lookAtColours"];function st(e){return e!==null&&Vr.includes(e)}o(st,"he");s(st,"isVoiceKey");var jn=s((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let a=e[n];r=a!=null&&jn(a,t)?a[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}o(je,"Me");s(je,"resolveClip");var Tn="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",On={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ie(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}o(ie,"re");s(ie,"synth");function Dr(){return ie()!==null&&typeof SpeechSynthesisUtterance=="function"}o(Dr,"Lr");s(Dr,"speechAvailable");function St(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}o(St,"Sn");s(St,"baseLang");function Et(e,t){let n=s(a=>a.replace(/_/g,"-").toLowerCase(),"norm"),r=St(t);return e.find(a=>n(a.lang)===n(t))??e.find(a=>St(a.lang)===r)}o(Et,"Mn");s(Et,"pickVoice");function Hr(e){if(!Dr())return!1;let t=[];try{t=ie()?.getVoices()??[]}catch{return!0}return t.length===0||Et(t,e)!==void 0}o(Hr,"wn");s(Hr,"speechUsable");function $r(e){let t=ie();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}o($r,"Ln");s($r,"subscribeVoices");function De(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}o(De,"Ke");s(De,"clipIdentity");function xt(e){e.pause(),e.removeAttribute("src"),e.load()}o(xt,"Rn");s(xt,"release");function Fr(){let e=null,t=null,n=0,r=null,a=null,l=null,c=!1,d=null,S=[],p=new Map,w=s(()=>{S=ie()?.getVoices()??[]},"loadVoices"),N=!1,j=s(()=>{let h=ie();N||h===null||(N=!0,w(),h.addEventListener?.("voiceschanged",w))},"bindVoices"),R=s(()=>(e??(e=new Audio),e),"element"),B=s((h,x,_,k)=>{let u=ie();if(u!==null&&h!==""&&typeof SpeechSynthesisUtterance=="function"){j();let M=Et(S,x);if(S.length===0||M!==void 0){u.cancel();let I=new SpeechSynthesisUtterance(h);I.lang=x,M!==void 0&&(I.voice=M),I.rate=.95,_!==void 0&&(I.onend=_),(_!==void 0||k!==void 0)&&(I.onerror=D=>{k!==void 0&&D.error==="not-allowed"?k():_?.()}),u.speak(I);return}}_?.()},"speak"),q=s(()=>{n+=1,r=null,a=l=null,e!==null&&(e.pause(),e.currentTime=0),ie()?.cancel()},"stop"),A=s(h=>{for(let x of h){let _=De(x);if(p.has(_))continue;let k=new Audio;k.preload="auto",k.src=x,p.set(_,k)}},"warmClips"),J=s((h,x,_)=>{let k={utterance:h,generation:x,end:_};d=k;let u=s(()=>x===n&&d===k,"live"),M=s(()=>{u()&&(a=k)},"block");if(ie()?.cancel(),h.url!==null){let I=R();I.pause(),I.muted=!1,I.src=h.url,I.currentTime=0,I.onended=_??null;let D=s(()=>{l===k&&(l=null)},"settled"),i=I.play();if(i===void 0)return;l=k,i.then(D,T=>{if(D(),!u())return;let O=T?.name;if(O!=="AbortError"){if(O==="NotAllowedError")return M();h.speech?B(h.text,h.lang,_,M):_?.()}});return}h.speech?B(h.text,h.lang,_,M):_?.()},"start");return{say(h){let x=h.url!==null?De(h.url):`tts:${h.lang}:${h.text}`;if(x===r)return;r=x,a=l=null,n+=1;let _=n,k=h.onEnd;J(h,_,k!==void 0?()=>{_===n&&k()}:void 0)},unlock({lang:h,speech:x,prefetch:_}){let k=a??(c?null:l);c=!0;let u=k!==null&&k.generation===n?k:null;a=l=null,u!==null&&J(u.utterance,u.generation,u.end);let M=R();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let T=Uint8Array.from(atob(Tn),O=>O.charCodeAt(0));t=URL.createObjectURL(new Blob([T],{type:"audio/wav"}))}let I=M.paused===!1&&t!==null&&M.src!==t;t!==null&&!I&&(u===null||u.utterance.url===null)&&(M.muted=!0,M.onended=null,M.src=t,M.play()?.catch(()=>{}));let D=ie(),i=u!==null&&u.utterance.url===null;if(x&&!i&&D!==null&&typeof SpeechSynthesisUtterance=="function"){j();let T=new SpeechSynthesisUtterance(" ");T.volume=0,T.lang=h,D.speak(T)}A(_??[])},prefetch:A,stop:q,dispose(){q(),N&&ie()?.removeEventListener?.("voiceschanged",w),N=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&xt(e),e=null;for(let h of p.values())xt(h);p.clear()}}}o(Fr,"_n");s(Fr,"createVoicePlayer");var Pn="sekyro.voiceGuidance";function Gr(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}}o(Gr,"xn");s(Gr,"readVoicePreference");function Kr(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}o(Kr,"En");s(Kr,"writeVoicePreference");var Ve="capture.tips.summary",Bn=typeof window<"u"?C.useLayoutEffect:C.useEffect,qn=Object.freeze({});function rt(e,t){let n=new Set,r=[];for(let a of Vr){let l=a===Ve?null:je(e,a,t);l===null||n.has(De(l))||(n.add(De(l)),r.push(l))}return r}o(rt,"ht");s(rt,"resolvedClipUrls");function Zr({locale:e,defaultClips:t,options:n}){let r=n===!1,a=r?{}:n??{},l=a.storageKey===void 0?Pn:a.storageKey,[c,d]=(0,C.useState)(a.defaultEnabled??!0),S=(0,C.useRef)(c),[p,w]=(0,C.useState)(!1),[N,j]=(0,C.useState)("none"),[R,B]=(0,C.useState)(!1),q=(0,C.useRef)(!1),[A,J]=(0,C.useState)(0),h=(0,C.useRef)(null),x=(0,C.useCallback)(()=>(h.current??(h.current=Fr()),h.current),[]),_=On[e],k=a.speechFallback,u=k===void 0||k===!0?!0:k===!1?!1:k.includes(e),M=a.clips??t??qn,I=(0,C.useRef)(!1),D=(0,C.useRef)(M);Bn(()=>{D.current=M,S.current=c}),(0,C.useEffect)(()=>{if(r||l===null)return;let L=Gr(l);L!==null&&(S.current=L,d(L))},[r,l]),(0,C.useEffect)(()=>{if(!(r||!u))return $r(()=>J(L=>L+1))},[r,u]);let i=a.clips;(0,C.useEffect)(()=>{if(r)return;let L=u&&Hr(_);w(rt(M,e).length>0||L),j(i!==void 0&&je(i,Ve,e)!==null?"partner":je(M,Ve,e)!==null||L?"default":"none")},[r,M,i,e,u,_,A]),(0,C.useEffect)(()=>{if(r||!c||!I.current)return;let L=rt(M,e);L.length>0&&x().prefetch(L)},[r,c,M,e,x]),(0,C.useEffect)(()=>()=>{h.current?.dispose(),h.current=null,I.current=!1},[]);let T=(0,C.useCallback)(L=>{r||(I.current=!0,x().unlock({lang:_,speech:u,...L?{prefetch:rt(D.current,e)}:{}}))},[r,x,_,u,e]),O=(0,C.useCallback)(()=>T(S.current),[T]),z=(0,C.useCallback)(()=>{q.current=!1,B(!1)},[]),H=(0,C.useCallback)(()=>{z(),h.current?.stop()},[z]),ge=(0,C.useCallback)(()=>{q.current&&H()},[H]),he=(0,C.useCallback)((L,xe)=>{if(r)return;if(q.current){H();return}let ve=x();ve.stop(),q.current=!0,B(!0);let V=xe?.clip===!1?null:je(D.current,Ve,e);ve.say({url:V,text:L,lang:_,speech:u,onEnd:z})},[r,H,x,e,_,u,z]),Y=(0,C.useCallback)(L=>{r||(L?T(!0):H(),l!==null&&Kr(l,L),S.current=L,d(L))},[r,T,H,l]),W=(0,C.useCallback)(()=>Y(!S.current),[Y]),ne=(0,C.useCallback)((L,xe)=>{if(r||!c)return;q.current&&z();let ve=je(D.current,L,e);x().say({url:ve,text:xe,lang:_,speech:u})},[r,c,e,x,_,u,z]);return(0,C.useMemo)(()=>({supported:!r&&p,enabled:!r&&c,setEnabled:Y,toggle:W,unlock:O,speakKey:ne,stop:H,summary:r?"none":N,summaryPlaying:R,toggleSummary:he,stopSummary:ge}),[r,p,c,Y,W,O,ne,H,N,R,he,ge])}o(Zr,"vt");s(Zr,"useVoiceGuidance");function zr(e,t,n,r){let{speakKey:a,stop:l,enabled:c}=e,d=(0,C.useRef)(!1);(0,C.useEffect)(()=>{if(!r||!c){d.current&&l(),d.current=!1;return}d.current=!0,st(t)&&t!==Ve&&n!==""&&a(t,n)},[r,c,t,n,a,l])}o(zr,"Ct");s(zr,"useSpeakGuidance");function ot(e,t){let n=Yr(e);return n==="face"&&(t==="lighting"||e==="liveness_inconclusive")?"again":n}o(ot,"Pn");s(ot,"retryCoachingOf");function Yr(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"}}o(Yr,"Pr");s(Yr,"coachingOfReason");var He={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},again:{title:"capture.retryTips.title",tips:["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 Wr({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:a}){let l=Me(),c=(0,at.useRef)(null);return(0,at.useEffect)(()=>{r&&c.current?.focus()},[r]),!e&&!r?null:(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,fe.jsx)("p",{className:"sekyro-text-body",children:l(He[t].title)}),(0,fe.jsx)("ul",{className:"sekyro-coaching",children:He[t].tips.map(d=>(0,fe.jsx)("li",{children:l(d)},d))}),n!==null?(0,fe.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,fe.jsx)(te,{ref:c,className:"sekyro-btn--start",onClick:a,children:l("capture.recordAgain")}):null]})}o(Wr,"Tn");s(Wr,"CapturedPanel");function Lt(){try{return!1}catch{return!1}}o(Lt,"nt");s(Lt,"isDevBuild");var Vn=(0,Qr.createContext)(null);function Xr({state:e}){let t=Me(),[n,r]=(0,lt.useState)(!1);(0,lt.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let a=e==="granted"?(0,we.jsx)(Ur,{}):e==="denied"?(0,we.jsx)(Tr,{}):(0,we.jsx)(jr,{});return(0,we.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,we.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:a}),(0,we.jsx)("span",{children:t(`capture.permission.${e}`)})]})}o(Xr,"On");s(Xr,"PermissionRow");function Jr({voice:e}){let t=Me();if(!e.supported)return null;let n=e.enabled;return(0,Se.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:o(()=>e.toggle(),"onClick"),children:[(0,Se.jsxs)("span",{className:"sekyro-switch__label",children:[(0,Se.jsx)(nt,{off:!n}),t("capture.voiceGuidance")]}),(0,Se.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,Se.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,Se.jsx)(Or,{className:"sekyro-switch__check"}):null})})]})}o(Jr,"Hn");s(Jr,"VoiceSwitch");function en({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:a,tips:l,summary:c,startLabel:d,startDisabled:S,onStart:p}){let w=Me(),N=(0,X.useRef)(c?.stop);N.current=c?.stop,(0,X.useEffect)(()=>()=>N.current?.(),[]);let j=(0,X.useRef)(null),R=(0,X.useRef)(null),B=(0,X.useRef)(null),q=(0,X.useRef)(e),A=(0,X.useRef)(!1);(0,X.useEffect)(()=>{let u=q.current;if(q.current=e,u===e)return;let M=A.current;e!=="loading"&&(A.current=!1),tn(j.current)&&(e==="failed"?B.current?.focus():M&&R.current?.focus())},[e]);let J=(0,X.useCallback)(()=>{A.current=!0,t()},[t]),h=e==="loading",x=h||S,_=(0,X.useCallback)(()=>{x||(N.current?.(),p())},[x,p]),k;return e==="failed"?k=(0,P.jsxs)(le,{tone:"danger",testId:"sekyro-assets-error",children:[(0,P.jsx)("p",{className:"sekyro-text-body",children:w("fcv2.err.models")}),(0,P.jsx)(te,{kind:"ghost",ref:B,className:"sekyro-btn--start",onClick:J,"data-testid":"sekyro-assets-retry",children:w("common.retry")})]}):k=(0,P.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,P.jsx)(te,{ref:R,full:!0,"data-testid":"sekyro-start","aria-disabled":x?"true":void 0,"aria-busy":h?"true":void 0,onClick:_,children:h?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Pr,{}),w("capture.preparing.title")]}):d??w("capture.start")}),h?(0,P.jsx)("p",{className:"sekyro-text-muted",children:w("capture.preparing.hint")}):null]}),(0,P.jsxs)("div",{ref:j,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,P.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,P.jsx)("h2",{className:"sekyro-text-body",children:w("capture.assisted.title")}),(0,P.jsx)("p",{className:"sekyro-text-muted",children:w("capture.assisted.lead")})]}):null,l!==!1?(0,P.jsx)(Br,{tips:l}):null,c!==void 0?(0,P.jsxs)(te,{kind:"ghost",className:"sekyro-btn--start",onClick:c.toggle,"data-testid":"sekyro-tips-listen",children:[(0,P.jsx)(nt,{off:!1}),w(c.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,P.jsx)(Xr,{state:n}),(0,P.jsx)(Jr,{voice:a}),(0,P.jsx)("p",{className:"sekyro-text-muted",children:w("capture.securityNote")}),k,(0,P.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?w("capture.preparing.title"):e==="ready"?w("capture.ready"):""})]})}o(en,"Fn");s(en,"PreCaptureScreen");function tn(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}o(tn,"Hr");s(tn,"focusIsOurs");function rn(){let[e,t]=(0,it.useState)({state:"unknown",settled:!1});return(0,it.useEffect)(()=>lr(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}o(rn,"Dn");s(rn,"useCameraStatus");function nn(e){return It(e,"mobileRequired")}o(nn,"qn");s(nn,"useMobileRequired");function sn(e){return It(e,"returning").required}o(sn,"jn");s(sn,"useReturning");function It(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let a=e?.[t];if(e===void 0||typeof a!="function"){r({required:!1,settled:!0});return}let l=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(c=>{l&&r({required:c===!0,settled:!0})},()=>{l&&r({required:!1,settled:!0})}),()=>{l=!1}},[e,t]),n}o(It,"Yn");s(It,"useFlag");function an(e){let t=s(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let l=e?.captureMode,c=e?.captureChoice??null;if(e===void 0||typeof l!="function"){r({session:"self",choice:c,settled:!0});return}let d=!0;return r({session:"self",choice:c,settled:!1}),Promise.resolve().then(()=>l.call(e)).then(S=>{let p=e.captureChoice??null;d&&r({session:p!==null&&S===p?"choice":S==="assisted"||S==="choice"?S:"self",choice:p,settled:!0})},()=>{d&&r({session:"self",choice:null,settled:!0})}),()=>{d=!1}},[e]);let a=(0,pe.useCallback)(l=>{e?.chooseCaptureMode?.(l),r(c=>({...c,choice:l}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:a}}o(an,"$n");s(an,"useCaptureMode");function on(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),a=e.on("result",()=>n(!1));return()=>{r(),a()}},[e]),t}o(on,"zn");s(on,"useBusy");var Dn=s(()=>"idle","serverSnapshot");function Nt(e){return ir(e!==void 0?{assetBaseUrl:e}:{})}o(Nt,"Qn");s(Nt,"preload");function ln(e,t=!0){let n=(0,Q.useSyncExternalStore)((0,Q.useCallback)(p=>ur(p,e),[e]),()=>cr(e),Dn),[r,a]=(0,Q.useState)(null),l=(0,Q.useRef)(!1),c=(0,Q.useCallback)(()=>{Nt(e).then(p=>{l.current&&p==="idle"&&a({base:e})})},[e]);(0,Q.useEffect)(()=>(l.current=!0,c(),()=>{l.current=!1}),[c]);let d=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{if(n!=="idle"){d.current={base:e};return}!t||d.current===null||d.current.base!==e||(d.current=null,c())},[n,e,c,t]);let S=(0,Q.useCallback)(()=>{Nt(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:S}}o(ln,"Jn");s(ln,"useLivenessAssets");var Rr={progress:0,hint:null,faceDetected:!1};function cn(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,E.useRef)(e.verification).current,a=(0,E.useRef)(!1);e.verification!==r&&!a.current&&Lt()&&(a.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 l=(0,E.useRef)(null),[c,d]=(0,E.useState)("idle"),[S,p]=(0,E.useState)(Rr),[w,N]=(0,E.useState)(!1),[j,R]=(0,E.useState)(!1),[B,q]=(0,E.useState)(null),[A,J]=(0,E.useState)(!1),[h,x]=(0,E.useState)(null),[_,k]=(0,E.useState)(null),[u,M]=(0,E.useState)(null),[I,D]=(0,E.useState)(null),[i,T]=(0,E.useState)(null),[O,z]=(0,E.useState)(!1),H=(0,E.useRef)(null),ge=(0,E.useRef)("idle"),he=(0,E.useRef)(-1),[Y,W]=(0,E.useState)(0),ne=(0,E.useRef)(e);ne.current=e,(0,E.useEffect)(()=>{let ee=t.current;if(ee===null)return;let ue={video:ee,...n!==void 0?{assetBaseUrl:n}:{}},F=r!==void 0?r.liveness(ue):dr(ue);l.current=F;let Ne=s(()=>T(F.facingMode??null),"readFacing");Ne();let $e=[F.on("state",b=>{b==="mode_switch"?z(!0):b!=="starting"&&b!=="gating"&&z(!1),b==="starting"?(ge.current!=="starting"&&(he.current+=1,W(Math.max(0,he.current))),k(null),M(null),p(Rr),R(!1),N(!1),q(null),x(null),H.current=null):b==="gating"&&ge.current==="recording"&&(R(!1),N(!1),q(null),H.current=null),ge.current=b,Ne(),d(b),ne.current.onStateChange?.(b)}),F.on("gate",b=>{let ke=H.current;H.current=b.progress,N(ke!==null&&b.progress<ke-.001&&b.progress>0&&b.progress<1),b.progress>=1&&R(!0),p(b)}),F.on("frozen",({previewDataUrl:b})=>q(b)),F.on("profile",({animations:b})=>J(b==="reduced")),F.on("ramp",({colour:b})=>x(b)),F.on("captured",b=>{k(b),D(null),ne.current.onCaptured?.(b)}),F.on("error",b=>{M(b);let ke=r?.reportCaptureIssue;ke!==void 0&&Ct(Le=>ke.call(r,Le),xr("liveness",b,Math.max(0,he.current))),ne.current.onError?.(b)}),r?.on("result",b=>{D(b),ne.current.onResult?.(b)})];return()=>{for(let b of $e)b?.();l.current=null,F.destroy()}},[r,t,n]);let L=(0,E.useCallback)(()=>{l.current?.start()},[]),xe=(0,E.useCallback)(()=>{l.current?.retry()},[]),ve=(0,E.useCallback)(async()=>{let ee=l.current;return ee===null||typeof ee.canSwitchCaptureMode!="function"?!1:await ee.canSwitchCaptureMode().catch(()=>!1)===!0},[]),V=(0,E.useCallback)(async ee=>{let ue=l.current;if(ue===null||typeof ue.setCaptureMode!="function")return!1;let F=await ue.setCaptureMode(ee).catch(()=>!1)===!0;return F&&T(ue.facingMode??null),F},[]);return{state:c,gate:S,draining:w,gateLocked:j,frozenPreview:B,reduceMotion:A,rampColour:h,artifacts:_,error:u,result:I,facingMode:i,start:L,retry:xe,canSwitchCaptureMode:ve,setCaptureMode:V,modeRestarted:O,attempt:Y}}o(cn,"er");s(cn,"useLivenessHandle");var Hn=new Set(["national_number"]);function Rt(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>Hn.has(n));return t.length>0?{...e,options:t}:null}o(Rt,"tr");s(Rt,"pending");function un(e){let[t,n]=(0,me.useState)(null),[r,a]=(0,me.useState)(e===void 0),[l,c]=(0,me.useState)(!1),[d,S]=(0,me.useState)(!1);(0,me.useEffect)(()=>{if(n(null),e===void 0){a(!0);return}let N=!0,j=e.methodChoice;typeof j=="function"?(a(!1),Promise.resolve().then(()=>j.call(e)).then(B=>{N&&n(Rt(B))},()=>{}).finally(()=>{N&&a(!0)})):a(!0);let R=e.on("method",B=>n(Rt(B)));return()=>{N=!1,R()}},[e]);let p=(0,me.useCallback)(async N=>{if(e===void 0)return!1;c(!0),S(!1);try{return await e.selectMethod(N),n(null),!0}catch{return S(!0),!1}finally{c(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!d?w:null,settled:r,busy:l,failed:d,select:p}}o(un,"nr");s(un,"useMethodChoice");var $n=["ar","fr","en"];function dn(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}}o(dn,"io");s(dn,"isClipUrl");function pn(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of $n){let a=t[r];if(!(typeof a!="object"||a===null))for(let[l,c]of Object.entries(a))!st(l)||!dn(c)||((n[r]??(n[r]={}))[l]=c)}return Object.keys(n).length>0?n:null}o(pn,"ao");s(pn,"toVoiceClipMap");function hn(e){let[t,n]=(0,Te.useState)(null);(0,Te.useEffect)(()=>{if(n(null),e===void 0)return;let a=!0,l=s(d=>{if(!a)return;let S=typeof d=="object"&&d!==null&&typeof d.setId=="string"?d:null;n(p=>p?.setId===S?.setId?p:S)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(l,()=>l(null))}catch{l(null)}let c=e.on("view",d=>l(d.voice));return()=>{a=!1,c()}},[e]);let r=(0,Te.useMemo)(()=>t!==null?pn(t):null,[t]);return e===void 0?null:r}o(hn,"rr");s(hn,"useServerVoiceClips");function fn({voice:e}){let t=Me();return(0,At.jsx)(te,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:o(()=>e.toggle(),"onClick"),children:(0,At.jsx)(nt,{off:!e.enabled,className:"sekyro-icon"})})}o(fn,"sr");s(fn,"VoiceChip");var Fn=new Set(["abandoned","not_opened","cancelled","superseded"]),Gn=800,Kn="capture.lookAtColours";function mn(e){return e===void 0||e!==!1&&e.length===wt.length&&wt.every(t=>e.includes(t))}o(mn,"mo");s(mn,"isDefaultTips");function yn(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}o(yn,"yo");s(yn,"carriesActivation");function gn(e){return typeof e=="object"&&e!==null&&!(0,m.isValidElement)(e)&&"tone"in e&&"text"in e}o(gn,"go");s(gn,"isNoticeObject");var Zn=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function vn(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}o(vn,"vo");s(vn,"isCapturing");function kn(e){return e==="captured"||e==="uploading"||e==="checking"}o(kn,"Co");s(kn,"isPostCapture");function zn({verification:e,locale:t,dir:n,strings:r,slots:a,autoStart:l=!1,notice:c,startDisabled:d=!1,startLabel:S,tips:p,tipsSummary:w,coach:N,voice:j,onGuidance:R,onCaptured:B,onResult:q,onError:A,onStateChange:J,assetBaseUrl:h,className:x}){let _=gr(t),k=(0,m.useMemo)(()=>yr(t,r),[t,r,_]),u=(0,m.useMemo)(()=>g=>k[g]??"",[k]),M=n??(t==="ar"?"rtl":"ltr"),I=(0,m.useRef)(null),D=(0,m.useContext)(Vn),i=cn({verification:e,videoRef:I,assetBaseUrl:h,onCaptured:B,onResult:q,onError:A,onStateChange:J}),T=ln(h,i.state==="idle"&&i.error===null),O=un(e),z=O.choice!==null,H=nn(e),ge=sn(e),he=on(e),Y=rn(),W=an(e),ne=W.session==="choice",L=W.mode==="assisted",xe=j!==!1&&j?.clips===void 0,ve=hn(xe?e:void 0),V=Zr({locale:t,defaultClips:ve,options:j}),ee=L?"environment":"user",ue=W.settled,F=(0,m.useRef)(null),Ne=(0,m.useRef)(!1),$e=(0,m.useRef)(V.unlock);$e.current=V.unlock,(0,m.useEffect)(()=>{let g=F.current;if(g===null)return;let oe=["pointerup","touchend","click","keydown"],_e=s(()=>{for(let qe of oe)g.removeEventListener(qe,Ae,!0)},"disarm");function Ae(qe){if(Ne.current){_e();return}yn(qe)&&(Ne.current=!0,_e(),$e.current())}o(Ae,"Re"),s(Ae,"onGesture");for(let qe of oe)g.addEventListener(qe,Ae,{capture:!0,passive:!0});return _e},[]);let b=(0,m.useCallback)(()=>{Ne.current||(Ne.current=!0,V.unlock()),i.start()},[V.unlock,i.start]),ke=(0,m.useCallback)(()=>i.start(),[i.start]),Le=(0,m.useRef)(!1),Oe=i.state==="idle"&&i.error===null,jt=!z&&!H.required&&(l===!0||l==="when-permitted"&&Y.permission==="granted"),Tt=jt&&O.settled&&H.settled&&ue,_n=l==="when-permitted"&&!Y.permissionSettled&&!Le.current,Ot=jt&&Oe&&!Le.current,ut=(_n||Ot||!ue)&&T.gate==="ready"?"loading":T.gate;(0,m.useEffect)(()=>{!Tt||!Oe||T.gate!=="ready"||Le.current||(Le.current=!0,ke())},[Tt,Oe,T.gate,ke]);let wn=Oe&&!z&&!H.required&&!(Ot&&T.gate==="ready"),[Pt,Bt]=(0,m.useState)(!1),{canSwitchCaptureMode:qt,setCaptureMode:Vt}=i;(0,m.useEffect)(()=>{if(!W.settled||!ne){Bt(!1);return}let g=!0;return qt().then(oe=>{g&&Bt(oe)}),()=>{g=!1}},[W.settled,ne,qt]);let{choose:Dt}=W,Ie=L?"self":"assisted",Sn=(0,m.useCallback)(async()=>{await Vt(Ie)&&Dt(Ie)},[Vt,Dt,Ie]),Ht=i.state!=="idle"&&i.facingMode!==null?i.facingMode:ee;(0,m.useEffect)(()=>{let g=I.current?.style;Ht==="user"?g?.removeProperty("transform"):g&&(g.transform="none")},[Ht]);let Fe=(0,m.useMemo)(()=>i.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(i.artifacts.keyframe):null,[i.artifacts]);(0,m.useEffect)(()=>{if(Fe!==null)return()=>URL.revokeObjectURL(Fe)},[Fe]);let $t=i.frozenPreview??Fe,Ue=e!==void 0,Z=vn(i.state),be=kn(i.state),Ge=Z||be,se=i.result,Ft=i.state==="done"&&se!==null,Ke=Z&&i.rampColour!==null,dt=i.state==="recording"&&i.frozenPreview!==null&&!Ke,Ze=D!==null,Gt=Pt&&Z&&!dt?{to:Ie,label:u(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:u(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:s(()=>{Sn()},"onSwitch")}:null,ze=i.modeRestarted&&Z?u("capture.modeSwitch.restarted"):null,Pe=be||dt,Kt=be?"checking":dt?"frozen":i.state==="recording"||Ke?"recording":i.gateLocked||i.gate.progress>=1?"locked":i.gate.faceDetected?"aligning":"seeking",Ye=Z?i.gate.hint:null,We=i.state==="starting"?"capture.preparing.title":Ye===null?null:Ye==="center"&&!i.gate.faceDetected?"fcv3.no_face":pr(Ye),[xn,Zt]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(We!=="fcv3.no_face"){Zt(We);return}if(!Z)return;let g=setTimeout(()=>Zt(We),Gn);return()=>clearTimeout(g)},[We,Z]);let pt=Z&&!Ke&&typeof N=="string"&&N!=="",zt=L&&Z?u("capture.assisted.stage"):null,Re=Z&&!pt?Ke?Kn:xn:null,ht=pt?N:Re===null?"":u(Re);zr(V,Re,ht,Z);let Yt=(0,m.useRef)(R);Yt.current=R,(0,m.useEffect)(()=>{if(st(Re))try{Yt.current?.(Re)}catch(g){console.error("[@sekyro/react] onGuidance threw:",g)}},[Re]);let Be=(0,m.useMemo)(()=>({supported:V.supported,enabled:V.enabled,setEnabled:V.setEnabled,toggle:V.toggle}),[V.supported,V.enabled,V.setEnabled,V.toggle]),ft=a?.voicePrompt,Wt=ft!==void 0,Qt=j===void 0,Xt=(0,m.useRef)(!1);(0,m.useEffect)(()=>{!Wt||!Qt||Xt.current||!Lt()||(Xt.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."))},[Wt,Qt]);let Nn=ft!==void 0?(g,oe,_e)=>ft(g,oe,_e,Be):V.supported?()=>(0,v.jsx)(fn,{voice:Be}):void 0,{summary:mt,summaryPlaying:Jt,toggleSummary:er,stopSummary:tr}=V,Qe=w!==void 0&&w!=="",rr=Qe?w:u("capture.tips.summary"),nr=Qe?mt!=="none":mt==="partner"||mt==="default"&&mn(p),Rn=(0,m.useMemo)(()=>nr?{playing:Jt,toggle:s(()=>er(rr,{clip:!Qe}),"toggle"),stop:tr}:void 0,[nr,Jt,er,rr,tr,Qe]),An=(0,m.useMemo)(()=>({assets:ut,retryAssets:T.retry,permission:Y.permission,permissionSettled:Y.permissionSettled,captureMode:W.mode,facing:ee,voice:Be}),[ut,T.retry,Y.permission,Y.permissionSettled,W.mode,ee,Be]),Mn=gn(c)?(0,v.jsx)(le,{tone:c.tone,testId:"sekyro-host-notice",children:(0,v.jsx)("span",{children:c.text})}):c??null,ae=se!==null&&se.status==="retry"?se:null,G=Ft&&se.status==="unavailable"&&!z&&se.reasonCode!=="portrait_required"?se:null,Ce=Ft&&(se.status==="verified"||se.status==="not_verified"||se.status==="review")?se:null,yt=s((g,oe)=>{if(g===void 0)return null;if(g==="device_cooldown"){let Ae=fr(t,oe);if(Ae!==null)return u(Ae.key).replace("{time}",Ae.time)}let _e=et(g);return _e===null?null:u(_e)},"reasonText"),gt=s(g=>{let oe=g.retakeHint===void 0?null:Je(g.retakeHint);return oe===null?yt(g.reasonCode):u(oe)},"retryText"),sr=Ce===null?null:yt(Ce.reasonCode,Ce.retryAfter)??(Ce.status==="not_verified"&&Ce.reason!==void 0&&Fn.has(Ce.reason)?u("errors.session_expired"):null),En=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"&&i.artifacts?.degraded==="NO_RECORDER"),Xe=G?.reasonCode,ar=i.attempt;(0,m.useEffect)(()=>{G===null||Xe===void 0||e?.reportCaptureIssue===void 0||Zn.has(Xe)||Ct(g=>e.reportCaptureIssue?.(g),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:Xe,attempt:Math.min(1e3,ar)})},[G,Xe,ar,e]);let or=bt(),Ln=z&&O.auto===null&&!Z&&!be&&i.error===null,vt=(0,m.useCallback)(async g=>{await O.select(g)&&i.state==="done"&&i.retry()},[O.select,i.state,i.retry]);return(0,m.useEffect)(()=>{O.auto!==null&&!O.busy&&!Z&&!be&&vt(O.auto)},[O.auto,O.busy,Z,be,vt]),(0,v.jsx)(vr,{value:u,children:(0,v.jsxs)("div",{ref:F,className:x===void 0?"sekyro-capture":`sekyro-capture ${x}`,dir:M,lang:t,"data-testid":"sekyro-liveness-capture","data-state":i.state,children:[a?.header,ae!==null&>(ae)!==null&&!(Ze&&Ge)?(0,v.jsx)(le,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,v.jsx)("span",{children:gt(ae)})}):null,ze!==null&&!Ze?(0,v.jsx)(le,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,v.jsx)("span",{children:ze})}):null,he&&be&&!Ze?(0,v.jsx)(le,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,v.jsx)("span",{children:u("capture.busy")})}):null,H.required&&Oe?(0,v.jsx)(le,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,v.jsx)("span",{children:u("reasons.mobile_required")})}):null,i.error!==null?a?.errorPanel!==void 0?a.errorPanel(i.error,i.retry):(0,v.jsxs)(le,{tone:"danger",testId:"sekyro-error-notice",children:[(0,v.jsx)("span",{children:u(hr(i.error))}),i.error.retryable?(0,v.jsx)(te,{ref:or,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:u("common.retry")}):null]}):null,G!==null?(0,v.jsxs)(le,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,v.jsx)("span",{children:(G.reasonCode==="attestation"&&G.attestationError==="clock_wrong"?u("errors.device_clock"):yt(G.reasonCode))??u(G.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),En?(0,v.jsx)(te,{ref:or,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:u(G.reasonCode==="attestation"?"common.retry":"capture.recordAgain")}):null]}):null,sr!==null&&Ce!==null?(0,v.jsx)(le,{tone:Ce.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,v.jsx)("span",{children:sr})}):null,(0,v.jsx)("div",{className:Ge?void 0:"sekyro-hidden","data-capture-live":Ge?"":void 0,children:Ze?D({videoRef:I,guidance:Pe&&Ue?u("capture.checking"):ht,coached:pt&&!(Pe&&Ue),note:Pe?Ue?u(he?"capture.busy":"capture.checkingHint"):null:ze??(ae!==null?gt(ae):zt),settled:Pe&&Ue,progress:i.gate.progress,phase:Kt,still:Pe?$t:null,live:Ge,modeSwitch:Gt,...Pt?{status:ze}:{},ramp:i.rampColour===null?null:{colour:i.rampColour}}):(0,v.jsx)(kr,{videoRef:I,guidanceText:ht,guidanceHint:Ye,guidanceKey:Re,progress:i.gate.progress,phase:Kt,draining:i.draining,stillUrl:$t,showChecking:Ue,operatorText:zt,voicePrompt:Nn,overlay:o(g=>(0,v.jsxs)(v.Fragment,{children:[a?.stageOverlay?.(g),(0,v.jsx)(br,{colour:i.rampColour})]}),"overlay"),reduceMotion:i.reduceMotion,modeSwitch:Gt})}),Ln&&O.choice!==null?(0,v.jsx)(qr,{title:u("method.title"),description:u("method.description"),options:O.choice.options.map(g=>({id:g,label:u(`method.${g}`)})),busy:O.busy,error:O.failed?u("errors.network_error"):null,focus:i.state==="done",testId:"sekyro-method",look:"buttons",onChoose:o(g=>{vt(g)},"onChoose")}):null,wn?(0,v.jsxs)(v.Fragment,{children:[ge&&a?.header===void 0&&a?.intro===void 0?(0,v.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,v.jsx)("h2",{className:"sekyro-text-body",children:u("returning.title")}),(0,v.jsx)("p",{className:"sekyro-text-muted",children:u("returning.description")})]}):null,Mn,a?.intro!==void 0?a.intro(b,An):(0,v.jsx)(en,{assets:ut,onRetryAssets:T.retry,permission:Y.permission,captureMode:W.mode,voice:Be,tips:p??wt,summary:Rn,startLabel:S,startDisabled:d,onStart:b})]}):null,(0,v.jsx)(Wr,{showCoaching:ae!==null,coaching:ot(ae?.reasonCode,ae?.retakeHint),attemptsText:ae?.attemptsRemaining!==void 0?mr(k,t,ae.attemptsRemaining):null,showRetake:ae!==null&&!Z&&!be||!Ue&&i.state==="captured",onRetake:i.retry}),a?.footer]})})}o(zn,"Ei");s(zn,"LivenessCapture");var Ut=U(K(),1),ct=U(K(),1),f=U(de(),1);var _s={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"},ws={population_registry:"hashtag",national_eid:"key"};function Yn(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=e.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}o(Yn,"D");s(Yn,"identityLabel");function Wn(e,t){let[n,r]=(0,Ut.useState)(!1),[a,l]=(0,Ut.useState)(null);return{busy:n,error:a,run:s(c=>{r(!0),l(null),c().then(()=>r(!1),d=>{r(!1),l(e.t(Nr(d,e.strings))),t?.(d)})},"run")}}o(Wn,"q");s(Wn,"useChoiceAction");function bn(){let e=`sekyro-face-light-${(0,ct.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,f.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("defs",{children:(0,f.jsx)("mask",{id:e,children:(0,f.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,f.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,f.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,f.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,f.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}o(bn,"O");s(bn,"FaceMark");var Qn={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function Xn(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}o(Xn,"ne");s(Xn,"faceIntroRetryOf");var Jn={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function es({start:e,context:t,tips:n,tipsTitle:r,human:a=!1,returning:l=!1,notice:c,retry:d}){let S=_t(),{t:p}=S,w=d===void 0?"face":ot(d.reason,d.retakeHint),N=w==="face"?null:He[w].tips,j=(0,ct.useContext)(_r)?.busy===!0;return(0,f.jsxs)("section",{className:"sekyro-step",children:[(0,f.jsx)(bn,{}),t.captureMode==="assisted"?(0,f.jsx)(tt,{title:p("capture.assisted.heading"),lead:p("capture.assisted.lead")}):l?(0,f.jsx)(tt,{title:p("returning.heading"),lead:p("returning.description")}):(0,f.jsx)(tt,{title:p(a?"native.face.humanIntroTitle":"native.face.introTitle"),lead:p(a?"native.face.humanIntroLead":"native.face.introLead")}),d!==void 0?(0,f.jsx)(Cn,{retry:d,title:He[w].title}):null,r!==void 0&&N===null?(0,f.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,f.jsx)("ul",{className:"sekyro-tiprows",children:N!==null?N.map(R=>(0,f.jsxs)("li",{children:[(0,f.jsx)(Ee,{name:Jn[R]??"face"}),p(R)]},R)):n!==void 0?n.map(R=>(0,f.jsxs)("li",{children:[(0,f.jsx)(Ee,{name:Qn[R.id]??"face"}),R.text]},R.id)):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("li",{children:[(0,f.jsx)(Ee,{name:"light"}),p("capture.tips.light")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)(Ee,{name:"jGlasses"}),p("capture.tips.uncover")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)(Ee,{name:"smartphone"}),p("capture.tips.eyeLevel")]})]})}),c??null,c!==void 0?null:t.assets==="failed"?(0,f.jsx)(te,{kind:"secondary",full:!0,onClick:t.retryAssets,children:p("common.retry")}):null,c!==void 0?null:(0,f.jsx)(Cr,{children:(0,f.jsxs)(te,{full:!0,disabled:t.assets!=="ready"||j,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,f.jsx)(Ee,{name:"camera"}),p("capture.start")]})})]})}o(es,"re");s(es,"FaceIntro");var ts=new Set(["match_inconclusive","no_face_source","below_threshold"]);function Cn({retry:e,title:t}){let n=_t(),r=e.retakeHint===void 0?null:Je(e.retakeHint),a=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":ts.has(e.reason)?"capture.retryMatch.message":et(e.reason);return(0,f.jsxs)(wr,{tone:"warning",children:[r!==null?(0,f.jsx)("span",{children:n.t(r)}):a!==null?(0,f.jsx)("span",{children:n.t(a)}):null,r===null?(0,f.jsx)("span",{children:n.t(t)}):null,(0,f.jsx)("span",{children:Sr(n,e.attemptsRemaining,e.attemptsExhausted)})]})}o(Cn,"K");s(Cn,"RetryNotice");function rs(e){return kt(e)}o(rs,"ce");s(rs,"isInAppBrowser");function ns(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let a=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${a};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}o(ns,"le");s(ns,"androidBrowserIntent");export{qr as a,Lt as b,Vn as c,an as d,zn as e,_s as f,ws as g,Yn as h,Wn as i,Xn as j,es as k,rs as l,ns as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t,b as r,c as m,d as o,e as p}from"./chunk-MINBJAVX.js";import"./chunk-HOBGJOBT.js";import"./chunk-F4Q2Q4OC.js";import"./chunk-32CNXSJQ.js";import"./chunk-U7QPOSFH.js";import"./chunk-P7K7ELYZ.js";import"./chunk-6MYG4HWP.js";import"./chunk-JS2IXPNL.js";import"./chunk-SLLJX5QK.js";import"./chunk-4FHWXBOB.js";export{r as BARCODE_BUDGET_MS,t as SAME_FACE_MAX_DROPS,o as createDocumentCapture,p as createDocumentCaptureInternal,m as warmDocumentCapture};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,b as a,c as t,d as o,e as m,f as p}from"./chunk-
|
|
1
|
+
import{a as r,b as a,c as t,d as o,e as m,f as p}from"./chunk-5JSOPXYS.js";import"./chunk-IO7MUUC6.js";import"./chunk-Q5ZVLMKQ.js";import"./chunk-L244IUB3.js";import"./chunk-Y6PC7FZV.js";import"./chunk-KHSYTJ46.js";import"./chunk-6MYG4HWP.js";import"./chunk-JS2IXPNL.js";import"./chunk-4FHWXBOB.js";export{r as ANALYSIS_LONG_EDGE,a as PORTRAIT_JPEG_QUALITY,m as createPortraitCaptureInternal,t as defaultGrabber,o as observe,p as warmPortraitCapture};
|