@opencx/widget-core 4.0.39 → 4.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,43 +1,43 @@
1
1
  import D from "openapi-fetch";
2
2
  import N from "lodash.isequal";
3
3
  import { v4 as U } from "uuid";
4
- const F = (h) => {
5
- console.log(h.error);
6
- }, B = (h) => {
7
- const n = D({
8
- baseUrl: h.baseUrl
4
+ const F = (_) => {
5
+ console.log(_.error);
6
+ }, B = (_) => {
7
+ const a = D({
8
+ baseUrl: _.baseUrl
9
9
  }), o = {
10
- onRequest: h.onRequest,
11
- onResponse: h.onResponse,
12
- onError: h.onError || F
10
+ onRequest: _.onRequest,
11
+ onResponse: _.onResponse,
12
+ onError: _.onError || F
13
13
  };
14
- return n.use(o), n;
14
+ return a.use(o), a;
15
15
  };
16
- class z {
17
- constructor({ config: n }) {
18
- var u, s;
16
+ class E {
17
+ constructor({ config: a }) {
18
+ var h, s;
19
19
  this.userToken = null, this.constructClientOptions = (e) => {
20
- const t = this.config.apiUrl || "https://api.open.cx", a = {
20
+ const t = this.config.apiUrl || "https://api.open.cx", n = {
21
21
  "X-Bot-Token": this.config.token,
22
22
  "Content-Type": "application/json",
23
23
  Accept: "application/json",
24
24
  Authorization: e ? `Bearer ${e}` : void 0
25
25
  };
26
- return { baseUrl: t, headers: a };
26
+ return { baseUrl: t, headers: n };
27
27
  }, this.createOpenAPIClient = ({
28
28
  baseUrl: e,
29
29
  headers: t
30
30
  }) => B({
31
31
  baseUrl: e,
32
- onRequest: ({ request: a }) => {
32
+ onRequest: ({ request: n }) => {
33
33
  Object.entries(t).forEach(([i, l]) => {
34
- l && a.headers.set(i, l);
34
+ l && n.headers.set(i, l);
35
35
  });
36
36
  }
37
37
  }), this.setAuthToken = (e) => {
38
38
  this.userToken = e;
39
- const { baseUrl: t, headers: a } = this.constructClientOptions(e);
40
- this.client = this.createOpenAPIClient({ baseUrl: t, headers: a });
39
+ const { baseUrl: t, headers: n } = this.constructClientOptions(e);
40
+ this.client = this.createOpenAPIClient({ baseUrl: t, headers: n });
41
41
  }, this.getExternalWidgetConfig = async () => await this.client.GET("/backend/widget/v2/config", {
42
42
  params: { header: { "X-Bot-Token": this.config.token } }
43
43
  }), this.sendMessage = async (e, t) => await this.client.POST("/backend/widget/v2/chat/send", {
@@ -54,74 +54,74 @@ class z {
54
54
  }), this.pollSessionAndHistory = async ({
55
55
  sessionId: e,
56
56
  lastMessageTimestamp: t,
57
- abortSignal: a
57
+ abortSignal: n
58
58
  }) => {
59
59
  const i = t ? { lastMessageTimestamp: t } : void 0;
60
60
  return await this.client.GET("/backend/widget/v2/poll/{sessionId}", {
61
61
  params: { path: { sessionId: e }, query: i },
62
- signal: a
62
+ signal: n
63
63
  });
64
64
  }, this.getSessions = async ({
65
65
  cursor: e,
66
66
  filters: t,
67
- abortSignal: a
67
+ abortSignal: n
68
68
  }) => await this.client.GET("/backend/widget/v2/sessions", {
69
69
  params: { query: { cursor: e, filters: JSON.stringify(t) } },
70
- signal: a
70
+ signal: n
71
71
  }), this.uploadFile = async ({
72
72
  file: e,
73
73
  abortSignal: t,
74
- onProgress: a
74
+ onProgress: n
75
75
  }) => new Promise((i, l) => {
76
76
  var y;
77
77
  const c = new FormData();
78
78
  c.append("file", e);
79
- const _ = new XMLHttpRequest();
79
+ const u = new XMLHttpRequest();
80
80
  if (t && (t.addEventListener("abort", () => {
81
- _.abort(), l(new DOMException("Aborted", "AbortError"));
81
+ u.abort(), l(new DOMException("Aborted", "AbortError"));
82
82
  }), t.aborted)) {
83
83
  l(new DOMException("Aborted", "AbortError"));
84
84
  return;
85
85
  }
86
- _.upload.addEventListener("progress", (v) => {
87
- if (v.lengthComputable && a) {
86
+ u.upload.addEventListener("progress", (v) => {
87
+ if (v.lengthComputable && n) {
88
88
  const f = Math.round(v.loaded / v.total * 100);
89
- a(f);
89
+ n(f);
90
90
  }
91
- }), _.addEventListener("load", () => {
92
- if (_.status >= 200 && _.status < 300)
91
+ }), u.addEventListener("load", () => {
92
+ if (u.status >= 200 && u.status < 300)
93
93
  try {
94
- const v = JSON.parse(_.responseText);
94
+ const v = JSON.parse(u.responseText);
95
95
  i(v);
96
96
  } catch (v) {
97
97
  l(new Error(`Failed to parse response: ${v}`));
98
98
  }
99
99
  else
100
- l(new Error(`Upload failed with status: ${_.status}`));
101
- }), _.addEventListener("error", () => {
100
+ l(new Error(`Upload failed with status: ${u.status}`));
101
+ }), u.addEventListener("error", () => {
102
102
  l(new Error("Network error occurred"));
103
- }), _.addEventListener("timeout", () => {
103
+ }), u.addEventListener("timeout", () => {
104
104
  l(new Error("Upload timed out"));
105
105
  });
106
106
  const { baseUrl: p } = this.constructClientOptions(this.userToken), d = `${p}/backend/widget/v2/upload`;
107
- _.open("POST", d), _.setRequestHeader("X-Bot-Token", this.config.token), this.userToken ?? ((y = this.config.user) == null ? void 0 : y.token) ? _.setRequestHeader("Authorization", `Bearer ${this.userToken}`) : console.error("User token not set"), _.send(c);
107
+ u.open("POST", d), u.setRequestHeader("X-Bot-Token", this.config.token), this.userToken ?? ((y = this.config.user) == null ? void 0 : y.token) ? u.setRequestHeader("Authorization", `Bearer ${this.userToken}`) : console.error("User token not set"), u.send(c);
108
108
  }), this.vote = async (e) => await this.client.POST("/backend/widget/v2/chat/vote", { body: e }), this.resolveSession = async (e, t) => await this.client.POST("/backend/widget/v2/session/resolve", {
109
109
  body: e,
110
110
  signal: t
111
111
  }), this.createStateCheckpoint = async (e) => await this.client.POST("/backend/widget/v2/checkpoint", {
112
112
  body: e
113
- }), this.submitCsat = async (e) => await this.client.POST("/backend/widget/v2/submit-csat", { body: e }), this.config = n, this.userToken = ((u = n.user) == null ? void 0 : u.token) || null;
113
+ }), this.submitCsat = async (e) => await this.client.POST("/backend/widget/v2/submit-csat", { body: e }), this.config = a, this.userToken = ((h = a.user) == null ? void 0 : h.token) || null;
114
114
  const { baseUrl: o, headers: r } = this.constructClientOptions(
115
- (s = n.user) == null ? void 0 : s.token
115
+ (s = a.user) == null ? void 0 : s.token
116
116
  );
117
117
  this.client = this.createOpenAPIClient({ baseUrl: o, headers: r });
118
118
  }
119
119
  }
120
- function V(h, n) {
121
- console.error(`Missing case for ${h} in ${n}`);
120
+ function V(_, a) {
121
+ console.error(`Missing case for ${_} in ${a}`);
122
122
  }
123
123
  class S {
124
- constructor(n) {
124
+ constructor(a) {
125
125
  this.subscribers = /* @__PURE__ */ new Set(), this.get = () => this.state, this.set = (o) => {
126
126
  N(this.state, o) || (this.state = o, this.notifySubscribers(o));
127
127
  }, this.setPartial = (o) => {
@@ -131,16 +131,16 @@ class S {
131
131
  }, this.reset = () => {
132
132
  this.set(this.initialState);
133
133
  }, this.notifySubscribers = (o) => {
134
- Array.from(this.subscribers).forEach((u) => {
134
+ Array.from(this.subscribers).forEach((h) => {
135
135
  try {
136
- u(o);
136
+ h(o);
137
137
  } catch (s) {
138
138
  console.error(s);
139
139
  }
140
140
  });
141
141
  }, this.subscribe = (o) => (this.subscribers.add(o), () => {
142
142
  this.subscribers.delete(o);
143
- }), this.state = n, this.initialState = n;
143
+ }), this.state = a, this.initialState = a;
144
144
  }
145
145
  }
146
146
  class O {
@@ -149,14 +149,14 @@ class O {
149
149
  isPolling: !1,
150
150
  isError: !1
151
151
  }), this.abortController = new AbortController(), this.reset = () => {
152
- var n;
153
- this.abortController.abort("Resetting poller"), (n = this.stopPolling) == null || n.call(this), this.stopPolling = null;
154
- }, this.stopPolling = null, this.startPolling = (n, o) => {
152
+ var a;
153
+ this.abortController.abort("Resetting poller"), (a = this.stopPolling) == null || a.call(this), this.stopPolling = null;
154
+ }, this.stopPolling = null, this.startPolling = (a, o) => {
155
155
  if (this.stopPolling) return;
156
- const r = [], u = async () => {
156
+ const r = [], h = async () => {
157
157
  this.abortController = new AbortController(), this.state.setPartial({ isPolling: !0 });
158
158
  try {
159
- await n(this.abortController.signal);
159
+ await a(this.abortController.signal);
160
160
  } catch (s) {
161
161
  if (this.abortController.signal.aborted)
162
162
  return;
@@ -164,28 +164,28 @@ class O {
164
164
  } finally {
165
165
  this.state.setPartial({ isPolling: !1 });
166
166
  }
167
- this.abortController.signal.aborted ? console.log("Poller aborted, not scheduling anymore") : r.push(setTimeout(u, o));
167
+ this.abortController.signal.aborted ? console.log("Poller aborted, not scheduling anymore") : r.push(setTimeout(h, o));
168
168
  };
169
- u(), this.stopPolling = () => {
169
+ h(), this.stopPolling = () => {
170
170
  r.forEach(clearTimeout), this.state.reset();
171
171
  };
172
172
  };
173
173
  }
174
174
  }
175
- function j(h) {
175
+ function L(_) {
176
176
  try {
177
- const n = h();
178
- return n instanceof Promise ? n.then((o) => ({ data: o })).catch((o) => ({ error: o })) : { data: n };
179
- } catch (n) {
180
- return { error: n };
177
+ const a = _();
178
+ return a instanceof Promise ? a.then((o) => ({ data: o })).catch((o) => ({ error: o })) : { data: a };
179
+ } catch (a) {
180
+ return { error: a };
181
181
  }
182
182
  }
183
183
  class H {
184
184
  constructor({
185
- api: n,
185
+ api: a,
186
186
  config: o,
187
187
  sessionCtx: r,
188
- messageCtx: u,
188
+ messageCtx: h,
189
189
  sessionPollingIntervalSeconds: s
190
190
  }) {
191
191
  this.poller = new O(), this.fetchSessionAndFullHistoryAbortController = new AbortController(), this.registerPolling = () => {
@@ -210,14 +210,14 @@ class H {
210
210
  }, this.fetchSessionAndHistory = async ({
211
211
  sessionId: e,
212
212
  abortSignal: t,
213
- fetchFullHistory: a = !1
213
+ fetchFullHistory: n = !1
214
214
  }) => {
215
- var _;
215
+ var u;
216
216
  this.messageCtx.state.get().messages.length === 0 && this.messageCtx.state.setPartial({ isInitialFetchLoading: !0 });
217
- const i = this.messageCtx.state.get().messages, l = i.length > 0 ? ((_ = i[i.length - 1]) == null ? void 0 : _.timestamp) ?? void 0 : void 0, { data: c } = await this.api.pollSessionAndHistory({
217
+ const i = this.messageCtx.state.get().messages, l = i.length > 0 ? ((u = i[i.length - 1]) == null ? void 0 : u.timestamp) ?? void 0 : void 0, { data: c } = await this.api.pollSessionAndHistory({
218
218
  sessionId: e,
219
219
  abortSignal: t,
220
- lastMessageTimestamp: a ? void 0 : l
220
+ lastMessageTimestamp: n ? void 0 : l
221
221
  });
222
222
  if (c != null && c.session && (this.sessionCtx.sessionState.setPartial({ session: c.session }), this.sessionCtx.setSessions([c.session])), c != null && c.history && c.history.length > 0) {
223
223
  const p = this.messageCtx.state.get().messages, w = c.history.map(this.mapHistoryToMessage).filter((d) => d !== null).filter(
@@ -229,7 +229,7 @@ class H {
229
229
  }
230
230
  this.messageCtx.state.get().isInitialFetchLoading && this.messageCtx.state.setPartial({ isInitialFetchLoading: !1 });
231
231
  }, this.mapHistoryToMessage = (e) => {
232
- var a;
232
+ var n;
233
233
  const t = {
234
234
  id: e.publicId,
235
235
  timestamp: e.sentAt || "",
@@ -268,7 +268,7 @@ class H {
268
268
  component: "bot_message",
269
269
  agent: {
270
270
  id: null,
271
- name: ((a = this.config.bot) == null ? void 0 : a.name) || "",
271
+ name: ((n = this.config.bot) == null ? void 0 : n.name) || "",
272
272
  isAi: !0,
273
273
  // Do not set avatarUrl from config here... let it be taken from the config at render time
274
274
  avatarUrl: null,
@@ -335,35 +335,35 @@ class H {
335
335
  const t = e.result;
336
336
  if (t === null || typeof t != "object") return t;
337
337
  if ("responseBodyText" in t && typeof t.responseBodyText == "string") {
338
- const a = t.responseBodyText, i = j(() => JSON.parse(a)).data;
338
+ const n = t.responseBodyText, i = L(() => JSON.parse(n)).data;
339
339
  if (i) return i;
340
340
  }
341
341
  return e.result;
342
- }, this.api = n, this.config = o, this.sessionCtx = r, this.messageCtx = u, this.sessionPollingIntervalSeconds = s, this.registerPolling();
342
+ }, this.api = a, this.config = o, this.sessionCtx = r, this.messageCtx = h, this.sessionPollingIntervalSeconds = s, this.registerPolling();
343
343
  }
344
344
  }
345
345
  class q {
346
346
  constructor({
347
- config: n,
347
+ config: a,
348
348
  api: o,
349
349
  storageCtx: r
350
350
  }) {
351
- var u;
351
+ var h;
352
352
  this.shouldCollectData = () => {
353
353
  var s;
354
354
  return !!(!((s = this.state.get().contact) != null && s.token) && this.config.collectUserData);
355
355
  }, this.autoCreateUnverifiedUserIfNotExists = async () => {
356
- var s, e, t, a, i, l, c, _, p, w, d, C, y, v;
356
+ var s, e, t, n, i, l, c, u, p, w, d, C, y, v;
357
357
  if (!((s = this.config.user) != null && s.token)) {
358
358
  if (this.config.collectUserData && !((t = (e = this.config.user) == null ? void 0 : e.data) != null && t.email)) {
359
- if ((a = this.config.extraDataCollectionFields) != null && a.length)
359
+ if ((n = this.config.extraDataCollectionFields) != null && n.length)
360
360
  return;
361
361
  const f = await ((i = this.storageCtx) == null ? void 0 : i.getContactToken());
362
362
  f && await this.setUnverifiedContact(f);
363
363
  return;
364
364
  }
365
365
  if (!((c = (l = this.config.user) == null ? void 0 : l.data) != null && c.email)) {
366
- const f = await ((_ = this.storageCtx) == null ? void 0 : _.getContactToken());
366
+ const f = await ((u = this.storageCtx) == null ? void 0 : u.getContactToken());
367
367
  if (f) {
368
368
  await this.setUnverifiedContact(f);
369
369
  return;
@@ -388,14 +388,14 @@ class q {
388
388
  this.state.setPartial({ isCreatingUnverifiedContact: !1 });
389
389
  }
390
390
  }, this.setUnverifiedContact = async (s) => {
391
- var a, i, l, c;
392
- const e = await ((a = this.storageCtx) == null ? void 0 : a.getExternalContactId()), t = ((i = this.config.user) == null ? void 0 : i.externalId) || e || U();
391
+ var n, i, l, c;
392
+ const e = await ((n = this.storageCtx) == null ? void 0 : n.getExternalContactId()), t = ((i = this.config.user) == null ? void 0 : i.externalId) || e || U();
393
393
  this.api.setAuthToken(s), await ((l = this.storageCtx) == null ? void 0 : l.setContactToken(s)), await ((c = this.storageCtx) == null ? void 0 : c.setExternalContactId(t)), this.state.setPartial({ contact: { token: s, externalId: t } });
394
- }, this.config = n, this.storageCtx = r, this.api = o, this.state = new S({
395
- contact: (u = n.user) != null && u.token ? {
396
- token: n.user.token,
394
+ }, this.config = a, this.storageCtx = r, this.api = o, this.state = new S({
395
+ contact: (h = a.user) != null && h.token ? {
396
+ token: a.user.token,
397
397
  // Set optional externalId from config... not local storage
398
- externalId: n.user.externalId
398
+ externalId: a.user.externalId
399
399
  } : null,
400
400
  extraCollectedData: void 0,
401
401
  isCreatingUnverifiedContact: !1,
@@ -406,12 +406,12 @@ class q {
406
406
  function k() {
407
407
  return U();
408
408
  }
409
- class Y {
409
+ class K {
410
410
  constructor({
411
- config: n,
411
+ config: a,
412
412
  api: o,
413
413
  sessionCtx: r,
414
- messageCtx: u
414
+ messageCtx: h
415
415
  }) {
416
416
  this.submitCsat = async (s) => {
417
417
  var l;
@@ -436,21 +436,21 @@ class Y {
436
436
  }
437
437
  ]
438
438
  });
439
- const { data: a, error: i } = await this.api.submitCsat({
439
+ const { data: n, error: i } = await this.api.submitCsat({
440
440
  ...s,
441
441
  system_message_uuid: t,
442
442
  session_id: e
443
443
  });
444
- return { data: a, error: i };
445
- }, this.config = n, this.api = o, this.sessionCtx = r, this.messageCtx = u;
444
+ return { data: n, error: i };
445
+ }, this.config = a, this.api = o, this.sessionCtx = r, this.messageCtx = h;
446
446
  }
447
447
  }
448
- class K {
448
+ class Y {
449
449
  constructor({
450
- config: n,
450
+ config: a,
451
451
  api: o,
452
452
  contactCtx: r,
453
- sessionsPollingIntervalSeconds: u
453
+ sessionsPollingIntervalSeconds: h
454
454
  }) {
455
455
  this.sessionsRefresher = new O(), this.sessionState = new S({
456
456
  session: null,
@@ -481,7 +481,7 @@ class K {
481
481
  Object.entries(this.config.sessionCustomData || {}).map(
482
482
  ([s, e]) => {
483
483
  var t;
484
- return typeof e == "string" ? [s, e] : typeof e == "boolean" ? [s, e] : typeof e == "number" ? [s, e] : [s, ((t = j(() => JSON.stringify(e))) == null ? void 0 : t.data) || ""];
484
+ return typeof e == "string" ? [s, e] : typeof e == "boolean" ? [s, e] : typeof e == "number" ? [s, e] : [s, ((t = L(() => JSON.stringify(e))) == null ? void 0 : t.data) || ""];
485
485
  }
486
486
  )
487
487
  ), this.createSession = async () => {
@@ -490,10 +490,10 @@ class K {
490
490
  const s = (i = this.contactCtx.state.get().contact) == null ? void 0 : i.externalId, e = {
491
491
  ...this.getParsedCustomData(),
492
492
  ...s ? { external_id: s } : {}
493
- }, { data: t, error: a } = await this.api.createSession({
493
+ }, { data: t, error: n } = await this.api.createSession({
494
494
  customData: Object.keys(e).length > 0 ? e : void 0
495
495
  });
496
- return t ? (this.sessionState.setPartial({ session: t, isCreatingSession: !1 }), t) : (this.sessionState.setPartial({ isCreatingSession: !1 }), console.error("Failed to create session:", a), null);
496
+ return t ? (this.sessionState.setPartial({ session: t, isCreatingSession: !1 }), t) : (this.sessionState.setPartial({ isCreatingSession: !1 }), console.error("Failed to create session:", n), null);
497
497
  }, this.loadMoreSessions = async () => {
498
498
  if (this.sessionsState.get().isLastPage) return;
499
499
  const { data: s } = await this.getSessions({
@@ -501,7 +501,7 @@ class K {
501
501
  });
502
502
  if (s) {
503
503
  const t = [...this.sessionsState.get().data, ...s.items].filter(
504
- (a, i, l) => i === l.findIndex((c) => a.id === c.id)
504
+ (n, i, l) => i === l.findIndex((c) => n.id === c.id)
505
505
  );
506
506
  this.sessionsState.setPartial({
507
507
  data: t,
@@ -510,9 +510,9 @@ class K {
510
510
  });
511
511
  }
512
512
  }, this.getSessions = async ({ cursor: s }) => {
513
- var t, a;
513
+ var t, n;
514
514
  if (!((t = this.contactCtx.state.get().contact) != null && t.token)) return { data: null };
515
- const e = (a = this.contactCtx.state.get().contact) == null ? void 0 : a.externalId;
515
+ const e = (n = this.contactCtx.state.get().contact) == null ? void 0 : n.externalId;
516
516
  return await this.api.getSessions({
517
517
  cursor: s,
518
518
  filters: e ? {
@@ -521,7 +521,7 @@ class K {
521
521
  });
522
522
  }, this.setSessions = (s) => {
523
523
  const e = [...s, ...this.sessionsState.get().data].filter(
524
- (t, a, i) => a === i.findIndex((l) => t.id === l.id)
524
+ (t, n, i) => n === i.findIndex((l) => t.id === l.id)
525
525
  );
526
526
  this.sessionsState.setPartial({ data: e });
527
527
  }, this.refreshSessions = async () => {
@@ -540,20 +540,20 @@ class K {
540
540
  var i;
541
541
  const e = (i = this.sessionState.get().session) == null ? void 0 : i.id;
542
542
  if (!e) return;
543
- const { data: t, error: a } = await this.api.createStateCheckpoint({
543
+ const { data: t, error: n } = await this.api.createStateCheckpoint({
544
544
  session_id: e,
545
545
  payload: s
546
546
  });
547
547
  return t != null && t.success ? { success: !0 } : { success: !1 };
548
- }, this.config = n, this.api = o, this.contactCtx = r, this.sessionsPollingIntervalSeconds = u, this.registerSessionsRefresherWrapper();
548
+ }, this.config = a, this.api = o, this.contactCtx = r, this.sessionsPollingIntervalSeconds = h, this.registerSessionsRefresherWrapper();
549
549
  }
550
550
  }
551
551
  class $ {
552
552
  constructor({
553
- config: n,
553
+ config: a,
554
554
  api: o,
555
555
  sessionCtx: r,
556
- contactCtx: u
556
+ contactCtx: h
557
557
  }) {
558
558
  this.state = new S({
559
559
  messages: [],
@@ -564,7 +564,7 @@ class $ {
564
564
  }), this.sendMessageAbortController = new AbortController(), this.reset = () => {
565
565
  this.sendMessageAbortController.abort("Resetting chat"), this.state.reset();
566
566
  }, this.sendMessage = async (s) => {
567
- var e, t, a, i, l, c, _, p, w;
567
+ var e, t, n, i, l, c, u, p, w;
568
568
  try {
569
569
  if (!s.content.trim() && (!s.attachments || s.attachments.length === 0)) {
570
570
  console.warn(
@@ -604,15 +604,15 @@ class $ {
604
604
  ...P,
605
605
  I
606
606
  ]
607
- }), !((a = this.sessionCtx.sessionState.get().session) != null && a.id)) {
607
+ }), !((n = this.sessionCtx.sessionState.get().session) != null && n.id)) {
608
608
  if (!await this.sessionCtx.createSession()) {
609
609
  console.error("Failed to create session");
610
610
  return;
611
611
  }
612
612
  this.sessionCtx.refreshSessions();
613
613
  }
614
- const E = (i = this.sessionCtx.sessionState.get().session) == null ? void 0 : i.id;
615
- if (!E) return;
614
+ const M = (i = this.sessionCtx.sessionState.get().session) == null ? void 0 : i.id;
615
+ if (!M) return;
616
616
  const { data: m } = await this.api.sendMessage(
617
617
  {
618
618
  uuid: I.id,
@@ -620,7 +620,7 @@ class $ {
620
620
  headers: this.config.headers,
621
621
  query_params: this.config.queryParams,
622
622
  body_properties: this.config.bodyProperties,
623
- session_id: E,
623
+ session_id: M,
624
624
  content: I.content,
625
625
  attachments: s.attachments,
626
626
  clientContext: this.config.context,
@@ -642,7 +642,7 @@ class $ {
642
642
  if (g) {
643
643
  const x = this.state.get().messages;
644
644
  if (!!x.some(
645
- (L) => L.id === g.id
645
+ (R) => R.id === g.id
646
646
  )) {
647
647
  this.state.setPartial({
648
648
  lastAIResMightSolveUserIssue: ((l = m.autopilotResponse) == null ? void 0 : l.mightSolveUserIssue) || ((c = m.uiResponse) == null ? void 0 : c.mightSolveUserIssue)
@@ -651,7 +651,7 @@ class $ {
651
651
  }
652
652
  this.state.setPartial({
653
653
  messages: [...x, g],
654
- lastAIResMightSolveUserIssue: ((_ = m.autopilotResponse) == null ? void 0 : _.mightSolveUserIssue) || ((p = m.uiResponse) == null ? void 0 : p.mightSolveUserIssue)
654
+ lastAIResMightSolveUserIssue: ((u = m.autopilotResponse) == null ? void 0 : u.mightSolveUserIssue) || ((p = m.uiResponse) == null ? void 0 : p.mightSolveUserIssue)
655
655
  });
656
656
  }
657
657
  m.session && this.sessionCtx.sessionState.setPartial({ session: m.session });
@@ -673,8 +673,8 @@ class $ {
673
673
  }
674
674
  }, this.toUserMessage = (s, e) => {
675
675
  const t = (() => {
676
- const a = this.contactCtx.state.get().extraCollectedData;
677
- return this.state.get().messages.length === 0 && a && Object.keys(a).length > 0 ? `${Object.entries(a).filter(([l, c]) => !!c).map(([l, c]) => `${l}: ${c}`).join(`
676
+ const n = this.contactCtx.state.get().extraCollectedData;
677
+ return this.state.get().messages.length === 0 && n && Object.keys(n).length > 0 ? `${Object.entries(n).filter(([l, c]) => !!c).map(([l, c]) => `${l}: ${c}`).join(`
678
678
  `)}
679
679
 
680
680
  ${s}` : s;
@@ -720,15 +720,15 @@ ${s}` : s;
720
720
  variant: "error",
721
721
  action: void 0
722
722
  }
723
- }), this.config = n, this.api = o, this.sessionCtx = r, this.contactCtx = u;
723
+ }), this.config = a, this.api = o, this.sessionCtx = r, this.contactCtx = h;
724
724
  }
725
725
  }
726
- class G {
726
+ class J {
727
727
  constructor({
728
- config: n,
728
+ config: a,
729
729
  contactCtx: o,
730
730
  sessionCtx: r,
731
- resetChat: u
731
+ resetChat: h
732
732
  }) {
733
733
  var s;
734
734
  this.registerRoutingListener = () => {
@@ -739,12 +739,12 @@ class G {
739
739
  });
740
740
  }), this.sessionCtx.sessionsState.subscribe(
741
741
  ({ isInitialFetchLoading: e, data: t }) => {
742
- var a, i, l, c;
743
- if ((a = this.config.router) != null && a.chatScreenOnly && // Do not route to a chat if we are currently inside one already
742
+ var n, i, l, c;
743
+ if ((n = this.config.router) != null && n.chatScreenOnly && // Do not route to a chat if we are currently inside one already
744
744
  // This also applies to newly created sessions; the new session will be in `sessionState` before it is refreshed and included in `sessionsState`
745
745
  !((i = this.sessionCtx.sessionState.get().session) != null && i.id)) {
746
- const _ = (l = t.find((p) => p.isOpened)) == null ? void 0 : l.id;
747
- return _ ? this.toChatScreen(_) : void 0;
746
+ const u = (l = t.find((p) => p.isOpened)) == null ? void 0 : l.id;
747
+ return u ? this.toChatScreen(u) : void 0;
748
748
  }
749
749
  t.length || ((c = this.config.router) == null ? void 0 : c.goToChatIfNoSessions) !== !1 && !e && this.state.get().screen !== "chat" && this.toChatScreen();
750
750
  }
@@ -753,19 +753,19 @@ class G {
753
753
  this.resetChat(), this.state.setPartial({ screen: "sessions" });
754
754
  }, this.toChatScreen = (e) => {
755
755
  if (this.resetChat(), e) {
756
- const t = this.sessionCtx.sessionsState.get().data.find((a) => a.id === e);
756
+ const t = this.sessionCtx.sessionsState.get().data.find((n) => n.id === e);
757
757
  if (!t) return;
758
758
  this.sessionCtx.sessionState.setPartial({ session: t });
759
759
  }
760
760
  this.state.setPartial({ screen: "chat" });
761
- }, this.config = n, this.contactCtx = o, this.sessionCtx = r, this.resetChat = u, this.state = new S({
761
+ }, this.config = a, this.contactCtx = o, this.sessionCtx = r, this.resetChat = h, this.state = new S({
762
762
  screen: this.contactCtx.shouldCollectData() ? "welcome" : (s = this.config.router) != null && s.chatScreenOnly ? "chat" : "sessions"
763
763
  }), this.registerRoutingListener();
764
764
  }
765
765
  }
766
- class J {
766
+ class G {
767
767
  constructor({
768
- storage: n,
768
+ storage: a,
769
769
  config: o
770
770
  }) {
771
771
  this.KEYS = {
@@ -775,15 +775,15 @@ class J {
775
775
  await this.storage.set(this.KEYS.contactToken(this.config.token), r);
776
776
  }, this.getContactToken = async () => this.storage.get(this.KEYS.contactToken(this.config.token)), this.setExternalContactId = async (r) => {
777
777
  await this.storage.set(this.KEYS.externalContactId(this.config.token), r);
778
- }, this.getExternalContactId = async () => this.storage.get(this.KEYS.externalContactId(this.config.token)), this.storage = n, this.config = o;
778
+ }, this.getExternalContactId = async () => this.storage.get(this.KEYS.externalContactId(this.config.token)), this.storage = a, this.config = o;
779
779
  }
780
780
  }
781
781
  const b = class b {
782
782
  constructor({
783
- config: n,
783
+ config: a,
784
784
  storage: o,
785
785
  modes: r,
786
- org: u
786
+ org: h
787
787
  }) {
788
788
  if (this.modes = [], this.resetChat = () => {
789
789
  this.sessionCtx.reset(), this.messageCtx.reset();
@@ -791,11 +791,11 @@ const b = class b {
791
791
  throw Error(
792
792
  "Widget polling values are not defined, did you call WidgetCtx.initialize()"
793
793
  );
794
- this.config = n, this.org = u, this.api = new z({ config: n }), this.storageCtx = o ? new J({ storage: o, config: n }) : void 0, this.modes = r, this.contactCtx = new q({
794
+ this.config = a, this.org = h, this.api = new E({ config: a }), this.storageCtx = o ? new G({ storage: o, config: a }) : void 0, this.modes = r, this.contactCtx = new q({
795
795
  api: this.api,
796
796
  config: this.config,
797
797
  storageCtx: this.storageCtx
798
- }), this.sessionCtx = new K({
798
+ }), this.sessionCtx = new Y({
799
799
  config: this.config,
800
800
  api: this.api,
801
801
  contactCtx: this.contactCtx,
@@ -805,7 +805,7 @@ const b = class b {
805
805
  api: this.api,
806
806
  sessionCtx: this.sessionCtx,
807
807
  contactCtx: this.contactCtx
808
- }), this.csatCtx = new Y({
808
+ }), this.csatCtx = new K({
809
809
  config: this.config,
810
810
  api: this.api,
811
811
  sessionCtx: this.sessionCtx,
@@ -816,7 +816,7 @@ const b = class b {
816
816
  sessionCtx: this.sessionCtx,
817
817
  messageCtx: this.messageCtx,
818
818
  sessionPollingIntervalSeconds: b.pollingIntervalsSeconds.session
819
- }), this.routerCtx = new G({
819
+ }), this.routerCtx = new J({
820
820
  config: this.config,
821
821
  contactCtx: this.contactCtx,
822
822
  sessionCtx: this.sessionCtx,
@@ -825,20 +825,20 @@ const b = class b {
825
825
  }
826
826
  };
827
827
  b.pollingIntervalsSeconds = null, b.initialize = async ({
828
- config: n,
828
+ config: a,
829
829
  storage: o
830
830
  }) => {
831
- var u, s, e;
832
- const r = await new z({
833
- config: n
831
+ var h, s, e;
832
+ const r = await new E({
833
+ config: a
834
834
  }).getExternalWidgetConfig();
835
835
  if (!r.data)
836
836
  throw new Error("Failed to fetch widget config");
837
837
  return b.pollingIntervalsSeconds = {
838
- session: ((u = r.data) == null ? void 0 : u.sessionPollingIntervalSeconds) || 10,
838
+ session: ((h = r.data) == null ? void 0 : h.sessionPollingIntervalSeconds) || 10,
839
839
  sessions: ((s = r.data) == null ? void 0 : s.sessionsPollingIntervalSeconds) || 60
840
840
  }, new b({
841
- config: n,
841
+ config: a,
842
842
  storage: o,
843
843
  modes: ((e = r.data) == null ? void 0 : e.modes) || [],
844
844
  org: {
@@ -847,7 +847,7 @@ b.pollingIntervalsSeconds = null, b.initialize = async ({
847
847
  }
848
848
  });
849
849
  };
850
- let M = b;
850
+ let z = b;
851
851
  const W = {
852
852
  write_a_message_placeholder: "اكتب رسالة...",
853
853
  your_issue_has_been_resolved: "تم حل مشكلتك!",
@@ -865,6 +865,22 @@ const W = {
865
865
  back_to_conversations: "العودة إلى المحادثات",
866
866
  closed_conversations: "المحادثات المغلقة"
867
867
  }, Z = {
868
+ write_a_message_placeholder: "একটি বার্তা লিখুন...",
869
+ your_issue_has_been_resolved: "আপনার সমস্যা সমাধান হয়েছে!",
870
+ new_conversation: "নতুন কথোপকথন",
871
+ welcome_screen_title: "আমাদের সাপোর্ট চ্যাটে স্বাগতম",
872
+ welcome_screen_description: "আমরা সাহায্য করতে এখানে আছি! একটি কথোপকথন শুরু করুন এবং আমরা যত তাড়াতাড়ি সম্ভব আপনার কাছে ফিরে আসব।",
873
+ your_name_placeholder: "আপনার নাম",
874
+ your_email_placeholder: "আপনার ইমেইল ঠিকানা",
875
+ start_chat_button: "সাপোর্টের সাথে কথা বলুন",
876
+ start_chat_button_loading: "সংযোগ হচ্ছে...",
877
+ i_need_more_help: "আমার আরও সাহায্য দরকার",
878
+ this_was_helpful: "এটি সহায়ক ছিল",
879
+ optional: "ঐচ্ছিক",
880
+ no_conversations_yet: "এখনো কোনো কথোপকথন নেই",
881
+ back_to_conversations: "কথোপকথনে ফিরে যান",
882
+ closed_conversations: "বন্ধ কথোপকথন"
883
+ }, X = {
868
884
  write_a_message_placeholder: "Напишете съобщение...",
869
885
  your_issue_has_been_resolved: "Вашият проблем е разрешен!",
870
886
  new_conversation: "Нов разговор",
@@ -880,7 +896,7 @@ const W = {
880
896
  no_conversations_yet: "Все още няма разговори",
881
897
  back_to_conversations: "Назад към разговорите",
882
898
  closed_conversations: "Затворени разговори"
883
- }, X = {
899
+ }, Q = {
884
900
  write_a_message_placeholder: "Napište zprávu...",
885
901
  your_issue_has_been_resolved: "Váš problém byl vyřešen!",
886
902
  new_conversation: "Nová konverzace",
@@ -896,7 +912,7 @@ const W = {
896
912
  no_conversations_yet: "Zatím žádné konverzace",
897
913
  back_to_conversations: "Zpět na konverzace",
898
914
  closed_conversations: "Uzavřené konverzace"
899
- }, Q = {
915
+ }, ee = {
900
916
  write_a_message_placeholder: "Skriv en besked...",
901
917
  your_issue_has_been_resolved: "Dit problem er løst!",
902
918
  new_conversation: "Ny samtale",
@@ -912,7 +928,7 @@ const W = {
912
928
  no_conversations_yet: "Ingen samtaler endnu",
913
929
  back_to_conversations: "Tilbage til samtaler",
914
930
  closed_conversations: "Lukkede samtaler"
915
- }, ee = {
931
+ }, te = {
916
932
  write_a_message_placeholder: "Γράψτε ένα μήνυμα...",
917
933
  your_issue_has_been_resolved: "Το πρόβλημά σας επιλύθηκε!",
918
934
  new_conversation: "Νέα συνομιλία",
@@ -928,7 +944,7 @@ const W = {
928
944
  no_conversations_yet: "Δεν υπάρχουν συνομιλίες ακόμα",
929
945
  back_to_conversations: "Πίσω στις συνομιλίες",
930
946
  closed_conversations: "Κλειστές συνομιλίες"
931
- }, te = {
947
+ }, se = {
932
948
  write_a_message_placeholder: "Nachricht schreiben...",
933
949
  your_issue_has_been_resolved: "Ihr Problem wurde gelöst!",
934
950
  new_conversation: "Neue Konversation",
@@ -944,7 +960,7 @@ const W = {
944
960
  no_conversations_yet: "noch keine Gespräche",
945
961
  back_to_conversations: "Zurück zur Konversationen",
946
962
  closed_conversations: "Geschlossene Konversationen"
947
- }, se = {
963
+ }, ae = {
948
964
  write_a_message_placeholder: "Write a message...",
949
965
  your_issue_has_been_resolved: "Your issue has been resolved!",
950
966
  new_conversation: "New conversation",
@@ -976,7 +992,23 @@ const W = {
976
992
  no_conversations_yet: "Sin conversaciones aún",
977
993
  back_to_conversations: "Volver a conversaciones",
978
994
  closed_conversations: "Conversaciones cerradas"
979
- }, ae = {
995
+ }, oe = {
996
+ write_a_message_placeholder: "Magsulat ng mensahe...",
997
+ your_issue_has_been_resolved: "Nalutas na ang iyong isyu!",
998
+ new_conversation: "Bagong usapan",
999
+ welcome_screen_title: "Maligayang pagdating sa aming support chat",
1000
+ welcome_screen_description: "Narito kami upang tumulong! Magsimula ng usapan at babalikan ka namin sa lalong madaling panahon.",
1001
+ your_name_placeholder: "Iyong pangalan",
1002
+ your_email_placeholder: "Iyong email address",
1003
+ start_chat_button: "Makipag-usap sa support",
1004
+ start_chat_button_loading: "Kumokonekta...",
1005
+ i_need_more_help: "Kailangan ko pa ng tulong",
1006
+ this_was_helpful: "Nakatulong ito",
1007
+ optional: "Opsyonal",
1008
+ no_conversations_yet: "Wala pang mga usapan",
1009
+ back_to_conversations: "Bumalik sa mga usapan",
1010
+ closed_conversations: "Mga saradong usapan"
1011
+ }, ie = {
980
1012
  write_a_message_placeholder: "Kirjoita viesti...",
981
1013
  your_issue_has_been_resolved: "Ongelmasi on ratkaistu!",
982
1014
  new_conversation: "Uusi keskustelu",
@@ -992,7 +1024,7 @@ const W = {
992
1024
  no_conversations_yet: "Ei vielä keskusteluja",
993
1025
  back_to_conversations: "Takaisin keskusteluihin",
994
1026
  closed_conversations: "Suljetut keskustelut"
995
- }, oe = {
1027
+ }, re = {
996
1028
  write_a_message_placeholder: "Écrivez un message...",
997
1029
  your_issue_has_been_resolved: "Votre problème a été résolu !",
998
1030
  new_conversation: "Nouvelle conversation",
@@ -1008,7 +1040,23 @@ const W = {
1008
1040
  no_conversations_yet: "Aucune conversation pour le moment",
1009
1041
  back_to_conversations: "Retour aux conversations",
1010
1042
  closed_conversations: "Conversations fermées"
1011
- }, ie = {
1043
+ }, le = {
1044
+ write_a_message_placeholder: "एक संदेश लिखें...",
1045
+ your_issue_has_been_resolved: "आपकी समस्या हल हो गई है!",
1046
+ new_conversation: "नई बातचीत",
1047
+ welcome_screen_title: "हमारी सहायता चैट में आपका स्वागत है",
1048
+ welcome_screen_description: "हम मदद के लिए यहाँ हैं! बातचीत शुरू करें और हम जल्द से जल्द आपसे संपर्क करेंगे।",
1049
+ your_name_placeholder: "आपका नाम",
1050
+ your_email_placeholder: "आपका ईमेल पता",
1051
+ start_chat_button: "सहायता से बात करें",
1052
+ start_chat_button_loading: "कनेक्ट हो रहा है...",
1053
+ i_need_more_help: "मुझे और मदद चाहिए",
1054
+ this_was_helpful: "यह मददगार था",
1055
+ optional: "वैकल्पिक",
1056
+ no_conversations_yet: "अभी तक कोई बातचीत नहीं",
1057
+ back_to_conversations: "बातचीत पर वापस जाएं",
1058
+ closed_conversations: "बंद बातचीत"
1059
+ }, ce = {
1012
1060
  write_a_message_placeholder: "Scrivi un messaggio...",
1013
1061
  your_issue_has_been_resolved: "Il tuo problema è stato risolto!",
1014
1062
  new_conversation: "Nuova conversazione",
@@ -1024,7 +1072,39 @@ const W = {
1024
1072
  no_conversations_yet: "Nessuna conversazione ancora",
1025
1073
  back_to_conversations: "Torna alle conversazioni",
1026
1074
  closed_conversations: "Conversazioni chiuse"
1027
- }, re = {
1075
+ }, _e = {
1076
+ write_a_message_placeholder: "メッセージを入力...",
1077
+ your_issue_has_been_resolved: "問題が解決しました!",
1078
+ new_conversation: "新しい会話",
1079
+ welcome_screen_title: "サポートチャットへようこそ",
1080
+ welcome_screen_description: "お手伝いいたします!会話を開始していただければ、できるだけ早くご連絡いたします。",
1081
+ your_name_placeholder: "お名前",
1082
+ your_email_placeholder: "メールアドレス",
1083
+ start_chat_button: "サポートに相談",
1084
+ start_chat_button_loading: "接続中...",
1085
+ i_need_more_help: "さらにサポートが必要です",
1086
+ this_was_helpful: "役に立ちました",
1087
+ optional: "任意",
1088
+ no_conversations_yet: "まだ会話がありません",
1089
+ back_to_conversations: "会話一覧に戻る",
1090
+ closed_conversations: "終了した会話"
1091
+ }, he = {
1092
+ write_a_message_placeholder: "메시지를 입력하세요...",
1093
+ your_issue_has_been_resolved: "문제가 해결되었습니다!",
1094
+ new_conversation: "새 대화",
1095
+ welcome_screen_title: "고객 지원 채팅에 오신 것을 환영합니다",
1096
+ welcome_screen_description: "도움을 드리기 위해 여기 있습니다! 대화를 시작해 주시면 가능한 한 빨리 연락드리겠습니다.",
1097
+ your_name_placeholder: "이름",
1098
+ your_email_placeholder: "이메일 주소",
1099
+ start_chat_button: "상담원과 대화",
1100
+ start_chat_button_loading: "연결 중...",
1101
+ i_need_more_help: "추가 도움이 필요합니다",
1102
+ this_was_helpful: "도움이 되었습니다",
1103
+ optional: "선택 사항",
1104
+ no_conversations_yet: "아직 대화가 없습니다",
1105
+ back_to_conversations: "대화 목록으로 돌아가기",
1106
+ closed_conversations: "종료된 대화"
1107
+ }, ue = {
1028
1108
  write_a_message_placeholder: "Schrijf een bericht...",
1029
1109
  your_issue_has_been_resolved: "Uw probleem is opgelost!",
1030
1110
  new_conversation: "Nieuw gesprek",
@@ -1040,7 +1120,7 @@ const W = {
1040
1120
  no_conversations_yet: "Nog geen gesprekken",
1041
1121
  back_to_conversations: "Terug naar gesprekken",
1042
1122
  closed_conversations: "Afgesloten gesprekken"
1043
- }, le = {
1123
+ }, de = {
1044
1124
  write_a_message_placeholder: "Skriv en melding...",
1045
1125
  your_issue_has_been_resolved: "Problemet ditt er løst!",
1046
1126
  new_conversation: "Ny samtale",
@@ -1056,7 +1136,7 @@ const W = {
1056
1136
  no_conversations_yet: "Ingen samtaler ennå",
1057
1137
  back_to_conversations: "Tilbake til samtaler",
1058
1138
  closed_conversations: "Lukkede samtaler"
1059
- }, ce = {
1139
+ }, ge = {
1060
1140
  write_a_message_placeholder: "Napisz wiadomość...",
1061
1141
  your_issue_has_been_resolved: "Twój problem został rozwiązany!",
1062
1142
  new_conversation: "Nowa rozmowa",
@@ -1072,7 +1152,7 @@ const W = {
1072
1152
  no_conversations_yet: "Jeszcze brak rozmów",
1073
1153
  back_to_conversations: "Powrót do rozmów",
1074
1154
  closed_conversations: "Zamknięte rozmowy"
1075
- }, he = {
1155
+ }, me = {
1076
1156
  write_a_message_placeholder: "Escreva uma mensagem...",
1077
1157
  your_issue_has_been_resolved: "Seu problema foi resolvido!",
1078
1158
  new_conversation: "Nova conversa",
@@ -1088,7 +1168,7 @@ const W = {
1088
1168
  no_conversations_yet: "Nenhuma conversa ainda",
1089
1169
  back_to_conversations: "Voltar para conversas",
1090
1170
  closed_conversations: "Conversas fechadas"
1091
- }, ue = {
1171
+ }, pe = {
1092
1172
  write_a_message_placeholder: "Scrie un mesaj...",
1093
1173
  your_issue_has_been_resolved: "Problema ta a fost rezolvată!",
1094
1174
  new_conversation: "Conversație nouă",
@@ -1104,7 +1184,7 @@ const W = {
1104
1184
  no_conversations_yet: "Încă nu există conversații",
1105
1185
  back_to_conversations: "Înapoi la conversații",
1106
1186
  closed_conversations: "Conversații închise"
1107
- }, _e = {
1187
+ }, ve = {
1108
1188
  write_a_message_placeholder: "Skriv ett meddelande...",
1109
1189
  your_issue_has_been_resolved: "Ditt problem har lösts!",
1110
1190
  new_conversation: "Ny konversation",
@@ -1120,7 +1200,7 @@ const W = {
1120
1200
  no_conversations_yet: "Inga konversationer ännu",
1121
1201
  back_to_conversations: "Tillbaka till konversationer",
1122
1202
  closed_conversations: "Stängda konversationer"
1123
- }, de = {
1203
+ }, fe = {
1124
1204
  write_a_message_placeholder: "Напишите сообщение...",
1125
1205
  your_issue_has_been_resolved: "Ваша проблема решена!",
1126
1206
  new_conversation: "Новый разговор",
@@ -1136,7 +1216,7 @@ const W = {
1136
1216
  no_conversations_yet: "Пока нет разговоров",
1137
1217
  back_to_conversations: "Назад к разговорам",
1138
1218
  closed_conversations: "Закрытые разговоры"
1139
- }, ge = {
1219
+ }, be = {
1140
1220
  write_a_message_placeholder: "เขียนข้อความ...",
1141
1221
  your_issue_has_been_resolved: "ปัญหาของคุณได้รับการแก้ไขแล้ว!",
1142
1222
  new_conversation: "การสนทนาใหม่",
@@ -1152,7 +1232,7 @@ const W = {
1152
1232
  no_conversations_yet: "ยังไม่มีการสนทนา",
1153
1233
  back_to_conversations: "กลับไปที่การสนทนา",
1154
1234
  closed_conversations: "การสนทนาที่ปิดแล้ว"
1155
- }, me = {
1235
+ }, we = {
1156
1236
  write_a_message_placeholder: "Bir mesaj yazın...",
1157
1237
  your_issue_has_been_resolved: "Sorununuz çözüldü!",
1158
1238
  new_conversation: "Yeni konuşma",
@@ -1168,7 +1248,23 @@ const W = {
1168
1248
  no_conversations_yet: "Henüz konuşma yok",
1169
1249
  back_to_conversations: "Konuşmalara geri dön",
1170
1250
  closed_conversations: "Kapatılan konuşmalar"
1171
- }, pe = {
1251
+ }, ye = {
1252
+ write_a_message_placeholder: "پیغام لکھیں...",
1253
+ your_issue_has_been_resolved: "آپ کا مسئلہ حل ہو گیا ہے!",
1254
+ new_conversation: "نئی گفتگو",
1255
+ welcome_screen_title: "ہماری سپورٹ چیٹ میں خوش آمدید",
1256
+ welcome_screen_description: "ہم مدد کے لیے حاضر ہیں! گفتگو شروع کریں اور ہم جلد از جلد آپ سے رابطہ کریں گے۔",
1257
+ your_name_placeholder: "آپ کا نام",
1258
+ your_email_placeholder: "آپ کا ای میل پتہ",
1259
+ start_chat_button: "سپورٹ سے بات کریں",
1260
+ start_chat_button_loading: "جڑ رہا ہے...",
1261
+ i_need_more_help: "مجھے مزید مدد چاہیے",
1262
+ this_was_helpful: "یہ مددگار تھا",
1263
+ optional: "اختیاری",
1264
+ no_conversations_yet: "ابھی تک کوئی گفتگو نہیں",
1265
+ back_to_conversations: "گفتگو پر واپس جائیں",
1266
+ closed_conversations: "بند گفتگو"
1267
+ }, Ce = {
1172
1268
  write_a_message_placeholder: "Viết tin nhắn...",
1173
1269
  your_issue_has_been_resolved: "Vấn đề của bạn đã được giải quyết!",
1174
1270
  new_conversation: "Cuộc trò chuyện mới",
@@ -1184,41 +1280,64 @@ const W = {
1184
1280
  no_conversations_yet: "Chưa có cuộc trò chuyện nào",
1185
1281
  back_to_conversations: "Quay lại cuộc trò chuyện",
1186
1282
  closed_conversations: "Cuộc trò chuyện đã đóng"
1187
- }, R = {
1283
+ }, Se = {
1284
+ write_a_message_placeholder: "写一条消息...",
1285
+ your_issue_has_been_resolved: "您的问题已解决!",
1286
+ new_conversation: "新对话",
1287
+ welcome_screen_title: "欢迎使用我们的客服聊天",
1288
+ welcome_screen_description: "我们随时为您提供帮助!开始对话,我们会尽快回复您。",
1289
+ your_name_placeholder: "您的姓名",
1290
+ your_email_placeholder: "您的电子邮件地址",
1291
+ start_chat_button: "联系客服",
1292
+ start_chat_button_loading: "连接中...",
1293
+ i_need_more_help: "我需要更多帮助",
1294
+ this_was_helpful: "这很有帮助",
1295
+ optional: "可选",
1296
+ no_conversations_yet: "暂无对话",
1297
+ back_to_conversations: "返回对话",
1298
+ closed_conversations: "已关闭的对话"
1299
+ }, j = {
1188
1300
  ar: W,
1189
- bg: Z,
1190
- cs: X,
1191
- da: Q,
1192
- de: te,
1193
- el: ee,
1194
- en: se,
1301
+ bn: Z,
1302
+ bg: X,
1303
+ cs: Q,
1304
+ da: ee,
1305
+ de: se,
1306
+ el: te,
1307
+ en: ae,
1195
1308
  es: ne,
1196
- fi: ae,
1197
- fr: oe,
1198
- it: ie,
1199
- nl: re,
1200
- no: le,
1201
- pl: ce,
1202
- pt: he,
1203
- ro: ue,
1204
- ru: de,
1205
- sv: _e,
1206
- th: ge,
1207
- tr: me,
1208
- vi: pe
1209
- }, ve = Object.keys(R);
1210
- function Ce(h) {
1211
- return ve.includes(h);
1309
+ fi: ie,
1310
+ fil: oe,
1311
+ fr: re,
1312
+ hi: le,
1313
+ it: ce,
1314
+ ja: _e,
1315
+ ko: he,
1316
+ nl: ue,
1317
+ no: de,
1318
+ pl: ge,
1319
+ pt: me,
1320
+ ro: pe,
1321
+ ru: fe,
1322
+ sv: ve,
1323
+ th: be,
1324
+ tr: we,
1325
+ ur: ye,
1326
+ vi: Ce,
1327
+ "zh-cn": Se
1328
+ }, ke = Object.keys(j);
1329
+ function Te(_) {
1330
+ return ke.includes(_);
1212
1331
  }
1213
- function Se(h, n, o) {
1332
+ function Me(_, a, o) {
1214
1333
  var r;
1215
- return ((r = o == null ? void 0 : o[n]) == null ? void 0 : r[h]) || R[n][h] || "";
1334
+ return ((r = o == null ? void 0 : o[a]) == null ? void 0 : r[_]) || j[a][_] || "";
1216
1335
  }
1217
1336
  export {
1218
1337
  S as PrimitiveState,
1219
- M as WidgetCtx,
1220
- Se as getTranslation,
1338
+ z as WidgetCtx,
1339
+ Me as getTranslation,
1221
1340
  V as isExhaustive,
1222
- Ce as isSupportedLanguage
1341
+ Te as isSupportedLanguage
1223
1342
  };
1224
1343
  //# sourceMappingURL=index.js.map