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