@sekyro/react 0.1.0-rc.31 → 0.1.0-rc.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @sekyro/react
2
2
 
3
+ ## 0.1.0-rc.33
4
+
5
+ ### Patch Changes
6
+
7
+ - 9a15ded: Voice guidance now plays its first prompt when the capture starts on its own, before the person has tapped the page. Browsers refuse audio until the first tap. Before, that first prompt was counted as spoken and never played, so a cold page load stayed silent until the guidance changed. Now the refused prompt plays on the first tap, once. Prompts still play one at a time, a newer prompt replaces a waiting one, and a prompt never repeats.
8
+
9
+ ## 0.1.0-rc.32
10
+
11
+ ### Patch Changes
12
+
13
+ - b884dc6: Requires `@sekyro/web` 0.1.0-rc.34 or later, which sends the verification's `locale` on every hosted API call, so your Form step's questions, intro and consent text show in the person's language even when the form is the first screen. Bump both packages together.
14
+ - Updated dependencies [e38c7e2]
15
+ - Updated dependencies [5c2b1fa]
16
+ - Updated dependencies [24c87ef]
17
+ - Updated dependencies [ea2bd51]
18
+ - Updated dependencies [b3a1018]
19
+ - @sekyro/web@0.1.0-rc.34
20
+
3
21
  ## 0.1.0-rc.31
4
22
 
5
23
  ### Patch Changes
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as b}from"./chunk-RGI6OVB2.js";import{d as I}from"./chunk-QD66CL7R.js";import{a as _,b as P,d as S,p as x,q as C}from"./chunk-Q5BGUJMS.js";import{a as f}from"./chunk-WC4U54LZ.js";import{a as s}from"./chunk-2KED7D2Q.js";import{useRef as E,useState as k}from"react";var N={"portrait.source.title":"كيف تريد إضافة صورتك الشخصية؟","portrait.source.description":"التقط صورة جديدة بالكاميرا، أو ارفع صورة حديثة من هذا الجهاز.","portrait.source.camera":"التقاط صورة","portrait.source.upload":"رفع صورة","portrait.source.uploadInstead":"رفع صورة بدلًا من ذلك","portrait.upload.title":"ارفع صورتك الشخصية","portrait.upload.hint":"صورة حديثة لوجهك، تنظر فيها مباشرة إلى الكاميرا، أمام جدار فاتح وبلون واحد.","portrait.upload.choose":"اختيار صورة","portrait.upload.unsupported":"اختر صورة بصيغة JPEG أو PNG أو HEIC.","portrait.upload.failed":"تعذّر إرسال هذه الصورة. حاول مرة أخرى.","portrait.review.title":"تحقّق من صورتك المعدّلة","portrait.review.description":"عدّلنا صورتك لتطابق قواعد صور الهوية. لم نغيّر وجهك.","portrait.review.original":"صورتك","portrait.review.fixed":"الصورة المعدّلة","portrait.review.fixesTitle":"ما الذي غيّرناه","portrait.review.accept":"استخدام هذه الصورة","portrait.review.retake":"إعادة الالتقاط","portrait.review.uploadAnother":"رفع صورة أخرى","portrait.fixes.crop":"قُصّت","portrait.fixes.scale":"غُيّر حجمها","portrait.fixes.straighten":"عُدّل ميلها","portrait.fixes.background":"استُبدلت الخلفية","portrait.fixes.exposure":"عُدّل السطوع","portrait.fixes.white_balance":"وُزنت الألوان","reasons.portrait_morph_suspected":"لا يمكن استخدام هذه الصورة. التقط صورة جديدة للشخص.","reasons.portrait_reference_mismatch":"لا تطابق الصورة المرجع. التقط صورة جديدة للشخص.","reasons.portrait_declined_fix":"التقط صورة أخرى أو ارفعها."};var g={"portrait.source.title":"How do you want to add your ID photo?","portrait.source.description":"Take a new photo with the camera, or upload a recent photo from this device.","portrait.source.camera":"Take a photo","portrait.source.upload":"Upload a photo","portrait.source.uploadInstead":"Upload a photo instead","portrait.upload.title":"Upload your ID photo","portrait.upload.hint":"A recent photo of your face, looking straight at the camera, in front of a plain, light wall.","portrait.upload.choose":"Choose a photo","portrait.upload.unsupported":"Choose a JPEG, PNG or HEIC photo.","portrait.upload.failed":"We could not send this photo. Try again.","portrait.review.title":"Check your adjusted photo","portrait.review.description":"We adjusted your photo to meet the ID photo rules. Your face was not changed.","portrait.review.original":"Your photo","portrait.review.fixed":"Adjusted photo","portrait.review.fixesTitle":"What we changed","portrait.review.accept":"Use this photo","portrait.review.retake":"Take another","portrait.review.uploadAnother":"Upload another","portrait.fixes.crop":"Cropped","portrait.fixes.scale":"Resized","portrait.fixes.straighten":"Straightened","portrait.fixes.background":"Background replaced","portrait.fixes.exposure":"Brightness adjusted","portrait.fixes.white_balance":"Colours balanced","reasons.portrait_morph_suspected":"This photo cannot be used. Take a new photo of the person.","reasons.portrait_reference_mismatch":"The photo does not match the reference. Take a new photo of the person.","reasons.portrait_declined_fix":"Take or upload another photo."};var T={"portrait.source.title":"Comment voulez-vous ajouter votre photo d'identité ?","portrait.source.description":"Prenez une nouvelle photo avec la caméra, ou importez une photo récente depuis cet appareil.","portrait.source.camera":"Prendre une photo","portrait.source.upload":"Importer une photo","portrait.source.uploadInstead":"Importer une photo à la place","portrait.upload.title":"Importez votre photo d'identité","portrait.upload.hint":"Une photo récente de votre visage, de face, devant un mur clair et uni.","portrait.upload.choose":"Choisir une photo","portrait.upload.unsupported":"Choisissez une photo JPEG, PNG ou HEIC.","portrait.upload.failed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","portrait.review.title":"Vérifiez votre photo ajustée","portrait.review.description":"Nous avons ajusté votre photo pour qu'elle respecte les règles des photos d'identité. Votre visage n'a pas été modifié.","portrait.review.original":"Votre photo","portrait.review.fixed":"Photo ajustée","portrait.review.fixesTitle":"Ce que nous avons modifié","portrait.review.accept":"Utiliser cette photo","portrait.review.retake":"Reprendre","portrait.review.uploadAnother":"Importer une autre","portrait.fixes.crop":"Recadrée","portrait.fixes.scale":"Redimensionnée","portrait.fixes.straighten":"Redressée","portrait.fixes.background":"Fond remplacé","portrait.fixes.exposure":"Luminosité ajustée","portrait.fixes.white_balance":"Couleurs équilibrées","reasons.portrait_morph_suspected":"Cette photo ne peut pas être utilisée. Prenez une nouvelle photo de la personne.","reasons.portrait_reference_mismatch":"La photo ne correspond pas à la référence. Prenez une nouvelle photo de la personne.","reasons.portrait_declined_fix":"Prenez ou importez une autre photo."};import{jsx as t,jsxs as n}from"react/jsx-runtime";var H={en:g,fr:T,ar:N,es:g,pt:g,de:g},V="image/jpeg,image/png,image/heic,image/heif";function v(r){let o=r.strings,i=H[r.locale];return e=>o[e]??i[e]??""}s(v,"portraitCopy");function R({step:r,i18n:o}){if(r.reason===void 0||r.reason==="portrait_fix_review")return null;let i=v(o)(`reasons.${r.reason}`)||o.t("portrait.retryTitle");return n(x,{tone:"warning",children:[t("span",{children:i}),t("span",{children:C(o,r.attemptsRemaining,r.attemptsExhausted)})]})}s(R,"ReasonNotice");function z({step:r,i18n:o,onCamera:i,onUpload:e}){let a=v(o),p=r.photo?.cameraOnPhone===!0;return t(b,{testId:"sekyro-portrait-source",title:a("portrait.source.title"),lead:a("portrait.source.description"),cameraLabel:p?o.t("capture.source.phone"):a("portrait.source.camera"),onPhone:p,uploadLabel:a("portrait.source.upload"),notice:t(R,{step:r,i18n:o}),onCamera:i,onUpload:e})}s(z,"PortraitSourceView");function A({step:r,i18n:o,onCamera:i}){let e=v(o),a=E(null),[p,h]=k("idle"),u=p==="sending",l=r.photo?.uploadOffered===!0,w=s(async c=>{let y=c.currentTarget.files?.[0];if(c.currentTarget.value="",y!==void 0){h("sending");try{await r.uploadPortrait(y),h("idle")}catch(m){h(m instanceof TypeError&&m.message==="unsupported_file"?"unsupported":"failed")}}},"onFile");return n("section",{className:"sekyro-step","data-testid":"sekyro-portrait-upload-screen",children:[t(P,{title:e("portrait.upload.title"),lead:e("portrait.upload.hint")}),p==="idle"||p==="sending"?t(R,{step:r,i18n:o}):null,p==="unsupported"||p==="failed"?t(x,{tone:"warning",children:t("span",{children:e(p==="unsupported"?"portrait.upload.unsupported":"portrait.upload.failed")})}):null,u?t("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:o.t("portrait.uploading")}):null,t("input",{ref:a,type:"file",accept:V,hidden:!0,"data-testid":"sekyro-portrait-upload","aria-label":e("portrait.upload.title"),onChange:c=>{w(c)}}),n(S,{children:[t(f,{full:!0,onClick:()=>a.current?.click(),disabled:u||!l||r.attemptsExhausted,children:e("portrait.upload.choose")}),i!==void 0?n(f,{full:!0,kind:"ghost",onClick:i,disabled:u,children:[t(_,{name:"camera"}),e("portrait.source.camera")]}):null]})]})}s(A,"PortraitUploadView");function j({step:r,i18n:o,onDeclined:i}){let e=v(o),[a,p]=k(!1),[h,u]=k(!1),l=r.pendingFix;if(l==null)return null;let w=s(async d=>{p(!0),u(!1);try{await r.confirmFix(d),d||i?.()}catch{u(!0)}finally{p(!1)}},"answer"),c=r.photo?.source==="upload"?e("portrait.review.uploadAnother"):e("portrait.review.retake"),y=s(d=>e(`portrait.fixes.${d}`)||d,"fixName"),m=e("portrait.review.original"),U=e("portrait.review.fixed");return n("section",{className:"sekyro-step","data-testid":"sekyro-portrait-review",children:[t(P,{title:e("portrait.review.title"),lead:e("portrait.review.description")}),n("div",{className:"sekyro-portrait-pair",children:[n("figure",{className:"sekyro-portrait-pair__item",children:[t("img",{src:l.originalUrl,alt:m}),t("figcaption",{className:"sekyro-text-muted",children:m})]}),n("figure",{className:"sekyro-portrait-pair__item",children:[t("img",{src:l.fixedUrl,alt:U}),t("figcaption",{className:"sekyro-text-muted",children:U})]})]}),l.fixes.length>0?n("div",{className:"sekyro-stack sekyro-stack--1",children:[t("p",{className:"sekyro-text-body",children:e("portrait.review.fixesTitle")}),t("ul",{className:"sekyro-portrait-fixes","data-testid":"sekyro-portrait-fixes",children:l.fixes.map(d=>t("li",{children:y(d)},d))})]}):null,h?t(x,{tone:"danger",children:t("span",{children:o.t("errors.network_error")})}):null,n(S,{children:[t(f,{full:!0,onClick:()=>{w(!0)},disabled:a,"data-testid":"sekyro-portrait-accept",children:e("portrait.review.accept")}),t(f,{full:!0,kind:"ghost",onClick:()=>{w(!1)},disabled:a,"data-testid":"sekyro-portrait-decline",children:c})]})]})}s(j,"PortraitReviewView");function Q({screen:r,step:o,i18n:i,onCamera:e,onUpload:a,onDeclined:p}){return r==="phone"?t(I,{i18n:i,lead:i.t("handoff.lead.portrait"),refresh:o.refresh,actions:t(f,{kind:"ghost",full:!0,onClick:a,children:v(i)("portrait.source.upload")})}):r==="review"?t(j,{step:o,i18n:i,onDeclined:p}):r==="upload"?t(A,{step:o,i18n:i,...e!==void 0?{onCamera:e}:{}}):t(z,{step:o,i18n:i,onCamera:e??a,onUpload:a})}s(Q,"PortraitScreens");export{v as a,z as b,A as c,j as d,Q as e};
2
+ import{a as b}from"./chunk-RGI6OVB2.js";import{d as I}from"./chunk-GPPZFBYP.js";import{a as _,b as P,d as S,p as x,q as C}from"./chunk-Q5BGUJMS.js";import{a as f}from"./chunk-WC4U54LZ.js";import{a as s}from"./chunk-2KED7D2Q.js";import{useRef as E,useState as k}from"react";var N={"portrait.source.title":"كيف تريد إضافة صورتك الشخصية؟","portrait.source.description":"التقط صورة جديدة بالكاميرا، أو ارفع صورة حديثة من هذا الجهاز.","portrait.source.camera":"التقاط صورة","portrait.source.upload":"رفع صورة","portrait.source.uploadInstead":"رفع صورة بدلًا من ذلك","portrait.upload.title":"ارفع صورتك الشخصية","portrait.upload.hint":"صورة حديثة لوجهك، تنظر فيها مباشرة إلى الكاميرا، أمام جدار فاتح وبلون واحد.","portrait.upload.choose":"اختيار صورة","portrait.upload.unsupported":"اختر صورة بصيغة JPEG أو PNG أو HEIC.","portrait.upload.failed":"تعذّر إرسال هذه الصورة. حاول مرة أخرى.","portrait.review.title":"تحقّق من صورتك المعدّلة","portrait.review.description":"عدّلنا صورتك لتطابق قواعد صور الهوية. لم نغيّر وجهك.","portrait.review.original":"صورتك","portrait.review.fixed":"الصورة المعدّلة","portrait.review.fixesTitle":"ما الذي غيّرناه","portrait.review.accept":"استخدام هذه الصورة","portrait.review.retake":"إعادة الالتقاط","portrait.review.uploadAnother":"رفع صورة أخرى","portrait.fixes.crop":"قُصّت","portrait.fixes.scale":"غُيّر حجمها","portrait.fixes.straighten":"عُدّل ميلها","portrait.fixes.background":"استُبدلت الخلفية","portrait.fixes.exposure":"عُدّل السطوع","portrait.fixes.white_balance":"وُزنت الألوان","reasons.portrait_morph_suspected":"لا يمكن استخدام هذه الصورة. التقط صورة جديدة للشخص.","reasons.portrait_reference_mismatch":"لا تطابق الصورة المرجع. التقط صورة جديدة للشخص.","reasons.portrait_declined_fix":"التقط صورة أخرى أو ارفعها."};var g={"portrait.source.title":"How do you want to add your ID photo?","portrait.source.description":"Take a new photo with the camera, or upload a recent photo from this device.","portrait.source.camera":"Take a photo","portrait.source.upload":"Upload a photo","portrait.source.uploadInstead":"Upload a photo instead","portrait.upload.title":"Upload your ID photo","portrait.upload.hint":"A recent photo of your face, looking straight at the camera, in front of a plain, light wall.","portrait.upload.choose":"Choose a photo","portrait.upload.unsupported":"Choose a JPEG, PNG or HEIC photo.","portrait.upload.failed":"We could not send this photo. Try again.","portrait.review.title":"Check your adjusted photo","portrait.review.description":"We adjusted your photo to meet the ID photo rules. Your face was not changed.","portrait.review.original":"Your photo","portrait.review.fixed":"Adjusted photo","portrait.review.fixesTitle":"What we changed","portrait.review.accept":"Use this photo","portrait.review.retake":"Take another","portrait.review.uploadAnother":"Upload another","portrait.fixes.crop":"Cropped","portrait.fixes.scale":"Resized","portrait.fixes.straighten":"Straightened","portrait.fixes.background":"Background replaced","portrait.fixes.exposure":"Brightness adjusted","portrait.fixes.white_balance":"Colours balanced","reasons.portrait_morph_suspected":"This photo cannot be used. Take a new photo of the person.","reasons.portrait_reference_mismatch":"The photo does not match the reference. Take a new photo of the person.","reasons.portrait_declined_fix":"Take or upload another photo."};var T={"portrait.source.title":"Comment voulez-vous ajouter votre photo d'identité ?","portrait.source.description":"Prenez une nouvelle photo avec la caméra, ou importez une photo récente depuis cet appareil.","portrait.source.camera":"Prendre une photo","portrait.source.upload":"Importer une photo","portrait.source.uploadInstead":"Importer une photo à la place","portrait.upload.title":"Importez votre photo d'identité","portrait.upload.hint":"Une photo récente de votre visage, de face, devant un mur clair et uni.","portrait.upload.choose":"Choisir une photo","portrait.upload.unsupported":"Choisissez une photo JPEG, PNG ou HEIC.","portrait.upload.failed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","portrait.review.title":"Vérifiez votre photo ajustée","portrait.review.description":"Nous avons ajusté votre photo pour qu'elle respecte les règles des photos d'identité. Votre visage n'a pas été modifié.","portrait.review.original":"Votre photo","portrait.review.fixed":"Photo ajustée","portrait.review.fixesTitle":"Ce que nous avons modifié","portrait.review.accept":"Utiliser cette photo","portrait.review.retake":"Reprendre","portrait.review.uploadAnother":"Importer une autre","portrait.fixes.crop":"Recadrée","portrait.fixes.scale":"Redimensionnée","portrait.fixes.straighten":"Redressée","portrait.fixes.background":"Fond remplacé","portrait.fixes.exposure":"Luminosité ajustée","portrait.fixes.white_balance":"Couleurs équilibrées","reasons.portrait_morph_suspected":"Cette photo ne peut pas être utilisée. Prenez une nouvelle photo de la personne.","reasons.portrait_reference_mismatch":"La photo ne correspond pas à la référence. Prenez une nouvelle photo de la personne.","reasons.portrait_declined_fix":"Prenez ou importez une autre photo."};import{jsx as t,jsxs as n}from"react/jsx-runtime";var H={en:g,fr:T,ar:N,es:g,pt:g,de:g},V="image/jpeg,image/png,image/heic,image/heif";function v(r){let o=r.strings,i=H[r.locale];return e=>o[e]??i[e]??""}s(v,"portraitCopy");function R({step:r,i18n:o}){if(r.reason===void 0||r.reason==="portrait_fix_review")return null;let i=v(o)(`reasons.${r.reason}`)||o.t("portrait.retryTitle");return n(x,{tone:"warning",children:[t("span",{children:i}),t("span",{children:C(o,r.attemptsRemaining,r.attemptsExhausted)})]})}s(R,"ReasonNotice");function z({step:r,i18n:o,onCamera:i,onUpload:e}){let a=v(o),p=r.photo?.cameraOnPhone===!0;return t(b,{testId:"sekyro-portrait-source",title:a("portrait.source.title"),lead:a("portrait.source.description"),cameraLabel:p?o.t("capture.source.phone"):a("portrait.source.camera"),onPhone:p,uploadLabel:a("portrait.source.upload"),notice:t(R,{step:r,i18n:o}),onCamera:i,onUpload:e})}s(z,"PortraitSourceView");function A({step:r,i18n:o,onCamera:i}){let e=v(o),a=E(null),[p,h]=k("idle"),u=p==="sending",l=r.photo?.uploadOffered===!0,w=s(async c=>{let y=c.currentTarget.files?.[0];if(c.currentTarget.value="",y!==void 0){h("sending");try{await r.uploadPortrait(y),h("idle")}catch(m){h(m instanceof TypeError&&m.message==="unsupported_file"?"unsupported":"failed")}}},"onFile");return n("section",{className:"sekyro-step","data-testid":"sekyro-portrait-upload-screen",children:[t(P,{title:e("portrait.upload.title"),lead:e("portrait.upload.hint")}),p==="idle"||p==="sending"?t(R,{step:r,i18n:o}):null,p==="unsupported"||p==="failed"?t(x,{tone:"warning",children:t("span",{children:e(p==="unsupported"?"portrait.upload.unsupported":"portrait.upload.failed")})}):null,u?t("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:o.t("portrait.uploading")}):null,t("input",{ref:a,type:"file",accept:V,hidden:!0,"data-testid":"sekyro-portrait-upload","aria-label":e("portrait.upload.title"),onChange:c=>{w(c)}}),n(S,{children:[t(f,{full:!0,onClick:()=>a.current?.click(),disabled:u||!l||r.attemptsExhausted,children:e("portrait.upload.choose")}),i!==void 0?n(f,{full:!0,kind:"ghost",onClick:i,disabled:u,children:[t(_,{name:"camera"}),e("portrait.source.camera")]}):null]})]})}s(A,"PortraitUploadView");function j({step:r,i18n:o,onDeclined:i}){let e=v(o),[a,p]=k(!1),[h,u]=k(!1),l=r.pendingFix;if(l==null)return null;let w=s(async d=>{p(!0),u(!1);try{await r.confirmFix(d),d||i?.()}catch{u(!0)}finally{p(!1)}},"answer"),c=r.photo?.source==="upload"?e("portrait.review.uploadAnother"):e("portrait.review.retake"),y=s(d=>e(`portrait.fixes.${d}`)||d,"fixName"),m=e("portrait.review.original"),U=e("portrait.review.fixed");return n("section",{className:"sekyro-step","data-testid":"sekyro-portrait-review",children:[t(P,{title:e("portrait.review.title"),lead:e("portrait.review.description")}),n("div",{className:"sekyro-portrait-pair",children:[n("figure",{className:"sekyro-portrait-pair__item",children:[t("img",{src:l.originalUrl,alt:m}),t("figcaption",{className:"sekyro-text-muted",children:m})]}),n("figure",{className:"sekyro-portrait-pair__item",children:[t("img",{src:l.fixedUrl,alt:U}),t("figcaption",{className:"sekyro-text-muted",children:U})]})]}),l.fixes.length>0?n("div",{className:"sekyro-stack sekyro-stack--1",children:[t("p",{className:"sekyro-text-body",children:e("portrait.review.fixesTitle")}),t("ul",{className:"sekyro-portrait-fixes","data-testid":"sekyro-portrait-fixes",children:l.fixes.map(d=>t("li",{children:y(d)},d))})]}):null,h?t(x,{tone:"danger",children:t("span",{children:o.t("errors.network_error")})}):null,n(S,{children:[t(f,{full:!0,onClick:()=>{w(!0)},disabled:a,"data-testid":"sekyro-portrait-accept",children:e("portrait.review.accept")}),t(f,{full:!0,kind:"ghost",onClick:()=>{w(!1)},disabled:a,"data-testid":"sekyro-portrait-decline",children:c})]})]})}s(j,"PortraitReviewView");function Q({screen:r,step:o,i18n:i,onCamera:e,onUpload:a,onDeclined:p}){return r==="phone"?t(I,{i18n:i,lead:i.t("handoff.lead.portrait"),refresh:o.refresh,actions:t(f,{kind:"ghost",full:!0,onClick:a,children:v(i)("portrait.source.upload")})}):r==="review"?t(j,{step:o,i18n:i,onDeclined:p}):r==="upload"?t(A,{step:o,i18n:i,...e!==void 0?{onCamera:e}:{}}):t(z,{step:o,i18n:i,onCamera:e??a,onUpload:a})}s(Q,"PortraitScreens");export{v as a,z as b,A as c,j as d,Q as e};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a as sn,c as cn}from"./chunk-M7JKVIGW.js";import{b as an,c as Qe}from"./chunk-7MMT5M4E.js";import{a as nn,b as rn,c as on,d as z}from"./chunk-DYWLZHSM.js";import{a as F,k as Wt,l as Qt,n as Jt,o as Xt,p as en,q as tn,r as D,s as Je}from"./chunk-WC4U54LZ.js";import{a as n}from"./chunk-2KED7D2Q.js";import{useId as Cr}from"react";import{Fragment as vr,jsx as _,jsxs as te}from"react/jsx-runtime";function ne({className:e,children:t}){return _("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}n(ne,"Svg");var gt="M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z";function ln(e){return te(ne,{...e,children:[_("circle",{cx:"12",cy:"12",r:"4"}),_("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}n(ln,"SunIcon");function un(e){return te(ne,{...e,children:[_("circle",{cx:"12",cy:"12",r:"9"}),_("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}n(un,"FaceUncoveredIcon");function dn(e){return te(ne,{...e,children:[_("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),_("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),_("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}n(dn,"PhoneEyeLevelIcon");function pn(e){return te(ne,{...e,children:[_("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),_("circle",{cx:"12",cy:"12",r:"2.8"})]})}n(pn,"LookStraightIcon");function fn(e){return te(ne,{...e,children:[_("path",{d:gt}),_("path",{d:"M9 13l2 2 4-4"})]})}n(fn,"CameraCheckIcon");function mn(e){return te(ne,{...e,children:[_("path",{d:gt}),_("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}n(mn,"CameraAskIcon");function yn(e){return te(ne,{...e,children:[_("path",{d:gt}),_("path",{d:"M3 3l18 18"})]})}n(yn,"CameraBlockedIcon");function Ve({off:e,className:t}){return te(ne,{className:t,children:[_("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?_("path",{d:"M4 4l16 16"}):te(vr,{children:[_("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),_("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}n(Ve,"SpeakerIcon");function gn(e){return _(ne,{...e,children:_("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}n(gn,"CheckIcon");function hn(e){return te(ne,{className:e.className??"sekyro-spinner",children:[_("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),_("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}n(hn,"SpinnerIcon");import{jsx as pe,jsxs as vn}from"react/jsx-runtime";var Xe=["light","uncover","eyeLevel","straight"],kr={light:{key:"capture.tips.light",icon:n(()=>pe(ln,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:n(()=>pe(un,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:n(()=>pe(dn,{}),"icon")},straight:{key:"capture.tips.straight",icon:n(()=>pe(pn,{}),"icon")}};function Cn({tips:e}){let t=z(),o=Cr();return e.length===0?null:vn("section",{className:"sekyro-tips","aria-labelledby":o,"data-testid":"sekyro-tips",children:[pe("p",{className:"sekyro-tips__title",id:o,children:t("capture.tips.title")}),pe("ul",{className:"sekyro-tips__list",children:e.map(r=>{let s=typeof r=="string"?kr[r]:void 0,c=typeof r=="string"?r:r.id,a=s!==void 0?s.icon():typeof r=="string"?void 0:r.icon,d=s!==void 0?t(s.key):typeof r=="string"?r:r.text;return vn("li",{className:"sekyro-tips__item",children:[a!=null?pe("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:a}):null,pe("span",{children:d})]},c)})})]})}n(Cn,"TipList");import{useEffect as kn,useId as br,useRef as Sr,useState as Rr}from"react";import{jsx as Q,jsxs as et}from"react/jsx-runtime";var Vr=220;function bn({title:e,description:t,options:o,busy:r,error:s,focus:c,testId:a,look:d="cards",marked:k,onChoose:b}){let y=br(),w=Je(),[V,A]=Rr(null),x=Sr(null);kn(()=>{s!==null&&A(null)},[s]),kn(()=>()=>{x.current!==null&&clearTimeout(x.current)},[]);let E=n(v=>{r||V!==null||(A(v),x.current=setTimeout(()=>{x.current=null,A(null),b(v)},Vr))},"choose");return et("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":y,"data-testid":a,children:[et("div",{className:d==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[Q("h2",{id:y,ref:c?w:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?Q("p",{className:"sekyro-text-muted",children:t}):null]}),s!==null?Q(D,{tone:"danger",children:Q("span",{children:s})}):null,d==="buttons"?Q("div",{className:"sekyro-stack sekyro-stack--3",children:o.map((v,Y)=>Q(F,{kind:Y===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:()=>b(v.id),children:v.label},v.id))}):Q("div",{className:"sekyro-choices",children:o.map(v=>et("button",{type:"button",className:"sekyro-card","aria-pressed":(V??k)===v.id,"aria-busy":r||void 0,disabled:r||V!==null&&V!==v.id,onClick:()=>E(v.id),children:[v.glyph!==void 0?Q("span",{className:"sekyro-card__tile",children:v.glyph}):null,et("span",{className:"sekyro-card__body",children:[Q("span",{className:"sekyro-card__title",children:v.label}),v.sub!==void 0?Q("span",{className:"sekyro-card__sub",children:v.sub}):null]}),Q("span",{className:"sekyro-radio","aria-hidden":"true"})]},v.id))})]})}n(bn,"ChoiceScreen");var tt=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","fcv3.one_face","capture.tips.summary","capture.lookAtColours"];function he(e){return e!==null&&tt.includes(e)}n(he,"isVoiceKey");import{useCallback as oe,useEffect as ve,useLayoutEffect as _r,useMemo as Ir,useRef as we,useState as Oe}from"react";var Mr=n((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function Me(e,t,o){let r;try{if(typeof e=="function")r=e(t,o);else{let s=e[o];r=s!=null&&Mr(s,t)?s[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}n(Me,"resolveClip");var wr="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",Vn={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function re(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}n(re,"synth");function Lr(){return re()!==null&&typeof SpeechSynthesisUtterance=="function"}n(Lr,"speechAvailable");function Sn(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}n(Sn,"baseLang");function Mn(e,t){let o=n(s=>s.replace(/_/g,"-").toLowerCase(),"norm"),r=Sn(t);return e.find(s=>o(s.lang)===o(t))??e.find(s=>Sn(s.lang)===r)}n(Mn,"pickVoice");function wn(e){if(!Lr())return!1;let t=[];try{t=re()?.getVoices()??[]}catch{return!0}return t.length===0||Mn(t,e)!==void 0}n(wn,"speechUsable");function Ln(e){let t=re();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}n(Ln,"subscribeVoices");function Ke(e){try{let t=typeof location<"u"?location.href:"http://localhost/",o=new URL(e,t);return`clip:${o.origin}${o.pathname}`}catch{return`clip:${e}`}}n(Ke,"clipIdentity");function Rn(e){e.pause(),e.removeAttribute("src"),e.load()}n(Rn,"release");function _n(){let e=null,t=null,o=0,r=null,s=null,c=null,a=!1,d=null,k=[],b=new Map,y=n(()=>{k=re()?.getVoices()??[]},"loadVoices"),w=!1,V=n(()=>{let u=re();w||u===null||(w=!0,y(),u.addEventListener?.("voiceschanged",y))},"bindVoices"),A=n(()=>(e??(e=new Audio),e),"element"),x=n((u,C,f,g)=>{let l=re();if(l!==null&&u!==""&&typeof SpeechSynthesisUtterance=="function"){V();let R=Mn(k,C);if(k.length===0||R!==void 0){l.cancel();let S=new SpeechSynthesisUtterance(u);S.lang=C,R!==void 0&&(S.voice=R),S.rate=.95,f!==void 0&&(S.onend=f),(f!==void 0||g!==void 0)&&(S.onerror=T=>{g!==void 0&&T.error==="not-allowed"?g():f?.()}),l.speak(S);return}}f?.()},"speak"),E=n(()=>{o+=1,r=null,s=c=null,e!==null&&(e.pause(),e.currentTime=0),re()?.cancel()},"stop"),v=n(u=>{for(let C of u){let f=Ke(C);if(b.has(f))continue;let g=new Audio;g.preload="auto",g.src=C,b.set(f,g)}},"warmClips"),Y=n((u,C,f)=>{let g={utterance:u,generation:C,end:f};d=g;let l=n(()=>C===o&&d===g,"live"),R=n(()=>{l()&&(s=g)},"block");if(re()?.cancel(),u.url!==null){let S=A();S.pause(),S.muted=!1,S.src=u.url,S.currentTime=0,S.onended=f??null;let T=n(()=>{c===g&&(c=null)},"settled"),i=S.play();if(i===void 0)return;c=g,i.then(T,I=>{if(T(),!l())return;let L=I?.name;if(L!=="AbortError"){if(L==="NotAllowedError")return R();u.speech?x(u.text,u.lang,f,R):f?.()}});return}u.speech?x(u.text,u.lang,f,R):f?.()},"start");return{say(u){let C=u.url!==null?Ke(u.url):`tts:${u.lang}:${u.text}`;if(C===r)return;r=C,s=c=null,o+=1;let f=o,g=u.onEnd;Y(u,f,g!==void 0?()=>{f===o&&g()}:void 0)},unlock({lang:u,speech:C,prefetch:f}){let g=s??(a?null:c);a=!0;let l=g!==null&&g.generation===o?g:null;s=c=null,l!==null&&Y(l.utterance,l.generation,l.end);let R=A();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let I=Uint8Array.from(atob(wr),L=>L.charCodeAt(0));t=URL.createObjectURL(new Blob([I],{type:"audio/wav"}))}let S=R.paused===!1&&t!==null&&R.src!==t;t!==null&&!S&&(l===null||l.utterance.url===null)&&(R.muted=!0,R.onended=null,R.src=t,R.play()?.catch(()=>{}));let T=re(),i=l!==null&&l.utterance.url===null;if(C&&!i&&T!==null&&typeof SpeechSynthesisUtterance=="function"){V();let I=new SpeechSynthesisUtterance(" ");I.volume=0,I.lang=u,T.speak(I)}v(f??[])},prefetch:v,stop:E,dispose(){E(),w&&re()?.removeEventListener?.("voiceschanged",y),w=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&Rn(e),e=null;for(let u of b.values())Rn(u);b.clear()}}}n(_n,"createVoicePlayer");var In="sekyro.voiceGuidance";function xn(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}n(xn,"readVoicePreference");function En(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}n(En,"writeVoicePreference");var Ue="capture.tips.summary",xr=typeof window<"u"?_r:ve,Er=Object.freeze({});function ht(e,t){let o=new Set,r=[];for(let s of tt){let c=s===Ue?null:Me(e,s,t);c===null||o.has(Ke(c))||(o.add(Ke(c)),r.push(c))}return r}n(ht,"resolvedClipUrls");function vt({locale:e,defaultClips:t,options:o}){let r=o===!1,s=r?{}:o??{},c=s.storageKey===void 0?In:s.storageKey,[a,d]=Oe(s.defaultEnabled??!0),k=we(a),[b,y]=Oe(!1),[w,V]=Oe("none"),[A,x]=Oe(!1),E=we(!1),[v,Y]=Oe(0),u=we(null),C=oe(()=>(u.current??(u.current=_n()),u.current),[]),f=Vn[e],g=s.speechFallback,l=g===void 0||g===!0?!0:g===!1?!1:g.includes(e),R=s.clips??t??Er,S=we(!1),T=we(R);xr(()=>{T.current=R,k.current=a}),ve(()=>{if(r||c===null)return;let h=xn(c);h!==null&&(k.current=h,d(h))},[r,c]),ve(()=>{if(!(r||!l))return Ln(()=>Y(h=>h+1))},[r,l]);let i=s.clips;ve(()=>{if(r)return;let h=l&&wn(f);y(ht(R,e).length>0||h),V(i!==void 0&&Me(i,Ue,e)!==null?"partner":Me(R,Ue,e)!==null||h?"default":"none")},[r,R,i,e,l,f,v]),ve(()=>{if(r||!a||!S.current)return;let h=ht(R,e);h.length>0&&C().prefetch(h)},[r,a,R,e,C]),ve(()=>()=>{u.current?.dispose(),u.current=null,S.current=!1},[]);let I=oe(h=>{r||(S.current=!0,C().unlock({lang:f,speech:l,...h?{prefetch:ht(T.current,e)}:{}}))},[r,C,f,l,e]),L=oe(()=>I(k.current),[I]),B=oe(()=>{E.current=!1,x(!1)},[]),K=oe(()=>{B(),u.current?.stop()},[B]),ie=oe(()=>{E.current&&K()},[K]),ae=oe((h,me)=>{if(r)return;if(E.current){K();return}let ce=C();ce.stop(),E.current=!0,x(!0);let N=me?.clip===!1?null:Me(T.current,Ue,e);ce.say({url:N,text:h,lang:f,speech:l,onEnd:B})},[r,K,C,e,f,l,B]),O=oe(h=>{r||(h?I(!0):K(),c!==null&&En(c,h),k.current=h,d(h))},[r,I,K,c]),G=oe(()=>O(!k.current),[O]),fe=oe((h,me)=>{if(r||!a)return;E.current&&B();let ce=Me(T.current,h,e);C().say({url:ce,text:me,lang:f,speech:l})},[r,a,e,C,f,l,B]);return Ir(()=>({supported:!r&&b,enabled:!r&&a,setEnabled:O,toggle:G,unlock:L,speakKey:fe,stop:K,summary:r?"none":w,summaryPlaying:A,toggleSummary:ae,stopSummary:ie}),[r,b,a,O,G,L,fe,K,w,A,ae,ie])}n(vt,"useVoiceGuidance");function Ct(e,t,o,r){let{speakKey:s,stop:c,enabled:a}=e,d=we(!1);ve(()=>{if(!r||!a){d.current&&c(),d.current=!1;return}d.current=!0,he(t)&&t!==Ue&&o!==""&&s(t,o)},[r,a,t,o,s,c])}n(Ct,"useSpeakGuidance");import{isValidElement as ao,useCallback as it,useContext as co,useEffect as se,useMemo as Ie,useRef as ke,useState as ir}from"react";import{useEffect as Ar,useRef as Nr}from"react";import{jsx as He,jsxs as Nn}from"react/jsx-runtime";function Pn(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}n(Pn,"retryCoachingOf");var An={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function Tn({showCoaching:e,coaching:t="face",attemptsText:o,showRetake:r,onRetake:s}){let c=z(),a=Nr(null);return Ar(()=>{r&&a.current?.focus()},[r]),!e&&!r?null:Nn("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?Nn("div",{className:"sekyro-stack sekyro-stack--1",children:[He("p",{className:"sekyro-text-body",children:c(An[t].title)}),He("ul",{className:"sekyro-coaching",children:An[t].tips.map(d=>He("li",{children:c(d)},d))}),o!==null?He("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:o}):null]}):null,r?He(F,{ref:a,className:"sekyro-btn--start",onClick:s,children:c("capture.recordAgain")}):null]})}n(Tn,"CapturedPanel");function nt(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}n(nt,"isDevBuild");import{createContext as Pr}from"react";var Kn=Pr(null);import{useCallback as Gn,useEffect as Bn,useRef as Le}from"react";import{useEffect as Tr,useState as Kr}from"react";import{jsx as Ge,jsxs as Or}from"react/jsx-runtime";function On({state:e}){let t=z(),[o,r]=Kr(!1);Tr(()=>{e!=="unknown"&&r(!0)},[e]);let s=e==="granted"?Ge(fn,{}):e==="denied"?Ge(yn,{}):Ge(mn,{});return Or("div",{role:o?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[Ge("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:s}),Ge("span",{children:t(`capture.permission.${e}`)})]})}n(On,"PermissionRow");import{jsx as rt,jsxs as Un}from"react/jsx-runtime";function Hn({voice:e}){let t=z();if(!e.supported)return null;let o=e.enabled;return Un("button",{type:"button",role:"switch","aria-checked":o,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:()=>e.toggle(),children:[Un("span",{className:"sekyro-switch__label",children:[rt(Ve,{off:!o}),t("capture.voiceGuidance")]}),rt("span",{className:"sekyro-switch__track","aria-hidden":"true",children:rt("span",{className:"sekyro-switch__thumb",children:o?rt(gn,{className:"sekyro-switch__check"}):null})})]})}n(Hn,"VoiceSwitch");import{Fragment as Hr,jsx as q,jsxs as _e}from"react/jsx-runtime";function Fn({assets:e,onRetryAssets:t,permission:o,captureMode:r="self",voice:s,tips:c,summary:a,startLabel:d,startDisabled:k,onStart:b}){let y=z(),w=Le(a?.stop);w.current=a?.stop,Bn(()=>()=>w.current?.(),[]);let V=Le(null),A=Le(null),x=Le(null),E=Le(e),v=Le(!1);Bn(()=>{let R=E.current;if(E.current=e,R===e)return;let S=v.current;e!=="loading"&&(v.current=!1),Ur(V.current)&&(e==="failed"?x.current?.focus():S&&A.current?.focus())},[e]);let Y=Gn(()=>{v.current=!0,t()},[t]),u=e==="loading",C=u||k,f=Gn(()=>{C||(w.current?.(),b())},[C,b]),g;return e==="failed"?g=_e(D,{tone:"danger",testId:"sekyro-assets-error",children:[q("p",{className:"sekyro-text-body",children:y("fcv2.err.models")}),q(F,{kind:"ghost",ref:x,className:"sekyro-btn--start",onClick:Y,"data-testid":"sekyro-assets-retry",children:y("common.retry")})]}):g=_e("div",{className:"sekyro-stack sekyro-stack--1",children:[q(F,{ref:A,full:!0,"data-testid":"sekyro-start","aria-disabled":C?"true":void 0,"aria-busy":u?"true":void 0,onClick:f,children:u?_e(Hr,{children:[q(hn,{}),y("capture.preparing.title")]}):d??y("capture.start")}),u?q("p",{className:"sekyro-text-muted",children:y("capture.preparing.hint")}):null]}),_e("div",{ref:V,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?_e("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[q("h2",{className:"sekyro-text-body",children:y("capture.assisted.title")}),q("p",{className:"sekyro-text-muted",children:y("capture.assisted.lead")})]}):null,c!==!1?q(Cn,{tips:c}):null,a!==void 0?_e(F,{kind:"ghost",className:"sekyro-btn--start",onClick:a.toggle,"data-testid":"sekyro-tips-listen",children:[q(Ve,{off:!1}),y(a.playing?"capture.tips.stop":"capture.tips.listen")]}):null,q(On,{state:o}),q(Hn,{voice:s}),q("p",{className:"sekyro-text-muted",children:y("capture.securityNote")}),g,q("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?y("capture.preparing.title"):e==="ready"?y("capture.ready"):""})]})}n(Fn,"PreCaptureScreen");function Ur(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}n(Ur,"focusIsOurs");import{subscribeCameraPermission as Gr}from"@sekyro/web";import{useEffect as Br,useState as Fr}from"react";function Dn(){let[e,t]=Fr({state:"unknown",settled:!1});return Br(()=>Gr(o=>t({state:o,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}n(Dn,"useCameraStatus");import{useCallback as Dr,useEffect as kt,useState as bt}from"react";function qn(e){return Yn(e,"mobileRequired")}n(qn,"useMobileRequired");function jn(e){return Yn(e,"returning").required}n(jn,"useReturning");function Yn(e,t){let[o,r]=bt({required:!1,settled:e===void 0});return kt(()=>{let s=e?.[t];if(e===void 0||typeof s!="function"){r({required:!1,settled:!0});return}let c=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>s.call(e)).then(a=>{c&&r({required:a===!0,settled:!0})},()=>{c&&r({required:!1,settled:!0})}),()=>{c=!1}},[e,t]),o}n(Yn,"useFlag");function $n(e){let t=n(()=>e?.captureChoice??null,"initialChoice"),[o,r]=bt(()=>({session:"self",choice:t(),settled:e===void 0}));kt(()=>{let a=e?.captureMode,d=e?.captureChoice??null;if(e===void 0||typeof a!="function"){r({session:"self",choice:d,settled:!0});return}let k=!0;return r({session:"self",choice:d,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(b=>{let y=e.captureChoice??null;k&&r({session:y!==null&&b===y?"choice":b==="assisted"||b==="choice"?b:"self",choice:y,settled:!0})},()=>{k&&r({session:"self",choice:null,settled:!0})}),()=>{k=!1}},[e]);let s=Dr(a=>{e?.chooseCaptureMode?.(a),r(d=>({...d,choice:a}))},[e]);return{mode:o.session==="choice"?o.choice??"self":o.session==="assisted"?"assisted":"self",session:o.session,choice:o.choice,settled:o.settled,choose:s}}n($n,"useCaptureMode");function zn(e){let[t,o]=bt(!1);return kt(()=>{if(o(!1),e===void 0)return;let r=e.on("busy",()=>o(!0)),s=e.on("result",()=>o(!1));return()=>{r(),s()}},[e]),t}n(zn,"useBusy");import{getLivenessAssetsStatus as qr,preloadLivenessAssets as jr,subscribeLivenessAssets as Yr}from"@sekyro/web";import{useCallback as St,useEffect as Zn,useRef as Wn,useState as $r,useSyncExternalStore as zr}from"react";var Zr=n(()=>"idle","serverSnapshot");function Qn(e){return jr(e!==void 0?{assetBaseUrl:e}:{})}n(Qn,"preload");function Jn(e,t=!0){let o=zr(St(w=>Yr(w,e),[e]),()=>qr(e),Zr),[r,s]=$r(null),c=Wn(!1),a=St(()=>{Qn(e).then(w=>{c.current&&w==="idle"&&s({base:e})})},[e]);Zn(()=>(c.current=!0,a(),()=>{c.current=!1}),[a]);let d=Wn(null);Zn(()=>{if(o!=="idle"){d.current={base:e};return}!t||d.current===null||d.current.base!==e||(d.current=null,a())},[o,e,a,t]);let k=St(()=>{Qn(e)},[e]);return{gate:r!==null&&r.base===e&&o==="idle"||o==="ready"?"ready":o==="failed"?"failed":"loading",retry:k}}n(Jn,"useLivenessAssets");import{createLivenessCapture as Wr}from"@sekyro/web";import{useCallback as ot,useEffect as Qr,useRef as Ce,useState as j}from"react";var Xn={progress:0,hint:null,faceDetected:!1};function er(e){let{videoRef:t,assetBaseUrl:o}=e,s=Ce(e.verification).current,c=Ce(!1);e.verification!==s&&!c.current&&nt()&&(c.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let a=Ce(null),[d,k]=j("idle"),[b,y]=j(Xn),[w,V]=j(!1),[A,x]=j(!1),[E,v]=j(null),[Y,u]=j(!1),[C,f]=j(null),[g,l]=j(null),[R,S]=j(null),[T,i]=j(null),[I,L]=j(null),[B,K]=j(!1),ie=Ce(null),ae=Ce("idle"),O=Ce(-1),[G,fe]=j(0),h=Ce(e);h.current=e,Qr(()=>{let Z=t.current;if(Z===null)return;let J={video:Z,...o!==void 0?{assetBaseUrl:o}:{}},P=s!==void 0?s.liveness(J):Wr(J);a.current=P;let Ae=n(()=>L(P.facingMode??null),"readFacing");Ae();let Be=[P.on("state",m=>{m==="mode_switch"?K(!0):m!=="starting"&&m!=="gating"&&K(!1),m==="starting"?(ae.current!=="starting"&&(O.current+=1,fe(Math.max(0,O.current))),l(null),S(null),y(Xn),x(!1),V(!1),v(null),f(null),ie.current=null):m==="gating"&&ae.current==="recording"&&(x(!1),V(!1),v(null),ie.current=null),ae.current=m,Ae(),k(m),h.current.onStateChange?.(m)}),P.on("gate",m=>{let X=ie.current;ie.current=m.progress,V(X!==null&&m.progress<X-.001&&m.progress>0&&m.progress<1),m.progress>=1&&x(!0),y(m)}),P.on("frozen",({previewDataUrl:m})=>v(m)),P.on("profile",({animations:m})=>u(m==="reduced")),P.on("ramp",({colour:m})=>f(m)),P.on("captured",m=>{l(m),i(null),h.current.onCaptured?.(m)}),P.on("error",m=>{S(m);let X=s?.reportCaptureIssue;X!==void 0&&Qe(ye=>X.call(s,ye),an("liveness",m,Math.max(0,O.current))),h.current.onError?.(m)}),s?.on("result",m=>{i(m),h.current.onResult?.(m)})];return()=>{for(let m of Be)m?.();a.current=null,P.destroy()}},[s,t,o]);let me=ot(()=>{a.current?.start()},[]),ce=ot(()=>{a.current?.retry()},[]),N=ot(async()=>{let Z=a.current;return Z===null||typeof Z.canSwitchCaptureMode!="function"?!1:await Z.canSwitchCaptureMode().catch(()=>!1)===!0},[]),Ee=ot(async Z=>{let J=a.current;if(J===null||typeof J.setCaptureMode!="function")return!1;let P=await J.setCaptureMode(Z).catch(()=>!1)===!0;return P&&L(J.facingMode??null),P},[]);return{state:d,gate:b,draining:w,gateLocked:A,frozenPreview:E,reduceMotion:Y,rampColour:C,artifacts:g,error:R,result:T,facingMode:I,start:me,retry:ce,canSwitchCaptureMode:N,setCaptureMode:Ee,modeRestarted:B,attempt:G}}n(er,"useLivenessHandle");import{useCallback as Jr,useEffect as Xr,useState as st}from"react";var eo=new Set(["national_number"]);function tr(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(o=>eo.has(o));return t.length>0?{...e,options:t}:null}n(tr,"pending");function nr(e){let[t,o]=st(null),[r,s]=st(e===void 0),[c,a]=st(!1),[d,k]=st(!1);Xr(()=>{if(o(null),e===void 0){s(!0);return}let V=!0,A=e.methodChoice;typeof A=="function"?(s(!1),Promise.resolve().then(()=>A.call(e)).then(E=>{V&&o(tr(E))},()=>{}).finally(()=>{V&&s(!0)})):s(!0);let x=e.on("method",E=>o(tr(E)));return()=>{V=!1,x()}},[e]);let b=Jr(async V=>{if(e===void 0)return!1;a(!0),k(!1);try{return await e.selectMethod(V),o(null),!0}catch{return k(!0),!1}finally{a(!1)}},[e]),y=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:y==="national_number"&&!d?y:null,settled:r,busy:c,failed:d,select:b}}n(nr,"useMethodChoice");import{useEffect as to,useMemo as no,useState as ro}from"react";var oo=["ar","fr","en"];function so(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}n(so,"isClipUrl");function io(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let o={};for(let r of oo){let s=t[r];if(!(typeof s!="object"||s===null))for(let[c,a]of Object.entries(s))!he(c)||!so(a)||((o[r]??(o[r]={}))[c]=a)}return Object.keys(o).length>0?o:null}n(io,"toVoiceClipMap");function rr(e){let[t,o]=ro(null);to(()=>{if(o(null),e===void 0)return;let s=!0,c=n(d=>{if(!s)return;let k=typeof d=="object"&&d!==null&&typeof d.setId=="string"?d:null;o(b=>b?.setId===k?.setId?b:k)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(c,()=>c(null))}catch{c(null)}let a=e.on("view",d=>c(d.voice));return()=>{s=!1,a()}},[e]);let r=no(()=>t!==null?io(t):null,[t]);return e===void 0?null:r}n(rr,"useServerVoiceClips");import{jsx as or}from"react/jsx-runtime";function sr({voice:e}){let t=z();return or(F,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:()=>e.toggle(),children:or(Ve,{off:!e.enabled,className:"sekyro-icon"})})}n(sr,"VoiceChip");import{Fragment as ar,jsx as M,jsxs as xe}from"react/jsx-runtime";var lo=new Set(["abandoned","not_opened","cancelled","superseded"]),uo=800,po="capture.lookAtColours";function fo(e){return e===void 0||e!==!1&&e.length===Xe.length&&Xe.every(t=>e.includes(t))}n(fo,"isDefaultTips");function mo(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}n(mo,"carriesActivation");function yo(e){return typeof e=="object"&&e!==null&&!ao(e)&&"tone"in e&&"text"in e}n(yo,"isNoticeObject");var go=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function ho(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}n(ho,"isCapturing");function vo(e){return e==="captured"||e==="uploading"||e==="checking"}n(vo,"isPostCapture");function xi({verification:e,locale:t,dir:o,strings:r,slots:s,autoStart:c=!1,notice:a,startDisabled:d=!1,startLabel:k,tips:b,tipsSummary:y,coach:w,voice:V,onGuidance:A,onCaptured:x,onResult:E,onError:v,onStateChange:Y,assetBaseUrl:u,className:C}){let f=rn(t),g=Ie(()=>nn(t,r),[t,r,f]),l=Ie(()=>p=>g[p]??"",[g]),R=o??(t==="ar"?"rtl":"ltr"),S=ke(null),T=co(Kn),i=er({verification:e,videoRef:S,assetBaseUrl:u,onCaptured:x,onResult:E,onError:v,onStateChange:Y}),I=Jn(u,i.state==="idle"&&i.error===null),L=nr(e),B=L.choice!==null,K=qn(e),ie=jn(e),ae=zn(e),O=Dn(),G=$n(e),fe=G.session==="choice",h=G.mode==="assisted",me=V!==!1&&V?.clips===void 0,ce=rr(me?e:void 0),N=vt({locale:t,defaultClips:ce,options:V}),Ee=h?"environment":"user",Z=G.settled,J=ke(null),P=ke(!1),Ae=ke(N.unlock);Ae.current=N.unlock,se(()=>{let p=J.current;if(p===null)return;let $=["pointerup","touchend","click","keydown"],de=n(()=>{for(let Te of $)p.removeEventListener(Te,Re,!0)},"disarm");function Re(Te){if(P.current){de();return}mo(Te)&&(P.current=!0,de(),Ae.current())}n(Re,"onGesture");for(let Te of $)p.addEventListener(Te,Re,{capture:!0,passive:!0});return de},[]);let Be=it(()=>{P.current||(P.current=!0,N.unlock()),i.start()},[N.unlock,i.start]),m=it(()=>i.start(),[i.start]),X=ke(!1),ye=i.state==="idle"&&i.error===null,Rt=!B&&!K.required&&(c===!0||c==="when-permitted"&&O.permission==="granted"),Vt=Rt&&L.settled&&K.settled&&Z,cr=c==="when-permitted"&&!O.permissionSettled&&!X.current,Mt=Rt&&ye&&!X.current,at=(cr||Mt||!Z)&&I.gate==="ready"?"loading":I.gate;se(()=>{!Vt||!ye||I.gate!=="ready"||X.current||(X.current=!0,m())},[Vt,ye,I.gate,m]);let lr=ye&&!B&&!K.required&&!(Mt&&I.gate==="ready"),[wt,Lt]=ir(!1),{canSwitchCaptureMode:_t,setCaptureMode:It}=i;se(()=>{if(!G.settled||!fe){Lt(!1);return}let p=!0;return _t().then($=>{p&&Lt($)}),()=>{p=!1}},[G.settled,fe,_t]);let{choose:xt}=G,be=h?"self":"assisted",ur=it(async()=>{await It(be)&&xt(be)},[It,xt,be]),Et=i.state!=="idle"&&i.facingMode!==null?i.facingMode:Ee;se(()=>{let p=S.current?.style;Et==="user"?p?.removeProperty("transform"):p&&(p.transform="none")},[Et]);let Fe=Ie(()=>i.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(i.artifacts.keyframe):null,[i.artifacts]);se(()=>{if(Fe!==null)return()=>URL.revokeObjectURL(Fe)},[Fe]);let At=i.frozenPreview??Fe,Se=e!==void 0,H=ho(i.state),le=vo(i.state),De=H||le,W=i.result,Nt=i.state==="done"&&W!==null,qe=H&&i.rampColour!==null,ct=i.state==="recording"&&i.frozenPreview!==null&&!qe,je=T!==null,Pt=wt&&H&&!ct?{to:be,label:l(be==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:l(be==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:n(()=>{ur()},"onSwitch")}:null,Ye=i.modeRestarted&&H?l("capture.modeSwitch.restarted"):null,Ne=le||ct,Tt=le?"checking":ct?"frozen":i.state==="recording"||qe?"recording":i.gateLocked||i.gate.progress>=1?"locked":i.gate.faceDetected?"aligning":"seeking",$e=H?i.gate.hint:null,ze=i.state==="starting"?"capture.preparing.title":$e===null?null:$e==="center"&&!i.gate.faceDetected?"fcv3.no_face":Wt($e),[dr,Kt]=ir(null);se(()=>{if(ze!=="fcv3.no_face"){Kt(ze);return}if(!H)return;let p=setTimeout(()=>Kt(ze),uo);return()=>clearTimeout(p)},[ze,H]);let lt=H&&!qe&&typeof w=="string"&&w!=="",Ot=h&&H?l("capture.assisted.stage"):null,ge=H&&!lt?qe?po:dr:null,ut=lt?w:ge===null?"":l(ge);Ct(N,ge,ut,H);let Ut=ke(A);Ut.current=A,se(()=>{if(he(ge))try{Ut.current?.(ge)}catch(p){console.error("[@sekyro/react] onGuidance threw:",p)}},[ge]);let Pe=Ie(()=>({supported:N.supported,enabled:N.enabled,setEnabled:N.setEnabled,toggle:N.toggle}),[N.supported,N.enabled,N.setEnabled,N.toggle]),dt=s?.voicePrompt,Ht=dt!==void 0,Gt=V===void 0,Bt=ke(!1);se(()=>{!Ht||!Gt||Bt.current||!nt()||(Bt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[Ht,Gt]);let pr=dt!==void 0?(p,$,de)=>dt(p,$,de,Pe):N.supported?()=>M(sr,{voice:Pe}):void 0,{summary:pt,summaryPlaying:Ft,toggleSummary:Dt,stopSummary:qt}=N,Ze=y!==void 0&&y!=="",jt=Ze?y:l("capture.tips.summary"),Yt=Ze?pt!=="none":pt==="partner"||pt==="default"&&fo(b),fr=Ie(()=>Yt?{playing:Ft,toggle:n(()=>Dt(jt,{clip:!Ze}),"toggle"),stop:qt}:void 0,[Yt,Ft,Dt,jt,qt,Ze]),mr=Ie(()=>({assets:at,retryAssets:I.retry,permission:O.permission,permissionSettled:O.permissionSettled,captureMode:G.mode,facing:Ee,voice:Pe}),[at,I.retry,O.permission,O.permissionSettled,G.mode,Ee,Pe]),yr=yo(a)?M(D,{tone:a.tone,testId:"sekyro-host-notice",children:M("span",{children:a.text})}):a??null,ee=W!==null&&W.status==="retry"?W:null,U=Nt&&W.status==="unavailable"&&!B&&W.reasonCode!=="portrait_required"?W:null,ue=Nt&&(W.status==="verified"||W.status==="not_verified"||W.status==="review")?W:null,ft=n((p,$)=>{if(p===void 0)return null;if(p==="device_cooldown"){let Re=en(t,$);if(Re!==null)return l(Re.key).replace("{time}",Re.time)}let de=Xt(p);return de===null?null:l(de)},"reasonText"),mt=n(p=>{let $=p.retakeHint===void 0?null:Qt(p.retakeHint);return $===null?ft(p.reasonCode):l($)},"retryText"),$t=ue===null?null:ft(ue.reasonCode,ue.retryAfter)??(ue.status==="not_verified"&&ue.reason!==void 0&&lo.has(ue.reason)?l("errors.session_expired"):null),gr=U!==null&&U.reasonCode!==void 0&&U.reasonCode!=="nni_unbound"&&U.reasonCode!=="id_number_unbound"&&U.reasonCode!=="method_required"&&U.reasonCode!=="mobile_required"&&!(U.reasonCode==="no_recorder"&&i.artifacts?.degraded==="NO_RECORDER"),We=U?.reasonCode,zt=i.attempt;se(()=>{U===null||We===void 0||e?.reportCaptureIssue===void 0||go.has(We)||Qe(p=>e.reportCaptureIssue?.(p),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:We,attempt:Math.min(1e3,zt)})},[U,We,zt,e]);let Zt=Je(),hr=B&&L.auto===null&&!H&&!le&&i.error===null,yt=it(async p=>{await L.select(p)&&i.state==="done"&&i.retry()},[L.select,i.state,i.retry]);return se(()=>{L.auto!==null&&!L.busy&&!H&&!le&&yt(L.auto)},[L.auto,L.busy,H,le,yt]),M(on,{value:l,children:xe("div",{ref:J,className:C===void 0?"sekyro-capture":`sekyro-capture ${C}`,dir:R,lang:t,"data-testid":"sekyro-liveness-capture","data-state":i.state,children:[s?.header,ee!==null&&mt(ee)!==null&&!(je&&De)?M(D,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:M("span",{children:mt(ee)})}):null,Ye!==null&&!je?M(D,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:M("span",{children:Ye})}):null,ae&&le&&!je?M(D,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:M("span",{children:l("capture.busy")})}):null,K.required&&ye?M(D,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:M("span",{children:l("reasons.mobile_required")})}):null,i.error!==null?s?.errorPanel!==void 0?s.errorPanel(i.error,i.retry):xe(D,{tone:"danger",testId:"sekyro-error-notice",children:[M("span",{children:l(Jt(i.error))}),i.error.retryable?M(F,{ref:Zt,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:l("common.retry")}):null]}):null,U!==null?xe(D,{tone:"danger",testId:"sekyro-unavailable-notice",children:[M("span",{children:(U.reasonCode==="attestation"&&U.attestationError==="clock_wrong"?l("errors.device_clock"):ft(U.reasonCode))??l(U.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),gr?M(F,{ref:Zt,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:l(U.reasonCode==="attestation"?"common.retry":"capture.recordAgain")}):null]}):null,$t!==null&&ue!==null?M(D,{tone:ue.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:M("span",{children:$t})}):null,M("div",{className:De?void 0:"sekyro-hidden","data-capture-live":De?"":void 0,children:je?T({videoRef:S,guidance:Ne&&Se?l("capture.checking"):ut,coached:lt&&!(Ne&&Se),note:Ne?Se?l(ae?"capture.busy":"capture.checkingHint"):null:Ye??(ee!==null?mt(ee):Ot),settled:Ne&&Se,progress:i.gate.progress,phase:Tt,still:Ne?At:null,live:De,modeSwitch:Pt,...wt?{status:Ye}:{},ramp:i.rampColour===null?null:{colour:i.rampColour}}):M(sn,{videoRef:S,guidanceText:ut,guidanceHint:$e,guidanceKey:ge,progress:i.gate.progress,phase:Tt,draining:i.draining,stillUrl:At,showChecking:Se,operatorText:Ot,voicePrompt:pr,overlay:p=>xe(ar,{children:[s?.stageOverlay?.(p),M(cn,{colour:i.rampColour})]}),reduceMotion:i.reduceMotion,modeSwitch:Pt})}),hr&&L.choice!==null?M(bn,{title:l("method.title"),description:l("method.description"),options:L.choice.options.map(p=>({id:p,label:l(`method.${p}`)})),busy:L.busy,error:L.failed?l("errors.network_error"):null,focus:i.state==="done",testId:"sekyro-method",look:"buttons",onChoose:p=>{yt(p)}}):null,lr?xe(ar,{children:[ie&&s?.header===void 0&&s?.intro===void 0?xe("div",{className:"sekyro-stack sekyro-stack--1",children:[M("h2",{className:"sekyro-text-body",children:l("returning.title")}),M("p",{className:"sekyro-text-muted",children:l("returning.description")})]}):null,yr,s?.intro!==void 0?s.intro(Be,mr):M(Fn,{assets:at,onRetryAssets:I.retry,permission:O.permission,captureMode:G.mode,voice:Pe,tips:b??Xe,summary:fr,startLabel:k,startDisabled:d,onStart:Be})]}):null,M(Tn,{showCoaching:ee!==null,coaching:Pn(ee?.reasonCode),attemptsText:ee?.attemptsRemaining!==void 0?tn(g,t,ee.attemptsRemaining):null,showRetake:ee!==null&&!H&&!le||!Se&&i.state==="captured",onRetake:i.retry}),s?.footer]})})}n(xi,"LivenessCapture");export{Pn as a,An as b,nt as c,Kn as d,Xe as e,bn as f,$n as g,tt as h,uo as i,xi as j};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{c as g}from"./chunk-K5H7KWEY.js";import{a as s}from"./chunk-2KED7D2Q.js";var c={light:{brand:"#0d3b66",brandFg:"#ffffff",fg:"#13141f",fgMuted:"#4e5270",bg:"#f6f7fb",surface:"#ffffff",ring:"#0d3b66",danger:"#ca0f07",success:"#007a5e",warning:"#735003"},dark:{brand:"#6ea2d3",brandFg:"#051a2e",fg:"#f6f7fb",fgMuted:"#cbcedc",bg:"#13141f",surface:"#1d1e2c",ring:"#6ea2d3",danger:"#ff7c7c",success:"#00c897",warning:"#ffd98a"},roles:{light:{brandSoft:"#eaf2fa",line:"#cbcedc",lineSubtle:"#e2e4ee",lineStrong:"#8c91a9",sunken:"#eeeff5",fgSubtle:"#686d8a"},dark:{brandSoft:"#092b4b",line:"#4e5270",lineSubtle:"#2b2d40",lineStrong:"#686d8a",sunken:"#0b0c14",fgSubtle:"#8c91a9"}},stage:"#051a2e",stageAccent:"#69dfef",radius:"10px",radiusLg:"16px",font:'"Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontDisplay:'"Sekyro Geist", Geist, "Sekyro Geist Fallback", "Sekyro Geist Fallback Roboto", "Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontArabic:'"Sekyro Cairo", Cairo, "Sekyro Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif'};import{jsx as y}from"react/jsx-runtime";var t={colors:{...c.light},radius:c.radiusLg,fontFamily:c.font},l={brand:"--sekyro-color-brand",brandFg:"--sekyro-color-brand-fg",fg:"--sekyro-color-fg",fgMuted:"--sekyro-color-fg-muted",bg:"--sekyro-color-bg",surface:"--sekyro-color-surface",ring:"--sekyro-color-ring",danger:"--sekyro-color-danger",success:"--sekyro-color-success",warning:"--sekyro-color-warning"};function S(r={}){let e={};for(let o of Object.keys(l))e[l[o]]=r.colors?.[o]??t.colors[o];return e["--sekyro-radius"]=r.radius??t.radius,e["--sekyro-font"]=r.fontFamily??t.fontFamily,e}s(S,"themeToCssVars");var k=/^#[0-9a-f]{6}$/i,m=["brand","brandFg","bg","surface","fg","fgMuted"],b=["danger","success","warning"],u=!1;function p(r){let e=r?.colors;if(r===void 0||e===void 0||!b.some(i=>i in e))return r;!u&&g()&&(u=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));let{danger:o,success:a,warning:f,...n}=e;return{...r,colors:n}}s(p,"stripDeprecatedStatusColors");var T={none:"0px",sm:"6px",md:"10px",lg:"16px",full:"9999px"},h={system:"",inter:"Inter","ibm-plex-sans-arabic":'"IBM Plex Sans Arabic"',"noto-sans-arabic":'"Noto Sans Arabic"',roboto:"Roboto"};function x(r){let e={};if(!r)return e;let o={},a=r.colors??{};for(let i of m){let d=a[i];d!==void 0&&k.test(d)&&(o[i]=d)}o.brand&&(o.ring=o.brand),Object.keys(o).length&&(e.colors=o);let f=T[r.radius];f&&(e.radius=f);let n=h[r.fontFamily];return n!==void 0&&(e.fontFamily=n?`${n}, ${t.fontFamily}`:t.fontFamily),e}s(x,"brandingToTheme");function I(...r){let e={};for(let o of r)o?.colors&&(e.colors={...e.colors,...o.colors}),o?.radius&&(e.radius=o.radius),o?.fontFamily&&(e.fontFamily=o.fontFamily);return e}s(I,"mergeThemes");function C({theme:r,children:e,className:o}){return y(R,{theme:p(r),...o!==void 0?{className:o}:{},children:e})}s(C,"SekyroThemeProvider");function R({theme:r,children:e,className:o}){let a=S(r);return y("div",{className:o===void 0?"sekyro-root":`sekyro-root ${o}`,style:a,children:e})}s(R,"SekyroThemeRoot");export{c as a,t as b,S as c,p as d,x as e,I as f,C as g,R as h};
2
+ import{c as g}from"./chunk-4E3G5TXC.js";import{a as s}from"./chunk-2KED7D2Q.js";var c={light:{brand:"#0d3b66",brandFg:"#ffffff",fg:"#13141f",fgMuted:"#4e5270",bg:"#f6f7fb",surface:"#ffffff",ring:"#0d3b66",danger:"#ca0f07",success:"#007a5e",warning:"#735003"},dark:{brand:"#6ea2d3",brandFg:"#051a2e",fg:"#f6f7fb",fgMuted:"#cbcedc",bg:"#13141f",surface:"#1d1e2c",ring:"#6ea2d3",danger:"#ff7c7c",success:"#00c897",warning:"#ffd98a"},roles:{light:{brandSoft:"#eaf2fa",line:"#cbcedc",lineSubtle:"#e2e4ee",lineStrong:"#8c91a9",sunken:"#eeeff5",fgSubtle:"#686d8a"},dark:{brandSoft:"#092b4b",line:"#4e5270",lineSubtle:"#2b2d40",lineStrong:"#686d8a",sunken:"#0b0c14",fgSubtle:"#8c91a9"}},stage:"#051a2e",stageAccent:"#69dfef",radius:"10px",radiusLg:"16px",font:'"Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontDisplay:'"Sekyro Geist", Geist, "Sekyro Geist Fallback", "Sekyro Geist Fallback Roboto", "Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontArabic:'"Sekyro Cairo", Cairo, "Sekyro Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif'};import{jsx as y}from"react/jsx-runtime";var t={colors:{...c.light},radius:c.radiusLg,fontFamily:c.font},l={brand:"--sekyro-color-brand",brandFg:"--sekyro-color-brand-fg",fg:"--sekyro-color-fg",fgMuted:"--sekyro-color-fg-muted",bg:"--sekyro-color-bg",surface:"--sekyro-color-surface",ring:"--sekyro-color-ring",danger:"--sekyro-color-danger",success:"--sekyro-color-success",warning:"--sekyro-color-warning"};function S(r={}){let e={};for(let o of Object.keys(l))e[l[o]]=r.colors?.[o]??t.colors[o];return e["--sekyro-radius"]=r.radius??t.radius,e["--sekyro-font"]=r.fontFamily??t.fontFamily,e}s(S,"themeToCssVars");var k=/^#[0-9a-f]{6}$/i,m=["brand","brandFg","bg","surface","fg","fgMuted"],b=["danger","success","warning"],u=!1;function p(r){let e=r?.colors;if(r===void 0||e===void 0||!b.some(i=>i in e))return r;!u&&g()&&(u=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));let{danger:o,success:a,warning:f,...n}=e;return{...r,colors:n}}s(p,"stripDeprecatedStatusColors");var T={none:"0px",sm:"6px",md:"10px",lg:"16px",full:"9999px"},h={system:"",inter:"Inter","ibm-plex-sans-arabic":'"IBM Plex Sans Arabic"',"noto-sans-arabic":'"Noto Sans Arabic"',roboto:"Roboto"};function x(r){let e={};if(!r)return e;let o={},a=r.colors??{};for(let i of m){let d=a[i];d!==void 0&&k.test(d)&&(o[i]=d)}o.brand&&(o.ring=o.brand),Object.keys(o).length&&(e.colors=o);let f=T[r.radius];f&&(e.radius=f);let n=h[r.fontFamily];return n!==void 0&&(e.fontFamily=n?`${n}, ${t.fontFamily}`:t.fontFamily),e}s(x,"brandingToTheme");function I(...r){let e={};for(let o of r)o?.colors&&(e.colors={...e.colors,...o.colors}),o?.radius&&(e.radius=o.radius),o?.fontFamily&&(e.fontFamily=o.fontFamily);return e}s(I,"mergeThemes");function C({theme:r,children:e,className:o}){return y(R,{theme:p(r),...o!==void 0?{className:o}:{},children:e})}s(C,"SekyroThemeProvider");function R({theme:r,children:e,className:o}){let a=S(r);return y("div",{className:o===void 0?"sekyro-root":`sekyro-root ${o}`,style:a,children:e})}s(R,"SekyroThemeRoot");export{c as a,t as b,S as c,p as d,x as e,I as f,C as g,R as h};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as v,b as _}from"./chunk-K5H7KWEY.js";import{a as x}from"./chunk-VRDPGOXM.js";import{g as S}from"./chunk-PMNUDJWG.js";import{a as p,b as y,d as N,k as C,p as b,q as w}from"./chunk-Q5BGUJMS.js";import{a as k,l as I,o as R}from"./chunk-WC4U54LZ.js";import{a as i}from"./chunk-2KED7D2Q.js";import{useState as E}from"react";var U={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function Y(e,r){switch(e.service){case"document":return r.t("method.document_photo");case"population_registry":return r.t("method.national_number");case"national_eid":{let a=e.nationalEid?.providerName;return a?r.t("method.national_eid",{provider:a}):r.t("method.national_eidGeneric")}default:return null}}i(Y,"identityLabel");function q(e,r){let[a,n]=E(!1),[c,m]=E(null);return{busy:a,error:c,run:i(u=>{n(!0),m(null),u().then(()=>n(!1),f=>{n(!1),m(e.t(x(f,e.strings))),r?.(f)})},"run")}}i(q,"useChoiceAction");import{useContext as H,useId as L}from"react";import{Fragment as M,jsx as t,jsxs as s}from"react/jsx-runtime";function O(){let e=`sekyro-face-light-${L().replace(/[^A-Za-z0-9_-]/g,"")}`;return s("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[t("defs",{children:t("mask",{id:e,children:t("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),t("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),t("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),t("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),t("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}i(O,"FaceMark");var B={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function te(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}i(te,"faceIntroRetryOf");var F={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function ne({start:e,context:r,tips:a,tipsTitle:n,human:c=!1,returning:m=!1,notice:d,retry:u}){let f=S(),{t:o}=f,g=u===void 0?"face":v(u.reason),h=g==="face"?null:_[g].tips,A=H(C)?.busy===!0;return s("section",{className:"sekyro-step",children:[t(O,{}),r.captureMode==="assisted"?t(y,{title:o("capture.assisted.heading"),lead:o("capture.assisted.lead")}):m?t(y,{title:o("returning.heading"),lead:o("returning.description")}):t(y,{title:o(c?"native.face.humanIntroTitle":"native.face.introTitle"),lead:o(c?"native.face.humanIntroLead":"native.face.introLead")}),u!==void 0?t(T,{retry:u,title:_[g].title}):null,n!==void 0&&h===null?t("p",{className:"sekyro-section-label",children:n}):null,t("ul",{className:"sekyro-tiprows",children:h!==null?h.map(l=>s("li",{children:[t(p,{name:F[l]??"face"}),o(l)]},l)):a!==void 0?a.map(l=>s("li",{children:[t(p,{name:B[l.id]??"face"}),l.text]},l.id)):s(M,{children:[s("li",{children:[t(p,{name:"light"}),o("capture.tips.light")]}),s("li",{children:[t(p,{name:"jGlasses"}),o("capture.tips.uncover")]}),s("li",{children:[t(p,{name:"smartphone"}),o("capture.tips.eyeLevel")]})]})}),d??null,d!==void 0?null:r.assets==="failed"?t(k,{kind:"secondary",full:!0,onClick:r.retryAssets,children:o("common.retry")}):null,d!==void 0?null:t(N,{children:s(k,{full:!0,disabled:r.assets!=="ready"||A,"aria-busy":r.assets==="loading"||void 0,onClick:e,children:[t(p,{name:"camera"}),o("capture.start")]})})]})}i(ne,"FaceIntro");var K=new Set(["match_inconclusive","no_face_source","below_threshold"]);function T({retry:e,title:r}){let a=S(),n=e.retakeHint===void 0?null:I(e.retakeHint),c=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":K.has(e.reason)?"capture.retryMatch.message":R(e.reason);return s(b,{tone:"warning",children:[n!==null?t("span",{children:a.t(n)}):c!==null?t("span",{children:a.t(c)}):null,n===null?t("span",{children:a.t(r)}):null,t("span",{children:w(a,e.attemptsRemaining,e.attemptsExhausted)})]})}i(T,"RetryNotice");import{isInAppBrowser as $}from"@sekyro/web/client";function se(e){return $(e)}i(se,"isInAppBrowser");function ce(e,r){let a=r??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(a))return null;let n;try{n=new URL(e)}catch{return null}if(n.protocol!=="https:"&&n.protocol!=="http:")return null;let c=n.protocol.slice(0,-1);return`intent://${n.host}${n.pathname}${n.search}#Intent;scheme=${c};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}i(ce,"androidBrowserIntent");export{U as a,Y as b,q as c,te as d,ne as e,se as f,ce as g};
2
+ import{a as v,b as _}from"./chunk-4E3G5TXC.js";import{a as x}from"./chunk-VRDPGOXM.js";import{g as S}from"./chunk-PMNUDJWG.js";import{a as p,b as y,d as N,k as C,p as b,q as w}from"./chunk-Q5BGUJMS.js";import{a as k,l as I,o as R}from"./chunk-WC4U54LZ.js";import{a as i}from"./chunk-2KED7D2Q.js";import{useState as E}from"react";var U={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function Y(e,r){switch(e.service){case"document":return r.t("method.document_photo");case"population_registry":return r.t("method.national_number");case"national_eid":{let a=e.nationalEid?.providerName;return a?r.t("method.national_eid",{provider:a}):r.t("method.national_eidGeneric")}default:return null}}i(Y,"identityLabel");function q(e,r){let[a,n]=E(!1),[c,m]=E(null);return{busy:a,error:c,run:i(u=>{n(!0),m(null),u().then(()=>n(!1),f=>{n(!1),m(e.t(x(f,e.strings))),r?.(f)})},"run")}}i(q,"useChoiceAction");import{useContext as H,useId as L}from"react";import{Fragment as M,jsx as t,jsxs as s}from"react/jsx-runtime";function O(){let e=`sekyro-face-light-${L().replace(/[^A-Za-z0-9_-]/g,"")}`;return s("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[t("defs",{children:t("mask",{id:e,children:t("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),t("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),t("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),t("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),t("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}i(O,"FaceMark");var B={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function te(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}i(te,"faceIntroRetryOf");var F={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function ne({start:e,context:r,tips:a,tipsTitle:n,human:c=!1,returning:m=!1,notice:d,retry:u}){let f=S(),{t:o}=f,g=u===void 0?"face":v(u.reason),h=g==="face"?null:_[g].tips,A=H(C)?.busy===!0;return s("section",{className:"sekyro-step",children:[t(O,{}),r.captureMode==="assisted"?t(y,{title:o("capture.assisted.heading"),lead:o("capture.assisted.lead")}):m?t(y,{title:o("returning.heading"),lead:o("returning.description")}):t(y,{title:o(c?"native.face.humanIntroTitle":"native.face.introTitle"),lead:o(c?"native.face.humanIntroLead":"native.face.introLead")}),u!==void 0?t(T,{retry:u,title:_[g].title}):null,n!==void 0&&h===null?t("p",{className:"sekyro-section-label",children:n}):null,t("ul",{className:"sekyro-tiprows",children:h!==null?h.map(l=>s("li",{children:[t(p,{name:F[l]??"face"}),o(l)]},l)):a!==void 0?a.map(l=>s("li",{children:[t(p,{name:B[l.id]??"face"}),l.text]},l.id)):s(M,{children:[s("li",{children:[t(p,{name:"light"}),o("capture.tips.light")]}),s("li",{children:[t(p,{name:"jGlasses"}),o("capture.tips.uncover")]}),s("li",{children:[t(p,{name:"smartphone"}),o("capture.tips.eyeLevel")]})]})}),d??null,d!==void 0?null:r.assets==="failed"?t(k,{kind:"secondary",full:!0,onClick:r.retryAssets,children:o("common.retry")}):null,d!==void 0?null:t(N,{children:s(k,{full:!0,disabled:r.assets!=="ready"||A,"aria-busy":r.assets==="loading"||void 0,onClick:e,children:[t(p,{name:"camera"}),o("capture.start")]})})]})}i(ne,"FaceIntro");var K=new Set(["match_inconclusive","no_face_source","below_threshold"]);function T({retry:e,title:r}){let a=S(),n=e.retakeHint===void 0?null:I(e.retakeHint),c=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":K.has(e.reason)?"capture.retryMatch.message":R(e.reason);return s(b,{tone:"warning",children:[n!==null?t("span",{children:a.t(n)}):c!==null?t("span",{children:a.t(c)}):null,n===null?t("span",{children:a.t(r)}):null,t("span",{children:w(a,e.attemptsRemaining,e.attemptsExhausted)})]})}i(T,"RetryNotice");import{isInAppBrowser as $}from"@sekyro/web/client";function se(e){return $(e)}i(se,"isInAppBrowser");function ce(e,r){let a=r??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(a))return null;let n;try{n=new URL(e)}catch{return null}if(n.protocol!=="https:"&&n.protocol!=="http:")return null;let c=n.protocol.slice(0,-1);return`intent://${n.host}${n.pathname}${n.search}#Intent;scheme=${c};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}i(ce,"androidBrowserIntent");export{U as a,Y as b,q as c,te as d,ne as e,se as f,ce as g};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as y}from"./chunk-VNVE5DMF.js";import{p as w}from"./chunk-Q5BGUJMS.js";import{a as d}from"./chunk-WC4U54LZ.js";import{a as t}from"./chunk-2KED7D2Q.js";import{createContext as C,useContext as R,useState as v}from"react";import{lazy as S,Suspense as b,useMemo as x,useState as g}from"react";import{Component as N}from"react";var c=class c extends N{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};t(c,"LoadBoundary");var p=c;import{jsx as r,jsxs as V}from"react/jsx-runtime";var h={load:t(()=>import("./flow-views-C3EIMXME.js"),"load")};function k({view:n,i18n:e,quiet:o,...a}){let[i,f]=g(0),s=x(()=>S(()=>h.load().then(m=>({default:m[n]}))),[n,i]),u=V(w,{tone:"danger",children:[r("span",{children:e.t("errors.network_error")}),r(d,{kind:"secondary",onClick:()=>f(m=>m+1),children:e.t("common.retry")})]});return r(p,{fallback:u,children:r(b,{fallback:o===!0?null:r("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:e.t("common.loading")}),children:r(s,{...a,i18n:e})})},i)}t(k,"Flow");import{Fragment as F,jsx as l,jsxs as B}from"react/jsx-runtime";var P=C(void 0);function K({i18n:n,lead:e,refresh:o,actions:a}){let i=R(P),[f,s]=v(!1);if(i!==void 0)return l(k,{view:"HandoffView",i18n:n,url:i,lead:e,...o!==void 0?{refresh:o}:{},footer:a});let u=t(()=>{o!==void 0&&(s(!0),o().catch(()=>{}).finally(()=>s(!1)))},"again");return l(y,{tone:"brand",icon:"smartphone",title:n.t("handoff.title"),testId:"sekyro-phone-handoff",actions:B(F,{children:[a,o!==void 0?l(d,{kind:"secondary",full:!0,disabled:f,onClick:u,children:n.t("common.refresh")}):null]}),children:l("p",{children:e})})}t(K,"PhoneHandoff");export{p as a,k as b,P as c,K as d};
2
+ import{a as y}from"./chunk-VNVE5DMF.js";import{p as w}from"./chunk-Q5BGUJMS.js";import{a as d}from"./chunk-WC4U54LZ.js";import{a as t}from"./chunk-2KED7D2Q.js";import{createContext as C,useContext as R,useState as v}from"react";import{lazy as S,Suspense as b,useMemo as x,useState as g}from"react";import{Component as N}from"react";var c=class c extends N{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};t(c,"LoadBoundary");var p=c;import{jsx as r,jsxs as V}from"react/jsx-runtime";var h={load:t(()=>import("./flow-views-IAR45I3I.js"),"load")};function k({view:n,i18n:e,quiet:o,...a}){let[i,f]=g(0),s=x(()=>S(()=>h.load().then(m=>({default:m[n]}))),[n,i]),u=V(w,{tone:"danger",children:[r("span",{children:e.t("errors.network_error")}),r(d,{kind:"secondary",onClick:()=>f(m=>m+1),children:e.t("common.retry")})]});return r(p,{fallback:u,children:r(b,{fallback:o===!0?null:r("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:e.t("common.loading")}),children:r(s,{...a,i18n:e})})},i)}t(k,"Flow");import{Fragment as F,jsx as l,jsxs as B}from"react/jsx-runtime";var P=C(void 0);function K({i18n:n,lead:e,refresh:o,actions:a}){let i=R(P),[f,s]=v(!1);if(i!==void 0)return l(k,{view:"HandoffView",i18n:n,url:i,lead:e,...o!==void 0?{refresh:o}:{},footer:a});let u=t(()=>{o!==void 0&&(s(!0),o().catch(()=>{}).finally(()=>s(!1)))},"again");return l(y,{tone:"brand",icon:"smartphone",title:n.t("handoff.title"),testId:"sekyro-phone-handoff",actions:B(F,{children:[a,o!==void 0?l(d,{kind:"secondary",full:!0,disabled:f,onClick:u,children:n.t("common.refresh")}):null]}),children:l("p",{children:e})})}t(K,"PhoneHandoff");export{p as a,k as b,P as c,K as d};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as Be}from"./chunk-RGI6OVB2.js";import{d as Ve}from"./chunk-QD66CL7R.js";import"./chunk-VNVE5DMF.js";import{a as $e,b as Ue,c as Ee}from"./chunk-7MMT5M4E.js";import{d as Pe}from"./chunk-PMNUDJWG.js";import{a as Y,b as pe,d as me,j as Ie,k as Oe,l as Ae,n as Ke,p as he,q as fe}from"./chunk-Q5BGUJMS.js";import"./chunk-DYWLZHSM.js";import{a as O,m as He,o as Re}from"./chunk-WC4U54LZ.js";import{a as d}from"./chunk-2KED7D2Q.js";import{useContext as qe,useEffect as G,useLayoutEffect as mt,useRef as F,useState as k}from"react";var Ye={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"/>'};var Ge={"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":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"};var Q={"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"};var Fe={"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"};var We={"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":"رفع صورة"};var Z={"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"};var Xe={"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"};var je={"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":"لنحاول مرة أخرى"};var q={"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"};var Qe={"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"};var pt=["locking","capturing"],ge=class ge{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(e,o){return this.presentHint(e,o),this.presentLock(e,o),this.presentCard(e,o),this.shutterSince=e.manualShutter?this.shutterSince??o:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&o-this.shutterSince>=1e3},this.shown}presentHint(e,o){let a=e.phase==="framing"&&!(e.hint==="blurry"&&e.card===null)?e.hint:null;if(e.phase!=="framing"){this.shown={...this.shown,hint:null},this.candidate=null;return}if(a!==this.candidate&&(this.candidate=a,this.candidateSince=o),a===this.shown.hint)return;let r=o-this.candidateSince>=(a===null?0:350),h=this.shown.hint===null||o-this.hintShownAt>=1200;r&&h&&(this.shown={...this.shown,hint:a},this.hintShownAt=o)}presentLock(e,o){if(pt.includes(e.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(e.phase!=="framing"){this.shown={...this.shown,locking:!1},this.lockLostAt=null;return}this.lockLostAt??(this.lockLostAt=o),o-this.lockLostAt>=300&&(this.shown={...this.shown,locking:!1},this.lockLostAt=null)}}presentCard(e,o){let a=e.card;if(a===null||e.phase!=="framing"){if(e.phase!=="framing"){this.shown={...this.shown,card:null},this.detectedSince=null,this.lostSince=null;return}this.detectedSince=null,this.lostSince??(this.lostSince=o),o-this.lostSince>=300&&(this.shown={...this.shown,card:null});return}if(this.lostSince=null,this.detectedSince??(this.detectedSince=o),o-this.detectedSince<250)return;let r=this.shown.card;if(r===null){this.shown={...this.shown,card:{...a}};return}let h=.35;this.shown={...this.shown,card:{fill:r.fill+(a.fill-r.fill)*h,offsetX:r.offsetX+(a.offsetX-r.offsetX)*h,offsetY:r.offsetY+(a.offsetY-r.offsetY)*h}}}};d(ge,"ScanPresenter");var ae=ge;import{Fragment as Se,jsx as n,jsxs as i}from"react/jsx-runtime";var ht={en:q,fr:Qe,ar:je,es:q,pt:q,de:q},ft=450,ve=d(t=>e=>Pe(t.strings[e]??ht[t.locale][e]??""),"useScanCopy");function re({name:t}){return n("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:Ye[t]}})}d(re,"ScanGlyph");var gt={en:Q,fr:Fe,ar:Ge,es:Q,pt:Q,de:Q},St={en:Z,fr:Xe,ar:We,es:Z,pt:Z,de:Z},vt="image/jpeg,image/png,image/heic,image/heif";function W(t){let e=t.strings,o=d(a=>e[a]??St[t.locale][a],"text");return{t:d(a=>o(a)??"","t")}}d(W,"uploadCopy");function yt(t,e){return t===null||t.state==="fallback"||t.state==="mismatch"?null:t.state==="searching"?e?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":t.state==="valid"?"dcv3.mrz.valid":t.coach!==void 0?`dcv3.mrz.${t.coach}`:"dcv3.mrz.reading"}d(yt,"mrzInstruction");var kt={document_type_mismatch:"doc.reason_document_type_mismatch",document_number_invalid:"doc.reason_document_number_invalid",provider_unavailable:"doc.reason_provider_unavailable",document_type_not_supported:"doc.reason_document_type_not_supported",document_sides_mismatch:"doc.reason_document_sides_mismatch"};function ye(t){if(t.reason==="unreadable")return"doc.reason_unreadable";let e=t.reason!==void 0?kt[t.reason]:void 0;return e!==void 0?e:t.reason==="tester_document_mismatch"?"reasons.tester_document_mismatch":t.reason!==void 0&&t.reason!=="side_missing"?Re(t.reason):null}d(ye,"reasonOf");var bt=new Set(["document_type_not_accepted","tester_document_mismatch","document_type_mismatch","provider_unavailable","document_type_not_supported","document_sides_mismatch"]);function un({step:t,i18n:e,liveMrz:o,barcodeAssetBaseUrl:a,ageLead:r,...h}){let[b,v]=k(!1),g=F(-1),[f,S]=k("idle"),L=F(null),w=typeof t.uploadDocument=="function",N=w?t.photo?.source??"camera":"camera",A=w&&N!=="camera"&&t.photo?.uploadOffered===!0,[y,K]=k(null),M=N==="upload"?"upload":N==="choice"?y??t.photo?.pick??"source":"camera",H=f==="sending"?void 0:()=>L.current?.click(),m=d(async R=>{let ee=R.currentTarget.files?.[0];if(R.currentTarget.value="",ee!==void 0){v(!1),S("sending");try{await t.uploadDocument(ee),S("idle")}catch(j){S(j instanceof TypeError&&j.message==="unsupported_file"?"unsupported":"failed")}}},"onFile"),J=A?n("input",{ref:L,type:"file",accept:vt,hidden:!0,"data-testid":"sekyro-doc-upload","aria-label":W(e).t("doc.uploadTitle"),onChange:R=>{m(R)}}):null,C=W(e),X=t.photo?.cameraOnPhone===!0;return M==="camera"&&X?n(Ve,{i18n:e,lead:e.t("handoff.lead.document"),refresh:t.refresh,actions:n(O,{kind:"ghost",full:!0,onClick:()=>K("upload"),children:C.t("doc.source.upload")})}):M==="source"?n(Be,{testId:"sekyro-doc-source",title:C.t("doc.source.title"),lead:C.t("doc.source.description"),cameraLabel:X?e.t("capture.source.phone"):C.t("doc.source.camera"),onPhone:X,uploadLabel:C.t("doc.source.upload"),notice:n(ke,{step:t,i18n:e}),onCamera:()=>K("camera"),onUpload:()=>K("upload")}):M==="upload"?i(Se,{children:[n(_t,{step:t,i18n:e,ageLead:r===!0,upload:f,offered:A,onPick:()=>L.current?.click(),...N==="choice"?{onCamera:d(()=>K("camera"),"onCamera")}:{},...h}),J]}):i(Se,{children:[b?n(Lt,{step:t,i18n:e,attempts:g,...o!==void 0?{liveMrz:o}:{},...a!==void 0?{barcodeAssetBaseUrl:a}:{},...A&&H!==void 0?{onUpload:H}:{},onClose:()=>v(!1)}):n(Ct,{step:t,i18n:e,ageLead:r===!0,onOpen:()=>v(!0),upload:f,...A&&H!==void 0?{onUpload:H}:{},...h}),J]})}d(un,"DocumentCaptureView");function Je({passport:t}){let o=Math.round(228/(t?1.42:1.586));return i("svg",{className:"sekyro-mark sekyro-mark--card",viewBox:`-12 -12 252 ${o+24}`,"aria-hidden":"true",focusable:"false",children:[n("defs",{children:n("clipPath",{id:"sekyro-card-clip",children:n("rect",{width:228,height:o,rx:"12.5"})})}),n("rect",{className:"sekyro-mark__card",width:228,height:o,rx:"12.5"}),n("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:o*.52,rx:"6"}),[0,1,2].map(a=>n("rect",{className:"sekyro-mark__text",x:"88",y:23+a*o*.12,width:100-a*20,height:"6",rx:"3"},a)),[0,1].map(a=>n("rect",{className:"sekyro-mark__text",x:"17",y:o*.74+a*9,width:194,height:"4",rx:"2"},a)),n("g",{clipPath:"url(#sekyro-card-clip)",children:n("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:n("rect",{x:"-1",width:"2",height:o,className:"sekyro-mark__beam"})})}),n("path",{className:"sekyro-mark__brackets",d:wt(-10,-10,248,o+20,16,30)})]})}d(Je,"ScanMark");function wt(t,e,o,a,r,h){let b=Math.min(r,h*.6);return[[t,e,1,1],[t+o,e,-1,1],[t,e+a,1,-1],[t+o,e+a,-1,-1]].map(([g,f,S,L])=>`M${g} ${f+L*h}V${f+L*b}Q${g} ${f} ${g+S*b} ${f}H${g+S*h}`).join("")}d(wt,"brackets");function Ct({step:t,i18n:e,ageLead:o,onOpen:a,onChangeCountry:r,onChangeDocument:h,upload:b,onUpload:v}){let g=ve(e),f=W(e),S=t.documentType==="passport",L=ye(t),w=b==="sending",N=qe(Oe)?.busy===!0;return i("section",{className:"sekyro-step","data-testid":"sekyro-document",children:[n(Je,{passport:S}),n(pe,{title:g("native.doc.introTitle"),lead:o?e.t("doc.ageStepUp"):g("native.doc.introLead")}),n(ke,{step:t,i18n:e}),t.reason!==void 0&&bt.has(t.reason)?null:i("ul",{className:"sekyro-tiprows",children:[i("li",{children:[n(Y,{name:S?"passport":"card"}),g("native.doc.tip.flat")]}),i("li",{children:[n(Y,{name:"light"}),g("native.doc.tip.glare")]}),i("li",{children:[n(re,{name:"image"}),g("native.doc.tip.frame")]})]}),n(et,{i18n:e,...h!==void 0?{onChangeDocument:h}:{},...r!==void 0?{onChangeCountry:r}:{}}),n(tt,{i18n:e,upload:b}),w?n("p",{className:"sekyro-text-muted",role:"status",children:e.t("doc.uploading")}):v!==void 0?n("p",{className:"sekyro-text-muted",children:f.t("doc.uploadHint")}):null,i(me,{children:[i(O,{full:!0,onClick:a,disabled:w||N,children:[n(Y,{name:"camera"}),g("native.doc.openCamera")]}),v!==void 0?i(O,{full:!0,kind:"ghost",onClick:v,children:[n(re,{name:"image"}),f.t("doc.uploadInstead")]}):null]})]})}d(Ct,"DocumentIntro");function ke({step:t,i18n:e}){let o=ye(t);return o===null?null:i(he,{tone:"warning",children:[n("span",{children:e.t(o)}),n("span",{children:fe(e,t.attemptsRemaining,t.attemptsExhausted)})]})}d(ke,"ReasonNotice");function et({i18n:t,onChangeCountry:e,onChangeDocument:o}){let a=ve(t);return o===void 0&&e===void 0?null:i("div",{className:"sekyro-links",children:[o!==void 0?n("button",{type:"button",className:"sekyro-link",onClick:o,children:a("native.doc.changeDocument")}):null,e!==void 0?n("button",{type:"button",className:"sekyro-link",onClick:e,children:t.t("native.doc.changeCountry")}):null]})}d(et,"ChangeLinks");function tt({i18n:t,upload:e}){return e!=="unsupported"&&e!=="failed"?null:n(he,{tone:"warning",children:n("span",{children:W(t).t(e==="unsupported"?"doc.uploadUnsupported":"doc.uploadFailed")})})}d(tt,"UploadNotice");function _t({step:t,i18n:e,ageLead:o,upload:a,offered:r,onPick:h,onCamera:b,onChangeCountry:v,onChangeDocument:g}){let f=W(e),S=a==="sending";return i("section",{className:"sekyro-step","data-testid":"sekyro-doc-upload-screen",children:[n(Je,{passport:t.documentType==="passport"}),n(pe,{title:f.t("doc.uploadTitle"),lead:o?e.t("doc.ageStepUp"):f.t("doc.uploadHint")}),o?n("p",{className:"sekyro-text-muted",children:f.t("doc.uploadHint")}):null,n(ke,{step:t,i18n:e}),n(et,{i18n:e,...g!==void 0?{onChangeDocument:g}:{},...v!==void 0?{onChangeCountry:v}:{}}),n(tt,{i18n:e,upload:a}),S?n("p",{className:"sekyro-text-muted",role:"status",children:e.t("doc.uploading")}):null,i(me,{children:[i(O,{full:!0,onClick:h,disabled:S||!r||t.attemptsExhausted,children:[n(re,{name:"image"}),f.t("doc.source.upload")]}),b!==void 0?i(O,{full:!0,kind:"ghost",onClick:b,disabled:S,children:[n(Y,{name:"camera"}),f.t("doc.source.camera")]}):null]})]})}d(_t,"DocumentUploadScreen");function Ze(t,e,o){let a=t*.88,r=a/o;return{x:(t-a)/2,y:e*.42-r/2,w:a,h:r}}d(Ze,"guideRect");var Dt={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"},Nt=d(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function Lt({step:t,i18n:e,liveMrz:o,barcodeAssetBaseUrl:a,onClose:r,attempts:h,onUpload:b}){let v=ve(e),g=qe($e),f=F(g);f.current=g;let S=F(null),L=F(null),w=F(null),[N,A]=k("idle"),[y,K]=k(null),[M,H]=k(null),[m,J]=k({w:0,h:0}),[C,X]=k({hint:null,locking:!1,card:null,manualShutter:!1}),[R,ee]=k({}),[j,nt]=k(null),[be,ot]=k(null),[we,Ce]=k(0),[_e,De]=k(null),[te,Ne]=k(null),$=t.documentType==="passport",ne=$?1.42:1.586;Ie(!0),mt(()=>{let c=S.current;if(c===null)return;let u=d(()=>J({w:c.clientWidth,h:c.clientHeight}),"measure");if(u(),typeof ResizeObserver>"u")return;let l=new ResizeObserver(u);return l.observe(c),()=>l.disconnect()},[]);let s=Ze(m.w,m.h,ne);G(()=>{m.w===0||m.h===0||w.current?.setGuide?.({viewAspect:m.w/m.h,rect:{x:s.x/m.w,y:s.y/m.h,width:s.w/m.w,height:s.h/m.h}})},[m.w,m.h,s.x,s.y,s.w,s.h]),G(()=>{let c=L.current;if(c===null)return;let u=t.capture({video:c,...o!==void 0?{liveMrz:o}:{},...a!==void 0?{barcodeAssetBaseUrl:a}:{}});w.current=u;let l=S.current;if(l!==null&&l.clientWidth>0&&l.clientHeight>0){let p=Ze(l.clientWidth,l.clientHeight,ne);u.setGuide?.({viewAspect:l.clientWidth/l.clientHeight,rect:{x:p.x/l.clientWidth,y:p.y/l.clientHeight,width:p.w/l.clientWidth,height:p.h/l.clientHeight}})}let T=new ae,D={scan:null,feedback:null,gate:null},E=d(p=>{D={...D,...p};let x=D.gate?.guide,ut={phase:D.scan?.phase??"framing",hint:D.feedback?.reticle==="coaching"?D.feedback.key:null,card:x?.detected?{fill:x.fill,offsetX:x.offsetX,offsetY:x.offsetY}:null,manualShutter:D.scan?.manualShutter??!1},P=T.present(ut,performance.now());X(I=>I.hint===P.hint&&I.locking===P.locking&&I.manualShutter===P.manualShutter&&I.card?.fill===P.card?.fill&&I.card?.offsetX===P.card?.offsetX&&I.card?.offsetY===P.card?.offsetY?I:P)},"present"),dt=[u.on("state",A),u.on("feedback",p=>E({feedback:p})),u.on("gate",p=>E({gate:p})),u.on("scan",p=>{K(p),E({scan:p})}),u.on("captured",p=>{ee(x=>({...x,[zt(p.side,$,x)]:p.previewDataUrl})),nt(p.previewDataUrl),ot(Tt(c))}),u.on("error",p=>{H(p);let x=f.current;x!==null&&Ee(x,Ue("document",p,Math.max(0,h.current)))}),u.on("mrz",p=>{p.state==="mismatch"?Ne(p.format??null):De(p)})];return h.current+=1,u.start().catch(()=>{}),()=>{for(let p of dt)p();u.destroy(),w.current=null}},[t.issuer,t.documentType]);let z=y?.phase??"framing",U=z==="reading"||z==="result",se=z==="flipCue"||z==="reaskRecto",V=C.locking,Le=y?.captured.length??0;G(()=>{V&&Ce(c=>c+1)},[V]),G(()=>{Le>0&&Ce(c=>c+1)},[Le]);let at=y?.expected??null;G(()=>{De(null)},[at]),G(()=>{if(te===null)return;let c=setTimeout(()=>Ne(null),2e3);return()=>clearTimeout(c)},[te]);let ze=se||U||t.documentType==="drivers_license"?null:yt(_e,$),ie=te!==null?te==="TD3"?"dcv3.mrz.looksLikePassport":"dcv3.mrz.looksLikeCard":ze,rt=ie===null?null:e.strings[ie]??gt[e.locale][ie],ce=ye(t),xe=C.hint===null?null:Dt[C.hint]??`dcv2.${C.hint}`,st=xe??(z==="flipCue"?y?.notice==="same_face"?"doc.sameFace":"doc.flip":z==="reaskRecto"?"doc.reaskRecto":U?"native.scan.reading":z==="locking"||z==="capturing"||V?"native.scan.holdStill":y?.notice==="reread"?ce??"doc.reread":y?.notice==="technical"?"native.scan.retry":y?.notice==="blurry"?"native.scan.blurry":ce??($?"doc.showPage":"doc.showSide")),le=rt??v(st),B=C.card,_=s;if(!V&&B!==null&&B.fill>=.45&&B.fill<=1.25&&!Nt()){let c=s.w*B.fill,u=c/ne,l=s.x+s.w/2+s.w*Math.max(-.25,Math.min(.25,B.offsetX)),T=s.y+s.h/2+s.h*Math.max(-.25,Math.min(.25,B.offsetY));_={x:l-c/2,y:T-u/2,w:c,h:u}}let oe=s.w*.045,de=28,Te=Math.min(oe,de*.6),it=[[_.x,_.y,1,1],[_.x+_.w,_.y,-1,1],[_.x,_.y+_.h,1,-1],[_.x+_.w,_.y+_.h,-1,-1]],ct=V?"is-locked":C.hint!==null?"is-coaching":"",lt=$?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],Me=s.y+s.h+48,ue={insetInlineStart:s.x,insetBlockStart:s.y,inlineSize:s.w,blockSize:s.h,borderRadius:oe};return n("section",{className:"sekyro-lm","aria-label":le,"data-testid":"sekyro-document",children:i("div",{ref:S,className:`sekyro-lm-stage${U?" is-reading":""}${se?" is-flip":""}`,style:{"--sekyro-guide-w":`${s.w}px`},children:[n("video",{ref:L,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:c=>{let u=c.currentTarget,l=u.getBoundingClientRect(),T=Math.max(l.width/(u.videoWidth||1),l.height/(u.videoHeight||1)),D=u.videoWidth*T,E=u.videoHeight*T;D>0&&E>0&&w.current?.focusAt((c.clientX-l.left+(D-l.width)/2)/D,(c.clientY-l.top+(E-l.height)/2)/E)}}),m.w>0?i(Se,{children:[U&&be!==null?n("img",{className:"sekyro-lm-scene",src:be,alt:""}):null,U&&j!==null?n("img",{className:"sekyro-lm-frozen",src:j,alt:"",style:ue}):null,i("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${m.w} ${m.h}`,"aria-hidden":"true",focusable:"false",children:[i("defs",{children:[i("linearGradient",{id:"sekyro-lm-top",x1:"0",y1:"0",x2:"0",y2:"1",children:[n("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),n("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),i("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[n("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),n("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),n("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${m.w}V${m.h}H0Z${xt(s,oe)}`}),n("rect",{width:m.w,height:Math.max(0,s.y),fill:"url(#sekyro-lm-top)"}),n("rect",{y:s.y+s.h,width:m.w,height:Math.max(0,m.h-s.y-s.h),fill:"url(#sekyro-lm-bottom)"}),n("g",{className:`sekyro-lm-brackets ${ct}`,children:it.map(([c,u,l,T],D)=>n("path",{style:{transform:`translate(${c}px, ${u}px) scale(${l}, ${T})`},d:`M0 ${de}V${Te}Q0 0 ${Te} 0H${de}`},D))}),V?n("rect",{className:"sekyro-lm-trace",x:s.x,y:s.y,width:s.w,height:s.h,rx:oe,pathLength:"1",style:{animationDuration:`${ft}ms`}}):null]}),n("div",{className:"sekyro-lm-slot",style:ue,"aria-hidden":"true",children:U?n("span",{className:"sekyro-lm-read is-repeating"}):we>0?n("span",{className:"sekyro-lm-read"},we):null})]}):null,ze!==null?n("div",{className:"sekyro-lm-slot",style:ue,"aria-hidden":"true",children:n("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${$?" is-page":""}${_e?.state==="valid"?" is-valid":""}`})}):null,i("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:s.y-64},children:[n("div",{role:"status","aria-live":"polite",children:n(Ke,{swapKey:le,className:"sekyro-lm-line",children:le})}),ce!==null&&z==="framing"&&xe===null?n("p",{className:"sekyro-lm-attempts",children:fe(e,t.attemptsRemaining,t.attemptsExhausted)}):null]}),U?i("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:Me-12},children:[n("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),v("native.scan.putDown")]}):se?n("div",{className:`sekyro-lm-under sekyro-lm-flip${z==="reaskRecto"?" is-toFront":""}`,style:{insetBlockStart:Me-20},"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:i("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(ne)},children:[n("span",{className:"sekyro-lm-flip-front"}),n("span",{className:"sekyro-lm-flip-back"})]})}):null,i("div",{className:"sekyro-lm-controls",children:[i("div",{className:"sekyro-lm-bar",children:[n("button",{type:"button",className:"sekyro-glass","aria-label":e.t("native.close"),onClick:r,children:n(Y,{name:"close"})}),y?.torchAvailable?n("button",{type:"button",className:`sekyro-glass${y.torch?" is-on":""}`,"aria-label":e.t("doc.torchOn"),"aria-pressed":y.torch,onClick:()=>w.current?.setTorch(!y.torch),children:n(re,{name:"flashlight"})}):null]}),M!==null?i("div",{className:"sekyro-lm-error",role:"alert",children:[n("p",{children:e.t("doc.cameraBlocked")}),n("p",{children:e.t(M.kind==="permission"?"doc.cameraBlockedHint":He(M.kind))}),n(O,{onClick:()=>{H(null),h.current+=1,w.current?.retry()},children:e.t("doc.retryCamera")})]}):null,C.manualShutter?n("button",{type:"button",className:"sekyro-shutter","aria-label":e.t("doc.shutter"),onClick:()=>w.current?.shutter()}):null,n("ol",{className:"sekyro-lm-tray",children:lt.map(({side:c,label:u})=>{let l=y?.captured.includes(c)??!1;return i("li",{className:l?"is-done":void 0,"aria-current":!l&&($||y?.expected===c)?"step":void 0,children:[l?i("span",{className:"sekyro-lm-thumb",children:[R[c]!==void 0?n("img",{src:R[c],alt:""}):null,n("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:n("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,v(u)]},c)})}),b!==void 0?n("button",{type:"button",className:"sekyro-lm-upload",onClick:b,children:W(e).t("doc.uploadInstead")}):null,N==="uploading"||N==="checking"?null:n(Ae,{onStop:r})]}),N==="uploading"||N==="checking"?n("span",{className:"sekyro-visually-hidden",role:"status",children:N==="uploading"?e.t("doc.uploading"):v("native.scan.reading")}):null]})})}d(Lt,"LumiereScan");function zt(t,e,o){return e?"single":t==="recto"||t==="verso"?t:o.recto===void 0?"recto":"verso"}d(zt,"slotOf");function xt({x:t,y:e,w:o,h:a},r){return`M${t+r} ${e}H${t+o-r}Q${t+o} ${e} ${t+o} ${e+r}V${e+a-r}Q${t+o} ${e+a} ${t+o-r} ${e+a}H${t+r}Q${t} ${e+a} ${t} ${e+a-r}V${e+r}Q${t} ${e} ${t+r} ${e}Z`}d(xt,"roundedRect");function Tt(t){let e=Math.round(t.videoWidth/4),o=Math.round(t.videoHeight/4);if(e===0||o===0||typeof document>"u")return null;try{let a=document.createElement("canvas");a.width=e,a.height=o;let r=a.getContext("2d");return r===null?null:(r.drawImage(t,0,0,e,o),a.toDataURL("image/jpeg",.7))}catch{return null}}d(Tt,"sceneSnapshot");export{un as DocumentCaptureView,ft as LOCK_TRACE_MS,vt as UPLOAD_ACCEPT,Ze as guideRect,yt as mrzInstruction,zt as slotOf};
2
+ import{a as Be}from"./chunk-RGI6OVB2.js";import{d as Ve}from"./chunk-GPPZFBYP.js";import"./chunk-VNVE5DMF.js";import{a as $e,b as Ue,c as Ee}from"./chunk-7MMT5M4E.js";import{d as Pe}from"./chunk-PMNUDJWG.js";import{a as Y,b as pe,d as me,j as Ie,k as Oe,l as Ae,n as Ke,p as he,q as fe}from"./chunk-Q5BGUJMS.js";import"./chunk-DYWLZHSM.js";import{a as O,m as He,o as Re}from"./chunk-WC4U54LZ.js";import{a as d}from"./chunk-2KED7D2Q.js";import{useContext as qe,useEffect as G,useLayoutEffect as mt,useRef as F,useState as k}from"react";var Ye={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"/>'};var Ge={"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":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"};var Q={"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"};var Fe={"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"};var We={"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":"رفع صورة"};var Z={"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"};var Xe={"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"};var je={"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":"لنحاول مرة أخرى"};var q={"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"};var Qe={"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"};var pt=["locking","capturing"],ge=class ge{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(e,o){return this.presentHint(e,o),this.presentLock(e,o),this.presentCard(e,o),this.shutterSince=e.manualShutter?this.shutterSince??o:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&o-this.shutterSince>=1e3},this.shown}presentHint(e,o){let a=e.phase==="framing"&&!(e.hint==="blurry"&&e.card===null)?e.hint:null;if(e.phase!=="framing"){this.shown={...this.shown,hint:null},this.candidate=null;return}if(a!==this.candidate&&(this.candidate=a,this.candidateSince=o),a===this.shown.hint)return;let r=o-this.candidateSince>=(a===null?0:350),h=this.shown.hint===null||o-this.hintShownAt>=1200;r&&h&&(this.shown={...this.shown,hint:a},this.hintShownAt=o)}presentLock(e,o){if(pt.includes(e.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(e.phase!=="framing"){this.shown={...this.shown,locking:!1},this.lockLostAt=null;return}this.lockLostAt??(this.lockLostAt=o),o-this.lockLostAt>=300&&(this.shown={...this.shown,locking:!1},this.lockLostAt=null)}}presentCard(e,o){let a=e.card;if(a===null||e.phase!=="framing"){if(e.phase!=="framing"){this.shown={...this.shown,card:null},this.detectedSince=null,this.lostSince=null;return}this.detectedSince=null,this.lostSince??(this.lostSince=o),o-this.lostSince>=300&&(this.shown={...this.shown,card:null});return}if(this.lostSince=null,this.detectedSince??(this.detectedSince=o),o-this.detectedSince<250)return;let r=this.shown.card;if(r===null){this.shown={...this.shown,card:{...a}};return}let h=.35;this.shown={...this.shown,card:{fill:r.fill+(a.fill-r.fill)*h,offsetX:r.offsetX+(a.offsetX-r.offsetX)*h,offsetY:r.offsetY+(a.offsetY-r.offsetY)*h}}}};d(ge,"ScanPresenter");var ae=ge;import{Fragment as Se,jsx as n,jsxs as i}from"react/jsx-runtime";var ht={en:q,fr:Qe,ar:je,es:q,pt:q,de:q},ft=450,ve=d(t=>e=>Pe(t.strings[e]??ht[t.locale][e]??""),"useScanCopy");function re({name:t}){return n("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:Ye[t]}})}d(re,"ScanGlyph");var gt={en:Q,fr:Fe,ar:Ge,es:Q,pt:Q,de:Q},St={en:Z,fr:Xe,ar:We,es:Z,pt:Z,de:Z},vt="image/jpeg,image/png,image/heic,image/heif";function W(t){let e=t.strings,o=d(a=>e[a]??St[t.locale][a],"text");return{t:d(a=>o(a)??"","t")}}d(W,"uploadCopy");function yt(t,e){return t===null||t.state==="fallback"||t.state==="mismatch"?null:t.state==="searching"?e?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":t.state==="valid"?"dcv3.mrz.valid":t.coach!==void 0?`dcv3.mrz.${t.coach}`:"dcv3.mrz.reading"}d(yt,"mrzInstruction");var kt={document_type_mismatch:"doc.reason_document_type_mismatch",document_number_invalid:"doc.reason_document_number_invalid",provider_unavailable:"doc.reason_provider_unavailable",document_type_not_supported:"doc.reason_document_type_not_supported",document_sides_mismatch:"doc.reason_document_sides_mismatch"};function ye(t){if(t.reason==="unreadable")return"doc.reason_unreadable";let e=t.reason!==void 0?kt[t.reason]:void 0;return e!==void 0?e:t.reason==="tester_document_mismatch"?"reasons.tester_document_mismatch":t.reason!==void 0&&t.reason!=="side_missing"?Re(t.reason):null}d(ye,"reasonOf");var bt=new Set(["document_type_not_accepted","tester_document_mismatch","document_type_mismatch","provider_unavailable","document_type_not_supported","document_sides_mismatch"]);function un({step:t,i18n:e,liveMrz:o,barcodeAssetBaseUrl:a,ageLead:r,...h}){let[b,v]=k(!1),g=F(-1),[f,S]=k("idle"),L=F(null),w=typeof t.uploadDocument=="function",N=w?t.photo?.source??"camera":"camera",A=w&&N!=="camera"&&t.photo?.uploadOffered===!0,[y,K]=k(null),M=N==="upload"?"upload":N==="choice"?y??t.photo?.pick??"source":"camera",H=f==="sending"?void 0:()=>L.current?.click(),m=d(async R=>{let ee=R.currentTarget.files?.[0];if(R.currentTarget.value="",ee!==void 0){v(!1),S("sending");try{await t.uploadDocument(ee),S("idle")}catch(j){S(j instanceof TypeError&&j.message==="unsupported_file"?"unsupported":"failed")}}},"onFile"),J=A?n("input",{ref:L,type:"file",accept:vt,hidden:!0,"data-testid":"sekyro-doc-upload","aria-label":W(e).t("doc.uploadTitle"),onChange:R=>{m(R)}}):null,C=W(e),X=t.photo?.cameraOnPhone===!0;return M==="camera"&&X?n(Ve,{i18n:e,lead:e.t("handoff.lead.document"),refresh:t.refresh,actions:n(O,{kind:"ghost",full:!0,onClick:()=>K("upload"),children:C.t("doc.source.upload")})}):M==="source"?n(Be,{testId:"sekyro-doc-source",title:C.t("doc.source.title"),lead:C.t("doc.source.description"),cameraLabel:X?e.t("capture.source.phone"):C.t("doc.source.camera"),onPhone:X,uploadLabel:C.t("doc.source.upload"),notice:n(ke,{step:t,i18n:e}),onCamera:()=>K("camera"),onUpload:()=>K("upload")}):M==="upload"?i(Se,{children:[n(_t,{step:t,i18n:e,ageLead:r===!0,upload:f,offered:A,onPick:()=>L.current?.click(),...N==="choice"?{onCamera:d(()=>K("camera"),"onCamera")}:{},...h}),J]}):i(Se,{children:[b?n(Lt,{step:t,i18n:e,attempts:g,...o!==void 0?{liveMrz:o}:{},...a!==void 0?{barcodeAssetBaseUrl:a}:{},...A&&H!==void 0?{onUpload:H}:{},onClose:()=>v(!1)}):n(Ct,{step:t,i18n:e,ageLead:r===!0,onOpen:()=>v(!0),upload:f,...A&&H!==void 0?{onUpload:H}:{},...h}),J]})}d(un,"DocumentCaptureView");function Je({passport:t}){let o=Math.round(228/(t?1.42:1.586));return i("svg",{className:"sekyro-mark sekyro-mark--card",viewBox:`-12 -12 252 ${o+24}`,"aria-hidden":"true",focusable:"false",children:[n("defs",{children:n("clipPath",{id:"sekyro-card-clip",children:n("rect",{width:228,height:o,rx:"12.5"})})}),n("rect",{className:"sekyro-mark__card",width:228,height:o,rx:"12.5"}),n("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:o*.52,rx:"6"}),[0,1,2].map(a=>n("rect",{className:"sekyro-mark__text",x:"88",y:23+a*o*.12,width:100-a*20,height:"6",rx:"3"},a)),[0,1].map(a=>n("rect",{className:"sekyro-mark__text",x:"17",y:o*.74+a*9,width:194,height:"4",rx:"2"},a)),n("g",{clipPath:"url(#sekyro-card-clip)",children:n("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:n("rect",{x:"-1",width:"2",height:o,className:"sekyro-mark__beam"})})}),n("path",{className:"sekyro-mark__brackets",d:wt(-10,-10,248,o+20,16,30)})]})}d(Je,"ScanMark");function wt(t,e,o,a,r,h){let b=Math.min(r,h*.6);return[[t,e,1,1],[t+o,e,-1,1],[t,e+a,1,-1],[t+o,e+a,-1,-1]].map(([g,f,S,L])=>`M${g} ${f+L*h}V${f+L*b}Q${g} ${f} ${g+S*b} ${f}H${g+S*h}`).join("")}d(wt,"brackets");function Ct({step:t,i18n:e,ageLead:o,onOpen:a,onChangeCountry:r,onChangeDocument:h,upload:b,onUpload:v}){let g=ve(e),f=W(e),S=t.documentType==="passport",L=ye(t),w=b==="sending",N=qe(Oe)?.busy===!0;return i("section",{className:"sekyro-step","data-testid":"sekyro-document",children:[n(Je,{passport:S}),n(pe,{title:g("native.doc.introTitle"),lead:o?e.t("doc.ageStepUp"):g("native.doc.introLead")}),n(ke,{step:t,i18n:e}),t.reason!==void 0&&bt.has(t.reason)?null:i("ul",{className:"sekyro-tiprows",children:[i("li",{children:[n(Y,{name:S?"passport":"card"}),g("native.doc.tip.flat")]}),i("li",{children:[n(Y,{name:"light"}),g("native.doc.tip.glare")]}),i("li",{children:[n(re,{name:"image"}),g("native.doc.tip.frame")]})]}),n(et,{i18n:e,...h!==void 0?{onChangeDocument:h}:{},...r!==void 0?{onChangeCountry:r}:{}}),n(tt,{i18n:e,upload:b}),w?n("p",{className:"sekyro-text-muted",role:"status",children:e.t("doc.uploading")}):v!==void 0?n("p",{className:"sekyro-text-muted",children:f.t("doc.uploadHint")}):null,i(me,{children:[i(O,{full:!0,onClick:a,disabled:w||N,children:[n(Y,{name:"camera"}),g("native.doc.openCamera")]}),v!==void 0?i(O,{full:!0,kind:"ghost",onClick:v,children:[n(re,{name:"image"}),f.t("doc.uploadInstead")]}):null]})]})}d(Ct,"DocumentIntro");function ke({step:t,i18n:e}){let o=ye(t);return o===null?null:i(he,{tone:"warning",children:[n("span",{children:e.t(o)}),n("span",{children:fe(e,t.attemptsRemaining,t.attemptsExhausted)})]})}d(ke,"ReasonNotice");function et({i18n:t,onChangeCountry:e,onChangeDocument:o}){let a=ve(t);return o===void 0&&e===void 0?null:i("div",{className:"sekyro-links",children:[o!==void 0?n("button",{type:"button",className:"sekyro-link",onClick:o,children:a("native.doc.changeDocument")}):null,e!==void 0?n("button",{type:"button",className:"sekyro-link",onClick:e,children:t.t("native.doc.changeCountry")}):null]})}d(et,"ChangeLinks");function tt({i18n:t,upload:e}){return e!=="unsupported"&&e!=="failed"?null:n(he,{tone:"warning",children:n("span",{children:W(t).t(e==="unsupported"?"doc.uploadUnsupported":"doc.uploadFailed")})})}d(tt,"UploadNotice");function _t({step:t,i18n:e,ageLead:o,upload:a,offered:r,onPick:h,onCamera:b,onChangeCountry:v,onChangeDocument:g}){let f=W(e),S=a==="sending";return i("section",{className:"sekyro-step","data-testid":"sekyro-doc-upload-screen",children:[n(Je,{passport:t.documentType==="passport"}),n(pe,{title:f.t("doc.uploadTitle"),lead:o?e.t("doc.ageStepUp"):f.t("doc.uploadHint")}),o?n("p",{className:"sekyro-text-muted",children:f.t("doc.uploadHint")}):null,n(ke,{step:t,i18n:e}),n(et,{i18n:e,...g!==void 0?{onChangeDocument:g}:{},...v!==void 0?{onChangeCountry:v}:{}}),n(tt,{i18n:e,upload:a}),S?n("p",{className:"sekyro-text-muted",role:"status",children:e.t("doc.uploading")}):null,i(me,{children:[i(O,{full:!0,onClick:h,disabled:S||!r||t.attemptsExhausted,children:[n(re,{name:"image"}),f.t("doc.source.upload")]}),b!==void 0?i(O,{full:!0,kind:"ghost",onClick:b,disabled:S,children:[n(Y,{name:"camera"}),f.t("doc.source.camera")]}):null]})]})}d(_t,"DocumentUploadScreen");function Ze(t,e,o){let a=t*.88,r=a/o;return{x:(t-a)/2,y:e*.42-r/2,w:a,h:r}}d(Ze,"guideRect");var Dt={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"},Nt=d(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function Lt({step:t,i18n:e,liveMrz:o,barcodeAssetBaseUrl:a,onClose:r,attempts:h,onUpload:b}){let v=ve(e),g=qe($e),f=F(g);f.current=g;let S=F(null),L=F(null),w=F(null),[N,A]=k("idle"),[y,K]=k(null),[M,H]=k(null),[m,J]=k({w:0,h:0}),[C,X]=k({hint:null,locking:!1,card:null,manualShutter:!1}),[R,ee]=k({}),[j,nt]=k(null),[be,ot]=k(null),[we,Ce]=k(0),[_e,De]=k(null),[te,Ne]=k(null),$=t.documentType==="passport",ne=$?1.42:1.586;Ie(!0),mt(()=>{let c=S.current;if(c===null)return;let u=d(()=>J({w:c.clientWidth,h:c.clientHeight}),"measure");if(u(),typeof ResizeObserver>"u")return;let l=new ResizeObserver(u);return l.observe(c),()=>l.disconnect()},[]);let s=Ze(m.w,m.h,ne);G(()=>{m.w===0||m.h===0||w.current?.setGuide?.({viewAspect:m.w/m.h,rect:{x:s.x/m.w,y:s.y/m.h,width:s.w/m.w,height:s.h/m.h}})},[m.w,m.h,s.x,s.y,s.w,s.h]),G(()=>{let c=L.current;if(c===null)return;let u=t.capture({video:c,...o!==void 0?{liveMrz:o}:{},...a!==void 0?{barcodeAssetBaseUrl:a}:{}});w.current=u;let l=S.current;if(l!==null&&l.clientWidth>0&&l.clientHeight>0){let p=Ze(l.clientWidth,l.clientHeight,ne);u.setGuide?.({viewAspect:l.clientWidth/l.clientHeight,rect:{x:p.x/l.clientWidth,y:p.y/l.clientHeight,width:p.w/l.clientWidth,height:p.h/l.clientHeight}})}let T=new ae,D={scan:null,feedback:null,gate:null},E=d(p=>{D={...D,...p};let x=D.gate?.guide,ut={phase:D.scan?.phase??"framing",hint:D.feedback?.reticle==="coaching"?D.feedback.key:null,card:x?.detected?{fill:x.fill,offsetX:x.offsetX,offsetY:x.offsetY}:null,manualShutter:D.scan?.manualShutter??!1},P=T.present(ut,performance.now());X(I=>I.hint===P.hint&&I.locking===P.locking&&I.manualShutter===P.manualShutter&&I.card?.fill===P.card?.fill&&I.card?.offsetX===P.card?.offsetX&&I.card?.offsetY===P.card?.offsetY?I:P)},"present"),dt=[u.on("state",A),u.on("feedback",p=>E({feedback:p})),u.on("gate",p=>E({gate:p})),u.on("scan",p=>{K(p),E({scan:p})}),u.on("captured",p=>{ee(x=>({...x,[zt(p.side,$,x)]:p.previewDataUrl})),nt(p.previewDataUrl),ot(Tt(c))}),u.on("error",p=>{H(p);let x=f.current;x!==null&&Ee(x,Ue("document",p,Math.max(0,h.current)))}),u.on("mrz",p=>{p.state==="mismatch"?Ne(p.format??null):De(p)})];return h.current+=1,u.start().catch(()=>{}),()=>{for(let p of dt)p();u.destroy(),w.current=null}},[t.issuer,t.documentType]);let z=y?.phase??"framing",U=z==="reading"||z==="result",se=z==="flipCue"||z==="reaskRecto",V=C.locking,Le=y?.captured.length??0;G(()=>{V&&Ce(c=>c+1)},[V]),G(()=>{Le>0&&Ce(c=>c+1)},[Le]);let at=y?.expected??null;G(()=>{De(null)},[at]),G(()=>{if(te===null)return;let c=setTimeout(()=>Ne(null),2e3);return()=>clearTimeout(c)},[te]);let ze=se||U||t.documentType==="drivers_license"?null:yt(_e,$),ie=te!==null?te==="TD3"?"dcv3.mrz.looksLikePassport":"dcv3.mrz.looksLikeCard":ze,rt=ie===null?null:e.strings[ie]??gt[e.locale][ie],ce=ye(t),xe=C.hint===null?null:Dt[C.hint]??`dcv2.${C.hint}`,st=xe??(z==="flipCue"?y?.notice==="same_face"?"doc.sameFace":"doc.flip":z==="reaskRecto"?"doc.reaskRecto":U?"native.scan.reading":z==="locking"||z==="capturing"||V?"native.scan.holdStill":y?.notice==="reread"?ce??"doc.reread":y?.notice==="technical"?"native.scan.retry":y?.notice==="blurry"?"native.scan.blurry":ce??($?"doc.showPage":"doc.showSide")),le=rt??v(st),B=C.card,_=s;if(!V&&B!==null&&B.fill>=.45&&B.fill<=1.25&&!Nt()){let c=s.w*B.fill,u=c/ne,l=s.x+s.w/2+s.w*Math.max(-.25,Math.min(.25,B.offsetX)),T=s.y+s.h/2+s.h*Math.max(-.25,Math.min(.25,B.offsetY));_={x:l-c/2,y:T-u/2,w:c,h:u}}let oe=s.w*.045,de=28,Te=Math.min(oe,de*.6),it=[[_.x,_.y,1,1],[_.x+_.w,_.y,-1,1],[_.x,_.y+_.h,1,-1],[_.x+_.w,_.y+_.h,-1,-1]],ct=V?"is-locked":C.hint!==null?"is-coaching":"",lt=$?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],Me=s.y+s.h+48,ue={insetInlineStart:s.x,insetBlockStart:s.y,inlineSize:s.w,blockSize:s.h,borderRadius:oe};return n("section",{className:"sekyro-lm","aria-label":le,"data-testid":"sekyro-document",children:i("div",{ref:S,className:`sekyro-lm-stage${U?" is-reading":""}${se?" is-flip":""}`,style:{"--sekyro-guide-w":`${s.w}px`},children:[n("video",{ref:L,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:c=>{let u=c.currentTarget,l=u.getBoundingClientRect(),T=Math.max(l.width/(u.videoWidth||1),l.height/(u.videoHeight||1)),D=u.videoWidth*T,E=u.videoHeight*T;D>0&&E>0&&w.current?.focusAt((c.clientX-l.left+(D-l.width)/2)/D,(c.clientY-l.top+(E-l.height)/2)/E)}}),m.w>0?i(Se,{children:[U&&be!==null?n("img",{className:"sekyro-lm-scene",src:be,alt:""}):null,U&&j!==null?n("img",{className:"sekyro-lm-frozen",src:j,alt:"",style:ue}):null,i("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${m.w} ${m.h}`,"aria-hidden":"true",focusable:"false",children:[i("defs",{children:[i("linearGradient",{id:"sekyro-lm-top",x1:"0",y1:"0",x2:"0",y2:"1",children:[n("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),n("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),i("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[n("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),n("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),n("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${m.w}V${m.h}H0Z${xt(s,oe)}`}),n("rect",{width:m.w,height:Math.max(0,s.y),fill:"url(#sekyro-lm-top)"}),n("rect",{y:s.y+s.h,width:m.w,height:Math.max(0,m.h-s.y-s.h),fill:"url(#sekyro-lm-bottom)"}),n("g",{className:`sekyro-lm-brackets ${ct}`,children:it.map(([c,u,l,T],D)=>n("path",{style:{transform:`translate(${c}px, ${u}px) scale(${l}, ${T})`},d:`M0 ${de}V${Te}Q0 0 ${Te} 0H${de}`},D))}),V?n("rect",{className:"sekyro-lm-trace",x:s.x,y:s.y,width:s.w,height:s.h,rx:oe,pathLength:"1",style:{animationDuration:`${ft}ms`}}):null]}),n("div",{className:"sekyro-lm-slot",style:ue,"aria-hidden":"true",children:U?n("span",{className:"sekyro-lm-read is-repeating"}):we>0?n("span",{className:"sekyro-lm-read"},we):null})]}):null,ze!==null?n("div",{className:"sekyro-lm-slot",style:ue,"aria-hidden":"true",children:n("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${$?" is-page":""}${_e?.state==="valid"?" is-valid":""}`})}):null,i("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:s.y-64},children:[n("div",{role:"status","aria-live":"polite",children:n(Ke,{swapKey:le,className:"sekyro-lm-line",children:le})}),ce!==null&&z==="framing"&&xe===null?n("p",{className:"sekyro-lm-attempts",children:fe(e,t.attemptsRemaining,t.attemptsExhausted)}):null]}),U?i("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:Me-12},children:[n("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),v("native.scan.putDown")]}):se?n("div",{className:`sekyro-lm-under sekyro-lm-flip${z==="reaskRecto"?" is-toFront":""}`,style:{insetBlockStart:Me-20},"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:i("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(ne)},children:[n("span",{className:"sekyro-lm-flip-front"}),n("span",{className:"sekyro-lm-flip-back"})]})}):null,i("div",{className:"sekyro-lm-controls",children:[i("div",{className:"sekyro-lm-bar",children:[n("button",{type:"button",className:"sekyro-glass","aria-label":e.t("native.close"),onClick:r,children:n(Y,{name:"close"})}),y?.torchAvailable?n("button",{type:"button",className:`sekyro-glass${y.torch?" is-on":""}`,"aria-label":e.t("doc.torchOn"),"aria-pressed":y.torch,onClick:()=>w.current?.setTorch(!y.torch),children:n(re,{name:"flashlight"})}):null]}),M!==null?i("div",{className:"sekyro-lm-error",role:"alert",children:[n("p",{children:e.t("doc.cameraBlocked")}),n("p",{children:e.t(M.kind==="permission"?"doc.cameraBlockedHint":He(M.kind))}),n(O,{onClick:()=>{H(null),h.current+=1,w.current?.retry()},children:e.t("doc.retryCamera")})]}):null,C.manualShutter?n("button",{type:"button",className:"sekyro-shutter","aria-label":e.t("doc.shutter"),onClick:()=>w.current?.shutter()}):null,n("ol",{className:"sekyro-lm-tray",children:lt.map(({side:c,label:u})=>{let l=y?.captured.includes(c)??!1;return i("li",{className:l?"is-done":void 0,"aria-current":!l&&($||y?.expected===c)?"step":void 0,children:[l?i("span",{className:"sekyro-lm-thumb",children:[R[c]!==void 0?n("img",{src:R[c],alt:""}):null,n("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:n("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,v(u)]},c)})}),b!==void 0?n("button",{type:"button",className:"sekyro-lm-upload",onClick:b,children:W(e).t("doc.uploadInstead")}):null,N==="uploading"||N==="checking"?null:n(Ae,{onStop:r})]}),N==="uploading"||N==="checking"?n("span",{className:"sekyro-visually-hidden",role:"status",children:N==="uploading"?e.t("doc.uploading"):v("native.scan.reading")}):null]})})}d(Lt,"LumiereScan");function zt(t,e,o){return e?"single":t==="recto"||t==="verso"?t:o.recto===void 0?"recto":"verso"}d(zt,"slotOf");function xt({x:t,y:e,w:o,h:a},r){return`M${t+r} ${e}H${t+o-r}Q${t+o} ${e} ${t+o} ${e+r}V${e+a-r}Q${t+o} ${e+a} ${t+o-r} ${e+a}H${t+r}Q${t} ${e+a} ${t} ${e+a-r}V${e+r}Q${t} ${e} ${t+r} ${e}Z`}d(xt,"roundedRect");function Tt(t){let e=Math.round(t.videoWidth/4),o=Math.round(t.videoHeight/4);if(e===0||o===0||typeof document>"u")return null;try{let a=document.createElement("canvas");a.width=e,a.height=o;let r=a.getContext("2d");return r===null?null:(r.drawImage(t,0,0,e,o),a.toDataURL("image/jpeg",.7))}catch{return null}}d(Tt,"sceneSnapshot");export{un as DocumentCaptureView,ft as LOCK_TRACE_MS,vt as UPLOAD_ACCEPT,Ze as guideRect,yt as mrzInstruction,zt as slotOf};