deep-chat-dev 9.0.239 → 9.0.241
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 +1030 -964
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.js +324 -286
- package/dist/types/messages.d.ts +1 -0
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/types/response.d.ts +1 -0
- package/dist/types/response.d.ts.map +1 -1
- package/dist/utils/decorators/property.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/custom/customButton.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/custom/customButtonDropupStyle.d.ts.map +1 -1
- package/dist/views/chat/input/dropup/dropupItem.d.ts.map +1 -1
- package/dist/views/chat/messages/history/history.d.ts.map +1 -1
- package/dist/views/chat/messages/messages.d.ts.map +1 -1
- package/dist/views/chat/messages/messagesBase.d.ts +2 -2
- package/dist/views/chat/messages/messagesBase.d.ts.map +1 -1
- package/dist/views/chat/messages/utils/messageUtils.d.ts +8 -4
- package/dist/views/chat/messages/utils/messageUtils.d.ts.map +1 -1
- package/dist/views/chat/messages/utils/updateMessage.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -71,11 +71,11 @@ var Ei = /*#__PURE__*/function () {
|
|
71
71
|
}
|
72
72
|
}]);
|
73
73
|
}();
|
74
|
-
var
|
75
|
-
function
|
76
|
-
_classCallCheck(this,
|
74
|
+
var O = /*#__PURE__*/function () {
|
75
|
+
function O() {
|
76
|
+
_classCallCheck(this, O);
|
77
77
|
}
|
78
|
-
return _createClass(
|
78
|
+
return _createClass(O, null, [{
|
79
79
|
key: "unsetStyle",
|
80
80
|
value: function unsetStyle(e, t) {
|
81
81
|
var i = Object.keys(t).reduce(function (s, r) {
|
@@ -86,12 +86,12 @@ var P = /*#__PURE__*/function () {
|
|
86
86
|
}, {
|
87
87
|
key: "unsetActivityCSSMouseStates",
|
88
88
|
value: function unsetActivityCSSMouseStates(e, t) {
|
89
|
-
t.click &&
|
89
|
+
t.click && O.unsetStyle(e, t.click), t.hover && O.unsetStyle(e, t.hover);
|
90
90
|
}
|
91
91
|
}, {
|
92
92
|
key: "unsetAllCSSMouseStates",
|
93
93
|
value: function unsetAllCSSMouseStates(e, t) {
|
94
|
-
|
94
|
+
O.unsetActivityCSSMouseStates(e, t), t["default"] && O.unsetStyle(e, t["default"]);
|
95
95
|
}
|
96
96
|
}, {
|
97
97
|
key: "processStateful",
|
@@ -184,7 +184,7 @@ var ht = /*#__PURE__*/function () {
|
|
184
184
|
}, {
|
185
185
|
key: "applyDefaultStyleToComponent",
|
186
186
|
value: function applyDefaultStyleToComponent(e, t) {
|
187
|
-
t &&
|
187
|
+
t && O.applyToStyleIfNotDefined(e, t), O.applyToStyleIfNotDefined(e, ht.DEFAULT_COMPONENT_STYLE);
|
188
188
|
}
|
189
189
|
}]);
|
190
190
|
}();
|
@@ -298,7 +298,7 @@ var Qe = /*#__PURE__*/function () {
|
|
298
298
|
key: "removePlaceholderStyle",
|
299
299
|
value: function removePlaceholderStyle() {
|
300
300
|
var e, t, i, s;
|
301
|
-
!this.inputElementRef.classList.contains("text-input-disabled") && (e = this._config.placeholder) != null && e.style && (
|
301
|
+
!this.inputElementRef.classList.contains("text-input-disabled") && (e = this._config.placeholder) != null && e.style && (O.unsetStyle(this.inputElementRef, (t = this._config.placeholder) == null ? void 0 : t.style), Object.assign(this.inputElementRef.style, (s = (i = this._config) == null ? void 0 : i.styles) == null ? void 0 : s.text));
|
302
302
|
}
|
303
303
|
}, {
|
304
304
|
key: "addEventListeners",
|
@@ -313,7 +313,7 @@ var Qe = /*#__PURE__*/function () {
|
|
313
313
|
}, {
|
314
314
|
key: "onBlur",
|
315
315
|
value: function onBlur(e, t) {
|
316
|
-
|
316
|
+
O.unsetStyle(this.elementRef, e), t && Object.assign(this.elementRef.style, t);
|
317
317
|
}
|
318
318
|
}, {
|
319
319
|
key: "onKeydown",
|
@@ -543,7 +543,7 @@ var ut = /*#__PURE__*/function () {
|
|
543
543
|
}]);
|
544
544
|
}();
|
545
545
|
ut.BUBBLE_CLASS = "deep-chat-loading-message-bubble", ut.DOTS_CONTAINER_CLASS = "deep-chat-loading-message-dots-container";
|
546
|
-
var
|
546
|
+
var Pe = ut;
|
547
547
|
var he = /*#__PURE__*/function () {
|
548
548
|
function he() {
|
549
549
|
_classCallCheck(this, he);
|
@@ -743,7 +743,7 @@ var Ge = /*#__PURE__*/function () {
|
|
743
743
|
return _createClass(Ge, null, [{
|
744
744
|
key: "mouseUp",
|
745
745
|
value: function mouseUp(e, t) {
|
746
|
-
|
746
|
+
O.unsetAllCSSMouseStates(e, t), Object.assign(e.style, t["default"]), Object.assign(e.style, t.hover);
|
747
747
|
}
|
748
748
|
}, {
|
749
749
|
key: "mouseDown",
|
@@ -753,7 +753,7 @@ var Ge = /*#__PURE__*/function () {
|
|
753
753
|
}, {
|
754
754
|
key: "mouseLeave",
|
755
755
|
value: function mouseLeave(e, t) {
|
756
|
-
|
756
|
+
O.unsetAllCSSMouseStates(e, t), Object.assign(e.style, t["default"]);
|
757
757
|
}
|
758
758
|
}, {
|
759
759
|
key: "mouseEnter",
|
@@ -839,10 +839,10 @@ var Ne = /*#__PURE__*/function () {
|
|
839
839
|
r = ts[i].styles;
|
840
840
|
if (r) {
|
841
841
|
var a = JSON.parse(JSON.stringify(r));
|
842
|
-
a["default"] &&
|
842
|
+
a["default"] && O.overwriteDefaultWithAlreadyApplied(a, t), s.unshift(a);
|
843
843
|
}
|
844
|
-
var o =
|
845
|
-
return
|
844
|
+
var o = O.mergeStatefulStyles(s);
|
845
|
+
return O.processStateful(o, {}, {});
|
846
846
|
}
|
847
847
|
}, {
|
848
848
|
key: "applyDeepChatUtilities",
|
@@ -868,7 +868,7 @@ var ie = /*#__PURE__*/function () {
|
|
868
868
|
return _createClass(ie, null, [{
|
869
869
|
key: "applyStylesToElement",
|
870
870
|
value: function applyStylesToElement(e, t) {
|
871
|
-
var i =
|
871
|
+
var i = O.processStateful(t, {}, {});
|
872
872
|
Ge.add(e, i), Object.assign(e.style, i["default"]);
|
873
873
|
}
|
874
874
|
}, {
|
@@ -952,7 +952,7 @@ var Me = /*#__PURE__*/function () {
|
|
952
952
|
key: "overwrite",
|
953
953
|
value: function overwrite(e, t, i, s) {
|
954
954
|
var r = e.messageToElements,
|
955
|
-
o =
|
955
|
+
o = v.overwriteMessage(r, s, t, i, "html", Me.HTML_BUBBLE_CLASS);
|
956
956
|
return o && Me.overwriteElements(e, t, o), o;
|
957
957
|
}
|
958
958
|
}, {
|
@@ -961,7 +961,7 @@ var Me = /*#__PURE__*/function () {
|
|
961
961
|
var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
962
962
|
var o;
|
963
963
|
var r = Me.createElements(e, t, i, s);
|
964
|
-
return
|
964
|
+
return v.fillEmptyMessageElement(r.bubbleElement, t), ie.apply(e, r.outerContainer), ne.flagHTMLUpdateClass(r.bubbleElement), e.applyCustomStyles(r, i, !1, (o = e.messageStyles) == null ? void 0 : o.html), r;
|
965
965
|
}
|
966
966
|
// prettier-ignore
|
967
967
|
}, {
|
@@ -1632,24 +1632,24 @@ function dt(n, e, t) {
|
|
1632
1632
|
return n.substr(0, e) + t + n.substr(e + 1);
|
1633
1633
|
}
|
1634
1634
|
function Er(n) {
|
1635
|
-
var e, t, i, s, r, o, a, l, c, d, u, h, f, m, p, g,
|
1635
|
+
var e, t, i, s, r, o, a, l, c, d, u, h, f, m, p, g, y;
|
1636
1636
|
if (n.options.typographer) {
|
1637
|
-
for (
|
1638
|
-
for (g = n.tokens[p].children,
|
1639
|
-
for (a = g[e].level, f =
|
1640
|
-
|
1637
|
+
for (y = [], p = n.tokens.length - 1; p >= 0; p--) if (n.tokens[p].type === "inline") {
|
1638
|
+
for (g = n.tokens[p].children, y.length = 0, e = 0; e < g.length; e++) if (t = g[e], !(t.type !== "text" || vr.test(t.text))) {
|
1639
|
+
for (a = g[e].level, f = y.length - 1; f >= 0 && !(y[f].level <= a); f--);
|
1640
|
+
y.length = f + 1, i = t.content, r = 0, o = i.length;
|
1641
1641
|
e: for (; r < o && (Us.lastIndex = r, s = Us.exec(i), !!s);) {
|
1642
1642
|
if (l = !qs(i, s.index - 1), r = s.index + 1, m = s[0] === "'", c = !qs(i, r), !c && !l) {
|
1643
1643
|
m && (t.content = dt(t.content, s.index, js));
|
1644
1644
|
continue;
|
1645
1645
|
}
|
1646
1646
|
if (u = !c, h = !l, h) {
|
1647
|
-
for (f =
|
1648
|
-
d =
|
1647
|
+
for (f = y.length - 1; f >= 0 && (d = y[f], !(y[f].level < a)); f--) if (d.single === m && y[f].level === a) {
|
1648
|
+
d = y[f], m ? (g[d.token].content = dt(g[d.token].content, d.pos, n.options.quotes[2]), t.content = dt(t.content, s.index, n.options.quotes[3])) : (g[d.token].content = dt(g[d.token].content, d.pos, n.options.quotes[0]), t.content = dt(t.content, s.index, n.options.quotes[1])), y.length = f;
|
1649
1649
|
continue e;
|
1650
1650
|
}
|
1651
1651
|
}
|
1652
|
-
u ?
|
1652
|
+
u ? y.push({
|
1653
1653
|
token: e,
|
1654
1654
|
pos: s.index,
|
1655
1655
|
single: m,
|
@@ -1851,7 +1851,7 @@ function Cr(n, e, t, i) {
|
|
1851
1851
|
m,
|
1852
1852
|
p,
|
1853
1853
|
g,
|
1854
|
-
|
1854
|
+
y,
|
1855
1855
|
R,
|
1856
1856
|
B,
|
1857
1857
|
Te,
|
@@ -1873,14 +1873,14 @@ function Cr(n, e, t, i) {
|
|
1873
1873
|
type: "bullet_list_open",
|
1874
1874
|
lines: Te = [e, 0],
|
1875
1875
|
level: n.level++
|
1876
|
-
}), s = e, B = !1, oe = n.parser.ruler.getRules("list"); s < t && (
|
1876
|
+
}), s = e, B = !1, oe = n.parser.ruler.getRules("list"); s < t && (y = n.skipSpaces(u), h = n.eMarks[s], y >= h ? f = 1 : f = y - u, f > 4 && (f = 1), f < 1 && (f = 1), r = u - n.bMarks[s] + f, n.tokens.push({
|
1877
1877
|
type: "list_item_open",
|
1878
1878
|
lines: N = [e, 0],
|
1879
1879
|
level: n.level++
|
1880
|
-
}), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] =
|
1880
|
+
}), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] = y - n.bMarks[e], n.blkIndent = r, n.tight = !0, n.parentType = "list", n.parser.tokenize(n, e, t, !0), (!n.tight || B) && (re = !1), B = n.line - e > 1 && n.isEmpty(n.line - 1), n.blkIndent = a, n.tShift[e] = o, n.tight = l, n.parentType = c, n.tokens.push({
|
1881
1881
|
type: "list_item_close",
|
1882
1882
|
level: --n.level
|
1883
|
-
}), s = e = n.line, N[1] = s,
|
1883
|
+
}), s = e = n.line, N[1] = s, y = n.bMarks[e], !(s >= t || n.isEmpty(s) || n.tShift[s] < n.blkIndent));) {
|
1884
1884
|
for (_t = !1, z = 0, We = oe.length; z < We; z++) if (oe[z](n, s, t, !0)) {
|
1885
1885
|
_t = !0;
|
1886
1886
|
break;
|
@@ -1975,7 +1975,7 @@ function Ir(n) {
|
|
1975
1975
|
var e = n | 32;
|
1976
1976
|
return e >= 97 && e <= 122;
|
1977
1977
|
}
|
1978
|
-
function
|
1978
|
+
function Or(n, e, t, i) {
|
1979
1979
|
var s,
|
1980
1980
|
r,
|
1981
1981
|
o,
|
@@ -2005,7 +2005,7 @@ function Zi(n, e) {
|
|
2005
2005
|
i = n.eMarks[e];
|
2006
2006
|
return n.src.substr(t, i - t);
|
2007
2007
|
}
|
2008
|
-
function
|
2008
|
+
function Pr(n, e, t, i) {
|
2009
2009
|
var s, r, o, a, l, c, d, u, h, f, m;
|
2010
2010
|
if (e + 2 > t || (l = e + 1, n.tShift[l] < n.blkIndent) || (o = n.bMarks[l] + n.tShift[l], o >= n.eMarks[l]) || (s = n.src.charCodeAt(o), s !== 124 && s !== 45 && s !== 58) || (r = Zi(n, e + 1), !/^[-:| ]+$/.test(r)) || (c = r.split("|"), c <= 2)) return !1;
|
2011
2011
|
for (u = [], a = 0; a < c.length; a++) {
|
@@ -2099,7 +2099,7 @@ function Nr(n, e) {
|
|
2099
2099
|
for (t = e + 2, i = n.tokens.length - 2; t < i; t++) n.tokens[t].level === s && n.tokens[t].type === "paragraph_open" && (n.tokens[t + 2].tight = !0, n.tokens[t].tight = !0, t += 2);
|
2100
2100
|
}
|
2101
2101
|
function Dr(n, e, t, i) {
|
2102
|
-
var s, r, o, a, l, c, d, u, h, f, m, p, g,
|
2102
|
+
var s, r, o, a, l, c, d, u, h, f, m, p, g, y;
|
2103
2103
|
if (i) return n.ddIndent < 0 ? !1 : gi(n, e) >= 0;
|
2104
2104
|
if (d = e + 1, n.isEmpty(d) && ++d > t || n.tShift[d] < n.blkIndent || (s = gi(n, d), s < 0) || n.level >= n.options.maxNesting) return !1;
|
2105
2105
|
c = n.tokens.length, n.tokens.push({
|
@@ -2108,7 +2108,7 @@ function Dr(n, e, t, i) {
|
|
2108
2108
|
level: n.level++
|
2109
2109
|
}), o = e, r = d;
|
2110
2110
|
e: for (;;) {
|
2111
|
-
for (
|
2111
|
+
for (y = !0, g = !1, n.tokens.push({
|
2112
2112
|
type: "dt_open",
|
2113
2113
|
lines: [o, o],
|
2114
2114
|
level: n.level++
|
@@ -2126,7 +2126,7 @@ function Dr(n, e, t, i) {
|
|
2126
2126
|
type: "dd_open",
|
2127
2127
|
lines: a = [d, 0],
|
2128
2128
|
level: n.level++
|
2129
|
-
}), p = n.tight, h = n.ddIndent, u = n.blkIndent, m = n.tShift[r], f = n.parentType, n.blkIndent = n.ddIndent = n.tShift[r] + 2, n.tShift[r] = s - n.bMarks[r], n.tight = !0, n.parentType = "deflist", n.parser.tokenize(n, r, t, !0), (!n.tight || g) && (
|
2129
|
+
}), p = n.tight, h = n.ddIndent, u = n.blkIndent, m = n.tShift[r], f = n.parentType, n.blkIndent = n.ddIndent = n.tShift[r] + 2, n.tShift[r] = s - n.bMarks[r], n.tight = !0, n.parentType = "deflist", n.parser.tokenize(n, r, t, !0), (!n.tight || g) && (y = !1), g = n.line - r > 1 && n.isEmpty(n.line - 1), n.tShift[r] = m, n.tight = p, n.parentType = f, n.blkIndent = u, n.ddIndent = h, n.tokens.push({
|
2130
2130
|
type: "dd_close",
|
2131
2131
|
level: --n.level
|
2132
2132
|
}), a[1] = d = n.line, d >= t || n.tShift[d] < n.blkIndent) break e;
|
@@ -2138,7 +2138,7 @@ function Dr(n, e, t, i) {
|
|
2138
2138
|
return n.tokens.push({
|
2139
2139
|
type: "dl_close",
|
2140
2140
|
level: --n.level
|
2141
|
-
}), l[1] = d, n.line = d,
|
2141
|
+
}), l[1] = d, n.line = d, y && Nr(n, c), !0;
|
2142
2142
|
}
|
2143
2143
|
function Br(n, e) {
|
2144
2144
|
var t,
|
@@ -2174,7 +2174,7 @@ function Br(n, e) {
|
|
2174
2174
|
level: n.level
|
2175
2175
|
})), !0;
|
2176
2176
|
}
|
2177
|
-
var bi = [["code", Sr], ["fences", _r, ["paragraph", "blockquote", "list"]], ["blockquote", xr, ["paragraph", "blockquote", "list"]], ["hr", wr, ["paragraph", "blockquote", "list"]], ["list", Cr, ["paragraph", "blockquote"]], ["footnote", Tr, ["paragraph"]], ["heading", Rr, ["paragraph", "blockquote"]], ["lheading", Mr], ["htmlblock",
|
2177
|
+
var bi = [["code", Sr], ["fences", _r, ["paragraph", "blockquote", "list"]], ["blockquote", xr, ["paragraph", "blockquote", "list"]], ["hr", wr, ["paragraph", "blockquote", "list"]], ["list", Cr, ["paragraph", "blockquote"]], ["footnote", Tr, ["paragraph"]], ["heading", Rr, ["paragraph", "blockquote"]], ["lheading", Mr], ["htmlblock", Or, ["paragraph", "blockquote"]], ["table", Pr, ["paragraph"]], ["deflist", Dr, ["paragraph"]], ["paragraph", Br]];
|
2178
2178
|
function _s() {
|
2179
2179
|
this.ruler = new ce();
|
2180
2180
|
for (var n = 0; n < bi.length; n++) this.ruler.push(bi[n][0], bi[n][1], {
|
@@ -2921,7 +2921,7 @@ var Q = /*#__PURE__*/function () {
|
|
2921
2921
|
}, {
|
2922
2922
|
key: "applySideStyles",
|
2923
2923
|
value: function applySideStyles(e, t, i, s) {
|
2924
|
-
s && (Q.applyCustomStylesToElements(e, i, s.shared), t ===
|
2924
|
+
s && (Q.applyCustomStylesToElements(e, i, s.shared), t === v.USER_ROLE ? Q.applyCustomStylesToElements(e, i, s.user) : (Q.applyCustomStylesToElements(e, i, s.ai), Q.applyCustomStylesToElements(e, i, s[t])));
|
2925
2925
|
}
|
2926
2926
|
}, {
|
2927
2927
|
key: "isElementsStyles",
|
@@ -3008,7 +3008,7 @@ var U = /*#__PURE__*/function () {
|
|
3008
3008
|
}, {
|
3009
3009
|
key: "apply",
|
3010
3010
|
value: function apply(e, t, i) {
|
3011
|
-
|
3011
|
+
Pe.setRing(t.bubbleElement, i == null ? void 0 : i.bubble), i != null && i.bubble && (i = JSON.parse(JSON.stringify(i)), delete i.bubble), e.applyCustomStyles(t, "history", !1, i);
|
3012
3012
|
}
|
3013
3013
|
}, {
|
3014
3014
|
key: "addLoadHistoryMessage",
|
@@ -3024,7 +3024,7 @@ var U = /*#__PURE__*/function () {
|
|
3024
3024
|
}, {
|
3025
3025
|
key: "createDefaultElements",
|
3026
3026
|
value: function createDefaultElements(e) {
|
3027
|
-
var t = e.createMessageElements("",
|
3027
|
+
var t = e.createMessageElements("", v.AI_ROLE),
|
3028
3028
|
i = t.bubbleElement,
|
3029
3029
|
s = U.generateLoadingRingElement();
|
3030
3030
|
return i.appendChild(s), t;
|
@@ -3035,7 +3035,7 @@ var U = /*#__PURE__*/function () {
|
|
3035
3035
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
3036
3036
|
var r, o, a, l;
|
3037
3037
|
var i = (l = (a = (o = (r = e.messageStyles) == null ? void 0 : r.loading) == null ? void 0 : o.history) == null ? void 0 : a.full) == null ? void 0 : l.html,
|
3038
|
-
s = i ? xe.createElements(e, i,
|
3038
|
+
s = i ? xe.createElements(e, i, v.AI_ROLE, !0) : U.createDefaultElements(e);
|
3039
3039
|
return U.addLoadHistoryMessage(s, e, t), s;
|
3040
3040
|
}
|
3041
3041
|
}, {
|
@@ -3108,7 +3108,7 @@ var te = /*#__PURE__*/function () {
|
|
3108
3108
|
var _this3 = this;
|
3109
3109
|
_classCallCheck(this, te);
|
3110
3110
|
var t;
|
3111
|
-
this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = te.createContainerElement(), this.messageStyles = ne.processMessageStyles(e.messageStyles), this._remarkable = ni.createNew(e.remarkable), this.
|
3111
|
+
this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = te.createContainerElement(), this.messageStyles = ne.processMessageStyles(e.messageStyles), this._remarkable = ni.createNew(e.remarkable), this.avatars = e.avatars, this.names = e.names, this._onMessage = xi.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), this.focusMode = e.focusMode, this.focusMode || (this._lastGroupMessagesElement = document.createElement("div")), typeof this.focusMode != "boolean" && (t = this.focusMode) != null && t.fade && wi.setFade(this.elementRef, this.focusMode.fade), setTimeout(function () {
|
3112
3112
|
_this3.submitUserMessage = e.submitUserMessage;
|
3113
3113
|
});
|
3114
3114
|
}
|
@@ -3122,13 +3122,13 @@ var te = /*#__PURE__*/function () {
|
|
3122
3122
|
i.status = !1;
|
3123
3123
|
}
|
3124
3124
|
var r = s ? this.createAndPrependNewMessageElement(e, t, s) : this.createAndAppendNewMessageElement(e, t);
|
3125
|
-
return r.bubbleElement.classList.add(te.TEXT_BUBBLE_CLASS), this.applyCustomStyles(r, t, !1),
|
3125
|
+
return r.bubbleElement.classList.add(te.TEXT_BUBBLE_CLASS), this.applyCustomStyles(r, t, !1), v.fillEmptyMessageElement(r.bubbleElement, e), r;
|
3126
3126
|
}
|
3127
3127
|
// prettier-ignore
|
3128
3128
|
}, {
|
3129
3129
|
key: "overwriteText",
|
3130
3130
|
value: function overwriteText(e, t, i) {
|
3131
|
-
var s =
|
3131
|
+
var s = v.overwriteMessage(this.messageToElements, i, t, e, "text", te.TEXT_BUBBLE_CLASS);
|
3132
3132
|
return s && this.renderText(s.bubbleElement, t), s;
|
3133
3133
|
}
|
3134
3134
|
}, {
|
@@ -3205,9 +3205,9 @@ var te = /*#__PURE__*/function () {
|
|
3205
3205
|
}, {
|
3206
3206
|
key: "revealRoleElementsIfTempRemoved",
|
3207
3207
|
value: function revealRoleElementsIfTempRemoved(e, t) {
|
3208
|
-
if ((this.
|
3208
|
+
if ((this.avatars || this.names) && Ne.isElementTemporary(e)) {
|
3209
3209
|
var i = this.messageElementRefs[this.messageElementRefs.length - 2];
|
3210
|
-
i && this.messageToElements.length > 0 && !e.bubbleElement.classList.contains(
|
3210
|
+
i && this.messageToElements.length > 0 && !e.bubbleElement.classList.contains(v.getRoleClass(t)) && v.revealRoleElements(i.innerContainer, !!this.avatars, !!this.names);
|
3211
3211
|
}
|
3212
3212
|
}
|
3213
3213
|
}, {
|
@@ -3224,15 +3224,15 @@ var te = /*#__PURE__*/function () {
|
|
3224
3224
|
value: function createMessageElements(e, t) {
|
3225
3225
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
3226
3226
|
var s = this.createElements(e, t);
|
3227
|
-
return
|
3227
|
+
return v.updateRefArr(this.messageElementRefs, s, i), v.classifyRoleMessages(this.messageElementRefs, t), s;
|
3228
3228
|
}
|
3229
3229
|
}, {
|
3230
3230
|
key: "addInnerContainerElements",
|
3231
3231
|
value:
|
3232
3232
|
// prettier-ignore
|
3233
3233
|
function addInnerContainerElements(e, t, i) {
|
3234
|
-
var s;
|
3235
|
-
return (
|
3234
|
+
var s = this.messageElementRefs[this.messageElementRefs.length - 1];
|
3235
|
+
return v.areOuterContainerClassRolesSame(i, s) && !this.isLastMessageError() && v.hideRoleElements(s.innerContainer, !!this.avatars, !!this.names), e.classList.add("message-bubble", v.getRoleClass(i), i === v.USER_ROLE ? "user-message-text" : "ai-message-text"), this.renderText(e, t), v.addRoleElements(e, i, this.avatars, this.names), {
|
3236
3236
|
bubbleElement: e
|
3237
3237
|
};
|
3238
3238
|
}
|
@@ -3242,7 +3242,6 @@ var te = /*#__PURE__*/function () {
|
|
3242
3242
|
value: function applyCustomStyles(e, t, i, s) {
|
3243
3243
|
e && this.messageStyles && Q.applyCustomStyles(this.messageStyles, e, t, i, s);
|
3244
3244
|
}
|
3245
|
-
// WORK - add a customProps to allow devs to add custom properties
|
3246
3245
|
}, {
|
3247
3246
|
key: "removeMessage",
|
3248
3247
|
value: function removeMessage(e) {
|
@@ -3261,7 +3260,7 @@ var te = /*#__PURE__*/function () {
|
|
3261
3260
|
key: "isLastMessageError",
|
3262
3261
|
value: function isLastMessageError() {
|
3263
3262
|
var e;
|
3264
|
-
return (e =
|
3263
|
+
return (e = v.getLastMessageBubbleElement(this.elementRef)) == null ? void 0 : e.classList.contains(v.ERROR_MESSAGE_TEXT_CLASS);
|
3265
3264
|
}
|
3266
3265
|
}, {
|
3267
3266
|
key: "sendClientUpdate",
|
@@ -3300,7 +3299,7 @@ var te = /*#__PURE__*/function () {
|
|
3300
3299
|
value: function createBaseElements(e) {
|
3301
3300
|
var t = document.createElement("div"),
|
3302
3301
|
i = document.createElement("div");
|
3303
|
-
i.classList.add("inner-message-container"), t.appendChild(i), t.classList.add("outer-message-container"), t.classList.add(
|
3302
|
+
i.classList.add("inner-message-container"), t.appendChild(i), t.classList.add("outer-message-container"), t.classList.add(v.buildRoleOuterContainerClass(e));
|
3304
3303
|
var s = document.createElement("div");
|
3305
3304
|
return s.classList.add("message-bubble"), i.appendChild(s), {
|
3306
3305
|
outerContainer: t,
|
@@ -3316,15 +3315,16 @@ var te = /*#__PURE__*/function () {
|
|
3316
3315
|
s = e.html,
|
3317
3316
|
r = e._sessionId,
|
3318
3317
|
o = e.role,
|
3319
|
-
a =
|
3320
|
-
|
3318
|
+
a = e.custom,
|
3319
|
+
l = {
|
3320
|
+
role: o || v.AI_ROLE
|
3321
3321
|
};
|
3322
|
-
return t && (
|
3322
|
+
return t && (l.text = t), i && (l.files = i), s && (l.html = s), !t && !i && !s && (l.text = ""), a && (l.custom = a), r && (l._sessionId = r), l;
|
3323
3323
|
}
|
3324
3324
|
}, {
|
3325
3325
|
key: "isLoadingMessage",
|
3326
3326
|
value: function isLoadingMessage(e) {
|
3327
|
-
return e == null ? void 0 : e.bubbleElement.classList.contains(
|
3327
|
+
return e == null ? void 0 : e.bubbleElement.classList.contains(Pe.BUBBLE_CLASS);
|
3328
3328
|
}
|
3329
3329
|
}]);
|
3330
3330
|
}();
|
@@ -3362,7 +3362,7 @@ var $s = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
|
|
3362
3362
|
key: "applyCustomStyles",
|
3363
3363
|
value: function applyCustomStyles(e, t, i, s) {
|
3364
3364
|
var r, o, a, l;
|
3365
|
-
if ((r = i["default"]) != null && r.styles && Y.applyCustomStylesToElements(e, t, i["default"].styles), s ===
|
3365
|
+
if ((r = i["default"]) != null && r.styles && Y.applyCustomStylesToElements(e, t, i["default"].styles), s === v.USER_ROLE) (o = i.user) != null && o.styles && Y.applyCustomStylesToElements(e, t, i.user.styles);else {
|
3366
3366
|
(a = i.ai) != null && a.styles && Y.applyCustomStylesToElements(e, t, i.ai.styles);
|
3367
3367
|
var c = (l = i[s]) == null ? void 0 : l.styles;
|
3368
3368
|
c && Y.applyCustomStylesToElements(e, t, c);
|
@@ -3373,7 +3373,7 @@ var $s = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
|
|
3373
3373
|
value: function createAvatar(e, t) {
|
3374
3374
|
var r, o, a, l, c;
|
3375
3375
|
var i = document.createElement("img");
|
3376
|
-
e ===
|
3376
|
+
e === v.USER_ROLE ? (i.src = ((r = t == null ? void 0 : t.user) == null ? void 0 : r.src) || ((o = t == null ? void 0 : t["default"]) == null ? void 0 : o.src) || ns, i.onerror = Y.errorFallback.bind(this, ns)) : (i.src = ((a = t == null ? void 0 : t[e]) == null ? void 0 : a.src) || ((l = t == null ? void 0 : t.ai) == null ? void 0 : l.src) || ((c = t == null ? void 0 : t["default"]) == null ? void 0 : c.src) || $s, i.onerror = Y.errorFallback.bind(this, $s)), i.classList.add("avatar"), i.alt = "".concat(e, " avatar");
|
3377
3377
|
var s = document.createElement("div");
|
3378
3378
|
return s.classList.add(Y.CONTAINER_CLASS), s.appendChild(i), t && Y.applyCustomStyles(s, i, t, e), s;
|
3379
3379
|
}
|
@@ -3382,7 +3382,7 @@ var $s = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
|
|
3382
3382
|
value: function getPosition(e, t) {
|
3383
3383
|
var s, r, o, a, l, c;
|
3384
3384
|
var i = (r = (s = t == null ? void 0 : t[e]) == null ? void 0 : s.styles) == null ? void 0 : r.position;
|
3385
|
-
return e !==
|
3385
|
+
return e !== v.USER_ROLE && (i !== null && i !== void 0 ? i : i = (a = (o = t == null ? void 0 : t.ai) == null ? void 0 : o.styles) == null ? void 0 : a.position), i !== null && i !== void 0 ? i : i = (c = (l = t == null ? void 0 : t["default"]) == null ? void 0 : l.styles) == null ? void 0 : c.position, i !== null && i !== void 0 ? i : i = e === v.USER_ROLE ? "right" : "left", i;
|
3386
3386
|
}
|
3387
3387
|
}, {
|
3388
3388
|
key: "add",
|
@@ -3416,19 +3416,19 @@ var Se = /*#__PURE__*/function () {
|
|
3416
3416
|
value: function getPosition(e, t) {
|
3417
3417
|
var s, r, o;
|
3418
3418
|
var i = (s = t == null ? void 0 : t[e]) == null ? void 0 : s.position;
|
3419
|
-
return e !==
|
3419
|
+
return e !== v.USER_ROLE && (i !== null && i !== void 0 ? i : i = (r = t == null ? void 0 : t.ai) == null ? void 0 : r.position), i !== null && i !== void 0 ? i : i = (o = t == null ? void 0 : t["default"]) == null ? void 0 : o.position, i !== null && i !== void 0 ? i : i = e === v.USER_ROLE ? "right" : "left", i;
|
3420
3420
|
}
|
3421
3421
|
}, {
|
3422
3422
|
key: "applyStyle",
|
3423
3423
|
value: function applyStyle(e, t, i) {
|
3424
3424
|
var s, r, o, a;
|
3425
|
-
Object.assign(e.style, (s = i["default"]) == null ? void 0 : s.style), t ===
|
3425
|
+
Object.assign(e.style, (s = i["default"]) == null ? void 0 : s.style), t === v.USER_ROLE ? Object.assign(e.style, (r = i.user) == null ? void 0 : r.style) : (Object.assign(e.style, (o = i.ai) == null ? void 0 : o.style), Object.assign(e.style, (a = i[t]) == null ? void 0 : a.style));
|
3426
3426
|
}
|
3427
3427
|
}, {
|
3428
3428
|
key: "getNameText",
|
3429
3429
|
value: function getNameText(e, t) {
|
3430
3430
|
var i, s, r, o, a, l;
|
3431
|
-
return e ===
|
3431
|
+
return e === v.USER_ROLE ? ((i = t.user) == null ? void 0 : i.text) || ((s = t["default"]) == null ? void 0 : s.text) || "User" : e === v.AI_ROLE ? ((r = t.ai) == null ? void 0 : r.text) || ((o = t["default"]) == null ? void 0 : o.text) || "AI" : ((a = t[e]) == null ? void 0 : a.text) || ((l = t["default"]) == null ? void 0 : l.text) || e;
|
3432
3432
|
}
|
3433
3433
|
}, {
|
3434
3434
|
key: "createName",
|
@@ -3448,11 +3448,11 @@ var Se = /*#__PURE__*/function () {
|
|
3448
3448
|
}();
|
3449
3449
|
Se.NAME_CLASS = "name";
|
3450
3450
|
var $t = Se;
|
3451
|
-
var
|
3452
|
-
function
|
3453
|
-
_classCallCheck(this,
|
3451
|
+
var _ = /*#__PURE__*/function () {
|
3452
|
+
function _() {
|
3453
|
+
_classCallCheck(this, _);
|
3454
3454
|
}
|
3455
|
-
return _createClass(
|
3455
|
+
return _createClass(_, null, [{
|
3456
3456
|
key: "getLastElementsByClass",
|
3457
3457
|
value: function getLastElementsByClass(e, t, i) {
|
3458
3458
|
var _loop = function _loop() {
|
@@ -3493,8 +3493,8 @@ var w = /*#__PURE__*/function () {
|
|
3493
3493
|
}, {
|
3494
3494
|
key: "overwriteMessage",
|
3495
3495
|
value: function overwriteMessage(e, t, i, s, r, o) {
|
3496
|
-
var a =
|
3497
|
-
l =
|
3496
|
+
var a = _.getLastElementsByClass(t, [_.getRoleClass(s), o], [Pe.BUBBLE_CLASS]),
|
3497
|
+
l = _.getLastMessage(e, s, r);
|
3498
3498
|
return l && (l[r] = i), a;
|
3499
3499
|
}
|
3500
3500
|
}, {
|
@@ -3506,18 +3506,18 @@ var w = /*#__PURE__*/function () {
|
|
3506
3506
|
}, {
|
3507
3507
|
key: "fillEmptyMessageElement",
|
3508
3508
|
value: function fillEmptyMessageElement(e, t) {
|
3509
|
-
t.trim().length === 0 && (e.classList.add(
|
3509
|
+
t.trim().length === 0 && (e.classList.add(_.EMPTY_MESSAGE_CLASS), e.innerHTML = '<div style="color:#00000000">.</div>');
|
3510
3510
|
}
|
3511
3511
|
}, {
|
3512
3512
|
key: "unfillEmptyMessageElement",
|
3513
3513
|
value: function unfillEmptyMessageElement(e, t) {
|
3514
|
-
e.classList.contains(
|
3514
|
+
e.classList.contains(_.EMPTY_MESSAGE_CLASS) && t.trim().length > 0 && e.replaceChildren();
|
3515
3515
|
}
|
3516
3516
|
}, {
|
3517
3517
|
key: "getLastMessageBubbleElement",
|
3518
3518
|
value: function getLastMessageBubbleElement(e) {
|
3519
3519
|
var t, i, s;
|
3520
|
-
return Array.from(((s = (i = (t =
|
3520
|
+
return Array.from(((s = (i = (t = _.getLastMessageElement(e)) == null ? void 0 : t.children) == null ? void 0 : i[0]) == null ? void 0 : s.children) || []).find(function (r) {
|
3521
3521
|
return r.classList.contains("message-bubble");
|
3522
3522
|
});
|
3523
3523
|
}
|
@@ -3534,8 +3534,7 @@ var w = /*#__PURE__*/function () {
|
|
3534
3534
|
}, {
|
3535
3535
|
key: "hideRoleElements",
|
3536
3536
|
value: function hideRoleElements(e, t, i) {
|
3537
|
-
|
3538
|
-
t && Kt.hide(s), i && $t.hide(s);
|
3537
|
+
t && Kt.hide(e), i && $t.hide(e);
|
3539
3538
|
}
|
3540
3539
|
}, {
|
3541
3540
|
key: "revealRoleElements",
|
@@ -3548,15 +3547,15 @@ var w = /*#__PURE__*/function () {
|
|
3548
3547
|
i ? e.unshift(t) : e.push(t);
|
3549
3548
|
}
|
3550
3549
|
}, {
|
3551
|
-
key: "
|
3552
|
-
value: function
|
3553
|
-
return "
|
3550
|
+
key: "buildRoleOuterContainerClass",
|
3551
|
+
value: function buildRoleOuterContainerClass(e) {
|
3552
|
+
return "".concat(_.OUTER_CONTAINER_CLASS_ROLE_PREFIX).concat(e);
|
3554
3553
|
}
|
3555
3554
|
}, {
|
3556
3555
|
key: "addNewPositionClasses",
|
3557
3556
|
value: function addNewPositionClasses(e, t) {
|
3558
3557
|
var _e$outerContainer$cla;
|
3559
|
-
e.outerContainer.classList.remove(
|
3558
|
+
e.outerContainer.classList.remove(_.POSITION_TOP_MESSAGE_CLASS, _.POSITION_MIDDLE_MESSAGE_CLASS, _.POSITION_BOTTOM_MESSAGE_CLASS), (_e$outerContainer$cla = e.outerContainer.classList).add.apply(_e$outerContainer$cla, _toConsumableArray(t));
|
3560
3559
|
}
|
3561
3560
|
}, {
|
3562
3561
|
key: "getNumberOfElements",
|
@@ -3582,32 +3581,57 @@ var w = /*#__PURE__*/function () {
|
|
3582
3581
|
key: "generateMessageBodyElements",
|
3583
3582
|
value: function generateMessageBodyElements(e, t) {
|
3584
3583
|
var i = {};
|
3585
|
-
return e.text && (i.text =
|
3584
|
+
return e.text && (i.text = _.findMessageElements(t, fe.TEXT_BUBBLE_CLASS)), e.html && (i.html = _.findMessageElements(t, xe.HTML_BUBBLE_CLASS)), e.files && (i.files = _.filterdMessageElements(t, V.FILE_BUBBLE_CLASS)), i;
|
3586
3585
|
}
|
3587
3586
|
}, {
|
3588
3587
|
key: "generateMessageBody",
|
3589
3588
|
value: function generateMessageBody(e, t) {
|
3590
|
-
var i =
|
3589
|
+
var i = _.getNumberOfElements(e),
|
3591
3590
|
s = t.slice(t.length - i);
|
3592
|
-
return
|
3591
|
+
return _.generateMessageBodyElements(e, s);
|
3593
3592
|
}
|
3593
|
+
// if role not present - traverse all
|
3594
3594
|
}, {
|
3595
|
-
key: "
|
3596
|
-
value: function
|
3597
|
-
var i =
|
3598
|
-
|
3599
|
-
|
3600
|
-
|
3601
|
-
|
3595
|
+
key: "classifyRoleMessages",
|
3596
|
+
value: function classifyRoleMessages(e, t) {
|
3597
|
+
var i = t ? _.buildRoleOuterContainerClass(t) : void 0;
|
3598
|
+
for (var s = e.length - 1; s >= 0; s -= 1) {
|
3599
|
+
if (t || (i = Array.from(e[s].outerContainer.classList).find(function (u) {
|
3600
|
+
return u.startsWith(_.OUTER_CONTAINER_CLASS_ROLE_PREFIX);
|
3601
|
+
})), !i) continue;
|
3602
|
+
var r = e[s],
|
3603
|
+
o = r.outerContainer.classList.contains(i),
|
3604
|
+
a = e[s - 1],
|
3605
|
+
l = e[s + 1],
|
3602
3606
|
c = a == null ? void 0 : a.outerContainer.classList.contains(i),
|
3603
3607
|
d = l == null ? void 0 : l.outerContainer.classList.contains(i);
|
3604
|
-
o
|
3608
|
+
if (o) !c && d ? _.addNewPositionClasses(r, [_.POSITION_TOP_MESSAGE_CLASS]) : c && d ? _.addNewPositionClasses(r, [_.POSITION_MIDDLE_MESSAGE_CLASS]) : c && !d ? _.addNewPositionClasses(r, [_.POSITION_BOTTOM_MESSAGE_CLASS]) : !c && !d && _.addNewPositionClasses(r, [_.POSITION_TOP_MESSAGE_CLASS, _.POSITION_BOTTOM_MESSAGE_CLASS]);else if (t) break;
|
3609
|
+
}
|
3610
|
+
}
|
3611
|
+
}, {
|
3612
|
+
key: "areOuterContainerClassRolesSame",
|
3613
|
+
value: function areOuterContainerClassRolesSame(e, t) {
|
3614
|
+
return t ? Array.from(t.outerContainer.classList).find(function (s) {
|
3615
|
+
return s.startsWith(_.OUTER_CONTAINER_CLASS_ROLE_PREFIX);
|
3616
|
+
}) === _.buildRoleOuterContainerClass(e) : !1;
|
3617
|
+
}
|
3618
|
+
}, {
|
3619
|
+
key: "resetAllRoleElements",
|
3620
|
+
value: function resetAllRoleElements(e, t, i) {
|
3621
|
+
if (!t && !i) return;
|
3622
|
+
var s = "";
|
3623
|
+
e.forEach(function (r, o) {
|
3624
|
+
r.bubbleElement.classList.contains(_.ERROR_MESSAGE_TEXT_CLASS) || _.revealRoleElements(r.innerContainer, t, i);
|
3625
|
+
var a = Array.from(r.outerContainer.classList).find(function (l) {
|
3626
|
+
return l.startsWith(_.OUTER_CONTAINER_CLASS_ROLE_PREFIX);
|
3627
|
+
});
|
3628
|
+
s === a && _.hideRoleElements(e[o - 1].innerContainer, t, i), s = a;
|
3605
3629
|
});
|
3606
3630
|
}
|
3607
3631
|
}]);
|
3608
3632
|
}();
|
3609
|
-
|
3610
|
-
var
|
3633
|
+
_.AI_ROLE = "ai", _.USER_ROLE = "user", _.ERROR_MESSAGE_TEXT_CLASS = "error-message-text", _.OUTER_CONTAINER_CLASS_ROLE_PREFIX = "deep-chat-outer-container-role-", _.EMPTY_MESSAGE_CLASS = "empty-message", _.POSITION_TOP_MESSAGE_CLASS = "deep-chat-top-message", _.POSITION_MIDDLE_MESSAGE_CLASS = "deep-chat-middle-message", _.POSITION_BOTTOM_MESSAGE_CLASS = "deep-chat-bottom-message";
|
3634
|
+
var v = _;
|
3611
3635
|
var pt = /*#__PURE__*/function () {
|
3612
3636
|
function pt(e) {
|
3613
3637
|
_classCallCheck(this, pt);
|
@@ -3631,7 +3655,7 @@ var pt = /*#__PURE__*/function () {
|
|
3631
3655
|
}, {
|
3632
3656
|
key: "setInitialState",
|
3633
3657
|
value: function setInitialState(e, t, i) {
|
3634
|
-
this._streamType = e, i !== null && i !== void 0 ? i : i =
|
3658
|
+
this._streamType = e, i !== null && i !== void 0 ? i : i = v.AI_ROLE, this._elements = e === "text" ? this._messages.addNewTextMessage(t, i) : xe.add(this._messages, t, i, this._messages.messageElementRefs), this._elements.bubbleElement.classList.add(pt.MESSAGE_CLASS), this._activeMessageRole = i, this._message = _defineProperty({
|
3635
3659
|
role: this._activeMessageRole
|
3636
3660
|
}, e, t), this._messages.messageToElements.push([this._message, _defineProperty({}, e, this._elements)]);
|
3637
3661
|
}
|
@@ -3639,7 +3663,7 @@ var pt = /*#__PURE__*/function () {
|
|
3639
3663
|
key: "updateBasedOnType",
|
3640
3664
|
value: function updateBasedOnType(e, t, i) {
|
3641
3665
|
var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
3642
|
-
|
3666
|
+
v.unfillEmptyMessageElement(i, e), (t === "text" ? this.updateText : this.updateHTML).bind(this)(e, i, s);
|
3643
3667
|
}
|
3644
3668
|
}, {
|
3645
3669
|
key: "updateText",
|
@@ -3941,7 +3965,7 @@ function Io(n) {
|
|
3941
3965
|
i,
|
3942
3966
|
s = !1;
|
3943
3967
|
return function (o) {
|
3944
|
-
e === void 0 ? (e = o, t = 0, i = -1) : e =
|
3968
|
+
e === void 0 ? (e = o, t = 0, i = -1) : e = Po(e, o);
|
3945
3969
|
var a = e.length;
|
3946
3970
|
var l = 0;
|
3947
3971
|
for (; t < a;) {
|
@@ -3963,7 +3987,7 @@ function Io(n) {
|
|
3963
3987
|
l === a ? e = void 0 : l !== 0 && (e = e.subarray(l), t -= l);
|
3964
3988
|
};
|
3965
3989
|
}
|
3966
|
-
function
|
3990
|
+
function Oo(n, e, t) {
|
3967
3991
|
var i = Ws();
|
3968
3992
|
var s = new TextDecoder();
|
3969
3993
|
return function (o, a) {
|
@@ -3989,7 +4013,7 @@ function Po(n, e, t) {
|
|
3989
4013
|
}
|
3990
4014
|
};
|
3991
4015
|
}
|
3992
|
-
function
|
4016
|
+
function Po(n, e) {
|
3993
4017
|
var t = new Uint8Array(n.length + e.length);
|
3994
4018
|
return t.set(n), t.set(e, n.length), t;
|
3995
4019
|
}
|
@@ -4029,9 +4053,9 @@ function Bo(n, e) {
|
|
4029
4053
|
}
|
4030
4054
|
l || document.addEventListener("visibilitychange", p);
|
4031
4055
|
var g = Do,
|
4032
|
-
|
4056
|
+
y = 0;
|
4033
4057
|
function R() {
|
4034
|
-
document.removeEventListener("visibilitychange", p), window.clearTimeout(
|
4058
|
+
document.removeEventListener("visibilitychange", p), window.clearTimeout(y), m.abort();
|
4035
4059
|
}
|
4036
4060
|
t == null || t.addEventListener("abort", function () {
|
4037
4061
|
R(), u();
|
@@ -4060,7 +4084,7 @@ function Bo(n, e) {
|
|
4060
4084
|
return Te(oe);
|
4061
4085
|
case 7:
|
4062
4086
|
_context6.next = 9;
|
4063
|
-
return Lo(oe.body, Io(
|
4087
|
+
return Lo(oe.body, Io(Oo(function (z) {
|
4064
4088
|
z ? f[Js] = z : delete f[Js];
|
4065
4089
|
}, function (z) {
|
4066
4090
|
g = z;
|
@@ -4076,7 +4100,7 @@ function Bo(n, e) {
|
|
4076
4100
|
_context6.t0 = _context6["catch"](1);
|
4077
4101
|
if (!m.signal.aborted) try {
|
4078
4102
|
z = (re = a == null ? void 0 : a(_context6.t0)) !== null && re !== void 0 ? re : g;
|
4079
|
-
window.clearTimeout(
|
4103
|
+
window.clearTimeout(y), y = window.setTimeout(N, z);
|
4080
4104
|
} catch (z) {
|
4081
4105
|
R(), h(z);
|
4082
4106
|
}
|
@@ -4108,7 +4132,7 @@ var M = /*#__PURE__*/function () {
|
|
4108
4132
|
r,
|
4109
4133
|
p,
|
4110
4134
|
g,
|
4111
|
-
|
4135
|
+
y,
|
4112
4136
|
R,
|
4113
4137
|
B,
|
4114
4138
|
Te,
|
@@ -4156,7 +4180,7 @@ var M = /*#__PURE__*/function () {
|
|
4156
4180
|
}
|
4157
4181
|
return _context9.abrupt("return", ye.stream(e, a, i));
|
4158
4182
|
case 17:
|
4159
|
-
if (!(((
|
4183
|
+
if (!(((y = e.connectSettings) == null ? void 0 : y.url) === Ee.URL)) {
|
4160
4184
|
_context9.next = 19;
|
4161
4185
|
break;
|
4162
4186
|
}
|
@@ -4546,7 +4570,7 @@ var G = /*#__PURE__*/function () {
|
|
4546
4570
|
throw Error(k.INVALID_RESPONSE(o, "server", !!e.deepChat.responseInterceptor, a));
|
4547
4571
|
case 8:
|
4548
4572
|
if (M.isSimulation(e.stream)) {
|
4549
|
-
l = G.stream.bind(_this7, e, i, s), c = s[o.role ||
|
4573
|
+
l = G.stream.bind(_this7, e, i, s), c = s[o.role || v.AI_ROLE];
|
4550
4574
|
M.upsertWFiles(i, l, c, a);
|
4551
4575
|
} else (Array.isArray(a) ? a : [a]).forEach(function (c) {
|
4552
4576
|
return i.addNewMessage(c);
|
@@ -4654,7 +4678,7 @@ var G = /*#__PURE__*/function () {
|
|
4654
4678
|
var r = e.stream.simulation;
|
4655
4679
|
if (typeof r == "string") {
|
4656
4680
|
var _i$o;
|
4657
|
-
var o = s.role ||
|
4681
|
+
var o = s.role || v.AI_ROLE,
|
4658
4682
|
a = i[o];
|
4659
4683
|
s.text === r || s.html === r ? (a == null || a.finaliseStreamedMessage(), delete i[o]) : ((_i$o = i[o]) !== null && _i$o !== void 0 ? _i$o : i[o] = new Ae(t), i[o].upsertStreamedMessage(s));
|
4660
4684
|
} else M.simulate(t, e.streamHandlers, s);
|
@@ -4843,7 +4867,7 @@ var ye = /*#__PURE__*/function () {
|
|
4843
4867
|
return typeof m.error == "string";
|
4844
4868
|
});
|
4845
4869
|
if (f) console.error(f.error), t.isLastMessageError() || t.addNewErrorMessage("service", f.error);else if (M.isSimulation(e.stream)) {
|
4846
|
-
m = u, p = G.stream.bind(_this8, e, t, i.roleToStream), g = i.roleToStream[m.role ||
|
4870
|
+
m = u, p = G.stream.bind(_this8, e, t, i.roleToStream), g = i.roleToStream[m.role || v.AI_ROLE];
|
4847
4871
|
M.upsertWFiles(t, p, g, m);
|
4848
4872
|
} else h.forEach(function (m) {
|
4849
4873
|
return t.addNewMessage(m);
|
@@ -4947,7 +4971,7 @@ var T = /*#__PURE__*/function () {
|
|
4947
4971
|
return E.processResponseByType(p);
|
4948
4972
|
}).then(/*#__PURE__*/function () {
|
4949
4973
|
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(p) {
|
4950
|
-
var R, B, g,
|
4974
|
+
var R, B, g, y;
|
4951
4975
|
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
4952
4976
|
while (1) switch (_context19.prev = _context19.next) {
|
4953
4977
|
case 0:
|
@@ -4971,20 +4995,20 @@ var T = /*#__PURE__*/function () {
|
|
4971
4995
|
_context19.next = 10;
|
4972
4996
|
return e.extractResultData(g, u, o);
|
4973
4997
|
case 10:
|
4974
|
-
|
4998
|
+
y = _context19.sent;
|
4975
4999
|
if (d) {
|
4976
5000
|
_context19.next = 13;
|
4977
5001
|
break;
|
4978
5002
|
}
|
4979
5003
|
throw p;
|
4980
5004
|
case 13:
|
4981
|
-
if (!(!
|
5005
|
+
if (!(!y || _typeof(y) != "object" && !Array.isArray(y))) {
|
4982
5006
|
_context19.next = 15;
|
4983
5007
|
break;
|
4984
5008
|
}
|
4985
5009
|
throw Error(k.INVALID_RESPONSE(p, "response", !!e.deepChat.responseInterceptor, g));
|
4986
5010
|
case 15:
|
4987
|
-
|
5011
|
+
y.makingAnotherRequest || (M.isSimulatable(e.stream, y) ? M.simulate(i, e.streamHandlers, y) : ((Array.isArray(y) ? y : [y]).forEach(function (N) {
|
4988
5012
|
return i.addNewMessage(N);
|
4989
5013
|
}), c()));
|
4990
5014
|
case 16:
|
@@ -5188,7 +5212,7 @@ var Ue = /*#__PURE__*/function () {
|
|
5188
5212
|
sendUpdate: !0
|
5189
5213
|
}), !0, !0);
|
5190
5214
|
if (c) {
|
5191
|
-
var d =
|
5215
|
+
var d = v.generateMessageBody(c, t);
|
5192
5216
|
i.unshift([c, d]);
|
5193
5217
|
}
|
5194
5218
|
return c;
|
@@ -5201,13 +5225,18 @@ var Ue = /*#__PURE__*/function () {
|
|
5201
5225
|
}, {
|
5202
5226
|
key: "populateMessages",
|
5203
5227
|
value: function populateMessages(e, t) {
|
5204
|
-
this._messages.removeMessage(e), this._isPaginationComplete = t.findIndex(function (
|
5205
|
-
return !
|
5228
|
+
this._messages.removeMessage(e), this._isPaginationComplete = t.findIndex(function (a) {
|
5229
|
+
return !a;
|
5206
5230
|
}) < 0;
|
5207
|
-
var i = t.filter(function (
|
5208
|
-
return !!
|
5231
|
+
var i = t.filter(function (a) {
|
5232
|
+
return !!a;
|
5209
5233
|
});
|
5210
5234
|
this.processLoadedHistory(i);
|
5235
|
+
var _this$_messages2 = this._messages,
|
5236
|
+
s = _this$_messages2.messageElementRefs,
|
5237
|
+
r = _this$_messages2.avatars,
|
5238
|
+
o = _this$_messages2.names;
|
5239
|
+
v.resetAllRoleElements(s, !!r, !!o);
|
5211
5240
|
}
|
5212
5241
|
}, {
|
5213
5242
|
key: "setupLoadHistoryOnScroll",
|
@@ -5262,7 +5291,7 @@ var Ue = /*#__PURE__*/function () {
|
|
5262
5291
|
value: function populateInitialHistory(e) {
|
5263
5292
|
var _this12 = this;
|
5264
5293
|
e.forEach(function (t) {
|
5265
|
-
ne.processHistoryFile(t), _this12._messages.
|
5294
|
+
ne.processHistoryFile(t), _this12._messages.addAnyMessage(t, !0);
|
5266
5295
|
});
|
5267
5296
|
}
|
5268
5297
|
}, {
|
@@ -6239,7 +6268,7 @@ var Xs = {
|
|
6239
6268
|
if (!this.shouldAddIntroMessage(e) || !this._chatEl) return;
|
6240
6269
|
var t = Ci.setUpInitial(this.init.bind(this), this._webModel.introMessage, this._chatEl, !!this._webModel.worker);
|
6241
6270
|
return this.scrollToTop(1), {
|
6242
|
-
role:
|
6271
|
+
role: v.AI_ROLE,
|
6243
6272
|
html: t,
|
6244
6273
|
sendUpdate: !1
|
6245
6274
|
};
|
@@ -6653,9 +6682,9 @@ var Xs = {
|
|
6653
6682
|
key: "setUpHistory",
|
6654
6683
|
value: function setUpHistory(e, t) {
|
6655
6684
|
t.forEach(function (i, s) {
|
6656
|
-
if (i.role ===
|
6685
|
+
if (i.role === v.USER_ROLE && i.text) {
|
6657
6686
|
var r = t[s + 1];
|
6658
|
-
r != null && r.text && r.role !==
|
6687
|
+
r != null && r.text && r.role !== v.USER_ROLE && e.push([i.text, r.text]);
|
6659
6688
|
}
|
6660
6689
|
});
|
6661
6690
|
}
|
@@ -8838,11 +8867,11 @@ var ws = /*#__PURE__*/function (_Ii) {
|
|
8838
8867
|
}
|
8839
8868
|
}]);
|
8840
8869
|
}(Ii);
|
8841
|
-
var
|
8842
|
-
function
|
8843
|
-
_classCallCheck(this,
|
8870
|
+
var Oi = /*#__PURE__*/function () {
|
8871
|
+
function Oi() {
|
8872
|
+
_classCallCheck(this, Oi);
|
8844
8873
|
}
|
8845
|
-
return _createClass(
|
8874
|
+
return _createClass(Oi, null, [{
|
8846
8875
|
key: "buildHeaders",
|
8847
8876
|
value: function buildHeaders(e) {
|
8848
8877
|
return {
|
@@ -8864,7 +8893,7 @@ var Pi = /*#__PURE__*/function () {
|
|
8864
8893
|
return {
|
8865
8894
|
url: "https://api.cohere.ai/v1/generate",
|
8866
8895
|
method: "POST",
|
8867
|
-
handleVerificationResult:
|
8896
|
+
handleVerificationResult: Oi.handleVerificationResult,
|
8868
8897
|
body: JSON.stringify({
|
8869
8898
|
prompt: ""
|
8870
8899
|
})
|
@@ -8876,7 +8905,7 @@ var As = /*#__PURE__*/function (_W4) {
|
|
8876
8905
|
function As(e, t, i, s, r) {
|
8877
8906
|
var _this36;
|
8878
8907
|
_classCallCheck(this, As);
|
8879
|
-
_this36 = _callSuper(this, As, [e,
|
8908
|
+
_this36 = _callSuper(this, As, [e, Oi.buildKeyVerificationDetails(), Oi.buildHeaders, r]), _this36.insertKeyPlaceholderText = "Cohere API Key", _this36.keyHelpUrl = "https://dashboard.cohere.ai/api-keys", _this36.permittedErrorPrefixes = ["invalid"], _this36.url = t, _this36.textInputPlaceholderText = i, s && _typeof(s) == "object" && Object.assign(_this36.rawBody, s);
|
8880
8909
|
return _this36;
|
8881
8910
|
}
|
8882
8911
|
_inherits(As, _W4);
|
@@ -8957,11 +8986,11 @@ var Xo = /*#__PURE__*/function (_As) {
|
|
8957
8986
|
}()
|
8958
8987
|
}]);
|
8959
8988
|
}(As);
|
8960
|
-
var
|
8961
|
-
function
|
8962
|
-
_classCallCheck(this,
|
8989
|
+
var Os = /*#__PURE__*/function () {
|
8990
|
+
function Os() {
|
8991
|
+
_classCallCheck(this, Os);
|
8963
8992
|
}
|
8964
|
-
return _createClass(
|
8993
|
+
return _createClass(Os, null, [{
|
8965
8994
|
key: "buildHeaders",
|
8966
8995
|
value: function buildHeaders(e) {
|
8967
8996
|
return {
|
@@ -8988,8 +9017,8 @@ var Ps = /*#__PURE__*/function () {
|
|
8988
9017
|
}
|
8989
9018
|
}]);
|
8990
9019
|
}();
|
8991
|
-
|
8992
|
-
var pe =
|
9020
|
+
Os.URL_DETAILS_ERROR_MESSAGE = "Please define the Azure URL Details. [More Information](https://deepchat.dev/docs/directConnection/Azure)";
|
9021
|
+
var pe = Os;
|
8993
9022
|
var mt = /*#__PURE__*/function (_Ii2) {
|
8994
9023
|
function mt(e) {
|
8995
9024
|
var _g$headers;
|
@@ -9014,9 +9043,9 @@ var mt = /*#__PURE__*/function (_Ii2) {
|
|
9014
9043
|
};
|
9015
9044
|
if (_this37 = _callSuper(this, mt, [e, s == null ? void 0 : s.assistant, l, pe.buildKeyVerificationDetails(r), pe.buildHeaders, i]), _this37.permittedErrorPrefixes = [pe.URL_DETAILS_ERROR_MESSAGE], _this37.insertKeyPlaceholderText = "Azure OpenAI API Key", _this37.keyHelpUrl = "https://learn.microsoft.com/en-us/answers/questions/1193991/how-to-get-the-value-of-openai-api-key", _this37.isTextInputDisabled = !1, _typeof(s == null ? void 0 : s.assistant) == "object") {
|
9016
9045
|
var _ref24 = (p = (m = (f = e.directConnection) == null ? void 0 : f.azure) == null ? void 0 : m.openAI) == null ? void 0 : p.assistant,
|
9017
|
-
|
9046
|
+
y = _ref24.function_handler,
|
9018
9047
|
R = _ref24.files_tool_type;
|
9019
|
-
|
9048
|
+
y && (_this37.functionHandler = y), R && (_this37.filesToolType = R);
|
9020
9049
|
}
|
9021
9050
|
pe.validateURLDetails(r) ? (_g$headers = (g = _this37.connectSettings).headers) !== null && _g$headers !== void 0 ? _g$headers : g.headers = {} : (_this37.isTextInputDisabled = !0, _this37.canSendMessage = function () {
|
9022
9051
|
return !1;
|
@@ -9106,11 +9135,11 @@ var Yo = /*#__PURE__*/function (_As2) {
|
|
9106
9135
|
}()
|
9107
9136
|
}]);
|
9108
9137
|
}(As);
|
9109
|
-
var
|
9110
|
-
function
|
9111
|
-
_classCallCheck(this,
|
9138
|
+
var P = /*#__PURE__*/function () {
|
9139
|
+
function P() {
|
9140
|
+
_classCallCheck(this, P);
|
9112
9141
|
}
|
9113
|
-
return _createClass(
|
9142
|
+
return _createClass(P, null, [{
|
9114
9143
|
key: "addAttributes",
|
9115
9144
|
value: function addAttributes(e) {
|
9116
9145
|
e.role = "button", e.setAttribute("tabindex", "0");
|
@@ -9138,7 +9167,7 @@ var O = /*#__PURE__*/function () {
|
|
9138
9167
|
}, {
|
9139
9168
|
key: "removeAriaAttributes",
|
9140
9169
|
value: function removeAriaAttributes(e) {
|
9141
|
-
|
9170
|
+
P.removeAriaBusy(e), P.removeAriaDisabled(e);
|
9142
9171
|
}
|
9143
9172
|
}]);
|
9144
9173
|
}();
|
@@ -9198,13 +9227,13 @@ var D = /*#__PURE__*/function () {
|
|
9198
9227
|
key: "unsetAllCSS",
|
9199
9228
|
value: function unsetAllCSS(e, t) {
|
9200
9229
|
var i, s;
|
9201
|
-
t.container &&
|
9230
|
+
t.container && O.unsetAllCSSMouseStates(e, t.container), (i = t.svg) != null && i.styles && O.unsetAllCSSMouseStates(e.children[0], t.svg.styles), (s = t.text) != null && s.styles && O.unsetAllCSSMouseStates(e.children[0], t.text.styles);
|
9202
9231
|
}
|
9203
9232
|
}, {
|
9204
9233
|
key: "unsetActionCSS",
|
9205
9234
|
value: function unsetActionCSS(e, t) {
|
9206
9235
|
var i, s;
|
9207
|
-
t.container &&
|
9236
|
+
t.container && O.unsetActivityCSSMouseStates(e, t.container), (i = t.svg) != null && i.styles && O.unsetActivityCSSMouseStates(e.children[0], t.svg.styles), (s = t.text) != null && s.styles && O.unsetActivityCSSMouseStates(e.children[0], t.text.styles);
|
9208
9237
|
}
|
9209
9238
|
}, {
|
9210
9239
|
key: "setElementsCSS",
|
@@ -9224,7 +9253,7 @@ var ct = /*#__PURE__*/function () {
|
|
9224
9253
|
_classCallCheck(this, ct);
|
9225
9254
|
this._mouseState = {
|
9226
9255
|
state: "default"
|
9227
|
-
},
|
9256
|
+
}, P.addAttributes(e), this.elementRef = e, this._customStyles = i, this.position = t, this.dropupText = s;
|
9228
9257
|
}
|
9229
9258
|
return _createClass(ct, [{
|
9230
9259
|
key: "buttonMouseLeave",
|
@@ -9316,7 +9345,7 @@ var zi = /*#__PURE__*/function (_ct) {
|
|
9316
9345
|
}]);
|
9317
9346
|
}(ct);
|
9318
9347
|
zi.EMPTY_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"></svg>';
|
9319
|
-
var
|
9348
|
+
var Pi = zi;
|
9320
9349
|
var q = /*#__PURE__*/function () {
|
9321
9350
|
function q() {
|
9322
9351
|
_classCallCheck(this, q);
|
@@ -9369,7 +9398,7 @@ var q = /*#__PURE__*/function () {
|
|
9369
9398
|
}
|
9370
9399
|
}]);
|
9371
9400
|
}();
|
9372
|
-
var
|
9401
|
+
var On = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>play</title>\n <path d=\"M5.92 24.096q0 1.088 0.928 1.728 0.512 0.288 1.088 0.288 0.448 0 0.896-0.224l16.16-8.064q0.48-0.256 0.8-0.736t0.288-1.088-0.288-1.056-0.8-0.736l-16.16-8.064q-0.448-0.224-0.896-0.224-0.544 0-1.088 0.288-0.928 0.608-0.928 1.728v16.16z\"></path>\n</svg>",
|
9373
9402
|
cs = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n<title>stop</title>\n<path d=\"M5.92 24.096q0 0.832 0.576 1.408t1.44 0.608h16.128q0.832 0 1.44-0.608t0.576-1.408v-16.16q0-0.832-0.576-1.44t-1.44-0.576h-16.128q-0.832 0-1.44 0.576t-0.576 1.44v16.16z\"></path>\n</svg>",
|
9374
9403
|
C = /*#__PURE__*/function (_W5) {
|
9375
9404
|
function C(e) {
|
@@ -9577,9 +9606,9 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9577
9606
|
value: function createMuteButton() {
|
9578
9607
|
var _this40 = this;
|
9579
9608
|
var t;
|
9580
|
-
var e = new
|
9609
|
+
var e = new Pi((t = this._buttonsConfig) == null ? void 0 : t.microphone);
|
9581
9610
|
return e.elementRef.classList.replace("input-button-svg", "deep-chat-openai-realtime-button"), e.elementRef.classList.add(C.BUTTON_DEFAULT, "deep-chat-openai-realtime-mute"), e.elementRef.onclick = function () {
|
9582
|
-
e.isActive ? (_this40.toggleMute(!0), e.elementRef.classList.replace(C.MUTE_ACTIVE, C.BUTTON_DEFAULT), e.changeToDefault(), _this40._isMuted = !1) : (_this40.toggleMute(!1), e.elementRef.classList.replace(C.BUTTON_DEFAULT, C.MUTE_ACTIVE),
|
9611
|
+
e.isActive ? (_this40.toggleMute(!0), e.elementRef.classList.replace(C.MUTE_ACTIVE, C.BUTTON_DEFAULT), e.changeToDefault(), _this40._isMuted = !1) : (_this40.toggleMute(!1), e.elementRef.classList.replace(C.BUTTON_DEFAULT, C.MUTE_ACTIVE), P.removeAriaAttributes(e.elementRef), e.changeToActive(), _this40._isMuted = !0);
|
9583
9612
|
}, e;
|
9584
9613
|
}
|
9585
9614
|
}, {
|
@@ -9595,7 +9624,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9595
9624
|
value: function createToggleButton() {
|
9596
9625
|
var _this41 = this;
|
9597
9626
|
var t;
|
9598
|
-
var e = new
|
9627
|
+
var e = new Pi((t = this._buttonsConfig) == null ? void 0 : t.toggle);
|
9599
9628
|
return e.elementRef.classList.replace("input-button-svg", "deep-chat-openai-realtime-button"), e.elementRef.classList.add(C.BUTTON_DEFAULT, "deep-chat-openai-realtime-toggle"), e.elementRef.onclick = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee92() {
|
9600
9629
|
var i, s;
|
9601
9630
|
return _regeneratorRuntime().wrap(function _callee92$(_context92) {
|
@@ -9732,7 +9761,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9732
9761
|
_context94.next = 5;
|
9733
9762
|
break;
|
9734
9763
|
}
|
9735
|
-
_this42.removeUnavailable(), _this42._toggleButton && (
|
9764
|
+
_this42.removeUnavailable(), _this42._toggleButton && (P.removeAriaAttributes(_this42._toggleButton.elementRef), _this42._toggleButton.changeToActive()), _this42.hideLoading();
|
9736
9765
|
_context94.next = 20;
|
9737
9766
|
break;
|
9738
9767
|
case 5:
|
@@ -9934,12 +9963,12 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9934
9963
|
key: "displayLoading",
|
9935
9964
|
value: function displayLoading() {
|
9936
9965
|
var e, t, i;
|
9937
|
-
this._toggleButton && (this._toggleButton.changeToActive(), this._toggleButton.elementRef.classList.add(C.BUTTON_LOADING),
|
9966
|
+
this._toggleButton && (this._toggleButton.changeToActive(), this._toggleButton.elementRef.classList.add(C.BUTTON_LOADING), P.removeAriaDisabled(this._toggleButton.elementRef), P.addAriaBusy(this._toggleButton.elementRef)), (typeof ((e = this._loadingConfig) == null ? void 0 : e.display) != "boolean" || this._loadingConfig.display) && this._loadingElement && (this._loadingElement.style.display = "block", (t = this._loadingConfig) != null && t.html || (this._loadingElement.textContent = ((i = this._loadingConfig) == null ? void 0 : i.text) || "Loading"));
|
9938
9967
|
}
|
9939
9968
|
}, {
|
9940
9969
|
key: "hideLoading",
|
9941
9970
|
value: function hideLoading() {
|
9942
|
-
this._toggleButton && (this._toggleButton.elementRef.classList.remove(C.BUTTON_LOADING),
|
9971
|
+
this._toggleButton && (this._toggleButton.elementRef.classList.remove(C.BUTTON_LOADING), P.removeAriaBusy(this._toggleButton.elementRef)), this._loadingElement && (this._loadingElement.style.display = "none");
|
9943
9972
|
}
|
9944
9973
|
// https://platform.openai.com/docs/guides/realtime-model-capabilities#function-calling
|
9945
9974
|
}, {
|
@@ -10020,7 +10049,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10020
10049
|
var _t$microphone, _o$default, _a$svg, _t$toggle, _u$default, _h$svg, _f$active, _m$svg;
|
10021
10050
|
var i, s, r, o, a, l, c, d, u, h, f, m;
|
10022
10051
|
var t = _typeof(e) == "object" && e.buttons ? JSON.parse(JSON.stringify(e.buttons)) : {};
|
10023
|
-
return (r = (s = (i = t.microphone) == null ? void 0 : i["default"]) == null ? void 0 : s.text) != null && r.content || ((_t$microphone = t.microphone) !== null && _t$microphone !== void 0 ? _t$microphone : t.microphone = {}, (_o$default = (o = t.microphone)["default"]) !== null && _o$default !== void 0 ? _o$default : o["default"] = {}, (_a$svg = (a = t.microphone["default"]).svg) !== null && _a$svg !== void 0 ? _a$svg : a.svg = {}, t.microphone["default"].svg.content = In), (d = (c = (l = t.toggle) == null ? void 0 : l["default"]) == null ? void 0 : c.text) != null && d.content || ((_t$toggle = t.toggle) !== null && _t$toggle !== void 0 ? _t$toggle : t.toggle = {}, (_u$default = (u = t.toggle)["default"]) !== null && _u$default !== void 0 ? _u$default : u["default"] = {}, (_h$svg = (h = t.toggle["default"]).svg) !== null && _h$svg !== void 0 ? _h$svg : h.svg = {}, t.toggle["default"].svg.content =
|
10052
|
+
return (r = (s = (i = t.microphone) == null ? void 0 : i["default"]) == null ? void 0 : s.text) != null && r.content || ((_t$microphone = t.microphone) !== null && _t$microphone !== void 0 ? _t$microphone : t.microphone = {}, (_o$default = (o = t.microphone)["default"]) !== null && _o$default !== void 0 ? _o$default : o["default"] = {}, (_a$svg = (a = t.microphone["default"]).svg) !== null && _a$svg !== void 0 ? _a$svg : a.svg = {}, t.microphone["default"].svg.content = In), (d = (c = (l = t.toggle) == null ? void 0 : l["default"]) == null ? void 0 : c.text) != null && d.content || ((_t$toggle = t.toggle) !== null && _t$toggle !== void 0 ? _t$toggle : t.toggle = {}, (_u$default = (u = t.toggle)["default"]) !== null && _u$default !== void 0 ? _u$default : u["default"] = {}, (_h$svg = (h = t.toggle["default"]).svg) !== null && _h$svg !== void 0 ? _h$svg : h.svg = {}, t.toggle["default"].svg.content = On, (_f$active = (f = t.toggle).active) !== null && _f$active !== void 0 ? _f$active : f.active = {}, (_m$svg = (m = t.toggle.active).svg) !== null && _m$svg !== void 0 ? _m$svg : m.svg = {}, t.toggle.active.svg.content = cs), t;
|
10024
10053
|
}
|
10025
10054
|
}, {
|
10026
10055
|
key: "createAvatar",
|
@@ -10038,7 +10067,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10038
10067
|
}, {
|
10039
10068
|
key: "changeButtonToUnavailable",
|
10040
10069
|
value: function changeButtonToUnavailable(e) {
|
10041
|
-
e.elementRef.classList.add(C.UNAVAILABLE),
|
10070
|
+
e.elementRef.classList.add(C.UNAVAILABLE), P.removeAriaBusy(e.elementRef), P.addAriaDisabled(e.elementRef), e.changeToUnavailable();
|
10042
10071
|
}
|
10043
10072
|
}, {
|
10044
10073
|
key: "changeButtonToAvailable",
|
@@ -10048,7 +10077,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10048
10077
|
}, {
|
10049
10078
|
key: "removeButtonUnavailable",
|
10050
10079
|
value: function removeButtonUnavailable(e) {
|
10051
|
-
|
10080
|
+
P.removeAriaDisabled(e.elementRef), e.elementRef.classList.remove(C.UNAVAILABLE);
|
10052
10081
|
}
|
10053
10082
|
}]);
|
10054
10083
|
}(W);
|
@@ -10730,20 +10759,20 @@ var Cs = /*#__PURE__*/function (_W9) {
|
|
10730
10759
|
}
|
10731
10760
|
}]);
|
10732
10761
|
}(W);
|
10733
|
-
var
|
10762
|
+
var Pn = /*#__PURE__*/function (_W10) {
|
10734
10763
|
// prettier-ignore
|
10735
|
-
function
|
10764
|
+
function Pn(e, t, i, s, r) {
|
10736
10765
|
var _this49;
|
10737
|
-
_classCallCheck(this,
|
10738
|
-
_this49 = _callSuper(this,
|
10766
|
+
_classCallCheck(this, Pn);
|
10767
|
+
_this49 = _callSuper(this, Pn, [e, me.buildSpeechKeyVerificationDetails(i), t, s, r]), _this49.insertKeyPlaceholderText = "Azure Speech Subscription Key", _this49.keyHelpUrl =
|
10739
10768
|
// eslint-disable-next-line max-len
|
10740
10769
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal";
|
10741
10770
|
return _this49;
|
10742
10771
|
}
|
10743
|
-
_inherits(
|
10744
|
-
return _createClass(
|
10772
|
+
_inherits(Pn, _W10);
|
10773
|
+
return _createClass(Pn);
|
10745
10774
|
}(W);
|
10746
|
-
var tt = /*#__PURE__*/function (
|
10775
|
+
var tt = /*#__PURE__*/function (_Pn) {
|
10747
10776
|
// prettier-ignore
|
10748
10777
|
function tt(e) {
|
10749
10778
|
var _a$lang, _l$name, _c$gender;
|
@@ -10761,7 +10790,7 @@ var tt = /*#__PURE__*/function (_On) {
|
|
10761
10790
|
}));
|
10762
10791
|
return _this50;
|
10763
10792
|
}
|
10764
|
-
_inherits(tt,
|
10793
|
+
_inherits(tt, _Pn);
|
10765
10794
|
return _createClass(tt, [{
|
10766
10795
|
key: "preprocessBody",
|
10767
10796
|
value: function preprocessBody(e, t) {
|
@@ -10825,14 +10854,14 @@ var tt = /*#__PURE__*/function (_On) {
|
|
10825
10854
|
return extractResultData;
|
10826
10855
|
}()
|
10827
10856
|
}]);
|
10828
|
-
}(
|
10857
|
+
}(Pn);
|
10829
10858
|
tt.HELP_LINK =
|
10830
10859
|
// eslint-disable-next-line max-len
|
10831
10860
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", tt.REGION_ERROR_MESSAGE =
|
10832
10861
|
// eslint-disable-next-line max-len
|
10833
10862
|
"Please define a region config property. [More Information](https://deepchat.dev/docs/directConnection/Azure#TextToSpeech)";
|
10834
10863
|
var ps = tt;
|
10835
|
-
var He = /*#__PURE__*/function (
|
10864
|
+
var He = /*#__PURE__*/function (_Pn2) {
|
10836
10865
|
function He(e) {
|
10837
10866
|
var _this51;
|
10838
10867
|
_classCallCheck(this, He);
|
@@ -10859,7 +10888,7 @@ var He = /*#__PURE__*/function (_On2) {
|
|
10859
10888
|
}
|
10860
10889
|
return _this51;
|
10861
10890
|
}
|
10862
|
-
_inherits(He,
|
10891
|
+
_inherits(He, _Pn2);
|
10863
10892
|
return _createClass(He, [{
|
10864
10893
|
key: "callServiceAPI",
|
10865
10894
|
value: function () {
|
@@ -10925,7 +10954,7 @@ var He = /*#__PURE__*/function (_On2) {
|
|
10925
10954
|
return !!(t != null && t[0]);
|
10926
10955
|
}
|
10927
10956
|
}]);
|
10928
|
-
}(
|
10957
|
+
}(Pn);
|
10929
10958
|
He.HELP_LINK =
|
10930
10959
|
// eslint-disable-next-line max-len
|
10931
10960
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", He.REGION_ERROR_MESSAGE =
|
@@ -11049,7 +11078,7 @@ var yt = /*#__PURE__*/function (_W12) {
|
|
11049
11078
|
s = Et.getCharacterLimitMessages(t, this.totalMessagesMaxCharLength ? this.totalMessagesMaxCharLength - this._systemMessage.content.length : -1).map(function (r) {
|
11050
11079
|
return {
|
11051
11080
|
content: yt.getContent(r),
|
11052
|
-
role: r.role ===
|
11081
|
+
role: r.role === v.USER_ROLE ? "user" : "assistant"
|
11053
11082
|
};
|
11054
11083
|
});
|
11055
11084
|
return t.find(function (r) {
|
@@ -11729,10 +11758,10 @@ var ia = /*#__PURE__*/function () {
|
|
11729
11758
|
}
|
11730
11759
|
}]);
|
11731
11760
|
}();
|
11732
|
-
var
|
11733
|
-
_classCallCheck(this,
|
11761
|
+
var Ps = /*#__PURE__*/_createClass(function Ps() {
|
11762
|
+
_classCallCheck(this, Ps);
|
11734
11763
|
});
|
11735
|
-
|
11764
|
+
Ps.attibutes = {
|
11736
11765
|
string: function string(e) {
|
11737
11766
|
return e;
|
11738
11767
|
},
|
@@ -11752,8 +11781,8 @@ Os.attibutes = {
|
|
11752
11781
|
return new Function("return ".concat(e))();
|
11753
11782
|
}
|
11754
11783
|
};
|
11755
|
-
var bs =
|
11756
|
-
function
|
11784
|
+
var bs = Ps;
|
11785
|
+
function x(n) {
|
11757
11786
|
return function (e, t) {
|
11758
11787
|
Object.defineProperty(e, t, {});
|
11759
11788
|
var i = e.constructor,
|
@@ -11822,7 +11851,7 @@ var sa = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
|
|
11822
11851
|
key: "createAudioElement",
|
11823
11852
|
value: function createAudioElement(e, t) {
|
11824
11853
|
var i = document.createElement("audio");
|
11825
|
-
return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, $e.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t ===
|
11854
|
+
return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, $e.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t === v.USER_ROLE ? "audio-player-safari-right" : "audio-player-safari-left")), i;
|
11826
11855
|
}
|
11827
11856
|
}, {
|
11828
11857
|
key: "createNewAudioMessage",
|
@@ -11967,6 +11996,7 @@ var de = /*#__PURE__*/function () {
|
|
11967
11996
|
var t, i;
|
11968
11997
|
return ue.isActiveElement((t = e.text) == null ? void 0 : t.bubbleElement.classList) || ue.isActiveElement((i = e.html) == null ? void 0 : i.bubbleElement.classList);
|
11969
11998
|
}
|
11999
|
+
// WORK - update message does not work on loaded history messages
|
11970
12000
|
// note that overwrite and 'deep-chat-temporary-message' are used to remove a message
|
11971
12001
|
}, {
|
11972
12002
|
key: "update",
|
@@ -11974,7 +12004,11 @@ var de = /*#__PURE__*/function () {
|
|
11974
12004
|
var s = e.messageToElements[i];
|
11975
12005
|
if (s) {
|
11976
12006
|
if (de.isElementActive(s[1])) return console.error("Cannot update a message that is being streamed");
|
11977
|
-
t.text && de.updateTextMessage(e, s, t.text), t.
|
12007
|
+
t.text && de.updateTextMessage(e, s, t.text), t.files ? de.updateFileMessages(e, s, t.files) : de.removeFilesMessages(e, s), t.html && de.updateHTMLMessage(e, s, t.html), !t.text && s[1].text && de.removeTextHTMLMessage(e, s, "text"), !t.html && s[1].html && de.removeTextHTMLMessage(e, s, "html");
|
12008
|
+
var r = e.messageElementRefs,
|
12009
|
+
o = e.avatars,
|
12010
|
+
a = e.names;
|
12011
|
+
v.classifyRoleMessages(r), v.resetAllRoleElements(r, !!o, !!a);
|
11978
12012
|
} else console.error("Message index not found. Please use the `getMessages` method to find the correct index");
|
11979
12013
|
}
|
11980
12014
|
}]);
|
@@ -12047,8 +12081,8 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12047
12081
|
value: function addSetupMessageIfNeeded(e, t) {
|
12048
12082
|
var i = na.getText(e, t);
|
12049
12083
|
if (i) {
|
12050
|
-
var s = this.createAndAppendNewMessageElement(i,
|
12051
|
-
this.applyCustomStyles(s,
|
12084
|
+
var s = this.createAndAppendNewMessageElement(i, v.AI_ROLE);
|
12085
|
+
this.applyCustomStyles(s, v.AI_ROLE, !1);
|
12052
12086
|
}
|
12053
12087
|
return !!i;
|
12054
12088
|
}
|
@@ -12062,7 +12096,11 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12062
12096
|
t != null && t.isWebModel() && (i !== null && i !== void 0 ? i : i = t.getIntroMessage(i));
|
12063
12097
|
var s = !(e != null && e.history) && !!(e != null && e.loadHistory || t != null && t.fetchHistory);
|
12064
12098
|
i && (Array.isArray(i) ? i.forEach(function (r, o) {
|
12065
|
-
o !== 0
|
12099
|
+
if (o !== 0) {
|
12100
|
+
var a = _this60.messageElementRefs[_this60.messageElementRefs.length - 1].innerContainer;
|
12101
|
+
v.hideRoleElements(a, !!_this60.avatars, !!_this60.names);
|
12102
|
+
}
|
12103
|
+
_this60.addIntroductoryMessage(r, s);
|
12066
12104
|
}) : this.addIntroductoryMessage(i, s));
|
12067
12105
|
}
|
12068
12106
|
}, {
|
@@ -12070,7 +12108,7 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12070
12108
|
value: function addIntroductoryMessage(e, t) {
|
12071
12109
|
var s;
|
12072
12110
|
var i;
|
12073
|
-
return e != null && e.text ? i = this.createAndAppendNewMessageElement(e.text,
|
12111
|
+
return e != null && e.text ? i = this.createAndAppendNewMessageElement(e.text, v.AI_ROLE) : e != null && e.html && (i = xe.add(this, e.html, v.AI_ROLE, this.messageElementRefs)), i && (this.applyCustomStyles(i, v.AI_ROLE, !1, (s = this.messageStyles) == null ? void 0 : s.intro), i.outerContainer.classList.add(fe.INTRO_CLASS), t && (i.outerContainer.style.display = "none")), i;
|
12074
12112
|
}
|
12075
12113
|
}, {
|
12076
12114
|
key: "removeIntroductoryMessage",
|
@@ -12083,7 +12121,7 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12083
12121
|
value: function addAnyMessage(e) {
|
12084
12122
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
12085
12123
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
12086
|
-
return e.error ? this.addNewErrorMessage("service", e.error) : this.addNewMessage(e, t, i);
|
12124
|
+
return e.error ? this.addNewErrorMessage("service", e.error, i) : this.addNewMessage(e, t, i);
|
12087
12125
|
}
|
12088
12126
|
// this should not be activated by streamed messages
|
12089
12127
|
}, {
|
@@ -12095,7 +12133,7 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12095
12133
|
r = {
|
12096
12134
|
status: e.overwrite
|
12097
12135
|
};
|
12098
|
-
if (!e.ignoreText && s.text !== void 0 && e.text !== null && (this.addNewTextMessage(s.text, s.role, r, i), !t && this.textToSpeech && s.role !==
|
12136
|
+
if (!e.ignoreText && s.text !== void 0 && e.text !== null && (this.addNewTextMessage(s.text, s.role, r, i), !t && this.textToSpeech && s.role !== v.USER_ROLE && vt.speak(s.text, this.textToSpeech)), s.files && Array.isArray(s.files) && Bi.addMessages(this, s.files, s.role, i), s.html !== void 0 && s.html !== null) {
|
12099
12137
|
var o = xe.add(this, s.html, s.role, this.messageElementRefs, r, i);
|
12100
12138
|
Ne.isElementTemporary(o) && delete s.html;
|
12101
12139
|
}
|
@@ -12112,7 +12150,7 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12112
12150
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
12113
12151
|
var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
12114
12152
|
if (!t) {
|
12115
|
-
var r =
|
12153
|
+
var r = v.generateMessageBody(e, this.messageElementRefs);
|
12116
12154
|
this.messageToElements.push([e, r]);
|
12117
12155
|
}
|
12118
12156
|
i && this.sendClientUpdate(e, s);
|
@@ -12134,10 +12172,10 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12134
12172
|
this.removeMessageOnError();
|
12135
12173
|
var s = this.getPermittedMessage(t) || ((c = this._errorMessageOverrides) == null ? void 0 : c[e]) || ((d = this._errorMessageOverrides) == null ? void 0 : d["default"]) || "Error, please try again.",
|
12136
12174
|
r = this.createMessageElementsOnOrientation(s, "error", i);
|
12137
|
-
|
12175
|
+
v.hideRoleElements(r.innerContainer, !!this.avatars, !!this.names);
|
12138
12176
|
var o = r.bubbleElement,
|
12139
12177
|
a = r.outerContainer;
|
12140
|
-
o.classList.add(
|
12178
|
+
o.classList.add(v.ERROR_MESSAGE_TEXT_CLASS), this.renderText(o, s);
|
12141
12179
|
var l = Q.extractParticularSharedStyles(["fontSize", "fontFamily"], (u = this.messageStyles) == null ? void 0 : u["default"]);
|
12142
12180
|
Q.applyCustomStylesToElements(r, !1, l), Q.applyCustomStylesToElements(r, !1, (h = this.messageStyles) == null ? void 0 : h.error), i || this.appendOuterContainerElemet(a), this.textToSpeech && vt.speak(s, this.textToSpeech), (f = this._onError) == null || f.call(this, s);
|
12143
12181
|
}
|
@@ -12161,16 +12199,16 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12161
12199
|
}, {
|
12162
12200
|
key: "removeError",
|
12163
12201
|
value: function removeError() {
|
12164
|
-
this.isLastMessageError() &&
|
12202
|
+
this.isLastMessageError() && v.getLastMessageElement(this.elementRef).remove();
|
12165
12203
|
}
|
12166
12204
|
}, {
|
12167
12205
|
key: "addDefaultLoadingMessage",
|
12168
12206
|
value: function addDefaultLoadingMessage() {
|
12169
|
-
var e = this.createMessageElements("",
|
12207
|
+
var e = this.createMessageElements("", v.AI_ROLE),
|
12170
12208
|
t = e.bubbleElement;
|
12171
|
-
e.bubbleElement.classList.add(
|
12209
|
+
e.bubbleElement.classList.add(Pe.DOTS_CONTAINER_CLASS);
|
12172
12210
|
var i = document.createElement("div");
|
12173
|
-
return i.classList.add("loading-message-dots"), t.appendChild(i),
|
12211
|
+
return i.classList.add("loading-message-dots"), t.appendChild(i), Pe.setDots(t, this.messageStyles), e;
|
12174
12212
|
}
|
12175
12213
|
}, {
|
12176
12214
|
key: "addLoadingMessage",
|
@@ -12180,8 +12218,8 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12180
12218
|
var t = this.messageElementRefs[this.messageElementRefs.length - 1];
|
12181
12219
|
if (fe.isLoadingMessage(t) || !e && !this._isLoadingMessageAllowed) return;
|
12182
12220
|
var i = (a = (o = (r = this.messageStyles) == null ? void 0 : r.loading) == null ? void 0 : o.message) == null ? void 0 : a.html,
|
12183
|
-
s = i ? xe.createElements(this, i,
|
12184
|
-
this.appendOuterContainerElemet(s.outerContainer), s.bubbleElement.classList.add(
|
12221
|
+
s = i ? xe.createElements(this, i, v.AI_ROLE, !1) : this.addDefaultLoadingMessage();
|
12222
|
+
this.appendOuterContainerElemet(s.outerContainer), s.bubbleElement.classList.add(Pe.BUBBLE_CLASS), this.applyCustomStyles(s, v.AI_ROLE, !1, (d = (c = (l = this.messageStyles) == null ? void 0 : l.loading) == null ? void 0 : c.message) == null ? void 0 : d.styles), this.focusMode || ee.scrollToBottom(this.elementRef);
|
12185
12223
|
}
|
12186
12224
|
}, {
|
12187
12225
|
key: "populateIntroPanel",
|
@@ -12240,7 +12278,7 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12240
12278
|
}), Array.from(this.elementRef.children).forEach(function (a) {
|
12241
12279
|
var c;
|
12242
12280
|
var l = (c = a.children[0]) == null ? void 0 : c.children[0];
|
12243
|
-
l != null && l.classList.contains(
|
12281
|
+
l != null && l.classList.contains(v.ERROR_MESSAGE_TEXT_CLASS) && a.remove();
|
12244
12282
|
}), this.messageElementRefs = i;
|
12245
12283
|
var s = this.messageToElements.filter(function (a) {
|
12246
12284
|
return a[1].text && ue.isActiveElement(a[1].text.bubbleElement.classList) || a[1].html && ue.isActiveElement(a[1].html.bubbleElement.classList);
|
@@ -12266,7 +12304,7 @@ var ue = /*#__PURE__*/function (_fe) {
|
|
12266
12304
|
}, {
|
12267
12305
|
key: "isActiveElement",
|
12268
12306
|
value: function isActiveElement(e) {
|
12269
|
-
return e ? e.contains(
|
12307
|
+
return e ? e.contains(Pe.BUBBLE_CLASS) || e.contains(De.CLASS) || e.contains(Ae.MESSAGE_CLASS) : !1;
|
12270
12308
|
}
|
12271
12309
|
}]);
|
12272
12310
|
}(fe);
|
@@ -12456,7 +12494,7 @@ var Nn = "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W
|
|
12456
12494
|
r = t.dropupText,
|
12457
12495
|
o = document.createElement("div");
|
12458
12496
|
if (Object.assign(o.style, (a = i == null ? void 0 : i.item) == null ? void 0 : a["default"]), _e.populateItem(s, o, r, i), o.classList.add(_e.MENU_ITEM_CLASS), s.classList.contains(Ke.BUTTOM_CLASS)) t.setDropupItem(o);else {
|
12459
|
-
var l =
|
12497
|
+
var l = O.processStateful((i == null ? void 0 : i.item) || {}, {
|
12460
12498
|
backgroundColor: "#f3f3f3"
|
12461
12499
|
}, {
|
12462
12500
|
backgroundColor: "#ebebeb"
|
@@ -12533,7 +12571,7 @@ var bt = /*#__PURE__*/function (_ct2) {
|
|
12533
12571
|
key: "assignDropupItemStyle",
|
12534
12572
|
value: function assignDropupItemStyle(e) {
|
12535
12573
|
this.elementRef.parentElement && this._originalElementRef && (this.elementRef = ie.replaceElementWithNewClone(this.elementRef, this._originalElementRef)), Object.assign(this.elementRef.style, e.item["default"]);
|
12536
|
-
var t =
|
12574
|
+
var t = O.processStateful(e.item, e.item.hover || {}, e.item.click || {});
|
12537
12575
|
Ge.add(this.elementRef, t), this.addClickListener();
|
12538
12576
|
var i = this.elementRef.children[0];
|
12539
12577
|
i.classList.contains("text-button") || Object.assign(i.style, e.iconContainer);
|
@@ -12542,18 +12580,18 @@ var bt = /*#__PURE__*/function (_ct2) {
|
|
12542
12580
|
key: "changeToDefault",
|
12543
12581
|
value: function changeToDefault(e) {
|
12544
12582
|
var t, i, s, r;
|
12545
|
-
!e && this._state === "default" || (this.elementRef.classList.contains(Ve.MENU_ITEM_CLASS) ? this.assignDropupItemStyle(this._dropupStyles["default"]) : (this.elementRef.replaceChildren(this._innerElements["default"]), (t = this._customStyles) != null && t.active && D.unsetAllCSS(this.elementRef, (i = this._customStyles) == null ? void 0 : i.active), (s = this._customStyles) != null && s.disabled && D.unsetAllCSS(this.elementRef, (r = this._customStyles) == null ? void 0 : r.disabled), this.reapplyStateStyle("default", ["active", "disabled"])),
|
12583
|
+
!e && this._state === "default" || (this.elementRef.classList.contains(Ve.MENU_ITEM_CLASS) ? this.assignDropupItemStyle(this._dropupStyles["default"]) : (this.elementRef.replaceChildren(this._innerElements["default"]), (t = this._customStyles) != null && t.active && D.unsetAllCSS(this.elementRef, (i = this._customStyles) == null ? void 0 : i.active), (s = this._customStyles) != null && s.disabled && D.unsetAllCSS(this.elementRef, (r = this._customStyles) == null ? void 0 : r.disabled), this.reapplyStateStyle("default", ["active", "disabled"])), P.removeAriaDisabled(this.elementRef), this._state = "default");
|
12546
12584
|
}
|
12547
12585
|
}, {
|
12548
12586
|
key: "changeToActive",
|
12549
12587
|
value: function changeToActive(e) {
|
12550
|
-
!e && this._state === "active" || (this.elementRef.classList.contains(Ve.MENU_ITEM_CLASS) ? this.assignDropupItemStyle(this._dropupStyles.active) : (this.elementRef.replaceChildren(this._innerElements.active), this.reapplyStateStyle("active", ["disabled", "default"])),
|
12588
|
+
!e && this._state === "active" || (this.elementRef.classList.contains(Ve.MENU_ITEM_CLASS) ? this.assignDropupItemStyle(this._dropupStyles.active) : (this.elementRef.replaceChildren(this._innerElements.active), this.reapplyStateStyle("active", ["disabled", "default"])), P.removeAriaDisabled(this.elementRef), this._state = "active");
|
12551
12589
|
}
|
12552
12590
|
}, {
|
12553
12591
|
key: "changeToDisabled",
|
12554
12592
|
value: function changeToDisabled(e) {
|
12555
12593
|
var t, i, s, r;
|
12556
|
-
!e && this._state === "disabled" || (this.elementRef.classList.contains(Ve.MENU_ITEM_CLASS) ? (this.elementRef.classList.add(Ve.DISABLED_ITEM_CLASS), this.assignDropupItemStyle(this._dropupStyles.disabled)) : (this.elementRef.replaceChildren(this._innerElements.disabled), (t = this._customStyles) != null && t.active && D.unsetAllCSS(this.elementRef, (i = this._customStyles) == null ? void 0 : i.active), (s = this._customStyles) != null && s["default"] && D.unsetAllCSS(this.elementRef, (r = this._customStyles) == null ? void 0 : r["default"]), this.reapplyStateStyle("disabled", ["default", "active"])),
|
12594
|
+
!e && this._state === "disabled" || (this.elementRef.classList.contains(Ve.MENU_ITEM_CLASS) ? (this.elementRef.classList.add(Ve.DISABLED_ITEM_CLASS), this.assignDropupItemStyle(this._dropupStyles.disabled)) : (this.elementRef.replaceChildren(this._innerElements.disabled), (t = this._customStyles) != null && t.active && D.unsetAllCSS(this.elementRef, (i = this._customStyles) == null ? void 0 : i.active), (s = this._customStyles) != null && s["default"] && D.unsetAllCSS(this.elementRef, (r = this._customStyles) == null ? void 0 : r["default"]), this.reapplyStateStyle("disabled", ["default", "active"])), P.addAriaDisabled(this.elementRef), this._state = "disabled");
|
12557
12595
|
}
|
12558
12596
|
}, {
|
12559
12597
|
key: "setDropupItem",
|
@@ -13148,13 +13186,13 @@ function Bn() {
|
|
13148
13186
|
}();
|
13149
13187
|
return It.AutoScroll = n, It;
|
13150
13188
|
}
|
13151
|
-
var
|
13189
|
+
var Ot = {},
|
13152
13190
|
on;
|
13153
13191
|
function Wi() {
|
13154
|
-
if (on) return
|
13155
|
-
on = 1, Object.defineProperty(
|
13192
|
+
if (on) return Ot;
|
13193
|
+
on = 1, Object.defineProperty(Ot, "__esModule", {
|
13156
13194
|
value: !0
|
13157
|
-
}),
|
13195
|
+
}), Ot.Elements = void 0;
|
13158
13196
|
var n = /*#__PURE__*/function () {
|
13159
13197
|
function n() {
|
13160
13198
|
_classCallCheck(this, n);
|
@@ -13201,15 +13239,15 @@ function Wi() {
|
|
13201
13239
|
}
|
13202
13240
|
}]);
|
13203
13241
|
}();
|
13204
|
-
return
|
13242
|
+
return Ot.Elements = n, Ot;
|
13205
13243
|
}
|
13206
|
-
var
|
13244
|
+
var Pt = {},
|
13207
13245
|
an;
|
13208
13246
|
function Ji() {
|
13209
|
-
if (an) return
|
13210
|
-
an = 1, Object.defineProperty(
|
13247
|
+
if (an) return Pt;
|
13248
|
+
an = 1, Object.defineProperty(Pt, "__esModule", {
|
13211
13249
|
value: !0
|
13212
|
-
}),
|
13250
|
+
}), Pt.Cursor = void 0;
|
13213
13251
|
var n = /*#__PURE__*/function () {
|
13214
13252
|
function n() {
|
13215
13253
|
_classCallCheck(this, n);
|
@@ -13290,7 +13328,7 @@ function Ji() {
|
|
13290
13328
|
}
|
13291
13329
|
}]);
|
13292
13330
|
}();
|
13293
|
-
return
|
13331
|
+
return Pt.Cursor = n, Pt;
|
13294
13332
|
}
|
13295
13333
|
var ln;
|
13296
13334
|
function Fn() {
|
@@ -13365,32 +13403,32 @@ function Fn() {
|
|
13365
13403
|
var p = a.commands;
|
13366
13404
|
if (!p || !d || !c) return;
|
13367
13405
|
var g = ((h = p.settings) === null || h === void 0 ? void 0 : h.caseSensitive) === !0 ? l : l.toLowerCase(),
|
13368
|
-
|
13406
|
+
y = s.Text.breakupIntoWordsArr(g),
|
13369
13407
|
R = ((f = p.settings) === null || f === void 0 ? void 0 : f.substrings) === !1 ? r.checkIfMatchesWord : r.checkIfMatchesSubstring;
|
13370
|
-
if (p.commandMode && R(p.commandMode, g,
|
13408
|
+
if (p.commandMode && R(p.commandMode, g, y)) return a.setInterimColorToFinal(), setTimeout(function () {
|
13371
13409
|
return r.toggleCommandModeOn(a);
|
13372
13410
|
}), {
|
13373
13411
|
doNotProcessTranscription: !1
|
13374
13412
|
};
|
13375
13413
|
if (!(p.commandMode && !a.isWaitingForCommand)) {
|
13376
|
-
if (p.stop && R(p.stop, g,
|
13414
|
+
if (p.stop && R(p.stop, g, y)) return r.toggleCommandModeOff(a), setTimeout(function () {
|
13377
13415
|
return a.stop();
|
13378
13416
|
}), {
|
13379
13417
|
doNotProcessTranscription: !1
|
13380
13418
|
};
|
13381
|
-
if (p.pause && R(p.pause, g,
|
13419
|
+
if (p.pause && R(p.pause, g, y)) return r.toggleCommandModeOff(a), a.setInterimColorToFinal(), setTimeout(function () {
|
13382
13420
|
var B;
|
13383
13421
|
a.isPaused = !0, (B = a.onPauseTrigger) === null || B === void 0 || B.call(a, !0);
|
13384
13422
|
}), {
|
13385
13423
|
doNotProcessTranscription: !1
|
13386
13424
|
};
|
13387
|
-
if (p.resume && R(p.resume, g,
|
13425
|
+
if (p.resume && R(p.resume, g, y)) return a.isPaused = !1, (m = a.onPauseTrigger) === null || m === void 0 || m.call(a, !1), r.toggleCommandModeOff(a), a.resetRecording(c), {
|
13388
13426
|
doNotProcessTranscription: !0
|
13389
13427
|
};
|
13390
|
-
if (p.reset && R(p.reset, g,
|
13428
|
+
if (p.reset && R(p.reset, g, y)) return u !== void 0 && r.setText(a, c, u, d), {
|
13391
13429
|
doNotProcessTranscription: !0
|
13392
13430
|
};
|
13393
|
-
if (p.removeAllText && R(p.removeAllText, g,
|
13431
|
+
if (p.removeAllText && R(p.removeAllText, g, y)) return r.setText(a, c, "", d), {
|
13394
13432
|
doNotProcessTranscription: !0
|
13395
13433
|
};
|
13396
13434
|
}
|
@@ -13553,8 +13591,8 @@ function Un() {
|
|
13553
13591
|
value: function prepareBeforeStart(h) {
|
13554
13592
|
var f, m;
|
13555
13593
|
if (h != null && h.element) if (n.EventListeners.add(this, h), Array.isArray(h.element)) {
|
13556
|
-
var g = h.element.find(function (
|
13557
|
-
return
|
13594
|
+
var g = h.element.find(function (y) {
|
13595
|
+
return y === document.activeElement;
|
13558
13596
|
}) || h.element[0];
|
13559
13597
|
if (!g) return;
|
13560
13598
|
this.prepare(g);
|
@@ -13582,9 +13620,9 @@ function Un() {
|
|
13582
13620
|
var g = c.Text.capitalize(f);
|
13583
13621
|
if (this.finalTranscript === g && h === "") return;
|
13584
13622
|
e.PreResultUtils.process(this, m, h === "", this._onPreResult, this._options) && (h = "", m = "");
|
13585
|
-
var
|
13586
|
-
if (
|
13587
|
-
if (
|
13623
|
+
var y = this.commands && t.CommandUtils.execCommand(this, m, this._options, this._primitiveElement || this._genericElement, this._originalText);
|
13624
|
+
if (y) {
|
13625
|
+
if (y.doNotProcessTranscription) return;
|
13588
13626
|
h = "", m = "";
|
13589
13627
|
}
|
13590
13628
|
if (this.isPaused || this.isWaitingForCommand) return;
|
@@ -13613,8 +13651,8 @@ function Un() {
|
|
13613
13651
|
this.finalSpan.innerHTML = p;
|
13614
13652
|
var g = i.AutoScroll.isRequired(this.autoScroll, h);
|
13615
13653
|
i.AutoScroll.changeStateIfNeeded(this, g);
|
13616
|
-
var
|
13617
|
-
this.interimSpan.innerHTML =
|
13654
|
+
var y = c.Text.lineBreak(f) + (m ? "" : this.endPadding);
|
13655
|
+
this.interimSpan.innerHTML = y, a.Browser.IS_SAFARI() && this.insertInCursorLocation && l.Cursor.setOffsetForSafariGeneric(h, p.length + y.length), g && i.AutoScroll.scrollGeneric(this, h), m && (this.scrollingSpan.innerHTML = "");
|
13618
13656
|
}
|
13619
13657
|
}, {
|
13620
13658
|
key: "finalise",
|
@@ -14322,32 +14360,32 @@ var ti = /*#__PURE__*/function (_li) {
|
|
14322
14360
|
}(li);
|
14323
14361
|
ti.MICROPHONE_RESET_TIMEOUT_MS = 300;
|
14324
14362
|
var ci = ti;
|
14325
|
-
var
|
14363
|
+
var Oe = /*#__PURE__*/function () {
|
14326
14364
|
// prettier-ignore
|
14327
|
-
function
|
14365
|
+
function Oe(e, t, i, s) {
|
14328
14366
|
var _this75 = this;
|
14329
|
-
_classCallCheck(this,
|
14367
|
+
_classCallCheck(this, Oe);
|
14330
14368
|
this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", t.maxNumberOfFiles && (this._fileCountLimit = t.maxNumberOfFiles), this._toggleContainerDisplay = i, this._fileAttachmentsContainerRef = s, t.acceptedFormats && (this._acceptedFormat = t.acceptedFormats), setTimeout(function () {
|
14331
14369
|
_this75._validationHandler = e._validationHandler;
|
14332
14370
|
});
|
14333
14371
|
}
|
14334
|
-
return _createClass(
|
14372
|
+
return _createClass(Oe, [{
|
14335
14373
|
key: "attemptAddFile",
|
14336
14374
|
value: function attemptAddFile(e, t) {
|
14337
|
-
return
|
14375
|
+
return Oe.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), !0) : !1;
|
14338
14376
|
}
|
14339
14377
|
}, {
|
14340
14378
|
key: "addAttachmentBasedOnType",
|
14341
14379
|
value: function addAttachmentBasedOnType(e, t, i) {
|
14342
|
-
var s =
|
14380
|
+
var s = Oe.getTypeFromBlob(e);
|
14343
14381
|
if (s === "image") {
|
14344
|
-
var r =
|
14382
|
+
var r = Oe.createImageAttachment(t);
|
14345
14383
|
this.addFileAttachment(e, "image", r, i);
|
14346
14384
|
} else if (s === "audio") {
|
14347
14385
|
var _r2 = di.createAudioAttachment(t);
|
14348
14386
|
this.addFileAttachment(e, "audio", _r2, i);
|
14349
14387
|
} else {
|
14350
|
-
var _r3 =
|
14388
|
+
var _r3 = Oe.createAnyFileAttachment(e.name);
|
14351
14389
|
this.addFileAttachment(e, "any", _r3, i);
|
14352
14390
|
}
|
14353
14391
|
}
|
@@ -14355,7 +14393,7 @@ var Pe = /*#__PURE__*/function () {
|
|
14355
14393
|
key: "addFileAttachment",
|
14356
14394
|
value: function addFileAttachment(e, t, i, s) {
|
14357
14395
|
var a;
|
14358
|
-
var r =
|
14396
|
+
var r = Oe.createContainer(i);
|
14359
14397
|
if (this._attachments.length >= this._fileCountLimit) {
|
14360
14398
|
var l = this._attachments[this._attachments.length - 1].removeButton;
|
14361
14399
|
l == null || l.click();
|
@@ -14455,13 +14493,13 @@ var Pe = /*#__PURE__*/function () {
|
|
14455
14493
|
}
|
14456
14494
|
}]);
|
14457
14495
|
}();
|
14458
|
-
var Le = /*#__PURE__*/function (
|
14496
|
+
var Le = /*#__PURE__*/function (_Oe) {
|
14459
14497
|
// prettier-ignore
|
14460
14498
|
function Le(e, t, i, s) {
|
14461
14499
|
_classCallCheck(this, Le);
|
14462
14500
|
return _callSuper(this, Le, [e, t, i, s]);
|
14463
14501
|
}
|
14464
|
-
_inherits(Le,
|
14502
|
+
_inherits(Le, _Oe);
|
14465
14503
|
return _createClass(Le, [{
|
14466
14504
|
key: "createTimer",
|
14467
14505
|
value: function createTimer(e, t) {
|
@@ -14540,7 +14578,7 @@ var Le = /*#__PURE__*/function (_Pe) {
|
|
14540
14578
|
var i = e.parentElement ? ee.cloneElement(e) : e,
|
14541
14579
|
s = document.createElement("audio");
|
14542
14580
|
s.src = t;
|
14543
|
-
var r = $.createSVGElement(
|
14581
|
+
var r = $.createSVGElement(On);
|
14544
14582
|
r.classList.add("attachment-icon", "play-icon");
|
14545
14583
|
var o = $.createSVGElement(cs);
|
14546
14584
|
o.classList.add("attachment-icon", "stop-icon"), i.replaceChildren(r), s.onplay = function () {
|
@@ -14566,7 +14604,7 @@ var Le = /*#__PURE__*/function (_Pe) {
|
|
14566
14604
|
(s = (i = (t = e.children[0]) == null ? void 0 : t.children) == null ? void 0 : i[0]) != null && s.classList.contains("stop-icon") && e.children[0].click();
|
14567
14605
|
}
|
14568
14606
|
}]);
|
14569
|
-
}(
|
14607
|
+
}(Oe);
|
14570
14608
|
Le.TIMER_LIMIT_S = 5999;
|
14571
14609
|
var di = Le;
|
14572
14610
|
var Ma = /*#__PURE__*/function () {
|
@@ -14578,7 +14616,7 @@ var Ma = /*#__PURE__*/function () {
|
|
14578
14616
|
value:
|
14579
14617
|
// prettier-ignore
|
14580
14618
|
function create(e, t, i, s, r) {
|
14581
|
-
return r === "audio" ? new di(e, t, i, s) : new
|
14619
|
+
return r === "audio" ? new di(e, t, i, s) : new Oe(e, t, i, s);
|
14582
14620
|
}
|
14583
14621
|
}]);
|
14584
14622
|
}();
|
@@ -14698,7 +14736,7 @@ var ve = /*#__PURE__*/function () {
|
|
14698
14736
|
e[_key2] = arguments[_key2];
|
14699
14737
|
}
|
14700
14738
|
e.forEach(function (t) {
|
14701
|
-
|
14739
|
+
P.addAttributes(t), _this78._buttonPanel.appendChild(t);
|
14702
14740
|
});
|
14703
14741
|
}
|
14704
14742
|
}, {
|
@@ -14798,13 +14836,13 @@ var Jt = /*#__PURE__*/function (_ct5) {
|
|
14798
14836
|
function Jt(e, t, i, s, r, o) {
|
14799
14837
|
var _this81;
|
14800
14838
|
_classCallCheck(this, Jt);
|
14801
|
-
var u, h, f, m, p, g,
|
14839
|
+
var u, h, f, m, p, g, y, R, B;
|
14802
14840
|
var a = (u = i == null ? void 0 : i.button) == null ? void 0 : u.position,
|
14803
14841
|
l = ((m = (f = (h = i == null ? void 0 : i.button) == null ? void 0 : h.styles) == null ? void 0 : f.text) == null ? void 0 : m.content) || o;
|
14804
14842
|
_this81 = _callSuper(this, Jt, [Jt.createButtonElement(), a, i.button, l]);
|
14805
14843
|
var c = a === "dropup-menu",
|
14806
14844
|
d = _this81.createInnerElements(s, r, _this81._customStyles, c);
|
14807
|
-
_this81._inputElement = Jt.createInputElement((p = i == null ? void 0 : i.files) == null ? void 0 : p.acceptedFormats), _this81.addClickEvent(e, i), _this81.elementRef.replaceChildren(d.styles), _this81.reapplyStateStyle("styles"), _this81._fileAttachmentsType = t, _this81._openModalOnce = ((
|
14845
|
+
_this81._inputElement = Jt.createInputElement((p = i == null ? void 0 : i.files) == null ? void 0 : p.acceptedFormats), _this81.addClickEvent(e, i), _this81.elementRef.replaceChildren(d.styles), _this81.reapplyStateStyle("styles"), _this81._fileAttachmentsType = t, _this81._openModalOnce = ((y = (g = i.files) == null ? void 0 : g.infoModal) == null ? void 0 : y.openModalOnce) === !1 || (B = (R = i.files) == null ? void 0 : R.infoModal) == null ? void 0 : B.openModalOnce;
|
14808
14846
|
return _this81;
|
14809
14847
|
}
|
14810
14848
|
_inherits(Jt, _ct5);
|
@@ -15256,7 +15294,7 @@ var I = /*#__PURE__*/function (_ct6) {
|
|
15256
15294
|
e.files && (t.files = Array.from(e.files).map(function (i) {
|
15257
15295
|
return {
|
15258
15296
|
file: i,
|
15259
|
-
type:
|
15297
|
+
type: Oe.getTypeFromBlob(i)
|
15260
15298
|
};
|
15261
15299
|
})), setTimeout(function () {
|
15262
15300
|
return _this88.attemptSubmit(t, !0);
|
@@ -15344,7 +15382,7 @@ var I = /*#__PURE__*/function (_ct6) {
|
|
15344
15382
|
case 0:
|
15345
15383
|
e = _ref41.text, t = _ref41.files;
|
15346
15384
|
i = {
|
15347
|
-
role:
|
15385
|
+
role: v.USER_ROLE
|
15348
15386
|
};
|
15349
15387
|
e && (i.text = e);
|
15350
15388
|
_context136.t0 = t;
|
@@ -15379,19 +15417,19 @@ var I = /*#__PURE__*/function (_ct6) {
|
|
15379
15417
|
}, {
|
15380
15418
|
key: "changeToStopIcon",
|
15381
15419
|
value: function changeToStopIcon() {
|
15382
|
-
this._serviceIO.websocket || (this.elementRef.classList.remove(I.LOADING_CLASS, I.DISABLED_CLASS, I.SUBMIT_CLASS),
|
15420
|
+
this._serviceIO.websocket || (this.elementRef.classList.remove(I.LOADING_CLASS, I.DISABLED_CLASS, I.SUBMIT_CLASS), P.removeAriaAttributes(this.elementRef), this.elementRef.replaceChildren(this._innerElements.stop), this.reapplyStateStyle("stop", ["loading", "submit"]), this.elementRef.onclick = this.stopStream.bind(this), this.status.loadingActive = !1);
|
15383
15421
|
}
|
15384
15422
|
}, {
|
15385
15423
|
key: "changeToLoadingIcon",
|
15386
15424
|
value: function changeToLoadingIcon() {
|
15387
|
-
this._serviceIO.websocket || (this._isSVGLoadingIconOverriden || this.elementRef.replaceChildren(this._innerElements.loading), this.elementRef.classList.remove(I.SUBMIT_CLASS, I.DISABLED_CLASS),
|
15425
|
+
this._serviceIO.websocket || (this._isSVGLoadingIconOverriden || this.elementRef.replaceChildren(this._innerElements.loading), this.elementRef.classList.remove(I.SUBMIT_CLASS, I.DISABLED_CLASS), P.removeAriaDisabled(this.elementRef), this.elementRef.classList.add(I.LOADING_CLASS), P.addAriaBusy(this.elementRef), this.reapplyStateStyle("loading", ["submit"]), this.elementRef.onclick = function () {}, this.status.requestInProgress = !0, this.status.loadingActive = !0);
|
15388
15426
|
}
|
15389
15427
|
// called every time when user triggers an input via ValidationHandler - hence use class to check if not already present
|
15390
15428
|
}, {
|
15391
15429
|
key: "changeToSubmitIcon",
|
15392
15430
|
value: function changeToSubmitIcon() {
|
15393
15431
|
var _this89 = this;
|
15394
|
-
this.elementRef.classList.contains(I.SUBMIT_CLASS) || (this.elementRef.classList.remove(I.LOADING_CLASS, I.DISABLED_CLASS),
|
15432
|
+
this.elementRef.classList.contains(I.SUBMIT_CLASS) || (this.elementRef.classList.remove(I.LOADING_CLASS, I.DISABLED_CLASS), P.removeAriaAttributes(this.elementRef), this.elementRef.classList.add(I.SUBMIT_CLASS), this.elementRef.replaceChildren(this._innerElements.submit), st.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = function () {
|
15395
15433
|
var e;
|
15396
15434
|
_this89.submitFromInput(), (e = _this89._microphoneButton) != null && e.isActive && ci.toggleSpeechAfterSubmit(_this89._microphoneButton.elementRef, !!_this89._stopSTTAfterSubmit);
|
15397
15435
|
});
|
@@ -15401,7 +15439,7 @@ var I = /*#__PURE__*/function (_ct6) {
|
|
15401
15439
|
key: "changeToDisabledIcon",
|
15402
15440
|
value: function changeToDisabledIcon() {
|
15403
15441
|
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
15404
|
-
this._alwaysEnabled && !e ? this.changeToSubmitIcon() : this.elementRef.classList.contains(I.DISABLED_CLASS) || (this.elementRef.classList.remove(I.LOADING_CLASS, I.SUBMIT_CLASS),
|
15442
|
+
this._alwaysEnabled && !e ? this.changeToSubmitIcon() : this.elementRef.classList.contains(I.DISABLED_CLASS) || (this.elementRef.classList.remove(I.LOADING_CLASS, I.SUBMIT_CLASS), P.removeAriaBusy(this.elementRef), this.elementRef.classList.add(I.DISABLED_CLASS), P.addAriaDisabled(this.elementRef), this.elementRef.replaceChildren(this._innerElements.disabled), this.reapplyStateStyle("disabled", ["submit"]), this.elementRef.onclick = function () {});
|
15405
15443
|
}
|
15406
15444
|
}, {
|
15407
15445
|
key: "disableSubmitButton",
|
@@ -15439,8 +15477,8 @@ I.SUBMIT_CLASS = "submit-button", I.LOADING_CLASS = "loading-button", I.DISABLED
|
|
15439
15477
|
var ys = I;
|
15440
15478
|
var La = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M27.1 14.313V5.396L24.158 8.34c-2.33-2.325-5.033-3.503-8.11-3.503C9.902 4.837 4.901 9.847 4.899 16c.001 6.152 5.003 11.158 11.15 11.16 4.276 0 9.369-2.227 10.836-8.478l.028-.122h-3.23l-.022.068c-1.078 3.242-4.138 5.421-7.613 5.421a8 8 0 0 1-5.691-2.359A7.993 7.993 0 0 1 8 16.001c0-4.438 3.611-8.049 8.05-8.049 2.069 0 3.638.58 5.924 2.573l-3.792 3.789H27.1z\"/>\n</svg>\n",
|
15441
15479
|
Ia = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>capture</title>\n <path d=\"M0 16q0 3.264 1.28 6.208t3.392 5.12 5.12 3.424 6.208 1.248 6.208-1.248 5.12-3.424 3.392-5.12 1.28-6.208-1.28-6.208-3.392-5.12-5.088-3.392-6.24-1.28q-3.264 0-6.208 1.28t-5.12 3.392-3.392 5.12-1.28 6.208zM4 16q0-3.264 1.6-6.016t4.384-4.352 6.016-1.632 6.016 1.632 4.384 4.352 1.6 6.016-1.6 6.048-4.384 4.352-6.016 1.6-6.016-1.6-4.384-4.352-1.6-6.048z\"></path>\n</svg>\n",
|
15442
|
-
|
15443
|
-
|
15480
|
+
Oa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z\"/>\n</svg>",
|
15481
|
+
Pa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M4.89163 13.2687L9.16582 17.5427L18.7085 8\" stroke=\"#000000\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
|
15444
15482
|
var Ls = /*#__PURE__*/function (_it) {
|
15445
15483
|
// prettier-ignore
|
15446
15484
|
function Ls(e, t, i, s) {
|
@@ -15459,9 +15497,9 @@ var Ls = /*#__PURE__*/function (_it) {
|
|
15459
15497
|
value: function addButtonsAndTheirEvents(e) {
|
15460
15498
|
var t = it.createSVGButton(Ia);
|
15461
15499
|
t.classList.add("modal-svg-camera-button"), t.children[0].classList.add("modal-svg-camera-icon");
|
15462
|
-
var i = this.addCloseButton(
|
15500
|
+
var i = this.addCloseButton(Oa, !0);
|
15463
15501
|
i.classList.add("modal-svg-close-button"), i.children[0].classList.add("modal-svg-close-icon");
|
15464
|
-
var s = it.createSVGButton(
|
15502
|
+
var s = it.createSVGButton(Pa);
|
15465
15503
|
return s.classList.add("modal-svg-submit-button"), this.addButtons(t, s), this.addButtonEvents(t, i, s, e), {
|
15466
15504
|
captureButton: t,
|
15467
15505
|
submitButton: s
|
@@ -15702,7 +15740,7 @@ var Is = /*#__PURE__*/function () {
|
|
15702
15740
|
}();
|
15703
15741
|
var Da = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#loading-validate-key-property{display:inline-block;width:50px;height:50px}#loading-validate-key-property:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:loading-spinner 1.4s linear infinite}#deep-chat-openai-realtime-container{height:100%;width:100%}#deep-chat-openai-realtime-avatar-container{height:60%;width:100%;display:flex;justify-content:center;align-items:center}#deep-chat-openai-realtime-avatar{border-radius:50%;height:110px;border:1px solid rgb(215,215,215);padding:8px;-webkit-user-select:none;user-select:none;margin-top:20px}#deep-chat-openai-realtime-buttons-container{height:40%;display:flex;position:relative}.deep-chat-openai-realtime-button-container{height:100%;width:50%;display:flex;justify-content:center;align-items:center}.deep-chat-openai-realtime-button{width:70px;height:70px;border-radius:50%;display:flex;justify-content:center;align-items:center;cursor:pointer}.deep-chat-openai-realtime-button-default{background-color:#e3e3e3}.deep-chat-openai-realtime-button-default:hover{background-color:#d4d4d4}.deep-chat-openai-realtime-button-default:active{background-color:#c5c5c5}.deep-chat-openai-realtime-button-loading{opacity:.7;pointer-events:none}.deep-chat-openai-realtime-mute-active{background-color:#ffe7e7}.deep-chat-openai-realtime-mute-active:hover{background-color:#ffdede}.deep-chat-openai-realtime-mute-active:active{background-color:#ffd2d2}.deep-chat-openai-realtime-mute>*{height:30px;width:30px}.deep-chat-openai-realtime-mute-active>*{filter:brightness(0) saturate(100%) invert(35%) sepia(60%) saturate(1360%) hue-rotate(325deg) brightness(95%) contrast(92%)}.deep-chat-openai-realtime-toggle>*{height:32px;width:32px;padding-left:3px;filter:brightness(0) saturate(100%) invert(22%) sepia(0%) saturate(4537%) hue-rotate(208deg) brightness(105%) contrast(91%)}.deep-chat-openai-realtime-button-unavailable{opacity:.45;pointer-events:none}#deep-chat-openai-realtime-error{color:red;position:absolute;top:calc(50% + 40px);left:50%;transform:translate(-50%,-50%);font-size:17px}#deep-chat-openai-realtime-loading{position:absolute;font-size:15px;top:50%;left:50%;transform:translate(-50%,-50%)}#insert-key-view{height:100%;position:relative}#insert-key-contents{text-align:center;position:absolute;top:44%;left:50%;transform:translate(-50%,-50%);width:82%;display:flex;max-width:700px}#insert-key-title{margin-bottom:15px}#insert-key-input-container{margin-right:2.7em;width:calc(100% - 80px)}#insert-key-input{padding:.3em 1.7em .3em .3em;border-width:1px;border-style:solid;border-radius:3px;width:100%;font-size:inherit}.insert-key-input-valid{border-color:gray}.insert-key-input-invalid{border-color:red}#visibility-icon-container{position:relative;float:right;cursor:pointer;-webkit-user-select:none;user-select:none}.visibility-icon{filter:brightness(0) saturate(100%) invert(63%) sepia(1%) saturate(9%) hue-rotate(43deg) brightness(98%) contrast(92%);position:absolute;right:-1.7em;top:-1.43em}#visible-icon{top:-1.4em}.visibility-icon:hover{filter:unset}.visibility-icon>*{pointer-events:none}#start-button{border:1px solid grey;color:#454545;border-radius:4px;width:3em;display:flex;justify-content:center;align-items:center;cursor:pointer;padding:.28em .3em;-webkit-user-select:none;user-select:none;background-color:#fff}#start-button:hover{background-color:#f2f2f2}#start-button:active{background-color:#d2d2d2}#insert-key-help-text-container{width:100%;position:absolute;margin-top:32px;margin-bottom:20px}#insert-key-help-text-contents{width:100%;position:absolute}#insert-key-input-invalid-text{display:block;margin-top:1em;margin-bottom:.5em;color:red}.insert-key-input-help-text{display:block;margin-top:16px}#loading-key{display:inline-block;width:16px;height:16px}#loading-key:after{content:\" \";display:block;width:11px;height:11px;margin:1px;border-radius:50%;border:2px solid #0084ff;border-color:#0084ff transparent #0084ff transparent;animation:loading-spinner 1.2s linear infinite}#error-view{color:red;font-size:1.2em;line-height:1.3em;margin-top:-5px;text-align:center;height:100%;display:flex;justify-content:center;align-items:center;padding-left:8px;padding-right:8px}@keyframes loading-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.intro-panel{position:absolute;display:flex;justify-content:center;right:0;bottom:0;left:0;margin:auto;height:fit-content;top:-2.5em}#internal-intro-panel{width:250px;height:min-content;display:block;border-radius:5px;overflow:auto;border:1px solid rgb(203,203,203);padding:10px;max-height:calc(100% - 6.8em)}#internal-intro-panel>p{margin-block-start:.8em;margin-block-end:.8em}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!\n Theme: a11y-dark\n Author: @ericwbailey\n Maintainer: @ericwbailey\n\n Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css\n*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.deep-chat-last-group-messages-active{height:100%}.loading-history-message-full-view{position:absolute;height:70%;width:100%;display:flex;align-items:center}.loading-history-message-small{height:20px;margin-bottom:30px}.loading-history-message-small>div>div{scale:.6}.loading-history-message{margin-top:0;width:100%;max-width:100%;display:flex;justify-content:center;background-color:unset}.loading-history{width:70px}.loading-history div{position:absolute;width:var(--loading-history-width);height:var(--loading-history-height);margin:var(--loading-history-margin);border:var(--loading-history-border);border-radius:50%;animation:loading-spinner 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--loading-history-color) transparent transparent transparent}.loading-history div:nth-child(1){animation-delay:-.45s}.loading-history div:nth-child(2){animation-delay:-.3s}.loading-history div:nth-child(3){animation-delay:-.15s}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.deep-chat-loading-message-dots-container{width:1em;padding:.6em .75em .6em 1.3em}.loading-message-dots{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite linear alternate;animation-delay:.5s}.loading-message-dots:before,.loading-message-dots:after{content:\"\";display:inline-block;position:absolute;top:0}.loading-message-dots:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:0s}.loading-message-dots:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:1s}@keyframes loading-message-dots{0%{background-color:var(--loading-message-color)}50%,to{background-color:var(--loading-message-color-fade)}}.message-bubble>p:first-child{margin-top:0}.message-bubble>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:2}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:1;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.loading-submit-button{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:loading-submit-button 1.5s infinite linear;bottom:-.75em}@keyframes loading-submit-button{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button:hover,.input-button:focus-visible{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.loading-button{cursor:auto}.loading-button:hover{background-color:unset}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}[contenteditable]:empty:before{content:attr(deep-chat-placeholder-text);pointer-events:none}[contenteditable][textcolor]:empty:before{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative;margin-right:.56em}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}.dropup-menu-item-text{margin-top:.08em;width:max-content}.dropup-menu-item-disabled>div{pointer-events:none}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}.deep-chat-web-model-button{margin-top:10px;margin-bottom:5px;margin-left:1px}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}";
|
15704
15742
|
var Ba = Object.defineProperty,
|
15705
|
-
|
15743
|
+
w = function w(n, e, t, i) {
|
15706
15744
|
for (var s = void 0, r = n.length - 1, o; r >= 0; r--) (o = n[r]) && (s = o(e, t, s) || s);
|
15707
15745
|
return s && Ba(e, t, s), s;
|
15708
15746
|
};
|
@@ -15745,47 +15783,47 @@ var S = /*#__PURE__*/function (_os) {
|
|
15745
15783
|
}
|
15746
15784
|
}]);
|
15747
15785
|
}(os);
|
15748
|
-
|
15749
|
-
|
15750
|
-
|
15751
|
-
|
15752
|
-
|
15753
|
-
|
15754
|
-
|
15755
|
-
|
15756
|
-
|
15757
|
-
|
15758
|
-
|
15759
|
-
|
15760
|
-
|
15761
|
-
|
15762
|
-
|
15763
|
-
|
15764
|
-
|
15765
|
-
|
15766
|
-
|
15767
|
-
|
15768
|
-
|
15769
|
-
|
15770
|
-
|
15771
|
-
|
15772
|
-
|
15773
|
-
|
15774
|
-
|
15775
|
-
|
15776
|
-
|
15777
|
-
|
15778
|
-
|
15779
|
-
|
15780
|
-
|
15781
|
-
|
15782
|
-
|
15783
|
-
|
15784
|
-
|
15785
|
-
|
15786
|
-
|
15787
|
-
|
15788
|
-
|
15789
|
-
|
15786
|
+
w([x("object")], S.prototype, "connect");
|
15787
|
+
w([x("object")], S.prototype, "directConnection");
|
15788
|
+
w([x("object")], S.prototype, "webModel");
|
15789
|
+
w([x("object")], S.prototype, "requestBodyLimits");
|
15790
|
+
w([x("function")], S.prototype, "requestInterceptor");
|
15791
|
+
w([x("function")], S.prototype, "responseInterceptor");
|
15792
|
+
w([x("function")], S.prototype, "validateInput");
|
15793
|
+
w([x("function")], S.prototype, "loadHistory");
|
15794
|
+
w([x("object")], S.prototype, "chatStyle");
|
15795
|
+
w([x("object")], S.prototype, "attachmentContainerStyle");
|
15796
|
+
w([x("object")], S.prototype, "dropupStyles");
|
15797
|
+
w([x("object")], S.prototype, "inputAreaStyle");
|
15798
|
+
w([x("object")], S.prototype, "textInput");
|
15799
|
+
w([x("object")], S.prototype, "submitButtonStyles");
|
15800
|
+
w([x("object")], S.prototype, "customButtons");
|
15801
|
+
w([x("string")], S.prototype, "auxiliaryStyle");
|
15802
|
+
w([x("array")], S.prototype, "history");
|
15803
|
+
w([x("object")], S.prototype, "introMessage");
|
15804
|
+
w([x("object")], S.prototype, "avatars");
|
15805
|
+
w([x("object")], S.prototype, "names");
|
15806
|
+
w([x("object")], S.prototype, "displayLoadingBubble");
|
15807
|
+
w([x("object")], S.prototype, "errorMessages");
|
15808
|
+
w([x("object")], S.prototype, "messageStyles");
|
15809
|
+
w([x("object")], S.prototype, "textToSpeech");
|
15810
|
+
w([x("object")], S.prototype, "speechToText");
|
15811
|
+
w([x("object")], S.prototype, "images");
|
15812
|
+
w([x("object")], S.prototype, "gifs");
|
15813
|
+
w([x("object")], S.prototype, "camera");
|
15814
|
+
w([x("object")], S.prototype, "audio");
|
15815
|
+
w([x("object")], S.prototype, "microphone");
|
15816
|
+
w([x("object")], S.prototype, "mixedFiles");
|
15817
|
+
w([x("object")], S.prototype, "dragAndDrop");
|
15818
|
+
w([x("object")], S.prototype, "introPanelStyle");
|
15819
|
+
w([x("object")], S.prototype, "htmlClassUtilities");
|
15820
|
+
w([x("object")], S.prototype, "remarkable");
|
15821
|
+
w([x("object")], S.prototype, "focusMode");
|
15822
|
+
w([x("function")], S.prototype, "onMessage");
|
15823
|
+
w([x("function")], S.prototype, "onClearMessages");
|
15824
|
+
w([x("function")], S.prototype, "onComponentRender");
|
15825
|
+
w([x("function")], S.prototype, "onError");
|
15826
|
+
w([x("object")], S.prototype, "demo");
|
15827
|
+
w([x("object")], S.prototype, "_insertKeyViewStyles");
|
15790
15828
|
customElements.define("deep-chat", S);
|
15791
15829
|
export { S as DeepChat };
|