@encatch/web-sdk 0.0.35-beta.1 → 0.0.35-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as Xs, x as ov, k as vh, t as sv, u as Ss } from "./module-
|
|
1
|
+
import { l as Xs, x as ov, k as vh, t as sv, u as Ss } from "./module-uAk9qJKf.js";
|
|
2
2
|
var Bo, Lt, ac, Uu, Go = 0, bh = [], jt = Xs, Zu = jt.__b, qu = jt.__r, Hu = jt.diffed, Bu = jt.__c, Gu = jt.unmount, Wu = jt.__;
|
|
3
3
|
function Ml(e, t) {
|
|
4
4
|
jt.__h && jt.__h(Lt, e, Go || t), Go = 0;
|
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
var
|
|
1
|
+
var O, d, ne, ie, F, X, se, oe, re, V, z, H, I = {}, _e = [], he = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, W = Array.isArray;
|
|
2
2
|
function k(t, e) {
|
|
3
3
|
for (var n in e) t[n] = e[n];
|
|
4
4
|
return t;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function q(t) {
|
|
7
7
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function R(t, e, n) {
|
|
10
10
|
var i, r, s, _ = {};
|
|
11
11
|
for (s in e) s == "key" ? i = e[s] : s == "ref" ? r = e[s] : _[s] = e[s];
|
|
12
|
-
if (arguments.length > 2 && (_.children = arguments.length > 3 ?
|
|
13
|
-
return
|
|
12
|
+
if (arguments.length > 2 && (_.children = arguments.length > 3 ? O.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) _[s] === void 0 && (_[s] = t.defaultProps[s]);
|
|
13
|
+
return A(t, _, i, r, null);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
var s = { type: t, props: e, key: n, ref: i, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: r ?? ++
|
|
17
|
-
return r == null &&
|
|
15
|
+
function A(t, e, n, i, r) {
|
|
16
|
+
var s = { type: t, props: e, key: n, ref: i, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: r ?? ++ne, __i: -1, __u: 0 };
|
|
17
|
+
return r == null && d.vnode != null && d.vnode(s), s;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function L(t) {
|
|
20
20
|
return t.children;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function D(t, e) {
|
|
23
23
|
this.props = t, this.context = e;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
if (e == null) return t.__ ?
|
|
25
|
+
function C(t, e) {
|
|
26
|
+
if (e == null) return t.__ ? C(t.__, t.__i + 1) : null;
|
|
27
27
|
for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
|
|
28
|
-
return typeof t.type == "function" ?
|
|
28
|
+
return typeof t.type == "function" ? C(t) : null;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function ce(t) {
|
|
31
31
|
var e, n;
|
|
32
32
|
if ((t = t.__) != null && t.__c != null) {
|
|
33
33
|
for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
|
|
34
34
|
t.__e = t.__c.base = n.__e;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return ce(t);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
(!t.__d && (t.__d = !0) && F.push(t) && !
|
|
40
|
+
function Y(t) {
|
|
41
|
+
(!t.__d && (t.__d = !0) && F.push(t) && !N.__r++ || X != d.debounceRendering) && ((X = d.debounceRendering) || se)(N);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
for (var t, e, n, i, r, s, _,
|
|
45
|
-
|
|
43
|
+
function N() {
|
|
44
|
+
for (var t, e, n, i, r, s, _, l = 1; F.length; ) F.length > l && F.sort(oe), t = F.shift(), l = F.length, t.__d && (n = void 0, i = void 0, r = (i = (e = t).__v).__e, s = [], _ = [], e.__P && ((n = k({}, i)).__v = i.__v + 1, d.vnode && d.vnode(n), G(e.__P, n, i, e.__n, e.__P.namespaceURI, 32 & i.__u ? [r] : null, s, r ?? C(i), !!(32 & i.__u), _), n.__v = i.__v, n.__.__k[n.__i] = n, ue(s, n, _), i.__e = i.__ = null, n.__e != r && ce(n)));
|
|
45
|
+
N.__r = 0;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
var o, m,
|
|
49
|
-
for (
|
|
50
|
-
return n.__e =
|
|
47
|
+
function le(t, e, n, i, r, s, _, l, u, c, f) {
|
|
48
|
+
var o, m, a, g, v, y, h, p = i && i.__k || _e, S = e.length;
|
|
49
|
+
for (u = pe(n, e, p, u, S), o = 0; o < S; o++) (a = n.__k[o]) != null && (m = a.__i == -1 ? I : p[a.__i] || I, a.__i = o, y = G(t, a, m, r, s, _, l, u, c, f), g = a.__e, a.ref && m.ref != a.ref && (m.ref && J(m.ref, null, a), f.push(a.ref, a.__c || g, a)), v == null && g != null && (v = g), (h = !!(4 & a.__u)) || m.__k === a.__k ? u = ae(a, u, t, h) : typeof a.type == "function" && y !== void 0 ? u = y : g && (u = g.nextSibling), a.__u &= -7);
|
|
50
|
+
return n.__e = v, u;
|
|
51
51
|
}
|
|
52
52
|
function pe(t, e, n, i, r) {
|
|
53
|
-
var s, _,
|
|
54
|
-
for (t.__k = new Array(r), s = 0; s < r; s++) (_ = e[s]) != null && typeof _ != "boolean" && typeof _ != "function" ? (
|
|
55
|
-
if (o) for (s = 0; s <
|
|
53
|
+
var s, _, l, u, c, f = n.length, o = f, m = 0;
|
|
54
|
+
for (t.__k = new Array(r), s = 0; s < r; s++) (_ = e[s]) != null && typeof _ != "boolean" && typeof _ != "function" ? (u = s + m, (_ = t.__k[s] = typeof _ == "string" || typeof _ == "number" || typeof _ == "bigint" || _.constructor == String ? A(null, _, null, null, null) : W(_) ? A(L, { children: _ }, null, null, null) : _.constructor == null && _.__b > 0 ? A(_.type, _.props, _.key, _.ref ? _.ref : null, _.__v) : _).__ = t, _.__b = t.__b + 1, l = null, (c = _.__i = me(_, n, u, o)) != -1 && (o--, (l = n[c]) && (l.__u |= 2)), l == null || l.__v == null ? (c == -1 && (r > f ? m-- : r < f && m++), typeof _.type != "function" && (_.__u |= 4)) : c != u && (c == u - 1 ? m-- : c == u + 1 ? m++ : (c > u ? m-- : m++, _.__u |= 4))) : t.__k[s] = null;
|
|
55
|
+
if (o) for (s = 0; s < f; s++) (l = n[s]) != null && (2 & l.__u) == 0 && (l.__e == i && (i = C(l)), de(l, l));
|
|
56
56
|
return i;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function ae(t, e, n, i) {
|
|
59
59
|
var r, s;
|
|
60
60
|
if (typeof t.type == "function") {
|
|
61
|
-
for (r = t.__k, s = 0; r && s < r.length; s++) r[s] && (r[s].__ = t, e =
|
|
61
|
+
for (r = t.__k, s = 0; r && s < r.length; s++) r[s] && (r[s].__ = t, e = ae(r[s], e, n, i));
|
|
62
62
|
return e;
|
|
63
63
|
}
|
|
64
|
-
t.__e != e && (i && (e && t.type && !e.parentNode && (e =
|
|
64
|
+
t.__e != e && (i && (e && t.type && !e.parentNode && (e = C(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
|
|
65
65
|
do
|
|
66
66
|
e = e && e.nextSibling;
|
|
67
67
|
while (e != null && e.nodeType == 8);
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
70
|
function me(t, e, n, i) {
|
|
71
|
-
var r, s, _,
|
|
72
|
-
if (c === null && t.key == null ||
|
|
73
|
-
if (i > (
|
|
74
|
-
for (r = n - 1, s = n + 1; r >= 0 || s < e.length; ) if ((c = e[_ = r >= 0 ? r-- : s++]) != null && (2 & c.__u) == 0 &&
|
|
71
|
+
var r, s, _, l = t.key, u = t.type, c = e[n], f = c != null && (2 & c.__u) == 0;
|
|
72
|
+
if (c === null && t.key == null || f && l == c.key && u == c.type) return n;
|
|
73
|
+
if (i > (f ? 1 : 0)) {
|
|
74
|
+
for (r = n - 1, s = n + 1; r >= 0 || s < e.length; ) if ((c = e[_ = r >= 0 ? r-- : s++]) != null && (2 & c.__u) == 0 && l == c.key && u == c.type) return _;
|
|
75
75
|
}
|
|
76
76
|
return -1;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" ||
|
|
78
|
+
function Z(t, e, n) {
|
|
79
|
+
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || he.test(e) ? n : n + "px";
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function B(t, e, n, i, r) {
|
|
82
82
|
var s, _;
|
|
83
83
|
e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
|
|
84
84
|
else {
|
|
85
|
-
if (typeof i == "string" && (t.style.cssText = i = ""), i) for (e in i) n && e in n ||
|
|
86
|
-
if (n) for (e in n) i && n[e] == i[e] ||
|
|
85
|
+
if (typeof i == "string" && (t.style.cssText = i = ""), i) for (e in i) n && e in n || Z(t.style, e, "");
|
|
86
|
+
if (n) for (e in n) i && n[e] == i[e] || Z(t.style, e, n[e]);
|
|
87
87
|
}
|
|
88
|
-
else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(
|
|
88
|
+
else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(re, "$1")), _ = e.toLowerCase(), e = _ in t || e == "onFocusOut" || e == "onFocusIn" ? _.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = n, n ? i ? n.u = i.u : (n.u = V, t.addEventListener(e, s ? H : z, s)) : t.removeEventListener(e, s ? H : z, s);
|
|
89
89
|
else {
|
|
90
90
|
if (r == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
91
91
|
else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
|
|
@@ -96,159 +96,173 @@ function U(t, e, n, i, r) {
|
|
|
96
96
|
typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function ee(t) {
|
|
100
100
|
return function(e) {
|
|
101
101
|
if (this.l) {
|
|
102
102
|
var n = this.l[e.type + t];
|
|
103
|
-
if (e.t == null) e.t =
|
|
103
|
+
if (e.t == null) e.t = V++;
|
|
104
104
|
else if (e.t < n.u) return;
|
|
105
|
-
return n(
|
|
105
|
+
return n(d.event ? d.event(e) : e);
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
var
|
|
109
|
+
function G(t, e, n, i, r, s, _, l, u, c) {
|
|
110
|
+
var f, o, m, a, g, v, y, h, p, S, w, U, x, Q, T, M, j, b = e.type;
|
|
111
111
|
if (e.constructor != null) return null;
|
|
112
|
-
128 & n.__u && (
|
|
112
|
+
128 & n.__u && (u = !!(32 & n.__u), s = [l = e.__e = n.__e]), (f = d.__b) && f(e);
|
|
113
113
|
e: if (typeof b == "function") try {
|
|
114
|
-
if (
|
|
114
|
+
if (h = e.props, p = "prototype" in b && b.prototype.render, S = (f = b.contextType) && i[f.__c], w = f ? S ? S.props.value : f.__ : i, n.__c ? y = (o = e.__c = n.__c).__ = o.__E : (p ? e.__c = o = new b(h, w) : (e.__c = o = new D(h, w), o.constructor = b, o.render = ye), S && S.sub(o), o.props = h, o.state || (o.state = {}), o.context = w, o.__n = i, m = o.__d = !0, o.__h = [], o._sb = []), p && o.__s == null && (o.__s = o.state), p && b.getDerivedStateFromProps != null && (o.__s == o.state && (o.__s = k({}, o.__s)), k(o.__s, b.getDerivedStateFromProps(h, o.__s))), a = o.props, g = o.state, o.__v = e, m) p && b.getDerivedStateFromProps == null && o.componentWillMount != null && o.componentWillMount(), p && o.componentDidMount != null && o.__h.push(o.componentDidMount);
|
|
115
115
|
else {
|
|
116
|
-
if (
|
|
117
|
-
for (e.__v != n.__v && (o.props =
|
|
118
|
-
|
|
119
|
-
}),
|
|
116
|
+
if (p && b.getDerivedStateFromProps == null && h !== a && o.componentWillReceiveProps != null && o.componentWillReceiveProps(h, w), !o.__e && o.shouldComponentUpdate != null && o.shouldComponentUpdate(h, o.__s, w) === !1 || e.__v == n.__v) {
|
|
117
|
+
for (e.__v != n.__v && (o.props = h, o.state = o.__s, o.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(P) {
|
|
118
|
+
P && (P.__ = e);
|
|
119
|
+
}), U = 0; U < o._sb.length; U++) o.__h.push(o._sb[U]);
|
|
120
120
|
o._sb = [], o.__h.length && _.push(o);
|
|
121
121
|
break e;
|
|
122
122
|
}
|
|
123
|
-
o.componentWillUpdate != null && o.componentWillUpdate(
|
|
124
|
-
o.componentDidUpdate(
|
|
123
|
+
o.componentWillUpdate != null && o.componentWillUpdate(h, o.__s, w), p && o.componentDidUpdate != null && o.__h.push(function() {
|
|
124
|
+
o.componentDidUpdate(a, g, v);
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
if (o.context = w, o.props =
|
|
128
|
-
for (o.state = o.__s, o.__d = !1, x && x(e),
|
|
127
|
+
if (o.context = w, o.props = h, o.__P = t, o.__e = !1, x = d.__r, Q = 0, p) {
|
|
128
|
+
for (o.state = o.__s, o.__d = !1, x && x(e), f = o.render(o.props, o.state, o.context), T = 0; T < o._sb.length; T++) o.__h.push(o._sb[T]);
|
|
129
129
|
o._sb = [];
|
|
130
130
|
} else do
|
|
131
|
-
o.__d = !1, x && x(e),
|
|
132
|
-
while (o.__d && ++
|
|
133
|
-
o.state = o.__s, o.getChildContext != null && (i = k(k({}, i), o.getChildContext())),
|
|
134
|
-
} catch (
|
|
135
|
-
if (e.__v = null,
|
|
136
|
-
for (e.__u |=
|
|
137
|
-
s[s.indexOf(
|
|
131
|
+
o.__d = !1, x && x(e), f = o.render(o.props, o.state, o.context), o.state = o.__s;
|
|
132
|
+
while (o.__d && ++Q < 25);
|
|
133
|
+
o.state = o.__s, o.getChildContext != null && (i = k(k({}, i), o.getChildContext())), p && !m && o.getSnapshotBeforeUpdate != null && (v = o.getSnapshotBeforeUpdate(a, g)), M = f, f != null && f.type === L && f.key == null && (M = fe(f.props.children)), l = le(t, W(M) ? M : [M], e, n, i, r, s, _, l, u, c), o.base = e.__e, e.__u &= -161, o.__h.length && _.push(o), y && (o.__E = o.__ = null);
|
|
134
|
+
} catch (P) {
|
|
135
|
+
if (e.__v = null, u || s != null) if (P.then) {
|
|
136
|
+
for (e.__u |= u ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
137
|
+
s[s.indexOf(l)] = null, e.__e = l;
|
|
138
138
|
} else {
|
|
139
|
-
for (
|
|
140
|
-
|
|
139
|
+
for (j = s.length; j--; ) q(s[j]);
|
|
140
|
+
K(e);
|
|
141
141
|
}
|
|
142
|
-
else e.__e = n.__e, e.__k = n.__k,
|
|
143
|
-
|
|
142
|
+
else e.__e = n.__e, e.__k = n.__k, P.then || K(e);
|
|
143
|
+
d.__e(P, e, n);
|
|
144
144
|
}
|
|
145
|
-
else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) :
|
|
146
|
-
return (
|
|
145
|
+
else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = ge(n.__e, e, n, i, r, s, _, u, c);
|
|
146
|
+
return (f = d.diffed) && f(e), 128 & e.__u ? void 0 : l;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(
|
|
148
|
+
function K(t) {
|
|
149
|
+
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(K);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
for (var i = 0; i < n.length; i++)
|
|
153
|
-
|
|
151
|
+
function ue(t, e, n) {
|
|
152
|
+
for (var i = 0; i < n.length; i++) J(n[i], n[++i], n[++i]);
|
|
153
|
+
d.__c && d.__c(e, t), t.some(function(r) {
|
|
154
154
|
try {
|
|
155
155
|
t = r.__h, r.__h = [], t.some(function(s) {
|
|
156
156
|
s.call(r);
|
|
157
157
|
});
|
|
158
158
|
} catch (s) {
|
|
159
|
-
|
|
159
|
+
d.__e(s, r.__v);
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : W(t) ? t.map(
|
|
163
|
+
function fe(t) {
|
|
164
|
+
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : W(t) ? t.map(fe) : k({}, t);
|
|
165
165
|
}
|
|
166
|
-
function ge(t, e, n, i, r, s, _,
|
|
167
|
-
var c,
|
|
168
|
-
if (
|
|
169
|
-
for (c = 0; c < s.length; c++) if ((
|
|
170
|
-
t =
|
|
166
|
+
function ge(t, e, n, i, r, s, _, l, u) {
|
|
167
|
+
var c, f, o, m, a, g, v, y = n.props, h = e.props, p = e.type;
|
|
168
|
+
if (p == "svg" ? r = "http://www.w3.org/2000/svg" : p == "math" ? r = "http://www.w3.org/1998/Math/MathML" : r || (r = "http://www.w3.org/1999/xhtml"), s != null) {
|
|
169
|
+
for (c = 0; c < s.length; c++) if ((a = s[c]) && "setAttribute" in a == !!p && (p ? a.localName == p : a.nodeType == 3)) {
|
|
170
|
+
t = a, s[c] = null;
|
|
171
171
|
break;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
if (t == null) {
|
|
175
|
-
if (
|
|
176
|
-
t = document.createElementNS(r,
|
|
175
|
+
if (p == null) return document.createTextNode(h);
|
|
176
|
+
t = document.createElementNS(r, p, h.is && h), l && (d.__m && d.__m(e, s), l = !1), s = null;
|
|
177
177
|
}
|
|
178
|
-
if (
|
|
178
|
+
if (p == null) y === h || l && t.data == h || (t.data = h);
|
|
179
179
|
else {
|
|
180
|
-
if (s = s &&
|
|
181
|
-
for (c in
|
|
182
|
-
if (c == "dangerouslySetInnerHTML") o =
|
|
183
|
-
else if (!(c in
|
|
184
|
-
if (c == "value" && "defaultValue" in
|
|
185
|
-
|
|
180
|
+
if (s = s && O.call(t.childNodes), y = n.props || I, !l && s != null) for (y = {}, c = 0; c < t.attributes.length; c++) y[(a = t.attributes[c]).name] = a.value;
|
|
181
|
+
for (c in y) if (a = y[c], c != "children") {
|
|
182
|
+
if (c == "dangerouslySetInnerHTML") o = a;
|
|
183
|
+
else if (!(c in h)) {
|
|
184
|
+
if (c == "value" && "defaultValue" in h || c == "checked" && "defaultChecked" in h) continue;
|
|
185
|
+
B(t, c, null, a, r);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
for (c in
|
|
189
|
-
if (
|
|
190
|
-
else if (o && (t.innerHTML = ""),
|
|
191
|
-
|
|
188
|
+
for (c in h) a = h[c], c == "children" ? m = a : c == "dangerouslySetInnerHTML" ? f = a : c == "value" ? g = a : c == "checked" ? v = a : l && typeof a != "function" || y[c] === a || B(t, c, a, y[c], r);
|
|
189
|
+
if (f) l || o && (f.__html == o.__html || f.__html == t.innerHTML) || (t.innerHTML = f.__html), e.__k = [];
|
|
190
|
+
else if (o && (t.innerHTML = ""), le(e.type == "template" ? t.content : t, W(m) ? m : [m], e, n, i, p == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, s, _, s ? s[0] : n.__k && C(n, 0), l, u), s != null) for (c = s.length; c--; ) q(s[c]);
|
|
191
|
+
l || (c = "value", p == "progress" && g == null ? t.removeAttribute("value") : g != null && (g !== t[c] || p == "progress" && !g || p == "option" && g != y[c]) && B(t, c, g, y[c], r), c = "checked", v != null && v != t[c] && B(t, c, v, y[c], r));
|
|
192
192
|
}
|
|
193
193
|
return t;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function J(t, e, n) {
|
|
196
196
|
try {
|
|
197
197
|
if (typeof t == "function") {
|
|
198
198
|
var i = typeof t.__u == "function";
|
|
199
199
|
i && t.__u(), i && e == null || (t.__u = t(e));
|
|
200
200
|
} else t.current = e;
|
|
201
201
|
} catch (r) {
|
|
202
|
-
|
|
202
|
+
d.__e(r, n);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function de(t, e, n) {
|
|
206
206
|
var i, r;
|
|
207
|
-
if (
|
|
207
|
+
if (d.unmount && d.unmount(t), (i = t.ref) && (i.current && i.current != t.__e || J(i, null, e)), (i = t.__c) != null) {
|
|
208
208
|
if (i.componentWillUnmount) try {
|
|
209
209
|
i.componentWillUnmount();
|
|
210
210
|
} catch (s) {
|
|
211
|
-
|
|
211
|
+
d.__e(s, e);
|
|
212
212
|
}
|
|
213
213
|
i.base = i.__P = null;
|
|
214
214
|
}
|
|
215
|
-
if (i = t.__k) for (r = 0; r < i.length; r++) i[r] &&
|
|
216
|
-
n ||
|
|
215
|
+
if (i = t.__k) for (r = 0; r < i.length; r++) i[r] && de(i[r], e, n || typeof t.type != "function");
|
|
216
|
+
n || q(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function ye(t, e, n) {
|
|
219
219
|
return this.constructor(t, n);
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function ve(t, e, n) {
|
|
222
222
|
var i, r, s, _;
|
|
223
|
-
e == document && (e = document.documentElement),
|
|
223
|
+
e == document && (e = document.documentElement), d.__ && d.__(t, e), r = (i = typeof n == "function") ? null : n && n.__k || e.__k, s = [], _ = [], G(e, t = (!i && n || e).__k = R(L, null, [t]), r || I, I, e.namespaceURI, !i && n ? [n] : r ? null : e.firstChild ? O.call(e.childNodes) : null, s, !i && n ? n : r ? r.__e : e.firstChild, i, _), ue(s, t, _);
|
|
224
224
|
}
|
|
225
|
-
|
|
225
|
+
O = _e.slice, d = { __e: function(t, e, n, i) {
|
|
226
226
|
for (var r, s, _; e = e.__; ) if ((r = e.__c) && !r.__) try {
|
|
227
227
|
if ((s = r.constructor) && s.getDerivedStateFromError != null && (r.setState(s.getDerivedStateFromError(t)), _ = r.__d), r.componentDidCatch != null && (r.componentDidCatch(t, i || {}), _ = r.__d), _) return r.__E = r;
|
|
228
|
-
} catch (
|
|
229
|
-
t =
|
|
228
|
+
} catch (l) {
|
|
229
|
+
t = l;
|
|
230
230
|
}
|
|
231
231
|
throw t;
|
|
232
|
-
} },
|
|
232
|
+
} }, ne = 0, ie = function(t) {
|
|
233
233
|
return t != null && t.constructor == null;
|
|
234
|
-
},
|
|
234
|
+
}, D.prototype.setState = function(t, e) {
|
|
235
235
|
var n;
|
|
236
|
-
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = k({}, this.state), typeof t == "function" && (t = t(k({}, n), this.props)), t && k(n, t), t != null && this.__v && (e && this._sb.push(e),
|
|
237
|
-
},
|
|
238
|
-
this.__v && (this.__e = !0, t && this.__h.push(t),
|
|
239
|
-
},
|
|
236
|
+
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = k({}, this.state), typeof t == "function" && (t = t(k({}, n), this.props)), t && k(n, t), t != null && this.__v && (e && this._sb.push(e), Y(this));
|
|
237
|
+
}, D.prototype.forceUpdate = function(t) {
|
|
238
|
+
this.__v && (this.__e = !0, t && this.__h.push(t), Y(this));
|
|
239
|
+
}, D.prototype.render = L, F = [], se = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, oe = function(t, e) {
|
|
240
240
|
return t.__v.__b - e.__v.__b;
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
}, N.__r = 0, re = /(PointerCapture)$|Capture$/i, V = 0, z = ee(!1), H = ee(!0);
|
|
242
|
+
const be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
243
|
+
__proto__: null,
|
|
244
|
+
Component: D,
|
|
245
|
+
Fragment: L,
|
|
246
|
+
createElement: R,
|
|
247
|
+
h: R,
|
|
248
|
+
get isValidElement() {
|
|
249
|
+
return ie;
|
|
250
|
+
},
|
|
251
|
+
get options() {
|
|
252
|
+
return d;
|
|
253
|
+
},
|
|
254
|
+
render: ve
|
|
255
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
256
|
+
var ke = 0;
|
|
257
|
+
function Se(t, e, n, i, r, s) {
|
|
244
258
|
e || (e = {});
|
|
245
|
-
var _,
|
|
246
|
-
if ("ref" in
|
|
247
|
-
var c = { type: t, props:
|
|
248
|
-
if (typeof t == "function" && (_ = t.defaultProps)) for (
|
|
249
|
-
return
|
|
259
|
+
var _, l, u = e;
|
|
260
|
+
if ("ref" in u) for (l in u = {}, e) l == "ref" ? _ = e[l] : u[l] = e[l];
|
|
261
|
+
var c = { type: t, props: u, key: n, ref: _, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --ke, __i: -1, __u: 0, __source: r, __self: s };
|
|
262
|
+
if (typeof t == "function" && (_ = t.defaultProps)) for (l in _) u[l] === void 0 && (u[l] = _[l]);
|
|
263
|
+
return d.vnode && d.vnode(c), c;
|
|
250
264
|
}
|
|
251
|
-
function
|
|
265
|
+
function we() {
|
|
252
266
|
const t = {
|
|
253
267
|
_i: [],
|
|
254
268
|
apiKey: "",
|
|
@@ -268,10 +282,10 @@ function Se() {
|
|
|
268
282
|
r && !r.startsWith("/") && (r = "/" + r), r = r.replace(/\/+$/, "");
|
|
269
283
|
const s = `${t.config.host}${r}/encatch-web-sdk.js`, _ = document.createElement("script");
|
|
270
284
|
_.src = s, _.type = "module", _.async = !0;
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
|
|
285
|
+
const l = document.head.firstChild;
|
|
286
|
+
l ? document.head.insertBefore(_, l) : document.head.appendChild(_);
|
|
287
|
+
const u = document.createElement("div");
|
|
288
|
+
u.id = "enisght-root", document.body.appendChild(u);
|
|
275
289
|
}
|
|
276
290
|
}
|
|
277
291
|
}, e = [
|
|
@@ -300,24 +314,24 @@ function Se() {
|
|
|
300
314
|
});
|
|
301
315
|
}), t;
|
|
302
316
|
}
|
|
303
|
-
let
|
|
304
|
-
async function
|
|
305
|
-
if (!(
|
|
306
|
-
|
|
317
|
+
let te = !1;
|
|
318
|
+
async function Ee() {
|
|
319
|
+
if (!(te || typeof window > "u" || typeof document > "u")) {
|
|
320
|
+
te = !0;
|
|
307
321
|
try {
|
|
308
|
-
const t = (await import("./core-wrapper-
|
|
322
|
+
const { render: t } = await Promise.resolve().then(() => be), e = (await import("./core-wrapper-t4w56N6H.js")).default;
|
|
309
323
|
if (typeof document > "u") return;
|
|
310
|
-
let
|
|
311
|
-
!
|
|
324
|
+
let n = document.getElementById("enisght-root");
|
|
325
|
+
!n && document.body && (n = document.createElement("div"), n.id = "enisght-root", document.body.appendChild(n)), n && t(/* @__PURE__ */ Se(e, {}), n);
|
|
312
326
|
} catch (t) {
|
|
313
327
|
console.error("Failed to load Encatch core:", t);
|
|
314
328
|
}
|
|
315
329
|
}
|
|
316
330
|
}
|
|
317
331
|
let E = null;
|
|
318
|
-
class
|
|
332
|
+
class $ {
|
|
319
333
|
constructor() {
|
|
320
|
-
if (this.instance =
|
|
334
|
+
if (this.instance = we(), typeof window < "u" && (window.encatch || (window.encatch = this.instance)), typeof window < "u" && typeof document < "u" && !document.getElementById("enisght-root")) {
|
|
321
335
|
const e = document.createElement("div");
|
|
322
336
|
e.id = "enisght-root", document.body ? document.body.appendChild(e) : document.readyState === "loading" && document.addEventListener("DOMContentLoaded", () => {
|
|
323
337
|
!document.getElementById("enisght-root") && document.body && document.body.appendChild(e);
|
|
@@ -329,13 +343,13 @@ class N {
|
|
|
329
343
|
* This provides a convenient API: Encatch.init(apiKey, options)
|
|
330
344
|
*/
|
|
331
345
|
static init(e, n) {
|
|
332
|
-
return E || (E = new
|
|
346
|
+
return E || (E = new $()), E.init(e, n), E;
|
|
333
347
|
}
|
|
334
348
|
/**
|
|
335
349
|
* Get the default singleton instance
|
|
336
350
|
*/
|
|
337
351
|
static getInstance() {
|
|
338
|
-
return E || (E = new
|
|
352
|
+
return E || (E = new $()), E;
|
|
339
353
|
}
|
|
340
354
|
/**
|
|
341
355
|
* Initialize the Encatch SDK
|
|
@@ -346,7 +360,7 @@ class N {
|
|
|
346
360
|
this.instance.apiKey = e, n && Object.assign(this.instance.config, n);
|
|
347
361
|
return;
|
|
348
362
|
}
|
|
349
|
-
this.instance.initialized || (this.instance.apiKey = e, this.instance.config.host = n?.host || "https://app.encatch.com", n?.autoStartSessionDisabled !== void 0 && (this.instance.config.autoStartSessionDisabled = n.autoStartSessionDisabled), n?.processAfterIdentitySet !== void 0 ? this.instance.config.processAfterIdentitySet = n.processAfterIdentitySet : this.instance.config.processAfterIdentitySet = !1, n?.autoStartEnabled !== void 0 && (this.instance.config.autoStartEnabled = n.autoStartEnabled), n?.themeMode ? this.instance.config.themeMode = n.themeMode : this.instance.config.themeMode = "light", n?.language ? this.instance.config.language = n.language : this.instance.config.language = "en", n?.customCssLink && (this.instance.config.customCssLink = n.customCssLink), n?.setUser && (this.instance.config.setUser = n.setUser), n?.onFormEvent && (this.instance.config.onFormEvent = n.onFormEvent), n?.customProperties && (this.instance.config.customProperties = n.customProperties), n?.onSessionDisabled && (this.instance.config.onSessionDisabled = n.onSessionDisabled), this.instance.initialized = !0, typeof window < "u" && (window.encatch = this.instance),
|
|
363
|
+
this.instance.initialized || (this.instance.apiKey = e, this.instance.config.host = n?.host || "https://app.encatch.com", n?.autoStartSessionDisabled !== void 0 && (this.instance.config.autoStartSessionDisabled = n.autoStartSessionDisabled), n?.processAfterIdentitySet !== void 0 ? this.instance.config.processAfterIdentitySet = n.processAfterIdentitySet : this.instance.config.processAfterIdentitySet = !1, n?.autoStartEnabled !== void 0 && (this.instance.config.autoStartEnabled = n.autoStartEnabled), n?.themeMode ? this.instance.config.themeMode = n.themeMode : this.instance.config.themeMode = "light", n?.language ? this.instance.config.language = n.language : this.instance.config.language = "en", n?.customCssLink && (this.instance.config.customCssLink = n.customCssLink), n?.setUser && (this.instance.config.setUser = n.setUser), n?.onFormEvent && (this.instance.config.onFormEvent = n.onFormEvent), n?.customProperties && (this.instance.config.customProperties = n.customProperties), n?.onSessionDisabled && (this.instance.config.onSessionDisabled = n.onSessionDisabled), this.instance.initialized = !0, typeof window < "u" && (window.encatch = this.instance), Ee());
|
|
350
364
|
}
|
|
351
365
|
/**
|
|
352
366
|
* Track a custom event
|
|
@@ -469,13 +483,13 @@ class N {
|
|
|
469
483
|
return this.instance;
|
|
470
484
|
}
|
|
471
485
|
}
|
|
472
|
-
const
|
|
486
|
+
const Fe = typeof window < "u" ? new $() : null;
|
|
473
487
|
export {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
488
|
+
$ as E,
|
|
489
|
+
Fe as e,
|
|
490
|
+
L as k,
|
|
491
|
+
d as l,
|
|
492
|
+
ie as t,
|
|
493
|
+
Se as u,
|
|
494
|
+
D as x
|
|
481
495
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@encatch/web-sdk",
|
|
3
|
-
"version": "0.0.35-beta.
|
|
3
|
+
"version": "0.0.35-beta.3",
|
|
4
4
|
"description": "A powerful, lightweight JavaScript SDK for collecting user feedback and running surveys on web applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist-sdk/plugin/sdk/module.js",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"preact": "^10.27.2",
|
|
50
50
|
"preact-iso": "^2.11.0",
|
|
51
51
|
"ua-parser-js": "^2.0.6",
|
|
52
|
-
"@encatch/
|
|
53
|
-
"@encatch/
|
|
54
|
-
"@encatch/
|
|
52
|
+
"@encatch/api-sdk": "0.0.11-beta.2",
|
|
53
|
+
"@encatch/schema": "0.1.38-beta.4",
|
|
54
|
+
"@encatch/event-publisher": "0.0.2-beta.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@preact/preset-vite": "^2.10.2",
|
package/src/module.tsx
CHANGED
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|
import { createEncatchInstance } from "./encatch-instance";
|
|
17
17
|
import { EncatchConfig, FormEventType, FormEventPayload } from "./@types/encatch-type";
|
|
18
|
-
// Import render statically to avoid dynamic/static import conflict with preact
|
|
19
|
-
import { render } from "preact";
|
|
20
18
|
|
|
21
19
|
let coreLoaded = false;
|
|
22
20
|
|
|
@@ -30,7 +28,8 @@ async function loadCore() {
|
|
|
30
28
|
coreLoaded = true;
|
|
31
29
|
|
|
32
30
|
try {
|
|
33
|
-
// Dynamically import the core wrapper
|
|
31
|
+
// Dynamically import and render the core wrapper
|
|
32
|
+
const { render } = await import("preact");
|
|
34
33
|
const CoreWrapper = (await import("./core-wrapper")).default;
|
|
35
34
|
|
|
36
35
|
// Ensure root exists (SSR-safe)
|