UNPKG

bry-biometric-collector

Version:

BRy web-collector component for biometric capture.

213 lines (212 loc) 5.11 kB
import { S as z, x as D, y as M, z as T, B as v, C as g, O as A, E as x, a1 as E, a2 as b, a3 as B, a0 as d, H as C, I as W, by as _, J as F, a8 as O, K as R, aB as k, D as j, G as n, bm as S, X as q, Z as G, _ as I, a4 as J } from "./main_8f1a8854_3.3.6.js"; import { W as K } from "./ValidationAlert_452e8b93_3.3.6.js"; function N(a) { let e, t, o, r = ( /*showWatermark*/ a[1] && H() ); return { c() { e = j("div"), r && r.c(), n(e, "id", "face-oval"), n(e, "class", t = "loader " + /*loading*/ (a[0] ? "loading" : "") + " z-10"), n( e, "style", /*styleVars*/ a[3] ); }, m(l, s) { v(l, e, s), r && r.m(e, null), o = !0; }, p(l, s) { /*showWatermark*/ l[1] ? r ? s & /*showWatermark*/ 2 && d(r, 1) : (r = H(), r.c(), d(r, 1), r.m(e, null)) : r && (E(), b(r, 1, 1, () => { r = null; }), B()), (!o || s & /*loading*/ 1 && t !== (t = "loader " + /*loading*/ (l[0] ? "loading" : "") + " z-10")) && n(e, "class", t), (!o || s & /*styleVars*/ 8) && n( e, "style", /*styleVars*/ l[3] ); }, i(l) { o || (d(r), o = !0); }, o(l) { b(r), o = !1; }, d(l) { l && C(e), r && r.d(); } }; } function P(a) { let e, t; return { c() { e = S("svg"), t = S("ellipse"), n(t, "cx", "50"), n(t, "cy", "50"), n(t, "rx", "35"), n(t, "ry", "48"), n(t, "fill", "transparent"), n(t, "stroke", "currentColor"), n(t, "stroke-width", "3.5"), n(e, "viewBox", "0 0 100 100"), n(e, "width", "100%"), n(e, "height", "100%"), n( e, "class", /*borderColor*/ a[2] ); }, m(o, r) { v(o, e, r), q(e, t); }, p(o, r) { r & /*borderColor*/ 4 && n( e, "class", /*borderColor*/ o[2] ); }, i: x, o: x, d(o) { o && C(e); } }; } function H(a) { let e, t; return e = new K({}), { c() { G(e.$$.fragment); }, m(o, r) { I(e, o, r), t = !0; }, i(o) { t || (d(e.$$.fragment, o), t = !0); }, o(o) { b(e.$$.fragment, o), t = !1; }, d(o) { J(e, o); } }; } function V(a) { let e, t, o, r; const l = [P, N], s = []; function h(i, u) { return ( /*$collectorSelect*/ i[4] === "STREAM" ? 0 : 1 ); } return e = h(a), t = s[e] = l[e](a), { c() { t.c(), o = A(), this.c = x; }, m(i, u) { s[e].m(i, u), v(i, o, u), r = !0; }, p(i, [u]) { let f = e; e = h(i), e === f ? s[e].p(i, u) : (E(), b(s[f], 1, 1, () => { s[f] = null; }), B(), t = s[e], t ? t.p(i, u) : (t = s[e] = l[e](i), t.c()), d(t, 1), t.m(o.parentNode, o)); }, i(i) { r || (d(t), r = !0); }, o(i) { b(t), r = !1; }, d(i) { s[e].d(i), i && C(o); } }; } const X = "hsl(var(--p))", Z = "hsl(var(--su))"; function L(a, e, t) { let o, r, l, s; W(a, _, (c) => t(10, r = c)), W(a, F, (c) => t(11, l = c)), W(a, O, (c) => t(4, s = c)); let { loading: h = !1 } = e, { showWatermark: i = !1 } = e, { borderColor: u = "text-blue-400" } = e, f, m, p = 0.8, w = 8, y = 0.15; return R() && (p = 0.65, w = 10, y = 0.25), a.$$set = (c) => { "loading" in c && t(0, h = c.loading), "showWatermark" in c && t(1, i = c.showWatermark), "borderColor" in c && t(2, u = c.borderColor); }, a.$$.update = () => { if (a.$$.dirty & /*$videoStore, percentage, ovalHeight, ovalWidth, $ovalDimensions, captureBarPercentage*/ 3808 && l) { t(6, m = l.videoHeight * p), t(5, f = m / 1.45), k(_, r.width = f, r), k(_, r.height = m, r), k(_, r.x = (l.videoWidth - r.width) / 2, r); let c = l.videoHeight - l.videoHeight * y; k(_, r.y = c - r.height, r); } a.$$.dirty & /*ovalWidth, ovalHeight, borderWidth*/ 352 && t(3, o = ` --oval-width: ${f}px; --oval-height: ${m}px; --border-color: ${X}; --border-color-animation: ${Z}; --oval-border: ${w}px; `); }, [ h, i, u, o, s, f, m, p, w, y, r, l ]; } class Q extends z { constructor(e) { super(), D( this, { target: this.shadowRoot, props: T(this.attributes), customElement: !0 }, L, V, M, { loading: 0, showWatermark: 1, borderColor: 2 }, null ), e && (e.target && v(e.target, this, e.anchor), e.props && (this.$set(e.props), g())); } static get observedAttributes() { return ["loading", "showWatermark", "borderColor"]; } get loading() { return this.$$.ctx[0]; } set loading(e) { this.$$set({ loading: e }), g(); } get showWatermark() { return this.$$.ctx[1]; } set showWatermark(e) { this.$$set({ showWatermark: e }), g(); } get borderColor() { return this.$$.ctx[2]; } set borderColor(e) { this.$$set({ borderColor: e }), g(); } } customElements.define("face-oval", Q); export { Q as F };