idmission-web-sdk 0.0.44 → 0.0.45

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.
@@ -195,7 +195,7 @@ function contentDispositionFromDataUrl(url) {
195
195
  return (_b = (_a = url.match(/^(data:.*;base64),/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';
196
196
  }
197
197
 
198
- var PageContainerDiv = styled__default['default'].div(templateObject_1$9 || (templateObject_1$9 = tslib.__makeTemplateObject(["\n position: fixed;\n top: 0;\n left: 0;\n width: var(--app-width);\n height: calc(\n var(--app-height) - ", "px\n );\n overflow-x: hidden;\n overflow-y: auto;\n font-family:\n Inter,\n -apple-system,\n BlinkMacSystemFont,\n Segoe UI,\n Roboto,\n Oxygen,\n Ubuntu,\n Cantarell,\n Fira Sans,\n Droid Sans,\n Helvetica Neue,\n sans-serif;\n\n &.flex {\n display: flex;\n }\n\n &.padded {\n box-sizing: border-box;\n padding: 16px 24px;\n }\n"], ["\n position: fixed;\n top: 0;\n left: 0;\n width: var(--app-width);\n height: calc(\n var(--app-height) - ", "px\n );\n overflow-x: hidden;\n overflow-y: auto;\n font-family:\n Inter,\n -apple-system,\n BlinkMacSystemFont,\n Segoe UI,\n Roboto,\n Oxygen,\n Ubuntu,\n Cantarell,\n Fira Sans,\n Droid Sans,\n Helvetica Neue,\n sans-serif;\n\n &.flex {\n display: flex;\n }\n\n &.padded {\n box-sizing: border-box;\n padding: 16px 24px;\n }\n"])), function (_a) {
198
+ var PageContainerDiv = styled__default['default'].div(templateObject_1$a || (templateObject_1$a = tslib.__makeTemplateObject(["\n position: fixed;\n top: 0;\n left: 0;\n width: var(--app-width);\n height: calc(\n var(--app-height) - ", "px\n );\n overflow-x: hidden;\n overflow-y: auto;\n font-family:\n Inter,\n -apple-system,\n BlinkMacSystemFont,\n Segoe UI,\n Roboto,\n Oxygen,\n Ubuntu,\n Cantarell,\n Fira Sans,\n Droid Sans,\n Helvetica Neue,\n sans-serif;\n\n &.flex {\n display: flex;\n }\n\n &.padded {\n box-sizing: border-box;\n padding: 16px 24px;\n }\n"], ["\n position: fixed;\n top: 0;\n left: 0;\n width: var(--app-width);\n height: calc(\n var(--app-height) - ", "px\n );\n overflow-x: hidden;\n overflow-y: auto;\n font-family:\n Inter,\n -apple-system,\n BlinkMacSystemFont,\n Segoe UI,\n Roboto,\n Oxygen,\n Ubuntu,\n Cantarell,\n Fira Sans,\n Droid Sans,\n Helvetica Neue,\n sans-serif;\n\n &.flex {\n display: flex;\n }\n\n &.padded {\n box-sizing: border-box;\n padding: 16px 24px;\n }\n"])), function (_a) {
199
199
  var $heightOffset = _a.$heightOffset;
200
200
  return $heightOffset !== null && $heightOffset !== void 0 ? $heightOffset : 0;
201
201
  });
@@ -232,13 +232,13 @@ var PageContainer = /*#__PURE__*/React.forwardRef(function (_a, ref) {
232
232
  }, dimensionsCalculated && children);
233
233
  });
234
234
  PageContainer.displayName = 'PageContainer';
235
- var templateObject_1$9;
235
+ var templateObject_1$a;
236
236
 
237
- var OverlayContainer = styled__default['default'](PageContainer)(templateObject_1$8 || (templateObject_1$8 = tslib.__makeTemplateObject(["\n background: white;\n z-index: 10000;\n"], ["\n background: white;\n z-index: 10000;\n"])));
238
- var OverlayInner = styled__default['default'].div(templateObject_2$3 || (templateObject_2$3 = tslib.__makeTemplateObject(["\n text-align: center;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n padding: 25px;\n max-height: var(--app-height);\n height: 100%;\n box-sizing: border-box;\n"], ["\n text-align: center;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n padding: 25px;\n max-height: var(--app-height);\n height: 100%;\n box-sizing: border-box;\n"])));
239
- var OverlayImageWrapper = styled__default['default'].div(templateObject_3$2 || (templateObject_3$2 = tslib.__makeTemplateObject(["\n position: relative;\n display: flex;\n flex-grow: 1;\n padding-bottom: 25px;\n max-width: var(--app-width);\n max-height: var(--app-height);\n overflow: hidden;\n\n & > img {\n margin: 0 auto;\n width: max-content;\n max-width: 100%;\n max-height: 100%;\n aspect-ratio: initial;\n object-fit: contain;\n display: block;\n }\n"], ["\n position: relative;\n display: flex;\n flex-grow: 1;\n padding-bottom: 25px;\n max-width: var(--app-width);\n max-height: var(--app-height);\n overflow: hidden;\n\n & > img {\n margin: 0 auto;\n width: max-content;\n max-width: 100%;\n max-height: 100%;\n aspect-ratio: initial;\n object-fit: contain;\n display: block;\n }\n"])));
237
+ var OverlayContainer = styled__default['default'](PageContainer)(templateObject_1$9 || (templateObject_1$9 = tslib.__makeTemplateObject(["\n background: white;\n z-index: 10000;\n"], ["\n background: white;\n z-index: 10000;\n"])));
238
+ var OverlayInner = styled__default['default'].div(templateObject_2$4 || (templateObject_2$4 = tslib.__makeTemplateObject(["\n text-align: center;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n padding: 25px;\n max-height: var(--app-height);\n height: 100%;\n box-sizing: border-box;\n"], ["\n text-align: center;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n padding: 25px;\n max-height: var(--app-height);\n height: 100%;\n box-sizing: border-box;\n"])));
239
+ var OverlayImageWrapper = styled__default['default'].div(templateObject_3$3 || (templateObject_3$3 = tslib.__makeTemplateObject(["\n position: relative;\n display: flex;\n flex-grow: 1;\n padding-bottom: 25px;\n max-width: var(--app-width);\n max-height: var(--app-height);\n overflow: hidden;\n\n & > img {\n margin: 0 auto;\n width: max-content;\n max-width: 100%;\n max-height: 100%;\n aspect-ratio: initial;\n object-fit: contain;\n display: block;\n }\n"], ["\n position: relative;\n display: flex;\n flex-grow: 1;\n padding-bottom: 25px;\n max-width: var(--app-width);\n max-height: var(--app-height);\n overflow: hidden;\n\n & > img {\n margin: 0 auto;\n width: max-content;\n max-width: 100%;\n max-height: 100%;\n aspect-ratio: initial;\n object-fit: contain;\n display: block;\n }\n"])));
240
240
  var OverlayImageMultiContainer = styled__default['default'].div(templateObject_4$2 || (templateObject_4$2 = tslib.__makeTemplateObject(["\n display: flex;\n margin: auto;\n\n & > div {\n max-height: calc(100vh - 320px);\n\n & > img {\n width: 100%;\n max-height: 100%;\n height: auto;\n object-fit: contain;\n }\n }\n"], ["\n display: flex;\n margin: auto;\n\n & > div {\n max-height: calc(100vh - 320px);\n\n & > img {\n width: 100%;\n max-height: 100%;\n height: auto;\n object-fit: contain;\n }\n }\n"])));
241
- var templateObject_1$8, templateObject_2$3, templateObject_3$2, templateObject_4$2;
241
+ var templateObject_1$9, templateObject_2$4, templateObject_3$3, templateObject_4$2;
242
242
 
243
243
  var GeolocationAccessDeniedOverlay = function GeolocationAccessDeniedOverlay(_a) {
244
244
  var accessBlockedImageUrl = _a.accessBlockedImageUrl;
@@ -8137,27 +8137,15 @@ function disposeTfBackend() {
8137
8137
  console.error('failed to dispose backend', e);
8138
8138
  }
8139
8139
  }
8140
- var InvisibleCanvas = styled__default['default'].canvas(templateObject_1$7 || (templateObject_1$7 = tslib.__makeTemplateObject(["\n display: none;\n"], ["\n display: none;\n"])));
8141
- var templateObject_1$7;
8140
+ var InvisibleCanvas = styled__default['default'].canvas(templateObject_1$8 || (templateObject_1$8 = tslib.__makeTemplateObject(["\n display: none;\n"], ["\n display: none;\n"])));
8141
+ var templateObject_1$8;
8142
8142
 
8143
- var DebugStatsPane = styled__default['default'].span(templateObject_1$6 || (templateObject_1$6 = tslib.__makeTemplateObject(["\n font-size: 16px;\n font-family: monospace;\n position: absolute;\n left: 20px;\n bottom: 20px;\n color: limegreen;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1001;\n"], ["\n font-size: 16px;\n font-family: monospace;\n position: absolute;\n left: 20px;\n bottom: 20px;\n color: limegreen;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1001;\n"])));
8144
- var ObjectDetectionDebugOverlay = styled__default['default'].div(templateObject_2$2 || (templateObject_2$2 = tslib.__makeTemplateObject(["\n position: absolute;\n z-index: 1001;\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\n ", "\n"], ["\n position: absolute;\n z-index: 1001;\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\n ", "\n"])), function (_a) {
8143
+ var DebugStatsPane = styled__default['default'].span(templateObject_1$7 || (templateObject_1$7 = tslib.__makeTemplateObject(["\n font-size: 16px;\n font-family: monospace;\n position: absolute;\n left: 20px;\n bottom: 20px;\n color: limegreen;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1001;\n"], ["\n font-size: 16px;\n font-family: monospace;\n position: absolute;\n left: 20px;\n bottom: 20px;\n color: limegreen;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1001;\n"])));
8144
+ var ObjectDetectionDebugOverlay = styled__default['default'].div(templateObject_2$3 || (templateObject_2$3 = tslib.__makeTemplateObject(["\n position: absolute;\n z-index: 1001;\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\n ", "\n"], ["\n position: absolute;\n z-index: 1001;\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\n ", "\n"])), function (_a) {
8145
8145
  var $flipX = _a.$flipX;
8146
8146
  return $flipX ? 'transform: scaleX(-1);' : '';
8147
8147
  });
8148
- var ObjectDetectionDebugBox = styled__default['default'].div(templateObject_3$1 || (templateObject_3$1 = tslib.__makeTemplateObject(["\n font: 10px monospace;\n position: absolute;\n top: ", "px;\n left: ", "px;\n width: ", "px;\n height: ", "px;\n border: 3px solid ", ";\n color: ", ";\n ", "\n"], ["\n font: 10px monospace;\n position: absolute;\n top: ", "px;\n left: ", "px;\n width: ", "px;\n height: ", "px;\n border: 3px solid ", ";\n color: ", ";\n ", "\n"])), function (_a) {
8149
- var $top = _a.$top;
8150
- return $top;
8151
- }, function (_a) {
8152
- var $left = _a.$left;
8153
- return $left;
8154
- }, function (_a) {
8155
- var $width = _a.$width;
8156
- return $width;
8157
- }, function (_a) {
8158
- var $height = _a.$height;
8159
- return $height;
8160
- }, function (_a) {
8148
+ var ObjectDetectionDebugBox = styled__default['default'].div(templateObject_3$2 || (templateObject_3$2 = tslib.__makeTemplateObject(["\n font: 10px monospace;\n position: absolute;\n border: 3px solid ", ";\n color: ", ";\n ", "\n"], ["\n font: 10px monospace;\n position: absolute;\n border: 3px solid ", ";\n color: ", ";\n ", "\n"])), function (_a) {
8161
8149
  var $color = _a.$color;
8162
8150
  return $color !== null && $color !== void 0 ? $color : 'green';
8163
8151
  }, function (_a) {
@@ -8167,24 +8155,7 @@ var ObjectDetectionDebugBox = styled__default['default'].div(templateObject_3$1
8167
8155
  var $flipX = _a.$flipX;
8168
8156
  return $flipX ? 'transform: scaleX(-1);' : '';
8169
8157
  });
8170
- var FaceDetectionKeypointMarker = styled__default['default'].div(templateObject_4$1 || (templateObject_4$1 = tslib.__makeTemplateObject(["\n position: absolute;\n top: ", "px;\n left: ", "px;\n width: ", "px;\n height: ", "px;\n border: ", "px solid\n ", ";\n font: 10px monospace;\n color: ", ";\n border-radius: 50%;\n ", "\n"], ["\n position: absolute;\n top: ", "px;\n left: ", "px;\n width: ", "px;\n height: ", "px;\n border: ", "px solid\n ", ";\n font: 10px monospace;\n color: ", ";\n border-radius: 50%;\n ", "\n"])), function (_a) {
8171
- var $top = _a.$top,
8172
- $height = _a.$height;
8173
- return $top - $height / 2;
8174
- }, function (_a) {
8175
- var $left = _a.$left,
8176
- $width = _a.$width;
8177
- return $left - $width / 2;
8178
- }, function (_a) {
8179
- var $width = _a.$width;
8180
- return $width;
8181
- }, function (_a) {
8182
- var $height = _a.$height;
8183
- return $height;
8184
- }, function (_a) {
8185
- var $width = _a.$width;
8186
- return $width / 2;
8187
- }, function (_a) {
8158
+ var FaceDetectionKeypointMarker = styled__default['default'].div(templateObject_4$1 || (templateObject_4$1 = tslib.__makeTemplateObject(["\n position: absolute;\n width: 4px;\n height: 4px;\n border: 2px solid ", ";\n font: 10px monospace;\n color: ", ";\n border-radius: 50%;\n ", "\n"], ["\n position: absolute;\n width: 4px;\n height: 4px;\n border: 2px solid ", ";\n font: 10px monospace;\n color: ", ";\n border-radius: 50%;\n ", "\n"])), function (_a) {
8188
8159
  var $color = _a.$color;
8189
8160
  return $color !== null && $color !== void 0 ? $color : 'red';
8190
8161
  }, function (_a) {
@@ -8246,11 +8217,13 @@ function IdCaptureDetectedObjectDebugBox(_a) {
8246
8217
  var width = obj.bbox[2] * (horizontal ? scaledWidth : pageWidth);
8247
8218
  var height = obj.bbox[3] * (horizontal ? pageHeight : scaledHeight);
8248
8219
  return /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugBox, {
8249
- "$top": top,
8250
- "$left": left,
8251
- "$width": width,
8252
- "$height": height,
8253
- "$flipX": flipX
8220
+ "$flipX": flipX,
8221
+ style: {
8222
+ top: top,
8223
+ left: left,
8224
+ width: width,
8225
+ height: height
8226
+ }
8254
8227
  }, obj.label, " (", obj.score.toFixed(3), ")");
8255
8228
  }
8256
8229
  function SelfieCaptureFaceDebugBox(_a) {
@@ -8284,12 +8257,14 @@ function SelfieCaptureFaceDebugBox(_a) {
8284
8257
  height = face.box.height / videoHeight * scaledHeight;
8285
8258
  }
8286
8259
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugBox, {
8287
- "$top": top,
8288
- "$left": left,
8289
- "$width": width,
8290
- "$height": height,
8291
8260
  "$flipX": flipX,
8292
- "$color": color
8261
+ "$color": color,
8262
+ style: {
8263
+ top: top,
8264
+ left: left,
8265
+ width: width,
8266
+ height: height
8267
+ }
8293
8268
  }), face.keypoints.map(function (point, ii) {
8294
8269
  return /*#__PURE__*/React__default['default'].createElement(SelfieCaptureFaceKeypoint, {
8295
8270
  key: ii,
@@ -8322,19 +8297,21 @@ function SelfieCaptureFaceKeypoint(_a) {
8322
8297
  left = point.x / videoWidth * pageWidth;
8323
8298
  top = point.y / videoHeight * scaledHeight - yOffset;
8324
8299
  }
8300
+ top -= 2;
8301
+ left -= 2;
8325
8302
  return /*#__PURE__*/React__default['default'].createElement(FaceDetectionKeypointMarker, {
8326
- "$top": top,
8327
- "$left": left,
8328
- "$width": 4,
8329
- "$height": 4,
8330
8303
  "$flipX": flipX,
8331
- "$color": color
8304
+ "$color": color,
8305
+ style: {
8306
+ top: top,
8307
+ left: left
8308
+ }
8332
8309
  });
8333
8310
  }
8334
- var templateObject_1$6, templateObject_2$2, templateObject_3$1, templateObject_4$1;
8311
+ var templateObject_1$7, templateObject_2$3, templateObject_3$2, templateObject_4$1;
8335
8312
 
8336
- var ExitCaptureButton = styled__default['default'].button(templateObject_1$5 || (templateObject_1$5 = tslib.__makeTemplateObject(["\n position: absolute;\n top: 12px;\n right: 12px;\n font-size: 20px;\n width: 32px;\n height: 32px;\n font-family: monospace;\n z-index: 1002;\n border: none;\n border-radius: 4px;\n background: #ccc;\n cursor: pointer;\n\n &:hover {\n background: #ddd;\n }\n"], ["\n position: absolute;\n top: 12px;\n right: 12px;\n font-size: 20px;\n width: 32px;\n height: 32px;\n font-family: monospace;\n z-index: 1002;\n border: none;\n border-radius: 4px;\n background: #ccc;\n cursor: pointer;\n\n &:hover {\n background: #ddd;\n }\n"])));
8337
- var templateObject_1$5;
8313
+ var ExitCaptureButton = styled__default['default'].button(templateObject_1$6 || (templateObject_1$6 = tslib.__makeTemplateObject(["\n position: absolute;\n top: 12px;\n right: 12px;\n font-size: 20px;\n width: 32px;\n height: 32px;\n font-family: monospace;\n z-index: 1002;\n border: none;\n border-radius: 4px;\n background: #ccc;\n cursor: pointer;\n\n &:hover {\n background: #ddd;\n }\n"], ["\n position: absolute;\n top: 12px;\n right: 12px;\n font-size: 20px;\n width: 32px;\n height: 32px;\n font-family: monospace;\n z-index: 1002;\n border: none;\n border-radius: 4px;\n background: #ccc;\n cursor: pointer;\n\n &:hover {\n background: #ddd;\n }\n"])));
8314
+ var templateObject_1$6;
8338
8315
 
8339
8316
  var initialState$5 = {
8340
8317
  videoWidth: 0,
@@ -9302,10 +9279,10 @@ var CameraVideoTag = function CameraVideoTag() {
9302
9279
  "$isRearFacing": (_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing
9303
9280
  });
9304
9281
  };
9305
- var FullscreenVideoTag = styled__default['default'].video(templateObject_1$4 || (templateObject_1$4 = tslib.__makeTemplateObject(["\n transform: ", ";\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n object-fit: cover;\n"], ["\n transform: ", ";\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n object-fit: cover;\n"])), function (props) {
9282
+ var FullscreenVideoTag = styled__default['default'].video(templateObject_1$5 || (templateObject_1$5 = tslib.__makeTemplateObject(["\n transform: ", ";\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n object-fit: cover;\n"], ["\n transform: ", ";\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n object-fit: cover;\n"])), function (props) {
9306
9283
  return props.$isRearFacing ? '' : 'scaleX(-1)';
9307
9284
  });
9308
- var templateObject_1$4;
9285
+ var templateObject_1$5;
9309
9286
 
9310
9287
  var CaptureState;
9311
9288
  (function (CaptureState) {
@@ -9944,18 +9921,18 @@ var HighPerformanceSelfieGuidanceModelsProvider = function HighPerformanceSelfie
9944
9921
  }, children);
9945
9922
  };
9946
9923
 
9947
- var GuidanceMessageContainer = styled__default['default'].div(templateObject_1$3 || (templateObject_1$3 = tslib.__makeTemplateObject(["\n position: absolute;\n top: calc(", ");\n font-weight: bold;\n width: 100%;\n display: flex;\n"], ["\n position: absolute;\n top: calc(", ");\n font-weight: bold;\n width: 100%;\n display: flex;\n"])), function (_a) {
9924
+ var GuidanceMessageContainer = styled__default['default'].div(templateObject_1$4 || (templateObject_1$4 = tslib.__makeTemplateObject(["\n position: absolute;\n top: calc(", ");\n font-weight: bold;\n width: 100%;\n display: flex;\n"], ["\n position: absolute;\n top: calc(", ");\n font-weight: bold;\n width: 100%;\n display: flex;\n"])), function (_a) {
9948
9925
  var $top = _a.$top;
9949
9926
  return $top !== null && $top !== void 0 ? $top : '10vh';
9950
9927
  });
9951
- var GuidanceMessage = styled__default['default'].div(templateObject_2$1 || (templateObject_2$1 = tslib.__makeTemplateObject(["\n margin-left: auto;\n margin-right: auto;\n background: ", ";\n color: ", ";\n padding: 10px 12px 8px;\n border-radius: 8px;\n"], ["\n margin-left: auto;\n margin-right: auto;\n background: ", ";\n color: ", ";\n padding: 10px 12px 8px;\n border-radius: 8px;\n"])), function (_a) {
9928
+ var GuidanceMessage = styled__default['default'].div(templateObject_2$2 || (templateObject_2$2 = tslib.__makeTemplateObject(["\n margin-left: auto;\n margin-right: auto;\n background: ", ";\n color: ", ";\n padding: 10px 12px 8px;\n border-radius: 8px;\n"], ["\n margin-left: auto;\n margin-right: auto;\n background: ", ";\n color: ", ";\n padding: 10px 12px 8px;\n border-radius: 8px;\n"])), function (_a) {
9952
9929
  var $background = _a.$background;
9953
9930
  return $background !== null && $background !== void 0 ? $background : '#ccc';
9954
9931
  }, function (_a) {
9955
9932
  var $textColor = _a.$textColor;
9956
9933
  return $textColor !== null && $textColor !== void 0 ? $textColor : 'black';
9957
9934
  });
9958
- var templateObject_1$3, templateObject_2$1;
9935
+ var templateObject_1$4, templateObject_2$2;
9959
9936
 
9960
9937
  var initialState$3 = {
9961
9938
  videoWidth: 0,
@@ -10178,8 +10155,8 @@ var SelfieCapture = function SelfieCapture(_a) {
10178
10155
  colors.guidesSatisfiedColor || (colors.guidesSatisfiedColor = 'green');
10179
10156
  colors.guidanceMessagesUnsatisfiedBackgroundColor || (colors.guidanceMessagesUnsatisfiedBackgroundColor = 'red');
10180
10157
  colors.guidanceMessagesSatisfiedBackgroundColor || (colors.guidanceMessagesSatisfiedBackgroundColor = 'green');
10181
- colors.guidanceMessagesUnsatisfiedTextColor || (colors.guidanceMessagesUnsatisfiedTextColor = 'black');
10182
- colors.guidanceMessagesSatisfiedTextColor || (colors.guidanceMessagesSatisfiedTextColor = 'black');
10158
+ colors.guidanceMessagesUnsatisfiedTextColor || (colors.guidanceMessagesUnsatisfiedTextColor = 'white');
10159
+ colors.guidanceMessagesSatisfiedTextColor || (colors.guidanceMessagesSatisfiedTextColor = 'white');
10183
10160
  if (!guidanceMessage) {
10184
10161
  verbiage.guidanceHoldStillText || (verbiage.guidanceHoldStillText = t('Hold still for a few seconds...'));
10185
10162
  verbiage.guidanceLookStraightText || (verbiage.guidanceLookStraightText = t('Look straight into the camera...'));
@@ -10212,6 +10189,33 @@ var SelfieCapture = function SelfieCapture(_a) {
10212
10189
  }, "\xD7"));
10213
10190
  };
10214
10191
 
10192
+ var Spinner = styled__default['default'].div(templateObject_1$3 || (templateObject_1$3 = tslib.__makeTemplateObject(["\n display: inline-block;\n width: ", "px;\n height: ", "px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: ", "px;\n height: ", "px;\n margin: 8px;\n border-radius: 50%;\n border: ", "px solid\n ", ";\n border-color: ", " transparent\n ", " transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"], ["\n display: inline-block;\n width: ", "px;\n height: ", "px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: ", "px;\n height: ", "px;\n margin: 8px;\n border-radius: 50%;\n border: ", "px solid\n ", ";\n border-color: ", " transparent\n ", " transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])), function (_a) {
10193
+ var $size = _a.$size;
10194
+ return $size !== null && $size !== void 0 ? $size : 80;
10195
+ }, function (_a) {
10196
+ var $size = _a.$size;
10197
+ return $size !== null && $size !== void 0 ? $size : 80;
10198
+ }, function (_a) {
10199
+ var $size = _a.$size;
10200
+ return ($size !== null && $size !== void 0 ? $size : 80) - 16;
10201
+ }, function (_a) {
10202
+ var $size = _a.$size;
10203
+ return ($size !== null && $size !== void 0 ? $size : 80) - 16;
10204
+ }, function (_a) {
10205
+ var $thickness = _a.$thickness;
10206
+ return $thickness !== null && $thickness !== void 0 ? $thickness : 6;
10207
+ }, function (_a) {
10208
+ var $color = _a.$color;
10209
+ return $color !== null && $color !== void 0 ? $color : '#888';
10210
+ }, function (_a) {
10211
+ var $color = _a.$color;
10212
+ return $color !== null && $color !== void 0 ? $color : '#888';
10213
+ }, function (_a) {
10214
+ var $color = _a.$color;
10215
+ return $color !== null && $color !== void 0 ? $color : '#888';
10216
+ });
10217
+ var templateObject_1$3;
10218
+
10215
10219
  var initialState$2 = {
10216
10220
  frame: null,
10217
10221
  face: null,
@@ -10310,6 +10314,9 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
10310
10314
  var _e = React.useReducer(reducer$2, initialState$2),
10311
10315
  state = _e[0],
10312
10316
  dispatch = _e[1];
10317
+ var _f = React.useState(null),
10318
+ imageUrl = _f[0],
10319
+ setImageUrl = _f[1];
10313
10320
  var onSelfieCaptured = React.useCallback(function (frame, face) {
10314
10321
  onCapture === null || onCapture === void 0 ? void 0 : onCapture();
10315
10322
  dispatch({
@@ -10331,14 +10338,15 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
10331
10338
  });
10332
10339
  (function () {
10333
10340
  return tslib.__awaiter(void 0, void 0, void 0, function () {
10334
- var imageUrl, response, _a, e_1;
10341
+ var imageUrl_1, response, _a, e_1;
10335
10342
  return tslib.__generator(this, function (_b) {
10336
10343
  switch (_b.label) {
10337
10344
  case 0:
10338
10345
  _b.trys.push([0, 3,, 4]);
10339
- imageUrl = cropToShoulders(frame, face);
10346
+ imageUrl_1 = cropToShoulders(frame, face);
10347
+ setImageUrl(imageUrl_1);
10340
10348
  _a = checkLiveness;
10341
- return [4, dataUrlToBase64(imageUrl)];
10349
+ return [4, dataUrlToBase64(imageUrl_1)];
10342
10350
  case 1:
10343
10351
  return [4, _a.apply(void 0, [_b.sent()])];
10344
10352
  case 2:
@@ -10348,7 +10356,7 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
10348
10356
  payload: {
10349
10357
  frame: frame,
10350
10358
  face: face,
10351
- imageUrl: imageUrl,
10359
+ imageUrl: imageUrl_1,
10352
10360
  response: response
10353
10361
  }
10354
10362
  });
@@ -10377,21 +10385,68 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
10377
10385
  onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
10378
10386
  }
10379
10387
  }, [onTimeout, state.timesLivenessCheckFailed]);
10388
+ var _g = React.useState(false),
10389
+ timedOut = _g[0],
10390
+ setTimedOut = _g[1];
10391
+ React.useEffect(function () {
10392
+ if (!timeoutDurationMs) return;
10393
+ var timer = setTimeout(function () {
10394
+ setTimedOut(true);
10395
+ }, timeoutDurationMs);
10396
+ return function () {
10397
+ if (timer) clearTimeout(timer);
10398
+ };
10399
+ }, [timeoutDurationMs]);
10400
+ React.useEffect(function () {
10401
+ if (!timedOut || state.requestState === 'PASSED') return;
10402
+ if (state.requestState !== 'IN_PROGRESS') {
10403
+ onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
10404
+ return;
10405
+ }
10406
+ var t = setTimeout(function () {
10407
+ onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
10408
+ }, 10000);
10409
+ return function () {
10410
+ clearTimeout(t);
10411
+ };
10412
+ }, [onTimeout, state.requestState, timedOut]);
10380
10413
  verbiage.guidanceRemoveEyeCoveringsText || (verbiage.guidanceRemoveEyeCoveringsText = t('Please remove your eye coverings (sunglasses, eye patch, etc.)...'));
10381
10414
  verbiage.guidanceRemoveHeadCoveringsText || (verbiage.guidanceRemoveHeadCoveringsText = t('Please remove your head coverings (hat, scarf, etc.)...'));
10382
10415
  verbiage.guidanceRemoveMaskText || (verbiage.guidanceRemoveMaskText = t('Please remove your mask...'));
10383
10416
  var guidanceMessage = state.eyeCoveringDetected ? verbiage.guidanceRemoveEyeCoveringsText : state.headCoveringDetected ? verbiage.guidanceRemoveHeadCoveringsText : state.maskDetected ? verbiage.guidanceRemoveMaskText : undefined;
10384
- return /*#__PURE__*/React__default['default'].createElement(SelfieCapture, {
10417
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(SelfieCapture, {
10385
10418
  onSelfieCaptured: onSelfieCaptured,
10386
- onTimeout: onTimeout,
10387
10419
  onExit: onExit,
10388
10420
  timeoutDurationMs: timeoutDurationMs,
10389
10421
  guidanceMessage: guidanceMessage,
10390
10422
  colors: colors,
10391
10423
  verbiage: verbiage,
10392
10424
  debugMode: debugMode
10393
- });
10425
+ }), imageUrl && /*#__PURE__*/React__default['default'].createElement(SelfieProgressPreview, {
10426
+ imageUrl: imageUrl
10427
+ }));
10394
10428
  };
10429
+ var SelfieProgressPreview = function SelfieProgressPreview(_a) {
10430
+ var imageUrl = _a.imageUrl;
10431
+ return /*#__PURE__*/React__default['default'].createElement(SelfieProgressPreviewWrapper, null, /*#__PURE__*/React__default['default'].createElement(SelfieProgressText, null, /*#__PURE__*/React__default['default'].createElement(Spinner, {
10432
+ "$size": 24,
10433
+ "$color": "white",
10434
+ "$thickness": 3,
10435
+ style: {
10436
+ position: 'relative',
10437
+ top: 4,
10438
+ left: -3,
10439
+ margin: '0 3px 0 -12px'
10440
+ }
10441
+ }), "Processing..."), /*#__PURE__*/React__default['default'].createElement(SelfiePreviewImageWrapper, null, /*#__PURE__*/React__default['default'].createElement("img", {
10442
+ src: imageUrl,
10443
+ alt: ""
10444
+ })));
10445
+ };
10446
+ var SelfieProgressPreviewWrapper = styled__default['default'].div(templateObject_1$2 || (templateObject_1$2 = tslib.__makeTemplateObject(["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: 33%;\n bottom: 12px;\n right: 12px;\n"], ["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: 33%;\n bottom: 12px;\n right: 12px;\n"])));
10447
+ var SelfieProgressText = styled__default['default'].div(templateObject_2$1 || (templateObject_2$1 = tslib.__makeTemplateObject(["\n display: block;\n position: absolute;\n top: -32px;\n font:\n 14px -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Helvetica,\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n color: white;\n text-align: center;\n margin: 0 auto;\n width: 100%;\n"], ["\n display: block;\n position: absolute;\n top: -32px;\n font:\n 14px -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Helvetica,\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n color: white;\n text-align: center;\n margin: 0 auto;\n width: 100%;\n"])));
10448
+ var SelfiePreviewImageWrapper = styled__default['default'].div(templateObject_3$1 || (templateObject_3$1 = tslib.__makeTemplateObject(["\n position: relative;\n height: calc(100% - 8px);\n padding: 4px;\n border-radius: 4px;\n background: white;\n\n & > img {\n border-radius: 4px;\n width: auto;\n max-height: 100%;\n }\n"], ["\n position: relative;\n height: calc(100% - 8px);\n padding: 4px;\n border-radius: 4px;\n background: white;\n\n & > img {\n border-radius: 4px;\n width: auto;\n max-height: 100%;\n }\n"])));
10449
+ var templateObject_1$2, templateObject_2$1, templateObject_3$1;
10395
10450
 
10396
10451
  var SelfieCaptureLoadingOverlay = function SelfieCaptureLoadingOverlay(_a) {
10397
10452
  var headingText = _a.headingText,
@@ -11222,9 +11277,6 @@ function truncate(str, max_chars) {
11222
11277
  return truncated;
11223
11278
  }
11224
11279
 
11225
- var Spinner = styled__default['default'].div(templateObject_1$2 || (templateObject_1$2 = tslib.__makeTemplateObject(["\n display: inline-block;\n width: 80px;\n height: 80px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: 64px;\n height: 64px;\n margin: 8px;\n border-radius: 50%;\n border: 6px solid #888;\n border-color: #888 transparent #888 transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"], ["\n display: inline-block;\n width: 80px;\n height: 80px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: 64px;\n height: 64px;\n margin: 8px;\n border-radius: 50%;\n border: 6px solid #888;\n border-color: #888 transparent #888 transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])));
11226
- var templateObject_1$2;
11227
-
11228
11280
  var AdditionalDocumentCapture = function AdditionalDocumentCapture(_a) {
11229
11281
  var document = _a.document,
11230
11282
  onComplete = _a.onComplete,