@sekyro/web 0.1.0-rc.6 → 0.1.0-rc.7

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 (67) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/LICENSE +3 -3
  3. package/README.md +4 -4
  4. package/dist/chunk-B45J4KC3.js +1 -0
  5. package/dist/chunk-BMA36W2W.js +1 -0
  6. package/dist/chunk-FPXL63KZ.js +1 -0
  7. package/dist/chunk-IYUOYINS.js +1 -0
  8. package/dist/chunk-P7ECRN47.js +1 -0
  9. package/dist/chunk-SXZCL5NO.js +1 -0
  10. package/dist/chunk-YOB4ZTYN.js +1 -0
  11. package/dist/chunk-YQBK6OIM.js +1 -0
  12. package/dist/client/index.cjs +1 -357
  13. package/dist/client/index.d.cts +2 -2
  14. package/dist/client/index.d.ts +2 -2
  15. package/dist/client/index.js +1 -15
  16. package/dist/core/index.cjs +1 -1639
  17. package/dist/core/index.js +1 -139
  18. package/dist/core/v3/detect-worker.cjs +1 -392
  19. package/dist/core/v3/detect-worker.js +1 -13
  20. package/dist/{create-verification-BKc9NFQj.d.cts → create-verification-C2JhOO6Y.d.cts} +94 -16
  21. package/dist/{create-verification-DjcMZHAQ.d.ts → create-verification-CGazwtAh.d.ts} +94 -16
  22. package/dist/detector-scanic-VQFFXKTL.js +1 -0
  23. package/dist/{hosted-client-DJXq_CB9.d.ts → hosted-client-kBeq-mnJ.d.cts} +164 -11
  24. package/dist/{hosted-client-DJXq_CB9.d.cts → hosted-client-kBeq-mnJ.d.ts} +164 -11
  25. package/dist/index.cjs +1 -3030
  26. package/dist/index.d.cts +2 -2
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.js +1 -85
  29. package/dist/internal/index.cjs +1 -4439
  30. package/dist/internal/index.d.cts +10 -7
  31. package/dist/internal/index.d.ts +10 -7
  32. package/dist/internal/index.js +1 -657
  33. package/dist/popup/index.cjs +1 -76
  34. package/dist/popup/index.js +1 -11
  35. package/dist/scanic-ml-stub-KW7IZHUT.js +1 -0
  36. package/package.json +5 -8
  37. package/sbom.cdx.json +195 -0
  38. package/dist/chunk-MWNFSNMP.js +0 -52
  39. package/dist/chunk-MWNFSNMP.js.map +0 -1
  40. package/dist/chunk-NILNKLK6.js +0 -50
  41. package/dist/chunk-NILNKLK6.js.map +0 -1
  42. package/dist/chunk-NWF46H7K.js +0 -359
  43. package/dist/chunk-NWF46H7K.js.map +0 -1
  44. package/dist/chunk-R3SJQHYU.js +0 -1173
  45. package/dist/chunk-R3SJQHYU.js.map +0 -1
  46. package/dist/chunk-TG5IE552.js +0 -1128
  47. package/dist/chunk-TG5IE552.js.map +0 -1
  48. package/dist/chunk-WY6U7AIK.js +0 -193
  49. package/dist/chunk-WY6U7AIK.js.map +0 -1
  50. package/dist/chunk-YVFF4Q4G.js +0 -327
  51. package/dist/chunk-YVFF4Q4G.js.map +0 -1
  52. package/dist/client/index.cjs.map +0 -1
  53. package/dist/client/index.js.map +0 -1
  54. package/dist/core/index.cjs.map +0 -1
  55. package/dist/core/index.js.map +0 -1
  56. package/dist/core/v3/detect-worker.cjs.map +0 -1
  57. package/dist/core/v3/detect-worker.js.map +0 -1
  58. package/dist/detector-scanic-4C6IEW2K.js +0 -787
  59. package/dist/detector-scanic-4C6IEW2K.js.map +0 -1
  60. package/dist/index.cjs.map +0 -1
  61. package/dist/index.js.map +0 -1
  62. package/dist/internal/index.cjs.map +0 -1
  63. package/dist/internal/index.js.map +0 -1
  64. package/dist/popup/index.cjs.map +0 -1
  65. package/dist/popup/index.js.map +0 -1
  66. package/dist/scanic-ml-stub-S2OZ6HEF.js +0 -10
  67. package/dist/scanic-ml-stub-S2OZ6HEF.js.map +0 -1
@@ -1,1128 +0,0 @@
1
- import {
2
- DetectorLadderError,
3
- WorkerDetectorProxy,
4
- createDetector,
5
- intrinsicSize,
6
- workerOffloadSupported
7
- } from "./chunk-NWF46H7K.js";
8
- import {
9
- EXPOSURE_BAND,
10
- exposure,
11
- meanLuma,
12
- sharpness
13
- } from "./chunk-MWNFSNMP.js";
14
-
15
- // src/core/capture-constraints.ts
16
- function buildCaptureConstraints(isMobile, facingMode) {
17
- void isMobile;
18
- return {
19
- video: {
20
- width: { ideal: 1280, max: 1280 },
21
- height: { ideal: 720, max: 720 },
22
- facingMode,
23
- frameRate: { ideal: 24, max: 30 }
24
- },
25
- audio: false
26
- };
27
- }
28
- function detectIsMobile() {
29
- if (typeof window === "undefined" || typeof navigator === "undefined") return false;
30
- return window.innerWidth <= 768 || /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
31
- String(navigator.userAgent ?? "")
32
- );
33
- }
34
- var CIRCLE_RADIUS_FACTOR = 0.45;
35
- var IN_CIRCLE_FACTOR = 0.9;
36
- var CENTERED_FACTOR = 0.4;
37
-
38
- // src/core/media.ts
39
- var MIME_CANDIDATES = [
40
- "video/mp4;codecs=avc1.42E01E,mp4a.40.2",
41
- "video/mp4;codecs=avc1.42E01E",
42
- "video/mp4",
43
- "video/webm;codecs=vp9,opus",
44
- "video/webm;codecs=vp9",
45
- "video/webm;codecs=vp8,opus",
46
- "video/webm;codecs=vp8",
47
- "video/webm"
48
- ];
49
- function pickMimeType() {
50
- const MR = globalThis.MediaRecorder;
51
- if (!MR || typeof MR.isTypeSupported !== "function") return "";
52
- return MIME_CANDIDATES.find((t) => MR.isTypeSupported(t)) ?? "";
53
- }
54
- var DEFAULT_CLIP_MIME = "video/webm";
55
- function mapGetUserMediaError(err) {
56
- if (err instanceof TypeError) return "insecure";
57
- const name = err?.name ?? "";
58
- switch (name) {
59
- case "NotAllowedError":
60
- case "PermissionDeniedError":
61
- return "permission";
62
- case "NotFoundError":
63
- case "DevicesNotFoundError":
64
- return "notfound";
65
- case "NotReadableError":
66
- case "TrackStartError":
67
- return "inuse";
68
- case "OverconstrainedError":
69
- case "ConstraintNotSatisfiedError":
70
- return "overconstrained";
71
- default:
72
- return "generic";
73
- }
74
- }
75
- function cameraPreflight() {
76
- const w = globalThis;
77
- if (typeof w.window !== "undefined" && w.window.isSecureContext === false)
78
- return "INSECURE_CONTEXT";
79
- const md = w.navigator?.mediaDevices;
80
- if (!md || typeof md.getUserMedia !== "function") return "UNSUPPORTED";
81
- return "OK";
82
- }
83
- function isMediaRecorderSupported() {
84
- const MR = globalThis.MediaRecorder;
85
- return typeof MR !== "undefined" && typeof MR.isTypeSupported === "function";
86
- }
87
- var MAX_CLIP_BYTES = 8 * 1024 * 1024;
88
- function isClipTooLarge(blob) {
89
- return blob.size > MAX_CLIP_BYTES;
90
- }
91
- function extForMime(mime) {
92
- const m = (mime || "").toLowerCase();
93
- if (m.startsWith("image/jpeg")) return "jpg";
94
- if (m.startsWith("video/mp4")) return "mp4";
95
- if (m.startsWith("video/webm")) return "webm";
96
- return "webm";
97
- }
98
- function buildLivenessV2FormData(args) {
99
- const { token, clip, keyframe } = args;
100
- const ts = args.ts ?? Date.now();
101
- const clipType = clip.type || DEFAULT_CLIP_MIME;
102
- const kfType = keyframe.type || "image/jpeg";
103
- const fd = new FormData();
104
- fd.append("token", token);
105
- fd.append("clip", new File([clip], `liveness-${ts}.${extForMime(clipType)}`, { type: clipType }));
106
- fd.append("keyframe", new File([keyframe], `keyframe-${ts}.${extForMime(kfType)}`, { type: kfType }));
107
- return fd;
108
- }
109
-
110
- // src/core/clip-recorder.ts
111
- var CLIP_MS = 2500;
112
- var TIMESLICE_MS = 1e3;
113
- var STOP_GRACE_MS = 1500;
114
- var VIDEO_BPS = 25e5;
115
- var ClipError = class extends Error {
116
- constructor(kind, msg) {
117
- super(msg ?? kind);
118
- this.kind = kind;
119
- }
120
- };
121
- var ClipRecorder = class {
122
- constructor() {
123
- this.recorder = null;
124
- this.stream = null;
125
- // own field so teardown can stop tracks (REVIEW FIX 8)
126
- this.chunks = [];
127
- this.bytes = 0;
128
- this.hardStopTimer = null;
129
- this.graceTimer = null;
130
- this.settled = false;
131
- }
132
- clearTimers() {
133
- if (this.hardStopTimer) clearTimeout(this.hardStopTimer);
134
- if (this.graceTimer) clearTimeout(this.graceTimer);
135
- this.hardStopTimer = null;
136
- this.graceTimer = null;
137
- }
138
- /** Records CLIP_MS of the stream. Resolves with the clip blob + its container mime;
139
- * rejects with ClipError. Behavior contract is the v1 hook's `start`, verbatim
140
- * (iOS workarounds included).
141
- *
142
- * ONE RECORDING AT A TIME: chunk/byte/timer state is shared per instance, so a
143
- * second record() while one is in flight rejects ClipError("generic") instead of
144
- * corrupting the in-flight clip. (v2 guard — v1's hook was gated by its owning
145
- * component; a class API invites reuse. Zero impact on clip bytes.)
146
- *
147
- * `onStopped` (optional) fires ONCE the moment the CLIP_MS recording window
148
- * elapses (the hard-stop), BEFORE finalize — which on iOS can lag up to
149
- * STOP_GRACE_MS while onstop flushes the last chunk. It lets the host freeze
150
- * the display on the already-captured keyframe the instant recording ends,
151
- * instead of waiting for the blob. PURE NOTIFICATION — it does not touch
152
- * timers, chunks, or the finalize path, so it is calibration-neutral (no
153
- * effect on clip bytes). Never fires on a rejected capture (error /
154
- * cliptoolarge settle before the hard-stop and clear the timer). */
155
- record(stream, onStopped) {
156
- if (this.recorder && !this.settled) {
157
- return Promise.reject(
158
- new ClipError(
159
- "generic",
160
- "record() called while a recording is in flight \u2014 ClipRecorder handles one recording at a time"
161
- )
162
- );
163
- }
164
- this.recorder = null;
165
- this.clearTimers();
166
- this.chunks = [];
167
- this.bytes = 0;
168
- this.settled = false;
169
- this.stream = stream;
170
- const picked = pickMimeType();
171
- return new Promise((resolve, reject) => {
172
- let recorder;
173
- try {
174
- recorder = new MediaRecorder(
175
- stream,
176
- picked ? { mimeType: picked, videoBitsPerSecond: VIDEO_BPS } : { videoBitsPerSecond: VIDEO_BPS }
177
- );
178
- } catch {
179
- try {
180
- recorder = new MediaRecorder(stream);
181
- } catch {
182
- reject(new ClipError("unsupported"));
183
- return;
184
- }
185
- }
186
- this.recorder = recorder;
187
- const settle = (fn) => {
188
- if (this.settled) return;
189
- this.settled = true;
190
- this.clearTimers();
191
- fn();
192
- };
193
- const finalize = () => settle(() => {
194
- const type = recorder.mimeType || picked || DEFAULT_CLIP_MIME;
195
- const blob = new Blob(this.chunks, { type });
196
- if (isClipTooLarge(blob)) {
197
- reject(new ClipError("cliptoolarge"));
198
- return;
199
- }
200
- resolve({ blob, mimeType: type });
201
- });
202
- recorder.ondataavailable = (e) => {
203
- if (e.data && e.data.size) {
204
- this.chunks.push(e.data);
205
- this.bytes += e.data.size;
206
- if (this.bytes > MAX_CLIP_BYTES) {
207
- settle(() => {
208
- try {
209
- if (recorder.state !== "inactive") recorder.stop();
210
- } catch {
211
- }
212
- reject(new ClipError("cliptoolarge"));
213
- });
214
- }
215
- }
216
- };
217
- recorder.onstop = finalize;
218
- recorder.onerror = () => settle(() => reject(new ClipError("generic")));
219
- try {
220
- recorder.start(TIMESLICE_MS);
221
- } catch {
222
- settle(() => reject(new ClipError("generic")));
223
- return;
224
- }
225
- this.hardStopTimer = setTimeout(() => {
226
- if (!this.settled) onStopped?.();
227
- if (recorder.state !== "inactive") {
228
- try {
229
- recorder.stop();
230
- } catch {
231
- finalize();
232
- }
233
- this.graceTimer = setTimeout(finalize, STOP_GRACE_MS);
234
- } else {
235
- finalize();
236
- }
237
- }, CLIP_MS);
238
- });
239
- }
240
- /** Idempotent teardown: stop recorder + ALL tracks (v1 `stopAndCleanup` + the unmount
241
- * effect). Optional `stream` override mirrors v1's `stopAndCleanup(stream?)`.
242
- *
243
- * MID-RECORDING SEMANTICS (verbatim v1): calling stop() while a record() is in
244
- * flight may LATER resolve the pending promise with a TRUNCATED clip (recorder.stop()
245
- * fires onstop → finalize from whatever chunks arrived so far), or — because this
246
- * method clears the hard-stop/grace timers — never settle it at all if onstop never
247
- * fires (the iOS grace path has been torn down). Callers MUST NOT treat a resolution
248
- * arriving after stop() as a full CLIP_MS clip, and must not await a record()
249
- * promise past stop() without their own timeout. (Task 4's CaptureSession owns
250
- * sequencing on top of this contract.) */
251
- stop(stream) {
252
- this.clearTimers();
253
- const rec = this.recorder;
254
- if (rec && rec.state !== "inactive") {
255
- try {
256
- rec.stop();
257
- } catch {
258
- }
259
- }
260
- this.recorder = null;
261
- const s = stream ?? this.stream;
262
- s?.getTracks().forEach((t) => t.stop());
263
- this.stream = null;
264
- }
265
- };
266
-
267
- // src/core/keyframe.ts
268
- function captureMirroredKeyframe(video, canvas, quality = 0.92) {
269
- return new Promise((resolve, reject) => {
270
- const w = video.videoWidth;
271
- const h = video.videoHeight;
272
- if (!w || !h) {
273
- reject(new Error("video-not-ready"));
274
- return;
275
- }
276
- const ctx = canvas.getContext("2d");
277
- if (!ctx) {
278
- reject(new Error("no-2d-context"));
279
- return;
280
- }
281
- canvas.width = w;
282
- canvas.height = h;
283
- ctx.scale(-1, 1);
284
- ctx.drawImage(video, -w, 0);
285
- canvas.toBlob(
286
- (blob) => blob ? resolve(blob) : reject(new Error("empty-keyframe")),
287
- "image/jpeg",
288
- quality
289
- );
290
- });
291
- }
292
-
293
- // src/core/v3/device-profile.ts
294
- var DEVICE_PROFILES = Object.freeze({
295
- LOW: Object.freeze({ cadenceHz: 5, inputWidth: 128, animations: "reduced" }),
296
- MID: Object.freeze({ cadenceHz: 8, inputWidth: 160, animations: "full" }),
297
- HIGH: Object.freeze({ cadenceHz: 10, inputWidth: 192, animations: "full" })
298
- });
299
- var SIMD_TEST_BYTES = new Uint8Array([
300
- 0,
301
- 97,
302
- 115,
303
- 109,
304
- 1,
305
- 0,
306
- 0,
307
- 0,
308
- 1,
309
- 5,
310
- 1,
311
- 96,
312
- 0,
313
- 1,
314
- 123,
315
- 3,
316
- 2,
317
- 1,
318
- 0,
319
- 10,
320
- 10,
321
- 1,
322
- 8,
323
- 0,
324
- 65,
325
- 0,
326
- 253,
327
- 15,
328
- 253,
329
- 98,
330
- 11
331
- ]);
332
- function probeDevice() {
333
- const nav = typeof navigator === "undefined" ? void 0 : navigator;
334
- let simd = false;
335
- try {
336
- simd = typeof WebAssembly !== "undefined" && WebAssembly.validate(SIMD_TEST_BYTES);
337
- } catch {
338
- simd = false;
339
- }
340
- return {
341
- cores: nav?.hardwareConcurrency ?? 2,
342
- memGB: nav?.deviceMemory ?? null,
343
- simd
344
- };
345
- }
346
- function classifyDevice(probe) {
347
- const memGB = probe.memGB ?? 4;
348
- if (probe.cores < 4 || memGB < 3) return "LOW";
349
- if (probe.cores >= 8 && memGB >= 6) return "HIGH";
350
- return "MID";
351
- }
352
- var ORDER = ["LOW", "MID", "HIGH"];
353
- var DeviceProfiler = class {
354
- constructor(initial) {
355
- this.samples = [];
356
- this.adjusted = false;
357
- this.current = initial;
358
- }
359
- get deviceClass() {
360
- return this.current;
361
- }
362
- get profile() {
363
- return DEVICE_PROFILES[this.current];
364
- }
365
- record(detectMs) {
366
- if (this.adjusted || this.samples.length >= 10) return this.current;
367
- this.samples.push(detectMs);
368
- if (this.samples.length < 10) return this.current;
369
- this.adjusted = true;
370
- const mean = this.samples.reduce((sum, value) => sum + value, 0) / this.samples.length;
371
- if (mean > 70) {
372
- this.current = "LOW";
373
- } else if (mean < 25) {
374
- const index = ORDER.indexOf(this.current);
375
- this.current = ORDER[Math.min(ORDER.length - 1, index + 1)] ?? this.current;
376
- }
377
- return this.current;
378
- }
379
- };
380
-
381
- // src/core/v3/detect-scheduler.ts
382
- var STATS_WINDOW = 20;
383
- var DetectScheduler = class {
384
- constructor(options) {
385
- this.timer = null;
386
- this.frameCallbackId = null;
387
- this.running = false;
388
- this.busy = false;
389
- this.lastRunAt = Number.NEGATIVE_INFINITY;
390
- this.degradeCount = 0;
391
- this.durations = [];
392
- this.options = options;
393
- this.periodMs = 1e3 / options.cadenceHz;
394
- }
395
- start() {
396
- if (this.running) return;
397
- this.running = true;
398
- const video = this.options.video;
399
- if (typeof video?.requestVideoFrameCallback === "function") {
400
- const loop = () => {
401
- if (!this.running) return;
402
- this.frameCallbackId = video.requestVideoFrameCallback?.(() => {
403
- this.frameCallbackId = null;
404
- if (this.now() - this.lastRunAt >= this.periodMs) this.tick();
405
- loop();
406
- });
407
- };
408
- loop();
409
- return;
410
- }
411
- this.timer = setInterval(() => this.tick(), this.periodMs);
412
- }
413
- stop() {
414
- this.running = false;
415
- if (this.timer !== null) {
416
- clearInterval(this.timer);
417
- this.timer = null;
418
- }
419
- if (this.frameCallbackId !== null) {
420
- this.options.video?.cancelVideoFrameCallback?.(
421
- this.frameCallbackId
422
- );
423
- this.frameCallbackId = null;
424
- }
425
- }
426
- stats() {
427
- const meanDetectMs = this.durations.length === 0 ? 0 : this.durations.reduce((sum, value) => sum + value, 0) / this.durations.length;
428
- return { degradeCount: this.degradeCount, meanDetectMs };
429
- }
430
- now() {
431
- return this.options.now?.() ?? performance.now();
432
- }
433
- tick() {
434
- if (!this.running) return;
435
- if (this.busy) {
436
- this.degradeCount += 1;
437
- return;
438
- }
439
- this.busy = true;
440
- this.lastRunAt = this.now();
441
- const startedAt = this.now();
442
- this.options.run().catch(() => void 0).finally(() => {
443
- this.busy = false;
444
- this.durations.push(this.now() - startedAt);
445
- if (this.durations.length > STATS_WINDOW) this.durations.shift();
446
- });
447
- }
448
- };
449
-
450
- // src/core/v3/face-gate-v3.ts
451
- var V3_GATE_DEFAULTS = Object.freeze({
452
- Q_GOOD: 0.6,
453
- RISE_PER_S: 0.9,
454
- FALL_PER_S: 0.25,
455
- CENTER_FALLOFF_IOD_MULTIPLE: 1.35,
456
- BOX_EYE_OFFSET_FACTOR: 0.12,
457
- IOD_BOX_PROXY_FACTOR: 0.42,
458
- SIZE_IDEAL_MIN: 0.12,
459
- SIZE_IDEAL_MAX: 0.3,
460
- SIZE_HARD_MIN: 0.08,
461
- SIZE_HARD_MAX: 0.45,
462
- ROLL_MAX_DEG: 25,
463
- MOTION_VELOCITY_IOD_PER_S: 0.5,
464
- MOTION_TAU_S: 0.4,
465
- MOTION_DEADBAND_IOD_PER_S: 0.1,
466
- READY_WINDOW_MS: 500,
467
- // (READY_MEAN_Q, the former 0.75 window MEAN, is gone — 2026-10-17 field
468
- // bug: a steady q anywhere in [Q_GOOD, 0.75) saturated p at 1, passed every
469
- // guide ("hold still") and could never reach the mean, so the ring sat full
470
- // and green with nothing recording. Readiness now checks the window against
471
- // Q_GOOD, which keeps the one-flaky-tick forgiveness and the second-bad-tick
472
- // block without a dead band above the rise threshold.)
473
- GUIDE_SIZE: 0.6,
474
- GUIDE_CENTERING: 0.6,
475
- GUIDE_POSE: 0.6,
476
- GUIDE_EXPOSURE: 0.6,
477
- GUIDE_SHARPNESS: 0.35,
478
- GUIDE_MOTION: 0.5
479
- });
480
- var clamp01 = (value) => Math.min(1, Math.max(0, value));
481
- var FaceGateV3 = class {
482
- constructor(overrides = {}) {
483
- this.p = 0;
484
- this.lastTickAt = null;
485
- this.lastCenter = null;
486
- this.velocityEma = 0;
487
- this.qWindow = [];
488
- /** Which side of the ideal band the last size measurement fell on. */
489
- this.lastSizeDirection = "ideal";
490
- this.t = { ...V3_GATE_DEFAULTS, ...overrides };
491
- }
492
- reset() {
493
- this.p = 0;
494
- this.lastTickAt = null;
495
- this.lastCenter = null;
496
- this.velocityEma = 0;
497
- this.qWindow = [];
498
- this.lastSizeDirection = "ideal";
499
- }
500
- tick(input) {
501
- const { observation, quality, timestampMs } = input;
502
- const dtSeconds = this.lastTickAt === null ? 0 : Math.max(0, (timestampMs - this.lastTickAt) / 1e3);
503
- this.lastTickAt = timestampMs;
504
- const factors = {
505
- presence: 0,
506
- centering: 0,
507
- size: 0,
508
- pose: 0,
509
- sharpness: clamp01(quality.sharpness),
510
- exposure: clamp01(quality.exposure),
511
- motion: 1
512
- };
513
- if (observation !== null) {
514
- factors.presence = 1;
515
- const geometry = this.geometryOf(observation, input);
516
- factors.centering = geometry.centering;
517
- factors.size = geometry.size;
518
- factors.pose = geometry.pose;
519
- factors.motion = this.motionOf(
520
- geometry.center,
521
- geometry.iod,
522
- timestampMs
523
- );
524
- } else {
525
- this.lastCenter = null;
526
- this.velocityEma = 0;
527
- }
528
- const q = Math.min(
529
- factors.presence,
530
- factors.centering,
531
- factors.size,
532
- factors.pose,
533
- factors.sharpness,
534
- factors.exposure,
535
- factors.motion
536
- );
537
- this.p = clamp01(
538
- this.p + (q >= this.t.Q_GOOD ? this.t.RISE_PER_S * q : -this.t.FALL_PER_S * (1 - q)) * dtSeconds
539
- );
540
- this.qWindow.push({ at: timestampMs, q });
541
- this.qWindow = this.qWindow.filter(
542
- (entry) => entry.at >= timestampMs - this.t.READY_WINDOW_MS
543
- );
544
- let windowSamples = this.qWindow.map((entry) => entry.q);
545
- if (windowSamples.length >= 3) {
546
- const worst = Math.min(...windowSamples);
547
- const worstIndex = windowSamples.indexOf(worst);
548
- windowSamples = windowSamples.filter((_, index) => index !== worstIndex);
549
- }
550
- const ready = this.p >= 1 && windowSamples.every((sample) => sample >= this.t.Q_GOOD);
551
- return {
552
- at: timestampMs,
553
- q,
554
- p: this.p,
555
- factors,
556
- guidanceKey: this.guidanceOf(factors, quality, q),
557
- ready,
558
- accepted: q >= this.t.Q_GOOD
559
- };
560
- }
561
- geometryOf(observation, input) {
562
- const { box, eyes } = observation;
563
- const frameCenter = { x: input.frameWidth / 2, y: input.frameHeight / 2 };
564
- const shortSide = Math.min(input.frameWidth, input.frameHeight);
565
- const center = eyes !== void 0 ? {
566
- x: (eyes.left.x + eyes.right.x) / 2,
567
- y: (eyes.left.y + eyes.right.y) / 2
568
- } : {
569
- x: box.x + box.width / 2,
570
- y: box.y + box.height / 2 - this.t.BOX_EYE_OFFSET_FACTOR * box.height
571
- };
572
- const iod = eyes !== void 0 ? Math.hypot(eyes.right.x - eyes.left.x, eyes.right.y - eyes.left.y) : this.t.IOD_BOX_PROXY_FACTOR * box.width;
573
- const distance = Math.hypot(
574
- center.x - frameCenter.x,
575
- center.y - frameCenter.y
576
- );
577
- const centering = iod <= 0 ? 0 : 1 - clamp01(distance / (this.t.CENTER_FALLOFF_IOD_MULTIPLE * iod));
578
- const ratio = shortSide > 0 ? iod / shortSide : 0;
579
- this.lastSizeDirection = ratio < this.t.SIZE_IDEAL_MIN ? "far" : ratio > this.t.SIZE_IDEAL_MAX ? "close" : "ideal";
580
- let size;
581
- if (ratio < this.t.SIZE_HARD_MIN || ratio > this.t.SIZE_HARD_MAX) {
582
- size = 0;
583
- } else if (ratio < this.t.SIZE_IDEAL_MIN) {
584
- size = (ratio - this.t.SIZE_HARD_MIN) / (this.t.SIZE_IDEAL_MIN - this.t.SIZE_HARD_MIN);
585
- } else if (ratio > this.t.SIZE_IDEAL_MAX) {
586
- size = (this.t.SIZE_HARD_MAX - ratio) / (this.t.SIZE_HARD_MAX - this.t.SIZE_IDEAL_MAX);
587
- } else {
588
- size = 1;
589
- }
590
- let pose = 1;
591
- if (eyes !== void 0) {
592
- const rollDeg = Math.abs(
593
- Math.atan2(eyes.right.y - eyes.left.y, eyes.right.x - eyes.left.x)
594
- ) * 180 / Math.PI;
595
- pose = 1 - clamp01(rollDeg / this.t.ROLL_MAX_DEG);
596
- }
597
- return { center, iod, centering, size, pose };
598
- }
599
- motionOf(center, iod, at) {
600
- const previous = this.lastCenter;
601
- this.lastCenter = { ...center, at };
602
- if (previous === null || iod <= 0) return 1;
603
- const dtSeconds = (at - previous.at) / 1e3;
604
- if (dtSeconds <= 0) return 1;
605
- let velocityIodPerS = Math.hypot(center.x - previous.x, center.y - previous.y) / iod / dtSeconds;
606
- if (velocityIodPerS <= this.t.MOTION_DEADBAND_IOD_PER_S)
607
- velocityIodPerS = 0;
608
- const alpha = 1 - Math.exp(-dtSeconds / this.t.MOTION_TAU_S);
609
- this.velocityEma = alpha * velocityIodPerS + (1 - alpha) * this.velocityEma;
610
- return 1 - clamp01(this.velocityEma / this.t.MOTION_VELOCITY_IOD_PER_S);
611
- }
612
- /** Lowest failing factor speaks — fixed priority (diagnostic, incl. light):
613
- * presence → size → centering → pose → exposure → sharpness → hold.
614
- *
615
- * HONESTY FALLBACK (operator ruling 2026-07-12): when every factor clears
616
- * its guide threshold but q (= min factor) is still below Q_GOOD — i.e.
617
- * progress is DRAINING — "hold still" would be a lie ("Perfect" while
618
- * nothing advances; the field symptom was users discovering by accident
619
- * that only leaning in fires the gate). In that state the WORST factor
620
- * speaks even though it passed its guide level, so the user always hears
621
- * the change that actually unblocks recording. */
622
- guidanceOf(factors, quality, q) {
623
- if (factors.presence <= 0) return "fcv3.no_face";
624
- if (factors.size < this.t.GUIDE_SIZE) return this.sizeGuidance();
625
- if (factors.centering < this.t.GUIDE_CENTERING) return "fcv3.center_face";
626
- if (factors.pose < this.t.GUIDE_POSE) return "fcv3.straighten";
627
- if (factors.exposure < this.t.GUIDE_EXPOSURE)
628
- return this.exposureGuidance(quality);
629
- if (factors.sharpness < this.t.GUIDE_SHARPNESS) return "fcv3.steady_camera";
630
- if (factors.motion < this.t.GUIDE_MOTION) return "fcv3.hold_still";
631
- if (q < this.t.Q_GOOD) {
632
- const coachable = [
633
- ["size", this.sizeGuidance()],
634
- ["centering", "fcv3.center_face"],
635
- ["pose", "fcv3.straighten"],
636
- ["exposure", this.exposureGuidance(quality)],
637
- ["sharpness", "fcv3.steady_camera"],
638
- ["motion", "fcv3.hold_still"]
639
- ];
640
- let worst = coachable[0];
641
- for (const entry of coachable) {
642
- if (factors[entry[0]] < factors[worst[0]]) worst = entry;
643
- }
644
- return worst[1];
645
- }
646
- return "fcv3.hold_still";
647
- }
648
- /** Direction from the size band set THIS tick (never inverted at the hard
649
- * limits: past SIZE_HARD_MAX the direction is 'close' → move_back). */
650
- sizeGuidance() {
651
- return this.lastSizeDirection === "far" ? "fcv3.come_closer" : "fcv3.move_back";
652
- }
653
- /** Band midpoint — direction only (tracks EXPOSURE_BAND automatically). */
654
- exposureGuidance(quality) {
655
- const bandMid = (EXPOSURE_BAND[0] + EXPOSURE_BAND[1]) / 2;
656
- return quality.meanLuma < bandMid ? "fcv3.more_light" : "fcv3.too_bright";
657
- }
658
- };
659
-
660
- // src/core/v3/capture-session-v3.ts
661
- var KEYFRAME_CANDIDATES = 4;
662
- var KEYFRAME_WINDOW_MS = 600;
663
- var NEUTRAL_QUALITY = { sharpness: 1, exposure: 1, meanLuma: 128 };
664
- var CaptureSessionV3 = class {
665
- constructor(options) {
666
- this.handlers = /* @__PURE__ */ new Map();
667
- this.stateValue = "idle";
668
- this.attempt = 0;
669
- this.stream = null;
670
- this.detector = null;
671
- this.scheduler = null;
672
- this.gate = null;
673
- this.profiler = null;
674
- this.lastGuidanceKey = null;
675
- this.positioningStartedAt = 0;
676
- // Face-capture timing marks of the CURRENT attempt (engine clock; reset per run).
677
- this.cameraRequestedAt = null;
678
- this.cameraReadyAt = null;
679
- this.faceAcquiredAt = null;
680
- this.captureCompleteAt = null;
681
- this.fired = false;
682
- this.carriedDegrade = 0;
683
- this.carriedMeans = [];
684
- /** Reused downscale canvas — falls back to the raw video where canvas 2D
685
- * is unavailable (jsdom) so tests and exotic hosts keep detecting. */
686
- this.snapshotCanvas = null;
687
- this.options = options;
688
- this.facing = options.facingMode ?? "user";
689
- }
690
- get state() {
691
- return this.stateValue;
692
- }
693
- on(event, handler) {
694
- let set = this.handlers.get(event);
695
- if (!set) {
696
- set = /* @__PURE__ */ new Set();
697
- this.handlers.set(event, set);
698
- }
699
- set.add(handler);
700
- return () => set?.delete(handler);
701
- }
702
- emit(event, payload) {
703
- for (const handler of [...this.handlers.get(event) ?? []]) {
704
- handler(payload);
705
- }
706
- }
707
- async start(options = {}) {
708
- if (options.facingMode !== void 0) this.facing = options.facingMode;
709
- this.attempt += 1;
710
- await this.run(this.attempt);
711
- }
712
- /** The camera the current/next attempt requests (start option, switchCamera toggles). */
713
- get facingMode() {
714
- return this.facing;
715
- }
716
- /** Full reset + camera restart — the documented recovery path (v1 parity). */
717
- retry() {
718
- this.teardownAttempt();
719
- void this.start();
720
- }
721
- switchCamera() {
722
- this.facing = this.facing === "user" ? "environment" : "user";
723
- this.teardownAttempt();
724
- void this.start();
725
- }
726
- destroy() {
727
- this.attempt += 1;
728
- this.teardownAttempt();
729
- this.detector?.destroy();
730
- this.detector = null;
731
- this.options.video.srcObject = null;
732
- }
733
- // ── attempt lifecycle ──────────────────────────────────────────────────────
734
- async run(attempt) {
735
- const { options } = this;
736
- this.fired = false;
737
- this.lastGuidanceKey = null;
738
- this.carriedDegrade = 0;
739
- this.carriedMeans = [];
740
- this.cameraRequestedAt = null;
741
- this.cameraReadyAt = null;
742
- this.faceAcquiredAt = null;
743
- this.captureCompleteAt = null;
744
- this.setState("preflight");
745
- const preflight = cameraPreflight();
746
- if (preflight !== "OK") {
747
- this.fail(preflight === "INSECURE_CONTEXT" ? "insecure" : "unsupported");
748
- return;
749
- }
750
- this.setState("acquiring");
751
- const getUserMedia = options.getUserMedia ?? ((constraints) => navigator.mediaDevices.getUserMedia(constraints));
752
- let stream;
753
- this.cameraRequestedAt = this.now();
754
- try {
755
- stream = await getUserMedia(buildCaptureConstraints(detectIsMobile(), this.facing));
756
- } catch (err) {
757
- if (attempt !== this.attempt) return;
758
- this.fail(mapGetUserMediaError(err));
759
- return;
760
- }
761
- if (attempt !== this.attempt) {
762
- for (const track of stream.getTracks()) track.stop();
763
- return;
764
- }
765
- this.stream = stream;
766
- options.video.srcObject = stream;
767
- await options.video.play().catch(() => void 0);
768
- if (attempt !== this.attempt) return;
769
- this.cameraReadyAt = this.now();
770
- if (this.detector === null) {
771
- const ladderOptions = {
772
- ...options.v3AssetBaseUrl !== void 0 ? { v3AssetBaseUrl: options.v3AssetBaseUrl } : {}
773
- };
774
- const create = options.createDetector ?? (options.createWorker !== void 0 && workerOffloadSupported() ? async () => {
775
- try {
776
- return await WorkerDetectorProxy.create(
777
- options.createWorker(),
778
- ladderOptions
779
- );
780
- } catch {
781
- return createDetector(ladderOptions);
782
- }
783
- } : () => createDetector(ladderOptions));
784
- let created;
785
- try {
786
- created = await create();
787
- } catch (err) {
788
- if (attempt === this.attempt) {
789
- this.fail(
790
- "models",
791
- err instanceof DetectorLadderError ? err.fallbackReason : describeError(err)
792
- );
793
- }
794
- return;
795
- }
796
- if (attempt !== this.attempt) {
797
- created.destroy();
798
- return;
799
- }
800
- this.detector = created;
801
- this.options.telemetry?.({
802
- type: "detector",
803
- tier: created.tier,
804
- ...created.fallbackReason !== void 0 ? { fallbackReason: created.fallbackReason } : {}
805
- });
806
- }
807
- const probe = probeDevice();
808
- const staticClass = options.deviceClass ?? classifyDevice(probe);
809
- this.profiler = new DeviceProfiler(staticClass);
810
- this.options.telemetry?.({
811
- type: "profile",
812
- staticClass,
813
- activeClass: this.profiler.deviceClass,
814
- simd: probe.simd
815
- });
816
- this.gate = new FaceGateV3(options.thresholds ?? {});
817
- this.setState("positioning");
818
- this.positioningStartedAt = this.now();
819
- this.startScheduler(attempt);
820
- }
821
- /** Chrome hint (Task 11): 'reduced' on LOW even without the media query. */
822
- get animations() {
823
- return this.profiler?.profile.animations ?? "full";
824
- }
825
- startScheduler(attempt) {
826
- const profiler = this.profiler;
827
- if (profiler === null) return;
828
- if (this.scheduler !== null) {
829
- const stats = this.scheduler.stats();
830
- this.carriedDegrade += stats.degradeCount;
831
- if (stats.meanDetectMs > 0) this.carriedMeans.push(stats.meanDetectMs);
832
- this.scheduler.stop();
833
- }
834
- const scheduler = new DetectScheduler({
835
- cadenceHz: profiler.profile.cadenceHz,
836
- video: this.options.video,
837
- ...this.options.now !== void 0 ? { now: this.options.now } : {},
838
- run: () => this.detectTick(attempt)
839
- });
840
- this.scheduler = scheduler;
841
- scheduler.start();
842
- }
843
- async detectTick(attempt) {
844
- const { detector, gate, profiler } = this;
845
- const video = this.options.video;
846
- if (attempt !== this.attempt || detector === null || gate === null || profiler === null)
847
- return;
848
- if (this.fired || video.videoWidth === 0) return;
849
- const before = profiler.deviceClass;
850
- const t0 = this.now();
851
- const source = this.options.makeSnapshot?.(video, profiler.profile.inputWidth) ?? this.defaultSnapshot(video, profiler.profile.inputWidth);
852
- let observation = null;
853
- try {
854
- observation = await detector.detect(source, video.videoWidth, video.videoHeight);
855
- } catch {
856
- observation = null;
857
- }
858
- if (attempt !== this.attempt || this.fired) return;
859
- profiler.record(this.now() - t0);
860
- if (profiler.deviceClass !== before) this.startScheduler(attempt);
861
- const quality = observation === null ? NEUTRAL_QUALITY : this.options.measureQuality?.(video, observation.box) ?? this.defaultQuality(video, observation.box);
862
- const tick = gate.tick({
863
- timestampMs: this.now(),
864
- observation,
865
- quality,
866
- frameWidth: video.videoWidth,
867
- frameHeight: video.videoHeight
868
- });
869
- if (tick.accepted && this.faceAcquiredAt === null) this.faceAcquiredAt = tick.at;
870
- this.emit("checks", {
871
- engine: "v3",
872
- progress: tick.p,
873
- q: tick.q,
874
- factors: tick.factors,
875
- attempt
876
- });
877
- if (tick.guidanceKey !== this.lastGuidanceKey) {
878
- this.lastGuidanceKey = tick.guidanceKey;
879
- this.emit("guidance", { key: tick.guidanceKey });
880
- }
881
- if (tick.ready && this.stateValue === "positioning") {
882
- this.fired = true;
883
- this.captureCompleteAt = tick.at;
884
- void this.fire(attempt);
885
- }
886
- }
887
- async fire(attempt) {
888
- const { options } = this;
889
- const scheduler = this.scheduler;
890
- scheduler?.stop();
891
- const stats = scheduler?.stats() ?? { degradeCount: 0, meanDetectMs: 0 };
892
- const means = [...this.carriedMeans, ...stats.meanDetectMs > 0 ? [stats.meanDetectMs] : []];
893
- options.telemetry?.({
894
- type: "fired",
895
- timeToGateMs: this.now() - this.positioningStartedAt,
896
- degradeCount: this.carriedDegrade + stats.degradeCount,
897
- meanDetectMs: means.length === 0 ? 0 : means.reduce((sum, value) => sum + value, 0) / means.length
898
- });
899
- const mode = options.mode ?? "clip";
900
- const bestOf = this.collectKeyframes(attempt);
901
- if (mode === "photo") {
902
- const best2 = await bestOf;
903
- if (attempt !== this.attempt) return;
904
- if (best2 === null) {
905
- this.fail("generic");
906
- return;
907
- }
908
- this.finishCapture({ keyframe: best2.blob, previewDataUrl: best2.previewDataUrl });
909
- return;
910
- }
911
- this.setState("recording");
912
- const recorder = options.createRecorder?.() ?? new ClipRecorder();
913
- const stream = this.stream;
914
- if (stream === null) {
915
- this.fail("generic");
916
- return;
917
- }
918
- let frozenBest = null;
919
- void bestOf.then(
920
- (candidate) => {
921
- frozenBest = candidate;
922
- },
923
- () => {
924
- }
925
- );
926
- const onRecordingStopped = () => {
927
- if (attempt !== this.attempt) return;
928
- if (frozenBest !== null) {
929
- this.emit("frozen", { previewDataUrl: frozenBest.previewDataUrl });
930
- }
931
- };
932
- let clip;
933
- let best;
934
- try {
935
- [clip, best] = await Promise.all([recorder.record(stream, onRecordingStopped), bestOf]);
936
- } catch (err) {
937
- if (attempt !== this.attempt) return;
938
- const kind = err.kind;
939
- this.fail(kind === "cliptoolarge" ? "cliptoolarge" : "recorder");
940
- return;
941
- }
942
- if (attempt !== this.attempt) return;
943
- if (isClipTooLarge(clip.blob)) {
944
- this.fail("cliptoolarge");
945
- return;
946
- }
947
- if (best === null) {
948
- this.fail("generic");
949
- return;
950
- }
951
- this.finishCapture({
952
- clip: clip.blob,
953
- clipMimeType: clip.mimeType,
954
- keyframe: best.blob,
955
- previewDataUrl: best.previewDataUrl
956
- });
957
- }
958
- /** Up to KEYFRAME_CANDIDATES mirrored frames over KEYFRAME_WINDOW_MS —
959
- * sharpest wins (reuses frame-quality.sharpness via the capture seam). */
960
- async collectKeyframes(attempt) {
961
- const capture = this.options.captureKeyframe ?? ((video) => this.defaultKeyframe(video));
962
- const stepMs = KEYFRAME_WINDOW_MS / (KEYFRAME_CANDIDATES - 1);
963
- let best = null;
964
- for (let i = 0; i < KEYFRAME_CANDIDATES; i += 1) {
965
- if (attempt !== this.attempt) return best;
966
- try {
967
- const candidate = await capture(this.options.video);
968
- if (best === null || candidate.sharpness > best.sharpness) best = candidate;
969
- } catch {
970
- }
971
- if (i < KEYFRAME_CANDIDATES - 1) await delay(stepMs);
972
- }
973
- return best;
974
- }
975
- finishCapture(artifacts) {
976
- this.stopTracks();
977
- this.setState("captured");
978
- const timing = this.captureTiming();
979
- this.emit("artifacts", timing === void 0 ? artifacts : { ...artifacts, timing });
980
- }
981
- /** The attempt's capture-phase timing (whole ms, ≥ 0); undefined when no mark landed. */
982
- captureTiming() {
983
- const span = (from, to) => from !== null && to !== null ? Math.max(0, Math.round(to - from)) : void 0;
984
- const cameraReadyMs = span(this.cameraRequestedAt, this.cameraReadyAt);
985
- const faceAcquireMs = span(this.cameraReadyAt, this.faceAcquiredAt);
986
- const captureMs = span(this.faceAcquiredAt, this.captureCompleteAt);
987
- const timing = {
988
- ...cameraReadyMs !== void 0 ? { cameraReadyMs } : {},
989
- ...faceAcquireMs !== void 0 ? { faceAcquireMs } : {},
990
- ...captureMs !== void 0 ? { captureMs } : {}
991
- };
992
- return Object.keys(timing).length > 0 ? timing : void 0;
993
- }
994
- // ── defaults for the canvas-bound seams ────────────────────────────────────
995
- async defaultKeyframe(video) {
996
- const canvas = document.createElement("canvas");
997
- const blob = await captureMirroredKeyframe(video, canvas);
998
- const previewDataUrl = canvas.toDataURL("image/jpeg", 0.92);
999
- return { blob, previewDataUrl, sharpness: this.centerSharpness(video) };
1000
- }
1001
- defaultSnapshot(video, targetWidth) {
1002
- try {
1003
- const canvas = this.snapshotCanvas ?? document.createElement("canvas");
1004
- const scale = targetWidth / Math.max(1, video.videoWidth);
1005
- const width = Math.max(1, Math.round(video.videoWidth * scale));
1006
- const height = Math.max(1, Math.round(video.videoHeight * scale));
1007
- const ctx = canvas.getContext("2d");
1008
- if (ctx === null) return video;
1009
- if (canvas.width !== width) canvas.width = width;
1010
- if (canvas.height !== height) canvas.height = height;
1011
- ctx.drawImage(video, 0, 0, width, height);
1012
- this.snapshotCanvas = canvas;
1013
- return canvas;
1014
- } catch {
1015
- return video;
1016
- }
1017
- }
1018
- defaultQuality(video, box) {
1019
- const crop = cropImageData(video, box, 96);
1020
- if (crop === null) return NEUTRAL_QUALITY;
1021
- return { sharpness: sharpness(crop), exposure: exposure(crop), meanLuma: meanLuma(crop) };
1022
- }
1023
- centerSharpness(video) {
1024
- const size = intrinsicSize(video);
1025
- const crop = cropImageData(
1026
- video,
1027
- { x: size.width * 0.25, y: size.height * 0.25, width: size.width * 0.5, height: size.height * 0.5 },
1028
- 96
1029
- );
1030
- return crop === null ? 0 : sharpness(crop);
1031
- }
1032
- // ── teardown ──────────────────────────────────────────────────────────────
1033
- teardownAttempt() {
1034
- this.scheduler?.stop();
1035
- this.scheduler = null;
1036
- this.gate = null;
1037
- this.stopTracks();
1038
- }
1039
- stopTracks() {
1040
- if (this.stream === null) return;
1041
- for (const track of this.stream.getTracks()) track.stop();
1042
- this.stream = null;
1043
- }
1044
- fail(kind, fallbackReason) {
1045
- this.scheduler?.stop();
1046
- this.stopTracks();
1047
- this.setState("error");
1048
- this.options.telemetry?.({
1049
- type: "error",
1050
- kind,
1051
- ...fallbackReason !== void 0 ? { fallbackReason } : {}
1052
- });
1053
- this.emit("error", { kind, retryable: kind !== "insecure" && kind !== "unsupported" });
1054
- }
1055
- setState(state) {
1056
- this.stateValue = state;
1057
- this.emit("statechange", { state });
1058
- }
1059
- now() {
1060
- return this.options.now?.() ?? performance.now();
1061
- }
1062
- };
1063
- function delay(ms) {
1064
- return new Promise((resolve) => setTimeout(resolve, ms));
1065
- }
1066
- function describeError(err) {
1067
- return err instanceof Error ? err.message : String(err);
1068
- }
1069
- function cropImageData(video, box, targetWidth) {
1070
- try {
1071
- const canvas = document.createElement("canvas");
1072
- const scale = targetWidth / Math.max(1, box.width);
1073
- canvas.width = Math.max(1, Math.round(box.width * scale));
1074
- canvas.height = Math.max(1, Math.round(box.height * scale));
1075
- const ctx = canvas.getContext("2d");
1076
- if (ctx === null) return null;
1077
- ctx.drawImage(
1078
- video,
1079
- box.x,
1080
- box.y,
1081
- box.width,
1082
- box.height,
1083
- 0,
1084
- 0,
1085
- canvas.width,
1086
- canvas.height
1087
- );
1088
- return ctx.getImageData(0, 0, canvas.width, canvas.height);
1089
- } catch {
1090
- return null;
1091
- }
1092
- }
1093
-
1094
- export {
1095
- buildCaptureConstraints,
1096
- detectIsMobile,
1097
- CIRCLE_RADIUS_FACTOR,
1098
- IN_CIRCLE_FACTOR,
1099
- CENTERED_FACTOR,
1100
- MIME_CANDIDATES,
1101
- pickMimeType,
1102
- DEFAULT_CLIP_MIME,
1103
- mapGetUserMediaError,
1104
- cameraPreflight,
1105
- isMediaRecorderSupported,
1106
- MAX_CLIP_BYTES,
1107
- isClipTooLarge,
1108
- extForMime,
1109
- buildLivenessV2FormData,
1110
- CLIP_MS,
1111
- TIMESLICE_MS,
1112
- STOP_GRACE_MS,
1113
- VIDEO_BPS,
1114
- ClipError,
1115
- ClipRecorder,
1116
- captureMirroredKeyframe,
1117
- DEVICE_PROFILES,
1118
- probeDevice,
1119
- classifyDevice,
1120
- DeviceProfiler,
1121
- DetectScheduler,
1122
- V3_GATE_DEFAULTS,
1123
- FaceGateV3,
1124
- KEYFRAME_CANDIDATES,
1125
- KEYFRAME_WINDOW_MS,
1126
- CaptureSessionV3
1127
- };
1128
- //# sourceMappingURL=chunk-TG5IE552.js.map