@neofaceid/web-sdk 2.1.0 → 2.1.1

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/dist/index.d.ts CHANGED
@@ -1866,7 +1866,7 @@ export declare const validateToken: (applicationToken: string) => Promise<boolea
1866
1866
  * MINOR: Incrementado quando adicionamos funcionalidades mantendo compatibilidade
1867
1867
  * PATCH: Incrementado quando corrigimos bugs mantendo compatibilidade
1868
1868
  */
1869
- export declare const VERSION = "2.1.0";
1869
+ export declare const VERSION = "2.1.1";
1870
1870
 
1871
1871
  /**
1872
1872
  * Executa `fn(sessionId)`. Se o servidor devolver 410 (sessão consumida/expirada),
@@ -8919,7 +8919,7 @@ function BiometricRegistrationModal({
8919
8919
  /* @__PURE__ */ jsx("canvas", { ref: canvasRef })
8920
8920
  ] });
8921
8921
  }
8922
- const VERSION = "2.1.0";
8922
+ const VERSION = "2.1.1";
8923
8923
  const RELEASE_DATE = "2026-09-23";
8924
8924
  const CONSENT_TRAIL_STORAGE_KEY = "neoface_consent_trail_v1";
8925
8925
  const CONSENT_TRAIL_MAX_LIMIT = 100;
@@ -13357,18 +13357,14 @@ function isThumbsUp(keypoints) {
13357
13357
  }
13358
13358
  const POLL_INTERVAL_MS = 150;
13359
13359
  let detectorPromise = null;
13360
+ const MEDIAPIPE_HANDS_VERSION = "0.4.1675469240";
13360
13361
  async function createDetector() {
13361
- const [tf, handPoseDetection] = await Promise.all([
13362
- import("@tensorflow/tfjs-core"),
13363
- import("@tensorflow-models/hand-pose-detection")
13364
- ]);
13365
- await import("@tensorflow/tfjs-backend-webgl");
13366
- await tf.setBackend("webgl");
13367
- await tf.ready();
13362
+ const handPoseDetection = await import("@tensorflow-models/hand-pose-detection");
13368
13363
  return handPoseDetection.createDetector(handPoseDetection.SupportedModels.MediaPipeHands, {
13369
- runtime: "tfjs",
13364
+ runtime: "mediapipe",
13370
13365
  modelType: "lite",
13371
- maxHands: 1
13366
+ maxHands: 1,
13367
+ solutionPath: `https://cdn.jsdelivr.net/npm/@mediapipe/hands@${MEDIAPIPE_HANDS_VERSION}`
13372
13368
  });
13373
13369
  }
13374
13370
  function getDetector() {
@@ -13380,6 +13376,13 @@ function getDetector() {
13380
13376
  const wait = (ms) => new Promise((resolve) => {
13381
13377
  setTimeout(resolve, ms);
13382
13378
  });
13379
+ async function preloadGestureDetector(videoEl) {
13380
+ const detector = await getDetector();
13381
+ try {
13382
+ await detector.estimateHands(videoEl, {});
13383
+ } catch {
13384
+ }
13385
+ }
13383
13386
  async function detectThumbsUp(videoEl, timeoutMs) {
13384
13387
  const detector = await getDetector();
13385
13388
  const deadline = Date.now() + timeoutMs;
@@ -13441,6 +13444,8 @@ const authorizeOperation = async (applicationToken, cpf, options) => {
13441
13444
  resolve();
13442
13445
  };
13443
13446
  });
13447
+ preloadGestureDetector(video).catch(() => {
13448
+ });
13444
13449
  const guideModal = showCameraOvalGuideModal({
13445
13450
  stream,
13446
13451
  faceState: "centered",