@ekyc_qoobiss/qbs-ect-cmp 3.6.35 → 3.6.37

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.
@@ -2023,6 +2023,7 @@ class FaceML5Detector {
2023
2023
  if (this.stream.facePose !== null) {
2024
2024
  await delay(3000);
2025
2025
  this.validFacePose = true;
2026
+ this.stream.autoCapturing();
2026
2027
  await this.drawFrame('green', true);
2027
2028
  }
2028
2029
  }
@@ -4558,7 +4559,7 @@ class Stream {
4558
4559
  this.faceML5Detector = FaceML5Detector.getInstance(this, state.device.isMobile);
4559
4560
  this.verificationMode = mode;
4560
4561
  }
4561
- static getInstance(mode) {
4562
+ static getNewInstance(mode) {
4562
4563
  if (!Stream.instance) {
4563
4564
  Stream.instance = new Stream(mode);
4564
4565
  }
@@ -4793,7 +4794,7 @@ const Camera = class {
4793
4794
  }
4794
4795
  startStream() {
4795
4796
  var captureMode = this.captureMode == 'tilt' ? VerificationMode.Tilt : VerificationMode.Full;
4796
- const stream = Stream.getInstance(captureMode);
4797
+ const stream = Stream.getNewInstance(captureMode);
4797
4798
  stream.updateHtmlElements(this.cameraVideo, this.cameraCanvas, this.component);
4798
4799
  if (this.captureMode == 'selfie') {
4799
4800
  stream.setFaceDetection(true);
@@ -5195,7 +5196,7 @@ const IdBackCapture = class {
5195
5196
  navigator.mediaDevices
5196
5197
  .getUserMedia(constraints)
5197
5198
  .then(stream => {
5198
- const superStream = Stream.getInstance(VerificationMode.Full);
5199
+ const superStream = Stream.getNewInstance(VerificationMode.Full);
5199
5200
  superStream.initStream(stream);
5200
5201
  })
5201
5202
  .catch(e => {
@@ -5206,7 +5207,7 @@ const IdBackCapture = class {
5206
5207
  }
5207
5208
  closeCamera() {
5208
5209
  if (Stream.instance) {
5209
- Stream.getInstance(VerificationMode.Full).dropStream();
5210
+ Stream.instance.dropStream();
5210
5211
  }
5211
5212
  }
5212
5213
  disconnectedCallback() {
@@ -5225,7 +5226,7 @@ const IdBackCapture = class {
5225
5226
  var loops = 0;
5226
5227
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
5227
5228
  this.demoVideo.loop = false;
5228
- while (loops < 5) {
5229
+ while (loops < 7) {
5229
5230
  this.demoVideo.play();
5230
5231
  await delay(this.translations.GlobalValues.VideoLenght);
5231
5232
  }
@@ -5235,8 +5236,13 @@ const IdBackCapture = class {
5235
5236
  if (this.captureTaken)
5236
5237
  return;
5237
5238
  this.captureTaken = true;
5238
- let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
5239
- this.photoIsReady(res);
5239
+ if (Stream.instance) {
5240
+ let res = await Stream.instance.takePhoto();
5241
+ this.photoIsReady(res);
5242
+ }
5243
+ else {
5244
+ this.eventTimeElapsed.emit();
5245
+ }
5240
5246
  await this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Finalized);
5241
5247
  }
5242
5248
  render() {
@@ -5307,7 +5313,7 @@ const IdCapture = class {
5307
5313
  navigator.mediaDevices
5308
5314
  .getUserMedia(constraints)
5309
5315
  .then(stream => {
5310
- const superStream = Stream.getInstance(VerificationMode.Full);
5316
+ const superStream = Stream.getNewInstance(VerificationMode.Full);
5311
5317
  superStream.initStream(stream);
5312
5318
  })
5313
5319
  .catch(e => {
@@ -5318,7 +5324,7 @@ const IdCapture = class {
5318
5324
  }
5319
5325
  closeCamera() {
5320
5326
  if (Stream.instance) {
5321
- Stream.getInstance(VerificationMode.Full).dropStream();
5327
+ Stream.instance.dropStream();
5322
5328
  }
5323
5329
  }
5324
5330
  disconnectedCallback() {
@@ -5331,8 +5337,13 @@ const IdCapture = class {
5331
5337
  if (this.captureTaken)
5332
5338
  return;
5333
5339
  this.captureTaken = true;
5334
- let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
5335
- this.photoIsReady(res);
5340
+ if (Stream.instance) {
5341
+ let res = await Stream.instance.takePhoto();
5342
+ this.photoIsReady(res);
5343
+ }
5344
+ else {
5345
+ this.eventTimeElapsed.emit();
5346
+ }
5336
5347
  await this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Finalized);
5337
5348
  }
5338
5349
  async verificationFinished() {
@@ -5345,7 +5356,7 @@ const IdCapture = class {
5345
5356
  var loops = 0;
5346
5357
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
5347
5358
  this.demoVideo.loop = false;
5348
- while (loops < 5) {
5359
+ while (loops < 7) {
5349
5360
  this.demoVideo.play();
5350
5361
  await delay(this.translations.GlobalValues.VideoLenght);
5351
5362
  }
@@ -5424,7 +5435,7 @@ const IdTilt = class {
5424
5435
  navigator.mediaDevices
5425
5436
  .getUserMedia(constraints)
5426
5437
  .then(stream => {
5427
- const superStream = Stream.getInstance(VerificationMode.Full);
5438
+ const superStream = Stream.getNewInstance(VerificationMode.Tilt);
5428
5439
  superStream.initStream(stream);
5429
5440
  })
5430
5441
  .catch(e => {
@@ -5435,7 +5446,7 @@ const IdTilt = class {
5435
5446
  }
5436
5447
  closeCamera() {
5437
5448
  if (Stream.instance) {
5438
- Stream.getInstance(VerificationMode.Full).dropStream();
5449
+ Stream.instance.dropStream();
5439
5450
  }
5440
5451
  }
5441
5452
  disconnectedCallback() {
@@ -5448,8 +5459,13 @@ const IdTilt = class {
5448
5459
  if (this.captureTaken)
5449
5460
  return;
5450
5461
  this.captureTaken = true;
5451
- let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
5452
- this.photoIsReady(res);
5462
+ if (Stream.instance) {
5463
+ let res = await Stream.instance.takePhoto();
5464
+ this.photoIsReady(res);
5465
+ }
5466
+ else {
5467
+ this.eventTimeElapsed.emit();
5468
+ }
5453
5469
  await this.baseComponent.logStep(FlowSteps.CiTilt, FlowMoments.Finalized);
5454
5470
  }
5455
5471
  async verificationFinished() {
@@ -5462,7 +5478,7 @@ const IdTilt = class {
5462
5478
  var loops = 0;
5463
5479
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
5464
5480
  this.demoVideo.loop = false;
5465
- while (loops < 5) {
5481
+ while (loops < 7) {
5466
5482
  this.demoVideo.play();
5467
5483
  await delay(this.translations.GlobalValues.VideoLenght);
5468
5484
  }
@@ -5555,7 +5571,7 @@ function v4(options, buf, offset) {
5555
5571
  }
5556
5572
 
5557
5573
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5558
- const version$1 = "3.6.35";
5574
+ const version$1 = "3.6.37";
5559
5575
  const description = "Person Identification Component";
5560
5576
  const main = "./dist/index.cjs.js";
5561
5577
  const module = "./dist/index.js";
@@ -8954,6 +8970,9 @@ const ProcessId = class {
8954
8970
  }
8955
8971
  componentWillLoad() {
8956
8972
  this.captureRetryCount = 0;
8973
+ this.initFlow();
8974
+ }
8975
+ initFlow() {
8957
8976
  this.flow = {
8958
8977
  front: {
8959
8978
  photoDone: false,
@@ -9055,11 +9074,11 @@ const ProcessId = class {
9055
9074
  let frontRec = new File([idRecording], this.flow.front.recName + mimeType.extension, { type: mimeType.type });
9056
9075
  this.flow.front.recordingDone = await this.uploadRecording(this.flow.front.recType, frontRec);
9057
9076
  }
9058
- else if (this.captureStep == IdCaptureFlowStatus.IdBack) {
9077
+ else if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack) {
9059
9078
  let backRec = new File([idRecording], this.flow.back.recName + mimeType.extension, { type: mimeType.type });
9060
9079
  this.flow.back.recordingDone = await this.uploadRecording(this.flow.back.recType, backRec);
9061
9080
  }
9062
- else if (this.captureStep == IdCaptureFlowStatus.Tilt) {
9081
+ else if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt) {
9063
9082
  let tiltRec = new File([idRecording], this.flow.tilt.recName + mimeType.extension, { type: mimeType.type });
9064
9083
  this.flow.tilt.recordingDone = await this.uploadRecording(this.flow.tilt.recType, tiltRec);
9065
9084
  }
@@ -9104,17 +9123,19 @@ const ProcessId = class {
9104
9123
  restart = true;
9105
9124
  }
9106
9125
  if (restart) {
9107
- this.captureStep = IdCaptureFlowStatus.IdFront;
9126
+ this.initFlow();
9127
+ this.showInvalid = true;
9128
+ return;
9108
9129
  }
9109
- if (this.captureStep == IdCaptureFlowStatus.IdFront || restart) {
9130
+ if (this.captureStep == IdCaptureFlowStatus.IdFront) {
9110
9131
  this.flow.front.photoDone = false;
9111
9132
  this.flow.front.recordingDone = false;
9112
9133
  }
9113
- if (this.captureStep == IdCaptureFlowStatus.IdBack || restart) {
9134
+ if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack) {
9114
9135
  this.flow.back.photoDone = false;
9115
9136
  this.flow.back.recordingDone = false;
9116
9137
  }
9117
- if (this.captureStep == IdCaptureFlowStatus.Tilt || restart) {
9138
+ if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt) {
9118
9139
  this.flow.tilt.photoDone = true;
9119
9140
  this.flow.tilt.recordingDone = false;
9120
9141
  }
@@ -9137,7 +9158,7 @@ const ProcessId = class {
9137
9158
  return;
9138
9159
  }
9139
9160
  }
9140
- if (this.captureStep == IdCaptureFlowStatus.IdBack && state.hasIdBack) {
9161
+ if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack && state.hasIdBack) {
9141
9162
  if (this.flow.back.photoDone && this.flow.back.recordingDone) {
9142
9163
  if (state.hasIdTilt) {
9143
9164
  this.captureStep = IdCaptureFlowStatus.Tilt;
@@ -9150,7 +9171,7 @@ const ProcessId = class {
9150
9171
  return;
9151
9172
  }
9152
9173
  }
9153
- if (this.captureStep == IdCaptureFlowStatus.Tilt && state.hasIdTilt) {
9174
+ if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt && state.hasIdTilt) {
9154
9175
  if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
9155
9176
  this.captureStep = IdCaptureFlowStatus.End;
9156
9177
  }
@@ -9263,7 +9284,7 @@ const SelfieCapture = class {
9263
9284
  navigator.mediaDevices
9264
9285
  .getUserMedia(constraints)
9265
9286
  .then(stream => {
9266
- const superStream = Stream.getInstance(VerificationMode.Full);
9287
+ const superStream = Stream.getNewInstance(VerificationMode.Full);
9267
9288
  superStream.initStream(stream);
9268
9289
  })
9269
9290
  .catch(e => {
@@ -9274,7 +9295,7 @@ const SelfieCapture = class {
9274
9295
  }
9275
9296
  closeCamera() {
9276
9297
  if (Stream.instance) {
9277
- Stream.getInstance(VerificationMode.Full).dropStream();
9298
+ Stream.instance.dropStream();
9278
9299
  }
9279
9300
  }
9280
9301
  disconnectedCallback() {
@@ -9286,8 +9307,13 @@ const SelfieCapture = class {
9286
9307
  if (this.captureTaken)
9287
9308
  return;
9288
9309
  this.captureTaken = true;
9289
- let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
9290
- this.photoIsReady(res);
9310
+ if (Stream.instance) {
9311
+ let res = await Stream.instance.takePhoto();
9312
+ this.photoIsReady(res);
9313
+ }
9314
+ else {
9315
+ this.eventTimeElapsed.emit();
9316
+ }
9291
9317
  await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Finalized);
9292
9318
  }
9293
9319
  async verificationFinished() {
@@ -9300,7 +9326,7 @@ const SelfieCapture = class {
9300
9326
  var loops = 0;
9301
9327
  this.demoVideo.src = this.uploadingLink;
9302
9328
  this.demoVideo.loop = false;
9303
- while (loops < 5) {
9329
+ while (loops < 7) {
9304
9330
  this.demoVideo.play();
9305
9331
  await delay(this.translations.GlobalValues.VideoLenght);
9306
9332
  }
@@ -9372,7 +9398,7 @@ const SelfieTilt = class {
9372
9398
  }
9373
9399
  }
9374
9400
  async componentDidLoad() {
9375
- this.mainStream = Stream.getInstance(VerificationMode.Tilt);
9401
+ this.mainStream = Stream.getNewInstance(VerificationMode.Tilt);
9376
9402
  await this.baseComponent.logStep(FlowSteps.SelfieTilt, FlowMoments.Initialized);
9377
9403
  this.titleMesage = this.translations.SelfieCaptureValues.FacePoseMapping[this.mainStream.facePose];
9378
9404
  this.demoEnded = false;
@@ -9412,7 +9438,7 @@ const SelfieTilt = class {
9412
9438
  this.captureTaken = true;
9413
9439
  let res = this.mainStream.takePhoto();
9414
9440
  this.photoIsReady(res);
9415
- await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Finalized);
9441
+ await this.baseComponent.logStep(FlowSteps.SelfieTilt, FlowMoments.Finalized);
9416
9442
  }
9417
9443
  async verificationFinished() {
9418
9444
  if (this.verified)
@@ -9424,7 +9450,7 @@ const SelfieTilt = class {
9424
9450
  var loops = 0;
9425
9451
  this.demoVideo.src = this.uploadingLink;
9426
9452
  this.demoVideo.loop = false;
9427
- while (loops < 5) {
9453
+ while (loops < 7) {
9428
9454
  this.demoVideo.play();
9429
9455
  await delay(this.translations.GlobalValues.VideoLenght);
9430
9456
  }