idmission-web-sdk 2.3.82 → 2.3.84

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.
@@ -211,7 +211,7 @@
211
211
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
212
  };
213
213
 
214
- var webSdkVersion = '2.3.82';
214
+ var webSdkVersion = '2.3.84';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -23566,6 +23566,13 @@
23566
23566
  var AcceptBtn$1 = styled(LoaderButton)(templateObject_2$b || (templateObject_2$b = __makeTemplateObject(["\n margin-left: auto;\n"], ["\n margin-left: auto;\n"])));
23567
23567
  var templateObject_1$c, templateObject_2$b;
23568
23568
 
23569
+ function isBlob(blobPart) {
23570
+ return typeof blobPart === 'object' && 'type' in blobPart;
23571
+ }
23572
+ function inferBlobType(blobPart) {
23573
+ return isBlob(blobPart) ? blobPart.type : undefined;
23574
+ }
23575
+
23569
23576
  var videoRecorder = null;
23570
23577
  var audioRecorder = null;
23571
23578
  var videoChunks = [];
@@ -23699,8 +23706,10 @@
23699
23706
  useVideoRecorderStore.getState().clearRecordedData();
23700
23707
  }, []);
23701
23708
  var processVideo = React.useCallback(function () {
23709
+ var _a;
23710
+ var inferredType = (_a = inferBlobType(videoChunks[0])) !== null && _a !== void 0 ? _a : 'video/mp4';
23702
23711
  var videoBlob = new Blob(videoChunks, {
23703
- type: 'video/mp4'
23712
+ type: inferredType
23704
23713
  });
23705
23714
  useVideoRecorderStore.setState({
23706
23715
  videoUrl: URL.createObjectURL(videoBlob),
@@ -23825,18 +23834,20 @@
23825
23834
  if (!signatureRecorder) return;
23826
23835
  signatureRecorder.stop();
23827
23836
  signatureRecorder.onstop = function () {
23837
+ var _a;
23838
+ var inferredType = (_a = inferBlobType(signatureChunks[0])) !== null && _a !== void 0 ? _a : 'video/mp4';
23828
23839
  var blob = new Blob(signatureChunks, {
23829
- type: 'video/mp4'
23840
+ type: inferredType
23830
23841
  });
23831
23842
  signatureChunks = [];
23832
23843
  signatureRecorder = null;
23833
23844
  if (!signatureData) return;
23834
- var _a = get(),
23835
- onSignatureVideoCaptured = _a.onSignatureVideoCaptured,
23836
- recordingStartedAt = _a.recordingStartedAt,
23837
- signatureStartedAt = _a.signatureStartedAt,
23838
- signatureEndedAt = _a.signatureEndedAt,
23839
- lastChunkReceivedAt = _a.lastChunkReceivedAt;
23845
+ var _b = get(),
23846
+ onSignatureVideoCaptured = _b.onSignatureVideoCaptured,
23847
+ recordingStartedAt = _b.recordingStartedAt,
23848
+ signatureStartedAt = _b.signatureStartedAt,
23849
+ signatureEndedAt = _b.signatureEndedAt,
23850
+ lastChunkReceivedAt = _b.lastChunkReceivedAt;
23840
23851
  var endMs = Math.min(signatureEndedAt !== null && signatureEndedAt !== void 0 ? signatureEndedAt : Infinity, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity);
23841
23852
  var signatureStartTimestamp = signatureStartedAt && recordingStartedAt ? formatTimestamp(Math.max(0, signatureStartedAt - recordingStartedAt - 500)) : undefined;
23842
23853
  var signatureEndTimestamp = endMs !== Infinity && recordingStartedAt ? formatTimestamp(Math.min(endMs - recordingStartedAt + 500, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity)) : undefined;
@@ -24189,14 +24200,11 @@
24189
24200
  onHeadTrackingPredictionMade = _o.onPredictionMade,
24190
24201
  startHeadTracking = _o.start,
24191
24202
  stopHeadTracking = _o.stop;
24192
- var _p = useVideoSignatureStore(useShallow(function (state) {
24193
- return {
24194
- clearRecordedData: state.clearRecordedData,
24195
- firstChunkReceivedAt: state.firstChunkReceivedAt
24196
- };
24197
- })),
24198
- clearRecordedData = _p.clearRecordedData,
24199
- firstChunkReceivedAt = _p.firstChunkReceivedAt;
24203
+ var firstChunkReceivedAt = useVideoSignatureStore(useShallow(function (state) {
24204
+ return {
24205
+ firstChunkReceivedAt: state.firstChunkReceivedAt
24206
+ };
24207
+ })).firstChunkReceivedAt;
24200
24208
  React.useEffect(function () {
24201
24209
  useVideoSignatureStore.setState({
24202
24210
  onSignatureVideoCaptured: onSignatureVideoCaptured
@@ -24215,15 +24223,15 @@
24215
24223
  var verbiage = useTranslations(rawVerbiage, {
24216
24224
  guidanceMessageText: 'Please sign the box below'
24217
24225
  });
24218
- var _q = React.useState(true),
24219
- headTrackingSatisfied = _q[0],
24220
- setHeadTrackingSatisfied = _q[1];
24221
- var _r = React.useState(null),
24222
- lastFace = _r[0],
24223
- setLastFace = _r[1];
24224
- var _s = React.useState(0),
24225
- numFramesWithoutFaces = _s[0],
24226
- setNumFramesWithoutFaces = _s[1];
24226
+ var _p = React.useState(true),
24227
+ headTrackingSatisfied = _p[0],
24228
+ setHeadTrackingSatisfied = _p[1];
24229
+ var _q = React.useState(null),
24230
+ lastFace = _q[0],
24231
+ setLastFace = _q[1];
24232
+ var _r = React.useState(0),
24233
+ numFramesWithoutFaces = _r[0],
24234
+ setNumFramesWithoutFaces = _r[1];
24227
24235
  onHeadTrackingPredictionMade(f(React.useCallback(function (_a) {
24228
24236
  var face = _a.face;
24229
24237
  if (headTrackingDisabled) return;
@@ -24238,12 +24246,12 @@
24238
24246
  return n + 1;
24239
24247
  });
24240
24248
  }, [headTrackingBoundaryPercentage, headTrackingBoundaryType, headTrackingDisabled, videoHeight, videoWidth]), 16));
24241
- var _t = useResizeObserver(),
24242
- ref = _t.ref,
24243
- _u = _t.width,
24244
- width = _u === void 0 ? 1 : _u,
24245
- _v = _t.height,
24246
- height = _v === void 0 ? 1 : _v;
24249
+ var _s = useResizeObserver(),
24250
+ ref = _s.ref,
24251
+ _t = _s.width,
24252
+ width = _t === void 0 ? 1 : _t,
24253
+ _u = _s.height,
24254
+ height = _u === void 0 ? 1 : _u;
24247
24255
  var debugScalingDetails = useDebugScalingDetails({
24248
24256
  enabled: debugMode,
24249
24257
  pageWidth: width,
@@ -24274,8 +24282,14 @@
24274
24282
  classNames: classNames.guides,
24275
24283
  verbiage: rawVerbiage.guides,
24276
24284
  onClearBtnClicked: restartVideoOnSignaturePadCleared ? function () {
24277
- return setTimeout(clearRecordedData, 100);
24278
- } : undefined
24285
+ return setTimeout(function () {
24286
+ return useVideoSignatureStore.getState().clearRecordedData();
24287
+ }, 100);
24288
+ } : function () {
24289
+ return useVideoSignatureStore.setState({
24290
+ signatureStartedAt: undefined
24291
+ });
24292
+ }
24279
24293
  }), debugMode && ( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ObjectDetectionDebugOverlayDiv, null, lastFace && ( /*#__PURE__*/React.createElement(SelfieCaptureFaceDebugBox, {
24280
24294
  face: lastFace,
24281
24295
  scaling: debugScalingDetails,