idmission-web-sdk 1.0.187 → 1.0.189

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.189';
52
52
 
53
53
  function getPlatform() {
54
54
  if (typeof window === 'undefined') return;
@@ -8796,9 +8796,9 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
8796
8796
  (function () {
8797
8797
  return tslib.__awaiter(void 0, void 0, void 0, function () {
8798
8798
  var canvases, prediction, e_1;
8799
- var _a, _b, _c;
8800
- return tslib.__generator(this, function (_d) {
8801
- switch (_d.label) {
8799
+ var _a, _b, _c, _d;
8800
+ return tslib.__generator(this, function (_e) {
8801
+ switch (_e.label) {
8802
8802
  case 0:
8803
8803
  if (!documentDetectionModel || !focusModel || !lastPredictionCanvas.current || !cropCanvas.current || !rotateCanvas.current) return [2 /*return*/];
8804
8804
  canvases = {
@@ -8806,12 +8806,12 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
8806
8806
  cropCanvas: cropCanvas.current,
8807
8807
  rotateCanvas: rotateCanvas.current
8808
8808
  };
8809
- _d.label = 1;
8809
+ _e.label = 1;
8810
8810
  case 1:
8811
- _d.trys.push([1, 3,, 4]);
8811
+ _e.trys.push([1, 3,, 4]);
8812
8812
  return [4 /*yield*/, makePredictions(frame, thresholds, canvases, logPredictions)];
8813
8813
  case 2:
8814
- prediction = _d.sent();
8814
+ prediction = _e.sent();
8815
8815
  setDetectionTime(prediction.detectionTime);
8816
8816
  setFocusPredictionTime(prediction.focusPredictionTime);
8817
8817
  if (bestFocusScore.current <= prediction.focusScore) {
@@ -8827,8 +8827,15 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
8827
8827
  (_c = onPredictionHandler.current) === null || _c === void 0 ? void 0 : _c.call(onPredictionHandler, prediction);
8828
8828
  return [3 /*break*/, 4];
8829
8829
  case 3:
8830
- e_1 = _d.sent();
8830
+ e_1 = _e.sent();
8831
8831
  console.log('caught an error while predicting!', e_1);
8832
+ if ((_d = e_1.message) === null || _d === void 0 ? void 0 : _d.includes('Requested texture size [0x0] is invalid.')) {
8833
+ console.log("it's the texture one!");
8834
+ } else if (e_1.message === 'CanvasRenderingContext2D.drawImage: Passed-in canvas is empty') {
8835
+ console.log("it's the empty canvas one!");
8836
+ } else {
8837
+ throw e_1;
8838
+ }
8832
8839
  return [3 /*break*/, 4];
8833
8840
  case 4:
8834
8841
  working.current = false;
@@ -8909,7 +8916,7 @@ function makePredictions(frame, thresholds, canvases, logPredictions) {
8909
8916
  case 0:
8910
8917
  _o = getFrameDimensions(frame), frameWidth = _o[0], frameHeight = _o[1];
8911
8918
  drawToCanvas(canvases.lastPredictionCanvas, frame);
8912
- return [4 /*yield*/, makeDocumentDetectionPredictions(frame, logPredictions)];
8919
+ return [4 /*yield*/, makeDocumentDetectionPredictions(canvases.lastPredictionCanvas, logPredictions)];
8913
8920
  case 1:
8914
8921
  _p = _t.sent(), boxes = _p.boxes, scores = _p.scores, labels = _p.labels, time = _p.time;
8915
8922
  allZero = boxes.length > 0 && !boxes.some(function (box) {
@@ -8971,7 +8978,7 @@ function makePredictions(frame, thresholds, canvases, logPredictions) {
8971
8978
  }
8972
8979
  focusPrediction = null, focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
8973
8980
  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)];
8981
+ return [4 /*yield*/, makeFocusPrediction(canvases.lastPredictionCanvas, canvases, bestDocumentOrPassport === null || bestDocumentOrPassport === void 0 ? void 0 : bestDocumentOrPassport.bbox, logPredictions)];
8975
8982
  case 2:
8976
8983
  _s = _t.sent(), focusPrediction = _s[0], focusPredictionTime = _s[1];
8977
8984
  focusScore = (_j = focusPrediction === null || focusPrediction === void 0 ? void 0 : focusPrediction[1]) !== null && _j !== void 0 ? _j : 0;
@@ -9537,6 +9544,7 @@ function SelfieCaptureFaceDebugBox(_a) {
9537
9544
  scaledHeight = scaling.scaledHeight,
9538
9545
  xOffset = scaling.xOffset,
9539
9546
  yOffset = scaling.yOffset;
9547
+ if (!videoWidth || !videoHeight || !pageWidth || !pageHeight) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
9540
9548
  var top;
9541
9549
  var left;
9542
9550
  var width;
@@ -11804,7 +11812,7 @@ var HighPerformanceSelfieGuidanceModelsProvider = function HighPerformanceSelfie
11804
11812
  return [4 /*yield*/, function renderPrediction() {
11805
11813
  var _a;
11806
11814
  return tslib.__awaiter(this, void 0, void 0, function () {
11807
- var vw, vh, prediction, faces, error_1;
11815
+ var vw, vh, prediction, faces;
11808
11816
  return tslib.__generator(this, function (_b) {
11809
11817
  switch (_b.label) {
11810
11818
  case 0:
@@ -11822,50 +11830,42 @@ var HighPerformanceSelfieGuidanceModelsProvider = function HighPerformanceSelfie
11822
11830
  vw = videoRef.current.videoWidth;
11823
11831
  vh = videoRef.current.videoHeight;
11824
11832
  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);
11833
+ // Detectors can throw errors, for example when using custom URLs that
11834
+ // contain a model that doesn't provide the expected output.
11835
+ try {
11836
+ prediction = detectorRef.current.detectForVideo(videoRef.current, performance.now());
11837
+ if (prediction) {
11838
+ faces = prediction.detections.map(function (d) {
11839
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
11840
+ return {
11841
+ keypoints: d.keypoints.map(function (k) {
11842
+ var _a;
11843
+ return tslib.__assign(tslib.__assign({}, k), {
11844
+ x: k.x * vw,
11845
+ y: k.y * vh,
11846
+ name: (_a = k.label) !== null && _a !== void 0 ? _a : ''
11847
+ });
11848
+ }),
11849
+ box: {
11850
+ xMin: (_b = (_a = d.boundingBox) === null || _a === void 0 ? void 0 : _a.originX) !== null && _b !== void 0 ? _b : 0,
11851
+ 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),
11852
+ yMin: (_h = (_g = d.boundingBox) === null || _g === void 0 ? void 0 : _g.originY) !== null && _h !== void 0 ? _h : 0,
11853
+ 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),
11854
+ width: (_p = (_o = d.boundingBox) === null || _o === void 0 ? void 0 : _o.width) !== null && _p !== void 0 ? _p : 0,
11855
+ height: (_r = (_q = d.boundingBox) === null || _q === void 0 ? void 0 : _q.height) !== null && _r !== void 0 ? _r : 0
11856
+ }
11857
+ };
11858
+ });
11859
+ (_a = onPredictionHandler.current) === null || _a === void 0 ? void 0 : _a.call(onPredictionHandler, faces);
11860
+ ctx && drawResults(ctx, faces, true, true);
11861
+ }
11862
+ } catch (error) {
11863
+ console.error('caught face detection error', error);
11864
+ // detector.dispose()
11855
11865
  }
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 {
11866
+ timer = setTimeout(function () {
11867
11867
  rafId.current = requestAnimationFrame(renderPrediction);
11868
- }
11868
+ }, throttleMs !== null && throttleMs !== void 0 ? throttleMs : 0);
11869
11869
  return [2 /*return*/];
11870
11870
  }
11871
11871
  });
@@ -14025,58 +14025,55 @@ var templateObject_1$7, templateObject_2$6, templateObject_3$5, templateObject_4
14025
14025
 
14026
14026
  var edgeBoundary = 0.05;
14027
14027
  var IdVideoCapture = function IdVideoCapture(_a) {
14028
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
14028
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
14029
14029
  var onComplete = _a.onComplete,
14030
14030
  onIdFrontImageCaptured = _a.onIdFrontImageCaptured,
14031
14031
  onIdBackImageCaptured = _a.onIdBackImageCaptured,
14032
14032
  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,
14033
+ _v = _a.idCardFrontDetectionThreshold,
14034
+ idCardFrontDetectionThreshold = _v === void 0 ? 0.6 : _v,
14035
+ _w = _a.idCardFrontFocusThreshold,
14036
+ idCardFrontFocusThreshold = _w === void 0 ? 0 : _w,
14037
+ _x = _a.goodIdCardFrontFramesThreshold,
14038
+ goodIdCardFrontFramesThreshold = _x === void 0 ? 3 : _x,
14039
+ _y = _a.idCardBackDetectionThreshold,
14040
+ idCardBackDetectionThreshold = _y === void 0 ? 0.6 : _y,
14041
+ _z = _a.idCardBackFocusThreshold,
14042
+ idCardBackFocusThreshold = _z === void 0 ? 0 : _z,
14043
+ _0 = _a.goodIdCardBackFramesThreshold,
14044
+ goodIdCardBackFramesThreshold = _0 === void 0 ? 3 : _0,
14045
+ _1 = _a.skipShowIdCardBack,
14046
+ skipShowIdCardBack = _1 === void 0 ? false : _1,
14047
14047
  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];
14048
+ _2 = _a.readTextTimeoutDurationMs,
14049
+ readTextTimeoutDurationMs = _2 === void 0 ? 15000 : _2,
14050
+ _3 = _a.assets,
14051
+ assets = _3 === void 0 ? {} : _3,
14052
+ _4 = _a.classNames,
14053
+ classNames = _4 === void 0 ? {} : _4,
14054
+ _5 = _a.colors,
14055
+ colors = _5 === void 0 ? {} : _5,
14056
+ _6 = _a.verbiage,
14057
+ rawVerbiage = _6 === void 0 ? {} : _6,
14058
+ _7 = _a.debugMode,
14059
+ debugMode = _7 === void 0 ? false : _7;
14060
+ var _8 = useResizeObserver__default['default'](),
14061
+ ref = _8.ref,
14062
+ _9 = _8.width,
14063
+ width = _9 === void 0 ? 1 : _9,
14064
+ _10 = _8.height,
14065
+ height = _10 === void 0 ? 1 : _10;
14066
+ var _11 = React.useContext(CameraStateContext),
14067
+ cameraRef = _11.cameraRef,
14068
+ videoRef = _11.videoRef,
14069
+ videoLoaded = _11.videoLoaded,
14070
+ cameraReady = _11.cameraReady;
14074
14071
  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];
14072
+ detectedObjects = _12[0],
14073
+ setDetectedObjects = _12[1];
14074
+ var _13 = React.useState([]),
14075
+ faces = _13[0],
14076
+ setFaces = _13[1];
14080
14077
  var _14 = React.useContext(IdCaptureModelsContext),
14081
14078
  idModelsReady = _14.ready,
14082
14079
  idModelsWorking = _14.working,
@@ -14171,6 +14168,10 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14171
14168
  stopRecording();
14172
14169
  }
14173
14170
  }, [readTextPrompt, stopRecording]);
14171
+ var frameWidth = (_c = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) !== null && _c !== void 0 ? _c : 0;
14172
+ var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
14173
+ var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
14174
+ var faceCentered = faceBox && faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
14174
14175
  var satisfied = goodFramesCount > 0 && faceCentered;
14175
14176
  React.useEffect(function () {
14176
14177
  (function () {
@@ -14225,8 +14226,6 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14225
14226
  stopRecording();
14226
14227
  }, [stopRecording]);
14227
14228
  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
14229
  var _20 = React.useState(0),
14231
14230
  numFramesWithoutFaces = _20[0],
14232
14231
  setNumFramesWithoutFaces = _20[1];
@@ -14236,14 +14235,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14236
14235
  setNumFramesWithoutFaces(function (n) {
14237
14236
  return faces.length === 0 ? n + 1 : 0;
14238
14237
  });
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
14238
  });
14246
- }, [frameHeight, frameWidth, onSelfiePredictionMade]);
14239
+ }, [onSelfiePredictionMade]);
14247
14240
  React.useEffect(function () {
14248
14241
  if (numFramesWithoutFaces >= 2) {
14249
14242
  onFaceNotDetected === null || onFaceNotDetected === void 0 ? void 0 : onFaceNotDetected();
@@ -14259,12 +14252,12 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14259
14252
  enabled: debugMode,
14260
14253
  pageWidth: width,
14261
14254
  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
14255
+ videoWidth: (_h = (_g = videoRef.current) === null || _g === void 0 ? void 0 : _g.videoWidth) !== null && _h !== void 0 ? _h : 0,
14256
+ videoHeight: (_k = (_j = videoRef.current) === null || _j === void 0 ? void 0 : _j.videoHeight) !== null && _k !== void 0 ? _k : 0
14264
14257
  });
14265
14258
  return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
14266
14259
  ref: ref,
14267
- className: "flex ".concat((_k = classNames.container) !== null && _k !== void 0 ? _k : '')
14260
+ className: "flex ".concat((_l = classNames.container) !== null && _l !== void 0 ? _l : '')
14268
14261
  }, /*#__PURE__*/React__default['default'].createElement(CameraVideoTag, {
14269
14262
  className: classNames.cameraFeed
14270
14263
  }), /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
@@ -14281,11 +14274,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14281
14274
  verbiage: rawVerbiage.guides,
14282
14275
  requestedAction: requestedAction,
14283
14276
  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)
14277
+ }), 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, {
14278
+ "$flipX": !((_m = cameraRef.current) === null || _m === void 0 ? void 0 : _m.isRearFacing)
14289
14279
  }, detectedObjects.map(function (obj, i) {
14290
14280
  var _a;
14291
14281
  return /*#__PURE__*/React__default['default'].createElement(IdCaptureDetectedObjectDebugBox, {
@@ -14296,7 +14286,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14296
14286
  flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
14297
14287
  });
14298
14288
  })), /*#__PURE__*/React__default['default'].createElement(DebugBoundingBoxOverlay, {
14299
- "$flipX": !((_t = cameraRef.current) === null || _t === void 0 ? void 0 : _t.isRearFacing)
14289
+ "$flipX": !((_o = cameraRef.current) === null || _o === void 0 ? void 0 : _o.isRearFacing)
14300
14290
  }, faces.map(function (face, i) {
14301
14291
  var _a;
14302
14292
  return /*#__PURE__*/React__default['default'].createElement(SelfieCaptureFaceDebugBox, {
@@ -14305,7 +14295,10 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14305
14295
  scaling: debugScalingDetails,
14306
14296
  flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
14307
14297
  });
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)));
14298
+ })))))), !faceCentered && ( /*#__PURE__*/React__default['default'].createElement(GuidanceMessageContainer, null, /*#__PURE__*/React__default['default'].createElement(GuidanceMessage, {
14299
+ "$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',
14300
+ "$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'
14301
+ }, 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
14302
  };
14310
14303
 
14311
14304
  var IdVideoCaptureSuccess = function IdVideoCaptureSuccess(_a) {