@sekyro/react 0.1.0-rc.36 → 0.1.0-rc.37
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 +10 -0
- package/dist/{chunk-2TEU3U7V.js → chunk-7THCXQ4A.js} +1 -1
- package/dist/{chunk-HICSMGFX.js → chunk-D5VPGT22.js} +1 -1
- package/dist/chunk-HAAVAKZQ.js +2 -0
- package/dist/{chunk-6JKZ5S2U.js → chunk-HF3773DV.js} +1 -1
- package/dist/{chunk-ZXY2YUAP.js → chunk-HWIKHDKH.js} +1 -1
- package/dist/{chunk-NEUOVHVC.js → chunk-I3LRG3HT.js} +1 -1
- package/dist/{chunk-ODSPOWMV.js → chunk-KJZVQDQ6.js} +1 -1
- package/dist/{chunk-PEQBKIR7.js → chunk-LOW3VZIA.js} +1 -1
- package/dist/{chunk-P7TS7JPW.js → chunk-OIHMIBJX.js} +1 -1
- package/dist/chunk-Q4PLVTE2.js +2 -0
- package/dist/{chunk-FT5BC4W5.js → chunk-TV72XMR2.js} +1 -1
- package/dist/{chunk-BMD5J7TC.js → chunk-U2PYBQXG.js} +1 -1
- package/dist/{chunk-KB7SLMC3.js → chunk-XT4MOJ7P.js} +1 -1
- package/dist/document-capture-view-TV2VKLPV.js +2 -0
- package/dist/{eid-view-ZM7QAEME.js → eid-view-VC3DHQWV.js} +1 -1
- package/dist/{email-otp-view-EYS26ZZM.js → email-otp-view-QCELBL7U.js} +1 -1
- package/dist/flow-views-VCE6CEBN.js +2 -0
- package/dist/{form-view-Y5KA6R5T.js → form-view-P2GVOYAC.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/overlay-de-EMTSLK3M.js +2 -0
- package/dist/overlay-es-6WMAHH33.js +2 -0
- package/dist/overlay-pt-WBGMJQTQ.js +2 -0
- package/dist/{portrait-capture-view-E5LKQQ5Y.js → portrait-capture-view-QYEEV2D6.js} +1 -1
- package/dist/portrait-review-view-E3SBOU4F.js +2 -0
- package/dist/{proof-of-address-view-LS3JZUTD.js → proof-of-address-view-NIAKWB6B.js} +1 -1
- package/dist/verification/index.cjs +1 -1
- package/dist/verification/index.d.cts +1 -0
- package/dist/verification/index.d.ts +1 -0
- package/dist/verification/index.js +1 -1
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/chunk-3GSNJJCA.js +0 -2
- package/dist/chunk-ERWGG4X6.js +0 -2
- package/dist/document-capture-view-7ZSM7YTT.js +0 -2
- package/dist/flow-views-7SAYQQ62.js +0 -2
- package/dist/overlay-de-4OISTBDL.js +0 -2
- package/dist/overlay-es-YO5UCAO2.js +0 -2
- package/dist/overlay-pt-E7PSFLLQ.js +0 -2
- package/dist/portrait-review-view-NJHH2E4W.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @sekyro/react
|
|
2
2
|
|
|
3
|
+
## 0.1.0-rc.37
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9610931: Japan: the My Number card (Individual Number Card) is captured and read from its front only. Its back holds the My Number, which the law limits who may collect (My Number Act, Arts. 19-20), so the capture plan leaves it out and the server refuses a back sent anyway with the new retryable reason `document_side_not_read` (not billed, nothing kept), shown with its own retake line. The Japanese residence card and driving licence numbers people type are checked against their formats.
|
|
8
|
+
- 10715ba: Document capture: a method that serves only some countries (a population registry, a national eID) is a row on those countries' document type lists, listed first, and no longer a switch under another country's documents. After picking Senegal, no « Enter my Mauritanian NNI »; Mauritania lists Numéro national (NNI), Carte d'identité, Passeport, Carte de séjour. Choice options carry `countries` and `names` from the server; the row label comes from that data (`laneOptionsFor`, `optionNameFor` in @sekyro/web).
|
|
9
|
+
- Updated dependencies [9610931]
|
|
10
|
+
- Updated dependencies [10715ba]
|
|
11
|
+
- @sekyro/web@0.1.0-rc.39
|
|
12
|
+
|
|
3
13
|
## 0.1.0-rc.36
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{c as g}from"./chunk-
|
|
2
|
+
import{c as g}from"./chunk-HWIKHDKH.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{c as P}from"./chunk-
|
|
2
|
+
import{c as P}from"./chunk-I3LRG3HT.js";import{a as C,k as L,o as z}from"./chunk-LOW3VZIA.js";import{a as d}from"./chunk-2KED7D2Q.js";import{useLayoutEffect as H,useRef as U,useState as A}from"react";import{jsx as s,jsxs as o}from"react/jsx-runtime";var N=72;function B(c,r){let n=c*.72,a=n*1.32;return{cx:c/2,cy:(r-a)/2.1+a/2,a:n/2,b:a/2}}d(B,"faceOval");function E({cx:c,cy:r,a:n,b:a}){return Array.from({length:N},(R,$)=>{let u=-Math.PI/2+$/N*2*Math.PI,y=Math.cos(u),l=Math.sin(u),f=c+n*y,p=r+a*l,h=Math.hypot(a*y,n*l),k=a*y/h,v=n*l/h,i=d(b=>Math.round(b*10)/10,"r");return`M${i(f+k*16)} ${i(p+v*16)}L${i(f+k*28)} ${i(p+v*28)}`})}d(E,"ticks");function T({video:c,instruction:r,note:n,status:a,busy:R,progress:$,still:u,overlay:y,ramp:l,onClose:f,closeLabel:p,end:h,live:k=!0,children:v,testId:i}){L(k);let b=U(null),[t,F]=A({w:0,h:0});H(()=>{let x=b.current;if(x===null)return;let O=d(()=>F({w:x.clientWidth,h:x.clientHeight}),"measure");if(O(),typeof ResizeObserver>"u")return;let I=new ResizeObserver(O);return I.observe(x),()=>I.disconnect()},[]);let e=B(t.w,t.h),g=t.w>0?E(e):[],M=Math.round(Math.min(1,Math.max(0,$))*N),S=e.cy-e.b,m=Math.max(e.a,e.b)+40,w=70*Math.PI/180;return s("section",{className:"sekyro-lm sekyro-fc","aria-label":r,"data-testid":i,"data-ramp":l?"":void 0,children:o("div",{ref:b,className:"sekyro-lm-stage",children:[c,u?s("img",{className:"sekyro-lm-video sekyro-fc-still",src:u,alt:""}):null,y,s(P,{colour:l??null}),t.w>0?o("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${t.w} ${t.h}`,"aria-hidden":"true",focusable:"false",children:[o("defs",{children:[o("linearGradient",{id:"sekyro-fc-fade",gradientUnits:"userSpaceOnUse",x1:e.cx-m*Math.sin(w),y1:e.cy,x2:e.cx,y2:e.cy,children:[s("stop",{offset:"0",className:"sekyro-fc-fade",stopOpacity:"0"}),s("stop",{offset:"1",className:"sekyro-fc-fade"})]}),s("mask",{id:"sekyro-fc-light",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:t.w,height:t.h,children:s("path",{className:"sekyro-fc-sweep",style:{transformOrigin:`${e.cx}px ${e.cy}px`},d:`M${e.cx} ${e.cy}L${e.cx-m*Math.sin(w)} ${e.cy-m*Math.cos(w)}A${m} ${m} 0 0 1 ${e.cx} ${e.cy-m}Z`,fill:"url(#sekyro-fc-fade)"})})]}),s("path",{className:"sekyro-fc-scrim",fillRule:"evenodd",d:`M0 0H${t.w}V${t.h}H0Z M${e.cx-e.a} ${e.cy}a${e.a} ${e.b} 0 1 0 ${2*e.a} 0a${e.a} ${e.b} 0 1 0 ${-2*e.a} 0Z`}),s("ellipse",{className:"sekyro-fc-rim",cx:e.cx,cy:e.cy,rx:e.a,ry:e.b}),s("path",{className:"sekyro-fc-ticks",d:g.join("")}),M>0?s("path",{className:"sekyro-fc-ticks is-done",d:g.slice(0,M).join("")}):null,M<N?s("path",{className:"sekyro-fc-ticks is-light",d:g.join(""),mask:"url(#sekyro-fc-light)"}):null]}):null,s("div",{className:"sekyro-lm-instruction sekyro-fc-instruction",style:{insetBlockStart:S-80},children:s("div",{role:"status","aria-live":"polite",children:s(z,{swapKey:r,className:"sekyro-lm-line",children:r})})}),a!==void 0?s("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-camera-status",children:a??""}):null,n?o("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:S+2*e.b+48},children:[R?s("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}):null,s("span",{children:n})]}):null,o("div",{className:"sekyro-lm-controls",children:[o("div",{className:"sekyro-lm-bar",children:[f!==void 0?s("button",{type:"button",className:"sekyro-glass","aria-label":p,onClick:f,children:s(C,{name:"close"})}):null,h]}),v]})]})})}d(T,"FaceCamera");export{T as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as v,b as _}from"./chunk-HWIKHDKH.js";import{a as x}from"./chunk-VRDPGOXM.js";import{g as S}from"./chunk-Q4PLVTE2.js";import{a as p,b as y,d as N,l as C,q as b,r as w}from"./chunk-LOW3VZIA.js";import{a as k,l as I,o as R}from"./chunk-OIHMIBJX.js";import{a as i}from"./chunk-2KED7D2Q.js";import{useState as E}from"react";var U={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"},Y={population_registry:"hashtag",national_eid:"key"};function D(e,r){switch(e.service){case"document":return r.t("method.document_photo");case"population_registry":return r.t("method.national_number");case"national_eid":{let a=e.nationalEid?.providerName;return a?r.t("method.national_eid",{provider:a}):r.t("method.national_eidGeneric")}default:return null}}i(D,"identityLabel");function q(e,r){let[a,n]=E(!1),[c,m]=E(null);return{busy:a,error:c,run:i(u=>{n(!0),m(null),u().then(()=>n(!1),f=>{n(!1),m(e.t(x(f,e.strings))),r?.(f)})},"run")}}i(q,"useChoiceAction");import{useContext as H,useId as L}from"react";import{Fragment as M,jsx as t,jsxs as s}from"react/jsx-runtime";function O(){let e=`sekyro-face-light-${L().replace(/[^A-Za-z0-9_-]/g,"")}`;return s("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[t("defs",{children:t("mask",{id:e,children:t("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),t("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),t("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),t("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),t("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}i(O,"FaceMark");var B={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function ne(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}i(ne,"faceIntroRetryOf");var T={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function re({start:e,context:r,tips:a,tipsTitle:n,human:c=!1,returning:m=!1,notice:d,retry:u}){let f=S(),{t:o}=f,g=u===void 0?"face":v(u.reason),h=g==="face"?null:_[g].tips,A=H(C)?.busy===!0;return s("section",{className:"sekyro-step",children:[t(O,{}),r.captureMode==="assisted"?t(y,{title:o("capture.assisted.heading"),lead:o("capture.assisted.lead")}):m?t(y,{title:o("returning.heading"),lead:o("returning.description")}):t(y,{title:o(c?"native.face.humanIntroTitle":"native.face.introTitle"),lead:o(c?"native.face.humanIntroLead":"native.face.introLead")}),u!==void 0?t(K,{retry:u,title:_[g].title}):null,n!==void 0&&h===null?t("p",{className:"sekyro-section-label",children:n}):null,t("ul",{className:"sekyro-tiprows",children:h!==null?h.map(l=>s("li",{children:[t(p,{name:T[l]??"face"}),o(l)]},l)):a!==void 0?a.map(l=>s("li",{children:[t(p,{name:B[l.id]??"face"}),l.text]},l.id)):s(M,{children:[s("li",{children:[t(p,{name:"light"}),o("capture.tips.light")]}),s("li",{children:[t(p,{name:"jGlasses"}),o("capture.tips.uncover")]}),s("li",{children:[t(p,{name:"smartphone"}),o("capture.tips.eyeLevel")]})]})}),d??null,d!==void 0?null:r.assets==="failed"?t(k,{kind:"secondary",full:!0,onClick:r.retryAssets,children:o("common.retry")}):null,d!==void 0?null:t(N,{children:s(k,{full:!0,disabled:r.assets!=="ready"||A,"aria-busy":r.assets==="loading"||void 0,onClick:e,children:[t(p,{name:"camera"}),o("capture.start")]})})]})}i(re,"FaceIntro");var F=new Set(["match_inconclusive","no_face_source","below_threshold"]);function K({retry:e,title:r}){let a=S(),n=e.retakeHint===void 0?null:I(e.retakeHint),c=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":F.has(e.reason)?"capture.retryMatch.message":R(e.reason);return s(b,{tone:"warning",children:[n!==null?t("span",{children:a.t(n)}):c!==null?t("span",{children:a.t(c)}):null,n===null?t("span",{children:a.t(r)}):null,t("span",{children:w(a,e.attemptsRemaining,e.attemptsExhausted)})]})}i(K,"RetryNotice");import{isInAppBrowser as $}from"@sekyro/web/client";function ce(e){return $(e)}i(ce,"isInAppBrowser");function le(e,r){let a=r??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(a))return null;let n;try{n=new URL(e)}catch{return null}if(n.protocol!=="https:"&&n.protocol!=="http:")return null;let c=n.protocol.slice(0,-1);return`intent://${n.host}${n.pathname}${n.search}#Intent;scheme=${c};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}i(le,"androidBrowserIntent");export{U as a,Y as b,D as c,q as d,ne as e,re as f,ce as g,le as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as r,d as i}from"./chunk-
|
|
2
|
+
import{a as r,d as i}from"./chunk-LOW3VZIA.js";import{s as n}from"./chunk-OIHMIBJX.js";import{a}from"./chunk-2KED7D2Q.js";import{jsx as t,jsxs as s}from"react/jsx-runtime";function g({tone:c,icon:l,busy:d,title:u,titleId:o,children:m,actions:e,live:y,testId:p}){let f=n();return s("section",{className:"sekyro-step sekyro-status",...o!==void 0?{"aria-labelledby":o}:{},...y?{role:"status","aria-live":"polite"}:{},"data-testid":p,children:[s("div",{className:"sekyro-status__body",children:[t("span",{className:`sekyro-tile sekyro-tile--${c}${d?" is-busy":""}`,"aria-hidden":"true",children:t(r,{name:l})}),s("div",{className:"sekyro-heading sekyro-status__text",children:[t("h2",{id:o,ref:f,tabIndex:-1,className:"sekyro-text-body",children:u}),m]})]}),e!=null&&e!==!1?t(i,{children:e}):null]})}a(g,"StatusPage");export{g as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as sn,c as cn}from"./chunk-NEUOVHVC.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-BMD5J7TC.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-P7TS7JPW.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};
|
|
2
|
+
import{a as sn,c as cn}from"./chunk-I3LRG3HT.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-U2PYBQXG.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-OIHMIBJX.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{d as I}from"./chunk-
|
|
2
|
+
import{d as I}from"./chunk-U2PYBQXG.js";import{a as S}from"./chunk-OIHMIBJX.js";import{a}from"./chunk-2KED7D2Q.js";import{useId as V}from"react";import{jsx as k,jsxs as E}from"react/jsx-runtime";var A=Array.from({length:56},(r,e)=>{let s=e/56*2*Math.PI-Math.PI/2,t=Math.cos(s),i=Math.sin(s);return{id:`tick-${e}`,frac:e/55,x1:150+108*t,y1:150+108*i,x2:150+138*t,y2:150+138*i,style:{transitionDelay:`${e*6}ms`}}});function T(r,e,s,t){return s?"var(--sekyro-color-success)":r?t?"color-mix(in srgb, var(--sekyro-color-warning) 75%, transparent)":e<.33?"color-mix(in srgb, var(--sekyro-color-brand) 55%, transparent)":e<.66?"color-mix(in srgb, var(--sekyro-color-brand) 80%, transparent)":"var(--sekyro-color-brand)":"color-mix(in srgb, var(--sekyro-color-surface) 32%, transparent)"}a(T,"tickColor");var w="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function x({progress:r,phase:e,draining:s=!1}){let t=Math.min(1,Math.max(0,r)),i=Math.round(t*56),n=e==="checking",l=e==="recording",c=e==="frozen",u=n||c,p=n||l||c,y=e==="locked"||p,f=s&&!y;return E("svg",{"aria-hidden":"true",viewBox:"0 0 300 300",preserveAspectRatio:"xMidYMid meet",className:"sekyro-stage__arc","data-testid":"sekyro-capture-arc","data-phase":e,"data-filled":i,"data-recording":l?"":void 0,"data-draining":f?"":void 0,children:[k("path",{fillRule:"evenodd",d:w,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":u?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),E("g",{className:e==="locked"?"sekyro-capture-settle":void 0,children:[k("g",{className:u?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:A.map((d,_)=>k("line",{x1:d.x1,y1:d.y1,x2:d.x2,y2:d.y2,stroke:T(_<i,d.frac,y,f),strokeWidth:3,strokeLinecap:"round",style:d.style,className:"sekyro-arc__tick"},d.id))}),k("g",{className:e==="seeking"?"sekyro-capture-breathe":void 0,children:k("circle",{cx:150,cy:150,r:100,fill:"none",stroke:y?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:y?3.5:2.5,className:p?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}a(x,"CaptureArc");import{Fragment as M,jsx as o,jsxs as m}from"react/jsx-runtime";function ne({videoRef:r,guidanceText:e,guidanceHint:s,guidanceKey:t,progress:i,phase:n,draining:l=!1,stillUrl:c,showChecking:u,operatorText:p=null,voicePrompt:y,overlay:f,reduceMotion:d=!1,modeSwitch:_=null}){let h=I(),b=n==="checking",g=b||n==="frozen",v=g&&u?h("capture.checking"):e,C=y?.(s,v,t);return m("div",{className:d?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[o("video",{ref:r,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),c!==null&&g?o("img",{src:c,alt:h("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,o(x,{progress:i,phase:n,draining:l}),f?.(r),C!=null&&!g?o("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:C}):null,_!==null&&!g?o(H,{view:_,className:"sekyro-stage__corner-end sekyro-stage__mode-switch",kind:"chip"}):null,b&&u?m("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[o(G,{}),h("capture.cameraOff")]}):null,m("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[o("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:v},v),g&&u?o("span",{className:"sekyro-stage__guidance-hint",children:h("capture.checkingHint")}):p!==null&&!g?o("span",{className:"sekyro-stage__guidance-hint","data-testid":"sekyro-operator-line",children:p}):null]})]})}a(ne,"CaptureStage");function H({view:r,className:e,kind:s}){let t=V(),i=m(M,{children:[o(D,{}),o("span",{children:r.label})]}),n={onClick:r.onSwitch,"aria-describedby":t,"data-testid":"sekyro-capture-mode-switch","data-mode":r.to};return m(M,{children:[s==="chip"?o(S,{kind:"chip",className:e,...n,children:i}):o("button",{type:"button",className:e,...n,children:i}),o("span",{id:t,className:"sekyro-visually-hidden",children:r.description})]})}a(H,"ModeSwitchChip");function D(){return m("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[o("path",{d:"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"}),o("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),o("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}a(D,"FlipCameraIcon");function G(){return m("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon sekyro-icon--sm",children:[o("path",{d:"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"}),o("path",{d:"M3 3l18 18"})]})}a(G,"CameraOffIcon");import{screenRampColourValue as P}from"@sekyro/web";import{useEffect as U,useLayoutEffect as $,useRef as L}from"react";import{createPortal as K}from"react-dom";import{Fragment as X,jsx as N,jsxs as Z}from"react/jsx-runtime";var W=typeof window>"u"?U:$,R="data-sekyro-ramp",O=[["background-color","transparent"],["background-image","none"]];function z(r){let e=[],s=r.ownerDocument;for(let n=r;n!==null&&n!==s.documentElement;n=n.parentElement){if(!(n instanceof HTMLElement)&&!(n instanceof SVGElement))continue;let l=n.style;for(let[c,u]of O){let p=l.getPropertyValue(c),y=l.getPropertyPriority(c);l.setProperty(c,u,"important"),e.push(()=>{p===""?l.removeProperty(c):l.setProperty(c,p,y)})}}let t=s.documentElement,i=t.hasAttribute(R);return t.setAttribute(R,""),i||e.push(()=>t.removeAttribute(R)),()=>{for(let n of e.reverse())n()}}a(z,"clearAncestorBackdrops");function B(r){return{position:"fixed",inset:0,minWidth:"100vw",minHeight:"100lvh",margin:0,padding:0,border:0,zIndex:-1,pointerEvents:"none",backgroundColor:P(r)}}a(B,"washStyle");function Y(r){return{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:P(r)}}a(Y,"coverStyle");function de({colour:r}){let e=L(null),s=r!==null;return W(()=>{let t=e.current?.parentElement;if(!(!s||t===null||t===void 0))return z(t)},[s]),r===null||typeof document>"u"?null:Z(X,{children:[N("div",{ref:e,"aria-hidden":"true","data-testid":"sekyro-screen-ramp-cover","data-colour":r,style:Y(r)}),K(N("div",{"aria-hidden":"true","data-testid":"sekyro-screen-ramp","data-colour":r,style:B(r)}),document.body)]})}a(de,"ScreenRampLayer");export{ne as a,H as b,de as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as y}from"./chunk-
|
|
2
|
+
import{a as y}from"./chunk-HF3773DV.js";import{q as w}from"./chunk-LOW3VZIA.js";import{a as d}from"./chunk-OIHMIBJX.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-VCE6CEBN.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{q as h,r as M,s as m}from"./chunk-P7TS7JPW.js";import{a as n}from"./chunk-2KED7D2Q.js";var f={success:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M8.5 12.5L10.5 14.5L15.5 9.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',pending:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M12 8V12L14.5 14.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',info:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M12 17V11" stroke="currentColor" stroke-linecap="round"/><path d="M12 8H12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',timer:'<path d="M3 13A9 9 0 1 0 21 13A9 9 0 1 0 3 13Z" stroke="currentColor"/><path d="M12 9V13L14.5 15.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.5 4.5L7.5 2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M20.5 4.5L16.5 2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',closeCircle:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M14.5 9.5L9.5 14.5M9.5 9.5L14.5 14.5" stroke="currentColor" stroke-linecap="round"/>',sms:'<path d="M14.6 19.21C14.26 19.41 14.05 19.76 13.63 20.47L13.09 21.39C12.6 22.2 11.4 22.2 10.91 21.39L10.37 20.47C9.95 19.76 9.74 19.41 9.4 19.21C9.07 19.01 8.64 19.01 7.79 18.99C6.53 18.97 5.75 18.89 5.09 18.62C3.86 18.11 2.89 17.14 2.38 15.91C2 14.99 2 13.83 2 11.5V10.5C2 7.23 2 5.59 2.74 4.39C3.15 3.71 3.71 3.15 4.39 2.74C5.59 2 7.23 2 10.5 2H13.5C16.77 2 18.41 2 19.61 2.74C20.29 3.15 20.85 3.71 21.26 4.39C22 5.59 22 7.23 22 10.5V11.5C22 13.83 22 14.99 21.62 15.91C21.11 17.14 20.14 18.11 18.91 18.62C18.25 18.89 17.47 18.97 16.21 18.99C15.36 19.01 14.93 19.01 14.6 19.21Z" stroke="currentColor" stroke-linecap="round"/>',whatsapp:'<path d="M17.47 14.38c-0.3-0.15-1.76-0.87-2.03-0.97c-0.27-0.1-0.47-0.15-0.670.15c-0.20.3-0.770.97-0.94 1.16c-0.170.2-0.350.22-0.640.07c-0.3-0.15-1.25-0.46-2.39-1.48c-0.88-0.79-1.48-1.76-1.65-2.06c-0.17-0.3-0.02-0.460.13-0.61c0.13-0.130.3-0.350.45-0.52s0.2-0.30.3-0.5c0.1-0.20.05-0.37-0.03-0.52s-0.67-1.61-0.92-2.21c-0.24-0.58-0.49-0.5-0.67-0.51a13 13 0 0 0-0.57-0.01c-0.2 0-0.520.07-0.790.37c-0.270.3-1.04 1.02-1.04 2.48c0 1.46 1.06 2.88 1.21 3.07s2.1 3.2 5.08 4.49c0.710.31 1.260.49 1.690.63c0.710.23 1.360.2 1.870.12c0.57-0.09 1.76-0.72 2.01-1.41s0.25-1.290.17-1.41c-0.07-0.12-0.27-0.2-0.57-0.35m-5.42 7.4h0a9.87 9.87 0 0 1-5.03-1.38l-0.36-0.21l-3.740.98l1-3.65l-0.23-0.37a9.86 9.86 0 0 1-1.51-5.26c0-5.45 4.44-9.88 9.89-9.88c2.64 0 5.12 1.03 6.99 2.9a9.82 9.82 0 0 1 2.89 6.99c0 5.45-4.44 9.88-9.88 9.88m8.41-18.3A11.82 11.82 0 0 0 12.05 0C5.5 0 0.16 5.330.16 11.89c0 2.10.55 4.14 1.59 5.95L0.06 24l6.3-1.65a11.9 11.9 0 0 0 5.68 1.45h0.01c6.55 0 11.89-5.33 11.89-11.89a11.82 11.82 0 0 0-3.48-8.41" fill="currentColor"/>',back:'<path d="M15 5L9 12L15 19" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',warning:'<path d="M5.31 10.76C8.23 5.59 9.69 3 12 3C14.31 3 15.77 5.59 18.69 10.76L19.05 11.41C21.48 15.71 22.69 17.86 21.59 19.43C20.5 21 17.79 21 12.36 21H11.64C6.21 21 3.5 21 2.41 19.43C1.31 17.86 2.52 15.71 4.95 11.41L5.31 10.76Z" stroke="currentColor"/><path d="M12 8V13" stroke="currentColor" stroke-linecap="round"/><path d="M12 16H12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',external:'<path d="M9 15L15 9M15 13.5V9H10.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><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"/>'};var u={id:'<path d="M4 6H17C18.66 6 20 7.34 20 9V19C20 20.66 18.66 22 17 22H7C5.34 22 4 20.66 4 19V6ZM4 6V5" stroke="currentColor" stroke-linejoin="round"/><path d="M9 13A3 3 0 1 0 15 13A3 3 0 1 0 9 13Z" stroke="currentColor"/><path d="M18 6H5.07C4.48 6 4 5.52 4 4.93C4 4.4 4.39 3.94 4.92 3.87L15.72 2.33C16.92 2.15 18 3.09 18 4.31V6Z" stroke="currentColor" stroke-linejoin="round"/><path d="M10 19H14" stroke="currentColor" stroke-linecap="round"/>',card:'<path d="M2 12C2 8.23 2 6.34 3.17 5.17C4.34 4 6.23 4 10 4H14C17.77 4 19.66 4 20.83 5.17C22 6.34 22 8.23 22 12C22 15.77 22 17.66 20.83 18.83C19.66 20 17.77 20 14 20H10C6.23 20 4.34 20 3.17 18.83C2 17.66 2 15.77 2 12Z" stroke="currentColor"/><path d="M10 16H6" stroke="currentColor" stroke-linecap="round"/><path d="M14 16H12.5" stroke="currentColor" stroke-linecap="round"/><path d="M2 10L22 10" stroke="currentColor" stroke-linecap="round"/>',lock:'<path d="M2 16C2 13.17 2 11.76 2.88 10.88C3.76 10 5.17 10 8 10H16C18.83 10 20.24 10 21.12 10.88C22 11.76 22 13.17 22 16C22 18.83 22 20.24 21.12 21.12C20.24 22 18.83 22 16 22H8C5.17 22 3.76 22 2.88 21.12C2 20.24 2 18.83 2 16Z" stroke="currentColor"/><path d="M6 10V8C6 4.69 8.69 2 12 2C15.31 2 18 4.69 18 8V10" stroke="currentColor" stroke-linecap="round"/>',passport:'<path d="M4 6H17C18.66 6 20 7.34 20 9V19C20 20.66 18.66 22 17 22H7C5.34 22 4 20.66 4 19V6ZM4 6V5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M15 13A3 3 0 1 1 9 13A3 3 0 1 1 15 13Z" stroke="currentColor" stroke-linecap="round"/><path d="M18 6H5.07C4.48 6 4 5.52 4 4.93C4 4.4 4.39 3.94 4.92 3.87L15.72 2.33C16.92 2.15 18 3.09 18 4.31V6Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 19H14" stroke="currentColor" stroke-linecap="round"/>',camera:'<path d="M9 13A3 3 0 1 0 15 13A3 3 0 1 0 9 13Z" stroke="currentColor"/><path d="M9.78 21H14.22C17.34 21 18.9 21 20.02 20.26C20.51 19.95 20.93 19.54 21.25 19.06C22 17.96 22 16.43 22 13.36C22 10.3 22 8.77 21.25 7.67C20.93 7.19 20.51 6.78 20.02 6.46C19.3 5.99 18.4 5.82 17.02 5.76C16.36 5.76 15.8 5.27 15.67 4.64C15.47 3.68 14.62 3 13.63 3H10.37C9.38 3 8.53 3.68 8.33 4.64C8.2 5.27 7.64 5.76 6.98 5.76C5.6 5.82 4.7 5.99 3.98 6.46C3.49 6.78 3.07 7.19 2.75 7.67C2 8.77 2 10.3 2 13.36C2 16.43 2 17.96 2.75 19.06C3.07 19.54 3.49 19.95 3.98 20.26C5.1 21 6.66 21 9.78 21Z" stroke="currentColor"/><path d="M19 10H18" stroke="currentColor" stroke-linecap="round"/>',light:'<path d="M6 12A6 6 0 1 0 18 12A6 6 0 1 0 6 12Z" stroke="currentColor"/><path d="M12 2V3" stroke="currentColor" stroke-linecap="round"/><path d="M12 21V22" stroke="currentColor" stroke-linecap="round"/><path d="M22 12L21 12" stroke="currentColor" stroke-linecap="round"/><path d="M3 12L2 12" stroke="currentColor" stroke-linecap="round"/><path d="M19.07 4.93L18.68 5.32" stroke="currentColor" stroke-linecap="round"/><path d="M5.32 18.68L4.93 19.07" stroke="currentColor" stroke-linecap="round"/><path d="M19.07 19.07L18.68 18.68" stroke="currentColor" stroke-linecap="round"/><path d="M5.32 5.32L4.93 4.93" stroke="currentColor" stroke-linecap="round"/>',jGlasses:'<path d="M14 16A4 4 0 1 0 22 16A4 4 0 1 0 14 16Z" stroke="currentColor"/><path d="M2 16A4 4 0 1 0 10 16A4 4 0 1 0 2 16Z" stroke="currentColor"/><path d="M14 16.21L13.34 15.98C12.47 15.67 11.53 15.67 10.66 15.98L10 16.21" stroke="currentColor" stroke-linecap="round"/><path d="M2 16L2.76 7.61C2.88 6.34 2.94 5.71 3.31 5.24C3.68 4.77 4.28 4.57 5.48 4.17L6 4" stroke="currentColor" stroke-linecap="round"/><path d="M22 16L21.24 7.61C21.12 6.34 21.06 5.71 20.69 5.24C20.32 4.77 19.72 4.57 18.52 4.17L18 4" stroke="currentColor" stroke-linecap="round"/>',smartphone:'<path d="M4 10C4 6.23 4 4.34 5.17 3.17C6.34 2 8.23 2 12 2C15.77 2 17.66 2 18.83 3.17C20 4.34 20 6.23 20 10V14C20 17.77 20 19.66 18.83 20.83C17.66 22 15.77 22 12 22C8.23 22 6.34 22 5.17 20.83C4 19.66 4 17.77 4 14V10Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 19H9" stroke="currentColor" stroke-linecap="round"/>',close:'<path d="M19.01 5L5.01 19" stroke="currentColor" stroke-linecap="round"/><path d="M19 19L5 5" stroke="currentColor" stroke-linecap="round"/>',phone:'<path d="M18.68 19.96C19.19 19.91 19.64 19.63 20 19.25L21.42 17.76C22.38 16.75 22.11 15.02 20.88 14.31L18.97 13.21C18.17 12.75 17.19 12.88 16.56 13.55L16.1 14.03C16.1 14.03 15.02 15.17 12.06 12.06C9.11 8.94 10.19 7.81 10.19 7.81L10.48 7.5C11.18 6.76 11.25 5.56 10.63 4.69L9.37 2.91C8.61 1.83 7.14 1.69 6.26 2.61L4.69 4.26C4.26 4.72 3.97 5.31 4 5.97C4.09 7.65 4.81 11.26 8.82 15.48C13.06 19.95 17.05 20.12 18.68 19.96Z" stroke="currentColor" stroke-linecap="round"/>',email:'<path d="M2 12C2 8.23 2 6.34 3.17 5.17C4.34 4 6.23 4 10 4H14C17.77 4 19.66 4 20.83 5.17C22 6.34 22 8.23 22 12C22 15.77 22 17.66 20.83 18.83C19.66 20 17.77 20 14 20H10C6.23 20 4.34 20 3.17 18.83C2 17.66 2 15.77 2 12Z" stroke="currentColor"/><path d="M6 8L8.16 9.8C10 11.33 10.91 12.09 12 12.09C13.09 12.09 14 11.33 15.84 9.8L18 8" stroke="currentColor" stroke-linecap="round"/>',face:'<path d="M9 16C9.85 16.63 10.88 17 12 17C13.12 17 14.15 16.63 15 16" stroke="currentColor" stroke-linecap="round"/><path d="M2.2 10C3 6.08 6.08 3 10 2.2" stroke="currentColor" stroke-linecap="round"/><path d="M2.2 14C3 17.92 6.08 21 10 21.8" stroke="currentColor" stroke-linecap="round"/><path d="M21.8 10C21 6.08 17.92 3 14 2.2" stroke="currentColor" stroke-linecap="round"/><path d="M21.8 14C21 17.92 17.92 21 14 21.8" stroke="currentColor" stroke-linecap="round"/><path d="M15.5 10.5C15.5 11.05 15.28 11.5 15 11.5C14.72 11.5 14.5 11.05 14.5 10.5C14.5 9.95 14.72 9.5 15 9.5C15.28 9.5 15.5 9.95 15.5 10.5Z" stroke="currentColor"/><path d="M8.5 10.5A0.5 1 0 1 0 9.5 10.5A0.5 1 0 1 0 8.5 10.5Z" stroke="currentColor"/>',copy:'<path d="M6 11C6 8.17 6 6.76 6.88 5.88C7.76 5 9.17 5 12 5H15C17.83 5 19.24 5 20.12 5.88C21 6.76 21 8.17 21 11V16C21 18.83 21 20.24 20.12 21.12C19.24 22 17.83 22 15 22H12C9.17 22 7.76 22 6.88 21.12C6 20.24 6 18.83 6 16V11Z" stroke="currentColor"/><path d="M6 19C4.34 19 3 17.66 3 16V10C3 6.23 3 4.34 4.17 3.17C5.34 2 7.23 2 11 2H15C16.66 2 18 3.34 18 5" stroke="currentColor"/>'};import{jsx as S}from"react/jsx-runtime";function L({name:e,className:o}){return S("svg",{className:`sekyro-glyph${o?` ${o}`:""}`,viewBox:"0 0 24 24",fill:"none",stroke:"none",strokeWidth:1.5,"aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:e in u?u[e]:f[e]}})}n(L,"Icon");import{createContext as c,useContext as d,useEffect as i,useId as x,useLayoutEffect as g,useRef as y,useState as H}from"react";import{jsx as a,jsxs as p}from"react/jsx-runtime";function B({id:e,title:o,lead:r,lang:t}){let C=m(),l=t?.title!==void 0?t.dir:void 0,s=t?.lead!==void 0?t.dir:void 0;return p("div",{className:"sekyro-heading",children:[a("h2",{id:e,ref:C,tabIndex:-1,className:"sekyro-text-body",lang:t?.title,dir:l,children:o}),r!==void 0?a("p",{className:"sekyro-text-muted",lang:t?.lead,dir:s,children:r}):null]})}n(B,"StepHeading");var A=c(null),v=typeof window>"u"?i:g;function G({children:e}){let o=d(A),r=x(),t=o?.claim;return v(()=>t?.(r),[t,r]),p("div",{className:"sekyro-actions",children:[e,o!==null&&o.owner===r?o.node:null]})}n(G,"StepActions");var Z=c(()=>{});function D(e){let o=d(Z),r=y(e);r.current=e;let t=e!==null;i(()=>{if(t)return o(()=>r.current?.()),()=>o(null)},[t,o])}n(D,"useFlowBack");var P=c(void 0),q=c(void 0),V=c(()=>{});function z(e){let o=d(V);i(()=>(o(e),()=>o(!1)),[e,o])}n(z,"useImmersive");var b=c(null);function J({onStop:e}){let o=d(b);return o===null?null:a("button",{type:"button",className:"sekyro-lm-upload",disabled:o.busy,"aria-busy":o.busy||void 0,"data-testid":"sekyro-skip-capture",onClick:()=>{e?.(),o.run()},children:o.label})}n(J,"CameraSkip");function Q({template:e,code:o}){let[r,t]=e.split("{code}");return p("span",{"data-testid":"sekyro-test-code-line",children:[r,a("bdi",{dir:"ltr",className:"sekyro-mono sekyro-test-code",children:o}),t]})}n(Q,"TestCodeLine");var I=100;function w({swapKey:e,className:o,children:r}){let[t,C]=H({key:e,node:r}),l=y(r);l.current=r;let s=t.key!==e;return i(()=>{if(!s)return;let N=setTimeout(()=>C({key:e,node:l.current}),I);return()=>clearTimeout(N)},[s,e]),a("div",{className:`${o}${s?" is-leaving":""}`,"aria-hidden":s||void 0,children:s?t.node:r},t.key)}n(w,"Swap");var U=n(({pageKey:e,children:o})=>a(w,{swapKey:e,className:"sekyro-page",children:o}),"PageSwap");import{jsx as k,jsxs as _}from"react/jsx-runtime";var O={info:"info",warning:"warning",danger:"warning"};function s1({tone:e,children:o}){return _(M,{tone:e,children:[k("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:k(L,{name:O[e]})}),k("div",{className:"sekyro-notice__body",children:o})]})}n(s1,"StepNotice");function a1(e,o,r){return r?e.t("common.noAttemptsLeft"):h(e.strings,e.locale,o)}n(a1,"attemptsLine");export{L as a,B as b,A as c,G as d,Z as e,D as f,P as g,q as h,V as i,z as j,b as k,J as l,Q as m,w as n,U as o,s1 as p,a1 as q};
|
|
2
|
+
import{q as h,r as M,s as m}from"./chunk-OIHMIBJX.js";import{a as n}from"./chunk-2KED7D2Q.js";var f={success:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M8.5 12.5L10.5 14.5L15.5 9.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',pending:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M12 8V12L14.5 14.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',info:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M12 17V11" stroke="currentColor" stroke-linecap="round"/><path d="M12 8H12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',timer:'<path d="M3 13A9 9 0 1 0 21 13A9 9 0 1 0 3 13Z" stroke="currentColor"/><path d="M12 9V13L14.5 15.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.5 4.5L7.5 2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M20.5 4.5L16.5 2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',closeCircle:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M14.5 9.5L9.5 14.5M9.5 9.5L14.5 14.5" stroke="currentColor" stroke-linecap="round"/>',sms:'<path d="M14.6 19.21C14.26 19.41 14.05 19.76 13.63 20.47L13.09 21.39C12.6 22.2 11.4 22.2 10.91 21.39L10.37 20.47C9.95 19.76 9.74 19.41 9.4 19.21C9.07 19.01 8.64 19.01 7.79 18.99C6.53 18.97 5.75 18.89 5.09 18.62C3.86 18.11 2.89 17.14 2.38 15.91C2 14.99 2 13.83 2 11.5V10.5C2 7.23 2 5.59 2.74 4.39C3.15 3.71 3.71 3.15 4.39 2.74C5.59 2 7.23 2 10.5 2H13.5C16.77 2 18.41 2 19.61 2.74C20.29 3.15 20.85 3.71 21.26 4.39C22 5.59 22 7.23 22 10.5V11.5C22 13.83 22 14.99 21.62 15.91C21.11 17.14 20.14 18.11 18.91 18.62C18.25 18.89 17.47 18.97 16.21 18.99C15.36 19.01 14.93 19.01 14.6 19.21Z" stroke="currentColor" stroke-linecap="round"/>',whatsapp:'<path d="M17.47 14.38c-0.3-0.15-1.76-0.87-2.03-0.97c-0.27-0.1-0.47-0.15-0.670.15c-0.20.3-0.770.97-0.94 1.16c-0.170.2-0.350.22-0.640.07c-0.3-0.15-1.25-0.46-2.39-1.48c-0.88-0.79-1.48-1.76-1.65-2.06c-0.17-0.3-0.02-0.460.13-0.61c0.13-0.130.3-0.350.45-0.52s0.2-0.30.3-0.5c0.1-0.20.05-0.37-0.03-0.52s-0.67-1.61-0.92-2.21c-0.24-0.58-0.49-0.5-0.67-0.51a13 13 0 0 0-0.57-0.01c-0.2 0-0.520.07-0.790.37c-0.270.3-1.04 1.02-1.04 2.48c0 1.46 1.06 2.88 1.21 3.07s2.1 3.2 5.08 4.49c0.710.31 1.260.49 1.690.63c0.710.23 1.360.2 1.870.12c0.57-0.09 1.76-0.72 2.01-1.41s0.25-1.290.17-1.41c-0.07-0.12-0.27-0.2-0.57-0.35m-5.42 7.4h0a9.87 9.87 0 0 1-5.03-1.38l-0.36-0.21l-3.740.98l1-3.65l-0.23-0.37a9.86 9.86 0 0 1-1.51-5.26c0-5.45 4.44-9.88 9.89-9.88c2.64 0 5.12 1.03 6.99 2.9a9.82 9.82 0 0 1 2.89 6.99c0 5.45-4.44 9.88-9.88 9.88m8.41-18.3A11.82 11.82 0 0 0 12.05 0C5.5 0 0.16 5.330.16 11.89c0 2.10.55 4.14 1.59 5.95L0.06 24l6.3-1.65a11.9 11.9 0 0 0 5.68 1.45h0.01c6.55 0 11.89-5.33 11.89-11.89a11.82 11.82 0 0 0-3.48-8.41" fill="currentColor"/>',back:'<path d="M15 5L9 12L15 19" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',warning:'<path d="M5.31 10.76C8.23 5.59 9.69 3 12 3C14.31 3 15.77 5.59 18.69 10.76L19.05 11.41C21.48 15.71 22.69 17.86 21.59 19.43C20.5 21 17.79 21 12.36 21H11.64C6.21 21 3.5 21 2.41 19.43C1.31 17.86 2.52 15.71 4.95 11.41L5.31 10.76Z" stroke="currentColor"/><path d="M12 8V13" stroke="currentColor" stroke-linecap="round"/><path d="M12 16H12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',external:'<path d="M9 15L15 9M15 13.5V9H10.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><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"/>'};var u={id:'<path d="M4 6H17C18.66 6 20 7.34 20 9V19C20 20.66 18.66 22 17 22H7C5.34 22 4 20.66 4 19V6ZM4 6V5" stroke="currentColor" stroke-linejoin="round"/><path d="M9 13A3 3 0 1 0 15 13A3 3 0 1 0 9 13Z" stroke="currentColor"/><path d="M18 6H5.07C4.48 6 4 5.52 4 4.93C4 4.4 4.39 3.94 4.92 3.87L15.72 2.33C16.92 2.15 18 3.09 18 4.31V6Z" stroke="currentColor" stroke-linejoin="round"/><path d="M10 19H14" stroke="currentColor" stroke-linecap="round"/>',card:'<path d="M2 12C2 8.23 2 6.34 3.17 5.17C4.34 4 6.23 4 10 4H14C17.77 4 19.66 4 20.83 5.17C22 6.34 22 8.23 22 12C22 15.77 22 17.66 20.83 18.83C19.66 20 17.77 20 14 20H10C6.23 20 4.34 20 3.17 18.83C2 17.66 2 15.77 2 12Z" stroke="currentColor"/><path d="M10 16H6" stroke="currentColor" stroke-linecap="round"/><path d="M14 16H12.5" stroke="currentColor" stroke-linecap="round"/><path d="M2 10L22 10" stroke="currentColor" stroke-linecap="round"/>',lock:'<path d="M2 16C2 13.17 2 11.76 2.88 10.88C3.76 10 5.17 10 8 10H16C18.83 10 20.24 10 21.12 10.88C22 11.76 22 13.17 22 16C22 18.83 22 20.24 21.12 21.12C20.24 22 18.83 22 16 22H8C5.17 22 3.76 22 2.88 21.12C2 20.24 2 18.83 2 16Z" stroke="currentColor"/><path d="M6 10V8C6 4.69 8.69 2 12 2C15.31 2 18 4.69 18 8V10" stroke="currentColor" stroke-linecap="round"/>',passport:'<path d="M4 6H17C18.66 6 20 7.34 20 9V19C20 20.66 18.66 22 17 22H7C5.34 22 4 20.66 4 19V6ZM4 6V5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M15 13A3 3 0 1 1 9 13A3 3 0 1 1 15 13Z" stroke="currentColor" stroke-linecap="round"/><path d="M18 6H5.07C4.48 6 4 5.52 4 4.93C4 4.4 4.39 3.94 4.92 3.87L15.72 2.33C16.92 2.15 18 3.09 18 4.31V6Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 19H14" stroke="currentColor" stroke-linecap="round"/>',camera:'<path d="M9 13A3 3 0 1 0 15 13A3 3 0 1 0 9 13Z" stroke="currentColor"/><path d="M9.78 21H14.22C17.34 21 18.9 21 20.02 20.26C20.51 19.95 20.93 19.54 21.25 19.06C22 17.96 22 16.43 22 13.36C22 10.3 22 8.77 21.25 7.67C20.93 7.19 20.51 6.78 20.02 6.46C19.3 5.99 18.4 5.82 17.02 5.76C16.36 5.76 15.8 5.27 15.67 4.64C15.47 3.68 14.62 3 13.63 3H10.37C9.38 3 8.53 3.68 8.33 4.64C8.2 5.27 7.64 5.76 6.98 5.76C5.6 5.82 4.7 5.99 3.98 6.46C3.49 6.78 3.07 7.19 2.75 7.67C2 8.77 2 10.3 2 13.36C2 16.43 2 17.96 2.75 19.06C3.07 19.54 3.49 19.95 3.98 20.26C5.1 21 6.66 21 9.78 21Z" stroke="currentColor"/><path d="M19 10H18" stroke="currentColor" stroke-linecap="round"/>',light:'<path d="M6 12A6 6 0 1 0 18 12A6 6 0 1 0 6 12Z" stroke="currentColor"/><path d="M12 2V3" stroke="currentColor" stroke-linecap="round"/><path d="M12 21V22" stroke="currentColor" stroke-linecap="round"/><path d="M22 12L21 12" stroke="currentColor" stroke-linecap="round"/><path d="M3 12L2 12" stroke="currentColor" stroke-linecap="round"/><path d="M19.07 4.93L18.68 5.32" stroke="currentColor" stroke-linecap="round"/><path d="M5.32 18.68L4.93 19.07" stroke="currentColor" stroke-linecap="round"/><path d="M19.07 19.07L18.68 18.68" stroke="currentColor" stroke-linecap="round"/><path d="M5.32 5.32L4.93 4.93" stroke="currentColor" stroke-linecap="round"/>',jGlasses:'<path d="M14 16A4 4 0 1 0 22 16A4 4 0 1 0 14 16Z" stroke="currentColor"/><path d="M2 16A4 4 0 1 0 10 16A4 4 0 1 0 2 16Z" stroke="currentColor"/><path d="M14 16.21L13.34 15.98C12.47 15.67 11.53 15.67 10.66 15.98L10 16.21" stroke="currentColor" stroke-linecap="round"/><path d="M2 16L2.76 7.61C2.88 6.34 2.94 5.71 3.31 5.24C3.68 4.77 4.28 4.57 5.48 4.17L6 4" stroke="currentColor" stroke-linecap="round"/><path d="M22 16L21.24 7.61C21.12 6.34 21.06 5.71 20.69 5.24C20.32 4.77 19.72 4.57 18.52 4.17L18 4" stroke="currentColor" stroke-linecap="round"/>',smartphone:'<path d="M4 10C4 6.23 4 4.34 5.17 3.17C6.34 2 8.23 2 12 2C15.77 2 17.66 2 18.83 3.17C20 4.34 20 6.23 20 10V14C20 17.77 20 19.66 18.83 20.83C17.66 22 15.77 22 12 22C8.23 22 6.34 22 5.17 20.83C4 19.66 4 17.77 4 14V10Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 19H9" stroke="currentColor" stroke-linecap="round"/>',close:'<path d="M19.01 5L5.01 19" stroke="currentColor" stroke-linecap="round"/><path d="M19 19L5 5" stroke="currentColor" stroke-linecap="round"/>',phone:'<path d="M18.68 19.96C19.19 19.91 19.64 19.63 20 19.25L21.42 17.76C22.38 16.75 22.11 15.02 20.88 14.31L18.97 13.21C18.17 12.75 17.19 12.88 16.56 13.55L16.1 14.03C16.1 14.03 15.02 15.17 12.06 12.06C9.11 8.94 10.19 7.81 10.19 7.81L10.48 7.5C11.18 6.76 11.25 5.56 10.63 4.69L9.37 2.91C8.61 1.83 7.14 1.69 6.26 2.61L4.69 4.26C4.26 4.72 3.97 5.31 4 5.97C4.09 7.65 4.81 11.26 8.82 15.48C13.06 19.95 17.05 20.12 18.68 19.96Z" stroke="currentColor" stroke-linecap="round"/>',email:'<path d="M2 12C2 8.23 2 6.34 3.17 5.17C4.34 4 6.23 4 10 4H14C17.77 4 19.66 4 20.83 5.17C22 6.34 22 8.23 22 12C22 15.77 22 17.66 20.83 18.83C19.66 20 17.77 20 14 20H10C6.23 20 4.34 20 3.17 18.83C2 17.66 2 15.77 2 12Z" stroke="currentColor"/><path d="M6 8L8.16 9.8C10 11.33 10.91 12.09 12 12.09C13.09 12.09 14 11.33 15.84 9.8L18 8" stroke="currentColor" stroke-linecap="round"/>',face:'<path d="M9 16C9.85 16.63 10.88 17 12 17C13.12 17 14.15 16.63 15 16" stroke="currentColor" stroke-linecap="round"/><path d="M2.2 10C3 6.08 6.08 3 10 2.2" stroke="currentColor" stroke-linecap="round"/><path d="M2.2 14C3 17.92 6.08 21 10 21.8" stroke="currentColor" stroke-linecap="round"/><path d="M21.8 10C21 6.08 17.92 3 14 2.2" stroke="currentColor" stroke-linecap="round"/><path d="M21.8 14C21 17.92 17.92 21 14 21.8" stroke="currentColor" stroke-linecap="round"/><path d="M15.5 10.5C15.5 11.05 15.28 11.5 15 11.5C14.72 11.5 14.5 11.05 14.5 10.5C14.5 9.95 14.72 9.5 15 9.5C15.28 9.5 15.5 9.95 15.5 10.5Z" stroke="currentColor"/><path d="M8.5 10.5A0.5 1 0 1 0 9.5 10.5A0.5 1 0 1 0 8.5 10.5Z" stroke="currentColor"/>',copy:'<path d="M6 11C6 8.17 6 6.76 6.88 5.88C7.76 5 9.17 5 12 5H15C17.83 5 19.24 5 20.12 5.88C21 6.76 21 8.17 21 11V16C21 18.83 21 20.24 20.12 21.12C19.24 22 17.83 22 15 22H12C9.17 22 7.76 22 6.88 21.12C6 20.24 6 18.83 6 16V11Z" stroke="currentColor"/><path d="M6 19C4.34 19 3 17.66 3 16V10C3 6.23 3 4.34 4.17 3.17C5.34 2 7.23 2 11 2H15C16.66 2 18 3.34 18 5" stroke="currentColor"/>',hashtag:'<path d="M11 7L8 17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 7L13 17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M18 10H7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M17 14H6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 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 22Z" stroke="currentColor" stroke-linecap="round"/>',key:'<path d="M8.86 19.33L7.62 20.57C7.3 20.88 6.86 21.04 6.41 20.99L4.32 20.76C4.1 20.73 3.89 20.63 3.73 20.48L3.52 20.27C3.37 20.11 3.27 19.9 3.24 19.68L3.01 17.59C2.96 17.14 3.12 16.7 3.43 16.38L7.15 12.67C7.41 12.4 7.5 12 7.4 11.63C6.82 9.34 7.42 6.81 9.21 5.02C11.91 2.33 16.28 2.33 18.98 5.02C21.67 7.72 21.67 12.09 18.98 14.79C17.19 16.58 14.66 17.18 12.37 16.6C12 16.5 11.6 16.58 11.33 16.85L8.86 19.33ZM8.86 19.33L7.11 17.6M12.59 8.59C13.37 7.8 14.63 7.8 15.41 8.59C16.2 9.37 16.2 10.63 15.41 11.41C14.63 12.2 13.37 12.2 12.59 11.41C11.8 10.63 11.8 9.37 12.59 8.59Z" stroke="currentColor" stroke-linecap="round"/>'};import{jsx as S}from"react/jsx-runtime";function L({name:r,className:o}){return S("svg",{className:`sekyro-glyph${o?` ${o}`:""}`,viewBox:"0 0 24 24",fill:"none",stroke:"none",strokeWidth:1.5,"aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:r in u?u[r]:f[r]}})}n(L,"Icon");import{createContext as l,useContext as d,useEffect as i,useId as g,useLayoutEffect as x,useRef as y,useState as H}from"react";import{jsx as a,jsxs as p}from"react/jsx-runtime";function B({id:r,title:o,lead:e,lang:t}){let C=m(),c=t?.title!==void 0?t.dir:void 0,s=t?.lead!==void 0?t.dir:void 0;return p("div",{className:"sekyro-heading",children:[a("h2",{id:r,ref:C,tabIndex:-1,className:"sekyro-text-body",lang:t?.title,dir:c,children:o}),e!==void 0?a("p",{className:"sekyro-text-muted",lang:t?.lead,dir:s,children:e}):null]})}n(B,"StepHeading");var Z=l(null),A=typeof window>"u"?i:x;function G({children:r}){let o=d(Z),e=g(),t=o?.claim;return A(()=>t?.(e),[t,e]),p("div",{className:"sekyro-actions",children:[r,o!==null&&o.owner===e?o.node:null]})}n(G,"StepActions");var P=l({issuer:null,listed:[],set:n(()=>{},"set")}),v=l(()=>{});function D(r){let o=d(v),e=y(r);e.current=r;let t=r!==null;i(()=>{if(t)return o(()=>e.current?.()),()=>o(null)},[t,o])}n(D,"useFlowBack");var q=l(void 0),z=l(void 0),V=l(()=>{});function J(r){let o=d(V);i(()=>(o(r),()=>o(!1)),[r,o])}n(J,"useImmersive");var I=l(null);function Q({onStop:r}){let o=d(I);return o===null?null:a("button",{type:"button",className:"sekyro-lm-upload",disabled:o.busy,"aria-busy":o.busy||void 0,"data-testid":"sekyro-skip-capture",onClick:()=>{r?.(),o.run()},children:o.label})}n(Q,"CameraSkip");function U({template:r,code:o}){let[e,t]=r.split("{code}");return p("span",{"data-testid":"sekyro-test-code-line",children:[e,a("bdi",{dir:"ltr",className:"sekyro-mono sekyro-test-code",children:o}),t]})}n(U,"TestCodeLine");var b=100;function w({swapKey:r,className:o,children:e}){let[t,C]=H({key:r,node:e}),c=y(e);c.current=e;let s=t.key!==r;return i(()=>{if(!s)return;let N=setTimeout(()=>C({key:r,node:c.current}),b);return()=>clearTimeout(N)},[s,r]),a("div",{className:`${o}${s?" is-leaving":""}`,"aria-hidden":s||void 0,children:s?t.node:e},t.key)}n(w,"Swap");var X=n(({pageKey:r,children:o})=>a(w,{swapKey:r,className:"sekyro-page",children:o}),"PageSwap");import{jsx as k,jsxs as _}from"react/jsx-runtime";var O={info:"info",warning:"warning",danger:"warning"};function l1({tone:r,children:o}){return _(M,{tone:r,children:[k("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:k(L,{name:O[r]})}),k("div",{className:"sekyro-notice__body",children:o})]})}n(l1,"StepNotice");function a1(r,o,e){return e?r.t("common.noAttemptsLeft"):h(r.strings,r.locale,o)}n(a1,"attemptsLine");export{L as a,B as b,Z as c,G as d,P as e,v as f,D as g,q as h,z as i,V as j,J as k,I as l,Q as m,U as n,w as o,X as p,l1 as q,a1 as r};
|