@telia-ace/widget-conversation-flamingo 1.0.14 → 1.0.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.
Files changed (68) hide show
  1. package/{dist/agent.d.ts → agent.d.ts} +0 -1
  2. package/components/conversation/conversation.d.ts +20 -0
  3. package/{dist/components → components}/conversation/plugin.d.ts +0 -1
  4. package/{dist/components → components}/conversation/ui/message-list.d.ts +1 -2
  5. package/{dist/components → components}/conversation/ui/message-types/message-type-html.d.ts +1 -2
  6. package/{dist/components → components}/conversation/ui/message-types/message-type-link-list.d.ts +1 -2
  7. package/{dist/components → components}/conversation/ui/message-types/message-type-separator.d.ts +1 -2
  8. package/{dist/components → components}/conversation/ui/message.d.ts +2 -3
  9. package/{dist/components → components}/conversation/utils.d.ts +0 -1
  10. package/conversation-18045ffc.mjs +1884 -0
  11. package/conversation-2a8210a9.js +446 -0
  12. package/{dist/conversation-controller.d.ts → conversation-controller.d.ts} +0 -1
  13. package/{dist/conversation-history.d.ts → conversation-history.d.ts} +0 -1
  14. package/{dist/conversation-platform.d.ts → conversation-platform.d.ts} +1 -2
  15. package/{dist/conversation-provider.d.ts → conversation-provider.d.ts} +0 -1
  16. package/{dist/index-9688347a-02584d39.js → index-17239ac6.mjs} +245 -245
  17. package/index-17fa2121.js +1 -0
  18. package/index-8a04bebb.mjs +3887 -0
  19. package/index-a12a1d3f.js +160 -0
  20. package/{dist/index.d.ts → index.d.ts} +0 -1
  21. package/index.js +1 -0
  22. package/{dist/index.js → index.mjs} +3 -4
  23. package/package.json +6 -47
  24. package/send-1e9780e5.mjs +5 -0
  25. package/send-df47dcea.js +1 -0
  26. package/{dist/store.d.ts → store.d.ts} +0 -1
  27. package/{dist/types.d.ts → types.d.ts} +0 -1
  28. package/{dist/user.d.ts → user.d.ts} +0 -1
  29. package/{dist/utils → utils}/custom-message.d.ts +0 -1
  30. package/{dist/utils → utils}/index.d.ts +0 -1
  31. package/{dist/utils → utils}/open-chat-widget.d.ts +0 -1
  32. package/{dist/utils → utils}/swap-provider.d.ts +0 -1
  33. package/LICENSE.txt +0 -6
  34. package/README.md +0 -490
  35. package/dist/agent.d.ts.map +0 -1
  36. package/dist/components/conversation/conversation.d.ts +0 -26
  37. package/dist/components/conversation/conversation.d.ts.map +0 -1
  38. package/dist/components/conversation/plugin.d.ts.map +0 -1
  39. package/dist/components/conversation/ui/message-list.d.ts.map +0 -1
  40. package/dist/components/conversation/ui/message-types/message-type-html.d.ts.map +0 -1
  41. package/dist/components/conversation/ui/message-types/message-type-link-list.d.ts.map +0 -1
  42. package/dist/components/conversation/ui/message-types/message-type-separator.d.ts.map +0 -1
  43. package/dist/components/conversation/ui/message.d.ts.map +0 -1
  44. package/dist/components/conversation/utils.d.ts.map +0 -1
  45. package/dist/conversation-309361e4.js +0 -2287
  46. package/dist/conversation-309361e4.js.map +0 -1
  47. package/dist/conversation-controller.d.ts.map +0 -1
  48. package/dist/conversation-form-adapter.d.ts +0 -7
  49. package/dist/conversation-form-adapter.d.ts.map +0 -1
  50. package/dist/conversation-history.d.ts.map +0 -1
  51. package/dist/conversation-platform.d.ts.map +0 -1
  52. package/dist/conversation-provider.d.ts.map +0 -1
  53. package/dist/index-9688347a-02584d39.js.map +0 -1
  54. package/dist/index-c61b2340.js +0 -5175
  55. package/dist/index-c61b2340.js.map +0 -1
  56. package/dist/index.d.ts.map +0 -1
  57. package/dist/index.js.map +0 -1
  58. package/dist/resolve-entity-value.d.ts +0 -11
  59. package/dist/resolve-entity-value.d.ts.map +0 -1
  60. package/dist/store.d.ts.map +0 -1
  61. package/dist/types.d.ts.map +0 -1
  62. package/dist/user.d.ts.map +0 -1
  63. package/dist/utils/custom-message.d.ts.map +0 -1
  64. package/dist/utils/index.d.ts.map +0 -1
  65. package/dist/utils/map-actions.d.ts +0 -2
  66. package/dist/utils/map-actions.d.ts.map +0 -1
  67. package/dist/utils/open-chat-widget.d.ts.map +0 -1
  68. package/dist/utils/swap-provider.d.ts.map +0 -1
@@ -0,0 +1,1884 @@
1
+ import { p as Dt, P as he, h as ue, i as w, n as x, t as k, E as ft, m as fe, a as It, b as at, e as lt, A as $, s as P, x as f, C as V, o as Nt, T as pe } from "./index-8a04bebb.mjs";
2
+ import { g as $e, s as ge } from "./send-1e9780e5.mjs";
3
+ /**
4
+ * @license
5
+ * Copyright 2017 Google LLC
6
+ * SPDX-License-Identifier: BSD-3-Clause
7
+ */
8
+ const L = (e) => (t) => typeof t == "function" ? ((s, i) => (customElements.define(s, i), i))(e, t) : ((s, i) => {
9
+ const { kind: n, elements: o } = i;
10
+ return { kind: n, elements: o, finisher(r) {
11
+ customElements.define(s, r);
12
+ } };
13
+ })(e, t);
14
+ /**
15
+ * @license
16
+ * Copyright 2017 Google LLC
17
+ * SPDX-License-Identifier: BSD-3-Clause
18
+ */
19
+ const ve = ({ finisher: e, descriptor: t }) => (s, i) => {
20
+ var n;
21
+ if (i === void 0) {
22
+ const o = (n = s.originalKey) !== null && n !== void 0 ? n : s.key, r = t != null ? { kind: "method", placement: "prototype", key: o, descriptor: t(s.key) } : { ...s, key: o };
23
+ return e != null && (r.finisher = function(a) {
24
+ e(a, o);
25
+ }), r;
26
+ }
27
+ {
28
+ const o = s.constructor;
29
+ t !== void 0 && Object.defineProperty(s, i, t(i)), e == null || e(o, i);
30
+ }
31
+ };
32
+ /**
33
+ * @license
34
+ * Copyright 2021 Google LLC
35
+ * SPDX-License-Identifier: BSD-3-Clause
36
+ */
37
+ let Ht = class extends Event {
38
+ constructor(t, s, i) {
39
+ super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.callback = s, this.subscribe = i != null && i;
40
+ }
41
+ };
42
+ /**
43
+ * @license
44
+ * Copyright 2021 Google LLC
45
+ * SPDX-License-Identifier: BSD-3-Clause
46
+ */
47
+ /**
48
+ * @license
49
+ * Copyright 2021 Google LLC
50
+ * SPDX-License-Identifier: BSD-3-Clause
51
+ */
52
+ let me = class {
53
+ constructor(t, s, i, n) {
54
+ var o;
55
+ if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (r, a) => {
56
+ this.unsubscribe && (this.unsubscribe !== a && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = r, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(r, a)), this.unsubscribe = a;
57
+ }, this.host = t, s.context !== void 0) {
58
+ const r = s;
59
+ this.context = r.context, this.callback = r.callback, this.subscribe = (o = r.subscribe) !== null && o !== void 0 && o;
60
+ } else
61
+ this.context = s, this.callback = i, this.subscribe = n != null && n;
62
+ this.host.addController(this);
63
+ }
64
+ hostConnected() {
65
+ this.dispatchRequest();
66
+ }
67
+ hostDisconnected() {
68
+ this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
69
+ }
70
+ dispatchRequest() {
71
+ this.host.dispatchEvent(new Ht(this.context, this.t, this.subscribe));
72
+ }
73
+ };
74
+ /**
75
+ * @license
76
+ * Copyright 2021 Google LLC
77
+ * SPDX-License-Identifier: BSD-3-Clause
78
+ */
79
+ let be = class {
80
+ constructor(t) {
81
+ this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
82
+ for (const [s, { disposer: i }] of this.subscriptions)
83
+ s(this.o, i);
84
+ }, t !== void 0 && (this.value = t);
85
+ }
86
+ get value() {
87
+ return this.o;
88
+ }
89
+ set value(t) {
90
+ this.setValue(t);
91
+ }
92
+ setValue(t, s = !1) {
93
+ const i = s || !Object.is(t, this.o);
94
+ this.o = t, i && this.updateObservers();
95
+ }
96
+ addCallback(t, s, i) {
97
+ if (!i)
98
+ return void t(this.value);
99
+ this.subscriptions.has(t) || this.subscriptions.set(t, { disposer: () => {
100
+ this.subscriptions.delete(t);
101
+ }, consumerHost: s });
102
+ const { disposer: n } = this.subscriptions.get(t);
103
+ t(this.value, n);
104
+ }
105
+ clearCallbacks() {
106
+ this.subscriptions.clear();
107
+ }
108
+ };
109
+ /**
110
+ * @license
111
+ * Copyright 2021 Google LLC
112
+ * SPDX-License-Identifier: BSD-3-Clause
113
+ */
114
+ let ye = class extends Event {
115
+ constructor(t) {
116
+ super("context-provider", { bubbles: !0, composed: !0 }), this.context = t;
117
+ }
118
+ }, j = class extends be {
119
+ constructor(t, s, i) {
120
+ super(s.context !== void 0 ? s.initialValue : i), this.onContextRequest = (n) => {
121
+ const o = n.composedPath()[0];
122
+ n.context === this.context && o !== this.host && (n.stopPropagation(), this.addCallback(n.callback, o, n.subscribe));
123
+ }, this.onProviderRequest = (n) => {
124
+ const o = n.composedPath()[0];
125
+ if (n.context !== this.context || o === this.host)
126
+ return;
127
+ const r = /* @__PURE__ */ new Set();
128
+ for (const [a, { consumerHost: l }] of this.subscriptions)
129
+ r.has(a) || (r.add(a), l.dispatchEvent(new Ht(this.context, a, !0)));
130
+ n.stopPropagation();
131
+ }, this.host = t, s.context !== void 0 ? this.context = s.context : this.context = s, this.attachListeners(), this.host.addController(this);
132
+ }
133
+ attachListeners() {
134
+ this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
135
+ }
136
+ hostConnected() {
137
+ this.host.dispatchEvent(new ye(this.context));
138
+ }
139
+ };
140
+ /**
141
+ * @license
142
+ * Copyright 2022 Google LLC
143
+ * SPDX-License-Identifier: BSD-3-Clause
144
+ */
145
+ function xe({ context: e, subscribe: t }) {
146
+ return ve({ finisher: (s, i) => {
147
+ s.addInitializer((n) => {
148
+ new me(n, { context: e, callback: (o) => {
149
+ n[i] = o;
150
+ }, subscribe: t });
151
+ });
152
+ } });
153
+ }
154
+ const _e = "children", we = "descriptor", ke = "container", Ce = "context", Se = "layout", Te = "properties";
155
+ class Oe {
156
+ constructor(t) {
157
+ (this.host = t).addController(this);
158
+ }
159
+ hostConnected() {
160
+ }
161
+ hostDisconnected() {
162
+ }
163
+ setDescriptor(t) {
164
+ this._descriptor = t;
165
+ }
166
+ setContainer(t) {
167
+ this._container = t;
168
+ }
169
+ async dispatch(t, s) {
170
+ if (!this._container || !this._descriptor)
171
+ return;
172
+ const i = await Dt.getInstance(
173
+ this._container
174
+ ), n = new he(i).withId(
175
+ this._descriptor.id
176
+ );
177
+ await i.actions(
178
+ n,
179
+ this._descriptor.type || ue()
180
+ ).dispatch(t, s);
181
+ }
182
+ }
183
+ const Ae = (e) => {
184
+ const t = {};
185
+ return Object.keys(e).forEach((s) => {
186
+ s.indexOf("css-") > -1 && (t[s] = e[s]);
187
+ }), t;
188
+ }, Pe = (e, t) => {
189
+ const s = Ae(t);
190
+ Object.entries(s).forEach(([i, n]) => {
191
+ e.style.setProperty(i.replace("css-", ""), n);
192
+ });
193
+ };
194
+ var Le = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, y = (e, t, s, i) => {
195
+ for (var n = i > 1 ? void 0 : i ? Ee(t, s) : t, o = e.length - 1, r; o >= 0; o--)
196
+ (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
197
+ return i && n && Le(t, s, n), n;
198
+ };
199
+ const je = (e) => {
200
+ class t extends e {
201
+ constructor() {
202
+ super(...arguments), this.entry = "", this._descriptorProvider = new j(
203
+ this,
204
+ we,
205
+ void 0
206
+ ), this._childrenProvider = new j(this, _e, []), this._propertiesProvider = new j(this, Te, {}), this._contextProvider = new j(this, Ce, {}), this._layoutProvider = new j(this, Se, {}), this.actions = new Oe(this), this.context = {}, this.layout = {}, this.properties = {};
207
+ }
208
+ connectedCallback() {
209
+ super.connectedCallback(), this.container && (this.actions.setContainer(this.container), Dt.getInstance(this.container).then(
210
+ async (i) => {
211
+ var o;
212
+ const n = i.nodes.get(this.entry);
213
+ if (n) {
214
+ this._propertyChangeListener = i.events.subscribe(
215
+ "components:properties-changed",
216
+ (h, d) => {
217
+ n.id === d.node.id && this._setProperties(d.node.attributes.properties);
218
+ }
219
+ ), this._contextChangeListener = i.events.subscribe(
220
+ "components:context-changed",
221
+ (h, d) => {
222
+ n.id === d.node.id && this._setContext(d.node.attributes.context);
223
+ }
224
+ ), this._layoutChangeListener = i.events.subscribe(
225
+ "components:layout-changed",
226
+ (h, d) => {
227
+ n.id === d.node.id && this._setLayout(d.node.attributes.layout);
228
+ }
229
+ );
230
+ const r = "default";
231
+ this._unmountNode = n.mount(this.container), this._setDescriptor(ft(n, r)), this._setProperties(n.attributes.properties), this._setContext(n.attributes.context), this._setLayout(this.layout);
232
+ const a = n.getChildren(r).map((h) => ft(h));
233
+ this._childrenProvider.setValue(a);
234
+ const c = (await this.container.getAsync("componentResolver")).getComponent(
235
+ ((o = this.descriptor) == null ? void 0 : o.type) || ""
236
+ );
237
+ c.then && c.then((h) => {
238
+ this.component = h.default;
239
+ });
240
+ }
241
+ }
242
+ ));
243
+ }
244
+ disconnectedCallback() {
245
+ super.disconnectedCallback(), this._propertyChangeListener && this._propertyChangeListener(), this._contextChangeListener && this._contextChangeListener(), this._layoutChangeListener && this._layoutChangeListener(), this._unmountNode && this._unmountNode();
246
+ }
247
+ updated() {
248
+ this.container && this.actions.setContainer(this.container), fe(this.context, this.renderRoot.host), this.renderRoot.host.style.setProperty(
249
+ "--width",
250
+ this.layout.size === "full" ? "var(--columns, 1)" : `min(${this.layout.size || "var(--columns)"}, var(--columns))`
251
+ ), Pe(this.renderRoot.host, this.properties);
252
+ }
253
+ _setProperties(i) {
254
+ this._propertiesProvider.setValue(i), this.properties = i;
255
+ }
256
+ _setContext(i) {
257
+ this._contextProvider.setValue(i), this.context = i;
258
+ }
259
+ _setLayout(i) {
260
+ this._layoutProvider.setValue(i), this.layout = i;
261
+ }
262
+ _setDescriptor(i) {
263
+ this.descriptor = i, this._descriptorProvider.setValue(i), this.actions.setDescriptor(i);
264
+ }
265
+ }
266
+ return t.styles = [
267
+ e.styles ?? [],
268
+ w`
269
+ :host {
270
+ font-family: var(--font-family);
271
+ grid-column: span var(--width);
272
+ max-width: 100%;
273
+ overflow: hidden;
274
+ box-sizing: border-box;
275
+ display: block;
276
+ }
277
+ * {
278
+ box-sizing: border-box;
279
+ }
280
+ `
281
+ ], y([
282
+ xe({ context: ke }),
283
+ x({ attribute: !1 })
284
+ ], t.prototype, "container", 2), y([
285
+ x()
286
+ ], t.prototype, "entry", 2), y([
287
+ k()
288
+ ], t.prototype, "descriptor", 2), y([
289
+ k()
290
+ ], t.prototype, "component", 2), y([
291
+ k()
292
+ ], t.prototype, "context", 2), y([
293
+ k()
294
+ ], t.prototype, "layout", 2), y([
295
+ k()
296
+ ], t.prototype, "properties", 2), t;
297
+ };
298
+ /**
299
+ * @license
300
+ * Copyright 2020 Google LLC
301
+ * SPDX-License-Identifier: BSD-3-Clause
302
+ */
303
+ const Re = (e) => e.strings === void 0;
304
+ /**
305
+ * @license
306
+ * Copyright 2017 Google LLC
307
+ * SPDX-License-Identifier: BSD-3-Clause
308
+ */
309
+ const R = (e, t) => {
310
+ var s, i;
311
+ const n = e._$AN;
312
+ if (n === void 0)
313
+ return !1;
314
+ for (const o of n)
315
+ (i = (s = o)._$AO) === null || i === void 0 || i.call(s, t, !1), R(o, t);
316
+ return !0;
317
+ }, M = (e) => {
318
+ let t, s;
319
+ do {
320
+ if ((t = e._$AM) === void 0)
321
+ break;
322
+ s = t._$AN, s.delete(e), e = t;
323
+ } while ((s == null ? void 0 : s.size) === 0);
324
+ }, zt = (e) => {
325
+ for (let t; t = e._$AM; e = t) {
326
+ let s = t._$AN;
327
+ if (s === void 0)
328
+ t._$AN = s = /* @__PURE__ */ new Set();
329
+ else if (s.has(e))
330
+ break;
331
+ s.add(e), Ne(t);
332
+ }
333
+ };
334
+ function De(e) {
335
+ this._$AN !== void 0 ? (M(this), this._$AM = e, zt(this)) : this._$AM = e;
336
+ }
337
+ function Ie(e, t = !1, s = 0) {
338
+ const i = this._$AH, n = this._$AN;
339
+ if (n !== void 0 && n.size !== 0)
340
+ if (t)
341
+ if (Array.isArray(i))
342
+ for (let o = s; o < i.length; o++)
343
+ R(i[o], !1), M(i[o]);
344
+ else
345
+ i != null && (R(i, !1), M(i));
346
+ else
347
+ R(this, e);
348
+ }
349
+ const Ne = (e) => {
350
+ var t, s, i, n;
351
+ e.type == at.CHILD && ((t = (i = e)._$AP) !== null && t !== void 0 || (i._$AP = Ie), (s = (n = e)._$AQ) !== null && s !== void 0 || (n._$AQ = De));
352
+ };
353
+ class Mt extends It {
354
+ constructor() {
355
+ super(...arguments), this._$AN = void 0;
356
+ }
357
+ _$AT(t, s, i) {
358
+ super._$AT(t, s, i), zt(this), this.isConnected = t._$AU;
359
+ }
360
+ _$AO(t, s = !0) {
361
+ var i, n;
362
+ t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) === null || i === void 0 || i.call(this) : (n = this.disconnected) === null || n === void 0 || n.call(this)), s && (R(this, t), M(this));
363
+ }
364
+ setValue(t) {
365
+ if (Re(this._$Ct))
366
+ this._$Ct._$AI(t, this);
367
+ else {
368
+ const s = [...this._$Ct._$AH];
369
+ s[this._$Ci] = t, this._$Ct._$AI(s, this, 0);
370
+ }
371
+ }
372
+ disconnected() {
373
+ }
374
+ reconnected() {
375
+ }
376
+ }
377
+ /**
378
+ * @license
379
+ * Copyright 2020 Google LLC
380
+ * SPDX-License-Identifier: BSD-3-Clause
381
+ */
382
+ const He = () => new ze();
383
+ let ze = class {
384
+ };
385
+ const tt = /* @__PURE__ */ new WeakMap(), Me = lt(class extends Mt {
386
+ render(e) {
387
+ return $;
388
+ }
389
+ update(e, [t]) {
390
+ var s;
391
+ const i = t !== this.G;
392
+ return i && this.G !== void 0 && this.ot(void 0), (i || this.rt !== this.lt) && (this.G = t, this.dt = (s = e.options) === null || s === void 0 ? void 0 : s.host, this.ot(this.lt = e.element)), $;
393
+ }
394
+ ot(e) {
395
+ var t;
396
+ if (typeof this.G == "function") {
397
+ const s = (t = this.dt) !== null && t !== void 0 ? t : globalThis;
398
+ let i = tt.get(s);
399
+ i === void 0 && (i = /* @__PURE__ */ new WeakMap(), tt.set(s, i)), i.get(this.G) !== void 0 && this.G.call(this.dt, void 0), i.set(this.G, e), e !== void 0 && this.G.call(this.dt, e);
400
+ } else
401
+ this.G.value = e;
402
+ }
403
+ get rt() {
404
+ var e, t, s;
405
+ return typeof this.G == "function" ? (t = tt.get((e = this.dt) !== null && e !== void 0 ? e : globalThis)) === null || t === void 0 ? void 0 : t.get(this.G) : (s = this.G) === null || s === void 0 ? void 0 : s.value;
406
+ }
407
+ disconnected() {
408
+ this.rt === this.lt && this.ot(void 0);
409
+ }
410
+ reconnected() {
411
+ this.ot(this.lt);
412
+ }
413
+ }), Fe = /* @__PURE__ */ new WeakMap();
414
+ let pt = 0;
415
+ const et = /* @__PURE__ */ new Map(), $t = /* @__PURE__ */ new WeakSet(), gt = () => new Promise((e) => requestAnimationFrame(e)), vt = [{ opacity: 0 }], mt = [{ opacity: 0 }, { opacity: 1 }], bt = (e, t) => {
416
+ const s = e - t;
417
+ return s === 0 ? void 0 : s;
418
+ }, yt = (e, t) => {
419
+ const s = e / t;
420
+ return s === 1 ? void 0 : s;
421
+ }, st = { left: (e, t) => {
422
+ const s = bt(e, t);
423
+ return { value: s, transform: s == null || isNaN(s) ? void 0 : `translateX(${s}px)` };
424
+ }, top: (e, t) => {
425
+ const s = bt(e, t);
426
+ return { value: s, transform: s == null || isNaN(s) ? void 0 : `translateY(${s}px)` };
427
+ }, width: (e, t) => {
428
+ let s;
429
+ t === 0 && (t = 1, s = { width: "1px" });
430
+ const i = yt(e, t);
431
+ return { value: i, overrideFrom: s, transform: i == null || isNaN(i) ? void 0 : `scaleX(${i})` };
432
+ }, height: (e, t) => {
433
+ let s;
434
+ t === 0 && (t = 1, s = { height: "1px" });
435
+ const i = yt(e, t);
436
+ return { value: i, overrideFrom: s, transform: i == null || isNaN(i) ? void 0 : `scaleY(${i})` };
437
+ } }, Ue = { duration: 333, easing: "ease-in-out" }, Be = ["left", "top", "width", "height", "opacity", "color", "background"], xt = /* @__PURE__ */ new WeakMap();
438
+ class We extends Mt {
439
+ constructor(t) {
440
+ if (super(t), this.t = null, this.i = null, this.o = !0, this.shouldLog = !1, t.type === at.CHILD)
441
+ throw Error("The `animate` directive must be used in attribute position.");
442
+ this.createFinished();
443
+ }
444
+ createFinished() {
445
+ var t;
446
+ (t = this.resolveFinished) === null || t === void 0 || t.call(this), this.finished = new Promise((s) => {
447
+ this.h = s;
448
+ });
449
+ }
450
+ async resolveFinished() {
451
+ var t;
452
+ (t = this.h) === null || t === void 0 || t.call(this), this.h = void 0;
453
+ }
454
+ render(t) {
455
+ return $;
456
+ }
457
+ getController() {
458
+ return Fe.get(this.l);
459
+ }
460
+ isDisabled() {
461
+ var t;
462
+ return this.options.disabled || ((t = this.getController()) === null || t === void 0 ? void 0 : t.disabled);
463
+ }
464
+ update(t, [s]) {
465
+ var i;
466
+ const n = this.l === void 0;
467
+ return n && (this.l = (i = t.options) === null || i === void 0 ? void 0 : i.host, this.l.addController(this), this.element = t.element, xt.set(this.element, this)), this.optionsOrCallback = s, (n || typeof s != "function") && this.u(s), this.render(s);
468
+ }
469
+ u(t) {
470
+ var s, i;
471
+ t = t ?? {};
472
+ const n = this.getController();
473
+ n !== void 0 && ((t = { ...n.defaultOptions, ...t }).keyframeOptions = { ...n.defaultOptions.keyframeOptions, ...t.keyframeOptions }), (s = (i = t).properties) !== null && s !== void 0 || (i.properties = Be), this.options = t;
474
+ }
475
+ v() {
476
+ const t = {}, s = this.element.getBoundingClientRect(), i = getComputedStyle(this.element);
477
+ return this.options.properties.forEach((n) => {
478
+ var o;
479
+ const r = (o = s[n]) !== null && o !== void 0 ? o : st[n] ? void 0 : i[n], a = Number(r);
480
+ t[n] = isNaN(a) ? r + "" : a;
481
+ }), t;
482
+ }
483
+ p() {
484
+ let t, s = !0;
485
+ return this.options.guard && (t = this.options.guard(), s = ((i, n) => {
486
+ if (Array.isArray(i)) {
487
+ if (Array.isArray(n) && n.length === i.length && i.every((o, r) => o === n[r]))
488
+ return !1;
489
+ } else if (n === i)
490
+ return !1;
491
+ return !0;
492
+ })(t, this.m)), this.o = this.l.hasUpdated && !this.isDisabled() && !this.isAnimating() && s && this.element.isConnected, this.o && (this.m = Array.isArray(t) ? Array.from(t) : t), this.o;
493
+ }
494
+ hostUpdate() {
495
+ var t;
496
+ typeof this.optionsOrCallback == "function" && this.u(this.optionsOrCallback()), this.p() && (this.g = this.v(), this.t = (t = this.t) !== null && t !== void 0 ? t : this.element.parentNode, this.i = this.element.nextSibling);
497
+ }
498
+ async hostUpdated() {
499
+ if (!this.o || !this.element.isConnected || this.options.skipInitial && !this.isHostRendered)
500
+ return;
501
+ let t;
502
+ this.prepare(), await gt;
503
+ const s = this._(), i = this.A(this.options.keyframeOptions, s), n = this.v();
504
+ if (this.g !== void 0) {
505
+ const { from: o, to: r } = this.O(this.g, n, s);
506
+ this.log("measured", [this.g, n, o, r]), t = this.calculateKeyframes(o, r);
507
+ } else {
508
+ const o = et.get(this.options.inId);
509
+ if (o) {
510
+ et.delete(this.options.inId);
511
+ const { from: r, to: a } = this.O(o, n, s);
512
+ t = this.calculateKeyframes(r, a), t = this.options.in ? [{ ...this.options.in[0], ...t[0] }, ...this.options.in.slice(1), t[1]] : t, pt++, t.forEach((l) => l.zIndex = pt);
513
+ } else
514
+ this.options.in && (t = [...this.options.in, {}]);
515
+ }
516
+ this.animate(t, i);
517
+ }
518
+ resetStyles() {
519
+ var t;
520
+ this.j !== void 0 && (this.element.setAttribute("style", (t = this.j) !== null && t !== void 0 ? t : ""), this.j = void 0);
521
+ }
522
+ commitStyles() {
523
+ var t, s;
524
+ this.j = this.element.getAttribute("style"), (t = this.webAnimation) === null || t === void 0 || t.commitStyles(), (s = this.webAnimation) === null || s === void 0 || s.cancel();
525
+ }
526
+ reconnected() {
527
+ }
528
+ async disconnected() {
529
+ var t;
530
+ if (!this.o || (this.options.id !== void 0 && et.set(this.options.id, this.g), this.options.out === void 0))
531
+ return;
532
+ if (this.prepare(), await gt(), (t = this.t) === null || t === void 0 ? void 0 : t.isConnected) {
533
+ const i = this.i && this.i.parentNode === this.t ? this.i : null;
534
+ if (this.t.insertBefore(this.element, i), this.options.stabilizeOut) {
535
+ const n = this.v();
536
+ this.log("stabilizing out");
537
+ const o = this.g.left - n.left, r = this.g.top - n.top;
538
+ getComputedStyle(this.element).position !== "static" || o === 0 && r === 0 || (this.element.style.position = "relative"), o !== 0 && (this.element.style.left = o + "px"), r !== 0 && (this.element.style.top = r + "px");
539
+ }
540
+ }
541
+ const s = this.A(this.options.keyframeOptions);
542
+ await this.animate(this.options.out, s), this.element.remove();
543
+ }
544
+ prepare() {
545
+ this.createFinished();
546
+ }
547
+ start() {
548
+ var t, s;
549
+ (s = (t = this.options).onStart) === null || s === void 0 || s.call(t, this);
550
+ }
551
+ didFinish(t) {
552
+ var s, i;
553
+ t && ((i = (s = this.options).onComplete) === null || i === void 0 || i.call(s, this)), this.g = void 0, this.animatingProperties = void 0, this.frames = void 0, this.resolveFinished();
554
+ }
555
+ _() {
556
+ const t = [];
557
+ for (let s = this.element.parentNode; s; s = s == null ? void 0 : s.parentNode) {
558
+ const i = xt.get(s);
559
+ i && !i.isDisabled() && i && t.push(i);
560
+ }
561
+ return t;
562
+ }
563
+ get isHostRendered() {
564
+ const t = $t.has(this.l);
565
+ return t || this.l.updateComplete.then(() => {
566
+ $t.add(this.l);
567
+ }), t;
568
+ }
569
+ A(t, s = this._()) {
570
+ const i = { ...Ue };
571
+ return s.forEach((n) => Object.assign(i, n.options.keyframeOptions)), Object.assign(i, t), i;
572
+ }
573
+ O(t, s, i) {
574
+ t = { ...t }, s = { ...s };
575
+ const n = i.map((a) => a.animatingProperties).filter((a) => a !== void 0);
576
+ let o = 1, r = 1;
577
+ return n !== void 0 && (n.forEach((a) => {
578
+ a.width && (o /= a.width), a.height && (r /= a.height);
579
+ }), t.left !== void 0 && s.left !== void 0 && (t.left = o * t.left, s.left = o * s.left), t.top !== void 0 && s.top !== void 0 && (t.top = r * t.top, s.top = r * s.top)), { from: t, to: s };
580
+ }
581
+ calculateKeyframes(t, s, i = !1) {
582
+ var n;
583
+ const o = {}, r = {};
584
+ let a = !1;
585
+ const l = {};
586
+ for (const c in s) {
587
+ const h = t[c], d = s[c];
588
+ if (c in st) {
589
+ const u = st[c];
590
+ if (h === void 0 || d === void 0)
591
+ continue;
592
+ const p = u(h, d);
593
+ p.transform !== void 0 && (l[c] = p.value, a = !0, o.transform = `${(n = o.transform) !== null && n !== void 0 ? n : ""} ${p.transform}`, p.overrideFrom !== void 0 && Object.assign(o, p.overrideFrom));
594
+ } else
595
+ h !== d && h !== void 0 && d !== void 0 && (a = !0, o[c] = h, r[c] = d);
596
+ }
597
+ return o.transformOrigin = r.transformOrigin = i ? "center center" : "top left", this.animatingProperties = l, a ? [o, r] : void 0;
598
+ }
599
+ async animate(t, s = this.options.keyframeOptions) {
600
+ this.start(), this.frames = t;
601
+ let i = !1;
602
+ if (!this.isAnimating() && !this.isDisabled() && (this.options.onFrames && (this.frames = t = this.options.onFrames(this), this.log("modified frames", t)), t !== void 0)) {
603
+ this.log("animate", [t, s]), i = !0, this.webAnimation = this.element.animate(t, s);
604
+ const n = this.getController();
605
+ n == null || n.add(this);
606
+ try {
607
+ await this.webAnimation.finished;
608
+ } catch {
609
+ }
610
+ n == null || n.remove(this);
611
+ }
612
+ return this.didFinish(i), i;
613
+ }
614
+ isAnimating() {
615
+ var t, s;
616
+ return ((t = this.webAnimation) === null || t === void 0 ? void 0 : t.playState) === "running" || ((s = this.webAnimation) === null || s === void 0 ? void 0 : s.pending);
617
+ }
618
+ log(t, s) {
619
+ this.shouldLog && !this.isDisabled() && console.log(t, this.options.id, s);
620
+ }
621
+ }
622
+ const _t = lt(We), C = {
623
+ allRenderFn: !1,
624
+ cmpDidLoad: !0,
625
+ cmpDidUnload: !1,
626
+ cmpDidUpdate: !0,
627
+ cmpDidRender: !0,
628
+ cmpWillLoad: !0,
629
+ cmpWillUpdate: !0,
630
+ cmpWillRender: !0,
631
+ connectedCallback: !0,
632
+ disconnectedCallback: !0,
633
+ element: !0,
634
+ event: !0,
635
+ hasRenderFn: !0,
636
+ lifecycle: !0,
637
+ hostListener: !0,
638
+ hostListenerTargetWindow: !0,
639
+ hostListenerTargetDocument: !0,
640
+ hostListenerTargetBody: !0,
641
+ hostListenerTargetParent: !1,
642
+ hostListenerTarget: !0,
643
+ member: !0,
644
+ method: !0,
645
+ mode: !0,
646
+ observeAttribute: !0,
647
+ prop: !0,
648
+ propMutable: !0,
649
+ reflect: !0,
650
+ scoped: !0,
651
+ shadowDom: !0,
652
+ slot: !0,
653
+ cssAnnotations: !0,
654
+ state: !0,
655
+ style: !0,
656
+ svg: !0,
657
+ updatable: !0,
658
+ vdomAttribute: !0,
659
+ vdomXlink: !0,
660
+ vdomClass: !0,
661
+ vdomFunctional: !0,
662
+ vdomKey: !0,
663
+ vdomListener: !0,
664
+ vdomRef: !0,
665
+ vdomPropOrAttr: !0,
666
+ vdomRender: !0,
667
+ vdomStyle: !0,
668
+ vdomText: !0,
669
+ watchCallback: !0,
670
+ taskQueue: !0,
671
+ hotModuleReplacement: !1,
672
+ isDebug: !1,
673
+ isDev: !1,
674
+ isTesting: !1,
675
+ hydrateServerSide: !1,
676
+ hydrateClientSide: !1,
677
+ lifecycleDOMEvents: !1,
678
+ lazyLoad: !1,
679
+ profile: !1,
680
+ slotRelocation: !0,
681
+ appendChildSlotFix: !1,
682
+ cloneNodeFix: !1,
683
+ hydratedAttribute: !1,
684
+ hydratedClass: !0,
685
+ safari10: !1,
686
+ scriptDataOpts: !1,
687
+ scopedSlotTextContentFix: !1,
688
+ shadowDomShim: !1,
689
+ slotChildNodesFix: !1,
690
+ invisiblePrehydration: !0,
691
+ propBoolean: !0,
692
+ propNumber: !0,
693
+ propString: !0,
694
+ cssVarShim: !1,
695
+ constructableCSS: !0,
696
+ cmpShouldUpdate: !0,
697
+ devTools: !1,
698
+ dynamicImportShim: !1,
699
+ shadowDelegatesFocus: !0,
700
+ initializeNextTick: !1,
701
+ asyncLoading: !1,
702
+ asyncQueue: !1,
703
+ transformTagName: !1,
704
+ attachStyles: !0
705
+ };
706
+ let S, Ft, Y, Ut = !1, F = !1, ct = !1, v = !1, wt = null, it = !1;
707
+ const J = typeof window < "u" ? window : {}, b = J.document || { head: {} }, Bt = J.HTMLElement || class {
708
+ }, g = {
709
+ $flags$: 0,
710
+ $resourcesUrl$: "",
711
+ jmp: (e) => e(),
712
+ raf: (e) => requestAnimationFrame(e),
713
+ ael: (e, t, s, i) => e.addEventListener(t, s, i),
714
+ rel: (e, t, s, i) => e.removeEventListener(t, s, i),
715
+ ce: (e, t) => new CustomEvent(e, t)
716
+ }, qe = /* @__PURE__ */ (() => {
717
+ let e = !1;
718
+ try {
719
+ b.addEventListener("e", null, Object.defineProperty({}, "passive", {
720
+ get() {
721
+ e = !0;
722
+ }
723
+ }));
724
+ } catch {
725
+ }
726
+ return e;
727
+ })(), Ge = (e) => Promise.resolve(e), Ke = /* @__PURE__ */ (() => {
728
+ try {
729
+ return new CSSStyleSheet(), typeof new CSSStyleSheet().replace == "function";
730
+ } catch {
731
+ }
732
+ return !1;
733
+ })(), Wt = (e, t, s, i) => {
734
+ s && s.map(([n, o, r]) => {
735
+ const a = Xe(e, n), l = Qe(t, r), c = Ye(n);
736
+ g.ael(a, o, l, c), (t.$rmListeners$ = t.$rmListeners$ || []).push(() => g.rel(a, o, l, c));
737
+ });
738
+ }, Qe = (e, t) => (s) => {
739
+ try {
740
+ C.lazyLoad || e.$hostElement$[t](s);
741
+ } catch (i) {
742
+ N(i);
743
+ }
744
+ }, Xe = (e, t) => t & 4 ? b : t & 8 ? J : t & 16 ? b.body : e, Ye = (e) => qe ? {
745
+ passive: (e & 1) !== 0,
746
+ capture: (e & 2) !== 0
747
+ } : (e & 2) !== 0, kt = "http://www.w3.org/1999/xlink", _ = (e, t = "") => () => {
748
+ }, Ct = /* @__PURE__ */ new WeakMap(), Je = (e, t, s) => {
749
+ let i = W.get(e);
750
+ Ke && s ? (i = i || new CSSStyleSheet(), i.replace(t)) : i = t, W.set(e, i);
751
+ }, Ze = (e, t, s, i) => {
752
+ let n = qt(t, s), o = W.get(n);
753
+ if (e = e.nodeType === 11 ? e : b, o)
754
+ if (typeof o == "string") {
755
+ e = e.head || e;
756
+ let r = Ct.get(e), a;
757
+ r || Ct.set(e, r = /* @__PURE__ */ new Set()), r.has(n) || (a = b.createElement("style"), a.innerHTML = o, e.insertBefore(a, e.querySelector("link")), r && r.add(n));
758
+ } else
759
+ e.adoptedStyleSheets.includes(o) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, o]);
760
+ return n;
761
+ }, Ve = (e) => {
762
+ const t = e.$cmpMeta$, s = e.$hostElement$, i = t.$flags$, n = _("attachStyles", t.$tagName$), o = Ze(s.shadowRoot ? s.shadowRoot : s.getRootNode(), t, e.$modeName$);
763
+ i & 10 && (s["s-sc"] = o, s.classList.add(o + "-h"), i & 2 && s.classList.add(o + "-s")), n();
764
+ }, qt = (e, t) => "sc-" + (t && e.$flags$ & 32 ? e.$tagName$ + "-" + t : e.$tagName$), ts = (e) => Os.map((t) => t(e)).find((t) => !!t), St = {}, es = "http://www.w3.org/2000/svg", ss = "http://www.w3.org/1999/xhtml", is = (e) => e != null, dt = (e) => (e = typeof e, e === "object" || e === "function"), O = (e, t, ...s) => {
765
+ let i = null, n = null, o = null, r = !1, a = !1, l = [];
766
+ const c = (d) => {
767
+ for (let u = 0; u < d.length; u++)
768
+ i = d[u], Array.isArray(i) ? c(i) : i != null && typeof i != "boolean" && ((r = typeof e != "function" && !dt(i)) && (i = String(i)), r && a ? l[l.length - 1].$text$ += i : l.push(r ? U(null, i) : i), a = r);
769
+ };
770
+ if (c(s), t) {
771
+ t.key && (n = t.key), t.name && (o = t.name);
772
+ {
773
+ const d = t.className || t.class;
774
+ d && (t.class = typeof d != "object" ? d : Object.keys(d).filter((u) => d[u]).join(" "));
775
+ }
776
+ }
777
+ if (typeof e == "function")
778
+ return e(t === null ? {} : t, l, os);
779
+ const h = U(e, null);
780
+ return h.$attrs$ = t, l.length > 0 && (h.$children$ = l), h.$key$ = n, h.$name$ = o, h;
781
+ }, U = (e, t) => {
782
+ const s = {
783
+ $flags$: 0,
784
+ $tag$: e,
785
+ $text$: t,
786
+ $elm$: null,
787
+ $children$: null
788
+ };
789
+ return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;
790
+ }, ht = {}, ns = (e) => e && e.$tag$ === ht, os = {
791
+ forEach: (e, t) => e.map(Tt).forEach(t),
792
+ map: (e, t) => e.map(Tt).map(t).map(rs)
793
+ }, Tt = (e) => ({
794
+ vattrs: e.$attrs$,
795
+ vchildren: e.$children$,
796
+ vkey: e.$key$,
797
+ vname: e.$name$,
798
+ vtag: e.$tag$,
799
+ vtext: e.$text$
800
+ }), rs = (e) => {
801
+ if (typeof e.vtag == "function") {
802
+ const s = Object.assign({}, e.vattrs);
803
+ return e.vkey && (s.key = e.vkey), e.vname && (s.name = e.vname), O(e.vtag, s, ...e.vchildren || []);
804
+ }
805
+ const t = U(e.vtag, e.vtext);
806
+ return t.$attrs$ = e.vattrs, t.$children$ = e.vchildren, t.$key$ = e.vkey, t.$name$ = e.vname, t;
807
+ }, Ot = (e, t, s, i, n, o) => {
808
+ if (s !== i) {
809
+ let r = Et(e, t), a = t.toLowerCase();
810
+ if (t === "class") {
811
+ const l = e.classList, c = At(s), h = At(i);
812
+ l.remove(...c.filter((d) => d && !h.includes(d))), l.add(...h.filter((d) => d && !c.includes(d)));
813
+ } else if (t === "style") {
814
+ for (const l in s)
815
+ (!i || i[l] == null) && (l.includes("-") ? e.style.removeProperty(l) : e.style[l] = "");
816
+ for (const l in i)
817
+ (!s || i[l] !== s[l]) && (l.includes("-") ? e.style.setProperty(l, i[l]) : e.style[l] = i[l]);
818
+ } else if (t !== "key")
819
+ if (t === "ref")
820
+ i && i(e);
821
+ else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n")
822
+ t[2] === "-" ? t = t.slice(3) : Et(J, a) ? t = a.slice(2) : t = a[2] + t.slice(3), s && g.rel(e, t, s, !1), i && g.ael(e, t, i, !1);
823
+ else {
824
+ const l = dt(i);
825
+ if ((r || l && i !== null) && !n)
826
+ try {
827
+ if (e.tagName.includes("-"))
828
+ e[t] = i;
829
+ else {
830
+ let h = i ?? "";
831
+ t === "list" ? r = !1 : (s == null || e[t] != h) && (e[t] = h);
832
+ }
833
+ } catch {
834
+ }
835
+ let c = !1;
836
+ a !== (a = a.replace(/^xlink\:?/, "")) && (t = a, c = !0), i == null || i === !1 ? (i !== !1 || e.getAttribute(t) === "") && (c ? e.removeAttributeNS(kt, t) : e.removeAttribute(t)) : (!r || o & 4 || n) && !l && (i = i === !0 ? "" : i, c ? e.setAttributeNS(kt, t, i) : e.setAttribute(t, i));
837
+ }
838
+ }
839
+ }, as = /\s/, At = (e) => e ? e.split(as) : [], Gt = (e, t, s, i) => {
840
+ const n = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || St, r = t.$attrs$ || St;
841
+ for (i in o)
842
+ i in r || Ot(n, i, o[i], void 0, s, t.$flags$);
843
+ for (i in r)
844
+ Ot(n, i, o[i], r[i], s, t.$flags$);
845
+ }, B = (e, t, s, i) => {
846
+ let n = t.$children$[s], o = 0, r, a, l;
847
+ if (Ut || (ct = !0, n.$tag$ === "slot" && (S && i.classList.add(S + "-s"), n.$flags$ |= n.$children$ ? (
848
+ // slot element has fallback content
849
+ 2
850
+ ) : (
851
+ // slot element does not have fallback content
852
+ 1
853
+ ))), n.$text$ !== null)
854
+ r = n.$elm$ = b.createTextNode(n.$text$);
855
+ else if (n.$flags$ & 1)
856
+ r = n.$elm$ = b.createTextNode("");
857
+ else {
858
+ if (v || (v = n.$tag$ === "svg"), r = n.$elm$ = b.createElementNS(v ? es : ss, n.$flags$ & 2 ? "slot-fb" : n.$tag$), v && n.$tag$ === "foreignObject" && (v = !1), Gt(null, n, v), is(S) && r["s-si"] !== S && r.classList.add(r["s-si"] = S), n.$children$)
859
+ for (o = 0; o < n.$children$.length; ++o)
860
+ a = B(e, n, o, r), a && r.appendChild(a);
861
+ n.$tag$ === "svg" ? v = !1 : r.tagName === "foreignObject" && (v = !0);
862
+ }
863
+ return r["s-hn"] = Y, n.$flags$ & 3 && (r["s-sr"] = !0, r["s-cr"] = Ft, r["s-sn"] = n.$name$ || "", l = e && e.$children$ && e.$children$[s], l && l.$tag$ === n.$tag$ && e.$elm$ && D(e.$elm$, !1)), r;
864
+ }, D = (e, t) => {
865
+ g.$flags$ |= 1;
866
+ const s = e.childNodes;
867
+ for (let i = s.length - 1; i >= 0; i--) {
868
+ const n = s[i];
869
+ n["s-hn"] !== Y && n["s-ol"] && (Xt(n).insertBefore(n, ut(n)), n["s-ol"].remove(), n["s-ol"] = void 0, ct = !0), t && D(n, t);
870
+ }
871
+ g.$flags$ &= -2;
872
+ }, Kt = (e, t, s, i, n, o) => {
873
+ let r = e["s-cr"] && e["s-cr"].parentNode || e, a;
874
+ for (r.shadowRoot && r.tagName === Y && (r = r.shadowRoot); n <= o; ++n)
875
+ i[n] && (a = B(null, s, n, e), a && (i[n].$elm$ = a, r.insertBefore(a, ut(t))));
876
+ }, Qt = (e, t, s, i, n) => {
877
+ for (; t <= s; ++t)
878
+ (i = e[t]) && (n = i.$elm$, Zt(i), F = !0, n["s-ol"] ? n["s-ol"].remove() : D(n, !0), n.remove());
879
+ }, ls = (e, t, s, i) => {
880
+ let n = 0, o = 0, r = 0, a = 0, l = t.length - 1, c = t[0], h = t[l], d = i.length - 1, u = i[0], p = i[d], E, H;
881
+ for (; n <= l && o <= d; )
882
+ if (c == null)
883
+ c = t[++n];
884
+ else if (h == null)
885
+ h = t[--l];
886
+ else if (u == null)
887
+ u = i[++o];
888
+ else if (p == null)
889
+ p = i[--d];
890
+ else if (z(c, u))
891
+ T(c, u), c = t[++n], u = i[++o];
892
+ else if (z(h, p))
893
+ T(h, p), h = t[--l], p = i[--d];
894
+ else if (z(c, p))
895
+ (c.$tag$ === "slot" || p.$tag$ === "slot") && D(c.$elm$.parentNode, !1), T(c, p), e.insertBefore(c.$elm$, h.$elm$.nextSibling), c = t[++n], p = i[--d];
896
+ else if (z(h, u))
897
+ (c.$tag$ === "slot" || p.$tag$ === "slot") && D(h.$elm$.parentNode, !1), T(h, u), e.insertBefore(h.$elm$, c.$elm$), h = t[--l], u = i[++o];
898
+ else {
899
+ for (r = -1, a = n; a <= l; ++a)
900
+ if (t[a] && t[a].$key$ !== null && t[a].$key$ === u.$key$) {
901
+ r = a;
902
+ break;
903
+ }
904
+ r >= 0 ? (H = t[r], H.$tag$ !== u.$tag$ ? E = B(t && t[o], s, r, e) : (T(H, u), t[r] = void 0, E = H.$elm$), u = i[++o]) : (E = B(t && t[o], s, o, e), u = i[++o]), E && Xt(c.$elm$).insertBefore(E, ut(c.$elm$));
905
+ }
906
+ n > l ? Kt(e, i[d + 1] == null ? null : i[d + 1].$elm$, s, i, o, d) : o > d && Qt(t, n, l);
907
+ }, z = (e, t) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : e.$key$ === t.$key$ : !1, ut = (e) => e && e["s-ol"] || e, Xt = (e) => (e["s-ol"] ? e["s-ol"] : e).parentNode, T = (e, t) => {
908
+ const s = t.$elm$ = e.$elm$, i = e.$children$, n = t.$children$, o = t.$tag$, r = t.$text$;
909
+ let a;
910
+ r === null ? (v = o === "svg" ? !0 : o === "foreignObject" ? !1 : v, o === "slot" || Gt(e, t, v), i !== null && n !== null ? ls(s, i, t, n) : n !== null ? (e.$text$ !== null && (s.textContent = ""), Kt(s, null, t, n, 0, n.length - 1)) : i !== null && Qt(i, 0, i.length - 1), v && o === "svg" && (v = !1)) : (a = s["s-cr"]) ? a.parentNode.textContent = r : e.$text$ !== r && (s.data = r);
911
+ }, Yt = (e) => {
912
+ let t = e.childNodes, s, i, n, o, r, a;
913
+ for (i = 0, n = t.length; i < n; i++)
914
+ if (s = t[i], s.nodeType === 1) {
915
+ if (s["s-sr"]) {
916
+ for (r = s["s-sn"], s.hidden = !1, o = 0; o < n; o++)
917
+ if (a = t[o].nodeType, t[o]["s-hn"] !== s["s-hn"] || r !== "") {
918
+ if (a === 1 && r === t[o].getAttribute("slot")) {
919
+ s.hidden = !0;
920
+ break;
921
+ }
922
+ } else if (a === 1 || a === 3 && t[o].textContent.trim() !== "") {
923
+ s.hidden = !0;
924
+ break;
925
+ }
926
+ }
927
+ Yt(s);
928
+ }
929
+ }, m = [], Jt = (e) => {
930
+ let t, s, i, n, o, r, a = 0, l = e.childNodes, c = l.length;
931
+ for (; a < c; a++) {
932
+ if (t = l[a], t["s-sr"] && (s = t["s-cr"]) && s.parentNode)
933
+ for (i = s.parentNode.childNodes, n = t["s-sn"], r = i.length - 1; r >= 0; r--)
934
+ s = i[r], !s["s-cn"] && !s["s-nr"] && s["s-hn"] !== t["s-hn"] && (Pt(s, n) ? (o = m.find((h) => h.$nodeToRelocate$ === s), F = !0, s["s-sn"] = s["s-sn"] || n, o ? o.$slotRefNode$ = t : m.push({
935
+ $slotRefNode$: t,
936
+ $nodeToRelocate$: s
937
+ }), s["s-sr"] && m.map((h) => {
938
+ Pt(h.$nodeToRelocate$, s["s-sn"]) && (o = m.find((d) => d.$nodeToRelocate$ === s), o && !h.$slotRefNode$ && (h.$slotRefNode$ = o.$slotRefNode$));
939
+ })) : m.some((h) => h.$nodeToRelocate$ === s) || m.push({
940
+ $nodeToRelocate$: s
941
+ }));
942
+ t.nodeType === 1 && Jt(t);
943
+ }
944
+ }, Pt = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", Zt = (e) => {
945
+ e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(Zt);
946
+ }, cs = (e, t) => {
947
+ const s = e.$hostElement$, i = e.$cmpMeta$, n = e.$vnode$ || U(null, null), o = ns(t) ? t : O(null, null, t);
948
+ Y = s.tagName, i.$attrsToReflect$ && (o.$attrs$ = o.$attrs$ || {}, i.$attrsToReflect$.map(([r, a]) => o.$attrs$[a] = s[r])), o.$tag$ = null, o.$flags$ |= 4, e.$vnode$ = o, o.$elm$ = n.$elm$ = s.shadowRoot || s, S = s["s-sc"], Ft = s["s-cr"], Ut = (i.$flags$ & 1) !== 0, F = !1, T(n, o);
949
+ {
950
+ if (g.$flags$ |= 1, ct) {
951
+ Jt(o.$elm$);
952
+ let r, a, l, c, h, d, u = 0;
953
+ for (; u < m.length; u++)
954
+ r = m[u], a = r.$nodeToRelocate$, a["s-ol"] || (l = b.createTextNode(""), l["s-nr"] = a, a.parentNode.insertBefore(a["s-ol"] = l, a));
955
+ for (u = 0; u < m.length; u++)
956
+ if (r = m[u], a = r.$nodeToRelocate$, r.$slotRefNode$) {
957
+ for (c = r.$slotRefNode$.parentNode, h = r.$slotRefNode$.nextSibling, l = a["s-ol"]; l = l.previousSibling; )
958
+ if (d = l["s-nr"], d && d["s-sn"] === a["s-sn"] && c === d.parentNode && (d = d.nextSibling, !d || !d["s-nr"])) {
959
+ h = d;
960
+ break;
961
+ }
962
+ (!h && c !== a.parentNode || a.nextSibling !== h) && a !== h && (!a["s-hn"] && a["s-ol"] && (a["s-hn"] = a["s-ol"].parentNode.nodeName), c.insertBefore(a, h));
963
+ } else
964
+ a.nodeType === 1 && (a.hidden = !0);
965
+ }
966
+ F && Yt(o.$elm$), g.$flags$ &= -2, m.length = 0;
967
+ }
968
+ }, ds = (e) => e, hs = (e, t, s) => {
969
+ const i = ds(e);
970
+ return {
971
+ emit: (n) => us(i, t, {
972
+ bubbles: !!(s & 4),
973
+ composed: !!(s & 2),
974
+ cancelable: !!(s & 1),
975
+ detail: n
976
+ })
977
+ };
978
+ }, us = (e, t, s) => {
979
+ const i = g.ce(t, s);
980
+ return e.dispatchEvent(i), i;
981
+ }, fs = (e, t) => {
982
+ }, Vt = (e, t) => (e.$flags$ |= 16, fs(e, e.$ancestorComponent$), Ls(() => ps(e, t))), ps = (e, t) => {
983
+ const s = e.$hostElement$, i = _("scheduleUpdate", e.$cmpMeta$.$tagName$), n = s;
984
+ let o;
985
+ return t ? o = A(n, "componentWillLoad") : o = A(n, "componentWillUpdate"), o = Lt(o, () => A(n, "componentWillRender")), i(), Lt(o, () => $s(e, n, t));
986
+ }, $s = async (e, t, s) => {
987
+ const i = e.$hostElement$, n = _("update", e.$cmpMeta$.$tagName$);
988
+ i["s-rc"], s && Ve(e);
989
+ const o = _("render", e.$cmpMeta$.$tagName$);
990
+ gs(e, t, i), o(), n(), vs(e);
991
+ }, gs = (e, t, s) => {
992
+ try {
993
+ wt = t, t = t.render && t.render(), e.$flags$ &= -17, e.$flags$ |= 2, (C.hasRenderFn || C.reflect) && (C.vdomRender || C.reflect) && (C.hydrateServerSide || cs(e, t));
994
+ } catch (a) {
995
+ N(a, e.$hostElement$);
996
+ }
997
+ return wt = null, null;
998
+ }, vs = (e) => {
999
+ const t = e.$cmpMeta$.$tagName$, s = e.$hostElement$, i = _("postUpdate", t), n = s;
1000
+ e.$ancestorComponent$, A(n, "componentDidRender"), e.$flags$ & 64 ? (A(n, "componentDidUpdate"), i()) : (e.$flags$ |= 64, A(n, "componentDidLoad"), i());
1001
+ }, A = (e, t, s) => {
1002
+ if (e && e[t])
1003
+ try {
1004
+ return e[t](s);
1005
+ } catch (i) {
1006
+ N(i);
1007
+ }
1008
+ }, Lt = (e, t) => e && e.then ? e.then(t) : t(), ms = (e, t) => e != null && !dt(e) ? t & 4 ? e === "false" ? !1 : e === "" || !!e : t & 2 ? parseFloat(e) : t & 1 ? String(e) : e : e, bs = (e, t) => Z(e).$instanceValues$.get(t), ys = (e, t, s, i) => {
1009
+ const n = Z(e), o = e, r = n.$instanceValues$.get(t), a = n.$flags$, l = o;
1010
+ s = ms(s, i.$members$[t][0]);
1011
+ const c = Number.isNaN(r) && Number.isNaN(s);
1012
+ if (s !== r && !c) {
1013
+ n.$instanceValues$.set(t, s);
1014
+ {
1015
+ if (i.$watchers$ && a & 128) {
1016
+ const d = i.$watchers$[t];
1017
+ d && d.map((u) => {
1018
+ try {
1019
+ l[u](s, r, t);
1020
+ } catch (p) {
1021
+ N(p, o);
1022
+ }
1023
+ });
1024
+ }
1025
+ if ((a & 18) === 2) {
1026
+ if (l.componentShouldUpdate && l.componentShouldUpdate(s, r, t) === !1)
1027
+ return;
1028
+ Vt(n, !1);
1029
+ }
1030
+ }
1031
+ }
1032
+ }, xs = (e, t, s) => {
1033
+ if (t.$members$) {
1034
+ e.watchers && (t.$watchers$ = e.watchers);
1035
+ const i = Object.entries(t.$members$), n = e.prototype;
1036
+ i.map(([o, [r]]) => {
1037
+ (r & 31 || r & 32) && Object.defineProperty(n, o, {
1038
+ get() {
1039
+ return bs(this, o);
1040
+ },
1041
+ set(a) {
1042
+ ys(this, o, a, t);
1043
+ },
1044
+ configurable: !0,
1045
+ enumerable: !0
1046
+ });
1047
+ });
1048
+ {
1049
+ const o = /* @__PURE__ */ new Map();
1050
+ n.attributeChangedCallback = function(r, a, l) {
1051
+ g.jmp(() => {
1052
+ const c = o.get(r);
1053
+ if (this.hasOwnProperty(c))
1054
+ l = this[c], delete this[c];
1055
+ else if (n.hasOwnProperty(c) && typeof this[c] == "number" && this[c] == l)
1056
+ return;
1057
+ this[c] = l === null && typeof this[c] == "boolean" ? !1 : l;
1058
+ });
1059
+ }, e.observedAttributes = i.filter(
1060
+ ([r, a]) => a[0] & 15
1061
+ /* HasAttribute */
1062
+ ).map(([r, a]) => {
1063
+ const l = a[1] || r;
1064
+ return o.set(l, r), a[0] & 512 && t.$attrsToReflect$.push([r, l]), l;
1065
+ });
1066
+ }
1067
+ }
1068
+ return e;
1069
+ }, _s = async (e, t, s, i, n) => {
1070
+ if (!(t.$flags$ & 32) && (n = e.constructor, t.$flags$ |= 32, customElements.whenDefined(s.$tagName$).then(() => t.$flags$ |= 128), n.style)) {
1071
+ let r = n.style;
1072
+ typeof r != "string" && (r = r[t.$modeName$ = ts(e)]);
1073
+ const a = qt(s, t.$modeName$);
1074
+ if (!W.has(a)) {
1075
+ const l = _("registerStyles", s.$tagName$);
1076
+ Je(a, r, !!(s.$flags$ & 1)), l();
1077
+ }
1078
+ }
1079
+ t.$ancestorComponent$, (() => Vt(t, !0))();
1080
+ }, ws = (e) => {
1081
+ }, ks = (e) => {
1082
+ if (!(g.$flags$ & 1)) {
1083
+ const t = Z(e), s = t.$cmpMeta$, i = _("connectedCallback", s.$tagName$);
1084
+ t.$flags$ & 1 ? (Wt(e, t, s.$listeners$), ws(t.$lazyInstance$)) : (t.$flags$ |= 1, s.$flags$ & 12 && Cs(e), s.$members$ && Object.entries(s.$members$).map(([n, [o]]) => {
1085
+ if (o & 31 && e.hasOwnProperty(n)) {
1086
+ const r = e[n];
1087
+ delete e[n], e[n] = r;
1088
+ }
1089
+ }), _s(e, t, s)), i();
1090
+ }
1091
+ }, Cs = (e) => {
1092
+ const t = e["s-cr"] = b.createComment("");
1093
+ t["s-cn"] = !0, e.insertBefore(t, e.firstChild);
1094
+ }, Ss = (e) => {
1095
+ if (!(g.$flags$ & 1)) {
1096
+ const t = Z(e);
1097
+ t.$rmListeners$ && (t.$rmListeners$.map((s) => s()), t.$rmListeners$ = void 0);
1098
+ }
1099
+ }, te = (e, t) => {
1100
+ const s = {
1101
+ $flags$: t[0],
1102
+ $tagName$: t[1]
1103
+ };
1104
+ s.$members$ = t[2], s.$listeners$ = t[3], s.$watchers$ = e.$watchers$, s.$attrsToReflect$ = [];
1105
+ const i = e.prototype.connectedCallback, n = e.prototype.disconnectedCallback;
1106
+ return Object.assign(e.prototype, {
1107
+ __registerHost() {
1108
+ Ts(this, s);
1109
+ },
1110
+ connectedCallback() {
1111
+ ks(this), i && i.call(this);
1112
+ },
1113
+ disconnectedCallback() {
1114
+ Ss(this), n && n.call(this);
1115
+ },
1116
+ __attachShadow() {
1117
+ this.attachShadow({
1118
+ mode: "open",
1119
+ delegatesFocus: !!(s.$flags$ & 16)
1120
+ });
1121
+ }
1122
+ }), e.is = s.$tagName$, xs(e, s);
1123
+ }, ee = /* @__PURE__ */ new WeakMap(), Z = (e) => ee.get(e), Ts = (e, t) => {
1124
+ const s = {
1125
+ $flags$: 0,
1126
+ $hostElement$: e,
1127
+ $cmpMeta$: t,
1128
+ $instanceValues$: /* @__PURE__ */ new Map()
1129
+ };
1130
+ return Wt(e, s, t.$listeners$), ee.set(e, s);
1131
+ }, Et = (e, t) => t in e, N = (e, t) => (0, console.error)(e, t), W = /* @__PURE__ */ new Map(), Os = [], jt = [], se = [], As = (e, t) => (s) => {
1132
+ e.push(s), it || (it = !0, t && g.$flags$ & 4 ? Ps(nt) : g.raf(nt));
1133
+ }, Rt = (e) => {
1134
+ for (let t = 0; t < e.length; t++)
1135
+ try {
1136
+ e[t](performance.now());
1137
+ } catch (s) {
1138
+ N(s);
1139
+ }
1140
+ e.length = 0;
1141
+ }, nt = () => {
1142
+ Rt(jt), Rt(se), (it = jt.length > 0) && g.raf(nt);
1143
+ }, Ps = (e) => Ge().then(e), Ls = /* @__PURE__ */ As(se, !0), Es = (e = {}) => {
1144
+ const { content: t = "", title: s, attributes: i = [] } = e;
1145
+ let n = "", o = [
1146
+ { name: "xmlns", value: "http://www.w3.org/2000/svg" },
1147
+ { name: "fill", value: "currentColor" },
1148
+ ...i
1149
+ ];
1150
+ return s && (n = `<title>${s}</title>`), `<svg ${o.map((a) => `${a.name}="${a.value}"`).join(" ")}>${n}${t}</svg>`;
1151
+ }, js = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim();
1152
+ function Rs(e) {
1153
+ return `${e.getFullYear()}.${e.getMonth() + 1}`;
1154
+ }
1155
+ class Ds {
1156
+ constructor(t) {
1157
+ this.voca_component = t, this.voca_added = Rs(/* @__PURE__ */ new Date());
1158
+ }
1159
+ }
1160
+ const Is = "telia-vst{display:none}", Ns = /* @__PURE__ */ te(class extends Bt {
1161
+ constructor() {
1162
+ super(), this.__registerHost(), this.vocaInternalUStats = hs(this, "vocaInternalUStats", 7);
1163
+ }
1164
+ connectedCallback() {
1165
+ this.vocaInternalUStats.emit(new Ds(this.dataTrackingId));
1166
+ }
1167
+ render() {
1168
+ return O(ht, null);
1169
+ }
1170
+ static get style() {
1171
+ return Is;
1172
+ }
1173
+ }, [0, "telia-vst", {
1174
+ dataTrackingId: [1, "data-tracking-id"]
1175
+ }]);
1176
+ function ie() {
1177
+ if (typeof customElements > "u")
1178
+ return;
1179
+ ["telia-vst"].forEach((t) => {
1180
+ switch (t) {
1181
+ case "telia-vst":
1182
+ customElements.get(t) || customElements.define(t, Ns);
1183
+ break;
1184
+ }
1185
+ });
1186
+ }
1187
+ ie();
1188
+ function ot() {
1189
+ return typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : { vocadsIcons: void 0, vocadsIconsRegistered: !1 };
1190
+ }
1191
+ function Hs() {
1192
+ if (typeof ot().vocadsIcons !== void 0)
1193
+ return ot().vocadsIcons;
1194
+ }
1195
+ function zs() {
1196
+ return ot().vocadsIconsRegistered;
1197
+ }
1198
+ const Ms = ".telia-icon{display:inline-block}.telia-icon__container{display:block;height:inherit}.telia-icon svg{display:block}.telia-icon--sm{height:calc(1.6rem * var(--voca-rem-multiplier));min-width:calc(1.6rem * var(--voca-rem-multiplier));width:calc(1.6rem * var(--voca-rem-multiplier))}.telia-icon--md{height:calc(2.4rem * var(--voca-rem-multiplier));min-width:calc(2.4rem * var(--voca-rem-multiplier));width:calc(2.4rem * var(--voca-rem-multiplier))}.telia-icon--lg{height:calc(3.2rem * var(--voca-rem-multiplier));min-width:calc(3.2rem * var(--voca-rem-multiplier));width:calc(3.2rem * var(--voca-rem-multiplier))}", Fs = /* @__PURE__ */ te(class extends Bt {
1199
+ constructor() {
1200
+ super(), this.__registerHost(), this.size = "md", this.allyTitle = null, this.dataTrackingId = "telia-icon";
1201
+ }
1202
+ /**
1203
+ * Returns svg string from svg property or svg string from icons bundle if icons bundle is registered
1204
+ * @private
1205
+ * @returns string
1206
+ */
1207
+ getSvgString() {
1208
+ if (this.svg)
1209
+ return this.svg;
1210
+ if (zs() && this.name) {
1211
+ const e = Hs();
1212
+ return e[this.name] ? e[this.name].svg : "";
1213
+ }
1214
+ return this.name && console.warn(this.name, "Icons bundle is not registered and will not be rendered. Check if you have registered icons bundle or use svg property"), "";
1215
+ }
1216
+ render() {
1217
+ let e = this.getSvgString(), t = [{ name: "viewBox", value: "0 0 64 64" }];
1218
+ this.allyTitle ? t = [...t, { name: "role", value: "img" }] : t = [
1219
+ ...t,
1220
+ { name: "aria-hidden", value: "true" }
1221
+ ];
1222
+ const s = Es({
1223
+ content: js(e),
1224
+ attributes: t,
1225
+ title: this.allyTitle
1226
+ });
1227
+ return O(ht, { class: `telia-icon telia-icon--${this.size}` }, O("span", { "aria-label": this.allyTitle, class: "telia-icon__container", innerHTML: s }), O("telia-vst", { dataTrackingId: this.dataTrackingId }));
1228
+ }
1229
+ static get style() {
1230
+ return Ms;
1231
+ }
1232
+ }, [0, "telia-icon", {
1233
+ name: [1],
1234
+ svg: [1],
1235
+ size: [1],
1236
+ allyTitle: [1, "ally-title"],
1237
+ dataTestid: [1, "data-testid"]
1238
+ }]);
1239
+ function Us() {
1240
+ if (typeof customElements > "u")
1241
+ return;
1242
+ ["telia-icon", "telia-vst"].forEach((t) => {
1243
+ switch (t) {
1244
+ case "telia-icon":
1245
+ customElements.get(t) || customElements.define(t, Fs);
1246
+ break;
1247
+ case "telia-vst":
1248
+ customElements.get(t) || ie();
1249
+ break;
1250
+ }
1251
+ });
1252
+ }
1253
+ Us();
1254
+ var Bs = Object.defineProperty, Ws = Object.getOwnPropertyDescriptor, ne = (e, t, s, i) => {
1255
+ for (var n = i > 1 ? void 0 : i ? Ws(t, s) : t, o = e.length - 1, r; o >= 0; o--)
1256
+ (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
1257
+ return i && n && Bs(t, s, n), n;
1258
+ };
1259
+ let q = class extends P {
1260
+ _renderTimestamp(e, t) {
1261
+ if (!e && !t)
1262
+ return $;
1263
+ const s = (n) => new Date(n).toLocaleTimeString([], {
1264
+ hour: "2-digit",
1265
+ minute: "2-digit"
1266
+ });
1267
+ let i = "";
1268
+ return e ? t ? i = `${e}: ${s(t)}` : i = e : t && (i = s(t)), f`<p class="conversation-timestamp">${i}</p>`;
1269
+ }
1270
+ render() {
1271
+ var e, t;
1272
+ switch (this.message.type) {
1273
+ case V.System:
1274
+ return "";
1275
+ case V.Agent:
1276
+ return f`<div
1277
+ class=${Nt({
1278
+ "conversation-agent-message": !0,
1279
+ "has-avatar": !!((e = this.message.sender) != null && e.avatar)
1280
+ })}
1281
+ >
1282
+ ${(t = this.message.sender) != null && t.avatar ? f`<div class="avatar">
1283
+ <img src=${this.message.sender.avatar} />
1284
+ </div>` : $}
1285
+
1286
+ <div class="content-bundle">
1287
+ ${this.message.content.map(
1288
+ (s) => f`
1289
+ <div class="message-container">
1290
+ <div class="message-content">
1291
+ <conversation-component-message-list
1292
+ .items=${s.items || []}
1293
+ ></conversation-component-message-list>
1294
+ </div>
1295
+ </div>
1296
+ `
1297
+ )}
1298
+ </div>
1299
+ ${this._renderTimestamp(
1300
+ this.message.sender.name || "",
1301
+ this.message.timestamp
1302
+ )}
1303
+ </div>`;
1304
+ case V.User:
1305
+ return f`<div class="conversation-user-message">
1306
+ <div class="content-bundle">
1307
+ ${this.message.content.map(
1308
+ (s) => f`
1309
+ <div class="message-container">
1310
+ <div class="message-content">
1311
+ <conversation-component-message-list
1312
+ .items=${s.items || []}
1313
+ ></conversation-component-message-list>
1314
+ </div>
1315
+ </div>
1316
+ `
1317
+ )}
1318
+ </div>
1319
+ ${this._renderTimestamp(
1320
+ "",
1321
+ // TODO: properties.userLabel || ''
1322
+ this.message.timestamp
1323
+ )}
1324
+ </div>`;
1325
+ default:
1326
+ return $;
1327
+ }
1328
+ }
1329
+ };
1330
+ q.styles = w`
1331
+ :host {
1332
+ box-sizing: border-box;
1333
+ display: block;
1334
+ }
1335
+ * {
1336
+ box-sizing: border-box;
1337
+ }
1338
+ .message-content {
1339
+ padding: var(--spacing-md);
1340
+ display: inline-block;
1341
+ margin-top: var(--spacing-md);
1342
+ max-width: 100%;
1343
+ border: 1px solid var(--gray-color);
1344
+ border-radius: var(--border-radius);
1345
+ background-color: var(--bubble-bg-color);
1346
+ color: var(--bubble-text-color);
1347
+ }
1348
+
1349
+ .conversation-user-message {
1350
+ --bubble-bg-color: var(--conversation-user-bg-color);
1351
+ --bubble-text-color: var(--conversation-user-text-color);
1352
+ margin-left: 10%;
1353
+ width: 90%;
1354
+ display: flex;
1355
+ flex-direction: column;
1356
+ align-items: flex-end;
1357
+ }
1358
+
1359
+ .conversation-agent-message {
1360
+ --bubble-bg-color: var(--conversation-agent-bg-color);
1361
+ --bubble-text-color: var(--conversation-agent-text-color);
1362
+ display: grid;
1363
+ margin-right: 10%;
1364
+ width: 90%;
1365
+
1366
+ grid-template-columns: 1fr;
1367
+ grid-template-rows: 1fr auto;
1368
+ grid-template-areas:
1369
+ 'content'
1370
+ 'info';
1371
+ }
1372
+ .conversation-agent-message.has-avatar {
1373
+ grid-template-columns: auto 1fr;
1374
+ grid-template-rows: 1fr auto;
1375
+ grid-template-areas:
1376
+ 'avatar content'
1377
+ '. info';
1378
+ }
1379
+
1380
+ .avatar {
1381
+ grid-area: avatar;
1382
+ place-self: flex-end;
1383
+ width: 32px;
1384
+ height: 32px;
1385
+ border-radius: 50%;
1386
+ background-color: var(--accent-color);
1387
+ align-self: flex-end;
1388
+ justify-self: center;
1389
+ overflow: hidden;
1390
+ margin-right: var(--spacing-md);
1391
+ justify-content: center;
1392
+ align-items: center;
1393
+ }
1394
+ .avatar img {
1395
+ height: 100%;
1396
+ width: 100%;
1397
+ object-fit: cover;
1398
+ }
1399
+
1400
+ .conversation-timestamp {
1401
+ grid-area: info;
1402
+ margin: 0;
1403
+ line-height: 1.5em;
1404
+ grid-area: info;
1405
+ color: var(--text-color);
1406
+ font-size: 0.8rem;
1407
+ font-weight: 300;
1408
+ }
1409
+
1410
+ .content-bundle {
1411
+ grid-area: content;
1412
+ }
1413
+ `;
1414
+ ne([
1415
+ x()
1416
+ ], q.prototype, "message", 2);
1417
+ q = ne([
1418
+ L("conversation-component-message")
1419
+ ], q);
1420
+ var qs = Object.defineProperty, Gs = Object.getOwnPropertyDescriptor, oe = (e, t, s, i) => {
1421
+ for (var n = i > 1 ? void 0 : i ? Gs(t, s) : t, o = e.length - 1, r; o >= 0; o--)
1422
+ (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
1423
+ return i && n && qs(t, s, n), n;
1424
+ };
1425
+ let G = class extends P {
1426
+ constructor() {
1427
+ super(...arguments), this.items = [];
1428
+ }
1429
+ _isCustomComponent(e) {
1430
+ return !["html", "link-list"].includes(e);
1431
+ }
1432
+ _createCustomComponent(e, t) {
1433
+ const s = customElements.get(e);
1434
+ if (s) {
1435
+ const i = new s();
1436
+ return i.message = t, i;
1437
+ }
1438
+ return $;
1439
+ }
1440
+ render() {
1441
+ return f` <div class="message-list">
1442
+ ${this.items.map(
1443
+ ([e, t]) => f`
1444
+ ${e === "html" ? f`
1445
+ <message-type-html .message=${t}> </message-type-html>
1446
+ ` : $}
1447
+ ${e === "link-list" ? f`
1448
+ <message-type-link-list .message=${t}>
1449
+ </message-type-link-list>
1450
+ ` : $}
1451
+ ${e === "separator" ? f`
1452
+ <message-type-separator .message=${t}>
1453
+ </message-type-separator>
1454
+ ` : $}
1455
+ ${this._isCustomComponent(e) ? this._createCustomComponent(e, t) : $}
1456
+ `
1457
+ )}
1458
+ </div>`;
1459
+ }
1460
+ };
1461
+ G.styles = w`
1462
+ :host {
1463
+ box-sizing: border-box;
1464
+ display: block;
1465
+ }
1466
+ * {
1467
+ box-sizing: border-box;
1468
+ }
1469
+ .message-list {
1470
+ display: flex;
1471
+ flex-direction: column;
1472
+ gap: var(--spacing-md);
1473
+ }
1474
+ `;
1475
+ oe([
1476
+ x()
1477
+ ], G.prototype, "items", 2);
1478
+ G = oe([
1479
+ L("conversation-component-message-list")
1480
+ ], G);
1481
+ /**
1482
+ * @license
1483
+ * Copyright 2017 Google LLC
1484
+ * SPDX-License-Identifier: BSD-3-Clause
1485
+ */
1486
+ class rt extends It {
1487
+ constructor(t) {
1488
+ if (super(t), this.et = $, t.type !== at.CHILD)
1489
+ throw Error(this.constructor.directiveName + "() can only be used in child bindings");
1490
+ }
1491
+ render(t) {
1492
+ if (t === $ || t == null)
1493
+ return this.ft = void 0, this.et = t;
1494
+ if (t === pe)
1495
+ return t;
1496
+ if (typeof t != "string")
1497
+ throw Error(this.constructor.directiveName + "() called with a non-string value");
1498
+ if (t === this.et)
1499
+ return this.ft;
1500
+ this.et = t;
1501
+ const s = [t];
1502
+ return s.raw = s, this.ft = { _$litType$: this.constructor.resultType, strings: s, values: [] };
1503
+ }
1504
+ }
1505
+ rt.directiveName = "unsafeHTML", rt.resultType = 1;
1506
+ const Ks = lt(rt);
1507
+ var Qs = Object.defineProperty, Xs = Object.getOwnPropertyDescriptor, re = (e, t, s, i) => {
1508
+ for (var n = i > 1 ? void 0 : i ? Xs(t, s) : t, o = e.length - 1, r; o >= 0; o--)
1509
+ (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
1510
+ return i && n && Qs(t, s, n), n;
1511
+ };
1512
+ let K = class extends P {
1513
+ render() {
1514
+ return f`<div class="message-type-html">
1515
+ ${Ks(this.message.body)}
1516
+ </div>`;
1517
+ }
1518
+ };
1519
+ K.styles = [
1520
+ w`
1521
+ :host {
1522
+ box-sizing: border-box;
1523
+ }
1524
+ * {
1525
+ box-sizing: border-box;
1526
+ }
1527
+ p {
1528
+ margin: 0;
1529
+ padding: 0;
1530
+ word-break: break-word;
1531
+ }
1532
+ `
1533
+ ];
1534
+ re([
1535
+ x()
1536
+ ], K.prototype, "message", 2);
1537
+ K = re([
1538
+ L("message-type-html")
1539
+ ], K);
1540
+ var Ys = Object.defineProperty, Js = Object.getOwnPropertyDescriptor, ae = (e, t, s, i) => {
1541
+ for (var n = i > 1 ? void 0 : i ? Js(t, s) : t, o = e.length - 1, r; o >= 0; o--)
1542
+ (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
1543
+ return i && n && Ys(t, s, n), n;
1544
+ };
1545
+ let Q = class extends P {
1546
+ _onItemClick(e) {
1547
+ const t = new CustomEvent("action", {
1548
+ bubbles: !0,
1549
+ composed: !0,
1550
+ detail: {
1551
+ actionKey: "action",
1552
+ payload: e
1553
+ }
1554
+ });
1555
+ this.dispatchEvent(t);
1556
+ }
1557
+ render() {
1558
+ return f`
1559
+ <div class="message-type-link-list">
1560
+ ${this.message.header ? f`<h1>${this.message.header}</h1>` : $}
1561
+ <ul>
1562
+ ${this.message.actions.map(
1563
+ (e) => f`
1564
+ <li>
1565
+ <button @click=${() => this._onItemClick(e)}>
1566
+ ${e.label}
1567
+ </button>
1568
+ </li>
1569
+ `
1570
+ )}
1571
+ </ul>
1572
+ </div>
1573
+ `;
1574
+ }
1575
+ };
1576
+ Q.styles = [
1577
+ w`
1578
+ :host {
1579
+ box-sizing: border-box;
1580
+ }
1581
+ * {
1582
+ box-sizing: border-box;
1583
+ }
1584
+ h1 {
1585
+ font-size: 1.1rem;
1586
+ margin: 0 0 var(--spacing-sm);
1587
+ font-weight: normal;
1588
+ line-height: 1.8rem;
1589
+ color: var(--text-color);
1590
+ white-space: normal;
1591
+ }
1592
+ ul {
1593
+ list-style: none;
1594
+ margin: 0;
1595
+ padding: 0;
1596
+ }
1597
+ .message-type-link-list button {
1598
+ color: var(--primary-color);
1599
+ background-color: transparent;
1600
+ max-width: 100%;
1601
+ border: none;
1602
+ cursor: pointer;
1603
+ text-transform: none;
1604
+ font-weight: 300;
1605
+ font-size: inherit;
1606
+ text-align: left;
1607
+ display: block;
1608
+ margin: 0;
1609
+ padding: 0;
1610
+ }
1611
+ .message-type-link-list ul {
1612
+ display: flex;
1613
+ flex-direction: column;
1614
+ gap: var(--spacing-sm);
1615
+ }
1616
+ `
1617
+ ];
1618
+ ae([
1619
+ x()
1620
+ ], Q.prototype, "message", 2);
1621
+ Q = ae([
1622
+ L("message-type-link-list")
1623
+ ], Q);
1624
+ var Zs = Object.defineProperty, Vs = Object.getOwnPropertyDescriptor, le = (e, t, s, i) => {
1625
+ for (var n = i > 1 ? void 0 : i ? Vs(t, s) : t, o = e.length - 1, r; o >= 0; o--)
1626
+ (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
1627
+ return i && n && Zs(t, s, n), n;
1628
+ };
1629
+ let X = class extends P {
1630
+ render() {
1631
+ return f`<div class="message-type-separator"></div>`;
1632
+ }
1633
+ };
1634
+ X.styles = [
1635
+ w`
1636
+ :host {
1637
+ box-sizing: border-box;
1638
+ }
1639
+ * {
1640
+ box-sizing: border-box;
1641
+ }
1642
+ .message-type-separator {
1643
+ border-bottom: 1px solid var(--gray-color);
1644
+ width: 100%;
1645
+ }
1646
+ `
1647
+ ];
1648
+ le([
1649
+ x({ attribute: !1 })
1650
+ ], X.prototype, "message", 2);
1651
+ X = le([
1652
+ L("message-type-separator")
1653
+ ], X);
1654
+ const ti = (e) => {
1655
+ e.scrollTo ? e.scrollTo({ top: e.scrollHeight, behavior: "smooth" }) : e.scrollTop = e.scrollHeight;
1656
+ };
1657
+ var ei = Object.defineProperty, si = Object.getOwnPropertyDescriptor, ce = (e, t, s, i) => {
1658
+ for (var n = i > 1 ? void 0 : i ? si(t, s) : t, o = e.length - 1, r; o >= 0; o--)
1659
+ (r = e[o]) && (n = (i ? r(t, s, n) : r(n)) || n);
1660
+ return i && n && ei(t, s, n), n;
1661
+ };
1662
+ const de = je(P);
1663
+ let I = class extends de {
1664
+ constructor() {
1665
+ super(...arguments), this.message = "", this.conversationContentRef = He(), this.chatScrollHeight = 0;
1666
+ }
1667
+ async _onClick(e) {
1668
+ e.preventDefault(), console.log("Todo", this.message);
1669
+ }
1670
+ async _onSendMessage(e) {
1671
+ e.preventDefault(), await this.actions.dispatch("user-submit", { text: this.message }), this.message = "";
1672
+ }
1673
+ _inputHandler(e) {
1674
+ this.message = e.target.value;
1675
+ }
1676
+ _actionHandler(e) {
1677
+ this.actions.dispatch(e.detail.actionKey, e.detail.payload);
1678
+ }
1679
+ updated(e) {
1680
+ const t = this.conversationContentRef.value;
1681
+ t && setTimeout(() => {
1682
+ const s = t.scrollHeight;
1683
+ s > this.chatScrollHeight && (ti(t), this.chatScrollHeight = s);
1684
+ }, 1e3);
1685
+ }
1686
+ render() {
1687
+ return f` <div
1688
+ @action=${this._actionHandler}
1689
+ class=${Nt({
1690
+ conversation: !0,
1691
+ "input-has-text": this.message.length > 0
1692
+ })}
1693
+ >
1694
+ <div class="conversation-content" ${Me(this.conversationContentRef)}>
1695
+ <div class="conversation-content-inner">
1696
+ ${(this.properties.messages || []).map(
1697
+ (e) => f`<div class="conversation-entry" tabindex="-1">
1698
+ <conversation-component-message
1699
+ .message=${e}
1700
+ ${_t({
1701
+ keyframeOptions: {},
1702
+ in: mt,
1703
+ out: vt,
1704
+ stabilizeOut: !0,
1705
+ skipInitial: !1
1706
+ })}
1707
+ >
1708
+ </conversation-component-message>
1709
+ </div>`
1710
+ )}
1711
+ ${this.properties.loading ? f`<div
1712
+ class="loader"
1713
+ ${_t({
1714
+ in: mt,
1715
+ out: vt,
1716
+ skipInitial: !1
1717
+ })}
1718
+ >
1719
+ <div></div>
1720
+ <div></div>
1721
+ <div></div>
1722
+ </div>` : $}
1723
+ </div>
1724
+ </div>
1725
+ <form class="conversation-bottom" @submit=${this._onSendMessage}>
1726
+ <div class="conversation-bottom-left">
1727
+ <button class="circle" @click=${this._onClick} type="button">
1728
+ <telia-icon svg=${$e.svg} size="sm"></telia-icon>
1729
+ </button>
1730
+ </div>
1731
+ <input
1732
+ placeholder="Type your message here..."
1733
+ .value=${this.message}
1734
+ @input=${this._inputHandler}
1735
+ />
1736
+ <div class="conversation-actions">
1737
+ <button class="conversation-send-button" type="submit">
1738
+ <telia-icon svg=${ge.svg}></telia-icon>
1739
+ </button>
1740
+ </div>
1741
+ </form>
1742
+ </div>`;
1743
+ }
1744
+ };
1745
+ I.styles = [
1746
+ de.styles || [],
1747
+ w`
1748
+ :host {
1749
+ font-family: var(--font-family);
1750
+ --send-icon-color: var(--gray-dark-color, #a6a6a6);
1751
+ --conversation-bg: #fafafa;
1752
+ --conversation-agent-bg-color: var(--conversation-bg);
1753
+ --conversation-agent-text-color: var(-text-color);
1754
+ --conversation-user-bg-color: var(--primary-color);
1755
+ --conversation-user-text-color: white;
1756
+
1757
+ scrollbar-width: thin; /* Firefox */
1758
+ scrollbar-color: #7f7f7f transparent; /* Firefox */
1759
+ }
1760
+ ::-webkit-scrollbar {
1761
+ width: 3px !important;
1762
+ background-color: transparent;
1763
+ border-left: none;
1764
+ }
1765
+ ::-webkit-scrollbar-thumb {
1766
+ background-color: #7f7f7f;
1767
+ }
1768
+ ::-webkit-scrollbar-track {
1769
+ -webkit-box-shadow: none !important;
1770
+ background-color: transparent;
1771
+ }
1772
+
1773
+ .conversation {
1774
+ display: grid;
1775
+ grid-template-rows: 1fr auto;
1776
+ height: 100%;
1777
+ background-color: var(--conversation-bg);
1778
+ }
1779
+
1780
+ .conversation.input-has-text {
1781
+ --send-icon-color: var(--primary-color);
1782
+ }
1783
+
1784
+ .conversation-content {
1785
+ flex: 1;
1786
+
1787
+ padding: var(--spacing-md);
1788
+ overflow-y: auto;
1789
+ overflow-x: hidden;
1790
+ }
1791
+ .conversation-content-inner {
1792
+ display: flex;
1793
+ flex-direction: column;
1794
+ justify-content: end;
1795
+ min-height: 100%;
1796
+ }
1797
+ .conversation-bottom {
1798
+ border-top: 1px solid var(--gray-color);
1799
+ background-color: #fff;
1800
+ min-height: 50px;
1801
+ max-height: 150px;
1802
+ display: flex;
1803
+ align-items: center;
1804
+ padding: 0 var(--spacing-md);
1805
+ margin: 0;
1806
+ }
1807
+ .conversation-bottom-left {
1808
+ border-right: 1px solid var(--gray-color);
1809
+ padding-right: var(--spacing-md);
1810
+ }
1811
+ .circle {
1812
+ background-color: var(--gray-dark-color, #a6a6a6);
1813
+ border-radius: 50%;
1814
+ color: #fff;
1815
+ padding: var(--spacing-sm, 5px);
1816
+ border: none;
1817
+ display: flex;
1818
+ justify-content: center;
1819
+ align-items: center;
1820
+ }
1821
+ .conversation-send-button {
1822
+ border: none;
1823
+ background: transparent;
1824
+ cursor: pointer;
1825
+ color: var(--send-icon-color);
1826
+ }
1827
+ input {
1828
+ border: none;
1829
+ font-family: inherit;
1830
+ font-size: inherit;
1831
+ flex: 1;
1832
+ padding: 0 var(--spacing-md);
1833
+ height: 2.5rem;
1834
+ outline: none;
1835
+ }
1836
+
1837
+ @keyframes loaderanim {
1838
+ 0% {
1839
+ opacity: 0;
1840
+ }
1841
+ 75% {
1842
+ opacity: 1;
1843
+ }
1844
+ 100% {
1845
+ opacity: 0;
1846
+ }
1847
+ }
1848
+
1849
+ .loader {
1850
+ display: flex;
1851
+ justify-content: center;
1852
+ }
1853
+
1854
+ .loader > div {
1855
+ height: 10px;
1856
+ width: 10px;
1857
+ border-radius: 50%;
1858
+ margin: 5px;
1859
+ background-color: var(--text-color);
1860
+ animation-name: loaderanim;
1861
+ animation-duration: 1s;
1862
+ animation-iteration-count: infinite;
1863
+ }
1864
+
1865
+ .loader > div:nth-of-type(2) {
1866
+ animation-delay: 100ms;
1867
+ }
1868
+
1869
+ .loader > div:nth-of-type(3) {
1870
+ animation-delay: 200ms;
1871
+ }
1872
+ `
1873
+ ];
1874
+ ce([
1875
+ k()
1876
+ ], I.prototype, "message", 2);
1877
+ I = ce([
1878
+ L("ace-conversation")
1879
+ ], I);
1880
+ const hi = I;
1881
+ export {
1882
+ I as ConversationComponent,
1883
+ hi as default
1884
+ };