idmission-web-sdk 2.3.100 → 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
@@ -205,7 +205,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
205
205
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
206
206
  };
207
207
 
208
- var webSdkVersion = '2.3.100';
208
+ var webSdkVersion = '2.3.101';
209
209
 
210
210
  function getPlatform() {
211
211
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -14295,23 +14295,10 @@ function inferBlobType(blobPart) {
14295
14295
  return t.length > 0 ? t : undefined;
14296
14296
  }
14297
14297
 
14298
- function makeReadChunk(file) {
14299
- var _this = this;
14300
- return function (chunkSize, offset) {
14301
- return __awaiter(_this, void 0, void 0, function () {
14302
- var _a;
14303
- return __generator(this, function (_b) {
14304
- switch (_b.label) {
14305
- case 0:
14306
- _a = Uint8Array.bind;
14307
- return [4 /*yield*/, file.slice(offset, offset + chunkSize).arrayBuffer()];
14308
- case 1:
14309
- return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _b.sent()]))()];
14310
- }
14311
- });
14312
- });
14313
- };
14314
- }
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
+ // }
14315
14302
  var signatureRecorder = null;
14316
14303
  var signatureChunks = [];
14317
14304
  var videoSignatureInitialState = {
@@ -14392,42 +14379,39 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
14392
14379
  signatureRecorder.stop();
14393
14380
  signatureRecorder.onstop = function () {
14394
14381
  return __awaiter(void 0, void 0, void 0, function () {
14395
- var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt, mediaInfo;
14396
- var _b;
14397
- return __generator(this, function (_c) {
14398
- switch (_c.label) {
14399
- case 0:
14400
- recordingStoppedAt = performance.now();
14401
- set({
14402
- recordingStoppedAt: recordingStoppedAt
14403
- });
14404
- inferredType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
14405
- blob = new Blob(signatureChunks, {
14406
- type: inferredType
14407
- });
14408
- signatureChunks = [];
14409
- signatureRecorder = null;
14410
- if (!signatureData) return [2 /*return*/];
14411
- _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;
14412
- return [4 /*yield*/, (_b = get().mediaInfo) === null || _b === void 0 ? void 0 : _b.analyzeData(blob.size, makeReadChunk(blob))];
14413
- case 1:
14414
- mediaInfo = _c.sent();
14415
- onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
14416
- mediaInfo: mediaInfo,
14417
- mimeType: inferredType,
14418
- timingData: {
14419
- recordingStartRequestedAt: recordingStartRequestedAt,
14420
- recordingStartedAt: recordingStartedAt,
14421
- firstChunkReceivedAt: firstChunkReceivedAt,
14422
- signatureStartedAt: signatureStartedAt,
14423
- signatureEndedAt: signatureEndedAt,
14424
- recordingStopRequestedAt: recordingStopRequestedAt,
14425
- recordingStoppedAt: recordingStoppedAt,
14426
- lastChunkReceivedAt: lastChunkReceivedAt
14427
- }
14428
- });
14429
- return [2 /*return*/];
14430
- }
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*/];
14431
14415
  });
14432
14416
  });
14433
14417
  };
@@ -14494,53 +14478,35 @@ function VideoSignatureContextProvider(_a) {
14494
14478
  // Use dynamic import to avoid build-time WASM loading issues
14495
14479
  var loadMediaInfo = function loadMediaInfo() {
14496
14480
  return __awaiter(_this, void 0, void 0, function () {
14497
- var mediaInfoFactory, mediaInfo, e_1, mediaInfoFactory, mediaInfo, fallbackError_1;
14481
+ var mediaInfoFactory, e_1;
14498
14482
  return __generator(this, function (_a) {
14499
14483
  switch (_a.label) {
14500
14484
  case 0:
14501
- _a.trys.push([0, 3,, 9]);
14502
- return [4 /*yield*/, import('mediainfo.js')];
14485
+ _a.trys.push([0, 3,, 4]);
14486
+ return [4 /*yield*/, import('mediainfo.js')
14487
+ // const mediaInfo =
14488
+ ];
14503
14489
  case 1:
14504
14490
  mediaInfoFactory = _a.sent().mediaInfoFactory;
14491
+ // const mediaInfo =
14505
14492
  return [4 /*yield*/, mediaInfoFactory({
14506
14493
  format: 'object',
14507
14494
  full: true,
14508
14495
  locateFile: function locateFile(filename) {
14509
14496
  return "".concat(DEFAULT_CDN_URL, "/").concat(filename);
14510
14497
  }
14511
- })];
14498
+ })
14499
+ // useVideoSignatureStore.setState({ mediaInfo })
14500
+ ];
14512
14501
  case 2:
14513
- mediaInfo = _a.sent();
14514
- useVideoSignatureStore.setState({
14515
- mediaInfo: mediaInfo
14516
- });
14517
- return [3 /*break*/, 9];
14502
+ // const mediaInfo =
14503
+ _a.sent();
14504
+ return [3 /*break*/, 4];
14518
14505
  case 3:
14519
14506
  e_1 = _a.sent();
14520
14507
  warn('error loading mediaInfo', e_1);
14521
- _a.label = 4;
14508
+ return [3 /*break*/, 4];
14522
14509
  case 4:
14523
- _a.trys.push([4, 7,, 8]);
14524
- return [4 /*yield*/, import('mediainfo.js')];
14525
- case 5:
14526
- mediaInfoFactory = _a.sent().mediaInfoFactory;
14527
- return [4 /*yield*/, mediaInfoFactory({
14528
- format: 'object',
14529
- full: true
14530
- })];
14531
- case 6:
14532
- mediaInfo = _a.sent();
14533
- useVideoSignatureStore.setState({
14534
- mediaInfo: mediaInfo
14535
- });
14536
- return [3 /*break*/, 8];
14537
- case 7:
14538
- fallbackError_1 = _a.sent();
14539
- warn('fallback mediaInfo loading also failed', fallbackError_1);
14540
- return [3 /*break*/, 8];
14541
- case 8:
14542
- return [3 /*break*/, 9];
14543
- case 9:
14544
14510
  return [2 /*return*/];
14545
14511
  }
14546
14512
  });
@@ -14548,13 +14514,11 @@ function VideoSignatureContextProvider(_a) {
14548
14514
  };
14549
14515
  loadMediaInfo();
14550
14516
  return function () {
14551
- var mediaInfo = useVideoSignatureStore.getState().mediaInfo;
14552
- if (mediaInfo) {
14553
- mediaInfo.close();
14554
- useVideoSignatureStore.setState({
14555
- mediaInfo: undefined
14556
- });
14557
- }
14517
+ // const mediaInfo = useVideoSignatureStore.getState().mediaInfo
14518
+ // if (mediaInfo) {
14519
+ // mediaInfo.close()
14520
+ // useVideoSignatureStore.setState({ mediaInfo: undefined })
14521
+ // }
14558
14522
  };
14559
14523
  }, [captureMediaInfo]);
14560
14524
  var signaturePadEmpty = useVideoSignatureStore().signaturePadEmpty;