idmission-web-sdk 2.3.99 → 2.3.101

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.
package/dist/sdk2.esm.js CHANGED
@@ -16,7 +16,6 @@ import { devtools } from 'zustand/middleware';
16
16
  import { useShallow } from 'zustand/react/shallow';
17
17
  import cn from 'clsx';
18
18
  import SignatureCanvas from 'react-signature-canvas';
19
- import { mediaInfoFactory } from 'mediainfo.js';
20
19
  import { renderToString } from 'react-dom/server';
21
20
 
22
21
  /******************************************************************************
@@ -206,7 +205,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
206
205
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
207
206
  };
208
207
 
209
- var webSdkVersion = '2.3.99';
208
+ var webSdkVersion = '2.3.101';
210
209
 
211
210
  function getPlatform() {
212
211
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -14296,23 +14295,10 @@ function inferBlobType(blobPart) {
14296
14295
  return t.length > 0 ? t : undefined;
14297
14296
  }
14298
14297
 
14299
- function makeReadChunk(file) {
14300
- var _this = this;
14301
- return function (chunkSize, offset) {
14302
- return __awaiter(_this, void 0, void 0, function () {
14303
- var _a;
14304
- return __generator(this, function (_b) {
14305
- switch (_b.label) {
14306
- case 0:
14307
- _a = Uint8Array.bind;
14308
- return [4 /*yield*/, file.slice(offset, offset + chunkSize).arrayBuffer()];
14309
- case 1:
14310
- return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _b.sent()]))()];
14311
- }
14312
- });
14313
- });
14314
- };
14315
- }
14298
+ // function makeReadChunk(file: File | Blob): ReadChunkFunc {
14299
+ // return async (chunkSize: number, offset: number) =>
14300
+ // new Uint8Array(await file.slice(offset, offset + chunkSize).arrayBuffer())
14301
+ // }
14316
14302
  var signatureRecorder = null;
14317
14303
  var signatureChunks = [];
14318
14304
  var videoSignatureInitialState = {
@@ -14393,42 +14379,39 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
14393
14379
  signatureRecorder.stop();
14394
14380
  signatureRecorder.onstop = function () {
14395
14381
  return __awaiter(void 0, void 0, void 0, function () {
14396
- var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt, mediaInfo;
14397
- var _b;
14398
- return __generator(this, function (_c) {
14399
- switch (_c.label) {
14400
- case 0:
14401
- recordingStoppedAt = performance.now();
14402
- set({
14403
- recordingStoppedAt: recordingStoppedAt
14404
- });
14405
- inferredType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
14406
- blob = new Blob(signatureChunks, {
14407
- type: inferredType
14408
- });
14409
- signatureChunks = [];
14410
- signatureRecorder = null;
14411
- if (!signatureData) return [2 /*return*/];
14412
- _a = get(), onSignatureVideoCaptured = _a.onSignatureVideoCaptured, recordingStartRequestedAt = _a.recordingStartRequestedAt, recordingStartedAt = _a.recordingStartedAt, firstChunkReceivedAt = _a.firstChunkReceivedAt, signatureStartedAt = _a.signatureStartedAt, signatureEndedAt = _a.signatureEndedAt, recordingStopRequestedAt = _a.recordingStopRequestedAt, lastChunkReceivedAt = _a.lastChunkReceivedAt;
14413
- return [4 /*yield*/, (_b = get().mediaInfo) === null || _b === void 0 ? void 0 : _b.analyzeData(blob.size, makeReadChunk(blob))];
14414
- case 1:
14415
- mediaInfo = _c.sent();
14416
- onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
14417
- mediaInfo: mediaInfo,
14418
- mimeType: inferredType,
14419
- timingData: {
14420
- recordingStartRequestedAt: recordingStartRequestedAt,
14421
- recordingStartedAt: recordingStartedAt,
14422
- firstChunkReceivedAt: firstChunkReceivedAt,
14423
- signatureStartedAt: signatureStartedAt,
14424
- signatureEndedAt: signatureEndedAt,
14425
- recordingStopRequestedAt: recordingStopRequestedAt,
14426
- recordingStoppedAt: recordingStoppedAt,
14427
- lastChunkReceivedAt: lastChunkReceivedAt
14428
- }
14429
- });
14430
- return [2 /*return*/];
14431
- }
14382
+ var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt;
14383
+ return __generator(this, function (_b) {
14384
+ recordingStoppedAt = performance.now();
14385
+ set({
14386
+ recordingStoppedAt: recordingStoppedAt
14387
+ });
14388
+ inferredType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
14389
+ blob = new Blob(signatureChunks, {
14390
+ type: inferredType
14391
+ });
14392
+ signatureChunks = [];
14393
+ signatureRecorder = null;
14394
+ if (!signatureData) return [2 /*return*/];
14395
+ _a = get(), onSignatureVideoCaptured = _a.onSignatureVideoCaptured, recordingStartRequestedAt = _a.recordingStartRequestedAt, recordingStartedAt = _a.recordingStartedAt, firstChunkReceivedAt = _a.firstChunkReceivedAt, signatureStartedAt = _a.signatureStartedAt, signatureEndedAt = _a.signatureEndedAt, recordingStopRequestedAt = _a.recordingStopRequestedAt, lastChunkReceivedAt = _a.lastChunkReceivedAt;
14396
+ // const mediaInfo = await get().mediaInfo?.analyzeData(
14397
+ // blob.size,
14398
+ // makeReadChunk(blob),
14399
+ // )
14400
+ onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
14401
+ // mediaInfo,
14402
+ mimeType: inferredType,
14403
+ timingData: {
14404
+ recordingStartRequestedAt: recordingStartRequestedAt,
14405
+ recordingStartedAt: recordingStartedAt,
14406
+ firstChunkReceivedAt: firstChunkReceivedAt,
14407
+ signatureStartedAt: signatureStartedAt,
14408
+ signatureEndedAt: signatureEndedAt,
14409
+ recordingStopRequestedAt: recordingStopRequestedAt,
14410
+ recordingStoppedAt: recordingStoppedAt,
14411
+ lastChunkReceivedAt: lastChunkReceivedAt
14412
+ }
14413
+ });
14414
+ return [2 /*return*/];
14432
14415
  });
14433
14416
  });
14434
14417
  };
@@ -14492,27 +14475,50 @@ function VideoSignatureContextProvider(_a) {
14492
14475
  var frameCheckCanvas = useRef(null);
14493
14476
  useEffect(function () {
14494
14477
  if (!captureMediaInfo) return;
14495
- mediaInfoFactory({
14496
- format: 'object',
14497
- full: true,
14498
- locateFile: function locateFile(filename) {
14499
- return "".concat(DEFAULT_CDN_URL, "/").concat(filename);
14500
- }
14501
- }).then(function (mediaInfo) {
14502
- useVideoSignatureStore.setState({
14503
- mediaInfo: mediaInfo
14478
+ // Use dynamic import to avoid build-time WASM loading issues
14479
+ var loadMediaInfo = function loadMediaInfo() {
14480
+ return __awaiter(_this, void 0, void 0, function () {
14481
+ var mediaInfoFactory, e_1;
14482
+ return __generator(this, function (_a) {
14483
+ switch (_a.label) {
14484
+ case 0:
14485
+ _a.trys.push([0, 3,, 4]);
14486
+ return [4 /*yield*/, import('mediainfo.js')
14487
+ // const mediaInfo =
14488
+ ];
14489
+ case 1:
14490
+ mediaInfoFactory = _a.sent().mediaInfoFactory;
14491
+ // const mediaInfo =
14492
+ return [4 /*yield*/, mediaInfoFactory({
14493
+ format: 'object',
14494
+ full: true,
14495
+ locateFile: function locateFile(filename) {
14496
+ return "".concat(DEFAULT_CDN_URL, "/").concat(filename);
14497
+ }
14498
+ })
14499
+ // useVideoSignatureStore.setState({ mediaInfo })
14500
+ ];
14501
+ case 2:
14502
+ // const mediaInfo =
14503
+ _a.sent();
14504
+ return [3 /*break*/, 4];
14505
+ case 3:
14506
+ e_1 = _a.sent();
14507
+ warn('error loading mediaInfo', e_1);
14508
+ return [3 /*break*/, 4];
14509
+ case 4:
14510
+ return [2 /*return*/];
14511
+ }
14512
+ });
14504
14513
  });
14505
- })["catch"](function (e) {
14506
- warn('error loading mediaInfo', e);
14507
- });
14514
+ };
14515
+ loadMediaInfo();
14508
14516
  return function () {
14509
- var mediaInfo = useVideoSignatureStore.getState().mediaInfo;
14510
- if (mediaInfo) {
14511
- mediaInfo.close();
14512
- useVideoSignatureStore.setState({
14513
- mediaInfo: undefined
14514
- });
14515
- }
14517
+ // const mediaInfo = useVideoSignatureStore.getState().mediaInfo
14518
+ // if (mediaInfo) {
14519
+ // mediaInfo.close()
14520
+ // useVideoSignatureStore.setState({ mediaInfo: undefined })
14521
+ // }
14516
14522
  };
14517
14523
  }, [captureMediaInfo]);
14518
14524
  var signaturePadEmpty = useVideoSignatureStore().signaturePadEmpty;
@@ -19466,6 +19472,8 @@ var SignatureKYC = function SignatureKYC(_a) {
19466
19472
  documentServiceUrl = _a.documentServiceUrl,
19467
19473
  sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
19468
19474
  useDocumentServiceForLivenessChecks = _a.useDocumentServiceForLivenessChecks,
19475
+ _c = _a.captureMediaInfo,
19476
+ captureMediaInfo = _c === void 0 ? false : _c,
19469
19477
  onLoadingStarted = _a.onLoadingStarted,
19470
19478
  onLoadingProgress = _a.onLoadingProgress,
19471
19479
  onLoadingCompleted = _a.onLoadingCompleted,
@@ -19485,48 +19493,48 @@ var SignatureKYC = function SignatureKYC(_a) {
19485
19493
  onCameraAccessDenied = _a.onCameraAccessDenied,
19486
19494
  onCameraTamperingDetected = _a.onCameraTamperingDetected,
19487
19495
  onLoadingOverlayDismissed = _a.onLoadingOverlayDismissed,
19488
- _c = _a.loadingOverlayMode,
19489
- loadingOverlayMode = _c === void 0 ? 'default' : _c,
19496
+ _d = _a.loadingOverlayMode,
19497
+ loadingOverlayMode = _d === void 0 ? 'default' : _d,
19490
19498
  customOverlayContent = _a.customOverlayContent,
19491
- _d = _a.skipSuccessScreen,
19492
- skipSuccessScreen = _d === void 0 ? false : _d,
19493
- _e = _a.captureAudio,
19494
- captureAudio = _e === void 0 ? false : _e,
19499
+ _e = _a.skipSuccessScreen,
19500
+ skipSuccessScreen = _e === void 0 ? false : _e,
19501
+ _f = _a.captureAudio,
19502
+ captureAudio = _f === void 0 ? false : _f,
19495
19503
  idCardForFaceMatch = _a.idCardForFaceMatch,
19496
- _f = _a.minSignaturePadPoints,
19497
- minSignaturePadPoints = _f === void 0 ? DEFAULT_MIN_SIGNATURE_PAD_POINTS : _f,
19498
- _g = _a.headTrackingDisabled,
19499
- headTrackingDisabled = _g === void 0 ? false : _g,
19500
- _h = _a.headTrackingBoundaryPercentage,
19501
- headTrackingBoundaryPercentage = _h === void 0 ? DEFAULT_HEAD_TRACKING_BOUNDARY_PERCENTAGE : _h,
19502
- _j = _a.headTrackingBoundaryType,
19503
- headTrackingBoundaryType = _j === void 0 ? DEFAULT_HEAD_TRACKING_BOUNDARY_TYPE : _j,
19504
- _k = _a.modelLoadTimeoutMs,
19505
- modelLoadTimeoutMs = _k === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _k,
19506
- _l = _a.allowSignatureAfterLivenessCheckFailure,
19507
- allowSignatureAfterLivenessCheckFailure = _l === void 0 ? false : _l,
19508
- _m = _a.restartVideoOnSignaturePadCleared,
19509
- restartVideoOnSignaturePadCleared = _m === void 0 ? true : _m,
19504
+ _g = _a.minSignaturePadPoints,
19505
+ minSignaturePadPoints = _g === void 0 ? DEFAULT_MIN_SIGNATURE_PAD_POINTS : _g,
19506
+ _h = _a.headTrackingDisabled,
19507
+ headTrackingDisabled = _h === void 0 ? false : _h,
19508
+ _j = _a.headTrackingBoundaryPercentage,
19509
+ headTrackingBoundaryPercentage = _j === void 0 ? DEFAULT_HEAD_TRACKING_BOUNDARY_PERCENTAGE : _j,
19510
+ _k = _a.headTrackingBoundaryType,
19511
+ headTrackingBoundaryType = _k === void 0 ? DEFAULT_HEAD_TRACKING_BOUNDARY_TYPE : _k,
19512
+ _l = _a.modelLoadTimeoutMs,
19513
+ modelLoadTimeoutMs = _l === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _l,
19514
+ _m = _a.allowSignatureAfterLivenessCheckFailure,
19515
+ allowSignatureAfterLivenessCheckFailure = _m === void 0 ? false : _m,
19516
+ _o = _a.restartVideoOnSignaturePadCleared,
19517
+ restartVideoOnSignaturePadCleared = _o === void 0 ? true : _o,
19510
19518
  faceLivenessProps = _a.faceLivenessProps,
19511
- _o = _a.skipLivenessValidation,
19512
- skipLivenessValidation = _o === void 0 ? false : _o,
19513
- _p = _a.allowManualSelfieCaptureOnLoadingError,
19514
- allowManualSelfieCaptureOnLoadingError = _p === void 0 ? false : _p,
19519
+ _p = _a.skipLivenessValidation,
19520
+ skipLivenessValidation = _p === void 0 ? false : _p,
19521
+ _q = _a.allowManualSelfieCaptureOnLoadingError,
19522
+ allowManualSelfieCaptureOnLoadingError = _q === void 0 ? false : _q,
19515
19523
  guidesComponent = _a.guidesComponent,
19516
- _q = _a.showFaceGuideThenSignaturePad,
19517
- showFaceGuideThenSignaturePad = _q === void 0 ? false : _q,
19524
+ _r = _a.showFaceGuideThenSignaturePad,
19525
+ showFaceGuideThenSignaturePad = _r === void 0 ? false : _r,
19518
19526
  minCaptureBrightnessThreshold = _a.minCaptureBrightnessThreshold,
19519
19527
  minCaptureRangeThreshold = _a.minCaptureRangeThreshold,
19520
19528
  minCaptureVarianceThreshold = _a.minCaptureVarianceThreshold,
19521
- _r = _a.theme,
19522
- theme = _r === void 0 ? 'default' : _r,
19529
+ _s = _a.theme,
19530
+ theme = _s === void 0 ? 'default' : _s,
19523
19531
  classNames = _a.classNames,
19524
19532
  colors = _a.colors,
19525
19533
  verbiage = _a.verbiage,
19526
19534
  geolocationEnabled = _a.geolocationEnabled,
19527
19535
  geolocationRequired = _a.geolocationRequired,
19528
- _s = _a.debugMode,
19529
- debugMode = _s === void 0 ? false : _s;
19536
+ _t = _a.debugMode,
19537
+ debugMode = _t === void 0 ? false : _t;
19530
19538
  useLanguage(lang);
19531
19539
  useDebugLogging(debugMode);
19532
19540
  return /*#__PURE__*/React__default.createElement(AuthProvider, {
@@ -19576,6 +19584,7 @@ var SignatureKYC = function SignatureKYC(_a) {
19576
19584
  loadingOverlayMode: loadingOverlayMode,
19577
19585
  skipSuccessScreen: skipSuccessScreen,
19578
19586
  captureAudio: captureAudio,
19587
+ captureMediaInfo: captureMediaInfo,
19579
19588
  minSignaturePadPoints: minSignaturePadPoints,
19580
19589
  headTrackingDisabled: headTrackingDisabled,
19581
19590
  headTrackingBoundaryPercentage: headTrackingBoundaryPercentage,
@@ -19598,7 +19607,7 @@ var SignatureKYC = function SignatureKYC(_a) {
19598
19607
  onModelError: onModelError,
19599
19608
  onUserCancel: onUserCancel
19600
19609
  };
19601
- }, [onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onSelfieCaptured, customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, minSignaturePadPoints, headTrackingDisabled, headTrackingBoundaryPercentage, headTrackingBoundaryType, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, restartVideoOnSignaturePadCleared, skipLivenessValidation, allowManualSelfieCaptureOnLoadingError, guidesComponent, showFaceGuideThenSignaturePad, minCaptureBrightnessThreshold, minCaptureRangeThreshold, minCaptureVarianceThreshold, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
19610
+ }, [onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onSelfieCaptured, customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, captureMediaInfo, minSignaturePadPoints, headTrackingDisabled, headTrackingBoundaryPercentage, headTrackingBoundaryType, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, restartVideoOnSignaturePadCleared, skipLivenessValidation, allowManualSelfieCaptureOnLoadingError, guidesComponent, showFaceGuideThenSignaturePad, minCaptureBrightnessThreshold, minCaptureRangeThreshold, minCaptureVarianceThreshold, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
19602
19611
  })))));
19603
19612
  };
19604
19613