bry-biometric-collector 3.1.0 → 3.1.1

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,1224 @@
1
+ import { S as st, q as ot, r as nt, t as rt, x as z, y as R, z as _, bg as se, B as Q, C as f, a_ as oe, bh as Nt, W as w, I as S, J as M, bi as q, bj as bi, L as ne, U as L, O as $, b1 as De, P as ee, D as E, E as pe, G as H, H as Te, Q as te, M as X, N as v, T as F, V as vi, X as Ye, Y as be, Z as G, _ as ve, a0 as Ii, a1 as Ie, a3 as wi, a2 as ue, a4 as we, a5 as Xe, a6 as Ve, a7 as kt, ab as Ce, ad as Je, ae as Ci, af as zt, ag as ye, $ as yi, aa as xe, ai as jt, ak as Ke, ap as Mi, aq as _i, as as Di, at as pi, au as Ti, aw as qe, ax as re, j as Ai, ay as $e, aN as Rt, d as Me, aO as Wt, aP as et, aQ as Oi, aC as tt, bk as Ni, aR as ki, aS as zi, aT as ji, av as Ri, aU as Wi, bl as Ei, aW as Si, aX as _e, aY as Zi, aZ as Pi, a$ as le, b0 as lt, b2 as Fi, b3 as V, b4 as J, w as Et, b5 as Li, aF as Hi, b8 as it, bm as Ui } from "./main_de63cee6_3.1.1.js";
2
+ import { W as Bi, C as Gi, V as Qi, a as Yi } from "./ValidationAlert_1d046b33_3.1.1.js";
3
+ import { matchDimensions as Xi, resizeResults as Vi } from "./face_api_0e3ce8c8_3.1.1.js";
4
+ const Ji = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwNiIgaGVpZ2h0PSI4OTAiIHZpZXdCb3g9IjAgMCAxMjA2IDg5MCIgZmlsbD0ibm9uZSIgb3BhY2l0eT0iMC4yIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF8xOF80KSIgb3BhY2l0eT0iMCI+CiAgICA8bWFzayBpZD0icGF0aC0xLWluc2l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("mask"), r = se("rect"), n = se("rect"), u = se("rect"), this.c = Q, f(r, "width", "100%"), f(r, "height", "100%"), f(r, "fill", "white"), f(n, "id", "transparent-rect"), f(n, "x", g = "calc((100% - " + /*$docDimensions*/
10
+ a[2].width + "px) / 2)"), f(n, "y", h = "calc(" + /*y*/
11
+ a[3] + ")"), f(n, "width", d = /*$docDimensions*/
12
+ a[2].width), f(n, "height", l = /*$docDimensions*/
13
+ a[2].height), f(n, "fill", "black"), f(o, "id", "transparentAreaMask"), f(u, "width", "100%"), f(u, "height", "100%"), oe(u, "fill", "rgba(" + Nt(
14
+ /*videoOverlay*/
15
+ a[0]
16
+ ) + ", " + (1 - /*videoOverlayTransparency*/
17
+ a[1] / 100) + ")"), f(u, "mask", "url(#transparentAreaMask)"), f(t, "class", "absolute w-full h-full"), f(t, "xmlns", "http://www.w3.org/2000/svg"), f(e, "id", "overlay-container"), f(e, "class", "flex items-center justify-center absolute inset-0");
18
+ },
19
+ m(c, b) {
20
+ z(c, e, b), w(e, t), w(t, s), w(s, o), w(o, r), w(o, n), w(t, u);
21
+ },
22
+ p(c, [b]) {
23
+ b & /*$docDimensions*/
24
+ 4 && g !== (g = "calc((100% - " + /*$docDimensions*/
25
+ c[2].width + "px) / 2)") && f(n, "x", g), b & /*y*/
26
+ 8 && h !== (h = "calc(" + /*y*/
27
+ c[3] + ")") && f(n, "y", h), b & /*$docDimensions*/
28
+ 4 && d !== (d = /*$docDimensions*/
29
+ c[2].width) && f(n, "width", d), b & /*$docDimensions*/
30
+ 4 && l !== (l = /*$docDimensions*/
31
+ c[2].height) && f(n, "height", l), b & /*videoOverlay, videoOverlayTransparency*/
32
+ 3 && oe(u, "fill", "rgba(" + Nt(
33
+ /*videoOverlay*/
34
+ c[0]
35
+ ) + ", " + (1 - /*videoOverlayTransparency*/
36
+ c[1] / 100) + ")");
37
+ },
38
+ i: Q,
39
+ o: Q,
40
+ d(c) {
41
+ c && S(e);
42
+ }
43
+ };
44
+ }
45
+ function Ki(a, e, t) {
46
+ let s, o, r;
47
+ M(a, q, (l) => t(2, s = l)), M(a, bi, (l) => t(5, o = l)), M(a, ne, (l) => t(6, r = l));
48
+ let { videoOverlay: n } = e, { videoOverlayTransparency: g } = e, h, d;
49
+ return a.$$set = (l) => {
50
+ "videoOverlay" in l && t(0, n = l.videoOverlay), "videoOverlayTransparency" in l && t(1, g = l.videoOverlayTransparency);
51
+ }, a.$$.update = () => {
52
+ a.$$.dirty & /*$videoStore, $docDimensions, $captureBarHeight, divHeight*/
53
+ 116 && r && s && (t(4, h = r.videoHeight - o), t(3, d = (h - s.height) / 2 + "px"));
54
+ }, [
55
+ n,
56
+ g,
57
+ s,
58
+ d,
59
+ h,
60
+ o,
61
+ r
62
+ ];
63
+ }
64
+ class Ht extends st {
65
+ constructor(e) {
66
+ super(), ot(
67
+ this,
68
+ {
69
+ target: this.shadowRoot,
70
+ props: rt(this.attributes),
71
+ customElement: !0
72
+ },
73
+ Ki,
74
+ xi,
75
+ nt,
76
+ {
77
+ videoOverlay: 0,
78
+ videoOverlayTransparency: 1
79
+ },
80
+ null
81
+ ), e && (e.target && z(e.target, this, e.anchor), e.props && (this.$set(e.props), R()));
82
+ }
83
+ static get observedAttributes() {
84
+ return ["videoOverlay", "videoOverlayTransparency"];
85
+ }
86
+ get videoOverlay() {
87
+ return this.$$.ctx[0];
88
+ }
89
+ set videoOverlay(e) {
90
+ this.$$set({ videoOverlay: e }), R();
91
+ }
92
+ get videoOverlayTransparency() {
93
+ return this.$$.ctx[1];
94
+ }
95
+ set videoOverlayTransparency(e) {
96
+ this.$$set({ videoOverlayTransparency: e }), R();
97
+ }
98
+ }
99
+ customElements.define("document-overlay", Ht);
100
+ function St(a) {
101
+ let e, t;
102
+ return e = new Bi({}), {
103
+ c() {
104
+ $(e.$$.fragment);
105
+ },
106
+ m(s, o) {
107
+ ee(e, s, o), t = !0;
108
+ },
109
+ i(s) {
110
+ t || (E(e.$$.fragment, s), t = !0);
111
+ },
112
+ o(s) {
113
+ H(e.$$.fragment, s), t = !1;
114
+ },
115
+ d(s) {
116
+ te(e, s);
117
+ }
118
+ };
119
+ }
120
+ function qi(a) {
121
+ let e, t, s, o, r, n, g, h, d, l, u = (
122
+ /*showWatermark*/
123
+ a[3] && St()
124
+ );
125
+ return d = new Ht({
126
+ props: {
127
+ videoOverlay: (
128
+ /*videoOverlay*/
129
+ a[1]
130
+ ),
131
+ videoOverlayTransparency: (
132
+ /*videoOverlayTransparency*/
133
+ a[2]
134
+ ),
135
+ borderWidth: (
136
+ /*borderWidth*/
137
+ a[4]
138
+ )
139
+ }
140
+ }), {
141
+ c() {
142
+ e = _("div"), t = _("div"), s = _("div"), o = _("img"), n = L(), u && u.c(), h = L(), $(d.$$.fragment), this.c = Q, De(o.src, r = Ji) || f(o, "src", r), f(o, "alt", "document"), f(s, "class", "w-full h-full relative"), f(t, "class", "absolute inset-0 flex justify-center"), f(e, "id", "doc-rectangle"), f(e, "class", g = "doc-loader " + /*loading*/
143
+ (a[0] ? "doc-loading" : "") + " z-10"), f(
144
+ e,
145
+ "style",
146
+ /*styleVars*/
147
+ a[5]
148
+ );
149
+ },
150
+ m(c, b) {
151
+ z(c, e, b), w(e, t), w(t, s), w(s, o), w(e, n), u && u.m(e, null), z(c, h, b), ee(d, c, b), l = !0;
152
+ },
153
+ p(c, [b]) {
154
+ /*showWatermark*/
155
+ c[3] ? u ? b & /*showWatermark*/
156
+ 8 && E(u, 1) : (u = St(), u.c(), E(u, 1), u.m(e, null)) : u && (pe(), H(u, 1, 1, () => {
157
+ u = null;
158
+ }), Te()), (!l || b & /*loading*/
159
+ 1 && g !== (g = "doc-loader " + /*loading*/
160
+ (c[0] ? "doc-loading" : "") + " z-10")) && f(e, "class", g), (!l || b & /*styleVars*/
161
+ 32) && f(
162
+ e,
163
+ "style",
164
+ /*styleVars*/
165
+ c[5]
166
+ );
167
+ const I = {};
168
+ b & /*videoOverlay*/
169
+ 2 && (I.videoOverlay = /*videoOverlay*/
170
+ c[1]), b & /*videoOverlayTransparency*/
171
+ 4 && (I.videoOverlayTransparency = /*videoOverlayTransparency*/
172
+ c[2]), b & /*borderWidth*/
173
+ 16 && (I.borderWidth = /*borderWidth*/
174
+ c[4]), d.$set(I);
175
+ },
176
+ i(c) {
177
+ l || (E(u), E(d.$$.fragment, c), l = !0);
178
+ },
179
+ o(c) {
180
+ H(u), H(d.$$.fragment, c), l = !1;
181
+ },
182
+ d(c) {
183
+ c && S(e), u && u.d(), c && S(h), te(d, c);
184
+ }
185
+ };
186
+ }
187
+ const at = 1.36, $i = "hsl(var(--p))", ea = "hsl(var(--su))";
188
+ function ta(a, e, t) {
189
+ let s, o, r;
190
+ M(a, q, (I) => t(9, o = I)), M(a, ne, (I) => t(10, r = I));
191
+ let { loading: n } = e, { videoOverlay: g = "" } = e, { videoOverlayTransparency: h = 100 } = e, { showWatermark: d } = e, l, u, c = 6, b = 0.7;
192
+ return X() && (b = 0.85, c = 5), a.$$set = (I) => {
193
+ "loading" in I && t(0, n = I.loading), "videoOverlay" in I && t(1, g = I.videoOverlay), "videoOverlayTransparency" in I && t(2, h = I.videoOverlayTransparency), "showWatermark" in I && t(3, d = I.showWatermark);
194
+ }, a.$$.update = () => {
195
+ a.$$.dirty & /*$videoStore, percentage, rectangleHeight, rectangleWidth, $docDimensions*/
196
+ 1984 && r && (r.videoWidth / r.videoHeight > at ? (t(7, u = r.videoHeight * b), t(6, l = u * at)) : (t(6, l = r.videoWidth * b), t(7, u = l / at)), v(q, o.width = l, o), v(q, o.height = u, o), v(q, o.x = (r.videoWidth - o.width) / 2, o), v(q, o.y = (r.videoHeight - o.height) / 2, o)), a.$$.dirty & /*rectangleWidth, rectangleHeight, borderWidth*/
197
+ 208 && t(5, s = `
198
+ --rectangle-width: ${l}px;
199
+ --rectangle-height: ${u}px;
200
+ --border-color: ${$i};
201
+ --border-color-animation: ${ea};
202
+ --rectangle-border: ${c}px;
203
+ `);
204
+ }, [
205
+ n,
206
+ g,
207
+ h,
208
+ d,
209
+ c,
210
+ s,
211
+ l,
212
+ u,
213
+ b,
214
+ o,
215
+ r
216
+ ];
217
+ }
218
+ class Ut extends st {
219
+ constructor(e) {
220
+ super(), ot(
221
+ this,
222
+ {
223
+ target: this.shadowRoot,
224
+ props: rt(this.attributes),
225
+ customElement: !0
226
+ },
227
+ ta,
228
+ qi,
229
+ nt,
230
+ {
231
+ loading: 0,
232
+ videoOverlay: 1,
233
+ videoOverlayTransparency: 2,
234
+ showWatermark: 3
235
+ },
236
+ null
237
+ ), e && (e.target && z(e.target, this, e.anchor), e.props && (this.$set(e.props), R()));
238
+ }
239
+ static get observedAttributes() {
240
+ return ["loading", "videoOverlay", "videoOverlayTransparency", "showWatermark"];
241
+ }
242
+ get loading() {
243
+ return this.$$.ctx[0];
244
+ }
245
+ set loading(e) {
246
+ this.$$set({ loading: e }), R();
247
+ }
248
+ get videoOverlay() {
249
+ return this.$$.ctx[1];
250
+ }
251
+ set videoOverlay(e) {
252
+ this.$$set({ videoOverlay: e }), R();
253
+ }
254
+ get videoOverlayTransparency() {
255
+ return this.$$.ctx[2];
256
+ }
257
+ set videoOverlayTransparency(e) {
258
+ this.$$set({ videoOverlayTransparency: e }), R();
259
+ }
260
+ get showWatermark() {
261
+ return this.$$.ctx[3];
262
+ }
263
+ set showWatermark(e) {
264
+ this.$$set({ showWatermark: e }), R();
265
+ }
266
+ }
267
+ customElements.define("doc-rectangle", Ut);
268
+ function Zt(a) {
269
+ let e, t, s, o, r, n, g, h, d, l, u, c, b, I, Z, m, y, O, A = (
270
+ /*$ready*/
271
+ a[12] && Pt(a)
272
+ );
273
+ return u = new Pi({}), b = new Gi({
274
+ props: {
275
+ showConfigButton: (
276
+ /*showConfigButton*/
277
+ a[1]
278
+ ),
279
+ showCameraButton: (
280
+ /*showCameraButton*/
281
+ a[2]
282
+ ),
283
+ videoOverlay: (
284
+ /*videoOverlay*/
285
+ a[3]
286
+ ),
287
+ videoOverlayTransparency: (
288
+ /*videoOverlayTransparency*/
289
+ a[4]
290
+ ),
291
+ handler: (
292
+ /*capture*/
293
+ a[25]
294
+ )
295
+ }
296
+ }), {
297
+ c() {
298
+ e = _("div"), t = _("div"), s = _("video"), r = L(), n = _("canvas"), g = L(), h = _("div"), d = _("div"), A && A.c(), l = L(), $(u.$$.fragment), c = L(), $(b.$$.fragment), f(s, "id", "bry-cc-camera-video-tag"), f(s, "class", o = /*$ready*/
299
+ a[12] ? X() ? "absolute inset-0" : "w-full h-full object-cover" : "w-0 h-0"), s.playsInline = !0, s.muted = !0, s.autoplay = !0, f(n, "id", "bry-ce-detectionsCanvas"), f(n, "class", "absolute top-0 left-0 max-w-full"), f(t, "class", "overflow-hidden"), oe(
300
+ t,
301
+ "width",
302
+ /*$videoStore*/
303
+ a[13].videoWidth + "px"
304
+ ), oe(
305
+ t,
306
+ "height",
307
+ /*$videoStore*/
308
+ a[13].videoHeight + "px"
309
+ ), f(d, "class", "flex flex-grow w-full items-center justify-center relative"), f(h, "class", "absolute inset-0 flex flex-col items-center justify-between w-full h-full"), f(e, "class", I = /*$ready*/
310
+ a[12] ? "relative" : "relative w-0 h-0"), e.hidden = Z = /*$cameraStatusStore*/
311
+ a[11] !== F.OK;
312
+ },
313
+ m(T, j) {
314
+ z(T, e, j), w(e, t), w(t, s), a[33](s), w(t, r), w(t, n), a[35](n), w(e, g), w(e, h), w(h, d), A && A.m(d, null), w(h, l), ee(u, h, null), w(h, c), ee(b, h, null), m = !0, y || (O = [
315
+ le(
316
+ s,
317
+ "canplay",
318
+ /*canplay_handler*/
319
+ a[34]
320
+ ),
321
+ le(
322
+ s,
323
+ "play",
324
+ /*play*/
325
+ a[6],
326
+ { once: !0 }
327
+ )
328
+ ], y = !0);
329
+ },
330
+ p(T, j) {
331
+ (!m || j[0] & /*$ready*/
332
+ 4096 && o !== (o = /*$ready*/
333
+ T[12] ? X() ? "absolute inset-0" : "w-full h-full object-cover" : "w-0 h-0")) && f(s, "class", o), (!m || j[0] & /*$videoStore*/
334
+ 8192) && oe(
335
+ t,
336
+ "width",
337
+ /*$videoStore*/
338
+ T[13].videoWidth + "px"
339
+ ), (!m || j[0] & /*$videoStore*/
340
+ 8192) && oe(
341
+ t,
342
+ "height",
343
+ /*$videoStore*/
344
+ T[13].videoHeight + "px"
345
+ ), /*$ready*/
346
+ T[12] ? A ? (A.p(T, j), j[0] & /*$ready*/
347
+ 4096 && E(A, 1)) : (A = Pt(T), A.c(), E(A, 1), A.m(d, null)) : A && (pe(), H(A, 1, 1, () => {
348
+ A = null;
349
+ }), Te());
350
+ const P = {};
351
+ j[0] & /*showConfigButton*/
352
+ 2 && (P.showConfigButton = /*showConfigButton*/
353
+ T[1]), j[0] & /*showCameraButton*/
354
+ 4 && (P.showCameraButton = /*showCameraButton*/
355
+ T[2]), j[0] & /*videoOverlay*/
356
+ 8 && (P.videoOverlay = /*videoOverlay*/
357
+ T[3]), j[0] & /*videoOverlayTransparency*/
358
+ 16 && (P.videoOverlayTransparency = /*videoOverlayTransparency*/
359
+ T[4]), b.$set(P), (!m || j[0] & /*$ready*/
360
+ 4096 && I !== (I = /*$ready*/
361
+ T[12] ? "relative" : "relative w-0 h-0")) && f(e, "class", I), (!m || j[0] & /*$cameraStatusStore*/
362
+ 2048 && Z !== (Z = /*$cameraStatusStore*/
363
+ T[11] !== F.OK)) && (e.hidden = Z);
364
+ },
365
+ i(T) {
366
+ m || (E(A), E(u.$$.fragment, T), E(b.$$.fragment, T), m = !0);
367
+ },
368
+ o(T) {
369
+ H(A), H(u.$$.fragment, T), H(b.$$.fragment, T), m = !1;
370
+ },
371
+ d(T) {
372
+ T && S(e), a[33](null), a[35](null), A && A.d(), te(u), te(b), y = !1, lt(O);
373
+ }
374
+ };
375
+ }
376
+ function Pt(a) {
377
+ let e, t, s, o;
378
+ return e = new Qi({
379
+ props: {
380
+ isCountingDown: (
381
+ /*isCountingDown*/
382
+ a[10]
383
+ )
384
+ }
385
+ }), s = new Ut({
386
+ props: {
387
+ loading: (
388
+ /*isCountingDown*/
389
+ a[10]
390
+ ),
391
+ videoOverlay: (
392
+ /*videoOverlay*/
393
+ a[3]
394
+ ),
395
+ videoOverlayTransparency: (
396
+ /*videoOverlayTransparency*/
397
+ a[4]
398
+ ),
399
+ showWatermark: (
400
+ /*showWatermark*/
401
+ a[5]
402
+ )
403
+ }
404
+ }), {
405
+ c() {
406
+ $(e.$$.fragment), t = L(), $(s.$$.fragment);
407
+ },
408
+ m(r, n) {
409
+ ee(e, r, n), z(r, t, n), ee(s, r, n), o = !0;
410
+ },
411
+ p(r, n) {
412
+ const g = {};
413
+ n[0] & /*isCountingDown*/
414
+ 1024 && (g.isCountingDown = /*isCountingDown*/
415
+ r[10]), e.$set(g);
416
+ const h = {};
417
+ n[0] & /*isCountingDown*/
418
+ 1024 && (h.loading = /*isCountingDown*/
419
+ r[10]), n[0] & /*videoOverlay*/
420
+ 8 && (h.videoOverlay = /*videoOverlay*/
421
+ r[3]), n[0] & /*videoOverlayTransparency*/
422
+ 16 && (h.videoOverlayTransparency = /*videoOverlayTransparency*/
423
+ r[4]), n[0] & /*showWatermark*/
424
+ 32 && (h.showWatermark = /*showWatermark*/
425
+ r[5]), s.$set(h);
426
+ },
427
+ i(r) {
428
+ o || (E(e.$$.fragment, r), E(s.$$.fragment, r), o = !0);
429
+ },
430
+ o(r) {
431
+ H(e.$$.fragment, r), H(s.$$.fragment, r), o = !1;
432
+ },
433
+ d(r) {
434
+ te(e, r), r && S(t), te(s, r);
435
+ }
436
+ };
437
+ }
438
+ function Ft(a) {
439
+ let e, t, s, o, r;
440
+ function n(d, l) {
441
+ return (
442
+ /*$isLoading*/
443
+ d[21] ? aa : ia
444
+ );
445
+ }
446
+ let g = n(a), h = g(a);
447
+ return {
448
+ c() {
449
+ e = _("slot"), t = _("div"), s = _("img"), r = L(), h.c(), De(s.src, o = Fi) || f(s, "src", o), f(s, "alt", "loading gif"), f(s, "class", "m-auto h-[10em] lg:h-[12em]"), f(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), f(e, "name", "loading-camera-gif"), f(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
450
+ },
451
+ m(d, l) {
452
+ z(d, e, l), w(e, t), w(t, s), w(t, r), h.m(t, null);
453
+ },
454
+ p(d, l) {
455
+ g === (g = n(d)) && h ? h.p(d, l) : (h.d(1), h = g(d), h && (h.c(), h.m(t, null)));
456
+ },
457
+ d(d) {
458
+ d && S(e), h.d();
459
+ }
460
+ };
461
+ }
462
+ function ia(a) {
463
+ let e, t = (
464
+ /*$_*/
465
+ a[19]("faceCollector.initiatingCamera") + ""
466
+ ), s;
467
+ return {
468
+ c() {
469
+ e = _("span"), s = V(t), f(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
470
+ },
471
+ m(o, r) {
472
+ z(o, e, r), w(e, s);
473
+ },
474
+ p(o, r) {
475
+ r[0] & /*$_*/
476
+ 524288 && t !== (t = /*$_*/
477
+ o[19]("faceCollector.initiatingCamera") + "") && J(s, t);
478
+ },
479
+ d(o) {
480
+ o && S(e);
481
+ }
482
+ };
483
+ }
484
+ function aa(a) {
485
+ let e;
486
+ return {
487
+ c() {
488
+ e = _("span"), e.textContent = "Loading camera...", f(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
489
+ },
490
+ m(t, s) {
491
+ z(t, e, s);
492
+ },
493
+ p: Q,
494
+ d(t) {
495
+ t && S(e);
496
+ }
497
+ };
498
+ }
499
+ function Lt(a) {
500
+ let e, t, s = (
501
+ /*$_*/
502
+ a[19]("faceCollector.finish") + ""
503
+ ), o, r, n, g, h = (
504
+ /*$_*/
505
+ a[19]("faceCollector.retakePhoto") + ""
506
+ ), d, l, u;
507
+ return {
508
+ c() {
509
+ e = _("div"), t = _("button"), o = V(s), n = L(), g = _("button"), d = V(h), t.disabled = r = /*$justification*/
510
+ a[16].length === 0, f(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), f(g, "id", "bry-cc-retake-button"), f(g, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), f(e, "class", "ce-dui-btn-group flex");
511
+ },
512
+ m(c, b) {
513
+ z(c, e, b), w(e, t), w(t, o), w(e, n), w(e, g), w(g, d), l || (u = [
514
+ le(
515
+ t,
516
+ "click",
517
+ /*click_handler*/
518
+ a[36]
519
+ ),
520
+ le(
521
+ g,
522
+ "click",
523
+ /*click_handler_1*/
524
+ a[37]
525
+ )
526
+ ], l = !0);
527
+ },
528
+ p(c, b) {
529
+ b[0] & /*$_*/
530
+ 524288 && s !== (s = /*$_*/
531
+ c[19]("faceCollector.finish") + "") && J(o, s), b[0] & /*$justification*/
532
+ 65536 && r !== (r = /*$justification*/
533
+ c[16].length === 0) && (t.disabled = r), b[0] & /*$_*/
534
+ 524288 && h !== (h = /*$_*/
535
+ c[19]("faceCollector.retakePhoto") + "") && J(d, h);
536
+ },
537
+ d(c) {
538
+ c && S(e), l = !1, lt(u);
539
+ }
540
+ };
541
+ }
542
+ function sa(a) {
543
+ let e, t;
544
+ return e = new Yi({ props: { handler: (
545
+ /*func*/
546
+ a[41]
547
+ ) } }), {
548
+ c() {
549
+ $(e.$$.fragment);
550
+ },
551
+ m(s, o) {
552
+ ee(e, s, o), t = !0;
553
+ },
554
+ p: Q,
555
+ i(s) {
556
+ t || (E(e.$$.fragment, s), t = !0);
557
+ },
558
+ o(s) {
559
+ H(e.$$.fragment, s), t = !1;
560
+ },
561
+ d(s) {
562
+ te(e, s);
563
+ }
564
+ };
565
+ }
566
+ function oa(a) {
567
+ let e, t, s, o, r, n;
568
+ function g(l, u) {
569
+ return (
570
+ /*$captured*/
571
+ l[14] ? na : ra
572
+ );
573
+ }
574
+ let h = g(a), d = h(a);
575
+ return {
576
+ c() {
577
+ e = _("div"), t = _("img"), r = L(), d.c(), f(t, "class", "m-auto col-start-1 col-end-1 max-h-[23.2em]"), De(t.src, s = /*$dataTypePrefix*/
578
+ a[20] + "," + /*$image*/
579
+ a[17]) || f(t, "src", s), t.hidden = o = !/*$captured*/
580
+ a[14] || !/*$showFaceWhileValidating*/
581
+ a[22], f(t, "alt", ""), f(e, "class", n = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (/*$showFaceWhileValidating*/
582
+ a[22] ? "grid overflow-hidden" : "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible"));
583
+ },
584
+ m(l, u) {
585
+ z(l, e, u), w(e, t), w(e, r), d.m(e, null);
586
+ },
587
+ p(l, u) {
588
+ u[0] & /*$dataTypePrefix, $image*/
589
+ 1179648 && !De(t.src, s = /*$dataTypePrefix*/
590
+ l[20] + "," + /*$image*/
591
+ l[17]) && f(t, "src", s), u[0] & /*$captured, $showFaceWhileValidating*/
592
+ 4210688 && o !== (o = !/*$captured*/
593
+ l[14] || !/*$showFaceWhileValidating*/
594
+ l[22]) && (t.hidden = o), h === (h = g(l)) && d ? d.p(l, u) : (d.d(1), d = h(l), d && (d.c(), d.m(e, null))), u[0] & /*$showFaceWhileValidating*/
595
+ 4194304 && n !== (n = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (/*$showFaceWhileValidating*/
596
+ l[22] ? "grid overflow-hidden" : "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible")) && f(e, "class", n);
597
+ },
598
+ i: Q,
599
+ o: Q,
600
+ d(l) {
601
+ l && S(e), d.d();
602
+ }
603
+ };
604
+ }
605
+ function na(a) {
606
+ let e, t, s, o, r = (
607
+ /*$_*/
608
+ a[19]("faceCollector.finish") + ""
609
+ ), n, g, h, d, l = (
610
+ /*$_*/
611
+ a[19]("faceCollector.retakePhoto") + ""
612
+ ), u, c, b;
613
+ function I(y, O) {
614
+ return (
615
+ /*$requestResult*/
616
+ y[18] === re.TEMPLATE_EXTRACTION_ERROR ? ua : (
617
+ /*$saved*/
618
+ y[15] ? la : ca
619
+ )
620
+ );
621
+ }
622
+ let Z = I(a), m = Z(a);
623
+ return {
624
+ c() {
625
+ e = _("div"), m.c(), t = L(), s = _("div"), o = _("button"), n = V(r), h = L(), d = _("button"), u = V(l), o.disabled = g = /*$saved*/
626
+ a[15] || /*$requestResult*/
627
+ a[18] !== re.OK, f(o, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), f(d, "id", "bry-cc-retake-button"), f(d, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), f(s, "class", "ce-dui-btn-group flex"), f(e, "class", "flex flex-col justify-between");
628
+ },
629
+ m(y, O) {
630
+ z(y, e, O), m.m(e, null), w(e, t), w(e, s), w(s, o), w(o, n), w(s, h), w(s, d), w(d, u), c || (b = [
631
+ le(
632
+ o,
633
+ "click",
634
+ /*click_handler_2*/
635
+ a[39]
636
+ ),
637
+ le(
638
+ d,
639
+ "click",
640
+ /*click_handler_3*/
641
+ a[40]
642
+ )
643
+ ], c = !0);
644
+ },
645
+ p(y, O) {
646
+ Z === (Z = I(y)) && m ? m.p(y, O) : (m.d(1), m = Z(y), m && (m.c(), m.m(e, t))), O[0] & /*$_*/
647
+ 524288 && r !== (r = /*$_*/
648
+ y[19]("faceCollector.finish") + "") && J(n, r), O[0] & /*$saved, $requestResult*/
649
+ 294912 && g !== (g = /*$saved*/
650
+ y[15] || /*$requestResult*/
651
+ y[18] !== re.OK) && (o.disabled = g), O[0] & /*$_*/
652
+ 524288 && l !== (l = /*$_*/
653
+ y[19]("faceCollector.retakePhoto") + "") && J(u, l);
654
+ },
655
+ d(y) {
656
+ y && S(e), m.d(), c = !1, lt(b);
657
+ }
658
+ };
659
+ }
660
+ function ra(a) {
661
+ let e;
662
+ return {
663
+ c() {
664
+ e = _("div"), f(e, "class", "");
665
+ },
666
+ m(t, s) {
667
+ z(t, e, s);
668
+ },
669
+ p: Q,
670
+ d(t) {
671
+ t && S(e);
672
+ }
673
+ };
674
+ }
675
+ function la(a) {
676
+ let e, t = (
677
+ /*$_*/
678
+ a[19]("docCollector.captured") + ""
679
+ ), s;
680
+ return {
681
+ c() {
682
+ e = _("h1"), s = V(t), f(e, "class", "text-3xl font-bold pb-[1em] transition-opacity");
683
+ },
684
+ m(o, r) {
685
+ z(o, e, r), w(e, s);
686
+ },
687
+ p(o, r) {
688
+ r[0] & /*$_*/
689
+ 524288 && t !== (t = /*$_*/
690
+ o[19]("docCollector.captured") + "") && J(s, t);
691
+ },
692
+ d(o) {
693
+ o && S(e);
694
+ }
695
+ };
696
+ }
697
+ function ca(a) {
698
+ let e, t = (
699
+ /*$_*/
700
+ a[19]("faceCollector.everythingOk") + ""
701
+ ), s;
702
+ return {
703
+ c() {
704
+ e = _("h1"), s = V(t), f(e, "class", "text-3xl font-bold pb-[1em] transition-opacity");
705
+ },
706
+ m(o, r) {
707
+ z(o, e, r), w(e, s);
708
+ },
709
+ p(o, r) {
710
+ r[0] & /*$_*/
711
+ 524288 && t !== (t = /*$_*/
712
+ o[19]("faceCollector.everythingOk") + "") && J(s, t);
713
+ },
714
+ d(o) {
715
+ o && S(e);
716
+ }
717
+ };
718
+ }
719
+ function ua(a) {
720
+ let e, t = (
721
+ /*$_*/
722
+ a[19]("docCollector.docNotFound") + ""
723
+ ), s;
724
+ return {
725
+ c() {
726
+ e = _("h1"), s = V(t), f(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
727
+ },
728
+ m(o, r) {
729
+ z(o, e, r), w(e, s);
730
+ },
731
+ p(o, r) {
732
+ r[0] & /*$_*/
733
+ 524288 && t !== (t = /*$_*/
734
+ o[19]("docCollector.docNotFound") + "") && J(s, t);
735
+ },
736
+ d(o) {
737
+ o && S(e);
738
+ }
739
+ };
740
+ }
741
+ function da(a) {
742
+ let e, t, s, o, r, n, g, h, d, l = (
743
+ /*$videoStore*/
744
+ a[13] && Zt(a)
745
+ ), u = !/*$ready*/
746
+ a[12] && /*$cameraStatusStore*/
747
+ a[11] === F.OK && Ft(a), c = (
748
+ /*$captured*/
749
+ a[14] && Lt(a)
750
+ );
751
+ const b = [oa, sa], I = [];
752
+ function Z(m, y) {
753
+ return (
754
+ /*showUnconformities*/
755
+ m[0] && /*$captured*/
756
+ m[14] ? 0 : (
757
+ /*$cameraStatusStore*/
758
+ m[11] !== F.OK ? 1 : -1
759
+ )
760
+ );
761
+ }
762
+ return ~(n = Z(a)) && (g = I[n] = b[n](a)), {
763
+ c() {
764
+ e = _("div"), t = _("div"), l && l.c(), s = L(), u && u.c(), o = L(), c && c.c(), r = L(), g && g.c(), h = vi(), this.c = Q, f(t, "class", "relative mx-auto"), f(e, "class", "flex flex-col justify-between");
765
+ },
766
+ m(m, y) {
767
+ z(m, e, y), w(e, t), l && l.m(t, null), w(t, s), u && u.m(t, null), w(t, o), c && c.m(t, null), a[38](e), z(m, r, y), ~n && I[n].m(m, y), z(m, h, y), d = !0;
768
+ },
769
+ p(m, y) {
770
+ /*$videoStore*/
771
+ m[13] ? l ? (l.p(m, y), y[0] & /*$videoStore*/
772
+ 8192 && E(l, 1)) : (l = Zt(m), l.c(), E(l, 1), l.m(t, s)) : l && (pe(), H(l, 1, 1, () => {
773
+ l = null;
774
+ }), Te()), !/*$ready*/
775
+ m[12] && /*$cameraStatusStore*/
776
+ m[11] === F.OK ? u ? u.p(m, y) : (u = Ft(m), u.c(), u.m(t, o)) : u && (u.d(1), u = null), /*$captured*/
777
+ m[14] ? c ? c.p(m, y) : (c = Lt(m), c.c(), c.m(t, null)) : c && (c.d(1), c = null);
778
+ let O = n;
779
+ n = Z(m), n === O ? ~n && I[n].p(m, y) : (g && (pe(), H(I[O], 1, 1, () => {
780
+ I[O] = null;
781
+ }), Te()), ~n ? (g = I[n], g ? g.p(m, y) : (g = I[n] = b[n](m), g.c()), E(g, 1), g.m(h.parentNode, h)) : g = null);
782
+ },
783
+ i(m) {
784
+ d || (E(l), E(g), d = !0);
785
+ },
786
+ o(m) {
787
+ H(l), H(g), d = !1;
788
+ },
789
+ d(m) {
790
+ m && S(e), l && l.d(), u && u.d(), c && c.d(), a[38](null), m && S(r), ~n && I[n].d(m), m && S(h);
791
+ }
792
+ };
793
+ }
794
+ let fa = !1, ga = 0;
795
+ function ha(a, e, t) {
796
+ const s = e.videoWidth / e.videoHeight, o = t.width / t.height;
797
+ let r = 0, n = 0, g = e.videoWidth, h = e.videoHeight;
798
+ s > o ? (g = e.videoHeight * o, r = (e.videoWidth - g) / 2) : s < o && (h = e.videoWidth / o, n = (e.videoHeight - h) / 2), a.drawImage(e, r, n, g, h, 0, 0, t.width, t.height);
799
+ }
800
+ function ma(a, e, t) {
801
+ let s, o, r, n, g, h, d, l, u, c, b, I, Z, m, y, O, A, T, j, P, Ae, x, de, K, ct, ut, dt;
802
+ M(a, Ye, (i) => t(55, s = i)), M(a, be, (i) => t(57, r = i)), M(a, G, (i) => t(11, n = i)), M(a, ve, (i) => t(12, g = i)), M(a, Ii, (i) => t(58, h = i)), M(a, Ie, (i) => t(59, d = i)), M(a, wi, (i) => t(60, l = i)), M(a, ue, (i) => t(61, u = i)), M(a, ne, (i) => t(13, c = i)), M(a, we, (i) => t(14, b = i)), M(a, Xe, (i) => t(62, I = i)), M(a, Ve, (i) => t(63, Z = i)), M(a, kt, (i) => t(64, m = i)), M(a, q, (i) => t(65, y = i)), M(a, Ce, (i) => t(66, O = i)), M(a, Je, (i) => t(15, A = i)), M(a, Ci, (i) => t(16, T = i)), M(a, zt, (i) => t(17, j = i)), M(a, ye, (i) => t(18, P = i)), M(a, yi, (i) => t(19, Ae = i)), M(a, xe, (i) => t(67, x = i)), M(a, jt, (i) => t(68, K = i)), M(a, Ke, (i) => t(69, ct = i)), M(a, Mi, (i) => t(21, ut = i)), M(a, _i, (i) => t(22, dt = i));
803
+ let D, W, Y, ce = !1, ft = !1, U = {
804
+ width: 2560,
805
+ height: 1440,
806
+ aspectRatio: -1
807
+ };
808
+ const Bt = { width: 2560, height: 1440 };
809
+ let { enableMinutiae: Oe } = e, { videoDimensions: Ne } = e, { noTabs: ke } = e, { weightsPath: ze } = e, { showUnconformities: gt } = e, { showConfigButton: ht } = e, { showCameraButton: mt } = e, { videoOverlay: bt } = e, { videoOverlayTransparency: vt } = e, { showWatermark: It } = e;
810
+ const fe = Et(!1);
811
+ M(a, fe, (i) => t(56, o = i));
812
+ const je = Et("data:image/png;base64");
813
+ M(a, je, (i) => t(20, de = i));
814
+ let wt = !1, ge = !0, Ct = 0, Re = 0, We = !0, yt = 0, Ee = (/* @__PURE__ */ new Date()).getTime(), Se = !1;
815
+ Di.mixin({
816
+ toast: !0,
817
+ position: "bottom-left",
818
+ timer: 13e3,
819
+ timerProgressBar: !0
820
+ }), pi(async () => {
821
+ if (v(ve, g = !1, g), Mt(), K)
822
+ try {
823
+ await Ti(ze), ft = !0;
824
+ } catch {
825
+ v(jt, K = !1, K);
826
+ }
827
+ await Pe(), Qt();
828
+ });
829
+ function Mt() {
830
+ v(we, b = !1, b), v(kt, m = !0, m), v(Ce, O = "", O), v(Ie, d = qe.REAR_CAMERA, d), v(be, r = !1, r), v(Je, A = !1, A), v(ye, P = re.OK, P), v(xe, x = "", x);
831
+ const i = Ai($e);
832
+ i.closedMouth = !1, i.isPersonCloseEnough = !1, i.isPersonTooclose = !0, i.isPersonInFrame = !1, $e.set(i);
833
+ }
834
+ async function Gt() {
835
+ const [i, p] = (Ne ?? "")?.replaceAll(" ", "")?.split("x")?.map((C) => C ? parseInt(C) : void 0);
836
+ !i || !p || (X() ? (await Li(), v(
837
+ ne,
838
+ c = {
839
+ videoWidth: window.innerWidth,
840
+ videoHeight: window.innerHeight
841
+ },
842
+ c
843
+ )) : v(ne, c = { videoWidth: i, videoHeight: p }, c));
844
+ }
845
+ function _t() {
846
+ v(G, n = F.OK, n), wt = !0, ge = !1;
847
+ }
848
+ async function he() {
849
+ if (K && !ft)
850
+ return _e(D, he);
851
+ if (D) {
852
+ if (ct !== tt.Document && !ke)
853
+ return _e(D, he);
854
+ v(ve, g = !0, g), K && (o || v(fe, o = !0, o)), _e(D, he);
855
+ }
856
+ }
857
+ async function Dt() {
858
+ let i = Yt();
859
+ if (K && !await Hi(i)) {
860
+ console.warn("Document capture - document not detected! Resetting capture.");
861
+ return;
862
+ }
863
+ v(we, b = !0, b);
864
+ let p = [];
865
+ try {
866
+ const C = i.toDataURL("image/jpeg").split(",");
867
+ v(je, de = C[0], de), v(zt, j = C[1], j), v(xe, x = C[1], x), p = [
868
+ {
869
+ bodyPart: "DOCUMENT",
870
+ data: x
871
+ }
872
+ ], v(ye, P = re.OK, P), window.dispatchEvent(new CustomEvent(
873
+ "document-unconformities-validated",
874
+ {
875
+ detail: { bodyParts: p, status: P }
876
+ }
877
+ ));
878
+ } catch (C) {
879
+ console.error(C);
880
+ let N, k = Ui.DOCUMENT_NOT_FOUND, B = [];
881
+ C instanceof Error && ["DOCUMENT_NOT_FOUND"].includes(C.message) && (v(ye, P = re.TEMPLATE_EXTRACTION_ERROR, P), N = C.message, B = [
882
+ {
883
+ bodyPart: "DOCUMENT",
884
+ data: x,
885
+ format: "jpg"
886
+ }
887
+ ]), window.dispatchEvent(new CustomEvent(
888
+ "document-unconformities-validated",
889
+ {
890
+ detail: {
891
+ bodyParts: B,
892
+ errorCode: N,
893
+ translatedError: Ae(k),
894
+ status: P
895
+ }
896
+ }
897
+ ));
898
+ }
899
+ }
900
+ function Ze() {
901
+ const i = {
902
+ bodyPart: "DOCUMENT",
903
+ data: j,
904
+ justification: T
905
+ };
906
+ v(Je, A = !0, A), window.dispatchEvent(new CustomEvent("export-document", { detail: i }));
907
+ }
908
+ function me() {
909
+ window.dispatchEvent(new CustomEvent("document-scrapped")), Mt(), ge && _t();
910
+ }
911
+ async function Pe(i) {
912
+ if (!We) {
913
+ v(G, n = F.CAMERA_ORIENTATION_PORTRAIT, n);
914
+ return;
915
+ }
916
+ await Gt();
917
+ try {
918
+ let { stream: p, deviceId: C, width: N, height: k, aspectRatio: B } = await Rt(U.width, U.height, d, i);
919
+ if (v(Xe, I = p, I), U.aspectRatio = B || N / k, U.aspectRatio > 1 && N < U.width || U.aspectRatio < 1 && k < U.width) {
920
+ U.width = N, U.height = N / 1.7777, I.getTracks()?.forEach((Le) => Le?.stop());
921
+ const { stream: Fe } = await Rt(U.width, U.height, d, i);
922
+ v(Xe, I = Fe, I);
923
+ }
924
+ v(ue, u = C || l[0].deviceId, u);
925
+ } catch (p) {
926
+ const C = p;
927
+ ge = !0;
928
+ const N = Me(p) && p.constraint ? p.constraint : "";
929
+ console.error(C, N), Me(C) && "message" in C && C.message.includes("Permission denied") && (console.error("User didn't give permission to use camera!"), v(G, n = F.CAMERA_DENIED_ERROR, n)), Me(C) && "message" in C && C.message.includes("Requested device not found") && v(G, n = F.DEVICE_NOT_FOUND_ERROR, n), (N.includes("width") || N.includes("height")) && (console.error(`Camera does not meet the minimum supported requirements! (${N})`), v(G, n = F.CAMERA_UNSUPPORTED, n));
930
+ }
931
+ }
932
+ async function ie() {
933
+ v(ue, u = "", u), await Pe();
934
+ }
935
+ function Qt() {
936
+ navigator.mediaDevices.ondevicechange = async (i) => {
937
+ await Wt(), n !== F.OK ? await ie() : I.active || (et(), v(G, n = F.DEVICE_NOT_FOUND_ERROR, n));
938
+ };
939
+ }
940
+ function pt() {
941
+ v(be, r = !1, r);
942
+ const i = (/* @__PURE__ */ new Date()).getTime();
943
+ i - Ee > 5e3 ? (Ee = i, v(Ce, O = "docCollector.docWasNotFound", O)) : Se || (Se = !0, setTimeout(
944
+ () => {
945
+ Se = !1, O != "docCollector.docWasNotFound" && v(Ce, O = "", O);
946
+ },
947
+ 1500
948
+ ));
949
+ }
950
+ function Yt() {
951
+ const i = c.videoWidth, p = c.videoHeight, C = Bt.width, N = p / i * C, k = document.createElement("canvas"), B = k.getContext("2d");
952
+ k.width = C, k.height = N, B && ha(B, D, k);
953
+ const Fe = k.width / c.videoWidth, Le = k.height / c.videoHeight, fi = X() ? 0.25 : 0.15, gi = Math.round(k.height * fi), He = y.width * Fe, Ue = y.height * Le, At = (X() ? 0.15 : 0.2) * He, Ot = 0.2 * Ue, hi = (k.width - He) / 2 - At / 2, mi = (k.height - gi - Ue) / 2 - Ot / 2, Be = He + At, Ge = Ue + Ot, ae = document.createElement("canvas");
954
+ ae.width = Be, ae.height = Ge;
955
+ const Qe = ae.getContext("2d");
956
+ return Qe?.clearRect(0, 0, ae.width, ae.height), Qe?.drawImage(k, hi, mi, Be, Ge, 0, 0, Be, Ge), Qe?.save(), ae;
957
+ }
958
+ const Xt = ne.subscribe((i) => {
959
+ D && W && (t(7, D.width = i.videoWidth, D), t(7, D.height = i.videoHeight, D), t(8, W.width = i.videoWidth, W), t(8, W.height = i.videoHeight, W));
960
+ }), Vt = $e.subscribe((i) => {
961
+ let p = "";
962
+ if (i.isPersonCloseEnough ? i.isPersonTooclose ? p = "docCollector.moveAwayCamera" : i.isPersonInFrame || (p = "docCollector.stayInFrame") : p = "docCollector.comeCloserCamera", r && Oi(p), !b && m && r && !ce && i.isPersonInFrame && !(!i.isPersonCloseEnough || i.isPersonTooclose)) {
963
+ t(10, ce = !0), yt = (/* @__PURE__ */ new Date()).getTime() + 4500;
964
+ const C = setInterval(
965
+ async () => {
966
+ if (!m || b || !i.isPersonCloseEnough || i.isPersonTooclose || !i.isPersonInFrame) {
967
+ t(10, ce = !1), setTimeout(
968
+ () => {
969
+ },
970
+ 1500
971
+ ), clearInterval(C);
972
+ return;
973
+ }
974
+ const N = (/* @__PURE__ */ new Date()).getTime();
975
+ Math.floor((yt - N) % (1e3 * 60) / 1e3) <= 0 && (clearInterval(C), t(10, ce = !1), Dt());
976
+ },
977
+ 100
978
+ );
979
+ }
980
+ }), Jt = we.subscribe((i) => {
981
+ Y && (i ? (Y.classList.remove("flex"), Y.classList.add("hidden")) : (Y.classList.add("flex"), Y.classList.remove("hidden")));
982
+ }), xt = Ve.subscribe((i) => {
983
+ D && i && (console.log("setting null in video srcObject"), t(7, D.srcObject = null, D), t(7, D.src = "", D), v(ue, u = null, u));
984
+ });
985
+ Ke.subscribe(async (i) => {
986
+ i === tt.Document && await Wt();
987
+ });
988
+ const Kt = ue.subscribe(async (i) => {
989
+ if (!(!I || !i))
990
+ try {
991
+ const p = await Ni(U.width, U.height, i);
992
+ t(7, D.srcObject = I, D), v(Ve, Z = !1, Z), I.getTracks().forEach((C) => {
993
+ C.readyState === "live" && console.log(`Camera ${C.label} opened successfully!`);
994
+ }), v(G, n = F.OK, n), ki(D);
995
+ } catch (p) {
996
+ const C = p;
997
+ ge = !0, Me(C) && "message" in C && C.message.includes("Requested device not found") && v(G, n = F.DEVICE_NOT_FOUND_ERROR, n);
998
+ }
999
+ }), qt = Ke.subscribe(async (i) => {
1000
+ i === tt.Document && !wt && !b && fa && await _t();
1001
+ }), $t = fe.subscribe(async (i) => {
1002
+ i && Tt();
1003
+ }), ei = ve.subscribe((i) => {
1004
+ i && window.dispatchEvent(new CustomEvent("brycc-camera-ready"));
1005
+ }), ti = zi.subscribe(async (i) => {
1006
+ if (!(!c || l.length <= 1)) {
1007
+ if (et(), !X()) {
1008
+ const C = (l.findIndex((k) => k.deviceId === u) + 1) % l.length, N = l[C].deviceId;
1009
+ await Pe(N);
1010
+ return;
1011
+ }
1012
+ i ? (v(Ie, d = qe.FRONT_CAMERA, d), await ie()) : (v(Ie, d = qe.REAR_CAMERA, d), await ie());
1013
+ }
1014
+ }), ii = ji.subscribe(async (i) => {
1015
+ !i.isSupported || !X() || h != "DOCUMENT" || (We = i.orientation.includes("portrait"), We ? D && !g ? await ie() : v(G, n = F.OK, n) : v(G, n = F.CAMERA_ORIENTATION_PORTRAIT, n));
1016
+ });
1017
+ async function Tt() {
1018
+ let i;
1019
+ try {
1020
+ if (Re >= ga) {
1021
+ Re = 0;
1022
+ const p = await Ri(), C = await import("./face_api_0e3ce8c8_3.1.1.js");
1023
+ let N;
1024
+ if (N = C.detectSingleFace(D, p), i = await N.withFaceLandmarks(), W.getContext("2d")?.clearRect(0, 0, W.width, W.height), i != null) {
1025
+ const k = Xi(W, D, !0);
1026
+ Wi(W, D, k);
1027
+ const B = Vi(i, k);
1028
+ Ei(B) ? (Si(B, W, Oe, !0), v(be, r = !0, r), Ee = (/* @__PURE__ */ new Date()).getTime()) : pt();
1029
+ } else
1030
+ pt();
1031
+ } else
1032
+ Re++;
1033
+ } catch (p) {
1034
+ console.warn(`FaceapiLoop: ${p}`);
1035
+ } finally {
1036
+ o && _e(D, Tt);
1037
+ }
1038
+ }
1039
+ Ye.subscribe(async (i) => {
1040
+ i && (me(), v(Ye, s = !1, s));
1041
+ }), Zi(() => {
1042
+ console.log("Destroying document collector"), et(), Jt(), Vt(), Xt(), xt(), Kt(), qt(), clearInterval(Ct), $t(), ti(), ei(), ii(), Ct = 0;
1043
+ });
1044
+ function ai(i) {
1045
+ it[i ? "unshift" : "push"](() => {
1046
+ D = i, t(7, D);
1047
+ });
1048
+ }
1049
+ const si = () => {
1050
+ t(7, D.width = c.videoWidth, D), t(7, D.height = c.videoHeight, D), t(8, W.width = c.videoWidth, W), t(8, W.height = c.videoHeight, W);
1051
+ };
1052
+ function oi(i) {
1053
+ it[i ? "unshift" : "push"](() => {
1054
+ W = i, t(8, W);
1055
+ });
1056
+ }
1057
+ const ni = () => Ze(), ri = () => me();
1058
+ function li(i) {
1059
+ it[i ? "unshift" : "push"](() => {
1060
+ Y = i, t(9, Y);
1061
+ });
1062
+ }
1063
+ const ci = () => Ze(), ui = () => me(), di = async () => {
1064
+ await ie();
1065
+ };
1066
+ return a.$$set = (i) => {
1067
+ "enableMinutiae" in i && t(29, Oe = i.enableMinutiae), "videoDimensions" in i && t(30, Ne = i.videoDimensions), "noTabs" in i && t(31, ke = i.noTabs), "weightsPath" in i && t(32, ze = i.weightsPath), "showUnconformities" in i && t(0, gt = i.showUnconformities), "showConfigButton" in i && t(1, ht = i.showConfigButton), "showCameraButton" in i && t(2, mt = i.showCameraButton), "videoOverlay" in i && t(3, bt = i.videoOverlay), "videoOverlayTransparency" in i && t(4, vt = i.videoOverlayTransparency), "showWatermark" in i && t(5, It = i.showWatermark);
1068
+ }, [
1069
+ gt,
1070
+ ht,
1071
+ mt,
1072
+ bt,
1073
+ vt,
1074
+ It,
1075
+ he,
1076
+ D,
1077
+ W,
1078
+ Y,
1079
+ ce,
1080
+ n,
1081
+ g,
1082
+ c,
1083
+ b,
1084
+ A,
1085
+ T,
1086
+ j,
1087
+ P,
1088
+ Ae,
1089
+ de,
1090
+ ut,
1091
+ dt,
1092
+ fe,
1093
+ je,
1094
+ Dt,
1095
+ Ze,
1096
+ me,
1097
+ ie,
1098
+ Oe,
1099
+ Ne,
1100
+ ke,
1101
+ ze,
1102
+ ai,
1103
+ si,
1104
+ oi,
1105
+ ni,
1106
+ ri,
1107
+ li,
1108
+ ci,
1109
+ ui,
1110
+ di
1111
+ ];
1112
+ }
1113
+ class ba extends st {
1114
+ constructor(e) {
1115
+ super(), ot(
1116
+ this,
1117
+ {
1118
+ target: this.shadowRoot,
1119
+ props: rt(this.attributes),
1120
+ customElement: !0
1121
+ },
1122
+ ma,
1123
+ da,
1124
+ nt,
1125
+ {
1126
+ enableMinutiae: 29,
1127
+ videoDimensions: 30,
1128
+ noTabs: 31,
1129
+ weightsPath: 32,
1130
+ showUnconformities: 0,
1131
+ showConfigButton: 1,
1132
+ showCameraButton: 2,
1133
+ videoOverlay: 3,
1134
+ videoOverlayTransparency: 4,
1135
+ showWatermark: 5,
1136
+ play: 6
1137
+ },
1138
+ null,
1139
+ [-1, -1, -1]
1140
+ ), e && (e.target && z(e.target, this, e.anchor), e.props && (this.$set(e.props), R()));
1141
+ }
1142
+ static get observedAttributes() {
1143
+ return [
1144
+ "enableMinutiae",
1145
+ "videoDimensions",
1146
+ "noTabs",
1147
+ "weightsPath",
1148
+ "showUnconformities",
1149
+ "showConfigButton",
1150
+ "showCameraButton",
1151
+ "videoOverlay",
1152
+ "videoOverlayTransparency",
1153
+ "showWatermark",
1154
+ "play"
1155
+ ];
1156
+ }
1157
+ get enableMinutiae() {
1158
+ return this.$$.ctx[29];
1159
+ }
1160
+ set enableMinutiae(e) {
1161
+ this.$$set({ enableMinutiae: e }), R();
1162
+ }
1163
+ get videoDimensions() {
1164
+ return this.$$.ctx[30];
1165
+ }
1166
+ set videoDimensions(e) {
1167
+ this.$$set({ videoDimensions: e }), R();
1168
+ }
1169
+ get noTabs() {
1170
+ return this.$$.ctx[31];
1171
+ }
1172
+ set noTabs(e) {
1173
+ this.$$set({ noTabs: e }), R();
1174
+ }
1175
+ get weightsPath() {
1176
+ return this.$$.ctx[32];
1177
+ }
1178
+ set weightsPath(e) {
1179
+ this.$$set({ weightsPath: e }), R();
1180
+ }
1181
+ get showUnconformities() {
1182
+ return this.$$.ctx[0];
1183
+ }
1184
+ set showUnconformities(e) {
1185
+ this.$$set({ showUnconformities: e }), R();
1186
+ }
1187
+ get showConfigButton() {
1188
+ return this.$$.ctx[1];
1189
+ }
1190
+ set showConfigButton(e) {
1191
+ this.$$set({ showConfigButton: e }), R();
1192
+ }
1193
+ get showCameraButton() {
1194
+ return this.$$.ctx[2];
1195
+ }
1196
+ set showCameraButton(e) {
1197
+ this.$$set({ showCameraButton: e }), R();
1198
+ }
1199
+ get videoOverlay() {
1200
+ return this.$$.ctx[3];
1201
+ }
1202
+ set videoOverlay(e) {
1203
+ this.$$set({ videoOverlay: e }), R();
1204
+ }
1205
+ get videoOverlayTransparency() {
1206
+ return this.$$.ctx[4];
1207
+ }
1208
+ set videoOverlayTransparency(e) {
1209
+ this.$$set({ videoOverlayTransparency: e }), R();
1210
+ }
1211
+ get showWatermark() {
1212
+ return this.$$.ctx[5];
1213
+ }
1214
+ set showWatermark(e) {
1215
+ this.$$set({ showWatermark: e }), R();
1216
+ }
1217
+ get play() {
1218
+ return this.$$.ctx[6];
1219
+ }
1220
+ }
1221
+ customElements.define("document-collector", ba);
1222
+ export {
1223
+ ba as default
1224
+ };