bry-biometric-collector 2.4.0-RC01 → 2.4.0

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.
@@ -0,0 +1,1985 @@
1
+ import { S as Bi, q as Ui, r as ti, t as Vi, w as L, x as g, y as D, z as le, B as d, C as Oe, D as c, E as we, G as W, H as N, I as P, J as Pt, $ as Hi, K as f, L as ce, M as q, N as j, O as F, P as Q, Q as Ke, R as x, T as je, U as zt, V as gt, W as ie, X as pt, Y as ka, Z as vt, _ as Pe, a0 as Ra, a1 as it, a2 as Xt, a3 as di, a4 as wt, a5 as Me, a6 as Ta, a7 as Jt, a8 as Qt, a9 as Le, aa as de, ab as We, ac as at, ad as Oa, ae as hi, af as Aa, ag as Ct, ah as Yt, ai as Ia, aj as Et, ak as mi, al as bi, am as yt, an as Pa, ao as La, ap as Da, aq as Fa, ar as Na, as as Sa, at as Gt, au as J, j as It, av as Zt, aw as Ma, ax as kt, ay as Rt, az as _i, aA as Tt, A as xt, aB as st, aC as Ot, aD as Wa, aE as gi, d as Ue, aF as $t, aG as At, aH as Ba, aI as Ua, aJ as Va, aK as Ha, aL as Ka, aM as ja, aN as Ve, aO as qa, aP as Ft, aQ as za, aR as qe, aS as ze, aT as Xe, aU as Lt, aV as Ki, aW as pi, aX as Xa, aY as vi, aZ as Ja, a_ as Qa, a$ as He, b0 as nt, b1 as Ya, b2 as Ga, b3 as wi, b4 as Za, b5 as Dt, b6 as xa } from "./main_ade50a8c_2.4.0.js";
2
+ import { C as $a, T as es, a as ts } from "./TakePictureBtn_3c447bd3_2.4.0.js";
3
+ import { Box as is } from "./face_api_0e3ce8c8_2.4.0.js";
4
+ function as(a) {
5
+ let e, t, s = (
6
+ /*$_*/
7
+ a[0]("buttons.startCapture") + ""
8
+ ), n, o, l;
9
+ return {
10
+ c() {
11
+ e = g("div"), t = g("button"), n = D(s), this.c = le, d(t, "class", Oe() ? "ce-dui-btn ce-dui-btn-primary text-base text-xl pb-[2px] absolute z-20 bottom-[15%]" : "ce-dui-btn ce-dui-btn-primary text-base text-xl pb-[2px] absolute z-20 bottom-2"), d(e, "class", "flex justify-center items-center");
12
+ },
13
+ m(r, u) {
14
+ L(r, e, u), c(e, t), c(t, n), o || (l = we(
15
+ t,
16
+ "click",
17
+ /*click_handler*/
18
+ a[2]
19
+ ), o = !0);
20
+ },
21
+ p(r, [u]) {
22
+ u & /*$_*/
23
+ 1 && s !== (s = /*$_*/
24
+ r[0]("buttons.startCapture") + "") && W(n, s);
25
+ },
26
+ i: le,
27
+ o: le,
28
+ d(r) {
29
+ r && N(e), o = !1, l();
30
+ }
31
+ };
32
+ }
33
+ function ss(a, e, t) {
34
+ let s, n;
35
+ P(a, Pt, (r) => t(3, s = r)), P(a, Hi, (r) => t(0, n = r));
36
+ function o() {
37
+ f(Pt, s = !0, s);
38
+ }
39
+ return [n, o, () => o()];
40
+ }
41
+ class ji extends Bi {
42
+ constructor(e) {
43
+ super(), Ui(
44
+ this,
45
+ {
46
+ target: this.shadowRoot,
47
+ props: Vi(this.attributes),
48
+ customElement: !0
49
+ },
50
+ ss,
51
+ as,
52
+ ti,
53
+ {},
54
+ null
55
+ ), e && e.target && L(e.target, this, e.anchor);
56
+ }
57
+ }
58
+ customElements.define("start-auto-capture-btn", ji);
59
+ function Ci(a, e, t) {
60
+ const s = a.slice();
61
+ return s[123] = e[t], s;
62
+ }
63
+ function ns(a) {
64
+ let e;
65
+ return {
66
+ c() {
67
+ e = g("idlive-face-capture"), e.hidden = !0, nt(e, "mask_hidden", ""), nt(e, "auto_capture_disabled", ""), nt(e, "auto_close_disabled", ""), nt(
68
+ e,
69
+ "device_id",
70
+ /*$selectedVideoDeviceId*/
71
+ a[23]
72
+ );
73
+ },
74
+ m(t, s) {
75
+ L(t, e, s), a[51](e);
76
+ },
77
+ p(t, s) {
78
+ s[0] & /*$selectedVideoDeviceId*/
79
+ 8388608 && nt(
80
+ e,
81
+ "device_id",
82
+ /*$selectedVideoDeviceId*/
83
+ t[23]
84
+ );
85
+ },
86
+ d(t) {
87
+ t && N(e), a[51](null);
88
+ }
89
+ };
90
+ }
91
+ function Ei(a) {
92
+ let e, t, s;
93
+ return {
94
+ c() {
95
+ e = g("video"), d(e, "id", "bry-cc-camera-video-tag"), d(e, "class", "absolute -z-10"), e.playsInline = !0, e.muted = !0, e.autoplay = !0;
96
+ },
97
+ m(n, o) {
98
+ L(n, e, o), a[52](e), t || (s = [
99
+ we(
100
+ e,
101
+ "canplay",
102
+ /*canplay_handler*/
103
+ a[53]
104
+ ),
105
+ we(
106
+ e,
107
+ "play",
108
+ /*play*/
109
+ a[8],
110
+ { once: !0 }
111
+ )
112
+ ], t = !0);
113
+ },
114
+ p: le,
115
+ d(n) {
116
+ n && N(e), a[52](null), t = !1, Ft(s);
117
+ }
118
+ };
119
+ }
120
+ function yi(a) {
121
+ let e, t;
122
+ return e = new za({}), {
123
+ c() {
124
+ qe(e.$$.fragment);
125
+ },
126
+ m(s, n) {
127
+ ze(e, s, n), t = !0;
128
+ },
129
+ i(s) {
130
+ t || (Q(e.$$.fragment, s), t = !0);
131
+ },
132
+ o(s) {
133
+ x(e.$$.fragment, s), t = !1;
134
+ },
135
+ d(s) {
136
+ Xe(e, s);
137
+ }
138
+ };
139
+ }
140
+ function ki(a) {
141
+ let e, t;
142
+ return e = new $a({}), {
143
+ c() {
144
+ qe(e.$$.fragment);
145
+ },
146
+ m(s, n) {
147
+ ze(e, s, n), t = !0;
148
+ },
149
+ i(s) {
150
+ t || (Q(e.$$.fragment, s), t = !0);
151
+ },
152
+ o(s) {
153
+ x(e.$$.fragment, s), t = !1;
154
+ },
155
+ d(s) {
156
+ Xe(e, s);
157
+ }
158
+ };
159
+ }
160
+ function Ri(a) {
161
+ let e, t;
162
+ return e = new ji({}), {
163
+ c() {
164
+ qe(e.$$.fragment);
165
+ },
166
+ m(s, n) {
167
+ ze(e, s, n), t = !0;
168
+ },
169
+ i(s) {
170
+ t || (Q(e.$$.fragment, s), t = !0);
171
+ },
172
+ o(s) {
173
+ x(e.$$.fragment, s), t = !1;
174
+ },
175
+ d(s) {
176
+ Xe(e, s);
177
+ }
178
+ };
179
+ }
180
+ function Ti(a) {
181
+ let e, t;
182
+ return e = new es({
183
+ props: {
184
+ disabled: !/*enableCaptureButton*/
185
+ a[14] && /*$enableFaceApi*/
186
+ a[34] || !/*$ready*/
187
+ a[22] && !/*$enableFaceApi*/
188
+ a[34],
189
+ hidden: (
190
+ /*$cameraStatusStore*/
191
+ a[21] !== j.OK || q() && /*idrndLoading*/
192
+ (a[17] || /*idrndClosed*/
193
+ a[18] || /*waitingIdrndCaptureEvent*/
194
+ a[19])
195
+ ),
196
+ handler: (
197
+ /*capture*/
198
+ a[40]
199
+ )
200
+ }
201
+ }), {
202
+ c() {
203
+ qe(e.$$.fragment);
204
+ },
205
+ m(s, n) {
206
+ ze(e, s, n), t = !0;
207
+ },
208
+ p(s, n) {
209
+ const o = {};
210
+ n[0] & /*enableCaptureButton, $ready*/
211
+ 4210688 | n[1] & /*$enableFaceApi*/
212
+ 8 && (o.disabled = !/*enableCaptureButton*/
213
+ s[14] && /*$enableFaceApi*/
214
+ s[34] || !/*$ready*/
215
+ s[22] && !/*$enableFaceApi*/
216
+ s[34]), n[0] & /*$cameraStatusStore, idrndLoading, idrndClosed, waitingIdrndCaptureEvent*/
217
+ 3014656 && (o.hidden = /*$cameraStatusStore*/
218
+ s[21] !== j.OK || q() && /*idrndLoading*/
219
+ (s[17] || /*idrndClosed*/
220
+ s[18] || /*waitingIdrndCaptureEvent*/
221
+ s[19])), e.$set(o);
222
+ },
223
+ i(s) {
224
+ t || (Q(e.$$.fragment, s), t = !0);
225
+ },
226
+ o(s) {
227
+ x(e.$$.fragment, s), t = !1;
228
+ },
229
+ d(s) {
230
+ Xe(e, s);
231
+ }
232
+ };
233
+ }
234
+ function Oi(a) {
235
+ let e, t = (
236
+ /*$_*/
237
+ a[31]("faceCollector.stayStill") + ""
238
+ ), s;
239
+ return {
240
+ c() {
241
+ e = g("span"), s = D(t), d(e, "class", "absolute left-1/2 -translate-x-1/2 ce-dui-badge ce-dui-badge-lg h-[2em] text-xl xl:text-base w-[12.1em] " + (Oe() ? "top-[5%]" : "top-[2%]"));
242
+ },
243
+ m(n, o) {
244
+ L(n, e, o), c(e, s);
245
+ },
246
+ p(n, o) {
247
+ o[1] & /*$_*/
248
+ 1 && t !== (t = /*$_*/
249
+ n[31]("faceCollector.stayStill") + "") && W(s, t);
250
+ },
251
+ d(n) {
252
+ n && N(e);
253
+ }
254
+ };
255
+ }
256
+ function Ai(a) {
257
+ let e, t = (
258
+ /*$_*/
259
+ a[31](`${/*$faceValidationAlert*/
260
+ a[26]}`) + ""
261
+ ), s;
262
+ return {
263
+ c() {
264
+ e = g("span"), s = D(t), d(e, "class", "absolute left-1/2 -translate-x-1/2 ce-dui-badge ce-dui-badge-lg h-[2em] text-xl xl:text-base w-[12.1em] " + (Oe() ? "top-[5%]" : "top-[2%]"));
265
+ },
266
+ m(n, o) {
267
+ L(n, e, o), c(e, s);
268
+ },
269
+ p(n, o) {
270
+ o[0] & /*$faceValidationAlert*/
271
+ 67108864 | o[1] & /*$_*/
272
+ 1 && t !== (t = /*$_*/
273
+ n[31](`${/*$faceValidationAlert*/
274
+ n[26]}`) + "") && W(s, t);
275
+ },
276
+ d(n) {
277
+ n && N(e);
278
+ }
279
+ };
280
+ }
281
+ function Ii(a) {
282
+ let e, t, s, n, o;
283
+ function l(h, b) {
284
+ return (
285
+ /*$isLoading*/
286
+ h[35] ? ls : os
287
+ );
288
+ }
289
+ let r = l(a), u = r(a);
290
+ return {
291
+ c() {
292
+ e = g("slot"), t = g("div"), s = g("img"), o = F(), u.c(), Lt(s.src, n = Ki) || d(s, "src", n), d(s, "alt", "loading gif"), d(s, "class", "m-auto h-[10em] lg:h-[12em]"), d(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), d(e, "name", "obtaining-photo-gif"), d(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
293
+ },
294
+ m(h, b) {
295
+ L(h, e, b), c(e, t), c(t, s), c(t, o), u.m(t, null);
296
+ },
297
+ p(h, b) {
298
+ r === (r = l(h)) && u ? u.p(h, b) : (u.d(1), u = r(h), u && (u.c(), u.m(t, null)));
299
+ },
300
+ d(h) {
301
+ h && N(e), u.d();
302
+ }
303
+ };
304
+ }
305
+ function os(a) {
306
+ let e, t = (
307
+ /*$_*/
308
+ a[31]("faceCollector.obtainingPicture") + ""
309
+ ), s;
310
+ return {
311
+ c() {
312
+ e = g("span"), s = D(t), d(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
313
+ },
314
+ m(n, o) {
315
+ L(n, e, o), c(e, s);
316
+ },
317
+ p(n, o) {
318
+ o[1] & /*$_*/
319
+ 1 && t !== (t = /*$_*/
320
+ n[31]("faceCollector.obtainingPicture") + "") && W(s, t);
321
+ },
322
+ d(n) {
323
+ n && N(e);
324
+ }
325
+ };
326
+ }
327
+ function ls(a) {
328
+ let e;
329
+ return {
330
+ c() {
331
+ e = g("span"), e.textContent = "Obtaining photo...", d(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
332
+ },
333
+ m(t, s) {
334
+ L(t, e, s);
335
+ },
336
+ p: le,
337
+ d(t) {
338
+ t && N(e);
339
+ }
340
+ };
341
+ }
342
+ function Pi(a) {
343
+ let e, t, s, n, o;
344
+ function l(h, b) {
345
+ return (
346
+ /*$isLoading*/
347
+ h[35] ? cs : rs
348
+ );
349
+ }
350
+ let r = l(a), u = r(a);
351
+ return {
352
+ c() {
353
+ e = g("slot"), t = g("div"), s = g("img"), o = F(), u.c(), Lt(s.src, n = Ki) || d(s, "src", n), d(s, "alt", "loading gif"), d(s, "class", "m-auto h-[10em] lg:h-[12em]"), d(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), d(e, "name", "loading-camera-gif"), d(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
354
+ },
355
+ m(h, b) {
356
+ L(h, e, b), c(e, t), c(t, s), c(t, o), u.m(t, null);
357
+ },
358
+ p(h, b) {
359
+ r === (r = l(h)) && u ? u.p(h, b) : (u.d(1), u = r(h), u && (u.c(), u.m(t, null)));
360
+ },
361
+ d(h) {
362
+ h && N(e), u.d();
363
+ }
364
+ };
365
+ }
366
+ function rs(a) {
367
+ let e, t = (
368
+ /*$_*/
369
+ a[31]("faceCollector.initiatingCamera") + ""
370
+ ), s;
371
+ return {
372
+ c() {
373
+ e = g("span"), s = D(t), d(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
374
+ },
375
+ m(n, o) {
376
+ L(n, e, o), c(e, s);
377
+ },
378
+ p(n, o) {
379
+ o[1] & /*$_*/
380
+ 1 && t !== (t = /*$_*/
381
+ n[31]("faceCollector.initiatingCamera") + "") && W(s, t);
382
+ },
383
+ d(n) {
384
+ n && N(e);
385
+ }
386
+ };
387
+ }
388
+ function cs(a) {
389
+ let e;
390
+ return {
391
+ c() {
392
+ e = g("span"), e.textContent = "Loading camera...", d(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
393
+ },
394
+ m(t, s) {
395
+ L(t, e, s);
396
+ },
397
+ p: le,
398
+ d(t) {
399
+ t && N(e);
400
+ }
401
+ };
402
+ }
403
+ function Li(a) {
404
+ let e, t, s = (
405
+ /*$_*/
406
+ a[31]("faceCollector.finish") + ""
407
+ ), n, o, l, r, u = (
408
+ /*$_*/
409
+ a[31]("faceCollector.retakePhoto") + ""
410
+ ), h, b, C;
411
+ return {
412
+ c() {
413
+ e = g("div"), t = g("button"), n = D(s), l = F(), r = g("button"), h = D(u), t.disabled = o = /*$justification*/
414
+ a[28].length === 0, d(t, "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(e, "class", "ce-dui-btn-group flex");
415
+ },
416
+ m(p, m) {
417
+ L(p, e, m), c(e, t), c(t, n), c(e, l), c(e, r), c(r, h), b || (C = [
418
+ we(
419
+ t,
420
+ "click",
421
+ /*click_handler*/
422
+ a[57]
423
+ ),
424
+ we(
425
+ r,
426
+ "click",
427
+ /*click_handler_1*/
428
+ a[58]
429
+ )
430
+ ], b = !0);
431
+ },
432
+ p(p, m) {
433
+ m[1] & /*$_*/
434
+ 1 && s !== (s = /*$_*/
435
+ p[31]("faceCollector.finish") + "") && W(n, s), m[0] & /*$justification*/
436
+ 268435456 && o !== (o = /*$justification*/
437
+ p[28].length === 0) && (t.disabled = o), m[1] & /*$_*/
438
+ 1 && u !== (u = /*$_*/
439
+ p[31]("faceCollector.retakePhoto") + "") && W(h, u);
440
+ },
441
+ d(p) {
442
+ p && N(e), b = !1, Ft(C);
443
+ }
444
+ };
445
+ }
446
+ function us(a) {
447
+ let e, t;
448
+ return e = new ts({ props: { handler: (
449
+ /*func*/
450
+ a[67]
451
+ ) } }), {
452
+ c() {
453
+ qe(e.$$.fragment);
454
+ },
455
+ m(s, n) {
456
+ ze(e, s, n), t = !0;
457
+ },
458
+ p: le,
459
+ i(s) {
460
+ t || (Q(e.$$.fragment, s), t = !0);
461
+ },
462
+ o(s) {
463
+ x(e.$$.fragment, s), t = !1;
464
+ },
465
+ d(s) {
466
+ Xe(e, s);
467
+ }
468
+ };
469
+ }
470
+ function fs(a) {
471
+ let e, t, s, n, o, l, r, u, h;
472
+ const b = [
473
+ _s,
474
+ bs,
475
+ ms,
476
+ hs,
477
+ ds
478
+ ], C = [];
479
+ function p(m, T) {
480
+ return (
481
+ /*$captured*/
482
+ m[24] ? (
483
+ /*$unconformitiesStore*/
484
+ m[32].isLoading ? 1 : (
485
+ /*$requestResult*/
486
+ m[30] !== J.OK ? 2 : (
487
+ /*$saved*/
488
+ m[27] ? 4 : 3
489
+ )
490
+ )
491
+ ) : 0
492
+ );
493
+ }
494
+ return l = p(a), r = C[l] = b[l](a), {
495
+ c() {
496
+ e = g("div"), t = g("img"), o = F(), r.c(), d(t, "class", "m-auto col-start-1 col-end-1 max-h-[23.2em]"), Lt(t.src, s = /*$dataTypePrefix*/
497
+ a[33] + "," + /*$image*/
498
+ a[29]) || d(t, "src", s), t.hidden = n = !/*$captured*/
499
+ a[24] || !/*$showFaceWhileValidating*/
500
+ a[36] && /*$unconformitiesStore*/
501
+ a[32].isLoading, d(t, "alt", ""), d(e, "class", u = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (!/*$showFaceWhileValidating*/
502
+ a[36] && /*$unconformitiesStore*/
503
+ a[32].isLoading ? "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible" : "grid overflow-hidden"));
504
+ },
505
+ m(m, T) {
506
+ L(m, e, T), c(e, t), c(e, o), C[l].m(e, null), h = !0;
507
+ },
508
+ p(m, T) {
509
+ (!h || T[0] & /*$image*/
510
+ 536870912 | T[1] & /*$dataTypePrefix*/
511
+ 4 && !Lt(t.src, s = /*$dataTypePrefix*/
512
+ m[33] + "," + /*$image*/
513
+ m[29])) && d(t, "src", s), (!h || T[0] & /*$captured*/
514
+ 16777216 | T[1] & /*$showFaceWhileValidating, $unconformitiesStore*/
515
+ 34 && n !== (n = !/*$captured*/
516
+ m[24] || !/*$showFaceWhileValidating*/
517
+ m[36] && /*$unconformitiesStore*/
518
+ m[32].isLoading)) && (t.hidden = n);
519
+ let _ = l;
520
+ l = p(m), l === _ ? C[l].p(m, T) : (Ke(), x(C[_], 1, 1, () => {
521
+ C[_] = null;
522
+ }), je(), r = C[l], r ? r.p(m, T) : (r = C[l] = b[l](m), r.c()), Q(r, 1), r.m(e, null)), (!h || T[1] & /*$showFaceWhileValidating, $unconformitiesStore*/
523
+ 34 && u !== (u = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (!/*$showFaceWhileValidating*/
524
+ m[36] && /*$unconformitiesStore*/
525
+ m[32].isLoading ? "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible" : "grid overflow-hidden"))) && d(e, "class", u);
526
+ },
527
+ i(m) {
528
+ h || (Q(r), h = !0);
529
+ },
530
+ o(m) {
531
+ x(r), h = !1;
532
+ },
533
+ d(m) {
534
+ m && N(e), C[l].d();
535
+ }
536
+ };
537
+ }
538
+ function ds(a) {
539
+ let e, t, s = (
540
+ /*$_*/
541
+ a[31]("faceCollector.captured") + ""
542
+ ), n, o, l, r, u, h = (
543
+ /*$_*/
544
+ a[31]("faceCollector.retakePhoto") + ""
545
+ ), b, C, p = It(Ya).faceStrategy !== Ga.DISABLED, m, T, _, y = (
546
+ /*$unconformitiesStore*/
547
+ a[32].unconformities.length !== 0 && Di(a)
548
+ ), w = p && gs();
549
+ return {
550
+ c() {
551
+ e = g("div"), t = g("h1"), n = D(s), o = F(), y && y.c(), l = F(), r = g("div"), u = g("button"), b = D(h), C = F(), w && w.c(), d(t, "class", "text-3xl font-bold pb-[1em] transition-opacity"), d(u, "id", "bry-cc-retake-button"), d(u, "class", "ce-dui-btn ce-dui-btn-block flex-shrink text-base"), d(r, "class", "flex flex-row"), wi(r, "ce-dui-btn-group", !/*$exportButtonDisabled*/
552
+ a[37]);
553
+ },
554
+ m(S, z) {
555
+ L(S, e, z), c(e, t), c(t, n), c(e, o), y && y.m(e, null), c(e, l), c(e, r), c(r, u), c(u, b), c(r, C), w && w.m(r, null), m = !0, T || (_ = we(
556
+ u,
557
+ "click",
558
+ /*click_handler_6*/
559
+ a[66]
560
+ ), T = !0);
561
+ },
562
+ p(S, z) {
563
+ (!m || z[1] & /*$_*/
564
+ 1) && s !== (s = /*$_*/
565
+ S[31]("faceCollector.captured") + "") && W(n, s), /*$unconformitiesStore*/
566
+ S[32].unconformities.length !== 0 ? y ? y.p(S, z) : (y = Di(S), y.c(), y.m(e, l)) : y && (y.d(1), y = null), (!m || z[1] & /*$_*/
567
+ 1) && h !== (h = /*$_*/
568
+ S[31]("faceCollector.retakePhoto") + "") && W(b, h), (!m || z[1] & /*$exportButtonDisabled*/
569
+ 64) && wi(r, "ce-dui-btn-group", !/*$exportButtonDisabled*/
570
+ S[37]);
571
+ },
572
+ i(S) {
573
+ m || (Q(w), m = !0);
574
+ },
575
+ o(S) {
576
+ x(w), m = !1;
577
+ },
578
+ d(S) {
579
+ S && N(e), y && y.d(), w && w.d(), T = !1, _();
580
+ }
581
+ };
582
+ }
583
+ function hs(a) {
584
+ let e, t, s = (
585
+ /*evaluatePhoto*/
586
+ (a[2] ? (
587
+ /*$_*/
588
+ a[31]("faceCollector.unconformities")
589
+ ) : (
590
+ /*$_*/
591
+ a[31]("faceCollector.previewCapture")
592
+ )) + ""
593
+ ), n, o, l, r, u, h, b = (
594
+ /*$unconformitiesStore*/
595
+ a[32].unconformities
596
+ ), C = [];
597
+ for (let _ = 0; _ < b.length; _ += 1)
598
+ C[_] = Fi(Ci(a, b, _));
599
+ let p = (
600
+ /*evaluatePhoto*/
601
+ a[2] && /*$unconformitiesStore*/
602
+ a[32].unconformities.length == 0 && Ni(a)
603
+ ), m = (
604
+ /*showJustificationField*/
605
+ a[7] && Si(a)
606
+ ), T = (
607
+ /*$captured*/
608
+ a[24] && Mi(a)
609
+ );
610
+ return {
611
+ c() {
612
+ e = g("div"), t = g("h1"), n = D(s), o = F(), l = g("div");
613
+ for (let _ = 0; _ < C.length; _ += 1)
614
+ C[_].c();
615
+ r = F(), p && p.c(), u = F(), m && m.c(), h = F(), T && T.c(), d(t, "class", "text-3xl font-bold transition-opacity"), d(l, "class", "flex flex-wrap"), d(e, "class", "flex flex-col justify-between");
616
+ },
617
+ m(_, y) {
618
+ L(_, e, y), c(e, t), c(t, n), c(e, o), c(e, l);
619
+ for (let w = 0; w < C.length; w += 1)
620
+ C[w] && C[w].m(l, null);
621
+ c(l, r), p && p.m(l, null), c(e, u), m && m.m(e, null), c(e, h), T && T.m(e, null);
622
+ },
623
+ p(_, y) {
624
+ if (y[0] & /*evaluatePhoto*/
625
+ 4 | y[1] & /*$_*/
626
+ 1 && s !== (s = /*evaluatePhoto*/
627
+ (_[2] ? (
628
+ /*$_*/
629
+ _[31]("faceCollector.unconformities")
630
+ ) : (
631
+ /*$_*/
632
+ _[31]("faceCollector.previewCapture")
633
+ )) + "") && W(n, s), y[1] & /*$unconformitiesStore*/
634
+ 2) {
635
+ b = /*$unconformitiesStore*/
636
+ _[32].unconformities;
637
+ let w;
638
+ for (w = 0; w < b.length; w += 1) {
639
+ const S = Ci(_, b, w);
640
+ C[w] ? C[w].p(S, y) : (C[w] = Fi(S), C[w].c(), C[w].m(l, r));
641
+ }
642
+ for (; w < C.length; w += 1)
643
+ C[w].d(1);
644
+ C.length = b.length;
645
+ }
646
+ /*evaluatePhoto*/
647
+ _[2] && /*$unconformitiesStore*/
648
+ _[32].unconformities.length == 0 ? p ? p.p(_, y) : (p = Ni(_), p.c(), p.m(l, null)) : p && (p.d(1), p = null), /*showJustificationField*/
649
+ _[7] ? m ? m.p(_, y) : (m = Si(_), m.c(), m.m(e, h)) : m && (m.d(1), m = null), /*$captured*/
650
+ _[24] ? T ? T.p(_, y) : (T = Mi(_), T.c(), T.m(e, null)) : T && (T.d(1), T = null);
651
+ },
652
+ i: le,
653
+ o: le,
654
+ d(_) {
655
+ _ && N(e), Za(C, _), p && p.d(), m && m.d(), T && T.d();
656
+ }
657
+ };
658
+ }
659
+ function ms(a) {
660
+ let e, t, s, n, o = (
661
+ /*$_*/
662
+ a[31]("faceCollector.finish") + ""
663
+ ), l, r, u, h = (
664
+ /*$_*/
665
+ a[31]("faceCollector.retakePhoto") + ""
666
+ ), b, C, p;
667
+ function m(y, w) {
668
+ return (
669
+ /*$requestResult*/
670
+ y[30] === J.LIVENESS_DETECTION_FAILURE || /*$requestResult*/
671
+ y[30] === J.UNKNOWN_LIVENESS_ERROR ? ys : (
672
+ /*$requestResult*/
673
+ y[30] === J.LOW_LIVENESS_SCORE ? Es : (
674
+ /*$requestResult*/
675
+ y[30] === J.TEMPLATE_EXTRACTION_ERROR || /*$requestResult*/
676
+ y[30] === J.UNKNOWN_TEMPLATE_EXTRACTION_ERROR ? Cs : (
677
+ /*$requestResult*/
678
+ y[30] === J.UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE ? ws : (
679
+ /*$requestResult*/
680
+ y[30] === J.LIVENESS_EVALUATION_ERROR ? vs : ps
681
+ )
682
+ )
683
+ )
684
+ )
685
+ );
686
+ }
687
+ let T = m(a), _ = T(a);
688
+ return {
689
+ c() {
690
+ e = g("div"), _.c(), t = F(), s = g("div"), n = g("button"), l = D(o), r = F(), u = g("button"), b = D(h), n.disabled = !0, d(n, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), d(u, "id", "bry-cc-retake-button"), d(u, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), d(s, "class", "ce-dui-btn-group flex"), d(e, "class", "flex flex-col justify-between");
691
+ },
692
+ m(y, w) {
693
+ L(y, e, w), _.m(e, null), c(e, t), c(e, s), c(s, n), c(n, l), c(s, r), c(s, u), c(u, b), C || (p = [
694
+ we(
695
+ n,
696
+ "click",
697
+ /*click_handler_2*/
698
+ a[60]
699
+ ),
700
+ we(
701
+ u,
702
+ "click",
703
+ /*click_handler_3*/
704
+ a[61]
705
+ )
706
+ ], C = !0);
707
+ },
708
+ p(y, w) {
709
+ T === (T = m(y)) && _ ? _.p(y, w) : (_.d(1), _ = T(y), _ && (_.c(), _.m(e, t))), w[1] & /*$_*/
710
+ 1 && o !== (o = /*$_*/
711
+ y[31]("faceCollector.finish") + "") && W(l, o), w[1] & /*$_*/
712
+ 1 && h !== (h = /*$_*/
713
+ y[31]("faceCollector.retakePhoto") + "") && W(b, h);
714
+ },
715
+ i: le,
716
+ o: le,
717
+ d(y) {
718
+ y && N(e), _.d(), C = !1, Ft(p);
719
+ }
720
+ };
721
+ }
722
+ function bs(a) {
723
+ let e, t, s = (
724
+ /*$_*/
725
+ a[31]("faceCollector.validating") + ""
726
+ ), n, o, l;
727
+ return {
728
+ c() {
729
+ e = g("div"), t = g("h1"), n = D(s), o = F(), l = g("div"), d(t, "class", "inline-block text-3xl font-bold pb-[1em] transition-opacity"), d(l, "class", "ml-6 inline-block dot-typing"), d(e, "class", "min-w-[200px]");
730
+ },
731
+ m(r, u) {
732
+ L(r, e, u), c(e, t), c(t, n), c(e, o), c(e, l);
733
+ },
734
+ p(r, u) {
735
+ u[1] & /*$_*/
736
+ 1 && s !== (s = /*$_*/
737
+ r[31]("faceCollector.validating") + "") && W(n, s);
738
+ },
739
+ i: le,
740
+ o: le,
741
+ d(r) {
742
+ r && N(e);
743
+ }
744
+ };
745
+ }
746
+ function _s(a) {
747
+ let e;
748
+ return {
749
+ c() {
750
+ e = g("div"), d(e, "class", "");
751
+ },
752
+ m(t, s) {
753
+ L(t, e, s);
754
+ },
755
+ p: le,
756
+ i: le,
757
+ o: le,
758
+ d(t) {
759
+ t && N(e);
760
+ }
761
+ };
762
+ }
763
+ function Di(a) {
764
+ let e, t, s = (
765
+ /*$_*/
766
+ a[31]("faceCollector.justification") + ""
767
+ ), n, o, l, r, u;
768
+ return {
769
+ c() {
770
+ e = g("label"), t = g("span"), n = D(s), o = F(), l = g("textarea"), d(t, "class", "ce-dui-label-text text-base"), d(e, "class", "ce-dui-label"), d(e, "for", "justification"), d(l, "contenteditable", ""), d(l, "id", "justification"), d(l, "class", "ce-dui-textarea ce-dui-textarea-bordered textarea-ghost h-[6em] w-full text-base");
771
+ },
772
+ m(h, b) {
773
+ L(h, e, b), c(e, t), c(t, n), L(h, o, b), L(h, l, b), Dt(
774
+ l,
775
+ /*$justification*/
776
+ a[28]
777
+ ), r || (u = we(
778
+ l,
779
+ "input",
780
+ /*textarea_input_handler_1*/
781
+ a[65]
782
+ ), r = !0);
783
+ },
784
+ p(h, b) {
785
+ b[1] & /*$_*/
786
+ 1 && s !== (s = /*$_*/
787
+ h[31]("faceCollector.justification") + "") && W(n, s), b[0] & /*$justification*/
788
+ 268435456 && Dt(
789
+ l,
790
+ /*$justification*/
791
+ h[28]
792
+ );
793
+ },
794
+ d(h) {
795
+ h && N(e), h && N(o), h && N(l), r = !1, u();
796
+ }
797
+ };
798
+ }
799
+ function gs(a) {
800
+ let e, t;
801
+ return e = new xa({
802
+ props: { cssClass: "ce-dui-btn-block flex-shrink" }
803
+ }), {
804
+ c() {
805
+ qe(e.$$.fragment);
806
+ },
807
+ m(s, n) {
808
+ ze(e, s, n), t = !0;
809
+ },
810
+ i(s) {
811
+ t || (Q(e.$$.fragment, s), t = !0);
812
+ },
813
+ o(s) {
814
+ x(e.$$.fragment, s), t = !1;
815
+ },
816
+ d(s) {
817
+ Xe(e, s);
818
+ }
819
+ };
820
+ }
821
+ function Fi(a) {
822
+ let e, t = (
823
+ /*unconformity*/
824
+ a[123] + ""
825
+ ), s;
826
+ return {
827
+ c() {
828
+ e = g("div"), s = D(t), d(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-error text-xl pb-[.25em] m-[.5em]");
829
+ },
830
+ m(n, o) {
831
+ L(n, e, o), c(e, s);
832
+ },
833
+ p(n, o) {
834
+ o[1] & /*$unconformitiesStore*/
835
+ 2 && t !== (t = /*unconformity*/
836
+ n[123] + "") && W(s, t);
837
+ },
838
+ d(n) {
839
+ n && N(e);
840
+ }
841
+ };
842
+ }
843
+ function Ni(a) {
844
+ let e, t = (
845
+ /*$_*/
846
+ a[31]("faceCollector.noNonconformity") + ""
847
+ ), s;
848
+ return {
849
+ c() {
850
+ e = g("div"), s = D(t), d(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-info text-xl pb-[.25em] m-[.5em]");
851
+ },
852
+ m(n, o) {
853
+ L(n, e, o), c(e, s);
854
+ },
855
+ p(n, o) {
856
+ o[1] & /*$_*/
857
+ 1 && t !== (t = /*$_*/
858
+ n[31]("faceCollector.noNonconformity") + "") && W(s, t);
859
+ },
860
+ d(n) {
861
+ n && N(e);
862
+ }
863
+ };
864
+ }
865
+ function Si(a) {
866
+ let e, t, s, n = (
867
+ /*$_*/
868
+ a[31]("faceCollector.provideAReasonForTheLowQualityCapture") + ""
869
+ ), o, l, r, u, h, b, C, p, m = (
870
+ /*$_*/
871
+ a[31]("faceCollector.thisInformationIsRequired") + ""
872
+ ), T, _, y, w;
873
+ return {
874
+ c() {
875
+ e = g("div"), t = g("label"), s = g("span"), o = D(n), l = F(), r = g("textarea"), h = F(), b = g("label"), C = g("span"), p = D("("), T = D(m), _ = D(")"), d(s, "class", "ce-dui-label-text text-base"), d(t, "class", "ce-dui-label"), d(t, "for", "justification"), d(r, "contenteditable", ""), d(r, "id", "justification"), d(r, "class", "ce-dui-textarea ce-dui-textarea-bordered h-[6em] text-base"), d(r, "placeholder", u = /*$_*/
876
+ a[31]("faceCollector.yourJustification")), d(C, "class", "ce-dui-label-text-alt text-base"), d(b, "class", "ce-dui-label"), d(b, "for", "justification"), d(e, "class", "ce-dui-form-control");
877
+ },
878
+ m(S, z) {
879
+ L(S, e, z), c(e, t), c(t, s), c(s, o), c(e, l), c(e, r), Dt(
880
+ r,
881
+ /*$justification*/
882
+ a[28]
883
+ ), c(e, h), c(e, b), c(b, C), c(C, p), c(C, T), c(C, _), y || (w = we(
884
+ r,
885
+ "input",
886
+ /*textarea_input_handler*/
887
+ a[62]
888
+ ), y = !0);
889
+ },
890
+ p(S, z) {
891
+ z[1] & /*$_*/
892
+ 1 && n !== (n = /*$_*/
893
+ S[31]("faceCollector.provideAReasonForTheLowQualityCapture") + "") && W(o, n), z[1] & /*$_*/
894
+ 1 && u !== (u = /*$_*/
895
+ S[31]("faceCollector.yourJustification")) && d(r, "placeholder", u), z[0] & /*$justification*/
896
+ 268435456 && Dt(
897
+ r,
898
+ /*$justification*/
899
+ S[28]
900
+ ), z[1] & /*$_*/
901
+ 1 && m !== (m = /*$_*/
902
+ S[31]("faceCollector.thisInformationIsRequired") + "") && W(T, m);
903
+ },
904
+ d(S) {
905
+ S && N(e), y = !1, w();
906
+ }
907
+ };
908
+ }
909
+ function Mi(a) {
910
+ let e, t, s = (
911
+ /*$_*/
912
+ a[31]("faceCollector.finish") + ""
913
+ ), n, o, l, r, u = (
914
+ /*$_*/
915
+ a[31]("faceCollector.retakePhoto") + ""
916
+ ), h, b, C;
917
+ return {
918
+ c() {
919
+ e = g("div"), t = g("button"), n = D(s), l = F(), r = g("button"), h = D(u), t.disabled = o = /*$justification*/
920
+ a[28].length === 0 && /*showJustificationField*/
921
+ a[7], d(t, "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(e, "class", "ce-dui-btn-group flex");
922
+ },
923
+ m(p, m) {
924
+ L(p, e, m), c(e, t), c(t, n), c(e, l), c(e, r), c(r, h), b || (C = [
925
+ we(
926
+ t,
927
+ "click",
928
+ /*click_handler_4*/
929
+ a[63]
930
+ ),
931
+ we(
932
+ r,
933
+ "click",
934
+ /*click_handler_5*/
935
+ a[64]
936
+ )
937
+ ], b = !0);
938
+ },
939
+ p(p, m) {
940
+ m[1] & /*$_*/
941
+ 1 && s !== (s = /*$_*/
942
+ p[31]("faceCollector.finish") + "") && W(n, s), m[0] & /*$justification, showJustificationField*/
943
+ 268435584 && o !== (o = /*$justification*/
944
+ p[28].length === 0 && /*showJustificationField*/
945
+ p[7]) && (t.disabled = o), m[1] & /*$_*/
946
+ 1 && u !== (u = /*$_*/
947
+ p[31]("faceCollector.retakePhoto") + "") && W(h, u);
948
+ },
949
+ d(p) {
950
+ p && N(e), b = !1, Ft(C);
951
+ }
952
+ };
953
+ }
954
+ function ps(a) {
955
+ let e, t = (
956
+ /*$_*/
957
+ a[31]("faceCollector.everythingOk") + ""
958
+ ), s;
959
+ return {
960
+ c() {
961
+ e = g("h1"), s = D(t), d(e, "class", "text-3xl font-bold pb-[1em] transition-opacity");
962
+ },
963
+ m(n, o) {
964
+ L(n, e, o), c(e, s);
965
+ },
966
+ p(n, o) {
967
+ o[1] & /*$_*/
968
+ 1 && t !== (t = /*$_*/
969
+ n[31]("faceCollector.everythingOk") + "") && W(s, t);
970
+ },
971
+ d(n) {
972
+ n && N(e);
973
+ }
974
+ };
975
+ }
976
+ function vs(a) {
977
+ let e, t = (
978
+ /*$_*/
979
+ a[31]("liveness.error.evaluationError") + ""
980
+ ), s;
981
+ return {
982
+ c() {
983
+ e = g("h1"), s = D(t), d(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
984
+ },
985
+ m(n, o) {
986
+ L(n, e, o), c(e, s);
987
+ },
988
+ p(n, o) {
989
+ o[1] & /*$_*/
990
+ 1 && t !== (t = /*$_*/
991
+ n[31]("liveness.error.evaluationError") + "") && W(s, t);
992
+ },
993
+ d(n) {
994
+ n && N(e);
995
+ }
996
+ };
997
+ }
998
+ function ws(a) {
999
+ let e, t = (
1000
+ /*$_*/
1001
+ a[31]("faceCollector.unableToCompleteRequest") + ""
1002
+ ), s;
1003
+ return {
1004
+ c() {
1005
+ e = g("h1"), s = D(t), d(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1006
+ },
1007
+ m(n, o) {
1008
+ L(n, e, o), c(e, s);
1009
+ },
1010
+ p(n, o) {
1011
+ o[1] & /*$_*/
1012
+ 1 && t !== (t = /*$_*/
1013
+ n[31]("faceCollector.unableToCompleteRequest") + "") && W(s, t);
1014
+ },
1015
+ d(n) {
1016
+ n && N(e);
1017
+ }
1018
+ };
1019
+ }
1020
+ function Cs(a) {
1021
+ let e, t = (
1022
+ /*$_*/
1023
+ a[31]("faceCollector.lowQualityCapture") + ""
1024
+ ), s;
1025
+ return {
1026
+ c() {
1027
+ e = g("h1"), s = D(t), d(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1028
+ },
1029
+ m(n, o) {
1030
+ L(n, e, o), c(e, s);
1031
+ },
1032
+ p(n, o) {
1033
+ o[1] & /*$_*/
1034
+ 1 && t !== (t = /*$_*/
1035
+ n[31]("faceCollector.lowQualityCapture") + "") && W(s, t);
1036
+ },
1037
+ d(n) {
1038
+ n && N(e);
1039
+ }
1040
+ };
1041
+ }
1042
+ function Es(a) {
1043
+ let e, t = (
1044
+ /*$_*/
1045
+ a[31]("liveness.error.error") + ""
1046
+ ), s, n, o = (
1047
+ /*$_*/
1048
+ a[31]("faceCollector.unaliveCapture") + ""
1049
+ ), l;
1050
+ return {
1051
+ c() {
1052
+ e = g("h1"), s = D(t), n = D(": "), l = D(o), d(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1053
+ },
1054
+ m(r, u) {
1055
+ L(r, e, u), c(e, s), c(e, n), c(e, l);
1056
+ },
1057
+ p(r, u) {
1058
+ u[1] & /*$_*/
1059
+ 1 && t !== (t = /*$_*/
1060
+ r[31]("liveness.error.error") + "") && W(s, t), u[1] & /*$_*/
1061
+ 1 && o !== (o = /*$_*/
1062
+ r[31]("faceCollector.unaliveCapture") + "") && W(l, o);
1063
+ },
1064
+ d(r) {
1065
+ r && N(e);
1066
+ }
1067
+ };
1068
+ }
1069
+ function ys(a) {
1070
+ let e, t = (
1071
+ /*$_*/
1072
+ a[31]("liveness.error.error") + ""
1073
+ ), s, n, o = (
1074
+ /*$_*/
1075
+ a[31](
1076
+ /*livenessError*/
1077
+ a[20]
1078
+ ) + ""
1079
+ ), l, r;
1080
+ return {
1081
+ c() {
1082
+ e = g("h1"), s = D(t), n = D(": "), l = D(o), r = D("."), d(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1083
+ },
1084
+ m(u, h) {
1085
+ L(u, e, h), c(e, s), c(e, n), c(e, l), c(e, r);
1086
+ },
1087
+ p(u, h) {
1088
+ h[1] & /*$_*/
1089
+ 1 && t !== (t = /*$_*/
1090
+ u[31]("liveness.error.error") + "") && W(s, t), h[0] & /*livenessError*/
1091
+ 1048576 | h[1] & /*$_*/
1092
+ 1 && o !== (o = /*$_*/
1093
+ u[31](
1094
+ /*livenessError*/
1095
+ u[20]
1096
+ ) + "") && W(l, o);
1097
+ },
1098
+ d(u) {
1099
+ u && N(e);
1100
+ }
1101
+ };
1102
+ }
1103
+ function ks(a) {
1104
+ let e, t, s, n, o = q(), l, r = (
1105
+ /*unique*/
1106
+ a[13]
1107
+ ), u, h, b, C, p, m, T, _, y, w, S, z, me, X, O, be = q() && /*waitingIdrndCaptureEvent*/
1108
+ a[19], $, re = (q() && /*idrndLoading*/
1109
+ (a[17] || !/*$ready*/
1110
+ a[22]) || !q() && !/*$ready*/
1111
+ a[22]) && /*$cameraStatusStore*/
1112
+ a[21] === j.OK, _e, Ae, U, ee, ge, Ce = o && ns(a), Ee = Ei(a), Y = (
1113
+ /*showConfigButton*/
1114
+ a[4] && /*$ready*/
1115
+ a[22] && yi()
1116
+ ), G = (
1117
+ /*showCameraButton*/
1118
+ a[6] && /*$ready*/
1119
+ a[22] && ki()
1120
+ ), Z = (
1121
+ /*showAutoCaptureButton*/
1122
+ a[5] && !/*$automaticCapture*/
1123
+ a[25] && !/*showCaptureButton*/
1124
+ a[0] && /*$ready*/
1125
+ a[22] && Ri()
1126
+ ), V = (
1127
+ /*showCaptureButton*/
1128
+ a[0] && /*$ready*/
1129
+ a[22] && Ti(a)
1130
+ ), ae = (
1131
+ /*isCountingDown*/
1132
+ a[12] && Oi(a)
1133
+ ), se = (
1134
+ /*$enableFaceApi*/
1135
+ a[34] && !/*isCountingDown*/
1136
+ a[12] && /*$faceValidationAlert*/
1137
+ a[26] && Ai(a)
1138
+ ), ne = be && Ii(a), R = re && Pi(a), B = (
1139
+ /*$captured*/
1140
+ a[24] && Li(a)
1141
+ );
1142
+ const ye = [fs, us], ue = [];
1143
+ function Je(v, H) {
1144
+ return (!/*idrndClosed*/
1145
+ v[18] || /*$captured*/
1146
+ v[24]) && /*showUnconformities*/
1147
+ v[3] ? 0 : (
1148
+ /*$cameraStatusStore*/
1149
+ v[21] !== j.OK ? 1 : -1
1150
+ );
1151
+ }
1152
+ return ~(U = Je(a)) && (ee = ue[U] = ye[U](a)), {
1153
+ c() {
1154
+ e = g("div"), t = g("div"), s = g("div"), n = g("div"), Ce && Ce.c(), l = F(), Ee.c(), u = F(), Y && Y.c(), h = F(), G && G.c(), b = F(), Z && Z.c(), C = F(), V && V.c(), p = F(), m = g("canvas"), T = F(), _ = g("canvas"), y = F(), w = g("canvas"), S = F(), ae && ae.c(), z = F(), se && se.c(), O = F(), ne && ne.c(), $ = F(), R && R.c(), _e = F(), B && B.c(), Ae = F(), ee && ee.c(), this.c = le, d(m, "id", "bry-ce-displayCanvas"), d(m, "class", "max-w-full -scale-x-100"), d(_, "id", "bry-ce-detectionsCanvas"), d(_, "class", "absolute top-0 left-0 max-w-full -scale-x-100"), d(w, "id", "bry-ce-maskCanvas"), d(w, "class", "absolute top-0 left-0 max-w-full -scale-x-100"), d(n, "class", me = /*$ready*/
1155
+ a[22] ? "relative" : "relative w-0 h-0"), n.hidden = X = /*$cameraStatusStore*/
1156
+ a[21] !== j.OK || q() && /*idrndLoading*/
1157
+ (a[17] || /*idrndClosed*/
1158
+ a[18] || /*waitingIdrndCaptureEvent*/
1159
+ a[19]), d(s, "class", "relative mx-auto"), d(t, "class", "flex flex-col justify-between");
1160
+ },
1161
+ m(v, H) {
1162
+ L(v, e, H), c(e, t), c(t, s), c(s, n), Ce && Ce.m(n, null), c(n, l), Ee.m(n, null), c(n, u), Y && Y.m(n, null), c(n, h), G && G.m(n, null), c(n, b), Z && Z.m(n, null), c(n, C), V && V.m(n, null), c(n, p), c(n, m), a[54](m), c(n, T), c(n, _), a[55](_), c(n, y), c(n, w), a[56](w), c(n, S), ae && ae.m(n, null), c(n, z), se && se.m(n, null), c(s, O), ne && ne.m(s, null), c(s, $), R && R.m(s, null), c(s, _e), B && B.m(s, null), a[59](t), c(e, Ae), ~U && ue[U].m(e, null), ge = !0;
1163
+ },
1164
+ p(v, H) {
1165
+ o && Ce.p(v, H), H[0] & /*unique*/
1166
+ 8192 && ti(r, r = /*unique*/
1167
+ v[13]) ? (Ee.d(1), Ee = Ei(v), Ee.c(), Ee.m(n, u)) : Ee.p(v, H), /*showConfigButton*/
1168
+ v[4] && /*$ready*/
1169
+ v[22] ? Y ? H[0] & /*showConfigButton, $ready*/
1170
+ 4194320 && Q(Y, 1) : (Y = yi(), Y.c(), Q(Y, 1), Y.m(n, h)) : Y && (Ke(), x(Y, 1, 1, () => {
1171
+ Y = null;
1172
+ }), je()), /*showCameraButton*/
1173
+ v[6] && /*$ready*/
1174
+ v[22] ? G ? H[0] & /*showCameraButton, $ready*/
1175
+ 4194368 && Q(G, 1) : (G = ki(), G.c(), Q(G, 1), G.m(n, b)) : G && (Ke(), x(G, 1, 1, () => {
1176
+ G = null;
1177
+ }), je()), /*showAutoCaptureButton*/
1178
+ v[5] && !/*$automaticCapture*/
1179
+ v[25] && !/*showCaptureButton*/
1180
+ v[0] && /*$ready*/
1181
+ v[22] ? Z ? H[0] & /*showAutoCaptureButton, $automaticCapture, showCaptureButton, $ready*/
1182
+ 37748769 && Q(Z, 1) : (Z = Ri(), Z.c(), Q(Z, 1), Z.m(n, C)) : Z && (Ke(), x(Z, 1, 1, () => {
1183
+ Z = null;
1184
+ }), je()), /*showCaptureButton*/
1185
+ v[0] && /*$ready*/
1186
+ v[22] ? V ? (V.p(v, H), H[0] & /*showCaptureButton, $ready*/
1187
+ 4194305 && Q(V, 1)) : (V = Ti(v), V.c(), Q(V, 1), V.m(n, p)) : V && (Ke(), x(V, 1, 1, () => {
1188
+ V = null;
1189
+ }), je()), /*isCountingDown*/
1190
+ v[12] ? ae ? ae.p(v, H) : (ae = Oi(v), ae.c(), ae.m(n, z)) : ae && (ae.d(1), ae = null), /*$enableFaceApi*/
1191
+ v[34] && !/*isCountingDown*/
1192
+ v[12] && /*$faceValidationAlert*/
1193
+ v[26] ? se ? se.p(v, H) : (se = Ai(v), se.c(), se.m(n, null)) : se && (se.d(1), se = null), (!ge || H[0] & /*$ready*/
1194
+ 4194304 && me !== (me = /*$ready*/
1195
+ v[22] ? "relative" : "relative w-0 h-0")) && d(n, "class", me), (!ge || H[0] & /*$cameraStatusStore, idrndLoading, idrndClosed, waitingIdrndCaptureEvent*/
1196
+ 3014656 && X !== (X = /*$cameraStatusStore*/
1197
+ v[21] !== j.OK || q() && /*idrndLoading*/
1198
+ (v[17] || /*idrndClosed*/
1199
+ v[18] || /*waitingIdrndCaptureEvent*/
1200
+ v[19]))) && (n.hidden = X), H[0] & /*waitingIdrndCaptureEvent*/
1201
+ 524288 && (be = q() && /*waitingIdrndCaptureEvent*/
1202
+ v[19]), be ? ne ? ne.p(v, H) : (ne = Ii(v), ne.c(), ne.m(s, $)) : ne && (ne.d(1), ne = null), H[0] & /*idrndLoading, $ready, $cameraStatusStore*/
1203
+ 6422528 && (re = (q() && /*idrndLoading*/
1204
+ (v[17] || !/*$ready*/
1205
+ v[22]) || !q() && !/*$ready*/
1206
+ v[22]) && /*$cameraStatusStore*/
1207
+ v[21] === j.OK), re ? R ? R.p(v, H) : (R = Pi(v), R.c(), R.m(s, _e)) : R && (R.d(1), R = null), /*$captured*/
1208
+ v[24] ? B ? B.p(v, H) : (B = Li(v), B.c(), B.m(s, null)) : B && (B.d(1), B = null);
1209
+ let De = U;
1210
+ U = Je(v), U === De ? ~U && ue[U].p(v, H) : (ee && (Ke(), x(ue[De], 1, 1, () => {
1211
+ ue[De] = null;
1212
+ }), je()), ~U ? (ee = ue[U], ee ? ee.p(v, H) : (ee = ue[U] = ye[U](v), ee.c()), Q(ee, 1), ee.m(e, null)) : ee = null);
1213
+ },
1214
+ i(v) {
1215
+ ge || (Q(Y), Q(G), Q(Z), Q(V), Q(ee), ge = !0);
1216
+ },
1217
+ o(v) {
1218
+ x(Y), x(G), x(Z), x(V), x(ee), ge = !1;
1219
+ },
1220
+ d(v) {
1221
+ v && N(e), Ce && Ce.d(), Ee.d(v), Y && Y.d(), G && G.d(), Z && Z.d(), V && V.d(), a[54](null), a[55](null), a[56](null), ae && ae.d(), se && se.d(), ne && ne.d(), R && R.d(), B && B.d(), a[59](null), ~U && ue[U].d();
1222
+ }
1223
+ };
1224
+ }
1225
+ let Rs = 5, Wi = 3e3;
1226
+ function Ts() {
1227
+ ({}).VITE_USE_DEV === "true" ? import("./index-no-detector_4b302e78_2.4.0.js") : import("./index-no-detector_b6972e40_2.4.0.js");
1228
+ }
1229
+ function ei(a, e, t) {
1230
+ const s = e.videoWidth / e.videoHeight, n = t.width / t.height;
1231
+ let o = 0, l = 0, r = e.videoWidth, u = e.videoHeight;
1232
+ s > n ? (r = e.videoHeight * n, o = (e.videoWidth - r) / 2) : s < n && (u = e.videoWidth / n, l = (e.videoHeight - u) / 2), a.drawImage(e, o, l, r, u, 0, 0, t.width, t.height);
1233
+ }
1234
+ function Os(a, e, t) {
1235
+ let s, n, o, l, r, u, h, b, C, p, m, T, _, y, w, S, z, me, X, O, be, $, re, _e, Ae, U, ee, ge, Ce, Ee, Y, G, Z, V, ae, se, ne;
1236
+ P(a, zt, (i) => t(79, s = i)), P(a, gt, (i) => t(81, o = i)), P(a, ie, (i) => t(21, l = i)), P(a, pt, (i) => t(22, r = i)), P(a, ka, (i) => t(82, u = i)), P(a, vt, (i) => t(83, h = i)), P(a, Pe, (i) => t(23, b = i)), P(a, Ra, (i) => t(84, C = i)), P(a, it, (i) => t(24, p = i)), P(a, Xt, (i) => t(85, m = i)), P(a, di, (i) => t(86, T = i)), P(a, wt, (i) => t(87, _ = i)), P(a, Pt, (i) => t(25, y = i)), P(a, Me, (i) => t(26, w = i)), P(a, Ta, (i) => t(88, S = i)), P(a, Jt, (i) => t(27, z = i)), P(a, Qt, (i) => t(28, me = i)), P(a, Le, (i) => t(29, X = i)), P(a, de, (i) => t(30, O = i)), P(a, Hi, (i) => t(31, be = i)), P(a, We, (i) => t(32, $ = i)), P(a, at, (i) => t(89, re = i)), P(a, Oa, (i) => t(90, Ae = i)), P(a, hi, (i) => t(34, U = i)), P(a, Aa, (i) => t(91, ee = i)), P(a, Ct, (i) => t(92, ge = i)), P(a, Yt, (i) => t(93, Ce = i)), P(a, Ia, (i) => t(94, Ee = i)), P(a, Et, (i) => t(95, Y = i)), P(a, mi, (i) => t(96, G = i)), P(a, bi, (i) => t(97, Z = i)), P(a, yt, (i) => t(98, V = i)), P(a, Pa, (i) => t(35, ae = i)), P(a, La, (i) => t(36, se = i)), P(a, Da, (i) => t(37, ne = i));
1237
+ let R, B, ye, ue = !1, Je = {}, v = !1, H = !1, De = !1, Nt = (/* @__PURE__ */ new Date()).getTime(), qi = !1, Qe = { width: 1280, height: 720 }, { enableMinutiae: St } = e, { videoDimensions: Mt } = e, { noTabs: Wt } = e, { weightsPath: Bt } = e, { evaluatePhoto: Ie } = e, { showCaptureButton: ot } = e, { showUnconformities: ii } = e, { videoOverlay: lt } = e, { videoOverlayTransparency: Ye } = e, { showConfigButton: ai } = e, { showAutoCaptureButton: rt } = e, { showCameraButton: si } = e, { showJustificationField: ni } = e, { minEyeToEyeDist: Ge } = e;
1238
+ const ct = pi(!1);
1239
+ P(a, ct, (i) => t(80, n = i));
1240
+ const Ze = pi("data:image/png;base64");
1241
+ P(a, Ze, (i) => t(33, _e = i));
1242
+ let { widgetInstance: oe } = e, Fe, M, xe = !1, Ut = !1, ut = !0, Re = !0, ft = !1, oi = 0, ke = "", Vt = 0, dt = !0, Ht = 0, Kt = !1;
1243
+ const $e = Fa.mixin({
1244
+ toast: !0,
1245
+ position: "bottom-left",
1246
+ timer: 13e3,
1247
+ timerProgressBar: !0
1248
+ });
1249
+ Na(async () => {
1250
+ if (f(Ct, ge = !0, ge), f(pt, r = !1, r), ri(), U)
1251
+ try {
1252
+ await Sa(Bt), v = !0;
1253
+ } catch {
1254
+ f(hi, U = !1, U), t(0, ot = !0);
1255
+ }
1256
+ q() ? (Ts(), zi()) : await Ne(), Oe() || Ji();
1257
+ });
1258
+ async function li() {
1259
+ const [i, E] = (Mt ?? "")?.replaceAll(" ", "")?.split("x")?.map((k) => k ? parseInt(k) : void 0);
1260
+ if (!(!i || !E))
1261
+ if (Oe()) {
1262
+ await Xa();
1263
+ const k = window.innerWidth, I = window.innerHeight, A = E, K = I / k * A;
1264
+ f(
1265
+ wt,
1266
+ _ = {
1267
+ videoWidth: A,
1268
+ videoHeight: K
1269
+ },
1270
+ _
1271
+ );
1272
+ } else
1273
+ f(wt, _ = { videoWidth: i, videoHeight: E }, _);
1274
+ }
1275
+ function ri() {
1276
+ f(gt, o = !1, o), f(it, p = !1, p), f(vt, h = Gt.FRONT_CAMERA, h), rt && f(Pt, y = !1, y), f(Jt, z = !1, z), f(de, O = J.OK, O), f(at, re = "", re), f(We, $.unconformities = [], $);
1277
+ const i = It(Zt);
1278
+ i.closedMouth = !1, i.isPersonCloseEnough = !1, i.isPersonTooclose = !0, i.isPersonInFrame = !1, Zt.set(i), f(Me, w = "", w);
1279
+ }
1280
+ function jt(i, E) {
1281
+ i.clearRect(0, 0, M.width, M.height), i.save(), lt != "none" ? (Ye > 0 && (i.globalAlpha = Ye / 100), i.fillStyle = lt, i.fillRect(0, 0, M.width, M.height)) : (i.beginPath(), i.rect(0, 0, M.width, M.height));
1282
+ const k = window.innerWidth;
1283
+ let I = M.height * 0.8;
1284
+ k < 1024 && (I = M.height * 0.7);
1285
+ const A = _.videoWidth / 2;
1286
+ let K = _.videoHeight * 0.5;
1287
+ (rt || ot) && (K = _.videoHeight * 0.44), Oe() && (I = M.height * 0.65, K = _.videoHeight * 0.4);
1288
+ const pe = I / 1.45;
1289
+ f(yt, V.width = pe, V), f(yt, V.height = I, V), f(yt, V.y = K, V), i.ellipse(A, K, pe / 2, I / 2, 0, 0, 2 * Math.PI, !0), Ye == 0 && i.clip(), ei(i, E, M), i.restore(), i.save(), i.beginPath();
1290
+ const Se = window.getComputedStyle(M).getPropertyValue("--p"), te = window.getComputedStyle(M).getPropertyValue("--su");
1291
+ if (i.strokeStyle = `hsl(${Se})`, i.lineWidth = 14, i.ellipse(A, K, pe / 2, I / 2, 0, 0, 2 * Math.PI), i.stroke(), ue && !Kt) {
1292
+ const tt = 1 - (Ht - (/* @__PURE__ */ new Date()).getTime()) / Wi;
1293
+ i.save(), i.beginPath(), i.lineWidth = 16, i.strokeStyle = `hsl(${te})`, i.ellipse(A, K, pe / 2, I / 2, 0, 0 - Math.PI / 2, 1.5 * (Math.PI * 2 * tt) - Math.PI / 2), i.stroke();
1294
+ }
1295
+ i.beginPath();
1296
+ const ve = new Path2D();
1297
+ ve.ellipse(A, K, pe / 2, I / 2, 0, 0, 2 * Math.PI), i.clip(ve), ei(i, E, M), i.restore();
1298
+ }
1299
+ function zi() {
1300
+ oe.addEventListener("open", (i) => {
1301
+ const E = i.detail[0].video;
1302
+ f(
1303
+ bi,
1304
+ Z = {
1305
+ width: E.videoWidth,
1306
+ height: E.videoHeight
1307
+ },
1308
+ Z
1309
+ ), t(9, R.srcObject = E.srcObject, R), t(17, ut = !1), Ma(oe);
1310
+ function k() {
1311
+ Re || (jt(M.getContext("2d"), E), Ve(R, k, !0));
1312
+ }
1313
+ k();
1314
+ }), oe.addEventListener("error", (i) => {
1315
+ console.error(i), i.detail[0].message === "Device in use" ? f(ie, l = j.CAMERA_IN_USE_ERROR, l) : i.detail[0].message === "Permission denied" || i.detail[0].message === "Permission dismissed" ? f(ie, l = j.CAMERA_DENIED_ERROR, l) : i.detail[0].message === "Requested device not found" && f(ie, l = j.DEVICE_NOT_FOUND_ERROR, l), t(17, ut = !1);
1316
+ }), oe.addEventListener("faceDetection", (i) => {
1317
+ }), oe.addEventListener("close", async (i) => {
1318
+ p || (xe = !1), t(18, Re = !0), t(19, ft = !1), l === j.OK && f(ie, l = j.CAMERA_CLOSED_ERROR, l);
1319
+ }), oe.addEventListener("initialize", async (i) => {
1320
+ Ut = !0, f(mi, G = !0, G), Ce === kt.Face && !xe && !p && Ut && await qt();
1321
+ }), oe.addEventListener("capture", async (i) => {
1322
+ t(20, ke = "");
1323
+ const { encryptedFile: E, photo: k } = i.detail[0];
1324
+ f(Et, Y = E, Y), t(19, ft = !1), f(de, O = J.OK, O), f(We, $.isLoading = !0, $), f(it, p = !0, p), xe = !1;
1325
+ const I = (await Rt(k)).split(",");
1326
+ if (f(Ze, _e = I[0], _e), f(Le, X = I[1], X), f(at, re = I[1], re), !Ee) {
1327
+ let te, ve, tt, bt;
1328
+ try {
1329
+ const fe = await import("./face_api_0e3ce8c8_2.4.0.js");
1330
+ let he, Te;
1331
+ const _t = await _i();
1332
+ if (Te = fe.detectSingleFace(M, _t), he = await Te.withFaceLandmarks(), !he)
1333
+ throw f(de, O = J.TEMPLATE_EXTRACTION_ERROR, O), new Error("Face not found");
1334
+ ({ bodyParts: te, icaoWarnings: ve } = await Tt(re, Ie, (await Rt(E)).split(",")[1])), window.dispatchEvent(new CustomEvent(
1335
+ "face-unconformities-validated",
1336
+ {
1337
+ detail: {
1338
+ bodyParts: te,
1339
+ icaoWarnings: ve,
1340
+ status: O
1341
+ }
1342
+ }
1343
+ ));
1344
+ } catch (fe) {
1345
+ console.error(fe);
1346
+ let he = st.UNKNOWN, Te = [], _t = [];
1347
+ fe instanceof xt && fe.response?.status === 400 ? fe.response.data && Array.isArray(fe.response.data.bodyParts) ? (Te = fe.response.data.bodyParts, _t = fe.response.data.icaoWarnings, tt = fe.response.data.invalidLivenessCounter, bt = fe.response.data.invalidLivenessLimit, he = Te.find((ya) => ya.livenessResult.error)?.livenessResult.error_code, f(de, O = J.LIVENESS_DETECTION_FAILURE, O), t(20, ke = st[he]), console.error("Liveness error:", he)) : f(de, O = J.TEMPLATE_EXTRACTION_ERROR, O) : O !== J.TEMPLATE_EXTRACTION_ERROR && (f(de, O = J.UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE, O), Ie && $e.fire({
1348
+ icon: "error",
1349
+ title: "Falha ao comunicar com serviço de Liveness"
1350
+ })), f(We, $.isLoading = !1, $), window.dispatchEvent(new CustomEvent(
1351
+ "face-unconformities-validated",
1352
+ {
1353
+ detail: {
1354
+ bodyParts: Te,
1355
+ errorCode: he,
1356
+ translatedError: be(ke),
1357
+ status: O,
1358
+ icaoWarnings: _t,
1359
+ invalidLivenessCounter: tt,
1360
+ invalidLivenessLimit: bt
1361
+ }
1362
+ }
1363
+ ));
1364
+ return;
1365
+ }
1366
+ if (O !== J.OK) {
1367
+ f(We, $.isLoading = !1, $);
1368
+ return;
1369
+ }
1370
+ te[0].livenessResult && ui(te[0].livenessResult), te.length !== 0 && te[0].data && f(Le, X = te[0].data, X), Ot(ve);
1371
+ return;
1372
+ }
1373
+ let A, K;
1374
+ try {
1375
+ K = await Wa(E), ui(K.data);
1376
+ } catch (te) {
1377
+ f(de, O = J.UNKNOWN_LIVENESS_ERROR, O), console.error(te), te instanceof xt && te.response?.status === 400 ? (A = te.response.data.error_code, t(20, ke = st[A]), console.error("Liveness error:", A), f(de, O = J.LIVENESS_DETECTION_FAILURE, O)) : $e.fire({
1378
+ icon: "error",
1379
+ title: "Falha ao comunicar com serviço de Liveness"
1380
+ });
1381
+ }
1382
+ if (O !== J.OK) {
1383
+ f(We, $.isLoading = !1, $), window.dispatchEvent(new CustomEvent(
1384
+ "face-unconformities-validated",
1385
+ {
1386
+ detail: {
1387
+ bodyParts: [
1388
+ {
1389
+ bodyPart: "FACE",
1390
+ data: re,
1391
+ livenessBlob: (await Rt(E)).split(",")[1],
1392
+ ...K && { livenessResult: K }
1393
+ }
1394
+ ],
1395
+ ...A && { errorCode: A },
1396
+ ...ke && { translatedError: be(ke) },
1397
+ status: O
1398
+ }
1399
+ }
1400
+ ));
1401
+ return;
1402
+ }
1403
+ let { bodyParts: pe, icaoWarnings: Se } = await Tt(re, Ie);
1404
+ window.dispatchEvent(new CustomEvent(
1405
+ "face-unconformities-validated",
1406
+ {
1407
+ detail: {
1408
+ bodyParts: pe,
1409
+ icaoWarnings: Se,
1410
+ status: O,
1411
+ errorCode: A,
1412
+ ...ke && { translatedError: be(ke) }
1413
+ }
1414
+ }
1415
+ )), pe[0].data && f(Le, X = pe[0].data, X), Ot(Se);
1416
+ });
1417
+ }
1418
+ async function Ne(i) {
1419
+ if (!dt) {
1420
+ f(ie, l = j.CAMERA_ORIENTATION_PORTRAIT, l);
1421
+ return;
1422
+ }
1423
+ await li(), q() ? qt() : await Xi(_.videoWidth, _.videoHeight, i);
1424
+ }
1425
+ async function qt() {
1426
+ if (q()) {
1427
+ if (await li(), !C[0]?.deviceId) {
1428
+ try {
1429
+ await gi(640, 480);
1430
+ } catch (i) {
1431
+ const E = i, k = Ue(i) && i.constraint ? i.constraint : "";
1432
+ console.error(E.message, k), Ue(E) && "message" in E && E.message.includes("Requested device not found") && f(ie, l = j.DEVICE_NOT_FOUND_ERROR, l);
1433
+ }
1434
+ await $t(), f(Pe, b = C[0].deviceId, b);
1435
+ }
1436
+ f(ie, l = j.OK, l), oe && "openCamera" in oe && oe.openCamera(), xe = !0, t(18, Re = !1), t(17, ut = !0);
1437
+ }
1438
+ }
1439
+ async function et() {
1440
+ if (U && !v)
1441
+ return Ve(R, et);
1442
+ if (R) {
1443
+ if (Ce !== kt.Face && !Wt)
1444
+ return Ve(R, et);
1445
+ f(pt, r = !0, r), f(Ct, ge = !1, ge), U ? (n || f(ct, n = !0, n), q() || jt(M.getContext("2d"), R), Ve(R, et)) : (jt(M.getContext("2d"), R), Ve(R, et));
1446
+ }
1447
+ }
1448
+ async function ci() {
1449
+ if (U && Ge > 0 && ee < Ge) {
1450
+ let i = "FACE_MUITO_PEQUENA";
1451
+ const E = vi[i];
1452
+ i = vi.FACE_MUITO_PEQUENA, window.dispatchEvent(new CustomEvent(
1453
+ "low-quality-face",
1454
+ {
1455
+ detail: {
1456
+ errorCode: i,
1457
+ translatedError: be(E),
1458
+ bodyParts: [
1459
+ {
1460
+ bodyPart: "FACE",
1461
+ minEyeToEyeDist: Ge,
1462
+ capturedEyeToEyeDist: ee
1463
+ }
1464
+ ]
1465
+ }
1466
+ }
1467
+ )), $e.fire({
1468
+ icon: "error",
1469
+ title: be(E)
1470
+ });
1471
+ return;
1472
+ }
1473
+ if (f(de, O = J.OK, O), q()) {
1474
+ t(19, ft = !0), oe.takePhoto();
1475
+ return;
1476
+ }
1477
+ f(it, p = !0, p);
1478
+ try {
1479
+ if (U) {
1480
+ const i = M.width, E = M.height, k = Qe.height, I = E / i * k, A = document.createElement("canvas"), K = A.getContext("2d");
1481
+ A.width = k, A.height = I;
1482
+ const pe = A.width / M.width, Se = A.height / M.height, te = new is({
1483
+ x: Ae.x * pe,
1484
+ y: Ae.y * Se,
1485
+ width: Ae.width * pe,
1486
+ height: Ae.height * Se
1487
+ }), ve = document.createElement("canvas");
1488
+ ve.width = te.width, ve.height = te.height, ve.getContext("2d")?.clearRect(0, 0, ve.width, ve.height), K && ei(K, R, A);
1489
+ const [bt] = await (await import("./face_api_0e3ce8c8_2.4.0.js")).extractFaces(A, [te]), fe = bt.toDataURL("image/jpeg").split(",");
1490
+ f(Ze, _e = fe[0], _e), f(Le, X = fe[1], X), f(at, re = fe[1], re);
1491
+ let he, Te;
1492
+ ({ bodyParts: he, icaoWarnings: Te } = await Tt(X, Ie)), window.dispatchEvent(new CustomEvent(
1493
+ "face-unconformities-validated",
1494
+ {
1495
+ detail: {
1496
+ bodyParts: he,
1497
+ icaoWarnings: Te,
1498
+ status: O
1499
+ }
1500
+ }
1501
+ )), he.length !== 0 && he[0].data && f(Le, X = he[0].data, X), Ot(Te);
1502
+ } else {
1503
+ const i = document.createElement("canvas"), E = i.getContext("2d");
1504
+ i.width = R.width, i.height = R.height, E?.drawImage(R, 0, 0, i.width, i.height);
1505
+ const k = i.toDataURL("image/jpeg").split(",");
1506
+ f(Ze, _e = k[0], _e), f(Le, X = k[1], X), f(at, re = k[1], re);
1507
+ let { bodyParts: I, icaoWarnings: A } = await Tt(X, Ie);
1508
+ window.dispatchEvent(new CustomEvent(
1509
+ "face-unconformities-validated",
1510
+ {
1511
+ detail: {
1512
+ bodyParts: I,
1513
+ icaoWarnings: A,
1514
+ status: O
1515
+ }
1516
+ }
1517
+ )), I.length !== 0 && I[0].data && f(Le, X = I[0].data, X), Ot(A);
1518
+ }
1519
+ } catch (i) {
1520
+ console.error(i);
1521
+ let E = st.UNKNOWN, k = [], I = [];
1522
+ if (i instanceof xt && i.response?.status === 400)
1523
+ if (i.response.data && Array.isArray(i.response.data.bodyParts)) {
1524
+ k = i.response.data.bodyParts, I = i.response.data.icaoWarnings;
1525
+ const A = k.find((K) => K.livenessResult.error);
1526
+ E = A?.livenessResult.error_code, f(de, O = J.LIVENESS_DETECTION_FAILURE, O), A?.livenessResult.error_code || f(de, O = J.UNKNOWN_LIVENESS_ERROR, O), t(20, ke = st[E]), console.error("Liveness error:", E);
1527
+ } else
1528
+ f(de, O = J.TEMPLATE_EXTRACTION_ERROR, O);
1529
+ else
1530
+ f(de, O = J.UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE, O), Ie && $e.fire({
1531
+ icon: "error",
1532
+ title: "Falha ao comunicar com serviço de Liveness"
1533
+ });
1534
+ f(We, $.isLoading = !1, $), window.dispatchEvent(new CustomEvent(
1535
+ "face-unconformities-validated",
1536
+ {
1537
+ detail: {
1538
+ bodyParts: k,
1539
+ errorCode: E,
1540
+ translatedError: be(ke),
1541
+ status: O,
1542
+ icaoWarnings: I
1543
+ }
1544
+ }
1545
+ ));
1546
+ return;
1547
+ }
1548
+ }
1549
+ function ht() {
1550
+ const i = {
1551
+ bodyPart: "FACE",
1552
+ data: X,
1553
+ justification: me
1554
+ };
1555
+ f(Jt, z = !0, z), It(Et) && Rt(It(Et)).then((E) => {
1556
+ i.livenessBlob = E.split(",")[1];
1557
+ }), window.dispatchEvent(new CustomEvent("export-face", { detail: i }));
1558
+ }
1559
+ function Be() {
1560
+ window.dispatchEvent(new CustomEvent("face-scrapped")), ri(), Re && qt();
1561
+ }
1562
+ function ui(i) {
1563
+ let E = "", k = "success";
1564
+ i.isAlive ? E = `Vivacidade de face (${i.face_liveness.probability.toFixed(2)}) e de captura (${i.capture_liveness.probability}, ${i.capture_liveness.score.toFixed(2)}) verificados!` : i?.face_liveness?.probability && (k = "error", E = `Vivacidade de face (${i.face_liveness.probability.toFixed(2)}) e de captura (${i.capture_liveness.probability}, ${i.capture_liveness.score.toFixed(2)}) insuficientes!`), S && $e.fire({ icon: k, title: E });
1565
+ }
1566
+ async function Xi(i, E, k) {
1567
+ try {
1568
+ const { deviceId: I, facingMode: A, touchPoints: K } = await gi(Qe.width, Qe.height, h, k);
1569
+ Oe() && (!A || K <= 1) && (qi = !0), f(Pe, b = I || C[0].deviceId, b);
1570
+ } catch (I) {
1571
+ const A = I, K = Ue(I) && I.constraint ? I.constraint : "";
1572
+ console.error(A.message, K), Ue(A) && "message" in A && A.message.includes("Permission denied") && (console.error("User didn't give permission to use camera!"), f(ie, l = j.CAMERA_DENIED_ERROR, l)), Ue(A) && "message" in A && A.message.includes("Requested device not found") && f(ie, l = j.DEVICE_NOT_FOUND_ERROR, l), (K.includes("width") || K.includes("height")) && (console.error(`Camera does not meet the minimum supported requirements! (${K})`), f(ie, l = j.CAMERA_UNSUPPORTED, l));
1573
+ }
1574
+ }
1575
+ async function mt() {
1576
+ f(Pe, b = "", b), await Ne();
1577
+ }
1578
+ function Ji() {
1579
+ navigator.mediaDevices.ondevicechange = async (i) => {
1580
+ i.type == "devicechange" && (await $t(), l !== j.OK ? await mt() : (!q() && !T.active || q() && !Re) && (At(oe), f(ie, l = j.DEVICE_NOT_FOUND_ERROR, l), t(18, Re = !0)));
1581
+ };
1582
+ }
1583
+ async function Qi() {
1584
+ f(gt, o = !1, o);
1585
+ const i = (/* @__PURE__ */ new Date()).getTime();
1586
+ if (i - Nt > 5e3) {
1587
+ Nt = i;
1588
+ try {
1589
+ const k = await Ja(R);
1590
+ if (k < 50) {
1591
+ f(Me, w = "faceCollector.illuminationTooLow", w);
1592
+ return;
1593
+ }
1594
+ if (k > 180) {
1595
+ f(Me, w = "faceCollector.illuminationTooHigh", w);
1596
+ return;
1597
+ }
1598
+ } catch (k) {
1599
+ console.warn("An error occurred while getting the video lighting level: ", k);
1600
+ }
1601
+ try {
1602
+ if (await Qa(R) < 4.5) {
1603
+ f(Me, w = "faceCollector.lowSharpness", w);
1604
+ return;
1605
+ }
1606
+ } catch (k) {
1607
+ console.warn("An error occurred while getting the video sharpness level: ", k);
1608
+ }
1609
+ f(Me, w = "faceCollector.faceWasNotFound", w);
1610
+ } else
1611
+ H || (H = !0, setTimeout(
1612
+ () => {
1613
+ let k = [
1614
+ "faceCollector.faceWasNotFound",
1615
+ "faceCollector.illuminationTooLow",
1616
+ "faceCollector.lowSharpness",
1617
+ "faceCollector.illuminationTooHigh"
1618
+ ];
1619
+ H = !1, t(14, De = !1), w && !k.includes(w) && f(Me, w = "", w);
1620
+ },
1621
+ 1500
1622
+ ));
1623
+ }
1624
+ const Yi = wt.subscribe((i) => {
1625
+ R && B && (t(9, R.width = i.videoWidth, R), t(9, R.height = i.videoHeight, R), t(10, B.width = i.videoWidth, B), t(10, B.height = i.videoHeight, B), t(15, Fe.width = i.videoWidth, Fe), t(15, Fe.height = i.videoHeight, Fe), t(16, M.width = i.videoWidth, M), t(16, M.height = i.videoHeight, M));
1626
+ }), Gi = Zt.subscribe((i) => {
1627
+ if (u == "DOCUMENT")
1628
+ return;
1629
+ let E = "";
1630
+ if (i.isPersonCloseEnough ? i.isPersonTooclose ? E = "faceCollector.moveAwayCamera" : i.isPersonInFrame ? i.closedMouth || (E = "faceCollector.dontOpenMouth") : E = "faceCollector.stayInFrame" : E = "faceCollector.comeCloserCamera", o && Ba(E), !p && y && o && !ue && i.isPersonInFrame && i.closedMouth && !(!i.isPersonCloseEnough || i.isPersonTooclose)) {
1631
+ t(12, ue = !0), Ht = (/* @__PURE__ */ new Date()).getTime() + Wi;
1632
+ const k = setInterval(
1633
+ () => {
1634
+ if (!y || p || q() && Re || !i.isPersonCloseEnough || i.isPersonTooclose || !i.closedMouth || !i.isPersonInFrame) {
1635
+ t(12, ue = !1), Kt = !0, setTimeout(
1636
+ () => {
1637
+ Kt = !1;
1638
+ },
1639
+ 1500
1640
+ ), clearInterval(k);
1641
+ return;
1642
+ }
1643
+ const I = (/* @__PURE__ */ new Date()).getTime();
1644
+ Math.floor((Ht - I) % (1e3 * 60) / 1e3) <= 0 && (clearInterval(k), t(12, ue = !1), ci());
1645
+ },
1646
+ 100
1647
+ );
1648
+ }
1649
+ }), Zi = it.subscribe((i) => {
1650
+ ye && (i ? (ye.classList.remove("flex"), ye.classList.add("hidden")) : (ye.classList.add("flex"), ye.classList.remove("hidden")));
1651
+ }), xi = Xt.subscribe((i) => {
1652
+ R && i && (console.log("setting null in video srcObject"), t(9, R.srcObject = null, R), t(9, R.src = "", R), f(Pe, b = null, b));
1653
+ });
1654
+ Yt.subscribe(async (i) => {
1655
+ i === kt.Face && (await $t(), q() && f(Pe, b = C[0]?.deviceId, b));
1656
+ });
1657
+ const $i = Pe.subscribe(async (i) => {
1658
+ if (!(!i || q() && Re)) {
1659
+ R || t(13, Je = {});
1660
+ try {
1661
+ if (q()) {
1662
+ await At(oe), await Ne();
1663
+ return;
1664
+ }
1665
+ const E = await Ua(Qe.width, Qe.height, i);
1666
+ t(9, R.srcObject = E, R), f(di, T = E, T), f(Xt, m = !1, m), dt ? f(ie, l = j.OK, l) : f(ie, l = j.CAMERA_ORIENTATION_PORTRAIT, l), E.getTracks().forEach((k) => {
1667
+ k.readyState === "live" && console.log(`Camera ${k.label} opened successfully!`);
1668
+ }), f(ie, l = j.OK, l), Va(R);
1669
+ } catch (E) {
1670
+ const k = E;
1671
+ t(18, Re = !0), Ue(k) && "message" in k && k.message.includes("Requested device not found") && f(ie, l = j.DEVICE_NOT_FOUND_ERROR, l);
1672
+ }
1673
+ }
1674
+ }), ea = Yt.subscribe(async (i) => {
1675
+ i === kt.Face && q() && !xe && !p && Ut && await Ne();
1676
+ }), ta = ct.subscribe(async (i) => {
1677
+ i && fi();
1678
+ }), ia = Ha.subscribe(async (i) => {
1679
+ if (C[0]?.deviceId) {
1680
+ if (At(), !Oe() || q()) {
1681
+ const k = (C.findIndex((A) => A.deviceId === b) + 1) % C.length, I = C[k].deviceId;
1682
+ q() ? f(Pe, b = I, b) : await Ne(I);
1683
+ return;
1684
+ }
1685
+ i ? (f(vt, h = Gt.REAR_CAMERA, h), await Ne()) : (f(vt, h = Gt.FRONT_CAMERA, h), await Ne());
1686
+ }
1687
+ }), aa = Ka.subscribe(async (i) => {
1688
+ !i.isSupported || !Oe() || u != "FACE" || (dt = i.orientation.includes("portrait"), dt ? r ? f(ie, l = j.OK, l) : await mt() : f(ie, l = j.CAMERA_ORIENTATION_PORTRAIT, l));
1689
+ });
1690
+ async function fi() {
1691
+ let i;
1692
+ try {
1693
+ if (Vt >= Rs) {
1694
+ Vt = 0;
1695
+ const E = await _i(), k = await import("./face_api_0e3ce8c8_2.4.0.js");
1696
+ let I;
1697
+ I = k.detectSingleFace(M, E), i = await I.withFaceLandmarks(), B.getContext("2d")?.clearRect(0, 0, B.width, B.height), i != null ? (ja(i, B, St), f(gt, o = !0, o), t(14, De = !0), Nt = (/* @__PURE__ */ new Date()).getTime()) : Qi();
1698
+ } else
1699
+ Vt++;
1700
+ n && Ve(R, fi);
1701
+ } catch (E) {
1702
+ console.warn(`FaceapiLoop: ${E}`);
1703
+ }
1704
+ }
1705
+ zt.subscribe(async (i) => {
1706
+ i && (Be(), f(zt, s = !1, s));
1707
+ });
1708
+ const sa = pt.subscribe((i) => {
1709
+ i && window.dispatchEvent(new CustomEvent("brycc-camera-ready"));
1710
+ }), na = Ct.subscribe((i) => {
1711
+ i && window.dispatchEvent(new CustomEvent("brycc-face-initialized"));
1712
+ });
1713
+ qa(() => {
1714
+ At(), Zi(), Gi(), Yi(), xi(), $i(), ea(), clearInterval(oi), ta(), ia(), aa(), sa(), na(), oi = 0;
1715
+ });
1716
+ function oa(i) {
1717
+ He[i ? "unshift" : "push"](() => {
1718
+ oe = i, t(1, oe);
1719
+ });
1720
+ }
1721
+ function la(i) {
1722
+ He[i ? "unshift" : "push"](() => {
1723
+ R = i, t(9, R);
1724
+ });
1725
+ }
1726
+ const ra = () => {
1727
+ q();
1728
+ };
1729
+ function ca(i) {
1730
+ He[i ? "unshift" : "push"](() => {
1731
+ M = i, t(16, M);
1732
+ });
1733
+ }
1734
+ function ua(i) {
1735
+ He[i ? "unshift" : "push"](() => {
1736
+ B = i, t(10, B);
1737
+ });
1738
+ }
1739
+ function fa(i) {
1740
+ He[i ? "unshift" : "push"](() => {
1741
+ Fe = i, t(15, Fe);
1742
+ });
1743
+ }
1744
+ const da = () => ht(), ha = () => Be();
1745
+ function ma(i) {
1746
+ He[i ? "unshift" : "push"](() => {
1747
+ ye = i, t(11, ye);
1748
+ });
1749
+ }
1750
+ const ba = () => ht(), _a = () => Be();
1751
+ function ga() {
1752
+ me = this.value, Qt.set(me);
1753
+ }
1754
+ const pa = () => ht(), va = () => Be();
1755
+ function wa() {
1756
+ me = this.value, Qt.set(me);
1757
+ }
1758
+ const Ca = () => Be(), Ea = async () => {
1759
+ await mt();
1760
+ };
1761
+ return a.$$set = (i) => {
1762
+ "enableMinutiae" in i && t(44, St = i.enableMinutiae), "videoDimensions" in i && t(45, Mt = i.videoDimensions), "noTabs" in i && t(46, Wt = i.noTabs), "weightsPath" in i && t(47, Bt = i.weightsPath), "evaluatePhoto" in i && t(2, Ie = i.evaluatePhoto), "showCaptureButton" in i && t(0, ot = i.showCaptureButton), "showUnconformities" in i && t(3, ii = i.showUnconformities), "videoOverlay" in i && t(48, lt = i.videoOverlay), "videoOverlayTransparency" in i && t(49, Ye = i.videoOverlayTransparency), "showConfigButton" in i && t(4, ai = i.showConfigButton), "showAutoCaptureButton" in i && t(5, rt = i.showAutoCaptureButton), "showCameraButton" in i && t(6, si = i.showCameraButton), "showJustificationField" in i && t(7, ni = i.showJustificationField), "minEyeToEyeDist" in i && t(50, Ge = i.minEyeToEyeDist), "widgetInstance" in i && t(1, oe = i.widgetInstance);
1763
+ }, [
1764
+ ot,
1765
+ oe,
1766
+ Ie,
1767
+ ii,
1768
+ ai,
1769
+ rt,
1770
+ si,
1771
+ ni,
1772
+ et,
1773
+ R,
1774
+ B,
1775
+ ye,
1776
+ ue,
1777
+ Je,
1778
+ De,
1779
+ Fe,
1780
+ M,
1781
+ ut,
1782
+ Re,
1783
+ ft,
1784
+ ke,
1785
+ l,
1786
+ r,
1787
+ b,
1788
+ p,
1789
+ y,
1790
+ w,
1791
+ z,
1792
+ me,
1793
+ X,
1794
+ O,
1795
+ be,
1796
+ $,
1797
+ _e,
1798
+ U,
1799
+ ae,
1800
+ se,
1801
+ ne,
1802
+ ct,
1803
+ Ze,
1804
+ ci,
1805
+ ht,
1806
+ Be,
1807
+ mt,
1808
+ St,
1809
+ Mt,
1810
+ Wt,
1811
+ Bt,
1812
+ lt,
1813
+ Ye,
1814
+ Ge,
1815
+ oa,
1816
+ la,
1817
+ ra,
1818
+ ca,
1819
+ ua,
1820
+ fa,
1821
+ da,
1822
+ ha,
1823
+ ma,
1824
+ ba,
1825
+ _a,
1826
+ ga,
1827
+ pa,
1828
+ va,
1829
+ wa,
1830
+ Ca,
1831
+ Ea
1832
+ ];
1833
+ }
1834
+ class As extends Bi {
1835
+ constructor(e) {
1836
+ super(), Ui(
1837
+ this,
1838
+ {
1839
+ target: this.shadowRoot,
1840
+ props: Vi(this.attributes),
1841
+ customElement: !0
1842
+ },
1843
+ Os,
1844
+ ks,
1845
+ ti,
1846
+ {
1847
+ enableMinutiae: 44,
1848
+ videoDimensions: 45,
1849
+ noTabs: 46,
1850
+ weightsPath: 47,
1851
+ evaluatePhoto: 2,
1852
+ showCaptureButton: 0,
1853
+ showUnconformities: 3,
1854
+ videoOverlay: 48,
1855
+ videoOverlayTransparency: 49,
1856
+ showConfigButton: 4,
1857
+ showAutoCaptureButton: 5,
1858
+ showCameraButton: 6,
1859
+ showJustificationField: 7,
1860
+ minEyeToEyeDist: 50,
1861
+ widgetInstance: 1,
1862
+ play: 8
1863
+ },
1864
+ null,
1865
+ [-1, -1, -1, -1, -1]
1866
+ ), e && (e.target && L(e.target, this, e.anchor), e.props && (this.$set(e.props), ce()));
1867
+ }
1868
+ static get observedAttributes() {
1869
+ return [
1870
+ "enableMinutiae",
1871
+ "videoDimensions",
1872
+ "noTabs",
1873
+ "weightsPath",
1874
+ "evaluatePhoto",
1875
+ "showCaptureButton",
1876
+ "showUnconformities",
1877
+ "videoOverlay",
1878
+ "videoOverlayTransparency",
1879
+ "showConfigButton",
1880
+ "showAutoCaptureButton",
1881
+ "showCameraButton",
1882
+ "showJustificationField",
1883
+ "minEyeToEyeDist",
1884
+ "widgetInstance",
1885
+ "play"
1886
+ ];
1887
+ }
1888
+ get enableMinutiae() {
1889
+ return this.$$.ctx[44];
1890
+ }
1891
+ set enableMinutiae(e) {
1892
+ this.$$set({ enableMinutiae: e }), ce();
1893
+ }
1894
+ get videoDimensions() {
1895
+ return this.$$.ctx[45];
1896
+ }
1897
+ set videoDimensions(e) {
1898
+ this.$$set({ videoDimensions: e }), ce();
1899
+ }
1900
+ get noTabs() {
1901
+ return this.$$.ctx[46];
1902
+ }
1903
+ set noTabs(e) {
1904
+ this.$$set({ noTabs: e }), ce();
1905
+ }
1906
+ get weightsPath() {
1907
+ return this.$$.ctx[47];
1908
+ }
1909
+ set weightsPath(e) {
1910
+ this.$$set({ weightsPath: e }), ce();
1911
+ }
1912
+ get evaluatePhoto() {
1913
+ return this.$$.ctx[2];
1914
+ }
1915
+ set evaluatePhoto(e) {
1916
+ this.$$set({ evaluatePhoto: e }), ce();
1917
+ }
1918
+ get showCaptureButton() {
1919
+ return this.$$.ctx[0];
1920
+ }
1921
+ set showCaptureButton(e) {
1922
+ this.$$set({ showCaptureButton: e }), ce();
1923
+ }
1924
+ get showUnconformities() {
1925
+ return this.$$.ctx[3];
1926
+ }
1927
+ set showUnconformities(e) {
1928
+ this.$$set({ showUnconformities: e }), ce();
1929
+ }
1930
+ get videoOverlay() {
1931
+ return this.$$.ctx[48];
1932
+ }
1933
+ set videoOverlay(e) {
1934
+ this.$$set({ videoOverlay: e }), ce();
1935
+ }
1936
+ get videoOverlayTransparency() {
1937
+ return this.$$.ctx[49];
1938
+ }
1939
+ set videoOverlayTransparency(e) {
1940
+ this.$$set({ videoOverlayTransparency: e }), ce();
1941
+ }
1942
+ get showConfigButton() {
1943
+ return this.$$.ctx[4];
1944
+ }
1945
+ set showConfigButton(e) {
1946
+ this.$$set({ showConfigButton: e }), ce();
1947
+ }
1948
+ get showAutoCaptureButton() {
1949
+ return this.$$.ctx[5];
1950
+ }
1951
+ set showAutoCaptureButton(e) {
1952
+ this.$$set({ showAutoCaptureButton: e }), ce();
1953
+ }
1954
+ get showCameraButton() {
1955
+ return this.$$.ctx[6];
1956
+ }
1957
+ set showCameraButton(e) {
1958
+ this.$$set({ showCameraButton: e }), ce();
1959
+ }
1960
+ get showJustificationField() {
1961
+ return this.$$.ctx[7];
1962
+ }
1963
+ set showJustificationField(e) {
1964
+ this.$$set({ showJustificationField: e }), ce();
1965
+ }
1966
+ get minEyeToEyeDist() {
1967
+ return this.$$.ctx[50];
1968
+ }
1969
+ set minEyeToEyeDist(e) {
1970
+ this.$$set({ minEyeToEyeDist: e }), ce();
1971
+ }
1972
+ get widgetInstance() {
1973
+ return this.$$.ctx[1];
1974
+ }
1975
+ set widgetInstance(e) {
1976
+ this.$$set({ widgetInstance: e }), ce();
1977
+ }
1978
+ get play() {
1979
+ return this.$$.ctx[8];
1980
+ }
1981
+ }
1982
+ customElements.define("face-collector", As);
1983
+ export {
1984
+ As as default
1985
+ };