@evelan/jexity-widget 0.9.0 → 0.10.2-canary.20
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.
- package/dist/index.mjs +1134 -922
- package/dist/index.mjs.map +1 -1
- package/dist/react.mjs +1149 -943
- package/dist/react.mjs.map +1 -1
- package/dist/types/features/chat/components/BotMessage.d.ts.map +1 -1
- package/dist/types/features/chat/components/ChatScreen.d.ts +2 -1
- package/dist/types/features/chat/components/ChatScreen.d.ts.map +1 -1
- package/dist/types/features/chat/components/MessageList.d.ts.map +1 -1
- package/dist/types/features/chat/components/SourcesRow.d.ts +18 -0
- package/dist/types/features/chat/components/SourcesRow.d.ts.map +1 -0
- package/dist/types/features/chat/composer.state.d.ts +17 -0
- package/dist/types/features/chat/composer.state.d.ts.map +1 -0
- package/dist/types/features/chat/hooks/useConvexSession.d.ts +1 -1
- package/dist/types/features/chat/hooks/useConvexSession.d.ts.map +1 -1
- package/dist/types/lib/widget-config.d.ts +1 -1
- package/dist/types/lib/widget-config.d.ts.map +1 -1
- package/dist/types/lib/widgetBootstrap.d.ts +19 -0
- package/dist/types/lib/widgetBootstrap.d.ts.map +1 -0
- package/dist/types/module/screens/ScreenRouter.d.ts +2 -1
- package/dist/types/module/screens/ScreenRouter.d.ts.map +1 -1
- package/dist/types/module/shell/WidgetShell.d.ts.map +1 -1
- package/dist/types/module/shell/hooks/useBootstrap.d.ts +10 -0
- package/dist/types/module/shell/hooks/useBootstrap.d.ts.map +1 -0
- package/dist/types/module/shell/hooks/useRemoteConfig.d.ts +1 -1
- package/dist/types/module/shell/hooks/useRemoteConfig.d.ts.map +1 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/widget.js +26 -25
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
var Ze, m,
|
|
2
|
-
function
|
|
1
|
+
var Ze, m, wr, Sr, le, An, jr, Cr, Tr, sn, Bt, Ft, Rr, Ve = {}, $r = [], zi = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Xe = Array.isArray;
|
|
2
|
+
function Y(t, e) {
|
|
3
3
|
for (var n in e) t[n] = e[n];
|
|
4
4
|
return t;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function on(t) {
|
|
7
7
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function O(t, e, n) {
|
|
10
10
|
var r, i, s, o = {};
|
|
11
11
|
for (s in e) s == "key" ? r = e[s] : s == "ref" ? i = e[s] : o[s] = e[s];
|
|
12
12
|
if (arguments.length > 2 && (o.children = arguments.length > 3 ? Ze.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) o[s] === void 0 && (o[s] = t.defaultProps[s]);
|
|
13
13
|
return Be(t, o, r, i, null);
|
|
14
14
|
}
|
|
15
15
|
function Be(t, e, n, r, i) {
|
|
16
|
-
var s = { type: t, props: e, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++
|
|
16
|
+
var s = { type: t, props: e, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++wr, __i: -1, __u: 0 };
|
|
17
17
|
return i == null && m.vnode != null && m.vnode(s), s;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Qi() {
|
|
20
20
|
return { current: null };
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function N(t) {
|
|
23
23
|
return t.children;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function D(t, e) {
|
|
26
26
|
this.props = t, this.context = e;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
if (e == null) return t.__ ?
|
|
28
|
+
function Se(t, e) {
|
|
29
|
+
if (e == null) return t.__ ? Se(t.__, t.__i + 1) : null;
|
|
30
30
|
for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
|
|
31
|
-
return typeof t.type == "function" ?
|
|
31
|
+
return typeof t.type == "function" ? Se(t) : null;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function Ar(t) {
|
|
34
34
|
var e, n;
|
|
35
35
|
if ((t = t.__) != null && t.__c != null) {
|
|
36
36
|
for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
|
|
37
37
|
t.__e = t.__c.base = n.__e;
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return Ar(t);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
(!t.__d && (t.__d = !0) && le.push(t) && !ht.__r++ ||
|
|
43
|
+
function Dt(t) {
|
|
44
|
+
(!t.__d && (t.__d = !0) && le.push(t) && !ht.__r++ || An != m.debounceRendering) && ((An = m.debounceRendering) || jr)(ht);
|
|
45
45
|
}
|
|
46
46
|
function ht() {
|
|
47
|
-
for (var t, e, n, r, i, s, o, l = 1; le.length; ) le.length > l && le.sort(
|
|
47
|
+
for (var t, e, n, r, i, s, o, l = 1; le.length; ) le.length > l && le.sort(Cr), t = le.shift(), l = le.length, t.__d && (n = void 0, r = void 0, i = (r = (e = t).__v).__e, s = [], o = [], e.__P && ((n = Y({}, r)).__v = r.__v + 1, m.vnode && m.vnode(n), an(e.__P, n, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [i] : null, s, i ?? Se(r), !!(32 & r.__u), o), n.__v = r.__v, n.__.__k[n.__i] = n, Pr(s, n, o), r.__e = r.__ = null, n.__e != i && Ar(n)));
|
|
48
48
|
ht.__r = 0;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
var c, p, f, g,
|
|
52
|
-
for (a =
|
|
53
|
-
return n.__e =
|
|
50
|
+
function Ir(t, e, n, r, i, s, o, l, a, u, d) {
|
|
51
|
+
var c, p, f, g, x, w, _, k = r && r.__k || $r, H = e.length;
|
|
52
|
+
for (a = Bi(n, e, k, a, H), c = 0; c < H; c++) (f = n.__k[c]) != null && (p = f.__i == -1 ? Ve : k[f.__i] || Ve, f.__i = c, w = an(t, f, p, i, s, o, l, a, u, d), g = f.__e, f.ref && p.ref != f.ref && (p.ref && ln(p.ref, null, f), d.push(f.ref, f.__c || g, f)), x == null && g != null && (x = g), (_ = !!(4 & f.__u)) || p.__k === f.__k ? a = Er(f, a, t, _) : typeof f.type == "function" && w !== void 0 ? a = w : g && (a = g.nextSibling), f.__u &= -7);
|
|
53
|
+
return n.__e = x, a;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Bi(t, e, n, r, i) {
|
|
56
56
|
var s, o, l, a, u, d = n.length, c = d, p = 0;
|
|
57
|
-
for (t.__k = new Array(i), s = 0; s < i; s++) (o = e[s]) != null && typeof o != "boolean" && typeof o != "function" ? (a = s + p, (o = t.__k[s] = typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Be(null, o, null, null, null) : Xe(o) ? Be(
|
|
58
|
-
if (c) for (s = 0; s < d; s++) (l = n[s]) != null && (2 & l.__u) == 0 && (l.__e == r && (r =
|
|
57
|
+
for (t.__k = new Array(i), s = 0; s < i; s++) (o = e[s]) != null && typeof o != "boolean" && typeof o != "function" ? (a = s + p, (o = t.__k[s] = typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Be(null, o, null, null, null) : Xe(o) ? Be(N, { children: o }, null, null, null) : o.constructor == null && o.__b > 0 ? Be(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o).__ = t, o.__b = t.__b + 1, l = null, (u = o.__i = Fi(o, n, a, c)) != -1 && (c--, (l = n[u]) && (l.__u |= 2)), l == null || l.__v == null ? (u == -1 && (i > d ? p-- : i < d && p++), typeof o.type != "function" && (o.__u |= 4)) : u != a && (u == a - 1 ? p-- : u == a + 1 ? p++ : (u > a ? p-- : p++, o.__u |= 4))) : t.__k[s] = null;
|
|
58
|
+
if (c) for (s = 0; s < d; s++) (l = n[s]) != null && (2 & l.__u) == 0 && (l.__e == r && (r = Se(l)), Mr(l, l));
|
|
59
59
|
return r;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Er(t, e, n, r) {
|
|
62
62
|
var i, s;
|
|
63
63
|
if (typeof t.type == "function") {
|
|
64
|
-
for (i = t.__k, s = 0; i && s < i.length; s++) i[s] && (i[s].__ = t, e =
|
|
64
|
+
for (i = t.__k, s = 0; i && s < i.length; s++) i[s] && (i[s].__ = t, e = Er(i[s], e, n, r));
|
|
65
65
|
return e;
|
|
66
66
|
}
|
|
67
|
-
t.__e != e && (r && (e && t.type && !e.parentNode && (e =
|
|
67
|
+
t.__e != e && (r && (e && t.type && !e.parentNode && (e = Se(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
|
|
68
68
|
do
|
|
69
69
|
e = e && e.nextSibling;
|
|
70
70
|
while (e != null && e.nodeType == 8);
|
|
71
71
|
return e;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function ee(t, e) {
|
|
74
74
|
return e = e || [], t == null || typeof t == "boolean" || (Xe(t) ? t.some(function(n) {
|
|
75
|
-
|
|
75
|
+
ee(n, e);
|
|
76
76
|
}) : e.push(t)), e;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Fi(t, e, n, r) {
|
|
79
79
|
var i, s, o, l = t.key, a = t.type, u = e[n], d = u != null && (2 & u.__u) == 0;
|
|
80
80
|
if (u === null && t.key == null || d && l == u.key && a == u.type) return n;
|
|
81
81
|
if (r > (d ? 1 : 0)) {
|
|
@@ -83,17 +83,17 @@ function Oi(t, e, n, r) {
|
|
|
83
83
|
}
|
|
84
84
|
return -1;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" ||
|
|
86
|
+
function In(t, e, n) {
|
|
87
|
+
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || zi.test(e) ? n : n + "px";
|
|
88
88
|
}
|
|
89
89
|
function rt(t, e, n, r, i) {
|
|
90
90
|
var s, o;
|
|
91
91
|
e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
|
|
92
92
|
else {
|
|
93
|
-
if (typeof r == "string" && (t.style.cssText = r = ""), r) for (e in r) n && e in n ||
|
|
94
|
-
if (n) for (e in n) r && n[e] == r[e] ||
|
|
93
|
+
if (typeof r == "string" && (t.style.cssText = r = ""), r) for (e in r) n && e in n || In(t.style, e, "");
|
|
94
|
+
if (n) for (e in n) r && n[e] == r[e] || In(t.style, e, n[e]);
|
|
95
95
|
}
|
|
96
|
-
else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(
|
|
96
|
+
else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(Tr, "$1")), o = e.toLowerCase(), e = o in t || e == "onFocusOut" || e == "onFocusIn" ? o.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = n, n ? r ? n.u = r.u : (n.u = sn, t.addEventListener(e, s ? Ft : Bt, s)) : t.removeEventListener(e, s ? Ft : Bt, s);
|
|
97
97
|
else {
|
|
98
98
|
if (i == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
99
99
|
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 {
|
|
@@ -104,60 +104,60 @@ function rt(t, e, n, r, i) {
|
|
|
104
104
|
typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function En(t) {
|
|
108
108
|
return function(e) {
|
|
109
109
|
if (this.l) {
|
|
110
110
|
var n = this.l[e.type + t];
|
|
111
|
-
if (e.t == null) e.t =
|
|
111
|
+
if (e.t == null) e.t = sn++;
|
|
112
112
|
else if (e.t < n.u) return;
|
|
113
113
|
return n(m.event ? m.event(e) : e);
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
var d, c, p, f, g,
|
|
117
|
+
function an(t, e, n, r, i, s, o, l, a, u) {
|
|
118
|
+
var d, c, p, f, g, x, w, _, k, H, J, ie, Q, $n, nt, Pe, $t, G = e.type;
|
|
119
119
|
if (e.constructor != null) return null;
|
|
120
120
|
128 & n.__u && (a = !!(32 & n.__u), s = [l = e.__e = n.__e]), (d = m.__b) && d(e);
|
|
121
|
-
e: if (typeof
|
|
122
|
-
if (_ = e.props, k = "prototype" in
|
|
121
|
+
e: if (typeof G == "function") try {
|
|
122
|
+
if (_ = e.props, k = "prototype" in G && G.prototype.render, H = (d = G.contextType) && r[d.__c], J = d ? H ? H.props.value : d.__ : r, n.__c ? w = (c = e.__c = n.__c).__ = c.__E : (k ? e.__c = c = new G(_, J) : (e.__c = c = new D(_, J), c.constructor = G, c.render = Ui), H && H.sub(c), c.props = _, c.state || (c.state = {}), c.context = J, c.__n = r, p = c.__d = !0, c.__h = [], c._sb = []), k && c.__s == null && (c.__s = c.state), k && G.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = Y({}, c.__s)), Y(c.__s, G.getDerivedStateFromProps(_, c.__s))), f = c.props, g = c.state, c.__v = e, p) k && G.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), k && c.componentDidMount != null && c.__h.push(c.componentDidMount);
|
|
123
123
|
else {
|
|
124
|
-
if (k &&
|
|
124
|
+
if (k && G.getDerivedStateFromProps == null && _ !== f && c.componentWillReceiveProps != null && c.componentWillReceiveProps(_, J), !c.__e && c.shouldComponentUpdate != null && c.shouldComponentUpdate(_, c.__s, J) === !1 || e.__v == n.__v) {
|
|
125
125
|
for (e.__v != n.__v && (c.props = _, c.state = c.__s, c.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(xe) {
|
|
126
126
|
xe && (xe.__ = e);
|
|
127
127
|
}), ie = 0; ie < c._sb.length; ie++) c.__h.push(c._sb[ie]);
|
|
128
128
|
c._sb = [], c.__h.length && o.push(c);
|
|
129
129
|
break e;
|
|
130
130
|
}
|
|
131
|
-
c.componentWillUpdate != null && c.componentWillUpdate(_, c.__s,
|
|
132
|
-
c.componentDidUpdate(f, g,
|
|
131
|
+
c.componentWillUpdate != null && c.componentWillUpdate(_, c.__s, J), k && c.componentDidUpdate != null && c.__h.push(function() {
|
|
132
|
+
c.componentDidUpdate(f, g, x);
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
if (c.context =
|
|
136
|
-
for (c.state = c.__s, c.__d = !1,
|
|
135
|
+
if (c.context = J, c.props = _, c.__P = t, c.__e = !1, Q = m.__r, $n = 0, k) {
|
|
136
|
+
for (c.state = c.__s, c.__d = !1, Q && Q(e), d = c.render(c.props, c.state, c.context), nt = 0; nt < c._sb.length; nt++) c.__h.push(c._sb[nt]);
|
|
137
137
|
c._sb = [];
|
|
138
138
|
} else do
|
|
139
|
-
c.__d = !1,
|
|
140
|
-
while (c.__d &&
|
|
141
|
-
c.state = c.__s, c.getChildContext != null && (r =
|
|
139
|
+
c.__d = !1, Q && Q(e), d = c.render(c.props, c.state, c.context), c.state = c.__s;
|
|
140
|
+
while (c.__d && ++$n < 25);
|
|
141
|
+
c.state = c.__s, c.getChildContext != null && (r = Y(Y({}, r), c.getChildContext())), k && !p && c.getSnapshotBeforeUpdate != null && (x = c.getSnapshotBeforeUpdate(f, g)), Pe = d, d != null && d.type === N && d.key == null && (Pe = qr(d.props.children)), l = Ir(t, Xe(Pe) ? Pe : [Pe], e, n, r, i, s, o, l, a, u), c.base = e.__e, e.__u &= -161, c.__h.length && o.push(c), w && (c.__E = c.__ = null);
|
|
142
142
|
} catch (xe) {
|
|
143
143
|
if (e.__v = null, a || s != null) if (xe.then) {
|
|
144
144
|
for (e.__u |= a ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
145
145
|
s[s.indexOf(l)] = null, e.__e = l;
|
|
146
146
|
} else {
|
|
147
|
-
for (
|
|
148
|
-
|
|
147
|
+
for ($t = s.length; $t--; ) on(s[$t]);
|
|
148
|
+
Ut(e);
|
|
149
149
|
}
|
|
150
|
-
else e.__e = n.__e, e.__k = n.__k, xe.then ||
|
|
150
|
+
else e.__e = n.__e, e.__k = n.__k, xe.then || Ut(e);
|
|
151
151
|
m.__e(xe, e, n);
|
|
152
152
|
}
|
|
153
|
-
else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e =
|
|
153
|
+
else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = Di(n.__e, e, n, r, i, s, o, a, u);
|
|
154
154
|
return (d = m.diffed) && d(e), 128 & e.__u ? void 0 : l;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(
|
|
156
|
+
function Ut(t) {
|
|
157
|
+
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(Ut);
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
for (var r = 0; r < n.length; r++)
|
|
159
|
+
function Pr(t, e, n) {
|
|
160
|
+
for (var r = 0; r < n.length; r++) ln(n[r], n[++r], n[++r]);
|
|
161
161
|
m.__c && m.__c(e, t), t.some(function(i) {
|
|
162
162
|
try {
|
|
163
163
|
t = i.__h, i.__h = [], t.some(function(s) {
|
|
@@ -168,11 +168,11 @@ function $r(t, e, n) {
|
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : Xe(t) ? t.map(
|
|
171
|
+
function qr(t) {
|
|
172
|
+
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : Xe(t) ? t.map(qr) : Y({}, t);
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
var u, d, c, p, f, g,
|
|
174
|
+
function Di(t, e, n, r, i, s, o, l, a) {
|
|
175
|
+
var u, d, c, p, f, g, x, w = n.props, _ = e.props, k = e.type;
|
|
176
176
|
if (k == "svg" ? i = "http://www.w3.org/2000/svg" : k == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), s != null) {
|
|
177
177
|
for (u = 0; u < s.length; u++) if ((f = s[u]) && "setAttribute" in f == !!k && (k ? f.localName == k : f.nodeType == 3)) {
|
|
178
178
|
t = f, s[u] = null;
|
|
@@ -193,14 +193,14 @@ function Ni(t, e, n, r, i, s, o, l, a) {
|
|
|
193
193
|
rt(t, u, null, f, i);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
for (u in _) f = _[u], u == "children" ? p = f : u == "dangerouslySetInnerHTML" ? d = f : u == "value" ? g = f : u == "checked" ?
|
|
196
|
+
for (u in _) f = _[u], u == "children" ? p = f : u == "dangerouslySetInnerHTML" ? d = f : u == "value" ? g = f : u == "checked" ? x = f : l && typeof f != "function" || w[u] === f || rt(t, u, f, w[u], i);
|
|
197
197
|
if (d) l || c && (d.__html == c.__html || d.__html == t.innerHTML) || (t.innerHTML = d.__html), e.__k = [];
|
|
198
|
-
else if (c && (t.innerHTML = ""),
|
|
199
|
-
l || (u = "value", k == "progress" && g == null ? t.removeAttribute("value") : g != null && (g !== t[u] || k == "progress" && !g || k == "option" && g != w[u]) && rt(t, u, g, w[u], i), u = "checked",
|
|
198
|
+
else if (c && (t.innerHTML = ""), Ir(e.type == "template" ? t.content : t, Xe(p) ? p : [p], e, n, r, k == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, s, o, s ? s[0] : n.__k && Se(n, 0), l, a), s != null) for (u = s.length; u--; ) on(s[u]);
|
|
199
|
+
l || (u = "value", k == "progress" && g == null ? t.removeAttribute("value") : g != null && (g !== t[u] || k == "progress" && !g || k == "option" && g != w[u]) && rt(t, u, g, w[u], i), u = "checked", x != null && x != t[u] && rt(t, u, x, w[u], i));
|
|
200
200
|
}
|
|
201
201
|
return t;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function ln(t, e, n) {
|
|
204
204
|
try {
|
|
205
205
|
if (typeof t == "function") {
|
|
206
206
|
var r = typeof t.__u == "function";
|
|
@@ -210,9 +210,9 @@ function an(t, e, n) {
|
|
|
210
210
|
m.__e(i, n);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Mr(t, e, n) {
|
|
214
214
|
var r, i;
|
|
215
|
-
if (m.unmount && m.unmount(t), (r = t.ref) && (r.current && r.current != t.__e ||
|
|
215
|
+
if (m.unmount && m.unmount(t), (r = t.ref) && (r.current && r.current != t.__e || ln(r, null, e)), (r = t.__c) != null) {
|
|
216
216
|
if (r.componentWillUnmount) try {
|
|
217
217
|
r.componentWillUnmount();
|
|
218
218
|
} catch (s) {
|
|
@@ -220,25 +220,25 @@ function Ir(t, e, n) {
|
|
|
220
220
|
}
|
|
221
221
|
r.base = r.__P = null;
|
|
222
222
|
}
|
|
223
|
-
if (r = t.__k) for (i = 0; i < r.length; i++) r[i] &&
|
|
224
|
-
n ||
|
|
223
|
+
if (r = t.__k) for (i = 0; i < r.length; i++) r[i] && Mr(r[i], e, n || typeof t.type != "function");
|
|
224
|
+
n || on(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function Ui(t, e, n) {
|
|
227
227
|
return this.constructor(t, n);
|
|
228
228
|
}
|
|
229
229
|
function he(t, e, n) {
|
|
230
230
|
var r, i, s, o;
|
|
231
|
-
e == document && (e = document.documentElement), m.__ && m.__(t, e), i = (r = typeof n == "function") ? null : n && n.__k || e.__k, s = [], o = [],
|
|
231
|
+
e == document && (e = document.documentElement), m.__ && m.__(t, e), i = (r = typeof n == "function") ? null : n && n.__k || e.__k, s = [], o = [], an(e, t = (!r && n || e).__k = O(N, null, [t]), i || Ve, Ve, e.namespaceURI, !r && n ? [n] : i ? null : e.firstChild ? Ze.call(e.childNodes) : null, s, !r && n ? n : i ? i.__e : e.firstChild, r, o), Pr(s, t, o);
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
he(t, e,
|
|
233
|
+
function Lr(t, e) {
|
|
234
|
+
he(t, e, Lr);
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
var r, i, s, o, l =
|
|
236
|
+
function Vi(t, e, n) {
|
|
237
|
+
var r, i, s, o, l = Y({}, t.props);
|
|
238
238
|
for (s in t.type && t.type.defaultProps && (o = t.type.defaultProps), e) s == "key" ? r = e[s] : s == "ref" ? i = e[s] : l[s] = e[s] === void 0 && o != null ? o[s] : e[s];
|
|
239
239
|
return arguments.length > 2 && (l.children = arguments.length > 3 ? Ze.call(arguments, 2) : n), Be(t.type, l, r || t.key, i || t.ref, null);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Wi(t) {
|
|
242
242
|
function e(n) {
|
|
243
243
|
var r, i;
|
|
244
244
|
return this.getChildContext || (r = /* @__PURE__ */ new Set(), (i = {})[e.__c] = this, this.getChildContext = function() {
|
|
@@ -247,7 +247,7 @@ function Bi(t) {
|
|
|
247
247
|
r = null;
|
|
248
248
|
}, this.shouldComponentUpdate = function(s) {
|
|
249
249
|
this.props.value != s.value && r.forEach(function(o) {
|
|
250
|
-
o.__e = !0,
|
|
250
|
+
o.__e = !0, Dt(o);
|
|
251
251
|
});
|
|
252
252
|
}, this.sub = function(s) {
|
|
253
253
|
r.add(s);
|
|
@@ -257,48 +257,48 @@ function Bi(t) {
|
|
|
257
257
|
};
|
|
258
258
|
}), n.children;
|
|
259
259
|
}
|
|
260
|
-
return e.__c = "__cC" +
|
|
260
|
+
return e.__c = "__cC" + Rr++, e.__ = t, e.Provider = e.__l = (e.Consumer = function(n, r) {
|
|
261
261
|
return n.children(r);
|
|
262
262
|
}).contextType = e, e;
|
|
263
263
|
}
|
|
264
|
-
Ze =
|
|
264
|
+
Ze = $r.slice, m = { __e: function(t, e, n, r) {
|
|
265
265
|
for (var i, s, o; e = e.__; ) if ((i = e.__c) && !i.__) try {
|
|
266
266
|
if ((s = i.constructor) && s.getDerivedStateFromError != null && (i.setState(s.getDerivedStateFromError(t)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(t, r || {}), o = i.__d), o) return i.__E = i;
|
|
267
267
|
} catch (l) {
|
|
268
268
|
t = l;
|
|
269
269
|
}
|
|
270
270
|
throw t;
|
|
271
|
-
} },
|
|
271
|
+
} }, wr = 0, Sr = function(t) {
|
|
272
272
|
return t != null && t.constructor == null;
|
|
273
|
-
},
|
|
273
|
+
}, D.prototype.setState = function(t, e) {
|
|
274
274
|
var n;
|
|
275
|
-
n = this.__s != null && this.__s != this.state ? this.__s : this.__s =
|
|
276
|
-
},
|
|
277
|
-
this.__v && (this.__e = !0, t && this.__h.push(t),
|
|
278
|
-
},
|
|
275
|
+
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = Y({}, this.state), typeof t == "function" && (t = t(Y({}, n), this.props)), t && Y(n, t), t != null && this.__v && (e && this._sb.push(e), Dt(this));
|
|
276
|
+
}, D.prototype.forceUpdate = function(t) {
|
|
277
|
+
this.__v && (this.__e = !0, t && this.__h.push(t), Dt(this));
|
|
278
|
+
}, D.prototype.render = N, le = [], jr = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Cr = function(t, e) {
|
|
279
279
|
return t.__v.__b - e.__v.__b;
|
|
280
|
-
}, ht.__r = 0,
|
|
281
|
-
var
|
|
280
|
+
}, ht.__r = 0, Tr = /(PointerCapture)$|Capture$/i, sn = 0, Bt = En(!1), Ft = En(!0), Rr = 0;
|
|
281
|
+
var Hi = 0;
|
|
282
282
|
function h(t, e, n, r, i, s) {
|
|
283
283
|
e || (e = {});
|
|
284
284
|
var o, l, a = e;
|
|
285
285
|
if ("ref" in a) for (l in a = {}, e) l == "ref" ? o = e[l] : a[l] = e[l];
|
|
286
|
-
var u = { type: t, props: a, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --
|
|
286
|
+
var u = { type: t, props: a, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Hi, __i: -1, __u: 0, __source: i, __self: s };
|
|
287
287
|
if (typeof t == "function" && (o = t.defaultProps)) for (l in o) a[l] === void 0 && (a[l] = o[l]);
|
|
288
288
|
return m.vnode && m.vnode(u), u;
|
|
289
289
|
}
|
|
290
|
-
var oe, S,
|
|
291
|
-
function
|
|
292
|
-
j.__h && j.__h(S, t,
|
|
290
|
+
var oe, S, At, Pn, je = 0, Or = [], j = m, qn = j.__b, Mn = j.__r, Ln = j.diffed, On = j.__c, Nn = j.unmount, zn = j.__;
|
|
291
|
+
function $e(t, e) {
|
|
292
|
+
j.__h && j.__h(S, t, je || e), je = 0;
|
|
293
293
|
var n = S.__H || (S.__H = { __: [], __h: [] });
|
|
294
294
|
return t >= n.__.length && n.__.push({}), n.__[t];
|
|
295
295
|
}
|
|
296
296
|
function R(t) {
|
|
297
|
-
return
|
|
297
|
+
return je = 1, cn(Br, t);
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
var r =
|
|
301
|
-
if (r.t = t, !r.__c && (r.__ = [n ? n(e) :
|
|
299
|
+
function cn(t, e, n) {
|
|
300
|
+
var r = $e(oe++, 2);
|
|
301
|
+
if (r.t = t, !r.__c && (r.__ = [n ? n(e) : Br(void 0, e), function(l) {
|
|
302
302
|
var a = r.__N ? r.__N[0] : r.__[0], u = r.t(a, l);
|
|
303
303
|
a !== u && (r.__N = [u, r.__[1]], r.__c.setState({}));
|
|
304
304
|
}], r.__c = S, !S.__f)) {
|
|
@@ -330,21 +330,21 @@ function ln(t, e, n) {
|
|
|
330
330
|
}
|
|
331
331
|
return r.__N || r.__;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
var n =
|
|
335
|
-
!j.__s &&
|
|
333
|
+
function z(t, e) {
|
|
334
|
+
var n = $e(oe++, 3);
|
|
335
|
+
!j.__s && un(n.__H, e) && (n.__ = t, n.u = e, S.__H.__h.push(n));
|
|
336
336
|
}
|
|
337
337
|
function Ye(t, e) {
|
|
338
|
-
var n =
|
|
339
|
-
!j.__s &&
|
|
338
|
+
var n = $e(oe++, 4);
|
|
339
|
+
!j.__s && un(n.__H, e) && (n.__ = t, n.u = e, S.__h.push(n));
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
return
|
|
341
|
+
function _t(t) {
|
|
342
|
+
return je = 5, V(function() {
|
|
343
343
|
return { current: t };
|
|
344
344
|
}, []);
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
|
|
346
|
+
function Nr(t, e, n) {
|
|
347
|
+
je = 6, Ye(function() {
|
|
348
348
|
if (typeof t == "function") {
|
|
349
349
|
var r = t(e());
|
|
350
350
|
return function() {
|
|
@@ -356,24 +356,24 @@ function Pr(t, e, n) {
|
|
|
356
356
|
};
|
|
357
357
|
}, n == null ? n : n.concat(t));
|
|
358
358
|
}
|
|
359
|
-
function
|
|
360
|
-
var n =
|
|
361
|
-
return
|
|
359
|
+
function V(t, e) {
|
|
360
|
+
var n = $e(oe++, 7);
|
|
361
|
+
return un(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
|
|
362
362
|
}
|
|
363
363
|
function We(t, e) {
|
|
364
|
-
return
|
|
364
|
+
return je = 8, V(function() {
|
|
365
365
|
return t;
|
|
366
366
|
}, e);
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
var e = S.context[t.__c], n =
|
|
368
|
+
function kt(t) {
|
|
369
|
+
var e = S.context[t.__c], n = $e(oe++, 9);
|
|
370
370
|
return n.c = t, e ? (n.__ == null && (n.__ = !0, e.sub(S)), e.props.value) : t.__;
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function zr(t, e) {
|
|
373
373
|
j.useDebugValue && j.useDebugValue(e ? e(t) : t);
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
var t =
|
|
375
|
+
function Qr() {
|
|
376
|
+
var t = $e(oe++, 11);
|
|
377
377
|
if (!t.__) {
|
|
378
378
|
for (var e = S.__v; e !== null && !e.__m && e.__ !== null; ) e = e.__;
|
|
379
379
|
var n = e.__m || (e.__m = [0, 0]);
|
|
@@ -381,9 +381,9 @@ function Lr() {
|
|
|
381
381
|
}
|
|
382
382
|
return t.__;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
for (var t; t =
|
|
386
|
-
t.__H.__h.forEach(lt), t.__H.__h.forEach(
|
|
384
|
+
function Ji() {
|
|
385
|
+
for (var t; t = Or.shift(); ) if (t.__P && t.__H) try {
|
|
386
|
+
t.__H.__h.forEach(lt), t.__H.__h.forEach(Vt), t.__H.__h = [];
|
|
387
387
|
} catch (e) {
|
|
388
388
|
t.__H.__h = [], j.__e(e, t.__v);
|
|
389
389
|
}
|
|
@@ -391,33 +391,33 @@ function Di() {
|
|
|
391
391
|
j.__b = function(t) {
|
|
392
392
|
S = null, qn && qn(t);
|
|
393
393
|
}, j.__ = function(t, e) {
|
|
394
|
-
t && e.__k && e.__k.__m && (t.__m = e.__k.__m),
|
|
394
|
+
t && e.__k && e.__k.__m && (t.__m = e.__k.__m), zn && zn(t, e);
|
|
395
395
|
}, j.__r = function(t) {
|
|
396
|
-
|
|
396
|
+
Mn && Mn(t), oe = 0;
|
|
397
397
|
var e = (S = t.__c).__H;
|
|
398
|
-
e && (
|
|
398
|
+
e && (At === S ? (e.__h = [], S.__h = [], e.__.forEach(function(n) {
|
|
399
399
|
n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
|
|
400
|
-
})) : (e.__h.forEach(lt), e.__h.forEach(
|
|
400
|
+
})) : (e.__h.forEach(lt), e.__h.forEach(Vt), e.__h = [], oe = 0)), At = S;
|
|
401
401
|
}, j.diffed = function(t) {
|
|
402
|
-
|
|
402
|
+
Ln && Ln(t);
|
|
403
403
|
var e = t.__c;
|
|
404
|
-
e && e.__H && (e.__H.__h.length && (
|
|
404
|
+
e && e.__H && (e.__H.__h.length && (Or.push(e) !== 1 && Pn === j.requestAnimationFrame || ((Pn = j.requestAnimationFrame) || Gi)(Ji)), e.__H.__.forEach(function(n) {
|
|
405
405
|
n.u && (n.__H = n.u), n.u = void 0;
|
|
406
|
-
})),
|
|
406
|
+
})), At = S = null;
|
|
407
407
|
}, j.__c = function(t, e) {
|
|
408
408
|
e.some(function(n) {
|
|
409
409
|
try {
|
|
410
410
|
n.__h.forEach(lt), n.__h = n.__h.filter(function(r) {
|
|
411
|
-
return !r.__ ||
|
|
411
|
+
return !r.__ || Vt(r);
|
|
412
412
|
});
|
|
413
413
|
} catch (r) {
|
|
414
414
|
e.some(function(i) {
|
|
415
415
|
i.__h && (i.__h = []);
|
|
416
416
|
}), e = [], j.__e(r, n.__v);
|
|
417
417
|
}
|
|
418
|
-
}),
|
|
418
|
+
}), On && On(t, e);
|
|
419
419
|
}, j.unmount = function(t) {
|
|
420
|
-
|
|
420
|
+
Nn && Nn(t);
|
|
421
421
|
var e, n = t.__c;
|
|
422
422
|
n && n.__H && (n.__H.__.forEach(function(r) {
|
|
423
423
|
try {
|
|
@@ -428,7 +428,7 @@ j.__b = function(t) {
|
|
|
428
428
|
}), n.__H = void 0, e && j.__e(e, n.__v));
|
|
429
429
|
};
|
|
430
430
|
var Qn = typeof requestAnimationFrame == "function";
|
|
431
|
-
function
|
|
431
|
+
function Gi(t) {
|
|
432
432
|
var e, n = function() {
|
|
433
433
|
clearTimeout(r), Qn && cancelAnimationFrame(e), setTimeout(t);
|
|
434
434
|
}, r = setTimeout(n, 35);
|
|
@@ -438,38 +438,38 @@ function lt(t) {
|
|
|
438
438
|
var e = S, n = t.__c;
|
|
439
439
|
typeof n == "function" && (t.__c = void 0, n()), S = e;
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function Vt(t) {
|
|
442
442
|
var e = S;
|
|
443
443
|
t.__c = t.__(), S = e;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function un(t, e) {
|
|
446
446
|
return !t || t.length !== e.length || e.some(function(n, r) {
|
|
447
447
|
return n !== t[r];
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function Br(t, e) {
|
|
451
451
|
return typeof e == "function" ? e(t) : e;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function Fr(t, e) {
|
|
454
454
|
for (var n in e) t[n] = e[n];
|
|
455
455
|
return t;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function Wt(t, e) {
|
|
458
458
|
for (var n in t) if (n !== "__source" && !(n in e)) return !0;
|
|
459
459
|
for (var r in e) if (r !== "__source" && t[r] !== e[r]) return !0;
|
|
460
460
|
return !1;
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Dr(t, e) {
|
|
463
463
|
var n = e(), r = R({ t: { __: n, u: e } }), i = r[0].t, s = r[1];
|
|
464
464
|
return Ye(function() {
|
|
465
|
-
i.__ = n, i.u = e,
|
|
466
|
-
}, [t, n, e]),
|
|
467
|
-
return
|
|
468
|
-
|
|
465
|
+
i.__ = n, i.u = e, It(i) && s({ t: i });
|
|
466
|
+
}, [t, n, e]), z(function() {
|
|
467
|
+
return It(i) && s({ t: i }), t(function() {
|
|
468
|
+
It(i) && s({ t: i });
|
|
469
469
|
});
|
|
470
470
|
}, [t]), n;
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function It(t) {
|
|
473
473
|
var e, n, r = t.u, i = t.__;
|
|
474
474
|
try {
|
|
475
475
|
var s = r();
|
|
@@ -478,80 +478,80 @@ function At(t) {
|
|
|
478
478
|
return !0;
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function Ur(t) {
|
|
482
482
|
t();
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function Vr(t) {
|
|
485
485
|
return t;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
488
|
-
return [!1,
|
|
487
|
+
function Wr() {
|
|
488
|
+
return [!1, Ur];
|
|
489
489
|
}
|
|
490
|
-
var
|
|
491
|
-
function
|
|
490
|
+
var Hr = Ye;
|
|
491
|
+
function Ht(t, e) {
|
|
492
492
|
this.props = t, this.context = e;
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function Ki(t, e) {
|
|
495
495
|
function n(i) {
|
|
496
496
|
var s = this.props.ref, o = s == i.ref;
|
|
497
|
-
return !o && s && (s.call ? s(null) : s.current = null), e ? !e(this.props, i) || !o :
|
|
497
|
+
return !o && s && (s.call ? s(null) : s.current = null), e ? !e(this.props, i) || !o : Wt(this.props, i);
|
|
498
498
|
}
|
|
499
499
|
function r(i) {
|
|
500
|
-
return this.shouldComponentUpdate = n,
|
|
500
|
+
return this.shouldComponentUpdate = n, O(t, i);
|
|
501
501
|
}
|
|
502
502
|
return r.displayName = "Memo(" + (t.displayName || t.name) + ")", r.prototype.isReactComponent = !0, r.__f = !0, r.type = t, r;
|
|
503
503
|
}
|
|
504
|
-
(
|
|
505
|
-
return
|
|
504
|
+
(Ht.prototype = new D()).isPureReactComponent = !0, Ht.prototype.shouldComponentUpdate = function(t, e) {
|
|
505
|
+
return Wt(this.props, t) || Wt(this.state, e);
|
|
506
506
|
};
|
|
507
|
-
var
|
|
507
|
+
var Bn = m.__b;
|
|
508
508
|
m.__b = function(t) {
|
|
509
|
-
t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null),
|
|
509
|
+
t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null), Bn && Bn(t);
|
|
510
510
|
};
|
|
511
|
-
var
|
|
512
|
-
function
|
|
511
|
+
var Zi = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.forward_ref") || 3911;
|
|
512
|
+
function Xi(t) {
|
|
513
513
|
function e(n) {
|
|
514
|
-
var r =
|
|
514
|
+
var r = Fr({}, n);
|
|
515
515
|
return delete r.ref, t(r, n.ref || null);
|
|
516
516
|
}
|
|
517
|
-
return e.$$typeof =
|
|
517
|
+
return e.$$typeof = Zi, e.render = t, e.prototype.isReactComponent = e.__f = !0, e.displayName = "ForwardRef(" + (t.displayName || t.name) + ")", e;
|
|
518
518
|
}
|
|
519
|
-
var
|
|
520
|
-
return t == null ? null :
|
|
521
|
-
},
|
|
522
|
-
return t ?
|
|
519
|
+
var Fn = function(t, e) {
|
|
520
|
+
return t == null ? null : ee(ee(t).map(e));
|
|
521
|
+
}, Yi = { map: Fn, forEach: Fn, count: function(t) {
|
|
522
|
+
return t ? ee(t).length : 0;
|
|
523
523
|
}, only: function(t) {
|
|
524
|
-
var e =
|
|
524
|
+
var e = ee(t);
|
|
525
525
|
if (e.length !== 1) throw "Children.only";
|
|
526
526
|
return e[0];
|
|
527
|
-
}, toArray:
|
|
527
|
+
}, toArray: ee }, es = m.__e;
|
|
528
528
|
m.__e = function(t, e, n, r) {
|
|
529
529
|
if (t.then) {
|
|
530
530
|
for (var i, s = e; s = s.__; ) if ((i = s.__c) && i.__c) return e.__e == null && (e.__e = n.__e, e.__k = n.__k), i.__c(t, e);
|
|
531
531
|
}
|
|
532
|
-
|
|
532
|
+
es(t, e, n, r);
|
|
533
533
|
};
|
|
534
|
-
var
|
|
535
|
-
function
|
|
534
|
+
var Dn = m.unmount;
|
|
535
|
+
function Jr(t, e, n) {
|
|
536
536
|
return t && (t.__c && t.__c.__H && (t.__c.__H.__.forEach(function(r) {
|
|
537
537
|
typeof r.__c == "function" && r.__c();
|
|
538
|
-
}), t.__c.__H = null), (t =
|
|
539
|
-
return
|
|
538
|
+
}), t.__c.__H = null), (t = Fr({}, t)).__c != null && (t.__c.__P === n && (t.__c.__P = e), t.__c.__e = !0, t.__c = null), t.__k = t.__k && t.__k.map(function(r) {
|
|
539
|
+
return Jr(r, e, n);
|
|
540
540
|
})), t;
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function Gr(t, e, n) {
|
|
543
543
|
return t && n && (t.__v = null, t.__k = t.__k && t.__k.map(function(r) {
|
|
544
|
-
return
|
|
544
|
+
return Gr(r, e, n);
|
|
545
545
|
}), t.__c && t.__c.__P === e && (t.__e && n.appendChild(t.__e), t.__c.__e = !0, t.__c.__P = n)), t;
|
|
546
546
|
}
|
|
547
547
|
function ct() {
|
|
548
548
|
this.__u = 0, this.o = null, this.__b = null;
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function Kr(t) {
|
|
551
551
|
var e = t.__.__c;
|
|
552
552
|
return e && e.__a && e.__a(t);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function ts(t) {
|
|
555
555
|
var e, n, r;
|
|
556
556
|
function i(s) {
|
|
557
557
|
if (e || (e = t()).then(function(o) {
|
|
@@ -560,20 +560,20 @@ function Ki(t) {
|
|
|
560
560
|
r = o;
|
|
561
561
|
}), r) throw r;
|
|
562
562
|
if (!n) throw e;
|
|
563
|
-
return
|
|
563
|
+
return O(n, s);
|
|
564
564
|
}
|
|
565
565
|
return i.displayName = "Lazy", i.__f = !0, i;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function Oe() {
|
|
568
568
|
this.i = null, this.l = null;
|
|
569
569
|
}
|
|
570
570
|
m.unmount = function(t) {
|
|
571
571
|
var e = t.__c;
|
|
572
|
-
e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null),
|
|
573
|
-
}, (ct.prototype = new
|
|
572
|
+
e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null), Dn && Dn(t);
|
|
573
|
+
}, (ct.prototype = new D()).__c = function(t, e) {
|
|
574
574
|
var n = e.__c, r = this;
|
|
575
575
|
r.o == null && (r.o = []), r.o.push(n);
|
|
576
|
-
var i =
|
|
576
|
+
var i = Kr(r.__v), s = !1, o = function() {
|
|
577
577
|
s || (s = !0, n.__R = null, i ? i(l) : l());
|
|
578
578
|
};
|
|
579
579
|
n.__R = o;
|
|
@@ -581,7 +581,7 @@ m.unmount = function(t) {
|
|
|
581
581
|
if (!--r.__u) {
|
|
582
582
|
if (r.state.__a) {
|
|
583
583
|
var a = r.state.__a;
|
|
584
|
-
r.__v.__k[0] =
|
|
584
|
+
r.__v.__k[0] = Gr(a, a.__c.__P, a.__c.__O);
|
|
585
585
|
}
|
|
586
586
|
var u;
|
|
587
587
|
for (r.setState({ __a: r.__b = null }); u = r.o.pop(); ) u.forceUpdate();
|
|
@@ -594,26 +594,26 @@ m.unmount = function(t) {
|
|
|
594
594
|
if (this.__b) {
|
|
595
595
|
if (this.__v.__k) {
|
|
596
596
|
var n = document.createElement("div"), r = this.__v.__k[0].__c;
|
|
597
|
-
this.__v.__k[0] =
|
|
597
|
+
this.__v.__k[0] = Jr(this.__b, n, r.__O = r.__P);
|
|
598
598
|
}
|
|
599
599
|
this.__b = null;
|
|
600
600
|
}
|
|
601
|
-
var i = e.__a &&
|
|
602
|
-
return i && (i.__u &= -33), [
|
|
601
|
+
var i = e.__a && O(N, null, t.fallback);
|
|
602
|
+
return i && (i.__u &= -33), [O(N, null, e.__a ? null : t.children), i];
|
|
603
603
|
};
|
|
604
|
-
var
|
|
604
|
+
var Un = function(t, e, n) {
|
|
605
605
|
if (++n[1] === n[0] && t.l.delete(e), t.props.revealOrder && (t.props.revealOrder[0] !== "t" || !t.l.size)) for (n = t.i; n; ) {
|
|
606
606
|
for (; n.length > 3; ) n.pop()();
|
|
607
607
|
if (n[1] < n[0]) break;
|
|
608
608
|
t.i = n = n[2];
|
|
609
609
|
}
|
|
610
610
|
};
|
|
611
|
-
function
|
|
611
|
+
function ns(t) {
|
|
612
612
|
return this.getChildContext = function() {
|
|
613
613
|
return t.context;
|
|
614
614
|
}, t.children;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function rs(t) {
|
|
617
617
|
var e = this, n = t.h;
|
|
618
618
|
if (e.componentWillUnmount = function() {
|
|
619
619
|
he(null, e.v), e.v = null, e.h = null;
|
|
@@ -627,124 +627,124 @@ function Xi(t) {
|
|
|
627
627
|
this.childNodes.splice(this.childNodes.indexOf(i) >>> 1, 1), e.h.removeChild(i);
|
|
628
628
|
} };
|
|
629
629
|
}
|
|
630
|
-
he(
|
|
630
|
+
he(O(ns, { context: e.context }, t.__v), e.v);
|
|
631
631
|
}
|
|
632
|
-
function
|
|
633
|
-
var n =
|
|
632
|
+
function is(t, e) {
|
|
633
|
+
var n = O(rs, { __v: t, h: e });
|
|
634
634
|
return n.containerInfo = e, n;
|
|
635
635
|
}
|
|
636
|
-
(
|
|
637
|
-
var e = this, n =
|
|
636
|
+
(Oe.prototype = new D()).__a = function(t) {
|
|
637
|
+
var e = this, n = Kr(e.__v), r = e.l.get(t);
|
|
638
638
|
return r[0]++, function(i) {
|
|
639
639
|
var s = function() {
|
|
640
|
-
e.props.revealOrder ? (r.push(i),
|
|
640
|
+
e.props.revealOrder ? (r.push(i), Un(e, t, r)) : i();
|
|
641
641
|
};
|
|
642
642
|
n ? n(s) : s();
|
|
643
643
|
};
|
|
644
|
-
},
|
|
644
|
+
}, Oe.prototype.render = function(t) {
|
|
645
645
|
this.i = null, this.l = /* @__PURE__ */ new Map();
|
|
646
|
-
var e =
|
|
646
|
+
var e = ee(t.children);
|
|
647
647
|
t.revealOrder && t.revealOrder[0] === "b" && e.reverse();
|
|
648
648
|
for (var n = e.length; n--; ) this.l.set(e[n], this.i = [1, 0, this.i]);
|
|
649
649
|
return t.children;
|
|
650
|
-
},
|
|
650
|
+
}, Oe.prototype.componentDidUpdate = Oe.prototype.componentDidMount = function() {
|
|
651
651
|
var t = this;
|
|
652
652
|
this.l.forEach(function(e, n) {
|
|
653
|
-
|
|
653
|
+
Un(t, n, e);
|
|
654
654
|
});
|
|
655
655
|
};
|
|
656
|
-
var
|
|
656
|
+
var Zr = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.element") || 60103, ss = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, os = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, as = /[A-Z0-9]/g, ls = typeof document < "u", cs = function(t) {
|
|
657
657
|
return (typeof Symbol < "u" && typeof /* @__PURE__ */ Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(t);
|
|
658
658
|
};
|
|
659
|
-
function
|
|
659
|
+
function us(t, e, n) {
|
|
660
660
|
return e.__k == null && (e.textContent = ""), he(t, e), typeof n == "function" && n(), t ? t.__c : null;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
663
|
-
return
|
|
662
|
+
function hs(t, e, n) {
|
|
663
|
+
return Lr(t, e), typeof n == "function" && n(), t ? t.__c : null;
|
|
664
664
|
}
|
|
665
|
-
|
|
666
|
-
Object.defineProperty(
|
|
665
|
+
D.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t) {
|
|
666
|
+
Object.defineProperty(D.prototype, t, { configurable: !0, get: function() {
|
|
667
667
|
return this["UNSAFE_" + t];
|
|
668
668
|
}, set: function(e) {
|
|
669
669
|
Object.defineProperty(this, t, { configurable: !0, writable: !0, value: e });
|
|
670
670
|
} });
|
|
671
671
|
});
|
|
672
|
-
var
|
|
673
|
-
function
|
|
672
|
+
var Vn = m.event;
|
|
673
|
+
function ds() {
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function fs() {
|
|
676
676
|
return this.cancelBubble;
|
|
677
677
|
}
|
|
678
|
-
function
|
|
678
|
+
function ps() {
|
|
679
679
|
return this.defaultPrevented;
|
|
680
680
|
}
|
|
681
681
|
m.event = function(t) {
|
|
682
|
-
return
|
|
682
|
+
return Vn && (t = Vn(t)), t.persist = ds, t.isPropagationStopped = fs, t.isDefaultPrevented = ps, t.nativeEvent = t;
|
|
683
683
|
};
|
|
684
|
-
var
|
|
684
|
+
var hn, gs = { enumerable: !1, configurable: !0, get: function() {
|
|
685
685
|
return this.class;
|
|
686
|
-
} },
|
|
686
|
+
} }, Wn = m.vnode;
|
|
687
687
|
m.vnode = function(t) {
|
|
688
688
|
typeof t.type == "string" && (function(e) {
|
|
689
689
|
var n = e.props, r = e.type, i = {}, s = r.indexOf("-") === -1;
|
|
690
690
|
for (var o in n) {
|
|
691
691
|
var l = n[o];
|
|
692
|
-
if (!(o === "value" && "defaultValue" in n && l == null ||
|
|
692
|
+
if (!(o === "value" && "defaultValue" in n && l == null || ls && o === "children" && r === "noscript" || o === "class" || o === "className")) {
|
|
693
693
|
var a = o.toLowerCase();
|
|
694
|
-
o === "defaultValue" && "value" in n && n.value == null ? o = "value" : o === "download" && l === !0 ? l = "" : a === "translate" && l === "no" ? l = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? o = "ondblclick" : a !== "onchange" || r !== "input" && r !== "textarea" ||
|
|
694
|
+
o === "defaultValue" && "value" in n && n.value == null ? o = "value" : o === "download" && l === !0 ? l = "" : a === "translate" && l === "no" ? l = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? o = "ondblclick" : a !== "onchange" || r !== "input" && r !== "textarea" || cs(n.type) ? a === "onfocus" ? o = "onfocusin" : a === "onblur" ? o = "onfocusout" : os.test(o) && (o = a) : a = o = "oninput" : s && ss.test(o) ? o = o.replace(as, "-$&").toLowerCase() : l === null && (l = void 0), a === "oninput" && i[o = a] && (o = "oninputCapture"), i[o] = l;
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
r == "select" && i.multiple && Array.isArray(i.value) && (i.value =
|
|
697
|
+
r == "select" && i.multiple && Array.isArray(i.value) && (i.value = ee(n.children).forEach(function(u) {
|
|
698
698
|
u.props.selected = i.value.indexOf(u.props.value) != -1;
|
|
699
|
-
})), r == "select" && i.defaultValue != null && (i.value =
|
|
699
|
+
})), r == "select" && i.defaultValue != null && (i.value = ee(n.children).forEach(function(u) {
|
|
700
700
|
u.props.selected = i.multiple ? i.defaultValue.indexOf(u.props.value) != -1 : i.defaultValue == u.props.value;
|
|
701
|
-
})), n.class && !n.className ? (i.class = n.class, Object.defineProperty(i, "className",
|
|
702
|
-
})(t), t.$$typeof =
|
|
701
|
+
})), n.class && !n.className ? (i.class = n.class, Object.defineProperty(i, "className", gs)) : (n.className && !n.class || n.class && n.className) && (i.class = i.className = n.className), e.props = i;
|
|
702
|
+
})(t), t.$$typeof = Zr, Wn && Wn(t);
|
|
703
703
|
};
|
|
704
|
-
var
|
|
704
|
+
var Hn = m.__r;
|
|
705
705
|
m.__r = function(t) {
|
|
706
|
-
|
|
706
|
+
Hn && Hn(t), hn = t.__c;
|
|
707
707
|
};
|
|
708
|
-
var
|
|
708
|
+
var Jn = m.diffed;
|
|
709
709
|
m.diffed = function(t) {
|
|
710
|
-
|
|
710
|
+
Jn && Jn(t);
|
|
711
711
|
var e = t.props, n = t.__e;
|
|
712
|
-
n != null && t.type === "textarea" && "value" in e && e.value !== n.value && (n.value = e.value == null ? "" : e.value),
|
|
712
|
+
n != null && t.type === "textarea" && "value" in e && e.value !== n.value && (n.value = e.value == null ? "" : e.value), hn = null;
|
|
713
713
|
};
|
|
714
|
-
var
|
|
715
|
-
return
|
|
716
|
-
}, useCallback: We, useContext:
|
|
717
|
-
function
|
|
718
|
-
return
|
|
714
|
+
var ms = { ReactCurrentDispatcher: { current: { readContext: function(t) {
|
|
715
|
+
return hn.__n[t.__c].props.value;
|
|
716
|
+
}, useCallback: We, useContext: kt, useDebugValue: zr, useDeferredValue: Vr, useEffect: z, useId: Qr, useImperativeHandle: Nr, useInsertionEffect: Hr, useLayoutEffect: Ye, useMemo: V, useReducer: cn, useRef: _t, useState: R, useSyncExternalStore: Dr, useTransition: Wr } } };
|
|
717
|
+
function xs(t) {
|
|
718
|
+
return O.bind(null, t);
|
|
719
719
|
}
|
|
720
|
-
function
|
|
721
|
-
return !!t && t.$$typeof ===
|
|
720
|
+
function wt(t) {
|
|
721
|
+
return !!t && t.$$typeof === Zr;
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
return
|
|
723
|
+
function bs(t) {
|
|
724
|
+
return wt(t) && t.type === N;
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function ys(t) {
|
|
727
727
|
return !!t && !!t.displayName && (typeof t.displayName == "string" || t.displayName instanceof String) && t.displayName.startsWith("Memo(");
|
|
728
728
|
}
|
|
729
|
-
function
|
|
730
|
-
return
|
|
729
|
+
function vs(t) {
|
|
730
|
+
return wt(t) ? Vi.apply(null, arguments) : t;
|
|
731
731
|
}
|
|
732
|
-
function
|
|
732
|
+
function _s(t) {
|
|
733
733
|
return !!t.__k && (he(null, t), !0);
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function ks(t) {
|
|
736
736
|
return t && (t.base || t.nodeType === 1 && t) || null;
|
|
737
737
|
}
|
|
738
|
-
var
|
|
738
|
+
var ws = function(t, e) {
|
|
739
739
|
return t(e);
|
|
740
|
-
},
|
|
740
|
+
}, Ss = function(t, e) {
|
|
741
741
|
return t(e);
|
|
742
|
-
},
|
|
743
|
-
for (var be = 0,
|
|
744
|
-
|
|
742
|
+
}, js = N, Cs = wt, dn = { useState: R, useId: Qr, useReducer: cn, useEffect: z, useLayoutEffect: Ye, useInsertionEffect: Hr, useTransition: Wr, useDeferredValue: Vr, useSyncExternalStore: Dr, startTransition: Ur, useRef: _t, useImperativeHandle: Nr, useMemo: V, useCallback: We, useContext: kt, useDebugValue: zr, version: "18.3.1", Children: Yi, render: us, hydrate: hs, unmountComponentAtNode: _s, createPortal: is, createElement: O, createContext: Wi, createFactory: xs, cloneElement: vs, createRef: Qi, Fragment: N, isValidElement: wt, isElement: Cs, isFragment: bs, isMemo: ys, findDOMNode: ks, Component: D, PureComponent: Ht, memo: Ki, forwardRef: Xi, flushSync: Ss, unstable_batchedUpdates: ws, StrictMode: js, Suspense: ct, SuspenseList: Oe, lazy: ts, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ms }, X = [], L = [], Ts = Uint8Array, Et = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
743
|
+
for (var be = 0, Rs = Et.length; be < Rs; ++be)
|
|
744
|
+
X[be] = Et[be], L[Et.charCodeAt(be)] = be;
|
|
745
745
|
L[45] = 62;
|
|
746
746
|
L[95] = 63;
|
|
747
|
-
function
|
|
747
|
+
function $s(t) {
|
|
748
748
|
var e = t.length;
|
|
749
749
|
if (e % 4 > 0)
|
|
750
750
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
@@ -753,46 +753,46 @@ function Ss(t) {
|
|
|
753
753
|
var r = n === e ? 0 : 4 - n % 4;
|
|
754
754
|
return [n, r];
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function As(t, e, n) {
|
|
757
757
|
return (e + n) * 3 / 4 - n;
|
|
758
758
|
}
|
|
759
759
|
function He(t) {
|
|
760
|
-
var e, n =
|
|
760
|
+
var e, n = $s(t), r = n[0], i = n[1], s = new Ts(As(t, r, i)), o = 0, l = i > 0 ? r - 4 : r, a;
|
|
761
761
|
for (a = 0; a < l; a += 4)
|
|
762
762
|
e = L[t.charCodeAt(a)] << 18 | L[t.charCodeAt(a + 1)] << 12 | L[t.charCodeAt(a + 2)] << 6 | L[t.charCodeAt(a + 3)], s[o++] = e >> 16 & 255, s[o++] = e >> 8 & 255, s[o++] = e & 255;
|
|
763
763
|
return i === 2 && (e = L[t.charCodeAt(a)] << 2 | L[t.charCodeAt(a + 1)] >> 4, s[o++] = e & 255), i === 1 && (e = L[t.charCodeAt(a)] << 10 | L[t.charCodeAt(a + 1)] << 4 | L[t.charCodeAt(a + 2)] >> 2, s[o++] = e >> 8 & 255, s[o++] = e & 255), s;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
766
|
-
return
|
|
765
|
+
function Is(t) {
|
|
766
|
+
return X[t >> 18 & 63] + X[t >> 12 & 63] + X[t >> 6 & 63] + X[t & 63];
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function Es(t, e, n) {
|
|
769
769
|
for (var r, i = [], s = e; s < n; s += 3)
|
|
770
|
-
r = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (t[s + 2] & 255), i.push(
|
|
770
|
+
r = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (t[s + 2] & 255), i.push(Is(r));
|
|
771
771
|
return i.join("");
|
|
772
772
|
}
|
|
773
773
|
function Je(t) {
|
|
774
774
|
for (var e, n = t.length, r = n % 3, i = [], s = 16383, o = 0, l = n - r; o < l; o += s)
|
|
775
775
|
i.push(
|
|
776
|
-
|
|
776
|
+
Es(
|
|
777
777
|
t,
|
|
778
778
|
o,
|
|
779
779
|
o + s > l ? l : o + s
|
|
780
780
|
)
|
|
781
781
|
);
|
|
782
|
-
return r === 1 ? (e = t[n - 1], i.push(
|
|
783
|
-
|
|
782
|
+
return r === 1 ? (e = t[n - 1], i.push(X[e >> 2] + X[e << 4 & 63] + "==")) : r === 2 && (e = (t[n - 2] << 8) + t[n - 1], i.push(
|
|
783
|
+
X[e >> 10] + X[e >> 4 & 63] + X[e << 2 & 63] + "="
|
|
784
784
|
)), i.join("");
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function re(t) {
|
|
787
787
|
if (t === void 0)
|
|
788
788
|
return {};
|
|
789
|
-
if (!
|
|
789
|
+
if (!Xr(t))
|
|
790
790
|
throw new Error(
|
|
791
791
|
`The arguments to a Convex function must be an object. Received: ${t}`
|
|
792
792
|
);
|
|
793
793
|
return t;
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function Ps(t) {
|
|
796
796
|
if (typeof t > "u")
|
|
797
797
|
throw new Error(
|
|
798
798
|
"Client created with undefined deployment address. If you used an environment variable, check that it's set."
|
|
@@ -817,46 +817,46 @@ function Rs(t) {
|
|
|
817
817
|
`Invalid deployment address: "${t}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`
|
|
818
818
|
);
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function Xr(t) {
|
|
821
821
|
const e = typeof t == "object", n = Object.getPrototypeOf(t), r = n === null || n === Object.prototype || // Objects generated from other contexts (e.g. across Node.js `vm` modules) will not satisfy the previous
|
|
822
822
|
// conditions but are still simple objects.
|
|
823
823
|
n?.constructor?.name === "Object";
|
|
824
824
|
return e && r;
|
|
825
825
|
}
|
|
826
|
-
const
|
|
827
|
-
function
|
|
826
|
+
const Yr = !0, Ce = BigInt("-9223372036854775808"), fn = BigInt("9223372036854775807"), Jt = BigInt("0"), qs = BigInt("8"), Ms = BigInt("256");
|
|
827
|
+
function ei(t) {
|
|
828
828
|
return Number.isNaN(t) || !Number.isFinite(t) || Object.is(t, -0);
|
|
829
829
|
}
|
|
830
|
-
function
|
|
831
|
-
t <
|
|
830
|
+
function Ls(t) {
|
|
831
|
+
t < Jt && (t -= Ce + Ce);
|
|
832
832
|
let e = t.toString(16);
|
|
833
833
|
e.length % 2 === 1 && (e = "0" + e);
|
|
834
834
|
const n = new Uint8Array(new ArrayBuffer(8));
|
|
835
835
|
let r = 0;
|
|
836
836
|
for (const i of e.match(/.{2}/g).reverse())
|
|
837
|
-
n.set([parseInt(i, 16)], r++), t >>=
|
|
837
|
+
n.set([parseInt(i, 16)], r++), t >>= qs;
|
|
838
838
|
return Je(n);
|
|
839
839
|
}
|
|
840
|
-
function
|
|
840
|
+
function Os(t) {
|
|
841
841
|
const e = He(t);
|
|
842
842
|
if (e.byteLength !== 8)
|
|
843
843
|
throw new Error(
|
|
844
844
|
`Received ${e.byteLength} bytes, expected 8 for $integer`
|
|
845
845
|
);
|
|
846
|
-
let n =
|
|
846
|
+
let n = Jt, r = Jt;
|
|
847
847
|
for (const i of e)
|
|
848
|
-
n += BigInt(i) *
|
|
849
|
-
return n >
|
|
848
|
+
n += BigInt(i) * Ms ** r, r++;
|
|
849
|
+
return n > fn && (n += Ce + Ce), n;
|
|
850
850
|
}
|
|
851
|
-
function
|
|
852
|
-
if (t <
|
|
851
|
+
function Ns(t) {
|
|
852
|
+
if (t < Ce || fn < t)
|
|
853
853
|
throw new Error(
|
|
854
854
|
`BigInt ${t} does not fit into a 64-bit signed integer.`
|
|
855
855
|
);
|
|
856
856
|
const e = new ArrayBuffer(8);
|
|
857
857
|
return new DataView(e).setBigInt64(0, t, !0), Je(new Uint8Array(e));
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function zs(t) {
|
|
860
860
|
const e = He(t);
|
|
861
861
|
if (e.byteLength !== 8)
|
|
862
862
|
throw new Error(
|
|
@@ -864,11 +864,11 @@ function Ps(t) {
|
|
|
864
864
|
);
|
|
865
865
|
return new DataView(e.buffer).getBigInt64(0, !0);
|
|
866
866
|
}
|
|
867
|
-
const
|
|
868
|
-
function
|
|
869
|
-
if (t.length >
|
|
867
|
+
const Qs = DataView.prototype.setBigInt64 ? Ns : Ls, Bs = DataView.prototype.getBigInt64 ? zs : Os, Gn = 1024;
|
|
868
|
+
function ti(t) {
|
|
869
|
+
if (t.length > Gn)
|
|
870
870
|
throw new Error(
|
|
871
|
-
`Field name ${t} exceeds maximum field name length ${
|
|
871
|
+
`Field name ${t} exceeds maximum field name length ${Gn}.`
|
|
872
872
|
);
|
|
873
873
|
if (t.startsWith("$"))
|
|
874
874
|
throw new Error(`Field name ${t} starts with a '$', which is reserved.`);
|
|
@@ -880,11 +880,11 @@ function Zr(t) {
|
|
|
880
880
|
);
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function Te(t) {
|
|
884
884
|
if (t === null || typeof t == "boolean" || typeof t == "number" || typeof t == "string")
|
|
885
885
|
return t;
|
|
886
886
|
if (Array.isArray(t))
|
|
887
|
-
return t.map((r) =>
|
|
887
|
+
return t.map((r) => Te(r));
|
|
888
888
|
if (typeof t != "object")
|
|
889
889
|
throw new Error(`Unexpected type of ${t}`);
|
|
890
890
|
const e = Object.entries(t);
|
|
@@ -898,7 +898,7 @@ function Re(t) {
|
|
|
898
898
|
if (r === "$integer") {
|
|
899
899
|
if (typeof t.$integer != "string")
|
|
900
900
|
throw new Error(`Malformed $integer field on ${t}`);
|
|
901
|
-
return
|
|
901
|
+
return Bs(t.$integer);
|
|
902
902
|
}
|
|
903
903
|
if (r === "$float") {
|
|
904
904
|
if (typeof t.$float != "string")
|
|
@@ -908,8 +908,8 @@ function Re(t) {
|
|
|
908
908
|
throw new Error(
|
|
909
909
|
`Received ${i.byteLength} bytes, expected 8 for $float`
|
|
910
910
|
);
|
|
911
|
-
const o = new DataView(i.buffer).getFloat64(0,
|
|
912
|
-
if (!
|
|
911
|
+
const o = new DataView(i.buffer).getFloat64(0, Yr);
|
|
912
|
+
if (!ei(o))
|
|
913
913
|
throw new Error(`Float ${o} should be encoded as a number`);
|
|
914
914
|
return o;
|
|
915
915
|
}
|
|
@@ -924,21 +924,21 @@ function Re(t) {
|
|
|
924
924
|
}
|
|
925
925
|
const n = {};
|
|
926
926
|
for (const [r, i] of Object.entries(t))
|
|
927
|
-
|
|
927
|
+
ti(r), n[r] = Te(i);
|
|
928
928
|
return n;
|
|
929
929
|
}
|
|
930
|
-
const
|
|
930
|
+
const Kn = 16384;
|
|
931
931
|
function Fe(t) {
|
|
932
932
|
const e = JSON.stringify(t, (n, r) => r === void 0 ? "undefined" : typeof r == "bigint" ? `${r.toString()}n` : r);
|
|
933
|
-
if (e.length >
|
|
933
|
+
if (e.length > Kn) {
|
|
934
934
|
const n = "[...truncated]";
|
|
935
|
-
let r =
|
|
935
|
+
let r = Kn - n.length;
|
|
936
936
|
const i = e.codePointAt(r - 1);
|
|
937
937
|
return i !== void 0 && i > 65535 && (r -= 1), e.substring(0, r) + n;
|
|
938
938
|
}
|
|
939
939
|
return e;
|
|
940
940
|
}
|
|
941
|
-
function
|
|
941
|
+
function Gt(t, e, n, r) {
|
|
942
942
|
if (t === void 0) {
|
|
943
943
|
const o = n && ` (present at path ${n} in original object ${Fe(
|
|
944
944
|
e
|
|
@@ -950,16 +950,16 @@ function Jt(t, e, n, r) {
|
|
|
950
950
|
if (t === null)
|
|
951
951
|
return t;
|
|
952
952
|
if (typeof t == "bigint") {
|
|
953
|
-
if (t <
|
|
953
|
+
if (t < Ce || fn < t)
|
|
954
954
|
throw new Error(
|
|
955
955
|
`BigInt ${t} does not fit into a 64-bit signed integer.`
|
|
956
956
|
);
|
|
957
|
-
return { $integer:
|
|
957
|
+
return { $integer: Qs(t) };
|
|
958
958
|
}
|
|
959
959
|
if (typeof t == "number")
|
|
960
|
-
if (
|
|
960
|
+
if (ei(t)) {
|
|
961
961
|
const o = new ArrayBuffer(8);
|
|
962
|
-
return new DataView(o).setFloat64(0, t,
|
|
962
|
+
return new DataView(o).setFloat64(0, t, Yr), { $float: Je(new Uint8Array(o)) };
|
|
963
963
|
} else
|
|
964
964
|
return t;
|
|
965
965
|
if (typeof t == "boolean" || typeof t == "string")
|
|
@@ -968,29 +968,29 @@ function Jt(t, e, n, r) {
|
|
|
968
968
|
return { $bytes: Je(new Uint8Array(t)) };
|
|
969
969
|
if (Array.isArray(t))
|
|
970
970
|
return t.map(
|
|
971
|
-
(o, l) =>
|
|
971
|
+
(o, l) => Gt(o, e, n + `[${l}]`)
|
|
972
972
|
);
|
|
973
973
|
if (t instanceof Set)
|
|
974
974
|
throw new Error(
|
|
975
|
-
|
|
975
|
+
Pt(n, "Set", [...t], e)
|
|
976
976
|
);
|
|
977
977
|
if (t instanceof Map)
|
|
978
978
|
throw new Error(
|
|
979
|
-
|
|
979
|
+
Pt(n, "Map", [...t], e)
|
|
980
980
|
);
|
|
981
|
-
if (!
|
|
981
|
+
if (!Xr(t)) {
|
|
982
982
|
const o = t?.constructor?.name, l = o ? `${o} ` : "";
|
|
983
983
|
throw new Error(
|
|
984
|
-
|
|
984
|
+
Pt(n, l, t, e)
|
|
985
985
|
);
|
|
986
986
|
}
|
|
987
987
|
const i = {}, s = Object.entries(t);
|
|
988
988
|
s.sort(([o, l], [a, u]) => o === a ? 0 : o < a ? -1 : 1);
|
|
989
989
|
for (const [o, l] of s)
|
|
990
|
-
l !== void 0 && (
|
|
990
|
+
l !== void 0 && (ti(o), i[o] = Gt(l, e, n + `.${o}`));
|
|
991
991
|
return i;
|
|
992
992
|
}
|
|
993
|
-
function
|
|
993
|
+
function Pt(t, e, n, r) {
|
|
994
994
|
return t ? `${e}${Fe(
|
|
995
995
|
n
|
|
996
996
|
)} is not a supported Convex type (present at path ${t} in original object ${Fe(
|
|
@@ -999,23 +999,23 @@ function Et(t, e, n, r) {
|
|
|
999
999
|
n
|
|
1000
1000
|
)} is not a supported Convex type.`;
|
|
1001
1001
|
}
|
|
1002
|
-
function
|
|
1003
|
-
return
|
|
1002
|
+
function te(t) {
|
|
1003
|
+
return Gt(t, t, "");
|
|
1004
1004
|
}
|
|
1005
|
-
var
|
|
1006
|
-
const
|
|
1007
|
-
class
|
|
1005
|
+
var Fs = Object.defineProperty, Ds = (t, e, n) => e in t ? Fs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, qt = (t, e, n) => Ds(t, typeof e != "symbol" ? e + "" : e, n), Zn, Xn;
|
|
1006
|
+
const Us = /* @__PURE__ */ Symbol.for("ConvexError");
|
|
1007
|
+
class Kt extends (Xn = Error, Zn = Us, Xn) {
|
|
1008
1008
|
constructor(e) {
|
|
1009
|
-
super(typeof e == "string" ? e : Fe(e)), qt(this, "name", "ConvexError"), qt(this, "data"), qt(this,
|
|
1009
|
+
super(typeof e == "string" ? e : Fe(e)), qt(this, "name", "ConvexError"), qt(this, "data"), qt(this, Zn, !0), this.data = e;
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
const
|
|
1016
|
-
var
|
|
1017
|
-
const
|
|
1018
|
-
function
|
|
1012
|
+
const ni = () => Array.from({ length: 4 }, () => 0);
|
|
1013
|
+
ni();
|
|
1014
|
+
ni();
|
|
1015
|
+
const Yn = "1.37.0";
|
|
1016
|
+
var Vs = Object.defineProperty, Ws = (t, e, n) => e in t ? Vs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, er = (t, e, n) => Ws(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1017
|
+
const Hs = "color:rgb(0, 145, 255)";
|
|
1018
|
+
function ri(t) {
|
|
1019
1019
|
switch (t) {
|
|
1020
1020
|
case "query":
|
|
1021
1021
|
return "Q";
|
|
@@ -1027,9 +1027,9 @@ function Yr(t) {
|
|
|
1027
1027
|
return "?";
|
|
1028
1028
|
}
|
|
1029
1029
|
}
|
|
1030
|
-
class
|
|
1030
|
+
class ii {
|
|
1031
1031
|
constructor(e) {
|
|
1032
|
-
|
|
1032
|
+
er(this, "_onLogLineFuncs"), er(this, "_verbose"), this._onLogLineFuncs = {}, this._verbose = e.verbose;
|
|
1033
1033
|
}
|
|
1034
1034
|
addLogLineListener(e) {
|
|
1035
1035
|
let n = Math.random().toString(36).substring(2, 15);
|
|
@@ -1057,8 +1057,8 @@ class ei {
|
|
|
1057
1057
|
n("error", ...e);
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1061
|
-
const e = new
|
|
1060
|
+
function si(t) {
|
|
1061
|
+
const e = new ii(t);
|
|
1062
1062
|
return e.addLogLineListener((n, ...r) => {
|
|
1063
1063
|
switch (n) {
|
|
1064
1064
|
case "debug":
|
|
@@ -1078,11 +1078,11 @@ function ti(t) {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
}), e;
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1082
|
-
return new
|
|
1081
|
+
function oi(t) {
|
|
1082
|
+
return new ii(t);
|
|
1083
1083
|
}
|
|
1084
1084
|
function dt(t, e, n, r, i) {
|
|
1085
|
-
const s =
|
|
1085
|
+
const s = ri(n);
|
|
1086
1086
|
if (typeof i == "object" && (i = `ConvexError ${JSON.stringify(i.errorData, null, 2)}`), e === "info") {
|
|
1087
1087
|
const o = i.match(/^\[.*?\] /);
|
|
1088
1088
|
if (o === null) {
|
|
@@ -1092,19 +1092,19 @@ function dt(t, e, n, r, i) {
|
|
|
1092
1092
|
return;
|
|
1093
1093
|
}
|
|
1094
1094
|
const l = i.slice(1, o[0].length - 2), a = i.slice(o[0].length);
|
|
1095
|
-
t.log(`%c[CONVEX ${s}(${r})] [${l}]`,
|
|
1095
|
+
t.log(`%c[CONVEX ${s}(${r})] [${l}]`, Hs, a);
|
|
1096
1096
|
} else
|
|
1097
1097
|
t.error(`[CONVEX ${s}(${r})] ${i}`);
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function Js(t, e) {
|
|
1100
1100
|
const n = `[CONVEX FATAL ERROR] ${e}`;
|
|
1101
1101
|
return t.error(n), new Error(n);
|
|
1102
1102
|
}
|
|
1103
1103
|
function _e(t, e, n) {
|
|
1104
|
-
return `[CONVEX ${
|
|
1104
|
+
return `[CONVEX ${ri(t)}(${e})] ${n.errorMessage}
|
|
1105
1105
|
Called by client`;
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function Zt(t, e) {
|
|
1108
1108
|
return e.data = t.errorData, e;
|
|
1109
1109
|
}
|
|
1110
1110
|
function de(t) {
|
|
@@ -1115,22 +1115,22 @@ function de(t) {
|
|
|
1115
1115
|
function ue(t, e) {
|
|
1116
1116
|
return JSON.stringify({
|
|
1117
1117
|
udfPath: de(t),
|
|
1118
|
-
args:
|
|
1118
|
+
args: te(e)
|
|
1119
1119
|
});
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function tr(t, e, n) {
|
|
1122
1122
|
const { initialNumItems: r, id: i } = n;
|
|
1123
1123
|
return JSON.stringify({
|
|
1124
1124
|
type: "paginated",
|
|
1125
1125
|
udfPath: de(t),
|
|
1126
|
-
args:
|
|
1127
|
-
options:
|
|
1126
|
+
args: te(e),
|
|
1127
|
+
options: te({ initialNumItems: r, id: i })
|
|
1128
1128
|
});
|
|
1129
1129
|
}
|
|
1130
|
-
var
|
|
1131
|
-
class
|
|
1130
|
+
var Gs = Object.defineProperty, Ks = (t, e, n) => e in t ? Gs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, K = (t, e, n) => Ks(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1131
|
+
class Zs {
|
|
1132
1132
|
constructor() {
|
|
1133
|
-
|
|
1133
|
+
K(this, "nextQueryId"), K(this, "querySetVersion"), K(this, "querySet"), K(this, "queryIdToToken"), K(this, "identityVersion"), K(this, "auth"), K(this, "outstandingQueriesOlderThanRestart"), K(this, "outstandingAuthOlderThanRestart"), K(this, "paused"), K(this, "pendingQuerySetModifications"), this.nextQueryId = 0, this.querySetVersion = 0, this.identityVersion = 0, this.querySet = /* @__PURE__ */ new Map(), this.queryIdToToken = /* @__PURE__ */ new Map(), this.outstandingQueriesOlderThanRestart = /* @__PURE__ */ new Set(), this.outstandingAuthOlderThanRestart = !1, this.paused = !1, this.pendingQuerySetModifications = /* @__PURE__ */ new Map();
|
|
1134
1134
|
}
|
|
1135
1135
|
hasSyncedPastLastReconnect() {
|
|
1136
1136
|
return this.outstandingQueriesOlderThanRestart.size === 0 && !this.outstandingAuthOlderThanRestart;
|
|
@@ -1160,7 +1160,7 @@ class Ws {
|
|
|
1160
1160
|
type: "Add",
|
|
1161
1161
|
queryId: a,
|
|
1162
1162
|
udfPath: s,
|
|
1163
|
-
args: [
|
|
1163
|
+
args: [te(n)],
|
|
1164
1164
|
journal: r,
|
|
1165
1165
|
componentPath: i
|
|
1166
1166
|
};
|
|
@@ -1270,7 +1270,7 @@ class Ws {
|
|
|
1270
1270
|
type: "Add",
|
|
1271
1271
|
queryId: i.id,
|
|
1272
1272
|
udfPath: i.canonicalizedUdfPath,
|
|
1273
|
-
args: [
|
|
1273
|
+
args: [te(i.args)],
|
|
1274
1274
|
journal: i.journal,
|
|
1275
1275
|
componentPath: i.componentPath
|
|
1276
1276
|
};
|
|
@@ -1333,8 +1333,8 @@ class Ws {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
|
-
var
|
|
1337
|
-
class
|
|
1336
|
+
var Xs = Object.defineProperty, Ys = (t, e, n) => e in t ? Xs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, it = (t, e, n) => Ys(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1337
|
+
class eo {
|
|
1338
1338
|
constructor(e, n) {
|
|
1339
1339
|
this.logger = e, this.markConnectionStateDirty = n, it(this, "inflightRequests"), it(this, "requestsOlderThanRestart"), it(this, "inflightMutationsCount", 0), it(this, "inflightActionsCount", 0), this.inflightRequests = /* @__PURE__ */ new Map(), this.requestsOlderThanRestart = /* @__PURE__ */ new Set();
|
|
1340
1340
|
}
|
|
@@ -1367,14 +1367,14 @@ class Gs {
|
|
|
1367
1367
|
o = {
|
|
1368
1368
|
success: !0,
|
|
1369
1369
|
logLines: e.logLines,
|
|
1370
|
-
value:
|
|
1370
|
+
value: Te(e.result)
|
|
1371
1371
|
}, l = () => s.onResult(o);
|
|
1372
1372
|
else {
|
|
1373
1373
|
const a = e.result, { errorData: u } = e;
|
|
1374
1374
|
dt(this.logger, "error", r, i, a), o = {
|
|
1375
1375
|
success: !1,
|
|
1376
1376
|
errorMessage: a,
|
|
1377
|
-
errorData: u !== void 0 ?
|
|
1377
|
+
errorData: u !== void 0 ? Te(u) : void 0,
|
|
1378
1378
|
logLines: e.logLines
|
|
1379
1379
|
}, l = () => s.onResult(o);
|
|
1380
1380
|
}
|
|
@@ -1470,29 +1470,29 @@ class Gs {
|
|
|
1470
1470
|
return this.inflightActionsCount;
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
|
-
const Ge = /* @__PURE__ */ Symbol.for("functionName"),
|
|
1474
|
-
function
|
|
1475
|
-
return t[
|
|
1473
|
+
const Ge = /* @__PURE__ */ Symbol.for("functionName"), ai = /* @__PURE__ */ Symbol.for("toReferencePath");
|
|
1474
|
+
function to(t) {
|
|
1475
|
+
return t[ai] ?? null;
|
|
1476
1476
|
}
|
|
1477
|
-
function
|
|
1477
|
+
function no(t) {
|
|
1478
1478
|
return t.startsWith("function://");
|
|
1479
1479
|
}
|
|
1480
|
-
function
|
|
1480
|
+
function ro(t) {
|
|
1481
1481
|
let e;
|
|
1482
1482
|
if (typeof t == "string")
|
|
1483
|
-
|
|
1483
|
+
no(t) ? e = { functionHandle: t } : e = { name: t };
|
|
1484
1484
|
else if (t[Ge])
|
|
1485
1485
|
e = { name: t[Ge] };
|
|
1486
1486
|
else {
|
|
1487
|
-
const n =
|
|
1487
|
+
const n = to(t);
|
|
1488
1488
|
if (!n)
|
|
1489
1489
|
throw new Error(`${t} is not a functionReference`);
|
|
1490
1490
|
e = { reference: n };
|
|
1491
1491
|
}
|
|
1492
1492
|
return e;
|
|
1493
1493
|
}
|
|
1494
|
-
function
|
|
1495
|
-
const e =
|
|
1494
|
+
function P(t) {
|
|
1495
|
+
const e = ro(t);
|
|
1496
1496
|
if (e.name === void 0)
|
|
1497
1497
|
throw e.functionHandle !== void 0 ? new Error(
|
|
1498
1498
|
`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${e.functionHandle}`
|
|
@@ -1507,15 +1507,15 @@ function q(t) {
|
|
|
1507
1507
|
throw new Error(`${t} is not a functionReference`);
|
|
1508
1508
|
return n;
|
|
1509
1509
|
}
|
|
1510
|
-
function
|
|
1510
|
+
function li(t) {
|
|
1511
1511
|
return { [Ge]: t };
|
|
1512
1512
|
}
|
|
1513
|
-
function
|
|
1513
|
+
function ci(t = []) {
|
|
1514
1514
|
const e = {
|
|
1515
1515
|
get(n, r) {
|
|
1516
1516
|
if (typeof r == "string") {
|
|
1517
1517
|
const i = [...t, r];
|
|
1518
|
-
return
|
|
1518
|
+
return ci(i);
|
|
1519
1519
|
} else if (r === Ge) {
|
|
1520
1520
|
if (t.length < 2) {
|
|
1521
1521
|
const o = ["api", ...t].join(".");
|
|
@@ -1530,21 +1530,21 @@ function si(t = []) {
|
|
|
1530
1530
|
};
|
|
1531
1531
|
return new Proxy({}, e);
|
|
1532
1532
|
}
|
|
1533
|
-
const
|
|
1534
|
-
var
|
|
1533
|
+
const io = ci();
|
|
1534
|
+
var so = Object.defineProperty, oo = (t, e, n) => e in t ? so(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ft = (t, e, n) => oo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1535
1535
|
class Ke {
|
|
1536
1536
|
constructor(e) {
|
|
1537
1537
|
ft(this, "queryResults"), ft(this, "modifiedQueries"), this.queryResults = e, this.modifiedQueries = [];
|
|
1538
1538
|
}
|
|
1539
1539
|
getQuery(e, ...n) {
|
|
1540
|
-
const r =
|
|
1540
|
+
const r = re(n[0]), i = P(e), s = this.queryResults.get(
|
|
1541
1541
|
ue(i, r)
|
|
1542
1542
|
);
|
|
1543
1543
|
if (s !== void 0)
|
|
1544
1544
|
return Ke.queryValue(s.result);
|
|
1545
1545
|
}
|
|
1546
1546
|
getAllQueries(e) {
|
|
1547
|
-
const n = [], r =
|
|
1547
|
+
const n = [], r = P(e);
|
|
1548
1548
|
for (const i of this.queryResults.values())
|
|
1549
1549
|
i.udfPath === de(r) && n.push({
|
|
1550
1550
|
args: i.args,
|
|
@@ -1553,7 +1553,7 @@ class Ke {
|
|
|
1553
1553
|
return n;
|
|
1554
1554
|
}
|
|
1555
1555
|
setQuery(e, n, r) {
|
|
1556
|
-
const i =
|
|
1556
|
+
const i = re(n), s = P(e), o = ue(s, i);
|
|
1557
1557
|
let l;
|
|
1558
1558
|
r === void 0 ? l = void 0 : l = {
|
|
1559
1559
|
success: !0,
|
|
@@ -1573,7 +1573,7 @@ class Ke {
|
|
|
1573
1573
|
return e.success ? e.value : void 0;
|
|
1574
1574
|
}
|
|
1575
1575
|
}
|
|
1576
|
-
class
|
|
1576
|
+
class ao {
|
|
1577
1577
|
constructor() {
|
|
1578
1578
|
ft(this, "queryResults"), ft(this, "optimisticUpdates"), this.queryResults = /* @__PURE__ */ new Map(), this.optimisticUpdates = [];
|
|
1579
1579
|
}
|
|
@@ -1621,9 +1621,9 @@ class no {
|
|
|
1621
1621
|
if (r !== void 0) {
|
|
1622
1622
|
if (r.success)
|
|
1623
1623
|
return r.value;
|
|
1624
|
-
throw r.errorData !== void 0 ?
|
|
1624
|
+
throw r.errorData !== void 0 ? Zt(
|
|
1625
1625
|
r,
|
|
1626
|
-
new
|
|
1626
|
+
new Kt(
|
|
1627
1627
|
_e("query", n.udfPath, r)
|
|
1628
1628
|
)
|
|
1629
1629
|
) : new Error(
|
|
@@ -1641,10 +1641,10 @@ class no {
|
|
|
1641
1641
|
return this.queryResults.get(e)?.result?.logLines;
|
|
1642
1642
|
}
|
|
1643
1643
|
}
|
|
1644
|
-
var
|
|
1644
|
+
var lo = Object.defineProperty, co = (t, e, n) => e in t ? lo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Mt = (t, e, n) => co(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1645
1645
|
class E {
|
|
1646
1646
|
constructor(e, n) {
|
|
1647
|
-
|
|
1647
|
+
Mt(this, "low"), Mt(this, "high"), Mt(this, "__isUnsignedLong__"), this.low = e | 0, this.high = n | 0, this.__isUnsignedLong__ = !0;
|
|
1648
1648
|
}
|
|
1649
1649
|
static isLong(e) {
|
|
1650
1650
|
return (e && e.__isUnsignedLong__) === !0;
|
|
@@ -1671,7 +1671,7 @@ class E {
|
|
|
1671
1671
|
];
|
|
1672
1672
|
}
|
|
1673
1673
|
static fromNumber(e) {
|
|
1674
|
-
return isNaN(e) || e < 0 ?
|
|
1674
|
+
return isNaN(e) || e < 0 ? nr : e >= uo ? ho : new E(e % De | 0, e / De | 0);
|
|
1675
1675
|
}
|
|
1676
1676
|
toString() {
|
|
1677
1677
|
return (BigInt(this.high) * BigInt(De) + BigInt(this.low)).toString();
|
|
@@ -1695,9 +1695,9 @@ class E {
|
|
|
1695
1695
|
return typeof e == "number" ? E.fromNumber(e) : new E(e.low, e.high);
|
|
1696
1696
|
}
|
|
1697
1697
|
}
|
|
1698
|
-
const
|
|
1699
|
-
var
|
|
1700
|
-
class
|
|
1698
|
+
const nr = new E(0, 0), rr = 65536, De = rr * rr, uo = De * De, ho = new E(-1, -1);
|
|
1699
|
+
var fo = Object.defineProperty, po = (t, e, n) => e in t ? fo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, st = (t, e, n) => po(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1700
|
+
class ir {
|
|
1701
1701
|
constructor(e, n) {
|
|
1702
1702
|
st(this, "version"), st(this, "remoteQuerySet"), st(this, "queryPath"), st(this, "logger"), this.version = { querySet: 0, ts: E.fromNumber(0), identity: 0 }, this.remoteQuerySet = /* @__PURE__ */ new Map(), this.queryPath = e, this.logger = n;
|
|
1703
1703
|
}
|
|
@@ -1714,7 +1714,7 @@ class rr {
|
|
|
1714
1714
|
if (i)
|
|
1715
1715
|
for (const o of r.logLines)
|
|
1716
1716
|
dt(this.logger, "info", "query", i, o);
|
|
1717
|
-
const s =
|
|
1717
|
+
const s = Te(r.value ?? null);
|
|
1718
1718
|
this.remoteQuerySet.set(r.queryId, {
|
|
1719
1719
|
success: !0,
|
|
1720
1720
|
value: s,
|
|
@@ -1731,7 +1731,7 @@ class rr {
|
|
|
1731
1731
|
this.remoteQuerySet.set(r.queryId, {
|
|
1732
1732
|
success: !1,
|
|
1733
1733
|
errorMessage: r.errorMessage,
|
|
1734
|
-
errorData: s !== void 0 ?
|
|
1734
|
+
errorData: s !== void 0 ? Te(s) : void 0,
|
|
1735
1735
|
logLines: r.logLines
|
|
1736
1736
|
});
|
|
1737
1737
|
break;
|
|
@@ -1752,15 +1752,15 @@ class rr {
|
|
|
1752
1752
|
return this.version.ts;
|
|
1753
1753
|
}
|
|
1754
1754
|
}
|
|
1755
|
-
function
|
|
1755
|
+
function Lt(t) {
|
|
1756
1756
|
const e = He(t);
|
|
1757
1757
|
return E.fromBytesLE(Array.from(e));
|
|
1758
1758
|
}
|
|
1759
|
-
function
|
|
1759
|
+
function go(t) {
|
|
1760
1760
|
const e = new Uint8Array(t.toBytesLE());
|
|
1761
1761
|
return Je(e);
|
|
1762
1762
|
}
|
|
1763
|
-
function
|
|
1763
|
+
function sr(t) {
|
|
1764
1764
|
switch (t.type) {
|
|
1765
1765
|
case "FatalError":
|
|
1766
1766
|
case "AuthError":
|
|
@@ -1769,22 +1769,22 @@ function ir(t) {
|
|
|
1769
1769
|
case "Ping":
|
|
1770
1770
|
return { ...t };
|
|
1771
1771
|
case "MutationResponse":
|
|
1772
|
-
return t.success ? { ...t, ts:
|
|
1772
|
+
return t.success ? { ...t, ts: Lt(t.ts) } : { ...t };
|
|
1773
1773
|
case "Transition":
|
|
1774
1774
|
return {
|
|
1775
1775
|
...t,
|
|
1776
1776
|
startVersion: {
|
|
1777
1777
|
...t.startVersion,
|
|
1778
|
-
ts:
|
|
1778
|
+
ts: Lt(t.startVersion.ts)
|
|
1779
1779
|
},
|
|
1780
1780
|
endVersion: {
|
|
1781
1781
|
...t.endVersion,
|
|
1782
|
-
ts:
|
|
1782
|
+
ts: Lt(t.endVersion.ts)
|
|
1783
1783
|
}
|
|
1784
1784
|
};
|
|
1785
1785
|
}
|
|
1786
1786
|
}
|
|
1787
|
-
function
|
|
1787
|
+
function mo(t) {
|
|
1788
1788
|
switch (t.type) {
|
|
1789
1789
|
case "Authenticate":
|
|
1790
1790
|
case "ModifyQuerySet":
|
|
@@ -1795,20 +1795,20 @@ function uo(t) {
|
|
|
1795
1795
|
case "Connect":
|
|
1796
1796
|
return t.maxObservedTimestamp !== void 0 ? {
|
|
1797
1797
|
...t,
|
|
1798
|
-
maxObservedTimestamp:
|
|
1798
|
+
maxObservedTimestamp: go(t.maxObservedTimestamp)
|
|
1799
1799
|
} : { ...t, maxObservedTimestamp: void 0 };
|
|
1800
1800
|
}
|
|
1801
1801
|
}
|
|
1802
|
-
var
|
|
1803
|
-
const
|
|
1802
|
+
var xo = Object.defineProperty, bo = (t, e, n) => e in t ? xo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, C = (t, e, n) => bo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1803
|
+
const yo = 1e3, vo = 1001, _o = 1005, ko = 4040;
|
|
1804
1804
|
let ut;
|
|
1805
1805
|
function ve() {
|
|
1806
1806
|
return ut === void 0 && (ut = Date.now()), typeof performance > "u" || !performance.now ? Date.now() : Math.round(ut + performance.now());
|
|
1807
1807
|
}
|
|
1808
|
-
function
|
|
1808
|
+
function or() {
|
|
1809
1809
|
return `t=${Math.round((ve() - ut) / 100) / 10}s`;
|
|
1810
1810
|
}
|
|
1811
|
-
const
|
|
1811
|
+
const ui = {
|
|
1812
1812
|
// A known error, e.g. during a restart or push
|
|
1813
1813
|
InternalServerError: { timeout: 1e3 },
|
|
1814
1814
|
// ErrorMetadata::overloaded() messages that we realy should back off
|
|
@@ -1828,16 +1828,16 @@ const oi = {
|
|
|
1828
1828
|
SearchIndexTooLarge: { timeout: 3e3 },
|
|
1829
1829
|
TooManyWritesInTimePeriod: { timeout: 3e3 }
|
|
1830
1830
|
};
|
|
1831
|
-
function
|
|
1831
|
+
function wo(t) {
|
|
1832
1832
|
if (t === void 0) return "Unknown";
|
|
1833
1833
|
for (const e of Object.keys(
|
|
1834
|
-
|
|
1834
|
+
ui
|
|
1835
1835
|
))
|
|
1836
1836
|
if (t.startsWith(e))
|
|
1837
1837
|
return e;
|
|
1838
1838
|
return "Unknown";
|
|
1839
1839
|
}
|
|
1840
|
-
class
|
|
1840
|
+
class So {
|
|
1841
1841
|
constructor(e, n, r, i, s, o) {
|
|
1842
1842
|
this.markConnectionStateDirty = s, this.debug = o, C(this, "socket"), C(this, "connectionCount"), C(this, "_hasEverConnected", !1), C(this, "lastCloseReason"), C(this, "transitionChunkBuffer", null), C(this, "defaultInitialBackoff"), C(this, "maxBackoff"), C(this, "retries"), C(this, "serverInactivityThreshold"), C(this, "reconnectDueToServerInactivityTimeout"), C(this, "scheduledReconnect", null), C(this, "networkOnlineHandler", null), C(this, "pendingNetworkRecoveryInfo", null), C(this, "uri"), C(this, "onOpen"), C(this, "onResume"), C(this, "onMessage"), C(this, "webSocketConstructor"), C(this, "logger"), C(this, "onServerDisconnectError"), this.webSocketConstructor = r, this.socket = { state: "disconnected" }, this.connectionCount = 0, this.lastCloseReason = "InitialConnect", this.defaultInitialBackoff = 1e3, this.maxBackoff = 16e3, this.retries = 0, this.serverInactivityThreshold = 6e4, this.reconnectDueToServerInactivityTimeout = null, this.uri = e, this.onOpen = n.onOpen, this.onResume = n.onResume, this.onMessage = n.onMessage, this.onServerDisconnectError = n.onServerDisconnectError, this.logger = i, this.setupNetworkListener(), this.connect();
|
|
1843
1843
|
}
|
|
@@ -1870,7 +1870,7 @@ class yo {
|
|
|
1870
1870
|
if (this.transitionChunkBuffer.chunks.push(e.chunk), this.transitionChunkBuffer.chunks.length === e.totalParts) {
|
|
1871
1871
|
const n = this.transitionChunkBuffer.chunks.join("");
|
|
1872
1872
|
this.transitionChunkBuffer = null;
|
|
1873
|
-
const r =
|
|
1873
|
+
const r = sr(JSON.parse(n));
|
|
1874
1874
|
if (r.type !== "Transition")
|
|
1875
1875
|
throw new Error(
|
|
1876
1876
|
`Expected Transition, got ${r.type} after assembling chunks`
|
|
@@ -1904,10 +1904,10 @@ class yo {
|
|
|
1904
1904
|
clientTs: ve()
|
|
1905
1905
|
})), this.lastCloseReason !== "InitialConnect" && (this.lastCloseReason ? this.logger.log(
|
|
1906
1906
|
"WebSocket reconnected at",
|
|
1907
|
-
|
|
1907
|
+
or(),
|
|
1908
1908
|
"after disconnect due to",
|
|
1909
1909
|
this.lastCloseReason
|
|
1910
|
-
) : this.logger.log("WebSocket reconnected at",
|
|
1910
|
+
) : this.logger.log("WebSocket reconnected at", or())), this.connectionCount += 1, this.lastCloseReason = null, this.pendingNetworkRecoveryInfo !== null) {
|
|
1911
1911
|
const { timeSavedMs: n } = this.pendingNetworkRecoveryInfo;
|
|
1912
1912
|
this.pendingNetworkRecoveryInfo = null, this.sendMessage({
|
|
1913
1913
|
type: "Event",
|
|
@@ -1924,7 +1924,7 @@ class yo {
|
|
|
1924
1924
|
}, e.onmessage = (n) => {
|
|
1925
1925
|
this.resetServerInactivityTimeout();
|
|
1926
1926
|
const r = n.data.length;
|
|
1927
|
-
let i =
|
|
1927
|
+
let i = sr(JSON.parse(n.data));
|
|
1928
1928
|
if (this._logVerbose(`received ws message with type ${i.type}`), i.type === "Ping")
|
|
1929
1929
|
return;
|
|
1930
1930
|
if (i.type === "TransitionChunk") {
|
|
@@ -1942,12 +1942,12 @@ class yo {
|
|
|
1942
1942
|
transition: i
|
|
1943
1943
|
}), this.onMessage(i).hasSyncedPastLastReconnect && (this.retries = 0, this.markConnectionStateDirty());
|
|
1944
1944
|
}, e.onclose = (n) => {
|
|
1945
|
-
if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = n.reason || `closed with code ${n.code}`), n.code !==
|
|
1946
|
-
n.code !==
|
|
1945
|
+
if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = n.reason || `closed with code ${n.code}`), n.code !== yo && n.code !== vo && // This commonly gets fired on mobile apps when the app is backgrounded
|
|
1946
|
+
n.code !== _o && n.code !== ko) {
|
|
1947
1947
|
let i = `WebSocket closed with code ${n.code}`;
|
|
1948
1948
|
n.reason && (i += `: ${n.reason}`), this.logger.log(i), this.onServerDisconnectError && n.reason && this.onServerDisconnectError(i);
|
|
1949
1949
|
}
|
|
1950
|
-
const r =
|
|
1950
|
+
const r = wo(n.reason);
|
|
1951
1951
|
this.scheduleReconnect(r);
|
|
1952
1952
|
};
|
|
1953
1953
|
}
|
|
@@ -1969,7 +1969,7 @@ class yo {
|
|
|
1969
1969
|
} : {}
|
|
1970
1970
|
};
|
|
1971
1971
|
if (this.socket.state === "ready" && this.socket.paused === "no") {
|
|
1972
|
-
const r =
|
|
1972
|
+
const r = mo(e), i = JSON.stringify(r);
|
|
1973
1973
|
let s = !1;
|
|
1974
1974
|
try {
|
|
1975
1975
|
this.socket.ws.send(i), s = !0;
|
|
@@ -2172,7 +2172,7 @@ class yo {
|
|
|
2172
2172
|
this.socket = { ...this.socket, paused: "no" };
|
|
2173
2173
|
return;
|
|
2174
2174
|
case "ready":
|
|
2175
|
-
this.socket.paused === "uninitialized" ? (this.socket = { ...this.socket, paused: "no" }, this.onOpen({
|
|
2175
|
+
this.socket.paused === "uninitialized" ? (this.socket = { ...this.socket, paused: "no" }, this._hasEverConnected = !0, this.onOpen({
|
|
2176
2176
|
connectionCount: this.connectionCount,
|
|
2177
2177
|
lastCloseReason: this.lastCloseReason,
|
|
2178
2178
|
clientTs: ve()
|
|
@@ -2199,7 +2199,7 @@ class yo {
|
|
|
2199
2199
|
this.logger.logVerbose(e);
|
|
2200
2200
|
}
|
|
2201
2201
|
nextBackoff(e) {
|
|
2202
|
-
const r = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff :
|
|
2202
|
+
const r = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff : ui[e].timeout) * Math.pow(2, this.retries);
|
|
2203
2203
|
this.retries += 1;
|
|
2204
2204
|
const i = Math.min(r, this.maxBackoff), s = i * (Math.random() - 0.5);
|
|
2205
2205
|
return i + s;
|
|
@@ -2228,19 +2228,19 @@ class yo {
|
|
|
2228
2228
|
});
|
|
2229
2229
|
}
|
|
2230
2230
|
}
|
|
2231
|
-
function
|
|
2232
|
-
return
|
|
2231
|
+
function jo() {
|
|
2232
|
+
return Co();
|
|
2233
2233
|
}
|
|
2234
|
-
function
|
|
2234
|
+
function Co() {
|
|
2235
2235
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
|
|
2236
2236
|
const e = Math.random() * 16 | 0;
|
|
2237
2237
|
return (t === "x" ? e : e & 3 | 8).toString(16);
|
|
2238
2238
|
});
|
|
2239
2239
|
}
|
|
2240
|
-
class
|
|
2240
|
+
class Ne extends Error {
|
|
2241
2241
|
}
|
|
2242
|
-
|
|
2243
|
-
function
|
|
2242
|
+
Ne.prototype.name = "InvalidTokenError";
|
|
2243
|
+
function To(t) {
|
|
2244
2244
|
return decodeURIComponent(
|
|
2245
2245
|
atob(t).replace(/(.)/g, (e, n) => {
|
|
2246
2246
|
let r = n.charCodeAt(0).toString(16).toUpperCase();
|
|
@@ -2248,7 +2248,7 @@ function ko(t) {
|
|
|
2248
2248
|
})
|
|
2249
2249
|
);
|
|
2250
2250
|
}
|
|
2251
|
-
function
|
|
2251
|
+
function Ro(t) {
|
|
2252
2252
|
let e = t.replace(/-/g, "+").replace(/_/g, "/");
|
|
2253
2253
|
switch (e.length % 4) {
|
|
2254
2254
|
case 0:
|
|
@@ -2263,39 +2263,39 @@ function wo(t) {
|
|
|
2263
2263
|
throw new Error("base64 string is not of the correct length");
|
|
2264
2264
|
}
|
|
2265
2265
|
try {
|
|
2266
|
-
return
|
|
2266
|
+
return To(e);
|
|
2267
2267
|
} catch {
|
|
2268
2268
|
return atob(e);
|
|
2269
2269
|
}
|
|
2270
2270
|
}
|
|
2271
|
-
function
|
|
2271
|
+
function hi(t, e) {
|
|
2272
2272
|
if (typeof t != "string")
|
|
2273
|
-
throw new
|
|
2273
|
+
throw new Ne("Invalid token specified: must be a string");
|
|
2274
2274
|
e || (e = {});
|
|
2275
2275
|
const n = e.header === !0 ? 0 : 1, r = t.split(".")[n];
|
|
2276
2276
|
if (typeof r != "string")
|
|
2277
|
-
throw new
|
|
2277
|
+
throw new Ne(
|
|
2278
2278
|
`Invalid token specified: missing part #${n + 1}`
|
|
2279
2279
|
);
|
|
2280
2280
|
let i;
|
|
2281
2281
|
try {
|
|
2282
|
-
i =
|
|
2282
|
+
i = Ro(r);
|
|
2283
2283
|
} catch (s) {
|
|
2284
|
-
throw new
|
|
2284
|
+
throw new Ne(
|
|
2285
2285
|
`Invalid token specified: invalid base64 for part #${n + 1} (${s.message})`
|
|
2286
2286
|
);
|
|
2287
2287
|
}
|
|
2288
2288
|
try {
|
|
2289
2289
|
return JSON.parse(i);
|
|
2290
2290
|
} catch (s) {
|
|
2291
|
-
throw new
|
|
2291
|
+
throw new Ne(
|
|
2292
2292
|
`Invalid token specified: invalid json for part #${n + 1} (${s.message})`
|
|
2293
2293
|
);
|
|
2294
2294
|
}
|
|
2295
2295
|
}
|
|
2296
|
-
var
|
|
2297
|
-
const
|
|
2298
|
-
class
|
|
2296
|
+
var $o = Object.defineProperty, Ao = (t, e, n) => e in t ? $o(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, M = (t, e, n) => Ao(t, typeof e != "symbol" ? e + "" : e, n);
|
|
2297
|
+
const Io = 480 * 60 * 60 * 1e3, ar = 2;
|
|
2298
|
+
class Eo {
|
|
2299
2299
|
constructor(e, n, r) {
|
|
2300
2300
|
M(this, "authState", { state: "noAuth" }), M(this, "configVersion", 0), M(this, "syncState"), M(this, "authenticate"), M(this, "stopSocket"), M(this, "tryRestartSocket"), M(this, "pauseSocket"), M(this, "resumeSocket"), M(this, "clearAuth"), M(this, "logger"), M(this, "refreshTokenLeewaySeconds"), M(this, "tokenConfirmationAttempts", 0), this.syncState = e, this.authenticate = n.authenticate, this.stopSocket = n.stopSocket, this.tryRestartSocket = n.tryRestartSocket, this.pauseSocket = n.pauseSocket, this.resumeSocket = n.resumeSocket, this.clearAuth = n.clearAuth, this.logger = r.logger, this.refreshTokenLeewaySeconds = r.refreshTokenLeewaySeconds;
|
|
2301
2301
|
}
|
|
@@ -2346,14 +2346,14 @@ class To {
|
|
|
2346
2346
|
if (this._logVerbose(`attempting to reauthenticate: ${e.error}`), // No way to fetch another token, kaboom
|
|
2347
2347
|
this.authState.state === "noAuth" || // We failed on a fresh token. After a small number of retries, we give up
|
|
2348
2348
|
// and clear the auth state to avoid infinite retries.
|
|
2349
|
-
this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >=
|
|
2349
|
+
this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >= ar) {
|
|
2350
2350
|
this.logger.error(
|
|
2351
2351
|
`Failed to authenticate: "${e.error}", check your server auth config`
|
|
2352
2352
|
), this.syncState.hasAuth() && this.syncState.clearAuth(), this.authState.state !== "noAuth" && this.setAndReportAuthFailed(this.authState.config.onAuthChange);
|
|
2353
2353
|
return;
|
|
2354
2354
|
}
|
|
2355
2355
|
this.authState.state === "waitingForServerConfirmationOfFreshToken" && (this.tokenConfirmationAttempts++, this._logVerbose(
|
|
2356
|
-
`retrying reauthentication, ${
|
|
2356
|
+
`retrying reauthentication, ${ar - this.tokenConfirmationAttempts} attempts remaining`
|
|
2357
2357
|
)), await this.stopSocket();
|
|
2358
2358
|
const n = await this.fetchTokenAndGuardAgainstRace(
|
|
2359
2359
|
this.authState.config.fetchToken,
|
|
@@ -2418,7 +2418,7 @@ class To {
|
|
|
2418
2418
|
return;
|
|
2419
2419
|
}
|
|
2420
2420
|
let o = Math.min(
|
|
2421
|
-
|
|
2421
|
+
Io,
|
|
2422
2422
|
(s - this.refreshTokenLeewaySeconds) * 1e3
|
|
2423
2423
|
);
|
|
2424
2424
|
o <= 0 && (this.logger.warn(
|
|
@@ -2475,7 +2475,7 @@ class To {
|
|
|
2475
2475
|
}
|
|
2476
2476
|
decodeToken(e) {
|
|
2477
2477
|
try {
|
|
2478
|
-
return
|
|
2478
|
+
return hi(e);
|
|
2479
2479
|
} catch (n) {
|
|
2480
2480
|
return this._logVerbose(
|
|
2481
2481
|
`Error decoding token: ${n instanceof Error ? n.message : "Unknown error"}`
|
|
@@ -2486,34 +2486,34 @@ class To {
|
|
|
2486
2486
|
this.logger.logVerbose(`${e} [v${this.configVersion}]`);
|
|
2487
2487
|
}
|
|
2488
2488
|
}
|
|
2489
|
-
const
|
|
2489
|
+
const Po = [
|
|
2490
2490
|
"convexClientConstructed",
|
|
2491
2491
|
"convexWebSocketOpen",
|
|
2492
2492
|
"convexFirstMessageReceived"
|
|
2493
2493
|
];
|
|
2494
|
-
function
|
|
2494
|
+
function qo(t, e) {
|
|
2495
2495
|
const n = { sessionId: e };
|
|
2496
2496
|
typeof performance > "u" || !performance.mark || performance.mark(t, { detail: n });
|
|
2497
2497
|
}
|
|
2498
|
-
function
|
|
2498
|
+
function Mo(t) {
|
|
2499
2499
|
let e = t.name.slice(6);
|
|
2500
2500
|
return e = e.charAt(0).toLowerCase() + e.slice(1), {
|
|
2501
2501
|
name: e,
|
|
2502
2502
|
startTime: t.startTime
|
|
2503
2503
|
};
|
|
2504
2504
|
}
|
|
2505
|
-
function
|
|
2505
|
+
function Lo(t) {
|
|
2506
2506
|
if (typeof performance > "u" || !performance.getEntriesByName)
|
|
2507
2507
|
return [];
|
|
2508
2508
|
const e = [];
|
|
2509
|
-
for (const n of
|
|
2509
|
+
for (const n of Po) {
|
|
2510
2510
|
const r = performance.getEntriesByName(n).filter((i) => i.entryType === "mark").filter((i) => i.detail.sessionId === t);
|
|
2511
2511
|
e.push(...r);
|
|
2512
2512
|
}
|
|
2513
|
-
return e.map(
|
|
2513
|
+
return e.map(Mo);
|
|
2514
2514
|
}
|
|
2515
|
-
var
|
|
2516
|
-
class
|
|
2515
|
+
var Oo = Object.defineProperty, No = (t, e, n) => e in t ? Oo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, T = (t, e, n) => No(t, typeof e != "symbol" ? e + "" : e, n);
|
|
2516
|
+
class zo {
|
|
2517
2517
|
/**
|
|
2518
2518
|
* @param address - The url of your Convex deployment, often provided
|
|
2519
2519
|
* by an environment variable. E.g. `https://small-mouse-123.convex.cloud`.
|
|
@@ -2533,19 +2533,19 @@ class Po {
|
|
|
2533
2533
|
}
|
|
2534
2534
|
});
|
|
2535
2535
|
}), T(this, "mark", (f) => {
|
|
2536
|
-
this.debug &&
|
|
2536
|
+
this.debug && qo(f, this.sessionId);
|
|
2537
2537
|
}), typeof e == "object")
|
|
2538
2538
|
throw new Error(
|
|
2539
2539
|
"Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly."
|
|
2540
2540
|
);
|
|
2541
|
-
r?.skipConvexDeploymentUrlCheck !== !0 &&
|
|
2541
|
+
r?.skipConvexDeploymentUrlCheck !== !0 && Ps(e), r = { ...r };
|
|
2542
2542
|
const i = r.authRefreshTokenLeewaySeconds ?? 10;
|
|
2543
2543
|
let s = r.webSocketConstructor;
|
|
2544
2544
|
if (!s && typeof WebSocket > "u")
|
|
2545
2545
|
throw new Error(
|
|
2546
2546
|
"No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient"
|
|
2547
2547
|
);
|
|
2548
|
-
s = s || WebSocket, this.debug = r.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = r.logger === !1 ?
|
|
2548
|
+
s = s || WebSocket, this.debug = r.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = r.logger === !1 ? oi({ verbose: r.verbose ?? !1 }) : r.logger !== !0 && r.logger ? r.logger : si({ verbose: r.verbose ?? !1 });
|
|
2549
2549
|
const o = e.search("://");
|
|
2550
2550
|
if (o === -1)
|
|
2551
2551
|
throw new Error("Provided address was not an absolute URL.");
|
|
@@ -2557,18 +2557,18 @@ class Po {
|
|
|
2557
2557
|
u = "wss";
|
|
2558
2558
|
else
|
|
2559
2559
|
throw new Error(`Unknown parent protocol ${a}`);
|
|
2560
|
-
const d = `${u}://${l}/api/${
|
|
2561
|
-
this.state = new
|
|
2560
|
+
const d = `${u}://${l}/api/${Yn}/sync`;
|
|
2561
|
+
this.state = new Zs(), this.remoteQuerySet = new ir(
|
|
2562
2562
|
(f) => this.state.queryPath(f),
|
|
2563
2563
|
this.logger
|
|
2564
|
-
), this.requestManager = new
|
|
2564
|
+
), this.requestManager = new eo(
|
|
2565
2565
|
this.logger,
|
|
2566
2566
|
this.markConnectionStateDirty
|
|
2567
2567
|
);
|
|
2568
2568
|
const c = () => {
|
|
2569
2569
|
this.webSocketManager.pause(), this.state.pause();
|
|
2570
2570
|
};
|
|
2571
|
-
this.authenticationManager = new
|
|
2571
|
+
this.authenticationManager = new Eo(
|
|
2572
2572
|
this.state,
|
|
2573
2573
|
{
|
|
2574
2574
|
authenticate: (f) => {
|
|
@@ -2587,9 +2587,9 @@ class Po {
|
|
|
2587
2587
|
logger: this.logger,
|
|
2588
2588
|
refreshTokenLeewaySeconds: i
|
|
2589
2589
|
}
|
|
2590
|
-
), this.optimisticQueryResults = new
|
|
2590
|
+
), this.optimisticQueryResults = new ao(), this.addOnTransitionHandler((f) => {
|
|
2591
2591
|
n(f.queries.map((g) => g.token));
|
|
2592
|
-
}), this._nextRequestId = 0, this._sessionId =
|
|
2592
|
+
}), this._nextRequestId = 0, this._sessionId = jo();
|
|
2593
2593
|
const { unsavedChangesWarning: p } = r;
|
|
2594
2594
|
if (typeof window > "u" || typeof window.addEventListener > "u") {
|
|
2595
2595
|
if (p === !0)
|
|
@@ -2603,7 +2603,7 @@ class Po {
|
|
|
2603
2603
|
return (f || window.event).returnValue = g, g;
|
|
2604
2604
|
}
|
|
2605
2605
|
});
|
|
2606
|
-
this.webSocketManager = new
|
|
2606
|
+
this.webSocketManager = new So(
|
|
2607
2607
|
d,
|
|
2608
2608
|
{
|
|
2609
2609
|
onOpen: (f) => {
|
|
@@ -2612,20 +2612,20 @@ class Po {
|
|
|
2612
2612
|
type: "Connect",
|
|
2613
2613
|
sessionId: this._sessionId,
|
|
2614
2614
|
maxObservedTimestamp: this.maxObservedTimestamp
|
|
2615
|
-
}), this.remoteQuerySet = new
|
|
2615
|
+
}), this.remoteQuerySet = new ir(
|
|
2616
2616
|
(w) => this.state.queryPath(w),
|
|
2617
2617
|
this.logger
|
|
2618
2618
|
);
|
|
2619
|
-
const [g,
|
|
2620
|
-
|
|
2619
|
+
const [g, x] = this.state.restart();
|
|
2620
|
+
x && this.webSocketManager.sendMessage(x), this.webSocketManager.sendMessage(g);
|
|
2621
2621
|
for (const w of this.requestManager.restart())
|
|
2622
2622
|
this.webSocketManager.sendMessage(w);
|
|
2623
2623
|
},
|
|
2624
2624
|
onResume: () => {
|
|
2625
2625
|
const [f, g] = this.state.resume();
|
|
2626
2626
|
g && this.webSocketManager.sendMessage(g), f && this.webSocketManager.sendMessage(f);
|
|
2627
|
-
for (const
|
|
2628
|
-
this.webSocketManager.sendMessage(
|
|
2627
|
+
for (const x of this.requestManager.resume())
|
|
2628
|
+
this.webSocketManager.sendMessage(x);
|
|
2629
2629
|
},
|
|
2630
2630
|
onMessage: (f) => {
|
|
2631
2631
|
switch (this.firstMessageReceived || (this.firstMessageReceived = !0, this.mark("convexFirstMessageReceived"), this.reportMarks()), f.type) {
|
|
@@ -2659,7 +2659,7 @@ class Po {
|
|
|
2659
2659
|
break;
|
|
2660
2660
|
}
|
|
2661
2661
|
case "FatalError": {
|
|
2662
|
-
const g =
|
|
2662
|
+
const g = Js(this.logger, f.error);
|
|
2663
2663
|
throw this.webSocketManager.terminate(), g;
|
|
2664
2664
|
}
|
|
2665
2665
|
}
|
|
@@ -2759,7 +2759,7 @@ class Po {
|
|
|
2759
2759
|
let n = {};
|
|
2760
2760
|
if (e && e.tokenType === "User")
|
|
2761
2761
|
try {
|
|
2762
|
-
n = e ?
|
|
2762
|
+
n = e ? hi(e.value) : {};
|
|
2763
2763
|
} catch {
|
|
2764
2764
|
n = {};
|
|
2765
2765
|
}
|
|
@@ -2805,7 +2805,7 @@ class Po {
|
|
|
2805
2805
|
* query and an `unsubscribe` callback.
|
|
2806
2806
|
*/
|
|
2807
2807
|
subscribe(e, n, r) {
|
|
2808
|
-
const i =
|
|
2808
|
+
const i = re(n), { modification: s, queryToken: o, unsubscribe: l } = this.state.subscribe(
|
|
2809
2809
|
e,
|
|
2810
2810
|
i,
|
|
2811
2811
|
r?.journal,
|
|
@@ -2826,7 +2826,7 @@ class Po {
|
|
|
2826
2826
|
* query or its value has been set optimistically.
|
|
2827
2827
|
*/
|
|
2828
2828
|
localQueryResult(e, n) {
|
|
2829
|
-
const r =
|
|
2829
|
+
const r = re(n), i = ue(e, r);
|
|
2830
2830
|
return this.optimisticQueryResults.queryResult(i);
|
|
2831
2831
|
}
|
|
2832
2832
|
/**
|
|
@@ -2854,7 +2854,7 @@ class Po {
|
|
|
2854
2854
|
* @internal
|
|
2855
2855
|
*/
|
|
2856
2856
|
localQueryLogs(e, n) {
|
|
2857
|
-
const r =
|
|
2857
|
+
const r = re(n), i = ue(e, r);
|
|
2858
2858
|
return this.optimisticQueryResults.queryLogs(i);
|
|
2859
2859
|
}
|
|
2860
2860
|
/**
|
|
@@ -2867,7 +2867,7 @@ class Po {
|
|
|
2867
2867
|
* @returns The query's {@link QueryJournal} or `undefined`.
|
|
2868
2868
|
*/
|
|
2869
2869
|
queryJournal(e, n) {
|
|
2870
|
-
const r =
|
|
2870
|
+
const r = re(n), i = ue(e, r);
|
|
2871
2871
|
return this.state.queryJournal(i);
|
|
2872
2872
|
}
|
|
2873
2873
|
/**
|
|
@@ -2918,9 +2918,9 @@ class Po {
|
|
|
2918
2918
|
async mutation(e, n, r) {
|
|
2919
2919
|
const i = await this.mutationInternal(e, n, r);
|
|
2920
2920
|
if (!i.success)
|
|
2921
|
-
throw i.errorData !== void 0 ?
|
|
2921
|
+
throw i.errorData !== void 0 ? Zt(
|
|
2922
2922
|
i,
|
|
2923
|
-
new
|
|
2923
|
+
new Kt(
|
|
2924
2924
|
_e("mutation", e, i)
|
|
2925
2925
|
)
|
|
2926
2926
|
) : new Error(_e("mutation", e, i));
|
|
@@ -2942,7 +2942,7 @@ class Po {
|
|
|
2942
2942
|
* @internal
|
|
2943
2943
|
*/
|
|
2944
2944
|
enqueueMutation(e, n, r, i) {
|
|
2945
|
-
const s =
|
|
2945
|
+
const s = re(n);
|
|
2946
2946
|
this.tryReportLongDisconnect();
|
|
2947
2947
|
const o = this.nextRequestId;
|
|
2948
2948
|
if (this._nextRequestId++, r !== void 0) {
|
|
@@ -2959,14 +2959,14 @@ class Po {
|
|
|
2959
2959
|
c,
|
|
2960
2960
|
o
|
|
2961
2961
|
).map((g) => {
|
|
2962
|
-
const
|
|
2962
|
+
const x = this.localQueryResultByToken(g);
|
|
2963
2963
|
return {
|
|
2964
2964
|
token: g,
|
|
2965
2965
|
modification: {
|
|
2966
2966
|
kind: "Updated",
|
|
2967
|
-
result:
|
|
2967
|
+
result: x === void 0 ? void 0 : {
|
|
2968
2968
|
success: !0,
|
|
2969
|
-
value:
|
|
2969
|
+
value: x,
|
|
2970
2970
|
logLines: []
|
|
2971
2971
|
}
|
|
2972
2972
|
}
|
|
@@ -2984,7 +2984,7 @@ class Po {
|
|
|
2984
2984
|
requestId: o,
|
|
2985
2985
|
udfPath: e,
|
|
2986
2986
|
componentPath: i,
|
|
2987
|
-
args: [
|
|
2987
|
+
args: [te(s)]
|
|
2988
2988
|
}, a = this.webSocketManager.sendMessage(l), u = this.requestManager.request(l, a);
|
|
2989
2989
|
return {
|
|
2990
2990
|
requestId: o,
|
|
@@ -3002,9 +3002,9 @@ class Po {
|
|
|
3002
3002
|
async action(e, n) {
|
|
3003
3003
|
const r = await this.actionInternal(e, n);
|
|
3004
3004
|
if (!r.success)
|
|
3005
|
-
throw r.errorData !== void 0 ?
|
|
3005
|
+
throw r.errorData !== void 0 ? Zt(
|
|
3006
3006
|
r,
|
|
3007
|
-
new
|
|
3007
|
+
new Kt(_e("action", e, r))
|
|
3008
3008
|
) : new Error(_e("action", e, r));
|
|
3009
3009
|
return r.value;
|
|
3010
3010
|
}
|
|
@@ -3012,14 +3012,14 @@ class Po {
|
|
|
3012
3012
|
* @internal
|
|
3013
3013
|
*/
|
|
3014
3014
|
async actionInternal(e, n, r) {
|
|
3015
|
-
const i =
|
|
3015
|
+
const i = re(n), s = this.nextRequestId;
|
|
3016
3016
|
this._nextRequestId++, this.tryReportLongDisconnect();
|
|
3017
3017
|
const o = {
|
|
3018
3018
|
type: "Action",
|
|
3019
3019
|
requestId: s,
|
|
3020
3020
|
udfPath: e,
|
|
3021
3021
|
componentPath: r,
|
|
3022
|
-
args: [
|
|
3022
|
+
args: [te(i)]
|
|
3023
3023
|
}, l = this.webSocketManager.sendMessage(o);
|
|
3024
3024
|
return this.requestManager.request(o, l);
|
|
3025
3025
|
}
|
|
@@ -3061,7 +3061,7 @@ class Po {
|
|
|
3061
3061
|
*/
|
|
3062
3062
|
reportMarks() {
|
|
3063
3063
|
if (this.debug) {
|
|
3064
|
-
const e =
|
|
3064
|
+
const e = Lo(this.sessionId);
|
|
3065
3065
|
this.webSocketManager.sendMessage({
|
|
3066
3066
|
type: "Event",
|
|
3067
3067
|
eventType: "ClientConnect",
|
|
@@ -3080,7 +3080,7 @@ class Po {
|
|
|
3080
3080
|
method: "POST",
|
|
3081
3081
|
headers: {
|
|
3082
3082
|
"Content-Type": "application/json",
|
|
3083
|
-
"Convex-Client": `npm-${
|
|
3083
|
+
"Convex-Client": `npm-${Yn}`
|
|
3084
3084
|
},
|
|
3085
3085
|
body: JSON.stringify({ event: "LongWebsocketDisconnect" })
|
|
3086
3086
|
}).then((r) => {
|
|
@@ -3093,15 +3093,15 @@ class Po {
|
|
|
3093
3093
|
});
|
|
3094
3094
|
}
|
|
3095
3095
|
}
|
|
3096
|
-
function
|
|
3096
|
+
function Ot(t) {
|
|
3097
3097
|
if (typeof t != "object" || t === null || !Array.isArray(t.page) || typeof t.isDone != "boolean" || typeof t.continueCursor != "string")
|
|
3098
3098
|
throw new Error(`Not a valid paginated query result: ${t?.toString()}`);
|
|
3099
3099
|
return t;
|
|
3100
3100
|
}
|
|
3101
|
-
var
|
|
3102
|
-
class
|
|
3101
|
+
var Qo = Object.defineProperty, Bo = (t, e, n) => e in t ? Qo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, lr = (t, e, n) => Bo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3102
|
+
class Fo {
|
|
3103
3103
|
constructor(e, n) {
|
|
3104
|
-
this.client = e, this.onTransition = n,
|
|
3104
|
+
this.client = e, this.onTransition = n, lr(this, "paginatedQuerySet", /* @__PURE__ */ new Map()), lr(this, "lastTransitionTs"), this.lastTransitionTs = E.fromNumber(0), this.client.addOnTransitionHandler(
|
|
3105
3105
|
(r) => this.onBaseTransition(r)
|
|
3106
3106
|
);
|
|
3107
3107
|
}
|
|
@@ -3114,7 +3114,7 @@ class Oo {
|
|
|
3114
3114
|
* @returns Object with paginatedQueryToken and unsubscribe function
|
|
3115
3115
|
*/
|
|
3116
3116
|
subscribe(e, n, r) {
|
|
3117
|
-
const i = de(e), s =
|
|
3117
|
+
const i = de(e), s = tr(
|
|
3118
3118
|
i,
|
|
3119
3119
|
n,
|
|
3120
3120
|
r
|
|
@@ -3145,7 +3145,7 @@ class Oo {
|
|
|
3145
3145
|
* Throws an error when one of the pages has errored.
|
|
3146
3146
|
*/
|
|
3147
3147
|
localQueryResult(e, n, r) {
|
|
3148
|
-
const i = de(e), s =
|
|
3148
|
+
const i = de(e), s = tr(
|
|
3149
3149
|
i,
|
|
3150
3150
|
n,
|
|
3151
3151
|
r
|
|
@@ -3173,7 +3173,7 @@ class Oo {
|
|
|
3173
3173
|
s = !0, o = !1;
|
|
3174
3174
|
continue;
|
|
3175
3175
|
}
|
|
3176
|
-
const d =
|
|
3176
|
+
const d = Ot(u);
|
|
3177
3177
|
i = i.concat(d.page), o = !!d.isDone;
|
|
3178
3178
|
}
|
|
3179
3179
|
let l;
|
|
@@ -3218,7 +3218,7 @@ class Oo {
|
|
|
3218
3218
|
const r = this.queryTokenForLastPageOfPaginatedQuery(e), i = this.client.localQueryResultByToken(r);
|
|
3219
3219
|
if (!i)
|
|
3220
3220
|
return !1;
|
|
3221
|
-
const s =
|
|
3221
|
+
const s = Ot(i);
|
|
3222
3222
|
if (s.isDone)
|
|
3223
3223
|
return !1;
|
|
3224
3224
|
this.addPageToPaginatedQuery(
|
|
@@ -3276,7 +3276,7 @@ class Oo {
|
|
|
3276
3276
|
const u = o.get(a).queryToken, d = n(u);
|
|
3277
3277
|
if (!d)
|
|
3278
3278
|
continue;
|
|
3279
|
-
const c =
|
|
3279
|
+
const c = Ot(d);
|
|
3280
3280
|
c.splitCursor && (c.pageStatus === "SplitRecommended" || c.pageStatus === "SplitRequired" || // This client-driven page splitting condition will change in the future.
|
|
3281
3281
|
c.page.length > i.options.initialNumItems * 2) && this.splitPaginatedQueryPage(
|
|
3282
3282
|
i,
|
|
@@ -3374,7 +3374,7 @@ class Oo {
|
|
|
3374
3374
|
return n;
|
|
3375
3375
|
}
|
|
3376
3376
|
}
|
|
3377
|
-
function
|
|
3377
|
+
function Do({
|
|
3378
3378
|
// (Synchronously) returns the current value of our subscription.
|
|
3379
3379
|
getCurrentValue: t,
|
|
3380
3380
|
// This function is passed an event handler to attach to the subscription.
|
|
@@ -3391,7 +3391,7 @@ function No({
|
|
|
3391
3391
|
getCurrentValue: t,
|
|
3392
3392
|
subscribe: e,
|
|
3393
3393
|
value: i
|
|
3394
|
-
})),
|
|
3394
|
+
})), z(() => {
|
|
3395
3395
|
let s = !1;
|
|
3396
3396
|
const o = () => {
|
|
3397
3397
|
s || r((a) => {
|
|
@@ -3406,34 +3406,34 @@ function No({
|
|
|
3406
3406
|
};
|
|
3407
3407
|
}, [t, e]), i;
|
|
3408
3408
|
}
|
|
3409
|
-
var
|
|
3410
|
-
const
|
|
3411
|
-
if (typeof
|
|
3409
|
+
var Uo = Object.defineProperty, Vo = (t, e, n) => e in t ? Uo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ne = (t, e, n) => Vo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3410
|
+
const Wo = 5e3;
|
|
3411
|
+
if (typeof dn > "u")
|
|
3412
3412
|
throw new Error("Required dependency 'react' not found");
|
|
3413
|
-
function
|
|
3413
|
+
function di(t, e, n) {
|
|
3414
3414
|
function r(i) {
|
|
3415
|
-
return
|
|
3415
|
+
return Ko(i), e.mutation(t, i, {
|
|
3416
3416
|
optimisticUpdate: n
|
|
3417
3417
|
});
|
|
3418
3418
|
}
|
|
3419
3419
|
return r.withOptimisticUpdate = function(s) {
|
|
3420
3420
|
if (n !== void 0)
|
|
3421
3421
|
throw new Error(
|
|
3422
|
-
`Already specified optimistic update for mutation ${
|
|
3422
|
+
`Already specified optimistic update for mutation ${P(
|
|
3423
3423
|
t
|
|
3424
3424
|
)}`
|
|
3425
3425
|
);
|
|
3426
|
-
return
|
|
3426
|
+
return di(t, e, s);
|
|
3427
3427
|
}, r;
|
|
3428
3428
|
}
|
|
3429
|
-
class
|
|
3429
|
+
class Ho {
|
|
3430
3430
|
/**
|
|
3431
3431
|
* @param address - The url of your Convex deployment, often provided
|
|
3432
3432
|
* by an environment variable. E.g. `https://small-mouse-123.convex.cloud`.
|
|
3433
3433
|
* @param options - See {@link ConvexReactClientOptions} for a full description.
|
|
3434
3434
|
*/
|
|
3435
3435
|
constructor(e, n) {
|
|
3436
|
-
if (
|
|
3436
|
+
if (ne(this, "address"), ne(this, "cachedSync"), ne(this, "cachedPaginatedQueryClient"), ne(this, "listeners"), ne(this, "options"), ne(this, "closed", !1), ne(this, "_logger"), ne(this, "adminAuth"), ne(this, "fakeUserIdentity"), e === void 0)
|
|
3437
3437
|
throw new Error(
|
|
3438
3438
|
"No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated."
|
|
3439
3439
|
);
|
|
@@ -3443,7 +3443,7 @@ class Fo {
|
|
|
3443
3443
|
);
|
|
3444
3444
|
if (!e.includes("://"))
|
|
3445
3445
|
throw new Error("Provided address was not an absolute URL.");
|
|
3446
|
-
this.address = e, this.listeners = /* @__PURE__ */ new Map(), this._logger = n?.logger === !1 ?
|
|
3446
|
+
this.address = e, this.listeners = /* @__PURE__ */ new Map(), this._logger = n?.logger === !1 ? oi({ verbose: n?.verbose ?? !1 }) : n?.logger !== !0 && n?.logger ? n.logger : si({ verbose: n?.verbose ?? !1 }), this.options = { ...n, logger: this._logger };
|
|
3447
3447
|
}
|
|
3448
3448
|
/**
|
|
3449
3449
|
* Return the address for this client, useful for creating a new client.
|
|
@@ -3463,13 +3463,13 @@ class Fo {
|
|
|
3463
3463
|
get sync() {
|
|
3464
3464
|
if (this.closed)
|
|
3465
3465
|
throw new Error("ConvexReactClient has already been closed.");
|
|
3466
|
-
return this.cachedSync ? this.cachedSync : (this.cachedSync = new
|
|
3466
|
+
return this.cachedSync ? this.cachedSync : (this.cachedSync = new zo(
|
|
3467
3467
|
this.address,
|
|
3468
3468
|
() => {
|
|
3469
3469
|
},
|
|
3470
3470
|
// Use the PaginatedQueryClient's transition instead.
|
|
3471
3471
|
this.options
|
|
3472
|
-
), this.adminAuth && this.cachedSync.setAdminAuth(this.adminAuth, this.fakeUserIdentity), this.cachedPaginatedQueryClient = new
|
|
3472
|
+
), this.adminAuth && this.cachedSync.setAdminAuth(this.adminAuth, this.fakeUserIdentity), this.cachedPaginatedQueryClient = new Fo(
|
|
3473
3473
|
this.cachedSync,
|
|
3474
3474
|
(e) => this.handleTransition(e)
|
|
3475
3475
|
), this.cachedSync);
|
|
@@ -3534,7 +3534,7 @@ class Fo {
|
|
|
3534
3534
|
* @returns The {@link Watch} object.
|
|
3535
3535
|
*/
|
|
3536
3536
|
watchQuery(e, ...n) {
|
|
3537
|
-
const [r, i] = n, s =
|
|
3537
|
+
const [r, i] = n, s = P(e);
|
|
3538
3538
|
return {
|
|
3539
3539
|
onUpdate: (o) => {
|
|
3540
3540
|
const { queryToken: l, unsubscribe: a } = this.sync.subscribe(
|
|
@@ -3579,7 +3579,7 @@ class Fo {
|
|
|
3579
3579
|
* an optional extendSubscriptionFor for how long to subscribe to the query.
|
|
3580
3580
|
*/
|
|
3581
3581
|
prewarmQuery(e) {
|
|
3582
|
-
const n = e.extendSubscriptionFor ??
|
|
3582
|
+
const n = e.extendSubscriptionFor ?? Wo, i = this.watchQuery(e.query, e.args || {}).onUpdate(() => {
|
|
3583
3583
|
});
|
|
3584
3584
|
setTimeout(i, n);
|
|
3585
3585
|
}
|
|
@@ -3601,7 +3601,7 @@ class Fo {
|
|
|
3601
3601
|
* @internal
|
|
3602
3602
|
*/
|
|
3603
3603
|
watchPaginatedQuery(e, n, r) {
|
|
3604
|
-
const i =
|
|
3604
|
+
const i = P(e);
|
|
3605
3605
|
return {
|
|
3606
3606
|
onUpdate: (s) => {
|
|
3607
3607
|
const { paginatedQueryToken: o, unsubscribe: l } = this.paginatedQueryClient.subscribe(i, n || {}, r), a = this.listeners.get(o);
|
|
@@ -3626,7 +3626,7 @@ class Fo {
|
|
|
3626
3626
|
* @returns A promise of the mutation's result.
|
|
3627
3627
|
*/
|
|
3628
3628
|
mutation(e, ...n) {
|
|
3629
|
-
const [r, i] = n, s =
|
|
3629
|
+
const [r, i] = n, s = P(e);
|
|
3630
3630
|
return this.sync.mutation(s, r, i);
|
|
3631
3631
|
}
|
|
3632
3632
|
/**
|
|
@@ -3639,7 +3639,7 @@ class Fo {
|
|
|
3639
3639
|
* @returns A promise of the action's result.
|
|
3640
3640
|
*/
|
|
3641
3641
|
action(e, ...n) {
|
|
3642
|
-
const r =
|
|
3642
|
+
const r = P(e);
|
|
3643
3643
|
return this.sync.action(r, ...n);
|
|
3644
3644
|
}
|
|
3645
3645
|
/**
|
|
@@ -3730,57 +3730,57 @@ class Fo {
|
|
|
3730
3730
|
}
|
|
3731
3731
|
}
|
|
3732
3732
|
}
|
|
3733
|
-
const
|
|
3733
|
+
const pn = dn.createContext(
|
|
3734
3734
|
void 0
|
|
3735
3735
|
// in the future this will be a mocked client for testing
|
|
3736
3736
|
);
|
|
3737
|
-
function
|
|
3738
|
-
return
|
|
3737
|
+
function Jo() {
|
|
3738
|
+
return kt(pn);
|
|
3739
3739
|
}
|
|
3740
|
-
const
|
|
3741
|
-
|
|
3740
|
+
const Go = ({ client: t, children: e }) => dn.createElement(
|
|
3741
|
+
pn.Provider,
|
|
3742
3742
|
{ value: t },
|
|
3743
3743
|
e
|
|
3744
3744
|
);
|
|
3745
|
-
function
|
|
3746
|
-
const n = e[0] === "skip", r = e[0] === "skip" ? {} :
|
|
3745
|
+
function cr(t, ...e) {
|
|
3746
|
+
const n = e[0] === "skip", r = e[0] === "skip" ? {} : re(e[0]), i = typeof t == "string" ? li(t) : t, s = P(i), o = V(
|
|
3747
3747
|
() => n ? {} : { query: { query: i, args: r } },
|
|
3748
3748
|
// Stringify args so args that are semantically the same don't trigger a
|
|
3749
3749
|
// rerender. Saves developers from adding `useMemo` on every args usage.
|
|
3750
3750
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3751
|
-
[JSON.stringify(
|
|
3752
|
-
), a =
|
|
3751
|
+
[JSON.stringify(te(r)), s, n]
|
|
3752
|
+
), a = ea(o).query;
|
|
3753
3753
|
if (a instanceof Error)
|
|
3754
3754
|
throw a;
|
|
3755
3755
|
return a;
|
|
3756
3756
|
}
|
|
3757
|
-
function
|
|
3758
|
-
const e = typeof t == "string" ?
|
|
3757
|
+
function St(t) {
|
|
3758
|
+
const e = typeof t == "string" ? li(t) : t, n = kt(pn);
|
|
3759
3759
|
if (n === void 0)
|
|
3760
3760
|
throw new Error(
|
|
3761
3761
|
"Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app"
|
|
3762
3762
|
);
|
|
3763
|
-
return
|
|
3764
|
-
() =>
|
|
3763
|
+
return V(
|
|
3764
|
+
() => di(e, n),
|
|
3765
3765
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3766
|
-
[n,
|
|
3766
|
+
[n, P(e)]
|
|
3767
3767
|
);
|
|
3768
3768
|
}
|
|
3769
|
-
function
|
|
3769
|
+
function Ko(t) {
|
|
3770
3770
|
if (typeof t == "object" && t !== null && "bubbles" in t && "persist" in t && "isDefaultPrevented" in t)
|
|
3771
3771
|
throw new Error(
|
|
3772
3772
|
"Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler."
|
|
3773
3773
|
);
|
|
3774
3774
|
}
|
|
3775
|
-
var
|
|
3776
|
-
class
|
|
3775
|
+
var Zo = Object.defineProperty, Xo = (t, e, n) => e in t ? Zo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Nt = (t, e, n) => Xo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3776
|
+
class Yo {
|
|
3777
3777
|
constructor(e) {
|
|
3778
|
-
|
|
3778
|
+
Nt(this, "createWatch"), Nt(this, "queries"), Nt(this, "listeners"), this.createWatch = e, this.queries = {}, this.listeners = /* @__PURE__ */ new Set();
|
|
3779
3779
|
}
|
|
3780
3780
|
setQueries(e) {
|
|
3781
3781
|
for (const n of Object.keys(e)) {
|
|
3782
3782
|
const { query: r, args: i, paginationOptions: s } = e[n];
|
|
3783
|
-
if (
|
|
3783
|
+
if (P(r), this.queries[n] === void 0)
|
|
3784
3784
|
this.addQuery(
|
|
3785
3785
|
n,
|
|
3786
3786
|
r,
|
|
@@ -3789,7 +3789,7 @@ class Jo {
|
|
|
3789
3789
|
);
|
|
3790
3790
|
else {
|
|
3791
3791
|
const o = this.queries[n];
|
|
3792
|
-
(
|
|
3792
|
+
(P(r) !== P(o.query) || JSON.stringify(te(i)) !== JSON.stringify(te(o.args)) || JSON.stringify(s) !== JSON.stringify(o.paginationOptions)) && (this.removeQuery(n), this.addQuery(
|
|
3793
3793
|
n,
|
|
3794
3794
|
r,
|
|
3795
3795
|
i,
|
|
@@ -3809,7 +3809,7 @@ class Jo {
|
|
|
3809
3809
|
const n = {};
|
|
3810
3810
|
for (const r of Object.keys(e)) {
|
|
3811
3811
|
const { query: i, args: s } = e[r], o = e[r].paginationOptions;
|
|
3812
|
-
|
|
3812
|
+
P(i);
|
|
3813
3813
|
const l = this.createWatch(
|
|
3814
3814
|
i,
|
|
3815
3815
|
s,
|
|
@@ -3874,40 +3874,40 @@ class Jo {
|
|
|
3874
3874
|
e();
|
|
3875
3875
|
}
|
|
3876
3876
|
}
|
|
3877
|
-
function
|
|
3878
|
-
const e =
|
|
3877
|
+
function ea(t) {
|
|
3878
|
+
const e = Jo();
|
|
3879
3879
|
if (e === void 0)
|
|
3880
3880
|
throw new Error(
|
|
3881
3881
|
"Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app"
|
|
3882
3882
|
);
|
|
3883
|
-
const n =
|
|
3883
|
+
const n = V(() => (r, i, {
|
|
3884
3884
|
journal: s,
|
|
3885
3885
|
paginationOptions: o
|
|
3886
3886
|
}) => o ? e.watchPaginatedQuery(r, i, o) : e.watchQuery(r, i, s ? { journal: s } : {}), [e]);
|
|
3887
|
-
return
|
|
3887
|
+
return ta(t, n);
|
|
3888
3888
|
}
|
|
3889
|
-
function
|
|
3890
|
-
const [n] = R(() => new
|
|
3891
|
-
n.createWatch !== e && n.setCreateWatch(e),
|
|
3892
|
-
const r =
|
|
3889
|
+
function ta(t, e) {
|
|
3890
|
+
const [n] = R(() => new Yo(e));
|
|
3891
|
+
n.createWatch !== e && n.setCreateWatch(e), z(() => () => n.destroy(), [n]);
|
|
3892
|
+
const r = V(
|
|
3893
3893
|
() => ({
|
|
3894
3894
|
getCurrentValue: () => n.getLocalResults(t),
|
|
3895
3895
|
subscribe: (i) => (n.setQueries(t), n.subscribe(i))
|
|
3896
3896
|
}),
|
|
3897
3897
|
[n, t]
|
|
3898
3898
|
);
|
|
3899
|
-
return
|
|
3899
|
+
return Do(r);
|
|
3900
3900
|
}
|
|
3901
|
-
var
|
|
3902
|
-
function
|
|
3901
|
+
var na = /* @__PURE__ */ Symbol.for("preact-signals");
|
|
3902
|
+
function jt() {
|
|
3903
3903
|
if (se > 1)
|
|
3904
3904
|
se--;
|
|
3905
3905
|
else {
|
|
3906
3906
|
for (var t, e = !1; Ue !== void 0; ) {
|
|
3907
3907
|
var n = Ue;
|
|
3908
|
-
for (Ue = void 0,
|
|
3908
|
+
for (Ue = void 0, Xt++; n !== void 0; ) {
|
|
3909
3909
|
var r = n.o;
|
|
3910
|
-
if (n.o = void 0, n.f &= -3, !(8 & n.f) &&
|
|
3910
|
+
if (n.o = void 0, n.f &= -3, !(8 & n.f) && gi(n)) try {
|
|
3911
3911
|
n.c();
|
|
3912
3912
|
} catch (i) {
|
|
3913
3913
|
e || (t = i, e = !0);
|
|
@@ -3915,20 +3915,20 @@ function St() {
|
|
|
3915
3915
|
n = r;
|
|
3916
3916
|
}
|
|
3917
3917
|
}
|
|
3918
|
-
if (
|
|
3918
|
+
if (Xt = 0, se--, e) throw t;
|
|
3919
3919
|
}
|
|
3920
3920
|
}
|
|
3921
|
-
function
|
|
3921
|
+
function ra(t) {
|
|
3922
3922
|
if (se > 0) return t();
|
|
3923
3923
|
se++;
|
|
3924
3924
|
try {
|
|
3925
3925
|
return t();
|
|
3926
3926
|
} finally {
|
|
3927
|
-
|
|
3927
|
+
jt();
|
|
3928
3928
|
}
|
|
3929
3929
|
}
|
|
3930
3930
|
var y = void 0;
|
|
3931
|
-
function
|
|
3931
|
+
function fi(t) {
|
|
3932
3932
|
var e = y;
|
|
3933
3933
|
y = void 0;
|
|
3934
3934
|
try {
|
|
@@ -3937,8 +3937,8 @@ function ci(t) {
|
|
|
3937
3937
|
y = e;
|
|
3938
3938
|
}
|
|
3939
3939
|
}
|
|
3940
|
-
var Ue = void 0, se = 0,
|
|
3941
|
-
function
|
|
3940
|
+
var Ue = void 0, se = 0, Xt = 0, pt = 0;
|
|
3941
|
+
function pi(t) {
|
|
3942
3942
|
if (y !== void 0) {
|
|
3943
3943
|
var e = t.n;
|
|
3944
3944
|
if (e === void 0 || e.t !== y)
|
|
@@ -3950,13 +3950,13 @@ function ui(t) {
|
|
|
3950
3950
|
function $(t, e) {
|
|
3951
3951
|
this.v = t, this.i = 0, this.n = void 0, this.t = void 0, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
|
|
3952
3952
|
}
|
|
3953
|
-
$.prototype.brand =
|
|
3953
|
+
$.prototype.brand = na;
|
|
3954
3954
|
$.prototype.h = function() {
|
|
3955
3955
|
return !0;
|
|
3956
3956
|
};
|
|
3957
3957
|
$.prototype.S = function(t) {
|
|
3958
3958
|
var e = this, n = this.t;
|
|
3959
|
-
n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t :
|
|
3959
|
+
n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t : fi(function() {
|
|
3960
3960
|
var r;
|
|
3961
3961
|
(r = e.W) == null || r.call(e);
|
|
3962
3962
|
}));
|
|
@@ -3965,7 +3965,7 @@ $.prototype.U = function(t) {
|
|
|
3965
3965
|
var e = this;
|
|
3966
3966
|
if (this.t !== void 0) {
|
|
3967
3967
|
var n = t.e, r = t.x;
|
|
3968
|
-
n !== void 0 && (n.x = r, t.e = void 0), r !== void 0 && (r.e = n, t.x = void 0), t === this.t && (this.t = r, r === void 0 &&
|
|
3968
|
+
n !== void 0 && (n.x = r, t.e = void 0), r !== void 0 && (r.e = n, t.x = void 0), t === this.t && (this.t = r, r === void 0 && fi(function() {
|
|
3969
3969
|
var i;
|
|
3970
3970
|
(i = e.Z) == null || i.call(e);
|
|
3971
3971
|
}));
|
|
@@ -4002,27 +4002,27 @@ $.prototype.peek = function() {
|
|
|
4002
4002
|
}
|
|
4003
4003
|
};
|
|
4004
4004
|
Object.defineProperty($.prototype, "value", { get: function() {
|
|
4005
|
-
var t =
|
|
4005
|
+
var t = pi(this);
|
|
4006
4006
|
return t !== void 0 && (t.i = this.i), this.v;
|
|
4007
4007
|
}, set: function(t) {
|
|
4008
4008
|
if (t !== this.v) {
|
|
4009
|
-
if (
|
|
4009
|
+
if (Xt > 100) throw new Error("Cycle detected");
|
|
4010
4010
|
this.v = t, this.i++, pt++, se++;
|
|
4011
4011
|
try {
|
|
4012
4012
|
for (var e = this.t; e !== void 0; e = e.x) e.t.N();
|
|
4013
4013
|
} finally {
|
|
4014
|
-
|
|
4014
|
+
jt();
|
|
4015
4015
|
}
|
|
4016
4016
|
}
|
|
4017
4017
|
} });
|
|
4018
|
-
function
|
|
4018
|
+
function W(t, e) {
|
|
4019
4019
|
return new $(t, e);
|
|
4020
4020
|
}
|
|
4021
|
-
function
|
|
4021
|
+
function gi(t) {
|
|
4022
4022
|
for (var e = t.s; e !== void 0; e = e.n) if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i) return !0;
|
|
4023
4023
|
return !1;
|
|
4024
4024
|
}
|
|
4025
|
-
function
|
|
4025
|
+
function mi(t) {
|
|
4026
4026
|
for (var e = t.s; e !== void 0; e = e.n) {
|
|
4027
4027
|
var n = e.S.n;
|
|
4028
4028
|
if (n !== void 0 && (e.r = n), e.S.n = e, e.i = -1, e.n === void 0) {
|
|
@@ -4031,7 +4031,7 @@ function di(t) {
|
|
|
4031
4031
|
}
|
|
4032
4032
|
}
|
|
4033
4033
|
}
|
|
4034
|
-
function
|
|
4034
|
+
function xi(t) {
|
|
4035
4035
|
for (var e = t.s, n = void 0; e !== void 0; ) {
|
|
4036
4036
|
var r = e.p;
|
|
4037
4037
|
e.i === -1 ? (e.S.U(e), r !== void 0 && (r.n = e.n), e.n !== void 0 && (e.n.p = r)) : n = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = r;
|
|
@@ -4045,17 +4045,17 @@ ge.prototype = new $();
|
|
|
4045
4045
|
ge.prototype.h = function() {
|
|
4046
4046
|
if (this.f &= -3, 1 & this.f) return !1;
|
|
4047
4047
|
if ((36 & this.f) == 32 || (this.f &= -5, this.g === pt)) return !0;
|
|
4048
|
-
if (this.g = pt, this.f |= 1, this.i > 0 && !
|
|
4048
|
+
if (this.g = pt, this.f |= 1, this.i > 0 && !gi(this))
|
|
4049
4049
|
return this.f &= -2, !0;
|
|
4050
4050
|
var t = y;
|
|
4051
4051
|
try {
|
|
4052
|
-
|
|
4052
|
+
mi(this), y = this;
|
|
4053
4053
|
var e = this.x();
|
|
4054
4054
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
4055
4055
|
} catch (n) {
|
|
4056
4056
|
this.v = n, this.f |= 16, this.i++;
|
|
4057
4057
|
}
|
|
4058
|
-
return y = t,
|
|
4058
|
+
return y = t, xi(this), this.f &= -2, !0;
|
|
4059
4059
|
};
|
|
4060
4060
|
ge.prototype.S = function(t) {
|
|
4061
4061
|
if (this.t === void 0) {
|
|
@@ -4078,14 +4078,14 @@ ge.prototype.N = function() {
|
|
|
4078
4078
|
};
|
|
4079
4079
|
Object.defineProperty(ge.prototype, "value", { get: function() {
|
|
4080
4080
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
4081
|
-
var t =
|
|
4081
|
+
var t = pi(this);
|
|
4082
4082
|
if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v;
|
|
4083
4083
|
return this.v;
|
|
4084
4084
|
} });
|
|
4085
|
-
function
|
|
4085
|
+
function ur(t, e) {
|
|
4086
4086
|
return new ge(t, e);
|
|
4087
4087
|
}
|
|
4088
|
-
function
|
|
4088
|
+
function bi(t) {
|
|
4089
4089
|
var e = t.u;
|
|
4090
4090
|
if (t.u = void 0, typeof e == "function") {
|
|
4091
4091
|
se++;
|
|
@@ -4094,24 +4094,24 @@ function pi(t) {
|
|
|
4094
4094
|
try {
|
|
4095
4095
|
e();
|
|
4096
4096
|
} catch (r) {
|
|
4097
|
-
throw t.f &= -2, t.f |= 8,
|
|
4097
|
+
throw t.f &= -2, t.f |= 8, gn(t), r;
|
|
4098
4098
|
} finally {
|
|
4099
|
-
y = n,
|
|
4099
|
+
y = n, jt();
|
|
4100
4100
|
}
|
|
4101
4101
|
}
|
|
4102
4102
|
}
|
|
4103
|
-
function
|
|
4103
|
+
function gn(t) {
|
|
4104
4104
|
for (var e = t.s; e !== void 0; e = e.n) e.S.U(e);
|
|
4105
|
-
t.x = void 0, t.s = void 0,
|
|
4105
|
+
t.x = void 0, t.s = void 0, bi(t);
|
|
4106
4106
|
}
|
|
4107
|
-
function
|
|
4107
|
+
function ia(t) {
|
|
4108
4108
|
if (y !== this) throw new Error("Out-of-order effect");
|
|
4109
|
-
|
|
4109
|
+
xi(this), y = t, this.f &= -2, 8 & this.f && gn(this), jt();
|
|
4110
4110
|
}
|
|
4111
|
-
function
|
|
4111
|
+
function Ae(t, e) {
|
|
4112
4112
|
this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = e?.name;
|
|
4113
4113
|
}
|
|
4114
|
-
|
|
4114
|
+
Ae.prototype.c = function() {
|
|
4115
4115
|
var t = this.S();
|
|
4116
4116
|
try {
|
|
4117
4117
|
if (8 & this.f || this.x === void 0) return;
|
|
@@ -4121,23 +4121,23 @@ Ie.prototype.c = function() {
|
|
|
4121
4121
|
t();
|
|
4122
4122
|
}
|
|
4123
4123
|
};
|
|
4124
|
-
|
|
4124
|
+
Ae.prototype.S = function() {
|
|
4125
4125
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
4126
|
-
this.f |= 1, this.f &= -9,
|
|
4126
|
+
this.f |= 1, this.f &= -9, bi(this), mi(this), se++;
|
|
4127
4127
|
var t = y;
|
|
4128
|
-
return y = this,
|
|
4128
|
+
return y = this, ia.bind(this, t);
|
|
4129
4129
|
};
|
|
4130
|
-
|
|
4130
|
+
Ae.prototype.N = function() {
|
|
4131
4131
|
2 & this.f || (this.f |= 2, this.o = Ue, Ue = this);
|
|
4132
4132
|
};
|
|
4133
|
-
|
|
4134
|
-
this.f |= 8, 1 & this.f ||
|
|
4133
|
+
Ae.prototype.d = function() {
|
|
4134
|
+
this.f |= 8, 1 & this.f || gn(this);
|
|
4135
4135
|
};
|
|
4136
|
-
|
|
4136
|
+
Ae.prototype.dispose = function() {
|
|
4137
4137
|
this.d();
|
|
4138
4138
|
};
|
|
4139
4139
|
function et(t, e) {
|
|
4140
|
-
var n = new
|
|
4140
|
+
var n = new Ae(t, e);
|
|
4141
4141
|
try {
|
|
4142
4142
|
n.c();
|
|
4143
4143
|
} catch (i) {
|
|
@@ -4146,11 +4146,11 @@ function et(t, e) {
|
|
|
4146
4146
|
var r = n.d.bind(n);
|
|
4147
4147
|
return r[Symbol.dispose] = r, r;
|
|
4148
4148
|
}
|
|
4149
|
-
var
|
|
4149
|
+
var yi, ot, sa = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, vi = [];
|
|
4150
4150
|
et(function() {
|
|
4151
|
-
|
|
4151
|
+
yi = this.N;
|
|
4152
4152
|
})();
|
|
4153
|
-
function
|
|
4153
|
+
function Ie(t, e) {
|
|
4154
4154
|
m[t] = e.bind(null, m[t] || function() {
|
|
4155
4155
|
});
|
|
4156
4156
|
}
|
|
@@ -4161,21 +4161,21 @@ function gt(t) {
|
|
|
4161
4161
|
}
|
|
4162
4162
|
ot = t && t.S();
|
|
4163
4163
|
}
|
|
4164
|
-
function
|
|
4165
|
-
var e = this, n = t.data, r =
|
|
4164
|
+
function _i(t) {
|
|
4165
|
+
var e = this, n = t.data, r = ze(n);
|
|
4166
4166
|
r.value = n;
|
|
4167
|
-
var i =
|
|
4167
|
+
var i = V(function() {
|
|
4168
4168
|
for (var l = e, a = e.__v; a = a.__; ) if (a.__c) {
|
|
4169
4169
|
a.__c.__$f |= 4;
|
|
4170
4170
|
break;
|
|
4171
4171
|
}
|
|
4172
|
-
var u =
|
|
4172
|
+
var u = ur(function() {
|
|
4173
4173
|
var f = r.value.value;
|
|
4174
4174
|
return f === 0 ? 0 : f === !0 ? "" : f || "";
|
|
4175
|
-
}), d =
|
|
4176
|
-
return !Array.isArray(u.value) && !
|
|
4175
|
+
}), d = ur(function() {
|
|
4176
|
+
return !Array.isArray(u.value) && !Sr(u.value);
|
|
4177
4177
|
}), c = et(function() {
|
|
4178
|
-
if (this.N =
|
|
4178
|
+
if (this.N = ki, d.value) {
|
|
4179
4179
|
var f = u.value;
|
|
4180
4180
|
l.__v && l.__v.__e && l.__v.__e.nodeType === 3 && (l.__v.__e.data = f);
|
|
4181
4181
|
}
|
|
@@ -4186,11 +4186,11 @@ function xi(t) {
|
|
|
4186
4186
|
}, []), s = i[0], o = i[1];
|
|
4187
4187
|
return s.value ? o.peek() : o.value;
|
|
4188
4188
|
}
|
|
4189
|
-
|
|
4190
|
-
Object.defineProperties($.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value:
|
|
4189
|
+
_i.displayName = "ReactiveTextNode";
|
|
4190
|
+
Object.defineProperties($.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: _i }, props: { configurable: !0, get: function() {
|
|
4191
4191
|
return { data: this };
|
|
4192
4192
|
} }, __b: { configurable: !0, value: 1 } });
|
|
4193
|
-
|
|
4193
|
+
Ie("__b", function(t, e) {
|
|
4194
4194
|
if (typeof e.type == "string") {
|
|
4195
4195
|
var n, r = e.props;
|
|
4196
4196
|
for (var i in r) if (i !== "children") {
|
|
@@ -4200,8 +4200,8 @@ Ee("__b", function(t, e) {
|
|
|
4200
4200
|
}
|
|
4201
4201
|
t(e);
|
|
4202
4202
|
});
|
|
4203
|
-
|
|
4204
|
-
if (t(e), e.type !==
|
|
4203
|
+
Ie("__r", function(t, e) {
|
|
4204
|
+
if (t(e), e.type !== N) {
|
|
4205
4205
|
gt();
|
|
4206
4206
|
var n, r = e.__c;
|
|
4207
4207
|
r && (r.__$f &= -2, (n = r.__$u) === void 0 && (r.__$u = n = (function(i, s) {
|
|
@@ -4211,14 +4211,14 @@ Ee("__r", function(t, e) {
|
|
|
4211
4211
|
}, { name: s }), o.c = i, o;
|
|
4212
4212
|
})(function() {
|
|
4213
4213
|
var i;
|
|
4214
|
-
|
|
4214
|
+
sa && ((i = n.y) == null || i.call(n)), r.__$f |= 1, r.setState({});
|
|
4215
4215
|
}, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), gt(n);
|
|
4216
4216
|
}
|
|
4217
4217
|
});
|
|
4218
|
-
|
|
4218
|
+
Ie("__e", function(t, e, n, r) {
|
|
4219
4219
|
gt(), t(e, n, r);
|
|
4220
4220
|
});
|
|
4221
|
-
|
|
4221
|
+
Ie("diffed", function(t, e) {
|
|
4222
4222
|
gt();
|
|
4223
4223
|
var n;
|
|
4224
4224
|
if (typeof e.type == "string" && (n = e.__e)) {
|
|
@@ -4233,23 +4233,23 @@ Ee("diffed", function(t, e) {
|
|
|
4233
4233
|
s = {}, n.U = s;
|
|
4234
4234
|
for (var a in r) {
|
|
4235
4235
|
var u = s[a], d = r[a];
|
|
4236
|
-
u === void 0 ? (u =
|
|
4236
|
+
u === void 0 ? (u = oa(n, a, d, i), s[a] = u) : u.o(d, i);
|
|
4237
4237
|
}
|
|
4238
4238
|
}
|
|
4239
4239
|
}
|
|
4240
4240
|
t(e);
|
|
4241
4241
|
});
|
|
4242
|
-
function
|
|
4243
|
-
var i = e in t && t.ownerSVGElement === void 0, s =
|
|
4242
|
+
function oa(t, e, n, r) {
|
|
4243
|
+
var i = e in t && t.ownerSVGElement === void 0, s = W(n);
|
|
4244
4244
|
return { o: function(o, l) {
|
|
4245
4245
|
s.value = o, r = l;
|
|
4246
4246
|
}, d: et(function() {
|
|
4247
|
-
this.N =
|
|
4247
|
+
this.N = ki;
|
|
4248
4248
|
var o = s.value.value;
|
|
4249
4249
|
r[e] !== o && (r[e] = o, i ? t[e] = o : o != null && (o !== !1 || e[4] === "-") ? t.setAttribute(e, o) : t.removeAttribute(e));
|
|
4250
4250
|
}) };
|
|
4251
4251
|
}
|
|
4252
|
-
|
|
4252
|
+
Ie("unmount", function(t, e) {
|
|
4253
4253
|
if (typeof e.type == "string") {
|
|
4254
4254
|
var n = e.__e;
|
|
4255
4255
|
if (n) {
|
|
@@ -4271,10 +4271,10 @@ Ee("unmount", function(t, e) {
|
|
|
4271
4271
|
}
|
|
4272
4272
|
t(e);
|
|
4273
4273
|
});
|
|
4274
|
-
|
|
4274
|
+
Ie("__h", function(t, e, n, r) {
|
|
4275
4275
|
(r < 3 || r === 9) && (e.__$f |= 2), t(e, n, r);
|
|
4276
4276
|
});
|
|
4277
|
-
|
|
4277
|
+
D.prototype.shouldComponentUpdate = function(t, e) {
|
|
4278
4278
|
if (this.__R) return !0;
|
|
4279
4279
|
var n = this.__$u, r = n && n.s !== void 0;
|
|
4280
4280
|
for (var i in e) return !0;
|
|
@@ -4286,32 +4286,32 @@ z.prototype.shouldComponentUpdate = function(t, e) {
|
|
|
4286
4286
|
for (var l in this.props) if (!(l in t)) return !0;
|
|
4287
4287
|
return !1;
|
|
4288
4288
|
};
|
|
4289
|
-
function
|
|
4290
|
-
return
|
|
4291
|
-
return
|
|
4289
|
+
function ze(t, e) {
|
|
4290
|
+
return V(function() {
|
|
4291
|
+
return W(t, e);
|
|
4292
4292
|
}, []);
|
|
4293
4293
|
}
|
|
4294
|
-
var
|
|
4294
|
+
var aa = function(t) {
|
|
4295
4295
|
queueMicrotask(function() {
|
|
4296
4296
|
queueMicrotask(t);
|
|
4297
4297
|
});
|
|
4298
4298
|
};
|
|
4299
|
-
function
|
|
4300
|
-
|
|
4301
|
-
for (var t; t =
|
|
4299
|
+
function la() {
|
|
4300
|
+
ra(function() {
|
|
4301
|
+
for (var t; t = vi.shift(); ) yi.call(t);
|
|
4302
4302
|
});
|
|
4303
4303
|
}
|
|
4304
|
-
function
|
|
4305
|
-
|
|
4304
|
+
function ki() {
|
|
4305
|
+
vi.push(this) === 1 && (m.requestAnimationFrame || aa)(la);
|
|
4306
4306
|
}
|
|
4307
|
-
const A =
|
|
4308
|
-
function
|
|
4307
|
+
const A = W(!1), mt = W(void 0), xt = W(void 0);
|
|
4308
|
+
function ca(t) {
|
|
4309
4309
|
return t.replace(/\.convex\.site\b/, ".convex.cloud");
|
|
4310
4310
|
}
|
|
4311
|
-
function
|
|
4311
|
+
function wi(t) {
|
|
4312
4312
|
return t.replace(/\.convex\.cloud\b/, ".convex.site");
|
|
4313
4313
|
}
|
|
4314
|
-
function
|
|
4314
|
+
function ua(t, e) {
|
|
4315
4315
|
const n = t.title ?? e?.title ?? "Assistant";
|
|
4316
4316
|
return {
|
|
4317
4317
|
title: n,
|
|
@@ -4333,33 +4333,76 @@ function oa(t, e) {
|
|
|
4333
4333
|
windowHeight: t.windowHeight ?? e?.windowHeight
|
|
4334
4334
|
};
|
|
4335
4335
|
}
|
|
4336
|
-
async function
|
|
4337
|
-
const
|
|
4338
|
-
|
|
4339
|
-
}
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4336
|
+
async function ha(t, e, n, r) {
|
|
4337
|
+
const i = new URL(`${t}/widget/config`);
|
|
4338
|
+
i.searchParams.set("orgSlug", e), r && i.searchParams.set("projSlug", r);
|
|
4339
|
+
const s = await fetch(i.toString(), { signal: n });
|
|
4340
|
+
return s.ok ? s.json() : null;
|
|
4341
|
+
}
|
|
4342
|
+
function da(t, e, n) {
|
|
4343
|
+
const [r, i] = R(null);
|
|
4344
|
+
return z(() => {
|
|
4345
|
+
i(null);
|
|
4346
|
+
const s = n ?? "https://tame-spider-109.eu-west-1.convex.cloud", o = s ? wi(s) : void 0;
|
|
4347
|
+
if (!o || !t)
|
|
4346
4348
|
return;
|
|
4347
|
-
const
|
|
4348
|
-
async function
|
|
4349
|
+
const l = new AbortController();
|
|
4350
|
+
async function a(u) {
|
|
4349
4351
|
try {
|
|
4350
|
-
const
|
|
4351
|
-
|
|
4352
|
-
} catch (
|
|
4353
|
-
if (
|
|
4352
|
+
const d = await ha(u, t, l.signal, e);
|
|
4353
|
+
d && i(d);
|
|
4354
|
+
} catch (d) {
|
|
4355
|
+
if (d instanceof Error && d.name === "AbortError")
|
|
4354
4356
|
return;
|
|
4355
4357
|
}
|
|
4356
4358
|
}
|
|
4357
|
-
return
|
|
4358
|
-
|
|
4359
|
+
return a(o), () => {
|
|
4360
|
+
l.abort();
|
|
4359
4361
|
};
|
|
4360
|
-
}, [t, e]),
|
|
4362
|
+
}, [t, e, n]), r;
|
|
4361
4363
|
}
|
|
4362
|
-
|
|
4364
|
+
async function fa(t, e, n) {
|
|
4365
|
+
try {
|
|
4366
|
+
const r = await fetch(`${e}/widget/bootstrap`, {
|
|
4367
|
+
method: "POST",
|
|
4368
|
+
headers: { "Content-Type": "application/json" },
|
|
4369
|
+
body: JSON.stringify(n ? { orgSlug: t, projSlug: n } : { orgSlug: t }),
|
|
4370
|
+
credentials: "omit"
|
|
4371
|
+
});
|
|
4372
|
+
if (r.ok) {
|
|
4373
|
+
const i = await r.json();
|
|
4374
|
+
return { ok: !0, token: i.token, excludePaths: i.excludePaths };
|
|
4375
|
+
}
|
|
4376
|
+
return r.status === 403 ? { ok: !1, error: "unauthorized" } : r.status === 404 ? { ok: !1, error: "not_found" } : { ok: !1, error: "network" };
|
|
4377
|
+
} catch {
|
|
4378
|
+
return { ok: !1, error: "network" };
|
|
4379
|
+
}
|
|
4380
|
+
}
|
|
4381
|
+
function pa(t, e, n, r) {
|
|
4382
|
+
z(() => {
|
|
4383
|
+
if (n)
|
|
4384
|
+
return;
|
|
4385
|
+
const i = r ?? "https://tame-spider-109.eu-west-1.convex.cloud", s = i ? wi(i) : void 0;
|
|
4386
|
+
if (!s || !t)
|
|
4387
|
+
return;
|
|
4388
|
+
let o = !1;
|
|
4389
|
+
return (async () => {
|
|
4390
|
+
const l = await fa(t, s, e);
|
|
4391
|
+
if (!o)
|
|
4392
|
+
if (l.ok)
|
|
4393
|
+
xt.value = l.token;
|
|
4394
|
+
else {
|
|
4395
|
+
const a = e ? `project '${t}/${e}'` : `org '${t}'`;
|
|
4396
|
+
l.error === "unauthorized" ? console.error(
|
|
4397
|
+
`[JexityChat] This domain is not authorized for ${a}. Check the widget's domain rules.`
|
|
4398
|
+
) : l.error === "not_found" ? console.error(`[JexityChat] No active widget config found for ${a}.`) : console.error(`[JexityChat] Bootstrap failed: ${l.error}`);
|
|
4399
|
+
}
|
|
4400
|
+
})(), () => {
|
|
4401
|
+
o = !0;
|
|
4402
|
+
};
|
|
4403
|
+
}, [t, e, n, r]);
|
|
4404
|
+
}
|
|
4405
|
+
const Si = {
|
|
4363
4406
|
title: "Assistant",
|
|
4364
4407
|
statusOnline: "Online · Responds in seconds",
|
|
4365
4408
|
inputPlaceholder: "Type a message…",
|
|
@@ -4414,7 +4457,7 @@ const yi = {
|
|
|
4414
4457
|
somethingWentWrong: "Something went wrong",
|
|
4415
4458
|
fabLabel: "Chat with us",
|
|
4416
4459
|
chatNoLongerAvailable: "This chat is no longer available."
|
|
4417
|
-
},
|
|
4460
|
+
}, ga = {
|
|
4418
4461
|
title: "Assistent",
|
|
4419
4462
|
statusOnline: "Online · Antwortet in Sekunden",
|
|
4420
4463
|
inputPlaceholder: "Nachricht eingeben…",
|
|
@@ -4469,88 +4512,88 @@ const yi = {
|
|
|
4469
4512
|
somethingWentWrong: "Etwas ist schiefgelaufen",
|
|
4470
4513
|
fabLabel: "Chatte mit uns",
|
|
4471
4514
|
chatNoLongerAvailable: "Dieser Chat ist nicht mehr verfügbar."
|
|
4472
|
-
},
|
|
4515
|
+
}, ma = [
|
|
4473
4516
|
{ value: "de", label: "Deutsch", flag: "🇩🇪" },
|
|
4474
4517
|
{ value: "en", label: "English", flag: "🇬🇧" }
|
|
4475
|
-
],
|
|
4476
|
-
function
|
|
4477
|
-
return
|
|
4518
|
+
], xa = "de", ba = "jex-locale", mn = W("de"), ya = { en: Si, de: ga };
|
|
4519
|
+
function q() {
|
|
4520
|
+
return ya[mn.value] ?? Si;
|
|
4478
4521
|
}
|
|
4479
|
-
function
|
|
4522
|
+
function zt(t) {
|
|
4480
4523
|
if (!t)
|
|
4481
4524
|
return null;
|
|
4482
4525
|
const e = (t.split("-")[0] ?? "").toLowerCase();
|
|
4483
|
-
return
|
|
4526
|
+
return ma.some((r) => r.value === e) ? e : null;
|
|
4484
4527
|
}
|
|
4485
|
-
function
|
|
4486
|
-
const e =
|
|
4528
|
+
function ji(t) {
|
|
4529
|
+
const e = zt(t);
|
|
4487
4530
|
if (e)
|
|
4488
4531
|
return e;
|
|
4489
4532
|
try {
|
|
4490
|
-
const n =
|
|
4533
|
+
const n = zt(localStorage.getItem(ba));
|
|
4491
4534
|
if (n)
|
|
4492
4535
|
return n;
|
|
4493
4536
|
} catch {
|
|
4494
4537
|
}
|
|
4495
4538
|
if (typeof navigator < "u") {
|
|
4496
|
-
const n =
|
|
4539
|
+
const n = zt(navigator.language);
|
|
4497
4540
|
if (n)
|
|
4498
4541
|
return n;
|
|
4499
4542
|
}
|
|
4500
|
-
return
|
|
4543
|
+
return xa;
|
|
4501
4544
|
}
|
|
4502
|
-
function
|
|
4503
|
-
|
|
4545
|
+
function va(t) {
|
|
4546
|
+
z(() => {
|
|
4504
4547
|
function e(n) {
|
|
4505
4548
|
const r = t ?? window.location.origin;
|
|
4506
4549
|
if (n.origin !== r || n.data?.type !== "jexity:config")
|
|
4507
4550
|
return;
|
|
4508
4551
|
const { locale: i } = n.data.payload;
|
|
4509
|
-
i && (
|
|
4552
|
+
i && (mn.value = ji(i));
|
|
4510
4553
|
}
|
|
4511
4554
|
return window.addEventListener("message", e), () => {
|
|
4512
4555
|
window.removeEventListener("message", e);
|
|
4513
4556
|
};
|
|
4514
4557
|
}, [t]);
|
|
4515
4558
|
}
|
|
4516
|
-
const
|
|
4517
|
-
function
|
|
4559
|
+
const xn = "jex-session-ref", Ct = "jex-session-active", ae = W(null), fe = W(!1);
|
|
4560
|
+
function _a() {
|
|
4518
4561
|
return "JEX-" + Math.random().toString(36).slice(2, 8).toUpperCase();
|
|
4519
4562
|
}
|
|
4520
|
-
function
|
|
4563
|
+
function ka() {
|
|
4521
4564
|
try {
|
|
4522
|
-
const t = sessionStorage.getItem(
|
|
4565
|
+
const t = sessionStorage.getItem(xn), e = sessionStorage.getItem(Ct);
|
|
4523
4566
|
ae.value = t ?? null, fe.value = t !== null && e === "true";
|
|
4524
4567
|
} catch {
|
|
4525
4568
|
ae.value = null, fe.value = !1;
|
|
4526
4569
|
}
|
|
4527
4570
|
}
|
|
4528
4571
|
function Yt() {
|
|
4529
|
-
const t =
|
|
4572
|
+
const t = _a();
|
|
4530
4573
|
ae.value = t, fe.value = !1;
|
|
4531
4574
|
try {
|
|
4532
|
-
sessionStorage.setItem(
|
|
4575
|
+
sessionStorage.setItem(xn, t), sessionStorage.removeItem(Ct);
|
|
4533
4576
|
} catch {
|
|
4534
4577
|
}
|
|
4535
4578
|
return t;
|
|
4536
4579
|
}
|
|
4537
|
-
function
|
|
4580
|
+
function wa(t) {
|
|
4538
4581
|
ae.value = t, fe.value = !0;
|
|
4539
4582
|
try {
|
|
4540
|
-
sessionStorage.setItem(
|
|
4583
|
+
sessionStorage.setItem(xn, t), sessionStorage.setItem(Ct, "true");
|
|
4541
4584
|
} catch {
|
|
4542
4585
|
}
|
|
4543
4586
|
}
|
|
4544
|
-
function
|
|
4587
|
+
function Sa() {
|
|
4545
4588
|
if (ae.value) {
|
|
4546
4589
|
fe.value = !0;
|
|
4547
4590
|
try {
|
|
4548
|
-
sessionStorage.setItem(
|
|
4591
|
+
sessionStorage.setItem(Ct, "true");
|
|
4549
4592
|
} catch {
|
|
4550
4593
|
}
|
|
4551
4594
|
}
|
|
4552
4595
|
}
|
|
4553
|
-
function
|
|
4596
|
+
function ja(t) {
|
|
4554
4597
|
const e = {}, { primaryColor: n, theme: r } = t;
|
|
4555
4598
|
if (n && (e["--jex-primary"] = n, e["--jex-bg-trigger"] = n, e["--jex-bg-header"] = n, e["--jex-bg-msg-user"] = n, e["--jex-bg-send-btn"] = n), t.accentColor && (e["--jex-accent"] = t.accentColor), r?.bg) {
|
|
4556
4599
|
const i = r.bg;
|
|
@@ -4566,17 +4609,17 @@ function ya(t) {
|
|
|
4566
4609
|
}
|
|
4567
4610
|
return t.fontFamily && (e["--jex-font-family"] = t.fontFamily), t.fontSize && (e["--jex-font-size"] = `${t.fontSize}px`), t.borderRadius && (e["--jex-radius"] = t.borderRadius), t.windowWidth && (e["--jex-window-width"] = `${t.windowWidth}px`), t.windowHeight && (e["--jex-window-height"] = `${t.windowHeight}px`), Object.keys(e).length > 0 ? e : void 0;
|
|
4568
4611
|
}
|
|
4569
|
-
const
|
|
4570
|
-
function
|
|
4571
|
-
|
|
4612
|
+
const U = W([{ id: "home" }]), Ca = W("screen");
|
|
4613
|
+
function ke(t) {
|
|
4614
|
+
U.value = [...U.value, t];
|
|
4572
4615
|
}
|
|
4573
|
-
function
|
|
4574
|
-
|
|
4616
|
+
function bn() {
|
|
4617
|
+
U.value.length > 1 && (U.value = U.value.slice(0, -1));
|
|
4575
4618
|
}
|
|
4576
|
-
function
|
|
4577
|
-
|
|
4619
|
+
function we(t) {
|
|
4620
|
+
U.value = [...U.value.slice(0, -1), t];
|
|
4578
4621
|
}
|
|
4579
|
-
function
|
|
4622
|
+
function yn({ size: t = 24 }) {
|
|
4580
4623
|
return /* @__PURE__ */ h("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
|
|
4581
4624
|
/* @__PURE__ */ h("path", { d: "M12 8V4H8" }),
|
|
4582
4625
|
/* @__PURE__ */ h("rect", { width: "16", height: "12", x: "4", y: "8", rx: "2" }),
|
|
@@ -4586,29 +4629,29 @@ function bn({ size: t = 24 }) {
|
|
|
4586
4629
|
/* @__PURE__ */ h("path", { d: "M9 13v2" })
|
|
4587
4630
|
] });
|
|
4588
4631
|
}
|
|
4589
|
-
function
|
|
4590
|
-
const e =
|
|
4632
|
+
function hr({ title: t }) {
|
|
4633
|
+
const e = q(), n = U.value.length > 1;
|
|
4591
4634
|
return /* @__PURE__ */ h("header", { class: "jex-chat-header", children: [
|
|
4592
4635
|
n && /* @__PURE__ */ h(
|
|
4593
4636
|
"button",
|
|
4594
4637
|
{
|
|
4595
4638
|
class: "jex-header-back",
|
|
4596
|
-
onClick:
|
|
4639
|
+
onClick: bn,
|
|
4597
4640
|
"aria-label": e.back || "Go back",
|
|
4598
4641
|
children: /* @__PURE__ */ h("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ h("path", { d: "m15 18-6-6 6-6" }) })
|
|
4599
4642
|
}
|
|
4600
4643
|
),
|
|
4601
|
-
!n && /* @__PURE__ */ h(
|
|
4644
|
+
!n && /* @__PURE__ */ h(yn, { size: 24 }),
|
|
4602
4645
|
/* @__PURE__ */ h("div", { class: "jex-header-info", children: [
|
|
4603
4646
|
/* @__PURE__ */ h("h3", { children: t }),
|
|
4604
4647
|
/* @__PURE__ */ h("p", { children: e.statusOnline })
|
|
4605
4648
|
] })
|
|
4606
4649
|
] });
|
|
4607
4650
|
}
|
|
4608
|
-
function
|
|
4651
|
+
function Ta({ size: t = 14 }) {
|
|
4609
4652
|
return /* @__PURE__ */ h("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ h("path", { d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z" }) });
|
|
4610
4653
|
}
|
|
4611
|
-
function
|
|
4654
|
+
function dr() {
|
|
4612
4655
|
return /* @__PURE__ */ h("div", { class: "jex-widget-footer", children: /* @__PURE__ */ h(
|
|
4613
4656
|
"a",
|
|
4614
4657
|
{
|
|
@@ -4617,7 +4660,7 @@ function hr() {
|
|
|
4617
4660
|
rel: "noopener noreferrer",
|
|
4618
4661
|
class: "jex-branding",
|
|
4619
4662
|
children: [
|
|
4620
|
-
/* @__PURE__ */ h(
|
|
4663
|
+
/* @__PURE__ */ h(Ta, { size: 14 }),
|
|
4621
4664
|
/* @__PURE__ */ h("span", { children: [
|
|
4622
4665
|
"Powered by ",
|
|
4623
4666
|
/* @__PURE__ */ h("strong", { children: "Jexity" })
|
|
@@ -4626,16 +4669,16 @@ function hr() {
|
|
|
4626
4669
|
}
|
|
4627
4670
|
) });
|
|
4628
4671
|
}
|
|
4629
|
-
function
|
|
4672
|
+
function Ci({ size: t = 28 }) {
|
|
4630
4673
|
return /* @__PURE__ */ h("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ h("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
|
|
4631
4674
|
}
|
|
4632
|
-
function
|
|
4675
|
+
function Ra({ size: t = 28 }) {
|
|
4633
4676
|
return /* @__PURE__ */ h("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
|
|
4634
4677
|
/* @__PURE__ */ h("path", { d: "M18 6 6 18" }),
|
|
4635
4678
|
/* @__PURE__ */ h("path", { d: "m6 6 12 12" })
|
|
4636
4679
|
] });
|
|
4637
4680
|
}
|
|
4638
|
-
function
|
|
4681
|
+
function $a({ size: t = 24, ...e }) {
|
|
4639
4682
|
return /* @__PURE__ */ h(
|
|
4640
4683
|
"svg",
|
|
4641
4684
|
{
|
|
@@ -4652,52 +4695,52 @@ function wa({ size: t = 24, ...e }) {
|
|
|
4652
4695
|
}
|
|
4653
4696
|
);
|
|
4654
4697
|
}
|
|
4655
|
-
const
|
|
4656
|
-
chat: /* @__PURE__ */ h(
|
|
4657
|
-
bot: /* @__PURE__ */ h(
|
|
4658
|
-
sparkles: /* @__PURE__ */ h(
|
|
4659
|
-
},
|
|
4698
|
+
const Aa = {
|
|
4699
|
+
chat: /* @__PURE__ */ h(Ci, { size: 28 }),
|
|
4700
|
+
bot: /* @__PURE__ */ h(yn, { size: 28 }),
|
|
4701
|
+
sparkles: /* @__PURE__ */ h($a, { size: 28 })
|
|
4702
|
+
}, Ia = {
|
|
4660
4703
|
none: "0px",
|
|
4661
4704
|
sm: "0.5rem",
|
|
4662
4705
|
md: "0.75rem",
|
|
4663
4706
|
lg: "1.25rem",
|
|
4664
4707
|
full: "9999px"
|
|
4665
4708
|
};
|
|
4666
|
-
function
|
|
4667
|
-
const r =
|
|
4709
|
+
function Ea({ radius: t = "full", iconOption: e = "chat", label: n }) {
|
|
4710
|
+
const r = q(), i = n ?? r.fabLabel, s = i !== "";
|
|
4668
4711
|
return /* @__PURE__ */ h(
|
|
4669
4712
|
"button",
|
|
4670
4713
|
{
|
|
4671
4714
|
class: `jex-floating-button ${!A.value && s ? "jex-has-label" : ""}`,
|
|
4672
|
-
style: { borderRadius:
|
|
4715
|
+
style: { borderRadius: Ia[t] ?? "9999px" },
|
|
4673
4716
|
onClick: () => {
|
|
4674
4717
|
A.value = !A.value;
|
|
4675
4718
|
},
|
|
4676
4719
|
"aria-label": A.value ? r.closeChatAriaLabel : r.openChatAriaLabel,
|
|
4677
|
-
children: A.value ? /* @__PURE__ */ h(
|
|
4678
|
-
|
|
4720
|
+
children: A.value ? /* @__PURE__ */ h(Ra, { size: 28 }) : /* @__PURE__ */ h("div", { class: "jex-fab-inner", children: [
|
|
4721
|
+
Aa[e],
|
|
4679
4722
|
s && /* @__PURE__ */ h("span", { class: "jex-fab-label", children: i })
|
|
4680
4723
|
] })
|
|
4681
4724
|
}
|
|
4682
4725
|
);
|
|
4683
4726
|
}
|
|
4684
|
-
function
|
|
4685
|
-
const e =
|
|
4727
|
+
function Pa({ title: t }) {
|
|
4728
|
+
const e = q(), n = ae.value, [r, i] = R("");
|
|
4686
4729
|
function s() {
|
|
4687
|
-
Yt(),
|
|
4730
|
+
Yt(), ke({ id: "chat" });
|
|
4688
4731
|
}
|
|
4689
4732
|
function o() {
|
|
4690
|
-
|
|
4733
|
+
ke({ id: "chat" });
|
|
4691
4734
|
}
|
|
4692
4735
|
function l(a) {
|
|
4693
4736
|
a.preventDefault();
|
|
4694
4737
|
const u = r.trim().toUpperCase();
|
|
4695
|
-
u && (
|
|
4738
|
+
u && (wa(u), ke({ id: "chat" }));
|
|
4696
4739
|
}
|
|
4697
4740
|
return /* @__PURE__ */ h("div", { class: "jex-home", children: [
|
|
4698
4741
|
/* @__PURE__ */ h("div", { class: "jex-home-hero", children: [
|
|
4699
4742
|
/* @__PURE__ */ h("div", { class: "jex-home-avatar", children: [
|
|
4700
|
-
/* @__PURE__ */ h(
|
|
4743
|
+
/* @__PURE__ */ h(Ci, { size: 24 }),
|
|
4701
4744
|
/* @__PURE__ */ h("span", { class: "jex-home-status-dot" })
|
|
4702
4745
|
] }),
|
|
4703
4746
|
/* @__PURE__ */ h("div", { class: "jex-home-hero-text", children: [
|
|
@@ -4740,8 +4783,8 @@ function Ta({ title: t }) {
|
|
|
4740
4783
|
] })
|
|
4741
4784
|
] });
|
|
4742
4785
|
}
|
|
4743
|
-
function
|
|
4744
|
-
const e =
|
|
4786
|
+
function qa({ title: t }) {
|
|
4787
|
+
const e = q();
|
|
4745
4788
|
return /* @__PURE__ */ h("div", { class: "jex-selection", children: [
|
|
4746
4789
|
/* @__PURE__ */ h("h2", { class: "jex-selection-title", children: e.howCanWeHelp }),
|
|
4747
4790
|
/* @__PURE__ */ h("div", { class: "jex-selection-options", children: [
|
|
@@ -4749,7 +4792,7 @@ function Ra({ title: t }) {
|
|
|
4749
4792
|
"button",
|
|
4750
4793
|
{
|
|
4751
4794
|
class: "jex-selection-option",
|
|
4752
|
-
onClick: () =>
|
|
4795
|
+
onClick: () => ke({ id: "chat" }),
|
|
4753
4796
|
children: [
|
|
4754
4797
|
/* @__PURE__ */ h("span", { class: "jex-selection-icon", children: "💬" }),
|
|
4755
4798
|
/* @__PURE__ */ h("span", { class: "jex-selection-label", children: e.chatWith.replace("{title}", t) }),
|
|
@@ -4761,7 +4804,7 @@ function Ra({ title: t }) {
|
|
|
4761
4804
|
"button",
|
|
4762
4805
|
{
|
|
4763
4806
|
class: "jex-selection-option",
|
|
4764
|
-
onClick: () =>
|
|
4807
|
+
onClick: () => ke({ id: "form" }),
|
|
4765
4808
|
children: [
|
|
4766
4809
|
/* @__PURE__ */ h("span", { class: "jex-selection-icon", children: "📝" }),
|
|
4767
4810
|
/* @__PURE__ */ h("span", { class: "jex-selection-label", children: e.submitTicket }),
|
|
@@ -4772,13 +4815,13 @@ function Ra({ title: t }) {
|
|
|
4772
4815
|
] })
|
|
4773
4816
|
] });
|
|
4774
4817
|
}
|
|
4775
|
-
function
|
|
4818
|
+
function Ti(t, e) {
|
|
4776
4819
|
const n = {
|
|
4777
4820
|
get(r, i) {
|
|
4778
4821
|
if (typeof i == "string") {
|
|
4779
4822
|
const s = [...e, i];
|
|
4780
|
-
return
|
|
4781
|
-
} else if (i ===
|
|
4823
|
+
return Ti(t, s);
|
|
4824
|
+
} else if (i === ai) {
|
|
4782
4825
|
if (e.length < 1) {
|
|
4783
4826
|
const s = [t, ...e].join(".");
|
|
4784
4827
|
throw new Error(
|
|
@@ -4792,91 +4835,163 @@ function ki(t, e) {
|
|
|
4792
4835
|
};
|
|
4793
4836
|
return new Proxy({}, n);
|
|
4794
4837
|
}
|
|
4795
|
-
const
|
|
4796
|
-
|
|
4797
|
-
function
|
|
4798
|
-
const
|
|
4799
|
-
const
|
|
4800
|
-
if (!
|
|
4838
|
+
const Ma = () => Ti("components", []), Re = io;
|
|
4839
|
+
Ma();
|
|
4840
|
+
function La(t, e) {
|
|
4841
|
+
const n = _t(null), r = ze(!1), i = ze(!1), s = ze(!1), o = ze(null), l = St(Re.functions.chat.public.sessions.createOrResume), a = async (p) => {
|
|
4842
|
+
const f = xt.value;
|
|
4843
|
+
if (!f)
|
|
4801
4844
|
return console.warn("[JexityChat] No bootstrap token — session creation blocked."), null;
|
|
4802
|
-
const
|
|
4845
|
+
const g = await l({
|
|
4803
4846
|
orgSlug: t,
|
|
4804
|
-
|
|
4805
|
-
|
|
4847
|
+
...e ? { projSlug: e } : {},
|
|
4848
|
+
visitorId: p,
|
|
4849
|
+
bootstrapToken: f,
|
|
4806
4850
|
...mt.value ? { source: mt.value } : {}
|
|
4807
4851
|
});
|
|
4808
|
-
|
|
4809
|
-
const
|
|
4810
|
-
return
|
|
4811
|
-
},
|
|
4812
|
-
if (
|
|
4813
|
-
return
|
|
4814
|
-
if (
|
|
4852
|
+
o.value = g.status;
|
|
4853
|
+
const x = { sessionId: g.sessionId, visitorId: p };
|
|
4854
|
+
return n.current = x, { session: x, result: g };
|
|
4855
|
+
}, u = We(async () => {
|
|
4856
|
+
if (n.current)
|
|
4857
|
+
return n.current;
|
|
4858
|
+
if (s.value)
|
|
4815
4859
|
return null;
|
|
4816
|
-
|
|
4817
|
-
const
|
|
4860
|
+
r.value = !0;
|
|
4861
|
+
const p = ae.value !== null, f = ae.value ?? Yt();
|
|
4818
4862
|
try {
|
|
4819
|
-
const
|
|
4820
|
-
return
|
|
4821
|
-
} catch (
|
|
4822
|
-
return console.error("[JexityChat] Failed to create session:",
|
|
4863
|
+
const g = await a(f);
|
|
4864
|
+
return g ? (p && g.result.isNew && (i.value = !0, s.value = !0), g.session) : null;
|
|
4865
|
+
} catch (g) {
|
|
4866
|
+
return console.error("[JexityChat] Failed to create session:", g), null;
|
|
4823
4867
|
} finally {
|
|
4824
|
-
|
|
4868
|
+
r.value = !1;
|
|
4825
4869
|
}
|
|
4826
|
-
}, [t,
|
|
4827
|
-
|
|
4828
|
-
const
|
|
4829
|
-
|
|
4870
|
+
}, [t, e, l, r, i, s]), d = We(async () => {
|
|
4871
|
+
n.current = null, s.value = !1, i.value = !1;
|
|
4872
|
+
const p = Yt();
|
|
4873
|
+
r.value = !0;
|
|
4830
4874
|
try {
|
|
4831
|
-
return (await
|
|
4832
|
-
} catch (
|
|
4833
|
-
return console.error("[JexityChat] Failed to create fresh session:",
|
|
4875
|
+
return (await a(p))?.session ?? null;
|
|
4876
|
+
} catch (f) {
|
|
4877
|
+
return console.error("[JexityChat] Failed to create fresh session:", f), null;
|
|
4834
4878
|
} finally {
|
|
4835
|
-
|
|
4879
|
+
r.value = !1;
|
|
4836
4880
|
}
|
|
4837
|
-
}, [t,
|
|
4881
|
+
}, [t, e, l, r, i, s, o]), c = n.current;
|
|
4838
4882
|
return {
|
|
4839
|
-
sessionId:
|
|
4840
|
-
visitorId:
|
|
4841
|
-
isLoading:
|
|
4842
|
-
sessionNotFound:
|
|
4843
|
-
resumeFailed:
|
|
4844
|
-
sessionStatus:
|
|
4845
|
-
isOrgDeleted:
|
|
4846
|
-
ensureSession:
|
|
4847
|
-
startFresh:
|
|
4883
|
+
sessionId: c?.sessionId ?? null,
|
|
4884
|
+
visitorId: c?.visitorId ?? null,
|
|
4885
|
+
isLoading: r.value,
|
|
4886
|
+
sessionNotFound: i.value,
|
|
4887
|
+
resumeFailed: s.value,
|
|
4888
|
+
sessionStatus: o.value,
|
|
4889
|
+
isOrgDeleted: o.value === "org_deleted",
|
|
4890
|
+
ensureSession: u,
|
|
4891
|
+
startFresh: d
|
|
4848
4892
|
};
|
|
4849
4893
|
}
|
|
4850
|
-
|
|
4894
|
+
const Oa = (...t) => t.filter((e, n, r) => !!e && e.trim() !== "" && r.indexOf(e) === n).join(" ").trim();
|
|
4895
|
+
const fr = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
4896
|
+
const Na = (t) => t.replace(
|
|
4897
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
4898
|
+
(e, n, r) => r ? r.toUpperCase() : n.toLowerCase()
|
|
4899
|
+
);
|
|
4900
|
+
const pr = (t) => {
|
|
4901
|
+
const e = Na(t);
|
|
4902
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
4903
|
+
};
|
|
4904
|
+
var za = {
|
|
4905
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4906
|
+
width: 24,
|
|
4907
|
+
height: 24,
|
|
4908
|
+
viewBox: "0 0 24 24",
|
|
4909
|
+
fill: "none",
|
|
4910
|
+
stroke: "currentColor",
|
|
4911
|
+
"stroke-width": "2",
|
|
4912
|
+
"stroke-linecap": "round",
|
|
4913
|
+
"stroke-linejoin": "round"
|
|
4914
|
+
};
|
|
4915
|
+
const Qa = (t) => {
|
|
4916
|
+
for (const e in t)
|
|
4917
|
+
if (e.startsWith("aria-") || e === "role" || e === "title")
|
|
4918
|
+
return !0;
|
|
4919
|
+
return !1;
|
|
4920
|
+
};
|
|
4921
|
+
const Ba = ({
|
|
4922
|
+
color: t = "currentColor",
|
|
4923
|
+
size: e = 24,
|
|
4924
|
+
strokeWidth: n = 2,
|
|
4925
|
+
absoluteStrokeWidth: r,
|
|
4926
|
+
children: i,
|
|
4927
|
+
iconNode: s,
|
|
4928
|
+
class: o = "",
|
|
4929
|
+
...l
|
|
4930
|
+
}) => O(
|
|
4931
|
+
"svg",
|
|
4932
|
+
{
|
|
4933
|
+
...za,
|
|
4934
|
+
width: String(e),
|
|
4935
|
+
height: e,
|
|
4936
|
+
stroke: t,
|
|
4937
|
+
"stroke-width": r ? Number(n) * 24 / Number(e) : n,
|
|
4938
|
+
class: ["lucide", o].join(" "),
|
|
4939
|
+
...!i && !Qa(l) && { "aria-hidden": "true" },
|
|
4940
|
+
...l
|
|
4941
|
+
},
|
|
4942
|
+
[...s.map(([a, u]) => O(a, u)), ...ee(i)]
|
|
4943
|
+
);
|
|
4944
|
+
const Fa = (t, e) => {
|
|
4945
|
+
const n = ({ class: r = "", className: i = "", children: s, ...o }) => O(
|
|
4946
|
+
Ba,
|
|
4947
|
+
{
|
|
4948
|
+
...o,
|
|
4949
|
+
iconNode: e,
|
|
4950
|
+
class: Oa(
|
|
4951
|
+
`lucide-${fr(pr(t))}`,
|
|
4952
|
+
`lucide-${fr(t)}`,
|
|
4953
|
+
r,
|
|
4954
|
+
i
|
|
4955
|
+
)
|
|
4956
|
+
},
|
|
4957
|
+
s
|
|
4958
|
+
);
|
|
4959
|
+
return n.displayName = pr(t), n;
|
|
4960
|
+
};
|
|
4961
|
+
const Da = Fa("corner-up-left", [
|
|
4962
|
+
["path", { d: "M20 20v-7a4 4 0 0 0-4-4H4", key: "1nkjon" }],
|
|
4963
|
+
["path", { d: "M9 14 4 9l5-5", key: "102s5s" }]
|
|
4964
|
+
]);
|
|
4965
|
+
function vn() {
|
|
4851
4966
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
4852
4967
|
}
|
|
4853
|
-
var me =
|
|
4854
|
-
function
|
|
4968
|
+
var me = vn();
|
|
4969
|
+
function Ri(t) {
|
|
4855
4970
|
me = t;
|
|
4856
4971
|
}
|
|
4857
4972
|
var ce = { exec: () => null };
|
|
4858
|
-
function
|
|
4973
|
+
function b(t, e = "") {
|
|
4859
4974
|
let n = typeof t == "string" ? t : t.source, r = { replace: (i, s) => {
|
|
4860
4975
|
let o = typeof s == "string" ? s : s.source;
|
|
4861
4976
|
return o = o.replace(I.caret, "$1"), n = n.replace(i, o), r;
|
|
4862
4977
|
}, getRegex: () => new RegExp(n, e) };
|
|
4863
4978
|
return r;
|
|
4864
4979
|
}
|
|
4865
|
-
var
|
|
4980
|
+
var Ua = (() => {
|
|
4866
4981
|
try {
|
|
4867
4982
|
return !!new RegExp("(?<=1)(?<!1)");
|
|
4868
4983
|
} catch {
|
|
4869
4984
|
return !1;
|
|
4870
4985
|
}
|
|
4871
|
-
})(), I = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (t) => new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}#`), htmlBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}>`) },
|
|
4872
|
-
]`).replace("lheading",
|
|
4873
|
-
function
|
|
4986
|
+
})(), I = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (t) => new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}#`), htmlBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}>`) }, Va = /^(?:[ \t]*(?:\n|$))+/, Wa = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ha = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, tt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Ja = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, _n = / {0,3}(?:[*+-]|\d{1,9}[.)])/, $i = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ai = b($i).replace(/bull/g, _n).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Ga = b($i).replace(/bull/g, _n).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), kn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ka = /^[^\n]+/, wn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Za = b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", wn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Xa = b(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, _n).getRegex(), Tt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Sn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ya = b("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Sn).replace("tag", Tt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ii = b(kn).replace("hr", tt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Tt).getRegex(), el = b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ii).getRegex(), jn = { blockquote: el, code: Wa, def: Za, fences: Ha, heading: Ja, hr: tt, html: Ya, lheading: Ai, list: Xa, newline: Va, paragraph: Ii, table: ce, text: Ka }, gr = b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", tt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Tt).getRegex(), tl = { ...jn, lheading: Ga, table: gr, paragraph: b(kn).replace("hr", tt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gr).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Tt).getRegex() }, nl = { ...jn, html: b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", Sn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: ce, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: b(kn).replace("hr", tt).replace("heading", ` *#{1,6} *[^
|
|
4987
|
+
]`).replace("lheading", Ai).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, rl = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, il = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Ei = /^( {2,}|\\)\n(?!\s*$)/, sl = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ee = /[\p{P}\p{S}]/u, Rt = /[\s\p{P}\p{S}]/u, Cn = /[^\s\p{P}\p{S}]/u, ol = b(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Rt).getRegex(), Pi = /(?!~)[\p{P}\p{S}]/u, al = /(?!~)[\s\p{P}\p{S}]/u, ll = /(?:[^\s\p{P}\p{S}]|~)/u, cl = b(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Ua ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), qi = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ul = b(qi, "u").replace(/punct/g, Ee).getRegex(), hl = b(qi, "u").replace(/punct/g, Pi).getRegex(), Mi = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", dl = b(Mi, "gu").replace(/notPunctSpace/g, Cn).replace(/punctSpace/g, Rt).replace(/punct/g, Ee).getRegex(), fl = b(Mi, "gu").replace(/notPunctSpace/g, ll).replace(/punctSpace/g, al).replace(/punct/g, Pi).getRegex(), pl = b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Cn).replace(/punctSpace/g, Rt).replace(/punct/g, Ee).getRegex(), gl = b(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ee).getRegex(), ml = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", xl = b(ml, "gu").replace(/notPunctSpace/g, Cn).replace(/punctSpace/g, Rt).replace(/punct/g, Ee).getRegex(), bl = b(/\\(punct)/, "gu").replace(/punct/g, Ee).getRegex(), yl = b(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), vl = b(Sn).replace("(?:-->|$)", "-->").getRegex(), _l = b("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", vl).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), bt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, kl = b(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", bt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Li = b(/^!?\[(label)\]\[(ref)\]/).replace("label", bt).replace("ref", wn).getRegex(), Oi = b(/^!?\[(ref)\](?:\[\])?/).replace("ref", wn).getRegex(), wl = b("reflink|nolink(?!\\()", "g").replace("reflink", Li).replace("nolink", Oi).getRegex(), mr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Tn = { _backpedal: ce, anyPunctuation: bl, autolink: yl, blockSkip: cl, br: Ei, code: il, del: ce, delLDelim: ce, delRDelim: ce, emStrongLDelim: ul, emStrongRDelimAst: dl, emStrongRDelimUnd: pl, escape: rl, link: kl, nolink: Oi, punctuation: ol, reflink: Li, reflinkSearch: wl, tag: _l, text: sl, url: ce }, Sl = { ...Tn, link: b(/^!?\[(label)\]\((.*?)\)/).replace("label", bt).getRegex(), reflink: b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", bt).getRegex() }, en = { ...Tn, emStrongRDelimAst: fl, emStrongLDelim: hl, delLDelim: gl, delRDelim: xl, url: b(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", mr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: b(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", mr).getRegex() }, jl = { ...en, br: b(Ei).replace("{2,}", "*").getRegex(), text: b(en.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, at = { normal: jn, gfm: tl, pedantic: nl }, qe = { normal: Tn, gfm: en, breaks: jl, pedantic: Sl }, Cl = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, xr = (t) => Cl[t];
|
|
4988
|
+
function Z(t, e) {
|
|
4874
4989
|
if (e) {
|
|
4875
|
-
if (I.escapeTest.test(t)) return t.replace(I.escapeReplace,
|
|
4876
|
-
} else if (I.escapeTestNoEncode.test(t)) return t.replace(I.escapeReplaceNoEncode,
|
|
4990
|
+
if (I.escapeTest.test(t)) return t.replace(I.escapeReplace, xr);
|
|
4991
|
+
} else if (I.escapeTestNoEncode.test(t)) return t.replace(I.escapeReplaceNoEncode, xr);
|
|
4877
4992
|
return t;
|
|
4878
4993
|
}
|
|
4879
|
-
function
|
|
4994
|
+
function br(t) {
|
|
4880
4995
|
try {
|
|
4881
4996
|
t = encodeURI(t).replace(I.percentDecode, "%");
|
|
4882
4997
|
} catch {
|
|
@@ -4884,7 +4999,7 @@ function gr(t) {
|
|
|
4884
4999
|
}
|
|
4885
5000
|
return t;
|
|
4886
5001
|
}
|
|
4887
|
-
function
|
|
5002
|
+
function yr(t, e) {
|
|
4888
5003
|
let n = t.replace(I.findPipe, (s, o, l) => {
|
|
4889
5004
|
let a = !1, u = o;
|
|
4890
5005
|
for (; --u >= 0 && l[u] === "\\"; ) a = !a;
|
|
@@ -4895,7 +5010,7 @@ function mr(t, e) {
|
|
|
4895
5010
|
for (; i < r.length; i++) r[i] = r[i].trim().replace(I.slashPipe, "|");
|
|
4896
5011
|
return r;
|
|
4897
5012
|
}
|
|
4898
|
-
function
|
|
5013
|
+
function Me(t, e, n) {
|
|
4899
5014
|
let r = t.length;
|
|
4900
5015
|
if (r === 0) return "";
|
|
4901
5016
|
let i = 0;
|
|
@@ -4903,7 +5018,7 @@ function Le(t, e, n) {
|
|
|
4903
5018
|
i++;
|
|
4904
5019
|
return t.slice(0, r - i);
|
|
4905
5020
|
}
|
|
4906
|
-
function
|
|
5021
|
+
function Tl(t, e) {
|
|
4907
5022
|
if (t.indexOf(e[1]) === -1) return -1;
|
|
4908
5023
|
let n = 0;
|
|
4909
5024
|
for (let r = 0; r < t.length; r++) if (t[r] === "\\") r++;
|
|
@@ -4911,7 +5026,7 @@ function pl(t, e) {
|
|
|
4911
5026
|
else if (t[r] === e[1] && (n--, n < 0)) return r;
|
|
4912
5027
|
return n > 0 ? -2 : -1;
|
|
4913
5028
|
}
|
|
4914
|
-
function
|
|
5029
|
+
function Rl(t, e = 0) {
|
|
4915
5030
|
let n = e, r = "";
|
|
4916
5031
|
for (let i of t) if (i === " ") {
|
|
4917
5032
|
let s = 4 - n % 4;
|
|
@@ -4919,13 +5034,13 @@ function gl(t, e = 0) {
|
|
|
4919
5034
|
} else r += i, n++;
|
|
4920
5035
|
return r;
|
|
4921
5036
|
}
|
|
4922
|
-
function
|
|
5037
|
+
function vr(t, e, n, r, i) {
|
|
4923
5038
|
let s = e.href, o = e.title || null, l = t[1].replace(i.other.outputLinkReplace, "$1");
|
|
4924
5039
|
r.state.inLink = !0;
|
|
4925
5040
|
let a = { type: t[0].charAt(0) === "!" ? "image" : "link", raw: n, href: s, title: o, text: l, tokens: r.inlineTokens(l) };
|
|
4926
5041
|
return r.state.inLink = !1, a;
|
|
4927
5042
|
}
|
|
4928
|
-
function
|
|
5043
|
+
function $l(t, e, n) {
|
|
4929
5044
|
let r = t.match(n.other.indentCodeCompensation);
|
|
4930
5045
|
if (r === null) return e;
|
|
4931
5046
|
let i = r[1];
|
|
@@ -4938,7 +5053,7 @@ function ml(t, e, n) {
|
|
|
4938
5053
|
}).join(`
|
|
4939
5054
|
`);
|
|
4940
5055
|
}
|
|
4941
|
-
var
|
|
5056
|
+
var yt = class {
|
|
4942
5057
|
options;
|
|
4943
5058
|
rules;
|
|
4944
5059
|
lexer;
|
|
@@ -4953,14 +5068,14 @@ var bt = class {
|
|
|
4953
5068
|
let e = this.rules.block.code.exec(t);
|
|
4954
5069
|
if (e) {
|
|
4955
5070
|
let n = e[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
4956
|
-
return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n :
|
|
5071
|
+
return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : Me(n, `
|
|
4957
5072
|
`) };
|
|
4958
5073
|
}
|
|
4959
5074
|
}
|
|
4960
5075
|
fences(t) {
|
|
4961
5076
|
let e = this.rules.block.fences.exec(t);
|
|
4962
5077
|
if (e) {
|
|
4963
|
-
let n = e[0], r =
|
|
5078
|
+
let n = e[0], r = $l(n, e[3] || "", this.rules);
|
|
4964
5079
|
return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
|
|
4965
5080
|
}
|
|
4966
5081
|
}
|
|
@@ -4969,7 +5084,7 @@ var bt = class {
|
|
|
4969
5084
|
if (e) {
|
|
4970
5085
|
let n = e[2].trim();
|
|
4971
5086
|
if (this.rules.other.endingHash.test(n)) {
|
|
4972
|
-
let r =
|
|
5087
|
+
let r = Me(n, "#");
|
|
4973
5088
|
(this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
|
|
4974
5089
|
}
|
|
4975
5090
|
return { type: "heading", raw: e[0], depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
@@ -4977,13 +5092,13 @@ var bt = class {
|
|
|
4977
5092
|
}
|
|
4978
5093
|
hr(t) {
|
|
4979
5094
|
let e = this.rules.block.hr.exec(t);
|
|
4980
|
-
if (e) return { type: "hr", raw:
|
|
5095
|
+
if (e) return { type: "hr", raw: Me(e[0], `
|
|
4981
5096
|
`) };
|
|
4982
5097
|
}
|
|
4983
5098
|
blockquote(t) {
|
|
4984
5099
|
let e = this.rules.block.blockquote.exec(t);
|
|
4985
5100
|
if (e) {
|
|
4986
|
-
let n =
|
|
5101
|
+
let n = Me(e[0], `
|
|
4987
5102
|
`).split(`
|
|
4988
5103
|
`), r = "", i = "", s = [];
|
|
4989
5104
|
for (; n.length > 0; ) {
|
|
@@ -5005,14 +5120,14 @@ ${d}` : d;
|
|
|
5005
5120
|
if (p?.type === "blockquote") {
|
|
5006
5121
|
let f = p, g = f.raw + `
|
|
5007
5122
|
` + n.join(`
|
|
5008
|
-
`),
|
|
5009
|
-
s[s.length - 1] =
|
|
5123
|
+
`), x = this.blockquote(g);
|
|
5124
|
+
s[s.length - 1] = x, r = r.substring(0, r.length - f.raw.length) + x.raw, i = i.substring(0, i.length - f.text.length) + x.text;
|
|
5010
5125
|
break;
|
|
5011
5126
|
} else if (p?.type === "list") {
|
|
5012
5127
|
let f = p, g = f.raw + `
|
|
5013
5128
|
` + n.join(`
|
|
5014
|
-
`),
|
|
5015
|
-
s[s.length - 1] =
|
|
5129
|
+
`), x = this.list(g);
|
|
5130
|
+
s[s.length - 1] = x, r = r.substring(0, r.length - p.raw.length) + x.raw, i = i.substring(0, i.length - f.raw.length) + x.raw, n = g.substring(s.at(-1).raw.length).split(`
|
|
5016
5131
|
`);
|
|
5017
5132
|
continue;
|
|
5018
5133
|
}
|
|
@@ -5030,25 +5145,25 @@ ${d}` : d;
|
|
|
5030
5145
|
let a = !1, u = "", d = "";
|
|
5031
5146
|
if (!(e = s.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
5032
5147
|
u = e[0], t = t.substring(u.length);
|
|
5033
|
-
let c =
|
|
5148
|
+
let c = Rl(e[2].split(`
|
|
5034
5149
|
`, 1)[0], e[1].length), p = t.split(`
|
|
5035
5150
|
`, 1)[0], f = !c.trim(), g = 0;
|
|
5036
5151
|
if (this.options.pedantic ? (g = 2, d = c.trimStart()) : f ? g = e[1].length + 1 : (g = c.search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, d = c.slice(g), g += e[1].length), f && this.rules.other.blankLine.test(p) && (u += p + `
|
|
5037
5152
|
`, t = t.substring(p.length + 1), a = !0), !a) {
|
|
5038
|
-
let
|
|
5153
|
+
let x = this.rules.other.nextBulletRegex(g), w = this.rules.other.hrRegex(g), _ = this.rules.other.fencesBeginRegex(g), k = this.rules.other.headingBeginRegex(g), H = this.rules.other.htmlBeginRegex(g), J = this.rules.other.blockquoteBeginRegex(g);
|
|
5039
5154
|
for (; t; ) {
|
|
5040
5155
|
let ie = t.split(`
|
|
5041
|
-
`, 1)[0],
|
|
5042
|
-
if (p = ie, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "),
|
|
5043
|
-
if (
|
|
5044
|
-
` +
|
|
5156
|
+
`, 1)[0], Q;
|
|
5157
|
+
if (p = ie, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), Q = p) : Q = p.replace(this.rules.other.tabCharGlobal, " "), _.test(p) || k.test(p) || H.test(p) || J.test(p) || x.test(p) || w.test(p)) break;
|
|
5158
|
+
if (Q.search(this.rules.other.nonSpaceChar) >= g || !p.trim()) d += `
|
|
5159
|
+
` + Q.slice(g);
|
|
5045
5160
|
else {
|
|
5046
5161
|
if (f || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || _.test(c) || k.test(c) || w.test(c)) break;
|
|
5047
5162
|
d += `
|
|
5048
5163
|
` + p;
|
|
5049
5164
|
}
|
|
5050
5165
|
f = !p.trim(), u += ie + `
|
|
5051
|
-
`, t = t.substring(ie.length + 1), c =
|
|
5166
|
+
`, t = t.substring(ie.length + 1), c = Q.slice(g);
|
|
5052
5167
|
}
|
|
5053
5168
|
}
|
|
5054
5169
|
i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(u) && (o = !0)), i.items.push({ type: "list_item", raw: u, task: !!this.options.gfm && this.rules.other.listIsTask.test(d), loose: !1, text: d, tokens: [] }), i.raw += u;
|
|
@@ -5098,12 +5213,12 @@ ${d}` : d;
|
|
|
5098
5213
|
table(t) {
|
|
5099
5214
|
let e = this.rules.block.table.exec(t);
|
|
5100
5215
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
5101
|
-
let n =
|
|
5216
|
+
let n = yr(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
5102
5217
|
`) : [], s = { type: "table", raw: e[0], header: [], align: [], rows: [] };
|
|
5103
5218
|
if (n.length === r.length) {
|
|
5104
5219
|
for (let o of r) this.rules.other.tableAlignRight.test(o) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? s.align.push("left") : s.align.push(null);
|
|
5105
5220
|
for (let o = 0; o < n.length; o++) s.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: s.align[o] });
|
|
5106
|
-
for (let o of i) s.rows.push(
|
|
5221
|
+
for (let o of i) s.rows.push(yr(o, s.header.length).map((l, a) => ({ text: l, tokens: this.lexer.inline(l), header: !1, align: s.align[a] })));
|
|
5107
5222
|
return s;
|
|
5108
5223
|
}
|
|
5109
5224
|
}
|
|
@@ -5140,10 +5255,10 @@ ${d}` : d;
|
|
|
5140
5255
|
let n = e[2].trim();
|
|
5141
5256
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
5142
5257
|
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
5143
|
-
let s =
|
|
5258
|
+
let s = Me(n.slice(0, -1), "\\");
|
|
5144
5259
|
if ((n.length - s.length) % 2 === 0) return;
|
|
5145
5260
|
} else {
|
|
5146
|
-
let s =
|
|
5261
|
+
let s = Tl(e[2], "()");
|
|
5147
5262
|
if (s === -2) return;
|
|
5148
5263
|
if (s > -1) {
|
|
5149
5264
|
let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + s;
|
|
@@ -5155,7 +5270,7 @@ ${d}` : d;
|
|
|
5155
5270
|
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
5156
5271
|
s && (r = s[1], i = s[3]);
|
|
5157
5272
|
} else i = e[3] ? e[3].slice(1, -1) : "";
|
|
5158
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
5273
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), vr(e, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
|
|
5159
5274
|
}
|
|
5160
5275
|
}
|
|
5161
5276
|
reflink(t, e) {
|
|
@@ -5166,7 +5281,7 @@ ${d}` : d;
|
|
|
5166
5281
|
let s = n[0].charAt(0);
|
|
5167
5282
|
return { type: "text", raw: s, text: s };
|
|
5168
5283
|
}
|
|
5169
|
-
return
|
|
5284
|
+
return vr(n, i, n[0], this.lexer, this.rules);
|
|
5170
5285
|
}
|
|
5171
5286
|
}
|
|
5172
5287
|
emStrong(t, e, n = "") {
|
|
@@ -5251,19 +5366,19 @@ ${d}` : d;
|
|
|
5251
5366
|
return { type: "text", raw: e[0], text: e[0], escaped: n };
|
|
5252
5367
|
}
|
|
5253
5368
|
}
|
|
5254
|
-
},
|
|
5369
|
+
}, B = class tn {
|
|
5255
5370
|
tokens;
|
|
5256
5371
|
options;
|
|
5257
5372
|
state;
|
|
5258
5373
|
inlineQueue;
|
|
5259
5374
|
tokenizer;
|
|
5260
5375
|
constructor(e) {
|
|
5261
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || me, this.options.tokenizer = this.options.tokenizer || new
|
|
5262
|
-
let n = { other: I, block: at.normal, inline:
|
|
5263
|
-
this.options.pedantic ? (n.block = at.pedantic, n.inline =
|
|
5376
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || me, this.options.tokenizer = this.options.tokenizer || new yt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
5377
|
+
let n = { other: I, block: at.normal, inline: qe.normal };
|
|
5378
|
+
this.options.pedantic ? (n.block = at.pedantic, n.inline = qe.pedantic) : this.options.gfm && (n.block = at.gfm, this.options.breaks ? n.inline = qe.breaks : n.inline = qe.gfm), this.tokenizer.rules = n;
|
|
5264
5379
|
}
|
|
5265
5380
|
static get rules() {
|
|
5266
|
-
return { block: at, inline:
|
|
5381
|
+
return { block: at, inline: qe };
|
|
5267
5382
|
}
|
|
5268
5383
|
static lex(e, n) {
|
|
5269
5384
|
return new tn(n).lex(e);
|
|
@@ -5459,7 +5574,7 @@ ${d}` : d;
|
|
|
5459
5574
|
}
|
|
5460
5575
|
return n;
|
|
5461
5576
|
}
|
|
5462
|
-
},
|
|
5577
|
+
}, vt = class {
|
|
5463
5578
|
options;
|
|
5464
5579
|
parser;
|
|
5465
5580
|
constructor(t) {
|
|
@@ -5471,8 +5586,8 @@ ${d}` : d;
|
|
|
5471
5586
|
code({ text: t, lang: e, escaped: n }) {
|
|
5472
5587
|
let r = (e || "").match(I.notSpaceStart)?.[0], i = t.replace(I.endingNewline, "") + `
|
|
5473
5588
|
`;
|
|
5474
|
-
return r ? '<pre><code class="language-' +
|
|
5475
|
-
` : "<pre><code>" + (n ? i :
|
|
5589
|
+
return r ? '<pre><code class="language-' + Z(r) + '">' + (n ? i : Z(i, !0)) + `</code></pre>
|
|
5590
|
+
` : "<pre><code>" + (n ? i : Z(i, !0)) + `</code></pre>
|
|
5476
5591
|
`;
|
|
5477
5592
|
}
|
|
5478
5593
|
blockquote({ tokens: t }) {
|
|
@@ -5550,7 +5665,7 @@ ${t}</tr>
|
|
|
5550
5665
|
return `<em>${this.parser.parseInline(t)}</em>`;
|
|
5551
5666
|
}
|
|
5552
5667
|
codespan({ text: t }) {
|
|
5553
|
-
return `<code>${
|
|
5668
|
+
return `<code>${Z(t, !0)}</code>`;
|
|
5554
5669
|
}
|
|
5555
5670
|
br(t) {
|
|
5556
5671
|
return "<br>";
|
|
@@ -5559,24 +5674,24 @@ ${t}</tr>
|
|
|
5559
5674
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
5560
5675
|
}
|
|
5561
5676
|
link({ href: t, title: e, tokens: n }) {
|
|
5562
|
-
let r = this.parser.parseInline(n), i =
|
|
5677
|
+
let r = this.parser.parseInline(n), i = br(t);
|
|
5563
5678
|
if (i === null) return r;
|
|
5564
5679
|
t = i;
|
|
5565
5680
|
let s = '<a href="' + t + '"';
|
|
5566
|
-
return e && (s += ' title="' +
|
|
5681
|
+
return e && (s += ' title="' + Z(e) + '"'), s += ">" + r + "</a>", s;
|
|
5567
5682
|
}
|
|
5568
5683
|
image({ href: t, title: e, text: n, tokens: r }) {
|
|
5569
5684
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
5570
|
-
let i =
|
|
5571
|
-
if (i === null) return
|
|
5685
|
+
let i = br(t);
|
|
5686
|
+
if (i === null) return Z(n);
|
|
5572
5687
|
t = i;
|
|
5573
|
-
let s = `<img src="${t}" alt="${
|
|
5574
|
-
return e && (s += ` title="${
|
|
5688
|
+
let s = `<img src="${t}" alt="${Z(n)}"`;
|
|
5689
|
+
return e && (s += ` title="${Z(e)}"`), s += ">", s;
|
|
5575
5690
|
}
|
|
5576
5691
|
text(t) {
|
|
5577
|
-
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text :
|
|
5692
|
+
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : Z(t.text);
|
|
5578
5693
|
}
|
|
5579
|
-
},
|
|
5694
|
+
}, Rn = class {
|
|
5580
5695
|
strong({ text: t }) {
|
|
5581
5696
|
return t;
|
|
5582
5697
|
}
|
|
@@ -5607,12 +5722,12 @@ ${t}</tr>
|
|
|
5607
5722
|
checkbox({ raw: t }) {
|
|
5608
5723
|
return t;
|
|
5609
5724
|
}
|
|
5610
|
-
},
|
|
5725
|
+
}, F = class nn {
|
|
5611
5726
|
options;
|
|
5612
5727
|
renderer;
|
|
5613
5728
|
textRenderer;
|
|
5614
5729
|
constructor(e) {
|
|
5615
|
-
this.options = e || me, this.options.renderer = this.options.renderer || new
|
|
5730
|
+
this.options = e || me, this.options.renderer = this.options.renderer || new vt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Rn();
|
|
5616
5731
|
}
|
|
5617
5732
|
static parse(e, n) {
|
|
5618
5733
|
return new nn(n).parse(e);
|
|
@@ -5758,7 +5873,7 @@ ${t}</tr>
|
|
|
5758
5873
|
}
|
|
5759
5874
|
return r;
|
|
5760
5875
|
}
|
|
5761
|
-
},
|
|
5876
|
+
}, Qe = class {
|
|
5762
5877
|
options;
|
|
5763
5878
|
block;
|
|
5764
5879
|
constructor(t) {
|
|
@@ -5779,22 +5894,22 @@ ${t}</tr>
|
|
|
5779
5894
|
return t;
|
|
5780
5895
|
}
|
|
5781
5896
|
provideLexer() {
|
|
5782
|
-
return this.block ?
|
|
5897
|
+
return this.block ? B.lex : B.lexInline;
|
|
5783
5898
|
}
|
|
5784
5899
|
provideParser() {
|
|
5785
|
-
return this.block ?
|
|
5900
|
+
return this.block ? F.parse : F.parseInline;
|
|
5786
5901
|
}
|
|
5787
|
-
},
|
|
5788
|
-
defaults =
|
|
5902
|
+
}, Al = class {
|
|
5903
|
+
defaults = vn();
|
|
5789
5904
|
options = this.setOptions;
|
|
5790
5905
|
parse = this.parseMarkdown(!0);
|
|
5791
5906
|
parseInline = this.parseMarkdown(!1);
|
|
5792
|
-
Parser =
|
|
5793
|
-
Renderer =
|
|
5794
|
-
TextRenderer =
|
|
5795
|
-
Lexer =
|
|
5796
|
-
Tokenizer =
|
|
5797
|
-
Hooks =
|
|
5907
|
+
Parser = F;
|
|
5908
|
+
Renderer = vt;
|
|
5909
|
+
TextRenderer = Rn;
|
|
5910
|
+
Lexer = B;
|
|
5911
|
+
Tokenizer = yt;
|
|
5912
|
+
Hooks = Qe;
|
|
5798
5913
|
constructor(...t) {
|
|
5799
5914
|
this.use(...t);
|
|
5800
5915
|
}
|
|
@@ -5842,7 +5957,7 @@ ${t}</tr>
|
|
|
5842
5957
|
}
|
|
5843
5958
|
"childTokens" in i && i.childTokens && (e.childTokens[i.name] = i.childTokens);
|
|
5844
5959
|
}), r.extensions = e), n.renderer) {
|
|
5845
|
-
let i = this.defaults.renderer || new
|
|
5960
|
+
let i = this.defaults.renderer || new vt(this.defaults);
|
|
5846
5961
|
for (let s in n.renderer) {
|
|
5847
5962
|
if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
|
|
5848
5963
|
if (["options", "parser"].includes(s)) continue;
|
|
@@ -5855,7 +5970,7 @@ ${t}</tr>
|
|
|
5855
5970
|
r.renderer = i;
|
|
5856
5971
|
}
|
|
5857
5972
|
if (n.tokenizer) {
|
|
5858
|
-
let i = this.defaults.tokenizer || new
|
|
5973
|
+
let i = this.defaults.tokenizer || new yt(this.defaults);
|
|
5859
5974
|
for (let s in n.tokenizer) {
|
|
5860
5975
|
if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
|
|
5861
5976
|
if (["options", "rules", "lexer"].includes(s)) continue;
|
|
@@ -5868,13 +5983,13 @@ ${t}</tr>
|
|
|
5868
5983
|
r.tokenizer = i;
|
|
5869
5984
|
}
|
|
5870
5985
|
if (n.hooks) {
|
|
5871
|
-
let i = this.defaults.hooks || new
|
|
5986
|
+
let i = this.defaults.hooks || new Qe();
|
|
5872
5987
|
for (let s in n.hooks) {
|
|
5873
5988
|
if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
|
|
5874
5989
|
if (["options", "block"].includes(s)) continue;
|
|
5875
5990
|
let o = s, l = n.hooks[o], a = i[o];
|
|
5876
|
-
|
|
5877
|
-
if (this.defaults.async &&
|
|
5991
|
+
Qe.passThroughHooks.has(s) ? i[o] = (u) => {
|
|
5992
|
+
if (this.defaults.async && Qe.passThroughHooksRespectAsync.has(s)) return (async () => {
|
|
5878
5993
|
let c = await l.call(i, u);
|
|
5879
5994
|
return a.call(i, c);
|
|
5880
5995
|
})();
|
|
@@ -5905,10 +6020,10 @@ ${t}</tr>
|
|
|
5905
6020
|
return this.defaults = { ...this.defaults, ...t }, this;
|
|
5906
6021
|
}
|
|
5907
6022
|
lexer(t, e) {
|
|
5908
|
-
return
|
|
6023
|
+
return B.lex(t, e ?? this.defaults);
|
|
5909
6024
|
}
|
|
5910
6025
|
parser(t, e) {
|
|
5911
|
-
return
|
|
6026
|
+
return F.parse(t, e ?? this.defaults);
|
|
5912
6027
|
}
|
|
5913
6028
|
parseMarkdown(t) {
|
|
5914
6029
|
return (e, n) => {
|
|
@@ -5917,16 +6032,16 @@ ${t}</tr>
|
|
|
5917
6032
|
if (typeof e > "u" || e === null) return s(new Error("marked(): input parameter is undefined or null"));
|
|
5918
6033
|
if (typeof e != "string") return s(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
5919
6034
|
if (i.hooks && (i.hooks.options = i, i.hooks.block = t), i.async) return (async () => {
|
|
5920
|
-
let o = i.hooks ? await i.hooks.preprocess(e) : e, l = await (i.hooks ? await i.hooks.provideLexer() : t ?
|
|
6035
|
+
let o = i.hooks ? await i.hooks.preprocess(e) : e, l = await (i.hooks ? await i.hooks.provideLexer() : t ? B.lex : B.lexInline)(o, i), a = i.hooks ? await i.hooks.processAllTokens(l) : l;
|
|
5921
6036
|
i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
|
|
5922
|
-
let u = await (i.hooks ? await i.hooks.provideParser() : t ?
|
|
6037
|
+
let u = await (i.hooks ? await i.hooks.provideParser() : t ? F.parse : F.parseInline)(a, i);
|
|
5923
6038
|
return i.hooks ? await i.hooks.postprocess(u) : u;
|
|
5924
6039
|
})().catch(s);
|
|
5925
6040
|
try {
|
|
5926
6041
|
i.hooks && (e = i.hooks.preprocess(e));
|
|
5927
|
-
let o = (i.hooks ? i.hooks.provideLexer() : t ?
|
|
6042
|
+
let o = (i.hooks ? i.hooks.provideLexer() : t ? B.lex : B.lexInline)(e, i);
|
|
5928
6043
|
i.hooks && (o = i.hooks.processAllTokens(o)), i.walkTokens && this.walkTokens(o, i.walkTokens);
|
|
5929
|
-
let l = (i.hooks ? i.hooks.provideParser() : t ?
|
|
6044
|
+
let l = (i.hooks ? i.hooks.provideParser() : t ? F.parse : F.parseInline)(o, i);
|
|
5930
6045
|
return i.hooks && (l = i.hooks.postprocess(l)), l;
|
|
5931
6046
|
} catch (o) {
|
|
5932
6047
|
return s(o);
|
|
@@ -5937,51 +6052,51 @@ ${t}</tr>
|
|
|
5937
6052
|
return (n) => {
|
|
5938
6053
|
if (n.message += `
|
|
5939
6054
|
Please report this to https://github.com/markedjs/marked.`, t) {
|
|
5940
|
-
let r = "<p>An error occurred:</p><pre>" +
|
|
6055
|
+
let r = "<p>An error occurred:</p><pre>" + Z(n.message + "", !0) + "</pre>";
|
|
5941
6056
|
return e ? Promise.resolve(r) : r;
|
|
5942
6057
|
}
|
|
5943
6058
|
if (e) return Promise.reject(n);
|
|
5944
6059
|
throw n;
|
|
5945
6060
|
};
|
|
5946
6061
|
}
|
|
5947
|
-
}, pe = new
|
|
6062
|
+
}, pe = new Al();
|
|
5948
6063
|
function v(t, e) {
|
|
5949
6064
|
return pe.parse(t, e);
|
|
5950
6065
|
}
|
|
5951
6066
|
v.options = v.setOptions = function(t) {
|
|
5952
|
-
return pe.setOptions(t), v.defaults = pe.defaults,
|
|
6067
|
+
return pe.setOptions(t), v.defaults = pe.defaults, Ri(v.defaults), v;
|
|
5953
6068
|
};
|
|
5954
|
-
v.getDefaults =
|
|
6069
|
+
v.getDefaults = vn;
|
|
5955
6070
|
v.defaults = me;
|
|
5956
6071
|
v.use = function(...t) {
|
|
5957
|
-
return pe.use(...t), v.defaults = pe.defaults,
|
|
6072
|
+
return pe.use(...t), v.defaults = pe.defaults, Ri(v.defaults), v;
|
|
5958
6073
|
};
|
|
5959
6074
|
v.walkTokens = function(t, e) {
|
|
5960
6075
|
return pe.walkTokens(t, e);
|
|
5961
6076
|
};
|
|
5962
6077
|
v.parseInline = pe.parseInline;
|
|
5963
|
-
v.Parser =
|
|
5964
|
-
v.parser =
|
|
5965
|
-
v.Renderer =
|
|
5966
|
-
v.TextRenderer =
|
|
5967
|
-
v.Lexer =
|
|
5968
|
-
v.lexer =
|
|
5969
|
-
v.Tokenizer =
|
|
5970
|
-
v.Hooks =
|
|
6078
|
+
v.Parser = F;
|
|
6079
|
+
v.parser = F.parse;
|
|
6080
|
+
v.Renderer = vt;
|
|
6081
|
+
v.TextRenderer = Rn;
|
|
6082
|
+
v.Lexer = B;
|
|
6083
|
+
v.lexer = B.lex;
|
|
6084
|
+
v.Tokenizer = yt;
|
|
6085
|
+
v.Hooks = Qe;
|
|
5971
6086
|
v.parse = v;
|
|
5972
6087
|
v.options;
|
|
5973
6088
|
v.setOptions;
|
|
5974
6089
|
v.use;
|
|
5975
6090
|
v.walkTokens;
|
|
5976
6091
|
v.parseInline;
|
|
5977
|
-
|
|
5978
|
-
|
|
6092
|
+
F.parse;
|
|
6093
|
+
B.lex;
|
|
5979
6094
|
v.setOptions({
|
|
5980
6095
|
breaks: !0,
|
|
5981
6096
|
gfm: !0
|
|
5982
6097
|
});
|
|
5983
|
-
function
|
|
5984
|
-
const e =
|
|
6098
|
+
function Il({ text: t }) {
|
|
6099
|
+
const e = V(() => {
|
|
5985
6100
|
if (!t)
|
|
5986
6101
|
return "";
|
|
5987
6102
|
const n = v.parse(t);
|
|
@@ -5989,7 +6104,17 @@ function bl({ text: t }) {
|
|
|
5989
6104
|
}, [t]);
|
|
5990
6105
|
return /* @__PURE__ */ h("div", { class: "jex-md", dangerouslySetInnerHTML: { __html: e } });
|
|
5991
6106
|
}
|
|
5992
|
-
|
|
6107
|
+
const rn = W("");
|
|
6108
|
+
function El(t) {
|
|
6109
|
+
if (!t)
|
|
6110
|
+
return;
|
|
6111
|
+
const e = t.trim().split(/\s+/)[0];
|
|
6112
|
+
if (!e)
|
|
6113
|
+
return;
|
|
6114
|
+
const n = `@${e} `, r = rn.value;
|
|
6115
|
+
r.includes(n) || r.includes(`@${e}`) || (rn.value = r.trimStart() ? `${n}${r.trimStart()}` : n);
|
|
6116
|
+
}
|
|
6117
|
+
function Pl(t) {
|
|
5993
6118
|
const e = t.trim().split(/\s+/).filter(Boolean);
|
|
5994
6119
|
return e.length === 0 ? "?" : e.map((n) => n[0]).join("").slice(0, 2).toUpperCase();
|
|
5995
6120
|
}
|
|
@@ -5999,21 +6124,36 @@ function ye({ text: t, streaming: e, error: n, authorId: r, authorName: i, autho
|
|
|
5999
6124
|
n ? "jex-message-error" : ""
|
|
6000
6125
|
].filter(Boolean).join(" ");
|
|
6001
6126
|
return /* @__PURE__ */ h("div", { class: "jex-message-row bot", children: [
|
|
6002
|
-
/* @__PURE__ */ h("div", { class: `jex-avatar ${l ? "jex-avatar-agent" : "jex-avatar-bot"}`, children: l && s && !a ? /* @__PURE__ */ h("img", { src: s, alt: i ?? "", class: "jex-avatar-img", onError: d }) : l ? /* @__PURE__ */ h("span", { class: "jex-avatar-initials", children:
|
|
6127
|
+
/* @__PURE__ */ h("div", { class: `jex-avatar ${l ? "jex-avatar-agent" : "jex-avatar-bot"}`, children: l && s && !a ? /* @__PURE__ */ h("img", { src: s, alt: i ?? "", class: "jex-avatar-img", onError: d }) : l ? /* @__PURE__ */ h("span", { class: "jex-avatar-initials", children: Pl(i ?? "") }) : o && !a ? /* @__PURE__ */ h("img", { src: o, alt: "", class: "jex-avatar-img", onError: d }) : /* @__PURE__ */ h(yn, { size: 14 }) }),
|
|
6003
6128
|
/* @__PURE__ */ h("div", { class: "jex-message-content", children: [
|
|
6004
6129
|
/* @__PURE__ */ h("div", { class: c, children: [
|
|
6005
|
-
/* @__PURE__ */ h(
|
|
6130
|
+
/* @__PURE__ */ h(Il, { text: t }),
|
|
6006
6131
|
e && /* @__PURE__ */ h("span", { class: "jex-streaming-cursor" })
|
|
6007
6132
|
] }),
|
|
6008
|
-
l && i && /* @__PURE__ */ h("
|
|
6133
|
+
l && i && /* @__PURE__ */ h("div", { class: "jex-message-author-row", children: [
|
|
6134
|
+
/* @__PURE__ */ h("span", { class: "jex-message-author", children: i }),
|
|
6135
|
+
/* @__PURE__ */ h(
|
|
6136
|
+
"button",
|
|
6137
|
+
{
|
|
6138
|
+
type: "button",
|
|
6139
|
+
class: "jex-reply-tag-btn",
|
|
6140
|
+
"aria-label": `Reply to ${i}`,
|
|
6141
|
+
title: `Reply to ${i}`,
|
|
6142
|
+
onClick: () => {
|
|
6143
|
+
El(i);
|
|
6144
|
+
},
|
|
6145
|
+
children: /* @__PURE__ */ h(Da, { size: 12 })
|
|
6146
|
+
}
|
|
6147
|
+
)
|
|
6148
|
+
] })
|
|
6009
6149
|
] })
|
|
6010
6150
|
] });
|
|
6011
6151
|
}
|
|
6012
|
-
function
|
|
6152
|
+
function ql({ text: t }) {
|
|
6013
6153
|
return /* @__PURE__ */ h("div", { class: "jex-message user", children: t });
|
|
6014
6154
|
}
|
|
6015
|
-
function
|
|
6016
|
-
const r =
|
|
6155
|
+
function Ml({ message: t, sessionId: e, visitorId: n }) {
|
|
6156
|
+
const r = q();
|
|
6017
6157
|
return t.formData ? /* @__PURE__ */ h("div", { class: "jex-inline-form-submitted", children: [
|
|
6018
6158
|
/* @__PURE__ */ h("span", { class: "jex-inline-form-check", children: "✓" }),
|
|
6019
6159
|
/* @__PURE__ */ h("div", { children: [
|
|
@@ -6025,7 +6165,7 @@ function _l({ message: t, sessionId: e, visitorId: n }) {
|
|
|
6025
6165
|
] })
|
|
6026
6166
|
] })
|
|
6027
6167
|
] }) : /* @__PURE__ */ h("div", { class: "jex-message-row bot", children: /* @__PURE__ */ h(
|
|
6028
|
-
|
|
6168
|
+
Ll,
|
|
6029
6169
|
{
|
|
6030
6170
|
messageId: t._id,
|
|
6031
6171
|
sessionId: e,
|
|
@@ -6033,8 +6173,8 @@ function _l({ message: t, sessionId: e, visitorId: n }) {
|
|
|
6033
6173
|
}
|
|
6034
6174
|
) });
|
|
6035
6175
|
}
|
|
6036
|
-
function
|
|
6037
|
-
const r =
|
|
6176
|
+
function Ll({ messageId: t, sessionId: e, visitorId: n }) {
|
|
6177
|
+
const r = q(), [i, s] = R(""), [o, l] = R(""), [a, u] = R(!1), d = St(Re.functions.chat.public.helpdesk.submitEscalation);
|
|
6038
6178
|
async function c(p) {
|
|
6039
6179
|
if (p.preventDefault(), !a) {
|
|
6040
6180
|
u(!0);
|
|
@@ -6089,16 +6229,84 @@ function kl({ messageId: t, sessionId: e, visitorId: n }) {
|
|
|
6089
6229
|
/* @__PURE__ */ h("div", { class: "jex-inline-form-consent", children: r.escalationConsent })
|
|
6090
6230
|
] });
|
|
6091
6231
|
}
|
|
6092
|
-
|
|
6232
|
+
const Ol = {
|
|
6233
|
+
crawl: "🌐",
|
|
6234
|
+
file: "📄",
|
|
6235
|
+
snippet: "💡",
|
|
6236
|
+
qa: "❓"
|
|
6237
|
+
};
|
|
6238
|
+
function Nl({ sources: t }) {
|
|
6239
|
+
const [e, n] = R(!1);
|
|
6240
|
+
return t.length === 0 ? null : /* @__PURE__ */ h("div", { class: "jex-sources-row", children: [
|
|
6241
|
+
/* @__PURE__ */ h(
|
|
6242
|
+
"button",
|
|
6243
|
+
{
|
|
6244
|
+
type: "button",
|
|
6245
|
+
class: "jex-sources-toggle",
|
|
6246
|
+
onClick: () => {
|
|
6247
|
+
n((r) => !r);
|
|
6248
|
+
},
|
|
6249
|
+
"aria-expanded": e,
|
|
6250
|
+
children: [
|
|
6251
|
+
/* @__PURE__ */ h("span", { class: "jex-sources-icon", children: "📖" }),
|
|
6252
|
+
/* @__PURE__ */ h("span", { children: [
|
|
6253
|
+
t.length,
|
|
6254
|
+
" ",
|
|
6255
|
+
t.length === 1 ? "source" : "sources"
|
|
6256
|
+
] }),
|
|
6257
|
+
/* @__PURE__ */ h("span", { class: `jex-sources-chevron${e ? " jex-sources-chevron--open" : ""}`, children: "▾" })
|
|
6258
|
+
]
|
|
6259
|
+
}
|
|
6260
|
+
),
|
|
6261
|
+
e ? /* @__PURE__ */ h("div", { class: "jex-sources-pills", children: t.map((r, i) => {
|
|
6262
|
+
const s = r.sourceType === "crawl", o = zl(r), l = s && r.url ? `${r.title}
|
|
6263
|
+
${r.url}` : r.title, a = /* @__PURE__ */ h(N, { children: [
|
|
6264
|
+
typeof r.id == "number" ? /* @__PURE__ */ h("span", { class: "jex-source-id", children: r.id }) : null,
|
|
6265
|
+
/* @__PURE__ */ h("span", { class: "jex-source-type", children: Ol[r.sourceType] }),
|
|
6266
|
+
/* @__PURE__ */ h("span", { class: "jex-source-label", children: o }),
|
|
6267
|
+
/* @__PURE__ */ h("span", { class: "jex-source-score", children: [
|
|
6268
|
+
"· ",
|
|
6269
|
+
r.score.toFixed(2)
|
|
6270
|
+
] })
|
|
6271
|
+
] });
|
|
6272
|
+
return s && r.url ? /* @__PURE__ */ h(
|
|
6273
|
+
"a",
|
|
6274
|
+
{
|
|
6275
|
+
class: "jex-source-pill",
|
|
6276
|
+
href: r.url,
|
|
6277
|
+
target: "_blank",
|
|
6278
|
+
rel: "noopener noreferrer",
|
|
6279
|
+
title: l,
|
|
6280
|
+
children: a
|
|
6281
|
+
},
|
|
6282
|
+
i
|
|
6283
|
+
) : /* @__PURE__ */ h("span", { class: "jex-source-pill", title: l, children: a }, i);
|
|
6284
|
+
}) }) : null
|
|
6285
|
+
] });
|
|
6286
|
+
}
|
|
6287
|
+
function zl(t) {
|
|
6288
|
+
if (t.sourceType === "crawl" && t.url)
|
|
6289
|
+
try {
|
|
6290
|
+
const e = new URL(t.url);
|
|
6291
|
+
return !e.pathname || e.pathname === "/" ? e.hostname : e.pathname;
|
|
6292
|
+
} catch {
|
|
6293
|
+
}
|
|
6294
|
+
return t.title;
|
|
6295
|
+
}
|
|
6296
|
+
function Ql() {
|
|
6093
6297
|
return /* @__PURE__ */ h("div", { class: "jex-typing", children: [
|
|
6094
6298
|
/* @__PURE__ */ h("span", {}),
|
|
6095
6299
|
/* @__PURE__ */ h("span", {}),
|
|
6096
6300
|
/* @__PURE__ */ h("span", {})
|
|
6097
6301
|
] });
|
|
6098
6302
|
}
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
return
|
|
6303
|
+
const Bl = /\s?\[\d+\]/g;
|
|
6304
|
+
function _r(t) {
|
|
6305
|
+
return t.replace(Bl, "");
|
|
6306
|
+
}
|
|
6307
|
+
function Fl({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r, onStartFresh: i, sessionId: s, visitorId: o }) {
|
|
6308
|
+
const l = q(), a = _t(null), [u, d] = R(null);
|
|
6309
|
+
return z(() => {
|
|
6102
6310
|
a.current?.scrollIntoView({ behavior: "smooth" });
|
|
6103
6311
|
}, [t?.length, t?.at(-1)?.content]), /* @__PURE__ */ h("div", { class: "jex-chat-messages", children: [
|
|
6104
6312
|
/* @__PURE__ */ h(ye, { text: e }),
|
|
@@ -6120,7 +6328,7 @@ function Sl({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
|
|
|
6120
6328
|
if (c.contentType === "human-notice")
|
|
6121
6329
|
return /* @__PURE__ */ h(ye, { text: c.content }, c._id);
|
|
6122
6330
|
if (c.contentType === "escalation-form" && s && o)
|
|
6123
|
-
return
|
|
6331
|
+
return Ca.value === "screen" && !c.formData ? u === c._id ? null : /* @__PURE__ */ h("div", { class: "jex-inline-form jex-inline-form-card", children: [
|
|
6124
6332
|
/* @__PURE__ */ h("div", { class: "jex-inline-form-title", children: l.escalationPromptTitle }),
|
|
6125
6333
|
/* @__PURE__ */ h("div", { class: "jex-inline-form-subtitle", children: l.escalationPromptSubtitle }),
|
|
6126
6334
|
/* @__PURE__ */ h(
|
|
@@ -6129,7 +6337,7 @@ function Sl({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
|
|
|
6129
6337
|
class: "jex-form-submit",
|
|
6130
6338
|
type: "button",
|
|
6131
6339
|
onClick: () => {
|
|
6132
|
-
|
|
6340
|
+
ke({ id: "escalation-form", formMessageId: c._id, sessionId: s, visitorId: o });
|
|
6133
6341
|
},
|
|
6134
6342
|
children: l.escalationPromptSubmit
|
|
6135
6343
|
}
|
|
@@ -6145,17 +6353,17 @@ function Sl({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
|
|
|
6145
6353
|
children: l.escalationSkip
|
|
6146
6354
|
}
|
|
6147
6355
|
)
|
|
6148
|
-
] }, c._id) : /* @__PURE__ */ h(
|
|
6356
|
+
] }, c._id) : /* @__PURE__ */ h(Ml, { message: c, sessionId: s, visitorId: o }, c._id);
|
|
6149
6357
|
if (c.contentType === "escalation-confirm")
|
|
6150
6358
|
return /* @__PURE__ */ h(ye, { text: c.content }, c._id);
|
|
6151
6359
|
if (c.role === "user")
|
|
6152
|
-
return /* @__PURE__ */ h(
|
|
6360
|
+
return /* @__PURE__ */ h(ql, { text: c.content }, c._id);
|
|
6153
6361
|
const p = {
|
|
6154
6362
|
authorId: c.authorId,
|
|
6155
6363
|
authorName: c.authorName,
|
|
6156
6364
|
authorImage: c.authorImage
|
|
6157
6365
|
};
|
|
6158
|
-
return c.status === "streaming" && c.content === "" ? /* @__PURE__ */ h(
|
|
6366
|
+
return c.status === "streaming" && c.content === "" ? /* @__PURE__ */ h(Ql, {}, c._id) : c.status === "streaming" ? /* @__PURE__ */ h(ye, { text: _r(c.content), streaming: !0, ...p }, c._id) : c.status === "error" ? /* @__PURE__ */ h(
|
|
6159
6367
|
ye,
|
|
6160
6368
|
{
|
|
6161
6369
|
text: c.errorMessage ?? `${l.somethingWentWrong}. ${l.tryAgain}.`,
|
|
@@ -6163,19 +6371,22 @@ function Sl({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
|
|
|
6163
6371
|
...p
|
|
6164
6372
|
},
|
|
6165
6373
|
c._id
|
|
6166
|
-
) : /* @__PURE__ */ h(
|
|
6374
|
+
) : /* @__PURE__ */ h("div", { children: [
|
|
6375
|
+
/* @__PURE__ */ h(ye, { text: _r(c.content), ...p }),
|
|
6376
|
+
c.sources && c.sources.length > 0 ? /* @__PURE__ */ h(Nl, { sources: c.sources }) : null
|
|
6377
|
+
] }, c._id);
|
|
6167
6378
|
}),
|
|
6168
6379
|
/* @__PURE__ */ h("div", { ref: a })
|
|
6169
6380
|
] });
|
|
6170
6381
|
}
|
|
6171
|
-
function
|
|
6382
|
+
function Dl({ size: t = 18 }) {
|
|
6172
6383
|
return /* @__PURE__ */ h("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
|
|
6173
6384
|
/* @__PURE__ */ h("path", { d: "M22 2 11 13" }),
|
|
6174
6385
|
/* @__PURE__ */ h("path", { d: "M22 2 15 22 11 13 2 9l20-7z" })
|
|
6175
6386
|
] });
|
|
6176
6387
|
}
|
|
6177
|
-
function
|
|
6178
|
-
const l =
|
|
6388
|
+
function Ul({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionStatus: i, ensureSession: s, onStartFresh: o }) {
|
|
6389
|
+
const l = q(), a = rn, u = St(Re.functions.chat.public.conversations.send), d = n || r;
|
|
6179
6390
|
if (i === "resolved")
|
|
6180
6391
|
return /* @__PURE__ */ h("div", { class: "jex-chat-input-resolved", children: [
|
|
6181
6392
|
/* @__PURE__ */ h("div", { class: "jex-resolved-notice", children: l.sessionResolved }),
|
|
@@ -6196,7 +6407,7 @@ function Cl({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionS
|
|
|
6196
6407
|
if (!p || d)
|
|
6197
6408
|
return;
|
|
6198
6409
|
const f = t && e ? { sessionId: t, visitorId: e } : await s();
|
|
6199
|
-
f && (
|
|
6410
|
+
f && (Sa(), a.value = "", u({
|
|
6200
6411
|
sessionId: f.sessionId,
|
|
6201
6412
|
visitorId: f.visitorId,
|
|
6202
6413
|
content: p
|
|
@@ -6228,58 +6439,58 @@ function Cl({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionS
|
|
|
6228
6439
|
onClick: c,
|
|
6229
6440
|
"aria-label": l.sendAriaLabel,
|
|
6230
6441
|
disabled: d,
|
|
6231
|
-
children: /* @__PURE__ */ h(
|
|
6442
|
+
children: /* @__PURE__ */ h(Dl, { size: 18 })
|
|
6232
6443
|
}
|
|
6233
6444
|
)
|
|
6234
6445
|
] });
|
|
6235
6446
|
}
|
|
6236
|
-
function
|
|
6447
|
+
function Ni({ message: t }) {
|
|
6237
6448
|
return /* @__PURE__ */ h("div", { class: "jex-overlay jex-loading", children: [
|
|
6238
6449
|
/* @__PURE__ */ h("div", { class: "jex-loading-spinner", "aria-hidden": "true" }),
|
|
6239
6450
|
t && /* @__PURE__ */ h("p", { class: "jex-loading-message", children: t })
|
|
6240
6451
|
] });
|
|
6241
6452
|
}
|
|
6242
|
-
function
|
|
6243
|
-
const
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
),
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
),
|
|
6250
|
-
return
|
|
6251
|
-
fe.value && !
|
|
6252
|
-
}, [
|
|
6453
|
+
function Vl({ greeting: t, orgSlug: e, projSlug: n }) {
|
|
6454
|
+
const r = q(), { sessionId: i, visitorId: s, isLoading: o, sessionNotFound: l, resumeFailed: a, isOrgDeleted: u, ensureSession: d, startFresh: c } = La(e, n), p = cr(
|
|
6455
|
+
Re.functions.chat.public.conversations.listBySession,
|
|
6456
|
+
i && s ? { sessionId: i, visitorId: s } : "skip"
|
|
6457
|
+
), f = cr(
|
|
6458
|
+
Re.functions.chat.public.sessions.getSessionStatus,
|
|
6459
|
+
i && s ? { sessionId: i, visitorId: s } : "skip"
|
|
6460
|
+
), g = i !== null && p === void 0, x = p?.some((w) => w.status === "streaming") ?? !1;
|
|
6461
|
+
return z(() => {
|
|
6462
|
+
fe.value && !i && d();
|
|
6463
|
+
}, [d, i]), u ? /* @__PURE__ */ h("div", { class: "jex-chat-messages", children: /* @__PURE__ */ h("div", { class: "jex-session-notice", children: r.chatNoLongerAvailable }) }) : o || g && fe.value ? /* @__PURE__ */ h(Ni, { message: r.resumeConversation }) : /* @__PURE__ */ h(N, { children: [
|
|
6253
6464
|
/* @__PURE__ */ h(
|
|
6254
|
-
|
|
6465
|
+
Fl,
|
|
6255
6466
|
{
|
|
6256
|
-
conversations:
|
|
6467
|
+
conversations: p,
|
|
6257
6468
|
greeting: t,
|
|
6258
|
-
sessionNotFound:
|
|
6259
|
-
resumeFailed:
|
|
6260
|
-
onStartFresh:
|
|
6261
|
-
sessionId:
|
|
6262
|
-
visitorId:
|
|
6469
|
+
sessionNotFound: l,
|
|
6470
|
+
resumeFailed: a,
|
|
6471
|
+
onStartFresh: c,
|
|
6472
|
+
sessionId: i,
|
|
6473
|
+
visitorId: s
|
|
6263
6474
|
}
|
|
6264
6475
|
),
|
|
6265
6476
|
/* @__PURE__ */ h(
|
|
6266
|
-
|
|
6477
|
+
Ul,
|
|
6267
6478
|
{
|
|
6268
|
-
sessionId:
|
|
6269
|
-
visitorId:
|
|
6270
|
-
isLoading:
|
|
6271
|
-
isStreaming:
|
|
6272
|
-
sessionStatus:
|
|
6273
|
-
ensureSession:
|
|
6274
|
-
onStartFresh:
|
|
6479
|
+
sessionId: i,
|
|
6480
|
+
visitorId: s,
|
|
6481
|
+
isLoading: o,
|
|
6482
|
+
isStreaming: x,
|
|
6483
|
+
sessionStatus: f ?? null,
|
|
6484
|
+
ensureSession: d,
|
|
6485
|
+
onStartFresh: c
|
|
6275
6486
|
}
|
|
6276
6487
|
)
|
|
6277
6488
|
] });
|
|
6278
6489
|
}
|
|
6279
|
-
function
|
|
6280
|
-
const r =
|
|
6490
|
+
function Wl({ formMessageId: t, sessionId: e, visitorId: n }) {
|
|
6491
|
+
const r = q(), [i, s] = R(""), [o, l] = R(""), a = St(Re.functions.chat.public.helpdesk.submitEscalation);
|
|
6281
6492
|
async function u(d) {
|
|
6282
|
-
d.preventDefault(),
|
|
6493
|
+
d.preventDefault(), we({ id: "loading", message: r.escalationSubmitting });
|
|
6283
6494
|
try {
|
|
6284
6495
|
const c = await a({
|
|
6285
6496
|
sessionId: e,
|
|
@@ -6288,9 +6499,9 @@ function Rl({ formMessageId: t, sessionId: e, visitorId: n }) {
|
|
|
6288
6499
|
visitorName: i.trim(),
|
|
6289
6500
|
visitorEmail: o.trim()
|
|
6290
6501
|
});
|
|
6291
|
-
|
|
6502
|
+
we({ id: "confirmation", ref: c.ticketRef });
|
|
6292
6503
|
} catch (c) {
|
|
6293
|
-
console.error("[EscalationFormScreen] Submit failed:", c),
|
|
6504
|
+
console.error("[EscalationFormScreen] Submit failed:", c), we({ id: "error", message: r.escalationSubmitFailed });
|
|
6294
6505
|
}
|
|
6295
6506
|
}
|
|
6296
6507
|
return /* @__PURE__ */ h("div", { class: "jex-form-screen", children: [
|
|
@@ -6329,18 +6540,18 @@ function Rl({ formMessageId: t, sessionId: e, visitorId: n }) {
|
|
|
6329
6540
|
] }),
|
|
6330
6541
|
/* @__PURE__ */ h("div", { class: "jex-inline-form-consent", style: { textAlign: "center", margin: "16px 0 8px 0" }, children: r.escalationConsent }),
|
|
6331
6542
|
/* @__PURE__ */ h("button", { class: "jex-escalation-skip", type: "button", onClick: () => {
|
|
6332
|
-
|
|
6543
|
+
bn();
|
|
6333
6544
|
}, children: r.escalationSkip })
|
|
6334
6545
|
] });
|
|
6335
6546
|
}
|
|
6336
|
-
function
|
|
6337
|
-
const t =
|
|
6547
|
+
function Hl() {
|
|
6548
|
+
const t = q(), [e, n] = R(""), [r, i] = R(""), [s, o] = R("");
|
|
6338
6549
|
async function l(a) {
|
|
6339
|
-
a.preventDefault(),
|
|
6550
|
+
a.preventDefault(), we({ id: "loading", message: t.submittingTicket }), await new Promise((d) => {
|
|
6340
6551
|
setTimeout(d, 1200);
|
|
6341
6552
|
});
|
|
6342
6553
|
const u = "JEX-" + Math.random().toString(36).slice(2, 8).toUpperCase();
|
|
6343
|
-
|
|
6554
|
+
we({ id: "confirmation", ref: u });
|
|
6344
6555
|
}
|
|
6345
6556
|
return /* @__PURE__ */ h("div", { class: "jex-form-screen", children: [
|
|
6346
6557
|
/* @__PURE__ */ h("h2", { class: "jex-form-title", children: t.submitTicket }),
|
|
@@ -6389,8 +6600,8 @@ function $l() {
|
|
|
6389
6600
|
] })
|
|
6390
6601
|
] });
|
|
6391
6602
|
}
|
|
6392
|
-
function
|
|
6393
|
-
const e =
|
|
6603
|
+
function Jl({ ticketRef: t }) {
|
|
6604
|
+
const e = q();
|
|
6394
6605
|
return /* @__PURE__ */ h("div", { class: "jex-confirmation", children: [
|
|
6395
6606
|
/* @__PURE__ */ h("div", { class: "jex-confirmation-icon", "aria-hidden": "true", children: "✓" }),
|
|
6396
6607
|
/* @__PURE__ */ h("h2", { class: "jex-confirmation-title", children: e.ticketSubmitted }),
|
|
@@ -6409,8 +6620,8 @@ function Al({ ticketRef: t }) {
|
|
|
6409
6620
|
)
|
|
6410
6621
|
] });
|
|
6411
6622
|
}
|
|
6412
|
-
function
|
|
6413
|
-
const r =
|
|
6623
|
+
function Gl({ message: t, onRetry: e, onBack: n }) {
|
|
6624
|
+
const r = q();
|
|
6414
6625
|
return /* @__PURE__ */ h("div", { class: "jex-overlay jex-error", children: [
|
|
6415
6626
|
/* @__PURE__ */ h("p", { class: "jex-error-message", children: t }),
|
|
6416
6627
|
/* @__PURE__ */ h("div", { class: "jex-error-actions", children: [
|
|
@@ -6419,45 +6630,46 @@ function Il({ message: t, onRetry: e, onBack: n }) {
|
|
|
6419
6630
|
] })
|
|
6420
6631
|
] });
|
|
6421
6632
|
}
|
|
6422
|
-
function
|
|
6423
|
-
const
|
|
6424
|
-
(
|
|
6633
|
+
function kr({ greeting: t, title: e, orgSlug: n, projSlug: r }) {
|
|
6634
|
+
const i = U.value, s = i[i.length - 1], o = i.findLast(
|
|
6635
|
+
(l) => l.id === "confirmation"
|
|
6425
6636
|
);
|
|
6426
6637
|
return /* @__PURE__ */ h("div", { class: "jex-screen-container", children: [
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6638
|
+
s.id === "home" && /* @__PURE__ */ h(Pa, { greeting: t, title: e }),
|
|
6639
|
+
s.id === "selection" && /* @__PURE__ */ h(qa, { title: e }),
|
|
6640
|
+
s.id === "form" && /* @__PURE__ */ h(Hl, {}),
|
|
6641
|
+
s.id === "escalation-form" && /* @__PURE__ */ h(
|
|
6642
|
+
Wl,
|
|
6432
6643
|
{
|
|
6433
|
-
formMessageId:
|
|
6434
|
-
sessionId:
|
|
6435
|
-
visitorId:
|
|
6644
|
+
formMessageId: s.formMessageId,
|
|
6645
|
+
sessionId: s.sessionId,
|
|
6646
|
+
visitorId: s.visitorId
|
|
6436
6647
|
}
|
|
6437
6648
|
),
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6649
|
+
s.id === "confirmation" && o && /* @__PURE__ */ h(Jl, { ticketRef: o.ref }),
|
|
6650
|
+
s.id === "chat" && /* @__PURE__ */ h(Vl, { greeting: t, orgSlug: n, projSlug: r }),
|
|
6651
|
+
s.id === "loading" && /* @__PURE__ */ h(Ni, { message: s.message }),
|
|
6652
|
+
s.id === "error" && /* @__PURE__ */ h(
|
|
6653
|
+
Gl,
|
|
6443
6654
|
{
|
|
6444
|
-
message:
|
|
6445
|
-
onRetry: () =>
|
|
6446
|
-
onBack:
|
|
6655
|
+
message: s.message,
|
|
6656
|
+
onRetry: () => we({ id: "loading" }),
|
|
6657
|
+
onBack: bn
|
|
6447
6658
|
}
|
|
6448
6659
|
)
|
|
6449
6660
|
] });
|
|
6450
6661
|
}
|
|
6451
|
-
function
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6662
|
+
function Kl({ options: t }) {
|
|
6663
|
+
pa(t.orgSlug, t.projSlug, t.bootstrapToken, t.convexUrl);
|
|
6664
|
+
const e = da(t.orgSlug, t.projSlug, t.convexUrl);
|
|
6665
|
+
va(t.parentOrigin), z(() => {
|
|
6666
|
+
ka();
|
|
6455
6667
|
}, []);
|
|
6456
|
-
const n =
|
|
6457
|
-
|
|
6458
|
-
|
|
6668
|
+
const n = ua(t, e);
|
|
6669
|
+
z(() => {
|
|
6670
|
+
mn.value = ji(n.locale);
|
|
6459
6671
|
}, [n.locale]);
|
|
6460
|
-
const r = n.position === "bottom-left", i = n.colorScheme === "dark" || n.colorScheme === "light" ? n.colorScheme : "", s =
|
|
6672
|
+
const r = n.position === "bottom-left", i = n.colorScheme === "dark" || n.colorScheme === "light" ? n.colorScheme : "", s = ja({
|
|
6461
6673
|
...t,
|
|
6462
6674
|
primaryColor: n.primaryColor,
|
|
6463
6675
|
accentColor: n.accentColor,
|
|
@@ -6473,17 +6685,17 @@ function El({ options: t }) {
|
|
|
6473
6685
|
class: `jex-widget ${i}`.trim(),
|
|
6474
6686
|
style: a,
|
|
6475
6687
|
children: o ? /* @__PURE__ */ h("div", { class: "jex-embedded", children: [
|
|
6476
|
-
/* @__PURE__ */ h(
|
|
6477
|
-
/* @__PURE__ */ h(
|
|
6478
|
-
!n.hideBranding && /* @__PURE__ */ h(
|
|
6688
|
+
/* @__PURE__ */ h(hr, { title: n.title }),
|
|
6689
|
+
/* @__PURE__ */ h(kr, { greeting: n.greeting, title: n.title, orgSlug: t.orgSlug, projSlug: t.projSlug }),
|
|
6690
|
+
!n.hideBranding && /* @__PURE__ */ h(dr, {})
|
|
6479
6691
|
] }) : /* @__PURE__ */ h("div", { class: `jex-container${r ? " jex-pos-left" : ""}`, children: [
|
|
6480
6692
|
A.value && /* @__PURE__ */ h("div", { class: "jex-chat-window", children: [
|
|
6481
|
-
/* @__PURE__ */ h(
|
|
6482
|
-
/* @__PURE__ */ h(
|
|
6483
|
-
!n.hideBranding && /* @__PURE__ */ h(
|
|
6693
|
+
/* @__PURE__ */ h(hr, { title: n.title }),
|
|
6694
|
+
/* @__PURE__ */ h(kr, { greeting: n.greeting, title: n.title, orgSlug: t.orgSlug, projSlug: t.projSlug }),
|
|
6695
|
+
!n.hideBranding && /* @__PURE__ */ h(dr, {})
|
|
6484
6696
|
] }),
|
|
6485
6697
|
/* @__PURE__ */ h(
|
|
6486
|
-
|
|
6698
|
+
Ea,
|
|
6487
6699
|
{
|
|
6488
6700
|
iconOption: n.triggerIcon,
|
|
6489
6701
|
radius: n.triggerRadius,
|
|
@@ -6494,34 +6706,34 @@ function El({ options: t }) {
|
|
|
6494
6706
|
}
|
|
6495
6707
|
);
|
|
6496
6708
|
}
|
|
6497
|
-
const ql = '.jex-widget{--jex-primary: #115A62;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-radius: .75rem;--jex-font-family: "Inter", system-ui, -apple-system, sans-serif;--jex-font-size: 14px;--jex-window-width: 380px;--jex-window-height: 600px;--jex-shadow: 0 16px 48px -12px rgba(13, 127, 138, .25), 0 4px 16px rgba(0, 0, 0, .08);pointer-events:auto;--jex-bg-trigger: var(--jex-primary);--jex-bg-header: var(--jex-primary);--jex-bg-msg-user: var(--jex-primary);--jex-bg-send-btn: var(--jex-primary);--jex-bg-window: rgba(255, 255, 255, .95);--jex-bg-msg-bot: #f1f5f9;--jex-bg-input: rgba(247, 253, 253, .6);--jex-text-header: #ffffff;--jex-text-msg-user: #ffffff;--jex-text-msg-bot: #0f172a;--jex-text-main: #0f172a;--jex-text-muted: #64748b;--jex-bg-avatar-agent: #d1fae5;--jex-text-avatar-agent: #065f46;--jex-border-window: rgba(226, 232, 240, .8);--jex-border-input: rgba(203, 213, 225, .8);--jex-bg-glass: var(--jex-bg-window);--jex-border-glass: var(--jex-border-window);font-family:var(--jex-font-family);-webkit-font-smoothing:antialiased}.dark .jex-widget,.jex-widget.dark{--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9);--jex-bg-avatar-agent: #064e3b;--jex-text-avatar-agent: #6ee7b7;--jex-bg-error: #3b1318;--jex-border-error: #5c1d24;--jex-text-error: #fca5a5}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light){--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9);--jex-bg-error: #3b1318;--jex-border-error: #5c1d24;--jex-text-error: #fca5a5}}.jex-widget *{box-sizing:border-box;margin:0;padding:0}.jex-container{position:fixed;bottom:24px;right:24px;display:flex;flex-direction:column;align-items:flex-end;gap:16px;z-index:9999}.jex-container.jex-pos-left{right:auto;left:24px;align-items:flex-start}:host(.jex-mode-embedded){display:block;width:100%;height:100%}:host(.jex-mode-embedded) .jex-widget{width:100%;height:100%}.jex-embedded{display:flex;flex-direction:column;width:100%;height:100%;background:var(--jex-bg-window);border:1px solid var(--jex-border-window);overflow:hidden}.jex-embedded .jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-floating-button{height:56px;min-width:56px;padding:0;background:var(--jex-bg-trigger);color:var(--jex-text-header);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--jex-shadow);transition:transform .3s cubic-bezier(.175,.885,.32,1.275),background .2s,width .3s ease,border-radius .3s ease}.jex-floating-button.jex-has-label{min-width:110px;padding:0 20px}.jex-fab-inner{display:flex;align-items:center;gap:12px}.jex-fab-label{font-size:15px;font-weight:600;white-space:nowrap}.jex-floating-button:hover{transform:scale(1.1);background:var(--jex-primary-hover)}.jex-floating-button:active{transform:scale(.95)}.jex-chat-window{width:var(--jex-window-width);height:var(--jex-window-height);max-height:calc(100vh - 120px);background:var(--jex-bg-window);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--jex-border-window);border-radius:calc(var(--jex-radius) * 2);box-shadow:var(--jex-shadow);display:flex;flex-direction:column;overflow:hidden;animation:jexSlideUp .4s cubic-bezier(.16,1,.3,1);transform-origin:bottom right}@keyframes jexSlideUp{0%{opacity:0;transform:scale(.8) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}.jex-chat-header{padding:20px;background:var(--jex-bg-header);color:var(--jex-text-header);display:flex;align-items:center;gap:12px;flex-shrink:0}.jex-header-info h3{font-size:16px;font-weight:600;color:var(--jex-text-header);margin:0}.jex-header-info p{font-size:12px;opacity:.8;color:var(--jex-text-header);margin:0}.jex-header-back{background:none;border:none;color:var(--jex-text-header);cursor:pointer;padding:4px;display:flex;align-items:center;opacity:.8;transition:opacity .2s;flex-shrink:0}.jex-header-back:hover{opacity:1}.jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-home{flex:1;display:flex;flex-direction:column;padding:24px;gap:20px;overflow-y:auto}.jex-home-hero{display:flex;align-items:center;gap:14px;animation:jexFadeIn .4s ease both}.jex-home-avatar{position:relative;width:48px;height:48px;border-radius:14px;background:var(--jex-primary);color:var(--jex-text-header);display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 4px 12px color-mix(in srgb,var(--jex-primary) 30%,transparent)}.jex-home-status-dot{position:absolute;bottom:-2px;right:-2px;width:14px;height:14px;border-radius:50%;background:#22c55e;border:2.5px solid var(--jex-bg-window);animation:jexPulse 2s ease-in-out infinite}@keyframes jexPulse{0%,to{box-shadow:0 0 #22c55e66}50%{box-shadow:0 0 0 6px #22c55e00}}.jex-home-hero-text{display:flex;flex-direction:column;gap:2px;min-width:0}.jex-home-title{font-size:17px;font-weight:700;color:var(--jex-text-main);margin:0;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.jex-home-status{font-size:12px;font-weight:500;color:#22c55e;letter-spacing:.02em}.jex-home-greeting{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:4px 16px 16px;padding:16px 18px;font-size:14px;line-height:1.55;color:var(--jex-text-main);animation:jexFadeIn .4s .1s ease both}.jex-home-greeting p{margin:0}@keyframes jexFadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.jex-home-actions{display:flex;flex-direction:column;gap:10px;animation:jexFadeIn .4s .2s ease both}.jex-home-start-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;padding:14px 20px;font-size:15px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,transform .15s,box-shadow .2s;width:100%;box-shadow:0 2px 8px color-mix(in srgb,var(--jex-primary) 25%,transparent)}.jex-home-start-btn:hover{background:var(--jex-primary-hover);transform:translateY(-1px);box-shadow:0 4px 16px color-mix(in srgb,var(--jex-primary) 35%,transparent)}.jex-home-start-btn:active{transform:translateY(0);box-shadow:0 1px 4px color-mix(in srgb,var(--jex-primary) 20%,transparent)}.jex-home-resume-card{display:flex;flex-direction:column;gap:8px;width:100%;text-align:left;padding:16px 18px;border-radius:14px;border:1.5px solid var(--jex-primary);background:color-mix(in srgb,var(--jex-primary) 6%,var(--jex-bg-window));cursor:pointer;font-family:inherit;transition:background .2s,border-color .2s,transform .15s,box-shadow .2s;box-shadow:0 2px 8px color-mix(in srgb,var(--jex-primary) 12%,transparent)}.jex-home-resume-card:hover{background:color-mix(in srgb,var(--jex-primary) 10%,var(--jex-bg-window));transform:translateY(-1px);box-shadow:0 4px 16px color-mix(in srgb,var(--jex-primary) 20%,transparent)}.jex-home-resume-card:active{transform:translateY(0)}.jex-home-resume-top{display:flex;align-items:center;justify-content:space-between}.jex-home-resume-label{font-size:14px;font-weight:600;color:var(--jex-primary)}.jex-home-resume-arrow{color:var(--jex-primary);opacity:.6;transition:opacity .2s,transform .2s}.jex-home-resume-card:hover .jex-home-resume-arrow{opacity:1;transform:translate(2px)}.jex-home-resume-ref{font-family:ui-monospace,Cascadia Code,Fira Code,monospace;font-size:13px;font-weight:600;letter-spacing:.06em;color:var(--jex-text-muted)}.jex-home-new-btn{background:transparent;color:var(--jex-text-muted);border:1px solid var(--jex-border-input);border-radius:12px;padding:12px 20px;font-size:14px;font-weight:500;cursor:pointer;font-family:inherit;transition:color .2s,border-color .2s,background .2s;width:100%}.jex-home-new-btn:hover{color:var(--jex-text-main);border-color:var(--jex-text-muted);background:color-mix(in srgb,var(--jex-primary) 3%,transparent)}.jex-session-ref{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:8px;font-size:12px}.jex-session-ref-label{color:var(--jex-text-muted);font-weight:500}.jex-session-ref-code{color:var(--jex-primary);font-weight:700;font-family:ui-monospace,Cascadia Code,monospace;letter-spacing:.05em}.jex-chat-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.jex-message-row{display:flex;align-items:flex-end;gap:8px;max-width:85%}.jex-message-row.bot{align-self:flex-start}.jex-message-content{flex:1;min-width:0}.jex-avatar{width:24px;height:24px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:12px;margin-bottom:2px}.jex-avatar-bot{background:var(--jex-bg-msg-bot);color:var(--jex-primary)}.jex-avatar-agent{background:var(--jex-bg-avatar-agent)}.jex-avatar-img{width:100%;height:100%;border-radius:50%;object-fit:cover}.jex-avatar-initials{font-size:9px;font-weight:700;color:var(--jex-text-avatar-agent)}.jex-message-author{display:block;font-size:10px;color:var(--jex-text-muted);margin-top:2px;padding-left:4px}.jex-message{padding:12px 16px;border-radius:18px;font-size:14px;line-height:1.4}.jex-message.bot{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);color:var(--jex-text-msg-bot);border-bottom-left-radius:4px}.jex-message.user{align-self:flex-end;max-width:80%;background:var(--jex-bg-msg-user);color:var(--jex-text-msg-user);border-bottom-right-radius:4px}.jex-typing{align-self:flex-start;display:flex;gap:4px;padding:12px 16px}.jex-typing span{width:8px;height:8px;border-radius:50%;background:var(--jex-text-muted);animation:jexTypingDot 1.2s infinite ease-in-out}.jex-typing span:nth-child(2){animation-delay:.2s}.jex-typing span:nth-child(3){animation-delay:.4s}@keyframes jexTypingDot{0%,80%,to{transform:scale(.8);opacity:.4}40%{transform:scale(1);opacity:1}}.jex-md{word-break:break-word;overflow-wrap:anywhere}.jex-md p{margin:0 0 8px}.jex-md p:last-child{margin-bottom:0}.jex-md strong{font-weight:600}.jex-md em{font-style:italic}.jex-md ul,.jex-md ol{margin:0 0 8px;padding-left:20px}.jex-md ul:last-child,.jex-md ol:last-child{margin-bottom:0}.jex-md ul{list-style-type:disc}.jex-md ol{list-style-type:decimal}.jex-md li{margin-bottom:2px}.jex-md li:last-child{margin-bottom:0}.jex-md a{color:var(--jex-primary);text-decoration:underline;text-underline-offset:2px}.jex-md a:hover{opacity:.8}.jex-md code{background:#00000014;padding:1px 5px;border-radius:4px;font-size:.9em;font-family:ui-monospace,Cascadia Code,Fira Code,monospace}.jex-md pre{background:#0000000f;border-radius:8px;padding:10px 12px;margin:0 0 8px;overflow-x:auto;font-size:.85em}.jex-md pre:last-child{margin-bottom:0}.jex-md pre code{background:none;padding:0;border-radius:0;font-size:inherit}.jex-md h1,.jex-md h2,.jex-md h3,.jex-md h4{font-weight:600;margin:8px 0 4px}.jex-md h1:first-child,.jex-md h2:first-child,.jex-md h3:first-child,.jex-md h4:first-child{margin-top:0}.jex-md h3{font-size:1em}.jex-md h4{font-size:.95em}.jex-md hr{border:none;border-top:1px solid var(--jex-border-window);margin:8px 0}.jex-md blockquote{border-left:3px solid var(--jex-primary);margin:0 0 8px;padding:4px 12px;color:var(--jex-text-muted)}.jex-md blockquote:last-child{margin-bottom:0}.dark .jex-md code,.jex-widget.dark .jex-md code{background:#ffffff1a}.dark .jex-md pre,.jex-widget.dark .jex-md pre{background:#ffffff14}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-md code{background:#ffffff1a}:host:not(.light) .jex-widget:not(.light) .jex-md pre{background:#ffffff14}}.jex-streaming-cursor:after{content:"◊";margin-left:2px;animation:jexBlinkCursor .8s ease-in-out infinite}@keyframes jexBlinkCursor{0%,to{opacity:1}50%{opacity:0}}.jex-session-notice{align-self:center;text-align:center;padding:8px 16px;margin:8px 0;font-size:12px;color:var(--jex-text-muted);background:var(--jex-bg-input, #f1f5f9);border-radius:8px;line-height:1.4}.jex-message-error{background:var(--jex-bg-error, #fef2f2)!important;border-color:var(--jex-border-error, #fecaca)!important;color:var(--jex-text-error, #991b1b)!important}.jex-chat-input{padding:16px;border-top:1px solid var(--jex-border-window);display:flex;gap:8px;flex-shrink:0}.jex-chat-input input{flex:1;background:var(--jex-bg-input);border:1px solid var(--jex-border-input);border-radius:12px;padding:10px 14px;color:var(--jex-text-main);outline:none;font-family:inherit;font-size:14px}.jex-chat-input input:focus{border-color:var(--jex-primary)}.jex-send-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s cubic-bezier(.175,.885,.32,1.275);flex-shrink:0}.jex-send-btn:hover{transform:scale(1.05);background:var(--jex-primary-hover)}.jex-send-btn:active{transform:scale(.95)}.jex-widget-footer{display:flex;align-items:center;justify-content:center;padding:8px 16px;border-top:1px solid var(--jex-border-glass);background:#00000005;flex-shrink:0}.jex-widget.dark .jex-widget-footer{background:#ffffff05}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-widget-footer{background:#ffffff05}}.jex-branding{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--jex-text-muted);font-size:11px;font-weight:500;transition:color .2s}.jex-branding:hover{color:var(--jex-text-main)}.jex-branding-icon{color:var(--jex-primary)}.jex-branding span strong{font-weight:700;color:var(--jex-text-main)}.jex-locale-select-wrapper{position:relative;display:flex;align-items:center}.jex-locale-select{appearance:none;-webkit-appearance:none;background:transparent;border:1px solid transparent;padding:4px 20px 4px 6px;border-radius:6px;font-family:inherit;font-size:11px;font-weight:600;color:var(--jex-text-muted);background-color:transparent;cursor:pointer;outline:none;transition:all .2s ease}.jex-locale-select option{background-color:#fff;color:#0f172a}.jex-locale-select:hover,.jex-locale-select:focus-visible{color:var(--jex-text-main);background:#0000000a}.jex-widget.dark .jex-locale-select:hover,.jex-widget.dark .jex-locale-select:focus-visible{background:#ffffff0d}.jex-widget.dark .jex-locale-select option{background-color:#0f172a;color:#f8fafc}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-locale-select:hover,:host:not(.light) .jex-widget:not(.light) .jex-locale-select:focus-visible{background:#ffffff0d}:host:not(.light) .jex-widget:not(.light) .jex-locale-select option{background-color:#0f172a;color:#f8fafc}}.jex-locale-select:focus-visible{border-color:var(--jex-primary)}.jex-locale-chevron{position:absolute;right:4px;pointer-events:none;color:var(--jex-text-muted);transition:color .2s ease}.jex-locale-select-wrapper:hover .jex-locale-chevron{color:var(--jex-text-main)}.jex-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:var(--jex-bg-window, #fff);z-index:10;padding:24px;text-align:center}.jex-loading-spinner{width:32px;height:32px;border:3px solid var(--jex-border-input, #e2e8f0);border-top-color:var(--jex-primary, #115A62);border-radius:50%;animation:jex-spin .7s linear infinite}@keyframes jex-spin{to{transform:rotate(360deg)}}.jex-loading-message{font-size:14px;color:var(--jex-text-muted, #64748b)}.jex-error-message{font-size:14px;color:var(--jex-text-main, #334155)}.jex-error-actions{display:flex;gap:8px}.jex-error-retry,.jex-error-back{padding:8px 16px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;border:none}.jex-error-retry{background:var(--jex-primary, #115A62);color:#fff}.jex-error-back{background:transparent;color:var(--jex-text-muted, #64748b);border:1px solid var(--jex-border-input, #e2e8f0)}.jex-selection{display:flex;flex-direction:column;gap:12px;padding:24px 16px;height:100%}.jex-selection-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 8px}.jex-selection-options{display:flex;flex-direction:column;gap:10px}.jex-selection-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:16px;border-radius:12px;border:1px solid var(--jex-border-window, #e2e8f0);background:transparent;cursor:pointer;text-align:left;transition:border-color .15s ease,background .15s ease}.jex-selection-option:hover{border-color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 5%,transparent)}.jex-selection-icon{font-size:20px}.jex-selection-label{font-size:14px;font-weight:600;color:var(--jex-text-main, #0f172a)}.jex-selection-sub{font-size:12px;color:var(--jex-text-muted, #64748b)}.jex-form-screen{display:flex;flex-direction:column;padding:20px 16px;height:100%;overflow-y:auto}.jex-form-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 16px}.jex-form{display:flex;flex-direction:column;gap:10px}.jex-form-input,.jex-form-textarea{padding:10px 12px;border-radius:8px;border:1px solid var(--jex-border-input, #e2e8f0);font-size:14px;background:transparent;color:var(--jex-text-main, #0f172a);outline:none}.jex-form-input:focus,.jex-form-textarea:focus{border-color:var(--jex-primary, #115A62)}.jex-form-textarea{min-height:80px;resize:vertical}.jex-form-submit{padding:10px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer;margin-top:4px}.jex-inline-form{display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--jex-bg-msg-bot, #f1f5f9);border:1px solid var(--jex-border-input, #e2e8f0);border-radius:var(--jex-radius, .75rem);width:100%}.jex-inline-form-title{font-weight:600;font-size:15px;color:var(--jex-text-main, #0f172a);margin:0}.jex-inline-form-subtitle{font-size:13px;color:var(--jex-text-muted, #64748b);line-height:1.4;margin:0 0 4px}.jex-inline-form-consent{font-size:11px;color:var(--jex-text-muted, #64748b);line-height:1.3;margin-top:4px;text-align:center}.jex-inline-form .jex-form-submit:disabled{opacity:.7;cursor:not-allowed}.jex-escalation-subtitle{font-size:13px;color:var(--jex-text-muted, #64748b);line-height:1.45;margin:0 0 8px}.jex-escalation-skip{padding:8px 12px;border:none;background:transparent;color:var(--jex-text-muted, #64748b);font-size:13px;cursor:pointer;text-decoration:underline;text-underline-offset:2px;text-align:center}.jex-escalation-skip:hover{color:var(--jex-text-main, #0f172a)}.jex-inline-form-card{position:relative;padding:14px;gap:8px}.jex-inline-form-dismiss{position:absolute;top:10px;right:10px;width:24px;height:24px;border-radius:50%;border:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-window, #fff);color:var(--jex-text-muted, #64748b);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1}.jex-inline-form-dismiss:hover{background:var(--jex-bg-msg-bot, #f1f5f9);color:var(--jex-text-main, #0f172a)}.jex-inline-form-submitted{display:flex;align-items:center;gap:10px;padding:10px 12px;background:var(--jex-bg-msg-bot, #f1f5f9);border:1px solid var(--jex-border-input, #e2e8f0);border-radius:var(--jex-radius, .75rem);width:100%}.jex-inline-form-check{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary) 15%,transparent);color:var(--jex-primary, #115A62);font-size:14px;font-weight:700;flex-shrink:0}.jex-inline-form-submitted-title{font-weight:600;font-size:var(--jex-font-size, 14px);color:var(--jex-text-main, #0f172a)}.jex-inline-form-submitted-detail{font-size:12px;color:var(--jex-text-muted, #64748b);margin-top:2px}.jex-escalation-confirm{border-left:3px solid var(--jex-primary, #115A62);padding-left:8px}.jex-session-prompt{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 16px;margin:8px 0;text-align:center}.jex-session-prompt-text{font-size:13px;color:var(--jex-text-muted, #64748b)}.jex-session-prompt-btn{padding:8px 16px;border-radius:8px;border:1px solid var(--jex-primary, #115A62);background:transparent;color:var(--jex-primary, #115A62);font-size:13px;font-weight:600;cursor:pointer}.jex-session-prompt-btn:hover{background:color-mix(in srgb,var(--jex-primary) 10%,transparent)}.jex-chat-input-resolved{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 16px;border-top:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-msg-bot, #f1f5f9);text-align:center}.jex-resolved-notice{font-size:13px;font-weight:500;color:var(--jex-text-muted, #64748b)}.jex-resolved-new-btn{padding:10px 20px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer;width:100%}.jex-resolved-new-btn:hover{opacity:.9}.jex-confirmation{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;height:100%;text-align:center}.jex-confirmation-icon{width:48px;height:48px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary, #115A62) 15%,transparent);color:var(--jex-primary, #115A62);font-size:22px;display:flex;align-items:center;justify-content:center}.jex-confirmation-title{font-size:18px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0}.jex-confirmation-body{font-size:13px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-ref{font-size:20px;font-weight:700;letter-spacing:.05em;color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 10%,transparent);padding:10px 20px;border-radius:10px}.jex-confirmation-hint{font-size:12px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-done{margin-top:8px;padding:10px 28px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer}.jex-home-lookup-link{background:none;border:none;font-size:12px;color:var(--jex-text-muted, #64748b);cursor:pointer;text-decoration:underline;padding:0;align-self:center}.jex-home-lookup{display:flex;gap:8px;width:100%;animation:jexFadeIn .4s .1s ease both}.jex-home-lookup-input{flex:1;padding:10px 14px;border-radius:10px;border:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-input);color:var(--jex-text-main);font-size:13px;font-family:ui-monospace,Cascadia Code,Fira Code,monospace;letter-spacing:.04em;outline:none;transition:border-color .2s}.jex-home-lookup-input::placeholder{font-family:inherit;letter-spacing:.04em;color:var(--jex-text-muted);opacity:.7}.jex-home-lookup-input:focus{border-color:var(--jex-primary, #115A62)}.jex-home-lookup-submit{padding:10px 16px;border-radius:10px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,opacity .2s;flex-shrink:0}.jex-home-lookup-submit:hover:not(:disabled){background:var(--jex-primary-hover)}.jex-home-lookup-submit:disabled{opacity:.4;cursor:default}';
|
|
6498
|
-
function
|
|
6709
|
+
const Zl = '.jex-widget{--jex-primary: #115A62;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-radius: .75rem;--jex-font-family: "Inter", system-ui, -apple-system, sans-serif;--jex-font-size: 14px;--jex-window-width: 380px;--jex-window-height: 600px;--jex-shadow: 0 16px 48px -12px rgba(13, 127, 138, .25), 0 4px 16px rgba(0, 0, 0, .08);pointer-events:auto;--jex-bg-trigger: var(--jex-primary);--jex-bg-header: var(--jex-primary);--jex-bg-msg-user: var(--jex-primary);--jex-bg-send-btn: var(--jex-primary);--jex-bg-window: rgba(255, 255, 255, .95);--jex-bg-msg-bot: #f1f5f9;--jex-bg-input: rgba(247, 253, 253, .6);--jex-text-header: #ffffff;--jex-text-msg-user: #ffffff;--jex-text-msg-bot: #0f172a;--jex-text-main: #0f172a;--jex-text-muted: #64748b;--jex-bg-avatar-agent: #d1fae5;--jex-text-avatar-agent: #065f46;--jex-border-window: rgba(226, 232, 240, .8);--jex-border-input: rgba(203, 213, 225, .8);--jex-bg-glass: var(--jex-bg-window);--jex-border-glass: var(--jex-border-window);font-family:var(--jex-font-family);-webkit-font-smoothing:antialiased}.dark .jex-widget,.jex-widget.dark{--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9);--jex-bg-avatar-agent: #064e3b;--jex-text-avatar-agent: #6ee7b7;--jex-bg-error: #3b1318;--jex-border-error: #5c1d24;--jex-text-error: #fca5a5}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light){--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9);--jex-bg-error: #3b1318;--jex-border-error: #5c1d24;--jex-text-error: #fca5a5}}.jex-widget *{box-sizing:border-box;margin:0;padding:0}.jex-container{position:fixed;bottom:24px;right:24px;display:flex;flex-direction:column;align-items:flex-end;gap:16px;z-index:9999}.jex-container.jex-pos-left{right:auto;left:24px;align-items:flex-start}:host(.jex-mode-embedded){display:block;width:100%;height:100%}:host(.jex-mode-embedded) .jex-widget{width:100%;height:100%}.jex-embedded{display:flex;flex-direction:column;width:100%;height:100%;background:var(--jex-bg-window);border:1px solid var(--jex-border-window);overflow:hidden}.jex-embedded .jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-floating-button{height:56px;min-width:56px;padding:0;background:var(--jex-bg-trigger);color:var(--jex-text-header);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--jex-shadow);transition:transform .3s cubic-bezier(.175,.885,.32,1.275),background .2s,width .3s ease,border-radius .3s ease}.jex-floating-button.jex-has-label{min-width:110px;padding:0 20px}.jex-fab-inner{display:flex;align-items:center;gap:12px}.jex-fab-label{font-size:15px;font-weight:600;white-space:nowrap}.jex-floating-button:hover{transform:scale(1.1);background:var(--jex-primary-hover)}.jex-floating-button:active{transform:scale(.95)}.jex-chat-window{width:var(--jex-window-width);height:var(--jex-window-height);max-height:calc(100vh - 120px);background:var(--jex-bg-window);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--jex-border-window);border-radius:calc(var(--jex-radius) * 2);box-shadow:var(--jex-shadow);display:flex;flex-direction:column;overflow:hidden;animation:jexSlideUp .4s cubic-bezier(.16,1,.3,1);transform-origin:bottom right}@keyframes jexSlideUp{0%{opacity:0;transform:scale(.8) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}.jex-chat-header{padding:20px;background:var(--jex-bg-header);color:var(--jex-text-header);display:flex;align-items:center;gap:12px;flex-shrink:0}.jex-header-info h3{font-size:16px;font-weight:600;color:var(--jex-text-header);margin:0}.jex-header-info p{font-size:12px;opacity:.8;color:var(--jex-text-header);margin:0}.jex-header-back{background:none;border:none;color:var(--jex-text-header);cursor:pointer;padding:4px;display:flex;align-items:center;opacity:.8;transition:opacity .2s;flex-shrink:0}.jex-header-back:hover{opacity:1}.jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-home{flex:1;display:flex;flex-direction:column;padding:24px;gap:20px;overflow-y:auto}.jex-home-hero{display:flex;align-items:center;gap:14px;animation:jexFadeIn .4s ease both}.jex-home-avatar{position:relative;width:48px;height:48px;border-radius:14px;background:var(--jex-primary);color:var(--jex-text-header);display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 4px 12px color-mix(in srgb,var(--jex-primary) 30%,transparent)}.jex-home-status-dot{position:absolute;bottom:-2px;right:-2px;width:14px;height:14px;border-radius:50%;background:#22c55e;border:2.5px solid var(--jex-bg-window);animation:jexPulse 2s ease-in-out infinite}@keyframes jexPulse{0%,to{box-shadow:0 0 #22c55e66}50%{box-shadow:0 0 0 6px #22c55e00}}.jex-home-hero-text{display:flex;flex-direction:column;gap:2px;min-width:0}.jex-home-title{font-size:17px;font-weight:700;color:var(--jex-text-main);margin:0;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.jex-home-status{font-size:12px;font-weight:500;color:#22c55e;letter-spacing:.02em}.jex-home-greeting{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:4px 16px 16px;padding:16px 18px;font-size:14px;line-height:1.55;color:var(--jex-text-main);animation:jexFadeIn .4s .1s ease both}.jex-home-greeting p{margin:0}@keyframes jexFadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.jex-home-actions{display:flex;flex-direction:column;gap:10px;animation:jexFadeIn .4s .2s ease both}.jex-home-start-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;padding:14px 20px;font-size:15px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,transform .15s,box-shadow .2s;width:100%;box-shadow:0 2px 8px color-mix(in srgb,var(--jex-primary) 25%,transparent)}.jex-home-start-btn:hover{background:var(--jex-primary-hover);transform:translateY(-1px);box-shadow:0 4px 16px color-mix(in srgb,var(--jex-primary) 35%,transparent)}.jex-home-start-btn:active{transform:translateY(0);box-shadow:0 1px 4px color-mix(in srgb,var(--jex-primary) 20%,transparent)}.jex-home-resume-card{display:flex;flex-direction:column;gap:8px;width:100%;text-align:left;padding:16px 18px;border-radius:14px;border:1.5px solid var(--jex-primary);background:color-mix(in srgb,var(--jex-primary) 6%,var(--jex-bg-window));cursor:pointer;font-family:inherit;transition:background .2s,border-color .2s,transform .15s,box-shadow .2s;box-shadow:0 2px 8px color-mix(in srgb,var(--jex-primary) 12%,transparent)}.jex-home-resume-card:hover{background:color-mix(in srgb,var(--jex-primary) 10%,var(--jex-bg-window));transform:translateY(-1px);box-shadow:0 4px 16px color-mix(in srgb,var(--jex-primary) 20%,transparent)}.jex-home-resume-card:active{transform:translateY(0)}.jex-home-resume-top{display:flex;align-items:center;justify-content:space-between}.jex-home-resume-label{font-size:14px;font-weight:600;color:var(--jex-primary)}.jex-home-resume-arrow{color:var(--jex-primary);opacity:.6;transition:opacity .2s,transform .2s}.jex-home-resume-card:hover .jex-home-resume-arrow{opacity:1;transform:translate(2px)}.jex-home-resume-ref{font-family:ui-monospace,Cascadia Code,Fira Code,monospace;font-size:13px;font-weight:600;letter-spacing:.06em;color:var(--jex-text-muted)}.jex-home-new-btn{background:transparent;color:var(--jex-text-muted);border:1px solid var(--jex-border-input);border-radius:12px;padding:12px 20px;font-size:14px;font-weight:500;cursor:pointer;font-family:inherit;transition:color .2s,border-color .2s,background .2s;width:100%}.jex-home-new-btn:hover{color:var(--jex-text-main);border-color:var(--jex-text-muted);background:color-mix(in srgb,var(--jex-primary) 3%,transparent)}.jex-session-ref{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:8px;font-size:12px}.jex-session-ref-label{color:var(--jex-text-muted);font-weight:500}.jex-session-ref-code{color:var(--jex-primary);font-weight:700;font-family:ui-monospace,Cascadia Code,monospace;letter-spacing:.05em}.jex-chat-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.jex-message-row{display:flex;align-items:flex-end;gap:8px;max-width:85%}.jex-message-row.bot{align-self:flex-start}.jex-message-content{flex:1;min-width:0}.jex-avatar{width:24px;height:24px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:12px;margin-bottom:2px}.jex-avatar-bot{background:var(--jex-bg-msg-bot);color:var(--jex-primary)}.jex-avatar-agent{background:var(--jex-bg-avatar-agent)}.jex-avatar-img{width:100%;height:100%;border-radius:50%;object-fit:cover}.jex-avatar-initials{font-size:9px;font-weight:700;color:var(--jex-text-avatar-agent)}.jex-message-author-row{display:flex;align-items:center;gap:6px;margin-top:2px;padding-left:4px}.jex-message-author{font-size:10px;color:var(--jex-text-muted)}.jex-reply-tag-btn{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:none;border-radius:4px;background:transparent;color:var(--jex-text-muted, #6b7280);cursor:pointer;transition:background .15s,color .15s}.jex-reply-tag-btn:hover{background:#0000000f;color:var(--jex-primary, #115A62)}.jex-reply-tag-btn:focus-visible{outline:2px solid var(--jex-primary, #115A62);outline-offset:1px}.jex-message{padding:12px 16px;border-radius:18px;font-size:14px;line-height:1.4}.jex-message.bot{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);color:var(--jex-text-msg-bot);border-bottom-left-radius:4px}.jex-message.user{align-self:flex-end;max-width:80%;background:var(--jex-bg-msg-user);color:var(--jex-text-msg-user);border-bottom-right-radius:4px}.jex-typing{align-self:flex-start;display:flex;gap:4px;padding:12px 16px}.jex-typing span{width:8px;height:8px;border-radius:50%;background:var(--jex-text-muted);animation:jexTypingDot 1.2s infinite ease-in-out}.jex-typing span:nth-child(2){animation-delay:.2s}.jex-typing span:nth-child(3){animation-delay:.4s}@keyframes jexTypingDot{0%,80%,to{transform:scale(.8);opacity:.4}40%{transform:scale(1);opacity:1}}.jex-md{word-break:break-word;overflow-wrap:anywhere}.jex-md p{margin:0 0 8px}.jex-md p:last-child{margin-bottom:0}.jex-md strong{font-weight:600}.jex-md em{font-style:italic}.jex-md ul,.jex-md ol{margin:0 0 8px;padding-left:20px}.jex-md ul:last-child,.jex-md ol:last-child{margin-bottom:0}.jex-md ul{list-style-type:disc}.jex-md ol{list-style-type:decimal}.jex-md li{margin-bottom:2px}.jex-md li:last-child{margin-bottom:0}.jex-md a{color:var(--jex-primary);text-decoration:underline;text-underline-offset:2px}.jex-md a:hover{opacity:.8}.jex-md code{background:#00000014;padding:1px 5px;border-radius:4px;font-size:.9em;font-family:ui-monospace,Cascadia Code,Fira Code,monospace}.jex-md pre{background:#0000000f;border-radius:8px;padding:10px 12px;margin:0 0 8px;overflow-x:auto;font-size:.85em}.jex-md pre:last-child{margin-bottom:0}.jex-md pre code{background:none;padding:0;border-radius:0;font-size:inherit}.jex-md h1,.jex-md h2,.jex-md h3,.jex-md h4{font-weight:600;margin:8px 0 4px}.jex-md h1:first-child,.jex-md h2:first-child,.jex-md h3:first-child,.jex-md h4:first-child{margin-top:0}.jex-md h3{font-size:1em}.jex-md h4{font-size:.95em}.jex-md hr{border:none;border-top:1px solid var(--jex-border-window);margin:8px 0}.jex-md blockquote{border-left:3px solid var(--jex-primary);margin:0 0 8px;padding:4px 12px;color:var(--jex-text-muted)}.jex-md blockquote:last-child{margin-bottom:0}.dark .jex-md code,.jex-widget.dark .jex-md code{background:#ffffff1a}.dark .jex-md pre,.jex-widget.dark .jex-md pre{background:#ffffff14}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-md code{background:#ffffff1a}:host:not(.light) .jex-widget:not(.light) .jex-md pre{background:#ffffff14}}.jex-streaming-cursor:after{content:"◊";margin-left:2px;animation:jexBlinkCursor .8s ease-in-out infinite}@keyframes jexBlinkCursor{0%,to{opacity:1}50%{opacity:0}}.jex-session-notice{align-self:center;text-align:center;padding:8px 16px;margin:8px 0;font-size:12px;color:var(--jex-text-muted);background:var(--jex-bg-input, #f1f5f9);border-radius:8px;line-height:1.4}.jex-message-error{background:var(--jex-bg-error, #fef2f2)!important;border-color:var(--jex-border-error, #fecaca)!important;color:var(--jex-text-error, #991b1b)!important}.jex-chat-input{padding:16px;border-top:1px solid var(--jex-border-window);display:flex;gap:8px;flex-shrink:0}.jex-chat-input input{flex:1;background:var(--jex-bg-input);border:1px solid var(--jex-border-input);border-radius:12px;padding:10px 14px;color:var(--jex-text-main);outline:none;font-family:inherit;font-size:14px}.jex-chat-input input:focus{border-color:var(--jex-primary)}.jex-send-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s cubic-bezier(.175,.885,.32,1.275);flex-shrink:0}.jex-send-btn:hover{transform:scale(1.05);background:var(--jex-primary-hover)}.jex-send-btn:active{transform:scale(.95)}.jex-widget-footer{display:flex;align-items:center;justify-content:center;padding:8px 16px;border-top:1px solid var(--jex-border-glass);background:#00000005;flex-shrink:0}.jex-widget.dark .jex-widget-footer{background:#ffffff05}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-widget-footer{background:#ffffff05}}.jex-branding{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--jex-text-muted);font-size:11px;font-weight:500;transition:color .2s}.jex-branding:hover{color:var(--jex-text-main)}.jex-branding-icon{color:var(--jex-primary)}.jex-branding span strong{font-weight:700;color:var(--jex-text-main)}.jex-locale-select-wrapper{position:relative;display:flex;align-items:center}.jex-locale-select{appearance:none;-webkit-appearance:none;background:transparent;border:1px solid transparent;padding:4px 20px 4px 6px;border-radius:6px;font-family:inherit;font-size:11px;font-weight:600;color:var(--jex-text-muted);background-color:transparent;cursor:pointer;outline:none;transition:all .2s ease}.jex-locale-select option{background-color:#fff;color:#0f172a}.jex-locale-select:hover,.jex-locale-select:focus-visible{color:var(--jex-text-main);background:#0000000a}.jex-widget.dark .jex-locale-select:hover,.jex-widget.dark .jex-locale-select:focus-visible{background:#ffffff0d}.jex-widget.dark .jex-locale-select option{background-color:#0f172a;color:#f8fafc}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-locale-select:hover,:host:not(.light) .jex-widget:not(.light) .jex-locale-select:focus-visible{background:#ffffff0d}:host:not(.light) .jex-widget:not(.light) .jex-locale-select option{background-color:#0f172a;color:#f8fafc}}.jex-locale-select:focus-visible{border-color:var(--jex-primary)}.jex-locale-chevron{position:absolute;right:4px;pointer-events:none;color:var(--jex-text-muted);transition:color .2s ease}.jex-locale-select-wrapper:hover .jex-locale-chevron{color:var(--jex-text-main)}.jex-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:var(--jex-bg-window, #fff);z-index:10;padding:24px;text-align:center}.jex-loading-spinner{width:32px;height:32px;border:3px solid var(--jex-border-input, #e2e8f0);border-top-color:var(--jex-primary, #115A62);border-radius:50%;animation:jex-spin .7s linear infinite}@keyframes jex-spin{to{transform:rotate(360deg)}}.jex-loading-message{font-size:14px;color:var(--jex-text-muted, #64748b)}.jex-error-message{font-size:14px;color:var(--jex-text-main, #334155)}.jex-error-actions{display:flex;gap:8px}.jex-error-retry,.jex-error-back{padding:8px 16px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;border:none}.jex-error-retry{background:var(--jex-primary, #115A62);color:#fff}.jex-error-back{background:transparent;color:var(--jex-text-muted, #64748b);border:1px solid var(--jex-border-input, #e2e8f0)}.jex-selection{display:flex;flex-direction:column;gap:12px;padding:24px 16px;height:100%}.jex-selection-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 8px}.jex-selection-options{display:flex;flex-direction:column;gap:10px}.jex-selection-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:16px;border-radius:12px;border:1px solid var(--jex-border-window, #e2e8f0);background:transparent;cursor:pointer;text-align:left;transition:border-color .15s ease,background .15s ease}.jex-selection-option:hover{border-color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 5%,transparent)}.jex-selection-icon{font-size:20px}.jex-selection-label{font-size:14px;font-weight:600;color:var(--jex-text-main, #0f172a)}.jex-selection-sub{font-size:12px;color:var(--jex-text-muted, #64748b)}.jex-form-screen{display:flex;flex-direction:column;padding:20px 16px;height:100%;overflow-y:auto}.jex-form-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 16px}.jex-form{display:flex;flex-direction:column;gap:10px}.jex-form-input,.jex-form-textarea{padding:10px 12px;border-radius:8px;border:1px solid var(--jex-border-input, #e2e8f0);font-size:14px;background:transparent;color:var(--jex-text-main, #0f172a);outline:none}.jex-form-input:focus,.jex-form-textarea:focus{border-color:var(--jex-primary, #115A62)}.jex-form-textarea{min-height:80px;resize:vertical}.jex-form-submit{padding:10px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer;margin-top:4px}.jex-inline-form{display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--jex-bg-msg-bot, #f1f5f9);border:1px solid var(--jex-border-input, #e2e8f0);border-radius:var(--jex-radius, .75rem);width:100%}.jex-inline-form-title{font-weight:600;font-size:15px;color:var(--jex-text-main, #0f172a);margin:0}.jex-inline-form-subtitle{font-size:13px;color:var(--jex-text-muted, #64748b);line-height:1.4;margin:0 0 4px}.jex-inline-form-consent{font-size:11px;color:var(--jex-text-muted, #64748b);line-height:1.3;margin-top:4px;text-align:center}.jex-inline-form .jex-form-submit:disabled{opacity:.7;cursor:not-allowed}.jex-escalation-subtitle{font-size:13px;color:var(--jex-text-muted, #64748b);line-height:1.45;margin:0 0 8px}.jex-escalation-skip{padding:8px 12px;border:none;background:transparent;color:var(--jex-text-muted, #64748b);font-size:13px;cursor:pointer;text-decoration:underline;text-underline-offset:2px;text-align:center}.jex-escalation-skip:hover{color:var(--jex-text-main, #0f172a)}.jex-inline-form-card{position:relative;padding:14px;gap:8px}.jex-inline-form-dismiss{position:absolute;top:10px;right:10px;width:24px;height:24px;border-radius:50%;border:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-window, #fff);color:var(--jex-text-muted, #64748b);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1}.jex-inline-form-dismiss:hover{background:var(--jex-bg-msg-bot, #f1f5f9);color:var(--jex-text-main, #0f172a)}.jex-inline-form-submitted{display:flex;align-items:center;gap:10px;padding:10px 12px;background:var(--jex-bg-msg-bot, #f1f5f9);border:1px solid var(--jex-border-input, #e2e8f0);border-radius:var(--jex-radius, .75rem);width:100%}.jex-inline-form-check{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary) 15%,transparent);color:var(--jex-primary, #115A62);font-size:14px;font-weight:700;flex-shrink:0}.jex-inline-form-submitted-title{font-weight:600;font-size:var(--jex-font-size, 14px);color:var(--jex-text-main, #0f172a)}.jex-inline-form-submitted-detail{font-size:12px;color:var(--jex-text-muted, #64748b);margin-top:2px}.jex-escalation-confirm{border-left:3px solid var(--jex-primary, #115A62);padding-left:8px}.jex-session-prompt{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 16px;margin:8px 0;text-align:center}.jex-session-prompt-text{font-size:13px;color:var(--jex-text-muted, #64748b)}.jex-session-prompt-btn{padding:8px 16px;border-radius:8px;border:1px solid var(--jex-primary, #115A62);background:transparent;color:var(--jex-primary, #115A62);font-size:13px;font-weight:600;cursor:pointer}.jex-session-prompt-btn:hover{background:color-mix(in srgb,var(--jex-primary) 10%,transparent)}.jex-chat-input-resolved{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 16px;border-top:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-msg-bot, #f1f5f9);text-align:center}.jex-resolved-notice{font-size:13px;font-weight:500;color:var(--jex-text-muted, #64748b)}.jex-resolved-new-btn{padding:10px 20px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer;width:100%}.jex-resolved-new-btn:hover{opacity:.9}.jex-confirmation{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;height:100%;text-align:center}.jex-confirmation-icon{width:48px;height:48px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary, #115A62) 15%,transparent);color:var(--jex-primary, #115A62);font-size:22px;display:flex;align-items:center;justify-content:center}.jex-confirmation-title{font-size:18px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0}.jex-confirmation-body{font-size:13px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-ref{font-size:20px;font-weight:700;letter-spacing:.05em;color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 10%,transparent);padding:10px 20px;border-radius:10px}.jex-confirmation-hint{font-size:12px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-done{margin-top:8px;padding:10px 28px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer}.jex-home-lookup-link{background:none;border:none;font-size:12px;color:var(--jex-text-muted, #64748b);cursor:pointer;text-decoration:underline;padding:0;align-self:center}.jex-home-lookup{display:flex;gap:8px;width:100%;animation:jexFadeIn .4s .1s ease both}.jex-home-lookup-input{flex:1;padding:10px 14px;border-radius:10px;border:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-input);color:var(--jex-text-main);font-size:13px;font-family:ui-monospace,Cascadia Code,Fira Code,monospace;letter-spacing:.04em;outline:none;transition:border-color .2s}.jex-home-lookup-input::placeholder{font-family:inherit;letter-spacing:.04em;color:var(--jex-text-muted);opacity:.7}.jex-home-lookup-input:focus{border-color:var(--jex-primary, #115A62)}.jex-home-lookup-submit{padding:10px 16px;border-radius:10px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,opacity .2s;flex-shrink:0}.jex-home-lookup-submit:hover:not(:disabled){background:var(--jex-primary-hover)}.jex-home-lookup-submit:disabled{opacity:.4;cursor:default}.jex-sources-row{margin-top:6px;margin-left:32px;display:flex;flex-direction:column;gap:6px}.jex-sources-toggle{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;background:transparent;border:none;border-radius:6px;cursor:pointer;font-size:11px;color:var(--jex-text-muted, #6b7280);font-family:inherit;align-self:flex-start;transition:background .15s,color .15s}.jex-sources-toggle:hover{background:#0000000a;color:inherit}.jex-sources-icon{font-size:12px;line-height:1}.jex-sources-chevron{display:inline-block;font-size:10px;transition:transform .15s}.jex-sources-chevron--open{transform:rotate(180deg)}.jex-sources-pills{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.jex-source-pill{display:inline-flex;align-items:center;gap:6px;max-width:240px;padding:2px 8px;border-radius:999px;border:1px solid rgba(0,0,0,.1);background:#0000000a;color:var(--jex-text-muted, #6b7280);font-size:11px;text-decoration:none;cursor:pointer;transition:background .15s,color .15s}.jex-source-pill:hover{background:#00000014;color:inherit}.jex-source-id{display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 4px;border-radius:4px;background:var(--jex-primary, #115A62);color:#fff;font-size:10px;font-weight:600;line-height:1;flex-shrink:0;font-variant-numeric:tabular-nums}.jex-source-type{font-size:10px;flex-shrink:0}.jex-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.jex-source-score{opacity:.6;flex-shrink:0;font-variant-numeric:tabular-nums}';
|
|
6710
|
+
function Xl(t) {
|
|
6499
6711
|
const e = document.createElement("style");
|
|
6500
|
-
e.textContent =
|
|
6712
|
+
e.textContent = Zl, t.appendChild(e);
|
|
6501
6713
|
}
|
|
6502
|
-
const
|
|
6714
|
+
const Yl = "https://tame-spider-109.eu-west-1.convex.cloud";
|
|
6503
6715
|
let Qt = null;
|
|
6504
|
-
function
|
|
6505
|
-
const e = t ??
|
|
6716
|
+
function ec(t) {
|
|
6717
|
+
const e = t ?? Yl;
|
|
6506
6718
|
if (!e)
|
|
6507
6719
|
throw new Error("[jexity] No Convex URL — set VITE_CONVEX_URL at build time or data-convex-url on the script tag");
|
|
6508
|
-
return Qt || (Qt = new
|
|
6720
|
+
return Qt || (Qt = new Ho(ca(e))), Qt;
|
|
6509
6721
|
}
|
|
6510
|
-
function
|
|
6722
|
+
function tc(t, e) {
|
|
6511
6723
|
const n = t.shadowRoot ?? t.attachShadow({ mode: "open" });
|
|
6512
6724
|
for (; n.firstChild; )
|
|
6513
6725
|
n.removeChild(n.firstChild);
|
|
6514
|
-
|
|
6726
|
+
Xl(n), mt.value = e.source, xt.value = e.bootstrapToken, U.value = [{ id: "home" }], e.mode === "embedded" && (t.classList.add("jex-mode-embedded"), A.value = !0);
|
|
6515
6727
|
const r = document.createElement("div");
|
|
6516
6728
|
return e.mode === "embedded" && (r.style.cssText = "width:100%;height:100%"), n.appendChild(r), he(
|
|
6517
|
-
/* @__PURE__ */ h(
|
|
6729
|
+
/* @__PURE__ */ h(Go, { client: ec(e.convexUrl), children: /* @__PURE__ */ h(Kl, { options: e }) }),
|
|
6518
6730
|
r
|
|
6519
6731
|
), function() {
|
|
6520
|
-
he(null, r), A.value = !1, mt.value = void 0,
|
|
6732
|
+
he(null, r), A.value = !1, mt.value = void 0, xt.value = void 0, U.value = [{ id: "home" }];
|
|
6521
6733
|
};
|
|
6522
6734
|
}
|
|
6523
|
-
function
|
|
6524
|
-
const r =
|
|
6735
|
+
function nc(t, e, n) {
|
|
6736
|
+
const r = tc(t, e), i = /* @__PURE__ */ new Set(), s = A.subscribe((l) => {
|
|
6525
6737
|
for (const a of i)
|
|
6526
6738
|
a(l);
|
|
6527
6739
|
});
|
|
@@ -6548,17 +6760,17 @@ function Nl(t, e, n) {
|
|
|
6548
6760
|
}
|
|
6549
6761
|
};
|
|
6550
6762
|
}
|
|
6551
|
-
let
|
|
6552
|
-
function
|
|
6553
|
-
|
|
6763
|
+
let Le = null;
|
|
6764
|
+
function rc(t) {
|
|
6765
|
+
Le && Le.shutdown();
|
|
6554
6766
|
let e;
|
|
6555
6767
|
t.container ? e = typeof t.container == "string" ? document.querySelector(t.container) : t.container : (e = document.createElement("div"), e.id = "jexity-chat-widget", document.body.appendChild(e));
|
|
6556
|
-
const n =
|
|
6557
|
-
t.container || e.remove(),
|
|
6768
|
+
const n = nc(e, t, () => {
|
|
6769
|
+
t.container || e.remove(), Le === n && (Le = null);
|
|
6558
6770
|
});
|
|
6559
|
-
return
|
|
6771
|
+
return Le = n, n;
|
|
6560
6772
|
}
|
|
6561
6773
|
export {
|
|
6562
|
-
|
|
6774
|
+
rc as JexityChat
|
|
6563
6775
|
};
|
|
6564
6776
|
//# sourceMappingURL=index.mjs.map
|