deep-chat-dev 9.0.268 → 9.0.270

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.
Files changed (32) hide show
  1. package/custom-elements.json +18012 -17840
  2. package/dist/deepChat.bundle.js +1 -1
  3. package/dist/deepChat.d.ts +2 -1
  4. package/dist/deepChat.d.ts.map +1 -1
  5. package/dist/deepChat.js +836 -794
  6. package/dist/services/serviceIO.d.ts +1 -0
  7. package/dist/services/serviceIO.d.ts.map +1 -1
  8. package/dist/types/openAIRealtime.d.ts +1 -1
  9. package/dist/types/stream.d.ts +6 -1
  10. package/dist/types/stream.d.ts.map +1 -1
  11. package/dist/types/textInput.d.ts +4 -0
  12. package/dist/types/textInput.d.ts.map +1 -1
  13. package/dist/utils/HTTP/stream.d.ts.map +1 -1
  14. package/dist/utils/events/fireEvents.d.ts +4 -0
  15. package/dist/utils/events/fireEvents.d.ts.map +1 -1
  16. package/dist/views/chat/input/fileAttachments/fileAttachmentTypes/audioFileAttachmentType.d.ts +2 -1
  17. package/dist/views/chat/input/fileAttachments/fileAttachmentTypes/audioFileAttachmentType.d.ts.map +1 -1
  18. package/dist/views/chat/input/fileAttachments/fileAttachmentTypes/fileAttachmentTypeFactory.d.ts +2 -2
  19. package/dist/views/chat/input/fileAttachments/fileAttachmentTypes/fileAttachmentTypeFactory.d.ts.map +1 -1
  20. package/dist/views/chat/input/fileAttachments/fileAttachmentTypes/fileAttachmentsType.d.ts +4 -2
  21. package/dist/views/chat/input/fileAttachments/fileAttachmentTypes/fileAttachmentsType.d.ts.map +1 -1
  22. package/dist/views/chat/input/fileAttachments/fileAttachments.d.ts +2 -2
  23. package/dist/views/chat/input/fileAttachments/fileAttachments.d.ts.map +1 -1
  24. package/dist/views/chat/input/input.d.ts +1 -0
  25. package/dist/views/chat/input/input.d.ts.map +1 -1
  26. package/dist/views/chat/input/textInput/textInput.d.ts +2 -1
  27. package/dist/views/chat/input/textInput/textInput.d.ts.map +1 -1
  28. package/dist/views/chat/messages/stream/messageStream.d.ts +7 -3
  29. package/dist/views/chat/messages/stream/messageStream.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/types/streamWrapper.d.ts +0 -8
  32. package/dist/types/streamWrapper.d.ts.map +0 -1
package/dist/deepChat.js CHANGED
@@ -31,11 +31,11 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
31
31
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
32
32
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
33
33
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
34
- var qn = /*#__PURE__*/function () {
35
- function qn() {
36
- _classCallCheck(this, qn);
34
+ var Hn = /*#__PURE__*/function () {
35
+ function Hn() {
36
+ _classCallCheck(this, Hn);
37
37
  }
38
- return _createClass(qn, null, [{
38
+ return _createClass(Hn, null, [{
39
39
  key: "render",
40
40
  value: function render(e, t) {
41
41
  var i = document.createElement("div");
@@ -43,11 +43,11 @@ var qn = /*#__PURE__*/function () {
43
43
  }
44
44
  }]);
45
45
  }();
46
- var gi = /*#__PURE__*/function () {
47
- function gi() {
48
- _classCallCheck(this, gi);
46
+ var bi = /*#__PURE__*/function () {
47
+ function bi() {
48
+ _classCallCheck(this, bi);
49
49
  }
50
- return _createClass(gi, null, [{
50
+ return _createClass(bi, null, [{
51
51
  key: "onLoad",
52
52
  value: function onLoad(e) {
53
53
  e.innerHTML = '<div id="loading-validate-key-property"></div>';
@@ -61,11 +61,11 @@ var gi = /*#__PURE__*/function () {
61
61
  }, {
62
62
  key: "render",
63
63
  value: function render(e, t, i) {
64
- var s = gi.createElements(),
64
+ var s = bi.createElements(),
65
65
  r = {
66
66
  onSuccess: t,
67
- onFail: qn.render.bind(this, e, "Your 'key' has failed authentication"),
68
- onLoad: gi.onLoad.bind(this, s)
67
+ onFail: Hn.render.bind(this, e, "Your 'key' has failed authentication"),
68
+ onLoad: bi.onLoad.bind(this, s)
69
69
  };
70
70
  i.key && i.verifyKey(i.key, r), e.replaceChildren(s);
71
71
  }
@@ -156,18 +156,18 @@ var Je = /*#__PURE__*/function () {
156
156
  }]);
157
157
  }();
158
158
  Je.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap", Je.DEFAULT_FONT_FAMILY = "'Inter', sans-serif, Avenir, Helvetica, Arial";
159
- var bi = Je;
160
- var ht = /*#__PURE__*/function () {
161
- function ht() {
162
- _classCallCheck(this, ht);
159
+ var vi = Je;
160
+ var ut = /*#__PURE__*/function () {
161
+ function ut() {
162
+ _classCallCheck(this, ut);
163
163
  }
164
- return _createClass(ht, null, [{
164
+ return _createClass(ut, null, [{
165
165
  key: "apply",
166
166
  value: function apply(e, t) {
167
167
  if (t) try {
168
- ht.applyStyleSheet(e, t);
168
+ ut.applyStyleSheet(e, t);
169
169
  } catch (_unused) {
170
- ht.addStyleElement(e, t);
170
+ ut.addStyleElement(e, t);
171
171
  }
172
172
  }
173
173
  }, {
@@ -185,18 +185,18 @@ var ht = /*#__PURE__*/function () {
185
185
  }, {
186
186
  key: "applyDefaultStyleToComponent",
187
187
  value: function applyDefaultStyleToComponent(e, t) {
188
- t && I.applyToStyleIfNotDefined(e, t), I.applyToStyleIfNotDefined(e, ht.DEFAULT_COMPONENT_STYLE);
188
+ t && I.applyToStyleIfNotDefined(e, t), I.applyToStyleIfNotDefined(e, ut.DEFAULT_COMPONENT_STYLE);
189
189
  }
190
190
  }]);
191
191
  }();
192
- ht.DEFAULT_COMPONENT_STYLE = {
192
+ ut.DEFAULT_COMPONENT_STYLE = {
193
193
  height: "350px",
194
194
  width: "320px",
195
195
  borderTop: "1px solid #cacaca",
196
196
  borderRight: "1px solid #cacaca",
197
197
  borderLeft: "1px solid #cacaca",
198
198
  borderBottom: "1px solid #cacaca",
199
- fontFamily: bi.DEFAULT_FONT_FAMILY,
199
+ fontFamily: vi.DEFAULT_FONT_FAMILY,
200
200
  fontSize: "0.9rem",
201
201
  backgroundColor: "white",
202
202
  position: "relative",
@@ -206,12 +206,12 @@ ht.DEFAULT_COMPONENT_STYLE = {
206
206
  // this is also causing the chat to squeeze when there is no space
207
207
  overflow: "hidden"
208
208
  };
209
- var Ht = ht;
210
- var $t = /*#__PURE__*/_createClass(function $t() {
211
- _classCallCheck(this, $t);
209
+ var zt = ut;
210
+ var Wt = /*#__PURE__*/_createClass(function Wt() {
211
+ _classCallCheck(this, Wt);
212
212
  });
213
- $t.IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), $t.IS_CHROMIUM = window.chrome, $t.IS_MOBILE = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
214
- var Be = $t;
213
+ Wt.IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), Wt.IS_CHROMIUM = window.chrome, Wt.IS_MOBILE = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
214
+ var Be = Wt;
215
215
  var U = /* @__PURE__ */function (n) {
216
216
  return n.ESCAPE = "Escape", n.ENTER = "Enter", n.TAB = "Tab", n.ARROW_UP = "ArrowUp", n.ARROW_DOWN = "ArrowDown", n.ARROW_RIGHT = "ArrowRight", n.ARROW_LEFT = "ArrowLeft", n.BACKSPACE = "Backspace", n.DELETE = "Delete", n.META = "Meta", n.CONTROL = "Control", n;
217
217
  }(U || {});
@@ -247,17 +247,17 @@ var Xe = /*#__PURE__*/function () {
247
247
  value: function onInput(e, t, i) {
248
248
  var s = i.target,
249
249
  r = s.textContent || "";
250
- e !== void 0 && r.length > e && (s.textContent = r.substring(0, e), ai.focusEndOfInput(s)), t == null || t();
250
+ e !== void 0 && r.length > e && (s.textContent = r.substring(0, e), li.focusEndOfInput(s)), t == null || t();
251
251
  }
252
252
  }]);
253
253
  }();
254
254
  Xe.PERMITTED_KEYS = /* @__PURE__ */new Set([U.BACKSPACE, U.DELETE, U.ARROW_RIGHT, U.ARROW_LEFT, U.ARROW_DOWN, U.ARROW_UP, U.META, U.CONTROL, U.ENTER]);
255
255
  var Qi = Xe;
256
- var Hn = /*#__PURE__*/function () {
257
- function Hn() {
258
- _classCallCheck(this, Hn);
256
+ var qn = /*#__PURE__*/function () {
257
+ function qn() {
258
+ _classCallCheck(this, qn);
259
259
  }
260
- return _createClass(Hn, null, [{
260
+ return _createClass(qn, null, [{
261
261
  key: "sanitizePastedTextContent",
262
262
  value: function sanitizePastedTextContent(e) {
263
263
  var i, s;
@@ -275,7 +275,7 @@ var Ye = /*#__PURE__*/function () {
275
275
  this._isComposing = !1;
276
276
  var s = Ye.processConfig(t, e.textInput);
277
277
  this.elementRef = Ye.createContainerElement((r = s == null ? void 0 : s.styles) == null ? void 0 : r.container), this._config = s, this.inputElementRef = this.createInputElement(), this.elementRef.appendChild(this.inputElementRef), e.setPlaceholderText = this.setPlaceholderText.bind(this), e.setPlaceholderText(((o = this._config.placeholder) == null ? void 0 : o.text) || "Ask me anything!"), setTimeout(function () {
278
- Qi.add(_this.inputElementRef, i, _this._config.characterLimit, e._validationHandler);
278
+ Qi.add(_this.inputElementRef, i, _this._config.characterLimit, e._validationHandler), _this._onInput = t.onInput;
279
279
  });
280
280
  }
281
281
  return _createClass(Ye, [{
@@ -283,9 +283,9 @@ var Ye = /*#__PURE__*/function () {
283
283
  value:
284
284
  // this also similarly prevents scroll up
285
285
  function clear() {
286
- var t;
286
+ var t, i;
287
287
  var e = window.scrollY;
288
- this.inputElementRef.classList.contains("text-input-disabled") || (Object.assign(this.inputElementRef.style, (t = this._config.placeholder) == null ? void 0 : t.style), this.inputElementRef.textContent = "", ai.focusEndOfInput(this.inputElementRef)), Be.IS_CHROMIUM && window.scrollTo({
288
+ this.inputElementRef.classList.contains("text-input-disabled") || (Object.assign(this.inputElementRef.style, (t = this._config.placeholder) == null ? void 0 : t.style), this.inputElementRef.textContent = "", li.focusEndOfInput(this.inputElementRef), (i = this._onInput) == null || i.call(this, !1)), Be.IS_CHROMIUM && window.scrollTo({
289
289
  top: e
290
290
  });
291
291
  }
@@ -310,7 +310,7 @@ var Ye = /*#__PURE__*/function () {
310
310
  (t = this._config.styles) != null && t.focus && (e.onfocus = function () {
311
311
  var s;
312
312
  return Object.assign(_this2.elementRef.style, (s = _this2._config.styles) == null ? void 0 : s.focus);
313
- }, e.onblur = this.onBlur.bind(this, this._config.styles.focus, (i = this._config.styles) == null ? void 0 : i.container)), e.addEventListener("keydown", this.onKeydown.bind(this)), e.addEventListener("input", this.onInput.bind(this)), e.addEventListener("paste", Hn.sanitizePastedTextContent), e.addEventListener("compositionstart", function () {
313
+ }, e.onblur = this.onBlur.bind(this, this._config.styles.focus, (i = this._config.styles) == null ? void 0 : i.container)), e.addEventListener("keydown", this.onKeydown.bind(this)), e.addEventListener("input", this.onInput.bind(this)), e.addEventListener("paste", qn.sanitizePastedTextContent), e.addEventListener("compositionstart", function () {
314
314
  return _this2._isComposing = !0;
315
315
  }), e.addEventListener("compositionend", function () {
316
316
  return _this2._isComposing = !1;
@@ -330,8 +330,8 @@ var Ye = /*#__PURE__*/function () {
330
330
  }, {
331
331
  key: "onInput",
332
332
  value: function onInput() {
333
- var e;
334
- this.isTextInputEmpty() ? Object.assign(this.inputElementRef.style, (e = this._config.placeholder) == null ? void 0 : e.style) : this.removePlaceholderStyle();
333
+ var e, t;
334
+ this.isTextInputEmpty() ? Object.assign(this.inputElementRef.style, (e = this._config.placeholder) == null ? void 0 : e.style) : this.removePlaceholderStyle(), (t = this._onInput) == null || t.call(this, !0);
335
335
  }
336
336
  }, {
337
337
  key: "setPlaceholderText",
@@ -376,12 +376,12 @@ var Ye = /*#__PURE__*/function () {
376
376
  }]);
377
377
  }();
378
378
  Ye.TEXT_INPUT_ID = "text-input";
379
- var vi = Ye;
380
- var ai = /*#__PURE__*/function () {
381
- function ai() {
382
- _classCallCheck(this, ai);
379
+ var yi = Ye;
380
+ var li = /*#__PURE__*/function () {
381
+ function li() {
382
+ _classCallCheck(this, li);
383
383
  }
384
- return _createClass(ai, null, [{
384
+ return _createClass(li, null, [{
385
385
  key: "focusEndOfInput",
386
386
  value: function focusEndOfInput(e) {
387
387
  var t = document.createRange();
@@ -392,8 +392,8 @@ var ai = /*#__PURE__*/function () {
392
392
  }, {
393
393
  key: "focusFromParentElement",
394
394
  value: function focusFromParentElement(e) {
395
- var t = e.querySelector("#".concat(vi.TEXT_INPUT_ID));
396
- t && (Be.IS_SAFARI && t.focus(), ai.focusEndOfInput(t));
395
+ var t = e.querySelector("#".concat(yi.TEXT_INPUT_ID));
396
+ t && (Be.IS_SAFARI && t.focus(), li.focusEndOfInput(t));
397
397
  }
398
398
  }]);
399
399
  }();
@@ -479,7 +479,7 @@ var Ds = "Make sure the events are using {text: string} or {html: string} format
479
479
  }]);
480
480
  }();
481
481
  Bi.CODE_SNIPPET_GENERATION_JUMP = 0.5;
482
- var G = Bi;
482
+ var V = Bi;
483
483
  var Fi = /*#__PURE__*/function () {
484
484
  function Fi() {
485
485
  _classCallCheck(this, Fi);
@@ -510,12 +510,12 @@ var Fi = /*#__PURE__*/function () {
510
510
  }]);
511
511
  }();
512
512
  Fi.LOAD_VOICES_MS = 200;
513
- var gt = Fi;
514
- var ut = /*#__PURE__*/function () {
515
- function ut() {
516
- _classCallCheck(this, ut);
513
+ var bt = Fi;
514
+ var ft = /*#__PURE__*/function () {
515
+ function ft() {
516
+ _classCallCheck(this, ft);
517
517
  }
518
- return _createClass(ut, null, [{
518
+ return _createClass(ft, null, [{
519
519
  key: "colorToHex",
520
520
  value: function colorToHex(e) {
521
521
  var t = document.createElement("div");
@@ -528,7 +528,7 @@ var ut = /*#__PURE__*/function () {
528
528
  value: function setDots(e, t) {
529
529
  var i, s, r, o;
530
530
  if ((o = (r = (s = (i = t == null ? void 0 : t.loading) == null ? void 0 : i.message) == null ? void 0 : s.styles) == null ? void 0 : r.bubble) != null && o.color) {
531
- var a = ut.colorToHex(t.loading.message.styles.bubble.color);
531
+ var a = ft.colorToHex(t.loading.message.styles.bubble.color);
532
532
  e.style.setProperty("--loading-message-color", a), e.style.setProperty("--loading-message-color-fade", "".concat(a, "33"));
533
533
  } else e.style.setProperty("--loading-message-color", "#848484"), e.style.setProperty("--loading-message-color-fade", "#55555533");
534
534
  }
@@ -542,15 +542,15 @@ var ut = /*#__PURE__*/function () {
542
542
  o = _ref.margin,
543
543
  a = _ref.border;
544
544
  if (i) {
545
- var l = ut.colorToHex(i);
545
+ var l = ft.colorToHex(i);
546
546
  e.style.setProperty("--loading-history-color", l);
547
547
  } else e.style.setProperty("--loading-history-color", "#dbdbdb");
548
548
  e.style.setProperty("--loading-history-height", r || "57px"), e.style.setProperty("--loading-history-width", s || "57px"), e.style.setProperty("--loading-history-margin", o || "7px"), e.style.setProperty("--loading-history-border", a || "6px solid");
549
549
  }
550
550
  }]);
551
551
  }();
552
- ut.BUBBLE_CLASS = "deep-chat-loading-message-bubble", ut.DOTS_CONTAINER_CLASS = "deep-chat-loading-message-dots-container";
553
- var De = ut;
552
+ ft.BUBBLE_CLASS = "deep-chat-loading-message-bubble", ft.DOTS_CONTAINER_CLASS = "deep-chat-loading-message-dots-container";
553
+ var De = ft;
554
554
  var ce = /*#__PURE__*/function () {
555
555
  function ce() {
556
556
  _classCallCheck(this, ce);
@@ -647,7 +647,7 @@ var ce = /*#__PURE__*/function () {
647
647
  }]);
648
648
  }();
649
649
  ce.DEFAULT_FILE_NAME = "file", ce.FILE_BUBBLE_CLASS = "file-message";
650
- var H = ce;
650
+ var q = ce;
651
651
  var te = /*#__PURE__*/function () {
652
652
  function te() {
653
653
  _classCallCheck(this, te);
@@ -743,11 +743,11 @@ var te = /*#__PURE__*/function () {
743
743
  }
744
744
  }]);
745
745
  }();
746
- var $e = /*#__PURE__*/function () {
747
- function $e() {
748
- _classCallCheck(this, $e);
746
+ var We = /*#__PURE__*/function () {
747
+ function We() {
748
+ _classCallCheck(this, We);
749
749
  }
750
- return _createClass($e, null, [{
750
+ return _createClass(We, null, [{
751
751
  key: "mouseUp",
752
752
  value: function mouseUp(e, t) {
753
753
  I.unsetAllCSSMouseStates(e, t), Object.assign(e.style, t["default"]), Object.assign(e.style, t.hover);
@@ -770,12 +770,12 @@ var $e = /*#__PURE__*/function () {
770
770
  }, {
771
771
  key: "add",
772
772
  value: function add(e, t) {
773
- e.addEventListener("mouseenter", $e.mouseEnter.bind(this, e, t)), e.addEventListener("mouseleave", $e.mouseLeave.bind(this, e, t)), e.addEventListener("mousedown", $e.mouseDown.bind(this, e, t)), e.addEventListener("mouseup", $e.mouseUp.bind(this, e, t));
773
+ e.addEventListener("mouseenter", We.mouseEnter.bind(this, e, t)), e.addEventListener("mouseleave", We.mouseLeave.bind(this, e, t)), e.addEventListener("mousedown", We.mouseDown.bind(this, e, t)), e.addEventListener("mouseup", We.mouseUp.bind(this, e, t));
774
774
  }
775
775
  }]);
776
776
  }();
777
- var $n = "deep-chat-temporary-message",
778
- Wn = "deep-chat-suggestion-button",
777
+ var Wn = "deep-chat-temporary-message",
778
+ $n = "deep-chat-suggestion-button",
779
779
  es = {
780
780
  "deep-chat-button": {
781
781
  styles: {
@@ -798,11 +798,11 @@ var $n = "deep-chat-temporary-message",
798
798
  }
799
799
  },
800
800
  Bs = Object.keys(es);
801
- var Se = /*#__PURE__*/function () {
802
- function Se() {
803
- _classCallCheck(this, Se);
801
+ var _e = /*#__PURE__*/function () {
802
+ function _e() {
803
+ _classCallCheck(this, _e);
804
804
  }
805
- return _createClass(Se, null, [{
805
+ return _createClass(_e, null, [{
806
806
  key: "applySuggestionEvent",
807
807
  value: function applySuggestionEvent(e, t) {
808
808
  setTimeout(function () {
@@ -818,7 +818,7 @@ var Se = /*#__PURE__*/function () {
818
818
  key: "isElementTemporary",
819
819
  value: function isElementTemporary(e) {
820
820
  var t;
821
- return e ? (t = e.bubbleElement.children[0]) == null ? void 0 : t.classList.contains($n) : !1;
821
+ return e ? (t = e.bubbleElement.children[0]) == null ? void 0 : t.classList.contains(Wn) : !1;
822
822
  }
823
823
  }, {
824
824
  key: "doesElementContainDeepChatClass",
@@ -857,26 +857,26 @@ var Se = /*#__PURE__*/function () {
857
857
  Bs.forEach(function (r) {
858
858
  var o = i.getElementsByClassName(r);
859
859
  Array.from(o || []).forEach(function (a) {
860
- var l = Se.getProcessedStyles(t, a, r);
861
- X.applyStylesToElement(a, l), Se.applyEvents(a, r);
860
+ var l = _e.getProcessedStyles(t, a, r);
861
+ G.applyStylesToElement(a, l), _e.applyEvents(a, r);
862
862
  });
863
863
  });
864
- var s = i.getElementsByClassName(Wn);
864
+ var s = i.getElementsByClassName($n);
865
865
  Array.from(s).forEach(function (r) {
866
- return Se.applySuggestionEvent(e, r);
866
+ return _e.applySuggestionEvent(e, r);
867
867
  });
868
868
  }
869
869
  }]);
870
870
  }();
871
- var X = /*#__PURE__*/function () {
872
- function X() {
873
- _classCallCheck(this, X);
871
+ var G = /*#__PURE__*/function () {
872
+ function G() {
873
+ _classCallCheck(this, G);
874
874
  }
875
- return _createClass(X, null, [{
875
+ return _createClass(G, null, [{
876
876
  key: "applyStylesToElement",
877
877
  value: function applyStylesToElement(e, t) {
878
878
  var i = I.processStateful(t);
879
- $e.add(e, i), Object.assign(e.style, i["default"]);
879
+ We.add(e, i), Object.assign(e.style, i["default"]);
880
880
  }
881
881
  }, {
882
882
  key: "applyEventsToElement",
@@ -891,7 +891,7 @@ var X = /*#__PURE__*/function () {
891
891
  value: function applyClassUtilitiesToElement(e, t) {
892
892
  var i = t.events,
893
893
  s = t.styles;
894
- i && X.applyEventsToElement(e, i), s && !Se.doesElementContainDeepChatClass(e) && X.applyStylesToElement(e, s);
894
+ i && G.applyEventsToElement(e, i), s && !_e.doesElementContainDeepChatClass(e) && G.applyStylesToElement(e, s);
895
895
  }
896
896
  }, {
897
897
  key: "applyCustomClassUtilities",
@@ -899,20 +899,20 @@ var X = /*#__PURE__*/function () {
899
899
  Object.keys(e).forEach(function (i) {
900
900
  var s = t.getElementsByClassName(i);
901
901
  Array.from(s).forEach(function (r) {
902
- e[i] && X.applyClassUtilitiesToElement(r, e[i]);
902
+ e[i] && G.applyClassUtilitiesToElement(r, e[i]);
903
903
  });
904
904
  });
905
905
  }
906
906
  }, {
907
907
  key: "apply",
908
908
  value: function apply(e, t) {
909
- Se.applyDeepChatUtilities(e, e.htmlClassUtilities, t), X.applyCustomClassUtilities(e.htmlClassUtilities, t);
909
+ _e.applyDeepChatUtilities(e, e.htmlClassUtilities, t), G.applyCustomClassUtilities(e.htmlClassUtilities, t);
910
910
  }
911
911
  }, {
912
912
  key: "traverseNodes",
913
913
  value: function traverseNodes(e, t) {
914
914
  e.nodeType === Node.ELEMENT_NODE && t.push(e.outerHTML), e.childNodes.forEach(function (i) {
915
- X.traverseNodes(i, t);
915
+ G.traverseNodes(i, t);
916
916
  });
917
917
  }
918
918
  }, {
@@ -921,14 +921,14 @@ var X = /*#__PURE__*/function () {
921
921
  var i = new DOMParser().parseFromString(e, "text/html"),
922
922
  s = [];
923
923
  return i.body.childNodes.forEach(function (r) {
924
- X.traverseNodes(r, s);
924
+ G.traverseNodes(r, s);
925
925
  }), s;
926
926
  }
927
927
  }, {
928
928
  key: "isTemporaryBasedOnHTML",
929
929
  value: function isTemporaryBasedOnHTML(e) {
930
930
  var t = document.createElement("div");
931
- return t.innerHTML = e, Se.isElementTemporary({
931
+ return t.innerHTML = e, _e.isElementTemporary({
932
932
  outerContainer: t,
933
933
  bubbleElement: t,
934
934
  innerContainer: t
@@ -944,11 +944,11 @@ var X = /*#__PURE__*/function () {
944
944
  }
945
945
  }]);
946
946
  }();
947
- var ke = /*#__PURE__*/function () {
948
- function ke() {
949
- _classCallCheck(this, ke);
947
+ var Le = /*#__PURE__*/function () {
948
+ function Le() {
949
+ _classCallCheck(this, Le);
950
950
  }
951
- return _createClass(ke, null, [{
951
+ return _createClass(Le, null, [{
952
952
  key: "addElement",
953
953
  value: function addElement(e, t) {
954
954
  e.appendOuterContainerElemet(t), e.focusMode || (e.elementRef.scrollTop = e.elementRef.scrollHeight);
@@ -958,28 +958,28 @@ var ke = /*#__PURE__*/function () {
958
958
  value: function createElements(e, t, i, s) {
959
959
  var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
960
960
  var o = e.createMessageElementsOnOrientation("", i, s, r);
961
- return o.bubbleElement.classList.add(ke.HTML_BUBBLE_CLASS), o.bubbleElement.innerHTML = t, o;
961
+ return o.bubbleElement.classList.add(Le.HTML_BUBBLE_CLASS), o.bubbleElement.innerHTML = t, o;
962
962
  }
963
963
  }, {
964
964
  key: "overwriteElements",
965
965
  value: function overwriteElements(e, t, i) {
966
- i.bubbleElement.innerHTML = t, X.apply(e, i.outerContainer), te.flagHTMLUpdateClass(i.bubbleElement);
966
+ i.bubbleElement.innerHTML = t, G.apply(e, i.outerContainer), te.flagHTMLUpdateClass(i.bubbleElement);
967
967
  }
968
968
  // prettier-ignore
969
969
  }, {
970
970
  key: "overwrite",
971
971
  value: function overwrite(e, t, i, s) {
972
972
  var r = e.messageToElements,
973
- o = y.overwriteMessage(r, s, t, i, "html", ke.HTML_BUBBLE_CLASS);
974
- return o && ke.overwriteElements(e, t, o), o;
973
+ o = y.overwriteMessage(r, s, t, i, "html", Le.HTML_BUBBLE_CLASS);
974
+ return o && Le.overwriteElements(e, t, o), o;
975
975
  }
976
976
  }, {
977
977
  key: "create",
978
978
  value: function create(e, t, i) {
979
979
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
980
980
  var o;
981
- var r = ke.createElements(e, t, i, s);
982
- return y.fillEmptyMessageElement(r.bubbleElement, t), X.apply(e, r.outerContainer), te.flagHTMLUpdateClass(r.bubbleElement), e.applyCustomStyles(r, i, !1, (o = e.messageStyles) == null ? void 0 : o.html), r;
981
+ var r = Le.createElements(e, t, i, s);
982
+ return y.fillEmptyMessageElement(r.bubbleElement, t), G.apply(e, r.outerContainer), te.flagHTMLUpdateClass(r.bubbleElement), e.applyCustomStyles(r, i, !1, (o = e.messageStyles) == null ? void 0 : o.html), r;
983
983
  }
984
984
  }, {
985
985
  key: "add",
@@ -990,17 +990,17 @@ var ke = /*#__PURE__*/function () {
990
990
  if (a) return a;
991
991
  s.status = !1;
992
992
  }
993
- if (r && e.messageElementRefs.length > 0 && X.isTemporaryBasedOnHTML(t)) return;
994
- var o = ke.create(e, t, i, r);
995
- return r || ke.addElement(e, o.outerContainer), o;
993
+ if (r && e.messageElementRefs.length > 0 && G.isTemporaryBasedOnHTML(t)) return;
994
+ var o = Le.create(e, t, i, r);
995
+ return r || Le.addElement(e, o.outerContainer), o;
996
996
  }
997
997
  }]);
998
998
  }();
999
- ke.HTML_BUBBLE_CLASS = "html-message";
1000
- var _e = ke;
1001
- var hi;
999
+ Le.HTML_BUBBLE_CLASS = "html-message";
1000
+ var xe = Le;
1001
+ var ui;
1002
1002
  function _n(n) {
1003
- return hi = hi || document.createElement("textarea"), hi.innerHTML = "&" + n + ";", hi.value;
1003
+ return ui = ui || document.createElement("textarea"), ui.innerHTML = "&" + n + ";", ui.value;
1004
1004
  }
1005
1005
  var Jn = Object.prototype.hasOwnProperty;
1006
1006
  function Xn(n, e) {
@@ -1643,7 +1643,7 @@ var vr = /['"]/,
1643
1643
  Us = /['"]/g,
1644
1644
  yr = /[-\s()\[\]]/,
1645
1645
  js = "’";
1646
- function qs(n, e) {
1646
+ function Hs(n, e) {
1647
1647
  return e < 0 || e >= n.length ? !1 : !yr.test(n[e]);
1648
1648
  }
1649
1649
  function dt(n, e, t) {
@@ -1657,7 +1657,7 @@ function Er(n) {
1657
1657
  for (a = g[e].level, f = b.length - 1; f >= 0 && !(b[f].level <= a); f--);
1658
1658
  b.length = f + 1, i = t.content, r = 0, o = i.length;
1659
1659
  e: for (; r < o && (Us.lastIndex = r, s = Us.exec(i), !!s);) {
1660
- if (l = !qs(i, s.index - 1), r = s.index + 1, m = s[0] === "'", c = !qs(i, r), !c && !l) {
1660
+ if (l = !Hs(i, s.index - 1), r = s.index + 1, m = s[0] === "'", c = !Hs(i, r), !c && !l) {
1661
1661
  m && (t.content = dt(t.content, s.index, js));
1662
1662
  continue;
1663
1663
  }
@@ -1831,7 +1831,7 @@ function wr(n, e, t, i) {
1831
1831
  level: n.level
1832
1832
  })), !0);
1833
1833
  }
1834
- function Hs(n, e) {
1834
+ function qs(n, e) {
1835
1835
  var t, i, s;
1836
1836
  return i = n.bMarks[e] + n.tShift[e], s = n.eMarks[e], i >= s || (t = n.src.charCodeAt(i++), t !== 42 && t !== 45 && t !== 43) || i < s && n.src.charCodeAt(i) !== 32 ? -1 : i;
1837
1837
  }
@@ -1872,47 +1872,47 @@ function Tr(n, e, t, i) {
1872
1872
  b,
1873
1873
  M,
1874
1874
  Y,
1875
- qe,
1875
+ He,
1876
1876
  ae,
1877
- Ce = !0,
1878
- ye,
1877
+ Re = !0,
1878
+ Ee,
1879
1879
  ie,
1880
1880
  Ps,
1881
- Wi;
1882
- if ((u = zs(n, e)) >= 0) g = !0;else if ((u = Hs(n, e)) >= 0) g = !1;else return !1;
1881
+ $i;
1882
+ if ((u = zs(n, e)) >= 0) g = !0;else if ((u = qs(n, e)) >= 0) g = !1;else return !1;
1883
1883
  if (n.level >= n.options.maxNesting) return !1;
1884
1884
  if (p = n.src.charCodeAt(u - 1), i) return !0;
1885
1885
  for (M = n.tokens.length, g ? (d = n.bMarks[e] + n.tShift[e], m = Number(n.src.substr(d, u - d - 1)), n.tokens.push({
1886
1886
  type: "ordered_list_open",
1887
1887
  order: m,
1888
- lines: qe = [e, 0],
1888
+ lines: He = [e, 0],
1889
1889
  level: n.level++
1890
1890
  })) : n.tokens.push({
1891
1891
  type: "bullet_list_open",
1892
- lines: qe = [e, 0],
1892
+ lines: He = [e, 0],
1893
1893
  level: n.level++
1894
- }), s = e, Y = !1, ye = n.parser.ruler.getRules("list"); s < t && (b = n.skipSpaces(u), h = n.eMarks[s], b >= h ? f = 1 : f = b - u, f > 4 && (f = 1), f < 1 && (f = 1), r = u - n.bMarks[s] + f, n.tokens.push({
1894
+ }), s = e, Y = !1, Ee = n.parser.ruler.getRules("list"); s < t && (b = n.skipSpaces(u), h = n.eMarks[s], b >= h ? f = 1 : f = b - u, f > 4 && (f = 1), f < 1 && (f = 1), r = u - n.bMarks[s] + f, n.tokens.push({
1895
1895
  type: "list_item_open",
1896
1896
  lines: ae = [e, 0],
1897
1897
  level: n.level++
1898
- }), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] = b - n.bMarks[e], n.blkIndent = r, n.tight = !0, n.parentType = "list", n.parser.tokenize(n, e, t, !0), (!n.tight || Y) && (Ce = !1), Y = n.line - e > 1 && n.isEmpty(n.line - 1), n.blkIndent = a, n.tShift[e] = o, n.tight = l, n.parentType = c, n.tokens.push({
1898
+ }), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] = b - n.bMarks[e], n.blkIndent = r, n.tight = !0, n.parentType = "list", n.parser.tokenize(n, e, t, !0), (!n.tight || Y) && (Re = !1), Y = n.line - e > 1 && n.isEmpty(n.line - 1), n.blkIndent = a, n.tShift[e] = o, n.tight = l, n.parentType = c, n.tokens.push({
1899
1899
  type: "list_item_close",
1900
1900
  level: --n.level
1901
1901
  }), s = e = n.line, ae[1] = s, b = n.bMarks[e], !(s >= t || n.isEmpty(s) || n.tShift[s] < n.blkIndent));) {
1902
- for (Wi = !1, ie = 0, Ps = ye.length; ie < Ps; ie++) if (ye[ie](n, s, t, !0)) {
1903
- Wi = !0;
1902
+ for ($i = !1, ie = 0, Ps = Ee.length; ie < Ps; ie++) if (Ee[ie](n, s, t, !0)) {
1903
+ $i = !0;
1904
1904
  break;
1905
1905
  }
1906
- if (Wi) break;
1906
+ if ($i) break;
1907
1907
  if (g) {
1908
1908
  if (u = zs(n, s), u < 0) break;
1909
- } else if (u = Hs(n, s), u < 0) break;
1909
+ } else if (u = qs(n, s), u < 0) break;
1910
1910
  if (p !== n.src.charCodeAt(u - 1)) break;
1911
1911
  }
1912
1912
  return n.tokens.push({
1913
1913
  type: g ? "ordered_list_close" : "bullet_list_close",
1914
1914
  level: --n.level
1915
- }), qe[1] = s, n.line = s, Ce && Ar(n, M), !0;
1915
+ }), He[1] = s, n.line = s, Re && Ar(n, M), !0;
1916
1916
  }
1917
1917
  function Cr(n, e, t, i) {
1918
1918
  var s,
@@ -2103,7 +2103,7 @@ function Pr(n, e, t, i) {
2103
2103
  level: --n.level
2104
2104
  }), f[1] = m[1] = l, n.line = l, !0;
2105
2105
  }
2106
- function ui(n, e) {
2106
+ function fi(n, e) {
2107
2107
  var t,
2108
2108
  i,
2109
2109
  s = n.bMarks[e] + n.tShift[e],
@@ -2118,8 +2118,8 @@ function Nr(n, e) {
2118
2118
  }
2119
2119
  function Dr(n, e, t, i) {
2120
2120
  var s, r, o, a, l, c, d, u, h, f, m, p, g, b;
2121
- if (i) return n.ddIndent < 0 ? !1 : ui(n, e) >= 0;
2122
- if (d = e + 1, n.isEmpty(d) && ++d > t || n.tShift[d] < n.blkIndent || (s = ui(n, d), s < 0) || n.level >= n.options.maxNesting) return !1;
2121
+ if (i) return n.ddIndent < 0 ? !1 : fi(n, e) >= 0;
2122
+ if (d = e + 1, n.isEmpty(d) && ++d > t || n.tShift[d] < n.blkIndent || (s = fi(n, d), s < 0) || n.level >= n.options.maxNesting) return !1;
2123
2123
  c = n.tokens.length, n.tokens.push({
2124
2124
  type: "dl_open",
2125
2125
  lines: l = [e, 0],
@@ -2148,10 +2148,10 @@ function Dr(n, e, t, i) {
2148
2148
  type: "dd_close",
2149
2149
  level: --n.level
2150
2150
  }), a[1] = d = n.line, d >= t || n.tShift[d] < n.blkIndent) break e;
2151
- if (s = ui(n, d), s < 0) break;
2151
+ if (s = fi(n, d), s < 0) break;
2152
2152
  r = d;
2153
2153
  }
2154
- if (d >= t || (o = d, n.isEmpty(o)) || n.tShift[o] < n.blkIndent || (r = o + 1, r >= t) || (n.isEmpty(r) && r++, r >= t) || n.tShift[r] < n.blkIndent || (s = ui(n, r), s < 0)) break;
2154
+ if (d >= t || (o = d, n.isEmpty(o)) || n.tShift[o] < n.blkIndent || (r = o + 1, r >= t) || (n.isEmpty(r) && r++, r >= t) || n.tShift[r] < n.blkIndent || (s = fi(n, r), s < 0)) break;
2155
2155
  }
2156
2156
  return n.tokens.push({
2157
2157
  type: "dl_close",
@@ -2192,11 +2192,11 @@ function Br(n, e) {
2192
2192
  level: n.level
2193
2193
  })), !0;
2194
2194
  }
2195
- var fi = [["code", Sr], ["fences", _r, ["paragraph", "blockquote", "list"]], ["blockquote", xr, ["paragraph", "blockquote", "list"]], ["hr", wr, ["paragraph", "blockquote", "list"]], ["list", Tr, ["paragraph", "blockquote"]], ["footnote", Cr, ["paragraph"]], ["heading", Rr, ["paragraph", "blockquote"]], ["lheading", Mr], ["htmlblock", Or, ["paragraph", "blockquote"]], ["table", Pr, ["paragraph"]], ["deflist", Dr, ["paragraph"]], ["paragraph", Br]];
2195
+ var pi = [["code", Sr], ["fences", _r, ["paragraph", "blockquote", "list"]], ["blockquote", xr, ["paragraph", "blockquote", "list"]], ["hr", wr, ["paragraph", "blockquote", "list"]], ["list", Tr, ["paragraph", "blockquote"]], ["footnote", Cr, ["paragraph"]], ["heading", Rr, ["paragraph", "blockquote"]], ["lheading", Mr], ["htmlblock", Or, ["paragraph", "blockquote"]], ["table", Pr, ["paragraph"]], ["deflist", Dr, ["paragraph"]], ["paragraph", Br]];
2196
2196
  function Ss() {
2197
2197
  this.ruler = new oe();
2198
- for (var n = 0; n < fi.length; n++) this.ruler.push(fi[n][0], fi[n][1], {
2199
- alt: (fi[n][2] || []).slice()
2198
+ for (var n = 0; n < pi.length; n++) this.ruler.push(pi[n][0], pi[n][1], {
2199
+ alt: (pi[n][2] || []).slice()
2200
2200
  });
2201
2201
  }
2202
2202
  Ss.prototype.tokenize = function (n, e, t) {
@@ -2221,7 +2221,7 @@ Ss.prototype.parse = function (n, e, t, i) {
2221
2221
  return n.charCodeAt(l) === 10 ? (r = l + 1, o = 0, a) : (c = " ".slice((l - r - o) % 4), o = l - r + 1, c);
2222
2222
  })), s = new lt(n, this, e, t, i), this.tokenize(s, s.line, s.lineMax);
2223
2223
  };
2224
- function qr(n) {
2224
+ function Hr(n) {
2225
2225
  switch (n) {
2226
2226
  case 10:
2227
2227
  case 92:
@@ -2249,8 +2249,8 @@ function qr(n) {
2249
2249
  return !1;
2250
2250
  }
2251
2251
  }
2252
- function Hr(n, e) {
2253
- for (var t = n.pos; t < n.posMax && !qr(n.src.charCodeAt(t));) t++;
2252
+ function qr(n, e) {
2253
+ for (var t = n.pos; t < n.posMax && !Hr(n.src.charCodeAt(t));) t++;
2254
2254
  return t === n.pos ? !1 : (e || (n.pending += n.src.slice(n.pos, t)), n.pos = t, !0);
2255
2255
  }
2256
2256
  function zr(n, e) {
@@ -2348,7 +2348,7 @@ function Kr(n, e) {
2348
2348
  level: --n.level
2349
2349
  })), n.pos = n.posMax + 2, n.posMax = r, !0) : (n.pos = o, !1);
2350
2350
  }
2351
- function $r(n, e) {
2351
+ function Wr(n, e) {
2352
2352
  var t,
2353
2353
  i,
2354
2354
  s,
@@ -2374,7 +2374,7 @@ function $r(n, e) {
2374
2374
  level: --n.level
2375
2375
  })), n.pos = n.posMax + 2, n.posMax = r, !0) : (n.pos = o, !1);
2376
2376
  }
2377
- function Wr(n, e) {
2377
+ function $r(n, e) {
2378
2378
  var t,
2379
2379
  i,
2380
2380
  s,
@@ -2625,7 +2625,7 @@ function oo(n, e) {
2625
2625
  level: n.level
2626
2626
  })), n.pos += s[0].length, !0) : !1) : !1));
2627
2627
  }
2628
- function qi(n, e) {
2628
+ function Hi(n, e) {
2629
2629
  return n = n.source, e = e || "", function t(i, s) {
2630
2630
  return i ? (s = s.source || s, n = n.replace(i, s), t) : new RegExp(n, e);
2631
2631
  };
@@ -2634,15 +2634,15 @@ var ao = /[a-zA-Z_:][a-zA-Z0-9:._-]*/,
2634
2634
  lo = /[^"'=<>`\x00-\x20]+/,
2635
2635
  co = /'[^']*'/,
2636
2636
  ho = /"[^"]*"/,
2637
- uo = qi(/(?:unquoted|single_quoted|double_quoted)/)("unquoted", lo)("single_quoted", co)("double_quoted", ho)(),
2638
- fo = qi(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name", ao)("attr_value", uo)(),
2639
- po = qi(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute", fo)(),
2637
+ uo = Hi(/(?:unquoted|single_quoted|double_quoted)/)("unquoted", lo)("single_quoted", co)("double_quoted", ho)(),
2638
+ fo = Hi(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name", ao)("attr_value", uo)(),
2639
+ po = Hi(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute", fo)(),
2640
2640
  mo = /<\/[A-Za-z][A-Za-z0-9]*\s*>/,
2641
2641
  go = /<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,
2642
2642
  bo = /<[?].*?[?]>/,
2643
2643
  vo = /<![A-Z]+\s+[^>]*>/,
2644
2644
  yo = /<!\[CDATA\[[\s\S]*?\]\]>/,
2645
- Eo = qi(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag", po)("close_tag", mo)("comment", go)("processing", bo)("declaration", vo)("cdata", yo)();
2645
+ Eo = Hi(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag", po)("close_tag", mo)("comment", go)("processing", bo)("declaration", vo)("cdata", yo)();
2646
2646
  function So(n) {
2647
2647
  var e = n | 32;
2648
2648
  return e >= 97 && e <= 122;
@@ -2677,13 +2677,13 @@ function Ao(n, e) {
2677
2677
  }
2678
2678
  return e || (n.pending += "&"), n.pos++, !0;
2679
2679
  }
2680
- var Zi = [["text", Hr], ["newline", zr], ["escape", Gr], ["backticks", Vr], ["del", Kr], ["ins", $r], ["mark", Wr], ["emphasis", Jr], ["sub", Yr], ["sup", Qr], ["links", eo], ["footnote_inline", to], ["footnote_ref", io], ["autolink", oo], ["htmltag", _o], ["entity", Ao]];
2681
- function Hi() {
2680
+ var Zi = [["text", qr], ["newline", zr], ["escape", Gr], ["backticks", Vr], ["del", Kr], ["ins", Wr], ["mark", $r], ["emphasis", Jr], ["sub", Yr], ["sup", Qr], ["links", eo], ["footnote_inline", to], ["footnote_ref", io], ["autolink", oo], ["htmltag", _o], ["entity", Ao]];
2681
+ function qi() {
2682
2682
  this.ruler = new oe();
2683
2683
  for (var n = 0; n < Zi.length; n++) this.ruler.push(Zi[n][0], Zi[n][1]);
2684
2684
  this.validateLink = To;
2685
2685
  }
2686
- Hi.prototype.skipToken = function (n) {
2686
+ qi.prototype.skipToken = function (n) {
2687
2687
  var e = this.ruler.getRules(""),
2688
2688
  t = e.length,
2689
2689
  i = n.pos,
@@ -2699,7 +2699,7 @@ Hi.prototype.skipToken = function (n) {
2699
2699
  }
2700
2700
  n.pos++, n.cacheSet(i, n.pos);
2701
2701
  };
2702
- Hi.prototype.tokenize = function (n) {
2702
+ qi.prototype.tokenize = function (n) {
2703
2703
  for (var e = this.ruler.getRules(""), t = e.length, i = n.posMax, s, r; n.pos < i;) {
2704
2704
  for (r = 0; r < t && (s = e[r](n, !1), !s); r++);
2705
2705
  if (s) {
@@ -2710,7 +2710,7 @@ Hi.prototype.tokenize = function (n) {
2710
2710
  }
2711
2711
  n.pending && n.pushPending();
2712
2712
  };
2713
- Hi.prototype.parse = function (n, e, t, i) {
2713
+ qi.prototype.parse = function (n, e, t, i) {
2714
2714
  var s = new at(n, this, e, t, i);
2715
2715
  this.tokenize(s);
2716
2716
  };
@@ -2836,47 +2836,47 @@ var Co = {
2836
2836
  function Ln(n, e, t) {
2837
2837
  this.src = e, this.env = t, this.options = n.options, this.tokens = [], this.inlineMode = !1, this.inline = n.inline, this.block = n.block, this.renderer = n.renderer, this.typographer = n.typographer;
2838
2838
  }
2839
- function xe(n, e) {
2840
- typeof n != "string" && (e = n, n = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new Hi(), this.block = new Ss(), this.core = new Mn(), this.renderer = new Es(), this.ruler = new oe(), this.options = {}, this.configure(ko[n]), this.set(e || {});
2839
+ function we(n, e) {
2840
+ typeof n != "string" && (e = n, n = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new qi(), this.block = new Ss(), this.core = new Mn(), this.renderer = new Es(), this.ruler = new oe(), this.options = {}, this.configure(ko[n]), this.set(e || {});
2841
2841
  }
2842
- xe.prototype.set = function (n) {
2842
+ we.prototype.set = function (n) {
2843
2843
  xn(this.options, n);
2844
2844
  };
2845
- xe.prototype.configure = function (n) {
2845
+ we.prototype.configure = function (n) {
2846
2846
  var e = this;
2847
2847
  if (!n) throw new Error("Wrong `remarkable` preset, check name/content");
2848
2848
  n.options && e.set(n.options), n.components && Object.keys(n.components).forEach(function (t) {
2849
2849
  n.components[t].rules && e[t].ruler.enable(n.components[t].rules, !0);
2850
2850
  });
2851
2851
  };
2852
- xe.prototype.use = function (n, e) {
2852
+ we.prototype.use = function (n, e) {
2853
2853
  return n(this, e), this;
2854
2854
  };
2855
- xe.prototype.parse = function (n, e) {
2855
+ we.prototype.parse = function (n, e) {
2856
2856
  var t = new Ln(this, n, e);
2857
2857
  return this.core.process(t), t.tokens;
2858
2858
  };
2859
- xe.prototype.render = function (n, e) {
2859
+ we.prototype.render = function (n, e) {
2860
2860
  return e = e || {}, this.renderer.render(this.parse(n, e), this.options, e);
2861
2861
  };
2862
- xe.prototype.parseInline = function (n, e) {
2862
+ we.prototype.parseInline = function (n, e) {
2863
2863
  var t = new Ln(this, n, e);
2864
2864
  return t.inlineMode = !0, this.core.process(t), t.tokens;
2865
2865
  };
2866
- xe.prototype.renderInline = function (n, e) {
2866
+ we.prototype.renderInline = function (n, e) {
2867
2867
  return e = e || {}, this.renderer.render(this.parseInline(n, e), this.options, e);
2868
2868
  };
2869
- var ft = /*#__PURE__*/function () {
2870
- function ft() {
2871
- _classCallCheck(this, ft);
2869
+ var pt = /*#__PURE__*/function () {
2870
+ function pt() {
2871
+ _classCallCheck(this, pt);
2872
2872
  }
2873
- return _createClass(ft, null, [{
2873
+ return _createClass(pt, null, [{
2874
2874
  key: "instantiate",
2875
2875
  value: function instantiate(e) {
2876
- if (e) return new xe(_objectSpread(_objectSpread({}, ft.DEFAULT_PROPERTIES), e));
2876
+ if (e) return new we(_objectSpread(_objectSpread({}, pt.DEFAULT_PROPERTIES), e));
2877
2877
  if (window.hljs) {
2878
2878
  var t = window.hljs;
2879
- return new xe({
2879
+ return new we({
2880
2880
  highlight: function highlight(i, s) {
2881
2881
  if (s && t.getLanguage(s)) try {
2882
2882
  return t.highlight(i, {
@@ -2905,29 +2905,29 @@ var ft = /*#__PURE__*/function () {
2905
2905
  typographer: !0
2906
2906
  // Enable smartypants and other sweet transforms
2907
2907
  });
2908
- } else return new xe(ft.DEFAULT_PROPERTIES);
2908
+ } else return new we(pt.DEFAULT_PROPERTIES);
2909
2909
  }
2910
2910
  }, {
2911
2911
  key: "createNew",
2912
2912
  value: function createNew(e) {
2913
- var t = ft.instantiate(e);
2913
+ var t = pt.instantiate(e);
2914
2914
  return t.inline.validateLink = function () {
2915
2915
  return !0;
2916
2916
  }, t;
2917
2917
  }
2918
2918
  }]);
2919
2919
  }();
2920
- ft.DEFAULT_PROPERTIES = {
2920
+ pt.DEFAULT_PROPERTIES = {
2921
2921
  breaks: !0,
2922
2922
  linkTarget: "_blank"
2923
2923
  // set target to open in a new tab
2924
2924
  };
2925
- var ti = ft;
2926
- var J = /*#__PURE__*/function () {
2927
- function J() {
2928
- _classCallCheck(this, J);
2925
+ var ti = pt;
2926
+ var X = /*#__PURE__*/function () {
2927
+ function X() {
2928
+ _classCallCheck(this, X);
2929
2929
  }
2930
- return _createClass(J, null, [{
2930
+ return _createClass(X, null, [{
2931
2931
  key: "applyCustomStylesToElements",
2932
2932
  value: function applyCustomStylesToElements(e, t, i) {
2933
2933
  if (i && (Object.assign(e.outerContainer.style, i.outerContainer), Object.assign(e.innerContainer.style, i.innerContainer), Object.assign(e.bubbleElement.style, i.bubble), t)) {
@@ -2939,7 +2939,7 @@ var J = /*#__PURE__*/function () {
2939
2939
  }, {
2940
2940
  key: "applySideStyles",
2941
2941
  value: function applySideStyles(e, t, i, s) {
2942
- s && (J.applyCustomStylesToElements(e, i, s.shared), t === y.USER_ROLE ? J.applyCustomStylesToElements(e, i, s.user) : (J.applyCustomStylesToElements(e, i, s.ai), J.applyCustomStylesToElements(e, i, s[t])));
2942
+ s && (X.applyCustomStylesToElements(e, i, s.shared), t === y.USER_ROLE ? X.applyCustomStylesToElements(e, i, s.user) : (X.applyCustomStylesToElements(e, i, s.ai), X.applyCustomStylesToElements(e, i, s[t])));
2943
2943
  }
2944
2944
  }, {
2945
2945
  key: "isElementsStyles",
@@ -2951,7 +2951,7 @@ var J = /*#__PURE__*/function () {
2951
2951
  key: "applyCustomStyles",
2952
2952
  value: function applyCustomStyles(e, t, i, s, r) {
2953
2953
  var o;
2954
- r && e["default"] !== r ? J.isElementsStyles(r) ? (J.applyCustomStylesToElements(t, s, (o = e["default"]) == null ? void 0 : o.shared), J.applyCustomStylesToElements(t, s, r)) : (J.applySideStyles(t, i, s, e["default"]), J.applySideStyles(t, i, s, r)) : J.applySideStyles(t, i, s, e["default"]);
2954
+ r && e["default"] !== r ? X.isElementsStyles(r) ? (X.applyCustomStylesToElements(t, s, (o = e["default"]) == null ? void 0 : o.shared), X.applyCustomStylesToElements(t, s, r)) : (X.applySideStyles(t, i, s, e["default"]), X.applySideStyles(t, i, s, r)) : X.applySideStyles(t, i, s, e["default"]);
2955
2955
  }
2956
2956
  // prettier-ignore
2957
2957
  }, {
@@ -2972,11 +2972,11 @@ var J = /*#__PURE__*/function () {
2972
2972
  }
2973
2973
  }]);
2974
2974
  }();
2975
- var yi = /*#__PURE__*/function () {
2976
- function yi() {
2977
- _classCallCheck(this, yi);
2975
+ var ii = /*#__PURE__*/function () {
2976
+ function ii() {
2977
+ _classCallCheck(this, ii);
2978
2978
  }
2979
- return _createClass(yi, null, [{
2979
+ return _createClass(ii, null, [{
2980
2980
  key: "onMessage",
2981
2981
  value: function onMessage(e, t, i) {
2982
2982
  var r;
@@ -2985,7 +2985,7 @@ var yi = /*#__PURE__*/function () {
2985
2985
  isHistory: i,
2986
2986
  isInitial: i
2987
2987
  }));
2988
- H.reAddFileRefToObject(t, s), (r = e.onMessage) == null || r.call(e, s), e.dispatchEvent(new CustomEvent("message", {
2988
+ q.reAddFileRefToObject(t, s), (r = e.onMessage) == null || r.call(e, s), e.dispatchEvent(new CustomEvent("message", {
2989
2989
  detail: s
2990
2990
  })), te.fireOnNewMessage(e, s);
2991
2991
  }
@@ -3003,6 +3003,17 @@ var yi = /*#__PURE__*/function () {
3003
3003
  detail: e
3004
3004
  }));
3005
3005
  }
3006
+ }, {
3007
+ key: "onInput",
3008
+ value: function onInput(e, t, i) {
3009
+ var s;
3010
+ (s = e.onInput) == null || s.call(e, t, i), e.dispatchEvent(new CustomEvent("input", {
3011
+ detail: {
3012
+ content: t,
3013
+ isUser: i
3014
+ }
3015
+ }));
3016
+ }
3006
3017
  }, {
3007
3018
  key: "onError",
3008
3019
  value: function onError(e, t) {
@@ -3053,7 +3064,7 @@ var F = /*#__PURE__*/function () {
3053
3064
  var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
3054
3065
  var r, o, a, l;
3055
3066
  var i = (l = (a = (o = (r = e.messageStyles) == null ? void 0 : r.loading) == null ? void 0 : o.history) == null ? void 0 : a.full) == null ? void 0 : l.html,
3056
- s = i ? _e.createElements(e, i, y.AI_ROLE, !0, !0) : F.createDefaultElements(e);
3067
+ s = i ? xe.createElements(e, i, y.AI_ROLE, !0, !0) : F.createDefaultElements(e);
3057
3068
  return F.addLoadHistoryMessage(s, e, t), y.softRemRoleElements(s.innerContainer, e.avatar, e.name), s;
3058
3069
  }
3059
3070
  }, {
@@ -3079,14 +3090,14 @@ var F = /*#__PURE__*/function () {
3079
3090
  }();
3080
3091
  F.CLASS = "loading-history-message", F.FULL_VIEW_CLASS = "loading-history-message-full-view", F.SMALL_CLASS = "loading-history-message-small";
3081
3092
  var Fe = F;
3082
- var Wt = /*#__PURE__*/function () {
3083
- function Wt() {
3084
- _classCallCheck(this, Wt);
3093
+ var $t = /*#__PURE__*/function () {
3094
+ function $t() {
3095
+ _classCallCheck(this, $t);
3085
3096
  }
3086
- return _createClass(Wt, null, [{
3097
+ return _createClass($t, null, [{
3087
3098
  key: "setFade",
3088
3099
  value: function setFade(e, t) {
3089
- e.style.transitionDuration = typeof t == "number" ? "".concat(t, "ms") : "".concat(Wt.DEFAULT_FADE_MS, "ms");
3100
+ e.style.transitionDuration = typeof t == "number" ? "".concat(t, "ms") : "".concat($t.DEFAULT_FADE_MS, "ms");
3090
3101
  }
3091
3102
  }, {
3092
3103
  key: "fadeAnimation",
@@ -3097,7 +3108,7 @@ var Wt = /*#__PURE__*/function () {
3097
3108
  while (1) switch (_context.prev = _context.next) {
3098
3109
  case 0:
3099
3110
  e.style.opacity = "0";
3100
- i = typeof t == "number" ? t : Wt.DEFAULT_FADE_MS;
3111
+ i = typeof t == "number" ? t : $t.DEFAULT_FADE_MS;
3101
3112
  _context.next = 4;
3102
3113
  return new Promise(function (s) {
3103
3114
  setTimeout(function () {
@@ -3119,9 +3130,9 @@ var Wt = /*#__PURE__*/function () {
3119
3130
  }()
3120
3131
  }]);
3121
3132
  }();
3122
- Wt.DEFAULT_FADE_MS = 500;
3123
- var Ei = Wt;
3124
- var $s = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3csvg%20fill='%23000000'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2032%2032'%20xml:space='preserve'%3e%3cpath%20d='M23,30.36H9c-2.404,0-4.36-1.956-4.36-4.36V15c0-2.404,1.956-4.36,4.36-4.36h3.659%20c0.167-1.566,1.415-2.813,2.981-2.981V5.333c-1.131-0.174-2-1.154-2-2.333c0-1.301,1.059-2.36,2.36-2.36%20c1.302,0,2.36,1.059,2.36,2.36c0,1.179-0.869,2.159-2,2.333V7.66c1.566,0.167,2.814,1.415,2.981,2.981H23%20c2.404,0,4.36,1.956,4.36,4.36v11C27.36,28.404,25.404,30.36,23,30.36z%20M9,11.36c-2.007,0-3.64,1.633-3.64,3.64v11%20c0,2.007,1.633,3.64,3.64,3.64h14c2.007,0,3.64-1.633,3.64-3.64V15c0-2.007-1.633-3.64-3.64-3.64H9z%20M13.384,10.64h5.231%20C18.439,9.354,17.334,8.36,16,8.36C14.667,8.36,13.561,9.354,13.384,10.64z%20M16,1.36c-0.904,0-1.64,0.736-1.64,1.64%20S15.096,4.64,16,4.64c0.904,0,1.64-0.736,1.64-1.64S16.904,1.36,16,1.36z%20M20,27.36h-8c-1.301,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36h8c1.302,0,2.36,1.059,2.36,2.36S21.302,27.36,20,27.36z%20M12,23.36c-0.904,0-1.64,0.735-1.64,1.64%20s0.736,1.64,1.64,1.64h8c0.904,0,1.64-0.735,1.64-1.64s-0.735-1.64-1.64-1.64H12z%20M31,23.86h-2c-0.199,0-0.36-0.161-0.36-0.36V15%20c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5C31.36,23.699,31.199,23.86,31,23.86z%20M29.36,23.14h1.279v-7.78%20H29.36V23.14z%20M3,23.86H1c-0.199,0-0.36-0.161-0.36-0.36V15c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5%20C3.36,23.699,3.199,23.86,3,23.86z%20M1.36,23.14h1.28v-7.78H1.36V23.14z%20M20,20.36c-1.302,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36s2.36,1.059,2.36,2.36C22.36,19.302,21.302,20.36,20,20.36z%20M20,16.36c-0.904,0-1.64,0.736-1.64,1.64%20s0.735,1.64,1.64,1.64s1.64-0.735,1.64-1.64S20.904,16.36,20,16.36z%20M12,20.36c-1.301,0-2.36-1.059-2.36-2.36s1.059-2.36,2.36-2.36%20s2.36,1.059,2.36,2.36C14.36,19.302,13.301,20.36,12,20.36z%20M12,16.36c-0.904,0-1.64,0.736-1.64,1.64s0.736,1.64,1.64,1.64%20s1.64-0.735,1.64-1.64S12.904,16.36,12,16.36z'/%3e%3crect%20style='fill:none;'%20width='32'%20height='32'/%3e%3c/svg%3e",
3133
+ $t.DEFAULT_FADE_MS = 500;
3134
+ var Ei = $t;
3135
+ var Ws = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3csvg%20fill='%23000000'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2032%2032'%20xml:space='preserve'%3e%3cpath%20d='M23,30.36H9c-2.404,0-4.36-1.956-4.36-4.36V15c0-2.404,1.956-4.36,4.36-4.36h3.659%20c0.167-1.566,1.415-2.813,2.981-2.981V5.333c-1.131-0.174-2-1.154-2-2.333c0-1.301,1.059-2.36,2.36-2.36%20c1.302,0,2.36,1.059,2.36,2.36c0,1.179-0.869,2.159-2,2.333V7.66c1.566,0.167,2.814,1.415,2.981,2.981H23%20c2.404,0,4.36,1.956,4.36,4.36v11C27.36,28.404,25.404,30.36,23,30.36z%20M9,11.36c-2.007,0-3.64,1.633-3.64,3.64v11%20c0,2.007,1.633,3.64,3.64,3.64h14c2.007,0,3.64-1.633,3.64-3.64V15c0-2.007-1.633-3.64-3.64-3.64H9z%20M13.384,10.64h5.231%20C18.439,9.354,17.334,8.36,16,8.36C14.667,8.36,13.561,9.354,13.384,10.64z%20M16,1.36c-0.904,0-1.64,0.736-1.64,1.64%20S15.096,4.64,16,4.64c0.904,0,1.64-0.736,1.64-1.64S16.904,1.36,16,1.36z%20M20,27.36h-8c-1.301,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36h8c1.302,0,2.36,1.059,2.36,2.36S21.302,27.36,20,27.36z%20M12,23.36c-0.904,0-1.64,0.735-1.64,1.64%20s0.736,1.64,1.64,1.64h8c0.904,0,1.64-0.735,1.64-1.64s-0.735-1.64-1.64-1.64H12z%20M31,23.86h-2c-0.199,0-0.36-0.161-0.36-0.36V15%20c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5C31.36,23.699,31.199,23.86,31,23.86z%20M29.36,23.14h1.279v-7.78%20H29.36V23.14z%20M3,23.86H1c-0.199,0-0.36-0.161-0.36-0.36V15c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5%20C3.36,23.699,3.199,23.86,3,23.86z%20M1.36,23.14h1.28v-7.78H1.36V23.14z%20M20,20.36c-1.302,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36s2.36,1.059,2.36,2.36C22.36,19.302,21.302,20.36,20,20.36z%20M20,16.36c-0.904,0-1.64,0.736-1.64,1.64%20s0.735,1.64,1.64,1.64s1.64-0.735,1.64-1.64S20.904,16.36,20,16.36z%20M12,20.36c-1.301,0-2.36-1.059-2.36-2.36s1.059-2.36,2.36-2.36%20s2.36,1.059,2.36,2.36C14.36,19.302,13.301,20.36,12,20.36z%20M12,16.36c-0.904,0-1.64,0.736-1.64,1.64s0.736,1.64,1.64,1.64%20s1.64-0.735,1.64-1.64S12.904,16.36,12,16.36z'/%3e%3crect%20style='fill:none;'%20width='32'%20height='32'/%3e%3c/svg%3e",
3125
3136
  ss = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAMAAAC/MqoPAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAADNQTFRF////9vX18vLy/Pz86enp4+Li2tnZ1tbWzczM+fn57Ozs4N/f09LS0M/P5uXl7+/v3dzcwtncCAAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAZNSURBVHja7d3bdtsqEABQYABZSLH9/3+ZpnUsIcF5iOM6PfElNoMHMfPQdq3GmL0GkLhEUqLaUExnOtOZznSmM53pTGc605nOdKYznelMZzrTmV4LXSqllKyJDkob26xWq8Zae/iH0QoWTm9d1xur4WuypQJtTd+5dqn0VjcxzNO5/57mEBvdLo8Oron6aseWOjYOFkVvjQs3DmgyONMuht52EfztP+4hdu0i6LCO808/M8c1lE/fuPGej41uUzgdtoO/75N+2ELJ9I3b3//hPXbiMenm3pR/Jt4USgcLBIp4Bh10gqKVhvLo0klCxeSky96nKcj3siw6pJIL4XsoiQ7apyvMY/V3HHrSRioLopvEhSpTCn2TPEuwKYMOIX0tAxRBf/Hpa+lfSqBv9gi1FPsNfTrMAiVmIE/vJhz61FGnQxRIEYE4vfNYdN8Rp6MlHaHotHTn8ejekaZPAjEmyvQWdZFTtYTpXqCGJ0zvcek9Yfoel76nS0ffv1NMp1ca+pkgyfRCGind4L7OWWc605l+cxjsyhqy9AGbPpClc1/nvl5VX0c/3Alk6RU3+Am7shNZ+h6bvidLr7jBB+zKBrL0irOOudmIUDzTmf5gIP+iEuXtRuTVaEmY/oZLfyNMrzjryPc0gerMTdpVg0tvjJUU6bLPcGOoUv46SLL6Wi8yhLf06C7TUyekI0efRaaYqdFltkeNpPumRPSMDxgBYvSM035FrKAmH72hRW99PrpvSdEHkTEGUvSsK3yKVDkuJ92RohcZaehzzirPpOg+J92Tolfc4Cumx5xVXpGiZ34+ICX6W84qv5GiR5NPbiIpOv6BCoSvSkTX+eiaGP092zINvBOj4x8mSf9FqejvNo/cvpOji19ZbmviL0GPLsYMFzgzCor0+Bv/ePDvSJKOb9dJ5UlnbnEHiHgzv6cdTpJOWuc/u3FEucLDOL75xGtBiefrcwgoC9NDSH/jkH6pAuXmBqPQ9HSUPVdZBH1GGOrMXAQdYxcKZfxAoK+KKBKFLosoEoX+u4giUehz8jlcnAuhp78I46yDYNAd+QLR6K+pr+yvxdBTHyVDubQh0UfSxaHSd0lbvNkVRE87JGOtc+PQd2QLQ6fHhJkKsSh6yg13tO08JPprsgrrXWH0dJd2vH1MLPprot4eXoujpzrdhngiD40ek2y92lggPcnWa8qN1Yz0BFuvZhRl0uOfR0v4Ewuli/Bg4Qr3lArqGdndQ3UPO1EunXYwnelMZzrTmc50pjOd6UxnOtOZznSmM53pTGf6kuj6oedFKV0s3fX6sX1S3bsi6a4PD7+/YAqYeBw6pIB/4qEgOqxdSPbGiim4NRRCbzs3Jj0L4UfXtQXQVRfn5IdA/Bw7RZzurEV6EtdsLeGXkIPuA+K1UoVeA0l62zmN/LqfSSft9KkepmoRuvi3nd5uKNFB9zbbXEANqdr941XO0NJx2v2jdJenpf+/3bvn0ts16ph+sd6hX7dPo2+2cZzE02Ia43bzDHqr+2Evnhz74ZHU30ffbKOeng1/NPV30Ns1gYQnSP2P6e65Pfxc6h02XZqXQCjhJ6kPL6bFo4NrGvAU4UII4SE2P1vQuZkuOxckVfehisF1MjUddN/MZBN+kvq5uf0O/xa66gyNS9ktMWlz44rO1Z8C19i5FPdHzPamXn+F3hryPfxMr78+4F+kq22kO6Rf6fUQt+puuustyWv4rbG3l/duztFB96GYoe1cTBdXMr+nw9qVM6ZfxOvzezff0nXi/ZOndvrR6Zvpm0c3h6nhdb+5iS7tsIim/qXZD9+97/Jf+rpZ5BET1ayv0GUzLhEuhBBjIy/RdVPgndutIRt9nt7p5cKFEEJ3Z+jQFDZL+XnMDXxHB73gxn5s9Kc3d3/pFciFkN/QTSXHJpX5l66gDrkQoP6hL3xsPw39la4qOiV8tH78XeSbue6N9mvWa6J/ybpc1CT1Wnh5Qq9meP8IOKH3ddH7E/ri1iYux/SXDrXR4UiPdck/wUpU+FtPf6/orja6O9KL3l56LOvVxe5Ib2qjN0d6Vbex4ghWlU3bPqI90If66MNng680FNpbJijH6kCvaF3uMzQ3+IrpFerV4Y9dffQdN3im10ivbuImhD3Qq5u4HdZkua8znelMZ/pS4z9CPVKkxowNxgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0wMy0yN1QxNTo0NToxNSswMDowMN1xSg4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDMtMjdUMTU6NDU6MTUrMDA6MDCsLPKyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==";
3126
3137
  var In = /*#__PURE__*/function () {
3127
3138
  function In(e) {
@@ -3146,15 +3157,15 @@ var In = /*#__PURE__*/function () {
3146
3157
  }
3147
3158
  }]);
3148
3159
  }();
3149
- var Re = /*#__PURE__*/function (_In) {
3150
- function Re(e) {
3160
+ var Me = /*#__PURE__*/function (_In) {
3161
+ function Me(e) {
3151
3162
  var _this3;
3152
- _classCallCheck(this, Re);
3153
- _this3 = _callSuper(this, Re, ["avatar-container"]), _this3._avatars = e;
3163
+ _classCallCheck(this, Me);
3164
+ _this3 = _callSuper(this, Me, ["avatar-container"]), _this3._avatars = e;
3154
3165
  return _this3;
3155
3166
  }
3156
- _inherits(Re, _In);
3157
- return _createClass(Re, [{
3167
+ _inherits(Me, _In);
3168
+ return _createClass(Me, [{
3158
3169
  key: "addBesideMsg",
3159
3170
  value: function addBesideMsg(e, t) {
3160
3171
  var i = typeof this._avatars == "boolean" ? void 0 : this._avatars,
@@ -3167,9 +3178,9 @@ var Re = /*#__PURE__*/function (_In) {
3167
3178
  value: function createAvatar(e, t) {
3168
3179
  var r, o, a, l, c;
3169
3180
  var i = document.createElement("img");
3170
- e === y.USER_ROLE ? (i.src = ((r = t == null ? void 0 : t.user) == null ? void 0 : r.src) || ((o = t == null ? void 0 : t["default"]) == null ? void 0 : o.src) || ss, i.onerror = Re.errorFallback.bind(this, ss)) : (i.src = ((a = t == null ? void 0 : t[e]) == null ? void 0 : a.src) || ((l = t == null ? void 0 : t.ai) == null ? void 0 : l.src) || ((c = t == null ? void 0 : t["default"]) == null ? void 0 : c.src) || $s, i.onerror = Re.errorFallback.bind(this, $s)), i.classList.add("avatar"), i.alt = "".concat(e, " avatar");
3181
+ e === y.USER_ROLE ? (i.src = ((r = t == null ? void 0 : t.user) == null ? void 0 : r.src) || ((o = t == null ? void 0 : t["default"]) == null ? void 0 : o.src) || ss, i.onerror = Me.errorFallback.bind(this, ss)) : (i.src = ((a = t == null ? void 0 : t[e]) == null ? void 0 : a.src) || ((l = t == null ? void 0 : t.ai) == null ? void 0 : l.src) || ((c = t == null ? void 0 : t["default"]) == null ? void 0 : c.src) || Ws, i.onerror = Me.errorFallback.bind(this, Ws)), i.classList.add("avatar"), i.alt = "".concat(e, " avatar");
3171
3182
  var s = document.createElement("div");
3172
- return s.classList.add(this.className), s.appendChild(i), t && Re.applyCustomStyles(s, i, t, e), s;
3183
+ return s.classList.add(this.className), s.appendChild(i), t && Me.applyCustomStyles(s, i, t, e), s;
3173
3184
  }
3174
3185
  }, {
3175
3186
  key: "getPosition",
@@ -3193,35 +3204,35 @@ var Re = /*#__PURE__*/function (_In) {
3193
3204
  key: "applyCustomStyles",
3194
3205
  value: function applyCustomStyles(e, t, i, s) {
3195
3206
  var r, o, a, l;
3196
- if ((r = i["default"]) != null && r.styles && Re.applyCustomStylesToElements(e, t, i["default"].styles), s === y.USER_ROLE) (o = i.user) != null && o.styles && Re.applyCustomStylesToElements(e, t, i.user.styles);else {
3197
- (a = i.ai) != null && a.styles && Re.applyCustomStylesToElements(e, t, i.ai.styles);
3207
+ if ((r = i["default"]) != null && r.styles && Me.applyCustomStylesToElements(e, t, i["default"].styles), s === y.USER_ROLE) (o = i.user) != null && o.styles && Me.applyCustomStylesToElements(e, t, i.user.styles);else {
3208
+ (a = i.ai) != null && a.styles && Me.applyCustomStylesToElements(e, t, i.ai.styles);
3198
3209
  var c = (l = i[s]) == null ? void 0 : l.styles;
3199
- c && Re.applyCustomStylesToElements(e, t, c);
3210
+ c && Me.applyCustomStylesToElements(e, t, c);
3200
3211
  }
3201
3212
  }
3202
3213
  }]);
3203
3214
  }(In);
3204
- var zt = /*#__PURE__*/function (_In2) {
3205
- function zt(e) {
3215
+ var Gt = /*#__PURE__*/function (_In2) {
3216
+ function Gt(e) {
3206
3217
  var _this4;
3207
- _classCallCheck(this, zt);
3208
- _this4 = _callSuper(this, zt, ["name"]), _this4._names = e;
3218
+ _classCallCheck(this, Gt);
3219
+ _this4 = _callSuper(this, Gt, ["name"]), _this4._names = e;
3209
3220
  return _this4;
3210
3221
  }
3211
- _inherits(zt, _In2);
3212
- return _createClass(zt, [{
3222
+ _inherits(Gt, _In2);
3223
+ return _createClass(Gt, [{
3213
3224
  key: "addBesideMsg",
3214
3225
  value: function addBesideMsg(e, t) {
3215
3226
  var i = typeof this._names == "boolean" ? {} : this._names,
3216
3227
  s = this.createName(t, i),
3217
- r = zt.getPosition(t, i);
3228
+ r = Gt.getPosition(t, i);
3218
3229
  s.classList.add(r === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(r === "left" ? "beforebegin" : "afterend", s);
3219
3230
  }
3220
3231
  }, {
3221
3232
  key: "createName",
3222
3233
  value: function createName(e, t) {
3223
3234
  var i = document.createElement("div");
3224
- return i.classList.add(this.className), i.textContent = zt.getNameText(e, t), zt.applyStyle(i, e, t), i;
3235
+ return i.classList.add(this.className), i.textContent = Gt.getNameText(e, t), Gt.applyStyle(i, e, t), i;
3225
3236
  }
3226
3237
  }], [{
3227
3238
  key: "getPosition",
@@ -3249,7 +3260,7 @@ var Z = /*#__PURE__*/function () {
3249
3260
  var _this5 = this;
3250
3261
  _classCallCheck(this, Z);
3251
3262
  var t;
3252
- this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = Z.createContainerElement(), this.messageStyles = te.processMessageStyles(e.messageStyles), this._remarkable = ti.createNew(e.remarkable), e.avatars && (this.avatar = new Re(e.avatars)), e.names && (this.name = new zt(e.names)), this._onMessage = yi.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), this.focusMode = e.focusMode, this.focusMode || (this._lastGroupMessagesElement = document.createElement("div")), typeof this.focusMode != "boolean" && (t = this.focusMode) != null && t.fade && Ei.setFade(this.elementRef, this.focusMode.fade), setTimeout(function () {
3263
+ this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = Z.createContainerElement(), this.messageStyles = te.processMessageStyles(e.messageStyles), this._remarkable = ti.createNew(e.remarkable), e.avatars && (this.avatar = new Me(e.avatars)), e.names && (this.name = new Gt(e.names)), this._onMessage = ii.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), this.focusMode = e.focusMode, this.focusMode || (this._lastGroupMessagesElement = document.createElement("div")), typeof this.focusMode != "boolean" && (t = this.focusMode) != null && t.fade && Ei.setFade(this.elementRef, this.focusMode.fade), setTimeout(function () {
3253
3264
  _this5.submitUserMessage = e.submitUserMessage;
3254
3265
  });
3255
3266
  }
@@ -3284,7 +3295,7 @@ var Z = /*#__PURE__*/function () {
3284
3295
  var i = this.createNewMessageElement(e, t);
3285
3296
  if (this.appendOuterContainerElemet(i.outerContainer, t), t === "user") {
3286
3297
  var r = typeof this.focusMode != "boolean" && ((s = this.focusMode) == null ? void 0 : s.scroll);
3287
- G.scrollToBottom(this.elementRef, r);
3298
+ V.scrollToBottom(this.elementRef, r);
3288
3299
  }
3289
3300
  return i;
3290
3301
  }
@@ -3302,7 +3313,7 @@ var Z = /*#__PURE__*/function () {
3302
3313
  var _this6 = this;
3303
3314
  var i = this.createNewMessageElement(e, t);
3304
3315
  return this.appendOuterContainerElemet(i.outerContainer), setTimeout(function () {
3305
- return G.scrollToBottom(_this6.elementRef);
3316
+ return V.scrollToBottom(_this6.elementRef);
3306
3317
  }), i;
3307
3318
  }
3308
3319
  }, {
@@ -3346,7 +3357,7 @@ var Z = /*#__PURE__*/function () {
3346
3357
  }, {
3347
3358
  key: "revealRoleElementsIfTempRemoved",
3348
3359
  value: function revealRoleElementsIfTempRemoved(e, t) {
3349
- if ((this.avatar || this.name) && Se.isElementTemporary(e)) {
3360
+ if ((this.avatar || this.name) && _e.isElementTemporary(e)) {
3350
3361
  var i = this.messageElementRefs[this.messageElementRefs.length - 2];
3351
3362
  i && this.messageToElements.length > 0 && !e.bubbleElement.classList.contains(y.getRoleClass(t)) && y.revealRoleElements(i.innerContainer, this.avatar, this.name);
3352
3363
  }
@@ -3381,7 +3392,7 @@ var Z = /*#__PURE__*/function () {
3381
3392
  }, {
3382
3393
  key: "applyCustomStyles",
3383
3394
  value: function applyCustomStyles(e, t, i, s) {
3384
- e && this.messageStyles && J.applyCustomStyles(this.messageStyles, e, t, i, s);
3395
+ e && this.messageStyles && X.applyCustomStyles(this.messageStyles, e, t, i, s);
3385
3396
  }
3386
3397
  }, {
3387
3398
  key: "removeMessage",
@@ -3433,7 +3444,7 @@ var Z = /*#__PURE__*/function () {
3433
3444
  }, {
3434
3445
  key: "isTemporaryElement",
3435
3446
  value: function isTemporaryElement(e) {
3436
- return Z.isLoadingMessage(e) || Se.isElementTemporary(e);
3447
+ return Z.isLoadingMessage(e) || _e.isElementTemporary(e);
3437
3448
  }
3438
3449
  }, {
3439
3450
  key: "createBaseElements",
@@ -3611,7 +3622,7 @@ var S = /*#__PURE__*/function () {
3611
3622
  key: "generateMessageBodyElements",
3612
3623
  value: function generateMessageBodyElements(e, t) {
3613
3624
  var i = {};
3614
- return e.text && (i.text = S.findMessageElements(t, he.TEXT_BUBBLE_CLASS)), e.html && (i.html = S.findMessageElements(t, _e.HTML_BUBBLE_CLASS)), e.files && (i.files = S.filterdMessageElements(t, H.FILE_BUBBLE_CLASS)), i;
3625
+ return e.text && (i.text = S.findMessageElements(t, he.TEXT_BUBBLE_CLASS)), e.html && (i.html = S.findMessageElements(t, xe.HTML_BUBBLE_CLASS)), e.files && (i.files = S.filterdMessageElements(t, q.FILE_BUBBLE_CLASS)), i;
3615
3626
  }
3616
3627
  }, {
3617
3628
  key: "generateMessageBody",
@@ -3688,39 +3699,49 @@ var S = /*#__PURE__*/function () {
3688
3699
  }();
3689
3700
  S.AI_ROLE = "ai", S.USER_ROLE = "user", S.ERROR_MESSAGE_TEXT_CLASS = "error-message-text", S.OUTER_CONTAINER_CLASS_ROLE_PREFIX = "deep-chat-outer-container-role-", S.EMPTY_MESSAGE_CLASS = "empty-message", S.POSITION_TOP_MESSAGE_CLASS = "deep-chat-top-message", S.POSITION_MIDDLE_MESSAGE_CLASS = "deep-chat-middle-message", S.POSITION_BOTTOM_MESSAGE_CLASS = "deep-chat-bottom-message";
3690
3701
  var y = S;
3691
- var Le = /*#__PURE__*/function () {
3692
- function Le(e, t) {
3693
- _classCallCheck(this, Le);
3694
- this._fileAdded = !1, this._streamType = "", this._hasStreamEnded = !1, this._partialText = "", this._messages = e, this._partialRender = _typeof(t) == "object" ? t.partialRender : !1;
3702
+ var pe = /*#__PURE__*/function () {
3703
+ function pe(e, t) {
3704
+ _classCallCheck(this, pe);
3705
+ this._fileAdded = !1, this._streamType = "", this._hasStreamEnded = !1, this._partialText = "", this._messages = e, _typeof(t) == "object" && (this._partialRender = t.partialRender, this._customWrappers = t.htmlWrappers);
3695
3706
  }
3696
- return _createClass(Le, [{
3707
+ return _createClass(pe, [{
3697
3708
  key: "upsertStreamedMessage",
3698
3709
  value: function upsertStreamedMessage(e) {
3699
- var r;
3700
3710
  if (this._hasStreamEnded) return;
3701
3711
  if ((e == null ? void 0 : e.text) === void 0 && (e == null ? void 0 : e.html) === void 0) return console.error(k.INVALID_STREAM_EVENT);
3702
3712
  e != null && e.custom && this._message && (this._message.custom = e.custom);
3703
3713
  var t = (e == null ? void 0 : e.text) || (e == null ? void 0 : e.html) || "",
3704
- i = G.isScrollbarAtBottomOfElement(this._messages.elementRef),
3714
+ i = V.isScrollbarAtBottomOfElement(this._messages.elementRef),
3705
3715
  s = (e == null ? void 0 : e.text) !== void 0 ? "text" : "html";
3706
3716
  if (!this._elements && !this._message) this.setInitialState(s, t, e == null ? void 0 : e.role);else {
3707
3717
  if (this._streamType !== s) return console.error(k.INVALID_STREAM_EVENT_MIX);
3708
- this.updateBasedOnType(t, s, (r = this._elements) == null ? void 0 : r.bubbleElement, e == null ? void 0 : e.overwrite);
3718
+ this.updateBasedOnType(t, s, e == null ? void 0 : e.overwrite);
3709
3719
  }
3710
- i && G.scrollToBottom(this._messages.elementRef);
3720
+ i && V.scrollToBottom(this._messages.elementRef);
3711
3721
  }
3712
3722
  }, {
3713
3723
  key: "setInitialState",
3714
3724
  value: function setInitialState(e, t, i) {
3715
- this._streamType = e, i !== null && i !== void 0 ? i : i = y.AI_ROLE, this._elements = e === "text" ? this._messages.addNewTextMessage(t, i) : _e.add(this._messages, t, i), this._elements && (this._elements.bubbleElement.classList.add(Le.MESSAGE_CLASS), this._activeMessageRole = i, this._message = _defineProperty({
3725
+ var o, a;
3726
+ this._streamType = e, i !== null && i !== void 0 ? i : i = y.AI_ROLE;
3727
+ var s = ((o = this._customWrappers) == null ? void 0 : o[i]) || ((a = this._customWrappers) == null ? void 0 : a["default"]),
3728
+ r = s ? "" : t;
3729
+ this._elements = e === "text" ? this._messages.addNewTextMessage(r, i) : xe.add(this._messages, r, i), this._elements && (this._elements.bubbleElement.classList.add(pe.MESSAGE_CLASS), this._activeMessageRole = i, this._message = _defineProperty({
3716
3730
  role: this._activeMessageRole
3717
- }, e, t), this._messages.messageToElements.push([this._message, _defineProperty({}, e, this._elements)]));
3731
+ }, e, r), this._messages.messageToElements.push([this._message, _defineProperty({}, e, this._elements)]), s && this.setTargetWrapperIfNeeded(this._elements, t, this._streamType, s));
3732
+ }
3733
+ }, {
3734
+ key: "setTargetWrapperIfNeeded",
3735
+ value: function setTargetWrapperIfNeeded(e, t, i, s) {
3736
+ e.bubbleElement.innerHTML = s, this._targetWrapper = e.bubbleElement.getElementsByClassName(pe.TARGET_WRAPPER_CLASS)[0], this._elements && G.apply(this._messages, this._elements.bubbleElement), this.updateBasedOnType(t, i);
3718
3737
  }
3719
3738
  }, {
3720
3739
  key: "updateBasedOnType",
3721
- value: function updateBasedOnType(e, t, i) {
3722
- var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
3723
- this._partialRender || y.unfillEmptyMessageElement(i, e), (t === "text" ? this.updateText : this.updateHTML).bind(this)(e, i, s);
3740
+ value: function updateBasedOnType(e, t) {
3741
+ var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
3742
+ var o;
3743
+ var s = this._targetWrapper || ((o = this._elements) == null ? void 0 : o.bubbleElement);
3744
+ this._partialRender || y.unfillEmptyMessageElement(s, e), (t === "text" ? this.updateText : this.updateHTML).bind(this)(e, s, i);
3724
3745
  }
3725
3746
  }, {
3726
3747
  key: "updateText",
@@ -3731,7 +3752,7 @@ var Le = /*#__PURE__*/function () {
3731
3752
  key: "isNewPartialRenderParagraph",
3732
3753
  value: function isNewPartialRenderParagraph() {
3733
3754
  var e, t;
3734
- return this._partialBubble ? this._partialText && ((t = this._partialText) == null ? void 0 : t.indexOf(Le.PARTIAL_RENDER_TEXT_MARK)) > -1 : ((e = this._message) == null ? void 0 : e.text) && this._message.text.indexOf(Le.PARTIAL_RENDER_TEXT_MARK) > -1;
3755
+ return this._partialBubble ? this._partialText && ((t = this._partialText) == null ? void 0 : t.indexOf(pe.PARTIAL_RENDER_TEXT_MARK)) > -1 : ((e = this._message) == null ? void 0 : e.text) && this._message.text.indexOf(pe.PARTIAL_RENDER_TEXT_MARK) > -1;
3735
3756
  }
3736
3757
  }, {
3737
3758
  key: "partialRenderNewParagraph",
@@ -3757,7 +3778,7 @@ var Le = /*#__PURE__*/function () {
3757
3778
  var e;
3758
3779
  if (!(this._endStreamAfterOperation || !this._message) && !(this._fileAdded && !this._elements)) {
3759
3780
  if (!this._elements) throw Error(k.NO_VALID_STREAM_EVENTS_SENT);
3760
- (e = this._elements.bubbleElement) != null && e.classList.contains(Le.MESSAGE_CLASS) && (this._streamType === "text" ? this._messages.textToSpeech && gt.speak(this._message.text || "", this._messages.textToSpeech) : this._streamType === "html" && this._elements && X.apply(this._messages, this._elements.outerContainer), this._elements.bubbleElement.classList.remove(Le.MESSAGE_CLASS), this._message && this._messages.sendClientUpdate(he.createMessageContent(this._message), !1), this._hasStreamEnded = !0);
3781
+ (e = this._elements.bubbleElement) != null && e.classList.contains(pe.MESSAGE_CLASS) && (this._streamType === "text" ? this._messages.textToSpeech && bt.speak(this._message.text || "", this._messages.textToSpeech) : this._streamType === "html" && this._elements && G.apply(this._messages, this._elements.outerContainer), this._elements.bubbleElement.classList.remove(pe.MESSAGE_CLASS), this._message && (this._targetWrapper && (this._message.html = this._elements.bubbleElement.children[0].outerHTML, this._streamType === "text" && delete this._message.text), this._messages.sendClientUpdate(he.createMessageContent(this._message), !1)), this._hasStreamEnded = !0);
3761
3782
  }
3762
3783
  }
3763
3784
  }, {
@@ -3775,7 +3796,7 @@ var Le = /*#__PURE__*/function () {
3775
3796
  key: "endStreamAfterFileDownloaded",
3776
3797
  value: function () {
3777
3798
  var _endStreamAfterFileDownloaded = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e, t) {
3778
- var r, _yield$t, i, s;
3799
+ var _yield$t, i, s;
3779
3800
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3780
3801
  while (1) switch (_context2.prev = _context2.next) {
3781
3802
  case 0:
@@ -3786,7 +3807,7 @@ var Le = /*#__PURE__*/function () {
3786
3807
  _yield$t = _context2.sent;
3787
3808
  i = _yield$t.text;
3788
3809
  s = _yield$t.files;
3789
- i && this.updateBasedOnType(i, "text", (r = this._elements) == null ? void 0 : r.bubbleElement, !0), this._endStreamAfterOperation = !1, this.finaliseStreamedMessage(), s && e.addNewMessage({
3810
+ i && this.updateBasedOnType(i, "text", !0), this._endStreamAfterOperation = !1, this.finaliseStreamedMessage(), s && e.addNewMessage({
3790
3811
  files: s
3791
3812
  });
3792
3813
  case 7:
@@ -3802,13 +3823,13 @@ var Le = /*#__PURE__*/function () {
3802
3823
  }()
3803
3824
  }]);
3804
3825
  }();
3805
- Le.MESSAGE_CLASS = "streamed-message", Le.PARTIAL_RENDER_TEXT_MARK = "\n\n";
3806
- var we = Le;
3807
- var He = /*#__PURE__*/function () {
3808
- function He() {
3809
- _classCallCheck(this, He);
3826
+ pe.MESSAGE_CLASS = "streamed-message", pe.PARTIAL_RENDER_TEXT_MARK = "\n\n", pe.TARGET_WRAPPER_CLASS = "stream-wrapper";
3827
+ var Ae = pe;
3828
+ var qe = /*#__PURE__*/function () {
3829
+ function qe() {
3830
+ _classCallCheck(this, qe);
3810
3831
  }
3811
- return _createClass(He, null, [{
3832
+ return _createClass(qe, null, [{
3812
3833
  key: "tempRemoveContentHeader",
3813
3834
  value: // need to pass stringifyBody boolean separately as binding is throwing an error for some reason
3814
3835
  // prettier-ignore
@@ -3824,8 +3845,8 @@ var He = /*#__PURE__*/function () {
3824
3845
  }
3825
3846
  throw new Error("Request settings have not been set up");
3826
3847
  case 2:
3827
- s = e.headers[He.CONTENT_TYPE];
3828
- delete e.headers[He.CONTENT_TYPE];
3848
+ s = e.headers[qe.CONTENT_TYPE];
3849
+ delete e.headers[qe.CONTENT_TYPE];
3829
3850
  _context3.prev = 4;
3830
3851
  _context3.next = 7;
3831
3852
  return t(i);
@@ -3836,9 +3857,9 @@ var He = /*#__PURE__*/function () {
3836
3857
  case 10:
3837
3858
  _context3.prev = 10;
3838
3859
  _context3.t0 = _context3["catch"](4);
3839
- throw e.headers[He.CONTENT_TYPE] = s, _context3.t0;
3860
+ throw e.headers[qe.CONTENT_TYPE] = s, _context3.t0;
3840
3861
  case 13:
3841
- return _context3.abrupt("return", (e.headers[He.CONTENT_TYPE] = s, r));
3862
+ return _context3.abrupt("return", (e.headers[qe.CONTENT_TYPE] = s, r));
3842
3863
  case 14:
3843
3864
  case "end":
3844
3865
  return _context3.stop();
@@ -3982,7 +4003,7 @@ var He = /*#__PURE__*/function () {
3982
4003
  }
3983
4004
  if (r) {
3984
4005
  d = k.INVALID_RESPONSE(t, "response", !!a, l);
3985
- He.displayError(e, d);
4006
+ qe.displayError(e, d);
3986
4007
  }
3987
4008
  return _context5.abrupt("return");
3988
4009
  case 17:
@@ -4000,8 +4021,8 @@ var He = /*#__PURE__*/function () {
4000
4021
  }()
4001
4022
  }]);
4002
4023
  }();
4003
- He.CONTENT_TYPE = "Content-Type";
4004
- var E = He;
4024
+ qe.CONTENT_TYPE = "Content-Type";
4025
+ var E = qe;
4005
4026
  function Lo(_x14, _x15) {
4006
4027
  return _Lo.apply(this, arguments);
4007
4028
  }
@@ -4061,10 +4082,10 @@ function Io(n) {
4061
4082
  };
4062
4083
  }
4063
4084
  function Oo(n, e, t) {
4064
- var i = Ws();
4085
+ var i = $s();
4065
4086
  var s = new TextDecoder();
4066
4087
  return function (o, a) {
4067
- if (o.length === 0) t == null || t(i), i = Ws();else if (a > 0) {
4088
+ if (o.length === 0) t == null || t(i), i = $s();else if (a > 0) {
4068
4089
  var l = s.decode(o.subarray(0, a)),
4069
4090
  c = a + (o[a + 1] === 32 ? 2 : 1),
4070
4091
  d = s.decode(o.subarray(c));
@@ -4090,7 +4111,7 @@ function Po(n, e) {
4090
4111
  var t = new Uint8Array(n.length + e.length);
4091
4112
  return t.set(n), t.set(e, n.length), t;
4092
4113
  }
4093
- function Ws() {
4114
+ function $s() {
4094
4115
  return {
4095
4116
  data: "",
4096
4117
  event: "",
@@ -4134,13 +4155,13 @@ function Bo(n, e) {
4134
4155
  M(), u();
4135
4156
  });
4136
4157
  var Y = c !== null && c !== void 0 ? c : window.fetch,
4137
- qe = s !== null && s !== void 0 ? s : Fo;
4158
+ He = s !== null && s !== void 0 ? s : Fo;
4138
4159
  function ae() {
4139
4160
  return _ae.apply(this, arguments);
4140
4161
  }
4141
4162
  function _ae() {
4142
4163
  _ae = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
4143
- var Ce, ye, ie;
4164
+ var Re, Ee, ie;
4144
4165
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
4145
4166
  while (1) switch (_context6.prev = _context6.next) {
4146
4167
  case 0:
@@ -4152,12 +4173,12 @@ function Bo(n, e) {
4152
4173
  signal: m.signal
4153
4174
  }));
4154
4175
  case 4:
4155
- ye = _context6.sent;
4176
+ Ee = _context6.sent;
4156
4177
  _context6.next = 7;
4157
- return qe(ye);
4178
+ return He(Ee);
4158
4179
  case 7:
4159
4180
  _context6.next = 9;
4160
- return Lo(ye.body, Io(Oo(function (ie) {
4181
+ return Lo(Ee.body, Io(Oo(function (ie) {
4161
4182
  ie ? f[Js] = ie : delete f[Js];
4162
4183
  }, function (ie) {
4163
4184
  g = ie;
@@ -4172,7 +4193,7 @@ function Bo(n, e) {
4172
4193
  _context6.prev = 14;
4173
4194
  _context6.t0 = _context6["catch"](1);
4174
4195
  if (!m.signal.aborted) try {
4175
- ie = (Ce = a == null ? void 0 : a(_context6.t0)) !== null && Ce !== void 0 ? Ce : g;
4196
+ ie = (Re = a == null ? void 0 : a(_context6.t0)) !== null && Re !== void 0 ? Re : g;
4176
4197
  window.clearTimeout(b), b = window.setTimeout(ae, ie);
4177
4198
  } catch (ie) {
4178
4199
  M(), h(ie);
@@ -4243,15 +4264,15 @@ var A = /*#__PURE__*/function () {
4243
4264
  _context7.next = 13;
4244
4265
  break;
4245
4266
  }
4246
- return _context7.abrupt("return", be.stream(e, a, i));
4267
+ return _context7.abrupt("return", ve.stream(e, a, i));
4247
4268
  case 13:
4248
- if (!(((p = e.connectSettings) == null ? void 0 : p.url) === ve.URL)) {
4269
+ if (!(((p = e.connectSettings) == null ? void 0 : p.url) === ye.URL)) {
4249
4270
  _context7.next = 15;
4250
4271
  break;
4251
4272
  }
4252
- return _context7.abrupt("return", ve.requestStream(i, e));
4273
+ return _context7.abrupt("return", ye.requestStream(i, e));
4253
4274
  case 15:
4254
- d = new we(i, e.stream), u = E.fetch.bind(this, e, l, s), h = {
4275
+ d = new Ae(i, e.stream), u = E.fetch.bind(this, e, l, s), h = {
4255
4276
  method: ((g = e.connectSettings) == null ? void 0 : g.method) || "POST",
4256
4277
  headers: l,
4257
4278
  credentials: (b = e.connectSettings) == null ? void 0 : b.credentials,
@@ -4280,7 +4301,7 @@ var A = /*#__PURE__*/function () {
4280
4301
  var u = !1;
4281
4302
  fetch(((h = e.connectSettings) == null ? void 0 : h.url) || e.url || "", s).then(/*#__PURE__*/function () {
4282
4303
  var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(f) {
4283
- var b, M, m, p, g, _yield$m$read, Y, qe, ae, Ce, ye;
4304
+ var b, M, m, p, g, _yield$m$read, Y, He, ae, Re, Ee;
4284
4305
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
4285
4306
  while (1) switch (_context8.prev = _context8.next) {
4286
4307
  case 0:
@@ -4303,8 +4324,8 @@ var A = /*#__PURE__*/function () {
4303
4324
  case 8:
4304
4325
  _yield$m$read = _context8.sent;
4305
4326
  Y = _yield$m$read.value;
4306
- qe = _yield$m$read.done;
4307
- if (!(g = qe, g)) {
4327
+ He = _yield$m$read.done;
4328
+ if (!(g = He, g)) {
4308
4329
  _context8.next = 15;
4309
4330
  break;
4310
4331
  }
@@ -4325,11 +4346,11 @@ var A = /*#__PURE__*/function () {
4325
4346
  }
4326
4347
  _context8.t0 = ae;
4327
4348
  case 21:
4328
- Ce = _context8.t0;
4329
- ye = _typeof(Ce) == "object" ? Ce : {
4349
+ Re = _context8.t0;
4350
+ Ee = _typeof(Re) == "object" ? Re : {
4330
4351
  text: ae
4331
4352
  };
4332
- A.handleMessage(e, t, i, c, ye, o, a);
4353
+ A.handleMessage(e, t, i, c, Ee, o, a);
4333
4354
  case 24:
4334
4355
  _context8.next = 5;
4335
4356
  break;
@@ -4463,7 +4484,7 @@ var A = /*#__PURE__*/function () {
4463
4484
  key: "simulate",
4464
4485
  value: function () {
4465
4486
  var _simulate = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee1(e, t, i, s) {
4466
- var r, o, _o2, a, _o3;
4487
+ var r, o, _o2, a, _o3, _a2;
4467
4488
  return _regeneratorRuntime().wrap(function _callee1$(_context1) {
4468
4489
  while (1) switch (_context1.prev = _context1.next) {
4469
4490
  case 0:
@@ -4499,13 +4520,15 @@ var A = /*#__PURE__*/function () {
4499
4520
  case 10:
4500
4521
  if (i.text) {
4501
4522
  t.onOpen();
4502
- _o2 = i.text.split(""), a = new we(e, s == null ? void 0 : s.stream);
4523
+ _o2 = i.text.split(""), a = new Ae(e, s == null ? void 0 : s.stream);
4503
4524
  A.populateMessages(e, _o2, a, r, "text", 0, s);
4504
4525
  }
4505
4526
  if (i.html) {
4506
4527
  t.onOpen();
4507
- _o3 = X.splitHTML(i.html);
4508
- _o3.length === 0 && (_o3 = i.html.split("")), A.populateMessages(e, _o3, new we(e), r, "html", 0, s);
4528
+ _o3 = G.splitHTML(i.html);
4529
+ _o3.length === 0 && (_o3 = i.html.split(""));
4530
+ _a2 = new Ae(e, s == null ? void 0 : s.stream);
4531
+ A.populateMessages(e, _o3, _a2, r, "html", 0, s);
4509
4532
  }
4510
4533
  i.error && (E.displayError(e, i.error), t.onClose());
4511
4534
  case 13:
@@ -4669,12 +4692,12 @@ var Ze = /*#__PURE__*/function () {
4669
4692
  }]);
4670
4693
  }();
4671
4694
  Ze.URL = "deep-chat-demo";
4672
- var ve = Ze;
4673
- var q = /*#__PURE__*/function () {
4674
- function q() {
4675
- _classCallCheck(this, q);
4695
+ var ye = Ze;
4696
+ var H = /*#__PURE__*/function () {
4697
+ function H() {
4698
+ _classCallCheck(this, H);
4676
4699
  }
4677
- return _createClass(q, null, [{
4700
+ return _createClass(H, null, [{
4678
4701
  key: "setup",
4679
4702
  value: function setup(e) {
4680
4703
  e.permittedErrorPrefixes = ["Connection error", "Error in server message"], e.websocket = "pending";
@@ -4689,21 +4712,21 @@ var q = /*#__PURE__*/function () {
4689
4712
  }, {
4690
4713
  key: "createConnection",
4691
4714
  value: function createConnection(e, t) {
4692
- if (!q.isElementPresentInDOM(e.deepChat)) return;
4715
+ if (!H.isElementPresentInDOM(e.deepChat)) return;
4693
4716
  var i = e.connectSettings.websocket;
4694
4717
  if (i) {
4695
- if (e.connectSettings.handler) return be.websocket(e, t);
4718
+ if (e.connectSettings.handler) return ve.websocket(e, t);
4696
4719
  try {
4697
4720
  var s = typeof i != "boolean" ? i : void 0,
4698
4721
  r = new WebSocket(e.connectSettings.url || "", s);
4699
4722
  e.websocket = r, e.websocket.onopen = function () {
4700
4723
  var o, a;
4701
- t.removeError(), e.websocket && _typeof(e.websocket) == "object" && q.assignListeners(e, r, t), (a = (o = e.deepChat)._validationHandler) == null || a.call(o);
4724
+ t.removeError(), e.websocket && _typeof(e.websocket) == "object" && H.assignListeners(e, r, t), (a = (o = e.deepChat)._validationHandler) == null || a.call(o);
4702
4725
  }, e.websocket.onerror = function (o) {
4703
- console.error(o), q.retryConnection(e, t);
4726
+ console.error(o), H.retryConnection(e, t);
4704
4727
  };
4705
4728
  } catch (s) {
4706
- console.error(s), q.retryConnection(e, t);
4729
+ console.error(s), H.retryConnection(e, t);
4707
4730
  }
4708
4731
  }
4709
4732
  }
@@ -4711,8 +4734,8 @@ var q = /*#__PURE__*/function () {
4711
4734
  key: "retryConnection",
4712
4735
  value: function retryConnection(e, t) {
4713
4736
  var i, s;
4714
- (s = (i = e.deepChat)._validationHandler) == null || s.call(i), q.isElementPresentInDOM(e.deepChat) && (e.websocket = "pending", t.isLastMessageError() || t.addNewErrorMessage("service", "Connection error"), setTimeout(function () {
4715
- q.createConnection(e, t);
4737
+ (s = (i = e.deepChat)._validationHandler) == null || s.call(i), H.isElementPresentInDOM(e.deepChat) && (e.websocket = "pending", t.isLastMessageError() || t.addNewErrorMessage("service", "Connection error"), setTimeout(function () {
4738
+ H.createConnection(e, t);
4716
4739
  }, 5e3));
4717
4740
  }
4718
4741
  }, {
@@ -4749,7 +4772,7 @@ var q = /*#__PURE__*/function () {
4749
4772
  _context12.next = 13;
4750
4773
  break;
4751
4774
  }
4752
- l = q.stream.bind(_this8, e, i, s), c = s[o.role || y.AI_ROLE];
4775
+ l = H.stream.bind(_this8, e, i, s), c = s[o.role || y.AI_ROLE];
4753
4776
  A.upsertWFiles(i, l, c, a);
4754
4777
  _context12.next = 17;
4755
4778
  break;
@@ -4783,7 +4806,7 @@ var q = /*#__PURE__*/function () {
4783
4806
  return _ref8.apply(this, arguments);
4784
4807
  };
4785
4808
  }(), t.onclose = function () {
4786
- console.error("Connection closed"), i.isLastMessageError() || i.addNewErrorMessage("service", "Connection error"), e.stream && e.streamHandlers.abortStream.abort(), q.createConnection(e, i);
4809
+ console.error("Connection closed"), i.isLastMessageError() || i.addNewErrorMessage("service", "Connection error"), e.stream && e.streamHandlers.abortStream.abort(), H.createConnection(e, i);
4787
4810
  };
4788
4811
  }
4789
4812
  }, {
@@ -4804,11 +4827,11 @@ var q = /*#__PURE__*/function () {
4804
4827
  while (1) switch (_context13.prev = _context13.next) {
4805
4828
  case 0:
4806
4829
  s = _args13.length > 3 && _args13[3] !== undefined ? _args13[3] : !0;
4807
- if (!(((d = e.connectSettings) == null ? void 0 : d.url) === ve.URL)) {
4830
+ if (!(((d = e.connectSettings) == null ? void 0 : d.url) === ye.URL)) {
4808
4831
  _context13.next = 3;
4809
4832
  break;
4810
4833
  }
4811
- return _context13.abrupt("return", ve.request(e, i));
4834
+ return _context13.abrupt("return", ye.request(e, i));
4812
4835
  case 3:
4813
4836
  r = e.websocket;
4814
4837
  if (!(!r || r === "pending")) {
@@ -4833,7 +4856,7 @@ var q = /*#__PURE__*/function () {
4833
4856
  }
4834
4857
  return _context13.abrupt("return", i.addNewErrorMessage("service", l));
4835
4858
  case 14:
4836
- if (q.isWebSocket(r)) {
4859
+ if (H.isWebSocket(r)) {
4837
4860
  _context13.next = 16;
4838
4861
  break;
4839
4862
  }
@@ -4855,7 +4878,7 @@ var q = /*#__PURE__*/function () {
4855
4878
  }, {
4856
4879
  key: "canSendMessage",
4857
4880
  value: function canSendMessage(e) {
4858
- return e ? e === "pending" ? !1 : q.isWebSocket(e) ? e.readyState !== void 0 && e.readyState === e.OPEN : e.isOpen : !0;
4881
+ return e ? e === "pending" ? !1 : H.isWebSocket(e) ? e.readyState !== void 0 && e.readyState === e.OPEN : e.isOpen : !0;
4859
4882
  }
4860
4883
  // if false then it is the internal websocket handler
4861
4884
  }, {
@@ -4872,16 +4895,16 @@ var q = /*#__PURE__*/function () {
4872
4895
  var _i$o;
4873
4896
  var o = s.role || y.AI_ROLE,
4874
4897
  a = i[o];
4875
- s.text === r || s.html === r ? (a == null || a.finaliseStreamedMessage(), delete i[o]) : ((_i$o = i[o]) !== null && _i$o !== void 0 ? _i$o : i[o] = new we(t, e.stream), i[o].upsertStreamedMessage(s));
4898
+ s.text === r || s.html === r ? (a == null || a.finaliseStreamedMessage(), delete i[o]) : ((_i$o = i[o]) !== null && _i$o !== void 0 ? _i$o : i[o] = new Ae(t, e.stream), i[o].upsertStreamedMessage(s));
4876
4899
  } else A.simulate(t, e.streamHandlers, s);
4877
4900
  }
4878
4901
  }]);
4879
4902
  }();
4880
- var be = /*#__PURE__*/function () {
4881
- function be() {
4882
- _classCallCheck(this, be);
4903
+ var ve = /*#__PURE__*/function () {
4904
+ function ve() {
4905
+ _classCallCheck(this, ve);
4883
4906
  }
4884
- return _createClass(be, null, [{
4907
+ return _createClass(ve, null, [{
4885
4908
  key: "request",
4886
4909
  value: function () {
4887
4910
  var _request2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(e, t, i) {
@@ -4927,7 +4950,7 @@ var be = /*#__PURE__*/function () {
4927
4950
  return function r(_x38) {
4928
4951
  return _ref9.apply(this, arguments);
4929
4952
  };
4930
- }(), o = be.generateOptionalSignals();
4953
+ }(), o = ve.generateOptionalSignals();
4931
4954
  (l = (a = e.connectSettings).handler) == null || l.call(a, t, _objectSpread(_objectSpread({}, o), {}, {
4932
4955
  onResponse: r
4933
4956
  }));
@@ -4959,12 +4982,12 @@ var be = /*#__PURE__*/function () {
4959
4982
  var u, h;
4960
4983
  var s = !0,
4961
4984
  r = !1;
4962
- var o = new we(i, e.stream),
4985
+ var o = new Ae(i, e.stream),
4963
4986
  a = function a() {
4964
4987
  r || !s || (e.streamHandlers.onOpen(), r = !0);
4965
4988
  },
4966
4989
  l = function l() {
4967
- s && (be.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), s = !1);
4990
+ s && (ve.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), s = !1);
4968
4991
  },
4969
4992
  c = /*#__PURE__*/function () {
4970
4993
  var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(f) {
@@ -4985,9 +5008,9 @@ var be = /*#__PURE__*/function () {
4985
5008
  });
4986
5009
  case 4:
4987
5010
  m = _context16.sent;
4988
- if (m) m.error ? (be.streamError(m.error, o, e, i), s = !1) : A.upsertWFiles(i, o.upsertStreamedMessage.bind(o), o, m);else {
5011
+ if (m) m.error ? (ve.streamError(m.error, o, e, i), s = !1) : A.upsertWFiles(i, o.upsertStreamedMessage.bind(o), o, m);else {
4989
5012
  p = k.INVALID_RESPONSE(f, "server", !!e.deepChat.responseInterceptor, m);
4990
- be.streamError(p, o, e, i), s = !1;
5013
+ ve.streamError(p, o, e, i), s = !1;
4991
5014
  }
4992
5015
  case 6:
4993
5016
  case "end":
@@ -5000,9 +5023,9 @@ var be = /*#__PURE__*/function () {
5000
5023
  };
5001
5024
  }();
5002
5025
  e.streamHandlers.abortStream.abort = function () {
5003
- be.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), s = !1;
5026
+ ve.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), s = !1;
5004
5027
  };
5005
- var d = be.generateOptionalSignals();
5028
+ var d = ve.generateOptionalSignals();
5006
5029
  (h = (u = e.connectSettings).handler) == null || h.call(u, t, _objectSpread(_objectSpread({}, d), {}, {
5007
5030
  onOpen: a,
5008
5031
  onResponse: c,
@@ -5059,7 +5082,7 @@ var be = /*#__PURE__*/function () {
5059
5082
  return typeof m.error == "string";
5060
5083
  });
5061
5084
  if (f) console.error(f.error), t.isLastMessageError() || t.addNewErrorMessage("service", f.error);else if (A.isSimulation(e.stream)) {
5062
- m = u, p = q.stream.bind(_this9, e, t, i.roleToStream), g = i.roleToStream[m.role || y.AI_ROLE];
5085
+ m = u, p = H.stream.bind(_this9, e, t, i.roleToStream), g = i.roleToStream[m.role || y.AI_ROLE];
5063
5086
  A.upsertWFiles(t, p, g, m);
5064
5087
  } else h.forEach(function (m) {
5065
5088
  return t.addNewMessage(m);
@@ -5075,7 +5098,7 @@ var be = /*#__PURE__*/function () {
5075
5098
  return _ref1.apply(this, arguments);
5076
5099
  };
5077
5100
  }(),
5078
- a = be.generateOptionalSignals();
5101
+ a = ve.generateOptionalSignals();
5079
5102
  (c = (l = e.connectSettings).handler) == null || c.call(l, void 0, _objectSpread(_objectSpread({}, a), {}, {
5080
5103
  onOpen: s,
5081
5104
  onResponse: o,
@@ -5147,13 +5170,13 @@ var R = /*#__PURE__*/function () {
5147
5170
  _context19.next = 13;
5148
5171
  break;
5149
5172
  }
5150
- return _context19.abrupt("return", be.request(e, o, i));
5173
+ return _context19.abrupt("return", ve.request(e, o, i));
5151
5174
  case 13:
5152
- if (!(((m = e.connectSettings) == null ? void 0 : m.url) === ve.URL)) {
5175
+ if (!(((m = e.connectSettings) == null ? void 0 : m.url) === ye.URL)) {
5153
5176
  _context19.next = 15;
5154
5177
  break;
5155
5178
  }
5156
- return _context19.abrupt("return", ve.request(e, i));
5179
+ return _context19.abrupt("return", ye.request(e, i));
5157
5180
  case 15:
5158
5181
  d = !0;
5159
5182
  u = E.fetch.bind(this, e, a, s);
@@ -5373,7 +5396,7 @@ var ze = /*#__PURE__*/function () {
5373
5396
  this._messages.removeMessage(t), ze.displayIntroMessages(this._messages.messageElementRefs), i.forEach(function (s) {
5374
5397
  return _this0._messages.addAnyMessage(s, !0);
5375
5398
  }), setTimeout(function () {
5376
- return G.scrollToBottom(_this0._messages.elementRef);
5399
+ return V.scrollToBottom(_this0._messages.elementRef);
5377
5400
  }, 0);
5378
5401
  case 5:
5379
5402
  case "end":
@@ -5504,7 +5527,7 @@ var ze = /*#__PURE__*/function () {
5504
5527
  i = _context25.sent;
5505
5528
  s = this._messages.elementRef.scrollTop;
5506
5529
  this.populateMessages(t, i), s === 0 && setTimeout(function () {
5507
- return G.scrollToBottom(_this12._messages.elementRef);
5530
+ return V.scrollToBottom(_this12._messages.elementRef);
5508
5531
  }, 0);
5509
5532
  _context25.next = 13;
5510
5533
  break;
@@ -5564,12 +5587,12 @@ var ze = /*#__PURE__*/function () {
5564
5587
  }]);
5565
5588
  }();
5566
5589
  ze.FAILED_ERROR_MESSAGE = "Failed to load history";
5567
- var ii = ze;
5568
- var vt = /*#__PURE__*/function () {
5569
- function vt() {
5570
- _classCallCheck(this, vt);
5590
+ var si = ze;
5591
+ var yt = /*#__PURE__*/function () {
5592
+ function yt() {
5593
+ _classCallCheck(this, yt);
5571
5594
  }
5572
- return _createClass(vt, null, [{
5595
+ return _createClass(yt, null, [{
5573
5596
  key: "getCharacterLimitMessages",
5574
5597
  value: function getCharacterLimitMessages(e, t) {
5575
5598
  var r;
@@ -5596,7 +5619,7 @@ var vt = /*#__PURE__*/function () {
5596
5619
  }, {
5597
5620
  key: "processMessages",
5598
5621
  value: function processMessages(e, t, i) {
5599
- return t !== void 0 ? t > 0 && (e = vt.getMaxMessages(e, t)) : e = [e[e.length - 1]], e = JSON.parse(JSON.stringify(e)), i === void 0 ? e : vt.getCharacterLimitMessages(e, i);
5622
+ return t !== void 0 ? t > 0 && (e = yt.getMaxMessages(e, t)) : e = [e[e.length - 1]], e = JSON.parse(JSON.stringify(e)), i === void 0 ? e : yt.getCharacterLimitMessages(e, i);
5600
5623
  }
5601
5624
  }]);
5602
5625
  }();
@@ -5713,7 +5736,7 @@ var rt = /*#__PURE__*/function () {
5713
5736
  var _a$url;
5714
5737
  _classCallCheck(this, rt);
5715
5738
  var s, r, o, a, l;
5716
- this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = rt.canSendMessage, this.connectSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (s = e.connect) == null ? void 0 : s.additionalBodyProps), this.totalMessagesMaxCharLength = (r = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : r.totalMessagesMaxCharLength, this.maxMessages = (o = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : o.maxMessages, B.set(e, this, t), e.connect && (this.connectSettings = e.connect), this.demo && ((_a$url = (a = this.connectSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = ve.URL), this.connectSettings.websocket && q.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || te.checkForStream(this.deepChat), e.loadHistory && ii.addErrorPrefix(this);
5739
+ this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = rt.canSendMessage, this.connectSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (s = e.connect) == null ? void 0 : s.additionalBodyProps), this.totalMessagesMaxCharLength = (r = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : r.totalMessagesMaxCharLength, this.maxMessages = (o = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : o.maxMessages, B.set(e, this, t), e.connect && (this.connectSettings = e.connect), this.demo && ((_a$url = (a = this.connectSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = ye.URL), this.connectSettings.websocket && H.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || te.checkForStream(this.deepChat), e.loadHistory && si.addErrorPrefix(this);
5717
5740
  }
5718
5741
  return _createClass(rt, [{
5719
5742
  key: "verifyKey",
@@ -5838,16 +5861,16 @@ var rt = /*#__PURE__*/function () {
5838
5861
  }
5839
5862
  throw new Error("Request settings have not been set up");
5840
5863
  case 2:
5841
- i = vt.processMessages(t.messageToElements.map(function (_ref13) {
5864
+ i = yt.processMessages(t.messageToElements.map(function (_ref13) {
5842
5865
  var _ref14 = _slicedToArray(_ref13, 1),
5843
5866
  s = _ref14[0];
5844
5867
  return s;
5845
5868
  }), this.maxMessages, this.totalMessagesMaxCharLength);
5846
- if (this.connectSettings.websocket && (!this.connectSettings.handler || this.connectSettings.url !== ve.URL)) {
5869
+ if (this.connectSettings.websocket && (!this.connectSettings.handler || this.connectSettings.url !== ye.URL)) {
5847
5870
  s = _objectSpread({
5848
5871
  messages: i
5849
5872
  }, this.rawBody);
5850
- q.sendWebsocket(this, s, t, !1);
5873
+ H.sendWebsocket(this, s, t, !1);
5851
5874
  } else this.callServiceAPI(t, i, e.files);
5852
5875
  case 4:
5853
5876
  case "end":
@@ -5927,17 +5950,17 @@ var rt = /*#__PURE__*/function () {
5927
5950
  }
5928
5951
  }]);
5929
5952
  }();
5930
- var V = /*#__PURE__*/function (_rt) {
5953
+ var K = /*#__PURE__*/function (_rt) {
5931
5954
  // prettier-ignore
5932
- function V(e, t, i, s, r) {
5955
+ function K(e, t, i, s, r) {
5933
5956
  var _this13;
5934
- _classCallCheck(this, V);
5957
+ _classCallCheck(this, K);
5935
5958
  var o;
5936
- _this13 = _callSuper(this, V, [e, r]), _this13.insertKeyPlaceholderText = "API Key", _this13.keyHelpUrl = "", Object.assign(_this13.rawBody, (o = e.connect) == null ? void 0 : o.additionalBodyProps), _this13._keyVerificationDetails = t, _this13._buildHeadersFunc = i, s && _this13.setApiKeyProperties(s), _this13.connectSettings = _this13.buildConnectSettings(_this13.key || "", e.connect);
5959
+ _this13 = _callSuper(this, K, [e, r]), _this13.insertKeyPlaceholderText = "API Key", _this13.keyHelpUrl = "", Object.assign(_this13.rawBody, (o = e.connect) == null ? void 0 : o.additionalBodyProps), _this13._keyVerificationDetails = t, _this13._buildHeadersFunc = i, s && _this13.setApiKeyProperties(s), _this13.connectSettings = _this13.buildConnectSettings(_this13.key || "", e.connect);
5937
5960
  return _this13;
5938
5961
  }
5939
- _inherits(V, _rt);
5940
- return _createClass(V, [{
5962
+ _inherits(K, _rt);
5963
+ return _createClass(K, [{
5941
5964
  key: "setApiKeyProperties",
5942
5965
  value: function setApiKeyProperties(e) {
5943
5966
  this.key = e.key, e.validateKeyProperty && (this.validateKeyProperty = e.validateKeyProperty);
@@ -6084,11 +6107,11 @@ var Ge = /*#__PURE__*/function () {
6084
6107
  }();
6085
6108
  Ge.VISIBLE_ICON_ID = "visible-icon";
6086
6109
  var os = Ge;
6087
- var K = /*#__PURE__*/function () {
6088
- function K() {
6089
- _classCallCheck(this, K);
6110
+ var W = /*#__PURE__*/function () {
6111
+ function W() {
6112
+ _classCallCheck(this, W);
6090
6113
  }
6091
- return _createClass(K, null, [{
6114
+ return _createClass(W, null, [{
6092
6115
  key: "createCautionText",
6093
6116
  value: function createCautionText() {
6094
6117
  var e = document.createElement("a");
@@ -6114,13 +6137,13 @@ var K = /*#__PURE__*/function () {
6114
6137
  i.id = "insert-key-help-text-container";
6115
6138
  var s = document.createElement("div");
6116
6139
  s.id = "insert-key-help-text-contents";
6117
- var r = K.createFailText();
6140
+ var r = W.createFailText();
6118
6141
  if (s.appendChild(r), e) {
6119
- var o = K.createHelpLink(e);
6142
+ var o = W.createHelpLink(e);
6120
6143
  s.appendChild(o);
6121
6144
  }
6122
6145
  if (t === !0) {
6123
- var _o4 = K.createCautionText();
6146
+ var _o4 = W.createCautionText();
6124
6147
  s.appendChild(_o4);
6125
6148
  }
6126
6149
  return i.appendChild(s), {
@@ -6151,10 +6174,10 @@ var K = /*#__PURE__*/function () {
6151
6174
  value: function addVerificationEvents(e, t, i, s, r) {
6152
6175
  var o = {
6153
6176
  onSuccess: s,
6154
- onFail: K.onFail.bind(this, e, t, i),
6155
- onLoad: K.onLoad.bind(this, e, t)
6177
+ onFail: W.onFail.bind(this, e, t, i),
6178
+ onLoad: W.onLoad.bind(this, e, t)
6156
6179
  },
6157
- a = K.verifyKey.bind(this, e, o, r);
6180
+ a = W.verifyKey.bind(this, e, o, r);
6158
6181
  t.onclick = a, e.onkeydown = function (l) {
6159
6182
  !e.classList.contains("loading") && l.key === U.ENTER && a();
6160
6183
  };
@@ -6176,7 +6199,7 @@ var K = /*#__PURE__*/function () {
6176
6199
  var t = document.createElement("div");
6177
6200
  t.id = "insert-key-input-container";
6178
6201
  var i = document.createElement("input");
6179
- return i.id = "insert-key-input", i.placeholder = e || "API Key", i.type = "password", i.classList.add("insert-key-input-valid"), i.onfocus = K.onInputFocus, t.appendChild(i), t;
6202
+ return i.id = "insert-key-input", i.placeholder = e || "API Key", i.type = "password", i.classList.add("insert-key-input-valid"), i.onfocus = W.onInputFocus, t.appendChild(i), t;
6180
6203
  }
6181
6204
  // prettier-ignore
6182
6205
  }, {
@@ -6185,28 +6208,28 @@ var K = /*#__PURE__*/function () {
6185
6208
  var d;
6186
6209
  var i = document.createElement("div");
6187
6210
  i.id = "insert-key-contents";
6188
- var s = K.createInput(t.insertKeyPlaceholderText),
6211
+ var s = W.createInput(t.insertKeyPlaceholderText),
6189
6212
  r = s.children[0],
6190
6213
  o = os.create(r);
6191
6214
  s.appendChild(o), i.appendChild(s);
6192
- var a = K.createStartButton(),
6193
- _K$createHelpTextCont = K.createHelpTextContainer(t.keyHelpUrl, (d = t.deepChat._insertKeyViewStyles) == null ? void 0 : d.displayCautionText),
6194
- l = _K$createHelpTextCont.helpTextContainerElement,
6195
- c = _K$createHelpTextCont.failTextElement;
6196
- return i.appendChild(a), i.appendChild(l), K.addVerificationEvents(r, a, c, e, t), i;
6215
+ var a = W.createStartButton(),
6216
+ _W$createHelpTextCont = W.createHelpTextContainer(t.keyHelpUrl, (d = t.deepChat._insertKeyViewStyles) == null ? void 0 : d.displayCautionText),
6217
+ l = _W$createHelpTextCont.helpTextContainerElement,
6218
+ c = _W$createHelpTextCont.failTextElement;
6219
+ return i.appendChild(a), i.appendChild(l), W.addVerificationEvents(r, a, c, e, t), i;
6197
6220
  }
6198
6221
  }, {
6199
6222
  key: "createElements",
6200
6223
  value: function createElements(e, t) {
6201
6224
  var i = document.createElement("div");
6202
6225
  i.id = "insert-key-view";
6203
- var s = K.createContents(e, t);
6226
+ var s = W.createContents(e, t);
6204
6227
  return i.appendChild(s), i;
6205
6228
  }
6206
6229
  }, {
6207
6230
  key: "render",
6208
6231
  value: function render(e, t, i) {
6209
- var s = K.createElements(t, i);
6232
+ var s = W.createElements(t, i);
6210
6233
  e.replaceChildren(s);
6211
6234
  }
6212
6235
  }]);
@@ -6219,7 +6242,7 @@ var se = /*#__PURE__*/function () {
6219
6242
  key: "enableButtons",
6220
6243
  value: function enableButtons(e, t) {
6221
6244
  var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
6222
- window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i < si.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
6245
+ window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i < ni.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
6223
6246
  return se.enableButtons(e, t, i + 1);
6224
6247
  }, 250);
6225
6248
  }
@@ -6444,7 +6467,7 @@ var Xs = {
6444
6467
  var t;
6445
6468
  ((t = this._webModel.introMessage) == null ? void 0 : t.autoScroll) !== !1 && setTimeout(function () {
6446
6469
  var i, s;
6447
- (i = _this18._messages) != null && i.elementRef && G.scrollToTop((s = _this18._messages) == null ? void 0 : s.elementRef);
6470
+ (i = _this18._messages) != null && i.elementRef && V.scrollToTop((s = _this18._messages) == null ? void 0 : s.elementRef);
6448
6471
  }, e);
6449
6472
  }
6450
6473
  // prettier-ignore
@@ -6576,7 +6599,7 @@ var Xs = {
6576
6599
  sendUpdate: !1
6577
6600
  }), i && (setTimeout(function () {
6578
6601
  var p;
6579
- return G.scrollToBottom((p = _this19._messages) == null ? void 0 : p.elementRef);
6602
+ return V.scrollToBottom((p = _this19._messages) == null ? void 0 : p.elementRef);
6580
6603
  }), i = !1);
6581
6604
  };
6582
6605
  T.chat.setInitProgressCallback(s);
@@ -6694,7 +6717,7 @@ var Xs = {
6694
6717
  this.streamHandlers.abortStream.abort = function () {
6695
6718
  i.interruptGenerate();
6696
6719
  }, this.streamHandlers.onOpen();
6697
- s = new we(e);
6720
+ s = new Ae(e);
6698
6721
  _context39.next = 4;
6699
6722
  return i.generate(t, /*#__PURE__*/function () {
6700
6723
  var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(r, o) {
@@ -6951,7 +6974,7 @@ var Xs = {
6951
6974
  }]);
6952
6975
  }(rt);
6953
6976
  T.GENERIC_ERROR = "Error, please check the [troubleshooting](https://deepchat.dev/docs/webModel#troubleshooting) section of documentation for help.", T.MULTIPLE_MODELS_ERROR = "Cannot run multiple web models", T.WEB_LLM_NOT_FOUND_ERROR = "WebLLM module not found", T.DEFAULT_MODEL = "Llama-2-7b-chat-hf-q4f32_1", T.MODULE_SEARCH_LIMIT_S = 5;
6954
- var si = T;
6977
+ var ni = T;
6955
6978
  var xi = /*#__PURE__*/function () {
6956
6979
  function xi() {
6957
6980
  _classCallCheck(this, xi);
@@ -6983,7 +7006,7 @@ var xi = /*#__PURE__*/function () {
6983
7006
  }
6984
7007
  }]);
6985
7008
  }();
6986
- var Jt = /*#__PURE__*/function (_V) {
7009
+ var Jt = /*#__PURE__*/function (_K) {
6987
7010
  // prettier-ignore
6988
7011
  function Jt(e, t, i, s, r, o) {
6989
7012
  var _this21;
@@ -6992,7 +7015,7 @@ var Jt = /*#__PURE__*/function (_V) {
6992
7015
  return _this21;
6993
7016
  }
6994
7017
  // prettier-ignore
6995
- _inherits(Jt, _V);
7018
+ _inherits(Jt, _K);
6996
7019
  return _createClass(Jt, [{
6997
7020
  key: "preprocessBody",
6998
7021
  value: function preprocessBody(e, t, i) {
@@ -7031,19 +7054,19 @@ var Jt = /*#__PURE__*/function (_V) {
7031
7054
  return callServiceAPI;
7032
7055
  }()
7033
7056
  }]);
7034
- }(V);
7057
+ }(K);
7035
7058
  Jt.URL_PREFIX = "https://api-inference.huggingface.co/models/";
7036
7059
  var je = Jt;
7037
- var li = /*#__PURE__*/function (_je) {
7060
+ var ci = /*#__PURE__*/function (_je) {
7038
7061
  // prettier-ignore
7039
- function li(e, t, i, s, r, o) {
7062
+ function ci(e, t, i, s, r, o) {
7040
7063
  var _this22;
7041
- _classCallCheck(this, li);
7042
- _this22 = _callSuper(this, li, [e, t, i, s, r, o]), _this22.isTextInputDisabled = !0, _this22.canSendMessage = li.canSendFile;
7064
+ _classCallCheck(this, ci);
7065
+ _this22 = _callSuper(this, ci, [e, t, i, s, r, o]), _this22.isTextInputDisabled = !0, _this22.canSendMessage = ci.canSendFile;
7043
7066
  return _this22;
7044
7067
  }
7045
- _inherits(li, _je);
7046
- return _createClass(li, [{
7068
+ _inherits(ci, _je);
7069
+ return _createClass(ci, [{
7047
7070
  key: "preprocessBody",
7048
7071
  value: function preprocessBody(e, t, i) {
7049
7072
  return i[0];
@@ -7087,19 +7110,19 @@ var li = /*#__PURE__*/function (_je) {
7087
7110
  }
7088
7111
  }]);
7089
7112
  }(je);
7090
- var qo = /*#__PURE__*/function (_li) {
7113
+ var Ho = /*#__PURE__*/function (_ci) {
7091
7114
  // prettier-ignore
7092
- function qo(e) {
7093
- _classCallCheck(this, qo);
7115
+ function Ho(e) {
7116
+ _classCallCheck(this, Ho);
7094
7117
  var s, r, o;
7095
7118
  var t = (r = (s = e.directConnection) == null ? void 0 : s.huggingFace) == null ? void 0 : r.audioClassification,
7096
7119
  i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
7097
- return _callSuper(this, qo, [e, "Attach an audio file", "ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition", t, i, {
7120
+ return _callSuper(this, Ho, [e, "Attach an audio file", "ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition", t, i, {
7098
7121
  audio: {}
7099
7122
  }]);
7100
7123
  }
7101
- _inherits(qo, _li);
7102
- return _createClass(qo, [{
7124
+ _inherits(Ho, _ci);
7125
+ return _createClass(Ho, [{
7103
7126
  key: "extractPollResultData",
7104
7127
  value: function () {
7105
7128
  var _extractPollResultData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(e) {
@@ -7136,19 +7159,19 @@ var qo = /*#__PURE__*/function (_li) {
7136
7159
  return extractPollResultData;
7137
7160
  }()
7138
7161
  }]);
7139
- }(li);
7140
- var Ho = /*#__PURE__*/function (_li2) {
7141
- function Ho(e) {
7142
- _classCallCheck(this, Ho);
7162
+ }(ci);
7163
+ var qo = /*#__PURE__*/function (_ci2) {
7164
+ function qo(e) {
7165
+ _classCallCheck(this, qo);
7143
7166
  var s, r, o;
7144
7167
  var t = (r = (s = e.directConnection) == null ? void 0 : s.huggingFace) == null ? void 0 : r.imageClassification,
7145
7168
  i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
7146
- return _callSuper(this, Ho, [e, "Attach an image file", "google/vit-base-patch16-224", t, i, {
7169
+ return _callSuper(this, qo, [e, "Attach an image file", "google/vit-base-patch16-224", t, i, {
7147
7170
  images: {}
7148
7171
  }]);
7149
7172
  }
7150
- _inherits(Ho, _li2);
7151
- return _createClass(Ho, [{
7173
+ _inherits(qo, _ci2);
7174
+ return _createClass(qo, [{
7152
7175
  key: "extractPollResultData",
7153
7176
  value: function () {
7154
7177
  var _extractPollResultData2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(e) {
@@ -7185,13 +7208,13 @@ var Ho = /*#__PURE__*/function (_li2) {
7185
7208
  return extractPollResultData;
7186
7209
  }()
7187
7210
  }]);
7188
- }(li);
7189
- var ci = "data:image/png;base64,";
7190
- var Te = /*#__PURE__*/function () {
7191
- function Te() {
7192
- _classCallCheck(this, Te);
7211
+ }(ci);
7212
+ var di = "data:image/png;base64,";
7213
+ var Ce = /*#__PURE__*/function () {
7214
+ function Ce() {
7215
+ _classCallCheck(this, Ce);
7193
7216
  }
7194
- return _createClass(Te, null, [{
7217
+ return _createClass(Ce, null, [{
7195
7218
  key: "buildHeaders",
7196
7219
  value: function buildHeaders(e) {
7197
7220
  return {
@@ -7211,12 +7234,12 @@ var Te = /*#__PURE__*/function () {
7211
7234
  return {
7212
7235
  url: "https://api.stability.ai/v1/engines/list",
7213
7236
  method: "GET",
7214
- handleVerificationResult: Te.handleVerificationResult
7237
+ handleVerificationResult: Ce.handleVerificationResult
7215
7238
  };
7216
7239
  }
7217
7240
  }]);
7218
7241
  }();
7219
- var zi = /*#__PURE__*/function (_V2) {
7242
+ var zi = /*#__PURE__*/function (_K2) {
7220
7243
  // prettier-ignore
7221
7244
  function zi(e, t, i, s, r) {
7222
7245
  var _this23;
@@ -7224,9 +7247,9 @@ var zi = /*#__PURE__*/function (_V2) {
7224
7247
  _this23 = _callSuper(this, zi, [e, t, i, s, r]), _this23.insertKeyPlaceholderText = "Stability AI API Key", _this23.keyHelpUrl = "https://platform.stability.ai/docs/getting-started/authentication", _this23.permittedErrorPrefixes = ["Incorrect", "invalid_"];
7225
7248
  return _this23;
7226
7249
  }
7227
- _inherits(zi, _V2);
7250
+ _inherits(zi, _K2);
7228
7251
  return _createClass(zi);
7229
- }(V);
7252
+ }(K);
7230
7253
  var wi = /*#__PURE__*/function (_zi) {
7231
7254
  function wi(e) {
7232
7255
  var _this24;
@@ -7242,7 +7265,7 @@ var wi = /*#__PURE__*/function (_zi) {
7242
7265
  }
7243
7266
  }
7244
7267
  };
7245
- _this24 = _callSuper(this, wi, [e, Te.buildKeyVerificationDetails(), Te.buildHeaders, i, s]), _this24.url = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale", _this24.textInputPlaceholderText = "Describe image changes", _this24.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Upscale</b></div>\n <p>Upload an image to generate a new one with higher resolution.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
7268
+ _this24 = _callSuper(this, wi, [e, Ce.buildKeyVerificationDetails(), Ce.buildHeaders, i, s]), _this24.url = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale", _this24.textInputPlaceholderText = "Describe image changes", _this24.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Upscale</b></div>\n <p>Upload an image to generate a new one with higher resolution.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
7246
7269
  var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageUpscale;
7247
7270
  _typeof(r) == "object" && (r.engine_id && (_this24.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")), wi.cleanConfig(r), Object.assign(_this24.rawBody, r)), _this24.canSendMessage = wi.canSendFileMessage;
7248
7271
  return _this24;
@@ -7306,7 +7329,7 @@ var wi = /*#__PURE__*/function (_zi) {
7306
7329
  return _context49.abrupt("return", {
7307
7330
  files: e.artifacts.map(function (i) {
7308
7331
  return {
7309
- src: "".concat(ci).concat(i.base64),
7332
+ src: "".concat(di).concat(i.base64),
7310
7333
  type: "image"
7311
7334
  };
7312
7335
  })
@@ -7349,7 +7372,7 @@ var Ai = /*#__PURE__*/function (_zi2) {
7349
7372
  }
7350
7373
  }
7351
7374
  };
7352
- _this25 = _callSuper(this, Ai, [e, Te.buildKeyVerificationDetails(), Te.buildHeaders, i, s]), _this25.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this25._maskSource = "MASK_IMAGE_WHITE", _this25.textInputPlaceholderText = "Describe image changes", _this25.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Masking</b></div>\n <p>Upload an image, its mask image to create a new one based on the changes you have described for the mask area.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
7375
+ _this25 = _callSuper(this, Ai, [e, Ce.buildKeyVerificationDetails(), Ce.buildHeaders, i, s]), _this25.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this25._maskSource = "MASK_IMAGE_WHITE", _this25.textInputPlaceholderText = "Describe image changes", _this25.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Masking</b></div>\n <p>Upload an image, its mask image to create a new one based on the changes you have described for the mask area.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
7353
7376
  var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
7354
7377
  _typeof(r) == "object" && (r.engine_id && (_this25.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this25._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this25._maskSource = r.mask_source), Ai.cleanConfig(r), Object.assign(_this25.rawBody, r)), _this25.canSendMessage = Ai.canSendFileTextMessage;
7355
7378
  return _this25;
@@ -7413,7 +7436,7 @@ var Ai = /*#__PURE__*/function (_zi2) {
7413
7436
  return _context51.abrupt("return", {
7414
7437
  files: e.artifacts.map(function (i) {
7415
7438
  return {
7416
- src: "".concat(ci).concat(i.base64),
7439
+ src: "".concat(di).concat(i.base64),
7417
7440
  type: "image"
7418
7441
  };
7419
7442
  })
@@ -7441,7 +7464,7 @@ var Ai = /*#__PURE__*/function (_zi2) {
7441
7464
  }
7442
7465
  }]);
7443
7466
  }(zi);
7444
- var zo = /*#__PURE__*/function (_li3) {
7467
+ var zo = /*#__PURE__*/function (_ci3) {
7445
7468
  function zo(e) {
7446
7469
  _classCallCheck(this, zo);
7447
7470
  var s, r, o;
@@ -7451,7 +7474,7 @@ var zo = /*#__PURE__*/function (_li3) {
7451
7474
  audio: {}
7452
7475
  }]);
7453
7476
  }
7454
- _inherits(zo, _li3);
7477
+ _inherits(zo, _ci3);
7455
7478
  return _createClass(zo, [{
7456
7479
  key: "extractPollResultData",
7457
7480
  value: function () {
@@ -7488,7 +7511,7 @@ var zo = /*#__PURE__*/function (_li3) {
7488
7511
  return extractPollResultData;
7489
7512
  }()
7490
7513
  }]);
7491
- }(li);
7514
+ }(ci);
7492
7515
  var Go = /*#__PURE__*/function (_je2) {
7493
7516
  function Go(e) {
7494
7517
  _classCallCheck(this, Go);
@@ -7621,20 +7644,20 @@ var Ko = /*#__PURE__*/function (_je4) {
7621
7644
  }()
7622
7645
  }]);
7623
7646
  }(je);
7624
- var $o = /*#__PURE__*/function (_je5) {
7625
- function $o(e) {
7647
+ var Wo = /*#__PURE__*/function (_je5) {
7648
+ function Wo(e) {
7626
7649
  var _this27$maxMessages;
7627
7650
  var _this27;
7628
- _classCallCheck(this, $o);
7651
+ _classCallCheck(this, Wo);
7629
7652
  var s, r, o;
7630
7653
  var t = (r = (s = e.directConnection) == null ? void 0 : s.huggingFace) == null ? void 0 : r.conversation,
7631
7654
  i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
7632
- _this27 = _callSuper(this, $o, [e, "Ask me anything!", "facebook/blenderbot-400M-distill", t, i]), (_this27$maxMessages = _this27.maxMessages) !== null && _this27$maxMessages !== void 0 ? _this27$maxMessages : _this27.maxMessages = -1;
7655
+ _this27 = _callSuper(this, Wo, [e, "Ask me anything!", "facebook/blenderbot-400M-distill", t, i]), (_this27$maxMessages = _this27.maxMessages) !== null && _this27$maxMessages !== void 0 ? _this27$maxMessages : _this27.maxMessages = -1;
7633
7656
  return _this27;
7634
7657
  }
7635
7658
  // prettier-ignore
7636
- _inherits($o, _je5);
7637
- return _createClass($o, [{
7659
+ _inherits(Wo, _je5);
7660
+ return _createClass(Wo, [{
7638
7661
  key: "processMessages",
7639
7662
  value: function processMessages(e) {
7640
7663
  var t = e.filter(function (a) {
@@ -7718,7 +7741,7 @@ var Ti = /*#__PURE__*/function (_zi3) {
7718
7741
  }
7719
7742
  }
7720
7743
  };
7721
- _this28 = _callSuper(this, Ti, [e, Te.buildKeyVerificationDetails(), Te.buildHeaders, i, s]), _this28.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this28.textInputPlaceholderText = "Describe image changes", _this28.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Image to Image</b></div>\n <p>Upload an image to create a new one with the changes you have described.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
7744
+ _this28 = _callSuper(this, Ti, [e, Ce.buildKeyVerificationDetails(), Ce.buildHeaders, i, s]), _this28.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this28.textInputPlaceholderText = "Describe image changes", _this28.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Image to Image</b></div>\n <p>Upload an image to create a new one with the changes you have described.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
7722
7745
  var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
7723
7746
  _typeof(r) == "object" && (r.engine_id && (_this28.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this28._imageWeight = r.weight), Ti.cleanConfig(r), Object.assign(_this28.rawBody, r)), _this28.canSendMessage = Ti.canSendFileTextMessage;
7724
7747
  return _this28;
@@ -7782,7 +7805,7 @@ var Ti = /*#__PURE__*/function (_zi3) {
7782
7805
  return _context58.abrupt("return", {
7783
7806
  files: e.artifacts.map(function (i) {
7784
7807
  return {
7785
- src: "".concat(ci).concat(i.base64),
7808
+ src: "".concat(di).concat(i.base64),
7786
7809
  type: "image"
7787
7810
  };
7788
7811
  })
@@ -7810,16 +7833,16 @@ var Ti = /*#__PURE__*/function (_zi3) {
7810
7833
  }
7811
7834
  }]);
7812
7835
  }(zi);
7813
- var Wo = /*#__PURE__*/function (_je6) {
7814
- function Wo(e) {
7815
- _classCallCheck(this, Wo);
7836
+ var $o = /*#__PURE__*/function (_je6) {
7837
+ function $o(e) {
7838
+ _classCallCheck(this, $o);
7816
7839
  var s, r, o;
7817
7840
  var t = (r = (s = e.directConnection) == null ? void 0 : s.huggingFace) == null ? void 0 : r.translation,
7818
7841
  i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
7819
- return _callSuper(this, Wo, [e, "Insert text to translate", "Helsinki-NLP/opus-tatoeba-en-ja", t, i]);
7842
+ return _callSuper(this, $o, [e, "Insert text to translate", "Helsinki-NLP/opus-tatoeba-en-ja", t, i]);
7820
7843
  }
7821
- _inherits(Wo, _je6);
7822
- return _createClass(Wo, [{
7844
+ _inherits($o, _je6);
7845
+ return _createClass($o, [{
7823
7846
  key: "extractResultData",
7824
7847
  value: function () {
7825
7848
  var _extractResultData9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee59(e) {
@@ -7856,7 +7879,7 @@ var Ci = /*#__PURE__*/function (_zi4) {
7856
7879
  var r;
7857
7880
  var t = JSON.parse(JSON.stringify(e.directConnection)),
7858
7881
  i = t.stabilityAI;
7859
- _this29 = _callSuper(this, Ci, [e, Te.buildKeyVerificationDetails(), Te.buildHeaders, i]), _this29.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/text-to-image", _this29.textInputPlaceholderText = "Describe an image", _this29.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Text to Image</b></div>\n <p>Insert text to generate an image.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
7882
+ _this29 = _callSuper(this, Ci, [e, Ce.buildKeyVerificationDetails(), Ce.buildHeaders, i]), _this29.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/text-to-image", _this29.textInputPlaceholderText = "Describe an image", _this29.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Text to Image</b></div>\n <p>Insert text to generate an image.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
7860
7883
  var s = (r = t.stabilityAI) == null ? void 0 : r.textToImage;
7861
7884
  _typeof(s) == "object" && (s.engine_id && (_this29.url = "https://api.stability.ai/v1/generation/".concat(s.engine_id, "/text-to-image")), s.weight !== void 0 && s.weight !== null && (_this29._imageWeight = s.weight), Ci.cleanConfig(s), Object.assign(_this29.rawBody, s)), _this29.canSendMessage = Ci.canSendTextMessage;
7862
7885
  return _this29;
@@ -7914,7 +7937,7 @@ var Ci = /*#__PURE__*/function (_zi4) {
7914
7937
  return _context61.abrupt("return", {
7915
7938
  files: e.artifacts.map(function (i) {
7916
7939
  return {
7917
- src: "".concat(ci).concat(i.base64),
7940
+ src: "".concat(di).concat(i.base64),
7918
7941
  type: "image"
7919
7942
  };
7920
7943
  })
@@ -8366,13 +8389,13 @@ var ne = /*#__PURE__*/function () {
8366
8389
  }]);
8367
8390
  }();
8368
8391
  ne.FILES_WITH_TEXT_ERROR = "content with type `text` must have `text` values", ne.FUNCTION_TOOL_RESP_ERROR = "Response must contain an array of strings for each individual function/tool_call, see https://deepchat.dev/docs/directConnection/OpenAI/#assistant-functions.";
8369
- var Me = ne;
8370
- var Ve = /*#__PURE__*/function (_V3) {
8392
+ var ke = ne;
8393
+ var Ve = /*#__PURE__*/function (_K3) {
8371
8394
  // prettier-ignore
8372
8395
  function Ve(e, t, i, s, r, o) {
8373
8396
  var _this31;
8374
8397
  _classCallCheck(this, Ve);
8375
- if (_this31 = _callSuper(this, Ve, [e, s, r, o]), _this31.insertKeyPlaceholderText = "OpenAI API Key", _this31.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this31.url = "", _this31.permittedErrorPrefixes = ["Incorrect", "Please send text", ii.FAILED_ERROR_MESSAGE], _this31.shouldFetchHistory = !1, _this31._searchedForThreadId = !1, _this31._config = {}, _this31._newAssistantDetails = {
8398
+ if (_this31 = _callSuper(this, Ve, [e, s, r, o]), _this31.insertKeyPlaceholderText = "OpenAI API Key", _this31.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this31.url = "", _this31.permittedErrorPrefixes = ["Incorrect", "Please send text", si.FAILED_ERROR_MESSAGE], _this31.shouldFetchHistory = !1, _this31._searchedForThreadId = !1, _this31._config = {}, _this31._newAssistantDetails = {
8376
8399
  model: "gpt-4"
8377
8400
  }, _this31._waitingForStreamResponse = !1, _this31._isSSEStream = !1, _this31.urlSegments = i, _typeof(t) == "object") {
8378
8401
  _this31._config = t;
@@ -8385,7 +8408,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8385
8408
  _this31.maxMessages = 1, _this31._isSSEStream = !!(_this31.stream && (_typeof(_this31.stream) != "object" || !_this31.stream.simulation));
8386
8409
  return _this31;
8387
8410
  }
8388
- _inherits(Ve, _V3);
8411
+ _inherits(Ve, _K3);
8389
8412
  return _createClass(Ve, [{
8390
8413
  key: "fetchHistoryFunc",
8391
8414
  value: function () {
@@ -8425,7 +8448,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8425
8448
  key: "processMessage",
8426
8449
  value: function processMessage(e, t) {
8427
8450
  var i = this.totalMessagesMaxCharLength || -1,
8428
- s = vt.getCharacterLimitMessages(e, i)[0];
8451
+ s = yt.getCharacterLimitMessages(e, i)[0];
8429
8452
  if (t && t.length > 0) {
8430
8453
  var r = this.filesToolType;
8431
8454
  if (typeof this.filesToolType == "function") {
@@ -8439,10 +8462,10 @@ var Ve = /*#__PURE__*/function (_V3) {
8439
8462
  if (r === "code_interpreter") return Ve.processAttachmentsMessage(s, t, "code_interpreter");
8440
8463
  if (t.find(function (_ref21) {
8441
8464
  var a = _ref21.name;
8442
- return !H.isImageFileExtension(a);
8465
+ return !q.isImageFileExtension(a);
8443
8466
  })) console.error("The uploaded files contained a non-image file"), console.error('Make sure only images can be uploaded or define a "code_interpreter" or "file_search" value in the "files_tool_type" property'), console.warn('Make sure your existing assistant supports these "tools" or specify them in the "new_assistant" property');else {
8444
- var _a2 = Ve.processImageMessage(s, t);
8445
- if (_a2) return _a2;
8467
+ var _a3 = Ve.processImageMessage(s, t);
8468
+ if (_a3) return _a3;
8446
8469
  }
8447
8470
  }
8448
8471
  return {
@@ -8513,7 +8536,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8513
8536
  break;
8514
8537
  }
8515
8538
  _context74.next = 16;
8516
- return Me.storeFiles(this, e, i, this.urlSegments.storeFiles);
8539
+ return ke.storeFiles(this, e, i, this.urlSegments.storeFiles);
8517
8540
  case 16:
8518
8541
  _context74.t1 = _context74.sent;
8519
8542
  _context74.next = 20;
@@ -8596,7 +8619,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8596
8619
  _context76.next = 6;
8597
8620
  break;
8598
8621
  }
8599
- throw e.error.message.startsWith(Me.FILES_WITH_TEXT_ERROR) ? Error("Please send text with your file(s)") : e.error.message;
8622
+ throw e.error.message.startsWith(ke.FILES_WITH_TEXT_ERROR) ? Error("Please send text with your file(s)") : e.error.message;
8600
8623
  case 6:
8601
8624
  _context76.next = 8;
8602
8625
  return this.assignThreadAndRun(e);
@@ -8680,7 +8703,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8680
8703
  case 9:
8681
8704
  i = _context78.sent;
8682
8705
  case 10:
8683
- return _context78.abrupt("return", Me.processAPIMessages(this, i, t, this.urlSegments));
8706
+ return _context78.abrupt("return", ke.processAPIMessages(this, i, t, this.urlSegments));
8684
8707
  case 11:
8685
8708
  case "end":
8686
8709
  return _context78.stop();
@@ -8781,7 +8804,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8781
8804
  _context80.next = 8;
8782
8805
  break;
8783
8806
  }
8784
- throw Error(Me.FUNCTION_TOOL_RESP_ERROR);
8807
+ throw Error(ke.FUNCTION_TOOL_RESP_ERROR);
8785
8808
  case 8:
8786
8809
  _context80.next = 10;
8787
8810
  return Promise.all(i);
@@ -8793,7 +8816,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8793
8816
  _context80.next = 13;
8794
8817
  break;
8795
8818
  }
8796
- throw Error(Me.FUNCTION_TOOL_RESP_ERROR);
8819
+ throw Error(ke.FUNCTION_TOOL_RESP_ERROR);
8797
8820
  case 13:
8798
8821
  r = s.map(function (l, c) {
8799
8822
  return {
@@ -8881,7 +8904,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8881
8904
  key: "parseStreamResult",
8882
8905
  value: function () {
8883
8906
  var _parseStreamResult = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(e) {
8884
- var t, i, s, r, o, a, l, c, _a3, _l2;
8907
+ var t, i, s, r, o, a, l, c, _a4, _l2;
8885
8908
  return _regeneratorRuntime().wrap(function _callee82$(_context82) {
8886
8909
  while (1) switch (_context82.prev = _context82.next) {
8887
8910
  case 0:
@@ -8898,7 +8921,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8898
8921
  }
8899
8922
  l = e.content.find(function (d) {
8900
8923
  return !!d.text;
8901
- }) || e.content[0], c = Me.getFilesAndText.bind(this, this, {
8924
+ }) || e.content[0], c = ke.getFilesAndText.bind(this, this, {
8902
8925
  role: "assistant",
8903
8926
  content: e.content
8904
8927
  }, this.urlSegments, l);
@@ -8914,15 +8937,15 @@ var Ve = /*#__PURE__*/function (_V3) {
8914
8937
  _context82.next = 13;
8915
8938
  break;
8916
8939
  }
8917
- _a3 = e.delta.content.find(function (l) {
8940
+ _a4 = e.delta.content.find(function (l) {
8918
8941
  return l.text;
8919
8942
  });
8920
- if (!((r = _a3 == null ? void 0 : _a3.text) != null && r.annotations && _a3.text.annotations.length === 0)) {
8943
+ if (!((r = _a4 == null ? void 0 : _a4.text) != null && r.annotations && _a4.text.annotations.length === 0)) {
8921
8944
  _context82.next = 13;
8922
8945
  break;
8923
8946
  }
8924
8947
  _context82.next = 11;
8925
- return Me.processStreamMessages(this, e.delta.content, this.urlSegments);
8948
+ return ke.processStreamMessages(this, e.delta.content, this.urlSegments);
8926
8949
  case 11:
8927
8950
  _l2 = _context82.sent;
8928
8951
  return _context82.abrupt("return", {
@@ -8977,7 +9000,7 @@ var Ve = /*#__PURE__*/function (_V3) {
8977
9000
  key: "processImageMessage",
8978
9001
  value: function processImageMessage(e, t) {
8979
9002
  var i = t == null ? void 0 : t.filter(function (s) {
8980
- return H.isImageFileExtension(s.name);
9003
+ return q.isImageFileExtension(s.name);
8981
9004
  }).map(function (s) {
8982
9005
  return {
8983
9006
  type: "image_file",
@@ -9014,7 +9037,7 @@ var Ve = /*#__PURE__*/function (_V3) {
9014
9037
  };
9015
9038
  }
9016
9039
  }]);
9017
- }(V);
9040
+ }(K);
9018
9041
  Ve.POLLING_TIMEOUT_MS = 500;
9019
9042
  var Ri = Ve;
9020
9043
  var xs = /*#__PURE__*/function (_Ri) {
@@ -9087,16 +9110,16 @@ var Mi = /*#__PURE__*/function () {
9087
9110
  }
9088
9111
  }]);
9089
9112
  }();
9090
- var ws = /*#__PURE__*/function (_V4) {
9113
+ var ws = /*#__PURE__*/function (_K4) {
9091
9114
  function ws(e, t, i, s, r) {
9092
9115
  var _this35;
9093
9116
  _classCallCheck(this, ws);
9094
9117
  _this35 = _callSuper(this, ws, [e, Mi.buildKeyVerificationDetails(), Mi.buildHeaders, r]), _this35.insertKeyPlaceholderText = "Cohere API Key", _this35.keyHelpUrl = "https://dashboard.cohere.ai/api-keys", _this35.permittedErrorPrefixes = ["invalid"], _this35.url = t, _this35.textInputPlaceholderText = i, s && _typeof(s) == "object" && Object.assign(_this35.rawBody, s);
9095
9118
  return _this35;
9096
9119
  }
9097
- _inherits(ws, _V4);
9120
+ _inherits(ws, _K4);
9098
9121
  return _createClass(ws);
9099
- }(V);
9122
+ }(K);
9100
9123
  var Xo = /*#__PURE__*/function (_ws) {
9101
9124
  function Xo(e) {
9102
9125
  _classCallCheck(this, Xo);
@@ -9205,11 +9228,11 @@ var Is = /*#__PURE__*/function () {
9205
9228
  }();
9206
9229
  Is.URL_DETAILS_ERROR_MESSAGE = "Please define the Azure URL Details. [More Information](https://deepchat.dev/docs/directConnection/Azure)";
9207
9230
  var ue = Is;
9208
- var pt = /*#__PURE__*/function (_Ri2) {
9209
- function pt(e) {
9231
+ var mt = /*#__PURE__*/function (_Ri2) {
9232
+ function mt(e) {
9210
9233
  var _g$headers;
9211
9234
  var _this36;
9212
- _classCallCheck(this, pt);
9235
+ _classCallCheck(this, mt);
9213
9236
  var c, d, u, h, f, m, p, g;
9214
9237
  var t = JSON.parse(JSON.stringify(e.directConnection)),
9215
9238
  i = t.azure,
@@ -9218,16 +9241,16 @@ var pt = /*#__PURE__*/function (_Ri2) {
9218
9241
  o = "".concat((d = s == null ? void 0 : s.urlDetails) == null ? void 0 : d.endpoint, "/openai/"),
9219
9242
  a = "?api-version=".concat((u = s == null ? void 0 : s.urlDetails) == null ? void 0 : u.version),
9220
9243
  l = {
9221
- threadsPrefix: "".concat(o).concat(pt.THREAD_RESOURCE),
9244
+ threadsPrefix: "".concat(o).concat(mt.THREAD_RESOURCE),
9222
9245
  threadsPosfix: a,
9223
- newAssistantUrl: "".concat(o).concat(pt.NEW_ASSISTANT_RESOURCE).concat(a),
9246
+ newAssistantUrl: "".concat(o).concat(mt.NEW_ASSISTANT_RESOURCE).concat(a),
9224
9247
  createMessagePostfix: a,
9225
9248
  listMessagesPostfix: "order=desc&api-version=".concat((h = s == null ? void 0 : s.urlDetails) == null ? void 0 : h.version),
9226
9249
  storeFiles: "".concat(o, "files").concat(a),
9227
9250
  getFilesPrefix: "".concat(o, "files/"),
9228
9251
  getFilesPostfix: "/content".concat(a)
9229
9252
  };
9230
- if (_this36 = _callSuper(this, pt, [e, s == null ? void 0 : s.assistant, l, ue.buildKeyVerificationDetails(r), ue.buildHeaders, i]), _this36.permittedErrorPrefixes = [ue.URL_DETAILS_ERROR_MESSAGE], _this36.insertKeyPlaceholderText = "Azure OpenAI API Key", _this36.keyHelpUrl = "https://learn.microsoft.com/en-us/answers/questions/1193991/how-to-get-the-value-of-openai-api-key", _this36.isTextInputDisabled = !1, _typeof(s == null ? void 0 : s.assistant) == "object") {
9253
+ if (_this36 = _callSuper(this, mt, [e, s == null ? void 0 : s.assistant, l, ue.buildKeyVerificationDetails(r), ue.buildHeaders, i]), _this36.permittedErrorPrefixes = [ue.URL_DETAILS_ERROR_MESSAGE], _this36.insertKeyPlaceholderText = "Azure OpenAI API Key", _this36.keyHelpUrl = "https://learn.microsoft.com/en-us/answers/questions/1193991/how-to-get-the-value-of-openai-api-key", _this36.isTextInputDisabled = !1, _typeof(s == null ? void 0 : s.assistant) == "object") {
9231
9254
  var _ref25 = (p = (m = (f = e.directConnection) == null ? void 0 : f.azure) == null ? void 0 : m.openAI) == null ? void 0 : p.assistant,
9232
9255
  b = _ref25.function_handler,
9233
9256
  M = _ref25.files_tool_type;
@@ -9242,11 +9265,11 @@ var pt = /*#__PURE__*/function (_Ri2) {
9242
9265
  }));
9243
9266
  return _this36;
9244
9267
  }
9245
- _inherits(pt, _Ri2);
9246
- return _createClass(pt);
9268
+ _inherits(mt, _Ri2);
9269
+ return _createClass(mt);
9247
9270
  }(Ri);
9248
- pt.THREAD_RESOURCE = "threads", pt.NEW_ASSISTANT_RESOURCE = "assistants";
9249
- var as = pt;
9271
+ mt.THREAD_RESOURCE = "threads", mt.NEW_ASSISTANT_RESOURCE = "assistants";
9272
+ var as = mt;
9250
9273
  var Yo = /*#__PURE__*/function (_ws2) {
9251
9274
  function Yo(e) {
9252
9275
  _classCallCheck(this, Yo);
@@ -9393,12 +9416,12 @@ var On = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg height=\"1.4em\"
9393
9416
  }]);
9394
9417
  }();
9395
9418
  re.INPUT_BUTTON_SVG_TEXT_CLASS = "input-button-svg-text", re.INPUT_BUTTON_INNER_TEXT_CLASS = "text-button", re.INPUT_BUTTON_SVG_CLASS = "input-button-svg";
9396
- var Ae = re;
9397
- var Gt = /*#__PURE__*/function () {
9398
- function Gt() {
9399
- _classCallCheck(this, Gt);
9419
+ var Te = re;
9420
+ var Vt = /*#__PURE__*/function () {
9421
+ function Vt() {
9422
+ _classCallCheck(this, Vt);
9400
9423
  }
9401
- return _createClass(Gt, null, [{
9424
+ return _createClass(Vt, null, [{
9402
9425
  key: "parseSVGTextElements",
9403
9426
  value: function parseSVGTextElements(e) {
9404
9427
  return {
@@ -9421,9 +9444,9 @@ var D = /*#__PURE__*/function () {
9421
9444
  value: function unsetAllCSS(e, t) {
9422
9445
  var r, o;
9423
9446
  t.container && I.unsetAllCSSMouseStates(e, t.container);
9424
- var _Gt$parseSVGTextEleme = Gt.parseSVGTextElements(Array.from(e.children)),
9425
- i = _Gt$parseSVGTextEleme.svg,
9426
- s = _Gt$parseSVGTextEleme.text;
9447
+ var _Vt$parseSVGTextEleme = Vt.parseSVGTextElements(Array.from(e.children)),
9448
+ i = _Vt$parseSVGTextEleme.svg,
9449
+ s = _Vt$parseSVGTextEleme.text;
9427
9450
  (r = t.svg) != null && r.styles && i && I.unsetAllCSSMouseStates(i, t.svg.styles), (o = t.text) != null && o.styles && s && I.unsetAllCSSMouseStates(s, t.text.styles);
9428
9451
  }
9429
9452
  }, {
@@ -9431,9 +9454,9 @@ var D = /*#__PURE__*/function () {
9431
9454
  value: function unsetActionCSS(e, t) {
9432
9455
  var r, o;
9433
9456
  t.container && I.unsetActivityCSSMouseStates(e, t.container);
9434
- var _Gt$parseSVGTextEleme2 = Gt.parseSVGTextElements(Array.from(e.children)),
9435
- i = _Gt$parseSVGTextEleme2.svg,
9436
- s = _Gt$parseSVGTextEleme2.text;
9457
+ var _Vt$parseSVGTextEleme2 = Vt.parseSVGTextElements(Array.from(e.children)),
9458
+ i = _Vt$parseSVGTextEleme2.svg,
9459
+ s = _Vt$parseSVGTextEleme2.text;
9437
9460
  (r = t.svg) != null && r.styles && i && I.unsetActivityCSSMouseStates(i, t.svg.styles), (o = t.text) != null && o.styles && s && I.unsetActivityCSSMouseStates(s, t.text.styles);
9438
9461
  }
9439
9462
  }, {
@@ -9441,9 +9464,9 @@ var D = /*#__PURE__*/function () {
9441
9464
  value: function setElementsCSS(e, t, i) {
9442
9465
  var o, a, l, c, d;
9443
9466
  Object.assign(e.style, (o = t.container) == null ? void 0 : o[i]);
9444
- var _Gt$parseSVGTextEleme3 = Gt.parseSVGTextElements(Array.from(e.children)),
9445
- s = _Gt$parseSVGTextEleme3.svg,
9446
- r = _Gt$parseSVGTextEleme3.text;
9467
+ var _Vt$parseSVGTextEleme3 = Vt.parseSVGTextElements(Array.from(e.children)),
9468
+ s = _Vt$parseSVGTextEleme3.svg,
9469
+ r = _Vt$parseSVGTextEleme3.text;
9447
9470
  s && Object.assign(s.style, (l = (a = t.svg) == null ? void 0 : a.styles) == null ? void 0 : l[i]), r && Object.assign(r.style, (d = (c = t.text) == null ? void 0 : c.styles) == null ? void 0 : d[i]);
9448
9471
  }
9449
9472
  }, {
@@ -9507,7 +9530,7 @@ var ct = /*#__PURE__*/function () {
9507
9530
  key: "changeElementsByState",
9508
9531
  value: function changeElementsByState(e) {
9509
9532
  var _this$elementRef;
9510
- (_this$elementRef = this.elementRef).replaceChildren.apply(_this$elementRef, _toConsumableArray(e)), Ae.reassignClassBasedOnChildren(this.elementRef, e);
9533
+ (_this$elementRef = this.elementRef).replaceChildren.apply(_this$elementRef, _toConsumableArray(e)), Te.reassignClassBasedOnChildren(this.elementRef, e);
9511
9534
  }
9512
9535
  }, {
9513
9536
  key: "buildDefaultIconElement",
@@ -9518,7 +9541,7 @@ var ct = /*#__PURE__*/function () {
9518
9541
  }, {
9519
9542
  key: "createInnerElements",
9520
9543
  value: function createInnerElements(e, t, i) {
9521
- var s = Ae.createCustomElements(t, this.svg, i);
9544
+ var s = Te.createCustomElements(t, this.svg, i);
9522
9545
  if (s && s.length > 0) {
9523
9546
  if (this.position === "dropup-menu") {
9524
9547
  var r = this.svg.cloneNode(!0);
@@ -9552,12 +9575,12 @@ var Ui = /*#__PURE__*/function (_ct) {
9552
9575
  }, {
9553
9576
  key: "createInnerButtonElements",
9554
9577
  value: function createInnerButtonElements(e, t) {
9555
- return Ae.createCustomElements(e, this.svg, t) || [this.svg];
9578
+ return Te.createCustomElements(e, this.svg, t) || [this.svg];
9556
9579
  }
9557
9580
  }, {
9558
9581
  key: "changeState",
9559
9582
  value: function changeState(e) {
9560
- this.changeElementsByState(e), this.elementRef.classList.replace(Ae.INPUT_BUTTON_SVG_CLASS, "deep-chat-openai-realtime-button");
9583
+ this.changeElementsByState(e), this.elementRef.classList.replace(Te.INPUT_BUTTON_SVG_CLASS, "deep-chat-openai-realtime-button");
9561
9584
  }
9562
9585
  }, {
9563
9586
  key: "changeToActive",
@@ -9639,7 +9662,7 @@ ji.SESSION_STARTED = "sts-session-started", ji.SESSION_STOPPED = "sts-session-st
9639
9662
  var Li = ji;
9640
9663
  var Pn = "<?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 <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>",
9641
9664
  ls = "<?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<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>",
9642
- C = /*#__PURE__*/function (_V5) {
9665
+ C = /*#__PURE__*/function (_K5) {
9643
9666
  function C(e) {
9644
9667
  var _l$model;
9645
9668
  var _this38;
@@ -9661,7 +9684,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
9661
9684
  (_l$model = (l = _this38.rawBody).model) !== null && _l$model !== void 0 ? _l$model : l.model = "gpt-4o-realtime-preview-2024-12-17", _this38._avatarConfig = C.buildAvatarConfig(s), _this38._buttonsConfig = C.buildButtonsConfig(s), _this38._avatarEl = C.createAvatar(_this38._avatarConfig), _this38._containerEl = _this38.createContainer(), _this38._deepChat = e;
9662
9685
  return _this38;
9663
9686
  }
9664
- _inherits(C, _V5);
9687
+ _inherits(C, _K5);
9665
9688
  return _createClass(C, [{
9666
9689
  key: "setUpView",
9667
9690
  value:
@@ -10351,24 +10374,24 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
10351
10374
  N.removeAriaDisabled(e.elementRef), e.elementRef.classList.remove(C.UNAVAILABLE);
10352
10375
  }
10353
10376
  }]);
10354
- }(V);
10377
+ }(K);
10355
10378
  C.BUTTON_DEFAULT = "deep-chat-openai-realtime-button-default", C.BUTTON_LOADING = "deep-chat-openai-realtime-button-loading", C.MICROPHONE_ACTIVE = "deep-chat-openai-realtime-microphone-active", C.UNAVAILABLE = "deep-chat-openai-realtime-button-unavailable";
10356
10379
  var cs = C;
10357
- var mt = /*#__PURE__*/function (_V6) {
10358
- function mt(e) {
10380
+ var gt = /*#__PURE__*/function (_K6) {
10381
+ function gt(e) {
10359
10382
  var _o$model, _a$voice;
10360
10383
  var _this44;
10361
- _classCallCheck(this, mt);
10384
+ _classCallCheck(this, gt);
10362
10385
  var r, o, a;
10363
10386
  var t = JSON.parse(JSON.stringify(e.directConnection)),
10364
10387
  i = t == null ? void 0 : t.openAI;
10365
- _this44 = _callSuper(this, mt, [e, L.buildKeyVerificationDetails(), L.buildHeaders, i]), _this44.insertKeyPlaceholderText = "OpenAI API Key", _this44.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this44.url = "https://api.openai.com/v1/audio/speech", _this44.permittedErrorPrefixes = ["Invalid"], _this44.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Text To Speech</b></div>\n <p>Generate an audio file based on your text input.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/text-to-speech\">here</a> for more information.</p>";
10388
+ _this44 = _callSuper(this, gt, [e, L.buildKeyVerificationDetails(), L.buildHeaders, i]), _this44.insertKeyPlaceholderText = "OpenAI API Key", _this44.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this44.url = "https://api.openai.com/v1/audio/speech", _this44.permittedErrorPrefixes = ["Invalid"], _this44.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Text To Speech</b></div>\n <p>Generate an audio file based on your text input.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/text-to-speech\">here</a> for more information.</p>";
10366
10389
  var s = (r = t == null ? void 0 : t.openAI) == null ? void 0 : r.textToSpeech;
10367
- _typeof(s) == "object" && Object.assign(_this44.rawBody, s), (_o$model = (o = _this44.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model = mt.DEFAULT_MODEL, (_a$voice = (a = _this44.rawBody).voice) !== null && _a$voice !== void 0 ? _a$voice : a.voice = mt.DEFAULT_VOIDE, _this44.textInputPlaceholderText = "Insert text to generate audio", _this44.rawBody.response_format = "mp3";
10390
+ _typeof(s) == "object" && Object.assign(_this44.rawBody, s), (_o$model = (o = _this44.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model = gt.DEFAULT_MODEL, (_a$voice = (a = _this44.rawBody).voice) !== null && _a$voice !== void 0 ? _a$voice : a.voice = gt.DEFAULT_VOIDE, _this44.textInputPlaceholderText = "Insert text to generate audio", _this44.rawBody.response_format = "mp3";
10368
10391
  return _this44;
10369
10392
  }
10370
- _inherits(mt, _V6);
10371
- return _createClass(mt, [{
10393
+ _inherits(gt, _K6);
10394
+ return _createClass(gt, [{
10372
10395
  key: "preprocessBody",
10373
10396
  value: function preprocessBody(e, t) {
10374
10397
  var r, o;
@@ -10448,29 +10471,29 @@ var mt = /*#__PURE__*/function (_V6) {
10448
10471
  return extractResultData;
10449
10472
  }()
10450
10473
  }]);
10451
- }(V);
10452
- mt.DEFAULT_MODEL = "tts-1", mt.DEFAULT_VOIDE = "alloy";
10453
- var ds = mt;
10454
- var pe = /*#__PURE__*/function (_V7) {
10455
- function pe(e) {
10474
+ }(K);
10475
+ gt.DEFAULT_MODEL = "tts-1", gt.DEFAULT_VOIDE = "alloy";
10476
+ var ds = gt;
10477
+ var me = /*#__PURE__*/function (_K7) {
10478
+ function me(e) {
10456
10479
  var _o$model2;
10457
10480
  var _this45;
10458
- _classCallCheck(this, pe);
10481
+ _classCallCheck(this, me);
10459
10482
  var r, o;
10460
10483
  var t = JSON.parse(JSON.stringify(e.directConnection)),
10461
10484
  i = t == null ? void 0 : t.openAI;
10462
- _this45 = _callSuper(this, pe, [e, L.buildKeyVerificationDetails(), L.buildHeaders, i, {
10485
+ _this45 = _callSuper(this, me, [e, L.buildKeyVerificationDetails(), L.buildHeaders, i, {
10463
10486
  audio: {}
10464
- }]), _this45.insertKeyPlaceholderText = "OpenAI API Key", _this45.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this45.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Speech To Text</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/guides/speech-to-text\">here</a> for more info.</p>", _this45.url = "", _this45.permittedErrorPrefixes = ["Invalid"], _this45.textInputPlaceholderText = "Upload an audio file", _this45._service_url = pe.AUDIO_TRANSCRIPTIONS_URL;
10487
+ }]), _this45.insertKeyPlaceholderText = "OpenAI API Key", _this45.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this45.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Speech To Text</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/guides/speech-to-text\">here</a> for more info.</p>", _this45.url = "", _this45.permittedErrorPrefixes = ["Invalid"], _this45.textInputPlaceholderText = "Upload an audio file", _this45._service_url = me.AUDIO_TRANSCRIPTIONS_URL;
10465
10488
  var s = (r = t == null ? void 0 : t.openAI) == null ? void 0 : r.audio;
10466
- _typeof(s) == "object" && (_this45.processConfig(s), pe.cleanConfig(s), Object.assign(_this45.rawBody, s)), (_o$model2 = (o = _this45.rawBody).model) !== null && _o$model2 !== void 0 ? _o$model2 : o.model = pe.DEFAULT_MODEL, _this45.rawBody.response_format = "json", _this45.canSendMessage = pe.canSendFileMessage;
10489
+ _typeof(s) == "object" && (_this45.processConfig(s), me.cleanConfig(s), Object.assign(_this45.rawBody, s)), (_o$model2 = (o = _this45.rawBody).model) !== null && _o$model2 !== void 0 ? _o$model2 : o.model = me.DEFAULT_MODEL, _this45.rawBody.response_format = "json", _this45.canSendMessage = me.canSendFileMessage;
10467
10490
  return _this45;
10468
10491
  }
10469
- _inherits(pe, _V7);
10470
- return _createClass(pe, [{
10492
+ _inherits(me, _K7);
10493
+ return _createClass(me, [{
10471
10494
  key: "processConfig",
10472
10495
  value: function processConfig(e) {
10473
- e != null && e.type && e.type === "translation" && (this._service_url = pe.AUDIO_TRANSLATIONS_URL, delete e.language);
10496
+ e != null && e.type && e.type === "translation" && (this._service_url = me.AUDIO_TRANSLATIONS_URL, delete e.language);
10474
10497
  }
10475
10498
  }, {
10476
10499
  key: "preprocessBody",
@@ -10502,7 +10525,7 @@ var pe = /*#__PURE__*/function (_V7) {
10502
10525
  throw new Error("No file was added");
10503
10526
  case 4:
10504
10527
  this.url = this.connectSettings.url || this._service_url;
10505
- s = this.preprocessBody(this.rawBody, t), r = pe.createFormDataBody(s, i[0]);
10528
+ s = this.preprocessBody(this.rawBody, t), r = me.createFormDataBody(s, i[0]);
10506
10529
  E.tempRemoveContentHeader(this.connectSettings, R.request.bind(this, this, r, e), !1);
10507
10530
  case 7:
10508
10531
  case "end":
@@ -10561,9 +10584,9 @@ var pe = /*#__PURE__*/function (_V7) {
10561
10584
  }), i;
10562
10585
  }
10563
10586
  }]);
10564
- }(V);
10565
- pe.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions", pe.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations", pe.DEFAULT_MODEL = "whisper-1";
10566
- var hs = pe;
10587
+ }(K);
10588
+ me.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions", me.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations", me.DEFAULT_MODEL = "whisper-1";
10589
+ var hs = me;
10567
10590
  var fe = /*#__PURE__*/function () {
10568
10591
  function fe() {
10569
10592
  _classCallCheck(this, fe);
@@ -10665,7 +10688,7 @@ var fe = /*#__PURE__*/function () {
10665
10688
  }
10666
10689
  }]);
10667
10690
  }();
10668
- var Zo = /*#__PURE__*/function (_V8) {
10691
+ var Zo = /*#__PURE__*/function (_K8) {
10669
10692
  // prettier-ignore
10670
10693
  function Zo(e, t, i, s, r) {
10671
10694
  var _this46;
@@ -10675,9 +10698,9 @@ var Zo = /*#__PURE__*/function (_V8) {
10675
10698
  "https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this46.permittedErrorPrefixes = ["Access"];
10676
10699
  return _this46;
10677
10700
  }
10678
- _inherits(Zo, _V8);
10701
+ _inherits(Zo, _K8);
10679
10702
  return _createClass(Zo);
10680
- }(V);
10703
+ }(K);
10681
10704
  var Yt = /*#__PURE__*/function (_Zo) {
10682
10705
  function Yt(e) {
10683
10706
  var _a$language;
@@ -10841,11 +10864,11 @@ Yt.ENDPOINT_ERROR_MESSAGE =
10841
10864
  // eslint-disable-next-line max-len
10842
10865
  "Please define the azure endpoint. [More Information](https://deepchat.dev/docs/directConnection/Azure#Summarization)";
10843
10866
  var us = Yt;
10844
- var Vt = /*#__PURE__*/function () {
10845
- function Vt() {
10846
- _classCallCheck(this, Vt);
10867
+ var Kt = /*#__PURE__*/function () {
10868
+ function Kt() {
10869
+ _classCallCheck(this, Kt);
10847
10870
  }
10848
- return _createClass(Vt, null, [{
10871
+ return _createClass(Kt, null, [{
10849
10872
  key: "poll",
10850
10873
  value: function () {
10851
10874
  var _poll2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee103(e, t) {
@@ -10941,23 +10964,23 @@ var Vt = /*#__PURE__*/function () {
10941
10964
  return {
10942
10965
  url: "https://api.assemblyai.com/v2/upload",
10943
10966
  method: "POST",
10944
- handleVerificationResult: Vt.handleVerificationResult
10967
+ handleVerificationResult: Kt.handleVerificationResult
10945
10968
  };
10946
10969
  }
10947
10970
  }]);
10948
10971
  }();
10949
- var As = /*#__PURE__*/function (_V9) {
10972
+ var As = /*#__PURE__*/function (_K9) {
10950
10973
  function As(e) {
10951
10974
  var _this48;
10952
10975
  _classCallCheck(this, As);
10953
10976
  var i;
10954
10977
  var t = (i = e.directConnection) == null ? void 0 : i.assemblyAI;
10955
- _this48 = _callSuper(this, As, [e, Vt.buildKeyVerificationDetails(), Vt.buildHeaders, t, {
10978
+ _this48 = _callSuper(this, As, [e, Kt.buildKeyVerificationDetails(), Kt.buildHeaders, t, {
10956
10979
  audio: {}
10957
10980
  }]), _this48.insertKeyPlaceholderText = "AssemblyAI API Key", _this48.keyHelpUrl = "https://www.assemblyai.com/app/account", _this48.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>AssemblyAI Audio</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"https://www.assemblyai.com/docs/Guides/transcribing_an_audio_file#get-started\">here</a> for more info.\n </p>", _this48.url = "https://api.assemblyai.com/v2/upload", _this48.isTextInputDisabled = !0, _this48.textInputPlaceholderText = "Upload an audio file", _this48.permittedErrorPrefixes = ["Authentication", "Invalid"], _this48.canSendMessage = As.canFileSendMessage;
10958
10981
  return _this48;
10959
10982
  }
10960
- _inherits(As, _V9);
10983
+ _inherits(As, _K9);
10961
10984
  return _createClass(As, [{
10962
10985
  key: "callServiceAPI",
10963
10986
  value: function () {
@@ -11006,7 +11029,7 @@ var As = /*#__PURE__*/function (_V9) {
11006
11029
  case 2:
11007
11030
  t = (r = (s = this.connectSettings) == null ? void 0 : s.headers) == null ? void 0 : r.Authorization;
11008
11031
  _context105.next = 5;
11009
- return Vt.poll(t, e.upload_url);
11032
+ return Kt.poll(t, e.upload_url);
11010
11033
  case 5:
11011
11034
  _context105.t0 = _context105.sent.text;
11012
11035
  return _context105.abrupt("return", {
@@ -11029,8 +11052,8 @@ var As = /*#__PURE__*/function (_V9) {
11029
11052
  return !!(t != null && t[0]);
11030
11053
  }
11031
11054
  }]);
11032
- }(V);
11033
- var Nn = /*#__PURE__*/function (_V0) {
11055
+ }(K);
11056
+ var Nn = /*#__PURE__*/function (_K0) {
11034
11057
  // prettier-ignore
11035
11058
  function Nn(e, t, i, s, r) {
11036
11059
  var _this49;
@@ -11040,9 +11063,9 @@ var Nn = /*#__PURE__*/function (_V0) {
11040
11063
  "https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal";
11041
11064
  return _this49;
11042
11065
  }
11043
- _inherits(Nn, _V0);
11066
+ _inherits(Nn, _K0);
11044
11067
  return _createClass(Nn);
11045
- }(V);
11068
+ }(K);
11046
11069
  var Qe = /*#__PURE__*/function (_Nn) {
11047
11070
  // prettier-ignore
11048
11071
  function Qe(e) {
@@ -11232,7 +11255,7 @@ Ke.HELP_LINK =
11232
11255
  // eslint-disable-next-line max-len
11233
11256
  "Please define a region config property. [More Information](https://deepchat.dev/docs/directConnection/Azure#SpeechToText)";
11234
11257
  var ps = Ke;
11235
- var Qo = /*#__PURE__*/function (_V1) {
11258
+ var Qo = /*#__PURE__*/function (_K1) {
11236
11259
  // prettier-ignore
11237
11260
  function Qo(e) {
11238
11261
  var _this52;
@@ -11245,7 +11268,7 @@ var Qo = /*#__PURE__*/function (_V1) {
11245
11268
  "https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this52.url = "", _this52.url = "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=".concat(t.language || "es");
11246
11269
  return _this52;
11247
11270
  }
11248
- _inherits(Qo, _V1);
11271
+ _inherits(Qo, _K1);
11249
11272
  return _createClass(Qo, [{
11250
11273
  key: "preprocessBody",
11251
11274
  value: function preprocessBody(e) {
@@ -11310,30 +11333,30 @@ var Qo = /*#__PURE__*/function (_V1) {
11310
11333
  return extractResultData;
11311
11334
  }()
11312
11335
  }]);
11313
- }(V);
11314
- var bt = /*#__PURE__*/function (_V10) {
11336
+ }(K);
11337
+ var vt = /*#__PURE__*/function (_K10) {
11315
11338
  // prettier-ignore
11316
- function bt(e, t, i, s, r) {
11339
+ function vt(e, t, i, s, r) {
11317
11340
  var _this53$maxMessages, _p$model;
11318
11341
  var _this53;
11319
- _classCallCheck(this, bt);
11342
+ _classCallCheck(this, vt);
11320
11343
  var u, h, f, m, p;
11321
11344
  var o = JSON.parse(JSON.stringify(e.directConnection)),
11322
11345
  a = t || L.buildKeyVerificationDetails(),
11323
11346
  l = i || L.buildHeaders,
11324
11347
  c = s || o.openAI;
11325
- _this53 = _callSuper(this, bt, [e, a, l, c]), _this53.insertKeyPlaceholderText = "OpenAI API Key", _this53.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this53.url = "https://api.openai.com/v1/chat/completions", _this53.permittedErrorPrefixes = ["Incorrect"], _this53.asyncCallInProgress = !1, _this53._systemMessage = bt.generateSystemMessage("You are a helpful assistant.");
11348
+ _this53 = _callSuper(this, vt, [e, a, l, c]), _this53.insertKeyPlaceholderText = "OpenAI API Key", _this53.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this53.url = "https://api.openai.com/v1/chat/completions", _this53.permittedErrorPrefixes = ["Incorrect"], _this53.asyncCallInProgress = !1, _this53._systemMessage = vt.generateSystemMessage("You are a helpful assistant.");
11326
11349
  var d = r || ((u = o.openAI) == null ? void 0 : u.chat);
11327
11350
  if (_typeof(d) == "object") {
11328
- d.system_prompt && (_this53._systemMessage = bt.generateSystemMessage(d.system_prompt));
11351
+ d.system_prompt && (_this53._systemMessage = vt.generateSystemMessage(d.system_prompt));
11329
11352
  var g = (m = (f = (h = e.directConnection) == null ? void 0 : h.openAI) == null ? void 0 : f.chat) == null ? void 0 : m.function_handler;
11330
11353
  g && (_this53._functionHandler = g), _this53.cleanConfig(d), Object.assign(_this53.rawBody, d);
11331
11354
  }
11332
11355
  (_this53$maxMessages = _this53.maxMessages) !== null && _this53$maxMessages !== void 0 ? _this53$maxMessages : _this53.maxMessages = -1, (_p$model = (p = _this53.rawBody).model) !== null && _p$model !== void 0 ? _p$model : p.model = "gpt-4o";
11333
11356
  return _this53;
11334
11357
  }
11335
- _inherits(bt, _V10);
11336
- return _createClass(bt, [{
11358
+ _inherits(vt, _K10);
11359
+ return _createClass(vt, [{
11337
11360
  key: "cleanConfig",
11338
11361
  value: function cleanConfig(e) {
11339
11362
  delete e.system_prompt, delete e.function_handler;
@@ -11345,9 +11368,9 @@ var bt = /*#__PURE__*/function (_V10) {
11345
11368
  function preprocessBody(e, t) {
11346
11369
  var _i$max_tokens;
11347
11370
  var i = JSON.parse(JSON.stringify(e)),
11348
- s = vt.getCharacterLimitMessages(t, this.totalMessagesMaxCharLength ? this.totalMessagesMaxCharLength - this._systemMessage.content.length : -1).map(function (r) {
11371
+ s = yt.getCharacterLimitMessages(t, this.totalMessagesMaxCharLength ? this.totalMessagesMaxCharLength - this._systemMessage.content.length : -1).map(function (r) {
11349
11372
  return {
11350
- content: bt.getContent(r),
11373
+ content: vt.getContent(r),
11351
11374
  role: r.role === y.USER_ROLE ? "user" : "assistant"
11352
11375
  };
11353
11376
  });
@@ -11604,8 +11627,8 @@ var bt = /*#__PURE__*/function (_V10) {
11604
11627
  return e.text;
11605
11628
  }
11606
11629
  }]);
11607
- }(V);
11608
- var Ts = /*#__PURE__*/function (_bt) {
11630
+ }(K);
11631
+ var Ts = /*#__PURE__*/function (_vt) {
11609
11632
  function Ts(e) {
11610
11633
  var _this55;
11611
11634
  _classCallCheck(this, Ts);
@@ -11628,7 +11651,7 @@ var Ts = /*#__PURE__*/function (_bt) {
11628
11651
  }));
11629
11652
  return _this55;
11630
11653
  }
11631
- _inherits(Ts, _bt);
11654
+ _inherits(Ts, _vt);
11632
11655
  return _createClass(Ts, null, [{
11633
11656
  key: "buildURL",
11634
11657
  value: function buildURL(e) {
@@ -11638,11 +11661,11 @@ var Ts = /*#__PURE__*/function (_bt) {
11638
11661
  return "".concat(t, "/openai/deployments/").concat(i, "/completions?api-version=").concat(s);
11639
11662
  }
11640
11663
  }]);
11641
- }(bt);
11642
- var me = /*#__PURE__*/function (_V11) {
11643
- function me(e) {
11664
+ }(vt);
11665
+ var ge = /*#__PURE__*/function (_K11) {
11666
+ function ge(e) {
11644
11667
  var _this56;
11645
- _classCallCheck(this, me);
11668
+ _classCallCheck(this, ge);
11646
11669
  var o;
11647
11670
  var t = e.directConnection,
11648
11671
  i = t == null ? void 0 : t.openAI,
@@ -11654,7 +11677,7 @@ var me = /*#__PURE__*/function (_V11) {
11654
11677
  }
11655
11678
  }
11656
11679
  };
11657
- _this56 = _callSuper(this, me, [e, L.buildKeyVerificationDetails(), L.buildHeaders, i, s]), _this56.insertKeyPlaceholderText = "OpenAI API Key", _this56.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this56.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI DALL\xB7E</b></div>\n <p><b>Insert text</b> to generate an image.</p>\n <p><b>Upload 1</b> PNG image to generate its variation and optionally insert text to specify the change.</p>\n <p><b>Upload 2</b> PNG images where the second is a copy of the first with a transparent area where the edit should\n take place and text to specify the edit.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/images/introduction\">here</a> for more info.</p>", _this56.url = "", _this56.permittedErrorPrefixes = ["Incorrect", "Invalid input image"];
11680
+ _this56 = _callSuper(this, ge, [e, L.buildKeyVerificationDetails(), L.buildHeaders, i, s]), _this56.insertKeyPlaceholderText = "OpenAI API Key", _this56.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this56.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI DALL\xB7E</b></div>\n <p><b>Insert text</b> to generate an image.</p>\n <p><b>Upload 1</b> PNG image to generate its variation and optionally insert text to specify the change.</p>\n <p><b>Upload 2</b> PNG images where the second is a copy of the first with a transparent area where the edit should\n take place and text to specify the edit.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/images/introduction\">here</a> for more info.</p>", _this56.url = "", _this56.permittedErrorPrefixes = ["Incorrect", "Invalid input image"];
11658
11681
  var r = (o = t == null ? void 0 : t.openAI) == null ? void 0 : o.images;
11659
11682
  if (_this56.camera) {
11660
11683
  var a = _typeof(r) == "object" && r.size ? Number.parseInt(r.size) : 1024;
@@ -11665,11 +11688,11 @@ var me = /*#__PURE__*/function (_V11) {
11665
11688
  }
11666
11689
  };
11667
11690
  }
11668
- _typeof(r) == "object" && Object.assign(_this56.rawBody, r), _this56.canSendMessage = me.canFileSendMessage;
11691
+ _typeof(r) == "object" && Object.assign(_this56.rawBody, r), _this56.canSendMessage = ge.canFileSendMessage;
11669
11692
  return _this56;
11670
11693
  }
11671
- _inherits(me, _V11);
11672
- return _createClass(me, [{
11694
+ _inherits(ge, _K11);
11695
+ return _createClass(ge, [{
11673
11696
  key: "preprocessBody",
11674
11697
  value: function preprocessBody(e, t) {
11675
11698
  var i = JSON.parse(JSON.stringify(e));
@@ -11683,10 +11706,10 @@ var me = /*#__PURE__*/function (_V11) {
11683
11706
  var s;
11684
11707
  var r = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim();
11685
11708
  if (i[1] || r && r !== "") {
11686
- this.url = me.IMAGE_EDIT_URL;
11709
+ this.url = ge.IMAGE_EDIT_URL;
11687
11710
  var l = this.preprocessBody(this.rawBody, r);
11688
- s = me.createFormDataBody(l, i[0], i[1]);
11689
- } else this.url = me.IMAGE_VARIATIONS_URL, s = me.createFormDataBody(this.rawBody, i[0]);
11711
+ s = ge.createFormDataBody(l, i[0], i[1]);
11712
+ } else this.url = ge.IMAGE_VARIATIONS_URL, s = ge.createFormDataBody(this.rawBody, i[0]);
11690
11713
  E.tempRemoveContentHeader(this.connectSettings, R.request.bind(this, this, s, e), !1);
11691
11714
  }
11692
11715
  }, {
@@ -11717,7 +11740,7 @@ var me = /*#__PURE__*/function (_V11) {
11717
11740
  }
11718
11741
  throw new Error("Request settings have not been set up");
11719
11742
  case 8:
11720
- this.url = me.IMAGE_GENERATION_URL;
11743
+ this.url = ge.IMAGE_GENERATION_URL;
11721
11744
  r = this.preprocessBody(this.rawBody, t[t.length - 1].text);
11722
11745
  R.request(this, r, e);
11723
11746
  case 11:
@@ -11750,7 +11773,7 @@ var me = /*#__PURE__*/function (_V11) {
11750
11773
  src: i.url,
11751
11774
  type: "image"
11752
11775
  } : {
11753
- src: "".concat(ci).concat(i.b64_json),
11776
+ src: "".concat(di).concat(i.b64_json),
11754
11777
  type: "image"
11755
11778
  };
11756
11779
  })
@@ -11788,9 +11811,9 @@ var me = /*#__PURE__*/function (_V11) {
11788
11811
  }), s;
11789
11812
  }
11790
11813
  }]);
11791
- }(V);
11792
- me.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations", me.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations", me.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
11793
- var ms = me;
11814
+ }(K);
11815
+ ge.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations", ge.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations", ge.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
11816
+ var ms = ge;
11794
11817
  var ea = /*#__PURE__*/function (_ws3) {
11795
11818
  function ea(e) {
11796
11819
  var _this57$maxMessages;
@@ -11905,7 +11928,7 @@ var Ii = /*#__PURE__*/function () {
11905
11928
  }
11906
11929
  }]);
11907
11930
  }();
11908
- var ta = /*#__PURE__*/function (_V12) {
11931
+ var ta = /*#__PURE__*/function (_K12) {
11909
11932
  function ta(e) {
11910
11933
  var _this58$maxMessages, _s$model;
11911
11934
  var _this58;
@@ -11915,7 +11938,7 @@ var ta = /*#__PURE__*/function (_V12) {
11915
11938
  _this58 = _callSuper(this, ta, [e, Ii.buildKeyVerificationDetails(), Ii.buildHeaders, i]), _this58.insertKeyPlaceholderText = "Mistral API Key", _this58.keyHelpUrl = "https://console.mistral.ai/api-keys/", _this58.url = "https://api.mistral.ai/v1/chat/completions", _this58.permittedErrorPrefixes = ["invalid"], i && (_this58.cleanConfig(i), Object.assign(_this58.rawBody, i)), (_this58$maxMessages = _this58.maxMessages) !== null && _this58$maxMessages !== void 0 ? _this58$maxMessages : _this58.maxMessages = -1, (_s$model = (s = _this58.rawBody).model) !== null && _s$model !== void 0 ? _s$model : s.model = "open-mistral-7b";
11916
11939
  return _this58;
11917
11940
  }
11918
- _inherits(ta, _V12);
11941
+ _inherits(ta, _K12);
11919
11942
  return _createClass(ta, [{
11920
11943
  key: "cleanConfig",
11921
11944
  value: function cleanConfig(e) {
@@ -11991,7 +12014,7 @@ var ta = /*#__PURE__*/function (_V12) {
11991
12014
  return extractResultData;
11992
12015
  }()
11993
12016
  }]);
11994
- }(V);
12017
+ }(K);
11995
12018
  var ia = /*#__PURE__*/function () {
11996
12019
  function ia() {
11997
12020
  _classCallCheck(this, ia);
@@ -12005,12 +12028,12 @@ var ia = /*#__PURE__*/function () {
12005
12028
  i = e.connect,
12006
12029
  s = e.demo,
12007
12030
  r = e.webModel;
12008
- if (r) return new si(e);
12031
+ if (r) return new ni(e);
12009
12032
  if (t) {
12010
- if (t.openAI) return t.openAI.images ? new ms(e) : t.openAI.speechToText ? new hs(e) : t.openAI.textToSpeech ? new ds(e) : t.openAI.assistant ? new xs(e) : t.openAI.realtime ? new cs(e) : new bt(e);
12033
+ if (t.openAI) return t.openAI.images ? new ms(e) : t.openAI.speechToText ? new hs(e) : t.openAI.textToSpeech ? new ds(e) : t.openAI.assistant ? new xs(e) : t.openAI.realtime ? new cs(e) : new vt(e);
12011
12034
  if (t.assemblyAI) return new As(e);
12012
12035
  if (t.cohere) return t.cohere.textGeneration ? new Xo(e) : t.cohere.summarization ? new Yo(e) : new ea(e);
12013
- if (t.huggingFace) return t.huggingFace.textGeneration ? new Go(e) : t.huggingFace.summarization ? new Ko(e) : t.huggingFace.translation ? new Wo(e) : t.huggingFace.fillMask ? new Jo(e) : t.huggingFace.questionAnswer ? new Vo(e) : t.huggingFace.audioSpeechRecognition ? new zo(e) : t.huggingFace.audioClassification ? new qo(e) : t.huggingFace.imageClassification ? new Ho(e) : new $o(e);
12036
+ if (t.huggingFace) return t.huggingFace.textGeneration ? new Go(e) : t.huggingFace.summarization ? new Ko(e) : t.huggingFace.translation ? new $o(e) : t.huggingFace.fillMask ? new Jo(e) : t.huggingFace.questionAnswer ? new Vo(e) : t.huggingFace.audioSpeechRecognition ? new zo(e) : t.huggingFace.audioClassification ? new Ho(e) : t.huggingFace.imageClassification ? new qo(e) : new Wo(e);
12014
12037
  if (t.azure) {
12015
12038
  if (t.azure.openAI) {
12016
12039
  if (t.azure.openAI.chat) return new Ts(e);
@@ -12096,23 +12119,23 @@ var Oi = /*#__PURE__*/function () {
12096
12119
  }]);
12097
12120
  }();
12098
12121
  var sa = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" \n\t viewBox=\"50 30 420 450\" xml:space=\"preserve\">\n<g filter=\"brightness(0) saturate(100%) invert(16%) sepia(0%) saturate(1942%) hue-rotate(215deg) brightness(99%) contrast(93%)\">\n\t<g>\n\t\t<path d=\"M447.933,103.629c-0.034-3.076-1.224-6.09-3.485-8.352L352.683,3.511c-0.004-0.004-0.007-0.005-0.011-0.008\n\t\t\tC350.505,1.338,347.511,0,344.206,0H89.278C75.361,0,64.04,11.32,64.04,25.237v461.525c0,13.916,11.32,25.237,25.237,25.237\n\t\t\th333.444c13.916,0,25.237-11.32,25.237-25.237V103.753C447.96,103.709,447.937,103.672,447.933,103.629z M356.194,40.931\n\t\t\tl50.834,50.834h-49.572c-0.695,0-1.262-0.567-1.262-1.262V40.931z M423.983,486.763c0,0.695-0.566,1.261-1.261,1.261H89.278\n\t\t\tc-0.695,0-1.261-0.566-1.261-1.261V25.237c0-0.695,0.566-1.261,1.261-1.261h242.94v66.527c0,13.916,11.322,25.239,25.239,25.239\n\t\t\th66.527V486.763z\"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path d=\"M362.088,164.014H149.912c-6.62,0-11.988,5.367-11.988,11.988c0,6.62,5.368,11.988,11.988,11.988h212.175\n\t\t\tc6.62,0,11.988-5.368,11.988-11.988C374.076,169.381,368.707,164.014,362.088,164.014z\"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path d=\"M362.088,236.353H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.62,5.368,11.988,11.988,11.988h212.175\n\t\t\tc6.62,0,11.988-5.368,11.988-11.988C374.076,241.721,368.707,236.353,362.088,236.353z\"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path d=\"M362.088,308.691H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.621,5.368,11.988,11.988,11.988h212.175\n\t\t\tc6.62,0,11.988-5.367,11.988-11.988C374.076,314.06,368.707,308.691,362.088,308.691z\"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path d=\"M256,381.031H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.621,5.368,11.988,11.988,11.988H256\n\t\t\tc6.62,0,11.988-5.367,11.988-11.988C267.988,386.398,262.62,381.031,256,381.031z\"/>\n\t</g>\n</g>\n</svg>",
12099
- W = /*#__PURE__*/function () {
12100
- function W() {
12101
- _classCallCheck(this, W);
12122
+ J = /*#__PURE__*/function () {
12123
+ function J() {
12124
+ _classCallCheck(this, J);
12102
12125
  }
12103
- return _createClass(W, null, [{
12126
+ return _createClass(J, null, [{
12104
12127
  key: "createImage",
12105
12128
  value: function createImage(e, t, i) {
12106
12129
  var s = new Image();
12107
- return s.src = e.src, i && H.scrollDownOnImageLoad(s.src, t), H.processContent("image", s, s.src, e.name);
12130
+ return s.src = e.src, i && q.scrollDownOnImageLoad(s.src, t), q.processContent("image", s, s.src, e.name);
12108
12131
  }
12109
12132
  // WORK - image still does not scroll down when loaded
12110
12133
  }, {
12111
12134
  key: "createImageMessage",
12112
12135
  value: function createImageMessage(e, t, i, s) {
12113
- var r = W.createImage(t, e.elementRef, !s && !e.focusMode),
12136
+ var r = J.createImage(t, e.elementRef, !s && !e.focusMode),
12114
12137
  o = e.createNewMessageElement("", i);
12115
- return o.bubbleElement.appendChild(r), o.bubbleElement.classList.add(W.IMAGE_BUBBLE_CLASS), {
12138
+ return o.bubbleElement.appendChild(r), o.bubbleElement.classList.add(J.IMAGE_BUBBLE_CLASS), {
12116
12139
  type: "image",
12117
12140
  elements: o
12118
12141
  };
@@ -12126,9 +12149,9 @@ var sa = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
12126
12149
  }, {
12127
12150
  key: "createNewAudioMessage",
12128
12151
  value: function createNewAudioMessage(e, t, i, s) {
12129
- var r = W.createAudioElement(t, i),
12152
+ var r = J.createAudioElement(t, i),
12130
12153
  o = e.createMessageElementsOnOrientation("", i, s);
12131
- return o.bubbleElement.appendChild(r), o.bubbleElement.classList.add(W.AUDIO_BUBBLE_CLASS), {
12154
+ return o.bubbleElement.appendChild(r), o.bubbleElement.classList.add(J.AUDIO_BUBBLE_CLASS), {
12132
12155
  type: "audio",
12133
12156
  elements: o
12134
12157
  };
@@ -12143,14 +12166,14 @@ var sa = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
12143
12166
  var s = Ue.createSVGElement(sa);
12144
12167
  s.classList.add("any-file-message-icon"), i.appendChild(s);
12145
12168
  var r = document.createElement("div");
12146
- return r.classList.add("any-file-message-text"), r.textContent = e.name || H.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), H.processContent("any", t, e.src, r.textContent);
12169
+ return r.classList.add("any-file-message-text"), r.textContent = e.name || q.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), q.processContent("any", t, e.src, r.textContent);
12147
12170
  }
12148
12171
  }, {
12149
12172
  key: "createNewAnyFileMessage",
12150
12173
  value: function createNewAnyFileMessage(e, t, i, s) {
12151
12174
  var r = e.createMessageElementsOnOrientation("", i, s),
12152
- o = W.createAnyFile(t);
12153
- return r.bubbleElement.classList.add(W.ANY_FILE_BUBBLE_CLASS), r.bubbleElement.appendChild(o), {
12175
+ o = J.createAnyFile(t);
12176
+ return r.bubbleElement.classList.add(J.ANY_FILE_BUBBLE_CLASS), r.bubbleElement.appendChild(o), {
12154
12177
  type: "file",
12155
12178
  elements: r
12156
12179
  };
@@ -12160,23 +12183,23 @@ var sa = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
12160
12183
  value: function createMessages(e, t, i) {
12161
12184
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
12162
12185
  return t.map(function (r) {
12163
- return r.ref && (r = H.removeFileRef(r)), H.isAudioFile(r) ? W.createNewAudioMessage(e, r, i, s) : H.isImageFile(r) ? W.createImageMessage(e, r, i, s) : W.createNewAnyFileMessage(e, r, i, s);
12186
+ return r.ref && (r = q.removeFileRef(r)), q.isAudioFile(r) ? J.createNewAudioMessage(e, r, i, s) : q.isImageFile(r) ? J.createImageMessage(e, r, i, s) : J.createNewAnyFileMessage(e, r, i, s);
12164
12187
  });
12165
12188
  }
12166
12189
  // no overwrite previous message logic as it is complex to track which files are to be overwritten
12167
12190
  }, {
12168
12191
  key: "addMessages",
12169
12192
  value: function addMessages(e, t, i, s) {
12170
- W.createMessages(e, t, i, s).forEach(function (_ref32) {
12193
+ J.createMessages(e, t, i, s).forEach(function (_ref32) {
12171
12194
  var o = _ref32.type,
12172
12195
  a = _ref32.elements;
12173
- H.addMessage(e, a, o, i, s);
12196
+ q.addMessage(e, a, o, i, s);
12174
12197
  });
12175
12198
  }
12176
12199
  }]);
12177
12200
  }();
12178
- W.IMAGE_BUBBLE_CLASS = "image-message", W.AUDIO_BUBBLE_CLASS = "audio-message", W.ANY_FILE_BUBBLE_CLASS = "any-file-message";
12179
- var Pi = W;
12201
+ J.IMAGE_BUBBLE_CLASS = "image-message", J.AUDIO_BUBBLE_CLASS = "audio-message", J.ANY_FILE_BUBBLE_CLASS = "any-file-message";
12202
+ var Pi = J;
12180
12203
  var le = /*#__PURE__*/function () {
12181
12204
  function le() {
12182
12205
  _classCallCheck(this, le);
@@ -12208,8 +12231,8 @@ var le = /*#__PURE__*/function () {
12208
12231
  key: "updateHTMLMessage",
12209
12232
  value: function updateHTMLMessage(e, t, i) {
12210
12233
  var s, r, o;
12211
- if (t[1].html) _e.overwriteElements(e, i, t[1].html);else {
12212
- var a = _e.create(e, i, t[0].role),
12234
+ if (t[1].html) xe.overwriteElements(e, i, t[1].html);else {
12235
+ var a = xe.create(e, i, t[0].role),
12213
12236
  l = ((r = t[1].files) == null ? void 0 : r[((s = t[1].files) == null ? void 0 : s.length) - 1]) || t[1].text,
12214
12237
  c = l.outerContainer.nextSibling;
12215
12238
  (o = c == null ? void 0 : c.parentElement) == null || o.insertBefore(a.outerContainer, c), e.messageElementRefs.splice(e.messageElementRefs.length - 1, 1);
@@ -12239,7 +12262,7 @@ var le = /*#__PURE__*/function () {
12239
12262
  var f = _ref33.type,
12240
12263
  m = _ref33.elements;
12241
12264
  var g;
12242
- H.setElementProps(e, m, f, s), (g = d.parentElement) == null || g.insertBefore(m.outerContainer, d), e.messageElementRefs.splice(e.messageElementRefs.length - 1, 1), e.messageElementRefs.splice(c + p, 0, m);
12265
+ q.setElementProps(e, m, f, s), (g = d.parentElement) == null || g.insertBefore(m.outerContainer, d), e.messageElementRefs.splice(e.messageElementRefs.length - 1, 1), e.messageElementRefs.splice(c + p, 0, m);
12243
12266
  }), le.removeFilesMessages(e, t), t[1].files = r.map(function (_ref34) {
12244
12267
  var f = _ref34.elements;
12245
12268
  return f;
@@ -12309,19 +12332,19 @@ var de = /*#__PURE__*/function (_he) {
12309
12332
  var s = t.permittedErrorPrefixes,
12310
12333
  r = t.introPanelMarkUp,
12311
12334
  o = t.demo;
12312
- _this59._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this59._onClearMessages = yi.onClearMessages.bind(_this59, e), _this59._onError = yi.onError.bind(_this59, e), _this59._isLoadingMessageAllowed = de.getDefaultDisplayLoadingMessage(e, t), _typeof(e.displayLoadingBubble) == "object" && e.displayLoadingBubble.toggle && (e.displayLoadingBubble.toggle = _this59.setLoadingToggle.bind(_this59)), _this59._permittedErrorPrefixes = s, _this59.addSetupMessageIfNeeded(e, t) || _this59.populateIntroPanel(i, r, e.introPanelStyle), o && _this59.prepareDemo(te.processDemo(o), e.loadHistory), _this59.addIntroductoryMessages(e, t), new ii(e, _this59, t), _this59._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
12335
+ _this59._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this59._onClearMessages = ii.onClearMessages.bind(_this59, e), _this59._onError = ii.onError.bind(_this59, e), _this59._isLoadingMessageAllowed = de.getDefaultDisplayLoadingMessage(e, t), _typeof(e.displayLoadingBubble) == "object" && e.displayLoadingBubble.toggle && (e.displayLoadingBubble.toggle = _this59.setLoadingToggle.bind(_this59)), _this59._permittedErrorPrefixes = s, _this59.addSetupMessageIfNeeded(e, t) || _this59.populateIntroPanel(i, r, e.introPanelStyle), o && _this59.prepareDemo(te.processDemo(o), e.loadHistory), _this59.addIntroductoryMessages(e, t), new si(e, _this59, t), _this59._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
12313
12336
  return y.deepCloneMessagesWithReferences(_this59.messageToElements.map(function (_ref35) {
12314
12337
  var _ref36 = _slicedToArray(_ref35, 1),
12315
12338
  c = _ref36[0];
12316
12339
  return c;
12317
12340
  }));
12318
- }, e.clearMessages = _this59.clearMessages.bind(_this59, t), e.refreshMessages = _this59.refreshTextMessages.bind(_this59, e.remarkable), e.scrollToBottom = G.scrollToBottom.bind(_this59, _this59.elementRef), e.addMessage = function (c, d) {
12341
+ }, e.clearMessages = _this59.clearMessages.bind(_this59, t), e.refreshMessages = _this59.refreshTextMessages.bind(_this59, e.remarkable), e.scrollToBottom = V.scrollToBottom.bind(_this59, _this59.elementRef), e.addMessage = function (c, d) {
12319
12342
  _this59.addAnyMessage(_objectSpread(_objectSpread({}, c), {}, {
12320
12343
  sendUpdate: !!d
12321
12344
  }), !d);
12322
12345
  }, e.updateMessage = function (c, d) {
12323
12346
  return le.update(_this59, c, d);
12324
- }, t.isWebModel() && t.setUpMessages(_this59), e.textToSpeech && gt.processConfig(e.textToSpeech, function (c) {
12347
+ }, t.isWebModel() && t.setUpMessages(_this59), e.textToSpeech && bt.processConfig(e.textToSpeech, function (c) {
12325
12348
  _this59.textToSpeech = c;
12326
12349
  });
12327
12350
  return _this59;
@@ -12377,7 +12400,7 @@ var de = /*#__PURE__*/function (_he) {
12377
12400
  value: function addIntroductoryMessage(e, t) {
12378
12401
  var s;
12379
12402
  var i;
12380
- return e != null && e.text ? i = this.createAndAppendNewMessageElement(e.text, y.AI_ROLE) : e != null && e.html && (i = _e.add(this, e.html, y.AI_ROLE)), i && (this.applyCustomStyles(i, y.AI_ROLE, !1, (s = this.messageStyles) == null ? void 0 : s.intro), i.outerContainer.classList.add(he.INTRO_CLASS), t && (i.outerContainer.style.display = "none")), i;
12403
+ return e != null && e.text ? i = this.createAndAppendNewMessageElement(e.text, y.AI_ROLE) : e != null && e.html && (i = xe.add(this, e.html, y.AI_ROLE)), i && (this.applyCustomStyles(i, y.AI_ROLE, !1, (s = this.messageStyles) == null ? void 0 : s.intro), i.outerContainer.classList.add(he.INTRO_CLASS), t && (i.outerContainer.style.display = "none")), i;
12381
12404
  }
12382
12405
  }, {
12383
12406
  key: "removeIntroductoryMessage",
@@ -12397,7 +12420,7 @@ var de = /*#__PURE__*/function (_he) {
12397
12420
  value: function tryAddTextMessage(e, t, i) {
12398
12421
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
12399
12422
  var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
12400
- !i.ignoreText && e.text !== void 0 && i.text !== null && (this.addNewTextMessage(e.text, e.role, t, r), !s && this.textToSpeech && e.role !== y.USER_ROLE && gt.speak(e.text, this.textToSpeech));
12423
+ !i.ignoreText && e.text !== void 0 && i.text !== null && (this.addNewTextMessage(e.text, e.role, t, r), !s && this.textToSpeech && e.role !== y.USER_ROLE && bt.speak(e.text, this.textToSpeech));
12401
12424
  }
12402
12425
  }, {
12403
12426
  key: "tryAddFileMessages",
@@ -12410,8 +12433,8 @@ var de = /*#__PURE__*/function (_he) {
12410
12433
  value: function tryAddHTMLMessage(e, t) {
12411
12434
  var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
12412
12435
  if (e.html !== void 0 && e.html !== null) {
12413
- var s = _e.add(this, e.html, e.role, t, i);
12414
- i && Se.isElementTemporary(s) && delete e.html;
12436
+ var s = xe.add(this, e.html, e.role, t, i);
12437
+ i && _e.isElementTemporary(s) && delete e.html;
12415
12438
  }
12416
12439
  }
12417
12440
  // this should not be activated by streamed messages
@@ -12450,7 +12473,7 @@ var de = /*#__PURE__*/function (_he) {
12450
12473
  value: function removeMessageOnError() {
12451
12474
  var e = this.messageElementRefs[this.messageElementRefs.length - 1],
12452
12475
  t = e == null ? void 0 : e.bubbleElement;
12453
- (t != null && t.classList.contains(we.MESSAGE_CLASS) && t.textContent === "" || de.isTemporaryElement(e)) && this.removeLastMessage();
12476
+ (t != null && t.classList.contains(Ae.MESSAGE_CLASS) && t.textContent === "" || de.isTemporaryElement(e)) && this.removeLastMessage();
12454
12477
  }
12455
12478
  // prettier-ignore
12456
12479
  }, {
@@ -12466,9 +12489,9 @@ var de = /*#__PURE__*/function (_he) {
12466
12489
  var o = r.bubbleElement,
12467
12490
  a = r.outerContainer;
12468
12491
  o.classList.add(y.ERROR_MESSAGE_TEXT_CLASS), this.renderText(o, s);
12469
- var l = J.extractParticularSharedStyles(["fontSize", "fontFamily"], (h = this.messageStyles) == null ? void 0 : h["default"]);
12470
- J.applyCustomStylesToElements(r, !1, l), J.applyCustomStylesToElements(r, !1, (f = this.messageStyles) == null ? void 0 : f.error), i || this.appendOuterContainerElemet(a), this.textToSpeech && gt.speak(s, this.textToSpeech), (m = this._onError) == null || m.call(this, s), setTimeout(function () {
12471
- return G.scrollToBottom(_this61.elementRef);
12492
+ var l = X.extractParticularSharedStyles(["fontSize", "fontFamily"], (h = this.messageStyles) == null ? void 0 : h["default"]);
12493
+ X.applyCustomStylesToElements(r, !1, l), X.applyCustomStylesToElements(r, !1, (f = this.messageStyles) == null ? void 0 : f.error), i || this.appendOuterContainerElemet(a), this.textToSpeech && bt.speak(s, this.textToSpeech), (m = this._onError) == null || m.call(this, s), setTimeout(function () {
12494
+ return V.scrollToBottom(_this61.elementRef);
12472
12495
  });
12473
12496
  }
12474
12497
  }, {
@@ -12510,13 +12533,13 @@ var de = /*#__PURE__*/function (_he) {
12510
12533
  var t = this.messageElementRefs[this.messageElementRefs.length - 1];
12511
12534
  if (he.isLoadingMessage(t) || !e && !this._isLoadingMessageAllowed) return;
12512
12535
  var i = (a = (o = (r = this.messageStyles) == null ? void 0 : r.loading) == null ? void 0 : o.message) == null ? void 0 : a.html,
12513
- s = i ? _e.createElements(this, i, y.AI_ROLE, !1) : this.addDefaultLoadingMessage();
12514
- this.appendOuterContainerElemet(s.outerContainer), s.bubbleElement.classList.add(De.BUBBLE_CLASS), this.applyCustomStyles(s, y.AI_ROLE, !1, (d = (c = (l = this.messageStyles) == null ? void 0 : l.loading) == null ? void 0 : c.message) == null ? void 0 : d.styles), this.focusMode || G.scrollToBottom(this.elementRef);
12536
+ s = i ? xe.createElements(this, i, y.AI_ROLE, !1) : this.addDefaultLoadingMessage();
12537
+ this.appendOuterContainerElemet(s.outerContainer), s.bubbleElement.classList.add(De.BUBBLE_CLASS), this.applyCustomStyles(s, y.AI_ROLE, !1, (d = (c = (l = this.messageStyles) == null ? void 0 : l.loading) == null ? void 0 : c.message) == null ? void 0 : d.styles), this.focusMode || V.scrollToBottom(this.elementRef);
12515
12538
  }
12516
12539
  }, {
12517
12540
  key: "populateIntroPanel",
12518
12541
  value: function populateIntroPanel(e, t, i) {
12519
- (e || t) && (this._introPanel = new Oi(e, t, i), this._introPanel._elementRef && (X.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
12542
+ (e || t) && (this._introPanel = new Oi(e, t, i), this._introPanel._elementRef && (G.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
12520
12543
  }
12521
12544
  }, {
12522
12545
  key: "addMultipleFiles",
@@ -12528,7 +12551,7 @@ var de = /*#__PURE__*/function (_he) {
12528
12551
  return _context122.abrupt("return", (this._hiddenAttachments = t, Promise.all((e || []).map(function (i) {
12529
12552
  return new Promise(function (s) {
12530
12553
  if (!i.type || i.type === "any") {
12531
- var r = i.file.name || H.DEFAULT_FILE_NAME;
12554
+ var r = i.file.name || q.DEFAULT_FILE_NAME;
12532
12555
  s({
12533
12556
  name: r,
12534
12557
  type: "any",
@@ -12596,7 +12619,7 @@ var de = /*#__PURE__*/function (_he) {
12596
12619
  }, {
12597
12620
  key: "isActiveElement",
12598
12621
  value: function isActiveElement(e) {
12599
- return e ? e.contains(De.BUBBLE_CLASS) || e.contains(Fe.CLASS) || e.contains(we.MESSAGE_CLASS) : !1;
12622
+ return e ? e.contains(De.BUBBLE_CLASS) || e.contains(Fe.CLASS) || e.contains(Ae.MESSAGE_CLASS) : !1;
12600
12623
  }
12601
12624
  }]);
12602
12625
  }(he);
@@ -12638,11 +12661,11 @@ var j = /*#__PURE__*/function () {
12638
12661
  }();
12639
12662
  j.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS = "text-input-container-left-adjustment", j.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS = "text-input-container-right-adjustment", j.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS = "text-input-container-left-small-adjustment", j.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS = "text-input-container-right-small-adjustment";
12640
12663
  var bs = j;
12641
- var yt = /*#__PURE__*/function () {
12642
- function yt() {
12643
- _classCallCheck(this, yt);
12664
+ var Et = /*#__PURE__*/function () {
12665
+ function Et() {
12666
+ _classCallCheck(this, Et);
12644
12667
  }
12645
- return _createClass(yt, null, [{
12668
+ return _createClass(Et, null, [{
12646
12669
  key: "create",
12647
12670
  value: function create() {
12648
12671
  return Array.from({
@@ -12666,7 +12689,7 @@ var yt = /*#__PURE__*/function () {
12666
12689
  key: "addButton",
12667
12690
  value: function addButton(e, t, i) {
12668
12691
  t.classList.add(i);
12669
- var s = yt.getContainerIndex(i);
12692
+ var s = Et.getContainerIndex(i);
12670
12693
  e[s].appendChild(t), s === 3 && t.classList.add("outside-right");
12671
12694
  }
12672
12695
  }]);
@@ -12680,7 +12703,7 @@ var Ys = ["camera", "gifs", "images", "audio", "mixedFiles", "submit", "micropho
12680
12703
  return _createClass(Q, null, [{
12681
12704
  key: "addItemEvents",
12682
12705
  value: function addItemEvents(e, t, i, s) {
12683
- $e.add(t, s), t.addEventListener("click", function () {
12706
+ We.add(t, s), t.addEventListener("click", function () {
12684
12707
  i.click();
12685
12708
  }), t.addEventListener("mouseenter", function (r) {
12686
12709
  e.highlightedItem = r.target;
@@ -12712,7 +12735,7 @@ var Ys = ["camera", "gifs", "images", "audio", "mixedFiles", "submit", "micropho
12712
12735
  var u;
12713
12736
  return ((u = d.svg) == null ? void 0 : u.content) === "";
12714
12737
  });
12715
- l.classList.contains(Ae.INPUT_BUTTON_INNER_TEXT_CLASS) ? (c || t.appendChild(Q.createItemIcon(o, i == null ? void 0 : i.iconContainer)), t.appendChild(Q.createItemText(l.textContent, i == null ? void 0 : i.text))) : (c || t.appendChild(Q.createItemIcon(s.children[0], i == null ? void 0 : i.iconContainer)), t.appendChild(Q.createItemText(r, i == null ? void 0 : i.text)));
12738
+ l.classList.contains(Te.INPUT_BUTTON_INNER_TEXT_CLASS) ? (c || t.appendChild(Q.createItemIcon(o, i == null ? void 0 : i.iconContainer)), t.appendChild(Q.createItemText(l.textContent, i == null ? void 0 : i.text))) : (c || t.appendChild(Q.createItemIcon(s.children[0], i == null ? void 0 : i.iconContainer)), t.appendChild(Q.createItemText(r, i == null ? void 0 : i.text)));
12716
12739
  }
12717
12740
  }, {
12718
12741
  key: "createItem",
@@ -12730,7 +12753,7 @@ var Ys = ["camera", "gifs", "images", "audio", "mixedFiles", "submit", "micropho
12730
12753
  }]);
12731
12754
  }();
12732
12755
  Q.MENU_ITEM_CLASS = "dropup-menu-item", Q.TEXT_CLASS = "dropup-menu-item-text", Q.ICON_CLASS = "dropup-menu-item-icon";
12733
- var Ee = Q;
12756
+ var Se = Q;
12734
12757
  var O = /*#__PURE__*/function (_ct2) {
12735
12758
  function O(e, t, i, s) {
12736
12759
  var _this62;
@@ -12782,13 +12805,13 @@ var O = /*#__PURE__*/function (_ct2) {
12782
12805
  var t = Array.from(this.elementRef.children);
12783
12806
  if (e != null && e.text) {
12784
12807
  var _i8 = t.find(function (s) {
12785
- return s.classList.contains(Ee.TEXT_CLASS);
12808
+ return s.classList.contains(Se.TEXT_CLASS);
12786
12809
  });
12787
12810
  _i8 && Object.assign(_i8.style, e.text);
12788
12811
  }
12789
12812
  if (e != null && e.iconContainer) {
12790
12813
  var _i9 = t.find(function (s) {
12791
- return s.classList.contains(Ee.ICON_CLASS);
12814
+ return s.classList.contains(Se.ICON_CLASS);
12792
12815
  });
12793
12816
  _i9 && Object.assign(_i9.style, e.iconContainer);
12794
12817
  }
@@ -12797,7 +12820,7 @@ var O = /*#__PURE__*/function (_ct2) {
12797
12820
  key: "resetDropupItem",
12798
12821
  value: function resetDropupItem(e) {
12799
12822
  var i, s, r;
12800
- this.elementRef = X.replaceElementWithNewClone(this.elementRef, this._originalElementRef), this.elementRef.innerHTML = "", ((i = e == null ? void 0 : e.svg) == null ? void 0 : i.content) === "" || this.elementRef.appendChild(Ee.createItemIcon(this.svg, (s = this._menuStyles) == null ? void 0 : s.iconContainer)), this.elementRef.appendChild(Ee.createItemText(this.dropupText, (r = this._menuStyles) == null ? void 0 : r.text));
12823
+ this.elementRef = G.replaceElementWithNewClone(this.elementRef, this._originalElementRef), this.elementRef.innerHTML = "", ((i = e == null ? void 0 : e.svg) == null ? void 0 : i.content) === "" || this.elementRef.appendChild(Se.createItemIcon(this.svg, (s = this._menuStyles) == null ? void 0 : s.iconContainer)), this.elementRef.appendChild(Se.createItemText(this.dropupText, (r = this._menuStyles) == null ? void 0 : r.text));
12801
12824
  }
12802
12825
  }, {
12803
12826
  key: "assignDropupItemStyle",
@@ -12805,25 +12828,25 @@ var O = /*#__PURE__*/function (_ct2) {
12805
12828
  var s;
12806
12829
  this.elementRef.parentElement && this._originalElementRef && this.resetDropupItem(t), this.applyDropupContentStyles(e), Object.assign(this.elementRef.style, (s = e == null ? void 0 : e.item) == null ? void 0 : s["default"]);
12807
12830
  var i = I.processStateful((e == null ? void 0 : e.item) || {});
12808
- $e.add(this.elementRef, i), this.addClickListener();
12831
+ We.add(this.elementRef, i), this.addClickListener();
12809
12832
  }
12810
12833
  }, {
12811
12834
  key: "changeToDefault",
12812
12835
  value: function changeToDefault(e) {
12813
12836
  var t, i, s, r, o, a;
12814
- !e && this._state === "default" || (this.elementRef.classList.contains(Ee.MENU_ITEM_CLASS) ? this.assignDropupItemStyle((t = this._dropupStyles) == null ? void 0 : t["default"], (i = this.customStyles) == null ? void 0 : i["default"]) : (this.changeElementsByState(this._innerElements["default"]), (s = this.customStyles) != null && s.active && D.unsetAllCSS(this.elementRef, (r = this.customStyles) == null ? void 0 : r.active), (o = this.customStyles) != null && o.disabled && D.unsetAllCSS(this.elementRef, (a = this.customStyles) == null ? void 0 : a.disabled), this.reapplyStateStyle("default", ["active", "disabled"])), this.elementRef.classList.remove(O.DISABLED_CONTAINER_CLASS, O.ACTIVE_CONTAINER_CLASS), this.elementRef.classList.add(O.DEFAULT_CONTAINER_CLASS), N.removeAriaDisabled(this.elementRef), this._state = "default");
12837
+ !e && this._state === "default" || (this.elementRef.classList.contains(Se.MENU_ITEM_CLASS) ? this.assignDropupItemStyle((t = this._dropupStyles) == null ? void 0 : t["default"], (i = this.customStyles) == null ? void 0 : i["default"]) : (this.changeElementsByState(this._innerElements["default"]), (s = this.customStyles) != null && s.active && D.unsetAllCSS(this.elementRef, (r = this.customStyles) == null ? void 0 : r.active), (o = this.customStyles) != null && o.disabled && D.unsetAllCSS(this.elementRef, (a = this.customStyles) == null ? void 0 : a.disabled), this.reapplyStateStyle("default", ["active", "disabled"])), this.elementRef.classList.remove(O.DISABLED_CONTAINER_CLASS, O.ACTIVE_CONTAINER_CLASS), this.elementRef.classList.add(O.DEFAULT_CONTAINER_CLASS), N.removeAriaDisabled(this.elementRef), this._state = "default");
12815
12838
  }
12816
12839
  }, {
12817
12840
  key: "changeToActive",
12818
12841
  value: function changeToActive(e) {
12819
12842
  var t, i;
12820
- !e && this._state === "active" || (this.elementRef.classList.contains(Ee.MENU_ITEM_CLASS) ? this.assignDropupItemStyle((t = this._dropupStyles) == null ? void 0 : t.active, (i = this.customStyles) == null ? void 0 : i.active) : (this.changeElementsByState(this._innerElements.active), this.reapplyStateStyle("active", ["disabled", "default"])), this.elementRef.classList.remove(O.DISABLED_CONTAINER_CLASS, O.DEFAULT_CONTAINER_CLASS), this.elementRef.classList.add(O.ACTIVE_CONTAINER_CLASS), N.removeAriaDisabled(this.elementRef), this._state = "active");
12843
+ !e && this._state === "active" || (this.elementRef.classList.contains(Se.MENU_ITEM_CLASS) ? this.assignDropupItemStyle((t = this._dropupStyles) == null ? void 0 : t.active, (i = this.customStyles) == null ? void 0 : i.active) : (this.changeElementsByState(this._innerElements.active), this.reapplyStateStyle("active", ["disabled", "default"])), this.elementRef.classList.remove(O.DISABLED_CONTAINER_CLASS, O.DEFAULT_CONTAINER_CLASS), this.elementRef.classList.add(O.ACTIVE_CONTAINER_CLASS), N.removeAriaDisabled(this.elementRef), this._state = "active");
12821
12844
  }
12822
12845
  }, {
12823
12846
  key: "changeToDisabled",
12824
12847
  value: function changeToDisabled(e) {
12825
12848
  var t, i, s, r, o, a;
12826
- !e && this._state === "disabled" || (this.elementRef.classList.contains(Ee.MENU_ITEM_CLASS) ? this.assignDropupItemStyle((t = this._dropupStyles) == null ? void 0 : t.disabled, (i = this.customStyles) == null ? void 0 : i.disabled) : (this.changeElementsByState(this._innerElements.disabled), (s = this.customStyles) != null && s.active && D.unsetAllCSS(this.elementRef, (r = this.customStyles) == null ? void 0 : r.active), (o = this.customStyles) != null && o["default"] && D.unsetAllCSS(this.elementRef, (a = this.customStyles) == null ? void 0 : a["default"]), this.reapplyStateStyle("disabled", ["default", "active"])), this.elementRef.classList.remove(O.ACTIVE_CONTAINER_CLASS, O.DEFAULT_CONTAINER_CLASS), this.elementRef.classList.add(O.DISABLED_CONTAINER_CLASS), N.addAriaDisabled(this.elementRef), this._state = "disabled");
12849
+ !e && this._state === "disabled" || (this.elementRef.classList.contains(Se.MENU_ITEM_CLASS) ? this.assignDropupItemStyle((t = this._dropupStyles) == null ? void 0 : t.disabled, (i = this.customStyles) == null ? void 0 : i.disabled) : (this.changeElementsByState(this._innerElements.disabled), (s = this.customStyles) != null && s.active && D.unsetAllCSS(this.elementRef, (r = this.customStyles) == null ? void 0 : r.active), (o = this.customStyles) != null && o["default"] && D.unsetAllCSS(this.elementRef, (a = this.customStyles) == null ? void 0 : a["default"]), this.reapplyStateStyle("disabled", ["default", "active"])), this.elementRef.classList.remove(O.ACTIVE_CONTAINER_CLASS, O.DEFAULT_CONTAINER_CLASS), this.elementRef.classList.add(O.DISABLED_CONTAINER_CLASS), N.addAriaDisabled(this.elementRef), this._state = "disabled");
12827
12850
  }
12828
12851
  // called after class is initialised
12829
12852
  }, {
@@ -12839,12 +12862,12 @@ var O = /*#__PURE__*/function (_ct2) {
12839
12862
  var o = (c = (l = s == null ? void 0 : s[t]) == null ? void 0 : l.svg) == null ? void 0 : c.content,
12840
12863
  a = (u = (d = s == null ? void 0 : s[t]) == null ? void 0 : d.text) == null ? void 0 : u.content;
12841
12864
  if (o === void 0 || a === void 0) {
12842
- var _Gt$parseSVGTextEleme4 = Gt.parseSVGTextElements(i),
12843
- h = _Gt$parseSVGTextEleme4.svg,
12844
- f = _Gt$parseSVGTextEleme4.text,
12845
- _Gt$parseSVGTextEleme5 = Gt.parseSVGTextElements(r),
12846
- m = _Gt$parseSVGTextEleme5.svg,
12847
- p = _Gt$parseSVGTextEleme5.text,
12865
+ var _Vt$parseSVGTextEleme4 = Vt.parseSVGTextElements(i),
12866
+ h = _Vt$parseSVGTextEleme4.svg,
12867
+ f = _Vt$parseSVGTextEleme4.text,
12868
+ _Vt$parseSVGTextEleme5 = Vt.parseSVGTextElements(r),
12869
+ m = _Vt$parseSVGTextEleme5.svg,
12870
+ p = _Vt$parseSVGTextEleme5.text,
12848
12871
  g = [];
12849
12872
  O.addToInnerElements(g, o, h, m), O.addToInnerElements(g, a, f, p), r = g;
12850
12873
  }
@@ -12879,15 +12902,15 @@ var O = /*#__PURE__*/function (_ct2) {
12879
12902
  O.INDICATOR_PREFIX = "custom", O.BUTTON_CLASS = "custom-button", O.DISABLED_CONTAINER_CLASS = "custom-button-container-disabled", O.DEFAULT_CONTAINER_CLASS = "custom-button-container-default", O.ACTIVE_CONTAINER_CLASS = "custom-button-container-active";
12880
12903
  var st = O;
12881
12904
  var oa = "<?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 <path d=\"M16 0c-8.836 0-16 7.163-16 16s7.163 16 16 16c8.837 0 16-7.163 16-16s-7.163-16-16-16zM16 30.032c-7.72 0-14-6.312-14-14.032s6.28-14 14-14 14 6.28 14 14-6.28 14.032-14 14.032zM23 15h-6v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1v6h-6c-0.552 0-1 0.448-1 1s0.448 1 1 1h6v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6h6c0.552 0 1-0.448 1-1s-0.448-1-1-1z\"></path>\n</svg>";
12882
- var ni = /*#__PURE__*/function () {
12883
- function ni() {
12884
- _classCallCheck(this, ni);
12905
+ var ri = /*#__PURE__*/function () {
12906
+ function ri() {
12907
+ _classCallCheck(this, ri);
12885
12908
  }
12886
- return _createClass(ni, null, [{
12909
+ return _createClass(ri, null, [{
12887
12910
  key: "focusItemWhenOnEdge",
12888
12911
  value: function focusItemWhenOnEdge(e, t) {
12889
12912
  var i = t ? e.children[0] : e.children[e.children.length - 1];
12890
- ni.focusSiblingItem(i, e, t, !0);
12913
+ ri.focusSiblingItem(i, e, t, !0);
12891
12914
  }
12892
12915
  // isEdgeItem means is it a start or end item
12893
12916
  // prettier-ignore
@@ -12896,7 +12919,7 @@ var ni = /*#__PURE__*/function () {
12896
12919
  value: function focusSiblingItem(e, t, i) {
12897
12920
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
12898
12921
  var r = s ? e : e[i ? "nextSibling" : "previousSibling"];
12899
- r ? (e.dispatchEvent(new MouseEvent("mouseleave")), r.dispatchEvent(new MouseEvent("mouseenter"))) : (e.dispatchEvent(new MouseEvent("mouseleave")), ni.focusItemWhenOnEdge(t, i));
12922
+ r ? (e.dispatchEvent(new MouseEvent("mouseleave")), r.dispatchEvent(new MouseEvent("mouseenter"))) : (e.dispatchEvent(new MouseEvent("mouseleave")), ri.focusItemWhenOnEdge(t, i));
12900
12923
  }
12901
12924
  }]);
12902
12925
  }();
@@ -12927,7 +12950,7 @@ var Cs = /*#__PURE__*/function () {
12927
12950
  }, {
12928
12951
  key: "addItem",
12929
12952
  value: function addItem(e) {
12930
- var t = Ee.createItem(this, e, this._styles);
12953
+ var t = Se.createItem(this, e, this._styles);
12931
12954
  this.elementRef.appendChild(t);
12932
12955
  }
12933
12956
  // prettier-ignore
@@ -12947,7 +12970,7 @@ var Cs = /*#__PURE__*/function () {
12947
12970
  key: "windowKeyDown",
12948
12971
  value: function windowKeyDown(e, t) {
12949
12972
  var i, s, r;
12950
- !e.isConnected && this.keyDownEvent ? window.removeEventListener("keydown", this.keyDownEvent) : this._isOpen && (t.key === U.ESCAPE ? (this.close(), (i = this.highlightedItem) == null || i.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === U.ENTER ? ((s = this.highlightedItem) == null || s.click(), (r = this.highlightedItem) == null || r.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === U.ARROW_DOWN ? ni.focusSiblingItem(this.highlightedItem || this.elementRef.children[this.elementRef.children.length - 1], this.elementRef, !0) : t.key === U.ARROW_UP && ni.focusSiblingItem(this.highlightedItem || this.elementRef.children[0], this.elementRef, !1));
12973
+ !e.isConnected && this.keyDownEvent ? window.removeEventListener("keydown", this.keyDownEvent) : this._isOpen && (t.key === U.ESCAPE ? (this.close(), (i = this.highlightedItem) == null || i.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === U.ENTER ? ((s = this.highlightedItem) == null || s.click(), (r = this.highlightedItem) == null || r.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === U.ARROW_DOWN ? ri.focusSiblingItem(this.highlightedItem || this.elementRef.children[this.elementRef.children.length - 1], this.elementRef, !0) : t.key === U.ARROW_UP && ri.focusSiblingItem(this.highlightedItem || this.elementRef.children[0], this.elementRef, !1));
12951
12974
  }
12952
12975
  }], [{
12953
12976
  key: "createElement",
@@ -13039,7 +13062,7 @@ var $ = /*#__PURE__*/function () {
13039
13062
  return r.addItem(a);
13040
13063
  });
13041
13064
  var o = Ni.getPosition(t, s);
13042
- yt.addButton(e, r.buttonContainer, o), t[o].push({});
13065
+ Et.addButton(e, r.buttonContainer, o), t[o].push({});
13043
13066
  }
13044
13067
  }, {
13045
13068
  key: "addToSideContainer",
@@ -13047,7 +13070,7 @@ var $ = /*#__PURE__*/function () {
13047
13070
  ["inside-left", "inside-right", "outside-left", "outside-right"].forEach(function (s) {
13048
13071
  var r = s;
13049
13072
  t[r].forEach(function (o) {
13050
- yt.addButton(e, o.button.elementRef, r);
13073
+ Et.addButton(e, o.button.elementRef, r);
13051
13074
  });
13052
13075
  });
13053
13076
  }
@@ -13193,17 +13216,17 @@ var Gi = /*#__PURE__*/function (_ct4) {
13193
13216
  function ua(n) {
13194
13217
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n["default"] : n;
13195
13218
  }
13196
- var pi = {},
13197
- Et = {},
13219
+ var mi = {},
13198
13220
  St = {},
13199
13221
  _t = {},
13200
13222
  xt = {},
13223
+ wt = {},
13201
13224
  Zs;
13202
13225
  function Vi() {
13203
- if (Zs) return xt;
13204
- Zs = 1, Object.defineProperty(xt, "__esModule", {
13226
+ if (Zs) return wt;
13227
+ Zs = 1, Object.defineProperty(wt, "__esModule", {
13205
13228
  value: !0
13206
- }), xt.Text = void 0;
13229
+ }), wt.Text = void 0;
13207
13230
  var n = /*#__PURE__*/function () {
13208
13231
  function n() {
13209
13232
  _classCallCheck(this, n);
@@ -13232,14 +13255,14 @@ function Vi() {
13232
13255
  }
13233
13256
  }]);
13234
13257
  }();
13235
- return xt.Text = n, n.FIRST_CHAR_REGEX = /\S/, n.DOUBLE_LINE = /\n\n/g, n.ONE_LINE = /\n/g, xt;
13258
+ return wt.Text = n, n.FIRST_CHAR_REGEX = /\S/, n.DOUBLE_LINE = /\n\n/g, n.ONE_LINE = /\n/g, wt;
13236
13259
  }
13237
13260
  var Qs;
13238
13261
  function Dn() {
13239
- if (Qs) return _t;
13240
- Qs = 1, Object.defineProperty(_t, "__esModule", {
13262
+ if (Qs) return xt;
13263
+ Qs = 1, Object.defineProperty(xt, "__esModule", {
13241
13264
  value: !0
13242
- }), _t.Translate = void 0;
13265
+ }), xt.Translate = void 0;
13243
13266
  var n = Vi();
13244
13267
  var e = /*#__PURE__*/function () {
13245
13268
  function e() {
@@ -13254,14 +13277,14 @@ function Dn() {
13254
13277
  }
13255
13278
  }]);
13256
13279
  }();
13257
- return _t.Translate = e, _t;
13280
+ return xt.Translate = e, xt;
13258
13281
  }
13259
13282
  var en;
13260
13283
  function fa() {
13261
- if (en) return St;
13262
- en = 1, Object.defineProperty(St, "__esModule", {
13284
+ if (en) return _t;
13285
+ en = 1, Object.defineProperty(_t, "__esModule", {
13263
13286
  value: !0
13264
- }), St.WebSpeechTranscript = void 0;
13287
+ }), _t.WebSpeechTranscript = void 0;
13265
13288
  var n = Dn();
13266
13289
  var e = /*#__PURE__*/function () {
13267
13290
  function e() {
@@ -13298,30 +13321,30 @@ function fa() {
13298
13321
  }
13299
13322
  }]);
13300
13323
  }();
13301
- return St.WebSpeechTranscript = e, St;
13324
+ return _t.WebSpeechTranscript = e, _t;
13302
13325
  }
13303
- var wt = {},
13326
+ var At = {},
13304
13327
  tn;
13305
13328
  function Rs() {
13306
- if (tn) return wt;
13307
- tn = 1, Object.defineProperty(wt, "__esModule", {
13329
+ if (tn) return At;
13330
+ tn = 1, Object.defineProperty(At, "__esModule", {
13308
13331
  value: !0
13309
- }), wt.Browser = void 0;
13332
+ }), At.Browser = void 0;
13310
13333
  var n = /*#__PURE__*/_createClass(function n() {
13311
13334
  _classCallCheck(this, n);
13312
13335
  });
13313
- return wt.Browser = n, n.IS_SAFARI = function () {
13336
+ return At.Browser = n, n.IS_SAFARI = function () {
13314
13337
  return n._IS_SAFARI === void 0 && (n._IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), n._IS_SAFARI;
13315
- }, wt;
13338
+ }, At;
13316
13339
  }
13317
- var At = {},
13318
- Tt = {},
13340
+ var Tt = {},
13341
+ Ct = {},
13319
13342
  sn;
13320
13343
  function pa() {
13321
- if (sn) return Tt;
13322
- sn = 1, Object.defineProperty(Tt, "__esModule", {
13344
+ if (sn) return Ct;
13345
+ sn = 1, Object.defineProperty(Ct, "__esModule", {
13323
13346
  value: !0
13324
- }), Tt.EventListeners = void 0;
13347
+ }), Ct.EventListeners = void 0;
13325
13348
  var n = /*#__PURE__*/function () {
13326
13349
  function n() {
13327
13350
  _classCallCheck(this, n);
@@ -13364,15 +13387,15 @@ function pa() {
13364
13387
  }
13365
13388
  }]);
13366
13389
  }();
13367
- return Tt.EventListeners = n, n.KEY_DOWN_TIMEOUT = null, Tt;
13390
+ return Ct.EventListeners = n, n.KEY_DOWN_TIMEOUT = null, Ct;
13368
13391
  }
13369
- var Ct = {},
13392
+ var Rt = {},
13370
13393
  nn;
13371
13394
  function ma() {
13372
- if (nn) return Ct;
13373
- nn = 1, Object.defineProperty(Ct, "__esModule", {
13395
+ if (nn) return Rt;
13396
+ nn = 1, Object.defineProperty(Rt, "__esModule", {
13374
13397
  value: !0
13375
- }), Ct.PreResultUtils = void 0;
13398
+ }), Rt.PreResultUtils = void 0;
13376
13399
  var n = /*#__PURE__*/function () {
13377
13400
  function n() {
13378
13401
  _classCallCheck(this, n);
@@ -13387,16 +13410,16 @@ function ma() {
13387
13410
  }
13388
13411
  }]);
13389
13412
  }();
13390
- return Ct.PreResultUtils = n, Ct;
13413
+ return Rt.PreResultUtils = n, Rt;
13391
13414
  }
13392
- var Rt = {},
13393
- Mt = {},
13415
+ var Mt = {},
13416
+ kt = {},
13394
13417
  rn;
13395
13418
  function Bn() {
13396
- if (rn) return Mt;
13397
- rn = 1, Object.defineProperty(Mt, "__esModule", {
13419
+ if (rn) return kt;
13420
+ rn = 1, Object.defineProperty(kt, "__esModule", {
13398
13421
  value: !0
13399
- }), Mt.AutoScroll = void 0;
13422
+ }), kt.AutoScroll = void 0;
13400
13423
  var n = /*#__PURE__*/function () {
13401
13424
  function n() {
13402
13425
  _classCallCheck(this, n);
@@ -13432,15 +13455,15 @@ function Bn() {
13432
13455
  }
13433
13456
  }]);
13434
13457
  }();
13435
- return Mt.AutoScroll = n, Mt;
13458
+ return kt.AutoScroll = n, kt;
13436
13459
  }
13437
- var kt = {},
13460
+ var Lt = {},
13438
13461
  on;
13439
13462
  function Ki() {
13440
- if (on) return kt;
13441
- on = 1, Object.defineProperty(kt, "__esModule", {
13463
+ if (on) return Lt;
13464
+ on = 1, Object.defineProperty(Lt, "__esModule", {
13442
13465
  value: !0
13443
- }), kt.Elements = void 0;
13466
+ }), Lt.Elements = void 0;
13444
13467
  var n = /*#__PURE__*/function () {
13445
13468
  function n() {
13446
13469
  _classCallCheck(this, n);
@@ -13487,15 +13510,15 @@ function Ki() {
13487
13510
  }
13488
13511
  }]);
13489
13512
  }();
13490
- return kt.Elements = n, kt;
13513
+ return Lt.Elements = n, Lt;
13491
13514
  }
13492
- var Lt = {},
13515
+ var It = {},
13493
13516
  an;
13494
- function $i() {
13495
- if (an) return Lt;
13496
- an = 1, Object.defineProperty(Lt, "__esModule", {
13517
+ function Wi() {
13518
+ if (an) return It;
13519
+ an = 1, Object.defineProperty(It, "__esModule", {
13497
13520
  value: !0
13498
- }), Lt.Cursor = void 0;
13521
+ }), It.Cursor = void 0;
13499
13522
  var n = /*#__PURE__*/function () {
13500
13523
  function n() {
13501
13524
  _classCallCheck(this, n);
@@ -13576,18 +13599,18 @@ function $i() {
13576
13599
  }
13577
13600
  }]);
13578
13601
  }();
13579
- return Lt.Cursor = n, Lt;
13602
+ return It.Cursor = n, It;
13580
13603
  }
13581
13604
  var ln;
13582
13605
  function Fn() {
13583
- if (ln) return Rt;
13584
- ln = 1, Object.defineProperty(Rt, "__esModule", {
13606
+ if (ln) return Mt;
13607
+ ln = 1, Object.defineProperty(Mt, "__esModule", {
13585
13608
  value: !0
13586
- }), Rt.CommandUtils = void 0;
13609
+ }), Mt.CommandUtils = void 0;
13587
13610
  var n = Bn(),
13588
13611
  e = Ki(),
13589
13612
  t = Rs(),
13590
- i = $i(),
13613
+ i = Wi(),
13591
13614
  s = Vi();
13592
13615
  var r = /*#__PURE__*/function () {
13593
13616
  function r() {
@@ -13683,17 +13706,17 @@ function Fn() {
13683
13706
  }
13684
13707
  }]);
13685
13708
  }();
13686
- return Rt.CommandUtils = r, Rt;
13709
+ return Mt.CommandUtils = r, Mt;
13687
13710
  }
13688
- var It = {},
13711
+ var Ot = {},
13689
13712
  cn;
13690
13713
  function ga() {
13691
- if (cn) return It;
13692
- cn = 1, Object.defineProperty(It, "__esModule", {
13714
+ if (cn) return Ot;
13715
+ cn = 1, Object.defineProperty(Ot, "__esModule", {
13693
13716
  value: !0
13694
- }), It.Highlight = void 0;
13717
+ }), Ot.Highlight = void 0;
13695
13718
  var n = Ki(),
13696
- e = $i();
13719
+ e = Wi();
13697
13720
  var t = /*#__PURE__*/function () {
13698
13721
  function t() {
13699
13722
  _classCallCheck(this, t);
@@ -13742,17 +13765,17 @@ function ga() {
13742
13765
  }
13743
13766
  }]);
13744
13767
  }();
13745
- return It.Highlight = t, It;
13768
+ return Ot.Highlight = t, Ot;
13746
13769
  }
13747
- var Ot = {},
13770
+ var Pt = {},
13748
13771
  dn;
13749
13772
  function ba() {
13750
- if (dn) return Ot;
13751
- dn = 1, Object.defineProperty(Ot, "__esModule", {
13773
+ if (dn) return Pt;
13774
+ dn = 1, Object.defineProperty(Pt, "__esModule", {
13752
13775
  value: !0
13753
- }), Ot.Padding = void 0;
13776
+ }), Pt.Padding = void 0;
13754
13777
  var n = Ki(),
13755
- e = $i(),
13778
+ e = Wi(),
13756
13779
  t = Vi();
13757
13780
  var i = /*#__PURE__*/function () {
13758
13781
  function i() {
@@ -13811,14 +13834,14 @@ function ba() {
13811
13834
  }
13812
13835
  }]);
13813
13836
  }();
13814
- return Ot.Padding = i, Ot;
13837
+ return Pt.Padding = i, Pt;
13815
13838
  }
13816
13839
  var hn;
13817
13840
  function Un() {
13818
- if (hn) return At;
13819
- hn = 1, Object.defineProperty(At, "__esModule", {
13841
+ if (hn) return Tt;
13842
+ hn = 1, Object.defineProperty(Tt, "__esModule", {
13820
13843
  value: !0
13821
- }), At.Speech = void 0;
13844
+ }), Tt.Speech = void 0;
13822
13845
  var n = pa(),
13823
13846
  e = ma(),
13824
13847
  t = Fn(),
@@ -13827,7 +13850,7 @@ function Un() {
13827
13850
  r = Ki(),
13828
13851
  o = ba(),
13829
13852
  a = Rs(),
13830
- l = $i(),
13853
+ l = Wi(),
13831
13854
  c = Vi();
13832
13855
  var d = /*#__PURE__*/function () {
13833
13856
  function d() {
@@ -13937,14 +13960,14 @@ function Un() {
13937
13960
  }
13938
13961
  }]);
13939
13962
  }();
13940
- return At.Speech = d, At;
13963
+ return Tt.Speech = d, Tt;
13941
13964
  }
13942
13965
  var un;
13943
13966
  function va() {
13944
- if (un) return Et;
13945
- un = 1, Object.defineProperty(Et, "__esModule", {
13967
+ if (un) return St;
13968
+ un = 1, Object.defineProperty(St, "__esModule", {
13946
13969
  value: !0
13947
- }), Et.WebSpeech = void 0;
13970
+ }), St.WebSpeech = void 0;
13948
13971
  var n = fa(),
13949
13972
  e = Rs(),
13950
13973
  t = Un();
@@ -14012,15 +14035,15 @@ function va() {
14012
14035
  }
14013
14036
  }]);
14014
14037
  }(t.Speech);
14015
- return Et.WebSpeech = i, Et;
14038
+ return St.WebSpeech = i, St;
14016
14039
  }
14017
- var Pt = {},
14040
+ var Nt = {},
14018
14041
  fn;
14019
14042
  function ya() {
14020
- if (fn) return Pt;
14021
- fn = 1, Object.defineProperty(Pt, "__esModule", {
14043
+ if (fn) return Nt;
14044
+ fn = 1, Object.defineProperty(Nt, "__esModule", {
14022
14045
  value: !0
14023
- }), Pt.GlobalState = void 0;
14046
+ }), Nt.GlobalState = void 0;
14024
14047
  var n = /*#__PURE__*/function () {
14025
14048
  function n() {
14026
14049
  _classCallCheck(this, n);
@@ -14034,16 +14057,16 @@ function ya() {
14034
14057
  }
14035
14058
  }]);
14036
14059
  }();
14037
- return Pt.GlobalState = n, n.doubleClickPending = !1, Pt;
14060
+ return Nt.GlobalState = n, n.doubleClickPending = !1, Nt;
14038
14061
  }
14039
- var Nt = {},
14040
- Dt = {},
14062
+ var Dt = {},
14063
+ Bt = {},
14041
14064
  pn;
14042
14065
  function Ea() {
14043
- if (pn) return Dt;
14044
- pn = 1, Object.defineProperty(Dt, "__esModule", {
14066
+ if (pn) return Bt;
14067
+ pn = 1, Object.defineProperty(Bt, "__esModule", {
14045
14068
  value: !0
14046
- }), Dt.PreventConnectionStop = void 0;
14069
+ }), Bt.PreventConnectionStop = void 0;
14047
14070
  var n = /*#__PURE__*/function () {
14048
14071
  function n() {
14049
14072
  _classCallCheck(this, n);
@@ -14062,22 +14085,22 @@ function Ea() {
14062
14085
  }
14063
14086
  }]);
14064
14087
  }();
14065
- return Dt.PreventConnectionStop = n, Dt;
14088
+ return Bt.PreventConnectionStop = n, Bt;
14066
14089
  }
14067
- var Bt = {},
14068
- Ft = {},
14090
+ var Ft = {},
14091
+ Ut = {},
14069
14092
  mn;
14070
14093
  function Sa() {
14071
- return mn || (mn = 1, Object.defineProperty(Ft, "__esModule", {
14094
+ return mn || (mn = 1, Object.defineProperty(Ut, "__esModule", {
14072
14095
  value: !0
14073
- }), Ft.README_URL = void 0, Ft.README_URL = "https://github.com/OvidijusParsiunas/speech-to-element"), Ft;
14096
+ }), Ut.README_URL = void 0, Ut.README_URL = "https://github.com/OvidijusParsiunas/speech-to-element"), Ut;
14074
14097
  }
14075
14098
  var gn;
14076
14099
  function _a() {
14077
- if (gn) return Bt;
14078
- gn = 1, Object.defineProperty(Bt, "__esModule", {
14100
+ if (gn) return Ft;
14101
+ gn = 1, Object.defineProperty(Ft, "__esModule", {
14079
14102
  value: !0
14080
- }), Bt.AzureSpeechConfig = void 0;
14103
+ }), Ft.AzureSpeechConfig = void 0;
14081
14104
  var n = Sa();
14082
14105
  var e = /*#__PURE__*/function () {
14083
14106
  function e() {
@@ -14146,15 +14169,15 @@ function _a() {
14146
14169
  }()
14147
14170
  }]);
14148
14171
  }();
14149
- return Bt.AzureSpeechConfig = e, Bt;
14172
+ return Ft.AzureSpeechConfig = e, Ft;
14150
14173
  }
14151
- var Ut = {},
14174
+ var jt = {},
14152
14175
  bn;
14153
14176
  function xa() {
14154
- if (bn) return Ut;
14155
- bn = 1, Object.defineProperty(Ut, "__esModule", {
14177
+ if (bn) return jt;
14178
+ bn = 1, Object.defineProperty(jt, "__esModule", {
14156
14179
  value: !0
14157
- }), Ut.StopTimeout = void 0;
14180
+ }), jt.StopTimeout = void 0;
14158
14181
  var n = /*#__PURE__*/function () {
14159
14182
  function n() {
14160
14183
  _classCallCheck(this, n);
@@ -14178,15 +14201,15 @@ function xa() {
14178
14201
  }
14179
14202
  }]);
14180
14203
  }();
14181
- return Ut.StopTimeout = n, n.DEFAULT_MS = 2e4, Ut;
14204
+ return jt.StopTimeout = n, n.DEFAULT_MS = 2e4, jt;
14182
14205
  }
14183
- var jt = {},
14206
+ var Ht = {},
14184
14207
  vn;
14185
14208
  function wa() {
14186
- if (vn) return jt;
14187
- vn = 1, Object.defineProperty(jt, "__esModule", {
14209
+ if (vn) return Ht;
14210
+ vn = 1, Object.defineProperty(Ht, "__esModule", {
14188
14211
  value: !0
14189
- }), jt.AzureAudioConfig = void 0;
14212
+ }), Ht.AzureAudioConfig = void 0;
14190
14213
  var n = /*#__PURE__*/function () {
14191
14214
  function n() {
14192
14215
  _classCallCheck(this, n);
@@ -14198,7 +14221,7 @@ function wa() {
14198
14221
  }
14199
14222
  }]);
14200
14223
  }();
14201
- return jt.AzureAudioConfig = n, jt;
14224
+ return Ht.AzureAudioConfig = n, Ht;
14202
14225
  }
14203
14226
  var qt = {},
14204
14227
  yn;
@@ -14233,10 +14256,10 @@ function Aa() {
14233
14256
  }
14234
14257
  var En;
14235
14258
  function Ta() {
14236
- if (En) return Nt;
14237
- En = 1, Object.defineProperty(Nt, "__esModule", {
14259
+ if (En) return Dt;
14260
+ En = 1, Object.defineProperty(Dt, "__esModule", {
14238
14261
  value: !0
14239
- }), Nt.Azure = void 0;
14262
+ }), Dt.Azure = void 0;
14240
14263
  var n = Ea(),
14241
14264
  e = _a(),
14242
14265
  t = xa(),
@@ -14407,12 +14430,12 @@ function Ta() {
14407
14430
  }
14408
14431
  }]);
14409
14432
  }(r.Speech);
14410
- return Nt.Azure = o, Nt;
14433
+ return Dt.Azure = o, Dt;
14411
14434
  }
14412
14435
  var Sn;
14413
14436
  function Ca() {
14414
- if (Sn) return pi;
14415
- Sn = 1, Object.defineProperty(pi, "__esModule", {
14437
+ if (Sn) return mi;
14438
+ Sn = 1, Object.defineProperty(mi, "__esModule", {
14416
14439
  value: !0
14417
14440
  });
14418
14441
  var n = va(),
@@ -14459,10 +14482,10 @@ function Ca() {
14459
14482
  }
14460
14483
  }]);
14461
14484
  }();
14462
- return pi["default"] = s, pi;
14485
+ return mi["default"] = s, mi;
14463
14486
  }
14464
14487
  var Ra = Ca();
14465
- var mi = /* @__PURE__ */ua(Ra);
14488
+ var gi = /* @__PURE__ */ua(Ra);
14466
14489
  var Ma = /*#__PURE__*/function () {
14467
14490
  function Ma(e, t) {
14468
14491
  _classCallCheck(this, Ma);
@@ -14474,7 +14497,7 @@ var Ma = /*#__PURE__*/function () {
14474
14497
  var _this73 = this;
14475
14498
  this._silenceTimeout = setTimeout(function () {
14476
14499
  var i;
14477
- (i = e.submit) == null || i.call(e), mi.stop(), _this73._stop || setTimeout(t, ri.MICROPHONE_RESET_TIMEOUT_MS);
14500
+ (i = e.submit) == null || i.call(e), gi.stop(), _this73._stop || setTimeout(t, oi.MICROPHONE_RESET_TIMEOUT_MS);
14478
14501
  }, this._silenceMS);
14479
14502
  }
14480
14503
  }, {
@@ -14503,7 +14526,7 @@ var Zt = /*#__PURE__*/function (_Gi) {
14503
14526
  var _this74$processConfig = _this74.processConfiguration(t, e.speechToText),
14504
14527
  r = _this74$processConfig.serviceName,
14505
14528
  o = _this74$processConfig.processedConfig;
14506
- if (_this74._addErrorMessage = i, r === "webspeech" && !mi.isWebSpeechSupported()) _this74.changeToUnsupported();else {
14529
+ if (_this74._addErrorMessage = i, r === "webspeech" && !gi.isWebSpeechSupported()) _this74.changeToUnsupported();else {
14507
14530
  var a = !e.textInput || !e.textInput.disabled;
14508
14531
  _this74.elementRef.onclick = _this74.buttonClick.bind(_this74, t, a, r, o);
14509
14532
  }
@@ -14534,7 +14557,7 @@ var Zt = /*#__PURE__*/function (_Gi) {
14534
14557
  return d.toLowerCase().includes(a) ? (setTimeout(function () {
14535
14558
  var u;
14536
14559
  return (u = e.submit) == null ? void 0 : u.call(e);
14537
- }), mi.endCommandMode(), {
14560
+ }), gi.endCommandMode(), {
14538
14561
  restart: !0,
14539
14562
  removeNewText: !0
14540
14563
  }) : null;
@@ -14548,7 +14571,7 @@ var Zt = /*#__PURE__*/function (_Gi) {
14548
14571
  value: function buttonClick(e, t, i, s) {
14549
14572
  var _this75 = this;
14550
14573
  var r = s == null ? void 0 : s.events;
14551
- e.removePlaceholderStyle(), mi.toggle(i, _objectSpread({
14574
+ e.removePlaceholderStyle(), gi.toggle(i, _objectSpread({
14552
14575
  insertInCursorLocation: !1,
14553
14576
  element: t ? e.inputElementRef : void 0,
14554
14577
  onError: function onError() {
@@ -14607,20 +14630,21 @@ var Zt = /*#__PURE__*/function (_Gi) {
14607
14630
  }]);
14608
14631
  }(Gi);
14609
14632
  Zt.MICROPHONE_RESET_TIMEOUT_MS = 300;
14610
- var ri = Zt;
14633
+ var oi = Zt;
14611
14634
  var Ne = /*#__PURE__*/function () {
14612
14635
  // prettier-ignore
14613
- function Ne(e, t, i, s) {
14636
+ function Ne(e, t, i, s, r) {
14614
14637
  var _this76 = this;
14615
14638
  _classCallCheck(this, Ne);
14616
- this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", this._hiddenAttachments = /* @__PURE__ */new Set(), t.maxNumberOfFiles && (this._fileCountLimit = t.maxNumberOfFiles), this._toggleContainerDisplay = i, this._fileAttachmentsContainerRef = s, t.acceptedFormats && (this._acceptedFormat = t.acceptedFormats), setTimeout(function () {
14617
- _this76._validationHandler = e._validationHandler;
14639
+ this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", this._hiddenAttachments = /* @__PURE__ */new Set(), i.maxNumberOfFiles && (this._fileCountLimit = i.maxNumberOfFiles), this._toggleContainerDisplay = s, this._fileAttachmentsContainerRef = r, i.acceptedFormats && (this._acceptedFormat = i.acceptedFormats), setTimeout(function () {
14640
+ _this76._validationHandler = e._validationHandler, _this76._onInput = t.onInput;
14618
14641
  });
14619
14642
  }
14620
14643
  return _createClass(Ne, [{
14621
14644
  key: "attemptAddFile",
14622
14645
  value: function attemptAddFile(e, t) {
14623
- return Ne.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), !0) : !1;
14646
+ var i;
14647
+ return Ne.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), (i = this._onInput) == null || i.call(this, !0), !0) : !1;
14624
14648
  }
14625
14649
  }, {
14626
14650
  key: "addAttachmentBasedOnType",
@@ -14630,7 +14654,7 @@ var Ne = /*#__PURE__*/function () {
14630
14654
  var r = Ne.createImageAttachment(t);
14631
14655
  this.addFileAttachment(e, "image", r, i);
14632
14656
  } else if (s === "audio") {
14633
- var _r3 = oi.createAudioAttachment(t);
14657
+ var _r3 = ai.createAudioAttachment(t);
14634
14658
  this.addFileAttachment(e, "audio", _r3, i);
14635
14659
  } else {
14636
14660
  var _r4 = Ne.createAnyFileAttachment(e.name);
@@ -14665,13 +14689,14 @@ var Ne = /*#__PURE__*/function () {
14665
14689
  }
14666
14690
  }, {
14667
14691
  key: "removeAttachment",
14668
- value: function removeAttachment(e) {
14669
- var s;
14670
- var t = this._attachments.findIndex(function (r) {
14671
- return r === e;
14692
+ value: function removeAttachment(e, t) {
14693
+ var r, o;
14694
+ (r = this._onInput) == null || r.call(this, !!(t != null && t.isTrusted));
14695
+ var i = this._attachments.findIndex(function (a) {
14696
+ return a === e;
14672
14697
  }),
14673
- i = this._attachments[t].attachmentContainerElement;
14674
- this._attachments.splice(t, 1), oi.stopAttachmentPlayback(i), i.remove(), this._toggleContainerDisplay(!1), (s = this._validationHandler) == null || s.call(this);
14698
+ s = this._attachments[i].attachmentContainerElement;
14699
+ this._attachments.splice(i, 1), ai.stopAttachmentPlayback(s), s.remove(), this._toggleContainerDisplay(!1), (o = this._validationHandler) == null || o.call(this);
14675
14700
  }
14676
14701
  }, {
14677
14702
  key: "getFiles",
@@ -14708,9 +14733,10 @@ var Ne = /*#__PURE__*/function () {
14708
14733
  key: "readdAttachments",
14709
14734
  value: function readdAttachments() {
14710
14735
  var _this78 = this;
14711
- Array.from(this._hiddenAttachments).forEach(function (e) {
14712
- _this78._fileAttachmentsContainerRef.appendChild(e.attachmentContainerElement), _this78._attachments.push(e);
14713
- }), this._hiddenAttachments.clear();
14736
+ var e;
14737
+ Array.from(this._hiddenAttachments).forEach(function (t) {
14738
+ _this78._fileAttachmentsContainerRef.appendChild(t.attachmentContainerElement), _this78._attachments.push(t);
14739
+ }), (e = this._onInput) == null || e.call(this, !1), this._hiddenAttachments.clear();
14714
14740
  }
14715
14741
  }], [{
14716
14742
  key: "isFileTypeValid",
@@ -14762,9 +14788,9 @@ var Ne = /*#__PURE__*/function () {
14762
14788
  }();
14763
14789
  var Oe = /*#__PURE__*/function (_Ne) {
14764
14790
  // prettier-ignore
14765
- function Oe(e, t, i, s) {
14791
+ function Oe(e, t, i, s, r) {
14766
14792
  _classCallCheck(this, Oe);
14767
- return _callSuper(this, Oe, [e, t, i, s]);
14793
+ return _callSuper(this, Oe, [e, t, i, s, r]);
14768
14794
  }
14769
14795
  _inherits(Oe, _Ne);
14770
14796
  return _createClass(Oe, [{
@@ -14842,7 +14868,7 @@ var Oe = /*#__PURE__*/function (_Ne) {
14842
14868
  }, {
14843
14869
  key: "addAudioElements",
14844
14870
  value: function addAudioElements(e, t) {
14845
- var i = e.parentElement ? G.cloneElement(e) : e,
14871
+ var i = e.parentElement ? V.cloneElement(e) : e,
14846
14872
  s = document.createElement("audio");
14847
14873
  s.src = t;
14848
14874
  var r = Ue.createSVGElement(Pn);
@@ -14873,7 +14899,7 @@ var Oe = /*#__PURE__*/function (_Ne) {
14873
14899
  }]);
14874
14900
  }(Ne);
14875
14901
  Oe.TIMER_LIMIT_S = 5999;
14876
- var oi = Oe;
14902
+ var ai = Oe;
14877
14903
  var ka = /*#__PURE__*/function () {
14878
14904
  function ka() {
14879
14905
  _classCallCheck(this, ka);
@@ -14882,24 +14908,24 @@ var ka = /*#__PURE__*/function () {
14882
14908
  key: "create",
14883
14909
  value:
14884
14910
  // prettier-ignore
14885
- function create(e, t, i, s, r) {
14886
- return r === "audio" ? new oi(e, t, i, s) : new Ne(e, t, i, s);
14911
+ function create(e, t, i, s, r, o) {
14912
+ return o === "audio" ? new ai(e, t, i, s, r) : new Ne(e, t, i, s, r);
14887
14913
  }
14888
14914
  }]);
14889
14915
  }();
14890
- var di = /*#__PURE__*/function () {
14891
- function di(e, t, i) {
14892
- _classCallCheck(this, di);
14916
+ var hi = /*#__PURE__*/function () {
14917
+ function hi(e, t, i) {
14918
+ _classCallCheck(this, hi);
14893
14919
  this._fileAttachmentsTypes = [], this.elementRef = this.createAttachmentContainer();
14894
14920
  var s = _typeof(i) == "object" && !!i.displayFileAttachmentContainer;
14895
14921
  this.toggleContainerDisplay(s), e.appendChild(this.elementRef), t && Object.assign(this.elementRef.style, t);
14896
14922
  }
14897
14923
  // prettier-ignore
14898
- return _createClass(di, [{
14924
+ return _createClass(hi, [{
14899
14925
  key: "addType",
14900
- value: function addType(e, t, i) {
14901
- var s = ka.create(e, t, this.toggleContainerDisplay.bind(this), this.elementRef, i);
14902
- return this._fileAttachmentsTypes.push(s), s;
14926
+ value: function addType(e, t, i, s) {
14927
+ var r = ka.create(e, t, i, this.toggleContainerDisplay.bind(this), this.elementRef, s);
14928
+ return this._fileAttachmentsTypes.push(r), r;
14903
14929
  }
14904
14930
  }, {
14905
14931
  key: "createAttachmentContainer",
@@ -14959,7 +14985,7 @@ var di = /*#__PURE__*/function () {
14959
14985
  }, {
14960
14986
  key: "addFilesToAnyType",
14961
14987
  value: function addFilesToAnyType(e) {
14962
- di.addFilesToType(e, this._fileAttachmentsTypes);
14988
+ hi.addFilesToType(e, this._fileAttachmentsTypes);
14963
14989
  }
14964
14990
  }, {
14965
14991
  key: "hideFiles",
@@ -14999,12 +15025,12 @@ var di = /*#__PURE__*/function () {
14999
15025
  }
15000
15026
  }]);
15001
15027
  }();
15002
- var ge = /*#__PURE__*/function () {
15003
- function ge(e, t, i) {
15004
- _classCallCheck(this, ge);
15005
- this._isOpen = !1, this._contentRef = ge.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = ge.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = ge.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = ge.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents(e);
15028
+ var be = /*#__PURE__*/function () {
15029
+ function be(e, t, i) {
15030
+ _classCallCheck(this, be);
15031
+ this._isOpen = !1, this._contentRef = be.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = be.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = be.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = be.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents(e);
15006
15032
  }
15007
- return _createClass(ge, [{
15033
+ return _createClass(be, [{
15008
15034
  key: "isOpen",
15009
15035
  value: function isOpen() {
15010
15036
  return this._isOpen;
@@ -15026,7 +15052,7 @@ var ge = /*#__PURE__*/function () {
15026
15052
  var _this82 = this;
15027
15053
  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 () {
15028
15054
  _this82._elementRef.style.display = "none", _this82._backgroundPanelRef.style.display = "none";
15029
- }, ge.MODAL_CLOSE_TIMEOUT_MS);
15055
+ }, be.MODAL_CLOSE_TIMEOUT_MS);
15030
15056
  }
15031
15057
  }, {
15032
15058
  key: "displayModalElements",
@@ -15042,7 +15068,7 @@ var ge = /*#__PURE__*/function () {
15042
15068
  key: "addCloseButton",
15043
15069
  value: function addCloseButton(e, t, i) {
15044
15070
  var _this83 = this;
15045
- var s = t ? ge.createSVGButton(e) : ge.createTextButton(e);
15071
+ var s = t ? be.createSVGButton(e) : be.createTextButton(e);
15046
15072
  return this.addButtons(s), s.onclick = function () {
15047
15073
  _this83.close(), setTimeout(function () {
15048
15074
  i == null || i();
@@ -15104,14 +15130,14 @@ var ge = /*#__PURE__*/function () {
15104
15130
  value: function createTextModalFunc(e, t, i) {
15105
15131
  var s;
15106
15132
  if (_typeof(t) == "object" && (s = t.files) != null && s.infoModal) {
15107
- var r = new ge(e, ["modal-content"], t.files.infoModal.containerStyle);
15133
+ var r = new be(e, ["modal-content"], t.files.infoModal.containerStyle);
15108
15134
  return r.addCloseButton("OK", !1, i), r.openTextModal.bind(r, t.infoModalTextMarkUp || "");
15109
15135
  }
15110
15136
  }
15111
15137
  }]);
15112
15138
  }();
15113
- ge.MODAL_CLOSE_TIMEOUT_MS = 190;
15114
- var tt = ge;
15139
+ be.MODAL_CLOSE_TIMEOUT_MS = 190;
15140
+ var tt = be;
15115
15141
  var Di = /*#__PURE__*/function (_ct5) {
15116
15142
  // prettier-ignore
15117
15143
  function Di(e, t, i, s, r, o) {
@@ -15141,7 +15167,7 @@ var Di = /*#__PURE__*/function (_ct5) {
15141
15167
  }, {
15142
15168
  key: "import",
15143
15169
  value: function _import(e) {
15144
- di.addFilesToType(Array.from(e.files || []), [this._fileAttachmentsType]), e.value = "";
15170
+ hi.addFilesToType(Array.from(e.files || []), [this._fileAttachmentsType]), e.value = "";
15145
15171
  }
15146
15172
  }, {
15147
15173
  key: "addClickEvent",
@@ -15222,11 +15248,11 @@ var Pe = /*#__PURE__*/function () {
15222
15248
  }
15223
15249
  }]);
15224
15250
  }();
15225
- var We = /*#__PURE__*/function () {
15226
- function We() {
15227
- _classCallCheck(this, We);
15251
+ var $e = /*#__PURE__*/function () {
15252
+ function $e() {
15253
+ _classCallCheck(this, $e);
15228
15254
  }
15229
- return _createClass(We, null, [{
15255
+ return _createClass($e, null, [{
15230
15256
  key: "validate",
15231
15257
  value:
15232
15258
  // prettier-ignore
@@ -15250,7 +15276,7 @@ var We = /*#__PURE__*/function () {
15250
15276
  o = i.getAllFileData(), a = o == null ? void 0 : o.map(function (l) {
15251
15277
  return l.file;
15252
15278
  });
15253
- return _context129.abrupt("return", We.validate(e, s, r, a));
15279
+ return _context129.abrupt("return", $e.validate(e, s, r, a));
15254
15280
  case 5:
15255
15281
  case "end":
15256
15282
  return _context129.stop();
@@ -15273,7 +15299,7 @@ var We = /*#__PURE__*/function () {
15273
15299
  s = (r = t.files) == null ? void 0 : r.map(function (o) {
15274
15300
  return o.file;
15275
15301
  });
15276
- return _context130.abrupt("return", We.validate(e, i, t.text, s, !0));
15302
+ return _context130.abrupt("return", $e.validate(e, i, t.text, s, !0));
15277
15303
  case 2:
15278
15304
  case "end":
15279
15305
  return _context130.stop();
@@ -15290,7 +15316,7 @@ var We = /*#__PURE__*/function () {
15290
15316
  value: function validateWebsocket(e, t) {
15291
15317
  var i = e.websocket,
15292
15318
  s = e.connectSettings;
15293
- return i && s.url !== ve.URL && !q.canSendMessage(i) ? (t.changeToDisabledIcon(), !1) : !0;
15319
+ return i && s.url !== ye.URL && !H.canSendMessage(i) ? (t.changeToDisabledIcon(), !1) : !0;
15294
15320
  }
15295
15321
  // prettier-ignore
15296
15322
  }, {
@@ -15303,14 +15329,14 @@ var We = /*#__PURE__*/function () {
15303
15329
  return _regeneratorRuntime().wrap(function _callee131$(_context131) {
15304
15330
  while (1) switch (_context131.prev = _context131.next) {
15305
15331
  case 0:
15306
- if (!(r.status.loadingActive || r.status.requestInProgress || t.isSubmitProgrammaticallyDisabled === !0 || !We.validateWebsocket(t, r))) {
15332
+ if (!(r.status.loadingActive || r.status.requestInProgress || t.isSubmitProgrammaticallyDisabled === !0 || !$e.validateWebsocket(t, r))) {
15307
15333
  _context131.next = 2;
15308
15334
  break;
15309
15335
  }
15310
15336
  return _context131.abrupt("return", !1);
15311
15337
  case 2:
15312
15338
  l = o || t.canSendMessage;
15313
- return _context131.abrupt("return", l ? a ? We.useValidationFuncProgrammatic(l, a, r) : We.useValidationFunc(l, i, s, r) : null);
15339
+ return _context131.abrupt("return", l ? a ? $e.useValidationFuncProgrammatic(l, a, r) : $e.useValidationFunc(l, i, s, r) : null);
15314
15340
  case 4:
15315
15341
  case "end":
15316
15342
  return _context131.stop();
@@ -15468,21 +15494,21 @@ var P = /*#__PURE__*/function (_ct6) {
15468
15494
  key: "createCustomElements",
15469
15495
  value: function createCustomElements() {
15470
15496
  var _this90 = this;
15471
- var e = Ae.createCustomElements("submit", this.svg, this.customStyles),
15497
+ var e = Te.createCustomElements("submit", this.svg, this.customStyles),
15472
15498
  t = {
15473
15499
  loading: void 0,
15474
15500
  stop: void 0
15475
15501
  };
15476
15502
  return Object.keys(t).forEach(function (i) {
15477
15503
  var s = i,
15478
- r = Ae.createCustomElements(s, _this90.svg, _this90.customStyles);
15504
+ r = Te.createCustomElements(s, _this90.svg, _this90.customStyles);
15479
15505
  r && (t[s] = r);
15480
15506
  }), t.submit = e || this.buildDefaultIconElement("submit-icon"), t;
15481
15507
  }
15482
15508
  }, {
15483
15509
  key: "createDisabledIconElement",
15484
15510
  value: function createDisabledIconElement(e) {
15485
- return Ae.createCustomElements("disabled", this.svg, this.customStyles) || [e[0].cloneNode(!0)];
15511
+ return Te.createCustomElements("disabled", this.svg, this.customStyles) || [e[0].cloneNode(!0)];
15486
15512
  }
15487
15513
  // prettier-ignore
15488
15514
  }, {
@@ -15705,7 +15731,7 @@ var P = /*#__PURE__*/function (_ct6) {
15705
15731
  var _this92 = this;
15706
15732
  this.elementRef.classList.contains(P.SUBMIT_CLASS) || (this.elementRef.classList.remove(P.LOADING_CLASS, P.DISABLED_CLASS), N.removeAriaAttributes(this.elementRef), this.elementRef.classList.add(P.SUBMIT_CLASS), this.changeElementsByState(this._innerElements.submit), it.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = function () {
15707
15733
  var e;
15708
- _this92.submitFromInput(), (e = _this92._microphoneButton) != null && e.isActive && ri.toggleSpeechAfterSubmit(_this92._microphoneButton.elementRef, !!_this92._stopSTTAfterSubmit);
15734
+ _this92.submitFromInput(), (e = _this92._microphoneButton) != null && e.isActive && oi.toggleSpeechAfterSubmit(_this92._microphoneButton.elementRef, !!_this92._stopSTTAfterSubmit);
15709
15735
  });
15710
15736
  }
15711
15737
  // called every time when user triggers an input via ValidationHandler - hence use class to check if not already present
@@ -15782,7 +15808,7 @@ var Ms = /*#__PURE__*/function (_tt) {
15782
15808
  _this94.capture();
15783
15809
  }, t.addEventListener("click", this.stop.bind(this)), i.onclick = function () {
15784
15810
  var r = _this94.getFile();
15785
- r && di.addFilesToType([r], [s]), _this94.stop(), _this94.close();
15811
+ r && hi.addFilesToType([r], [s]), _this94.stop(), _this94.close();
15786
15812
  };
15787
15813
  }
15788
15814
  }, {
@@ -15897,36 +15923,36 @@ var ks = /*#__PURE__*/function (_ct7) {
15897
15923
  }
15898
15924
  }]);
15899
15925
  }(ct);
15900
- var Kt = /*#__PURE__*/function () {
15901
- function Kt(e, t, i, s) {
15902
- _classCallCheck(this, Kt);
15903
- this.elementRef = Kt.createPanelElement(e.inputAreaStyle);
15926
+ var ht = /*#__PURE__*/function () {
15927
+ function ht(e, t, i, s) {
15928
+ _classCallCheck(this, ht);
15929
+ this.elementRef = ht.createPanelElement(e.inputAreaStyle);
15904
15930
  var r = {},
15905
15931
  o = this.createFileUploadComponents(e, i, s, r),
15906
- a = new vi(e, i, o);
15932
+ a = new yi(e, i, o);
15907
15933
  e.speechToText && !r.microphone && (r.microphone = {
15908
- button: new ri(e, a, t.addNewErrorMessage.bind(t))
15934
+ button: new oi(e, a, t.addNewErrorMessage.bind(t))
15909
15935
  });
15910
15936
  var l = new vs(e, a, t, i, o, r);
15911
- a.submit = l.submitFromInput.bind(l), We.attach(e, i, a, o, l), e.submitUserMessage = l.programmaticSubmit.bind(l), r.submit = {
15937
+ a.submit = l.submitFromInput.bind(l), $e.attach(e, i, a, o, l), e.submitUserMessage = l.programmaticSubmit.bind(l), r.submit = {
15912
15938
  button: l
15913
- }, e.customButtons && st.add(e, r), Kt.addElements(this.elementRef, a, r, s, o, e.dropupStyles);
15939
+ }, e.customButtons && st.add(e, r), ht.addElements(this.elementRef, a, r, s, o, e.dropupStyles), ht.assignOnInput(e, i, o, a);
15914
15940
  }
15915
- return _createClass(Kt, [{
15941
+ return _createClass(ht, [{
15916
15942
  key: "createFileUploadComponents",
15917
15943
  value:
15918
15944
  // prettier-ignore
15919
15945
  function createFileUploadComponents(e, t, i, s) {
15920
15946
  var o, a, l, c;
15921
- var r = new di(this.elementRef, e.attachmentContainerStyle, t.demo);
15922
- if (Kt.createUploadButtons(e, t.fileTypes || {}, r, i, s), (o = t.camera) != null && o.files) {
15923
- var d = ((a = s.images) == null ? void 0 : a.fileType) || r.addType(e, t.camera.files, "images");
15947
+ var r = new hi(this.elementRef, e.attachmentContainerStyle, t.demo);
15948
+ if (ht.createUploadButtons(e, t, t.fileTypes || {}, r, i, s), (o = t.camera) != null && o.files) {
15949
+ var d = ((a = s.images) == null ? void 0 : a.fileType) || r.addType(e, t, t.camera.files, "images");
15924
15950
  s.camera = {
15925
15951
  button: new ks(i, d, t.camera)
15926
15952
  };
15927
15953
  }
15928
15954
  if ((l = t.recordAudio) != null && l.files) {
15929
- var _d = ((c = s.audio) == null ? void 0 : c.fileType) || r.addType(e, t.recordAudio.files, "audio");
15955
+ var _d = ((c = s.audio) == null ? void 0 : c.fileType) || r.addType(e, t, t.recordAudio.files, "audio");
15930
15956
  s.microphone = {
15931
15957
  button: new La(_d, t.recordAudio)
15932
15958
  };
@@ -15942,20 +15968,20 @@ var Kt = /*#__PURE__*/function () {
15942
15968
  }
15943
15969
  }, {
15944
15970
  key: "createUploadButtons",
15945
- value: function createUploadButtons(e, t, i, s, r) {
15946
- Object.keys(t).forEach(function (o) {
15947
- var a = o,
15948
- l = t[a];
15949
- if (l.files) {
15950
- var c = i.addType(e, l.files, a),
15951
- _ha$a = ha[a],
15952
- d = _ha$a.id,
15953
- u = _ha$a.svgString,
15954
- h = _ha$a.dropupText,
15955
- f = new Di(s, c, l, d, u, h);
15956
- r[a] = {
15957
- button: f,
15958
- fileType: c
15971
+ value: function createUploadButtons(e, t, i, s, r, o) {
15972
+ Object.keys(i).forEach(function (a) {
15973
+ var l = a,
15974
+ c = i[l];
15975
+ if (c.files) {
15976
+ var d = s.addType(e, t, c.files, l),
15977
+ _ha$l = ha[l],
15978
+ u = _ha$l.id,
15979
+ h = _ha$l.svgString,
15980
+ f = _ha$l.dropupText,
15981
+ m = new Di(r, d, c, u, h, f);
15982
+ o[l] = {
15983
+ button: m,
15984
+ fileType: d
15959
15985
  };
15960
15986
  }
15961
15987
  });
@@ -15964,10 +15990,25 @@ var Kt = /*#__PURE__*/function () {
15964
15990
  }, {
15965
15991
  key: "addElements",
15966
15992
  value: function addElements(e, t, i, s, r, o) {
15967
- G.addElements(e, t.elementRef);
15968
- var a = yt.create(),
15993
+ V.addElements(e, t.elementRef);
15994
+ var a = Et.create(),
15969
15995
  l = $.addButtons(a, i, s, o);
15970
- bs.set(t.inputElementRef, a, r.elementRef, l), yt.add(e, a);
15996
+ bs.set(t.inputElementRef, a, r.elementRef, l), Et.add(e, a);
15997
+ }
15998
+ }, {
15999
+ key: "assignOnInput",
16000
+ value: function assignOnInput(e, t, i, s) {
16001
+ t.onInput = function (r) {
16002
+ setTimeout(function () {
16003
+ var o = i.getAllFileData(),
16004
+ l = {
16005
+ text: s.inputElementRef.innerText.trim()
16006
+ };
16007
+ o && (l.files = o.map(function (c) {
16008
+ return c.file;
16009
+ })), ii.onInput(e, l, r);
16010
+ });
16011
+ };
15971
16012
  }
15972
16013
  }]);
15973
16014
  }();
@@ -15981,9 +16022,9 @@ var Ls = /*#__PURE__*/function () {
15981
16022
  var s = document.createElement("div");
15982
16023
  s.id = "chat-view";
15983
16024
  var r = new de(e, t, i);
15984
- t.websocket && q.createConnection(t, r);
15985
- var o = new Kt(e, r, t, s);
15986
- return G.addElements(s, r.elementRef, o.elementRef), s;
16025
+ t.websocket && H.createConnection(t, r);
16026
+ var o = new ht(e, r, t, s);
16027
+ return V.addElements(s, r.elementRef, o.elementRef), s;
15987
16028
  }
15988
16029
  }, {
15989
16030
  key: "render",
@@ -16010,10 +16051,10 @@ var _ = /*#__PURE__*/function (_rs) {
16010
16051
  }, _this98.addMessage = function () {
16011
16052
  return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
16012
16053
  }, _this98.updateMessage = function () {}, _this98.clearMessages = function () {}, _this98.focusInput = function () {
16013
- return ai.focusFromParentElement(_this98._elementRef);
16054
+ return li.focusFromParentElement(_this98._elementRef);
16014
16055
  }, _this98.refreshMessages = function () {}, _this98.scrollToBottom = function () {}, _this98.disableSubmitButton = function () {}, _this98.setPlaceholderText = function () {}, _this98._hasBeenRendered = !1, _this98._auxiliaryStyleApplied = !1, _this98._elementRef = document.createElement("div"), _this98._elementRef.id = "container", _this98.attachShadow({
16015
16056
  mode: "open"
16016
- }).appendChild(_this98._elementRef), Ht.apply(Fa, _this98.shadowRoot), setTimeout(function () {
16057
+ }).appendChild(_this98._elementRef), zt.apply(Fa, _this98.shadowRoot), setTimeout(function () {
16017
16058
  _this98._hasBeenRendered || _this98.onRender();
16018
16059
  }, 20);
16019
16060
  return _this98;
@@ -16029,12 +16070,12 @@ var _ = /*#__PURE__*/function (_rs) {
16029
16070
  key: "onRender",
16030
16071
  value: function onRender() {
16031
16072
  var _this$_childElement;
16032
- bi.attemptAppendStyleSheetToHead(this.style), te.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = ia.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (Ht.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Ht.applyDefaultStyleToComponent(this.style, this.chatStyle), te.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? gi.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof V) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Ls.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof V && K.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered || yi.onRender(this), this._hasBeenRendered = !0;
16073
+ vi.attemptAppendStyleSheetToHead(this.style), te.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = ia.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (zt.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), zt.applyDefaultStyleToComponent(this.style, this.chatStyle), te.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? bi.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof K) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Ls.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof K && W.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered || ii.onRender(this), this._hasBeenRendered = !0;
16033
16074
  }
16034
16075
  }, {
16035
16076
  key: "disconnectedCallback",
16036
16077
  value: function disconnectedCallback() {
16037
- si.chat = void 0;
16078
+ ni.chat = void 0;
16038
16079
  }
16039
16080
  }]);
16040
16081
  }(rs);
@@ -16077,6 +16118,7 @@ w([x("object")], _.prototype, "focusMode");
16077
16118
  w([x("function")], _.prototype, "onMessage");
16078
16119
  w([x("function")], _.prototype, "onClearMessages");
16079
16120
  w([x("function")], _.prototype, "onComponentRender");
16121
+ w([x("function")], _.prototype, "onInput");
16080
16122
  w([x("function")], _.prototype, "onError");
16081
16123
  w([x("object")], _.prototype, "demo");
16082
16124
  w([x("object")], _.prototype, "_insertKeyViewStyles");