@ekyc_qoobiss/qbs-ect-cmp 3.6.75 → 3.6.77
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/cjs/agreement-check_18.cjs.entry.js +104 -135
- package/dist/collection/components/common/id-capture/id-capture.js +11 -17
- package/dist/collection/components/flow/process-id/process-id.js +2 -13
- package/dist/collection/components/flow/user-liveness/user-liveness.js +2 -13
- package/dist/collection/helpers/Stream.js +14 -16
- package/dist/collection/libs/IDML5Detector/IDML5Detector.js +3 -8
- package/dist/esm/agreement-check_18.entry.js +104 -135
- package/dist/qbs-ect-cmp/{p-f5cae974.entry.js → p-66a8b394.entry.js} +1 -1
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/common/id-capture/id-capture.d.ts +0 -2
- package/dist/types/helpers/Stream.d.ts +0 -1
- package/dist/types/libs/IDML5Detector/IDML5Detector.d.ts +1 -3
- package/package.json +1 -1
|
@@ -5,7 +5,6 @@ import { FacePosePick } from '../libs/FaceML5Detector/FacePose';
|
|
|
5
5
|
import { addExifInImg } from './security';
|
|
6
6
|
import store from './store';
|
|
7
7
|
import { Browser, MobileOS } from '../models/IDevice';
|
|
8
|
-
import * as uuid from 'uuid';
|
|
9
8
|
var ImageFormat;
|
|
10
9
|
(function (ImageFormat) {
|
|
11
10
|
ImageFormat["JPEG"] = "image/jpeg";
|
|
@@ -37,11 +36,10 @@ export class Stream {
|
|
|
37
36
|
}
|
|
38
37
|
constructor(mode) {
|
|
39
38
|
this.streamPaused = false;
|
|
40
|
-
this.guid = uuid.v4();
|
|
41
39
|
this.recordedChunks = [];
|
|
42
40
|
this.videoSize = { width: 0, height: 0 };
|
|
43
41
|
if (store.debug)
|
|
44
|
-
console.log(`stream
|
|
42
|
+
console.log(`stream | constructor`);
|
|
45
43
|
this.initFacePose();
|
|
46
44
|
this.idML5Detector = IDML5Detector.getInstance(this, store.device.isMobile);
|
|
47
45
|
this.faceML5Detector = FaceML5Detector.getInstance(this, store.device.isMobile);
|
|
@@ -53,23 +51,23 @@ export class Stream {
|
|
|
53
51
|
if (!Stream.instance) {
|
|
54
52
|
Stream.instance = new Stream(mode);
|
|
55
53
|
if (store.debug)
|
|
56
|
-
console.log(`stream
|
|
54
|
+
console.log(`stream | getNewInstance | new instance`);
|
|
57
55
|
}
|
|
58
56
|
return Stream.instance;
|
|
59
57
|
}
|
|
60
58
|
autoCapturing() {
|
|
61
59
|
if (store.debug)
|
|
62
|
-
console.log(`stream
|
|
60
|
+
console.log(`stream | autoCapturing`);
|
|
63
61
|
this.callbackAutoCapturing();
|
|
64
62
|
}
|
|
65
63
|
timeElapsed() {
|
|
66
64
|
if (store.debug)
|
|
67
|
-
console.log(`stream
|
|
65
|
+
console.log(`stream | timeElapsed`);
|
|
68
66
|
this.callbackTimeElapsed();
|
|
69
67
|
}
|
|
70
68
|
verificationReady() {
|
|
71
69
|
if (store.debug)
|
|
72
|
-
console.log(`stream
|
|
70
|
+
console.log(`stream | verificationReady`);
|
|
73
71
|
this.verificationFinished();
|
|
74
72
|
}
|
|
75
73
|
updateHtmlElements(videoElement, canvasElement, component) {
|
|
@@ -80,7 +78,7 @@ export class Stream {
|
|
|
80
78
|
}
|
|
81
79
|
startStream(stream) {
|
|
82
80
|
if (store.debug)
|
|
83
|
-
console.log(`stream
|
|
81
|
+
console.log(`stream | startStream`);
|
|
84
82
|
if (this.stream)
|
|
85
83
|
this.stream.getTracks().forEach((track) => track.stop());
|
|
86
84
|
this.stream = stream;
|
|
@@ -113,7 +111,7 @@ export class Stream {
|
|
|
113
111
|
}
|
|
114
112
|
recordStream() {
|
|
115
113
|
if (store.debug)
|
|
116
|
-
console.log(`stream
|
|
114
|
+
console.log(`stream | recordStream`);
|
|
117
115
|
if (this.mediaRecorder && this.mediaRecorder.state == 'recording')
|
|
118
116
|
return;
|
|
119
117
|
var options = { mimeType: Stream.webmMimeType.mime, videoBitsPerSecond: 1500000 };
|
|
@@ -125,12 +123,12 @@ export class Stream {
|
|
|
125
123
|
this.mediaRecorder = new MediaRecorder(this.stream, options);
|
|
126
124
|
this.mediaRecorder.ondataavailable = event => {
|
|
127
125
|
if (store.debug)
|
|
128
|
-
console.log(`stream
|
|
126
|
+
console.log(`stream | recordStream | ondataavailable`);
|
|
129
127
|
this.recordedChunks.push(event.data);
|
|
130
128
|
};
|
|
131
129
|
this.mediaRecorder.onstop = _e => {
|
|
132
130
|
if (store.debug)
|
|
133
|
-
console.log(`stream
|
|
131
|
+
console.log(`stream | recordStream | onstop`);
|
|
134
132
|
var rec = new Blob(this.recordedChunks, {
|
|
135
133
|
type: options.mimeType.split(';')[0],
|
|
136
134
|
});
|
|
@@ -162,7 +160,7 @@ export class Stream {
|
|
|
162
160
|
}
|
|
163
161
|
async takePhoto() {
|
|
164
162
|
if (store.debug)
|
|
165
|
-
console.log(`stream
|
|
163
|
+
console.log(`stream | takePhoto`);
|
|
166
164
|
const canvas = document.createElement('canvas');
|
|
167
165
|
canvas.style.visibility = 'hidden';
|
|
168
166
|
canvas.width = this.videoElement.videoWidth;
|
|
@@ -171,7 +169,7 @@ export class Stream {
|
|
|
171
169
|
}
|
|
172
170
|
getFrame(canvas) {
|
|
173
171
|
if (store.debug)
|
|
174
|
-
console.log(`stream
|
|
172
|
+
console.log(`stream | getFrame`);
|
|
175
173
|
return new Promise(resolve => {
|
|
176
174
|
const context = canvas.getContext('2d');
|
|
177
175
|
context.drawImage(this.videoElement, 0, 0, canvas.width, canvas.height);
|
|
@@ -179,7 +177,7 @@ export class Stream {
|
|
|
179
177
|
if (frame.type === ImageFormat.JPEG && !store.device.isAppleDevice) {
|
|
180
178
|
try {
|
|
181
179
|
if (store.debug)
|
|
182
|
-
console.log(`stream
|
|
180
|
+
console.log(`stream | getFrame | addExifInImg`);
|
|
183
181
|
addExifInImg(frame, this.stream.getTracks()[0], this.videoSize).then(updatedFrame => resolve(updatedFrame));
|
|
184
182
|
}
|
|
185
183
|
catch (e) {
|
|
@@ -189,7 +187,7 @@ export class Stream {
|
|
|
189
187
|
}
|
|
190
188
|
else {
|
|
191
189
|
if (store.debug)
|
|
192
|
-
console.log(`stream
|
|
190
|
+
console.log(`stream | getFrame | resolve`);
|
|
193
191
|
resolve(frame);
|
|
194
192
|
}
|
|
195
193
|
}, ImageFormat.PNG, 1);
|
|
@@ -198,7 +196,7 @@ export class Stream {
|
|
|
198
196
|
async startIdDetection() {
|
|
199
197
|
if (this.streamPaused)
|
|
200
198
|
return;
|
|
201
|
-
this.idML5Detector.initDetector(
|
|
199
|
+
this.idML5Detector.initDetector();
|
|
202
200
|
}
|
|
203
201
|
async startFaceDetection() {
|
|
204
202
|
if (this.streamPaused)
|
|
@@ -4,7 +4,6 @@ import id_white_svg from '../../assets/canvas-masks/id_white.svg';
|
|
|
4
4
|
// @ts-ignore
|
|
5
5
|
import id_green_svg from '../../assets/canvas-masks/id_green.svg';
|
|
6
6
|
import { delay } from '../../utils/utils';
|
|
7
|
-
import { VerificationMode } from '../../models/IVerificationMode';
|
|
8
7
|
import store from '../../helpers/store';
|
|
9
8
|
export class IDML5Detector {
|
|
10
9
|
static getInstance(stream, isMobile) {
|
|
@@ -26,13 +25,9 @@ export class IDML5Detector {
|
|
|
26
25
|
this.canvasElement = canvasElement;
|
|
27
26
|
// this.component = component;
|
|
28
27
|
}
|
|
29
|
-
initDetector(
|
|
28
|
+
initDetector() {
|
|
30
29
|
this.initTime = Date.now();
|
|
31
30
|
this.continue = true;
|
|
32
|
-
if (mode == VerificationMode.Full)
|
|
33
|
-
this.targetedLabel = 'full';
|
|
34
|
-
else
|
|
35
|
-
this.targetedLabel = 'tilted';
|
|
36
31
|
// this.width = this.videoElement.videoWidth;
|
|
37
32
|
// this.height = this.videoElement.videoHeight;
|
|
38
33
|
this.drawFrame('white');
|
|
@@ -60,14 +55,14 @@ export class IDML5Detector {
|
|
|
60
55
|
this.stream.timeElapsed();
|
|
61
56
|
return;
|
|
62
57
|
}
|
|
63
|
-
if (results[0].label ==
|
|
58
|
+
if (results[0].label == 'full' && results[0].confidence > 0.9 && !this.checked) {
|
|
64
59
|
this.checked = true;
|
|
65
60
|
if (store.debug)
|
|
66
61
|
console.log('idml5detector | gotResults | autoCapturing');
|
|
67
62
|
this.stream.autoCapturing();
|
|
68
63
|
await this.drawFrame('green');
|
|
69
64
|
}
|
|
70
|
-
if (results[0].label ==
|
|
65
|
+
if (results[0].label == 'tilted' && results[0].confidence > 0.8 && !this.checked) {
|
|
71
66
|
this.checked = true;
|
|
72
67
|
await this.drawFrame('green');
|
|
73
68
|
}
|
|
@@ -1524,12 +1524,6 @@ const getLogMessage = (param_req_id = '', param_redirect_id = '', param_token =
|
|
|
1524
1524
|
};
|
|
1525
1525
|
};
|
|
1526
1526
|
|
|
1527
|
-
var VerificationMode;
|
|
1528
|
-
(function (VerificationMode) {
|
|
1529
|
-
VerificationMode[VerificationMode["Full"] = 0] = "Full";
|
|
1530
|
-
VerificationMode[VerificationMode["Tilt"] = 1] = "Tilt";
|
|
1531
|
-
})(VerificationMode || (VerificationMode = {}));
|
|
1532
|
-
|
|
1533
1527
|
class IDML5Detector {
|
|
1534
1528
|
static getInstance(stream, isMobile) {
|
|
1535
1529
|
if (!IDML5Detector.instance) {
|
|
@@ -1550,13 +1544,9 @@ class IDML5Detector {
|
|
|
1550
1544
|
this.canvasElement = canvasElement;
|
|
1551
1545
|
// this.component = component;
|
|
1552
1546
|
}
|
|
1553
|
-
initDetector(
|
|
1547
|
+
initDetector() {
|
|
1554
1548
|
this.initTime = Date.now();
|
|
1555
1549
|
this.continue = true;
|
|
1556
|
-
if (mode == VerificationMode.Full)
|
|
1557
|
-
this.targetedLabel = 'full';
|
|
1558
|
-
else
|
|
1559
|
-
this.targetedLabel = 'tilted';
|
|
1560
1550
|
// this.width = this.videoElement.videoWidth;
|
|
1561
1551
|
// this.height = this.videoElement.videoHeight;
|
|
1562
1552
|
this.drawFrame('white');
|
|
@@ -1584,14 +1574,14 @@ class IDML5Detector {
|
|
|
1584
1574
|
this.stream.timeElapsed();
|
|
1585
1575
|
return;
|
|
1586
1576
|
}
|
|
1587
|
-
if (results[0].label ==
|
|
1577
|
+
if (results[0].label == 'full' && results[0].confidence > 0.9 && !this.checked) {
|
|
1588
1578
|
this.checked = true;
|
|
1589
1579
|
if (state.debug)
|
|
1590
1580
|
console.log('idml5detector | gotResults | autoCapturing');
|
|
1591
1581
|
this.stream.autoCapturing();
|
|
1592
1582
|
await this.drawFrame('green');
|
|
1593
1583
|
}
|
|
1594
|
-
if (results[0].label ==
|
|
1584
|
+
if (results[0].label == 'tilted' && results[0].confidence > 0.8 && !this.checked) {
|
|
1595
1585
|
this.checked = true;
|
|
1596
1586
|
await this.drawFrame('green');
|
|
1597
1587
|
}
|
|
@@ -1715,6 +1705,12 @@ const faceWhiteSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUwIiBoZWlnaHQ9
|
|
|
1715
1705
|
|
|
1716
1706
|
const faceGreenSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUwIiBoZWlnaHQ9IjIyNC45OTk5OTk5OTk5OTk5NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZlcnNpb249IjEuMSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQogPGc+DQogIDx0aXRsZT5MYXllciAxPC90aXRsZT4NCiAgPGcgc3Ryb2tlPSJudWxsIiBpZD0iTGF5ZXIgMSI+DQogICA8cGF0aCBzdHJva2U9IiM0Y2E1ODUiIGlkPSJzdmdfMSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZmlsbD0ibm9uZSIgZD0ibTc0LjI3NzY1LDYuOTI3NjFjLTExLjM3NTk3LC0wLjAxNzEzIC0zMy41NjU1MSw1LjEwNDMzIC00Ni44MTMxNiwxOS40OTQ4MWMtNi43NDE0Myw3LjMyMjkyIC0xOC4xMjI2OSwyMy4wNjk2NyAtMTkuMjY3NTgsNTkuNjEzNjljLTAuNTE5MDYsMTYuNTY5MjEgNS4wNDUyNCw2MC42MjUzMyAxMC4yNDAwNiw3Ni40Njc3NWMzLjYzMTMsMTEuMDc0NjggMjcuNDgyMTUsNDMuOTMzNDkgNDQuNDkwNiw1My42ODI1MWM0LjgwNzkxLDIuNzU1NDYgMTEuMjk2NjgsMi42ODI1MSAxMi40MjI1NSwyLjY4MjUxYzEuMTg4NzYsLTAuMDg0NTcgNy4zMzAyNiwwLjA3Mjk0IDEyLjEzNzY1LC0yLjY4MjUxYzE3LjAwODQ2LC05Ljc0OTAyIDQwLjQwMjA4LC00Mi43Njg1MSA0NC40OTA2LC01My42ODI1MWM0LjQwMDM4LC0xMS43NDQ5MSAxMC43NTk2NSwtNTkuODk4NTQgMTAuMjQwMDYsLTc2LjQ2Nzc1Yy0xLjE0NDg5LC0zNi41NDQwMiAtMTIuNTI2MTUsLTUyLjI5MDc3IC0xOS4yNjc1OCwtNTkuNjEzNjljLTEzLjI0NzY1LC0xNC4zOTA0OCAtMzUuMzA2NjMsLTE5LjUyOTMzIC00Ni43NzgyNywtMTkuNDk0ODFjLTAuNzQ2ODgsMC4wMDIyMiAtMS44OTQ5NCwwIC0xLjg5NDk0LDB6IiBzdHJva2Utd2lkdGg9IjciLz4NCiAgPC9nPg0KIDwvZz4NCjwvc3ZnPg0K';
|
|
1717
1707
|
|
|
1708
|
+
var VerificationMode;
|
|
1709
|
+
(function (VerificationMode) {
|
|
1710
|
+
VerificationMode[VerificationMode["Full"] = 0] = "Full";
|
|
1711
|
+
VerificationMode[VerificationMode["Tilt"] = 1] = "Tilt";
|
|
1712
|
+
})(VerificationMode || (VerificationMode = {}));
|
|
1713
|
+
|
|
1718
1714
|
class FaceML5Detector {
|
|
1719
1715
|
static getInstance(stream, isMobile) {
|
|
1720
1716
|
if (!FaceML5Detector.instance) {
|
|
@@ -4384,71 +4380,6 @@ var Browser;
|
|
|
4384
4380
|
Browser["Unknown"] = "unknown";
|
|
4385
4381
|
})(Browser || (Browser = {}));
|
|
4386
4382
|
|
|
4387
|
-
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
4388
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
4389
|
-
// generators (like Math.random()).
|
|
4390
|
-
let getRandomValues;
|
|
4391
|
-
const rnds8 = new Uint8Array(16);
|
|
4392
|
-
function rng() {
|
|
4393
|
-
// lazy load so that environments that need to polyfill have a chance to do so
|
|
4394
|
-
if (!getRandomValues) {
|
|
4395
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
4396
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
4397
|
-
|
|
4398
|
-
if (!getRandomValues) {
|
|
4399
|
-
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
4400
|
-
}
|
|
4401
|
-
}
|
|
4402
|
-
|
|
4403
|
-
return getRandomValues(rnds8);
|
|
4404
|
-
}
|
|
4405
|
-
|
|
4406
|
-
/**
|
|
4407
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
4408
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
4409
|
-
*/
|
|
4410
|
-
|
|
4411
|
-
const byteToHex = [];
|
|
4412
|
-
|
|
4413
|
-
for (let i = 0; i < 256; ++i) {
|
|
4414
|
-
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
4415
|
-
}
|
|
4416
|
-
|
|
4417
|
-
function unsafeStringify(arr, offset = 0) {
|
|
4418
|
-
// Note: Be careful editing this code! It's been tuned for performance
|
|
4419
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
4420
|
-
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
4421
|
-
}
|
|
4422
|
-
|
|
4423
|
-
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
4424
|
-
const native = {
|
|
4425
|
-
randomUUID
|
|
4426
|
-
};
|
|
4427
|
-
|
|
4428
|
-
function v4(options, buf, offset) {
|
|
4429
|
-
if (native.randomUUID && !buf && !options) {
|
|
4430
|
-
return native.randomUUID();
|
|
4431
|
-
}
|
|
4432
|
-
|
|
4433
|
-
options = options || {};
|
|
4434
|
-
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
4435
|
-
|
|
4436
|
-
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
4437
|
-
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
4438
|
-
|
|
4439
|
-
if (buf) {
|
|
4440
|
-
offset = offset || 0;
|
|
4441
|
-
|
|
4442
|
-
for (let i = 0; i < 16; ++i) {
|
|
4443
|
-
buf[offset + i] = rnds[i];
|
|
4444
|
-
}
|
|
4445
|
-
|
|
4446
|
-
return buf;
|
|
4447
|
-
}
|
|
4448
|
-
|
|
4449
|
-
return unsafeStringify(rnds);
|
|
4450
|
-
}
|
|
4451
|
-
|
|
4452
4383
|
var ImageFormat;
|
|
4453
4384
|
(function (ImageFormat) {
|
|
4454
4385
|
ImageFormat["JPEG"] = "image/jpeg";
|
|
@@ -4480,11 +4411,10 @@ class Stream {
|
|
|
4480
4411
|
}
|
|
4481
4412
|
constructor(mode) {
|
|
4482
4413
|
this.streamPaused = false;
|
|
4483
|
-
this.guid = v4();
|
|
4484
4414
|
this.recordedChunks = [];
|
|
4485
4415
|
this.videoSize = { width: 0, height: 0 };
|
|
4486
4416
|
if (state.debug)
|
|
4487
|
-
console.log(`stream
|
|
4417
|
+
console.log(`stream | constructor`);
|
|
4488
4418
|
this.initFacePose();
|
|
4489
4419
|
this.idML5Detector = IDML5Detector.getInstance(this, state.device.isMobile);
|
|
4490
4420
|
this.faceML5Detector = FaceML5Detector.getInstance(this, state.device.isMobile);
|
|
@@ -4496,23 +4426,23 @@ class Stream {
|
|
|
4496
4426
|
if (!Stream.instance) {
|
|
4497
4427
|
Stream.instance = new Stream(mode);
|
|
4498
4428
|
if (state.debug)
|
|
4499
|
-
console.log(`stream
|
|
4429
|
+
console.log(`stream | getNewInstance | new instance`);
|
|
4500
4430
|
}
|
|
4501
4431
|
return Stream.instance;
|
|
4502
4432
|
}
|
|
4503
4433
|
autoCapturing() {
|
|
4504
4434
|
if (state.debug)
|
|
4505
|
-
console.log(`stream
|
|
4435
|
+
console.log(`stream | autoCapturing`);
|
|
4506
4436
|
this.callbackAutoCapturing();
|
|
4507
4437
|
}
|
|
4508
4438
|
timeElapsed() {
|
|
4509
4439
|
if (state.debug)
|
|
4510
|
-
console.log(`stream
|
|
4440
|
+
console.log(`stream | timeElapsed`);
|
|
4511
4441
|
this.callbackTimeElapsed();
|
|
4512
4442
|
}
|
|
4513
4443
|
verificationReady() {
|
|
4514
4444
|
if (state.debug)
|
|
4515
|
-
console.log(`stream
|
|
4445
|
+
console.log(`stream | verificationReady`);
|
|
4516
4446
|
this.verificationFinished();
|
|
4517
4447
|
}
|
|
4518
4448
|
updateHtmlElements(videoElement, canvasElement, component) {
|
|
@@ -4523,7 +4453,7 @@ class Stream {
|
|
|
4523
4453
|
}
|
|
4524
4454
|
startStream(stream) {
|
|
4525
4455
|
if (state.debug)
|
|
4526
|
-
console.log(`stream
|
|
4456
|
+
console.log(`stream | startStream`);
|
|
4527
4457
|
if (this.stream)
|
|
4528
4458
|
this.stream.getTracks().forEach((track) => track.stop());
|
|
4529
4459
|
this.stream = stream;
|
|
@@ -4556,7 +4486,7 @@ class Stream {
|
|
|
4556
4486
|
}
|
|
4557
4487
|
recordStream() {
|
|
4558
4488
|
if (state.debug)
|
|
4559
|
-
console.log(`stream
|
|
4489
|
+
console.log(`stream | recordStream`);
|
|
4560
4490
|
if (this.mediaRecorder && this.mediaRecorder.state == 'recording')
|
|
4561
4491
|
return;
|
|
4562
4492
|
var options = { mimeType: Stream.webmMimeType.mime, videoBitsPerSecond: 1500000 };
|
|
@@ -4568,12 +4498,12 @@ class Stream {
|
|
|
4568
4498
|
this.mediaRecorder = new MediaRecorder(this.stream, options);
|
|
4569
4499
|
this.mediaRecorder.ondataavailable = event => {
|
|
4570
4500
|
if (state.debug)
|
|
4571
|
-
console.log(`stream
|
|
4501
|
+
console.log(`stream | recordStream | ondataavailable`);
|
|
4572
4502
|
this.recordedChunks.push(event.data);
|
|
4573
4503
|
};
|
|
4574
4504
|
this.mediaRecorder.onstop = _e => {
|
|
4575
4505
|
if (state.debug)
|
|
4576
|
-
console.log(`stream
|
|
4506
|
+
console.log(`stream | recordStream | onstop`);
|
|
4577
4507
|
var rec = new Blob(this.recordedChunks, {
|
|
4578
4508
|
type: options.mimeType.split(';')[0],
|
|
4579
4509
|
});
|
|
@@ -4605,7 +4535,7 @@ class Stream {
|
|
|
4605
4535
|
}
|
|
4606
4536
|
async takePhoto() {
|
|
4607
4537
|
if (state.debug)
|
|
4608
|
-
console.log(`stream
|
|
4538
|
+
console.log(`stream | takePhoto`);
|
|
4609
4539
|
const canvas = document.createElement('canvas');
|
|
4610
4540
|
canvas.style.visibility = 'hidden';
|
|
4611
4541
|
canvas.width = this.videoElement.videoWidth;
|
|
@@ -4614,7 +4544,7 @@ class Stream {
|
|
|
4614
4544
|
}
|
|
4615
4545
|
getFrame(canvas) {
|
|
4616
4546
|
if (state.debug)
|
|
4617
|
-
console.log(`stream
|
|
4547
|
+
console.log(`stream | getFrame`);
|
|
4618
4548
|
return new Promise(resolve => {
|
|
4619
4549
|
const context = canvas.getContext('2d');
|
|
4620
4550
|
context.drawImage(this.videoElement, 0, 0, canvas.width, canvas.height);
|
|
@@ -4622,7 +4552,7 @@ class Stream {
|
|
|
4622
4552
|
if (frame.type === ImageFormat.JPEG && !state.device.isAppleDevice) {
|
|
4623
4553
|
try {
|
|
4624
4554
|
if (state.debug)
|
|
4625
|
-
console.log(`stream
|
|
4555
|
+
console.log(`stream | getFrame | addExifInImg`);
|
|
4626
4556
|
addExifInImg(frame, this.stream.getTracks()[0], this.videoSize).then(updatedFrame => resolve(updatedFrame));
|
|
4627
4557
|
}
|
|
4628
4558
|
catch (e) {
|
|
@@ -4632,7 +4562,7 @@ class Stream {
|
|
|
4632
4562
|
}
|
|
4633
4563
|
else {
|
|
4634
4564
|
if (state.debug)
|
|
4635
|
-
console.log(`stream
|
|
4565
|
+
console.log(`stream | getFrame | resolve`);
|
|
4636
4566
|
resolve(frame);
|
|
4637
4567
|
}
|
|
4638
4568
|
}, ImageFormat.PNG, 1);
|
|
@@ -4641,7 +4571,7 @@ class Stream {
|
|
|
4641
4571
|
async startIdDetection() {
|
|
4642
4572
|
if (this.streamPaused)
|
|
4643
4573
|
return;
|
|
4644
|
-
this.idML5Detector.initDetector(
|
|
4574
|
+
this.idML5Detector.initDetector();
|
|
4645
4575
|
}
|
|
4646
4576
|
async startFaceDetection() {
|
|
4647
4577
|
if (this.streamPaused)
|
|
@@ -5105,7 +5035,6 @@ const IdCapture = class {
|
|
|
5105
5035
|
this.eventPhotoCapture = createEvent(this, "photoIdCapture", 7);
|
|
5106
5036
|
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
5107
5037
|
this.eventTimeElapsed = createEvent(this, "timeElapsed", 7);
|
|
5108
|
-
this.guid = v4();
|
|
5109
5038
|
this.videoStarted = undefined;
|
|
5110
5039
|
this.cameraSize = undefined;
|
|
5111
5040
|
this.captureTaken = undefined;
|
|
@@ -5123,7 +5052,7 @@ const IdCapture = class {
|
|
|
5123
5052
|
}
|
|
5124
5053
|
async componentWillLoad() {
|
|
5125
5054
|
if (state.debug)
|
|
5126
|
-
console.log(`id-capture
|
|
5055
|
+
console.log(`id-capture | componentWillLoad`);
|
|
5127
5056
|
this.translations = await Translations.getValues();
|
|
5128
5057
|
if (!navigator.mediaDevices) {
|
|
5129
5058
|
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
@@ -5131,29 +5060,26 @@ const IdCapture = class {
|
|
|
5131
5060
|
}
|
|
5132
5061
|
initVariables() {
|
|
5133
5062
|
if (state.debug)
|
|
5134
|
-
console.log(`id-capture
|
|
5063
|
+
console.log(`id-capture | initVariables`);
|
|
5135
5064
|
if (state.flowStatus == FlowStatus.IDFRONT) {
|
|
5136
5065
|
this.pose = IDPose.Straight;
|
|
5137
5066
|
this.flowStep = FlowSteps.CiFrontCapture;
|
|
5138
5067
|
this.titleMesage = this.translations.IdCaptureValues.Title;
|
|
5139
|
-
this.verificationMode = VerificationMode.Full;
|
|
5140
5068
|
}
|
|
5141
5069
|
else if (state.flowStatus == FlowStatus.IDBACK) {
|
|
5142
5070
|
this.pose = IDPose.BackStraight;
|
|
5143
5071
|
this.flowStep = FlowSteps.CiBackCapture;
|
|
5144
5072
|
this.titleMesage = this.translations.IdCaptureValues.TtileRotate;
|
|
5145
|
-
this.verificationMode = VerificationMode.Full;
|
|
5146
5073
|
}
|
|
5147
5074
|
else if (state.flowStatus == FlowStatus.IDTILT) {
|
|
5148
5075
|
this.titleMesage = this.translations.IdCaptureValues.IDPoseMapping;
|
|
5149
5076
|
this.pose = IDPose.Tilted;
|
|
5150
5077
|
this.flowStep = FlowSteps.CiTilt;
|
|
5151
|
-
this.verificationMode = VerificationMode.Tilt;
|
|
5152
5078
|
}
|
|
5153
5079
|
}
|
|
5154
5080
|
async componentDidLoad() {
|
|
5155
5081
|
if (state.debug)
|
|
5156
|
-
console.log(`id-capture
|
|
5082
|
+
console.log(`id-capture | componentDidLoad`);
|
|
5157
5083
|
this.initVariables();
|
|
5158
5084
|
await BaseComponent.logStep(this.flowStep, FlowMoments.Initialized);
|
|
5159
5085
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[this.pose];
|
|
@@ -5164,7 +5090,7 @@ const IdCapture = class {
|
|
|
5164
5090
|
}
|
|
5165
5091
|
async openCamera() {
|
|
5166
5092
|
if (state.debug)
|
|
5167
|
-
console.log(`id-capture
|
|
5093
|
+
console.log(`id-capture | openCamera`);
|
|
5168
5094
|
if (!state.cameraId) {
|
|
5169
5095
|
await Cameras.InitCameras(state.device);
|
|
5170
5096
|
}
|
|
@@ -5174,8 +5100,8 @@ const IdCapture = class {
|
|
|
5174
5100
|
.getUserMedia(constraints)
|
|
5175
5101
|
.then(stream => {
|
|
5176
5102
|
if (state.debug)
|
|
5177
|
-
console.log(`id-capture
|
|
5178
|
-
const superStream = Stream.getNewInstance(
|
|
5103
|
+
console.log(`id-capture | openCamera | streamObtained`);
|
|
5104
|
+
const superStream = Stream.getNewInstance(null);
|
|
5179
5105
|
superStream.initStream(stream);
|
|
5180
5106
|
})
|
|
5181
5107
|
.catch(e => {
|
|
@@ -5186,7 +5112,7 @@ const IdCapture = class {
|
|
|
5186
5112
|
}
|
|
5187
5113
|
closeCamera() {
|
|
5188
5114
|
if (state.debug)
|
|
5189
|
-
console.log(`id-capture
|
|
5115
|
+
console.log(`id-capture | closeCamera`);
|
|
5190
5116
|
if (Stream.instance) {
|
|
5191
5117
|
Stream.instance.dropStream();
|
|
5192
5118
|
}
|
|
@@ -5197,23 +5123,23 @@ const IdCapture = class {
|
|
|
5197
5123
|
IDML5Detector.instance = null;
|
|
5198
5124
|
FaceML5Detector.instance = null;
|
|
5199
5125
|
if (state.debug)
|
|
5200
|
-
console.log(`id-capture
|
|
5126
|
+
console.log(`id-capture | disconnectedCallback`);
|
|
5201
5127
|
}
|
|
5202
5128
|
async takePhoto() {
|
|
5203
5129
|
if (state.debug)
|
|
5204
|
-
console.log(`id-capture
|
|
5130
|
+
console.log(`id-capture | takePhoto`);
|
|
5205
5131
|
if (this.captureTaken)
|
|
5206
5132
|
return;
|
|
5207
5133
|
this.captureTaken = true;
|
|
5208
5134
|
if (state.debug)
|
|
5209
|
-
console.log(`id-capture
|
|
5135
|
+
console.log(`id-capture | takePhoto | sendingPhoto`);
|
|
5210
5136
|
let res = await Stream.instance.takePhoto();
|
|
5211
5137
|
this.eventPhotoCapture.emit(res);
|
|
5212
5138
|
await BaseComponent.logStep(this.flowStep, FlowMoments.Finalized);
|
|
5213
5139
|
}
|
|
5214
5140
|
async verificationFinished() {
|
|
5215
5141
|
if (state.debug)
|
|
5216
|
-
console.log(`id-capture
|
|
5142
|
+
console.log(`id-capture | verificationFinished`);
|
|
5217
5143
|
if (this.verified)
|
|
5218
5144
|
return;
|
|
5219
5145
|
this.verified = true;
|
|
@@ -5244,8 +5170,73 @@ const IdCapture = class {
|
|
|
5244
5170
|
};
|
|
5245
5171
|
IdCapture.style = idCaptureCss;
|
|
5246
5172
|
|
|
5173
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
5174
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
5175
|
+
// generators (like Math.random()).
|
|
5176
|
+
let getRandomValues;
|
|
5177
|
+
const rnds8 = new Uint8Array(16);
|
|
5178
|
+
function rng() {
|
|
5179
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
5180
|
+
if (!getRandomValues) {
|
|
5181
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
5182
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
5183
|
+
|
|
5184
|
+
if (!getRandomValues) {
|
|
5185
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
5186
|
+
}
|
|
5187
|
+
}
|
|
5188
|
+
|
|
5189
|
+
return getRandomValues(rnds8);
|
|
5190
|
+
}
|
|
5191
|
+
|
|
5192
|
+
/**
|
|
5193
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
5194
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
5195
|
+
*/
|
|
5196
|
+
|
|
5197
|
+
const byteToHex = [];
|
|
5198
|
+
|
|
5199
|
+
for (let i = 0; i < 256; ++i) {
|
|
5200
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
5201
|
+
}
|
|
5202
|
+
|
|
5203
|
+
function unsafeStringify(arr, offset = 0) {
|
|
5204
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
5205
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
5206
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
5207
|
+
}
|
|
5208
|
+
|
|
5209
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
5210
|
+
const native = {
|
|
5211
|
+
randomUUID
|
|
5212
|
+
};
|
|
5213
|
+
|
|
5214
|
+
function v4(options, buf, offset) {
|
|
5215
|
+
if (native.randomUUID && !buf && !options) {
|
|
5216
|
+
return native.randomUUID();
|
|
5217
|
+
}
|
|
5218
|
+
|
|
5219
|
+
options = options || {};
|
|
5220
|
+
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
5221
|
+
|
|
5222
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
5223
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
5224
|
+
|
|
5225
|
+
if (buf) {
|
|
5226
|
+
offset = offset || 0;
|
|
5227
|
+
|
|
5228
|
+
for (let i = 0; i < 16; ++i) {
|
|
5229
|
+
buf[offset + i] = rnds[i];
|
|
5230
|
+
}
|
|
5231
|
+
|
|
5232
|
+
return buf;
|
|
5233
|
+
}
|
|
5234
|
+
|
|
5235
|
+
return unsafeStringify(rnds);
|
|
5236
|
+
}
|
|
5237
|
+
|
|
5247
5238
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5248
|
-
const version$1 = "3.6.
|
|
5239
|
+
const version$1 = "3.6.77";
|
|
5249
5240
|
const description = "Person Identification Component";
|
|
5250
5241
|
const main = "./dist/index.cjs.js";
|
|
5251
5242
|
const module = "./dist/index.js";
|
|
@@ -8809,23 +8800,12 @@ const ProcessId = class {
|
|
|
8809
8800
|
if (state.debug)
|
|
8810
8801
|
console.log('process-id | verificationFinished');
|
|
8811
8802
|
this.verificationReceived = Date.now();
|
|
8812
|
-
|
|
8813
|
-
let statusChanged = false;
|
|
8814
|
-
while (Date.now() - this.verificationReceived < 30000 && !statusChanged) {
|
|
8803
|
+
while (Date.now() - this.verificationReceived < 30000) {
|
|
8815
8804
|
await delay(2000);
|
|
8816
8805
|
if (this.showInvalid || this.showTimeout)
|
|
8817
8806
|
return;
|
|
8818
|
-
statusChanged = initialStatus != state.flowStatus;
|
|
8819
|
-
}
|
|
8820
|
-
if (!statusChanged) {
|
|
8821
|
-
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
8822
|
-
if (currentStatus != state.flowStatus) {
|
|
8823
|
-
state.flowStatus = currentStatus;
|
|
8824
|
-
}
|
|
8825
|
-
else {
|
|
8826
|
-
this.triggerUploadFailedFlow();
|
|
8827
|
-
}
|
|
8828
8807
|
}
|
|
8808
|
+
this.triggerUploadFailedFlow();
|
|
8829
8809
|
if (state.debug)
|
|
8830
8810
|
console.log('process-id | verificationFinished | waitingFinished ');
|
|
8831
8811
|
}
|
|
@@ -9204,23 +9184,12 @@ const UserLiveness = class {
|
|
|
9204
9184
|
if (state.debug)
|
|
9205
9185
|
console.log('user-liveness | verificationFinished');
|
|
9206
9186
|
this.verificationReceived = Date.now();
|
|
9207
|
-
|
|
9208
|
-
let statusChanged = false;
|
|
9209
|
-
while (Date.now() - this.verificationReceived < 30000 && !statusChanged) {
|
|
9187
|
+
while (Date.now() - this.verificationReceived < 30000) {
|
|
9210
9188
|
await delay(2000);
|
|
9211
9189
|
if (this.showError || this.showTimeout)
|
|
9212
9190
|
return;
|
|
9213
|
-
statusChanged = initialStatus != state.flowStatus;
|
|
9214
|
-
}
|
|
9215
|
-
if (!statusChanged) {
|
|
9216
|
-
let currentStatus = await ApiCall.instance.GetFlowState();
|
|
9217
|
-
if (currentStatus != state.flowStatus) {
|
|
9218
|
-
state.flowStatus = currentStatus;
|
|
9219
|
-
}
|
|
9220
|
-
else {
|
|
9221
|
-
this.triggerUploadFailedFlow();
|
|
9222
|
-
}
|
|
9223
9191
|
}
|
|
9192
|
+
this.triggerUploadFailedFlow();
|
|
9224
9193
|
if (state.debug)
|
|
9225
9194
|
console.log('user-liveness | verificationFinished | waitingFinished ');
|
|
9226
9195
|
}
|