@iai-lib/any-chat-widget 0.1.0-alpha.31 → 0.1.0-alpha.32

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.
@@ -2,7 +2,7 @@ var Ui = (i, e, t) => {
2
2
  if (!e.has(i))
3
3
  throw TypeError("Cannot " + t);
4
4
  };
5
- var en = (i, e, t) => (Ui(i, e, "read from private field"), t ? t.call(i) : e.get(i)), Gn = (i, e, t) => {
5
+ var en = (i, e, t) => (Ui(i, e, "read from private field"), t ? t.call(i) : e.get(i)), Xn = (i, e, t) => {
6
6
  if (e.has(i))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
8
  e instanceof WeakSet ? e.add(i) : e.set(i, t);
@@ -14,16 +14,16 @@ var mr = Object.defineProperty, gr = (i, e, t) => e in i ? mr(i, e, { enumerable
14
14
  if (e.has(i))
15
15
  throw TypeError("Cannot add the same private member more than once");
16
16
  e instanceof WeakSet ? e.add(i) : e.set(i, t);
17
- }, ni = (i, e, t) => (fr(i, e, "access private method"), t);
17
+ }, ii = (i, e, t) => (fr(i, e, "access private method"), t);
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2019 Google LLC
21
21
  * SPDX-License-Identifier: BSD-3-Clause
22
22
  */
23
- const sn = globalThis, ui = sn.ShadowRoot && (sn.ShadyCSS === void 0 || sn.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, hi = Symbol(), Bi = /* @__PURE__ */ new WeakMap();
23
+ const sn = globalThis, ui = sn.ShadowRoot && (sn.ShadyCSS === void 0 || sn.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, pi = Symbol(), Bi = /* @__PURE__ */ new WeakMap();
24
24
  let bs = class {
25
25
  constructor(i, e, t) {
26
- if (this._$cssResult$ = !0, t !== hi)
26
+ if (this._$cssResult$ = !0, t !== pi)
27
27
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
28
28
  this.cssText = i, this.t = e;
29
29
  }
@@ -40,7 +40,7 @@ let bs = class {
40
40
  return this.cssText;
41
41
  }
42
42
  };
43
- const yr = (i) => new bs(typeof i == "string" ? i : i + "", void 0, hi), nt = (i, ...e) => {
43
+ const yr = (i) => new bs(typeof i == "string" ? i : i + "", void 0, pi), nt = (i, ...e) => {
44
44
  const t = i.length === 1 ? i[0] : e.reduce((n, s, r) => n + ((a) => {
45
45
  if (a._$cssResult$ === !0)
46
46
  return a.cssText;
@@ -48,7 +48,7 @@ const yr = (i) => new bs(typeof i == "string" ? i : i + "", void 0, hi), nt = (i
48
48
  return a;
49
49
  throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
50
50
  })(s) + i[r + 1], i[0]);
51
- return new bs(t, i, hi);
51
+ return new bs(t, i, pi);
52
52
  }, vr = (i, e) => {
53
53
  if (ui)
54
54
  i.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
@@ -96,7 +96,7 @@ const { is: br, defineProperty: wr, getOwnPropertyDescriptor: xr, getOwnProperty
96
96
  }
97
97
  }
98
98
  return t;
99
- } }, pi = (i, e) => !br(i, e), qi = { attribute: !0, type: String, converter: ln, reflect: !1, hasChanged: pi };
99
+ } }, mi = (i, e) => !br(i, e), qi = { attribute: !0, type: String, converter: ln, reflect: !1, hasChanged: mi };
100
100
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), ct.litPropertyMetadata ?? (ct.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
101
101
  class at extends HTMLElement {
102
102
  static addInitializer(e) {
@@ -231,7 +231,7 @@ class at extends HTMLElement {
231
231
  }
232
232
  requestUpdate(e, t, n) {
233
233
  if (e !== void 0) {
234
- if (n ?? (n = this.constructor.getPropertyOptions(e)), !(n.hasChanged ?? pi)(this[e], t))
234
+ if (n ?? (n = this.constructor.getPropertyOptions(e)), !(n.hasChanged ?? mi)(this[e], t))
235
235
  return;
236
236
  this.P(e, t, n);
237
237
  }
@@ -315,8 +315,8 @@ at.elementStyles = [], at.shadowRootOptions = { mode: "open" }, at[wt("elementPr
315
315
  * Copyright 2017 Google LLC
316
316
  * SPDX-License-Identifier: BSD-3-Clause
317
317
  */
318
- const cn = globalThis, dn = cn.trustedTypes, Ki = dn ? dn.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, mi = "$lit$", ke = `lit$${(Math.random() + "").slice(9)}$`, gi = "?" + ke, Er = `<${gi}>`, Ke = document, St = () => Ke.createComment(""), Ct = (i) => i === null || typeof i != "object" && typeof i != "function", ws = Array.isArray, xs = (i) => ws(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", Xn = `[
319
- \f\r]`, yt = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ji = /-->/g, Qi = />/g, De = RegExp(`>|${Xn}(?:([^\\s"'>=/]+)(${Xn}*=${Xn}*(?:[^
318
+ const cn = globalThis, dn = cn.trustedTypes, Ki = dn ? dn.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, gi = "$lit$", ke = `lit$${(Math.random() + "").slice(9)}$`, fi = "?" + ke, Er = `<${fi}>`, Ke = document, St = () => Ke.createComment(""), Ct = (i) => i === null || typeof i != "object" && typeof i != "function", ws = Array.isArray, xs = (i) => ws(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", ei = `[
319
+ \f\r]`, yt = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ji = /-->/g, Qi = />/g, De = RegExp(`>|${ei}(?:([^\\s"'>=/]+)(${ei}*=${ei}*(?:[^
320
320
  \f\r"'\`<>=]|("|')|))|$)`, "g"), Yi = /'/g, Gi = /"/g, _s = /^(?:script|style|textarea|title)$/i, Sr = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), z = Sr(1), fe = Symbol.for("lit-noChange"), q = Symbol.for("lit-nothing"), Xi = /* @__PURE__ */ new WeakMap(), Be = Ke.createTreeWalker(Ke, 129);
321
321
  function ks(i, e) {
322
322
  if (!Array.isArray(i) || !i.hasOwnProperty("raw"))
@@ -328,11 +328,11 @@ const $s = (i, e) => {
328
328
  let s, r = e === 2 ? "<svg>" : "", a = yt;
329
329
  for (let o = 0; o < t; o++) {
330
330
  const l = i[o];
331
- let d, u, p = -1, c = 0;
332
- for (; c < l.length && (a.lastIndex = c, u = a.exec(l), u !== null); )
333
- c = a.lastIndex, a === yt ? u[1] === "!--" ? a = Ji : u[1] !== void 0 ? a = Qi : u[2] !== void 0 ? (_s.test(u[2]) && (s = RegExp("</" + u[2], "g")), a = De) : u[3] !== void 0 && (a = De) : a === De ? u[0] === ">" ? (a = s ?? yt, p = -1) : u[1] === void 0 ? p = -2 : (p = a.lastIndex - u[2].length, d = u[1], a = u[3] === void 0 ? De : u[3] === '"' ? Gi : Yi) : a === Gi || a === Yi ? a = De : a === Ji || a === Qi ? a = yt : (a = De, s = void 0);
331
+ let d, h, p = -1, c = 0;
332
+ for (; c < l.length && (a.lastIndex = c, h = a.exec(l), h !== null); )
333
+ c = a.lastIndex, a === yt ? h[1] === "!--" ? a = Ji : h[1] !== void 0 ? a = Qi : h[2] !== void 0 ? (_s.test(h[2]) && (s = RegExp("</" + h[2], "g")), a = De) : h[3] !== void 0 && (a = De) : a === De ? h[0] === ">" ? (a = s ?? yt, p = -1) : h[1] === void 0 ? p = -2 : (p = a.lastIndex - h[2].length, d = h[1], a = h[3] === void 0 ? De : h[3] === '"' ? Gi : Yi) : a === Gi || a === Yi ? a = De : a === Ji || a === Qi ? a = yt : (a = De, s = void 0);
334
334
  const g = a === De && i[o + 1].startsWith("/>") ? " " : "";
335
- r += a === yt ? l + Er : p >= 0 ? (n.push(d), l.slice(0, p) + mi + l.slice(p) + ke + g) : l + ke + (p === -2 ? o : g);
335
+ r += a === yt ? l + Er : p >= 0 ? (n.push(d), l.slice(0, p) + gi + l.slice(p) + ke + g) : l + ke + (p === -2 ? o : g);
336
336
  }
337
337
  return [ks(i, r + (i[t] || "<?>") + (e === 2 ? "</svg>" : "")), n];
338
338
  };
@@ -341,7 +341,7 @@ class At {
341
341
  let s;
342
342
  this.parts = [];
343
343
  let r = 0, a = 0;
344
- const o = e.length - 1, l = this.parts, [d, u] = $s(e, t);
344
+ const o = e.length - 1, l = this.parts, [d, h] = $s(e, t);
345
345
  if (this.el = At.createElement(d, n), Be.currentNode = this.el.content, t === 2) {
346
346
  const p = this.el.content.firstChild;
347
347
  p.replaceWith(...p.childNodes);
@@ -350,8 +350,8 @@ class At {
350
350
  if (s.nodeType === 1) {
351
351
  if (s.hasAttributes())
352
352
  for (const p of s.getAttributeNames())
353
- if (p.endsWith(mi)) {
354
- const c = u[a++], g = s.getAttribute(p).split(ke), O = /([.?@])?(.*)/.exec(c);
353
+ if (p.endsWith(gi)) {
354
+ const c = h[a++], g = s.getAttribute(p).split(ke), O = /([.?@])?(.*)/.exec(c);
355
355
  l.push({ type: 1, index: r, name: O[2], strings: g, ctor: O[1] === "." ? Es : O[1] === "?" ? Ss : O[1] === "@" ? Cs : Wt }), s.removeAttribute(p);
356
356
  } else
357
357
  p.startsWith(ke) && (l.push({ type: 6, index: r }), s.removeAttribute(p));
@@ -365,7 +365,7 @@ class At {
365
365
  }
366
366
  }
367
367
  } else if (s.nodeType === 8)
368
- if (s.data === gi)
368
+ if (s.data === fi)
369
369
  l.push({ type: 2, index: r });
370
370
  else {
371
371
  let p = -1;
@@ -551,7 +551,7 @@ class As {
551
551
  Je(this, e);
552
552
  }
553
553
  }
554
- const Cr = { P: mi, A: ke, C: gi, M: 1, L: $s, R: Ts, D: xs, V: Je, I: mt, H: Wt, N: Ss, U: Cs, B: Es, F: As }, es = cn.litHtmlPolyfillSupport;
554
+ const Cr = { P: gi, A: ke, C: fi, M: 1, L: $s, R: Ts, D: xs, V: Je, I: mt, H: Wt, N: Ss, U: Cs, B: Es, F: As }, es = cn.litHtmlPolyfillSupport;
555
555
  es == null || es(At, mt), (cn.litHtmlVersions ?? (cn.litHtmlVersions = [])).push("3.1.2");
556
556
  const Ar = (i, e, t) => {
557
557
  const n = (t == null ? void 0 : t.renderBefore) ?? e;
@@ -612,7 +612,7 @@ const Ee = (i) => (e, t) => {
612
612
  * Copyright 2017 Google LLC
613
613
  * SPDX-License-Identifier: BSD-3-Clause
614
614
  */
615
- const Ir = { attribute: !0, type: String, converter: ln, reflect: !1, hasChanged: pi }, Or = (i = Ir, e, t) => {
615
+ const Ir = { attribute: !0, type: String, converter: ln, reflect: !1, hasChanged: mi }, Or = (i = Ir, e, t) => {
616
616
  const { kind: n, metadata: s } = t;
617
617
  let r = globalThis.litPropertyMetadata.get(s);
618
618
  if (r === void 0 && globalThis.litPropertyMetadata.set(s, r = /* @__PURE__ */ new Map()), r.set(t.name, i), n === "accessor") {
@@ -725,13 +725,13 @@ const { I: Mr } = Cr, ss = () => document.createComment(""), vt = (i, e, t) => {
725
725
  if (a !== r || l) {
726
726
  let d = t._$AA;
727
727
  for (; d !== a; ) {
728
- const u = d.nextSibling;
729
- s.insertBefore(d, r), d = u;
728
+ const h = d.nextSibling;
729
+ s.insertBefore(d, r), d = h;
730
730
  }
731
731
  }
732
732
  }
733
733
  return t;
734
- }, Ue = (i, e, t = i) => (i._$AI(e, t), i), Rr = {}, Nr = (i, e = Rr) => i._$AH = e, Pr = (i) => i._$AH, ei = (i) => {
734
+ }, Ue = (i, e, t = i) => (i._$AI(e, t), i), Rr = {}, Nr = (i, e = Rr) => i._$AH = e, Pr = (i) => i._$AH, ti = (i) => {
735
735
  var e;
736
736
  (e = i._$AP) == null || e.call(i, !1, !0);
737
737
  let t = i._$AA;
@@ -773,7 +773,7 @@ const rs = (i, e, t) => {
773
773
  if (!Array.isArray(s))
774
774
  return this.ut = a, r;
775
775
  const o = this.ut ?? (this.ut = []), l = [];
776
- let d, u, p = 0, c = s.length - 1, g = 0, O = r.length - 1;
776
+ let d, h, p = 0, c = s.length - 1, g = 0, O = r.length - 1;
777
777
  for (; p <= c && g <= O; )
778
778
  if (s[p] === null)
779
779
  p++;
@@ -787,9 +787,9 @@ const rs = (i, e, t) => {
787
787
  l[O] = Ue(s[p], r[O]), vt(i, l[O + 1], s[p]), p++, O--;
788
788
  else if (o[c] === a[g])
789
789
  l[g] = Ue(s[c], r[g]), vt(i, s[p], s[c]), c--, g++;
790
- else if (d === void 0 && (d = rs(a, g, O), u = rs(o, p, c)), d.has(o[p]))
790
+ else if (d === void 0 && (d = rs(a, g, O), h = rs(o, p, c)), d.has(o[p]))
791
791
  if (d.has(o[c])) {
792
- const D = u.get(a[g]), J = D !== void 0 ? s[D] : null;
792
+ const D = h.get(a[g]), J = D !== void 0 ? s[D] : null;
793
793
  if (J === null) {
794
794
  const Ce = vt(i, s[p]);
795
795
  Ue(Ce, r[g]), l[g] = Ce;
@@ -797,16 +797,16 @@ const rs = (i, e, t) => {
797
797
  l[g] = Ue(J, r[g]), vt(i, s[p], J), s[D] = null;
798
798
  g++;
799
799
  } else
800
- ei(s[c]), c--;
800
+ ti(s[c]), c--;
801
801
  else
802
- ei(s[p]), p++;
802
+ ti(s[p]), p++;
803
803
  for (; g <= O; ) {
804
804
  const D = vt(i, l[O + 1]);
805
805
  Ue(D, r[g]), l[g++] = D;
806
806
  }
807
807
  for (; p <= c; ) {
808
808
  const D = s[p++];
809
- D !== null && ei(D);
809
+ D !== null && ti(D);
810
810
  }
811
811
  return this.ut = a, Nr(i, l), fe;
812
812
  }
@@ -934,20 +934,20 @@ function Zr(i) {
934
934
  } else
935
935
  return Array.from(i);
936
936
  }
937
- var fi = !1;
937
+ var yi = !1;
938
938
  if (typeof window < "u") {
939
939
  var as = {
940
940
  get passive() {
941
- fi = !0;
941
+ yi = !0;
942
942
  }
943
943
  };
944
944
  window.addEventListener("testPassive", null, as), window.removeEventListener("testPassive", null, as);
945
945
  }
946
- var un = typeof window < "u" && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1), Fe = [], hn = !1, Os = -1, xt = void 0, He = void 0, _t = void 0, Ms = function(i) {
946
+ var hn = typeof window < "u" && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1), Fe = [], un = !1, Os = -1, xt = void 0, He = void 0, _t = void 0, Ms = function(i) {
947
947
  return Fe.some(function(e) {
948
948
  return !!(e.options.allowTouchMove && e.options.allowTouchMove(i));
949
949
  });
950
- }, yi = function(i) {
950
+ }, vi = function(i) {
951
951
  var e = i || window.event;
952
952
  return Ms(e.target) || e.touches.length > 1 ? !0 : (e.preventDefault && e.preventDefault(), !1);
953
953
  }, Lr = function(i) {
@@ -987,7 +987,7 @@ var un = typeof window < "u" && window.navigator && window.navigator.platform &&
987
987
  return i ? i.scrollHeight - i.scrollTop <= i.clientHeight : !1;
988
988
  }, Wr = function(i, e) {
989
989
  var t = i.targetTouches[0].clientY - Os;
990
- return Ms(i.target) ? !1 : e && e.scrollTop === 0 && t > 0 || Br(e) && t < 0 ? yi(i) : (i.stopPropagation(), !0);
990
+ return Ms(i.target) ? !1 : e && e.scrollTop === 0 && t > 0 || Br(e) && t < 0 ? vi(i) : (i.stopPropagation(), !0);
991
991
  }, Fr = function(i, e) {
992
992
  if (!i) {
993
993
  console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");
@@ -1000,11 +1000,11 @@ var un = typeof window < "u" && window.navigator && window.navigator.platform &&
1000
1000
  targetElement: i,
1001
1001
  options: e || {}
1002
1002
  };
1003
- Fe = [].concat(Zr(Fe), [t]), un ? Ur() : Lr(e), un && (i.ontouchstart = function(n) {
1003
+ Fe = [].concat(Zr(Fe), [t]), hn ? Ur() : Lr(e), hn && (i.ontouchstart = function(n) {
1004
1004
  n.targetTouches.length === 1 && (Os = n.targetTouches[0].clientY);
1005
1005
  }, i.ontouchmove = function(n) {
1006
1006
  n.targetTouches.length === 1 && Wr(n, i);
1007
- }, hn || (document.addEventListener("touchmove", yi, fi ? { passive: !1 } : void 0), hn = !0));
1007
+ }, un || (document.addEventListener("touchmove", vi, yi ? { passive: !1 } : void 0), un = !0));
1008
1008
  }
1009
1009
  }, os = function(i) {
1010
1010
  if (!i) {
@@ -1013,7 +1013,7 @@ var un = typeof window < "u" && window.navigator && window.navigator.platform &&
1013
1013
  }
1014
1014
  Fe = Fe.filter(function(e) {
1015
1015
  return e.targetElement !== i;
1016
- }), un && (i.ontouchstart = null, i.ontouchmove = null, hn && Fe.length === 0 && (document.removeEventListener("touchmove", yi, fi ? { passive: !1 } : void 0), hn = !1)), un ? Hr() : Dr();
1016
+ }), hn && (i.ontouchstart = null, i.ontouchmove = null, un && Fe.length === 0 && (document.removeEventListener("touchmove", vi, yi ? { passive: !1 } : void 0), un = !1)), hn ? Hr() : Dr();
1017
1017
  };
1018
1018
  /**
1019
1019
  * @license
@@ -1084,12 +1084,12 @@ const Rs = "important", Vr = " !" + Rs, Ve = On(class extends Mn {
1084
1084
  function qr(i) {
1085
1085
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
1086
1086
  }
1087
- var vi = {};
1087
+ var bi = {};
1088
1088
  (function(i) {
1089
1089
  function e(o) {
1090
1090
  o && o.options && clearTimeout(o.options.timer);
1091
1091
  }
1092
- function t(o, l, d, u) {
1092
+ function t(o, l, d, h) {
1093
1093
  var p = { timer: void 0, lastArgs: [] }, c = function() {
1094
1094
  for (var g = this, O = [], D = 0; D < arguments.length; D++)
1095
1095
  O[D] = arguments[D];
@@ -1097,23 +1097,23 @@ var vi = {};
1097
1097
  l || d.apply(g, p.lastArgs), p.timer = void 0;
1098
1098
  }, o);
1099
1099
  };
1100
- return u && (c = c.bind(u)), c.options = p, c;
1100
+ return h && (c = c.bind(h)), c.options = p, c;
1101
1101
  }
1102
- function n(o, l, d, u) {
1102
+ function n(o, l, d, h) {
1103
1103
  var p;
1104
- Object.defineProperty(d, u, { configurable: !0, enumerable: !1, get: function() {
1104
+ Object.defineProperty(d, h, { configurable: !0, enumerable: !1, get: function() {
1105
1105
  return p;
1106
1106
  }, set: function(c) {
1107
1107
  p = t(o, l, c, this);
1108
1108
  } });
1109
1109
  }
1110
1110
  function s(o, l, d) {
1111
- var u = d.value;
1112
- return d.value = t(o, l, u), d;
1111
+ var h = d.value;
1112
+ return d.value = t(o, l, h), d;
1113
1113
  }
1114
1114
  function r(o, l) {
1115
- for (var d = [], u = 2; u < arguments.length; u++)
1116
- d[u - 2] = arguments[u];
1115
+ for (var d = [], h = 2; h < arguments.length; h++)
1116
+ d[h - 2] = arguments[h];
1117
1117
  if (d.length === 0)
1118
1118
  throw new Error("function applied debounce decorator should be a method");
1119
1119
  if (d.length === 1)
@@ -1126,20 +1126,20 @@ var vi = {};
1126
1126
  function a() {
1127
1127
  for (var o = [], l = 0; l < arguments.length; l++)
1128
1128
  o[l] = arguments[l];
1129
- var d = 500, u = !1;
1129
+ var d = 500, h = !1;
1130
1130
  if (o.length && (typeof o[0] == "number" || typeof o[0] == "object" && o[0].leading !== void 0)) {
1131
1131
  typeof o[0] == "number" && (d = o[0]);
1132
1132
  var p = void 0;
1133
- return typeof o[0] == "object" && o[0].leading !== void 0 && (p = o[0]), 1 < o.length && typeof o[1] == "object" && o[1].leading !== void 0 && (p = o[1]), p && (u = p.leading), function() {
1133
+ return typeof o[0] == "object" && o[0].leading !== void 0 && (p = o[0]), 1 < o.length && typeof o[1] == "object" && o[1].leading !== void 0 && (p = o[1]), p && (h = p.leading), function() {
1134
1134
  for (var c = [], g = 0; g < arguments.length; g++)
1135
1135
  c[g] = arguments[g];
1136
- return r.apply(void 0, [d, u].concat(c));
1136
+ return r.apply(void 0, [d, h].concat(c));
1137
1137
  };
1138
1138
  }
1139
- return r.apply(void 0, [d, u].concat(o));
1139
+ return r.apply(void 0, [d, h].concat(o));
1140
1140
  }
1141
1141
  Object.defineProperty(i, "__esModule", { value: !0 }), i.cancel = e, i.debounce = a;
1142
- })(vi);
1142
+ })(bi);
1143
1143
  var P;
1144
1144
  (function(i) {
1145
1145
  i.assertEqual = (s) => s;
@@ -1176,14 +1176,14 @@ var P;
1176
1176
  }
1177
1177
  i.joinValues = n, i.jsonStringifyReplacer = (s, r) => typeof r == "bigint" ? r.toString() : r;
1178
1178
  })(P || (P = {}));
1179
- var ii;
1179
+ var si;
1180
1180
  (function(i) {
1181
1181
  i.mergeShapes = (e, t) => ({
1182
1182
  ...e,
1183
1183
  ...t
1184
1184
  // second overwrites first
1185
1185
  });
1186
- })(ii || (ii = {}));
1186
+ })(si || (si = {}));
1187
1187
  const f = P.arrayToEnum([
1188
1188
  "string",
1189
1189
  "nan",
@@ -1434,7 +1434,7 @@ class G {
1434
1434
  }
1435
1435
  const S = Object.freeze({
1436
1436
  status: "aborted"
1437
- }), Ps = (i) => ({ status: "dirty", value: i }), ee = (i) => ({ status: "valid", value: i }), si = (i) => i.status === "aborted", ri = (i) => i.status === "dirty", Ot = (i) => i.status === "valid", gn = (i) => typeof Promise < "u" && i instanceof Promise;
1437
+ }), Ps = (i) => ({ status: "dirty", value: i }), ee = (i) => ({ status: "valid", value: i }), ri = (i) => i.status === "aborted", ai = (i) => i.status === "dirty", Ot = (i) => i.status === "valid", gn = (i) => typeof Promise < "u" && i instanceof Promise;
1438
1438
  var x;
1439
1439
  (function(i) {
1440
1440
  i.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, i.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
@@ -1592,7 +1592,7 @@ class I {
1592
1592
  return ce.create(this, this._def);
1593
1593
  }
1594
1594
  promise() {
1595
- return ht.create(this, this._def);
1595
+ return ut.create(this, this._def);
1596
1596
  }
1597
1597
  or(e) {
1598
1598
  return Pt.create([this, e], this._def);
@@ -1654,7 +1654,7 @@ class I {
1654
1654
  }
1655
1655
  }
1656
1656
  const Yr = /^c[^\s-]{8,}$/i, Gr = /^[a-z][a-z0-9]*$/, Xr = /^[0-9A-HJKMNP-TV-Z]{26}$/, ea = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, ta = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, na = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1657
- let ti;
1657
+ let ni;
1658
1658
  const ia = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/, sa = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, ra = (i) => i.precision ? i.offset ? new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`) : new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}Z$`) : i.precision === 0 ? i.offset ? new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$") : new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$") : i.offset ? new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$") : new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");
1659
1659
  function aa(i, e) {
1660
1660
  return !!((e === "v4" || !e) && ia.test(i) || (e === "v6" || !e) && sa.test(i));
@@ -1718,7 +1718,7 @@ class oe extends I {
1718
1718
  message: s.message
1719
1719
  }), t.dirty());
1720
1720
  else if (s.kind === "emoji")
1721
- ti || (ti = new RegExp(na, "u")), ti.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
1721
+ ni || (ni = new RegExp(na, "u")), ni.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
1722
1722
  validation: "emoji",
1723
1723
  code: m.invalid_string,
1724
1724
  message: s.message
@@ -2411,7 +2411,7 @@ Nt.create = (i) => new Nt({
2411
2411
  typeName: T.ZodNull,
2412
2412
  ...A(i)
2413
2413
  });
2414
- class ut extends I {
2414
+ class ht extends I {
2415
2415
  constructor() {
2416
2416
  super(...arguments), this._any = !0;
2417
2417
  }
@@ -2419,7 +2419,7 @@ class ut extends I {
2419
2419
  return ee(e.data);
2420
2420
  }
2421
2421
  }
2422
- ut.create = (i) => new ut({
2422
+ ht.create = (i) => new ht({
2423
2423
  typeName: T.ZodAny,
2424
2424
  ...A(i)
2425
2425
  });
@@ -2581,10 +2581,10 @@ class F extends I {
2581
2581
  r.includes(l) || a.push(l);
2582
2582
  const o = [];
2583
2583
  for (const l of r) {
2584
- const d = s[l], u = n.data[l];
2584
+ const d = s[l], h = n.data[l];
2585
2585
  o.push({
2586
2586
  key: { status: "valid", value: l },
2587
- value: d._parse(new ye(n, u, n.path, l)),
2587
+ value: d._parse(new ye(n, h, n.path, l)),
2588
2588
  alwaysSet: l in n.data
2589
2589
  });
2590
2590
  }
@@ -2606,11 +2606,11 @@ class F extends I {
2606
2606
  } else {
2607
2607
  const l = this._def.catchall;
2608
2608
  for (const d of a) {
2609
- const u = n.data[d];
2609
+ const h = n.data[d];
2610
2610
  o.push({
2611
2611
  key: { status: "valid", value: d },
2612
2612
  value: l._parse(
2613
- new ye(n, u, n.path, d)
2613
+ new ye(n, h, n.path, d)
2614
2614
  //, ctx.child(key), value, getParsedType(value)
2615
2615
  ),
2616
2616
  alwaysSet: d in n.data
@@ -2620,9 +2620,9 @@ class F extends I {
2620
2620
  return n.common.async ? Promise.resolve().then(async () => {
2621
2621
  const l = [];
2622
2622
  for (const d of o) {
2623
- const u = await d.key;
2623
+ const h = await d.key;
2624
2624
  l.push({
2625
- key: u,
2625
+ key: h,
2626
2626
  value: await d.value,
2627
2627
  alwaysSet: d.alwaysSet
2628
2628
  });
@@ -2890,14 +2890,14 @@ class Pt extends I {
2890
2890
  issues: []
2891
2891
  },
2892
2892
  parent: null
2893
- }, u = l._parseSync({
2893
+ }, h = l._parseSync({
2894
2894
  data: t.data,
2895
2895
  path: t.path,
2896
2896
  parent: d
2897
2897
  });
2898
- if (u.status === "valid")
2899
- return u;
2900
- u.status === "dirty" && !r && (r = { result: u, ctx: d }), d.common.issues.length && a.push(d.common.issues);
2898
+ if (h.status === "valid")
2899
+ return h;
2900
+ h.status === "dirty" && !r && (r = { result: h, ctx: d }), d.common.issues.length && a.push(d.common.issues);
2901
2901
  }
2902
2902
  if (r)
2903
2903
  return t.common.issues.push(...r.ctx.common.issues), r.result;
@@ -2980,14 +2980,14 @@ class Nn extends I {
2980
2980
  });
2981
2981
  }
2982
2982
  }
2983
- function ai(i, e) {
2983
+ function oi(i, e) {
2984
2984
  const t = Me(i), n = Me(e);
2985
2985
  if (i === e)
2986
2986
  return { valid: !0, data: i };
2987
2987
  if (t === f.object && n === f.object) {
2988
2988
  const s = P.objectKeys(e), r = P.objectKeys(i).filter((o) => s.indexOf(o) !== -1), a = { ...i, ...e };
2989
2989
  for (const o of r) {
2990
- const l = ai(i[o], e[o]);
2990
+ const l = oi(i[o], e[o]);
2991
2991
  if (!l.valid)
2992
2992
  return { valid: !1 };
2993
2993
  a[o] = l.data;
@@ -2998,7 +2998,7 @@ function ai(i, e) {
2998
2998
  return { valid: !1 };
2999
2999
  const s = [];
3000
3000
  for (let r = 0; r < i.length; r++) {
3001
- const a = i[r], o = e[r], l = ai(a, o);
3001
+ const a = i[r], o = e[r], l = oi(a, o);
3002
3002
  if (!l.valid)
3003
3003
  return { valid: !1 };
3004
3004
  s.push(l.data);
@@ -3010,10 +3010,10 @@ function ai(i, e) {
3010
3010
  class jt extends I {
3011
3011
  _parse(e) {
3012
3012
  const { status: t, ctx: n } = this._processInputParams(e), s = (r, a) => {
3013
- if (si(r) || si(a))
3013
+ if (ri(r) || ri(a))
3014
3014
  return S;
3015
- const o = ai(r.value, a.value);
3016
- return o.valid ? ((ri(r) || ri(a)) && t.dirty(), { status: t.value, value: o.data }) : (y(n, {
3015
+ const o = oi(r.value, a.value);
3016
+ return o.valid ? ((ai(r) || ai(a)) && t.dirty(), { status: t.value, value: o.data }) : (y(n, {
3017
3017
  code: m.invalid_intersection_types
3018
3018
  }), S);
3019
3019
  };
@@ -3158,20 +3158,20 @@ class vn extends I {
3158
3158
  const o = /* @__PURE__ */ new Map();
3159
3159
  return Promise.resolve().then(async () => {
3160
3160
  for (const l of a) {
3161
- const d = await l.key, u = await l.value;
3162
- if (d.status === "aborted" || u.status === "aborted")
3161
+ const d = await l.key, h = await l.value;
3162
+ if (d.status === "aborted" || h.status === "aborted")
3163
3163
  return S;
3164
- (d.status === "dirty" || u.status === "dirty") && t.dirty(), o.set(d.value, u.value);
3164
+ (d.status === "dirty" || h.status === "dirty") && t.dirty(), o.set(d.value, h.value);
3165
3165
  }
3166
3166
  return { status: t.value, value: o };
3167
3167
  });
3168
3168
  } else {
3169
3169
  const o = /* @__PURE__ */ new Map();
3170
3170
  for (const l of a) {
3171
- const d = l.key, u = l.value;
3172
- if (d.status === "aborted" || u.status === "aborted")
3171
+ const d = l.key, h = l.value;
3172
+ if (d.status === "aborted" || h.status === "aborted")
3173
3173
  return S;
3174
- (d.status === "dirty" || u.status === "dirty") && t.dirty(), o.set(d.value, u.value);
3174
+ (d.status === "dirty" || h.status === "dirty") && t.dirty(), o.set(d.value, h.value);
3175
3175
  }
3176
3176
  return { status: t.value, value: o };
3177
3177
  }
@@ -3211,10 +3211,10 @@ class Ye extends I {
3211
3211
  const r = this._def.valueType;
3212
3212
  function a(l) {
3213
3213
  const d = /* @__PURE__ */ new Set();
3214
- for (const u of l) {
3215
- if (u.status === "aborted")
3214
+ for (const h of l) {
3215
+ if (h.status === "aborted")
3216
3216
  return S;
3217
- u.status === "dirty" && t.dirty(), d.add(u.value);
3217
+ h.status === "dirty" && t.dirty(), d.add(h.value);
3218
3218
  }
3219
3219
  return { status: t.value, value: d };
3220
3220
  }
@@ -3292,12 +3292,12 @@ class lt extends I {
3292
3292
  });
3293
3293
  }
3294
3294
  const r = { errorMap: t.common.contextualErrorMap }, a = t.data;
3295
- if (this._def.returns instanceof ht) {
3295
+ if (this._def.returns instanceof ut) {
3296
3296
  const o = this;
3297
3297
  return ee(async function(...l) {
3298
- const d = new le([]), u = await o._def.args.parseAsync(l, r).catch((c) => {
3298
+ const d = new le([]), h = await o._def.args.parseAsync(l, r).catch((c) => {
3299
3299
  throw d.addIssue(n(l, c)), d;
3300
- }), p = await Reflect.apply(a, this, u);
3300
+ }), p = await Reflect.apply(a, this, h);
3301
3301
  return await o._def.returns._def.type.parseAsync(p, r).catch((c) => {
3302
3302
  throw d.addIssue(s(p, c)), d;
3303
3303
  });
@@ -3308,9 +3308,9 @@ class lt extends I {
3308
3308
  const d = o._def.args.safeParse(l, r);
3309
3309
  if (!d.success)
3310
3310
  throw new le([n(l, d.error)]);
3311
- const u = Reflect.apply(a, this, d.data), p = o._def.returns.safeParse(u, r);
3311
+ const h = Reflect.apply(a, this, d.data), p = o._def.returns.safeParse(h, r);
3312
3312
  if (!p.success)
3313
- throw new le([s(u, p.error)]);
3313
+ throw new le([s(h, p.error)]);
3314
3314
  return p.data;
3315
3315
  });
3316
3316
  }
@@ -3469,7 +3469,7 @@ Dt.create = (i, e) => new Dt({
3469
3469
  typeName: T.ZodNativeEnum,
3470
3470
  ...A(e)
3471
3471
  });
3472
- class ht extends I {
3472
+ class ut extends I {
3473
3473
  unwrap() {
3474
3474
  return this._def.type;
3475
3475
  }
@@ -3488,7 +3488,7 @@ class ht extends I {
3488
3488
  })));
3489
3489
  }
3490
3490
  }
3491
- ht.create = (i, e) => new ht({
3491
+ ut.create = (i, e) => new ut({
3492
3492
  type: i,
3493
3493
  typeName: T.ZodPromise,
3494
3494
  ...A(e)
@@ -3744,13 +3744,13 @@ xn.create = (i, e) => new xn({
3744
3744
  typeName: T.ZodReadonly,
3745
3745
  ...A(e)
3746
3746
  });
3747
- const Zs = (i, e = {}, t) => i ? ut.create().superRefine((n, s) => {
3747
+ const Zs = (i, e = {}, t) => i ? ht.create().superRefine((n, s) => {
3748
3748
  var r, a;
3749
3749
  if (!i(n)) {
3750
3750
  const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, l = (a = (r = o.fatal) !== null && r !== void 0 ? r : t) !== null && a !== void 0 ? a : !0, d = typeof o == "string" ? { message: o } : o;
3751
3751
  s.addIssue({ code: "custom", ...d, fatal: l });
3752
3752
  }
3753
- }) : ut.create(), ca = {
3753
+ }) : ht.create(), ca = {
3754
3754
  object: F.lazycreate
3755
3755
  };
3756
3756
  var T;
@@ -3759,7 +3759,7 @@ var T;
3759
3759
  })(T || (T = {}));
3760
3760
  const da = (i, e = {
3761
3761
  message: `Input not instance of ${i.name}`
3762
- }) => Zs((t) => t instanceof i, e), Ls = oe.create, Ds = Ne.create, ua = wn.create, ha = Pe.create, Us = Mt.create, pa = Qe.create, ma = fn.create, ga = Rt.create, fa = Nt.create, ya = ut.create, va = qe.create, ba = Te.create, wa = yn.create, xa = ce.create, _a = F.create, ka = F.strictCreate, $a = Pt.create, Ta = Nn.create, Ea = jt.create, Sa = ve.create, Ca = zt.create, Aa = vn.create, Ia = Ye.create, Oa = lt.create, Ma = Zt.create, Ra = Lt.create, Na = je.create, Pa = Dt.create, ja = ht.create, ds = de.create, za = $e.create, Za = Ge.create, La = de.createWithPreprocess, Da = Ft.create, Ua = () => Ls().optional(), Ha = () => Ds().optional(), Ba = () => Us().optional(), Wa = {
3762
+ }) => Zs((t) => t instanceof i, e), Ls = oe.create, Ds = Ne.create, ha = wn.create, ua = Pe.create, Us = Mt.create, pa = Qe.create, ma = fn.create, ga = Rt.create, fa = Nt.create, ya = ht.create, va = qe.create, ba = Te.create, wa = yn.create, xa = ce.create, _a = F.create, ka = F.strictCreate, $a = Pt.create, Ta = Nn.create, Ea = jt.create, Sa = ve.create, Ca = zt.create, Aa = vn.create, Ia = Ye.create, Oa = lt.create, Ma = Zt.create, Ra = Lt.create, Na = je.create, Pa = Dt.create, ja = ut.create, ds = de.create, za = $e.create, Za = Ge.create, La = de.createWithPreprocess, Da = Ft.create, Ua = () => Ls().optional(), Ha = () => Ds().optional(), Ba = () => Us().optional(), Wa = {
3763
3763
  string: (i) => oe.create({ ...i, coerce: !0 }),
3764
3764
  number: (i) => Ne.create({ ...i, coerce: !0 }),
3765
3765
  boolean: (i) => Mt.create({
@@ -3781,15 +3781,15 @@ var w = /* @__PURE__ */ Object.freeze({
3781
3781
  INVALID: S,
3782
3782
  DIRTY: Ps,
3783
3783
  OK: ee,
3784
- isAborted: si,
3785
- isDirty: ri,
3784
+ isAborted: ri,
3785
+ isDirty: ai,
3786
3786
  isValid: Ot,
3787
3787
  isAsync: gn,
3788
3788
  get util() {
3789
3789
  return P;
3790
3790
  },
3791
3791
  get objectUtil() {
3792
- return ii;
3792
+ return si;
3793
3793
  },
3794
3794
  ZodParsedType: f,
3795
3795
  getParsedType: Me,
@@ -3802,7 +3802,7 @@ var w = /* @__PURE__ */ Object.freeze({
3802
3802
  ZodSymbol: fn,
3803
3803
  ZodUndefined: Rt,
3804
3804
  ZodNull: Nt,
3805
- ZodAny: ut,
3805
+ ZodAny: ht,
3806
3806
  ZodUnknown: qe,
3807
3807
  ZodNever: Te,
3808
3808
  ZodVoid: yn,
@@ -3820,7 +3820,7 @@ var w = /* @__PURE__ */ Object.freeze({
3820
3820
  ZodLiteral: Lt,
3821
3821
  ZodEnum: je,
3822
3822
  ZodNativeEnum: Dt,
3823
- ZodPromise: ht,
3823
+ ZodPromise: ut,
3824
3824
  ZodEffects: de,
3825
3825
  ZodTransformer: de,
3826
3826
  ZodOptional: $e,
@@ -3842,7 +3842,7 @@ var w = /* @__PURE__ */ Object.freeze({
3842
3842
  coerce: Wa,
3843
3843
  any: ya,
3844
3844
  array: xa,
3845
- bigint: ha,
3845
+ bigint: ua,
3846
3846
  boolean: Us,
3847
3847
  date: pa,
3848
3848
  discriminatedUnion: Ta,
@@ -3854,7 +3854,7 @@ var w = /* @__PURE__ */ Object.freeze({
3854
3854
  lazy: Ma,
3855
3855
  literal: Ra,
3856
3856
  map: Aa,
3857
- nan: ua,
3857
+ nan: ha,
3858
3858
  nativeEnum: Pa,
3859
3859
  never: ba,
3860
3860
  null: fa,
@@ -4031,14 +4031,14 @@ Vt([
4031
4031
  An("iai-chat")
4032
4032
  ], Xe.prototype, "chatWindow", 2);
4033
4033
  Vt([
4034
- vi.debounce(250)
4034
+ bi.debounce(250)
4035
4035
  ], Xe.prototype, "onResizeHandler", 2);
4036
4036
  Xe = Vt([
4037
4037
  Ee("iai-chat-popup")
4038
4038
  ], Xe);
4039
- const bi = "https://api-dev.ai.inhabit.work";
4039
+ const jn = "https://api-dev.ai.inhabit.work";
4040
4040
  async function Ka(i, e = {}) {
4041
- return (await fetch(`${bi}/threads`, {
4041
+ return (await fetch(`${jn}/threads`, {
4042
4042
  method: "POST",
4043
4043
  headers: {
4044
4044
  "Content-Type": "application/json"
@@ -4046,8 +4046,17 @@ async function Ka(i, e = {}) {
4046
4046
  body: JSON.stringify({ assistantId: i, params: e })
4047
4047
  })).json();
4048
4048
  }
4049
- async function Ja(i, e) {
4050
- return (await fetch(`${bi}/threads/${i}/messages`, {
4049
+ async function Ja(i, e = "No reason provided") {
4050
+ await fetch(`${jn}/threads/${i}`, {
4051
+ method: "DELETE",
4052
+ headers: {
4053
+ "Content-Type": "application/json"
4054
+ },
4055
+ body: JSON.stringify({ reason: e })
4056
+ });
4057
+ }
4058
+ async function Qa(i, e) {
4059
+ return (await fetch(`${jn}/threads/${i}/messages`, {
4051
4060
  method: "POST",
4052
4061
  headers: {
4053
4062
  "Content-Type": "application/json"
@@ -4055,8 +4064,8 @@ async function Ja(i, e) {
4055
4064
  body: JSON.stringify({ content: e })
4056
4065
  })).json();
4057
4066
  }
4058
- async function Qa(i, e, t, n = !1) {
4059
- return (await fetch(`${bi}/threads/${i}/functions/${e}`, {
4067
+ async function Ya(i, e, t, n = !1) {
4068
+ return (await fetch(`${jn}/threads/${i}/functions/${e}`, {
4060
4069
  method: "POST",
4061
4070
  headers: {
4062
4071
  "Content-Type": "application/json"
@@ -4064,7 +4073,7 @@ async function Qa(i, e, t, n = !1) {
4064
4073
  body: JSON.stringify({ params: t, rerunLLM: n })
4065
4074
  })).json();
4066
4075
  }
4067
- function Ya(i) {
4076
+ function Ga(i) {
4068
4077
  return { all: i = i || /* @__PURE__ */ new Map(), on: function(e, t) {
4069
4078
  var n = i.get(e);
4070
4079
  n ? n.push(t) : i.set(e, [t]);
@@ -4080,7 +4089,7 @@ function Ya(i) {
4080
4089
  });
4081
4090
  } };
4082
4091
  }
4083
- class Ga {
4092
+ class Xa {
4084
4093
  constructor(e, t = {}) {
4085
4094
  if (this._assistantId = "", this._conversationDetails = null, this._messages = [], this.isTyping = !1, this.inputDisabled = !1, this.chatEndingWarningSent = !1, this.chatEnded = !1, this.onStorageEvent = (n) => {
4086
4095
  var s;
@@ -4114,7 +4123,7 @@ class Ga {
4114
4123
  simulateDelays: !1,
4115
4124
  historyKey: "main",
4116
4125
  ...t
4117
- }, this._emitter = Ya(), this.on = this._emitter.on.bind(this._emitter), this.off = this._emitter.off.bind(this._emitter), t.events && Object.entries(t.events).forEach(([n, s]) => {
4126
+ }, this._emitter = Ga(), this.on = this._emitter.on.bind(this._emitter), this.off = this._emitter.off.bind(this._emitter), t.events && Object.entries(t.events).forEach(([n, s]) => {
4118
4127
  this._emitter.on(n, s);
4119
4128
  }), t.historyKey) {
4120
4129
  this._messages = this.storageGet("messageHistory", []);
@@ -4144,8 +4153,12 @@ class Ga {
4144
4153
  n.includes(r.id) || this._emitter.emit("message", r);
4145
4154
  }), this._messages = t;
4146
4155
  }
4147
- reset() {
4148
- this._messages = [], this.setConversationDetails(null), this.setTyping(!1), this.setInputDisabled(!1), this.setChatEnded(!1), this.stopInactivityTimers(), this.storageRemoveAll(), this._emitter.emit("reset");
4156
+ async endChat(e, t = !0) {
4157
+ !this.threadId || this.chatEnded || (t && (this._emitter.emit("chatEnded"), this.setChatEnded(!0)), this.stopInactivityTimers(), await Ja(this.threadId, e));
4158
+ }
4159
+ reset(e) {
4160
+ this.endChat(e, !1).then(() => {
4161
+ }), this._messages = [], this.setConversationDetails(null), this.setTyping(!1), this.setInputDisabled(!1), this.setChatEnded(!1), this.stopInactivityTimers(), this.storageRemoveAll(), this._emitter.emit("reset");
4149
4162
  }
4150
4163
  destroy() {
4151
4164
  this._emitter.all.clear(), window.removeEventListener("storage", this.onStorageEvent), this.stopInactivityTimers(), this._emitter.emit("destroy");
@@ -4195,7 +4208,7 @@ class Ga {
4195
4208
  const s = this.simulateDelay(2e3);
4196
4209
  this.keepAlive(), await this.insertMessagesWithSimulatedDelays(
4197
4210
  Promise.all([
4198
- Qa(this.threadId, e, t, n),
4211
+ Ya(this.threadId, e, t, n),
4199
4212
  s
4200
4213
  ]).then(([r]) => r)
4201
4214
  );
@@ -4219,7 +4232,7 @@ class Ga {
4219
4232
  this.keepAlive();
4220
4233
  const { messages: n, functions: s } = await this.insertMessagesWithSimulatedDelays(
4221
4234
  Promise.all([
4222
- Ja(this.threadId, e),
4235
+ Qa(this.threadId, e),
4223
4236
  t
4224
4237
  ]).then(([r]) => r)
4225
4238
  );
@@ -4310,7 +4323,7 @@ class Ga {
4310
4323
  function Re(i, e, t) {
4311
4324
  return i ? e(i) : t == null ? void 0 : t(i);
4312
4325
  }
4313
- function Xa(i) {
4326
+ function eo(i) {
4314
4327
  return { all: i = i || /* @__PURE__ */ new Map(), on: function(e, t) {
4315
4328
  var n = i.get(e);
4316
4329
  n ? n.push(t) : i.set(e, [t]);
@@ -4338,7 +4351,7 @@ const Ht = z`
4338
4351
  <path
4339
4352
  d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"/>
4340
4353
  </svg>
4341
- `, eo = z`
4354
+ `, to = z`
4342
4355
  <svg
4343
4356
  xmlns="http://www.w3.org/2000/svg"
4344
4357
  viewBox="0 0 24 24"
@@ -4350,7 +4363,7 @@ const Ht = z`
4350
4363
  <path
4351
4364
  d="M12,3C17.5,3 22,6.58 22,11C22,15.42 17.5,19 12,19C10.76,19 9.57,18.82 8.47,18.5C5.55,21 2,21 2,21C4.33,18.67 4.7,17.1 4.75,16.5C3.05,15.07 2,13.13 2,11C2,6.58 6.5,3 12,3Z"/>
4352
4365
  </svg>
4353
- `, to = z`
4366
+ `, no = z`
4354
4367
  <svg
4355
4368
  xmlns="http://www.w3.org/2000/svg"
4356
4369
  viewBox="0 0 24 24"
@@ -4361,7 +4374,7 @@ const Ht = z`
4361
4374
  <title>send</title>
4362
4375
  <path d="M2,21L23,12L2,3V10L17,12L2,14V21Z"/>
4363
4376
  </svg>
4364
- `, no = z`
4377
+ `, io = z`
4365
4378
  <svg
4366
4379
  xmlns="http://www.w3.org/2000/svg"
4367
4380
  viewBox="0 0 24 24"
@@ -4373,21 +4386,21 @@ const Ht = z`
4373
4386
  <path d="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z" />
4374
4387
  </svg>
4375
4388
  `;
4376
- var io = Object.defineProperty, so = Object.getOwnPropertyDescriptor, ue = (i, e, t, n) => {
4377
- for (var s = n > 1 ? void 0 : n ? so(e, t) : e, r = i.length - 1, a; r >= 0; r--)
4389
+ var so = Object.defineProperty, ro = Object.getOwnPropertyDescriptor, he = (i, e, t, n) => {
4390
+ for (var s = n > 1 ? void 0 : n ? ro(e, t) : e, r = i.length - 1, a; r >= 0; r--)
4378
4391
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
4379
- return n && s && io(e, t, s), s;
4392
+ return n && s && so(e, t, s), s;
4380
4393
  }, Hs = (i, e, t) => {
4381
4394
  if (!e.has(i))
4382
4395
  throw TypeError("Cannot " + t);
4383
- }, rt = (i, e, t) => (Hs(i, e, "read from private field"), t ? t.call(i) : e.get(i)), us = (i, e, t) => {
4396
+ }, rt = (i, e, t) => (Hs(i, e, "read from private field"), t ? t.call(i) : e.get(i)), hs = (i, e, t) => {
4384
4397
  if (e.has(i))
4385
4398
  throw TypeError("Cannot add the same private member more than once");
4386
4399
  e instanceof WeakSet ? e.add(i) : e.set(i, t);
4387
- }, hs = (i, e, t, n) => (Hs(i, e, "write to private field"), n ? n.call(i, t) : e.set(i, t), t), Oe, an;
4400
+ }, us = (i, e, t, n) => (Hs(i, e, "write to private field"), n ? n.call(i, t) : e.set(i, t), t), Oe, an;
4388
4401
  let ie = class extends ne {
4389
4402
  constructor() {
4390
- super(), us(this, Oe, void 0), us(this, an, Promise.resolve()), this.disableInput = !1, this.showTyping = !1, this.messages = [], this.inputValue = "", this.internalDisableInput = !1, this.internalShowTyping = !1, this._emitter = Xa(), this._emitter.on("*", (i, e) => this.dispatchEvent(
4403
+ super(), hs(this, Oe, void 0), hs(this, an, Promise.resolve()), this.disableInput = !1, this.showTyping = !1, this.messages = [], this.inputValue = "", this.internalDisableInput = !1, this.internalShowTyping = !1, this._emitter = eo(), this._emitter.on("*", (i, e) => this.dispatchEvent(
4391
4404
  new CustomEvent(`iai-chat-${i.toString()}`, {
4392
4405
  bubbles: !0,
4393
4406
  // Allow events to be reached through other elements
@@ -4402,7 +4415,7 @@ let ie = class extends ne {
4402
4415
  connectedCallback() {
4403
4416
  super.connectedCallback(), this.cleanOptions = Pn.parse(this.options || {});
4404
4417
  const { assistantId: i, params: e, config: t } = this.cleanOptions;
4405
- hs(this, Oe, new Ga(i, {
4418
+ us(this, Oe, new Xa(i, {
4406
4419
  params: e,
4407
4420
  simulateDelays: t.simulateDelays,
4408
4421
  historyKey: t.historyKey,
@@ -4470,7 +4483,7 @@ let ie = class extends ne {
4470
4483
  class="mr-2 h-6 w-6"
4471
4484
  @click="${this.resetChat}"
4472
4485
  >
4473
- ${no}
4486
+ ${io}
4474
4487
  </button>
4475
4488
 
4476
4489
  ${Re(n, () => z`
@@ -4515,7 +4528,7 @@ let ie = class extends ne {
4515
4528
  class="button rounded-lg p-2 disabled:opacity-50 h-9 w-9"
4516
4529
  .disabled="${this.isSubmitDisabled}"
4517
4530
  >
4518
- ${to}
4531
+ ${no}
4519
4532
  </button>
4520
4533
  </div>
4521
4534
  </form>
@@ -4546,7 +4559,7 @@ let ie = class extends ne {
4546
4559
  return rt(this, Oe);
4547
4560
  }
4548
4561
  resetChat() {
4549
- this.chatManager.reset();
4562
+ this.chatManager.reset("Manually reset by user");
4550
4563
  }
4551
4564
  // Methods
4552
4565
  addMessage(i) {
@@ -4579,7 +4592,7 @@ let ie = class extends ne {
4579
4592
  message: this.inputValue
4580
4593
  },
4581
4594
  cancelable: !0
4582
- })) && (await rt(this, an), hs(this, an, this.chatManager.sendUserMessage(this.inputValue))), this.inputValue = "", this.inputElement && (this.inputElement.style.height = "auto"), this.internalDisableInput = !1, setTimeout(() => {
4595
+ })) && (await rt(this, an), us(this, an, this.chatManager.sendUserMessage(this.inputValue))), this.inputValue = "", this.inputElement && (this.inputElement.style.height = "auto"), this.internalDisableInput = !1, setTimeout(() => {
4583
4596
  this.focusOnInput();
4584
4597
  }, 0));
4585
4598
  }
@@ -4656,37 +4669,37 @@ ie.styles = [Se, nt`
4656
4669
  color: #8c8c8c;
4657
4670
  }
4658
4671
  `];
4659
- ue([
4672
+ he([
4660
4673
  V({ type: Object })
4661
4674
  ], ie.prototype, "options", 2);
4662
- ue([
4675
+ he([
4663
4676
  V()
4664
4677
  ], ie.prototype, "disableInput", 2);
4665
- ue([
4678
+ he([
4666
4679
  V()
4667
4680
  ], ie.prototype, "showTyping", 2);
4668
- ue([
4681
+ he([
4669
4682
  gt()
4670
4683
  ], ie.prototype, "messages", 2);
4671
- ue([
4684
+ he([
4672
4685
  gt()
4673
4686
  ], ie.prototype, "inputValue", 2);
4674
- ue([
4687
+ he([
4675
4688
  gt()
4676
4689
  ], ie.prototype, "internalDisableInput", 2);
4677
- ue([
4690
+ he([
4678
4691
  gt()
4679
4692
  ], ie.prototype, "internalShowTyping", 2);
4680
- ue([
4693
+ he([
4681
4694
  An("#chat-container")
4682
4695
  ], ie.prototype, "chatContainer", 2);
4683
- ue([
4696
+ he([
4684
4697
  An("#message-input")
4685
4698
  ], ie.prototype, "inputElement", 2);
4686
- ue([
4687
- vi.debounce(1)
4699
+ he([
4700
+ bi.debounce(1)
4688
4701
  ], ie.prototype, "scrollChatToBottom", 1);
4689
- ie = ue([
4702
+ ie = he([
4690
4703
  Ee("iai-chat")
4691
4704
  ], ie);
4692
4705
  var Bs = { exports: {} };
@@ -4694,7 +4707,7 @@ var Bs = { exports: {} };
4694
4707
  (function(e) {
4695
4708
  if (typeof window > "u")
4696
4709
  return;
4697
- var t = 0, n = !1, s = !1, r = "message", a = r.length, o = "[iFrameSizer]", l = o.length, d = null, u = window.requestAnimationFrame, p = Object.freeze({
4710
+ var t = 0, n = !1, s = !1, r = "message", a = r.length, o = "[iFrameSizer]", l = o.length, d = null, h = window.requestAnimationFrame, p = Object.freeze({
4698
4711
  max: 1,
4699
4712
  scroll: 1,
4700
4713
  bodyScroll: 1,
@@ -4747,41 +4760,41 @@ var Bs = { exports: {} };
4747
4760
  function D() {
4748
4761
  return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
4749
4762
  }
4750
- function J(h, v, M) {
4751
- h.addEventListener(v, M, !1);
4763
+ function J(u, v, M) {
4764
+ u.addEventListener(v, M, !1);
4752
4765
  }
4753
- function Ce(h, v, M) {
4754
- h.removeEventListener(v, M, !1);
4766
+ function Ce(u, v, M) {
4767
+ u.removeEventListener(v, M, !1);
4755
4768
  }
4756
4769
  function Qt() {
4757
- var h = ["moz", "webkit", "o", "ms"], v;
4758
- for (v = 0; v < h.length && !u; v += 1)
4759
- u = window[h[v] + "RequestAnimationFrame"];
4760
- u ? u = u.bind(window) : N("setup", "RequestAnimationFrame not supported");
4770
+ var u = ["moz", "webkit", "o", "ms"], v;
4771
+ for (v = 0; v < u.length && !h; v += 1)
4772
+ h = window[u[v] + "RequestAnimationFrame"];
4773
+ h ? h = h.bind(window) : N("setup", "RequestAnimationFrame not supported");
4761
4774
  }
4762
- function Yt(h) {
4763
- var v = "Host page: " + h;
4764
- return window.top !== window.self && (v = window.parentIFrame && window.parentIFrame.getId ? window.parentIFrame.getId() + ": " + h : "Nested host page: " + h), v;
4775
+ function Yt(u) {
4776
+ var v = "Host page: " + u;
4777
+ return window.top !== window.self && (v = window.parentIFrame && window.parentIFrame.getId ? window.parentIFrame.getId() + ": " + u : "Nested host page: " + u), v;
4765
4778
  }
4766
- function Gt(h) {
4767
- return o + "[" + Yt(h) + "]";
4779
+ function Gt(u) {
4780
+ return o + "[" + Yt(u) + "]";
4768
4781
  }
4769
- function st(h) {
4770
- return c[h] ? c[h].log : n;
4782
+ function st(u) {
4783
+ return c[u] ? c[u].log : n;
4771
4784
  }
4772
- function N(h, v) {
4773
- Zn("log", h, v, st(h));
4785
+ function N(u, v) {
4786
+ Ln("log", u, v, st(u));
4774
4787
  }
4775
- function Ci(h, v) {
4776
- Zn("info", h, v, st(h));
4788
+ function Ci(u, v) {
4789
+ Ln("info", u, v, st(u));
4777
4790
  }
4778
- function se(h, v) {
4779
- Zn("warn", h, v, !0);
4791
+ function se(u, v) {
4792
+ Ln("warn", u, v, !0);
4780
4793
  }
4781
- function Zn(h, v, M, _) {
4782
- _ === !0 && typeof window.console == "object" && console[h](Gt(v), M);
4794
+ function Ln(u, v, M, _) {
4795
+ _ === !0 && typeof window.console == "object" && console[u](Gt(v), M);
4783
4796
  }
4784
- function or(h) {
4797
+ function or(u) {
4785
4798
  function v() {
4786
4799
  function b() {
4787
4800
  Ni(j), Oi(E), Le("onResized", j);
@@ -4834,10 +4847,10 @@ var Bs = { exports: {} };
4834
4847
  }
4835
4848
  return H.constructor === Array ? B() : Q();
4836
4849
  }
4837
- var C = h.origin, H = c[E] && c[E].checkOrigin;
4850
+ var C = u.origin, H = c[E] && c[E].checkOrigin;
4838
4851
  if (H && "" + C != "null" && !b())
4839
4852
  throw new Error(
4840
- "Unexpected message received from: " + C + " for " + j.iframe.id + ". Message was: " + h.data + ". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains."
4853
+ "Unexpected message received from: " + C + " for " + j.iframe.id + ". Message was: " + u.data + ". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains."
4841
4854
  );
4842
4855
  return !0;
4843
4856
  }
@@ -4860,7 +4873,7 @@ var Bs = { exports: {} };
4860
4873
  message: JSON.parse(b)
4861
4874
  }), N(E, "--");
4862
4875
  }
4863
- function Wn() {
4876
+ function Fn() {
4864
4877
  var b = document.body.getBoundingClientRect(), C = j.iframe.getBoundingClientRect();
4865
4878
  return JSON.stringify({
4866
4879
  iframeHeight: C.height,
@@ -4885,11 +4898,11 @@ var Bs = { exports: {} };
4885
4898
  }
4886
4899
  function Xt(b, C) {
4887
4900
  function H() {
4888
- he("Send Page Info", "pageInfo:" + Wn(), b, C);
4901
+ ue("Send Page Info", "pageInfo:" + Fn(), b, C);
4889
4902
  }
4890
4903
  cr(H, 32, C);
4891
4904
  }
4892
- function Fn() {
4905
+ function Vn() {
4893
4906
  function b(Q, X) {
4894
4907
  function xe() {
4895
4908
  c[B] ? Xt(c[B].iframe, B) : C();
@@ -4907,10 +4920,10 @@ var Bs = { exports: {} };
4907
4920
  var B = E;
4908
4921
  H(), c[B] && (c[B].stopPageInfo = C);
4909
4922
  }
4910
- function Vn() {
4923
+ function qn() {
4911
4924
  c[E] && c[E].stopPageInfo && (c[E].stopPageInfo(), delete c[E].stopPageInfo);
4912
4925
  }
4913
- function qn() {
4926
+ function Kn() {
4914
4927
  var b = !0;
4915
4928
  return j.iframe === null && (se(E, "IFrame (" + j.id + ") not found"), b = !1), b;
4916
4929
  }
@@ -4990,12 +5003,12 @@ var Bs = { exports: {} };
4990
5003
  });
4991
5004
  }
4992
5005
  function Le(b, C) {
4993
- return Ln(E, b, C);
5006
+ return Dn(E, b, C);
4994
5007
  }
4995
- function Kn() {
4996
- switch (c[E] && c[E].firstRun && Yn(), j.type) {
5008
+ function Jn() {
5009
+ switch (c[E] && c[E].firstRun && Gn(), j.type) {
4997
5010
  case "close": {
4998
- Dn(j.iframe);
5011
+ Un(j.iframe);
4999
5012
  break;
5000
5013
  }
5001
5014
  case "message": {
@@ -5026,11 +5039,11 @@ var Bs = { exports: {} };
5026
5039
  Xt(
5027
5040
  c[E] && c[E].iframe,
5028
5041
  E
5029
- ), Fn();
5042
+ ), Vn();
5030
5043
  break;
5031
5044
  }
5032
5045
  case "pageInfoStop": {
5033
- Vn();
5046
+ qn();
5034
5047
  break;
5035
5048
  }
5036
5049
  case "inPageLink": {
@@ -5051,117 +5064,117 @@ var Bs = { exports: {} };
5051
5064
  ) : v();
5052
5065
  }
5053
5066
  }
5054
- function Jn(b) {
5067
+ function Qn(b) {
5055
5068
  var C = !0;
5056
5069
  return c[b] || (C = !1, se(
5057
5070
  j.type + " No settings for " + b + ". Message was: " + ae
5058
5071
  )), C;
5059
5072
  }
5060
- function Qn() {
5073
+ function Yn() {
5061
5074
  for (var b in c)
5062
- he(
5075
+ ue(
5063
5076
  "iFrame requested init",
5064
5077
  ji(b),
5065
5078
  c[b].iframe,
5066
5079
  b
5067
5080
  );
5068
5081
  }
5069
- function Yn() {
5082
+ function Gn() {
5070
5083
  c[E] && (c[E].firstRun = !1);
5071
5084
  }
5072
- var ae = h.data, j = {}, E = null;
5073
- ae === "[iFrameResizerChild]Ready" ? Qn() : Ze() ? (j = M(), E = j.id, c[E] && (c[E].loaded = !0), !be() && Jn(E) && (N(E, "Received: " + ae), qn() && pe() && Kn())) : Ci(E, "Ignored: " + ae);
5085
+ var ae = u.data, j = {}, E = null;
5086
+ ae === "[iFrameResizerChild]Ready" ? Yn() : Ze() ? (j = M(), E = j.id, c[E] && (c[E].loaded = !0), !be() && Qn(E) && (N(E, "Received: " + ae), Kn() && pe() && Jn())) : Ci(E, "Ignored: " + ae);
5074
5087
  }
5075
- function Ln(h, v, M) {
5088
+ function Dn(u, v, M) {
5076
5089
  var _ = null, R = null;
5077
- if (c[h])
5078
- if (_ = c[h][v], typeof _ == "function")
5090
+ if (c[u])
5091
+ if (_ = c[u][v], typeof _ == "function")
5079
5092
  R = _(M);
5080
5093
  else
5081
5094
  throw new TypeError(
5082
- v + " on iFrame[" + h + "] is not a function"
5095
+ v + " on iFrame[" + u + "] is not a function"
5083
5096
  );
5084
5097
  return R;
5085
5098
  }
5086
- function Ai(h) {
5087
- var v = h.id;
5099
+ function Ai(u) {
5100
+ var v = u.id;
5088
5101
  delete c[v];
5089
5102
  }
5090
- function Dn(h) {
5091
- var v = h.id;
5092
- if (Ln(v, "onClose", v) === !1) {
5103
+ function Un(u) {
5104
+ var v = u.id;
5105
+ if (Dn(v, "onClose", v) === !1) {
5093
5106
  N(v, "Close iframe cancelled by onClose event");
5094
5107
  return;
5095
5108
  }
5096
5109
  N(v, "Removing iFrame: " + v);
5097
5110
  try {
5098
- h.parentNode && h.parentNode.removeChild(h);
5111
+ u.parentNode && u.parentNode.removeChild(u);
5099
5112
  } catch (M) {
5100
5113
  se(M);
5101
5114
  }
5102
- Ln(v, "onClosed", v), N(v, "--"), Ai(h);
5115
+ Dn(v, "onClosed", v), N(v, "--"), Ai(u);
5103
5116
  }
5104
- function Ii(h) {
5117
+ function Ii(u) {
5105
5118
  d === null && (d = {
5106
5119
  x: window.pageXOffset === e ? document.documentElement.scrollLeft : window.pageXOffset,
5107
5120
  y: window.pageYOffset === e ? document.documentElement.scrollTop : window.pageYOffset
5108
5121
  }, N(
5109
- h,
5122
+ u,
5110
5123
  "Get page position: " + d.x + "," + d.y
5111
5124
  ));
5112
5125
  }
5113
- function Oi(h) {
5126
+ function Oi(u) {
5114
5127
  d !== null && (window.scrollTo(d.x, d.y), N(
5115
- h,
5128
+ u,
5116
5129
  "Set page position: " + d.x + "," + d.y
5117
5130
  ), Mi());
5118
5131
  }
5119
5132
  function Mi() {
5120
5133
  d = null;
5121
5134
  }
5122
- function Ri(h) {
5135
+ function Ri(u) {
5123
5136
  function v() {
5124
- Ni(h), he("reset", "reset", h.iframe, h.id);
5137
+ Ni(u), ue("reset", "reset", u.iframe, u.id);
5125
5138
  }
5126
5139
  N(
5127
- h.id,
5128
- "Size reset requested by " + (h.type === "init" ? "host page" : "iFrame")
5129
- ), Ii(h.id), Pi(v, h, "reset");
5140
+ u.id,
5141
+ "Size reset requested by " + (u.type === "init" ? "host page" : "iFrame")
5142
+ ), Ii(u.id), Pi(v, u, "reset");
5130
5143
  }
5131
- function Ni(h) {
5144
+ function Ni(u) {
5132
5145
  function v(Z) {
5133
- if (!h.id) {
5146
+ if (!u.id) {
5134
5147
  N("undefined", "messageData id not set");
5135
5148
  return;
5136
5149
  }
5137
- h.iframe.style[Z] = h[Z] + "px", N(
5138
- h.id,
5139
- "IFrame (" + R + ") " + Z + " set to " + h[Z] + "px"
5150
+ u.iframe.style[Z] = u[Z] + "px", N(
5151
+ u.id,
5152
+ "IFrame (" + R + ") " + Z + " set to " + u[Z] + "px"
5140
5153
  );
5141
5154
  }
5142
5155
  function M(Z) {
5143
- !s && h[Z] === "0" && (s = !0, N(R, "Hidden iFrame detected, creating visibility listener"), dr());
5156
+ !s && u[Z] === "0" && (s = !0, N(R, "Hidden iFrame detected, creating visibility listener"), dr());
5144
5157
  }
5145
5158
  function _(Z) {
5146
5159
  v(Z), M(Z);
5147
5160
  }
5148
- var R = h.iframe.id;
5161
+ var R = u.iframe.id;
5149
5162
  c[R] && (c[R].sizeHeight && _("height"), c[R].sizeWidth && _("width"));
5150
5163
  }
5151
- function Pi(h, v, M) {
5152
- M !== v.type && u && // including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame
5153
- !window.jasmine ? (N(v.id, "Requesting animation frame"), u(h)) : h();
5164
+ function Pi(u, v, M) {
5165
+ M !== v.type && h && // including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame
5166
+ !window.jasmine ? (N(v.id, "Requesting animation frame"), h(u)) : u();
5154
5167
  }
5155
- function he(h, v, M, _, R) {
5168
+ function ue(u, v, M, _, R) {
5156
5169
  function Z() {
5157
5170
  var Ae = c[_] && c[_].targetOrigin;
5158
5171
  N(
5159
5172
  _,
5160
- "[" + h + "] Sending msg to iframe[" + _ + "] (" + v + ") targetOrigin: " + Ae
5173
+ "[" + u + "] Sending msg to iframe[" + _ + "] (" + v + ") targetOrigin: " + Ae
5161
5174
  ), M.contentWindow.postMessage(o + v, Ae);
5162
5175
  }
5163
5176
  function pe() {
5164
- se(_, "[" + h + "] IFrame(" + _ + ") not found");
5177
+ se(_, "[" + u + "] IFrame(" + _ + ") not found");
5165
5178
  }
5166
5179
  function Ze() {
5167
5180
  M && "contentWindow" in M && M.contentWindow !== null ? Z() : pe();
@@ -5181,17 +5194,17 @@ var Bs = { exports: {} };
5181
5194
  var we = !1;
5182
5195
  _ = _ || M.id, c[_] && (Ze(), be());
5183
5196
  }
5184
- function ji(h) {
5185
- return h + ":" + c[h].bodyMarginV1 + ":" + c[h].sizeWidth + ":" + c[h].log + ":" + c[h].interval + ":" + c[h].enablePublicMethods + ":" + c[h].autoResize + ":" + c[h].bodyMargin + ":" + c[h].heightCalculationMethod + ":" + c[h].bodyBackground + ":" + c[h].bodyPadding + ":" + c[h].tolerance + ":" + c[h].inPageLinks + ":" + c[h].resizeFrom + ":" + c[h].widthCalculationMethod + ":" + c[h].mouseEvents;
5197
+ function ji(u) {
5198
+ return u + ":" + c[u].bodyMarginV1 + ":" + c[u].sizeWidth + ":" + c[u].log + ":" + c[u].interval + ":" + c[u].enablePublicMethods + ":" + c[u].autoResize + ":" + c[u].bodyMargin + ":" + c[u].heightCalculationMethod + ":" + c[u].bodyBackground + ":" + c[u].bodyPadding + ":" + c[u].tolerance + ":" + c[u].inPageLinks + ":" + c[u].resizeFrom + ":" + c[u].widthCalculationMethod + ":" + c[u].mouseEvents;
5186
5199
  }
5187
- function lr(h) {
5188
- return typeof h == "number";
5200
+ function lr(u) {
5201
+ return typeof u == "number";
5189
5202
  }
5190
- function zi(h, v) {
5203
+ function zi(u, v) {
5191
5204
  function M() {
5192
5205
  function $(Y) {
5193
5206
  var re = c[k][Y];
5194
- re !== 1 / 0 && re !== 0 && (h.style[Y] = lr(re) ? re + "px" : re, N(k, "Set " + Y + " = " + h.style[Y]));
5207
+ re !== 1 / 0 && re !== 0 && (u.style[Y] = lr(re) ? re + "px" : re, N(k, "Set " + Y + " = " + u.style[Y]));
5195
5208
  }
5196
5209
  function K(Y) {
5197
5210
  if (c[k]["min" + Y] > c[k]["max" + Y])
@@ -5208,28 +5221,28 @@ var Bs = { exports: {} };
5208
5221
  function R($) {
5209
5222
  if (typeof $ != "string")
5210
5223
  throw new TypeError("Invaild id for iFrame. Expected String");
5211
- return $ === "" && (h.id = $ = _(), n = (v || {}).log, N(
5224
+ return $ === "" && (u.id = $ = _(), n = (v || {}).log, N(
5212
5225
  $,
5213
- "Added missing iframe ID: " + $ + " (" + h.src + ")"
5226
+ "Added missing iframe ID: " + $ + " (" + u.src + ")"
5214
5227
  )), $;
5215
5228
  }
5216
5229
  function Z() {
5217
5230
  switch (N(
5218
5231
  k,
5219
5232
  "IFrame scrolling " + (c[k] && c[k].scrolling ? "enabled" : "disabled") + " for " + k
5220
- ), h.style.overflow = (c[k] && c[k].scrolling) === !1 ? "hidden" : "auto", c[k] && c[k].scrolling) {
5233
+ ), u.style.overflow = (c[k] && c[k].scrolling) === !1 ? "hidden" : "auto", c[k] && c[k].scrolling) {
5221
5234
  case "omit":
5222
5235
  break;
5223
5236
  case !0: {
5224
- h.scrolling = "yes";
5237
+ u.scrolling = "yes";
5225
5238
  break;
5226
5239
  }
5227
5240
  case !1: {
5228
- h.scrolling = "no";
5241
+ u.scrolling = "no";
5229
5242
  break;
5230
5243
  }
5231
5244
  default:
5232
- h.scrolling = c[k] ? c[k].scrolling : "no";
5245
+ u.scrolling = c[k] ? c[k].scrolling : "no";
5233
5246
  }
5234
5247
  }
5235
5248
  function pe() {
@@ -5237,23 +5250,23 @@ var Bs = { exports: {} };
5237
5250
  }
5238
5251
  function Ze() {
5239
5252
  var $ = c[k] && c[k].firstRun, K = c[k] && c[k].heightCalculationMethod in p;
5240
- !$ && K && Ri({ iframe: h, height: 0, width: 0, type: "init" });
5253
+ !$ && K && Ri({ iframe: u, height: 0, width: 0, type: "init" });
5241
5254
  }
5242
5255
  function be() {
5243
5256
  c[k] && (c[k].iframe.iFrameResizer = {
5244
- close: Dn.bind(null, c[k].iframe),
5257
+ close: Un.bind(null, c[k].iframe),
5245
5258
  removeListeners: Ai.bind(
5246
5259
  null,
5247
5260
  c[k].iframe
5248
5261
  ),
5249
- resize: he.bind(
5262
+ resize: ue.bind(
5250
5263
  null,
5251
5264
  "Window resize",
5252
5265
  "resize",
5253
5266
  c[k].iframe
5254
5267
  ),
5255
5268
  moveToAnchor: function($) {
5256
- he(
5269
+ ue(
5257
5270
  "Move to anchor",
5258
5271
  "moveToAnchor:" + $,
5259
5272
  c[k].iframe,
@@ -5261,7 +5274,7 @@ var Bs = { exports: {} };
5261
5274
  );
5262
5275
  },
5263
5276
  sendMessage: function($) {
5264
- $ = JSON.stringify($), he(
5277
+ $ = JSON.stringify($), ue(
5265
5278
  "Send Message",
5266
5279
  "message:" + $,
5267
5280
  c[k].iframe,
@@ -5272,31 +5285,31 @@ var Bs = { exports: {} };
5272
5285
  }
5273
5286
  function we($) {
5274
5287
  function K() {
5275
- he("iFrame.onload", $, h, e, !0), Ze();
5288
+ ue("iFrame.onload", $, u, e, !0), Ze();
5276
5289
  }
5277
5290
  function Y(Le) {
5278
- if (h.parentNode) {
5279
- var Kn = new Le(function(Jn) {
5280
- Jn.forEach(function(Qn) {
5281
- var Yn = Array.prototype.slice.call(Qn.removedNodes);
5282
- Yn.forEach(function(ae) {
5283
- ae === h && Dn(h);
5291
+ if (u.parentNode) {
5292
+ var Jn = new Le(function(Qn) {
5293
+ Qn.forEach(function(Yn) {
5294
+ var Gn = Array.prototype.slice.call(Yn.removedNodes);
5295
+ Gn.forEach(function(ae) {
5296
+ ae === u && Un(u);
5284
5297
  });
5285
5298
  });
5286
5299
  });
5287
- Kn.observe(h.parentNode, {
5300
+ Jn.observe(u.parentNode, {
5288
5301
  childList: !0
5289
5302
  });
5290
5303
  }
5291
5304
  }
5292
5305
  var re = D();
5293
- re && Y(re), J(h, "load", K), he("init", $, h, e, !0);
5306
+ re && Y(re), J(u, "load", K), ue("init", $, u, e, !0);
5294
5307
  }
5295
5308
  function Ae($) {
5296
5309
  if (typeof $ != "object")
5297
5310
  throw new TypeError("Options is not an object");
5298
5311
  }
5299
- function Wn($) {
5312
+ function Fn($) {
5300
5313
  for (var K in O)
5301
5314
  Object.prototype.hasOwnProperty.call(O, K) && (c[k][K] = Object.prototype.hasOwnProperty.call(
5302
5315
  $,
@@ -5306,7 +5319,7 @@ var Bs = { exports: {} };
5306
5319
  function Xt($) {
5307
5320
  return $ === "" || $.match(/^(about:blank|javascript:|file:\/\/)/) !== null ? "*" : $;
5308
5321
  }
5309
- function Fn($) {
5322
+ function Vn($) {
5310
5323
  var K = $.split("Callback");
5311
5324
  if (K.length === 2) {
5312
5325
  var Y = "on" + K[0].charAt(0).toUpperCase() + K[0].slice(1);
@@ -5316,28 +5329,28 @@ var Bs = { exports: {} };
5316
5329
  );
5317
5330
  }
5318
5331
  }
5319
- function Vn($) {
5320
- $ = $ || {}, c[k] = /* @__PURE__ */ Object.create(null), c[k].iframe = h, c[k].firstRun = !0, c[k].remoteHost = h.src && h.src.split("/").slice(0, 3).join("/"), Ae($), Object.keys($).forEach(Fn, $), Wn($), c[k] && (c[k].targetOrigin = c[k].checkOrigin === !0 ? Xt(c[k].remoteHost) : "*");
5332
+ function qn($) {
5333
+ $ = $ || {}, c[k] = /* @__PURE__ */ Object.create(null), c[k].iframe = u, c[k].firstRun = !0, c[k].remoteHost = u.src && u.src.split("/").slice(0, 3).join("/"), Ae($), Object.keys($).forEach(Vn, $), Fn($), c[k] && (c[k].targetOrigin = c[k].checkOrigin === !0 ? Xt(c[k].remoteHost) : "*");
5321
5334
  }
5322
- function qn() {
5323
- return k in c && "iFrameResizer" in h;
5335
+ function Kn() {
5336
+ return k in c && "iFrameResizer" in u;
5324
5337
  }
5325
- var k = R(h.id);
5326
- qn() ? se(k, "Ignored iFrame, already setup.") : (Vn(v), Z(), M(), pe(), we(ji(k)), be());
5338
+ var k = R(u.id);
5339
+ Kn() ? se(k, "Ignored iFrame, already setup.") : (qn(v), Z(), M(), pe(), we(ji(k)), be());
5327
5340
  }
5328
- function Un(h, v) {
5341
+ function Hn(u, v) {
5329
5342
  g === null && (g = setTimeout(function() {
5330
- g = null, h();
5343
+ g = null, u();
5331
5344
  }, v));
5332
5345
  }
5333
- var Hn = {};
5334
- function cr(h, v, M) {
5335
- Hn[M] || (Hn[M] = setTimeout(function() {
5336
- Hn[M] = null, h();
5346
+ var Bn = {};
5347
+ function cr(u, v, M) {
5348
+ Bn[M] || (Bn[M] = setTimeout(function() {
5349
+ Bn[M] = null, u();
5337
5350
  }, v));
5338
5351
  }
5339
5352
  function dr() {
5340
- function h() {
5353
+ function u() {
5341
5354
  function R(Z) {
5342
5355
  function pe(be) {
5343
5356
  return (c[Z] && c[Z].iframe.style[be]) === "0px";
@@ -5345,7 +5358,7 @@ var Bs = { exports: {} };
5345
5358
  function Ze(be) {
5346
5359
  return be.offsetParent !== null;
5347
5360
  }
5348
- c[Z] && Ze(c[Z].iframe) && (pe("height") || pe("width")) && he(
5361
+ c[Z] && Ze(c[Z].iframe) && (pe("height") || pe("width")) && ue(
5349
5362
  "Visibility change",
5350
5363
  "resize",
5351
5364
  c[Z].iframe,
@@ -5360,7 +5373,7 @@ var Bs = { exports: {} };
5360
5373
  N(
5361
5374
  "window",
5362
5375
  "Mutation observed: " + R[0].target + " " + R[0].type
5363
- ), Un(h, 16);
5376
+ ), Hn(u, 16);
5364
5377
  }
5365
5378
  function M() {
5366
5379
  var R = document.querySelector("body"), Z = {
@@ -5376,33 +5389,33 @@ var Bs = { exports: {} };
5376
5389
  var _ = D();
5377
5390
  _ && M();
5378
5391
  }
5379
- function ur(h) {
5392
+ function hr(u) {
5380
5393
  function v() {
5381
- Li("Window " + h, "resize");
5394
+ Li("Window " + u, "resize");
5382
5395
  }
5383
- N("window", "Trigger event: " + h), Un(v, 16);
5396
+ N("window", "Trigger event: " + u), Hn(v, 16);
5384
5397
  }
5385
5398
  function Zi() {
5386
- function h() {
5399
+ function u() {
5387
5400
  Li("Tab Visible", "resize");
5388
5401
  }
5389
- document.visibilityState !== "hidden" && (N("document", "Trigger event: Visibility change"), Un(h, 16));
5402
+ document.visibilityState !== "hidden" && (N("document", "Trigger event: Visibility change"), Hn(u, 16));
5390
5403
  }
5391
- function Li(h, v) {
5404
+ function Li(u, v) {
5392
5405
  function M(_) {
5393
5406
  return c[_] && c[_].resizeFrom === "parent" && c[_].autoResize && !c[_].firstRun;
5394
5407
  }
5395
5408
  Object.keys(c).forEach(function(_) {
5396
- M(_) && he(h, v, c[_].iframe, _);
5409
+ M(_) && ue(u, v, c[_].iframe, _);
5397
5410
  });
5398
5411
  }
5399
- function hr() {
5412
+ function ur() {
5400
5413
  J(window, "message", or), J(window, "resize", function() {
5401
- ur("resize");
5414
+ hr("resize");
5402
5415
  }), J(document, "visibilitychange", Zi), J(document, "-webkit-visibilitychange", Zi);
5403
5416
  }
5404
- function Bn() {
5405
- function h(_, R) {
5417
+ function Wn() {
5418
+ function u(_, R) {
5406
5419
  function Z() {
5407
5420
  if (R.tagName) {
5408
5421
  if (R.tagName.toUpperCase() !== "IFRAME")
@@ -5420,18 +5433,18 @@ var Bs = { exports: {} };
5420
5433
  );
5421
5434
  }
5422
5435
  var M;
5423
- return Qt(), hr(), function(_, R) {
5436
+ return Qt(), ur(), function(_, R) {
5424
5437
  switch (M = [], v(_), typeof R) {
5425
5438
  case "undefined":
5426
5439
  case "string": {
5427
5440
  Array.prototype.forEach.call(
5428
5441
  document.querySelectorAll(R || "iframe"),
5429
- h.bind(e, _)
5442
+ u.bind(e, _)
5430
5443
  );
5431
5444
  break;
5432
5445
  }
5433
5446
  case "object": {
5434
- h(_, R);
5447
+ u(_, R);
5435
5448
  break;
5436
5449
  }
5437
5450
  default:
@@ -5440,30 +5453,30 @@ var Bs = { exports: {} };
5440
5453
  return M;
5441
5454
  };
5442
5455
  }
5443
- function pr(h) {
5444
- h.fn ? h.fn.iFrameResize || (h.fn.iFrameResize = function(v) {
5456
+ function pr(u) {
5457
+ u.fn ? u.fn.iFrameResize || (u.fn.iFrameResize = function(v) {
5445
5458
  function M(_, R) {
5446
5459
  zi(R, v);
5447
5460
  }
5448
5461
  return this.filter("iframe").each(M).end();
5449
5462
  }) : Ci("", "Unable to bind to jQuery, it is not fully loaded.");
5450
5463
  }
5451
- window.jQuery !== e && pr(window.jQuery), typeof e == "function" && e.amd ? e([], Bn) : i.exports = Bn(), window.iFrameResize = window.iFrameResize || Bn();
5464
+ window.jQuery !== e && pr(window.jQuery), typeof e == "function" && e.amd ? e([], Wn) : i.exports = Wn(), window.iFrameResize = window.iFrameResize || Wn();
5452
5465
  })();
5453
5466
  })(Bs);
5454
- var ro = Bs.exports;
5455
- const ao = /* @__PURE__ */ qr(ro);
5456
- var oo = Object.defineProperty, lo = Object.getOwnPropertyDescriptor, wi = (i, e, t, n) => {
5457
- for (var s = n > 1 ? void 0 : n ? lo(e, t) : e, r = i.length - 1, a; r >= 0; r--)
5467
+ var ao = Bs.exports;
5468
+ const oo = /* @__PURE__ */ qr(ao);
5469
+ var lo = Object.defineProperty, co = Object.getOwnPropertyDescriptor, wi = (i, e, t, n) => {
5470
+ for (var s = n > 1 ? void 0 : n ? co(e, t) : e, r = i.length - 1, a; r >= 0; r--)
5458
5471
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
5459
- return n && s && oo(e, t, s), s;
5472
+ return n && s && lo(e, t, s), s;
5460
5473
  };
5461
5474
  let Bt = class extends ne {
5462
5475
  constructor() {
5463
5476
  super(...arguments), this.src = "", this.showCloseButton = !1;
5464
5477
  }
5465
5478
  async onLoad(i) {
5466
- ao({
5479
+ oo({
5467
5480
  log: !1,
5468
5481
  heightCalculationMethod: "max",
5469
5482
  onMessage: ({ message: e }) => {
@@ -5506,10 +5519,10 @@ wi([
5506
5519
  Bt = wi([
5507
5520
  Ee("iai-chat-iframe")
5508
5521
  ], Bt);
5509
- var co = Object.defineProperty, uo = Object.getOwnPropertyDescriptor, ft = (i, e, t, n) => {
5522
+ var ho = Object.defineProperty, uo = Object.getOwnPropertyDescriptor, ft = (i, e, t, n) => {
5510
5523
  for (var s = n > 1 ? void 0 : n ? uo(e, t) : e, r = i.length - 1, a; r >= 0; r--)
5511
5524
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
5512
- return n && s && co(e, t, s), s;
5525
+ return n && s && ho(e, t, s), s;
5513
5526
  };
5514
5527
  let ze = class extends ne {
5515
5528
  constructor() {
@@ -5587,7 +5600,7 @@ ze = ft([
5587
5600
  * Copyright 2017 Google LLC
5588
5601
  * SPDX-License-Identifier: BSD-3-Clause
5589
5602
  */
5590
- class oi extends Mn {
5603
+ class li extends Mn {
5591
5604
  constructor(e) {
5592
5605
  if (super(e), this.it = q, e.type !== In.CHILD)
5593
5606
  throw Error(this.constructor.directiveName + "() can only be used in child bindings");
@@ -5606,8 +5619,8 @@ class oi extends Mn {
5606
5619
  return t.raw = t, this._t = { _$litType$: this.constructor.resultType, strings: t, values: [] };
5607
5620
  }
5608
5621
  }
5609
- oi.directiveName = "unsafeHTML", oi.resultType = 1;
5610
- const Ws = On(oi);
5622
+ li.directiveName = "unsafeHTML", li.resultType = 1;
5623
+ const Ws = On(li);
5611
5624
  function xi() {
5612
5625
  return {
5613
5626
  async: !1,
@@ -5626,33 +5639,33 @@ let it = xi();
5626
5639
  function Fs(i) {
5627
5640
  it = i;
5628
5641
  }
5629
- const Vs = /[&<>"']/, ho = new RegExp(Vs.source, "g"), qs = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, po = new RegExp(qs.source, "g"), mo = {
5642
+ const Vs = /[&<>"']/, po = new RegExp(Vs.source, "g"), qs = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, mo = new RegExp(qs.source, "g"), go = {
5630
5643
  "&": "&amp;",
5631
5644
  "<": "&lt;",
5632
5645
  ">": "&gt;",
5633
5646
  '"': "&quot;",
5634
5647
  "'": "&#39;"
5635
- }, ps = (i) => mo[i];
5648
+ }, ps = (i) => go[i];
5636
5649
  function te(i, e) {
5637
5650
  if (e) {
5638
5651
  if (Vs.test(i))
5639
- return i.replace(ho, ps);
5652
+ return i.replace(po, ps);
5640
5653
  } else if (qs.test(i))
5641
- return i.replace(po, ps);
5654
+ return i.replace(mo, ps);
5642
5655
  return i;
5643
5656
  }
5644
- const go = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
5645
- function fo(i) {
5646
- return i.replace(go, (e, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""));
5657
+ const fo = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
5658
+ function yo(i) {
5659
+ return i.replace(fo, (e, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""));
5647
5660
  }
5648
- const yo = /(^|[^\[])\^/g;
5661
+ const vo = /(^|[^\[])\^/g;
5649
5662
  function U(i, e) {
5650
5663
  let t = typeof i == "string" ? i : i.source;
5651
5664
  e = e || "";
5652
5665
  const n = {
5653
5666
  replace: (s, r) => {
5654
5667
  let a = typeof r == "string" ? r : r.source;
5655
- return a = a.replace(yo, "$1"), t = t.replace(s, a), n;
5668
+ return a = a.replace(vo, "$1"), t = t.replace(s, a), n;
5656
5669
  },
5657
5670
  getRegex: () => new RegExp(t, e)
5658
5671
  };
@@ -5701,7 +5714,7 @@ function tn(i, e, t) {
5701
5714
  }
5702
5715
  return i.slice(0, n - s);
5703
5716
  }
5704
- function vo(i, e) {
5717
+ function bo(i, e) {
5705
5718
  if (i.indexOf(e[1]) === -1)
5706
5719
  return -1;
5707
5720
  let t = 0;
@@ -5736,7 +5749,7 @@ function fs(i, e, t, n) {
5736
5749
  text: te(a)
5737
5750
  };
5738
5751
  }
5739
- function bo(i, e) {
5752
+ function wo(i, e) {
5740
5753
  const t = i.match(/^(\s+)(?:```)/);
5741
5754
  if (t === null)
5742
5755
  return e;
@@ -5780,7 +5793,7 @@ class _n {
5780
5793
  fences(e) {
5781
5794
  const t = this.rules.block.fences.exec(e);
5782
5795
  if (t) {
5783
- const n = t[0], s = bo(n, t[3] || "");
5796
+ const n = t[0], s = wo(n, t[3] || "");
5784
5797
  return {
5785
5798
  type: "code",
5786
5799
  raw: n,
@@ -5848,7 +5861,7 @@ class _n {
5848
5861
  const a = new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);
5849
5862
  let o = "", l = "", d = !1;
5850
5863
  for (; e; ) {
5851
- let u = !1;
5864
+ let h = !1;
5852
5865
  if (!(t = a.exec(e)) || this.rules.block.hr.test(e))
5853
5866
  break;
5854
5867
  o = t[0], e = e.substring(o.length);
@@ -5858,7 +5871,7 @@ class _n {
5858
5871
  this.options.pedantic ? (g = 2, l = p.trimStart()) : (g = t[2].search(/[^ ]/), g = g > 4 ? 1 : g, l = p.slice(g), g += t[1].length);
5859
5872
  let O = !1;
5860
5873
  if (!p && /^ *$/.test(c) && (o += c + `
5861
- `, e = e.substring(c.length + 1), u = !0), !u) {
5874
+ `, e = e.substring(c.length + 1), h = !0), !h) {
5862
5875
  const Ce = new RegExp(`^ {0,${Math.min(3, g - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), Qt = new RegExp(`^ {0,${Math.min(3, g - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), Yt = new RegExp(`^ {0,${Math.min(3, g - 1)}}(?:\`\`\`|~~~)`), Gt = new RegExp(`^ {0,${Math.min(3, g - 1)}}#`);
5863
5876
  for (; e; ) {
5864
5877
  const st = e.split(`
@@ -5891,14 +5904,14 @@ class _n {
5891
5904
  }), r.raw += o;
5892
5905
  }
5893
5906
  r.items[r.items.length - 1].raw = o.trimEnd(), r.items[r.items.length - 1].text = l.trimEnd(), r.raw = r.raw.trimEnd();
5894
- for (let u = 0; u < r.items.length; u++)
5895
- if (this.lexer.state.top = !1, r.items[u].tokens = this.lexer.blockTokens(r.items[u].text, []), !r.loose) {
5896
- const p = r.items[u].tokens.filter((g) => g.type === "space"), c = p.length > 0 && p.some((g) => /\n.*\n/.test(g.raw));
5907
+ for (let h = 0; h < r.items.length; h++)
5908
+ if (this.lexer.state.top = !1, r.items[h].tokens = this.lexer.blockTokens(r.items[h].text, []), !r.loose) {
5909
+ const p = r.items[h].tokens.filter((g) => g.type === "space"), c = p.length > 0 && p.some((g) => /\n.*\n/.test(g.raw));
5897
5910
  r.loose = c;
5898
5911
  }
5899
5912
  if (r.loose)
5900
- for (let u = 0; u < r.items.length; u++)
5901
- r.items[u].loose = !0;
5913
+ for (let h = 0; h < r.items.length; h++)
5914
+ r.items[h].loose = !0;
5902
5915
  return r;
5903
5916
  }
5904
5917
  }
@@ -6020,7 +6033,7 @@ class _n {
6020
6033
  if ((n.length - a.length) % 2 === 0)
6021
6034
  return;
6022
6035
  } else {
6023
- const a = vo(t[2], "()");
6036
+ const a = bo(t[2], "()");
6024
6037
  if (a > -1) {
6025
6038
  const o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + a;
6026
6039
  t[2] = t[2].substring(0, a), t[0] = t[0].substring(0, o).trim(), t[3] = "";
@@ -6058,8 +6071,8 @@ class _n {
6058
6071
  if (!(!s || s[3] && n.match(/[\p{L}\p{N}]/u)) && (!(s[1] || s[2]) || !n || this.rules.inline.punctuation.exec(n))) {
6059
6072
  const r = [...s[0]].length - 1;
6060
6073
  let a, o, l = r, d = 0;
6061
- const u = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
6062
- for (u.lastIndex = 0, t = t.slice(-1 * e.length + r); (s = u.exec(t)) != null; ) {
6074
+ const h = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
6075
+ for (h.lastIndex = 0, t = t.slice(-1 * e.length + r); (s = h.exec(t)) != null; ) {
6063
6076
  if (a = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !a)
6064
6077
  continue;
6065
6078
  if (o = [...a].length, s[3] || s[4]) {
@@ -6182,25 +6195,25 @@ class _n {
6182
6195
  }
6183
6196
  }
6184
6197
  }
6185
- const wo = /^(?: *(?:\n|$))+/, xo = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, _o = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, qt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ko = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Ks = /(?:[*+-]|\d{1,9}[.)])/, Js = U(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, Ks).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), _i = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, $o = /^[^\n]+/, ki = /(?!\s*\])(?:\\.|[^\[\]\\])+/, To = U(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", ki).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Eo = U(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Ks).getRegex(), jn = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", $i = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, So = U("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", $i).replace("tag", jn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Qs = U(_i).replace("hr", qt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", jn).getRegex(), Co = U(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Qs).getRegex(), Ti = {
6186
- blockquote: Co,
6187
- code: xo,
6188
- def: To,
6189
- fences: _o,
6190
- heading: ko,
6198
+ const xo = /^(?: *(?:\n|$))+/, _o = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, ko = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, qt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, $o = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Ks = /(?:[*+-]|\d{1,9}[.)])/, Js = U(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, Ks).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), _i = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, To = /^[^\n]+/, ki = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Eo = U(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", ki).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), So = U(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Ks).getRegex(), zn = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", $i = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Co = U("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", $i).replace("tag", zn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Qs = U(_i).replace("hr", qt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", zn).getRegex(), Ao = U(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Qs).getRegex(), Ti = {
6199
+ blockquote: Ao,
6200
+ code: _o,
6201
+ def: Eo,
6202
+ fences: ko,
6203
+ heading: $o,
6191
6204
  hr: qt,
6192
- html: So,
6205
+ html: Co,
6193
6206
  lheading: Js,
6194
- list: Eo,
6195
- newline: wo,
6207
+ list: So,
6208
+ newline: xo,
6196
6209
  paragraph: Qs,
6197
6210
  table: kt,
6198
- text: $o
6199
- }, ys = U("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", qt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", jn).getRegex(), Ao = {
6211
+ text: To
6212
+ }, ys = U("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", qt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", zn).getRegex(), Io = {
6200
6213
  ...Ti,
6201
6214
  table: ys,
6202
- paragraph: U(_i).replace("hr", qt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ys).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", jn).getRegex()
6203
- }, Io = {
6215
+ paragraph: U(_i).replace("hr", qt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ys).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", zn).getRegex()
6216
+ }, Oo = {
6204
6217
  ...Ti,
6205
6218
  html: U(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", $i).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
6206
6219
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
@@ -6210,51 +6223,51 @@ const wo = /^(?: *(?:\n|$))+/, xo = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, _o =
6210
6223
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
6211
6224
  paragraph: U(_i).replace("hr", qt).replace("heading", ` *#{1,6} *[^
6212
6225
  ]`).replace("lheading", Js).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
6213
- }, Ys = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Oo = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Gs = /^( {2,}|\\)\n(?!\s*$)/, Mo = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Kt = "\\p{P}\\p{S}", Ro = U(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, Kt).getRegex(), No = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, Po = U(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, Kt).getRegex(), jo = U("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, Kt).getRegex(), zo = U("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, Kt).getRegex(), Zo = U(/\\([punct])/, "gu").replace(/punct/g, Kt).getRegex(), Lo = U(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Do = U($i).replace("(?:-->|$)", "-->").getRegex(), Uo = U("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Do).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), kn = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Ho = U(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", kn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Xs = U(/^!?\[(label)\]\[(ref)\]/).replace("label", kn).replace("ref", ki).getRegex(), er = U(/^!?\[(ref)\](?:\[\])?/).replace("ref", ki).getRegex(), Bo = U("reflink|nolink(?!\\()", "g").replace("reflink", Xs).replace("nolink", er).getRegex(), Ei = {
6226
+ }, Ys = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Mo = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Gs = /^( {2,}|\\)\n(?!\s*$)/, Ro = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Kt = "\\p{P}\\p{S}", No = U(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, Kt).getRegex(), Po = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, jo = U(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, Kt).getRegex(), zo = U("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, Kt).getRegex(), Zo = U("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, Kt).getRegex(), Lo = U(/\\([punct])/, "gu").replace(/punct/g, Kt).getRegex(), Do = U(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Uo = U($i).replace("(?:-->|$)", "-->").getRegex(), Ho = U("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Uo).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), kn = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Bo = U(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", kn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Xs = U(/^!?\[(label)\]\[(ref)\]/).replace("label", kn).replace("ref", ki).getRegex(), er = U(/^!?\[(ref)\](?:\[\])?/).replace("ref", ki).getRegex(), Wo = U("reflink|nolink(?!\\()", "g").replace("reflink", Xs).replace("nolink", er).getRegex(), Ei = {
6214
6227
  _backpedal: kt,
6215
6228
  // only used for GFM url
6216
- anyPunctuation: Zo,
6217
- autolink: Lo,
6218
- blockSkip: No,
6229
+ anyPunctuation: Lo,
6230
+ autolink: Do,
6231
+ blockSkip: Po,
6219
6232
  br: Gs,
6220
- code: Oo,
6233
+ code: Mo,
6221
6234
  del: kt,
6222
- emStrongLDelim: Po,
6223
- emStrongRDelimAst: jo,
6224
- emStrongRDelimUnd: zo,
6235
+ emStrongLDelim: jo,
6236
+ emStrongRDelimAst: zo,
6237
+ emStrongRDelimUnd: Zo,
6225
6238
  escape: Ys,
6226
- link: Ho,
6239
+ link: Bo,
6227
6240
  nolink: er,
6228
- punctuation: Ro,
6241
+ punctuation: No,
6229
6242
  reflink: Xs,
6230
- reflinkSearch: Bo,
6231
- tag: Uo,
6232
- text: Mo,
6243
+ reflinkSearch: Wo,
6244
+ tag: Ho,
6245
+ text: Ro,
6233
6246
  url: kt
6234
- }, Wo = {
6247
+ }, Fo = {
6235
6248
  ...Ei,
6236
6249
  link: U(/^!?\[(label)\]\((.*?)\)/).replace("label", kn).getRegex(),
6237
6250
  reflink: U(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", kn).getRegex()
6238
- }, li = {
6251
+ }, ci = {
6239
6252
  ...Ei,
6240
6253
  escape: U(Ys).replace("])", "~|])").getRegex(),
6241
6254
  url: U(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
6242
6255
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
6243
6256
  del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
6244
6257
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
6245
- }, Fo = {
6246
- ...li,
6258
+ }, Vo = {
6259
+ ...ci,
6247
6260
  br: U(Gs).replace("{2,}", "*").getRegex(),
6248
- text: U(li.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
6261
+ text: U(ci.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
6249
6262
  }, nn = {
6250
6263
  normal: Ti,
6251
- gfm: Ao,
6252
- pedantic: Io
6264
+ gfm: Io,
6265
+ pedantic: Oo
6253
6266
  }, bt = {
6254
6267
  normal: Ei,
6255
- gfm: li,
6256
- breaks: Fo,
6257
- pedantic: Wo
6268
+ gfm: ci,
6269
+ breaks: Vo,
6270
+ pedantic: Fo
6258
6271
  };
6259
6272
  class me {
6260
6273
  constructor(e) {
@@ -6363,8 +6376,8 @@ class me {
6363
6376
  let o = 1 / 0;
6364
6377
  const l = e.slice(1);
6365
6378
  let d;
6366
- this.options.extensions.startBlock.forEach((u) => {
6367
- d = u.call({ lexer: this }, l), typeof d == "number" && d >= 0 && (o = Math.min(o, d));
6379
+ this.options.extensions.startBlock.forEach((h) => {
6380
+ d = h.call({ lexer: this }, l), typeof d == "number" && d >= 0 && (o = Math.min(o, d));
6368
6381
  }), o < 1 / 0 && o >= 0 && (r = e.substring(0, o + 1));
6369
6382
  }
6370
6383
  if (this.state.top && (n = this.tokenizer.paragraph(r))) {
@@ -6399,17 +6412,17 @@ class me {
6399
6412
  inlineTokens(e, t = []) {
6400
6413
  let n, s, r, a = e, o, l, d;
6401
6414
  if (this.tokens.links) {
6402
- const u = Object.keys(this.tokens.links);
6403
- if (u.length > 0)
6415
+ const h = Object.keys(this.tokens.links);
6416
+ if (h.length > 0)
6404
6417
  for (; (o = this.tokenizer.rules.inline.reflinkSearch.exec(a)) != null; )
6405
- u.includes(o[0].slice(o[0].lastIndexOf("[") + 1, -1)) && (a = a.slice(0, o.index) + "[" + "a".repeat(o[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
6418
+ h.includes(o[0].slice(o[0].lastIndexOf("[") + 1, -1)) && (a = a.slice(0, o.index) + "[" + "a".repeat(o[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
6406
6419
  }
6407
6420
  for (; (o = this.tokenizer.rules.inline.blockSkip.exec(a)) != null; )
6408
6421
  a = a.slice(0, o.index) + "[" + "a".repeat(o[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
6409
6422
  for (; (o = this.tokenizer.rules.inline.anyPunctuation.exec(a)) != null; )
6410
6423
  a = a.slice(0, o.index) + "++" + a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
6411
6424
  for (; e; )
6412
- if (l || (d = ""), l = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((u) => (n = u.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1))) {
6425
+ if (l || (d = ""), l = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((h) => (n = h.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1))) {
6413
6426
  if (n = this.tokenizer.escape(e)) {
6414
6427
  e = e.substring(n.raw.length), t.push(n);
6415
6428
  continue;
@@ -6451,24 +6464,24 @@ class me {
6451
6464
  continue;
6452
6465
  }
6453
6466
  if (r = e, this.options.extensions && this.options.extensions.startInline) {
6454
- let u = 1 / 0;
6467
+ let h = 1 / 0;
6455
6468
  const p = e.slice(1);
6456
6469
  let c;
6457
6470
  this.options.extensions.startInline.forEach((g) => {
6458
- c = g.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (u = Math.min(u, c));
6459
- }), u < 1 / 0 && u >= 0 && (r = e.substring(0, u + 1));
6471
+ c = g.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (h = Math.min(h, c));
6472
+ }), h < 1 / 0 && h >= 0 && (r = e.substring(0, h + 1));
6460
6473
  }
6461
6474
  if (n = this.tokenizer.inlineText(r)) {
6462
6475
  e = e.substring(n.raw.length), n.raw.slice(-1) !== "_" && (d = n.raw.slice(-1)), l = !0, s = t[t.length - 1], s && s.type === "text" ? (s.raw += n.raw, s.text += n.text) : t.push(n);
6463
6476
  continue;
6464
6477
  }
6465
6478
  if (e) {
6466
- const u = "Infinite loop on byte: " + e.charCodeAt(0);
6479
+ const h = "Infinite loop on byte: " + e.charCodeAt(0);
6467
6480
  if (this.options.silent) {
6468
- console.error(u);
6481
+ console.error(h);
6469
6482
  break;
6470
6483
  } else
6471
- throw new Error(u);
6484
+ throw new Error(h);
6472
6485
  }
6473
6486
  }
6474
6487
  return t;
@@ -6643,7 +6656,7 @@ class ge {
6643
6656
  }
6644
6657
  case "heading": {
6645
6658
  const a = r;
6646
- n += this.renderer.heading(this.parseInline(a.tokens), a.depth, fo(this.parseInline(a.tokens, this.textRenderer)));
6659
+ n += this.renderer.heading(this.parseInline(a.tokens), a.depth, yo(this.parseInline(a.tokens, this.textRenderer)));
6647
6660
  continue;
6648
6661
  }
6649
6662
  case "code": {
@@ -6654,12 +6667,12 @@ class ge {
6654
6667
  case "table": {
6655
6668
  const a = r;
6656
6669
  let o = "", l = "";
6657
- for (let u = 0; u < a.header.length; u++)
6658
- l += this.renderer.tablecell(this.parseInline(a.header[u].tokens), { header: !0, align: a.align[u] });
6670
+ for (let h = 0; h < a.header.length; h++)
6671
+ l += this.renderer.tablecell(this.parseInline(a.header[h].tokens), { header: !0, align: a.align[h] });
6659
6672
  o += this.renderer.tablerow(l);
6660
6673
  let d = "";
6661
- for (let u = 0; u < a.rows.length; u++) {
6662
- const p = a.rows[u];
6674
+ for (let h = 0; h < a.rows.length; h++) {
6675
+ const p = a.rows[h];
6663
6676
  l = "";
6664
6677
  for (let c = 0; c < p.length; c++)
6665
6678
  l += this.renderer.tablecell(this.parseInline(p[c].tokens), { header: !1, align: a.align[c] });
@@ -6675,7 +6688,7 @@ class ge {
6675
6688
  }
6676
6689
  case "list": {
6677
6690
  const a = r, o = a.ordered, l = a.start, d = a.loose;
6678
- let u = "";
6691
+ let h = "";
6679
6692
  for (let p = 0; p < a.items.length; p++) {
6680
6693
  const c = a.items[p], g = c.checked, O = c.task;
6681
6694
  let D = "";
@@ -6686,9 +6699,9 @@ class ge {
6686
6699
  text: J + " "
6687
6700
  }) : D += J + " ";
6688
6701
  }
6689
- D += this.parse(c.tokens, d), u += this.renderer.listitem(D, O, !!g);
6702
+ D += this.parse(c.tokens, d), h += this.renderer.listitem(D, O, !!g);
6690
6703
  }
6691
- n += this.renderer.list(u, o, l);
6704
+ n += this.renderer.list(h, o, l);
6692
6705
  continue;
6693
6706
  }
6694
6707
  case "html": {
@@ -6823,10 +6836,10 @@ W($t, "passThroughHooks", /* @__PURE__ */ new Set([
6823
6836
  "postprocess",
6824
6837
  "processAllTokens"
6825
6838
  ]));
6826
- var on, ci, di, vs;
6827
- class Vo {
6839
+ var on, di, hi, vs;
6840
+ class qo {
6828
6841
  constructor(...e) {
6829
- Hi(this, on), Hi(this, di), W(this, "defaults", xi()), W(this, "options", this.setOptions), W(this, "parse", ni(this, on, ci).call(this, me.lex, ge.parse)), W(this, "parseInline", ni(this, on, ci).call(this, me.lexInline, ge.parseInline)), W(this, "Parser", ge), W(this, "Renderer", $n), W(this, "TextRenderer", Si), W(this, "Lexer", me), W(this, "Tokenizer", _n), W(this, "Hooks", $t), this.use(...e);
6842
+ Hi(this, on), Hi(this, hi), W(this, "defaults", xi()), W(this, "options", this.setOptions), W(this, "parse", ii(this, on, di).call(this, me.lex, ge.parse)), W(this, "parseInline", ii(this, on, di).call(this, me.lexInline, ge.parseInline)), W(this, "Parser", ge), W(this, "Renderer", $n), W(this, "TextRenderer", Si), W(this, "Lexer", me), W(this, "Tokenizer", _n), W(this, "Hooks", $t), this.use(...e);
6830
6843
  }
6831
6844
  /**
6832
6845
  * Run callback for every token
@@ -6889,9 +6902,9 @@ class Vo {
6889
6902
  if (a === "options")
6890
6903
  continue;
6891
6904
  const o = a, l = n.renderer[o], d = r[o];
6892
- r[o] = (...u) => {
6893
- let p = l.apply(r, u);
6894
- return p === !1 && (p = d.apply(r, u)), p || "";
6905
+ r[o] = (...h) => {
6906
+ let p = l.apply(r, h);
6907
+ return p === !1 && (p = d.apply(r, h)), p || "";
6895
6908
  };
6896
6909
  }
6897
6910
  s.renderer = r;
@@ -6904,9 +6917,9 @@ class Vo {
6904
6917
  if (["options", "rules", "lexer"].includes(a))
6905
6918
  continue;
6906
6919
  const o = a, l = n.tokenizer[o], d = r[o];
6907
- r[o] = (...u) => {
6908
- let p = l.apply(r, u);
6909
- return p === !1 && (p = d.apply(r, u)), p;
6920
+ r[o] = (...h) => {
6921
+ let p = l.apply(r, h);
6922
+ return p === !1 && (p = d.apply(r, h)), p;
6910
6923
  };
6911
6924
  }
6912
6925
  s.tokenizer = r;
@@ -6919,14 +6932,14 @@ class Vo {
6919
6932
  if (a === "options")
6920
6933
  continue;
6921
6934
  const o = a, l = n.hooks[o], d = r[o];
6922
- $t.passThroughHooks.has(a) ? r[o] = (u) => {
6935
+ $t.passThroughHooks.has(a) ? r[o] = (h) => {
6923
6936
  if (this.defaults.async)
6924
- return Promise.resolve(l.call(r, u)).then((c) => d.call(r, c));
6925
- const p = l.call(r, u);
6937
+ return Promise.resolve(l.call(r, h)).then((c) => d.call(r, c));
6938
+ const p = l.call(r, h);
6926
6939
  return d.call(r, p);
6927
- } : r[o] = (...u) => {
6928
- let p = l.apply(r, u);
6929
- return p === !1 && (p = d.apply(r, u)), p;
6940
+ } : r[o] = (...h) => {
6941
+ let p = l.apply(r, h);
6942
+ return p === !1 && (p = d.apply(r, h)), p;
6930
6943
  };
6931
6944
  }
6932
6945
  s.hooks = r;
@@ -6951,11 +6964,11 @@ class Vo {
6951
6964
  return ge.parse(e, t ?? this.defaults);
6952
6965
  }
6953
6966
  }
6954
- on = /* @__PURE__ */ new WeakSet(), ci = function(i, e) {
6967
+ on = /* @__PURE__ */ new WeakSet(), di = function(i, e) {
6955
6968
  return (t, n) => {
6956
6969
  const s = { ...n }, r = { ...this.defaults, ...s };
6957
6970
  this.defaults.async === !0 && s.async === !1 && (r.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), r.async = !0);
6958
- const a = ni(this, di, vs).call(this, !!r.silent, !!r.async);
6971
+ const a = ii(this, hi, vs).call(this, !!r.silent, !!r.async);
6959
6972
  if (typeof t > "u" || t === null)
6960
6973
  return a(new Error("marked(): input parameter is undefined or null"));
6961
6974
  if (typeof t != "string")
@@ -6972,7 +6985,7 @@ on = /* @__PURE__ */ new WeakSet(), ci = function(i, e) {
6972
6985
  return a(o);
6973
6986
  }
6974
6987
  };
6975
- }, di = /* @__PURE__ */ new WeakSet(), vs = function(i, e) {
6988
+ }, hi = /* @__PURE__ */ new WeakSet(), vs = function(i, e) {
6976
6989
  return (t) => {
6977
6990
  if (t.message += `
6978
6991
  Please report this to https://github.com/markedjs/marked.`, i) {
@@ -6984,7 +6997,7 @@ Please report this to https://github.com/markedjs/marked.`, i) {
6984
6997
  throw t;
6985
6998
  };
6986
6999
  };
6987
- const et = new Vo();
7000
+ const et = new qo();
6988
7001
  function L(i, e) {
6989
7002
  return et.parse(i, e);
6990
7003
  }
@@ -7016,16 +7029,16 @@ L.walkTokens;
7016
7029
  L.parseInline;
7017
7030
  ge.parse;
7018
7031
  me.lex;
7019
- function qo(i) {
7032
+ function Ko(i) {
7020
7033
  return i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
7021
7034
  }
7022
7035
  function tr(i, e = "") {
7023
7036
  return Object.keys(i).reduce((t, n) => {
7024
- const s = qo(n), r = e ? `${e}-${s}` : s;
7037
+ const s = Ko(n), r = e ? `${e}-${s}` : s;
7025
7038
  return typeof i[n] == "object" && i[n] !== null ? Object.assign(t, tr(i[n], r)) : t[r] = i[n], t;
7026
7039
  }, {});
7027
7040
  }
7028
- function Ko(i) {
7041
+ function Jo(i) {
7029
7042
  const e = {
7030
7043
  "&": "&amp;",
7031
7044
  "<": "&lt;",
@@ -7036,13 +7049,13 @@ function Ko(i) {
7036
7049
  return i.replace(/[&<>"']/g, (t) => e[t]);
7037
7050
  }
7038
7051
  function nr(i) {
7039
- const e = Ko(i);
7052
+ const e = Jo(i);
7040
7053
  return L.parse(e);
7041
7054
  }
7042
- var Jo = Object.defineProperty, Qo = Object.getOwnPropertyDescriptor, ir = (i, e, t, n) => {
7043
- for (var s = n > 1 ? void 0 : n ? Qo(e, t) : e, r = i.length - 1, a; r >= 0; r--)
7055
+ var Qo = Object.defineProperty, Yo = Object.getOwnPropertyDescriptor, ir = (i, e, t, n) => {
7056
+ for (var s = n > 1 ? void 0 : n ? Yo(e, t) : e, r = i.length - 1, a; r >= 0; r--)
7044
7057
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
7045
- return n && s && Jo(e, t, s), s;
7058
+ return n && s && Qo(e, t, s), s;
7046
7059
  };
7047
7060
  let Tn = class extends ne {
7048
7061
  constructor() {
@@ -7073,16 +7086,16 @@ ir([
7073
7086
  Tn = ir([
7074
7087
  Ee("iai-chat-message-assistant")
7075
7088
  ], Tn);
7076
- async function Yo(i, e) {
7089
+ async function Go(i, e) {
7077
7090
  const { type: t, params: n } = i, s = e[t];
7078
7091
  if (!s)
7079
7092
  throw new Error(`No handler for enhanced content type ${t}`);
7080
7093
  return s({ params: n, html: z });
7081
7094
  }
7082
- var Go = Object.defineProperty, Xo = Object.getOwnPropertyDescriptor, Jt = (i, e, t, n) => {
7083
- for (var s = n > 1 ? void 0 : n ? Xo(e, t) : e, r = i.length - 1, a; r >= 0; r--)
7095
+ var Xo = Object.defineProperty, el = Object.getOwnPropertyDescriptor, Jt = (i, e, t, n) => {
7096
+ for (var s = n > 1 ? void 0 : n ? el(e, t) : e, r = i.length - 1, a; r >= 0; r--)
7084
7097
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
7085
- return n && s && Go(e, t, s), s;
7098
+ return n && s && Xo(e, t, s), s;
7086
7099
  };
7087
7100
  let tt = class extends ne {
7088
7101
  constructor() {
@@ -7091,7 +7104,7 @@ let tt = class extends ne {
7091
7104
  async connectedCallback() {
7092
7105
  if (super.connectedCallback(), this.enhancedContent)
7093
7106
  try {
7094
- this.contentHtmlTemplate = await Yo(this.enhancedContent, this.options.handlers.enhancedContent);
7107
+ this.contentHtmlTemplate = await Go(this.enhancedContent, this.options.handlers.enhancedContent);
7095
7108
  } catch (i) {
7096
7109
  console.warn("Error processing enhanced content", i);
7097
7110
  }
@@ -7121,10 +7134,10 @@ Jt([
7121
7134
  tt = Jt([
7122
7135
  Ee("iai-chat-message-system")
7123
7136
  ], tt);
7124
- var el = Object.defineProperty, tl = Object.getOwnPropertyDescriptor, sr = (i, e, t, n) => {
7125
- for (var s = n > 1 ? void 0 : n ? tl(e, t) : e, r = i.length - 1, a; r >= 0; r--)
7137
+ var tl = Object.defineProperty, nl = Object.getOwnPropertyDescriptor, sr = (i, e, t, n) => {
7138
+ for (var s = n > 1 ? void 0 : n ? nl(e, t) : e, r = i.length - 1, a; r >= 0; r--)
7126
7139
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
7127
- return n && s && el(e, t, s), s;
7140
+ return n && s && tl(e, t, s), s;
7128
7141
  };
7129
7142
  let En = class extends ne {
7130
7143
  constructor() {
@@ -7152,10 +7165,10 @@ sr([
7152
7165
  En = sr([
7153
7166
  Ee("iai-chat-message-user")
7154
7167
  ], En);
7155
- var nl = Object.defineProperty, il = Object.getOwnPropertyDescriptor, zn = (i, e, t, n) => {
7156
- for (var s = n > 1 ? void 0 : n ? il(e, t) : e, r = i.length - 1, a; r >= 0; r--)
7168
+ var il = Object.defineProperty, sl = Object.getOwnPropertyDescriptor, Zn = (i, e, t, n) => {
7169
+ for (var s = n > 1 ? void 0 : n ? sl(e, t) : e, r = i.length - 1, a; r >= 0; r--)
7157
7170
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
7158
- return n && s && nl(e, t, s), s;
7171
+ return n && s && il(e, t, s), s;
7159
7172
  };
7160
7173
  let pt = class extends ne {
7161
7174
  constructor() {
@@ -7196,7 +7209,7 @@ let pt = class extends ne {
7196
7209
  () => z`
7197
7210
  <div class="button rounded-full flex items-center justify-center" style=${a}>
7198
7211
  <div class="h-3/5 w-3/5">
7199
- ${Re(this.isChatWindowOpen, () => Ht, () => eo)}
7212
+ ${Re(this.isChatWindowOpen, () => Ht, () => to)}
7200
7213
  </div>
7201
7214
  </div>
7202
7215
  `
@@ -7215,19 +7228,19 @@ pt.styles = [Se, nt`
7215
7228
  color: var(--iai-chat-i-ocb-fg);
7216
7229
  }
7217
7230
  `];
7218
- zn([
7231
+ Zn([
7219
7232
  V({ type: Object })
7220
7233
  ], pt.prototype, "options", 2);
7221
- zn([
7234
+ Zn([
7222
7235
  V({ type: Boolean })
7223
7236
  ], pt.prototype, "isChatWindowOpen", 2);
7224
- zn([
7237
+ Zn([
7225
7238
  gt()
7226
7239
  ], pt.prototype, "isCtaOpen", 2);
7227
- pt = zn([
7240
+ pt = Zn([
7228
7241
  Ee("iai-chat-open-chat-button")
7229
7242
  ], pt);
7230
- class sl {
7243
+ class rl {
7231
7244
  constructor(e) {
7232
7245
  this.widget = null, this.options = Pn.parse(e);
7233
7246
  const t = document.createElement("iai-chat-popup");
@@ -7248,7 +7261,7 @@ class sl {
7248
7261
  (e = this.widget) == null || e.remove(), this.widget = null;
7249
7262
  }
7250
7263
  }
7251
- function rl({ html: i, params: e }) {
7264
+ function al({ html: i, params: e }) {
7252
7265
  return i`
7253
7266
  <div>
7254
7267
  <h2>Unit List</h2>
@@ -7269,7 +7282,7 @@ function rl({ html: i, params: e }) {
7269
7282
  </iai-chat-carousel>
7270
7283
  `;
7271
7284
  }
7272
- function al(i) {
7285
+ function ol(i) {
7273
7286
  return async function({ id: t, params: n, chatWindow: s }) {
7274
7287
  s.setInputDisabled(!0);
7275
7288
  const r = {
@@ -7282,7 +7295,7 @@ function al(i) {
7282
7295
  }, a = document.createElement("iai-chat-iframe-modal");
7283
7296
  a.title = "Schedule a Tour", a.src = `${i}?${new URLSearchParams(r).toString()}`, a.showHeader = !1;
7284
7297
  const o = () => {
7285
- a.remove(), window.removeEventListener("beforeunload", u), s.setInputDisabled(!1);
7298
+ a.remove(), window.removeEventListener("beforeunload", h), s.setInputDisabled(!1);
7286
7299
  }, l = async ({ detail: p }) => {
7287
7300
  if (p.type !== "tourScheduled")
7288
7301
  return;
@@ -7310,13 +7323,13 @@ function al(i) {
7310
7323
  }), await s.sendFunctionCallResponse(t, {
7311
7324
  status: "canceled"
7312
7325
  }, !0);
7313
- }, u = async () => {
7326
+ }, h = async () => {
7314
7327
  o(), s.addMessage({
7315
7328
  role: "system",
7316
7329
  content: "Tour Scheduler Closed"
7317
7330
  });
7318
7331
  };
7319
- a.addEventListener("message-received", l), a.addEventListener("close", d), window.addEventListener("beforeunload", u), document.body.appendChild(a), s.addMessage({
7332
+ a.addEventListener("message-received", l), a.addEventListener("close", d), window.addEventListener("beforeunload", h), document.body.appendChild(a), s.addMessage({
7320
7333
  role: "system",
7321
7334
  content: "Tour Scheduler Opened"
7322
7335
  });
@@ -7338,7 +7351,7 @@ function rr(i) {
7338
7351
  });
7339
7352
  } };
7340
7353
  }
7341
- class ol {
7354
+ class ll {
7342
7355
  constructor(e) {
7343
7356
  this.chatWsUrl = e, this._emitter = rr(), this.on = this._emitter.on.bind(this._emitter), this.off = this._emitter.off.bind(this._emitter), this.reconnectCodes = /* @__PURE__ */ new Set([
7344
7357
  1006
@@ -7383,14 +7396,14 @@ var Sn;
7383
7396
  e.PENDING = "PENDING", e.ACTIVE = "ACTIVE", e.TERMINATED = "TERMINATED";
7384
7397
  })(i.ConversationStatus || (i.ConversationStatus = {}));
7385
7398
  })(Sn || (Sn = {}));
7386
- const ll = Sn.AcknowledgeType, cl = "Anyone Home", dl = "IB Chat Leasing - Development";
7399
+ const cl = Sn.AcknowledgeType, dl = "Anyone Home", hl = "IB Chat Leasing - Development";
7387
7400
  let ul = "https://five9.ah.inhabit.work";
7388
- const hl = "https://five9.ah.inhabit.work".replace("http", "ws").replace(/\/$/, "");
7401
+ const pl = "https://five9.ah.inhabit.work".replace("http", "ws").replace(/\/$/, "");
7389
7402
  var _e, We;
7390
7403
  const Et = class Et {
7391
7404
  constructor() {
7392
- Gn(this, _e, void 0);
7393
- Gn(this, We, void 0);
7405
+ Xn(this, _e, void 0);
7406
+ Xn(this, We, void 0);
7394
7407
  this._emitter = rr(), this.on = this._emitter.on.bind(this._emitter), this.off = this._emitter.off.bind(this._emitter), Ie(this, _e, null), Ie(this, We, null), this.conversationStarted = !1;
7395
7408
  }
7396
7409
  serialize() {
@@ -7414,7 +7427,7 @@ const Et = class Et {
7414
7427
  "Content-Type": "application/json",
7415
7428
  Accept: "application/json"
7416
7429
  },
7417
- body: JSON.stringify({ tenantName: cl })
7430
+ body: JSON.stringify({ tenantName: dl })
7418
7431
  });
7419
7432
  return Ie(this, _e, await e.json()), en(this, _e);
7420
7433
  }
@@ -7435,7 +7448,7 @@ const Et = class Et {
7435
7448
  if (!this.conversationId)
7436
7449
  throw new Error("Conversation not started");
7437
7450
  this.five9WebSocket && this.five9WebSocket.destroy();
7438
- const e = new ol(`${hl}/conversations/${this.conversationId}/ws`);
7451
+ const e = new ll(`${pl}/conversations/${this.conversationId}/ws`);
7439
7452
  e.on("*", (t, n) => {
7440
7453
  this._emitter.emit(t, n);
7441
7454
  }), e.on("conversationCreated", (t) => {
@@ -7457,7 +7470,7 @@ const Et = class Et {
7457
7470
  messages: [
7458
7471
  {
7459
7472
  messageId: t.messageId,
7460
- type: ll.READ
7473
+ type: cl.READ
7461
7474
  }
7462
7475
  ]
7463
7476
  });
@@ -7501,7 +7514,7 @@ const Et = class Et {
7501
7514
  });
7502
7515
  const n = {
7503
7516
  ...e,
7504
- campaignName: dl,
7517
+ campaignName: hl,
7505
7518
  tenantId: this.tenantId,
7506
7519
  callbackUrl: ul
7507
7520
  };
@@ -7586,7 +7599,7 @@ let Cn = Et;
7586
7599
  function Tt(i) {
7587
7600
  return `any-${i || "main"}-chatSession`;
7588
7601
  }
7589
- async function pl({
7602
+ async function ml({
7590
7603
  id: i,
7591
7604
  params: e,
7592
7605
  chatWindow: t,
@@ -7599,7 +7612,7 @@ async function pl({
7599
7612
  t.setInputDisabled(!0), t.removeMessage("transferMessageId"), t.addMessage({
7600
7613
  role: "system",
7601
7614
  content: "Please wait while we connect you to a live agent"
7602
- }), t.chatManager.stopInactivityTimers();
7615
+ }), t.chatManager.endChat("Transferred to live agent", !1);
7603
7616
  const a = new Cn();
7604
7617
  await a.createSession();
7605
7618
  const { summary: o, subject: l, ...d } = e;
@@ -7736,7 +7749,7 @@ function ar(i, e) {
7736
7749
  };
7737
7750
  i.cleanOptions.config.disclaimerMessage = "You are chatting with a live agent", i.addEventListener("iai-chat-send-user-message", t), i.addEventListener("iai-chat-reset", s), i.addEventListener("iai-chat-destroy", n);
7738
7751
  }
7739
- class gl {
7752
+ class fl {
7740
7753
  constructor(e, t) {
7741
7754
  const n = Pn.parse({
7742
7755
  assistantId: "7e59c8c1-a4ff-40f1-9a68-86ea294a4e75",
@@ -7746,7 +7759,7 @@ class gl {
7746
7759
  styles: e.styles || {}
7747
7760
  }
7748
7761
  });
7749
- n.handlers.functionCalls.transferToLiveAgent = pl, n.handlers.functionCalls.showScheduleTourWidget = al(t.schedulerUrl), n.handlers.enhancedContent.unitList = rl, this.chatWidget = new sl(n);
7762
+ n.handlers.functionCalls.transferToLiveAgent = ml, n.handlers.functionCalls.showScheduleTourWidget = ol(t.schedulerUrl), n.handlers.enhancedContent.unitList = al, this.chatWidget = new rl(n);
7750
7763
  const s = localStorage.getItem(Tt(n.config.historyKey));
7751
7764
  if (s) {
7752
7765
  const r = Cn.deserialize(s);
@@ -7760,5 +7773,5 @@ class gl {
7760
7773
  }
7761
7774
  }
7762
7775
  export {
7763
- gl as AnyChatWidget
7776
+ fl as AnyChatWidget
7764
7777
  };