@sekyro/web 0.1.0-rc.20 → 0.1.0-rc.21

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 +13 -0
  2. package/dist/{capture-session-doc-QA4DOFRF.js → capture-session-doc-XBZGXWOP.js} +1 -1
  3. package/dist/{capture-session-v3-CNL-GX11.d.cts → capture-session-v3-26FgzBIl.d.cts} +1 -1
  4. package/dist/{capture-session-v3-DaBqN8fO.d.ts → capture-session-v3-ZO0QOeQH.d.ts} +1 -1
  5. package/dist/chunk-234OZEDB.js +1 -0
  6. package/dist/chunk-33KKMPJ5.js +1 -0
  7. package/dist/chunk-53POX7U4.js +1 -0
  8. package/dist/{chunk-FGOVIGGL.js → chunk-7Q4YPMAF.js} +1 -1
  9. package/dist/chunk-B2X33ZW2.js +1 -0
  10. package/dist/{chunk-5ZKQHFFW.js → chunk-H3HVCWLF.js} +1 -1
  11. package/dist/{chunk-W2WD7PR2.js → chunk-P3H3D33O.js} +1 -1
  12. package/dist/{chunk-U6S7SCBY.js → chunk-P6UP4UQY.js} +1 -1
  13. package/dist/{chunk-IG466TOP.js → chunk-QYYJLXKA.js} +1 -1
  14. package/dist/{chunk-ZLWH4RBO.js → chunk-VIAT4DEA.js} +1 -1
  15. package/dist/chunk-ZADZTM3M.js +1 -0
  16. package/dist/chunk-ZNIZACXD.js +1 -0
  17. package/dist/client/index.cjs +1 -1
  18. package/dist/client/index.d.cts +3 -3
  19. package/dist/client/index.d.ts +3 -3
  20. package/dist/client/index.js +1 -1
  21. package/dist/core/index.cjs +1 -1
  22. package/dist/core/index.d.cts +3 -3
  23. package/dist/core/index.d.ts +3 -3
  24. package/dist/core/index.js +1 -1
  25. package/dist/{create-document-capture-GJXBQMTC.js → create-document-capture-23R2F47A.js} +1 -1
  26. package/dist/{create-portrait-capture-MOS2D7CL.js → create-portrait-capture-AGFHECK7.js} +1 -1
  27. package/dist/{create-verification-BBOUYpga.d.cts → create-verification-CXhXxknV.d.cts} +44 -5
  28. package/dist/{create-verification-COpe2hxf.d.ts → create-verification-KlHIU4Fy.d.ts} +44 -5
  29. package/dist/{icao-gate-CEGvJR3q.d.ts → icao-gate-DI8VePWd.d.ts} +36 -4
  30. package/dist/{icao-gate-l40OU6x1.d.cts → icao-gate-DvzOzHq6.d.cts} +36 -4
  31. package/dist/icao-gate-T3BTOKFJ.js +1 -0
  32. package/dist/{icao-policy-BgI1Y870.d.ts → icao-policy-DztbA50-.d.ts} +3 -3
  33. package/dist/{icao-policy-C7fIdRzo.d.cts → icao-policy-MRB8NMAu.d.cts} +3 -3
  34. package/dist/icao-tuning-4ETMF53W.js +1 -0
  35. package/dist/index.cjs +1 -1
  36. package/dist/index.d.cts +7 -7
  37. package/dist/index.d.ts +7 -7
  38. package/dist/index.js +1 -1
  39. package/dist/internal/index.cjs +1 -1
  40. package/dist/internal/index.d.cts +10 -6
  41. package/dist/internal/index.d.ts +10 -6
  42. package/dist/internal/index.js +1 -1
  43. package/dist/plan-runner-NUWONT7F.js +1 -0
  44. package/dist/popup/index.d.cts +1 -1
  45. package/dist/popup/index.d.ts +1 -1
  46. package/dist/popup/index.js +1 -1
  47. package/dist/{types-Dpfg2cO8.d.cts → types-C_XP92JQ.d.cts} +40 -7
  48. package/dist/{types-Dpfg2cO8.d.ts → types-C_XP92JQ.d.ts} +40 -7
  49. package/package.json +1 -1
  50. package/sbom.cdx.json +10 -10
  51. package/dist/chunk-7ZCZY3ZP.js +0 -1
  52. package/dist/chunk-BPE5NSQ2.js +0 -1
  53. package/dist/chunk-KHR4U2SZ.js +0 -1
  54. package/dist/chunk-KZBBB5B2.js +0 -1
  55. package/dist/chunk-NJML6FMD.js +0 -1
  56. package/dist/chunk-XCKE2MJL.js +0 -1
  57. package/dist/icao-gate-PWBMKRGC.js +0 -1
  58. package/dist/icao-tuning-4GGVX6B4.js +0 -1
  59. package/dist/plan-runner-35655N4Z.js +0 -1
  60. /package/dist/{chunk-U6TYL2IJ.js → chunk-SNACCYTL.js} +0 -0
@@ -1 +1 @@
1
- import{a as t,b as o,c as i,e as n,f as s,g as a,h as r,i as p}from"../chunk-NJML6FMD.js";import{b as e}from"../chunk-ZLWH4RBO.js";export{i as HostedApiError,a as HostedClient,t as KNOWN_CODES,s as SEKYRO_SDK_HEADER,r as icaoPolicyOf,e as isInAppBrowser,o as isKnownCode,p as portraitIcaoGate,n as stripMimeParams};
1
+ import{a as t,b as o,c as i,e as n,f as s,g as a,h as r,i as p}from"../chunk-B2X33ZW2.js";import{b as e}from"../chunk-VIAT4DEA.js";export{i as HostedApiError,a as HostedClient,t as KNOWN_CODES,s as SEKYRO_SDK_HEADER,r as icaoPolicyOf,e as isInAppBrowser,o as isKnownCode,p as portraitIcaoGate,n as stripMimeParams};
@@ -1 +1 @@
1
- "use strict";var Rt=Object.create;var B=Object.defineProperty;var Dt=Object.getOwnPropertyDescriptor;var It=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Ot=Object.prototype.hasOwnProperty;var W=(t,e)=>()=>(t&&(e=t(t=0)),e);var K=(t,e)=>{for(var r in e)B(t,r,{get:e[r],enumerable:!0})},Re=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of It(e))!Ot.call(t,n)&&n!==r&&B(t,n,{get:()=>e[n],enumerable:!(i=Dt(e,n))||i.enumerable});return t};var Pt=(t,e,r)=>(r=t!=null?Rt(At(t)):{},Re(e||!t||!t.__esModule?B(r,"default",{value:t,enumerable:!0}):r,t)),Ft=t=>Re(B({},"__esModule",{value:!0}),t);function Ue(t){let e=(t??"").trim().toLowerCase();return e.length===0?"unknown":er.some(r=>e.includes(r))?"known_virtual":tr.some(r=>r.test(e))?"platform":"unknown"}var er,tr,ze=W(()=>{"use strict";er=["obs","manycam","virtual","snap camera","xsplit","droidcam","iriun","camo"],tr=[/^(front|back|rear)( [a-z ]+)? camera$/i,/^camera2? ?\d+, facing (front|back|external)/i,/facetime/i,/\b(integrated|built-in|builtin) (web)?cam(era)?\b/i,/\b(hd )?web ?cam\b/i,/\([0-9a-f]{4}:[0-9a-f]{4}\)\s*$/i]});var Xe={};K(Xe,{bounded:()=>G,cameraHash:()=>qe,hex16:()=>$,noteCameraTrait:()=>ir});function G(t,e){return new Promise(r=>{let i=setTimeout(()=>r(void 0),e),n=a=>{clearTimeout(i),r(a)};try{t().then(n,()=>n(void 0))}catch{n(void 0)}})}async function $(t){let e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(t)));return Array.from(new Uint8Array(e).subarray(0,8),r=>r.toString(16).padStart(2,"0")).join("")}function nr(t){try{return t.getSettings?.().facingMode==="environment"}catch{return!1}}async function qe(t){try{if(t.readyState==="ended"||nr(t))return;let e={};try{e=t.getCapabilities?.()??{}}catch{}let r=await G(()=>navigator.mediaDevices.enumerateDevices(),rr);return await $([ve(e.width),ve(e.height),ve(e.frameRate),ye(e.facingMode),ye(e.focusMode),ye(e.exposureMode),Ue(t.label),r?.filter(i=>i.kind==="videoinput").length??null])}catch{return}}async function ir(t,e){let r=await qe(t);r&&e.noteCamera(r)}var rr,ye,ve,Se=W(()=>{"use strict";ze();rr=1e3;ye=t=>Array.isArray(t)?[...t].sort():null,ve=t=>{let e=t;return e==null?null:[e.min??null,e.max??null]}});var Qe={};K(Qe,{computePrint:()=>gr,readHints:()=>je});function Ye(t,e){if(typeof t!="string")return;let r=t.trim();return r.length>0&&r.length<=e?r:void 0}async function je(){let t=navigator.userAgentData;if(typeof t?.getHighEntropyValues!="function")return;let e=await G(()=>t.getHighEntropyValues(["model","platformVersion"]),cr);if(e==null)return;let r=Ye(e.model,lr),i=Ye(e.platformVersion,dr),n={...r!==void 0?{model:r}:{},...i!==void 0?{platformVersion:i}:{}};return Object.keys(n).length>0?n:void 0}async function fr(){let[t,e]=await Promise.all([new Ze.Thumbmark({stabilize:["private","iframe"],exclude:["permissions","webrtc","speech"],logging:!1,collect_beacon:!1,timeout:or}).get(),je()]),r=t?.thumbmark;if(typeof r!="string"||r.length<mr||r.length>pr)return;let i={};for(let n of ar){let a=t.components?.[n];a==null||a.timeout==="true"||(i[n]=await $(a))}return{hash:r,c:i,...e!==void 0?{hints:e}:{}}}function hr(){return new Promise(t=>{typeof globalThis.requestIdleCallback=="function"?globalThis.requestIdleCallback(()=>t(),{timeout:ur}):t()})}async function gr(t){return t()||(await hr(),t())?"busy":G(fr,sr)}var Ze,ar,or,sr,cr,ur,lr,dr,mr,pr,$e=W(()=>{"use strict";Ze=require("@thumbmarkjs/thumbmarkjs");Se();ar=["canvas","webgl","audio","fonts","hardware","screen","system","locales","math","plugins"],or=2e3,sr=4e3,cr=1e3,ur=2e3,lr=64,dr=32,mr=8,pr=128});var St={};K(St,{RANK_CANDIDATES:()=>Lr,RANK_TOLERANCE:()=>ee,RANK_WINDOW_MS:()=>Nr,ROLL_ZERO_DEG:()=>Gr,SHARPNESS_REPORT_MAX:()=>yt,YAW_REPORT_MAX:()=>bt,YAW_ZERO_IOD:()=>Vr,collectRankedKeyframes:()=>vt,default:()=>Br,featuresOf:()=>ht,frontalOf:()=>ft,rankKeyframes:()=>gt});function ft(t){let e=t.eyes;if(e===void 0)return{frontal:1,yaw:null,roll:null};let r=e.right.x-e.left.x,i=e.right.y-e.left.y,n=r*r+i*i;if(n===0)return{frontal:1,yaw:null,roll:null};let a=Math.abs(Math.atan2(i,Math.abs(r))*180/Math.PI),o=pt(1-a/30),s=null,l=t.nose;if(l!==void 0){let c=(e.left.x+e.right.x)/2,u=(e.left.y+e.right.y)/2;s=Math.abs(((l.x-c)*r+(l.y-u)*i)/n),o*=pt(1-s/.5)}return{frontal:o,yaw:s,roll:a}}function ht(t,e){return t===null?{face:!1,frontal:0,yaw:null,roll:null,eyes:null,score:0,sharpness:e}:{face:!0,...ft(t),eyes:null,score:t.score,sharpness:e}}function gt(t){let e=t.map((n,a)=>a),r=(n,a)=>{let o=Number.NEGATIVE_INFINITY;for(let s of e)o=Math.max(o,n(t[s]));e=e.filter(s=>n(t[s])>=o-a)};r(n=>n.frontal,ee.frontal),r(n=>n.eyes??1,ee.eyes),r(n=>n.score,ee.score);let i=-1;for(let n of e)(i===-1||t[n].sharpness>t[i].sharpness)&&(i=n);return i}function Hr(t){return{face:t.face,frontal:I(t.frontal),...t.yaw!==null?{yaw:Math.min(I(t.yaw),bt)}:{},...t.roll!==null?{roll:I(t.roll)}:{},...t.eyes!==null?{eyes:I(t.eyes)}:{},score:I(t.score),sharpness:Math.min(I(t.sharpness),yt)}}async function vt(t,e){let{options:r}=t,i=r.video,n=r.now??(()=>performance.now()),a=r.captureKeyframe??(m=>t.defaultKeyframe(m)),o=600/3,s=[],l=[],c=0;for(let m=0;m<4;m+=1){if(e!==t.attempt)return null;let p=t.detector,f=Promise.resolve(null),h,g=0;try{if(p!==null){let k=t.profiler?.profile.inputWidth??160,A=r.makeSnapshot?.(i,k)??t.defaultSnapshot(i,k);h=a(i).then(b=>(g=n(),b));let ne=n();f=p.detect(A,i.videoWidth,i.videoHeight).then(b=>(c+=n()-ne,b),()=>null)}else h=a(i).then(k=>(g=n(),k));let[v,T]=await Promise.all([h,f]);s.push(v),l.push(ht(T,v.sharpness))}catch{h?.catch(()=>{})}let S=g>0?Math.max(0,n()-g):0;m<3&&await new Promise(v=>setTimeout(v,Math.max(0,o-S)))}if(e!==t.attempt)return null;let u=gt(l);if(u===-1)return null;let d=0;l.forEach((m,p)=>{m.sharpness>l[d].sharpness&&(d=p)});try{r.telemetry?.({type:"keyframe",tier:t.detector?.tier??null,chosen:u,sharpest:d,detectMs:Math.round(c),candidates:l.map(Hr)})}catch{}return s[u]??null}var Lr,Nr,Vr,Gr,ee,pt,I,bt,yt,Br,Et=W(()=>{"use strict";Lr=4,Nr=600,Vr=.5,Gr=30,ee={frontal:.1,eyes:.1,score:.05},pt=t=>t<0?0:t>1?1:t;I=t=>Number.isFinite(t)?Math.round(t*1e3)/1e3:0,bt=99,yt=999999;Br=vt});var qr={};K(qr,{CENTERED_FACTOR:()=>Ut,CIRCLE_RADIUS_FACTOR:()=>Wt,CLIP_MS:()=>Ie,CaptureSessionV3:()=>_e,ClipError:()=>y,ClipRecorder:()=>P,DEFAULT_CLIP_MIME:()=>U,DEFAULT_TIER_ORDER:()=>Ve,DEFAULT_V3_ASSET_BASE_URL:()=>Ne,DEVICE_PROFILES:()=>Be,DetectScheduler:()=>V,DetectorLadderError:()=>w,DeviceProfiler:()=>N,EXPOSURE_BAND:()=>L,FaceGateV3:()=>R,GATE_SNAPSHOT_MS:()=>kt,GateBlockStats:()=>D,HOLD_UPRIGHT_KEY:()=>te,IN_CIRCLE_FACTOR:()=>Kt,KEYFRAME_CANDIDATES:()=>re,KEYFRAME_WINDOW_MS:()=>wt,MAX_CLIP_BYTES:()=>z,MIME_CANDIDATES:()=>De,PHONE_MAX_SHORT_SIDE:()=>Pe,PROVENANCE_WAIT_MS:()=>xt,SHARP_REF:()=>cn,STOP_GRACE_MS:()=>Oe,TIMESLICE_MS:()=>Ae,UPRIGHT_WATCH_MS:()=>Ct,V3_GATE_DEFAULTS:()=>He,VIDEO_BPS:()=>ue,blockReasonOf:()=>mt,buildCaptureConstraints:()=>le,buildLivenessV2FormData:()=>Nt,cameraPreflight:()=>se,captureMirroredKeyframe:()=>ce,classifyDevice:()=>be,createDetector:()=>x,detectFormFactor:()=>q,detectIsMobile:()=>de,errorCopy:()=>Vt,exposure:()=>fe,extForMime:()=>ie,intrinsicSize:()=>C,isClipTooLarge:()=>O,isMediaRecorderSupported:()=>Lt,mapGetUserMediaError:()=>oe,meanLuma:()=>j,pickMimeType:()=>ae,probeDevice:()=>ge,sharpness:()=>Q,toStreamPixels:()=>F,trackFacingMode:()=>me,uiCopy:()=>Gt});module.exports=Ft(qr);var De=["video/mp4;codecs=avc1.42E01E,mp4a.40.2","video/mp4;codecs=avc1.42E01E","video/mp4","video/webm;codecs=vp9,opus","video/webm;codecs=vp9","video/webm;codecs=vp8,opus","video/webm;codecs=vp8","video/webm"];function ae(){let t=globalThis.MediaRecorder;return!t||typeof t.isTypeSupported!="function"?"":De.find(e=>t.isTypeSupported(e))??""}var U="video/webm";function oe(t){if(t instanceof TypeError)return"insecure";switch(t?.name??""){case"NotAllowedError":case"PermissionDeniedError":return"permission";case"NotFoundError":case"DevicesNotFoundError":return"notfound";case"NotReadableError":case"TrackStartError":return"inuse";case"OverconstrainedError":case"ConstraintNotSatisfiedError":return"overconstrained";default:return"generic"}}function se(){let t=globalThis;if(typeof t.window<"u"&&t.window.isSecureContext===!1)return"INSECURE_CONTEXT";let e=t.navigator?.mediaDevices;return!e||typeof e.getUserMedia!="function"?"UNSUPPORTED":"OK"}function Lt(){let t=globalThis.MediaRecorder;return typeof t<"u"&&typeof t.isTypeSupported=="function"}var z=8*1024*1024;function O(t){return t.size>z}function ie(t){let e=(t||"").toLowerCase();return e.startsWith("image/jpeg")?"jpg":e.startsWith("video/mp4")?"mp4":(e.startsWith("video/webm"),"webm")}function Nt(t){let{token:e,clip:r,keyframe:i}=t,n=t.ts??Date.now(),a=r.type||U,o=i.type||"image/jpeg",s=new FormData;return s.append("token",e),s.append("clip",new File([r],`liveness-${n}.${ie(a)}`,{type:a})),s.append("keyframe",new File([i],`keyframe-${n}.${ie(o)}`,{type:o})),s}function ce(t,e,r=.92){return new Promise((i,n)=>{let a=t.videoWidth,o=t.videoHeight;if(!a||!o){n(new Error("video-not-ready"));return}let s=e.getContext("2d");if(!s){n(new Error("no-2d-context"));return}e.width=a,e.height=o,s.scale(-1,1),s.drawImage(t,-a,0),e.toBlob(l=>l?i(l):n(new Error("empty-keyframe")),"image/jpeg",r)})}var Vt={permission:{key:"fcv2.err.permission",fr:"Autorisez la cam\xE9ra dans les r\xE9glages du navigateur (ic\xF4ne cam\xE9ra dans la barre d\u2019adresse), puis r\xE9essayez."},notfound:{key:"fcv2.err.notfound",fr:"Aucune cam\xE9ra d\xE9tect\xE9e. Branchez ou activez une cam\xE9ra, puis r\xE9essayez."},inuse:{key:"fcv2.err.inuse",fr:"La cam\xE9ra est utilis\xE9e par une autre application. Fermez-la puis r\xE9essayez."},overconstrained:{key:"fcv2.err.overconstrained",fr:"La cam\xE9ra ne prend pas en charge les r\xE9glages demand\xE9s. Nouvel essai en cours\u2026"},insecure:{key:"fcv2.err.insecure",fr:"La cam\xE9ra n\xE9cessite une connexion s\xE9curis\xE9e (HTTPS). Ouvrez la page en HTTPS."},unsupported:{key:"fcv2.err.unsupported",fr:"Votre navigateur ne prend pas en charge l\u2019enregistrement vid\xE9o. Utilisez un navigateur r\xE9cent."},generic:{key:"fcv2.err.generic",fr:"Cam\xE9ra indisponible. R\xE9essayez ou contactez le support."}},Gt={recording:{key:"fcv2.recording",fr:"Enregistrement en cours\u2026"},uploading:{key:"fcv2.uploading",fr:"Envoi en cours\u2026"},clipTooLarge:{key:"fcv2.err.cliptoolarge",fr:"La vid\xE9o est trop volumineuse. R\xE9essayez dans un endroit mieux \xE9clair\xE9."},retry:{key:"fcv2.retry",fr:"R\xE9essayer"},listen:{key:"fcv2.listen",fr:"\xC9couter"}};var Ie=2500,Ae=1e3,Oe=1500,ue=25e5,y=class extends Error{constructor(e,r){super(r??e),this.kind=e}},P=class{constructor(){this.recorder=null;this.stream=null;this.chunks=[];this.bytes=0;this.hardStopTimer=null;this.graceTimer=null;this.settled=!1}clearTimers(){this.hardStopTimer&&clearTimeout(this.hardStopTimer),this.graceTimer&&clearTimeout(this.graceTimer),this.hardStopTimer=null,this.graceTimer=null}record(e,r,i){if(this.recorder&&!this.settled)return Promise.reject(new y("generic","record() called while a recording is in flight \u2014 ClipRecorder handles one recording at a time"));this.recorder=null,this.clearTimers(),this.chunks=[],this.bytes=0,this.settled=!1,this.stream=e;let n=ae();return new Promise((a,o)=>{let s;try{s=new MediaRecorder(e,n?{mimeType:n,videoBitsPerSecond:ue}:{videoBitsPerSecond:ue})}catch{try{s=new MediaRecorder(e)}catch{o(new y("unsupported"));return}}this.recorder=s;let l=u=>{this.settled||(this.settled=!0,this.clearTimers(),u())},c=()=>l(()=>{let u=s.mimeType||n||U,d=new Blob(this.chunks,{type:u});if(d.size===0){o(new y("generic","empty clip"));return}if(O(d)){o(new y("cliptoolarge"));return}a({blob:d,mimeType:u})});if(s.ondataavailable=u=>{u.data&&u.data.size&&(this.chunks.push(u.data),this.bytes+=u.data.size,this.bytes>z&&l(()=>{try{s.state!=="inactive"&&s.stop()}catch{}o(new y("cliptoolarge"))}))},s.onstop=c,s.onerror=()=>l(()=>o(new y("generic"))),i!==void 0){let u=!1;s.onstart=()=>{if(!(u||this.settled)){u=!0;try{i()}catch{}}}}try{s.start(Ae)}catch{l(()=>o(new y("generic")));return}this.hardStopTimer=setTimeout(()=>{if(this.settled||r?.(),s.state!=="inactive"){try{s.stop()}catch{c()}this.graceTimer=setTimeout(c,Oe)}else c()},Ie)})}stop(e){this.clearTimers();let r=this.recorder;if(r&&r.state!=="inactive")try{r.stop()}catch{}this.recorder=null,(e??this.stream)?.getTracks().forEach(n=>n.stop()),this.stream=null}};function le(t,e){return{video:{width:{ideal:1280,max:1280},height:{ideal:720,max:720},facingMode:e,frameRate:{ideal:24,max:30}},audio:!1}}var Pe=600;function q(){if(typeof window>"u"||typeof navigator>"u")return"desktop";let 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(Number(navigator.maxTouchPoints??0)<=1)return"desktop";if(/Macintosh/.test(t))return"tablet";if(!Bt())return"desktop";let r=Ht();return r>0&&r<Pe?"phone":"tablet"}function de(){return q()!=="desktop"}function Ht(){try{let t=window.screen,e=Number(t?.width??0),r=Number(t?.height??0);return e>0&&r>0?Math.min(e,r):0}catch{return 0}}function me(t){try{let r=t?.getVideoTracks?.()[0]?.getSettings?.().facingMode;return r==="user"||r==="environment"?r:null}catch{return null}}function Bt(){try{return typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches}catch{return!1}}var Wt=.45,Kt=.9,Ut=.4;var Fe=1e4,X=class t{constructor(e,r){this.tier="blaze";this.inner=e,r!==void 0&&(this.fallbackReason=r)}static async create(e,r){let i=await import("@mediapipe/tasks-vision"),n=await i.FilesetResolver.forVisionTasks(e),a=await i.FaceDetector.createFromOptions(n,{baseOptions:{modelAssetPath:`${e}/blaze_face_short_range.tflite`,delegate:"CPU"},runningMode:"IMAGE"});return new t(a,r)}async detect(e,r,i){let n;try{n=this.inner.detect(e).detections}catch{return null}let a=zt(n);if(a?.boundingBox===void 0)return null;let o=C(e),s=qt(a.keypoints,o),l=a.keypoints?.[2],c={box:{x:a.boundingBox.originX,y:a.boundingBox.originY,width:a.boundingBox.width,height:a.boundingBox.height},...s!==void 0?{eyes:s}:{},...l!==void 0?{nose:{x:l.x*o.width,y:l.y*o.height}}:{},score:a.categories[0]?.score??0};return F(c,e,r,i)}destroy(){try{this.inner.close()}catch{}}};function zt(t){let e,r=-1;for(let i of t){let n=i.categories[0]?.score??0;n>r&&(e=i,r=n)}return e}function qt(t,e){let r=t?.[0],i=t?.[1];if(r===void 0||i===void 0)return;let n=s=>({x:s.x*e.width,y:s.y*e.height}),[a,o]=[n(r),n(i)];return a.x<=o.x?{left:a,right:o}:{left:o,right:a}}function Xt(){if(typeof OffscreenCanvas=="function")return new OffscreenCanvas(2,2);let t=document.createElement("canvas");return t.width=2,t.height=2,t}async function Le(){let t=globalThis.FaceDetector;if(typeof t!="function")return{ok:!1,reason:"unsupported"};try{let e=new t({fastMode:!0,maxDetectedFaces:1});return await e.detect(Xt()),{ok:!0,instance:e}}catch(e){return{ok:!1,reason:`smoke_failed:${e instanceof Error?e.message:String(e)}`}}}var Y=class{constructor(e,r){this.tier="native";this.inner=e,r!==void 0&&(this.fallbackReason=r)}async detect(e,r,i){let n;try{n=await this.inner.detect(e)}catch{return null}let a=n[0];if(a===void 0)return null;let o=Yt(a.landmarks),s={box:{x:a.boundingBox.x,y:a.boundingBox.y,width:a.boundingBox.width,height:a.boundingBox.height},...o!==void 0?{eyes:o}:{},score:1};return F(s,e,r,i)}destroy(){}};function Yt(t){if(t===void 0)return;let e=t.filter(n=>n.type==="eye").map(n=>n.locations[0]).filter(n=>n!==void 0),[r,i]=e;if(!(r===void 0||i===void 0))return r.x<=i.x?{left:r,right:i}:{left:i,right:r}}var Ne="/models-v3",Ve=["native","blaze"],w=class extends Error{constructor(e){super(`no detector tier available (${e})`),this.name="DetectorLadderError",this.fallbackReason=e}};function C(t){let e=t;if(typeof e.videoWidth=="number"&&e.videoWidth>0)return{width:e.videoWidth,height:e.videoHeight??0};if(typeof e.naturalWidth=="number"&&e.naturalWidth>0)return{width:e.naturalWidth,height:e.naturalHeight??0};let r=typeof e.width=="number"?e.width:0,i=typeof e.height=="number"?e.height:0;return{width:r,height:i}}function F(t,e,r,i){let n=C(e),a=n.width>0?r/n.width:1,o=n.height>0?i/n.height:1,s=l=>({x:l.x*a,y:l.y*o});return{box:{x:t.box.x*a,y:t.box.y*o,width:t.box.width*a,height:t.box.height*o},...t.eyes!==void 0?{eyes:{left:s(t.eyes.left),right:s(t.eyes.right)}}:{},...t.nose!==void 0?{nose:s(t.nose)}:{},score:t.score}}function Zt(t){return t instanceof Error?t.message:String(t)}async function x(t){let e=t.preferred??Ve,r=[];for(let i of e){if(i==="native"){let n=await Le();if(n.ok)return new Y(n.instance,pe(r));r.push(`native:${n.reason}`);continue}try{return await jt(X.create(t.v3AssetBaseUrl??Ne,pe(r)),t.blazeInitTimeoutMs??Fe)}catch(n){r.push(n instanceof Z?"blaze:blaze_init_timeout":`blaze:${Zt(n)}`)}}throw new w(pe(r)??"no_tier_available")}function pe(t){return t.length>0?t.join("; "):void 0}var Z=class extends Error{};function jt(t,e){return new Promise((r,i)=>{let n=setTimeout(()=>{i(new Z(`init exceeded ${e}ms`)),t.then(a=>a.destroy(),()=>{})},e);t.then(a=>{clearTimeout(n),r(a)},a=>{clearTimeout(n),i(a)})})}var cn=180,L=[100,190],Qt=64;function Ge(t,e){return .299*(t[e]??0)+.587*(t[e+1]??0)+.114*(t[e+2]??0)}function j(t){let{data:e,width:r,height:i}=t,n=r*i;if(n===0)return 0;let a=0;for(let o=0;o<n;o+=1)a+=Ge(e,o*4);return a/n}function Q(t){let{data:e,width:r,height:i}=t;if(r<3||i<3)return 0;let n=new Float32Array(r*i);for(let u=0;u<n.length;u+=1)n[u]=Ge(e,u*4);let a=0,o=0,s=0;for(let u=1;u<i-1;u+=1)for(let d=1;d<r-1;d+=1){let m=u*r+d,p=(n[m-r]??0)+(n[m-1]??0)+(n[m+1]??0)+(n[m+r]??0)-4*(n[m]??0);a+=p,o+=p*p,s+=1}if(s===0)return 0;let l=a/s,c=o/s-l*l;return Math.min(1,Math.max(0,c)/180)}function fe(t){let e=j(t),[r,i]=L,n=e<r?r-e:e>i?e-i:0;return Math.max(0,1-n/Qt)}var He=Object.freeze({Q_GOOD:.6,RISE_PER_S:.9,FALL_PER_S:.25,CENTER_FALLOFF_IOD_MULTIPLE:1.35,BOX_EYE_OFFSET_FACTOR:.12,IOD_BOX_PROXY_FACTOR:.42,SIZE_IDEAL_MIN:.12,SIZE_IDEAL_MAX:.3,SIZE_HARD_MIN:.08,SIZE_HARD_MAX:.45,ROLL_MAX_DEG:25,MOTION_VELOCITY_IOD_PER_S:.5,MOTION_TAU_S:.4,MOTION_DEADBAND_IOD_PER_S:.1,READY_WINDOW_MS:500,GUIDE_SIZE:.6,GUIDE_CENTERING:.6,GUIDE_POSE:.6,GUIDE_EXPOSURE:.6,GUIDE_SHARPNESS:.35,GUIDE_MOTION:.5}),_=t=>Math.min(1,Math.max(0,t)),R=class{constructor(e={}){this.p=0;this.lastTickAt=null;this.lastCenter=null;this.velocityEma=0;this.qWindow=[];this.lastSizeDirection="ideal";this.t={...He,...e}}reset(){this.p=0,this.lastTickAt=null,this.lastCenter=null,this.velocityEma=0,this.qWindow=[],this.lastSizeDirection="ideal"}tick(e){let{observation:r,quality:i,timestampMs:n}=e,a=this.lastTickAt===null?0:Math.max(0,(n-this.lastTickAt)/1e3);this.lastTickAt=n;let o={presence:0,centering:0,size:0,pose:0,sharpness:_(i.sharpness),exposure:_(i.exposure),motion:1};if(r!==null){o.presence=1;let u=this.geometryOf(r,e);o.centering=u.centering,o.size=u.size,o.pose=u.pose,o.motion=this.motionOf(u.center,u.iod,n)}else this.lastCenter=null,this.velocityEma=0;let s=Math.min(o.presence,o.centering,o.size,o.pose,o.sharpness,o.exposure,o.motion);this.p=_(this.p+(s>=this.t.Q_GOOD?this.t.RISE_PER_S*s:-this.t.FALL_PER_S*(1-s))*a),this.qWindow.push({at:n,q:s}),this.qWindow=this.qWindow.filter(u=>u.at>=n-this.t.READY_WINDOW_MS);let l=this.qWindow.map(u=>u.q);if(l.length>=3){let u=Math.min(...l),d=l.indexOf(u);l=l.filter((m,p)=>p!==d)}let c=this.p>=1&&l.every(u=>u>=this.t.Q_GOOD);return{at:n,q:s,p:this.p,factors:o,guidanceKey:this.guidanceOf(o,i,s),ready:c,accepted:s>=this.t.Q_GOOD}}geometryOf(e,r){let{box:i,eyes:n}=e,a={x:r.frameWidth/2,y:r.frameHeight/2},o=Math.min(r.frameWidth,r.frameHeight),s=n!==void 0?{x:(n.left.x+n.right.x)/2,y:(n.left.y+n.right.y)/2}:{x:i.x+i.width/2,y:i.y+i.height/2-this.t.BOX_EYE_OFFSET_FACTOR*i.height},l=n!==void 0?Math.hypot(n.right.x-n.left.x,n.right.y-n.left.y):this.t.IOD_BOX_PROXY_FACTOR*i.width,c=Math.hypot(s.x-a.x,s.y-a.y),u=l<=0?0:1-_(c/(this.t.CENTER_FALLOFF_IOD_MULTIPLE*l)),d=o>0?l/o:0;this.lastSizeDirection=d<this.t.SIZE_IDEAL_MIN?"far":d>this.t.SIZE_IDEAL_MAX?"close":"ideal";let m;d<this.t.SIZE_HARD_MIN||d>this.t.SIZE_HARD_MAX?m=0:d<this.t.SIZE_IDEAL_MIN?m=(d-this.t.SIZE_HARD_MIN)/(this.t.SIZE_IDEAL_MIN-this.t.SIZE_HARD_MIN):d>this.t.SIZE_IDEAL_MAX?m=(this.t.SIZE_HARD_MAX-d)/(this.t.SIZE_HARD_MAX-this.t.SIZE_IDEAL_MAX):m=1;let p=1;if(n!==void 0){let f=Math.abs(Math.atan2(n.right.y-n.left.y,n.right.x-n.left.x))*180/Math.PI;p=1-_(f/this.t.ROLL_MAX_DEG)}return{center:s,iod:l,centering:u,size:m,pose:p}}motionOf(e,r,i){let n=this.lastCenter;if(this.lastCenter={...e,at:i},n===null||r<=0)return 1;let a=(i-n.at)/1e3;if(a<=0)return 1;let o=Math.hypot(e.x-n.x,e.y-n.y)/r/a;o<=this.t.MOTION_DEADBAND_IOD_PER_S&&(o=0);let s=1-Math.exp(-a/this.t.MOTION_TAU_S);return this.velocityEma=s*o+(1-s)*this.velocityEma,1-_(this.velocityEma/this.t.MOTION_VELOCITY_IOD_PER_S)}guidanceOf(e,r,i){if(e.presence<=0)return"fcv3.no_face";if(e.size<this.t.GUIDE_SIZE)return this.sizeGuidance();if(e.centering<this.t.GUIDE_CENTERING)return"fcv3.center_face";if(e.pose<this.t.GUIDE_POSE)return"fcv3.straighten";if(e.exposure<this.t.GUIDE_EXPOSURE)return this.exposureGuidance(r);if(e.sharpness<this.t.GUIDE_SHARPNESS)return"fcv3.steady_camera";if(e.motion<this.t.GUIDE_MOTION)return"fcv3.hold_still";if(i<this.t.Q_GOOD){let n=[["size",this.sizeGuidance()],["centering","fcv3.center_face"],["pose","fcv3.straighten"],["exposure",this.exposureGuidance(r)],["sharpness","fcv3.steady_camera"],["motion","fcv3.hold_still"]],a=n[0];for(let o of n)e[o[0]]<e[a[0]]&&(a=o);return a[1]}return"fcv3.hold_still"}sizeGuidance(){return this.lastSizeDirection==="far"?"fcv3.come_closer":"fcv3.move_back"}exposureGuidance(e){let r=(L[0]+L[1])/2;return e.meanLuma<r?"fcv3.more_light":"fcv3.too_bright"}};var Be=Object.freeze({LOW:Object.freeze({cadenceHz:5,inputWidth:128,animations:"reduced"}),MID:Object.freeze({cadenceHz:8,inputWidth:160,animations:"full"}),HIGH:Object.freeze({cadenceHz:10,inputWidth:192,animations:"full"})}),$t=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]);function ge(){let t=typeof navigator>"u"?void 0:navigator,e=!1;try{e=typeof WebAssembly<"u"&&WebAssembly.validate($t)}catch{e=!1}return{cores:t?.hardwareConcurrency??2,memGB:t?.deviceMemory??null,simd:e}}function be(t){let e=t.memGB??4;return t.cores<4||e<3?"LOW":t.cores>=8&&e>=6?"HIGH":"MID"}var he=["LOW","MID","HIGH"],N=class{constructor(e){this.samples=[];this.adjusted=!1;this.current=e}get deviceClass(){return this.current}get profile(){return Be[this.current]}record(e){if(this.adjusted||this.samples.length>=10)return this.current;if(this.samples.push(e),this.samples.length<10)return this.current;this.adjusted=!0;let r=this.samples.reduce((i,n)=>i+n,0)/this.samples.length;if(r>70)this.current="LOW";else if(r<25){let i=he.indexOf(this.current);this.current=he[Math.min(he.length-1,i+1)]??this.current}return this.current}};var V=class{constructor(e){this.timer=null;this.frameCallbackId=null;this.running=!1;this.busy=!1;this.lastRunAt=Number.NEGATIVE_INFINITY;this.degradeCount=0;this.durations=[];this.options=e,this.periodMs=1e3/e.cadenceHz}start(){if(this.running)return;this.running=!0;let e=this.options.video;if(typeof e?.requestVideoFrameCallback=="function"){let r=()=>{this.running&&(this.frameCallbackId=e.requestVideoFrameCallback?.(()=>{this.frameCallbackId=null,this.now()-this.lastRunAt>=this.periodMs&&this.tick(),r()}))};r();return}this.timer=setInterval(()=>this.tick(),this.periodMs)}stop(){this.running=!1,this.timer!==null&&(clearInterval(this.timer),this.timer=null),this.frameCallbackId!==null&&(this.options.video?.cancelVideoFrameCallback?.(this.frameCallbackId),this.frameCallbackId=null)}stats(){let e=this.durations.length===0?0:this.durations.reduce((r,i)=>r+i,0)/this.durations.length;return{degradeCount:this.degradeCount,meanDetectMs:e}}now(){return this.options.now?.()??performance.now()}tick(){if(!this.running)return;if(this.busy){this.degradeCount+=1;return}this.busy=!0,this.lastRunAt=this.now();let e=this.now();this.options.run().catch(()=>{}).finally(()=>{this.busy=!1,this.durations.push(this.now()-e),this.durations.length>20&&this.durations.shift()})}};var We="0.1.0-rc.20";var Jt=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function Ke(t){let e=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));return Jt.test(e)}var Je="sekyro.did",br=1e4,rt=()=>globalThis.process?.versions?.node,et;function tt(){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,r=>r.toString(16).padStart(2,"0")).join("")}}catch{}}function yr(){try{let t=localStorage.getItem(Je);if(t)return t;let e=tt();return e!==void 0&&localStorage.setItem(Je,e),e}catch{return et??(et=tt()),et}}async function vr(){let t=globalThis.crypto?.subtle;if(!t)return"";let e=navigator,r=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(r));return Array.from(new Uint8Array(i),n=>n.toString(16).padStart(2,"0")).join("").slice(0,32)}function Sr(t){let e=new TextEncoder().encode(t),r="";for(let i of e)r+=String.fromCharCode(i);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Er(t){let e,r,i,n,a,o,s=()=>o?.readyState==="live",l=()=>{a!==void 0||!globalThis.crypto?.subtle||rt()||s()||(a=Promise.race([Promise.resolve().then(()=>($e(),Qe)),new Promise(c=>setTimeout(c,br))]).then(c=>c?.computePrint(s)).then(c=>{c==="busy"?a=void 0:n=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){r=c},noteCameraTrack(c){o=c},async deviceHeader(){try{i??(i=vr().catch(()=>""));let c=[];navigator.webdriver&&c.push("webdriver"),/HeadlessChrome/.test(navigator.userAgent)&&c.push("headless");let u=await i,d=yr(),m={v:1,platform:"web",sdk:t.sdk.slice(0,64),ids:[...d?[{kind:"web_local",value:d.slice(0,128)}]:[],...u?[{kind:"web_fp",value:u}]:[]],screen:{w:screen.width,h:screen.height,dpr:globalThis.devicePixelRatio??1},...e?{cameraLabel:e}:{},...c.length?{signals:c}:{},...n?{print:{v:2,...n,...r?{camera:r}:{}}}:{},...Ke()?{inApp:!0}:{}},p=Sr(JSON.stringify(m));return l(),p}catch{return}},printReady(){return a??Promise.resolve()}}}var Ee=Symbol.for("sekyro.web.clientContext"),Me=globalThis,Te=Me[Ee]??(Me[Ee]=Er({sdk:`@sekyro/web@${We}`}));function nt(t){try{let e=t.getVideoTracks?.()[0];if(e){if(Te.noteCameraLabel(e.label),Te.noteCameraTrack(e),rt())return;Promise.resolve().then(()=>(Se(),Xe)).then(r=>r.noteCameraTrait(e,Te)).catch(()=>{})}}catch{}}var ke=Symbol.for("sekyro.web.cameraStreams"),Ce=globalThis,Mr=Ce[ke]??(Ce[ke]=new Set);function it(t){try{Mr.add(t)}catch{}}var Tr=["obs","manycam","virtual","snap camera","xsplit","droidcam","iriun","camo"],kr=[/^(front|back|rear)( [a-z ]+)? camera$/i,/^camera2? ?\d+, facing (front|back|external)/i,/facetime/i,/\b(integrated|built-in|builtin) (web)?cam(era)?\b/i,/\b(hd )?web ?cam\b/i,/\([0-9a-f]{4}:[0-9a-f]{4}\)\s*$/i];function Cr(t){let e=(t??"").trim().toLowerCase();return e.length===0?"unknown":Tr.some(r=>e.includes(r))?"known_virtual":kr.some(r=>r.test(e))?"platform":"unknown"}function at(t){if(typeof t!="function")return!1;try{return/\{\s*\[native code\]\s*\}\s*$/.test(Function.prototype.toString.call(t))}catch{return!1}}function wr(t=globalThis){return at(t.navigator?.mediaDevices?.getUserMedia)&&at(t.MediaStreamTrack?.prototype?.getSettings)}async function xr(t,e=globalThis){let r=e.crypto?.subtle?.digest;if(typeof r=="function")try{let i=new Uint8Array(await r.call(e.crypto?.subtle,"SHA-256",new TextEncoder().encode(t)));return Array.from(i.subarray(0,8),n=>n.toString(16).padStart(2,"0")).join("")}catch{return}}async function ot(t,e=globalThis){let r={};try{r=typeof t.getSettings=="function"?t.getSettings()??{}:{}}catch{r={}}let i={};if((r.facingMode==="user"||r.facingMode==="environment"||r.facingMode==="left"||r.facingMode==="right")&&(i.facingMode=r.facingMode),typeof r.frameRate=="number"&&Number.isFinite(r.frameRate)&&(i.frameRate=r.frameRate),typeof r.width=="number"&&Number.isFinite(r.width)&&(i.width=r.width),typeof r.height=="number"&&Number.isFinite(r.height)&&(i.height=r.height),typeof r.deviceId=="string"&&r.deviceId.length>0){let a=await xr(r.deviceId,e);a!==void 0&&(i.deviceIdHash=a)}let n;try{n=t.label}catch{n=void 0}return{trackSettings:i,capabilitiesPresent:typeof t.getCapabilities=="function",labelClass:Cr(n),prototypesIntact:wr(e)}}var we=t=>Math.round(t*100)/100;function st(t){let e=t,r=typeof e?.requestVideoFrameCallback=="function",i=null,n=null,a=0,o=0,s=0,l=0,c=0,u=0,d=()=>{!r||e?.requestVideoFrameCallback===void 0||(i=e.requestVideoFrameCallback((m,p)=>{if(i=null,!r)return;let f=p.presentationTime;if(n!==null){let h=f-n.presentationTimeMs;o+=1;let g=h-s;s+=g/o,l+=g*(h-s)}typeof p.captureTime=="number"&&Number.isFinite(p.captureTime)&&(c+=f-p.captureTime,u+=1),a+=1,n={mediaTimeMs:p.mediaTime*1e3,presentationTimeMs:f},d()}))};return d(),{latest:()=>n,stats:()=>({n:a,meanGapMs:o===0?0:we(s),stdGapMs:o<2?0:we(Math.sqrt(l/(o-1))),captureLatencyMs:u===0?null:we(c/u)}),stop:()=>{r&&(r=!1,i!==null&&e?.cancelVideoFrameCallback?.(i),i=null)}}}function ct(t,e,r){return{...t,rvfc:e,rampPainter:r}}var _r=["rose","peach","sand","mint","sky","lilac"];var Rr=4,Dr=4;function Ir(t){if(typeof t!="object"||t===null)return!1;let e=t;if(typeof e.nonce!="string"||e.nonce.length===0||!Array.isArray(e.colours)||e.colours.length!==3||!e.colours.every(i=>_r.includes(i))||!Array.isArray(e.onsetsMs)||e.onsetsMs.length!==3)return!1;let r=-1;for(let i of e.onsetsMs){if(typeof i!="number"||!Number.isFinite(i)||i<=r||i>=2e3)return!1;r=i}return!0}function ut(t,e){let r=e.now??(()=>performance.now()),i=Ir(t)?t:void 0,n=[],a=null,o=null,s=null,l=!1,c=null,u=f=>{c=f;try{e.paint(f)}catch{}},d=f=>{let h=e.frames?.()??null;return h!==null&&s!==null?h.mediaTimeMs+(f-h.presentationTimeMs)-s:f-(o??f)},m=(f,h,g=0)=>{if(l)return;let S=Math.max(0,f-d(r()));a=setTimeout(()=>{if(a=null,!l){if(g<Rr&&d(r())<f-Dr){m(f,h,g+1);return}h()}},S)},p=f=>{if(i!==void 0){if(f>=3){m(2e3,()=>u(null));return}m(i.onsetsMs[f],()=>{let h=d(r());if(h>2e3){c!==null&&u(null);return}let g=i.colours[f];u(g);let S=n.length===0?0:n[n.length-1].tMs;n.push({tMs:Math.max(S,Math.round(h)),colour:g}),p(f+1)})}};return{started(f){if(i===void 0||l||o!==null)return;o=f;let h=e.frames?.()??null;s=h===null?null:h.mediaTimeMs+(f-h.presentationTimeMs),p(0)},stop(){l||(l=!0,a!==null&&clearTimeout(a),a=null,c!==null&&u(null))},report(){return i===void 0?void 0:{nonce:i.nonce,rendered:[...n]}}}}var Ar=40;function H(t){if(t===null||typeof t!="object"&&typeof t!="function")return;let e;try{e=t.name}catch{return}return Or(e)}function Or(t){if(typeof t!="string")return;let e=t.replace(/[^A-Za-z]/g,"").slice(0,Ar);return e===""?void 0:e}function lt(t){let e=oe(t);if(e!=="generic")return e;switch(H(t)){case"AbortError":return"inuse";case"SecurityError":return"permission";default:return e}}var M=1;function dt(){return typeof OffscreenCanvas=="function"&&typeof createImageBitmap=="function"&&typeof Worker=="function"}function Pr(t,e={}){let r=e.createDetector??x,i=null;t.onmessage=n=>{let a=n.data;if(a.v!==M){a.bitmap?.close?.();return}if(a.type==="init"){r(a.options).then(o=>{i=o;let s={v:M,type:"ready",tier:o.tier,...o.fallbackReason!==void 0?{fallbackReason:o.fallbackReason}:{}};t.postMessage(s)});return}if(a.type==="detect"){let o=s=>{let l={v:M,type:"result",id:a.id,observation:s};t.postMessage(l),a.bitmap.close?.()};if(i===null){o(null);return}i.detect(a.bitmap,a.streamWidth,a.streamHeight).then(o,()=>o(null))}}}typeof self<"u"&&typeof self.importScripts=="function"&&Pr(self);var J=class t{constructor(e,r){this.pending=new Map;this.nextId=1;this.worker=e,this.tier=r.tier,r.fallbackReason!==void 0&&(this.fallbackReason=r.fallbackReason),e.addEventListener("message",i=>{let n=i.data;if(n.v!==M||n.type!=="result")return;let a=this.pending.get(n.id);this.pending.delete(n.id),a?.(n.observation)})}static create(e,r,i=1e4){return new Promise((n,a)=>{let o=setTimeout(()=>{e.removeEventListener("message",s),e.terminate(),a(new Error(`worker detector not ready within ${i}ms`))},i),s=c=>{let u=c.data;u.v!==M||u.type!=="ready"||(clearTimeout(o),e.removeEventListener("message",s),n(new t(e,u)))};e.addEventListener("message",s);let l={v:M,type:"init",options:r};e.postMessage(l)})}async detect(e,r,i){let n;try{typeof ImageBitmap<"u"&&e instanceof ImageBitmap?n=e:typeof createImageBitmap=="function"?n=await createImageBitmap(e):n=e}catch{return null}let a=this.nextId;return this.nextId+=1,new Promise(o=>{this.pending.set(a,o);let s={v:M,type:"detect",id:a,bitmap:n,streamWidth:r,streamHeight:i};this.worker.postMessage(s,[n])})}destroy(){for(let e of this.pending.values())e(null);this.pending.clear(),this.worker.terminate()}};var Fr=["size","centering","pose","exposure","sharpness","motion"];function mt(t){if(t.accepted)return null;if(t.factors.presence<=0)return"no_face";let e="size";for(let r of Fr)t.factors[r]<t.factors[e]&&(e=r);return e}var D=class{constructor(){this.blocked={};this.acceptedMs=0;this.ticks=0;this.lastAt=null}record(e){let r=this.lastAt===null?0:Math.max(0,e.at-this.lastAt);this.lastAt=e.at,this.ticks+=1;let i=mt(e);if(i===null){this.acceptedMs+=r;return}let n=this.blocked[i]??{count:0,ms:0};n.count+=1,n.ms+=r,this.blocked[i]=n}summary(){let e={};for(let[r,i]of Object.entries(this.blocked))e[r]={count:i.count,ms:Math.round(i.ms)};return{blocked:e,acceptedMs:Math.round(this.acceptedMs),ticks:this.ticks}}};var kt=1e3,te="fcv3.hold_upright",Ct=200,re=4,wt=600,xt=1e3,Mt={sharpness:1,exposure:1,meanLuma:128};function Wr(t,e){return e.width=t.videoWidth,e.height=t.videoHeight,e.getContext("2d").drawImage(t,0,0),new Promise((r,i)=>e.toBlob(n=>n?r(n):i(new Error("empty-keyframe")),"image/jpeg",.92))}function Kr(){return q()==="phone"}var _e=class{constructor(e){this.handlers=new Map;this.stateValue="idle";this.attempt=0;this.stream=null;this.detector=null;this.scheduler=null;this.gate=null;this.profiler=null;this.lastGuidanceKey=null;this.positioningStartedAt=0;this.cameraRequestedAt=null;this.cameraReadyAt=null;this.faceAcquiredAt=null;this.captureCompleteAt=null;this.fired=!1;this.carriedDegrade=0;this.carriedMeans=[];this.blockStats=null;this.lastGateSnapshotAt=Number.NEGATIVE_INFINITY;this.uprightGuard=!1;this.trackProvenance=null;this.ramp=null;this.snapshotCanvas=null;this.options=e,this.facing=e.facingMode??"user"}get state(){return this.stateValue}on(e,r){let i=this.handlers.get(e);return i||(i=new Set,this.handlers.set(e,i)),i.add(r),()=>i?.delete(r)}emit(e,r){for(let i of[...this.handlers.get(e)??[]])i(r)}async start(e={}){e.facingMode!==void 0&&(this.facing=e.facingMode),this.attempt+=1,await this.run(this.attempt)}get facingMode(){return this.facing}retry(){this.teardownAttempt(),this.start()}switchCamera(){this.facing=this.facing==="user"?"environment":"user",this.teardownAttempt(),this.start()}destroy(){this.attempt+=1,this.teardownAttempt(),this.detector?.destroy(),this.detector=null,this.options.video.srcObject=null}async run(e){let{options:r}=this;this.fired=!1,this.lastGuidanceKey=null,this.carriedDegrade=0,this.carriedMeans=[],this.cameraRequestedAt=null,this.cameraReadyAt=null,this.faceAcquiredAt=null,this.captureCompleteAt=null,this.uprightGuard=(r.isPhone??Kr)(),this.setState("preflight");let i=se();if(i!=="OK"){this.fail(i==="INSECURE_CONTEXT"?"insecure":"unsupported",{phase:"preflight"});return}this.setState("acquiring");let n=r.getUserMedia??(c=>navigator.mediaDevices.getUserMedia(c)),a;this.cameraRequestedAt=this.now();try{a=await n(le(de(),this.facing))}catch(c){if(e!==this.attempt)return;this.fail(lt(c),{phase:"acquiring",name:H(c)});return}if(nt(a),it(a),e!==this.attempt){for(let c of a.getTracks())c.stop();return}this.stream=a;let o=a.getVideoTracks?.()[0];if(this.trackProvenance=o===void 0?null:ot(o).catch(()=>null),this.facing=me(a)??this.facing,r.video.srcObject=a,await r.video.play().catch(()=>{}),e!==this.attempt)return;if(this.cameraReadyAt=this.now(),this.detector===null){let c={v3AssetBaseUrl:r.v3AssetBaseUrl},u=r.createDetector??(r.createWorker!==void 0&&dt()?async()=>{try{return await J.create(r.createWorker(),c)}catch{return x(c)}}:()=>x(c)),d;try{d=await u()}catch(m){e===this.attempt&&this.fail("models",{phase:"models",name:H(m)},m instanceof w?m.fallbackReason:zr(m));return}if(e!==this.attempt){d.destroy();return}this.detector=d,this.options.telemetry?.({type:"detector",tier:d.tier,fallbackReason:d.fallbackReason})}let s=ge(),l=r.deviceClass??be(s);this.profiler=new N(l),this.options.telemetry?.({type:"profile",staticClass:l,activeClass:this.profiler.deviceClass,simd:s.simd}),this.gate=new R(r.thresholds??{}),this.blockStats=new D,this.lastGateSnapshotAt=this.now(),r.rankKeyframes?.()&&Promise.resolve().then(()=>(Et(),St)).then(c=>xe=c,()=>{}),this.setState("positioning"),this.positioningStartedAt=this.now(),this.startScheduler(e)}get animations(){return this.profiler?.profile.animations??"full"}startScheduler(e){let r=this.profiler;if(r===null)return;if(this.scheduler!==null){let n=this.scheduler.stats();this.carriedDegrade+=n.degradeCount,n.meanDetectMs>0&&this.carriedMeans.push(n.meanDetectMs),this.scheduler.stop()}let i=new V({cadenceHz:r.profile.cadenceHz,video:this.options.video,now:this.options.now,run:()=>this.detectTick(e)});this.scheduler=i,i.start()}async detectTick(e){let{detector:r,gate:i,profiler:n}=this,a=this.options.video;if(e!==this.attempt||r===null||i===null||n===null||this.fired||a.videoWidth===0)return;if(this.isLandscape()){this.holdUpright(e);return}let o=n.deviceClass,s=this.now(),l=this.options.makeSnapshot?.(a,n.profile.inputWidth)??this.defaultSnapshot(a,n.profile.inputWidth),c=null;try{c=await r.detect(l,a.videoWidth,a.videoHeight)}catch{c=null}if(e!==this.attempt||this.fired)return;n.record(this.now()-s),n.deviceClass!==o&&this.startScheduler(e);let u=c===null?Mt:this.options.measureQuality?.(a,c.box)??this.defaultQuality(a,c.box),d=i.tick({timestampMs:this.now(),observation:c,quality:u,frameWidth:a.videoWidth,frameHeight:a.videoHeight});d.accepted&&this.faceAcquiredAt===null&&(this.faceAcquiredAt=d.at),this.blockStats?.record(d),!d.ready&&d.at-this.lastGateSnapshotAt>=kt&&(this.lastGateSnapshotAt=d.at,this.reportGate(!1)),this.emit("checks",{engine:"v3",progress:d.p,q:d.q,factors:d.factors,attempt:e}),d.guidanceKey!==this.lastGuidanceKey&&(this.lastGuidanceKey=d.guidanceKey,this.emit("guidance",{key:d.guidanceKey})),d.ready&&this.stateValue==="positioning"&&(this.fired=!0,this.captureCompleteAt=d.at,this.fire(e))}async fire(e){let{options:r}=this,i=this.scheduler;i?.stop(),this.reportGate(!0);let n=i?.stats()??{degradeCount:0,meanDetectMs:0},a=[...this.carriedMeans,...n.meanDetectMs>0?[n.meanDetectMs]:[]];r.telemetry?.({type:"fired",timeToGateMs:this.now()-this.positioningStartedAt,degradeCount:this.carriedDegrade+n.degradeCount,meanDetectMs:a.length===0?0:a.reduce((b,E)=>b+E,0)/a.length});let o=r.mode??"clip",s=r.rankKeyframes?.()&&xe?xe.default(this,e).catch(()=>this.collectKeyframes(e)):this.collectKeyframes(e);if(o==="photo"){let b=this.watchRotation(e,null),E=await s;if(b(),e!==this.attempt)return;if(E===null){this.fail("generic",{phase:"keyframes"});return}let _t=await this.provenance({n:0,meanGapMs:0,stdGapMs:0,captureLatencyMs:null},!1);if(e!==this.attempt)return;this.finishCapture({keyframe:E.blob,previewDataUrl:E.previewDataUrl,..._t});return}this.setState("recording");let l=r.createRecorder?.()??new P,c=this.stream;if(c===null){this.fail("generic",{phase:"recording"});return}let u=st(r.video),d=r.screenRamp?.(),m=d!==void 0,p=ut(d,{paint:b=>{(b===null||e===this.attempt)&&this.emit("ramp",{colour:b})},now:()=>this.now(),frames:u.latest});this.ramp=p;let f=()=>{u.stop(),p.stop(),this.ramp===p&&(this.ramp=null)},h=this.watchRotation(e,l),g=null;s.then(b=>{g=b},()=>{});let S=()=>{e===this.attempt&&g!==null&&this.emit("frozen",{previewDataUrl:g.previewDataUrl})},v,T;try{[v,T]=await Promise.all([l.record(c,S,()=>p.started(this.now())),s])}catch(b){if(h(),f(),e!==this.attempt)return;let E=b.kind;this.fail(E==="cliptoolarge"?"cliptoolarge":"recorder",{phase:"recording",name:H(b)});return}h();let k=u.stats();if(f(),e!==this.attempt)return;if(O(v.blob)){this.fail("cliptoolarge",{phase:"recording"});return}if(T===null){this.fail("generic",{phase:"keyframes"});return}let A=p.report(),ne=await this.provenance(k,m);e===this.attempt&&this.finishCapture({clip:v.blob,clipMimeType:v.mimeType,keyframe:T.blob,previewDataUrl:T.previewDataUrl,...A!==void 0&&A.rendered.length>0?{screenRamp:A}:{},...ne})}async provenance(e,r){let i=this.trackProvenance;if(i===null)return{};let n,a=new Promise(s=>{n=setTimeout(()=>s(null),xt)}),o=await Promise.race([i,a]);return clearTimeout(n),o===null?{}:{provenance:ct(o,e,r)}}isLandscape(){let e=this.options.video;return this.uprightGuard&&e.videoWidth>e.videoHeight}holdUpright(e){this.gate?.reset(),this.emit("checks",{engine:"v3",progress:0,q:0,factors:{presence:0,centering:0,size:0,pose:0,sharpness:0,exposure:0,motion:0},attempt:e}),this.lastGuidanceKey!==te&&(this.lastGuidanceKey=te,this.emit("guidance",{key:te}))}watchRotation(e,r){if(!this.uprightGuard)return()=>{};let i=this.options.video,n=()=>{if(e!==this.attempt||r!==null&&this.stateValue!=="recording"){s();return}i.videoWidth>0&&this.isLandscape()&&(s(),this.abortRecording(e,r))},a=setInterval(n,Ct);i.addEventListener?.("resize",n);let o=!1;function s(){o||(o=!0,clearInterval(a),i.removeEventListener?.("resize",n))}return s}abortRecording(e,r){if(e!==this.attempt)return;this.attempt+=1;let i=this.attempt;try{r?.stop()}catch{}this.ramp?.stop(),this.ramp=null,this.fired=!1,this.captureCompleteAt=null,this.gate=new R(this.options.thresholds??{}),this.blockStats=new D,this.lastGateSnapshotAt=this.now(),this.lastGuidanceKey=null,this.setState("positioning"),this.positioningStartedAt=this.now(),this.holdUpright(i),this.startScheduler(i)}async collectKeyframes(e){let r=this.options.captureKeyframe??(a=>this.defaultKeyframe(a)),i=wt/(re-1),n=null;for(let a=0;a<re;a+=1){if(e!==this.attempt)return n;try{let o=await r(this.options.video);(n===null||o.sharpness>n.sharpness)&&(n=o)}catch{}a<re-1&&await Ur(i)}return n}finishCapture(e){this.stopTracks(),this.setState("captured");let r=this.captureTiming();this.emit("artifacts",r===void 0?e:{...e,timing:r})}captureTiming(){let e={},r=(i,n,a)=>{n!==null&&a!==null&&(e[i]=Math.max(0,Math.round(a-n)))};return r("cameraReadyMs",this.cameraRequestedAt,this.cameraReadyAt),r("faceAcquireMs",this.cameraReadyAt,this.faceAcquiredAt),r("captureMs",this.faceAcquiredAt,this.captureCompleteAt),Object.keys(e).length>0?e:void 0}async defaultKeyframe(e){let r=document.createElement("canvas"),i=await(this.facing==="user"?ce:Wr)(e,r),n=r.toDataURL("image/jpeg",.92);return{blob:i,previewDataUrl:n,sharpness:this.centerSharpness(e)}}defaultSnapshot(e,r){try{let i=this.snapshotCanvas??document.createElement("canvas"),n=r/Math.max(1,e.videoWidth),a=Math.max(1,Math.round(e.videoWidth*n)),o=Math.max(1,Math.round(e.videoHeight*n)),s=i.getContext("2d");return s===null?e:(i.width!==a&&(i.width=a),i.height!==o&&(i.height=o),s.drawImage(e,0,0,a,o),this.snapshotCanvas=i,i)}catch{return e}}defaultQuality(e,r){let i=Tt(e,r,96);return i===null?Mt:{sharpness:Q(i),exposure:fe(i),meanLuma:j(i)}}centerSharpness(e){let r=C(e),i=Tt(e,{x:r.width*.25,y:r.height*.25,width:r.width*.5,height:r.height*.5},96);return i===null?0:Q(i)}teardownAttempt(){this.scheduler?.stop(),this.scheduler=null,this.reportGate(!0),this.gate=null,this.ramp?.stop(),this.ramp=null,this.stopTracks()}reportGate(e){let r=this.blockStats,i=this.profiler;if(r===null||i===null)return;let n=r.summary();e&&(this.blockStats=null),n.ticks!==0&&this.options.telemetry?.({type:"gate",final:e,activeClass:i.deviceClass,cadenceHz:i.profile.cadenceHz,...n})}stopTracks(){if(this.stream!==null){for(let e of this.stream.getTracks())e.stop();this.stream=null}}fail(e,r,i){this.scheduler?.stop(),this.reportGate(!0),this.stopTracks(),this.setState("error"),this.options.telemetry?.({type:"error",kind:e,fallbackReason:i});let{phase:n,name:a}=r;this.emit("error",{kind:e,retryable:e!=="insecure"&&e!=="unsupported",detail:a===void 0?{phase:n}:{phase:n,name:a}})}setState(e){this.stateValue=e,this.emit("statechange",{state:e})}now(){return this.options.now?.()??performance.now()}},xe;function Ur(t){return new Promise(e=>setTimeout(e,t))}function zr(t){return t instanceof Error?t.message:String(t)}function Tt(t,e,r){try{let i=document.createElement("canvas"),n=r/Math.max(1,e.width);i.width=Math.max(1,Math.round(e.width*n)),i.height=Math.max(1,Math.round(e.height*n));let a=i.getContext("2d");return a===null?null:(a.drawImage(t,e.x,e.y,e.width,e.height,0,0,i.width,i.height),a.getImageData(0,0,i.width,i.height))}catch{return null}}0&&(module.exports={CENTERED_FACTOR,CIRCLE_RADIUS_FACTOR,CLIP_MS,CaptureSessionV3,ClipError,ClipRecorder,DEFAULT_CLIP_MIME,DEFAULT_TIER_ORDER,DEFAULT_V3_ASSET_BASE_URL,DEVICE_PROFILES,DetectScheduler,DetectorLadderError,DeviceProfiler,EXPOSURE_BAND,FaceGateV3,GATE_SNAPSHOT_MS,GateBlockStats,HOLD_UPRIGHT_KEY,IN_CIRCLE_FACTOR,KEYFRAME_CANDIDATES,KEYFRAME_WINDOW_MS,MAX_CLIP_BYTES,MIME_CANDIDATES,PHONE_MAX_SHORT_SIDE,PROVENANCE_WAIT_MS,SHARP_REF,STOP_GRACE_MS,TIMESLICE_MS,UPRIGHT_WATCH_MS,V3_GATE_DEFAULTS,VIDEO_BPS,blockReasonOf,buildCaptureConstraints,buildLivenessV2FormData,cameraPreflight,captureMirroredKeyframe,classifyDevice,createDetector,detectFormFactor,detectIsMobile,errorCopy,exposure,extForMime,intrinsicSize,isClipTooLarge,isMediaRecorderSupported,mapGetUserMediaError,meanLuma,pickMimeType,probeDevice,sharpness,toStreamPixels,trackFacingMode,uiCopy});
1
+ "use strict";var Rt=Object.create;var B=Object.defineProperty;var Dt=Object.getOwnPropertyDescriptor;var It=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Ot=Object.prototype.hasOwnProperty;var W=(t,e)=>()=>(t&&(e=t(t=0)),e);var K=(t,e)=>{for(var r in e)B(t,r,{get:e[r],enumerable:!0})},Re=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of It(e))!Ot.call(t,n)&&n!==r&&B(t,n,{get:()=>e[n],enumerable:!(i=Dt(e,n))||i.enumerable});return t};var Pt=(t,e,r)=>(r=t!=null?Rt(At(t)):{},Re(e||!t||!t.__esModule?B(r,"default",{value:t,enumerable:!0}):r,t)),Ft=t=>Re(B({},"__esModule",{value:!0}),t);function Ue(t){let e=(t??"").trim().toLowerCase();return e.length===0?"unknown":er.some(r=>e.includes(r))?"known_virtual":tr.some(r=>r.test(e))?"platform":"unknown"}var er,tr,ze=W(()=>{"use strict";er=["obs","manycam","virtual","snap camera","xsplit","droidcam","iriun","camo"],tr=[/^(front|back|rear)( [a-z ]+)? camera$/i,/^camera2? ?\d+, facing (front|back|external)/i,/facetime/i,/\b(integrated|built-in|builtin) (web)?cam(era)?\b/i,/\b(hd )?web ?cam\b/i,/\([0-9a-f]{4}:[0-9a-f]{4}\)\s*$/i]});var Xe={};K(Xe,{bounded:()=>G,cameraHash:()=>qe,hex16:()=>$,noteCameraTrait:()=>ir});function G(t,e){return new Promise(r=>{let i=setTimeout(()=>r(void 0),e),n=a=>{clearTimeout(i),r(a)};try{t().then(n,()=>n(void 0))}catch{n(void 0)}})}async function $(t){let e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(t)));return Array.from(new Uint8Array(e).subarray(0,8),r=>r.toString(16).padStart(2,"0")).join("")}function nr(t){try{return t.getSettings?.().facingMode==="environment"}catch{return!1}}async function qe(t){try{if(t.readyState==="ended"||nr(t))return;let e={};try{e=t.getCapabilities?.()??{}}catch{}let r=await G(()=>navigator.mediaDevices.enumerateDevices(),rr);return await $([ve(e.width),ve(e.height),ve(e.frameRate),ye(e.facingMode),ye(e.focusMode),ye(e.exposureMode),Ue(t.label),r?.filter(i=>i.kind==="videoinput").length??null])}catch{return}}async function ir(t,e){let r=await qe(t);r&&e.noteCamera(r)}var rr,ye,ve,Se=W(()=>{"use strict";ze();rr=1e3;ye=t=>Array.isArray(t)?[...t].sort():null,ve=t=>{let e=t;return e==null?null:[e.min??null,e.max??null]}});var Qe={};K(Qe,{computePrint:()=>gr,readHints:()=>je});function Ye(t,e){if(typeof t!="string")return;let r=t.trim();return r.length>0&&r.length<=e?r:void 0}async function je(){let t=navigator.userAgentData;if(typeof t?.getHighEntropyValues!="function")return;let e=await G(()=>t.getHighEntropyValues(["model","platformVersion"]),cr);if(e==null)return;let r=Ye(e.model,lr),i=Ye(e.platformVersion,dr),n={...r!==void 0?{model:r}:{},...i!==void 0?{platformVersion:i}:{}};return Object.keys(n).length>0?n:void 0}async function fr(){let[t,e]=await Promise.all([new Ze.Thumbmark({stabilize:["private","iframe"],exclude:["permissions","webrtc","speech"],logging:!1,collect_beacon:!1,timeout:or}).get(),je()]),r=t?.thumbmark;if(typeof r!="string"||r.length<mr||r.length>pr)return;let i={};for(let n of ar){let a=t.components?.[n];a==null||a.timeout==="true"||(i[n]=await $(a))}return{hash:r,c:i,...e!==void 0?{hints:e}:{}}}function hr(){return new Promise(t=>{typeof globalThis.requestIdleCallback=="function"?globalThis.requestIdleCallback(()=>t(),{timeout:ur}):t()})}async function gr(t){return t()||(await hr(),t())?"busy":G(fr,sr)}var Ze,ar,or,sr,cr,ur,lr,dr,mr,pr,$e=W(()=>{"use strict";Ze=require("@thumbmarkjs/thumbmarkjs");Se();ar=["canvas","webgl","audio","fonts","hardware","screen","system","locales","math","plugins"],or=2e3,sr=4e3,cr=1e3,ur=2e3,lr=64,dr=32,mr=8,pr=128});var St={};K(St,{RANK_CANDIDATES:()=>Lr,RANK_TOLERANCE:()=>ee,RANK_WINDOW_MS:()=>Nr,ROLL_ZERO_DEG:()=>Gr,SHARPNESS_REPORT_MAX:()=>yt,YAW_REPORT_MAX:()=>bt,YAW_ZERO_IOD:()=>Vr,collectRankedKeyframes:()=>vt,default:()=>Br,featuresOf:()=>ht,frontalOf:()=>ft,rankKeyframes:()=>gt});function ft(t){let e=t.eyes;if(e===void 0)return{frontal:1,yaw:null,roll:null};let r=e.right.x-e.left.x,i=e.right.y-e.left.y,n=r*r+i*i;if(n===0)return{frontal:1,yaw:null,roll:null};let a=Math.abs(Math.atan2(i,Math.abs(r))*180/Math.PI),o=pt(1-a/30),s=null,l=t.nose;if(l!==void 0){let c=(e.left.x+e.right.x)/2,u=(e.left.y+e.right.y)/2;s=Math.abs(((l.x-c)*r+(l.y-u)*i)/n),o*=pt(1-s/.5)}return{frontal:o,yaw:s,roll:a}}function ht(t,e){return t===null?{face:!1,frontal:0,yaw:null,roll:null,eyes:null,score:0,sharpness:e}:{face:!0,...ft(t),eyes:null,score:t.score,sharpness:e}}function gt(t){let e=t.map((n,a)=>a),r=(n,a)=>{let o=Number.NEGATIVE_INFINITY;for(let s of e)o=Math.max(o,n(t[s]));e=e.filter(s=>n(t[s])>=o-a)};r(n=>n.frontal,ee.frontal),r(n=>n.eyes??1,ee.eyes),r(n=>n.score,ee.score);let i=-1;for(let n of e)(i===-1||t[n].sharpness>t[i].sharpness)&&(i=n);return i}function Hr(t){return{face:t.face,frontal:I(t.frontal),...t.yaw!==null?{yaw:Math.min(I(t.yaw),bt)}:{},...t.roll!==null?{roll:I(t.roll)}:{},...t.eyes!==null?{eyes:I(t.eyes)}:{},score:I(t.score),sharpness:Math.min(I(t.sharpness),yt)}}async function vt(t,e){let{options:r}=t,i=r.video,n=r.now??(()=>performance.now()),a=r.captureKeyframe??(m=>t.defaultKeyframe(m)),o=600/3,s=[],l=[],c=0;for(let m=0;m<4;m+=1){if(e!==t.attempt)return null;let p=t.detector,f=Promise.resolve(null),h,g=0;try{if(p!==null){let k=t.profiler?.profile.inputWidth??160,A=r.makeSnapshot?.(i,k)??t.defaultSnapshot(i,k);h=a(i).then(b=>(g=n(),b));let ne=n();f=p.detect(A,i.videoWidth,i.videoHeight).then(b=>(c+=n()-ne,b),()=>null)}else h=a(i).then(k=>(g=n(),k));let[v,T]=await Promise.all([h,f]);s.push(v),l.push(ht(T,v.sharpness))}catch{h?.catch(()=>{})}let S=g>0?Math.max(0,n()-g):0;m<3&&await new Promise(v=>setTimeout(v,Math.max(0,o-S)))}if(e!==t.attempt)return null;let u=gt(l);if(u===-1)return null;let d=0;l.forEach((m,p)=>{m.sharpness>l[d].sharpness&&(d=p)});try{r.telemetry?.({type:"keyframe",tier:t.detector?.tier??null,chosen:u,sharpest:d,detectMs:Math.round(c),candidates:l.map(Hr)})}catch{}return s[u]??null}var Lr,Nr,Vr,Gr,ee,pt,I,bt,yt,Br,Et=W(()=>{"use strict";Lr=4,Nr=600,Vr=.5,Gr=30,ee={frontal:.1,eyes:.1,score:.05},pt=t=>t<0?0:t>1?1:t;I=t=>Number.isFinite(t)?Math.round(t*1e3)/1e3:0,bt=99,yt=999999;Br=vt});var qr={};K(qr,{CENTERED_FACTOR:()=>Ut,CIRCLE_RADIUS_FACTOR:()=>Wt,CLIP_MS:()=>Ie,CaptureSessionV3:()=>_e,ClipError:()=>y,ClipRecorder:()=>P,DEFAULT_CLIP_MIME:()=>U,DEFAULT_TIER_ORDER:()=>Ve,DEFAULT_V3_ASSET_BASE_URL:()=>Ne,DEVICE_PROFILES:()=>Be,DetectScheduler:()=>V,DetectorLadderError:()=>w,DeviceProfiler:()=>N,EXPOSURE_BAND:()=>L,FaceGateV3:()=>R,GATE_SNAPSHOT_MS:()=>kt,GateBlockStats:()=>D,HOLD_UPRIGHT_KEY:()=>te,IN_CIRCLE_FACTOR:()=>Kt,KEYFRAME_CANDIDATES:()=>re,KEYFRAME_WINDOW_MS:()=>wt,MAX_CLIP_BYTES:()=>z,MIME_CANDIDATES:()=>De,PHONE_MAX_SHORT_SIDE:()=>Pe,PROVENANCE_WAIT_MS:()=>xt,SHARP_REF:()=>cn,STOP_GRACE_MS:()=>Oe,TIMESLICE_MS:()=>Ae,UPRIGHT_WATCH_MS:()=>Ct,V3_GATE_DEFAULTS:()=>He,VIDEO_BPS:()=>ue,blockReasonOf:()=>mt,buildCaptureConstraints:()=>le,buildLivenessV2FormData:()=>Nt,cameraPreflight:()=>se,captureMirroredKeyframe:()=>ce,classifyDevice:()=>be,createDetector:()=>x,detectFormFactor:()=>q,detectIsMobile:()=>de,errorCopy:()=>Vt,exposure:()=>fe,extForMime:()=>ie,intrinsicSize:()=>C,isClipTooLarge:()=>O,isMediaRecorderSupported:()=>Lt,mapGetUserMediaError:()=>oe,meanLuma:()=>j,pickMimeType:()=>ae,probeDevice:()=>ge,sharpness:()=>Q,toStreamPixels:()=>F,trackFacingMode:()=>me,uiCopy:()=>Gt});module.exports=Ft(qr);var De=["video/mp4;codecs=avc1.42E01E,mp4a.40.2","video/mp4;codecs=avc1.42E01E","video/mp4","video/webm;codecs=vp9,opus","video/webm;codecs=vp9","video/webm;codecs=vp8,opus","video/webm;codecs=vp8","video/webm"];function ae(){let t=globalThis.MediaRecorder;return!t||typeof t.isTypeSupported!="function"?"":De.find(e=>t.isTypeSupported(e))??""}var U="video/webm";function oe(t){if(t instanceof TypeError)return"insecure";switch(t?.name??""){case"NotAllowedError":case"PermissionDeniedError":return"permission";case"NotFoundError":case"DevicesNotFoundError":return"notfound";case"NotReadableError":case"TrackStartError":return"inuse";case"OverconstrainedError":case"ConstraintNotSatisfiedError":return"overconstrained";default:return"generic"}}function se(){let t=globalThis;if(typeof t.window<"u"&&t.window.isSecureContext===!1)return"INSECURE_CONTEXT";let e=t.navigator?.mediaDevices;return!e||typeof e.getUserMedia!="function"?"UNSUPPORTED":"OK"}function Lt(){let t=globalThis.MediaRecorder;return typeof t<"u"&&typeof t.isTypeSupported=="function"}var z=8*1024*1024;function O(t){return t.size>z}function ie(t){let e=(t||"").toLowerCase();return e.startsWith("image/jpeg")?"jpg":e.startsWith("video/mp4")?"mp4":(e.startsWith("video/webm"),"webm")}function Nt(t){let{token:e,clip:r,keyframe:i}=t,n=t.ts??Date.now(),a=r.type||U,o=i.type||"image/jpeg",s=new FormData;return s.append("token",e),s.append("clip",new File([r],`liveness-${n}.${ie(a)}`,{type:a})),s.append("keyframe",new File([i],`keyframe-${n}.${ie(o)}`,{type:o})),s}function ce(t,e,r=.92){return new Promise((i,n)=>{let a=t.videoWidth,o=t.videoHeight;if(!a||!o){n(new Error("video-not-ready"));return}let s=e.getContext("2d");if(!s){n(new Error("no-2d-context"));return}e.width=a,e.height=o,s.scale(-1,1),s.drawImage(t,-a,0),e.toBlob(l=>l?i(l):n(new Error("empty-keyframe")),"image/jpeg",r)})}var Vt={permission:{key:"fcv2.err.permission",fr:"Autorisez la cam\xE9ra dans les r\xE9glages du navigateur (ic\xF4ne cam\xE9ra dans la barre d\u2019adresse), puis r\xE9essayez."},notfound:{key:"fcv2.err.notfound",fr:"Aucune cam\xE9ra d\xE9tect\xE9e. Branchez ou activez une cam\xE9ra, puis r\xE9essayez."},inuse:{key:"fcv2.err.inuse",fr:"La cam\xE9ra est utilis\xE9e par une autre application. Fermez-la puis r\xE9essayez."},overconstrained:{key:"fcv2.err.overconstrained",fr:"La cam\xE9ra ne prend pas en charge les r\xE9glages demand\xE9s. Nouvel essai en cours\u2026"},insecure:{key:"fcv2.err.insecure",fr:"La cam\xE9ra n\xE9cessite une connexion s\xE9curis\xE9e (HTTPS). Ouvrez la page en HTTPS."},unsupported:{key:"fcv2.err.unsupported",fr:"Votre navigateur ne prend pas en charge l\u2019enregistrement vid\xE9o. Utilisez un navigateur r\xE9cent."},generic:{key:"fcv2.err.generic",fr:"Cam\xE9ra indisponible. R\xE9essayez ou contactez le support."}},Gt={recording:{key:"fcv2.recording",fr:"Enregistrement en cours\u2026"},uploading:{key:"fcv2.uploading",fr:"Envoi en cours\u2026"},clipTooLarge:{key:"fcv2.err.cliptoolarge",fr:"La vid\xE9o est trop volumineuse. R\xE9essayez dans un endroit mieux \xE9clair\xE9."},retry:{key:"fcv2.retry",fr:"R\xE9essayer"},listen:{key:"fcv2.listen",fr:"\xC9couter"}};var Ie=2500,Ae=1e3,Oe=1500,ue=25e5,y=class extends Error{constructor(e,r){super(r??e),this.kind=e}},P=class{constructor(){this.recorder=null;this.stream=null;this.chunks=[];this.bytes=0;this.hardStopTimer=null;this.graceTimer=null;this.settled=!1}clearTimers(){this.hardStopTimer&&clearTimeout(this.hardStopTimer),this.graceTimer&&clearTimeout(this.graceTimer),this.hardStopTimer=null,this.graceTimer=null}record(e,r,i){if(this.recorder&&!this.settled)return Promise.reject(new y("generic","record() called while a recording is in flight \u2014 ClipRecorder handles one recording at a time"));this.recorder=null,this.clearTimers(),this.chunks=[],this.bytes=0,this.settled=!1,this.stream=e;let n=ae();return new Promise((a,o)=>{let s;try{s=new MediaRecorder(e,n?{mimeType:n,videoBitsPerSecond:ue}:{videoBitsPerSecond:ue})}catch{try{s=new MediaRecorder(e)}catch{o(new y("unsupported"));return}}this.recorder=s;let l=u=>{this.settled||(this.settled=!0,this.clearTimers(),u())},c=()=>l(()=>{let u=s.mimeType||n||U,d=new Blob(this.chunks,{type:u});if(d.size===0){o(new y("generic","empty clip"));return}if(O(d)){o(new y("cliptoolarge"));return}a({blob:d,mimeType:u})});if(s.ondataavailable=u=>{u.data&&u.data.size&&(this.chunks.push(u.data),this.bytes+=u.data.size,this.bytes>z&&l(()=>{try{s.state!=="inactive"&&s.stop()}catch{}o(new y("cliptoolarge"))}))},s.onstop=c,s.onerror=()=>l(()=>o(new y("generic"))),i!==void 0){let u=!1;s.onstart=()=>{if(!(u||this.settled)){u=!0;try{i()}catch{}}}}try{s.start(Ae)}catch{l(()=>o(new y("generic")));return}this.hardStopTimer=setTimeout(()=>{if(this.settled||r?.(),s.state!=="inactive"){try{s.stop()}catch{c()}this.graceTimer=setTimeout(c,Oe)}else c()},Ie)})}stop(e){this.clearTimers();let r=this.recorder;if(r&&r.state!=="inactive")try{r.stop()}catch{}this.recorder=null,(e??this.stream)?.getTracks().forEach(n=>n.stop()),this.stream=null}};function le(t,e){return{video:{width:{ideal:1280,max:1280},height:{ideal:720,max:720},facingMode:e,frameRate:{ideal:24,max:30}},audio:!1}}var Pe=600;function q(){if(typeof window>"u"||typeof navigator>"u")return"desktop";let 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(Number(navigator.maxTouchPoints??0)<=1)return"desktop";if(/Macintosh/.test(t))return"tablet";if(!Bt())return"desktop";let r=Ht();return r>0&&r<Pe?"phone":"tablet"}function de(){return q()!=="desktop"}function Ht(){try{let t=window.screen,e=Number(t?.width??0),r=Number(t?.height??0);return e>0&&r>0?Math.min(e,r):0}catch{return 0}}function me(t){try{let r=t?.getVideoTracks?.()[0]?.getSettings?.().facingMode;return r==="user"||r==="environment"?r:null}catch{return null}}function Bt(){try{return typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches}catch{return!1}}var Wt=.45,Kt=.9,Ut=.4;var Fe=1e4,X=class t{constructor(e,r){this.tier="blaze";this.inner=e,r!==void 0&&(this.fallbackReason=r)}static async create(e,r){let i=await import("@mediapipe/tasks-vision"),n=await i.FilesetResolver.forVisionTasks(e),a=await i.FaceDetector.createFromOptions(n,{baseOptions:{modelAssetPath:`${e}/blaze_face_short_range.tflite`,delegate:"CPU"},runningMode:"IMAGE"});return new t(a,r)}async detect(e,r,i){let n;try{n=this.inner.detect(e).detections}catch{return null}let a=zt(n);if(a?.boundingBox===void 0)return null;let o=C(e),s=qt(a.keypoints,o),l=a.keypoints?.[2],c={box:{x:a.boundingBox.originX,y:a.boundingBox.originY,width:a.boundingBox.width,height:a.boundingBox.height},...s!==void 0?{eyes:s}:{},...l!==void 0?{nose:{x:l.x*o.width,y:l.y*o.height}}:{},score:a.categories[0]?.score??0};return F(c,e,r,i)}destroy(){try{this.inner.close()}catch{}}};function zt(t){let e,r=-1;for(let i of t){let n=i.categories[0]?.score??0;n>r&&(e=i,r=n)}return e}function qt(t,e){let r=t?.[0],i=t?.[1];if(r===void 0||i===void 0)return;let n=s=>({x:s.x*e.width,y:s.y*e.height}),[a,o]=[n(r),n(i)];return a.x<=o.x?{left:a,right:o}:{left:o,right:a}}function Xt(){if(typeof OffscreenCanvas=="function")return new OffscreenCanvas(2,2);let t=document.createElement("canvas");return t.width=2,t.height=2,t}async function Le(){let t=globalThis.FaceDetector;if(typeof t!="function")return{ok:!1,reason:"unsupported"};try{let e=new t({fastMode:!0,maxDetectedFaces:1});return await e.detect(Xt()),{ok:!0,instance:e}}catch(e){return{ok:!1,reason:`smoke_failed:${e instanceof Error?e.message:String(e)}`}}}var Y=class{constructor(e,r){this.tier="native";this.inner=e,r!==void 0&&(this.fallbackReason=r)}async detect(e,r,i){let n;try{n=await this.inner.detect(e)}catch{return null}let a=n[0];if(a===void 0)return null;let o=Yt(a.landmarks),s={box:{x:a.boundingBox.x,y:a.boundingBox.y,width:a.boundingBox.width,height:a.boundingBox.height},...o!==void 0?{eyes:o}:{},score:1};return F(s,e,r,i)}destroy(){}};function Yt(t){if(t===void 0)return;let e=t.filter(n=>n.type==="eye").map(n=>n.locations[0]).filter(n=>n!==void 0),[r,i]=e;if(!(r===void 0||i===void 0))return r.x<=i.x?{left:r,right:i}:{left:i,right:r}}var Ne="/models-v3",Ve=["native","blaze"],w=class extends Error{constructor(e){super(`no detector tier available (${e})`),this.name="DetectorLadderError",this.fallbackReason=e}};function C(t){let e=t;if(typeof e.videoWidth=="number"&&e.videoWidth>0)return{width:e.videoWidth,height:e.videoHeight??0};if(typeof e.naturalWidth=="number"&&e.naturalWidth>0)return{width:e.naturalWidth,height:e.naturalHeight??0};let r=typeof e.width=="number"?e.width:0,i=typeof e.height=="number"?e.height:0;return{width:r,height:i}}function F(t,e,r,i){let n=C(e),a=n.width>0?r/n.width:1,o=n.height>0?i/n.height:1,s=l=>({x:l.x*a,y:l.y*o});return{box:{x:t.box.x*a,y:t.box.y*o,width:t.box.width*a,height:t.box.height*o},...t.eyes!==void 0?{eyes:{left:s(t.eyes.left),right:s(t.eyes.right)}}:{},...t.nose!==void 0?{nose:s(t.nose)}:{},score:t.score}}function Zt(t){return t instanceof Error?t.message:String(t)}async function x(t){let e=t.preferred??Ve,r=[];for(let i of e){if(i==="native"){let n=await Le();if(n.ok)return new Y(n.instance,pe(r));r.push(`native:${n.reason}`);continue}try{return await jt(X.create(t.v3AssetBaseUrl??Ne,pe(r)),t.blazeInitTimeoutMs??Fe)}catch(n){r.push(n instanceof Z?"blaze:blaze_init_timeout":`blaze:${Zt(n)}`)}}throw new w(pe(r)??"no_tier_available")}function pe(t){return t.length>0?t.join("; "):void 0}var Z=class extends Error{};function jt(t,e){return new Promise((r,i)=>{let n=setTimeout(()=>{i(new Z(`init exceeded ${e}ms`)),t.then(a=>a.destroy(),()=>{})},e);t.then(a=>{clearTimeout(n),r(a)},a=>{clearTimeout(n),i(a)})})}var cn=180,L=[100,190],Qt=64;function Ge(t,e){return .299*(t[e]??0)+.587*(t[e+1]??0)+.114*(t[e+2]??0)}function j(t){let{data:e,width:r,height:i}=t,n=r*i;if(n===0)return 0;let a=0;for(let o=0;o<n;o+=1)a+=Ge(e,o*4);return a/n}function Q(t){let{data:e,width:r,height:i}=t;if(r<3||i<3)return 0;let n=new Float32Array(r*i);for(let u=0;u<n.length;u+=1)n[u]=Ge(e,u*4);let a=0,o=0,s=0;for(let u=1;u<i-1;u+=1)for(let d=1;d<r-1;d+=1){let m=u*r+d,p=(n[m-r]??0)+(n[m-1]??0)+(n[m+1]??0)+(n[m+r]??0)-4*(n[m]??0);a+=p,o+=p*p,s+=1}if(s===0)return 0;let l=a/s,c=o/s-l*l;return Math.min(1,Math.max(0,c)/180)}function fe(t){let e=j(t),[r,i]=L,n=e<r?r-e:e>i?e-i:0;return Math.max(0,1-n/Qt)}var He=Object.freeze({Q_GOOD:.6,RISE_PER_S:.9,FALL_PER_S:.25,CENTER_FALLOFF_IOD_MULTIPLE:1.35,BOX_EYE_OFFSET_FACTOR:.12,IOD_BOX_PROXY_FACTOR:.42,SIZE_IDEAL_MIN:.12,SIZE_IDEAL_MAX:.3,SIZE_HARD_MIN:.08,SIZE_HARD_MAX:.45,ROLL_MAX_DEG:25,MOTION_VELOCITY_IOD_PER_S:.5,MOTION_TAU_S:.4,MOTION_DEADBAND_IOD_PER_S:.1,READY_WINDOW_MS:500,GUIDE_SIZE:.6,GUIDE_CENTERING:.6,GUIDE_POSE:.6,GUIDE_EXPOSURE:.6,GUIDE_SHARPNESS:.35,GUIDE_MOTION:.5}),_=t=>Math.min(1,Math.max(0,t)),R=class{constructor(e={}){this.p=0;this.lastTickAt=null;this.lastCenter=null;this.velocityEma=0;this.qWindow=[];this.lastSizeDirection="ideal";this.t={...He,...e}}reset(){this.p=0,this.lastTickAt=null,this.lastCenter=null,this.velocityEma=0,this.qWindow=[],this.lastSizeDirection="ideal"}tick(e){let{observation:r,quality:i,timestampMs:n}=e,a=this.lastTickAt===null?0:Math.max(0,(n-this.lastTickAt)/1e3);this.lastTickAt=n;let o={presence:0,centering:0,size:0,pose:0,sharpness:_(i.sharpness),exposure:_(i.exposure),motion:1};if(r!==null){o.presence=1;let u=this.geometryOf(r,e);o.centering=u.centering,o.size=u.size,o.pose=u.pose,o.motion=this.motionOf(u.center,u.iod,n)}else this.lastCenter=null,this.velocityEma=0;let s=Math.min(o.presence,o.centering,o.size,o.pose,o.sharpness,o.exposure,o.motion);this.p=_(this.p+(s>=this.t.Q_GOOD?this.t.RISE_PER_S*s:-this.t.FALL_PER_S*(1-s))*a),this.qWindow.push({at:n,q:s}),this.qWindow=this.qWindow.filter(u=>u.at>=n-this.t.READY_WINDOW_MS);let l=this.qWindow.map(u=>u.q);if(l.length>=3){let u=Math.min(...l),d=l.indexOf(u);l=l.filter((m,p)=>p!==d)}let c=this.p>=1&&l.every(u=>u>=this.t.Q_GOOD);return{at:n,q:s,p:this.p,factors:o,guidanceKey:this.guidanceOf(o,i,s),ready:c,accepted:s>=this.t.Q_GOOD}}geometryOf(e,r){let{box:i,eyes:n}=e,a={x:r.frameWidth/2,y:r.frameHeight/2},o=Math.min(r.frameWidth,r.frameHeight),s=n!==void 0?{x:(n.left.x+n.right.x)/2,y:(n.left.y+n.right.y)/2}:{x:i.x+i.width/2,y:i.y+i.height/2-this.t.BOX_EYE_OFFSET_FACTOR*i.height},l=n!==void 0?Math.hypot(n.right.x-n.left.x,n.right.y-n.left.y):this.t.IOD_BOX_PROXY_FACTOR*i.width,c=Math.hypot(s.x-a.x,s.y-a.y),u=l<=0?0:1-_(c/(this.t.CENTER_FALLOFF_IOD_MULTIPLE*l)),d=o>0?l/o:0;this.lastSizeDirection=d<this.t.SIZE_IDEAL_MIN?"far":d>this.t.SIZE_IDEAL_MAX?"close":"ideal";let m;d<this.t.SIZE_HARD_MIN||d>this.t.SIZE_HARD_MAX?m=0:d<this.t.SIZE_IDEAL_MIN?m=(d-this.t.SIZE_HARD_MIN)/(this.t.SIZE_IDEAL_MIN-this.t.SIZE_HARD_MIN):d>this.t.SIZE_IDEAL_MAX?m=(this.t.SIZE_HARD_MAX-d)/(this.t.SIZE_HARD_MAX-this.t.SIZE_IDEAL_MAX):m=1;let p=1;if(n!==void 0){let f=Math.abs(Math.atan2(n.right.y-n.left.y,n.right.x-n.left.x))*180/Math.PI;p=1-_(f/this.t.ROLL_MAX_DEG)}return{center:s,iod:l,centering:u,size:m,pose:p}}motionOf(e,r,i){let n=this.lastCenter;if(this.lastCenter={...e,at:i},n===null||r<=0)return 1;let a=(i-n.at)/1e3;if(a<=0)return 1;let o=Math.hypot(e.x-n.x,e.y-n.y)/r/a;o<=this.t.MOTION_DEADBAND_IOD_PER_S&&(o=0);let s=1-Math.exp(-a/this.t.MOTION_TAU_S);return this.velocityEma=s*o+(1-s)*this.velocityEma,1-_(this.velocityEma/this.t.MOTION_VELOCITY_IOD_PER_S)}guidanceOf(e,r,i){if(e.presence<=0)return"fcv3.no_face";if(e.size<this.t.GUIDE_SIZE)return this.sizeGuidance();if(e.centering<this.t.GUIDE_CENTERING)return"fcv3.center_face";if(e.pose<this.t.GUIDE_POSE)return"fcv3.straighten";if(e.exposure<this.t.GUIDE_EXPOSURE)return this.exposureGuidance(r);if(e.sharpness<this.t.GUIDE_SHARPNESS)return"fcv3.steady_camera";if(e.motion<this.t.GUIDE_MOTION)return"fcv3.hold_still";if(i<this.t.Q_GOOD){let n=[["size",this.sizeGuidance()],["centering","fcv3.center_face"],["pose","fcv3.straighten"],["exposure",this.exposureGuidance(r)],["sharpness","fcv3.steady_camera"],["motion","fcv3.hold_still"]],a=n[0];for(let o of n)e[o[0]]<e[a[0]]&&(a=o);return a[1]}return"fcv3.hold_still"}sizeGuidance(){return this.lastSizeDirection==="far"?"fcv3.come_closer":"fcv3.move_back"}exposureGuidance(e){let r=(L[0]+L[1])/2;return e.meanLuma<r?"fcv3.more_light":"fcv3.too_bright"}};var Be=Object.freeze({LOW:Object.freeze({cadenceHz:5,inputWidth:128,animations:"reduced"}),MID:Object.freeze({cadenceHz:8,inputWidth:160,animations:"full"}),HIGH:Object.freeze({cadenceHz:10,inputWidth:192,animations:"full"})}),$t=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]);function ge(){let t=typeof navigator>"u"?void 0:navigator,e=!1;try{e=typeof WebAssembly<"u"&&WebAssembly.validate($t)}catch{e=!1}return{cores:t?.hardwareConcurrency??2,memGB:t?.deviceMemory??null,simd:e}}function be(t){let e=t.memGB??4;return t.cores<4||e<3?"LOW":t.cores>=8&&e>=6?"HIGH":"MID"}var he=["LOW","MID","HIGH"],N=class{constructor(e){this.samples=[];this.adjusted=!1;this.current=e}get deviceClass(){return this.current}get profile(){return Be[this.current]}record(e){if(this.adjusted||this.samples.length>=10)return this.current;if(this.samples.push(e),this.samples.length<10)return this.current;this.adjusted=!0;let r=this.samples.reduce((i,n)=>i+n,0)/this.samples.length;if(r>70)this.current="LOW";else if(r<25){let i=he.indexOf(this.current);this.current=he[Math.min(he.length-1,i+1)]??this.current}return this.current}};var V=class{constructor(e){this.timer=null;this.frameCallbackId=null;this.running=!1;this.busy=!1;this.lastRunAt=Number.NEGATIVE_INFINITY;this.degradeCount=0;this.durations=[];this.options=e,this.periodMs=1e3/e.cadenceHz}start(){if(this.running)return;this.running=!0;let e=this.options.video;if(typeof e?.requestVideoFrameCallback=="function"){let r=()=>{this.running&&(this.frameCallbackId=e.requestVideoFrameCallback?.(()=>{this.frameCallbackId=null,this.now()-this.lastRunAt>=this.periodMs&&this.tick(),r()}))};r();return}this.timer=setInterval(()=>this.tick(),this.periodMs)}stop(){this.running=!1,this.timer!==null&&(clearInterval(this.timer),this.timer=null),this.frameCallbackId!==null&&(this.options.video?.cancelVideoFrameCallback?.(this.frameCallbackId),this.frameCallbackId=null)}stats(){let e=this.durations.length===0?0:this.durations.reduce((r,i)=>r+i,0)/this.durations.length;return{degradeCount:this.degradeCount,meanDetectMs:e}}now(){return this.options.now?.()??performance.now()}tick(){if(!this.running)return;if(this.busy){this.degradeCount+=1;return}this.busy=!0,this.lastRunAt=this.now();let e=this.now();this.options.run().catch(()=>{}).finally(()=>{this.busy=!1,this.durations.push(this.now()-e),this.durations.length>20&&this.durations.shift()})}};var We="0.1.0-rc.21";var Jt=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function Ke(t){let e=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));return Jt.test(e)}var Je="sekyro.did",br=1e4,rt=()=>globalThis.process?.versions?.node,et;function tt(){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,r=>r.toString(16).padStart(2,"0")).join("")}}catch{}}function yr(){try{let t=localStorage.getItem(Je);if(t)return t;let e=tt();return e!==void 0&&localStorage.setItem(Je,e),e}catch{return et??(et=tt()),et}}async function vr(){let t=globalThis.crypto?.subtle;if(!t)return"";let e=navigator,r=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(r));return Array.from(new Uint8Array(i),n=>n.toString(16).padStart(2,"0")).join("").slice(0,32)}function Sr(t){let e=new TextEncoder().encode(t),r="";for(let i of e)r+=String.fromCharCode(i);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Er(t){let e,r,i,n,a,o,s=()=>o?.readyState==="live",l=()=>{a!==void 0||!globalThis.crypto?.subtle||rt()||s()||(a=Promise.race([Promise.resolve().then(()=>($e(),Qe)),new Promise(c=>setTimeout(c,br))]).then(c=>c?.computePrint(s)).then(c=>{c==="busy"?a=void 0:n=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){r=c},noteCameraTrack(c){o=c},async deviceHeader(){try{i??(i=vr().catch(()=>""));let c=[];navigator.webdriver&&c.push("webdriver"),/HeadlessChrome/.test(navigator.userAgent)&&c.push("headless");let u=await i,d=yr(),m={v:1,platform:"web",sdk:t.sdk.slice(0,64),ids:[...d?[{kind:"web_local",value:d.slice(0,128)}]:[],...u?[{kind:"web_fp",value:u}]:[]],screen:{w:screen.width,h:screen.height,dpr:globalThis.devicePixelRatio??1},...e?{cameraLabel:e}:{},...c.length?{signals:c}:{},...n?{print:{v:2,...n,...r?{camera:r}:{}}}:{},...Ke()?{inApp:!0}:{}},p=Sr(JSON.stringify(m));return l(),p}catch{return}},printReady(){return a??Promise.resolve()}}}var Ee=Symbol.for("sekyro.web.clientContext"),Me=globalThis,Te=Me[Ee]??(Me[Ee]=Er({sdk:`@sekyro/web@${We}`}));function nt(t){try{let e=t.getVideoTracks?.()[0];if(e){if(Te.noteCameraLabel(e.label),Te.noteCameraTrack(e),rt())return;Promise.resolve().then(()=>(Se(),Xe)).then(r=>r.noteCameraTrait(e,Te)).catch(()=>{})}}catch{}}var ke=Symbol.for("sekyro.web.cameraStreams"),Ce=globalThis,Mr=Ce[ke]??(Ce[ke]=new Set);function it(t){try{Mr.add(t)}catch{}}var Tr=["obs","manycam","virtual","snap camera","xsplit","droidcam","iriun","camo"],kr=[/^(front|back|rear)( [a-z ]+)? camera$/i,/^camera2? ?\d+, facing (front|back|external)/i,/facetime/i,/\b(integrated|built-in|builtin) (web)?cam(era)?\b/i,/\b(hd )?web ?cam\b/i,/\([0-9a-f]{4}:[0-9a-f]{4}\)\s*$/i];function Cr(t){let e=(t??"").trim().toLowerCase();return e.length===0?"unknown":Tr.some(r=>e.includes(r))?"known_virtual":kr.some(r=>r.test(e))?"platform":"unknown"}function at(t){if(typeof t!="function")return!1;try{return/\{\s*\[native code\]\s*\}\s*$/.test(Function.prototype.toString.call(t))}catch{return!1}}function wr(t=globalThis){return at(t.navigator?.mediaDevices?.getUserMedia)&&at(t.MediaStreamTrack?.prototype?.getSettings)}async function xr(t,e=globalThis){let r=e.crypto?.subtle?.digest;if(typeof r=="function")try{let i=new Uint8Array(await r.call(e.crypto?.subtle,"SHA-256",new TextEncoder().encode(t)));return Array.from(i.subarray(0,8),n=>n.toString(16).padStart(2,"0")).join("")}catch{return}}async function ot(t,e=globalThis){let r={};try{r=typeof t.getSettings=="function"?t.getSettings()??{}:{}}catch{r={}}let i={};if((r.facingMode==="user"||r.facingMode==="environment"||r.facingMode==="left"||r.facingMode==="right")&&(i.facingMode=r.facingMode),typeof r.frameRate=="number"&&Number.isFinite(r.frameRate)&&(i.frameRate=r.frameRate),typeof r.width=="number"&&Number.isFinite(r.width)&&(i.width=r.width),typeof r.height=="number"&&Number.isFinite(r.height)&&(i.height=r.height),typeof r.deviceId=="string"&&r.deviceId.length>0){let a=await xr(r.deviceId,e);a!==void 0&&(i.deviceIdHash=a)}let n;try{n=t.label}catch{n=void 0}return{trackSettings:i,capabilitiesPresent:typeof t.getCapabilities=="function",labelClass:Cr(n),prototypesIntact:wr(e)}}var we=t=>Math.round(t*100)/100;function st(t){let e=t,r=typeof e?.requestVideoFrameCallback=="function",i=null,n=null,a=0,o=0,s=0,l=0,c=0,u=0,d=()=>{!r||e?.requestVideoFrameCallback===void 0||(i=e.requestVideoFrameCallback((m,p)=>{if(i=null,!r)return;let f=p.presentationTime;if(n!==null){let h=f-n.presentationTimeMs;o+=1;let g=h-s;s+=g/o,l+=g*(h-s)}typeof p.captureTime=="number"&&Number.isFinite(p.captureTime)&&(c+=f-p.captureTime,u+=1),a+=1,n={mediaTimeMs:p.mediaTime*1e3,presentationTimeMs:f},d()}))};return d(),{latest:()=>n,stats:()=>({n:a,meanGapMs:o===0?0:we(s),stdGapMs:o<2?0:we(Math.sqrt(l/(o-1))),captureLatencyMs:u===0?null:we(c/u)}),stop:()=>{r&&(r=!1,i!==null&&e?.cancelVideoFrameCallback?.(i),i=null)}}}function ct(t,e,r){return{...t,rvfc:e,rampPainter:r}}var _r=["rose","peach","sand","mint","sky","lilac"];var Rr=4,Dr=4;function Ir(t){if(typeof t!="object"||t===null)return!1;let e=t;if(typeof e.nonce!="string"||e.nonce.length===0||!Array.isArray(e.colours)||e.colours.length!==3||!e.colours.every(i=>_r.includes(i))||!Array.isArray(e.onsetsMs)||e.onsetsMs.length!==3)return!1;let r=-1;for(let i of e.onsetsMs){if(typeof i!="number"||!Number.isFinite(i)||i<=r||i>=2e3)return!1;r=i}return!0}function ut(t,e){let r=e.now??(()=>performance.now()),i=Ir(t)?t:void 0,n=[],a=null,o=null,s=null,l=!1,c=null,u=f=>{c=f;try{e.paint(f)}catch{}},d=f=>{let h=e.frames?.()??null;return h!==null&&s!==null?h.mediaTimeMs+(f-h.presentationTimeMs)-s:f-(o??f)},m=(f,h,g=0)=>{if(l)return;let S=Math.max(0,f-d(r()));a=setTimeout(()=>{if(a=null,!l){if(g<Rr&&d(r())<f-Dr){m(f,h,g+1);return}h()}},S)},p=f=>{if(i!==void 0){if(f>=3){m(2e3,()=>u(null));return}m(i.onsetsMs[f],()=>{let h=d(r());if(h>2e3){c!==null&&u(null);return}let g=i.colours[f];u(g);let S=n.length===0?0:n[n.length-1].tMs;n.push({tMs:Math.max(S,Math.round(h)),colour:g}),p(f+1)})}};return{started(f){if(i===void 0||l||o!==null)return;o=f;let h=e.frames?.()??null;s=h===null?null:h.mediaTimeMs+(f-h.presentationTimeMs),p(0)},stop(){l||(l=!0,a!==null&&clearTimeout(a),a=null,c!==null&&u(null))},report(){return i===void 0?void 0:{nonce:i.nonce,rendered:[...n]}}}}var Ar=40;function H(t){if(t===null||typeof t!="object"&&typeof t!="function")return;let e;try{e=t.name}catch{return}return Or(e)}function Or(t){if(typeof t!="string")return;let e=t.replace(/[^A-Za-z]/g,"").slice(0,Ar);return e===""?void 0:e}function lt(t){let e=oe(t);if(e!=="generic")return e;switch(H(t)){case"AbortError":return"inuse";case"SecurityError":return"permission";default:return e}}var M=1;function dt(){return typeof OffscreenCanvas=="function"&&typeof createImageBitmap=="function"&&typeof Worker=="function"}function Pr(t,e={}){let r=e.createDetector??x,i=null;t.onmessage=n=>{let a=n.data;if(a.v!==M){a.bitmap?.close?.();return}if(a.type==="init"){r(a.options).then(o=>{i=o;let s={v:M,type:"ready",tier:o.tier,...o.fallbackReason!==void 0?{fallbackReason:o.fallbackReason}:{}};t.postMessage(s)});return}if(a.type==="detect"){let o=s=>{let l={v:M,type:"result",id:a.id,observation:s};t.postMessage(l),a.bitmap.close?.()};if(i===null){o(null);return}i.detect(a.bitmap,a.streamWidth,a.streamHeight).then(o,()=>o(null))}}}typeof self<"u"&&typeof self.importScripts=="function"&&Pr(self);var J=class t{constructor(e,r){this.pending=new Map;this.nextId=1;this.worker=e,this.tier=r.tier,r.fallbackReason!==void 0&&(this.fallbackReason=r.fallbackReason),e.addEventListener("message",i=>{let n=i.data;if(n.v!==M||n.type!=="result")return;let a=this.pending.get(n.id);this.pending.delete(n.id),a?.(n.observation)})}static create(e,r,i=1e4){return new Promise((n,a)=>{let o=setTimeout(()=>{e.removeEventListener("message",s),e.terminate(),a(new Error(`worker detector not ready within ${i}ms`))},i),s=c=>{let u=c.data;u.v!==M||u.type!=="ready"||(clearTimeout(o),e.removeEventListener("message",s),n(new t(e,u)))};e.addEventListener("message",s);let l={v:M,type:"init",options:r};e.postMessage(l)})}async detect(e,r,i){let n;try{typeof ImageBitmap<"u"&&e instanceof ImageBitmap?n=e:typeof createImageBitmap=="function"?n=await createImageBitmap(e):n=e}catch{return null}let a=this.nextId;return this.nextId+=1,new Promise(o=>{this.pending.set(a,o);let s={v:M,type:"detect",id:a,bitmap:n,streamWidth:r,streamHeight:i};this.worker.postMessage(s,[n])})}destroy(){for(let e of this.pending.values())e(null);this.pending.clear(),this.worker.terminate()}};var Fr=["size","centering","pose","exposure","sharpness","motion"];function mt(t){if(t.accepted)return null;if(t.factors.presence<=0)return"no_face";let e="size";for(let r of Fr)t.factors[r]<t.factors[e]&&(e=r);return e}var D=class{constructor(){this.blocked={};this.acceptedMs=0;this.ticks=0;this.lastAt=null}record(e){let r=this.lastAt===null?0:Math.max(0,e.at-this.lastAt);this.lastAt=e.at,this.ticks+=1;let i=mt(e);if(i===null){this.acceptedMs+=r;return}let n=this.blocked[i]??{count:0,ms:0};n.count+=1,n.ms+=r,this.blocked[i]=n}summary(){let e={};for(let[r,i]of Object.entries(this.blocked))e[r]={count:i.count,ms:Math.round(i.ms)};return{blocked:e,acceptedMs:Math.round(this.acceptedMs),ticks:this.ticks}}};var kt=1e3,te="fcv3.hold_upright",Ct=200,re=4,wt=600,xt=1e3,Mt={sharpness:1,exposure:1,meanLuma:128};function Wr(t,e){return e.width=t.videoWidth,e.height=t.videoHeight,e.getContext("2d").drawImage(t,0,0),new Promise((r,i)=>e.toBlob(n=>n?r(n):i(new Error("empty-keyframe")),"image/jpeg",.92))}function Kr(){return q()==="phone"}var _e=class{constructor(e){this.handlers=new Map;this.stateValue="idle";this.attempt=0;this.stream=null;this.detector=null;this.scheduler=null;this.gate=null;this.profiler=null;this.lastGuidanceKey=null;this.positioningStartedAt=0;this.cameraRequestedAt=null;this.cameraReadyAt=null;this.faceAcquiredAt=null;this.captureCompleteAt=null;this.fired=!1;this.carriedDegrade=0;this.carriedMeans=[];this.blockStats=null;this.lastGateSnapshotAt=Number.NEGATIVE_INFINITY;this.uprightGuard=!1;this.trackProvenance=null;this.ramp=null;this.snapshotCanvas=null;this.options=e,this.facing=e.facingMode??"user"}get state(){return this.stateValue}on(e,r){let i=this.handlers.get(e);return i||(i=new Set,this.handlers.set(e,i)),i.add(r),()=>i?.delete(r)}emit(e,r){for(let i of[...this.handlers.get(e)??[]])i(r)}async start(e={}){e.facingMode!==void 0&&(this.facing=e.facingMode),this.attempt+=1,await this.run(this.attempt)}get facingMode(){return this.facing}retry(){this.teardownAttempt(),this.start()}switchCamera(){this.facing=this.facing==="user"?"environment":"user",this.teardownAttempt(),this.start()}destroy(){this.attempt+=1,this.teardownAttempt(),this.detector?.destroy(),this.detector=null,this.options.video.srcObject=null}async run(e){let{options:r}=this;this.fired=!1,this.lastGuidanceKey=null,this.carriedDegrade=0,this.carriedMeans=[],this.cameraRequestedAt=null,this.cameraReadyAt=null,this.faceAcquiredAt=null,this.captureCompleteAt=null,this.uprightGuard=(r.isPhone??Kr)(),this.setState("preflight");let i=se();if(i!=="OK"){this.fail(i==="INSECURE_CONTEXT"?"insecure":"unsupported",{phase:"preflight"});return}this.setState("acquiring");let n=r.getUserMedia??(c=>navigator.mediaDevices.getUserMedia(c)),a;this.cameraRequestedAt=this.now();try{a=await n(le(de(),this.facing))}catch(c){if(e!==this.attempt)return;this.fail(lt(c),{phase:"acquiring",name:H(c)});return}if(nt(a),it(a),e!==this.attempt){for(let c of a.getTracks())c.stop();return}this.stream=a;let o=a.getVideoTracks?.()[0];if(this.trackProvenance=o===void 0?null:ot(o).catch(()=>null),this.facing=me(a)??this.facing,r.video.srcObject=a,await r.video.play().catch(()=>{}),e!==this.attempt)return;if(this.cameraReadyAt=this.now(),this.detector===null){let c={v3AssetBaseUrl:r.v3AssetBaseUrl},u=r.createDetector??(r.createWorker!==void 0&&dt()?async()=>{try{return await J.create(r.createWorker(),c)}catch{return x(c)}}:()=>x(c)),d;try{d=await u()}catch(m){e===this.attempt&&this.fail("models",{phase:"models",name:H(m)},m instanceof w?m.fallbackReason:zr(m));return}if(e!==this.attempt){d.destroy();return}this.detector=d,this.options.telemetry?.({type:"detector",tier:d.tier,fallbackReason:d.fallbackReason})}let s=ge(),l=r.deviceClass??be(s);this.profiler=new N(l),this.options.telemetry?.({type:"profile",staticClass:l,activeClass:this.profiler.deviceClass,simd:s.simd}),this.gate=new R(r.thresholds??{}),this.blockStats=new D,this.lastGateSnapshotAt=this.now(),r.rankKeyframes?.()&&Promise.resolve().then(()=>(Et(),St)).then(c=>xe=c,()=>{}),this.setState("positioning"),this.positioningStartedAt=this.now(),this.startScheduler(e)}get animations(){return this.profiler?.profile.animations??"full"}startScheduler(e){let r=this.profiler;if(r===null)return;if(this.scheduler!==null){let n=this.scheduler.stats();this.carriedDegrade+=n.degradeCount,n.meanDetectMs>0&&this.carriedMeans.push(n.meanDetectMs),this.scheduler.stop()}let i=new V({cadenceHz:r.profile.cadenceHz,video:this.options.video,now:this.options.now,run:()=>this.detectTick(e)});this.scheduler=i,i.start()}async detectTick(e){let{detector:r,gate:i,profiler:n}=this,a=this.options.video;if(e!==this.attempt||r===null||i===null||n===null||this.fired||a.videoWidth===0)return;if(this.isLandscape()){this.holdUpright(e);return}let o=n.deviceClass,s=this.now(),l=this.options.makeSnapshot?.(a,n.profile.inputWidth)??this.defaultSnapshot(a,n.profile.inputWidth),c=null;try{c=await r.detect(l,a.videoWidth,a.videoHeight)}catch{c=null}if(e!==this.attempt||this.fired)return;n.record(this.now()-s),n.deviceClass!==o&&this.startScheduler(e);let u=c===null?Mt:this.options.measureQuality?.(a,c.box)??this.defaultQuality(a,c.box),d=i.tick({timestampMs:this.now(),observation:c,quality:u,frameWidth:a.videoWidth,frameHeight:a.videoHeight});d.accepted&&this.faceAcquiredAt===null&&(this.faceAcquiredAt=d.at),this.blockStats?.record(d),!d.ready&&d.at-this.lastGateSnapshotAt>=kt&&(this.lastGateSnapshotAt=d.at,this.reportGate(!1)),this.emit("checks",{engine:"v3",progress:d.p,q:d.q,factors:d.factors,attempt:e}),d.guidanceKey!==this.lastGuidanceKey&&(this.lastGuidanceKey=d.guidanceKey,this.emit("guidance",{key:d.guidanceKey})),d.ready&&this.stateValue==="positioning"&&(this.fired=!0,this.captureCompleteAt=d.at,this.fire(e))}async fire(e){let{options:r}=this,i=this.scheduler;i?.stop(),this.reportGate(!0);let n=i?.stats()??{degradeCount:0,meanDetectMs:0},a=[...this.carriedMeans,...n.meanDetectMs>0?[n.meanDetectMs]:[]];r.telemetry?.({type:"fired",timeToGateMs:this.now()-this.positioningStartedAt,degradeCount:this.carriedDegrade+n.degradeCount,meanDetectMs:a.length===0?0:a.reduce((b,E)=>b+E,0)/a.length});let o=r.mode??"clip",s=r.rankKeyframes?.()&&xe?xe.default(this,e).catch(()=>this.collectKeyframes(e)):this.collectKeyframes(e);if(o==="photo"){let b=this.watchRotation(e,null),E=await s;if(b(),e!==this.attempt)return;if(E===null){this.fail("generic",{phase:"keyframes"});return}let _t=await this.provenance({n:0,meanGapMs:0,stdGapMs:0,captureLatencyMs:null},!1);if(e!==this.attempt)return;this.finishCapture({keyframe:E.blob,previewDataUrl:E.previewDataUrl,..._t});return}this.setState("recording");let l=r.createRecorder?.()??new P,c=this.stream;if(c===null){this.fail("generic",{phase:"recording"});return}let u=st(r.video),d=r.screenRamp?.(),m=d!==void 0,p=ut(d,{paint:b=>{(b===null||e===this.attempt)&&this.emit("ramp",{colour:b})},now:()=>this.now(),frames:u.latest});this.ramp=p;let f=()=>{u.stop(),p.stop(),this.ramp===p&&(this.ramp=null)},h=this.watchRotation(e,l),g=null;s.then(b=>{g=b},()=>{});let S=()=>{e===this.attempt&&g!==null&&this.emit("frozen",{previewDataUrl:g.previewDataUrl})},v,T;try{[v,T]=await Promise.all([l.record(c,S,()=>p.started(this.now())),s])}catch(b){if(h(),f(),e!==this.attempt)return;let E=b.kind;this.fail(E==="cliptoolarge"?"cliptoolarge":"recorder",{phase:"recording",name:H(b)});return}h();let k=u.stats();if(f(),e!==this.attempt)return;if(O(v.blob)){this.fail("cliptoolarge",{phase:"recording"});return}if(T===null){this.fail("generic",{phase:"keyframes"});return}let A=p.report(),ne=await this.provenance(k,m);e===this.attempt&&this.finishCapture({clip:v.blob,clipMimeType:v.mimeType,keyframe:T.blob,previewDataUrl:T.previewDataUrl,...A!==void 0&&A.rendered.length>0?{screenRamp:A}:{},...ne})}async provenance(e,r){let i=this.trackProvenance;if(i===null)return{};let n,a=new Promise(s=>{n=setTimeout(()=>s(null),xt)}),o=await Promise.race([i,a]);return clearTimeout(n),o===null?{}:{provenance:ct(o,e,r)}}isLandscape(){let e=this.options.video;return this.uprightGuard&&e.videoWidth>e.videoHeight}holdUpright(e){this.gate?.reset(),this.emit("checks",{engine:"v3",progress:0,q:0,factors:{presence:0,centering:0,size:0,pose:0,sharpness:0,exposure:0,motion:0},attempt:e}),this.lastGuidanceKey!==te&&(this.lastGuidanceKey=te,this.emit("guidance",{key:te}))}watchRotation(e,r){if(!this.uprightGuard)return()=>{};let i=this.options.video,n=()=>{if(e!==this.attempt||r!==null&&this.stateValue!=="recording"){s();return}i.videoWidth>0&&this.isLandscape()&&(s(),this.abortRecording(e,r))},a=setInterval(n,Ct);i.addEventListener?.("resize",n);let o=!1;function s(){o||(o=!0,clearInterval(a),i.removeEventListener?.("resize",n))}return s}abortRecording(e,r){if(e!==this.attempt)return;this.attempt+=1;let i=this.attempt;try{r?.stop()}catch{}this.ramp?.stop(),this.ramp=null,this.fired=!1,this.captureCompleteAt=null,this.gate=new R(this.options.thresholds??{}),this.blockStats=new D,this.lastGateSnapshotAt=this.now(),this.lastGuidanceKey=null,this.setState("positioning"),this.positioningStartedAt=this.now(),this.holdUpright(i),this.startScheduler(i)}async collectKeyframes(e){let r=this.options.captureKeyframe??(a=>this.defaultKeyframe(a)),i=wt/(re-1),n=null;for(let a=0;a<re;a+=1){if(e!==this.attempt)return n;try{let o=await r(this.options.video);(n===null||o.sharpness>n.sharpness)&&(n=o)}catch{}a<re-1&&await Ur(i)}return n}finishCapture(e){this.stopTracks(),this.setState("captured");let r=this.captureTiming();this.emit("artifacts",r===void 0?e:{...e,timing:r})}captureTiming(){let e={},r=(i,n,a)=>{n!==null&&a!==null&&(e[i]=Math.max(0,Math.round(a-n)))};return r("cameraReadyMs",this.cameraRequestedAt,this.cameraReadyAt),r("faceAcquireMs",this.cameraReadyAt,this.faceAcquiredAt),r("captureMs",this.faceAcquiredAt,this.captureCompleteAt),Object.keys(e).length>0?e:void 0}async defaultKeyframe(e){let r=document.createElement("canvas"),i=await(this.facing==="user"?ce:Wr)(e,r),n=r.toDataURL("image/jpeg",.92);return{blob:i,previewDataUrl:n,sharpness:this.centerSharpness(e)}}defaultSnapshot(e,r){try{let i=this.snapshotCanvas??document.createElement("canvas"),n=r/Math.max(1,e.videoWidth),a=Math.max(1,Math.round(e.videoWidth*n)),o=Math.max(1,Math.round(e.videoHeight*n)),s=i.getContext("2d");return s===null?e:(i.width!==a&&(i.width=a),i.height!==o&&(i.height=o),s.drawImage(e,0,0,a,o),this.snapshotCanvas=i,i)}catch{return e}}defaultQuality(e,r){let i=Tt(e,r,96);return i===null?Mt:{sharpness:Q(i),exposure:fe(i),meanLuma:j(i)}}centerSharpness(e){let r=C(e),i=Tt(e,{x:r.width*.25,y:r.height*.25,width:r.width*.5,height:r.height*.5},96);return i===null?0:Q(i)}teardownAttempt(){this.scheduler?.stop(),this.scheduler=null,this.reportGate(!0),this.gate=null,this.ramp?.stop(),this.ramp=null,this.stopTracks()}reportGate(e){let r=this.blockStats,i=this.profiler;if(r===null||i===null)return;let n=r.summary();e&&(this.blockStats=null),n.ticks!==0&&this.options.telemetry?.({type:"gate",final:e,activeClass:i.deviceClass,cadenceHz:i.profile.cadenceHz,...n})}stopTracks(){if(this.stream!==null){for(let e of this.stream.getTracks())e.stop();this.stream=null}}fail(e,r,i){this.scheduler?.stop(),this.reportGate(!0),this.stopTracks(),this.setState("error"),this.options.telemetry?.({type:"error",kind:e,fallbackReason:i});let{phase:n,name:a}=r;this.emit("error",{kind:e,retryable:e!=="insecure"&&e!=="unsupported",detail:a===void 0?{phase:n}:{phase:n,name:a}})}setState(e){this.stateValue=e,this.emit("statechange",{state:e})}now(){return this.options.now?.()??performance.now()}},xe;function Ur(t){return new Promise(e=>setTimeout(e,t))}function zr(t){return t instanceof Error?t.message:String(t)}function Tt(t,e,r){try{let i=document.createElement("canvas"),n=r/Math.max(1,e.width);i.width=Math.max(1,Math.round(e.width*n)),i.height=Math.max(1,Math.round(e.height*n));let a=i.getContext("2d");return a===null?null:(a.drawImage(t,e.x,e.y,e.width,e.height,0,0,i.width,i.height),a.getImageData(0,0,i.width,i.height))}catch{return null}}0&&(module.exports={CENTERED_FACTOR,CIRCLE_RADIUS_FACTOR,CLIP_MS,CaptureSessionV3,ClipError,ClipRecorder,DEFAULT_CLIP_MIME,DEFAULT_TIER_ORDER,DEFAULT_V3_ASSET_BASE_URL,DEVICE_PROFILES,DetectScheduler,DetectorLadderError,DeviceProfiler,EXPOSURE_BAND,FaceGateV3,GATE_SNAPSHOT_MS,GateBlockStats,HOLD_UPRIGHT_KEY,IN_CIRCLE_FACTOR,KEYFRAME_CANDIDATES,KEYFRAME_WINDOW_MS,MAX_CLIP_BYTES,MIME_CANDIDATES,PHONE_MAX_SHORT_SIDE,PROVENANCE_WAIT_MS,SHARP_REF,STOP_GRACE_MS,TIMESLICE_MS,UPRIGHT_WATCH_MS,V3_GATE_DEFAULTS,VIDEO_BPS,blockReasonOf,buildCaptureConstraints,buildLivenessV2FormData,cameraPreflight,captureMirroredKeyframe,classifyDevice,createDetector,detectFormFactor,detectIsMobile,errorCopy,exposure,extForMime,intrinsicSize,isClipTooLarge,isMediaRecorderSupported,mapGetUserMediaError,meanLuma,pickMimeType,probeDevice,sharpness,toStreamPixels,trackFacingMode,uiCopy});
@@ -1,8 +1,8 @@
1
- import { C as CameraErrorKind } from '../capture-session-v3-CNL-GX11.cjs';
2
- export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureSessionV3StartOptions, i as CaptureState, j as CaptureTiming, k as ClipError, l as ClipErrorKind, m as ClipRecorder, n as ClipResult, D as DEFAULT_CLIP_MIME, o as DEVICE_PROFILES, p as DeviceClass, q as DeviceProbe, r as DeviceProfile, s as DeviceProfiler, E as EscalationClipArtifact, t as EscalationHook, F as FaceGateV3, G as GATE_SNAPSHOT_MS, u as GateBlockEntry, v as GateBlockReason, w as GateBlockStats, x as GateBlockSummary, y as GateChecks, H as HOLD_UPRIGHT_KEY, K as KEYFRAME_CANDIDATES, z as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, A as MIME_CANDIDATES, P as PROVENANCE_WAIT_MS, S as STOP_GRACE_MS, T as TIMESLICE_MS, U as UPRIGHT_WATCH_MS, V as V3ChecksPayload, B as V3GateFactor, I as V3GateQuality, J as V3GateThresholds, L as V3GateTick, N as V3GateTickInput, O as V3TelemetryEvent, Q as V3_GATE_DEFAULTS, R as VIDEO_BPS, W as blockReasonOf, X as buildLivenessV2FormData, Y as cameraPreflight, Z as classifyDevice, _ as extForMime, $ as isClipTooLarge, a0 as isMediaRecorderSupported, a1 as mapGetUserMediaError, a2 as pickMimeType, a3 as probeDevice } from '../capture-session-v3-CNL-GX11.cjs';
1
+ import { C as CameraErrorKind } from '../capture-session-v3-26FgzBIl.cjs';
2
+ export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureSessionV3StartOptions, i as CaptureState, j as CaptureTiming, k as ClipError, l as ClipErrorKind, m as ClipRecorder, n as ClipResult, D as DEFAULT_CLIP_MIME, o as DEVICE_PROFILES, p as DeviceClass, q as DeviceProbe, r as DeviceProfile, s as DeviceProfiler, E as EscalationClipArtifact, t as EscalationHook, F as FaceGateV3, G as GATE_SNAPSHOT_MS, u as GateBlockEntry, v as GateBlockReason, w as GateBlockStats, x as GateBlockSummary, y as GateChecks, H as HOLD_UPRIGHT_KEY, K as KEYFRAME_CANDIDATES, z as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, A as MIME_CANDIDATES, P as PROVENANCE_WAIT_MS, S as STOP_GRACE_MS, T as TIMESLICE_MS, U as UPRIGHT_WATCH_MS, V as V3ChecksPayload, B as V3GateFactor, I as V3GateQuality, J as V3GateThresholds, L as V3GateTick, N as V3GateTickInput, O as V3TelemetryEvent, Q as V3_GATE_DEFAULTS, R as VIDEO_BPS, W as blockReasonOf, X as buildLivenessV2FormData, Y as cameraPreflight, Z as classifyDevice, _ as extForMime, $ as isClipTooLarge, a0 as isMediaRecorderSupported, a1 as mapGetUserMediaError, a2 as pickMimeType, a3 as probeDevice } from '../capture-session-v3-26FgzBIl.cjs';
3
3
  export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, P as PHONE_MAX_SHORT_SIDE, b as buildCaptureConstraints, d as detectFormFactor, c as detectIsMobile, t as trackFacingMode } from '../capture-constraints-B5omafmk.cjs';
4
4
  export { C as CreateDetectorOptions, D as DEFAULT_TIER_ORDER, a as DEFAULT_V3_ASSET_BASE_URL, b as Detector, c as DetectorLadderError, F as FaceObservation, d as createDetector, i as intrinsicSize, t as toStreamPixels } from '../detect-worker-DclNxkZT.cjs';
5
- import '../types-Dpfg2cO8.cjs';
5
+ import '../types-C_XP92JQ.cjs';
6
6
 
7
7
  declare function captureMirroredKeyframe(video: HTMLVideoElement, canvas: HTMLCanvasElement, quality?: number): Promise<Blob>;
8
8
 
@@ -1,8 +1,8 @@
1
- import { C as CameraErrorKind } from '../capture-session-v3-DaBqN8fO.js';
2
- export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureSessionV3StartOptions, i as CaptureState, j as CaptureTiming, k as ClipError, l as ClipErrorKind, m as ClipRecorder, n as ClipResult, D as DEFAULT_CLIP_MIME, o as DEVICE_PROFILES, p as DeviceClass, q as DeviceProbe, r as DeviceProfile, s as DeviceProfiler, E as EscalationClipArtifact, t as EscalationHook, F as FaceGateV3, G as GATE_SNAPSHOT_MS, u as GateBlockEntry, v as GateBlockReason, w as GateBlockStats, x as GateBlockSummary, y as GateChecks, H as HOLD_UPRIGHT_KEY, K as KEYFRAME_CANDIDATES, z as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, A as MIME_CANDIDATES, P as PROVENANCE_WAIT_MS, S as STOP_GRACE_MS, T as TIMESLICE_MS, U as UPRIGHT_WATCH_MS, V as V3ChecksPayload, B as V3GateFactor, I as V3GateQuality, J as V3GateThresholds, L as V3GateTick, N as V3GateTickInput, O as V3TelemetryEvent, Q as V3_GATE_DEFAULTS, R as VIDEO_BPS, W as blockReasonOf, X as buildLivenessV2FormData, Y as cameraPreflight, Z as classifyDevice, _ as extForMime, $ as isClipTooLarge, a0 as isMediaRecorderSupported, a1 as mapGetUserMediaError, a2 as pickMimeType, a3 as probeDevice } from '../capture-session-v3-DaBqN8fO.js';
1
+ import { C as CameraErrorKind } from '../capture-session-v3-ZO0QOeQH.js';
2
+ export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureSessionV3StartOptions, i as CaptureState, j as CaptureTiming, k as ClipError, l as ClipErrorKind, m as ClipRecorder, n as ClipResult, D as DEFAULT_CLIP_MIME, o as DEVICE_PROFILES, p as DeviceClass, q as DeviceProbe, r as DeviceProfile, s as DeviceProfiler, E as EscalationClipArtifact, t as EscalationHook, F as FaceGateV3, G as GATE_SNAPSHOT_MS, u as GateBlockEntry, v as GateBlockReason, w as GateBlockStats, x as GateBlockSummary, y as GateChecks, H as HOLD_UPRIGHT_KEY, K as KEYFRAME_CANDIDATES, z as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, A as MIME_CANDIDATES, P as PROVENANCE_WAIT_MS, S as STOP_GRACE_MS, T as TIMESLICE_MS, U as UPRIGHT_WATCH_MS, V as V3ChecksPayload, B as V3GateFactor, I as V3GateQuality, J as V3GateThresholds, L as V3GateTick, N as V3GateTickInput, O as V3TelemetryEvent, Q as V3_GATE_DEFAULTS, R as VIDEO_BPS, W as blockReasonOf, X as buildLivenessV2FormData, Y as cameraPreflight, Z as classifyDevice, _ as extForMime, $ as isClipTooLarge, a0 as isMediaRecorderSupported, a1 as mapGetUserMediaError, a2 as pickMimeType, a3 as probeDevice } from '../capture-session-v3-ZO0QOeQH.js';
3
3
  export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, P as PHONE_MAX_SHORT_SIDE, b as buildCaptureConstraints, d as detectFormFactor, c as detectIsMobile, t as trackFacingMode } from '../capture-constraints-B5omafmk.js';
4
4
  export { C as CreateDetectorOptions, D as DEFAULT_TIER_ORDER, a as DEFAULT_V3_ASSET_BASE_URL, b as Detector, c as DetectorLadderError, F as FaceObservation, d as createDetector, i as intrinsicSize, t as toStreamPixels } from '../detect-worker-DclNxkZT.js';
5
- import '../types-Dpfg2cO8.js';
5
+ import '../types-C_XP92JQ.js';
6
6
 
7
7
  declare function captureMirroredKeyframe(video: HTMLVideoElement, canvas: HTMLCanvasElement, quality?: number): Promise<Blob>;
8
8
 
@@ -1 +1 @@
1
- import{a as x,b as k,c as z,d as C,e as L,f as T,k as E,l as N,m as w,n as D,o as G,p as I,q as J,r as M,s as Q,t as W,u as X,v as Y,w as Z}from"../chunk-FGOVIGGL.js";import{a as e,b as r,c as o,d as n,e as a,f as s,g as t,h as i}from"../chunk-FUHDOEBP.js";import{a as P,b as S,c as B,d as F}from"../chunk-POIQGEZM.js";import{a as c,b as p,c as u,d as f,e as m,f as d,g as l,h as v,i as y,j as g}from"../chunk-CQ7SKLMC.js";import{a as O,b as U,c as V,d as j,e as q}from"../chunk-FPXL63KZ.js";import"../chunk-ZLWH4RBO.js";import{a as R,b as h,c as b,d as A,e as H,f as K}from"../chunk-OKWG3PVH.js";var _={permission:{key:"fcv2.err.permission",fr:"Autorisez la cam\xE9ra dans les r\xE9glages du navigateur (ic\xF4ne cam\xE9ra dans la barre d\u2019adresse), puis r\xE9essayez."},notfound:{key:"fcv2.err.notfound",fr:"Aucune cam\xE9ra d\xE9tect\xE9e. Branchez ou activez une cam\xE9ra, puis r\xE9essayez."},inuse:{key:"fcv2.err.inuse",fr:"La cam\xE9ra est utilis\xE9e par une autre application. Fermez-la puis r\xE9essayez."},overconstrained:{key:"fcv2.err.overconstrained",fr:"La cam\xE9ra ne prend pas en charge les r\xE9glages demand\xE9s. Nouvel essai en cours\u2026"},insecure:{key:"fcv2.err.insecure",fr:"La cam\xE9ra n\xE9cessite une connexion s\xE9curis\xE9e (HTTPS). Ouvrez la page en HTTPS."},unsupported:{key:"fcv2.err.unsupported",fr:"Votre navigateur ne prend pas en charge l\u2019enregistrement vid\xE9o. Utilisez un navigateur r\xE9cent."},generic:{key:"fcv2.err.generic",fr:"Cam\xE9ra indisponible. R\xE9essayez ou contactez le support."}},$={recording:{key:"fcv2.recording",fr:"Enregistrement en cours\u2026"},uploading:{key:"fcv2.uploading",fr:"Envoi en cours\u2026"},clipTooLarge:{key:"fcv2.err.cliptoolarge",fr:"La vid\xE9o est trop volumineuse. R\xE9essayez dans un endroit mieux \xE9clair\xE9."},retry:{key:"fcv2.retry",fr:"R\xE9essayer"},listen:{key:"fcv2.listen",fr:"\xC9couter"}};export{i as CENTERED_FACTOR,s as CIRCLE_RADIUS_FACTOR,x as CLIP_MS,Z as CaptureSessionV3,L as ClipError,T as ClipRecorder,u as DEFAULT_CLIP_MIME,h as DEFAULT_TIER_ORDER,R as DEFAULT_V3_ASSET_BASE_URL,P as DEVICE_PROFILES,N as DetectScheduler,b as DetectorLadderError,F as DeviceProfiler,U as EXPOSURE_BAND,D as FaceGateV3,J as GATE_SNAPSHOT_MS,I as GateBlockStats,M as HOLD_UPRIGHT_KEY,t as IN_CIRCLE_FACTOR,W as KEYFRAME_CANDIDATES,X as KEYFRAME_WINDOW_MS,l as MAX_CLIP_BYTES,c as MIME_CANDIDATES,r as PHONE_MAX_SHORT_SIDE,Y as PROVENANCE_WAIT_MS,O as SHARP_REF,z as STOP_GRACE_MS,k as TIMESLICE_MS,Q as UPRIGHT_WATCH_MS,w as V3_GATE_DEFAULTS,C as VIDEO_BPS,G as blockReasonOf,e as buildCaptureConstraints,g as buildLivenessV2FormData,m as cameraPreflight,E as captureMirroredKeyframe,B as classifyDevice,K as createDetector,o as detectFormFactor,n as detectIsMobile,_ as errorCopy,q as exposure,y as extForMime,A as intrinsicSize,v as isClipTooLarge,d as isMediaRecorderSupported,f as mapGetUserMediaError,V as meanLuma,p as pickMimeType,S as probeDevice,j as sharpness,H as toStreamPixels,a as trackFacingMode,$ as uiCopy};
1
+ import{a as x,b as k,c as z,d as C,e as L,f as T,k as E,l as N,m as w,n as D,o as G,p as I,q as J,r as M,s as Q,t as W,u as X,v as Y,w as Z}from"../chunk-7Q4YPMAF.js";import{a as e,b as r,c as o,d as n,e as a,f as s,g as t,h as i}from"../chunk-FUHDOEBP.js";import{a as P,b as S,c as B,d as F}from"../chunk-POIQGEZM.js";import{a as c,b as p,c as u,d as f,e as m,f as d,g as l,h as v,i as y,j as g}from"../chunk-CQ7SKLMC.js";import{a as O,b as U,c as V,d as j,e as q}from"../chunk-FPXL63KZ.js";import"../chunk-VIAT4DEA.js";import{a as R,b as h,c as b,d as A,e as H,f as K}from"../chunk-OKWG3PVH.js";var _={permission:{key:"fcv2.err.permission",fr:"Autorisez la cam\xE9ra dans les r\xE9glages du navigateur (ic\xF4ne cam\xE9ra dans la barre d\u2019adresse), puis r\xE9essayez."},notfound:{key:"fcv2.err.notfound",fr:"Aucune cam\xE9ra d\xE9tect\xE9e. Branchez ou activez une cam\xE9ra, puis r\xE9essayez."},inuse:{key:"fcv2.err.inuse",fr:"La cam\xE9ra est utilis\xE9e par une autre application. Fermez-la puis r\xE9essayez."},overconstrained:{key:"fcv2.err.overconstrained",fr:"La cam\xE9ra ne prend pas en charge les r\xE9glages demand\xE9s. Nouvel essai en cours\u2026"},insecure:{key:"fcv2.err.insecure",fr:"La cam\xE9ra n\xE9cessite une connexion s\xE9curis\xE9e (HTTPS). Ouvrez la page en HTTPS."},unsupported:{key:"fcv2.err.unsupported",fr:"Votre navigateur ne prend pas en charge l\u2019enregistrement vid\xE9o. Utilisez un navigateur r\xE9cent."},generic:{key:"fcv2.err.generic",fr:"Cam\xE9ra indisponible. R\xE9essayez ou contactez le support."}},$={recording:{key:"fcv2.recording",fr:"Enregistrement en cours\u2026"},uploading:{key:"fcv2.uploading",fr:"Envoi en cours\u2026"},clipTooLarge:{key:"fcv2.err.cliptoolarge",fr:"La vid\xE9o est trop volumineuse. R\xE9essayez dans un endroit mieux \xE9clair\xE9."},retry:{key:"fcv2.retry",fr:"R\xE9essayer"},listen:{key:"fcv2.listen",fr:"\xC9couter"}};export{i as CENTERED_FACTOR,s as CIRCLE_RADIUS_FACTOR,x as CLIP_MS,Z as CaptureSessionV3,L as ClipError,T as ClipRecorder,u as DEFAULT_CLIP_MIME,h as DEFAULT_TIER_ORDER,R as DEFAULT_V3_ASSET_BASE_URL,P as DEVICE_PROFILES,N as DetectScheduler,b as DetectorLadderError,F as DeviceProfiler,U as EXPOSURE_BAND,D as FaceGateV3,J as GATE_SNAPSHOT_MS,I as GateBlockStats,M as HOLD_UPRIGHT_KEY,t as IN_CIRCLE_FACTOR,W as KEYFRAME_CANDIDATES,X as KEYFRAME_WINDOW_MS,l as MAX_CLIP_BYTES,c as MIME_CANDIDATES,r as PHONE_MAX_SHORT_SIDE,Y as PROVENANCE_WAIT_MS,O as SHARP_REF,z as STOP_GRACE_MS,k as TIMESLICE_MS,Q as UPRIGHT_WATCH_MS,w as V3_GATE_DEFAULTS,C as VIDEO_BPS,G as blockReasonOf,e as buildCaptureConstraints,g as buildLivenessV2FormData,m as cameraPreflight,E as captureMirroredKeyframe,B as classifyDevice,K as createDetector,o as detectFormFactor,n as detectIsMobile,_ as errorCopy,q as exposure,y as extForMime,A as intrinsicSize,v as isClipTooLarge,d as isMediaRecorderSupported,f as mapGetUserMediaError,V as meanLuma,p as pickMimeType,S as probeDevice,j as sharpness,H as toStreamPixels,a as trackFacingMode,$ as uiCopy};
@@ -1 +1 @@
1
- import{u as a,v as b,w as c,x as d}from"./chunk-IG466TOP.js";import"./chunk-G6LKLN4U.js";import"./chunk-TDLIXFDT.js";import"./chunk-W2WD7PR2.js";import"./chunk-GT2ZLGF7.js";import"./chunk-FGOVIGGL.js";import"./chunk-FUHDOEBP.js";import"./chunk-POIQGEZM.js";import"./chunk-CQ7SKLMC.js";import"./chunk-FPXL63KZ.js";import"./chunk-ZLWH4RBO.js";import"./chunk-OKWG3PVH.js";import"./chunk-DK5YPBDQ.js";export{a as SAME_FACE_MAX_DROPS,c as createDocumentCapture,d as createDocumentCaptureInternal,b as warmDocumentCapture};
1
+ import{u as a,v as b,w as c,x as d}from"./chunk-QYYJLXKA.js";import"./chunk-G6LKLN4U.js";import"./chunk-TDLIXFDT.js";import"./chunk-P3H3D33O.js";import"./chunk-GT2ZLGF7.js";import"./chunk-7Q4YPMAF.js";import"./chunk-FUHDOEBP.js";import"./chunk-POIQGEZM.js";import"./chunk-CQ7SKLMC.js";import"./chunk-FPXL63KZ.js";import"./chunk-VIAT4DEA.js";import"./chunk-OKWG3PVH.js";import"./chunk-DK5YPBDQ.js";export{a as SAME_FACE_MAX_DROPS,c as createDocumentCapture,d as createDocumentCaptureInternal,b as warmDocumentCapture};
@@ -1 +1 @@
1
- import{j as a,k as b,l as c,m as d,n as e,o as f}from"./chunk-KHR4U2SZ.js";import"./chunk-7ZCZY3ZP.js";import"./chunk-BPE5NSQ2.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import"./chunk-GI3UFGRQ.js";import"./chunk-GT2ZLGF7.js";import"./chunk-FUHDOEBP.js";import"./chunk-CQ7SKLMC.js";export{a as ANALYSIS_LONG_EDGE,b as PORTRAIT_JPEG_QUALITY,e as createPortraitCaptureInternal,c as defaultGrabber,d as observe,f as warmPortraitCapture};
1
+ import{j as a,k as b,l as c,m as d,n as e,o as f}from"./chunk-ZNIZACXD.js";import"./chunk-53POX7U4.js";import"./chunk-33KKMPJ5.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import"./chunk-GI3UFGRQ.js";import"./chunk-GT2ZLGF7.js";import"./chunk-FUHDOEBP.js";import"./chunk-CQ7SKLMC.js";export{a as ANALYSIS_LONG_EDGE,b as PORTRAIT_JPEG_QUALITY,e as createPortraitCaptureInternal,c as defaultGrabber,d as observe,f as warmPortraitCapture};
@@ -1,7 +1,7 @@
1
1
  import { b as Detector } from './detect-worker-DclNxkZT.cjs';
2
- import { A as AcceptedDocumentType, a5 as NationalEidOption, aC as StepSection, aL as HostedBranding, aj as PlanSectionView, ag as PlanChoiceKind, k as ContactChannel, f as CheckReason, aP as RetakeHint, ad as PhotoSource, ae as PhotoSourcePick, Y as IdentityMethod, E as EidAfterPass, Z as IdentitySummarySource, I as HostedIcaoPolicy, a9 as PhoneCountryRule, W as IcaoReportEntry, aO as IcaoCaptureTuning, P as HostedPortraitPendingFix, b as CaptureMode, R as HostedSessionView, S as HostedStepView, ak as PlanStepView, aS as ScreenRampReport, aK as CaptureProvenance, aG as ScreenRampColour, ax as SessionFailureReason, aH as AgeEstimationReason, aF as VerificationLevel, aE as VerificationAssurance, a4 as MethodChoiceView, aI as CameraUnavailableCause, aJ as CaptureIssueReport, aw as ResolvedCaptureMode, U as HostedVoiceView, aQ as ScreenRampChallenge, aX as PersonMask, a as AttestationInput, h as CheckType, aq as PortraitIcaoInput } from './types-Dpfg2cO8.cjs';
3
- import { i as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1, p as DeviceClass, b as CaptureArtifacts, a4 as EngineErrorDetail, I as V3GateQuality, O as V3TelemetryEvent } from './capture-session-v3-CNL-GX11.cjs';
4
- import { f as IcaoGateSummary, g as IcaoGateUpdate, P as Point, h as Box, m as IcaoFrameObservation, H as HostedClient, n as IcaoGate } from './icao-gate-l40OU6x1.cjs';
2
+ import { A as AcceptedDocumentType, a6 as NationalEidOption, aE as StepSection, aN as HostedBranding, ak as PlanSectionView, ah as PlanChoiceKind, S as HostedSimulationView, k as ContactChannel, f as CheckReason, aR as RetakeHint, ae as PhotoSource, af as PhotoSourcePick, Z as IdentityMethod, E as EidAfterPass, _ as IdentitySummarySource, I as HostedIcaoPolicy, aa as PhoneCountryRule, X as IcaoReportEntry, aQ as IcaoCaptureTuning, P as HostedPortraitPendingFix, b as CaptureMode, R as HostedSessionView, T as HostedStepView, al as PlanStepView, aU as ScreenRampReport, aM as CaptureProvenance, aI as ScreenRampColour, ay as SessionFailureReason, aJ as AgeEstimationReason, aH as VerificationLevel, aG as VerificationAssurance, a5 as MethodChoiceView, aK as CameraUnavailableCause, aL as CaptureIssueReport, ax as ResolvedCaptureMode, V as HostedVoiceView, aS as ScreenRampChallenge, aZ as PersonMask, a as AttestationInput, h as CheckType, ar as PortraitIcaoInput } from './types-C_XP92JQ.cjs';
3
+ import { i as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1, p as DeviceClass, b as CaptureArtifacts, a4 as EngineErrorDetail, I as V3GateQuality, O as V3TelemetryEvent } from './capture-session-v3-26FgzBIl.cjs';
4
+ import { f as IcaoGateSummary, g as IcaoGateUpdate, P as Point, p as IcaoGateScores, h as Box, m as IcaoFrameObservation, H as HostedClient, n as IcaoGate } from './icao-gate-DvzOzHq6.cjs';
5
5
 
6
6
  declare const ISSUER_CODES: readonly string[];
7
7
 
@@ -75,6 +75,11 @@ interface StepContext {
75
75
  * Absent otherwise: then only a `human` session offers "continue without a camera".
76
76
  */
77
77
  cameraUnavailableHandled?: true;
78
+ /**
79
+ * Sandbox DX spec 2026-11-06 §8: a simulated session (`view.simulation`). Say that nothing is sent, show `otpCode` on
80
+ * the code screens, and with `skipCapture` offer the step's `skipCapture()`. Absent on every other session.
81
+ */
82
+ simulation?: HostedSimulationView;
78
83
  }
79
84
  interface StepAttempts {
80
85
  reason?: CheckReason;
@@ -334,6 +339,11 @@ interface DocumentSnapshot extends StepAttempts {
334
339
  side: "recto" | "verso";
335
340
  acceptedSides: ("recto" | "verso")[];
336
341
  documents: AcceptedDocumentsLike;
342
+ /**
343
+ * The person's country as detected from their IP address (ISO 3166-1 alpha-2, the view's
344
+ * `detectedCountry`): list it first among the issuers when `documents` accepts it. Absent when unknown.
345
+ */
346
+ detectedCountry?: string;
337
347
  /**
338
348
  * Age check (selfie): `true` when the session reached this document because the selfie could not settle the
339
349
  * person's age (`age_estimation` failed with `age_uncertain` or `age_unavailable`); show the step-up line
@@ -1083,7 +1093,7 @@ interface VerificationBusy {
1083
1093
  type VerificationLocale = "ar" | "fr" | "en" | "es" | "pt" | "de";
1084
1094
  /** Options of {@link createVerification}. */
1085
1095
  interface VerificationOptions {
1086
- /** The session's client token (from `POST /api/v2/sessions` → `client_token`). */
1096
+ /** The session's client token (from `POST /api/v2/sessions` → `clientToken`). */
1087
1097
  clientToken: string;
1088
1098
  /** API origin; default `https://api.sekyro.ai`. */
1089
1099
  apiOrigin?: string;
@@ -1382,6 +1392,12 @@ interface DocumentStepHandle extends DocumentSnapshot {
1382
1392
  * `reason`, or the next step). Other failures reject with the typed `HostedApiError`.
1383
1393
  */
1384
1394
  uploadDocument(file: Blob): Promise<void>;
1395
+ /**
1396
+ * Sandbox DX spec 2026-11-06 §8: present only when `context.simulation.skipCapture` is set. Stops the camera and
1397
+ * submits the check with `{ simulatedCapture: true }` and no media; the step then moves on as after a capture.
1398
+ * Repeating it while it is on its way reuses the same submission. Rejects with the typed `HostedApiError`.
1399
+ */
1400
+ skipCapture?(): Promise<void>;
1385
1401
  }
1386
1402
  /** The liveness / selfie step. */
1387
1403
  interface LivenessStepHandle extends LivenessSnapshot {
@@ -1395,6 +1411,12 @@ interface LivenessStepHandle extends LivenessSnapshot {
1395
1411
  * otherwise). Returns the unsubscribe; never fires without `livePhoto.icao`.
1396
1412
  */
1397
1413
  onLivePhoto(handler: (gate: LivePhotoGateUpdate) => void): () => void;
1414
+ /**
1415
+ * Sandbox DX spec 2026-11-06 §8: present only when `context.simulation.skipCapture` is set. Stops the camera and
1416
+ * submits the check with `{ simulatedCapture: true }` and no media; the step then moves on as after a capture.
1417
+ * Repeating it while it is on its way reuses the same submission. Rejects with the typed `HostedApiError`.
1418
+ */
1419
+ skipCapture?(): Promise<void>;
1398
1420
  }
1399
1421
  /** The ICAO coaching of a one-capture live photo (`LivenessStepHandle.onLivePhoto`). */
1400
1422
  interface LivePhotoGateUpdate {
@@ -1445,6 +1467,12 @@ interface PortraitStepHandle extends PortraitSnapshot {
1445
1467
  * to the `capture` phase for another photo. Submits `portrait_icao` with `{ fixReview: { accept } }`.
1446
1468
  */
1447
1469
  confirmFix(accept: boolean): Promise<void>;
1470
+ /**
1471
+ * Sandbox DX spec 2026-11-06 §8: present only when `context.simulation.skipCapture` is set. Stops the camera and
1472
+ * submits the check with `{ simulatedCapture: true }` and no media; the step then moves on as after a capture.
1473
+ * Repeating it while it is on its way reuses the same submission. Rejects with the typed `HostedApiError`.
1474
+ */
1475
+ skipCapture?(): Promise<void>;
1448
1476
  }
1449
1477
  /** The biometric step needs a phone (desktop browser). */
1450
1478
  interface MobileRequiredStepHandle extends MobileRequiredSnapshot {
@@ -1452,6 +1480,12 @@ interface MobileRequiredStepHandle extends MobileRequiredSnapshot {
1452
1480
  chooseOption?(option: string): Promise<void>;
1453
1481
  /** Re-read the session (e.g. after the person finished on their phone). */
1454
1482
  refresh(): Promise<void>;
1483
+ /**
1484
+ * Sandbox DX spec 2026-11-06 §8: present only when `context.simulation.skipCapture` is set. Stops the camera and
1485
+ * submits the check with `{ simulatedCapture: true }` and no media; the step then moves on as after a capture.
1486
+ * Repeating it while it is on its way reuses the same submission. Rejects with the typed `HostedApiError`.
1487
+ */
1488
+ skipCapture?(): Promise<void>;
1455
1489
  }
1456
1490
  /** The server is still deciding. */
1457
1491
  interface ProcessingStepHandle extends ProcessingSnapshot {
@@ -1461,7 +1495,10 @@ interface ProcessingStepHandle extends ProcessingSnapshot {
1461
1495
  refresh(): Promise<void>;
1462
1496
  }
1463
1497
  /** A step this SDK cannot run (`platform_unsupported` / `update_required`). */
1464
- type UnsupportedStepHandle = UnsupportedSnapshot;
1498
+ type UnsupportedStepHandle = UnsupportedSnapshot & {
1499
+ /** The chip step of a simulated session (`checkType: "nfc_chip"`); see {@link DocumentStepHandle.skipCapture}. */
1500
+ skipCapture?(): Promise<void>;
1501
+ };
1465
1502
  /** The session's outcome — display only (the SDK never decides it). */
1466
1503
  type ResultStepHandle = ResultSnapshot;
1467
1504
  /** What `on('step')` delivers: the step's data plus its actions. */
@@ -3033,6 +3070,8 @@ interface PortraitCaptureInternals {
3033
3070
  interface PortraitCaptureController {
3034
3071
  handle: PortraitCaptureHandle;
3035
3072
  setFlowState(state: Extract<PortraitCaptureState, "uploading" | "checking" | "done">): void;
3073
+ /** This gate run's mouth scores (staff diagnostics). */
3074
+ gateScores(): IcaoGateScores | null;
3036
3075
  }
3037
3076
  /** The observation of one landmarked frame. `scale` maps analysis px → source px. */
3038
3077
  declare function observe(faces: readonly LandmarkedFace[], frame: GrabbedFrame, sourceWidth: number, sourceHeight: number): IcaoFrameObservation;
@@ -1,7 +1,7 @@
1
1
  import { b as Detector } from './detect-worker-DclNxkZT.js';
2
- import { A as AcceptedDocumentType, a5 as NationalEidOption, aC as StepSection, aL as HostedBranding, aj as PlanSectionView, ag as PlanChoiceKind, k as ContactChannel, f as CheckReason, aP as RetakeHint, ad as PhotoSource, ae as PhotoSourcePick, Y as IdentityMethod, E as EidAfterPass, Z as IdentitySummarySource, I as HostedIcaoPolicy, a9 as PhoneCountryRule, W as IcaoReportEntry, aO as IcaoCaptureTuning, P as HostedPortraitPendingFix, b as CaptureMode, R as HostedSessionView, S as HostedStepView, ak as PlanStepView, aS as ScreenRampReport, aK as CaptureProvenance, aG as ScreenRampColour, ax as SessionFailureReason, aH as AgeEstimationReason, aF as VerificationLevel, aE as VerificationAssurance, a4 as MethodChoiceView, aI as CameraUnavailableCause, aJ as CaptureIssueReport, aw as ResolvedCaptureMode, U as HostedVoiceView, aQ as ScreenRampChallenge, aX as PersonMask, a as AttestationInput, h as CheckType, aq as PortraitIcaoInput } from './types-Dpfg2cO8.js';
3
- import { i as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1, p as DeviceClass, b as CaptureArtifacts, a4 as EngineErrorDetail, I as V3GateQuality, O as V3TelemetryEvent } from './capture-session-v3-DaBqN8fO.js';
4
- import { f as IcaoGateSummary, g as IcaoGateUpdate, P as Point, h as Box, m as IcaoFrameObservation, H as HostedClient, n as IcaoGate } from './icao-gate-CEGvJR3q.js';
2
+ import { A as AcceptedDocumentType, a6 as NationalEidOption, aE as StepSection, aN as HostedBranding, ak as PlanSectionView, ah as PlanChoiceKind, S as HostedSimulationView, k as ContactChannel, f as CheckReason, aR as RetakeHint, ae as PhotoSource, af as PhotoSourcePick, Z as IdentityMethod, E as EidAfterPass, _ as IdentitySummarySource, I as HostedIcaoPolicy, aa as PhoneCountryRule, X as IcaoReportEntry, aQ as IcaoCaptureTuning, P as HostedPortraitPendingFix, b as CaptureMode, R as HostedSessionView, T as HostedStepView, al as PlanStepView, aU as ScreenRampReport, aM as CaptureProvenance, aI as ScreenRampColour, ay as SessionFailureReason, aJ as AgeEstimationReason, aH as VerificationLevel, aG as VerificationAssurance, a5 as MethodChoiceView, aK as CameraUnavailableCause, aL as CaptureIssueReport, ax as ResolvedCaptureMode, V as HostedVoiceView, aS as ScreenRampChallenge, aZ as PersonMask, a as AttestationInput, h as CheckType, ar as PortraitIcaoInput } from './types-C_XP92JQ.js';
3
+ import { i as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1, p as DeviceClass, b as CaptureArtifacts, a4 as EngineErrorDetail, I as V3GateQuality, O as V3TelemetryEvent } from './capture-session-v3-ZO0QOeQH.js';
4
+ import { f as IcaoGateSummary, g as IcaoGateUpdate, P as Point, p as IcaoGateScores, h as Box, m as IcaoFrameObservation, H as HostedClient, n as IcaoGate } from './icao-gate-DI8VePWd.js';
5
5
 
6
6
  declare const ISSUER_CODES: readonly string[];
7
7
 
@@ -75,6 +75,11 @@ interface StepContext {
75
75
  * Absent otherwise: then only a `human` session offers "continue without a camera".
76
76
  */
77
77
  cameraUnavailableHandled?: true;
78
+ /**
79
+ * Sandbox DX spec 2026-11-06 §8: a simulated session (`view.simulation`). Say that nothing is sent, show `otpCode` on
80
+ * the code screens, and with `skipCapture` offer the step's `skipCapture()`. Absent on every other session.
81
+ */
82
+ simulation?: HostedSimulationView;
78
83
  }
79
84
  interface StepAttempts {
80
85
  reason?: CheckReason;
@@ -334,6 +339,11 @@ interface DocumentSnapshot extends StepAttempts {
334
339
  side: "recto" | "verso";
335
340
  acceptedSides: ("recto" | "verso")[];
336
341
  documents: AcceptedDocumentsLike;
342
+ /**
343
+ * The person's country as detected from their IP address (ISO 3166-1 alpha-2, the view's
344
+ * `detectedCountry`): list it first among the issuers when `documents` accepts it. Absent when unknown.
345
+ */
346
+ detectedCountry?: string;
337
347
  /**
338
348
  * Age check (selfie): `true` when the session reached this document because the selfie could not settle the
339
349
  * person's age (`age_estimation` failed with `age_uncertain` or `age_unavailable`); show the step-up line
@@ -1083,7 +1093,7 @@ interface VerificationBusy {
1083
1093
  type VerificationLocale = "ar" | "fr" | "en" | "es" | "pt" | "de";
1084
1094
  /** Options of {@link createVerification}. */
1085
1095
  interface VerificationOptions {
1086
- /** The session's client token (from `POST /api/v2/sessions` → `client_token`). */
1096
+ /** The session's client token (from `POST /api/v2/sessions` → `clientToken`). */
1087
1097
  clientToken: string;
1088
1098
  /** API origin; default `https://api.sekyro.ai`. */
1089
1099
  apiOrigin?: string;
@@ -1382,6 +1392,12 @@ interface DocumentStepHandle extends DocumentSnapshot {
1382
1392
  * `reason`, or the next step). Other failures reject with the typed `HostedApiError`.
1383
1393
  */
1384
1394
  uploadDocument(file: Blob): Promise<void>;
1395
+ /**
1396
+ * Sandbox DX spec 2026-11-06 §8: present only when `context.simulation.skipCapture` is set. Stops the camera and
1397
+ * submits the check with `{ simulatedCapture: true }` and no media; the step then moves on as after a capture.
1398
+ * Repeating it while it is on its way reuses the same submission. Rejects with the typed `HostedApiError`.
1399
+ */
1400
+ skipCapture?(): Promise<void>;
1385
1401
  }
1386
1402
  /** The liveness / selfie step. */
1387
1403
  interface LivenessStepHandle extends LivenessSnapshot {
@@ -1395,6 +1411,12 @@ interface LivenessStepHandle extends LivenessSnapshot {
1395
1411
  * otherwise). Returns the unsubscribe; never fires without `livePhoto.icao`.
1396
1412
  */
1397
1413
  onLivePhoto(handler: (gate: LivePhotoGateUpdate) => void): () => void;
1414
+ /**
1415
+ * Sandbox DX spec 2026-11-06 §8: present only when `context.simulation.skipCapture` is set. Stops the camera and
1416
+ * submits the check with `{ simulatedCapture: true }` and no media; the step then moves on as after a capture.
1417
+ * Repeating it while it is on its way reuses the same submission. Rejects with the typed `HostedApiError`.
1418
+ */
1419
+ skipCapture?(): Promise<void>;
1398
1420
  }
1399
1421
  /** The ICAO coaching of a one-capture live photo (`LivenessStepHandle.onLivePhoto`). */
1400
1422
  interface LivePhotoGateUpdate {
@@ -1445,6 +1467,12 @@ interface PortraitStepHandle extends PortraitSnapshot {
1445
1467
  * to the `capture` phase for another photo. Submits `portrait_icao` with `{ fixReview: { accept } }`.
1446
1468
  */
1447
1469
  confirmFix(accept: boolean): Promise<void>;
1470
+ /**
1471
+ * Sandbox DX spec 2026-11-06 §8: present only when `context.simulation.skipCapture` is set. Stops the camera and
1472
+ * submits the check with `{ simulatedCapture: true }` and no media; the step then moves on as after a capture.
1473
+ * Repeating it while it is on its way reuses the same submission. Rejects with the typed `HostedApiError`.
1474
+ */
1475
+ skipCapture?(): Promise<void>;
1448
1476
  }
1449
1477
  /** The biometric step needs a phone (desktop browser). */
1450
1478
  interface MobileRequiredStepHandle extends MobileRequiredSnapshot {
@@ -1452,6 +1480,12 @@ interface MobileRequiredStepHandle extends MobileRequiredSnapshot {
1452
1480
  chooseOption?(option: string): Promise<void>;
1453
1481
  /** Re-read the session (e.g. after the person finished on their phone). */
1454
1482
  refresh(): Promise<void>;
1483
+ /**
1484
+ * Sandbox DX spec 2026-11-06 §8: present only when `context.simulation.skipCapture` is set. Stops the camera and
1485
+ * submits the check with `{ simulatedCapture: true }` and no media; the step then moves on as after a capture.
1486
+ * Repeating it while it is on its way reuses the same submission. Rejects with the typed `HostedApiError`.
1487
+ */
1488
+ skipCapture?(): Promise<void>;
1455
1489
  }
1456
1490
  /** The server is still deciding. */
1457
1491
  interface ProcessingStepHandle extends ProcessingSnapshot {
@@ -1461,7 +1495,10 @@ interface ProcessingStepHandle extends ProcessingSnapshot {
1461
1495
  refresh(): Promise<void>;
1462
1496
  }
1463
1497
  /** A step this SDK cannot run (`platform_unsupported` / `update_required`). */
1464
- type UnsupportedStepHandle = UnsupportedSnapshot;
1498
+ type UnsupportedStepHandle = UnsupportedSnapshot & {
1499
+ /** The chip step of a simulated session (`checkType: "nfc_chip"`); see {@link DocumentStepHandle.skipCapture}. */
1500
+ skipCapture?(): Promise<void>;
1501
+ };
1465
1502
  /** The session's outcome — display only (the SDK never decides it). */
1466
1503
  type ResultStepHandle = ResultSnapshot;
1467
1504
  /** What `on('step')` delivers: the step's data plus its actions. */
@@ -3033,6 +3070,8 @@ interface PortraitCaptureInternals {
3033
3070
  interface PortraitCaptureController {
3034
3071
  handle: PortraitCaptureHandle;
3035
3072
  setFlowState(state: Extract<PortraitCaptureState, "uploading" | "checking" | "done">): void;
3073
+ /** This gate run's mouth scores (staff diagnostics). */
3074
+ gateScores(): IcaoGateScores | null;
3036
3075
  }
3037
3076
  /** The observation of one landmarked frame. `scale` maps analysis px → source px. */
3038
3077
  declare function observe(faces: readonly LandmarkedFace[], frame: GrabbedFrame, sourceWidth: number, sourceHeight: number): IcaoFrameObservation;