bry-biometric-collector 2.2.21 → 2.2.23

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.
@@ -1,1017 +0,0 @@
1
- import { S as hi, q as mi, r as Lt, t as bi, w as ee, L as se, x as v, N as U, z as $, B as d, D as l, O as K, P as Ce, Q as X, R as ke, H as oe, I as A, T as ze, U as Pe, V as gi, W as Se, Y as _i, X as pe, Z as de, _ as Fe, a0 as Ge, a1 as gt, J as _t, a2 as Ie, a4 as Le, a5 as pt, a6 as wt, a7 as Ze, a9 as xe, ad as vt, ab as pi, af as Be, ag as $e, b4 as We, $ as wi, an as vi, ao as Ci, ap as ki, aq as yi, K as h, ar as Di, as as et, at as ot, j as Bt, au as tt, aA as Ei, C as it, d as Me, aB as Ct, aC as Ne, aD as Oi, aE as st, aF as Ti, aG as Ai, aH as Ri, aI as we, aJ as Pi, aK as kt, E as ae, aL as He, aM as Si, aN as ye, aO as De, aP as Ee, y as J, G as z, aS as yt, aU as Fi, aV as Ii, aW as ve, aQ as Dt, a_ as Li, a$ as Bi, b0 as Et, b2 as Ot, b3 as Wi } from "./main_255a6ad2_2.2.21.js";
2
- import { C as j, c as x, a as Mi, T as Ni, b as Hi } from "./TakePictureBtn_dd5c4c91_2.2.21.js";
3
- function Tt(s) {
4
- let t, i, o;
5
- return {
6
- c() {
7
- t = v("video"), d(t, "id", "bry-cc-camera-video-tag"), d(t, "class", "absolute -z-10"), t.playsInline = !0, t.muted = !0, t.autoplay = !0;
8
- },
9
- m(a, f) {
10
- ee(a, t, f), s[39](t), i || (o = [
11
- ae(
12
- t,
13
- "canplay",
14
- /*canplay_handler*/
15
- s[40]
16
- ),
17
- ae(
18
- t,
19
- "play",
20
- /*play*/
21
- s[4],
22
- { once: !0 }
23
- )
24
- ], i = !0);
25
- },
26
- p: $,
27
- d(a) {
28
- a && oe(t), s[39](null), i = !1, He(o);
29
- }
30
- };
31
- }
32
- function At(s) {
33
- let t, i;
34
- return t = new Si({}), {
35
- c() {
36
- ye(t.$$.fragment);
37
- },
38
- m(o, a) {
39
- De(t, o, a), i = !0;
40
- },
41
- i(o) {
42
- i || (K(t.$$.fragment, o), i = !0);
43
- },
44
- o(o) {
45
- X(t.$$.fragment, o), i = !1;
46
- },
47
- d(o) {
48
- Ee(t, o);
49
- }
50
- };
51
- }
52
- function Rt(s) {
53
- let t, i;
54
- return t = new Mi({}), {
55
- c() {
56
- ye(t.$$.fragment);
57
- },
58
- m(o, a) {
59
- De(t, o, a), i = !0;
60
- },
61
- i(o) {
62
- i || (K(t.$$.fragment, o), i = !0);
63
- },
64
- o(o) {
65
- X(t.$$.fragment, o), i = !1;
66
- },
67
- d(o) {
68
- Ee(t, o);
69
- }
70
- };
71
- }
72
- function Pt(s) {
73
- let t, i = (
74
- /*$_*/
75
- s[24]("faceCollector.stayStill") + ""
76
- ), o;
77
- return {
78
- c() {
79
- t = v("span"), o = J(i), d(t, "class", "absolute left-1/2 -translate-x-1/2 top-[7%] ce-dui-badge ce-dui-badge-lg h-[2em] text-2xl xl:text-base w-[12.1em]");
80
- },
81
- m(a, f) {
82
- ee(a, t, f), l(t, o);
83
- },
84
- p(a, f) {
85
- f[0] & /*$_*/
86
- 16777216 && i !== (i = /*$_*/
87
- a[24]("faceCollector.stayStill") + "") && z(o, i);
88
- },
89
- d(a) {
90
- a && oe(t);
91
- }
92
- };
93
- }
94
- function St(s) {
95
- let t, i = (
96
- /*$_*/
97
- s[24](`${/*$faceValidationAlert*/
98
- s[16]}`) + ""
99
- ), o;
100
- return {
101
- c() {
102
- t = v("span"), o = J(i), d(t, "class", "absolute left-1/2 -translate-x-1/2 top-[7%] ce-dui-badge ce-dui-badge-lg h-[2em] text-2xl xl:text-base w-[15.1em]");
103
- },
104
- m(a, f) {
105
- ee(a, t, f), l(t, o);
106
- },
107
- p(a, f) {
108
- f[0] & /*$_, $faceValidationAlert*/
109
- 16842752 && i !== (i = /*$_*/
110
- a[24](`${/*$faceValidationAlert*/
111
- a[16]}`) + "") && z(o, i);
112
- },
113
- d(a) {
114
- a && oe(t);
115
- }
116
- };
117
- }
118
- function Ui(s) {
119
- let t, i, o = (
120
- /*$_*/
121
- s[24]("faceCollector.finish") + ""
122
- ), a, f, n, r, b = (
123
- /*$_*/
124
- s[24]("faceCollector.retakePhoto") + ""
125
- ), g, k, m;
126
- return {
127
- c() {
128
- t = v("div"), i = v("button"), a = J(o), n = U(), r = v("button"), g = J(b), i.disabled = f = /*$justification*/
129
- s[18].length === 0, d(i, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), d(r, "id", "bry-cc-retake-button"), d(r, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), d(t, "class", "ce-dui-btn-group flex");
130
- },
131
- m(c, u) {
132
- ee(c, t, u), l(t, i), l(i, a), l(t, n), l(t, r), l(r, g), k || (m = [
133
- ae(
134
- i,
135
- "click",
136
- /*click_handler*/
137
- s[44]
138
- ),
139
- ae(
140
- r,
141
- "click",
142
- /*click_handler_1*/
143
- s[45]
144
- )
145
- ], k = !0);
146
- },
147
- p(c, u) {
148
- u[0] & /*$_*/
149
- 16777216 && o !== (o = /*$_*/
150
- c[24]("faceCollector.finish") + "") && z(a, o), u[0] & /*$justification*/
151
- 262144 && f !== (f = /*$justification*/
152
- c[18].length === 0) && (i.disabled = f), u[0] & /*$_*/
153
- 16777216 && b !== (b = /*$_*/
154
- c[24]("faceCollector.retakePhoto") + "") && z(g, b);
155
- },
156
- i: $,
157
- o: $,
158
- d(c) {
159
- c && oe(t), k = !1, He(m);
160
- }
161
- };
162
- }
163
- function Vi(s) {
164
- let t, i;
165
- return t = new Ni({
166
- props: {
167
- id: "bry-cc-capture-btn",
168
- disabled: !/*$ready*/
169
- s[23],
170
- hidden: (
171
- /*$cameraStatusStore*/
172
- s[13] !== j.OK
173
- ),
174
- handler: (
175
- /*capture*/
176
- s[29]
177
- )
178
- }
179
- }), {
180
- c() {
181
- ye(t.$$.fragment);
182
- },
183
- m(o, a) {
184
- De(t, o, a), i = !0;
185
- },
186
- p(o, a) {
187
- const f = {};
188
- a[0] & /*$ready*/
189
- 8388608 && (f.disabled = !/*$ready*/
190
- o[23]), a[0] & /*$cameraStatusStore*/
191
- 8192 && (f.hidden = /*$cameraStatusStore*/
192
- o[13] !== j.OK), t.$set(f);
193
- },
194
- i(o) {
195
- i || (K(t.$$.fragment, o), i = !0);
196
- },
197
- o(o) {
198
- X(t.$$.fragment, o), i = !1;
199
- },
200
- d(o) {
201
- Ee(t, o);
202
- }
203
- };
204
- }
205
- function Ki(s) {
206
- let t, i;
207
- return t = new Hi({ props: { handler: (
208
- /*func*/
209
- s[53]
210
- ) } }), {
211
- c() {
212
- ye(t.$$.fragment);
213
- },
214
- m(o, a) {
215
- De(t, o, a), i = !0;
216
- },
217
- p: $,
218
- i(o) {
219
- i || (K(t.$$.fragment, o), i = !0);
220
- },
221
- o(o) {
222
- X(t.$$.fragment, o), i = !1;
223
- },
224
- d(o) {
225
- Ee(t, o);
226
- }
227
- };
228
- }
229
- function qi(s) {
230
- let t, i, o, a, f, n, r, b, g;
231
- const k = [Ji, Xi, ji, Yi], m = [];
232
- function c(u, R) {
233
- return (
234
- /*$captured*/
235
- u[15] ? (
236
- /*$requestResult*/
237
- u[20] !== ot.OK ? 1 : (
238
- /*$saved*/
239
- u[17] ? 3 : 2
240
- )
241
- ) : 0
242
- );
243
- }
244
- return n = c(s), r = m[n] = k[n](s), {
245
- c() {
246
- t = v("div"), i = v("img"), f = U(), r.c(), d(i, "class", "m-auto col-start-1 col-end-1 max-h-[23.2em]"), Dt(i.src, o = /*$dataTypePrefix*/
247
- s[21] + "," + /*$image*/
248
- s[19]) || d(i, "src", o), i.hidden = a = !/*$captured*/
249
- s[15] || !/*$showFaceWhileValidating*/
250
- s[25], d(i, "alt", ""), d(t, "class", b = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (/*$showFaceWhileValidating*/
251
- s[25] ? "grid m-[1em] overflow-hidden" : "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible"));
252
- },
253
- m(u, R) {
254
- ee(u, t, R), l(t, i), l(t, f), m[n].m(t, null), g = !0;
255
- },
256
- p(u, R) {
257
- (!g || R[0] & /*$dataTypePrefix, $image*/
258
- 2621440 && !Dt(i.src, o = /*$dataTypePrefix*/
259
- u[21] + "," + /*$image*/
260
- u[19])) && d(i, "src", o), (!g || R[0] & /*$captured, $showFaceWhileValidating*/
261
- 33587200 && a !== (a = !/*$captured*/
262
- u[15] || !/*$showFaceWhileValidating*/
263
- u[25])) && (i.hidden = a);
264
- let y = n;
265
- n = c(u), n === y ? m[n].p(u, R) : (Ce(), X(m[y], 1, 1, () => {
266
- m[y] = null;
267
- }), ke(), r = m[n], r ? r.p(u, R) : (r = m[n] = k[n](u), r.c()), K(r, 1), r.m(t, null)), (!g || R[0] & /*$showFaceWhileValidating*/
268
- 33554432 && b !== (b = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (/*$showFaceWhileValidating*/
269
- u[25] ? "grid m-[1em] overflow-hidden" : "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible"))) && d(t, "class", b);
270
- },
271
- i(u) {
272
- g || (K(r), g = !0);
273
- },
274
- o(u) {
275
- X(r), g = !1;
276
- },
277
- d(u) {
278
- u && oe(t), m[n].d();
279
- }
280
- };
281
- }
282
- function Yi(s) {
283
- let t, i, o = (
284
- /*$_*/
285
- s[24]("docCollector.captured") + ""
286
- ), a, f, n, r, b = (
287
- /*$_*/
288
- s[24]("faceCollector.retakePhoto") + ""
289
- ), g, k, m = Bt(Li).faceStrategy !== Bi.DISABLED, c, u, R, y = m && Qi();
290
- return {
291
- c() {
292
- t = v("div"), i = v("h1"), a = J(o), f = U(), n = v("div"), r = v("button"), g = J(b), k = U(), y && y.c(), d(i, "class", "text-3xl font-bold pb-[1em] transition-opacity"), d(r, "id", "bry-cc-retake-button"), d(r, "class", "ce-dui-btn ce-dui-btn-block flex-shrink text-base"), d(n, "class", "flex flex-row"), Et(n, "ce-dui-btn-group", !/*$exportButtonDisabled*/
293
- s[26]);
294
- },
295
- m(p, P) {
296
- ee(p, t, P), l(t, i), l(i, a), l(t, f), l(t, n), l(n, r), l(r, g), l(n, k), y && y.m(n, null), c = !0, u || (R = ae(
297
- r,
298
- "click",
299
- /*click_handler_6*/
300
- s[52]
301
- ), u = !0);
302
- },
303
- p(p, P) {
304
- (!c || P[0] & /*$_*/
305
- 16777216) && o !== (o = /*$_*/
306
- p[24]("docCollector.captured") + "") && z(a, o), (!c || P[0] & /*$_*/
307
- 16777216) && b !== (b = /*$_*/
308
- p[24]("faceCollector.retakePhoto") + "") && z(g, b), (!c || P[0] & /*$exportButtonDisabled*/
309
- 67108864) && Et(n, "ce-dui-btn-group", !/*$exportButtonDisabled*/
310
- p[26]);
311
- },
312
- i(p) {
313
- c || (K(y), c = !0);
314
- },
315
- o(p) {
316
- X(y), c = !1;
317
- },
318
- d(p) {
319
- p && oe(t), y && y.d(), u = !1, R();
320
- }
321
- };
322
- }
323
- function ji(s) {
324
- let t, i, o = (
325
- /*$_*/
326
- s[24]("faceCollector.unconformities") + ""
327
- ), a, f, n, r, b, g = (
328
- /*$_*/
329
- s[24]("faceCollector.provideAReasonForTheLowQualityCapture") + ""
330
- ), k, m, c, u, R, y, p, P, F = (
331
- /*$_*/
332
- s[24]("faceCollector.thisInformationIsRequired") + ""
333
- ), M, G, S, I, Z, O = (
334
- /*$captured*/
335
- s[15] && Ft(s)
336
- );
337
- return {
338
- c() {
339
- t = v("div"), i = v("h1"), a = J(o), f = U(), n = v("div"), r = v("label"), b = v("span"), k = J(g), m = U(), c = v("textarea"), R = U(), y = v("label"), p = v("span"), P = J("("), M = J(F), G = J(")"), S = U(), O && O.c(), d(i, "class", "text-3xl font-bold pb-[1em] transition-opacity"), d(b, "class", "ce-dui-label-text text-base"), d(r, "class", "ce-dui-label"), d(r, "for", "justification"), d(c, "contenteditable", ""), d(c, "id", "justification"), d(c, "class", "ce-dui-textarea ce-dui-textarea-bordered h-[6em] text-base"), d(c, "placeholder", u = /*$_*/
340
- s[24]("faceCollector.yourJustification")), d(p, "class", "ce-dui-label-text-alt text-base"), d(y, "class", "ce-dui-label"), d(y, "for", "justification"), d(n, "class", "ce-dui-form-control mt-[2.5em]");
341
- },
342
- m(w, T) {
343
- ee(w, t, T), l(t, i), l(i, a), l(t, f), l(t, n), l(n, r), l(r, b), l(b, k), l(n, m), l(n, c), Ot(
344
- c,
345
- /*$justification*/
346
- s[18]
347
- ), l(n, R), l(n, y), l(y, p), l(p, P), l(p, M), l(p, G), l(t, S), O && O.m(t, null), I || (Z = ae(
348
- c,
349
- "input",
350
- /*textarea_input_handler*/
351
- s[49]
352
- ), I = !0);
353
- },
354
- p(w, T) {
355
- T[0] & /*$_*/
356
- 16777216 && o !== (o = /*$_*/
357
- w[24]("faceCollector.unconformities") + "") && z(a, o), T[0] & /*$_*/
358
- 16777216 && g !== (g = /*$_*/
359
- w[24]("faceCollector.provideAReasonForTheLowQualityCapture") + "") && z(k, g), T[0] & /*$_*/
360
- 16777216 && u !== (u = /*$_*/
361
- w[24]("faceCollector.yourJustification")) && d(c, "placeholder", u), T[0] & /*$justification*/
362
- 262144 && Ot(
363
- c,
364
- /*$justification*/
365
- w[18]
366
- ), T[0] & /*$_*/
367
- 16777216 && F !== (F = /*$_*/
368
- w[24]("faceCollector.thisInformationIsRequired") + "") && z(M, F), /*$captured*/
369
- w[15] ? O ? O.p(w, T) : (O = Ft(w), O.c(), O.m(t, null)) : O && (O.d(1), O = null);
370
- },
371
- i: $,
372
- o: $,
373
- d(w) {
374
- w && oe(t), O && O.d(), I = !1, Z();
375
- }
376
- };
377
- }
378
- function Xi(s) {
379
- let t, i, o = (
380
- /*$_*/
381
- s[24]("faceCollector.everythingOk") + ""
382
- ), a, f, n, r, b = (
383
- /*$_*/
384
- s[24]("faceCollector.finish") + ""
385
- ), g, k, m, c = (
386
- /*$_*/
387
- s[24]("faceCollector.retakePhoto") + ""
388
- ), u, R, y;
389
- return {
390
- c() {
391
- t = v("div"), i = v("h1"), a = J(o), f = U(), n = v("div"), r = v("button"), g = J(b), k = U(), m = v("button"), u = J(c), d(i, "class", "text-3xl font-bold pb-[1em] transition-opacity"), r.disabled = !0, d(r, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), d(m, "id", "bry-cc-retake-button"), d(m, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), d(n, "class", "ce-dui-btn-group flex"), d(t, "class", "flex flex-col justify-between");
392
- },
393
- m(p, P) {
394
- ee(p, t, P), l(t, i), l(i, a), l(t, f), l(t, n), l(n, r), l(r, g), l(n, k), l(n, m), l(m, u), R || (y = [
395
- ae(
396
- r,
397
- "click",
398
- /*click_handler_2*/
399
- s[47]
400
- ),
401
- ae(
402
- m,
403
- "click",
404
- /*click_handler_3*/
405
- s[48]
406
- )
407
- ], R = !0);
408
- },
409
- p(p, P) {
410
- P[0] & /*$_*/
411
- 16777216 && o !== (o = /*$_*/
412
- p[24]("faceCollector.everythingOk") + "") && z(a, o), P[0] & /*$_*/
413
- 16777216 && b !== (b = /*$_*/
414
- p[24]("faceCollector.finish") + "") && z(g, b), P[0] & /*$_*/
415
- 16777216 && c !== (c = /*$_*/
416
- p[24]("faceCollector.retakePhoto") + "") && z(u, c);
417
- },
418
- i: $,
419
- o: $,
420
- d(p) {
421
- p && oe(t), R = !1, He(y);
422
- }
423
- };
424
- }
425
- function Ji(s) {
426
- let t;
427
- return {
428
- c() {
429
- t = v("div"), d(t, "class", "");
430
- },
431
- m(i, o) {
432
- ee(i, t, o);
433
- },
434
- p: $,
435
- i: $,
436
- o: $,
437
- d(i) {
438
- i && oe(t);
439
- }
440
- };
441
- }
442
- function Qi(s) {
443
- let t, i;
444
- return t = new Wi({
445
- props: { cssClass: "ce-dui-btn-block flex-shrink" }
446
- }), {
447
- c() {
448
- ye(t.$$.fragment);
449
- },
450
- m(o, a) {
451
- De(t, o, a), i = !0;
452
- },
453
- i(o) {
454
- i || (K(t.$$.fragment, o), i = !0);
455
- },
456
- o(o) {
457
- X(t.$$.fragment, o), i = !1;
458
- },
459
- d(o) {
460
- Ee(t, o);
461
- }
462
- };
463
- }
464
- function Ft(s) {
465
- let t, i, o = (
466
- /*$_*/
467
- s[24]("faceCollector.finish") + ""
468
- ), a, f, n, r, b = (
469
- /*$_*/
470
- s[24]("faceCollector.retakePhoto") + ""
471
- ), g, k, m;
472
- return {
473
- c() {
474
- t = v("div"), i = v("button"), a = J(o), n = U(), r = v("button"), g = J(b), i.disabled = f = /*$justification*/
475
- s[18].length === 0, d(i, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink text-base"), d(r, "id", "bry-cc-retake-button"), d(r, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink text-base"), d(t, "class", "ce-dui-btn-group flex");
476
- },
477
- m(c, u) {
478
- ee(c, t, u), l(t, i), l(i, a), l(t, n), l(t, r), l(r, g), k || (m = [
479
- ae(
480
- i,
481
- "click",
482
- /*click_handler_4*/
483
- s[50]
484
- ),
485
- ae(
486
- r,
487
- "click",
488
- /*click_handler_5*/
489
- s[51]
490
- )
491
- ], k = !0);
492
- },
493
- p(c, u) {
494
- u[0] & /*$_*/
495
- 16777216 && o !== (o = /*$_*/
496
- c[24]("faceCollector.finish") + "") && z(a, o), u[0] & /*$justification*/
497
- 262144 && f !== (f = /*$justification*/
498
- c[18].length === 0) && (i.disabled = f), u[0] & /*$_*/
499
- 16777216 && b !== (b = /*$_*/
500
- c[24]("faceCollector.retakePhoto") + "") && z(g, b);
501
- },
502
- d(c) {
503
- c && oe(t), k = !1, He(m);
504
- }
505
- };
506
- }
507
- function zi(s) {
508
- let t, i, o, a, f = (
509
- /*unique*/
510
- s[9]
511
- ), n, r, b, g, k, m, c, u, R, y, p, P, F, M, G, S, I, Z, O = Tt(s), w = (
512
- /*showConfigButton*/
513
- s[1] && At()
514
- ), T = (
515
- /*showCameraButton*/
516
- s[2] && Rt()
517
- ), W = (
518
- /*isCountingDown*/
519
- s[8] && Pt(s)
520
- ), q = (
521
- /*$enableFaceApi*/
522
- s[22] && !/*isCountingDown*/
523
- s[8] && /*$faceValidationAlert*/
524
- s[16] && St(s)
525
- );
526
- const he = [Vi, Ui], te = [];
527
- function D(_, V) {
528
- return !/*$captured*/
529
- _[15] || !/*showAutoCaptureButton*/
530
- _[3] ? 0 : 1;
531
- }
532
- F = D(s), M = te[F] = he[F](s);
533
- const Q = [qi, Ki], Y = [];
534
- function ne(_, V) {
535
- return (
536
- /*showUnconformities*/
537
- _[0] && (!/*idrndClosed*/
538
- _[12] || /*$captured*/
539
- _[15]) ? 0 : (
540
- /*$cameraStatusStore*/
541
- _[13] !== j.OK ? 1 : -1
542
- )
543
- );
544
- }
545
- return ~(S = ne(s)) && (I = Y[S] = Q[S](s)), {
546
- c() {
547
- t = v("div"), i = v("div"), o = v("div"), a = v("div"), O.c(), n = U(), w && w.c(), r = U(), T && T.c(), b = U(), g = v("canvas"), k = U(), m = v("canvas"), c = U(), u = v("canvas"), R = U(), W && W.c(), y = U(), q && q.c(), P = U(), M.c(), G = U(), I && I.c(), this.c = $, d(g, "id", "bry-ce-displayCanvas"), d(g, "class", "max-w-full"), d(m, "id", "bry-ce-detectionsCanvas"), d(m, "class", "absolute top-0 left-0 max-w-full"), d(u, "id", "bry-ce-maskCanvas"), d(u, "class", "absolute top-0 left-0 max-w-full"), d(a, "class", "relative"), a.hidden = p = /*$cameraStatusStore*/
548
- s[13] !== j.OK, d(o, "class", "relative mx-auto"), d(i, "class", "flex flex-col justify-between");
549
- },
550
- m(_, V) {
551
- ee(_, t, V), l(t, i), l(i, o), l(o, a), O.m(a, null), l(a, n), w && w.m(a, null), l(a, r), T && T.m(a, null), l(a, b), l(a, g), s[41](g), l(a, k), l(a, m), s[42](m), l(a, c), l(a, u), s[43](u), l(a, R), W && W.m(a, null), l(a, y), q && q.m(a, null), l(o, P), te[F].m(o, null), s[46](i), l(t, G), ~S && Y[S].m(t, null), Z = !0;
552
- },
553
- p(_, V) {
554
- V[0] & /*unique*/
555
- 512 && Lt(f, f = /*unique*/
556
- _[9]) ? (O.d(1), O = Tt(_), O.c(), O.m(a, n)) : O.p(_, V), /*showConfigButton*/
557
- _[1] ? w ? V[0] & /*showConfigButton*/
558
- 2 && K(w, 1) : (w = At(), w.c(), K(w, 1), w.m(a, r)) : w && (Ce(), X(w, 1, 1, () => {
559
- w = null;
560
- }), ke()), /*showCameraButton*/
561
- _[2] ? T ? V[0] & /*showCameraButton*/
562
- 4 && K(T, 1) : (T = Rt(), T.c(), K(T, 1), T.m(a, b)) : T && (Ce(), X(T, 1, 1, () => {
563
- T = null;
564
- }), ke()), /*isCountingDown*/
565
- _[8] ? W ? W.p(_, V) : (W = Pt(_), W.c(), W.m(a, y)) : W && (W.d(1), W = null), /*$enableFaceApi*/
566
- _[22] && !/*isCountingDown*/
567
- _[8] && /*$faceValidationAlert*/
568
- _[16] ? q ? q.p(_, V) : (q = St(_), q.c(), q.m(a, null)) : q && (q.d(1), q = null), (!Z || V[0] & /*$cameraStatusStore*/
569
- 8192 && p !== (p = /*$cameraStatusStore*/
570
- _[13] !== j.OK)) && (a.hidden = p);
571
- let le = F;
572
- F = D(_), F === le ? te[F].p(_, V) : (Ce(), X(te[le], 1, 1, () => {
573
- te[le] = null;
574
- }), ke(), M = te[F], M ? M.p(_, V) : (M = te[F] = he[F](_), M.c()), K(M, 1), M.m(o, null));
575
- let re = S;
576
- S = ne(_), S === re ? ~S && Y[S].p(_, V) : (I && (Ce(), X(Y[re], 1, 1, () => {
577
- Y[re] = null;
578
- }), ke()), ~S ? (I = Y[S], I ? I.p(_, V) : (I = Y[S] = Q[S](_), I.c()), K(I, 1), I.m(t, null)) : I = null);
579
- },
580
- i(_) {
581
- Z || (K(w), K(T), K(M), K(I), Z = !0);
582
- },
583
- o(_) {
584
- X(w), X(T), X(M), X(I), Z = !1;
585
- },
586
- d(_) {
587
- _ && oe(t), O.d(_), w && w.d(), T && T.d(), s[41](null), s[42](null), s[43](null), W && W.d(), q && q.d(), te[F].d(), s[46](null), ~S && Y[S].d();
588
- }
589
- };
590
- }
591
- let Gi = !1, Zi = 5;
592
- function It(s, t, i) {
593
- const o = t.videoWidth / t.videoHeight, a = i.width / i.height;
594
- let f = 0, n = 0, r = t.videoWidth, b = t.videoHeight;
595
- o > a ? (r = t.videoHeight * a, f = (t.videoWidth - r) / 2) : o < a && (b = t.videoWidth / a, n = (t.videoHeight - b) / 2), s.drawImage(t, f, n, r, b, 0, 0, i.width, i.height);
596
- }
597
- function xi(s, t, i) {
598
- let o, a, f, n, r, b, g, k, m, c, u, R, y, p, P, F, M, G, S, I, Z, O, w, T, W, q, he, te;
599
- A(s, ze, (e) => i(65, o = e)), A(s, Pe, (e) => i(67, f = e)), A(s, x, (e) => i(13, n = e)), A(s, gi, (e) => i(68, r = e)), A(s, Se, (e) => i(69, b = e)), A(s, _i, (e) => i(70, g = e)), A(s, pe, (e) => i(71, k = e)), A(s, de, (e) => i(14, m = e)), A(s, Fe, (e) => i(15, c = e)), A(s, Ge, (e) => i(72, u = e)), A(s, gt, (e) => i(73, R = e)), A(s, _t, (e) => i(74, y = e)), A(s, Ie, (e) => i(16, p = e)), A(s, Le, (e) => i(17, P = e)), A(s, pt, (e) => i(18, F = e)), A(s, wt, (e) => i(19, M = e)), A(s, Ze, (e) => i(20, G = e)), A(s, xe, (e) => i(75, S = e)), A(s, vt, (e) => i(76, Z = e)), A(s, pi, (e) => i(22, O = e)), A(s, Be, (e) => i(23, w = e)), A(s, $e, (e) => i(77, T = e)), A(s, We, (e) => i(78, W = e)), A(s, wi, (e) => i(24, q = e)), A(s, vi, (e) => i(25, he = e)), A(s, Ci, (e) => i(26, te = e));
600
- let D, Q, Y, ne = !1, _ = {}, V = !1, { enableMinutiae: le } = t, { videoDimensions: re } = t, { noTabs: Ue } = t, { weightsPath: Ve } = t, { showUnconformities: at } = t, { videoOverlay: Oe } = t, { videoOverlayTransparency: me } = t, { showConfigButton: nt } = t, { showCameraButton: lt } = t, { showAutoCaptureButton: rt } = t;
601
- const Te = yt(!1);
602
- A(s, Te, (e) => i(66, a = e));
603
- const Ke = yt("data:image/png;base64");
604
- A(s, Ke, (e) => i(21, I = e));
605
- let ce, N, ct = !1, be = !0, ut = 0, qe = 0, Ae = !0, Ye = 0, je = !1, Xe = (/* @__PURE__ */ new Date()).getTime(), Je = !1, C = {
606
- topLeftX: 130,
607
- topLeftY: 70,
608
- width: 540,
609
- height: 400
610
- };
611
- ki.mixin({
612
- toast: !0,
613
- position: "bottom-left",
614
- timer: 13e3,
615
- timerProgressBar: !0
616
- }), yi(async () => {
617
- h(Be, w = !1, w), ft(), await Qe(), O && (await Di(Ve), V = !0), Nt();
618
- });
619
- function ft() {
620
- h(Fe, c = !1, c), h(_t, y = !0, y), h(Ie, p = "", p), h(Se, b = et.REAR_CAMERA, b), h(x, n = j.OK, n), h(Pe, f = !1, f), h(Le, P = !1, P), h(Ze, G = ot.OK, G), h(xe, S = "", S);
621
- const e = Bt(tt);
622
- e.closedMouth = !1, e.isPersonCloseEnough = !1, e.isPersonTooclose = !0, e.isPersonInFrame = !1, tt.set(e);
623
- }
624
- function Wt() {
625
- const e = m.videoWidth, L = m.videoHeight, B = L * 0.75, E = B * 1.36;
626
- C.topLeftX = (e - E) / 2, C.topLeftY = (L - B) / 2.5, Ae || (C.topLeftX = (e - E) / 2, C.topLeftY = (L - B) / 2), C.width = E, C.height = B, h(We, W.y = C.topLeftY, W), h(We, W.height = C.height, W), h(We, W.width = C.width, W);
627
- }
628
- function dt(e, L) {
629
- e.clearRect(0, 0, N.width, N.height), e.save(), Wt(), Oe != "none" ? (me > 0 && (e.globalAlpha = me / 100), e.fillStyle = Oe, e.fillRect(0, 0, N.width, N.height)) : (e.beginPath(), e.rect(0, 0, N.width, N.height)), e.rect(C.topLeftX, C.topLeftY, C.width, C.height), me == 0 && e.clip(), It(e, L, N), e.restore(), e.save(), e.beginPath();
630
- const B = window.getComputedStyle(N).getPropertyValue("--p"), E = window.getComputedStyle(N).getPropertyValue("--su");
631
- if (e.strokeStyle = `hsl(${B})`, e.lineWidth = 12, e.lineJoin = "round", e.setLineDash([28, 8]), e.rect(C.topLeftX, C.topLeftY, C.width, C.height), e.stroke(), ne && !je) {
632
- const ie = 1 - (Ye - (/* @__PURE__ */ new Date()).getTime()) / 4500;
633
- e.save(), e.beginPath(), e.setLineDash([]), e.lineWidth = 14, e.strokeStyle = `hsl(${E})`;
634
- const _e = C.width * 3 * ie, bt = C.height * 2 * ie, fi = _e < C.width ? _e : C.width, di = bt < C.height ? bt : C.height;
635
- e.rect(C.topLeftX, C.topLeftY, fi, di), e.stroke();
636
- }
637
- e.beginPath();
638
- const H = new Path2D();
639
- H.rect(C.topLeftX, C.topLeftY, C.width, C.height), e.clip(H), It(e, L, N), e.restore();
640
- }
641
- function ht() {
642
- h(x, n = j.OK, n), ct = !0, i(12, be = !1);
643
- }
644
- async function ge() {
645
- if (O && !V)
646
- return we(D, ge);
647
- if (D) {
648
- if (T !== st.Document && !Ue)
649
- return we(D, ge);
650
- h(Be, w = !0, w), O ? (a || h(Te, a = !0, a), dt(N.getContext("2d"), D), we(D, ge)) : (dt(N.getContext("2d"), D), we(D, ge));
651
- }
652
- }
653
- async function Mt() {
654
- Z && (kt(), h(vt, Z = !1, Z)), h(Ze, G = ot.OK, G), h(Fe, c = !0, c), h(Le, P = !0, P);
655
- const e = document.createElement("canvas"), L = e.getContext("2d");
656
- e.width = C.width, e.height = C.height, L?.drawImage(D, C.topLeftX, C.topLeftY, C.width, C.height, 0, 0, e.width, e.height);
657
- const B = e.toDataURL("image/jpeg").split(",");
658
- h(Ke, I = B[0], I), h(wt, M = B[1], M), h(xe, S = B[1], S);
659
- const E = [{ data: S }];
660
- window.dispatchEvent(new CustomEvent(
661
- "document-unconformities-validated",
662
- {
663
- detail: { bodyParts: E, status: G }
664
- }
665
- ));
666
- }
667
- function Re() {
668
- const e = {
669
- bodyPart: "DOCUMENT",
670
- data: M,
671
- justification: F
672
- };
673
- h(Le, P = !0, P), window.dispatchEvent(new CustomEvent("export-document", { detail: e }));
674
- }
675
- function ue() {
676
- window.dispatchEvent(new CustomEvent("document-scrapped")), ft(), be && ht();
677
- }
678
- async function Qe(e) {
679
- const [L, B] = (re ?? "")?.replaceAll(" ", "")?.split("x")?.map((E) => E ? parseInt(E) : void 0);
680
- if (!(!L || !B)) {
681
- h(de, m = { videoWidth: L, videoHeight: B }, m);
682
- try {
683
- const { deviceId: E, width: H, height: ie, aspectRatio: _e } = await Ei(L, B, b, e);
684
- _e && _e < 1 && it() ? h(
685
- de,
686
- m = {
687
- videoWidth: ie,
688
- videoHeight: H
689
- },
690
- m
691
- ) : h(
692
- de,
693
- m = {
694
- videoWidth: H,
695
- videoHeight: ie
696
- },
697
- m
698
- ), h(pe, k = E || g[0].deviceId, k), h(x, n = j.OK, n);
699
- } catch (E) {
700
- const H = E;
701
- i(12, be = !0);
702
- const ie = Me(E) && E.constraint ? E.constraint : "";
703
- console.error(H, ie), Me(H) && "message" in H && H.message.includes("Permission denied") && (console.error("User didn't give permission to use camera!"), h(x, n = j.CAMERA_DENIED_ERROR, n)), Me(H) && "message" in H && H.message.includes("Requested device not found") && h(x, n = j.DEVICE_NOT_FOUND_ERROR, n), (ie.includes("width") || ie.includes("height")) && (console.error(`Camera does not meet the minimum supported requirements! (${ie})`), h(x, n = j.CAMERA_UNSUPPORTED, n));
704
- }
705
- }
706
- }
707
- async function fe() {
708
- h(pe, k = "", k), await Qe();
709
- }
710
- function Nt() {
711
- navigator.mediaDevices.ondevicechange = async (e) => {
712
- await Ct(), n !== j.OK ? await fe() : R.active || (Ne(), h(x, n = j.DEVICE_NOT_FOUND_ERROR, n));
713
- };
714
- }
715
- function Ht() {
716
- h(Pe, f = !1, f);
717
- const e = (/* @__PURE__ */ new Date()).getTime();
718
- e - Xe > 1e4 ? (Xe = e, h(Ie, p = "docCollector.docWasNotFound", p)) : Je || (Je = !0, setTimeout(
719
- () => {
720
- Je = !1, p != "docCollector.docWasNotFound" && h(Ie, p = "", p);
721
- },
722
- 1500
723
- ));
724
- }
725
- const Ut = de.subscribe((e) => {
726
- D && Q && (i(5, D.width = e.videoWidth, D), i(5, D.height = e.videoHeight, D), i(6, Q.width = e.videoWidth, Q), i(6, Q.height = e.videoHeight, Q), i(10, ce.width = e.videoWidth, ce), i(10, ce.height = e.videoHeight, ce), i(11, N.width = e.videoWidth, N), i(11, N.height = e.videoHeight, N));
727
- }), Vt = tt.subscribe((e) => {
728
- if (r != "DOCUMENT")
729
- return;
730
- let L = "";
731
- if (e.isPersonCloseEnough ? e.isPersonTooclose ? L = "docCollector.moveAwayCamera" : e.isPersonInFrame || (L = "docCollector.stayInFrame") : L = "docCollector.comeCloserCamera", f && Oi(L), !c && y && f && !ne && e.isPersonInFrame && !(!e.isPersonCloseEnough || e.isPersonTooclose)) {
732
- i(8, ne = !0), Ye = (/* @__PURE__ */ new Date()).getTime() + 4500;
733
- const B = setInterval(
734
- () => {
735
- if (!y || c || !e.isPersonCloseEnough || e.isPersonTooclose || !e.isPersonInFrame) {
736
- i(8, ne = !1), je = !0, setTimeout(
737
- () => {
738
- je = !1;
739
- },
740
- 1500
741
- ), clearInterval(B);
742
- return;
743
- }
744
- const E = (/* @__PURE__ */ new Date()).getTime();
745
- Math.floor((Ye - E) % (1e3 * 60) / 1e3) <= 0 && (clearInterval(B), i(8, ne = !1), document.getElementsByTagName("biometric-collector")?.[0]?.shadowRoot?.getElementById("bry-cc-capture-btn")?.click());
746
- },
747
- 250
748
- );
749
- }
750
- }), Kt = Fe.subscribe((e) => {
751
- Y && (e ? (Y.classList.remove("flex"), Y.classList.add("hidden")) : (Y.classList.add("flex"), Y.classList.remove("hidden")));
752
- }), qt = Ge.subscribe((e) => {
753
- D && e && (console.log("setting null in video srcObject"), i(5, D.srcObject = null, D), i(5, D.src = "", D), h(pe, k = null, k));
754
- });
755
- $e.subscribe(async (e) => {
756
- e === st.Document && await Ct();
757
- });
758
- const Yt = pe.subscribe(async (e) => {
759
- if (!e || r != "DOCUMENT")
760
- return;
761
- D || i(9, _ = {});
762
- const { videoHeight: L, videoWidth: B } = m;
763
- try {
764
- const E = await Ti(B, L, e);
765
- i(5, D.srcObject = E, D), h(gt, R = E, R), h(Ge, u = !1, u), Ae || h(x, n = j.CAMERA_ORIENTATION_LANDSCAPE, n);
766
- } catch (E) {
767
- const H = E;
768
- i(12, be = !0), Me(H) && "message" in H && H.message.includes("Requested device not found") && h(x, n = j.DEVICE_NOT_FOUND_ERROR, n);
769
- }
770
- }), jt = $e.subscribe(async (e) => {
771
- e === st.Document && !ct && !c && Gi && await ht();
772
- }), Xt = Te.subscribe(async (e) => {
773
- e && mt();
774
- }), Jt = Be.subscribe((e) => {
775
- e && window.dispatchEvent(new CustomEvent("brycc-camera-ready"));
776
- }), Qt = Ai.subscribe(async (e) => {
777
- if (m) {
778
- if (Ne(), !it()) {
779
- const B = (g.findIndex((H) => H.deviceId === k) + 1) % g.length, E = g[B].deviceId;
780
- await Qe(E);
781
- return;
782
- }
783
- e ? (h(Se, b = et.FRONT_CAMERA, b), await fe()) : (h(Se, b = et.REAR_CAMERA, b), await fe());
784
- }
785
- }), zt = Ri.subscribe(async (e) => {
786
- !e.isSupported || !it() || r != "DOCUMENT" || (Ne(), Ae = e.orientation.includes("landscape"), Ae ? h(x, n = j.OK, n) : h(x, n = j.CAMERA_ORIENTATION_LANDSCAPE, n), await fe());
787
- });
788
- async function mt() {
789
- let e;
790
- if (qe >= Zi) {
791
- qe = 0;
792
- const L = await Fi(), B = await import("./face_api_0e3ce8c8_2.2.21.js");
793
- let E;
794
- E = B.detectSingleFace(N, L), e = await E.withFaceLandmarks(), Q.getContext("2d")?.clearRect(0, 0, Q.width, Q.height), e != null ? (Ii(e, Q, le, !0), h(Pe, f = !0, f), Xe = (/* @__PURE__ */ new Date()).getTime()) : Ht();
795
- } else
796
- qe++;
797
- a && we(D, mt);
798
- }
799
- ze.subscribe(async (e) => {
800
- e && (ue(), h(ze, o = !1, o));
801
- }), Pi(() => {
802
- Ne(), Kt(), Vt(), Ut(), qt(), Yt(), jt(), clearInterval(ut), Xt(), Qt(), Jt(), zt(), kt(), ut = 0;
803
- });
804
- function Gt(e) {
805
- ve[e ? "unshift" : "push"](() => {
806
- D = e, i(5, D);
807
- });
808
- }
809
- const Zt = () => {
810
- h(
811
- de,
812
- m = {
813
- videoHeight: D.videoHeight,
814
- videoWidth: D.videoWidth
815
- },
816
- m
817
- );
818
- };
819
- function xt(e) {
820
- ve[e ? "unshift" : "push"](() => {
821
- N = e, i(11, N);
822
- });
823
- }
824
- function $t(e) {
825
- ve[e ? "unshift" : "push"](() => {
826
- Q = e, i(6, Q);
827
- });
828
- }
829
- function ei(e) {
830
- ve[e ? "unshift" : "push"](() => {
831
- ce = e, i(10, ce);
832
- });
833
- }
834
- const ti = () => Re(), ii = () => ue();
835
- function si(e) {
836
- ve[e ? "unshift" : "push"](() => {
837
- Y = e, i(7, Y);
838
- });
839
- }
840
- const oi = () => Re(), ai = () => ue();
841
- function ni() {
842
- F = this.value, pt.set(F);
843
- }
844
- const li = () => Re(), ri = () => ue(), ci = () => ue(), ui = async () => {
845
- await fe();
846
- };
847
- return s.$$set = (e) => {
848
- "enableMinutiae" in e && i(33, le = e.enableMinutiae), "videoDimensions" in e && i(34, re = e.videoDimensions), "noTabs" in e && i(35, Ue = e.noTabs), "weightsPath" in e && i(36, Ve = e.weightsPath), "showUnconformities" in e && i(0, at = e.showUnconformities), "videoOverlay" in e && i(37, Oe = e.videoOverlay), "videoOverlayTransparency" in e && i(38, me = e.videoOverlayTransparency), "showConfigButton" in e && i(1, nt = e.showConfigButton), "showCameraButton" in e && i(2, lt = e.showCameraButton), "showAutoCaptureButton" in e && i(3, rt = e.showAutoCaptureButton);
849
- }, [
850
- at,
851
- nt,
852
- lt,
853
- rt,
854
- ge,
855
- D,
856
- Q,
857
- Y,
858
- ne,
859
- _,
860
- ce,
861
- N,
862
- be,
863
- n,
864
- m,
865
- c,
866
- p,
867
- P,
868
- F,
869
- M,
870
- G,
871
- I,
872
- O,
873
- w,
874
- q,
875
- he,
876
- te,
877
- Te,
878
- Ke,
879
- Mt,
880
- Re,
881
- ue,
882
- fe,
883
- le,
884
- re,
885
- Ue,
886
- Ve,
887
- Oe,
888
- me,
889
- Gt,
890
- Zt,
891
- xt,
892
- $t,
893
- ei,
894
- ti,
895
- ii,
896
- si,
897
- oi,
898
- ai,
899
- ni,
900
- li,
901
- ri,
902
- ci,
903
- ui
904
- ];
905
- }
906
- class $i extends hi {
907
- constructor(t) {
908
- super(), mi(
909
- this,
910
- {
911
- target: this.shadowRoot,
912
- props: bi(this.attributes),
913
- customElement: !0
914
- },
915
- xi,
916
- zi,
917
- Lt,
918
- {
919
- enableMinutiae: 33,
920
- videoDimensions: 34,
921
- noTabs: 35,
922
- weightsPath: 36,
923
- showUnconformities: 0,
924
- videoOverlay: 37,
925
- videoOverlayTransparency: 38,
926
- showConfigButton: 1,
927
- showCameraButton: 2,
928
- showAutoCaptureButton: 3,
929
- play: 4
930
- },
931
- null,
932
- [-1, -1, -1, -1]
933
- ), t && (t.target && ee(t.target, this, t.anchor), t.props && (this.$set(t.props), se()));
934
- }
935
- static get observedAttributes() {
936
- return [
937
- "enableMinutiae",
938
- "videoDimensions",
939
- "noTabs",
940
- "weightsPath",
941
- "showUnconformities",
942
- "videoOverlay",
943
- "videoOverlayTransparency",
944
- "showConfigButton",
945
- "showCameraButton",
946
- "showAutoCaptureButton",
947
- "play"
948
- ];
949
- }
950
- get enableMinutiae() {
951
- return this.$$.ctx[33];
952
- }
953
- set enableMinutiae(t) {
954
- this.$$set({ enableMinutiae: t }), se();
955
- }
956
- get videoDimensions() {
957
- return this.$$.ctx[34];
958
- }
959
- set videoDimensions(t) {
960
- this.$$set({ videoDimensions: t }), se();
961
- }
962
- get noTabs() {
963
- return this.$$.ctx[35];
964
- }
965
- set noTabs(t) {
966
- this.$$set({ noTabs: t }), se();
967
- }
968
- get weightsPath() {
969
- return this.$$.ctx[36];
970
- }
971
- set weightsPath(t) {
972
- this.$$set({ weightsPath: t }), se();
973
- }
974
- get showUnconformities() {
975
- return this.$$.ctx[0];
976
- }
977
- set showUnconformities(t) {
978
- this.$$set({ showUnconformities: t }), se();
979
- }
980
- get videoOverlay() {
981
- return this.$$.ctx[37];
982
- }
983
- set videoOverlay(t) {
984
- this.$$set({ videoOverlay: t }), se();
985
- }
986
- get videoOverlayTransparency() {
987
- return this.$$.ctx[38];
988
- }
989
- set videoOverlayTransparency(t) {
990
- this.$$set({ videoOverlayTransparency: t }), se();
991
- }
992
- get showConfigButton() {
993
- return this.$$.ctx[1];
994
- }
995
- set showConfigButton(t) {
996
- this.$$set({ showConfigButton: t }), se();
997
- }
998
- get showCameraButton() {
999
- return this.$$.ctx[2];
1000
- }
1001
- set showCameraButton(t) {
1002
- this.$$set({ showCameraButton: t }), se();
1003
- }
1004
- get showAutoCaptureButton() {
1005
- return this.$$.ctx[3];
1006
- }
1007
- set showAutoCaptureButton(t) {
1008
- this.$$set({ showAutoCaptureButton: t }), se();
1009
- }
1010
- get play() {
1011
- return this.$$.ctx[4];
1012
- }
1013
- }
1014
- customElements.define("document-collector", $i);
1015
- export {
1016
- $i as default
1017
- };