@telia-ace/widget-conversation 1.0.27 → 1.0.28

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 (46) hide show
  1. package/README.md +246 -106
  2. package/dist/{ui → components}/conversation/conversation.d.ts +0 -0
  3. package/dist/{ui/conversation/conversation-component.d.ts → components/conversation/plugin.d.ts} +13 -2
  4. package/dist/components/conversation/ui/content.d.ts +2 -0
  5. package/dist/{ui/conversation/conversation-input.d.ts → components/conversation/ui/input.d.ts} +0 -0
  6. package/dist/components/conversation/ui/loader.d.ts +9 -0
  7. package/dist/components/conversation/ui/message-list-items/button-list.d.ts +8 -0
  8. package/dist/components/conversation/ui/message-list-items/custom.d.ts +9 -0
  9. package/dist/components/conversation/ui/message-list-items/html.d.ts +5 -0
  10. package/dist/components/conversation/ui/message-list-items/link-list.d.ts +8 -0
  11. package/dist/components/conversation/ui/message-list-items/separator.d.ts +2 -0
  12. package/dist/components/conversation/ui/message-list-items/text.d.ts +6 -0
  13. package/dist/components/conversation/ui/message-list-items/video-request.d.ts +8 -0
  14. package/dist/{ui/conversation → components/conversation/ui}/message-types/agent.d.ts +1 -1
  15. package/dist/{ui/conversation → components/conversation/ui}/message-types/index.d.ts +0 -1
  16. package/dist/components/conversation/ui/message-types/message-list.d.ts +9 -0
  17. package/dist/{ui/conversation → components/conversation/ui}/message-types/system.d.ts +1 -1
  18. package/dist/{ui/conversation → components/conversation/ui}/message-types/timestamp.d.ts +0 -0
  19. package/dist/{ui/conversation → components/conversation/ui}/message-types/user.d.ts +0 -0
  20. package/dist/components/conversation/ui/message.d.ts +5 -0
  21. package/dist/components/conversation/ui/overlay-outlets.d.ts +13 -0
  22. package/dist/components/conversation/ui/styles.d.ts +31 -0
  23. package/dist/{ui/return-button/return-button-component.d.ts → components/return-button/plugin.d.ts} +1 -2
  24. package/dist/{ui → components}/return-button/return-button.d.ts +0 -0
  25. package/dist/conversation.d7aad569.js +1153 -0
  26. package/dist/conversation.d7aad569.js.map +1 -0
  27. package/dist/index.d.ts +2 -1
  28. package/dist/index.js +453 -341
  29. package/dist/index.js.map +1 -1
  30. package/dist/{return-button.8773c0de.js → return-button.9c517bbe.js} +11 -14
  31. package/dist/return-button.9c517bbe.js.map +1 -0
  32. package/dist/types.d.ts +34 -41
  33. package/dist/utils/map-actions.d.ts +1 -0
  34. package/dist/utils/open-chat-widget.d.ts +1 -1
  35. package/package.json +10 -9
  36. package/dist/conversation.70c6987f.js +0 -1101
  37. package/dist/conversation.70c6987f.js.map +0 -1
  38. package/dist/return-button.8773c0de.js.map +0 -1
  39. package/dist/ui/conversation/conversation-content.d.ts +0 -11
  40. package/dist/ui/conversation/conversation-loader.d.ts +0 -8
  41. package/dist/ui/conversation/conversation-message.d.ts +0 -7
  42. package/dist/ui/conversation/conversation-styles.d.ts +0 -11
  43. package/dist/ui/conversation/index.d.ts +0 -2
  44. package/dist/ui/conversation/message-types/custom.d.ts +0 -9
  45. package/dist/ui/index.d.ts +0 -2
  46. package/dist/ui/return-button/index.d.ts +0 -2
package/dist/index.js CHANGED
@@ -1,231 +1,271 @@
1
- var U = Object.defineProperty, F = Object.defineProperties;
2
- var _ = Object.getOwnPropertyDescriptors;
3
- var C = Object.getOwnPropertySymbols;
4
- var T = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
5
- var N = (i, t, e) => t in i ? U(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, p = (i, t) => {
6
- for (var e in t || (t = {}))
7
- T.call(t, e) && N(i, e, t[e]);
8
- if (C)
9
- for (var e of C(t))
10
- D.call(t, e) && N(i, e, t[e]);
11
- return i;
12
- }, g = (i, t) => F(i, _(t));
13
- var R = (i, t) => {
14
- var e = {};
15
- for (var s in i)
16
- T.call(i, s) && t.indexOf(s) < 0 && (e[s] = i[s]);
17
- if (i != null && C)
18
- for (var s of C(i))
19
- t.indexOf(s) < 0 && D.call(i, s) && (e[s] = i[s]);
20
- return e;
1
+ var L = Object.defineProperty, _ = Object.defineProperties;
2
+ var F = Object.getOwnPropertyDescriptors;
3
+ var P = Object.getOwnPropertySymbols;
4
+ var M = Object.prototype.hasOwnProperty, R = Object.prototype.propertyIsEnumerable;
5
+ var x = (r, e, t) => e in r ? L(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, v = (r, e) => {
6
+ for (var t in e || (e = {}))
7
+ M.call(e, t) && x(r, t, e[t]);
8
+ if (P)
9
+ for (var t of P(e))
10
+ R.call(e, t) && x(r, t, e[t]);
11
+ return r;
12
+ }, m = (r, e) => _(r, F(e));
13
+ var D = (r, e) => {
14
+ var t = {};
15
+ for (var s in r)
16
+ M.call(r, s) && e.indexOf(s) < 0 && (t[s] = r[s]);
17
+ if (r != null && P)
18
+ for (var s of P(r))
19
+ e.indexOf(s) < 0 && R.call(r, s) && (t[s] = r[s]);
20
+ return t;
21
21
  };
22
- var S = (i, t, e) => new Promise((s, r) => {
22
+ var d = (r, e, t) => (x(r, typeof e != "symbol" ? e + "" : e, t), t);
23
+ var A = (r, e, t) => new Promise((s, i) => {
23
24
  var n = (c) => {
24
25
  try {
25
- a(e.next(c));
26
+ a(t.next(c));
26
27
  } catch (h) {
27
- r(h);
28
+ i(h);
28
29
  }
29
30
  }, o = (c) => {
30
31
  try {
31
- a(e.throw(c));
32
+ a(t.throw(c));
32
33
  } catch (h) {
33
- r(h);
34
+ i(h);
34
35
  }
35
36
  }, a = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(n, o);
36
- a((e = e.apply(i, t)).next());
37
+ a((t = t.apply(r, e)).next());
37
38
  });
38
39
  import { ComponentPlatform as H } from "@telia-ace/widget-core";
39
- import { createStorageWriter as z, StorageCategory as $, StorageMedium as m, StorageScope as L, readStorage as A } from "@telia-ace/widget-services";
40
- import { uuid as j, lock as G } from "@telia-ace/widget-utilities";
40
+ import { createStorageWriter as $, StorageCategory as Q, StorageMedium as f, StorageScope as j, readStorage as S } from "@telia-ace/widget-services";
41
+ import { uuid as q, lock as G } from "@telia-ace/widget-utilities";
41
42
  import { FormBuilder as J } from "@telia-ace/widget-forms";
42
- import { closeAllModals as M } from "@telia-ace/widget-plugins";
43
- import { createReactComponent as Q } from "@telia-ace/widget-ui";
43
+ import { closeAllModals as O } from "@telia-ace/widget-plugins";
44
+ import { createReactComponent as U } from "@telia-ace/widget-ui";
44
45
  import { lazy as K } from "react";
45
46
  class V {
46
- constructor(t, e) {
47
- this.provider = t, this.print = (s) => {
48
- const r = { name: this.name, avatar: this.avatar }, n = x(s);
49
- return this.provider.createEntry(n.key, n.content, E.Agent, r, n.timestamp);
50
- }, this.typing = () => this.provider.setTypingState({ name: this.name, avatar: this.avatar }), this.name = e.name, this.avatar = e.avatar;
47
+ constructor(e, t) {
48
+ d(this, "name");
49
+ d(this, "avatar");
50
+ d(this, "print", (e) => {
51
+ const t = { name: this.name, avatar: this.avatar }, s = W(e);
52
+ return this.provider.createEntry(
53
+ s.key,
54
+ s.content,
55
+ k.Agent,
56
+ t,
57
+ s.timestamp
58
+ );
59
+ });
60
+ d(this, "typing", () => this.provider.setTypingState({ name: this.name, avatar: this.avatar }));
61
+ this.provider = e, this.name = t.name, this.avatar = t.avatar;
51
62
  }
52
- update(t) {
53
- const { name: e, avatar: s } = t;
54
- s === null ? this.avatar = void 0 : s && (this.avatar = s), e === null ? this.name = void 0 : e && (this.name = e);
63
+ update(e) {
64
+ const { name: t, avatar: s } = e;
65
+ s === null ? this.avatar = void 0 : s && (this.avatar = s), t === null ? this.name = void 0 : t && (this.name = t);
55
66
  }
56
67
  }
57
- class k {
58
- constructor(t, e, s) {
59
- this.name = t, this.container = e, this.controller = s, this.subscriptions = [], this.user = s == null ? void 0 : s.user;
68
+ class I {
69
+ constructor(e, t, s) {
70
+ d(this, "subscriptions", []);
71
+ d(this, "user");
72
+ this.name = e, this.container = t, this.controller = s, this.user = s == null ? void 0 : s.user;
60
73
  }
61
- static create(t, e, s) {
62
- return new k(t, e, s);
74
+ static create(e, t, s) {
75
+ return new I(e, t, s);
63
76
  }
64
- createAgent(t = {}) {
77
+ createAgent(e = {}) {
65
78
  if (this.controller)
66
- return new V(this, t);
79
+ return new V(this, e);
67
80
  }
68
- print(t) {
69
- var e;
70
- return (e = this.controller) == null ? void 0 : e.print(t);
81
+ print(e) {
82
+ var t;
83
+ return (t = this.controller) == null ? void 0 : t.print(e);
71
84
  }
72
- setTypingState(t, e) {
85
+ setTypingState(e, t) {
73
86
  var s;
74
- return (s = this.controller) == null ? void 0 : s.setTypingState(t, e);
87
+ return (s = this.controller) == null ? void 0 : s.setTypingState(e, t);
75
88
  }
76
89
  loading() {
77
90
  return this.controller ? this.controller.loader() : () => () => {
78
91
  };
79
92
  }
80
- createEntry(t, e, s, r, n) {
93
+ createEntry(e, t, s, i, n) {
81
94
  var o;
82
- return (o = this.controller) == null ? void 0 : o.createEntry(t, e, s, r, n);
95
+ return (o = this.controller) == null ? void 0 : o.createEntry(e, t, s, i, n);
83
96
  }
84
97
  dispose() {
85
- var t;
86
- process.env.NODE_ENV !== "production" && console.log(`conversation-provider: dispose (${this.name})`), (t = this.controller) == null || t.disposeProvider(this), this.controller = null, this.subscriptions.forEach((e) => e());
87
- }
88
- onUnreadMessage(t) {
89
98
  var e;
99
+ process.env.NODE_ENV !== "production" && console.log(`conversation-provider: dispose (${this.name})`), (e = this.controller) == null || e.disposeProvider(this), this.controller = null, this.subscriptions.forEach((t) => t());
100
+ }
101
+ onUnreadMessage(e) {
102
+ var t;
90
103
  if (this.controller) {
91
- const s = (e = this.controller) == null ? void 0 : e.onUnreadMessage(t);
104
+ const s = (t = this.controller) == null ? void 0 : t.onUnreadMessage(e);
92
105
  return this.subscriptions.push(s), () => {
93
106
  s();
94
107
  };
95
108
  }
96
109
  }
97
- onMounted(t) {
98
- var e;
110
+ onMounted(e) {
111
+ var t;
99
112
  if (this.controller) {
100
- const s = (e = this.controller) == null ? void 0 : e.events.subscribe("conversation:component-mount-changed", t);
101
- return this.subscriptions.push(s), t({}, this.controller.getComponentMountedState()), () => {
113
+ const s = (t = this.controller) == null ? void 0 : t.events.subscribe(
114
+ "conversation:component-mount-changed",
115
+ e
116
+ );
117
+ return this.subscriptions.push(s), e({}, this.controller.getComponentMountedState()), () => {
102
118
  s();
103
119
  };
104
120
  }
105
121
  }
106
122
  }
107
123
  class Y {
108
- constructor(t) {
109
- this.controller = t, this.print = (e) => {
110
- const s = x(e);
111
- return this.controller.createEntry(s.key, s.content, E.User, void 0, s.timestamp);
112
- };
124
+ constructor(e) {
125
+ d(this, "print", (e) => {
126
+ const t = W(e);
127
+ return this.controller.createEntry(
128
+ t.key,
129
+ t.content,
130
+ k.User,
131
+ void 0,
132
+ t.timestamp
133
+ );
134
+ });
135
+ this.controller = e;
113
136
  }
114
137
  }
115
- class q {
116
- constructor(t) {
117
- this.writer = t;
138
+ class X {
139
+ constructor(e) {
140
+ this.writer = e;
118
141
  }
119
- update(t) {
120
- const e = this.getNormalizedSettings(t);
121
- this.writer(e);
142
+ update(e) {
143
+ const t = this.getNormalizedSettings(e);
144
+ this.writer(t);
122
145
  }
123
146
  remove() {
124
147
  this.writer(null);
125
148
  }
126
- getNormalizedSettings(t) {
127
- return typeof t == "string" ? { body: t } : t.length > -1 && typeof t == "object" ? { items: t } : t;
149
+ getNormalizedSettings(e) {
150
+ return typeof e == "string" ? { body: e } : e.length > -1 && typeof e == "object" ? { items: e } : e;
128
151
  }
129
152
  }
130
- var E = /* @__PURE__ */ ((i) => (i.User = "user", i.Agent = "agent", i.System = "system", i))(E || {});
131
- const x = (i) => {
132
- let t, e = j(), s = Date.now();
133
- if (i.length > -1 && typeof i == "object")
134
- typeof i[0] == "string" ? t = { items: [i] } : t = { items: i };
135
- else if (typeof i == "string")
136
- t = { body: i };
137
- else if (i = i, i.type)
138
- t = p({}, i);
153
+ var k = /* @__PURE__ */ ((r) => (r.User = "user", r.Agent = "agent", r.System = "system", r))(k || {});
154
+ const W = (r) => {
155
+ let e, t = q(), s = Date.now();
156
+ if (Array.isArray(r) && r.length > -1)
157
+ typeof r[0] == "string" ? e = { items: [r] } : e = { items: r };
158
+ else if (typeof r == "string")
159
+ e = { body: r };
160
+ else if (r = r || {}, r.type)
161
+ e = v({}, r);
139
162
  else {
140
- if (t = {
141
- body: i.body,
142
- actions: i.actions,
143
- title: i.title
144
- }, i.key && (e = i.key), i.timestamp && (s = i.timestamp), i.form) {
145
- const r = J.create(e);
146
- i.form(r);
147
- const n = r.get();
148
- t.form = n;
163
+ if (e = {
164
+ body: r.body,
165
+ actions: r.actions,
166
+ title: r.title
167
+ }, r.key && (t = r.key), r.timestamp && (s = r.timestamp), r.form) {
168
+ const i = J.create(t);
169
+ r.form(i);
170
+ const n = i.get();
171
+ e.form = n;
149
172
  }
150
- i.timestamp === null && (s = null);
173
+ r.timestamp === null && (s = null);
151
174
  }
152
- return { content: t, key: e, timestamp: s };
153
- }, O = (i, t) => {
154
- if (!t)
175
+ return { content: e, key: t, timestamp: s };
176
+ }, B = (r, e) => {
177
+ if (!e)
155
178
  return;
156
- const e = JSON.stringify(t), s = i.findIndex((r) => e === JSON.stringify(r));
179
+ const t = JSON.stringify(e), s = r.findIndex((i) => t === JSON.stringify(i));
157
180
  if (s > -1)
158
- return i.splice(s, 1);
181
+ return r.splice(s, 1);
159
182
  };
160
- class X {
161
- constructor(t, e) {
162
- this.container = t, this.id = e, this.formHandlers = {}, this.user = new Y(this), this.providers = [], this.active = !1, this.registeredProviders = [], this.loaders = 0, this.componentMounted = !1, this.messages = [], this.typingActors = [], this.print = (r) => {
163
- const n = x(r);
164
- return this.createEntry(n.key, n.content, "system", void 0, n.timestamp);
165
- };
166
- const s = t.get("$widget");
183
+ class Z {
184
+ constructor(e, t) {
185
+ d(this, "formHandlers", {});
186
+ d(this, "user", new Y(this));
187
+ d(this, "events");
188
+ d(this, "providers", []);
189
+ d(this, "active", !1);
190
+ d(this, "registeredProviders", []);
191
+ d(this, "loaders", 0);
192
+ d(this, "componentMounted", !1);
193
+ d(this, "messages", []);
194
+ d(this, "typingActors", []);
195
+ d(this, "print", (e) => {
196
+ const t = W(e);
197
+ return this.createEntry(
198
+ t.key,
199
+ t.content,
200
+ "system",
201
+ void 0,
202
+ t.timestamp
203
+ );
204
+ });
205
+ this.container = e, this.id = t;
206
+ const s = e.get("$widget");
167
207
  this.events = s.events.createChild(this);
168
208
  }
169
- setProviders(t) {
170
- const e = [], s = [];
171
- this.providers.reduce((r, n) => (t.indexOf(n) === -1 && r.push(n), r), []).forEach((r) => {
172
- const n = this.providers.indexOf(r);
173
- n > -1 && (e.push(r), this.providers.splice(n, 1));
174
- }), t.forEach((r) => {
175
- this.providers.indexOf(r) === -1 && (s.push(r), this.providers.push(r));
176
- }), (s.length || e.length) && this.events.dispatch("conversation:providers-changed", { added: s, removed: e });
177
- }
178
- createProvider(t) {
179
- const e = this.providerIndex(t);
180
- if (e > -1)
181
- return this.registeredProviders[e];
182
- const s = k.create(t, this.container, this);
209
+ setProviders(e) {
210
+ const t = [], s = [];
211
+ this.providers.reduce((i, n) => (e.indexOf(n) === -1 && i.push(n), i), []).forEach((i) => {
212
+ const n = this.providers.indexOf(i);
213
+ n > -1 && (t.push(i), this.providers.splice(n, 1));
214
+ }), e.forEach((i) => {
215
+ this.providers.indexOf(i) === -1 && (s.push(i), this.providers.push(i));
216
+ }), (s.length || t.length) && this.events.dispatch("conversation:providers-changed", { added: s, removed: t });
217
+ }
218
+ createProvider(e) {
219
+ const t = this.providerIndex(e);
220
+ if (t > -1)
221
+ return this.registeredProviders[t];
222
+ const s = I.create(e, this.container, this);
183
223
  return this.registeredProviders.push(s), s;
184
224
  }
185
- providerIndex(t) {
186
- return this.registeredProviders.findIndex((e) => e.name === t);
225
+ providerIndex(e) {
226
+ return this.registeredProviders.findIndex((t) => t.name === e);
187
227
  }
188
228
  dispose() {
189
- this.registeredProviders.forEach((t) => t.dispose()), this.messages = [], this.events.dispatch("conversation:controller-disposed", this), this.active = !1;
229
+ this.registeredProviders.forEach((e) => e.dispose()), this.messages = [], this.events.dispatch("conversation:controller-disposed", this), this.active = !1;
190
230
  }
191
- onDispose(t) {
192
- return this.events.subscribe("conversation:controller-disposed", t);
231
+ onDispose(e) {
232
+ return this.events.subscribe("conversation:controller-disposed", e);
193
233
  }
194
- onStarted(t) {
195
- return this.events.subscribe("conversation:started", t);
234
+ onStarted(e) {
235
+ return this.events.subscribe("conversation:started", e);
196
236
  }
197
- disposeProvider(t) {
198
- const e = this.providerIndex(t.name);
199
- e > -1 && this.registeredProviders.splice(e, 1), this.events.dispatch("conversation:providers-changed", { removed: [t.name] }), this.registeredProviders.length || this.dispose();
237
+ disposeProvider(e) {
238
+ const t = this.providerIndex(e.name);
239
+ t > -1 && this.registeredProviders.splice(t, 1), this.events.dispatch("conversation:providers-changed", { removed: [e.name] }), this.registeredProviders.length || this.dispose();
200
240
  }
201
- onProvidersChange(t) {
202
- return this.events.subscribe("conversation:providers-changed", t);
241
+ onProvidersChange(e) {
242
+ return this.events.subscribe("conversation:providers-changed", e);
203
243
  }
204
- setComponentMountedState(t) {
205
- this.componentMounted !== t && (this.componentMounted = t, t && (this.events.dispatch("conversation:unread-message", !1), this.events.dispatch("conversation:started", !0), this.active = !0), this.events.dispatch("conversation:component-mount-changed", t));
244
+ setComponentMountedState(e) {
245
+ this.componentMounted !== e && (this.componentMounted = e, e && (this.events.dispatch("conversation:unread-message", !1), this.events.dispatch("conversation:started", !0), this.active = !0), this.events.dispatch("conversation:component-mount-changed", e));
206
246
  }
207
247
  getComponentMountedState() {
208
248
  return this.componentMounted;
209
249
  }
210
- onUnreadMessage(t) {
211
- return this.events.subscribe("conversation:unread-message", t);
250
+ onUnreadMessage(e) {
251
+ return this.events.subscribe("conversation:unread-message", e);
212
252
  }
213
- createEntry(t, e, s, r, n) {
253
+ createEntry(e, t, s, i, n) {
214
254
  const o = {
215
- key: t,
216
- content: e,
255
+ key: e,
256
+ content: t,
217
257
  type: s,
218
- sender: r || null,
258
+ sender: i || null,
219
259
  timestamp: n || n === null ? n : Date.now()
220
260
  };
221
- this.messages.push(o), o.type === "agent" && O(this.typingActors, r);
222
- const a = new q((c) => {
261
+ this.messages.push(o), o.type === "agent" && B(this.typingActors, i);
262
+ const a = new X((c) => {
223
263
  if (c !== null) {
224
- const h = c, { timestamp: d = void 0 } = h, f = R(h, ["timestamp"]);
225
- o.content = f, d && (o.timestamp = d);
264
+ const h = c, { timestamp: l = void 0 } = h, y = D(h, ["timestamp"]);
265
+ o.content = y, l && (o.timestamp = l);
226
266
  } else {
227
- const d = this.messages.indexOf(o);
228
- o.content = null, d > -1 && this.messages.splice(d, 1);
267
+ const l = this.messages.indexOf(o);
268
+ o.content = null, l > -1 && this.messages.splice(l, 1);
229
269
  }
230
270
  this.events.dispatch("conversation:message-updated", { message: o }), this.update();
231
271
  });
@@ -245,44 +285,44 @@ class X {
245
285
  typingActors: this.typingActors
246
286
  };
247
287
  }
248
- setTypingState(t, e) {
249
- return this.typingActors.indexOf(t) === -1 && (this.typingActors.push(t), this.update()), () => {
250
- O(this.typingActors, t), this.update();
288
+ setTypingState(e, t) {
289
+ return this.typingActors.indexOf(e) === -1 && (this.typingActors.push(e), this.update()), () => {
290
+ B(this.typingActors, e), this.update();
251
291
  };
252
292
  }
253
293
  loader() {
254
294
  this.loaders = this.loaders + 1;
255
- let t = !1;
295
+ let e = !1;
256
296
  return this.loaders === 1 && this.update(), () => {
257
- t || (t = !0, this.loaders = this.loaders - 1, this.loaders === 0 && this.update());
297
+ e || (e = !0, this.loaders = this.loaders - 1, this.loaders === 0 && this.update());
258
298
  };
259
299
  }
260
- submitForm(t, e) {
261
- this.formHandlers[t] = g(p({}, this.formHandlers[t]), { submit: e });
300
+ submitForm(e, t) {
301
+ this.formHandlers[e] = m(v({}, this.formHandlers[e]), { submit: t });
262
302
  }
263
- validateForm(t, e) {
264
- this.formHandlers[t] = g(p({}, this.formHandlers[t]), { validate: e });
303
+ validateForm(e, t) {
304
+ this.formHandlers[e] = m(v({}, this.formHandlers[e]), { validate: t });
265
305
  }
266
306
  }
267
- const Z = (i, t) => {
268
- const e = i.split("_contact");
269
- return t.widgets.get(e[0]);
270
- }, I = (i) => {
271
- const t = i.get("$widget"), { name: e, implementation: s } = i.get("$widget"), r = e.indexOf("_contact") > -1 ? Z(e, s) : t, { data: n } = i.get("$settings"), { trigger: o } = r.container.get("$settings"), a = `${e.replace("_contact-method", "").replace("_contact", "")}_contact-method`, c = s.widgets.get(a);
272
- return c && !o ? { chatWidget: c, mainWidget: r, data: n } : { mainWidget: r, data: n };
273
- }, tt = (i) => {
274
- const { chatWidget: t } = I(i);
275
- return !!t;
276
- }, B = (i, t, e) => {
277
- const { mainWidget: s, data: r, chatWidget: n } = I(i);
307
+ const ee = (r, e) => {
308
+ const t = r.split("_contact");
309
+ return e.widgets.get(t[0]);
310
+ }, T = (r) => {
311
+ const e = r.get("$widget"), { name: t, implementation: s } = r.get("$widget"), i = t.indexOf("_contact") > -1 ? ee(t, s) : e, { data: n } = r.get("$settings"), { trigger: o } = i.container.get("$settings"), a = `${t.replace("_contact-method", "").replace("_contact", "")}_contact-method`, c = s.widgets.get(a);
312
+ return c && !o ? { chatWidget: c, mainWidget: i, data: n } : { mainWidget: i, data: n };
313
+ }, te = (r) => {
314
+ const { chatWidget: e } = T(r);
315
+ return !!e;
316
+ }, z = (r, e, t) => {
317
+ const { mainWidget: s, data: i, chatWidget: n } = T(r);
278
318
  return n ? n.state === "activated" ? n.invoke("open").then(() => {
279
319
  n.container.getAsync("conversation").then((o) => {
280
- o.navigateToConversationIfActive(t.id).then(() => M(i));
320
+ o.navigateToConversationIfActive(e.id).then(() => O(r));
281
321
  });
282
322
  }) : n.activate().then(() => {
283
323
  const { trigger: o } = n.container.get("$settings");
284
324
  return o.action = "hide", n.invoke("setSettings", () => ({
285
- data: r,
325
+ data: i,
286
326
  trigger: o,
287
327
  activate: !0
288
328
  })).then(() => n.container.getAsync("components").then((a) => {
@@ -291,8 +331,8 @@ const Z = (i, t) => {
291
331
  key: "setContactMethodId",
292
332
  attributes: {
293
333
  properties: {
294
- id: t.id,
295
- guideId: t.guideId
334
+ id: e.id,
335
+ guideId: e.guideId
296
336
  }
297
337
  },
298
338
  target: c,
@@ -302,7 +342,7 @@ const Z = (i, t) => {
302
342
  a.write({
303
343
  key: "setConversationProvider",
304
344
  attributes: {
305
- properties: { providers: [t.clientName] }
345
+ properties: { providers: [e.clientName] }
306
346
  },
307
347
  target: h,
308
348
  provider: "localStorage"
@@ -310,250 +350,322 @@ const Z = (i, t) => {
310
350
  }));
311
351
  }).then(() => n.invoke("attach", {
312
352
  key: "contact-method",
313
- triggerDOMElement: e,
353
+ triggerDOMElement: t,
314
354
  withRenderState: "open"
315
- })).then(() => (z(n.container, "activeStickyWidget", $.Necessary, {
316
- medium: m.Local,
317
- scope: L.Implementation
318
- }).then((o) => o(n.name)), n.container.getAsync("conversation").then((o) => {
319
- o.setConversationEndedBehavior(P.Deactivate);
320
- }).then(() => M(i)).then(() => !1))) : (s.container.getAsync("conversation").then((o) => o.navigateToConversationIfActive(t.id).then(() => o.setConversationEndedBehavior(P.Navigate))), !n);
321
- }, et = (i, t, e = "conversation") => {
322
- const { mainWidget: s, chatWidget: r } = I(i);
323
- return r ? r.container.getAsync("router").then((n) => {
324
- n.navigate(e, { id: t.id });
355
+ })).then(() => ($(
356
+ n.container,
357
+ "activeStickyWidget",
358
+ Q.Necessary,
359
+ {
360
+ medium: f.Local,
361
+ scope: j.Implementation
362
+ }
363
+ ).then((o) => o(n.name)), n.container.getAsync("conversation").then((o) => {
364
+ o.setConversationEndedBehavior(E.Deactivate);
365
+ }).then(() => O(r)).then(() => !1))) : (s.container.getAsync("conversation").then((o) => o.navigateToConversationIfActive(e.id).then(() => o.setConversationEndedBehavior(E.Navigate))), !n);
366
+ }, se = (r, e, t = "conversation") => {
367
+ const { mainWidget: s, chatWidget: i } = T(r);
368
+ return i ? i.container.getAsync("router").then((n) => {
369
+ n.navigate(t, { id: e.id });
325
370
  }) : s.container.getAsync("conversation").then((n) => {
326
371
  var o;
327
- (o = n.setConversationEndedBehavior(P.Navigate)) == null || o.then(() => {
372
+ (o = n.setConversationEndedBehavior(E.Navigate)) == null || o.then(() => {
328
373
  s.container.getAsync("router").then((a) => {
329
374
  s.container.getAsync("components").then((c) => {
330
375
  const h = c.components().ofType("conversation");
331
376
  c.write({
332
377
  key: "setConversationProvider",
333
- attributes: { properties: { providers: [t.clientName] } },
378
+ attributes: { properties: { providers: [e.clientName] } },
334
379
  target: h,
335
380
  provider: "localStorage"
336
381
  });
337
382
  }).then(() => {
338
- a.navigate(e, { id: t.id });
383
+ a.navigate(t, { id: e.id });
339
384
  });
340
385
  });
341
386
  });
342
387
  });
343
- }, y = "conversations";
344
- var P = /* @__PURE__ */ ((i) => (i.Deactivate = "deactivate", i.Navigate = "navigate", i.None = "none", i))(P || {});
345
- class b {
346
- constructor(t, e) {
347
- this.container = t, this.components = e, this.controllers = [], this.providers = [], this.disposeProviders = {}, this.subscriptions = [], this.storageWriter = null, this.router = null, this.buttonQuery = null, this.sessionInfo = null;
348
- const s = t.get("$widget");
388
+ }, b = "conversations";
389
+ var E = /* @__PURE__ */ ((r) => (r.Deactivate = "deactivate", r.Navigate = "navigate", r.None = "none", r))(E || {});
390
+ class w {
391
+ constructor(e, t) {
392
+ d(this, "events");
393
+ d(this, "controllers", []);
394
+ d(this, "providers", []);
395
+ d(this, "disposeProviders", {});
396
+ d(this, "subscriptions", []);
397
+ d(this, "storageWriter", null);
398
+ d(this, "router", null);
399
+ d(this, "buttonQuery", null);
400
+ d(this, "sessionInfo", null);
401
+ this.container = e, this.components = t;
402
+ const s = e.get("$widget");
349
403
  this.events = s.events.createChild(this);
350
404
  }
351
405
  initialize() {
352
- z(this.container, y, $.Necessary, {
353
- medium: m.Local
354
- }).then((t) => this.storageWriter = t), A(this.container, y, m.Local).then((t) => {
355
- this.buttonQuery = this.components.components().ofType("conversation-return-button"), t && (this.sessionInfo = t, t.id && t.route && this.writeToComponents({ active: !0, alert: { show: !1 } }));
356
- }), this.container.getAsync("router").then((t) => this.router = t), this.events.subscribe("conversation:ended", (t, e) => {
357
- var s, r, n;
406
+ $(this.container, b, Q.Necessary, {
407
+ medium: f.Local
408
+ }).then((e) => this.storageWriter = e), S(this.container, b, f.Local).then(
409
+ (e) => {
410
+ this.buttonQuery = this.components.components().ofType("conversation-return-button"), e && (this.sessionInfo = e, e.id && e.route && this.writeToComponents({ active: !0, alert: { show: !1 } }));
411
+ }
412
+ ), this.container.getAsync("router").then((e) => this.router = e), this.events.subscribe("conversation:ended", (e, t) => {
413
+ var s, i, n;
358
414
  switch ((s = this.sessionInfo) == null ? void 0 : s.conversationEndedBehavior) {
359
415
  case "deactivate":
360
416
  this.container.get("$widget").deactivate();
361
417
  break;
362
418
  case "navigate":
363
- const a = (r = this.router) == null ? void 0 : r.getInitialRoute();
419
+ const a = (i = this.router) == null ? void 0 : i.getInitialRoute();
364
420
  a && ((n = this.router) == null || n.navigate(a.name));
365
421
  break;
366
422
  }
367
423
  this.writeToComponents({ active: !1 }), this.sessionInfo = null, this.storageWriter && this.storageWriter();
368
424
  });
369
425
  }
370
- addSubscription(t) {
371
- this.subscriptions.push(t);
426
+ addSubscription(e) {
427
+ this.subscriptions.push(e);
372
428
  }
373
- static getInstance(t, e = "conversation") {
374
- return G(t)(() => t.getAsync(e).then((s) => {
375
- let r = s;
376
- return r || H.getInstance(t).then((n) => (r = new b(t, n), r.initialize(), t.registerAsync(e, () => r), r));
429
+ static getInstance(e, t = "conversation") {
430
+ return G(e)(() => e.getAsync(t).then((s) => {
431
+ let i = s;
432
+ return i || H.getInstance(e).then((n) => (i = new w(e, n), i.initialize(), e.registerAsync(t, () => i), i));
377
433
  }));
378
434
  }
379
- navigateToConversationIfActive(t) {
380
- return A(this.container, y, m.Local).then((e) => {
381
- var s;
382
- if (e && e.id === t && e.route) {
383
- const { name: r, params: n } = e.route;
384
- (s = this.router) == null || s.navigate(r, n);
435
+ navigateToConversationIfActive(e) {
436
+ return S(this.container, b, f.Local).then(
437
+ (t) => {
438
+ var s;
439
+ if (t && t.id === e && t.route) {
440
+ const { name: i, params: n } = t.route;
441
+ (s = this.router) == null || s.navigate(i, n);
442
+ }
385
443
  }
386
- });
444
+ );
387
445
  }
388
- setConversationEndedBehavior(t) {
389
- return A(this.container, y, m.Local).then((e) => {
390
- let s = e;
391
- return s ? s.conversationEndedBehavior = t : s = { conversationEndedBehavior: t }, this.sessionInfo = s, this.storageWriter && this.storageWriter(this.sessionInfo) || Promise.resolve();
392
- });
446
+ setConversationEndedBehavior(e) {
447
+ return S(this.container, b, f.Local).then(
448
+ (t) => {
449
+ let s = t;
450
+ return s ? s.conversationEndedBehavior = e : s = { conversationEndedBehavior: e }, this.sessionInfo = s, this.storageWriter && this.storageWriter(this.sessionInfo) || Promise.resolve();
451
+ }
452
+ );
393
453
  }
394
- createController(t) {
395
- const e = this.controllers.findIndex((s) => s.conversation.id === t);
396
- return e > -1 ? this.controllers[e].conversation : new X(this.container, t);
454
+ createController(e) {
455
+ const t = this.controllers.findIndex((s) => s.conversation.id === e);
456
+ return t > -1 ? this.controllers[t].conversation : new Z(this.container, e);
397
457
  }
398
- registerProvider(t, e) {
458
+ registerProvider(e, t) {
399
459
  const s = {
400
- name: t,
401
- handler: e
460
+ name: e,
461
+ handler: t
402
462
  };
403
- this.providers.push(s), this.controllers.filter((r) => r.conversation.providers.indexOf(t) > -1).forEach((r) => {
404
- this.invokeHandler(s, r);
463
+ this.providers.push(s), this.controllers.filter((i) => i.conversation.providers.indexOf(e) > -1).forEach((i) => {
464
+ this.invokeHandler(s, i);
405
465
  });
406
466
  }
407
- registerController(t, e) {
408
- const s = this.controllers.findIndex((n) => n.conversation.id === t.id);
409
- let r;
467
+ registerController(e, t) {
468
+ const s = this.controllers.findIndex((n) => n.conversation.id === e.id);
469
+ let i;
410
470
  if (s < 0) {
411
- r = { conversation: t, component: e }, this.controllers.push(r);
471
+ i = { conversation: e, component: t }, this.controllers.push(i);
412
472
  const n = (o) => {
413
473
  o && this.providers.filter((a) => o.indexOf(a.name) > -1).forEach((a) => {
414
- this.invokeHandler(a, r);
474
+ this.invokeHandler(a, i);
415
475
  });
416
476
  };
417
- return this.subscriptions.push(t.onDispose((o, a) => {
418
- const c = this.controllers.findIndex((h) => h.conversation === a);
419
- c > -1 && this.controllers.splice(c, 1), this.components.components().ofType("conversation-return-button").select().writeProperties({ active: !1 }), this.events.dispatch("conversation:ended", {}, { bubbles: !0 });
420
- })), this.subscriptions.push(t.onProvidersChange((o, a) => {
421
- const { added: c, removed: h } = a;
422
- h.forEach((d) => {
423
- this.disposeProviders[d].forEach((f) => {
424
- f();
425
- });
426
- }), n(c);
427
- })), this.subscriptions.push(t.onStarted((o, a) => {
428
- var h, d;
429
- const c = {
430
- id: t.id,
431
- route: (h = this.router) == null ? void 0 : h.getRouteData(),
432
- conversationEndedBehavior: (d = this.sessionInfo) == null ? void 0 : d.conversationEndedBehavior
433
- };
434
- this.sessionInfo = c, this.storageWriter && this.storageWriter(c), this.writeToComponents({ active: a });
435
- })), this.subscriptions.push(t.onUnreadMessage((o, a) => {
436
- this.events.dispatch("conversation:unread-message", a), this.writeToComponents({ alert: { show: a } });
437
- })), n(t.providers), !0;
477
+ return this.subscriptions.push(
478
+ e.onDispose((o, a) => {
479
+ const c = this.controllers.findIndex((h) => h.conversation === a);
480
+ c > -1 && this.controllers.splice(c, 1), this.components.components().ofType("conversation-return-button").select().writeProperties({ active: !1 }), this.events.dispatch("conversation:ended", {}, { bubbles: !0 });
481
+ })
482
+ ), this.subscriptions.push(
483
+ e.onProvidersChange((o, a) => {
484
+ const { added: c, removed: h } = a;
485
+ h.forEach((l) => {
486
+ this.disposeProviders[l].forEach((y) => {
487
+ y();
488
+ });
489
+ }), n(c);
490
+ })
491
+ ), this.subscriptions.push(
492
+ e.onStarted((o, a) => {
493
+ var h, l;
494
+ const c = {
495
+ id: e.id,
496
+ route: (h = this.router) == null ? void 0 : h.getRouteData(),
497
+ conversationEndedBehavior: (l = this.sessionInfo) == null ? void 0 : l.conversationEndedBehavior
498
+ };
499
+ this.sessionInfo = c, this.storageWriter && this.storageWriter(c), this.writeToComponents({ active: a });
500
+ })
501
+ ), this.subscriptions.push(
502
+ e.onUnreadMessage((o, a) => {
503
+ this.events.dispatch("conversation:unread-message", a), this.writeToComponents({ alert: { show: a } });
504
+ })
505
+ ), n(e.providers), !0;
438
506
  }
439
- return r = this.controllers[s], !1;
507
+ return i = this.controllers[s], !1;
440
508
  }
441
- writeToComponents(t, e = "conversationReturnButtonState") {
509
+ writeToComponents(e, t = "conversationReturnButtonState") {
442
510
  this.buttonQuery && this.components.write({
443
511
  key: "conversationReturnButtonState",
444
- attributes: { properties: t },
512
+ attributes: { properties: e },
445
513
  target: this.buttonQuery,
446
514
  provider: "localStorage"
447
515
  });
448
516
  }
449
- invokeHandler(t, e) {
450
- const s = t.handler(e.conversation.createProvider(t.name), e.component);
451
- s && (this.disposeProviders[t.name] || (this.disposeProviders[t.name] = []), this.disposeProviders[t.name].push(s));
517
+ invokeHandler(e, t) {
518
+ const s = e.handler(
519
+ t.conversation.createProvider(e.name),
520
+ t.component
521
+ );
522
+ s && (this.disposeProviders[e.name] || (this.disposeProviders[e.name] = []), this.disposeProviders[e.name].push(s));
452
523
  }
453
524
  getComponentRoute() {
454
- return A(this.container, y, m.Local).then((t) => t == null ? void 0 : t.route);
525
+ return S(this.container, b, f.Local).then(
526
+ (e) => e == null ? void 0 : e.route
527
+ );
455
528
  }
456
529
  dispose() {
457
- Object.keys(this.disposeProviders).forEach((t) => {
458
- this.disposeProviders[t].forEach((e) => {
459
- e();
530
+ Object.keys(this.disposeProviders).forEach((e) => {
531
+ this.disposeProviders[e].forEach((t) => {
532
+ t();
460
533
  });
461
- }), this.subscriptions.forEach((t) => {
462
- t();
534
+ }), this.subscriptions.forEach((e) => {
535
+ e();
463
536
  }), this.controllers = [], this.providers = [];
464
537
  }
465
- static handleContactMethodClick(t, e, s, r) {
466
- return S(this, null, function* () {
467
- if (tt(e)) {
468
- t.preventDefault();
538
+ static handleContactMethodClick(e, t, s, i) {
539
+ return A(this, null, function* () {
540
+ if (te(t)) {
541
+ e.preventDefault();
469
542
  let n = document.getElementById("humany-dynamic-anchor");
470
- n || (n = document.createElement("a"), n.setAttribute("href", "#"), n.id = "humany-dynamic-anchor", document.body.appendChild(n)), B(e, s, n);
543
+ n || (n = document.createElement("a"), n.setAttribute("href", "#"), n.id = "humany-dynamic-anchor", document.body.appendChild(n)), z(t, s, n);
471
544
  }
472
- B(e, s);
545
+ z(t, s);
473
546
  });
474
547
  }
475
- static handleContactMethodSubmit(t, e) {
476
- return S(this, null, function* () {
477
- return et(t, e);
548
+ static handleContactMethodSubmit(e, t) {
549
+ return A(this, null, function* () {
550
+ return se(e, t);
478
551
  });
479
552
  }
480
553
  }
481
- var st = /* @__PURE__ */ ((i) => (i.Header = "header", i.LinkList = "link-list", i.Separator = "separator", i.NoGoodAlternative = "no-good-alternative", i.ButtonList = "button-list", i.Text = "text", i.HTML = "html", i.FeedbackList = "feedback-list", i))(st || {});
482
- const it = (i, t) => i.reduce((e, s, r) => {
554
+ const re = (r, e) => r.reduce((t, s, i) => {
483
555
  var o, a;
484
- const n = g(p({}, s), {
485
- content: [g(p({}, s.content), { key: s.key })]
556
+ const n = m(v({}, s), {
557
+ content: [m(v({}, s.content), { key: s.key })]
486
558
  });
487
- if (e.length > 0 && s.type !== E.System) {
488
- const c = e[e.length - 1];
489
- if ((!t && t !== 0 || Math.abs(c.timestamp - s.timestamp) < t) && ((o = c.sender) == null ? void 0 : o.name) === ((a = s.sender) == null ? void 0 : a.name) && c.type === s.type)
490
- return c.timestamp = s.timestamp, c.content.push(g(p({}, s.content), { key: s.key })), e;
491
- }
492
- return e.push(n), e;
493
- }, []), lt = (i) => Promise.all([
494
- b.getInstance(i),
495
- i.getAsync("router")
496
- ]).then(([t, e]) => Q(i, "conversation", import("./conversation.70c6987f.js"), (s) => {
497
- const n = e.getRouteData().params.id || s.node.name || "component", o = t.createController(n), a = t.registerController(o, s), c = 3 * 60 * 1e3, h = (l) => {
498
- const { providers: u = [] } = l;
499
- if (u) {
500
- const v = Array.isArray(u) ? u : [u];
501
- return o.setProviders(v), v;
502
- }
503
- };
504
- h(s.properties(h)), o.setComponentMountedState(!0);
505
- const d = (l) => {
506
- const { loading: u, typingActors: v, messages: w } = l;
507
- s.writeProperties({
508
- loading: u,
509
- typingActors: v,
510
- messages: it(w, c)
511
- });
512
- };
513
- d(o.getMessageStream()), a && (s.actions.create("user-submit", (l, u) => {
514
- if (u) {
515
- const { preventDefault: v, validationPromise: w } = u;
516
- if (v) {
517
- w && w().then((W) => {
518
- W && o.user.print(W);
519
- });
520
- return;
559
+ if (t.length > 0 && s.type !== k.System) {
560
+ const c = t[t.length - 1];
561
+ if ((!e && e !== 0 || Math.abs(c.timestamp - s.timestamp) < e) && ((o = c.sender) == null ? void 0 : o.name) === ((a = s.sender) == null ? void 0 : a.name) && c.type === s.type)
562
+ return c.timestamp = s.timestamp, c.content.push(m(v({}, s.content), { key: s.key })), t;
563
+ }
564
+ return t.push(n), t;
565
+ }, []), pe = (r) => Promise.all([
566
+ w.getInstance(r),
567
+ r.getAsync("router")
568
+ ]).then(([e, t]) => U(
569
+ r,
570
+ "conversation",
571
+ import("./conversation.d7aad569.js"),
572
+ (s) => {
573
+ const n = t.getRouteData().params.id || s.node.name || "component", o = e.createController(n), a = e.registerController(o, s), c = 3 * 60 * 1e3, h = (p) => {
574
+ const { providers: u = [] } = p;
575
+ if (u) {
576
+ const g = Array.isArray(u) ? u : [u];
577
+ return o.setProviders(g), g;
521
578
  }
579
+ };
580
+ h(s.properties(h)), o.setComponentMountedState(!0);
581
+ const l = (p) => {
582
+ const { loading: u, typingActors: g, messages: C } = p;
583
+ s.writeProperties({
584
+ loading: u,
585
+ typingActors: g,
586
+ messages: re(C, c)
587
+ });
588
+ };
589
+ l(o.getMessageStream()), a && (s.actions.create("user-submit", (p, u) => {
590
+ if (u) {
591
+ const { preventDefault: g, validationPromise: C } = u;
592
+ if (g) {
593
+ C && C().then((N) => {
594
+ N && o.user.print(N);
595
+ });
596
+ return;
597
+ }
598
+ }
599
+ o.user.print(p.text);
600
+ }), s.actions.create("user-typing", (p, u) => {
601
+ }), s.actions.create("form", (p, u) => {
602
+ }), s.actions.create("action", (p, u) => {
603
+ }), s.actions.create("overlay-mounted", (p, u) => {
604
+ }), s.actions.create("show-overlay", (p, u) => {
605
+ s.writeProperties({
606
+ overlay: { conversation: !1, secondary: !1 }
607
+ });
608
+ }), s.actions.create("hide-overlay", (p, u) => {
609
+ s.writeProperties({
610
+ overlay: null
611
+ });
612
+ }), s.actions.create("show-overlay-conversation", (p, u) => {
613
+ s.writeProperties({
614
+ overlay: { conversation: !0, secondary: !1 }
615
+ });
616
+ }), s.actions.create("hide-overlay-conversation", (p, u) => {
617
+ s.writeProperties({
618
+ overlay: { conversation: !1, secondary: !1 }
619
+ });
620
+ }));
621
+ const y = o.events.subscribe(
622
+ "conversation:updated",
623
+ (p, u) => {
624
+ l(u);
625
+ }
626
+ );
627
+ return () => {
628
+ o.setComponentMountedState(!1), y(), o.active || l({ messages: [], typingActors: [], loading: !1 });
629
+ };
630
+ },
631
+ { reuseController: !0 }
632
+ )), ve = (r) => Promise.all([
633
+ H.getInstance(r),
634
+ w.getInstance(r),
635
+ r.getAsync("router")
636
+ ]).then(
637
+ ([e, t, s]) => U(
638
+ r,
639
+ "conversation-return-button",
640
+ import("./return-button.9c517bbe.js"),
641
+ (i) => {
642
+ i.actions.create("toggle", (n = {}) => {
643
+ var o;
644
+ (o = t.getComponentRoute()) == null || o.then((a) => {
645
+ a && s.navigate(a.name, a.params);
646
+ });
647
+ });
522
648
  }
523
- o.user.print(l.text);
524
- }), s.actions.create("user-typing", (l, u) => {
525
- }), s.actions.create("form", (l, u) => {
526
- }), s.actions.create("action", (l, u) => {
527
- }));
528
- const f = o.events.subscribe("conversation:updated", (l, u) => {
529
- d(u);
530
- });
531
- return () => {
532
- o.setComponentMountedState(!1), f(), o.active || d({ messages: [], typingActors: [], loading: !1 });
533
- };
534
- }, { reuseController: !0 })), pt = (i) => Promise.all([
535
- H.getInstance(i),
536
- b.getInstance(i),
537
- i.getAsync("router")
538
- ]).then(([t, e, s]) => Q(i, "conversation-return-button", import("./return-button.8773c0de.js"), (r) => {
539
- r.actions.create("toggle", (n = {}) => {
540
- var o;
541
- (o = e.getComponentRoute()) == null || o.then((a) => {
542
- a && s.navigate(a.name, a.params);
543
- });
544
- });
545
- })), vt = (i, t, e) => i.getAsync("componentResolver").then((s) => S(void 0, null, function* () {
546
- (yield b.getInstance(i)).addSubscription(s.registerComponent(t, K(() => e)));
649
+ )
650
+ );
651
+ var ne = /* @__PURE__ */ ((r) => (r.LinkList = "link-list", r.Separator = "separator", r.ButtonList = "button-list", r.Text = "text", r.HTML = "html", r.VideoRequest = "video-request", r))(ne || {});
652
+ const ge = (r, e, t) => r.getAsync("componentResolver").then((s) => A(void 0, null, function* () {
653
+ (yield w.getInstance(r)).addSubscription(
654
+ s.registerComponent(
655
+ e,
656
+ K(() => t)
657
+ )
658
+ );
547
659
  }));
548
660
  export {
549
- lt as ConversationComponent,
550
- X as ConversationController,
551
- P as ConversationEndedBehavior,
552
- q as ConversationEntry,
553
- st as ConversationMessageListItemType,
554
- E as ConversationMessageType,
555
- b as ConversationPlatform,
556
- pt as ConversationReturnButtonComponent,
557
- vt as registerCustomMessageComponent
661
+ pe as ConversationComponent,
662
+ Z as ConversationController,
663
+ E as ConversationEndedBehavior,
664
+ X as ConversationEntry,
665
+ ne as ConversationMessageListItemType,
666
+ k as ConversationMessageType,
667
+ w as ConversationPlatform,
668
+ ve as ConversationReturnButtonComponent,
669
+ ge as registerCustomMessageComponent
558
670
  };
559
671
  //# sourceMappingURL=index.js.map