@sekyro/elements 0.1.0-rc.15 → 0.1.0-rc.17
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 +19 -0
- package/dist/cdn/chunks/{camera-trait-V4UAOPIQ-TFCPOCSU.js → camera-trait-DELAK3YN-4I2GHAFU.js} +1 -1
- package/dist/cdn/chunks/{capture-session-doc-KAKQJPCO-AIHWPBYL.js → capture-session-doc-MGDYUASI-LYQ23KS6.js} +1 -1
- package/dist/cdn/chunks/{chunk-OGJRFKPJ.js → chunk-2MJOW3FG.js} +1 -1
- package/dist/cdn/chunks/chunk-2TFK736S.js +1 -0
- package/dist/cdn/chunks/{chunk-2YPWGFSK.js → chunk-3APQX7OW.js} +1 -1
- package/dist/cdn/chunks/{chunk-QXCB7CMC.js → chunk-3DAULGZ2.js} +1 -1
- package/dist/cdn/chunks/chunk-3S7YMUPU.js +1 -0
- package/dist/cdn/chunks/chunk-4RGDPCRE.js +33 -0
- package/dist/cdn/chunks/chunk-6L4TYBV7.js +1 -0
- package/dist/cdn/chunks/chunk-6TIQ2463.js +1 -0
- package/dist/cdn/chunks/chunk-BDRBGJA3.js +3 -0
- package/dist/cdn/chunks/{chunk-BSMEALQQ.js → chunk-BR5RW4XZ.js} +1 -1
- package/dist/cdn/chunks/{chunk-BLN4F6B2.js → chunk-DCTDTKG7.js} +1 -1
- package/dist/cdn/chunks/{chunk-SI3OCSQL.js → chunk-DHMC5D6M.js} +1 -1
- package/dist/cdn/chunks/{chunk-LVBGPPKD.js → chunk-E5JQU363.js} +1 -1
- package/dist/cdn/chunks/chunk-E5YZMFCZ.js +1 -0
- package/dist/cdn/chunks/{chunk-HOUFBXEP.js → chunk-HM65LKWB.js} +1 -1
- package/dist/cdn/chunks/{chunk-Z25MPNSU.js → chunk-IGZCP7OY.js} +1 -1
- package/dist/cdn/chunks/chunk-NPTVQXUW.js +1 -0
- package/dist/cdn/chunks/chunk-PND4F7JQ.js +1 -0
- package/dist/cdn/chunks/{chunk-3SVGT2PS.js → chunk-PRMQUJTM.js} +1 -1
- package/dist/cdn/chunks/chunk-Q7ACZDU4.js +1 -0
- package/dist/cdn/chunks/{chunk-OCMUHHDC.js → chunk-QR7XWTXK.js} +1 -1
- package/dist/cdn/chunks/chunk-RPMVDYDV.js +1 -0
- package/dist/cdn/chunks/{chunk-CAEMCBEY.js → chunk-SI6GIBVC.js} +1 -1
- package/dist/cdn/chunks/chunk-SLLJX5QK.js +1 -0
- package/dist/cdn/chunks/{chunk-TWWD2WAW.js → chunk-Z5QOJL3W.js} +1 -1
- package/dist/cdn/chunks/{chunk-E75YC36S.js → chunk-Z6KNLRUW.js} +1 -1
- package/dist/cdn/chunks/create-document-capture-KISF6XD3-R6PFAJU6.js +1 -0
- package/dist/cdn/chunks/{detector-scanic-GGIKCF6B-OP62MOM6.js → detector-scanic-JC25DD3A-YZ3NPKMQ.js} +1 -1
- package/dist/cdn/chunks/document-capture-view-7ZSM7YTT-UHYBVOQI.js +1 -0
- package/dist/cdn/chunks/eid-view-ZM7QAEME-DIL3UVBB.js +1 -0
- package/dist/cdn/chunks/email-otp-view-EYS26ZZM-UNGUBHFI.js +1 -0
- package/dist/cdn/chunks/flow-views-7SAYQQ62-2TENAJ6C.js +1 -0
- package/dist/cdn/chunks/form-view-Y5KA6R5T-KUDCNJNS.js +1 -0
- package/dist/cdn/chunks/overlay-de-4OISTBDL-WWT74VG7.js +1 -0
- package/dist/cdn/chunks/overlay-es-YO5UCAO2-U3OAELIS.js +1 -0
- package/dist/cdn/chunks/overlay-pt-E7PSFLLQ-ZPN4CLS4.js +1 -0
- package/dist/cdn/chunks/plan-runner-NWK4LZFI-CDXUYVEW.js +1 -0
- package/dist/cdn/chunks/portrait-capture-view-E5LKQQ5Y-3HNPCMBJ.js +1 -0
- package/dist/cdn/chunks/{portrait-review-view-WGI5PXWF-ZJH3G4DR.js → portrait-review-view-NJHH2E4W-B3RFT2PG.js} +1 -1
- package/dist/cdn/chunks/print-DCYX3CZD-DLQCPZZE.js +11 -0
- package/dist/cdn/chunks/{proof-of-address-view-CFVHB2XR-3RJQNRNW.js → proof-of-address-view-LS3JZUTD-MDTXER25.js} +1 -1
- package/dist/cdn/define.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunk-2EMXU2MG.js +33 -0
- package/dist/{chunk-YEY23NFE.js → chunk-2WYXQYNY.js} +1 -1
- package/dist/{chunk-YYQZMOGI.js → chunk-5NSMKCTW.js} +1 -1
- package/dist/{chunk-QESP3Y4J.js → chunk-6NNMOFMF.js} +1 -1
- package/dist/{chunk-BLT5ZVGV.js → chunk-734Y6RUV.js} +1 -1
- package/dist/{chunk-4LFDPSOL.js → chunk-AJHRPKD4.js} +1 -1
- package/dist/{chunk-DGVIPMH7.js → chunk-D3TZZ4SI.js} +1 -1
- package/dist/{chunk-L2D3XWI2.js → chunk-ICJ544T4.js} +1 -1
- package/dist/{chunk-JLKISVND.js → chunk-MWTOWGEI.js} +1 -1
- package/dist/{chunk-DZ64G3BB.js → chunk-VJZANYM3.js} +1 -1
- package/dist/{chunk-M6FHHGY7.js → chunk-WLCS5VAA.js} +1 -1
- package/dist/chunk-XI37ATRU.js +1 -0
- package/dist/{chunk-H2EODYM3.js → chunk-YVGOUZ7T.js} +1 -1
- package/dist/{chunk-PDYEWDSG.js → chunk-ZUFN5VIE.js} +1 -1
- package/dist/define.cjs +5 -5
- package/dist/define.js +1 -1
- package/dist/document-capture-view-7ZSM7YTT-GLHWVI3B.js +1 -0
- package/dist/{eid-view-PWROMDEV-5AMVHINZ.js → eid-view-ZM7QAEME-7FRC3TV6.js} +1 -1
- package/dist/{email-otp-view-Q334LLOM-WWVHZUZ3.js → email-otp-view-EYS26ZZM-EESWRHKM.js} +1 -1
- package/dist/{flow-views-I3YI3NWV-5FHNXBHD.js → flow-views-7SAYQQ62-3NIWXTDB.js} +1 -1
- package/dist/{form-view-XPOGTYL6-NGLOEF3Y.js → form-view-Y5KA6R5T-DOZFYGBK.js} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/overlay-de-4OISTBDL-TH46LT3S.js +1 -0
- package/dist/overlay-es-YO5UCAO2-NBICE576.js +1 -0
- package/dist/overlay-pt-E7PSFLLQ-NCA5NABT.js +1 -0
- package/dist/{portrait-capture-view-G4BE6IVC-5UKZX7HH.js → portrait-capture-view-E5LKQQ5Y-E3BRULLL.js} +1 -1
- package/dist/{portrait-review-view-WGI5PXWF-PITOWYGV.js → portrait-review-view-NJHH2E4W-CKMVD7ME.js} +1 -1
- package/dist/{proof-of-address-view-CFVHB2XR-Y6DJUU4V.js → proof-of-address-view-LS3JZUTD-ZQ4BDFNP.js} +1 -1
- package/dist/styles.css +9 -1
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/cdn/chunks/chunk-2QSUUXLJ.js +0 -1
- package/dist/cdn/chunks/chunk-3NOBU7TE.js +0 -1
- package/dist/cdn/chunks/chunk-I7TF57NI.js +0 -33
- package/dist/cdn/chunks/chunk-IEZ4K3YX.js +0 -1
- package/dist/cdn/chunks/chunk-JDVZXXYF.js +0 -1
- package/dist/cdn/chunks/chunk-KVTY4E6J.js +0 -1
- package/dist/cdn/chunks/chunk-NLTAFWIN.js +0 -1
- package/dist/cdn/chunks/chunk-PJT5EI2V.js +0 -1
- package/dist/cdn/chunks/chunk-QWPURAKS.js +0 -1
- package/dist/cdn/chunks/chunk-TT57CQGK.js +0 -3
- package/dist/cdn/chunks/chunk-ZEUFK4EC.js +0 -1
- package/dist/cdn/chunks/create-document-capture-AITCB4ZU-QA2Z7I3D.js +0 -1
- package/dist/cdn/chunks/document-capture-view-FSMO25KF-2Q3A6GDQ.js +0 -1
- package/dist/cdn/chunks/eid-view-PWROMDEV-NH4432Y2.js +0 -1
- package/dist/cdn/chunks/email-otp-view-Q334LLOM-RYZD4GMU.js +0 -1
- package/dist/cdn/chunks/flow-views-I3YI3NWV-ENMBLDRD.js +0 -1
- package/dist/cdn/chunks/form-view-XPOGTYL6-R34DVU6J.js +0 -1
- package/dist/cdn/chunks/overlay-de-VMGXTY3V-VVLXUOLW.js +0 -1
- package/dist/cdn/chunks/overlay-es-45YNJBVM-RHH5Z6UY.js +0 -1
- package/dist/cdn/chunks/overlay-pt-EU4FBZ2U-OHSSK5RZ.js +0 -1
- package/dist/cdn/chunks/plan-runner-HPXZHAQB-N2UJCZUV.js +0 -1
- package/dist/cdn/chunks/portrait-capture-view-G4BE6IVC-73TWN235.js +0 -1
- package/dist/cdn/chunks/print-SEWS3VHQ-HWJTHADG.js +0 -11
- package/dist/chunk-73RGTE4Z.js +0 -1
- package/dist/chunk-AXDGT3L2.js +0 -33
- package/dist/document-capture-view-FSMO25KF-FFRQD2FZ.js +0 -1
- package/dist/overlay-de-VMGXTY3V-3AGJDOK3.js +0 -1
- package/dist/overlay-es-45YNJBVM-WHWUGDQ6.js +0 -1
- package/dist/overlay-pt-EU4FBZ2U-F34MGCNE.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @sekyro/elements
|
|
2
2
|
|
|
3
|
+
## 0.1.0-rc.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
8
|
+
- Updated dependencies [7528fca]
|
|
9
|
+
- Updated dependencies [451cd78]
|
|
10
|
+
- Updated dependencies [4743339]
|
|
11
|
+
- Updated dependencies [ae5142b]
|
|
12
|
+
- @sekyro/web@0.1.0-rc.38
|
|
13
|
+
|
|
14
|
+
## 0.1.0-rc.16
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
19
|
+
- Updated dependencies [8bbc6f8]
|
|
20
|
+
- @sekyro/web@0.1.0-rc.36
|
|
21
|
+
|
|
3
22
|
## 0.1.0-rc.15
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/cdn/chunks/{camera-trait-V4UAOPIQ-TFCPOCSU.js → camera-trait-DELAK3YN-4I2GHAFU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b as e,c as r,d as o}from"./chunk-
|
|
1
|
+
import{a,b as e,c as r,d as o}from"./chunk-PND4F7JQ.js";import"./chunk-4FHWXBOB.js";export{a as bounded,r as cameraHash,e as hex16,o as noteCameraTrait};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,d as s,e as o,f as r,g as _,h as t,i as A,j as C,k as D,l as p,m as i}from"./chunk-
|
|
1
|
+
import{c as a,d as s,e as o,f as r,g as _,h as t,i as A,j as C,k as D,l as p,m as i}from"./chunk-6L4TYBV7.js";import"./chunk-IGZCP7OY.js";import"./chunk-2TFK736S.js";import"./chunk-3S7YMUPU.js";import"./chunk-L22GFJQV.js";import"./chunk-RPMVDYDV.js";import"./chunk-P7K7ELYZ.js";import"./chunk-JS2IXPNL.js";import"./chunk-4FHWXBOB.js";export{i as CAPTURE_CANDIDATE_SPACING_MS,p as CAPTURE_EXTRA_CANDIDATES,C as CaptureSessionDoc,o as DOC_BLACK_FRAME_LUMA,r as DOC_BLACK_FRAME_TICKS,_ as DOC_CADENCE_HZ,s as DOC_FIRST_FRAME_MS,t as DOC_SHUTTER_DEFAULTS,D as passportBandOf,A as resolveDocShutterTuning,a as warmDocDetector};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as v}from"./chunk-
|
|
1
|
+
import{d as v}from"./chunk-BDRBGJA3.js";import{a as y,b as C}from"./chunk-Z6KNLRUW.js";import{a as d}from"./chunk-5QL6W6FW.js";import{a,c as p}from"./chunk-4FHWXBOB.js";var r=p(y(),1),o=p(C(),1),m=p(y(),1);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[k,f]=(0,r.useState)(!1),[h,N]=(0,r.useState)(0);(0,r.useEffect)(()=>{s&&N(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 b=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":""}${k&&u===b?" 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(v(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-4FHWXBOB.js";var z=Object.freeze({minLines:4,fillMin:.55,fillMax:.98,offsetMax:.12,steadyFillDelta:.04,steadyOffsetDelta:.03,layoutShiftMax:.025,lineCountDelta:1,lockMs:600,steadyMs:900,minFrames:3});function P(h,t){let e=h.lineBoxes;if(e.length===0)return{lineCount:0,detected:!1,fill:0,offsetX:0,offsetY:0,centers:[]};let r=Math.min(...e.map(a=>a[0])),i=Math.max(...e.map(a=>a[0]+a[2])),s=Math.min(...e.map(a=>a[1])),l=Math.max(...e.map(a=>a[1]+a[3]));return{lineCount:e.length,detected:e.length>=t.minLines,fill:i-r,offsetX:(r+i)/2-.5,offsetY:(s+l)/2-.5,centers:e.map(a=>[a[0]+a[2]/2,a[1]+a[3]/2])}}o(P,"M");function C(h,t){if(h.centers.length===0||t.centers.length===0)return Number.POSITIVE_INFINITY;let e=0;for(let[r,i]of t.centers){let s=Number.POSITIVE_INFINITY;for(let[l,a]of h.centers)s=Math.min(s,Math.hypot(r-l,i-a));e+=s}return e/t.centers.length}o(C,"p");var b,O=(b=class{constructor(t=z){this.t=t,this.last=null,this.goodSince=null,this.steadySince=null,this.frames=0}offer(t,e,r={glareOk:!0,sharpOk:!0}){let i=this.t,s=P(t,i),l=this.last;this.last=s;let a=s.fill>=i.fillMin&&s.fill<=i.fillMax,d=Math.abs(s.offsetX)<=i.offsetMax&&Math.abs(s.offsetY)<=i.offsetMax,n=l!==null&&l.detected&&Math.abs(s.lineCount-l.lineCount)<=i.lineCountDelta&&C(l,s)<=i.layoutShiftMax,m=s.detected&&r.glareOk&&r.sharpOk&&a&&n&&l!==null&&Math.abs(s.fill-l.fill)<=i.steadyFillDelta&&Math.abs(s.offsetX-l.offsetX)<=i.steadyOffsetDelta&&Math.abs(s.offsetY-l.offsetY)<=i.steadyOffsetDelta,g=m&&d,c=s.detected?r.glareOk?s.fill<i.fillMin?"closer":s.fill>i.fillMax?"farther":d?r.sharpOk?void 0:"blurry":"center":"glare":void 0;return m?(this.frames++,this.steadySince??(this.steadySince=e),this.goodSince=g?this.goodSince??e:null,(this.goodSince!==null&&e-this.goodSince>=i.lockMs||e-this.steadySince>=i.steadyMs)&&this.frames>=i.minFrames?{state:"locked"}:{state:"locking",...c?{hint:c}:{}}):(this.goodSince=null,this.steadySince=null,this.frames=s.detected?1:0,{state:s.detected?"locking":"searching",...c?{hint:c}:{}})}reset(){this.last=null,this.goodSince=null,this.steadySince=null,this.frames=0}},o(b,"y"),b);function j(h,t){if(!Number.isFinite(h)||h<0)return"low";if(h<=150)return"high";let e=typeof t!="number"||!Number.isFinite(t)||t>3;return h<=400&&e?"mid":"low"}o(j,"L");var N=Object.freeze({low:Object.freeze({stride:1,bandWidthPx:960}),mid:Object.freeze({stride:2,bandWidthPx:1280}),high:Object.freeze({stride:1,bandWidthPx:1280})}),F=3e3;function B(h=globalThis){let t=h.navigator?.deviceMemory;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:null}o(B,"S");var E=[[1,0],[0,1],[1,1],[1,-1]];function A(h){let{width:t,height:e,data:r}=h;if(t<16||e<16)return-1;let i=new Uint8Array(t*e);for(let l=0,a=0;l<i.length;l+=1,a+=4)i[l]=Math.round(.299*(r[a]??0)+.587*(r[a+1]??0)+.114*(r[a+2]??0));let s=-1;for(let[l,a]of E){let d=new Uint32Array(256),n=new Float64Array(256),m=0;for(let f=1;f<e-1;f+=1){let u=f*t,R=(f+a)*t,_=(f-a)*t;for(let y=1;y<t-1;y+=1){let I=i[R+y+l]??0,T=i[_+y-l]??0,p=Math.abs(I-T);d[p]=(d[p]??0)+1,n[p]=(n[p]??0)+Math.abs(I+T-2*(i[u+y]??0)),m+=1}}let g=Math.max(1,Math.floor(m/20)),c=0,M=0,k=0;for(let f=255;f>=0&&c<g;f-=1){let u=d[f]??0;c+=u,M+=u*f,k+=n[f]??0}if(M===0)return 0;let S=k/M;s=s<0?S:Math.min(s,S)}return s}o(A,"w");var G=.06;function H(h,t,e,r=G){if(h===null||t.width<=0||t.height<=0)return null;let i=[h.topLeft,h.topRight,h.bottomRight,h.bottomLeft],s=e.width/t.width,l=e.height/t.height,a=Math.min(...i.map(u=>u.x))*s,d=Math.max(...i.map(u=>u.x))*s,n=Math.min(...i.map(u=>u.y))*l,m=Math.max(...i.map(u=>u.y))*l,g=(d-a)*r,c=(m-n)*r,M=Math.max(0,Math.floor(a-g)),k=Math.max(0,Math.floor(n-c)),S=Math.min(e.width,Math.ceil(d+g)),f=Math.min(e.height,Math.ceil(m+c));return S-M<16||f-k<16?null:{x:M,y:k,width:S-M,height:f-k}}o(H,"B");function J(h,t){let e=t??{x:0,y:0,width:h.width,height:h.height},r=Math.min(1,1e3/Math.max(e.width,e.height)),i=Math.max(1,Math.round(e.width*r)),s=Math.max(1,Math.round(e.height*r)),l=document.createElement("canvas");l.width=i,l.height=s;try{let a=l.getContext("2d",{willReadFrequently:!0});return a===null?-1:(a.imageSmoothingQuality="high",a.drawImage(h,e.x,e.y,e.width,e.height,0,0,i,s),A(a.getImageData(0,0,i,s)))}catch{return-1}finally{l.width=0,l.height=0}}o(J,"U");var v,W=(v=class{constructor(t=2){this.stableReads=t,this.last=null,this.run=0}offer(t){return t===null?(this.reset(),!1):(this.run=t===this.last?this.run+1:1,this.last=t,this.run>=this.stableReads)}reset(){this.last=null,this.run=0}},o(v,"g"),v),L=Object.freeze({...z,minIntervalMs:150,maxWidthPx:480,detectorLimit:960,searchTimeoutMs:12e3}),V=Object.freeze({detectorLimit:960,bandMaxWidthPx:1280,minBandWidthPx:900,bandTop:.55,minIntervalMs:150,stableReads:2,profileReads:5,maxReadMs:1200,searchTimeoutMs:12e3}),Y=o(()=>typeof document>"u"||document.visibilityState!=="hidden","C"),Q=o((h,t,e)=>createImageBitmap(h,Math.round(t.x),Math.round(t.y),Math.max(1,Math.round(t.w)),Math.max(1,Math.round(t.h)),{resizeWidth:Math.max(1,Math.round(Math.min(t.w,e))),resizeQuality:"high"}),"G"),w=o((h,t)=>{if(h.length===0)return 0;let e=[...h].sort((r,i)=>r-i);return e[Math.min(e.length-1,Math.floor(e.length*t))]},"x");function D(h){return h<=250?"fast":h<=600?"mid":"slow"}o(D,"V");function K(h,t,e){let r=h.y+h.h*t,i=Math.min(e,h.y+h.h*1.05);return{x:h.x,y:r,w:h.w,h:Math.max(1,i-r)}}o(K,"X");var x,Z=(x=class{constructor(t){this.o=t,this.engine=null,this.tier=null,this.gen=0,this.ticksSinceRead=Number.POSITIVE_INFINITY,this.hiddenSince=null,this.inFlight=!1,this.lastReadAt=Number.NEGATIVE_INFINITY,this.firstSeen=null,this.reads=0,this.times=[],this.mrzState={state:"searching"},this.lockState={state:"searching"},this.fallback=null,this.lockOff=!1,this.lockError=!1,this.fired=null,this.valid=null,this.faceMode="off",this.disabled=!1,this.crop=t.crop??Q,this.visible=t.visible??Y,this.mrzGate=new W(t.liveMrz?.stableReads??2),this.lockGate=new O(t.textLock??L)}setEngine(t,e){this.engine=t,e!==void 0&&(this.tier=e)}liveCadence(t){let e=this.tier===null?null:N[this.tier];return{stride:e?.stride??1,bandWidthPx:Math.min(t.bandMaxWidthPx,e?.bandWidthPx??t.bandMaxWidthPx)}}get bandTop(){return this.o.liveMrz?.bandTop??V.bandTop}get liveMrzOn(){return this.o.liveMrz!==null}get hasEngine(){return this.engine!==null&&!this.disabled}reset(){this.gen++,this.inFlight=!1,this.lastReadAt=Number.NEGATIVE_INFINITY,this.ticksSinceRead=Number.POSITIVE_INFINITY,this.hiddenSince=null,this.firstSeen=null,this.reads=0,this.times=[],this.mrzGate.reset(),this.lockGate.reset(),this.mrzState={state:"searching"},this.lockState={state:"searching"},this.fallback=null,this.lockOff=!1,this.lockError=!1,this.fired=null,this.valid=null,this.faceMode="off"}rearmFace(){this.gen++,this.inFlight=!1,this.lastReadAt=Number.NEGATIVE_INFINITY,this.ticksSinceRead=Number.POSITIVE_INFINITY,this.mrzGate.reset(),this.lockGate.reset(),this.fired=null,this.valid=null,this.fallback===null&&(this.mrzState={state:"searching"}),this.lockOff||(this.lockState={state:"searching"})}liveCapture(){return this.fired?.via==="live_mrz"?this.valid:null}modeFor(t){return this.engine===null||this.disabled?"off":t.mrzFace&&this.o.liveMrz!==null&&this.fallback===null?"live_mrz":this.o.textLock!==null&&!this.lockOff?"text_lock":"off"}tick(t){let e=this.modeFor(t);return e!=="off"&&(this.faceMode=e),this.fired!==null?{ready:!0,via:this.fired.via,suspendQuality:this.fired.via==="live_mrz",mode:e,...this.states()}:e!=="off"&&!this.visible()?(this.hiddenSince??(this.hiddenSince=t.atMs),this.mrzGate.reset(),{ready:!1,suspendQuality:e==="live_mrz"&&this.fallback===null,mode:e,...this.states()}):(this.hiddenSince!==null&&(this.firstSeen!==null&&(this.firstSeen+=t.atMs-this.hiddenSince),this.hiddenSince=null),e==="live_mrz"?this.liveTick(t,this.o.liveMrz):e==="text_lock"?this.lockTick(t,this.o.textLock):{ready:!1,suspendQuality:!1,mode:e,...this.states()})}states(){return{...this.faceMode==="live_mrz"||this.fallback!==null?{mrz:this.fallback!==null?{state:"fallback",reason:this.fallback}:this.mrzState}:{},...this.faceMode==="text_lock"?{lock:this.lockState}:{}}}canRead(t,e){let r=this.engine;return r!==null&&!this.inFlight&&!r.busy&&t-this.lastReadAt>=e}fall(t){this.fallback=t,this.mrzGate.reset()}liveTick(t,e){let r=o(()=>this.tier!=="low"||this.firstSeen===null||t.atMs-this.firstSeen<F,"r"),i=o(()=>this.fallback!==null?{ready:!1,suspendQuality:!1,mode:"live_mrz",mrz:{state:"fallback",reason:this.fallback}}:{ready:!1,suspendQuality:r(),mode:"live_mrz",mrz:this.mrzState},"s");if(!t.present||t.band===null)return this.mrzGate.reset(),this.mrzState={state:"searching"},i();if(this.firstSeen??(this.firstSeen=t.atMs),t.atMs-this.firstSeen>e.searchTimeoutMs)return this.fall("timeout"),i();if(t.band.w<e.minBandWidthPx)return t.card!==null&&t.card.w<e.minBandWidthPx?(this.fall("unsupported"),i()):(this.mrzState={state:"reading",coach:t.portrait?"turnSideways":"moveCloser"},{ready:!1,suspendQuality:!1,mode:"live_mrz",mrz:this.mrzState});let s=this.liveCadence(e);if(this.ticksSinceRead++,this.ticksSinceRead<s.stride||!this.canRead(t.atMs,e.minIntervalMs))return i();this.inFlight=!0,this.lastReadAt=t.atMs,this.ticksSinceRead=0;let l=this.gen,a=this.engine,d=t.glareOk?t.sharpOk?void 0:"holdStill":"glare";return this.crop(t.video,t.band,s.bandWidthPx).then(n=>a.bandRead(n,e.detectorLimit)).then(n=>{if(l===this.gen){if(this.reads++,this.times.push(n.ms),this.times.length>8&&this.times.shift(),this.reads>=e.profileReads&&w(this.times,.5)>e.maxReadMs)return this.fall("slow");if(this.mrzGate.offer(n.valid?n.digest??null:null)&&n.format&&n.digest){this.valid={format:n.format,...n.documentCode!==void 0?{documentCode:n.documentCode}:{},digest:n.digest,lineCount:n.lineCount,framesToValid:this.reads,msToValid:Math.round(t.atMs-(this.firstSeen??t.atMs))},this.mrzState={state:"valid",format:n.format},this.fired={via:"live_mrz",at:t.atMs};return}this.mrzState={state:"reading",...d?{coach:d}:{},...n.format?{format:n.format}:{}}}}).catch(()=>{l===this.gen&&this.fall("error")}).finally(()=>{l===this.gen&&(this.inFlight=!1)}),i()}lockTick(t,e){let r=o(()=>({ready:!1,suspendQuality:!1,mode:"text_lock",lock:this.lockState,...this.fallback!==null?{mrz:{state:"fallback",reason:this.fallback}}:{}}),"r");if(!t.present||t.card===null)return this.lockGate.reset(),this.lockState={state:"searching"},r();if(this.firstSeen??(this.firstSeen=t.atMs),t.atMs-this.firstSeen>e.searchTimeoutMs)return this.lockOff=!0,r();if(!this.canRead(t.atMs,e.minIntervalMs))return r();this.inFlight=!0,this.lastReadAt=t.atMs;let i=this.gen,s=this.engine,l={glareOk:t.glareOk,sharpOk:t.sharpOk};return this.crop(t.video,t.card,e.maxWidthPx).then(a=>s.layoutRead(a,e.detectorLimit)).then(a=>{if(i!==this.gen)return;this.reads++,this.times.push(a.ms),this.times.length>8&&this.times.shift();let d=this.lockGate.offer(a,t.atMs,l);this.lockState=d.state==="locked"?{state:"locked"}:{state:d.state,...d.hint?{hint:d.hint}:{}},d.state==="locked"&&(this.fired={via:"text_lock",at:t.atMs})}).catch(()=>{i===this.gen&&(this.lockOff=!0,this.lockError=!0)}).finally(()=>{i===this.gen&&(this.inFlight=!1)}),r()}disable(){this.disabled=!0,this.reset()}report(t,e,r){let i=this.faceMode;if(i==="off")return null;let s=w(this.times,.5),l={capture:t,mode:i,reads:this.reads,...this.times.length>0?{readP50Ms:Math.round(s),readP90Ms:Math.round(w(this.times,.9)),deviceClass:D(s)}:{}};return i==="live_mrz"?this.fired?.via==="live_mrz"&&this.valid!==null&&e==="live_mrz"?{...l,outcome:"valid",format:this.valid.format,framesToValid:this.valid.framesToValid,msToValid:this.valid.msToValid}:this.fallback!==null?{...l,outcome:this.fallback}:{...l,outcome:r-(this.firstSeen??r)>=(this.o.liveMrz?.searchTimeoutMs??1/0)?"timeout":"off"}:this.fired?.via==="text_lock"?{...l,outcome:"locked",framesToLock:Math.max(1,this.reads),msToLock:Math.round(this.fired.at-(this.firstSeen??this.fired.at))}:{...l,outcome:this.lockError?"error":this.lockOff?"timeout":"off"}}},o(x,"I"),x);export{j as a,B as b,H as c,J as d,L as e,V as f,K as g,Z as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as j}from"./chunk-
|
|
1
|
+
import{a as j}from"./chunk-QR7XWTXK.js";import{d as U}from"./chunk-SI6GIBVC.js";import{K as k,L as I,a as A,b as V,c as h,v as T,w as _,y as C}from"./chunk-Z6KNLRUW.js";import{a as n}from"./chunk-5QL6W6FW.js";import{a as s,c as N}from"./chunk-4FHWXBOB.js";var f=N(A(),1),e=N(V(),1);var D={"portrait.source.title":"كيف تريد إضافة صورتك الشخصية؟","portrait.source.description":"التقط صورة جديدة بالكاميرا، أو ارفع صورة حديثة من هذا الجهاز.","portrait.source.camera":"التقاط صورة","portrait.source.upload":"رفع صورة","portrait.source.uploadInstead":"رفع صورة بدلًا من ذلك","portrait.upload.title":"ارفع صورتك الشخصية","portrait.upload.hint":"صورة حديثة لوجهك، تنظر فيها مباشرة إلى الكاميرا، أمام جدار فاتح وبلون واحد.","portrait.upload.choose":"اختيار صورة","portrait.upload.unsupported":"اختر صورة بصيغة JPEG أو PNG أو HEIC.","portrait.upload.failed":"تعذّر إرسال هذه الصورة. حاول مرة أخرى.","portrait.review.title":"تحقّق من صورتك المعدّلة","portrait.review.description":"عدّلنا صورتك لتطابق قواعد صور الهوية. لم نغيّر وجهك.","portrait.review.original":"صورتك","portrait.review.fixed":"الصورة المعدّلة","portrait.review.fixesTitle":"ما الذي غيّرناه","portrait.review.accept":"استخدام هذه الصورة","portrait.review.retake":"إعادة الالتقاط","portrait.review.uploadAnother":"رفع صورة أخرى","portrait.fixes.crop":"قُصّت","portrait.fixes.scale":"غُيّر حجمها","portrait.fixes.straighten":"عُدّل ميلها","portrait.fixes.background":"استُبدلت الخلفية","portrait.fixes.exposure":"عُدّل السطوع","portrait.fixes.white_balance":"وُزنت الألوان","reasons.portrait_morph_suspected":"لا يمكن استخدام هذه الصورة. التقط صورة جديدة للشخص.","reasons.portrait_reference_mismatch":"لا تطابق الصورة المرجع. التقط صورة جديدة للشخص.","reasons.portrait_declined_fix":"التقط صورة أخرى أو ارفعها."},y={"portrait.source.title":"How do you want to add your ID photo?","portrait.source.description":"Take a new photo with the camera, or upload a recent photo from this device.","portrait.source.camera":"Take a photo","portrait.source.upload":"Upload a photo","portrait.source.uploadInstead":"Upload a photo instead","portrait.upload.title":"Upload your ID photo","portrait.upload.hint":"A recent photo of your face, looking straight at the camera, in front of a plain, light wall.","portrait.upload.choose":"Choose a photo","portrait.upload.unsupported":"Choose a JPEG, PNG or HEIC photo.","portrait.upload.failed":"We could not send this photo. Try again.","portrait.review.title":"Check your adjusted photo","portrait.review.description":"We adjusted your photo to meet the ID photo rules. Your face was not changed.","portrait.review.original":"Your photo","portrait.review.fixed":"Adjusted photo","portrait.review.fixesTitle":"What we changed","portrait.review.accept":"Use this photo","portrait.review.retake":"Take another","portrait.review.uploadAnother":"Upload another","portrait.fixes.crop":"Cropped","portrait.fixes.scale":"Resized","portrait.fixes.straighten":"Straightened","portrait.fixes.background":"Background replaced","portrait.fixes.exposure":"Brightness adjusted","portrait.fixes.white_balance":"Colours balanced","reasons.portrait_morph_suspected":"This photo cannot be used. Take a new photo of the person.","reasons.portrait_reference_mismatch":"The photo does not match the reference. Take a new photo of the person.","reasons.portrait_declined_fix":"Take or upload another photo."},G={"portrait.source.title":"Comment voulez-vous ajouter votre photo d'identité ?","portrait.source.description":"Prenez une nouvelle photo avec la caméra, ou importez une photo récente depuis cet appareil.","portrait.source.camera":"Prendre une photo","portrait.source.upload":"Importer une photo","portrait.source.uploadInstead":"Importer une photo à la place","portrait.upload.title":"Importez votre photo d'identité","portrait.upload.hint":"Une photo récente de votre visage, de face, devant un mur clair et uni.","portrait.upload.choose":"Choisir une photo","portrait.upload.unsupported":"Choisissez une photo JPEG, PNG ou HEIC.","portrait.upload.failed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","portrait.review.title":"Vérifiez votre photo ajustée","portrait.review.description":"Nous avons ajusté votre photo pour qu'elle respecte les règles des photos d'identité. Votre visage n'a pas été modifié.","portrait.review.original":"Votre photo","portrait.review.fixed":"Photo ajustée","portrait.review.fixesTitle":"Ce que nous avons modifié","portrait.review.accept":"Utiliser cette photo","portrait.review.retake":"Reprendre","portrait.review.uploadAnother":"Importer une autre","portrait.fixes.crop":"Recadrée","portrait.fixes.scale":"Redimensionnée","portrait.fixes.straighten":"Redressée","portrait.fixes.background":"Fond remplacé","portrait.fixes.exposure":"Luminosité ajustée","portrait.fixes.white_balance":"Couleurs équilibrées","reasons.portrait_morph_suspected":"Cette photo ne peut pas être utilisée. Prenez une nouvelle photo de la personne.","reasons.portrait_reference_mismatch":"La photo ne correspond pas à la référence. Prenez une nouvelle photo de la personne.","reasons.portrait_declined_fix":"Prenez ou importez une autre photo."},H={en:y,fr:G,ar:D,es:y,pt:y,de:y},S="image/jpeg,image/png,image/heic,image/heif";function m(r){let o=r.strings,a=H[r.locale];return t=>o[t]??a[t]??""}s(m,"v");n(m,"portraitCopy");function b({step:r,i18n:o}){if(r.reason===void 0||r.reason==="portrait_fix_review")return null;let a=m(o)(`reasons.${r.reason}`)||o.t("portrait.retryTitle");return(0,e.jsxs)(k,{tone:"warning",children:[(0,e.jsx)("span",{children:a}),(0,e.jsx)("span",{children:I(o,r.attemptsRemaining,r.attemptsExhausted)})]})}s(b,"R");n(b,"ReasonNotice");function z({step:r,i18n:o,onCamera:a,onUpload:t}){let i=m(o),p=r.photo?.cameraOnPhone===!0;return(0,e.jsx)(j,{testId:"sekyro-portrait-source",title:i("portrait.source.title"),lead:i("portrait.source.description"),cameraLabel:p?o.t("capture.source.phone"):i("portrait.source.camera"),onPhone:p,uploadLabel:i("portrait.source.upload"),notice:(0,e.jsx)(b,{step:r,i18n:o}),onCamera:a,onUpload:t})}s(z,"z");n(z,"PortraitSourceView");function R({step:r,i18n:o,onCamera:a}){let t=m(o),i=(0,f.useRef)(null),[p,v]=(0,f.useState)("idle"),u=p==="sending",d=r.photo?.uploadOffered===!0,g=n(async c=>{let x=c.currentTarget.files?.[0];if(c.currentTarget.value="",x!==void 0){v("sending");try{await r.uploadPortrait(x),v("idle")}catch(w){v(w instanceof TypeError&&w.message==="unsupported_file"?"unsupported":"failed")}}},"onFile");return(0,e.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-portrait-upload-screen",children:[(0,e.jsx)(_,{title:t("portrait.upload.title"),lead:t("portrait.upload.hint")}),p==="idle"||p==="sending"?(0,e.jsx)(b,{step:r,i18n:o}):null,p==="unsupported"||p==="failed"?(0,e.jsx)(k,{tone:"warning",children:(0,e.jsx)("span",{children:t(p==="unsupported"?"portrait.upload.unsupported":"portrait.upload.failed")})}):null,u?(0,e.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:o.t("portrait.uploading")}):null,(0,e.jsx)("input",{ref:i,type:"file",accept:S,hidden:!0,"data-testid":"sekyro-portrait-upload","aria-label":t("portrait.upload.title"),onChange:s(c=>{g(c)},"onChange")}),(0,e.jsxs)(C,{children:[(0,e.jsx)(h,{full:!0,onClick:s(()=>i.current?.click(),"onClick"),disabled:u||!d||r.attemptsExhausted,children:t("portrait.upload.choose")}),a!==void 0?(0,e.jsxs)(h,{full:!0,kind:"ghost",onClick:a,disabled:u,children:[(0,e.jsx)(T,{name:"camera"}),t("portrait.source.camera")]}):null]})]})}s(R,"A");n(R,"PortraitUploadView");function E({step:r,i18n:o,onDeclined:a}){let t=m(o),[i,p]=(0,f.useState)(!1),[v,u]=(0,f.useState)(!1),d=r.pendingFix;if(d==null)return null;let g=n(async l=>{p(!0),u(!1);try{await r.confirmFix(l),l||a?.()}catch{u(!0)}finally{p(!1)}},"answer"),c=r.photo?.source==="upload"?t("portrait.review.uploadAnother"):t("portrait.review.retake"),x=n(l=>t(`portrait.fixes.${l}`)||l,"fixName"),w=t("portrait.review.original"),P=t("portrait.review.fixed");return(0,e.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-portrait-review",children:[(0,e.jsx)(_,{title:t("portrait.review.title"),lead:t("portrait.review.description")}),(0,e.jsxs)("div",{className:"sekyro-portrait-pair",children:[(0,e.jsxs)("figure",{className:"sekyro-portrait-pair__item",children:[(0,e.jsx)("img",{src:d.originalUrl,alt:w}),(0,e.jsx)("figcaption",{className:"sekyro-text-muted",children:w})]}),(0,e.jsxs)("figure",{className:"sekyro-portrait-pair__item",children:[(0,e.jsx)("img",{src:d.fixedUrl,alt:P}),(0,e.jsx)("figcaption",{className:"sekyro-text-muted",children:P})]})]}),d.fixes.length>0?(0,e.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,e.jsx)("p",{className:"sekyro-text-body",children:t("portrait.review.fixesTitle")}),(0,e.jsx)("ul",{className:"sekyro-portrait-fixes","data-testid":"sekyro-portrait-fixes",children:d.fixes.map(l=>(0,e.jsx)("li",{children:x(l)},l))})]}):null,v?(0,e.jsx)(k,{tone:"danger",children:(0,e.jsx)("span",{children:o.t("errors.network_error")})}):null,(0,e.jsxs)(C,{children:[(0,e.jsx)(h,{full:!0,onClick:s(()=>{g(!0)},"onClick"),disabled:i,"data-testid":"sekyro-portrait-accept",children:t("portrait.review.accept")}),(0,e.jsx)(h,{full:!0,kind:"ghost",onClick:s(()=>{g(!1)},"onClick"),disabled:i,"data-testid":"sekyro-portrait-decline",children:c})]})]})}s(E,"j");n(E,"PortraitReviewView");function q({screen:r,step:o,i18n:a,onCamera:t,onUpload:i,onDeclined:p}){return r==="phone"?(0,e.jsx)(U,{i18n:a,lead:a.t("handoff.lead.portrait"),refresh:o.refresh,actions:(0,e.jsx)(h,{kind:"ghost",full:!0,onClick:i,children:m(a)("portrait.source.upload")})}):r==="review"?(0,e.jsx)(E,{step:o,i18n:a,onDeclined:p}):r==="upload"?(0,e.jsx)(R,{step:o,i18n:a,...t!==void 0?{onCamera:t}:{}}):(0,e.jsx)(z,{step:o,i18n:a,onCamera:t??i,onUpload:i})}s(q,"Q");n(q,"PortraitScreens");export{m as a,z as b,R as c,E as d,q as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b,t as r,v as l,y as o}from"./chunk-
|
|
1
|
+
import{b,t as r,v as l,y as o}from"./chunk-Z6KNLRUW.js";import{a as i}from"./chunk-5QL6W6FW.js";import{a,c as p}from"./chunk-4FHWXBOB.js";var s=p(b(),1);function f({tone:d,icon:n,busy:c,title:m,titleId:e,children:u,actions:t,live:y,testId:h}){let k=r();return(0,s.jsxs)("section",{className:"sekyro-step sekyro-status",...e!==void 0?{"aria-labelledby":e}:{},...y?{role:"status","aria-live":"polite"}:{},"data-testid":h,children:[(0,s.jsxs)("div",{className:"sekyro-status__body",children:[(0,s.jsx)("span",{className:`sekyro-tile sekyro-tile--${d}${c?" is-busy":""}`,"aria-hidden":"true",children:(0,s.jsx)(l,{name:n})}),(0,s.jsxs)("div",{className:"sekyro-heading sekyro-status__text",children:[(0,s.jsx)("h2",{id:e,ref:k,tabIndex:-1,className:"sekyro-text-body",children:m}),u]})]}),t!=null&&t!==!1?(0,s.jsx)(o,{children:t}):null]})}a(f,"g");i(f,"StatusPage");export{f as a};
|