@sekyro/web 0.1.0-rc.20 → 0.1.0-rc.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -0
- package/README.md +12 -11
- package/dist/camera-trait-V4UAOPIQ.js +1 -0
- package/dist/{capture-constraints-B5omafmk.d.cts → capture-constraints-CVqpMNGA.d.cts} +7 -3
- package/dist/{capture-constraints-B5omafmk.d.ts → capture-constraints-CVqpMNGA.d.ts} +7 -3
- package/dist/{capture-session-doc-QA4DOFRF.js → capture-session-doc-YDUKUN3P.js} +1 -1
- package/dist/{capture-session-v3-CNL-GX11.d.cts → capture-session-v3-CkcuPKSD.d.ts} +90 -13
- package/dist/{capture-session-v3-DaBqN8fO.d.ts → capture-session-v3-TJL-0Muv.d.cts} +90 -13
- package/dist/chunk-2KTSNAVR.js +1 -0
- package/dist/chunk-2LDOXGY3.js +1 -0
- package/dist/chunk-32ELI5BZ.js +1 -0
- package/dist/chunk-33KKMPJ5.js +1 -0
- package/dist/chunk-53POX7U4.js +1 -0
- package/dist/chunk-7QZWBDI5.js +1 -0
- package/dist/chunk-7XT5YDSC.js +1 -0
- package/dist/chunk-BATJN3VQ.js +1 -0
- package/dist/chunk-CPUECYAJ.js +1 -0
- package/dist/chunk-FSSMUAKC.js +1 -0
- package/dist/{chunk-IG466TOP.js → chunk-HYGINGDC.js} +1 -1
- package/dist/chunk-LJYMZQY2.js +1 -0
- package/dist/chunk-PZYVSLPG.js +1 -0
- package/dist/chunk-RALQBQPT.js +1 -0
- package/dist/chunk-SX7TUC3V.js +1 -0
- package/dist/chunk-TJUM65FN.js +1 -0
- package/dist/chunk-TSA6GHUG.js +1 -0
- package/dist/chunk-VWGKUQ3C.js +1 -0
- package/dist/chunk-Z2BIZYZQ.js +1 -0
- package/dist/chunk-Z5D7SZUW.js +1 -0
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +1 -1
- package/dist/clip-inspect-DLJXVKV6.js +1 -0
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +1 -1
- package/dist/core/v3/detect-worker.cjs +1 -1
- package/dist/core/v3/detect-worker.d.cts +1 -1
- package/dist/core/v3/detect-worker.d.ts +1 -1
- package/dist/core/v3/detect-worker.js +1 -1
- package/dist/create-document-capture-K6EHRCWN.js +1 -0
- package/dist/create-portrait-capture-5VGYZUOK.js +1 -0
- package/dist/{create-verification-COpe2hxf.d.ts → create-verification-DnyHCSu6.d.cts} +216 -82
- package/dist/{create-verification-BBOUYpga.d.cts → create-verification-DoISHOqL.d.ts} +216 -82
- package/dist/{detect-worker-DclNxkZT.d.cts → detect-worker-CHqsPJoM.d.cts} +19 -2
- package/dist/{detect-worker-DclNxkZT.d.ts → detect-worker-CHqsPJoM.d.ts} +19 -2
- package/dist/{icao-gate-CEGvJR3q.d.ts → icao-gate-BFlSZYCZ.d.cts} +36 -4
- package/dist/icao-gate-T3BTOKFJ.js +1 -0
- package/dist/{icao-gate-l40OU6x1.d.cts → icao-gate-lZ_fHE7k.d.ts} +36 -4
- package/dist/{icao-policy-BgI1Y870.d.ts → icao-policy-BOcutYdD.d.ts} +3 -3
- package/dist/{icao-policy-C7fIdRzo.d.cts → icao-policy-JZH0UdmD.d.cts} +3 -3
- package/dist/icao-tuning-4ETMF53W.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +11 -15
- package/dist/index.d.ts +11 -15
- package/dist/index.js +1 -1
- package/dist/internal/index.cjs +1 -1
- package/dist/internal/index.d.cts +53 -34
- package/dist/internal/index.d.ts +53 -34
- package/dist/internal/index.js +1 -1
- package/dist/plan-runner-3ZMV7SFQ.js +1 -0
- package/dist/popup/index.cjs +1 -1
- package/dist/popup/index.d.cts +3 -3
- package/dist/popup/index.d.ts +3 -3
- package/dist/popup/index.js +1 -1
- package/dist/{print-AYSCRSZB.js → print-SEWS3VHQ.js} +1 -1
- package/dist/{turnstile-FATNZ4AG.js → turnstile-2J3LUHCG.js} +1 -1
- package/dist/{types-Dpfg2cO8.d.cts → types-DwfyBTte.d.cts} +167 -79
- package/dist/{types-Dpfg2cO8.d.ts → types-DwfyBTte.d.ts} +167 -79
- package/package.json +1 -1
- package/sbom.cdx.json +10 -10
- package/dist/camera-trait-45MJTW4K.js +0 -1
- package/dist/chunk-5ZKQHFFW.js +0 -1
- package/dist/chunk-7ZCZY3ZP.js +0 -1
- package/dist/chunk-BPE5NSQ2.js +0 -1
- package/dist/chunk-CQ7SKLMC.js +0 -1
- package/dist/chunk-FGOVIGGL.js +0 -1
- package/dist/chunk-FUHDOEBP.js +0 -1
- package/dist/chunk-GT2ZLGF7.js +0 -1
- package/dist/chunk-KHR4U2SZ.js +0 -1
- package/dist/chunk-KZBBB5B2.js +0 -1
- package/dist/chunk-NJML6FMD.js +0 -1
- package/dist/chunk-O5WKNZ2C.js +0 -1
- package/dist/chunk-OKWG3PVH.js +0 -1
- package/dist/chunk-TQB3URP2.js +0 -1
- package/dist/chunk-U6S7SCBY.js +0 -1
- package/dist/chunk-U6TYL2IJ.js +0 -1
- package/dist/chunk-W2WD7PR2.js +0 -1
- package/dist/chunk-XCKE2MJL.js +0 -1
- package/dist/chunk-ZLWH4RBO.js +0 -1
- package/dist/create-document-capture-GJXBQMTC.js +0 -1
- package/dist/create-portrait-capture-MOS2D7CL.js +0 -1
- package/dist/icao-gate-PWBMKRGC.js +0 -1
- package/dist/icao-tuning-4GGVX6B4.js +0 -1
- package/dist/plan-runner-35655N4Z.js +0 -1
|
@@ -52,11 +52,12 @@ declare const ICAO_DEVICE_LIMITS: {
|
|
|
52
52
|
readonly eyes: {
|
|
53
53
|
readonly relativeMin: 0.62;
|
|
54
54
|
readonly blinkMax: 0.48;
|
|
55
|
+
readonly lowerEyeMin: 0.32;
|
|
55
56
|
};
|
|
56
57
|
readonly mouth: {
|
|
57
58
|
readonly jawOpenMax: 0.13;
|
|
58
59
|
readonly smileMax: 0.28;
|
|
59
|
-
readonly puckerMax: 0.
|
|
60
|
+
readonly puckerMax: 0.48;
|
|
60
61
|
};
|
|
61
62
|
readonly lighting: {
|
|
62
63
|
readonly faceLuma: readonly [95, 185];
|
|
@@ -84,6 +85,7 @@ declare const ICAO_DEVICE_LIMITS: {
|
|
|
84
85
|
readonly eyes: {
|
|
85
86
|
readonly relativeMin: 0.62;
|
|
86
87
|
readonly blinkMax: 0.48;
|
|
88
|
+
readonly lowerEyeMin: 0.32;
|
|
87
89
|
};
|
|
88
90
|
readonly mouth: {
|
|
89
91
|
readonly jawOpenMax: 0.13;
|
|
@@ -129,6 +131,7 @@ interface IcaoCaptureTuning {
|
|
|
129
131
|
eyes?: {
|
|
130
132
|
relativeMin?: number;
|
|
131
133
|
blinkMax?: number;
|
|
134
|
+
lowerEyeMin?: number;
|
|
132
135
|
earMin?: number;
|
|
133
136
|
};
|
|
134
137
|
mouth?: {
|
|
@@ -189,6 +192,7 @@ interface ResolvedIcaoTuning {
|
|
|
189
192
|
eyes: {
|
|
190
193
|
relativeMin: number;
|
|
191
194
|
blinkMax: number;
|
|
195
|
+
lowerEyeMin: number;
|
|
192
196
|
};
|
|
193
197
|
mouth: {
|
|
194
198
|
jawOpenMax: number;
|
|
@@ -239,19 +243,37 @@ declare const ICAO_FALLBACK: Omit<ResolvedIcaoTuning, "tuningVersion">;
|
|
|
239
243
|
*/
|
|
240
244
|
declare function resolveIcaoTuning(raw: unknown, tuningVersion?: unknown): ResolvedIcaoTuning;
|
|
241
245
|
|
|
242
|
-
/** Session lifecycle status (spec §4 two-field status/outcome model). */
|
|
243
|
-
type SessionStatus = "created" | "in_progress" | "review_pending" | "completed" | "expired" | "failed";
|
|
244
246
|
/**
|
|
245
|
-
*
|
|
246
|
-
* `
|
|
247
|
-
*
|
|
248
|
-
|
|
247
|
+
* Session lifecycle status (session outcome model 2026-11-08): a finished session is
|
|
248
|
+
* `verified` or `not_verified`; a `not_verified` one says why in {@link SessionReason},
|
|
249
|
+
* and every finished one says who or what closed it in {@link ClosedBy}.
|
|
250
|
+
*/
|
|
251
|
+
type SessionStatus = "created" | "in_progress" | "review_pending" | "verified" | "not_verified";
|
|
252
|
+
/**
|
|
253
|
+
* Why a `not_verified` session was not verified (verification-session.schema.ts
|
|
254
|
+
* `SESSION_REASONS`): a verdict against the person (`rejected`), no verdict
|
|
255
|
+
* (`inconclusive`), the check could not run (`unavailable`), the person left before a
|
|
256
|
+
* result (`abandoned`), nobody opened the link (`not_opened`), a flow rule (`policy`),
|
|
257
|
+
* the organization cancelled it (`cancelled`), a newer session took its review over
|
|
258
|
+
* (`superseded`).
|
|
249
259
|
*/
|
|
250
|
-
type
|
|
260
|
+
type SessionReason = "rejected" | "inconclusive" | "unavailable" | "abandoned" | "not_opened" | "policy" | "cancelled" | "superseded";
|
|
261
|
+
/** Who or what closed a finished session (verification-session.schema.ts `CLOSED_BY`). */
|
|
262
|
+
type ClosedBy = "automatic" | "reviewer" | "deadline" | "expiry" | "organization";
|
|
263
|
+
/**
|
|
264
|
+
* What a step's last counted attempt said (verification-session.schema.ts `STEP_RESULTS`);
|
|
265
|
+
* absent before the first counted attempt.
|
|
266
|
+
*/
|
|
267
|
+
type StepResult = "passed" | "rejected" | "inconclusive" | "unreadable" | "unavailable" | "review";
|
|
268
|
+
/** The step that decided a `not_verified` session: its node id and its service. */
|
|
269
|
+
interface SessionDecidingStep {
|
|
270
|
+
id: string;
|
|
271
|
+
service: string;
|
|
272
|
+
}
|
|
251
273
|
/**
|
|
252
274
|
* What a finished session proved (spec 2026-10-29 §3.2): `1` a live, real
|
|
253
275
|
* person, `2` that person's identity, `3` an identity corroborated by an
|
|
254
|
-
* independent source; `0` on a
|
|
276
|
+
* independent source; `0` on a `not_verified` session.
|
|
255
277
|
*/
|
|
256
278
|
type VerificationLevel = 0 | 1 | 2 | 3;
|
|
257
279
|
/** How a session's {@link VerificationLevel} was proved (spec 2026-10-29 §3.4). */
|
|
@@ -265,9 +287,9 @@ type CheckState = "pending" | "input_required" | "processing" | "passed" | "fail
|
|
|
265
287
|
* `eid_auth` (SDK spec §3.2) is the national eID sign-in (Houwiyeti in MR).
|
|
266
288
|
*/
|
|
267
289
|
type CheckType = "liveness" | "face_match" | "doc_ocr" | "population_registry" | "phone_otp" | "nfc_chip" | "email_otp" | "portrait_icao" | "eid_auth";
|
|
268
|
-
type LivenessReason = "no_face" | "media_unreadable" | "clip_too_short" | "spoof_detected" | "review_band" | "liveness_inconclusive" | "device_integrity_failed" | "mobile_required" | "
|
|
269
|
-
type PopulationReason = "registry_record_not_found" | "nni_not_found" | "id_number_invalid" | "nni_invalid" | "registry_unavailable" | "
|
|
270
|
-
type FaceMatchReason = "no_face_source" | "no_face_reference" | "low_quality_reference" | "below_threshold" | "review_band" | "match_inconclusive" | "subject_revoked" | "probe_not_from_liveness" | "prior_review_approved"
|
|
290
|
+
type LivenessReason = "no_face" | "media_unreadable" | "clip_too_short" | "spoof_detected" | "review_band" | "liveness_inconclusive" | "device_integrity_failed" | "mobile_required" | "capture_back_camera" | "capture_not_upright" | "capture_front_camera" | "multiple_faces" | "camera_unavailable";
|
|
291
|
+
type PopulationReason = "registry_record_not_found" | "nni_not_found" | "id_number_invalid" | "nni_invalid" | "registry_unavailable" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "id_number_recheck" | "nni_recheck";
|
|
292
|
+
type FaceMatchReason = "no_face_source" | "no_face_reference" | "low_quality_reference" | "below_threshold" | "review_band" | "match_inconclusive" | "subject_revoked" | "probe_not_from_liveness" | "prior_review_approved";
|
|
271
293
|
type DocReason = "side_missing" | "mrz_checksum_failed" | "unreadable" | "expired_document" | "authenticity_review" | "document_authenticity" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "nationality_unreadable" | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "document_number_mismatch";
|
|
272
294
|
/**
|
|
273
295
|
* Profile v2 step 3 matching reasons: a field the partner sent at session
|
|
@@ -302,7 +324,7 @@ type EmailOtpReason = "otp_mismatch" | "otp_expired" | "otp_send_failed" | "otp_
|
|
|
302
324
|
/**
|
|
303
325
|
* nfc_chip reasons (M-nfc, SDK spec §4.3). Native SDKs read the chip; the web
|
|
304
326
|
* never does — on web the step arrives `skipped` (`platform_unsupported`) or
|
|
305
|
-
* the session shows `
|
|
327
|
+
* the session shows `reasonCode: 'platform_unsupported'`.
|
|
306
328
|
*/
|
|
307
329
|
type NfcChipReason = "chip_read_failed" | "chip_access_denied" | "chip_parse_failed" | "chip_not_present" | "nfc_unavailable" | "chip_document_mismatch" | "chip_integrity_failed" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "platform_unsupported";
|
|
308
330
|
/**
|
|
@@ -339,12 +361,19 @@ type CheckReason = LivenessReason | PopulationReason | FaceMatchReason | DocReas
|
|
|
339
361
|
*/
|
|
340
362
|
| "tester_document_mismatch" | "tester_phone_mismatch"
|
|
341
363
|
/**
|
|
342
|
-
* Review
|
|
343
|
-
*
|
|
344
|
-
* `superseded`) and `review_split` (two reviewers disagreed and nobody
|
|
345
|
-
*
|
|
364
|
+
* Review ends, on any reviewed step: `superseded_by_retry` (a newer attempt of the
|
|
365
|
+
* same person took the review over; the session is `not_verified` with reason
|
|
366
|
+
* `superseded`) and `review_split` (two reviewers disagreed and nobody settled it
|
|
367
|
+
* before the review deadline; the session is `not_verified` with reason `inconclusive`).
|
|
346
368
|
*/
|
|
347
|
-
| "superseded_by_retry" | "review_split"
|
|
369
|
+
| "superseded_by_retry" | "review_split"
|
|
370
|
+
/**
|
|
371
|
+
* Session outcome model §2.4: `review_timeout` (the review deadline passed, written on the
|
|
372
|
+
* reviewed step; the session is `not_verified` with reason `inconclusive`) and
|
|
373
|
+
* `inference_unavailable` (the model service could not run the check; the step's `result`
|
|
374
|
+
* is `unavailable`).
|
|
375
|
+
*/
|
|
376
|
+
| "review_timeout" | "inference_unavailable";
|
|
348
377
|
/**
|
|
349
378
|
* Session-level failure reasons: the session was stopped by a policy gate,
|
|
350
379
|
* not by a failed check. All are terminal (no retry on this session):
|
|
@@ -362,13 +391,6 @@ type CheckReason = LivenessReason | PopulationReason | FaceMatchReason | DocReas
|
|
|
362
391
|
* - `blocked_by_org`: one of the organization's blocks stopped the session.
|
|
363
392
|
*/
|
|
364
393
|
type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown" | "platform_unsupported" | "blocked_by_org" | "starter_credit_claimed";
|
|
365
|
-
/**
|
|
366
|
-
* The profile-v2 policy reasons a session can end on: the two session-level
|
|
367
|
-
* reasons plus the failed check's policy reasons (`document_type_not_accepted`,
|
|
368
|
-
* `nationality_not_allowed`, `underage`, `age_unverifiable`,
|
|
369
|
-
* `document_id_number_mismatch`, formerly `document_nni_mismatch`).
|
|
370
|
-
*/
|
|
371
|
-
type PolicyFailureReason = SessionFailureReason | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "document_id_number_mismatch" | "document_nni_mismatch" | "camera_unavailable" | "underage_estimated";
|
|
372
394
|
/**
|
|
373
395
|
* Why the person has no camera (spec 2026-10-29 §3.4, 2026-10-30): `denied` when the camera permission was refused,
|
|
374
396
|
* `no_camera` when there is no usable camera (none found, an insecure page or a browser that cannot capture).
|
|
@@ -642,7 +664,7 @@ interface HostedEmailOtpView {
|
|
|
642
664
|
* criterion; every one is retryable (re-run only the ICAO gate).
|
|
643
665
|
* `media_unreadable` (no report) is shared with liveness.
|
|
644
666
|
*/
|
|
645
|
-
type PortraitIcaoReason = "icao_pose" | "icao_eyes" | "icao_mouth" | "icao_occlusion" | "icao_lighting" | "icao_background" | "icao_resolution" | "portrait_not_from_liveness" | "
|
|
667
|
+
type PortraitIcaoReason = "icao_pose" | "icao_eyes" | "icao_mouth" | "icao_occlusion" | "icao_lighting" | "icao_background" | "icao_resolution" | "portrait_not_from_liveness" | "portrait_morph_suspected" | "portrait_reference_mismatch" | "portrait_declined_fix" | "portrait_fix_review" | "capture_front_camera";
|
|
646
668
|
/** One ICAO criterion of the server's portrait report (SDK spec §4.9). */
|
|
647
669
|
type IcaoCriterion = "pose" | "eyes" | "mouth" | "occlusion" | "glare" | "lighting" | "background" | "resolution";
|
|
648
670
|
/** The ICAO policy of a session's selfie (spec 2026-10-24 selfie ICAO policy §10). */
|
|
@@ -755,6 +777,8 @@ interface HostedStepView {
|
|
|
755
777
|
state: CheckState;
|
|
756
778
|
/** Frozen-taxonomy reason code explaining a `failed`/`review` state. */
|
|
757
779
|
reason?: CheckReason;
|
|
780
|
+
/** What the last counted attempt said ({@link StepResult}); absent before the first one. */
|
|
781
|
+
result?: StepResult;
|
|
758
782
|
/**
|
|
759
783
|
* Liveness v7 §5.2: what to change for the next capture, on a liveness step parked at
|
|
760
784
|
* `input_required` (the signal that weighed most in the inconclusive score). Absent on older
|
|
@@ -778,11 +802,8 @@ interface HostedStepView {
|
|
|
778
802
|
otp?: HostedOtpView;
|
|
779
803
|
/** email_otp only: the display-safe email send surface (never the handle or the address). */
|
|
780
804
|
emailOtp?: HostedEmailOtpView;
|
|
781
|
-
/**
|
|
782
|
-
|
|
783
|
-
* Absent on older APIs (treat absent as `false`).
|
|
784
|
-
*/
|
|
785
|
-
attemptsExhausted?: boolean;
|
|
805
|
+
/** Counted attempts and the cap (`used >= max`: no try is left). */
|
|
806
|
+
attempts?: PlanAttempts;
|
|
786
807
|
/**
|
|
787
808
|
* population_registry only: the session is not bound to an NNI, but the
|
|
788
809
|
* document step already read a valid one — the page submits the registry
|
|
@@ -810,11 +831,10 @@ interface HostedStepView {
|
|
|
810
831
|
/** phone_otp only (phone rules spec §2.1): numbers from other countries are accepted, through a free international field. */
|
|
811
832
|
phoneInternational?: true;
|
|
812
833
|
/**
|
|
813
|
-
*
|
|
814
|
-
*
|
|
815
|
-
*
|
|
816
|
-
*
|
|
817
|
-
* Absent on older APIs and in `review` mode.
|
|
834
|
+
* Spec 2026-11-06 §3.1: the step's camera runs on a phone only, in every decision mode. Set on `liveness` and
|
|
835
|
+
* `face_match`, and on `doc_ocr` / `portrait_icao` whose photo source is `camera` or `choice` (under `choice` the
|
|
836
|
+
* upload stays on the desktop). A desktop page hands the camera over to a phone instead of opening the webcam; a
|
|
837
|
+
* camera capture from a desktop answers `409 mobile_required`. Absent on `upload` steps and steps without a camera.
|
|
818
838
|
*/
|
|
819
839
|
requiresMobile?: boolean;
|
|
820
840
|
/** nfc_chip only (M-nfc). */
|
|
@@ -845,8 +865,7 @@ type HostedVoiceLocale = "ar" | "fr" | "en";
|
|
|
845
865
|
*
|
|
846
866
|
* `clips[locale]` maps a voice key (`fcv3.*`, the `@sekyro/react` voice-key
|
|
847
867
|
* namespace) to an ABSOLUTE URL on the Sekyro AI assets host
|
|
848
|
-
* (`https://assets.sekyro.ai/voice/<setId>/<locale>/<name>.mp3
|
|
849
|
-
* `assets-staging.sekyro.ai`). URLs are immutable per `setId`. A locale or key
|
|
868
|
+
* (`https://assets.sekyro.ai/voice/<setId>/<locale>/<name>.mp3`). URLs are immutable per `setId`. A locale or key
|
|
850
869
|
* may be missing — the player falls back to the device voice for it.
|
|
851
870
|
*
|
|
852
871
|
* A page with a Content-Security-Policy must allow the assets origin in
|
|
@@ -918,12 +937,18 @@ interface HostedCaptureTuning {
|
|
|
918
937
|
* Who films the face, set in the flow (always present on current backends):
|
|
919
938
|
* - `self` — the person films themselves: front camera only, no camera
|
|
920
939
|
* choice, phone held upright;
|
|
921
|
-
* - `assisted` —
|
|
922
|
-
*
|
|
940
|
+
* - `assisted` — another person films the person: back camera only, phone
|
|
941
|
+
* held upright.
|
|
923
942
|
* `@sekyro/web` enforces it on a capture bound to the session; an absent
|
|
924
943
|
* value falls back to {@link HostedCaptureTuning.cameraSwitch}, then `self`.
|
|
925
944
|
*/
|
|
926
945
|
mode?: CaptureMode;
|
|
946
|
+
/**
|
|
947
|
+
* Spec 2026-11-06 §3.4, under `mode: 'choice'` only: the latest mode a camera attempt of this session ran in
|
|
948
|
+
* (`self` / `assisted`). Open the camera in it (a reloaded page), with the switch still offered. Absent before the
|
|
949
|
+
* first attempt and on older servers.
|
|
950
|
+
*/
|
|
951
|
+
pick?: ResolvedCaptureMode;
|
|
927
952
|
/**
|
|
928
953
|
* @deprecated Mirror of `mode === 'assisted'`, kept for older clients. Read
|
|
929
954
|
* {@link HostedCaptureTuning.mode}.
|
|
@@ -933,8 +958,9 @@ interface HostedCaptureTuning {
|
|
|
933
958
|
/**
|
|
934
959
|
* Who films the face (`HostedSessionView.capture.mode`, a flow setting):
|
|
935
960
|
* `self` (the person, front camera), `assisted` (an agent, back camera) or
|
|
936
|
-
* `choice` (the
|
|
937
|
-
*
|
|
961
|
+
* `choice` (the liveness camera opens in `self` and the person can switch to
|
|
962
|
+
* `assisted` and back on the camera view; each attempt runs in one
|
|
963
|
+
* {@link ResolvedCaptureMode}).
|
|
938
964
|
*/
|
|
939
965
|
type CaptureMode = "self" | "assisted" | "choice";
|
|
940
966
|
/** The mode a camera runs in: the session's {@link CaptureMode}, or the person's pick under `choice`. */
|
|
@@ -959,23 +985,31 @@ interface HostedLivenessCaptureTuning {
|
|
|
959
985
|
*/
|
|
960
986
|
screenRamp?: ScreenRampChallenge;
|
|
961
987
|
}
|
|
988
|
+
/** A screen-ramp palette colour (ramp v2: four saturated colours). */
|
|
989
|
+
type ScreenRampColour = 'magenta' | 'yellow' | 'green' | 'blue';
|
|
990
|
+
/** What the screen-ramp layer shows: a palette colour, `'dark'` (black, the dark-gap arm) or `null` (cleared). */
|
|
991
|
+
type ScreenRampPaint = ScreenRampColour | 'dark' | null;
|
|
962
992
|
/**
|
|
963
|
-
* The
|
|
964
|
-
*
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
*
|
|
969
|
-
* starting at `onsetsMs[i]` on the clip's own timeline (the backend jitters each onset inside its slot). The layer
|
|
970
|
-
* returns to transparent at 2,000 ms. The client renders exactly this and reports what it rendered
|
|
971
|
-
* ({@link ScreenRampReport}); the backend forwards the issued challenge to the model service.
|
|
993
|
+
* The screen-ramp challenge issued per session (ramp v2; liveness v7 §4.4, §4.5 item 1): the client paints the whole
|
|
994
|
+
* screen `colours[i]` from `onsetsMs[i]` on the clip's own timeline for `holdMs` (black for the rest of the slot when
|
|
995
|
+
* that is shorter than the gap to the next onset), clears it at `endMs`, and records at least `clipMs`. The backend
|
|
996
|
+
* issues three distinct colours in 650 ms slots after an 800 to 850 ms settle, and a 3.0 s clip. The
|
|
997
|
+
* client renders exactly this and reports what it rendered ({@link ScreenRampReport}); the backend forwards the issued
|
|
998
|
+
* challenge to the model service, which reads the order of the colours the face took.
|
|
972
999
|
*/
|
|
973
1000
|
interface ScreenRampChallenge {
|
|
974
1001
|
/** Ties the report to the issued challenge (echoed in {@link ScreenRampReport.nonce}). */
|
|
975
1002
|
nonce: string;
|
|
976
|
-
colours
|
|
977
|
-
|
|
978
|
-
|
|
1003
|
+
/** One to eight palette colours (the backend issues five). */
|
|
1004
|
+
colours: ScreenRampColour[];
|
|
1005
|
+
/** Ms on the clip timeline, strictly ascending, one per colour. */
|
|
1006
|
+
onsetsMs: number[];
|
|
1007
|
+
/** How long each colour shows from its onset (ms). */
|
|
1008
|
+
holdMs: number;
|
|
1009
|
+
/** The layer clears here (ms on the clip timeline). */
|
|
1010
|
+
endMs: number;
|
|
1011
|
+
/** The clip records at least this long (ms, at most 8,000). */
|
|
1012
|
+
clipMs: number;
|
|
979
1013
|
/** The palette the colours were drawn from (informational; the client renders `colours`). */
|
|
980
1014
|
palette: ScreenRampColour[];
|
|
981
1015
|
}
|
|
@@ -987,7 +1021,7 @@ interface ScreenRampRendered {
|
|
|
987
1021
|
/** `LivenessCaptureInput.screenRamp`: what the SDK rendered against the issued {@link ScreenRampChallenge}. */
|
|
988
1022
|
interface ScreenRampReport {
|
|
989
1023
|
nonce: string;
|
|
990
|
-
/** In render order, at most
|
|
1024
|
+
/** In render order, one per painted colour (never the dark gap), at most one per issued colour. */
|
|
991
1025
|
rendered: ScreenRampRendered[];
|
|
992
1026
|
}
|
|
993
1027
|
/**
|
|
@@ -1100,7 +1134,19 @@ interface HostedIntegrity {
|
|
|
1100
1134
|
interface HostedSessionView {
|
|
1101
1135
|
sessionId: string;
|
|
1102
1136
|
status: SessionStatus;
|
|
1103
|
-
|
|
1137
|
+
/** `not_verified` only: why ({@link SessionReason}). */
|
|
1138
|
+
reason?: SessionReason;
|
|
1139
|
+
/**
|
|
1140
|
+
* The detailed code behind `reason`, when one exists (`spoof_detected`, `match_inconclusive`,
|
|
1141
|
+
* `device_cooldown`, ...). Also a stop the page shows on a session that stays open:
|
|
1142
|
+
* `platform_unsupported` (a required chip read this client cannot do) and
|
|
1143
|
+
* `starter_credit_claimed` (an owner check of a person who already earned the credit).
|
|
1144
|
+
*/
|
|
1145
|
+
reasonCode?: string;
|
|
1146
|
+
/** Finished sessions: who or what closed it ({@link ClosedBy}). */
|
|
1147
|
+
closedBy?: ClosedBy;
|
|
1148
|
+
/** `not_verified` only: the step that decided it, when one did. */
|
|
1149
|
+
step?: SessionDecidingStep;
|
|
1104
1150
|
/** ISO-8601 timestamp (Date on the server, string on the wire). */
|
|
1105
1151
|
expiresAt: string;
|
|
1106
1152
|
consentRecorded: boolean;
|
|
@@ -1154,13 +1200,6 @@ interface HostedSessionView {
|
|
|
1154
1200
|
* the field — treat absent like `null`.
|
|
1155
1201
|
*/
|
|
1156
1202
|
voice?: HostedVoiceView | null;
|
|
1157
|
-
/**
|
|
1158
|
-
* Why the session ended, when a profile-v2 policy stopped it: a
|
|
1159
|
-
* {@link SessionFailureReason}, or the failed check's reason when it is a
|
|
1160
|
-
* policy reason (eligibility, or `document_nni_mismatch`). Absent otherwise
|
|
1161
|
-
* (and on older APIs).
|
|
1162
|
-
*/
|
|
1163
|
-
failureReason?: PolicyFailureReason;
|
|
1164
1203
|
/**
|
|
1165
1204
|
* The document types the person may pick, resolved for issuer `MR`,
|
|
1166
1205
|
* `carte_identite`/`passport` only (older pickers). Absent on older APIs —
|
|
@@ -1173,9 +1212,15 @@ interface HostedSessionView {
|
|
|
1173
1212
|
*/
|
|
1174
1213
|
acceptedDocuments?: HostedAcceptedDocuments;
|
|
1175
1214
|
/**
|
|
1176
|
-
*
|
|
1177
|
-
*
|
|
1178
|
-
* (and on older
|
|
1215
|
+
* The person's country as detected from the IP address the session started
|
|
1216
|
+
* from (ISO 3166-1 alpha-2). The document country picker lists it first when
|
|
1217
|
+
* the session accepts a document from it. Absent when unknown (and on older
|
|
1218
|
+
* APIs).
|
|
1219
|
+
*/
|
|
1220
|
+
detectedCountry?: string;
|
|
1221
|
+
/**
|
|
1222
|
+
* ISO-8601 time from which this device may verify again, set with
|
|
1223
|
+
* `reasonCode: 'device_cooldown'` (profile v2 step 4). Absent otherwise.
|
|
1179
1224
|
*/
|
|
1180
1225
|
retryAfter?: string;
|
|
1181
1226
|
/**
|
|
@@ -1281,6 +1326,11 @@ interface HostedSessionView {
|
|
|
1281
1326
|
* older APIs. Offer "continue without a camera" only then, or on a `human` session.
|
|
1282
1327
|
*/
|
|
1283
1328
|
cameraUnavailableHandled?: true;
|
|
1329
|
+
/**
|
|
1330
|
+
* Sandbox DX spec 2026-11-06 §8: present only on a simulated session (never Live, never bound to a tester), so the
|
|
1331
|
+
* flow can say that nothing is sent and offer to skip the camera steps. Absent otherwise and on older APIs.
|
|
1332
|
+
*/
|
|
1333
|
+
simulation?: HostedSimulationView;
|
|
1284
1334
|
/**
|
|
1285
1335
|
* 2026-11-05: where the ID document step's photo may come from. Absent when the open document step is camera only
|
|
1286
1336
|
* with no upload offered (and on older APIs): `{ source: "camera", uploadOffered: false }`.
|
|
@@ -1330,8 +1380,10 @@ interface SessionStepView {
|
|
|
1330
1380
|
*/
|
|
1331
1381
|
simulated?: boolean;
|
|
1332
1382
|
calibratedScore?: number;
|
|
1333
|
-
/**
|
|
1334
|
-
|
|
1383
|
+
/** What the last counted attempt said ({@link StepResult}); absent before the first one. */
|
|
1384
|
+
result?: StepResult;
|
|
1385
|
+
/** Counted attempts and the cap. */
|
|
1386
|
+
attempts?: PlanAttempts;
|
|
1335
1387
|
/** portrait_icao only (SDK spec §4.9): the last attempt's per-criterion report. */
|
|
1336
1388
|
report?: IcaoReportEntry[];
|
|
1337
1389
|
}
|
|
@@ -1342,9 +1394,14 @@ interface SessionStepView {
|
|
|
1342
1394
|
interface SessionView {
|
|
1343
1395
|
id: string;
|
|
1344
1396
|
status: SessionStatus;
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1397
|
+
/** `not_verified` only: why ({@link SessionReason}). */
|
|
1398
|
+
reason?: SessionReason;
|
|
1399
|
+
/** `not_verified` only: the detailed code behind `reason`, when one exists. */
|
|
1400
|
+
reasonCode?: string;
|
|
1401
|
+
/** Finished sessions: who or what closed it ({@link ClosedBy}). */
|
|
1402
|
+
closedBy?: ClosedBy;
|
|
1403
|
+
/** `not_verified` only: the step that decided it, when one did. */
|
|
1404
|
+
step?: SessionDecidingStep;
|
|
1348
1405
|
steps: SessionStepView[];
|
|
1349
1406
|
/** ISO-8601 timestamp (Date on the server, string on the wire). */
|
|
1350
1407
|
expiresAt: string;
|
|
@@ -1438,10 +1495,8 @@ interface AttestationInput {
|
|
|
1438
1495
|
interface LivenessInput {
|
|
1439
1496
|
clipKey: string;
|
|
1440
1497
|
attestation?: AttestationInput;
|
|
1441
|
-
/** Declared capture channel
|
|
1442
|
-
*
|
|
1443
|
-
* Client-declared by design (not a security boundary); absent = legacy
|
|
1444
|
-
* clients, treated as mobile server-side during the rollout window. */
|
|
1498
|
+
/** Declared capture channel, reported only (stored with the capture metadata): the server decides a desktop from
|
|
1499
|
+
* the request headers, never from this field. */
|
|
1445
1500
|
captureChannel?: 'mobile' | 'desktop';
|
|
1446
1501
|
/** Capture metadata (engine, dimensions, clip length, face-capture timing)
|
|
1447
1502
|
* — the backend's allowlisted, non-PII `capture` block (session insights). */
|
|
@@ -1462,10 +1517,21 @@ interface LivenessCaptureInput {
|
|
|
1462
1517
|
engine?: 'v1' | 'v3';
|
|
1463
1518
|
width?: number;
|
|
1464
1519
|
height?: number;
|
|
1520
|
+
/** The clip's duration (ms), read from its container when the SDK could. */
|
|
1465
1521
|
clipMs?: number;
|
|
1522
|
+
/** Video frames in the clip. */
|
|
1523
|
+
clipFrames?: number;
|
|
1524
|
+
/** The clip's frame rate (frames over its duration). */
|
|
1525
|
+
fps?: number;
|
|
1526
|
+
/** Silent re-recordings of the clip (0 or 1). */
|
|
1527
|
+
clipRetakes?: number;
|
|
1528
|
+
/** The clip's codec, from the recorder's type. */
|
|
1529
|
+
codec?: string;
|
|
1466
1530
|
cameraReadyMs?: number;
|
|
1467
1531
|
faceAcquireMs?: number;
|
|
1468
1532
|
captureMs?: number;
|
|
1533
|
+
/** Uploads settled → attestation token in hand (the Turnstile challenge on the web), ms. */
|
|
1534
|
+
attestationMs?: number;
|
|
1469
1535
|
/** The camera the clip was filmed with (`environment` = back). */
|
|
1470
1536
|
facingMode?: 'user' | 'environment';
|
|
1471
1537
|
/**
|
|
@@ -1505,6 +1571,21 @@ interface FaceMatchInput {
|
|
|
1505
1571
|
}
|
|
1506
1572
|
/** Document side (docs.types.ts DocSide). */
|
|
1507
1573
|
type DocSide = "recto" | "verso" | "single";
|
|
1574
|
+
/** The hosted view's `simulation` block (Sandbox DX spec 2026-11-06 §8): what a simulated session tells the flow. */
|
|
1575
|
+
interface HostedSimulationView {
|
|
1576
|
+
/** The code that passes the phone, email and national eID code screens: render it, nothing is delivered. */
|
|
1577
|
+
otpCode: string;
|
|
1578
|
+
/** The server takes {@link SimulatedCaptureInput} on the document, chip, liveness and portrait steps. */
|
|
1579
|
+
skipCapture: boolean;
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* The input of a camera step skipped in a simulated session (`doc_ocr`, `nfc_chip`, `liveness`, `face_match`,
|
|
1583
|
+
* `portrait_icao`), with no media. Any other session answers `403 simulated_capture_forbidden`.
|
|
1584
|
+
*/
|
|
1585
|
+
interface SimulatedCaptureInput {
|
|
1586
|
+
/** Always `true`. */
|
|
1587
|
+
simulatedCapture: true;
|
|
1588
|
+
}
|
|
1508
1589
|
/** The hosted view's `documents` block (2026-11-05): where the ID document step's photo may come from. */
|
|
1509
1590
|
interface HostedDocumentsView {
|
|
1510
1591
|
/** The step's setting ({@link PhotoSource}). */
|
|
@@ -1613,8 +1694,8 @@ interface EmailOtpInput {
|
|
|
1613
1694
|
}
|
|
1614
1695
|
/**
|
|
1615
1696
|
* portrait_icao executor input (SDK spec §4.9): the ICAO gate's frame
|
|
1616
|
-
* (uploaded as media kind `image`). The server re-runs every criterion; only
|
|
1617
|
-
*
|
|
1697
|
+
* (uploaded as media kind `image`). The server re-runs every criterion; only the
|
|
1698
|
+
* eye baselines (0–1, the user's own eye openness) are used.
|
|
1618
1699
|
*/
|
|
1619
1700
|
interface PortraitIcaoInput {
|
|
1620
1701
|
media: {
|
|
@@ -1622,6 +1703,9 @@ interface PortraitIcaoInput {
|
|
|
1622
1703
|
};
|
|
1623
1704
|
gate?: {
|
|
1624
1705
|
baselineEyeOpenness?: number;
|
|
1706
|
+
/** The baseline of each eye, both or neither: the server then judges each eye against its own. */
|
|
1707
|
+
baselineEyeOpennessLeft?: number;
|
|
1708
|
+
baselineEyeOpennessRight?: number;
|
|
1625
1709
|
/**
|
|
1626
1710
|
* The device verdict on the submitted still, with the server's criterion names
|
|
1627
1711
|
* (`framing` folds into `resolution`; unmeasured criteria are omitted, and
|
|
@@ -1639,9 +1723,13 @@ interface PortraitIcaoInput {
|
|
|
1639
1723
|
* (presigned as a declared upload, no capture proof). Absent = `camera`.
|
|
1640
1724
|
*/
|
|
1641
1725
|
source?: PhotoSourcePick;
|
|
1642
|
-
/**
|
|
1726
|
+
/**
|
|
1727
|
+
* Camera only: the capture mode the portrait camera ran in (the step's, or the person's pick under `choice`) and the
|
|
1728
|
+
* camera the photo was taken with. An `assisted` photo on the front camera is refused with `capture_front_camera`.
|
|
1729
|
+
*/
|
|
1643
1730
|
capture?: {
|
|
1644
1731
|
mode: ResolvedCaptureMode;
|
|
1732
|
+
facingMode?: 'user' | 'environment';
|
|
1645
1733
|
};
|
|
1646
1734
|
}
|
|
1647
1735
|
/**
|
|
@@ -1696,4 +1784,4 @@ interface SubmitCheckBody {
|
|
|
1696
1784
|
forceOutcome?: "pass" | "fail" | "age_over" | "age_uncertain" | "age_under" | "age_unavailable";
|
|
1697
1785
|
}
|
|
1698
1786
|
|
|
1699
|
-
export { type
|
|
1787
|
+
export { type IdentitySummarySource as $, type AcceptedDocumentType as A, type HostedEidView as B, type CaptureContext as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchInput as F, type HostedEmailOtpView as G, type HostedAcceptedDocuments as H, type HostedFlowRef as I, type HostedIcaoPolicy as J, type HostedIntegrity as K, type HostedLivePhotoTuning as L, type HostedNativeCaptureTuning as M, type HostedOcrTuning as N, type HostedOtpView as O, type HostedPlanView as P, type HostedPortraitPendingFix as Q, type HostedPortraitView as R, type HostedSessionView as S, type HostedSimulationView as T, type HostedStepView as U, type HostedVoiceLocale as V, type HostedVoiceView as W, type IcaoCriterion as X, type IcaoReportEntry as Y, type IdentityConfirmDecision as Z, type IdentityMethod as _, type AttestationInput as a, resolveIcaoTuning as a$, type IdentitySummaryView as a0, type LivenessCaptureInput as a1, type LivenessInput as a2, type LivenessReason as a3, type MatchReason as a4, type MediaKind as a5, type MethodChoiceView as a6, type NationalEidOption as a7, type NfcChipReason as a8, type NfcStepView as a9, type SessionReason as aA, type SessionStatus as aB, type SessionStepView as aC, type SessionView as aD, type SimulatedCaptureInput as aE, type StepResult as aF, type StepSection as aG, type SubmitCheckBody as aH, type VerificationAssurance as aI, type VerificationLevel as aJ, type ScreenRampColour as aK, type AgeEstimationReason as aL, type CameraUnavailableCause as aM, type CaptureIssueReport as aN, type CaptureProvenance as aO, type HostedBranding as aP, type HostedBrandingColorKey as aQ, type HostedLivenessCaptureTuning as aR, type IcaoCaptureTuning as aS, type RetakeHint as aT, type ScreenRampChallenge as aU, type ScreenRampPaint as aV, type ScreenRampRendered as aW, type ScreenRampReport as aX, ICAO_FALLBACK as aY, type IcaoProfile as aZ, type ResolvedIcaoTuning as a_, type OtpChoiceView as aa, type PhoneCountryRule as ab, type PhoneFormat as ac, type PhoneOtpInput as ad, type PhoneOtpReason as ae, type PhotoSource as af, type PhotoSourcePick as ag, type PlanAttempts as ah, type PlanChoiceKind as ai, type PlanChoiceOption as aj, type PlanChoiceView as ak, type PlanSectionView as al, type PlanStepView as am, type PopulationInput as an, type PopulationReason as ao, type PortraitFix as ap, type PortraitFixReviewInput as aq, type PortraitIcaoInput as ar, type PortraitIcaoReason as as, type PortraitOutputFormat as at, type PresignRequest as au, type PresignUploadResult as av, type RecordConsentResult as aw, type ResolvedCaptureMode as ax, type SessionDecidingStep as ay, type SessionFailureReason as az, type CaptureMode as b, type PersonMask as b0, type BackgroundUniformity as b1, type CaptureNoncesResult as c, type CaptureProof as d, type CheckInputByType as e, type CheckReason as f, type CheckState as g, type CheckType as h, type ClosedBy as i, type CompleteMediaResult as j, type ConsentLocale as k, type ContactChannel as l, type DocDeviceRead as m, type DocOcrInput as n, type DocReason as o, type DocSide as p, type EidAuthInput as q, type EidReason as r, type EmailOtpInput as s, type EmailOtpReason as t, type FaceMatchReason as u, type HostedCaptureTuning as v, type HostedConsentView as w, type HostedDocumentCaptureTuning as x, type HostedDocumentScanTuning as y, type HostedDocumentsView as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sekyro/web",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.22",
|
|
4
4
|
"description": "Sekyro AI web SDK \u2014 browser liveness capture, hosted-verification client and popup embed for Sekyro AI identity verification",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
package/sbom.cdx.json
CHANGED
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"type": "application",
|
|
98
98
|
"name": "web",
|
|
99
99
|
"group": "@sekyro",
|
|
100
|
-
"version": "0.1.0-rc.
|
|
101
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
100
|
+
"version": "0.1.0-rc.22",
|
|
101
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.22",
|
|
102
102
|
"description": "Sekyro AI web SDK — browser liveness capture, hosted-verification client and popup embed for Sekyro AI identity verification",
|
|
103
103
|
"licenses": [
|
|
104
104
|
{
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
],
|
|
111
|
-
"purl": "pkg:npm/%40sekyro/web@0.1.0-rc.
|
|
111
|
+
"purl": "pkg:npm/%40sekyro/web@0.1.0-rc.22?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-web",
|
|
112
112
|
"externalReferences": [
|
|
113
113
|
{
|
|
114
114
|
"url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"name": "tasks-vision",
|
|
151
151
|
"group": "@mediapipe",
|
|
152
152
|
"version": "0.10.35",
|
|
153
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
153
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.22|@mediapipe/tasks-vision@0.10.35",
|
|
154
154
|
"licenses": [
|
|
155
155
|
{
|
|
156
156
|
"license": {
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"name": "thumbmarkjs",
|
|
186
186
|
"group": "@thumbmarkjs",
|
|
187
187
|
"version": "1.12.0",
|
|
188
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
188
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.22|@thumbmarkjs/thumbmarkjs@1.12.0",
|
|
189
189
|
"licenses": [
|
|
190
190
|
{
|
|
191
191
|
"license": {
|
|
@@ -218,17 +218,17 @@
|
|
|
218
218
|
],
|
|
219
219
|
"dependencies": [
|
|
220
220
|
{
|
|
221
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
221
|
+
"ref": "@sekyro/web@0.1.0-rc.22",
|
|
222
222
|
"dependsOn": [
|
|
223
|
-
"@sekyro/web@0.1.0-rc.
|
|
224
|
-
"@sekyro/web@0.1.0-rc.
|
|
223
|
+
"@sekyro/web@0.1.0-rc.22|@mediapipe/tasks-vision@0.10.35",
|
|
224
|
+
"@sekyro/web@0.1.0-rc.22|@thumbmarkjs/thumbmarkjs@1.12.0"
|
|
225
225
|
]
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
228
|
+
"ref": "@sekyro/web@0.1.0-rc.22|@mediapipe/tasks-vision@0.10.35"
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
231
|
+
"ref": "@sekyro/web@0.1.0-rc.22|@thumbmarkjs/thumbmarkjs@1.12.0"
|
|
232
232
|
}
|
|
233
233
|
]
|
|
234
234
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-TQB3URP2.js";export{a as bounded,c as cameraHash,b as hex16,d as noteCameraTrait};
|
package/dist/chunk-5ZKQHFFW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as v,d as V,e as A}from"./chunk-NJML6FMD.js";var j=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function we(e){return j.has(e)}function be(e,n,t){let i=n.detail;return{check:e,kind:n.kind,...i?.name!==void 0?{name:i.name}:{},...i?.phase!==void 0?{phase:i.phase}:{},...i?.engineKind!==void 0?{engineKind:i.engineKind}:{},attempt:Math.max(0,Math.min(1e3,t))}}function ke(){let e=-1,n="";return{note(t){t==="starting"&&n!=="starting"&&(e+=1),n=t},newHandle(){n=""},noteError(){e<0&&(e=0)},get value(){return e}}}var H=Object.freeze({nni_invalid:"id_number_invalid",nni_not_found:"registry_record_not_found",nni_recheck:"id_number_recheck",document_nni_mismatch:"document_id_number_mismatch",nni_locked:"id_number_locked",nni_unbound:"id_number_unbound",sandbox_nni_not_seeded:"sandbox_id_number_not_seeded",missing_nni:"missing_id_number",registry_needs_nni_source:"registry_needs_id_number_source"}),I=new Map(Object.entries(H)),$=new Map(Object.entries(H).map(([e,n])=>[n,e]));function ve(e){return I.get(e)??e}function z(e){let n=I.get(e)??$.get(e);return n===void 0?[e]:[e,n]}function T(e){let n=[];for(let t of e)for(let i of z(t))n.includes(i)||n.push(i);return n}var W=new Set(T(["no_face","media_unreadable","clip_too_short","no_face_source","side_missing","unreadable","registry_unavailable","otp_mismatch","otp_expired","otp_send_failed","document_type_not_accepted","age_unverifiable","nationality_unreadable","liveness_inconclusive","match_inconclusive","document_authenticity","probe_not_from_liveness","capture_back_camera","capture_not_upright","chip_read_failed","chip_access_denied","chip_parse_failed","icao_pose","icao_eyes","icao_mouth","icao_occlusion","icao_lighting","icao_background","icao_resolution","portrait_not_from_liveness","nni_recheck","device_integrity_failed","eid_identifier_invalid","eid_code_invalid","eid_code_expired","eid_unavailable","eid_resend_too_soon"])),X={document:"document_photo",nfc:"document_chip",population_registry:"national_number",national_eid:"national_eid"};function p(e){return e.plan?.steps??[]}function O(e){return Math.max(0,e.attempts.max-e.attempts.used)}function G(e){let n=e.plan?.choice;return n!==void 0&&e.plan?.current===n.nodeId?n:null}function Me(e){let n=G(e);if(n?.kind!=="identity_method")return null;let t=n.options.map(o=>X[o.service]).filter(o=>o!==void 0),i=n.options.find(o=>o.nationalEid)?.nationalEid;return i?{available:!0,selected:null,options:t,nationalEid:i}:{available:!0,selected:null,options:t}}var J=new Set(["liveness","face_match"]);function x(e){return e!==void 0&&(e.state==="pending"||e.state==="input_required")}function L(e){return e.status!=="created"&&e.status!=="in_progress"}function E(e){let n=e.plan?.current,t=n==null?void 0:p(e).find(i=>i.id===n);return x(t)?t:void 0}function y(e,n){return p(e).find(t=>t.checkType===n)}function g(e){let n=p(e),t=n.findIndex(i=>i.checkType==="liveness");return n.find((i,o)=>o>t&&i.checkType==="face_match")}function N(e,n){let t=y(n,"liveness")?.state,i=g(n)?.state;return(g(e)?.state??"pending")==="pending"&&(t==="passed"||t==="review")&&i!==void 0&&i!=="pending"&&i!=="skipped"}function M(e,n){let t=new Map(p(e).map(i=>[i.id,i.state]));return p(n).filter(i=>i.checkType==="face_match"&&(t.get(i.id)??"pending")==="pending"&&i.state!=="pending"&&i.state!=="skipped").map(i=>i.id)}var Q=/^[0-9a-f]{24}$/i;function b(e){return Q.test(e)?`ses_${e}`:e}function w(e,n){let t=b(e);return n===void 0?{sessionId:t,status:"unavailable"}:{sessionId:t,status:"unavailable",reason:n}}function _(e,n,t){let i=b(e);return t===void 0?{sessionId:i,status:n}:{sessionId:i,status:n,reason:t}}function Pe(e,n){let{sessionId:t}=e;switch(e.status){case"completed":case"failed":case"review_pending":return ee(e,ne(e));case"expired":return w(t);case"created":case"in_progress":break;default:{let i=e.status;throw new Error(`mapSessionResult: unhandled status ${i}`)}}return ie(e,n)}var Z=new Set([0,1,2,3]);function ee(e,n){return Z.has(e.level)&&(n.level=e.level),typeof e.assurance=="string"&&e.assurance.length>0&&(n.assurance=e.assurance),n}function ne(e){let n=b(e.sessionId);switch(e.status){case"completed":return e.outcome==="approved"?{sessionId:n,status:"approved"}:e.outcome==="review"?_(n,"review",h(e,"review")):_(n,"rejected",h(e,"failed"));case"failed":{let t=_(n,"rejected",e.failureReason??h(e,"failed"));return e.failureReason==="device_cooldown"&&e.retryAfter!==void 0&&(t.retryAfter=e.retryAfter),t}default:return _(n,"review",h(e,"review"))}}function te(e,n){if(n===void 0)return!1;let t=p(n).find(i=>i.id===e.id);return t!==void 0&&t.attempts.used===e.attempts.used}function ie(e,n){let t=b(e.sessionId),i=p(e).find(s=>J.has(s.checkType)&&s.state==="input_required"&&s.reason!==void 0);if(i?.reason==="mobile_required")return w(t,"mobile_required");if(i?.reason!==void 0){let s=n.autoRetry&&O(i)>0&&(W.has(i.reason)||te(i,n.previous)),d={sessionId:t,status:s?"retry":"rejected",reason:i.reason,attemptsRemaining:O(i)};return i.retakeHint!==void 0&&(d.retakeHint=i.retakeHint),d}let o=E(e);return o===void 0&&p(e).some(s=>s.state==="review")?_(t,"review",h(e,"review")):o?.checkType==="portrait_icao"?w(t,"portrait_required"):w(t)}function h(e,n){let t=p(e).filter(i=>i.state===n&&i.reason!==void 0);return t[n==="failed"?t.length-1:0]?.reason}function K(e,n,t,i,o){return e.presignCapture!==void 0?e.presignCapture(n,t,i,o):e.presign(n,t,i)}function q(e){return{engine:e?.engine,durationMs:e?.clipMs}}var oe=["video/webm","video/mp4"],F="image/jpeg",se=2,re=1e3,ae=1e4,de=3,ue=10,ce=3,le=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),pe=new Set(["session_not_active","check_not_found","check_already_finalized","check_out_of_order","identity_confirm_required","check_not_active","step_not_on_path"]),S=class extends Error{constructor(){super("verification destroyed"),this.name="FlowCancelledError"}};function fe(e){let n=g(e);return y(e,"portrait_icao")?.state!=="pending"&&(n!==void 0?x(n):e.capture?.livePhoto?.oneCapture===!0)}var R=class extends Error{constructor(n){super(n),this.name="AttestationError"}};async function D(e,n,t={}){let i=e.uuid(),o=!1,s=!1,d=0,u=0;for(;;)try{return await n(e.client,i)}catch(r){if(r instanceof R){if(s)throw r;s=!0,t.onAttestationInvalid?.(),i=e.uuid();continue}if(!(r instanceof v))throw r;if(r.code==="consent_required"&&!o){o=!0,await e.ensureConsent({force:!0}),i=e.uuid();continue}if(r.code==="attestation_invalid"&&!s){s=!0,t.onAttestationInvalid?.(),i=e.uuid();continue}if(r.code==="inference_unavailable"&&u<de){u+=1;let a=V(r.retryAfterSeconds,ue,e.random??Math.random);e.onBusy?.({attempt:u,retryAfterSeconds:a/1e3}),await e.sleep(a),t.onAttestationInvalid?.(),i=e.uuid();continue}if(le.has(r.code)&&d<se){d+=1;let a=r.retryAfterSeconds!==void 0?r.retryAfterSeconds*1e3:void 0;await e.sleep(a!==void 0?Math.min(a,ae):re);continue}throw r}}var me=new Set(["passed","review","processing","skipped"]);async function Oe(e){let{artifacts:n}=e,t=n.clip,i=A(n.clipMime??"");if(n.degraded==="NO_RECORDER"||t===void 0||!oe.includes(i))return{kind:"unavailable",reason:"no_recorder"};e.client.armCapture?.(2);let o=_e(e,n.keyframe),s=he(e,t,i,o),d=ge(e,o),u=!1,r=new Set,a=!0,m=0;for(;;){if(e.isCancelled())return{kind:"cancelled"};let l=e.getView();if(L(l))return{kind:"settled"};let k=E(l),P=k?.checkType,C=P==="liveness"&&!u?"liveness":P==="face_match"&&!r.has(k?.id)&&r.size<2&&a?"face_match":null;if(C===null)return{kind:"settled"};if(C==="liveness"&&n.captureChannel==="desktop"&&y(l,"liveness")?.requiresMobile===!0)return{kind:"unavailable",reason:"mobile_required"};try{if(C==="liveness"){u=!0;let c=await s();if(e.isCancelled())return{kind:"cancelled"};N(l,c)&&r.add(g(c)?.id);for(let B of M(l,c))r.add(B);await e.applySubmit(c,"liveness");let f=y(e.getView(),"liveness")?.state;a=f===void 0||me.has(f)}else{r.add(k?.id);let c=await d();if(e.isCancelled())return{kind:"cancelled"};for(let f of M(l,c))r.add(f);await e.applySubmit(c,"face_match")}}catch(c){if(e.isCancelled()||c instanceof S)return{kind:"cancelled"};let f=Re(c);if(f.kind!=="resync"||m>=ce)return f;m+=1,await e.refreshView()}}}function _e(e,n){let t=null,i=null,o=()=>t!==null?Promise.resolve(t):(i??(i=(async()=>{let s=await K(e.client,"image",F,n.size,q(e.artifacts));return await e.client.uploadToSpaces(s.uploadUrl,n,F),t=(await e.client.completeMedia(s.key)).key,e.onKeyframePromoted?.(t),t})().finally(()=>{i=null})),i);return{ensure:o,attempt:()=>o().catch(()=>null),current:()=>t}}function he(e,n,t,i){let o=null,s,d=null;return()=>D(e,async(u,r)=>{if(o===null||s===void 0){if(e.isCancelled())throw new S;s===void 0&&!fe(e.getView())&&(s=null),e.onPhase("uploading");let[a,m]=await Promise.all([o!==null?Promise.resolve(o):(async()=>{let l=await K(u,"clip",t,n.size,q(e.artifacts));return await u.uploadToSpaces(l.uploadUrl,n,t),(await u.completeMedia(l.key)).key})(),s!==void 0?Promise.resolve(s===null?null:s.imageKey):i.attempt()]);o=a,s===void 0&&(s=m===null?null:{imageKey:m})}if(d===null)try{d=await e.getAttestation()}catch(a){throw new R(a instanceof Error?a.message:String(a))}return e.onPhase("checking"),u.submitCheck("liveness",{clipKey:o,attestation:d,captureChannel:e.artifacts.captureChannel,capture:ye(e.artifacts),...s!==null?{faceMatch:s}:{}},{idempotencyKey:r})},{onAttestationInvalid:()=>{d=null}})}function ge(e,n){return()=>D(e,async(t,i)=>{if(n.current()===null){if(e.isCancelled())throw new S;e.onPhase("uploading")}let o=await n.ensure();return e.onPhase("checking"),t.submitCheck("face_match",{imageKey:o},{idempotencyKey:i})})}function ye(e){let n={width:e.width,height:e.height};for(let t of Se)e[t]!==void 0&&(n[t]=e[t]);return n}var Se=["engine","facingMode","mode","formFactor","clipMs","cameraReadyMs","faceAcquireMs","captureMs","screenRamp","provenance"];function Re(e){if(e instanceof R)return{kind:"unavailable",reason:"attestation"};if(e instanceof v){if(e.code==="attestation_invalid")return{kind:"unavailable",reason:"attestation"};if(e.code==="inference_unavailable")return{kind:"unavailable",reason:"inference_unavailable"};if(e.code==="mobile_required")return{kind:"unavailable",reason:"mobile_required"};if(pe.has(e.code))return{kind:"resync"}}return{kind:"unavailable",reason:"network"}}var U=class extends Error{constructor(n,t){super(`invalid ${n} (${t})`),this.name="InvalidInputError",this.field=n,this.kind=t}},Y=class extends Error{constructor(n,t){super(`invalid ${n} (${t})`),this.name="OtpInputError",this.field=n,this.kind=t}};function Fe(e){let n=e?.capture,t=n?.mode;return t==="assisted"||t==="self"||t==="choice"?t:n?.cameraSwitch===!0?"assisted":"self"}function Ke(e,n){return e==="choice"?n??"self":e}export{we as a,be as b,ke as c,Fe as d,Ke as e,ve as f,W as g,X as h,p as i,O as j,G as k,Me as l,x as m,L as n,E as o,y as p,b as q,w as r,Pe as s,K as t,oe as u,se as v,re as w,de as x,ue as y,R as z,D as A,Oe as B,U as C,Y as D};
|
package/dist/chunk-7ZCZY3ZP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var w=[468,473],K=[[33,133],[362,263]],V=[[33,7,163,144,145,153,154,155,133,173,157,158,159,160,161,246],[362,382,381,380,374,373,390,249,263,466,388,387,386,385,384,398]],D=1;function S(e){let n=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let r of e)r.x<n&&(n=r.x),r.y<o&&(o=r.y),r.x>t&&(t=r.x),r.y>s&&(s=r.y);return e.length===0?{x:0,y:0,width:0,height:0}:{x:n,y:o,width:t-n,height:s-o}}var _=(e,n)=>({x:(e.x+n.x)/2,y:(e.y+n.y)/2});function $(e,n,o){if(e.length<468)return null;let t=l=>{let i=e[l];return{x:i.x*n,y:i.y*o}},s=[0,1].map(l=>{let i=e.length>w[1]?t(w[l]):null,[c,p]=K[l];return i??_(t(c),t(p))}),r=V.map(l=>S(l.map(t))),h=[];for(let l=0;l<Math.min(e.length,468);l+=1)h.push(t(l));let[d,m]=s,u=d.x>m.x,b=u?m:d,f=u?d:m;return{leftEye:b,rightEye:f,iod:Math.hypot(f.x-b.x,f.y-b.y),box:S(h),nose:t(D),leftEyeBox:u?r[1]:r[0],rightEyeBox:u?r[0]:r[1]}}var R=180/Math.PI;function F(e,n="column"){if(e.length<16||e.some(l=>!Number.isFinite(l)))return null;let o=(l,i)=>n==="column"?e[i*4+l]:e[l*4+i],t=Math.hypot(o(0,0),o(1,0),o(2,0))||1,s=o(0,0)/t,r=o(1,0)/t,h=o(2,0)/t,d=o(2,1)/t,m=o(2,2)/t,u=Math.asin(Math.max(-1,Math.min(1,-h)))*R,b=Math.atan2(d,m)*R,f=Math.atan2(r,s)*R;return{yaw:u,pitch:b,roll:f}}function B(e){return Math.atan2(e.rightEye.y-e.leftEye.y,e.rightEye.x-e.leftEye.x)*R}var E={width:480,height:640,eyeX:240,eyeY:289,iodMin:120,iodMax:160};function G(e){let n=E,o=e.iod>=n.iodMin&&e.iod<=n.iodMax?1:n.iodMin/Math.max(e.iod,1e-6),t=n.width/o,s=n.height/o,r=_(e.leftEye,e.rightEye);return{x:r.x-n.eyeX/n.width*t,y:r.y-n.eyeY/n.height*s,width:t,height:s}}function N(e,n,o){let t=Math.max(0,-e.x),s=Math.max(0,-e.y),r=Math.max(0,e.x+e.width-n),h=Math.max(0,e.y+e.height-o);return Math.max((t+r)/e.width,(s+h)/e.height)}function ee(e,n,o,t){let s=G(e),r=s.x+s.width/2,h=s.y+s.height/2,d=E.width/E.height,m=Math.max(s.height*t.margin,t.minHeight,t.minWidth/d);m=Math.min(m,o,n/d);let u=m*d,b=Math.min(Math.max(r-u/2,0),Math.max(0,n-u)),f=Math.min(Math.max(h-m/2,0),Math.max(0,o-m));return{x:Math.round(b),y:Math.round(f),width:Math.round(u),height:Math.round(m)}}var v=["face","framing","pose","eyes","mouth","glare","lighting","background","resolution","sharpness"],H=new Set(["glare","background"]),x=e=>({pass:!0,value:e,coach:null}),y=(e,n)=>({pass:!1,value:e,coach:n}),I=(e,n)=>({pass:e,value:null,coach:e?null:n,none:!0});function X(e,n){let o=e.pose,t;if(o!==null){let c=o.pitch-n.pitchOffsetDeg,p=Math.max(Math.abs(o.yaw),Math.abs(c),Math.abs(o.roll));t=Math.abs(o.yaw)<=n.yawDeg&&Math.abs(c)<=n.pitchDeg&&Math.abs(o.roll)<=n.rollDeg?x(p):y(p,"pose")}else t={...I(!1,"pose"),value:e.eyeLineRoll??null};let s=I(!1,"eyes");if(e.eyes!==null){let c=e.baseline,p=Math.min(e.eyes.left,e.eyes.right),M=Math.max(1-n.eyes.blinkMax,c!==null&&c>0&&c<=1?n.eyes.relativeMin*c:0),g=c!==null&&c>0?p/c:null;s=p>=M-1e-9?x(g):y(g,"eyes")}let r=I(!1,"mouth");if(e.mouth!==null){let{jawOpen:c,smile:p,pucker:M}=e.mouth,g=Math.max(c/n.mouth.jawOpenMax,p/n.mouth.smileMax,M/n.mouth.puckerMax);r=c<=n.mouth.jawOpenMax&&p<=n.mouth.smileMax&&M<=n.mouth.puckerMax?x(g):y(g,"mouth")}let h=e.lighting,d=I(!0,"lighting");if(h!==null){let[c,p]=n.lighting.faceLuma,[M,g]=n.lighting.halfRatio;d=h.faceLuma<c||h.faceLuma>p||h.clipped>n.lighting.clippedMax?y(h.faceLuma,"lighting"):h.halfRatio<M||h.halfRatio>g?y(h.halfRatio,"lighting_side"):x(h.faceLuma)}let m=e.uniformity,u=e.background,b=n.background.required?m!=null&&n.backgroundCheck.enabled?m.uniform?x(m.colorStd):y(m.colorStd,"background"):u===null?I(!0,"background"):u.luma>=n.background.lumaMin&&u.sd<=n.background.lumaSdMax?x(u.luma):y(u.luma,"background"):I(!0,"background"),f=n.resolution,l=Math.min(e.frameWidth,e.frameHeight)>=f.minWidth&&Math.max(e.frameWidth,e.frameHeight)>=f.minHeight,i=e.iod>=f.minIodPx&&l?x(e.iod):y(e.iod,"resolution");return{pose:t,eyes:s,mouth:r,lighting:d,background:b,resolution:i}}function L(e){let n=e?.eyeBlinkLeft,o=e?.eyeBlinkRight;return typeof n!="number"||typeof o!="number"?null:{left:1-n,right:1-o,blinkLeft:n,blinkRight:o}}function q(e,n){if(e.length===0)return null;let o=[...e].sort((s,r)=>s-r),t=Math.min(o.length-1,Math.max(0,Math.ceil(n*o.length)-1));return o[t]}function T(e,n,o){let t={},s=e.geometry;if(e.faces!==1||s===null){let c=e.faces>1?y(e.faces,"multiple_faces"):y(e.faces,"no_face");for(let p of v)t[p]=p==="face"?c:I(!1,"no_face");return{results:t,pose:null}}t.face=x(1);let r=G(s),h=N(r,e.frameWidth,e.frameHeight);t.framing=r.height>e.frameHeight*1.02||r.width>e.frameWidth*1.02?y(h,"too_close"):h>.02?y(h,"center"):x(h);let d=e.matrix!=null?F(e.matrix):null,m=L(e.blendshapes),u=e.blendshapes,b=e.stats??null,f=X({pose:d,eyeLineRoll:Math.abs(B(s)),eyes:m,baseline:o,mouth:u==null?null:{jawOpen:u.jawOpen??0,smile:Math.max(u.mouthSmileLeft??0,u.mouthSmileRight??0),pucker:u.mouthPucker??0},lighting:b?.lighting??null,background:b?.background??null,uniformity:e.backgroundCheck??null,iod:s.iod,frameWidth:e.frameWidth,frameHeight:e.frameHeight},n);Object.assign(t,f);let l=b?.eyeSpecular??null;t.glare=l===null?I(!0,"glare"):l<=n.glare.specularMax?x(l):y(l,"glare");let i=b?.sharpness??null;return t.sharpness=i===null||i>=n.sharpnessMin?x(i):y(i,"hold_still"),{results:t,pose:d}}var J={pose:"pose",eyes:"eyes",mouth:"mouth",glare:"glare",lighting:"lighting",background:"background",framing:"resolution",resolution:"resolution"};function oe(e,n={}){let o=n.policy==="alert",t=new Map,s=0,r=null,h=null,d={},m=[],u=null,b=null,f=l=>{if(m=m.filter(c=>l-c.at<=e.baseline.windowMs),m.length<e.baseline.minSamples)return null;let i=q(m.map(c=>c.open),e.baseline.percentile);return i===null||i<=0?null:Math.min(1,i)};return{push(l,i){let c=T(l,e,null),p=L(l.blendshapes);p!==null&&c.results.face.pass&&c.results.pose.pass&&m.push({at:i,open:(p.left+p.right)/2});let M=f(i),{results:g,pose:A}=T(l,e,M);for(let a of v)g[a].pass&&(a!=="eyes"||M!==null)?t.has(a)||t.set(a,i):t.delete(a);let P=a=>{let C=t.get(a);return C!==void 0&&i-C>=e.holdMs};v.filter(a=>!H.has(a)).every(P)?r??(r=i):r=null;let W=a=>a==="background"&&l.backgroundCheck!=null?e.backgroundCheck.timeoutMs:e.softGraceMs,U=a=>H.has(a)&&!g[a].pass&&r!==null&&i-r>=W(a),k=v.map(a=>({criterion:a,pass:g[a].pass,held:P(a),waived:U(a),value:g[a].value,coach:g[a].pass?null:g[a].coach}));s=k.every(a=>a.pass||a.waived)?s+1:0;let O=k.find(a=>!a.pass&&!a.waived)??null,j=k.filter(a=>a.held||a.waived).length;g.face.pass&&g.framing.pass?h??(h=i):h=null;let Y=k.every(a=>a.held||a.waived)&&s>=e.holdFrames||o&&h!==null&&i-h>=e.alertGraceMs;d={};for(let a of v){let C=J[a];C!==void 0&&g[a].none!==!0&&(d[C]=(d[C]??!0)&&g[a].pass)}return b=l.backgroundCheck??null,u={criteria:k,coach:O?.coach??"hold",failing:O?.criterion??null,progress:j/k.length,ready:Y,baseline:M,pose:A},u},last:()=>u,summary(){let l={criteria:{}};if(u===null)return l;l.verdict={...d},u.baseline!==null&&Math.round(u.baseline*1e3)>0&&(l.baselineEyeOpenness=Math.round(u.baseline*1e3)/1e3);for(let i of u.criteria){let c=i.value===null||!Number.isFinite(i.value)?null:Math.round(i.value*1e3)/1e3;l.criteria[i.criterion]=i.waived?{pass:i.pass,value:c,waived:!0}:{pass:i.pass,value:c}}if(b!==null&&e.background.required){let{pixels:i,...c}=b;l.backgroundCheck=c}return l},reset(){t.clear(),s=0,r=null,h=null,d={},u=null,b=null}}}export{$ as a,F as b,B as c,E as d,G as e,N as f,ee as g,v as h,X as i,L as j,q as k,T as l,oe as m};
|