@sekyro/elements 0.1.0-rc.0 → 0.1.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cdn/chunks/{capture-session-doc-K6LVXAGQ-SY3B27LY.js → capture-session-doc-ELX6VK6Z-SDM3ILRA.js} +1 -1
  3. package/dist/cdn/chunks/{chunk-2ZVKLBJD.js → chunk-36WGD7QV.js} +1 -1
  4. package/dist/cdn/chunks/chunk-5FLR7RPJ.js +1 -0
  5. package/dist/cdn/chunks/{chunk-TCW6XNLI.js → chunk-6H22RNSK.js} +1 -1
  6. package/dist/cdn/chunks/{chunk-C66GZ7NN.js → chunk-7Y73DZJB.js} +1 -1
  7. package/dist/cdn/chunks/{chunk-3VYQXVW4.js → chunk-BF6SE2AC.js} +1 -1
  8. package/dist/cdn/chunks/{chunk-YMGCOMYZ.js → chunk-BZ37D4FR.js} +1 -1
  9. package/dist/cdn/chunks/{chunk-KPGTFHQU.js → chunk-CFJJD6T2.js} +1 -1
  10. package/dist/cdn/chunks/{chunk-OIJVTJML.js → chunk-CYGAKCKG.js} +1 -1
  11. package/dist/cdn/chunks/{chunk-2SENV5CV.js → chunk-FCTRNWRU.js} +1 -1
  12. package/dist/cdn/chunks/{chunk-6MEPT5ZS.js → chunk-FDWO4KXK.js} +1 -1
  13. package/dist/cdn/chunks/{chunk-Z3EEB4CI.js → chunk-FEWP7HBJ.js} +1 -1
  14. package/dist/cdn/chunks/{chunk-7XAIG23G.js → chunk-HQF66Y6S.js} +1 -1
  15. package/dist/cdn/chunks/{chunk-XYQGAQBQ.js → chunk-KLE75SX4.js} +1 -1
  16. package/dist/cdn/chunks/{chunk-OBPBHX2J.js → chunk-LYYAVERP.js} +1 -1
  17. package/dist/cdn/chunks/chunk-PUO2VWDE.js +33 -0
  18. package/dist/cdn/chunks/chunk-U3UDWPBG.js +1 -0
  19. package/dist/cdn/chunks/chunk-X3BGM3B2.js +1 -0
  20. package/dist/cdn/chunks/{chunk-UYAVCSQ4.js → chunk-YWPZG2MZ.js} +1 -1
  21. package/dist/cdn/chunks/{chunk-IFGPCCJH.js → chunk-ZIC5GEH2.js} +1 -1
  22. package/dist/cdn/chunks/{chunk-HODE7UDG.js → chunk-ZKLSZJFN.js} +1 -1
  23. package/dist/cdn/chunks/{create-document-capture-LNX6NFSK-A4LP25Y5.js → create-document-capture-UHZJUZHC-YYZNCSW6.js} +1 -1
  24. package/dist/cdn/chunks/{document-capture-view-JIKJWCFG-MMCEL43X.js → document-capture-view-JE6IX4IE-2454PW6Z.js} +1 -1
  25. package/dist/cdn/chunks/{eid-view-IW2ZP2NG-EB5SCHBD.js → eid-view-RZS6MLT6-35VSHTV3.js} +1 -1
  26. package/dist/cdn/chunks/{email-otp-view-VDTMZ4R5-Y5QHQDIB.js → email-otp-view-WUQ5OGDD-YDSUKAN2.js} +1 -1
  27. package/dist/cdn/chunks/flow-views-5L7JF3MM-M6C3RXSX.js +1 -0
  28. package/dist/cdn/chunks/overlay-de-JQ2FDZBA-HLFTXIF6.js +1 -0
  29. package/dist/cdn/chunks/overlay-es-WDYRSRHH-UXHTYCHD.js +1 -0
  30. package/dist/cdn/chunks/overlay-pt-AQMDWDWX-BD7TO6Y4.js +1 -0
  31. package/dist/cdn/chunks/plan-runner-ZHOYMRAO-RDS523K5.js +1 -0
  32. package/dist/cdn/chunks/{portrait-capture-view-LWESDZPM-SEOHMLJQ.js → portrait-capture-view-GQIBQY4U-TJUYRCTI.js} +1 -1
  33. package/dist/cdn/chunks/{portrait-review-view-FU3QSO4K-DZHDIMQX.js → portrait-review-view-XOQYQNU7-LPONGGFW.js} +1 -1
  34. package/dist/cdn/define.js +1 -1
  35. package/dist/cdn/index.js +1 -1
  36. package/dist/{chunk-HSQWGTF7.js → chunk-6NQ7EWA4.js} +1 -1
  37. package/dist/{chunk-JJNFGW3A.js → chunk-72JW2LCH.js} +1 -1
  38. package/dist/{chunk-X5WMOOH2.js → chunk-7URX73UH.js} +1 -1
  39. package/dist/{chunk-W2UTL5PI.js → chunk-AGPBG22V.js} +1 -1
  40. package/dist/{chunk-UT2KIR2K.js → chunk-B6A5RXN4.js} +1 -1
  41. package/dist/chunk-EIRNIJXL.js +1 -0
  42. package/dist/{chunk-WWGJDMZQ.js → chunk-ESSKMX7I.js} +1 -1
  43. package/dist/{chunk-KU4DZ3OQ.js → chunk-IBPUWYHJ.js} +1 -1
  44. package/dist/{chunk-OSBGOI4W.js → chunk-IGC6OQZ2.js} +1 -1
  45. package/dist/{chunk-JQ3ANVKN.js → chunk-QE2B3MSJ.js} +1 -1
  46. package/dist/{chunk-X5K27NXI.js → chunk-RMV3BNWO.js} +1 -1
  47. package/dist/{chunk-4QI2LTJD.js → chunk-XEY5ANJ6.js} +1 -1
  48. package/dist/chunk-ZDF5JILV.js +33 -0
  49. package/dist/define.cjs +5 -5
  50. package/dist/define.js +1 -1
  51. package/dist/{document-capture-view-JIKJWCFG-OWMTF5A3.js → document-capture-view-JE6IX4IE-5HJYAEDX.js} +1 -1
  52. package/dist/{eid-view-IW2ZP2NG-SKEYTRTX.js → eid-view-RZS6MLT6-2W2T3AWK.js} +1 -1
  53. package/dist/{email-otp-view-VDTMZ4R5-EO7T6SL4.js → email-otp-view-WUQ5OGDD-NGI6PBX3.js} +1 -1
  54. package/dist/flow-views-5L7JF3MM-P55CCCOH.js +1 -0
  55. package/dist/index.cjs +5 -5
  56. package/dist/index.d.cts +16 -0
  57. package/dist/index.d.ts +16 -0
  58. package/dist/index.js +1 -1
  59. package/dist/overlay-de-JQ2FDZBA-FR25JPE4.js +1 -0
  60. package/dist/overlay-es-WDYRSRHH-PFDMX5D2.js +1 -0
  61. package/dist/overlay-pt-AQMDWDWX-LTD4N2DW.js +1 -0
  62. package/dist/{portrait-capture-view-LWESDZPM-XZOM6LXG.js → portrait-capture-view-GQIBQY4U-AFPEUDLY.js} +1 -1
  63. package/dist/{portrait-review-view-FU3QSO4K-AGWEX2EQ.js → portrait-review-view-XOQYQNU7-IPKAZBP6.js} +1 -1
  64. package/dist/styles.css +5 -1
  65. package/package.json +2 -2
  66. package/dist/cdn/chunks/chunk-3KIFGAEK.js +0 -1
  67. package/dist/cdn/chunks/chunk-562ANROG.js +0 -1
  68. package/dist/cdn/chunks/chunk-YEPHU5PX.js +0 -1
  69. package/dist/cdn/chunks/chunk-ZKEOHGBY.js +0 -33
  70. package/dist/cdn/chunks/flow-views-N4FMOYIR-FDN6ATHN.js +0 -1
  71. package/dist/cdn/chunks/overlay-de-F7GCMCGJ-FBTP3BSM.js +0 -1
  72. package/dist/cdn/chunks/overlay-es-HIO7CIKS-GDHVHUQW.js +0 -1
  73. package/dist/cdn/chunks/overlay-pt-YC4HRHKL-J3TGRZRW.js +0 -1
  74. package/dist/cdn/chunks/plan-runner-DIRERYBF-FANNXQNO.js +0 -1
  75. package/dist/chunk-43YHL2WG.js +0 -1
  76. package/dist/chunk-73JRPFCO.js +0 -33
  77. package/dist/flow-views-N4FMOYIR-J54ADNRO.js +0 -1
  78. package/dist/overlay-de-F7GCMCGJ-7OI7SGX4.js +0 -1
  79. package/dist/overlay-es-HIO7CIKS-LXC2SFGY.js +0 -1
  80. package/dist/overlay-pt-YC4HRHKL-2QCRICEV.js +0 -1
  81. package/sbom.cdx.json +0 -153
package/dist/define.js CHANGED
@@ -1 +1 @@
1
- import{g as e}from"./chunk-73JRPFCO.js";import"./chunk-4QI2LTJD.js";import"./chunk-X5K27NXI.js";import"./chunk-X5WMOOH2.js";import"./chunk-OSBGOI4W.js";import"./chunk-KU4DZ3OQ.js";import"./chunk-UT2KIR2K.js";import"./chunk-WWGJDMZQ.js";import"./chunk-SEE6MST7.js";import"./chunk-43YHL2WG.js";import"./chunk-HSQWGTF7.js";import"./chunk-JJNFGW3A.js";import"./chunk-RPLVIGTS.js";e();export{e as defineSekyroElements};
1
+ import{g as e}from"./chunk-ZDF5JILV.js";import"./chunk-XEY5ANJ6.js";import"./chunk-RMV3BNWO.js";import"./chunk-7URX73UH.js";import"./chunk-IGC6OQZ2.js";import"./chunk-IBPUWYHJ.js";import"./chunk-B6A5RXN4.js";import"./chunk-ESSKMX7I.js";import"./chunk-SEE6MST7.js";import"./chunk-EIRNIJXL.js";import"./chunk-6NQ7EWA4.js";import"./chunk-72JW2LCH.js";import"./chunk-RPLVIGTS.js";e();export{e as defineSekyroElements};
@@ -1 +1 @@
1
- "use client";import{a as Ge}from"./chunk-W2UTL5PI.js";import{d as Be}from"./chunk-X5K27NXI.js";import{a as Ie,b as Oe,c as Ee}from"./chunk-KU4DZ3OQ.js";import"./chunk-UT2KIR2K.js";import{a as Ve}from"./chunk-43YHL2WG.js";import"./chunk-HSQWGTF7.js";import{E as Ae,F as Re,G as Pe,I as Ue,K as pe,L as me,a as ct,b as dt,c as O,o as He,q as De,v as Y,w as ue,y as he}from"./chunk-JJNFGW3A.js";import{a as c,c as _e,i as h}from"./chunk-RPLVIGTS.js";var i=_e(ct(),1),e=_e(dt(),1);var ut={image:'<path d="M2 12C2 7.29 2 4.93 3.46 3.46C4.93 2 7.29 2 12 2C16.71 2 19.07 2 20.54 3.46C22 4.93 22 7.29 22 12C22 16.71 22 19.07 20.54 20.54C19.07 22 16.71 22 12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 12Z" stroke="currentColor"/><path d="M14 8A2 2 0 1 0 18 8A2 2 0 1 0 14 8Z" stroke="currentColor"/><path d="M2 12.5L3.75 10.97C4.66 10.17 6.04 10.22 6.89 11.07L11.18 15.36C11.87 16.05 12.95 16.14 13.75 15.58L14.04 15.37C15.19 14.57 16.74 14.66 17.78 15.6L21 18.5" stroke="currentColor" stroke-linecap="round"/>',flashlight:'<path d="M9 11.66V19C9 19.93 9 20.4 9.15 20.77C9.36 21.26 9.74 21.64 10.23 21.85C10.6 22 11.07 22 12 22C12.93 22 13.4 22 13.77 21.85C14.26 21.64 14.64 21.26 14.85 20.77C15 20.4 15 19.93 15 19V11.66C15 10.84 15 10.43 15.15 10.06C15.3 9.7 15.59 9.41 16.17 8.83L16.17 8.83L19.41 5.59C19.7 5.3 19.85 5.15 19.92 4.97C20 4.78 20 4.58 20 4.17V4C20 3.06 20 2.59 19.71 2.29C19.41 2 18.94 2 18 2H6C5.06 2 4.59 2 4.29 2.29C4 2.59 4 3.06 4 4V4.17C4 4.58 4 4.78 4.08 4.97C4.15 5.15 4.3 5.3 4.59 5.59L7.83 8.83C8.41 9.41 8.7 9.7 8.85 10.06C9 10.43 9 10.84 9 11.66Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 10H9" stroke="currentColor" stroke-linecap="round"/><path d="M12 13V15" stroke="currentColor" stroke-linecap="round"/><path d="M4.5 5H19.5" stroke="currentColor" stroke-linecap="round"/>'},ht={"dcv3.mrz.searching":"ضع صفحة جواز السفر كاملة داخل الإطار","dcv3.mrz.showMrzSide":"اعرض الوجه الذي يحتوي على سطرين أو ثلاثة أسطر من الحروف","dcv3.mrz.reading":"جارٍ قراءة الوثيقة… ثبّتها","dcv3.mrz.moveCloser":"اقترب حتى تملأ أسطر الحروف الإطار","dcv3.mrz.turnSideways":"أدر هاتفك أفقيًا لقراءة أسطر الحروف","dcv3.mrz.glare":"أمِل الوثيقة لإزالة الانعكاس","dcv3.mrz.holdStill":"لا تتحرك","dcv3.mrz.valid":"تمت قراءة الوثيقة. جارٍ التقاط الصورة","dcv3.mrz.looksLikePassport":"يبدو أن هذا جواز سفر","dcv3.mrz.looksLikeCard":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"},ee={"dcv3.mrz.searching":"Fit the whole passport page in the frame","dcv3.mrz.showMrzSide":"Show the side with the two or three lines of characters","dcv3.mrz.reading":"Reading the document… hold it steady","dcv3.mrz.moveCloser":"Move closer so the lines of characters fill the frame","dcv3.mrz.turnSideways":"Turn your phone sideways to read the lines of characters","dcv3.mrz.glare":"Tilt the document to remove the reflection","dcv3.mrz.holdStill":"Hold still","dcv3.mrz.valid":"Document read. Taking the photo","dcv3.mrz.looksLikePassport":"This looks like a passport","dcv3.mrz.looksLikeCard":"This looks like an identity card or residence permit"},pt={"dcv3.mrz.searching":"Cadrez toute la page du passeport","dcv3.mrz.showMrzSide":"Montrez la face avec les deux ou trois lignes de caractères","dcv3.mrz.reading":"Lecture du document… tenez-le immobile","dcv3.mrz.moveCloser":"Rapprochez-vous pour que les lignes de caractères remplissent le cadre","dcv3.mrz.turnSideways":"Tournez votre téléphone à l’horizontale pour lire les lignes de caractères","dcv3.mrz.glare":"Inclinez le document pour supprimer le reflet","dcv3.mrz.holdStill":"Ne bougez plus","dcv3.mrz.valid":"Document lu. Prise de la photo","dcv3.mrz.looksLikePassport":"Ceci ressemble à un passeport","dcv3.mrz.looksLikeCard":"Ceci ressemble à une carte d’identité ou un titre de séjour"},mt={"doc.uploadInstead":"رفع صورة بدلًا من ذلك","doc.uploadTitle":"ارفع صورة لوثيقتك","doc.uploadHint":"صورة واضحة للوثيقة كاملة، ملتقطة بكاميرا.","doc.uploadUnsupported":"اختر صورة للوثيقة بصيغة JPEG أو PNG أو HEIC.","doc.uploadFailed":"تعذّر إرسال هذه الصورة. أعد المحاولة.","doc.source.title":"كيف تريد إضافة وثيقتك؟","doc.source.description":"التقط صورة بالكاميرا، أو ارفع صورة للوثيقة من هذا الجهاز.","doc.source.camera":"التقاط صورة","doc.source.upload":"رفع صورة"},te={"doc.uploadInstead":"Upload a photo instead","doc.uploadTitle":"Upload a photo of your document","doc.uploadHint":"A clear photo of the whole document, taken with a camera.","doc.uploadUnsupported":"Choose a JPEG, PNG or HEIC photo of the document.","doc.uploadFailed":"We could not send this photo. Try again.","doc.source.title":"How do you want to add your document?","doc.source.description":"Take a photo with the camera, or upload a photo of the document from this device.","doc.source.camera":"Take a photo","doc.source.upload":"Upload a photo"},vt={"doc.uploadInstead":"Téléverser une photo à la place","doc.uploadTitle":"Téléversez une photo de votre document","doc.uploadHint":"Une photo nette du document entier, prise avec un appareil photo.","doc.uploadUnsupported":"Choisissez une photo JPEG, PNG ou HEIC du document.","doc.uploadFailed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","doc.source.title":"Comment voulez-vous ajouter votre document ?","doc.source.description":"Prenez une photo avec la caméra, ou importez une photo du document depuis cet appareil.","doc.source.camera":"Prendre une photo","doc.source.upload":"Importer une photo"},ft={"native.doc.introTitle":"سنلتقط صورة لوثيقتك","native.doc.introLead":"ستُفتح كاميرا هاتفك، وتُلتقط الصورة تلقائيًا بمجرد أن تكون الوثيقة داخل الإطار.","native.doc.tip.flat":"ضع الوثيقة مسطحة على سطح داكن.","native.doc.tip.glare":"تجنّب انعكاسات المصابيح أو الشمس.","native.doc.tip.frame":"أبقِ الوثيقة كاملة داخل الإطار.","native.doc.openCamera":"افتح الكاميرا","native.doc.changeDocument":"تغيير الوثيقة","native.scan.closer":"اقترب قليلًا","native.scan.farther":"ابتعد قليلًا","native.scan.glare":"أمِل البطاقة قليلًا","native.scan.dark":"الإضاءة ضعيفة. شغّل المصباح.","native.scan.blurry":"الصورة غير واضحة. ثبّت الهاتف.","native.scan.holdStill":"لا تتحرك","native.scan.reading":"جارٍ التحقق من وثيقتك…","native.scan.putDown":"يمكنك وضع وثيقتك جانبًا.","native.scan.retry":"لنحاول مرة أخرى"},ae={"native.doc.introTitle":"Photograph your document","native.doc.introLead":"Your phone's camera will open. The photo is taken by itself as soon as the document is well framed.","native.doc.tip.flat":"Lay the document flat on a dark surface.","native.doc.tip.glare":"Avoid glare from lamps or sunlight.","native.doc.tip.frame":"Keep the whole document in the frame.","native.doc.openCamera":"Open the camera","native.doc.changeDocument":"Change document","native.scan.closer":"Move a little closer","native.scan.farther":"Move back a little","native.scan.glare":"Tilt the card a little","native.scan.dark":"Too dark. Turn on the light.","native.scan.blurry":"Blurry image. Hold the phone still.","native.scan.holdStill":"Hold still","native.scan.reading":"Checking your document…","native.scan.putDown":"You can put your document down.","native.scan.retry":"Let's try that again"},kt={"native.doc.introTitle":"Photographiez votre pièce","native.doc.introLead":"La caméra de votre téléphone va s'ouvrir. La photo est prise automatiquement dès que la pièce est bien cadrée.","native.doc.tip.flat":"Posez la pièce à plat, sur une surface sombre.","native.doc.tip.glare":"Évitez les reflets de lampe ou de soleil.","native.doc.tip.frame":"Gardez toute la pièce dans le cadre.","native.doc.openCamera":"Ouvrir la caméra","native.doc.changeDocument":"Changer de document","native.scan.closer":"Approchez un peu","native.scan.farther":"Reculez un peu","native.scan.glare":"Inclinez un peu la carte","native.scan.dark":"Trop sombre. Allumez la lampe.","native.scan.blurry":"Image floue. Tenez le téléphone immobile.","native.scan.holdStill":"Ne bougez plus","native.scan.reading":"Vérification de votre document…","native.scan.putDown":"Vous pouvez poser votre pièce.","native.scan.retry":"Réessayons"},gt=["locking","capturing"],W,Ye=(W=class{constructor(){this.shown={hint:null,locking:!1,card:null,manualShutter:!1},this.candidate=null,this.candidateSince=0,this.hintShownAt=0,this.lockLostAt=null,this.detectedSince=null,this.lostSince=null,this.shutterSince=null}present(t,n){return this.presentHint(t,n),this.presentLock(t,n),this.presentCard(t,n),this.shutterSince=t.manualShutter?this.shutterSince??n:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&n-this.shutterSince>=1e3},this.shown}presentHint(t,n){let o=t.phase==="framing"&&!(t.hint==="blurry"&&t.card===null)?t.hint:null;if(t.phase!=="framing"){this.shown={...this.shown,hint:null},this.candidate=null;return}if(o!==this.candidate&&(this.candidate=o,this.candidateSince=n),o===this.shown.hint)return;let r=n-this.candidateSince>=(o===null?0:350),f=this.shown.hint===null||n-this.hintShownAt>=1200;r&&f&&(this.shown={...this.shown,hint:o},this.hintShownAt=n)}presentLock(t,n){if(gt.includes(t.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(t.phase!=="framing"){this.shown={...this.shown,locking:!1},this.lockLostAt=null;return}this.lockLostAt??(this.lockLostAt=n),n-this.lockLostAt>=300&&(this.shown={...this.shown,locking:!1},this.lockLostAt=null)}}presentCard(t,n){let o=t.card;if(o===null||t.phase!=="framing"){if(t.phase!=="framing"){this.shown={...this.shown,card:null},this.detectedSince=null,this.lostSince=null;return}this.detectedSince=null,this.lostSince??(this.lostSince=n),n-this.lostSince>=300&&(this.shown={...this.shown,card:null});return}if(this.lostSince=null,this.detectedSince??(this.detectedSince=n),n-this.detectedSince<250)return;let r=this.shown.card;if(r===null){this.shown={...this.shown,card:{...o}};return}let f=.35;this.shown={...this.shown,card:{fill:r.fill+(o.fill-r.fill)*f,offsetX:r.offsetX+(o.offsetX-r.offsetX)*f,offsetY:r.offsetY+(o.offsetY-r.offsetY)*f}}}},c(W,"fe"),W);h(Ye,"ScanPresenter");var yt=Ye,wt={en:ae,fr:kt,ar:ft,es:ae,pt:ae,de:ae},Ct=450,fe=h(a=>t=>Ve(a.strings[t]??wt[a.locale][t]??""),"useScanCopy");function j({name:a}){return(0,e.jsx)("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:ut[a]}})}c(j,"ae");h(j,"ScanGlyph");var zt={en:ee,fr:pt,ar:ht,es:ee,pt:ee,de:ee},bt={en:te,fr:vt,ar:mt,es:te,pt:te,de:te},St="image/jpeg,image/png,image/heic,image/heif";function E(a){let t=a.strings,n=h(o=>t[o]??bt[a.locale][o],"text");return{t:h(o=>n(o)??"","t")}}c(E,"F");h(E,"uploadCopy");function We(a,t){return a===null||a.state==="fallback"||a.state==="mismatch"?null:a.state==="searching"?t?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":a.state==="valid"?"dcv3.mrz.valid":a.coach!==void 0?`dcv3.mrz.${a.coach}`:"dcv3.mrz.reading"}c(We,"vt");h(We,"mrzInstruction");function ne(a){return a.reason==="unreadable"?"doc.reason_unreadable":a.reason==="tester_document_mismatch"?"reasons.tester_document_mismatch":a.reason!==void 0&&a.reason!=="side_missing"?De(a.reason):null}c(ne,"ve");h(ne,"reasonOf");var Nt=new Set(["document_type_not_accepted","tester_document_mismatch"]);function xt({step:a,i18n:t,liveMrz:n,ageLead:o,...r}){let[f,g]=(0,i.useState)(!1),y=(0,i.useRef)(-1),[v,k]=(0,i.useState)("idle"),w=(0,i.useRef)(null),x=typeof a.uploadDocument=="function",z=x?a.photo?.source??"camera":"camera",M=x&&z!=="camera"&&a.photo?.uploadOffered===!0,[C,V]=(0,i.useState)(null),_=z==="upload"?"upload":z==="choice"?C??a.photo?.pick??"source":"camera",H=v==="sending"?void 0:()=>w.current?.click(),m=h(async D=>{let q=D.currentTarget.files?.[0];if(D.currentTarget.value="",q!==void 0){g(!1),k("sending");try{await a.uploadDocument(q),k("idle")}catch(F){k(F instanceof TypeError&&F.message==="unsupported_file"?"unsupported":"failed")}}},"onFile"),Q=M?(0,e.jsx)("input",{ref:w,type:"file",accept:St,hidden:!0,"data-testid":"sekyro-doc-upload","aria-label":E(t).t("doc.uploadTitle"),onChange:c(D=>{m(D)},"onChange")}):null,b=E(t),X=a.photo?.cameraOnPhone===!0;return _==="camera"&&X?(0,e.jsx)(Be,{i18n:t,lead:t.t("handoff.lead.document"),refresh:a.refresh,actions:(0,e.jsx)(O,{kind:"ghost",full:!0,onClick:c(()=>V("upload"),"onClick"),children:b.t("doc.source.upload")})}):_==="source"?(0,e.jsx)(Ge,{testId:"sekyro-doc-source",title:b.t("doc.source.title"),lead:b.t("doc.source.description"),cameraLabel:X?t.t("capture.source.phone"):b.t("doc.source.camera"),onPhone:X,uploadLabel:b.t("doc.source.upload"),notice:(0,e.jsx)(oe,{step:a,i18n:t}),onCamera:c(()=>V("camera"),"onCamera"),onUpload:c(()=>V("upload"),"onUpload")}):_==="upload"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(je,{step:a,i18n:t,ageLead:o===!0,upload:v,offered:M,onPick:c(()=>w.current?.click(),"onPick"),...z==="choice"?{onCamera:h(()=>V("camera"),"onCamera")}:{},...r}),Q]}):(0,e.jsxs)(e.Fragment,{children:[f?(0,e.jsx)(Qe,{step:a,i18n:t,attempts:y,...n!==void 0?{liveMrz:n}:{},...M&&H!==void 0?{onUpload:H}:{},onClose:c(()=>g(!1),"onClose")}):(0,e.jsx)(Fe,{step:a,i18n:t,ageLead:o===!0,onOpen:c(()=>g(!0),"onOpen"),upload:v,...M&&H!==void 0?{onUpload:H}:{},...r}),Q]})}c(xt,"ln");h(xt,"DocumentCaptureView");function ke({passport:a}){let t=Math.round(228/(a?1.42:1.586));return(0,e.jsxs)("svg",{className:"sekyro-mark sekyro-mark--card",viewBox:`-12 -12 252 ${t+24}`,"aria-hidden":"true",focusable:"false",children:[(0,e.jsx)("defs",{children:(0,e.jsx)("clipPath",{id:"sekyro-card-clip",children:(0,e.jsx)("rect",{width:228,height:t,rx:"12.5"})})}),(0,e.jsx)("rect",{className:"sekyro-mark__card",width:228,height:t,rx:"12.5"}),(0,e.jsx)("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:t*.52,rx:"6"}),[0,1,2].map(n=>(0,e.jsx)("rect",{className:"sekyro-mark__text",x:"88",y:23+n*t*.12,width:100-n*20,height:"6",rx:"3"},n)),[0,1].map(n=>(0,e.jsx)("rect",{className:"sekyro-mark__text",x:"17",y:t*.74+n*9,width:194,height:"4",rx:"2"},n)),(0,e.jsx)("g",{clipPath:"url(#sekyro-card-clip)",children:(0,e.jsx)("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:(0,e.jsx)("rect",{x:"-1",width:"2",height:t,className:"sekyro-mark__beam"})})}),(0,e.jsx)("path",{className:"sekyro-mark__brackets",d:Xe(-10,-10,248,t+20,16,30)})]})}c(ke,"qe");h(ke,"ScanMark");function Xe(a,t,n,o,r,f){let g=Math.min(r,f*.6);return[[a,t,1,1],[a+n,t,-1,1],[a,t+o,1,-1],[a+n,t+o,-1,-1]].map(([y,v,k,w])=>`M${y} ${v+w*f}V${v+w*g}Q${y} ${v} ${y+k*g} ${v}H${y+k*f}`).join("")}c(Xe,"kt");h(Xe,"brackets");function Fe({step:a,i18n:t,ageLead:n,onOpen:o,onChangeCountry:r,onChangeDocument:f,upload:g,onUpload:y}){let v=fe(t),k=E(t),w=a.documentType==="passport",x=ne(a),z=g==="sending",M=(0,i.useContext)(Re)?.busy===!0;return(0,e.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-document",children:[(0,e.jsx)(ke,{passport:w}),(0,e.jsx)(ue,{title:v("native.doc.introTitle"),lead:n?t.t("doc.ageStepUp"):v("native.doc.introLead")}),(0,e.jsx)(oe,{step:a,i18n:t}),a.reason!==void 0&&Nt.has(a.reason)?null:(0,e.jsxs)("ul",{className:"sekyro-tiprows",children:[(0,e.jsxs)("li",{children:[(0,e.jsx)(Y,{name:w?"passport":"card"}),v("native.doc.tip.flat")]}),(0,e.jsxs)("li",{children:[(0,e.jsx)(Y,{name:"light"}),v("native.doc.tip.glare")]}),(0,e.jsxs)("li",{children:[(0,e.jsx)(j,{name:"image"}),v("native.doc.tip.frame")]})]}),(0,e.jsx)(ge,{i18n:t,...f!==void 0?{onChangeDocument:f}:{},...r!==void 0?{onChangeCountry:r}:{}}),(0,e.jsx)(ye,{i18n:t,upload:g}),z?(0,e.jsx)("p",{className:"sekyro-text-muted",role:"status",children:t.t("doc.uploading")}):y!==void 0?(0,e.jsx)("p",{className:"sekyro-text-muted",children:k.t("doc.uploadHint")}):null,(0,e.jsxs)(he,{children:[(0,e.jsxs)(O,{full:!0,onClick:o,disabled:z||M,children:[(0,e.jsx)(Y,{name:"camera"}),v("native.doc.openCamera")]}),y!==void 0?(0,e.jsxs)(O,{full:!0,kind:"ghost",onClick:y,children:[(0,e.jsx)(j,{name:"image"}),k.t("doc.uploadInstead")]}):null]})]})}c(Fe,"bt");h(Fe,"DocumentIntro");function oe({step:a,i18n:t}){let n=ne(a);return n===null?null:(0,e.jsxs)(pe,{tone:"warning",children:[(0,e.jsx)("span",{children:t.t(n)}),(0,e.jsx)("span",{children:me(t,a.attemptsRemaining,a.attemptsExhausted)})]})}c(oe,"ye");h(oe,"ReasonNotice");function ge({i18n:a,onChangeCountry:t,onChangeDocument:n}){let o=fe(a);return n===void 0&&t===void 0?null:(0,e.jsxs)("div",{className:"sekyro-links",children:[n!==void 0?(0,e.jsx)("button",{type:"button",className:"sekyro-link",onClick:n,children:o("native.doc.changeDocument")}):null,t!==void 0?(0,e.jsx)("button",{type:"button",className:"sekyro-link",onClick:t,children:a.t("native.doc.changeCountry")}):null]})}c(ge,"Je");h(ge,"ChangeLinks");function ye({i18n:a,upload:t}){return t!=="unsupported"&&t!=="failed"?null:(0,e.jsx)(pe,{tone:"warning",children:(0,e.jsx)("span",{children:E(a).t(t==="unsupported"?"doc.uploadUnsupported":"doc.uploadFailed")})})}c(ye,"et");h(ye,"UploadNotice");function je({step:a,i18n:t,ageLead:n,upload:o,offered:r,onPick:f,onCamera:g,onChangeCountry:y,onChangeDocument:v}){let k=E(t),w=o==="sending";return(0,e.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-doc-upload-screen",children:[(0,e.jsx)(ke,{passport:a.documentType==="passport"}),(0,e.jsx)(ue,{title:k.t("doc.uploadTitle"),lead:n?t.t("doc.ageStepUp"):k.t("doc.uploadHint")}),n?(0,e.jsx)("p",{className:"sekyro-text-muted",children:k.t("doc.uploadHint")}):null,(0,e.jsx)(oe,{step:a,i18n:t}),(0,e.jsx)(ge,{i18n:t,...v!==void 0?{onChangeDocument:v}:{},...y!==void 0?{onChangeCountry:y}:{}}),(0,e.jsx)(ye,{i18n:t,upload:o}),w?(0,e.jsx)("p",{className:"sekyro-text-muted",role:"status",children:t.t("doc.uploading")}):null,(0,e.jsxs)(he,{children:[(0,e.jsxs)(O,{full:!0,onClick:f,disabled:w||!r||a.attemptsExhausted,children:[(0,e.jsx)(j,{name:"image"}),k.t("doc.source.upload")]}),g!==void 0?(0,e.jsxs)(O,{full:!0,kind:"ghost",onClick:g,disabled:w,children:[(0,e.jsx)(Y,{name:"camera"}),k.t("doc.source.camera")]}):null]})]})}c(je,"wt");h(je,"DocumentUploadScreen");function ve(a,t,n){let o=a*.88,r=o/n;return{x:(a-o)/2,y:t*.42-r/2,w:o,h:r}}c(ve,"Qe");h(ve,"guideRect");var $t={too_far:"native.scan.closer",too_close:"native.scan.farther",focus_far:"native.scan.farther",glare:"native.scan.glare",too_bright:"native.scan.glare",too_dark:"native.scan.dark",blurry:"native.scan.blurry"},Lt=h(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function Qe({step:a,i18n:t,liveMrz:n,onClose:o,attempts:r,onUpload:f}){let g=fe(t),y=(0,i.useContext)(Ie),v=(0,i.useRef)(y);v.current=y;let k=(0,i.useRef)(null),w=(0,i.useRef)(null),x=(0,i.useRef)(null),[z,M]=(0,i.useState)("idle"),[C,V]=(0,i.useState)(null),[_,H]=(0,i.useState)(null),[m,Q]=(0,i.useState)({w:0,h:0}),[b,X]=(0,i.useState)({hint:null,locking:!1,card:null,manualShutter:!1}),[D,q]=(0,i.useState)({}),[F,Ke]=(0,i.useState)(null),[we,et]=(0,i.useState)(null),[Ce,ze]=(0,i.useState)(0),[be,Se]=(0,i.useState)(null),[Z,Ne]=(0,i.useState)(null),A=a.documentType==="passport",J=A?1.42:1.586;Ae(!0),(0,i.useLayoutEffect)(()=>{let s=k.current;if(s===null)return;let u=h(()=>Q({w:s.clientWidth,h:s.clientHeight}),"measure");if(u(),typeof ResizeObserver>"u")return;let d=new ResizeObserver(u);return d.observe(s),()=>d.disconnect()},[]);let l=ve(m.w,m.h,J);(0,i.useEffect)(()=>{m.w===0||m.h===0||x.current?.setGuide?.({viewAspect:m.w/m.h,rect:{x:l.x/m.w,y:l.y/m.h,width:l.w/m.w,height:l.h/m.h}})},[m.w,m.h,l.x,l.y,l.w,l.h]),(0,i.useEffect)(()=>{let s=w.current;if(s===null)return;let u=a.capture({video:s,...n!==void 0?{liveMrz:n}:{}});x.current=u;let d=k.current;if(d!==null&&d.clientWidth>0&&d.clientHeight>0){let p=ve(d.clientWidth,d.clientHeight,J);u.setGuide?.({viewAspect:d.clientWidth/d.clientHeight,rect:{x:p.x/d.clientWidth,y:p.y/d.clientHeight,width:p.w/d.clientWidth,height:p.h/d.clientHeight}})}let T=new yt,N={scan:null,feedback:null,gate:null},P=h(p=>{N={...N,...p};let L=N.gate?.guide,st={phase:N.scan?.phase??"framing",hint:N.feedback?.reticle==="coaching"?N.feedback.key:null,card:L?.detected?{fill:L.fill,offsetX:L.offsetX,offsetY:L.offsetY}:null,manualShutter:N.scan?.manualShutter??!1},U=T.present(st,performance.now());X(I=>I.hint===U.hint&&I.locking===U.locking&&I.manualShutter===U.manualShutter&&I.card?.fill===U.card?.fill&&I.card?.offsetX===U.card?.offsetX&&I.card?.offsetY===U.card?.offsetY?I:U)},"present"),it=[u.on("state",M),u.on("feedback",p=>P({feedback:p})),u.on("gate",p=>P({gate:p})),u.on("scan",p=>{V(p),P({scan:p})}),u.on("captured",p=>{q(L=>({...L,[qe(p.side,A,L)]:p.previewDataUrl})),Ke(p.previewDataUrl),et(Je(s))}),u.on("error",p=>{H(p);let L=v.current;L!==null&&Ee(L,Oe("document",p,Math.max(0,r.current)))}),u.on("mrz",p=>{p.state==="mismatch"?Ne(p.format??null):Se(p)})];return r.current+=1,u.start().catch(()=>{}),()=>{for(let p of it)p();u.destroy(),x.current=null}},[a.issuer,a.documentType]);let $=C?.phase??"framing",R=$==="reading"||$==="result",re=$==="flipCue"||$==="reaskRecto",B=b.locking,xe=C?.captured.length??0;(0,i.useEffect)(()=>{B&&ze(s=>s+1)},[B]),(0,i.useEffect)(()=>{xe>0&&ze(s=>s+1)},[xe]);let tt=C?.expected??null;(0,i.useEffect)(()=>{Se(null)},[tt]),(0,i.useEffect)(()=>{if(Z===null)return;let s=setTimeout(()=>Ne(null),2e3);return()=>clearTimeout(s)},[Z]);let $e=re||R?null:We(be,A),le=Z!==null?Z==="TD3"?"dcv3.mrz.looksLikePassport":"dcv3.mrz.looksLikeCard":$e,at=le===null?null:t.strings[le]??zt[t.locale][le],ie=ne(a),Le=b.hint===null?null:$t[b.hint]??`dcv2.${b.hint}`,nt=Le??($==="flipCue"?C?.notice==="same_face"?"doc.sameFace":"doc.flip":$==="reaskRecto"?"doc.reaskRecto":R?"native.scan.reading":$==="locking"||$==="capturing"||B?"native.scan.holdStill":C?.notice==="reread"?ie??"doc.reread":C?.notice==="technical"?"native.scan.retry":C?.notice==="blurry"?"native.scan.blurry":ie??(A?"doc.showPage":"doc.showSide")),se=at??g(nt),G=b.card,S=l;if(!B&&G!==null&&G.fill>=.45&&G.fill<=1.25&&!Lt()){let s=l.w*G.fill,u=s/J,d=l.x+l.w/2+l.w*Math.max(-.25,Math.min(.25,G.offsetX)),T=l.y+l.h/2+l.h*Math.max(-.25,Math.min(.25,G.offsetY));S={x:d-s/2,y:T-u/2,w:s,h:u}}let K=l.w*.045,ce=28,Me=Math.min(K,ce*.6),ot=[[S.x,S.y,1,1],[S.x+S.w,S.y,-1,1],[S.x,S.y+S.h,1,-1],[S.x+S.w,S.y+S.h,-1,-1]],rt=B?"is-locked":b.hint!==null?"is-coaching":"",lt=A?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],Te=l.y+l.h+48,de={insetInlineStart:l.x,insetBlockStart:l.y,inlineSize:l.w,blockSize:l.h,borderRadius:K};return(0,e.jsx)("section",{className:"sekyro-lm","aria-label":se,"data-testid":"sekyro-document",children:(0,e.jsxs)("div",{ref:k,className:`sekyro-lm-stage${R?" is-reading":""}${re?" is-flip":""}`,style:{"--sekyro-guide-w":`${l.w}px`},children:[(0,e.jsx)("video",{ref:w,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:c(s=>{let u=s.currentTarget,d=u.getBoundingClientRect(),T=Math.max(d.width/(u.videoWidth||1),d.height/(u.videoHeight||1)),N=u.videoWidth*T,P=u.videoHeight*T;N>0&&P>0&&x.current?.focusAt((s.clientX-d.left+(N-d.width)/2)/N,(s.clientY-d.top+(P-d.height)/2)/P)},"onPointerUp")}),m.w>0?(0,e.jsxs)(e.Fragment,{children:[R&&we!==null?(0,e.jsx)("img",{className:"sekyro-lm-scene",src:we,alt:""}):null,R&&F!==null?(0,e.jsx)("img",{className:"sekyro-lm-frozen",src:F,alt:"",style:de}):null,(0,e.jsxs)("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${m.w} ${m.h}`,"aria-hidden":"true",focusable:"false",children:[(0,e.jsxs)("defs",{children:[(0,e.jsxs)("linearGradient",{id:"sekyro-lm-top",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),(0,e.jsx)("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),(0,e.jsxs)("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),(0,e.jsx)("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),(0,e.jsx)("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${m.w}V${m.h}H0Z${Ze(l,K)}`}),(0,e.jsx)("rect",{width:m.w,height:Math.max(0,l.y),fill:"url(#sekyro-lm-top)"}),(0,e.jsx)("rect",{y:l.y+l.h,width:m.w,height:Math.max(0,m.h-l.y-l.h),fill:"url(#sekyro-lm-bottom)"}),(0,e.jsx)("g",{className:`sekyro-lm-brackets ${rt}`,children:ot.map(([s,u,d,T],N)=>(0,e.jsx)("path",{style:{transform:`translate(${s}px, ${u}px) scale(${d}, ${T})`},d:`M0 ${ce}V${Me}Q0 0 ${Me} 0H${ce}`},N))}),B?(0,e.jsx)("rect",{className:"sekyro-lm-trace",x:l.x,y:l.y,width:l.w,height:l.h,rx:K,pathLength:"1",style:{animationDuration:`${Ct}ms`}}):null]}),(0,e.jsx)("div",{className:"sekyro-lm-slot",style:de,"aria-hidden":"true",children:R?(0,e.jsx)("span",{className:"sekyro-lm-read is-repeating"}):Ce>0?(0,e.jsx)("span",{className:"sekyro-lm-read"},Ce):null})]}):null,$e!==null?(0,e.jsx)("div",{className:"sekyro-lm-slot",style:de,"aria-hidden":"true",children:(0,e.jsx)("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${A?" is-page":""}${be?.state==="valid"?" is-valid":""}`})}):null,(0,e.jsxs)("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:l.y-64},children:[(0,e.jsx)("div",{role:"status","aria-live":"polite",children:(0,e.jsx)(Ue,{swapKey:se,className:"sekyro-lm-line",children:se})}),ie!==null&&$==="framing"&&Le===null?(0,e.jsx)("p",{className:"sekyro-lm-attempts",children:me(t,a.attemptsRemaining,a.attemptsExhausted)}):null]}),R?(0,e.jsxs)("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:Te-12},children:[(0,e.jsx)("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),g("native.scan.putDown")]}):re?(0,e.jsx)("div",{className:`sekyro-lm-under sekyro-lm-flip${$==="reaskRecto"?" is-toFront":""}`,style:{insetBlockStart:Te-20},"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:(0,e.jsxs)("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(J)},children:[(0,e.jsx)("span",{className:"sekyro-lm-flip-front"}),(0,e.jsx)("span",{className:"sekyro-lm-flip-back"})]})}):null,(0,e.jsxs)("div",{className:"sekyro-lm-controls",children:[(0,e.jsxs)("div",{className:"sekyro-lm-bar",children:[(0,e.jsx)("button",{type:"button",className:"sekyro-glass","aria-label":t.t("native.close"),onClick:o,children:(0,e.jsx)(Y,{name:"close"})}),C?.torchAvailable?(0,e.jsx)("button",{type:"button",className:`sekyro-glass${C.torch?" is-on":""}`,"aria-label":t.t("doc.torchOn"),"aria-pressed":C.torch,onClick:c(()=>x.current?.setTorch(!C.torch),"onClick"),children:(0,e.jsx)(j,{name:"flashlight"})}):null]}),_!==null?(0,e.jsxs)("div",{className:"sekyro-lm-error",role:"alert",children:[(0,e.jsx)("p",{children:t.t("doc.cameraBlocked")}),(0,e.jsx)("p",{children:t.t(_.kind==="permission"?"doc.cameraBlockedHint":He(_.kind))}),(0,e.jsx)(O,{onClick:c(()=>{H(null),r.current+=1,x.current?.retry()},"onClick"),children:t.t("doc.retryCamera")})]}):null,b.manualShutter?(0,e.jsx)("button",{type:"button",className:"sekyro-shutter","aria-label":t.t("doc.shutter"),onClick:c(()=>x.current?.shutter(),"onClick")}):null,(0,e.jsx)("ol",{className:"sekyro-lm-tray",children:lt.map(({side:s,label:u})=>{let d=C?.captured.includes(s)??!1;return(0,e.jsxs)("li",{className:d?"is-done":void 0,"aria-current":!d&&(A||C?.expected===s)?"step":void 0,children:[d?(0,e.jsxs)("span",{className:"sekyro-lm-thumb",children:[D[s]!==void 0?(0,e.jsx)("img",{src:D[s],alt:""}):null,(0,e.jsx)("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,g(u)]},s)})}),f!==void 0?(0,e.jsx)("button",{type:"button",className:"sekyro-lm-upload",onClick:f,children:E(t).t("doc.uploadInstead")}):null,z==="uploading"||z==="checking"?null:(0,e.jsx)(Pe,{onStop:o})]}),z==="uploading"||z==="checking"?(0,e.jsx)("span",{className:"sekyro-visually-hidden",role:"status",children:z==="uploading"?t.t("doc.uploading"):g("native.scan.reading")}):null]})})}c(Qe,"Nt");h(Qe,"LumiereScan");function qe(a,t,n){return t?"single":a==="recto"||a==="verso"?a:n.recto===void 0?"recto":"verso"}c(qe,"Lt");h(qe,"slotOf");function Ze({x:a,y:t,w:n,h:o},r){return`M${a+r} ${t}H${a+n-r}Q${a+n} ${t} ${a+n} ${t+r}V${t+o-r}Q${a+n} ${t+o} ${a+n-r} ${t+o}H${a+r}Q${a} ${t+o} ${a} ${t+o-r}V${t+r}Q${a} ${t} ${a+r} ${t}Z`}c(Ze,"zt");h(Ze,"roundedRect");function Je(a){let t=Math.round(a.videoWidth/4),n=Math.round(a.videoHeight/4);if(t===0||n===0||typeof document>"u")return null;try{let o=document.createElement("canvas");o.width=t,o.height=n;let r=o.getContext("2d");return r===null?null:(r.drawImage(a,0,0,t,n),o.toDataURL("image/jpeg",.7))}catch{return null}}c(Je,"xt");h(Je,"sceneSnapshot");export{xt as DocumentCaptureView,Ct as LOCK_TRACE_MS,St as UPLOAD_ACCEPT,ve as guideRect,We as mrzInstruction,qe as slotOf};
1
+ "use client";import{a as Ge}from"./chunk-AGPBG22V.js";import{d as Be}from"./chunk-RMV3BNWO.js";import{a as Ie,b as Oe,c as Ee}from"./chunk-IBPUWYHJ.js";import"./chunk-B6A5RXN4.js";import{a as Ve}from"./chunk-EIRNIJXL.js";import"./chunk-6NQ7EWA4.js";import{E as Ae,F as Re,G as Pe,I as Ue,K as pe,L as me,a as ct,b as dt,c as O,o as He,q as De,v as Y,w as ue,y as he}from"./chunk-72JW2LCH.js";import{a as c,c as _e,i as h}from"./chunk-RPLVIGTS.js";var i=_e(ct(),1),e=_e(dt(),1);var ut={image:'<path d="M2 12C2 7.29 2 4.93 3.46 3.46C4.93 2 7.29 2 12 2C16.71 2 19.07 2 20.54 3.46C22 4.93 22 7.29 22 12C22 16.71 22 19.07 20.54 20.54C19.07 22 16.71 22 12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 12Z" stroke="currentColor"/><path d="M14 8A2 2 0 1 0 18 8A2 2 0 1 0 14 8Z" stroke="currentColor"/><path d="M2 12.5L3.75 10.97C4.66 10.17 6.04 10.22 6.89 11.07L11.18 15.36C11.87 16.05 12.95 16.14 13.75 15.58L14.04 15.37C15.19 14.57 16.74 14.66 17.78 15.6L21 18.5" stroke="currentColor" stroke-linecap="round"/>',flashlight:'<path d="M9 11.66V19C9 19.93 9 20.4 9.15 20.77C9.36 21.26 9.74 21.64 10.23 21.85C10.6 22 11.07 22 12 22C12.93 22 13.4 22 13.77 21.85C14.26 21.64 14.64 21.26 14.85 20.77C15 20.4 15 19.93 15 19V11.66C15 10.84 15 10.43 15.15 10.06C15.3 9.7 15.59 9.41 16.17 8.83L16.17 8.83L19.41 5.59C19.7 5.3 19.85 5.15 19.92 4.97C20 4.78 20 4.58 20 4.17V4C20 3.06 20 2.59 19.71 2.29C19.41 2 18.94 2 18 2H6C5.06 2 4.59 2 4.29 2.29C4 2.59 4 3.06 4 4V4.17C4 4.58 4 4.78 4.08 4.97C4.15 5.15 4.3 5.3 4.59 5.59L7.83 8.83C8.41 9.41 8.7 9.7 8.85 10.06C9 10.43 9 10.84 9 11.66Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 10H9" stroke="currentColor" stroke-linecap="round"/><path d="M12 13V15" stroke="currentColor" stroke-linecap="round"/><path d="M4.5 5H19.5" stroke="currentColor" stroke-linecap="round"/>'},ht={"dcv3.mrz.searching":"ضع صفحة جواز السفر كاملة داخل الإطار","dcv3.mrz.showMrzSide":"اعرض الوجه الذي يحتوي على سطرين أو ثلاثة أسطر من الحروف","dcv3.mrz.reading":"جارٍ قراءة الوثيقة… ثبّتها","dcv3.mrz.moveCloser":"اقترب حتى تملأ أسطر الحروف الإطار","dcv3.mrz.turnSideways":"أدر هاتفك أفقيًا لقراءة أسطر الحروف","dcv3.mrz.glare":"أمِل الوثيقة لإزالة الانعكاس","dcv3.mrz.holdStill":"لا تتحرك","dcv3.mrz.valid":"تمت قراءة الوثيقة. جارٍ التقاط الصورة","dcv3.mrz.looksLikePassport":"يبدو أن هذا جواز سفر","dcv3.mrz.looksLikeCard":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"},ee={"dcv3.mrz.searching":"Fit the whole passport page in the frame","dcv3.mrz.showMrzSide":"Show the side with the two or three lines of characters","dcv3.mrz.reading":"Reading the document… hold it steady","dcv3.mrz.moveCloser":"Move closer so the lines of characters fill the frame","dcv3.mrz.turnSideways":"Turn your phone sideways to read the lines of characters","dcv3.mrz.glare":"Tilt the document to remove the reflection","dcv3.mrz.holdStill":"Hold still","dcv3.mrz.valid":"Document read. Taking the photo","dcv3.mrz.looksLikePassport":"This looks like a passport","dcv3.mrz.looksLikeCard":"This looks like an identity card or residence permit"},pt={"dcv3.mrz.searching":"Cadrez toute la page du passeport","dcv3.mrz.showMrzSide":"Montrez la face avec les deux ou trois lignes de caractères","dcv3.mrz.reading":"Lecture du document… tenez-le immobile","dcv3.mrz.moveCloser":"Rapprochez-vous pour que les lignes de caractères remplissent le cadre","dcv3.mrz.turnSideways":"Tournez votre téléphone à l’horizontale pour lire les lignes de caractères","dcv3.mrz.glare":"Inclinez le document pour supprimer le reflet","dcv3.mrz.holdStill":"Ne bougez plus","dcv3.mrz.valid":"Document lu. Prise de la photo","dcv3.mrz.looksLikePassport":"Ceci ressemble à un passeport","dcv3.mrz.looksLikeCard":"Ceci ressemble à une carte d’identité ou un titre de séjour"},mt={"doc.uploadInstead":"رفع صورة بدلًا من ذلك","doc.uploadTitle":"ارفع صورة لوثيقتك","doc.uploadHint":"صورة واضحة للوثيقة كاملة، ملتقطة بكاميرا.","doc.uploadUnsupported":"اختر صورة للوثيقة بصيغة JPEG أو PNG أو HEIC.","doc.uploadFailed":"تعذّر إرسال هذه الصورة. أعد المحاولة.","doc.source.title":"كيف تريد إضافة وثيقتك؟","doc.source.description":"التقط صورة بالكاميرا، أو ارفع صورة للوثيقة من هذا الجهاز.","doc.source.camera":"التقاط صورة","doc.source.upload":"رفع صورة"},te={"doc.uploadInstead":"Upload a photo instead","doc.uploadTitle":"Upload a photo of your document","doc.uploadHint":"A clear photo of the whole document, taken with a camera.","doc.uploadUnsupported":"Choose a JPEG, PNG or HEIC photo of the document.","doc.uploadFailed":"We could not send this photo. Try again.","doc.source.title":"How do you want to add your document?","doc.source.description":"Take a photo with the camera, or upload a photo of the document from this device.","doc.source.camera":"Take a photo","doc.source.upload":"Upload a photo"},vt={"doc.uploadInstead":"Téléverser une photo à la place","doc.uploadTitle":"Téléversez une photo de votre document","doc.uploadHint":"Une photo nette du document entier, prise avec un appareil photo.","doc.uploadUnsupported":"Choisissez une photo JPEG, PNG ou HEIC du document.","doc.uploadFailed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","doc.source.title":"Comment voulez-vous ajouter votre document ?","doc.source.description":"Prenez une photo avec la caméra, ou importez une photo du document depuis cet appareil.","doc.source.camera":"Prendre une photo","doc.source.upload":"Importer une photo"},ft={"native.doc.introTitle":"سنلتقط صورة لوثيقتك","native.doc.introLead":"ستُفتح كاميرا هاتفك، وتُلتقط الصورة تلقائيًا بمجرد أن تكون الوثيقة داخل الإطار.","native.doc.tip.flat":"ضع الوثيقة مسطحة على سطح داكن.","native.doc.tip.glare":"تجنّب انعكاسات المصابيح أو الشمس.","native.doc.tip.frame":"أبقِ الوثيقة كاملة داخل الإطار.","native.doc.openCamera":"افتح الكاميرا","native.doc.changeDocument":"تغيير الوثيقة","native.scan.closer":"اقترب قليلًا","native.scan.farther":"ابتعد قليلًا","native.scan.glare":"أمِل البطاقة قليلًا","native.scan.dark":"الإضاءة ضعيفة. شغّل المصباح.","native.scan.blurry":"الصورة غير واضحة. ثبّت الهاتف.","native.scan.holdStill":"لا تتحرك","native.scan.reading":"جارٍ التحقق من وثيقتك…","native.scan.putDown":"يمكنك وضع وثيقتك جانبًا.","native.scan.retry":"لنحاول مرة أخرى"},ae={"native.doc.introTitle":"Photograph your document","native.doc.introLead":"Your phone's camera will open. The photo is taken by itself as soon as the document is well framed.","native.doc.tip.flat":"Lay the document flat on a dark surface.","native.doc.tip.glare":"Avoid glare from lamps or sunlight.","native.doc.tip.frame":"Keep the whole document in the frame.","native.doc.openCamera":"Open the camera","native.doc.changeDocument":"Change document","native.scan.closer":"Move a little closer","native.scan.farther":"Move back a little","native.scan.glare":"Tilt the card a little","native.scan.dark":"Too dark. Turn on the light.","native.scan.blurry":"Blurry image. Hold the phone still.","native.scan.holdStill":"Hold still","native.scan.reading":"Checking your document…","native.scan.putDown":"You can put your document down.","native.scan.retry":"Let's try that again"},kt={"native.doc.introTitle":"Photographiez votre pièce","native.doc.introLead":"La caméra de votre téléphone va s'ouvrir. La photo est prise automatiquement dès que la pièce est bien cadrée.","native.doc.tip.flat":"Posez la pièce à plat, sur une surface sombre.","native.doc.tip.glare":"Évitez les reflets de lampe ou de soleil.","native.doc.tip.frame":"Gardez toute la pièce dans le cadre.","native.doc.openCamera":"Ouvrir la caméra","native.doc.changeDocument":"Changer de document","native.scan.closer":"Approchez un peu","native.scan.farther":"Reculez un peu","native.scan.glare":"Inclinez un peu la carte","native.scan.dark":"Trop sombre. Allumez la lampe.","native.scan.blurry":"Image floue. Tenez le téléphone immobile.","native.scan.holdStill":"Ne bougez plus","native.scan.reading":"Vérification de votre document…","native.scan.putDown":"Vous pouvez poser votre pièce.","native.scan.retry":"Réessayons"},gt=["locking","capturing"],W,Ye=(W=class{constructor(){this.shown={hint:null,locking:!1,card:null,manualShutter:!1},this.candidate=null,this.candidateSince=0,this.hintShownAt=0,this.lockLostAt=null,this.detectedSince=null,this.lostSince=null,this.shutterSince=null}present(t,n){return this.presentHint(t,n),this.presentLock(t,n),this.presentCard(t,n),this.shutterSince=t.manualShutter?this.shutterSince??n:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&n-this.shutterSince>=1e3},this.shown}presentHint(t,n){let o=t.phase==="framing"&&!(t.hint==="blurry"&&t.card===null)?t.hint:null;if(t.phase!=="framing"){this.shown={...this.shown,hint:null},this.candidate=null;return}if(o!==this.candidate&&(this.candidate=o,this.candidateSince=n),o===this.shown.hint)return;let r=n-this.candidateSince>=(o===null?0:350),f=this.shown.hint===null||n-this.hintShownAt>=1200;r&&f&&(this.shown={...this.shown,hint:o},this.hintShownAt=n)}presentLock(t,n){if(gt.includes(t.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(t.phase!=="framing"){this.shown={...this.shown,locking:!1},this.lockLostAt=null;return}this.lockLostAt??(this.lockLostAt=n),n-this.lockLostAt>=300&&(this.shown={...this.shown,locking:!1},this.lockLostAt=null)}}presentCard(t,n){let o=t.card;if(o===null||t.phase!=="framing"){if(t.phase!=="framing"){this.shown={...this.shown,card:null},this.detectedSince=null,this.lostSince=null;return}this.detectedSince=null,this.lostSince??(this.lostSince=n),n-this.lostSince>=300&&(this.shown={...this.shown,card:null});return}if(this.lostSince=null,this.detectedSince??(this.detectedSince=n),n-this.detectedSince<250)return;let r=this.shown.card;if(r===null){this.shown={...this.shown,card:{...o}};return}let f=.35;this.shown={...this.shown,card:{fill:r.fill+(o.fill-r.fill)*f,offsetX:r.offsetX+(o.offsetX-r.offsetX)*f,offsetY:r.offsetY+(o.offsetY-r.offsetY)*f}}}},c(W,"fe"),W);h(Ye,"ScanPresenter");var yt=Ye,wt={en:ae,fr:kt,ar:ft,es:ae,pt:ae,de:ae},Ct=450,fe=h(a=>t=>Ve(a.strings[t]??wt[a.locale][t]??""),"useScanCopy");function j({name:a}){return(0,e.jsx)("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:ut[a]}})}c(j,"ae");h(j,"ScanGlyph");var zt={en:ee,fr:pt,ar:ht,es:ee,pt:ee,de:ee},bt={en:te,fr:vt,ar:mt,es:te,pt:te,de:te},St="image/jpeg,image/png,image/heic,image/heif";function E(a){let t=a.strings,n=h(o=>t[o]??bt[a.locale][o],"text");return{t:h(o=>n(o)??"","t")}}c(E,"F");h(E,"uploadCopy");function We(a,t){return a===null||a.state==="fallback"||a.state==="mismatch"?null:a.state==="searching"?t?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":a.state==="valid"?"dcv3.mrz.valid":a.coach!==void 0?`dcv3.mrz.${a.coach}`:"dcv3.mrz.reading"}c(We,"vt");h(We,"mrzInstruction");function ne(a){return a.reason==="unreadable"?"doc.reason_unreadable":a.reason==="tester_document_mismatch"?"reasons.tester_document_mismatch":a.reason!==void 0&&a.reason!=="side_missing"?De(a.reason):null}c(ne,"ve");h(ne,"reasonOf");var Nt=new Set(["document_type_not_accepted","tester_document_mismatch"]);function xt({step:a,i18n:t,liveMrz:n,ageLead:o,...r}){let[f,g]=(0,i.useState)(!1),y=(0,i.useRef)(-1),[v,k]=(0,i.useState)("idle"),w=(0,i.useRef)(null),x=typeof a.uploadDocument=="function",z=x?a.photo?.source??"camera":"camera",M=x&&z!=="camera"&&a.photo?.uploadOffered===!0,[C,V]=(0,i.useState)(null),_=z==="upload"?"upload":z==="choice"?C??a.photo?.pick??"source":"camera",H=v==="sending"?void 0:()=>w.current?.click(),m=h(async D=>{let q=D.currentTarget.files?.[0];if(D.currentTarget.value="",q!==void 0){g(!1),k("sending");try{await a.uploadDocument(q),k("idle")}catch(F){k(F instanceof TypeError&&F.message==="unsupported_file"?"unsupported":"failed")}}},"onFile"),Q=M?(0,e.jsx)("input",{ref:w,type:"file",accept:St,hidden:!0,"data-testid":"sekyro-doc-upload","aria-label":E(t).t("doc.uploadTitle"),onChange:c(D=>{m(D)},"onChange")}):null,b=E(t),X=a.photo?.cameraOnPhone===!0;return _==="camera"&&X?(0,e.jsx)(Be,{i18n:t,lead:t.t("handoff.lead.document"),refresh:a.refresh,actions:(0,e.jsx)(O,{kind:"ghost",full:!0,onClick:c(()=>V("upload"),"onClick"),children:b.t("doc.source.upload")})}):_==="source"?(0,e.jsx)(Ge,{testId:"sekyro-doc-source",title:b.t("doc.source.title"),lead:b.t("doc.source.description"),cameraLabel:X?t.t("capture.source.phone"):b.t("doc.source.camera"),onPhone:X,uploadLabel:b.t("doc.source.upload"),notice:(0,e.jsx)(oe,{step:a,i18n:t}),onCamera:c(()=>V("camera"),"onCamera"),onUpload:c(()=>V("upload"),"onUpload")}):_==="upload"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(je,{step:a,i18n:t,ageLead:o===!0,upload:v,offered:M,onPick:c(()=>w.current?.click(),"onPick"),...z==="choice"?{onCamera:h(()=>V("camera"),"onCamera")}:{},...r}),Q]}):(0,e.jsxs)(e.Fragment,{children:[f?(0,e.jsx)(Qe,{step:a,i18n:t,attempts:y,...n!==void 0?{liveMrz:n}:{},...M&&H!==void 0?{onUpload:H}:{},onClose:c(()=>g(!1),"onClose")}):(0,e.jsx)(Fe,{step:a,i18n:t,ageLead:o===!0,onOpen:c(()=>g(!0),"onOpen"),upload:v,...M&&H!==void 0?{onUpload:H}:{},...r}),Q]})}c(xt,"ln");h(xt,"DocumentCaptureView");function ke({passport:a}){let t=Math.round(228/(a?1.42:1.586));return(0,e.jsxs)("svg",{className:"sekyro-mark sekyro-mark--card",viewBox:`-12 -12 252 ${t+24}`,"aria-hidden":"true",focusable:"false",children:[(0,e.jsx)("defs",{children:(0,e.jsx)("clipPath",{id:"sekyro-card-clip",children:(0,e.jsx)("rect",{width:228,height:t,rx:"12.5"})})}),(0,e.jsx)("rect",{className:"sekyro-mark__card",width:228,height:t,rx:"12.5"}),(0,e.jsx)("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:t*.52,rx:"6"}),[0,1,2].map(n=>(0,e.jsx)("rect",{className:"sekyro-mark__text",x:"88",y:23+n*t*.12,width:100-n*20,height:"6",rx:"3"},n)),[0,1].map(n=>(0,e.jsx)("rect",{className:"sekyro-mark__text",x:"17",y:t*.74+n*9,width:194,height:"4",rx:"2"},n)),(0,e.jsx)("g",{clipPath:"url(#sekyro-card-clip)",children:(0,e.jsx)("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:(0,e.jsx)("rect",{x:"-1",width:"2",height:t,className:"sekyro-mark__beam"})})}),(0,e.jsx)("path",{className:"sekyro-mark__brackets",d:Xe(-10,-10,248,t+20,16,30)})]})}c(ke,"qe");h(ke,"ScanMark");function Xe(a,t,n,o,r,f){let g=Math.min(r,f*.6);return[[a,t,1,1],[a+n,t,-1,1],[a,t+o,1,-1],[a+n,t+o,-1,-1]].map(([y,v,k,w])=>`M${y} ${v+w*f}V${v+w*g}Q${y} ${v} ${y+k*g} ${v}H${y+k*f}`).join("")}c(Xe,"kt");h(Xe,"brackets");function Fe({step:a,i18n:t,ageLead:n,onOpen:o,onChangeCountry:r,onChangeDocument:f,upload:g,onUpload:y}){let v=fe(t),k=E(t),w=a.documentType==="passport",x=ne(a),z=g==="sending",M=(0,i.useContext)(Re)?.busy===!0;return(0,e.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-document",children:[(0,e.jsx)(ke,{passport:w}),(0,e.jsx)(ue,{title:v("native.doc.introTitle"),lead:n?t.t("doc.ageStepUp"):v("native.doc.introLead")}),(0,e.jsx)(oe,{step:a,i18n:t}),a.reason!==void 0&&Nt.has(a.reason)?null:(0,e.jsxs)("ul",{className:"sekyro-tiprows",children:[(0,e.jsxs)("li",{children:[(0,e.jsx)(Y,{name:w?"passport":"card"}),v("native.doc.tip.flat")]}),(0,e.jsxs)("li",{children:[(0,e.jsx)(Y,{name:"light"}),v("native.doc.tip.glare")]}),(0,e.jsxs)("li",{children:[(0,e.jsx)(j,{name:"image"}),v("native.doc.tip.frame")]})]}),(0,e.jsx)(ge,{i18n:t,...f!==void 0?{onChangeDocument:f}:{},...r!==void 0?{onChangeCountry:r}:{}}),(0,e.jsx)(ye,{i18n:t,upload:g}),z?(0,e.jsx)("p",{className:"sekyro-text-muted",role:"status",children:t.t("doc.uploading")}):y!==void 0?(0,e.jsx)("p",{className:"sekyro-text-muted",children:k.t("doc.uploadHint")}):null,(0,e.jsxs)(he,{children:[(0,e.jsxs)(O,{full:!0,onClick:o,disabled:z||M,children:[(0,e.jsx)(Y,{name:"camera"}),v("native.doc.openCamera")]}),y!==void 0?(0,e.jsxs)(O,{full:!0,kind:"ghost",onClick:y,children:[(0,e.jsx)(j,{name:"image"}),k.t("doc.uploadInstead")]}):null]})]})}c(Fe,"bt");h(Fe,"DocumentIntro");function oe({step:a,i18n:t}){let n=ne(a);return n===null?null:(0,e.jsxs)(pe,{tone:"warning",children:[(0,e.jsx)("span",{children:t.t(n)}),(0,e.jsx)("span",{children:me(t,a.attemptsRemaining,a.attemptsExhausted)})]})}c(oe,"ye");h(oe,"ReasonNotice");function ge({i18n:a,onChangeCountry:t,onChangeDocument:n}){let o=fe(a);return n===void 0&&t===void 0?null:(0,e.jsxs)("div",{className:"sekyro-links",children:[n!==void 0?(0,e.jsx)("button",{type:"button",className:"sekyro-link",onClick:n,children:o("native.doc.changeDocument")}):null,t!==void 0?(0,e.jsx)("button",{type:"button",className:"sekyro-link",onClick:t,children:a.t("native.doc.changeCountry")}):null]})}c(ge,"Je");h(ge,"ChangeLinks");function ye({i18n:a,upload:t}){return t!=="unsupported"&&t!=="failed"?null:(0,e.jsx)(pe,{tone:"warning",children:(0,e.jsx)("span",{children:E(a).t(t==="unsupported"?"doc.uploadUnsupported":"doc.uploadFailed")})})}c(ye,"et");h(ye,"UploadNotice");function je({step:a,i18n:t,ageLead:n,upload:o,offered:r,onPick:f,onCamera:g,onChangeCountry:y,onChangeDocument:v}){let k=E(t),w=o==="sending";return(0,e.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-doc-upload-screen",children:[(0,e.jsx)(ke,{passport:a.documentType==="passport"}),(0,e.jsx)(ue,{title:k.t("doc.uploadTitle"),lead:n?t.t("doc.ageStepUp"):k.t("doc.uploadHint")}),n?(0,e.jsx)("p",{className:"sekyro-text-muted",children:k.t("doc.uploadHint")}):null,(0,e.jsx)(oe,{step:a,i18n:t}),(0,e.jsx)(ge,{i18n:t,...v!==void 0?{onChangeDocument:v}:{},...y!==void 0?{onChangeCountry:y}:{}}),(0,e.jsx)(ye,{i18n:t,upload:o}),w?(0,e.jsx)("p",{className:"sekyro-text-muted",role:"status",children:t.t("doc.uploading")}):null,(0,e.jsxs)(he,{children:[(0,e.jsxs)(O,{full:!0,onClick:f,disabled:w||!r||a.attemptsExhausted,children:[(0,e.jsx)(j,{name:"image"}),k.t("doc.source.upload")]}),g!==void 0?(0,e.jsxs)(O,{full:!0,kind:"ghost",onClick:g,disabled:w,children:[(0,e.jsx)(Y,{name:"camera"}),k.t("doc.source.camera")]}):null]})]})}c(je,"wt");h(je,"DocumentUploadScreen");function ve(a,t,n){let o=a*.88,r=o/n;return{x:(a-o)/2,y:t*.42-r/2,w:o,h:r}}c(ve,"Qe");h(ve,"guideRect");var $t={too_far:"native.scan.closer",too_close:"native.scan.farther",focus_far:"native.scan.farther",glare:"native.scan.glare",too_bright:"native.scan.glare",too_dark:"native.scan.dark",blurry:"native.scan.blurry"},Lt=h(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function Qe({step:a,i18n:t,liveMrz:n,onClose:o,attempts:r,onUpload:f}){let g=fe(t),y=(0,i.useContext)(Ie),v=(0,i.useRef)(y);v.current=y;let k=(0,i.useRef)(null),w=(0,i.useRef)(null),x=(0,i.useRef)(null),[z,M]=(0,i.useState)("idle"),[C,V]=(0,i.useState)(null),[_,H]=(0,i.useState)(null),[m,Q]=(0,i.useState)({w:0,h:0}),[b,X]=(0,i.useState)({hint:null,locking:!1,card:null,manualShutter:!1}),[D,q]=(0,i.useState)({}),[F,Ke]=(0,i.useState)(null),[we,et]=(0,i.useState)(null),[Ce,ze]=(0,i.useState)(0),[be,Se]=(0,i.useState)(null),[Z,Ne]=(0,i.useState)(null),A=a.documentType==="passport",J=A?1.42:1.586;Ae(!0),(0,i.useLayoutEffect)(()=>{let s=k.current;if(s===null)return;let u=h(()=>Q({w:s.clientWidth,h:s.clientHeight}),"measure");if(u(),typeof ResizeObserver>"u")return;let d=new ResizeObserver(u);return d.observe(s),()=>d.disconnect()},[]);let l=ve(m.w,m.h,J);(0,i.useEffect)(()=>{m.w===0||m.h===0||x.current?.setGuide?.({viewAspect:m.w/m.h,rect:{x:l.x/m.w,y:l.y/m.h,width:l.w/m.w,height:l.h/m.h}})},[m.w,m.h,l.x,l.y,l.w,l.h]),(0,i.useEffect)(()=>{let s=w.current;if(s===null)return;let u=a.capture({video:s,...n!==void 0?{liveMrz:n}:{}});x.current=u;let d=k.current;if(d!==null&&d.clientWidth>0&&d.clientHeight>0){let p=ve(d.clientWidth,d.clientHeight,J);u.setGuide?.({viewAspect:d.clientWidth/d.clientHeight,rect:{x:p.x/d.clientWidth,y:p.y/d.clientHeight,width:p.w/d.clientWidth,height:p.h/d.clientHeight}})}let T=new yt,N={scan:null,feedback:null,gate:null},P=h(p=>{N={...N,...p};let L=N.gate?.guide,st={phase:N.scan?.phase??"framing",hint:N.feedback?.reticle==="coaching"?N.feedback.key:null,card:L?.detected?{fill:L.fill,offsetX:L.offsetX,offsetY:L.offsetY}:null,manualShutter:N.scan?.manualShutter??!1},U=T.present(st,performance.now());X(I=>I.hint===U.hint&&I.locking===U.locking&&I.manualShutter===U.manualShutter&&I.card?.fill===U.card?.fill&&I.card?.offsetX===U.card?.offsetX&&I.card?.offsetY===U.card?.offsetY?I:U)},"present"),it=[u.on("state",M),u.on("feedback",p=>P({feedback:p})),u.on("gate",p=>P({gate:p})),u.on("scan",p=>{V(p),P({scan:p})}),u.on("captured",p=>{q(L=>({...L,[qe(p.side,A,L)]:p.previewDataUrl})),Ke(p.previewDataUrl),et(Je(s))}),u.on("error",p=>{H(p);let L=v.current;L!==null&&Ee(L,Oe("document",p,Math.max(0,r.current)))}),u.on("mrz",p=>{p.state==="mismatch"?Ne(p.format??null):Se(p)})];return r.current+=1,u.start().catch(()=>{}),()=>{for(let p of it)p();u.destroy(),x.current=null}},[a.issuer,a.documentType]);let $=C?.phase??"framing",R=$==="reading"||$==="result",re=$==="flipCue"||$==="reaskRecto",B=b.locking,xe=C?.captured.length??0;(0,i.useEffect)(()=>{B&&ze(s=>s+1)},[B]),(0,i.useEffect)(()=>{xe>0&&ze(s=>s+1)},[xe]);let tt=C?.expected??null;(0,i.useEffect)(()=>{Se(null)},[tt]),(0,i.useEffect)(()=>{if(Z===null)return;let s=setTimeout(()=>Ne(null),2e3);return()=>clearTimeout(s)},[Z]);let $e=re||R?null:We(be,A),le=Z!==null?Z==="TD3"?"dcv3.mrz.looksLikePassport":"dcv3.mrz.looksLikeCard":$e,at=le===null?null:t.strings[le]??zt[t.locale][le],ie=ne(a),Le=b.hint===null?null:$t[b.hint]??`dcv2.${b.hint}`,nt=Le??($==="flipCue"?C?.notice==="same_face"?"doc.sameFace":"doc.flip":$==="reaskRecto"?"doc.reaskRecto":R?"native.scan.reading":$==="locking"||$==="capturing"||B?"native.scan.holdStill":C?.notice==="reread"?ie??"doc.reread":C?.notice==="technical"?"native.scan.retry":C?.notice==="blurry"?"native.scan.blurry":ie??(A?"doc.showPage":"doc.showSide")),se=at??g(nt),G=b.card,S=l;if(!B&&G!==null&&G.fill>=.45&&G.fill<=1.25&&!Lt()){let s=l.w*G.fill,u=s/J,d=l.x+l.w/2+l.w*Math.max(-.25,Math.min(.25,G.offsetX)),T=l.y+l.h/2+l.h*Math.max(-.25,Math.min(.25,G.offsetY));S={x:d-s/2,y:T-u/2,w:s,h:u}}let K=l.w*.045,ce=28,Me=Math.min(K,ce*.6),ot=[[S.x,S.y,1,1],[S.x+S.w,S.y,-1,1],[S.x,S.y+S.h,1,-1],[S.x+S.w,S.y+S.h,-1,-1]],rt=B?"is-locked":b.hint!==null?"is-coaching":"",lt=A?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],Te=l.y+l.h+48,de={insetInlineStart:l.x,insetBlockStart:l.y,inlineSize:l.w,blockSize:l.h,borderRadius:K};return(0,e.jsx)("section",{className:"sekyro-lm","aria-label":se,"data-testid":"sekyro-document",children:(0,e.jsxs)("div",{ref:k,className:`sekyro-lm-stage${R?" is-reading":""}${re?" is-flip":""}`,style:{"--sekyro-guide-w":`${l.w}px`},children:[(0,e.jsx)("video",{ref:w,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:c(s=>{let u=s.currentTarget,d=u.getBoundingClientRect(),T=Math.max(d.width/(u.videoWidth||1),d.height/(u.videoHeight||1)),N=u.videoWidth*T,P=u.videoHeight*T;N>0&&P>0&&x.current?.focusAt((s.clientX-d.left+(N-d.width)/2)/N,(s.clientY-d.top+(P-d.height)/2)/P)},"onPointerUp")}),m.w>0?(0,e.jsxs)(e.Fragment,{children:[R&&we!==null?(0,e.jsx)("img",{className:"sekyro-lm-scene",src:we,alt:""}):null,R&&F!==null?(0,e.jsx)("img",{className:"sekyro-lm-frozen",src:F,alt:"",style:de}):null,(0,e.jsxs)("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${m.w} ${m.h}`,"aria-hidden":"true",focusable:"false",children:[(0,e.jsxs)("defs",{children:[(0,e.jsxs)("linearGradient",{id:"sekyro-lm-top",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),(0,e.jsx)("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),(0,e.jsxs)("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),(0,e.jsx)("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),(0,e.jsx)("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${m.w}V${m.h}H0Z${Ze(l,K)}`}),(0,e.jsx)("rect",{width:m.w,height:Math.max(0,l.y),fill:"url(#sekyro-lm-top)"}),(0,e.jsx)("rect",{y:l.y+l.h,width:m.w,height:Math.max(0,m.h-l.y-l.h),fill:"url(#sekyro-lm-bottom)"}),(0,e.jsx)("g",{className:`sekyro-lm-brackets ${rt}`,children:ot.map(([s,u,d,T],N)=>(0,e.jsx)("path",{style:{transform:`translate(${s}px, ${u}px) scale(${d}, ${T})`},d:`M0 ${ce}V${Me}Q0 0 ${Me} 0H${ce}`},N))}),B?(0,e.jsx)("rect",{className:"sekyro-lm-trace",x:l.x,y:l.y,width:l.w,height:l.h,rx:K,pathLength:"1",style:{animationDuration:`${Ct}ms`}}):null]}),(0,e.jsx)("div",{className:"sekyro-lm-slot",style:de,"aria-hidden":"true",children:R?(0,e.jsx)("span",{className:"sekyro-lm-read is-repeating"}):Ce>0?(0,e.jsx)("span",{className:"sekyro-lm-read"},Ce):null})]}):null,$e!==null?(0,e.jsx)("div",{className:"sekyro-lm-slot",style:de,"aria-hidden":"true",children:(0,e.jsx)("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${A?" is-page":""}${be?.state==="valid"?" is-valid":""}`})}):null,(0,e.jsxs)("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:l.y-64},children:[(0,e.jsx)("div",{role:"status","aria-live":"polite",children:(0,e.jsx)(Ue,{swapKey:se,className:"sekyro-lm-line",children:se})}),ie!==null&&$==="framing"&&Le===null?(0,e.jsx)("p",{className:"sekyro-lm-attempts",children:me(t,a.attemptsRemaining,a.attemptsExhausted)}):null]}),R?(0,e.jsxs)("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:Te-12},children:[(0,e.jsx)("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),g("native.scan.putDown")]}):re?(0,e.jsx)("div",{className:`sekyro-lm-under sekyro-lm-flip${$==="reaskRecto"?" is-toFront":""}`,style:{insetBlockStart:Te-20},"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:(0,e.jsxs)("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(J)},children:[(0,e.jsx)("span",{className:"sekyro-lm-flip-front"}),(0,e.jsx)("span",{className:"sekyro-lm-flip-back"})]})}):null,(0,e.jsxs)("div",{className:"sekyro-lm-controls",children:[(0,e.jsxs)("div",{className:"sekyro-lm-bar",children:[(0,e.jsx)("button",{type:"button",className:"sekyro-glass","aria-label":t.t("native.close"),onClick:o,children:(0,e.jsx)(Y,{name:"close"})}),C?.torchAvailable?(0,e.jsx)("button",{type:"button",className:`sekyro-glass${C.torch?" is-on":""}`,"aria-label":t.t("doc.torchOn"),"aria-pressed":C.torch,onClick:c(()=>x.current?.setTorch(!C.torch),"onClick"),children:(0,e.jsx)(j,{name:"flashlight"})}):null]}),_!==null?(0,e.jsxs)("div",{className:"sekyro-lm-error",role:"alert",children:[(0,e.jsx)("p",{children:t.t("doc.cameraBlocked")}),(0,e.jsx)("p",{children:t.t(_.kind==="permission"?"doc.cameraBlockedHint":He(_.kind))}),(0,e.jsx)(O,{onClick:c(()=>{H(null),r.current+=1,x.current?.retry()},"onClick"),children:t.t("doc.retryCamera")})]}):null,b.manualShutter?(0,e.jsx)("button",{type:"button",className:"sekyro-shutter","aria-label":t.t("doc.shutter"),onClick:c(()=>x.current?.shutter(),"onClick")}):null,(0,e.jsx)("ol",{className:"sekyro-lm-tray",children:lt.map(({side:s,label:u})=>{let d=C?.captured.includes(s)??!1;return(0,e.jsxs)("li",{className:d?"is-done":void 0,"aria-current":!d&&(A||C?.expected===s)?"step":void 0,children:[d?(0,e.jsxs)("span",{className:"sekyro-lm-thumb",children:[D[s]!==void 0?(0,e.jsx)("img",{src:D[s],alt:""}):null,(0,e.jsx)("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,g(u)]},s)})}),f!==void 0?(0,e.jsx)("button",{type:"button",className:"sekyro-lm-upload",onClick:f,children:E(t).t("doc.uploadInstead")}):null,z==="uploading"||z==="checking"?null:(0,e.jsx)(Pe,{onStop:o})]}),z==="uploading"||z==="checking"?(0,e.jsx)("span",{className:"sekyro-visually-hidden",role:"status",children:z==="uploading"?t.t("doc.uploading"):g("native.scan.reading")}):null]})})}c(Qe,"Nt");h(Qe,"LumiereScan");function qe(a,t,n){return t?"single":a==="recto"||a==="verso"?a:n.recto===void 0?"recto":"verso"}c(qe,"Lt");h(qe,"slotOf");function Ze({x:a,y:t,w:n,h:o},r){return`M${a+r} ${t}H${a+n-r}Q${a+n} ${t} ${a+n} ${t+r}V${t+o-r}Q${a+n} ${t+o} ${a+n-r} ${t+o}H${a+r}Q${a} ${t+o} ${a} ${t+o-r}V${t+r}Q${a} ${t} ${a+r} ${t}Z`}c(Ze,"zt");h(Ze,"roundedRect");function Je(a){let t=Math.round(a.videoWidth/4),n=Math.round(a.videoHeight/4);if(t===0||n===0||typeof document>"u")return null;try{let o=document.createElement("canvas");o.width=t,o.height=n;let r=o.getContext("2d");return r===null?null:(r.drawImage(a,0,0,t,n),o.toDataURL("image/jpeg",.7))}catch{return null}}c(Je,"xt");h(Je,"sceneSnapshot");export{xt as DocumentCaptureView,Ct as LOCK_TRACE_MS,St as UPLOAD_ACCEPT,ve as guideRect,We as mrzInstruction,qe as slotOf};
@@ -1 +1 @@
1
- "use client";import{a as j,b as v,c as z}from"./chunk-TPIBYY2S.js";import{a as O,b as W,c as q}from"./chunk-WWGJDMZQ.js";import{a as U}from"./chunk-SEE6MST7.js";import{a as E}from"./chunk-43YHL2WG.js";import"./chunk-HSQWGTF7.js";import{H as T,K as R,a as te,b as oe,c as N,t as P,y as A}from"./chunk-JJNFGW3A.js";import{a as u,c as L,i as o}from"./chunk-RPLVIGTS.js";var a=L(te(),1),i=L(oe(),1);import{isValidNni as ce,normalizeNni as J}from"@sekyro/web";var K={en:v,fr:z,ar:j,es:v,pt:v,de:v},w=6,pe=new Set(["eid_identifier_invalid","eid_code_invalid","eid_locked","eid_not_enrolled"]),Q=o((e,d)=>{if(e===void 0)return 0;let h=Date.parse(e)-d;return Number.isFinite(h)?Math.max(0,Math.ceil(h/1e3)):0},"secondsUntil"),me=o(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss");function ue({step:e,i18n:d,className:h,onError:X}){let C=d.strings,r=o((n,t)=>E(C[n]??K[d.locale][n]??"",t),"t"),I=o((n,t)=>{let se=new Intl.PluralRules(d.locale).select(t),G=`${n}.${se}`,le=C[G]??K[d.locale][G]??r(`${n}.other`);return E(le,{count:new Intl.NumberFormat(d.locale).format(t)})},"plural"),y=o(n=>e.providerName?r(`eid.${n}`,{provider:e.providerName}):r(`eid.${n}Generic`),"named"),[B,Y]=(0,a.useState)(""),[f,_]=(0,a.useState)(""),[c,S]=(0,a.useState)(!1),[b,p]=(0,a.useState)(null),s=e.phase==="code",D=q(s),l=(0,a.useId)(),Z=P(),[ee,ie]=O(e.reason==="eid_code_invalid",e.codeAttemptsRemaining??0,()=>_("")),m=o(async n=>{S(!0),p(null);try{await n()}catch(t){p(U(t,d.strings)),X?.(t)}finally{S(!1)}},"run"),F=(0,a.useRef)(!1);(0,a.useEffect)(()=>{!e.identifierBound||s||e.reason!==void 0||F.current||(F.current=!0,m(()=>e.start()))},[e.identifierBound,s,e.reason]),(0,a.useEffect)(()=>{(e.reason==="eid_code_invalid"||e.codeExpiresAt!==void 0)&&_("")},[e.reason,e.codeExpiresAt,e.codeAttemptsRemaining]);let M=(0,a.useRef)(s);(0,a.useEffect)(()=>{s&&!M.current&&document.getElementById(`${l}-code`)?.focus(),M.current=s},[s,l]);let k=e.reason==="eid_locked",H=Q(e.codeExpiresAt,D),x=s&&e.codeExpiresAt!==void 0&&H===0,$=Q(e.resendAvailableAt,D),V=e.resendsRemaining===0||e.reason==="eid_resend_limit",ne=o(n=>{if(n.preventDefault(),s){f.length===w&&!k&&m(()=>e.verify(f));return}if(e.identifierBound){m(()=>e.start());return}let t=J(B);if(e.country==="MR"){if(!/^\d{10}$/.test(t))return p("population.invalid");if(!ce(t))return p("population.reason_nni_invalid")}m(()=>e.start(t))},"onSubmit"),g=e.reason?.startsWith("eid_")?e.reason:void 0,re=(0,i.jsxs)(i.Fragment,{children:[g!==void 0?(0,i.jsxs)(R,{tone:pe.has(g)?"danger":"warning",children:[(0,i.jsx)("span",{children:r(`reasons.${g}`)}),g==="eid_code_invalid"&&e.codeAttemptsRemaining!==void 0?(0,i.jsx)("span",{children:I("eid.codeAttemptsRemaining",e.codeAttemptsRemaining)}):null,e.canUseCamera?(0,i.jsx)(N,{kind:"secondary",disabled:c,onClick:u(()=>{m(()=>e.useCamera())},"onClick"),children:r("eid.useCamera")}):null]}):null,b!==null?(0,i.jsx)(R,{tone:"danger",children:(0,i.jsx)("span",{children:d.t(b)})}):null]}),[ae,de]=s?[y("codeTitle"),y("codeHelp")]:[y("identifierTitle"),y(e.identifierBound?"boundDescription":"identifierDescription")];return(0,i.jsxs)("form",{className:`sekyro-step sekyro-otp${h?` ${h}`:""}`,"aria-labelledby":l,onSubmit:ne,noValidate:!0,"data-testid":"sekyro-eid",children:[(0,i.jsxs)("div",{className:"sekyro-heading",children:[(0,i.jsx)("h2",{id:l,ref:Z,tabIndex:-1,className:"sekyro-text-body",children:ae}),(0,i.jsx)("p",{className:"sekyro-text-muted",children:s&&e.context.simulation!==void 0?(0,i.jsx)(T,{template:d.t("sandbox.otpHint"),code:e.context.simulation.otpCode}):de}),e.afterPass==="continue"?(0,i.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-eid-continue",children:e.providerName?r("eid.continueHint",{provider:e.providerName}):r("eid.continueHintGeneric")}):null]}),re,s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"sekyro-field",children:[(0,i.jsx)("label",{className:"sekyro-label",htmlFor:`${l}-code`,children:r("eid.codeLabel")}),k?(0,i.jsx)("input",{id:`${l}-code`,className:"sekyro-input sekyro-input--number",dir:"ltr",value:f,disabled:!0,readOnly:!0}):(0,i.jsx)(W,{id:`${l}-code`,value:f,length:w,invalid:ee,onChange:u(n=>{p(null),n!==""&&ie(),_(n)},"onChange")}),e.codeExpiresAt!==void 0?(0,i.jsx)("span",{className:`sekyro-help sekyro-otp-expiry${x?" is-danger":""}`,children:x?r("eid.expired"):r("eid.expiresIn",{time:me(H)})}):null]}),(0,i.jsx)("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:x?r("eid.expired"):""}),(0,i.jsxs)(A,{children:[(0,i.jsx)(N,{type:"submit",full:!0,disabled:c||f.length!==w||k,"aria-busy":c||void 0,children:r("eid.verify")}),(0,i.jsx)("div",{className:"sekyro-resend-row",children:V?(0,i.jsx)("p",{className:"sekyro-resend is-waiting",children:r("eid.noResendsLeft")}):(0,i.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:c||$>0||k,onClick:u(()=>{m(()=>e.resend())},"onClick"),children:$>0?r("eid.resendIn",{seconds:$}):r("eid.resend")})}),!V&&e.resendsRemaining!==void 0?(0,i.jsx)("p",{className:"sekyro-help sekyro-center",children:I("eid.resendsRemaining",e.resendsRemaining)}):null]})]}):(0,i.jsxs)(i.Fragment,{children:[e.identifierBound?null:(0,i.jsxs)("div",{className:"sekyro-field",children:[(0,i.jsx)("label",{className:"sekyro-label",htmlFor:`${l}-nni`,children:d.t("population.label")}),(0,i.jsx)("input",{id:`${l}-nni`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:d.t("population.placeholder"),value:B,"aria-describedby":`${l}-nni-help`,"aria-invalid":b==="population.invalid"||b==="population.reason_nni_invalid"||void 0,onChange:u(n=>{p(null),Y(J(n.target.value).replace(/\D/g,"").slice(0,10))},"onChange")}),(0,i.jsx)("span",{id:`${l}-nni-help`,className:"sekyro-help",children:d.t("population.helper")})]}),(0,i.jsx)(A,{children:(0,i.jsx)(N,{type:"submit",full:!0,disabled:c,"aria-busy":c||void 0,children:r("eid.start")})})]})]})}u(ue,"Ae");o(ue,"EidView");export{ue as EidView};
1
+ "use client";import{a as j,b as v,c as z}from"./chunk-TPIBYY2S.js";import{a as O,b as W,c as q}from"./chunk-ESSKMX7I.js";import{a as U}from"./chunk-SEE6MST7.js";import{a as E}from"./chunk-EIRNIJXL.js";import"./chunk-6NQ7EWA4.js";import{H as T,K as R,a as te,b as oe,c as N,t as P,y as A}from"./chunk-72JW2LCH.js";import{a as u,c as L,i as o}from"./chunk-RPLVIGTS.js";var a=L(te(),1),i=L(oe(),1);import{isValidNni as ce,normalizeNni as J}from"@sekyro/web";var K={en:v,fr:z,ar:j,es:v,pt:v,de:v},w=6,pe=new Set(["eid_identifier_invalid","eid_code_invalid","eid_locked","eid_not_enrolled"]),Q=o((e,d)=>{if(e===void 0)return 0;let h=Date.parse(e)-d;return Number.isFinite(h)?Math.max(0,Math.ceil(h/1e3)):0},"secondsUntil"),me=o(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss");function ue({step:e,i18n:d,className:h,onError:X}){let C=d.strings,r=o((n,t)=>E(C[n]??K[d.locale][n]??"",t),"t"),I=o((n,t)=>{let se=new Intl.PluralRules(d.locale).select(t),G=`${n}.${se}`,le=C[G]??K[d.locale][G]??r(`${n}.other`);return E(le,{count:new Intl.NumberFormat(d.locale).format(t)})},"plural"),y=o(n=>e.providerName?r(`eid.${n}`,{provider:e.providerName}):r(`eid.${n}Generic`),"named"),[B,Y]=(0,a.useState)(""),[f,_]=(0,a.useState)(""),[c,S]=(0,a.useState)(!1),[b,p]=(0,a.useState)(null),s=e.phase==="code",D=q(s),l=(0,a.useId)(),Z=P(),[ee,ie]=O(e.reason==="eid_code_invalid",e.codeAttemptsRemaining??0,()=>_("")),m=o(async n=>{S(!0),p(null);try{await n()}catch(t){p(U(t,d.strings)),X?.(t)}finally{S(!1)}},"run"),F=(0,a.useRef)(!1);(0,a.useEffect)(()=>{!e.identifierBound||s||e.reason!==void 0||F.current||(F.current=!0,m(()=>e.start()))},[e.identifierBound,s,e.reason]),(0,a.useEffect)(()=>{(e.reason==="eid_code_invalid"||e.codeExpiresAt!==void 0)&&_("")},[e.reason,e.codeExpiresAt,e.codeAttemptsRemaining]);let M=(0,a.useRef)(s);(0,a.useEffect)(()=>{s&&!M.current&&document.getElementById(`${l}-code`)?.focus(),M.current=s},[s,l]);let k=e.reason==="eid_locked",H=Q(e.codeExpiresAt,D),x=s&&e.codeExpiresAt!==void 0&&H===0,$=Q(e.resendAvailableAt,D),V=e.resendsRemaining===0||e.reason==="eid_resend_limit",ne=o(n=>{if(n.preventDefault(),s){f.length===w&&!k&&m(()=>e.verify(f));return}if(e.identifierBound){m(()=>e.start());return}let t=J(B);if(e.country==="MR"){if(!/^\d{10}$/.test(t))return p("population.invalid");if(!ce(t))return p("population.reason_nni_invalid")}m(()=>e.start(t))},"onSubmit"),g=e.reason?.startsWith("eid_")?e.reason:void 0,re=(0,i.jsxs)(i.Fragment,{children:[g!==void 0?(0,i.jsxs)(R,{tone:pe.has(g)?"danger":"warning",children:[(0,i.jsx)("span",{children:r(`reasons.${g}`)}),g==="eid_code_invalid"&&e.codeAttemptsRemaining!==void 0?(0,i.jsx)("span",{children:I("eid.codeAttemptsRemaining",e.codeAttemptsRemaining)}):null,e.canUseCamera?(0,i.jsx)(N,{kind:"secondary",disabled:c,onClick:u(()=>{m(()=>e.useCamera())},"onClick"),children:r("eid.useCamera")}):null]}):null,b!==null?(0,i.jsx)(R,{tone:"danger",children:(0,i.jsx)("span",{children:d.t(b)})}):null]}),[ae,de]=s?[y("codeTitle"),y("codeHelp")]:[y("identifierTitle"),y(e.identifierBound?"boundDescription":"identifierDescription")];return(0,i.jsxs)("form",{className:`sekyro-step sekyro-otp${h?` ${h}`:""}`,"aria-labelledby":l,onSubmit:ne,noValidate:!0,"data-testid":"sekyro-eid",children:[(0,i.jsxs)("div",{className:"sekyro-heading",children:[(0,i.jsx)("h2",{id:l,ref:Z,tabIndex:-1,className:"sekyro-text-body",children:ae}),(0,i.jsx)("p",{className:"sekyro-text-muted",children:s&&e.context.simulation!==void 0?(0,i.jsx)(T,{template:d.t("sandbox.otpHint"),code:e.context.simulation.otpCode}):de}),e.afterPass==="continue"?(0,i.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-eid-continue",children:e.providerName?r("eid.continueHint",{provider:e.providerName}):r("eid.continueHintGeneric")}):null]}),re,s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"sekyro-field",children:[(0,i.jsx)("label",{className:"sekyro-label",htmlFor:`${l}-code`,children:r("eid.codeLabel")}),k?(0,i.jsx)("input",{id:`${l}-code`,className:"sekyro-input sekyro-input--number",dir:"ltr",value:f,disabled:!0,readOnly:!0}):(0,i.jsx)(W,{id:`${l}-code`,value:f,length:w,invalid:ee,onChange:u(n=>{p(null),n!==""&&ie(),_(n)},"onChange")}),e.codeExpiresAt!==void 0?(0,i.jsx)("span",{className:`sekyro-help sekyro-otp-expiry${x?" is-danger":""}`,children:x?r("eid.expired"):r("eid.expiresIn",{time:me(H)})}):null]}),(0,i.jsx)("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:x?r("eid.expired"):""}),(0,i.jsxs)(A,{children:[(0,i.jsx)(N,{type:"submit",full:!0,disabled:c||f.length!==w||k,"aria-busy":c||void 0,children:r("eid.verify")}),(0,i.jsx)("div",{className:"sekyro-resend-row",children:V?(0,i.jsx)("p",{className:"sekyro-resend is-waiting",children:r("eid.noResendsLeft")}):(0,i.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:c||$>0||k,onClick:u(()=>{m(()=>e.resend())},"onClick"),children:$>0?r("eid.resendIn",{seconds:$}):r("eid.resend")})}),!V&&e.resendsRemaining!==void 0?(0,i.jsx)("p",{className:"sekyro-help sekyro-center",children:I("eid.resendsRemaining",e.resendsRemaining)}):null]})]}):(0,i.jsxs)(i.Fragment,{children:[e.identifierBound?null:(0,i.jsxs)("div",{className:"sekyro-field",children:[(0,i.jsx)("label",{className:"sekyro-label",htmlFor:`${l}-nni`,children:d.t("population.label")}),(0,i.jsx)("input",{id:`${l}-nni`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:d.t("population.placeholder"),value:B,"aria-describedby":`${l}-nni-help`,"aria-invalid":b==="population.invalid"||b==="population.reason_nni_invalid"||void 0,onChange:u(n=>{p(null),Y(J(n.target.value).replace(/\D/g,"").slice(0,10))},"onChange")}),(0,i.jsx)("span",{id:`${l}-nni-help`,className:"sekyro-help",children:d.t("population.helper")})]}),(0,i.jsx)(A,{children:(0,i.jsx)(N,{type:"submit",full:!0,disabled:c,"aria-busy":c||void 0,children:r("eid.start")})})]})]})}u(ue,"Ae");o(ue,"EidView");export{ue as EidView};
@@ -1 +1 @@
1
- "use client";import{a as G,b as J,c as K}from"./chunk-WWGJDMZQ.js";import{a as Y}from"./chunk-SEE6MST7.js";import{a as B}from"./chunk-43YHL2WG.js";import"./chunk-HSQWGTF7.js";import{A as F,H as j,K as f,L as U,a as de,b as me,c as N,w as P,y as E}from"./chunk-JJNFGW3A.js";import{a as p,c as q,i as n}from"./chunk-RPLVIGTS.js";var t=q(de(),1),e=q(me(),1);import{OtpInputError as pe}from"@sekyro/web";var ce={"emailOtp.reason_otp_daily_cap_reached":"لا يمكننا إرسال رمز إلى بريدك الإلكتروني اليوم. اختر طريقة أخرى للتحقق إن كانت متاحة، أو حاول مرة أخرى لاحقًا.","emailOtp.sendTitle":"تحقّق من بريدك الإلكتروني","emailOtp.sendDescription":"سنرسل إليك عبر البريد الإلكتروني رمزًا يُستخدم مرة واحدة لتأكيد أن هذا العنوان يخصّك","emailOtp.prefilledNotice":"سنرسل رمز تحقّق إلى بريدك الإلكتروني المسجّل.","emailOtp.emailLabel":"البريد الإلكتروني","emailOtp.emailHelper":"سنرسل رمزًا يُستخدم مرة واحدة إلى هذا العنوان","emailOtp.emailPlaceholder":"عنوان بريدك الإلكتروني","emailOtp.emailInvalid":"أدخل عنوان بريد إلكتروني صالحًا","emailOtp.send":"أرسل لي رمزًا عبر البريد الإلكتروني","emailOtp.verifyTitle":"أدخل الرمز","emailOtp.verifyDescription":"أدخل الرمز المكوّن من 6 أرقام الذي أرسلناه إلى بريدك الإلكتروني لإتمام التحقّق من عنوانك","emailOtp.sentTo":"أرسلنا رمزًا مكوّنًا من 6 أرقام إلى {email}","emailOtp.codeLabel":"رمز التحقّق","emailOtp.codeHelper":"أدخل الرمز المكوّن من 6 أرقام الوارد في الرسالة","emailOtp.verify":"تحقّق من الرمز","emailOtp.resend":"إعادة إرسال الرمز","emailOtp.resendIn":"إعادة إرسال الرمز خلال {seconds} ثانية","emailOtp.expiresIn":"ينتهي الرمز خلال {time}","emailOtp.expired":"انتهت صلاحية الرمز. أعد إرسال رمز جديد","emailOtp.reason_otp_mismatch":"الرمز غير صحيح. تحقّق منه وأعد إدخاله","emailOtp.reason_otp_expired":"انتهت صلاحية الرمز. أعد إرسال رمز جديد للمتابعة","emailOtp.reason_otp_send_failed":"تعذّر إرسال الرسالة. أعد المحاولة بعد قليل","emailOtp.reason_otp_rate_limited":"طلبت رموزًا كثيرة. انتظر قليلًا ثم أعد المحاولة","emailOtp.reason_email_invalid":"لا يمكننا الإرسال إلى هذا العنوان. تحقّق منه أو أدخل عنوانًا آخر","emailOtp.reason_email_disposable":"استخدم بريدًا إلكترونيًا دائمًا، وليس عنوانًا مؤقتًا","emailOtp.changeEmail":"تغيير البريد الإلكتروني","emailOtp.backToCode":"العودة إلى الرمز","emailOtp.reason_otp_resend_limit":"لا يمكنك طلب رموز أخرى. أدخل آخر رمز وصلك"},b={"emailOtp.reason_otp_daily_cap_reached":"We can't email you a code today. Choose another way to verify if one is offered, or try again later.","emailOtp.sendTitle":"Verify your email address","emailOtp.sendDescription":"We'll email you a one-time code to confirm this address is yours","emailOtp.prefilledNotice":"We'll send a verification code to your registered email address.","emailOtp.emailLabel":"Email address","emailOtp.emailHelper":"We'll send a one-time code to this address","emailOtp.emailPlaceholder":"Your email address","emailOtp.emailInvalid":"Enter a valid email address","emailOtp.send":"Email me a code","emailOtp.verifyTitle":"Enter the code","emailOtp.verifyDescription":"Type the 6-digit code we emailed you to finish verifying your address","emailOtp.sentTo":"We sent a 6-digit code to {email}","emailOtp.codeLabel":"Verification code","emailOtp.codeHelper":"Enter the 6-digit code from the email","emailOtp.verify":"Verify code","emailOtp.resend":"Resend code","emailOtp.resendIn":"Resend code in {seconds}s","emailOtp.expiresIn":"Code expires in {time}","emailOtp.expired":"That code has expired. Resend a new one","emailOtp.reason_otp_mismatch":"That code was incorrect. Check it and enter it again","emailOtp.reason_otp_expired":"That code has expired. Resend a new code to continue","emailOtp.reason_otp_send_failed":"We couldn't send the email. Try again in a moment","emailOtp.reason_otp_rate_limited":"Too many codes requested. Wait a moment, then try again","emailOtp.reason_email_invalid":"We can't send to this address. Check it or enter another one","emailOtp.reason_email_disposable":"Use a permanent email address, not a temporary one","emailOtp.changeEmail":"Change email","emailOtp.backToCode":"Back to code","emailOtp.reason_otp_resend_limit":"You can't get more codes. Enter the last code you received"},ue={"emailOtp.reason_otp_daily_cap_reached":"Nous ne pouvons pas vous envoyer de code par e-mail aujourd'hui. Choisissez une autre méthode si elle est proposée, ou réessayez plus tard.","emailOtp.sendTitle":"Vérifiez votre e-mail","emailOtp.sendDescription":"Nous vous enverrons par e-mail un code à usage unique pour confirmer que cette adresse vous appartient","emailOtp.prefilledNotice":"Nous enverrons un code de vérification à votre adresse e-mail enregistrée.","emailOtp.emailLabel":"Adresse e-mail","emailOtp.emailHelper":"Nous enverrons un code à usage unique à cette adresse","emailOtp.emailPlaceholder":"Votre adresse e-mail","emailOtp.emailInvalid":"Saisissez une adresse e-mail valide","emailOtp.send":"M'envoyer un code par e-mail","emailOtp.verifyTitle":"Saisissez le code","emailOtp.verifyDescription":"Saisissez le code à 6 chiffres que nous vous avons envoyé par e-mail pour finaliser la vérification de votre adresse","emailOtp.sentTo":"Nous avons envoyé un code à 6 chiffres à {email}","emailOtp.codeLabel":"Code de vérification","emailOtp.codeHelper":"Saisissez le code à 6 chiffres reçu par e-mail","emailOtp.verify":"Vérifier le code","emailOtp.resend":"Renvoyer le code","emailOtp.resendIn":"Renvoyer le code dans {seconds} s","emailOtp.expiresIn":"Le code expire dans {time}","emailOtp.expired":"Ce code a expiré. Renvoyez-en un nouveau","emailOtp.reason_otp_mismatch":"Ce code est incorrect. Vérifiez-le et saisissez-le à nouveau","emailOtp.reason_otp_expired":"Ce code a expiré. Renvoyez un nouveau code pour continuer","emailOtp.reason_otp_send_failed":"Nous n'avons pas pu envoyer l'e-mail. Réessayez dans un instant","emailOtp.reason_otp_rate_limited":"Trop de codes demandés. Patientez un instant, puis réessayez","emailOtp.reason_email_invalid":"Nous ne pouvons pas envoyer à cette adresse. Vérifiez-la ou saisissez-en une autre","emailOtp.reason_email_disposable":"Utilisez une adresse e-mail permanente, pas une adresse temporaire","emailOtp.changeEmail":"Changer d'adresse e-mail","emailOtp.backToCode":"Retour au code","emailOtp.reason_otp_resend_limit":"Vous ne pouvez plus demander de code. Saisissez le dernier code reçu"},Oe={en:b,fr:ue,ar:ce,es:b,pt:b,de:b},Q=n((a,o,O)=>{if(a===void 0)return 0;let h=Date.parse(a)-o;return Number.isFinite(h)?Math.min(O,Math.max(0,Math.ceil(h/1e3))):0},"secondsUntil"),he=600,ye=60,ve=n(a=>`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`,"mmss"),X=new Set(["otp_expired","otp_send_failed","otp_rate_limited","otp_resend_limit","email_invalid","email_disposable","otp_daily_cap_reached"]);function _e({step:a,i18n:o,className:O,defaultEmail:h="",onError:Z}){let i=n((l,s)=>B(o.strings[l]??Oe[o.locale][l],s),"t"),[C,ee]=(0,t.useState)(h),[y,T]=(0,t.useState)(""),[r,z]=(0,t.useState)(!1),[I,w]=(0,t.useState)(null),[k,c]=(0,t.useState)(!1),[R,ae]=(0,t.useState)(null),u=(0,t.useRef)(null),v=a.phase==="verify",m=v&&!k,V=K(v),d=(0,t.useId)(),[ie,le]=G(a.reason==="otp_mismatch",a.attemptsRemaining,()=>T("")),$=v?a.codeExpiresAt??"sent":null;(0,t.useEffect)(()=>{$!==null&&(c(!1),u.current!==null&&!X.has(a.reason??"")&&ae(u.current),u.current=null)},[$]);let S=n(async l=>{z(!0),w(null);try{await l()}catch(s){w(s instanceof pe&&s.field==="email"?i("emailOtp.emailInvalid"):o.t(Y(s,o.strings))),Z?.(s)}finally{z(!1)}},"run"),D=n(l=>{let s=a.needsEmail?l?R:C.trim():null;u.current=s,S(async()=>{try{await a.send(s!==null?{email:s}:{})}catch(oe){throw u.current=null,oe}})},"send"),L=n(l=>{S(()=>a.verify(l))},"submitCode"),te=n(l=>{l.preventDefault(),m?L(y):D(!1)},"onSubmit"),g=Q(a.codeExpiresAt,V,he),x=Q(a.resendAvailableAt,V,ye),_=m&&a.codeExpiresAt!==void 0&&g===0,A=a.needsEmail&&!a.attemptsExhausted,H=v&&(a.codeExpiresAt===void 0||g>0),W=m&&A?()=>c(!0):k&&H?()=>c(!1):null;F(W===null?null:r?()=>{}:W);let[se,re]=i("emailOtp.sentTo").split("{email}"),M=a.context.simulation?.otpCode,ne=a.reason==="otp_mismatch"?(0,e.jsxs)(f,{tone:"danger",children:[(0,e.jsx)("span",{children:i("emailOtp.reason_otp_mismatch")}),(0,e.jsx)("span",{children:U(o,a.attemptsRemaining,a.attemptsExhausted)})]}):a.reason!==void 0&&X.has(a.reason)?(0,e.jsx)(f,{tone:"warning",children:(0,e.jsx)("span",{children:i(`emailOtp.reason_${a.reason}`)})}):null;return(0,e.jsxs)("form",{className:`sekyro-step sekyro-otp${O?` ${O}`:""}`,"aria-labelledby":d,onSubmit:te,noValidate:!0,children:[(0,e.jsx)(P,{id:d,title:i(m?"emailOtp.verifyTitle":"emailOtp.sendTitle"),lead:m&&M!==void 0?(0,e.jsx)(j,{template:o.t("sandbox.otpHint"),code:M}):m?(0,e.jsxs)(e.Fragment,{children:[se,(0,e.jsx)("bdi",{dir:"ltr",className:"sekyro-mono",children:R??a.sentToMasked}),re]}):i("emailOtp.sendDescription")}),ne,I!==null?(0,e.jsx)(f,{tone:"danger",children:(0,e.jsx)("span",{children:I})}):null,m?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"sekyro-field",children:[(0,e.jsx)("label",{className:"sekyro-label",htmlFor:`${d}-code`,children:i("emailOtp.codeLabel")}),(0,e.jsx)(J,{id:`${d}-code`,value:y,invalid:ie,onChange:p(l=>{l!==""&&le(),T(l),l.length===6&&y.length!==6&&!r&&!a.attemptsExhausted&&L(l)},"onChange")}),(0,e.jsx)("span",{className:`sekyro-help sekyro-otp-expiry${_?" is-danger":""}`,"aria-hidden":!_||void 0,children:_?i("emailOtp.expired"):i("emailOtp.expiresIn",{time:ve(g)})})]}),(0,e.jsx)("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:_?i("emailOtp.expired"):""}),(0,e.jsxs)(E,{children:[(0,e.jsx)(N,{type:"submit",full:!0,disabled:r||y.length!==6,"aria-busy":r||void 0,children:i("emailOtp.verify")}),(0,e.jsxs)("div",{className:"sekyro-resend-row",children:[(0,e.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:r||x>0,onClick:p(()=>D(!0),"onClick"),children:x>0?i("emailOtp.resendIn",{seconds:x}):i("emailOtp.resend")}),A?(0,e.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:r,onClick:p(()=>c(!0),"onClick"),"data-testid":"sekyro-otp-change",children:i("emailOtp.changeEmail")}):null]})]})]}):(0,e.jsxs)(e.Fragment,{children:[a.needsEmail?(0,e.jsxs)("div",{className:"sekyro-field",children:[(0,e.jsx)("label",{className:"sekyro-label",htmlFor:`${d}-email`,children:i("emailOtp.emailLabel")}),(0,e.jsx)("input",{id:`${d}-email`,className:"sekyro-input",type:"email",dir:"ltr",inputMode:"email",autoComplete:"email",autoCapitalize:"none",spellCheck:!1,placeholder:i("emailOtp.emailPlaceholder"),value:C,"aria-describedby":`${d}-email-help`,onChange:p(l=>ee(l.target.value),"onChange")}),(0,e.jsx)("span",{id:`${d}-email-help`,className:"sekyro-help",children:i("emailOtp.emailHelper")})]}):(0,e.jsx)("p",{className:"sekyro-text-muted",children:i("emailOtp.prefilledNotice")}),(0,e.jsxs)(E,{children:[(0,e.jsx)(N,{type:"submit",full:!0,disabled:r,"aria-busy":r||void 0,children:i("emailOtp.send")}),k&&H?(0,e.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:r,onClick:p(()=>c(!1),"onClick"),"data-testid":"sekyro-otp-back-to-code",children:i("emailOtp.backToCode")}):null]})]})]})}p(_e,"Ae");n(_e,"EmailOtpView");export{_e as EmailOtpView};
1
+ "use client";import{a as G,b as J,c as K}from"./chunk-ESSKMX7I.js";import{a as Y}from"./chunk-SEE6MST7.js";import{a as B}from"./chunk-EIRNIJXL.js";import"./chunk-6NQ7EWA4.js";import{A as F,H as j,K as f,L as U,a as de,b as me,c as N,w as P,y as E}from"./chunk-72JW2LCH.js";import{a as p,c as q,i as n}from"./chunk-RPLVIGTS.js";var t=q(de(),1),e=q(me(),1);import{OtpInputError as pe}from"@sekyro/web";var ce={"emailOtp.reason_otp_daily_cap_reached":"لا يمكننا إرسال رمز إلى بريدك الإلكتروني اليوم. اختر طريقة أخرى للتحقق إن كانت متاحة، أو حاول مرة أخرى لاحقًا.","emailOtp.sendTitle":"تحقّق من بريدك الإلكتروني","emailOtp.sendDescription":"سنرسل إليك عبر البريد الإلكتروني رمزًا يُستخدم مرة واحدة لتأكيد أن هذا العنوان يخصّك","emailOtp.prefilledNotice":"سنرسل رمز تحقّق إلى بريدك الإلكتروني المسجّل.","emailOtp.emailLabel":"البريد الإلكتروني","emailOtp.emailHelper":"سنرسل رمزًا يُستخدم مرة واحدة إلى هذا العنوان","emailOtp.emailPlaceholder":"عنوان بريدك الإلكتروني","emailOtp.emailInvalid":"أدخل عنوان بريد إلكتروني صالحًا","emailOtp.send":"أرسل لي رمزًا عبر البريد الإلكتروني","emailOtp.verifyTitle":"أدخل الرمز","emailOtp.verifyDescription":"أدخل الرمز المكوّن من 6 أرقام الذي أرسلناه إلى بريدك الإلكتروني لإتمام التحقّق من عنوانك","emailOtp.sentTo":"أرسلنا رمزًا مكوّنًا من 6 أرقام إلى {email}","emailOtp.codeLabel":"رمز التحقّق","emailOtp.codeHelper":"أدخل الرمز المكوّن من 6 أرقام الوارد في الرسالة","emailOtp.verify":"تحقّق من الرمز","emailOtp.resend":"إعادة إرسال الرمز","emailOtp.resendIn":"إعادة إرسال الرمز خلال {seconds} ثانية","emailOtp.expiresIn":"ينتهي الرمز خلال {time}","emailOtp.expired":"انتهت صلاحية الرمز. أعد إرسال رمز جديد","emailOtp.reason_otp_mismatch":"الرمز غير صحيح. تحقّق منه وأعد إدخاله","emailOtp.reason_otp_expired":"انتهت صلاحية الرمز. أعد إرسال رمز جديد للمتابعة","emailOtp.reason_otp_send_failed":"تعذّر إرسال الرسالة. أعد المحاولة بعد قليل","emailOtp.reason_otp_rate_limited":"طلبت رموزًا كثيرة. انتظر قليلًا ثم أعد المحاولة","emailOtp.reason_email_invalid":"لا يمكننا الإرسال إلى هذا العنوان. تحقّق منه أو أدخل عنوانًا آخر","emailOtp.reason_email_disposable":"استخدم بريدًا إلكترونيًا دائمًا، وليس عنوانًا مؤقتًا","emailOtp.changeEmail":"تغيير البريد الإلكتروني","emailOtp.backToCode":"العودة إلى الرمز","emailOtp.reason_otp_resend_limit":"لا يمكنك طلب رموز أخرى. أدخل آخر رمز وصلك"},b={"emailOtp.reason_otp_daily_cap_reached":"We can't email you a code today. Choose another way to verify if one is offered, or try again later.","emailOtp.sendTitle":"Verify your email address","emailOtp.sendDescription":"We'll email you a one-time code to confirm this address is yours","emailOtp.prefilledNotice":"We'll send a verification code to your registered email address.","emailOtp.emailLabel":"Email address","emailOtp.emailHelper":"We'll send a one-time code to this address","emailOtp.emailPlaceholder":"Your email address","emailOtp.emailInvalid":"Enter a valid email address","emailOtp.send":"Email me a code","emailOtp.verifyTitle":"Enter the code","emailOtp.verifyDescription":"Type the 6-digit code we emailed you to finish verifying your address","emailOtp.sentTo":"We sent a 6-digit code to {email}","emailOtp.codeLabel":"Verification code","emailOtp.codeHelper":"Enter the 6-digit code from the email","emailOtp.verify":"Verify code","emailOtp.resend":"Resend code","emailOtp.resendIn":"Resend code in {seconds}s","emailOtp.expiresIn":"Code expires in {time}","emailOtp.expired":"That code has expired. Resend a new one","emailOtp.reason_otp_mismatch":"That code was incorrect. Check it and enter it again","emailOtp.reason_otp_expired":"That code has expired. Resend a new code to continue","emailOtp.reason_otp_send_failed":"We couldn't send the email. Try again in a moment","emailOtp.reason_otp_rate_limited":"Too many codes requested. Wait a moment, then try again","emailOtp.reason_email_invalid":"We can't send to this address. Check it or enter another one","emailOtp.reason_email_disposable":"Use a permanent email address, not a temporary one","emailOtp.changeEmail":"Change email","emailOtp.backToCode":"Back to code","emailOtp.reason_otp_resend_limit":"You can't get more codes. Enter the last code you received"},ue={"emailOtp.reason_otp_daily_cap_reached":"Nous ne pouvons pas vous envoyer de code par e-mail aujourd'hui. Choisissez une autre méthode si elle est proposée, ou réessayez plus tard.","emailOtp.sendTitle":"Vérifiez votre e-mail","emailOtp.sendDescription":"Nous vous enverrons par e-mail un code à usage unique pour confirmer que cette adresse vous appartient","emailOtp.prefilledNotice":"Nous enverrons un code de vérification à votre adresse e-mail enregistrée.","emailOtp.emailLabel":"Adresse e-mail","emailOtp.emailHelper":"Nous enverrons un code à usage unique à cette adresse","emailOtp.emailPlaceholder":"Votre adresse e-mail","emailOtp.emailInvalid":"Saisissez une adresse e-mail valide","emailOtp.send":"M'envoyer un code par e-mail","emailOtp.verifyTitle":"Saisissez le code","emailOtp.verifyDescription":"Saisissez le code à 6 chiffres que nous vous avons envoyé par e-mail pour finaliser la vérification de votre adresse","emailOtp.sentTo":"Nous avons envoyé un code à 6 chiffres à {email}","emailOtp.codeLabel":"Code de vérification","emailOtp.codeHelper":"Saisissez le code à 6 chiffres reçu par e-mail","emailOtp.verify":"Vérifier le code","emailOtp.resend":"Renvoyer le code","emailOtp.resendIn":"Renvoyer le code dans {seconds} s","emailOtp.expiresIn":"Le code expire dans {time}","emailOtp.expired":"Ce code a expiré. Renvoyez-en un nouveau","emailOtp.reason_otp_mismatch":"Ce code est incorrect. Vérifiez-le et saisissez-le à nouveau","emailOtp.reason_otp_expired":"Ce code a expiré. Renvoyez un nouveau code pour continuer","emailOtp.reason_otp_send_failed":"Nous n'avons pas pu envoyer l'e-mail. Réessayez dans un instant","emailOtp.reason_otp_rate_limited":"Trop de codes demandés. Patientez un instant, puis réessayez","emailOtp.reason_email_invalid":"Nous ne pouvons pas envoyer à cette adresse. Vérifiez-la ou saisissez-en une autre","emailOtp.reason_email_disposable":"Utilisez une adresse e-mail permanente, pas une adresse temporaire","emailOtp.changeEmail":"Changer d'adresse e-mail","emailOtp.backToCode":"Retour au code","emailOtp.reason_otp_resend_limit":"Vous ne pouvez plus demander de code. Saisissez le dernier code reçu"},Oe={en:b,fr:ue,ar:ce,es:b,pt:b,de:b},Q=n((a,o,O)=>{if(a===void 0)return 0;let h=Date.parse(a)-o;return Number.isFinite(h)?Math.min(O,Math.max(0,Math.ceil(h/1e3))):0},"secondsUntil"),he=600,ye=60,ve=n(a=>`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`,"mmss"),X=new Set(["otp_expired","otp_send_failed","otp_rate_limited","otp_resend_limit","email_invalid","email_disposable","otp_daily_cap_reached"]);function _e({step:a,i18n:o,className:O,defaultEmail:h="",onError:Z}){let i=n((l,s)=>B(o.strings[l]??Oe[o.locale][l],s),"t"),[C,ee]=(0,t.useState)(h),[y,T]=(0,t.useState)(""),[r,z]=(0,t.useState)(!1),[I,w]=(0,t.useState)(null),[k,c]=(0,t.useState)(!1),[R,ae]=(0,t.useState)(null),u=(0,t.useRef)(null),v=a.phase==="verify",m=v&&!k,V=K(v),d=(0,t.useId)(),[ie,le]=G(a.reason==="otp_mismatch",a.attemptsRemaining,()=>T("")),$=v?a.codeExpiresAt??"sent":null;(0,t.useEffect)(()=>{$!==null&&(c(!1),u.current!==null&&!X.has(a.reason??"")&&ae(u.current),u.current=null)},[$]);let S=n(async l=>{z(!0),w(null);try{await l()}catch(s){w(s instanceof pe&&s.field==="email"?i("emailOtp.emailInvalid"):o.t(Y(s,o.strings))),Z?.(s)}finally{z(!1)}},"run"),D=n(l=>{let s=a.needsEmail?l?R:C.trim():null;u.current=s,S(async()=>{try{await a.send(s!==null?{email:s}:{})}catch(oe){throw u.current=null,oe}})},"send"),L=n(l=>{S(()=>a.verify(l))},"submitCode"),te=n(l=>{l.preventDefault(),m?L(y):D(!1)},"onSubmit"),g=Q(a.codeExpiresAt,V,he),x=Q(a.resendAvailableAt,V,ye),_=m&&a.codeExpiresAt!==void 0&&g===0,A=a.needsEmail&&!a.attemptsExhausted,H=v&&(a.codeExpiresAt===void 0||g>0),W=m&&A?()=>c(!0):k&&H?()=>c(!1):null;F(W===null?null:r?()=>{}:W);let[se,re]=i("emailOtp.sentTo").split("{email}"),M=a.context.simulation?.otpCode,ne=a.reason==="otp_mismatch"?(0,e.jsxs)(f,{tone:"danger",children:[(0,e.jsx)("span",{children:i("emailOtp.reason_otp_mismatch")}),(0,e.jsx)("span",{children:U(o,a.attemptsRemaining,a.attemptsExhausted)})]}):a.reason!==void 0&&X.has(a.reason)?(0,e.jsx)(f,{tone:"warning",children:(0,e.jsx)("span",{children:i(`emailOtp.reason_${a.reason}`)})}):null;return(0,e.jsxs)("form",{className:`sekyro-step sekyro-otp${O?` ${O}`:""}`,"aria-labelledby":d,onSubmit:te,noValidate:!0,children:[(0,e.jsx)(P,{id:d,title:i(m?"emailOtp.verifyTitle":"emailOtp.sendTitle"),lead:m&&M!==void 0?(0,e.jsx)(j,{template:o.t("sandbox.otpHint"),code:M}):m?(0,e.jsxs)(e.Fragment,{children:[se,(0,e.jsx)("bdi",{dir:"ltr",className:"sekyro-mono",children:R??a.sentToMasked}),re]}):i("emailOtp.sendDescription")}),ne,I!==null?(0,e.jsx)(f,{tone:"danger",children:(0,e.jsx)("span",{children:I})}):null,m?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"sekyro-field",children:[(0,e.jsx)("label",{className:"sekyro-label",htmlFor:`${d}-code`,children:i("emailOtp.codeLabel")}),(0,e.jsx)(J,{id:`${d}-code`,value:y,invalid:ie,onChange:p(l=>{l!==""&&le(),T(l),l.length===6&&y.length!==6&&!r&&!a.attemptsExhausted&&L(l)},"onChange")}),(0,e.jsx)("span",{className:`sekyro-help sekyro-otp-expiry${_?" is-danger":""}`,"aria-hidden":!_||void 0,children:_?i("emailOtp.expired"):i("emailOtp.expiresIn",{time:ve(g)})})]}),(0,e.jsx)("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:_?i("emailOtp.expired"):""}),(0,e.jsxs)(E,{children:[(0,e.jsx)(N,{type:"submit",full:!0,disabled:r||y.length!==6,"aria-busy":r||void 0,children:i("emailOtp.verify")}),(0,e.jsxs)("div",{className:"sekyro-resend-row",children:[(0,e.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:r||x>0,onClick:p(()=>D(!0),"onClick"),children:x>0?i("emailOtp.resendIn",{seconds:x}):i("emailOtp.resend")}),A?(0,e.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:r,onClick:p(()=>c(!0),"onClick"),"data-testid":"sekyro-otp-change",children:i("emailOtp.changeEmail")}):null]})]})]}):(0,e.jsxs)(e.Fragment,{children:[a.needsEmail?(0,e.jsxs)("div",{className:"sekyro-field",children:[(0,e.jsx)("label",{className:"sekyro-label",htmlFor:`${d}-email`,children:i("emailOtp.emailLabel")}),(0,e.jsx)("input",{id:`${d}-email`,className:"sekyro-input",type:"email",dir:"ltr",inputMode:"email",autoComplete:"email",autoCapitalize:"none",spellCheck:!1,placeholder:i("emailOtp.emailPlaceholder"),value:C,"aria-describedby":`${d}-email-help`,onChange:p(l=>ee(l.target.value),"onChange")}),(0,e.jsx)("span",{id:`${d}-email-help`,className:"sekyro-help",children:i("emailOtp.emailHelper")})]}):(0,e.jsx)("p",{className:"sekyro-text-muted",children:i("emailOtp.prefilledNotice")}),(0,e.jsxs)(E,{children:[(0,e.jsx)(N,{type:"submit",full:!0,disabled:r,"aria-busy":r||void 0,children:i("emailOtp.send")}),k&&H?(0,e.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:r,onClick:p(()=>c(!1),"onClick"),"data-testid":"sekyro-otp-back-to-code",children:i("emailOtp.backToCode")}):null]})]})]})}p(_e,"Ae");n(_e,"EmailOtpView");export{_e as EmailOtpView};
@@ -0,0 +1 @@
1
+ "use client";import{a as S,e as V,f as X,g as H,h as T,i as ee,j as te,l as re}from"./chunk-7URX73UH.js";import"./chunk-IGC6OQZ2.js";import"./chunk-IBPUWYHJ.js";import{a as z}from"./chunk-B6A5RXN4.js";import{a as ae,b as _,c as oe}from"./chunk-TPIBYY2S.js";import{a as J}from"./chunk-SEE6MST7.js";import{a as q}from"./chunk-EIRNIJXL.js";import"./chunk-6NQ7EWA4.js";import{K as x,a as ze,b as Ge,c as N,t as B,v as D,w as K,y as L}from"./chunk-72JW2LCH.js";import{a as y,c as Q,i as m}from"./chunk-RPLVIGTS.js";var v=Q(ze(),1),c=Q(Ge(),1);import{HostedApiError as ie}from"@sekyro/web";import{detectIsMobile as se}from"@sekyro/web/core";var xe={"consent.human.terms.intro":"تؤكد Sekyro AI أن شخصًا حقيقيًا يُجري هذه الخطوة، نيابةً عن الجهة التي طلبتها.","consent.human.terms.data":"تلتقط Sekyro AI تسجيلًا قصيرًا لوجهك.","consent.human.terms.processing":"يُفحص هذا التسجيل للتأكد من أنك شخص حقيقي وحاضر، وقد يُقارَن بالوجوه التي سبق التحقق منها لدى هذه الجهة.","consent.human.terms.sharing":"تُبلَّغ الجهة التي طلبت هذا التحقق بنتيجته.","consent.human.terms.retention":"تُخزَّن بياناتك مشفّرة ولا يُحتفظ بها إلا للمدة التي يقتضيها القانون وإعدادات الجهة. لممارسة حقوقك المتعلقة بحماية البيانات، تواصل مع الجهة التي طلبت هذا التحقق.","capture.noCamera.title":"تتطلب هذه الخطوة كاميرا","capture.noCamera.body":"اسمح بالوصول إلى الكاميرا وحاول مرة أخرى، أو تابع على هاتف مزوّد بكاميرا.","capture.noCamera.continue":"المتابعة بدون كاميرا","capture.noCamera.deniedTitle":"اسمح بالوصول إلى الكاميرا","capture.noCamera.deniedBody":"حظر متصفحك الوصول إلى الكاميرا في هذه الصفحة. اسمح به من إعدادات الموقع ثم أعد المحاولة.","choice.title":"كيف تريد المتابعة؟","choice.description":"اختر خيارًا واحدًا.","choice.switch":"استخدم خيارًا آخر","contact.title":"كيف تريد استلام الرمز؟","contact.description":"اختر خيارًا واحدًا.","contact.phone":"عبر الهاتف (واتساب أو رسالة نصية)","contact.email":"عبر البريد الإلكتروني","contact.switch":"استخدم خيارًا آخر","summary.title":"تحقق من بياناتك","summary.description":"تأكد من أن هذه بياناتك قبل الصورة الحية.","summary.fullName":"الاسم الكامل","summary.birthDate":"تاريخ الميلاد","summary.nationality":"الجنسية","summary.documentType":"الوثيقة","summary.documentNumber":"رقم الوثيقة","summary.nni":"الرقم الوطني للتعريف الموريتاني (NNI)","summary.id_number":"رقم الهوية","summary.expiryDate":"تاريخ الانتهاء","summary.portraitAlt":"الصورة المسجلة","summary.source.registry":"من سجل الحالة المدنية","summary.source.document":"مقروءة من وثيقتك","summary.source.chip":"مقروءة من شريحة وثيقتك","summary.name":"الاسم","summary.birthYear":"سنة الميلاد","summary.confirm":"تأكيد ومتابعة","summary.retakeDocument":"مسح وثيقتي مرة أخرى","summary.retakeNationalNumber":"إدخال رقمي مرة أخرى","summary.noRetake":"لم يعد بإمكانك إعادة المحاولة. تواصل مع {org} إذا كانت هذه البيانات غير صحيحة","capture.tipsIcao.title":"لصورة الهوية:","capture.tipsIcao.glasses":"انزع نظارتك","capture.tipsIcao.headwear":"انزع القبعة. يُقبل غطاء الرأس الديني إذا كان الوجه ظاهرًا بالكامل","capture.tipsIcao.expression":"حافظ على تعبير محايد وفمك مغلق","capture.tipsIcao.faceCamera":"انظر مباشرة إلى الكاميرا وعيناك مفتوحتان","capture.tipsIcao.background":"قف أمام خلفية سادة فاتحة اللون","capture.tipsIcao.lighting":"استخدم إضاءة متساوية على وجهك: دون ظلال","capture.tipsIcao.hair":"أبعد شعرك عن وجهك وعينيك","capture.tipsIcao.summary":"قف أمام جدار سادة فاتح اللون مع إضاءة متساوية على وجهك. انزع نظارتك وأي قبعة. أبعد شعرك عن وجهك، وانظر مباشرة إلى الكاميرا وعيناك مفتوحتان، وحافظ على تعبير محايد وفمك مغلق، وابقَ ثابتًا.","portrait.retakeOnly":"نجح التحقق الحي. الصورة فقط تحتاج إلى محاولة أخرى","portrait.keepCamera":"ابقَ أمام الكاميرا","handoff.description":"امسح الرمز بهاتفك للمتابعة","handoff.qrAlt":"رمز QR يفتح عملية التحقق هذه على هاتفك","handoff.copyLink":"نسخ الرابط","handoff.copyFailed":"تعذّر نسخ الرابط. انسخ عنوان هذه الصفحة من متصفحك بدلًا من ذلك","handoff.waiting":"ستنتقل هذه الصفحة تلقائيًا بعد أن تُكمل الخطوة على هاتفك","inApp.title":"افتح الصفحة في متصفحك","inApp.description":"لا تعمل الكاميرا جيدًا داخل هذا التطبيق. افتح الرابط في Chrome أو Safari للمتابعة.","inApp.copyLink":"نسخ الرابط","inApp.copied":"تم نسخ الرابط. الصقه في متصفحك","inApp.copyFailed":"تعذّر نسخ الرابط. انسخ عنوان هذه الصفحة بدلًا من ذلك","inApp.continueAnyway":"المتابعة هنا على أي حال","inApp.openBrowser":"افتح في المتصفح","testerGate.action":"إجراء فحوصات حقيقية بصفتي مختبِرًا","testerGate.title":"إجراء فحوصات حقيقية بصفتي مختبِرًا","testerGate.body":"انظر إلى الكاميرا. إذا تطابق وجهك مع أحد المختبِرين المسجَّلين لدى المؤسسة، فستُجري هذه الجلسة فحوصات حقيقية. وإلا فلن يُحتفظ بأي شيء وستتابع باستخدام بيانات الاختبار.","testerGate.start":"ابدأ","testerGate.checking":"جارٍ التحقق من وجهك","testerGate.boundTitle":"الفحوصات الحقيقية مفعّلة","testerGate.boundBody":"تم التعرّف عليك كمختبِر مسجَّل. ستُجري الخطوات التالية فحوصات حقيقية.","testerGate.missTitle":"لا يوجد مختبِر مسجَّل مطابق","testerGate.missBody":"لم يُحتفظ بأي شيء. يمكنك إعادة المحاولة أو المتابعة باستخدام بيانات الاختبار.","testerGate.retry":"أعد المحاولة","testerGate.continueTest":"المتابعة باستخدام بيانات الاختبار","testerGate.continue":"متابعة","testerGate.limitBody":"تم بلوغ الحد اليومي للفحوصات الحقيقية للمختبِرين. تابع باستخدام بيانات الاختبار، أو أعد المحاولة غدًا.","testerGate.exhaustedBody":"لم تتبقَّ أي محاولة في هذه الجلسة. تابع باستخدام بيانات الاختبار، أو ابدأ جلسة جديدة.","testerGate.closedBody":"لا يمكن بدء الفحوصات الحقيقية إلا قبل أول التقاط. تابع باستخدام بيانات الاختبار، أو ابدأ جلسة جديدة."},$={"consent.human.terms.intro":"Sekyro AI confirms that a real person is completing this step, on behalf of the organization that asked for it.","consent.human.terms.data":"Sekyro AI collects a short capture of your face.","consent.human.terms.processing":"The capture is checked to confirm that you are a real person who is present. It may be compared with faces already verified for this organization.","consent.human.terms.sharing":"The organization that requested this verification learns its outcome.","consent.human.terms.retention":"Your data is stored encrypted and kept only as long as the law and the organization's settings require. To exercise your data-protection rights, contact the organization that requested this verification.","capture.noCamera.title":"This step needs a camera","capture.noCamera.body":"Allow camera access and try again, or continue on a phone with a camera.","capture.noCamera.continue":"Continue without a camera","capture.noCamera.deniedTitle":"Allow camera access","capture.noCamera.deniedBody":"Your browser blocked the camera for this page. Allow it in the site settings, then try again.","choice.title":"Choose how to continue","choice.description":"Choose one option.","choice.switch":"Use another option","contact.title":"Where to send your code","contact.description":"Choose one option.","contact.phone":"By phone (WhatsApp or SMS)","contact.email":"By email","contact.switch":"Use another option","summary.title":"Check your details","summary.description":"Make sure this is you before the live photo.","summary.fullName":"Full name","summary.birthDate":"Date of birth","summary.nationality":"Nationality","summary.documentType":"Document","summary.documentNumber":"Document number","summary.nni":"Mauritanian national ID number (NNI)","summary.id_number":"ID number","summary.expiryDate":"Expiry date","summary.portraitAlt":"Photo on record","summary.source.registry":"From the civil registry","summary.source.document":"Read from your document","summary.source.chip":"Read from your document's chip","summary.name":"Name","summary.birthYear":"Year of birth","summary.confirm":"Confirm and continue","summary.retakeDocument":"Scan my document again","summary.retakeNationalNumber":"Enter my number again","summary.noRetake":"You can't try again. Contact {org} if these details are wrong","capture.tipsIcao.title":"For your ID photo:","capture.tipsIcao.glasses":"Remove your glasses","capture.tipsIcao.headwear":"Remove hats and caps. A religious head covering is fine if your whole face shows","capture.tipsIcao.expression":"Keep a neutral expression with your mouth closed","capture.tipsIcao.faceCamera":"Look straight at the camera with your eyes open","capture.tipsIcao.background":"Stand in front of a plain, light background","capture.tipsIcao.lighting":"Use even light on your face: no shadows","capture.tipsIcao.hair":"Keep your hair away from your face and eyes","capture.tipsIcao.summary":"Stand in front of a plain, light wall with even light on your face. Remove your glasses and any hat. Keep your hair off your face, look straight at the camera with your eyes open, keep a neutral expression with your mouth closed, and hold still.","portrait.retakeOnly":"Your live check passed. Only the photo needs another try","portrait.keepCamera":"Stay in front of the camera","handoff.description":"Scan with your phone to continue","handoff.qrAlt":"QR code that opens this verification on your phone","handoff.copyLink":"Copy link","handoff.copyFailed":"We couldn't copy the link. Copy this page's address from your browser instead","handoff.waiting":"This page moves on by itself once you finish on your phone","inApp.title":"Open in your browser","inApp.description":"The camera doesn't work well inside this app. Open the link in Chrome or Safari to continue.","inApp.copyLink":"Copy link","inApp.copied":"Link copied. Paste it in your browser","inApp.copyFailed":"We couldn't copy the link. Copy this page's address instead","inApp.continueAnyway":"Continue here anyway","inApp.openBrowser":"Open in browser","testerGate.action":"Run real checks as a tester","testerGate.title":"Run real checks as a tester","testerGate.body":"Look at the camera. If your face matches one of the organization's enrolled testers, this session runs real checks. If not, nothing is kept and you continue with test data.","testerGate.start":"Start","testerGate.checking":"Checking your face","testerGate.boundTitle":"Real checks are on","testerGate.boundBody":"You were recognised as an enrolled tester. The next steps run real checks.","testerGate.missTitle":"No enrolled tester matched","testerGate.missBody":"Nothing was kept. You can try again or continue with test data.","testerGate.retry":"Try again","testerGate.continueTest":"Continue with test data","testerGate.continue":"Continue","testerGate.limitBody":"Today's limit of real checks for testers is reached. Continue with test data, or try again tomorrow.","testerGate.exhaustedBody":"No tries are left on this session. Continue with test data, or start a new session.","testerGate.closedBody":"Real checks can start only before the first capture. Continue with test data, or start a new session."},Te={"consent.human.terms.intro":"Sekyro AI confirme qu'une personne réelle effectue cette étape, pour le compte de l'organisme qui l'a demandée.","consent.human.terms.data":"Sekyro AI recueille une courte capture de votre visage.","consent.human.terms.processing":"La capture est analysée pour confirmer que vous êtes une personne réelle et présente. Elle peut être comparée aux visages déjà vérifiés pour cet organisme.","consent.human.terms.sharing":"L'organisme qui a demandé cette vérification est informé de son résultat.","consent.human.terms.retention":"Vos données sont stockées chiffrées et conservées uniquement pendant la durée exigée par la loi et les paramètres de l'organisme. Pour exercer vos droits en matière de protection des données, contactez l'organisme qui a demandé cette vérification.","capture.noCamera.title":"Une caméra est nécessaire","capture.noCamera.body":"Autorisez l'accès à la caméra et réessayez, ou continuez sur un téléphone équipé d'une caméra.","capture.noCamera.continue":"Continuer sans caméra","capture.noCamera.deniedTitle":"Autorisez la caméra","capture.noCamera.deniedBody":"Votre navigateur a bloqué la caméra pour cette page. Autorisez-la dans les paramètres du site, puis réessayez.","choice.title":"Comment continuer ?","choice.description":"Choisissez une option.","choice.switch":"Utiliser une autre option","contact.title":"Où envoyer votre code ?","contact.description":"Choisissez une option.","contact.phone":"Par téléphone (WhatsApp ou SMS)","contact.email":"Par e-mail","contact.switch":"Utiliser une autre option","summary.title":"Vérifiez vos informations","summary.description":"Assurez-vous qu'il s'agit bien de vous avant la photo en direct.","summary.fullName":"Nom complet","summary.birthDate":"Date de naissance","summary.nationality":"Nationalité","summary.documentType":"Document","summary.documentNumber":"Numéro du document","summary.nni":"Numéro national d'identification mauritanien (NNI)","summary.id_number":"Numéro d'identité","summary.expiryDate":"Date d'expiration","summary.portraitAlt":"Photo enregistrée","summary.source.registry":"Issu de l'état civil","summary.source.document":"Lu sur votre document","summary.source.chip":"Lu sur la puce de votre document","summary.name":"Nom","summary.birthYear":"Année de naissance","summary.confirm":"Confirmer et continuer","summary.retakeDocument":"Scanner à nouveau mon document","summary.retakeNationalNumber":"Saisir à nouveau mon numéro","summary.noRetake":"Vous ne pouvez plus réessayer. Contactez {org} si ces informations sont incorrectes","capture.tipsIcao.title":"Pour votre photo d'identité :","capture.tipsIcao.glasses":"Retirez vos lunettes","capture.tipsIcao.headwear":"Retirez chapeau et casquette. Un couvre-chef religieux est accepté si tout le visage est visible","capture.tipsIcao.expression":"Gardez une expression neutre, la bouche fermée","capture.tipsIcao.faceCamera":"Regardez la caméra bien en face, les yeux ouverts","capture.tipsIcao.background":"Placez-vous devant un fond uni et clair","capture.tipsIcao.lighting":"Éclairez votre visage de façon uniforme : sans ombres","capture.tipsIcao.hair":"Dégagez vos cheveux du visage et des yeux","capture.tipsIcao.summary":"Placez-vous devant un mur uni et clair, le visage éclairé de façon uniforme. Retirez vos lunettes et tout chapeau. Dégagez vos cheveux du visage, regardez la caméra bien en face, les yeux ouverts, gardez une expression neutre, la bouche fermée, et ne bougez plus.","portrait.retakeOnly":"Votre vérification en direct est validée. Seule la photo est à refaire","portrait.keepCamera":"Restez face à la caméra","handoff.description":"Scannez avec votre téléphone pour continuer","handoff.qrAlt":"Code QR qui ouvre cette vérification sur votre téléphone","handoff.copyLink":"Copier le lien","handoff.copyFailed":"Nous n'avons pas pu copier le lien. Copiez plutôt l'adresse de cette page depuis votre navigateur","handoff.waiting":"Cette page avancera d’elle-même une fois l’étape terminée sur votre téléphone","inApp.title":"Ouvrez dans le navigateur","inApp.description":"La caméra fonctionne mal dans cette application. Ouvrez le lien dans Chrome ou Safari pour continuer.","inApp.copyLink":"Copier le lien","inApp.copied":"Lien copié. Collez-le dans votre navigateur","inApp.copyFailed":"Impossible de copier le lien. Copiez plutôt l'adresse de cette page","inApp.continueAnyway":"Continuer ici quand même","inApp.openBrowser":"Ouvrir dans le navigateur","testerGate.action":"Lancer de vrais contrôles en tant que testeur","testerGate.title":"Lancer de vrais contrôles en tant que testeur","testerGate.body":"Regardez la caméra. Si votre visage correspond à l'un des testeurs inscrits de l'organisation, cette session lance de vrais contrôles. Sinon, rien n'est conservé et vous continuez avec des données de test.","testerGate.start":"Commencer","testerGate.checking":"Vérification de votre visage","testerGate.boundTitle":"Les vrais contrôles sont activés","testerGate.boundBody":"Vous avez été reconnu comme testeur inscrit. Les étapes suivantes lancent de vrais contrôles.","testerGate.missTitle":"Aucun testeur inscrit ne correspond","testerGate.missBody":"Rien n'a été conservé. Vous pouvez réessayer ou continuer avec des données de test.","testerGate.retry":"Réessayer","testerGate.continueTest":"Continuer avec des données de test","testerGate.continue":"Continuer","testerGate.limitBody":"La limite de vrais contrôles pour les testeurs est atteinte pour aujourd'hui. Continuez avec des données de test, ou réessayez demain.","testerGate.exhaustedBody":"Il ne reste plus d'essai sur cette session. Continuez avec des données de test, ou lancez une nouvelle session.","testerGate.closedBody":"Les vrais contrôles ne peuvent commencer qu'avant la première capture. Continuez avec des données de test, ou lancez une nouvelle session."},ce={M:{perBlock:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26],blocks:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16],formatBits:0},H:{perBlock:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28],blocks:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25],formatBits:2}},ne=20;function le(e){let t=(16*e+128)*e+64;if(e>=2){let a=Math.floor(e/7)+2;t-=(25*a-10)*a-55,e>=7&&(t-=36)}return t}y(le,"we");m(le,"rawDataModules");function O(e,t){let{perBlock:a,blocks:r}=ce[t],n=a[e-1],i=r[e-1],l=Math.floor(le(e)/8),s=i-l%i,o=Math.floor(l/i)-n;return[n,s===i?[[i,o]]:[[s,o],[i-s,o+1]]]}y(O,"se");m(O,"blockLayout");var P=m((e,t)=>O(e,t)[1].reduce((a,[r,n])=>a+r*n,0),"dataCapacity");function R(e,t){let a=0;for(let r=7;r>=0;r-=1)a=a<<1^(a>>>7)*285,a^=(t>>>r&1)*e;return a&255}y(R,"E");m(R,"gfMul");function ue(e){let t=new Array(e).fill(0);t[e-1]=1;let a=1;for(let r=0;r<e;r+=1){for(let n=0;n<e;n+=1)t[n]=R(t[n],a),n+1<e&&(t[n]=t[n]^t[n+1]);a=R(a,2)}return t}y(ue,"ve");m(ue,"rsDivisor");function de(e,t){let a=t.map(()=>0);for(let r of e){let n=r^a.shift();a.push(0),t.forEach((i,l)=>{a[l]=a[l]^R(i,n)})}return a}y(de,"Ce");m(de,"rsRemainder");function me(e,t,a){let r=[],n=m((u,d)=>{for(let k=d-1;k>=0;k-=1)r.push(u>>>k&1)},"put");n(4,4),n(e.length,t<10?8:16);for(let u of e)n(u,8);let i=P(t,a)*8;n(0,Math.min(4,i-r.length)),n(0,(8-r.length%8)%8);let l=[];for(let u=0;u<r.length;u+=8)l.push(r.slice(u,u+8).reduce((d,k)=>d<<1|k,0));for(let u=236;l.length<P(t,a);u^=253)l.push(u);let[s,o]=O(t,a),p=ue(s),h=[],f=0;for(let[u,d]of o)for(let k=0;k<u;k+=1){let w=l.slice(f,f+d);f+=d,h.push({data:w,ec:de(w,p)})}let g=[],C=Math.max(...h.map(u=>u.data.length));for(let u=0;u<C;u+=1)for(let d of h)u<d.data.length&&g.push(d.data[u]);for(let u=0;u<s;u+=1)for(let d of h)g.push(d.ec[u]);return g}y(me,"Se");m(me,"codewords");function E(e){if(e===1)return[];let t=Math.floor(e/7)+2,a=Math.ceil((e*4+4)/(t*2-2))*2,r=[6];for(let n=e*4+10;r.length<t;n-=a)r.splice(1,0,n);return r}y(E,"ie");m(E,"alignmentPositions");var _e=[(e,t)=>(e+t)%2===0,e=>e%2===0,(e,t)=>t%3===0,(e,t)=>(e+t)%3===0,(e,t)=>(Math.floor(e/2)+Math.floor(t/3))%2===0,(e,t)=>e*t%2+e*t%3===0,(e,t)=>(e*t%2+e*t%3)%2===0,(e,t)=>((e+t)%2+e*t%3)%2===0],G,pe=(G=class{constructor(t){this.size=t,this.dark=new Array(t*t).fill(!1),this.fixed=new Array(t*t).fill(!1)}set(t,a,r){this.dark[t*this.size+a]=r,this.fixed[t*this.size+a]=!0}get(t,a){return this.dark[t*this.size+a]===!0}},y(G,"q"),G);m(pe,"Grid");var Me=pe;function he(e,t){let a=e.size;for(let i=0;i<a;i+=1)e.set(6,i,i%2===0),e.set(i,6,i%2===0);for(let[i,l]of[[3,3],[3,a-4],[a-4,3]])for(let s=-4;s<=4;s+=1)for(let o=-4;o<=4;o+=1){let p=i+s,h=l+o;if(p<0||p>=a||h<0||h>=a)continue;let f=Math.max(Math.abs(s),Math.abs(o));e.set(p,h,f!==2&&f!==4)}let r=E(t),n=r.length-1;if(r.forEach((i,l)=>r.forEach((s,o)=>{if(!(l===0&&o===0||l===0&&o===n||l===n&&o===0))for(let p=-2;p<=2;p+=1)for(let h=-2;h<=2;h+=1)e.set(i+p,s+h,Math.max(Math.abs(p),Math.abs(h))!==1)})),U(e,0),t>=7){let i=t;for(let s=0;s<12;s+=1)i=i<<1^(i>>>11)*7973;let l=t<<12|i;for(let s=0;s<18;s+=1){let o=(l>>>s&1)===1,p=a-11+s%3,h=Math.floor(s/3);e.set(p,h,o),e.set(h,p,o)}}}y(he,"xe");m(he,"drawFunctionPatterns");function U(e,t,a=0){let r=e.size,n=a<<3|t,i=n;for(let o=0;o<10;o+=1)i=i<<1^(i>>>9)*1335;let l=(n<<10|i)^21522,s=m(o=>(l>>>o&1)===1,"bit");for(let o=0;o<=5;o+=1)e.set(o,8,s(o));e.set(7,8,s(6)),e.set(8,8,s(7)),e.set(8,7,s(8));for(let o=9;o<15;o+=1)e.set(8,14-o,s(o));for(let o=0;o<8;o+=1)e.set(8,r-1-o,s(o));for(let o=8;o<15;o+=1)e.set(r-15+o,8,s(o));e.set(r-8,8,!0)}y(U,"ce");m(U,"drawFormat");function ye(e,t){let a=e.size,r=0;for(let n=a-1;n>=1;n-=2){n===6&&(n=5);for(let i=0;i<a;i+=1)for(let l=0;l<2;l+=1){let s=n-l,o=(n+1&2)===0?a-1-i:i;e.fixed[o*a+s]!==!0&&(r<t.length*8&&(e.dark[o*a+s]=(t[r>>>3]>>>7-(r&7)&1)===1),r+=1)}}}y(ye,"Ie");m(ye,"placeData");function fe(e,t){let a=_e[t];for(let r=0;r<e.size;r+=1)for(let n=0;n<e.size;n+=1)e.fixed[r*e.size+n]!==!0&&a(r,n)&&(e.dark[r*e.size+n]=!e.dark[r*e.size+n])}y(fe,"Ne");m(fe,"applyMask");function ge(e){let t=e.size,a=0,r=m(i=>{let l=1;for(let s=1;s<=t;s+=1)s<t&&i(s)===i(s-1)?l+=1:(l>=5&&(a+=3+(l-5)),l=1);for(let s=0;s+10<t;s+=1){let o=[!0,!1,!0,!0,!0,!1,!0];if(!(o.every((f,g)=>i(s+g)===f)||o.every((f,g)=>i(s+4+g)===f)))continue;let p=[0,1,2,3].every(f=>!i(s+f))&&o.every((f,g)=>i(s+4+g)===f),h=o.every((f,g)=>i(s+g)===f)&&[7,8,9,10].every(f=>!i(s+f));p&&(a+=40),h&&(a+=40)}},"line");for(let i=0;i<t;i+=1)r(l=>e.get(i,l));for(let i=0;i<t;i+=1)r(l=>e.get(l,i));for(let i=0;i+1<t;i+=1)for(let l=0;l+1<t;l+=1){let s=e.get(i,l);s===e.get(i,l+1)&&s===e.get(i+1,l)&&s===e.get(i+1,l+1)&&(a+=3)}let n=e.dark.filter(Boolean).length;return a+=Math.floor(Math.abs(n*20-t*t*10)/(t*t))*10,a}y(ge,"Ge");m(ge,"penalty");function ke(e,t={}){let a=t.ecl??"M",r=new TextEncoder().encode(e),n=1;for(;n<=ne&&!(4+(n<10?8:16)+r.length*8<=P(n,a)*8);n+=1);if(n>ne)throw new RangeError("text too long for a QR code");let i=me(r,n,a),l=m(p=>{let h=new Me(n*4+17);return he(h,n),ye(h,i),fe(h,p),U(h,p,ce[a].formatBits),h},"build"),s=null;if(t.mask!==void 0)s=l(t.mask);else{let p=Number.POSITIVE_INFINITY;for(let h=0;h<8;h+=1){let f=l(h),g=ge(f);g<p&&(p=g,s=f)}}let o=s;return{size:o.size,get:m((p,h)=>o.get(p,h),"get")}}y(ke,"ue");m(ke,"encodeQr");var Be={viewBox:"0 0 100 100",d:"M22.37,0H77.63A22.37,22.37 0 0 1 100,22.37V77.63A22.37,22.37 0 0 1 77.63,100H22.37A22.37,22.37 0 0 1 0,77.63V22.37A22.37,22.37 0 0 1 22.37,0ZM48.067,21H38.308A17.308,17.308 0 0 0 21,38.308V42.543A19.886,19.886 0 0 0 40.886,62.429H60.219V57.641A4.419,4.419 0 0 0 55.8,53.222H43.463A11.416,11.416 0 0 1 32.048,41.806V38.308A8.102,8.102 0 0 1 40.149,30.206H43.648A4.419,4.419 0 0 0 48.067,25.787ZM38.676,79H59.114A19.886,19.886 0 0 0 79,59.114V57.457A19.886,19.886 0 0 0 59.114,37.571H38.676V42.359A4.419,4.419 0 0 0 43.095,46.778H56.537A11.416,11.416 0 0 1 67.952,58.194V58.378A11.416,11.416 0 0 1 56.537,69.794H43.095A4.419,4.419 0 0 0 38.676,74.213ZM51.933,21H79V37.571H69.794V30.206H51.933ZM21,71.543A7.457,7.457 0 1 0 35.914,71.543A7.457,7.457 0 1 0 21,71.543Z"},M=.42,Le=.2,b=m(e=>{let t=Math.round(e*1e3)/1e3;return String(t===0?0:t)},"num");function I(e,t,a,r){let n=`A${b(r)} ${b(r)} 0 0 1 `;return`M${b(e+r)} ${b(t)}H${b(e+a-r)}${n}${b(e+a)} ${b(t+r)}V${b(t+a-r)}${n}${b(e+a-r)} ${b(t+a)}H${b(e+r)}${n}${b(e)} ${b(t+a-r)}V${b(t+r)}${n}${b(e+r)} ${b(t)}Z`}y(I,"I");m(I,"roundedSquare");function ve(e){let t=(e-17)/4,a=E(t),r=a.length-1,n=[];return a.forEach((i,l)=>a.forEach((s,o)=>{l===0&&o===0||l===0&&o===r||l===r&&o===0||n.push([i,s])})),n}y(ve,"Be");m(ve,"alignmentCentres");function be(e,{quiet:t=4,logo:a=!1}={}){let r=e.size,n=m((u,d)=>u<7&&d<7||u<7&&d>=r-7||u>=r-7&&d<7,"isFinder"),i=Math.floor(r*Le),l=a?i%2===0?i-1:i:0,s=(r-l)/2,o=m((u,d)=>l>0&&u>=s&&u<s+l&&d>=s&&d<s+l,"inZone"),p=ve(r).filter(([u,d])=>!o(u,d)),h=m((u,d)=>p.some(([k,w])=>Math.abs(u-k)<=2&&Math.abs(d-w)<=2),"isAlign"),f=`a${b(M)} ${b(M)} 0 1 0 `,g="";for(let u=0;u<r;u+=1)for(let d=0;d<r;d+=1)!e.get(u,d)||n(u,d)||h(u,d)||o(u,d)||(g+=`M${b(d+t+.5-M)} ${b(u+t+.5)}${f}${b(2*M)} 0${f}${b(-2*M)} 0Z`);let C="";for(let[u,d]of[[0,0],[0,r-7],[r-7,0]]){let k=d+t,w=u+t;C+=I(k,w,7,1.6)+I(k+1,w+1,5,.6)+I(k+2,w+2,3,.6)}for(let[u,d]of p){let k=d-2+t,w=u-2+t;C+=I(k,w,5,1.2)+I(k+1,w+1,3,.5)+I(k+2,w+2,1,.5)}return{size:r+t*2,dots:g,finders:C,logo:l>0?{x:s+t+.5,y:s+t+.5,size:l-1}:null}}y(be,"de");m(be,"styledQr");function we(e){let t=Math.round(e.size/100*1e5)/1e5;return`translate(${b(e.x)} ${b(e.y)}) scale(${t})`}y(we,"me");m(we,"qrLogoTransform");var $e={en:$,fr:Te,ar:xe,es:$,pt:$,de:$},Ce={en:_,fr:oe,ar:ae,es:_,pt:_,de:_};function A(e){let t=e.strings;return(a,r)=>q(t[a]??$e[e.locale][a]??"",r)}y(A,"C");m(A,"flowT");function F(e,t){let a=A(t);return e.flatMap(r=>{let n=r.service==="phone_otp"?a("contact.phone"):r.service==="email_otp"?a("contact.email"):H(r,t),i=X[r.service];return n===null?[]:[{id:r.id,label:n,...i!==void 0?{glyph:(0,c.jsx)(D,{name:i})}:{}}]})}y(F,"he");m(F,"labelled");function Y({step:e,i18n:t,onError:a}){let r=A(t),{busy:n,error:i,run:l}=T(t,a),s=e.kind==="contact_choice";return(0,c.jsx)(S,{title:r(s?"contact.title":"choice.title"),description:r(s?"contact.description":"choice.description"),options:F(e.choice.options,t),busy:n,error:i,focus:!0,testId:s?"sekyro-contact-choice":"sekyro-choice",onChoose:y(o=>l(()=>e.choose(o)),"onChoose")})}y(Y,"be");m(Y,"PlanChoiceView");var lt=Y,ut=Y;function Re({step:e,i18n:t,onError:a,onOpen:r}){let n=A(t),{busy:i,error:l,run:s}=T(t,a),o=e,p=e.context.switchable,h=p===void 0?[]:p.options.filter(k=>k.id!==p.current),f=o.kind==="registry"&&(o.reason==="nni_not_found"||o.reason==="registry_record_not_found")&&o.canUseDocument||o.kind==="eid"&&o.reason?.startsWith("eid_")&&o.canUseCamera,g=h.length===1?h[0]:void 0,C=g!==void 0&&(g.service==="phone_otp"||g.service==="email_otp"),u=C&&o.canSwitch&&o.switchTo!==void 0?()=>o.switchTo.call(e):o.chooseOption===void 0||g===void 0?void 0:()=>o.chooseOption.call(e,g.id);if(h.length===0||f||g!==void 0&&(u===void 0||d()===null)||g===void 0&&o.chooseOption===void 0)return null;function d(){return g===void 0?n("choice.switch"):g.service==="phone_otp"||g.service==="email_otp"?n("contact.switch"):o.kind==="registry"&&g.service==="document"?t.t("population.useDocument"):o.kind==="eid"?t.strings["eid.useCamera"]??Ce[t.locale]["eid.useCamera"]:H(g,t)}return y(d,"p"),m(d,"labelOf"),(0,c.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[l!==null?(0,c.jsx)(x,{tone:"danger",children:(0,c.jsx)("span",{children:l})}):null,(0,c.jsx)(N,{kind:"secondary",disabled:i,"aria-busy":i||void 0,onClick:y(()=>u===void 0?r():s(u),"onClick"),"data-testid":C?"sekyro-contact-switch":"sekyro-lane-switch",children:d()})]})}y(Re,"bt");m(Re,"LaneSwitch");function De({step:e,i18n:t,onError:a,onClose:r}){let n=A(t),{busy:i,error:l,run:s}=T(t,a),o=e.context.switchable,p=e.chooseOption;return o===void 0||p===void 0?null:(0,c.jsx)(S,{title:n("choice.title"),description:n("choice.description"),options:F(o.options,t),...o.current!==null?{marked:o.current}:{},busy:i,error:l,focus:!0,testId:"sekyro-lane-choice",onChoose:y(h=>h===o.current?r():s(()=>p.call(e,h)),"onChoose")})}y(De,"gt");m(De,"LaneChoiceView");var Se=[["fullName","summary.fullName",!1],["birthDate","summary.birthDate",!0],["birthYear","summary.birthYear",!0],["nationality","summary.nationality",!0],["documentType","summary.documentType",!1],["documentNumberMasked","summary.documentNumber",!0],["idNumberMasked","summary.id_number",!0],["expiryDate","summary.expiryDate",!0]];function Ae(e){let[t,a]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!e.portraitAvailable)return;let r=!0,n=null;return e.portrait().then(i=>{!r||i===null||!i.type.startsWith("image/")||typeof URL.createObjectURL!="function"||(n=URL.createObjectURL(i),a(n))}),()=>{r=!1,n!==null&&URL.revokeObjectURL(n)}},[e.portraitAvailable]),t}y(Ae,"Re");m(Ae,"usePortraitUrl");var Ve=m(e=>/^\d{4}-\d{2}-\d{2}$/.test(e),"isoDate");function Ne(e,t){try{return new Intl.DateTimeFormat(t==="ar"?"ar-u-nu-latn":t,{day:"numeric",month:"long",year:"numeric",timeZone:"UTC"}).format(new Date(`${e}T00:00:00Z`))}catch{return e}}y(Ne,"Fe");m(Ne,"formatDate");function qe({step:e,i18n:t,onError:a}){let r=A(t),n=(0,v.useId)(),i=B(),l=Ae(e),{busy:s,error:o,run:p}=T(t,a),h=e.context.orgName,f=["registry","document","chip"].find(u=>u===e.source),g=e.summaryKind==="partial",C=m(u=>t.strings[`doc.type.${u}`]??u,"documentLabel");return(0,c.jsxs)("section",{className:"sekyro-step","aria-labelledby":n,"data-testid":"sekyro-identity-summary",children:[(0,c.jsxs)("div",{className:"sekyro-heading",children:[(0,c.jsx)("h2",{id:n,ref:i,tabIndex:-1,className:"sekyro-text-body",children:r("summary.title")}),(0,c.jsx)("p",{className:"sekyro-text-muted",children:r("summary.description")})]}),f!==void 0?(0,c.jsx)("p",{className:"sekyro-summary__source",children:r(`summary.source.${f}`)}):null,(0,c.jsxs)("div",{className:"sekyro-summary",children:[l!==null?(0,c.jsx)("img",{className:"sekyro-summary__portrait",src:l,alt:r("summary.portraitAlt")}):null,(0,c.jsx)("dl",{className:"sekyro-summary__list",children:Se.map(([u,d,k])=>{let w=u==="idNumberMasked"?e.idNumberMasked??e.nniMasked:e[u];return w===void 0?null:(0,c.jsxs)("div",{className:"sekyro-summary__row",children:[(0,c.jsx)("dt",{className:"sekyro-text-muted",children:r(u==="fullName"&&g?"summary.name":d)}),(0,c.jsx)("dd",{children:Ve(w)?Ne(w,t.locale):k?(0,c.jsx)("bdi",{dir:"ltr",children:w}):u==="documentType"?C(w):w})]},u)})})]}),o!==null?(0,c.jsx)(x,{tone:"danger",children:(0,c.jsx)("span",{children:o})}):null,e.retakeAvailable?null:(0,c.jsx)("p",{className:"sekyro-text-muted",children:r("summary.noRetake",{org:h})}),(0,c.jsxs)(L,{children:[(0,c.jsx)(N,{full:!0,disabled:s,"aria-busy":s||void 0,onClick:y(()=>p(()=>e.confirm()),"onClick"),children:r("summary.confirm")}),e.retakeAvailable?(0,c.jsx)(N,{kind:"secondary",full:!0,disabled:s,onClick:y(()=>p(()=>e.retake()),"onClick"),children:r(e.retakeTarget==="national_number"?"summary.retakeNationalNumber":"summary.retakeDocument")}):null]})]})}y(qe,"kt");m(qe,"IdentitySummaryView");var He=["glasses","headwear","expression","faceCamera","background","lighting","hair"];function Pe({step:e,i18n:t,livenessProps:a,sekyroIntro:r}){let n=A(t),[i,l]=(0,v.useState)(null);(0,v.useEffect)(()=>e.onLivePhoto(d=>{let k=d.update?.coach;l(d.holding||k===void 0?null:t.t(`portrait.coach.${k}`))}),[e,t]);let s=e.instructions==="icao",o=(0,v.useMemo)(()=>ee(e),[e]),p=e.icao?.profile==="selfie",h=(0,v.useMemo)(()=>s?He.filter(d=>!p||d!=="background").map(d=>({id:d,text:n(`capture.tipsIcao.${d}`)})):void 0,[s,p,t]),f=(0,v.useMemo)(()=>s&&!p?{...a.strings,"capture.tips.title":n("capture.tipsIcao.title")}:a.strings,[s,p,a.strings,t]),g=p?void 0:n("capture.tipsIcao.title"),C=(0,v.useMemo)(()=>r===!0&&h!==void 0?{...a.slots,intro:m((d,k)=>(0,c.jsx)(te,{start:d,context:k,tips:h,...g!==void 0?{tipsTitle:g}:{},...o!==void 0?{retry:o}:{}}),"intro")}:a.slots,[r,h,g,o,a.slots,t]),u=p?`${(h??[]).map(d=>d.text).join(". ")}.`:n("capture.tipsIcao.summary");return(0,c.jsx)(V,{...a,...C!==void 0?{slots:C}:{},...f!==void 0?{strings:f}:{},...h!==void 0?{tips:h,tipsSummary:u}:{},coach:i})}y(Pe,"wt");m(Pe,"LivePhotoLiveness");function Oe({i18n:e}){let t=A(e);return(0,c.jsxs)(x,{tone:"info",children:[(0,c.jsx)("strong",{children:t("portrait.retakeOnly")}),(0,c.jsx)("span",{children:t("portrait.keepCamera")})]})}y(Oe,"vt");m(Oe,"PortraitRetakeNotice");function Ee({i18n:e,provider:t}){let a=e.strings,r=m(n=>a[n]??Ce[e.locale][n]??"","pick");return(0,c.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-eid-continue",children:t?q(r("eid.continueHint"),{provider:t}):r("eid.continueHintGeneric")})}y(Ee,"Ct");m(Ee,"EidContinueHint");async function Ie(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}y(Ie,"Pe");m(Ie,"copy");function Z({url:e,i18n:t,label:a,primary:r}){let n=A(t),[i,l]=(0,v.useState)("idle"),s=a.startsWith("inApp.")?"inApp":"handoff";return(0,c.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,c.jsx)(N,{kind:r?"primary":"secondary",full:!0,onClick:y(()=>{Ie(e).then(o=>l(o?"copied":"failed"))},"onClick"),children:n(a)}),(0,c.jsx)("p",{role:"status","aria-live":"polite",className:"sekyro-text-muted",children:i==="idle"?"":n(`${s}.${i==="copied"?"copied":"copyFailed"}`)})]})}y(Z,"ge");m(Z,"CopyLink");function j({url:e,i18n:t,refresh:a,footer:r,lead:n}){let i=A(t),l=(0,v.useId)(),s=(0,v.useMemo)(()=>{try{return be(ke(e,{ecl:"H"}),{logo:!0})}catch{return null}},[e]),o=(0,v.useRef)(a);o.current=a;let p=B();return(0,v.useEffect)(()=>{let h=setInterval(()=>{(typeof document>"u"||document.visibilityState!=="hidden")&&o.current?.().catch(()=>{})},5e3);return()=>clearInterval(h)},[]),(0,c.jsxs)("section",{className:"sekyro-step sekyro-handoff","aria-labelledby":l,"data-testid":"sekyro-handoff",children:[(0,c.jsxs)("div",{className:"sekyro-heading",children:[(0,c.jsx)("h2",{id:l,ref:p,tabIndex:-1,className:"sekyro-text-body",children:t.t("handoff.title")}),n!==void 0?(0,c.jsx)("p",{children:n}):null,(0,c.jsx)("p",{className:"sekyro-text-muted",children:i("handoff.description")})]}),s!==null?(0,c.jsxs)("svg",{className:"sekyro-qr",viewBox:`0 0 ${s.size} ${s.size}`,role:"img","aria-label":i("handoff.qrAlt"),children:[(0,c.jsx)("rect",{width:s.size,height:s.size,className:"sekyro-qr__bg"}),(0,c.jsx)("path",{d:s.dots,className:"sekyro-qr__fg"}),(0,c.jsx)("path",{d:s.finders,className:"sekyro-qr__fg",fillRule:"evenodd"}),s.logo!==null?(0,c.jsx)("path",{d:Be.d,className:"sekyro-qr__fg",fillRule:"evenodd",transform:we(s.logo),"data-qr-mark":""}):null]}):null,(0,c.jsxs)("p",{className:"sekyro-handoff__waiting",role:"status",children:[(0,c.jsx)("span",{className:"sekyro-handoff__pulse","aria-hidden":"true"}),i("handoff.waiting")]}),(0,c.jsxs)(L,{children:[(0,c.jsx)(Z,{url:e,i18n:t,label:"handoff.copyLink"}),r??null]})]})}y(j,"ke");m(j,"HandoffView");var Ue=["intro","data","processing","sharing","retention"];function Fe({i18n:e}){let t=A(e);return(0,c.jsx)(c.Fragment,{children:Ue.map(a=>(0,c.jsx)("p",{children:t(`consent.human.terms.${a}`)},a))})}y(Fe,"St");m(Fe,"HumanConsentTerms");function Ye({url:e,i18n:t}){return(0,v.useMemo)(()=>!se(),[])?(0,c.jsx)(j,{url:e,i18n:t}):null}y(Ye,"At");m(Ye,"DesktopHandoffView");function Ze({i18n:e,cause:t,onRetry:a,onContinue:r,handoffUrl:n}){let i=A(e),l=(0,v.useId)(),s=B(),[o,p]=(0,v.useState)("idle"),h=(0,v.useMemo)(()=>n!==void 0&&!se(),[n]),f=t==="denied",g=m(()=>{r!==void 0&&(p("busy"),r(t).then(()=>p("idle"),d=>p(d instanceof ie&&d.code==="check_out_of_order"?"idle":"failed")))},"end"),C=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(N,{full:!0,kind:f||r===void 0?"primary":"secondary",onClick:a,children:e.t("common.retry")}),r!==void 0?(0,c.jsx)(N,{full:!0,kind:f?"secondary":"primary",disabled:o==="busy","aria-busy":o==="busy"||void 0,onClick:g,children:i("capture.noCamera.continue")}):null]}),u=o==="failed"?(0,c.jsx)(x,{tone:"danger",children:(0,c.jsx)("span",{children:e.t("errors.network_error")})}):null;return h&&n!==void 0?(0,c.jsxs)("section",{className:"sekyro-stack sekyro-stack--4","aria-labelledby":l,"data-testid":"sekyro-no-camera","data-cause":t,children:[(0,c.jsx)(j,{url:n,i18n:e}),(0,c.jsx)("h2",{id:l,ref:s,tabIndex:-1,className:"sekyro-text-body",children:i(f?"capture.noCamera.deniedTitle":"capture.noCamera.title")}),(0,c.jsx)("p",{className:"sekyro-text-muted",children:i(f?"capture.noCamera.deniedBody":"capture.noCamera.body")}),u,(0,c.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:C})]}):(0,c.jsxs)(z,{tone:f?"warning":"neutral",icon:"camera",titleId:l,title:i(f?"capture.noCamera.deniedTitle":"capture.noCamera.title"),testId:"sekyro-no-camera",actions:C,children:[(0,c.jsx)("p",{children:i(f?"capture.noCamera.deniedBody":"capture.noCamera.body")}),u]})}y(Ze,"xt");m(Ze,"NoCameraView");function je({url:e,i18n:t,onContinue:a}){let r=A(t),n=(0,v.useId)(),i=(0,v.useMemo)(()=>re(e),[e]);return(0,c.jsx)(z,{tone:"brand",icon:"external",titleId:n,title:r("inApp.title"),testId:"sekyro-in-app",actions:(0,c.jsxs)(c.Fragment,{children:[i!==null?(0,c.jsxs)("a",{className:"sekyro-btn sekyro-btn--primary sekyro-btn--full",href:i,"data-testid":"sekyro-open-browser",children:[(0,c.jsx)(D,{name:"external"}),r("inApp.openBrowser")]}):null,(0,c.jsx)(Z,{url:e,i18n:t,label:"inApp.copyLink",primary:i===null}),(0,c.jsx)(N,{kind:"ghost",full:!0,onClick:a,children:r("inApp.continueAnyway")})]}),children:(0,c.jsx)("p",{children:r("inApp.description")})})}y(je,"It");m(je,"InAppBrowserPrompt");var We={tester_limit_reached:"testerGate.limitBody",gate_attempts_exhausted:"testerGate.exhaustedBody",tester_gate_closed:"testerGate.closedBody"};function Qe({i18n:e,onOpen:t}){let a=A(e);return(0,c.jsx)(N,{kind:"ghost",full:!0,onClick:t,"data-testid":"sekyro-tester-gate-action",children:a("testerGate.action")})}y(Qe,"Nt");m(Qe,"TesterGateAction");function Ke({i18n:e,verification:t,attemptsLeft:a,livenessProps:r,onBound:n,onDone:i}){let l=A(e),s=(0,v.useId)(),[o,p]=(0,v.useState)("intro"),[h,f]=(0,v.useState)(null),g=t.testerGate,C=m(d=>{g!==void 0&&(p("checking"),g.call(t,d).then(({bound:k})=>{k&&n(),p(k?"bound":"miss")},k=>{let w=k instanceof ie?k.code:"",W=We[w];f(W!==void 0?l(W):e.t(J(k,e.strings))),p("failed")}))},"captured"),u=(0,c.jsx)(N,{full:!0,kind:o==="intro"?"secondary":"primary",onClick:y(()=>i(!0),"onClick"),"data-testid":"sekyro-tester-gate-continue",children:l("testerGate.continueTest")});return o==="capture"?(0,c.jsx)(V,{...r,onCaptured:C}):o==="checking"?(0,c.jsx)(z,{tone:"brand",icon:"face",busy:!0,live:!0,title:l("testerGate.checking"),testId:"sekyro-tester-gate-checking"}):o==="bound"?(0,c.jsx)(z,{tone:"success",icon:"success",title:l("testerGate.boundTitle"),testId:"sekyro-tester-gate-bound",actions:(0,c.jsx)(N,{full:!0,onClick:y(()=>i(!1),"onClick"),children:l("testerGate.continue")}),children:(0,c.jsx)("p",{children:l("testerGate.boundBody")})}):o==="miss"||o==="failed"?(0,c.jsx)(z,{tone:"warning",icon:"info",title:l(o==="miss"?"testerGate.missTitle":"testerGate.title"),testId:"sekyro-tester-gate-miss",actions:(0,c.jsxs)(c.Fragment,{children:[u,a>0&&o==="miss"?(0,c.jsx)(N,{full:!0,kind:"secondary",onClick:y(()=>p("capture"),"onClick"),children:l("testerGate.retry")}):null]}),children:(0,c.jsx)("p",{children:o==="miss"?l("testerGate.missBody"):h})}):(0,c.jsxs)("section",{className:"sekyro-stack sekyro-stack--4","aria-labelledby":s,"data-testid":"sekyro-tester-gate",children:[(0,c.jsx)(K,{id:s,title:l("testerGate.title"),lead:l("testerGate.body")}),(0,c.jsxs)(L,{children:[(0,c.jsx)(N,{full:!0,onClick:y(()=>p("capture"),"onClick"),disabled:g===void 0,"data-testid":"sekyro-tester-gate-start",children:l("testerGate.start")}),u]})]})}y(Ke,"Gt");m(Ke,"TesterGateView");export{lt as ContactChoiceView,Ye as DesktopHandoffView,Ee as EidContinueHint,ut as GenericChoiceView,j as HandoffView,Fe as HumanConsentTerms,qe as IdentitySummaryView,je as InAppBrowserPrompt,De as LaneChoiceView,Re as LaneSwitch,Pe as LivePhotoLiveness,Ze as NoCameraView,Oe as PortraitRetakeNotice,Qe as TesterGateAction,Ke as TesterGateView};