idmission-web-sdk 1.0.187 → 1.0.188

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.
@@ -48,7 +48,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
48
48
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
49
49
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
50
50
 
51
- var webSdkVersion = '1.0.187';
51
+ var webSdkVersion = '1.0.188';
52
52
 
53
53
  function getPlatform() {
54
54
  if (typeof window === 'undefined') return;
@@ -8829,6 +8829,11 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
8829
8829
  case 3:
8830
8830
  e_1 = _d.sent();
8831
8831
  console.log('caught an error while predicting!', e_1);
8832
+ if (e_1.message === 'Error: Requested texture size [0x0] is invalid.') {
8833
+ console.log("it's the texture one!");
8834
+ } else {
8835
+ throw e_1;
8836
+ }
8832
8837
  return [3 /*break*/, 4];
8833
8838
  case 4:
8834
8839
  working.current = false;
@@ -8909,7 +8914,7 @@ function makePredictions(frame, thresholds, canvases, logPredictions) {
8909
8914
  case 0:
8910
8915
  _o = getFrameDimensions(frame), frameWidth = _o[0], frameHeight = _o[1];
8911
8916
  drawToCanvas(canvases.lastPredictionCanvas, frame);
8912
- return [4 /*yield*/, makeDocumentDetectionPredictions(frame, logPredictions)];
8917
+ return [4 /*yield*/, makeDocumentDetectionPredictions(canvases.lastPredictionCanvas, logPredictions)];
8913
8918
  case 1:
8914
8919
  _p = _t.sent(), boxes = _p.boxes, scores = _p.scores, labels = _p.labels, time = _p.time;
8915
8920
  allZero = boxes.length > 0 && !boxes.some(function (box) {
@@ -8971,7 +8976,7 @@ function makePredictions(frame, thresholds, canvases, logPredictions) {
8971
8976
  }
8972
8977
  focusPrediction = null, focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
8973
8978
  if (!(detectionThresholdMet && documentInBounds && !documentTooClose)) return [3 /*break*/, 3];
8974
- return [4 /*yield*/, makeFocusPrediction(frame, canvases, bestDocumentOrPassport === null || bestDocumentOrPassport === void 0 ? void 0 : bestDocumentOrPassport.bbox, logPredictions)];
8979
+ return [4 /*yield*/, makeFocusPrediction(canvases.lastPredictionCanvas, canvases, bestDocumentOrPassport === null || bestDocumentOrPassport === void 0 ? void 0 : bestDocumentOrPassport.bbox, logPredictions)];
8975
8980
  case 2:
8976
8981
  _s = _t.sent(), focusPrediction = _s[0], focusPredictionTime = _s[1];
8977
8982
  focusScore = (_j = focusPrediction === null || focusPrediction === void 0 ? void 0 : focusPrediction[1]) !== null && _j !== void 0 ? _j : 0;
@@ -9537,6 +9542,7 @@ function SelfieCaptureFaceDebugBox(_a) {
9537
9542
  scaledHeight = scaling.scaledHeight,
9538
9543
  xOffset = scaling.xOffset,
9539
9544
  yOffset = scaling.yOffset;
9545
+ if (!videoWidth || !videoHeight || !pageWidth || !pageHeight) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
9540
9546
  var top;
9541
9547
  var left;
9542
9548
  var width;
@@ -11804,7 +11810,7 @@ var HighPerformanceSelfieGuidanceModelsProvider = function HighPerformanceSelfie
11804
11810
  return [4 /*yield*/, function renderPrediction() {
11805
11811
  var _a;
11806
11812
  return tslib.__awaiter(this, void 0, void 0, function () {
11807
- var vw, vh, prediction, faces, error_1;
11813
+ var vw, vh, prediction, faces;
11808
11814
  return tslib.__generator(this, function (_b) {
11809
11815
  switch (_b.label) {
11810
11816
  case 0:
@@ -11822,50 +11828,42 @@ var HighPerformanceSelfieGuidanceModelsProvider = function HighPerformanceSelfie
11822
11828
  vw = videoRef.current.videoWidth;
11823
11829
  vh = videoRef.current.videoHeight;
11824
11830
  ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(videoRef.current, 0, 0, vw, vh);
11825
- _b.label = 3;
11826
- case 3:
11827
- _b.trys.push([3, 5,, 6]);
11828
- return [4 /*yield*/, detectorRef.current.detectForVideo(videoRef.current, performance.now())];
11829
- case 4:
11830
- prediction = _b.sent();
11831
- if (prediction) {
11832
- faces = prediction.detections.map(function (d) {
11833
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
11834
- return {
11835
- keypoints: d.keypoints.map(function (k) {
11836
- var _a;
11837
- return tslib.__assign(tslib.__assign({}, k), {
11838
- x: k.x * vw,
11839
- y: k.y * vh,
11840
- name: (_a = k.label) !== null && _a !== void 0 ? _a : ''
11841
- });
11842
- }),
11843
- box: {
11844
- xMin: (_b = (_a = d.boundingBox) === null || _a === void 0 ? void 0 : _a.originX) !== null && _b !== void 0 ? _b : 0,
11845
- xMax: ((_d = (_c = d.boundingBox) === null || _c === void 0 ? void 0 : _c.originX) !== null && _d !== void 0 ? _d : 0) + ((_f = (_e = d.boundingBox) === null || _e === void 0 ? void 0 : _e.width) !== null && _f !== void 0 ? _f : 0),
11846
- yMin: (_h = (_g = d.boundingBox) === null || _g === void 0 ? void 0 : _g.originY) !== null && _h !== void 0 ? _h : 0,
11847
- yMax: ((_k = (_j = d.boundingBox) === null || _j === void 0 ? void 0 : _j.originY) !== null && _k !== void 0 ? _k : 0) + ((_m = (_l = d.boundingBox) === null || _l === void 0 ? void 0 : _l.height) !== null && _m !== void 0 ? _m : 0),
11848
- width: (_p = (_o = d.boundingBox) === null || _o === void 0 ? void 0 : _o.width) !== null && _p !== void 0 ? _p : 0,
11849
- height: (_r = (_q = d.boundingBox) === null || _q === void 0 ? void 0 : _q.height) !== null && _r !== void 0 ? _r : 0
11850
- }
11851
- };
11852
- });
11853
- (_a = onPredictionHandler.current) === null || _a === void 0 ? void 0 : _a.call(onPredictionHandler, faces);
11854
- ctx && drawResults(ctx, faces, true, true);
11831
+ // Detectors can throw errors, for example when using custom URLs that
11832
+ // contain a model that doesn't provide the expected output.
11833
+ try {
11834
+ prediction = detectorRef.current.detectForVideo(videoRef.current, performance.now());
11835
+ if (prediction) {
11836
+ faces = prediction.detections.map(function (d) {
11837
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
11838
+ return {
11839
+ keypoints: d.keypoints.map(function (k) {
11840
+ var _a;
11841
+ return tslib.__assign(tslib.__assign({}, k), {
11842
+ x: k.x * vw,
11843
+ y: k.y * vh,
11844
+ name: (_a = k.label) !== null && _a !== void 0 ? _a : ''
11845
+ });
11846
+ }),
11847
+ box: {
11848
+ xMin: (_b = (_a = d.boundingBox) === null || _a === void 0 ? void 0 : _a.originX) !== null && _b !== void 0 ? _b : 0,
11849
+ xMax: ((_d = (_c = d.boundingBox) === null || _c === void 0 ? void 0 : _c.originX) !== null && _d !== void 0 ? _d : 0) + ((_f = (_e = d.boundingBox) === null || _e === void 0 ? void 0 : _e.width) !== null && _f !== void 0 ? _f : 0),
11850
+ yMin: (_h = (_g = d.boundingBox) === null || _g === void 0 ? void 0 : _g.originY) !== null && _h !== void 0 ? _h : 0,
11851
+ yMax: ((_k = (_j = d.boundingBox) === null || _j === void 0 ? void 0 : _j.originY) !== null && _k !== void 0 ? _k : 0) + ((_m = (_l = d.boundingBox) === null || _l === void 0 ? void 0 : _l.height) !== null && _m !== void 0 ? _m : 0),
11852
+ width: (_p = (_o = d.boundingBox) === null || _o === void 0 ? void 0 : _o.width) !== null && _p !== void 0 ? _p : 0,
11853
+ height: (_r = (_q = d.boundingBox) === null || _q === void 0 ? void 0 : _q.height) !== null && _r !== void 0 ? _r : 0
11854
+ }
11855
+ };
11856
+ });
11857
+ (_a = onPredictionHandler.current) === null || _a === void 0 ? void 0 : _a.call(onPredictionHandler, faces);
11858
+ ctx && drawResults(ctx, faces, true, true);
11859
+ }
11860
+ } catch (error) {
11861
+ console.error('caught face detection error', error);
11862
+ // detector.dispose()
11855
11863
  }
11856
- return [3 /*break*/, 6];
11857
- case 5:
11858
- error_1 = _b.sent();
11859
- console.error('caught face detection error', error_1);
11860
- return [3 /*break*/, 6];
11861
- case 6:
11862
- if (throttleMs) {
11863
- timer = setTimeout(function () {
11864
- rafId.current = requestAnimationFrame(renderPrediction);
11865
- }, throttleMs);
11866
- } else {
11864
+ timer = setTimeout(function () {
11867
11865
  rafId.current = requestAnimationFrame(renderPrediction);
11868
- }
11866
+ }, throttleMs !== null && throttleMs !== void 0 ? throttleMs : 0);
11869
11867
  return [2 /*return*/];
11870
11868
  }
11871
11869
  });
@@ -14025,58 +14023,55 @@ var templateObject_1$7, templateObject_2$6, templateObject_3$5, templateObject_4
14025
14023
 
14026
14024
  var edgeBoundary = 0.05;
14027
14025
  var IdVideoCapture = function IdVideoCapture(_a) {
14028
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
14026
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
14029
14027
  var onComplete = _a.onComplete,
14030
14028
  onIdFrontImageCaptured = _a.onIdFrontImageCaptured,
14031
14029
  onIdBackImageCaptured = _a.onIdBackImageCaptured,
14032
14030
  onFaceNotDetected = _a.onFaceNotDetected,
14033
- _u = _a.idCardFrontDetectionThreshold,
14034
- idCardFrontDetectionThreshold = _u === void 0 ? 0.6 : _u,
14035
- _v = _a.idCardFrontFocusThreshold,
14036
- idCardFrontFocusThreshold = _v === void 0 ? 0 : _v,
14037
- _w = _a.goodIdCardFrontFramesThreshold,
14038
- goodIdCardFrontFramesThreshold = _w === void 0 ? 3 : _w,
14039
- _x = _a.idCardBackDetectionThreshold,
14040
- idCardBackDetectionThreshold = _x === void 0 ? 0.6 : _x,
14041
- _y = _a.idCardBackFocusThreshold,
14042
- idCardBackFocusThreshold = _y === void 0 ? 0 : _y,
14043
- _z = _a.goodIdCardBackFramesThreshold,
14044
- goodIdCardBackFramesThreshold = _z === void 0 ? 3 : _z,
14045
- _0 = _a.skipShowIdCardBack,
14046
- skipShowIdCardBack = _0 === void 0 ? false : _0,
14031
+ _v = _a.idCardFrontDetectionThreshold,
14032
+ idCardFrontDetectionThreshold = _v === void 0 ? 0.6 : _v,
14033
+ _w = _a.idCardFrontFocusThreshold,
14034
+ idCardFrontFocusThreshold = _w === void 0 ? 0 : _w,
14035
+ _x = _a.goodIdCardFrontFramesThreshold,
14036
+ goodIdCardFrontFramesThreshold = _x === void 0 ? 3 : _x,
14037
+ _y = _a.idCardBackDetectionThreshold,
14038
+ idCardBackDetectionThreshold = _y === void 0 ? 0.6 : _y,
14039
+ _z = _a.idCardBackFocusThreshold,
14040
+ idCardBackFocusThreshold = _z === void 0 ? 0 : _z,
14041
+ _0 = _a.goodIdCardBackFramesThreshold,
14042
+ goodIdCardBackFramesThreshold = _0 === void 0 ? 3 : _0,
14043
+ _1 = _a.skipShowIdCardBack,
14044
+ skipShowIdCardBack = _1 === void 0 ? false : _1,
14047
14045
  readTextPrompt = _a.readTextPrompt,
14048
- _1 = _a.readTextTimeoutDurationMs,
14049
- readTextTimeoutDurationMs = _1 === void 0 ? 15000 : _1,
14050
- _2 = _a.assets,
14051
- assets = _2 === void 0 ? {} : _2,
14052
- _3 = _a.classNames,
14053
- classNames = _3 === void 0 ? {} : _3,
14054
- _4 = _a.colors,
14055
- colors = _4 === void 0 ? {} : _4,
14056
- _5 = _a.verbiage,
14057
- rawVerbiage = _5 === void 0 ? {} : _5,
14058
- _6 = _a.debugMode,
14059
- debugMode = _6 === void 0 ? false : _6;
14060
- var _7 = useResizeObserver__default['default'](),
14061
- ref = _7.ref,
14062
- _8 = _7.width,
14063
- width = _8 === void 0 ? 1 : _8,
14064
- _9 = _7.height,
14065
- height = _9 === void 0 ? 1 : _9;
14066
- var _10 = React.useContext(CameraStateContext),
14067
- cameraRef = _10.cameraRef,
14068
- videoRef = _10.videoRef,
14069
- videoLoaded = _10.videoLoaded,
14070
- cameraReady = _10.cameraReady;
14071
- var _11 = React.useState([]),
14072
- detectedObjects = _11[0],
14073
- setDetectedObjects = _11[1];
14046
+ _2 = _a.readTextTimeoutDurationMs,
14047
+ readTextTimeoutDurationMs = _2 === void 0 ? 15000 : _2,
14048
+ _3 = _a.assets,
14049
+ assets = _3 === void 0 ? {} : _3,
14050
+ _4 = _a.classNames,
14051
+ classNames = _4 === void 0 ? {} : _4,
14052
+ _5 = _a.colors,
14053
+ colors = _5 === void 0 ? {} : _5,
14054
+ _6 = _a.verbiage,
14055
+ rawVerbiage = _6 === void 0 ? {} : _6,
14056
+ _7 = _a.debugMode,
14057
+ debugMode = _7 === void 0 ? false : _7;
14058
+ var _8 = useResizeObserver__default['default'](),
14059
+ ref = _8.ref,
14060
+ _9 = _8.width,
14061
+ width = _9 === void 0 ? 1 : _9,
14062
+ _10 = _8.height,
14063
+ height = _10 === void 0 ? 1 : _10;
14064
+ var _11 = React.useContext(CameraStateContext),
14065
+ cameraRef = _11.cameraRef,
14066
+ videoRef = _11.videoRef,
14067
+ videoLoaded = _11.videoLoaded,
14068
+ cameraReady = _11.cameraReady;
14074
14069
  var _12 = React.useState([]),
14075
- faces = _12[0],
14076
- setFaces = _12[1];
14077
- var _13 = React.useState(true),
14078
- faceCentered = _13[0],
14079
- setFaceCentered = _13[1];
14070
+ detectedObjects = _12[0],
14071
+ setDetectedObjects = _12[1];
14072
+ var _13 = React.useState([]),
14073
+ faces = _13[0],
14074
+ setFaces = _13[1];
14080
14075
  var _14 = React.useContext(IdCaptureModelsContext),
14081
14076
  idModelsReady = _14.ready,
14082
14077
  idModelsWorking = _14.working,
@@ -14171,6 +14166,10 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14171
14166
  stopRecording();
14172
14167
  }
14173
14168
  }, [readTextPrompt, stopRecording]);
14169
+ var frameWidth = (_c = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) !== null && _c !== void 0 ? _c : 0;
14170
+ var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
14171
+ var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
14172
+ var faceCentered = faceBox && faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
14174
14173
  var satisfied = goodFramesCount > 0 && faceCentered;
14175
14174
  React.useEffect(function () {
14176
14175
  (function () {
@@ -14225,8 +14224,6 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14225
14224
  stopRecording();
14226
14225
  }, [stopRecording]);
14227
14226
  var timeoutStartedAt = useTimeout(readTextTimeoutDurationMs, onReadTextTimeout, requestedAction !== 'READ_TEXT', false, requestedAction === 'READ_TEXT').timeoutStartedAt;
14228
- var frameWidth = (_c = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) !== null && _c !== void 0 ? _c : 0;
14229
- var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
14230
14227
  var _20 = React.useState(0),
14231
14228
  numFramesWithoutFaces = _20[0],
14232
14229
  setNumFramesWithoutFaces = _20[1];
@@ -14236,14 +14233,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14236
14233
  setNumFramesWithoutFaces(function (n) {
14237
14234
  return faces.length === 0 ? n + 1 : 0;
14238
14235
  });
14239
- if (faces.length > 0) {
14240
- var box = faces[0].box;
14241
- setFaceCentered(box.xMin > frameWidth * edgeBoundary && box.yMin > frameHeight * edgeBoundary && box.xMax < frameWidth * (1 - edgeBoundary) && box.yMax < frameHeight * (1 - edgeBoundary));
14242
- } else {
14243
- setFaceCentered(false);
14244
- }
14245
14236
  });
14246
- }, [frameHeight, frameWidth, onSelfiePredictionMade]);
14237
+ }, [onSelfiePredictionMade]);
14247
14238
  React.useEffect(function () {
14248
14239
  if (numFramesWithoutFaces >= 2) {
14249
14240
  onFaceNotDetected === null || onFaceNotDetected === void 0 ? void 0 : onFaceNotDetected();
@@ -14259,12 +14250,12 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14259
14250
  enabled: debugMode,
14260
14251
  pageWidth: width,
14261
14252
  pageHeight: height,
14262
- videoWidth: (_g = (_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.videoWidth) !== null && _g !== void 0 ? _g : 0,
14263
- videoHeight: (_j = (_h = videoRef.current) === null || _h === void 0 ? void 0 : _h.videoHeight) !== null && _j !== void 0 ? _j : 0
14253
+ videoWidth: (_h = (_g = videoRef.current) === null || _g === void 0 ? void 0 : _g.videoWidth) !== null && _h !== void 0 ? _h : 0,
14254
+ videoHeight: (_k = (_j = videoRef.current) === null || _j === void 0 ? void 0 : _j.videoHeight) !== null && _k !== void 0 ? _k : 0
14264
14255
  });
14265
14256
  return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
14266
14257
  ref: ref,
14267
- className: "flex ".concat((_k = classNames.container) !== null && _k !== void 0 ? _k : '')
14258
+ className: "flex ".concat((_l = classNames.container) !== null && _l !== void 0 ? _l : '')
14268
14259
  }, /*#__PURE__*/React__default['default'].createElement(CameraVideoTag, {
14269
14260
  className: classNames.cameraFeed
14270
14261
  }), /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
@@ -14281,11 +14272,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14281
14272
  verbiage: rawVerbiage.guides,
14282
14273
  requestedAction: requestedAction,
14283
14274
  borderColor: satisfied ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor
14284
- }), !faceCentered && ( /*#__PURE__*/React__default['default'].createElement(GuidanceMessageContainer, null, /*#__PURE__*/React__default['default'].createElement(GuidanceMessage, {
14285
- "$background": (_o = (_m = (_l = theme.guidanceMessages) === null || _l === void 0 ? void 0 : _l.negative) === null || _m === void 0 ? void 0 : _m.backgroundColor) !== null && _o !== void 0 ? _o : 'red',
14286
- "$textColor": (_r = (_q = (_p = theme.guidanceMessages) === null || _p === void 0 ? void 0 : _p.negative) === null || _q === void 0 ? void 0 : _q.textColor) !== null && _r !== void 0 ? _r : 'white'
14287
- }, faceNotCenteredText))), debugMode && ['SHOW_ID_FRONT', 'SHOW_ID_BACK'].includes(requestedAction) && ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugOverlayDiv, {
14288
- "$flipX": !((_s = cameraRef.current) === null || _s === void 0 ? void 0 : _s.isRearFacing)
14275
+ }), debugMode && ['SHOW_ID_FRONT', 'SHOW_ID_BACK'].includes(requestedAction) && ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugOverlayDiv, {
14276
+ "$flipX": !((_m = cameraRef.current) === null || _m === void 0 ? void 0 : _m.isRearFacing)
14289
14277
  }, detectedObjects.map(function (obj, i) {
14290
14278
  var _a;
14291
14279
  return /*#__PURE__*/React__default['default'].createElement(IdCaptureDetectedObjectDebugBox, {
@@ -14296,7 +14284,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14296
14284
  flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
14297
14285
  });
14298
14286
  })), /*#__PURE__*/React__default['default'].createElement(DebugBoundingBoxOverlay, {
14299
- "$flipX": !((_t = cameraRef.current) === null || _t === void 0 ? void 0 : _t.isRearFacing)
14287
+ "$flipX": !((_o = cameraRef.current) === null || _o === void 0 ? void 0 : _o.isRearFacing)
14300
14288
  }, faces.map(function (face, i) {
14301
14289
  var _a;
14302
14290
  return /*#__PURE__*/React__default['default'].createElement(SelfieCaptureFaceDebugBox, {
@@ -14305,7 +14293,10 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14305
14293
  scaling: debugScalingDetails,
14306
14294
  flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
14307
14295
  });
14308
- })))))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), isRecording ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default['default'].createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default['default'].createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Detection Score: ", bestFrameDetectionScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Focus Score: ", bestFrameFocusScore)));
14296
+ })))))), !faceCentered && ( /*#__PURE__*/React__default['default'].createElement(GuidanceMessageContainer, null, /*#__PURE__*/React__default['default'].createElement(GuidanceMessage, {
14297
+ "$background": (_r = (_q = (_p = theme.guidanceMessages) === null || _p === void 0 ? void 0 : _p.negative) === null || _q === void 0 ? void 0 : _q.backgroundColor) !== null && _r !== void 0 ? _r : 'red',
14298
+ "$textColor": (_u = (_t = (_s = theme.guidanceMessages) === null || _s === void 0 ? void 0 : _s.negative) === null || _t === void 0 ? void 0 : _t.textColor) !== null && _u !== void 0 ? _u : 'white'
14299
+ }, faceNotCenteredText))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), isRecording ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default['default'].createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default['default'].createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Detection Score: ", bestFrameDetectionScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Focus Score: ", bestFrameFocusScore)));
14309
14300
  };
14310
14301
 
14311
14302
  var IdVideoCaptureSuccess = function IdVideoCaptureSuccess(_a) {