@sekyro/elements 0.1.0-rc.19 → 0.1.0-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cdn/chunks/capture-session-doc-HIN3YZG2-ZOYOVMIF.js +1 -0
- package/dist/cdn/chunks/{chunk-3PBU4237.js → chunk-2GVFM77I.js} +2 -2
- package/dist/cdn/chunks/{chunk-WANVL25H.js → chunk-32CNXSJQ.js} +1 -1
- package/dist/cdn/chunks/{chunk-L66SWMJ5.js → chunk-677IJRH3.js} +1 -1
- package/dist/cdn/chunks/chunk-BMTTAXWY.js +25 -0
- package/dist/cdn/chunks/{chunk-EPMGZQHF.js → chunk-BO327WCQ.js} +1 -1
- package/dist/cdn/chunks/chunk-BWOTZKA7.js +1 -0
- package/dist/cdn/chunks/{chunk-EXMVZUHU.js → chunk-CYEDFGUG.js} +1 -1
- package/dist/cdn/chunks/{chunk-RTCZJKYC.js → chunk-FQHV53QQ.js} +1 -1
- package/dist/cdn/chunks/chunk-FZP5NLDQ.js +1 -0
- package/dist/cdn/chunks/chunk-HOBGJOBT.js +1 -0
- package/dist/cdn/chunks/{chunk-ZWP6MDIC.js → chunk-HPTNANWX.js} +1 -1
- package/dist/cdn/chunks/{chunk-CGOCWIXM.js → chunk-K67DQTFL.js} +1 -1
- package/dist/cdn/chunks/{chunk-PAU2BFT7.js → chunk-L7I27OCG.js} +1 -1
- package/dist/cdn/chunks/{chunk-WCEIXBIS.js → chunk-LHYSCL4T.js} +1 -1
- package/dist/cdn/chunks/chunk-MINBJAVX.js +1 -0
- package/dist/cdn/chunks/chunk-MXMEO2IW.js +1 -0
- package/dist/cdn/chunks/{chunk-IXRKOBFA.js → chunk-PZVVXMQ6.js} +1 -1
- package/dist/cdn/chunks/chunk-RH466MDF.js +3 -0
- package/dist/cdn/chunks/{chunk-HXD7VO3F.js → chunk-U7QPOSFH.js} +1 -1
- package/dist/cdn/chunks/{chunk-6H2SLOEK.js → chunk-X6LDVTUQ.js} +1 -1
- package/dist/cdn/chunks/{chunk-K2JDLIFO.js → chunk-Z6OYPC4S.js} +1 -1
- package/dist/cdn/chunks/chunk-ZJNLNYA5.js +1 -0
- package/dist/cdn/chunks/{create-document-capture-4ZOSBL3Y-KLZDMWOQ.js → create-document-capture-Z3UK34XH-J7HHUVQU.js} +1 -1
- package/dist/cdn/chunks/document-capture-view-NI4452T4-UL6ELWE6.js +1 -0
- package/dist/cdn/chunks/{eid-view-6DXZ5ELB-ZX35JGDS.js → eid-view-GAIQODI5-AH3LJYP4.js} +1 -1
- package/dist/cdn/chunks/{email-otp-view-3UJPJOQ6-MIOPWSME.js → email-otp-view-SM2POPMA-XEEHDST5.js} +1 -1
- package/dist/cdn/chunks/{flow-views-ZVDXJZWH-C5ZVKCB6.js → flow-views-NBUWHG7J-HB57IJYX.js} +1 -1
- package/dist/cdn/chunks/{form-view-4NKEHYNF-I25LMP47.js → form-view-GOFXOQJO-6K34NRBN.js} +1 -1
- package/dist/cdn/chunks/overlay-de-YLCWZB42-REI3GVKV.js +1 -0
- package/dist/cdn/chunks/overlay-es-YIPBOMXT-5DHSESGX.js +1 -0
- package/dist/cdn/chunks/overlay-pt-JSDCAYVA-MQHVGOHK.js +1 -0
- package/dist/cdn/chunks/plan-runner-JSLWPJ6D-7PE72QOP.js +1 -0
- package/dist/cdn/chunks/{portrait-capture-view-QDUJ36UH-GRTZTYTJ.js → portrait-capture-view-TTUVVA7L-ENQSXXXH.js} +1 -1
- package/dist/cdn/chunks/{portrait-review-view-LW5DBF3L-K7WAOPAG.js → portrait-review-view-BCIENGKR-SHYX5FRE.js} +1 -1
- package/dist/cdn/chunks/{proof-of-address-view-E6WJTTIV-7ISFWEEZ.js → proof-of-address-view-SS2TIV3D-GFY3THLT.js} +1 -1
- package/dist/cdn/define.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/{chunk-BRS7YLGB.js → chunk-2TOYHI7F.js} +1 -1
- package/dist/{chunk-VBJ4CJHE.js → chunk-2ZWLZDO2.js} +1 -1
- package/dist/{chunk-QNK7OBIW.js → chunk-3NYC5YLB.js} +1 -1
- package/dist/chunk-3T7JA7T7.js +1 -0
- package/dist/{chunk-SVGBNMXK.js → chunk-47ELGOCA.js} +1 -1
- package/dist/{chunk-KYDIB6KR.js → chunk-7FYJ4XL4.js} +1 -1
- package/dist/{chunk-CY66YE6F.js → chunk-AUISCZAL.js} +1 -1
- package/dist/{chunk-7XJHQ3NM.js → chunk-GXENE4GQ.js} +1 -1
- package/dist/{chunk-5QJOJLKJ.js → chunk-HRJ5PESP.js} +1 -1
- package/dist/{chunk-RPA5QQVH.js → chunk-IYLMNTY5.js} +2 -2
- package/dist/chunk-TBECC5OK.js +1 -0
- package/dist/{chunk-PKK72TVJ.js → chunk-UJM3T4QD.js} +1 -1
- package/dist/{chunk-6FAODASF.js → chunk-V4USJ5ZA.js} +1 -1
- package/dist/chunk-XXCBLQ53.js +1 -0
- package/dist/chunk-YUZW7NSK.js +25 -0
- package/dist/define.cjs +5 -5
- package/dist/define.js +1 -1
- package/dist/document-capture-view-NI4452T4-VZHREVJN.js +1 -0
- package/dist/{eid-view-6DXZ5ELB-XDQVFDXS.js → eid-view-GAIQODI5-KCEO3AZS.js} +1 -1
- package/dist/{email-otp-view-3UJPJOQ6-5PQM7LNW.js → email-otp-view-SM2POPMA-O7WM3ZEZ.js} +1 -1
- package/dist/{flow-views-ZVDXJZWH-LOGNCRIA.js → flow-views-NBUWHG7J-PO2CMTIF.js} +1 -1
- package/dist/{form-view-4NKEHYNF-VFMN6QFW.js → form-view-GOFXOQJO-CRQWOLQA.js} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/dist/overlay-de-YLCWZB42-XINMWIXZ.js +1 -0
- package/dist/overlay-es-YIPBOMXT-MS7EN5ZX.js +1 -0
- package/dist/overlay-pt-JSDCAYVA-27WQ3BLB.js +1 -0
- package/dist/{portrait-capture-view-QDUJ36UH-QZR4O3YW.js → portrait-capture-view-TTUVVA7L-6BGZEV6C.js} +1 -1
- package/dist/{portrait-review-view-LW5DBF3L-QVERJXKH.js → portrait-review-view-BCIENGKR-WZ7GCBEX.js} +1 -1
- package/dist/{proof-of-address-view-E6WJTTIV-4SHZIQ3O.js → proof-of-address-view-SS2TIV3D-C6YD4BRC.js} +1 -1
- package/dist/styles.css +2 -0
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/cdn/chunks/capture-session-doc-DFLSX6BB-3ULMTYJH.js +0 -1
- package/dist/cdn/chunks/chunk-2TFK736S.js +0 -1
- package/dist/cdn/chunks/chunk-4VHWJD57.js +0 -1
- package/dist/cdn/chunks/chunk-AC45ZP53.js +0 -1
- package/dist/cdn/chunks/chunk-D7YINY2U.js +0 -3
- package/dist/cdn/chunks/chunk-JR4AQLJ2.js +0 -1
- package/dist/cdn/chunks/chunk-LUO3AZFS.js +0 -1
- package/dist/cdn/chunks/chunk-PLWGAXYM.js +0 -25
- package/dist/cdn/chunks/chunk-YULJCSQ3.js +0 -1
- package/dist/cdn/chunks/document-capture-view-25EASYV7-EUEYS55L.js +0 -1
- package/dist/cdn/chunks/overlay-de-64ABPD3N-KIBBQI36.js +0 -1
- package/dist/cdn/chunks/overlay-es-VIMXYK2Q-KTLONTNF.js +0 -1
- package/dist/cdn/chunks/overlay-pt-3IBDZBAW-DQTJHDLG.js +0 -1
- package/dist/cdn/chunks/plan-runner-3BLEJWHF-3K3RBXJU.js +0 -1
- package/dist/chunk-57MVUXQ6.js +0 -25
- package/dist/chunk-M7HNWDQD.js +0 -1
- package/dist/chunk-XQPY6G2B.js +0 -1
- package/dist/chunk-YZ6YGLNN.js +0 -1
- package/dist/document-capture-view-25EASYV7-MOFQVGV6.js +0 -1
- package/dist/overlay-de-64ABPD3N-ARJE63WR.js +0 -1
- package/dist/overlay-es-VIMXYK2Q-JRHIX3OT.js +0 -1
- package/dist/overlay-pt-3IBDZBAW-JXQE6BVY.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as hr,d as fr}from"./chunk-AUISCZAL.js";import{b as kr,c as bt}from"./chunk-HRJ5PESP.js";import{a as br}from"./chunk-XXCBLQ53.js";import{c as Ct}from"./chunk-TBECC5OK.js";import{a as ur,b as dr,c as pr,d as Ae}from"./chunk-V4USJ5ZA.js";import{G as yr,L as gr,M as vr,a as K,b as de,c as te,m as lr,n as Je,p as or,q as et,r as ir,s as cr,t as kt,u as oe,v as Le,w as tt,y as mr}from"./chunk-YUZW7NSK.js";import{a as l,c as U,i as s}from"./chunk-SSU37LFQ.js";var _r=U(K(),1),y=U(de(),1),re=U(de(),1),ye=U(K(),1),D=U(de(),1),C=U(K(),1),m=U(K(),1),at=U(K(),1),fe=U(de(),1),Gr=U(K(),1),X=U(K(),1),ot=U(K(),1),we=U(de(),1),Se=U(de(),1),B=U(de(),1),it=U(K(),1),pe=U(K(),1),Q=U(K(),1),L=U(K(),1),me=U(K(),1),Te=U(K(),1),Rt=U(de(),1),v=U(de(),1);import{subscribeCameraPermission as Tn}from"@sekyro/web";import{getLivenessAssetsStatus as Pn,preloadLivenessAssets as Bn,subscribeLivenessAssets as On}from"@sekyro/web";import{createLivenessCapture as Vn}from"@sekyro/web";function ce({className:e,children:t}){return(0,y.jsx)("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}l(ce,"ne");s(ce,"Svg");var Mt="M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z";function wr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,y.jsx)("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}l(wr,"ln");s(wr,"SunIcon");function Sr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,y.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}l(Sr,"un");s(Sr,"FaceUncoveredIcon");function xr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,y.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,y.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}l(xr,"dn");s(xr,"PhoneEyeLevelIcon");function Nr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,y.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}l(Nr,"pn");s(Nr,"LookStraightIcon");function Rr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M9 13l2 2 4-4"})]})}l(Rr,"fn");s(Rr,"CameraCheckIcon");function Mr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}l(Mr,"mn");s(Mr,"CameraAskIcon");function Ar(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M3 3l18 18"})]})}l(Ar,"yn");s(Ar,"CameraBlockedIcon");function nt({off:e,className:t}){return(0,y.jsxs)(ce,{className:t,children:[(0,y.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,y.jsx)("path",{d:"M4 4l16 16"}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,y.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}l(nt,"Ve");s(nt,"SpeakerIcon");function Lr(e){return(0,y.jsx)(ce,{...e,children:(0,y.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}l(Lr,"gn");s(Lr,"CheckIcon");function Er(e){return(0,y.jsxs)(ce,{className:e.className??"sekyro-spinner",children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,y.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}l(Er,"hn");s(Er,"SpinnerIcon");var _t=["light","uncover","eyeLevel","straight"],Nn={light:{key:"capture.tips.light",icon:s(()=>(0,re.jsx)(wr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:s(()=>(0,re.jsx)(Sr,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:s(()=>(0,re.jsx)(xr,{}),"icon")},straight:{key:"capture.tips.straight",icon:s(()=>(0,re.jsx)(Nr,{}),"icon")}};function Ir({tips:e}){let t=Ae(),n=(0,_r.useId)();return e.length===0?null:(0,re.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,re.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,re.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let a=typeof r=="string"?Nn[r]:void 0,o=typeof r=="string"?r:r.id,c=a!==void 0?a.icon():typeof r=="string"?void 0:r.icon,d=a!==void 0?t(a.key):typeof r=="string"?r:r.text;return(0,re.jsxs)("li",{className:"sekyro-tips__item",children:[c!=null?(0,re.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:c}):null,(0,re.jsx)("span",{children:d})]},o)})})]})}l(Ir,"Cn");s(Ir,"TipList");var Rn=220;function Ur({title:e,description:t,options:n,busy:r,error:a,focus:o,testId:c,look:d="cards",marked:S,onChoose:p}){let w=(0,ye.useId)(),N=kt(),[j,R]=(0,ye.useState)(null),O=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{a!==null&&R(null)},[a]),(0,ye.useEffect)(()=>()=>{O.current!==null&&clearTimeout(O.current)},[]);let q=s(M=>{r||j!==null||(R(M),O.current=setTimeout(()=>{O.current=null,R(null),p(M)},Rn))},"choose");return(0,D.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":c,children:[(0,D.jsxs)("div",{className:d==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,D.jsx)("h2",{id:w,ref:o?N:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,D.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),a!==null?(0,D.jsx)(oe,{tone:"danger",children:(0,D.jsx)("span",{children:a})}):null,d==="buttons"?(0,D.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((M,J)=>(0,D.jsx)(te,{kind:J===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:l(()=>p(M.id),"onClick"),children:M.label},M.id))}):(0,D.jsx)("div",{className:"sekyro-choices",children:n.map(M=>(0,D.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(j??S)===M.id,"aria-busy":r||void 0,disabled:r||j!==null&&j!==M.id,onClick:l(()=>q(M.id),"onClick"),children:[M.glyph!==void 0?(0,D.jsx)("span",{className:"sekyro-card__tile",children:M.glyph}):null,(0,D.jsxs)("span",{className:"sekyro-card__body",children:[(0,D.jsx)("span",{className:"sekyro-card__title",children:M.label}),M.sub!==void 0?(0,D.jsx)("span",{className:"sekyro-card__sub",children:M.sub}):null]}),(0,D.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},M.id))})]})}l(Ur,"bn");s(Ur,"ChoiceScreen");var jr=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","fcv3.one_face","capture.tips.summary","capture.lookAtColours"];function st(e){return e!==null&&jr.includes(e)}l(st,"he");s(st,"isVoiceKey");var Mn=s((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let a=e[n];r=a!=null&&Mn(a,t)?a[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}l(je,"Me");s(je,"resolveClip");var An="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",Ln={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ie(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}l(ie,"re");s(ie,"synth");function Tr(){return ie()!==null&&typeof SpeechSynthesisUtterance=="function"}l(Tr,"Lr");s(Tr,"speechAvailable");function wt(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}l(wt,"Sn");s(wt,"baseLang");function At(e,t){let n=s(a=>a.replace(/_/g,"-").toLowerCase(),"norm"),r=wt(t);return e.find(a=>n(a.lang)===n(t))??e.find(a=>wt(a.lang)===r)}l(At,"Mn");s(At,"pickVoice");function Pr(e){if(!Tr())return!1;let t=[];try{t=ie()?.getVoices()??[]}catch{return!0}return t.length===0||At(t,e)!==void 0}l(Pr,"wn");s(Pr,"speechUsable");function Br(e){let t=ie();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}l(Br,"Ln");s(Br,"subscribeVoices");function $e(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}l($e,"Ke");s($e,"clipIdentity");function St(e){e.pause(),e.removeAttribute("src"),e.load()}l(St,"Rn");s(St,"release");function Or(){let e=null,t=null,n=0,r=null,a=null,o=null,c=!1,d=null,S=[],p=new Map,w=s(()=>{S=ie()?.getVoices()??[]},"loadVoices"),N=!1,j=s(()=>{let h=ie();N||h===null||(N=!0,w(),h.addEventListener?.("voiceschanged",w))},"bindVoices"),R=s(()=>(e??(e=new Audio),e),"element"),O=s((h,x,_,k)=>{let u=ie();if(u!==null&&h!==""&&typeof SpeechSynthesisUtterance=="function"){j();let A=At(S,x);if(S.length===0||A!==void 0){u.cancel();let I=new SpeechSynthesisUtterance(h);I.lang=x,A!==void 0&&(I.voice=A),I.rate=.95,_!==void 0&&(I.onend=_),(_!==void 0||k!==void 0)&&(I.onerror=$=>{k!==void 0&&$.error==="not-allowed"?k():_?.()}),u.speak(I);return}}_?.()},"speak"),q=s(()=>{n+=1,r=null,a=o=null,e!==null&&(e.pause(),e.currentTime=0),ie()?.cancel()},"stop"),M=s(h=>{for(let x of h){let _=$e(x);if(p.has(_))continue;let k=new Audio;k.preload="auto",k.src=x,p.set(_,k)}},"warmClips"),J=s((h,x,_)=>{let k={utterance:h,generation:x,end:_};d=k;let u=s(()=>x===n&&d===k,"live"),A=s(()=>{u()&&(a=k)},"block");if(ie()?.cancel(),h.url!==null){let I=R();I.pause(),I.muted=!1,I.src=h.url,I.currentTime=0,I.onended=_??null;let $=s(()=>{o===k&&(o=null)},"settled"),i=I.play();if(i===void 0)return;o=k,i.then($,T=>{if($(),!u())return;let P=T?.name;if(P!=="AbortError"){if(P==="NotAllowedError")return A();h.speech?O(h.text,h.lang,_,A):_?.()}});return}h.speech?O(h.text,h.lang,_,A):_?.()},"start");return{say(h){let x=h.url!==null?$e(h.url):`tts:${h.lang}:${h.text}`;if(x===r)return;r=x,a=o=null,n+=1;let _=n,k=h.onEnd;J(h,_,k!==void 0?()=>{_===n&&k()}:void 0)},unlock({lang:h,speech:x,prefetch:_}){let k=a??(c?null:o);c=!0;let u=k!==null&&k.generation===n?k:null;a=o=null,u!==null&&J(u.utterance,u.generation,u.end);let A=R();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let T=Uint8Array.from(atob(An),P=>P.charCodeAt(0));t=URL.createObjectURL(new Blob([T],{type:"audio/wav"}))}let I=A.paused===!1&&t!==null&&A.src!==t;t!==null&&!I&&(u===null||u.utterance.url===null)&&(A.muted=!0,A.onended=null,A.src=t,A.play()?.catch(()=>{}));let $=ie(),i=u!==null&&u.utterance.url===null;if(x&&!i&&$!==null&&typeof SpeechSynthesisUtterance=="function"){j();let T=new SpeechSynthesisUtterance(" ");T.volume=0,T.lang=h,$.speak(T)}M(_??[])},prefetch:M,stop:q,dispose(){q(),N&&ie()?.removeEventListener?.("voiceschanged",w),N=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&St(e),e=null;for(let h of p.values())St(h);p.clear()}}}l(Or,"_n");s(Or,"createVoicePlayer");var En="sekyro.voiceGuidance";function qr(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}}l(qr,"xn");s(qr,"readVoicePreference");function Vr(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}l(Vr,"En");s(Vr,"writeVoicePreference");var Ve="capture.tips.summary",In=typeof window<"u"?C.useLayoutEffect:C.useEffect,Un=Object.freeze({});function rt(e,t){let n=new Set,r=[];for(let a of jr){let o=a===Ve?null:je(e,a,t);o===null||n.has($e(o))||(n.add($e(o)),r.push(o))}return r}l(rt,"ht");s(rt,"resolvedClipUrls");function $r({locale:e,defaultClips:t,options:n}){let r=n===!1,a=r?{}:n??{},o=a.storageKey===void 0?En:a.storageKey,[c,d]=(0,C.useState)(a.defaultEnabled??!0),S=(0,C.useRef)(c),[p,w]=(0,C.useState)(!1),[N,j]=(0,C.useState)("none"),[R,O]=(0,C.useState)(!1),q=(0,C.useRef)(!1),[M,J]=(0,C.useState)(0),h=(0,C.useRef)(null),x=(0,C.useCallback)(()=>(h.current??(h.current=Or()),h.current),[]),_=Ln[e],k=a.speechFallback,u=k===void 0||k===!0?!0:k===!1?!1:k.includes(e),A=a.clips??t??Un,I=(0,C.useRef)(!1),$=(0,C.useRef)(A);In(()=>{$.current=A,S.current=c}),(0,C.useEffect)(()=>{if(r||o===null)return;let E=qr(o);E!==null&&(S.current=E,d(E))},[r,o]),(0,C.useEffect)(()=>{if(!(r||!u))return Br(()=>J(E=>E+1))},[r,u]);let i=a.clips;(0,C.useEffect)(()=>{if(r)return;let E=u&&Pr(_);w(rt(A,e).length>0||E),j(i!==void 0&&je(i,Ve,e)!==null?"partner":je(A,Ve,e)!==null||E?"default":"none")},[r,A,i,e,u,_,M]),(0,C.useEffect)(()=>{if(r||!c||!I.current)return;let E=rt(A,e);E.length>0&&x().prefetch(E)},[r,c,A,e,x]),(0,C.useEffect)(()=>()=>{h.current?.dispose(),h.current=null,I.current=!1},[]);let T=(0,C.useCallback)(E=>{r||(I.current=!0,x().unlock({lang:_,speech:u,...E?{prefetch:rt($.current,e)}:{}}))},[r,x,_,u,e]),P=(0,C.useCallback)(()=>T(S.current),[T]),z=(0,C.useCallback)(()=>{q.current=!1,O(!1)},[]),F=(0,C.useCallback)(()=>{z(),h.current?.stop()},[z]),ge=(0,C.useCallback)(()=>{q.current&&F()},[F]),he=(0,C.useCallback)((E,xe)=>{if(r)return;if(q.current){F();return}let ve=x();ve.stop(),q.current=!0,O(!0);let V=xe?.clip===!1?null:je($.current,Ve,e);ve.say({url:V,text:E,lang:_,speech:u,onEnd:z})},[r,F,x,e,_,u,z]),Y=(0,C.useCallback)(E=>{r||(E?T(!0):F(),o!==null&&Vr(o,E),S.current=E,d(E))},[r,T,F,o]),W=(0,C.useCallback)(()=>Y(!S.current),[Y]),ne=(0,C.useCallback)((E,xe)=>{if(r||!c)return;q.current&&z();let ve=je($.current,E,e);x().say({url:ve,text:xe,lang:_,speech:u})},[r,c,e,x,_,u,z]);return(0,C.useMemo)(()=>({supported:!r&&p,enabled:!r&&c,setEnabled:Y,toggle:W,unlock:P,speakKey:ne,stop:F,summary:r?"none":N,summaryPlaying:R,toggleSummary:he,stopSummary:ge}),[r,p,c,Y,W,P,ne,F,N,R,he,ge])}l($r,"vt");s($r,"useVoiceGuidance");function Fr(e,t,n,r){let{speakKey:a,stop:o,enabled:c}=e,d=(0,C.useRef)(!1);(0,C.useEffect)(()=>{if(!r||!c){d.current&&o(),d.current=!1;return}d.current=!0,st(t)&&t!==Ve&&n!==""&&a(t,n)},[r,c,t,n,a,o])}l(Fr,"Ct");s(Fr,"useSpeakGuidance");function lt(e,t){let n=Dr(e);return n==="face"&&(t==="lighting"||e==="liveness_inconclusive")?"again":n}l(lt,"Pn");s(lt,"retryCoachingOf");function Dr(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"}}l(Dr,"Pr");s(Dr,"coachingOfReason");var Fe={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},again:{title:"capture.retryTips.title",tips:["capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function Hr({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:a}){let o=Ae(),c=(0,at.useRef)(null);return(0,at.useEffect)(()=>{r&&c.current?.focus()},[r]),!e&&!r?null:(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,fe.jsx)("p",{className:"sekyro-text-body",children:o(Fe[t].title)}),(0,fe.jsx)("ul",{className:"sekyro-coaching",children:Fe[t].tips.map(d=>(0,fe.jsx)("li",{children:o(d)},d))}),n!==null?(0,fe.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,fe.jsx)(te,{ref:c,className:"sekyro-btn--start",onClick:a,children:o("capture.recordAgain")}):null]})}l(Hr,"Tn");s(Hr,"CapturedPanel");function Lt(){try{return!1}catch{return!1}}l(Lt,"nt");s(Lt,"isDevBuild");var jn=(0,Gr.createContext)(null);function Kr({state:e}){let t=Ae(),[n,r]=(0,ot.useState)(!1);(0,ot.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let a=e==="granted"?(0,we.jsx)(Rr,{}):e==="denied"?(0,we.jsx)(Ar,{}):(0,we.jsx)(Mr,{});return(0,we.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,we.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:a}),(0,we.jsx)("span",{children:t(`capture.permission.${e}`)})]})}l(Kr,"On");s(Kr,"PermissionRow");function Zr({voice:e}){let t=Ae();if(!e.supported)return null;let n=e.enabled;return(0,Se.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:l(()=>e.toggle(),"onClick"),children:[(0,Se.jsxs)("span",{className:"sekyro-switch__label",children:[(0,Se.jsx)(nt,{off:!n}),t("capture.voiceGuidance")]}),(0,Se.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,Se.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,Se.jsx)(Lr,{className:"sekyro-switch__check"}):null})})]})}l(Zr,"Hn");s(Zr,"VoiceSwitch");function zr({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:a,tips:o,summary:c,startLabel:d,startDisabled:S,onStart:p}){let w=Ae(),N=(0,X.useRef)(c?.stop);N.current=c?.stop,(0,X.useEffect)(()=>()=>N.current?.(),[]);let j=(0,X.useRef)(null),R=(0,X.useRef)(null),O=(0,X.useRef)(null),q=(0,X.useRef)(e),M=(0,X.useRef)(!1);(0,X.useEffect)(()=>{let u=q.current;if(q.current=e,u===e)return;let A=M.current;e!=="loading"&&(M.current=!1),Yr(j.current)&&(e==="failed"?O.current?.focus():A&&R.current?.focus())},[e]);let J=(0,X.useCallback)(()=>{M.current=!0,t()},[t]),h=e==="loading",x=h||S,_=(0,X.useCallback)(()=>{x||(N.current?.(),p())},[x,p]),k;return e==="failed"?k=(0,B.jsxs)(oe,{tone:"danger",testId:"sekyro-assets-error",children:[(0,B.jsx)("p",{className:"sekyro-text-body",children:w("fcv2.err.models")}),(0,B.jsx)(te,{kind:"ghost",ref:O,className:"sekyro-btn--start",onClick:J,"data-testid":"sekyro-assets-retry",children:w("common.retry")})]}):k=(0,B.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,B.jsx)(te,{ref:R,full:!0,"data-testid":"sekyro-start","aria-disabled":x?"true":void 0,"aria-busy":h?"true":void 0,onClick:_,children:h?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Er,{}),w("capture.preparing.title")]}):d??w("capture.start")}),h?(0,B.jsx)("p",{className:"sekyro-text-muted",children:w("capture.preparing.hint")}):null]}),(0,B.jsxs)("div",{ref:j,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,B.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,B.jsx)("h2",{className:"sekyro-text-body",children:w("capture.assisted.title")}),(0,B.jsx)("p",{className:"sekyro-text-muted",children:w("capture.assisted.lead")})]}):null,o!==!1?(0,B.jsx)(Ir,{tips:o}):null,c!==void 0?(0,B.jsxs)(te,{kind:"ghost",className:"sekyro-btn--start",onClick:c.toggle,"data-testid":"sekyro-tips-listen",children:[(0,B.jsx)(nt,{off:!1}),w(c.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,B.jsx)(Kr,{state:n}),(0,B.jsx)(Zr,{voice:a}),(0,B.jsx)("p",{className:"sekyro-text-muted",children:w("capture.securityNote")}),k,(0,B.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?w("capture.preparing.title"):e==="ready"?w("capture.ready"):""})]})}l(zr,"Fn");s(zr,"PreCaptureScreen");function Yr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}l(Yr,"Hr");s(Yr,"focusIsOurs");function Wr(){let[e,t]=(0,it.useState)({state:"unknown",settled:!1});return(0,it.useEffect)(()=>Tn(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}l(Wr,"Dn");s(Wr,"useCameraStatus");function Qr(e){return Et(e,"mobileRequired")}l(Qr,"qn");s(Qr,"useMobileRequired");function Xr(e){return Et(e,"returning").required}l(Xr,"jn");s(Xr,"useReturning");function Et(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let a=e?.[t];if(e===void 0||typeof a!="function"){r({required:!1,settled:!0});return}let o=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(c=>{o&&r({required:c===!0,settled:!0})},()=>{o&&r({required:!1,settled:!0})}),()=>{o=!1}},[e,t]),n}l(Et,"Yn");s(Et,"useFlag");function Jr(e){let t=s(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let o=e?.captureMode,c=e?.captureChoice??null;if(e===void 0||typeof o!="function"){r({session:"self",choice:c,settled:!0});return}let d=!0;return r({session:"self",choice:c,settled:!1}),Promise.resolve().then(()=>o.call(e)).then(S=>{let p=e.captureChoice??null;d&&r({session:p!==null&&S===p?"choice":S==="assisted"||S==="choice"?S:"self",choice:p,settled:!0})},()=>{d&&r({session:"self",choice:null,settled:!0})}),()=>{d=!1}},[e]);let a=(0,pe.useCallback)(o=>{e?.chooseCaptureMode?.(o),r(c=>({...c,choice:o}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:a}}l(Jr,"$n");s(Jr,"useCaptureMode");function en(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),a=e.on("result",()=>n(!1));return()=>{r(),a()}},[e]),t}l(en,"zn");s(en,"useBusy");var qn=s(()=>"idle","serverSnapshot");function xt(e){return Bn(e!==void 0?{assetBaseUrl:e}:{})}l(xt,"Qn");s(xt,"preload");function tn(e,t=!0){let n=(0,Q.useSyncExternalStore)((0,Q.useCallback)(p=>On(p,e),[e]),()=>Pn(e),qn),[r,a]=(0,Q.useState)(null),o=(0,Q.useRef)(!1),c=(0,Q.useCallback)(()=>{xt(e).then(p=>{o.current&&p==="idle"&&a({base:e})})},[e]);(0,Q.useEffect)(()=>(o.current=!0,c(),()=>{o.current=!1}),[c]);let d=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{if(n!=="idle"){d.current={base:e};return}!t||d.current===null||d.current.base!==e||(d.current=null,c())},[n,e,c,t]);let S=(0,Q.useCallback)(()=>{xt(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:S}}l(tn,"Jn");s(tn,"useLivenessAssets");var Cr={progress:0,hint:null,faceDetected:!1};function rn(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,L.useRef)(e.verification).current,a=(0,L.useRef)(!1);e.verification!==r&&!a.current&&Lt()&&(a.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let o=(0,L.useRef)(null),[c,d]=(0,L.useState)("idle"),[S,p]=(0,L.useState)(Cr),[w,N]=(0,L.useState)(!1),[j,R]=(0,L.useState)(!1),[O,q]=(0,L.useState)(null),[M,J]=(0,L.useState)(!1),[h,x]=(0,L.useState)(null),[_,k]=(0,L.useState)(null),[u,A]=(0,L.useState)(null),[I,$]=(0,L.useState)(null),[i,T]=(0,L.useState)(null),[P,z]=(0,L.useState)(!1),F=(0,L.useRef)(null),ge=(0,L.useRef)("idle"),he=(0,L.useRef)(-1),[Y,W]=(0,L.useState)(0),ne=(0,L.useRef)(e);ne.current=e,(0,L.useEffect)(()=>{let ee=t.current;if(ee===null)return;let ue={video:ee,...n!==void 0?{assetBaseUrl:n}:{}},H=r!==void 0?r.liveness(ue):Vn(ue);o.current=H;let Ne=s(()=>T(H.facingMode??null),"readFacing");Ne();let De=[H.on("state",b=>{b==="mode_switch"?z(!0):b!=="starting"&&b!=="gating"&&z(!1),b==="starting"?(ge.current!=="starting"&&(he.current+=1,W(Math.max(0,he.current))),k(null),A(null),p(Cr),R(!1),N(!1),q(null),x(null),F.current=null):b==="gating"&&ge.current==="recording"&&(R(!1),N(!1),q(null),F.current=null),ge.current=b,Ne(),d(b),ne.current.onStateChange?.(b)}),H.on("gate",b=>{let ke=F.current;F.current=b.progress,N(ke!==null&&b.progress<ke-.001&&b.progress>0&&b.progress<1),b.progress>=1&&R(!0),p(b)}),H.on("frozen",({previewDataUrl:b})=>q(b)),H.on("profile",({animations:b})=>J(b==="reduced")),H.on("ramp",({colour:b})=>x(b)),H.on("captured",b=>{k(b),$(null),ne.current.onCaptured?.(b)}),H.on("error",b=>{A(b);let ke=r?.reportCaptureIssue;ke!==void 0&&bt(Ee=>ke.call(r,Ee),kr("liveness",b,Math.max(0,he.current))),ne.current.onError?.(b)}),r?.on("result",b=>{$(b),ne.current.onResult?.(b)})];return()=>{for(let b of De)b?.();o.current=null,H.destroy()}},[r,t,n]);let E=(0,L.useCallback)(()=>{o.current?.start()},[]),xe=(0,L.useCallback)(()=>{o.current?.retry()},[]),ve=(0,L.useCallback)(async()=>{let ee=o.current;return ee===null||typeof ee.canSwitchCaptureMode!="function"?!1:await ee.canSwitchCaptureMode().catch(()=>!1)===!0},[]),V=(0,L.useCallback)(async ee=>{let ue=o.current;if(ue===null||typeof ue.setCaptureMode!="function")return!1;let H=await ue.setCaptureMode(ee).catch(()=>!1)===!0;return H&&T(ue.facingMode??null),H},[]);return{state:c,gate:S,draining:w,gateLocked:j,frozenPreview:O,reduceMotion:M,rampColour:h,artifacts:_,error:u,result:I,facingMode:i,start:E,retry:xe,canSwitchCaptureMode:ve,setCaptureMode:V,modeRestarted:P,attempt:Y}}l(rn,"er");s(rn,"useLivenessHandle");var $n=new Set(["national_number"]);function Nt(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>$n.has(n));return t.length>0?{...e,options:t}:null}l(Nt,"tr");s(Nt,"pending");function nn(e){let[t,n]=(0,me.useState)(null),[r,a]=(0,me.useState)(e===void 0),[o,c]=(0,me.useState)(!1),[d,S]=(0,me.useState)(!1);(0,me.useEffect)(()=>{if(n(null),e===void 0){a(!0);return}let N=!0,j=e.methodChoice;typeof j=="function"?(a(!1),Promise.resolve().then(()=>j.call(e)).then(O=>{N&&n(Nt(O))},()=>{}).finally(()=>{N&&a(!0)})):a(!0);let R=e.on("method",O=>n(Nt(O)));return()=>{N=!1,R()}},[e]);let p=(0,me.useCallback)(async N=>{if(e===void 0)return!1;c(!0),S(!1);try{return await e.selectMethod(N),n(null),!0}catch{return S(!0),!1}finally{c(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!d?w:null,settled:r,busy:o,failed:d,select:p}}l(nn,"nr");s(nn,"useMethodChoice");var Fn=["ar","fr","en"];function sn(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}}l(sn,"io");s(sn,"isClipUrl");function an(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of Fn){let a=t[r];if(!(typeof a!="object"||a===null))for(let[o,c]of Object.entries(a))!st(o)||!sn(c)||((n[r]??(n[r]={}))[o]=c)}return Object.keys(n).length>0?n:null}l(an,"ao");s(an,"toVoiceClipMap");function ln(e){let[t,n]=(0,Te.useState)(null);(0,Te.useEffect)(()=>{if(n(null),e===void 0)return;let a=!0,o=s(d=>{if(!a)return;let S=typeof d=="object"&&d!==null&&typeof d.setId=="string"?d:null;n(p=>p?.setId===S?.setId?p:S)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(o,()=>o(null))}catch{o(null)}let c=e.on("view",d=>o(d.voice));return()=>{a=!1,c()}},[e]);let r=(0,Te.useMemo)(()=>t!==null?an(t):null,[t]);return e===void 0?null:r}l(ln,"rr");s(ln,"useServerVoiceClips");function on({voice:e}){let t=Ae();return(0,Rt.jsx)(te,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:l(()=>e.toggle(),"onClick"),children:(0,Rt.jsx)(nt,{off:!e.enabled,className:"sekyro-icon"})})}l(on,"sr");s(on,"VoiceChip");var Dn=new Set(["abandoned","not_opened","cancelled","superseded"]),Hn=800,Gn="capture.lookAtColours";function cn(e){return e===void 0||e!==!1&&e.length===_t.length&&_t.every(t=>e.includes(t))}l(cn,"mo");s(cn,"isDefaultTips");function un(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}l(un,"yo");s(un,"carriesActivation");function dn(e){return typeof e=="object"&&e!==null&&!(0,m.isValidElement)(e)&&"tone"in e&&"text"in e}l(dn,"go");s(dn,"isNoticeObject");var Kn=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function pn(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}l(pn,"vo");s(pn,"isCapturing");function hn(e){return e==="captured"||e==="uploading"||e==="checking"}l(hn,"Co");s(hn,"isPostCapture");function Zn({verification:e,locale:t,dir:n,strings:r,slots:a,autoStart:o=!1,notice:c,startDisabled:d=!1,startLabel:S,tips:p,tipsSummary:w,coach:N,voice:j,onGuidance:R,onCaptured:O,onResult:q,onError:M,onStateChange:J,assetBaseUrl:h,className:x}){let _=dr(t),k=(0,m.useMemo)(()=>ur(t,r),[t,r,_]),u=(0,m.useMemo)(()=>g=>k[g]??"",[k]),A=n??(t==="ar"?"rtl":"ltr"),I=(0,m.useRef)(null),$=(0,m.useContext)(jn),i=rn({verification:e,videoRef:I,assetBaseUrl:h,onCaptured:O,onResult:q,onError:M,onStateChange:J}),T=tn(h,i.state==="idle"&&i.error===null),P=nn(e),z=P.choice!==null,F=Qr(e),ge=Xr(e),he=en(e),Y=Wr(),W=Jr(e),ne=W.session==="choice",E=W.mode==="assisted",xe=j!==!1&&j?.clips===void 0,ve=ln(xe?e:void 0),V=$r({locale:t,defaultClips:ve,options:j}),ee=E?"environment":"user",ue=W.settled,H=(0,m.useRef)(null),Ne=(0,m.useRef)(!1),De=(0,m.useRef)(V.unlock);De.current=V.unlock,(0,m.useEffect)(()=>{let g=H.current;if(g===null)return;let le=["pointerup","touchend","click","keydown"],_e=s(()=>{for(let qe of le)g.removeEventListener(qe,Me,!0)},"disarm");function Me(qe){if(Ne.current){_e();return}un(qe)&&(Ne.current=!0,_e(),De.current())}l(Me,"Re"),s(Me,"onGesture");for(let qe of le)g.addEventListener(qe,Me,{capture:!0,passive:!0});return _e},[]);let b=(0,m.useCallback)(()=>{Ne.current||(Ne.current=!0,V.unlock()),i.start()},[V.unlock,i.start]),ke=(0,m.useCallback)(()=>i.start(),[i.start]),Ee=(0,m.useRef)(!1),Pe=i.state==="idle"&&i.error===null,Ut=!z&&!F.required&&(o===!0||o==="when-permitted"&&Y.permission==="granted"),jt=Ut&&P.settled&&F.settled&&ue,yn=o==="when-permitted"&&!Y.permissionSettled&&!Ee.current,Tt=Ut&&Pe&&!Ee.current,ut=(yn||Tt||!ue)&&T.gate==="ready"?"loading":T.gate;(0,m.useEffect)(()=>{!jt||!Pe||T.gate!=="ready"||Ee.current||(Ee.current=!0,ke())},[jt,Pe,T.gate,ke]);let gn=Pe&&!z&&!F.required&&!(Tt&&T.gate==="ready"),[Pt,Bt]=(0,m.useState)(!1),{canSwitchCaptureMode:Ot,setCaptureMode:qt}=i;(0,m.useEffect)(()=>{if(!W.settled||!ne){Bt(!1);return}let g=!0;return Ot().then(le=>{g&&Bt(le)}),()=>{g=!1}},[W.settled,ne,Ot]);let{choose:Vt}=W,Ie=E?"self":"assisted",vn=(0,m.useCallback)(async()=>{await qt(Ie)&&Vt(Ie)},[qt,Vt,Ie]),$t=i.state!=="idle"&&i.facingMode!==null?i.facingMode:ee;(0,m.useEffect)(()=>{let g=I.current?.style;$t==="user"?g?.removeProperty("transform"):g&&(g.transform="none")},[$t]);let He=(0,m.useMemo)(()=>i.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(i.artifacts.keyframe):null,[i.artifacts]);(0,m.useEffect)(()=>{if(He!==null)return()=>URL.revokeObjectURL(He)},[He]);let Ft=i.frozenPreview??He,Ue=e!==void 0,Z=pn(i.state),be=hn(i.state),Ge=Z||be,se=i.result,Dt=i.state==="done"&&se!==null,Ke=Z&&i.rampColour!==null,dt=i.state==="recording"&&i.frozenPreview!==null&&!Ke,Ze=$!==null,Ht=Pt&&Z&&!dt?{to:Ie,label:u(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:u(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:s(()=>{vn()},"onSwitch")}:null,ze=i.modeRestarted&&Z?u("capture.modeSwitch.restarted"):null,Be=be||dt,Gt=be?"checking":dt?"frozen":i.state==="recording"||Ke?"recording":i.gateLocked||i.gate.progress>=1?"locked":i.gate.faceDetected?"aligning":"seeking",Ye=Z?i.gate.hint:null,We=i.state==="starting"?"capture.preparing.title":Ye===null?null:Ye==="center"&&!i.gate.faceDetected?"fcv3.no_face":lr(Ye),[kn,Kt]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(We!=="fcv3.no_face"){Kt(We);return}if(!Z)return;let g=setTimeout(()=>Kt(We),Hn);return()=>clearTimeout(g)},[We,Z]);let pt=Z&&!Ke&&typeof N=="string"&&N!=="",Zt=E&&Z?u("capture.assisted.stage"):null,Re=Z&&!pt?Ke?Gn:kn:null,ht=pt?N:Re===null?"":u(Re);Fr(V,Re,ht,Z);let zt=(0,m.useRef)(R);zt.current=R,(0,m.useEffect)(()=>{if(st(Re))try{zt.current?.(Re)}catch(g){console.error("[@sekyro/react] onGuidance threw:",g)}},[Re]);let Oe=(0,m.useMemo)(()=>({supported:V.supported,enabled:V.enabled,setEnabled:V.setEnabled,toggle:V.toggle}),[V.supported,V.enabled,V.setEnabled,V.toggle]),ft=a?.voicePrompt,Yt=ft!==void 0,Wt=j===void 0,Qt=(0,m.useRef)(!1);(0,m.useEffect)(()=>{!Yt||!Wt||Qt.current||!Lt()||(Qt.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."))},[Yt,Wt]);let bn=ft!==void 0?(g,le,_e)=>ft(g,le,_e,Oe):V.supported?()=>(0,v.jsx)(on,{voice:Oe}):void 0,{summary:mt,summaryPlaying:Xt,toggleSummary:Jt,stopSummary:er}=V,Qe=w!==void 0&&w!=="",tr=Qe?w:u("capture.tips.summary"),rr=Qe?mt!=="none":mt==="partner"||mt==="default"&&cn(p),Cn=(0,m.useMemo)(()=>rr?{playing:Xt,toggle:s(()=>Jt(tr,{clip:!Qe}),"toggle"),stop:er}:void 0,[rr,Xt,Jt,tr,er,Qe]),_n=(0,m.useMemo)(()=>({assets:ut,retryAssets:T.retry,permission:Y.permission,permissionSettled:Y.permissionSettled,captureMode:W.mode,facing:ee,voice:Oe}),[ut,T.retry,Y.permission,Y.permissionSettled,W.mode,ee,Oe]),wn=dn(c)?(0,v.jsx)(oe,{tone:c.tone,testId:"sekyro-host-notice",children:(0,v.jsx)("span",{children:c.text})}):c??null,ae=se!==null&&se.status==="retry"?se:null,G=Dt&&se.status==="unavailable"&&!z&&se.reasonCode!=="portrait_required"?se:null,Ce=Dt&&(se.status==="verified"||se.status==="not_verified"||se.status==="review")?se:null,yt=s((g,le)=>{if(g===void 0)return null;if(g==="device_cooldown"){let Me=ir(t,le);if(Me!==null)return u(Me.key).replace("{time}",Me.time)}let _e=et(g);return _e===null?null:u(_e)},"reasonText"),gt=s(g=>{let le=g.retakeHint===void 0?null:Je(g.retakeHint);return le===null?yt(g.reasonCode):u(le)},"retryText"),nr=Ce===null?null:yt(Ce.reasonCode,Ce.retryAfter)??(Ce.status==="not_verified"&&Ce.reason!==void 0&&Dn.has(Ce.reason)?u("errors.session_expired"):null),Sn=G!==null&&G.reasonCode!==void 0&&G.reasonCode!=="nni_unbound"&&G.reasonCode!=="id_number_unbound"&&G.reasonCode!=="method_required"&&G.reasonCode!=="mobile_required"&&!(G.reasonCode==="no_recorder"&&i.artifacts?.degraded==="NO_RECORDER"),Xe=G?.reasonCode,sr=i.attempt;(0,m.useEffect)(()=>{G===null||Xe===void 0||e?.reportCaptureIssue===void 0||Kn.has(Xe)||bt(g=>e.reportCaptureIssue?.(g),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:Xe,attempt:Math.min(1e3,sr)})},[G,Xe,sr,e]);let ar=kt(),xn=z&&P.auto===null&&!Z&&!be&&i.error===null,vt=(0,m.useCallback)(async g=>{await P.select(g)&&i.state==="done"&&i.retry()},[P.select,i.state,i.retry]);return(0,m.useEffect)(()=>{P.auto!==null&&!P.busy&&!Z&&!be&&vt(P.auto)},[P.auto,P.busy,Z,be,vt]),(0,v.jsx)(pr,{value:u,children:(0,v.jsxs)("div",{ref:H,className:x===void 0?"sekyro-capture":`sekyro-capture ${x}`,dir:A,lang:t,"data-testid":"sekyro-liveness-capture","data-state":i.state,children:[a?.header,ae!==null&>(ae)!==null&&!(Ze&&Ge)?(0,v.jsx)(oe,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,v.jsx)("span",{children:gt(ae)})}):null,ze!==null&&!Ze?(0,v.jsx)(oe,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,v.jsx)("span",{children:ze})}):null,he&&be&&!Ze?(0,v.jsx)(oe,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,v.jsx)("span",{children:u("capture.busy")})}):null,F.required&&Pe?(0,v.jsx)(oe,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,v.jsx)("span",{children:u("reasons.mobile_required")})}):null,i.error!==null?a?.errorPanel!==void 0?a.errorPanel(i.error,i.retry):(0,v.jsxs)(oe,{tone:"danger",testId:"sekyro-error-notice",children:[(0,v.jsx)("span",{children:u(or(i.error))}),i.error.retryable?(0,v.jsx)(te,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:u("common.retry")}):null]}):null,G!==null?(0,v.jsxs)(oe,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,v.jsx)("span",{children:(G.reasonCode==="attestation"&&G.attestationError==="clock_wrong"?u("errors.device_clock"):yt(G.reasonCode))??u(G.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),Sn?(0,v.jsx)(te,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:u(G.reasonCode==="attestation"?"common.retry":"capture.recordAgain")}):null]}):null,nr!==null&&Ce!==null?(0,v.jsx)(oe,{tone:Ce.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,v.jsx)("span",{children:nr})}):null,(0,v.jsx)("div",{className:Ge?void 0:"sekyro-hidden","data-capture-live":Ge?"":void 0,children:Ze?$({videoRef:I,guidance:Be&&Ue?u("capture.checking"):ht,coached:pt&&!(Be&&Ue),note:Be?Ue?u(he?"capture.busy":"capture.checkingHint"):null:ze??(ae!==null?gt(ae):Zt),settled:Be&&Ue,progress:i.gate.progress,phase:Gt,still:Be?Ft:null,live:Ge,modeSwitch:Ht,...Pt?{status:ze}:{},ramp:i.rampColour===null?null:{colour:i.rampColour}}):(0,v.jsx)(hr,{videoRef:I,guidanceText:ht,guidanceHint:Ye,guidanceKey:Re,progress:i.gate.progress,phase:Gt,draining:i.draining,stillUrl:Ft,showChecking:Ue,operatorText:Zt,voicePrompt:bn,overlay:l(g=>(0,v.jsxs)(v.Fragment,{children:[a?.stageOverlay?.(g),(0,v.jsx)(fr,{colour:i.rampColour})]}),"overlay"),reduceMotion:i.reduceMotion,modeSwitch:Ht})}),xn&&P.choice!==null?(0,v.jsx)(Ur,{title:u("method.title"),description:u("method.description"),options:P.choice.options.map(g=>({id:g,label:u(`method.${g}`)})),busy:P.busy,error:P.failed?u("errors.network_error"):null,focus:i.state==="done",testId:"sekyro-method",look:"buttons",onChoose:l(g=>{vt(g)},"onChoose")}):null,gn?(0,v.jsxs)(v.Fragment,{children:[ge&&a?.header===void 0&&a?.intro===void 0?(0,v.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,v.jsx)("h2",{className:"sekyro-text-body",children:u("returning.title")}),(0,v.jsx)("p",{className:"sekyro-text-muted",children:u("returning.description")})]}):null,wn,a?.intro!==void 0?a.intro(b,_n):(0,v.jsx)(zr,{assets:ut,onRetryAssets:T.retry,permission:Y.permission,captureMode:W.mode,voice:Oe,tips:p??_t,summary:Cn,startLabel:S,startDisabled:d,onStart:b})]}):null,(0,v.jsx)(Hr,{showCoaching:ae!==null,coaching:lt(ae?.reasonCode,ae?.retakeHint),attemptsText:ae?.attemptsRemaining!==void 0?cr(k,t,ae.attemptsRemaining):null,showRetake:ae!==null&&!Z&&!be||!Ue&&i.state==="captured",onRetake:i.retry}),a?.footer]})})}l(Zn,"Ei");s(Zn,"LivenessCapture");var It=U(K(),1),ct=U(K(),1),f=U(de(),1);import{isInAppBrowser as ts}from"@sekyro/web/client";var bs={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"},Cs={population_registry:"hashtag",national_eid:"key"};function zn(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=e.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}l(zn,"D");s(zn,"identityLabel");function Yn(e,t){let[n,r]=(0,It.useState)(!1),[a,o]=(0,It.useState)(null);return{busy:n,error:a,run:s(c=>{r(!0),o(null),c().then(()=>r(!1),d=>{r(!1),o(e.t(br(d,e.strings))),t?.(d)})},"run")}}l(Yn,"q");s(Yn,"useChoiceAction");function fn(){let e=`sekyro-face-light-${(0,ct.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,f.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("defs",{children:(0,f.jsx)("mask",{id:e,children:(0,f.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,f.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,f.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,f.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,f.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}l(fn,"O");s(fn,"FaceMark");var Wn={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function Qn(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}}l(Qn,"ne");s(Qn,"faceIntroRetryOf");var Xn={"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 Jn({start:e,context:t,tips:n,tipsTitle:r,human:a=!1,returning:o=!1,notice:c,retry:d}){let S=Ct(),{t:p}=S,w=d===void 0?"face":lt(d.reason,d.retakeHint),N=w==="face"?null:Fe[w].tips,j=(0,ct.useContext)(yr)?.busy===!0;return(0,f.jsxs)("section",{className:"sekyro-step",children:[(0,f.jsx)(fn,{}),t.captureMode==="assisted"?(0,f.jsx)(tt,{title:p("capture.assisted.heading"),lead:p("capture.assisted.lead")}):o?(0,f.jsx)(tt,{title:p("returning.heading"),lead:p("returning.description")}):(0,f.jsx)(tt,{title:p(a?"native.face.humanIntroTitle":"native.face.introTitle"),lead:p(a?"native.face.humanIntroLead":"native.face.introLead")}),d!==void 0?(0,f.jsx)(mn,{retry:d,title:Fe[w].title}):null,r!==void 0&&N===null?(0,f.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,f.jsx)("ul",{className:"sekyro-tiprows",children:N!==null?N.map(R=>(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:Xn[R]??"face"}),p(R)]},R)):n!==void 0?n.map(R=>(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:Wn[R.id]??"face"}),R.text]},R.id)):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:"light"}),p("capture.tips.light")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:"jGlasses"}),p("capture.tips.uncover")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:"smartphone"}),p("capture.tips.eyeLevel")]})]})}),c??null,c!==void 0?null:t.assets==="failed"?(0,f.jsx)(te,{kind:"secondary",full:!0,onClick:t.retryAssets,children:p("common.retry")}):null,c!==void 0?null:(0,f.jsx)(mr,{children:(0,f.jsxs)(te,{full:!0,disabled:t.assets!=="ready"||j,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,f.jsx)(Le,{name:"camera"}),p("capture.start")]})})]})}l(Jn,"re");s(Jn,"FaceIntro");var es=new Set(["match_inconclusive","no_face_source","below_threshold"]);function mn({retry:e,title:t}){let n=Ct(),r=e.retakeHint===void 0?null:Je(e.retakeHint),a=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":es.has(e.reason)?"capture.retryMatch.message":et(e.reason);return(0,f.jsxs)(gr,{tone:"warning",children:[r!==null?(0,f.jsx)("span",{children:n.t(r)}):a!==null?(0,f.jsx)("span",{children:n.t(a)}):null,r===null?(0,f.jsx)("span",{children:n.t(t)}):null,(0,f.jsx)("span",{children:vr(n,e.attemptsRemaining,e.attemptsExhausted)})]})}l(mn,"K");s(mn,"RetryNotice");function rs(e){return ts(e)}l(rs,"ce");s(rs,"isInAppBrowser");function ns(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let a=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${a};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}l(ns,"le");s(ns,"androidBrowserIntent");export{Ur as a,Lt as b,jn as c,Jr as d,Zn as e,bs as f,Cs as g,zn as h,Yn as i,Qn as j,Jn as k,rs as l,ns as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as X,b as z}from"./chunk-57MVUXQ6.js";import{a,c as Z,i as n}from"./chunk-SSU37LFQ.js";var u=Z(X(),1),J=Z(X(),1),s=Z(z(),1),h=Z(z(),1);import{normalizeNni as pe}from"@sekyro/web";var ue="AC247 AD376 AE971/0 AF93/0 AG1/1 AI1/1 AL355/0 AM374/0 AO244 AR54/0 AS1/1 AT43/0 AU61/0 AW297 AX358/0 AZ994/0 BA387/0 BB1/1 BD880/0 BE32/0 BF226 BG359/0 BH973 BI257 BJ229 BL590/0 BM1/1 BN673 BO591/0 BQ599 BR55/0 BS1/1 BT975 BW267 BY375/8 BZ501 CA1/1 CC61/0 CD243/0 CF236 CG242 CH41/0 CI225 CK682 CL56 CM237 CN86/0 CO57/0 CR506 CU53/0 CV238 CW599 CX61/0 CY357 CZ420 DE49/0 DJ253 DK45 DM1/1 DO1/1 DZ213/0 EC593/0 EE372 EG20/0 EH212/0 ER291/0 ES34 ET251/0 FI358/0 FJ679 FK500 FM691 FO298 FR33/0 GA241 GB44/0 GD1/1 GE995/0 GF594/0 GG44/0 GH233/0 GI350 GL299 GM220 GN224 GP590/0 GQ240 GR30 GT502 GU1/1 GW245 GY592 HK852 HN504 HR385/0 HT509 HU36/06 ID62/0 IE353/0 IL972/0 IM44/0 IN91/0 IO246 IQ964/0 IR98/0 IS354 IT39 JE44/0 JM1/1 JO962/0 JP81/0 KE254/0 KG996/0 KH855/0 KI686/0 KM269 KN1/1 KP850/0 KR82/0 KW965 KY1/1 KZ7/8 LA856/0 LB961/0 LC1/1 LI423/0 LK94/0 LR231/0 LS266 LT370/0 LU352 LV371 LY218/0 MA212/0 MC377/0 MD373/0 ME382/0 MF590/0 MG261/0 MH692/1 MK389/0 ML223 MM95/0 MN976/0 MO853 MP1/1 MQ596/0 MR222 MS1/1 MT356 MU230 MV960 MW265/0 MX52 MY60/0 MZ258 NA264/0 NC687 NE227 NF672 NG234/0 NI505 NL31/0 NO47 NP977/0 NR674 NU683 NZ64/0 OM968 PA507 PE51/0 PF689 PG675 PH63/0 PK92/0 PL48 PM508/0 PR1/1 PS970/0 PT351 PW680 PY595/0 QA974 RE262/0 RO40/0 RS381/0 RU7/8 RW250/0 SA966/0 SB677 SC248 SD249/0 SE46/0 SG65 SH290 SI386/0 SJ47 SK421/0 SL232/0 SM378 SN221 SO252/0 SR597 SS211/0 ST239 SV503 SX1/1 SY963/0 SZ268 TA290 TC1/1 TD235 TG228 TH66/0 TJ992 TK690 TL670 TM993/8 TN216 TO676 TR90/0 TT1/1 TV688 TW886/0 TZ255/0 UA380/0 UG256/0 US1/1 UY598/0 UZ998 VA39 VC1/1 VE58/0 VG1/1 VI1/1 VN84/0 VU678 WF681 WS685 XK383/0 YE967/0 YT262/0 ZA27/0 ZM260/0 ZW263/0",j;function Q(e){return j??(j=new Map(ue.split(" ").map(l=>{let[r,t]=l.slice(2).split("/");return[l.slice(0,2),[r,t]]}))),j.get(e.toUpperCase())}a(Q,"z");n(Q,"entryOf");function he(e){return Q(e)?.[0]}a(he,"Ne");n(he,"dialCodeOf");function re(e){return Q(e)?.[1]}a(re,"ee");n(re,"nationalPrefixOf");var ee=n(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold");function ne(e,l){let r=ee(l.trim());return r===""?e:e.filter(t=>ee(t.name).includes(r)||t.code.toLowerCase()===r)}a(ne,"ce");n(ne,"matchCountries");function ae({countries:e,label:l,searchPlaceholder:r,noMatch:t,onPick:v,selected:P,searchRef:f,scroll:E=!1,searchable:w=!0,detail:D,extra:y}){let[M,b]=(0,J.useState)(""),c=(0,J.useId)(),T=ne(e,M),N=(0,s.jsxs)("ul",{className:`sekyro-rows${E?" sekyro-rows--scroll":""}`,children:[T.map(d=>{let S=D?.(d.code);return(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"sekyro-row-btn","aria-current":P===d.code||void 0,onClick:a(()=>v(d.code),"onClick"),children:[(0,s.jsx)("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:se(d.code)}),(0,s.jsx)("span",{className:"sekyro-row-btn__name",children:d.name}),S!==void 0?(0,s.jsx)("bdi",{className:"sekyro-row-btn__detail",dir:"ltr",children:S}):null]})},d.code)}),y!==void 0?(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"sekyro-row-btn","aria-current":y.current||void 0,onClick:y.onPick,children:[(0,s.jsx)("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:"🌐"}),(0,s.jsx)("span",{className:"sekyro-row-btn__name",children:y.label})]})}):null]});return w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"sekyro-field",children:[(0,s.jsx)("label",{className:"sekyro-label",htmlFor:c,children:l}),(0,s.jsx)("input",{ref:f,id:c,type:"search",className:"sekyro-input",placeholder:r,value:M,onChange:a(d=>b(d.target.value),"onChange")})]}),T.length===0&&y===void 0?(0,s.jsx)("p",{className:"sekyro-text-muted",children:t}):N]}):N}a(ae,"te");n(ae,"CountryList");function U(e){let l=pe(e).replace(/\D/g,"");return/^\D*\+/.test(e)?`+${l}`:l.startsWith("00")?`+${l.slice(2)}`:l}a(U,"H");n(U,"digitsOf");var le=n((e,l)=>(l.trunk!==void 0&&e.startsWith(l.trunk)?e.slice(l.trunk.length):e).slice(0,Math.max(...l.lengths)),"fitDigits");function Y(e,l){let r="",t=0;for(let v of l?.formats?.find(P=>new RegExp(`^(?:${P.leading})`).test(e))?.groups??[])t<e.length&&(r+=(t>0?" ":"")+e.slice(t,t+v)),t+=v;return r+e.slice(t)}a(Y,"Z");n(Y,"groupDigits");function oe(e,l){let r=0;for(let t=l;t>0&&r<e.length;r+=1)e[r]!==" "&&(t-=1);return r}a(oe,"oe");n(oe,"caretAfter");var ie=n((e,l)=>l.find(r=>e.startsWith(r.dial)),"countryOfNumber"),me=n((e,l)=>e.lengths.join(", ").replace(/, (\d+)$/,` ${l} $1`),"lengthsLabel");function q(e){let l=U(e).replace("+","");return/^\d{8,15}$/.test(l)?`+${l}`:null}a(q,"le");n(q,"normalizedPhone");var se=n(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),l=>127397+l.charCodeAt(0))),"flagOf");function ce(e,l){if(l===null||!e.startsWith(l.dial))return q(e);let r=e.slice(l.dial.length).replace(/\D/g,""),t=re(l.code);return t!==void 0&&r.startsWith(t)&&(r=r.slice(t.length)),q(l.dial+r)}a(ce,"ye");n(ce,"e164Of");var te=n((e,l)=>(ie(e,l)??l[0])?.code??null,"countryFor");function de(e){let l=null;try{l=new Intl.DisplayNames([e],{type:"region"})}catch{}return r=>`${l?.of(r.code)??r.code} (${r.dial})`}a(de,"me");n(de,"countryLabels");var fe="other",ye=8;function ge({countries:e,international:l,closed:r,defaultPhone:t}){let[v,P]=(0,u.useState)(()=>te(t,e)),[f,E]=(0,u.useState)(t),[w,D]=(0,u.useState)(!1),[y,M]=(0,u.useState)(!1),b=e.map(o=>o.code).join(","),c=e.find(o=>o.code===v)??null,T=(0,u.useRef)(c);c!==null&&(T.current=c),(0,u.useEffect)(()=>{if(v===null||!e.some(o=>o.code===v)){let o=te(t,e);P(o);let i=T.current,k=e.find(C=>C.code===o)?.dial;k!==void 0&&E(C=>i!==null&&C.startsWith(i.dial)?k+C.slice(i.dial.length):C.startsWith("+")?C:k)}},[b,t]);let N=w||c===null,d=N||f.startsWith("+")&&!f.startsWith(c.dial),S=d?void 0:c.rule,x=d?f:f.replace(c.dial,"").replace(/\D/g,""),p=S?le(x,S):x,W=d&&!N&&!l&&r&&!e.some(o=>o.dial.startsWith(f)),I=W?null:S?S.lengths.includes(p.length)?c.dial+p:null:N&&!f.startsWith("+")?null:ce(f,w?null:c),H=d||c===null?I??f:`${c.dial} ${Y(p,S)}`,B=d?U(f).replace("+","")==="":p==="";return{countries:e,international:l,phone:f,selected:c,other:w,whole:d,free:N,rule:S,national:p,refused:W,typed:I,shown:H,empty:B,lengthShown:y,setLengthShown:M,onNumber:n(o=>{let i=o.target,k=o.nativeEvent.inputType,C=Math.max(0,i.value.lastIndexOf("+")),G=U(i.value.slice(C)),A=ie(G,e),_=U(i.value.slice(C,i.selectionStart)).length,F=G,V=G;if(M(!1),!A&&(N||G.startsWith("+")))l&&D(!0);else{let R=A??c,g=A?G.slice(A.dial.length):G;if(P(R.code),D(!1),g===p&&k?.startsWith("delete")&&(k.endsWith("Forward")||(_-=1),g=g.slice(0,_)+g.slice(_+1)),R.rule){let $=le(g,R.rule),O=g.length-$.length;_-=O,g=O>0&&!A&&p.length===$.length?p:$}V=R.dial+g,F=Y(g,R.rule)}E(V),i.value=F;let K=oe(F,_);i.setSelectionRange(K,K)},"onNumber"),onCountry:n(o=>{M(!1);let i=e.find(k=>k.code===o);D(i===void 0),i!==void 0&&P(i.code),E(i===void 0?"":i.dial+(d?"":p))},"onCountry")}}a(ge,"_e");n(ge,"usePhoneField");function Ne({field:e,id:l,locale:r,t,inputRef:v,invalid:P=!1,describedby:f,required:E,compact:w=!1,ready:D}){let{selected:y,whole:M,other:b,free:c,national:T,rule:N,phone:d,refused:S,typed:x,countries:p,international:W}=e,[I,H]=(0,u.useState)(!1),B=(0,u.useRef)(null),o=(0,u.useRef)(null),i=(0,u.useRef)(null),k=(0,u.useRef)(null),C=v??k,G=(0,u.useId)(),A=S?t("otp.reason_otp_destination_not_allowed"):e.lengthShown&&N?t("otp.phoneLengthError",{digits:me(N,t("otp.or"))}):"",_=p.length>1||W,F=de(r),V=(0,u.useMemo)(()=>{let m=null;try{m=new Intl.DisplayNames([r],{type:"region"})}catch{}return p.map(L=>({code:L.code,name:m?.of(L.code)??L.code}))},[p,r]),K=p.length>ye,R=[M?"":`${l}-dial ${l}-hint`,A?`${l}-error`:"",f??""].join(" ").trim()||void 0,g=n(m=>{H(!1),requestAnimationFrame(()=>(m==="lead"?B.current:C.current)?.focus())},"close"),$=n(()=>{if(I)return g("lead");H(!0),requestAnimationFrame(()=>(i.current??o.current?.querySelector('[aria-current="true"]')??o.current?.querySelector("button"))?.focus())},"toggle"),O=n(()=>(0,h.jsxs)("span",{className:"sekyro-phone__dial",id:`${l}-dial`,"aria-hidden":_||void 0,children:[(0,h.jsx)("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:b?"🌐":se(y.code)}),b?null:y.dial]}),"dial");return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("div",{className:`sekyro-phone${w?" sekyro-phone--compact":""}`,dir:"ltr",children:[y===null||M&&!b?null:_?(0,h.jsx)("button",{ref:B,type:"button",className:"sekyro-phone__lead sekyro-phone__pick","aria-label":`${t("otp.countryLabel")}: ${b?t("otp.otherCountry"):F(y)}`,"aria-expanded":I,"aria-controls":I?G:void 0,onClick:$,children:O()}):(0,h.jsx)("div",{className:"sekyro-phone__lead",children:O()}),(0,h.jsx)("input",{ref:C,id:l,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",required:E,"aria-describedby":R,"aria-invalid":!!A||P||void 0,placeholder:c?"+":void 0,value:M?d:Y(T,N),onChange:e.onNumber,onKeyDown:a(m=>{m.key==="Enter"&&D===!1&&e.setLengthShown(!0)},"onKeyDown"),onBlur:a(m=>{let L=m.relatedTarget;L!==null&&(B.current?.contains(L)||o.current?.contains(L))||e.setLengthShown(T!==""&&x===null)},"onBlur")})]}),I?(0,h.jsx)("div",{ref:o,id:G,className:"sekyro-phone__list",onKeyDown:a(m=>{m.key==="Escape"&&(m.preventDefault(),g("lead"))},"onKeyDown"),children:(0,h.jsx)(ae,{countries:V,label:(0,h.jsx)("span",{className:"sekyro-visually-hidden",children:t("otp.countrySearch")}),searchPlaceholder:t("otp.countrySearch"),noMatch:t("doc.noCountryMatch"),searchable:K,scroll:!0,...K?{searchRef:i}:{},...!b&&y!==null?{selected:y.code}:{},detail:a(m=>p.find(L=>L.code===m)?.dial,"detail"),onPick:a(m=>{e.onCountry(m),g("number")},"onPick"),...W?{extra:{label:t("otp.otherCountry"),current:b,onPick:n(()=>{e.onCountry(fe),g("number")},"onPick")}}:{}})}):null,M?null:(0,h.jsx)("span",{className:"sekyro-help",id:`${l}-hint`,children:t("otp.phonePlaceholderGeneric")}),A?(0,h.jsx)("span",{className:"sekyro-help is-danger",id:`${l}-error`,role:"alert",children:A}):null]})}a(Ne,"xe");n(Ne,"PhoneField");export{he as a,ae as b,se as c,ge as d,Ne as e};
|
|
1
|
+
import{a as X,b as z}from"./chunk-YUZW7NSK.js";import{a,c as Z,i as n}from"./chunk-SSU37LFQ.js";var u=Z(X(),1),J=Z(X(),1),s=Z(z(),1),h=Z(z(),1);import{normalizeNni as pe}from"@sekyro/web";var ue="AC247 AD376 AE971/0 AF93/0 AG1/1 AI1/1 AL355/0 AM374/0 AO244 AR54/0 AS1/1 AT43/0 AU61/0 AW297 AX358/0 AZ994/0 BA387/0 BB1/1 BD880/0 BE32/0 BF226 BG359/0 BH973 BI257 BJ229 BL590/0 BM1/1 BN673 BO591/0 BQ599 BR55/0 BS1/1 BT975 BW267 BY375/8 BZ501 CA1/1 CC61/0 CD243/0 CF236 CG242 CH41/0 CI225 CK682 CL56 CM237 CN86/0 CO57/0 CR506 CU53/0 CV238 CW599 CX61/0 CY357 CZ420 DE49/0 DJ253 DK45 DM1/1 DO1/1 DZ213/0 EC593/0 EE372 EG20/0 EH212/0 ER291/0 ES34 ET251/0 FI358/0 FJ679 FK500 FM691 FO298 FR33/0 GA241 GB44/0 GD1/1 GE995/0 GF594/0 GG44/0 GH233/0 GI350 GL299 GM220 GN224 GP590/0 GQ240 GR30 GT502 GU1/1 GW245 GY592 HK852 HN504 HR385/0 HT509 HU36/06 ID62/0 IE353/0 IL972/0 IM44/0 IN91/0 IO246 IQ964/0 IR98/0 IS354 IT39 JE44/0 JM1/1 JO962/0 JP81/0 KE254/0 KG996/0 KH855/0 KI686/0 KM269 KN1/1 KP850/0 KR82/0 KW965 KY1/1 KZ7/8 LA856/0 LB961/0 LC1/1 LI423/0 LK94/0 LR231/0 LS266 LT370/0 LU352 LV371 LY218/0 MA212/0 MC377/0 MD373/0 ME382/0 MF590/0 MG261/0 MH692/1 MK389/0 ML223 MM95/0 MN976/0 MO853 MP1/1 MQ596/0 MR222 MS1/1 MT356 MU230 MV960 MW265/0 MX52 MY60/0 MZ258 NA264/0 NC687 NE227 NF672 NG234/0 NI505 NL31/0 NO47 NP977/0 NR674 NU683 NZ64/0 OM968 PA507 PE51/0 PF689 PG675 PH63/0 PK92/0 PL48 PM508/0 PR1/1 PS970/0 PT351 PW680 PY595/0 QA974 RE262/0 RO40/0 RS381/0 RU7/8 RW250/0 SA966/0 SB677 SC248 SD249/0 SE46/0 SG65 SH290 SI386/0 SJ47 SK421/0 SL232/0 SM378 SN221 SO252/0 SR597 SS211/0 ST239 SV503 SX1/1 SY963/0 SZ268 TA290 TC1/1 TD235 TG228 TH66/0 TJ992 TK690 TL670 TM993/8 TN216 TO676 TR90/0 TT1/1 TV688 TW886/0 TZ255/0 UA380/0 UG256/0 US1/1 UY598/0 UZ998 VA39 VC1/1 VE58/0 VG1/1 VI1/1 VN84/0 VU678 WF681 WS685 XK383/0 YE967/0 YT262/0 ZA27/0 ZM260/0 ZW263/0",j;function Q(e){return j??(j=new Map(ue.split(" ").map(l=>{let[r,t]=l.slice(2).split("/");return[l.slice(0,2),[r,t]]}))),j.get(e.toUpperCase())}a(Q,"z");n(Q,"entryOf");function he(e){return Q(e)?.[0]}a(he,"Ne");n(he,"dialCodeOf");function re(e){return Q(e)?.[1]}a(re,"ee");n(re,"nationalPrefixOf");var ee=n(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold");function ne(e,l){let r=ee(l.trim());return r===""?e:e.filter(t=>ee(t.name).includes(r)||t.code.toLowerCase()===r)}a(ne,"ce");n(ne,"matchCountries");function ae({countries:e,label:l,searchPlaceholder:r,noMatch:t,onPick:v,selected:P,searchRef:f,scroll:E=!1,searchable:w=!0,detail:D,extra:y}){let[M,b]=(0,J.useState)(""),c=(0,J.useId)(),T=ne(e,M),N=(0,s.jsxs)("ul",{className:`sekyro-rows${E?" sekyro-rows--scroll":""}`,children:[T.map(d=>{let S=D?.(d.code);return(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"sekyro-row-btn","aria-current":P===d.code||void 0,onClick:a(()=>v(d.code),"onClick"),children:[(0,s.jsx)("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:se(d.code)}),(0,s.jsx)("span",{className:"sekyro-row-btn__name",children:d.name}),S!==void 0?(0,s.jsx)("bdi",{className:"sekyro-row-btn__detail",dir:"ltr",children:S}):null]})},d.code)}),y!==void 0?(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"sekyro-row-btn","aria-current":y.current||void 0,onClick:y.onPick,children:[(0,s.jsx)("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:"🌐"}),(0,s.jsx)("span",{className:"sekyro-row-btn__name",children:y.label})]})}):null]});return w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"sekyro-field",children:[(0,s.jsx)("label",{className:"sekyro-label",htmlFor:c,children:l}),(0,s.jsx)("input",{ref:f,id:c,type:"search",className:"sekyro-input",placeholder:r,value:M,onChange:a(d=>b(d.target.value),"onChange")})]}),T.length===0&&y===void 0?(0,s.jsx)("p",{className:"sekyro-text-muted",children:t}):N]}):N}a(ae,"te");n(ae,"CountryList");function U(e){let l=pe(e).replace(/\D/g,"");return/^\D*\+/.test(e)?`+${l}`:l.startsWith("00")?`+${l.slice(2)}`:l}a(U,"H");n(U,"digitsOf");var le=n((e,l)=>(l.trunk!==void 0&&e.startsWith(l.trunk)?e.slice(l.trunk.length):e).slice(0,Math.max(...l.lengths)),"fitDigits");function Y(e,l){let r="",t=0;for(let v of l?.formats?.find(P=>new RegExp(`^(?:${P.leading})`).test(e))?.groups??[])t<e.length&&(r+=(t>0?" ":"")+e.slice(t,t+v)),t+=v;return r+e.slice(t)}a(Y,"Z");n(Y,"groupDigits");function oe(e,l){let r=0;for(let t=l;t>0&&r<e.length;r+=1)e[r]!==" "&&(t-=1);return r}a(oe,"oe");n(oe,"caretAfter");var ie=n((e,l)=>l.find(r=>e.startsWith(r.dial)),"countryOfNumber"),me=n((e,l)=>e.lengths.join(", ").replace(/, (\d+)$/,` ${l} $1`),"lengthsLabel");function q(e){let l=U(e).replace("+","");return/^\d{8,15}$/.test(l)?`+${l}`:null}a(q,"le");n(q,"normalizedPhone");var se=n(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),l=>127397+l.charCodeAt(0))),"flagOf");function ce(e,l){if(l===null||!e.startsWith(l.dial))return q(e);let r=e.slice(l.dial.length).replace(/\D/g,""),t=re(l.code);return t!==void 0&&r.startsWith(t)&&(r=r.slice(t.length)),q(l.dial+r)}a(ce,"ye");n(ce,"e164Of");var te=n((e,l)=>(ie(e,l)??l[0])?.code??null,"countryFor");function de(e){let l=null;try{l=new Intl.DisplayNames([e],{type:"region"})}catch{}return r=>`${l?.of(r.code)??r.code} (${r.dial})`}a(de,"me");n(de,"countryLabels");var fe="other",ye=8;function ge({countries:e,international:l,closed:r,defaultPhone:t}){let[v,P]=(0,u.useState)(()=>te(t,e)),[f,E]=(0,u.useState)(t),[w,D]=(0,u.useState)(!1),[y,M]=(0,u.useState)(!1),b=e.map(o=>o.code).join(","),c=e.find(o=>o.code===v)??null,T=(0,u.useRef)(c);c!==null&&(T.current=c),(0,u.useEffect)(()=>{if(v===null||!e.some(o=>o.code===v)){let o=te(t,e);P(o);let i=T.current,k=e.find(C=>C.code===o)?.dial;k!==void 0&&E(C=>i!==null&&C.startsWith(i.dial)?k+C.slice(i.dial.length):C.startsWith("+")?C:k)}},[b,t]);let N=w||c===null,d=N||f.startsWith("+")&&!f.startsWith(c.dial),S=d?void 0:c.rule,x=d?f:f.replace(c.dial,"").replace(/\D/g,""),p=S?le(x,S):x,W=d&&!N&&!l&&r&&!e.some(o=>o.dial.startsWith(f)),I=W?null:S?S.lengths.includes(p.length)?c.dial+p:null:N&&!f.startsWith("+")?null:ce(f,w?null:c),H=d||c===null?I??f:`${c.dial} ${Y(p,S)}`,B=d?U(f).replace("+","")==="":p==="";return{countries:e,international:l,phone:f,selected:c,other:w,whole:d,free:N,rule:S,national:p,refused:W,typed:I,shown:H,empty:B,lengthShown:y,setLengthShown:M,onNumber:n(o=>{let i=o.target,k=o.nativeEvent.inputType,C=Math.max(0,i.value.lastIndexOf("+")),G=U(i.value.slice(C)),A=ie(G,e),_=U(i.value.slice(C,i.selectionStart)).length,F=G,V=G;if(M(!1),!A&&(N||G.startsWith("+")))l&&D(!0);else{let R=A??c,g=A?G.slice(A.dial.length):G;if(P(R.code),D(!1),g===p&&k?.startsWith("delete")&&(k.endsWith("Forward")||(_-=1),g=g.slice(0,_)+g.slice(_+1)),R.rule){let $=le(g,R.rule),O=g.length-$.length;_-=O,g=O>0&&!A&&p.length===$.length?p:$}V=R.dial+g,F=Y(g,R.rule)}E(V),i.value=F;let K=oe(F,_);i.setSelectionRange(K,K)},"onNumber"),onCountry:n(o=>{M(!1);let i=e.find(k=>k.code===o);D(i===void 0),i!==void 0&&P(i.code),E(i===void 0?"":i.dial+(d?"":p))},"onCountry")}}a(ge,"_e");n(ge,"usePhoneField");function Ne({field:e,id:l,locale:r,t,inputRef:v,invalid:P=!1,describedby:f,required:E,compact:w=!1,ready:D}){let{selected:y,whole:M,other:b,free:c,national:T,rule:N,phone:d,refused:S,typed:x,countries:p,international:W}=e,[I,H]=(0,u.useState)(!1),B=(0,u.useRef)(null),o=(0,u.useRef)(null),i=(0,u.useRef)(null),k=(0,u.useRef)(null),C=v??k,G=(0,u.useId)(),A=S?t("otp.reason_otp_destination_not_allowed"):e.lengthShown&&N?t("otp.phoneLengthError",{digits:me(N,t("otp.or"))}):"",_=p.length>1||W,F=de(r),V=(0,u.useMemo)(()=>{let m=null;try{m=new Intl.DisplayNames([r],{type:"region"})}catch{}return p.map(L=>({code:L.code,name:m?.of(L.code)??L.code}))},[p,r]),K=p.length>ye,R=[M?"":`${l}-dial ${l}-hint`,A?`${l}-error`:"",f??""].join(" ").trim()||void 0,g=n(m=>{H(!1),requestAnimationFrame(()=>(m==="lead"?B.current:C.current)?.focus())},"close"),$=n(()=>{if(I)return g("lead");H(!0),requestAnimationFrame(()=>(i.current??o.current?.querySelector('[aria-current="true"]')??o.current?.querySelector("button"))?.focus())},"toggle"),O=n(()=>(0,h.jsxs)("span",{className:"sekyro-phone__dial",id:`${l}-dial`,"aria-hidden":_||void 0,children:[(0,h.jsx)("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:b?"🌐":se(y.code)}),b?null:y.dial]}),"dial");return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("div",{className:`sekyro-phone${w?" sekyro-phone--compact":""}`,dir:"ltr",children:[y===null||M&&!b?null:_?(0,h.jsx)("button",{ref:B,type:"button",className:"sekyro-phone__lead sekyro-phone__pick","aria-label":`${t("otp.countryLabel")}: ${b?t("otp.otherCountry"):F(y)}`,"aria-expanded":I,"aria-controls":I?G:void 0,onClick:$,children:O()}):(0,h.jsx)("div",{className:"sekyro-phone__lead",children:O()}),(0,h.jsx)("input",{ref:C,id:l,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",required:E,"aria-describedby":R,"aria-invalid":!!A||P||void 0,placeholder:c?"+":void 0,value:M?d:Y(T,N),onChange:e.onNumber,onKeyDown:a(m=>{m.key==="Enter"&&D===!1&&e.setLengthShown(!0)},"onKeyDown"),onBlur:a(m=>{let L=m.relatedTarget;L!==null&&(B.current?.contains(L)||o.current?.contains(L))||e.setLengthShown(T!==""&&x===null)},"onBlur")})]}),I?(0,h.jsx)("div",{ref:o,id:G,className:"sekyro-phone__list",onKeyDown:a(m=>{m.key==="Escape"&&(m.preventDefault(),g("lead"))},"onKeyDown"),children:(0,h.jsx)(ae,{countries:V,label:(0,h.jsx)("span",{className:"sekyro-visually-hidden",children:t("otp.countrySearch")}),searchPlaceholder:t("otp.countrySearch"),noMatch:t("doc.noCountryMatch"),searchable:K,scroll:!0,...K?{searchRef:i}:{},...!b&&y!==null?{selected:y.code}:{},detail:a(m=>p.find(L=>L.code===m)?.dial,"detail"),onPick:a(m=>{e.onCountry(m),g("number")},"onPick"),...W?{extra:{label:t("otp.otherCountry"),current:b,onPick:n(()=>{e.onCountry(fe),g("number")},"onPick")}}:{}})}):null,M?null:(0,h.jsx)("span",{className:"sekyro-help",id:`${l}-hint`,children:t("otp.phonePlaceholderGeneric")}),A?(0,h.jsx)("span",{className:"sekyro-help is-danger",id:`${l}-error`,role:"alert",children:A}):null]})}a(Ne,"xe");n(Ne,"PhoneField");export{he as a,ae as b,se as c,ge as d,Ne as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as U}from"./chunk-
|
|
1
|
+
import{d as U}from"./chunk-AUISCZAL.js";import{F as C,J as H,a as Z,b as E,v as B}from"./chunk-YUZW7NSK.js";import{a as N,c as R,i as d}from"./chunk-SSU37LFQ.js";var y=R(Z(),1),s=R(E(),1);var b=72;function P(c,t){let r=c*.72,a=r*1.32;return{cx:c/2,cy:(t-a)/2.1+a/2,a:r/2,b:a/2}}N(P,"B");d(P,"faceOval");function z({cx:c,cy:t,a:r,b:a}){return Array.from({length:b},(S,M)=>{let m=-Math.PI/2+M/b*2*Math.PI,h=Math.cos(m),i=Math.sin(m),u=c+r*h,f=t+a*i,k=Math.hypot(a*h,r*i),p=a*h/k,$=r*i/k,o=d(v=>Math.round(v*10)/10,"r");return`M${o(u+p*16)} ${o(f+$*16)}L${o(u+p*28)} ${o(f+$*28)}`})}N(z,"E");d(z,"ticks");function F({video:c,instruction:t,note:r,status:a,busy:S,progress:M,still:m,overlay:h,ramp:i,onClose:u,closeLabel:f,end:k,live:p=!0,children:$,testId:o}){C(p);let v=(0,y.useRef)(null),[l,A]=(0,y.useState)({w:0,h:0});(0,y.useLayoutEffect)(()=>{let x=v.current;if(x===null)return;let I=d(()=>A({w:x.clientWidth,h:x.clientHeight}),"measure");if(I(),typeof ResizeObserver>"u")return;let L=new ResizeObserver(I);return L.observe(x),()=>L.disconnect()},[]);let e=P(l.w,l.h),g=l.w>0?z(e):[],w=Math.round(Math.min(1,Math.max(0,M))*b),j=e.cy-e.b,n=Math.max(e.a,e.b)+40,O=70*Math.PI/180;return(0,s.jsx)("section",{className:"sekyro-lm sekyro-fc","aria-label":t,"data-testid":o,"data-ramp":i?"":void 0,children:(0,s.jsxs)("div",{ref:v,className:"sekyro-lm-stage",children:[c,m?(0,s.jsx)("img",{className:"sekyro-lm-video sekyro-fc-still",src:m,alt:""}):null,h,(0,s.jsx)(U,{colour:i??null}),l.w>0?(0,s.jsxs)("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${l.w} ${l.h}`,"aria-hidden":"true",focusable:"false",children:[(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:"sekyro-fc-fade",gradientUnits:"userSpaceOnUse",x1:e.cx-n*Math.sin(O),y1:e.cy,x2:e.cx,y2:e.cy,children:[(0,s.jsx)("stop",{offset:"0",className:"sekyro-fc-fade",stopOpacity:"0"}),(0,s.jsx)("stop",{offset:"1",className:"sekyro-fc-fade"})]}),(0,s.jsx)("mask",{id:"sekyro-fc-light",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:l.w,height:l.h,children:(0,s.jsx)("path",{className:"sekyro-fc-sweep",style:{transformOrigin:`${e.cx}px ${e.cy}px`},d:`M${e.cx} ${e.cy}L${e.cx-n*Math.sin(O)} ${e.cy-n*Math.cos(O)}A${n} ${n} 0 0 1 ${e.cx} ${e.cy-n}Z`,fill:"url(#sekyro-fc-fade)"})})]}),(0,s.jsx)("path",{className:"sekyro-fc-scrim",fillRule:"evenodd",d:`M0 0H${l.w}V${l.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`}),(0,s.jsx)("ellipse",{className:"sekyro-fc-rim",cx:e.cx,cy:e.cy,rx:e.a,ry:e.b}),(0,s.jsx)("path",{className:"sekyro-fc-ticks",d:g.join("")}),w>0?(0,s.jsx)("path",{className:"sekyro-fc-ticks is-done",d:g.slice(0,w).join("")}):null,w<b?(0,s.jsx)("path",{className:"sekyro-fc-ticks is-light",d:g.join(""),mask:"url(#sekyro-fc-light)"}):null]}):null,(0,s.jsx)("div",{className:"sekyro-lm-instruction sekyro-fc-instruction",style:{insetBlockStart:j-80},children:(0,s.jsx)("div",{role:"status","aria-live":"polite",children:(0,s.jsx)(H,{swapKey:t,className:"sekyro-lm-line",children:t})})}),a!==void 0?(0,s.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-camera-status",children:a??""}):null,r?(0,s.jsxs)("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:j+2*e.b+48},children:[S?(0,s.jsx)("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}):null,(0,s.jsx)("span",{children:r})]}):null,(0,s.jsxs)("div",{className:"sekyro-lm-controls",children:[(0,s.jsxs)("div",{className:"sekyro-lm-bar",children:[u!==void 0?(0,s.jsx)("button",{type:"button",className:"sekyro-glass","aria-label":f,onClick:u,children:(0,s.jsx)(B,{name:"close"})}):null,k]}),$]})]})})}N(F,"T");d(F,"FaceCamera");export{F as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as H}from"./chunk-6FAODASF.js";import{a as T,b as C,c as D}from"./chunk-57MVUXQ6.js";import{a as s,b as L,c as N,i as u}from"./chunk-SSU37LFQ.js";var V=L(l=>{"use strict";var Q=T();function I(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}s(I,"formatProdErrorMessage");function h(){}s(h,"noop");var c={d:{f:h,r:s(function(){throw Error(I(522))},"r"),D:h,C:h,L:h,m:h,X:h,S:h,M:h},p:0,findDOMNode:null},ee=Symbol.for("react.portal");function re(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ee,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}s(re,"createPortal$1");var O=Q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function M(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}s(M,"getCrossOriginStringAs");l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c;l.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(I(299));return re(r,e,null,t)};l.flushSync=function(r){var e=O.T,t=c.p;try{if(O.T=null,c.p=2,r)return r()}finally{O.T=e,c.p=t,c.d.f()}};l.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,c.d.C(r,e))};l.prefetchDNS=function(r){typeof r=="string"&&c.d.D(r)};l.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin),o=typeof e.integrity=="string"?e.integrity:void 0,i=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?c.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:o,fetchPriority:i}):t==="script"&&c.d.X(r,{crossOrigin:n,integrity:o,fetchPriority:i,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};l.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=M(e.as,e.crossOrigin);c.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&c.d.M(r)};l.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin);c.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};l.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=M(e.as,e.crossOrigin);c.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else c.d.m(r)};l.requestFormReset=function(r){c.d.r(r)};l.unstable_batchedUpdates=function(r,e){return r(e)};l.useFormState=function(r,e,t){return O.H.useFormState(r,e,t)};l.useFormStatus=function(){return O.H.useHostTransitionStatus()};l.version="19.2.0"});var B=L((de,U)=>{"use strict";function j(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j)}catch(r){console.error(r)}}s(j,"checkDCE");j(),U.exports=V()});var W=N(T(),1),f=N(C(),1),a=N(C(),1),E=N(T(),1),Z=N(B(),1),v=N(C(),1);import{screenRampColourValue as Y}from"@sekyro/web";var te=Array.from({length:56},(r,e)=>{let t=e/56*2*Math.PI-Math.PI/2,n=Math.cos(t),o=Math.sin(t);return{id:`tick-${e}`,frac:e/55,x1:150+108*n,y1:150+108*o,x2:150+138*n,y2:150+138*o,style:{transitionDelay:`${e*6}ms`}}});function z(r,e,t,n){return t?"var(--sekyro-color-success)":r?n?"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)"}s(z,"T");u(z,"tickColor");var ae="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function F({progress:r,phase:e,draining:t=!1}){let n=Math.min(1,Math.max(0,r)),o=Math.round(n*56),i=e==="checking",y=e==="recording",d=e==="frozen",m=i||d,p=i||y||d,k=e==="locked"||p,S=t&&!k;return(0,f.jsxs)("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":o,"data-recording":y?"":void 0,"data-draining":S?"":void 0,children:[(0,f.jsx)("path",{fillRule:"evenodd",d:ae,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":m?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),(0,f.jsxs)("g",{className:e==="locked"?"sekyro-capture-settle":void 0,children:[(0,f.jsx)("g",{className:m?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:te.map((g,x)=>(0,f.jsx)("line",{x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,stroke:z(x<o,g.frac,k,S),strokeWidth:3,strokeLinecap:"round",style:g.style,className:"sekyro-arc__tick"},g.id))}),(0,f.jsx)("g",{className:e==="seeking"?"sekyro-capture-breathe":void 0,children:(0,f.jsx)("circle",{cx:150,cy:150,r:100,fill:"none",stroke:k?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:k?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"})})]})]})}s(F,"x");u(F,"CaptureArc");function ne({videoRef:r,guidanceText:e,guidanceHint:t,guidanceKey:n,progress:o,phase:i,draining:y=!1,stillUrl:d,showChecking:m,operatorText:p=null,voicePrompt:k,overlay:S,reduceMotion:g=!1,modeSwitch:x=null}){let b=H(),R=i==="checking",_=R||i==="frozen",A=_&&m?b("capture.checking"):e,w=k?.(t,A,n);return(0,a.jsxs)("div",{className:g?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[(0,a.jsx)("video",{ref:r,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),d!==null&&_?(0,a.jsx)("img",{src:d,alt:b("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,(0,a.jsx)(F,{progress:o,phase:i,draining:y}),S?.(r),w!=null&&!_?(0,a.jsx)("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:w}):null,x!==null&&!_?(0,a.jsx)(G,{view:x,className:"sekyro-stage__corner-end sekyro-stage__mode-switch",kind:"chip"}):null,R&&m?(0,a.jsxs)("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[(0,a.jsx)(K,{}),b("capture.cameraOff")]}):null,(0,a.jsxs)("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[(0,a.jsx)("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:A},A),_&&m?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint",children:b("capture.checkingHint")}):p!==null&&!_?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint","data-testid":"sekyro-operator-line",children:p}):null]})]})}s(ne,"ne");u(ne,"CaptureStage");function G({view:r,className:e,kind:t}){let n=(0,W.useId)(),o=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)($,{}),(0,a.jsx)("span",{children:r.label})]}),i={onClick:r.onSwitch,"aria-describedby":n,"data-testid":"sekyro-capture-mode-switch","data-mode":r.to};return(0,a.jsxs)(a.Fragment,{children:[t==="chip"?(0,a.jsx)(D,{kind:"chip",className:e,...i,children:o}):(0,a.jsx)("button",{type:"button",className:e,...i,children:o}),(0,a.jsx)("span",{id:n,className:"sekyro-visually-hidden",children:r.description})]})}s(G,"H");u(G,"ModeSwitchChip");function $(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[(0,a.jsx)("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"}),(0,a.jsx)("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),(0,a.jsx)("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}s($,"D");u($,"FlipCameraIcon");function K(){return(0,a.jsxs)("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:[(0,a.jsx)("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"}),(0,a.jsx)("path",{d:"M3 3l18 18"})]})}s(K,"G");u(K,"CameraOffIcon");var ie=typeof window>"u"?E.useEffect:E.useLayoutEffect,P="data-sekyro-ramp",se=[["background-color","transparent"],["background-image","none"]];function q(r){let e=[],t=r.ownerDocument;for(let i=r;i!==null&&i!==t.documentElement;i=i.parentElement){if(!(i instanceof HTMLElement)&&!(i instanceof SVGElement))continue;let y=i.style;for(let[d,m]of se){let p=y.getPropertyValue(d),k=y.getPropertyPriority(d);y.setProperty(d,m,"important"),e.push(()=>{p===""?y.removeProperty(d):y.setProperty(d,p,k)})}}let n=t.documentElement,o=n.hasAttribute(P);return n.setAttribute(P,""),o||e.push(()=>n.removeAttribute(P)),()=>{for(let i of e.reverse())i()}}s(q,"z");u(q,"clearAncestorBackdrops");function X(r){return{position:"fixed",inset:0,minWidth:"100vw",minHeight:"100lvh",margin:0,padding:0,border:0,zIndex:-1,pointerEvents:"none",backgroundColor:Y(r)}}s(X,"B");u(X,"washStyle");function J(r){return{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:Y(r)}}s(J,"Y");u(J,"coverStyle");function oe({colour:r}){let e=(0,E.useRef)(null),t=r!==null;return ie(()=>{let n=e.current?.parentElement;if(!(!t||n===null||n===void 0))return q(n)},[t]),r===null||typeof document>"u"?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{ref:e,"aria-hidden":"true","data-testid":"sekyro-screen-ramp-cover","data-colour":r,style:J(r)}),(0,Z.createPortal)((0,v.jsx)("div",{"aria-hidden":"true","data-testid":"sekyro-screen-ramp","data-colour":r,style:X(r)}),document.body)]})}s(oe,"de");u(oe,"ScreenRampLayer");export{B as a,ne as b,G as c,oe as d};
|
|
1
|
+
import{d as H}from"./chunk-V4USJ5ZA.js";import{a as T,b as C,c as D}from"./chunk-YUZW7NSK.js";import{a as s,b as L,c as N,i as u}from"./chunk-SSU37LFQ.js";var V=L(l=>{"use strict";var Q=T();function I(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}s(I,"formatProdErrorMessage");function h(){}s(h,"noop");var c={d:{f:h,r:s(function(){throw Error(I(522))},"r"),D:h,C:h,L:h,m:h,X:h,S:h,M:h},p:0,findDOMNode:null},ee=Symbol.for("react.portal");function re(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ee,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}s(re,"createPortal$1");var O=Q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function M(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}s(M,"getCrossOriginStringAs");l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c;l.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(I(299));return re(r,e,null,t)};l.flushSync=function(r){var e=O.T,t=c.p;try{if(O.T=null,c.p=2,r)return r()}finally{O.T=e,c.p=t,c.d.f()}};l.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,c.d.C(r,e))};l.prefetchDNS=function(r){typeof r=="string"&&c.d.D(r)};l.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin),o=typeof e.integrity=="string"?e.integrity:void 0,i=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?c.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:o,fetchPriority:i}):t==="script"&&c.d.X(r,{crossOrigin:n,integrity:o,fetchPriority:i,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};l.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=M(e.as,e.crossOrigin);c.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&c.d.M(r)};l.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin);c.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};l.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=M(e.as,e.crossOrigin);c.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else c.d.m(r)};l.requestFormReset=function(r){c.d.r(r)};l.unstable_batchedUpdates=function(r,e){return r(e)};l.useFormState=function(r,e,t){return O.H.useFormState(r,e,t)};l.useFormStatus=function(){return O.H.useHostTransitionStatus()};l.version="19.2.0"});var B=L((de,U)=>{"use strict";function j(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j)}catch(r){console.error(r)}}s(j,"checkDCE");j(),U.exports=V()});var W=N(T(),1),f=N(C(),1),a=N(C(),1),E=N(T(),1),Z=N(B(),1),v=N(C(),1);import{screenRampColourValue as Y}from"@sekyro/web";var te=Array.from({length:56},(r,e)=>{let t=e/56*2*Math.PI-Math.PI/2,n=Math.cos(t),o=Math.sin(t);return{id:`tick-${e}`,frac:e/55,x1:150+108*n,y1:150+108*o,x2:150+138*n,y2:150+138*o,style:{transitionDelay:`${e*6}ms`}}});function z(r,e,t,n){return t?"var(--sekyro-color-success)":r?n?"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)"}s(z,"T");u(z,"tickColor");var ae="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function F({progress:r,phase:e,draining:t=!1}){let n=Math.min(1,Math.max(0,r)),o=Math.round(n*56),i=e==="checking",y=e==="recording",d=e==="frozen",m=i||d,p=i||y||d,k=e==="locked"||p,S=t&&!k;return(0,f.jsxs)("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":o,"data-recording":y?"":void 0,"data-draining":S?"":void 0,children:[(0,f.jsx)("path",{fillRule:"evenodd",d:ae,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":m?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),(0,f.jsxs)("g",{className:e==="locked"?"sekyro-capture-settle":void 0,children:[(0,f.jsx)("g",{className:m?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:te.map((g,x)=>(0,f.jsx)("line",{x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,stroke:z(x<o,g.frac,k,S),strokeWidth:3,strokeLinecap:"round",style:g.style,className:"sekyro-arc__tick"},g.id))}),(0,f.jsx)("g",{className:e==="seeking"?"sekyro-capture-breathe":void 0,children:(0,f.jsx)("circle",{cx:150,cy:150,r:100,fill:"none",stroke:k?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:k?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"})})]})]})}s(F,"x");u(F,"CaptureArc");function ne({videoRef:r,guidanceText:e,guidanceHint:t,guidanceKey:n,progress:o,phase:i,draining:y=!1,stillUrl:d,showChecking:m,operatorText:p=null,voicePrompt:k,overlay:S,reduceMotion:g=!1,modeSwitch:x=null}){let b=H(),R=i==="checking",_=R||i==="frozen",A=_&&m?b("capture.checking"):e,w=k?.(t,A,n);return(0,a.jsxs)("div",{className:g?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[(0,a.jsx)("video",{ref:r,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),d!==null&&_?(0,a.jsx)("img",{src:d,alt:b("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,(0,a.jsx)(F,{progress:o,phase:i,draining:y}),S?.(r),w!=null&&!_?(0,a.jsx)("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:w}):null,x!==null&&!_?(0,a.jsx)(G,{view:x,className:"sekyro-stage__corner-end sekyro-stage__mode-switch",kind:"chip"}):null,R&&m?(0,a.jsxs)("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[(0,a.jsx)(K,{}),b("capture.cameraOff")]}):null,(0,a.jsxs)("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[(0,a.jsx)("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:A},A),_&&m?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint",children:b("capture.checkingHint")}):p!==null&&!_?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint","data-testid":"sekyro-operator-line",children:p}):null]})]})}s(ne,"ne");u(ne,"CaptureStage");function G({view:r,className:e,kind:t}){let n=(0,W.useId)(),o=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)($,{}),(0,a.jsx)("span",{children:r.label})]}),i={onClick:r.onSwitch,"aria-describedby":n,"data-testid":"sekyro-capture-mode-switch","data-mode":r.to};return(0,a.jsxs)(a.Fragment,{children:[t==="chip"?(0,a.jsx)(D,{kind:"chip",className:e,...i,children:o}):(0,a.jsx)("button",{type:"button",className:e,...i,children:o}),(0,a.jsx)("span",{id:n,className:"sekyro-visually-hidden",children:r.description})]})}s(G,"H");u(G,"ModeSwitchChip");function $(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[(0,a.jsx)("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"}),(0,a.jsx)("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),(0,a.jsx)("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}s($,"D");u($,"FlipCameraIcon");function K(){return(0,a.jsxs)("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:[(0,a.jsx)("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"}),(0,a.jsx)("path",{d:"M3 3l18 18"})]})}s(K,"G");u(K,"CameraOffIcon");var ie=typeof window>"u"?E.useEffect:E.useLayoutEffect,P="data-sekyro-ramp",se=[["background-color","transparent"],["background-image","none"]];function q(r){let e=[],t=r.ownerDocument;for(let i=r;i!==null&&i!==t.documentElement;i=i.parentElement){if(!(i instanceof HTMLElement)&&!(i instanceof SVGElement))continue;let y=i.style;for(let[d,m]of se){let p=y.getPropertyValue(d),k=y.getPropertyPriority(d);y.setProperty(d,m,"important"),e.push(()=>{p===""?y.removeProperty(d):y.setProperty(d,p,k)})}}let n=t.documentElement,o=n.hasAttribute(P);return n.setAttribute(P,""),o||e.push(()=>n.removeAttribute(P)),()=>{for(let i of e.reverse())i()}}s(q,"z");u(q,"clearAncestorBackdrops");function X(r){return{position:"fixed",inset:0,minWidth:"100vw",minHeight:"100lvh",margin:0,padding:0,border:0,zIndex:-1,pointerEvents:"none",backgroundColor:Y(r)}}s(X,"B");u(X,"washStyle");function J(r){return{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:Y(r)}}s(J,"Y");u(J,"coverStyle");function oe({colour:r}){let e=(0,E.useRef)(null),t=r!==null;return ie(()=>{let n=e.current?.parentElement;if(!(!t||n===null||n===void 0))return q(n)},[t]),r===null||typeof document>"u"?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{ref:e,"aria-hidden":"true","data-testid":"sekyro-screen-ramp-cover","data-colour":r,style:J(r)}),(0,Z.createPortal)((0,v.jsx)("div",{"aria-hidden":"true","data-testid":"sekyro-screen-ramp","data-colour":r,style:X(r)}),document.body)]})}s(oe,"de");u(oe,"ScreenRampLayer");export{B as a,ne as b,G as c,oe as d};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
react-dom/cjs/react-dom.production.js:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b}from"./chunk-
|
|
1
|
+
import{a as v,b}from"./chunk-YUZW7NSK.js";import{a,c as p,i as d}from"./chunk-SSU37LFQ.js";var r=p(v(),1),o=p(b(),1),m=p(v(),1);import{normalizeNni as C}from"@sekyro/web";function w(t,e,i){let[n,c]=(0,r.useState)(!1),s=(0,r.useRef)(i);return s.current=i,(0,r.useEffect)(()=>{t&&(c(!0),s.current())},[t,e]),[n,()=>c(!1)]}a(w,"I");d(w,"useWrongCode");function x({id:t,value:e,onChange:i,length:n=6,describedBy:c,invalid:s}){let[y,f]=(0,r.useState)(!1),[h,k]=(0,r.useState)(0);(0,r.useEffect)(()=>{s&&k(l=>l+1)},[s]);let g=(0,r.useRef)(null);(0,r.useEffect)(()=>{let l=setTimeout(()=>g.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(l)},[]);let N=e.length<n?e.length:-1;return(0,o.jsxs)("div",{className:"sekyro-otp-boxes",dir:"ltr",children:[(0,o.jsx)("div",{className:`sekyro-otp-row${h>0?" is-shaking":""}`,"aria-hidden":"true",children:Array.from({length:n},(l,u)=>(0,o.jsx)("span",{className:`sekyro-otp-box${u<e.length?" is-filled":""}${y&&u===N?" is-current":""}${s?" is-invalid":""}`,children:e[u]!==void 0?(0,o.jsx)("span",{className:"sekyro-otp-digit",children:e[u]},e[u]):null},u))},h),(0,o.jsx)("input",{ref:g,id:t,className:"sekyro-input sekyro-input--code",dir:"ltr",inputMode:"numeric",autoComplete:"one-time-code",value:e,"aria-describedby":c,"aria-invalid":s||void 0,onFocus:a(()=>f(!0),"onFocus"),onBlur:a(()=>f(!1),"onBlur"),onChange:a(l=>i(C(l.target.value).replace(/\D/g,"").slice(0,n)),"onChange")})]})}a(x,"S");d(x,"CodeInput");function I(t){let[e,i]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!t)return;let n=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(n)},[t]),e}a(I,"B");d(I,"useNow");export{w as a,x as b,I as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
1
|
+
import{a as d}from"./chunk-YUZW7NSK.js";import{a as i,c as r,i as t}from"./chunk-SSU37LFQ.js";var s=r(d(),1);var u=(0,s.createContext)(null);function c(a,n,o){let e=n.detail;return{check:a,kind:n.kind,...e?.name!==void 0?{name:e.name}:{},...e?.phase!==void 0?{phase:e.phase}:{},...e?.engineKind!==void 0?{engineKind:e.engineKind}:{},attempt:Math.max(0,Math.min(1e3,o))}}i(c,"a");t(c,"captureIssueOf");function m(a,n){if(a!==void 0)try{a(n)}catch{}}i(m,"o");t(m,"sendCaptureIssue");export{u as a,c as b,m as c};
|