idmission-web-sdk 2.1.41 → 2.1.42

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.
@@ -16,9 +16,11 @@ export type FlipIdPromptVerbiage = {
16
16
  instructionText?: CustomerSuppliedVerbiage;
17
17
  };
18
18
  export type FlipIdPromptProps = {
19
+ width?: number;
20
+ height?: number;
19
21
  padding?: number;
20
22
  imagePadding?: number;
21
- borderWidth?: number;
23
+ borderWidth?: number | string;
22
24
  borderColor?: string;
23
25
  borderRadius?: number;
24
26
  isMirrored?: boolean;
@@ -27,4 +29,4 @@ export type FlipIdPromptProps = {
27
29
  classNames?: FlipIdPromptClassNames;
28
30
  verbiage?: FlipIdPromptVerbiage;
29
31
  };
30
- export declare const FlipIdPrompt: ({ borderWidth, borderColor, borderRadius, isMirrored, portraitGuidesOnMobile, assets, classNames, }: FlipIdPromptProps) => ReactElement;
32
+ export declare const FlipIdPrompt: ({ width, height, borderWidth, borderColor, borderRadius, isMirrored, portraitGuidesOnMobile, assets, classNames, }: FlipIdPromptProps) => ReactElement;
@@ -36,7 +36,7 @@ export type IdCaptureGuideOverlayProps = {
36
36
  imageVisible?: boolean;
37
37
  borderWidth?: number;
38
38
  borderColor?: string;
39
- idCardBorderWidth?: number;
39
+ idCardBorderWidth?: number | string;
40
40
  idCardBorderColor?: string;
41
41
  maskColor?: string;
42
42
  isMirrored?: boolean;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function ScalingCameraFeed(): React.JSX.Element | null;
@@ -20,7 +20,7 @@ export type IdVideoCaptureFlipIdPromptProps = {
20
20
  export declare const IdVideoCaptureFlipIdPrompt: ({ assets, classNames, borderWidth, borderColor, borderRadius, imageStyle, }: IdVideoCaptureFlipIdPromptProps) => ReactElement;
21
21
  export declare const FlipImageContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<React.HTMLAttributes<HTMLDivElement> & {
22
22
  status?: import("./IdVideoCaptureGuidesCommon").IdCardGuideStatus;
23
- borderWidth?: number;
23
+ borderWidth?: number | string;
24
24
  borderRadius?: number;
25
25
  borderColor?: string;
26
26
  progress?: number;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export declare const IdCardGuideImageContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.HTMLAttributes<HTMLDivElement> & {
3
3
  status?: IdCardGuideStatus;
4
- borderWidth?: number;
4
+ borderWidth?: number | string;
5
5
  borderRadius?: number;
6
6
  borderColor?: string;
7
7
  progress?: number;
@@ -15,7 +15,7 @@ export declare const IdCardGuideImage: import("styled-components/dist/types").IS
15
15
  export type IdCardGuideStatus = 'disabled' | 'ready' | 'capturing';
16
16
  declare function IdCardBorder({ children, status, borderWidth, borderRadius, borderColor, progress, ...props }: React.HTMLAttributes<HTMLDivElement> & {
17
17
  status?: IdCardGuideStatus;
18
- borderWidth?: number;
18
+ borderWidth?: number | string;
19
19
  borderRadius?: number;
20
20
  borderColor?: string;
21
21
  progress?: number;
@@ -234,7 +234,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
234
234
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
235
235
  };
236
236
 
237
- var webSdkVersion = '2.1.41';
237
+ var webSdkVersion = '2.1.42';
238
238
 
239
239
  function getPlatform() {
240
240
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -8147,48 +8147,6 @@ var CapturedImageWrapper = styled__default.default.div(templateObject_7$5 || (te
8147
8147
  var StyledImage = styled__default.default(CapturedDocumentImg)(templateObject_8$3 || (templateObject_8$3 = __makeTemplateObject(["\n width: 100%;\n border-radius: 4px;\n"], ["\n width: 100%;\n border-radius: 4px;\n"])));
8148
8148
  var templateObject_1$v, templateObject_2$o, templateObject_3$k, templateObject_4$e, templateObject_5$9, templateObject_6$7, templateObject_7$5, templateObject_8$3;
8149
8149
 
8150
- var CameraVideoTag = function CameraVideoTag(_a) {
8151
- var _b;
8152
- var className = _a.className;
8153
- var _c = React.useContext(CameraStateContext),
8154
- videoRef = _c.videoRef,
8155
- setVideoLoaded = _c.setVideoLoaded,
8156
- onVideoUnmounted = _c.onVideoUnmounted,
8157
- cameraRef = _c.cameraRef;
8158
- React.useEffect(function notifyCameraProviderOfUnmount() {
8159
- var videoElement = videoRef.current;
8160
- if (!videoElement) return;
8161
- return function () {
8162
- onVideoUnmounted(videoElement);
8163
- };
8164
- }, [onVideoUnmounted, videoRef]);
8165
- React.useEffect(function setVideoLoadedToFalseOnMount() {
8166
- setVideoLoaded(false);
8167
- }, [setVideoLoaded]);
8168
- React.useEffect(function attachCameraStreamToVideoTagWhenReady() {
8169
- var _a;
8170
- if (videoRef.current && ((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.stream)) {
8171
- videoRef.current.srcObject = cameraRef.current.stream;
8172
- }
8173
- }, [cameraRef, videoRef]);
8174
- var onLoadedData = React.useCallback(function () {
8175
- setVideoLoaded(true);
8176
- }, [setVideoLoaded]);
8177
- return /*#__PURE__*/React__namespace.default.createElement(FullscreenVideoTag, {
8178
- className: className,
8179
- autoPlay: true,
8180
- playsInline: true,
8181
- muted: true,
8182
- ref: videoRef,
8183
- onLoadedData: onLoadedData,
8184
- "$isRearFacing": (_b = cameraRef.current) === null || _b === void 0 ? void 0 : _b.isRearFacing
8185
- });
8186
- };
8187
- var FullscreenVideoTag = styled__default.default.video(templateObject_1$u || (templateObject_1$u = __makeTemplateObject(["\n transform: ", ";\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n object-fit: cover;\n background: black;\n z-index: -2;\n"], ["\n transform: ", ";\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n object-fit: cover;\n background: black;\n z-index: -2;\n"])), function (props) {
8188
- return props.$isRearFacing ? '' : 'scaleX(-1)';
8189
- });
8190
- var templateObject_1$u;
8191
-
8192
8150
  function useShowSuccessScreen(skipSuccessScreen, successScreenReady, onDoneCallback) {
8193
8151
  var _this = this;
8194
8152
  var _a = React.useState(false),
@@ -8222,11 +8180,6 @@ function useShowSuccessScreen(skipSuccessScreen, successScreenReady, onDoneCallb
8222
8180
  return !skipSuccessScreen || skipSuccessScreenResolvedFalse;
8223
8181
  }
8224
8182
 
8225
- var CameraFeedWrapper = styled__default.default.div(templateObject_1$t || (templateObject_1$t = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
8226
- return props.$mode === 'snapToGuides' ? "display: flex;\n position: absolute;\n left: ".concat(props.$x, "px;\n top: ").concat(props.$y, "px;\n width: ").concat(props.$w, "px;\n height: ").concat(props.$h, "px;") : "";
8227
- });
8228
- var templateObject_1$t;
8229
-
8230
8183
  function setCanvasDimensions(canvas, width, height) {
8231
8184
  var _a;
8232
8185
  var devicePixelRatio = 1;
@@ -8259,7 +8212,7 @@ var GuideOrientationContext = /*#__PURE__*/React.createContext({
8259
8212
  }
8260
8213
  });
8261
8214
 
8262
- var IdCardGuideImageContainer = styled__default.default(IdCardBorder)(templateObject_1$s || (templateObject_1$s = __makeTemplateObject(["\n position: relative;\n ", "\n box-sizing: border-box;\n"], ["\n position: relative;\n ", "\n box-sizing: border-box;\n"])), function (props) {
8215
+ var IdCardGuideImageContainer = styled__default.default(IdCardBorder)(templateObject_1$u || (templateObject_1$u = __makeTemplateObject(["\n position: relative;\n ", "\n box-sizing: border-box;\n"], ["\n position: relative;\n ", "\n box-sizing: border-box;\n"])), function (props) {
8263
8216
  return props.$isVisible ? '' : 'opacity: 0;';
8264
8217
  });
8265
8218
  var IdCardGuideImage = styled__default.default.img(templateObject_2$n || (templateObject_2$n = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), function (props) {
@@ -8406,7 +8359,7 @@ var IdCardBorderRect = styled__default.default.rect(templateObject_5$8 || (templ
8406
8359
  var _a;
8407
8360
  return (_a = props.$fillMode) !== null && _a !== void 0 ? _a : 'forwards';
8408
8361
  });
8409
- var templateObject_1$s, templateObject_2$n, templateObject_3$j, templateObject_4$d, templateObject_5$8;
8362
+ var templateObject_1$u, templateObject_2$n, templateObject_3$j, templateObject_4$d, templateObject_5$8;
8410
8363
 
8411
8364
  var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
8412
8365
  var _b;
@@ -8479,23 +8432,21 @@ var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
8479
8432
  style: imageStyle
8480
8433
  })));
8481
8434
  };
8482
- var FlipImageContainer = styled__default.default(IdCardGuideImageContainer)(templateObject_1$r || (templateObject_1$r = __makeTemplateObject(["\n backface-visibility: hidden;\n transition: transform ", "s;\n transform: ", ";\n transform-style: preserve-3d;\n position: absolute;\n display: block;\n top: 0;\n width: 100%;\n max-height: 100%;\n"], ["\n backface-visibility: hidden;\n transition: transform ", "s;\n transform: ", ";\n transform-style: preserve-3d;\n position: absolute;\n display: block;\n top: 0;\n width: 100%;\n max-height: 100%;\n"])), function (props) {
8435
+ var FlipImageContainer = styled__default.default(IdCardGuideImageContainer)(templateObject_1$t || (templateObject_1$t = __makeTemplateObject(["\n backface-visibility: hidden;\n transition: transform ", "s;\n transform: ", ";\n transform-style: preserve-3d;\n position: absolute;\n display: block;\n top: 0;\n width: 100%;\n max-height: 100%;\n"], ["\n backface-visibility: hidden;\n transition: transform ", "s;\n transform: ", ";\n transform-style: preserve-3d;\n position: absolute;\n display: block;\n top: 0;\n width: 100%;\n max-height: 100%;\n"])), function (props) {
8483
8436
  return props.$transitionTime;
8484
8437
  }, function (props) {
8485
8438
  return props.$transforms;
8486
8439
  });
8487
- var templateObject_1$r;
8440
+ var templateObject_1$t;
8488
8441
 
8489
8442
  var FlipIdPrompt = function FlipIdPrompt(_a) {
8490
- // const { width = 1, height = 1 } = useResizeObserver<HTMLDivElement>()
8491
- // const { cameraRef } = useContext(CameraStateContext)
8492
8443
  // const theme = useTheme()
8493
8444
  var
8494
8445
  // padding: userSuppliedPadding,
8495
8446
  // imagePadding: userSuppliedImagePadding,
8447
+ width = _a.width,
8448
+ height = _a.height,
8496
8449
  _b = _a.borderWidth,
8497
- // padding: userSuppliedPadding,
8498
- // imagePadding: userSuppliedImagePadding,
8499
8450
  borderWidth = _b === void 0 ? 20 : _b,
8500
8451
  _c = _a.borderColor,
8501
8452
  borderColor = _c === void 0 ? 'white' : _c,
@@ -8521,14 +8472,8 @@ var FlipIdPrompt = function FlipIdPrompt(_a) {
8521
8472
  // (userSuppliedPadding ?? isMobile())
8522
8473
  // ? (theme.idCapture?.guideBox?.mobilePadding ?? 0)
8523
8474
  // : (theme.idCapture?.guideBox?.desktopPadding ?? 50)
8524
- // if (borderWidth === undefined)
8525
- // borderWidth = theme.idCapture?.guideBox?.borderWidth ?? 4
8526
- // const isMirrored = !cameraRef.current?.isRearFacing
8527
8475
  var onImageLoaded = React.useContext(GuideOrientationContext).onImageLoaded;
8528
8476
  var orientation = portraitGuidesOnMobile && window.innerWidth < window.innerHeight ? 'portrait' : 'landscape';
8529
- // useEffect(() => {
8530
- // setDimensions({ width, height })
8531
- // }, [height, setDimensions, width])
8532
8477
  // const imagePadding =
8533
8478
  // userSuppliedImagePadding ?? theme.idCapture?.guideBox?.imagePadding ?? 0
8534
8479
  var _j = React.useState(1),
@@ -8572,12 +8517,9 @@ var FlipIdPrompt = function FlipIdPrompt(_a) {
8572
8517
  alt: "",
8573
8518
  className: classNames.frontImage,
8574
8519
  // $padding={imagePadding}
8575
- // $transitionTime={transitionTime}
8576
- // $transforms={frontTransforms.join(' ')}
8577
- // $width={imageWidth}
8578
- // $height={imageHeight}
8579
- // $visible
8580
- onLoad: onImageLoaded
8520
+ onLoad: onImageLoaded,
8521
+ width: width,
8522
+ height: height
8581
8523
  })), /*#__PURE__*/React__namespace.default.createElement(FlipImageContainer, {
8582
8524
  status: "disabled",
8583
8525
  className: classNames.backImageContainer,
@@ -8590,16 +8532,12 @@ var FlipIdPrompt = function FlipIdPrompt(_a) {
8590
8532
  }, /*#__PURE__*/React__namespace.default.createElement(IdCardGuideImage, {
8591
8533
  src: orientation === 'portrait' ? assets.idCardBackPortraitImageUrl : assets.idCardBackLandscapeImageUrl,
8592
8534
  alt: "",
8593
- className: classNames.backImage
8535
+ className: classNames.backImage,
8536
+ // $padding={imagePadding}
8537
+ width: width,
8538
+ height: height
8594
8539
  })));
8595
8540
  };
8596
- // const regionClsx = (
8597
- // classNames: FlipIdPromptClassNames,
8598
- // which: 'Top' | 'Left' | 'Right' | 'Bottom',
8599
- // ): string =>
8600
- // [classNames.dimmingRegion, classNames[`dimmingRegion${which}`]]
8601
- // .filter((v) => v)
8602
- // .join(' ')
8603
8541
 
8604
8542
  var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8605
8543
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
@@ -8702,10 +8640,9 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8702
8640
  (_r = assets.flipIdPrompt).idCardBackPortraitImageUrl || (_r.idCardBackPortraitImageUrl = images.portrait.SHOW_ID_BACK);
8703
8641
  (_s = assets.flipIdPrompt).idCardBackLandscapeImageUrl || (_s.idCardBackLandscapeImageUrl = images.landscape.SHOW_ID_BACK);
8704
8642
  var imagePadding = (_o = userSuppliedImagePadding !== null && userSuppliedImagePadding !== void 0 ? userSuppliedImagePadding : (_m = (_l = theme.idCapture) === null || _l === void 0 ? void 0 : _l.guideBox) === null || _m === void 0 ? void 0 : _m.imagePadding) !== null && _o !== void 0 ? _o : 0;
8705
- var imageWidth = undefined;
8706
- if (imageAspectRatio >= wrapperAspectRatio) {
8707
- imageWidth = wrapperWidth - paddingAndBorderPx;
8708
- }
8643
+ var imageWidth = state.guideRectWidth - imagePadding * 2;
8644
+ var imageHeight = state.guideRectHeight - imagePadding * 2;
8645
+ var centerRegionMinWidth = imageAspectRatio >= wrapperAspectRatio ? wrapperWidth - paddingAndBorderPx : undefined;
8709
8646
  return /*#__PURE__*/React__namespace.default.createElement(StyledPageContainer, {
8710
8647
  ref: wrapperRef,
8711
8648
  onClick: onClick,
@@ -8725,7 +8662,7 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8725
8662
  "$minWidth": padding,
8726
8663
  className: regionClsx(classNames, 'Left')
8727
8664
  }), /*#__PURE__*/React__namespace.default.createElement(GuideCenterRegion, {
8728
- "$minWidth": imageWidth,
8665
+ "$minWidth": centerRegionMinWidth,
8729
8666
  "$isMirrored": isMirrored,
8730
8667
  className: classNames.centerRegion
8731
8668
  }, /*#__PURE__*/React__namespace.default.createElement(GuideCenterBorder, {
@@ -8748,15 +8685,17 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8748
8685
  className: classNames.image,
8749
8686
  "$isInvisible": !imageVisible,
8750
8687
  "$isMirrored": isMirrored,
8751
- width: state.guideRectWidth - imagePadding * 2,
8752
- height: state.guideRectHeight - imagePadding * 2
8688
+ width: imageWidth,
8689
+ height: imageHeight
8753
8690
  })), requestedAction === 'FLIP_ID' && ( /*#__PURE__*/React__namespace.default.createElement(FlipIdPrompt, {
8754
8691
  borderWidth: idCardBorderWidth,
8755
8692
  borderColor: idCardBorderColor,
8756
8693
  portraitGuidesOnMobile: portraitGuidesOnMobile,
8757
8694
  isMirrored: isMirrored,
8758
8695
  assets: assets.flipIdPrompt,
8759
- classNames: classNames.flipIdPrompt
8696
+ classNames: classNames.flipIdPrompt,
8697
+ width: imageWidth,
8698
+ height: imageHeight
8760
8699
  }))))), /*#__PURE__*/React__namespace.default.createElement(Spacer, {
8761
8700
  "$maskColor": maskColor,
8762
8701
  "$minWidth": padding,
@@ -8776,7 +8715,7 @@ var regionClsx = function regionClsx(classNames, which) {
8776
8715
  return v;
8777
8716
  }).join(' ');
8778
8717
  };
8779
- var StyledPageContainer = styled__default.default(PageContainerDiv)(templateObject_1$q || (templateObject_1$q = __makeTemplateObject(["\n z-index: 1000;\n overflow-y: hidden;\n"], ["\n z-index: 1000;\n overflow-y: hidden;\n"])));
8718
+ var StyledPageContainer = styled__default.default(PageContainerDiv)(templateObject_1$s || (templateObject_1$s = __makeTemplateObject(["\n z-index: 1000;\n overflow-y: hidden;\n"], ["\n z-index: 1000;\n overflow-y: hidden;\n"])));
8780
8719
  var GuidesContainer = styled__default.default.div(templateObject_2$m || (templateObject_2$m = __makeTemplateObject(["\n display: flex;\n flex-flow: column nowrap;\n width: 100dvw;\n height: 100dvh;\n"], ["\n display: flex;\n flex-flow: column nowrap;\n width: 100dvw;\n height: 100dvh;\n"])));
8781
8720
  var GuideCenterRow = styled__default.default.div(templateObject_3$i || (templateObject_3$i = __makeTemplateObject(["\n position: relative;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-items: center;\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n min-height: 0;\n flex: 1;\n"], ["\n position: relative;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-items: center;\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n min-height: 0;\n flex: 1;\n"])));
8782
8721
  var GuideRegion = styled__default.default.div(templateObject_4$c || (templateObject_4$c = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: end;\n width: 100%;\n position: relative;\n z-index: 1000;\n background: ", ";\n color: ", ";\n text-align: center;\n ", "\n ", "\n"], ["\n display: flex;\n flex-direction: column;\n justify-content: end;\n width: 100%;\n position: relative;\n z-index: 1000;\n background: ", ";\n color: ", ";\n text-align: center;\n ", "\n ", "\n"])), function (props) {
@@ -8804,7 +8743,7 @@ var GuideCenterBorder = styled__default.default.div(templateObject_7$4 || (templ
8804
8743
  });
8805
8744
  var GuideText = styled__default.default.span(templateObject_8$2 || (templateObject_8$2 = __makeTemplateObject(["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"], ["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"])));
8806
8745
  var GuideCenterInner = styled__default.default.div(templateObject_9$1 || (templateObject_9$1 = __makeTemplateObject(["\n position: relative;\n margin: auto;\n"], ["\n position: relative;\n margin: auto;\n"])));
8807
- var templateObject_1$q, templateObject_2$m, templateObject_3$i, templateObject_4$c, templateObject_5$7, templateObject_6$6, templateObject_7$4, templateObject_8$2, templateObject_9$1;
8746
+ var templateObject_1$s, templateObject_2$m, templateObject_3$i, templateObject_4$c, templateObject_5$7, templateObject_6$6, templateObject_7$4, templateObject_8$2, templateObject_9$1;
8808
8747
 
8809
8748
  var IdCaptureFitGuide = function IdCaptureFitGuide(_a) {
8810
8749
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
@@ -8947,11 +8886,11 @@ var IdCaptureFitGuide = function IdCaptureFitGuide(_a) {
8947
8886
  progress: progress
8948
8887
  }));
8949
8888
  };
8950
- var CanvasWrapper$1 = styled__default.default.div(templateObject_1$p || (templateObject_1$p = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n z-index: -1;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n z-index: -1;\n"])), function (props) {
8889
+ var CanvasWrapper$1 = styled__default.default.div(templateObject_1$r || (templateObject_1$r = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n z-index: -1;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n z-index: -1;\n"])), function (props) {
8951
8890
  return props.$maskColor;
8952
8891
  });
8953
8892
  var Canvas$1 = styled__default.default.canvas(templateObject_2$l || (templateObject_2$l = __makeTemplateObject(["\n display: block;\n"], ["\n display: block;\n"])));
8954
- var templateObject_1$p, templateObject_2$l;
8893
+ var templateObject_1$r, templateObject_2$l;
8955
8894
 
8956
8895
  function IdCaptureGuides(_a) {
8957
8896
  var _b, _c;
@@ -9093,11 +9032,53 @@ var SelfieProgressPreview = function SelfieProgressPreview(_a) {
9093
9032
  onError: onError
9094
9033
  })));
9095
9034
  };
9096
- var StyledSpinner = styled__default.default(Spinner)(templateObject_1$o || (templateObject_1$o = __makeTemplateObject(["\n position: relative;\n top: 4px;\n left: -3px;\n margin: 0 3px 0 -12px;\n"], ["\n position: relative;\n top: 4px;\n left: -3px;\n margin: 0 3px 0 -12px;\n"])));
9035
+ var StyledSpinner = styled__default.default(Spinner)(templateObject_1$q || (templateObject_1$q = __makeTemplateObject(["\n position: relative;\n top: 4px;\n left: -3px;\n margin: 0 3px 0 -12px;\n"], ["\n position: relative;\n top: 4px;\n left: -3px;\n margin: 0 3px 0 -12px;\n"])));
9097
9036
  var ImagePreviewWrapper = styled__default.default.div(templateObject_2$k || (templateObject_2$k = __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"])));
9098
9037
  var ImagePreviewText = styled__default.default.div(templateObject_3$h || (templateObject_3$h = __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"])));
9099
9038
  var ImagePreviewImageWrapper = styled__default.default.div(templateObject_4$b || (templateObject_4$b = __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"])));
9100
- var templateObject_1$o, templateObject_2$k, templateObject_3$h, templateObject_4$b;
9039
+ var templateObject_1$q, templateObject_2$k, templateObject_3$h, templateObject_4$b;
9040
+
9041
+ var CameraVideoTag = function CameraVideoTag(_a) {
9042
+ var _b;
9043
+ var className = _a.className;
9044
+ var _c = React.useContext(CameraStateContext),
9045
+ videoRef = _c.videoRef,
9046
+ setVideoLoaded = _c.setVideoLoaded,
9047
+ onVideoUnmounted = _c.onVideoUnmounted,
9048
+ cameraRef = _c.cameraRef;
9049
+ React.useEffect(function notifyCameraProviderOfUnmount() {
9050
+ var videoElement = videoRef.current;
9051
+ if (!videoElement) return;
9052
+ return function () {
9053
+ onVideoUnmounted(videoElement);
9054
+ };
9055
+ }, [onVideoUnmounted, videoRef]);
9056
+ React.useEffect(function setVideoLoadedToFalseOnMount() {
9057
+ setVideoLoaded(false);
9058
+ }, [setVideoLoaded]);
9059
+ React.useEffect(function attachCameraStreamToVideoTagWhenReady() {
9060
+ var _a;
9061
+ if (videoRef.current && ((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.stream)) {
9062
+ videoRef.current.srcObject = cameraRef.current.stream;
9063
+ }
9064
+ }, [cameraRef, videoRef]);
9065
+ var onLoadedData = React.useCallback(function () {
9066
+ setVideoLoaded(true);
9067
+ }, [setVideoLoaded]);
9068
+ return /*#__PURE__*/React__namespace.default.createElement(FullscreenVideoTag, {
9069
+ className: className,
9070
+ autoPlay: true,
9071
+ playsInline: true,
9072
+ muted: true,
9073
+ ref: videoRef,
9074
+ onLoadedData: onLoadedData,
9075
+ "$isRearFacing": (_b = cameraRef.current) === null || _b === void 0 ? void 0 : _b.isRearFacing
9076
+ });
9077
+ };
9078
+ var FullscreenVideoTag = styled__default.default.video(templateObject_1$p || (templateObject_1$p = __makeTemplateObject(["\n transform: ", ";\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n object-fit: cover;\n background: black;\n z-index: -2;\n"], ["\n transform: ", ";\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n object-fit: cover;\n background: black;\n z-index: -2;\n"])), function (props) {
9079
+ return props.$isRearFacing ? '' : 'scaleX(-1)';
9080
+ });
9081
+ var templateObject_1$p;
9101
9082
 
9102
9083
  var documentCaptureInitialState = {
9103
9084
  documents: [],
@@ -9453,11 +9434,16 @@ var DocumentCaptureGuideOverlay = function DocumentCaptureGuideOverlay(_a) {
9453
9434
  ref: canvasRef
9454
9435
  }));
9455
9436
  };
9456
- var CanvasWrapper = styled__default.default.div(templateObject_1$n || (templateObject_1$n = __makeTemplateObject(["\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n"], ["\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n"])), function (props) {
9437
+ var CanvasWrapper = styled__default.default.div(templateObject_1$o || (templateObject_1$o = __makeTemplateObject(["\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n"], ["\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n"])), function (props) {
9457
9438
  return props.$maskColor;
9458
9439
  });
9459
9440
  var Canvas = styled__default.default.canvas(templateObject_2$j || (templateObject_2$j = __makeTemplateObject(["\n display: block;\n"], ["\n display: block;\n"])));
9460
- var templateObject_1$n, templateObject_2$j;
9441
+ var templateObject_1$o, templateObject_2$j;
9442
+
9443
+ var CameraFeedWrapper = styled__default.default.div(templateObject_1$n || (templateObject_1$n = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
9444
+ return props.$mode === 'snapToGuides' ? "display: flex;\n position: absolute;\n left: ".concat(props.$x, "px;\n top: ").concat(props.$y, "px;\n width: ").concat(props.$w, "px;\n height: ").concat(props.$h, "px;") : "";
9445
+ });
9446
+ var templateObject_1$n;
9461
9447
 
9462
9448
  var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
9463
9449
  var _b, _c, _d, _e, _f, _g, _h;
@@ -9898,6 +9884,23 @@ var ImageCol = styled__default.default.div(templateObject_5$5 || (templateObject
9898
9884
  var StyledButtonsRow$8 = styled__default.default(ButtonsRow$1)(templateObject_6$4 || (templateObject_6$4 = __makeTemplateObject(["\n margin-top: 32px;\n"], ["\n margin-top: 32px;\n"])));
9899
9885
  var templateObject_1$l, templateObject_2$h, templateObject_3$f, templateObject_4$9, templateObject_5$5, templateObject_6$4;
9900
9886
 
9887
+ function ScalingCameraFeed() {
9888
+ var _a = React.useContext(IdCaptureStateContext),
9889
+ captureState = _a.captureState,
9890
+ guideRectX = _a.guideRectX,
9891
+ guideRectY = _a.guideRectY,
9892
+ guideRectWidth = _a.guideRectWidth,
9893
+ guideRectHeight = _a.guideRectHeight;
9894
+ if (captureState === 'complete') return null;
9895
+ return /*#__PURE__*/React__namespace.default.createElement(CameraFeedWrapper, {
9896
+ "$x": guideRectX,
9897
+ "$y": guideRectY,
9898
+ "$w": guideRectWidth,
9899
+ "$h": guideRectHeight,
9900
+ "$mode": 'snapToGuides'
9901
+ }, /*#__PURE__*/React__namespace.default.createElement(CameraVideoTag, null));
9902
+ }
9903
+
9901
9904
  var IdCaptureWizard = function IdCaptureWizard(_a) {
9902
9905
  var _b, _c, _d, _e, _f, _g;
9903
9906
  var _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
@@ -10121,12 +10124,6 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
10121
10124
  })
10122
10125
  };
10123
10126
  var theme = styled.useTheme();
10124
- var _25 = useIdCaptureState()[0],
10125
- guideRectX = _25.guideRectX,
10126
- guideRectY = _25.guideRectY,
10127
- guideRectWidth = _25.guideRectWidth,
10128
- guideRectHeight = _25.guideRectHeight,
10129
- imageUrl = _25.imageUrl;
10130
10127
  var idCaptureAssets = assets[state.requestedDocumentType];
10131
10128
  var idCaptureVerbiage = idCaptureVerbiages[state.requestedDocumentType];
10132
10129
  React.useEffect(function () {
@@ -10180,9 +10177,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
10180
10177
  });
10181
10178
  });
10182
10179
  }, [dispatch]);
10183
- var _26 = React.useState(false),
10184
- progressStarted = _26[0],
10185
- setProgressStarted = _26[1];
10180
+ var _25 = React.useState(false),
10181
+ progressStarted = _25[0],
10182
+ setProgressStarted = _25[1];
10186
10183
  React.useEffect(function () {
10187
10184
  if (state.captureState === 'capturing') {
10188
10185
  setProgressStarted(false);
@@ -10205,17 +10202,10 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
10205
10202
  });
10206
10203
  }
10207
10204
  var requestedAction = state.captureState === 'requestingFlip' ? 'FLIP_ID' : state.requestedDocumentType === 'idCardBack' ? 'SHOW_ID_BACK' : state.requestedDocumentType === 'passport' ? 'SHOW_PASSPORT' : 'SHOW_ID_FRONT';
10205
+ var guidesStatus = !overlayDismissed ? 'disabled' : state.isGoodFrame ? 'capturing' : 'ready';
10208
10206
  return /*#__PURE__*/React__namespace.default.createElement(PageContainer, {
10209
10207
  className: "flex ".concat((_b = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _b !== void 0 ? _b : '')
10210
- }, state.captureState !== 'complete' && ( /*#__PURE__*/React__namespace.default.createElement(CameraFeedWrapper, {
10211
- "$x": guideRectX,
10212
- "$y": guideRectY,
10213
- "$w": guideRectWidth,
10214
- "$h": guideRectHeight,
10215
- "$mode": guideType === 'fit' ? 'snapToGuides' : 'fullscreen'
10216
- }, /*#__PURE__*/React__namespace.default.createElement(CameraVideoTag, {
10217
- className: classNames === null || classNames === void 0 ? void 0 : classNames.cameraFeed
10218
- }))), overlayDismissed && state.captureState === 'capturing' && ( /*#__PURE__*/React__namespace.default.createElement(IdCapture, {
10208
+ }, /*#__PURE__*/React__namespace.default.createElement(ScalingCameraFeed, null), overlayDismissed && state.captureState === 'capturing' && ( /*#__PURE__*/React__namespace.default.createElement(IdCapture, {
10219
10209
  requiredDocumentType: state.requestedDocumentType,
10220
10210
  thresholds: thresholds,
10221
10211
  onCapture: onCapture,
@@ -10227,7 +10217,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
10227
10217
  })), /*#__PURE__*/React__namespace.default.createElement(IdCaptureGuides, {
10228
10218
  key: "guides".concat(attempt),
10229
10219
  guideType: guideType,
10230
- status: state.isGoodFrame ? 'capturing' : 'ready',
10220
+ status: guidesStatus,
10231
10221
  progress: progressStarted && state.captureState === 'capturing' ? 1 : 0,
10232
10222
  portraitGuidesOnMobile: portraitGuidesOnMobile,
10233
10223
  requestedAction: requestedAction,
@@ -10236,10 +10226,10 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
10236
10226
  colors: colors,
10237
10227
  verbiage: idCaptureVerbiage,
10238
10228
  isBackToFront: state.allowIdCardBackToFrontCapture && 'idCardBack' in state.capturedDocuments
10239
- }), !((_d = (_c = theme.idCapture) === null || _c === void 0 ? void 0 : _c.capturePreview) === null || _d === void 0 ? void 0 : _d.disabled) && state.captureState === 'requestingFlip' && !separateIdCardCaptureSequence && imageUrl && ( /*#__PURE__*/React__namespace.default.createElement(IdCaptureImagePreview, {
10229
+ }), !((_d = (_c = theme.idCapture) === null || _c === void 0 ? void 0 : _c.capturePreview) === null || _d === void 0 ? void 0 : _d.disabled) && state.captureState === 'requestingFlip' && !separateIdCardCaptureSequence && state.imageUrl && ( /*#__PURE__*/React__namespace.default.createElement(IdCaptureImagePreview, {
10240
10230
  classNames: (_e = classNames.capture) === null || _e === void 0 ? void 0 : _e.imagePreview,
10241
10231
  text: (_f = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _f === void 0 ? void 0 : _f.processingIdCardText,
10242
- imageUrl: imageUrl
10232
+ imageUrl: state.imageUrl
10243
10233
  })), state.captureState !== 'complete' && ( /*#__PURE__*/React__namespace.default.createElement("div", {
10244
10234
  id: "idmission-above-guides-content"
10245
10235
  })), /*#__PURE__*/React__namespace.default.createElement(ExitCaptureButton, {