@telia-ace/ace-chat-flamingo 1.1.123-rc.33 → 1.1.123-rc.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/index.js +28 -28
  2. package/index.mjs +101 -134
  3. package/package.json +3 -3
  4. package/provider.d.ts +0 -1
package/index.mjs CHANGED
@@ -8,7 +8,7 @@ var Ii = function(n, e) {
8
8
  for (var s in i) Object.prototype.hasOwnProperty.call(i, s) && (t[s] = i[s]);
9
9
  }, Ii(n, e);
10
10
  };
11
- function Me(n, e) {
11
+ function Pe(n, e) {
12
12
  if (typeof e != "function" && e !== null)
13
13
  throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
14
14
  Ii(n, e);
@@ -339,7 +339,7 @@ function kn(n) {
339
339
  n();
340
340
  }
341
341
  var ts = (function(n) {
342
- Me(e, n);
342
+ Pe(e, n);
343
343
  function e(t) {
344
344
  var i = n.call(this) || this;
345
345
  return i.isStopped = !1, t ? (i.destination = t, Ro(t) && t.add(i)) : i.destination = kl, i;
@@ -401,7 +401,7 @@ var ts = (function(n) {
401
401
  }
402
402
  }, n;
403
403
  })(), Pi = (function(n) {
404
- Me(e, n);
404
+ Pe(e, n);
405
405
  function e(t, i, s) {
406
406
  var r = n.call(this) || this, o;
407
407
  return C(t) || !t ? o = {
@@ -526,7 +526,7 @@ function Q(n, e, t, i, s) {
526
526
  return new Al(n, e, t, i, s);
527
527
  }
528
528
  var Al = (function(n) {
529
- Me(e, n);
529
+ Pe(e, n);
530
530
  function e(t, i, s, r, o, a) {
531
531
  var c = n.call(this, t) || this;
532
532
  return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = i ? function(l) {
@@ -565,7 +565,7 @@ var Al = (function(n) {
565
565
  n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
566
566
  };
567
567
  }), P = (function(n) {
568
- Me(e, n);
568
+ Pe(e, n);
569
569
  function e() {
570
570
  var t = n.call(this) || this;
571
571
  return t.closed = !1, t.currentObservers = null, t.observers = [], t.isStopped = !1, t.hasError = !1, t.thrownError = null, t;
@@ -644,7 +644,7 @@ var Al = (function(n) {
644
644
  return new Cr(t, i);
645
645
  }, e;
646
646
  })(V), Cr = (function(n) {
647
- Me(e, n);
647
+ Pe(e, n);
648
648
  function e(t, i) {
649
649
  var s = n.call(this) || this;
650
650
  return s.destination = t, s.source = i, s;
@@ -663,7 +663,7 @@ var Al = (function(n) {
663
663
  return (s = (i = this.source) === null || i === void 0 ? void 0 : i.subscribe(t)) !== null && s !== void 0 ? s : Oo;
664
664
  }, e;
665
665
  })(P), he = (function(n) {
666
- Me(e, n);
666
+ Pe(e, n);
667
667
  function e(t) {
668
668
  var i = n.call(this) || this;
669
669
  return i._value = t, i;
@@ -690,7 +690,7 @@ var Al = (function(n) {
690
690
  return Date.now();
691
691
  }
692
692
  }, Rl = (function(n) {
693
- Me(e, n);
693
+ Pe(e, n);
694
694
  function e(t, i) {
695
695
  return n.call(this) || this;
696
696
  }
@@ -708,7 +708,7 @@ var Al = (function(n) {
708
708
  },
709
709
  delegate: void 0
710
710
  }, Ll = (function(n) {
711
- Me(e, n);
711
+ Pe(e, n);
712
712
  function e(t, i) {
713
713
  var s = n.call(this, t, i) || this;
714
714
  return s.scheduler = t, s.work = i, s.pending = !1, s;
@@ -757,7 +757,7 @@ var Al = (function(n) {
757
757
  return t === void 0 && (t = 0), new this.schedulerActionCtor(this, e).schedule(i, t);
758
758
  }, n.now = Ol.now, n;
759
759
  })(), Il = (function(n) {
760
- Me(e, n);
760
+ Pe(e, n);
761
761
  function e(t, i) {
762
762
  i === void 0 && (i = _r.now);
763
763
  var s = n.call(this, t, i) || this;
@@ -782,7 +782,7 @@ var Al = (function(n) {
782
782
  }
783
783
  }, e;
784
784
  })(_r), fp = new Il(Ll);
785
- var Re = new V(function(n) {
785
+ var Oe = new V(function(n) {
786
786
  return n.complete();
787
787
  });
788
788
  function Pl(n) {
@@ -1175,13 +1175,13 @@ function oc(n, e, t, i, s, r, o, a) {
1175
1175
  try {
1176
1176
  l--;
1177
1177
  for (var le = function() {
1178
- var Ne = c.shift();
1179
- o || m(Ne);
1178
+ var Me = c.shift();
1179
+ o || m(Me);
1180
1180
  }; c.length && l < i; )
1181
1181
  le();
1182
1182
  d();
1183
- } catch (Ne) {
1184
- e.error(Ne);
1183
+ } catch (Me) {
1184
+ e.error(Me);
1185
1185
  }
1186
1186
  }));
1187
1187
  };
@@ -1253,7 +1253,7 @@ function gc() {
1253
1253
  for (var n = [], e = 0; e < arguments.length; e++)
1254
1254
  n[e] = arguments[e];
1255
1255
  var t = ss(n), i = Ml(n, 1 / 0), s = n;
1256
- return s.length ? s.length === 1 ? oe(s[0]) : ac(i)(Xe(s, t)) : Re;
1256
+ return s.length ? s.length === 1 ? oe(s[0]) : ac(i)(Xe(s, t)) : Oe;
1257
1257
  }
1258
1258
  function G(n, e) {
1259
1259
  return re(function(t, i) {
@@ -1276,7 +1276,7 @@ function bi(n, e) {
1276
1276
  }
1277
1277
  function ve(n) {
1278
1278
  return n <= 0 ? function() {
1279
- return Re;
1279
+ return Oe;
1280
1280
  } : re(function(e, t) {
1281
1281
  var i = 0;
1282
1282
  e.subscribe(Q(t, function(s) {
@@ -1287,7 +1287,7 @@ function ve(n) {
1287
1287
  function yi(n) {
1288
1288
  var e = 1 / 0, t;
1289
1289
  return e <= 0 ? function() {
1290
- return Re;
1290
+ return Oe;
1291
1291
  } : re(function(i, s) {
1292
1292
  var r = 0, o, a = function() {
1293
1293
  o == null || o.unsubscribe(), o = null;
@@ -1302,7 +1302,7 @@ function yi(n) {
1302
1302
  c();
1303
1303
  });
1304
1304
  }
1305
- function Le(n, e) {
1305
+ function Re(n, e) {
1306
1306
  return re(function(t, i) {
1307
1307
  var s = null, r = 0, o = !1, a = function() {
1308
1308
  return o && !s && i.complete();
@@ -1907,7 +1907,7 @@ dt.elementStyles = [], dt.shadowRootOptions = { mode: "open" }, dt[Ft("elementPr
1907
1907
  */
1908
1908
  const jt = globalThis, Ln = jt.trustedTypes, Mr = Ln ? Ln.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Qo = "$lit$", Ue = `lit$${Math.random().toFixed(9).slice(2)}$`, Xo = "?" + Ue, Lc = `<${Xo}>`, et = document, Gt = () => et.createComment(""), Zt = (n) => n === null || typeof n != "object" && typeof n != "function", us = Array.isArray, Ic = (n) => us(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", wi = `[
1909
1909
  \f\r]`, It = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Nr = /-->/g, Ur = />/g, Ge = RegExp(`>|${wi}(?:([^\\s"'>=/]+)(${wi}*=${wi}*(?:[^
1910
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Dr = /'/g, Hr = /"/g, Ko = /^(?:script|style|textarea|title)$/i, Pc = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), y = Pc(1), Ie = Symbol.for("lit-noChange"), w = Symbol.for("lit-nothing"), zr = /* @__PURE__ */ new WeakMap(), Ye = et.createTreeWalker(et, 129);
1910
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Dr = /'/g, Hr = /"/g, Ko = /^(?:script|style|textarea|title)$/i, Pc = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), y = Pc(1), Le = Symbol.for("lit-noChange"), w = Symbol.for("lit-nothing"), zr = /* @__PURE__ */ new WeakMap(), Ye = et.createTreeWalker(et, 129);
1911
1911
  function Jo(n, e) {
1912
1912
  if (!us(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
1913
1913
  return Mr !== void 0 ? Mr.createHTML(e) : e;
@@ -1963,7 +1963,7 @@ let Hi = class ea {
1963
1963
  };
1964
1964
  function xt(n, e, t = n, i) {
1965
1965
  var o, a;
1966
- if (e === Ie) return e;
1966
+ if (e === Le) return e;
1967
1967
  let s = i !== void 0 ? (o = t._$Co) == null ? void 0 : o[i] : t._$Cl;
1968
1968
  const r = Zt(e) ? void 0 : e._$litDirective$;
1969
1969
  return (s == null ? void 0 : s.constructor) !== r && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), r === void 0 ? s = void 0 : (s = new r(n), s._$AT(n, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = s : t._$Cl = s), s !== void 0 && (e = xt(n, s._$AS(n, e.values), s, i)), e;
@@ -2016,7 +2016,7 @@ class rn {
2016
2016
  return this._$AB;
2017
2017
  }
2018
2018
  _$AI(e, t = this) {
2019
- e = xt(this, e, t), Zt(e) ? e === w || e == null || e === "" ? (this._$AH !== w && this._$AR(), this._$AH = w) : e !== this._$AH && e !== Ie && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ic(e) ? this.k(e) : this._(e);
2019
+ e = xt(this, e, t), Zt(e) ? e === w || e == null || e === "" ? (this._$AH !== w && this._$AR(), this._$AH = w) : e !== this._$AH && e !== Le && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ic(e) ? this.k(e) : this._(e);
2020
2020
  }
2021
2021
  O(e) {
2022
2022
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -2072,11 +2072,11 @@ class Yn {
2072
2072
  _$AI(e, t = this, i, s) {
2073
2073
  const r = this.strings;
2074
2074
  let o = !1;
2075
- if (r === void 0) e = xt(this, e, t, 0), o = !Zt(e) || e !== this._$AH && e !== Ie, o && (this._$AH = e);
2075
+ if (r === void 0) e = xt(this, e, t, 0), o = !Zt(e) || e !== this._$AH && e !== Le, o && (this._$AH = e);
2076
2076
  else {
2077
2077
  const a = e;
2078
2078
  let c, l;
2079
- for (e = r[0], c = 0; c < r.length - 1; c++) l = xt(this, a[i + c], t, c), l === Ie && (l = this._$AH[c]), o || (o = !Zt(l) || l !== this._$AH[c]), l === w ? e = w : e !== w && (e += (l ?? "") + r[c + 1]), this._$AH[c] = l;
2079
+ for (e = r[0], c = 0; c < r.length - 1; c++) l = xt(this, a[i + c], t, c), l === Le && (l = this._$AH[c]), o || (o = !Zt(l) || l !== this._$AH[c]), l === w ? e = w : e !== w && (e += (l ?? "") + r[c + 1]), this._$AH[c] = l;
2080
2080
  }
2081
2081
  o && !s && this.j(e);
2082
2082
  }
@@ -2105,7 +2105,7 @@ class Hc extends Yn {
2105
2105
  super(e, t, i, s, r), this.type = 5;
2106
2106
  }
2107
2107
  _$AI(e, t = this) {
2108
- if ((e = xt(this, e, t, 0) ?? w) === Ie) return;
2108
+ if ((e = xt(this, e, t, 0) ?? w) === Le) return;
2109
2109
  const i = this._$AH, s = e === w && i !== w || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, r = e !== w && (i === w || s);
2110
2110
  s && this.element.removeEventListener(this.name, this, i), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
2111
2111
  }
@@ -2164,7 +2164,7 @@ let A = class extends dt {
2164
2164
  super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
2165
2165
  }
2166
2166
  render() {
2167
- return Ie;
2167
+ return Le;
2168
2168
  }
2169
2169
  };
2170
2170
  var _o;
@@ -2992,7 +2992,7 @@ const kt = ln(class extends Jn {
2992
2992
  const o = !!e[r];
2993
2993
  o === this.st.has(r) || (s = this.nt) != null && s.has(r) || (o ? (t.add(r), this.st.add(r)) : (t.remove(r), this.st.delete(r)));
2994
2994
  }
2995
- return Ie;
2995
+ return Le;
2996
2996
  }
2997
2997
  });
2998
2998
  var eh = Object.defineProperty, th = (n, e, t, i) => {
@@ -3544,22 +3544,22 @@ Rs.styles = [
3544
3544
  }
3545
3545
  `
3546
3546
  ];
3547
- let Pe = Rs;
3547
+ let Ie = Rs;
3548
3548
  cn([
3549
3549
  k({ attribute: !1 })
3550
- ], Pe.prototype, "application");
3550
+ ], Ie.prototype, "application");
3551
3551
  cn([
3552
3552
  T()
3553
- ], Pe.prototype, "active");
3553
+ ], Ie.prototype, "active");
3554
3554
  cn([
3555
3555
  T()
3556
- ], Pe.prototype, "triggerVisible");
3556
+ ], Ie.prototype, "triggerVisible");
3557
3557
  cn([
3558
3558
  T()
3559
- ], Pe.prototype, "loaded");
3559
+ ], Ie.prototype, "loaded");
3560
3560
  cn([
3561
3561
  T()
3562
- ], Pe.prototype, "icon");
3562
+ ], Ie.prototype, "icon");
3563
3563
  var ch = Object.defineProperty, Ze = (n, e, t, i) => {
3564
3564
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
3565
3565
  (o = n[r]) && (s = o(e, t, s) || s);
@@ -4047,7 +4047,7 @@ const Ps = class Ps extends A {
4047
4047
  if (!this.widget || this.status !== "activated")
4048
4048
  return w;
4049
4049
  if (this.widget.renderStrategy === gs.Trigger) {
4050
- const e = new Pe();
4050
+ const e = new Ie();
4051
4051
  return e.application = this.widget, e;
4052
4052
  }
4053
4053
  return this.widget.render();
@@ -4071,7 +4071,7 @@ ms([
4071
4071
  T()
4072
4072
  ], St.prototype, "status");
4073
4073
  customElements.get("ace-trigger-slot") || customElements.define("ace-trigger-slot", Dn);
4074
- customElements.get("ace-trigger") || customElements.define("ace-trigger", Pe);
4074
+ customElements.get("ace-trigger") || customElements.define("ace-trigger", Ie);
4075
4075
  customElements.get("ace-unresolved-component") || customElements.define("ace-unresolved-component", Vi);
4076
4076
  customElements.get("ace-wrapper") || customElements.define("ace-wrapper", Qt);
4077
4077
  customElements.get("ace-widget") || customElements.define("ace-widget", St);
@@ -4094,7 +4094,7 @@ class mh {
4094
4094
  class uo {
4095
4095
  constructor(e, t, i, s, r) {
4096
4096
  this.id = e, this.providerKey = t, this.providerOptions = i, this.component = r, this.provider$ = new he(null), this.entries$ = new he([]), this.removeEntryAction$ = new P(), this.kill$ = new P(), this.isTyping$ = new he(!1), this.data$ = new he({}), this.complete$ = this.provider$.pipe(
4097
- Le((c) => c ? c.onComplete() : Re)
4097
+ Re((c) => c ? c.onComplete() : Oe)
4098
4098
  );
4099
4099
  const o = this._getProviderFactory(t);
4100
4100
  if (!o)
@@ -4137,7 +4137,7 @@ class uo {
4137
4137
  }
4138
4138
  _addEntryRemoveHandler(e) {
4139
4139
  e.remove$.pipe(
4140
- Le(() => this.entries$),
4140
+ Re(() => this.entries$),
4141
4141
  ve(1)
4142
4142
  ).subscribe((t) => {
4143
4143
  this.removeEntryAction$.next(e), this.entries$.next(t.filter((i) => i !== e));
@@ -4248,8 +4248,8 @@ class vh {
4248
4248
  class bh {
4249
4249
  constructor(e, t) {
4250
4250
  this.state$ = e, this.component = t, this.entries$ = new he([]), this.session = () => this.session$, this.isTyping = () => this.isTyping$, this.entries = () => this.entries$.asObservable(), this.sessionService = new vh(this.component), this.session$ = this.sessionService.currentSession(), this.isTyping$ = this.session$.pipe(
4251
- Le((i) => i ? i.provider$.pipe(
4252
- Le((s) => s ? s.isTyping() : Mi(!1))
4251
+ Re((i) => i ? i.provider$.pipe(
4252
+ Re((s) => s ? s.isTyping() : Mi(!1))
4253
4253
  ) : Mi(!1))
4254
4254
  ), e.subscribe((i) => {
4255
4255
  switch (i) {
@@ -4274,9 +4274,9 @@ class bh {
4274
4274
  }
4275
4275
  rehydrate() {
4276
4276
  this.session$.pipe(
4277
- Le((e) => {
4277
+ Re((e) => {
4278
4278
  if (!e)
4279
- return Re;
4279
+ return Oe;
4280
4280
  const t = e.removeEntryAction$.pipe(Ni(this.entries$)).pipe(
4281
4281
  Tn(([s, r]) => r.filter((o) => o.id !== s.id))
4282
4282
  ), i = e.entries().pipe(
@@ -4756,7 +4756,7 @@ class Gi extends Jn {
4756
4756
  }
4757
4757
  render(e) {
4758
4758
  if (e === w || e == null) return this._t = void 0, this.it = e;
4759
- if (e === Ie) return e;
4759
+ if (e === Le) return e;
4760
4760
  if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
4761
4761
  if (e === this.it) return this._t;
4762
4762
  this.it = e;
@@ -4930,7 +4930,7 @@ function Ma() {
4930
4930
  HTMLFormElement: p,
4931
4931
  DOMParser: d,
4932
4932
  trustedTypes: g
4933
- } = n, m = c.prototype, $ = Ut(m, "cloneNode"), we = Ut(m, "remove"), le = Ut(m, "nextSibling"), Ne = Ut(m, "childNodes"), je = Ut(m, "parentNode");
4933
+ } = n, m = c.prototype, $ = Ut(m, "cloneNode"), we = Ut(m, "remove"), le = Ut(m, "nextSibling"), Me = Ut(m, "childNodes"), je = Ut(m, "parentNode");
4934
4934
  if (typeof o == "function") {
4935
4935
  const b = t.createElement("template");
4936
4936
  b.content && b.content.ownerDocument && (t = b.content.ownerDocument);
@@ -5108,7 +5108,7 @@ function Ma() {
5108
5108
  if (!Tt[v] && yr(v) && (L.tagNameCheck instanceof RegExp && Z(L.tagNameCheck, v) || L.tagNameCheck instanceof Function && L.tagNameCheck(v)))
5109
5109
  return !1;
5110
5110
  if (ci && !lt[v]) {
5111
- const O = je(h) || h.parentNode, j = Ne(h) || h.childNodes;
5111
+ const O = je(h) || h.parentNode, j = Me(h) || h.childNodes;
5112
5112
  if (j && O) {
5113
5113
  const I = j.length;
5114
5114
  for (let ee = I - 1; ee >= 0; --ee) {
@@ -5754,18 +5754,18 @@ ${u}` : u;
5754
5754
  `, 1)[0], g = !p.trim(), m = 0;
5755
5755
  if (this.options.pedantic ? (m = 2, u = p.trimStart()) : g ? m = e[1].length + 1 : (m = e[2].search(this.rules.other.nonSpaceChar), m = m > 4 ? 1 : m, u = p.slice(m), m += e[1].length), g && this.rules.other.blankLine.test(d) && (l += d + `
5756
5756
  `, n = n.substring(d.length + 1), c = !0), !c) {
5757
- const le = this.rules.other.nextBulletRegex(m), Ne = this.rules.other.hrRegex(m), je = this.rules.other.fencesBeginRegex(m), M = this.rules.other.headingBeginRegex(m), Be = this.rules.other.htmlBeginRegex(m);
5757
+ const le = this.rules.other.nextBulletRegex(m), Me = this.rules.other.hrRegex(m), je = this.rules.other.fencesBeginRegex(m), M = this.rules.other.headingBeginRegex(m), Be = this.rules.other.htmlBeginRegex(m);
5758
5758
  for (; n; ) {
5759
5759
  const qe = n.split(`
5760
5760
  `, 1)[0];
5761
5761
  let Ve;
5762
- if (d = qe, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), Ve = d) : Ve = d.replace(this.rules.other.tabCharGlobal, " "), je.test(d) || M.test(d) || Be.test(d) || le.test(d) || Ne.test(d))
5762
+ if (d = qe, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), Ve = d) : Ve = d.replace(this.rules.other.tabCharGlobal, " "), je.test(d) || M.test(d) || Be.test(d) || le.test(d) || Me.test(d))
5763
5763
  break;
5764
5764
  if (Ve.search(this.rules.other.nonSpaceChar) >= m || !d.trim())
5765
5765
  u += `
5766
5766
  ` + Ve.slice(m);
5767
5767
  else {
5768
- if (g || p.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || je.test(p) || M.test(p) || Ne.test(p))
5768
+ if (g || p.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || je.test(p) || M.test(p) || Me.test(p))
5769
5769
  break;
5770
5770
  u += `
5771
5771
  ` + d;
@@ -6089,7 +6089,7 @@ ${u}` : u;
6089
6089
  };
6090
6090
  }
6091
6091
  }
6092
- }, Ae = class Xi {
6092
+ }, _e = class Xi {
6093
6093
  constructor(e) {
6094
6094
  _(this, "tokens");
6095
6095
  _(this, "options");
@@ -6497,7 +6497,7 @@ ${n}</tr>
6497
6497
  br() {
6498
6498
  return "";
6499
6499
  }
6500
- }, Te = class Ki {
6500
+ }, Ae = class Ki {
6501
6501
  constructor(e) {
6502
6502
  _(this, "options");
6503
6503
  _(this, "renderer");
@@ -6687,13 +6687,13 @@ ${n}</tr>
6687
6687
  * Provide function to tokenize markdown
6688
6688
  */
6689
6689
  provideLexer() {
6690
- return this.block ? Ae.lex : Ae.lexInline;
6690
+ return this.block ? _e.lex : _e.lexInline;
6691
6691
  }
6692
6692
  /**
6693
6693
  * Provide function to parse tokens
6694
6694
  */
6695
6695
  provideParser() {
6696
- return this.block ? Te.parse : Te.parseInline;
6696
+ return this.block ? Ae.parse : Ae.parseInline;
6697
6697
  }
6698
6698
  }, _(Li, "passThroughHooks", /* @__PURE__ */ new Set([
6699
6699
  "preprocess",
@@ -6705,10 +6705,10 @@ ${n}</tr>
6705
6705
  _(this, "options", this.setOptions);
6706
6706
  _(this, "parse", this.parseMarkdown(!0));
6707
6707
  _(this, "parseInline", this.parseMarkdown(!1));
6708
- _(this, "Parser", Te);
6708
+ _(this, "Parser", Ae);
6709
6709
  _(this, "Renderer", Jt);
6710
6710
  _(this, "TextRenderer", Cs);
6711
- _(this, "Lexer", Ae);
6711
+ _(this, "Lexer", _e);
6712
6712
  _(this, "Tokenizer", jn);
6713
6713
  _(this, "Hooks", En);
6714
6714
  this.use(...n);
@@ -6830,10 +6830,10 @@ ${n}</tr>
6830
6830
  return this.defaults = { ...this.defaults, ...n }, this;
6831
6831
  }
6832
6832
  lexer(n, e) {
6833
- return Ae.lex(n, e ?? this.defaults);
6833
+ return _e.lex(n, e ?? this.defaults);
6834
6834
  }
6835
6835
  parser(n, e) {
6836
- return Te.parse(n, e ?? this.defaults);
6836
+ return Ae.parse(n, e ?? this.defaults);
6837
6837
  }
6838
6838
  parseMarkdown(n) {
6839
6839
  return (t, i) => {
@@ -6845,7 +6845,7 @@ ${n}</tr>
6845
6845
  if (typeof t != "string")
6846
6846
  return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
6847
6847
  r.hooks && (r.hooks.options = r, r.hooks.block = n);
6848
- const a = r.hooks ? r.hooks.provideLexer() : n ? Ae.lex : Ae.lexInline, c = r.hooks ? r.hooks.provideParser() : n ? Te.parse : Te.parseInline;
6848
+ const a = r.hooks ? r.hooks.provideLexer() : n ? _e.lex : _e.lexInline, c = r.hooks ? r.hooks.provideParser() : n ? Ae.parse : Ae.parseInline;
6849
6849
  if (r.async)
6850
6850
  return Promise.resolve(r.hooks ? r.hooks.preprocess(t) : t).then((l) => a(l, r)).then((l) => r.hooks ? r.hooks.processAllTokens(l) : l).then((l) => r.walkTokens ? Promise.all(this.walkTokens(l, r.walkTokens)).then(() => l) : l).then((l) => c(l, r)).then((l) => r.hooks ? r.hooks.postprocess(l) : l).catch(o);
6851
6851
  try {
@@ -6887,12 +6887,12 @@ S.walkTokens = function(n, e) {
6887
6887
  return nt.walkTokens(n, e);
6888
6888
  };
6889
6889
  S.parseInline = nt.parseInline;
6890
- S.Parser = Te;
6891
- S.parser = Te.parse;
6890
+ S.Parser = Ae;
6891
+ S.parser = Ae.parse;
6892
6892
  S.Renderer = Jt;
6893
6893
  S.TextRenderer = Cs;
6894
- S.Lexer = Ae;
6895
- S.lexer = Ae.lex;
6894
+ S.Lexer = _e;
6895
+ S.lexer = _e.lex;
6896
6896
  S.Tokenizer = jn;
6897
6897
  S.Hooks = En;
6898
6898
  S.parse = S;
@@ -6901,8 +6901,8 @@ S.setOptions;
6901
6901
  S.use;
6902
6902
  S.walkTokens;
6903
6903
  S.parseInline;
6904
- Te.parse;
6905
- Ae.lex;
6904
+ Ae.parse;
6905
+ _e.lex;
6906
6906
  var Od = Object.defineProperty, Za = (n, e, t, i) => {
6907
6907
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
6908
6908
  (o = n[r]) && (s = o(e, t, s) || s);
@@ -7145,7 +7145,7 @@ customElements.get("ace-lightbox") || customElements.define("ace-lightbox", Bn);
7145
7145
  const Eo = Ea(A), js = class js extends Eo {
7146
7146
  constructor() {
7147
7147
  super(...arguments), this.platform = null, this.entries = [], this.typing = !1, this.message = "", this.disabledInput = !1, this.disabledSkipToLatest = !1, this.disabledSubmit = !1, this.chatOverlayActive = !1, this.textAreaLength = 0, this.showAuthBanner = !1, this.authenticated = !1, this.isMuted = !1, this.isKeyboardNavigation = !1, this.conversationContentRef = be(), this.conversationFeedRef = be(), this.formRef = be(), this.inputRef = be(), this.scrollRef = be(), this.counterRef = be(), this.chatCurrentScrollPosition = 0, this.toast = new mh(this), this.messageMaxLength = 1e3, this.messageMaxLengthLabel = "Maximum character limit reached", this.skipToLatestMessageLabel = "Skip to latest message", this.conversationState$ = new he("waiting"), this.stateMachine = new bh(this.conversationState$, this), this.provider$ = this.stateMachine.session().pipe(
7148
- Le((e) => e ? e == null ? void 0 : e.provider$ : Mi(null))
7148
+ Re((e) => e ? e == null ? void 0 : e.provider$ : Mi(null))
7149
7149
  ), this.userTyping$ = new P();
7150
7150
  }
7151
7151
  // =================
@@ -7327,7 +7327,7 @@ const Eo = Ea(A), js = class js extends Eo {
7327
7327
  providerOptions: t
7328
7328
  }
7329
7329
  });
7330
- return this.dispatchEvent(i), i.detail.complete || Re;
7330
+ return this.dispatchEvent(i), i.detail.complete || Oe;
7331
7331
  }
7332
7332
  render() {
7333
7333
  var s, r, o;
@@ -7818,7 +7818,7 @@ pe([
7818
7818
  pe([
7819
7819
  T()
7820
7820
  ], ne.prototype, "authenticated");
7821
- var Oe = /* @__PURE__ */ ((n) => (n.Tunnistus = "tunnistus", n.BankId = "bankid", n.Freja = "freja", n))(Oe || {}), F = /* @__PURE__ */ ((n) => (n.Pending = "pending", n.Authenticated = "authenticated", n.Error = "error", n))(F || {});
7821
+ var Te = /* @__PURE__ */ ((n) => (n.Tunnistus = "tunnistus", n.BankId = "bankid", n.Freja = "freja", n))(Te || {}), F = /* @__PURE__ */ ((n) => (n.Pending = "pending", n.Authenticated = "authenticated", n.Error = "error", n))(F || {});
7822
7822
  class Vt {
7823
7823
  constructor(e) {
7824
7824
  this.orderRef = "", e = {
@@ -7850,18 +7850,18 @@ class Vt {
7850
7850
  };
7851
7851
  const t = await e.json();
7852
7852
  switch (this.orderRef = t.orderRef, this.config.idHubEidType) {
7853
- case Oe.Tunnistus:
7853
+ case Te.Tunnistus:
7854
7854
  return {
7855
7855
  tunnistusURL: t.tunnistusURL,
7856
7856
  status: F.Pending
7857
7857
  };
7858
- case Oe.BankId:
7858
+ case Te.BankId:
7859
7859
  return {
7860
7860
  autoStartToken: t.autoStartToken,
7861
7861
  status: F.Pending
7862
7862
  };
7863
- case Oe.Freja:
7864
- throw new Error(`${Oe.Freja} is not implemented`);
7863
+ case Te.Freja:
7864
+ throw new Error(`${Te.Freja} is not implemented`);
7865
7865
  default:
7866
7866
  throw new Error(
7867
7867
  `The service ${this.config.idHubEidType} is not implemented`
@@ -7950,7 +7950,7 @@ class Vt {
7950
7950
  }
7951
7951
  const ge = (n) => n.objectType === "info", Pd = (n) => n.objectType === "chatEntry", Md = (n) => n.objectType === "pen", Nd = (n) => n.objectType === "chatButtonClicked", Ud = (n) => n.objectType === "endVideoButtonClicked", Dd = (n) => n.type === "queue-status", Hd = (n) => n.type === "established", zd = (n) => n.type === "pen-status", Fd = (n) => n.type === "prepareVideo", jd = (n) => n.type === "videoPrepared", Bd = (n) => n.type === "chatButtonClicked", qd = (n) => n.type === "endVideoButtonClicked", Vd = (n) => n.type === "chat-ended";
7952
7952
  var Qe = /* @__PURE__ */ ((n) => (n.Initial = "initial", n.Error = "error", n.Retry = "retry", n))(Qe || {});
7953
- class _e extends Error {
7953
+ class Ne extends Error {
7954
7954
  constructor(e, t, i) {
7955
7955
  super(i || (t == null ? void 0 : t.message) || "Unknown engine error"), this.errorType = e, this.originalError = t;
7956
7956
  }
@@ -8117,8 +8117,8 @@ class Zd {
8117
8117
  videoChatMode: this.config.videoChatMode
8118
8118
  })
8119
8119
  ).pipe(
8120
- vt((t) => vi(() => new _e("chat-join-error", t))),
8121
- Le(() => this.poll().pipe(
8120
+ vt((t) => vi(() => new Ne("chat-join-error", t))),
8121
+ Re(() => this.poll().pipe(
8122
8122
  bi(() => this.poll()),
8123
8123
  // Using concatMap here to ensure that each http request gets handled in order
8124
8124
  yi()
@@ -8142,9 +8142,9 @@ class Zd {
8142
8142
  })
8143
8143
  ).pipe(
8144
8144
  vt((t) => vi(
8145
- () => new _e("chat-request-error", t)
8145
+ () => new Ne("chat-request-error", t)
8146
8146
  )),
8147
- Le(() => this.poll().pipe(
8147
+ Re(() => this.poll().pipe(
8148
8148
  bi(() => this.poll()),
8149
8149
  // Using concatMap here to ensure that each http request gets handled in order
8150
8150
  yi()
@@ -8157,7 +8157,7 @@ class Zd {
8157
8157
  // Using concatMap here to ensure that each http request gets handled in order
8158
8158
  yi(),
8159
8159
  vt((e) => vi(
8160
- () => new _e("chat-engine-error", e)
8160
+ () => new Ne("chat-engine-error", e)
8161
8161
  ))
8162
8162
  );
8163
8163
  }
@@ -8176,7 +8176,7 @@ class Zd {
8176
8176
  (i) => ge(i) && i.infoType === "error"
8177
8177
  );
8178
8178
  if (t)
8179
- throw new _e(
8179
+ throw new Ne(
8180
8180
  "chat-engine-error",
8181
8181
  void 0,
8182
8182
  t.text || "Chat engine error occurred"
@@ -8196,7 +8196,7 @@ class Zd {
8196
8196
  (s) => ge(s) && s.infoType === "error"
8197
8197
  );
8198
8198
  if (i)
8199
- throw new _e(
8199
+ throw new Ne(
8200
8200
  "chat-write-error",
8201
8201
  void 0,
8202
8202
  i.text || "Unable to send message"
@@ -8233,7 +8233,7 @@ class Zd {
8233
8233
  (s) => ge(s) && s.infoType === "error"
8234
8234
  );
8235
8235
  if (i)
8236
- throw new _e(
8236
+ throw new Ne(
8237
8237
  "chat-email-session-error",
8238
8238
  void 0,
8239
8239
  i.text || "Unable to send email with conversation"
@@ -9738,7 +9738,7 @@ const Ka = "important", cp = " !" + Ka, up = ln(class extends Jn {
9738
9738
  i.includes("-") || r ? t.setProperty(i, r ? s.slice(0, -11) : s, r ? Ka : "") : t[i] = s;
9739
9739
  }
9740
9740
  }
9741
- return Ie;
9741
+ return Le;
9742
9742
  }
9743
9743
  });
9744
9744
  var hp = Object.defineProperty, dp = (n, e, t, i) => {
@@ -9917,13 +9917,13 @@ class Ts extends xc {
9917
9917
  try {
9918
9918
  await ((i = this.engine) == null ? void 0 : i.chatWrite(e.text));
9919
9919
  } catch (s) {
9920
- s instanceof _e ? t.setStatus("failed") : (t.setStatus("failed"), console.warn("Unhandled error:", s));
9920
+ s instanceof Ne ? t.setStatus("failed") : (t.setStatus("failed"), console.warn("Unhandled error:", s));
9921
9921
  }
9922
9922
  })();
9923
9923
  }
9924
9924
  save(e) {
9925
9925
  this.component.stateMachine.session().pipe(
9926
- Le((t) => (t == null ? void 0 : t.data$) || Re),
9926
+ Re((t) => (t == null ? void 0 : t.data$) || Oe),
9927
9927
  ve(1)
9928
9928
  ).subscribe((t) => {
9929
9929
  this.saveToCurrentSession$.next({ ...t, ...e });
@@ -9956,12 +9956,12 @@ class Ts extends xc {
9956
9956
  t || (this.headerComponent.showAuthOptions = !1), t && this.shouldUseAuth && this.idHubEidType ? (this.component.setAuthenticationBannerStatus(H.NonAuthenticated), this.setupIDHubAuth(), this.idHubClient && await this.startAuthenticationFlow()) : this.handleWelcomeForm(e, void 0, t);
9957
9957
  }
9958
9958
  setupAuthenticationListeners() {
9959
- var e;
9960
- this.shouldUseAuth && this.headerComponent && this.headerComponent.actions$ && ((e = this.headerComponent) == null || e.actions$.pipe(
9961
- G((t) => t.key === "start-auth"),
9959
+ var e, t;
9960
+ this.shouldUseAuth && ((e = this.headerComponent) != null && e.actions$) && ((t = this.headerComponent) == null || t.actions$.pipe(
9961
+ G((i) => i.key === "start-auth"),
9962
9962
  z(this.disconnected$)
9963
- ).subscribe((t) => {
9964
- t.key === "start-auth" && this.handleAuthentication();
9963
+ ).subscribe((i) => {
9964
+ i.key === "start-auth" && this.handleAuthentication();
9965
9965
  }));
9966
9966
  }
9967
9967
  setupIDHubAuth() {
@@ -9972,12 +9972,12 @@ class Ts extends xc {
9972
9972
  });
9973
9973
  }
9974
9974
  async startAuthenticationFlow(e = !1) {
9975
- if (this.component.disableInput(), e || (this.resetAuthState(H.NonAuthenticated), this.authResult = await this.getAuthResult()), !!this.authResult)
9975
+ if (this.component.disableInput(), e === !1 && (this.resetAuthState(H.NonAuthenticated), this.authResult = await this.getAuthResult()), !!this.authResult)
9976
9976
  switch (this.idHubEidType) {
9977
9977
  // ========================
9978
9978
  // Tunnistus authentication
9979
9979
  // ========================
9980
- case Oe.Tunnistus:
9980
+ case Te.Tunnistus:
9981
9981
  if (!this.authResult.tunnistusURL) {
9982
9982
  this.printSystem(
9983
9983
  this.texts.getOrFallback(
@@ -10000,7 +10000,7 @@ class Ts extends xc {
10000
10000
  // =====================
10001
10001
  // BankId authentication
10002
10002
  // =====================
10003
- case Oe.BankId:
10003
+ case Te.BankId:
10004
10004
  break;
10005
10005
  }
10006
10006
  }
@@ -10046,7 +10046,7 @@ class Ts extends xc {
10046
10046
  customerName: this.customerName ?? e.customerName
10047
10047
  }).pipe(
10048
10048
  z(this.disconnected$),
10049
- vt((s) => (this.handleChatEngineError(s), Re))
10049
+ vt((s) => (this.handleChatEngineError(s), Oe))
10050
10050
  ).subscribe()) : this.engine.chatRequest({
10051
10051
  customerName: e.customerName,
10052
10052
  customerEmailAddress: e.customerEmailAddress ?? "",
@@ -10056,55 +10056,23 @@ class Ts extends xc {
10056
10056
  ...t && { authToken: t }
10057
10057
  }).pipe(
10058
10058
  z(this.disconnected$),
10059
- vt((s) => (this.handleChatEngineError(s), Re))
10059
+ vt((s) => (this.handleChatEngineError(s), Oe))
10060
10060
  ).subscribe(), this.component.enableInput(), this.component.enableSkipToLatestMessage(), this.setEndConversationOption();
10061
10061
  }
10062
10062
  restartNewChat() {
10063
10063
  this.engine && (this.setSessionId(null), this.component.clearMessages(), this.removeHeaderOptions(), this.connect(this._conversationOptions));
10064
10064
  }
10065
10065
  handleChatEngineError(e) {
10066
- console.error(e);
10067
- const t = e instanceof _e ? e.errorType : "chat-unknown-error", i = this.getUIErrorMessage(t);
10068
- this.printSystem(i), this.resetChatState();
10066
+ console.error(e), this.printSystem(
10067
+ this.texts.getOrFallback(
10068
+ "chat-engine.service-error",
10069
+ "We are experiencing issues. Chat is temporarily down."
10070
+ )
10071
+ ), this.resetChatState();
10069
10072
  }
10070
10073
  resetChatState() {
10071
10074
  this.component.setAuthenticationBannerStatus(H.NonAuthenticated), this.setSessionId(null), this.resetAuthState(H.NonAuthenticated), this.endConversation(), this.setStartNewChatOption();
10072
10075
  }
10073
- getUIErrorMessage(e) {
10074
- switch (e) {
10075
- case "chat-request-error":
10076
- return this.texts.getOrFallback(
10077
- "chat-engine.request-error",
10078
- "There was a problem starting your chat."
10079
- );
10080
- case "chat-join-error":
10081
- return this.texts.getOrFallback(
10082
- "chat-engine.join-error",
10083
- "There was a problem joining your chat."
10084
- );
10085
- case "chat-engine-error":
10086
- return this.texts.getOrFallback(
10087
- "chat-engine.service-error",
10088
- "Chat service encountered an error."
10089
- );
10090
- case "chat-write-error":
10091
- return this.texts.getOrFallback(
10092
- "chat-engine.write-error",
10093
- "Failed to send your message."
10094
- );
10095
- case "chat-email-session-error":
10096
- return this.texts.getOrFallback(
10097
- "chat-engine.email-error",
10098
- "Email service unavailable."
10099
- );
10100
- case "chat-unknown-error":
10101
- default:
10102
- return this.texts.getOrFallback(
10103
- "chat-engine.unknown-error",
10104
- "An error occurred. Chat service temporarily unavailable."
10105
- );
10106
- }
10107
- }
10108
10076
  setQueueStatus(e) {
10109
10077
  this.setToastMessage(e);
10110
10078
  }
@@ -10127,13 +10095,12 @@ class Ts extends xc {
10127
10095
  "email-form.error-message",
10128
10096
  "Unable to send email with the conversation."
10129
10097
  )
10130
- ), i instanceof _e || console.warn("Unhandled error:", i);
10098
+ ), i instanceof Ne || console.warn("Unhandled error:", i);
10131
10099
  }
10132
10100
  }
10133
10101
  clearPendingMessages() {
10134
- this.pendingMessages.forEach((e) => {
10102
+ for (const e of this.pendingMessages)
10135
10103
  e.remove();
10136
- });
10137
10104
  }
10138
10105
  setSessionId(e) {
10139
10106
  this.sessionId = e;
@@ -10169,7 +10136,7 @@ class Ts extends xc {
10169
10136
  ), this.headerComponent.authState = H.Authenticating;
10170
10137
  const e = await this.idHubClient.collect();
10171
10138
  switch (this.authenticationCardEntry && this.authenticationCardEntry.remove(), this.idHubEidType) {
10172
- case Oe.Tunnistus:
10139
+ case Te.Tunnistus:
10173
10140
  if (e.status === F.Error) {
10174
10141
  if (this.authResult = await this.getAuthResult(), !this.authResult) return;
10175
10142
  this.headerComponent.userName = this.texts.getOrFallback(
@@ -10198,7 +10165,7 @@ class Ts extends xc {
10198
10165
  );
10199
10166
  }
10200
10167
  break;
10201
- case Oe.BankId:
10168
+ case Te.BankId:
10202
10169
  break;
10203
10170
  }
10204
10171
  }