deep-chat-dev 9.0.133 → 9.0.135

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/deepChat.js CHANGED
@@ -135,7 +135,7 @@ var C = /*#__PURE__*/function () {
135
135
  }]);
136
136
  return C;
137
137
  }();
138
- var Un = /*#__PURE__*/function () {
138
+ var qn = /*#__PURE__*/function () {
139
139
  function jt() {
140
140
  _classCallCheck(this, jt);
141
141
  }
@@ -168,7 +168,7 @@ var Un = /*#__PURE__*/function () {
168
168
  }]);
169
169
  return jt;
170
170
  }();
171
- Un.DEFAULT_COMPONENT_STYLE = {
171
+ qn.DEFAULT_COMPONENT_STYLE = {
172
172
  height: "350px",
173
173
  width: "320px",
174
174
  border: "1px solid #cacaca",
@@ -182,15 +182,15 @@ Un.DEFAULT_COMPONENT_STYLE = {
182
182
  // this is also causing the chat to squeeze when there is no space
183
183
  overflow: "hidden"
184
184
  };
185
- var wi = Un;
185
+ var wi = qn;
186
186
  var R = /* @__PURE__ */function (s) {
187
187
  return s.ESCAPE = "Escape", s.ENTER = "Enter", s.TAB = "Tab", s.ARROW_UP = "ArrowUp", s.ARROW_DOWN = "ArrowDown", s.ARROW_RIGHT = "ArrowRight", s.ARROW_LEFT = "ArrowLeft", s.BACKSPACE = "Backspace", s.DELETE = "Delete", s.META = "Meta", s.CONTROL = "Control", s;
188
188
  }(R || {});
189
- var ye = /*#__PURE__*/_createClass(function ye() {
190
- _classCallCheck(this, ye);
189
+ var xe = /*#__PURE__*/_createClass(function xe() {
190
+ _classCallCheck(this, xe);
191
191
  });
192
- ye.IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
193
- ye.IS_CHROMIUM = window.chrome;
192
+ xe.IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
193
+ xe.IS_CHROMIUM = window.chrome;
194
194
  var Hn = /*#__PURE__*/function () {
195
195
  function rt() {
196
196
  _classCallCheck(this, rt);
@@ -256,7 +256,7 @@ var Gn = /*#__PURE__*/function () {
256
256
  value: function createInputElement(e) {
257
257
  var i, n, r;
258
258
  var t = document.createElement("div");
259
- return t.id = Ve.TEXT_INPUT_ID, t.classList.add("text-input-styling", "text-input-placeholder"), t.innerText = ((i = e == null ? void 0 : e.placeholder) == null ? void 0 : i.text) || "Ask me anything!", ye.IS_CHROMIUM && Ve.preventAutomaticScrollUpOnNewLine(t), typeof (e == null ? void 0 : e.disabled) == "boolean" && e.disabled === !0 ? (t.contentEditable = "false", t.classList.add("text-input-disabled")) : (t.contentEditable = "true", this.addEventListeners(t, e)), Object.assign(t.style, (n = e == null ? void 0 : e.styles) == null ? void 0 : n.text), Object.assign(t.style, (r = e == null ? void 0 : e.placeholder) == null ? void 0 : r.style), t;
259
+ return t.id = Ve.TEXT_INPUT_ID, t.classList.add("text-input-styling", "text-input-placeholder"), t.innerText = ((i = e == null ? void 0 : e.placeholder) == null ? void 0 : i.text) || "Ask me anything!", xe.IS_CHROMIUM && Ve.preventAutomaticScrollUpOnNewLine(t), typeof (e == null ? void 0 : e.disabled) == "boolean" && e.disabled === !0 ? (t.contentEditable = "false", t.classList.add("text-input-disabled")) : (t.contentEditable = "true", this.addEventListeners(t, e)), Object.assign(t.style, (n = e == null ? void 0 : e.styles) == null ? void 0 : n.text), Object.assign(t.style, (r = e == null ? void 0 : e.placeholder) == null ? void 0 : r.style), t;
260
260
  }
261
261
  }, {
262
262
  key: "removeTextIfPlaceholder",
@@ -274,7 +274,7 @@ var Gn = /*#__PURE__*/function () {
274
274
  key: "onFocus",
275
275
  value: function onFocus(e) {
276
276
  var _this2 = this;
277
- ye.IS_SAFARI ? setTimeout(function () {
277
+ xe.IS_SAFARI ? setTimeout(function () {
278
278
  _this2.removeTextIfPlaceholder();
279
279
  }) : this.removeTextIfPlaceholder(), Object.assign(this.elementRef.style, e);
280
280
  }
@@ -318,7 +318,7 @@ var Gn = /*#__PURE__*/function () {
318
318
  key: "clear",
319
319
  value: function clear(e) {
320
320
  var t = window.scrollY;
321
- e.classList.contains("text-input-disabled") || (e.textContent = ""), ye.IS_CHROMIUM && window.scrollTo({
321
+ e.classList.contains("text-input-disabled") || (e.textContent = ""), xe.IS_CHROMIUM && window.scrollTo({
322
322
  top: t
323
323
  });
324
324
  }
@@ -468,11 +468,11 @@ var Jn = /*#__PURE__*/function () {
468
468
  }();
469
469
  Jn.LOAD_VOICES_MS = 200;
470
470
  var Ft = Jn;
471
- var Se = /*#__PURE__*/function () {
472
- function Se() {
473
- _classCallCheck(this, Se);
471
+ var ce = /*#__PURE__*/function () {
472
+ function ce() {
473
+ _classCallCheck(this, ce);
474
474
  }
475
- _createClass(Se, null, [{
475
+ _createClass(ce, null, [{
476
476
  key: "checkForContainerStyles",
477
477
  value: function checkForContainerStyles(e, t) {
478
478
  var i = e.containerStyle;
@@ -485,8 +485,14 @@ var Se = /*#__PURE__*/function () {
485
485
  return console.error("The {result: ....} response object type is deprecated since version 1.3.0."), console.error("Please change to using the new response object: https://deepchat.dev/docs/connect#Response"), e.result;
486
486
  }
487
487
  }, {
488
- key: "processInitialMessageFile",
489
- value: function processInitialMessageFile(e) {
488
+ key: "processHistory",
489
+ value: function processHistory(e) {
490
+ var t = e.initialMessages;
491
+ if (t) return console.error("The initialMessages property is deprecated since version 1.5.0."), console.error("Please change to using the history property instead: https://deepchat.dev/docs/messages/#history"), t;
492
+ }
493
+ }, {
494
+ key: "processHistoryFile",
495
+ value: function processHistoryFile(e) {
490
496
  var t = e.file;
491
497
  t && (console.error("The file property in MessageContent is deprecated since version 1.3.17."), console.error("Please change to using the files array property: https://deepchat.dev/docs/messages/#MessageContent"), e.files = [t]);
492
498
  }
@@ -509,14 +515,20 @@ var Se = /*#__PURE__*/function () {
509
515
  var t;
510
516
  (t = e.children[0]) != null && t.classList.contains("deep-chat-update-message") && (console.error('The "deep-chat-update-message" html class is deprecated since version 1.4.4.'), console.error("Please change to using {..., overwrite: true} object: https://deepchat.dev/docs/connect#Response"));
511
517
  }
518
+ }, {
519
+ key: "processConnect",
520
+ value: function processConnect(e) {
521
+ var t = e;
522
+ t.request && (t.connect ? Object.assign(t.connect, t.request) : t.connect = t.request, console.error("The request property is deprecated since version 1.5.0."), console.error("Please see the the connect object: https://deepchat.dev/docs/connect#connect-1"));
523
+ }
512
524
  }, {
513
525
  key: "checkForStream",
514
526
  value: function checkForStream(e) {
515
527
  var t = e.stream;
516
- if (t) return console.error("The stream property has been moved to the request object in version 1.4.12."), console.error("Please see the thew request object: https://deepchat.dev/docs/connect#request"), t;
528
+ if (t) return console.error("The stream property has been moved to the connect object in version 1.5.0."), console.error("Please see the the connect object: https://deepchat.dev/docs/connect#connect-1"), t;
517
529
  }
518
530
  }]);
519
- return Se;
531
+ return ce;
520
532
  }();
521
533
  var ks = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8c3ZnIGZpbGw9IiMwMDAwMDAiIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIAoJCXZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+Cgk8cGF0aCBkPSJNMjMsMzAuMzZIOWMtMi40MDQsMC00LjM2LTEuOTU2LTQuMzYtNC4zNlYxNWMwLTIuNDA0LDEuOTU2LTQuMzYsNC4zNi00LjM2aDMuNjU5CgkJYzAuMTY3LTEuNTY2LDEuNDE1LTIuODEzLDIuOTgxLTIuOTgxVjUuMzMzYy0xLjEzMS0wLjE3NC0yLTEuMTU0LTItMi4zMzNjMC0xLjMwMSwxLjA1OS0yLjM2LDIuMzYtMi4zNgoJCWMxLjMwMiwwLDIuMzYsMS4wNTksMi4zNiwyLjM2YzAsMS4xNzktMC44NjksMi4xNTktMiwyLjMzM1Y3LjY2YzEuNTY2LDAuMTY3LDIuODE0LDEuNDE1LDIuOTgxLDIuOTgxSDIzCgkJYzIuNDA0LDAsNC4zNiwxLjk1Niw0LjM2LDQuMzZ2MTFDMjcuMzYsMjguNDA0LDI1LjQwNCwzMC4zNiwyMywzMC4zNnogTTksMTEuMzZjLTIuMDA3LDAtMy42NCwxLjYzMy0zLjY0LDMuNjR2MTEKCQljMCwyLjAwNywxLjYzMywzLjY0LDMuNjQsMy42NGgxNGMyLjAwNywwLDMuNjQtMS42MzMsMy42NC0zLjY0VjE1YzAtMi4wMDctMS42MzMtMy42NC0zLjY0LTMuNjRIOXogTTEzLjM4NCwxMC42NGg1LjIzMQoJCUMxOC40MzksOS4zNTQsMTcuMzM0LDguMzYsMTYsOC4zNkMxNC42NjcsOC4zNiwxMy41NjEsOS4zNTQsMTMuMzg0LDEwLjY0eiBNMTYsMS4zNmMtMC45MDQsMC0xLjY0LDAuNzM2LTEuNjQsMS42NAoJCVMxNS4wOTYsNC42NCwxNiw0LjY0YzAuOTA0LDAsMS42NC0wLjczNiwxLjY0LTEuNjRTMTYuOTA0LDEuMzYsMTYsMS4zNnogTTIwLDI3LjM2aC04Yy0xLjMwMSwwLTIuMzYtMS4wNTktMi4zNi0yLjM2CgkJczEuMDU5LTIuMzYsMi4zNi0yLjM2aDhjMS4zMDIsMCwyLjM2LDEuMDU5LDIuMzYsMi4zNlMyMS4zMDIsMjcuMzYsMjAsMjcuMzZ6IE0xMiwyMy4zNmMtMC45MDQsMC0xLjY0LDAuNzM1LTEuNjQsMS42NAoJCXMwLjczNiwxLjY0LDEuNjQsMS42NGg4YzAuOTA0LDAsMS42NC0wLjczNSwxLjY0LTEuNjRzLTAuNzM1LTEuNjQtMS42NC0xLjY0SDEyeiBNMzEsMjMuODZoLTJjLTAuMTk5LDAtMC4zNi0wLjE2MS0wLjM2LTAuMzZWMTUKCQljMC0wLjE5OSwwLjE2MS0wLjM2LDAuMzYtMC4zNmgyYzAuMTk5LDAsMC4zNiwwLjE2MSwwLjM2LDAuMzZ2OC41QzMxLjM2LDIzLjY5OSwzMS4xOTksMjMuODYsMzEsMjMuODZ6IE0yOS4zNiwyMy4xNGgxLjI3OXYtNy43OAoJCUgyOS4zNlYyMy4xNHogTTMsMjMuODZIMWMtMC4xOTksMC0wLjM2LTAuMTYxLTAuMzYtMC4zNlYxNWMwLTAuMTk5LDAuMTYxLTAuMzYsMC4zNi0wLjM2aDJjMC4xOTksMCwwLjM2LDAuMTYxLDAuMzYsMC4zNnY4LjUKCQlDMy4zNiwyMy42OTksMy4xOTksMjMuODYsMywyMy44NnogTTEuMzYsMjMuMTRoMS4yOHYtNy43OEgxLjM2VjIzLjE0eiBNMjAsMjAuMzZjLTEuMzAyLDAtMi4zNi0xLjA1OS0yLjM2LTIuMzYKCQlzMS4wNTktMi4zNiwyLjM2LTIuMzZzMi4zNiwxLjA1OSwyLjM2LDIuMzZDMjIuMzYsMTkuMzAyLDIxLjMwMiwyMC4zNiwyMCwyMC4zNnogTTIwLDE2LjM2Yy0wLjkwNCwwLTEuNjQsMC43MzYtMS42NCwxLjY0CgkJczAuNzM1LDEuNjQsMS42NCwxLjY0czEuNjQtMC43MzUsMS42NC0xLjY0UzIwLjkwNCwxNi4zNiwyMCwxNi4zNnogTTEyLDIwLjM2Yy0xLjMwMSwwLTIuMzYtMS4wNTktMi4zNi0yLjM2czEuMDU5LTIuMzYsMi4zNi0yLjM2CgkJczIuMzYsMS4wNTksMi4zNiwyLjM2QzE0LjM2LDE5LjMwMiwxMy4zMDEsMjAuMzYsMTIsMjAuMzZ6IE0xMiwxNi4zNmMtMC45MDQsMC0xLjY0LDAuNzM2LTEuNjQsMS42NHMwLjczNiwxLjY0LDEuNjQsMS42NAoJCXMxLjY0LTAuNzM1LDEuNjQtMS42NFMxMi45MDQsMTYuMzYsMTIsMTYuMzZ6Ii8+Cgk8cmVjdCBzdHlsZT0iZmlsbDpub25lOyIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIi8+Cjwvc3ZnPg==",
522
534
  Is = "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==",
@@ -774,11 +786,11 @@ var Ls = "deep-chat-temporary-message",
774
786
  }
775
787
  },
776
788
  un = Object.keys(Pi);
777
- var xe = /*#__PURE__*/function () {
778
- function xe() {
779
- _classCallCheck(this, xe);
789
+ var Ee = /*#__PURE__*/function () {
790
+ function Ee() {
791
+ _classCallCheck(this, Ee);
780
792
  }
781
- _createClass(xe, null, [{
793
+ _createClass(Ee, null, [{
782
794
  key: "applySuggestionEvent",
783
795
  value: function applySuggestionEvent(e, t) {
784
796
  setTimeout(function () {
@@ -833,17 +845,17 @@ var xe = /*#__PURE__*/function () {
833
845
  un.forEach(function (r) {
834
846
  var o = i.getElementsByClassName(r);
835
847
  Array.from(o || []).forEach(function (a) {
836
- var l = xe.getProcessedStyles(t, a, r);
837
- le.applyStylesToElement(a, l), xe.applyEvents(a, r);
848
+ var l = Ee.getProcessedStyles(t, a, r);
849
+ le.applyStylesToElement(a, l), Ee.applyEvents(a, r);
838
850
  });
839
851
  });
840
852
  var n = i.getElementsByClassName(Rs);
841
853
  Array.from(n).forEach(function (r) {
842
- return xe.applySuggestionEvent(e, r);
854
+ return Ee.applySuggestionEvent(e, r);
843
855
  });
844
856
  }
845
857
  }]);
846
- return xe;
858
+ return Ee;
847
859
  }();
848
860
  var le = /*#__PURE__*/function () {
849
861
  function le() {
@@ -868,7 +880,7 @@ var le = /*#__PURE__*/function () {
868
880
  value: function applyClassUtilitiesToElement(e, t) {
869
881
  var i = t.events,
870
882
  n = t.styles;
871
- i && le.applyEventsToElement(e, i), n && !xe.doesElementContainDeepChatClass(e) && le.applyStylesToElement(e, n);
883
+ i && le.applyEventsToElement(e, i), n && !Ee.doesElementContainDeepChatClass(e) && le.applyStylesToElement(e, n);
872
884
  }
873
885
  }, {
874
886
  key: "applyCustomClassUtilities",
@@ -883,7 +895,7 @@ var le = /*#__PURE__*/function () {
883
895
  }, {
884
896
  key: "apply",
885
897
  value: function apply(e, t) {
886
- xe.applyDeepChatUtilities(e, e.htmlClassUtilities, t), le.applyCustomClassUtilities(e.htmlClassUtilities, t);
898
+ Ee.applyDeepChatUtilities(e, e.htmlClassUtilities, t), le.applyCustomClassUtilities(e.htmlClassUtilities, t);
887
899
  }
888
900
  }]);
889
901
  return le;
@@ -908,7 +920,7 @@ var Qe = /*#__PURE__*/function () {
908
920
  value: function overwrite(e, t, i, n) {
909
921
  var r = e.messages,
910
922
  o = b.overwriteMessage(r, n, t, i, "html", "html-message");
911
- return o && (o.bubbleElement.innerHTML = t, le.apply(e, o.outerContainer), Se.flagHTMLUpdateClass(o.bubbleElement)), o;
923
+ return o && (o.bubbleElement.innerHTML = t, le.apply(e, o.outerContainer), ce.flagHTMLUpdateClass(o.bubbleElement)), o;
912
924
  }
913
925
  // prettier-ignore
914
926
  }, {
@@ -921,7 +933,7 @@ var Qe = /*#__PURE__*/function () {
921
933
  r.status = !1;
922
934
  }
923
935
  var o = Qe.createElements(e, t, i);
924
- return b.fillEmptyMessageElement(o.bubbleElement, t), le.apply(e, o.outerContainer), Se.flagHTMLUpdateClass(o.bubbleElement), e.applyCustomStyles(o, i, !1, (a = e.messageStyles) == null ? void 0 : a.html), Qe.addElement(e, o.outerContainer), o;
936
+ return b.fillEmptyMessageElement(o.bubbleElement, t), le.apply(e, o.outerContainer), ce.flagHTMLUpdateClass(o.bubbleElement), e.applyCustomStyles(o, i, !1, (a = e.messageStyles) == null ? void 0 : a.html), Qe.addElement(e, o.outerContainer), o;
925
937
  }
926
938
  }]);
927
939
  return Qe;
@@ -973,17 +985,17 @@ function Ne(s) {
973
985
  }
974
986
  var Bs = /[&<>"]/,
975
987
  zs = /[&<>"]/g,
976
- qs = {
988
+ Us = {
977
989
  "&": "&amp;",
978
990
  "<": "&lt;",
979
991
  ">": "&gt;",
980
992
  '"': "&quot;"
981
993
  };
982
- function Us(s) {
983
- return qs[s];
994
+ function qs(s) {
995
+ return Us[s];
984
996
  }
985
- function q(s) {
986
- return Bs.test(s) ? s.replace(zs, Us) : s;
997
+ function U(s) {
998
+ return Bs.test(s) ? s.replace(zs, qs) : s;
987
999
  }
988
1000
  var g = {};
989
1001
  g.blockquote_open = function () {
@@ -993,7 +1005,7 @@ g.blockquote_close = function (s, e) {
993
1005
  return "</blockquote>" + De(s, e);
994
1006
  };
995
1007
  g.code = function (s, e) {
996
- return s[e].block ? "<pre><code>" + q(s[e].content) + "</code></pre>" + De(s, e) : "<code>" + q(s[e].content) + "</code>";
1008
+ return s[e].block ? "<pre><code>" + U(s[e].content) + "</code></pre>" + De(s, e) : "<code>" + U(s[e].content) + "</code>";
997
1009
  };
998
1010
  g.fence = function (s, e, t, i, n) {
999
1011
  var r = s[e],
@@ -1005,9 +1017,9 @@ g.fence = function (s, e, t, i, n) {
1005
1017
  u;
1006
1018
  if (r.params) {
1007
1019
  if (c = r.params.split(/\s+/g), d = c.join(" "), Os(n.rules.fence_custom, c[0])) return n.rules.fence_custom[c[0]](s, e, t, i, n);
1008
- l = q(Ne(gt(d))), o = ' class="' + a + l + '"';
1020
+ l = U(Ne(gt(d))), o = ' class="' + a + l + '"';
1009
1021
  }
1010
- return t.highlight ? u = t.highlight.apply(t.highlight, [r.content].concat(c)) || q(r.content) : u = q(r.content), "<pre><code" + o + ">" + u + "</code></pre>" + De(s, e);
1022
+ return t.highlight ? u = t.highlight.apply(t.highlight, [r.content].concat(c)) || U(r.content) : u = U(r.content), "<pre><code" + o + ">" + u + "</code></pre>" + De(s, e);
1011
1023
  };
1012
1024
  g.fence_custom = {};
1013
1025
  g.heading_open = function (s, e) {
@@ -1047,17 +1059,17 @@ g.paragraph_close = function (s, e) {
1047
1059
  return (s[e].tight ? "" : "</p>") + (t ? De(s, e) : "");
1048
1060
  };
1049
1061
  g.link_open = function (s, e, t) {
1050
- var i = s[e].title ? ' title="' + q(Ne(s[e].title)) + '"' : "",
1062
+ var i = s[e].title ? ' title="' + U(Ne(s[e].title)) + '"' : "",
1051
1063
  n = t.linkTarget ? ' target="' + t.linkTarget + '"' : "";
1052
- return '<a href="' + q(s[e].href) + '"' + i + n + ">";
1064
+ return '<a href="' + U(s[e].href) + '"' + i + n + ">";
1053
1065
  };
1054
1066
  g.link_close = function () {
1055
1067
  return "</a>";
1056
1068
  };
1057
1069
  g.image = function (s, e, t) {
1058
- var i = ' src="' + q(s[e].src) + '"',
1059
- n = s[e].title ? ' title="' + q(Ne(s[e].title)) + '"' : "",
1060
- r = ' alt="' + (s[e].alt ? q(Ne(gt(s[e].alt))) : "") + '"',
1070
+ var i = ' src="' + U(s[e].src) + '"',
1071
+ n = s[e].title ? ' title="' + U(Ne(s[e].title)) + '"' : "",
1072
+ r = ' alt="' + (s[e].alt ? U(Ne(gt(s[e].alt))) : "") + '"',
1061
1073
  o = t.xhtmlOut ? " /" : "";
1062
1074
  return "<img" + i + r + n + o + ">";
1063
1075
  };
@@ -1130,10 +1142,10 @@ g.mark_close = function () {
1130
1142
  return "</mark>";
1131
1143
  };
1132
1144
  g.sub = function (s, e) {
1133
- return "<sub>" + q(s[e].content) + "</sub>";
1145
+ return "<sub>" + U(s[e].content) + "</sub>";
1134
1146
  };
1135
1147
  g.sup = function (s, e) {
1136
- return "<sup>" + q(s[e].content) + "</sup>";
1148
+ return "<sup>" + U(s[e].content) + "</sup>";
1137
1149
  };
1138
1150
  g.hardbreak = function (s, e, t) {
1139
1151
  return t.xhtmlOut ? "<br />\n" : "<br>\n";
@@ -1142,7 +1154,7 @@ g.softbreak = function (s, e, t) {
1142
1154
  return t.breaks ? t.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
1143
1155
  };
1144
1156
  g.text = function (s, e) {
1145
- return q(s[e].content);
1157
+ return U(s[e].content);
1146
1158
  };
1147
1159
  g.htmlblock = function (s, e) {
1148
1160
  return s[e].content;
@@ -1151,7 +1163,7 @@ g.htmltag = function (s, e) {
1151
1163
  return s[e].content;
1152
1164
  };
1153
1165
  g.abbr_open = function (s, e) {
1154
- return '<abbr title="' + q(Ne(s[e].title)) + '">';
1166
+ return '<abbr title="' + U(Ne(s[e].title)) + '">';
1155
1167
  };
1156
1168
  g.abbr_close = function () {
1157
1169
  return "</abbr>";
@@ -1457,8 +1469,8 @@ function Ks(s) {
1457
1469
  d = 0,
1458
1470
  u = !1,
1459
1471
  h = {};
1460
- if (s.env.footnotes && (s.tokens = s.tokens.filter(function (f) {
1461
- return f.type === "footnote_reference_open" ? (u = !0, l = [], c = f.label, !1) : f.type === "footnote_reference_close" ? (u = !1, h[":" + c] = l, !1) : (u && l.push(f), !u);
1472
+ if (s.env.footnotes && (s.tokens = s.tokens.filter(function (p) {
1473
+ return p.type === "footnote_reference_open" ? (u = !0, l = [], c = p.label, !1) : p.type === "footnote_reference_close" ? (u = !1, h[":" + c] = l, !1) : (u && l.push(p), !u);
1462
1474
  }), !!s.env.footnotes.list)) {
1463
1475
  for (o = s.env.footnotes.list, s.tokens.push({
1464
1476
  type: "footnote_block_open",
@@ -1515,14 +1527,14 @@ function Ys(s) {
1515
1527
  d,
1516
1528
  u,
1517
1529
  h,
1518
- f = s.tokens;
1530
+ p = s.tokens;
1519
1531
  if (s.env.abbreviations) {
1520
1532
  for (s.env.abbrRegExp || (h = "(^|[" + hn.split("").map(Mi).join("") + "])(" + Object.keys(s.env.abbreviations).map(function (m) {
1521
1533
  return m.substr(1);
1522
- }).sort(function (m, p) {
1523
- return p.length - m.length;
1524
- }).map(Mi).join("|") + ")($|[" + hn.split("").map(Mi).join("") + "])", s.env.abbrRegExp = new RegExp(h, "g")), d = s.env.abbrRegExp, t = 0, i = f.length; t < i; t++) if (f[t].type === "inline") {
1525
- for (n = f[t].children, e = n.length - 1; e >= 0; e--) if (r = n[e], r.type === "text") {
1534
+ }).sort(function (m, f) {
1535
+ return f.length - m.length;
1536
+ }).map(Mi).join("|") + ")($|[" + hn.split("").map(Mi).join("") + "])", s.env.abbrRegExp = new RegExp(h, "g")), d = s.env.abbrRegExp, t = 0, i = p.length; t < i; t++) if (p[t].type === "inline") {
1537
+ for (n = p[t].children, e = n.length - 1; e >= 0; e--) if (r = n[e], r.type === "text") {
1526
1538
  for (l = 0, o = r.content, d.lastIndex = 0, c = r.level, a = []; u = d.exec(o);) d.lastIndex > l && a.push({
1527
1539
  type: "text",
1528
1540
  content: o.slice(l, u.index + u[1].length),
@@ -1543,7 +1555,7 @@ function Ys(s) {
1543
1555
  type: "text",
1544
1556
  content: o.slice(l),
1545
1557
  level: c
1546
- }), f[t].children = n = [].concat(n.slice(0, e), a, n.slice(e + 1)));
1558
+ }), p[t].children = n = [].concat(n.slice(0, e), a, n.slice(e + 1)));
1547
1559
  }
1548
1560
  }
1549
1561
  }
@@ -1568,9 +1580,9 @@ function tr(s) {
1568
1580
  }
1569
1581
  }
1570
1582
  var ir = /['"]/,
1571
- fn = /['"]/g,
1583
+ pn = /['"]/g,
1572
1584
  nr = /[-\s()\[\]]/,
1573
- pn = "’";
1585
+ fn = "’";
1574
1586
  function mn(s, e) {
1575
1587
  return e < 0 || e >= s.length ? !1 : !nr.test(s[e]);
1576
1588
  }
@@ -1578,20 +1590,20 @@ function He(s, e, t) {
1578
1590
  return s.substr(0, e) + t + s.substr(e + 1);
1579
1591
  }
1580
1592
  function sr(s) {
1581
- var e, t, i, n, r, o, a, l, c, d, u, h, f, m, p, x, S;
1593
+ var e, t, i, n, r, o, a, l, c, d, u, h, p, m, f, x, S;
1582
1594
  if (s.options.typographer) {
1583
- for (S = [], p = s.tokens.length - 1; p >= 0; p--) if (s.tokens[p].type === "inline") {
1584
- for (x = s.tokens[p].children, S.length = 0, e = 0; e < x.length; e++) if (t = x[e], !(t.type !== "text" || ir.test(t.text))) {
1585
- for (a = x[e].level, f = S.length - 1; f >= 0 && !(S[f].level <= a); f--);
1586
- S.length = f + 1, i = t.content, r = 0, o = i.length;
1587
- e: for (; r < o && (fn.lastIndex = r, n = fn.exec(i), !!n);) {
1595
+ for (S = [], f = s.tokens.length - 1; f >= 0; f--) if (s.tokens[f].type === "inline") {
1596
+ for (x = s.tokens[f].children, S.length = 0, e = 0; e < x.length; e++) if (t = x[e], !(t.type !== "text" || ir.test(t.text))) {
1597
+ for (a = x[e].level, p = S.length - 1; p >= 0 && !(S[p].level <= a); p--);
1598
+ S.length = p + 1, i = t.content, r = 0, o = i.length;
1599
+ e: for (; r < o && (pn.lastIndex = r, n = pn.exec(i), !!n);) {
1588
1600
  if (l = !mn(i, n.index - 1), r = n.index + 1, m = n[0] === "'", c = !mn(i, r), !c && !l) {
1589
- m && (t.content = He(t.content, n.index, pn));
1601
+ m && (t.content = He(t.content, n.index, fn));
1590
1602
  continue;
1591
1603
  }
1592
1604
  if (u = !c, h = !l, h) {
1593
- for (f = S.length - 1; f >= 0 && (d = S[f], !(S[f].level < a)); f--) if (d.single === m && S[f].level === a) {
1594
- d = S[f], m ? (x[d.token].content = He(x[d.token].content, d.pos, s.options.quotes[2]), t.content = He(t.content, n.index, s.options.quotes[3])) : (x[d.token].content = He(x[d.token].content, d.pos, s.options.quotes[0]), t.content = He(t.content, n.index, s.options.quotes[1])), S.length = f;
1605
+ for (p = S.length - 1; p >= 0 && (d = S[p], !(S[p].level < a)); p--) if (d.single === m && S[p].level === a) {
1606
+ d = S[p], m ? (x[d.token].content = He(x[d.token].content, d.pos, s.options.quotes[2]), t.content = He(t.content, n.index, s.options.quotes[3])) : (x[d.token].content = He(x[d.token].content, d.pos, s.options.quotes[0]), t.content = He(t.content, n.index, s.options.quotes[1])), S.length = p;
1595
1607
  continue e;
1596
1608
  }
1597
1609
  }
@@ -1600,7 +1612,7 @@ function sr(s) {
1600
1612
  pos: n.index,
1601
1613
  single: m,
1602
1614
  level: a
1603
- }) : h && m && (t.content = He(t.content, n.index, pn));
1615
+ }) : h && m && (t.content = He(t.content, n.index, fn));
1604
1616
  }
1605
1617
  }
1606
1618
  }
@@ -1713,19 +1725,19 @@ function ar(s, e, t, i) {
1713
1725
  d,
1714
1726
  u,
1715
1727
  h,
1716
- f,
1728
+ p,
1717
1729
  m,
1718
- p = s.bMarks[e] + s.tShift[e],
1730
+ f = s.bMarks[e] + s.tShift[e],
1719
1731
  x = s.eMarks[e];
1720
- if (p > x || s.src.charCodeAt(p++) !== 62 || s.level >= s.options.maxNesting) return !1;
1732
+ if (f > x || s.src.charCodeAt(f++) !== 62 || s.level >= s.options.maxNesting) return !1;
1721
1733
  if (i) return !0;
1722
- for (s.src.charCodeAt(p) === 32 && p++, l = s.blkIndent, s.blkIndent = 0, a = [s.bMarks[e]], s.bMarks[e] = p, p = p < x ? s.skipSpaces(p) : p, r = p >= x, o = [s.tShift[e]], s.tShift[e] = p - s.bMarks[e], u = s.parser.ruler.getRules("blockquote"), n = e + 1; n < t && (p = s.bMarks[n] + s.tShift[n], x = s.eMarks[n], !(p >= x)); n++) {
1723
- if (s.src.charCodeAt(p++) === 62) {
1724
- s.src.charCodeAt(p) === 32 && p++, a.push(s.bMarks[n]), s.bMarks[n] = p, p = p < x ? s.skipSpaces(p) : p, r = p >= x, o.push(s.tShift[n]), s.tShift[n] = p - s.bMarks[n];
1734
+ for (s.src.charCodeAt(f) === 32 && f++, l = s.blkIndent, s.blkIndent = 0, a = [s.bMarks[e]], s.bMarks[e] = f, f = f < x ? s.skipSpaces(f) : f, r = f >= x, o = [s.tShift[e]], s.tShift[e] = f - s.bMarks[e], u = s.parser.ruler.getRules("blockquote"), n = e + 1; n < t && (f = s.bMarks[n] + s.tShift[n], x = s.eMarks[n], !(f >= x)); n++) {
1735
+ if (s.src.charCodeAt(f++) === 62) {
1736
+ s.src.charCodeAt(f) === 32 && f++, a.push(s.bMarks[n]), s.bMarks[n] = f, f = f < x ? s.skipSpaces(f) : f, r = f >= x, o.push(s.tShift[n]), s.tShift[n] = f - s.bMarks[n];
1725
1737
  continue;
1726
1738
  }
1727
1739
  if (r) break;
1728
- for (m = !1, h = 0, f = u.length; h < f; h++) if (u[h](s, n, t, !0)) {
1740
+ for (m = !1, h = 0, p = u.length; h < p; h++) if (u[h](s, n, t, !0)) {
1729
1741
  m = !0;
1730
1742
  break;
1731
1743
  }
@@ -1793,9 +1805,9 @@ function dr(s, e, t, i) {
1793
1805
  d,
1794
1806
  u,
1795
1807
  h,
1796
- f,
1797
- m,
1798
1808
  p,
1809
+ m,
1810
+ f,
1799
1811
  x,
1800
1812
  S,
1801
1813
  J,
@@ -1809,7 +1821,7 @@ function dr(s, e, t, i) {
1809
1821
  te;
1810
1822
  if ((u = bn(s, e)) >= 0) x = !0;else if ((u = gn(s, e)) >= 0) x = !1;else return !1;
1811
1823
  if (s.level >= s.options.maxNesting) return !1;
1812
- if (p = s.src.charCodeAt(u - 1), i) return !0;
1824
+ if (f = s.src.charCodeAt(u - 1), i) return !0;
1813
1825
  for (J = s.tokens.length, x ? (d = s.bMarks[e] + s.tShift[e], m = Number(s.src.substr(d, u - d - 1)), s.tokens.push({
1814
1826
  type: "ordered_list_open",
1815
1827
  order: m,
@@ -1819,7 +1831,7 @@ function dr(s, e, t, i) {
1819
1831
  type: "bullet_list_open",
1820
1832
  lines: O = [e, 0],
1821
1833
  level: s.level++
1822
- }), n = e, X = !1, ee = s.parser.ruler.getRules("list"); n < t && (S = s.skipSpaces(u), h = s.eMarks[n], S >= h ? f = 1 : f = S - u, f > 4 && (f = 1), f < 1 && (f = 1), r = u - s.bMarks[n] + f, s.tokens.push({
1834
+ }), n = e, X = !1, ee = s.parser.ruler.getRules("list"); n < t && (S = s.skipSpaces(u), h = s.eMarks[n], S >= h ? p = 1 : p = S - u, p > 4 && (p = 1), p < 1 && (p = 1), r = u - s.bMarks[n] + p, s.tokens.push({
1823
1835
  type: "list_item_open",
1824
1836
  lines: H = [e, 0],
1825
1837
  level: s.level++
@@ -1835,7 +1847,7 @@ function dr(s, e, t, i) {
1835
1847
  if (x) {
1836
1848
  if (u = bn(s, n), u < 0) break;
1837
1849
  } else if (u = gn(s, n), u < 0) break;
1838
- if (p !== s.src.charCodeAt(u - 1)) break;
1850
+ if (f !== s.src.charCodeAt(u - 1)) break;
1839
1851
  }
1840
1852
  return s.tokens.push({
1841
1853
  type: x ? "ordered_list_close" : "bullet_list_close",
@@ -1889,7 +1901,7 @@ function hr(s, e, t, i) {
1889
1901
  level: s.level
1890
1902
  })), !0);
1891
1903
  }
1892
- function fr(s, e, t) {
1904
+ function pr(s, e, t) {
1893
1905
  var i,
1894
1906
  n,
1895
1907
  r,
@@ -1915,7 +1927,7 @@ var rs = {};
1915
1927
  ["article", "aside", "button", "blockquote", "body", "canvas", "caption", "col", "colgroup", "dd", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "iframe", "li", "map", "object", "ol", "output", "p", "pre", "progress", "script", "section", "style", "table", "tbody", "td", "textarea", "tfoot", "th", "tr", "thead", "ul", "video"].forEach(function (s) {
1916
1928
  rs[s] = !0;
1917
1929
  });
1918
- var pr = /^<([a-zA-Z]{1,15})[\s\/>]/,
1930
+ var fr = /^<([a-zA-Z]{1,15})[\s\/>]/,
1919
1931
  mr = /^<\/([a-zA-Z]{1,15})[\s>]/;
1920
1932
  function gr(s) {
1921
1933
  var e = s | 32;
@@ -1934,7 +1946,7 @@ function br(s, e, t, i) {
1934
1946
  } else if (n === 47 || gr(n)) {
1935
1947
  if (n === 47) {
1936
1948
  if (r = s.src.slice(a, l).match(mr), !r) return !1;
1937
- } else if (r = s.src.slice(a, l).match(pr), !r) return !1;
1949
+ } else if (r = s.src.slice(a, l).match(fr), !r) return !1;
1938
1950
  if (rs[r[1].toLowerCase()] !== !0) return !1;
1939
1951
  if (i) return !0;
1940
1952
  } else return !1;
@@ -1952,7 +1964,7 @@ function Ci(s, e) {
1952
1964
  return s.src.substr(t, i - t);
1953
1965
  }
1954
1966
  function vr(s, e, t, i) {
1955
- var n, r, o, a, l, c, d, u, h, f, m;
1967
+ var n, r, o, a, l, c, d, u, h, p, m;
1956
1968
  if (e + 2 > t || (l = e + 1, s.tShift[l] < s.blkIndent) || (o = s.bMarks[l] + s.tShift[l], o >= s.eMarks[l]) || (n = s.src.charCodeAt(o), n !== 124 && n !== 45 && n !== 58) || (r = Ci(s, e + 1), !/^[-:| ]+$/.test(r)) || (c = r.split("|"), c <= 2)) return !1;
1957
1969
  for (u = [], a = 0; a < c.length; a++) {
1958
1970
  if (h = c[a].trim(), !h) {
@@ -1966,7 +1978,7 @@ function vr(s, e, t, i) {
1966
1978
  if (i) return !0;
1967
1979
  for (s.tokens.push({
1968
1980
  type: "table_open",
1969
- lines: f = [e, 0],
1981
+ lines: p = [e, 0],
1970
1982
  level: s.level++
1971
1983
  }), s.tokens.push({
1972
1984
  type: "thead_open",
@@ -2029,7 +2041,7 @@ function vr(s, e, t, i) {
2029
2041
  }), s.tokens.push({
2030
2042
  type: "table_close",
2031
2043
  level: --s.level
2032
- }), f[1] = m[1] = l, s.line = l, !0;
2044
+ }), p[1] = m[1] = l, s.line = l, !0;
2033
2045
  }
2034
2046
  function Ot(s, e) {
2035
2047
  var t,
@@ -2045,7 +2057,7 @@ function yr(s, e) {
2045
2057
  for (t = e + 2, i = s.tokens.length - 2; t < i; t++) s.tokens[t].level === n && s.tokens[t].type === "paragraph_open" && (s.tokens[t + 2].tight = !0, s.tokens[t].tight = !0, t += 2);
2046
2058
  }
2047
2059
  function xr(s, e, t, i) {
2048
- var n, r, o, a, l, c, d, u, h, f, m, p, x, S;
2060
+ var n, r, o, a, l, c, d, u, h, p, m, f, x, S;
2049
2061
  if (i) return s.ddIndent < 0 ? !1 : Ot(s, e) >= 0;
2050
2062
  if (d = e + 1, s.isEmpty(d) && ++d > t || s.tShift[d] < s.blkIndent || (n = Ot(s, d), n < 0) || s.level >= s.options.maxNesting) return !1;
2051
2063
  c = s.tokens.length, s.tokens.push({
@@ -2072,7 +2084,7 @@ function xr(s, e, t, i) {
2072
2084
  type: "dd_open",
2073
2085
  lines: a = [d, 0],
2074
2086
  level: s.level++
2075
- }), p = s.tight, h = s.ddIndent, u = s.blkIndent, m = s.tShift[r], f = s.parentType, s.blkIndent = s.ddIndent = s.tShift[r] + 2, s.tShift[r] = n - s.bMarks[r], s.tight = !0, s.parentType = "deflist", s.parser.tokenize(s, r, t, !0), (!s.tight || x) && (S = !1), x = s.line - r > 1 && s.isEmpty(s.line - 1), s.tShift[r] = m, s.tight = p, s.parentType = f, s.blkIndent = u, s.ddIndent = h, s.tokens.push({
2087
+ }), f = s.tight, h = s.ddIndent, u = s.blkIndent, m = s.tShift[r], p = s.parentType, s.blkIndent = s.ddIndent = s.tShift[r] + 2, s.tShift[r] = n - s.bMarks[r], s.tight = !0, s.parentType = "deflist", s.parser.tokenize(s, r, t, !0), (!s.tight || x) && (S = !1), x = s.line - r > 1 && s.isEmpty(s.line - 1), s.tShift[r] = m, s.tight = f, s.parentType = p, s.blkIndent = u, s.ddIndent = h, s.tokens.push({
2076
2088
  type: "dd_close",
2077
2089
  level: --s.level
2078
2090
  }), a[1] = d = s.line, d >= t || s.tShift[d] < s.blkIndent) break e;
@@ -2120,7 +2132,7 @@ function Er(s, e) {
2120
2132
  level: s.level
2121
2133
  })), !0;
2122
2134
  }
2123
- var Pt = [["code", rr], ["fences", or, ["paragraph", "blockquote", "list"]], ["blockquote", ar, ["paragraph", "blockquote", "list"]], ["hr", lr, ["paragraph", "blockquote", "list"]], ["list", dr, ["paragraph", "blockquote"]], ["footnote", ur, ["paragraph"]], ["heading", hr, ["paragraph", "blockquote"]], ["lheading", fr], ["htmlblock", br, ["paragraph", "blockquote"]], ["table", vr, ["paragraph"]], ["deflist", xr, ["paragraph"]], ["paragraph", Er]];
2135
+ var Pt = [["code", rr], ["fences", or, ["paragraph", "blockquote", "list"]], ["blockquote", ar, ["paragraph", "blockquote", "list"]], ["hr", lr, ["paragraph", "blockquote", "list"]], ["list", dr, ["paragraph", "blockquote"]], ["footnote", ur, ["paragraph"]], ["heading", hr, ["paragraph", "blockquote"]], ["lheading", pr], ["htmlblock", br, ["paragraph", "blockquote"]], ["table", vr, ["paragraph"]], ["deflist", xr, ["paragraph"]], ["paragraph", Er]];
2124
2136
  function Ji() {
2125
2137
  this.ruler = new W();
2126
2138
  for (var s = 0; s < Pt.length; s++) this.ruler.push(Pt[s][0], Pt[s][1], {
@@ -2450,20 +2462,20 @@ function Fr(s, e) {
2450
2462
  d = !1,
2451
2463
  u = s.pos,
2452
2464
  h = s.posMax,
2453
- f = s.pos,
2454
- m = s.src.charCodeAt(f);
2455
- if (m === 33 && (d = !0, m = s.src.charCodeAt(++f)), m !== 91 || s.level >= s.options.maxNesting || (t = f + 1, i = bt(s, f), i < 0)) return !1;
2465
+ p = s.pos,
2466
+ m = s.src.charCodeAt(p);
2467
+ if (m === 33 && (d = !0, m = s.src.charCodeAt(++p)), m !== 91 || s.level >= s.options.maxNesting || (t = p + 1, i = bt(s, p), i < 0)) return !1;
2456
2468
  if (a = i + 1, a < h && s.src.charCodeAt(a) === 40) {
2457
2469
  for (a++; a < h && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
2458
2470
  if (a >= h) return !1;
2459
- for (f = a, ts(s, a) ? (r = s.linkContent, a = s.pos) : r = "", f = a; a < h && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
2460
- if (a < h && f !== a && is(s, a)) for (o = s.linkContent, a = s.pos; a < h && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);else o = "";
2471
+ for (p = a, ts(s, a) ? (r = s.linkContent, a = s.pos) : r = "", p = a; a < h && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
2472
+ if (a < h && p !== a && is(s, a)) for (o = s.linkContent, a = s.pos; a < h && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);else o = "";
2461
2473
  if (a >= h || s.src.charCodeAt(a) !== 41) return s.pos = u, !1;
2462
2474
  a++;
2463
2475
  } else {
2464
2476
  if (s.linkLevel > 0) return !1;
2465
2477
  for (; a < h && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
2466
- if (a < h && s.src.charCodeAt(a) === 91 && (f = a + 1, a = bt(s, a), a >= 0 ? n = s.src.slice(f, a++) : a = f - 1), n || (_typeof(n) > "u" && (a = i + 1), n = s.src.slice(t, i)), l = s.env.references[ns(n)], !l) return s.pos = u, !1;
2478
+ if (a < h && s.src.charCodeAt(a) === 91 && (p = a + 1, a = bt(s, a), a >= 0 ? n = s.src.slice(p, a++) : a = p - 1), n || (_typeof(n) > "u" && (a = i + 1), n = s.src.slice(t, i)), l = s.env.references[ns(n)], !l) return s.pos = u, !1;
2467
2479
  r = l.href, o = l.title;
2468
2480
  }
2469
2481
  return e || (s.pos = t, s.posMax = i, d ? s.push({
@@ -2519,8 +2531,8 @@ function zr(s, e) {
2519
2531
  level: s.level
2520
2532
  })), s.pos = i, s.posMax = o, !0);
2521
2533
  }
2522
- var qr = ["coap", "doi", "javascript", "aaa", "aaas", "about", "acap", "cap", "cid", "crid", "data", "dav", "dict", "dns", "file", "ftp", "geo", "go", "gopher", "h323", "http", "https", "iax", "icap", "im", "imap", "info", "ipp", "iris", "iris.beep", "iris.xpc", "iris.xpcs", "iris.lwz", "ldap", "mailto", "mid", "msrp", "msrps", "mtqp", "mupdate", "news", "nfs", "ni", "nih", "nntp", "opaquelocktoken", "pop", "pres", "rtsp", "service", "session", "shttp", "sieve", "sip", "sips", "sms", "snmp", "soap.beep", "soap.beeps", "tag", "tel", "telnet", "tftp", "thismessage", "tn3270", "tip", "tv", "urn", "vemmi", "ws", "wss", "xcon", "xcon-userid", "xmlrpc.beep", "xmlrpc.beeps", "xmpp", "z39.50r", "z39.50s", "adiumxtra", "afp", "afs", "aim", "apt", "attachment", "aw", "beshare", "bitcoin", "bolo", "callto", "chrome", "chrome-extension", "com-eventbrite-attendee", "content", "cvs", "dlna-playsingle", "dlna-playcontainer", "dtn", "dvb", "ed2k", "facetime", "feed", "finger", "fish", "gg", "git", "gizmoproject", "gtalk", "hcp", "icon", "ipn", "irc", "irc6", "ircs", "itms", "jar", "jms", "keyparc", "lastfm", "ldaps", "magnet", "maps", "market", "message", "mms", "ms-help", "msnim", "mumble", "mvn", "notes", "oid", "palm", "paparazzi", "platform", "proxy", "psyc", "query", "res", "resource", "rmi", "rsync", "rtmp", "secondlife", "sftp", "sgn", "skype", "smb", "soldat", "spotify", "ssh", "steam", "svn", "teamspeak", "things", "udp", "unreal", "ut2004", "ventrilo", "view-source", "webcal", "wtai", "wyciwyg", "xfire", "xri", "ymsgr"],
2523
- Ur = /^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,
2534
+ var Ur = ["coap", "doi", "javascript", "aaa", "aaas", "about", "acap", "cap", "cid", "crid", "data", "dav", "dict", "dns", "file", "ftp", "geo", "go", "gopher", "h323", "http", "https", "iax", "icap", "im", "imap", "info", "ipp", "iris", "iris.beep", "iris.xpc", "iris.xpcs", "iris.lwz", "ldap", "mailto", "mid", "msrp", "msrps", "mtqp", "mupdate", "news", "nfs", "ni", "nih", "nntp", "opaquelocktoken", "pop", "pres", "rtsp", "service", "session", "shttp", "sieve", "sip", "sips", "sms", "snmp", "soap.beep", "soap.beeps", "tag", "tel", "telnet", "tftp", "thismessage", "tn3270", "tip", "tv", "urn", "vemmi", "ws", "wss", "xcon", "xcon-userid", "xmlrpc.beep", "xmlrpc.beeps", "xmpp", "z39.50r", "z39.50s", "adiumxtra", "afp", "afs", "aim", "apt", "attachment", "aw", "beshare", "bitcoin", "bolo", "callto", "chrome", "chrome-extension", "com-eventbrite-attendee", "content", "cvs", "dlna-playsingle", "dlna-playcontainer", "dtn", "dvb", "ed2k", "facetime", "feed", "finger", "fish", "gg", "git", "gizmoproject", "gtalk", "hcp", "icon", "ipn", "irc", "irc6", "ircs", "itms", "jar", "jms", "keyparc", "lastfm", "ldaps", "magnet", "maps", "market", "message", "mms", "ms-help", "msnim", "mumble", "mvn", "notes", "oid", "palm", "paparazzi", "platform", "proxy", "psyc", "query", "res", "resource", "rmi", "rsync", "rtmp", "secondlife", "sftp", "sgn", "skype", "smb", "soldat", "spotify", "ssh", "steam", "svn", "teamspeak", "things", "udp", "unreal", "ut2004", "ventrilo", "view-source", "webcal", "wtai", "wyciwyg", "xfire", "xri", "ymsgr"],
2535
+ qr = /^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,
2524
2536
  Hr = /^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;
2525
2537
  function Gr(s, e) {
2526
2538
  var t,
@@ -2529,7 +2541,7 @@ function Gr(s, e) {
2529
2541
  r,
2530
2542
  o,
2531
2543
  a = s.pos;
2532
- return s.src.charCodeAt(a) !== 60 || (t = s.src.slice(a), t.indexOf(">") < 0) ? !1 : (i = t.match(Hr), i ? qr.indexOf(i[1].toLowerCase()) < 0 || (r = i[0].slice(1, -1), o = ji(r), !s.parser.validateLink(r)) ? !1 : (e || (s.push({
2544
+ return s.src.charCodeAt(a) !== 60 || (t = s.src.slice(a), t.indexOf(">") < 0) ? !1 : (i = t.match(Hr), i ? Ur.indexOf(i[1].toLowerCase()) < 0 || (r = i[0].slice(1, -1), o = ji(r), !s.parser.validateLink(r)) ? !1 : (e || (s.push({
2533
2545
  type: "link_open",
2534
2546
  href: o,
2535
2547
  level: s.level
@@ -2540,7 +2552,7 @@ function Gr(s, e) {
2540
2552
  }), s.push({
2541
2553
  type: "link_close",
2542
2554
  level: s.level
2543
- })), s.pos += i[0].length, !0) : (n = t.match(Ur), n ? (r = n[0].slice(1, -1), o = ji("mailto:" + r), s.parser.validateLink(o) ? (e || (s.push({
2555
+ })), s.pos += i[0].length, !0) : (n = t.match(qr), n ? (r = n[0].slice(1, -1), o = ji("mailto:" + r), s.parser.validateLink(o) ? (e || (s.push({
2544
2556
  type: "link_open",
2545
2557
  href: o,
2546
2558
  level: s.level
@@ -2718,7 +2730,7 @@ var uo = {
2718
2730
  inline: {}
2719
2731
  }
2720
2732
  },
2721
- fo = {
2733
+ po = {
2722
2734
  options: {
2723
2735
  html: !0,
2724
2736
  // Enable HTML tags in source
@@ -2756,42 +2768,42 @@ var uo = {
2756
2768
  }
2757
2769
  }
2758
2770
  },
2759
- po = {
2771
+ fo = {
2760
2772
  "default": uo,
2761
2773
  full: ho,
2762
- commonmark: fo
2774
+ commonmark: po
2763
2775
  };
2764
2776
  function os(s, e, t) {
2765
2777
  this.src = e, this.env = t, this.options = s.options, this.tokens = [], this.inlineMode = !1, this.inline = s.inline, this.block = s.block, this.renderer = s.renderer, this.typographer = s.typographer;
2766
2778
  }
2767
- function pe(s, e) {
2768
- typeof s != "string" && (e = s, s = "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 ri(), this.block = new Ji(), this.core = new ss(), this.renderer = new Wi(), this.ruler = new W(), this.options = {}, this.configure(po[s]), this.set(e || {});
2779
+ function me(s, e) {
2780
+ typeof s != "string" && (e = s, s = "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 ri(), this.block = new Ji(), this.core = new ss(), this.renderer = new Wi(), this.ruler = new W(), this.options = {}, this.configure(fo[s]), this.set(e || {});
2769
2781
  }
2770
- pe.prototype.set = function (s) {
2782
+ me.prototype.set = function (s) {
2771
2783
  Xn(this.options, s);
2772
2784
  };
2773
- pe.prototype.configure = function (s) {
2785
+ me.prototype.configure = function (s) {
2774
2786
  var e = this;
2775
2787
  if (!s) throw new Error("Wrong `remarkable` preset, check name/content");
2776
2788
  s.options && e.set(s.options), s.components && Object.keys(s.components).forEach(function (t) {
2777
2789
  s.components[t].rules && e[t].ruler.enable(s.components[t].rules, !0);
2778
2790
  });
2779
2791
  };
2780
- pe.prototype.use = function (s, e) {
2792
+ me.prototype.use = function (s, e) {
2781
2793
  return s(this, e), this;
2782
2794
  };
2783
- pe.prototype.parse = function (s, e) {
2795
+ me.prototype.parse = function (s, e) {
2784
2796
  var t = new os(this, s, e);
2785
2797
  return this.core.process(t), t.tokens;
2786
2798
  };
2787
- pe.prototype.render = function (s, e) {
2799
+ me.prototype.render = function (s, e) {
2788
2800
  return e = e || {}, this.renderer.render(this.parse(s, e), this.options, e);
2789
2801
  };
2790
- pe.prototype.parseInline = function (s, e) {
2802
+ me.prototype.parseInline = function (s, e) {
2791
2803
  var t = new os(this, s, e);
2792
2804
  return t.inlineMode = !0, this.core.process(t), t.tokens;
2793
2805
  };
2794
- pe.prototype.renderInline = function (s, e) {
2806
+ me.prototype.renderInline = function (s, e) {
2795
2807
  return e = e || {}, this.renderer.render(this.parseInline(s, e), this.options, e);
2796
2808
  };
2797
2809
  var vt = /*#__PURE__*/function () {
@@ -2802,7 +2814,7 @@ var vt = /*#__PURE__*/function () {
2802
2814
  key: "instantiate",
2803
2815
  value: function instantiate() {
2804
2816
  var e = window.hljs;
2805
- return e ? new pe({
2817
+ return e ? new me({
2806
2818
  highlight: function highlight(t, i) {
2807
2819
  if (i && e.getLanguage(i)) try {
2808
2820
  return e.highlight(i, t).value;
@@ -2828,7 +2840,7 @@ var vt = /*#__PURE__*/function () {
2828
2840
  // set target to open in a new tab
2829
2841
  typographer: !0
2830
2842
  // Enable smartypants and other sweet transforms
2831
- }) : new pe({
2843
+ }) : new me({
2832
2844
  linkTarget: "_blank"
2833
2845
  // set target to open in a new tab
2834
2846
  });
@@ -3118,7 +3130,7 @@ var Ye = /*#__PURE__*/function () {
3118
3130
  }, {
3119
3131
  key: "isTemporaryElement",
3120
3132
  value: function isTemporaryElement(e) {
3121
- return (e == null ? void 0 : e.bubbleElement.classList.contains("loading-message-text")) || xe.isElementTemporary(e);
3133
+ return (e == null ? void 0 : e.bubbleElement.classList.contains("loading-message-text")) || Ee.isElementTemporary(e);
3122
3134
  }
3123
3135
  }, {
3124
3136
  key: "createBaseElements",
@@ -3464,17 +3476,17 @@ function Eo(s, e) {
3464
3476
  c = e.fetch,
3465
3477
  d = yo(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
3466
3478
  return new Promise(function (u, h) {
3467
- var f = Object.assign({}, i);
3468
- f.accept || (f.accept = Fi);
3479
+ var p = Object.assign({}, i);
3480
+ p.accept || (p.accept = Fi);
3469
3481
  var m;
3470
- function p() {
3482
+ function f() {
3471
3483
  m.abort(), document.hidden || H();
3472
3484
  }
3473
- l || document.addEventListener("visibilitychange", p);
3485
+ l || document.addEventListener("visibilitychange", f);
3474
3486
  var x = xo,
3475
3487
  S = 0;
3476
3488
  function J() {
3477
- document.removeEventListener("visibilitychange", p), window.clearTimeout(S), m.abort();
3489
+ document.removeEventListener("visibilitychange", f), window.clearTimeout(S), m.abort();
3478
3490
  }
3479
3491
  t == null || t.addEventListener("abort", function () {
3480
3492
  J(), u();
@@ -3494,7 +3506,7 @@ function Eo(s, e) {
3494
3506
  _context3.prev = 1;
3495
3507
  _context3.next = 4;
3496
3508
  return X(s, Object.assign(Object.assign({}, d), {
3497
- headers: f,
3509
+ headers: p,
3498
3510
  signal: m.signal
3499
3511
  }));
3500
3512
  case 4:
@@ -3504,7 +3516,7 @@ function Eo(s, e) {
3504
3516
  case 7:
3505
3517
  _context3.next = 9;
3506
3518
  return mo(ee.body, go(bo(function (I) {
3507
- I ? f[_n] = I : delete f[_n];
3519
+ I ? p[_n] = I : delete p[_n];
3508
3520
  }, function (I) {
3509
3521
  x = I;
3510
3522
  }, r)));
@@ -3549,7 +3561,7 @@ var T = /*#__PURE__*/function () {
3549
3561
  var _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(e, t, i) {
3550
3562
  var n,
3551
3563
  m,
3552
- p,
3564
+ f,
3553
3565
  x,
3554
3566
  S,
3555
3567
  J,
@@ -3564,7 +3576,7 @@ var T = /*#__PURE__*/function () {
3564
3576
  d,
3565
3577
  u,
3566
3578
  h,
3567
- f,
3579
+ p,
3568
3580
  _args6 = arguments;
3569
3581
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
3570
3582
  while (1) switch (_context6.prev = _context6.next) {
@@ -3591,19 +3603,19 @@ var T = /*#__PURE__*/function () {
3591
3603
  }
3592
3604
  return _context6.abrupt("return", v.onInterceptorError(i, l, d));
3593
3605
  case 14:
3594
- if (!((p = e.requestSettings) != null && p.handler)) {
3606
+ if (!((f = e.requestSettings) != null && f.handler)) {
3595
3607
  _context6.next = 16;
3596
3608
  break;
3597
3609
  }
3598
- return _context6.abrupt("return", he.stream(e, o, i));
3610
+ return _context6.abrupt("return", pe.stream(e, o, i));
3599
3611
  case 16:
3600
- if (!(((x = e.requestSettings) == null ? void 0 : x.url) === Ee.URL)) {
3612
+ if (!(((x = e.requestSettings) == null ? void 0 : x.url) === _e.URL)) {
3601
3613
  _context6.next = 18;
3602
3614
  break;
3603
3615
  }
3604
- return _context6.abrupt("return", Ee.requestStream(i, e.streamHandlers));
3616
+ return _context6.abrupt("return", _e.requestStream(i, e.streamHandlers));
3605
3617
  case 18:
3606
- h = new Oe(i), f = v.fetch.bind(this, e, a, n);
3618
+ h = new Oe(i), p = v.fetch.bind(this, e, a, n);
3607
3619
  Eo(((S = e.requestSettings) == null ? void 0 : S.url) || e.url || "", {
3608
3620
  method: ((J = e.requestSettings) == null ? void 0 : J.method) || "POST",
3609
3621
  headers: a,
@@ -3659,7 +3671,7 @@ var T = /*#__PURE__*/function () {
3659
3671
  _context5.t0 = I;
3660
3672
  case 7:
3661
3673
  Rt = _context5.t0;
3662
- (ee = e.extractResultData) == null || ee.call(e, Rt, f, o).then(function (te) {
3674
+ (ee = e.extractResultData) == null || ee.call(e, Rt, p, o).then(function (te) {
3663
3675
  e.asyncCallInProgress && te && te.text !== "" ? (T.simulate(i, e.streamHandlers, te), d(), e.asyncCallInProgress = !1) : T.upsertWFiles(i, h.upsertStreamedMessage.bind(h), h, te);
3664
3676
  })["catch"](function (te) {
3665
3677
  return v.displayError(i, te);
@@ -3830,7 +3842,7 @@ var cs = /*#__PURE__*/function () {
3830
3842
  return lt;
3831
3843
  }();
3832
3844
  cs.URL = "deep-chat-demo";
3833
- var Ee = cs;
3845
+ var _e = cs;
3834
3846
  var B = /*#__PURE__*/function () {
3835
3847
  function B() {
3836
3848
  _classCallCheck(this, B);
@@ -3838,7 +3850,7 @@ var B = /*#__PURE__*/function () {
3838
3850
  _createClass(B, null, [{
3839
3851
  key: "setup",
3840
3852
  value: function setup(e) {
3841
- e.requestSettings.url !== Ee.URL && (e.permittedErrorPrefixes = ["Connection error", "Error in server message"], e.websocket = "pending");
3853
+ e.requestSettings.url !== _e.URL && (e.permittedErrorPrefixes = ["Connection error", "Error in server message"], e.websocket = "pending");
3842
3854
  }
3843
3855
  }, {
3844
3856
  key: "createConnection",
@@ -3846,7 +3858,7 @@ var B = /*#__PURE__*/function () {
3846
3858
  if (!document.body.contains(e.deepChat)) return;
3847
3859
  var i = e.requestSettings.websocket;
3848
3860
  if (i) {
3849
- if (e.requestSettings.handler) return he.websocket(e, t);
3861
+ if (e.requestSettings.handler) return pe.websocket(e, t);
3850
3862
  try {
3851
3863
  var n = typeof i != "boolean" ? i : void 0,
3852
3864
  r = new WebSocket(e.requestSettings.url || "", n);
@@ -3978,11 +3990,11 @@ var B = /*#__PURE__*/function () {
3978
3990
  return _context9.abrupt("return", r.newUserMessage.listener(a));
3979
3991
  case 14:
3980
3992
  c = n ? JSON.stringify(a) : a;
3981
- if (!(((u = e.requestSettings) == null ? void 0 : u.url) === Ee.URL)) {
3993
+ if (!(((u = e.requestSettings) == null ? void 0 : u.url) === _e.URL)) {
3982
3994
  _context9.next = 17;
3983
3995
  break;
3984
3996
  }
3985
- return _context9.abrupt("return", Ee.request(e, i));
3997
+ return _context9.abrupt("return", _e.request(e, i));
3986
3998
  case 17:
3987
3999
  r.readyState === void 0 || r.readyState !== r.OPEN ? (console.error("Connection is not open"), i.isLastMessageError() || i.addNewErrorMessage("service", "Connection error")) : (r.send(JSON.stringify(c)), e.completionsHandlers.onFinish());
3988
4000
  case 18:
@@ -4022,11 +4034,11 @@ var B = /*#__PURE__*/function () {
4022
4034
  }]);
4023
4035
  return B;
4024
4036
  }();
4025
- var he = /*#__PURE__*/function () {
4026
- function he() {
4027
- _classCallCheck(this, he);
4037
+ var pe = /*#__PURE__*/function () {
4038
+ function pe() {
4039
+ _classCallCheck(this, pe);
4028
4040
  }
4029
- _createClass(he, null, [{
4041
+ _createClass(pe, null, [{
4030
4042
  key: "request",
4031
4043
  value: function () {
4032
4044
  var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(e, t, i) {
@@ -4069,7 +4081,7 @@ var he = /*#__PURE__*/function () {
4069
4081
  return function r(_x22) {
4070
4082
  return _ref3.apply(this, arguments);
4071
4083
  };
4072
- }(), o = he.generateOptionalSignals();
4084
+ }(), o = pe.generateOptionalSignals();
4073
4085
  (l = (a = e.requestSettings).handler) == null || l.call(a, t, _objectSpread(_objectSpread({}, o), {}, {
4074
4086
  onResponse: r
4075
4087
  }));
@@ -4105,11 +4117,11 @@ var he = /*#__PURE__*/function () {
4105
4117
  r || !n || (e.streamHandlers.onOpen(), r = !0);
4106
4118
  },
4107
4119
  l = function l() {
4108
- n && (he.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), n = !1);
4120
+ n && (pe.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), n = !1);
4109
4121
  },
4110
4122
  c = /*#__PURE__*/function () {
4111
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(f) {
4112
- var p, x, m;
4123
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(p) {
4124
+ var f, x, m;
4113
4125
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
4114
4126
  while (1) switch (_context12.prev = _context12.next) {
4115
4127
  case 0:
@@ -4120,17 +4132,17 @@ var he = /*#__PURE__*/function () {
4120
4132
  return _context12.abrupt("return");
4121
4133
  case 2:
4122
4134
  _context12.next = 4;
4123
- return (x = (p = e.deepChat).responseInterceptor) == null ? void 0 : x.call(p, f);
4135
+ return (x = (f = e.deepChat).responseInterceptor) == null ? void 0 : x.call(f, p);
4124
4136
  case 4:
4125
4137
  _context12.t0 = _context12.sent;
4126
4138
  if (_context12.t0) {
4127
4139
  _context12.next = 7;
4128
4140
  break;
4129
4141
  }
4130
- _context12.t0 = f;
4142
+ _context12.t0 = p;
4131
4143
  case 7:
4132
4144
  m = _context12.t0;
4133
- v.validateResponseFormat(m) ? m.error ? (console.error(m.error), o.finaliseStreamedMessage(), i.addNewErrorMessage("service", m.error), e.streamHandlers.onClose(), n = !1) : T.upsertWFiles(i, o.upsertStreamedMessage.bind(o), o, m) : console.error(A.INVALID_RESPONSE(f, "server", !!e.deepChat.responseInterceptor, m));
4145
+ v.validateResponseFormat(m) ? m.error ? (console.error(m.error), o.finaliseStreamedMessage(), i.addNewErrorMessage("service", m.error), e.streamHandlers.onClose(), n = !1) : T.upsertWFiles(i, o.upsertStreamedMessage.bind(o), o, m) : console.error(A.INVALID_RESPONSE(p, "server", !!e.deepChat.responseInterceptor, m));
4134
4146
  case 9:
4135
4147
  case "end":
4136
4148
  return _context12.stop();
@@ -4142,9 +4154,9 @@ var he = /*#__PURE__*/function () {
4142
4154
  };
4143
4155
  }();
4144
4156
  e.streamHandlers.abortStream.abort = function () {
4145
- he.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), n = !1;
4157
+ pe.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), n = !1;
4146
4158
  };
4147
- var d = he.generateOptionalSignals();
4159
+ var d = pe.generateOptionalSignals();
4148
4160
  (h = (u = e.requestSettings).handler) == null || h.call(u, t, _objectSpread(_objectSpread({}, d), {}, {
4149
4161
  onOpen: a,
4150
4162
  onResponse: c,
@@ -4174,7 +4186,7 @@ var he = /*#__PURE__*/function () {
4174
4186
  },
4175
4187
  o = /*#__PURE__*/function () {
4176
4188
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(d) {
4177
- var h, f, u, m, p;
4189
+ var h, p, u, m, f;
4178
4190
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
4179
4191
  while (1) switch (_context13.prev = _context13.next) {
4180
4192
  case 0:
@@ -4185,7 +4197,7 @@ var he = /*#__PURE__*/function () {
4185
4197
  return _context13.abrupt("return");
4186
4198
  case 2:
4187
4199
  _context13.next = 4;
4188
- return (f = (h = e.deepChat).responseInterceptor) == null ? void 0 : f.call(h, d);
4200
+ return (p = (h = e.deepChat).responseInterceptor) == null ? void 0 : p.call(h, d);
4189
4201
  case 4:
4190
4202
  _context13.t0 = _context13.sent;
4191
4203
  if (_context13.t0) {
@@ -4196,8 +4208,8 @@ var he = /*#__PURE__*/function () {
4196
4208
  case 7:
4197
4209
  u = _context13.t0;
4198
4210
  if (!v.validateResponseFormat(u)) console.error(A.INVALID_RESPONSE(d, "server", !!e.deepChat.responseInterceptor, u)), t.addNewErrorMessage("service", "Error in server message");else if (typeof u.error == "string") console.error(u.error), t.isLastMessageError() || t.addNewErrorMessage("service", u.error);else if (T.isSimulation(e.stream)) {
4199
- m = B.stream.bind(_this7, e, t, i.roleToStream), p = i.roleToStream[d.role || b.AI_ROLE];
4200
- T.upsertWFiles(t, m, p, d);
4211
+ m = B.stream.bind(_this7, e, t, i.roleToStream), f = i.roleToStream[d.role || b.AI_ROLE];
4212
+ T.upsertWFiles(t, m, f, d);
4201
4213
  } else t.addNewMessage(u);
4202
4214
  case 9:
4203
4215
  case "end":
@@ -4209,7 +4221,7 @@ var he = /*#__PURE__*/function () {
4209
4221
  return _ref5.apply(this, arguments);
4210
4222
  };
4211
4223
  }(),
4212
- a = he.generateOptionalSignals();
4224
+ a = pe.generateOptionalSignals();
4213
4225
  (c = (l = e.requestSettings).handler) == null || c.call(l, void 0, _objectSpread(_objectSpread({}, a), {}, {
4214
4226
  onOpen: n,
4215
4227
  onResponse: o,
@@ -4232,7 +4244,7 @@ var he = /*#__PURE__*/function () {
4232
4244
  };
4233
4245
  }
4234
4246
  }]);
4235
- return he;
4247
+ return pe;
4236
4248
  }();
4237
4249
  var w = /*#__PURE__*/function () {
4238
4250
  function w() {
@@ -4245,7 +4257,7 @@ var w = /*#__PURE__*/function () {
4245
4257
  var _request3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(e, t, i) {
4246
4258
  var n,
4247
4259
  h,
4248
- f,
4260
+ p,
4249
4261
  m,
4250
4262
  r,
4251
4263
  _yield$v$processReque3,
@@ -4278,26 +4290,26 @@ var w = /*#__PURE__*/function () {
4278
4290
  }
4279
4291
  return _context15.abrupt("return", v.onInterceptorError(i, l, c));
4280
4292
  case 11:
4281
- if (!((f = e.requestSettings) != null && f.handler)) {
4293
+ if (!((p = e.requestSettings) != null && p.handler)) {
4282
4294
  _context15.next = 13;
4283
4295
  break;
4284
4296
  }
4285
- return _context15.abrupt("return", he.request(e, o, i));
4297
+ return _context15.abrupt("return", pe.request(e, o, i));
4286
4298
  case 13:
4287
- if (!(((m = e.requestSettings) == null ? void 0 : m.url) === Ee.URL)) {
4299
+ if (!(((m = e.requestSettings) == null ? void 0 : m.url) === _e.URL)) {
4288
4300
  _context15.next = 15;
4289
4301
  break;
4290
4302
  }
4291
- return _context15.abrupt("return", Ee.request(e, i));
4303
+ return _context15.abrupt("return", _e.request(e, i));
4292
4304
  case 15:
4293
4305
  d = !0;
4294
4306
  u = v.fetch.bind(this, e, a, n);
4295
- u(o).then(function (p) {
4296
- return d = !!p.ok, p;
4297
- }).then(function (p) {
4298
- return v.processResponseByType(p);
4307
+ u(o).then(function (f) {
4308
+ return d = !!f.ok, f;
4309
+ }).then(function (f) {
4310
+ return v.processResponseByType(f);
4299
4311
  }).then( /*#__PURE__*/function () {
4300
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(p) {
4312
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(f) {
4301
4313
  var J, X, x, S;
4302
4314
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
4303
4315
  while (1) switch (_context14.prev = _context14.next) {
@@ -4309,14 +4321,14 @@ var w = /*#__PURE__*/function () {
4309
4321
  return _context14.abrupt("return");
4310
4322
  case 2:
4311
4323
  _context14.next = 4;
4312
- return (X = (J = e.deepChat).responseInterceptor) == null ? void 0 : X.call(J, p);
4324
+ return (X = (J = e.deepChat).responseInterceptor) == null ? void 0 : X.call(J, f);
4313
4325
  case 4:
4314
4326
  _context14.t0 = _context14.sent;
4315
4327
  if (_context14.t0) {
4316
4328
  _context14.next = 7;
4317
4329
  break;
4318
4330
  }
4319
- _context14.t0 = p;
4331
+ _context14.t0 = f;
4320
4332
  case 7:
4321
4333
  x = _context14.t0;
4322
4334
  _context14.next = 10;
@@ -4327,13 +4339,13 @@ var w = /*#__PURE__*/function () {
4327
4339
  _context14.next = 13;
4328
4340
  break;
4329
4341
  }
4330
- throw p;
4342
+ throw f;
4331
4343
  case 13:
4332
4344
  if (!(!S || _typeof(S) != "object")) {
4333
4345
  _context14.next = 15;
4334
4346
  break;
4335
4347
  }
4336
- throw Error(A.INVALID_RESPONSE(p, "response", !!e.deepChat.responseInterceptor, x));
4348
+ throw Error(A.INVALID_RESPONSE(f, "response", !!e.deepChat.responseInterceptor, x));
4337
4349
  case 15:
4338
4350
  S.makingAnotherRequest || (T.isSimulatable(e.stream, S) ? T.simulate(i, e.streamHandlers, S) : (i.addNewMessage(S), c()));
4339
4351
  case 16:
@@ -4345,8 +4357,8 @@ var w = /*#__PURE__*/function () {
4345
4357
  return function (_x28) {
4346
4358
  return _ref6.apply(this, arguments);
4347
4359
  };
4348
- }())["catch"](function (p) {
4349
- v.displayError(i, p), c();
4360
+ }())["catch"](function (f) {
4361
+ v.displayError(i, f), c();
4350
4362
  });
4351
4363
  case 18:
4352
4364
  case "end":
@@ -4415,9 +4427,9 @@ var w = /*#__PURE__*/function () {
4415
4427
  value: function () {
4416
4428
  var _poll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(e, t, i) {
4417
4429
  var n,
4418
- f,
4419
- m,
4420
4430
  p,
4431
+ m,
4432
+ f,
4421
4433
  r,
4422
4434
  _yield$v$processReque4,
4423
4435
  o,
@@ -4434,7 +4446,7 @@ var w = /*#__PURE__*/function () {
4434
4446
  n = _args17.length > 3 && _args17[3] !== undefined ? _args17[3] : !0;
4435
4447
  r = {
4436
4448
  body: t,
4437
- headers: (f = e.requestSettings) == null ? void 0 : f.headers
4449
+ headers: (p = e.requestSettings) == null ? void 0 : p.headers
4438
4450
  };
4439
4451
  _context17.next = 4;
4440
4452
  return v.processRequestInterceptor(e.deepChat, r);
@@ -4449,7 +4461,7 @@ var w = /*#__PURE__*/function () {
4449
4461
  }
4450
4462
  return _context17.abrupt("return", v.onInterceptorError(i, l));
4451
4463
  case 10:
4452
- c = ((m = e.requestSettings) == null ? void 0 : m.url) || e.url || "", d = ((p = e.requestSettings) == null ? void 0 : p.method) || "POST", u = n ? JSON.stringify(o) : o, h = {
4464
+ c = ((m = e.requestSettings) == null ? void 0 : m.url) || e.url || "", d = ((f = e.requestSettings) == null ? void 0 : f.method) || "POST", u = n ? JSON.stringify(o) : o, h = {
4453
4465
  method: d,
4454
4466
  body: u,
4455
4467
  headers: a
@@ -4537,9 +4549,9 @@ var L = /*#__PURE__*/function () {
4537
4549
  };
4538
4550
  if (_typeof(n) == "object") {
4539
4551
  var a = n.files,
4540
- l = n.request,
4552
+ l = n.connect,
4541
4553
  c = n.button;
4542
- a && (a.infoModal && (r.files.infoModal = a.infoModal, (o = a.infoModal) != null && o.textMarkDown && (r.infoModalTextMarkUp = i.render(a.infoModal.textMarkDown))), a.acceptedFormats && (r.files.acceptedFormats = a.acceptedFormats), a.maxNumberOfFiles && (r.files.maxNumberOfFiles = a.maxNumberOfFiles)), r.button = c, l && (l.headers || l.method || l.url || l.credentials || e.headers || e.method || e.url || e.credentials) && (r.request = {
4554
+ a && (a.infoModal && (r.files.infoModal = a.infoModal, (o = a.infoModal) != null && o.textMarkDown && (r.infoModalTextMarkUp = i.render(a.infoModal.textMarkDown))), a.acceptedFormats && (r.files.acceptedFormats = a.acceptedFormats), a.maxNumberOfFiles && (r.files.maxNumberOfFiles = a.maxNumberOfFiles)), r.button = c, l && (l.headers || l.method || l.url || l.credentials || e.headers || e.method || e.url || e.credentials) && (r.connect = {
4543
4555
  url: (l == null ? void 0 : l.url) || e.url,
4544
4556
  method: (l == null ? void 0 : l.method) || e.method,
4545
4557
  headers: (l == null ? void 0 : l.headers) || e.headers,
@@ -4635,7 +4647,7 @@ var Pe = /*#__PURE__*/function () {
4635
4647
  var _a$url;
4636
4648
  _classCallCheck(this, Pe);
4637
4649
  var n, r, o, a, l;
4638
- this.rawBody = {}, this.validateConfigKey = !1, this.canSendMessage = Pe.canSendMessage, this.requestSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (n = e.request) == null ? void 0 : n.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, L.set(e, this, t), e.request && (this.requestSettings = e.request), this.demo && ((_a$url = (a = this.requestSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = Ee.URL), this.requestSettings.websocket && B.setup(this), this.stream = ((l = this.deepChat.request) == null ? void 0 : l.stream) || Se.checkForStream(this.deepChat);
4650
+ this.rawBody = {}, this.validateConfigKey = !1, this.canSendMessage = Pe.canSendMessage, this.requestSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (n = e.connect) == null ? void 0 : n.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, L.set(e, this, t), e.connect && (this.requestSettings = e.connect), this.demo && ((_a$url = (a = this.requestSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = _e.URL), this.requestSettings.websocket && B.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || ce.checkForStream(this.deepChat);
4639
4651
  }
4640
4652
  _createClass(Pe, [{
4641
4653
  key: "verifyKey",
@@ -4711,7 +4723,7 @@ var Pe = /*#__PURE__*/function () {
4711
4723
  while (1) switch (_context20.prev = _context20.next) {
4712
4724
  case 0:
4713
4725
  n = Pe.createCustomFormDataBody(this.rawBody, t, i), r = this.requestSettings, o = this.getServiceIOByType(i[0]);
4714
- this.requestSettings = (o == null ? void 0 : o.request) || this.requestSettings;
4726
+ this.requestSettings = (o == null ? void 0 : o.connect) || this.requestSettings;
4715
4727
  _context20.next = 4;
4716
4728
  return this.request(n, e, !1);
4717
4729
  case 4:
@@ -4795,7 +4807,7 @@ var Pe = /*#__PURE__*/function () {
4795
4807
  _context23.next = 4;
4796
4808
  break;
4797
4809
  }
4798
- return _context23.abrupt("return", Se.handleResponseProperty(e));
4810
+ return _context23.abrupt("return", ce.handleResponseProperty(e));
4799
4811
  case 4:
4800
4812
  if (!v.validateResponseFormat(e)) {
4801
4813
  _context23.next = 6;
@@ -4847,17 +4859,17 @@ var Pe = /*#__PURE__*/function () {
4847
4859
  }]);
4848
4860
  return Pe;
4849
4861
  }();
4850
- var U = /*#__PURE__*/function (_Pe) {
4851
- _inherits(U, _Pe);
4862
+ var q = /*#__PURE__*/function (_Pe) {
4863
+ _inherits(q, _Pe);
4852
4864
  // prettier-ignore
4853
- function U(e, t, i, n, r) {
4865
+ function q(e, t, i, n, r) {
4854
4866
  var _this8;
4855
- _classCallCheck(this, U);
4867
+ _classCallCheck(this, q);
4856
4868
  var o;
4857
- _this8 = _callSuper(this, U, [e, r]), _this8.insertKeyPlaceholderText = "API Key", _this8.keyHelpUrl = "", Object.assign(_this8.rawBody, (o = e.request) == null ? void 0 : o.additionalBodyProps), _this8.keyVerificationDetails = t, _this8.buildHeadersFunc = i, n && _this8.setApiKeyProperties(n), _this8.requestSettings = _this8.buildRequestSettings(_this8.key || "", e.request);
4869
+ _this8 = _callSuper(this, q, [e, r]), _this8.insertKeyPlaceholderText = "API Key", _this8.keyHelpUrl = "", Object.assign(_this8.rawBody, (o = e.connect) == null ? void 0 : o.additionalBodyProps), _this8.keyVerificationDetails = t, _this8.buildHeadersFunc = i, n && _this8.setApiKeyProperties(n), _this8.requestSettings = _this8.buildRequestSettings(_this8.key || "", e.connect);
4858
4870
  return _this8;
4859
4871
  }
4860
- _createClass(U, [{
4872
+ _createClass(q, [{
4861
4873
  key: "setApiKeyProperties",
4862
4874
  value: function setApiKeyProperties(e) {
4863
4875
  this.key = e.key, e.validateKeyProperty && (this.validateConfigKey = e.validateKeyProperty);
@@ -4893,26 +4905,26 @@ var U = /*#__PURE__*/function (_Pe) {
4893
4905
  return !0;
4894
4906
  }
4895
4907
  }]);
4896
- return U;
4908
+ return q;
4897
4909
  }(Pe);
4898
- var qt = /*#__PURE__*/function () {
4899
- function qt() {
4900
- _classCallCheck(this, qt);
4910
+ var Ut = /*#__PURE__*/function () {
4911
+ function Ut() {
4912
+ _classCallCheck(this, Ut);
4901
4913
  }
4902
- _createClass(qt, null, [{
4914
+ _createClass(Ut, null, [{
4903
4915
  key: "waitForPropertiesToBeUpdatedBeforeRender",
4904
4916
  value: function waitForPropertiesToBeUpdatedBeforeRender(e) {
4905
4917
  e._propUpdated_ = !1, setTimeout(function () {
4906
- e._propUpdated_ ? qt.waitForPropertiesToBeUpdatedBeforeRender(e) : (e._waitingToRender_ = !1, e.onRender());
4918
+ e._propUpdated_ ? Ut.waitForPropertiesToBeUpdatedBeforeRender(e) : (e._waitingToRender_ = !1, e.onRender());
4907
4919
  });
4908
4920
  }
4909
4921
  }, {
4910
4922
  key: "attemptRender",
4911
4923
  value: function attemptRender(e) {
4912
- e._propUpdated_ = !0, e._waitingToRender_ || (e._waitingToRender_ = !0, qt.waitForPropertiesToBeUpdatedBeforeRender(e));
4924
+ e._propUpdated_ = !0, e._waitingToRender_ || (e._waitingToRender_ = !0, Ut.waitForPropertiesToBeUpdatedBeforeRender(e));
4913
4925
  }
4914
4926
  }]);
4915
- return qt;
4927
+ return Ut;
4916
4928
  }();
4917
4929
  var Yi = /*#__PURE__*/function (_HTMLElement) {
4918
4930
  _inherits(Je, _HTMLElement);
@@ -4937,7 +4949,7 @@ var Yi = /*#__PURE__*/function (_HTMLElement) {
4937
4949
  return i;
4938
4950
  },
4939
4951
  set: function set(o) {
4940
- i = o, t ? this[e] = o : qt.attemptRender(this);
4952
+ i = o, t ? this[e] = o : Ut.attemptRender(this);
4941
4953
  }
4942
4954
  });
4943
4955
  }
@@ -5139,24 +5151,24 @@ var P = /*#__PURE__*/function () {
5139
5151
  return P;
5140
5152
  }();
5141
5153
  var _t = /*#__PURE__*/function () {
5142
- function me() {
5143
- _classCallCheck(this, me);
5154
+ function ge() {
5155
+ _classCallCheck(this, ge);
5144
5156
  }
5145
- _createClass(me, null, [{
5157
+ _createClass(ge, null, [{
5146
5158
  key: "enableButtons",
5147
5159
  value: function enableButtons(e, t) {
5148
5160
  var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
5149
5161
  window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i < Zi.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
5150
- return me.enableButtons(e, t, i + 1);
5162
+ return ge.enableButtons(e, t, i + 1);
5151
5163
  }, 250);
5152
5164
  }
5153
5165
  // prettier-ignore
5154
5166
  }, {
5155
5167
  key: "setUpInitial",
5156
5168
  value: function setUpInitial(e, t, i, n) {
5157
- var r = (t == null ? void 0 : t.downloadClass) || me.DOWNLOAD_BUTTON_CLASS,
5158
- o = (t == null ? void 0 : t.uploadClass) || me.UPLOAD_BUTTON_CLASS,
5159
- a = (t == null ? void 0 : t.fileInputClass) || me.FILE_INPUT_CLASS;
5169
+ var r = (t == null ? void 0 : t.downloadClass) || ge.DOWNLOAD_BUTTON_CLASS,
5170
+ o = (t == null ? void 0 : t.uploadClass) || ge.UPLOAD_BUTTON_CLASS,
5171
+ a = (t == null ? void 0 : t.fileInputClass) || ge.FILE_INPUT_CLASS;
5160
5172
  return setTimeout(function () {
5161
5173
  var l = i == null ? void 0 : i.getElementsByClassName(r)[0],
5162
5174
  c = i == null ? void 0 : i.getElementsByClassName(a)[0],
@@ -5167,7 +5179,7 @@ var _t = /*#__PURE__*/function () {
5167
5179
  c.files && c.files.length > 0 && e(c.files);
5168
5180
  }), d && (d.onclick = function () {
5169
5181
  return c.click();
5170
- }), (l || d) && me.enableButtons(l, d);
5182
+ }), (l || d) && ge.enableButtons(l, d);
5171
5183
  }), (t == null ? void 0 : t.initialHtml) || "<div>\n Download or upload a web model that will run entirely on your browser: <br/> \n <button disabled class=\"".concat(r, " deep-chat-button deep-chat-web-model-button\">Download</button>\n ").concat(n ? "" : "<input type=\"file\" class=\"".concat(a, "\" hidden multiple />\n <button disabled class=\"").concat(o, " deep-chat-button deep-chat-web-model-button\">Upload</button>"), "\n </div>");
5172
5184
  }
5173
5185
  }, {
@@ -5192,16 +5204,16 @@ var _t = /*#__PURE__*/function () {
5192
5204
  }, {
5193
5205
  key: "setUpAfterLoad",
5194
5206
  value: function setUpAfterLoad(e, t, i, n) {
5195
- var r = (t == null ? void 0 : t.exportFilesClass) || me.EXPORT_BUTTON_CLASS;
5207
+ var r = (t == null ? void 0 : t.exportFilesClass) || ge.EXPORT_BUTTON_CLASS;
5196
5208
  return setTimeout(function () {
5197
5209
  var o = i == null ? void 0 : i.getElementsByClassName(r)[0];
5198
5210
  o && (o.onclick = function () {
5199
- return me.exportFile(e);
5211
+ return ge.exportFile(e);
5200
5212
  });
5201
5213
  }), (t == null ? void 0 : t.afterLoadHtml) || "<div>\n Model loaded successfully and has been cached for future requests.\n ".concat(n ? "" : "<br/> <button style=\"margin-top: 5px\" class=\"".concat(r, " deep-chat-button\">Export</button>"), "\n </div>");
5202
5214
  }
5203
5215
  }]);
5204
- return me;
5216
+ return ge;
5205
5217
  }();
5206
5218
  _t.DOWNLOAD_BUTTON_CLASS = "deep-chat-download-button";
5207
5219
  _t.UPLOAD_BUTTON_CLASS = "deep-chat-upload-button";
@@ -5358,13 +5370,13 @@ var wn = {
5358
5370
  var _this12 = this;
5359
5371
  var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
5360
5372
  var i;
5361
- window.webLLM ? this.configureInit(this.shouldAddInitialMessage(e.introMessage)) : t > M.MODULE_SEARCH_LIMIT_S ? ((i = this._messages) == null || i.addNewErrorMessage("service", M.WEB_LLM_NOT_FOUND_ERROR), console.error("The deep-chat-web-llm module has not been attached to the window object. Please see the following guide:"), console.error("https://deepchat.dev/examples/externalModules")) : setTimeout(function () {
5373
+ window.webLLM ? this.configureInit(this.shouldAddIntroMessage(e.introMessage)) : t > M.MODULE_SEARCH_LIMIT_S ? ((i = this._messages) == null || i.addNewErrorMessage("service", M.WEB_LLM_NOT_FOUND_ERROR), console.error("The deep-chat-web-llm module has not been attached to the window object. Please see the following guide:"), console.error("https://deepchat.dev/examples/externalModules")) : setTimeout(function () {
5362
5374
  return _this12.findModelInWindow(e, t + 1);
5363
5375
  }, 1e3);
5364
5376
  }
5365
5377
  }, {
5366
- key: "shouldAddInitialMessage",
5367
- value: function shouldAddInitialMessage(e) {
5378
+ key: "shouldAddIntroMessage",
5379
+ value: function shouldAddIntroMessage(e) {
5368
5380
  var t;
5369
5381
  return !e && this._webModel && ((t = this._webModel.introMessage) == null ? void 0 : t.displayed) !== !1;
5370
5382
  }
@@ -5382,7 +5394,7 @@ var wn = {
5382
5394
  }, {
5383
5395
  key: "getIntroMessage",
5384
5396
  value: function getIntroMessage(e) {
5385
- if (!this.shouldAddInitialMessage(e) || !this._chatEl) return;
5397
+ if (!this.shouldAddIntroMessage(e) || !this._chatEl) return;
5386
5398
  var t = Sn.setUpInitial(this.init.bind(this), this._webModel.introMessage, this._chatEl, !!this._webModel.worker);
5387
5399
  return this.scrollToTop(1), {
5388
5400
  role: b.AI_ROLE,
@@ -5493,32 +5505,32 @@ var wn = {
5493
5505
  value: function () {
5494
5506
  var _loadModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(e, t) {
5495
5507
  var _this14 = this;
5496
- var o, a, l, c, d, u, h, i, n, r, _this$getConfig, f, m, p, _f;
5508
+ var o, a, l, c, d, u, h, i, n, r, _this$getConfig, p, m, f, _p;
5497
5509
  return _regeneratorRuntime().wrap(function _callee26$(_context26) {
5498
5510
  while (1) switch (_context26.prev = _context26.next) {
5499
5511
  case 0:
5500
5512
  this.scrollToTop(), M.chat = e, this._isModelLoading = !0;
5501
5513
  i = ((o = this._webModel.introMessage) == null ? void 0 : o.displayed) === !1;
5502
- n = function n(f) {
5514
+ n = function n(p) {
5503
5515
  var m;
5504
5516
  (m = _this14._messages) == null || m.addNewMessage({
5505
- html: "<div>".concat(f.text, "</div>"),
5517
+ html: "<div>".concat(p.text, "</div>"),
5506
5518
  overwrite: !0,
5507
5519
  sendUpdate: !1
5508
5520
  }), i && (setTimeout(function () {
5509
- var p;
5510
- return G.scrollToBottom((p = _this14._messages) == null ? void 0 : p.elementRef);
5521
+ var f;
5522
+ return G.scrollToBottom((f = _this14._messages) == null ? void 0 : f.elementRef);
5511
5523
  }), i = !1);
5512
5524
  };
5513
5525
  M.chat.setInitProgressCallback(n);
5514
5526
  _context26.prev = 4;
5515
- _this$getConfig = this.getConfig(), f = _this$getConfig.model, m = _this$getConfig.appConfig, p = {};
5516
- this._webModel.instruction && (p.conv_config = {
5527
+ _this$getConfig = this.getConfig(), p = _this$getConfig.model, m = _this$getConfig.appConfig, f = {};
5528
+ this._webModel.instruction && (f.conv_config = {
5517
5529
  system: this._webModel.instruction
5518
5530
  });
5519
- this._conversationHistory.length > 0 && (p.conversation_history = this._conversationHistory);
5531
+ this._conversationHistory.length > 0 && (f.conversation_history = this._conversationHistory);
5520
5532
  _context26.next = 10;
5521
- return M.chat.reload(f, p, m, t);
5533
+ return M.chat.reload(p, f, m, t);
5522
5534
  case 10:
5523
5535
  r = _context26.sent;
5524
5536
  _context26.next = 16;
@@ -5529,9 +5541,9 @@ var wn = {
5529
5541
  return _context26.abrupt("return", this.unloadChat(_context26.t0));
5530
5542
  case 16:
5531
5543
  if ((l = (a = this.deepChat)._validationHandler) == null || l.call(a), (c = this._webModel.introMessage) != null && c.removeAfterLoad) this._webModel.introMessage.displayed === !1 ? (u = this._messages) == null || u.removeLastMessage() : (h = this._removeIntro) == null || h.call(this);else {
5532
- _f = Sn.setUpAfterLoad(r, this._webModel.introMessage, this._chatEl, !!this._webModel.worker);
5544
+ _p = Sn.setUpAfterLoad(r, this._webModel.introMessage, this._chatEl, !!this._webModel.worker);
5533
5545
  (d = this._messages) == null || d.addNewMessage({
5534
- html: _f,
5546
+ html: _p,
5535
5547
  overwrite: !0,
5536
5548
  sendUpdate: !1
5537
5549
  });
@@ -5874,11 +5886,11 @@ it.WEB_LLM_NOT_FOUND_ERROR = "WebLLM module not found";
5874
5886
  it.DEFAULT_MODEL = "Llama-2-7b-chat-hf-q4f32_1";
5875
5887
  it.MODULE_SEARCH_LIMIT_S = 5;
5876
5888
  var Zi = it;
5877
- var Ut = /*#__PURE__*/function () {
5878
- function Ut() {
5879
- _classCallCheck(this, Ut);
5889
+ var qt = /*#__PURE__*/function () {
5890
+ function qt() {
5891
+ _classCallCheck(this, qt);
5880
5892
  }
5881
- _createClass(Ut, null, [{
5893
+ _createClass(qt, null, [{
5882
5894
  key: "buildHeaders",
5883
5895
  value: function buildHeaders(e) {
5884
5896
  return {
@@ -5900,19 +5912,19 @@ var Ut = /*#__PURE__*/function () {
5900
5912
  return {
5901
5913
  url: "https://api-inference.huggingface.co/models/gpt2",
5902
5914
  method: "POST",
5903
- handleVerificationResult: Ut.handleVerificationResult
5915
+ handleVerificationResult: qt.handleVerificationResult
5904
5916
  };
5905
5917
  }
5906
5918
  }]);
5907
- return Ut;
5919
+ return qt;
5908
5920
  }();
5909
- var us = /*#__PURE__*/function (_U) {
5910
- _inherits(Bi, _U);
5921
+ var us = /*#__PURE__*/function (_q) {
5922
+ _inherits(Bi, _q);
5911
5923
  // prettier-ignore
5912
5924
  function Bi(e, t, i, n, r, o) {
5913
5925
  var _this16;
5914
5926
  _classCallCheck(this, Bi);
5915
- _this16 = _callSuper(this, Bi, [e, Ut.buildKeyVerificationDetails(), Ut.buildHeaders, r, o]), _this16.insertKeyPlaceholderText = "Hugging Face Token", _this16.keyHelpUrl = "https://huggingface.co/settings/tokens", _this16.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this16.permittedErrorPrefixes = ["Authorization header"], _this16.url = "".concat(Bi.URL_PREFIX).concat(i), _this16.textInputPlaceholderText = t, _typeof(n) == "object" && (n.model && (_this16.url = "".concat(Bi.URL_PREFIX).concat(n.model)), n.options && (_this16.rawBody.options = n.options), n.parameters && (_this16.rawBody.parameters = n.parameters));
5927
+ _this16 = _callSuper(this, Bi, [e, qt.buildKeyVerificationDetails(), qt.buildHeaders, r, o]), _this16.insertKeyPlaceholderText = "Hugging Face Token", _this16.keyHelpUrl = "https://huggingface.co/settings/tokens", _this16.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this16.permittedErrorPrefixes = ["Authorization header"], _this16.url = "".concat(Bi.URL_PREFIX).concat(i), _this16.textInputPlaceholderText = t, _typeof(n) == "object" && (n.model && (_this16.url = "".concat(Bi.URL_PREFIX).concat(n.model)), n.options && (_this16.rawBody.options = n.options), n.parameters && (_this16.rawBody.parameters = n.parameters));
5916
5928
  return _this16;
5917
5929
  }
5918
5930
  // prettier-ignore
@@ -5955,7 +5967,7 @@ var us = /*#__PURE__*/function (_U) {
5955
5967
  }()
5956
5968
  }]);
5957
5969
  return Bi;
5958
- }(U);
5970
+ }(q);
5959
5971
  us.URL_PREFIX = "https://api-inference.huggingface.co/models/";
5960
5972
  var Be = us;
5961
5973
  var St = /*#__PURE__*/function (_Be) {
@@ -6114,11 +6126,11 @@ var Ao = /*#__PURE__*/function (_St2) {
6114
6126
  return Ao;
6115
6127
  }(St);
6116
6128
  var wt = "data:image/png;base64,";
6117
- var ce = /*#__PURE__*/function () {
6118
- function ce() {
6119
- _classCallCheck(this, ce);
6129
+ var de = /*#__PURE__*/function () {
6130
+ function de() {
6131
+ _classCallCheck(this, de);
6120
6132
  }
6121
- _createClass(ce, null, [{
6133
+ _createClass(de, null, [{
6122
6134
  key: "buildHeaders",
6123
6135
  value: function buildHeaders(e) {
6124
6136
  return {
@@ -6138,14 +6150,14 @@ var ce = /*#__PURE__*/function () {
6138
6150
  return {
6139
6151
  url: "https://api.stability.ai/v1/engines/list",
6140
6152
  method: "GET",
6141
- handleVerificationResult: ce.handleVerificationResult
6153
+ handleVerificationResult: de.handleVerificationResult
6142
6154
  };
6143
6155
  }
6144
6156
  }]);
6145
- return ce;
6157
+ return de;
6146
6158
  }();
6147
- var oi = /*#__PURE__*/function (_U2) {
6148
- _inherits(oi, _U2);
6159
+ var oi = /*#__PURE__*/function (_q2) {
6160
+ _inherits(oi, _q2);
6149
6161
  // prettier-ignore
6150
6162
  function oi(e, t, i, n, r) {
6151
6163
  var _this18;
@@ -6154,7 +6166,7 @@ var oi = /*#__PURE__*/function (_U2) {
6154
6166
  return _this18;
6155
6167
  }
6156
6168
  return _createClass(oi);
6157
- }(U);
6169
+ }(q);
6158
6170
  var Ht = /*#__PURE__*/function (_oi) {
6159
6171
  _inherits(Ht, _oi);
6160
6172
  function Ht(e) {
@@ -6171,7 +6183,7 @@ var Ht = /*#__PURE__*/function (_oi) {
6171
6183
  }
6172
6184
  }
6173
6185
  };
6174
- _this19 = _callSuper(this, Ht, [e, ce.buildKeyVerificationDetails(), ce.buildHeaders, i, n]), _this19.url = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale", _this19.textInputPlaceholderText = "Describe image changes", _this19.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>";
6186
+ _this19 = _callSuper(this, Ht, [e, de.buildKeyVerificationDetails(), de.buildHeaders, i, n]), _this19.url = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale", _this19.textInputPlaceholderText = "Describe image changes", _this19.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>";
6175
6187
  var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageUpscale;
6176
6188
  _typeof(r) == "object" && (r.engine_id && (_this19.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")), Ht.cleanConfig(r), Object.assign(_this19.rawBody, r)), _this19.canSendMessage = Ht.canSendFileMessage;
6177
6189
  return _this19;
@@ -6279,7 +6291,7 @@ var Gt = /*#__PURE__*/function (_oi2) {
6279
6291
  }
6280
6292
  }
6281
6293
  };
6282
- _this20 = _callSuper(this, Gt, [e, ce.buildKeyVerificationDetails(), ce.buildHeaders, i, n]), _this20.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this20._maskSource = "MASK_IMAGE_WHITE", _this20.textInputPlaceholderText = "Describe image changes", _this20.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>";
6294
+ _this20 = _callSuper(this, Gt, [e, de.buildKeyVerificationDetails(), de.buildHeaders, i, n]), _this20.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this20._maskSource = "MASK_IMAGE_WHITE", _this20.textInputPlaceholderText = "Describe image changes", _this20.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>";
6283
6295
  var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
6284
6296
  _typeof(r) == "object" && (r.engine_id && (_this20.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this20._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this20._maskSource = r.mask_source), Gt.cleanConfig(r), Object.assign(_this20.rawBody, r)), _this20.canSendMessage = Gt.canSendFileTextMessage;
6285
6297
  return _this20;
@@ -6652,7 +6664,7 @@ var Vt = /*#__PURE__*/function (_oi3) {
6652
6664
  }
6653
6665
  }
6654
6666
  };
6655
- _this23 = _callSuper(this, Vt, [e, ce.buildKeyVerificationDetails(), ce.buildHeaders, i, n]), _this23.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this23.textInputPlaceholderText = "Describe image changes", _this23.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>";
6667
+ _this23 = _callSuper(this, Vt, [e, de.buildKeyVerificationDetails(), de.buildHeaders, i, n]), _this23.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this23.textInputPlaceholderText = "Describe image changes", _this23.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>";
6656
6668
  var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
6657
6669
  _typeof(r) == "object" && (r.engine_id && (_this23.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this23._imageWeight = r.weight), Vt.cleanConfig(r), Object.assign(_this23.rawBody, r)), _this23.canSendMessage = Vt.canSendFileTextMessage;
6658
6670
  return _this23;
@@ -6791,7 +6803,7 @@ var Wt = /*#__PURE__*/function (_oi4) {
6791
6803
  var r;
6792
6804
  var t = JSON.parse(JSON.stringify(e.directConnection)),
6793
6805
  i = t.stabilityAI;
6794
- _this24 = _callSuper(this, Wt, [e, ce.buildKeyVerificationDetails(), ce.buildHeaders, i]), _this24.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/text-to-image", _this24.textInputPlaceholderText = "Describe an image", _this24.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>";
6806
+ _this24 = _callSuper(this, Wt, [e, de.buildKeyVerificationDetails(), de.buildHeaders, i]), _this24.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/text-to-image", _this24.textInputPlaceholderText = "Describe an image", _this24.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>";
6795
6807
  var n = (r = t.stabilityAI) == null ? void 0 : r.textToImage;
6796
6808
  _typeof(n) == "object" && (n.engine_id && (_this24.url = "https://api.stability.ai/v1/generation/".concat(n.engine_id, "/text-to-image")), n.weight !== void 0 && n.weight !== null && (_this24._imageWeight = n.weight), Wt.cleanConfig(n), Object.assign(_this24.rawBody, n)), _this24.canSendMessage = Wt.canSendTextMessage;
6797
6809
  return _this24;
@@ -6953,8 +6965,8 @@ var Jt = /*#__PURE__*/function () {
6953
6965
  }]);
6954
6966
  return Jt;
6955
6967
  }();
6956
- var Xi = /*#__PURE__*/function (_U3) {
6957
- _inherits(Xi, _U3);
6968
+ var Xi = /*#__PURE__*/function (_q3) {
6969
+ _inherits(Xi, _q3);
6958
6970
  function Xi(e, t, i, n, r) {
6959
6971
  var _this26;
6960
6972
  _classCallCheck(this, Xi);
@@ -6962,7 +6974,7 @@ var Xi = /*#__PURE__*/function (_U3) {
6962
6974
  return _this26;
6963
6975
  }
6964
6976
  return _createClass(Xi);
6965
- }(U);
6977
+ }(q);
6966
6978
  var Do = /*#__PURE__*/function (_Xi) {
6967
6979
  _inherits(Do, _Xi);
6968
6980
  function Do(e) {
@@ -7182,8 +7194,8 @@ var N = /*#__PURE__*/function () {
7182
7194
  }]);
7183
7195
  return N;
7184
7196
  }();
7185
- var Qi = /*#__PURE__*/function (_U4) {
7186
- _inherits(zi, _U4);
7197
+ var Qi = /*#__PURE__*/function (_q4) {
7198
+ _inherits(zi, _q4);
7187
7199
  function zi(e) {
7188
7200
  var _o$model, _a$voice;
7189
7201
  var _this27;
@@ -7277,12 +7289,12 @@ var Qi = /*#__PURE__*/function (_U4) {
7277
7289
  }()
7278
7290
  }]);
7279
7291
  return zi;
7280
- }(U);
7292
+ }(q);
7281
7293
  Qi.DEFAULT_MODEL = "tts-1";
7282
7294
  Qi.DEFAULT_VOIDE = "alloy";
7283
7295
  var Fo = Qi;
7284
- var ai = /*#__PURE__*/function (_U5) {
7285
- _inherits(Te, _U5);
7296
+ var ai = /*#__PURE__*/function (_q5) {
7297
+ _inherits(Te, _q5);
7286
7298
  function Te(e) {
7287
7299
  var _o$model2;
7288
7300
  var _this28;
@@ -7392,7 +7404,7 @@ var ai = /*#__PURE__*/function (_U5) {
7392
7404
  }
7393
7405
  }]);
7394
7406
  return Te;
7395
- }(U);
7407
+ }(q);
7396
7408
  ai.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions";
7397
7409
  ai.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations";
7398
7410
  ai.DEFAULT_MODEL = "whisper-1";
@@ -7499,8 +7511,8 @@ var Z = /*#__PURE__*/function () {
7499
7511
  }]);
7500
7512
  return Z;
7501
7513
  }();
7502
- var zo = /*#__PURE__*/function (_U6) {
7503
- _inherits(zo, _U6);
7514
+ var zo = /*#__PURE__*/function (_q6) {
7515
+ _inherits(zo, _q6);
7504
7516
  // prettier-ignore
7505
7517
  function zo(e, t, i, n, r) {
7506
7518
  var _this29;
@@ -7511,20 +7523,20 @@ var zo = /*#__PURE__*/function (_U6) {
7511
7523
  return _this29;
7512
7524
  }
7513
7525
  return _createClass(zo);
7514
- }(U);
7515
- var qo = /*#__PURE__*/function (_zo) {
7516
- _inherits(qo, _zo);
7517
- function qo(e) {
7526
+ }(q);
7527
+ var Uo = /*#__PURE__*/function (_zo) {
7528
+ _inherits(Uo, _zo);
7529
+ function Uo(e) {
7518
7530
  var _a$language;
7519
7531
  var _this30;
7520
- _classCallCheck(this, qo);
7532
+ _classCallCheck(this, Uo);
7521
7533
  var n, r, o, a;
7522
7534
  var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.summarization,
7523
7535
  i = (o = e.directConnection) == null ? void 0 : o.azure;
7524
- _this30 = _callSuper(this, qo, [e, Z.buildSummarizationHeader, t.endpoint, i]), _this30.url = "", _this30.textInputPlaceholderText = "Insert text to summarize", (_a$language = (a = _this30.rawBody).language) !== null && _a$language !== void 0 ? _a$language : a.language = "en", Object.assign(_this30.rawBody, t), _this30.url = "".concat(t.endpoint, "/language/analyze-text/jobs?api-version=2022-10-01-preview");
7536
+ _this30 = _callSuper(this, Uo, [e, Z.buildSummarizationHeader, t.endpoint, i]), _this30.url = "", _this30.textInputPlaceholderText = "Insert text to summarize", (_a$language = (a = _this30.rawBody).language) !== null && _a$language !== void 0 ? _a$language : a.language = "en", Object.assign(_this30.rawBody, t), _this30.url = "".concat(t.endpoint, "/language/analyze-text/jobs?api-version=2022-10-01-preview");
7525
7537
  return _this30;
7526
7538
  }
7527
- _createClass(qo, [{
7539
+ _createClass(Uo, [{
7528
7540
  key: "preprocessBody",
7529
7541
  value: function preprocessBody(e, t) {
7530
7542
  var i = t[t.length - 1].text;
@@ -7664,7 +7676,7 @@ var qo = /*#__PURE__*/function (_zo) {
7664
7676
  return extractPollResultData;
7665
7677
  }()
7666
7678
  }]);
7667
- return qo;
7679
+ return Uo;
7668
7680
  }(zo);
7669
7681
  var ut = /*#__PURE__*/function () {
7670
7682
  function ut() {
@@ -7772,8 +7784,8 @@ var ut = /*#__PURE__*/function () {
7772
7784
  }]);
7773
7785
  return ut;
7774
7786
  }();
7775
- var en = /*#__PURE__*/function (_U7) {
7776
- _inherits(en, _U7);
7787
+ var en = /*#__PURE__*/function (_q7) {
7788
+ _inherits(en, _q7);
7777
7789
  function en(e) {
7778
7790
  var _this31;
7779
7791
  _classCallCheck(this, en);
@@ -7856,9 +7868,9 @@ var en = /*#__PURE__*/function (_U7) {
7856
7868
  }
7857
7869
  }]);
7858
7870
  return en;
7859
- }(U);
7860
- var hs = /*#__PURE__*/function (_U8) {
7861
- _inherits(hs, _U8);
7871
+ }(q);
7872
+ var hs = /*#__PURE__*/function (_q8) {
7873
+ _inherits(hs, _q8);
7862
7874
  // prettier-ignore
7863
7875
  function hs(e, t, i, n, r) {
7864
7876
  var _this32;
@@ -7869,21 +7881,21 @@ var hs = /*#__PURE__*/function (_U8) {
7869
7881
  return _this32;
7870
7882
  }
7871
7883
  return _createClass(hs);
7872
- }(U);
7873
- var fs = /*#__PURE__*/function (_hs) {
7874
- _inherits(ps, _hs);
7884
+ }(q);
7885
+ var ps = /*#__PURE__*/function (_hs) {
7886
+ _inherits(fs, _hs);
7875
7887
  // prettier-ignore
7876
- function ps(e) {
7888
+ function fs(e) {
7877
7889
  var _a$lang, _l$name, _c$gender;
7878
7890
  var _this33;
7879
- _classCallCheck(this, ps);
7891
+ _classCallCheck(this, fs);
7880
7892
  var n, r, o, a, l, c;
7881
7893
  var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.textToSpeech,
7882
7894
  i = (o = e.directConnection) == null ? void 0 : o.azure;
7883
- _this33 = _callSuper(this, ps, [e, Z.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, i]), _this33.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(ps.HELP_LINK, "\">here</a> for more info.\n </p>"), _this33.url = "", Object.assign(_this33.rawBody, t), (_a$lang = (a = _this33.rawBody).lang) !== null && _a$lang !== void 0 ? _a$lang : a.lang = "en-US", (_l$name = (l = _this33.rawBody).name) !== null && _l$name !== void 0 ? _l$name : l.name = "en-US-JennyNeural", (_c$gender = (c = _this33.rawBody).gender) !== null && _c$gender !== void 0 ? _c$gender : c.gender = "Female", _this33.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1");
7895
+ _this33 = _callSuper(this, fs, [e, Z.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, i]), _this33.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(fs.HELP_LINK, "\">here</a> for more info.\n </p>"), _this33.url = "", Object.assign(_this33.rawBody, t), (_a$lang = (a = _this33.rawBody).lang) !== null && _a$lang !== void 0 ? _a$lang : a.lang = "en-US", (_l$name = (l = _this33.rawBody).name) !== null && _l$name !== void 0 ? _l$name : l.name = "en-US-JennyNeural", (_c$gender = (c = _this33.rawBody).gender) !== null && _c$gender !== void 0 ? _c$gender : c.gender = "Female", _this33.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1");
7884
7896
  return _this33;
7885
7897
  }
7886
- _createClass(ps, [{
7898
+ _createClass(fs, [{
7887
7899
  key: "preprocessBody",
7888
7900
  value: function preprocessBody(e, t) {
7889
7901
  var i = t[t.length - 1].text;
@@ -7946,17 +7958,17 @@ var fs = /*#__PURE__*/function (_hs) {
7946
7958
  return extractResultData;
7947
7959
  }()
7948
7960
  }]);
7949
- return ps;
7961
+ return fs;
7950
7962
  }(hs);
7951
- fs.HELP_LINK =
7963
+ ps.HELP_LINK =
7952
7964
  // eslint-disable-next-line max-len
7953
7965
  "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
7954
- var Uo = fs;
7966
+ var qo = ps;
7955
7967
  var ms = /*#__PURE__*/function (_hs2) {
7956
- _inherits(qi, _hs2);
7957
- function qi(e) {
7968
+ _inherits(Ui, _hs2);
7969
+ function Ui(e) {
7958
7970
  var _this34;
7959
- _classCallCheck(this, qi);
7971
+ _classCallCheck(this, Ui);
7960
7972
  var o, a, l;
7961
7973
  var t = (a = (o = e.directConnection) == null ? void 0 : o.azure) == null ? void 0 : a.speechToText,
7962
7974
  i = (l = e.directConnection) == null ? void 0 : l.azure,
@@ -7967,12 +7979,12 @@ var ms = /*#__PURE__*/function (_hs2) {
7967
7979
  }
7968
7980
  }
7969
7981
  };
7970
- _this34 = _callSuper(this, qi, [e, Z.buildSpeechToTextHeaders, t.region, i, n]), _this34.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(qi.HELP_LINK, "\">here</a> for more info.\n </p>"), _this34.url = "", _this34.isTextInputDisabled = !0, _this34.textInputPlaceholderText = "Upload an audio file", _this34.canSendMessage = qi.canFileSendMessage;
7982
+ _this34 = _callSuper(this, Ui, [e, Z.buildSpeechToTextHeaders, t.region, i, n]), _this34.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(Ui.HELP_LINK, "\">here</a> for more info.\n </p>"), _this34.url = "", _this34.isTextInputDisabled = !0, _this34.textInputPlaceholderText = "Upload an audio file", _this34.canSendMessage = Ui.canFileSendMessage;
7971
7983
  var r = t.lang || "en-US";
7972
7984
  _this34.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(r, "&format=detailed"), _this34.recordAudio = void 0;
7973
7985
  return _this34;
7974
7986
  }
7975
- _createClass(qi, [{
7987
+ _createClass(Ui, [{
7976
7988
  key: "callServiceAPI",
7977
7989
  value: function () {
7978
7990
  var _callServiceAPI16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(e, t, i) {
@@ -8037,14 +8049,14 @@ var ms = /*#__PURE__*/function (_hs2) {
8037
8049
  return !!(t != null && t[0]);
8038
8050
  }
8039
8051
  }]);
8040
- return qi;
8052
+ return Ui;
8041
8053
  }(hs);
8042
8054
  ms.HELP_LINK =
8043
8055
  // eslint-disable-next-line max-len
8044
8056
  "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
8045
8057
  var Ho = ms;
8046
- var Go = /*#__PURE__*/function (_U9) {
8047
- _inherits(Go, _U9);
8058
+ var Go = /*#__PURE__*/function (_q9) {
8059
+ _inherits(Go, _q9);
8048
8060
  // prettier-ignore
8049
8061
  function Go(e) {
8050
8062
  var _this35;
@@ -8122,12 +8134,12 @@ var Go = /*#__PURE__*/function (_U9) {
8122
8134
  }()
8123
8135
  }]);
8124
8136
  return Go;
8125
- }(U);
8126
- var ve = /*#__PURE__*/function () {
8127
- function ve() {
8128
- _classCallCheck(this, ve);
8137
+ }(q);
8138
+ var ye = /*#__PURE__*/function () {
8139
+ function ye() {
8140
+ _classCallCheck(this, ye);
8129
8141
  }
8130
- _createClass(ve, null, [{
8142
+ _createClass(ye, null, [{
8131
8143
  key: "storeFiles",
8132
8144
  value: function () {
8133
8145
  var _storeFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(e, t, i) {
@@ -8218,7 +8230,7 @@ var ve = /*#__PURE__*/function () {
8218
8230
  l({
8219
8231
  src: d.target.result,
8220
8232
  name: t[a].name,
8221
- type: ve.getType(t, a)
8233
+ type: ye.getType(t, a)
8222
8234
  });
8223
8235
  };
8224
8236
  });
@@ -8256,7 +8268,7 @@ var ve = /*#__PURE__*/function () {
8256
8268
  l.text && l.text.startsWith("sandbox:") && (c = l.file_path) != null && c.file_id && i.push({
8257
8269
  path: l.text,
8258
8270
  fileId: l.file_path.file_id,
8259
- name: ve.getFileName(l.text)
8271
+ name: ye.getFileName(l.text)
8260
8272
  });
8261
8273
  });
8262
8274
  }), t != null && t.image_file && i.push({
@@ -8278,7 +8290,7 @@ var ve = /*#__PURE__*/function () {
8278
8290
  break;
8279
8291
  }
8280
8292
  _context78.next = 4;
8281
- return ve.getFiles(e, t);
8293
+ return ye.getFiles(e, t);
8282
8294
  case 4:
8283
8295
  r = _context78.sent;
8284
8296
  (o = n == null ? void 0 : n.text) != null && o.value && r.forEach(function (l, c) {
@@ -8312,9 +8324,9 @@ var ve = /*#__PURE__*/function () {
8312
8324
  return _regeneratorRuntime().wrap(function _callee79$(_context79) {
8313
8325
  while (1) switch (_context79.prev = _context79.next) {
8314
8326
  case 0:
8315
- n = ve.getFileDetails(t, i);
8327
+ n = ye.getFileDetails(t, i);
8316
8328
  _context79.next = 3;
8317
- return ve.getFilesAndNewText(e, n, t.role, i);
8329
+ return ye.getFilesAndNewText(e, n, t.role, i);
8318
8330
  case 3:
8319
8331
  return _context79.abrupt("return", _context79.sent);
8320
8332
  case 4:
@@ -8329,10 +8341,10 @@ var ve = /*#__PURE__*/function () {
8329
8341
  return getFilesAndText;
8330
8342
  }()
8331
8343
  }]);
8332
- return ve;
8344
+ return ye;
8333
8345
  }();
8334
- var li = /*#__PURE__*/function (_U10) {
8335
- _inherits(oe, _U10);
8346
+ var li = /*#__PURE__*/function (_q10) {
8347
+ _inherits(oe, _q10);
8336
8348
  function oe(e) {
8337
8349
  var _c$headers, _d$OpenAIBeta;
8338
8350
  var _this36;
@@ -8349,8 +8361,8 @@ var li = /*#__PURE__*/function (_U10) {
8349
8361
  var _this36$config = _this36.config,
8350
8362
  u = _this36$config.new_assistant,
8351
8363
  h = _this36$config.thread_id,
8352
- f = _this36$config.load_thread_history;
8353
- Object.assign(_this36.newAssistantDetails, u), h && (_this36.sessionId = h), f && (_this36.shouldFetchHistory = !0);
8364
+ p = _this36$config.load_thread_history;
8365
+ Object.assign(_this36.newAssistantDetails, u), h && (_this36.sessionId = h), p && (_this36.shouldFetchHistory = !0);
8354
8366
  var _ref11 = (a = (o = e.directConnection) == null ? void 0 : o.openAI) == null ? void 0 : a.assistant,
8355
8367
  m = _ref11.function_handler;
8356
8368
  m && (_this36._functionHandler = m);
@@ -8467,7 +8479,7 @@ var li = /*#__PURE__*/function (_U10) {
8467
8479
  break;
8468
8480
  }
8469
8481
  _context81.next = 16;
8470
- return ve.storeFiles(this, e, i);
8482
+ return ye.storeFiles(this, e, i);
8471
8483
  case 16:
8472
8484
  _context81.t1 = _context81.sent;
8473
8485
  _context81.next = 20;
@@ -8634,7 +8646,7 @@ var li = /*#__PURE__*/function (_U10) {
8634
8646
  return !!d.text || !!d.image_file;
8635
8647
  });
8636
8648
  _context85.next = 3;
8637
- return ve.getFilesAndText(_this38, l, c);
8649
+ return ye.getFilesAndText(_this38, l, c);
8638
8650
  case 3:
8639
8651
  return _context85.abrupt("return", _context85.sent);
8640
8652
  case 4:
@@ -8786,13 +8798,13 @@ var li = /*#__PURE__*/function (_U10) {
8786
8798
  }()
8787
8799
  }]);
8788
8800
  return oe;
8789
- }(U);
8801
+ }(q);
8790
8802
  li.THREAD_PREFIX = "https://api.openai.com/v1/threads";
8791
8803
  li.NEW_ASSISTANT_URL = "https://api.openai.com/v1/assistants";
8792
8804
  li.POLLING_TIMEOUT_MS = 800;
8793
8805
  var Vo = li;
8794
- var ci = /*#__PURE__*/function (_U11) {
8795
- _inherits(Ce, _U11);
8806
+ var ci = /*#__PURE__*/function (_q11) {
8807
+ _inherits(Ce, _q11);
8796
8808
  function Ce(e) {
8797
8809
  var _this39;
8798
8810
  _classCallCheck(this, Ce);
@@ -8941,13 +8953,13 @@ var ci = /*#__PURE__*/function (_U11) {
8941
8953
  }
8942
8954
  }]);
8943
8955
  return Ce;
8944
- }(U);
8956
+ }(q);
8945
8957
  ci.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations";
8946
8958
  ci.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations";
8947
8959
  ci.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
8948
8960
  var Wo = ci;
8949
- var ht = /*#__PURE__*/function (_U12) {
8950
- _inherits(ht, _U12);
8961
+ var ht = /*#__PURE__*/function (_q12) {
8962
+ _inherits(ht, _q12);
8951
8963
  function ht(e) {
8952
8964
  var _this40$maxMessages, _l$model;
8953
8965
  var _this40;
@@ -9137,9 +9149,9 @@ var ht = /*#__PURE__*/function (_U12) {
9137
9149
  _context94.next = 35;
9138
9150
  break;
9139
9151
  }
9140
- o.forEach(function (h, f) {
9141
- var p;
9142
- var m = (p = e.tool_calls) == null ? void 0 : p[f];
9152
+ o.forEach(function (h, p) {
9153
+ var f;
9154
+ var m = (f = e.tool_calls) == null ? void 0 : f[p];
9143
9155
  n == null || n.messages.push({
9144
9156
  role: "tool",
9145
9157
  tool_call_id: m == null ? void 0 : m.id,
@@ -9149,8 +9161,8 @@ var ht = /*#__PURE__*/function (_U12) {
9149
9161
  }), delete n.tools, delete n.tool_choice, delete n.stream;
9150
9162
  _context94.prev = 17;
9151
9163
  _context94.next = 20;
9152
- return t == null ? void 0 : t(n).then(function (f) {
9153
- return v.processResponseByType(f);
9164
+ return t == null ? void 0 : t(n).then(function (p) {
9165
+ return v.processResponseByType(p);
9154
9166
  });
9155
9167
  case 20:
9156
9168
  _h = _context94.sent;
@@ -9220,7 +9232,7 @@ var ht = /*#__PURE__*/function (_U12) {
9220
9232
  }
9221
9233
  }]);
9222
9234
  return ht;
9223
- }(U);
9235
+ }(q);
9224
9236
  var Jo = /*#__PURE__*/function (_Xi3) {
9225
9237
  _inherits(Jo, _Xi3);
9226
9238
  function Jo(e) {
@@ -9315,7 +9327,7 @@ var $o = /*#__PURE__*/function () {
9315
9327
  // this should only be called when no _activeService is set or is demo as otherwise we don't want to reconnect
9316
9328
  function create(e) {
9317
9329
  var t = e.directConnection,
9318
- i = e.request,
9330
+ i = e.connect,
9319
9331
  n = e.demo,
9320
9332
  r = e.webModel;
9321
9333
  if (r) return new Zi(e);
@@ -9326,34 +9338,34 @@ var $o = /*#__PURE__*/function () {
9326
9338
  if (t.huggingFace) return t.huggingFace.textGeneration ? new Io(e) : t.huggingFace.summarization ? new Ro(e) : t.huggingFace.translation ? new Oo(e) : t.huggingFace.fillMask ? new Po(e) : t.huggingFace.questionAnswer ? new Lo(e) : t.huggingFace.audioSpeechRecognition ? new ko(e) : t.huggingFace.audioClassification ? new Co(e) : t.huggingFace.imageClassification ? new Ao(e) : new No(e);
9327
9339
  if (t.azure) {
9328
9340
  if (t.azure.speechToText) return new Ho(e);
9329
- if (t.azure.textToSpeech) return new Uo(e);
9330
- if (t.azure.summarization) return new qo(e);
9341
+ if (t.azure.textToSpeech) return new qo(e);
9342
+ if (t.azure.summarization) return new Uo(e);
9331
9343
  if (t.azure.translation) return new Go(e);
9332
9344
  }
9333
9345
  if (t.stabilityAI) return t.stabilityAI.imageToImage ? new Vt(e) : t.stabilityAI.imageToImageUpscale ? new Ht(e) : t.stabilityAI.imageToImageMasking ? new Gt(e) : new Wt(e);
9334
9346
  }
9335
- return i ? new Pe(e) : new Pe(e, void 0, n || !0);
9347
+ return i && !(n && i.stream) ? new Pe(e) : new Pe(e, void 0, n || !0);
9336
9348
  }
9337
9349
  }]);
9338
9350
  return $o;
9339
9351
  }();
9340
9352
  var gs = /*#__PURE__*/function () {
9341
- function Ui() {
9342
- _classCallCheck(this, Ui);
9353
+ function qi() {
9354
+ _classCallCheck(this, qi);
9343
9355
  }
9344
- _createClass(Ui, null, [{
9356
+ _createClass(qi, null, [{
9345
9357
  key: "appendStyleSheetToHead",
9346
9358
  value: function appendStyleSheetToHead() {
9347
9359
  var e = document.getElementsByTagName("head")[0];
9348
9360
  if (!Array.from(e.getElementsByTagName("link")).some(function (i) {
9349
- return i.getAttribute("href") === Ui.FONT_URL;
9361
+ return i.getAttribute("href") === qi.FONT_URL;
9350
9362
  })) {
9351
9363
  var _i12 = document.createElement("link");
9352
- _i12.rel = "stylesheet", _i12.href = Ui.FONT_URL, e.appendChild(_i12);
9364
+ _i12.rel = "stylesheet", _i12.href = qi.FONT_URL, e.appendChild(_i12);
9353
9365
  }
9354
9366
  }
9355
9367
  }]);
9356
- return Ui;
9368
+ return qi;
9357
9369
  }();
9358
9370
  gs.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap";
9359
9371
  var Ko = gs;
@@ -9456,26 +9468,23 @@ var Yo = /*#__PURE__*/function () {
9456
9468
  key: "getText",
9457
9469
  value: function getText(e, t) {
9458
9470
  var i;
9459
- if (!e.directConnection && !e.request && !e.webModel && !e.demo) return "Connect to any API using the [request](https://deepchat.dev/docs/connect#Request)\n property or a popular service via\n [directConnection](https://deepchat.dev/docs/directConnection/#directConnection).\n \n Host AI entirely on your browser via a [webModel](https://deepchat.dev/docs/webModel).\n \n To get started checkout the [Start](https://deepchat.dev/start) page and\n live code [examples](https://deepchat.dev/examples/frameworks).\n \n To remove this message set the [demo](https://deepchat.dev/docs/demo#demo) property to true.";
9471
+ if (!e.directConnection && !e.connect && !e.webModel && !e.demo) return "Connect to any API using the [connect](https://deepchat.dev/docs/connect#connect-1)\n property or a popular service via\n [directConnection](https://deepchat.dev/docs/directConnection/#directConnection).\n \n Host AI entirely on your browser via a [webModel](https://deepchat.dev/docs/webModel).\n \n To get started checkout the [Start](https://deepchat.dev/start) page and\n live code [examples](https://deepchat.dev/examples/frameworks).\n \n To remove this message set the [demo](https://deepchat.dev/docs/demo#demo) property to true.";
9460
9472
  if (e.directConnection) {
9461
9473
  if (!t.isDirectConnection()) return "Please define a valid service inside\n the [directConnection](https://deepchat.dev/docs/directConnection/#directConnection) object.";
9462
9474
  var n = (i = e.directConnection.openAI) == null ? void 0 : i.chat;
9463
9475
  if (_typeof(n) == "object" && n.tools && !n.function_handler) return "Please define the `function_handler` property inside the openAI [chat](https://deepchat.dev/docs/directConnection/openAI#Chat) object.";
9464
- } else if (e.request) {
9465
- if (e.demo && !e.request.stream) return "When [demo](https://deepchat.dev/docs/demo) mode is enabled - the [request](https://deepchat.dev/docs/connect#Request) object can only accept the [stream](https://deepchat.dev/docs/connect#Stream) property.";
9466
- if (!e.request.url && !e.request.handler) return "Please define a `url` or a `handler` property inside the [request](https://deepchat.dev/docs/connect#Request) object.";
9467
- }
9476
+ } else if (e.connect && !e.connect.url && !e.connect.handler) return e.demo ? e.connect.stream ? null : "When [demo](https://deepchat.dev/docs/demo) mode is enabled - the [connect](https://deepchat.dev/docs/connect#connect-1) object can only accept the [stream](https://deepchat.dev/docs/connect#Stream) property." : "Please define a `url` or a `handler` property inside the [connect](https://deepchat.dev/docs/connect#connect-1) object.";
9468
9477
  return null;
9469
9478
  }
9470
9479
  }]);
9471
9480
  return Yo;
9472
9481
  }();
9473
9482
  var Zo = "<?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>";
9474
- var ge = /*#__PURE__*/function () {
9475
- function ge() {
9476
- _classCallCheck(this, ge);
9483
+ var be = /*#__PURE__*/function () {
9484
+ function be() {
9485
+ _classCallCheck(this, be);
9477
9486
  }
9478
- _createClass(ge, null, [{
9487
+ _createClass(be, null, [{
9479
9488
  key: "createImage",
9480
9489
  value: function createImage(e, t) {
9481
9490
  var i = new Image();
@@ -9490,7 +9499,7 @@ var ge = /*#__PURE__*/function () {
9490
9499
  return _regeneratorRuntime().wrap(function _callee97$(_context97) {
9491
9500
  while (1) switch (_context97.prev = _context97.next) {
9492
9501
  case 0:
9493
- n = ge.createImage(t, e.elementRef), r = e.createNewMessageElement("", i);
9502
+ n = be.createImage(t, e.elementRef), r = e.createNewMessageElement("", i);
9494
9503
  r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"), ae.addMessage(e, r, "image", i);
9495
9504
  case 2:
9496
9505
  case "end":
@@ -9507,12 +9516,12 @@ var ge = /*#__PURE__*/function () {
9507
9516
  key: "createAudioElement",
9508
9517
  value: function createAudioElement(e, t) {
9509
9518
  var i = document.createElement("audio");
9510
- return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, ye.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t === b.USER_ROLE ? "audio-player-safari-right" : "audio-player-safari-left")), i;
9519
+ return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, xe.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t === b.USER_ROLE ? "audio-player-safari-right" : "audio-player-safari-left")), i;
9511
9520
  }
9512
9521
  }, {
9513
9522
  key: "addNewAudioMessage",
9514
9523
  value: function addNewAudioMessage(e, t, i) {
9515
- var n = ge.createAudioElement(t, i),
9524
+ var n = be.createAudioElement(t, i),
9516
9525
  r = e.createNewMessageElement("", i);
9517
9526
  r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"), ae.addMessage(e, r, "audio", i);
9518
9527
  }
@@ -9532,7 +9541,7 @@ var ge = /*#__PURE__*/function () {
9532
9541
  key: "addNewAnyFileMessage",
9533
9542
  value: function addNewAnyFileMessage(e, t, i) {
9534
9543
  var n = e.createNewMessageElement("", i),
9535
- r = ge.createAnyFile(t);
9544
+ r = be.createAnyFile(t);
9536
9545
  n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r), ae.addMessage(e, n, "file", i);
9537
9546
  }
9538
9547
  // no overwrite previous message logic as it is complex to track which files are to be overwritten
@@ -9541,23 +9550,23 @@ var ge = /*#__PURE__*/function () {
9541
9550
  value: function addMessages(e, t, i) {
9542
9551
  t.forEach(function (n) {
9543
9552
  var r, o;
9544
- n.ref && (n = ae.removeFileRef(n)), n.type === "audio" || (r = n.src) != null && r.startsWith("data:audio") ? ge.addNewAudioMessage(e, n, i) : n.type === "image" || (o = n.src) != null && o.startsWith("data:image") ? ge.addNewImageMessage(e, n, i) : ge.addNewAnyFileMessage(e, n, i);
9553
+ n.ref && (n = ae.removeFileRef(n)), n.type === "audio" || (r = n.src) != null && r.startsWith("data:audio") ? be.addNewAudioMessage(e, n, i) : n.type === "image" || (o = n.src) != null && o.startsWith("data:image") ? be.addNewImageMessage(e, n, i) : be.addNewAnyFileMessage(e, n, i);
9545
9554
  });
9546
9555
  }
9547
9556
  }]);
9548
- return ge;
9557
+ return be;
9549
9558
  }();
9550
- var be = /*#__PURE__*/function (_Ye) {
9551
- _inherits(be, _Ye);
9552
- function be(e, t, i) {
9559
+ var ve = /*#__PURE__*/function (_Ye) {
9560
+ _inherits(ve, _Ye);
9561
+ function ve(e, t, i) {
9553
9562
  var _this43;
9554
- _classCallCheck(this, be);
9563
+ _classCallCheck(this, ve);
9555
9564
  var a, l;
9556
- _this43 = _callSuper(this, be, [e]);
9565
+ _this43 = _callSuper(this, ve, [e]);
9557
9566
  var n = t.permittedErrorPrefixes,
9558
9567
  r = t.introPanelMarkUp,
9559
9568
  o = t.demo;
9560
- _this43._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this43._onClearMessages = zt.onClearMessages.bind(_assertThisInitialized(_this43), e), _this43._onError = zt.onError.bind(_assertThisInitialized(_this43), e), _this43._displayLoadingMessage = be.getDisplayLoadingMessage(e, t), _this43._permittedErrorPrefixes = n, _this43.addSetupMessageIfNeeded(e, t) || _this43.populateIntroPanel(i, r, e.introPanelStyle), _this43.addIntroductoryMessage(e, t), e.history && _this43.populateInitialMessages(e.history), _this43._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
9569
+ _this43._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this43._onClearMessages = zt.onClearMessages.bind(_assertThisInitialized(_this43), e), _this43._onError = zt.onError.bind(_assertThisInitialized(_this43), e), _this43._displayLoadingMessage = ve.getDisplayLoadingMessage(e, t), _this43._permittedErrorPrefixes = n, _this43.addSetupMessageIfNeeded(e, t) || _this43.populateIntroPanel(i, r, e.introPanelStyle), _this43.addIntroductoryMessage(e, t), _this43.populateHistory(e), _this43._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
9561
9570
  return JSON.parse(JSON.stringify(_this43.messages));
9562
9571
  }, e.clearMessages = _this43.clearMessages.bind(_assertThisInitialized(_this43), t), e.refreshMessages = _this43.refreshTextMessages.bind(_assertThisInitialized(_this43)), e.scrollToBottom = G.scrollToBottom.bind(_assertThisInitialized(_this43), _this43.elementRef), e._addMessage = function (c, d) {
9563
9572
  _this43.addNewMessage(_objectSpread(_objectSpread({}, c), {}, {
@@ -9568,7 +9577,7 @@ var be = /*#__PURE__*/function (_Ye) {
9568
9577
  }), t.fetchHistory && _this43.fetchHistory(t.fetchHistory);
9569
9578
  return _this43;
9570
9579
  }
9571
- _createClass(be, [{
9580
+ _createClass(ve, [{
9572
9581
  key: "prepareDemo",
9573
9582
  value: function prepareDemo(e) {
9574
9583
  _typeof(e) == "object" && (e.response && (this.customDemoResponse = e.response), e.displayErrors && (e.displayErrors["default"] && this.addNewErrorMessage("", ""), e.displayErrors.service && this.addNewErrorMessage("service", ""), e.displayErrors.speechToText && this.addNewErrorMessage("speechToText", "")), e.displayLoadingBubble && this.addLoadingMessage());
@@ -9603,14 +9612,15 @@ var be = /*#__PURE__*/function (_Ye) {
9603
9612
  e.outerContainer.classList.contains("deep-chat-intro") && (e.outerContainer.remove(), this.messageElementRefs.shift());
9604
9613
  }
9605
9614
  }, {
9606
- key: "populateInitialMessages",
9607
- value: function populateInitialMessages(e) {
9615
+ key: "populateHistory",
9616
+ value: function populateHistory(e) {
9608
9617
  var _this44 = this;
9609
- e.forEach(function (t) {
9610
- Se.processInitialMessageFile(t), _this44.addNewMessage(t, !0);
9618
+ var t = e.history || ce.processHistory(e);
9619
+ t && (t.forEach(function (i) {
9620
+ ce.processHistoryFile(i), _this44.addNewMessage(i, !0);
9611
9621
  }), setTimeout(function () {
9612
9622
  return G.scrollToBottom(_this44.elementRef);
9613
- }, 0);
9623
+ }, 0));
9614
9624
  }
9615
9625
  }, {
9616
9626
  key: "fetchHistory",
@@ -9644,13 +9654,13 @@ var be = /*#__PURE__*/function (_Ye) {
9644
9654
  key: "addNewMessage",
9645
9655
  value: function addNewMessage(e) {
9646
9656
  var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
9647
- var i = be.createMessageContent(e),
9657
+ var i = ve.createMessageContent(e),
9648
9658
  n = {
9649
9659
  status: e.overwrite
9650
9660
  };
9651
- if (!e.ignoreText && i.text !== void 0 && e.text !== null && (this.addNewTextMessage(i.text, i.role, n), !t && this.textToSpeech && i.role !== b.USER_ROLE && Ft.speak(i.text, this.textToSpeech)), i.files && Array.isArray(i.files) && ge.addMessages(this, i.files, i.role), i.html !== void 0 && i.html !== null) {
9661
+ if (!e.ignoreText && i.text !== void 0 && e.text !== null && (this.addNewTextMessage(i.text, i.role, n), !t && this.textToSpeech && i.role !== b.USER_ROLE && Ft.speak(i.text, this.textToSpeech)), i.files && Array.isArray(i.files) && be.addMessages(this, i.files, i.role), i.html !== void 0 && i.html !== null) {
9652
9662
  var r = Qe.add(this, i.html, i.role, this.messageElementRefs, n);
9653
- xe.isElementTemporary(r) && delete i.html;
9663
+ Ee.isElementTemporary(r) && delete i.html;
9654
9664
  }
9655
9665
  this.isValidMessageContent(i) && this.updateStateOnMessage(i, e.overwrite, e.sendUpdate, t);
9656
9666
  }
@@ -9672,7 +9682,7 @@ var be = /*#__PURE__*/function (_Ye) {
9672
9682
  value: function removeMessageOnError() {
9673
9683
  var e = this.messageElementRefs[this.messageElementRefs.length - 1],
9674
9684
  t = e == null ? void 0 : e.bubbleElement;
9675
- (t != null && t.classList.contains(Oe.MESSAGE_CLASS) && t.textContent === "" || be.isTemporaryElement(e)) && this.removeLastMessage();
9685
+ (t != null && t.classList.contains(Oe.MESSAGE_CLASS) && t.textContent === "" || ve.isTemporaryElement(e)) && this.removeLastMessage();
9676
9686
  }
9677
9687
  // prettier-ignore
9678
9688
  }, {
@@ -9680,7 +9690,7 @@ var be = /*#__PURE__*/function (_Ye) {
9680
9690
  value: function addNewErrorMessage(e, t) {
9681
9691
  var l, c, d, u, h;
9682
9692
  this.removeMessageOnError();
9683
- var i = be.createBaseElements(),
9693
+ var i = ve.createBaseElements(),
9684
9694
  n = i.outerContainer,
9685
9695
  r = i.bubbleElement;
9686
9696
  r.classList.add("error-message-text");
@@ -9695,10 +9705,10 @@ var be = /*#__PURE__*/function (_Ye) {
9695
9705
  if (e) {
9696
9706
  if (this._displayServiceErrorMessages) return e;
9697
9707
  if (typeof e == "string" && this._permittedErrorPrefixes) {
9698
- var t = be.checkPermittedErrorPrefixes(this._permittedErrorPrefixes, e);
9708
+ var t = ve.checkPermittedErrorPrefixes(this._permittedErrorPrefixes, e);
9699
9709
  if (t) return t;
9700
9710
  } else if (Array.isArray(e) && this._permittedErrorPrefixes) for (var _t3 = 0; _t3 < e.length; _t3 += 1) {
9701
- var _i14 = be.checkPermittedErrorPrefixes(this._permittedErrorPrefixes, e[_t3]);
9711
+ var _i14 = ve.checkPermittedErrorPrefixes(this._permittedErrorPrefixes, e[_t3]);
9702
9712
  if (_i14) return _i14;
9703
9713
  }
9704
9714
  }
@@ -9790,7 +9800,7 @@ var be = /*#__PURE__*/function (_Ye) {
9790
9800
  for (var _i15 = 0; _i15 < e.length; _i15 += 1) if (t.startsWith(e[_i15])) return t;
9791
9801
  }
9792
9802
  }]);
9793
- return be;
9803
+ return ve;
9794
9804
  }(Ye);
9795
9805
  var Mt = /*#__PURE__*/function () {
9796
9806
  function $() {
@@ -10427,7 +10437,7 @@ var fe = /*#__PURE__*/function () {
10427
10437
  key: "createAnyFileAttachment",
10428
10438
  value: function createAnyFileAttachment(e) {
10429
10439
  var t = document.createElement("div");
10430
- t.classList.add("border-bound-attachment"), ye.IS_SAFARI && t.classList.add("border-bound-attachment-safari");
10440
+ t.classList.add("border-bound-attachment"), xe.IS_SAFARI && t.classList.add("border-bound-attachment-safari");
10431
10441
  var i = document.createElement("div");
10432
10442
  i.classList.add("any-file-attachment-text");
10433
10443
  var n = document.createElement("div");
@@ -10521,7 +10531,7 @@ var ra = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
10521
10531
  key: "createAudioContainer",
10522
10532
  value: function createAudioContainer() {
10523
10533
  var e = document.createElement("div");
10524
- return e.classList.add("border-bound-attachment", "audio-attachment-icon-container"), ye.IS_SAFARI && e.classList.add("border-bound-attachment-safari"), e;
10534
+ return e.classList.add("border-bound-attachment", "audio-attachment-icon-container"), xe.IS_SAFARI && e.classList.add("border-bound-attachment-safari"), e;
10525
10535
  }
10526
10536
  }, {
10527
10537
  key: "addAudioElements",
@@ -10673,11 +10683,11 @@ var Ct = /*#__PURE__*/function () {
10673
10683
  return Ct;
10674
10684
  }();
10675
10685
  var ys = /*#__PURE__*/function () {
10676
- function de(e, t, i) {
10677
- _classCallCheck(this, de);
10678
- this._isOpen = !1, this._contentRef = de.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = de.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = de.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = de.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents(e);
10686
+ function ue(e, t, i) {
10687
+ _classCallCheck(this, ue);
10688
+ this._isOpen = !1, this._contentRef = ue.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = ue.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = ue.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = ue.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents(e);
10679
10689
  }
10680
- _createClass(de, [{
10690
+ _createClass(ue, [{
10681
10691
  key: "isOpen",
10682
10692
  value: function isOpen() {
10683
10693
  return this._isOpen;
@@ -10699,7 +10709,7 @@ var ys = /*#__PURE__*/function () {
10699
10709
  var _this53 = this;
10700
10710
  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 () {
10701
10711
  _this53._elementRef.style.display = "none", _this53._backgroundPanelRef.style.display = "none";
10702
- }, de.MODAL_CLOSE_TIMEOUT_MS);
10712
+ }, ue.MODAL_CLOSE_TIMEOUT_MS);
10703
10713
  }
10704
10714
  }, {
10705
10715
  key: "displayModalElements",
@@ -10715,7 +10725,7 @@ var ys = /*#__PURE__*/function () {
10715
10725
  key: "addCloseButton",
10716
10726
  value: function addCloseButton(e, t, i) {
10717
10727
  var _this54 = this;
10718
- var n = t ? de.createSVGButton(e) : de.createTextButton(e);
10728
+ var n = t ? ue.createSVGButton(e) : ue.createTextButton(e);
10719
10729
  return this.addButtons(n), n.onclick = function () {
10720
10730
  _this54.close(), setTimeout(function () {
10721
10731
  i == null || i();
@@ -10777,31 +10787,31 @@ var ys = /*#__PURE__*/function () {
10777
10787
  value: function createTextModalFunc(e, t, i) {
10778
10788
  var n;
10779
10789
  if (_typeof(t) == "object" && (n = t.files) != null && n.infoModal) {
10780
- var r = new de(e, ["modal-content"], t.files.infoModal.containerStyle);
10790
+ var r = new ue(e, ["modal-content"], t.files.infoModal.containerStyle);
10781
10791
  return r.addCloseButton("OK", !1, i), r.openTextModal.bind(r, t.infoModalTextMarkUp || "");
10782
10792
  }
10783
10793
  }
10784
10794
  }]);
10785
- return de;
10795
+ return ue;
10786
10796
  }();
10787
10797
  ys.MODAL_CLOSE_TIMEOUT_MS = 190;
10788
10798
  var ct = ys;
10789
- var ft = /*#__PURE__*/function (_Tt2) {
10790
- _inherits(ft, _Tt2);
10799
+ var pt = /*#__PURE__*/function (_Tt2) {
10800
+ _inherits(pt, _Tt2);
10791
10801
  // prettier-ignore
10792
- function ft(e, t, i, n, r, o) {
10802
+ function pt(e, t, i, n, r, o) {
10793
10803
  var _this55;
10794
- _classCallCheck(this, ft);
10795
- var l, c, d, u, h, f;
10796
- _this55 = _callSuper(this, ft, [ft.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o]);
10804
+ _classCallCheck(this, pt);
10805
+ var l, c, d, u, h, p;
10806
+ _this55 = _callSuper(this, pt, [pt.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o]);
10797
10807
  var a = _this55.createInnerElements(n, r, _this55._customStyles);
10798
- _this55._inputElement = ft.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this55.addClickEvent(e, i), _this55.elementRef.replaceChildren(a.styles), _this55.reapplyStateStyle("styles"), _this55._fileAttachmentsType = t, _this55._openModalOnce = ((u = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : u.openModalOnce) === !1 || (f = (h = i.files) == null ? void 0 : h.infoModal) == null ? void 0 : f.openModalOnce;
10808
+ _this55._inputElement = pt.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this55.addClickEvent(e, i), _this55.elementRef.replaceChildren(a.styles), _this55.reapplyStateStyle("styles"), _this55._fileAttachmentsType = t, _this55._openModalOnce = ((u = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : u.openModalOnce) === !1 || (p = (h = i.files) == null ? void 0 : h.infoModal) == null ? void 0 : p.openModalOnce;
10799
10809
  return _this55;
10800
10810
  }
10801
- _createClass(ft, [{
10811
+ _createClass(pt, [{
10802
10812
  key: "createInnerElements",
10803
10813
  value: function createInnerElements(e, t, i) {
10804
- var n = ft.createSVGIconElement(e, t);
10814
+ var n = pt.createSVGIconElement(e, t);
10805
10815
  return {
10806
10816
  styles: this.createInnerElement(n, "styles", i)
10807
10817
  };
@@ -10852,17 +10862,17 @@ var ft = /*#__PURE__*/function (_Tt2) {
10852
10862
  return i.id = e, i;
10853
10863
  }
10854
10864
  }]);
10855
- return ft;
10865
+ return pt;
10856
10866
  }(Tt);
10857
- var ue = /*#__PURE__*/function () {
10858
- function ue() {
10859
- _classCallCheck(this, ue);
10867
+ var he = /*#__PURE__*/function () {
10868
+ function he() {
10869
+ _classCallCheck(this, he);
10860
10870
  }
10861
- _createClass(ue, null, [{
10871
+ _createClass(he, null, [{
10862
10872
  key: "create",
10863
10873
  value: function create(e, t, i) {
10864
- var n = ue.createElement(i);
10865
- ue.addEvents(n, e, t), e.appendChild(n);
10874
+ var n = he.createElement(i);
10875
+ he.addEvents(n, e, t), e.appendChild(n);
10866
10876
  }
10867
10877
  }, {
10868
10878
  key: "createElement",
@@ -10874,13 +10884,13 @@ var ue = /*#__PURE__*/function () {
10874
10884
  key: "addEvents",
10875
10885
  value: function addEvents(e, t, i) {
10876
10886
  t.ondragenter = function (n) {
10877
- n.preventDefault(), ue.display(e);
10887
+ n.preventDefault(), he.display(e);
10878
10888
  }, e.ondragleave = function (n) {
10879
- n.preventDefault(), ue.hide(e);
10889
+ n.preventDefault(), he.hide(e);
10880
10890
  }, e.ondragover = function (n) {
10881
10891
  n.preventDefault();
10882
10892
  }, e.ondrop = function (n) {
10883
- n.preventDefault(), ue.uploadFile(i, n), ue.hide(e);
10893
+ n.preventDefault(), he.uploadFile(i, n), he.hide(e);
10884
10894
  };
10885
10895
  }
10886
10896
  }, {
@@ -10906,7 +10916,7 @@ var ue = /*#__PURE__*/function () {
10906
10916
  return t !== void 0 && t === !1 ? !1 : !!t || e.getNumberOfTypes() > 0;
10907
10917
  }
10908
10918
  }]);
10909
- return ue;
10919
+ return he;
10910
10920
  }();
10911
10921
  var Ie = /*#__PURE__*/function () {
10912
10922
  function Ie() {
@@ -10980,7 +10990,7 @@ var Ie = /*#__PURE__*/function () {
10980
10990
  }, {
10981
10991
  key: "attach",
10982
10992
  value: function attach(e, t, i, n, r) {
10983
- var o = e.validateInput || Se.processValidateInput(e);
10993
+ var o = e.validateInput || ce.processValidateInput(e);
10984
10994
  e._validationHandler = /*#__PURE__*/function () {
10985
10995
  var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee104(a) {
10986
10996
  var l;
@@ -11095,21 +11105,21 @@ Object.defineProperty(ze, "__esModule", {
11095
11105
  value: !0
11096
11106
  });
11097
11107
  ze.Text = void 0;
11098
- var _e = /*#__PURE__*/function () {
11099
- function _e() {
11100
- _classCallCheck(this, _e);
11108
+ var Se = /*#__PURE__*/function () {
11109
+ function Se() {
11110
+ _classCallCheck(this, Se);
11101
11111
  }
11102
- _createClass(_e, null, [{
11112
+ _createClass(Se, null, [{
11103
11113
  key: "capitalize",
11104
11114
  value: function capitalize(e) {
11105
- return e.replace(_e.FIRST_CHAR_REGEX, function (t) {
11115
+ return e.replace(Se.FIRST_CHAR_REGEX, function (t) {
11106
11116
  return t.toUpperCase();
11107
11117
  });
11108
11118
  }
11109
11119
  }, {
11110
11120
  key: "lineBreak",
11111
11121
  value: function lineBreak(e) {
11112
- return e.replace(_e.DOUBLE_LINE, "<p></p>").replace(_e.ONE_LINE, "<br>");
11122
+ return e.replace(Se.DOUBLE_LINE, "<p></p>").replace(Se.ONE_LINE, "<br>");
11113
11123
  }
11114
11124
  }, {
11115
11125
  key: "isCharDefined",
@@ -11123,12 +11133,12 @@ var _e = /*#__PURE__*/function () {
11123
11133
  return e.split(/(\W+)/);
11124
11134
  }
11125
11135
  }]);
11126
- return _e;
11136
+ return Se;
11127
11137
  }();
11128
- ze.Text = _e;
11129
- _e.FIRST_CHAR_REGEX = /\S/;
11130
- _e.DOUBLE_LINE = /\n\n/g;
11131
- _e.ONE_LINE = /\n/g;
11138
+ ze.Text = Se;
11139
+ Se.FIRST_CHAR_REGEX = /\S/;
11140
+ Se.DOUBLE_LINE = /\n\n/g;
11141
+ Se.ONE_LINE = /\n/g;
11132
11142
  Object.defineProperty(At, "__esModule", {
11133
11143
  value: !0
11134
11144
  });
@@ -11254,11 +11264,11 @@ var Y = /*#__PURE__*/function () {
11254
11264
  }();
11255
11265
  hi.EventListeners = Y;
11256
11266
  Y.KEY_DOWN_TIMEOUT = null;
11257
- var fi = {};
11258
- Object.defineProperty(fi, "__esModule", {
11267
+ var pi = {};
11268
+ Object.defineProperty(pi, "__esModule", {
11259
11269
  value: !0
11260
11270
  });
11261
- fi.PreResultUtils = void 0;
11271
+ pi.PreResultUtils = void 0;
11262
11272
  var ua = /*#__PURE__*/function () {
11263
11273
  function ua() {
11264
11274
  _classCallCheck(this, ua);
@@ -11274,7 +11284,7 @@ var ua = /*#__PURE__*/function () {
11274
11284
  }]);
11275
11285
  return ua;
11276
11286
  }();
11277
- fi.PreResultUtils = ua;
11287
+ pi.PreResultUtils = ua;
11278
11288
  var It = {},
11279
11289
  Lt = {};
11280
11290
  Object.defineProperty(Lt, "__esModule", {
@@ -11318,11 +11328,11 @@ var sn = /*#__PURE__*/function () {
11318
11328
  return sn;
11319
11329
  }();
11320
11330
  Lt.AutoScroll = sn;
11321
- var qe = {};
11322
- Object.defineProperty(qe, "__esModule", {
11331
+ var Ue = {};
11332
+ Object.defineProperty(Ue, "__esModule", {
11323
11333
  value: !0
11324
11334
  });
11325
- qe.Elements = void 0;
11335
+ Ue.Elements = void 0;
11326
11336
  var ha = /*#__PURE__*/function () {
11327
11337
  function ha() {
11328
11338
  _classCallCheck(this, ha);
@@ -11370,17 +11380,17 @@ var ha = /*#__PURE__*/function () {
11370
11380
  }]);
11371
11381
  return ha;
11372
11382
  }();
11373
- qe.Elements = ha;
11374
- var Ue = {};
11375
- Object.defineProperty(Ue, "__esModule", {
11383
+ Ue.Elements = ha;
11384
+ var qe = {};
11385
+ Object.defineProperty(qe, "__esModule", {
11376
11386
  value: !0
11377
11387
  });
11378
- Ue.Cursor = void 0;
11379
- var pt = /*#__PURE__*/function () {
11380
- function pt() {
11381
- _classCallCheck(this, pt);
11388
+ qe.Cursor = void 0;
11389
+ var ft = /*#__PURE__*/function () {
11390
+ function ft() {
11391
+ _classCallCheck(this, ft);
11382
11392
  }
11383
- _createClass(pt, null, [{
11393
+ _createClass(ft, null, [{
11384
11394
  key: "setOffsetForGeneric",
11385
11395
  value: function setOffsetForGeneric(e, t) {
11386
11396
  var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
@@ -11388,7 +11398,7 @@ var pt = /*#__PURE__*/function () {
11388
11398
  for (var r = 0; r < e.childNodes.length; r += 1) {
11389
11399
  var o = e.childNodes[r];
11390
11400
  if (o.childNodes.length > 0) {
11391
- var a = pt.setOffsetForGeneric(o, t, i);
11401
+ var a = ft.setOffsetForGeneric(o, t, i);
11392
11402
  if (a === -1) return -1;
11393
11403
  i += a;
11394
11404
  } else if (o.textContent !== null) {
@@ -11416,8 +11426,8 @@ var pt = /*#__PURE__*/function () {
11416
11426
  value: function setOffsetForSafariGeneric(e, t) {
11417
11427
  var i = window.getSelection();
11418
11428
  if (i) {
11419
- var n = pt.getGenericElementCursorOffset(e, i, !0);
11420
- console.log(n), setTimeout(function () {}, 100), pt.setOffsetForGeneric(e, n + t);
11429
+ var n = ft.getGenericElementCursorOffset(e, i, !0);
11430
+ console.log(n), setTimeout(function () {}, 100), ft.setOffsetForGeneric(e, n + t);
11421
11431
  }
11422
11432
  }
11423
11433
  // set to automatically scroll to cursor (scroll does not work in Safari)
@@ -11455,17 +11465,17 @@ var pt = /*#__PURE__*/function () {
11455
11465
  return n;
11456
11466
  }
11457
11467
  }]);
11458
- return pt;
11468
+ return ft;
11459
11469
  }();
11460
- Ue.Cursor = pt;
11470
+ qe.Cursor = ft;
11461
11471
  Object.defineProperty(It, "__esModule", {
11462
11472
  value: !0
11463
11473
  });
11464
11474
  It.CommandUtils = void 0;
11465
11475
  var An = Lt,
11466
- fa = qe,
11467
- pa = nt,
11468
- kn = Ue,
11476
+ pa = Ue,
11477
+ fa = nt,
11478
+ kn = qe,
11469
11479
  In = ze;
11470
11480
  var K = /*#__PURE__*/function () {
11471
11481
  function K() {
@@ -11500,7 +11510,7 @@ var K = /*#__PURE__*/function () {
11500
11510
  }, {
11501
11511
  key: "setText",
11502
11512
  value: function setText(e, t, i, n) {
11503
- K.toggleCommandModeOff(e), fa.Elements.isPrimitiveElement(n) ? (n.value = i, e.isTargetInShadow || kn.Cursor.setOffsetForPrimitive(n, i.length, !0), pa.Browser.IS_SAFARI() && e.autoScroll && An.AutoScroll.scrollSafariPrimitiveToEnd(n)) : (n.textContent = i, e.isTargetInShadow || kn.Cursor.focusEndOfGeneric(n), setTimeout(function () {
11513
+ K.toggleCommandModeOff(e), pa.Elements.isPrimitiveElement(n) ? (n.value = i, e.isTargetInShadow || kn.Cursor.setOffsetForPrimitive(n, i.length, !0), fa.Browser.IS_SAFARI() && e.autoScroll && An.AutoScroll.scrollSafariPrimitiveToEnd(n)) : (n.textContent = i, e.isTargetInShadow || kn.Cursor.focusEndOfGeneric(n), setTimeout(function () {
11504
11514
  return An.AutoScroll.scrollGeneric(e, n);
11505
11515
  })), e.resetRecording(t);
11506
11516
  }
@@ -11543,8 +11553,8 @@ var K = /*#__PURE__*/function () {
11543
11553
  doNotProcessTranscription: !1
11544
11554
  };
11545
11555
  if (c.pause && h(c.pause, d, u)) return K.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
11546
- var f;
11547
- e.isPaused = !0, (f = e.onPauseTrigger) === null || f === void 0 || f.call(e, !0);
11556
+ var p;
11557
+ e.isPaused = !0, (p = e.onPauseTrigger) === null || p === void 0 || p.call(e, !0);
11548
11558
  }), {
11549
11559
  doNotProcessTranscription: !1
11550
11560
  };
@@ -11563,13 +11573,13 @@ var K = /*#__PURE__*/function () {
11563
11573
  return K;
11564
11574
  }();
11565
11575
  It.CommandUtils = K;
11566
- var pi = {};
11567
- Object.defineProperty(pi, "__esModule", {
11576
+ var fi = {};
11577
+ Object.defineProperty(fi, "__esModule", {
11568
11578
  value: !0
11569
11579
  });
11570
- pi.Highlight = void 0;
11571
- var ma = qe,
11572
- st = Ue;
11580
+ fi.Highlight = void 0;
11581
+ var ma = Ue,
11582
+ st = qe;
11573
11583
  var Kt = /*#__PURE__*/function () {
11574
11584
  function Kt() {
11575
11585
  _classCallCheck(this, Kt);
@@ -11619,14 +11629,14 @@ var Kt = /*#__PURE__*/function () {
11619
11629
  }]);
11620
11630
  return Kt;
11621
11631
  }();
11622
- pi.Highlight = Kt;
11632
+ fi.Highlight = Kt;
11623
11633
  var mi = {};
11624
11634
  Object.defineProperty(mi, "__esModule", {
11625
11635
  value: !0
11626
11636
  });
11627
11637
  mi.Padding = void 0;
11628
- var ga = qe,
11629
- Ln = Ue,
11638
+ var ga = Ue,
11639
+ Ln = qe,
11630
11640
  Ge = ze;
11631
11641
  var Yt = /*#__PURE__*/function () {
11632
11642
  function Yt() {
@@ -11692,14 +11702,14 @@ Object.defineProperty(kt, "__esModule", {
11692
11702
  });
11693
11703
  kt.Speech = void 0;
11694
11704
  var Rn = hi,
11695
- ba = fi,
11705
+ ba = pi,
11696
11706
  Nn = It,
11697
11707
  Dt = Lt,
11698
- ki = pi,
11699
- se = qe,
11708
+ ki = fi,
11709
+ se = Ue,
11700
11710
  Ii = mi,
11701
11711
  On = nt,
11702
- Pn = Ue,
11712
+ Pn = qe,
11703
11713
  Li = ze;
11704
11714
  var va = /*#__PURE__*/function () {
11705
11715
  function va() {
@@ -12247,7 +12257,7 @@ bi.Azure = Qt;
12247
12257
  Object.defineProperty(xs, "__esModule", {
12248
12258
  value: !0
12249
12259
  });
12250
- var qn = di,
12260
+ var Un = di,
12251
12261
  wa = It,
12252
12262
  ie = gi,
12253
12263
  Ma = bi;
@@ -12265,12 +12275,12 @@ var Ke = /*#__PURE__*/function () {
12265
12275
  }, {
12266
12276
  key: "startWebSpeech",
12267
12277
  value: function startWebSpeech(e) {
12268
- Ke.stop() || (ie.GlobalState.service = new qn.WebSpeech(), ie.GlobalState.service.start(e));
12278
+ Ke.stop() || (ie.GlobalState.service = new Un.WebSpeech(), ie.GlobalState.service.start(e));
12269
12279
  }
12270
12280
  }, {
12271
12281
  key: "isWebSpeechSupported",
12272
12282
  value: function isWebSpeechSupported() {
12273
- return !!qn.WebSpeech.getAPI();
12283
+ return !!Un.WebSpeech.getAPI();
12274
12284
  }
12275
12285
  }, {
12276
12286
  key: "startAzure",
@@ -12625,7 +12635,7 @@ var Si = /*#__PURE__*/function (_Tt4) {
12625
12635
  return _regeneratorRuntime().wrap(function _callee110$(_context110) {
12626
12636
  while (1) switch (_context110.prev = _context110.next) {
12627
12637
  case 0:
12628
- typeof e == "string" && (e = Se.processSubmitUserMessage(e));
12638
+ typeof e == "string" && (e = ce.processSubmitUserMessage(e));
12629
12639
  t = {
12630
12640
  text: e.text
12631
12641
  };
@@ -13002,7 +13012,7 @@ var mt = /*#__PURE__*/function () {
13002
13012
  button: new Ta(_d, t.recordAudio)
13003
13013
  };
13004
13014
  }
13005
- return ue.isEnabled(r, e.dragAndDrop) && ue.create(i, r, e.dragAndDrop), r;
13015
+ return he.isEnabled(r, e.dragAndDrop) && he.create(i, r, e.dragAndDrop), r;
13006
13016
  }
13007
13017
  // prettier-ignore
13008
13018
  }], [{
@@ -13023,9 +13033,9 @@ var mt = /*#__PURE__*/function () {
13023
13033
  d = _sa$a.id,
13024
13034
  u = _sa$a.svgString,
13025
13035
  h = _sa$a.dropupText,
13026
- f = new ft(n, c, l, d, u, h);
13036
+ p = new pt(n, c, l, d, u, h);
13027
13037
  r[a] = {
13028
- button: f,
13038
+ button: p,
13029
13039
  fileType: c
13030
13040
  };
13031
13041
  }
@@ -13052,7 +13062,7 @@ var on = /*#__PURE__*/function () {
13052
13062
  value: function createElements(e, t, i) {
13053
13063
  var n = document.createElement("div");
13054
13064
  n.id = "chat-view";
13055
- var r = new be(e, t, i);
13065
+ var r = new ve(e, t, i);
13056
13066
  t.websocket && B.createConnection(t, r);
13057
13067
  var o = new mt(e, r, t, n);
13058
13068
  return G.addElements(n, r.elementRef, o.elementRef), n;
@@ -13103,7 +13113,7 @@ var y = /*#__PURE__*/function (_So) {
13103
13113
  key: "onRender",
13104
13114
  value: function onRender() {
13105
13115
  var _this$_childElement;
13106
- (!this._activeService || this._activeService.demo) && (this._activeService = $o.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (wi.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), wi.applyDefaultStyleToComponent(this.style, this.chatStyle), Se.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? Bt.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof U) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], on.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof U && P.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, zt.onRender(this);
13116
+ ce.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = $o.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (wi.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), wi.applyDefaultStyleToComponent(this.style, this.chatStyle), ce.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? Bt.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof q) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], on.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof q && P.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, zt.onRender(this);
13107
13117
  }
13108
13118
  }, {
13109
13119
  key: "disconnectedCallback",
@@ -13113,8 +13123,8 @@ var y = /*#__PURE__*/function (_So) {
13113
13123
  }]);
13114
13124
  return y;
13115
13125
  }(So);
13126
+ _([E("object")], y.prototype, "connect", 2);
13116
13127
  _([E("object")], y.prototype, "directConnection", 2);
13117
- _([E("object")], y.prototype, "request", 2);
13118
13128
  _([E("object")], y.prototype, "webModel", 2);
13119
13129
  _([E("object")], y.prototype, "requestBodyLimits", 2);
13120
13130
  _([E("function")], y.prototype, "requestInterceptor", 2);