deep-chat-dev 9.0.34 → 9.0.36
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/README.md +6 -3
- package/custom-elements.json +4804 -4763
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.d.ts +0 -1
- package/dist/deepChat.d.ts.map +1 -1
- package/dist/deepChat.js +819 -806
- package/dist/services/huggingFace/huggingFaceAudioClassificationIO.d.ts.map +1 -1
- package/dist/services/huggingFace/huggingFaceFileIO.d.ts.map +1 -1
- package/dist/services/utils/baseServiceIO.d.ts.map +1 -1
- package/dist/services/utils/messageLimitUtils.d.ts +1 -3
- package/dist/services/utils/messageLimitUtils.d.ts.map +1 -1
- package/dist/types/messageFile.d.ts.map +1 -1
- package/dist/types/messages.d.ts +5 -9
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/utils/HTTP/websocket.d.ts.map +1 -1
- package/dist/utils/demo/demo.d.ts +0 -1
- package/dist/utils/demo/demo.d.ts.map +1 -1
- package/dist/utils/element/styleUtils.d.ts +1 -0
- package/dist/utils/element/styleUtils.d.ts.map +1 -1
- package/dist/utils/legacy/legacy.d.ts +8 -0
- package/dist/utils/legacy/legacy.d.ts.map +1 -0
- package/dist/utils/webComponent/webComponentStyleUtils.d.ts +2 -0
- package/dist/utils/webComponent/webComponentStyleUtils.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/submit/submitButton.d.ts +1 -0
- package/dist/views/chat/input/buttons/submit/submitButton.d.ts.map +1 -1
- package/dist/views/chat/messages/fileMessageUtils.d.ts +1 -2
- package/dist/views/chat/messages/fileMessageUtils.d.ts.map +1 -1
- package/dist/views/chat/messages/fileMessages.d.ts +5 -4
- package/dist/views/chat/messages/fileMessages.d.ts.map +1 -1
- package/dist/views/chat/messages/html/htmlMessages.d.ts +1 -2
- package/dist/views/chat/messages/html/htmlMessages.d.ts.map +1 -1
- package/dist/views/chat/messages/messages.d.ts +8 -15
- package/dist/views/chat/messages/messages.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -7,7 +7,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
7
7
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
8
8
|
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
9
9
|
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
10
|
-
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
10
|
+
function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
|
11
11
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
12
12
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
13
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
@@ -69,37 +69,6 @@ var ValidateKeyPropertyView = /*#__PURE__*/function () {
|
|
69
69
|
}]);
|
70
70
|
return ValidateKeyPropertyView;
|
71
71
|
}();
|
72
|
-
var WebComponentStyleUtils = /*#__PURE__*/function () {
|
73
|
-
function WebComponentStyleUtils() {
|
74
|
-
_classCallCheck(this, WebComponentStyleUtils);
|
75
|
-
}
|
76
|
-
_createClass(WebComponentStyleUtils, null, [{
|
77
|
-
key: "apply",
|
78
|
-
value: function apply(e, t) {
|
79
|
-
if (t) try {
|
80
|
-
WebComponentStyleUtils.applyStyleSheet(e, t);
|
81
|
-
} catch (_unused) {
|
82
|
-
WebComponentStyleUtils.addStyleElement(e, t);
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}, {
|
86
|
-
key: "applyStyleSheet",
|
87
|
-
value: function applyStyleSheet(e, t) {
|
88
|
-
var n = new CSSStyleSheet();
|
89
|
-
n.replaceSync(e), t.adoptedStyleSheets.push(n);
|
90
|
-
}
|
91
|
-
}, {
|
92
|
-
key: "addStyleElement",
|
93
|
-
value: function addStyleElement(e, t) {
|
94
|
-
var n = document.createElement("style");
|
95
|
-
n.innerHTML = e, t.appendChild(n);
|
96
|
-
}
|
97
|
-
}]);
|
98
|
-
return WebComponentStyleUtils;
|
99
|
-
}();
|
100
|
-
var KEYBOARD_KEY = /* @__PURE__ */function (r) {
|
101
|
-
return r.ESCAPE = "Escape", r.ENTER = "Enter", r.TAB = "Tab", r.ARROW_UP = "ArrowUp", r.ARROW_DOWN = "ArrowDown", r.ARROW_RIGHT = "ArrowRight", r.ARROW_LEFT = "ArrowLeft", r.BACKSPACE = "Backspace", r.DELETE = "Delete", r.META = "Meta", r.CONTROL = "Control", r;
|
102
|
-
}(KEYBOARD_KEY || {});
|
103
72
|
var StyleUtils = /*#__PURE__*/function () {
|
104
73
|
function StyleUtils() {
|
105
74
|
_classCallCheck(this, StyleUtils);
|
@@ -155,9 +124,63 @@ var StyleUtils = /*#__PURE__*/function () {
|
|
155
124
|
t.style[s] && (o = e["default"]) != null && o[s] && (e["default"][n] = t.style[s]);
|
156
125
|
});
|
157
126
|
}
|
127
|
+
}, {
|
128
|
+
key: "applyToStyleIfNotDefined",
|
129
|
+
value: function applyToStyleIfNotDefined(e, t) {
|
130
|
+
for (var n in t) {
|
131
|
+
var s = t[n];
|
132
|
+
e[n] === "" && s && (e[n] = s);
|
133
|
+
}
|
134
|
+
}
|
158
135
|
}]);
|
159
136
|
return StyleUtils;
|
160
137
|
}();
|
138
|
+
var _WebComponentStyleUtils = /*#__PURE__*/function () {
|
139
|
+
function D() {
|
140
|
+
_classCallCheck(this, D);
|
141
|
+
}
|
142
|
+
_createClass(D, null, [{
|
143
|
+
key: "apply",
|
144
|
+
value: function apply(e, t) {
|
145
|
+
if (t) try {
|
146
|
+
D.applyStyleSheet(e, t);
|
147
|
+
} catch (_unused) {
|
148
|
+
D.addStyleElement(e, t);
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}, {
|
152
|
+
key: "applyStyleSheet",
|
153
|
+
value: function applyStyleSheet(e, t) {
|
154
|
+
var n = new CSSStyleSheet();
|
155
|
+
n.replaceSync(e), t.adoptedStyleSheets.push(n);
|
156
|
+
}
|
157
|
+
}, {
|
158
|
+
key: "addStyleElement",
|
159
|
+
value: function addStyleElement(e, t) {
|
160
|
+
var n = document.createElement("style");
|
161
|
+
n.innerHTML = e, t.appendChild(n);
|
162
|
+
}
|
163
|
+
}, {
|
164
|
+
key: "applyDefaultStyleToComponent",
|
165
|
+
value: function applyDefaultStyleToComponent(e) {
|
166
|
+
StyleUtils.applyToStyleIfNotDefined(e, D.DEFAULT_COMPONENT_STYLE);
|
167
|
+
}
|
168
|
+
}]);
|
169
|
+
return D;
|
170
|
+
}();
|
171
|
+
_WebComponentStyleUtils.DEFAULT_COMPONENT_STYLE = {
|
172
|
+
height: "350px",
|
173
|
+
width: "320px",
|
174
|
+
border: "1px solid #cacaca",
|
175
|
+
fontFamily: "'Inter', sans-serif, Avenir, Helvetica, Arial",
|
176
|
+
fontSize: "0.9rem",
|
177
|
+
backgroundColor: "white",
|
178
|
+
position: "relative"
|
179
|
+
};
|
180
|
+
var WebComponentStyleUtils = _WebComponentStyleUtils;
|
181
|
+
var KEYBOARD_KEY = /* @__PURE__ */function (r) {
|
182
|
+
return r.ESCAPE = "Escape", r.ENTER = "Enter", r.TAB = "Tab", r.ARROW_UP = "ArrowUp", r.ARROW_DOWN = "ArrowDown", r.ARROW_RIGHT = "ArrowRight", r.ARROW_LEFT = "ArrowLeft", r.BACKSPACE = "Backspace", r.DELETE = "Delete", r.META = "Meta", r.CONTROL = "Control", r;
|
183
|
+
}(KEYBOARD_KEY || {});
|
161
184
|
var Browser$1 = /*#__PURE__*/_createClass(function Browser$1() {
|
162
185
|
_classCallCheck(this, Browser$1);
|
163
186
|
});
|
@@ -179,13 +202,13 @@ var PasteUtils = /*#__PURE__*/function () {
|
|
179
202
|
return PasteUtils;
|
180
203
|
}();
|
181
204
|
var _InputLimit = /*#__PURE__*/function () {
|
182
|
-
function
|
183
|
-
_classCallCheck(this,
|
205
|
+
function P() {
|
206
|
+
_classCallCheck(this, P);
|
184
207
|
}
|
185
|
-
_createClass(
|
208
|
+
_createClass(P, null, [{
|
186
209
|
key: "add",
|
187
210
|
value: function add(e, t) {
|
188
|
-
e.addEventListener("keydown",
|
211
|
+
e.addEventListener("keydown", P.onKeyDown.bind(this, t)), e.oninput = P.onInput.bind(this, t);
|
189
212
|
}
|
190
213
|
// preventing insertion early for a nicer UX
|
191
214
|
// prettier-ignore
|
@@ -193,7 +216,7 @@ var _InputLimit = /*#__PURE__*/function () {
|
|
193
216
|
key: "onKeyDown",
|
194
217
|
value: function onKeyDown(e, t) {
|
195
218
|
var s = t.target.textContent;
|
196
|
-
s && s.length >= e && !
|
219
|
+
s && s.length >= e && !P.PERMITTED_KEYS.has(t.key) && !P.isKeyCombinationPermitted(t) && t.preventDefault();
|
197
220
|
}
|
198
221
|
}, {
|
199
222
|
key: "isKeyCombinationPermitted",
|
@@ -209,29 +232,29 @@ var _InputLimit = /*#__PURE__*/function () {
|
|
209
232
|
s && s.length > e && (n.textContent = s.substring(0, e), FocusUtils.focusEndOfInput(n));
|
210
233
|
}
|
211
234
|
}]);
|
212
|
-
return
|
235
|
+
return P;
|
213
236
|
}();
|
214
237
|
_InputLimit.PERMITTED_KEYS = /* @__PURE__ */new Set([KEYBOARD_KEY.BACKSPACE, KEYBOARD_KEY.DELETE, KEYBOARD_KEY.ARROW_RIGHT, KEYBOARD_KEY.ARROW_LEFT, KEYBOARD_KEY.ARROW_DOWN, KEYBOARD_KEY.ARROW_UP, KEYBOARD_KEY.META, KEYBOARD_KEY.CONTROL, KEYBOARD_KEY.ENTER]);
|
215
238
|
var InputLimit = _InputLimit;
|
216
239
|
var _TextInputEl = /*#__PURE__*/function () {
|
217
|
-
function
|
218
|
-
_classCallCheck(this,
|
240
|
+
function R(e, t) {
|
241
|
+
_classCallCheck(this, R);
|
219
242
|
var s;
|
220
|
-
var n =
|
221
|
-
this.elementRef =
|
243
|
+
var n = R.processConfig(e, t);
|
244
|
+
this.elementRef = R.createContainerElement((s = n == null ? void 0 : n.styles) == null ? void 0 : s.container), this.inputElementRef = this.createInputElement(n), this._config = n, this.elementRef.appendChild(this.inputElementRef), t != null && t.characterLimit && InputLimit.add(this.inputElementRef, t == null ? void 0 : t.characterLimit);
|
222
245
|
}
|
223
|
-
_createClass(
|
246
|
+
_createClass(R, [{
|
224
247
|
key: "createInputElement",
|
225
248
|
value: function createInputElement(e) {
|
226
249
|
var n, s, o;
|
227
250
|
var t = document.createElement("div");
|
228
|
-
return t.id =
|
251
|
+
return t.id = R.TEXT_INPUT_ID, t.classList.add("text-input-styling", "text-input-placeholder"), t.innerText = ((n = e == null ? void 0 : e.placeholder) == null ? void 0 : n.text) || "Ask me anything!", Browser$1.IS_CHROMIUM && R.preventAutomaticScrollUpOnNewLine(t), typeof (e == null ? void 0 : e.disabled) == "boolean" && e.disabled === !0 ? (t.contentEditable = "false", t.classList.add("text-input-disabled")) : (t.contentEditable = "true", this.addEventListeners(t, e)), Object.assign(t.style, (s = e == null ? void 0 : e.styles) == null ? void 0 : s.text), Object.assign(t.style, (o = e == null ? void 0 : e.placeholder) == null ? void 0 : o.style), t;
|
229
252
|
}
|
230
253
|
}, {
|
231
254
|
key: "removeTextIfPlaceholder",
|
232
255
|
value: function removeTextIfPlaceholder() {
|
233
256
|
var e, t, n, s;
|
234
|
-
this.inputElementRef.classList.contains("text-input-placeholder") && !this.inputElementRef.classList.contains("text-input-disabled") && ((e = this._config.placeholder) != null && e.style && (StyleUtils.unsetStyle(this.inputElementRef, (t = this._config.placeholder) == null ? void 0 : t.style), Object.assign(this.inputElementRef.style, (s = (n = this._config) == null ? void 0 : n.styles) == null ? void 0 : s.text)),
|
257
|
+
this.inputElementRef.classList.contains("text-input-placeholder") && !this.inputElementRef.classList.contains("text-input-disabled") && ((e = this._config.placeholder) != null && e.style && (StyleUtils.unsetStyle(this.inputElementRef, (t = this._config.placeholder) == null ? void 0 : t.style), Object.assign(this.inputElementRef.style, (s = (n = this._config) == null ? void 0 : n.styles) == null ? void 0 : s.text)), R.clear(this.inputElementRef), this.inputElementRef.classList.remove("text-input-placeholder"));
|
235
258
|
}
|
236
259
|
}, {
|
237
260
|
key: "addEventListeners",
|
@@ -303,7 +326,7 @@ var _TextInputEl = /*#__PURE__*/function () {
|
|
303
326
|
return t.id = "text-input-container", Object.assign(t.style, e), t;
|
304
327
|
}
|
305
328
|
}]);
|
306
|
-
return
|
329
|
+
return R;
|
307
330
|
}();
|
308
331
|
_TextInputEl.TEXT_INPUT_ID = "text-input";
|
309
332
|
var TextInputEl = _TextInputEl;
|
@@ -346,10 +369,10 @@ var ErrorMessages = {
|
|
346
369
|
INVALID_STREAM_RESPONSE: "Make sure the events are using the Response format: https://deepchat.dev/docs/connect/#Response \nYou can also augment them using the responseInterceptor property: https://deepchat.dev/docs/interceptors#responseInterceptor"
|
347
370
|
},
|
348
371
|
_RequestUtils = /*#__PURE__*/function () {
|
349
|
-
function
|
350
|
-
_classCallCheck(this,
|
372
|
+
function B() {
|
373
|
+
_classCallCheck(this, B);
|
351
374
|
}
|
352
|
-
_createClass(
|
375
|
+
_createClass(B, null, [{
|
353
376
|
key: "temporarilyRemoveHeader",
|
354
377
|
value: // need to pass stringifyBody boolean separately as binding is throwing an error for some reason
|
355
378
|
// prettier-ignore
|
@@ -365,12 +388,12 @@ var ErrorMessages = {
|
|
365
388
|
}
|
366
389
|
throw new Error("Request settings have not been set up");
|
367
390
|
case 2:
|
368
|
-
s = e.headers[
|
369
|
-
delete e.headers[
|
391
|
+
s = e.headers[B.CONTENT_TYPE];
|
392
|
+
delete e.headers[B.CONTENT_TYPE];
|
370
393
|
_context.next = 6;
|
371
394
|
return t(n);
|
372
395
|
case 6:
|
373
|
-
e.headers[
|
396
|
+
e.headers[B.CONTENT_TYPE] = s;
|
374
397
|
case 7:
|
375
398
|
case "end":
|
376
399
|
return _context.stop();
|
@@ -438,7 +461,7 @@ var ErrorMessages = {
|
|
438
461
|
return e && _typeof(e) == "object" && (typeof e.error == "string" || typeof e.text == "string" || typeof e.html == "string" || _typeof(e.files) == "object");
|
439
462
|
}
|
440
463
|
}]);
|
441
|
-
return
|
464
|
+
return B;
|
442
465
|
}();
|
443
466
|
_RequestUtils.CONTENT_TYPE = "Content-Type";
|
444
467
|
var RequestUtils = _RequestUtils;
|
@@ -446,29 +469,29 @@ function getBytes(_x6, _x7) {
|
|
446
469
|
return _getBytes.apply(this, arguments);
|
447
470
|
}
|
448
471
|
function _getBytes() {
|
449
|
-
_getBytes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
472
|
+
_getBytes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(r, e) {
|
450
473
|
var t, n;
|
451
|
-
return _regeneratorRuntime().wrap(function
|
452
|
-
while (1) switch (
|
474
|
+
return _regeneratorRuntime().wrap(function _callee75$(_context75) {
|
475
|
+
while (1) switch (_context75.prev = _context75.next) {
|
453
476
|
case 0:
|
454
477
|
t = r.getReader();
|
455
478
|
case 1:
|
456
|
-
|
479
|
+
_context75.next = 3;
|
457
480
|
return t.read();
|
458
481
|
case 3:
|
459
|
-
if ((n =
|
460
|
-
|
482
|
+
if ((n = _context75.sent).done) {
|
483
|
+
_context75.next = 7;
|
461
484
|
break;
|
462
485
|
}
|
463
486
|
e(n.value);
|
464
487
|
case 5:
|
465
|
-
|
488
|
+
_context75.next = 1;
|
466
489
|
break;
|
467
490
|
case 7:
|
468
491
|
case "end":
|
469
|
-
return
|
492
|
+
return _context75.stop();
|
470
493
|
}
|
471
|
-
},
|
494
|
+
}, _callee75);
|
472
495
|
}));
|
473
496
|
return _getBytes.apply(this, arguments);
|
474
497
|
}
|
@@ -483,19 +506,19 @@ function getLines(r) {
|
|
483
506
|
var c = 0;
|
484
507
|
for (; t < l;) {
|
485
508
|
s && (e[t] === 10 && (c = ++t), s = !1);
|
486
|
-
var
|
487
|
-
for (; t < l &&
|
509
|
+
var d = -1;
|
510
|
+
for (; t < l && d === -1; ++t) switch (e[t]) {
|
488
511
|
case 58:
|
489
512
|
n === -1 && (n = t - c);
|
490
513
|
break;
|
491
514
|
case 13:
|
492
515
|
s = !0;
|
493
516
|
case 10:
|
494
|
-
|
517
|
+
d = t;
|
495
518
|
break;
|
496
519
|
}
|
497
|
-
if (
|
498
|
-
r(e.subarray(c,
|
520
|
+
if (d === -1) break;
|
521
|
+
r(e.subarray(c, d), n), c = t, n = -1;
|
499
522
|
}
|
500
523
|
c === l ? e = void 0 : c !== 0 && (e = e.subarray(c), t -= c);
|
501
524
|
};
|
@@ -506,20 +529,20 @@ function getMessages(r, e, t) {
|
|
506
529
|
return function (a, l) {
|
507
530
|
if (a.length === 0) t == null || t(n), n = newMessage();else if (l > 0) {
|
508
531
|
var c = s.decode(a.subarray(0, l)),
|
509
|
-
|
510
|
-
|
532
|
+
d = l + (a[l + 1] === 32 ? 2 : 1),
|
533
|
+
u = s.decode(a.subarray(d));
|
511
534
|
switch (c) {
|
512
535
|
case "data":
|
513
|
-
n.data = n.data ? n.data + "\n" +
|
536
|
+
n.data = n.data ? n.data + "\n" + u : u;
|
514
537
|
break;
|
515
538
|
case "event":
|
516
|
-
n.event =
|
539
|
+
n.event = u;
|
517
540
|
break;
|
518
541
|
case "id":
|
519
|
-
r(n.id =
|
542
|
+
r(n.id = u);
|
520
543
|
break;
|
521
544
|
case "retry":
|
522
|
-
var h = parseInt(
|
545
|
+
var h = parseInt(u, 10);
|
523
546
|
isNaN(h) || e(n.retry = h);
|
524
547
|
break;
|
525
548
|
}
|
@@ -555,8 +578,8 @@ function fetchEventSource(r, e) {
|
|
555
578
|
a = e.onclose,
|
556
579
|
l = e.onerror,
|
557
580
|
c = e.openWhenHidden,
|
558
|
-
|
559
|
-
|
581
|
+
d = e.fetch,
|
582
|
+
u = __rest(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
560
583
|
return new Promise(function (h, f) {
|
561
584
|
var p = Object.assign({}, n);
|
562
585
|
p.accept || (p.accept = EventStreamContentType);
|
@@ -573,34 +596,34 @@ function fetchEventSource(r, e) {
|
|
573
596
|
t == null || t.addEventListener("abort", function () {
|
574
597
|
y(), h();
|
575
598
|
});
|
576
|
-
var S =
|
577
|
-
|
599
|
+
var S = d !== null && d !== void 0 ? d : window.fetch,
|
600
|
+
_ = s !== null && s !== void 0 ? s : defaultOnOpen;
|
578
601
|
function E() {
|
579
602
|
return _E.apply(this, arguments);
|
580
603
|
}
|
581
604
|
function _E() {
|
582
605
|
_E = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
583
|
-
var
|
606
|
+
var I, w, x;
|
584
607
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
585
608
|
while (1) switch (_context3.prev = _context3.next) {
|
586
609
|
case 0:
|
587
610
|
b = new AbortController();
|
588
611
|
_context3.prev = 1;
|
589
612
|
_context3.next = 4;
|
590
|
-
return S(r, Object.assign(Object.assign({},
|
613
|
+
return S(r, Object.assign(Object.assign({}, u), {
|
591
614
|
headers: p,
|
592
615
|
signal: b.signal
|
593
616
|
}));
|
594
617
|
case 4:
|
595
618
|
w = _context3.sent;
|
596
619
|
_context3.next = 7;
|
597
|
-
return
|
620
|
+
return _(w);
|
598
621
|
case 7:
|
599
622
|
_context3.next = 9;
|
600
|
-
return getBytes(w.body, getLines(getMessages(function (
|
601
|
-
|
602
|
-
}, function (
|
603
|
-
g =
|
623
|
+
return getBytes(w.body, getLines(getMessages(function (x) {
|
624
|
+
x ? p[LastEventId] = x : delete p[LastEventId];
|
625
|
+
}, function (x) {
|
626
|
+
g = x;
|
604
627
|
}, o)));
|
605
628
|
case 9:
|
606
629
|
a == null || a();
|
@@ -612,10 +635,10 @@ function fetchEventSource(r, e) {
|
|
612
635
|
_context3.prev = 14;
|
613
636
|
_context3.t0 = _context3["catch"](1);
|
614
637
|
if (!b.signal.aborted) try {
|
615
|
-
|
616
|
-
window.clearTimeout(v), v = window.setTimeout(E,
|
617
|
-
} catch (
|
618
|
-
y(), f(
|
638
|
+
x = (I = l == null ? void 0 : l(_context3.t0)) !== null && I !== void 0 ? I : g;
|
639
|
+
window.clearTimeout(v), v = window.setTimeout(E, x);
|
640
|
+
} catch (x) {
|
641
|
+
y(), f(x);
|
619
642
|
}
|
620
643
|
case 17:
|
621
644
|
case "end":
|
@@ -633,29 +656,23 @@ function defaultOnOpen(r) {
|
|
633
656
|
if (!(e != null && e.startsWith(EventStreamContentType))) throw new Error("Expected content-type to be ".concat(EventStreamContentType, ", Actual: ").concat(e));
|
634
657
|
}
|
635
658
|
var _Demo = /*#__PURE__*/function () {
|
636
|
-
function
|
637
|
-
_classCallCheck(this,
|
659
|
+
function N() {
|
660
|
+
_classCallCheck(this, N);
|
638
661
|
}
|
639
|
-
_createClass(
|
640
|
-
key: "generateResponseForOneMessage",
|
641
|
-
value: function generateResponseForOneMessage(e) {
|
642
|
-
if (e.file) return e.file.type === "image" ? "That is a nice image!" : e.file.type === "audio" ? "I like the sound of that!" : e.file.type === "gif" ? "That is a nice gif!" : "That is an interesting file!";
|
643
|
-
if (e.text) {
|
644
|
-
if (e.text.charAt(e.text.length - 1) === "?") return "I'm sorry but I can't answer that question...";
|
645
|
-
if (e.text.includes("updog")) return "What's updog?";
|
646
|
-
}
|
647
|
-
return "Hi there! This is a demo response!";
|
648
|
-
}
|
649
|
-
}, {
|
662
|
+
_createClass(N, null, [{
|
650
663
|
key: "generateResponse",
|
651
664
|
value: function generateResponse(e) {
|
652
|
-
var t = [];
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
return
|
657
|
-
}
|
658
|
-
|
665
|
+
var t = e.messages[e.messages.length - 1];
|
666
|
+
if (t.files && t.files.length > 0) {
|
667
|
+
if (t.files.length > 1) return "These are interesting files!";
|
668
|
+
var n = t.files[0];
|
669
|
+
return n.src && n.src.startsWith("data:image/gif") ? "That is a nice gif!" : n.type === "image" ? "That is a nice image!" : n.type === "audio" ? "I like the sound of that!" : "That is an interesting file!";
|
670
|
+
}
|
671
|
+
if (t.text) {
|
672
|
+
if (t.text.charAt(t.text.length - 1) === "?") return "I'm sorry but I can't answer that question...";
|
673
|
+
if (t.text.includes("updog")) return "What's updog?";
|
674
|
+
}
|
675
|
+
return "Hi there! This is a demo response!";
|
659
676
|
}
|
660
677
|
}, {
|
661
678
|
key: "getCustomResponse",
|
@@ -665,15 +682,15 @@ var _Demo = /*#__PURE__*/function () {
|
|
665
682
|
}, {
|
666
683
|
key: "getResponse",
|
667
684
|
value: function getResponse(e) {
|
668
|
-
return e.customDemoResponse ?
|
669
|
-
text:
|
685
|
+
return e.customDemoResponse ? N.getCustomResponse(e.customDemoResponse, e.messages[e.messages.length - 1]) : {
|
686
|
+
text: N.generateResponse(e)
|
670
687
|
};
|
671
688
|
}
|
672
689
|
// timeout is used to simulate a timeout for a response to come back
|
673
690
|
}, {
|
674
691
|
key: "request",
|
675
692
|
value: function request(e, t, n) {
|
676
|
-
var s =
|
693
|
+
var s = N.getResponse(e);
|
677
694
|
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
678
695
|
var o;
|
679
696
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
@@ -690,7 +707,7 @@ var _Demo = /*#__PURE__*/function () {
|
|
690
707
|
_context4.t0 = s;
|
691
708
|
case 5:
|
692
709
|
o = _context4.t0;
|
693
|
-
o.error ? e.addNewErrorMessage("service", o.error) : e.addNewMessage(o, !0
|
710
|
+
o.error ? e.addNewErrorMessage("service", o.error) : e.addNewMessage(o, !0), t();
|
694
711
|
case 7:
|
695
712
|
case "end":
|
696
713
|
return _context4.stop();
|
@@ -704,12 +721,12 @@ var _Demo = /*#__PURE__*/function () {
|
|
704
721
|
value: function requestStream(e, t) {
|
705
722
|
setTimeout(function () {
|
706
723
|
var s;
|
707
|
-
var n = (s =
|
724
|
+
var n = (s = N.getResponse(e)) == null ? void 0 : s.text;
|
708
725
|
Stream.simulate(e, t, n);
|
709
726
|
}, 400);
|
710
727
|
}
|
711
728
|
}]);
|
712
|
-
return
|
729
|
+
return N;
|
713
730
|
}();
|
714
731
|
_Demo.URL = "deep-chat-demo";
|
715
732
|
var Demo = _Demo;
|
@@ -734,8 +751,8 @@ var Stream = /*#__PURE__*/function () {
|
|
734
751
|
l,
|
735
752
|
c,
|
736
753
|
_e$streamHandlers,
|
737
|
-
u,
|
738
754
|
d,
|
755
|
+
u,
|
739
756
|
h,
|
740
757
|
f,
|
741
758
|
_args6 = arguments;
|
@@ -755,14 +772,14 @@ var Stream = /*#__PURE__*/function () {
|
|
755
772
|
l = _yield$RequestUtils$p.headers;
|
756
773
|
c = _yield$RequestUtils$p.error;
|
757
774
|
_e$streamHandlers = e.streamHandlers;
|
758
|
-
|
759
|
-
|
775
|
+
d = _e$streamHandlers.onOpen;
|
776
|
+
u = _e$streamHandlers.onClose;
|
760
777
|
h = _e$streamHandlers.abortStream;
|
761
778
|
if (!c) {
|
762
779
|
_context6.next = 14;
|
763
780
|
break;
|
764
781
|
}
|
765
|
-
return _context6.abrupt("return", Stream.onInterceptorError(n, c,
|
782
|
+
return _context6.abrupt("return", Stream.onInterceptorError(n, c, u));
|
766
783
|
case 14:
|
767
784
|
if (!((b = e.requestSettings) != null && b.handler)) {
|
768
785
|
_context6.next = 16;
|
@@ -792,7 +809,7 @@ var Stream = /*#__PURE__*/function () {
|
|
792
809
|
_context5.next = 2;
|
793
810
|
break;
|
794
811
|
}
|
795
|
-
return _context5.abrupt("return", (f = n.addNewStreamedMessage(),
|
812
|
+
return _context5.abrupt("return", (f = n.addNewStreamedMessage(), d()));
|
796
813
|
case 2:
|
797
814
|
_context5.next = 4;
|
798
815
|
return RequestUtils.processResponseByType(y);
|
@@ -808,8 +825,8 @@ var Stream = /*#__PURE__*/function () {
|
|
808
825
|
onmessage: function onmessage(y) {
|
809
826
|
var S;
|
810
827
|
if (JSON.stringify(y.data) !== JSON.stringify("[DONE]")) {
|
811
|
-
var
|
812
|
-
(S = e.extractResultData) == null || S.call(e,
|
828
|
+
var _ = JSON.parse(y.data);
|
829
|
+
(S = e.extractResultData) == null || S.call(e, _).then(function (E) {
|
813
830
|
(E == null ? void 0 : E.text) === void 0 ? console.error("Response data: ".concat(y.data, " \n ").concat(ErrorMessages.INVALID_STREAM_RESPONSE)) : f && n.updateStreamedMessage(E.text, f);
|
814
831
|
})["catch"](function (E) {
|
815
832
|
return RequestUtils.displayError(n, E);
|
@@ -817,18 +834,18 @@ var Stream = /*#__PURE__*/function () {
|
|
817
834
|
}
|
818
835
|
},
|
819
836
|
onerror: function onerror(y) {
|
820
|
-
throw
|
837
|
+
throw u(), y;
|
821
838
|
},
|
822
839
|
onclose: function onclose() {
|
823
|
-
n.finaliseStreamedMessage(),
|
840
|
+
n.finaliseStreamedMessage(), u();
|
824
841
|
},
|
825
842
|
signal: h.signal
|
826
843
|
})["catch"](function (y) {
|
827
844
|
var S;
|
828
845
|
(S = e.extractResultData) == null || S.call(e, y).then(function () {
|
829
846
|
RequestUtils.displayError(n, y);
|
830
|
-
})["catch"](function (
|
831
|
-
RequestUtils.displayError(n,
|
847
|
+
})["catch"](function (_) {
|
848
|
+
RequestUtils.displayError(n, _);
|
832
849
|
});
|
833
850
|
});
|
834
851
|
case 20:
|
@@ -893,8 +910,8 @@ var CustomHandler = /*#__PURE__*/function () {
|
|
893
910
|
case 0:
|
894
911
|
s = !0;
|
895
912
|
o = /*#__PURE__*/function () {
|
896
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(
|
897
|
-
var h, f,
|
913
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(d) {
|
914
|
+
var h, f, u;
|
898
915
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
899
916
|
while (1) switch (_context7.prev = _context7.next) {
|
900
917
|
case 0:
|
@@ -906,17 +923,17 @@ var CustomHandler = /*#__PURE__*/function () {
|
|
906
923
|
case 2:
|
907
924
|
s = !1;
|
908
925
|
_context7.next = 5;
|
909
|
-
return (f = (h = e.deepChat).responseInterceptor) == null ? void 0 : f.call(h,
|
926
|
+
return (f = (h = e.deepChat).responseInterceptor) == null ? void 0 : f.call(h, d);
|
910
927
|
case 5:
|
911
928
|
_context7.t0 = _context7.sent;
|
912
929
|
if (_context7.t0) {
|
913
930
|
_context7.next = 8;
|
914
931
|
break;
|
915
932
|
}
|
916
|
-
_context7.t0 =
|
933
|
+
_context7.t0 = d;
|
917
934
|
case 8:
|
918
|
-
|
919
|
-
RequestUtils.validateResponseFormat(
|
935
|
+
u = _context7.t0;
|
936
|
+
RequestUtils.validateResponseFormat(u) ? typeof u.error == "string" ? (console.error(u.error), n.addNewErrorMessage("service", u.error), e.completionsHandlers.onFinish()) : e.deepChat.stream && u.text ? Stream.simulate(n, e.streamHandlers, u.text) : (n.addNewMessage(u, !0), e.completionsHandlers.onFinish()) : (console.error(ErrorMessages.INVALID_RESPONSE(d, "server", !!e.deepChat.responseInterceptor, u)), n.addNewErrorMessage("service", "Error in server message"), e.completionsHandlers.onFinish());
|
920
937
|
case 10:
|
921
938
|
case "end":
|
922
939
|
return _context7.stop();
|
@@ -954,16 +971,16 @@ var CustomHandler = /*#__PURE__*/function () {
|
|
954
971
|
c = function c() {
|
955
972
|
s && (n.finaliseStreamedMessage(), e.streamHandlers.onClose(), s = !1);
|
956
973
|
},
|
957
|
-
|
974
|
+
d = function d(p) {
|
958
975
|
s && (!p || _typeof(p) != "object" || typeof p.error != "string" && typeof p.text != "string" ? console.error(ErrorMessages.INVALID_RESPONSE(p, "server", !1)) : p.error ? (console.error(p.error), n.finaliseStreamedMessage(), e.streamHandlers.onClose(), n.addNewErrorMessage("service", p.error), s = !1) : p.text && a && n.updateStreamedMessage(p.text, a));
|
959
976
|
};
|
960
977
|
e.streamHandlers.abortStream.abort = function () {
|
961
978
|
n.finaliseStreamedMessage(), e.streamHandlers.onClose(), s = !1;
|
962
979
|
};
|
963
|
-
var
|
964
|
-
(f = (h = e.requestSettings).handler) == null || f.call(h, t, _objectSpread(_objectSpread({},
|
980
|
+
var u = CustomHandler.generateOptionalSignals();
|
981
|
+
(f = (h = e.requestSettings).handler) == null || f.call(h, t, _objectSpread(_objectSpread({}, u), {}, {
|
965
982
|
onOpen: l,
|
966
|
-
onResponse:
|
983
|
+
onResponse: d,
|
967
984
|
onClose: c,
|
968
985
|
stopClicked: e.streamHandlers.stopClicked
|
969
986
|
}));
|
@@ -972,7 +989,7 @@ var CustomHandler = /*#__PURE__*/function () {
|
|
972
989
|
}, {
|
973
990
|
key: "websocket",
|
974
991
|
value: function websocket(e, t) {
|
975
|
-
var c,
|
992
|
+
var c, d;
|
976
993
|
var n = {
|
977
994
|
isOpen: !1,
|
978
995
|
newUserMessage: {
|
@@ -987,7 +1004,7 @@ var CustomHandler = /*#__PURE__*/function () {
|
|
987
1004
|
n.isOpen = !1;
|
988
1005
|
},
|
989
1006
|
a = /*#__PURE__*/function () {
|
990
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(
|
1007
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(u) {
|
991
1008
|
var f, p, h;
|
992
1009
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
993
1010
|
while (1) switch (_context9.prev = _context9.next) {
|
@@ -999,17 +1016,17 @@ var CustomHandler = /*#__PURE__*/function () {
|
|
999
1016
|
return _context9.abrupt("return");
|
1000
1017
|
case 2:
|
1001
1018
|
_context9.next = 4;
|
1002
|
-
return (p = (f = e.deepChat).responseInterceptor) == null ? void 0 : p.call(f,
|
1019
|
+
return (p = (f = e.deepChat).responseInterceptor) == null ? void 0 : p.call(f, u);
|
1003
1020
|
case 4:
|
1004
1021
|
_context9.t0 = _context9.sent;
|
1005
1022
|
if (_context9.t0) {
|
1006
1023
|
_context9.next = 7;
|
1007
1024
|
break;
|
1008
1025
|
}
|
1009
|
-
_context9.t0 =
|
1026
|
+
_context9.t0 = u;
|
1010
1027
|
case 7:
|
1011
1028
|
h = _context9.t0;
|
1012
|
-
RequestUtils.validateResponseFormat(h) ? typeof h.error == "string" ? (console.error(h.error), t.isLastMessageError() || t.addNewErrorMessage("service", h.error)) : e.deepChat.stream ? Stream.simulate(t, e.streamHandlers, h.text) : t.addNewMessage(h, !0
|
1029
|
+
RequestUtils.validateResponseFormat(h) ? typeof h.error == "string" ? (console.error(h.error), t.isLastMessageError() || t.addNewErrorMessage("service", h.error)) : e.deepChat.stream ? Stream.simulate(t, e.streamHandlers, h.text) : t.addNewMessage(h, !0) : (console.error(ErrorMessages.INVALID_RESPONSE(u, "server", !!e.deepChat.responseInterceptor, h)), t.addNewErrorMessage("service", "Error in server message"));
|
1013
1030
|
case 9:
|
1014
1031
|
case "end":
|
1015
1032
|
return _context9.stop();
|
@@ -1021,7 +1038,7 @@ var CustomHandler = /*#__PURE__*/function () {
|
|
1021
1038
|
};
|
1022
1039
|
}(),
|
1023
1040
|
l = CustomHandler.generateOptionalSignals();
|
1024
|
-
(
|
1041
|
+
(d = (c = e.requestSettings).handler) == null || d.call(c, void 0, _objectSpread(_objectSpread({}, l), {}, {
|
1025
1042
|
onOpen: s,
|
1026
1043
|
onResponse: a,
|
1027
1044
|
onClose: o,
|
@@ -1065,8 +1082,8 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1065
1082
|
a,
|
1066
1083
|
l,
|
1067
1084
|
c,
|
1068
|
-
u,
|
1069
1085
|
d,
|
1086
|
+
u,
|
1070
1087
|
_args11 = arguments;
|
1071
1088
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
1072
1089
|
while (1) switch (_context11.prev = _context11.next) {
|
@@ -1083,12 +1100,12 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1083
1100
|
a = _yield$RequestUtils$p2.body;
|
1084
1101
|
l = _yield$RequestUtils$p2.headers;
|
1085
1102
|
c = _yield$RequestUtils$p2.error;
|
1086
|
-
|
1103
|
+
d = e.completionsHandlers.onFinish;
|
1087
1104
|
if (!c) {
|
1088
1105
|
_context11.next = 11;
|
1089
1106
|
break;
|
1090
1107
|
}
|
1091
|
-
return _context11.abrupt("return", HTTPRequest.onInterceptorError(n, c,
|
1108
|
+
return _context11.abrupt("return", HTTPRequest.onInterceptorError(n, c, d));
|
1092
1109
|
case 11:
|
1093
1110
|
if (!((f = e.requestSettings) != null && f.handler)) {
|
1094
1111
|
_context11.next = 13;
|
@@ -1100,20 +1117,20 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1100
1117
|
_context11.next = 15;
|
1101
1118
|
break;
|
1102
1119
|
}
|
1103
|
-
return _context11.abrupt("return", Demo.request(n,
|
1120
|
+
return _context11.abrupt("return", Demo.request(n, d, e.deepChat.responseInterceptor));
|
1104
1121
|
case 15:
|
1105
|
-
|
1122
|
+
u = !0;
|
1106
1123
|
fetch(((b = e.requestSettings) == null ? void 0 : b.url) || e.url || "", {
|
1107
1124
|
method: ((m = e.requestSettings) == null ? void 0 : m.method) || "POST",
|
1108
1125
|
headers: l,
|
1109
1126
|
body: s ? JSON.stringify(a) : a
|
1110
1127
|
}).then(function (g) {
|
1111
|
-
return
|
1128
|
+
return u = !!g.ok, g;
|
1112
1129
|
}).then(function (g) {
|
1113
1130
|
return RequestUtils.processResponseByType(g);
|
1114
1131
|
}).then( /*#__PURE__*/function () {
|
1115
1132
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(g) {
|
1116
|
-
var S,
|
1133
|
+
var S, _, v, y;
|
1117
1134
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
1118
1135
|
while (1) switch (_context10.prev = _context10.next) {
|
1119
1136
|
case 0:
|
@@ -1124,7 +1141,7 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1124
1141
|
return _context10.abrupt("return");
|
1125
1142
|
case 2:
|
1126
1143
|
_context10.next = 4;
|
1127
|
-
return (
|
1144
|
+
return (_ = (S = e.deepChat).responseInterceptor) == null ? void 0 : _.call(S, g);
|
1128
1145
|
case 4:
|
1129
1146
|
_context10.t0 = _context10.sent;
|
1130
1147
|
if (_context10.t0) {
|
@@ -1138,7 +1155,7 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1138
1155
|
return e.extractResultData(v);
|
1139
1156
|
case 10:
|
1140
1157
|
y = _context10.sent;
|
1141
|
-
if (
|
1158
|
+
if (u) {
|
1142
1159
|
_context10.next = 13;
|
1143
1160
|
break;
|
1144
1161
|
}
|
@@ -1150,7 +1167,7 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1150
1167
|
}
|
1151
1168
|
throw Error(ErrorMessages.INVALID_RESPONSE(g, "response", !!e.deepChat.responseInterceptor, v));
|
1152
1169
|
case 15:
|
1153
|
-
y.pollingInAnotherRequest || (e.deepChat.stream && y.text ? Stream.simulate(n, e.streamHandlers, y.text) : (n.addNewMessage(y, !0
|
1170
|
+
y.pollingInAnotherRequest || (e.deepChat.stream && y.text ? Stream.simulate(n, e.streamHandlers, y.text) : (n.addNewMessage(y, !0), d()));
|
1154
1171
|
case 16:
|
1155
1172
|
case "end":
|
1156
1173
|
return _context10.stop();
|
@@ -1161,7 +1178,7 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1161
1178
|
return _ref4.apply(this, arguments);
|
1162
1179
|
};
|
1163
1180
|
}())["catch"](function (g) {
|
1164
|
-
RequestUtils.displayError(n, g),
|
1181
|
+
RequestUtils.displayError(n, g), d();
|
1165
1182
|
});
|
1166
1183
|
case 17:
|
1167
1184
|
case "end":
|
@@ -1183,7 +1200,7 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1183
1200
|
return a.json();
|
1184
1201
|
}).then( /*#__PURE__*/function () {
|
1185
1202
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(a) {
|
1186
|
-
var c,
|
1203
|
+
var c, d, l;
|
1187
1204
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
1188
1205
|
while (1) switch (_context12.prev = _context12.next) {
|
1189
1206
|
case 0:
|
@@ -1195,7 +1212,7 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1195
1212
|
case 2:
|
1196
1213
|
_context12.t0 = e;
|
1197
1214
|
_context12.next = 5;
|
1198
|
-
return (
|
1215
|
+
return (d = (c = e.deepChat).responseInterceptor) == null ? void 0 : d.call(c, a);
|
1199
1216
|
case 5:
|
1200
1217
|
_context12.t1 = _context12.sent;
|
1201
1218
|
if (_context12.t1) {
|
@@ -1211,7 +1228,7 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1211
1228
|
l = _context12.sent;
|
1212
1229
|
l.timeoutMS ? setTimeout(function () {
|
1213
1230
|
HTTPRequest.executePollRequest(e, t, n, s);
|
1214
|
-
}, l.timeoutMS) : (console.log("finished polling"), s.addNewMessage(l, !0
|
1231
|
+
}, l.timeoutMS) : (console.log("finished polling"), s.addNewMessage(l, !0), o());
|
1215
1232
|
case 13:
|
1216
1233
|
case "end":
|
1217
1234
|
return _context12.stop();
|
@@ -1239,8 +1256,8 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1239
1256
|
a,
|
1240
1257
|
l,
|
1241
1258
|
c,
|
1242
|
-
u,
|
1243
1259
|
d,
|
1260
|
+
u,
|
1244
1261
|
h,
|
1245
1262
|
f,
|
1246
1263
|
_args13 = arguments;
|
@@ -1265,12 +1282,12 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1265
1282
|
}
|
1266
1283
|
return _context13.abrupt("return", HTTPRequest.onInterceptorError(n, c));
|
1267
1284
|
case 10:
|
1268
|
-
|
1269
|
-
method:
|
1285
|
+
d = ((b = e.requestSettings) == null ? void 0 : b.url) || e.url || "", u = ((m = e.requestSettings) == null ? void 0 : m.method) || "POST", h = s ? JSON.stringify(a) : a, f = {
|
1286
|
+
method: u,
|
1270
1287
|
body: h,
|
1271
1288
|
headers: l
|
1272
1289
|
};
|
1273
|
-
HTTPRequest.executePollRequest(e,
|
1290
|
+
HTTPRequest.executePollRequest(e, d, f, n);
|
1274
1291
|
case 12:
|
1275
1292
|
case "end":
|
1276
1293
|
return _context13.stop();
|
@@ -1290,18 +1307,18 @@ var HTTPRequest = /*#__PURE__*/function () {
|
|
1290
1307
|
// prettier-ignore
|
1291
1308
|
}, {
|
1292
1309
|
key: "verifyKey",
|
1293
|
-
value: function verifyKey(e, t, n, s, o, a, l, c,
|
1310
|
+
value: function verifyKey(e, t, n, s, o, a, l, c, d) {
|
1294
1311
|
if (e === "") return a(ErrorMessages.INVALID_KEY);
|
1295
1312
|
l(), fetch(t, {
|
1296
1313
|
method: s,
|
1297
1314
|
headers: n,
|
1298
|
-
body:
|
1299
|
-
}).then(function (
|
1300
|
-
return RequestUtils.processResponseByType(
|
1301
|
-
}).then(function (
|
1302
|
-
c(
|
1303
|
-
})["catch"](function (
|
1304
|
-
a(ErrorMessages.CONNECTION_FAILED), console.error(
|
1315
|
+
body: d || null
|
1316
|
+
}).then(function (u) {
|
1317
|
+
return RequestUtils.processResponseByType(u);
|
1318
|
+
}).then(function (u) {
|
1319
|
+
c(u, e, o, a);
|
1320
|
+
})["catch"](function (u) {
|
1321
|
+
a(ErrorMessages.CONNECTION_FAILED), console.error(u);
|
1305
1322
|
});
|
1306
1323
|
}
|
1307
1324
|
}]);
|
@@ -1326,19 +1343,6 @@ var MessageLimitUtils = /*#__PURE__*/function () {
|
|
1326
1343
|
}
|
1327
1344
|
return e.slice(Math.max(s, 0));
|
1328
1345
|
}
|
1329
|
-
}, {
|
1330
|
-
key: "getRequestMessages",
|
1331
|
-
value: function getRequestMessages(e, t) {
|
1332
|
-
var a;
|
1333
|
-
var n = [];
|
1334
|
-
var s = ((a = e.files) == null ? void 0 : a.length) || 0,
|
1335
|
-
o = !!e.text;
|
1336
|
-
for (var l = t.length - 1; l >= 0; l -= 1) {
|
1337
|
-
var c = t[l];
|
1338
|
-
if (n.push(c), c.file ? s -= 1 : c.text && (o = !1), s === 0 && !o) break;
|
1339
|
-
}
|
1340
|
-
return n;
|
1341
|
-
}
|
1342
1346
|
}, {
|
1343
1347
|
key: "getMaxMessages",
|
1344
1348
|
value: function getMaxMessages(e, t) {
|
@@ -1350,8 +1354,8 @@ var MessageLimitUtils = /*#__PURE__*/function () {
|
|
1350
1354
|
// if maxMessages 0 or below we send only what is in the request
|
1351
1355
|
}, {
|
1352
1356
|
key: "processMessages",
|
1353
|
-
value: function processMessages(e, t, n
|
1354
|
-
return
|
1357
|
+
value: function processMessages(e, t, n) {
|
1358
|
+
return t !== void 0 ? t > 0 && (e = MessageLimitUtils.getMaxMessages(e, t)) : e = [e[e.length - 1]], e = JSON.parse(JSON.stringify(e)), n === void 0 ? e : MessageLimitUtils.getCharacterLimitMessages(e, n);
|
1355
1359
|
}
|
1356
1360
|
}]);
|
1357
1361
|
return MessageLimitUtils;
|
@@ -1397,7 +1401,7 @@ var Websocket = /*#__PURE__*/function () {
|
|
1397
1401
|
value: function assignListeners(e, t, n) {
|
1398
1402
|
t.onmessage = /*#__PURE__*/function () {
|
1399
1403
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
|
1400
|
-
var o, a, l, c,
|
1404
|
+
var o, a, l, c, d;
|
1401
1405
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
1402
1406
|
while (1) switch (_context14.prev = _context14.next) {
|
1403
1407
|
case 0:
|
@@ -1421,14 +1425,14 @@ var Websocket = /*#__PURE__*/function () {
|
|
1421
1425
|
_context14.next = 11;
|
1422
1426
|
return e.extractResultData(c);
|
1423
1427
|
case 11:
|
1424
|
-
|
1425
|
-
if (!(!
|
1428
|
+
d = _context14.sent;
|
1429
|
+
if (!(!d || _typeof(d) != "object")) {
|
1426
1430
|
_context14.next = 14;
|
1427
1431
|
break;
|
1428
1432
|
}
|
1429
1433
|
throw Error(ErrorMessages.INVALID_RESPONSE(l, "server", !!e.deepChat.responseInterceptor, c));
|
1430
1434
|
case 14:
|
1431
|
-
e.deepChat.stream &&
|
1435
|
+
e.deepChat.stream && d.text ? Stream.simulate(n, e.streamHandlers, d.text) : n.addNewMessage(d, !0);
|
1432
1436
|
_context14.next = 20;
|
1433
1437
|
break;
|
1434
1438
|
case 17:
|
@@ -1453,14 +1457,14 @@ var Websocket = /*#__PURE__*/function () {
|
|
1453
1457
|
value: function () {
|
1454
1458
|
var _sendWebsocket = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(e, t, n) {
|
1455
1459
|
var s,
|
1456
|
-
|
1460
|
+
u,
|
1457
1461
|
h,
|
1458
1462
|
o,
|
1459
1463
|
a,
|
1460
1464
|
_yield$RequestUtils$p4,
|
1461
1465
|
l,
|
1462
1466
|
c,
|
1463
|
-
|
1467
|
+
d,
|
1464
1468
|
_args15 = arguments;
|
1465
1469
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
1466
1470
|
while (1) switch (_context15.prev = _context15.next) {
|
@@ -1475,7 +1479,7 @@ var Websocket = /*#__PURE__*/function () {
|
|
1475
1479
|
case 4:
|
1476
1480
|
a = {
|
1477
1481
|
body: t,
|
1478
|
-
headers: (
|
1482
|
+
headers: (u = e.requestSettings) == null ? void 0 : u.headers
|
1479
1483
|
};
|
1480
1484
|
_context15.next = 7;
|
1481
1485
|
return RequestUtils.processRequestInterceptor(e.deepChat, a);
|
@@ -1495,14 +1499,14 @@ var Websocket = /*#__PURE__*/function () {
|
|
1495
1499
|
}
|
1496
1500
|
return _context15.abrupt("return", o.newUserMessage.listener(l));
|
1497
1501
|
case 14:
|
1498
|
-
|
1502
|
+
d = s ? JSON.stringify(l) : l;
|
1499
1503
|
if (!(((h = e.requestSettings) == null ? void 0 : h.url) === Demo.URL)) {
|
1500
1504
|
_context15.next = 17;
|
1501
1505
|
break;
|
1502
1506
|
}
|
1503
1507
|
return _context15.abrupt("return", Demo.request(n, e.completionsHandlers.onFinish, e.deepChat.responseInterceptor));
|
1504
1508
|
case 17:
|
1505
|
-
o.readyState === void 0 || o.readyState !== o.OPEN ? (console.error("Connection is not open"), n.isLastMessageError() || n.addNewErrorMessage("service", "Connection error")) : o.send(JSON.stringify(
|
1509
|
+
o.readyState === void 0 || o.readyState !== o.OPEN ? (console.error("Connection is not open"), n.isLastMessageError() || n.addNewErrorMessage("service", "Connection error")) : o.send(JSON.stringify(d));
|
1506
1510
|
case 18:
|
1507
1511
|
case "end":
|
1508
1512
|
return _context15.stop();
|
@@ -1528,6 +1532,31 @@ var Websocket = /*#__PURE__*/function () {
|
|
1528
1532
|
}]);
|
1529
1533
|
return Websocket;
|
1530
1534
|
}();
|
1535
|
+
var Legacy = /*#__PURE__*/function () {
|
1536
|
+
function Legacy() {
|
1537
|
+
_classCallCheck(this, Legacy);
|
1538
|
+
}
|
1539
|
+
_createClass(Legacy, null, [{
|
1540
|
+
key: "checkForContainerStyles",
|
1541
|
+
value: function checkForContainerStyles(e, t) {
|
1542
|
+
var n = e.containerStyle;
|
1543
|
+
n && (Object.assign(t.style, n), console.error("The containerStyle property is deprecated since version 1.3.14."), console.error("Please change to using the style property instead: https://deepchat.dev/docs/styles#style"));
|
1544
|
+
}
|
1545
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
1546
|
+
}, {
|
1547
|
+
key: "handleResponseProperty",
|
1548
|
+
value: function handleResponseProperty(e) {
|
1549
|
+
return console.error("The {result: ....} response object type is deprecated since version 1.3.0."), console.error("Please change to using the new response object: https://deepchat.dev/docs/connect#Response"), e.result;
|
1550
|
+
}
|
1551
|
+
}, {
|
1552
|
+
key: "processInitialMessageFile",
|
1553
|
+
value: function processInitialMessageFile(e) {
|
1554
|
+
var t = e.file;
|
1555
|
+
t && (e.files = [t]);
|
1556
|
+
}
|
1557
|
+
}]);
|
1558
|
+
return Legacy;
|
1559
|
+
}();
|
1531
1560
|
var textarea;
|
1532
1561
|
function decodeEntity(r) {
|
1533
1562
|
return textarea = textarea || document.createElement("textarea"), textarea.innerHTML = "&" + r + ";", textarea.value;
|
@@ -1602,14 +1631,14 @@ rules.fence = function (r, e, t, n, s) {
|
|
1602
1631
|
a = "",
|
1603
1632
|
l = t.langPrefix,
|
1604
1633
|
c = "",
|
1605
|
-
u,
|
1606
1634
|
d,
|
1635
|
+
u,
|
1607
1636
|
h;
|
1608
1637
|
if (o.params) {
|
1609
|
-
if (
|
1610
|
-
c = escapeHtml(replaceEntities(unescapeMd(
|
1638
|
+
if (d = o.params.split(/\s+/g), u = d.join(" "), has(s.rules.fence_custom, d[0])) return s.rules.fence_custom[d[0]](r, e, t, n, s);
|
1639
|
+
c = escapeHtml(replaceEntities(unescapeMd(u))), a = ' class="' + l + c + '"';
|
1611
1640
|
}
|
1612
|
-
return t.highlight ? h = t.highlight.apply(t.highlight, [o.content].concat(
|
1641
|
+
return t.highlight ? h = t.highlight.apply(t.highlight, [o.content].concat(d)) || escapeHtml(o.content) : h = escapeHtml(o.content), "<pre><code" + a + ">" + h + "</code></pre>" + getBreak(r, e);
|
1613
1642
|
};
|
1614
1643
|
rules.fence_custom = {};
|
1615
1644
|
rules.heading_open = function (r, e) {
|
@@ -1942,10 +1971,10 @@ function parseLinkLabel(r, e) {
|
|
1942
1971
|
return n ? (o = r.pos, r.labelUnmatchedScopes = 0) : r.labelUnmatchedScopes = t - 1, r.pos = l, r.isInLabel = c, o;
|
1943
1972
|
}
|
1944
1973
|
function parseAbbr(r, e, t, n) {
|
1945
|
-
var s, o, a, l, c,
|
1974
|
+
var s, o, a, l, c, d;
|
1946
1975
|
if (r.charCodeAt(0) !== 42 || r.charCodeAt(1) !== 91 || r.indexOf("]:") === -1 || (s = new StateInline(r, e, t, n, []), o = parseLinkLabel(s, 1), o < 0 || r.charCodeAt(o + 1) !== 58)) return -1;
|
1947
1976
|
for (l = s.posMax, a = o + 2; a < l && s.src.charCodeAt(a) !== 10; a++);
|
1948
|
-
return c = r.slice(2, o),
|
1977
|
+
return c = r.slice(2, o), d = r.slice(o + 2, a).trim(), d.length === 0 ? -1 : (n.abbreviations || (n.abbreviations = {}), _typeof(n.abbreviations[":" + c]) > "u" && (n.abbreviations[":" + c] = d), a);
|
1949
1978
|
}
|
1950
1979
|
function abbr(r) {
|
1951
1980
|
var e = r.tokens,
|
@@ -2015,15 +2044,15 @@ function normalizeReference(r) {
|
|
2015
2044
|
return r.trim().replace(/\s+/g, " ").toUpperCase();
|
2016
2045
|
}
|
2017
2046
|
function parseReference(r, e, t, n) {
|
2018
|
-
var s, o, a, l, c,
|
2047
|
+
var s, o, a, l, c, d, u, h, f;
|
2019
2048
|
if (r.charCodeAt(0) !== 91 || r.indexOf("]:") === -1 || (s = new StateInline(r, e, t, n, []), o = parseLinkLabel(s, 0), o < 0 || r.charCodeAt(o + 1) !== 58)) return -1;
|
2020
2049
|
for (l = s.posMax, a = o + 2; a < l && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2021
2050
|
if (!parseLinkDestination(s, a)) return -1;
|
2022
|
-
for (
|
2023
|
-
for (a < l &&
|
2051
|
+
for (u = s.linkContent, a = s.pos, d = a, a = a + 1; a < l && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2052
|
+
for (a < l && d !== a && parseLinkTitle(s, a) ? (h = s.linkContent, a = s.pos) : (h = "", a = d); a < l && s.src.charCodeAt(a) === 32;) a++;
|
2024
2053
|
return a < l && s.src.charCodeAt(a) !== 10 ? -1 : (f = normalizeReference(r.slice(1, o)), _typeof(n.references[f]) > "u" && (n.references[f] = {
|
2025
2054
|
title: h,
|
2026
|
-
href:
|
2055
|
+
href: u
|
2027
2056
|
}), a);
|
2028
2057
|
}
|
2029
2058
|
function references(r) {
|
@@ -2055,48 +2084,48 @@ function footnote_block(r) {
|
|
2055
2084
|
a,
|
2056
2085
|
l,
|
2057
2086
|
c,
|
2058
|
-
|
2059
|
-
|
2087
|
+
d,
|
2088
|
+
u = 0,
|
2060
2089
|
h = !1,
|
2061
2090
|
f = {};
|
2062
2091
|
if (r.env.footnotes && (r.tokens = r.tokens.filter(function (p) {
|
2063
|
-
return p.type === "footnote_reference_open" ? (h = !0, c = [],
|
2092
|
+
return p.type === "footnote_reference_open" ? (h = !0, c = [], d = p.label, !1) : p.type === "footnote_reference_close" ? (h = !1, f[":" + d] = c, !1) : (h && c.push(p), !h);
|
2064
2093
|
}), !!r.env.footnotes.list)) {
|
2065
2094
|
for (a = r.env.footnotes.list, r.tokens.push({
|
2066
2095
|
type: "footnote_block_open",
|
2067
|
-
level:
|
2096
|
+
level: u++
|
2068
2097
|
}), e = 0, t = a.length; e < t; e++) {
|
2069
2098
|
for (r.tokens.push({
|
2070
2099
|
type: "footnote_open",
|
2071
2100
|
id: e,
|
2072
|
-
level:
|
2101
|
+
level: u++
|
2073
2102
|
}), a[e].tokens ? (l = [], l.push({
|
2074
2103
|
type: "paragraph_open",
|
2075
2104
|
tight: !1,
|
2076
|
-
level:
|
2105
|
+
level: u++
|
2077
2106
|
}), l.push({
|
2078
2107
|
type: "inline",
|
2079
2108
|
content: "",
|
2080
|
-
level:
|
2109
|
+
level: u,
|
2081
2110
|
children: a[e].tokens
|
2082
2111
|
}), l.push({
|
2083
2112
|
type: "paragraph_close",
|
2084
2113
|
tight: !1,
|
2085
|
-
level: --
|
2114
|
+
level: --u
|
2086
2115
|
})) : a[e].label && (l = f[":" + a[e].label]), r.tokens = r.tokens.concat(l), r.tokens[r.tokens.length - 1].type === "paragraph_close" ? o = r.tokens.pop() : o = null, s = a[e].count > 0 ? a[e].count : 1, n = 0; n < s; n++) r.tokens.push({
|
2087
2116
|
type: "footnote_anchor",
|
2088
2117
|
id: e,
|
2089
2118
|
subId: n,
|
2090
|
-
level:
|
2119
|
+
level: u
|
2091
2120
|
});
|
2092
2121
|
o && r.tokens.push(o), r.tokens.push({
|
2093
2122
|
type: "footnote_close",
|
2094
|
-
level: --
|
2123
|
+
level: --u
|
2095
2124
|
});
|
2096
2125
|
}
|
2097
2126
|
r.tokens.push({
|
2098
2127
|
type: "footnote_block_close",
|
2099
|
-
level: --
|
2128
|
+
level: --u
|
2100
2129
|
});
|
2101
2130
|
}
|
2102
2131
|
}
|
@@ -2113,8 +2142,8 @@ function abbr2(r) {
|
|
2113
2142
|
a,
|
2114
2143
|
l,
|
2115
2144
|
c,
|
2116
|
-
u,
|
2117
2145
|
d,
|
2146
|
+
u,
|
2118
2147
|
h,
|
2119
2148
|
f,
|
2120
2149
|
p = r.tokens;
|
@@ -2123,28 +2152,28 @@ function abbr2(r) {
|
|
2123
2152
|
return b.substr(1);
|
2124
2153
|
}).sort(function (b, m) {
|
2125
2154
|
return m.length - b.length;
|
2126
|
-
}).map(regEscape).join("|") + ")($|[" + PUNCT_CHARS.split("").map(regEscape).join("") + "])", r.env.abbrRegExp = new RegExp(f, "g")),
|
2155
|
+
}).map(regEscape).join("|") + ")($|[" + PUNCT_CHARS.split("").map(regEscape).join("") + "])", r.env.abbrRegExp = new RegExp(f, "g")), u = r.env.abbrRegExp, t = 0, n = p.length; t < n; t++) if (p[t].type === "inline") {
|
2127
2156
|
for (s = p[t].children, e = s.length - 1; e >= 0; e--) if (o = s[e], o.type === "text") {
|
2128
|
-
for (c = 0, a = o.content,
|
2157
|
+
for (c = 0, a = o.content, u.lastIndex = 0, d = o.level, l = []; h = u.exec(a);) u.lastIndex > c && l.push({
|
2129
2158
|
type: "text",
|
2130
2159
|
content: a.slice(c, h.index + h[1].length),
|
2131
|
-
level:
|
2160
|
+
level: d
|
2132
2161
|
}), l.push({
|
2133
2162
|
type: "abbr_open",
|
2134
2163
|
title: r.env.abbreviations[":" + h[2]],
|
2135
|
-
level:
|
2164
|
+
level: d++
|
2136
2165
|
}), l.push({
|
2137
2166
|
type: "text",
|
2138
2167
|
content: h[2],
|
2139
|
-
level:
|
2168
|
+
level: d
|
2140
2169
|
}), l.push({
|
2141
2170
|
type: "abbr_close",
|
2142
|
-
level: --
|
2143
|
-
}), c =
|
2171
|
+
level: --d
|
2172
|
+
}), c = u.lastIndex - h[3].length;
|
2144
2173
|
l.length && (c < a.length && l.push({
|
2145
2174
|
type: "text",
|
2146
2175
|
content: a.slice(c),
|
2147
|
-
level:
|
2176
|
+
level: d
|
2148
2177
|
}), p[t].children = s = [].concat(s.slice(0, e), l, s.slice(e + 1)));
|
2149
2178
|
}
|
2150
2179
|
}
|
@@ -2180,20 +2209,20 @@ function replaceAt(r, e, t) {
|
|
2180
2209
|
return r.substr(0, e) + t + r.substr(e + 1);
|
2181
2210
|
}
|
2182
2211
|
function smartquotes(r) {
|
2183
|
-
var e, t, n, s, o, a, l, c,
|
2212
|
+
var e, t, n, s, o, a, l, c, d, u, h, f, p, b, m, g, v;
|
2184
2213
|
if (r.options.typographer) {
|
2185
2214
|
for (v = [], m = r.tokens.length - 1; m >= 0; m--) if (r.tokens[m].type === "inline") {
|
2186
2215
|
for (g = r.tokens[m].children, v.length = 0, e = 0; e < g.length; e++) if (t = g[e], !(t.type !== "text" || QUOTE_TEST_RE.test(t.text))) {
|
2187
2216
|
for (l = g[e].level, p = v.length - 1; p >= 0 && !(v[p].level <= l); p--);
|
2188
2217
|
v.length = p + 1, n = t.content, o = 0, a = n.length;
|
2189
2218
|
e: for (; o < a && (QUOTE_RE.lastIndex = o, s = QUOTE_RE.exec(n), !!s);) {
|
2190
|
-
if (c = !isLetter(n, s.index - 1), o = s.index + 1, b = s[0] === "'",
|
2219
|
+
if (c = !isLetter(n, s.index - 1), o = s.index + 1, b = s[0] === "'", d = !isLetter(n, o), !d && !c) {
|
2191
2220
|
b && (t.content = replaceAt(t.content, s.index, APOSTROPHE));
|
2192
2221
|
continue;
|
2193
2222
|
}
|
2194
|
-
if (h = !
|
2195
|
-
for (p = v.length - 1; p >= 0 && (
|
2196
|
-
|
2223
|
+
if (h = !d, f = !c, f) {
|
2224
|
+
for (p = v.length - 1; p >= 0 && (u = v[p], !(v[p].level < l)); p--) if (u.single === b && v[p].level === l) {
|
2225
|
+
u = v[p], b ? (g[u.token].content = replaceAt(g[u.token].content, u.pos, r.options.quotes[2]), t.content = replaceAt(t.content, s.index, r.options.quotes[3])) : (g[u.token].content = replaceAt(g[u.token].content, u.pos, r.options.quotes[0]), t.content = replaceAt(t.content, s.index, r.options.quotes[1])), v.length = p;
|
2197
2226
|
continue e;
|
2198
2227
|
}
|
2199
2228
|
}
|
@@ -2218,13 +2247,13 @@ Core.prototype.process = function (r) {
|
|
2218
2247
|
for (n = this.ruler.getRules(""), e = 0, t = n.length; e < t; e++) n[e](r);
|
2219
2248
|
};
|
2220
2249
|
function StateBlock(r, e, t, n, s) {
|
2221
|
-
var o, a, l, c,
|
2222
|
-
for (this.src = r, this.parser = e, this.options = t, this.env = n, this.tokens = s, this.bMarks = [], this.eMarks = [], this.tShift = [], this.blkIndent = 0, this.line = 0, this.lineMax = 0, this.tight = !1, this.parentType = "root", this.ddIndent = -1, this.level = 0, this.result = "", a = this.src,
|
2250
|
+
var o, a, l, c, d, u, h;
|
2251
|
+
for (this.src = r, this.parser = e, this.options = t, this.env = n, this.tokens = s, this.bMarks = [], this.eMarks = [], this.tShift = [], this.blkIndent = 0, this.line = 0, this.lineMax = 0, this.tight = !1, this.parentType = "root", this.ddIndent = -1, this.level = 0, this.result = "", a = this.src, u = 0, h = !1, l = c = u = 0, d = a.length; c < d; c++) {
|
2223
2252
|
if (o = a.charCodeAt(c), !h) if (o === 32) {
|
2224
|
-
|
2253
|
+
u++;
|
2225
2254
|
continue;
|
2226
2255
|
} else h = !0;
|
2227
|
-
(o === 10 || c ===
|
2256
|
+
(o === 10 || c === d - 1) && (o !== 10 && c++, this.bMarks.push(l), this.eMarks.push(c), this.tShift.push(u), h = !1, u = 0, l = c + 1);
|
2228
2257
|
}
|
2229
2258
|
this.bMarks.push(a.length), this.eMarks.push(a.length), this.tShift.push(0), this.lineMax = this.bMarks.length - 1;
|
2230
2259
|
}
|
@@ -2253,11 +2282,11 @@ StateBlock.prototype.getLines = function (e, t, n, s) {
|
|
2253
2282
|
a,
|
2254
2283
|
l,
|
2255
2284
|
c,
|
2256
|
-
|
2257
|
-
|
2285
|
+
d,
|
2286
|
+
u = e;
|
2258
2287
|
if (e >= t) return "";
|
2259
|
-
if (
|
2260
|
-
for (c = new Array(t - e), o = 0;
|
2288
|
+
if (u + 1 === t) return a = this.bMarks[u] + Math.min(this.tShift[u], n), l = s ? this.eMarks[u] + 1 : this.eMarks[u], this.src.slice(a, l);
|
2289
|
+
for (c = new Array(t - e), o = 0; u < t; u++, o++) d = this.tShift[u], d > n && (d = n), d < 0 && (d = 0), a = this.bMarks[u] + d, u + 1 < t || s ? l = this.eMarks[u] + 1 : l = this.eMarks[u], c[o] = this.src.slice(a, l);
|
2261
2290
|
return c.join("");
|
2262
2291
|
};
|
2263
2292
|
function code(r, e, t) {
|
@@ -2288,16 +2317,16 @@ function fences(r, e, t, n) {
|
|
2288
2317
|
a,
|
2289
2318
|
l,
|
2290
2319
|
c,
|
2291
|
-
|
2292
|
-
|
2320
|
+
d = !1,
|
2321
|
+
u = r.bMarks[e] + r.tShift[e],
|
2293
2322
|
h = r.eMarks[e];
|
2294
|
-
if (
|
2323
|
+
if (u + 3 > h || (s = r.src.charCodeAt(u), s !== 126 && s !== 96) || (c = u, u = r.skipChars(u, s), o = u - c, o < 3) || (a = r.src.slice(u, h).trim(), a.indexOf("`") >= 0)) return !1;
|
2295
2324
|
if (n) return !0;
|
2296
|
-
for (l = e; l++, !(l >= t || (
|
2297
|
-
|
2325
|
+
for (l = e; l++, !(l >= t || (u = c = r.bMarks[l] + r.tShift[l], h = r.eMarks[l], u < h && r.tShift[l] < r.blkIndent));) if (r.src.charCodeAt(u) === s && !(r.tShift[l] - r.blkIndent >= 4) && (u = r.skipChars(u, s), !(u - c < o) && (u = r.skipSpaces(u), !(u < h)))) {
|
2326
|
+
d = !0;
|
2298
2327
|
break;
|
2299
2328
|
}
|
2300
|
-
return o = r.tShift[e], r.line = l + (
|
2329
|
+
return o = r.tShift[e], r.line = l + (d ? 1 : 0), r.tokens.push({
|
2301
2330
|
type: "fence",
|
2302
2331
|
params: a,
|
2303
2332
|
content: r.getLines(e + 1, l, o, !0),
|
@@ -2311,8 +2340,8 @@ function blockquote(r, e, t, n) {
|
|
2311
2340
|
a,
|
2312
2341
|
l,
|
2313
2342
|
c,
|
2314
|
-
u,
|
2315
2343
|
d,
|
2344
|
+
u,
|
2316
2345
|
h,
|
2317
2346
|
f,
|
2318
2347
|
p,
|
@@ -2334,14 +2363,14 @@ function blockquote(r, e, t, n) {
|
|
2334
2363
|
if (b) break;
|
2335
2364
|
l.push(r.bMarks[s]), a.push(r.tShift[s]), r.tShift[s] = -1337;
|
2336
2365
|
}
|
2337
|
-
for (
|
2366
|
+
for (d = r.parentType, r.parentType = "blockquote", r.tokens.push({
|
2338
2367
|
type: "blockquote_open",
|
2339
|
-
lines:
|
2368
|
+
lines: u = [e, 0],
|
2340
2369
|
level: r.level++
|
2341
2370
|
}), r.parser.tokenize(r, e, s), r.tokens.push({
|
2342
2371
|
type: "blockquote_close",
|
2343
2372
|
level: --r.level
|
2344
|
-
}), r.parentType =
|
2373
|
+
}), r.parentType = d, u[1] = r.line, f = 0; f < a.length; f++) r.bMarks[f + e] = l[f], r.tShift[f + e] = a[f];
|
2345
2374
|
return r.blkIndent = c, !0;
|
2346
2375
|
}
|
2347
2376
|
function hr(r, e, t, n) {
|
@@ -2391,8 +2420,8 @@ function list(r, e, t, n) {
|
|
2391
2420
|
a,
|
2392
2421
|
l,
|
2393
2422
|
c,
|
2394
|
-
u,
|
2395
2423
|
d,
|
2424
|
+
u,
|
2396
2425
|
h,
|
2397
2426
|
f,
|
2398
2427
|
p,
|
@@ -2402,38 +2431,38 @@ function list(r, e, t, n) {
|
|
2402
2431
|
v,
|
2403
2432
|
y,
|
2404
2433
|
S,
|
2405
|
-
|
2434
|
+
_,
|
2406
2435
|
E,
|
2407
|
-
|
2436
|
+
I = !0,
|
2408
2437
|
w,
|
2409
|
-
|
2410
|
-
|
2411
|
-
|
2438
|
+
x,
|
2439
|
+
q,
|
2440
|
+
F;
|
2412
2441
|
if ((h = skipOrderedListMarker(r, e)) >= 0) g = !0;else if ((h = skipBulletListMarker(r, e)) >= 0) g = !1;else return !1;
|
2413
2442
|
if (r.level >= r.options.maxNesting) return !1;
|
2414
2443
|
if (m = r.src.charCodeAt(h - 1), n) return !0;
|
2415
|
-
for (y = r.tokens.length, g ? (
|
2444
|
+
for (y = r.tokens.length, g ? (u = r.bMarks[e] + r.tShift[e], b = Number(r.src.substr(u, h - u - 1)), r.tokens.push({
|
2416
2445
|
type: "ordered_list_open",
|
2417
2446
|
order: b,
|
2418
|
-
lines:
|
2447
|
+
lines: _ = [e, 0],
|
2419
2448
|
level: r.level++
|
2420
2449
|
})) : r.tokens.push({
|
2421
2450
|
type: "bullet_list_open",
|
2422
|
-
lines:
|
2451
|
+
lines: _ = [e, 0],
|
2423
2452
|
level: r.level++
|
2424
2453
|
}), s = e, S = !1, w = r.parser.ruler.getRules("list"); s < t && (v = r.skipSpaces(h), f = r.eMarks[s], v >= f ? p = 1 : p = v - h, p > 4 && (p = 1), p < 1 && (p = 1), o = h - r.bMarks[s] + p, r.tokens.push({
|
2425
2454
|
type: "list_item_open",
|
2426
2455
|
lines: E = [e, 0],
|
2427
2456
|
level: r.level++
|
2428
|
-
}), l = r.blkIndent, c = r.tight, a = r.tShift[e],
|
2457
|
+
}), l = r.blkIndent, c = r.tight, a = r.tShift[e], d = r.parentType, r.tShift[e] = v - r.bMarks[e], r.blkIndent = o, r.tight = !0, r.parentType = "list", r.parser.tokenize(r, e, t, !0), (!r.tight || S) && (I = !1), S = r.line - e > 1 && r.isEmpty(r.line - 1), r.blkIndent = l, r.tShift[e] = a, r.tight = c, r.parentType = d, r.tokens.push({
|
2429
2458
|
type: "list_item_close",
|
2430
2459
|
level: --r.level
|
2431
2460
|
}), s = e = r.line, E[1] = s, v = r.bMarks[e], !(s >= t || r.isEmpty(s) || r.tShift[s] < r.blkIndent));) {
|
2432
|
-
for (
|
2433
|
-
|
2461
|
+
for (F = !1, x = 0, q = w.length; x < q; x++) if (w[x](r, s, t, !0)) {
|
2462
|
+
F = !0;
|
2434
2463
|
break;
|
2435
2464
|
}
|
2436
|
-
if (
|
2465
|
+
if (F) break;
|
2437
2466
|
if (g) {
|
2438
2467
|
if (h = skipOrderedListMarker(r, s), h < 0) break;
|
2439
2468
|
} else if (h = skipBulletListMarker(r, s), h < 0) break;
|
@@ -2442,7 +2471,7 @@ function list(r, e, t, n) {
|
|
2442
2471
|
return r.tokens.push({
|
2443
2472
|
type: g ? "ordered_list_close" : "bullet_list_close",
|
2444
2473
|
level: --r.level
|
2445
|
-
}),
|
2474
|
+
}), _[1] = s, r.line = s, I && markTightParagraphs(r, y), !0;
|
2446
2475
|
}
|
2447
2476
|
function footnote(r, e, t, n) {
|
2448
2477
|
var s,
|
@@ -2450,14 +2479,14 @@ function footnote(r, e, t, n) {
|
|
2450
2479
|
a,
|
2451
2480
|
l,
|
2452
2481
|
c,
|
2453
|
-
|
2454
|
-
|
2455
|
-
if (
|
2456
|
-
for (l =
|
2482
|
+
d = r.bMarks[e] + r.tShift[e],
|
2483
|
+
u = r.eMarks[e];
|
2484
|
+
if (d + 4 > u || r.src.charCodeAt(d) !== 91 || r.src.charCodeAt(d + 1) !== 94 || r.level >= r.options.maxNesting) return !1;
|
2485
|
+
for (l = d + 2; l < u; l++) {
|
2457
2486
|
if (r.src.charCodeAt(l) === 32) return !1;
|
2458
2487
|
if (r.src.charCodeAt(l) === 93) break;
|
2459
2488
|
}
|
2460
|
-
return l ===
|
2489
|
+
return l === d + 2 || l + 1 >= u || r.src.charCodeAt(++l) !== 58 ? !1 : (n || (l++, r.env.footnotes || (r.env.footnotes = {}), r.env.footnotes.refs || (r.env.footnotes.refs = {}), c = r.src.slice(d + 2, l - 2), r.env.footnotes.refs[":" + c] = -1, r.tokens.push({
|
2461
2490
|
type: "footnote_reference_open",
|
2462
2491
|
label: c,
|
2463
2492
|
level: r.level++
|
@@ -2529,8 +2558,8 @@ function htmlblock(r, e, t, n) {
|
|
2529
2558
|
a,
|
2530
2559
|
l = r.bMarks[e],
|
2531
2560
|
c = r.eMarks[e],
|
2532
|
-
|
2533
|
-
if (l +=
|
2561
|
+
d = r.tShift[e];
|
2562
|
+
if (l += d, !r.options.html || d > 3 || l + 2 >= c || r.src.charCodeAt(l) !== 60) return !1;
|
2534
2563
|
if (s = r.src.charCodeAt(l + 1), s === 33 || s === 63) {
|
2535
2564
|
if (n) return !0;
|
2536
2565
|
} else if (s === 47 || isLetter$1(s)) {
|
@@ -2554,17 +2583,17 @@ function getLine(r, e) {
|
|
2554
2583
|
return r.src.substr(t, n - t);
|
2555
2584
|
}
|
2556
2585
|
function table(r, e, t, n) {
|
2557
|
-
var s, o, a, l, c,
|
2558
|
-
if (e + 2 > t || (c = e + 1, r.tShift[c] < r.blkIndent) || (a = r.bMarks[c] + r.tShift[c], a >= r.eMarks[c]) || (s = r.src.charCodeAt(a), s !== 124 && s !== 45 && s !== 58) || (o = getLine(r, e + 1), !/^[-:| ]+$/.test(o)) || (
|
2559
|
-
for (h = [], l = 0; l <
|
2560
|
-
if (f =
|
2561
|
-
if (l === 0 || l ===
|
2586
|
+
var s, o, a, l, c, d, u, h, f, p, b;
|
2587
|
+
if (e + 2 > t || (c = e + 1, r.tShift[c] < r.blkIndent) || (a = r.bMarks[c] + r.tShift[c], a >= r.eMarks[c]) || (s = r.src.charCodeAt(a), s !== 124 && s !== 45 && s !== 58) || (o = getLine(r, e + 1), !/^[-:| ]+$/.test(o)) || (d = o.split("|"), d <= 2)) return !1;
|
2588
|
+
for (h = [], l = 0; l < d.length; l++) {
|
2589
|
+
if (f = d[l].trim(), !f) {
|
2590
|
+
if (l === 0 || l === d.length - 1) continue;
|
2562
2591
|
return !1;
|
2563
2592
|
}
|
2564
2593
|
if (!/^:?-+:?$/.test(f)) return !1;
|
2565
2594
|
f.charCodeAt(f.length - 1) === 58 ? h.push(f.charCodeAt(0) === 58 ? "center" : "right") : f.charCodeAt(0) === 58 ? h.push("left") : h.push("");
|
2566
2595
|
}
|
2567
|
-
if (o = getLine(r, e).trim(), o.indexOf("|") === -1 || (
|
2596
|
+
if (o = getLine(r, e).trim(), o.indexOf("|") === -1 || (d = o.replace(/^\||\|$/g, "").split("|"), h.length !== d.length)) return !1;
|
2568
2597
|
if (n) return !0;
|
2569
2598
|
for (r.tokens.push({
|
2570
2599
|
type: "table_open",
|
@@ -2578,14 +2607,14 @@ function table(r, e, t, n) {
|
|
2578
2607
|
type: "tr_open",
|
2579
2608
|
lines: [e, e + 1],
|
2580
2609
|
level: r.level++
|
2581
|
-
}), l = 0; l <
|
2610
|
+
}), l = 0; l < d.length; l++) r.tokens.push({
|
2582
2611
|
type: "th_open",
|
2583
2612
|
align: h[l],
|
2584
2613
|
lines: [e, e + 1],
|
2585
2614
|
level: r.level++
|
2586
2615
|
}), r.tokens.push({
|
2587
2616
|
type: "inline",
|
2588
|
-
content:
|
2617
|
+
content: d[l].trim(),
|
2589
2618
|
lines: [e, e + 1],
|
2590
2619
|
level: r.level,
|
2591
2620
|
children: []
|
@@ -2604,16 +2633,16 @@ function table(r, e, t, n) {
|
|
2604
2633
|
lines: b = [e + 2, 0],
|
2605
2634
|
level: r.level++
|
2606
2635
|
}), c = e + 2; c < t && !(r.tShift[c] < r.blkIndent || (o = getLine(r, c).trim(), o.indexOf("|") === -1)); c++) {
|
2607
|
-
for (
|
2636
|
+
for (d = o.replace(/^\||\|$/g, "").split("|"), r.tokens.push({
|
2608
2637
|
type: "tr_open",
|
2609
2638
|
level: r.level++
|
2610
|
-
}), l = 0; l <
|
2639
|
+
}), l = 0; l < d.length; l++) r.tokens.push({
|
2611
2640
|
type: "td_open",
|
2612
2641
|
align: h[l],
|
2613
2642
|
level: r.level++
|
2614
|
-
}),
|
2643
|
+
}), u = d[l].substring(d[l].charCodeAt(0) === 124 ? 1 : 0, d[l].charCodeAt(d[l].length - 1) === 124 ? d[l].length - 1 : d[l].length).trim(), r.tokens.push({
|
2615
2644
|
type: "inline",
|
2616
|
-
content:
|
2645
|
+
content: u,
|
2617
2646
|
level: r.level,
|
2618
2647
|
children: []
|
2619
2648
|
}), r.tokens.push({
|
@@ -2647,14 +2676,14 @@ function markTightParagraphs$1(r, e) {
|
|
2647
2676
|
for (t = e + 2, n = r.tokens.length - 2; t < n; t++) r.tokens[t].level === s && r.tokens[t].type === "paragraph_open" && (r.tokens[t + 2].tight = !0, r.tokens[t].tight = !0, t += 2);
|
2648
2677
|
}
|
2649
2678
|
function deflist(r, e, t, n) {
|
2650
|
-
var s, o, a, l, c,
|
2679
|
+
var s, o, a, l, c, d, u, h, f, p, b, m, g, v;
|
2651
2680
|
if (n) return r.ddIndent < 0 ? !1 : skipMarker(r, e) >= 0;
|
2652
|
-
if (
|
2653
|
-
|
2681
|
+
if (u = e + 1, r.isEmpty(u) && ++u > t || r.tShift[u] < r.blkIndent || (s = skipMarker(r, u), s < 0) || r.level >= r.options.maxNesting) return !1;
|
2682
|
+
d = r.tokens.length, r.tokens.push({
|
2654
2683
|
type: "dl_open",
|
2655
2684
|
lines: c = [e, 0],
|
2656
2685
|
level: r.level++
|
2657
|
-
}), a = e, o =
|
2686
|
+
}), a = e, o = u;
|
2658
2687
|
e: for (;;) {
|
2659
2688
|
for (v = !0, g = !1, r.tokens.push({
|
2660
2689
|
type: "dt_open",
|
@@ -2672,21 +2701,21 @@ function deflist(r, e, t, n) {
|
|
2672
2701
|
});;) {
|
2673
2702
|
if (r.tokens.push({
|
2674
2703
|
type: "dd_open",
|
2675
|
-
lines: l = [
|
2704
|
+
lines: l = [u, 0],
|
2676
2705
|
level: r.level++
|
2677
2706
|
}), m = r.tight, f = r.ddIndent, h = r.blkIndent, b = r.tShift[o], p = r.parentType, r.blkIndent = r.ddIndent = r.tShift[o] + 2, r.tShift[o] = s - r.bMarks[o], r.tight = !0, r.parentType = "deflist", r.parser.tokenize(r, o, t, !0), (!r.tight || g) && (v = !1), g = r.line - o > 1 && r.isEmpty(r.line - 1), r.tShift[o] = b, r.tight = m, r.parentType = p, r.blkIndent = h, r.ddIndent = f, r.tokens.push({
|
2678
2707
|
type: "dd_close",
|
2679
2708
|
level: --r.level
|
2680
|
-
}), l[1] =
|
2681
|
-
if (s = skipMarker(r,
|
2682
|
-
o =
|
2709
|
+
}), l[1] = u = r.line, u >= t || r.tShift[u] < r.blkIndent) break e;
|
2710
|
+
if (s = skipMarker(r, u), s < 0) break;
|
2711
|
+
o = u;
|
2683
2712
|
}
|
2684
|
-
if (
|
2713
|
+
if (u >= t || (a = u, r.isEmpty(a)) || r.tShift[a] < r.blkIndent || (o = a + 1, o >= t) || (r.isEmpty(o) && o++, o >= t) || r.tShift[o] < r.blkIndent || (s = skipMarker(r, o), s < 0)) break;
|
2685
2714
|
}
|
2686
2715
|
return r.tokens.push({
|
2687
2716
|
type: "dl_close",
|
2688
2717
|
level: --r.level
|
2689
|
-
}), c[1] =
|
2718
|
+
}), c[1] = u, r.line = u, v && markTightParagraphs$1(r, d), !0;
|
2690
2719
|
}
|
2691
2720
|
function paragraph(r, e) {
|
2692
2721
|
var t,
|
@@ -2747,8 +2776,8 @@ ParserBlock.prototype.parse = function (r, e, t, n) {
|
|
2747
2776
|
a = 0;
|
2748
2777
|
if (!r) return [];
|
2749
2778
|
r = r.replace(SPACES_RE, " "), r = r.replace(NEWLINES_RE, "\n"), r.indexOf(" ") >= 0 && (r = r.replace(TABS_SCAN_RE, function (l, c) {
|
2750
|
-
var
|
2751
|
-
return r.charCodeAt(c) === 10 ? (o = c + 1, a = 0, l) : (
|
2779
|
+
var d;
|
2780
|
+
return r.charCodeAt(c) === 10 ? (o = c + 1, a = 0, l) : (d = " ".slice((c - o - a) % 4), a = c - o + 1, d);
|
2752
2781
|
})), s = new StateBlock(r, this, e, t, n), this.tokenize(s, s.line, s.lineMax);
|
2753
2782
|
};
|
2754
2783
|
function isTerminatorChar(r) {
|
@@ -2941,9 +2970,9 @@ function scanDelims(r, e) {
|
|
2941
2970
|
a = !0,
|
2942
2971
|
l = !0,
|
2943
2972
|
c = r.posMax,
|
2944
|
-
|
2945
|
-
for (n = e > 0 ? r.src.charCodeAt(e - 1) : -1; t < c && r.src.charCodeAt(t) ===
|
2946
|
-
return t >= c && (a = !1), o = t - e, o >= 4 ? a = l = !1 : (s = t < c ? r.src.charCodeAt(t) : -1, (s === 32 || s === 10) && (a = !1), (n === 32 || n === 10) && (l = !1),
|
2973
|
+
d = r.src.charCodeAt(e);
|
2974
|
+
for (n = e > 0 ? r.src.charCodeAt(e - 1) : -1; t < c && r.src.charCodeAt(t) === d;) t++;
|
2975
|
+
return t >= c && (a = !1), o = t - e, o >= 4 ? a = l = !1 : (s = t < c ? r.src.charCodeAt(t) : -1, (s === 32 || s === 10) && (a = !1), (n === 32 || n === 10) && (l = !1), d === 95 && (isAlphaNum(n) && (a = !1), isAlphaNum(s) && (l = !1))), {
|
2947
2976
|
can_open: a,
|
2948
2977
|
can_close: l,
|
2949
2978
|
delims: o
|
@@ -2957,13 +2986,13 @@ function emphasis(r, e) {
|
|
2957
2986
|
a,
|
2958
2987
|
l,
|
2959
2988
|
c,
|
2960
|
-
|
2961
|
-
|
2962
|
-
h = r.src.charCodeAt(
|
2989
|
+
d = r.posMax,
|
2990
|
+
u = r.pos,
|
2991
|
+
h = r.src.charCodeAt(u);
|
2963
2992
|
if (h !== 95 && h !== 42 || e) return !1;
|
2964
|
-
if (c = scanDelims(r,
|
2993
|
+
if (c = scanDelims(r, u), t = c.delims, !c.can_open) return r.pos += t, e || (r.pending += r.src.slice(u, r.pos)), !0;
|
2965
2994
|
if (r.level >= r.options.maxNesting) return !1;
|
2966
|
-
for (r.pos =
|
2995
|
+
for (r.pos = u + t, l = [t]; r.pos < d;) {
|
2967
2996
|
if (r.src.charCodeAt(r.pos) === h) {
|
2968
2997
|
if (c = scanDelims(r, r.pos), n = c.delims, c.can_close) {
|
2969
2998
|
for (o = l.pop(), a = n; o !== a;) {
|
@@ -2986,7 +3015,7 @@ function emphasis(r, e) {
|
|
2986
3015
|
}
|
2987
3016
|
r.parser.skipToken(r);
|
2988
3017
|
}
|
2989
|
-
return s ? (r.posMax = r.pos, r.pos =
|
3018
|
+
return s ? (r.posMax = r.pos, r.pos = u + t, e || ((t === 2 || t === 3) && r.push({
|
2990
3019
|
type: "strong_open",
|
2991
3020
|
level: r.level++
|
2992
3021
|
}), (t === 1 || t === 3) && r.push({
|
@@ -2998,7 +3027,7 @@ function emphasis(r, e) {
|
|
2998
3027
|
}), (t === 2 || t === 3) && r.push({
|
2999
3028
|
type: "strong_close",
|
3000
3029
|
level: --r.level
|
3001
|
-
})), r.pos = r.posMax + t, r.posMax =
|
3030
|
+
})), r.pos = r.posMax + t, r.posMax = d, !0) : (r.pos = u, !1);
|
3002
3031
|
}
|
3003
3032
|
var UNESCAPE_RE = /\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;
|
3004
3033
|
function sub(r, e) {
|
@@ -3048,27 +3077,27 @@ function links(r, e) {
|
|
3048
3077
|
a,
|
3049
3078
|
l,
|
3050
3079
|
c,
|
3051
|
-
|
3052
|
-
|
3080
|
+
d,
|
3081
|
+
u = !1,
|
3053
3082
|
h = r.pos,
|
3054
3083
|
f = r.posMax,
|
3055
3084
|
p = r.pos,
|
3056
3085
|
b = r.src.charCodeAt(p);
|
3057
|
-
if (b === 33 && (
|
3086
|
+
if (b === 33 && (u = !0, b = r.src.charCodeAt(++p)), b !== 91 || r.level >= r.options.maxNesting || (t = p + 1, n = parseLinkLabel(r, p), n < 0)) return !1;
|
3058
3087
|
if (l = n + 1, l < f && r.src.charCodeAt(l) === 40) {
|
3059
|
-
for (l++; l < f && (
|
3088
|
+
for (l++; l < f && (d = r.src.charCodeAt(l), !(d !== 32 && d !== 10)); l++);
|
3060
3089
|
if (l >= f) return !1;
|
3061
|
-
for (p = l, parseLinkDestination(r, l) ? (o = r.linkContent, l = r.pos) : o = "", p = l; l < f && (
|
3062
|
-
if (l < f && p !== l && parseLinkTitle(r, l)) for (a = r.linkContent, l = r.pos; l < f && (
|
3090
|
+
for (p = l, parseLinkDestination(r, l) ? (o = r.linkContent, l = r.pos) : o = "", p = l; l < f && (d = r.src.charCodeAt(l), !(d !== 32 && d !== 10)); l++);
|
3091
|
+
if (l < f && p !== l && parseLinkTitle(r, l)) for (a = r.linkContent, l = r.pos; l < f && (d = r.src.charCodeAt(l), !(d !== 32 && d !== 10)); l++);else a = "";
|
3063
3092
|
if (l >= f || r.src.charCodeAt(l) !== 41) return r.pos = h, !1;
|
3064
3093
|
l++;
|
3065
3094
|
} else {
|
3066
3095
|
if (r.linkLevel > 0) return !1;
|
3067
|
-
for (; l < f && (
|
3096
|
+
for (; l < f && (d = r.src.charCodeAt(l), !(d !== 32 && d !== 10)); l++);
|
3068
3097
|
if (l < f && r.src.charCodeAt(l) === 91 && (p = l + 1, l = parseLinkLabel(r, l), l >= 0 ? s = r.src.slice(p, l++) : l = p - 1), s || (_typeof(s) > "u" && (l = n + 1), s = r.src.slice(t, n)), c = r.env.references[normalizeReference(s)], !c) return r.pos = h, !1;
|
3069
3098
|
o = c.href, a = c.title;
|
3070
3099
|
}
|
3071
|
-
return e || (r.pos = t, r.posMax = n,
|
3100
|
+
return e || (r.pos = t, r.posMax = n, u ? r.push({
|
3072
3101
|
type: "image",
|
3073
3102
|
src: o,
|
3074
3103
|
title: a,
|
@@ -3460,8 +3489,8 @@ var SetFileTypes = /*#__PURE__*/function () {
|
|
3460
3489
|
if (_typeof(s) == "object") {
|
3461
3490
|
var l = s.files,
|
3462
3491
|
c = s.request,
|
3463
|
-
|
3464
|
-
l && (l.infoModal && (o.files.infoModal = l.infoModal, (a = l.infoModal) != null && a.textMarkDown && (o.infoModalTextMarkUp = n.render(l.infoModal.textMarkDown))), l.acceptedFormats && (o.files.acceptedFormats = l.acceptedFormats), l.maxNumberOfFiles && (o.files.maxNumberOfFiles = l.maxNumberOfFiles)), o.button =
|
3492
|
+
d = s.button;
|
3493
|
+
l && (l.infoModal && (o.files.infoModal = l.infoModal, (a = l.infoModal) != null && a.textMarkDown && (o.infoModalTextMarkUp = n.render(l.infoModal.textMarkDown))), l.acceptedFormats && (o.files.acceptedFormats = l.acceptedFormats), l.maxNumberOfFiles && (o.files.maxNumberOfFiles = l.maxNumberOfFiles)), o.button = d, c && (c.headers || c.method || c.url || e.headers || e.method || e.url) && (o.request = {
|
3465
3494
|
headers: (c == null ? void 0 : c.headers) || e.headers,
|
3466
3495
|
method: (c == null ? void 0 : c.method) || e.method,
|
3467
3496
|
url: (c == null ? void 0 : c.url) || e.url
|
@@ -3485,11 +3514,11 @@ var SetFileTypes = /*#__PURE__*/function () {
|
|
3485
3514
|
key: "processMicrophone",
|
3486
3515
|
value: function processMicrophone(e, t, n, s) {
|
3487
3516
|
var _c$files, _f$maxNumberOfFiles;
|
3488
|
-
var l, c,
|
3517
|
+
var l, c, d, u, h, f;
|
3489
3518
|
var a = _objectSpread({
|
3490
3519
|
acceptedFormats: "audio/*"
|
3491
3520
|
}, ((l = e.fileTypes.audio) == null ? void 0 : l.files) || {});
|
3492
|
-
n && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = SetFileTypes.parseConfig(e.requestSettings, a, t, n), _typeof(n) == "object" && n.files && ((_c$files = (c = e.recordAudio).files) !== null && _c$files !== void 0 ? _c$files : c.files = {}, e.recordAudio.files.format = (
|
3521
|
+
n && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = SetFileTypes.parseConfig(e.requestSettings, a, t, n), _typeof(n) == "object" && n.files && ((_c$files = (c = e.recordAudio).files) !== null && _c$files !== void 0 ? _c$files : c.files = {}, e.recordAudio.files.format = (d = n.files) == null ? void 0 : d.format, e.recordAudio.files.maxDurationSeconds = (u = n.files) == null ? void 0 : u.maxDurationSeconds, (h = e.fileTypes.audio) != null && h.files && ((_f$maxNumberOfFiles = (f = e.fileTypes.audio.files).maxNumberOfFiles) !== null && _f$maxNumberOfFiles !== void 0 ? _f$maxNumberOfFiles : f.maxNumberOfFiles = n.files.maxNumberOfFiles))) : s || (e.fileTypes.audio = SetFileTypes.parseConfig(e.requestSettings, a, t, n)));
|
3493
3522
|
}
|
3494
3523
|
// prettier-ignore
|
3495
3524
|
}, {
|
@@ -3517,11 +3546,11 @@ var SetFileTypes = /*#__PURE__*/function () {
|
|
3517
3546
|
key: "processCamera",
|
3518
3547
|
value: function processCamera(e, t, n, s) {
|
3519
3548
|
var _c$files2;
|
3520
|
-
var l, c,
|
3549
|
+
var l, c, d, u;
|
3521
3550
|
var a = _objectSpread({
|
3522
3551
|
acceptedFormats: "image/*"
|
3523
3552
|
}, ((l = e.fileTypes.images) == null ? void 0 : l.files) || {});
|
3524
|
-
n && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.camera = SetFileTypes.parseConfig(e.requestSettings, a, t, n), _typeof(n) == "object" && (e.camera.modalContainerStyle = n.modalContainerStyle, n.files && ((_c$files2 = (c = e.camera).files) !== null && _c$files2 !== void 0 ? _c$files2 : c.files = {}, e.camera.files.format = (
|
3553
|
+
n && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.camera = SetFileTypes.parseConfig(e.requestSettings, a, t, n), _typeof(n) == "object" && (e.camera.modalContainerStyle = n.modalContainerStyle, n.files && ((_c$files2 = (c = e.camera).files) !== null && _c$files2 !== void 0 ? _c$files2 : c.files = {}, e.camera.files.format = (d = n.files) == null ? void 0 : d.format, e.camera.files.dimensions = (u = n.files) == null ? void 0 : u.dimensions))) : s || (e.fileTypes.images = SetFileTypes.parseConfig(e.requestSettings, a, t, n)));
|
3525
3554
|
}
|
3526
3555
|
// prettier-ignore
|
3527
3556
|
}, {
|
@@ -3576,8 +3605,8 @@ var BaseServiceIO = /*#__PURE__*/function () {
|
|
3576
3605
|
key: "callServiceAPI",
|
3577
3606
|
value: function () {
|
3578
3607
|
var _callServiceAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(e, t, n) {
|
3579
|
-
var _c$headers,
|
3580
|
-
var l, c,
|
3608
|
+
var _c$headers, _d$ContentType;
|
3609
|
+
var l, c, d, u, s, o, a;
|
3581
3610
|
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
3582
3611
|
while (1) switch (_context16.prev = _context16.next) {
|
3583
3612
|
case 0:
|
@@ -3585,7 +3614,7 @@ var BaseServiceIO = /*#__PURE__*/function () {
|
|
3585
3614
|
messages: t
|
3586
3615
|
}, this.rawBody);
|
3587
3616
|
o = !1;
|
3588
|
-
(l = this.requestSettings.headers) != null && l["Content-Type"] || ((_c$headers = (c = this.requestSettings).headers) !== null && _c$headers !== void 0 ? _c$headers : c.headers = {}, (
|
3617
|
+
(l = this.requestSettings.headers) != null && l["Content-Type"] || ((_c$headers = (c = this.requestSettings).headers) !== null && _c$headers !== void 0 ? _c$headers : c.headers = {}, (_d$ContentType = (d = this.requestSettings.headers)["Content-Type"]) !== null && _d$ContentType !== void 0 ? _d$ContentType : d["Content-Type"] = "application/json", o = !0);
|
3589
3618
|
a = this.deepChat.stream;
|
3590
3619
|
if (!(a && (this.demo || _typeof(a) != "object" || !a.simulation))) {
|
3591
3620
|
_context16.next = 9;
|
@@ -3600,7 +3629,7 @@ var BaseServiceIO = /*#__PURE__*/function () {
|
|
3600
3629
|
_context16.next = 11;
|
3601
3630
|
return HTTPRequest.request(this, s, e);
|
3602
3631
|
case 11:
|
3603
|
-
o && ((
|
3632
|
+
o && ((u = this.requestSettings.headers) == null || delete u["Content-Type"]);
|
3604
3633
|
case 12:
|
3605
3634
|
case "end":
|
3606
3635
|
return _context16.stop();
|
@@ -3611,7 +3640,7 @@ var BaseServiceIO = /*#__PURE__*/function () {
|
|
3611
3640
|
return _callServiceAPI.apply(this, arguments);
|
3612
3641
|
}
|
3613
3642
|
return callServiceAPI;
|
3614
|
-
}()
|
3643
|
+
}() // WORK - when a file is sent - but the user is using the stream property the response back is not streamed
|
3615
3644
|
}, {
|
3616
3645
|
key: "callApiWithFiles",
|
3617
3646
|
value: function () {
|
@@ -3651,7 +3680,7 @@ var BaseServiceIO = /*#__PURE__*/function () {
|
|
3651
3680
|
}
|
3652
3681
|
throw new Error("Request settings have not been set up");
|
3653
3682
|
case 2:
|
3654
|
-
n = MessageLimitUtils.processMessages(
|
3683
|
+
n = MessageLimitUtils.processMessages(t.messages, this.maxMessages, this.totalMessagesMaxCharLength);
|
3655
3684
|
if (this.requestSettings.websocket) {
|
3656
3685
|
s = _objectSpread({
|
3657
3686
|
messages: n
|
@@ -3683,7 +3712,7 @@ var BaseServiceIO = /*#__PURE__*/function () {
|
|
3683
3712
|
}
|
3684
3713
|
throw e.error;
|
3685
3714
|
case 2:
|
3686
|
-
return _context19.abrupt("return", e.result ?
|
3715
|
+
return _context19.abrupt("return", e.result ? Legacy.handleResponseProperty(e) : e);
|
3687
3716
|
case 3:
|
3688
3717
|
case "end":
|
3689
3718
|
return _context19.stop();
|
@@ -3709,15 +3738,17 @@ var BaseServiceIO = /*#__PURE__*/function () {
|
|
3709
3738
|
key: "createCustomFormDataBody",
|
3710
3739
|
value: function createCustomFormDataBody(e, t, n) {
|
3711
3740
|
var s = new FormData();
|
3712
|
-
n.forEach(function (
|
3713
|
-
return s.append("files",
|
3714
|
-
}), Object.keys(e).forEach(function (
|
3715
|
-
return s.append(
|
3741
|
+
n.forEach(function (l) {
|
3742
|
+
return s.append("files", l);
|
3743
|
+
}), Object.keys(e).forEach(function (l) {
|
3744
|
+
return s.append(l, String(e[l]));
|
3716
3745
|
});
|
3717
3746
|
var o = 0;
|
3718
|
-
|
3719
|
-
|
3720
|
-
})
|
3747
|
+
t.slice(0, t.length - 1).forEach(function (l) {
|
3748
|
+
s.append("message".concat(o += 1), JSON.stringify(l));
|
3749
|
+
});
|
3750
|
+
var a = t[t.length - 1];
|
3751
|
+
return a.text && (delete a.files, s.append("message".concat(o += 1), JSON.stringify(a))), s;
|
3721
3752
|
}
|
3722
3753
|
}]);
|
3723
3754
|
return BaseServiceIO;
|
@@ -3790,19 +3821,19 @@ var RenderControl = /*#__PURE__*/function () {
|
|
3790
3821
|
return RenderControl;
|
3791
3822
|
}();
|
3792
3823
|
var _InternalHTML = /*#__PURE__*/function (_HTMLElement) {
|
3793
|
-
_inherits(
|
3794
|
-
var _super2 = _createSuper(
|
3824
|
+
_inherits(L, _HTMLElement);
|
3825
|
+
var _super2 = _createSuper(L);
|
3795
3826
|
// If this is not working, try using propertyName directly
|
3796
|
-
function
|
3827
|
+
function L() {
|
3797
3828
|
var _this3;
|
3798
|
-
_classCallCheck(this,
|
3799
|
-
_this3 = _super2.call(this), _this3._waitingToRender_ = !1, _this3._propUpdated_ = !1, Object.keys(
|
3800
|
-
var t =
|
3829
|
+
_classCallCheck(this, L);
|
3830
|
+
_this3 = _super2.call(this), _this3._waitingToRender_ = !1, _this3._propUpdated_ = !1, Object.keys(L._attributeToProperty_).forEach(function (e) {
|
3831
|
+
var t = L._attributeToProperty_[e];
|
3801
3832
|
_this3.constructPropertyAccessors(t), _this3.hasOwnProperty(e) || _this3.constructPropertyAccessors(t, e);
|
3802
3833
|
});
|
3803
3834
|
return _this3;
|
3804
3835
|
}
|
3805
|
-
_createClass(
|
3836
|
+
_createClass(L, [{
|
3806
3837
|
key: "constructPropertyAccessors",
|
3807
3838
|
value:
|
3808
3839
|
// need to be called here as accessors need to be set for the class instance
|
@@ -3821,8 +3852,8 @@ var _InternalHTML = /*#__PURE__*/function (_HTMLElement) {
|
|
3821
3852
|
key: "attributeChangedCallback",
|
3822
3853
|
value: function attributeChangedCallback(e, t, n) {
|
3823
3854
|
if (t === n) return;
|
3824
|
-
var s =
|
3825
|
-
o =
|
3855
|
+
var s = L._attributes_[e](n),
|
3856
|
+
o = L._attributeToProperty_[e];
|
3826
3857
|
this[o] = s;
|
3827
3858
|
}
|
3828
3859
|
}, {
|
@@ -3831,10 +3862,10 @@ var _InternalHTML = /*#__PURE__*/function (_HTMLElement) {
|
|
3831
3862
|
}], [{
|
3832
3863
|
key: "observedAttributes",
|
3833
3864
|
get: function get() {
|
3834
|
-
return Object.keys(
|
3865
|
+
return Object.keys(L._attributes_) || [];
|
3835
3866
|
}
|
3836
3867
|
}]);
|
3837
|
-
return
|
3868
|
+
return L;
|
3838
3869
|
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
3839
3870
|
_InternalHTML._attributes_ = {};
|
3840
3871
|
_InternalHTML._attributeToProperty_ = {};
|
@@ -3854,15 +3885,15 @@ var SVGIconUtils = /*#__PURE__*/function () {
|
|
3854
3885
|
return SVGIconUtils;
|
3855
3886
|
}();
|
3856
3887
|
var _VisibilityIcon = /*#__PURE__*/function () {
|
3857
|
-
function
|
3858
|
-
_classCallCheck(this,
|
3888
|
+
function O() {
|
3889
|
+
_classCallCheck(this, O);
|
3859
3890
|
}
|
3860
|
-
_createClass(
|
3891
|
+
_createClass(O, null, [{
|
3861
3892
|
key: "changeVisibility",
|
3862
3893
|
value:
|
3863
3894
|
// prettier-ignore
|
3864
3895
|
function changeVisibility(e, t, n, s) {
|
3865
|
-
s.target.id ===
|
3896
|
+
s.target.id === O.VISIBLE_ICON_ID ? (t.style.display = "none", n.style.display = "block", e.type = "password") : (t.style.display = "block", n.style.display = "none", e.type = "text");
|
3866
3897
|
}
|
3867
3898
|
}, {
|
3868
3899
|
key: "createIconElement",
|
@@ -3876,13 +3907,13 @@ var _VisibilityIcon = /*#__PURE__*/function () {
|
|
3876
3907
|
value: function create(e) {
|
3877
3908
|
var t = document.createElement("div");
|
3878
3909
|
t.id = "visibility-icon-container";
|
3879
|
-
var n =
|
3910
|
+
var n = O.createIconElement(VISIBLE_ICON_STRING, O.VISIBLE_ICON_ID);
|
3880
3911
|
n.style.display = "none", t.appendChild(n);
|
3881
|
-
var s =
|
3882
|
-
return t.appendChild(s), t.onclick =
|
3912
|
+
var s = O.createIconElement(NOT_VISIBLE_ICON_STRING, "not-visible-icon");
|
3913
|
+
return t.appendChild(s), t.onclick = O.changeVisibility.bind(this, e, n, s), t;
|
3883
3914
|
}
|
3884
3915
|
}]);
|
3885
|
-
return
|
3916
|
+
return O;
|
3886
3917
|
}();
|
3887
3918
|
_VisibilityIcon.VISIBLE_ICON_ID = "visible-icon";
|
3888
3919
|
var VisibilityIcon = _VisibilityIcon;
|
@@ -3988,8 +4019,8 @@ var InsertKeyView = /*#__PURE__*/function () {
|
|
3988
4019
|
var l = InsertKeyView.createStartButton(),
|
3989
4020
|
_InsertKeyView$create = InsertKeyView.createHelpTextContainer(t.getKeyLink),
|
3990
4021
|
c = _InsertKeyView$create.helpTextContainerElement,
|
3991
|
-
|
3992
|
-
return n.appendChild(l), n.appendChild(c), InsertKeyView.addVerificationEvents(o, l,
|
4022
|
+
d = _InsertKeyView$create.failTextElement;
|
4023
|
+
return n.appendChild(l), n.appendChild(c), InsertKeyView.addVerificationEvents(o, l, d, e, t), n;
|
3993
4024
|
}
|
3994
4025
|
}, {
|
3995
4026
|
key: "createElements",
|
@@ -4041,17 +4072,17 @@ var HuggingFaceUtils = /*#__PURE__*/function () {
|
|
4041
4072
|
return HuggingFaceUtils;
|
4042
4073
|
}();
|
4043
4074
|
var _HuggingFaceIO = /*#__PURE__*/function (_DirectServiceIO) {
|
4044
|
-
_inherits(
|
4045
|
-
var _super3 = _createSuper(
|
4075
|
+
_inherits(j, _DirectServiceIO);
|
4076
|
+
var _super3 = _createSuper(j);
|
4046
4077
|
// prettier-ignore
|
4047
|
-
function
|
4078
|
+
function j(e, t, n, s, o, a) {
|
4048
4079
|
var _this4;
|
4049
|
-
_classCallCheck(this,
|
4050
|
-
_this4 = _super3.call(this, e, HuggingFaceUtils.buildKeyVerificationDetails(), HuggingFaceUtils.buildHeaders, o, a), _this4.insertKeyPlaceholderText = "Hugging Face Token", _this4.getKeyLink = "https://huggingface.co/settings/tokens", _this4.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this4.permittedErrorPrefixes = ["Authorization header"], _this4.url = "".concat(
|
4080
|
+
_classCallCheck(this, j);
|
4081
|
+
_this4 = _super3.call(this, e, HuggingFaceUtils.buildKeyVerificationDetails(), HuggingFaceUtils.buildHeaders, o, a), _this4.insertKeyPlaceholderText = "Hugging Face Token", _this4.getKeyLink = "https://huggingface.co/settings/tokens", _this4.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this4.permittedErrorPrefixes = ["Authorization header"], _this4.url = "".concat(j.URL_PREFIX).concat(n), _this4.textInputPlaceholderText = t, _typeof(s) == "object" && (s.model && (_this4.url = "".concat(j.URL_PREFIX).concat(s.model)), s.options && (_this4.rawBody.options = s.options), s.parameters && (_this4.rawBody.parameters = s.parameters));
|
4051
4082
|
return _this4;
|
4052
4083
|
}
|
4053
4084
|
// prettier-ignore
|
4054
|
-
_createClass(
|
4085
|
+
_createClass(j, [{
|
4055
4086
|
key: "preprocessBody",
|
4056
4087
|
value: function preprocessBody(e, t, n) {
|
4057
4088
|
var _s$options;
|
@@ -4089,7 +4120,7 @@ var _HuggingFaceIO = /*#__PURE__*/function (_DirectServiceIO) {
|
|
4089
4120
|
return callServiceAPI;
|
4090
4121
|
}()
|
4091
4122
|
}]);
|
4092
|
-
return
|
4123
|
+
return j;
|
4093
4124
|
}(DirectServiceIO);
|
4094
4125
|
_HuggingFaceIO.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
4095
4126
|
var HuggingFaceIO = _HuggingFaceIO;
|
@@ -4702,12 +4733,13 @@ var HuggingFaceConversationIO = /*#__PURE__*/function (_HuggingFaceIO6) {
|
|
4702
4733
|
_inherits(HuggingFaceConversationIO, _HuggingFaceIO6);
|
4703
4734
|
var _super14 = _createSuper(HuggingFaceConversationIO);
|
4704
4735
|
function HuggingFaceConversationIO(e) {
|
4736
|
+
var _this10$maxMessages;
|
4705
4737
|
var _this10;
|
4706
4738
|
_classCallCheck(this, HuggingFaceConversationIO);
|
4707
4739
|
var s, o, a;
|
4708
4740
|
var t = (o = (s = e.directConnection) == null ? void 0 : s.huggingFace) == null ? void 0 : o.conversation,
|
4709
4741
|
n = (a = e.directConnection) == null ? void 0 : a.huggingFace;
|
4710
|
-
_this10 = _super14.call(this, e, "Ask me anything!", "facebook/blenderbot-400M-distill", t, n), _this10.maxMessages
|
4742
|
+
_this10 = _super14.call(this, e, "Ask me anything!", "facebook/blenderbot-400M-distill", t, n), (_this10$maxMessages = _this10.maxMessages) !== null && _this10$maxMessages !== void 0 ? _this10$maxMessages : _this10.maxMessages = -1;
|
4711
4743
|
return _this10;
|
4712
4744
|
}
|
4713
4745
|
// prettier-ignore
|
@@ -5534,10 +5566,10 @@ var AzureSummarizationIO = /*#__PURE__*/function (_AzureLanguageIO) {
|
|
5534
5566
|
return AzureSummarizationIO;
|
5535
5567
|
}(AzureLanguageIO);
|
5536
5568
|
var _OpenAIConverseBaseBody = /*#__PURE__*/function () {
|
5537
|
-
function
|
5538
|
-
_classCallCheck(this,
|
5569
|
+
function G() {
|
5570
|
+
_classCallCheck(this, G);
|
5539
5571
|
}
|
5540
|
-
_createClass(
|
5572
|
+
_createClass(G, null, [{
|
5541
5573
|
key: "generateDefaultBody",
|
5542
5574
|
value: function generateDefaultBody(e) {
|
5543
5575
|
return {
|
@@ -5547,20 +5579,20 @@ var _OpenAIConverseBaseBody = /*#__PURE__*/function () {
|
|
5547
5579
|
}, {
|
5548
5580
|
key: "build",
|
5549
5581
|
value: function build(e, t) {
|
5550
|
-
var n =
|
5582
|
+
var n = G.generateDefaultBody(e);
|
5551
5583
|
return !t || typeof t == "boolean" ? n : Object.assign(n, t);
|
5552
5584
|
}
|
5553
5585
|
}]);
|
5554
|
-
return
|
5586
|
+
return G;
|
5555
5587
|
}();
|
5556
5588
|
_OpenAIConverseBaseBody.GPT_COMPLETIONS_DAVINCI_MODEL = "text-davinci-003";
|
5557
5589
|
_OpenAIConverseBaseBody.GPT_CHAT_TURBO_MODEL = "gpt-3.5-turbo";
|
5558
5590
|
var OpenAIConverseBaseBody = _OpenAIConverseBaseBody;
|
5559
5591
|
var _OpenAIUtils = /*#__PURE__*/function () {
|
5560
|
-
function
|
5561
|
-
_classCallCheck(this,
|
5592
|
+
function V() {
|
5593
|
+
_classCallCheck(this, V);
|
5562
5594
|
}
|
5563
|
-
_createClass(
|
5595
|
+
_createClass(V, null, [{
|
5564
5596
|
key: "buildHeaders",
|
5565
5597
|
value: function buildHeaders(e) {
|
5566
5598
|
return {
|
@@ -5581,11 +5613,11 @@ var _OpenAIUtils = /*#__PURE__*/function () {
|
|
5581
5613
|
return {
|
5582
5614
|
url: "https://api.openai.com/v1/models",
|
5583
5615
|
method: "GET",
|
5584
|
-
handleVerificationResult:
|
5616
|
+
handleVerificationResult: V.handleVerificationResult
|
5585
5617
|
};
|
5586
5618
|
}
|
5587
5619
|
}]);
|
5588
|
-
return
|
5620
|
+
return V;
|
5589
5621
|
}();
|
5590
5622
|
_OpenAIUtils.CONVERSE_MAX_CHAR_LENGTH = 13352;
|
5591
5623
|
_OpenAIUtils.FILE_MAX_CHAR_LENGTH = 1e3;
|
@@ -5687,7 +5719,7 @@ var AssemblyAIUtils = /*#__PURE__*/function () {
|
|
5687
5719
|
key: "poll",
|
5688
5720
|
value: function () {
|
5689
5721
|
var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(e, t) {
|
5690
|
-
var n, l, c,
|
5722
|
+
var n, l, c, u;
|
5691
5723
|
return _regeneratorRuntime().wrap(function _callee48$(_context48) {
|
5692
5724
|
while (1) switch (_context48.prev = _context48.next) {
|
5693
5725
|
case 0:
|
@@ -5723,20 +5755,20 @@ var AssemblyAIUtils = /*#__PURE__*/function () {
|
|
5723
5755
|
_context48.next = 13;
|
5724
5756
|
return _context48.sent.json();
|
5725
5757
|
case 13:
|
5726
|
-
|
5727
|
-
if (!(
|
5758
|
+
u = _context48.sent;
|
5759
|
+
if (!(u.status === "completed")) {
|
5728
5760
|
_context48.next = 18;
|
5729
5761
|
break;
|
5730
5762
|
}
|
5731
|
-
c =
|
5763
|
+
c = u;
|
5732
5764
|
_context48.next = 22;
|
5733
5765
|
break;
|
5734
5766
|
case 18:
|
5735
|
-
if (!(
|
5767
|
+
if (!(u.status === "error")) {
|
5736
5768
|
_context48.next = 20;
|
5737
5769
|
break;
|
5738
5770
|
}
|
5739
|
-
throw new Error("Transcription failed: ".concat(
|
5771
|
+
throw new Error("Transcription failed: ".concat(u.error));
|
5740
5772
|
case 20:
|
5741
5773
|
_context48.next = 22;
|
5742
5774
|
return new Promise(function (h) {
|
@@ -5886,20 +5918,20 @@ var AzureSpeechIO = /*#__PURE__*/function (_DirectServiceIO7) {
|
|
5886
5918
|
return _createClass(AzureSpeechIO);
|
5887
5919
|
}(DirectServiceIO);
|
5888
5920
|
var _AzureTextToSpeechIO = /*#__PURE__*/function (_AzureSpeechIO) {
|
5889
|
-
_inherits(
|
5890
|
-
var _super27 = _createSuper(
|
5921
|
+
_inherits(K, _AzureSpeechIO);
|
5922
|
+
var _super27 = _createSuper(K);
|
5891
5923
|
// prettier-ignore
|
5892
|
-
function
|
5893
|
-
var _l$lang, _c$name,
|
5924
|
+
function K(e) {
|
5925
|
+
var _l$lang, _c$name, _d$gender;
|
5894
5926
|
var _this20;
|
5895
|
-
_classCallCheck(this,
|
5896
|
-
var s, o, a, l, c,
|
5927
|
+
_classCallCheck(this, K);
|
5928
|
+
var s, o, a, l, c, d;
|
5897
5929
|
var t = (o = (s = e.directConnection) == null ? void 0 : s.azure) == null ? void 0 : o.textToSpeech,
|
5898
5930
|
n = (a = e.directConnection) == null ? void 0 : a.azure;
|
5899
|
-
_this20 = _super27.call(this, e, AzureUtils.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, n), _this20.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(
|
5931
|
+
_this20 = _super27.call(this, e, AzureUtils.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, n), _this20.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(K.HELP_LINK, "\">here</a> for more info.\n </p>"), _this20.url = "", Object.assign(_this20.rawBody, t), (_l$lang = (l = _this20.rawBody).lang) !== null && _l$lang !== void 0 ? _l$lang : l.lang = "en-US", (_c$name = (c = _this20.rawBody).name) !== null && _c$name !== void 0 ? _c$name : c.name = "en-US-JennyNeural", (_d$gender = (d = _this20.rawBody).gender) !== null && _d$gender !== void 0 ? _d$gender : d.gender = "Female", _this20.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1");
|
5900
5932
|
return _this20;
|
5901
5933
|
}
|
5902
|
-
_createClass(
|
5934
|
+
_createClass(K, [{
|
5903
5935
|
key: "preprocessBody",
|
5904
5936
|
value: function preprocessBody(e, t) {
|
5905
5937
|
var n = t[t.length - 1].text;
|
@@ -5962,18 +5994,18 @@ var _AzureTextToSpeechIO = /*#__PURE__*/function (_AzureSpeechIO) {
|
|
5962
5994
|
return extractResultData;
|
5963
5995
|
}()
|
5964
5996
|
}]);
|
5965
|
-
return
|
5997
|
+
return K;
|
5966
5998
|
}(AzureSpeechIO);
|
5967
5999
|
_AzureTextToSpeechIO.HELP_LINK =
|
5968
6000
|
// eslint-disable-next-line max-len
|
5969
6001
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
5970
6002
|
var AzureTextToSpeechIO = _AzureTextToSpeechIO;
|
5971
6003
|
var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
|
5972
|
-
_inherits(
|
5973
|
-
var _super28 = _createSuper(
|
5974
|
-
function
|
6004
|
+
_inherits(z, _AzureSpeechIO2);
|
6005
|
+
var _super28 = _createSuper(z);
|
6006
|
+
function z(e) {
|
5975
6007
|
var _this21;
|
5976
|
-
_classCallCheck(this,
|
6008
|
+
_classCallCheck(this, z);
|
5977
6009
|
var a, l, c;
|
5978
6010
|
var t = (l = (a = e.directConnection) == null ? void 0 : a.azure) == null ? void 0 : l.speechToText,
|
5979
6011
|
n = (c = e.directConnection) == null ? void 0 : c.azure,
|
@@ -5984,12 +6016,12 @@ var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
|
|
5984
6016
|
}
|
5985
6017
|
}
|
5986
6018
|
};
|
5987
|
-
_this21 = _super28.call(this, e, AzureUtils.buildSpeechToTextHeaders, t.region, n, s), _this21.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(
|
6019
|
+
_this21 = _super28.call(this, e, AzureUtils.buildSpeechToTextHeaders, t.region, n, s), _this21.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(z.HELP_LINK, "\">here</a> for more info.\n </p>"), _this21.url = "", _this21.isTextInputDisabled = !0, _this21.textInputPlaceholderText = "Upload an audio file", _this21.canSendMessage = z.canFileSendMessage;
|
5988
6020
|
var o = t.lang || "en-US";
|
5989
6021
|
_this21.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(o, "&format=detailed"), _this21.recordAudio = void 0;
|
5990
6022
|
return _this21;
|
5991
6023
|
}
|
5992
|
-
_createClass(
|
6024
|
+
_createClass(z, [{
|
5993
6025
|
key: "callServiceAPI",
|
5994
6026
|
value: function () {
|
5995
6027
|
var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(e, t, n) {
|
@@ -6054,7 +6086,7 @@ var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
|
|
6054
6086
|
return !!(t != null && t[0]);
|
6055
6087
|
}
|
6056
6088
|
}]);
|
6057
|
-
return
|
6089
|
+
return z;
|
6058
6090
|
}(AzureSpeechIO);
|
6059
6091
|
_AzureSpeechToTextIO.HELP_LINK =
|
6060
6092
|
// eslint-disable-next-line max-len
|
@@ -6303,39 +6335,39 @@ _OpenAIImagesIO.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variati
|
|
6303
6335
|
_OpenAIImagesIO.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
|
6304
6336
|
var OpenAIImagesIO = _OpenAIImagesIO;
|
6305
6337
|
var _OpenAIAudioIO = /*#__PURE__*/function (_DirectServiceIO10) {
|
6306
|
-
_inherits(
|
6307
|
-
var _super31 = _createSuper(
|
6308
|
-
function
|
6338
|
+
_inherits(M, _DirectServiceIO10);
|
6339
|
+
var _super31 = _createSuper(M);
|
6340
|
+
function M(e) {
|
6309
6341
|
var _l$model2;
|
6310
6342
|
var _this24;
|
6311
|
-
_classCallCheck(this,
|
6343
|
+
_classCallCheck(this, M);
|
6312
6344
|
var a, l;
|
6313
6345
|
var t = e.textInput,
|
6314
6346
|
n = JSON.parse(JSON.stringify(e.directConnection)),
|
6315
6347
|
s = n == null ? void 0 : n.openAI;
|
6316
6348
|
_this24 = _super31.call(this, e, OpenAIUtils.buildKeyVerificationDetails(), OpenAIUtils.buildHeaders, s, {
|
6317
6349
|
audio: {}
|
6318
|
-
}), _this24.insertKeyPlaceholderText = "OpenAI API Key", _this24.getKeyLink = "https://platform.openai.com/account/api-keys", _this24.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI Whisper</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/api-reference/audio/create\">here</a> for more info.</p>", _this24.url = "", _this24.permittedErrorPrefixes = ["Invalid"], _this24._maxCharLength = OpenAIUtils.FILE_MAX_CHAR_LENGTH, _this24._service_url =
|
6350
|
+
}), _this24.insertKeyPlaceholderText = "OpenAI API Key", _this24.getKeyLink = "https://platform.openai.com/account/api-keys", _this24.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI Whisper</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/api-reference/audio/create\">here</a> for more info.</p>", _this24.url = "", _this24.permittedErrorPrefixes = ["Invalid"], _this24._maxCharLength = OpenAIUtils.FILE_MAX_CHAR_LENGTH, _this24._service_url = M.AUDIO_TRANSCRIPTIONS_URL, t != null && t.characterLimit && (_this24._maxCharLength = t.characterLimit);
|
6319
6351
|
var o = (a = n == null ? void 0 : n.openAI) == null ? void 0 : a.audio;
|
6320
|
-
_typeof(o) == "object" && (_this24.processConfig(o),
|
6352
|
+
_typeof(o) == "object" && (_this24.processConfig(o), M.cleanConfig(o), Object.assign(_this24.rawBody, o)), (_l$model2 = (l = _this24.rawBody).model) !== null && _l$model2 !== void 0 ? _l$model2 : l.model = M.DEFAULT_MODEL, _this24.rawBody.response_format = "json", _this24.canSendMessage = M.canSendFileMessage;
|
6321
6353
|
return _this24;
|
6322
6354
|
}
|
6323
|
-
_createClass(
|
6355
|
+
_createClass(M, [{
|
6324
6356
|
key: "processConfig",
|
6325
6357
|
value: function processConfig(e) {
|
6326
|
-
e != null && e.type && e.type === "translation" && (this._service_url =
|
6358
|
+
e != null && e.type && e.type === "translation" && (this._service_url = M.AUDIO_TRANSLATIONS_URL, delete e.language);
|
6327
6359
|
}
|
6328
6360
|
}, {
|
6329
6361
|
key: "preprocessBody",
|
6330
|
-
value: function preprocessBody(e, t
|
6331
|
-
var
|
6332
|
-
var
|
6333
|
-
|
6334
|
-
if (
|
6335
|
-
var
|
6336
|
-
|
6362
|
+
value: function preprocessBody(e, t) {
|
6363
|
+
var o, a;
|
6364
|
+
var n = JSON.parse(JSON.stringify(e)),
|
6365
|
+
s = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim();
|
6366
|
+
if (s && s !== "") {
|
6367
|
+
var l = s.substring(0, this._maxCharLength);
|
6368
|
+
n.prompt = l;
|
6337
6369
|
}
|
6338
|
-
return
|
6370
|
+
return n;
|
6339
6371
|
}
|
6340
6372
|
// prettier-ignore
|
6341
6373
|
}, {
|
@@ -6359,7 +6391,7 @@ var _OpenAIAudioIO = /*#__PURE__*/function (_DirectServiceIO10) {
|
|
6359
6391
|
throw new Error("No file was added");
|
6360
6392
|
case 4:
|
6361
6393
|
this.url = this.requestSettings.url || this._service_url;
|
6362
|
-
s = this.preprocessBody(this.rawBody, t
|
6394
|
+
s = this.preprocessBody(this.rawBody, t), o = M.createFormDataBody(s, n[0]);
|
6363
6395
|
RequestUtils.temporarilyRemoveHeader(this.requestSettings, HTTPRequest.request.bind(this, this, o, e), !1);
|
6364
6396
|
case 7:
|
6365
6397
|
case "end":
|
@@ -6418,7 +6450,7 @@ var _OpenAIAudioIO = /*#__PURE__*/function (_DirectServiceIO10) {
|
|
6418
6450
|
}), n;
|
6419
6451
|
}
|
6420
6452
|
}]);
|
6421
|
-
return
|
6453
|
+
return M;
|
6422
6454
|
}(DirectServiceIO);
|
6423
6455
|
_OpenAIAudioIO.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions";
|
6424
6456
|
_OpenAIAudioIO.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations";
|
@@ -6428,7 +6460,7 @@ var OpenAIChatIO = /*#__PURE__*/function (_DirectServiceIO11) {
|
|
6428
6460
|
_inherits(OpenAIChatIO, _DirectServiceIO11);
|
6429
6461
|
var _super32 = _createSuper(OpenAIChatIO);
|
6430
6462
|
function OpenAIChatIO(e) {
|
6431
|
-
var _a$model;
|
6463
|
+
var _this25$maxMessages, _a$model;
|
6432
6464
|
var _this25;
|
6433
6465
|
_classCallCheck(this, OpenAIChatIO);
|
6434
6466
|
var o, a;
|
@@ -6436,7 +6468,7 @@ var OpenAIChatIO = /*#__PURE__*/function (_DirectServiceIO11) {
|
|
6436
6468
|
n = t.openAI;
|
6437
6469
|
_this25 = _super32.call(this, e, OpenAIUtils.buildKeyVerificationDetails(), OpenAIUtils.buildHeaders, n), _this25.insertKeyPlaceholderText = "OpenAI API Key", _this25.getKeyLink = "https://platform.openai.com/account/api-keys", _this25.url = "https://api.openai.com/v1/chat/completions", _this25.permittedErrorPrefixes = ["Incorrect"], _this25._systemMessage = OpenAIChatIO.generateSystemMessage("You are a helpful assistant.");
|
6438
6470
|
var s = (o = t.openAI) == null ? void 0 : o.chat;
|
6439
|
-
_typeof(s) == "object" && (s.system_prompt && (_this25._systemMessage = OpenAIChatIO.generateSystemMessage(s.system_prompt)), _this25.cleanConfig(s), Object.assign(_this25.rawBody, s)), _this25.maxMessages
|
6471
|
+
_typeof(s) == "object" && (s.system_prompt && (_this25._systemMessage = OpenAIChatIO.generateSystemMessage(s.system_prompt)), _this25.cleanConfig(s), Object.assign(_this25.rawBody, s)), (_this25$maxMessages = _this25.maxMessages) !== null && _this25$maxMessages !== void 0 ? _this25$maxMessages : _this25.maxMessages = -1, (_a$model = (a = _this25.rawBody).model) !== null && _a$model !== void 0 ? _a$model : a.model = OpenAIConverseBaseBody.GPT_CHAT_TURBO_MODEL;
|
6440
6472
|
return _this25;
|
6441
6473
|
}
|
6442
6474
|
_createClass(OpenAIChatIO, [{
|
@@ -6531,13 +6563,14 @@ var CohereChatIO = /*#__PURE__*/function (_CohereIO3) {
|
|
6531
6563
|
_inherits(CohereChatIO, _CohereIO3);
|
6532
6564
|
var _super33 = _createSuper(CohereChatIO);
|
6533
6565
|
function CohereChatIO(e) {
|
6566
|
+
var _this26$maxMessages;
|
6534
6567
|
var _this26;
|
6535
6568
|
_classCallCheck(this, CohereChatIO);
|
6536
6569
|
var o;
|
6537
6570
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6538
6571
|
n = (o = t.cohere) == null ? void 0 : o.chat,
|
6539
6572
|
s = t.cohere;
|
6540
|
-
_this26 = _super33.call(this, e, "https://api.cohere.ai/v1/chat", "Ask me anything!", n, s), _this26.username = "USER", _typeof(n) == "object" && (n.user_name && (_this26.username = n.user_name), _this26.cleanConfig(n), Object.assign(_this26.rawBody, n)), _this26.maxMessages
|
6573
|
+
_this26 = _super33.call(this, e, "https://api.cohere.ai/v1/chat", "Ask me anything!", n, s), _this26.username = "USER", _typeof(n) == "object" && (n.user_name && (_this26.username = n.user_name), _this26.cleanConfig(n), Object.assign(_this26.rawBody, n)), (_this26$maxMessages = _this26.maxMessages) !== null && _this26$maxMessages !== void 0 ? _this26$maxMessages : _this26.maxMessages = -1;
|
6541
6574
|
return _this26;
|
6542
6575
|
}
|
6543
6576
|
_createClass(CohereChatIO, [{
|
@@ -6643,22 +6676,22 @@ var ServiceIOFactory = /*#__PURE__*/function () {
|
|
6643
6676
|
return ServiceIOFactory;
|
6644
6677
|
}();
|
6645
6678
|
var _GoogleFont = /*#__PURE__*/function () {
|
6646
|
-
function
|
6647
|
-
_classCallCheck(this,
|
6679
|
+
function H() {
|
6680
|
+
_classCallCheck(this, H);
|
6648
6681
|
}
|
6649
|
-
_createClass(
|
6682
|
+
_createClass(H, null, [{
|
6650
6683
|
key: "appendStyleSheetToHead",
|
6651
6684
|
value: function appendStyleSheetToHead() {
|
6652
6685
|
var e = document.getElementsByTagName("head")[0];
|
6653
6686
|
if (!Array.from(e.getElementsByTagName("link")).some(function (n) {
|
6654
|
-
return n.getAttribute("href") ===
|
6687
|
+
return n.getAttribute("href") === H.FONT_URL;
|
6655
6688
|
})) {
|
6656
6689
|
var n = document.createElement("link");
|
6657
|
-
n.rel = "stylesheet", n.href =
|
6690
|
+
n.rel = "stylesheet", n.href = H.FONT_URL, e.appendChild(n);
|
6658
6691
|
}
|
6659
6692
|
}
|
6660
6693
|
}]);
|
6661
|
-
return
|
6694
|
+
return H;
|
6662
6695
|
}();
|
6663
6696
|
_GoogleFont.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap";
|
6664
6697
|
var GoogleFont = _GoogleFont;
|
@@ -6722,10 +6755,10 @@ var FireEvents = /*#__PURE__*/function () {
|
|
6722
6755
|
return FireEvents;
|
6723
6756
|
}();
|
6724
6757
|
var _ElementUtils = /*#__PURE__*/function () {
|
6725
|
-
function
|
6726
|
-
_classCallCheck(this,
|
6758
|
+
function $() {
|
6759
|
+
_classCallCheck(this, $);
|
6727
6760
|
}
|
6728
|
-
_createClass(
|
6761
|
+
_createClass($, null, [{
|
6729
6762
|
key: "addElements",
|
6730
6763
|
value: function addElements(e) {
|
6731
6764
|
for (var _len = arguments.length, t = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
@@ -6742,7 +6775,7 @@ var _ElementUtils = /*#__PURE__*/function () {
|
|
6742
6775
|
n = e.clientHeight,
|
6743
6776
|
s = e.scrollTop,
|
6744
6777
|
o = t - n;
|
6745
|
-
return s >= o -
|
6778
|
+
return s >= o - $.CODE_SNIPPET_GENERATION_JUMP;
|
6746
6779
|
}
|
6747
6780
|
}, {
|
6748
6781
|
key: "cloneElement",
|
@@ -6751,15 +6784,15 @@ var _ElementUtils = /*#__PURE__*/function () {
|
|
6751
6784
|
return e.parentNode.replaceChild(t, e), t;
|
6752
6785
|
}
|
6753
6786
|
}]);
|
6754
|
-
return
|
6787
|
+
return $;
|
6755
6788
|
}();
|
6756
6789
|
_ElementUtils.CODE_SNIPPET_GENERATION_JUMP = 0.5;
|
6757
6790
|
var ElementUtils = _ElementUtils;
|
6758
6791
|
var _TextToSpeech = /*#__PURE__*/function () {
|
6759
|
-
function
|
6760
|
-
_classCallCheck(this,
|
6792
|
+
function Y() {
|
6793
|
+
_classCallCheck(this, Y);
|
6761
6794
|
}
|
6762
|
-
_createClass(
|
6795
|
+
_createClass(Y, null, [{
|
6763
6796
|
key: "speak",
|
6764
6797
|
value: function speak(e, t) {
|
6765
6798
|
if (window.SpeechSynthesisUtterance) {
|
@@ -6780,10 +6813,10 @@ var _TextToSpeech = /*#__PURE__*/function () {
|
|
6780
6813
|
s && (n.voice = s);
|
6781
6814
|
}
|
6782
6815
|
t(n);
|
6783
|
-
},
|
6816
|
+
}, Y.LOAD_VOICES_MS);
|
6784
6817
|
}
|
6785
6818
|
}]);
|
6786
|
-
return
|
6819
|
+
return Y;
|
6787
6820
|
}();
|
6788
6821
|
_TextToSpeech.LOAD_VOICES_MS = 200;
|
6789
6822
|
var TextToSpeech = _TextToSpeech;
|
@@ -6881,7 +6914,7 @@ var HTMLUtils = /*#__PURE__*/function () {
|
|
6881
6914
|
}, {
|
6882
6915
|
key: "apply",
|
6883
6916
|
value: function apply(e, t) {
|
6884
|
-
HTMLDeepChatElements.applyDeepChatUtilities(e, e.
|
6917
|
+
HTMLDeepChatElements.applyDeepChatUtilities(e, e.htmlClassUtilities, t), HTMLUtils.applyCustomClassUtilities(e.htmlClassUtilities, t);
|
6885
6918
|
}
|
6886
6919
|
}]);
|
6887
6920
|
return HTMLUtils;
|
@@ -6927,7 +6960,8 @@ var HTMLDeepChatElements = /*#__PURE__*/function () {
|
|
6927
6960
|
}, {
|
6928
6961
|
key: "isElementTemporary",
|
6929
6962
|
value: function isElementTemporary(e) {
|
6930
|
-
|
6963
|
+
var t;
|
6964
|
+
return e ? (t = e.bubbleElement.children[0]) == null ? void 0 : t.classList.contains(DEEP_CHAT_TEMPORARY_MESSAGE) : !1;
|
6931
6965
|
}
|
6932
6966
|
}, {
|
6933
6967
|
key: "doesElementContainDeepChatClass",
|
@@ -6948,9 +6982,9 @@ var HTMLDeepChatElements = /*#__PURE__*/function () {
|
|
6948
6982
|
key: "getProcessedStyles",
|
6949
6983
|
value: function getProcessedStyles(e, t, n) {
|
6950
6984
|
var s = Array.from(t.classList).reduce(function (l, c) {
|
6951
|
-
var
|
6952
|
-
var
|
6953
|
-
return
|
6985
|
+
var u;
|
6986
|
+
var d = (u = e[c]) == null ? void 0 : u.styles;
|
6987
|
+
return d && e[c].styles && l.push(d), l;
|
6954
6988
|
}, []),
|
6955
6989
|
o = DEEP_CHAT_ELEMENTS[n].styles;
|
6956
6990
|
if (o) {
|
@@ -7021,8 +7055,8 @@ var MessageStyleUtils = /*#__PURE__*/function () {
|
|
7021
7055
|
media: {}
|
7022
7056
|
};
|
7023
7057
|
return e.forEach(function (o) {
|
7024
|
-
var a, l, c,
|
7025
|
-
s.outerContainer[o] = ((a = n.outerContainer) == null ? void 0 : a[o]) || "", s.innerContainer[o] = ((l = n.innerContainer) == null ? void 0 : l[o]) || "", s.bubble[o] = ((c = n.bubble) == null ? void 0 : c[o]) || "", s.media[o] = ((
|
7058
|
+
var a, l, c, d;
|
7059
|
+
s.outerContainer[o] = ((a = n.outerContainer) == null ? void 0 : a[o]) || "", s.innerContainer[o] = ((l = n.innerContainer) == null ? void 0 : l[o]) || "", s.bubble[o] = ((c = n.bubble) == null ? void 0 : c[o]) || "", s.media[o] = ((d = n.media) == null ? void 0 : d[o]) || "";
|
7026
7060
|
}), s;
|
7027
7061
|
}
|
7028
7062
|
}]);
|
@@ -7065,21 +7099,14 @@ var IntroPanel = /*#__PURE__*/function () {
|
|
7065
7099
|
return IntroPanel;
|
7066
7100
|
}();
|
7067
7101
|
var _FileMessageUtils = /*#__PURE__*/function () {
|
7068
|
-
function
|
7069
|
-
_classCallCheck(this,
|
7102
|
+
function U() {
|
7103
|
+
_classCallCheck(this, U);
|
7070
7104
|
}
|
7071
|
-
_createClass(
|
7072
|
-
key: "
|
7073
|
-
value:
|
7074
|
-
|
7075
|
-
|
7076
|
-
var a = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !1;
|
7077
|
-
var c;
|
7078
|
-
e.applyCustomStyles(t, o, !0, (c = e.messageStyles) == null ? void 0 : c[s]), e.elementRef.scrollTop = e.elementRef.scrollHeight;
|
7079
|
-
var l = Messages.createMessageContent(o, {
|
7080
|
-
file: n
|
7081
|
-
});
|
7082
|
-
e.messages.push(l), e.sendClientUpdate(l, a);
|
7105
|
+
_createClass(U, null, [{
|
7106
|
+
key: "addMessage",
|
7107
|
+
value: function addMessage(e, t, n, s) {
|
7108
|
+
var o;
|
7109
|
+
e.elementRef.appendChild(t.outerContainer), e.applyCustomStyles(t, s, !0, (o = e.messageStyles) == null ? void 0 : o[n]), e.elementRef.scrollTop = e.elementRef.scrollHeight;
|
7083
7110
|
}
|
7084
7111
|
}, {
|
7085
7112
|
key: "wrapInLink",
|
@@ -7090,7 +7117,7 @@ var _FileMessageUtils = /*#__PURE__*/function () {
|
|
7090
7117
|
}, {
|
7091
7118
|
key: "processContent",
|
7092
7119
|
value: function processContent(e, t) {
|
7093
|
-
return !t || t.startsWith("data") ? e :
|
7120
|
+
return !t || t.startsWith("data") ? e : U.wrapInLink(e, t);
|
7094
7121
|
}
|
7095
7122
|
}, {
|
7096
7123
|
key: "waitToLoadThenScroll",
|
@@ -7102,18 +7129,18 @@ var _FileMessageUtils = /*#__PURE__*/function () {
|
|
7102
7129
|
}, {
|
7103
7130
|
key: "scrollDownOnImageLoad",
|
7104
7131
|
value: function scrollDownOnImageLoad(e, t) {
|
7105
|
-
if (e.startsWith("data"))
|
7132
|
+
if (e.startsWith("data")) U.waitToLoadThenScroll(t);else try {
|
7106
7133
|
fetch(e, {
|
7107
7134
|
mode: "no-cors"
|
7108
7135
|
})["catch"](function () {})["finally"](function () {
|
7109
|
-
|
7136
|
+
U.waitToLoadThenScroll(t);
|
7110
7137
|
});
|
7111
7138
|
} catch (_unused5) {
|
7112
7139
|
t.scrollTop = t.scrollHeight;
|
7113
7140
|
}
|
7114
7141
|
}
|
7115
7142
|
}]);
|
7116
|
-
return
|
7143
|
+
return U;
|
7117
7144
|
}();
|
7118
7145
|
_FileMessageUtils.DEFAULT_FILE_NAME = "file";
|
7119
7146
|
var FileMessageUtils = _FileMessageUtils;
|
@@ -7126,27 +7153,18 @@ var HTMLMessages = /*#__PURE__*/function () {
|
|
7126
7153
|
value: function addElement(e, t) {
|
7127
7154
|
e.elementRef.appendChild(t), e.elementRef.scrollTop = e.elementRef.scrollHeight;
|
7128
7155
|
}
|
7129
|
-
}, {
|
7130
|
-
key: "update",
|
7131
|
-
value: function update(e, t, n, s) {
|
7132
|
-
var o = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
7133
|
-
var a = Messages.createMessageContent(n, {
|
7134
|
-
html: t
|
7135
|
-
});
|
7136
|
-
o || e.messages.push(a), s && e.sendClientUpdate(a, o);
|
7137
|
-
}
|
7138
7156
|
}, {
|
7139
7157
|
key: "createElements",
|
7140
7158
|
value: function createElements(e, t, n) {
|
7141
7159
|
var s = e.createNewMessageElement("", n);
|
7142
|
-
return s.bubbleElement.
|
7160
|
+
return s.bubbleElement.classList.add("html-message"), s.bubbleElement.innerHTML = t, s;
|
7143
7161
|
}
|
7144
7162
|
}, {
|
7145
7163
|
key: "addNewHTMLMessage",
|
7146
|
-
value: function addNewHTMLMessage(e, t, n
|
7147
|
-
var o
|
7148
|
-
var
|
7149
|
-
return t.trim().length === 0 && Messages.editEmptyMessageElement(
|
7164
|
+
value: function addNewHTMLMessage(e, t, n) {
|
7165
|
+
var o;
|
7166
|
+
var s = HTMLMessages.createElements(e, t, n);
|
7167
|
+
return t.trim().length === 0 && Messages.editEmptyMessageElement(s.bubbleElement), HTMLUtils.apply(e, s.outerContainer), e.applyCustomStyles(s, n, !1, (o = e.messageStyles) == null ? void 0 : o.html), HTMLMessages.addElement(e, s.outerContainer), s;
|
7150
7168
|
}
|
7151
7169
|
}]);
|
7152
7170
|
return HTMLMessages;
|
@@ -7184,17 +7202,13 @@ var FileMessages = /*#__PURE__*/function () {
|
|
7184
7202
|
key: "addNewImageMessage",
|
7185
7203
|
value: function () {
|
7186
7204
|
var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(e, t, n) {
|
7187
|
-
var s,
|
7188
|
-
o,
|
7189
|
-
a,
|
7190
|
-
_args65 = arguments;
|
7205
|
+
var s, o;
|
7191
7206
|
return _regeneratorRuntime().wrap(function _callee65$(_context65) {
|
7192
7207
|
while (1) switch (_context65.prev = _context65.next) {
|
7193
7208
|
case 0:
|
7194
|
-
s =
|
7195
|
-
o
|
7196
|
-
|
7197
|
-
case 3:
|
7209
|
+
s = FileMessages.createImage(t, e.elementRef), o = e.createNewMessageElement("", n);
|
7210
|
+
o.bubbleElement.appendChild(s), o.bubbleElement.classList.add("image-message"), FileMessageUtils.addMessage(e, o, "image", n);
|
7211
|
+
case 2:
|
7198
7212
|
case "end":
|
7199
7213
|
return _context65.stop();
|
7200
7214
|
}
|
@@ -7214,10 +7228,9 @@ var FileMessages = /*#__PURE__*/function () {
|
|
7214
7228
|
}, {
|
7215
7229
|
key: "addNewAudioMessage",
|
7216
7230
|
value: function addNewAudioMessage(e, t, n) {
|
7217
|
-
var s =
|
7218
|
-
|
7219
|
-
|
7220
|
-
a.bubbleElement.appendChild(o), a.bubbleElement.classList.add("audio-message"), e.elementRef.appendChild(a.outerContainer), FileMessageUtils.updateMessages(e, a, t, "audio", n, s);
|
7231
|
+
var s = FileMessages.createAudioElement(t, n),
|
7232
|
+
o = e.createNewMessageElement("", n);
|
7233
|
+
o.bubbleElement.appendChild(s), o.bubbleElement.classList.add("audio-message"), FileMessageUtils.addMessage(e, o, "audio", n);
|
7221
7234
|
}
|
7222
7235
|
}, {
|
7223
7236
|
key: "createAnyFile",
|
@@ -7234,10 +7247,17 @@ var FileMessages = /*#__PURE__*/function () {
|
|
7234
7247
|
}, {
|
7235
7248
|
key: "addNewAnyFileMessage",
|
7236
7249
|
value: function addNewAnyFileMessage(e, t, n) {
|
7237
|
-
var s =
|
7238
|
-
|
7239
|
-
|
7240
|
-
|
7250
|
+
var s = e.createNewMessageElement("", n),
|
7251
|
+
o = FileMessages.createAnyFile(t);
|
7252
|
+
s.bubbleElement.classList.add("any-file-message-bubble"), s.bubbleElement.appendChild(o), FileMessageUtils.addMessage(e, s, "file", n);
|
7253
|
+
}
|
7254
|
+
}, {
|
7255
|
+
key: "addMessages",
|
7256
|
+
value: function addMessages(e, t, n) {
|
7257
|
+
t.forEach(function (s) {
|
7258
|
+
var o, a;
|
7259
|
+
s.type === "audio" || (o = s.src) != null && o.startsWith("data:audio") ? FileMessages.addNewAudioMessage(e, s, n) : s.type === "image" || s.type === "gif" || (a = s.src) != null && a.startsWith("data:image") ? FileMessages.addNewImageMessage(e, s, n) : FileMessages.addNewAnyFileMessage(e, s, n);
|
7260
|
+
});
|
7241
7261
|
}
|
7242
7262
|
}]);
|
7243
7263
|
return FileMessages;
|
@@ -7274,9 +7294,9 @@ var AvatarEl = /*#__PURE__*/function () {
|
|
7274
7294
|
key: "getPosition",
|
7275
7295
|
value: function getPosition(e, t) {
|
7276
7296
|
var _n, _n2;
|
7277
|
-
var s, o, a, l, c,
|
7297
|
+
var s, o, a, l, c, d;
|
7278
7298
|
var n = e ? (o = (s = t == null ? void 0 : t.ai) == null ? void 0 : s.styles) == null ? void 0 : o.position : (l = (a = t == null ? void 0 : t.user) == null ? void 0 : a.styles) == null ? void 0 : l.position;
|
7279
|
-
return (_n = n) !== null && _n !== void 0 ? _n : n = (
|
7299
|
+
return (_n = n) !== null && _n !== void 0 ? _n : n = (d = (c = t == null ? void 0 : t["default"]) == null ? void 0 : c.styles) == null ? void 0 : d.position, (_n2 = n) !== null && _n2 !== void 0 ? _n2 : n = e ? "left" : "right", n;
|
7280
7300
|
}
|
7281
7301
|
}, {
|
7282
7302
|
key: "add",
|
@@ -7334,14 +7354,14 @@ var Messages = /*#__PURE__*/function () {
|
|
7334
7354
|
var _this28 = this;
|
7335
7355
|
_classCallCheck(this, Messages);
|
7336
7356
|
var l, c;
|
7337
|
-
this._messageElementRefs = [], this._streamedText = "", this.
|
7357
|
+
this._messageElementRefs = [], this._textElementsToText = [], this._streamedText = "", this.htmlClassUtilities = {}, this.messages = [];
|
7338
7358
|
var s = t.permittedErrorPrefixes,
|
7339
7359
|
o = t.introPanelMarkUp,
|
7340
7360
|
a = t.demo;
|
7341
|
-
this._remarkable = RemarkableConfig.createNew(), this.elementRef = Messages.createContainerElement(), this.messageStyles = e.messageStyles, this._avatars = e.avatars, this._names = e.names, this._errorMessageOverrides = (l = e.errorMessages) == null ? void 0 : l.overrides, e.htmlClassUtilities && (this.
|
7361
|
+
this._remarkable = RemarkableConfig.createNew(), this.elementRef = Messages.createContainerElement(), this.messageStyles = e.messageStyles, this._avatars = e.avatars, this._names = e.names, this._errorMessageOverrides = (l = e.errorMessages) == null ? void 0 : l.overrides, e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), this._onNewMessage = FireEvents.onNewMessage.bind(this, e), this._onClearMessages = FireEvents.onClearMessages.bind(this, e), this._displayLoadingMessage = Messages.getDisplayLoadingMessage(e, t), this._permittedErrorPrefixes = s, this.addSetupMessageIfNeeded(e, t), this.populateIntroPanel(n, o, e.introPanelStyle), e.introMessage && this.addIntroductoryMessage(e.introMessage), e.initialMessages && this.populateInitialMessages(e.initialMessages), this._displayServiceErrorMessages = (c = e.errorMessages) == null ? void 0 : c.displayServiceErrorMessages, e.getMessages = function () {
|
7342
7362
|
return JSON.parse(JSON.stringify(_this28.messages));
|
7343
|
-
}, e.clearMessages = this.clearMessages.bind(this), e.refreshMessages = this.refreshTextMessages.bind(this), e.scrollToBottom = this.scrollToBottom.bind(this), a && this.prepareDemo(a), e.textToSpeech && TextToSpeech.processConfig(e.textToSpeech, function (
|
7344
|
-
_this28._textToSpeech =
|
7363
|
+
}, e.clearMessages = this.clearMessages.bind(this), e.refreshMessages = this.refreshTextMessages.bind(this), e.scrollToBottom = this.scrollToBottom.bind(this), a && this.prepareDemo(a), e.textToSpeech && TextToSpeech.processConfig(e.textToSpeech, function (d) {
|
7364
|
+
_this28._textToSpeech = d;
|
7345
7365
|
}), setTimeout(function () {
|
7346
7366
|
_this28.submitUserMessage = e.submitUserMessage;
|
7347
7367
|
});
|
@@ -7363,13 +7383,13 @@ var Messages = /*#__PURE__*/function () {
|
|
7363
7383
|
}, {
|
7364
7384
|
key: "addIntroductoryMessage",
|
7365
7385
|
value: function addIntroductoryMessage(e) {
|
7366
|
-
var t, n, s, o
|
7386
|
+
var t, n, s, o;
|
7367
7387
|
if (e && (this._introMessage = e), (t = this._introMessage) != null && t.text) {
|
7368
|
-
var
|
7369
|
-
this.applyCustomStyles(
|
7388
|
+
var a = this.createAndAppendNewMessageElement(this._introMessage.text, !0);
|
7389
|
+
this.applyCustomStyles(a, !0, !1, (n = this.messageStyles) == null ? void 0 : n.intro);
|
7370
7390
|
} else if ((s = this._introMessage) != null && s.html) {
|
7371
|
-
var
|
7372
|
-
this.applyCustomStyles(
|
7391
|
+
var _a = HTMLMessages.addNewHTMLMessage(this, this._introMessage.html, !0);
|
7392
|
+
this.applyCustomStyles(_a, !0, !1, (o = this.messageStyles) == null ? void 0 : o.intro);
|
7373
7393
|
}
|
7374
7394
|
}
|
7375
7395
|
}, {
|
@@ -7377,9 +7397,7 @@ var Messages = /*#__PURE__*/function () {
|
|
7377
7397
|
value: function populateInitialMessages(e) {
|
7378
7398
|
var _this29 = this;
|
7379
7399
|
e.forEach(function (t) {
|
7380
|
-
t
|
7381
|
-
files: [t.file]
|
7382
|
-
}, t.role === "ai", !0, !0) : _this29.addNewMessage(t, t.role === "ai", !0, !0);
|
7400
|
+
Legacy.processInitialMessageFile(t), _this29.addNewMessage(t, t.role === "ai", !0);
|
7383
7401
|
}), setTimeout(function () {
|
7384
7402
|
return _this29.scrollToBottom();
|
7385
7403
|
});
|
@@ -7423,28 +7441,27 @@ var Messages = /*#__PURE__*/function () {
|
|
7423
7441
|
// makes sure the bubble has dimensions when there is no text
|
7424
7442
|
}, {
|
7425
7443
|
key: "addNewTextMessage",
|
7426
|
-
value: function addNewTextMessage(e, t
|
7427
|
-
var
|
7428
|
-
|
7429
|
-
this.applyCustomStyles(o, t, !1);
|
7430
|
-
var a = Messages.createMessageContent(t, {
|
7431
|
-
text: e
|
7432
|
-
});
|
7433
|
-
return e.trim().length === 0 && Messages.editEmptyMessageElement(o.bubbleElement), this.messages.push(a), n && this.sendClientUpdate(a, s), o;
|
7444
|
+
value: function addNewTextMessage(e, t) {
|
7445
|
+
var n = this.createAndAppendNewMessageElement(e, t);
|
7446
|
+
return this.applyCustomStyles(n, t, !1), e.trim().length === 0 && Messages.editEmptyMessageElement(n.bubbleElement), this._textElementsToText.push([n, e]), n;
|
7434
7447
|
}
|
7448
|
+
// this should not be activated by streamed messages
|
7435
7449
|
}, {
|
7436
7450
|
key: "addNewMessage",
|
7437
|
-
value: function addNewMessage(e, t
|
7438
|
-
var
|
7439
|
-
var s =
|
7440
|
-
|
7441
|
-
|
7442
|
-
|
7443
|
-
a.type === "audio" || (l = a.src) != null && l.startsWith("data:audio") ? FileMessages.addNewAudioMessage(_this30, a, t, s) : a.type === "image" || a.type === "gif" || (c = a.src) != null && c.startsWith("data:image") ? FileMessages.addNewImageMessage(_this30, a, t, s) : FileMessages.addNewAnyFileMessage(_this30, a, t, s);
|
7444
|
-
}), e.html !== void 0 && e.html !== null) {
|
7445
|
-
var a = HTMLMessages.addNewHTMLMessage(this, e.html, t, n, s);
|
7446
|
-
this.applyCustomStyles(a, t, !1, (o = this.messageStyles) == null ? void 0 : o.html);
|
7451
|
+
value: function addNewMessage(e, t) {
|
7452
|
+
var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
7453
|
+
var s = Messages.createMessageContent(t, e);
|
7454
|
+
if (s.text !== void 0 && e.text !== null && (this.addNewTextMessage(s.text, t), !n && this._textToSpeech && t && TextToSpeech.speak(s.text, this._textToSpeech)), s.files && Array.isArray(s.files) && FileMessages.addMessages(this, s.files, t), s.html !== void 0 && s.html !== null) {
|
7455
|
+
var o = HTMLMessages.addNewHTMLMessage(this, s.html, t);
|
7456
|
+
HTMLDeepChatElements.isElementTemporary(o) && delete s.html;
|
7447
7457
|
}
|
7458
|
+
this.updateStateOnMessage(s, n);
|
7459
|
+
}
|
7460
|
+
}, {
|
7461
|
+
key: "updateStateOnMessage",
|
7462
|
+
value: function updateStateOnMessage(e) {
|
7463
|
+
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
7464
|
+
this.messages.push(e), this.sendClientUpdate(e, t);
|
7448
7465
|
}
|
7449
7466
|
}, {
|
7450
7467
|
key: "sendClientUpdate",
|
@@ -7465,22 +7482,22 @@ var Messages = /*#__PURE__*/function () {
|
|
7465
7482
|
}, {
|
7466
7483
|
key: "addNewErrorMessage",
|
7467
7484
|
value: function addNewErrorMessage(e, t) {
|
7468
|
-
var c,
|
7485
|
+
var c, d, u, h;
|
7469
7486
|
this.removeMessageOnError();
|
7470
7487
|
var n = Messages.createBaseElements(),
|
7471
7488
|
s = n.outerContainer,
|
7472
7489
|
o = n.bubbleElement;
|
7473
7490
|
o.classList.add("error-message-text");
|
7474
|
-
var a = this.getPermittedMessage(t) || ((c = this._errorMessageOverrides) == null ? void 0 : c[e]) || ((
|
7491
|
+
var a = this.getPermittedMessage(t) || ((c = this._errorMessageOverrides) == null ? void 0 : c[e]) || ((d = this._errorMessageOverrides) == null ? void 0 : d["default"]) || "Error, please try again.";
|
7475
7492
|
o.innerHTML = a;
|
7476
|
-
var l = MessageStyleUtils.extractParticularSharedStyles(["fontSize", "fontFamily"], (
|
7493
|
+
var l = MessageStyleUtils.extractParticularSharedStyles(["fontSize", "fontFamily"], (u = this.messageStyles) == null ? void 0 : u["default"]);
|
7477
7494
|
MessageStyleUtils.applyCustomStylesToElements(n, !1, l), MessageStyleUtils.applyCustomStylesToElements(n, !1, (h = this.messageStyles) == null ? void 0 : h.error), this.elementRef.appendChild(s), this.scrollToBottom(), this._textToSpeech && TextToSpeech.speak(a, this._textToSpeech), this._streamedText = "";
|
7478
7495
|
}
|
7479
7496
|
}, {
|
7480
7497
|
key: "getPermittedMessage",
|
7481
7498
|
value: function getPermittedMessage(e) {
|
7482
7499
|
if (e) {
|
7483
|
-
if (this.
|
7500
|
+
if (this._displayServiceErrorMessages) return e;
|
7484
7501
|
if (typeof e == "string" && this._permittedErrorPrefixes) {
|
7485
7502
|
var t = Messages.checkPermittedErrorPrefixes(this._permittedErrorPrefixes, e);
|
7486
7503
|
if (t) return t;
|
@@ -7529,9 +7546,12 @@ var Messages = /*#__PURE__*/function () {
|
|
7529
7546
|
}, {
|
7530
7547
|
key: "addNewStreamedMessage",
|
7531
7548
|
value: function addNewStreamedMessage() {
|
7532
|
-
var _this$addNewTextMessa = this.addNewTextMessage("", !0
|
7533
|
-
e = _this$addNewTextMessa.bubbleElement
|
7534
|
-
|
7549
|
+
var _this$addNewTextMessa = this.addNewTextMessage("", !0),
|
7550
|
+
e = _this$addNewTextMessa.bubbleElement,
|
7551
|
+
t = Messages.createMessageContent(!0, {
|
7552
|
+
text: ""
|
7553
|
+
});
|
7554
|
+
return this.messages.push(t), e.classList.add("streamed-message"), this.scrollToBottom(), e;
|
7535
7555
|
}
|
7536
7556
|
}, {
|
7537
7557
|
key: "updateStreamedMessage",
|
@@ -7539,16 +7559,16 @@ var Messages = /*#__PURE__*/function () {
|
|
7539
7559
|
var s, o, a, l, c;
|
7540
7560
|
var n = ElementUtils.isScrollbarAtBottomOfElement(this.elementRef);
|
7541
7561
|
if (e.trim().length !== 0) {
|
7542
|
-
var
|
7543
|
-
t.style.color = ((a = (o =
|
7562
|
+
var d = (s = this.messageStyles) == null ? void 0 : s["default"];
|
7563
|
+
t.style.color = ((a = (o = d == null ? void 0 : d.ai) == null ? void 0 : o.bubble) == null ? void 0 : a.color) || ((c = (l = d == null ? void 0 : d.shared) == null ? void 0 : l.bubble) == null ? void 0 : c.color) || "";
|
7544
7564
|
}
|
7545
|
-
this._streamedText += e, t.innerHTML = this._remarkable.render(this._streamedText), n && this.scrollToBottom();
|
7565
|
+
this._streamedText += e, this._textElementsToText[this._textElementsToText.length - 1][1] = this._streamedText, t.innerHTML = this._remarkable.render(this._streamedText), n && this.scrollToBottom();
|
7546
7566
|
}
|
7547
7567
|
}, {
|
7548
7568
|
key: "finaliseStreamedMessage",
|
7549
7569
|
value: function finaliseStreamedMessage() {
|
7550
7570
|
var e;
|
7551
|
-
(e = this.getLastMessageBubbleElement()) != null && e.classList.contains("streamed-message") && (this.messages[this.messages.length - 1].text = this._streamedText, this.sendClientUpdate(Messages.createMessageContent(!0, {
|
7571
|
+
(e = this.getLastMessageBubbleElement()) != null && e.classList.contains("streamed-message") && (this._textElementsToText[this._textElementsToText.length - 1][1] = this._streamedText, this.messages[this.messages.length - 1].text = this._streamedText, this.sendClientUpdate(Messages.createMessageContent(!0, {
|
7552
7572
|
text: this._streamedText
|
7553
7573
|
}), !1), this._textToSpeech && TextToSpeech.speak(this._streamedText, this._textToSpeech), this._streamedText = "");
|
7554
7574
|
}
|
@@ -7561,7 +7581,6 @@ var Messages = /*#__PURE__*/function () {
|
|
7561
7581
|
key: "addMultipleFiles",
|
7562
7582
|
value: function () {
|
7563
7583
|
var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(e) {
|
7564
|
-
var _this31 = this;
|
7565
7584
|
return _regeneratorRuntime().wrap(function _callee66$(_context66) {
|
7566
7585
|
while (1) switch (_context66.prev = _context66.next) {
|
7567
7586
|
case 0:
|
@@ -7569,21 +7588,17 @@ var Messages = /*#__PURE__*/function () {
|
|
7569
7588
|
return new Promise(function (n) {
|
7570
7589
|
if (!t.type || t.type === "any") {
|
7571
7590
|
var s = t.file.name || FileMessageUtils.DEFAULT_FILE_NAME;
|
7572
|
-
|
7573
|
-
|
7574
|
-
|
7575
|
-
|
7576
|
-
}]
|
7577
|
-
}, !1, !0), n(!0);
|
7591
|
+
n({
|
7592
|
+
name: s,
|
7593
|
+
type: "any"
|
7594
|
+
});
|
7578
7595
|
} else {
|
7579
7596
|
var _s = new FileReader();
|
7580
7597
|
_s.readAsDataURL(t.file), _s.onload = function () {
|
7581
|
-
|
7582
|
-
|
7583
|
-
|
7584
|
-
|
7585
|
-
}]
|
7586
|
-
}, !1, !0), n(!0);
|
7598
|
+
n({
|
7599
|
+
src: _s.result,
|
7600
|
+
type: t.type
|
7601
|
+
});
|
7587
7602
|
};
|
7588
7603
|
}
|
7589
7604
|
});
|
@@ -7611,20 +7626,20 @@ var Messages = /*#__PURE__*/function () {
|
|
7611
7626
|
var l;
|
7612
7627
|
var a = (l = o.children[0]) == null ? void 0 : l.children[0];
|
7613
7628
|
a != null && a.classList.contains("error-message-text") && o.remove();
|
7614
|
-
}), this._messageElementRefs = t, e !== !1 && ((n = this._introPanel) != null && n._elementRef && this._introPanel.display(), this.addIntroductoryMessage()), this.messages.splice(0, this.messages.length), (s = this._onClearMessages) == null || s.call(this);
|
7629
|
+
}), this._messageElementRefs = t, e !== !1 && ((n = this._introPanel) != null && n._elementRef && this._introPanel.display(), this.addIntroductoryMessage()), this.messages.splice(0, this.messages.length), this._textElementsToText.splice(0, this._textElementsToText.length), (s = this._onClearMessages) == null || s.call(this);
|
7615
7630
|
}
|
7616
7631
|
}, {
|
7617
7632
|
key: "scrollToBottom",
|
7618
7633
|
value: function scrollToBottom() {
|
7619
7634
|
this.elementRef.scrollTop = this.elementRef.scrollHeight;
|
7620
7635
|
}
|
7621
|
-
// this is mostly used for enabling highlight.js to highlight code if it
|
7636
|
+
// this is mostly used for enabling highlight.js to highlight code if it downloads later
|
7622
7637
|
}, {
|
7623
7638
|
key: "refreshTextMessages",
|
7624
7639
|
value: function refreshTextMessages() {
|
7625
|
-
var
|
7626
|
-
this._remarkable = RemarkableConfig.createNew(), this.
|
7627
|
-
e
|
7640
|
+
var _this30 = this;
|
7641
|
+
this._remarkable = RemarkableConfig.createNew(), this._textElementsToText.forEach(function (e) {
|
7642
|
+
e[0].bubbleElement.innerHTML = _this30._remarkable.render(e[1]);
|
7628
7643
|
});
|
7629
7644
|
}
|
7630
7645
|
}], [{
|
@@ -7642,20 +7657,13 @@ var Messages = /*#__PURE__*/function () {
|
|
7642
7657
|
}, {
|
7643
7658
|
key: "createMessageContent",
|
7644
7659
|
value: function createMessageContent(e, t) {
|
7645
|
-
var n =
|
7660
|
+
var n = {
|
7661
|
+
role: e ? "ai" : "user"
|
7662
|
+
},
|
7646
7663
|
s = t.text,
|
7647
|
-
o = t.
|
7664
|
+
o = t.files,
|
7648
7665
|
a = t.html;
|
7649
|
-
return o
|
7650
|
-
role: n,
|
7651
|
-
file: o
|
7652
|
-
} : a ? {
|
7653
|
-
role: n,
|
7654
|
-
html: a
|
7655
|
-
} : {
|
7656
|
-
role: n,
|
7657
|
-
text: s || ""
|
7658
|
-
};
|
7666
|
+
return s && (n.text = s), o && (n.files = o), a && (n.html = a), Object.keys(n).length === 1 && (n.text = ""), n;
|
7659
7667
|
}
|
7660
7668
|
}, {
|
7661
7669
|
key: "createBaseElements",
|
@@ -7689,10 +7697,10 @@ var Messages = /*#__PURE__*/function () {
|
|
7689
7697
|
return Messages;
|
7690
7698
|
}();
|
7691
7699
|
var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
|
7692
|
-
function
|
7693
|
-
_classCallCheck(this,
|
7700
|
+
function T() {
|
7701
|
+
_classCallCheck(this, T);
|
7694
7702
|
}
|
7695
|
-
_createClass(
|
7703
|
+
_createClass(T, null, [{
|
7696
7704
|
key: "adjustInputPadding",
|
7697
7705
|
value: function adjustInputPadding(e, t) {
|
7698
7706
|
t["inside-left"].length > 0 && e.classList.add("text-input-inner-left-adjustment"), t["inside-right"].length > 0 && e.classList.add("text-input-inner-right-adjustment");
|
@@ -7700,7 +7708,7 @@ var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
|
|
7700
7708
|
}, {
|
7701
7709
|
key: "adjustForOutsideButton",
|
7702
7710
|
value: function adjustForOutsideButton(e, t, n) {
|
7703
|
-
n["outside-right"].length === 0 && n["outside-left"].length > 0 ? (e[0].classList.add(
|
7711
|
+
n["outside-right"].length === 0 && n["outside-left"].length > 0 ? (e[0].classList.add(T.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS)) : n["outside-left"].length === 0 && n["outside-right"].length > 0 && (e[3].classList.add(T.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS));
|
7704
7712
|
}
|
7705
7713
|
// when submit is the only button
|
7706
7714
|
// when submit button is outside by itself - we increase the height for a better look
|
@@ -7708,10 +7716,10 @@ var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
|
|
7708
7716
|
key: "adjustOutsideSubmit",
|
7709
7717
|
value: function adjustOutsideSubmit(e, t, n) {
|
7710
7718
|
if (!(n["inside-left"].length > 0 || n["inside-right"].length > 0)) {
|
7711
|
-
if (n["outside-right"].length === 0 && n["outside-left"].length > 0) return e[0].classList.add(
|
7719
|
+
if (n["outside-right"].length === 0 && n["outside-left"].length > 0) return e[0].classList.add(T.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), n["outside-left"].map(function (s) {
|
7712
7720
|
return s.button.elementRef.classList.add("submit-button-enlarged");
|
7713
7721
|
});
|
7714
|
-
if (n["outside-left"].length === 0 && n["outside-right"].length > 0) return e[3].classList.add(
|
7722
|
+
if (n["outside-left"].length === 0 && n["outside-right"].length > 0) return e[3].classList.add(T.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), n["outside-right"].map(function (s) {
|
7715
7723
|
return s.button.elementRef.classList.add("submit-button-enlarged");
|
7716
7724
|
});
|
7717
7725
|
}
|
@@ -7719,10 +7727,10 @@ var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
|
|
7719
7727
|
}, {
|
7720
7728
|
key: "set",
|
7721
7729
|
value: function set(e, t, n, s) {
|
7722
|
-
!!
|
7730
|
+
!!T.adjustOutsideSubmit(t, n, s) || T.adjustForOutsideButton(t, n, s), T.adjustInputPadding(e, s);
|
7723
7731
|
}
|
7724
7732
|
}]);
|
7725
|
-
return
|
7733
|
+
return T;
|
7726
7734
|
}();
|
7727
7735
|
_InputButtonStyleAdjustments.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS = "text-input-container-left-adjustment";
|
7728
7736
|
_InputButtonStyleAdjustments.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS = "text-input-container-right-adjustment";
|
@@ -7977,11 +7985,11 @@ var DropupItem = /*#__PURE__*/function () {
|
|
7977
7985
|
}();
|
7978
7986
|
var DropupMenu = /*#__PURE__*/function () {
|
7979
7987
|
function DropupMenu(e, t) {
|
7980
|
-
var
|
7988
|
+
var _this31 = this;
|
7981
7989
|
_classCallCheck(this, DropupMenu);
|
7982
7990
|
var n;
|
7983
7991
|
this._isOpen = !0, this._styles = t, this.elementRef = DropupMenu.createElement((n = this._styles) == null ? void 0 : n.container), this.close(), setTimeout(function () {
|
7984
|
-
return
|
7992
|
+
return _this31.addWindowEvents(e);
|
7985
7993
|
});
|
7986
7994
|
}
|
7987
7995
|
_createClass(DropupMenu, [{
|
@@ -8009,13 +8017,13 @@ var DropupMenu = /*#__PURE__*/function () {
|
|
8009
8017
|
}, {
|
8010
8018
|
key: "addWindowEvents",
|
8011
8019
|
value: function addWindowEvents(e) {
|
8012
|
-
var
|
8020
|
+
var _this32 = this;
|
8013
8021
|
window.addEventListener("click", function (t) {
|
8014
8022
|
var n;
|
8015
|
-
e.parentElement !== ((n = t.target.shadowRoot) == null ? void 0 : n.children[0]) &&
|
8023
|
+
e.parentElement !== ((n = t.target.shadowRoot) == null ? void 0 : n.children[0]) && _this32.close();
|
8016
8024
|
}), window.addEventListener("keydown", function (t) {
|
8017
8025
|
var n, s, o;
|
8018
|
-
|
8026
|
+
_this32._isOpen && (t.key === KEYBOARD_KEY.ESCAPE ? (_this32.close(), (n = _this32.highlightedItem) == null || n.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === KEYBOARD_KEY.ENTER ? ((s = _this32.highlightedItem) == null || s.click(), (o = _this32.highlightedItem) == null || o.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === KEYBOARD_KEY.ARROW_DOWN ? DropupItemNavigation.focusSiblingItem(_this32.highlightedItem || _this32.elementRef.children[_this32.elementRef.children.length - 1], _this32.elementRef, !0) : t.key === KEYBOARD_KEY.ARROW_UP && DropupItemNavigation.focusSiblingItem(_this32.highlightedItem || _this32.elementRef.children[0], _this32.elementRef, !1));
|
8019
8027
|
});
|
8020
8028
|
}
|
8021
8029
|
}], [{
|
@@ -8031,15 +8039,15 @@ var Dropup = /*#__PURE__*/function (_InputButton) {
|
|
8031
8039
|
_inherits(Dropup, _InputButton);
|
8032
8040
|
var _super34 = _createSuper(Dropup);
|
8033
8041
|
function Dropup(e, t) {
|
8034
|
-
var
|
8042
|
+
var _this33;
|
8035
8043
|
_classCallCheck(this, Dropup);
|
8036
8044
|
var s;
|
8037
|
-
|
8045
|
+
_this33 = _super34.call(this, Dropup.createButtonElement(), void 0, {
|
8038
8046
|
styles: (s = t == null ? void 0 : t.button) == null ? void 0 : s.styles
|
8039
8047
|
});
|
8040
|
-
var n =
|
8041
|
-
|
8042
|
-
return
|
8048
|
+
var n = _this33.createInnerElements(_this33._customStyles);
|
8049
|
+
_this33._menu = new DropupMenu(e, t == null ? void 0 : t.menu), _this33.addClickEvent(), _this33.buttonContainer = Dropup.createButtonContainer(), _this33.elementRef.appendChild(n.styles), _this33.buttonContainer.appendChild(_this33.elementRef), _this33.elementRef.classList.add("dropup-icon", "upload-file-button"), _this33.buttonContainer.appendChild(_this33._menu.elementRef), _this33.reapplyStateStyle("styles"), _this33.addContainerEvents(e);
|
8050
|
+
return _this33;
|
8043
8051
|
}
|
8044
8052
|
_createClass(Dropup, [{
|
8045
8053
|
key: "createInnerElements",
|
@@ -8066,9 +8074,9 @@ var Dropup = /*#__PURE__*/function (_InputButton) {
|
|
8066
8074
|
}, {
|
8067
8075
|
key: "addContainerEvents",
|
8068
8076
|
value: function addContainerEvents(e) {
|
8069
|
-
var
|
8077
|
+
var _this34 = this;
|
8070
8078
|
e.addEventListener("click", function (t) {
|
8071
|
-
t.target.classList.contains("dropup-icon") ||
|
8079
|
+
t.target.classList.contains("dropup-icon") || _this34._menu.close();
|
8072
8080
|
});
|
8073
8081
|
}
|
8074
8082
|
}], [{
|
@@ -8109,11 +8117,11 @@ var InputButtonPositions = /*#__PURE__*/function () {
|
|
8109
8117
|
function addToDropup(e, t, n, s) {
|
8110
8118
|
var o = new Dropup(n, s);
|
8111
8119
|
BUTTON_ORDER.forEach(function (l) {
|
8112
|
-
var c = t["dropup-menu"].findIndex(function (
|
8113
|
-
return
|
8120
|
+
var c = t["dropup-menu"].findIndex(function (u) {
|
8121
|
+
return u.buttonType === l;
|
8114
8122
|
}),
|
8115
|
-
|
8116
|
-
|
8123
|
+
d = t["dropup-menu"][c];
|
8124
|
+
d && (o.addItem(d.button), t["dropup-menu"].splice(c, 1));
|
8117
8125
|
});
|
8118
8126
|
var a = Dropup.getPosition(t, s);
|
8119
8127
|
ButtonContainers.addButton(e, o.buttonContainer, a), t[a].push({});
|
@@ -8324,21 +8332,21 @@ var FileAttachmentsType = /*#__PURE__*/function () {
|
|
8324
8332
|
var PLAY_ICON_STRING = "<?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>",
|
8325
8333
|
STOP_ICON_STRING = "<?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>",
|
8326
8334
|
_AudioFileAttachmentType = /*#__PURE__*/function (_FileAttachmentsType) {
|
8327
|
-
_inherits(
|
8328
|
-
var _super35 = _createSuper(
|
8329
|
-
function
|
8330
|
-
_classCallCheck(this,
|
8335
|
+
_inherits(k, _FileAttachmentsType);
|
8336
|
+
var _super35 = _createSuper(k);
|
8337
|
+
function k(e, t, n) {
|
8338
|
+
_classCallCheck(this, k);
|
8331
8339
|
return _super35.call(this, e, t, n);
|
8332
8340
|
}
|
8333
|
-
_createClass(
|
8341
|
+
_createClass(k, [{
|
8334
8342
|
key: "createTimer",
|
8335
8343
|
value: function createTimer(e, t) {
|
8336
|
-
var
|
8344
|
+
var _this35 = this;
|
8337
8345
|
var n = 0;
|
8338
|
-
var s = t !== void 0 && t <
|
8346
|
+
var s = t !== void 0 && t < k.TIMER_LIMIT_S ? t : k.TIMER_LIMIT_S;
|
8339
8347
|
return setInterval(function () {
|
8340
8348
|
var l;
|
8341
|
-
n += 1, n === s && ((l =
|
8349
|
+
n += 1, n === s && ((l = _this35.stopPlaceholderCallback) == null || l.call(_this35), _this35.clearTimer()), n === 600 && e.classList.add("audio-placeholder-text-4-digits");
|
8342
8350
|
var o = Math.floor(n / 60),
|
8343
8351
|
a = (n % 60).toString().padStart(2, "0");
|
8344
8352
|
e.textContent = "".concat(o, ":").concat(a);
|
@@ -8347,7 +8355,7 @@ var PLAY_ICON_STRING = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox
|
|
8347
8355
|
}, {
|
8348
8356
|
key: "createPlaceholderAudioAttachment",
|
8349
8357
|
value: function createPlaceholderAudioAttachment(e) {
|
8350
|
-
var t =
|
8358
|
+
var t = k.createAudioContainer(),
|
8351
8359
|
n = document.createElement("div");
|
8352
8360
|
n.classList.add("audio-placeholder-text-3-digits");
|
8353
8361
|
var s = document.createElement("div");
|
@@ -8358,7 +8366,7 @@ var PLAY_ICON_STRING = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox
|
|
8358
8366
|
}, {
|
8359
8367
|
key: "addPlaceholderAudioAttachmentEvents",
|
8360
8368
|
value: function addPlaceholderAudioAttachmentEvents(e, t, n) {
|
8361
|
-
var
|
8369
|
+
var _this36 = this;
|
8362
8370
|
var s = function s() {
|
8363
8371
|
return e.replaceChildren(t);
|
8364
8372
|
};
|
@@ -8369,7 +8377,7 @@ var PLAY_ICON_STRING = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox
|
|
8369
8377
|
e.addEventListener("mouseleave", o);
|
8370
8378
|
var a = function a() {
|
8371
8379
|
var l;
|
8372
|
-
return (l =
|
8380
|
+
return (l = _this36.stopPlaceholderCallback) == null ? void 0 : l.call(_this36);
|
8373
8381
|
};
|
8374
8382
|
e.addEventListener("click", a);
|
8375
8383
|
}
|
@@ -8384,7 +8392,7 @@ var PLAY_ICON_STRING = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox
|
|
8384
8392
|
key: "completePlaceholderAttachment",
|
8385
8393
|
value: function completePlaceholderAttachment(e, t) {
|
8386
8394
|
var n = this._activePlaceholderAttachment;
|
8387
|
-
n && (n.file = e,
|
8395
|
+
n && (n.file = e, k.addAudioElements(n.attachmentContainerElement.children[0], t), n.removeButton = this.createRemoveAttachmentButton(n), n.attachmentContainerElement.appendChild(n.removeButton), this._activePlaceholderAttachment = void 0, this.clearTimer());
|
8388
8396
|
}
|
8389
8397
|
}, {
|
8390
8398
|
key: "removePlaceholderAttachment",
|
@@ -8424,8 +8432,8 @@ var PLAY_ICON_STRING = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox
|
|
8424
8432
|
}, {
|
8425
8433
|
key: "createAudioAttachment",
|
8426
8434
|
value: function createAudioAttachment(e) {
|
8427
|
-
var t =
|
8428
|
-
return
|
8435
|
+
var t = k.createAudioContainer();
|
8436
|
+
return k.addAudioElements(t, e), t;
|
8429
8437
|
}
|
8430
8438
|
}, {
|
8431
8439
|
key: "stopAttachmentPlayback",
|
@@ -8434,7 +8442,7 @@ var PLAY_ICON_STRING = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox
|
|
8434
8442
|
(s = (n = (t = e.children[0]) == null ? void 0 : t.children) == null ? void 0 : n[0]) != null && s.classList.contains("stop-icon") && e.children[0].click();
|
8435
8443
|
}
|
8436
8444
|
}]);
|
8437
|
-
return
|
8445
|
+
return k;
|
8438
8446
|
}(FileAttachmentsType);
|
8439
8447
|
_AudioFileAttachmentType.TIMER_LIMIT_S = 5999;
|
8440
8448
|
var AudioFileAttachmentType = _AudioFileAttachmentType;
|
@@ -8552,11 +8560,11 @@ var FileAttachments = /*#__PURE__*/function () {
|
|
8552
8560
|
return FileAttachments;
|
8553
8561
|
}();
|
8554
8562
|
var _Modal = /*#__PURE__*/function () {
|
8555
|
-
function
|
8556
|
-
_classCallCheck(this,
|
8557
|
-
this._isOpen = !1, this._contentRef =
|
8563
|
+
function C(e, t, n) {
|
8564
|
+
_classCallCheck(this, C);
|
8565
|
+
this._isOpen = !1, this._contentRef = C.createModalContent(t, n == null ? void 0 : n.backgroundColor), this._buttonPanel = C.createButtonPanel(n == null ? void 0 : n.backgroundColor), this._elementRef = C.createContainer(this._contentRef, n), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = C.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents();
|
8558
8566
|
}
|
8559
|
-
_createClass(
|
8567
|
+
_createClass(C, [{
|
8560
8568
|
key: "isOpen",
|
8561
8569
|
value: function isOpen() {
|
8562
8570
|
return this._isOpen;
|
@@ -8564,21 +8572,21 @@ var _Modal = /*#__PURE__*/function () {
|
|
8564
8572
|
}, {
|
8565
8573
|
key: "addButtons",
|
8566
8574
|
value: function addButtons() {
|
8567
|
-
var
|
8575
|
+
var _this37 = this;
|
8568
8576
|
for (var _len2 = arguments.length, e = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
8569
8577
|
e[_key2] = arguments[_key2];
|
8570
8578
|
}
|
8571
8579
|
e.forEach(function (t) {
|
8572
|
-
return
|
8580
|
+
return _this37._buttonPanel.appendChild(t);
|
8573
8581
|
});
|
8574
8582
|
}
|
8575
8583
|
}, {
|
8576
8584
|
key: "close",
|
8577
8585
|
value: function close() {
|
8578
|
-
var
|
8586
|
+
var _this38 = this;
|
8579
8587
|
this._elementRef.classList.remove("show-modal"), this._elementRef.classList.add("hide-modal"), this._backgroundPanelRef.classList.remove("show-modal-background"), this._backgroundPanelRef.classList.add("hide-modal-background"), this._isOpen = !1, setTimeout(function () {
|
8580
|
-
|
8581
|
-
},
|
8588
|
+
_this38._elementRef.style.display = "none", _this38._backgroundPanelRef.style.display = "none";
|
8589
|
+
}, C.MODAL_CLOSE_TIMEOUT_MS);
|
8582
8590
|
}
|
8583
8591
|
}, {
|
8584
8592
|
key: "displayModalElements",
|
@@ -8593,10 +8601,10 @@ var _Modal = /*#__PURE__*/function () {
|
|
8593
8601
|
}, {
|
8594
8602
|
key: "addCloseButton",
|
8595
8603
|
value: function addCloseButton(e, t, n) {
|
8596
|
-
var
|
8597
|
-
var s = t ?
|
8604
|
+
var _this39 = this;
|
8605
|
+
var s = t ? C.createSVGButton(e) : C.createTextButton(e);
|
8598
8606
|
return this.addButtons(s), s.onclick = function () {
|
8599
|
-
|
8607
|
+
_this39.close(), setTimeout(function () {
|
8600
8608
|
n == null || n();
|
8601
8609
|
}, 140);
|
8602
8610
|
}, s;
|
@@ -8604,10 +8612,10 @@ var _Modal = /*#__PURE__*/function () {
|
|
8604
8612
|
}, {
|
8605
8613
|
key: "addWindowEvents",
|
8606
8614
|
value: function addWindowEvents() {
|
8607
|
-
var
|
8615
|
+
var _this40 = this;
|
8608
8616
|
window.addEventListener("keydown", function (e) {
|
8609
8617
|
var t, n;
|
8610
|
-
|
8618
|
+
_this40._isOpen && (e.key === KEYBOARD_KEY.ESCAPE ? (_this40.close(), (t = _this40.extensionCloseCallback) == null || t.call(_this40)) : e.key === KEYBOARD_KEY.ENTER && (_this40.close(), (n = _this40.extensionCloseCallback) == null || n.call(_this40)));
|
8611
8619
|
});
|
8612
8620
|
}
|
8613
8621
|
}], [{
|
@@ -8654,12 +8662,12 @@ var _Modal = /*#__PURE__*/function () {
|
|
8654
8662
|
value: function createTextModalFunc(e, t, n) {
|
8655
8663
|
var s;
|
8656
8664
|
if (_typeof(t) == "object" && (s = t.files) != null && s.infoModal) {
|
8657
|
-
var o = new
|
8665
|
+
var o = new C(e, ["modal-content"], t.files.infoModal.containerStyle);
|
8658
8666
|
return o.addCloseButton("OK", !1, n), o.openTextModal.bind(o, t.infoModalTextMarkUp || "");
|
8659
8667
|
}
|
8660
8668
|
}
|
8661
8669
|
}]);
|
8662
|
-
return
|
8670
|
+
return C;
|
8663
8671
|
}();
|
8664
8672
|
_Modal.MODAL_CLOSE_TIMEOUT_MS = 190;
|
8665
8673
|
var Modal = _Modal;
|
@@ -8668,13 +8676,13 @@ var UploadFileButton = /*#__PURE__*/function (_InputButton2) {
|
|
8668
8676
|
var _super36 = _createSuper(UploadFileButton);
|
8669
8677
|
// prettier-ignore
|
8670
8678
|
function UploadFileButton(e, t, n, s, o, a) {
|
8671
|
-
var
|
8679
|
+
var _this41;
|
8672
8680
|
_classCallCheck(this, UploadFileButton);
|
8673
|
-
var c,
|
8674
|
-
|
8675
|
-
var l =
|
8676
|
-
|
8677
|
-
return
|
8681
|
+
var c, d, u, h, f, p;
|
8682
|
+
_this41 = _super36.call(this, UploadFileButton.createButtonElement(), (c = n.button) == null ? void 0 : c.position, n.button, a);
|
8683
|
+
var l = _this41.createInnerElements(s, o, _this41._customStyles);
|
8684
|
+
_this41._inputElement = UploadFileButton.createInputElement((d = n == null ? void 0 : n.files) == null ? void 0 : d.acceptedFormats), _this41.addClickEvent(e, n), _this41.elementRef.replaceChildren(l.styles), _this41.reapplyStateStyle("styles"), _this41._fileAttachmentsType = t, _this41._openModalOnce = ((h = (u = n.files) == null ? void 0 : u.infoModal) == null ? void 0 : h.openModalOnce) === !1 || (p = (f = n.files) == null ? void 0 : f.infoModal) == null ? void 0 : p.openModalOnce;
|
8685
|
+
return _this41;
|
8678
8686
|
}
|
8679
8687
|
_createClass(UploadFileButton, [{
|
8680
8688
|
key: "createInnerElements",
|
@@ -8791,10 +8799,10 @@ var MicrophoneButton = /*#__PURE__*/function (_InputButton3) {
|
|
8791
8799
|
_inherits(MicrophoneButton, _InputButton3);
|
8792
8800
|
var _super37 = _createSuper(MicrophoneButton);
|
8793
8801
|
function MicrophoneButton(e) {
|
8794
|
-
var
|
8802
|
+
var _this42;
|
8795
8803
|
_classCallCheck(this, MicrophoneButton);
|
8796
|
-
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"),
|
8797
|
-
return
|
8804
|
+
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this42 = _super37.call(this, MicrophoneButton.createMicrophoneElement(), e == null ? void 0 : e.position, e), _this42.isActive = !1, _this42._innerElements = _this42.createInnerElements(_this42._customStyles), _this42.changeToDefault();
|
8805
|
+
return _this42;
|
8798
8806
|
}
|
8799
8807
|
_createClass(MicrophoneButton, [{
|
8800
8808
|
key: "createInnerElements",
|
@@ -9001,9 +9009,9 @@ var EventListeners = /*#__PURE__*/function () {
|
|
9001
9009
|
}, {
|
9002
9010
|
key: "keyDownWindow",
|
9003
9011
|
value: function keyDownWindow(e) {
|
9004
|
-
var
|
9012
|
+
var _this43 = this;
|
9005
9013
|
e.element && EventListeners.getElementIfFocusedOnAvailable(e.element, document.activeElement) && (EventListeners.KEY_DOWN_TIMEOUT !== null && clearTimeout(EventListeners.KEY_DOWN_TIMEOUT), EventListeners.KEY_DOWN_TIMEOUT = setTimeout(function () {
|
9006
|
-
EventListeners.KEY_DOWN_TIMEOUT = null,
|
9014
|
+
EventListeners.KEY_DOWN_TIMEOUT = null, _this43.resetRecording(e);
|
9007
9015
|
}, 500));
|
9008
9016
|
}
|
9009
9017
|
}, {
|
@@ -9171,10 +9179,10 @@ var Cursor = /*#__PURE__*/function () {
|
|
9171
9179
|
n += l;
|
9172
9180
|
} else if (a.textContent !== null) {
|
9173
9181
|
if (n + a.textContent.length > t) {
|
9174
|
-
var
|
9175
|
-
|
9182
|
+
var _l = document.createRange();
|
9183
|
+
_l.setStart(a, t - n), _l.collapse(!0);
|
9176
9184
|
var c = window.getSelection();
|
9177
|
-
return c == null || c.removeAllRanges(), c == null || c.addRange(
|
9185
|
+
return c == null || c.removeAllRanges(), c == null || c.addRange(_l), e.focus(), -1;
|
9178
9186
|
}
|
9179
9187
|
n += a.textContent.length, s += a.textContent.length;
|
9180
9188
|
}
|
@@ -9304,35 +9312,35 @@ var CommandUtils = /*#__PURE__*/function () {
|
|
9304
9312
|
key: "execCommand",
|
9305
9313
|
value: function execCommand(e, t, n, s, o) {
|
9306
9314
|
var a, l, c;
|
9307
|
-
var
|
9308
|
-
if (!
|
9309
|
-
var
|
9310
|
-
h = text_1$2.Text.breakupIntoWordsArr(
|
9311
|
-
f = ((l =
|
9312
|
-
if (
|
9315
|
+
var d = e.commands;
|
9316
|
+
if (!d || !s || !n) return;
|
9317
|
+
var u = ((a = d.settings) === null || a === void 0 ? void 0 : a.caseSensitive) === !0 ? t : t.toLowerCase(),
|
9318
|
+
h = text_1$2.Text.breakupIntoWordsArr(u),
|
9319
|
+
f = ((l = d.settings) === null || l === void 0 ? void 0 : l.substrings) === !1 ? CommandUtils.checkIfMatchesWord : CommandUtils.checkIfMatchesSubstring;
|
9320
|
+
if (d.commandMode && f(d.commandMode, u, h)) return e.setInterimColorToFinal(), setTimeout(function () {
|
9313
9321
|
return CommandUtils.toggleCommandModeOn(e);
|
9314
9322
|
}), {
|
9315
9323
|
doNotProcessTranscription: !1
|
9316
9324
|
};
|
9317
|
-
if (!(
|
9318
|
-
if (
|
9325
|
+
if (!(d.commandMode && !e.isWaitingForCommand)) {
|
9326
|
+
if (d.stop && f(d.stop, u, h)) return CommandUtils.toggleCommandModeOff(e), setTimeout(function () {
|
9319
9327
|
return e.stop();
|
9320
9328
|
}), {
|
9321
9329
|
doNotProcessTranscription: !1
|
9322
9330
|
};
|
9323
|
-
if (
|
9331
|
+
if (d.pause && f(d.pause, u, h)) return CommandUtils.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
|
9324
9332
|
var p;
|
9325
9333
|
e.isPaused = !0, (p = e.onPauseTrigger) === null || p === void 0 || p.call(e, !0);
|
9326
9334
|
}), {
|
9327
9335
|
doNotProcessTranscription: !1
|
9328
9336
|
};
|
9329
|
-
if (
|
9337
|
+
if (d.resume && f(d.resume, u, h)) return e.isPaused = !1, (c = e.onPauseTrigger) === null || c === void 0 || c.call(e, !1), CommandUtils.toggleCommandModeOff(e), e.resetRecording(n), {
|
9330
9338
|
doNotProcessTranscription: !0
|
9331
9339
|
};
|
9332
|
-
if (
|
9340
|
+
if (d.reset && f(d.reset, u, h)) return o !== void 0 && CommandUtils.setText(e, n, o, s), {
|
9333
9341
|
doNotProcessTranscription: !0
|
9334
9342
|
};
|
9335
|
-
if (
|
9343
|
+
if (d.removeAllText && f(d.removeAllText, u, h)) return CommandUtils.setText(e, n, "", s), {
|
9336
9344
|
doNotProcessTranscription: !0
|
9337
9345
|
};
|
9338
9346
|
}
|
@@ -9432,10 +9440,10 @@ var Padding = /*#__PURE__*/function () {
|
|
9432
9440
|
var l = window.getSelection();
|
9433
9441
|
if (l != null && l.focusNode) {
|
9434
9442
|
var c = cursor_1$1.Cursor.getGenericElementCursorOffset(t, l, !0),
|
9435
|
-
|
9436
|
-
|
9437
|
-
h = (s = t.textContent) === null || s === void 0 ? void 0 : s[
|
9438
|
-
text_1$1.Text.isCharDefined(
|
9443
|
+
d = (n = t.textContent) === null || n === void 0 ? void 0 : n[c - 1],
|
9444
|
+
u = cursor_1$1.Cursor.getGenericElementCursorOffset(t, l, !1),
|
9445
|
+
h = (s = t.textContent) === null || s === void 0 ? void 0 : s[u];
|
9446
|
+
text_1$1.Text.isCharDefined(d) && (e.startPadding = " "), text_1$1.Text.isCharDefined(h) && (e.endPadding = " "), e.isCursorAtEnd = ((o = t.textContent) === null || o === void 0 ? void 0 : o.length) === u;
|
9439
9447
|
return;
|
9440
9448
|
}
|
9441
9449
|
}
|
@@ -9624,22 +9632,22 @@ var WebSpeech = /*#__PURE__*/function (_speech_1$1$Speech) {
|
|
9624
9632
|
}, {
|
9625
9633
|
key: "setEvents",
|
9626
9634
|
value: function setEvents() {
|
9627
|
-
var
|
9635
|
+
var _this44 = this;
|
9628
9636
|
this._service && (this._service.onstart = function () {
|
9629
|
-
|
9637
|
+
_this44.setStateOnStart();
|
9630
9638
|
}, this._service.onerror = function (e) {
|
9631
|
-
browser_1.Browser.IS_SAFARI() && e.message === "Another request is started" || e.error === "aborted" &&
|
9639
|
+
browser_1.Browser.IS_SAFARI() && e.message === "Another request is started" || e.error === "aborted" && _this44.isRestarting || e.error !== "no-speech" && _this44.error(e.message || e.error);
|
9632
9640
|
}, this._service.onaudioend = function () {
|
9633
|
-
|
9641
|
+
_this44.setStateOnStop();
|
9634
9642
|
}, this._service.onend = function () {
|
9635
|
-
|
9643
|
+
_this44._stopping = !1;
|
9636
9644
|
}, this._service.onresult = function (e) {
|
9637
|
-
if (_typeof(e.results) > "u" &&
|
9638
|
-
var
|
9639
|
-
t =
|
9640
|
-
n =
|
9641
|
-
s =
|
9642
|
-
|
9645
|
+
if (_typeof(e.results) > "u" && _this44._service) _this44._service.onend = null, _this44._service.stop();else if (_this44._extractText && !_this44._stopping) {
|
9646
|
+
var _this44$_extractText = _this44._extractText(e, _this44.finalTranscript, _this44._translations),
|
9647
|
+
t = _this44$_extractText.interimTranscript,
|
9648
|
+
n = _this44$_extractText.finalTranscript,
|
9649
|
+
s = _this44$_extractText.newText;
|
9650
|
+
_this44.updateElements(t, n, s);
|
9643
9651
|
}
|
9644
9652
|
});
|
9645
9653
|
}
|
@@ -9859,10 +9867,10 @@ var Azure = /*#__PURE__*/function (_speech_1$Speech) {
|
|
9859
9867
|
_inherits(Azure, _speech_1$Speech);
|
9860
9868
|
var _super39 = _createSuper(Azure);
|
9861
9869
|
function Azure() {
|
9862
|
-
var
|
9870
|
+
var _this45;
|
9863
9871
|
_classCallCheck(this, Azure);
|
9864
|
-
|
9865
|
-
return
|
9872
|
+
_this45 = _super39.apply(this, arguments), _this45._newTextPadding = "";
|
9873
|
+
return _this45;
|
9866
9874
|
}
|
9867
9875
|
_createClass(Azure, [{
|
9868
9876
|
key: "start",
|
@@ -9990,12 +9998,12 @@ var Azure = /*#__PURE__*/function (_speech_1$Speech) {
|
|
9990
9998
|
}, {
|
9991
9999
|
key: "retrieveTokenInterval",
|
9992
10000
|
value: function retrieveTokenInterval(e) {
|
9993
|
-
var
|
10001
|
+
var _this46 = this;
|
9994
10002
|
this._retrieveTokenInterval = setInterval(function () {
|
9995
10003
|
e == null || e().then(function (t) {
|
9996
|
-
|
10004
|
+
_this46._service && (_this46._service.authorizationToken = (t == null ? void 0 : t.trim()) || "");
|
9997
10005
|
})["catch"](function (t) {
|
9998
|
-
|
10006
|
+
_this46.error(t);
|
9999
10007
|
});
|
10000
10008
|
}, 1e4);
|
10001
10009
|
}
|
@@ -10077,18 +10085,18 @@ var SpeechToText = /*#__PURE__*/function (_MicrophoneButton) {
|
|
10077
10085
|
_inherits(SpeechToText, _MicrophoneButton);
|
10078
10086
|
var _super40 = _createSuper(SpeechToText);
|
10079
10087
|
function SpeechToText(e, t, n) {
|
10080
|
-
var
|
10088
|
+
var _this47;
|
10081
10089
|
_classCallCheck(this, SpeechToText);
|
10082
10090
|
var a;
|
10083
|
-
|
10091
|
+
_this47 = _super40.call(this, _typeof(e.speechToText) == "object" ? (a = e.speechToText) == null ? void 0 : a.button : {});
|
10084
10092
|
var _SpeechToText$process = SpeechToText.processConfiguration(t, e.speechToText),
|
10085
10093
|
s = _SpeechToText$process.serviceName,
|
10086
10094
|
o = _SpeechToText$process.processedConfig;
|
10087
|
-
if (
|
10095
|
+
if (_this47._addErrorMessage = n, s === "webspeech" && !_default.isWebSpeechSupported()) _this47.changeToUnsupported();else {
|
10088
10096
|
var l = !e.textInput || !e.textInput.disabled;
|
10089
|
-
|
10097
|
+
_this47.elementRef.onclick = _this47.buttonClick.bind(_assertThisInitialized(_this47), t, l, s, o);
|
10090
10098
|
}
|
10091
|
-
return
|
10099
|
+
return _this47;
|
10092
10100
|
}
|
10093
10101
|
// prettier-ignore
|
10094
10102
|
_createClass(SpeechToText, [{
|
@@ -10117,7 +10125,7 @@ var SpeechToText = /*#__PURE__*/function (_MicrophoneButton) {
|
|
10117
10125
|
key: "processConfiguration",
|
10118
10126
|
value: function processConfiguration(e, t) {
|
10119
10127
|
var _n$displayInterimResu, _n$textColor, _n$translations, _n$commands;
|
10120
|
-
var
|
10128
|
+
var d;
|
10121
10129
|
var n = _typeof(t) == "object" ? t : {},
|
10122
10130
|
s = _typeof(n.webSpeech) == "object" ? n.webSpeech : {},
|
10123
10131
|
o = n.azure || {},
|
@@ -10127,9 +10135,9 @@ var SpeechToText = /*#__PURE__*/function (_MicrophoneButton) {
|
|
10127
10135
|
translations: (_n$translations = n.translations) !== null && _n$translations !== void 0 ? _n$translations : void 0,
|
10128
10136
|
commands: (_n$commands = n.commands) !== null && _n$commands !== void 0 ? _n$commands : void 0
|
10129
10137
|
}, s), o),
|
10130
|
-
l = (
|
10131
|
-
return l && (a.onPreResult = function (
|
10132
|
-
return
|
10138
|
+
l = (d = n.commands) == null ? void 0 : d.submit;
|
10139
|
+
return l && (a.onPreResult = function (u) {
|
10140
|
+
return u.toLowerCase().includes(l) ? (setTimeout(function () {
|
10133
10141
|
var h;
|
10134
10142
|
return (h = e.submit) == null ? void 0 : h.call(e);
|
10135
10143
|
}), _default.endCommandMode(), {
|
@@ -10169,11 +10177,11 @@ var RecordAudio = /*#__PURE__*/function (_MicrophoneButton2) {
|
|
10169
10177
|
_inherits(RecordAudio, _MicrophoneButton2);
|
10170
10178
|
var _super41 = _createSuper(RecordAudio);
|
10171
10179
|
function RecordAudio(e, t) {
|
10172
|
-
var
|
10180
|
+
var _this48;
|
10173
10181
|
_classCallCheck(this, RecordAudio);
|
10174
10182
|
var n, s;
|
10175
|
-
|
10176
|
-
return
|
10183
|
+
_this48 = _super41.call(this, t.button), _this48._waitingForBrowserApproval = !1, _this48._audioType = e, _this48._extension = ((n = t.files) == null ? void 0 : n.format) || "mp3", _this48._maxDurationSeconds = (s = t.files) == null ? void 0 : s.maxDurationSeconds, _this48.elementRef.onclick = _this48.buttonClick.bind(_assertThisInitialized(_this48));
|
10184
|
+
return _this48;
|
10177
10185
|
}
|
10178
10186
|
_createClass(RecordAudio, [{
|
10179
10187
|
key: "buttonClick",
|
@@ -10183,10 +10191,10 @@ var RecordAudio = /*#__PURE__*/function (_MicrophoneButton2) {
|
|
10183
10191
|
}, {
|
10184
10192
|
key: "stop",
|
10185
10193
|
value: function stop() {
|
10186
|
-
var
|
10194
|
+
var _this49 = this;
|
10187
10195
|
return new Promise(function (e) {
|
10188
10196
|
var t, n;
|
10189
|
-
|
10197
|
+
_this49.changeToDefault(), (t = _this49._mediaRecorder) == null || t.stop(), (n = _this49._mediaStream) == null || n.getTracks().forEach(function (s) {
|
10190
10198
|
return s.stop();
|
10191
10199
|
}), setTimeout(function () {
|
10192
10200
|
e();
|
@@ -10196,23 +10204,23 @@ var RecordAudio = /*#__PURE__*/function (_MicrophoneButton2) {
|
|
10196
10204
|
}, {
|
10197
10205
|
key: "record",
|
10198
10206
|
value: function record() {
|
10199
|
-
var
|
10207
|
+
var _this50 = this;
|
10200
10208
|
navigator.mediaDevices.getUserMedia({
|
10201
10209
|
audio: !0
|
10202
10210
|
}).then(function (e) {
|
10203
|
-
|
10204
|
-
|
10205
|
-
}),
|
10211
|
+
_this50.changeToActive(), _this50._mediaRecorder = new MediaRecorder(e), _this50._audioType.addPlaceholderAttachment(_this50.stop.bind(_this50), _this50._maxDurationSeconds), _this50._mediaStream = e, _this50._mediaRecorder.addEventListener("dataavailable", function (t) {
|
10212
|
+
_this50.createFile(t);
|
10213
|
+
}), _this50._mediaRecorder.start();
|
10206
10214
|
})["catch"](function (e) {
|
10207
|
-
console.error(e),
|
10215
|
+
console.error(e), _this50.stop();
|
10208
10216
|
})["finally"](function () {
|
10209
|
-
|
10217
|
+
_this50._waitingForBrowserApproval = !1;
|
10210
10218
|
});
|
10211
10219
|
}
|
10212
10220
|
}, {
|
10213
10221
|
key: "createFile",
|
10214
10222
|
value: function createFile(e) {
|
10215
|
-
var
|
10223
|
+
var _this51 = this;
|
10216
10224
|
var t = new Blob([e.data], {
|
10217
10225
|
type: "audio/".concat(this._extension)
|
10218
10226
|
}),
|
@@ -10222,7 +10230,7 @@ var RecordAudio = /*#__PURE__*/function (_MicrophoneButton2) {
|
|
10222
10230
|
}),
|
10223
10231
|
o = new FileReader();
|
10224
10232
|
o.readAsDataURL(s), o.onload = function (a) {
|
10225
|
-
|
10233
|
+
_this51._audioType.completePlaceholderAttachment(s, a.target.result);
|
10226
10234
|
};
|
10227
10235
|
}
|
10228
10236
|
}]);
|
@@ -10246,13 +10254,13 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
|
|
10246
10254
|
var _super42 = _createSuper(SubmitButton);
|
10247
10255
|
// prettier-ignore
|
10248
10256
|
function SubmitButton(e, t, n, s, o) {
|
10249
|
-
var
|
10257
|
+
var _this52;
|
10250
10258
|
_classCallCheck(this, SubmitButton);
|
10251
10259
|
var a;
|
10252
|
-
|
10260
|
+
_this52 = _super42.call(this, SubmitButton.createButtonContainerElement(), (a = e.submitButtonStyles) == null ? void 0 : a.position, e.submitButtonStyles), _this52._isRequestInProgress = !1, _this52._isLoadingActive = !1, _this52._isSVGLoadingIconOverriden = !1, _this52._messages = n, _this52._inputElementRef = t, _this52._fileAttachments = o, _this52._innerElements = _this52.createInnerElements(), _this52._abortStream = new AbortController(), _this52._stopClicked = {
|
10253
10261
|
listener: function listener() {}
|
10254
|
-
},
|
10255
|
-
return
|
10262
|
+
}, _this52._serviceIO = s, _this52.attemptOverwriteLoadingStyle(e), _this52.changeToSubmitIcon(), _this52.assignHandlers();
|
10263
|
+
return _this52;
|
10256
10264
|
}
|
10257
10265
|
// prettier-ignore
|
10258
10266
|
_createClass(SubmitButton, [{
|
@@ -10273,10 +10281,10 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
|
|
10273
10281
|
value:
|
10274
10282
|
// prettier-ignore
|
10275
10283
|
function attemptOverwriteLoadingStyle(e) {
|
10276
|
-
var t, n, s, o, a, l, c,
|
10277
|
-
if (!((n = (t = this._customStyles) == null ? void 0 : t.submit) != null && n.svg || (a = (o = (s = this._customStyles) == null ? void 0 : s.loading) == null ? void 0 : o.svg) != null && a.content || (
|
10284
|
+
var t, n, s, o, a, l, c, d, u;
|
10285
|
+
if (!((n = (t = this._customStyles) == null ? void 0 : t.submit) != null && n.svg || (a = (o = (s = this._customStyles) == null ? void 0 : s.loading) == null ? void 0 : o.svg) != null && a.content || (d = (c = (l = this._customStyles) == null ? void 0 : l.loading) == null ? void 0 : c.text) != null && d.content) && (e.displayLoadingBubble === void 0 || e.displayLoadingBubble === !0)) {
|
10278
10286
|
var h = document.createElement("style");
|
10279
|
-
h.textContent = "\n .loading-button > * {\n filter: brightness(0) saturate(100%) invert(72%) sepia(0%) saturate(3044%) hue-rotate(322deg) brightness(100%)\n contrast(96%) !important;\n }", (
|
10287
|
+
h.textContent = "\n .loading-button > * {\n filter: brightness(0) saturate(100%) invert(72%) sepia(0%) saturate(3044%) hue-rotate(322deg) brightness(100%)\n contrast(96%) !important;\n }", (u = e.shadowRoot) == null || u.appendChild(h), this._isSVGLoadingIconOverriden = !0;
|
10280
10288
|
}
|
10281
10289
|
}
|
10282
10290
|
}, {
|
@@ -10323,8 +10331,8 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
|
|
10323
10331
|
return this._fileAttachments.completePlaceholders();
|
10324
10332
|
case 4:
|
10325
10333
|
n = this._fileAttachments.getAllFileData();
|
10326
|
-
s = n == null ? void 0 : n.map(function (
|
10327
|
-
return
|
10334
|
+
s = n == null ? void 0 : n.map(function (d) {
|
10335
|
+
return d.file;
|
10328
10336
|
});
|
10329
10337
|
case 6:
|
10330
10338
|
o = t === "" ? void 0 : t;
|
@@ -10354,28 +10362,20 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
|
|
10354
10362
|
return _context73.abrupt("return");
|
10355
10363
|
case 16:
|
10356
10364
|
this.changeToLoadingIcon();
|
10357
|
-
|
10358
|
-
|
10359
|
-
|
10360
|
-
_context73.t1 = n;
|
10361
|
-
if (!_context73.t1) {
|
10362
|
-
_context73.next = 22;
|
10363
|
-
break;
|
10364
|
-
}
|
10365
|
-
_context73.next = 22;
|
10366
|
-
return this._messages.addMultipleFiles(n);
|
10367
|
-
case 22:
|
10365
|
+
_context73.next = 19;
|
10366
|
+
return this.addNewMessages(t, n);
|
10367
|
+
case 19:
|
10368
10368
|
this._messages.addLoadingMessage();
|
10369
10369
|
e || TextInputEl.clear(this._inputElementRef);
|
10370
10370
|
a = {
|
10371
10371
|
text: o,
|
10372
10372
|
files: s
|
10373
10373
|
};
|
10374
|
-
_context73.next =
|
10374
|
+
_context73.next = 24;
|
10375
10375
|
return this._serviceIO.callAPI(a, this._messages);
|
10376
|
-
case
|
10376
|
+
case 24:
|
10377
10377
|
e || (c = this._fileAttachments) == null || c.removeAllFiles();
|
10378
|
-
case
|
10378
|
+
case 25:
|
10379
10379
|
case "end":
|
10380
10380
|
return _context73.stop();
|
10381
10381
|
}
|
@@ -10386,6 +10386,38 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
|
|
10386
10386
|
}
|
10387
10387
|
return submit;
|
10388
10388
|
}()
|
10389
|
+
}, {
|
10390
|
+
key: "addNewMessages",
|
10391
|
+
value: function () {
|
10392
|
+
var _addNewMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(e, t) {
|
10393
|
+
var n;
|
10394
|
+
return _regeneratorRuntime().wrap(function _callee74$(_context74) {
|
10395
|
+
while (1) switch (_context74.prev = _context74.next) {
|
10396
|
+
case 0:
|
10397
|
+
n = {};
|
10398
|
+
e !== "" && (n.text = e);
|
10399
|
+
_context74.t0 = t;
|
10400
|
+
if (!_context74.t0) {
|
10401
|
+
_context74.next = 7;
|
10402
|
+
break;
|
10403
|
+
}
|
10404
|
+
_context74.next = 6;
|
10405
|
+
return this._messages.addMultipleFiles(t);
|
10406
|
+
case 6:
|
10407
|
+
n.files = _context74.sent;
|
10408
|
+
case 7:
|
10409
|
+
Object.keys(n).length > 0 && this._messages.addNewMessage(n, !1);
|
10410
|
+
case 8:
|
10411
|
+
case "end":
|
10412
|
+
return _context74.stop();
|
10413
|
+
}
|
10414
|
+
}, _callee74, this);
|
10415
|
+
}));
|
10416
|
+
function addNewMessages(_x124, _x125) {
|
10417
|
+
return _addNewMessages.apply(this, arguments);
|
10418
|
+
}
|
10419
|
+
return addNewMessages;
|
10420
|
+
}()
|
10389
10421
|
}, {
|
10390
10422
|
key: "stopStream",
|
10391
10423
|
value: function stopStream() {
|
@@ -10444,14 +10476,14 @@ var CameraModal = /*#__PURE__*/function (_Modal2) {
|
|
10444
10476
|
var _super43 = _createSuper(CameraModal);
|
10445
10477
|
// prettier-ignore
|
10446
10478
|
function CameraModal(e, t, n, s) {
|
10447
|
-
var
|
10479
|
+
var _this53;
|
10448
10480
|
_classCallCheck(this, CameraModal);
|
10449
|
-
|
10450
|
-
var
|
10451
|
-
o =
|
10452
|
-
a =
|
10453
|
-
|
10454
|
-
return
|
10481
|
+
_this53 = _super43.call(this, e, ["modal-content", "modal-camera-content"], n), _this53._stopped = !1, _this53._format = "image/png", _this53._canvas = document.createElement("canvas"), _this53._canvas.classList.add("camera-modal-canvas");
|
10482
|
+
var _this53$addButtonsAnd = _this53.addButtonsAndTheirEvents(t),
|
10483
|
+
o = _this53$addButtonsAnd.captureButton,
|
10484
|
+
a = _this53$addButtonsAnd.submitButton;
|
10485
|
+
_this53._captureButton = o, _this53._submitButton = a, _this53._captureIcon = _this53._captureButton.children[0], _this53._refreshIcon = SVGIconUtils.createSVGElement(REFRESH_ICON_STRING), _this53._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (s == null ? void 0 : s.format) === "jpeg" && (_this53._format = "image/jpeg"), s != null && s.dimensions && (_this53._dimensions = s.dimensions), _this53._contentRef.appendChild(_this53._canvas), _this53.extensionCloseCallback = _this53.stop;
|
10486
|
+
return _this53;
|
10455
10487
|
}
|
10456
10488
|
_createClass(CameraModal, [{
|
10457
10489
|
key: "addButtonsAndTheirEvents",
|
@@ -10470,38 +10502,38 @@ var CameraModal = /*#__PURE__*/function (_Modal2) {
|
|
10470
10502
|
}, {
|
10471
10503
|
key: "addButtonEvents",
|
10472
10504
|
value: function addButtonEvents(e, t, n, s) {
|
10473
|
-
var
|
10505
|
+
var _this54 = this;
|
10474
10506
|
e.onclick = function () {
|
10475
|
-
|
10507
|
+
_this54.capture();
|
10476
10508
|
}, t.addEventListener("click", this.stop.bind(this)), n.onclick = function () {
|
10477
|
-
var o =
|
10478
|
-
o && FileAttachments.addFilesToType([o], [s]),
|
10509
|
+
var o = _this54.getFile();
|
10510
|
+
o && FileAttachments.addFilesToType([o], [s]), _this54.stop(), _this54.close();
|
10479
10511
|
};
|
10480
10512
|
}
|
10481
10513
|
}, {
|
10482
10514
|
key: "stop",
|
10483
10515
|
value: function stop() {
|
10484
|
-
var
|
10516
|
+
var _this55 = this;
|
10485
10517
|
this._mediaStream && this._mediaStream.getTracks().forEach(function (e) {
|
10486
10518
|
return e.stop();
|
10487
10519
|
}), this._stopped = !0, setTimeout(function () {
|
10488
|
-
|
10489
|
-
var e =
|
10490
|
-
e == null || e.clearRect(0, 0,
|
10520
|
+
_this55._captureButton.replaceChildren(_this55._captureIcon), _this55._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
|
10521
|
+
var e = _this55._canvas.getContext("2d");
|
10522
|
+
e == null || e.clearRect(0, 0, _this55._canvas.width, _this55._canvas.height);
|
10491
10523
|
}, Modal.MODAL_CLOSE_TIMEOUT_MS);
|
10492
10524
|
}
|
10493
10525
|
}, {
|
10494
10526
|
key: "start",
|
10495
10527
|
value: function start() {
|
10496
|
-
var
|
10528
|
+
var _this56 = this;
|
10497
10529
|
this._dataURL = void 0, this._submitButton.classList.add("modal-svg-submit-disabled"), this._stopped = !1, navigator.mediaDevices.getUserMedia({
|
10498
10530
|
video: this._dimensions || !0
|
10499
10531
|
}).then(function (e) {
|
10500
|
-
if (
|
10532
|
+
if (_this56._mediaStream = e, !_this56.isOpen()) return _this56.stop();
|
10501
10533
|
var t = document.createElement("video");
|
10502
|
-
t.srcObject = e, t.play(), requestAnimationFrame(
|
10534
|
+
t.srcObject = e, t.play(), requestAnimationFrame(_this56.updateCanvas.bind(_this56, t, _this56._canvas));
|
10503
10535
|
})["catch"](function (e) {
|
10504
|
-
console.error(e),
|
10536
|
+
console.error(e), _this56.stop(), _this56.close();
|
10505
10537
|
});
|
10506
10538
|
}
|
10507
10539
|
}, {
|
@@ -10559,13 +10591,13 @@ var CameraButton = /*#__PURE__*/function (_InputButton5) {
|
|
10559
10591
|
_inherits(CameraButton, _InputButton5);
|
10560
10592
|
var _super44 = _createSuper(CameraButton);
|
10561
10593
|
function CameraButton(e, t, n) {
|
10562
|
-
var
|
10594
|
+
var _this57;
|
10563
10595
|
_classCallCheck(this, CameraButton);
|
10564
10596
|
var o;
|
10565
|
-
|
10566
|
-
var s =
|
10567
|
-
n &&
|
10568
|
-
return
|
10597
|
+
_this57 = _super44.call(this, CameraButton.createButtonElement(), (o = n == null ? void 0 : n.button) == null ? void 0 : o.position, (n == null ? void 0 : n.button) || {}, "Photo");
|
10598
|
+
var s = _this57.createInnerElements(_this57._customStyles);
|
10599
|
+
n && _this57.addClickEvent(e, t, n.modalContainerStyle, n.files), _this57.elementRef.classList.add("upload-file-button"), _this57.elementRef.appendChild(s.styles), _this57.reapplyStateStyle("styles");
|
10600
|
+
return _this57;
|
10569
10601
|
}
|
10570
10602
|
_createClass(CameraButton, [{
|
10571
10603
|
key: "createInnerElements",
|
@@ -10623,18 +10655,18 @@ var Input = /*#__PURE__*/function () {
|
|
10623
10655
|
value:
|
10624
10656
|
// prettier-ignore
|
10625
10657
|
function createFileUploadComponents(e, t, n, s) {
|
10626
|
-
var a, l, c,
|
10658
|
+
var a, l, c, d;
|
10627
10659
|
var o = new FileAttachments(this.elementRef, e.attachmentContainerStyle, t.demo);
|
10628
10660
|
if (Input.createUploadButtons(t.fileTypes || {}, o, n, s), (a = t.camera) != null && a.files) {
|
10629
|
-
var
|
10661
|
+
var u = ((l = s.images) == null ? void 0 : l.fileType) || o.addType(t.camera.files, "images");
|
10630
10662
|
s.camera = {
|
10631
|
-
button: new CameraButton(n,
|
10663
|
+
button: new CameraButton(n, u, t.camera)
|
10632
10664
|
};
|
10633
10665
|
}
|
10634
10666
|
if ((c = t.recordAudio) != null && c.files) {
|
10635
|
-
var
|
10667
|
+
var _u = ((d = s.audio) == null ? void 0 : d.fileType) || o.addType(t.recordAudio.files, "audio");
|
10636
10668
|
s.microphone = {
|
10637
|
-
button: new RecordAudio(
|
10669
|
+
button: new RecordAudio(_u, t.recordAudio)
|
10638
10670
|
};
|
10639
10671
|
}
|
10640
10672
|
return DragAndDrop.isEnabled(o, e.dragAndDrop) && DragAndDrop.create(n, o, e.dragAndDrop), o;
|
@@ -10655,10 +10687,10 @@ var Input = /*#__PURE__*/function () {
|
|
10655
10687
|
if (l.files) {
|
10656
10688
|
var c = t.addType(l.files, a),
|
10657
10689
|
_FILE_TYPE_BUTTON_ICO = FILE_TYPE_BUTTON_ICONS[a],
|
10658
|
-
|
10659
|
-
|
10690
|
+
d = _FILE_TYPE_BUTTON_ICO.id,
|
10691
|
+
u = _FILE_TYPE_BUTTON_ICO.svgString,
|
10660
10692
|
h = _FILE_TYPE_BUTTON_ICO.dropupText,
|
10661
|
-
f = new UploadFileButton(n, c, l,
|
10693
|
+
f = new UploadFileButton(n, c, l, d, u, h);
|
10662
10694
|
s[a] = {
|
10663
10695
|
button: f,
|
10664
10696
|
fileType: c
|
@@ -10701,101 +10733,82 @@ var ChatView = /*#__PURE__*/function () {
|
|
10701
10733
|
}]);
|
10702
10734
|
return ChatView;
|
10703
10735
|
}();
|
10704
|
-
var style = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#large-loading-ring{display:inline-block;width:50px;height:50px}#large-loading-ring:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:large-loading-ring 1.4s linear infinite}@keyframes large-loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#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-ring{display:inline-block;width:16px;height:16px}#loading-ring: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-ring 1.2s linear infinite}@keyframes loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#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}.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;width:90%;margin-left:auto;margin-right:auto;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}.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}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.loading-message-text{width:1em;padding:.6em .75em .6em 1.3em}.message-bubble>p{line-height:1.26em}.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-bubble{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}.dots-jumping{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:dots-jumping 1.5s infinite linear;bottom:-.7em}@keyframes dots-jumping{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}}.dots-flashing{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite linear alternate;animation-delay:.5s}.dots-flashing:before,.dots-flashing:after{content:\"\";display:inline-block;position:absolute;top:0}.dots-flashing:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:0s}.dots-flashing:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:1s}@keyframes dots-flashing{0%{background-color:var(--message-dots-color)}50%,to{background-color:var(--message-dots-color-fade)}}.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{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.loading-button{background-color:#fff;cursor:auto}.loading-button:hover,.loading-button:active{background-color:#fff}.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}.text-input-placeholder{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}#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}:host{all:initial;display:table-cell}#container{height:100%}\n";
|
10736
|
+
var style = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#large-loading-ring{display:inline-block;width:50px;height:50px}#large-loading-ring:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:large-loading-ring 1.4s linear infinite}@keyframes large-loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#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-ring{display:inline-block;width:16px;height:16px}#loading-ring: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-ring 1.2s linear infinite}@keyframes loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#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}.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;width:90%;margin-left:auto;margin-right:auto;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}.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}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.loading-message-text{width:1em;padding:.6em .75em .6em 1.3em}.message-bubble>p{line-height:1.26em}.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-bubble{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}.dots-jumping{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:dots-jumping 1.5s infinite linear;bottom:-.7em}@keyframes dots-jumping{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}}.dots-flashing{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite linear alternate;animation-delay:.5s}.dots-flashing:before,.dots-flashing:after{content:\"\";display:inline-block;position:absolute;top:0}.dots-flashing:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:0s}.dots-flashing:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:1s}@keyframes dots-flashing{0%{background-color:var(--message-dots-color)}50%,to{background-color:var(--message-dots-color-fade)}}.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{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.loading-button{background-color:#fff;cursor:auto}.loading-button:hover,.loading-button:active{background-color:#fff}.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}.text-input-placeholder{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}#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}:host{all:initial;display:table-cell}#container{height:inherit;overflow:hidden}\n";
|
10705
10737
|
var __defProp = Object.defineProperty,
|
10706
10738
|
__getOwnPropDesc = Object.getOwnPropertyDescriptor,
|
10707
10739
|
__decorateClass = function __decorateClass(r, e, t, n) {
|
10708
10740
|
for (var s = n > 1 ? void 0 : n ? __getOwnPropDesc(e, t) : e, o = r.length - 1, a; o >= 0; o--) (a = r[o]) && (s = (n ? a(e, t, s) : a(s)) || s);
|
10709
10741
|
return n && s && __defProp(e, t, s), s;
|
10710
10742
|
};
|
10711
|
-
var
|
10712
|
-
_inherits(
|
10713
|
-
var _super45 = _createSuper(
|
10743
|
+
var DeepChat = /*#__PURE__*/function (_InternalHTML2) {
|
10744
|
+
_inherits(DeepChat, _InternalHTML2);
|
10745
|
+
var _super45 = _createSuper(DeepChat);
|
10714
10746
|
// TO-DO - key view style
|
10715
|
-
function
|
10716
|
-
var
|
10717
|
-
_classCallCheck(this,
|
10718
|
-
|
10747
|
+
function DeepChat() {
|
10748
|
+
var _this58;
|
10749
|
+
_classCallCheck(this, DeepChat);
|
10750
|
+
_this58 = _super45.call(this), _this58.getMessages = function () {
|
10719
10751
|
return [];
|
10720
|
-
},
|
10752
|
+
}, _this58.submitUserMessage = function () {
|
10721
10753
|
return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
|
10722
|
-
},
|
10723
|
-
FocusUtils.focusFromParentElement(
|
10724
|
-
},
|
10754
|
+
}, _this58.focusInput = function () {
|
10755
|
+
return FocusUtils.focusFromParentElement(_this58._elementRef);
|
10756
|
+
}, _this58.refreshMessages = function () {}, _this58.clearMessages = function () {}, _this58.scrollToBottom = function () {}, _this58.onNewMessage = function () {}, _this58.onClearMessages = function () {}, _this58.onComponentRender = function () {}, _this58._hasBeenRendered = !1, _this58._auxiliaryStyleApplied = !1, GoogleFont.appendStyleSheetToHead(), _this58._elementRef = document.createElement("div"), _this58._elementRef.id = "container", _this58.attachShadow({
|
10725
10757
|
mode: "open"
|
10726
|
-
}).appendChild(
|
10727
|
-
|
10758
|
+
}).appendChild(_this58._elementRef), WebComponentStyleUtils.apply(style, _this58.shadowRoot), setTimeout(function () {
|
10759
|
+
_this58._hasBeenRendered || _this58.onRender();
|
10728
10760
|
}, 20);
|
10729
|
-
return
|
10761
|
+
return _this58;
|
10730
10762
|
}
|
10731
|
-
_createClass(
|
10763
|
+
_createClass(DeepChat, [{
|
10732
10764
|
key: "changeToChatView",
|
10733
10765
|
value: function changeToChatView() {
|
10734
10766
|
this._activeService && (this._activeService.validateConfigKey = !1), this.onRender();
|
10735
10767
|
}
|
10768
|
+
// prettier-ignore
|
10736
10769
|
}, {
|
10737
10770
|
key: "onRender",
|
10738
|
-
value:
|
10739
|
-
// prettier-ignore
|
10740
|
-
function onRender() {
|
10771
|
+
value: function onRender() {
|
10741
10772
|
var _this$_activeService, _this$_childElement;
|
10742
|
-
|
10743
|
-
this.auxiliaryStyle && !this._auxiliaryStyleApplied && (WebComponentStyleUtils.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0);
|
10744
|
-
var e = {
|
10745
|
-
height: "150px",
|
10746
|
-
width: "500px",
|
10747
|
-
border: "1px solid #cacaca",
|
10748
|
-
fontFamily: "'Inter', sans-serif, Avenir, Helvetica, Arial",
|
10749
|
-
fontSize: "0.9rem",
|
10750
|
-
backgroundColor: "white",
|
10751
|
-
position: "relative",
|
10752
|
-
overflow: "hidden"
|
10753
|
-
};
|
10754
|
-
Y.customAssign(this.style, e), this._activeService.key && this._activeService.validateConfigKey ? ValidateKeyPropertyView.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof DirectServiceIO) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], ChatView.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof DirectServiceIO && InsertKeyView.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, FireEvents.onRender(this);
|
10755
|
-
}
|
10756
|
-
}], [{
|
10757
|
-
key: "customAssign",
|
10758
|
-
value: function customAssign(e, t) {
|
10759
|
-
for (var n in t) e[n] === "" && (e[n] = t[n]);
|
10773
|
+
(_this$_activeService = this._activeService) !== null && _this$_activeService !== void 0 ? _this$_activeService : this._activeService = ServiceIOFactory.create(this), this._activeService && (this.auxiliaryStyle && !this._auxiliaryStyleApplied && (WebComponentStyleUtils.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), WebComponentStyleUtils.applyDefaultStyleToComponent(this.style), Legacy.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? ValidateKeyPropertyView.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof DirectServiceIO) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], ChatView.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof DirectServiceIO && InsertKeyView.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, FireEvents.onRender(this));
|
10760
10774
|
}
|
10761
10775
|
}]);
|
10762
|
-
return
|
10776
|
+
return DeepChat;
|
10763
10777
|
}(InternalHTML);
|
10764
|
-
__decorateClass([Property("object")],
|
10765
|
-
__decorateClass([Property("object")],
|
10766
|
-
__decorateClass([Property("object")],
|
10767
|
-
__decorateClass([Property("object")],
|
10768
|
-
__decorateClass([Property("function")],
|
10769
|
-
__decorateClass([Property("function")],
|
10770
|
-
__decorateClass([Property("function")],
|
10771
|
-
__decorateClass([Property("object")],
|
10772
|
-
__decorateClass([Property("object")],
|
10773
|
-
__decorateClass([Property("object")],
|
10774
|
-
__decorateClass([Property("object")],
|
10775
|
-
__decorateClass([Property("object")],
|
10776
|
-
__decorateClass([Property("string")],
|
10777
|
-
__decorateClass([Property("array")],
|
10778
|
-
__decorateClass([Property("object")],
|
10779
|
-
__decorateClass([Property("object")],
|
10780
|
-
__decorateClass([Property("object")],
|
10781
|
-
__decorateClass([Property("boolean")],
|
10782
|
-
__decorateClass([Property("object")],
|
10783
|
-
__decorateClass([Property("object")],
|
10784
|
-
__decorateClass([Property("object")],
|
10785
|
-
__decorateClass([Property("object")],
|
10786
|
-
__decorateClass([Property("object")],
|
10787
|
-
__decorateClass([Property("object")],
|
10788
|
-
__decorateClass([Property("object")],
|
10789
|
-
__decorateClass([Property("object")],
|
10790
|
-
__decorateClass([Property("object")],
|
10791
|
-
__decorateClass([Property("object")],
|
10792
|
-
__decorateClass([Property("object")],
|
10793
|
-
__decorateClass([Property("object")],
|
10794
|
-
__decorateClass([Property("object")],
|
10795
|
-
__decorateClass([Property("function")],
|
10796
|
-
__decorateClass([Property("function")],
|
10797
|
-
__decorateClass([Property("function")],
|
10798
|
-
__decorateClass([Property("object")],
|
10799
|
-
var DeepChat = _DeepChat;
|
10778
|
+
__decorateClass([Property("object")], DeepChat.prototype, "directConnection", 2);
|
10779
|
+
__decorateClass([Property("object")], DeepChat.prototype, "request", 2);
|
10780
|
+
__decorateClass([Property("object")], DeepChat.prototype, "stream", 2);
|
10781
|
+
__decorateClass([Property("object")], DeepChat.prototype, "requestBodyLimits", 2);
|
10782
|
+
__decorateClass([Property("function")], DeepChat.prototype, "requestInterceptor", 2);
|
10783
|
+
__decorateClass([Property("function")], DeepChat.prototype, "responseInterceptor", 2);
|
10784
|
+
__decorateClass([Property("function")], DeepChat.prototype, "validateMessageBeforeSending", 2);
|
10785
|
+
__decorateClass([Property("object")], DeepChat.prototype, "attachmentContainerStyle", 2);
|
10786
|
+
__decorateClass([Property("object")], DeepChat.prototype, "dropupStyles", 2);
|
10787
|
+
__decorateClass([Property("object")], DeepChat.prototype, "inputAreaStyle", 2);
|
10788
|
+
__decorateClass([Property("object")], DeepChat.prototype, "textInput", 2);
|
10789
|
+
__decorateClass([Property("object")], DeepChat.prototype, "submitButtonStyles", 2);
|
10790
|
+
__decorateClass([Property("string")], DeepChat.prototype, "auxiliaryStyle", 2);
|
10791
|
+
__decorateClass([Property("array")], DeepChat.prototype, "initialMessages", 2);
|
10792
|
+
__decorateClass([Property("object")], DeepChat.prototype, "introMessage", 2);
|
10793
|
+
__decorateClass([Property("object")], DeepChat.prototype, "avatars", 2);
|
10794
|
+
__decorateClass([Property("object")], DeepChat.prototype, "names", 2);
|
10795
|
+
__decorateClass([Property("boolean")], DeepChat.prototype, "displayLoadingBubble", 2);
|
10796
|
+
__decorateClass([Property("object")], DeepChat.prototype, "errorMessages", 2);
|
10797
|
+
__decorateClass([Property("object")], DeepChat.prototype, "messageStyles", 2);
|
10798
|
+
__decorateClass([Property("object")], DeepChat.prototype, "textToSpeech", 2);
|
10799
|
+
__decorateClass([Property("object")], DeepChat.prototype, "speechToText", 2);
|
10800
|
+
__decorateClass([Property("object")], DeepChat.prototype, "images", 2);
|
10801
|
+
__decorateClass([Property("object")], DeepChat.prototype, "gifs", 2);
|
10802
|
+
__decorateClass([Property("object")], DeepChat.prototype, "camera", 2);
|
10803
|
+
__decorateClass([Property("object")], DeepChat.prototype, "audio", 2);
|
10804
|
+
__decorateClass([Property("object")], DeepChat.prototype, "microphone", 2);
|
10805
|
+
__decorateClass([Property("object")], DeepChat.prototype, "mixedFiles", 2);
|
10806
|
+
__decorateClass([Property("object")], DeepChat.prototype, "dragAndDrop", 2);
|
10807
|
+
__decorateClass([Property("object")], DeepChat.prototype, "introPanelStyle", 2);
|
10808
|
+
__decorateClass([Property("object")], DeepChat.prototype, "htmlClassUtilities", 2);
|
10809
|
+
__decorateClass([Property("function")], DeepChat.prototype, "onNewMessage", 2);
|
10810
|
+
__decorateClass([Property("function")], DeepChat.prototype, "onClearMessages", 2);
|
10811
|
+
__decorateClass([Property("function")], DeepChat.prototype, "onComponentRender", 2);
|
10812
|
+
__decorateClass([Property("object")], DeepChat.prototype, "demo", 2);
|
10800
10813
|
customElements.define("deep-chat", DeepChat);
|
10801
10814
|
export { DeepChat };
|