deep-chat-dev 9.0.9 → 9.0.11

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
@@ -365,19 +365,19 @@ function getLines(r) {
365
365
  var c = 0;
366
366
  for (; t < l;) {
367
367
  s && (e[t] === 10 && (c = ++t), s = !1);
368
- var u = -1;
369
- for (; t < l && u === -1; ++t) switch (e[t]) {
368
+ var d = -1;
369
+ for (; t < l && d === -1; ++t) switch (e[t]) {
370
370
  case 58:
371
371
  n === -1 && (n = t - c);
372
372
  break;
373
373
  case 13:
374
374
  s = !0;
375
375
  case 10:
376
- u = t;
376
+ d = t;
377
377
  break;
378
378
  }
379
- if (u === -1) break;
380
- r(e.subarray(c, u), n), c = t, n = -1;
379
+ if (d === -1) break;
380
+ r(e.subarray(c, d), n), c = t, n = -1;
381
381
  }
382
382
  c === l ? e = void 0 : c !== 0 && (e = e.subarray(c), t -= c);
383
383
  };
@@ -388,20 +388,20 @@ function getMessages(r, e, t) {
388
388
  return function (a, l) {
389
389
  if (a.length === 0) t == null || t(n), n = newMessage();else if (l > 0) {
390
390
  var c = s.decode(a.subarray(0, l)),
391
- u = l + (a[l + 1] === 32 ? 2 : 1),
392
- d = s.decode(a.subarray(u));
391
+ d = l + (a[l + 1] === 32 ? 2 : 1),
392
+ u = s.decode(a.subarray(d));
393
393
  switch (c) {
394
394
  case "data":
395
- n.data = n.data ? n.data + "\n" + d : d;
395
+ n.data = n.data ? n.data + "\n" + u : u;
396
396
  break;
397
397
  case "event":
398
- n.event = d;
398
+ n.event = u;
399
399
  break;
400
400
  case "id":
401
- r(n.id = d);
401
+ r(n.id = u);
402
402
  break;
403
403
  case "retry":
404
- var h = parseInt(d, 10);
404
+ var h = parseInt(u, 10);
405
405
  isNaN(h) || e(n.retry = h);
406
406
  break;
407
407
  }
@@ -437,8 +437,8 @@ function fetchEventSource(r, e) {
437
437
  a = e.onclose,
438
438
  l = e.onerror,
439
439
  c = e.openWhenHidden,
440
- u = e.fetch,
441
- d = __rest(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
440
+ d = e.fetch,
441
+ u = __rest(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
442
442
  return new Promise(function (h, f) {
443
443
  var p = Object.assign({}, n);
444
444
  p.accept || (p.accept = EventStreamContentType);
@@ -455,31 +455,31 @@ function fetchEventSource(r, e) {
455
455
  t == null || t.addEventListener("abort", function () {
456
456
  y(), h();
457
457
  });
458
- var S = u !== null && u !== void 0 ? u : window.fetch,
458
+ var S = d !== null && d !== void 0 ? d : window.fetch,
459
459
  E = s !== null && s !== void 0 ? s : defaultOnOpen;
460
460
  function x() {
461
461
  return _x3.apply(this, arguments);
462
462
  }
463
463
  function _x3() {
464
464
  _x3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
465
- var R, C, _;
465
+ var R, w, _;
466
466
  return _regeneratorRuntime().wrap(function _callee$(_context) {
467
467
  while (1) switch (_context.prev = _context.next) {
468
468
  case 0:
469
469
  b = new AbortController();
470
470
  _context.prev = 1;
471
471
  _context.next = 4;
472
- return S(r, Object.assign(Object.assign({}, d), {
472
+ return S(r, Object.assign(Object.assign({}, u), {
473
473
  headers: p,
474
474
  signal: b.signal
475
475
  }));
476
476
  case 4:
477
- C = _context.sent;
477
+ w = _context.sent;
478
478
  _context.next = 7;
479
- return E(C);
479
+ return E(w);
480
480
  case 7:
481
481
  _context.next = 9;
482
- return getBytes(C.body, getLines(getMessages(function (_) {
482
+ return getBytes(w.body, getLines(getMessages(function (_) {
483
483
  _ ? p[LastEventId] = _ : delete p[LastEventId];
484
484
  }, function (_) {
485
485
  g = _;
@@ -708,8 +708,8 @@ var Stream = /*#__PURE__*/function () {
708
708
  l,
709
709
  c,
710
710
  _e$streamHandlers,
711
- u,
712
711
  d,
712
+ u,
713
713
  h,
714
714
  f,
715
715
  _args6 = arguments;
@@ -729,14 +729,14 @@ var Stream = /*#__PURE__*/function () {
729
729
  l = _yield$RequestUtils$p.headers;
730
730
  c = _yield$RequestUtils$p.error;
731
731
  _e$streamHandlers = e.streamHandlers;
732
- u = _e$streamHandlers.onOpen;
733
- d = _e$streamHandlers.onClose;
732
+ d = _e$streamHandlers.onOpen;
733
+ u = _e$streamHandlers.onClose;
734
734
  h = _e$streamHandlers.abortStream;
735
735
  if (!c) {
736
736
  _context6.next = 14;
737
737
  break;
738
738
  }
739
- return _context6.abrupt("return", Stream.onInterceptorError(n, c, d));
739
+ return _context6.abrupt("return", Stream.onInterceptorError(n, c, u));
740
740
  case 14:
741
741
  if (!((b = e.requestSettings) != null && b.handler)) {
742
742
  _context6.next = 16;
@@ -766,7 +766,7 @@ var Stream = /*#__PURE__*/function () {
766
766
  _context5.next = 2;
767
767
  break;
768
768
  }
769
- return _context5.abrupt("return", (f = n.addNewStreamedMessage(), u()));
769
+ return _context5.abrupt("return", (f = n.addNewStreamedMessage(), d()));
770
770
  case 2:
771
771
  _context5.next = 4;
772
772
  return RequestUtils.processResponseByType(y);
@@ -791,10 +791,10 @@ var Stream = /*#__PURE__*/function () {
791
791
  }
792
792
  },
793
793
  onerror: function onerror(y) {
794
- throw d(), y;
794
+ throw u(), y;
795
795
  },
796
796
  onclose: function onclose() {
797
- n.finaliseStreamedMessage(), d();
797
+ n.finaliseStreamedMessage(), u();
798
798
  },
799
799
  signal: h.signal
800
800
  })["catch"](function (y) {
@@ -867,8 +867,8 @@ var CustomHandler = /*#__PURE__*/function () {
867
867
  case 0:
868
868
  s = !0;
869
869
  o = /*#__PURE__*/function () {
870
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(u) {
871
- var h, f, d;
870
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(d) {
871
+ var h, f, u;
872
872
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
873
873
  while (1) switch (_context7.prev = _context7.next) {
874
874
  case 0:
@@ -880,17 +880,17 @@ var CustomHandler = /*#__PURE__*/function () {
880
880
  case 2:
881
881
  s = !1;
882
882
  _context7.next = 5;
883
- return (f = (h = e.deepChat).responseInterceptor) == null ? void 0 : f.call(h, u);
883
+ return (f = (h = e.deepChat).responseInterceptor) == null ? void 0 : f.call(h, d);
884
884
  case 5:
885
885
  _context7.t0 = _context7.sent;
886
886
  if (_context7.t0) {
887
887
  _context7.next = 8;
888
888
  break;
889
889
  }
890
- _context7.t0 = u;
890
+ _context7.t0 = d;
891
891
  case 8:
892
- d = _context7.t0;
893
- !d || _typeof(d) != "object" || typeof d.error != "string" && typeof d.text != "string" ? (console.error(ErrorMessages.INVALID_RESPONSE(u, "server", !!e.deepChat.responseInterceptor, d)), n.addNewErrorMessage("service", "Error in server message"), e.completionsHandlers.onFinish()) : typeof d.error == "string" ? (console.error(d.error), n.addNewErrorMessage("service", d.error), e.completionsHandlers.onFinish()) : e.deepChat.stream && d.text ? Stream.simulate(n, e.streamHandlers, d.text) : (n.addNewMessage(d, !0, !0), e.completionsHandlers.onFinish());
892
+ u = _context7.t0;
893
+ !u || _typeof(u) != "object" || typeof u.error != "string" && typeof u.text != "string" ? (console.error(ErrorMessages.INVALID_RESPONSE(d, "server", !!e.deepChat.responseInterceptor, u)), n.addNewErrorMessage("service", "Error in server message"), e.completionsHandlers.onFinish()) : typeof u.error == "string" ? (console.error(u.error), n.addNewErrorMessage("service", u.error), e.completionsHandlers.onFinish()) : e.deepChat.stream && u.text ? Stream.simulate(n, e.streamHandlers, u.text) : (n.addNewMessage(u, !0, !0), e.completionsHandlers.onFinish());
894
894
  case 10:
895
895
  case "end":
896
896
  return _context7.stop();
@@ -928,16 +928,16 @@ var CustomHandler = /*#__PURE__*/function () {
928
928
  c = function c() {
929
929
  s && (n.finaliseStreamedMessage(), e.streamHandlers.onClose(), s = !1);
930
930
  },
931
- u = function u(p) {
931
+ d = function d(p) {
932
932
  s && (!p || _typeof(p) != "object" || typeof p.error != "string" && typeof p.text != "string" ? console.error(ErrorMessages.INVALID_RESPONSE(p, "server", !1)) : p.error ? (console.error(p.error), n.finaliseStreamedMessage(), e.streamHandlers.onClose(), n.addNewErrorMessage("service", p.error), s = !1) : p.text && a && n.updateStreamedMessage(p.text, a));
933
933
  };
934
934
  e.streamHandlers.abortStream.abort = function () {
935
935
  n.finaliseStreamedMessage(), e.streamHandlers.onClose(), s = !1;
936
936
  };
937
- var d = CustomHandler.generateOptionalSignals();
938
- (f = (h = e.requestSettings).handler) == null || f.call(h, t, _objectSpread(_objectSpread({}, d), {}, {
937
+ var u = CustomHandler.generateOptionalSignals();
938
+ (f = (h = e.requestSettings).handler) == null || f.call(h, t, _objectSpread(_objectSpread({}, u), {}, {
939
939
  onOpen: l,
940
- onResponse: u,
940
+ onResponse: d,
941
941
  onClose: c,
942
942
  stopClicked: e.streamHandlers.stopClicked
943
943
  }));
@@ -946,7 +946,7 @@ var CustomHandler = /*#__PURE__*/function () {
946
946
  }, {
947
947
  key: "websocket",
948
948
  value: function websocket(e, t) {
949
- var c, u;
949
+ var c, d;
950
950
  var n = {
951
951
  isOpen: !1,
952
952
  newUserMessage: {
@@ -961,7 +961,7 @@ var CustomHandler = /*#__PURE__*/function () {
961
961
  n.isOpen = !1;
962
962
  },
963
963
  a = /*#__PURE__*/function () {
964
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(d) {
964
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(u) {
965
965
  var f, p, h;
966
966
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
967
967
  while (1) switch (_context9.prev = _context9.next) {
@@ -973,17 +973,17 @@ var CustomHandler = /*#__PURE__*/function () {
973
973
  return _context9.abrupt("return");
974
974
  case 2:
975
975
  _context9.next = 4;
976
- return (p = (f = e.deepChat).responseInterceptor) == null ? void 0 : p.call(f, d);
976
+ return (p = (f = e.deepChat).responseInterceptor) == null ? void 0 : p.call(f, u);
977
977
  case 4:
978
978
  _context9.t0 = _context9.sent;
979
979
  if (_context9.t0) {
980
980
  _context9.next = 7;
981
981
  break;
982
982
  }
983
- _context9.t0 = d;
983
+ _context9.t0 = u;
984
984
  case 7:
985
985
  h = _context9.t0;
986
- !h || _typeof(h) != "object" || typeof h.error != "string" && typeof h.text != "string" ? (console.error(ErrorMessages.INVALID_RESPONSE(d, "server", !!e.deepChat.responseInterceptor, h)), t.addNewErrorMessage("service", "Error in server message")) : typeof h.error == "string" ? (console.error(h.error), t.isLastMessageError() || t.addNewErrorMessage("service", h.error)) : e.deepChat.stream ? Stream.simulate(t, e.streamHandlers, h.text) : t.addNewMessage(h, !0, !0);
986
+ !h || _typeof(h) != "object" || typeof h.error != "string" && typeof h.text != "string" ? (console.error(ErrorMessages.INVALID_RESPONSE(u, "server", !!e.deepChat.responseInterceptor, h)), t.addNewErrorMessage("service", "Error in server message")) : typeof h.error == "string" ? (console.error(h.error), t.isLastMessageError() || t.addNewErrorMessage("service", h.error)) : e.deepChat.stream ? Stream.simulate(t, e.streamHandlers, h.text) : t.addNewMessage(h, !0, !0);
987
987
  case 9:
988
988
  case "end":
989
989
  return _context9.stop();
@@ -995,7 +995,7 @@ var CustomHandler = /*#__PURE__*/function () {
995
995
  };
996
996
  }(),
997
997
  l = CustomHandler.generateOptionalSignals();
998
- (u = (c = e.requestSettings).handler) == null || u.call(c, void 0, _objectSpread(_objectSpread({}, l), {}, {
998
+ (d = (c = e.requestSettings).handler) == null || d.call(c, void 0, _objectSpread(_objectSpread({}, l), {}, {
999
999
  onOpen: s,
1000
1000
  onResponse: a,
1001
1001
  onClose: o,
@@ -1039,8 +1039,8 @@ var HTTPRequest = /*#__PURE__*/function () {
1039
1039
  a,
1040
1040
  l,
1041
1041
  c,
1042
- u,
1043
1042
  d,
1043
+ u,
1044
1044
  _args11 = arguments;
1045
1045
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1046
1046
  while (1) switch (_context11.prev = _context11.next) {
@@ -1057,12 +1057,12 @@ var HTTPRequest = /*#__PURE__*/function () {
1057
1057
  a = _yield$RequestUtils$p2.body;
1058
1058
  l = _yield$RequestUtils$p2.headers;
1059
1059
  c = _yield$RequestUtils$p2.error;
1060
- u = e.completionsHandlers.onFinish;
1060
+ d = e.completionsHandlers.onFinish;
1061
1061
  if (!c) {
1062
1062
  _context11.next = 11;
1063
1063
  break;
1064
1064
  }
1065
- return _context11.abrupt("return", HTTPRequest.onInterceptorError(n, c, u));
1065
+ return _context11.abrupt("return", HTTPRequest.onInterceptorError(n, c, d));
1066
1066
  case 11:
1067
1067
  if (!((f = e.requestSettings) != null && f.handler)) {
1068
1068
  _context11.next = 13;
@@ -1074,15 +1074,15 @@ var HTTPRequest = /*#__PURE__*/function () {
1074
1074
  _context11.next = 15;
1075
1075
  break;
1076
1076
  }
1077
- return _context11.abrupt("return", Demo.request(n, u, e.deepChat.responseInterceptor));
1077
+ return _context11.abrupt("return", Demo.request(n, d, e.deepChat.responseInterceptor));
1078
1078
  case 15:
1079
- d = !0;
1079
+ u = !0;
1080
1080
  fetch(((b = e.requestSettings) == null ? void 0 : b.url) || e.url || "", {
1081
1081
  method: ((m = e.requestSettings) == null ? void 0 : m.method) || "POST",
1082
1082
  headers: l,
1083
1083
  body: s ? JSON.stringify(a) : a
1084
1084
  }).then(function (g) {
1085
- return d = !!g.ok, g;
1085
+ return u = !!g.ok, g;
1086
1086
  }).then(function (g) {
1087
1087
  return RequestUtils.processResponseByType(g);
1088
1088
  }).then( /*#__PURE__*/function () {
@@ -1112,7 +1112,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1112
1112
  return e.extractResultData(v);
1113
1113
  case 10:
1114
1114
  y = _context10.sent;
1115
- if (d) {
1115
+ if (u) {
1116
1116
  _context10.next = 13;
1117
1117
  break;
1118
1118
  }
@@ -1124,7 +1124,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1124
1124
  }
1125
1125
  throw Error(ErrorMessages.INVALID_RESPONSE(g, "response", !!e.deepChat.responseInterceptor, v));
1126
1126
  case 15:
1127
- y.pollingInAnotherRequest || (e.deepChat.stream && y.text ? Stream.simulate(n, e.streamHandlers, y.text) : (n.addNewMessage(y, !0, !0), u()));
1127
+ y.pollingInAnotherRequest || (e.deepChat.stream && y.text ? Stream.simulate(n, e.streamHandlers, y.text) : (n.addNewMessage(y, !0, !0), d()));
1128
1128
  case 16:
1129
1129
  case "end":
1130
1130
  return _context10.stop();
@@ -1135,7 +1135,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1135
1135
  return _ref4.apply(this, arguments);
1136
1136
  };
1137
1137
  }())["catch"](function (g) {
1138
- RequestUtils.displayError(n, g), u();
1138
+ RequestUtils.displayError(n, g), d();
1139
1139
  });
1140
1140
  case 17:
1141
1141
  case "end":
@@ -1157,7 +1157,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1157
1157
  return a.json();
1158
1158
  }).then( /*#__PURE__*/function () {
1159
1159
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(a) {
1160
- var c, u, l;
1160
+ var c, d, l;
1161
1161
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1162
1162
  while (1) switch (_context12.prev = _context12.next) {
1163
1163
  case 0:
@@ -1169,7 +1169,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1169
1169
  case 2:
1170
1170
  _context12.t0 = e;
1171
1171
  _context12.next = 5;
1172
- return (u = (c = e.deepChat).responseInterceptor) == null ? void 0 : u.call(c, a);
1172
+ return (d = (c = e.deepChat).responseInterceptor) == null ? void 0 : d.call(c, a);
1173
1173
  case 5:
1174
1174
  _context12.t1 = _context12.sent;
1175
1175
  if (_context12.t1) {
@@ -1213,8 +1213,8 @@ var HTTPRequest = /*#__PURE__*/function () {
1213
1213
  a,
1214
1214
  l,
1215
1215
  c,
1216
- u,
1217
1216
  d,
1217
+ u,
1218
1218
  h,
1219
1219
  f,
1220
1220
  _args13 = arguments;
@@ -1239,12 +1239,12 @@ var HTTPRequest = /*#__PURE__*/function () {
1239
1239
  }
1240
1240
  return _context13.abrupt("return", HTTPRequest.onInterceptorError(n, c));
1241
1241
  case 10:
1242
- u = ((b = e.requestSettings) == null ? void 0 : b.url) || e.url || "", d = ((m = e.requestSettings) == null ? void 0 : m.method) || "POST", h = s ? JSON.stringify(a) : a, f = {
1243
- method: d,
1242
+ d = ((b = e.requestSettings) == null ? void 0 : b.url) || e.url || "", u = ((m = e.requestSettings) == null ? void 0 : m.method) || "POST", h = s ? JSON.stringify(a) : a, f = {
1243
+ method: u,
1244
1244
  body: h,
1245
1245
  headers: l
1246
1246
  };
1247
- HTTPRequest.executePollRequest(e, u, f, n);
1247
+ HTTPRequest.executePollRequest(e, d, f, n);
1248
1248
  case 12:
1249
1249
  case "end":
1250
1250
  return _context13.stop();
@@ -1264,18 +1264,18 @@ var HTTPRequest = /*#__PURE__*/function () {
1264
1264
  // prettier-ignore
1265
1265
  }, {
1266
1266
  key: "verifyKey",
1267
- value: function verifyKey(e, t, n, s, o, a, l, c, u) {
1267
+ value: function verifyKey(e, t, n, s, o, a, l, c, d) {
1268
1268
  if (e === "") return a(ErrorMessages.INVALID_KEY);
1269
1269
  l(), fetch(t, {
1270
1270
  method: s,
1271
1271
  headers: n,
1272
- body: u || null
1273
- }).then(function (d) {
1274
- return RequestUtils.processResponseByType(d);
1275
- }).then(function (d) {
1276
- c(d, e, o, a);
1277
- })["catch"](function (d) {
1278
- a(ErrorMessages.CONNECTION_FAILED), console.error(d);
1272
+ body: d || null
1273
+ }).then(function (u) {
1274
+ return RequestUtils.processResponseByType(u);
1275
+ }).then(function (u) {
1276
+ c(u, e, o, a);
1277
+ })["catch"](function (u) {
1278
+ a(ErrorMessages.CONNECTION_FAILED), console.error(u);
1279
1279
  });
1280
1280
  }
1281
1281
  }]);
@@ -1371,7 +1371,7 @@ var Websocket = /*#__PURE__*/function () {
1371
1371
  value: function assignListeners(e, t, n) {
1372
1372
  t.onmessage = /*#__PURE__*/function () {
1373
1373
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
1374
- var o, a, l, c, u;
1374
+ var o, a, l, c, d;
1375
1375
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1376
1376
  while (1) switch (_context14.prev = _context14.next) {
1377
1377
  case 0:
@@ -1395,14 +1395,14 @@ var Websocket = /*#__PURE__*/function () {
1395
1395
  _context14.next = 11;
1396
1396
  return e.extractResultData(c);
1397
1397
  case 11:
1398
- u = _context14.sent;
1399
- if (!(!u || _typeof(u) != "object")) {
1398
+ d = _context14.sent;
1399
+ if (!(!d || _typeof(d) != "object")) {
1400
1400
  _context14.next = 14;
1401
1401
  break;
1402
1402
  }
1403
1403
  throw Error(ErrorMessages.INVALID_RESPONSE(l, "server", !!e.deepChat.responseInterceptor, c));
1404
1404
  case 14:
1405
- e.deepChat.stream && u.text ? Stream.simulate(n, e.streamHandlers, u.text) : n.addNewMessage(u, !0, !0);
1405
+ e.deepChat.stream && d.text ? Stream.simulate(n, e.streamHandlers, d.text) : n.addNewMessage(d, !0, !0);
1406
1406
  _context14.next = 20;
1407
1407
  break;
1408
1408
  case 17:
@@ -1427,14 +1427,14 @@ var Websocket = /*#__PURE__*/function () {
1427
1427
  value: function () {
1428
1428
  var _sendWebsocket = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(e, t, n) {
1429
1429
  var s,
1430
- d,
1430
+ u,
1431
1431
  h,
1432
1432
  o,
1433
1433
  a,
1434
1434
  _yield$RequestUtils$p4,
1435
1435
  l,
1436
1436
  c,
1437
- u,
1437
+ d,
1438
1438
  _args15 = arguments;
1439
1439
  return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1440
1440
  while (1) switch (_context15.prev = _context15.next) {
@@ -1449,7 +1449,7 @@ var Websocket = /*#__PURE__*/function () {
1449
1449
  case 4:
1450
1450
  a = {
1451
1451
  body: t,
1452
- headers: (d = e.requestSettings) == null ? void 0 : d.headers
1452
+ headers: (u = e.requestSettings) == null ? void 0 : u.headers
1453
1453
  };
1454
1454
  _context15.next = 7;
1455
1455
  return RequestUtils.processRequestInterceptor(e.deepChat, a);
@@ -1469,14 +1469,14 @@ var Websocket = /*#__PURE__*/function () {
1469
1469
  }
1470
1470
  return _context15.abrupt("return", o.newUserMessage.listener(l));
1471
1471
  case 14:
1472
- u = s ? JSON.stringify(l) : l;
1472
+ d = s ? JSON.stringify(l) : l;
1473
1473
  if (!(((h = e.requestSettings) == null ? void 0 : h.url) === Demo.URL)) {
1474
1474
  _context15.next = 17;
1475
1475
  break;
1476
1476
  }
1477
1477
  return _context15.abrupt("return", Demo.request(n, e.completionsHandlers.onFinish, e.deepChat.responseInterceptor));
1478
1478
  case 17:
1479
- o.readyState === void 0 || o.readyState !== o.OPEN ? (console.error("Connection is not open"), n.isLastMessageError() || n.addNewErrorMessage("service", "Connection error")) : o.send(JSON.stringify(u));
1479
+ o.readyState === void 0 || o.readyState !== o.OPEN ? (console.error("Connection is not open"), n.isLastMessageError() || n.addNewErrorMessage("service", "Connection error")) : o.send(JSON.stringify(d));
1480
1480
  case 18:
1481
1481
  case "end":
1482
1482
  return _context15.stop();
@@ -1576,14 +1576,14 @@ rules.fence = function (r, e, t, n, s) {
1576
1576
  a = "",
1577
1577
  l = t.langPrefix,
1578
1578
  c = "",
1579
- u,
1580
1579
  d,
1580
+ u,
1581
1581
  h;
1582
1582
  if (o.params) {
1583
- if (u = o.params.split(/\s+/g), d = u.join(" "), has(s.rules.fence_custom, u[0])) return s.rules.fence_custom[u[0]](r, e, t, n, s);
1584
- c = escapeHtml(replaceEntities(unescapeMd(d))), a = ' class="' + l + c + '"';
1583
+ if (d = o.params.split(/\s+/g), u = d.join(" "), has(s.rules.fence_custom, d[0])) return s.rules.fence_custom[d[0]](r, e, t, n, s);
1584
+ c = escapeHtml(replaceEntities(unescapeMd(u))), a = ' class="' + l + c + '"';
1585
1585
  }
1586
- return t.highlight ? h = t.highlight.apply(t.highlight, [o.content].concat(u)) || escapeHtml(o.content) : h = escapeHtml(o.content), "<pre><code" + a + ">" + h + "</code></pre>" + getBreak(r, e);
1586
+ return t.highlight ? h = t.highlight.apply(t.highlight, [o.content].concat(d)) || escapeHtml(o.content) : h = escapeHtml(o.content), "<pre><code" + a + ">" + h + "</code></pre>" + getBreak(r, e);
1587
1587
  };
1588
1588
  rules.fence_custom = {};
1589
1589
  rules.heading_open = function (r, e) {
@@ -1916,10 +1916,10 @@ function parseLinkLabel(r, e) {
1916
1916
  return n ? (o = r.pos, r.labelUnmatchedScopes = 0) : r.labelUnmatchedScopes = t - 1, r.pos = l, r.isInLabel = c, o;
1917
1917
  }
1918
1918
  function parseAbbr(r, e, t, n) {
1919
- var s, o, a, l, c, u;
1919
+ var s, o, a, l, c, d;
1920
1920
  if (r.charCodeAt(0) !== 42 || r.charCodeAt(1) !== 91 || r.indexOf("]:") === -1 || (s = new StateInline(r, e, t, n, []), o = parseLinkLabel(s, 1), o < 0 || r.charCodeAt(o + 1) !== 58)) return -1;
1921
1921
  for (l = s.posMax, a = o + 2; a < l && s.src.charCodeAt(a) !== 10; a++);
1922
- return c = r.slice(2, o), u = r.slice(o + 2, a).trim(), u.length === 0 ? -1 : (n.abbreviations || (n.abbreviations = {}), _typeof(n.abbreviations[":" + c]) > "u" && (n.abbreviations[":" + c] = u), a);
1922
+ return c = r.slice(2, o), d = r.slice(o + 2, a).trim(), d.length === 0 ? -1 : (n.abbreviations || (n.abbreviations = {}), _typeof(n.abbreviations[":" + c]) > "u" && (n.abbreviations[":" + c] = d), a);
1923
1923
  }
1924
1924
  function abbr(r) {
1925
1925
  var e = r.tokens,
@@ -1989,15 +1989,15 @@ function normalizeReference(r) {
1989
1989
  return r.trim().replace(/\s+/g, " ").toUpperCase();
1990
1990
  }
1991
1991
  function parseReference(r, e, t, n) {
1992
- var s, o, a, l, c, u, d, h, f;
1992
+ var s, o, a, l, c, d, u, h, f;
1993
1993
  if (r.charCodeAt(0) !== 91 || r.indexOf("]:") === -1 || (s = new StateInline(r, e, t, n, []), o = parseLinkLabel(s, 0), o < 0 || r.charCodeAt(o + 1) !== 58)) return -1;
1994
1994
  for (l = s.posMax, a = o + 2; a < l && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
1995
1995
  if (!parseLinkDestination(s, a)) return -1;
1996
- for (d = s.linkContent, a = s.pos, u = a, a = a + 1; a < l && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
1997
- for (a < l && u !== a && parseLinkTitle(s, a) ? (h = s.linkContent, a = s.pos) : (h = "", a = u); a < l && s.src.charCodeAt(a) === 32;) a++;
1996
+ for (u = s.linkContent, a = s.pos, d = a, a = a + 1; a < l && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
1997
+ for (a < l && d !== a && parseLinkTitle(s, a) ? (h = s.linkContent, a = s.pos) : (h = "", a = d); a < l && s.src.charCodeAt(a) === 32;) a++;
1998
1998
  return a < l && s.src.charCodeAt(a) !== 10 ? -1 : (f = normalizeReference(r.slice(1, o)), _typeof(n.references[f]) > "u" && (n.references[f] = {
1999
1999
  title: h,
2000
- href: d
2000
+ href: u
2001
2001
  }), a);
2002
2002
  }
2003
2003
  function references(r) {
@@ -2029,48 +2029,48 @@ function footnote_block(r) {
2029
2029
  a,
2030
2030
  l,
2031
2031
  c,
2032
- u,
2033
- d = 0,
2032
+ d,
2033
+ u = 0,
2034
2034
  h = !1,
2035
2035
  f = {};
2036
2036
  if (r.env.footnotes && (r.tokens = r.tokens.filter(function (p) {
2037
- return p.type === "footnote_reference_open" ? (h = !0, c = [], u = p.label, !1) : p.type === "footnote_reference_close" ? (h = !1, f[":" + u] = c, !1) : (h && c.push(p), !h);
2037
+ return p.type === "footnote_reference_open" ? (h = !0, c = [], d = p.label, !1) : p.type === "footnote_reference_close" ? (h = !1, f[":" + d] = c, !1) : (h && c.push(p), !h);
2038
2038
  }), !!r.env.footnotes.list)) {
2039
2039
  for (a = r.env.footnotes.list, r.tokens.push({
2040
2040
  type: "footnote_block_open",
2041
- level: d++
2041
+ level: u++
2042
2042
  }), e = 0, t = a.length; e < t; e++) {
2043
2043
  for (r.tokens.push({
2044
2044
  type: "footnote_open",
2045
2045
  id: e,
2046
- level: d++
2046
+ level: u++
2047
2047
  }), a[e].tokens ? (l = [], l.push({
2048
2048
  type: "paragraph_open",
2049
2049
  tight: !1,
2050
- level: d++
2050
+ level: u++
2051
2051
  }), l.push({
2052
2052
  type: "inline",
2053
2053
  content: "",
2054
- level: d,
2054
+ level: u,
2055
2055
  children: a[e].tokens
2056
2056
  }), l.push({
2057
2057
  type: "paragraph_close",
2058
2058
  tight: !1,
2059
- level: --d
2059
+ level: --u
2060
2060
  })) : a[e].label && (l = f[":" + a[e].label]), r.tokens = r.tokens.concat(l), r.tokens[r.tokens.length - 1].type === "paragraph_close" ? o = r.tokens.pop() : o = null, s = a[e].count > 0 ? a[e].count : 1, n = 0; n < s; n++) r.tokens.push({
2061
2061
  type: "footnote_anchor",
2062
2062
  id: e,
2063
2063
  subId: n,
2064
- level: d
2064
+ level: u
2065
2065
  });
2066
2066
  o && r.tokens.push(o), r.tokens.push({
2067
2067
  type: "footnote_close",
2068
- level: --d
2068
+ level: --u
2069
2069
  });
2070
2070
  }
2071
2071
  r.tokens.push({
2072
2072
  type: "footnote_block_close",
2073
- level: --d
2073
+ level: --u
2074
2074
  });
2075
2075
  }
2076
2076
  }
@@ -2087,8 +2087,8 @@ function abbr2(r) {
2087
2087
  a,
2088
2088
  l,
2089
2089
  c,
2090
- u,
2091
2090
  d,
2091
+ u,
2092
2092
  h,
2093
2093
  f,
2094
2094
  p = r.tokens;
@@ -2097,28 +2097,28 @@ function abbr2(r) {
2097
2097
  return b.substr(1);
2098
2098
  }).sort(function (b, m) {
2099
2099
  return m.length - b.length;
2100
- }).map(regEscape).join("|") + ")($|[" + PUNCT_CHARS.split("").map(regEscape).join("") + "])", r.env.abbrRegExp = new RegExp(f, "g")), d = r.env.abbrRegExp, t = 0, n = p.length; t < n; t++) if (p[t].type === "inline") {
2100
+ }).map(regEscape).join("|") + ")($|[" + PUNCT_CHARS.split("").map(regEscape).join("") + "])", r.env.abbrRegExp = new RegExp(f, "g")), u = r.env.abbrRegExp, t = 0, n = p.length; t < n; t++) if (p[t].type === "inline") {
2101
2101
  for (s = p[t].children, e = s.length - 1; e >= 0; e--) if (o = s[e], o.type === "text") {
2102
- for (c = 0, a = o.content, d.lastIndex = 0, u = o.level, l = []; h = d.exec(a);) d.lastIndex > c && l.push({
2102
+ for (c = 0, a = o.content, u.lastIndex = 0, d = o.level, l = []; h = u.exec(a);) u.lastIndex > c && l.push({
2103
2103
  type: "text",
2104
2104
  content: a.slice(c, h.index + h[1].length),
2105
- level: u
2105
+ level: d
2106
2106
  }), l.push({
2107
2107
  type: "abbr_open",
2108
2108
  title: r.env.abbreviations[":" + h[2]],
2109
- level: u++
2109
+ level: d++
2110
2110
  }), l.push({
2111
2111
  type: "text",
2112
2112
  content: h[2],
2113
- level: u
2113
+ level: d
2114
2114
  }), l.push({
2115
2115
  type: "abbr_close",
2116
- level: --u
2117
- }), c = d.lastIndex - h[3].length;
2116
+ level: --d
2117
+ }), c = u.lastIndex - h[3].length;
2118
2118
  l.length && (c < a.length && l.push({
2119
2119
  type: "text",
2120
2120
  content: a.slice(c),
2121
- level: u
2121
+ level: d
2122
2122
  }), p[t].children = s = [].concat(s.slice(0, e), l, s.slice(e + 1)));
2123
2123
  }
2124
2124
  }
@@ -2154,20 +2154,20 @@ function replaceAt(r, e, t) {
2154
2154
  return r.substr(0, e) + t + r.substr(e + 1);
2155
2155
  }
2156
2156
  function smartquotes(r) {
2157
- var e, t, n, s, o, a, l, c, u, d, h, f, p, b, m, g, v;
2157
+ var e, t, n, s, o, a, l, c, d, u, h, f, p, b, m, g, v;
2158
2158
  if (r.options.typographer) {
2159
2159
  for (v = [], m = r.tokens.length - 1; m >= 0; m--) if (r.tokens[m].type === "inline") {
2160
2160
  for (g = r.tokens[m].children, v.length = 0, e = 0; e < g.length; e++) if (t = g[e], !(t.type !== "text" || QUOTE_TEST_RE.test(t.text))) {
2161
2161
  for (l = g[e].level, p = v.length - 1; p >= 0 && !(v[p].level <= l); p--);
2162
2162
  v.length = p + 1, n = t.content, o = 0, a = n.length;
2163
2163
  e: for (; o < a && (QUOTE_RE.lastIndex = o, s = QUOTE_RE.exec(n), !!s);) {
2164
- if (c = !isLetter(n, s.index - 1), o = s.index + 1, b = s[0] === "'", u = !isLetter(n, o), !u && !c) {
2164
+ if (c = !isLetter(n, s.index - 1), o = s.index + 1, b = s[0] === "'", d = !isLetter(n, o), !d && !c) {
2165
2165
  b && (t.content = replaceAt(t.content, s.index, APOSTROPHE));
2166
2166
  continue;
2167
2167
  }
2168
- if (h = !u, f = !c, f) {
2169
- for (p = v.length - 1; p >= 0 && (d = v[p], !(v[p].level < l)); p--) if (d.single === b && v[p].level === l) {
2170
- d = v[p], b ? (g[d.token].content = replaceAt(g[d.token].content, d.pos, r.options.quotes[2]), t.content = replaceAt(t.content, s.index, r.options.quotes[3])) : (g[d.token].content = replaceAt(g[d.token].content, d.pos, r.options.quotes[0]), t.content = replaceAt(t.content, s.index, r.options.quotes[1])), v.length = p;
2168
+ if (h = !d, f = !c, f) {
2169
+ for (p = v.length - 1; p >= 0 && (u = v[p], !(v[p].level < l)); p--) if (u.single === b && v[p].level === l) {
2170
+ u = v[p], b ? (g[u.token].content = replaceAt(g[u.token].content, u.pos, r.options.quotes[2]), t.content = replaceAt(t.content, s.index, r.options.quotes[3])) : (g[u.token].content = replaceAt(g[u.token].content, u.pos, r.options.quotes[0]), t.content = replaceAt(t.content, s.index, r.options.quotes[1])), v.length = p;
2171
2171
  continue e;
2172
2172
  }
2173
2173
  }
@@ -2192,13 +2192,13 @@ Core.prototype.process = function (r) {
2192
2192
  for (n = this.ruler.getRules(""), e = 0, t = n.length; e < t; e++) n[e](r);
2193
2193
  };
2194
2194
  function StateBlock(r, e, t, n, s) {
2195
- var o, a, l, c, u, d, h;
2196
- for (this.src = r, this.parser = e, this.options = t, this.env = n, this.tokens = s, this.bMarks = [], this.eMarks = [], this.tShift = [], this.blkIndent = 0, this.line = 0, this.lineMax = 0, this.tight = !1, this.parentType = "root", this.ddIndent = -1, this.level = 0, this.result = "", a = this.src, d = 0, h = !1, l = c = d = 0, u = a.length; c < u; c++) {
2195
+ var o, a, l, c, d, u, h;
2196
+ for (this.src = r, this.parser = e, this.options = t, this.env = n, this.tokens = s, this.bMarks = [], this.eMarks = [], this.tShift = [], this.blkIndent = 0, this.line = 0, this.lineMax = 0, this.tight = !1, this.parentType = "root", this.ddIndent = -1, this.level = 0, this.result = "", a = this.src, u = 0, h = !1, l = c = u = 0, d = a.length; c < d; c++) {
2197
2197
  if (o = a.charCodeAt(c), !h) if (o === 32) {
2198
- d++;
2198
+ u++;
2199
2199
  continue;
2200
2200
  } else h = !0;
2201
- (o === 10 || c === u - 1) && (o !== 10 && c++, this.bMarks.push(l), this.eMarks.push(c), this.tShift.push(d), h = !1, d = 0, l = c + 1);
2201
+ (o === 10 || c === d - 1) && (o !== 10 && c++, this.bMarks.push(l), this.eMarks.push(c), this.tShift.push(u), h = !1, u = 0, l = c + 1);
2202
2202
  }
2203
2203
  this.bMarks.push(a.length), this.eMarks.push(a.length), this.tShift.push(0), this.lineMax = this.bMarks.length - 1;
2204
2204
  }
@@ -2227,11 +2227,11 @@ StateBlock.prototype.getLines = function (e, t, n, s) {
2227
2227
  a,
2228
2228
  l,
2229
2229
  c,
2230
- u,
2231
- d = e;
2230
+ d,
2231
+ u = e;
2232
2232
  if (e >= t) return "";
2233
- if (d + 1 === t) return a = this.bMarks[d] + Math.min(this.tShift[d], n), l = s ? this.eMarks[d] + 1 : this.eMarks[d], this.src.slice(a, l);
2234
- for (c = new Array(t - e), o = 0; d < t; d++, o++) u = this.tShift[d], u > n && (u = n), u < 0 && (u = 0), a = this.bMarks[d] + u, d + 1 < t || s ? l = this.eMarks[d] + 1 : l = this.eMarks[d], c[o] = this.src.slice(a, l);
2233
+ if (u + 1 === t) return a = this.bMarks[u] + Math.min(this.tShift[u], n), l = s ? this.eMarks[u] + 1 : this.eMarks[u], this.src.slice(a, l);
2234
+ for (c = new Array(t - e), o = 0; u < t; u++, o++) d = this.tShift[u], d > n && (d = n), d < 0 && (d = 0), a = this.bMarks[u] + d, u + 1 < t || s ? l = this.eMarks[u] + 1 : l = this.eMarks[u], c[o] = this.src.slice(a, l);
2235
2235
  return c.join("");
2236
2236
  };
2237
2237
  function code(r, e, t) {
@@ -2262,16 +2262,16 @@ function fences(r, e, t, n) {
2262
2262
  a,
2263
2263
  l,
2264
2264
  c,
2265
- u = !1,
2266
- d = r.bMarks[e] + r.tShift[e],
2265
+ d = !1,
2266
+ u = r.bMarks[e] + r.tShift[e],
2267
2267
  h = r.eMarks[e];
2268
- if (d + 3 > h || (s = r.src.charCodeAt(d), s !== 126 && s !== 96) || (c = d, d = r.skipChars(d, s), o = d - c, o < 3) || (a = r.src.slice(d, h).trim(), a.indexOf("`") >= 0)) return !1;
2268
+ if (u + 3 > h || (s = r.src.charCodeAt(u), s !== 126 && s !== 96) || (c = u, u = r.skipChars(u, s), o = u - c, o < 3) || (a = r.src.slice(u, h).trim(), a.indexOf("`") >= 0)) return !1;
2269
2269
  if (n) return !0;
2270
- for (l = e; l++, !(l >= t || (d = c = r.bMarks[l] + r.tShift[l], h = r.eMarks[l], d < h && r.tShift[l] < r.blkIndent));) if (r.src.charCodeAt(d) === s && !(r.tShift[l] - r.blkIndent >= 4) && (d = r.skipChars(d, s), !(d - c < o) && (d = r.skipSpaces(d), !(d < h)))) {
2271
- u = !0;
2270
+ for (l = e; l++, !(l >= t || (u = c = r.bMarks[l] + r.tShift[l], h = r.eMarks[l], u < h && r.tShift[l] < r.blkIndent));) if (r.src.charCodeAt(u) === s && !(r.tShift[l] - r.blkIndent >= 4) && (u = r.skipChars(u, s), !(u - c < o) && (u = r.skipSpaces(u), !(u < h)))) {
2271
+ d = !0;
2272
2272
  break;
2273
2273
  }
2274
- return o = r.tShift[e], r.line = l + (u ? 1 : 0), r.tokens.push({
2274
+ return o = r.tShift[e], r.line = l + (d ? 1 : 0), r.tokens.push({
2275
2275
  type: "fence",
2276
2276
  params: a,
2277
2277
  content: r.getLines(e + 1, l, o, !0),
@@ -2285,8 +2285,8 @@ function blockquote(r, e, t, n) {
2285
2285
  a,
2286
2286
  l,
2287
2287
  c,
2288
- u,
2289
2288
  d,
2289
+ u,
2290
2290
  h,
2291
2291
  f,
2292
2292
  p,
@@ -2308,14 +2308,14 @@ function blockquote(r, e, t, n) {
2308
2308
  if (b) break;
2309
2309
  l.push(r.bMarks[s]), a.push(r.tShift[s]), r.tShift[s] = -1337;
2310
2310
  }
2311
- for (u = r.parentType, r.parentType = "blockquote", r.tokens.push({
2311
+ for (d = r.parentType, r.parentType = "blockquote", r.tokens.push({
2312
2312
  type: "blockquote_open",
2313
- lines: d = [e, 0],
2313
+ lines: u = [e, 0],
2314
2314
  level: r.level++
2315
2315
  }), r.parser.tokenize(r, e, s), r.tokens.push({
2316
2316
  type: "blockquote_close",
2317
2317
  level: --r.level
2318
- }), r.parentType = u, d[1] = r.line, f = 0; f < a.length; f++) r.bMarks[f + e] = l[f], r.tShift[f + e] = a[f];
2318
+ }), r.parentType = d, u[1] = r.line, f = 0; f < a.length; f++) r.bMarks[f + e] = l[f], r.tShift[f + e] = a[f];
2319
2319
  return r.blkIndent = c, !0;
2320
2320
  }
2321
2321
  function hr(r, e, t, n) {
@@ -2365,8 +2365,8 @@ function list(r, e, t, n) {
2365
2365
  a,
2366
2366
  l,
2367
2367
  c,
2368
- u,
2369
2368
  d,
2369
+ u,
2370
2370
  h,
2371
2371
  f,
2372
2372
  p,
@@ -2379,14 +2379,14 @@ function list(r, e, t, n) {
2379
2379
  E,
2380
2380
  x,
2381
2381
  R = !0,
2382
- C,
2382
+ w,
2383
2383
  _,
2384
2384
  H,
2385
2385
  F;
2386
2386
  if ((h = skipOrderedListMarker(r, e)) >= 0) g = !0;else if ((h = skipBulletListMarker(r, e)) >= 0) g = !1;else return !1;
2387
2387
  if (r.level >= r.options.maxNesting) return !1;
2388
2388
  if (m = r.src.charCodeAt(h - 1), n) return !0;
2389
- for (y = r.tokens.length, g ? (d = r.bMarks[e] + r.tShift[e], b = Number(r.src.substr(d, h - d - 1)), r.tokens.push({
2389
+ for (y = r.tokens.length, g ? (u = r.bMarks[e] + r.tShift[e], b = Number(r.src.substr(u, h - u - 1)), r.tokens.push({
2390
2390
  type: "ordered_list_open",
2391
2391
  order: b,
2392
2392
  lines: E = [e, 0],
@@ -2395,15 +2395,15 @@ function list(r, e, t, n) {
2395
2395
  type: "bullet_list_open",
2396
2396
  lines: E = [e, 0],
2397
2397
  level: r.level++
2398
- }), s = e, S = !1, C = r.parser.ruler.getRules("list"); s < t && (v = r.skipSpaces(h), f = r.eMarks[s], v >= f ? p = 1 : p = v - h, p > 4 && (p = 1), p < 1 && (p = 1), o = h - r.bMarks[s] + p, r.tokens.push({
2398
+ }), s = e, S = !1, w = r.parser.ruler.getRules("list"); s < t && (v = r.skipSpaces(h), f = r.eMarks[s], v >= f ? p = 1 : p = v - h, p > 4 && (p = 1), p < 1 && (p = 1), o = h - r.bMarks[s] + p, r.tokens.push({
2399
2399
  type: "list_item_open",
2400
2400
  lines: x = [e, 0],
2401
2401
  level: r.level++
2402
- }), l = r.blkIndent, c = r.tight, a = r.tShift[e], u = r.parentType, r.tShift[e] = v - r.bMarks[e], r.blkIndent = o, r.tight = !0, r.parentType = "list", r.parser.tokenize(r, e, t, !0), (!r.tight || S) && (R = !1), S = r.line - e > 1 && r.isEmpty(r.line - 1), r.blkIndent = l, r.tShift[e] = a, r.tight = c, r.parentType = u, r.tokens.push({
2402
+ }), l = r.blkIndent, c = r.tight, a = r.tShift[e], d = r.parentType, r.tShift[e] = v - r.bMarks[e], r.blkIndent = o, r.tight = !0, r.parentType = "list", r.parser.tokenize(r, e, t, !0), (!r.tight || S) && (R = !1), S = r.line - e > 1 && r.isEmpty(r.line - 1), r.blkIndent = l, r.tShift[e] = a, r.tight = c, r.parentType = d, r.tokens.push({
2403
2403
  type: "list_item_close",
2404
2404
  level: --r.level
2405
2405
  }), s = e = r.line, x[1] = s, v = r.bMarks[e], !(s >= t || r.isEmpty(s) || r.tShift[s] < r.blkIndent));) {
2406
- for (F = !1, _ = 0, H = C.length; _ < H; _++) if (C[_](r, s, t, !0)) {
2406
+ for (F = !1, _ = 0, H = w.length; _ < H; _++) if (w[_](r, s, t, !0)) {
2407
2407
  F = !0;
2408
2408
  break;
2409
2409
  }
@@ -2424,14 +2424,14 @@ function footnote(r, e, t, n) {
2424
2424
  a,
2425
2425
  l,
2426
2426
  c,
2427
- u = r.bMarks[e] + r.tShift[e],
2428
- d = r.eMarks[e];
2429
- if (u + 4 > d || r.src.charCodeAt(u) !== 91 || r.src.charCodeAt(u + 1) !== 94 || r.level >= r.options.maxNesting) return !1;
2430
- for (l = u + 2; l < d; l++) {
2427
+ d = r.bMarks[e] + r.tShift[e],
2428
+ u = r.eMarks[e];
2429
+ if (d + 4 > u || r.src.charCodeAt(d) !== 91 || r.src.charCodeAt(d + 1) !== 94 || r.level >= r.options.maxNesting) return !1;
2430
+ for (l = d + 2; l < u; l++) {
2431
2431
  if (r.src.charCodeAt(l) === 32) return !1;
2432
2432
  if (r.src.charCodeAt(l) === 93) break;
2433
2433
  }
2434
- return l === u + 2 || l + 1 >= d || r.src.charCodeAt(++l) !== 58 ? !1 : (n || (l++, r.env.footnotes || (r.env.footnotes = {}), r.env.footnotes.refs || (r.env.footnotes.refs = {}), c = r.src.slice(u + 2, l - 2), r.env.footnotes.refs[":" + c] = -1, r.tokens.push({
2434
+ return l === d + 2 || l + 1 >= u || r.src.charCodeAt(++l) !== 58 ? !1 : (n || (l++, r.env.footnotes || (r.env.footnotes = {}), r.env.footnotes.refs || (r.env.footnotes.refs = {}), c = r.src.slice(d + 2, l - 2), r.env.footnotes.refs[":" + c] = -1, r.tokens.push({
2435
2435
  type: "footnote_reference_open",
2436
2436
  label: c,
2437
2437
  level: r.level++
@@ -2503,8 +2503,8 @@ function htmlblock(r, e, t, n) {
2503
2503
  a,
2504
2504
  l = r.bMarks[e],
2505
2505
  c = r.eMarks[e],
2506
- u = r.tShift[e];
2507
- if (l += u, !r.options.html || u > 3 || l + 2 >= c || r.src.charCodeAt(l) !== 60) return !1;
2506
+ d = r.tShift[e];
2507
+ if (l += d, !r.options.html || d > 3 || l + 2 >= c || r.src.charCodeAt(l) !== 60) return !1;
2508
2508
  if (s = r.src.charCodeAt(l + 1), s === 33 || s === 63) {
2509
2509
  if (n) return !0;
2510
2510
  } else if (s === 47 || isLetter$1(s)) {
@@ -2528,17 +2528,17 @@ function getLine(r, e) {
2528
2528
  return r.src.substr(t, n - t);
2529
2529
  }
2530
2530
  function table(r, e, t, n) {
2531
- var s, o, a, l, c, u, d, h, f, p, b;
2532
- if (e + 2 > t || (c = e + 1, r.tShift[c] < r.blkIndent) || (a = r.bMarks[c] + r.tShift[c], a >= r.eMarks[c]) || (s = r.src.charCodeAt(a), s !== 124 && s !== 45 && s !== 58) || (o = getLine(r, e + 1), !/^[-:| ]+$/.test(o)) || (u = o.split("|"), u <= 2)) return !1;
2533
- for (h = [], l = 0; l < u.length; l++) {
2534
- if (f = u[l].trim(), !f) {
2535
- if (l === 0 || l === u.length - 1) continue;
2531
+ var s, o, a, l, c, d, u, h, f, p, b;
2532
+ if (e + 2 > t || (c = e + 1, r.tShift[c] < r.blkIndent) || (a = r.bMarks[c] + r.tShift[c], a >= r.eMarks[c]) || (s = r.src.charCodeAt(a), s !== 124 && s !== 45 && s !== 58) || (o = getLine(r, e + 1), !/^[-:| ]+$/.test(o)) || (d = o.split("|"), d <= 2)) return !1;
2533
+ for (h = [], l = 0; l < d.length; l++) {
2534
+ if (f = d[l].trim(), !f) {
2535
+ if (l === 0 || l === d.length - 1) continue;
2536
2536
  return !1;
2537
2537
  }
2538
2538
  if (!/^:?-+:?$/.test(f)) return !1;
2539
2539
  f.charCodeAt(f.length - 1) === 58 ? h.push(f.charCodeAt(0) === 58 ? "center" : "right") : f.charCodeAt(0) === 58 ? h.push("left") : h.push("");
2540
2540
  }
2541
- if (o = getLine(r, e).trim(), o.indexOf("|") === -1 || (u = o.replace(/^\||\|$/g, "").split("|"), h.length !== u.length)) return !1;
2541
+ if (o = getLine(r, e).trim(), o.indexOf("|") === -1 || (d = o.replace(/^\||\|$/g, "").split("|"), h.length !== d.length)) return !1;
2542
2542
  if (n) return !0;
2543
2543
  for (r.tokens.push({
2544
2544
  type: "table_open",
@@ -2552,14 +2552,14 @@ function table(r, e, t, n) {
2552
2552
  type: "tr_open",
2553
2553
  lines: [e, e + 1],
2554
2554
  level: r.level++
2555
- }), l = 0; l < u.length; l++) r.tokens.push({
2555
+ }), l = 0; l < d.length; l++) r.tokens.push({
2556
2556
  type: "th_open",
2557
2557
  align: h[l],
2558
2558
  lines: [e, e + 1],
2559
2559
  level: r.level++
2560
2560
  }), r.tokens.push({
2561
2561
  type: "inline",
2562
- content: u[l].trim(),
2562
+ content: d[l].trim(),
2563
2563
  lines: [e, e + 1],
2564
2564
  level: r.level,
2565
2565
  children: []
@@ -2578,16 +2578,16 @@ function table(r, e, t, n) {
2578
2578
  lines: b = [e + 2, 0],
2579
2579
  level: r.level++
2580
2580
  }), c = e + 2; c < t && !(r.tShift[c] < r.blkIndent || (o = getLine(r, c).trim(), o.indexOf("|") === -1)); c++) {
2581
- for (u = o.replace(/^\||\|$/g, "").split("|"), r.tokens.push({
2581
+ for (d = o.replace(/^\||\|$/g, "").split("|"), r.tokens.push({
2582
2582
  type: "tr_open",
2583
2583
  level: r.level++
2584
- }), l = 0; l < u.length; l++) r.tokens.push({
2584
+ }), l = 0; l < d.length; l++) r.tokens.push({
2585
2585
  type: "td_open",
2586
2586
  align: h[l],
2587
2587
  level: r.level++
2588
- }), d = u[l].substring(u[l].charCodeAt(0) === 124 ? 1 : 0, u[l].charCodeAt(u[l].length - 1) === 124 ? u[l].length - 1 : u[l].length).trim(), r.tokens.push({
2588
+ }), u = d[l].substring(d[l].charCodeAt(0) === 124 ? 1 : 0, d[l].charCodeAt(d[l].length - 1) === 124 ? d[l].length - 1 : d[l].length).trim(), r.tokens.push({
2589
2589
  type: "inline",
2590
- content: d,
2590
+ content: u,
2591
2591
  level: r.level,
2592
2592
  children: []
2593
2593
  }), r.tokens.push({
@@ -2621,14 +2621,14 @@ function markTightParagraphs$1(r, e) {
2621
2621
  for (t = e + 2, n = r.tokens.length - 2; t < n; t++) r.tokens[t].level === s && r.tokens[t].type === "paragraph_open" && (r.tokens[t + 2].tight = !0, r.tokens[t].tight = !0, t += 2);
2622
2622
  }
2623
2623
  function deflist(r, e, t, n) {
2624
- var s, o, a, l, c, u, d, h, f, p, b, m, g, v;
2624
+ var s, o, a, l, c, d, u, h, f, p, b, m, g, v;
2625
2625
  if (n) return r.ddIndent < 0 ? !1 : skipMarker(r, e) >= 0;
2626
- if (d = e + 1, r.isEmpty(d) && ++d > t || r.tShift[d] < r.blkIndent || (s = skipMarker(r, d), s < 0) || r.level >= r.options.maxNesting) return !1;
2627
- u = r.tokens.length, r.tokens.push({
2626
+ if (u = e + 1, r.isEmpty(u) && ++u > t || r.tShift[u] < r.blkIndent || (s = skipMarker(r, u), s < 0) || r.level >= r.options.maxNesting) return !1;
2627
+ d = r.tokens.length, r.tokens.push({
2628
2628
  type: "dl_open",
2629
2629
  lines: c = [e, 0],
2630
2630
  level: r.level++
2631
- }), a = e, o = d;
2631
+ }), a = e, o = u;
2632
2632
  e: for (;;) {
2633
2633
  for (v = !0, g = !1, r.tokens.push({
2634
2634
  type: "dt_open",
@@ -2646,21 +2646,21 @@ function deflist(r, e, t, n) {
2646
2646
  });;) {
2647
2647
  if (r.tokens.push({
2648
2648
  type: "dd_open",
2649
- lines: l = [d, 0],
2649
+ lines: l = [u, 0],
2650
2650
  level: r.level++
2651
2651
  }), m = r.tight, f = r.ddIndent, h = r.blkIndent, b = r.tShift[o], p = r.parentType, r.blkIndent = r.ddIndent = r.tShift[o] + 2, r.tShift[o] = s - r.bMarks[o], r.tight = !0, r.parentType = "deflist", r.parser.tokenize(r, o, t, !0), (!r.tight || g) && (v = !1), g = r.line - o > 1 && r.isEmpty(r.line - 1), r.tShift[o] = b, r.tight = m, r.parentType = p, r.blkIndent = h, r.ddIndent = f, r.tokens.push({
2652
2652
  type: "dd_close",
2653
2653
  level: --r.level
2654
- }), l[1] = d = r.line, d >= t || r.tShift[d] < r.blkIndent) break e;
2655
- if (s = skipMarker(r, d), s < 0) break;
2656
- o = d;
2654
+ }), l[1] = u = r.line, u >= t || r.tShift[u] < r.blkIndent) break e;
2655
+ if (s = skipMarker(r, u), s < 0) break;
2656
+ o = u;
2657
2657
  }
2658
- if (d >= t || (a = d, r.isEmpty(a)) || r.tShift[a] < r.blkIndent || (o = a + 1, o >= t) || (r.isEmpty(o) && o++, o >= t) || r.tShift[o] < r.blkIndent || (s = skipMarker(r, o), s < 0)) break;
2658
+ if (u >= t || (a = u, r.isEmpty(a)) || r.tShift[a] < r.blkIndent || (o = a + 1, o >= t) || (r.isEmpty(o) && o++, o >= t) || r.tShift[o] < r.blkIndent || (s = skipMarker(r, o), s < 0)) break;
2659
2659
  }
2660
2660
  return r.tokens.push({
2661
2661
  type: "dl_close",
2662
2662
  level: --r.level
2663
- }), c[1] = d, r.line = d, v && markTightParagraphs$1(r, u), !0;
2663
+ }), c[1] = u, r.line = u, v && markTightParagraphs$1(r, d), !0;
2664
2664
  }
2665
2665
  function paragraph(r, e) {
2666
2666
  var t,
@@ -2721,8 +2721,8 @@ ParserBlock.prototype.parse = function (r, e, t, n) {
2721
2721
  a = 0;
2722
2722
  if (!r) return [];
2723
2723
  r = r.replace(SPACES_RE, " "), r = r.replace(NEWLINES_RE, "\n"), r.indexOf(" ") >= 0 && (r = r.replace(TABS_SCAN_RE, function (l, c) {
2724
- var u;
2725
- return r.charCodeAt(c) === 10 ? (o = c + 1, a = 0, l) : (u = " ".slice((c - o - a) % 4), a = c - o + 1, u);
2724
+ var d;
2725
+ return r.charCodeAt(c) === 10 ? (o = c + 1, a = 0, l) : (d = " ".slice((c - o - a) % 4), a = c - o + 1, d);
2726
2726
  })), s = new StateBlock(r, this, e, t, n), this.tokenize(s, s.line, s.lineMax);
2727
2727
  };
2728
2728
  function isTerminatorChar(r) {
@@ -2915,9 +2915,9 @@ function scanDelims(r, e) {
2915
2915
  a = !0,
2916
2916
  l = !0,
2917
2917
  c = r.posMax,
2918
- u = r.src.charCodeAt(e);
2919
- for (n = e > 0 ? r.src.charCodeAt(e - 1) : -1; t < c && r.src.charCodeAt(t) === u;) t++;
2920
- return t >= c && (a = !1), o = t - e, o >= 4 ? a = l = !1 : (s = t < c ? r.src.charCodeAt(t) : -1, (s === 32 || s === 10) && (a = !1), (n === 32 || n === 10) && (l = !1), u === 95 && (isAlphaNum(n) && (a = !1), isAlphaNum(s) && (l = !1))), {
2918
+ d = r.src.charCodeAt(e);
2919
+ for (n = e > 0 ? r.src.charCodeAt(e - 1) : -1; t < c && r.src.charCodeAt(t) === d;) t++;
2920
+ return t >= c && (a = !1), o = t - e, o >= 4 ? a = l = !1 : (s = t < c ? r.src.charCodeAt(t) : -1, (s === 32 || s === 10) && (a = !1), (n === 32 || n === 10) && (l = !1), d === 95 && (isAlphaNum(n) && (a = !1), isAlphaNum(s) && (l = !1))), {
2921
2921
  can_open: a,
2922
2922
  can_close: l,
2923
2923
  delims: o
@@ -2931,13 +2931,13 @@ function emphasis(r, e) {
2931
2931
  a,
2932
2932
  l,
2933
2933
  c,
2934
- u = r.posMax,
2935
- d = r.pos,
2936
- h = r.src.charCodeAt(d);
2934
+ d = r.posMax,
2935
+ u = r.pos,
2936
+ h = r.src.charCodeAt(u);
2937
2937
  if (h !== 95 && h !== 42 || e) return !1;
2938
- if (c = scanDelims(r, d), t = c.delims, !c.can_open) return r.pos += t, e || (r.pending += r.src.slice(d, r.pos)), !0;
2938
+ if (c = scanDelims(r, u), t = c.delims, !c.can_open) return r.pos += t, e || (r.pending += r.src.slice(u, r.pos)), !0;
2939
2939
  if (r.level >= r.options.maxNesting) return !1;
2940
- for (r.pos = d + t, l = [t]; r.pos < u;) {
2940
+ for (r.pos = u + t, l = [t]; r.pos < d;) {
2941
2941
  if (r.src.charCodeAt(r.pos) === h) {
2942
2942
  if (c = scanDelims(r, r.pos), n = c.delims, c.can_close) {
2943
2943
  for (o = l.pop(), a = n; o !== a;) {
@@ -2960,7 +2960,7 @@ function emphasis(r, e) {
2960
2960
  }
2961
2961
  r.parser.skipToken(r);
2962
2962
  }
2963
- return s ? (r.posMax = r.pos, r.pos = d + t, e || ((t === 2 || t === 3) && r.push({
2963
+ return s ? (r.posMax = r.pos, r.pos = u + t, e || ((t === 2 || t === 3) && r.push({
2964
2964
  type: "strong_open",
2965
2965
  level: r.level++
2966
2966
  }), (t === 1 || t === 3) && r.push({
@@ -2972,7 +2972,7 @@ function emphasis(r, e) {
2972
2972
  }), (t === 2 || t === 3) && r.push({
2973
2973
  type: "strong_close",
2974
2974
  level: --r.level
2975
- })), r.pos = r.posMax + t, r.posMax = u, !0) : (r.pos = d, !1);
2975
+ })), r.pos = r.posMax + t, r.posMax = d, !0) : (r.pos = u, !1);
2976
2976
  }
2977
2977
  var UNESCAPE_RE = /\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;
2978
2978
  function sub(r, e) {
@@ -3022,27 +3022,27 @@ function links(r, e) {
3022
3022
  a,
3023
3023
  l,
3024
3024
  c,
3025
- u,
3026
- d = !1,
3025
+ d,
3026
+ u = !1,
3027
3027
  h = r.pos,
3028
3028
  f = r.posMax,
3029
3029
  p = r.pos,
3030
3030
  b = r.src.charCodeAt(p);
3031
- if (b === 33 && (d = !0, b = r.src.charCodeAt(++p)), b !== 91 || r.level >= r.options.maxNesting || (t = p + 1, n = parseLinkLabel(r, p), n < 0)) return !1;
3031
+ if (b === 33 && (u = !0, b = r.src.charCodeAt(++p)), b !== 91 || r.level >= r.options.maxNesting || (t = p + 1, n = parseLinkLabel(r, p), n < 0)) return !1;
3032
3032
  if (l = n + 1, l < f && r.src.charCodeAt(l) === 40) {
3033
- for (l++; l < f && (u = r.src.charCodeAt(l), !(u !== 32 && u !== 10)); l++);
3033
+ for (l++; l < f && (d = r.src.charCodeAt(l), !(d !== 32 && d !== 10)); l++);
3034
3034
  if (l >= f) return !1;
3035
- for (p = l, parseLinkDestination(r, l) ? (o = r.linkContent, l = r.pos) : o = "", p = l; l < f && (u = r.src.charCodeAt(l), !(u !== 32 && u !== 10)); l++);
3036
- if (l < f && p !== l && parseLinkTitle(r, l)) for (a = r.linkContent, l = r.pos; l < f && (u = r.src.charCodeAt(l), !(u !== 32 && u !== 10)); l++);else a = "";
3035
+ for (p = l, parseLinkDestination(r, l) ? (o = r.linkContent, l = r.pos) : o = "", p = l; l < f && (d = r.src.charCodeAt(l), !(d !== 32 && d !== 10)); l++);
3036
+ if (l < f && p !== l && parseLinkTitle(r, l)) for (a = r.linkContent, l = r.pos; l < f && (d = r.src.charCodeAt(l), !(d !== 32 && d !== 10)); l++);else a = "";
3037
3037
  if (l >= f || r.src.charCodeAt(l) !== 41) return r.pos = h, !1;
3038
3038
  l++;
3039
3039
  } else {
3040
3040
  if (r.linkLevel > 0) return !1;
3041
- for (; l < f && (u = r.src.charCodeAt(l), !(u !== 32 && u !== 10)); l++);
3041
+ for (; l < f && (d = r.src.charCodeAt(l), !(d !== 32 && d !== 10)); l++);
3042
3042
  if (l < f && r.src.charCodeAt(l) === 91 && (p = l + 1, l = parseLinkLabel(r, l), l >= 0 ? s = r.src.slice(p, l++) : l = p - 1), s || (_typeof(s) > "u" && (l = n + 1), s = r.src.slice(t, n)), c = r.env.references[normalizeReference(s)], !c) return r.pos = h, !1;
3043
3043
  o = c.href, a = c.title;
3044
3044
  }
3045
- return e || (r.pos = t, r.posMax = n, d ? r.push({
3045
+ return e || (r.pos = t, r.posMax = n, u ? r.push({
3046
3046
  type: "image",
3047
3047
  src: o,
3048
3048
  title: a,
@@ -3403,11 +3403,17 @@ var RemarkableConfig = /*#__PURE__*/function () {
3403
3403
  // Convert '\n' in paragraphs into <br>
3404
3404
  langPrefix: "language-",
3405
3405
  // CSS language prefix for fenced blocks
3406
- linkTarget: "",
3407
- // set target to open link in
3406
+ linkTarget: "_blank",
3407
+ // set target to open in a new tab
3408
3408
  typographer: !0
3409
3409
  // Enable smartypants and other sweet transforms
3410
- }) : new Remarkable();
3410
+ }) : new Remarkable({
3411
+ highlight: function highlight(t) {
3412
+ return t;
3413
+ },
3414
+ linkTarget: "_blank"
3415
+ // set target to open in a new tab
3416
+ });
3411
3417
  }
3412
3418
  }]);
3413
3419
  return RemarkableConfig;
@@ -3428,8 +3434,8 @@ var SetFileTypes = /*#__PURE__*/function () {
3428
3434
  if (_typeof(s) == "object") {
3429
3435
  var l = s.files,
3430
3436
  c = s.request,
3431
- u = s.button;
3432
- l && (l.infoModal && (o.files.infoModal = l.infoModal, (a = l.infoModal) != null && a.textMarkDown && (o.infoModalTextMarkUp = n.render(l.infoModal.textMarkDown))), l.acceptedFormats && (o.files.acceptedFormats = l.acceptedFormats), l.maxNumberOfFiles && (o.files.maxNumberOfFiles = l.maxNumberOfFiles)), o.button = u, c && (c.headers || c.method || c.url || e.headers || e.method || e.url) && (o.request = {
3437
+ d = s.button;
3438
+ l && (l.infoModal && (o.files.infoModal = l.infoModal, (a = l.infoModal) != null && a.textMarkDown && (o.infoModalTextMarkUp = n.render(l.infoModal.textMarkDown))), l.acceptedFormats && (o.files.acceptedFormats = l.acceptedFormats), l.maxNumberOfFiles && (o.files.maxNumberOfFiles = l.maxNumberOfFiles)), o.button = d, c && (c.headers || c.method || c.url || e.headers || e.method || e.url) && (o.request = {
3433
3439
  headers: (c == null ? void 0 : c.headers) || e.headers,
3434
3440
  method: (c == null ? void 0 : c.method) || e.method,
3435
3441
  url: (c == null ? void 0 : c.url) || e.url
@@ -3453,11 +3459,11 @@ var SetFileTypes = /*#__PURE__*/function () {
3453
3459
  key: "processMicrophone",
3454
3460
  value: function processMicrophone(e, t, n, s) {
3455
3461
  var _c$files, _f$maxNumberOfFiles;
3456
- var l, c, u, d, h, f;
3462
+ var l, c, d, u, h, f;
3457
3463
  var a = _objectSpread({
3458
3464
  acceptedFormats: "audio/*"
3459
3465
  }, ((l = e.fileTypes.audio) == null ? void 0 : l.files) || {});
3460
- n && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = SetFileTypes.parseConfig(e.requestSettings, a, t, n), _typeof(n) == "object" && n.files && ((_c$files = (c = e.recordAudio).files) !== null && _c$files !== void 0 ? _c$files : c.files = {}, e.recordAudio.files.format = (u = n.files) == null ? void 0 : u.format, e.recordAudio.files.maxDurationSeconds = (d = n.files) == null ? void 0 : d.maxDurationSeconds, (h = e.fileTypes.audio) != null && h.files && ((_f$maxNumberOfFiles = (f = e.fileTypes.audio.files).maxNumberOfFiles) !== null && _f$maxNumberOfFiles !== void 0 ? _f$maxNumberOfFiles : f.maxNumberOfFiles = n.files.maxNumberOfFiles))) : s || (e.fileTypes.audio = SetFileTypes.parseConfig(e.requestSettings, a, t, n)));
3466
+ n && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = SetFileTypes.parseConfig(e.requestSettings, a, t, n), _typeof(n) == "object" && n.files && ((_c$files = (c = e.recordAudio).files) !== null && _c$files !== void 0 ? _c$files : c.files = {}, e.recordAudio.files.format = (d = n.files) == null ? void 0 : d.format, e.recordAudio.files.maxDurationSeconds = (u = n.files) == null ? void 0 : u.maxDurationSeconds, (h = e.fileTypes.audio) != null && h.files && ((_f$maxNumberOfFiles = (f = e.fileTypes.audio.files).maxNumberOfFiles) !== null && _f$maxNumberOfFiles !== void 0 ? _f$maxNumberOfFiles : f.maxNumberOfFiles = n.files.maxNumberOfFiles))) : s || (e.fileTypes.audio = SetFileTypes.parseConfig(e.requestSettings, a, t, n)));
3461
3467
  }
3462
3468
  // prettier-ignore
3463
3469
  }, {
@@ -3485,11 +3491,11 @@ var SetFileTypes = /*#__PURE__*/function () {
3485
3491
  key: "processCamera",
3486
3492
  value: function processCamera(e, t, n, s) {
3487
3493
  var _c$files2;
3488
- var l, c, u, d;
3494
+ var l, c, d, u;
3489
3495
  var a = _objectSpread({
3490
3496
  acceptedFormats: "image/*"
3491
3497
  }, ((l = e.fileTypes.images) == null ? void 0 : l.files) || {});
3492
- n && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.camera = SetFileTypes.parseConfig(e.requestSettings, a, t, n), _typeof(n) == "object" && (e.camera.modalContainerStyle = n.modalContainerStyle, n.files && ((_c$files2 = (c = e.camera).files) !== null && _c$files2 !== void 0 ? _c$files2 : c.files = {}, e.camera.files.format = (u = n.files) == null ? void 0 : u.format, e.camera.files.dimensions = (d = n.files) == null ? void 0 : d.dimensions))) : s || (e.fileTypes.images = SetFileTypes.parseConfig(e.requestSettings, a, t, n)));
3498
+ n && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.camera = SetFileTypes.parseConfig(e.requestSettings, a, t, n), _typeof(n) == "object" && (e.camera.modalContainerStyle = n.modalContainerStyle, n.files && ((_c$files2 = (c = e.camera).files) !== null && _c$files2 !== void 0 ? _c$files2 : c.files = {}, e.camera.files.format = (d = n.files) == null ? void 0 : d.format, e.camera.files.dimensions = (u = n.files) == null ? void 0 : u.dimensions))) : s || (e.fileTypes.images = SetFileTypes.parseConfig(e.requestSettings, a, t, n)));
3493
3499
  }
3494
3500
  // prettier-ignore
3495
3501
  }, {
@@ -3544,8 +3550,8 @@ var BaseServiceIO = /*#__PURE__*/function () {
3544
3550
  key: "callServiceAPI",
3545
3551
  value: function () {
3546
3552
  var _callServiceAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(e, t, n) {
3547
- var _c$headers, _u$ContentType;
3548
- var l, c, u, d, s, o, a;
3553
+ var _c$headers, _d$ContentType;
3554
+ var l, c, d, u, s, o, a;
3549
3555
  return _regeneratorRuntime().wrap(function _callee16$(_context16) {
3550
3556
  while (1) switch (_context16.prev = _context16.next) {
3551
3557
  case 0:
@@ -3553,7 +3559,7 @@ var BaseServiceIO = /*#__PURE__*/function () {
3553
3559
  messages: t
3554
3560
  }, this.rawBody);
3555
3561
  o = !1;
3556
- (l = this.requestSettings.headers) != null && l["Content-Type"] || ((_c$headers = (c = this.requestSettings).headers) !== null && _c$headers !== void 0 ? _c$headers : c.headers = {}, (_u$ContentType = (u = this.requestSettings.headers)["Content-Type"]) !== null && _u$ContentType !== void 0 ? _u$ContentType : u["Content-Type"] = "application/json", o = !0);
3562
+ (l = this.requestSettings.headers) != null && l["Content-Type"] || ((_c$headers = (c = this.requestSettings).headers) !== null && _c$headers !== void 0 ? _c$headers : c.headers = {}, (_d$ContentType = (d = this.requestSettings.headers)["Content-Type"]) !== null && _d$ContentType !== void 0 ? _d$ContentType : d["Content-Type"] = "application/json", o = !0);
3557
3563
  a = this.deepChat.stream;
3558
3564
  if (!(a && (this.demo || _typeof(a) != "object" || !a.simulation))) {
3559
3565
  _context16.next = 9;
@@ -3568,7 +3574,7 @@ var BaseServiceIO = /*#__PURE__*/function () {
3568
3574
  _context16.next = 11;
3569
3575
  return HTTPRequest.request(this, s, e);
3570
3576
  case 11:
3571
- o && ((d = this.requestSettings.headers) == null || delete d["Content-Type"]);
3577
+ o && ((u = this.requestSettings.headers) == null || delete u["Content-Type"]);
3572
3578
  case 12:
3573
3579
  case "end":
3574
3580
  return _context16.stop();
@@ -3663,6 +3669,11 @@ var BaseServiceIO = /*#__PURE__*/function () {
3663
3669
  }
3664
3670
  return extractResultData;
3665
3671
  }()
3672
+ }, {
3673
+ key: "isDirectConnection",
3674
+ value: function isDirectConnection() {
3675
+ return !1;
3676
+ }
3666
3677
  }], [{
3667
3678
  key: "canSendMessage",
3668
3679
  value: function canSendMessage(e, t) {
@@ -3725,6 +3736,11 @@ var DirectServiceIO = /*#__PURE__*/function (_BaseServiceIO) {
3725
3736
  c = (a == null ? void 0 : a(e)) || this.buildHeadersFunc(e);
3726
3737
  HTTPRequest.verifyKey(e, n, c, s, this.keyAuthenticated.bind(this, t.onSuccess), t.onFail, t.onLoad, o, l);
3727
3738
  }
3739
+ }, {
3740
+ key: "isDirectConnection",
3741
+ value: function isDirectConnection() {
3742
+ return !0;
3743
+ }
3728
3744
  }]);
3729
3745
  return DirectServiceIO;
3730
3746
  }(BaseServiceIO);
@@ -3946,8 +3962,8 @@ var InsertKeyView = /*#__PURE__*/function () {
3946
3962
  var l = InsertKeyView.createStartButton(),
3947
3963
  _InsertKeyView$create = InsertKeyView.createHelpTextContainer(t.getKeyLink),
3948
3964
  c = _InsertKeyView$create.helpTextContainerElement,
3949
- u = _InsertKeyView$create.failTextElement;
3950
- return n.appendChild(l), n.appendChild(c), InsertKeyView.addVerificationEvents(o, l, u, e, t), n;
3965
+ d = _InsertKeyView$create.failTextElement;
3966
+ return n.appendChild(l), n.appendChild(c), InsertKeyView.addVerificationEvents(o, l, d, e, t), n;
3951
3967
  }
3952
3968
  }, {
3953
3969
  key: "createElements",
@@ -3999,17 +4015,17 @@ var HuggingFaceUtils = /*#__PURE__*/function () {
3999
4015
  return HuggingFaceUtils;
4000
4016
  }();
4001
4017
  var _HuggingFaceIO = /*#__PURE__*/function (_DirectServiceIO) {
4002
- _inherits(U, _DirectServiceIO);
4003
- var _super3 = _createSuper(U);
4018
+ _inherits(j, _DirectServiceIO);
4019
+ var _super3 = _createSuper(j);
4004
4020
  // prettier-ignore
4005
- function U(e, t, n, s, o, a) {
4021
+ function j(e, t, n, s, o, a) {
4006
4022
  var _this4;
4007
- _classCallCheck(this, U);
4008
- _this4 = _super3.call(this, e, HuggingFaceUtils.buildKeyVerificationDetails(), HuggingFaceUtils.buildHeaders, o, a), _this4.insertKeyPlaceholderText = "Hugging Face Token", _this4.getKeyLink = "https://huggingface.co/settings/tokens", _this4.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this4.permittedErrorPrefixes = ["Authorization header"], _this4.url = "".concat(U.URL_PREFIX).concat(n), _this4.textInputPlaceholderText = t, _typeof(s) == "object" && (s.model && (_this4.url = "".concat(U.URL_PREFIX).concat(s.model)), s.options && (_this4.rawBody.options = s.options), s.parameters && (_this4.rawBody.parameters = s.parameters));
4023
+ _classCallCheck(this, j);
4024
+ _this4 = _super3.call(this, e, HuggingFaceUtils.buildKeyVerificationDetails(), HuggingFaceUtils.buildHeaders, o, a), _this4.insertKeyPlaceholderText = "Hugging Face Token", _this4.getKeyLink = "https://huggingface.co/settings/tokens", _this4.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this4.permittedErrorPrefixes = ["Authorization header"], _this4.url = "".concat(j.URL_PREFIX).concat(n), _this4.textInputPlaceholderText = t, _typeof(s) == "object" && (s.model && (_this4.url = "".concat(j.URL_PREFIX).concat(s.model)), s.options && (_this4.rawBody.options = s.options), s.parameters && (_this4.rawBody.parameters = s.parameters));
4009
4025
  return _this4;
4010
4026
  }
4011
4027
  // prettier-ignore
4012
- _createClass(U, [{
4028
+ _createClass(j, [{
4013
4029
  key: "preprocessBody",
4014
4030
  value: function preprocessBody(e, t, n) {
4015
4031
  var _s$options;
@@ -4047,7 +4063,7 @@ var _HuggingFaceIO = /*#__PURE__*/function (_DirectServiceIO) {
4047
4063
  return callServiceAPI;
4048
4064
  }()
4049
4065
  }]);
4050
- return U;
4066
+ return j;
4051
4067
  }(DirectServiceIO);
4052
4068
  _HuggingFaceIO.URL_PREFIX = "https://api-inference.huggingface.co/models/";
4053
4069
  var HuggingFaceIO = _HuggingFaceIO;
@@ -4259,7 +4275,7 @@ var StabilityAIImageToImageUpscaleIO = /*#__PURE__*/function (_StabilityAIIO) {
4259
4275
  var _this7;
4260
4276
  _classCallCheck(this, StabilityAIImageToImageUpscaleIO);
4261
4277
  var a;
4262
- var t = e.directConnection,
4278
+ var t = JSON.parse(JSON.stringify(e.directConnection)),
4263
4279
  n = t == null ? void 0 : t.stabilityAI,
4264
4280
  s = {
4265
4281
  images: {
@@ -4368,7 +4384,7 @@ var StabilityAIImageToImageMaskingIO = /*#__PURE__*/function (_StabilityAIIO2) {
4368
4384
  var _this8;
4369
4385
  _classCallCheck(this, StabilityAIImageToImageMaskingIO);
4370
4386
  var a;
4371
- var t = e.directConnection,
4387
+ var t = JSON.parse(JSON.stringify(e.directConnection)),
4372
4388
  n = t == null ? void 0 : t.stabilityAI,
4373
4389
  s = {
4374
4390
  images: {
@@ -4743,8 +4759,8 @@ var StabilityAIImageToImageIO = /*#__PURE__*/function (_StabilityAIIO3) {
4743
4759
  var _this11;
4744
4760
  _classCallCheck(this, StabilityAIImageToImageIO);
4745
4761
  var a;
4746
- var t = e.directConnection,
4747
- n = t == null ? void 0 : t.stabilityAI,
4762
+ var t = JSON.parse(JSON.stringify(e.directConnection)),
4763
+ n = t.stabilityAI,
4748
4764
  s = {
4749
4765
  images: {
4750
4766
  files: {
@@ -4753,8 +4769,8 @@ var StabilityAIImageToImageIO = /*#__PURE__*/function (_StabilityAIIO3) {
4753
4769
  }
4754
4770
  }
4755
4771
  };
4756
- _this11 = _super15.call(this, e, StabilityAIUtils.buildKeyVerificationDetails(), StabilityAIUtils.buildHeaders, n, s), _this11.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-5/image-to-image", _this11.textInputPlaceholderText = "Describe image changes", _this11.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>";
4757
- var o = (a = t == null ? void 0 : t.stabilityAI) == null ? void 0 : a.imageToImage;
4772
+ _this11 = _super15.call(this, e, StabilityAIUtils.buildKeyVerificationDetails(), StabilityAIUtils.buildHeaders, n, s), _this11.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-5/image-to-image", _this11.textInputPlaceholderText = "Describe image changes", _this11.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>";
4773
+ var o = (a = t.stabilityAI) == null ? void 0 : a.imageToImage;
4758
4774
  _typeof(o) == "object" && (o.engine_id && (_this11.url = "https://api.stability.ai/v1/generation/".concat(o.engine_id, "/text-to-image")), o.weight !== void 0 && o.weight !== null && (_this11._imageWeight = o.weight), StabilityAIImageToImageIO.cleanConfig(o), Object.assign(_this11.rawBody, o)), _this11.canSendMessage = StabilityAIImageToImageIO.canSendFileTextMessage;
4759
4775
  return _this11;
4760
4776
  }
@@ -4892,10 +4908,10 @@ var StabilityAITextToImageIO = /*#__PURE__*/function (_StabilityAIIO4) {
4892
4908
  var _this12;
4893
4909
  _classCallCheck(this, StabilityAITextToImageIO);
4894
4910
  var o;
4895
- var t = e.directConnection,
4896
- n = t == null ? void 0 : t.stabilityAI;
4897
- _this12 = _super17.call(this, e, StabilityAIUtils.buildKeyVerificationDetails(), StabilityAIUtils.buildHeaders, n), _this12.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-5/text-to-image", _this12.textInputPlaceholderText = "Describe an image", _this12.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>";
4898
- var s = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.textToImage;
4911
+ var t = JSON.parse(JSON.stringify(e.directConnection)),
4912
+ n = t.stabilityAI;
4913
+ _this12 = _super17.call(this, e, StabilityAIUtils.buildKeyVerificationDetails(), StabilityAIUtils.buildHeaders, n), _this12.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-5/text-to-image", _this12.textInputPlaceholderText = "Describe an image", _this12.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>";
4914
+ var s = (o = t.stabilityAI) == null ? void 0 : o.textToImage;
4899
4915
  _typeof(s) == "object" && (s.engine_id && (_this12.url = "https://api.stability.ai/v1/generation/".concat(s.engine_id, "/text-to-image")), s.weight !== void 0 && s.weight !== null && (_this12._imageWeight = s.weight), StabilityAITextToImageIO.cleanConfig(s), Object.assign(_this12.rawBody, s)), _this12.canSendMessage = StabilityAITextToImageIO.canSendTextMessage;
4900
4916
  return _this12;
4901
4917
  }
@@ -5645,7 +5661,7 @@ var AssemblyAIUtils = /*#__PURE__*/function () {
5645
5661
  key: "poll",
5646
5662
  value: function () {
5647
5663
  var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(e, t) {
5648
- var n, l, c, d;
5664
+ var n, l, c, u;
5649
5665
  return _regeneratorRuntime().wrap(function _callee48$(_context48) {
5650
5666
  while (1) switch (_context48.prev = _context48.next) {
5651
5667
  case 0:
@@ -5681,20 +5697,20 @@ var AssemblyAIUtils = /*#__PURE__*/function () {
5681
5697
  _context48.next = 13;
5682
5698
  return _context48.sent.json();
5683
5699
  case 13:
5684
- d = _context48.sent;
5685
- if (!(d.status === "completed")) {
5700
+ u = _context48.sent;
5701
+ if (!(u.status === "completed")) {
5686
5702
  _context48.next = 18;
5687
5703
  break;
5688
5704
  }
5689
- c = d;
5705
+ c = u;
5690
5706
  _context48.next = 22;
5691
5707
  break;
5692
5708
  case 18:
5693
- if (!(d.status === "error")) {
5709
+ if (!(u.status === "error")) {
5694
5710
  _context48.next = 20;
5695
5711
  break;
5696
5712
  }
5697
- throw new Error("Transcription failed: ".concat(d.error));
5713
+ throw new Error("Transcription failed: ".concat(u.error));
5698
5714
  case 20:
5699
5715
  _context48.next = 22;
5700
5716
  return new Promise(function (h) {
@@ -5848,13 +5864,13 @@ var _AzureTextToSpeechIO = /*#__PURE__*/function (_AzureSpeechIO) {
5848
5864
  var _super27 = _createSuper(V);
5849
5865
  // prettier-ignore
5850
5866
  function V(e) {
5851
- var _l$lang, _c$name, _u$gender;
5867
+ var _l$lang, _c$name, _d$gender;
5852
5868
  var _this20;
5853
5869
  _classCallCheck(this, V);
5854
- var s, o, a, l, c, u;
5870
+ var s, o, a, l, c, d;
5855
5871
  var t = (o = (s = e.directConnection) == null ? void 0 : s.azure) == null ? void 0 : o.textToSpeech,
5856
5872
  n = (a = e.directConnection) == null ? void 0 : a.azure;
5857
- _this20 = _super27.call(this, e, AzureUtils.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, n), _this20.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(V.HELP_LINK, "\">here</a> for more info.\n </p>"), _this20.url = "", Object.assign(_this20.rawBody, t), (_l$lang = (l = _this20.rawBody).lang) !== null && _l$lang !== void 0 ? _l$lang : l.lang = "en-US", (_c$name = (c = _this20.rawBody).name) !== null && _c$name !== void 0 ? _c$name : c.name = "en-US-JennyNeural", (_u$gender = (u = _this20.rawBody).gender) !== null && _u$gender !== void 0 ? _u$gender : u.gender = "Female", _this20.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1");
5873
+ _this20 = _super27.call(this, e, AzureUtils.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, n), _this20.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(V.HELP_LINK, "\">here</a> for more info.\n </p>"), _this20.url = "", Object.assign(_this20.rawBody, t), (_l$lang = (l = _this20.rawBody).lang) !== null && _l$lang !== void 0 ? _l$lang : l.lang = "en-US", (_c$name = (c = _this20.rawBody).name) !== null && _c$name !== void 0 ? _c$name : c.name = "en-US-JennyNeural", (_d$gender = (d = _this20.rawBody).gender) !== null && _d$gender !== void 0 ? _d$gender : d.gender = "Female", _this20.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1");
5858
5874
  return _this20;
5859
5875
  }
5860
5876
  _createClass(V, [{
@@ -5927,11 +5943,11 @@ _AzureTextToSpeechIO.HELP_LINK =
5927
5943
  "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
5928
5944
  var AzureTextToSpeechIO = _AzureTextToSpeechIO;
5929
5945
  var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
5930
- _inherits(j, _AzureSpeechIO2);
5931
- var _super28 = _createSuper(j);
5932
- function j(e) {
5946
+ _inherits(U, _AzureSpeechIO2);
5947
+ var _super28 = _createSuper(U);
5948
+ function U(e) {
5933
5949
  var _this21;
5934
- _classCallCheck(this, j);
5950
+ _classCallCheck(this, U);
5935
5951
  var a, l, c;
5936
5952
  var t = (l = (a = e.directConnection) == null ? void 0 : a.azure) == null ? void 0 : l.speechToText,
5937
5953
  n = (c = e.directConnection) == null ? void 0 : c.azure,
@@ -5942,12 +5958,12 @@ var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
5942
5958
  }
5943
5959
  }
5944
5960
  };
5945
- _this21 = _super28.call(this, e, AzureUtils.buildSpeechToTextHeaders, t.region, n, s), _this21.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(j.HELP_LINK, "\">here</a> for more info.\n </p>"), _this21.url = "", _this21.isTextInputDisabled = !0, _this21.textInputPlaceholderText = "Upload an audio file", _this21.canSendMessage = j.canFileSendMessage;
5961
+ _this21 = _super28.call(this, e, AzureUtils.buildSpeechToTextHeaders, t.region, n, s), _this21.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(U.HELP_LINK, "\">here</a> for more info.\n </p>"), _this21.url = "", _this21.isTextInputDisabled = !0, _this21.textInputPlaceholderText = "Upload an audio file", _this21.canSendMessage = U.canFileSendMessage;
5946
5962
  var o = t.lang || "en-US";
5947
5963
  _this21.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(o, "&format=detailed"), _this21.recordAudio = void 0;
5948
5964
  return _this21;
5949
5965
  }
5950
- _createClass(j, [{
5966
+ _createClass(U, [{
5951
5967
  key: "callServiceAPI",
5952
5968
  value: function () {
5953
5969
  var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(e, t, n) {
@@ -6012,7 +6028,7 @@ var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
6012
6028
  return !!(t != null && t[0]);
6013
6029
  }
6014
6030
  }]);
6015
- return j;
6031
+ return U;
6016
6032
  }(AzureSpeechIO);
6017
6033
  _AzureSpeechToTextIO.HELP_LINK =
6018
6034
  // eslint-disable-next-line max-len
@@ -6268,13 +6284,13 @@ var _OpenAIAudioIO = /*#__PURE__*/function (_DirectServiceIO10) {
6268
6284
  var _this24;
6269
6285
  _classCallCheck(this, k);
6270
6286
  var a, l;
6271
- var t = e.directConnection,
6272
- n = e.textInput,
6273
- s = t == null ? void 0 : t.openAI;
6287
+ var t = e.textInput,
6288
+ n = JSON.parse(JSON.stringify(e.directConnection)),
6289
+ s = n == null ? void 0 : n.openAI;
6274
6290
  _this24 = _super31.call(this, e, OpenAIUtils.buildKeyVerificationDetails(), OpenAIUtils.buildHeaders, s, {
6275
6291
  audio: {}
6276
- }), _this24.insertKeyPlaceholderText = "OpenAI API Key", _this24.getKeyLink = "https://platform.openai.com/account/api-keys", _this24.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI Whisper</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/api-reference/audio/create\">here</a> for more info.</p>", _this24.url = "", _this24.permittedErrorPrefixes = ["Invalid"], _this24._maxCharLength = OpenAIUtils.FILE_MAX_CHAR_LENGTH, _this24._service_url = k.AUDIO_TRANSCRIPTIONS_URL, n != null && n.characterLimit && (_this24._maxCharLength = n.characterLimit);
6277
- var o = (a = t == null ? void 0 : t.openAI) == null ? void 0 : a.audio;
6292
+ }), _this24.insertKeyPlaceholderText = "OpenAI API Key", _this24.getKeyLink = "https://platform.openai.com/account/api-keys", _this24.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI Whisper</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/api-reference/audio/create\">here</a> for more info.</p>", _this24.url = "", _this24.permittedErrorPrefixes = ["Invalid"], _this24._maxCharLength = OpenAIUtils.FILE_MAX_CHAR_LENGTH, _this24._service_url = k.AUDIO_TRANSCRIPTIONS_URL, t != null && t.characterLimit && (_this24._maxCharLength = t.characterLimit);
6293
+ var o = (a = n == null ? void 0 : n.openAI) == null ? void 0 : a.audio;
6278
6294
  _typeof(o) == "object" && (_this24.processConfig(o), k.cleanConfig(o), Object.assign(_this24.rawBody, o)), (_l$model2 = (l = _this24.rawBody).model) !== null && _l$model2 !== void 0 ? _l$model2 : l.model = k.DEFAULT_MODEL, _this24.rawBody.response_format = "json", _this24.canSendMessage = k.canSendFileMessage;
6279
6295
  return _this24;
6280
6296
  }
@@ -6386,20 +6402,21 @@ var OpenAIChatIO = /*#__PURE__*/function (_DirectServiceIO11) {
6386
6402
  _inherits(OpenAIChatIO, _DirectServiceIO11);
6387
6403
  var _super32 = _createSuper(OpenAIChatIO);
6388
6404
  function OpenAIChatIO(e) {
6389
- var _l$model3;
6405
+ var _a$model;
6390
6406
  var _this25;
6391
6407
  _classCallCheck(this, OpenAIChatIO);
6392
- var s, o, a, l;
6393
- var t = (s = e.directConnection) == null ? void 0 : s.openAI;
6394
- _this25 = _super32.call(this, e, OpenAIUtils.buildKeyVerificationDetails(), OpenAIUtils.buildHeaders, t), _this25.insertKeyPlaceholderText = "OpenAI API Key", _this25.getKeyLink = "https://platform.openai.com/account/api-keys", _this25.url = "https://api.openai.com/v1/chat/completions", _this25.permittedErrorPrefixes = ["Incorrect"], _this25._systemMessage = OpenAIChatIO.generateSystemMessage("You are a helpful assistant.");
6395
- var n = (a = (o = e.directConnection) == null ? void 0 : o.openAI) == null ? void 0 : a.chat;
6396
- _typeof(n) == "object" && (n.systemPrompt && (_this25._systemMessage = OpenAIChatIO.generateSystemMessage(n.systemPrompt)), _this25.cleanConfig(n), Object.assign(_this25.rawBody, n)), _this25.maxMessages === void 0 && (_this25.maxMessages = -1), (_l$model3 = (l = _this25.rawBody).model) !== null && _l$model3 !== void 0 ? _l$model3 : l.model = OpenAIConverseBaseBody.GPT_CHAT_TURBO_MODEL;
6408
+ var o, a;
6409
+ var t = JSON.parse(JSON.stringify(e.directConnection)),
6410
+ n = t.openAI;
6411
+ _this25 = _super32.call(this, e, OpenAIUtils.buildKeyVerificationDetails(), OpenAIUtils.buildHeaders, n), _this25.insertKeyPlaceholderText = "OpenAI API Key", _this25.getKeyLink = "https://platform.openai.com/account/api-keys", _this25.url = "https://api.openai.com/v1/chat/completions", _this25.permittedErrorPrefixes = ["Incorrect"], _this25._systemMessage = OpenAIChatIO.generateSystemMessage("You are a helpful assistant.");
6412
+ var s = (o = t.openAI) == null ? void 0 : o.chat;
6413
+ _typeof(s) == "object" && (s.system_prompt && (_this25._systemMessage = OpenAIChatIO.generateSystemMessage(s.system_prompt)), _this25.cleanConfig(s), Object.assign(_this25.rawBody, s)), _this25.maxMessages === void 0 && (_this25.maxMessages = -1), (_a$model = (a = _this25.rawBody).model) !== null && _a$model !== void 0 ? _a$model : a.model = OpenAIConverseBaseBody.GPT_CHAT_TURBO_MODEL;
6397
6414
  return _this25;
6398
6415
  }
6399
6416
  _createClass(OpenAIChatIO, [{
6400
6417
  key: "cleanConfig",
6401
6418
  value: function cleanConfig(e) {
6402
- delete e.systemPrompt;
6419
+ delete e.system_prompt;
6403
6420
  }
6404
6421
  // prettier-ignore
6405
6422
  }, {
@@ -6490,10 +6507,11 @@ var CohereChatIO = /*#__PURE__*/function (_CohereIO3) {
6490
6507
  function CohereChatIO(e) {
6491
6508
  var _this26;
6492
6509
  _classCallCheck(this, CohereChatIO);
6493
- var s, o, a;
6494
- var t = (o = (s = e.directConnection) == null ? void 0 : s.cohere) == null ? void 0 : o.chat,
6495
- n = (a = e.directConnection) == null ? void 0 : a.cohere;
6496
- _this26 = _super33.call(this, e, "https://api.cohere.ai/v1/chat", "Ask me anything!", t, n), _this26.username = "USER", _typeof(t) == "object" && (t.user_name && (_this26.username = t.user_name), _this26.cleanConfig(t), Object.assign(_this26.rawBody, t)), _this26.maxMessages === void 0 && (_this26.maxMessages = -1);
6510
+ var o;
6511
+ var t = JSON.parse(JSON.stringify(e.directConnection)),
6512
+ n = (o = t.cohere) == null ? void 0 : o.chat,
6513
+ s = t.cohere;
6514
+ _this26 = _super33.call(this, e, "https://api.cohere.ai/v1/chat", "Ask me anything!", n, s), _this26.username = "USER", _typeof(n) == "object" && (n.user_name && (_this26.username = n.user_name), _this26.cleanConfig(n), Object.assign(_this26.rawBody, n)), _this26.maxMessages === void 0 && (_this26.maxMessages = -1);
6497
6515
  return _this26;
6498
6516
  }
6499
6517
  _createClass(CohereChatIO, [{
@@ -6578,7 +6596,8 @@ var ServiceIOFactory = /*#__PURE__*/function () {
6578
6596
  key: "create",
6579
6597
  value: function create(e) {
6580
6598
  var t = e.directConnection,
6581
- n = e.request;
6599
+ n = e.request,
6600
+ s = e.demo;
6582
6601
  if (t) {
6583
6602
  if (t.openAI) return t.openAI.images ? new OpenAIImagesIO(e) : t.openAI.audio ? new OpenAIAudioIO(e) : t.openAI.completions ? new OpenAICompletionsIO(e) : new OpenAIChatIO(e);
6584
6603
  if (t.assemblyAI) return new AssemblyAIAudioIO(e);
@@ -6591,9 +6610,8 @@ var ServiceIOFactory = /*#__PURE__*/function () {
6591
6610
  if (t.azure.translation) return new AzureTranslationIO(e);
6592
6611
  }
6593
6612
  if (t.stabilityAI) return t.stabilityAI.imageToImage ? new StabilityAIImageToImageIO(e) : t.stabilityAI.imageToImageUpscale ? new StabilityAIImageToImageUpscaleIO(e) : t.stabilityAI.imageToImageMasking ? new StabilityAIImageToImageMaskingIO(e) : new StabilityAITextToImageIO(e);
6594
- if (t.demo && !(n != null && n.url)) return new BaseServiceIO(e, void 0, t.demo);
6595
6613
  }
6596
- return new BaseServiceIO(e);
6614
+ return n ? new BaseServiceIO(e) : new BaseServiceIO(e, void 0, s || !0);
6597
6615
  }
6598
6616
  }]);
6599
6617
  return ServiceIOFactory;
@@ -6810,8 +6828,8 @@ var MessageStyleUtils = /*#__PURE__*/function () {
6810
6828
  media: {}
6811
6829
  };
6812
6830
  return e.forEach(function (o) {
6813
- var a, l, c, u;
6814
- s.outerContainer[o] = ((a = n.outerContainer) == null ? void 0 : a[o]) || "", s.innerContainer[o] = ((l = n.innerContainer) == null ? void 0 : l[o]) || "", s.bubble[o] = ((c = n.bubble) == null ? void 0 : c[o]) || "", s.media[o] = ((u = n.media) == null ? void 0 : u[o]) || "";
6831
+ var a, l, c, d;
6832
+ s.outerContainer[o] = ((a = n.outerContainer) == null ? void 0 : a[o]) || "", s.innerContainer[o] = ((l = n.innerContainer) == null ? void 0 : l[o]) || "", s.bubble[o] = ((c = n.bubble) == null ? void 0 : c[o]) || "", s.media[o] = ((d = n.media) == null ? void 0 : d[o]) || "";
6815
6833
  }), s;
6816
6834
  }
6817
6835
  }]);
@@ -6904,6 +6922,22 @@ var _FileMessageUtils = /*#__PURE__*/function () {
6904
6922
  }();
6905
6923
  _FileMessageUtils.DEFAULT_FILE_NAME = "file";
6906
6924
  var FileMessageUtils = _FileMessageUtils;
6925
+ var SetupMessages = /*#__PURE__*/function () {
6926
+ function SetupMessages() {
6927
+ _classCallCheck(this, SetupMessages);
6928
+ }
6929
+ _createClass(SetupMessages, null, [{
6930
+ key: "getText",
6931
+ value: function getText(e, t) {
6932
+ if (!e.directConnection && !e.request && !e.demo) return "Connect to any API using the [request](https://deepchat.dev/docs/connect#Request)\n property or choose any one of the preconfigured APIs via\n the [directConnection](https://deepchat.dev/docs/directConnection/#directConnection) property.\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.";
6933
+ if (e.directConnection) {
6934
+ if (!t.isDirectConnection()) return "Please define a valid service inside\n the [directConnection](https://deepchat.dev/docs/directConnection/#directConnection) object.";
6935
+ } else if (e.request && !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.";
6936
+ return null;
6937
+ }
6938
+ }]);
6939
+ return SetupMessages;
6940
+ }();
6907
6941
  var FILE_ICON_STRING = "<?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>";
6908
6942
  var FileMessages = /*#__PURE__*/function () {
6909
6943
  function FileMessages() {
@@ -7011,9 +7045,9 @@ var AvatarEl = /*#__PURE__*/function () {
7011
7045
  key: "getPosition",
7012
7046
  value: function getPosition(e, t) {
7013
7047
  var _n, _n2;
7014
- var s, o, a, l, c, u;
7048
+ var s, o, a, l, c, d;
7015
7049
  var n = e ? (o = (s = t == null ? void 0 : t.ai) == null ? void 0 : s.styles) == null ? void 0 : o.position : (l = (a = t == null ? void 0 : t.user) == null ? void 0 : a.styles) == null ? void 0 : l.position;
7016
- return (_n = n) !== null && _n !== void 0 ? _n : n = (u = (c = t == null ? void 0 : t["default"]) == null ? void 0 : c.styles) == null ? void 0 : u.position, (_n2 = n) !== null && _n2 !== void 0 ? _n2 : n = e ? "left" : "right", n;
7050
+ return (_n = n) !== null && _n !== void 0 ? _n : n = (d = (c = t == null ? void 0 : t["default"]) == null ? void 0 : c.styles) == null ? void 0 : d.position, (_n2 = n) !== null && _n2 !== void 0 ? _n2 : n = e ? "left" : "right", n;
7017
7051
  }
7018
7052
  }, {
7019
7053
  key: "add",
@@ -7075,10 +7109,10 @@ var Messages = /*#__PURE__*/function () {
7075
7109
  var s = t.permittedErrorPrefixes,
7076
7110
  o = t.introPanelMarkUp,
7077
7111
  a = t.demo;
7078
- this._remarkable = RemarkableConfig.createNew(), this.elementRef = Messages.createContainerElement(), this.messageStyles = e.messageStyles, this._avatars = e.avatars, this._names = e.names, this._errorMessageOverrides = (l = e.errorMessages) == null ? void 0 : l.overrides, this._onNewMessage = FireEvents.onNewMessage.bind(this, e), this._onClearMessages = FireEvents.onClearMessages.bind(this, e), this._displayLoadingMessage = Messages.getDisplayLoadingMessage(e, t), this._permittedErrorPrefixes = s, this.populateIntroPanel(n, o, e.introPanelStyle), e.introMessage && this.addIntroductoryMessage(e.introMessage), e.initialMessages && this.populateInitialMessages(e.initialMessages), this.displayServiceErrorMessages = (c = e.errorMessages) == null ? void 0 : c.displayServiceErrorMessages, e.getMessages = function () {
7112
+ this._remarkable = RemarkableConfig.createNew(), this.elementRef = Messages.createContainerElement(), this.messageStyles = e.messageStyles, this._avatars = e.avatars, this._names = e.names, this._errorMessageOverrides = (l = e.errorMessages) == null ? void 0 : l.overrides, this._onNewMessage = FireEvents.onNewMessage.bind(this, e), this._onClearMessages = FireEvents.onClearMessages.bind(this, e), this._displayLoadingMessage = Messages.getDisplayLoadingMessage(e, t), this._permittedErrorPrefixes = s, this.addSetupMessageIfNeeded(e, t), this.populateIntroPanel(n, o, e.introPanelStyle), e.introMessage && this.addIntroductoryMessage(e.introMessage), e.initialMessages && this.populateInitialMessages(e.initialMessages), this.displayServiceErrorMessages = (c = e.errorMessages) == null ? void 0 : c.displayServiceErrorMessages, e.getMessages = function () {
7079
7113
  return JSON.parse(JSON.stringify(_this28.messages));
7080
- }, e.clearMessages = this.clearMessages.bind(this), e.refreshMessages = this.refreshTextMessages.bind(this), a && this.prepareDemo(a), e.textToSpeech && TextToSpeech.processConfig(e.textToSpeech, function (u) {
7081
- _this28._textToSpeech = u;
7114
+ }, e.clearMessages = this.clearMessages.bind(this), e.refreshMessages = this.refreshTextMessages.bind(this), a && this.prepareDemo(a), e.textToSpeech && TextToSpeech.processConfig(e.textToSpeech, function (d) {
7115
+ _this28._textToSpeech = d;
7082
7116
  });
7083
7117
  }
7084
7118
  _createClass(Messages, [{
@@ -7086,6 +7120,15 @@ var Messages = /*#__PURE__*/function () {
7086
7120
  value: function prepareDemo(e) {
7087
7121
  _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());
7088
7122
  }
7123
+ }, {
7124
+ key: "addSetupMessageIfNeeded",
7125
+ value: function addSetupMessageIfNeeded(e, t) {
7126
+ var n = SetupMessages.getText(e, t);
7127
+ if (n) {
7128
+ var s = this.createAndAppendNewMessageElement(n, !0);
7129
+ this.applyCustomStyles(s, !0, !1);
7130
+ }
7131
+ }
7089
7132
  }, {
7090
7133
  key: "addIntroductoryMessage",
7091
7134
  value: function addIntroductoryMessage(e) {
@@ -7183,15 +7226,15 @@ var Messages = /*#__PURE__*/function () {
7183
7226
  }, {
7184
7227
  key: "addNewErrorMessage",
7185
7228
  value: function addNewErrorMessage(e, t) {
7186
- var c, u, d, h;
7229
+ var c, d, u, h;
7187
7230
  this.removeMessageOnError();
7188
7231
  var n = Messages.createBaseElements(),
7189
7232
  s = n.outerContainer,
7190
7233
  o = n.bubbleElement;
7191
7234
  o.classList.add("error-message-text");
7192
- var a = this.getPermittedMessage(t) || ((c = this._errorMessageOverrides) == null ? void 0 : c[e]) || ((u = this._errorMessageOverrides) == null ? void 0 : u["default"]) || "Error, please try again.";
7235
+ var a = this.getPermittedMessage(t) || ((c = this._errorMessageOverrides) == null ? void 0 : c[e]) || ((d = this._errorMessageOverrides) == null ? void 0 : d["default"]) || "Error, please try again.";
7193
7236
  o.innerHTML = a;
7194
- var l = MessageStyleUtils.extractParticularSharedStyles(["fontSize", "fontFamily"], (d = this.messageStyles) == null ? void 0 : d["default"]);
7237
+ var l = MessageStyleUtils.extractParticularSharedStyles(["fontSize", "fontFamily"], (u = this.messageStyles) == null ? void 0 : u["default"]);
7195
7238
  MessageStyleUtils.applyCustomStylesToElements(n, !1, l), MessageStyleUtils.applyCustomStylesToElements(n, !1, (h = this.messageStyles) == null ? void 0 : h.error), this.elementRef.appendChild(s), this.elementRef.scrollTop = this.elementRef.scrollHeight, this._textToSpeech && TextToSpeech.speak(a, this._textToSpeech), this._streamedText = "";
7196
7239
  }
7197
7240
  }, {
@@ -7257,8 +7300,8 @@ var Messages = /*#__PURE__*/function () {
7257
7300
  var s, o, a, l, c;
7258
7301
  var n = ElementUtils.isScrollbarAtBottomOfElement(this.elementRef);
7259
7302
  if (e.trim().length !== 0) {
7260
- var u = (s = this.messageStyles) == null ? void 0 : s["default"];
7261
- t.style.color = ((a = (o = u == null ? void 0 : u.ai) == null ? void 0 : o.bubble) == null ? void 0 : a.color) || ((c = (l = u == null ? void 0 : u.shared) == null ? void 0 : l.bubble) == null ? void 0 : c.color) || "";
7303
+ var d = (s = this.messageStyles) == null ? void 0 : s["default"];
7304
+ t.style.color = ((a = (o = d == null ? void 0 : d.ai) == null ? void 0 : o.bubble) == null ? void 0 : a.color) || ((c = (l = d == null ? void 0 : d.shared) == null ? void 0 : l.bubble) == null ? void 0 : c.color) || "";
7262
7305
  }
7263
7306
  this._streamedText += e, t.innerHTML = this._remarkable.render(this._streamedText), n && (this.elementRef.scrollTop = this.elementRef.scrollHeight);
7264
7307
  }
@@ -7324,9 +7367,8 @@ var Messages = /*#__PURE__*/function () {
7324
7367
  var a = o.bubbleElement.classList;
7325
7368
  a.contains("loading-message-text") || a.contains("streamed-message") ? t.push(o) : o.outerContainer.remove();
7326
7369
  }), Array.from(this.elementRef.children).forEach(function (o) {
7327
- var l, c;
7328
- console.log((l = o.children[0]) == null ? void 0 : l.children[0]);
7329
- var a = (c = o.children[0]) == null ? void 0 : c.children[0];
7370
+ var l;
7371
+ var a = (l = o.children[0]) == null ? void 0 : l.children[0];
7330
7372
  a != null && a.classList.contains("error-message-text") && o.remove();
7331
7373
  }), this._messageElementRefs = t, e !== !1 && ((n = this._introPanel) != null && n._elementRef && this._introPanel.display(), this.addIntroductoryMessage()), this.messages.splice(0, this.messages.length), (s = this._onClearMessages) == null || s.call(this);
7332
7374
  }
@@ -7389,10 +7431,10 @@ var Messages = /*#__PURE__*/function () {
7389
7431
  return Messages;
7390
7432
  }();
7391
7433
  var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
7392
- function T() {
7393
- _classCallCheck(this, T);
7434
+ function C() {
7435
+ _classCallCheck(this, C);
7394
7436
  }
7395
- _createClass(T, null, [{
7437
+ _createClass(C, null, [{
7396
7438
  key: "adjustInputPadding",
7397
7439
  value: function adjustInputPadding(e, t) {
7398
7440
  t["inside-left"].length > 0 && e.classList.add("text-input-inner-left-adjustment"), t["inside-right"].length > 0 && e.classList.add("text-input-inner-right-adjustment");
@@ -7400,7 +7442,7 @@ var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
7400
7442
  }, {
7401
7443
  key: "adjustForOutsideButton",
7402
7444
  value: function adjustForOutsideButton(e, t, n) {
7403
- n["outside-right"].length === 0 && n["outside-left"].length > 0 ? (e[0].classList.add(T.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS)) : n["outside-left"].length === 0 && n["outside-right"].length > 0 && (e[3].classList.add(T.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS));
7445
+ n["outside-right"].length === 0 && n["outside-left"].length > 0 ? (e[0].classList.add(C.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS), t.classList.add(C.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS)) : n["outside-left"].length === 0 && n["outside-right"].length > 0 && (e[3].classList.add(C.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS), t.classList.add(C.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS));
7404
7446
  }
7405
7447
  // when submit is the only button
7406
7448
  // when submit button is outside by itself - we increase the height for a better look
@@ -7408,10 +7450,10 @@ var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
7408
7450
  key: "adjustOutsideSubmit",
7409
7451
  value: function adjustOutsideSubmit(e, t, n) {
7410
7452
  if (!(n["inside-left"].length > 0 || n["inside-right"].length > 0)) {
7411
- if (n["outside-right"].length === 0 && n["outside-left"].length > 0) return e[0].classList.add(T.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), n["outside-left"].map(function (s) {
7453
+ if (n["outside-right"].length === 0 && n["outside-left"].length > 0) return e[0].classList.add(C.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), t.classList.add(C.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), n["outside-left"].map(function (s) {
7412
7454
  return s.button.elementRef.classList.add("submit-button-enlarged");
7413
7455
  });
7414
- if (n["outside-left"].length === 0 && n["outside-right"].length > 0) return e[3].classList.add(T.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), n["outside-right"].map(function (s) {
7456
+ if (n["outside-left"].length === 0 && n["outside-right"].length > 0) return e[3].classList.add(C.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), t.classList.add(C.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), n["outside-right"].map(function (s) {
7415
7457
  return s.button.elementRef.classList.add("submit-button-enlarged");
7416
7458
  });
7417
7459
  }
@@ -7419,10 +7461,10 @@ var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
7419
7461
  }, {
7420
7462
  key: "set",
7421
7463
  value: function set(e, t, n, s) {
7422
- !!T.adjustOutsideSubmit(t, n, s) || T.adjustForOutsideButton(t, n, s), T.adjustInputPadding(e, s);
7464
+ !!C.adjustOutsideSubmit(t, n, s) || C.adjustForOutsideButton(t, n, s), C.adjustInputPadding(e, s);
7423
7465
  }
7424
7466
  }]);
7425
- return T;
7467
+ return C;
7426
7468
  }();
7427
7469
  _InputButtonStyleAdjustments.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS = "text-input-container-left-adjustment";
7428
7470
  _InputButtonStyleAdjustments.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS = "text-input-container-right-adjustment";
@@ -7846,11 +7888,11 @@ var InputButtonPositions = /*#__PURE__*/function () {
7846
7888
  function addToDropup(e, t, n, s) {
7847
7889
  var o = new Dropup(n, s);
7848
7890
  BUTTON_ORDER.forEach(function (l) {
7849
- var c = t["dropup-menu"].findIndex(function (d) {
7850
- return d.buttonType === l;
7891
+ var c = t["dropup-menu"].findIndex(function (u) {
7892
+ return u.buttonType === l;
7851
7893
  }),
7852
- u = t["dropup-menu"][c];
7853
- u && (o.addItem(u.button), t["dropup-menu"].splice(c, 1));
7894
+ d = t["dropup-menu"][c];
7895
+ d && (o.addItem(d.button), t["dropup-menu"].splice(c, 1));
7854
7896
  });
7855
7897
  var a = Dropup.getPosition(t, s);
7856
7898
  ButtonContainers.addButton(e, o.buttonContainer, a), t[a].push({});
@@ -8289,11 +8331,11 @@ var FileAttachments = /*#__PURE__*/function () {
8289
8331
  return FileAttachments;
8290
8332
  }();
8291
8333
  var _Modal = /*#__PURE__*/function () {
8292
- function w(e, t, n) {
8293
- _classCallCheck(this, w);
8294
- this._isOpen = !1, this._contentRef = w.createModalContent(t, n == null ? void 0 : n.backgroundColor), this._buttonPanel = w.createButtonPanel(n == null ? void 0 : n.backgroundColor), this._elementRef = w.createContainer(this._contentRef, n), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = w.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents();
8334
+ function T(e, t, n) {
8335
+ _classCallCheck(this, T);
8336
+ this._isOpen = !1, this._contentRef = T.createModalContent(t, n == null ? void 0 : n.backgroundColor), this._buttonPanel = T.createButtonPanel(n == null ? void 0 : n.backgroundColor), this._elementRef = T.createContainer(this._contentRef, n), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = T.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents();
8295
8337
  }
8296
- _createClass(w, [{
8338
+ _createClass(T, [{
8297
8339
  key: "isOpen",
8298
8340
  value: function isOpen() {
8299
8341
  return this._isOpen;
@@ -8315,7 +8357,7 @@ var _Modal = /*#__PURE__*/function () {
8315
8357
  var _this40 = this;
8316
8358
  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 () {
8317
8359
  _this40._elementRef.style.display = "none", _this40._backgroundPanelRef.style.display = "none";
8318
- }, w.MODAL_CLOSE_TIMEOUT_MS);
8360
+ }, T.MODAL_CLOSE_TIMEOUT_MS);
8319
8361
  }
8320
8362
  }, {
8321
8363
  key: "displayModalElements",
@@ -8331,7 +8373,7 @@ var _Modal = /*#__PURE__*/function () {
8331
8373
  key: "addCloseButton",
8332
8374
  value: function addCloseButton(e, t, n) {
8333
8375
  var _this41 = this;
8334
- var s = t ? w.createSVGButton(e) : w.createTextButton(e);
8376
+ var s = t ? T.createSVGButton(e) : T.createTextButton(e);
8335
8377
  return this.addButtons(s), s.onclick = function () {
8336
8378
  _this41.close(), setTimeout(function () {
8337
8379
  n == null || n();
@@ -8391,12 +8433,12 @@ var _Modal = /*#__PURE__*/function () {
8391
8433
  value: function createTextModalFunc(e, t, n) {
8392
8434
  var s;
8393
8435
  if (_typeof(t) == "object" && (s = t.files) != null && s.infoModal) {
8394
- var o = new w(e, ["modal-content"], t.files.infoModal.containerStyle);
8436
+ var o = new T(e, ["modal-content"], t.files.infoModal.containerStyle);
8395
8437
  return o.addCloseButton("OK", !1, n), o.openTextModal.bind(o, t.infoModalTextMarkUp || "");
8396
8438
  }
8397
8439
  }
8398
8440
  }]);
8399
- return w;
8441
+ return T;
8400
8442
  }();
8401
8443
  _Modal.MODAL_CLOSE_TIMEOUT_MS = 190;
8402
8444
  var Modal = _Modal;
@@ -8407,10 +8449,10 @@ var UploadFileButton = /*#__PURE__*/function (_InputButton2) {
8407
8449
  function UploadFileButton(e, t, n, s, o, a) {
8408
8450
  var _this43;
8409
8451
  _classCallCheck(this, UploadFileButton);
8410
- var c, u, d, h, f, p;
8452
+ var c, d, u, h, f, p;
8411
8453
  _this43 = _super36.call(this, UploadFileButton.createButtonElement(), (c = n.button) == null ? void 0 : c.position, n.button, a);
8412
8454
  var l = _this43.createInnerElements(s, o, _this43._customStyles);
8413
- _this43._inputElement = UploadFileButton.createInputElement((u = n == null ? void 0 : n.files) == null ? void 0 : u.acceptedFormats), _this43.addClickEvent(e, n), _this43.elementRef.replaceChildren(l.styles), _this43.reapplyStateStyle("styles"), _this43._fileAttachmentsType = t, _this43._openModalOnce = ((h = (d = n.files) == null ? void 0 : d.infoModal) == null ? void 0 : h.openModalOnce) === !1 || (p = (f = n.files) == null ? void 0 : f.infoModal) == null ? void 0 : p.openModalOnce;
8455
+ _this43._inputElement = UploadFileButton.createInputElement((d = n == null ? void 0 : n.files) == null ? void 0 : d.acceptedFormats), _this43.addClickEvent(e, n), _this43.elementRef.replaceChildren(l.styles), _this43.reapplyStateStyle("styles"), _this43._fileAttachmentsType = t, _this43._openModalOnce = ((h = (u = n.files) == null ? void 0 : u.infoModal) == null ? void 0 : h.openModalOnce) === !1 || (p = (f = n.files) == null ? void 0 : f.infoModal) == null ? void 0 : p.openModalOnce;
8414
8456
  return _this43;
8415
8457
  }
8416
8458
  _createClass(UploadFileButton, [{
@@ -9041,35 +9083,35 @@ var CommandUtils = /*#__PURE__*/function () {
9041
9083
  key: "execCommand",
9042
9084
  value: function execCommand(e, t, n, s, o) {
9043
9085
  var a, l, c;
9044
- var u = e.commands;
9045
- if (!u || !s || !n) return;
9046
- var d = ((a = u.settings) === null || a === void 0 ? void 0 : a.caseSensitive) === !0 ? t : t.toLowerCase(),
9047
- h = text_1$2.Text.breakupIntoWordsArr(d),
9048
- f = ((l = u.settings) === null || l === void 0 ? void 0 : l.substrings) === !1 ? CommandUtils.checkIfMatchesWord : CommandUtils.checkIfMatchesSubstring;
9049
- if (u.commandMode && f(u.commandMode, d, h)) return e.setInterimColorToFinal(), setTimeout(function () {
9086
+ var d = e.commands;
9087
+ if (!d || !s || !n) return;
9088
+ var u = ((a = d.settings) === null || a === void 0 ? void 0 : a.caseSensitive) === !0 ? t : t.toLowerCase(),
9089
+ h = text_1$2.Text.breakupIntoWordsArr(u),
9090
+ f = ((l = d.settings) === null || l === void 0 ? void 0 : l.substrings) === !1 ? CommandUtils.checkIfMatchesWord : CommandUtils.checkIfMatchesSubstring;
9091
+ if (d.commandMode && f(d.commandMode, u, h)) return e.setInterimColorToFinal(), setTimeout(function () {
9050
9092
  return CommandUtils.toggleCommandModeOn(e);
9051
9093
  }), {
9052
9094
  doNotProcessTranscription: !1
9053
9095
  };
9054
- if (!(u.commandMode && !e.isWaitingForCommand)) {
9055
- if (u.stop && f(u.stop, d, h)) return CommandUtils.toggleCommandModeOff(e), setTimeout(function () {
9096
+ if (!(d.commandMode && !e.isWaitingForCommand)) {
9097
+ if (d.stop && f(d.stop, u, h)) return CommandUtils.toggleCommandModeOff(e), setTimeout(function () {
9056
9098
  return e.stop();
9057
9099
  }), {
9058
9100
  doNotProcessTranscription: !1
9059
9101
  };
9060
- if (u.pause && f(u.pause, d, h)) return CommandUtils.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
9102
+ if (d.pause && f(d.pause, u, h)) return CommandUtils.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
9061
9103
  var p;
9062
9104
  e.isPaused = !0, (p = e.onPauseTrigger) === null || p === void 0 || p.call(e, !0);
9063
9105
  }), {
9064
9106
  doNotProcessTranscription: !1
9065
9107
  };
9066
- if (u.resume && f(u.resume, d, h)) return e.isPaused = !1, (c = e.onPauseTrigger) === null || c === void 0 || c.call(e, !1), CommandUtils.toggleCommandModeOff(e), e.resetRecording(n), {
9108
+ if (d.resume && f(d.resume, u, h)) return e.isPaused = !1, (c = e.onPauseTrigger) === null || c === void 0 || c.call(e, !1), CommandUtils.toggleCommandModeOff(e), e.resetRecording(n), {
9067
9109
  doNotProcessTranscription: !0
9068
9110
  };
9069
- if (u.reset && f(u.reset, d, h)) return o !== void 0 && CommandUtils.setText(e, n, o, s), {
9111
+ if (d.reset && f(d.reset, u, h)) return o !== void 0 && CommandUtils.setText(e, n, o, s), {
9070
9112
  doNotProcessTranscription: !0
9071
9113
  };
9072
- if (u.removeAllText && f(u.removeAllText, d, h)) return CommandUtils.setText(e, n, "", s), {
9114
+ if (d.removeAllText && f(d.removeAllText, u, h)) return CommandUtils.setText(e, n, "", s), {
9073
9115
  doNotProcessTranscription: !0
9074
9116
  };
9075
9117
  }
@@ -9169,10 +9211,10 @@ var Padding = /*#__PURE__*/function () {
9169
9211
  var l = window.getSelection();
9170
9212
  if (l != null && l.focusNode) {
9171
9213
  var c = cursor_1$1.Cursor.getGenericElementCursorOffset(t, l, !0),
9172
- u = (n = t.textContent) === null || n === void 0 ? void 0 : n[c - 1],
9173
- d = cursor_1$1.Cursor.getGenericElementCursorOffset(t, l, !1),
9174
- h = (s = t.textContent) === null || s === void 0 ? void 0 : s[d];
9175
- text_1$1.Text.isCharDefined(u) && (e.startPadding = " "), text_1$1.Text.isCharDefined(h) && (e.endPadding = " "), e.isCursorAtEnd = ((o = t.textContent) === null || o === void 0 ? void 0 : o.length) === d;
9214
+ d = (n = t.textContent) === null || n === void 0 ? void 0 : n[c - 1],
9215
+ u = cursor_1$1.Cursor.getGenericElementCursorOffset(t, l, !1),
9216
+ h = (s = t.textContent) === null || s === void 0 ? void 0 : s[u];
9217
+ text_1$1.Text.isCharDefined(d) && (e.startPadding = " "), text_1$1.Text.isCharDefined(h) && (e.endPadding = " "), e.isCursorAtEnd = ((o = t.textContent) === null || o === void 0 ? void 0 : o.length) === u;
9176
9218
  return;
9177
9219
  }
9178
9220
  }
@@ -9854,7 +9896,7 @@ var SpeechToText = /*#__PURE__*/function (_MicrophoneButton) {
9854
9896
  key: "processConfiguration",
9855
9897
  value: function processConfiguration(e, t) {
9856
9898
  var _n$displayInterimResu, _n$textColor, _n$translations, _n$commands;
9857
- var u;
9899
+ var d;
9858
9900
  var n = _typeof(t) == "object" ? t : {},
9859
9901
  s = _typeof(n.webSpeech) == "object" ? n.webSpeech : {},
9860
9902
  o = n.azure || {},
@@ -9864,9 +9906,9 @@ var SpeechToText = /*#__PURE__*/function (_MicrophoneButton) {
9864
9906
  translations: (_n$translations = n.translations) !== null && _n$translations !== void 0 ? _n$translations : void 0,
9865
9907
  commands: (_n$commands = n.commands) !== null && _n$commands !== void 0 ? _n$commands : void 0
9866
9908
  }, s), o),
9867
- l = (u = n.commands) == null ? void 0 : u.submit;
9868
- return l && (a.onPreResult = function (d) {
9869
- return d.toLowerCase().includes(l) ? (setTimeout(function () {
9909
+ l = (d = n.commands) == null ? void 0 : d.submit;
9910
+ return l && (a.onPreResult = function (u) {
9911
+ return u.toLowerCase().includes(l) ? (setTimeout(function () {
9870
9912
  var h;
9871
9913
  return (h = e.submit) == null ? void 0 : h.call(e);
9872
9914
  }), _default.endCommandMode(), {
@@ -10010,10 +10052,10 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
10010
10052
  value:
10011
10053
  // prettier-ignore
10012
10054
  function attemptOverwriteLoadingStyle(e) {
10013
- var t, n, s, o, a, l, c, u, d;
10014
- if (!((n = (t = this._customStyles) == null ? void 0 : t.submit) != null && n.svg || (a = (o = (s = this._customStyles) == null ? void 0 : s.loading) == null ? void 0 : o.svg) != null && a.content || (u = (c = (l = this._customStyles) == null ? void 0 : l.loading) == null ? void 0 : c.text) != null && u.content) && (e.displayLoadingBubble === void 0 || e.displayLoadingBubble === !0)) {
10055
+ var t, n, s, o, a, l, c, d, u;
10056
+ if (!((n = (t = this._customStyles) == null ? void 0 : t.submit) != null && n.svg || (a = (o = (s = this._customStyles) == null ? void 0 : s.loading) == null ? void 0 : o.svg) != null && a.content || (d = (c = (l = this._customStyles) == null ? void 0 : l.loading) == null ? void 0 : c.text) != null && d.content) && (e.displayLoadingBubble === void 0 || e.displayLoadingBubble === !0)) {
10015
10057
  var h = document.createElement("style");
10016
- h.textContent = "\n .loading-button > * {\n filter: brightness(0) saturate(100%) invert(72%) sepia(0%) saturate(3044%) hue-rotate(322deg) brightness(100%)\n contrast(96%) !important;\n }", (d = e.shadowRoot) == null || d.appendChild(h), this._isSVGLoadingIconOverriden = !0;
10058
+ h.textContent = "\n .loading-button > * {\n filter: brightness(0) saturate(100%) invert(72%) sepia(0%) saturate(3044%) hue-rotate(322deg) brightness(100%)\n contrast(96%) !important;\n }", (u = e.shadowRoot) == null || u.appendChild(h), this._isSVGLoadingIconOverriden = !0;
10017
10059
  }
10018
10060
  }
10019
10061
  }, {
@@ -10060,8 +10102,8 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
10060
10102
  return this._fileAttachments.completePlaceholders();
10061
10103
  case 4:
10062
10104
  n = this._fileAttachments.getAllFileData();
10063
- s = n == null ? void 0 : n.map(function (u) {
10064
- return u.file;
10105
+ s = n == null ? void 0 : n.map(function (d) {
10106
+ return d.file;
10065
10107
  });
10066
10108
  case 6:
10067
10109
  o = t === "" ? void 0 : t;
@@ -10134,6 +10176,7 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
10134
10176
  value: function changeToStopIcon() {
10135
10177
  this.elementRef.classList.remove("loading-button"), this.elementRef.replaceChildren(this._innerElements.stop), this.reapplyStateStyle("stop", ["loading", "submit"]), this.elementRef.onclick = this.stopStream.bind(this), this._isLoadingActive = !1;
10136
10178
  }
10179
+ // WORK - animation needs to be lowered
10137
10180
  }, {
10138
10181
  key: "changeToLoadingIcon",
10139
10182
  value: function changeToLoadingIcon() {
@@ -10359,18 +10402,18 @@ var Input = /*#__PURE__*/function () {
10359
10402
  value:
10360
10403
  // prettier-ignore
10361
10404
  function createFileUploadComponents(e, t, n, s) {
10362
- var a, l, c, u;
10405
+ var a, l, c, d;
10363
10406
  var o = new FileAttachments(this.elementRef, e.attachmentContainerStyle, t.demo);
10364
10407
  if (Input.createUploadButtons(t.fileTypes || {}, o, n, s), (a = t.camera) != null && a.files) {
10365
- var d = ((l = s.images) == null ? void 0 : l.fileType) || o.addType(t.camera.files, "images");
10408
+ var u = ((l = s.images) == null ? void 0 : l.fileType) || o.addType(t.camera.files, "images");
10366
10409
  s.camera = {
10367
- button: new CameraButton(n, d, t.camera)
10410
+ button: new CameraButton(n, u, t.camera)
10368
10411
  };
10369
10412
  }
10370
10413
  if ((c = t.recordAudio) != null && c.files) {
10371
- var _d = ((u = s.audio) == null ? void 0 : u.fileType) || o.addType(t.recordAudio.files, "audio");
10414
+ var _u = ((d = s.audio) == null ? void 0 : d.fileType) || o.addType(t.recordAudio.files, "audio");
10372
10415
  s.microphone = {
10373
- button: new RecordAudio(_d, t.recordAudio)
10416
+ button: new RecordAudio(_u, t.recordAudio)
10374
10417
  };
10375
10418
  }
10376
10419
  return DragAndDrop.isEnabled(o, e.dragAndDrop) && DragAndDrop.create(n, o, e.dragAndDrop), o;
@@ -10391,10 +10434,10 @@ var Input = /*#__PURE__*/function () {
10391
10434
  if (l.files) {
10392
10435
  var c = t.addType(l.files, a),
10393
10436
  _FILE_TYPE_BUTTON_ICO = FILE_TYPE_BUTTON_ICONS[a],
10394
- u = _FILE_TYPE_BUTTON_ICO.id,
10395
- d = _FILE_TYPE_BUTTON_ICO.svgString,
10437
+ d = _FILE_TYPE_BUTTON_ICO.id,
10438
+ u = _FILE_TYPE_BUTTON_ICO.svgString,
10396
10439
  h = _FILE_TYPE_BUTTON_ICO.dropupText,
10397
- f = new UploadFileButton(n, c, l, u, d, h);
10440
+ f = new UploadFileButton(n, c, l, d, u, h);
10398
10441
  s[a] = {
10399
10442
  button: f,
10400
10443
  fileType: c
@@ -10474,8 +10517,7 @@ var DeepChat = /*#__PURE__*/function (_InternalHTML2) {
10474
10517
  key: "onRender",
10475
10518
  value: function onRender() {
10476
10519
  var _this$_activeService, _this$_childElement;
10477
- var e, t, n;
10478
- (_this$_activeService = this._activeService) !== null && _this$_activeService !== void 0 ? _this$_activeService : this._activeService = ServiceIOFactory.create(this), this._activeService && (this.auxiliaryStyle && !this._auxiliaryStyleApplied && (WebComponentStyleUtils.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Object.assign(this._elementRef.style, this.containerStyle), this._activeService.key && this._activeService.validateConfigKey ? ValidateKeyPropertyView.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : this._activeService instanceof DirectServiceIO && this._activeService.key || (e = this.request) != null && e.url || (t = this.request) != null && t.handler || (n = this.directConnection) != null && n.demo ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], ChatView.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof DirectServiceIO ? InsertKeyView.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : ErrorView.render(this._elementRef, 'Please define "request" with a "url"'), this._hasBeenRendered = !0, FireEvents.onRender(this));
10520
+ (_this$_activeService = this._activeService) !== null && _this$_activeService !== void 0 ? _this$_activeService : this._activeService = ServiceIOFactory.create(this), this._activeService && (this.auxiliaryStyle && !this._auxiliaryStyleApplied && (WebComponentStyleUtils.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Object.assign(this._elementRef.style, this.containerStyle), this._activeService.key && this._activeService.validateConfigKey ? ValidateKeyPropertyView.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof DirectServiceIO) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], ChatView.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof DirectServiceIO && InsertKeyView.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, FireEvents.onRender(this));
10479
10521
  }
10480
10522
  }]);
10481
10523
  return DeepChat;
@@ -10514,5 +10556,6 @@ __decorateClass([Property("object")], DeepChat.prototype, "introPanelStyle", 2);
10514
10556
  __decorateClass([Property("function")], DeepChat.prototype, "onNewMessage", 2);
10515
10557
  __decorateClass([Property("function")], DeepChat.prototype, "onClearMessages", 2);
10516
10558
  __decorateClass([Property("function")], DeepChat.prototype, "onComponentRender", 2);
10559
+ __decorateClass([Property("object")], DeepChat.prototype, "demo", 2);
10517
10560
  customElements.define("deep-chat", DeepChat);
10518
10561
  export { DeepChat };