@sekyro/web 0.1.0-rc.37 → 0.1.0-rc.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/{capture-session-doc-6MUKGUJ3.js → capture-session-doc-MGDYUASI.js} +1 -1
  3. package/dist/{capture-session-v3-BdpUe0ht.d.cts → capture-session-v3-Dz-AQW52.d.cts} +1 -1
  4. package/dist/{capture-session-v3-Q4otwuve.d.ts → capture-session-v3-Z2KI_2p9.d.ts} +1 -1
  5. package/dist/chunk-5AR5GTEJ.js +1 -0
  6. package/dist/{chunk-DTQTSZAX.js → chunk-C4XDRRU5.js} +1 -1
  7. package/dist/{chunk-KORZGQLS.js → chunk-COZXZAD5.js} +1 -1
  8. package/dist/chunk-IAKYKPL6.js +1 -0
  9. package/dist/chunk-IOCOIZKE.js +3 -0
  10. package/dist/chunk-MQHTFHSN.js +1 -0
  11. package/dist/chunk-PBWIMNSN.js +1 -0
  12. package/dist/{chunk-7GUHA2NM.js → chunk-QTOMWAS6.js} +1 -1
  13. package/dist/{chunk-LTGRPMMY.js → chunk-TOISWBOX.js} +1 -1
  14. package/dist/chunk-TQQK7464.js +1 -0
  15. package/dist/chunk-U5TL63CG.js +1 -0
  16. package/dist/chunk-VMHFHHPP.js +1 -0
  17. package/dist/{chunk-ISMVEF7H.js → chunk-WNBEOK5Q.js} +1 -1
  18. package/dist/chunk-XDB7L5KS.js +1 -0
  19. package/dist/client/index.cjs +1 -1
  20. package/dist/client/index.d.cts +3 -3
  21. package/dist/client/index.d.ts +3 -3
  22. package/dist/client/index.js +1 -1
  23. package/dist/core/index.cjs +1 -1
  24. package/dist/core/index.d.cts +3 -3
  25. package/dist/core/index.d.ts +3 -3
  26. package/dist/core/index.js +1 -1
  27. package/dist/core/ocr/worker.bundle.js +12 -12
  28. package/dist/core/ocr/worker.cjs +12 -12
  29. package/dist/core/ocr/worker.js +9 -9
  30. package/dist/create-document-capture-KISF6XD3.js +1 -0
  31. package/dist/{create-verification-CCCvsDdp.d.ts → create-verification-2Qm_K28Y.d.ts} +5 -4
  32. package/dist/{create-verification-BJGWTzCS.d.cts → create-verification-BG6A2iyO.d.cts} +5 -4
  33. package/dist/{detector-scanic-LYXXX77M.js → detector-scanic-JC25DD3A.js} +1 -1
  34. package/dist/{icao-gate-C2B9Yyz0.d.cts → icao-gate-Dyb0wGO3.d.cts} +8 -1
  35. package/dist/{icao-gate-toRhhMow.d.ts → icao-gate-QqtNED0V.d.ts} +8 -1
  36. package/dist/{icao-policy-xp26r3lv.d.ts → icao-policy-DsaRylAQ.d.ts} +2 -2
  37. package/dist/{icao-policy-CFoaL76l.d.cts → icao-policy-iIBtqhbf.d.cts} +2 -2
  38. package/dist/index.cjs +2 -2
  39. package/dist/index.d.cts +7 -7
  40. package/dist/index.d.ts +7 -7
  41. package/dist/index.js +1 -1
  42. package/dist/internal/index.cjs +3 -3
  43. package/dist/internal/index.d.cts +6 -6
  44. package/dist/internal/index.d.ts +6 -6
  45. package/dist/internal/index.js +1 -1
  46. package/dist/plan-runner-NWK4LZFI.js +1 -0
  47. package/dist/{types-BUvxjU5V.d.cts → types-Cy_SJtPf.d.cts} +30 -3
  48. package/dist/{types-BUvxjU5V.d.ts → types-Cy_SJtPf.d.ts} +30 -3
  49. package/package.json +1 -1
  50. package/sbom.cdx.json +19 -19
  51. package/dist/chunk-2DBOZDYR.js +0 -1
  52. package/dist/chunk-5QUJHFOH.js +0 -1
  53. package/dist/chunk-AYWS6XTB.js +0 -1
  54. package/dist/chunk-EP6FVAR4.js +0 -3
  55. package/dist/chunk-GVAN773O.js +0 -1
  56. package/dist/chunk-JULJQOVT.js +0 -1
  57. package/dist/chunk-PW2HWXBJ.js +0 -1
  58. package/dist/chunk-QPO6LOYB.js +0 -1
  59. package/dist/create-document-capture-EK7EDLTD.js +0 -1
  60. package/dist/plan-runner-7XZH4SBZ.js +0 -1
@@ -1 +1 @@
1
- import{a as re,d as ne,e as B,f as se,g as oe}from"./chunk-7QZWBDI5.js";import{C as te,a as X}from"./chunk-AYWS6XTB.js";import{f as j,l as J}from"./chunk-CPUECYAJ.js";import{c as Z}from"./chunk-TSA6GHUG.js";import{c as ee,h as L}from"./chunk-FSSMUAKC.js";var ve=12e4,ie=13e4,ge=3e3,he=1200,D=Symbol.for("@sekyro/web.preload.v1");function h(){let e=globalThis;return e[D]??(e[D]=new Map),e[D]}function b(e){let r=(e??ee).replace(/\/+$/,"");return r===""?"/":r}function ae(e){let r=h(),n=r.get(e);return n===void 0&&(n={status:"idle",promise:null,scheduled:null,detectorPromise:null,detector:null,listeners:new Set},r.set(e,n)),n}function k(e,r){if(e.status!==r){e.status=r;for(let n of[...e.listeners])n(r)}}var K=e=>L({preferred:["blaze"],v3AssetBaseUrl:e,blazeInitTimeoutMs:ve}),H=K;function Te(e){H=e??K}function Oe(){for(let e of h().values())e.detector?.destroy();h().clear(),H=K}function Ce(){return typeof window<"u"&&typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"}function Se(){return navigator.connection?.saveData===!0}function Ee(e){let r=window;if(typeof r.requestIdleCallback=="function"){let s=r.requestIdleCallback(e,{timeout:ge});return()=>r.cancelIdleCallback?.(s)}let n=setTimeout(e,he);return()=>clearTimeout(n)}function ye(e,r){let n,s=new Promise(d=>{n=d}),m=!1,u=()=>{},c={promise:s,settle:d=>{m||(m=!0,u(),e.scheduled===c&&(e.scheduled=null),n(d))}};return e.scheduled=c,u=Ee(()=>{m||c.settle(U(e,r))}),s}function U(e,r){if((e.status==="loading"||e.status==="ready")&&e.promise!==null)return e.promise;k(e,"loading");let n=new Promise(d=>d(H(r)));e.detectorPromise=n;let s,m=new Promise((d,f)=>{s=setTimeout(()=>{n.then(C=>C.destroy(),()=>{}),f(new Error(`detector preload exceeded ${ie} ms`))},ie)}),c=Promise.race([n,m]).then(d=>e.detectorPromise!==n?(d.destroy(),e.status):(e.detector=d,k(e,"ready"),"ready"),d=>(e.detectorPromise===n&&(e.detectorPromise=null,e.detector=null,k(e,"failed"),console.warn("[@sekyro/web] face-detector preload failed:",d)),e.status)).finally(()=>clearTimeout(s));return e.promise=c,e.scheduled?.settle(c),c}function xe(e={}){if(!Ce())return Promise.resolve("idle");let r=b(e.assetBaseUrl),n=ae(r);return e.respectSaveData===!0&&Se()?Promise.resolve(n.status):(n.status==="loading"||n.status==="ready")&&n.promise!==null?n.promise:e.idle===!0?n.scheduled?.promise??ye(n,r):U(n,r)}function Fe(e){return h().get(b(e))?.status??"idle"}function Ie(e,r){let n=ae(b(r));return n.listeners.add(e),()=>{n.listeners.delete(e)}}function Be(e){let r=h().get(b(e));r!==void 0&&(r.scheduled?.settle("idle"),r.detector?.destroy(),r.detector=null,r.detectorPromise=null,r.promise=null,k(r,"idle"))}function Le(e){return{get tier(){return e.tier},get fallbackReason(){return e.fallbackReason},detect:(...r)=>e.detect(...r),destroy:()=>{}}}function de(e){let r=b(e),n=h().get(r);if(!(n===void 0||n.detector===null&&n.detectorPromise===null&&n.scheduled===null))return async()=>{n.scheduled!==null&&U(n,r);let s=n.promise;for(;n.detector===null&&s!==null&&(await s,n.promise!==s);)s=n.promise;return n.detector!==null?Le(n.detector):L({v3AssetBaseUrl:r})}}var be=new Set(["inuse","overconstrained","notfound"]),Me=[500,1500];function Ae(e){switch(e){case"fcv3.no_face":case"fcv3.center_face":case"fcv3.straighten":return"center";case"fcv3.come_closer":return"closer";case"fcv3.move_back":return"farther";case"fcv3.more_light":case"fcv3.too_bright":return"light";case"fcv3.hold_still":case"fcv3.steady_camera":return"still";case"fcv3.hold_upright":return"upright";case"fcv3.one_face":return"one_face";default:return null}}function Pe(e){switch(e){case"preflight":case"acquiring":return"starting";case"positioning":return"gating";default:return e}}function ue(e){switch(e){case"permission":case"notfound":case"inuse":case"insecure":case"unsupported":return e;case"backcamera":return"notfound";default:{let r=e;return"generic"}}}function we(e,r,n){if(n===void 0)return{kind:ue(e),retryable:r};let s=J(n.name);return{kind:ue(e),retryable:r,detail:{...s!==void 0?{name:s}:{},phase:n.phase,engineKind:e}}}var _e=new Set(["captured","uploading","checking"]);function De(e,r={},n,s=()=>"self",m=()=>{},u){let c=r.now??(()=>performance.now()),d=r.canChooseFacing??ne,f="user",C=se(),p=s(),l=re(),V=!j(),G=r.engineOptions,ce=G?.createDetector===void 0&&G?.createWorker===void 0?{createDetector:()=>{let t=de(e.assetBaseUrl);return t!==void 0?t():L({v3AssetBaseUrl:e.assetBaseUrl})}}:{},z={video:e.video,mode:V?"photo":"clip",rankKeyframes:n,facingMode:void 0,v3AssetBaseUrl:e.assetBaseUrl,screenRamp:()=>p==="self"&&l.count("ramp")>0?m():void 0,...r.engineOptions??{},...ce},a=r.createEngine?.(z)??new te(z),v="idle",M=null,A=0,R=!1,T="full",P=null,w=null,O=0,x=0,W=()=>{e.video.videoWidth>0&&e.video.videoHeight>0&&(O=e.video.videoWidth,x=e.video.videoHeight)},q=oe({enabled:e.keepScreenAwake!==!1}),S=t=>{v=t,q.setActive(t==="starting"||t==="gating"||t==="recording"),l.emit("state",t)},F=()=>l.emit("gate",{progress:A,hint:M,faceDetected:R}),I=()=>{let t=a.animations??"full";t!==T&&(T=t,l.emit("profile",{animations:T}))},g=0,_=null,le=r.schedule??((t,o)=>{let i=setTimeout(t,o);return()=>clearTimeout(i)}),E=()=>{_?.(),_=null},fe=(t,o)=>{if(y||!be.has(t)||o?.phase!=="acquiring")return!1;let i=Me[g];return i===void 0?!1:(g+=1,E(),_=le(()=>{_=null,y||a.retry()},i),!0)},pe=[a.on("statechange",({state:t})=>{if(t==="error")return;let o=Pe(t);o==="gating"&&(g=0),o==="starting"&&v!=="starting"&&(M=null,A=0,R=!1,P=null,w=null,O=0,x=0),S(o),I(),o==="recording"&&(W(),P=c(),M="hold",A=1,F())}),a.on("checks",t=>{W(),A=t.progress,R=t.factors.presence>0,F(),I()}),a.on("guidance",({key:t})=>{M=Ae(t),F()}),a.on("frozen",({previewDataUrl:t})=>{w=c(),l.emit("frozen",{previewDataUrl:t})}),a.on("ramp",t=>l.emit("ramp",t)),a.on("artifacts",t=>{if(v!=="captured")return;let o=Z(),i=t.clipStats,Q=i!==void 0?Math.round(i.durationMs):P!==null&&w!==null?Math.max(0,Math.round(w-P)):void 0,Y=i!==void 0&&i.frames>1&&i.durationMs>0?Math.round(i.frames*1e4/i.durationMs)/10:void 0;l.emit("captured",{keyframe:t.keyframe,...t.clip!==void 0?{clip:t.clip}:{},...t.clipMimeType!==void 0?{clipMime:t.clipMimeType}:{},width:e.video.videoWidth||O,height:e.video.videoHeight||x,...Q!==void 0?{clipMs:Q}:{},...i!==void 0?{clipFrames:i.frames}:{},...Y!==void 0?{fps:Y}:{},...t.clipRetakes!==void 0?{clipRetakes:t.clipRetakes}:{},...t.clipMimeType!==void 0?{codec:X(t.clipMimeType)}:{},captureChannel:o==="desktop"?"desktop":"mobile",formFactor:o,...V?{degraded:"NO_RECORDER"}:{},engine:"v3",facingMode:a.facingMode,mode:p,...t.timing,...t.screenRamp!==void 0?{screenRamp:t.screenRamp}:{},...t.provenance!==void 0?{provenance:t.provenance}:{}})}),a.on("error",({kind:t,retryable:o,detail:i})=>{t==="backcamera"&&me()||fe(t,i)||(S("error"),I(),l.emit("error",we(t,o,i)))})],N=!1;function me(){return y||N||p!=="assisted"||u===void 0||u.session()!=="choice"?!1:(N=!0,u.onModeChange("self"),p="self",f=B("self"),S("mode_switch"),a.restart(f),!0)}let $=async()=>u!==void 0&&u.session()==="choice"&&await d().catch(()=>!1),y=!1;return{handle:{get state(){return v},get captureMode(){return s()},get facingMode(){return a.facingMode??f},on:(t,o)=>l.on(t,o),start:t=>(p=s(),C.facing(p,e.facing),f=C.facing(p,t?.facing),E(),g=0,a.start({facingMode:f})),retry:()=>{E(),g=0,a.retry()},switchCamera:()=>C.refuseSwitch(s()),canSwitchCaptureMode:$,setCaptureMode:async t=>{if(t===s()||!await $()||y||_e.has(v)||u===void 0)return!1;u.onModeChange(t),p=t;let o=B(t);return f=o,v==="idle"||(S("mode_switch"),E(),g=0,a.restart(o)),!0},destroy:()=>{y=!0,E();for(let t of pe)t();q.setActive(!1),a.destroy(),l.clear()}},setFlowState:t=>{v!==t&&S(t)}}}function Ze(e){return De(e).handle}export{ve as a,ie as b,Te as c,Oe as d,xe as e,Fe as f,Ie as g,Be as h,de as i,Ae as j,Pe as k,ue as l,we as m,De as n,Ze as o};
1
+ import{a as re,d as ne,e as B,f as se,g as oe}from"./chunk-7QZWBDI5.js";import{A as te,a as X}from"./chunk-PBWIMNSN.js";import{f as j,l as J}from"./chunk-CPUECYAJ.js";import{c as Z}from"./chunk-TSA6GHUG.js";import{c as ee,h as L}from"./chunk-FSSMUAKC.js";var ve=12e4,ie=13e4,ge=3e3,he=1200,D=Symbol.for("@sekyro/web.preload.v1");function h(){let e=globalThis;return e[D]??(e[D]=new Map),e[D]}function b(e){let r=(e??ee).replace(/\/+$/,"");return r===""?"/":r}function ae(e){let r=h(),n=r.get(e);return n===void 0&&(n={status:"idle",promise:null,scheduled:null,detectorPromise:null,detector:null,listeners:new Set},r.set(e,n)),n}function k(e,r){if(e.status!==r){e.status=r;for(let n of[...e.listeners])n(r)}}var K=e=>L({preferred:["blaze"],v3AssetBaseUrl:e,blazeInitTimeoutMs:ve}),H=K;function Te(e){H=e??K}function Oe(){for(let e of h().values())e.detector?.destroy();h().clear(),H=K}function Ce(){return typeof window<"u"&&typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"}function Se(){return navigator.connection?.saveData===!0}function Ee(e){let r=window;if(typeof r.requestIdleCallback=="function"){let s=r.requestIdleCallback(e,{timeout:ge});return()=>r.cancelIdleCallback?.(s)}let n=setTimeout(e,he);return()=>clearTimeout(n)}function ye(e,r){let n,s=new Promise(d=>{n=d}),m=!1,u=()=>{},c={promise:s,settle:d=>{m||(m=!0,u(),e.scheduled===c&&(e.scheduled=null),n(d))}};return e.scheduled=c,u=Ee(()=>{m||c.settle(U(e,r))}),s}function U(e,r){if((e.status==="loading"||e.status==="ready")&&e.promise!==null)return e.promise;k(e,"loading");let n=new Promise(d=>d(H(r)));e.detectorPromise=n;let s,m=new Promise((d,f)=>{s=setTimeout(()=>{n.then(C=>C.destroy(),()=>{}),f(new Error(`detector preload exceeded ${ie} ms`))},ie)}),c=Promise.race([n,m]).then(d=>e.detectorPromise!==n?(d.destroy(),e.status):(e.detector=d,k(e,"ready"),"ready"),d=>(e.detectorPromise===n&&(e.detectorPromise=null,e.detector=null,k(e,"failed"),console.warn("[@sekyro/web] face-detector preload failed:",d)),e.status)).finally(()=>clearTimeout(s));return e.promise=c,e.scheduled?.settle(c),c}function xe(e={}){if(!Ce())return Promise.resolve("idle");let r=b(e.assetBaseUrl),n=ae(r);return e.respectSaveData===!0&&Se()?Promise.resolve(n.status):(n.status==="loading"||n.status==="ready")&&n.promise!==null?n.promise:e.idle===!0?n.scheduled?.promise??ye(n,r):U(n,r)}function Fe(e){return h().get(b(e))?.status??"idle"}function Ie(e,r){let n=ae(b(r));return n.listeners.add(e),()=>{n.listeners.delete(e)}}function Be(e){let r=h().get(b(e));r!==void 0&&(r.scheduled?.settle("idle"),r.detector?.destroy(),r.detector=null,r.detectorPromise=null,r.promise=null,k(r,"idle"))}function Le(e){return{get tier(){return e.tier},get fallbackReason(){return e.fallbackReason},detect:(...r)=>e.detect(...r),destroy:()=>{}}}function de(e){let r=b(e),n=h().get(r);if(!(n===void 0||n.detector===null&&n.detectorPromise===null&&n.scheduled===null))return async()=>{n.scheduled!==null&&U(n,r);let s=n.promise;for(;n.detector===null&&s!==null&&(await s,n.promise!==s);)s=n.promise;return n.detector!==null?Le(n.detector):L({v3AssetBaseUrl:r})}}var be=new Set(["inuse","overconstrained","notfound"]),Me=[500,1500];function Ae(e){switch(e){case"fcv3.no_face":case"fcv3.center_face":case"fcv3.straighten":return"center";case"fcv3.come_closer":return"closer";case"fcv3.move_back":return"farther";case"fcv3.more_light":case"fcv3.too_bright":return"light";case"fcv3.hold_still":case"fcv3.steady_camera":return"still";case"fcv3.hold_upright":return"upright";case"fcv3.one_face":return"one_face";default:return null}}function Pe(e){switch(e){case"preflight":case"acquiring":return"starting";case"positioning":return"gating";default:return e}}function ue(e){switch(e){case"permission":case"notfound":case"inuse":case"insecure":case"unsupported":return e;case"backcamera":return"notfound";default:{let r=e;return"generic"}}}function we(e,r,n){if(n===void 0)return{kind:ue(e),retryable:r};let s=J(n.name);return{kind:ue(e),retryable:r,detail:{...s!==void 0?{name:s}:{},phase:n.phase,engineKind:e}}}var _e=new Set(["captured","uploading","checking"]);function De(e,r={},n,s=()=>"self",m=()=>{},u){let c=r.now??(()=>performance.now()),d=r.canChooseFacing??ne,f="user",C=se(),p=s(),l=re(),V=!j(),G=r.engineOptions,ce=G?.createDetector===void 0&&G?.createWorker===void 0?{createDetector:()=>{let t=de(e.assetBaseUrl);return t!==void 0?t():L({v3AssetBaseUrl:e.assetBaseUrl})}}:{},z={video:e.video,mode:V?"photo":"clip",rankKeyframes:n,facingMode:void 0,v3AssetBaseUrl:e.assetBaseUrl,screenRamp:()=>p==="self"&&l.count("ramp")>0?m():void 0,...r.engineOptions??{},...ce},a=r.createEngine?.(z)??new te(z),v="idle",M=null,A=0,R=!1,T="full",P=null,w=null,O=0,x=0,W=()=>{e.video.videoWidth>0&&e.video.videoHeight>0&&(O=e.video.videoWidth,x=e.video.videoHeight)},q=oe({enabled:e.keepScreenAwake!==!1}),S=t=>{v=t,q.setActive(t==="starting"||t==="gating"||t==="recording"),l.emit("state",t)},F=()=>l.emit("gate",{progress:A,hint:M,faceDetected:R}),I=()=>{let t=a.animations??"full";t!==T&&(T=t,l.emit("profile",{animations:T}))},g=0,_=null,le=r.schedule??((t,o)=>{let i=setTimeout(t,o);return()=>clearTimeout(i)}),E=()=>{_?.(),_=null},fe=(t,o)=>{if(y||!be.has(t)||o?.phase!=="acquiring")return!1;let i=Me[g];return i===void 0?!1:(g+=1,E(),_=le(()=>{_=null,y||a.retry()},i),!0)},pe=[a.on("statechange",({state:t})=>{if(t==="error")return;let o=Pe(t);o==="gating"&&(g=0),o==="starting"&&v!=="starting"&&(M=null,A=0,R=!1,P=null,w=null,O=0,x=0),S(o),I(),o==="recording"&&(W(),P=c(),M="hold",A=1,F())}),a.on("checks",t=>{W(),A=t.progress,R=t.factors.presence>0,F(),I()}),a.on("guidance",({key:t})=>{M=Ae(t),F()}),a.on("frozen",({previewDataUrl:t})=>{w=c(),l.emit("frozen",{previewDataUrl:t})}),a.on("ramp",t=>l.emit("ramp",t)),a.on("artifacts",t=>{if(v!=="captured")return;let o=Z(),i=t.clipStats,Q=i!==void 0?Math.round(i.durationMs):P!==null&&w!==null?Math.max(0,Math.round(w-P)):void 0,Y=i!==void 0&&i.frames>1&&i.durationMs>0?Math.round(i.frames*1e4/i.durationMs)/10:void 0;l.emit("captured",{keyframe:t.keyframe,...t.clip!==void 0?{clip:t.clip}:{},...t.clipMimeType!==void 0?{clipMime:t.clipMimeType}:{},width:e.video.videoWidth||O,height:e.video.videoHeight||x,...Q!==void 0?{clipMs:Q}:{},...i!==void 0?{clipFrames:i.frames}:{},...Y!==void 0?{fps:Y}:{},...t.clipRetakes!==void 0?{clipRetakes:t.clipRetakes}:{},...t.clipMimeType!==void 0?{codec:X(t.clipMimeType)}:{},captureChannel:o==="desktop"?"desktop":"mobile",formFactor:o,...V?{degraded:"NO_RECORDER"}:{},engine:"v3",facingMode:a.facingMode,mode:p,...t.timing,...t.screenRamp!==void 0?{screenRamp:t.screenRamp}:{},...t.provenance!==void 0?{provenance:t.provenance}:{}})}),a.on("error",({kind:t,retryable:o,detail:i})=>{t==="backcamera"&&me()||fe(t,i)||(S("error"),I(),l.emit("error",we(t,o,i)))})],N=!1;function me(){return y||N||p!=="assisted"||u===void 0||u.session()!=="choice"?!1:(N=!0,u.onModeChange("self"),p="self",f=B("self"),S("mode_switch"),a.restart(f),!0)}let $=async()=>u!==void 0&&u.session()==="choice"&&await d().catch(()=>!1),y=!1;return{handle:{get state(){return v},get captureMode(){return s()},get facingMode(){return a.facingMode??f},on:(t,o)=>l.on(t,o),start:t=>(p=s(),C.facing(p,e.facing),f=C.facing(p,t?.facing),E(),g=0,a.start({facingMode:f})),retry:()=>{E(),g=0,a.retry()},switchCamera:()=>C.refuseSwitch(s()),canSwitchCaptureMode:$,setCaptureMode:async t=>{if(t===s()||!await $()||y||_e.has(v)||u===void 0)return!1;u.onModeChange(t),p=t;let o=B(t);return f=o,v==="idle"||(S("mode_switch"),E(),g=0,a.restart(o)),!0},destroy:()=>{y=!0,E();for(let t of pe)t();q.setActive(!1),a.destroy(),l.clear()}},setFlowState:t=>{v!==t&&S(t)}}}function Ze(e){return De(e).handle}export{ve as a,ie as b,Te as c,Oe as d,xe as e,Fe as f,Ie as g,Be as h,de as i,Ae as j,Pe as k,ue as l,we as m,De as n,Ze as o};
@@ -1 +1 @@
1
- import{d as x}from"./chunk-PW2HWXBJ.js";import{b}from"./chunk-FPXL63KZ.js";var T=480,y=Object.freeze({MIN_AREA_FRAC:.15,EDGE_CLIP_MARGIN_PX:4,STABLE_TICKS:3,IOU_STABLE_MIN:.85,RISE_PER_S:.9,FALL_PER_S:.25,GUIDE_EXPOSURE:.6,GUIDE_SHARPNESS:.35,ID3_BAND_MIN_WIDTH_FRAC:.55,ID3_BAND_ASPECT_MIN:4,ID3_BAND_ASPECT_MAX:40}),p=e=>Math.min(1,Math.max(0,e));function E(e,o,t){let n=[e.topLeft,e.topRight,e.bottomRight,e.bottomLeft],i=0;for(let s=0;s<4;s++){let r=n[s],c=n[(s+1)%4];i+=r.x*c.y-c.x*r.y}let a=o*t;return a>0?Math.abs(i/2)/a:0}function I(e,o){let t=D(e),n=D(o),i=Math.max(t.x1,n.x1),a=Math.max(t.y1,n.y1),s=Math.min(t.x2,n.x2),r=Math.min(t.y2,n.y2),c=Math.max(0,s-i)*Math.max(0,r-a),u=(t.x2-t.x1)*(t.y2-t.y1),_=(n.x2-n.x1)*(n.y2-n.y1),m=u+_-c;return m>0?c/m:0}function R(e){let o=D(e);return{width:o.x2-o.x1,height:o.y2-o.y1}}function D(e){let o=[e.topLeft,e.topRight,e.bottomRight,e.bottomLeft];return{x1:Math.min(...o.map(t=>t.x)),y1:Math.min(...o.map(t=>t.y)),x2:Math.max(...o.map(t=>t.x)),y2:Math.max(...o.map(t=>t.y))}}function M(e){let o=Math.hypot(e.topRight.x-e.topLeft.x,e.topRight.y-e.topLeft.y),t=Math.hypot(e.bottomRight.x-e.bottomLeft.x,e.bottomRight.y-e.bottomLeft.y),n=Math.hypot(e.bottomLeft.x-e.topLeft.x,e.bottomLeft.y-e.topLeft.y),i=Math.hypot(e.bottomRight.x-e.topRight.x,e.bottomRight.y-e.topRight.y),a=(o+t)/2,s=(n+i)/2;return a<=0||s<=0?0:Math.max(a,s)/Math.min(a,s)}var d=class{constructor(o,t={}){this.p=0;this.lastTickAt=null;this.lastQuad=null;this.streak=0;this.format=o,this.t={...y,...t}}reset(){this.p=0,this.lastTickAt=null,this.lastQuad=null,this.streak=0}tick(o){let{quad:t,quality:n,timestampMs:i}=o,a=this.lastTickAt===null?0:Math.max(0,(i-this.lastTickAt)/1e3);this.lastTickAt=i;let s=null;if(t===null)s="dcv1.no_doc";else if(this.format==="ID-3"){let h=R(t),f=h.height>0?h.width/h.height:0;h.width<this.t.ID3_BAND_MIN_WIDTH_FRAC*o.frameWidth?s="dcv1.come_closer":this.edgeClipped(t,o.frameWidth,o.frameHeight)?s="dcv1.fit_document":(f<this.t.ID3_BAND_ASPECT_MIN||f>this.t.ID3_BAND_ASPECT_MAX)&&(s="dcv1.wrong_shape")}else E(t,o.frameWidth,o.frameHeight)<this.t.MIN_AREA_FRAC?s="dcv1.come_closer":this.edgeClipped(t,o.frameWidth,o.frameHeight)?s="dcv1.fit_document":x(this.format,M(t))||(s="dcv1.wrong_shape");let r=s===null,c=p(n.exposure)>=this.t.GUIDE_EXPOSURE,u=p(n.sharpness)>=this.t.GUIDE_SHARPNESS,_=c&&u;if(r&&_&&t!==null){let h=this.lastQuad===null||I(t,this.lastQuad)>=this.t.IOU_STABLE_MIN;this.streak=h?this.streak+1:1}else this.streak=0;this.lastQuad=t;let m=r&&_;this.p=p(this.p+(m?this.t.RISE_PER_S:-this.t.FALL_PER_S)*a);let A=m&&this.streak>=this.t.STABLE_TICKS,l;if(s!==null)l=s;else if(c)u?l="dcv1.hold_still":l="dcv1.steady";else{let h=(b[0]+b[1])/2;l=n.meanLuma<h?"dcv1.more_light":"dcv1.too_bright"}return{at:i,quad:t,plausible:r,p:this.p,guidanceKey:l,ready:A,stableTicks:this.streak}}edgeClipped(o,t,n){let i=this.t.EDGE_CLIP_MARGIN_PX;return[o.topLeft,o.topRight,o.bottomRight,o.bottomLeft].some(s=>s.x<=i||s.y<=i||s.x>=t-i||s.y>=n-i)}};export{T as a,y as b,E as c,I as d,R as e,d as f};
1
+ import{d as x}from"./chunk-5AR5GTEJ.js";import{b}from"./chunk-FPXL63KZ.js";var T=480,y=Object.freeze({MIN_AREA_FRAC:.15,EDGE_CLIP_MARGIN_PX:4,STABLE_TICKS:3,IOU_STABLE_MIN:.85,RISE_PER_S:.9,FALL_PER_S:.25,GUIDE_EXPOSURE:.6,GUIDE_SHARPNESS:.35,ID3_BAND_MIN_WIDTH_FRAC:.55,ID3_BAND_ASPECT_MIN:4,ID3_BAND_ASPECT_MAX:40}),p=e=>Math.min(1,Math.max(0,e));function E(e,o,t){let n=[e.topLeft,e.topRight,e.bottomRight,e.bottomLeft],i=0;for(let s=0;s<4;s++){let r=n[s],c=n[(s+1)%4];i+=r.x*c.y-c.x*r.y}let a=o*t;return a>0?Math.abs(i/2)/a:0}function I(e,o){let t=D(e),n=D(o),i=Math.max(t.x1,n.x1),a=Math.max(t.y1,n.y1),s=Math.min(t.x2,n.x2),r=Math.min(t.y2,n.y2),c=Math.max(0,s-i)*Math.max(0,r-a),u=(t.x2-t.x1)*(t.y2-t.y1),_=(n.x2-n.x1)*(n.y2-n.y1),m=u+_-c;return m>0?c/m:0}function R(e){let o=D(e);return{width:o.x2-o.x1,height:o.y2-o.y1}}function D(e){let o=[e.topLeft,e.topRight,e.bottomRight,e.bottomLeft];return{x1:Math.min(...o.map(t=>t.x)),y1:Math.min(...o.map(t=>t.y)),x2:Math.max(...o.map(t=>t.x)),y2:Math.max(...o.map(t=>t.y))}}function M(e){let o=Math.hypot(e.topRight.x-e.topLeft.x,e.topRight.y-e.topLeft.y),t=Math.hypot(e.bottomRight.x-e.bottomLeft.x,e.bottomRight.y-e.bottomLeft.y),n=Math.hypot(e.bottomLeft.x-e.topLeft.x,e.bottomLeft.y-e.topLeft.y),i=Math.hypot(e.bottomRight.x-e.topRight.x,e.bottomRight.y-e.topRight.y),a=(o+t)/2,s=(n+i)/2;return a<=0||s<=0?0:Math.max(a,s)/Math.min(a,s)}var d=class{constructor(o,t={}){this.p=0;this.lastTickAt=null;this.lastQuad=null;this.streak=0;this.format=o,this.t={...y,...t}}reset(){this.p=0,this.lastTickAt=null,this.lastQuad=null,this.streak=0}tick(o){let{quad:t,quality:n,timestampMs:i}=o,a=this.lastTickAt===null?0:Math.max(0,(i-this.lastTickAt)/1e3);this.lastTickAt=i;let s=null;if(t===null)s="dcv1.no_doc";else if(this.format==="ID-3"){let h=R(t),f=h.height>0?h.width/h.height:0;h.width<this.t.ID3_BAND_MIN_WIDTH_FRAC*o.frameWidth?s="dcv1.come_closer":this.edgeClipped(t,o.frameWidth,o.frameHeight)?s="dcv1.fit_document":(f<this.t.ID3_BAND_ASPECT_MIN||f>this.t.ID3_BAND_ASPECT_MAX)&&(s="dcv1.wrong_shape")}else E(t,o.frameWidth,o.frameHeight)<this.t.MIN_AREA_FRAC?s="dcv1.come_closer":this.edgeClipped(t,o.frameWidth,o.frameHeight)?s="dcv1.fit_document":x(this.format,M(t))||(s="dcv1.wrong_shape");let r=s===null,c=p(n.exposure)>=this.t.GUIDE_EXPOSURE,u=p(n.sharpness)>=this.t.GUIDE_SHARPNESS,_=c&&u;if(r&&_&&t!==null){let h=this.lastQuad===null||I(t,this.lastQuad)>=this.t.IOU_STABLE_MIN;this.streak=h?this.streak+1:1}else this.streak=0;this.lastQuad=t;let m=r&&_;this.p=p(this.p+(m?this.t.RISE_PER_S:-this.t.FALL_PER_S)*a);let A=m&&this.streak>=this.t.STABLE_TICKS,l;if(s!==null)l=s;else if(c)u?l="dcv1.hold_still":l="dcv1.steady";else{let h=(b[0]+b[1])/2;l=n.meanLuma<h?"dcv1.more_light":"dcv1.too_bright"}return{at:i,quad:t,plausible:r,p:this.p,guidanceKey:l,ready:A,stableTicks:this.streak}}edgeClipped(o,t,n){let i=this.t.EDGE_CLIP_MARGIN_PX;return[o.topLeft,o.topRight,o.bottomRight,o.bottomLeft].some(s=>s.x<=i||s.y<=i||s.x>=t-i||s.y>=n-i)}};export{T as a,y as b,E as c,I as d,R as e,d as f};
@@ -0,0 +1 @@
1
+ import{c as g}from"./chunk-U5TL63CG.js";import{c as _}from"./chunk-TSA6GHUG.js";import{a as b,c as y}from"./chunk-COZXZAD5.js";var I=["session_token_invalid","session_token_required","session_token_session_mismatch","session_not_found","rate_limit_exceeded","consent_required","session_not_active","check_not_found","check_already_finalized","check_out_of_order","check_type_unsupported","force_outcome_forbidden","attestation_invalid","platform_unregistered","app_attest_invalid","too_many_challenges","inference_unavailable","mobile_required","nni_locked","document_nni_mismatch","media_content_type_not_allowed","media_too_large","media_key_invalid","media_key_forbidden","media_not_found","media_unreadable","media_session_invalid","idempotency_key_collision","idempotency_in_progress","idempotency_key_required","validation_error","internal_error","unknown_error","upload_failed","network_error","timeout","nfc_outcome_not_accepted","identity_confirm_required","identity_confirm_locked","choice_not_found","choice_locked","choice_option_unavailable","step_not_on_path","check_not_active","sekyro_app_not_allowed","sekyro_app_unverified","id_number_locked","document_id_number_mismatch","simulated_capture_forbidden","native_app_required"];function q(i){return I.includes(i)}var u=class extends Error{constructor(e){super(e.message),this.name="HostedApiError",this.status=e.status,this.code=e.code,e.retryAfterSeconds!==void 0&&(this.retryAfterSeconds=e.retryAfterSeconds),e.details&&(this.details=e.details)}};function T(i,e,n=Math.random){let t=(i??e)*1e3,s=Math.min(Math.max(t,500),2e4),o=Math.round(s*(1+(n()*2-1)*.25));return Math.min(Math.max(o,500),2e4)}var w=6e4,h=4,E=3e4,P=9e5,M=200,C=5,A=400,v=new Set(["server_busy","request_timeout"]),O=20,N=60,H=600,x=2;function l(i){return(i.split(";")[0]??"").trim()}var D={liveness:"clipKey",face_match:"imageKey",doc_ocr:"imageKey"},U=`@sekyro/web/${b}`,K=U,S=class{constructor(e){this.sessionId=null;this.bootstrap=null;this.captureNonces=[];this.captureFetch=null;this.reportedIssues=new Map;this.issueReports=0;this.issuesPausedUntil=0;this.apiOrigin=e.apiOrigin.replace(/\/+$/,""),this.sessionToken=e.sessionToken;let n=e.fetch;this.fetchImpl=(t,s)=>(n??globalThis.fetch).call(globalThis,t,s),this.requestTimeoutMs=e.requestTimeoutMs??E,this.retryAttempts=e.inProgressRetry?.attempts??C,this.retryDelayMs=e.inProgressRetry?.delayMs??A,this.random=e.random??Math.random,this.clientLocale=e.locale}async getSession(){let e=await this.api("GET","/hosted/session");return this.sessionId=e.sessionId,e}async recordConsent(e){let n=await this.api("POST","/hosted/consent",{body:{locale:e},busyRetry:!0}),t=this.captureHold;return this.captureHold=void 0,t&&this.armCapture(t),n}async reportCameraUnavailable(e){return this.api("POST","/hosted/camera-unavailable",{body:{cause:e}})}async testerGate(e){return this.api("POST","/hosted/tester-gate",{body:{input:e}})}async reportCaptureIssue(e){let n=typeof e.name=="string"?e.name.replace(/[^A-Za-z]/g,"").slice(0,40):"",t=typeof e.engineKind=="string"&&/^[a-z_]{1,32}$/.test(e.engineKind)?e.engineKind:void 0,s=typeof e.attempt=="number"&&Number.isInteger(e.attempt)&&e.attempt>=0&&e.attempt<=1e3?e.attempt:void 0,o=e.check==="attestation"?s??"":"",r=[e.check,o,e.kind,n,e.phase??"",t??""].join("|"),c=this.reportedIssues.get(r);if(c!==void 0)return c;if(Date.now()<this.issuesPausedUntil||this.issueReports>=O)return;let a={check:e.check,kind:e.kind,...n!==""?{name:n}:{},...e.phase!==void 0?{phase:e.phase}:{},...t!==void 0?{engineKind:t}:{},...s!==void 0?{attempt:s}:{},...e.formFactor!==void 0?{formFactor:e.formFactor}:{},...typeof e.detail=="string"&&/^\d{1,10}$/.test(e.detail)?{detail:e.detail}:{},...k(e.challengeMs)?{challengeMs:e.challengeMs}:{},...k(e.readyMs)?{readyMs:e.readyMs}:{},...e.inApp===!0?{inApp:!0}:{}};this.issueReports+=1;let p=this.api("POST","/hosted/capture-issue",{body:a,empty:!0}).catch(d=>{if(d instanceof u&&d.status===429){let m=Math.min(Math.max(d.retryAfterSeconds??N,0),H);this.issuesPausedUntil=Math.max(this.issuesPausedUntil,Date.now()+m*1e3);return}(!(d instanceof u)||d.status===0||d.status>=500)&&this.reportedIssues.delete(r)});return this.reportedIssues.set(r,p),p}async choose(e,n){let t=await this.api("POST","/hosted/choice",{body:{nodeId:e,option:n},busyRetry:!0});return this.sessionId=t.sessionId,t}async confirmIdentity(e){return this.api("POST","/hosted/identity/confirm",{body:{decision:e}})}async identityPortrait(){return this.api("GET","/hosted/identity/portrait",{blob:!0})}async presign(e,n,t,s={}){let o=await this.ensureSessionId(),r={kind:e,contentType:l(n),contentLength:t,...s.source==="upload"?{source:"upload"}:{}};return this.api("POST",`/sessions/${o}/media`,{body:r})}armCapture(e=2){let n=Date.now();this.captureNonces.filter(t=>t.expiresAt-w>n).length>=e||(this.captureHold===void 0?this.fillCaptureNonces(e,e):this.captureHold=Math.max(this.captureHold,e))}async armRamp(){try{let e=await this.ensureSessionId(),n=await this.api("POST",`/sessions/${e}/media/capture-nonces`,{body:{count:2,ramp:!0}}),t=Date.now(),s=g(n.screenRamp)?n.screenRamp:void 0,o=t+Math.max(0,n.expiresIn)*1e3;for(let c of Array.isArray(n.nonces)?n.nonces:[])typeof c!="string"||c.length===0||this.captureNonces.push({nonce:c,expiresAt:o,...s!==void 0?{arm:s.nonce}:{}});this.captureNonces=this.captureNonces.slice(-h),this.captureHold=void 0;let r=typeof n.rampExpiresIn=="number"&&n.rampExpiresIn>0?n.rampExpiresIn:0;return{...s!==void 0?{challenge:s}:{},expiresAt:t+r*1e3}}catch{return}}async presignCapture(e,n,t,s={}){let o=await this.ensureSessionId(),r=await this.takeCaptureNonce(s.arm),c=r===void 0?void 0:{nonce:r,...s.engine!==void 0?{engine:s.engine.slice(0,32)}:{},...s.durationMs!==void 0&&Number.isFinite(s.durationMs)?{captureMs:Math.min(36e5,Math.max(0,Math.round(s.durationMs)))}:{}},a={kind:e,contentType:l(n),contentLength:t,capture:c};return this.api("POST",`/sessions/${o}/media`,{body:a})}async takeCaptureNonce(e){let n=()=>{let t=Date.now();this.captureNonces=this.captureNonces.filter(o=>o.expiresAt-w>t);let s=this.captureNonces.findIndex(o=>o.arm===e);return this.captureNonces.splice(s<0?0:s,1)[0]?.nonce};for(let t=0;t<2;t++){let s=n();if(s!==void 0)return s;await this.fillCaptureNonces(1)}return n()}fillCaptureNonces(e,n=0){return this.captureFetch??(this.captureFetch=(async()=>{try{let t=await this.ensureSessionId(),s=await this.api("POST",`/sessions/${t}/media/capture-nonces`,{body:{count:Math.min(h,Math.max(1,e))}}),o=Date.now()+Math.max(0,s.expiresIn)*1e3;for(let r of Array.isArray(s.nonces)?s.nonces:[])typeof r=="string"&&r.length>0&&this.captureNonces.push({nonce:r,expiresAt:o});this.captureNonces=this.captureNonces.slice(-h),this.captureHold=void 0}catch(t){t instanceof u&&t.code==="consent_required"&&(this.captureHold=Math.max(this.captureHold??0,n))}})().finally(()=>{this.captureFetch=null})),this.captureFetch}async uploadToSpaces(e,n,t){let s;try{s=await this.fetchImpl(e,{method:"PUT",headers:{"content-type":l(t)},body:n,signal:AbortSignal.timeout(P)})}catch(o){throw f(o)}if(!s.ok){let o=(await s.text().catch(()=>"")).slice(0,M);throw new u({status:s.status,code:"upload_failed",message:`media upload failed (HTTP ${s.status})${o?`: ${o}`:""}`})}}async completeMedia(e){let n=await this.ensureSessionId();return this.api("POST",`/sessions/${n}/media/complete`,{body:{key:e}})}async submitCheck(e,n,t={}){let s=await this.ensureSessionId(),o={input:n,forceOutcome:t.forceOutcome};return this.api("POST",`/sessions/${s}/checks/${e}`,{body:o,idempotencyKey:t.idempotencyKey,...t.browserCheckToken!==void 0?{browserCheckToken:t.browserCheckToken}:{},busyRetry:t.idempotencyKey!==void 0})}async uploadAndSubmit(e,n,t,s={}){let o=l(n.contentType),r=await this.presign(n.kind,o,n.blob.size);await this.uploadToSpaces(r.uploadUrl,n.blob,o);let c=await this.completeMedia(r.key),a={...t,[D[e]]:c.key};return this.submitCheck(e,a,s)}async ensureSessionId(){return this.sessionId!==null?this.sessionId:(this.bootstrap??(this.bootstrap=this.getSession().finally(()=>{this.bootstrap=null})),(await this.bootstrap).sessionId)}async api(e,n,t={}){let s=e==="GET"||t.busyRetry===!0,o=`${this.apiOrigin}/api/v2${n}`,r={"x-session-token":this.sessionToken,"x-sekyro-sdk":K};t.body!==void 0&&(r["content-type"]="application/json"),t.idempotencyKey!==void 0&&(r["x-idempotency-key"]=t.idempotencyKey),t.browserCheckToken!==void 0&&(r["sekyro-browser-check"]=t.browserCheckToken),this.clientLocale!==void 0&&(r["sekyro-client-locale"]=this.clientLocale);try{let c=y.timezone();c!==void 0&&(r["sekyro-client-timezone"]=c)}catch{}r["sekyro-client-form-factor"]=_();try{let c=await y.deviceHeader();c!==void 0&&(r["sekyro-client-device"]=c)}catch{}for(let c=0;;c++){let a;try{a=await this.fetchImpl(o,{method:e,headers:r,...t.body!==void 0?{body:JSON.stringify(t.body)}:{},cache:"no-store",signal:AbortSignal.timeout(this.requestTimeoutMs)})}catch(d){throw f(d)}if(a.ok){if(t.empty===!0)return;if(t.blob===!0)try{return await a.blob()}catch(m){throw f(m)}let d;try{d=await a.json()}catch{throw new u({status:a.status,code:"unknown_error",message:`response body was not valid JSON (HTTP ${a.status})`})}return L(d)}let p=await V(a);if(p.code==="idempotency_in_progress"&&c<this.retryAttempts){this.retryDelayMs>0&&await R(this.retryDelayMs);continue}if(s&&p.status===503&&v.has(p.code)){s=!1,await R(T(p.retryAfterSeconds,x,this.random));continue}throw p}}};function k(i){return typeof i=="number"&&Number.isInteger(i)&&i>=0&&i<=6e5}function f(i){if((typeof i=="object"&&i!==null?i.name:void 0)==="TimeoutError")return new u({status:0,code:"timeout",message:"request timed out"});let n=i instanceof Error?i.message:String(i);return new u({status:0,code:"network_error",message:`network request failed: ${n}`})}function L(i){return i!==null&&typeof i=="object"&&"success"in i&&"data"in i?i.data:i}async function V(i){let e="unknown_error",n=`request failed (HTTP ${i.status})`,t=Number.NaN,s;try{let c=await i.json();if(c!==null&&typeof c=="object"){let a=c;typeof a.code=="string"&&a.code.length>0&&(e=a.code),typeof a.message=="string"&&a.message.length>0&&(n=a.message),typeof a.retryAfterSeconds=="number"&&(t=a.retryAfterSeconds),Array.isArray(a.details?.issues)?s=a.details:Array.isArray(a.details?.errors)&&(s={...a.details,issues:[]})}}catch{}let o=i.headers.get("retry-after"),r=o===null?Math.floor(t):Number.parseInt(o,10);return new u({status:i.status,code:e,message:n,...Number.isFinite(r)&&r>=0?{retryAfterSeconds:r}:{},details:s})}function R(i){return new Promise(e=>setTimeout(e,i))}function J(i){let e=i?.portrait,n=e?.icao,t=e?.purpose==="id_document";return n==null?t?{policy:"reject",profile:"id_document"}:null:{policy:n.policy==="alert"?"alert":"reject",profile:t||n.profile==="id_document"?"id_document":"selfie"}}function Q(i){return{...i.baselineEyeOpenness!==void 0?{baselineEyeOpenness:i.baselineEyeOpenness}:{},...i.baselineEyeOpennessLeft!==void 0&&i.baselineEyeOpennessRight!==void 0?{baselineEyeOpennessLeft:i.baselineEyeOpennessLeft,baselineEyeOpennessRight:i.baselineEyeOpennessRight}:{},criteria:i.verdict??{},...i.backgroundCheck!==void 0?{backgroundCheck:i.backgroundCheck}:{}}}export{I as a,q as b,u as c,T as d,l as e,U as f,S as g,J as h,Q as i};
@@ -0,0 +1 @@
1
+ var A=["magenta","yellow","green","blue"];var E={magenta:"rgb(255, 72, 150)",yellow:"rgb(255, 190, 0)",green:"rgb(0, 238, 175)",blue:"rgb(25, 150, 255)",dark:"rgb(0, 0, 0)"};function P(l){return E[l]}var T=4,v=4,R=l=>typeof l=="number"&&Number.isFinite(l);function _(l){if(typeof l!="object"||l===null)return!1;let e=l;if(typeof e.nonce!="string"||e.nonce.length===0||!Array.isArray(e.colours)||e.colours.length<1||e.colours.length>8||!e.colours.every(r=>A.includes(r))||!Array.isArray(e.onsetsMs)||e.onsetsMs.length!==e.colours.length)return!1;let o=-1;for(let r of e.onsetsMs){if(!R(r)||r<0||r<=o)return!1;o=r}return!(!R(e.holdMs)||e.holdMs<=0||!R(e.endMs)||e.endMs<=o||!R(e.clipMs)||e.clipMs<e.endMs||e.clipMs>8e3)}function O(l,e){return _(l)?Math.max(e,Math.ceil(l.clipMs)):e}function w(l,e){let o=e.now??(()=>performance.now()),r=_(l)?l:void 0,a=[],u=null,d=null,M=null,i=!1,m=null,s=n=>{m=n;try{e.paint(n)}catch{}},p=n=>{let t=e.frames?.()??null;return t!==null&&M!==null?t.mediaTimeMs+(n-t.presentationTimeMs)-M:n-(d??n)},f=(n,t,c=0)=>{if(i)return;let g=Math.max(0,n-p(o()));u=setTimeout(()=>{if(u=null,!i){if(c<T&&p(o())<n-v){f(n,t,c+1);return}t()}},g)},S=n=>{if(r===void 0)return;let t=r.endMs;if(n>=r.colours.length){f(t,()=>s(null));return}let c=r.onsetsMs[n],g=n+1<r.onsetsMs.length?r.onsetsMs[n+1]:t;f(c,()=>{let h=p(o());if(h>t){m!==null&&s(null);return}let b=r.colours[n];s(b);let y=a.length===0?0:a[a.length-1].tMs;a.push({tMs:Math.max(y,Math.round(h)),colour:b});let C=c+r.holdMs;if(C<g){f(C,()=>{if(p(o())>t){m!==null&&s(null);return}s("dark"),S(n+1)});return}S(n+1)})};return{started(n){if(r===void 0||i||d!==null)return;d=n;let t=e.frames?.()??null;M=t===null?null:t.mediaTimeMs+(n-t.presentationTimeMs),S(0)},stop(){i||(i=!0,u!==null&&clearTimeout(u),u=null,m!==null&&s(null))},report(){return r===void 0?void 0:{nonce:r.nonce,rendered:[...a]}}}}export{A as a,P as b,_ as c,O as d,w as e};
@@ -0,0 +1 @@
1
+ import{c as P,d as H,e as A}from"./chunk-TQQK7464.js";var z=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function be(e){return z.has(e)}function ve(e,n,t){let i=n.detail;return{check:e,kind:n.kind,...i?.name!==void 0?{name:i.name}:{},...i?.phase!==void 0?{phase:i.phase}:{},...i?.engineKind!==void 0?{engineKind:i.engineKind}:{},attempt:Math.max(0,Math.min(1e3,t))}}function Pe(){let e=-1,n="";return{note(t){t==="starting"&&n!=="starting"&&(e+=1),n=t},newHandle(){n=""},noteError(){e<0&&(e=0)},get value(){return e}}}var j={document:"document_photo",nfc:"document_chip",population_registry:"national_number",national_eid:"national_eid"};function f(e){return e.plan?.steps??[]}function x(e){return Math.max(0,e.attempts.max-e.attempts.used)}function W(e){let n=e.plan?.choice;return n!==void 0&&e.plan?.current===n.nodeId?n:null}function Me(e){let n=W(e);if(n?.kind!=="identity_method")return null;let t=n.options.map(r=>j[r.service]).filter(r=>r!==void 0),i=n.options.find(r=>r.nationalEid)?.nationalEid;return i?{available:!0,selected:null,options:t,nationalEid:i}:{available:!0,selected:null,options:t}}var G=new Set(["liveness","face_match"]);function y(e){return e!==void 0&&(e.state==="pending"||e.state==="input_required")}function T(e){return e.status!=="created"&&e.status!=="in_progress"}function M(e){let n=e.plan?.current,t=n==null?void 0:f(e).find(i=>i.id===n);return y(t)?t:void 0}function _(e,n){return f(e).find(t=>t.checkType===n)}function S(e){let n=f(e),t=n.findIndex(i=>i.checkType==="liveness");return n.find((i,r)=>r>t&&i.checkType==="face_match")}function F(e,n){let t=_(n,"liveness")?.state,i=S(n)?.state;return(S(e)?.state??"pending")==="pending"&&(t==="passed"||t==="review")&&i!==void 0&&i!=="pending"&&i!=="skipped"}function V(e,n){let t=new Map(f(e).map(i=>[i.id,i.state]));return f(n).filter(i=>i.checkType==="face_match"&&(t.get(i.id)??"pending")==="pending"&&i.state!=="pending"&&i.state!=="skipped").map(i=>i.id)}var X=/^[0-9a-f]{24}$/i;function R(e){return X.test(e)?`ses_${e}`:e}function w(e,n){let t=R(e);return n===void 0?{sessionId:t,status:"unavailable"}:{sessionId:t,status:"unavailable",reasonCode:n}}function O(e,n,t){let i=R(e);return t===void 0?{sessionId:i,status:n}:{sessionId:i,status:n,reasonCode:t}}function Ve(e,n){let t=Z(e,n),i=Q(e);return i!==void 0&&(t.sandbox={simulated:!0,reason:i}),t}var J=new Set(["no_testers","tester_gate_not_used","tester_gate_missed"]);function Q(e){if(e.sandbox!==!0)return;let n=e.simulation?.reason;return J.has(n)?n:void 0}function Z(e,n){let t=R(e.sessionId);switch(e.status){case"created":case"in_progress":return re(e,n);case"verified":return b(e,{sessionId:t,status:"verified"});case"review_pending":return b(e,O(t,"review",L(e,"review")));case"not_verified":return b(e,ne(e));default:return b(e,{sessionId:t,status:"not_verified"})}}var ee=new Set([0,1,2,3]);function b(e,n){return ee.has(e.level)&&(n.level=e.level),typeof e.assurance=="string"&&e.assurance.length>0&&(n.assurance=e.assurance),n}function ne(e){let n={sessionId:R(e.sessionId),status:"not_verified"};return e.reason!==void 0&&(n.reason=e.reason),e.reasonCode!==void 0&&(n.reasonCode=e.reasonCode),e.reasonCode==="device_cooldown"&&e.retryAfter!==void 0&&(n.retryAfter=e.retryAfter),n}function te(e){return e==="rejected"?"rejected":e==="unavailable"?"unavailable":"inconclusive"}function ie(e,n){if(n===void 0)return!1;let t=f(n).find(i=>i.id===e.id);return t!==void 0&&t.attempts.used===e.attempts.used}function re(e,n){let t=R(e.sessionId),i=f(e).find(o=>G.has(o.checkType)&&o.state==="input_required"&&o.reason!==void 0);if(i?.reason==="mobile_required")return w(t,"mobile_required");if(i?.reason!==void 0){if(i.result==="unavailable")return w(t,i.reason);let u=n.autoRetry&&(x(i)>0||ie(i,n.previous))?{sessionId:t,status:"retry",reasonCode:i.reason,attemptsRemaining:x(i)}:{sessionId:t,status:"not_verified",reason:te(i.result),reasonCode:i.reason,attemptsRemaining:x(i)};return i.retakeHint!==void 0&&(u.retakeHint=i.retakeHint),u}let r=M(e);return r===void 0&&f(e).some(o=>o.state==="review")?O(t,"review",L(e,"review")):r?.checkType==="portrait_icao"?w(t,"portrait_required"):w(t)}function L(e,n){return f(e).find(t=>t.state===n&&t.reason!==void 0)?.reason}function K(e,n,t,i,r){return e.presignCapture!==void 0?e.presignCapture(n,t,i,r):e.presign(n,t,i)}function q(e){return{engine:e?.engine,durationMs:e?.clipMs,arm:e?.screenRamp?.nonce}}var oe=["video/webm","video/mp4"],N="image/jpeg",se=2,ae=1e3,ue=1e4,de=3,ce=10,le=3,pe=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),fe=new Set(["session_not_active","check_not_found","check_already_finalized","check_out_of_order","identity_confirm_required","check_not_active","step_not_on_path","native_app_required"]),k=class extends Error{constructor(){super("verification destroyed"),this.name="FlowCancelledError"}};function me(e){let n=S(e);return _(e,"portrait_icao")?.state!=="pending"&&(n!==void 0?y(n):e.capture?.livePhoto?.oneCapture===!0)}var h=class extends Error{constructor(n){super(n),this.name="AttestationError"}},E=class extends h{constructor(n){super(`no attestation token: ${n}`),this.name="AttestationUnavailableError",this.code=n}};async function D(e,n,t={}){let i=e.uuid(),r=!1,o=!1,u=0,p=0;for(;;)try{return await n(e.client,i)}catch(s){if(s instanceof h){if(o||s instanceof E)throw s;o=!0,t.onAttestationInvalid?.(),i=e.uuid();continue}if(!(s instanceof P))throw s;if(s.code==="consent_required"&&!r){r=!0,await e.ensureConsent({force:!0}),i=e.uuid();continue}if(s.code==="attestation_invalid"&&!o){o=!0,t.onAttestationInvalid?.(),i=e.uuid();continue}if(s.code==="inference_unavailable"&&p<de){p+=1;let a=H(s.retryAfterSeconds,ce,e.random??Math.random);e.onBusy?.({attempt:p,retryAfterSeconds:a/1e3}),await e.sleep(a),t.onAttestationInvalid?.(),i=e.uuid();continue}if(pe.has(s.code)&&u<se){u+=1;let a=s.retryAfterSeconds!==void 0?s.retryAfterSeconds*1e3:void 0;await e.sleep(a!==void 0?Math.min(a,ue):ae);continue}throw s}}var he=new Set(["passed","review","processing","skipped"]);async function Fe(e){let{artifacts:n}=e,t=n.clip,i=A(n.clipMime??"");if(n.degraded==="NO_RECORDER"||t===void 0||!oe.includes(i))return{kind:"unavailable",reason:"no_recorder"};e.client.armCapture?.(2);let r=_e(e,n.keyframe),o=ge(e,t,i,r),u=Se(e,r),p=!1,s=new Set,a=!0,C=0;for(;;){if(e.isCancelled())return{kind:"cancelled"};let c=e.getView();if(T(c))return{kind:"settled"};let d=M(c),g=d?.checkType,v=g==="liveness"&&!p?"liveness":g==="face_match"&&!s.has(d?.id)&&s.size<2&&a?"face_match":null;if(v===null)return{kind:"settled"};if(v==="liveness"&&n.captureChannel==="desktop")return{kind:"unavailable",reason:"mobile_required"};try{if(v==="liveness"){p=!0;let l=await o();if(e.isCancelled())return{kind:"cancelled"};F(c,l)&&s.add(S(l)?.id);for(let Y of V(c,l))s.add(Y);await e.applySubmit(l,"liveness");let m=_(e.getView(),"liveness")?.state;a=m===void 0||he.has(m)}else{s.add(d?.id);let l=await u();if(e.isCancelled())return{kind:"cancelled"};for(let m of V(c,l))s.add(m);await e.applySubmit(l,"face_match")}}catch(l){if(e.isCancelled()||l instanceof k)return{kind:"cancelled"};let m=Ce(l);if(m.kind!=="resync"||C>=le)return m;C+=1,await e.refreshView()}}}function _e(e,n){let t=null,i=null,r=()=>t!==null?Promise.resolve(t):(i??(i=(async()=>{let o=await K(e.client,"image",N,n.size,q(e.artifacts));return await e.client.uploadToSpaces(o.uploadUrl,n,N),t=(await e.client.completeMedia(o.key)).key,e.onKeyframePromoted?.(t),t})().finally(()=>{i=null})),i);return{ensure:r,attempt:()=>r().catch(()=>null),current:()=>t}}function ge(e,n,t,i){let r=e.clipKeys?.get()??null,o,u=null,p=0,s;return()=>D(e,async(a,C)=>{if(r===null||o===void 0){if(e.isCancelled())throw new k;o===void 0&&!me(e.getView())&&(o=null),e.onPhase("uploading");let[c,d]=await Promise.all([r!==null?Promise.resolve(r):(async()=>{let g=await K(a,"clip",t,n.size,q(e.artifacts));return await a.uploadToSpaces(g.uploadUrl,n,t),(await a.completeMedia(g.key)).key})(),o!==void 0?Promise.resolve(o===null?null:o.imageKey):i.attempt()]);r=c,e.clipKeys?.set(c),o===void 0&&(o=d===null?null:{imageKey:d})}if(u===null){let c=performance.now();try{u=await e.getAttestation(),s=e.attestationError?.()}catch(d){throw d instanceof h?d:new h(d instanceof Error?d.message:String(d))}p=Math.round(performance.now()-c)}return e.onPhase("checking"),a.submitCheck("liveness",{clipKey:r,attestation:u,captureChannel:e.artifacts.captureChannel,capture:{...ye(e.artifacts),attestationMs:p,attestationError:s,...ke(e.attestationFacts?.())},...o!==null?{faceMatch:o}:{}},{idempotencyKey:C})},{onAttestationInvalid:()=>{u=null}})}function Se(e,n){return()=>D(e,async(t,i)=>{if(n.current()===null){if(e.isCancelled())throw new k;e.onPhase("uploading")}let r=await n.ensure();return e.onPhase("checking"),t.submitCheck("face_match",{imageKey:r},{idempotencyKey:i})})}function ye(e){let n={width:e.width,height:e.height};for(let t of Re)e[t]!==void 0&&(n[t]=e[t]);return n}var Re=["engine","facingMode","mode","formFactor","clipMs","clipFrames","fps","clipRetakes","codec","cameraReadyMs","faceAcquireMs","captureMs","screenRamp","provenance"];function ke(e){return e===void 0?{}:{attestationChecks:e.checks,...e.challengeMs!==void 0?{attestationChallengeMs:e.challengeMs}:{}}}function Ce(e){if(e instanceof h)return{kind:"unavailable",reason:"attestation"};if(e instanceof P){if(e.code==="attestation_invalid")return{kind:"unavailable",reason:"attestation"};if(e.code==="inference_unavailable")return{kind:"unavailable",reason:"inference_unavailable"};if(e.code==="mobile_required")return{kind:"unavailable",reason:"mobile_required"};if(fe.has(e.code))return{kind:"resync"}}return{kind:"unavailable",reason:"network"}}var Le="form_answers_invalid",U=class extends Error{constructor(n,t){super(`form answers refused (${n.map(i=>`${i.id}: ${i.code}`).join(", ")})`),this.name="FormAnswersError",this.issues=n,this.source=t}};var B=class extends Error{constructor(n,t){super(`invalid ${n} (${t})`),this.name="InvalidInputError",this.field=n,this.kind=t}},$=class extends Error{constructor(n,t){super(`invalid ${n} (${t})`),this.name="OtpInputError",this.field=n,this.kind=t}};function I(e){return e?.source==="upload"?null:e?.source==="choice"&&e.sourcePick!=="camera"?"upload_or_phone":"phone"}function De(e,n){if(n===void 0||!y(n)||n.requiresMobile!==!0)return null;switch(n.checkType){case"liveness":return"phone";case"face_match":{if(n.reason!==void 0)return"phone";let t=_(e,"portrait_icao");return t?.state==="passed"||t?.state==="review"?null:"phone"}case"doc_ocr":return I(e.documents);case"poa":return I(e.proofOfAddress);case"portrait_icao":{let t=e.portrait;return t?.pendingFix!==void 0||t?.reuse?.pending===!0?null:I(t)}default:return null}}function we(e){let n=e?.capture,t=n?.mode;return t==="assisted"||t==="self"||t==="choice"?t:n?.cameraSwitch===!0?"assisted":"self"}function Be(e){let n=e?.capture?.pick;return we(e)==="choice"&&(n==="self"||n==="assisted")?n:null}function $e(e,n,t=null){return e==="choice"?n??t??"self":e}var ze={"MR:drivers_license":{normalize:"upper_no_space_or_hyphen",pattern:"^[0-9]{8}$",check:null,registrySources:[],describe:"number must be the 8-digit Mauritanian driver's license number"},"MR:national_id":{normalize:"trim",pattern:"^[0-9]{10}$",check:"mr_nni_mod97",registrySources:["MR.anrpts"],describe:"number must be the 10-digit Mauritanian national ID number with a valid check digit"}};export{be as a,ve as b,Pe as c,j as d,f as e,x as f,W as g,Me as h,y as i,T as j,M as k,_ as l,R as m,w as n,Ve as o,Q as p,De as q,we as r,Be as s,$e as t,K as u,oe as v,se as w,ae as x,de as y,ce as z,h as A,E as B,D as C,Fe as D,ye as E,Le as F,U as G,ze as H,B as I,$ as J};
@@ -1 +1 @@
1
- var x=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 M(s,o){let r=s.lineBoxes;if(r.length===0)return{lineCount:0,detected:!1,fill:0,offsetX:0,offsetY:0,centers:[]};let i=Math.min(...r.map(n=>n[0])),e=Math.max(...r.map(n=>n[0]+n[2])),t=Math.min(...r.map(n=>n[1])),l=Math.max(...r.map(n=>n[1]+n[3]));return{lineCount:r.length,detected:r.length>=o.minLines,fill:e-i,offsetX:(i+e)/2-.5,offsetY:(t+l)/2-.5,centers:r.map(n=>[n[0]+n[2]/2,n[1]+n[3]/2])}}function p(s,o){if(s.centers.length===0||o.centers.length===0)return Number.POSITIVE_INFINITY;let r=0;for(let[i,e]of o.centers){let t=Number.POSITIVE_INFINITY;for(let[l,n]of s.centers)t=Math.min(t,Math.hypot(i-l,e-n));r+=t}return r/o.centers.length}var y=class{constructor(o=x){this.t=o;this.last=null;this.goodSince=null;this.steadySince=null;this.frames=0}offer(o,r,i={glareOk:!0,sharpOk:!0}){let e=this.t,t=M(o,e),l=this.last;this.last=t;let n=t.fill>=e.fillMin&&t.fill<=e.fillMax,u=Math.abs(t.offsetX)<=e.offsetMax&&Math.abs(t.offsetY)<=e.offsetMax,d=l!==null&&l.detected&&Math.abs(t.lineCount-l.lineCount)<=e.lineCountDelta&&p(l,t)<=e.layoutShiftMax,m=t.detected&&i.glareOk&&i.sharpOk&&n&&d&&l!==null&&Math.abs(t.fill-l.fill)<=e.steadyFillDelta&&Math.abs(t.offsetX-l.offsetX)<=e.steadyOffsetDelta&&Math.abs(t.offsetY-l.offsetY)<=e.steadyOffsetDelta,c=m&&u,h=t.detected?i.glareOk?t.fill<e.fillMin?"closer":t.fill>e.fillMax?"farther":u?i.sharpOk?void 0:"blurry":"center":"glare":void 0;return m?(this.frames++,this.steadySince??(this.steadySince=r),this.goodSince=c?this.goodSince??r:null,(this.goodSince!==null&&r-this.goodSince>=e.lockMs||r-this.steadySince>=e.steadyMs)&&this.frames>=e.minFrames?{state:"locked"}:{state:"locking",...h?{hint:h}:{}}):(this.goodSince=null,this.steadySince=null,this.frames=t.detected?1:0,{state:t.detected?"locking":"searching",...h?{hint:h}:{}})}reset(){this.last=null,this.goodSince=null,this.steadySince=null,this.frames=0}};function g(s,o,r){let i=e=>Math.round(Math.min(1,Math.max(0,e))*1e4)/1e4;return s.map(e=>{let t=[e[0],e[2],e[4],e[6]],l=[e[1],e[3],e[5],e[7]],n=Math.min(...t),u=Math.min(...l);return[i(n/o),i(u/r),i((Math.max(...t)-n)/o),i((Math.max(...l)-u)/r)]}).sort((e,t)=>e[1]-t[1]||e[0]-t[0])}function S(s,o){if(!Number.isFinite(s)||s<0)return"low";if(s<=150)return"high";let r=typeof o!="number"||!Number.isFinite(o)||o>3;return s<=400&&r?"mid":"low"}var L=Object.freeze({low:Object.freeze({stride:1,bandWidthPx:960}),mid:Object.freeze({stride:2,bandWidthPx:1280}),high:Object.freeze({stride:1,bandWidthPx:1280})});function O(s=globalThis){let o=s.navigator?.deviceMemory;return typeof o=="number"&&Number.isFinite(o)&&o>0?o:null}function _(){let r=new Uint8Array(1228800).fill(255),i=24301,e=()=>(i=i*1103515245+12345&2147483647,i/2147483647),t=(d,m)=>{let c=(m*960+d)*4;r[c]=20,r[c+1]=20,r[c+2]=20},l=20,n=14,u=28;for(let d of[110,190])for(let m=0;m<44;m++){let c=40+m*l;if(e()<.25){for(let a=0;a<n/2;a++)for(let f=0;f<2;f++)t(c+n/2-a,d+u/2-a+f),t(c+n/2-a,d+u/2+a+f);continue}let h=Math.floor(e()*(n-3));for(let a=0;a<u;a++)for(let f=0;f<3;f++)t(c+h+f,d+a);for(let a of[0,u/2-1,u-3])if(!(e()<.4))for(let f=0;f<n;f++)for(let b=0;b<3;b++)t(c+f,d+a+b)}return{rgba:r,width:960,height:320}}export{x as a,y as b,g as c,S as d,L as e,O as f,_ as g};
1
+ var x=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 M(s,o){let r=s.lineBoxes;if(r.length===0)return{lineCount:0,detected:!1,fill:0,offsetX:0,offsetY:0,centers:[]};let i=Math.min(...r.map(n=>n[0])),e=Math.max(...r.map(n=>n[0]+n[2])),t=Math.min(...r.map(n=>n[1])),l=Math.max(...r.map(n=>n[1]+n[3]));return{lineCount:r.length,detected:r.length>=o.minLines,fill:e-i,offsetX:(i+e)/2-.5,offsetY:(t+l)/2-.5,centers:r.map(n=>[n[0]+n[2]/2,n[1]+n[3]/2])}}function p(s,o){if(s.centers.length===0||o.centers.length===0)return Number.POSITIVE_INFINITY;let r=0;for(let[i,e]of o.centers){let t=Number.POSITIVE_INFINITY;for(let[l,n]of s.centers)t=Math.min(t,Math.hypot(i-l,e-n));r+=t}return r/o.centers.length}var y=class{constructor(o=x){this.t=o;this.last=null;this.goodSince=null;this.steadySince=null;this.frames=0}offer(o,r,i={glareOk:!0,sharpOk:!0}){let e=this.t,t=M(o,e),l=this.last;this.last=t;let n=t.fill>=e.fillMin&&t.fill<=e.fillMax,u=Math.abs(t.offsetX)<=e.offsetMax&&Math.abs(t.offsetY)<=e.offsetMax,d=l!==null&&l.detected&&Math.abs(t.lineCount-l.lineCount)<=e.lineCountDelta&&p(l,t)<=e.layoutShiftMax,m=t.detected&&i.glareOk&&i.sharpOk&&n&&d&&l!==null&&Math.abs(t.fill-l.fill)<=e.steadyFillDelta&&Math.abs(t.offsetX-l.offsetX)<=e.steadyOffsetDelta&&Math.abs(t.offsetY-l.offsetY)<=e.steadyOffsetDelta,c=m&&u,h=t.detected?i.glareOk?t.fill<e.fillMin?"closer":t.fill>e.fillMax?"farther":u?i.sharpOk?void 0:"blurry":"center":"glare":void 0;return m?(this.frames++,this.steadySince??(this.steadySince=r),this.goodSince=c?this.goodSince??r:null,(this.goodSince!==null&&r-this.goodSince>=e.lockMs||r-this.steadySince>=e.steadyMs)&&this.frames>=e.minFrames?{state:"locked"}:{state:"locking",...h?{hint:h}:{}}):(this.goodSince=null,this.steadySince=null,this.frames=t.detected?1:0,{state:t.detected?"locking":"searching",...h?{hint:h}:{}})}reset(){this.last=null,this.goodSince=null,this.steadySince=null,this.frames=0}};function g(s,o,r){let i=e=>Math.round(Math.min(1,Math.max(0,e))*1e4)/1e4;return s.map(e=>{let t=[e[0],e[2],e[4],e[6]],l=[e[1],e[3],e[5],e[7]],n=Math.min(...t),u=Math.min(...l);return[i(n/o),i(u/r),i((Math.max(...t)-n)/o),i((Math.max(...l)-u)/r)]}).sort((e,t)=>e[1]-t[1]||e[0]-t[0])}function L(s,o){if(!Number.isFinite(s)||s<0)return"low";if(s<=150)return"high";let r=typeof o!="number"||!Number.isFinite(o)||o>3;return s<=400&&r?"mid":"low"}var _=Object.freeze({low:Object.freeze({stride:1,bandWidthPx:960}),mid:Object.freeze({stride:2,bandWidthPx:1280}),high:Object.freeze({stride:1,bandWidthPx:1280})}),O=3e3;function S(s=globalThis){let o=s.navigator?.deviceMemory;return typeof o=="number"&&Number.isFinite(o)&&o>0?o:null}function T(){let r=new Uint8Array(1228800).fill(255),i=24301,e=()=>(i=i*1103515245+12345&2147483647,i/2147483647),t=(d,m)=>{let c=(m*960+d)*4;r[c]=20,r[c+1]=20,r[c+2]=20},l=20,n=14,u=28;for(let d of[110,190])for(let m=0;m<44;m++){let c=40+m*l;if(e()<.25){for(let a=0;a<n/2;a++)for(let f=0;f<2;f++)t(c+n/2-a,d+u/2-a+f),t(c+n/2-a,d+u/2+a+f);continue}let h=Math.floor(e()*(n-3));for(let a=0;a<u;a++)for(let f=0;f<3;f++)t(c+h+f,d+a);for(let a of[0,u/2-1,u-3])if(!(e()<.4))for(let f=0;f<n;f++)for(let b=0;b<3;b++)t(c+f,d+a+b)}return{rgba:r,width:960,height:320}}export{x as a,y as b,g as c,L as d,_ as e,O as f,S as g,T as h};
@@ -0,0 +1 @@
1
+ import{d as ae,h as _e,i as Ae,j as Be,l as Ie}from"./chunk-MQHTFHSN.js";import{a as oe,e as Te,g as Le}from"./chunk-5AR5GTEJ.js";import{m as J}from"./chunk-QTOMWAS6.js";import{a as Re,g as Pe}from"./chunk-7QZWBDI5.js";import{k as re}from"./chunk-CPUECYAJ.js";import{d as Oe,g as Ee}from"./chunk-WNBEOK5Q.js";function Fe(e,t){let n=new Set(e.flatMap(o=>o.sides.filter(i=>i[t]!==null).map(i=>i.side)));return n.size===1?[...n][0]:null}function pt(e){let t=Te.find(o=>o.docType===e),n=t.mrz==="none"?null:t.mrz==="td3"?"single":"verso";return{sides:t.sides,format:Le(e),mrz:t.mrz==="none"?"none":"required",mrzSide:n,barcodeSide:null,portraitSide:t.portraitSide,scripts:null}}function ft(e){let t=[];for(let n of e)for(let o of n.sides){if(!Array.isArray(o.scripts))return null;for(let i of o.scripts)t.includes(i)||t.push(i)}return t}function We(e,t){if(t.length===0)return pt(e);let n=t.some(u=>u.sides.length>1),o=new Set(t.map(u=>u.format)),i=o.size===1?[...o][0]:"card",l=t.filter(u=>u.sides.some(m=>m.mrz!==null)).length,s=t.find(u=>u.sides.length>1===n)?.sides.find(u=>u.portrait)?.side;return{sides:n?["recto","verso"]:["single"],format:i,mrz:l===t.length?"required":l===0?"none":"optional",mrzSide:Fe(t,"mrz"),barcodeSide:Fe(t,"barcode"),portraitSide:s??(n?"recto":"single"),scripts:ft(t)}}function ze(e,t){if(e===void 0)return[];let n=e.toUpperCase();return Object.prototype.hasOwnProperty.call(oe,n)?oe[n]?.[t]??[]:[]}async function Ue(e,t,n){return await e(t)?n:n==="recto"?"verso":"recto"}function Ne(e,t,n){return e!==t&&t==="verso"&&n.recto!==void 0&&n.verso===void 0?"verso":e}var gt={low:{maxLongEdge:1920,payloadTargetBytes:7e5,qMin:.7,qMax:.92},mid:{maxLongEdge:2240,payloadTargetBytes:12e5,qMin:.7,qMax:.92},good:{maxLongEdge:2560,payloadTargetBytes:16e5,qMin:.7,qMax:.92}};function ht(e){let{deviceMemory:t,effectiveType:n,saveData:o,downlinkMbps:i,sourceLongEdge:l}=e,s=o===!0||n==="slow-2g"||n==="2g"||i!=null&&i>0&&i<1,u=t!=null&&t<=2,m=n==="4g"||i!=null&&i>=5,c=t!=null&&t>=6,b;s||u?b="low":m&&c?b="good":b="mid";let f=gt[b],L=l&&l>0?Math.min(f.maxLongEdge,l):f.maxLongEdge;return{tier:b,...f,maxLongEdge:L}}function Ge(e){let t={};try{let n=navigator;typeof n.deviceMemory=="number"&&(t.deviceMemory=n.deviceMemory);let o=n.connection;o&&(t.effectiveType=o.effectiveType,t.saveData=o.saveData,t.downlinkMbps=o.downlink)}catch{}return typeof e=="number"&&e>0&&(t.sourceLongEdge=e),ht(t)}function bt(e,t,n){let o=Math.min(1,Math.max(0,(e-.28)/.21999999999999997)),i=(t+n)/2;return Math.max(t,n-o*(n-i))}function St(e,t,n){let o=Math.max(e,t),i=o>0?Math.min(1,n/o):1;return{width:Math.max(1,Math.round(e*i)),height:Math.max(1,Math.round(t*i))}}async function yt(e,t){let n=t.startQ,o=await e(n);for(let i=0;i<4&&!(o.size<=t.budgetBytes||n<=t.qMin);i++)n=Math.max(t.qMin,n-.08),o=await e(n);return{blob:o,quality:n}}async function qe(e,t,n,o,i){if(t<=0||n<=0)return null;let{width:l,height:s}=St(t,n,o.maxLongEdge),u=document.createElement("canvas");u.width=l,u.height=s;let m=u.getContext("2d");if(!m)return null;m.drawImage(e,0,0,l,s);let c=k=>new Promise((S,v)=>{u.toBlob(p=>p?S(p):v(new Error("canvas toBlob returned null")),"image/jpeg",k)}),b=bt(i,o.qMin,o.qMax),{blob:f,quality:L}=await yt(c,{startQ:b,qMin:o.qMin,budgetBytes:o.payloadTargetBytes}).finally(()=>{u.width=0,u.height=0});if(f.size>5242880)throw new Error("encoded document exceeds the 5242880-byte media cap");return{blob:f,quality:L,width:l,height:s}}async function ie(e){let t=Ge(Math.max(e.width,e.height)),n=await qe(e,e.width,e.height,t,.5);if(n===null)throw new Error("canvas encode unavailable");return{blob:n.blob,width:n.width,height:n.height}}async function Ht(e){let t=await createImageBitmap(e);try{return await ie(t)}finally{t.close()}}var Yt=250,Vt=.6,Qt=1800,Kt=6e3,jt=2e3,He=.16;function ue(e,t){return{layout:e,phase:"framing",captured:{},pending:[],lastCaptureAt:t,lastReportAt:t,manualShutter:!1,restPhase:"framing",readSides:[],needFlip:!1,flipped:!1,flipTimeoutSpent:!1,timeoutCapture:!1,lastShotByTimeout:!1}}var Xe=e=>e==="recto"?"verso":"recto",Ye=e=>e.phase==="framing"||e.phase==="locking"||e.phase==="flipCue"||e.phase==="reaskRecto",le=e=>(e.captured.recto!==void 0?1:0)+(e.captured.verso!==void 0?1:0)+e.pending.length;function se(e,t){return e.lastCaptureAt>=0&&e.lastReportAt>=0?e:{...e,lastCaptureAt:e.lastCaptureAt<0?t:e.lastCaptureAt,lastReportAt:e.lastReportAt<0?t:e.lastReportAt}}function Mt(e,t,n){if(e.phase==="result")return{...e,lastReportAt:n};let o=!t.present||e.captureArea!==void 0&&t.areaFrac<.6*e.captureArea,{flipped:i,awaySince:l}=e;o&&(l=l??n),l!==void 0&&n-l>=250&&(i=!0),o||(l=void 0);let s=e.flipTimeoutSpent&&!(i&&!e.flipped),u=e.notice==="same_face"&&i&&!e.flipped?void 0:e.notice,m={...e,lastReportAt:n,flipped:i,awaySince:l,flipTimeoutSpent:s,notice:u,lastArea:t.areaFrac};if(!Ye(e))return m;if(e.needFlip&&!i){if(!t.ready)return{...m,phase:e.restPhase,goodSince:void 0};let c=e.lastShot!==void 0&&e.pending.includes(e.lastShot);if(s||c)return{...m,goodSince:void 0,phase:e.restPhase};let b=e.goodSince??n;return n-b>=1800?{...m,goodSince:b,phase:"capturing",flipTimeoutSpent:!0,timeoutCapture:!0}:{...m,goodSince:b,phase:e.restPhase}}return t.ready?{...m,phase:"capturing",goodSince:e.goodSince??n}:{...m,goodSince:void 0,phase:t.locking?"locking":e.restPhase}}function Dt(e,t){if(!Ye(e)||e.manualShutter)return e;let n=t-e.lastReportAt>=2e3,o=t-e.lastCaptureAt>=6e3;return n||o?{...e,manualShutter:!0}:e}function wt(e,t,n){let o=e.layout==="singlePage",i=o?{recto:t}:e.captured,l=o?[]:[...e.pending,t],s={...e,captured:i,pending:l,lastShot:t,lastCaptureAt:n,lastReportAt:-1,manualShutter:!1,goodSince:void 0,notice:void 0,awaySince:void 0,flipped:!1,lastShotByTimeout:e.timeoutCapture,timeoutCapture:!1,captureArea:e.lastArea};return o||le({captured:i,pending:l})>=2?{...s,phase:"reading",restPhase:"framing",current:void 0,needFlip:!1}:{...s,phase:"flipCue",restPhase:"flipCue",current:void 0,needFlip:!0}}function Ve(e,t,n){return e.pending.includes(t)?{...e,pending:e.pending.filter(o=>o!==t),lastShot:e.lastShot===t?void 0:e.lastShot,phase:e.phase==="capturing"?e.phase:"flipCue",restPhase:"flipCue",current:Xe(n),needFlip:!0,flipTimeoutSpent:!1,goodSince:void 0,manualShutter:!0,notice:"same_face",lastCaptureAt:-1,lastReportAt:-1}:e}function kt(e,t,n){if(!e.pending.includes(t))return e;if(e.captured[n]!==void 0)return Ve(e,t,n);let o=e.pending.filter(m=>m!==t),i={...e,pending:o,captured:{...e.captured,[n]:t}};if(le(i)!==1||e.layout==="singlePage")return i;let l=Xe(n),s=l==="recto"&&e.restPhase==="reaskRecto"?"reaskRecto":"flipCue",u=e.phase==="flipCue"||e.phase==="reaskRecto"||e.phase==="framing";return{...i,restPhase:s,current:l,phase:u?s:e.phase}}function Ct(e,t){let n=t.id??e.captured[t.side],o={...e.captured};(t.id===void 0||o[t.side]===t.id)&&delete o[t.side];let i=e.pending.filter(c=>c!==n),l=e.layout==="twoSided"&&le({captured:o,pending:i})>0,s=e.lastShotByTimeout||n===e.lastShot!==e.flipped,u=l&&!s,m=u?t.side==="recto"?"reaskRecto":"flipCue":"framing";return{...e,captured:o,pending:i,readSides:e.readSides.filter(c=>c!==t.side),lastShot:e.lastShot===n?void 0:e.lastShot,notice:t.issue,goodSince:void 0,manualShutter:!1,phase:m,restPhase:m,current:t.side,needFlip:u,flipped:!1,flipTimeoutSpent:!1,awaySince:void 0,lastCaptureAt:-1,lastReportAt:-1}}function Qe(e,t){switch(t.type){case"report":return Mt(se(e,t.at),t.report,t.at);case"tick":return Dt(se(e,t.at),t.at);case"captured":return wt(se(e,t.at),t.id,t.at);case"captureFailed":return{...e,phase:e.restPhase,goodSince:void 0,lastCaptureAt:t.at,manualShutter:!0,timeoutCapture:!1};case"classified":return kt(e,t.id,t.side);case"duplicate":return Ve(e,t.id,t.side);case"readOk":{let n=e.readSides.includes(t.side)?e.readSides:[...e.readSides,t.side],o=["recto","verso"].filter(l=>e.captured[l]!==void 0),i=e.phase==="reading"&&e.pending.length===0&&o.every(l=>n.includes(l));return{...e,readSides:n,flipTimeoutSpent:!1,phase:i?"result":e.phase}}case"readFailed":return Ct(e,t);case"clockRestart":return e.lastCaptureAt<0&&e.lastReportAt<0&&e.awaySince===void 0?e:{...e,awaySince:void 0,lastCaptureAt:-1,lastReportAt:-1};case"retake":return{...ue(e.layout,-1),lastCaptureAt:-1,lastReportAt:-1};default:return e}}function xt(e,t,n=!1){let o=e(t);return o===null?"recto":!n||o.y+o.height/2>=t.height/2?"verso":"recto"}async function vt(e,t=!1){let{detectMrzBand:n}=await import("./mrz-band-VYHOTDHY.js");return xt(n,e,t)}async function ce(e,t=480,n,o=n!=null){let i=n??{x:0,y:0,width:e.width,height:e.height},l=Math.max(1,Math.round(i.height/i.width*t)),s=document.createElement("canvas");s.width=t,s.height=l;try{let u=s.getContext("2d");return u===null?"recto":(u.drawImage(e,i.x,i.y,i.width,i.height,0,0,t,l),await vt(u.getImageData(0,0,t,l),o))}finally{s.width=0,s.height=0}}async function Jt(e,t=480){try{let n=await createImageBitmap(e),o=Math.max(1,Math.round(n.height/n.width*t)),i=document.createElement("canvas");i.width=t,i.height=o;let l=i.getContext("2d");return l===null?(n.close(),null):(l.drawImage(n,0,0,t,o),n.close(),l.getImageData(0,0,t,o))}catch{return null}}var de=(e,t,n)=>Math.min(n,Math.max(t,Math.round(e))),Z=e=>Math.round(Math.min(1,Math.max(0,e))*1e4)/1e4;async function Ke(e,t,n,o){let i=o.decode??(m=>createImageBitmap(m)),l=async()=>e.stillRead(await i(t),o.region??[0,0,1,1],o.detectorLimit),s;try{s=await l()}catch{try{await new Promise(m=>setTimeout(m,o.retryMs??300)),s=await l()}catch{return null}}let u=s.mrzBox;return u===void 0?null:{engine:o.engine,source:"live_mrz",format:n.format,lineCount:de(n.lineCount,2,3),checkDigitsValid:!0,stillConfirmed:s.valid&&s.digest===n.digest,band:[Z(u[0]),Z(u[1]),Z(Math.min(u[2],1-u[0])),Z(Math.min(u[3],1-u[1]))],digest:n.digest,framesToValid:de(n.framesToValid,1,1e3),msToValid:de(n.msToValid,0,12e4)}}function en(e){let t=null;return e?.then(n=>{t=n}),()=>t}var Rt=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]),Pt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,6,64,11,11]);function je(e=globalThis){let t=e.WebAssembly?.validate;if(typeof t!="function")return{ok:!1,reason:"simd"};try{if(!t.call(e.WebAssembly,Rt)||!t.call(e.WebAssembly,Pt))return{ok:!1,reason:"simd"}}catch{return{ok:!1,reason:"simd"}}return typeof e.Worker!="function"?{ok:!1,reason:"worker"}:typeof e.createImageBitmap!="function"?{ok:!1,reason:"bitmap"}:{ok:!0}}function $e(e=globalThis){let t=e.navigator?.connection;return t?.saveData===!0||["slow-2g","2g","3g"].includes(t?.effectiveType??"")}var E=class extends Error{constructor(t){super(t),this.name="OcrEngineError",this.code=t}};function Je(){let e=t=>(t.close(),Promise.reject(new E("unsupported")));return{ready:Promise.resolve("unsupported"),busy:!1,bandRead:e,stillRead:e,layoutRead:e,dispose:()=>{}}}function Ze(e){let t;try{if(e.createWorker)t=e.createWorker();else if(e.workerUrl!==void 0)t=new Worker(e.workerUrl,{type:"module",name:"sekyro-ocr"});else return Je()}catch{return Je()}let n=new Map,o=0,i=!1,l=!1,s=!1;t.addEventListener("message",p=>{let g=p.data,M=n.get(g.id);M&&(n.delete(g.id),M.resolve(g))});let u=()=>{for(let p of n.values())p.reject(new E("error"));n.clear(),c()};t.addEventListener("error",u),t.addEventListener("messageerror",u);function m(p,g=[]){if(i)return Promise.reject(new E("disposed"));let M=++o;return new Promise((I,z)=>{n.set(M,{resolve:I,reject:z});try{t.postMessage({...p,id:M},g)}catch{n.delete(M),z(new E("error"))}})}function c(){if(!i){i=!0;try{t.postMessage({id:++o,kind:"dispose"})}catch{}t.terminate();for(let p of n.values())p.reject(new E("disposed"));n.clear()}}let b=(async()=>{let p=await m({kind:"init",baseUrl:e.baseUrl,salt:e.salt,detectorLimit:e.tuning.detectorLimit,maxDownloadMs:e.tuning.maxDownloadMs});if(p.kind==="failed")return p.reason;if(p.kind!=="ready")return"error";let g=await m({kind:"warmup"});if(g.kind!=="ready")return"error";let M=g.benchMs??g.warmupMs,I=e.deviceMemoryGb===void 0?Ee():e.deviceMemoryGb;return{warmupMs:g.warmupMs,downloadMs:p.downloadMs,cached:p.cached,benchMs:M,tier:Oe(M,I)}})().catch(()=>"error"),f,L=new Promise(p=>{f=setTimeout(()=>p("timeout"),e.tuning.loadTimeoutMs)}),k=Promise.race([b,L]).then(p=>(clearTimeout(f),typeof p=="string"?c():s=!0,i&&typeof p!="string"?"error":p));(e.page===void 0?globalThis.addEventListener?globalThis:null:e.page)?.addEventListener("pagehide",c,{once:!0});async function v(p,g,M){if(i)throw g.close(),new E("disposed");if(!s)throw g.close(),new E("not_ready");if(l)throw g.close(),new E("busy");l=!0;let I;try{let z=new Promise((N,G)=>{I=setTimeout(()=>{G(new E("timeout")),c()},e.tuning.readTimeoutMs??1e4)}),B=await Promise.race([m(p,[g]),z]);if(B.kind===M){let{id:N,...G}=B;return G}throw new E(B.kind==="error"?B.code:B.kind==="failed"?B.reason:"error")}finally{clearTimeout(I),l=!1}}return{ready:k,get busy(){return l},bandRead:(p,g=e.tuning.detectorLimit)=>v({kind:"band",bitmap:p,detectorLimit:g},p,"band"),stillRead:(p,g,M=e.tuning.detectorLimit)=>v({kind:"still",bitmap:p,region:g,detectorLimit:M},p,"band"),layoutRead:(p,g)=>v({kind:"layout",bitmap:p,detectorLimit:g},p,"layout"),dispose:c}}var V="sekyro-ocr-1",me=e=>e!==null&&typeof e=="object"?e:{},O=(e,t,n,o)=>typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n?e:o,et=(e,t)=>typeof e=="boolean"?e:t,tt=e=>{let t=typeof e=="string"?/^sekyro-ocr-(\d{1,4})$/.exec(e):null;return t?Number(t[1]):Number.POSITIVE_INFINITY};function nt(e,t={}){let n=me(e),o=me(n.liveMrz),i=me(n.frontLock),l=tt(t.engine??V),s=t.mode==="off",u=p=>p.enabled===!0?p.arm==="live"?"live":"control":null,m=u(o),c=u(i),b=(p,g)=>!s&&g==="live"&&tt(p.minEngine??V)<=l,f=Be,L=b(o,m)?{detectorLimit:O(o.detectorLimit,320,1600,f.detectorLimit),bandMaxWidthPx:O(o.bandMaxWidthPx,320,4096,f.bandMaxWidthPx),minBandWidthPx:O(o.minBandWidthPx,0,4096,f.minBandWidthPx),bandTop:O(o.bandTop,0,.95,f.bandTop),minIntervalMs:O(o.minIntervalMs,0,5e3,f.minIntervalMs),stableReads:Math.round(O(o.stableReads,1,10,f.stableReads)),profileReads:Math.round(O(o.profileReads,1,100,f.profileReads)),maxReadMs:O(o.maxReadMs,50,6e4,f.maxReadMs),searchTimeoutMs:O(o.searchTimeoutMs,1e3,12e4,f.searchTimeoutMs),hint:et(o.hint,!0),stillConfirm:et(o.stillConfirm,!0)}:null,k=Ae,S=(p,g,M)=>O(i[p],g,M,k[p]),v=b(i,c)?{minLines:Math.round(S("minLines",1,50)),fillMin:S("fillMin",0,1),fillMax:S("fillMax",0,2),offsetMax:S("offsetMax",0,1),steadyFillDelta:S("steadyFillDelta",0,1),steadyOffsetDelta:S("steadyOffsetDelta",0,1),layoutShiftMax:S("layoutShiftMax",0,1),lineCountDelta:Math.round(S("lineCountDelta",0,50)),lockMs:S("lockMs",0,3e4),steadyMs:S("steadyMs",0,3e4),minFrames:Math.round(S("minFrames",1,100)),minIntervalMs:S("minIntervalMs",0,5e3),maxWidthPx:S("maxWidthPx",160,2048),detectorLimit:S("detectorLimit",320,1600),searchTimeoutMs:S("searchTimeoutMs",1e3,12e4)}:null;return{enabled:L!==null||v!==null,liveMrz:L,textLock:v,liveMrzArm:m,frontLockArm:c,load:{detectorLimit:L?.detectorLimit??v?.detectorLimit??f.detectorLimit,loadTimeoutMs:O(o.loadTimeoutMs,1e3,12e4,2e4),maxDownloadMs:O(o.maxDownloadMs,1e3,12e4,2e4)},reportSampleRate:O(o.reportSampleRate,0,1,1)}}function rt(e,t){return e.enabled?!(t.probe??je)().ok||(t.slow??$e)()?{ok:!1,reason:"unsupported"}:{ok:!0,engine:Ze({baseUrl:t.baseUrl,salt:t.salt,tuning:{detectorLimit:e.load.detectorLimit,maxDownloadMs:e.load.maxDownloadMs,loadTimeoutMs:e.load.loadTimeoutMs},...t.workerUrl!==void 0?{workerUrl:t.workerUrl}:{},...t.createWorker!==void 0?{createWorker:t.createWorker}:{},...t.page!==void 0?{page:t.page}:{},...t.deviceMemoryGb!==void 0?{deviceMemoryGb:t.deviceMemoryGb}:{}})}:{ok:!1,reason:"off"}}function Tt(e=typeof navigator<"u"?navigator.userAgent:""){return/SamsungBrowser\//.test(e)?"samsung":/Firefox\/|FxiOS\//.test(e)?"firefox":/Chrome\/|CriOS\/|Chromium\//.test(e)&&!/Edg\/|OPR\//.test(e)?"chrome":/Safari\//.test(e)&&/Version\/|Mobile\//.test(e)&&!/Chrome\/|CriOS\//.test(e)?"safari":"other"}var W=e=>e===void 0||!Number.isFinite(e)?void 0:Math.min(6e5,Math.max(0,Math.round(e))),pe=(e,t,n)=>e===void 0||!Number.isFinite(e)?void 0:Math.min(n,Math.max(t,Math.round(e)));function ot(e){let t=e.assist??null,n=e.load!==null&&e.load!==void 0&&typeof e.load=="object"?e.load:null,o=typeof e.load=="string"?e.load:null,i=t!==null?t.outcome:o==="unsupported"||o==="download"||o==="integrity"?o:o==="error"||o==="timeout"?"error":"off",l={kind:"live_mrz",platform:"web",engine:e.engine??V,arm:e.arm,capture:e.capture,outcome:i,reads:pe(t?.reads??0,0,1e4)??0,browser:e.browser??Tt()},s=(u,m)=>{m!==void 0&&(l[u]=m)};return s("format",t?.format),s("framesToValid",pe(t?.framesToValid,1,1e4)),s("msToValid",W(t?.msToValid)),s("framesToLock",pe(t?.framesToLock,1,1e4)),s("msToLock",W(t?.msToLock)),s("msToCapture",W(e.msToCapture)),s("readP50Ms",W(t?.readP50Ms)),s("readP90Ms",W(t?.readP90Ms)),s("deviceClass",t?.deviceClass),n!==null&&(s("warmupMs",W(n.warmupMs)),s("downloadMs",W(n.downloadMs)),s("cached",n.cached),s("tier",n.tier),s("benchMs",W(n.benchMs))),s("stillConfirmed",e.stillConfirmed),s("typeMismatch",e.typeMismatch),l}function fe(e,t){return e===void 0?!1:t==="passport"?e!=="TD3":e==="TD3"}var Lt=2,_t=1500;async function Ot(e){let t=await import("./capture-session-doc-MGDYUASI.js");return new t.CaptureSessionDoc(e)}function Et(e){return{topLeft:{x:e.x,y:e.y},topRight:{x:e.x+e.width,y:e.y},bottomRight:{x:e.x+e.width,y:e.y+e.height},bottomLeft:{x:e.x,y:e.y+e.height}}}function At(e,t,n){let o=[e.topLeft,e.topRight,e.bottomRight,e.bottomLeft],i=0;for(let l=0;l<o.length;l+=1){let s=o[l],u=o[(l+1)%o.length];i+=s.x*u.y-u.x*s.y}return t>0&&n>0?Math.abs(i)/2/(t*n):0}function kn(){import("./capture-session-doc-MGDYUASI.js").then(e=>e.warmDocDetector()).catch(()=>{})}function Cn(e){return Bt(e,{}).handle}function Bt(e,t){let n=Re(),o=Pe({enabled:e.keepScreenAwake!==!1}),i=t.decode??(r=>createImageBitmap(r)),l=t.blurRefuseSharpnessMax??.16,s=t.now??(()=>performance.now()),u=We(e.documentType,t.catalogCapture===!0?t.captureSeries??ze(e.issuer,e.documentType):[]),m=u.sides.length===1||e.side==="single",c=ue(m?"singlePage":"twoSided",s());if(!m&&(e.side==="recto"||e.side==="verso")){let r=e.side==="recto"?"verso":"recto";c={...c,captured:{[r]:"server"},readSides:[r],current:e.side,phase:"flipCue",restPhase:"flipCue"}}let b="idle",f=null,L=null,k=!0,S=0,v=0,p=null,g=!1,M=!1,I="",z=null,B,N=null,G=[],ge=u.mrz==="none",at=u.barcodeSide==="recto"||u.barcodeSide==="verso"?u.barcodeSide:null,q=ge&&!m?t.barcode?.side??at:null,he=e.barcodeAssetBaseUrl??t.barcode?.assetBaseUrl,be=null,Se=()=>q===null||he===void 0||t.barcode?.seen!==void 0?Promise.resolve(null):(be??(be=import("./barcode-detect-C5IOXMKI.js").then(r=>r.loadBarcodeDetect(he)).catch(()=>null)),be),it=(r,a)=>{if(q===null)return Promise.resolve(null);let d,h=new Promise(D=>{d=setTimeout(()=>D(null),t.barcode?.budgetMs??_t)});return Promise.race([st(r,a,q),h]).finally(()=>clearTimeout(d))},st=async(r,a,d)=>{let h=d==="recto"?"verso":"recto";try{let D=t.barcode?.seen;if(D!==void 0)return await D(r)?d:h;let[_,x]=await Promise.all([Se(),a()]);if(_===null||x===null)return null;let y=Math.min(1600,x.width),w=document.createElement("canvas");w.width=y,w.height=Math.max(1,Math.round(x.height/x.width*y));try{let A=w.getContext("2d");return A===null?null:(A.drawImage(x,0,0,w.width,w.height),await Ue(_,A.getImageData(0,0,w.width,w.height),d))}finally{w.width=0,w.height=0}}catch{return null}},C=t.webOcr!==void 0&&!ge?nt(t.webOcr.captureDocument,{mode:e.liveMrz?.mode??"auto"}):null,X=null,F=C===null||!C.enabled?"off":null,Q=null,K=null,ye=new WeakMap,ee="";if(C!==null&&C.enabled&&t.webOcr!==void 0){let r=t.webOcr,a=rt(C,{baseUrl:e.liveMrz?.assetBaseUrl??r.baseUrl,salt:r.salt,...e.liveMrz?.workerUrl!==void 0?{workerUrl:e.liveMrz.workerUrl}:{},...r.createWorker!==void 0?{createWorker:r.createWorker}:{}});if(a.ok){X=a.engine;let d=new Ie({textLock:C.textLock,liveMrz:C.liveMrz});Q=d;let h=a.engine;h.ready.then(D=>{F=D,typeof D!="string"&&k&&d.setEngine(h,D.tier)})}else F=a.reason}let H=r=>{let a=JSON.stringify(r);a!==ee&&(ee=a,n.emit("mrz",r))},Me=(r,a)=>{let d=t.webOcr?.reports;if(d===void 0||C===null||r===void 0)return;let h=r.format==="ID-3"||r.side==="single"?"single":r.side==="verso"?"verso":"recto",D=h!=="recto"?C.liveMrzArm??C.frontLockArm:C.frontLockArm;if(D===null||Math.random()>=C.reportSampleRate)return;let _=r.via==="live_mrz"?K:null,x=()=>{let y=_?.value??null;d([ot({arm:D,capture:h,assist:r.ocr??null,load:D==="control"?"off":F,...r.msToCapture!==void 0?{msToCapture:r.msToCapture}:{},...y!==null&&y.stillConfirmed!==void 0?{stillConfirmed:y.stillConfirmed}:{},...a!==void 0?{typeMismatch:fe(a.format,u.format==="ID-3"?"passport":"card")}:{}})])};_!==null&&_.value===null?Promise.race([_.promise,new Promise(y=>setTimeout(y,3e3))]).then(x):x()},U=r=>{!k||r===b||(b=r,o.setActive(r==="starting"||r==="scanning"),n.emit("state",r))},ut=(r,a)=>a===void 0?null:m?"single":r.captured.recto===a?"recto":r.captured.verso===a?"verso":null,lt=r=>({phase:r.phase,captured:m?r.captured.recto!==void 0?["single"]:[]:["recto","verso"].filter(a=>r.captured[a]!==void 0),expected:m?null:r.current??null,notice:r.notice??null,lastShot:ut(r,r.lastShot),manualShutter:r.manualShutter,torchAvailable:f?.torchAvailable()??!1,torch:M}),De=()=>{let r=f;r!==null&&r.captureNow().catch(()=>R({type:"captureFailed",at:s()}))};function R(r){if(!k)return;let a=c;c=Qe(c,r),c.phase==="capturing"&&a.phase!=="capturing"&&Promise.resolve().then(De),c.phase==="result"&&a.phase!=="result"&&(U("done"),we());let d=lt(c),h=JSON.stringify(d);h!==I&&(I=h,n.emit("scan",d))}function we(){N!==null&&clearInterval(N),N=null;for(let r of G.splice(0))r();f?.destroy(),f=null,o.setActive(!1)}let ke=()=>f?.captureReport?.(),te=!1,Ce=(r,a)=>{if(!(r===void 0||t.onFaceReport===void 0))try{t.onFaceReport(r,a)}catch{}},j=r=>{ee="",!(f===null||c.phase==="reading"||c.phase==="result")&&(te=!1,p=m?"single":c.current??r,f.rearm(p))},ct=async(r,a,d,h)=>{K=null;let D=F!==null&&typeof F=="object"&&F.tier==="low";if(h!==void 0&&X!==null&&C?.liveMrz?.hint===!0&&!D){let A={promise:Ke(X,r,h,{engine:V,detectorLimit:C.liveMrz.detectorLimit}).catch(()=>null),value:null};A.promise.then(P=>{A.value=P}),K=A}h!==void 0&&fe(h.format,u.format==="ID-3"?"passport":"card")&&H({state:"mismatch",format:h.format});let _=ke();Ce(_,"captured"),te=!0,Me(_,h);let x=d===void 0?z:d===null?null:{quad:Et(d),frameWidth:0,frameHeight:0,inStill:!0},y={decoded:null},w=()=>(y.decoded??(y.decoded=Promise.resolve().then(()=>i(r)).catch(()=>null)),y.decoded);try{await dt(r,a,x,w,K,h)}finally{y.decoded!==null&&(await y.decoded)?.close()}},dt=async(r,a,d,h,D,_)=>{let x=`shot-${S+=1}`,y=c.current;if(R({type:"captured",id:x,at:s()}),e.haptics!==!1)try{globalThis.navigator?.vibrate?.(30)}catch{}if(!g&&l>0){let P=await(t.measureSharpness!==void 0?t.measureSharpness(r,d):h().then(T=>T===null?-1:_e(T,ae(d?.quad??null,d?.inStill===!0?T:{width:d?.frameWidth??0,height:d?.frameHeight??0},T)))).catch(()=>-1);if(!k)return;if(Number.isFinite(P)&&P>=0&&P<l){g=!0;let T=m?"recto":c.current??(c.captured.recto===void 0?"recto":"verso");R({type:"readFailed",side:T,id:x,issue:"blurry"}),j(T);return}}g=!1;let w;if(m)w="single";else{let P=_!==void 0&&_.format!=="TD3"&&(u.mrzSide==="recto"||u.mrzSide==="verso")?u.mrzSide:null,T=P===null&&t.classify===void 0?await it(r,h):null,xe=T===null||q===null?T:Ne(T,q,c.captured),Y=P??xe??(xe===null&&q!==null&&y!==void 0?y:null)??await(t.classify!==void 0?t.classify(r):h().then($=>$===null?y??"recto":d?.inStill===!0?ce($,480,null,!0):ce($,480,ae(d?.quad??null,{width:d?.frameWidth??0,height:d?.frameHeight??0},$)))).catch(()=>y??"recto");if(!k)return;if(c.captured[Y]!==void 0&&v<Lt){v+=1,R({type:"duplicate",id:x,side:Y}),j(Y==="recto"?"verso":"recto");return}let ve=c.captured.recto===void 0?"recto":c.captured.verso===void 0?"verso":void 0;w=c.captured[Y]!==void 0&&ve!==void 0?ve:Y,v=0,R({type:"classified",id:x,side:w})}let A=w==="verso"?"verso":"recto";try{let P=t.encode!==void 0?await t.encode(r):await h().then(T=>{if(T===null)throw new Error("the still could not be decoded");return ie(T)});if(!k)return;D!==null&&ye.set(P.blob,D),n.emit("captured",{image:P.blob,side:w,documentType:e.documentType,...e.issuer!==void 0?{issuer:e.issuer}:{},width:P.width,height:P.height,previewDataUrl:a}),t.deferRead!==!0&&R({type:"readOk",side:A})}catch(P){R({type:"readFailed",side:A,id:x,issue:"technical"}),n.emit("error",J("generic",!0,{phase:"keyframes",name:re(P)}))}j(A==="recto"?"verso":"recto")},mt=r=>{G.push(r.on("statechange",({state:a})=>{a==="preflight"||a==="acquiring"?U("starting"):a==="positioning"?U("scanning"):a==="captured"?U("captured"):a==="error"&&U("error")}),r.on("feedback",({key:a,reticle:d})=>n.emit("feedback",{key:a,reticle:d})),r.on("checks",a=>{n.emit("gate",{progress:a.p,quad:a.quad,frameWidth:a.frameWidth,frameHeight:a.frameHeight,...a.guide!==void 0?{guide:{detected:a.guide.detected,fill:a.guide.fill,offsetX:a.guide.offsetX??0,offsetY:a.guide.offsetY??0}}:{}});let d=a.ocr?.mrz;d!==void 0&&(d.state==="fallback"?H({state:"fallback",reason:d.reason}):d.state==="valid"?H({state:"valid",format:d.format}):d.state==="reading"?H({state:"reading",...d.format?{format:d.format}:{},...d.coach?{coach:d.coach}:{}}):H({state:"searching"}));let h=a.quad===null?0:At(a.quad,a.frameWidth,a.frameHeight);z=a.quad===null?null:{quad:a.quad,frameWidth:a.frameWidth,frameHeight:a.frameHeight},R({type:"report",report:{present:a.quad!==null&&a.plausible||a.guide?.detected===!0,ready:a.ready===!0,locking:a.p>=.5,areaFrac:h},at:s()})}),r.on("error",({kind:a,retryable:d,detail:h})=>n.emit("error",J(a,d,h))),r.on("artifacts",a=>{ct(a.keyframe,a.previewDataUrl,a.docRegion,a.liveMrz)}))},ne=()=>(L??(L=(async()=>{if(k){if(Se(),f===null){let r;try{r=await(t.createEngine??Ot)({...t.engineOptions??{},...B!==void 0?{guide:B}:{},video:e.video,format:u.format,side:m?"single":e.side??"recto",autoCapture:!1,...Q!==null?{ocr:Q}:{}})}catch(d){U("error"),n.emit("error",J("models",!0,{phase:"models",name:re(d)}));return}if(!k){r.destroy();return}f=r,p=m?"single":e.side??"recto",mt(r);let a=t.tickMs??500;a>0&&(N=setInterval(()=>R({type:"tick",at:s()}),a))}R({type:"clockRestart"}),C!==null&&C.liveMrzArm==="live"&&(F==="unsupported"||F==="off")&&H({state:"fallback",reason:F}),await f.start()}})().finally(()=>{L=null})),L);return{handle:{get state(){return b},on:(r,a)=>n.on(r,a),start:ne,retry:()=>{if(f===null&&c.phase==="result"){R({type:"retake"}),v=0,g=!1,ne();return}if(f!==null&&b!=="error"){R({type:"retake"}),v=0,g=!1,p=m?"single":null,f.rearm(m?"single":void 0);return}ne()},setSide:r=>{m||r==="single"||f!==null&&c.current===r&&p===r&&c.phase!=="reading"&&c.phase!=="result"||(c.current!==r&&(c={...c,current:r}),R({type:"clockRestart"}),c.phase!=="reading"&&c.phase!=="result"&&f!==null&&(p=r,f.rearm(r)))},shutter:De,focusAt:(r,a)=>{f?.focusAt?.(r,a)},setGuide:r=>{B=r,f?.setGuide?.(r)},setTorch:r=>{M=r,f?.setTorch(r),R({type:"tick",at:s()})},destroy:()=>{if(k&&f!==null&&b!=="done"){let r=ke();!te&&r!==void 0&&r.ticks>0&&Ce(r,"abandoned"),Me(r,void 0)}k=!1,we(),Q?.setEngine(null),X?.dispose(),X=null,n.clear()}},plan:u,setFlowState:r=>{(c.phase==="reading"||c.phase==="result")&&U(r==="done"&&c.phase!=="result"?"scanning":r)},settle:(r,a)=>{let d=r==="verso"?"verso":"recto";R(a.ok?{type:"readOk",side:d}:{type:"readFailed",side:d,issue:a.issue}),a.ok||j(d)},takeDeviceRead:r=>ye.get(r.image)?.value??null}}export{Ht as a,Yt as b,Vt as c,Qt as d,Kt as e,jt as f,He as g,ue as h,Qe as i,xt as j,vt as k,Jt as l,Ke as m,en as n,V as o,nt as p,rt as q,Tt as r,ot as s,fe as t,Lt as u,_t as v,kn as w,Cn as x,Bt as y};
@@ -1 +1 @@
1
- "use strict";var b=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var f=(t,e)=>()=>(t&&(e=t(t=0)),e);var C=(t,e)=>{for(var n in e)b(t,n,{get:e[n],enumerable:!0})},te=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Z(e))!ee.call(t,o)&&o!==n&&b(t,o,{get:()=>e[o],enumerable:!(i=Q(e,o))||i.enumerable});return t};var ne=t=>te(b({},"__esModule",{value:!0}),t);function E(t,e=80){return typeof t=="string"&&t.replace(/[^A-Za-z0-9 ()\-._,]/g,"").trim().slice(0,e)||void 0}function ae(t){let e={};for(let[n,i]of Object.entries(t))i!==void 0&&(e[n]=i);return Object.keys(e).length>0?e:void 0}function I(t,e){R=ae({renderer:E(t),vendor:E(e)})??R}var Ye,R,A=f(()=>{"use strict";Ye="zoom torch focusMode focusDistance exposureMode exposureCompensation exposureTime whiteBalanceMode colorTemperature iso facingMode frameRate width height aspectRatio resizeMode deviceId groupId".split(" ")});var x=f(()=>{"use strict"});function w(t,e){return new Promise(n=>{let i=setTimeout(()=>n(void 0),e),o=s=>{clearTimeout(i),n(s)};try{t().then(o,()=>o(void 0))}catch{o(void 0)}})}async function O(t){let e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(t)));return Array.from(new Uint8Array(e).subarray(0,8),n=>n.toString(16).padStart(2,"0")).join("")}var H=f(()=>{"use strict";x()});var F={};C(F,{computePrint:()=>we,readHints:()=>V});function N(t,e){if(typeof t!="string")return;let n=t.trim();return n.length>0&&n.length<=e?n:void 0}async function V(){let t=navigator.userAgentData;if(typeof t?.getHighEntropyValues!="function")return;let e=await w(()=>t.getHighEntropyValues(["model","platformVersion"]),le);if(e==null)return;let n=N(e.model,me),i=N(e.platformVersion,fe),o={...n!==void 0?{model:n}:{},...i!==void 0?{platformVersion:i}:{}};return Object.keys(o).length>0?o:void 0}async function ge(){let[t,e]=await Promise.all([new D.Thumbmark({stabilize:["private","iframe"],exclude:["permissions","webrtc","speech"],logging:!1,collect_beacon:!1,timeout:de}).get(),V()]),n=t?.components?.hardware?.videocard;n!==null&&typeof n=="object"&&I(n.rendererUnmasked??n.renderer,n.vendorUnmasked??n.vendor);let i=t?.thumbmark;if(typeof i!="string"||i.length<he||i.length>ye)return;let o={};for(let s of ce){let r=t.components?.[s];r==null||r.timeout==="true"||(o[s]=await O(r))}return{hash:i,c:o,...e!==void 0?{hints:e}:{}}}function be(){return new Promise(t=>{typeof globalThis.requestIdleCallback=="function"?globalThis.requestIdleCallback(()=>t(),{timeout:pe}):t()})}async function we(t){return t()||(await be(),t())?"busy":w(ge,ue)}var D,ce,de,ue,le,pe,me,fe,he,ye,L=f(()=>{"use strict";D=require("@thumbmarkjs/thumbmarkjs");A();H();ce=["canvas","webgl","audio","fonts","hardware","screen","system","locales","math","plugins"],de=2e3,ue=4e3,le=1e3,pe=2e3,me=64,fe=32,he=8,ye=128});var Be={};C(Be,{HostedApiError:()=>l,HostedClient:()=>g,KNOWN_CODES:()=>T,SEKYRO_SDK_HEADER:()=>P,icaoPolicyOf:()=>j,isInAppBrowser:()=>y,isKnownCode:()=>G,portraitIcaoGate:()=>z,stripMimeParams:()=>m});module.exports=ne(Be);var ie=600;function M(){if(typeof window>"u"||typeof navigator>"u")return"desktop";let t=navigator.userAgentData,e=t?.mobile||/Android|i(Pad)?OS/.test(String(t?.platform)),n=String(navigator.userAgent??"");if(/iPhone|iPod/i.test(n))return"phone";if(/iPad/i.test(n))return"tablet";if(/Android/i.test(n))return/Mobile/i.test(n)?"phone":"tablet";if(/BlackBerry|IEMobile|Opera Mini/i.test(n))return"phone";if(!e){if(Number(navigator.maxTouchPoints??0)<=1)return"desktop";if(/Macintosh/.test(n))return"tablet";if(/Windows NT|CrOS/.test(n)||!re())return"desktop"}let i=oe();return i>0&&i<ie?"phone":"tablet"}function oe(){try{let t=window.screen,e=Number(t?.width??0),n=Number(t?.height??0);return e>0&&n>0?Math.min(e,n):0}catch{return 0}}function re(){try{return typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches}catch{return!1}}var h="0.1.0-rc.37";var se=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function y(t){let e=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));return se.test(e)}var U="sekyro.did",_e=1e4,ve=()=>globalThis.process?.versions?.node,K;function B(){let t=globalThis.crypto;try{if(typeof t?.randomUUID=="function")return t.randomUUID()}catch{}try{if(typeof t?.getRandomValues=="function"){let e=t.getRandomValues(new Uint8Array(16));return Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}}catch{}}function ke(){try{let t=localStorage.getItem(U);if(t)return t;let e=B();return e!==void 0&&localStorage.setItem(U,e),e}catch{return K??(K=B()),K}}async function Te(){let t=globalThis.crypto?.subtle;if(!t)return"";let e=navigator,n=JSON.stringify([e.userAgent,e.platform,e.hardwareConcurrency??null,e.deviceMemory??null,e.maxTouchPoints??0,screen.width,screen.height,screen.colorDepth,globalThis.devicePixelRatio??1,Intl.DateTimeFormat().resolvedOptions().timeZone,e.languages?.join(",")??e.language]),i=await t.digest("SHA-256",new TextEncoder().encode(n));return Array.from(new Uint8Array(i),o=>o.toString(16).padStart(2,"0")).join("").slice(0,32)}function Se(){try{let t=Number(navigator.maxTouchPoints);return Number.isFinite(t)&&t>=0?{touch:Math.min(64,Math.trunc(t))}:{}}catch{return{}}}function Pe(t){let e=new TextEncoder().encode(t),n="";for(let i of e)n+=String.fromCharCode(i);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ce(t){let e,n,i,o,s,r,d=()=>r?.readyState==="live",a=()=>{s!==void 0||!globalThis.crypto?.subtle||ve()||d()||(s=Promise.race([Promise.resolve().then(()=>(L(),F)),new Promise(c=>setTimeout(c,_e))]).then(c=>c?.computePrint(d)).then(c=>{c==="busy"?s=void 0:o=c}).catch(()=>{}))};return{timezone(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone?.slice(0,64)||void 0}catch{return}},noteCameraLabel(c){c&&(e=c.slice(0,128))},noteCamera(c){n=c},noteCameraTrack(c){r=c},async deviceHeader(){try{i??(i=Te().catch(()=>""));let c=[];navigator.webdriver&&c.push("webdriver"),/HeadlessChrome/.test(navigator.userAgent)&&c.push("headless");let u=await i,p=ke(),X={v:1,platform:"web",sdk:t.sdk.slice(0,64),caps:["session_proof"],ids:[...p?[{kind:"web_local",value:p.slice(0,128)}]:[],...u?[{kind:"web_fp",value:u}]:[]],screen:{w:screen.width,h:screen.height,dpr:globalThis.devicePixelRatio??1},...Se(),...e?{cameraLabel:e}:{},...c.length?{signals:c}:{},...o?{print:{v:2,...o,...n?{camera:n}:{}}}:{},...y()?{inApp:!0}:{}},J=Pe(JSON.stringify(X));return a(),J}catch{return}},printReady(){return s??Promise.resolve()}}}var _=Symbol.for("sekyro.web.clientContext"),v=globalThis,k=v[_]??(v[_]=Ce({sdk:`@sekyro/web@${h}`}));var T=["session_token_invalid","session_token_required","session_token_session_mismatch","session_not_found","rate_limit_exceeded","consent_required","session_not_active","check_not_found","check_already_finalized","check_out_of_order","check_type_unsupported","force_outcome_forbidden","attestation_invalid","platform_unregistered","app_attest_invalid","too_many_challenges","inference_unavailable","mobile_required","nni_locked","document_nni_mismatch","media_content_type_not_allowed","media_too_large","media_key_invalid","media_key_forbidden","media_not_found","media_unreadable","media_session_invalid","idempotency_key_collision","idempotency_in_progress","idempotency_key_required","validation_error","internal_error","unknown_error","upload_failed","network_error","timeout","nfc_outcome_not_accepted","identity_confirm_required","identity_confirm_locked","choice_not_found","choice_locked","choice_option_unavailable","step_not_on_path","check_not_active","sekyro_app_not_allowed","sekyro_app_unverified","id_number_locked","document_id_number_mismatch","simulated_capture_forbidden","native_app_required"];function G(t){return T.includes(t)}var l=class extends Error{constructor(e){super(e.message),this.name="HostedApiError",this.status=e.status,this.code=e.code,e.retryAfterSeconds!==void 0&&(this.retryAfterSeconds=e.retryAfterSeconds),e.details&&(this.details=e.details)}};function W(t,e,n=Math.random){let i=(t??e)*1e3,o=Math.min(Math.max(i,500),2e4),s=Math.round(o*(1+(n()*2-1)*.25));return Math.min(Math.max(s,500),2e4)}var Me=6e4,q=4,Ee=3e4,Re=9e5,Ie=200,Ae=5,xe=400,Oe=new Set(["server_busy","request_timeout"]),He=20,Ne=60,De=600,Ve=2;function m(t){return(t.split(";")[0]??"").trim()}var Fe={liveness:"clipKey",face_match:"imageKey",doc_ocr:"imageKey"},P=`@sekyro/web/${h}`,Le=P,g=class{constructor(e){this.sessionId=null;this.bootstrap=null;this.captureNonces=[];this.captureFetch=null;this.reportedIssues=new Map;this.issueReports=0;this.issuesPausedUntil=0;this.apiOrigin=e.apiOrigin.replace(/\/+$/,""),this.sessionToken=e.sessionToken;let n=e.fetch;this.fetchImpl=(i,o)=>(n??globalThis.fetch).call(globalThis,i,o),this.requestTimeoutMs=e.requestTimeoutMs??Ee,this.retryAttempts=e.inProgressRetry?.attempts??Ae,this.retryDelayMs=e.inProgressRetry?.delayMs??xe,this.random=e.random??Math.random,this.clientLocale=e.locale}async getSession(){let e=await this.api("GET","/hosted/session");return this.sessionId=e.sessionId,e}async recordConsent(e){let n=await this.api("POST","/hosted/consent",{body:{locale:e},busyRetry:!0}),i=this.captureHold;return this.captureHold=void 0,i&&this.armCapture(i),n}async reportCameraUnavailable(e){return this.api("POST","/hosted/camera-unavailable",{body:{cause:e}})}async testerGate(e){return this.api("POST","/hosted/tester-gate",{body:{input:e}})}async reportCaptureIssue(e){let n=typeof e.name=="string"?e.name.replace(/[^A-Za-z]/g,"").slice(0,40):"",i=typeof e.engineKind=="string"&&/^[a-z_]{1,32}$/.test(e.engineKind)?e.engineKind:void 0,o=typeof e.attempt=="number"&&Number.isInteger(e.attempt)&&e.attempt>=0&&e.attempt<=1e3?e.attempt:void 0,s=e.check==="attestation"?o??"":"",r=[e.check,s,e.kind,n,e.phase??"",i??""].join("|"),d=this.reportedIssues.get(r);if(d!==void 0)return d;if(Date.now()<this.issuesPausedUntil||this.issueReports>=He)return;let a={check:e.check,kind:e.kind,...n!==""?{name:n}:{},...e.phase!==void 0?{phase:e.phase}:{},...i!==void 0?{engineKind:i}:{},...o!==void 0?{attempt:o}:{},...e.formFactor!==void 0?{formFactor:e.formFactor}:{},...typeof e.detail=="string"&&/^\d{1,10}$/.test(e.detail)?{detail:e.detail}:{},...$(e.challengeMs)?{challengeMs:e.challengeMs}:{},...$(e.readyMs)?{readyMs:e.readyMs}:{},...e.inApp===!0?{inApp:!0}:{}};this.issueReports+=1;let c=this.api("POST","/hosted/capture-issue",{body:a,empty:!0}).catch(u=>{if(u instanceof l&&u.status===429){let p=Math.min(Math.max(u.retryAfterSeconds??Ne,0),De);this.issuesPausedUntil=Math.max(this.issuesPausedUntil,Date.now()+p*1e3);return}(!(u instanceof l)||u.status===0||u.status>=500)&&this.reportedIssues.delete(r)});return this.reportedIssues.set(r,c),c}async choose(e,n){let i=await this.api("POST","/hosted/choice",{body:{nodeId:e,option:n},busyRetry:!0});return this.sessionId=i.sessionId,i}async confirmIdentity(e){return this.api("POST","/hosted/identity/confirm",{body:{decision:e}})}async identityPortrait(){return this.api("GET","/hosted/identity/portrait",{blob:!0})}async presign(e,n,i,o={}){let s=await this.ensureSessionId(),r={kind:e,contentType:m(n),contentLength:i,...o.source==="upload"?{source:"upload"}:{}};return this.api("POST",`/sessions/${s}/media`,{body:r})}armCapture(e=2){this.captureHold===void 0?this.fillCaptureNonces(e,e):this.captureHold=Math.max(this.captureHold,e)}async presignCapture(e,n,i,o={}){let s=await this.ensureSessionId(),r=await this.takeCaptureNonce(),d=r===void 0?void 0:{nonce:r,...o.engine!==void 0?{engine:o.engine.slice(0,32)}:{},...o.durationMs!==void 0&&Number.isFinite(o.durationMs)?{captureMs:Math.min(36e5,Math.max(0,Math.round(o.durationMs)))}:{}},a={kind:e,contentType:m(n),contentLength:i,capture:d};return this.api("POST",`/sessions/${s}/media`,{body:a})}async takeCaptureNonce(){let e=()=>{let n=Date.now();return this.captureNonces=this.captureNonces.filter(i=>i.expiresAt-Me>n),this.captureNonces.shift()?.nonce};for(let n=0;n<2;n++){let i=e();if(i!==void 0)return i;await this.fillCaptureNonces(1)}return e()}fillCaptureNonces(e,n=0){return this.captureFetch??(this.captureFetch=(async()=>{try{let i=await this.ensureSessionId(),o=await this.api("POST",`/sessions/${i}/media/capture-nonces`,{body:{count:Math.min(q,Math.max(1,e))}}),s=Date.now()+Math.max(0,o.expiresIn)*1e3;for(let r of Array.isArray(o.nonces)?o.nonces:[])typeof r=="string"&&r.length>0&&this.captureNonces.push({nonce:r,expiresAt:s});this.captureNonces=this.captureNonces.slice(-q),this.captureHold=void 0}catch(i){i instanceof l&&i.code==="consent_required"&&(this.captureHold=Math.max(this.captureHold??0,n))}})().finally(()=>{this.captureFetch=null})),this.captureFetch}async uploadToSpaces(e,n,i){let o;try{o=await this.fetchImpl(e,{method:"PUT",headers:{"content-type":m(i)},body:n,signal:AbortSignal.timeout(Re)})}catch(s){throw S(s)}if(!o.ok){let s=(await o.text().catch(()=>"")).slice(0,Ie);throw new l({status:o.status,code:"upload_failed",message:`media upload failed (HTTP ${o.status})${s?`: ${s}`:""}`})}}async completeMedia(e){let n=await this.ensureSessionId();return this.api("POST",`/sessions/${n}/media/complete`,{body:{key:e}})}async submitCheck(e,n,i={}){let o=await this.ensureSessionId(),s={input:n,forceOutcome:i.forceOutcome};return this.api("POST",`/sessions/${o}/checks/${e}`,{body:s,idempotencyKey:i.idempotencyKey,...i.browserCheckToken!==void 0?{browserCheckToken:i.browserCheckToken}:{},busyRetry:i.idempotencyKey!==void 0})}async uploadAndSubmit(e,n,i,o={}){let s=m(n.contentType),r=await this.presign(n.kind,s,n.blob.size);await this.uploadToSpaces(r.uploadUrl,n.blob,s);let d=await this.completeMedia(r.key),a={...i,[Fe[e]]:d.key};return this.submitCheck(e,a,o)}async ensureSessionId(){return this.sessionId!==null?this.sessionId:(this.bootstrap??(this.bootstrap=this.getSession().finally(()=>{this.bootstrap=null})),(await this.bootstrap).sessionId)}async api(e,n,i={}){let o=e==="GET"||i.busyRetry===!0,s=`${this.apiOrigin}/api/v2${n}`,r={"x-session-token":this.sessionToken,"x-sekyro-sdk":Le};i.body!==void 0&&(r["content-type"]="application/json"),i.idempotencyKey!==void 0&&(r["x-idempotency-key"]=i.idempotencyKey),i.browserCheckToken!==void 0&&(r["sekyro-browser-check"]=i.browserCheckToken),this.clientLocale!==void 0&&(r["sekyro-client-locale"]=this.clientLocale);try{let d=k.timezone();d!==void 0&&(r["sekyro-client-timezone"]=d)}catch{}r["sekyro-client-form-factor"]=M();try{let d=await k.deviceHeader();d!==void 0&&(r["sekyro-client-device"]=d)}catch{}for(let d=0;;d++){let a;try{a=await this.fetchImpl(s,{method:e,headers:r,...i.body!==void 0?{body:JSON.stringify(i.body)}:{},cache:"no-store",signal:AbortSignal.timeout(this.requestTimeoutMs)})}catch(u){throw S(u)}if(a.ok){if(i.empty===!0)return;if(i.blob===!0)try{return await a.blob()}catch(p){throw S(p)}let u;try{u=await a.json()}catch{throw new l({status:a.status,code:"unknown_error",message:`response body was not valid JSON (HTTP ${a.status})`})}return Ue(u)}let c=await Ke(a);if(c.code==="idempotency_in_progress"&&d<this.retryAttempts){this.retryDelayMs>0&&await Y(this.retryDelayMs);continue}if(o&&c.status===503&&Oe.has(c.code)){o=!1,await Y(W(c.retryAfterSeconds,Ve,this.random));continue}throw c}}};function $(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=6e5}function S(t){if((typeof t=="object"&&t!==null?t.name:void 0)==="TimeoutError")return new l({status:0,code:"timeout",message:"request timed out"});let n=t instanceof Error?t.message:String(t);return new l({status:0,code:"network_error",message:`network request failed: ${n}`})}function Ue(t){return t!==null&&typeof t=="object"&&"success"in t&&"data"in t?t.data:t}async function Ke(t){let e="unknown_error",n=`request failed (HTTP ${t.status})`,i=Number.NaN,o;try{let d=await t.json();if(d!==null&&typeof d=="object"){let a=d;typeof a.code=="string"&&a.code.length>0&&(e=a.code),typeof a.message=="string"&&a.message.length>0&&(n=a.message),typeof a.retryAfterSeconds=="number"&&(i=a.retryAfterSeconds),Array.isArray(a.details?.issues)?o=a.details:Array.isArray(a.details?.errors)&&(o={...a.details,issues:[]})}}catch{}let s=t.headers.get("retry-after"),r=s===null?Math.floor(i):Number.parseInt(s,10);return new l({status:t.status,code:e,message:n,...Number.isFinite(r)&&r>=0?{retryAfterSeconds:r}:{},details:o})}function Y(t){return new Promise(e=>setTimeout(e,t))}function j(t){let e=t?.portrait,n=e?.icao,i=e?.purpose==="id_document";return n==null?i?{policy:"reject",profile:"id_document"}:null:{policy:n.policy==="alert"?"alert":"reject",profile:i||n.profile==="id_document"?"id_document":"selfie"}}function z(t){return{...t.baselineEyeOpenness!==void 0?{baselineEyeOpenness:t.baselineEyeOpenness}:{},...t.baselineEyeOpennessLeft!==void 0&&t.baselineEyeOpennessRight!==void 0?{baselineEyeOpennessLeft:t.baselineEyeOpennessLeft,baselineEyeOpennessRight:t.baselineEyeOpennessRight}:{},criteria:t.verdict??{},...t.backgroundCheck!==void 0?{backgroundCheck:t.backgroundCheck}:{}}}0&&(module.exports={HostedApiError,HostedClient,KNOWN_CODES,SEKYRO_SDK_HEADER,icaoPolicyOf,isInAppBrowser,isKnownCode,portraitIcaoGate,stripMimeParams});
1
+ "use strict";var w=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var re=Object.prototype.hasOwnProperty;var f=(n,e)=>()=>(n&&(e=n(n=0)),e);var P=(n,e)=>{for(var t in e)w(n,t,{get:e[t],enumerable:!0})},ie=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of te(e))!re.call(n,i)&&i!==t&&w(n,i,{get:()=>e[i],enumerable:!(r=ne(e,i))||r.enumerable});return n};var oe=n=>ie(w({},"__esModule",{value:!0}),n);function A(n,e=80){return typeof n=="string"&&n.replace(/[^A-Za-z0-9 ()\-._,]/g,"").trim().slice(0,e)||void 0}function le(n){let e={};for(let[t,r]of Object.entries(n))r!==void 0&&(e[t]=r);return Object.keys(e).length>0?e:void 0}function O(n,e){x=le({renderer:A(n),vendor:A(e)})??x}var Je,x,N=f(()=>{"use strict";Je="zoom torch focusMode focusDistance exposureMode exposureCompensation exposureTime whiteBalanceMode colorTemperature iso facingMode frameRate width height aspectRatio resizeMode deviceId groupId".split(" ")});var H=f(()=>{"use strict"});function S(n,e){return new Promise(t=>{let r=setTimeout(()=>t(void 0),e),i=o=>{clearTimeout(r),t(o)};try{n().then(i,()=>i(void 0))}catch{i(void 0)}})}async function D(n){let e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(n)));return Array.from(new Uint8Array(e).subarray(0,8),t=>t.toString(16).padStart(2,"0")).join("")}var V=f(()=>{"use strict";H()});var K={};P(K,{computePrint:()=>Te,readHints:()=>U});function F(n,e){if(typeof n!="string")return;let t=n.trim();return t.length>0&&t.length<=e?t:void 0}async function U(){let n=navigator.userAgentData;if(typeof n?.getHighEntropyValues!="function")return;let e=await S(()=>n.getHighEntropyValues(["model","platformVersion"]),he);if(e==null)return;let t=F(e.model,ge),r=F(e.platformVersion,be),i={...t!==void 0?{model:t}:{},...r!==void 0?{platformVersion:r}:{}};return Object.keys(i).length>0?i:void 0}async function _e(){let[n,e]=await Promise.all([new L.Thumbmark({stabilize:["private","iframe"],exclude:["permissions","webrtc","speech"],logging:!1,collect_beacon:!1,timeout:me}).get(),U()]),t=n?.components?.hardware?.videocard;t!==null&&typeof t=="object"&&O(t.rendererUnmasked??t.renderer,t.vendorUnmasked??t.vendor);let r=n?.thumbmark;if(typeof r!="string"||r.length<we||r.length>Se)return;let i={};for(let o of pe){let s=n.components?.[o];s==null||s.timeout==="true"||(i[o]=await D(s))}return{hash:r,c:i,...e!==void 0?{hints:e}:{}}}function ve(){return new Promise(n=>{typeof globalThis.requestIdleCallback=="function"?globalThis.requestIdleCallback(()=>n(),{timeout:ye}):n()})}async function Te(n){return n()||(await ve(),n())?"busy":S(_e,fe)}var L,pe,me,fe,he,ye,ge,be,we,Se,B=f(()=>{"use strict";L=require("@thumbmarkjs/thumbmarkjs");N();V();pe=["canvas","webgl","audio","fonts","hardware","screen","system","locales","math","plugins"],me=2e3,fe=4e3,he=1e3,ye=2e3,ge=64,be=32,we=8,Se=128});var qe={};P(qe,{HostedApiError:()=>l,HostedClient:()=>b,KNOWN_CODES:()=>k,SEKYRO_SDK_HEADER:()=>C,icaoPolicyOf:()=>J,isInAppBrowser:()=>g,isKnownCode:()=>$,portraitIcaoGate:()=>Q,stripMimeParams:()=>m});module.exports=oe(qe);var se=600;function E(){if(typeof window>"u"||typeof navigator>"u")return"desktop";let n=navigator.userAgentData,e=n?.mobile||/Android|i(Pad)?OS/.test(String(n?.platform)),t=String(navigator.userAgent??"");if(/iPhone|iPod/i.test(t))return"phone";if(/iPad/i.test(t))return"tablet";if(/Android/i.test(t))return/Mobile/i.test(t)?"phone":"tablet";if(/BlackBerry|IEMobile|Opera Mini/i.test(t))return"phone";if(!e){if(Number(navigator.maxTouchPoints??0)<=1)return"desktop";if(/Macintosh/.test(t))return"tablet";if(/Windows NT|CrOS/.test(t)||!ce())return"desktop"}let r=ae();return r>0&&r<se?"phone":"tablet"}function ae(){try{let n=window.screen,e=Number(n?.width??0),t=Number(n?.height??0);return e>0&&t>0?Math.min(e,t):0}catch{return 0}}function ce(){try{return typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches}catch{return!1}}var de=["magenta","yellow","green","blue"];var h=n=>typeof n=="number"&&Number.isFinite(n);function I(n){if(typeof n!="object"||n===null)return!1;let e=n;if(typeof e.nonce!="string"||e.nonce.length===0||!Array.isArray(e.colours)||e.colours.length<1||e.colours.length>8||!e.colours.every(r=>de.includes(r))||!Array.isArray(e.onsetsMs)||e.onsetsMs.length!==e.colours.length)return!1;let t=-1;for(let r of e.onsetsMs){if(!h(r)||r<0||r<=t)return!1;t=r}return!(!h(e.holdMs)||e.holdMs<=0||!h(e.endMs)||e.endMs<=t||!h(e.clipMs)||e.clipMs<e.endMs||e.clipMs>8e3)}var y="0.1.0-rc.38";var ue=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function g(n){let e=n??(typeof navigator>"u"?"":String(navigator.userAgent??""));return ue.test(e)}var G="sekyro.did",ke=1e4,Re=()=>globalThis.process?.versions?.node,W;function q(){let n=globalThis.crypto;try{if(typeof n?.randomUUID=="function")return n.randomUUID()}catch{}try{if(typeof n?.getRandomValues=="function"){let e=n.getRandomValues(new Uint8Array(16));return Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}}catch{}}function Me(){try{let n=localStorage.getItem(G);if(n)return n;let e=q();return e!==void 0&&localStorage.setItem(G,e),e}catch{return W??(W=q()),W}}async function Ce(){let n=globalThis.crypto?.subtle;if(!n)return"";let e=navigator,t=JSON.stringify([e.userAgent,e.platform,e.hardwareConcurrency??null,e.deviceMemory??null,e.maxTouchPoints??0,screen.width,screen.height,screen.colorDepth,globalThis.devicePixelRatio??1,Intl.DateTimeFormat().resolvedOptions().timeZone,e.languages?.join(",")??e.language]),r=await n.digest("SHA-256",new TextEncoder().encode(t));return Array.from(new Uint8Array(r),i=>i.toString(16).padStart(2,"0")).join("").slice(0,32)}function Pe(){try{let n=Number(navigator.maxTouchPoints);return Number.isFinite(n)&&n>=0?{touch:Math.min(64,Math.trunc(n))}:{}}catch{return{}}}function Ee(n){let e=new TextEncoder().encode(n),t="";for(let r of e)t+=String.fromCharCode(r);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ie(n){let e,t,r,i,o,s,d=()=>s?.readyState==="live",a=()=>{o!==void 0||!globalThis.crypto?.subtle||Re()||d()||(o=Promise.race([Promise.resolve().then(()=>(B(),K)),new Promise(c=>setTimeout(c,ke))]).then(c=>c?.computePrint(d)).then(c=>{c==="busy"?o=void 0:i=c}).catch(()=>{}))};return{timezone(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone?.slice(0,64)||void 0}catch{return}},noteCameraLabel(c){c&&(e=c.slice(0,128))},noteCamera(c){t=c},noteCameraTrack(c){s=c},async deviceHeader(){try{r??(r=Ce().catch(()=>""));let c=[];navigator.webdriver&&c.push("webdriver"),/HeadlessChrome/.test(navigator.userAgent)&&c.push("headless");let u=await r,p=Me(),Z={v:1,platform:"web",sdk:n.sdk.slice(0,64),caps:["session_proof"],rampAtArm:!0,ids:[...p?[{kind:"web_local",value:p.slice(0,128)}]:[],...u?[{kind:"web_fp",value:u}]:[]],screen:{w:screen.width,h:screen.height,dpr:globalThis.devicePixelRatio??1},...Pe(),...e?{cameraLabel:e}:{},...c.length?{signals:c}:{},...i?{print:{v:2,...i,...t?{camera:t}:{}}}:{},...g()?{inApp:!0}:{}},ee=Ee(JSON.stringify(Z));return a(),ee}catch{return}},printReady(){return o??Promise.resolve()}}}var _=Symbol.for("sekyro.web.clientContext"),v=globalThis,T=v[_]??(v[_]=Ie({sdk:`@sekyro/web@${y}`}));var k=["session_token_invalid","session_token_required","session_token_session_mismatch","session_not_found","rate_limit_exceeded","consent_required","session_not_active","check_not_found","check_already_finalized","check_out_of_order","check_type_unsupported","force_outcome_forbidden","attestation_invalid","platform_unregistered","app_attest_invalid","too_many_challenges","inference_unavailable","mobile_required","nni_locked","document_nni_mismatch","media_content_type_not_allowed","media_too_large","media_key_invalid","media_key_forbidden","media_not_found","media_unreadable","media_session_invalid","idempotency_key_collision","idempotency_in_progress","idempotency_key_required","validation_error","internal_error","unknown_error","upload_failed","network_error","timeout","nfc_outcome_not_accepted","identity_confirm_required","identity_confirm_locked","choice_not_found","choice_locked","choice_option_unavailable","step_not_on_path","check_not_active","sekyro_app_not_allowed","sekyro_app_unverified","id_number_locked","document_id_number_mismatch","simulated_capture_forbidden","native_app_required"];function $(n){return k.includes(n)}var l=class extends Error{constructor(e){super(e.message),this.name="HostedApiError",this.status=e.status,this.code=e.code,e.retryAfterSeconds!==void 0&&(this.retryAfterSeconds=e.retryAfterSeconds),e.details&&(this.details=e.details)}};function j(n,e,t=Math.random){let r=(n??e)*1e3,i=Math.min(Math.max(r,500),2e4),o=Math.round(i*(1+(t()*2-1)*.25));return Math.min(Math.max(o,500),2e4)}var Y=6e4,R=4,Ae=3e4,xe=9e5,Oe=200,Ne=5,He=400,De=new Set(["server_busy","request_timeout"]),Ve=20,Fe=60,Le=600,Ue=2;function m(n){return(n.split(";")[0]??"").trim()}var Ke={liveness:"clipKey",face_match:"imageKey",doc_ocr:"imageKey"},C=`@sekyro/web/${y}`,Be=C,b=class{constructor(e){this.sessionId=null;this.bootstrap=null;this.captureNonces=[];this.captureFetch=null;this.reportedIssues=new Map;this.issueReports=0;this.issuesPausedUntil=0;this.apiOrigin=e.apiOrigin.replace(/\/+$/,""),this.sessionToken=e.sessionToken;let t=e.fetch;this.fetchImpl=(r,i)=>(t??globalThis.fetch).call(globalThis,r,i),this.requestTimeoutMs=e.requestTimeoutMs??Ae,this.retryAttempts=e.inProgressRetry?.attempts??Ne,this.retryDelayMs=e.inProgressRetry?.delayMs??He,this.random=e.random??Math.random,this.clientLocale=e.locale}async getSession(){let e=await this.api("GET","/hosted/session");return this.sessionId=e.sessionId,e}async recordConsent(e){let t=await this.api("POST","/hosted/consent",{body:{locale:e},busyRetry:!0}),r=this.captureHold;return this.captureHold=void 0,r&&this.armCapture(r),t}async reportCameraUnavailable(e){return this.api("POST","/hosted/camera-unavailable",{body:{cause:e}})}async testerGate(e){return this.api("POST","/hosted/tester-gate",{body:{input:e}})}async reportCaptureIssue(e){let t=typeof e.name=="string"?e.name.replace(/[^A-Za-z]/g,"").slice(0,40):"",r=typeof e.engineKind=="string"&&/^[a-z_]{1,32}$/.test(e.engineKind)?e.engineKind:void 0,i=typeof e.attempt=="number"&&Number.isInteger(e.attempt)&&e.attempt>=0&&e.attempt<=1e3?e.attempt:void 0,o=e.check==="attestation"?i??"":"",s=[e.check,o,e.kind,t,e.phase??"",r??""].join("|"),d=this.reportedIssues.get(s);if(d!==void 0)return d;if(Date.now()<this.issuesPausedUntil||this.issueReports>=Ve)return;let a={check:e.check,kind:e.kind,...t!==""?{name:t}:{},...e.phase!==void 0?{phase:e.phase}:{},...r!==void 0?{engineKind:r}:{},...i!==void 0?{attempt:i}:{},...e.formFactor!==void 0?{formFactor:e.formFactor}:{},...typeof e.detail=="string"&&/^\d{1,10}$/.test(e.detail)?{detail:e.detail}:{},...z(e.challengeMs)?{challengeMs:e.challengeMs}:{},...z(e.readyMs)?{readyMs:e.readyMs}:{},...e.inApp===!0?{inApp:!0}:{}};this.issueReports+=1;let c=this.api("POST","/hosted/capture-issue",{body:a,empty:!0}).catch(u=>{if(u instanceof l&&u.status===429){let p=Math.min(Math.max(u.retryAfterSeconds??Fe,0),Le);this.issuesPausedUntil=Math.max(this.issuesPausedUntil,Date.now()+p*1e3);return}(!(u instanceof l)||u.status===0||u.status>=500)&&this.reportedIssues.delete(s)});return this.reportedIssues.set(s,c),c}async choose(e,t){let r=await this.api("POST","/hosted/choice",{body:{nodeId:e,option:t},busyRetry:!0});return this.sessionId=r.sessionId,r}async confirmIdentity(e){return this.api("POST","/hosted/identity/confirm",{body:{decision:e}})}async identityPortrait(){return this.api("GET","/hosted/identity/portrait",{blob:!0})}async presign(e,t,r,i={}){let o=await this.ensureSessionId(),s={kind:e,contentType:m(t),contentLength:r,...i.source==="upload"?{source:"upload"}:{}};return this.api("POST",`/sessions/${o}/media`,{body:s})}armCapture(e=2){let t=Date.now();this.captureNonces.filter(r=>r.expiresAt-Y>t).length>=e||(this.captureHold===void 0?this.fillCaptureNonces(e,e):this.captureHold=Math.max(this.captureHold,e))}async armRamp(){try{let e=await this.ensureSessionId(),t=await this.api("POST",`/sessions/${e}/media/capture-nonces`,{body:{count:2,ramp:!0}}),r=Date.now(),i=I(t.screenRamp)?t.screenRamp:void 0,o=r+Math.max(0,t.expiresIn)*1e3;for(let d of Array.isArray(t.nonces)?t.nonces:[])typeof d!="string"||d.length===0||this.captureNonces.push({nonce:d,expiresAt:o,...i!==void 0?{arm:i.nonce}:{}});this.captureNonces=this.captureNonces.slice(-R),this.captureHold=void 0;let s=typeof t.rampExpiresIn=="number"&&t.rampExpiresIn>0?t.rampExpiresIn:0;return{...i!==void 0?{challenge:i}:{},expiresAt:r+s*1e3}}catch{return}}async presignCapture(e,t,r,i={}){let o=await this.ensureSessionId(),s=await this.takeCaptureNonce(i.arm),d=s===void 0?void 0:{nonce:s,...i.engine!==void 0?{engine:i.engine.slice(0,32)}:{},...i.durationMs!==void 0&&Number.isFinite(i.durationMs)?{captureMs:Math.min(36e5,Math.max(0,Math.round(i.durationMs)))}:{}},a={kind:e,contentType:m(t),contentLength:r,capture:d};return this.api("POST",`/sessions/${o}/media`,{body:a})}async takeCaptureNonce(e){let t=()=>{let r=Date.now();this.captureNonces=this.captureNonces.filter(o=>o.expiresAt-Y>r);let i=this.captureNonces.findIndex(o=>o.arm===e);return this.captureNonces.splice(i<0?0:i,1)[0]?.nonce};for(let r=0;r<2;r++){let i=t();if(i!==void 0)return i;await this.fillCaptureNonces(1)}return t()}fillCaptureNonces(e,t=0){return this.captureFetch??(this.captureFetch=(async()=>{try{let r=await this.ensureSessionId(),i=await this.api("POST",`/sessions/${r}/media/capture-nonces`,{body:{count:Math.min(R,Math.max(1,e))}}),o=Date.now()+Math.max(0,i.expiresIn)*1e3;for(let s of Array.isArray(i.nonces)?i.nonces:[])typeof s=="string"&&s.length>0&&this.captureNonces.push({nonce:s,expiresAt:o});this.captureNonces=this.captureNonces.slice(-R),this.captureHold=void 0}catch(r){r instanceof l&&r.code==="consent_required"&&(this.captureHold=Math.max(this.captureHold??0,t))}})().finally(()=>{this.captureFetch=null})),this.captureFetch}async uploadToSpaces(e,t,r){let i;try{i=await this.fetchImpl(e,{method:"PUT",headers:{"content-type":m(r)},body:t,signal:AbortSignal.timeout(xe)})}catch(o){throw M(o)}if(!i.ok){let o=(await i.text().catch(()=>"")).slice(0,Oe);throw new l({status:i.status,code:"upload_failed",message:`media upload failed (HTTP ${i.status})${o?`: ${o}`:""}`})}}async completeMedia(e){let t=await this.ensureSessionId();return this.api("POST",`/sessions/${t}/media/complete`,{body:{key:e}})}async submitCheck(e,t,r={}){let i=await this.ensureSessionId(),o={input:t,forceOutcome:r.forceOutcome};return this.api("POST",`/sessions/${i}/checks/${e}`,{body:o,idempotencyKey:r.idempotencyKey,...r.browserCheckToken!==void 0?{browserCheckToken:r.browserCheckToken}:{},busyRetry:r.idempotencyKey!==void 0})}async uploadAndSubmit(e,t,r,i={}){let o=m(t.contentType),s=await this.presign(t.kind,o,t.blob.size);await this.uploadToSpaces(s.uploadUrl,t.blob,o);let d=await this.completeMedia(s.key),a={...r,[Ke[e]]:d.key};return this.submitCheck(e,a,i)}async ensureSessionId(){return this.sessionId!==null?this.sessionId:(this.bootstrap??(this.bootstrap=this.getSession().finally(()=>{this.bootstrap=null})),(await this.bootstrap).sessionId)}async api(e,t,r={}){let i=e==="GET"||r.busyRetry===!0,o=`${this.apiOrigin}/api/v2${t}`,s={"x-session-token":this.sessionToken,"x-sekyro-sdk":Be};r.body!==void 0&&(s["content-type"]="application/json"),r.idempotencyKey!==void 0&&(s["x-idempotency-key"]=r.idempotencyKey),r.browserCheckToken!==void 0&&(s["sekyro-browser-check"]=r.browserCheckToken),this.clientLocale!==void 0&&(s["sekyro-client-locale"]=this.clientLocale);try{let d=T.timezone();d!==void 0&&(s["sekyro-client-timezone"]=d)}catch{}s["sekyro-client-form-factor"]=E();try{let d=await T.deviceHeader();d!==void 0&&(s["sekyro-client-device"]=d)}catch{}for(let d=0;;d++){let a;try{a=await this.fetchImpl(o,{method:e,headers:s,...r.body!==void 0?{body:JSON.stringify(r.body)}:{},cache:"no-store",signal:AbortSignal.timeout(this.requestTimeoutMs)})}catch(u){throw M(u)}if(a.ok){if(r.empty===!0)return;if(r.blob===!0)try{return await a.blob()}catch(p){throw M(p)}let u;try{u=await a.json()}catch{throw new l({status:a.status,code:"unknown_error",message:`response body was not valid JSON (HTTP ${a.status})`})}return Ge(u)}let c=await We(a);if(c.code==="idempotency_in_progress"&&d<this.retryAttempts){this.retryDelayMs>0&&await X(this.retryDelayMs);continue}if(i&&c.status===503&&De.has(c.code)){i=!1,await X(j(c.retryAfterSeconds,Ue,this.random));continue}throw c}}};function z(n){return typeof n=="number"&&Number.isInteger(n)&&n>=0&&n<=6e5}function M(n){if((typeof n=="object"&&n!==null?n.name:void 0)==="TimeoutError")return new l({status:0,code:"timeout",message:"request timed out"});let t=n instanceof Error?n.message:String(n);return new l({status:0,code:"network_error",message:`network request failed: ${t}`})}function Ge(n){return n!==null&&typeof n=="object"&&"success"in n&&"data"in n?n.data:n}async function We(n){let e="unknown_error",t=`request failed (HTTP ${n.status})`,r=Number.NaN,i;try{let d=await n.json();if(d!==null&&typeof d=="object"){let a=d;typeof a.code=="string"&&a.code.length>0&&(e=a.code),typeof a.message=="string"&&a.message.length>0&&(t=a.message),typeof a.retryAfterSeconds=="number"&&(r=a.retryAfterSeconds),Array.isArray(a.details?.issues)?i=a.details:Array.isArray(a.details?.errors)&&(i={...a.details,issues:[]})}}catch{}let o=n.headers.get("retry-after"),s=o===null?Math.floor(r):Number.parseInt(o,10);return new l({status:n.status,code:e,message:t,...Number.isFinite(s)&&s>=0?{retryAfterSeconds:s}:{},details:i})}function X(n){return new Promise(e=>setTimeout(e,n))}function J(n){let e=n?.portrait,t=e?.icao,r=e?.purpose==="id_document";return t==null?r?{policy:"reject",profile:"id_document"}:null:{policy:t.policy==="alert"?"alert":"reject",profile:r||t.profile==="id_document"?"id_document":"selfie"}}function Q(n){return{...n.baselineEyeOpenness!==void 0?{baselineEyeOpenness:n.baselineEyeOpenness}:{},...n.baselineEyeOpennessLeft!==void 0&&n.baselineEyeOpennessRight!==void 0?{baselineEyeOpennessLeft:n.baselineEyeOpennessLeft,baselineEyeOpennessRight:n.baselineEyeOpennessRight}:{},criteria:n.verdict??{},...n.backgroundCheck!==void 0?{backgroundCheck:n.backgroundCheck}:{}}}0&&(module.exports={HostedApiError,HostedClient,KNOWN_CODES,SEKYRO_SDK_HEADER,icaoPolicyOf,isInAppBrowser,isKnownCode,portraitIcaoGate,stripMimeParams});
@@ -1,6 +1,6 @@
1
- export { H as HostedClient, a as HostedClientOptions, M as MediaCheckType, S as SEKYRO_SDK_HEADER, b as SubmitOptions, U as UploadMedia, s as stripMimeParams } from '../icao-gate-C2B9Yyz0.cjs';
2
- export { H as HostedApiError, a as HostedErrorDetails, b as HostedErrorIssue, K as KNOWN_CODES, c as KnownCode, i as icaoPolicyOf, d as isKnownCode, p as portraitIcaoGate } from '../icao-policy-CFoaL76l.cjs';
3
- export { A as AcceptedDocumentType, a as AttestationInput, C as CaptureContext, b as CaptureMode, c as CaptureNoncesResult, d as CaptureProof, e as CheckInputByType, f as CheckReason, g as CheckState, h as CheckType, i as ClosedBy, j as CompleteMediaResult, k as ConsentLocale, l as ContactChannel, D as DecisionReason, m as DocDeviceRead, n as DocOcrInput, o as DocReason, p as DocSide, E as EidAfterPass, q as EidAuthInput, r as EidReason, s as EmailOtpInput, t as EmailOtpReason, F as FaceMatchInput, u as FaceMatchReason, v as FormAddressValue, w as FormAnswerValue, x as FormChoiceView, y as FormConsentView, z as FormCustomQuestionView, B as FormFieldName, G as FormFieldQuestionView, H as FormInput, I as FormIssueCode, J as FormLocale, K as FormQuestionOptions, L as FormQuestionType, M as FormQuestionView, N as HostedAcceptedDocuments, O as HostedCaptureTuning, P as HostedChallengeView, Q as HostedConsentView, R as HostedDocumentCaptureTuning, S as HostedDocumentScanTuning, T as HostedDocumentsView, U as HostedEidView, V as HostedEmailOtpView, W as HostedFlowRef, X as HostedFormView, Y as HostedIcaoPolicy, Z as HostedIntegrity, _ as HostedLivePhotoTuning, $ as HostedNativeAppView, a0 as HostedNativeCaptureTuning, a1 as HostedOcrTuning, a2 as HostedOtpView, a3 as HostedPlanView, a4 as HostedPoaRuleKindView, a5 as HostedPoaRuleView, a6 as HostedPortraitPendingFix, a7 as HostedPortraitView, a8 as HostedProofOfAddressView, a9 as HostedSessionView, aa as HostedSimulationView, ab as HostedStepView, ac as HostedTesterGateView, ad as HostedVoiceLocale, ae as HostedVoiceView, af as IcaoCriterion, ag as IcaoReportEntry, ah as IdentityConfirmDecision, ai as IdentityMethod, aj as IdentitySummarySource, ak as IdentitySummaryView, al as LivenessCaptureInput, am as LivenessInput, an as LivenessReason, ao as MatchReason, ap as MediaKind, aq as MethodChoiceView, ar as NationalEidOption, as as NfcChipReason, at as NfcStepView, au as OtpChoiceView, av as PhoneCountryRule, aw as PhoneFormat, ax as PhoneOtpInput, ay as PhoneOtpReason, az as PhotoSource, aA as PhotoSourcePick, aB as PlanAttempts, aC as PlanChoiceKind, aD as PlanChoiceOption, aE as PlanChoiceView, aF as PlanSectionView, aG as PlanStepView, aH as PoaImagesInput, aI as PoaInput, aJ as PoaKind, aK as PoaLicenceInput, aL as PoaNameMatchMode, aM as PoaPdfInput, aN as PoaReason, aO as PoaRuleSource, aP as PopulationInput, aQ as PopulationReason, aR as PortraitFix, aS as PortraitFixReviewInput, aT as PortraitIcaoInput, aU as PortraitIcaoReason, aV as PortraitOutputFormat, aW as PresignRequest, aX as PresignUploadResult, aY as RecordConsentResult, aZ as ResolvedCaptureMode, a_ as SandboxSimulatedReason, a$ as SandboxSimulation, b0 as SessionDecidingStep, b1 as SessionFailureReason, b2 as SessionReason, b3 as SessionStatus, b4 as SessionStepView, b5 as SessionView, b6 as SimulatedCaptureInput, b7 as StepResult, b8 as StepSection, b9 as SubmitCheckBody, ba as TesterGateInput, bb as TesterGateResponse, bc as VerificationAssurance, bd as VerificationLevel } from '../types-BUvxjU5V.cjs';
1
+ export { H as HostedClient, a as HostedClientOptions, M as MediaCheckType, S as SEKYRO_SDK_HEADER, b as SubmitOptions, U as UploadMedia, s as stripMimeParams } from '../icao-gate-Dyb0wGO3.cjs';
2
+ export { H as HostedApiError, a as HostedErrorDetails, b as HostedErrorIssue, K as KNOWN_CODES, c as KnownCode, i as icaoPolicyOf, d as isKnownCode, p as portraitIcaoGate } from '../icao-policy-iIBtqhbf.cjs';
3
+ export { A as AcceptedDocumentType, a as ArmedRamp, b as AttestationInput, C as CaptureContext, c as CaptureMode, d as CaptureNoncesResult, e as CaptureProof, f as CheckInputByType, g as CheckReason, h as CheckState, i as CheckType, j as ClosedBy, k as CompleteMediaResult, l as ConsentLocale, m as ContactChannel, D as DecisionReason, n as DocDeviceRead, o as DocOcrInput, p as DocReason, q as DocSide, E as EidAfterPass, r as EidAuthInput, s as EidReason, t as EmailOtpInput, u as EmailOtpReason, F as FaceMatchInput, v as FaceMatchReason, w as FormAddressValue, x as FormAnswerValue, y as FormChoiceView, z as FormConsentView, B as FormCustomQuestionView, G as FormFieldName, H as FormFieldQuestionView, I as FormInput, J as FormIssueCode, K as FormLocale, L as FormQuestionOptions, M as FormQuestionType, N as FormQuestionView, O as HostedAcceptedDocuments, P as HostedCaptureTuning, Q as HostedChallengeView, R as HostedConsentView, S as HostedDocumentCaptureTuning, T as HostedDocumentScanTuning, U as HostedDocumentsView, V as HostedEidView, W as HostedEmailOtpView, X as HostedFlowRef, Y as HostedFormView, Z as HostedIcaoPolicy, _ as HostedIntegrity, $ as HostedLivePhotoTuning, a0 as HostedNativeAppView, a1 as HostedNativeCaptureTuning, a2 as HostedOcrTuning, a3 as HostedOtpView, a4 as HostedPlanView, a5 as HostedPoaRuleKindView, a6 as HostedPoaRuleView, a7 as HostedPortraitPendingFix, a8 as HostedPortraitView, a9 as HostedProofOfAddressView, aa as HostedSessionView, ab as HostedSimulationView, ac as HostedStepView, ad as HostedTesterGateView, ae as HostedVoiceLocale, af as HostedVoiceView, ag as IcaoCriterion, ah as IcaoReportEntry, ai as IdentityConfirmDecision, aj as IdentityMethod, ak as IdentitySummarySource, al as IdentitySummaryView, am as LivenessCaptureInput, an as LivenessInput, ao as LivenessReason, ap as MatchReason, aq as MediaKind, ar as MethodChoiceView, as as NationalEidOption, at as NfcChipReason, au as NfcStepView, av as OtpChoiceView, aw as PhoneCountryRule, ax as PhoneFormat, ay as PhoneOtpInput, az as PhoneOtpReason, aA as PhotoSource, aB as PhotoSourcePick, aC as PlanAttempts, aD as PlanChoiceKind, aE as PlanChoiceOption, aF as PlanChoiceView, aG as PlanSectionView, aH as PlanStepView, aI as PoaImagesInput, aJ as PoaInput, aK as PoaKind, aL as PoaLicenceInput, aM as PoaNameMatchMode, aN as PoaPdfInput, aO as PoaReason, aP as PoaRuleSource, aQ as PopulationInput, aR as PopulationReason, aS as PortraitFix, aT as PortraitFixReviewInput, aU as PortraitIcaoInput, aV as PortraitIcaoReason, aW as PortraitOutputFormat, aX as PresignRequest, aY as PresignUploadResult, aZ as RecordConsentResult, a_ as ResolvedCaptureMode, a$ as SandboxSimulatedReason, b0 as SandboxSimulation, b1 as SessionDecidingStep, b2 as SessionFailureReason, b3 as SessionReason, b4 as SessionStatus, b5 as SessionStepView, b6 as SessionView, b7 as SimulatedCaptureInput, b8 as StepResult, b9 as StepSection, ba as SubmitCheckBody, bb as TesterGateInput, bc as TesterGateResponse, bd as VerificationAssurance, be as VerificationLevel } from '../types-Cy_SJtPf.cjs';
4
4
 
5
5
  /** The page runs inside an app's WebView (WhatsApp, Instagram, Facebook, TikTok, Snapchat, LINE, LinkedIn, WeChat, an Android WebView…). */
6
6
  declare function isInAppBrowser(userAgent?: string): boolean;
@@ -1,6 +1,6 @@
1
- export { H as HostedClient, a as HostedClientOptions, M as MediaCheckType, S as SEKYRO_SDK_HEADER, b as SubmitOptions, U as UploadMedia, s as stripMimeParams } from '../icao-gate-toRhhMow.js';
2
- export { H as HostedApiError, a as HostedErrorDetails, b as HostedErrorIssue, K as KNOWN_CODES, c as KnownCode, i as icaoPolicyOf, d as isKnownCode, p as portraitIcaoGate } from '../icao-policy-xp26r3lv.js';
3
- export { A as AcceptedDocumentType, a as AttestationInput, C as CaptureContext, b as CaptureMode, c as CaptureNoncesResult, d as CaptureProof, e as CheckInputByType, f as CheckReason, g as CheckState, h as CheckType, i as ClosedBy, j as CompleteMediaResult, k as ConsentLocale, l as ContactChannel, D as DecisionReason, m as DocDeviceRead, n as DocOcrInput, o as DocReason, p as DocSide, E as EidAfterPass, q as EidAuthInput, r as EidReason, s as EmailOtpInput, t as EmailOtpReason, F as FaceMatchInput, u as FaceMatchReason, v as FormAddressValue, w as FormAnswerValue, x as FormChoiceView, y as FormConsentView, z as FormCustomQuestionView, B as FormFieldName, G as FormFieldQuestionView, H as FormInput, I as FormIssueCode, J as FormLocale, K as FormQuestionOptions, L as FormQuestionType, M as FormQuestionView, N as HostedAcceptedDocuments, O as HostedCaptureTuning, P as HostedChallengeView, Q as HostedConsentView, R as HostedDocumentCaptureTuning, S as HostedDocumentScanTuning, T as HostedDocumentsView, U as HostedEidView, V as HostedEmailOtpView, W as HostedFlowRef, X as HostedFormView, Y as HostedIcaoPolicy, Z as HostedIntegrity, _ as HostedLivePhotoTuning, $ as HostedNativeAppView, a0 as HostedNativeCaptureTuning, a1 as HostedOcrTuning, a2 as HostedOtpView, a3 as HostedPlanView, a4 as HostedPoaRuleKindView, a5 as HostedPoaRuleView, a6 as HostedPortraitPendingFix, a7 as HostedPortraitView, a8 as HostedProofOfAddressView, a9 as HostedSessionView, aa as HostedSimulationView, ab as HostedStepView, ac as HostedTesterGateView, ad as HostedVoiceLocale, ae as HostedVoiceView, af as IcaoCriterion, ag as IcaoReportEntry, ah as IdentityConfirmDecision, ai as IdentityMethod, aj as IdentitySummarySource, ak as IdentitySummaryView, al as LivenessCaptureInput, am as LivenessInput, an as LivenessReason, ao as MatchReason, ap as MediaKind, aq as MethodChoiceView, ar as NationalEidOption, as as NfcChipReason, at as NfcStepView, au as OtpChoiceView, av as PhoneCountryRule, aw as PhoneFormat, ax as PhoneOtpInput, ay as PhoneOtpReason, az as PhotoSource, aA as PhotoSourcePick, aB as PlanAttempts, aC as PlanChoiceKind, aD as PlanChoiceOption, aE as PlanChoiceView, aF as PlanSectionView, aG as PlanStepView, aH as PoaImagesInput, aI as PoaInput, aJ as PoaKind, aK as PoaLicenceInput, aL as PoaNameMatchMode, aM as PoaPdfInput, aN as PoaReason, aO as PoaRuleSource, aP as PopulationInput, aQ as PopulationReason, aR as PortraitFix, aS as PortraitFixReviewInput, aT as PortraitIcaoInput, aU as PortraitIcaoReason, aV as PortraitOutputFormat, aW as PresignRequest, aX as PresignUploadResult, aY as RecordConsentResult, aZ as ResolvedCaptureMode, a_ as SandboxSimulatedReason, a$ as SandboxSimulation, b0 as SessionDecidingStep, b1 as SessionFailureReason, b2 as SessionReason, b3 as SessionStatus, b4 as SessionStepView, b5 as SessionView, b6 as SimulatedCaptureInput, b7 as StepResult, b8 as StepSection, b9 as SubmitCheckBody, ba as TesterGateInput, bb as TesterGateResponse, bc as VerificationAssurance, bd as VerificationLevel } from '../types-BUvxjU5V.js';
1
+ export { H as HostedClient, a as HostedClientOptions, M as MediaCheckType, S as SEKYRO_SDK_HEADER, b as SubmitOptions, U as UploadMedia, s as stripMimeParams } from '../icao-gate-QqtNED0V.js';
2
+ export { H as HostedApiError, a as HostedErrorDetails, b as HostedErrorIssue, K as KNOWN_CODES, c as KnownCode, i as icaoPolicyOf, d as isKnownCode, p as portraitIcaoGate } from '../icao-policy-DsaRylAQ.js';
3
+ export { A as AcceptedDocumentType, a as ArmedRamp, b as AttestationInput, C as CaptureContext, c as CaptureMode, d as CaptureNoncesResult, e as CaptureProof, f as CheckInputByType, g as CheckReason, h as CheckState, i as CheckType, j as ClosedBy, k as CompleteMediaResult, l as ConsentLocale, m as ContactChannel, D as DecisionReason, n as DocDeviceRead, o as DocOcrInput, p as DocReason, q as DocSide, E as EidAfterPass, r as EidAuthInput, s as EidReason, t as EmailOtpInput, u as EmailOtpReason, F as FaceMatchInput, v as FaceMatchReason, w as FormAddressValue, x as FormAnswerValue, y as FormChoiceView, z as FormConsentView, B as FormCustomQuestionView, G as FormFieldName, H as FormFieldQuestionView, I as FormInput, J as FormIssueCode, K as FormLocale, L as FormQuestionOptions, M as FormQuestionType, N as FormQuestionView, O as HostedAcceptedDocuments, P as HostedCaptureTuning, Q as HostedChallengeView, R as HostedConsentView, S as HostedDocumentCaptureTuning, T as HostedDocumentScanTuning, U as HostedDocumentsView, V as HostedEidView, W as HostedEmailOtpView, X as HostedFlowRef, Y as HostedFormView, Z as HostedIcaoPolicy, _ as HostedIntegrity, $ as HostedLivePhotoTuning, a0 as HostedNativeAppView, a1 as HostedNativeCaptureTuning, a2 as HostedOcrTuning, a3 as HostedOtpView, a4 as HostedPlanView, a5 as HostedPoaRuleKindView, a6 as HostedPoaRuleView, a7 as HostedPortraitPendingFix, a8 as HostedPortraitView, a9 as HostedProofOfAddressView, aa as HostedSessionView, ab as HostedSimulationView, ac as HostedStepView, ad as HostedTesterGateView, ae as HostedVoiceLocale, af as HostedVoiceView, ag as IcaoCriterion, ah as IcaoReportEntry, ai as IdentityConfirmDecision, aj as IdentityMethod, ak as IdentitySummarySource, al as IdentitySummaryView, am as LivenessCaptureInput, an as LivenessInput, ao as LivenessReason, ap as MatchReason, aq as MediaKind, ar as MethodChoiceView, as as NationalEidOption, at as NfcChipReason, au as NfcStepView, av as OtpChoiceView, aw as PhoneCountryRule, ax as PhoneFormat, ay as PhoneOtpInput, az as PhoneOtpReason, aA as PhotoSource, aB as PhotoSourcePick, aC as PlanAttempts, aD as PlanChoiceKind, aE as PlanChoiceOption, aF as PlanChoiceView, aG as PlanSectionView, aH as PlanStepView, aI as PoaImagesInput, aJ as PoaInput, aK as PoaKind, aL as PoaLicenceInput, aM as PoaNameMatchMode, aN as PoaPdfInput, aO as PoaReason, aP as PoaRuleSource, aQ as PopulationInput, aR as PopulationReason, aS as PortraitFix, aT as PortraitFixReviewInput, aU as PortraitIcaoInput, aV as PortraitIcaoReason, aW as PortraitOutputFormat, aX as PresignRequest, aY as PresignUploadResult, aZ as RecordConsentResult, a_ as ResolvedCaptureMode, a$ as SandboxSimulatedReason, b0 as SandboxSimulation, b1 as SessionDecidingStep, b2 as SessionFailureReason, b3 as SessionReason, b4 as SessionStatus, b5 as SessionStepView, b6 as SessionView, b7 as SimulatedCaptureInput, b8 as StepResult, b9 as StepSection, ba as SubmitCheckBody, bb as TesterGateInput, bc as TesterGateResponse, bd as VerificationAssurance, be as VerificationLevel } from '../types-Cy_SJtPf.js';
4
4
 
5
5
  /** The page runs inside an app's WebView (WhatsApp, Instagram, Facebook, TikTok, Snapchat, LINE, LinkedIn, WeChat, an Android WebView…). */
6
6
  declare function isInAppBrowser(userAgent?: string): boolean;
@@ -1 +1 @@
1
- import{a as o,b as t,c as i,e as n,f as s,g as a,h as r,i as p}from"../chunk-QPO6LOYB.js";import"../chunk-TSA6GHUG.js";import{b as e}from"../chunk-KORZGQLS.js";export{i as HostedApiError,a as HostedClient,o as KNOWN_CODES,s as SEKYRO_SDK_HEADER,r as icaoPolicyOf,e as isInAppBrowser,t as isKnownCode,p as portraitIcaoGate,n as stripMimeParams};
1
+ import{a as o,b as t,c as i,e as n,f as s,g as a,h as r,i as p}from"../chunk-TQQK7464.js";import"../chunk-U5TL63CG.js";import"../chunk-TSA6GHUG.js";import{b as e}from"../chunk-COZXZAD5.js";export{i as HostedApiError,a as HostedClient,o as KNOWN_CODES,s as SEKYRO_SDK_HEADER,r as icaoPolicyOf,e as isInAppBrowser,t as isKnownCode,p as portraitIcaoGate,n as stripMimeParams};