deep-chat-dev 9.0.106 → 9.0.107
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/custom-elements.json +1428 -1428
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.js +217 -217
- package/dist/services/openAI/openAIAssistantIO.d.ts.map +1 -1
- package/dist/types/openAIResult.d.ts +4 -1
- package/dist/types/openAIResult.d.ts.map +1 -1
- package/dist/views/chat/input/input.d.ts.map +1 -1
- package/dist/views/chat/input/validation/validationHandler.d.ts +0 -1
- package/dist/views/chat/input/validation/validationHandler.d.ts.map +1 -1
- package/dist/webModel/webModel.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -864,17 +864,17 @@ function Ps(s) {
|
|
864
864
|
function z(s) {
|
865
865
|
return Rs.test(s) ? s.replace(Os, Ps) : s;
|
866
866
|
}
|
867
|
-
var
|
868
|
-
|
867
|
+
var m = {};
|
868
|
+
m.blockquote_open = function () {
|
869
869
|
return "<blockquote>\n";
|
870
870
|
};
|
871
|
-
|
871
|
+
m.blockquote_close = function (s, e) {
|
872
872
|
return "</blockquote>" + Re(s, e);
|
873
873
|
};
|
874
|
-
|
874
|
+
m.code = function (s, e) {
|
875
875
|
return s[e].block ? "<pre><code>" + z(s[e].content) + "</code></pre>" + Re(s, e) : "<code>" + z(s[e].content) + "</code>";
|
876
876
|
};
|
877
|
-
|
877
|
+
m.fence = function (s, e, t, i, n) {
|
878
878
|
var r = s[e],
|
879
879
|
o = "",
|
880
880
|
a = t.langPrefix,
|
@@ -888,203 +888,203 @@ f.fence = function (s, e, t, i, n) {
|
|
888
888
|
}
|
889
889
|
return t.highlight ? u = t.highlight.apply(t.highlight, [r.content].concat(c)) || z(r.content) : u = z(r.content), "<pre><code" + o + ">" + u + "</code></pre>" + Re(s, e);
|
890
890
|
};
|
891
|
-
|
892
|
-
|
891
|
+
m.fence_custom = {};
|
892
|
+
m.heading_open = function (s, e) {
|
893
893
|
return "<h" + s[e].hLevel + ">";
|
894
894
|
};
|
895
|
-
|
895
|
+
m.heading_close = function (s, e) {
|
896
896
|
return "</h" + s[e].hLevel + ">\n";
|
897
897
|
};
|
898
|
-
|
898
|
+
m.hr = function (s, e, t) {
|
899
899
|
return (t.xhtmlOut ? "<hr />" : "<hr>") + Re(s, e);
|
900
900
|
};
|
901
|
-
|
901
|
+
m.bullet_list_open = function () {
|
902
902
|
return "<ul>\n";
|
903
903
|
};
|
904
|
-
|
904
|
+
m.bullet_list_close = function (s, e) {
|
905
905
|
return "</ul>" + Re(s, e);
|
906
906
|
};
|
907
|
-
|
907
|
+
m.list_item_open = function () {
|
908
908
|
return "<li>";
|
909
909
|
};
|
910
|
-
|
910
|
+
m.list_item_close = function () {
|
911
911
|
return "</li>\n";
|
912
912
|
};
|
913
|
-
|
913
|
+
m.ordered_list_open = function (s, e) {
|
914
914
|
var t = s[e],
|
915
915
|
i = t.order > 1 ? ' start="' + t.order + '"' : "";
|
916
916
|
return "<ol" + i + ">\n";
|
917
917
|
};
|
918
|
-
|
918
|
+
m.ordered_list_close = function (s, e) {
|
919
919
|
return "</ol>" + Re(s, e);
|
920
920
|
};
|
921
|
-
|
921
|
+
m.paragraph_open = function (s, e) {
|
922
922
|
return s[e].tight ? "" : "<p>";
|
923
923
|
};
|
924
|
-
|
924
|
+
m.paragraph_close = function (s, e) {
|
925
925
|
var t = !(s[e].tight && e && s[e - 1].type === "inline" && !s[e - 1].content);
|
926
926
|
return (s[e].tight ? "" : "</p>") + (t ? Re(s, e) : "");
|
927
927
|
};
|
928
|
-
|
928
|
+
m.link_open = function (s, e, t) {
|
929
929
|
var i = s[e].title ? ' title="' + z(Ie(s[e].title)) + '"' : "",
|
930
930
|
n = t.linkTarget ? ' target="' + t.linkTarget + '"' : "";
|
931
931
|
return '<a href="' + z(s[e].href) + '"' + i + n + ">";
|
932
932
|
};
|
933
|
-
|
933
|
+
m.link_close = function () {
|
934
934
|
return "</a>";
|
935
935
|
};
|
936
|
-
|
936
|
+
m.image = function (s, e, t) {
|
937
937
|
var i = ' src="' + z(s[e].src) + '"',
|
938
938
|
n = s[e].title ? ' title="' + z(Ie(s[e].title)) + '"' : "",
|
939
939
|
r = ' alt="' + (s[e].alt ? z(Ie(ft(s[e].alt))) : "") + '"',
|
940
940
|
o = t.xhtmlOut ? " /" : "";
|
941
941
|
return "<img" + i + r + n + o + ">";
|
942
942
|
};
|
943
|
-
|
943
|
+
m.table_open = function () {
|
944
944
|
return "<table>\n";
|
945
945
|
};
|
946
|
-
|
946
|
+
m.table_close = function () {
|
947
947
|
return "</table>\n";
|
948
948
|
};
|
949
|
-
|
949
|
+
m.thead_open = function () {
|
950
950
|
return "<thead>\n";
|
951
951
|
};
|
952
|
-
|
952
|
+
m.thead_close = function () {
|
953
953
|
return "</thead>\n";
|
954
954
|
};
|
955
|
-
|
955
|
+
m.tbody_open = function () {
|
956
956
|
return "<tbody>\n";
|
957
957
|
};
|
958
|
-
|
958
|
+
m.tbody_close = function () {
|
959
959
|
return "</tbody>\n";
|
960
960
|
};
|
961
|
-
|
961
|
+
m.tr_open = function () {
|
962
962
|
return "<tr>";
|
963
963
|
};
|
964
|
-
|
964
|
+
m.tr_close = function () {
|
965
965
|
return "</tr>\n";
|
966
966
|
};
|
967
|
-
|
967
|
+
m.th_open = function (s, e) {
|
968
968
|
var t = s[e];
|
969
969
|
return "<th" + (t.align ? ' style="text-align:' + t.align + '"' : "") + ">";
|
970
970
|
};
|
971
|
-
|
971
|
+
m.th_close = function () {
|
972
972
|
return "</th>";
|
973
973
|
};
|
974
|
-
|
974
|
+
m.td_open = function (s, e) {
|
975
975
|
var t = s[e];
|
976
976
|
return "<td" + (t.align ? ' style="text-align:' + t.align + '"' : "") + ">";
|
977
977
|
};
|
978
|
-
|
978
|
+
m.td_close = function () {
|
979
979
|
return "</td>";
|
980
980
|
};
|
981
|
-
|
981
|
+
m.strong_open = function () {
|
982
982
|
return "<strong>";
|
983
983
|
};
|
984
|
-
|
984
|
+
m.strong_close = function () {
|
985
985
|
return "</strong>";
|
986
986
|
};
|
987
|
-
|
987
|
+
m.em_open = function () {
|
988
988
|
return "<em>";
|
989
989
|
};
|
990
|
-
|
990
|
+
m.em_close = function () {
|
991
991
|
return "</em>";
|
992
992
|
};
|
993
|
-
|
993
|
+
m.del_open = function () {
|
994
994
|
return "<del>";
|
995
995
|
};
|
996
|
-
|
996
|
+
m.del_close = function () {
|
997
997
|
return "</del>";
|
998
998
|
};
|
999
|
-
|
999
|
+
m.ins_open = function () {
|
1000
1000
|
return "<ins>";
|
1001
1001
|
};
|
1002
|
-
|
1002
|
+
m.ins_close = function () {
|
1003
1003
|
return "</ins>";
|
1004
1004
|
};
|
1005
|
-
|
1005
|
+
m.mark_open = function () {
|
1006
1006
|
return "<mark>";
|
1007
1007
|
};
|
1008
|
-
|
1008
|
+
m.mark_close = function () {
|
1009
1009
|
return "</mark>";
|
1010
1010
|
};
|
1011
|
-
|
1011
|
+
m.sub = function (s, e) {
|
1012
1012
|
return "<sub>" + z(s[e].content) + "</sub>";
|
1013
1013
|
};
|
1014
|
-
|
1014
|
+
m.sup = function (s, e) {
|
1015
1015
|
return "<sup>" + z(s[e].content) + "</sup>";
|
1016
1016
|
};
|
1017
|
-
|
1017
|
+
m.hardbreak = function (s, e, t) {
|
1018
1018
|
return t.xhtmlOut ? "<br />\n" : "<br>\n";
|
1019
1019
|
};
|
1020
|
-
|
1020
|
+
m.softbreak = function (s, e, t) {
|
1021
1021
|
return t.breaks ? t.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
|
1022
1022
|
};
|
1023
|
-
|
1023
|
+
m.text = function (s, e) {
|
1024
1024
|
return z(s[e].content);
|
1025
1025
|
};
|
1026
|
-
|
1026
|
+
m.htmlblock = function (s, e) {
|
1027
1027
|
return s[e].content;
|
1028
1028
|
};
|
1029
|
-
|
1029
|
+
m.htmltag = function (s, e) {
|
1030
1030
|
return s[e].content;
|
1031
1031
|
};
|
1032
|
-
|
1032
|
+
m.abbr_open = function (s, e) {
|
1033
1033
|
return '<abbr title="' + z(Ie(s[e].title)) + '">';
|
1034
1034
|
};
|
1035
|
-
|
1035
|
+
m.abbr_close = function () {
|
1036
1036
|
return "</abbr>";
|
1037
1037
|
};
|
1038
|
-
|
1038
|
+
m.footnote_ref = function (s, e) {
|
1039
1039
|
var t = Number(s[e].id + 1).toString(),
|
1040
1040
|
i = "fnref" + t;
|
1041
1041
|
return s[e].subId > 0 && (i += ":" + s[e].subId), '<sup class="footnote-ref"><a href="#fn' + t + '" id="' + i + '">[' + t + "]</a></sup>";
|
1042
1042
|
};
|
1043
|
-
|
1043
|
+
m.footnote_block_open = function (s, e, t) {
|
1044
1044
|
var i = t.xhtmlOut ? "<hr class=\"footnotes-sep\" />\n" : "<hr class=\"footnotes-sep\">\n";
|
1045
1045
|
return i + "<section class=\"footnotes\">\n<ol class=\"footnotes-list\">\n";
|
1046
1046
|
};
|
1047
|
-
|
1047
|
+
m.footnote_block_close = function () {
|
1048
1048
|
return "</ol>\n</section>\n";
|
1049
1049
|
};
|
1050
|
-
|
1050
|
+
m.footnote_open = function (s, e) {
|
1051
1051
|
var t = Number(s[e].id + 1).toString();
|
1052
1052
|
return '<li id="fn' + t + '" class="footnote-item">';
|
1053
1053
|
};
|
1054
|
-
|
1054
|
+
m.footnote_close = function () {
|
1055
1055
|
return "</li>\n";
|
1056
1056
|
};
|
1057
|
-
|
1057
|
+
m.footnote_anchor = function (s, e) {
|
1058
1058
|
var t = Number(s[e].id + 1).toString(),
|
1059
1059
|
i = "fnref" + t;
|
1060
1060
|
return s[e].subId > 0 && (i += ":" + s[e].subId), ' <a href="#' + i + '" class="footnote-backref">↩</a>';
|
1061
1061
|
};
|
1062
|
-
|
1062
|
+
m.dl_open = function () {
|
1063
1063
|
return "<dl>\n";
|
1064
1064
|
};
|
1065
|
-
|
1065
|
+
m.dt_open = function () {
|
1066
1066
|
return "<dt>";
|
1067
1067
|
};
|
1068
|
-
|
1068
|
+
m.dd_open = function () {
|
1069
1069
|
return "<dd>";
|
1070
1070
|
};
|
1071
|
-
|
1071
|
+
m.dl_close = function () {
|
1072
1072
|
return "</dl>\n";
|
1073
1073
|
};
|
1074
|
-
|
1074
|
+
m.dt_close = function () {
|
1075
1075
|
return "</dt>\n";
|
1076
1076
|
};
|
1077
|
-
|
1077
|
+
m.dd_close = function () {
|
1078
1078
|
return "</dd>\n";
|
1079
1079
|
};
|
1080
1080
|
function $n(s, e) {
|
1081
1081
|
return ++e >= s.length - 2 ? e : s[e].type === "paragraph_open" && s[e].tight && s[e + 1].type === "inline" && s[e + 1].content.length === 0 && s[e + 2].type === "paragraph_close" && s[e + 2].tight ? $n(s, e + 2) : e;
|
1082
1082
|
}
|
1083
|
-
var Re =
|
1083
|
+
var Re = m.getBreak = function (e, t) {
|
1084
1084
|
return t = $n(e, t), t < e.length && e[t].type === "list_item_close" ? "" : "\n";
|
1085
1085
|
};
|
1086
1086
|
function Gi() {
|
1087
|
-
this.rules = Kn({},
|
1087
|
+
this.rules = Kn({}, m), this.getBreak = m.getBreak;
|
1088
1088
|
}
|
1089
1089
|
Gi.prototype.renderInline = function (s, e, t) {
|
1090
1090
|
for (var i = this.rules, n = s.length, r = 0, o = ""; n--;) o += i[s[r].type](s, r++, e, t, this);
|
@@ -1292,13 +1292,13 @@ function Xn(s) {
|
|
1292
1292
|
return s.trim().replace(/\s+/g, " ").toUpperCase();
|
1293
1293
|
}
|
1294
1294
|
function Bs(s, e, t, i) {
|
1295
|
-
var n, r, o, a, l, c, d, u,
|
1295
|
+
var n, r, o, a, l, c, d, u, p;
|
1296
1296
|
if (s.charCodeAt(0) !== 91 || s.indexOf("]:") === -1 || (n = new Oe(s, e, t, i, []), r = mt(n, 0), r < 0 || s.charCodeAt(r + 1) !== 58)) return -1;
|
1297
1297
|
for (a = n.posMax, o = r + 2; o < a && (l = n.src.charCodeAt(o), !(l !== 32 && l !== 10)); o++);
|
1298
1298
|
if (!Yn(n, o)) return -1;
|
1299
1299
|
for (d = n.linkContent, o = n.pos, c = o, o = o + 1; o < a && (l = n.src.charCodeAt(o), !(l !== 32 && l !== 10)); o++);
|
1300
1300
|
for (o < a && c !== o && Zn(n, o) ? (u = n.linkContent, o = n.pos) : (u = "", o = c); o < a && n.src.charCodeAt(o) === 32;) o++;
|
1301
|
-
return o < a && n.src.charCodeAt(o) !== 10 ? -1 : (
|
1301
|
+
return o < a && n.src.charCodeAt(o) !== 10 ? -1 : (p = Xn(s.slice(1, r)), _typeof(i.references[p]) > "u" && (i.references[p] = {
|
1302
1302
|
title: u,
|
1303
1303
|
href: d
|
1304
1304
|
}), o);
|
@@ -1335,9 +1335,9 @@ function qs(s) {
|
|
1335
1335
|
c,
|
1336
1336
|
d = 0,
|
1337
1337
|
u = !1,
|
1338
|
-
|
1339
|
-
if (s.env.footnotes && (s.tokens = s.tokens.filter(function (
|
1340
|
-
return
|
1338
|
+
p = {};
|
1339
|
+
if (s.env.footnotes && (s.tokens = s.tokens.filter(function (h) {
|
1340
|
+
return h.type === "footnote_reference_open" ? (u = !0, l = [], c = h.label, !1) : h.type === "footnote_reference_close" ? (u = !1, p[":" + c] = l, !1) : (u && l.push(h), !u);
|
1341
1341
|
}), !!s.env.footnotes.list)) {
|
1342
1342
|
for (o = s.env.footnotes.list, s.tokens.push({
|
1343
1343
|
type: "footnote_block_open",
|
@@ -1360,7 +1360,7 @@ function qs(s) {
|
|
1360
1360
|
type: "paragraph_close",
|
1361
1361
|
tight: !1,
|
1362
1362
|
level: --d
|
1363
|
-
})) : o[e].label && (a =
|
1363
|
+
})) : o[e].label && (a = p[":" + o[e].label]), s.tokens = s.tokens.concat(a), s.tokens[s.tokens.length - 1].type === "paragraph_close" ? r = s.tokens.pop() : r = null, n = o[e].count > 0 ? o[e].count : 1, i = 0; i < n; i++) s.tokens.push({
|
1364
1364
|
type: "footnote_anchor",
|
1365
1365
|
id: e,
|
1366
1366
|
subId: i,
|
@@ -1393,15 +1393,15 @@ function Hs(s) {
|
|
1393
1393
|
c,
|
1394
1394
|
d,
|
1395
1395
|
u,
|
1396
|
-
|
1397
|
-
|
1396
|
+
p,
|
1397
|
+
h = s.tokens;
|
1398
1398
|
if (s.env.abbreviations) {
|
1399
|
-
for (s.env.abbrRegExp || (
|
1399
|
+
for (s.env.abbrRegExp || (p = "(^|[" + cn.split("").map(Si).join("") + "])(" + Object.keys(s.env.abbreviations).map(function (g) {
|
1400
1400
|
return g.substr(1);
|
1401
|
-
}).sort(function (g,
|
1402
|
-
return
|
1403
|
-
}).map(Si).join("|") + ")($|[" + cn.split("").map(Si).join("") + "])", s.env.abbrRegExp = new RegExp(
|
1404
|
-
for (n =
|
1401
|
+
}).sort(function (g, f) {
|
1402
|
+
return f.length - g.length;
|
1403
|
+
}).map(Si).join("|") + ")($|[" + cn.split("").map(Si).join("") + "])", s.env.abbrRegExp = new RegExp(p, "g")), d = s.env.abbrRegExp, t = 0, i = h.length; t < i; t++) if (h[t].type === "inline") {
|
1404
|
+
for (n = h[t].children, e = n.length - 1; e >= 0; e--) if (r = n[e], r.type === "text") {
|
1405
1405
|
for (l = 0, o = r.content, d.lastIndex = 0, c = r.level, a = []; u = d.exec(o);) d.lastIndex > l && a.push({
|
1406
1406
|
type: "text",
|
1407
1407
|
content: o.slice(l, u.index + u[1].length),
|
@@ -1422,7 +1422,7 @@ function Hs(s) {
|
|
1422
1422
|
type: "text",
|
1423
1423
|
content: o.slice(l),
|
1424
1424
|
level: c
|
1425
|
-
}),
|
1425
|
+
}), h[t].children = n = [].concat(n.slice(0, e), a, n.slice(e + 1)));
|
1426
1426
|
}
|
1427
1427
|
}
|
1428
1428
|
}
|
@@ -1457,20 +1457,20 @@ function ze(s, e, t) {
|
|
1457
1457
|
return s.substr(0, e) + t + s.substr(e + 1);
|
1458
1458
|
}
|
1459
1459
|
function Zs(s) {
|
1460
|
-
var e, t, i, n, r, o, a, l, c, d, u,
|
1460
|
+
var e, t, i, n, r, o, a, l, c, d, u, p, h, g, f, S, w;
|
1461
1461
|
if (s.options.typographer) {
|
1462
|
-
for (w = [],
|
1463
|
-
for (S = s.tokens[
|
1464
|
-
for (a = S[e].level,
|
1465
|
-
w.length =
|
1462
|
+
for (w = [], f = s.tokens.length - 1; f >= 0; f--) if (s.tokens[f].type === "inline") {
|
1463
|
+
for (S = s.tokens[f].children, w.length = 0, e = 0; e < S.length; e++) if (t = S[e], !(t.type !== "text" || $s.test(t.text))) {
|
1464
|
+
for (a = S[e].level, h = w.length - 1; h >= 0 && !(w[h].level <= a); h--);
|
1465
|
+
w.length = h + 1, i = t.content, r = 0, o = i.length;
|
1466
1466
|
e: for (; r < o && (dn.lastIndex = r, n = dn.exec(i), !!n);) {
|
1467
1467
|
if (l = !hn(i, n.index - 1), r = n.index + 1, g = n[0] === "'", c = !hn(i, r), !c && !l) {
|
1468
1468
|
g && (t.content = ze(t.content, n.index, un));
|
1469
1469
|
continue;
|
1470
1470
|
}
|
1471
|
-
if (u = !c,
|
1472
|
-
for (
|
1473
|
-
d = w[
|
1471
|
+
if (u = !c, p = !l, p) {
|
1472
|
+
for (h = w.length - 1; h >= 0 && (d = w[h], !(w[h].level < a)); h--) if (d.single === g && w[h].level === a) {
|
1473
|
+
d = w[h], g ? (S[d.token].content = ze(S[d.token].content, d.pos, s.options.quotes[2]), t.content = ze(t.content, n.index, s.options.quotes[3])) : (S[d.token].content = ze(S[d.token].content, d.pos, s.options.quotes[0]), t.content = ze(t.content, n.index, s.options.quotes[1])), w.length = h;
|
1474
1474
|
continue e;
|
1475
1475
|
}
|
1476
1476
|
}
|
@@ -1479,7 +1479,7 @@ function Zs(s) {
|
|
1479
1479
|
pos: n.index,
|
1480
1480
|
single: g,
|
1481
1481
|
level: a
|
1482
|
-
}) :
|
1482
|
+
}) : p && g && (t.content = ze(t.content, n.index, un));
|
1483
1483
|
}
|
1484
1484
|
}
|
1485
1485
|
}
|
@@ -1591,20 +1591,20 @@ function er(s, e, t, i) {
|
|
1591
1591
|
c,
|
1592
1592
|
d,
|
1593
1593
|
u,
|
1594
|
-
h,
|
1595
1594
|
p,
|
1595
|
+
h,
|
1596
1596
|
g,
|
1597
|
-
|
1597
|
+
f = s.bMarks[e] + s.tShift[e],
|
1598
1598
|
S = s.eMarks[e];
|
1599
|
-
if (
|
1599
|
+
if (f > S || s.src.charCodeAt(f++) !== 62 || s.level >= s.options.maxNesting) return !1;
|
1600
1600
|
if (i) return !0;
|
1601
|
-
for (s.src.charCodeAt(
|
1602
|
-
if (s.src.charCodeAt(
|
1603
|
-
s.src.charCodeAt(
|
1601
|
+
for (s.src.charCodeAt(f) === 32 && f++, l = s.blkIndent, s.blkIndent = 0, a = [s.bMarks[e]], s.bMarks[e] = f, f = f < S ? s.skipSpaces(f) : f, r = f >= S, o = [s.tShift[e]], s.tShift[e] = f - s.bMarks[e], u = s.parser.ruler.getRules("blockquote"), n = e + 1; n < t && (f = s.bMarks[n] + s.tShift[n], S = s.eMarks[n], !(f >= S)); n++) {
|
1602
|
+
if (s.src.charCodeAt(f++) === 62) {
|
1603
|
+
s.src.charCodeAt(f) === 32 && f++, a.push(s.bMarks[n]), s.bMarks[n] = f, f = f < S ? s.skipSpaces(f) : f, r = f >= S, o.push(s.tShift[n]), s.tShift[n] = f - s.bMarks[n];
|
1604
1604
|
continue;
|
1605
1605
|
}
|
1606
1606
|
if (r) break;
|
1607
|
-
for (g = !1,
|
1607
|
+
for (g = !1, p = 0, h = u.length; p < h; p++) if (u[p](s, n, t, !0)) {
|
1608
1608
|
g = !0;
|
1609
1609
|
break;
|
1610
1610
|
}
|
@@ -1618,7 +1618,7 @@ function er(s, e, t, i) {
|
|
1618
1618
|
}), s.parser.tokenize(s, e, n), s.tokens.push({
|
1619
1619
|
type: "blockquote_close",
|
1620
1620
|
level: --s.level
|
1621
|
-
}), s.parentType = c, d[1] = s.line,
|
1621
|
+
}), s.parentType = c, d[1] = s.line, p = 0; p < o.length; p++) s.bMarks[p + e] = a[p], s.tShift[p + e] = o[p];
|
1622
1622
|
return s.blkIndent = l, !0;
|
1623
1623
|
}
|
1624
1624
|
function tr(s, e, t, i) {
|
@@ -1671,10 +1671,10 @@ function nr(s, e, t, i) {
|
|
1671
1671
|
c,
|
1672
1672
|
d,
|
1673
1673
|
u,
|
1674
|
-
h,
|
1675
1674
|
p,
|
1675
|
+
h,
|
1676
1676
|
g,
|
1677
|
-
|
1677
|
+
f,
|
1678
1678
|
S,
|
1679
1679
|
w,
|
1680
1680
|
G,
|
@@ -1688,7 +1688,7 @@ function nr(s, e, t, i) {
|
|
1688
1688
|
xi;
|
1689
1689
|
if ((u = fn(s, e)) >= 0) S = !0;else if ((u = pn(s, e)) >= 0) S = !1;else return !1;
|
1690
1690
|
if (s.level >= s.options.maxNesting) return !1;
|
1691
|
-
if (
|
1691
|
+
if (f = s.src.charCodeAt(u - 1), i) return !0;
|
1692
1692
|
for (G = s.tokens.length, S ? (d = s.bMarks[e] + s.tShift[e], g = Number(s.src.substr(d, u - d - 1)), s.tokens.push({
|
1693
1693
|
type: "ordered_list_open",
|
1694
1694
|
order: g,
|
@@ -1698,7 +1698,7 @@ function nr(s, e, t, i) {
|
|
1698
1698
|
type: "bullet_list_open",
|
1699
1699
|
lines: V = [e, 0],
|
1700
1700
|
level: s.level++
|
1701
|
-
}), n = e, A = !1, Q = s.parser.ruler.getRules("list"); n < t && (w = s.skipSpaces(u),
|
1701
|
+
}), n = e, A = !1, Q = s.parser.ruler.getRules("list"); n < t && (w = s.skipSpaces(u), p = s.eMarks[n], w >= p ? h = 1 : h = w - u, h > 4 && (h = 1), h < 1 && (h = 1), r = u - s.bMarks[n] + h, s.tokens.push({
|
1702
1702
|
type: "list_item_open",
|
1703
1703
|
lines: X = [e, 0],
|
1704
1704
|
level: s.level++
|
@@ -1714,7 +1714,7 @@ function nr(s, e, t, i) {
|
|
1714
1714
|
if (S) {
|
1715
1715
|
if (u = fn(s, n), u < 0) break;
|
1716
1716
|
} else if (u = pn(s, n), u < 0) break;
|
1717
|
-
if (
|
1717
|
+
if (f !== s.src.charCodeAt(u - 1)) break;
|
1718
1718
|
}
|
1719
1719
|
return s.tokens.push({
|
1720
1720
|
type: S ? "ordered_list_close" : "bullet_list_close",
|
@@ -1831,21 +1831,21 @@ function _i(s, e) {
|
|
1831
1831
|
return s.src.substr(t, i - t);
|
1832
1832
|
}
|
1833
1833
|
function ur(s, e, t, i) {
|
1834
|
-
var n, r, o, a, l, c, d, u,
|
1834
|
+
var n, r, o, a, l, c, d, u, p, h, g;
|
1835
1835
|
if (e + 2 > t || (l = e + 1, s.tShift[l] < s.blkIndent) || (o = s.bMarks[l] + s.tShift[l], o >= s.eMarks[l]) || (n = s.src.charCodeAt(o), n !== 124 && n !== 45 && n !== 58) || (r = _i(s, e + 1), !/^[-:| ]+$/.test(r)) || (c = r.split("|"), c <= 2)) return !1;
|
1836
1836
|
for (u = [], a = 0; a < c.length; a++) {
|
1837
|
-
if (
|
1837
|
+
if (p = c[a].trim(), !p) {
|
1838
1838
|
if (a === 0 || a === c.length - 1) continue;
|
1839
1839
|
return !1;
|
1840
1840
|
}
|
1841
|
-
if (!/^:?-+:?$/.test(
|
1842
|
-
|
1841
|
+
if (!/^:?-+:?$/.test(p)) return !1;
|
1842
|
+
p.charCodeAt(p.length - 1) === 58 ? u.push(p.charCodeAt(0) === 58 ? "center" : "right") : p.charCodeAt(0) === 58 ? u.push("left") : u.push("");
|
1843
1843
|
}
|
1844
1844
|
if (r = _i(s, e).trim(), r.indexOf("|") === -1 || (c = r.replace(/^\||\|$/g, "").split("|"), u.length !== c.length)) return !1;
|
1845
1845
|
if (i) return !0;
|
1846
1846
|
for (s.tokens.push({
|
1847
1847
|
type: "table_open",
|
1848
|
-
lines:
|
1848
|
+
lines: h = [e, 0],
|
1849
1849
|
level: s.level++
|
1850
1850
|
}), s.tokens.push({
|
1851
1851
|
type: "thead_open",
|
@@ -1908,7 +1908,7 @@ function ur(s, e, t, i) {
|
|
1908
1908
|
}), s.tokens.push({
|
1909
1909
|
type: "table_close",
|
1910
1910
|
level: --s.level
|
1911
|
-
}),
|
1911
|
+
}), h[1] = g[1] = l, s.line = l, !0;
|
1912
1912
|
}
|
1913
1913
|
function It(s, e) {
|
1914
1914
|
var t,
|
@@ -1924,7 +1924,7 @@ function hr(s, e) {
|
|
1924
1924
|
for (t = e + 2, i = s.tokens.length - 2; t < i; t++) s.tokens[t].level === n && s.tokens[t].type === "paragraph_open" && (s.tokens[t + 2].tight = !0, s.tokens[t].tight = !0, t += 2);
|
1925
1925
|
}
|
1926
1926
|
function pr(s, e, t, i) {
|
1927
|
-
var n, r, o, a, l, c, d, u,
|
1927
|
+
var n, r, o, a, l, c, d, u, p, h, g, f, S, w;
|
1928
1928
|
if (i) return s.ddIndent < 0 ? !1 : It(s, e) >= 0;
|
1929
1929
|
if (d = e + 1, s.isEmpty(d) && ++d > t || s.tShift[d] < s.blkIndent || (n = It(s, d), n < 0) || s.level >= s.options.maxNesting) return !1;
|
1930
1930
|
c = s.tokens.length, s.tokens.push({
|
@@ -1951,7 +1951,7 @@ function pr(s, e, t, i) {
|
|
1951
1951
|
type: "dd_open",
|
1952
1952
|
lines: a = [d, 0],
|
1953
1953
|
level: s.level++
|
1954
|
-
}),
|
1954
|
+
}), f = s.tight, p = s.ddIndent, u = s.blkIndent, g = s.tShift[r], h = s.parentType, s.blkIndent = s.ddIndent = s.tShift[r] + 2, s.tShift[r] = n - s.bMarks[r], s.tight = !0, s.parentType = "deflist", s.parser.tokenize(s, r, t, !0), (!s.tight || S) && (w = !1), S = s.line - r > 1 && s.isEmpty(s.line - 1), s.tShift[r] = g, s.tight = f, s.parentType = h, s.blkIndent = u, s.ddIndent = p, s.tokens.push({
|
1955
1955
|
type: "dd_close",
|
1956
1956
|
level: --s.level
|
1957
1957
|
}), a[1] = d = s.line, d >= t || s.tShift[d] < s.blkIndent) break e;
|
@@ -2328,21 +2328,21 @@ function Lr(s, e) {
|
|
2328
2328
|
c,
|
2329
2329
|
d = !1,
|
2330
2330
|
u = s.pos,
|
2331
|
-
|
2332
|
-
|
2333
|
-
g = s.src.charCodeAt(
|
2334
|
-
if (g === 33 && (d = !0, g = s.src.charCodeAt(++
|
2335
|
-
if (a = i + 1, a <
|
2336
|
-
for (a++; a <
|
2337
|
-
if (a >=
|
2338
|
-
for (
|
2339
|
-
if (a <
|
2340
|
-
if (a >=
|
2331
|
+
p = s.posMax,
|
2332
|
+
h = s.pos,
|
2333
|
+
g = s.src.charCodeAt(h);
|
2334
|
+
if (g === 33 && (d = !0, g = s.src.charCodeAt(++h)), g !== 91 || s.level >= s.options.maxNesting || (t = h + 1, i = mt(s, h), i < 0)) return !1;
|
2335
|
+
if (a = i + 1, a < p && s.src.charCodeAt(a) === 40) {
|
2336
|
+
for (a++; a < p && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2337
|
+
if (a >= p) return !1;
|
2338
|
+
for (h = a, Yn(s, a) ? (r = s.linkContent, a = s.pos) : r = "", h = a; a < p && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2339
|
+
if (a < p && h !== a && Zn(s, a)) for (o = s.linkContent, a = s.pos; a < p && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);else o = "";
|
2340
|
+
if (a >= p || s.src.charCodeAt(a) !== 41) return s.pos = u, !1;
|
2341
2341
|
a++;
|
2342
2342
|
} else {
|
2343
2343
|
if (s.linkLevel > 0) return !1;
|
2344
|
-
for (; a <
|
2345
|
-
if (a <
|
2344
|
+
for (; a < p && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2345
|
+
if (a < p && s.src.charCodeAt(a) === 91 && (h = a + 1, a = mt(s, a), a >= 0 ? n = s.src.slice(h, a++) : a = h - 1), n || (_typeof(n) > "u" && (a = i + 1), n = s.src.slice(t, i)), l = s.env.references[Xn(n)], !l) return s.pos = u, !1;
|
2346
2346
|
r = l.href, o = l.title;
|
2347
2347
|
}
|
2348
2348
|
return e || (s.pos = t, s.posMax = i, d ? s.push({
|
@@ -2359,7 +2359,7 @@ function Lr(s, e) {
|
|
2359
2359
|
}), s.linkLevel++, s.parser.tokenize(s), s.linkLevel--, s.push({
|
2360
2360
|
type: "link_close",
|
2361
2361
|
level: --s.level
|
2362
|
-
}))), s.pos = a, s.posMax =
|
2362
|
+
}))), s.pos = a, s.posMax = p, !0;
|
2363
2363
|
}
|
2364
2364
|
function Rr(s, e) {
|
2365
2365
|
var t,
|
@@ -3411,18 +3411,18 @@ function go(s, e) {
|
|
3411
3411
|
l = e.openWhenHidden,
|
3412
3412
|
c = e.fetch,
|
3413
3413
|
d = fo(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
3414
|
-
return new Promise(function (u,
|
3415
|
-
var
|
3416
|
-
|
3414
|
+
return new Promise(function (u, p) {
|
3415
|
+
var h = Object.assign({}, i);
|
3416
|
+
h.accept || (h.accept = Di);
|
3417
3417
|
var g;
|
3418
|
-
function
|
3418
|
+
function f() {
|
3419
3419
|
g.abort(), document.hidden || X();
|
3420
3420
|
}
|
3421
|
-
l || document.addEventListener("visibilitychange",
|
3421
|
+
l || document.addEventListener("visibilitychange", f);
|
3422
3422
|
var S = mo,
|
3423
3423
|
w = 0;
|
3424
3424
|
function G() {
|
3425
|
-
document.removeEventListener("visibilitychange",
|
3425
|
+
document.removeEventListener("visibilitychange", f), window.clearTimeout(w), g.abort();
|
3426
3426
|
}
|
3427
3427
|
t == null || t.addEventListener("abort", function () {
|
3428
3428
|
G(), u();
|
@@ -3442,7 +3442,7 @@ function go(s, e) {
|
|
3442
3442
|
_context3.prev = 1;
|
3443
3443
|
_context3.next = 4;
|
3444
3444
|
return A(s, Object.assign(Object.assign({}, d), {
|
3445
|
-
headers:
|
3445
|
+
headers: h,
|
3446
3446
|
signal: g.signal
|
3447
3447
|
}));
|
3448
3448
|
case 4:
|
@@ -3452,7 +3452,7 @@ function go(s, e) {
|
|
3452
3452
|
case 7:
|
3453
3453
|
_context3.next = 9;
|
3454
3454
|
return co(Q.body, uo(ho(function (N) {
|
3455
|
-
N ?
|
3455
|
+
N ? h[yn] = N : delete h[yn];
|
3456
3456
|
}, function (N) {
|
3457
3457
|
S = N;
|
3458
3458
|
}, r)));
|
@@ -3469,7 +3469,7 @@ function go(s, e) {
|
|
3469
3469
|
N = (oe = a == null ? void 0 : a(_context3.t0)) !== null && oe !== void 0 ? oe : S;
|
3470
3470
|
window.clearTimeout(w), w = window.setTimeout(X, N);
|
3471
3471
|
} catch (N) {
|
3472
|
-
G(),
|
3472
|
+
G(), p(N);
|
3473
3473
|
}
|
3474
3474
|
case 17:
|
3475
3475
|
case "end":
|
@@ -3570,9 +3570,9 @@ var I = /*#__PURE__*/function () {
|
|
3570
3570
|
function () {
|
3571
3571
|
var _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(e, t, i) {
|
3572
3572
|
var n,
|
3573
|
-
|
3573
|
+
h,
|
3574
3574
|
g,
|
3575
|
-
|
3575
|
+
f,
|
3576
3576
|
S,
|
3577
3577
|
w,
|
3578
3578
|
G,
|
@@ -3585,7 +3585,7 @@ var I = /*#__PURE__*/function () {
|
|
3585
3585
|
c,
|
3586
3586
|
d,
|
3587
3587
|
u,
|
3588
|
-
|
3588
|
+
p,
|
3589
3589
|
_args7 = arguments;
|
3590
3590
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
3591
3591
|
while (1) switch (_context7.prev = _context7.next) {
|
@@ -3593,7 +3593,7 @@ var I = /*#__PURE__*/function () {
|
|
3593
3593
|
n = _args7.length > 3 && _args7[3] !== undefined ? _args7[3] : !0;
|
3594
3594
|
r = {
|
3595
3595
|
body: t,
|
3596
|
-
headers: (
|
3596
|
+
headers: (h = e.requestSettings) == null ? void 0 : h.headers
|
3597
3597
|
};
|
3598
3598
|
_context7.next = 4;
|
3599
3599
|
return E.processRequestInterceptor(e.deepChat, r);
|
@@ -3618,13 +3618,13 @@ var I = /*#__PURE__*/function () {
|
|
3618
3618
|
}
|
3619
3619
|
return _context7.abrupt("return", Ae.stream(e, o, i));
|
3620
3620
|
case 16:
|
3621
|
-
if (!(((
|
3621
|
+
if (!(((f = e.requestSettings) == null ? void 0 : f.url) === ve.URL)) {
|
3622
3622
|
_context7.next = 18;
|
3623
3623
|
break;
|
3624
3624
|
}
|
3625
3625
|
return _context7.abrupt("return", ve.requestStream(i, e.streamHandlers));
|
3626
3626
|
case 18:
|
3627
|
-
|
3627
|
+
p = new Ze(i);
|
3628
3628
|
go(((S = e.requestSettings) == null ? void 0 : S.url) || e.url || "", {
|
3629
3629
|
method: ((w = e.requestSettings) == null ? void 0 : w.method) || "POST",
|
3630
3630
|
headers: a,
|
@@ -3677,7 +3677,7 @@ var I = /*#__PURE__*/function () {
|
|
3677
3677
|
case 7:
|
3678
3678
|
N = _context6.t0;
|
3679
3679
|
(oe = e.extractResultData) == null || oe.call(e, N).then(function (Be) {
|
3680
|
-
|
3680
|
+
p.upsertStreamedMessage(Be);
|
3681
3681
|
})["catch"](function (Be) {
|
3682
3682
|
return E.displayError(i, Be);
|
3683
3683
|
});
|
@@ -3692,7 +3692,7 @@ var I = /*#__PURE__*/function () {
|
|
3692
3692
|
throw d(), A;
|
3693
3693
|
},
|
3694
3694
|
onclose: function onclose() {
|
3695
|
-
|
3695
|
+
p.finaliseStreamedMessage(), d();
|
3696
3696
|
},
|
3697
3697
|
signal: u.signal
|
3698
3698
|
})["catch"](function (A) {
|
@@ -3772,7 +3772,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3772
3772
|
n = !0;
|
3773
3773
|
r = /*#__PURE__*/function () {
|
3774
3774
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(c) {
|
3775
|
-
var u,
|
3775
|
+
var u, p, d;
|
3776
3776
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
3777
3777
|
while (1) switch (_context8.prev = _context8.next) {
|
3778
3778
|
case 0:
|
@@ -3784,7 +3784,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3784
3784
|
case 2:
|
3785
3785
|
n = !1;
|
3786
3786
|
_context8.next = 5;
|
3787
|
-
return (
|
3787
|
+
return (p = (u = e.deepChat).responseInterceptor) == null ? void 0 : p.call(u, c);
|
3788
3788
|
case 5:
|
3789
3789
|
_context8.t0 = _context8.sent;
|
3790
3790
|
if (_context8.t0) {
|
@@ -3822,7 +3822,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3822
3822
|
}, {
|
3823
3823
|
key: "stream",
|
3824
3824
|
value: function stream(e, t, i) {
|
3825
|
-
var u,
|
3825
|
+
var u, p;
|
3826
3826
|
var n = !0,
|
3827
3827
|
r = !1;
|
3828
3828
|
var o = new Ze(i),
|
@@ -3832,14 +3832,14 @@ var Ae = /*#__PURE__*/function () {
|
|
3832
3832
|
l = function l() {
|
3833
3833
|
n && (o.finaliseStreamedMessage(), e.streamHandlers.onClose(), n = !1);
|
3834
3834
|
},
|
3835
|
-
c = function c(
|
3836
|
-
n && (!
|
3835
|
+
c = function c(h) {
|
3836
|
+
n && (!h || _typeof(h) != "object" || typeof h.error != "string" && typeof h.html != "string" && typeof h.text != "string" ? console.error(C.INVALID_RESPONSE(h, "server", !1)) : h.error ? (console.error(h.error), o.finaliseStreamedMessage(), e.streamHandlers.onClose(), i.addNewErrorMessage("service", h.error), n = !1) : o.upsertStreamedMessage(h));
|
3837
3837
|
};
|
3838
3838
|
e.streamHandlers.abortStream.abort = function () {
|
3839
3839
|
o.finaliseStreamedMessage(), e.streamHandlers.onClose(), n = !1;
|
3840
3840
|
};
|
3841
3841
|
var d = Ae.generateOptionalSignals();
|
3842
|
-
(
|
3842
|
+
(p = (u = e.requestSettings).handler) == null || p.call(u, t, _objectSpread(_objectSpread({}, d), {}, {
|
3843
3843
|
onOpen: a,
|
3844
3844
|
onResponse: c,
|
3845
3845
|
onClose: l,
|
@@ -3866,7 +3866,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3866
3866
|
},
|
3867
3867
|
o = /*#__PURE__*/function () {
|
3868
3868
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(d) {
|
3869
|
-
var
|
3869
|
+
var p, h, u;
|
3870
3870
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
3871
3871
|
while (1) switch (_context10.prev = _context10.next) {
|
3872
3872
|
case 0:
|
@@ -3877,7 +3877,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3877
3877
|
return _context10.abrupt("return");
|
3878
3878
|
case 2:
|
3879
3879
|
_context10.next = 4;
|
3880
|
-
return (
|
3880
|
+
return (h = (p = e.deepChat).responseInterceptor) == null ? void 0 : h.call(p, d);
|
3881
3881
|
case 4:
|
3882
3882
|
_context10.t0 = _context10.sent;
|
3883
3883
|
if (_context10.t0) {
|
@@ -3933,8 +3933,8 @@ var _ = /*#__PURE__*/function () {
|
|
3933
3933
|
function () {
|
3934
3934
|
var _request3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(e, t, i) {
|
3935
3935
|
var n,
|
3936
|
-
h,
|
3937
3936
|
p,
|
3937
|
+
h,
|
3938
3938
|
g,
|
3939
3939
|
r,
|
3940
3940
|
_yield$E$processReque2,
|
@@ -3951,7 +3951,7 @@ var _ = /*#__PURE__*/function () {
|
|
3951
3951
|
n = _args12.length > 3 && _args12[3] !== undefined ? _args12[3] : !0;
|
3952
3952
|
r = {
|
3953
3953
|
body: t,
|
3954
|
-
headers: (
|
3954
|
+
headers: (p = e.requestSettings) == null ? void 0 : p.headers
|
3955
3955
|
};
|
3956
3956
|
_context12.next = 4;
|
3957
3957
|
return E.processRequestInterceptor(e.deepChat, r);
|
@@ -3967,7 +3967,7 @@ var _ = /*#__PURE__*/function () {
|
|
3967
3967
|
}
|
3968
3968
|
return _context12.abrupt("return", E.onInterceptorError(i, l, c));
|
3969
3969
|
case 11:
|
3970
|
-
if (!((
|
3970
|
+
if (!((h = e.requestSettings) != null && h.handler)) {
|
3971
3971
|
_context12.next = 13;
|
3972
3972
|
break;
|
3973
3973
|
}
|
@@ -3981,12 +3981,12 @@ var _ = /*#__PURE__*/function () {
|
|
3981
3981
|
case 15:
|
3982
3982
|
d = !0;
|
3983
3983
|
u = E.fetch.bind(this, e, a, n);
|
3984
|
-
u(o).then(function (
|
3985
|
-
return d = !!
|
3986
|
-
}).then(function (
|
3987
|
-
return E.processResponseByType(
|
3984
|
+
u(o).then(function (f) {
|
3985
|
+
return d = !!f.ok, f;
|
3986
|
+
}).then(function (f) {
|
3987
|
+
return E.processResponseByType(f);
|
3988
3988
|
}).then( /*#__PURE__*/function () {
|
3989
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(
|
3989
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(f) {
|
3990
3990
|
var G, A, S, w;
|
3991
3991
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
3992
3992
|
while (1) switch (_context11.prev = _context11.next) {
|
@@ -3998,14 +3998,14 @@ var _ = /*#__PURE__*/function () {
|
|
3998
3998
|
return _context11.abrupt("return");
|
3999
3999
|
case 2:
|
4000
4000
|
_context11.next = 4;
|
4001
|
-
return (A = (G = e.deepChat).responseInterceptor) == null ? void 0 : A.call(G,
|
4001
|
+
return (A = (G = e.deepChat).responseInterceptor) == null ? void 0 : A.call(G, f);
|
4002
4002
|
case 4:
|
4003
4003
|
_context11.t0 = _context11.sent;
|
4004
4004
|
if (_context11.t0) {
|
4005
4005
|
_context11.next = 7;
|
4006
4006
|
break;
|
4007
4007
|
}
|
4008
|
-
_context11.t0 =
|
4008
|
+
_context11.t0 = f;
|
4009
4009
|
case 7:
|
4010
4010
|
S = _context11.t0;
|
4011
4011
|
_context11.next = 10;
|
@@ -4016,13 +4016,13 @@ var _ = /*#__PURE__*/function () {
|
|
4016
4016
|
_context11.next = 13;
|
4017
4017
|
break;
|
4018
4018
|
}
|
4019
|
-
throw
|
4019
|
+
throw f;
|
4020
4020
|
case 13:
|
4021
4021
|
if (!(!w || _typeof(w) != "object")) {
|
4022
4022
|
_context11.next = 15;
|
4023
4023
|
break;
|
4024
4024
|
}
|
4025
|
-
throw Error(C.INVALID_RESPONSE(
|
4025
|
+
throw Error(C.INVALID_RESPONSE(f, "response", !!e.deepChat.responseInterceptor, S));
|
4026
4026
|
case 15:
|
4027
4027
|
w.makingAnotherRequest || (I.isSimulation(e.deepChat.stream) ? I.simulate(i, e.streamHandlers, w) : (i.addNewMessage(w), c()));
|
4028
4028
|
case 16:
|
@@ -4034,8 +4034,8 @@ var _ = /*#__PURE__*/function () {
|
|
4034
4034
|
return function (_x23) {
|
4035
4035
|
return _ref4.apply(this, arguments);
|
4036
4036
|
};
|
4037
|
-
}())["catch"](function (
|
4038
|
-
E.displayError(i,
|
4037
|
+
}())["catch"](function (f) {
|
4038
|
+
E.displayError(i, f), c();
|
4039
4039
|
});
|
4040
4040
|
case 18:
|
4041
4041
|
case "end":
|
@@ -4104,9 +4104,9 @@ var _ = /*#__PURE__*/function () {
|
|
4104
4104
|
value: function () {
|
4105
4105
|
var _poll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(e, t, i) {
|
4106
4106
|
var n,
|
4107
|
-
|
4107
|
+
h,
|
4108
4108
|
g,
|
4109
|
-
|
4109
|
+
f,
|
4110
4110
|
r,
|
4111
4111
|
_yield$E$processReque3,
|
4112
4112
|
o,
|
@@ -4115,7 +4115,7 @@ var _ = /*#__PURE__*/function () {
|
|
4115
4115
|
c,
|
4116
4116
|
d,
|
4117
4117
|
u,
|
4118
|
-
|
4118
|
+
p,
|
4119
4119
|
_args14 = arguments;
|
4120
4120
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
4121
4121
|
while (1) switch (_context14.prev = _context14.next) {
|
@@ -4123,7 +4123,7 @@ var _ = /*#__PURE__*/function () {
|
|
4123
4123
|
n = _args14.length > 3 && _args14[3] !== undefined ? _args14[3] : !0;
|
4124
4124
|
r = {
|
4125
4125
|
body: t,
|
4126
|
-
headers: (
|
4126
|
+
headers: (h = e.requestSettings) == null ? void 0 : h.headers
|
4127
4127
|
};
|
4128
4128
|
_context14.next = 4;
|
4129
4129
|
return E.processRequestInterceptor(e.deepChat, r);
|
@@ -4138,12 +4138,12 @@ var _ = /*#__PURE__*/function () {
|
|
4138
4138
|
}
|
4139
4139
|
return _context14.abrupt("return", E.onInterceptorError(i, l));
|
4140
4140
|
case 10:
|
4141
|
-
c = ((g = e.requestSettings) == null ? void 0 : g.url) || e.url || "", d = ((
|
4141
|
+
c = ((g = e.requestSettings) == null ? void 0 : g.url) || e.url || "", d = ((f = e.requestSettings) == null ? void 0 : f.method) || "POST", u = n ? JSON.stringify(o) : o, p = {
|
4142
4142
|
method: d,
|
4143
4143
|
body: u,
|
4144
4144
|
headers: a
|
4145
4145
|
};
|
4146
|
-
e.requestSettings.credentials && (
|
4146
|
+
e.requestSettings.credentials && (p.credentials = e.requestSettings.credentials), _.executePollRequest(e, c, p, i);
|
4147
4147
|
case 12:
|
4148
4148
|
case "end":
|
4149
4149
|
return _context14.stop();
|
@@ -4426,12 +4426,12 @@ var L = /*#__PURE__*/function () {
|
|
4426
4426
|
}, {
|
4427
4427
|
key: "processMicrophone",
|
4428
4428
|
value: function processMicrophone(e, t, i, n) {
|
4429
|
-
var _l$files,
|
4430
|
-
var a, l, c, d, u,
|
4429
|
+
var _l$files, _p$maxNumberOfFiles;
|
4430
|
+
var a, l, c, d, u, p;
|
4431
4431
|
var o = _objectSpread({
|
4432
4432
|
acceptedFormats: "audio/*"
|
4433
4433
|
}, ((a = e.fileTypes.audio) == null ? void 0 : a.files) || {});
|
4434
|
-
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = L.parseConfig(e.requestSettings, o, t, i), _typeof(i) == "object" && i.files && ((_l$files = (l = e.recordAudio).files) !== null && _l$files !== void 0 ? _l$files : l.files = {}, e.recordAudio.files.format = (c = i.files) == null ? void 0 : c.format, e.recordAudio.files.maxDurationSeconds = (d = i.files) == null ? void 0 : d.maxDurationSeconds, (u = e.fileTypes.audio) != null && u.files && ((
|
4434
|
+
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = L.parseConfig(e.requestSettings, o, t, i), _typeof(i) == "object" && i.files && ((_l$files = (l = e.recordAudio).files) !== null && _l$files !== void 0 ? _l$files : l.files = {}, e.recordAudio.files.format = (c = i.files) == null ? void 0 : c.format, e.recordAudio.files.maxDurationSeconds = (d = i.files) == null ? void 0 : d.maxDurationSeconds, (u = e.fileTypes.audio) != null && u.files && ((_p$maxNumberOfFiles = (p = e.fileTypes.audio.files).maxNumberOfFiles) !== null && _p$maxNumberOfFiles !== void 0 ? _p$maxNumberOfFiles : p.maxNumberOfFiles = i.files.maxNumberOfFiles))) : n || (e.fileTypes.audio = L.parseConfig(e.requestSettings, o, t, i)));
|
4435
4435
|
}
|
4436
4436
|
// prettier-ignore
|
4437
4437
|
}, {
|
@@ -5303,32 +5303,32 @@ var En = {
|
|
5303
5303
|
value: function () {
|
5304
5304
|
var _loadModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(e, t) {
|
5305
5305
|
var _this12 = this;
|
5306
|
-
var o, a, l, c, d, i, n, r, _this$getConfig,
|
5306
|
+
var o, a, l, c, d, u, p, i, n, r, _this$getConfig, h, g, f, _h;
|
5307
5307
|
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
5308
5308
|
while (1) switch (_context25.prev = _context25.next) {
|
5309
5309
|
case 0:
|
5310
5310
|
this.scrollToTop(), M.chat = e, this._isModelLoading = !0;
|
5311
5311
|
i = ((o = this._webModel.introMessage) == null ? void 0 : o.displayed) === !1;
|
5312
|
-
n = function n(
|
5313
|
-
var
|
5314
|
-
(
|
5315
|
-
html: "<div>".concat(
|
5312
|
+
n = function n(h) {
|
5313
|
+
var g;
|
5314
|
+
(g = _this12._messages) == null || g.addNewMessage({
|
5315
|
+
html: "<div>".concat(h.text, "</div>"),
|
5316
5316
|
overwrite: !0,
|
5317
5317
|
sendUpdate: !1
|
5318
5318
|
}), i && (setTimeout(function () {
|
5319
|
-
var
|
5320
|
-
return Y.scrollToBottom((
|
5319
|
+
var f;
|
5320
|
+
return Y.scrollToBottom((f = _this12._messages) == null ? void 0 : f.elementRef);
|
5321
5321
|
}), i = !1);
|
5322
5322
|
};
|
5323
5323
|
M.chat.setInitProgressCallback(n);
|
5324
5324
|
_context25.prev = 4;
|
5325
|
-
_this$getConfig = this.getConfig(),
|
5326
|
-
this._webModel.instruction && (
|
5325
|
+
_this$getConfig = this.getConfig(), h = _this$getConfig.model, g = _this$getConfig.appConfig, f = {};
|
5326
|
+
this._webModel.instruction && (f.conv_config = {
|
5327
5327
|
system: this._webModel.instruction
|
5328
5328
|
});
|
5329
|
-
this._conversationHistory.length > 0 && (
|
5329
|
+
this._conversationHistory.length > 0 && (f.conversation_history = this._conversationHistory);
|
5330
5330
|
_context25.next = 10;
|
5331
|
-
return M.chat.reload(
|
5331
|
+
return M.chat.reload(h, f, g, t);
|
5332
5332
|
case 10:
|
5333
5333
|
r = _context25.sent;
|
5334
5334
|
_context25.next = 16;
|
@@ -5338,10 +5338,10 @@ var En = {
|
|
5338
5338
|
_context25.t0 = _context25["catch"](4);
|
5339
5339
|
return _context25.abrupt("return", this.unloadChat(_context25.t0));
|
5340
5340
|
case 16:
|
5341
|
-
if ((a = this._webModel.introMessage) != null &&
|
5342
|
-
|
5343
|
-
(
|
5344
|
-
html:
|
5341
|
+
if ((l = (a = this.deepChat)._validationHandler) == null || l.call(a), (c = this._webModel.introMessage) != null && c.removeAfterLoad) this._webModel.introMessage.displayed === !1 ? (u = this._messages) == null || u.removeLastMessage() : (p = this._removeIntro) == null || p.call(this);else {
|
5342
|
+
_h = xn.setUpAfterLoad(r, this._webModel.introMessage, this._chatEl, !!this._webModel.worker);
|
5343
|
+
(d = this._messages) == null || d.addNewMessage({
|
5344
|
+
html: _h,
|
5345
5345
|
overwrite: !0,
|
5346
5346
|
sendUpdate: !1
|
5347
5347
|
});
|
@@ -8196,7 +8196,7 @@ var Qi = /*#__PURE__*/function (_U10) {
|
|
8196
8196
|
key: "extractPollResultData",
|
8197
8197
|
value: function () {
|
8198
8198
|
var _extractPollResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79(e) {
|
8199
|
-
var r, t, i, n;
|
8199
|
+
var r, o, t, i, c, n;
|
8200
8200
|
return _regeneratorRuntime().wrap(function _callee79$(_context79) {
|
8201
8201
|
while (1) switch (_context79.prev = _context79.next) {
|
8202
8202
|
case 0:
|
@@ -8210,32 +8210,33 @@ var Qi = /*#__PURE__*/function (_U10) {
|
|
8210
8210
|
});
|
8211
8211
|
case 3:
|
8212
8212
|
if (!(t === "completed" && this.messages)) {
|
8213
|
-
_context79.next =
|
8213
|
+
_context79.next = 9;
|
8214
8214
|
break;
|
8215
8215
|
}
|
8216
8216
|
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(e.thread_id, "/messages");
|
8217
8217
|
_context79.next = 7;
|
8218
8218
|
return O.directFetch(this, {}, "GET");
|
8219
8219
|
case 7:
|
8220
|
-
|
8221
|
-
|
8220
|
+
c = _context79.sent.data[0].content.find(function (d) {
|
8221
|
+
return !!d.text;
|
8222
|
+
});
|
8222
8223
|
return _context79.abrupt("return", {
|
8223
|
-
text:
|
8224
|
-
_sessionId:
|
8224
|
+
text: ((r = c == null ? void 0 : c.text) == null ? void 0 : r.value) || "",
|
8225
|
+
_sessionId: this.sessionId
|
8225
8226
|
});
|
8226
|
-
case
|
8227
|
-
n = (
|
8227
|
+
case 9:
|
8228
|
+
n = (o = i == null ? void 0 : i.submit_tool_outputs) == null ? void 0 : o.tool_calls;
|
8228
8229
|
if (!(t === "requires_action" && n)) {
|
8229
|
-
_context79.next =
|
8230
|
+
_context79.next = 14;
|
8230
8231
|
break;
|
8231
8232
|
}
|
8232
|
-
_context79.next =
|
8233
|
+
_context79.next = 13;
|
8233
8234
|
return this.handleTools(n);
|
8234
|
-
case
|
8235
|
+
case 13:
|
8235
8236
|
return _context79.abrupt("return", _context79.sent);
|
8236
|
-
case
|
8237
|
+
case 14:
|
8237
8238
|
throw Error("Thread run status: ".concat(t));
|
8238
|
-
case
|
8239
|
+
case 15:
|
8239
8240
|
case "end":
|
8240
8241
|
return _context79.stop();
|
8241
8242
|
}
|
@@ -8607,8 +8608,8 @@ var dt = /*#__PURE__*/function (_U12) {
|
|
8607
8608
|
break;
|
8608
8609
|
}
|
8609
8610
|
o.forEach(function (c, d) {
|
8610
|
-
var
|
8611
|
-
var u = (
|
8611
|
+
var p;
|
8612
|
+
var u = (p = e.tool_calls) == null ? void 0 : p[d];
|
8612
8613
|
n == null || n.messages.push({
|
8613
8614
|
role: "tool",
|
8614
8615
|
tool_call_id: u == null ? void 0 : u.id,
|
@@ -9106,7 +9107,7 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9106
9107
|
}, {
|
9107
9108
|
key: "addNewErrorMessage",
|
9108
9109
|
value: function addNewErrorMessage(e, t) {
|
9109
|
-
var l, c, d, u,
|
9110
|
+
var l, c, d, u, p;
|
9110
9111
|
this.removeMessageOnError();
|
9111
9112
|
var i = me.createBaseElements(),
|
9112
9113
|
n = i.outerContainer,
|
@@ -9115,7 +9116,7 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9115
9116
|
var o = this.getPermittedMessage(t) || ((l = this._errorMessageOverrides) == null ? void 0 : l[e]) || ((c = this._errorMessageOverrides) == null ? void 0 : c["default"]) || "Error, please try again.";
|
9116
9117
|
this.renderText(r, o);
|
9117
9118
|
var a = D.extractParticularSharedStyles(["fontSize", "fontFamily"], (d = this.messageStyles) == null ? void 0 : d["default"]);
|
9118
|
-
D.applyCustomStylesToElements(i, !1, a), D.applyCustomStylesToElements(i, !1, (u = this.messageStyles) == null ? void 0 : u.error), this.elementRef.appendChild(n), Y.scrollToBottom(this.elementRef), this.textToSpeech && Nt.speak(o, this.textToSpeech), (
|
9119
|
+
D.applyCustomStylesToElements(i, !1, a), D.applyCustomStylesToElements(i, !1, (u = this.messageStyles) == null ? void 0 : u.error), this.elementRef.appendChild(n), Y.scrollToBottom(this.elementRef), this.textToSpeech && Nt.speak(o, this.textToSpeech), (p = this._onError) == null || p.call(this, o);
|
9119
9120
|
}
|
9120
9121
|
}, {
|
9121
9122
|
key: "getPermittedMessage",
|
@@ -10230,10 +10231,10 @@ var ut = /*#__PURE__*/function (_wt2) {
|
|
10230
10231
|
function ut(e, t, i, n, r, o) {
|
10231
10232
|
var _this49;
|
10232
10233
|
_classCallCheck(this, ut);
|
10233
|
-
var l, c, d, u,
|
10234
|
+
var l, c, d, u, p, h;
|
10234
10235
|
_this49 = _super39.call(this, ut.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o);
|
10235
10236
|
var a = _this49.createInnerElements(n, r, _this49._customStyles);
|
10236
|
-
_this49._inputElement = ut.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this49.addClickEvent(e, i), _this49.elementRef.replaceChildren(a.styles), _this49.reapplyStateStyle("styles"), _this49._fileAttachmentsType = t, _this49._openModalOnce = ((u = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : u.openModalOnce) === !1 || (
|
10237
|
+
_this49._inputElement = ut.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this49.addClickEvent(e, i), _this49.elementRef.replaceChildren(a.styles), _this49.reapplyStateStyle("styles"), _this49._fileAttachmentsType = t, _this49._openModalOnce = ((u = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : u.openModalOnce) === !1 || (h = (p = i.files) == null ? void 0 : p.infoModal) == null ? void 0 : h.openModalOnce;
|
10237
10238
|
return _this49;
|
10238
10239
|
}
|
10239
10240
|
_createClass(ut, [{
|
@@ -10969,31 +10970,31 @@ var K = /*#__PURE__*/function () {
|
|
10969
10970
|
if (!c || !n || !i) return;
|
10970
10971
|
var d = ((o = c.settings) === null || o === void 0 ? void 0 : o.caseSensitive) === !0 ? t : t.toLowerCase(),
|
10971
10972
|
u = Cn.Text.breakupIntoWordsArr(d),
|
10972
|
-
|
10973
|
-
if (c.commandMode &&
|
10973
|
+
p = ((a = c.settings) === null || a === void 0 ? void 0 : a.substrings) === !1 ? K.checkIfMatchesWord : K.checkIfMatchesSubstring;
|
10974
|
+
if (c.commandMode && p(c.commandMode, d, u)) return e.setInterimColorToFinal(), setTimeout(function () {
|
10974
10975
|
return K.toggleCommandModeOn(e);
|
10975
10976
|
}), {
|
10976
10977
|
doNotProcessTranscription: !1
|
10977
10978
|
};
|
10978
10979
|
if (!(c.commandMode && !e.isWaitingForCommand)) {
|
10979
|
-
if (c.stop &&
|
10980
|
+
if (c.stop && p(c.stop, d, u)) return K.toggleCommandModeOff(e), setTimeout(function () {
|
10980
10981
|
return e.stop();
|
10981
10982
|
}), {
|
10982
10983
|
doNotProcessTranscription: !1
|
10983
10984
|
};
|
10984
|
-
if (c.pause &&
|
10985
|
-
var
|
10986
|
-
e.isPaused = !0, (
|
10985
|
+
if (c.pause && p(c.pause, d, u)) return K.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
|
10986
|
+
var h;
|
10987
|
+
e.isPaused = !0, (h = e.onPauseTrigger) === null || h === void 0 || h.call(e, !0);
|
10987
10988
|
}), {
|
10988
10989
|
doNotProcessTranscription: !1
|
10989
10990
|
};
|
10990
|
-
if (c.resume &&
|
10991
|
+
if (c.resume && p(c.resume, d, u)) return e.isPaused = !1, (l = e.onPauseTrigger) === null || l === void 0 || l.call(e, !1), K.toggleCommandModeOff(e), e.resetRecording(i), {
|
10991
10992
|
doNotProcessTranscription: !0
|
10992
10993
|
};
|
10993
|
-
if (c.reset &&
|
10994
|
+
if (c.reset && p(c.reset, d, u)) return r !== void 0 && K.setText(e, i, r, n), {
|
10994
10995
|
doNotProcessTranscription: !0
|
10995
10996
|
};
|
10996
|
-
if (c.removeAllText &&
|
10997
|
+
if (c.removeAllText && p(c.removeAllText, d, u)) return K.setText(e, i, "", n), {
|
10997
10998
|
doNotProcessTranscription: !0
|
10998
10999
|
};
|
10999
11000
|
}
|
@@ -12416,7 +12417,6 @@ var Xt = /*#__PURE__*/function (_wt5) {
|
|
12416
12417
|
return Xt;
|
12417
12418
|
}(wt);
|
12418
12419
|
var pt = /*#__PURE__*/function () {
|
12419
|
-
// prettier-ignore
|
12420
12420
|
function pt(e, t, i, n) {
|
12421
12421
|
_classCallCheck(this, pt);
|
12422
12422
|
this.elementRef = pt.createPanelElement(e.inputAreaStyle);
|
@@ -12470,10 +12470,10 @@ var pt = /*#__PURE__*/function () {
|
|
12470
12470
|
_Qo$a = Qo[a],
|
12471
12471
|
d = _Qo$a.id,
|
12472
12472
|
u = _Qo$a.svgString,
|
12473
|
-
|
12474
|
-
|
12473
|
+
p = _Qo$a.dropupText,
|
12474
|
+
h = new ut(n, c, l, d, u, p);
|
12475
12475
|
r[a] = {
|
12476
|
-
button:
|
12476
|
+
button: h,
|
12477
12477
|
fileType: c
|
12478
12478
|
};
|
12479
12479
|
}
|