@maebgch/rcs-emulator 0.1.13 → 0.1.14

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.
@@ -1,119 +1,125 @@
1
1
  import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
- import { createContext as re, useContext as te, useReducer as se, useRef as W, useEffect as j, useCallback as $, useState as A, memo as p, useMemo as V } from "react";
3
- function Y(s) {
2
+ import { createContext as ae, useContext as le, useReducer as ce, useRef as H, useEffect as B, useCallback as M, useState as A, memo as f, useMemo as O } from "react";
3
+ function ee(s) {
4
4
  return "reply" in s;
5
5
  }
6
- function I(s) {
6
+ function T(s) {
7
7
  return "action" in s;
8
8
  }
9
- function qe(s) {
10
- if (!I(s)) return !1;
9
+ function nr(s) {
10
+ if (!T(s)) return !1;
11
11
  const { urlAction: r } = s.action;
12
12
  return r?.openUrl?.application === "WEBVIEW";
13
13
  }
14
- function oe(s) {
14
+ function ne(s) {
15
15
  const { urlAction: r } = s.action;
16
16
  return r?.openUrl?.application === "WEBVIEW" ? r.openUrl : null;
17
17
  }
18
- const ae = {
18
+ const ie = {
19
19
  name: "Business",
20
20
  verified: !1
21
- }, le = {
21
+ }, ue = {
22
22
  currentMessageId: null,
23
23
  chatHistory: [],
24
24
  isTyping: !1,
25
25
  error: null
26
- }, Q = re(null);
27
- function Z({
26
+ }, re = ae(null);
27
+ function te({
28
28
  children: s,
29
29
  theme: r,
30
30
  device: t,
31
31
  businessInfo: o,
32
32
  state: a,
33
- showSuggestions: c,
34
- isProfileOpen: l,
35
- toggleProfile: u,
33
+ showSuggestions: l,
34
+ isProfileOpen: c,
35
+ toggleProfile: i,
36
36
  onReply: m,
37
- onAction: i,
38
- webView: h,
39
- openWebView: f,
40
- closeWebView: v
37
+ onAction: u,
38
+ webView: d,
39
+ openWebView: h,
40
+ closeWebView: v,
41
+ toast: y,
42
+ showToast: k,
43
+ onBack: w
41
44
  }) {
42
- const b = {
45
+ const g = {
43
46
  theme: r,
44
47
  device: t,
45
- businessInfo: { ...ae, ...o },
46
- state: { ...le, ...a },
47
- showSuggestions: c,
48
- isProfileOpen: l,
49
- toggleProfile: u,
48
+ businessInfo: { ...ie, ...o },
49
+ state: { ...ue, ...a },
50
+ showSuggestions: l,
51
+ isProfileOpen: c,
52
+ toggleProfile: i,
50
53
  handleReply: m,
51
- handleAction: i,
52
- webView: h,
53
- openWebView: f,
54
- closeWebView: v
54
+ handleAction: u,
55
+ webView: d,
56
+ openWebView: h,
57
+ closeWebView: v,
58
+ toast: y,
59
+ showToast: k,
60
+ handleBack: w
55
61
  };
56
- return /* @__PURE__ */ e(Q.Provider, { value: b, children: s });
62
+ return /* @__PURE__ */ e(re.Provider, { value: g, children: s });
57
63
  }
58
- function k() {
59
- const s = te(Q);
64
+ function C() {
65
+ const s = le(re);
60
66
  if (!s)
61
67
  throw new Error("useEmulator must be used within an EmulatorProvider");
62
68
  return s;
63
69
  }
64
- function K(s) {
70
+ function se(s) {
65
71
  const r = Object.values(s.messages);
66
72
  return r.find((t) => t.is_first) || r[0] || null;
67
73
  }
68
- function R(s, r) {
74
+ function V(s, r) {
69
75
  return s.messages[r] || null;
70
76
  }
71
- function O(s, r) {
77
+ function Y(s, r) {
72
78
  const t = s.responses?.keyword?.keyword_response?.choices;
73
79
  return t && t[r]?.next_message || null;
74
80
  }
75
- function H(s, r) {
76
- const t = s.parts, o = ce(t), a = ie(t);
77
- return {
78
- id: `${s.id}-${r}-${Date.now()}`,
79
- sender: "business",
80
- content: o,
81
- timestamp: Date.now(),
82
- suggestions: a
83
- };
84
- }
85
- function ce(s) {
86
- for (const r of s) {
87
- const t = r.RCSMessage;
88
- if (t.textMessage)
89
- return {
90
- type: "text",
91
- text: t.textMessage
92
- };
93
- const o = t.richcardMessage?.message?.generalPurposeCard;
94
- if (o)
95
- return {
96
- type: "richcard",
97
- card: P(o.content, o.layout)
98
- };
99
- const a = t.richcardMessage?.message?.generalPurposeCardCarousel;
100
- if (a)
101
- return {
102
- type: "carousel",
103
- cards: a.content.map(
104
- (c) => P(c, {
105
- cardOrientation: "VERTICAL",
106
- cardWidth: a.layout.cardWidth
107
- })
108
- )
109
- };
81
+ function U(s, r) {
82
+ const t = s.parts, o = [], a = Date.now();
83
+ for (let l = 0; l < t.length; l++) {
84
+ const c = t[l], i = me(c), u = l === t.length - 1 ? he(t) : void 0;
85
+ o.push({
86
+ id: `${s.id}-${r}-${l}-${a + l}`,
87
+ sender: "business",
88
+ content: i,
89
+ timestamp: a + l,
90
+ suggestions: u
91
+ });
110
92
  }
111
- return {
93
+ return o;
94
+ }
95
+ function me(s) {
96
+ const r = s.RCSMessage;
97
+ if (r.textMessage)
98
+ return {
99
+ type: "text",
100
+ text: r.textMessage
101
+ };
102
+ const t = r.richcardMessage?.message?.generalPurposeCard;
103
+ if (t)
104
+ return {
105
+ type: "richcard",
106
+ card: q(t.content, t.layout)
107
+ };
108
+ const o = r.richcardMessage?.message?.generalPurposeCardCarousel;
109
+ return o ? {
110
+ type: "carousel",
111
+ cards: o.content.map(
112
+ (a) => q(a, {
113
+ cardOrientation: o.layout.cardOrientation || "VERTICAL",
114
+ cardWidth: o.layout.cardWidth
115
+ })
116
+ )
117
+ } : {
112
118
  type: "text",
113
119
  text: "[Unsupported message type]"
114
120
  };
115
121
  }
116
- function P(s, r) {
122
+ function q(s, r) {
117
123
  const t = () => {
118
124
  if (s.media) {
119
125
  if (s.media.mediaUrl) return s.media.mediaUrl;
@@ -130,7 +136,7 @@ function P(s, r) {
130
136
  description: s.description,
131
137
  media: a ? {
132
138
  url: a,
133
- height: ne(s.media?.height || "MEDIUM_HEIGHT"),
139
+ height: de(s.media?.height || "MEDIUM_HEIGHT"),
134
140
  thumbnailUrl: o()
135
141
  } : void 0,
136
142
  suggestions: s.suggestions,
@@ -141,7 +147,7 @@ function P(s, r) {
141
147
  }
142
148
  };
143
149
  }
144
- function ne(s) {
150
+ function de(s) {
145
151
  switch (s) {
146
152
  case "SHORT_HEIGHT":
147
153
  return "short";
@@ -151,7 +157,7 @@ function ne(s) {
151
157
  return "medium";
152
158
  }
153
159
  }
154
- function ie(s) {
160
+ function he(s) {
155
161
  const r = [];
156
162
  for (const t of s) {
157
163
  const o = t.RCSMessage;
@@ -159,7 +165,7 @@ function ie(s) {
159
165
  }
160
166
  return r;
161
167
  }
162
- function ue(s) {
168
+ function fe(s) {
163
169
  return {
164
170
  id: `user-${Date.now()}`,
165
171
  sender: "user",
@@ -170,7 +176,7 @@ function ue(s) {
170
176
  timestamp: Date.now()
171
177
  };
172
178
  }
173
- function me(s) {
179
+ function pe(s) {
174
180
  if (!s || typeof s != "object") return !1;
175
181
  const r = s;
176
182
  if (typeof r.name != "string" || !r.messages || typeof r.messages != "object") return !1;
@@ -183,8 +189,8 @@ function me(s) {
183
189
  }
184
190
  return !0;
185
191
  }
186
- function de(s) {
187
- const r = K(s);
192
+ function ge(s) {
193
+ const r = se(s);
188
194
  if (!r || !r.parts.length) return "New message";
189
195
  const o = r.parts[0].RCSMessage;
190
196
  if (o.textMessage)
@@ -192,16 +198,16 @@ function de(s) {
192
198
  const a = o.richcardMessage?.message?.generalPurposeCard;
193
199
  if (a?.content.title)
194
200
  return a.content.title;
195
- const c = o.richcardMessage?.message?.generalPurposeCardCarousel;
196
- return c?.content[0]?.title ? c.content[0].title : "New message";
201
+ const l = o.richcardMessage?.message?.generalPurposeCardCarousel;
202
+ return l?.content[0]?.title ? l.content[0].title : "New message";
197
203
  }
198
- const X = {
204
+ const oe = {
199
205
  currentMessageId: null,
200
206
  chatHistory: [],
201
207
  isTyping: !1,
202
208
  error: null
203
209
  };
204
- function he(s, r) {
210
+ function xe(s, r) {
205
211
  switch (r.type) {
206
212
  case "INIT":
207
213
  return {
@@ -216,8 +222,8 @@ function he(s, r) {
216
222
  isTyping: !1
217
223
  };
218
224
  case "ADD_USER_REPLY": {
219
- const t = ue(r.text), o = s.chatHistory.map(
220
- (a, c) => c === s.chatHistory.length - 1 ? { ...a, suggestions: void 0 } : a
225
+ const t = fe(r.text), o = s.chatHistory.map(
226
+ (a, l) => l === s.chatHistory.length - 1 ? { ...a, suggestions: void 0 } : a
221
227
  );
222
228
  return {
223
229
  ...s,
@@ -241,143 +247,125 @@ function he(s, r) {
241
247
  isTyping: !1
242
248
  };
243
249
  case "RESET":
244
- return X;
250
+ return oe;
245
251
  default:
246
252
  return s;
247
253
  }
248
254
  }
249
- function fe({
255
+ function be({
250
256
  flow: s,
251
257
  onUserReply: r,
252
258
  typingDelay: t = 800
253
259
  }) {
254
- const [o, a] = se(he, X), c = W(0), l = W(!1);
255
- j(() => {
256
- if (l.current) return;
257
- l.current = !0;
258
- const h = K(s);
259
- if (!h) {
260
+ const [o, a] = ce(xe, oe), l = H(0), c = H(!1);
261
+ B(() => {
262
+ if (c.current) return;
263
+ c.current = !0;
264
+ const d = se(s);
265
+ if (!d) {
260
266
  a({
261
267
  type: "SET_ERROR",
262
268
  error: "No first message found in conversation flow"
263
269
  });
264
270
  return;
265
271
  }
266
- a({ type: "INIT", messageId: h.id });
267
- const f = H(
268
- h,
269
- c.current++
270
- );
271
- a({ type: "ADD_BUSINESS_MESSAGE", message: f });
272
+ a({ type: "INIT", messageId: d.id }), U(
273
+ d,
274
+ l.current++
275
+ ).forEach((v) => {
276
+ a({ type: "ADD_BUSINESS_MESSAGE", message: v });
277
+ });
272
278
  }, [s]);
273
- const u = $(
274
- (h) => {
275
- if (!Y(h)) return;
276
- const { displayText: f, postback: v } = h.reply, b = v.data;
277
- a({ type: "ADD_USER_REPLY", text: f, postbackData: b });
278
- const N = {
279
+ const i = M(
280
+ (d) => {
281
+ if (!ee(d)) return;
282
+ const { displayText: h, postback: v } = d.reply, y = v.data;
283
+ a({ type: "ADD_USER_REPLY", text: h, postbackData: y });
284
+ const k = {
279
285
  type: "reply",
280
- postbackData: b,
281
- displayText: f,
286
+ postbackData: y,
287
+ displayText: h,
282
288
  timestamp: Date.now()
283
289
  };
284
- r(N);
285
- const y = o.currentMessageId ? R(s, o.currentMessageId) : null;
286
- if (!y) {
290
+ r(k);
291
+ const w = o.currentMessageId ? V(s, o.currentMessageId) : null;
292
+ if (!w) {
287
293
  a({ type: "SET_ERROR", error: "Current message not found" });
288
294
  return;
289
295
  }
290
- const w = O(y, b);
291
- if (!w)
296
+ const g = Y(w, y);
297
+ if (!g)
292
298
  return;
293
- const g = R(s, w);
294
- if (!g) {
299
+ const x = V(s, g);
300
+ if (!x) {
295
301
  a({
296
302
  type: "SET_ERROR",
297
- error: `Next message "${w}" not found`
303
+ error: `Next message "${g}" not found`
298
304
  });
299
305
  return;
300
306
  }
301
- a({ type: "SET_TYPING", isTyping: !0 }), a({ type: "NAVIGATE_TO", messageId: w }), setTimeout(() => {
302
- const d = H(
303
- g,
304
- c.current++
305
- );
306
- a({ type: "ADD_BUSINESS_MESSAGE", message: d });
307
+ a({ type: "SET_TYPING", isTyping: !0 }), a({ type: "NAVIGATE_TO", messageId: g }), setTimeout(() => {
308
+ U(
309
+ x,
310
+ l.current++
311
+ ).forEach((b) => {
312
+ a({ type: "ADD_BUSINESS_MESSAGE", message: b });
313
+ });
307
314
  }, t);
308
315
  },
309
316
  [s, o.currentMessageId, r, t]
310
- ), m = $(
311
- (h) => {
312
- if (!I(h)) return;
313
- const {
314
- displayText: f,
315
- postback: v,
316
- openUrlAction: b,
317
- dialAction: N,
318
- dialerAction: y,
319
- mapAction: w,
320
- viewLocationAction: g
321
- } = h.action, d = v.data, x = N?.phoneNumber || y?.dialPhoneNumber?.phoneNumber, L = w?.showLocation?.location || g?.latLong;
322
- let z;
323
- b ? z = { type: "openUrl", url: b.url } : x ? z = { type: "dial", phoneNumber: x } : L && (z = {
324
- type: "viewLocation",
325
- latitude: L.latitude,
326
- longitude: L.longitude,
327
- query: g?.query
328
- });
329
- const C = {
330
- type: "action",
331
- postbackData: d,
332
- displayText: f,
333
- timestamp: Date.now(),
334
- actionData: z
335
- };
336
- if (r(C), b)
337
- window.open(b.url, "_blank", "noopener,noreferrer");
338
- else if (x)
339
- window.location.href = `tel:${x}`;
340
- else if (L) {
341
- const M = w?.showLocation?.location?.label || g?.label || "", S = `https://www.google.com/maps/search/?api=1&query=${L.latitude},${L.longitude}${M ? `&query_place_id=${encodeURIComponent(M)}` : ""}`;
342
- window.open(S, "_blank", "noopener,noreferrer");
317
+ ), m = M(
318
+ (d) => {
319
+ if (!T(d)) return;
320
+ const { displayText: h, postback: v, openUrlAction: y } = d.action, k = v.data;
321
+ if (y) {
322
+ const g = {
323
+ type: "action",
324
+ postbackData: k,
325
+ displayText: h,
326
+ timestamp: Date.now(),
327
+ actionData: { type: "openUrl", url: y.url }
328
+ };
329
+ r(g), window.open(y.url, "_blank", "noopener,noreferrer");
343
330
  }
344
- const T = o.currentMessageId ? R(s, o.currentMessageId) : null;
345
- if (T) {
346
- const M = O(T, d);
347
- if (M) {
348
- const S = R(s, M);
349
- S && (a({
331
+ const w = o.currentMessageId ? V(s, o.currentMessageId) : null;
332
+ if (w) {
333
+ const g = Y(w, k);
334
+ if (g) {
335
+ const x = V(s, g);
336
+ x && (a({
350
337
  type: "ADD_USER_REPLY",
351
- text: f,
352
- postbackData: d
353
- }), a({ type: "SET_TYPING", isTyping: !0 }), a({ type: "NAVIGATE_TO", messageId: M }), setTimeout(() => {
354
- const ee = H(
355
- S,
356
- c.current++
357
- );
358
- a({ type: "ADD_BUSINESS_MESSAGE", message: ee });
338
+ text: h,
339
+ postbackData: k
340
+ }), a({ type: "SET_TYPING", isTyping: !0 }), a({ type: "NAVIGATE_TO", messageId: g }), setTimeout(() => {
341
+ U(
342
+ x,
343
+ l.current++
344
+ ).forEach((b) => {
345
+ a({ type: "ADD_BUSINESS_MESSAGE", message: b });
346
+ });
359
347
  }, t));
360
348
  }
361
349
  }
362
350
  },
363
351
  [s, o.currentMessageId, r, t]
364
- ), i = $(() => {
365
- l.current = !1, c.current = 0, a({ type: "RESET" });
352
+ ), u = M(() => {
353
+ c.current = !1, l.current = 0, a({ type: "RESET" });
366
354
  }, []);
367
355
  return {
368
356
  state: o,
369
- handleReply: u,
357
+ handleReply: i,
370
358
  handleAction: m,
371
- reset: i
359
+ reset: u
372
360
  };
373
361
  }
374
- function pe(s) {
375
- const [r, t] = A(null), [o, a] = A(!1), [c, l] = A(null), u = $(async () => {
362
+ function ve(s) {
363
+ const [r, t] = A(null), [o, a] = A(!1), [l, c] = A(null), i = M(async () => {
376
364
  if (!s) {
377
- t(null), l(null);
365
+ t(null), c(null);
378
366
  return;
379
367
  }
380
- a(!0), l(null);
368
+ a(!0), c(null);
381
369
  try {
382
370
  const m = await fetch(s, {
383
371
  method: "GET",
@@ -387,39 +375,39 @@ function pe(s) {
387
375
  });
388
376
  if (!m.ok)
389
377
  throw new Error(`HTTP ${m.status}: ${m.statusText}`);
390
- const i = await m.json();
391
- if (!i || typeof i != "object")
378
+ const u = await m.json();
379
+ if (!u || typeof u != "object")
392
380
  throw new Error("Invalid JSON: Expected an object");
393
- if (!i.messages || typeof i.messages != "object")
381
+ if (!u.messages || typeof u.messages != "object")
394
382
  throw new Error("Invalid RBM JSON: Missing 'messages' object");
395
- t(i);
383
+ t(u);
396
384
  } catch (m) {
397
- const i = m instanceof Error ? m.message : "Failed to fetch JSON";
398
- l(i), t(null);
385
+ const u = m instanceof Error ? m.message : "Failed to fetch JSON";
386
+ c(u), t(null);
399
387
  } finally {
400
388
  a(!1);
401
389
  }
402
390
  }, [s]);
403
- return j(() => {
404
- u();
405
- }, [u]), {
391
+ return B(() => {
392
+ i();
393
+ }, [i]), {
406
394
  data: r,
407
395
  isLoading: o,
408
- error: c,
409
- refetch: u
396
+ error: l,
397
+ refetch: i
410
398
  };
411
399
  }
412
- function ge(s) {
413
- const r = W(null);
414
- return j(() => {
400
+ function we(s) {
401
+ const r = H(null);
402
+ return B(() => {
415
403
  r.current && r.current.scrollTo({
416
404
  top: r.current.scrollHeight,
417
405
  behavior: "smooth"
418
406
  });
419
407
  }, [s]), r;
420
408
  }
421
- const xe = p(function() {
422
- const { theme: r, businessInfo: t, toggleProfile: o } = k(), a = r === "dark", c = a ? "rcs-emulator-dark" : "rcs-emulator-light", l = t.brandColor || "#1A73E8";
409
+ const ye = f(function() {
410
+ const { theme: r, businessInfo: t, toggleProfile: o, handleBack: a } = C(), l = r === "dark", c = l ? "rcs-emulator-dark" : "rcs-emulator-light", i = t.brandColor || "#1A73E8";
423
411
  return /* @__PURE__ */ n(
424
412
  "header",
425
413
  {
@@ -431,7 +419,8 @@ const xe = p(function() {
431
419
  "button",
432
420
  {
433
421
  type: "button",
434
- className: `rcs-emulator-icon-btn rcs-emulator-p-1-5 rcs-emulator--ml-1 ${c} ${a ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-700"}`,
422
+ onClick: a || void 0,
423
+ className: `rcs-emulator-icon-btn rcs-emulator-p-1-5 rcs-emulator--ml-1 ${c} ${l ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-700"}`,
435
424
  "aria-label": "Go back",
436
425
  children: /* @__PURE__ */ e(
437
426
  "svg",
@@ -466,7 +455,7 @@ const xe = p(function() {
466
455
  {
467
456
  className: `rcs-emulator-logo-avatar rcs-emulator-w-9 rcs-emulator-h-9 ${c}`,
468
457
  style: {
469
- backgroundColor: t.logo ? void 0 : l
458
+ backgroundColor: t.logo ? void 0 : i
470
459
  },
471
460
  children: t.logo ? /* @__PURE__ */ e(
472
461
  "img",
@@ -481,7 +470,7 @@ const xe = p(function() {
481
470
  /* @__PURE__ */ e(
482
471
  "h1",
483
472
  {
484
- className: `rcs-emulator-text-base rcs-emulator-font-medium rcs-emulator-truncate ${a ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
473
+ className: `rcs-emulator-text-base rcs-emulator-font-medium rcs-emulator-truncate ${l ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
485
474
  children: t.name
486
475
  }
487
476
  )
@@ -506,7 +495,7 @@ const xe = p(function() {
506
495
  "path",
507
496
  {
508
497
  d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",
509
- stroke: a ? "#9ca3af" : "#6b7280",
498
+ stroke: l ? "#9ca3af" : "#6b7280",
510
499
  strokeWidth: 2,
511
500
  strokeLinecap: "round",
512
501
  strokeLinejoin: "round"
@@ -531,7 +520,7 @@ const xe = p(function() {
531
520
  "button",
532
521
  {
533
522
  type: "button",
534
- className: `rcs-emulator-icon-btn rcs-emulator-p-2 ${c} ${a ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
523
+ className: `rcs-emulator-icon-btn rcs-emulator-p-2 ${c} ${l ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
535
524
  "aria-label": "More options",
536
525
  children: /* @__PURE__ */ e(
537
526
  "svg",
@@ -557,8 +546,8 @@ const xe = p(function() {
557
546
  ]
558
547
  }
559
548
  );
560
- }), be = p(function() {
561
- const { theme: r, businessInfo: t } = k(), o = r === "dark", a = o ? "rcs-emulator-dark" : "rcs-emulator-light", c = t.brandColor || "#0084ff";
549
+ }), ke = f(function() {
550
+ const { theme: r, businessInfo: t } = C(), o = r === "dark", a = o ? "rcs-emulator-dark" : "rcs-emulator-light", l = t.brandColor || "#0084ff";
562
551
  return /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-py-4 rcs-emulator-px-4", children: [
563
552
  /* @__PURE__ */ n("div", { className: "rcs-emulator-relative rcs-emulator-mb-3", children: [
564
553
  /* @__PURE__ */ e(
@@ -566,7 +555,7 @@ const xe = p(function() {
566
555
  {
567
556
  className: `rcs-emulator-logo-avatar rcs-emulator-w-16 rcs-emulator-h-16 rcs-emulator-shadow-lg ${a}`,
568
557
  style: {
569
- backgroundColor: t.logo ? void 0 : c
558
+ backgroundColor: t.logo ? void 0 : l
570
559
  },
571
560
  children: t.logo ? /* @__PURE__ */ e(
572
561
  "img",
@@ -603,12 +592,12 @@ const xe = p(function() {
603
592
  }
604
593
  )
605
594
  ] });
606
- }), ve = p(function({
595
+ }), Ne = f(function({
607
596
  text: r,
608
597
  sender: t,
609
598
  timestamp: o
610
599
  }) {
611
- const { theme: a, businessInfo: c } = k(), u = a === "dark" ? "rcs-emulator-dark" : "rcs-emulator-light", m = t === "business", i = c.brandColor || "#1A73E8", h = new Date(o).toLocaleTimeString([], {
600
+ const { theme: a, businessInfo: l } = C(), i = a === "dark" ? "rcs-emulator-dark" : "rcs-emulator-light", m = t === "business", u = l.brandColor || "#1A73E8", d = new Date(o).toLocaleTimeString([], {
612
601
  hour: "2-digit",
613
602
  minute: "2-digit"
614
603
  });
@@ -616,17 +605,17 @@ const xe = p(function() {
616
605
  /* @__PURE__ */ e(
617
606
  "div",
618
607
  {
619
- className: `rcs-emulator-message-bubble rcs-emulator-business ${u}`,
608
+ className: `rcs-emulator-message-bubble rcs-emulator-business ${i}`,
620
609
  children: r
621
610
  }
622
611
  ),
623
- /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: h })
612
+ /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: d })
624
613
  ] }) : /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-items-end rcs-emulator-gap-1-5 rcs-emulator-max-w-85 rcs-emulator-ml-auto", children: [
625
614
  /* @__PURE__ */ e(
626
615
  "div",
627
616
  {
628
617
  className: "rcs-emulator-message-bubble rcs-emulator-user",
629
- style: { backgroundColor: i },
618
+ style: { backgroundColor: u },
630
619
  children: r
631
620
  }
632
621
  ),
@@ -634,7 +623,7 @@ const xe = p(function() {
634
623
  "div",
635
624
  {
636
625
  className: "rcs-emulator-delivery-status",
637
- style: { backgroundColor: i },
626
+ style: { backgroundColor: u },
638
627
  children: /* @__PURE__ */ e(
639
628
  "svg",
640
629
  {
@@ -648,13 +637,13 @@ const xe = p(function() {
648
637
  )
649
638
  }
650
639
  ),
651
- /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: h })
640
+ /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: d })
652
641
  ] });
653
- }), ye = p(function({
642
+ }), Ce = f(function({
654
643
  text: r,
655
644
  timestamp: t
656
645
  }) {
657
- const { businessInfo: o } = k(), a = o.brandColor || "#1A73E8", c = new Date(t).toLocaleTimeString([], {
646
+ const { businessInfo: o } = C(), a = o.brandColor || "#1A73E8", l = new Date(t).toLocaleTimeString([], {
658
647
  hour: "2-digit",
659
648
  minute: "2-digit"
660
649
  });
@@ -692,18 +681,18 @@ const xe = p(function() {
692
681
  )
693
682
  }
694
683
  ),
695
- /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: c })
684
+ /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: l })
696
685
  ] });
697
- }), we = p(function({
686
+ }), Le = f(function({
698
687
  card: r,
699
688
  timestamp: t
700
689
  }) {
701
- const { theme: o, handleReply: a, handleAction: c } = k(), l = o === "dark", u = l ? "rcs-emulator-dark" : "rcs-emulator-light", m = new Date(t).toLocaleTimeString([], {
690
+ const { theme: o, handleReply: a, handleAction: l } = C(), c = o === "dark", i = c ? "rcs-emulator-dark" : "rcs-emulator-light", m = new Date(t).toLocaleTimeString([], {
702
691
  hour: "2-digit",
703
692
  minute: "2-digit"
704
- }), i = (f) => {
705
- "reply" in f ? a(f) : c(f);
706
- }, h = {
693
+ }), u = (h) => {
694
+ "reply" in h ? a(h) : l(h);
695
+ }, d = {
707
696
  short: "rcs-emulator-h-36",
708
697
  medium: "rcs-emulator-h-44",
709
698
  tall: "rcs-emulator-h-56"
@@ -712,12 +701,12 @@ const xe = p(function() {
712
701
  /* @__PURE__ */ n(
713
702
  "div",
714
703
  {
715
- className: `rcs-emulator-rich-card ${u}`,
704
+ className: `rcs-emulator-rich-card ${i}`,
716
705
  children: [
717
706
  r.media && /* @__PURE__ */ e(
718
707
  "div",
719
708
  {
720
- className: `rcs-emulator-w-full rcs-emulator-overflow-hidden rcs-emulator-media-placeholder ${h[r.media.height]} ${l ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
709
+ className: `rcs-emulator-w-full rcs-emulator-overflow-hidden rcs-emulator-media-placeholder ${d[r.media.height]} ${c ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
721
710
  style: { borderRadius: "12px 12px 0 0" },
722
711
  children: /* @__PURE__ */ e(
723
712
  "img",
@@ -726,8 +715,8 @@ const xe = p(function() {
726
715
  alt: r.title || "Rich card media",
727
716
  className: "rcs-emulator-w-full rcs-emulator-h-full rcs-emulator-object-cover",
728
717
  loading: "lazy",
729
- onError: (f) => {
730
- const v = f.target;
718
+ onError: (h) => {
719
+ const v = h.target;
731
720
  v.style.display = "none";
732
721
  }
733
722
  }
@@ -738,27 +727,27 @@ const xe = p(function() {
738
727
  r.title && /* @__PURE__ */ e(
739
728
  "h3",
740
729
  {
741
- className: `rcs-emulator-text-base rcs-emulator-font-semibold rcs-emulator-leading-snug rcs-emulator-card-title ${l ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
730
+ className: `rcs-emulator-text-base rcs-emulator-font-semibold rcs-emulator-leading-snug rcs-emulator-card-title ${c ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
742
731
  children: r.title
743
732
  }
744
733
  ),
745
734
  r.description && /* @__PURE__ */ e(
746
735
  "p",
747
736
  {
748
- className: `rcs-emulator-text-sm rcs-emulator-leading-relaxed rcs-emulator-mt-1-5 rcs-emulator-card-subtitle ${l ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
737
+ className: `rcs-emulator-text-sm rcs-emulator-leading-relaxed rcs-emulator-mt-1-5 rcs-emulator-card-subtitle ${c ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
749
738
  children: r.description
750
739
  }
751
740
  ),
752
741
  r.suggestions && r.suggestions.length > 0 && /* @__PURE__ */ e(
753
742
  "div",
754
743
  {
755
- className: `rcs-emulator-card-actions rcs-emulator-mt-4 rcs-emulator-divide-y ${l ? "rcs-emulator-divide-zinc-700" : "rcs-emulator-divide-gray-100"} ${u}`,
756
- children: r.suggestions.map((f, v) => /* @__PURE__ */ e(
757
- Me,
744
+ className: `rcs-emulator-card-actions rcs-emulator-mt-4 rcs-emulator-divide-y ${c ? "rcs-emulator-divide-zinc-700" : "rcs-emulator-divide-gray-100"} ${i}`,
745
+ children: r.suggestions.map((h, v) => /* @__PURE__ */ e(
746
+ ze,
758
747
  {
759
- suggestion: f,
760
- onClick: () => i(f),
761
- isDark: l
748
+ suggestion: h,
749
+ onClick: () => u(h),
750
+ isDark: c
762
751
  },
763
752
  v
764
753
  ))
@@ -770,15 +759,15 @@ const xe = p(function() {
770
759
  ),
771
760
  /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: m })
772
761
  ] });
773
- }), B = "rcs-emulator-w-5 rcs-emulator-h-5 rcs-emulator-text-gray-400", ke = () => /* @__PURE__ */ e("svg", { className: B, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" }) }), Ne = () => /* @__PURE__ */ e("svg", { className: B, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), Ce = () => /* @__PURE__ */ n("svg", { className: B, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
762
+ }), W = "rcs-emulator-w-5 rcs-emulator-h-5 rcs-emulator-text-gray-400", Me = () => /* @__PURE__ */ e("svg", { className: W, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" }) }), $e = () => /* @__PURE__ */ e("svg", { className: W, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), Ae = () => /* @__PURE__ */ n("svg", { className: W, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
774
763
  /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }),
775
764
  /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
776
- ] }), Le = () => /* @__PURE__ */ e("svg", { className: B, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), G = () => /* @__PURE__ */ e("svg", { className: B, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), Me = p(function({
765
+ ] }), Ie = () => /* @__PURE__ */ e("svg", { className: W, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), Q = () => /* @__PURE__ */ e("svg", { className: W, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), ze = f(function({
777
766
  suggestion: r,
778
767
  onClick: t,
779
768
  isDark: o
780
769
  }) {
781
- const a = I(r), c = a ? r.action.displayText : r.reply.displayText;
770
+ const a = T(r), l = a ? r.action.displayText : r.reply.displayText;
782
771
  return /* @__PURE__ */ n(
783
772
  "button",
784
773
  {
@@ -787,40 +776,40 @@ const xe = p(function() {
787
776
  style: { gap: "0.75rem", padding: "0.75rem 1rem" },
788
777
  children: [
789
778
  /* @__PURE__ */ e("span", { className: "rcs-emulator-flex-shrink-0", children: (() => {
790
- if (!a) return /* @__PURE__ */ e(G, {});
791
- const { action: u } = r;
792
- return u.urlAction || u.openUrlAction ? /* @__PURE__ */ e(ke, {}) : u.dialerAction || u.dialAction ? /* @__PURE__ */ e(Ne, {}) : u.mapAction || u.viewLocationAction ? /* @__PURE__ */ e(Ce, {}) : u.calendarAction || u.createCalendarEventAction ? /* @__PURE__ */ e(Le, {}) : /* @__PURE__ */ e(G, {});
779
+ if (!a) return /* @__PURE__ */ e(Q, {});
780
+ const { action: i } = r;
781
+ return i.urlAction || i.openUrlAction ? /* @__PURE__ */ e(Me, {}) : i.dialerAction || i.dialAction ? /* @__PURE__ */ e($e, {}) : i.mapAction || i.viewLocationAction ? /* @__PURE__ */ e(Ae, {}) : i.calendarAction || i.createCalendarEventAction ? /* @__PURE__ */ e(Ie, {}) : /* @__PURE__ */ e(Q, {});
793
782
  })() }),
794
- /* @__PURE__ */ e("span", { className: `rcs-emulator-text-sm ${o ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`, children: c })
783
+ /* @__PURE__ */ e("span", { className: `rcs-emulator-text-sm ${o ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`, children: l })
795
784
  ]
796
785
  }
797
786
  );
798
- }), $e = p(function({
787
+ }), Te = f(function({
799
788
  cards: r,
800
789
  timestamp: t
801
790
  }) {
802
- const { theme: o, handleReply: a, handleAction: c } = k(), l = W(null), [u, m] = A(!1), [i, h] = A(r.length > 1), f = o === "dark", v = f ? "rcs-emulator-dark" : "rcs-emulator-light", b = new Date(t).toLocaleTimeString([], {
791
+ const { theme: o, handleReply: a, handleAction: l } = C(), c = H(null), [i, m] = A(!1), [u, d] = A(r.length > 1), h = o === "dark", v = h ? "rcs-emulator-dark" : "rcs-emulator-light", y = new Date(t).toLocaleTimeString([], {
803
792
  hour: "2-digit",
804
793
  minute: "2-digit"
805
- }), N = (g) => {
806
- "reply" in g ? a(g) : c(g);
807
- }, y = $(() => {
808
- if (l.current) {
809
- const { scrollLeft: g, scrollWidth: d, clientWidth: x } = l.current;
810
- m(g > 0), h(g < d - x - 10);
794
+ }), k = (x) => {
795
+ "reply" in x ? a(x) : l(x);
796
+ }, w = M(() => {
797
+ if (c.current) {
798
+ const { scrollLeft: x, scrollWidth: L, clientWidth: b } = c.current;
799
+ m(x > 0), d(x < L - b - 10);
811
800
  }
812
- }, []), w = (g) => {
813
- l.current && l.current.scrollBy({
814
- left: g === "left" ? -200 : 200,
801
+ }, []), g = (x) => {
802
+ c.current && c.current.scrollBy({
803
+ left: x === "left" ? -200 : 200,
815
804
  behavior: "smooth"
816
805
  });
817
806
  };
818
807
  return /* @__PURE__ */ n("div", { className: "rcs-emulator-w-full rcs-emulator--mx-3", children: [
819
808
  /* @__PURE__ */ n("div", { className: "rcs-emulator-relative", children: [
820
- u && /* @__PURE__ */ e(
809
+ i && /* @__PURE__ */ e(
821
810
  "button",
822
811
  {
823
- onClick: () => w("left"),
812
+ onClick: () => g("left"),
824
813
  className: `rcs-emulator-carousel-arrow rcs-emulator-left ${v}`,
825
814
  "aria-label": "Scroll left",
826
815
  children: /* @__PURE__ */ e(
@@ -846,24 +835,24 @@ const xe = p(function() {
846
835
  /* @__PURE__ */ e(
847
836
  "div",
848
837
  {
849
- ref: l,
850
- onScroll: y,
838
+ ref: c,
839
+ onScroll: w,
851
840
  className: "rcs-emulator-flex rcs-emulator-gap-2-5 rcs-emulator-overflow-x-auto rcs-emulator-py-1 rcs-emulator-px-3 rcs-emulator-snap-x rcs-emulator-scrollbar-hide",
852
- children: r.map((g, d) => /* @__PURE__ */ e(
853
- Ie,
841
+ children: r.map((x, L) => /* @__PURE__ */ e(
842
+ Se,
854
843
  {
855
- card: g,
856
- isDark: f,
857
- onSuggestionClick: N
844
+ card: x,
845
+ isDark: h,
846
+ onSuggestionClick: k
858
847
  },
859
- d
848
+ L
860
849
  ))
861
850
  }
862
851
  ),
863
- i && /* @__PURE__ */ e(
852
+ u && /* @__PURE__ */ e(
864
853
  "button",
865
854
  {
866
- onClick: () => w("right"),
855
+ onClick: () => g("right"),
867
856
  className: `rcs-emulator-carousel-arrow rcs-emulator-right ${v}`,
868
857
  "aria-label": "Scroll right",
869
858
  children: /* @__PURE__ */ e(
@@ -887,14 +876,14 @@ const xe = p(function() {
887
876
  }
888
877
  )
889
878
  ] }),
890
- /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: b })
879
+ /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: y })
891
880
  ] });
892
- }), E = "rcs-emulator-w-4 rcs-emulator-h-4 rcs-emulator-text-gray-400", Ae = (s) => {
893
- if (!I(s))
881
+ }), j = "rcs-emulator-w-4 rcs-emulator-h-4 rcs-emulator-text-gray-400", Ee = (s) => {
882
+ if (!T(s))
894
883
  return /* @__PURE__ */ e(
895
884
  "svg",
896
885
  {
897
- className: E,
886
+ className: j,
898
887
  fill: "none",
899
888
  viewBox: "0 0 24 24",
900
889
  stroke: "currentColor",
@@ -913,7 +902,7 @@ const xe = p(function() {
913
902
  return r.urlAction || r.openUrlAction ? /* @__PURE__ */ e(
914
903
  "svg",
915
904
  {
916
- className: E,
905
+ className: j,
917
906
  fill: "none",
918
907
  viewBox: "0 0 24 24",
919
908
  stroke: "currentColor",
@@ -930,7 +919,7 @@ const xe = p(function() {
930
919
  ) : r.dialerAction || r.dialAction ? /* @__PURE__ */ e(
931
920
  "svg",
932
921
  {
933
- className: E,
922
+ className: j,
934
923
  fill: "none",
935
924
  viewBox: "0 0 24 24",
936
925
  stroke: "currentColor",
@@ -947,7 +936,7 @@ const xe = p(function() {
947
936
  ) : r.mapAction || r.viewLocationAction ? /* @__PURE__ */ n(
948
937
  "svg",
949
938
  {
950
- className: E,
939
+ className: j,
951
940
  fill: "none",
952
941
  viewBox: "0 0 24 24",
953
942
  stroke: "currentColor",
@@ -974,7 +963,7 @@ const xe = p(function() {
974
963
  ) : r.calendarAction || r.createCalendarEventAction ? /* @__PURE__ */ e(
975
964
  "svg",
976
965
  {
977
- className: E,
966
+ className: j,
978
967
  fill: "none",
979
968
  viewBox: "0 0 24 24",
980
969
  stroke: "currentColor",
@@ -991,7 +980,7 @@ const xe = p(function() {
991
980
  ) : /* @__PURE__ */ e(
992
981
  "svg",
993
982
  {
994
- className: E,
983
+ className: j,
995
984
  fill: "none",
996
985
  viewBox: "0 0 24 24",
997
986
  stroke: "currentColor",
@@ -1006,13 +995,13 @@ const xe = p(function() {
1006
995
  )
1007
996
  }
1008
997
  );
1009
- }, Ie = p(function({
998
+ }, Se = f(function({
1010
999
  card: r,
1011
1000
  isDark: t,
1012
1001
  onSuggestionClick: o
1013
1002
  }) {
1014
- const a = r.layout.width === "small" ? "rcs-emulator-w-44" : "rcs-emulator-w-52", c = t ? "rcs-emulator-dark" : "rcs-emulator-light";
1015
- return /* @__PURE__ */ n("div", { className: `rcs-emulator-carousel-card ${a} ${c}`, children: [
1003
+ const a = r.layout.width === "small" ? "rcs-emulator-w-44" : "rcs-emulator-w-52", l = t ? "rcs-emulator-dark" : "rcs-emulator-light";
1004
+ return /* @__PURE__ */ n("div", { className: `rcs-emulator-carousel-card ${a} ${l}`, children: [
1016
1005
  r.media && /* @__PURE__ */ e("div", { className: "rcs-emulator-w-full rcs-emulator-h-32 rcs-emulator-bg-gray-200 rcs-emulator-overflow-hidden", children: /* @__PURE__ */ e(
1017
1006
  "img",
1018
1007
  {
@@ -1040,47 +1029,47 @@ const xe = p(function() {
1040
1029
  r.suggestions && r.suggestions.length > 0 && /* @__PURE__ */ e(
1041
1030
  "div",
1042
1031
  {
1043
- className: `rcs-emulator-carousel-actions rcs-emulator-mt-3 rcs-emulator-divide-y ${t ? "rcs-emulator-divide-zinc-600" : "rcs-emulator-divide-gray-100"} ${c}`,
1044
- children: r.suggestions.map((l, u) => {
1045
- const i = I(l) ? l.action.displayText : l.reply.displayText;
1032
+ className: `rcs-emulator-carousel-actions rcs-emulator-mt-3 rcs-emulator-divide-y ${t ? "rcs-emulator-divide-zinc-600" : "rcs-emulator-divide-gray-100"} ${l}`,
1033
+ children: r.suggestions.map((c, i) => {
1034
+ const u = T(c) ? c.action.displayText : c.reply.displayText;
1046
1035
  return /* @__PURE__ */ n(
1047
1036
  "button",
1048
1037
  {
1049
- onClick: () => o(l),
1038
+ onClick: () => o(c),
1050
1039
  className: `rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-2 rcs-emulator-px-3 rcs-emulator-py-2-5 rcs-emulator-text-xs rcs-emulator-transition-colors rcs-emulator-text-left rcs-emulator-border-none ${t ? "rcs-emulator-hover-bg-zinc-700 rcs-emulator-text-white" : "rcs-emulator-hover-bg-gray-50 rcs-emulator-text-gray-900"}`,
1051
1040
  children: [
1052
- /* @__PURE__ */ e("span", { className: "rcs-emulator-flex-shrink-0", children: Ae(l) }),
1053
- /* @__PURE__ */ e("span", { className: "rcs-emulator-truncate", children: i })
1041
+ /* @__PURE__ */ e("span", { className: "rcs-emulator-flex-shrink-0", children: Ee(c) }),
1042
+ /* @__PURE__ */ e("span", { className: "rcs-emulator-truncate", children: u })
1054
1043
  ]
1055
1044
  },
1056
- u
1045
+ i
1057
1046
  );
1058
1047
  })
1059
1048
  }
1060
1049
  )
1061
1050
  ] })
1062
1051
  ] });
1063
- }), ze = {
1064
- text: ({ content: s, sender: r, timestamp: t }) => s.type !== "text" ? null : /* @__PURE__ */ e(ve, { text: s.text, sender: r, timestamp: t }),
1065
- userReply: ({ content: s, timestamp: r }) => s.type !== "userReply" ? null : /* @__PURE__ */ e(ye, { text: s.text, timestamp: r }),
1066
- richcard: ({ content: s, timestamp: r }) => s.type !== "richcard" ? null : /* @__PURE__ */ e(we, { card: s.card, timestamp: r }),
1067
- carousel: ({ content: s, timestamp: r }) => s.type !== "carousel" ? null : /* @__PURE__ */ e($e, { cards: s.cards, timestamp: r })
1068
- }, Te = p(function({
1052
+ }), je = {
1053
+ text: ({ content: s, sender: r, timestamp: t }) => s.type !== "text" ? null : /* @__PURE__ */ e(Ne, { text: s.text, sender: r, timestamp: t }),
1054
+ userReply: ({ content: s, timestamp: r }) => s.type !== "userReply" ? null : /* @__PURE__ */ e(Ce, { text: s.text, timestamp: r }),
1055
+ richcard: ({ content: s, timestamp: r }) => s.type !== "richcard" ? null : /* @__PURE__ */ e(Le, { card: s.card, timestamp: r }),
1056
+ carousel: ({ content: s, timestamp: r }) => s.type !== "carousel" ? null : /* @__PURE__ */ e(Te, { cards: s.cards, timestamp: r })
1057
+ }, Be = f(function({
1069
1058
  message: r,
1070
1059
  isLast: t
1071
1060
  }) {
1072
- const { content: o, sender: a, timestamp: c } = r, l = ze[o.type];
1073
- return l ? /* @__PURE__ */ e(
1074
- l,
1061
+ const { content: o, sender: a, timestamp: l } = r, c = je[o.type];
1062
+ return c ? /* @__PURE__ */ e(
1063
+ c,
1075
1064
  {
1076
1065
  content: o,
1077
1066
  sender: a,
1078
- timestamp: c,
1067
+ timestamp: l,
1079
1068
  showSuggestions: t && a === "business"
1080
1069
  }
1081
1070
  ) : (console.warn(`Unknown message type: ${o.type}`), /* @__PURE__ */ e("div", { className: "rcs-emulator-px-4 rcs-emulator-py-2 rcs-emulator-text-gray-500 rcs-emulator-text-sm rcs-emulator-italic", children: "[Unsupported message type]" }));
1082
- }), Se = p(function() {
1083
- const { theme: r } = k(), t = r === "dark";
1071
+ }), We = f(function() {
1072
+ const { theme: r } = C(), t = r === "dark";
1084
1073
  return /* @__PURE__ */ e(
1085
1074
  "div",
1086
1075
  {
@@ -1115,8 +1104,8 @@ const xe = p(function() {
1115
1104
  )
1116
1105
  }
1117
1106
  );
1118
- }), Ee = p(function() {
1119
- const { theme: r, state: t } = k(), { chatHistory: o, isTyping: a } = t, c = r === "dark", l = c ? "rcs-emulator-dark" : "rcs-emulator-light";
1107
+ }), Re = f(function() {
1108
+ const { theme: r, state: t } = C(), { chatHistory: o, isTyping: a } = t, l = r === "dark", c = l ? "rcs-emulator-dark" : "rcs-emulator-light";
1120
1109
  return /* @__PURE__ */ n(
1121
1110
  "div",
1122
1111
  {
@@ -1128,32 +1117,32 @@ const xe = p(function() {
1128
1117
  o.length > 0 && /* @__PURE__ */ e("div", { className: "rcs-emulator-flex rcs-emulator-justify-center rcs-emulator-py-2", children: /* @__PURE__ */ e(
1129
1118
  "span",
1130
1119
  {
1131
- className: `rcs-emulator-text-xs rcs-emulator-font-medium rcs-emulator-px-3 rcs-emulator-py-1 ${c ? "rcs-emulator-text-zinc-500" : "rcs-emulator-text-gray-500"}`,
1120
+ className: `rcs-emulator-text-xs rcs-emulator-font-medium rcs-emulator-px-3 rcs-emulator-py-1 ${l ? "rcs-emulator-text-zinc-500" : "rcs-emulator-text-gray-500"}`,
1132
1121
  children: "Today"
1133
1122
  }
1134
1123
  ) }),
1135
1124
  /* @__PURE__ */ n(
1136
1125
  "div",
1137
1126
  {
1138
- className: `rcs-emulator-messages-container ${l}`,
1127
+ className: `rcs-emulator-messages-container ${c}`,
1139
1128
  children: [
1140
- o.length === 0 && !a && /* @__PURE__ */ e("div", { className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-py-12", children: /* @__PURE__ */ e("p", { className: `rcs-emulator-text-sm ${c ? "rcs-emulator-text-zinc-500" : "rcs-emulator-text-gray-400"}`, children: "No messages yet" }) }),
1129
+ o.length === 0 && !a && /* @__PURE__ */ e("div", { className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-py-12", children: /* @__PURE__ */ e("p", { className: `rcs-emulator-text-sm ${l ? "rcs-emulator-text-zinc-500" : "rcs-emulator-text-gray-400"}`, children: "No messages yet" }) }),
1141
1130
  /* @__PURE__ */ n("div", { className: "rcs-emulator-p-3 rcs-emulator-space-y-3", children: [
1142
- o.map((u, m) => /* @__PURE__ */ e(
1131
+ o.map((i, m) => /* @__PURE__ */ e(
1143
1132
  "div",
1144
1133
  {
1145
- className: `rcs-emulator-flex ${u.sender === "user" ? "rcs-emulator-justify-end" : "rcs-emulator-justify-start"}`,
1134
+ className: `rcs-emulator-flex ${i.sender === "user" ? "rcs-emulator-justify-end" : "rcs-emulator-justify-start"}`,
1146
1135
  children: /* @__PURE__ */ e(
1147
- Te,
1136
+ Be,
1148
1137
  {
1149
- message: u,
1138
+ message: i,
1150
1139
  isLast: m === o.length - 1 && !a
1151
1140
  }
1152
1141
  )
1153
1142
  },
1154
- u.id
1143
+ i.id
1155
1144
  )),
1156
- a && /* @__PURE__ */ e(Se, {})
1145
+ a && /* @__PURE__ */ e(We, {})
1157
1146
  ] })
1158
1147
  ]
1159
1148
  }
@@ -1161,21 +1150,21 @@ const xe = p(function() {
1161
1150
  ]
1162
1151
  }
1163
1152
  );
1164
- }), je = p(function({
1153
+ }), Ve = f(function({
1165
1154
  suggestion: r,
1166
1155
  onClick: t,
1167
1156
  variant: o = "bar"
1168
1157
  }) {
1169
- const { theme: a, businessInfo: c } = k(), l = a === "dark", u = I(r), m = u ? r.action.displayText : r.reply.displayText, i = u ? Be(r) : null, h = c.brandColor || "#1A73E8", f = l ? "rcs-emulator-dark" : "rcs-emulator-light";
1158
+ const { theme: a, businessInfo: l } = C(), c = a === "dark", i = T(r), m = i ? r.action.displayText : r.reply.displayText, u = i ? Oe(r) : null, d = l.brandColor || "#1A73E8", h = c ? "rcs-emulator-dark" : "rcs-emulator-light";
1170
1159
  return o === "bar" ? /* @__PURE__ */ n(
1171
1160
  "button",
1172
1161
  {
1173
1162
  type: "button",
1174
1163
  onClick: t,
1175
- className: `rcs-emulator-suggestion-chip rcs-emulator-inline-flex rcs-emulator-items-center rcs-emulator-gap-2 rcs-emulator-px-4 rcs-emulator-py-2 rcs-emulator-rounded-full rcs-emulator-text-sm rcs-emulator-font-medium rcs-emulator-whitespace-nowrap rcs-emulator-transition-colors rcs-emulator-flex-shrink-0 rcs-emulator-border ${f}`,
1176
- "aria-label": u ? `${Re(r)}: ${m}` : m,
1164
+ className: `rcs-emulator-suggestion-chip rcs-emulator-inline-flex rcs-emulator-items-center rcs-emulator-gap-2 rcs-emulator-px-4 rcs-emulator-py-2 rcs-emulator-rounded-full rcs-emulator-text-sm rcs-emulator-font-medium rcs-emulator-whitespace-nowrap rcs-emulator-transition-colors rcs-emulator-flex-shrink-0 rcs-emulator-border ${h}`,
1165
+ "aria-label": i ? `${Ue(r)}: ${m}` : m,
1177
1166
  children: [
1178
- i && /* @__PURE__ */ e("span", { style: { color: h }, children: /* @__PURE__ */ e(i, { className: "rcs-emulator-w-4 rcs-emulator-h-4" }) }),
1167
+ u && /* @__PURE__ */ e("span", { style: { color: d }, children: /* @__PURE__ */ e(u, { className: "rcs-emulator-w-4 rcs-emulator-h-4" }) }),
1179
1168
  /* @__PURE__ */ e("span", { className: "rcs-emulator-text-sm rcs-emulator-font-medium", children: m })
1180
1169
  ]
1181
1170
  }
@@ -1184,18 +1173,18 @@ const xe = p(function() {
1184
1173
  {
1185
1174
  type: "button",
1186
1175
  onClick: t,
1187
- className: `rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-3 rcs-emulator-py-2-5 rcs-emulator-text-left rcs-emulator-transition-colors rcs-emulator-rounded-lg rcs-emulator-list-item rcs-emulator-border-none ${f}`,
1176
+ className: `rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-3 rcs-emulator-py-2-5 rcs-emulator-text-left rcs-emulator-transition-colors rcs-emulator-rounded-lg rcs-emulator-list-item rcs-emulator-border-none ${h}`,
1188
1177
  children: [
1189
- i && /* @__PURE__ */ e(
1178
+ u && /* @__PURE__ */ e(
1190
1179
  "div",
1191
1180
  {
1192
1181
  className: "rcs-emulator-w-8 rcs-emulator-h-8 rcs-emulator-rounded-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-flex-shrink-0",
1193
- style: { backgroundColor: `${h}15` },
1182
+ style: { backgroundColor: `${d}15` },
1194
1183
  children: /* @__PURE__ */ e(
1195
- i,
1184
+ u,
1196
1185
  {
1197
1186
  className: "rcs-emulator-w-4 rcs-emulator-h-4",
1198
- style: { color: h }
1187
+ style: { color: d }
1199
1188
  }
1200
1189
  )
1201
1190
  }
@@ -1203,7 +1192,7 @@ const xe = p(function() {
1203
1192
  /* @__PURE__ */ e(
1204
1193
  "span",
1205
1194
  {
1206
- className: `rcs-emulator-text-sm rcs-emulator-font-medium ${l ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
1195
+ className: `rcs-emulator-text-sm rcs-emulator-font-medium ${c ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
1207
1196
  children: m
1208
1197
  }
1209
1198
  )
@@ -1214,155 +1203,127 @@ const xe = p(function() {
1214
1203
  {
1215
1204
  type: "button",
1216
1205
  onClick: t,
1217
- className: `rcs-emulator-w-full rcs-emulator-px-3 rcs-emulator-py-2 rcs-emulator-rounded-lg rcs-emulator-text-xs rcs-emulator-font-medium rcs-emulator-text-center rcs-emulator-border rcs-emulator-transition-colors ${l ? "rcs-emulator-border-zinc-600 rcs-emulator-hover-bg-zinc-700 rcs-emulator-text-white" : "rcs-emulator-border-gray-300 rcs-emulator-hover-bg-gray-50 rcs-emulator-text-gray-900"}`,
1206
+ className: `rcs-emulator-w-full rcs-emulator-px-3 rcs-emulator-py-2 rcs-emulator-rounded-lg rcs-emulator-text-xs rcs-emulator-font-medium rcs-emulator-text-center rcs-emulator-border rcs-emulator-transition-colors ${c ? "rcs-emulator-border-zinc-600 rcs-emulator-hover-bg-zinc-700 rcs-emulator-text-white" : "rcs-emulator-border-gray-300 rcs-emulator-hover-bg-gray-50 rcs-emulator-text-gray-900"}`,
1218
1207
  children: m
1219
1208
  }
1220
1209
  );
1221
- });
1222
- function Be(s) {
1223
- if (!I(s)) return null;
1224
- const { action: r } = s;
1225
- return r.openUrlAction ? ({ className: t, style: o }) => /* @__PURE__ */ e(
1226
- "svg",
1227
- {
1228
- className: t,
1229
- style: o,
1230
- fill: "none",
1231
- viewBox: "0 0 24 24",
1232
- stroke: "currentColor",
1233
- strokeWidth: 2,
1234
- children: /* @__PURE__ */ e(
1235
- "path",
1236
- {
1237
- strokeLinecap: "round",
1238
- strokeLinejoin: "round",
1239
- d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"
1240
- }
1241
- )
1242
- }
1243
- ) : r.dialAction ? ({ className: t, style: o }) => /* @__PURE__ */ e(
1244
- "svg",
1245
- {
1246
- className: t,
1247
- style: o,
1248
- fill: "none",
1249
- viewBox: "0 0 24 24",
1250
- stroke: "currentColor",
1251
- strokeWidth: 2,
1252
- children: /* @__PURE__ */ e(
1210
+ }), He = ({ className: s, style: r }) => /* @__PURE__ */ e(
1211
+ "svg",
1212
+ {
1213
+ className: s,
1214
+ style: r,
1215
+ fill: "none",
1216
+ viewBox: "0 0 24 24",
1217
+ stroke: "currentColor",
1218
+ strokeWidth: 2,
1219
+ children: /* @__PURE__ */ e(
1220
+ "path",
1221
+ {
1222
+ strokeLinecap: "round",
1223
+ strokeLinejoin: "round",
1224
+ d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"
1225
+ }
1226
+ )
1227
+ }
1228
+ ), De = ({ className: s, style: r }) => /* @__PURE__ */ e(
1229
+ "svg",
1230
+ {
1231
+ className: s,
1232
+ style: r,
1233
+ fill: "none",
1234
+ viewBox: "0 0 24 24",
1235
+ stroke: "currentColor",
1236
+ strokeWidth: 2,
1237
+ children: /* @__PURE__ */ e(
1238
+ "path",
1239
+ {
1240
+ strokeLinecap: "round",
1241
+ strokeLinejoin: "round",
1242
+ d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
1243
+ }
1244
+ )
1245
+ }
1246
+ ), Pe = ({ className: s, style: r }) => /* @__PURE__ */ n(
1247
+ "svg",
1248
+ {
1249
+ className: s,
1250
+ style: r,
1251
+ fill: "none",
1252
+ viewBox: "0 0 24 24",
1253
+ stroke: "currentColor",
1254
+ strokeWidth: 2,
1255
+ children: [
1256
+ /* @__PURE__ */ e(
1253
1257
  "path",
1254
1258
  {
1255
1259
  strokeLinecap: "round",
1256
1260
  strokeLinejoin: "round",
1257
- d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
1261
+ d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
1258
1262
  }
1259
- )
1260
- }
1261
- ) : r.shareLocationAction ? ({ className: t, style: o }) => /* @__PURE__ */ n(
1262
- "svg",
1263
- {
1264
- className: t,
1265
- style: o,
1266
- fill: "none",
1267
- viewBox: "0 0 24 24",
1268
- stroke: "currentColor",
1269
- strokeWidth: 2,
1270
- children: [
1271
- /* @__PURE__ */ e(
1272
- "path",
1273
- {
1274
- strokeLinecap: "round",
1275
- strokeLinejoin: "round",
1276
- d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
1277
- }
1278
- ),
1279
- /* @__PURE__ */ e(
1280
- "path",
1281
- {
1282
- strokeLinecap: "round",
1283
- strokeLinejoin: "round",
1284
- d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
1285
- }
1286
- )
1287
- ]
1288
- }
1289
- ) : r.viewLocationAction ? ({ className: t, style: o }) => /* @__PURE__ */ n(
1290
- "svg",
1291
- {
1292
- className: t,
1293
- style: o,
1294
- fill: "none",
1295
- viewBox: "0 0 24 24",
1296
- stroke: "currentColor",
1297
- strokeWidth: 2,
1298
- children: [
1299
- /* @__PURE__ */ e(
1300
- "path",
1301
- {
1302
- strokeLinecap: "round",
1303
- strokeLinejoin: "round",
1304
- d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
1305
- }
1306
- ),
1307
- /* @__PURE__ */ e(
1308
- "path",
1309
- {
1310
- strokeLinecap: "round",
1311
- strokeLinejoin: "round",
1312
- d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
1313
- }
1314
- )
1315
- ]
1316
- }
1317
- ) : r.createCalendarEventAction ? ({ className: t, style: o }) => /* @__PURE__ */ e(
1318
- "svg",
1319
- {
1320
- className: t,
1321
- style: o,
1322
- fill: "none",
1323
- viewBox: "0 0 24 24",
1324
- stroke: "currentColor",
1325
- strokeWidth: 2,
1326
- children: /* @__PURE__ */ e(
1263
+ ),
1264
+ /* @__PURE__ */ e(
1327
1265
  "path",
1328
1266
  {
1329
1267
  strokeLinecap: "round",
1330
1268
  strokeLinejoin: "round",
1331
- d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
1269
+ d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
1332
1270
  }
1333
1271
  )
1334
- }
1335
- ) : null;
1272
+ ]
1273
+ }
1274
+ ), _e = ({ className: s, style: r }) => /* @__PURE__ */ e(
1275
+ "svg",
1276
+ {
1277
+ className: s,
1278
+ style: r,
1279
+ fill: "none",
1280
+ viewBox: "0 0 24 24",
1281
+ stroke: "currentColor",
1282
+ strokeWidth: 2,
1283
+ children: /* @__PURE__ */ e(
1284
+ "path",
1285
+ {
1286
+ strokeLinecap: "round",
1287
+ strokeLinejoin: "round",
1288
+ d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
1289
+ }
1290
+ )
1291
+ }
1292
+ );
1293
+ function Oe(s) {
1294
+ if (!T(s)) return null;
1295
+ const { action: r } = s;
1296
+ return r.openUrlAction || r.urlAction ? He : r.dialAction || r.dialerAction ? De : r.shareLocationAction || r.viewLocationAction || r.mapAction ? Pe : r.createCalendarEventAction || r.calendarAction ? _e : null;
1336
1297
  }
1337
- function Re(s) {
1338
- if (!I(s)) return "Reply";
1298
+ function Ue(s) {
1299
+ if (!T(s)) return "Reply";
1339
1300
  const { action: r } = s;
1340
- return r.openUrlAction ? "Open link" : r.dialAction ? "Call" : r.shareLocationAction ? "Share location" : r.viewLocationAction ? "View location" : r.createCalendarEventAction ? "Add to calendar" : "Action";
1301
+ return r.openUrlAction || r.urlAction ? "Open link" : r.dialAction || r.dialerAction ? "Call" : r.shareLocationAction ? "Share location" : r.viewLocationAction || r.mapAction ? "View location" : r.createCalendarEventAction || r.calendarAction ? "Add to calendar" : "Action";
1341
1302
  }
1342
- const We = p(function({
1303
+ const Ge = f(function({
1343
1304
  suggestions: r
1344
1305
  }) {
1345
- const { theme: t, handleReply: o, handleAction: a } = k(), c = t === "dark";
1306
+ const { theme: t, handleReply: o, handleAction: a } = C(), l = t === "dark";
1346
1307
  if (!r || r.length === 0)
1347
1308
  return null;
1348
- const l = (u) => {
1349
- Y(u) ? o(u) : I(u) && a(u);
1309
+ const c = (i) => {
1310
+ ee(i) ? o(i) : T(i) && a(i);
1350
1311
  };
1351
1312
  return /* @__PURE__ */ e(
1352
1313
  "div",
1353
1314
  {
1354
- className: `rcs-emulator-suggestions-bar rcs-emulator-px-3 rcs-emulator-py-2 ${c ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
1315
+ className: `rcs-emulator-suggestions-bar rcs-emulator-px-3 rcs-emulator-py-2 ${l ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
1355
1316
  role: "group",
1356
1317
  "aria-label": "Quick replies",
1357
1318
  children: /* @__PURE__ */ e(
1358
1319
  "div",
1359
1320
  {
1360
1321
  className: "rcs-emulator-flex rcs-emulator-gap-2 rcs-emulator-overflow-x-auto rcs-emulator-pb-1 rcs-emulator--mx-1 rcs-emulator-px-1 rcs-emulator-scrollbar-hide",
1361
- children: r.map((u, m) => /* @__PURE__ */ e(
1362
- je,
1322
+ children: r.map((i, m) => /* @__PURE__ */ e(
1323
+ Ve,
1363
1324
  {
1364
- suggestion: u,
1365
- onClick: () => l(u),
1325
+ suggestion: i,
1326
+ onClick: () => c(i),
1366
1327
  variant: "bar"
1367
1328
  },
1368
1329
  m
@@ -1371,40 +1332,40 @@ const We = p(function({
1371
1332
  )
1372
1333
  }
1373
1334
  );
1374
- }), Ve = p(function() {
1375
- const { theme: r, state: t, showSuggestions: o } = k(), { chatHistory: a, isTyping: c, error: l } = t, u = ge([
1335
+ }), Fe = f(function() {
1336
+ const { theme: r, state: t, showSuggestions: o } = C(), { chatHistory: a, isTyping: l, error: c } = t, i = we([
1376
1337
  a.length,
1377
- c
1378
- ]), m = r === "dark", i = m ? "rcs-emulator-dark" : "rcs-emulator-light", h = a[a.length - 1], f = o && h?.sender === "business" && !c ? h.suggestions : void 0;
1338
+ l
1339
+ ]), m = r === "dark", u = m ? "rcs-emulator-dark" : "rcs-emulator-light", d = a[a.length - 1], h = o && d?.sender === "business" && !l ? d.suggestions : void 0;
1379
1340
  return /* @__PURE__ */ n(
1380
1341
  "div",
1381
1342
  {
1382
1343
  className: `rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-h-full rcs-emulator-w-full rcs-emulator-overflow-hidden ${m ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
1383
1344
  children: [
1384
- /* @__PURE__ */ e(xe, {}),
1385
- l && /* @__PURE__ */ e(
1345
+ /* @__PURE__ */ e(ye, {}),
1346
+ c && /* @__PURE__ */ e(
1386
1347
  "div",
1387
1348
  {
1388
1349
  className: "rcs-emulator-error-alert",
1389
1350
  role: "alert",
1390
- children: /* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-text-red-500", children: l })
1351
+ children: /* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-text-red-500", children: c })
1391
1352
  }
1392
1353
  ),
1393
- /* @__PURE__ */ n("div", { ref: u, className: "rcs-emulator-flex-1 rcs-emulator-overflow-y-auto rcs-emulator-scrollbar", children: [
1394
- /* @__PURE__ */ e(be, {}),
1395
- /* @__PURE__ */ e(Ee, {})
1354
+ /* @__PURE__ */ n("div", { ref: i, className: "rcs-emulator-flex-1 rcs-emulator-overflow-y-auto rcs-emulator-scrollbar", children: [
1355
+ /* @__PURE__ */ e(ke, {}),
1356
+ /* @__PURE__ */ e(Re, {})
1396
1357
  ] }),
1397
- f && f.length > 0 && /* @__PURE__ */ e(We, { suggestions: f }),
1358
+ h && h.length > 0 && /* @__PURE__ */ e(Ge, { suggestions: h }),
1398
1359
  /* @__PURE__ */ n(
1399
1360
  "div",
1400
1361
  {
1401
- className: `rcs-emulator-input-area ${i}`,
1362
+ className: `rcs-emulator-input-area ${u}`,
1402
1363
  children: [
1403
1364
  /* @__PURE__ */ e(
1404
1365
  "button",
1405
1366
  {
1406
1367
  type: "button",
1407
- className: `rcs-emulator-add-btn ${i}`,
1368
+ className: `rcs-emulator-add-btn ${u}`,
1408
1369
  "aria-label": "Add attachment",
1409
1370
  children: /* @__PURE__ */ e(
1410
1371
  "svg",
@@ -1429,7 +1390,7 @@ const We = p(function({
1429
1390
  /* @__PURE__ */ n(
1430
1391
  "div",
1431
1392
  {
1432
- className: `rcs-emulator-input-container ${i}`,
1393
+ className: `rcs-emulator-input-container ${u}`,
1433
1394
  children: [
1434
1395
  /* @__PURE__ */ e(
1435
1396
  "span",
@@ -1508,23 +1469,23 @@ const We = p(function({
1508
1469
  ]
1509
1470
  }
1510
1471
  );
1511
- }), He = p(function() {
1512
- const { theme: r, businessInfo: t, toggleProfile: o } = k(), [a, c] = A("info"), l = r === "dark", u = t.bannerImage || "https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=800&q=80", m = t.brandColor || "#0084ff";
1472
+ }), Je = f(function() {
1473
+ const { theme: r, businessInfo: t, toggleProfile: o } = C(), [a, l] = A("info"), c = r === "dark", i = t.bannerImage || "https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=800&q=80", m = t.brandColor || "#0084ff";
1513
1474
  return /* @__PURE__ */ n(
1514
1475
  "div",
1515
1476
  {
1516
- className: `rcs-emulator-absolute rcs-emulator-inset-0 rcs-emulator-z-50 rcs-emulator-flex rcs-emulator-flex-col ${l ? "rcs-emulator-bg-zinc-950" : "rcs-emulator-bg-white"}`,
1477
+ className: `rcs-emulator-absolute rcs-emulator-inset-0 rcs-emulator-z-50 rcs-emulator-flex rcs-emulator-flex-col ${c ? "rcs-emulator-bg-zinc-950" : "rcs-emulator-bg-white"}`,
1517
1478
  children: [
1518
1479
  /* @__PURE__ */ n(
1519
1480
  "header",
1520
1481
  {
1521
- className: `rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-4 rcs-emulator-py-3 rcs-emulator-border-b ${l ? "rcs-emulator-bg-zinc-900 rcs-emulator-border-zinc-800" : "rcs-emulator-bg-white rcs-emulator-border-gray-200"}`,
1482
+ className: `rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-4 rcs-emulator-py-3 rcs-emulator-border-b ${c ? "rcs-emulator-bg-zinc-900 rcs-emulator-border-zinc-800" : "rcs-emulator-bg-white rcs-emulator-border-gray-200"}`,
1522
1483
  children: [
1523
1484
  /* @__PURE__ */ e(
1524
1485
  "button",
1525
1486
  {
1526
1487
  onClick: o,
1527
- className: `rcs-emulator-p-1-5 rcs-emulator--ml-1-5 rcs-emulator-rounded-full rcs-emulator-transition-colors ${l ? "rcs-emulator-hover-bg-zinc-800 rcs-emulator-text-white" : "rcs-emulator-hover-bg-gray-100 rcs-emulator-text-gray-900"}`,
1488
+ className: `rcs-emulator-p-1-5 rcs-emulator--ml-1-5 rcs-emulator-rounded-full rcs-emulator-transition-colors ${c ? "rcs-emulator-hover-bg-zinc-800 rcs-emulator-text-white" : "rcs-emulator-hover-bg-gray-100 rcs-emulator-text-gray-900"}`,
1528
1489
  "aria-label": "Go back",
1529
1490
  children: /* @__PURE__ */ e(
1530
1491
  "svg",
@@ -1549,7 +1510,7 @@ const We = p(function({
1549
1510
  /* @__PURE__ */ e(
1550
1511
  "span",
1551
1512
  {
1552
- className: `rcs-emulator-text-base rcs-emulator-font-medium ${l ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
1513
+ className: `rcs-emulator-text-base rcs-emulator-font-medium ${c ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
1553
1514
  children: "Info & options"
1554
1515
  }
1555
1516
  )
@@ -1560,7 +1521,7 @@ const We = p(function({
1560
1521
  /* @__PURE__ */ e("div", { className: "rcs-emulator-relative rcs-emulator-h-40 rcs-emulator-bg-gray-200", children: /* @__PURE__ */ e(
1561
1522
  "img",
1562
1523
  {
1563
- src: u,
1524
+ src: i,
1564
1525
  alt: "Business banner",
1565
1526
  className: "rcs-emulator-w-full rcs-emulator-h-full rcs-emulator-object-cover"
1566
1527
  }
@@ -1568,7 +1529,7 @@ const We = p(function({
1568
1529
  /* @__PURE__ */ e("div", { className: "rcs-emulator-relative rcs-emulator-px-4", children: /* @__PURE__ */ e(
1569
1530
  "div",
1570
1531
  {
1571
- className: `rcs-emulator-absolute rcs-emulator--top-10 rcs-emulator-left-1-2 rcs-emulator--translate-x-1-2 rcs-emulator-w-20 rcs-emulator-h-20 rcs-emulator-rounded-full rcs-emulator-overflow-hidden rcs-emulator-border-4 ${l ? "rcs-emulator-border-zinc-950 rcs-emulator-bg-zinc-800" : "rcs-emulator-border-white rcs-emulator-bg-gray-100"} rcs-emulator-shadow-lg`,
1532
+ className: `rcs-emulator-absolute rcs-emulator--top-10 rcs-emulator-left-1-2 rcs-emulator--translate-x-1-2 rcs-emulator-w-20 rcs-emulator-h-20 rcs-emulator-rounded-full rcs-emulator-overflow-hidden rcs-emulator-border-4 ${c ? "rcs-emulator-border-zinc-950 rcs-emulator-bg-zinc-800" : "rcs-emulator-border-white rcs-emulator-bg-gray-100"} rcs-emulator-shadow-lg`,
1572
1533
  children: t.logo ? /* @__PURE__ */ e(
1573
1534
  "img",
1574
1535
  {
@@ -1590,49 +1551,49 @@ const We = p(function({
1590
1551
  /* @__PURE__ */ e(
1591
1552
  "h1",
1592
1553
  {
1593
- className: `rcs-emulator-text-xl rcs-emulator-font-semibold ${l ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
1554
+ className: `rcs-emulator-text-xl rcs-emulator-font-semibold ${c ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
1594
1555
  children: t.name
1595
1556
  }
1596
1557
  ),
1597
- t.description && /* @__PURE__ */ e("p", { className: `rcs-emulator-text-sm rcs-emulator-mt-1 ${l ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`, children: t.description })
1558
+ t.description && /* @__PURE__ */ e("p", { className: `rcs-emulator-text-sm rcs-emulator-mt-1 ${c ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`, children: t.description })
1598
1559
  ] }),
1599
1560
  /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-justify-center rcs-emulator-gap-4 rcs-emulator-px-4 rcs-emulator-pb-4", children: [
1600
1561
  t.phoneNumbers && t.phoneNumbers.length > 0 && /* @__PURE__ */ e(
1601
- _,
1562
+ G,
1602
1563
  {
1603
1564
  icon: "phone",
1604
1565
  label: "Call",
1605
- isDark: l,
1566
+ isDark: c,
1606
1567
  brandColor: m,
1607
1568
  onClick: () => {
1608
- const i = t.phoneNumbers?.[0]?.number;
1609
- i && (window.location.href = `tel:${i}`);
1569
+ const u = t.phoneNumbers?.[0]?.number;
1570
+ u && (window.location.href = `tel:${u}`);
1610
1571
  }
1611
1572
  }
1612
1573
  ),
1613
1574
  t.websites && t.websites.length > 0 && /* @__PURE__ */ e(
1614
- _,
1575
+ G,
1615
1576
  {
1616
1577
  icon: "globe",
1617
1578
  label: "Website",
1618
- isDark: l,
1579
+ isDark: c,
1619
1580
  brandColor: m,
1620
1581
  onClick: () => {
1621
- const i = t.websites?.[0]?.url;
1622
- i && window.open(i, "_blank", "noopener,noreferrer");
1582
+ const u = t.websites?.[0]?.url;
1583
+ u && window.open(u, "_blank", "noopener,noreferrer");
1623
1584
  }
1624
1585
  }
1625
1586
  ),
1626
1587
  t.emails && t.emails.length > 0 && /* @__PURE__ */ e(
1627
- _,
1588
+ G,
1628
1589
  {
1629
1590
  icon: "mail",
1630
1591
  label: "Contact",
1631
- isDark: l,
1592
+ isDark: c,
1632
1593
  brandColor: m,
1633
1594
  onClick: () => {
1634
- const i = t.emails?.[0]?.email;
1635
- i && (window.location.href = `mailto:${i}`);
1595
+ const u = t.emails?.[0]?.email;
1596
+ u && (window.location.href = `mailto:${u}`);
1636
1597
  }
1637
1598
  }
1638
1599
  )
@@ -1640,24 +1601,24 @@ const We = p(function({
1640
1601
  /* @__PURE__ */ n(
1641
1602
  "div",
1642
1603
  {
1643
- className: `rcs-emulator-tabs-container rcs-emulator-flex rcs-emulator-mx-4 rcs-emulator-rounded-lg rcs-emulator-overflow-hidden rcs-emulator-border ${l ? "rcs-emulator-border-zinc-700 rcs-emulator-bg-zinc-800" : "rcs-emulator-border-gray-200 rcs-emulator-bg-gray-100"}`,
1604
+ className: `rcs-emulator-tabs-container rcs-emulator-flex rcs-emulator-mx-4 rcs-emulator-rounded-lg rcs-emulator-overflow-hidden rcs-emulator-border ${c ? "rcs-emulator-border-zinc-700 rcs-emulator-bg-zinc-800" : "rcs-emulator-border-gray-200 rcs-emulator-bg-gray-100"}`,
1644
1605
  children: [
1645
1606
  /* @__PURE__ */ e(
1646
- F,
1607
+ Z,
1647
1608
  {
1648
1609
  active: a === "info",
1649
- onClick: () => c("info"),
1650
- isDark: l,
1610
+ onClick: () => l("info"),
1611
+ isDark: c,
1651
1612
  brandColor: m,
1652
1613
  children: "Info"
1653
1614
  }
1654
1615
  ),
1655
1616
  /* @__PURE__ */ e(
1656
- F,
1617
+ Z,
1657
1618
  {
1658
1619
  active: a === "options",
1659
- onClick: () => c("options"),
1660
- isDark: l,
1620
+ onClick: () => l("options"),
1621
+ isDark: c,
1661
1622
  brandColor: m,
1662
1623
  children: "Options"
1663
1624
  }
@@ -1665,22 +1626,22 @@ const We = p(function({
1665
1626
  ]
1666
1627
  }
1667
1628
  ),
1668
- /* @__PURE__ */ e("div", { className: "rcs-emulator-p-4", children: a === "info" ? /* @__PURE__ */ e(_e, { isDark: l, brandColor: m }) : /* @__PURE__ */ e(Ue, { isDark: l }) })
1629
+ /* @__PURE__ */ e("div", { className: "rcs-emulator-p-4", children: a === "info" ? /* @__PURE__ */ e(Ye, { isDark: c, brandColor: m }) : /* @__PURE__ */ e(qe, { isDark: c }) })
1669
1630
  ] })
1670
1631
  ]
1671
1632
  }
1672
1633
  );
1673
- }), _ = p(function({
1634
+ }), G = f(function({
1674
1635
  icon: r,
1675
1636
  label: t,
1676
1637
  isDark: o,
1677
1638
  brandColor: a,
1678
- onClick: c
1639
+ onClick: l
1679
1640
  }) {
1680
1641
  return /* @__PURE__ */ n(
1681
1642
  "button",
1682
1643
  {
1683
- onClick: c,
1644
+ onClick: l,
1684
1645
  className: `rcs-emulator-quick-action-btn rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-gap-2 rcs-emulator-px-6 rcs-emulator-py-3 rcs-emulator-rounded-xl rcs-emulator-border rcs-emulator-transition-colors ${o ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
1685
1646
  children: [
1686
1647
  /* @__PURE__ */ e(
@@ -1731,12 +1692,12 @@ const We = p(function({
1731
1692
  ]
1732
1693
  }
1733
1694
  );
1734
- }), F = p(function({
1695
+ }), Z = f(function({
1735
1696
  active: r,
1736
1697
  onClick: t,
1737
1698
  isDark: o,
1738
1699
  brandColor: a,
1739
- children: c
1700
+ children: l
1740
1701
  }) {
1741
1702
  return /* @__PURE__ */ e(
1742
1703
  "button",
@@ -1744,51 +1705,51 @@ const We = p(function({
1744
1705
  onClick: t,
1745
1706
  className: `rcs-emulator-tab-btn rcs-emulator-flex-1 rcs-emulator-py-2-5 rcs-emulator-text-sm rcs-emulator-font-medium rcs-emulator-transition-colors rcs-emulator-rounded-lg ${r ? "rcs-emulator-active" : `rcs-emulator-inactive ${o ? "rcs-emulator-dark" : "rcs-emulator-light"}`}`,
1746
1707
  style: r ? { backgroundColor: a } : void 0,
1747
- children: c
1708
+ children: l
1748
1709
  }
1749
1710
  );
1750
- }), _e = p(function({ isDark: r, brandColor: t }) {
1751
- const { businessInfo: o } = k();
1711
+ }), Ye = f(function({ isDark: r, brandColor: t }) {
1712
+ const { businessInfo: o } = C();
1752
1713
  return o.phoneNumbers && o.phoneNumbers.length > 0 || o.websites && o.websites.length > 0 || o.emails && o.emails.length > 0 ? /* @__PURE__ */ n(
1753
1714
  "div",
1754
1715
  {
1755
1716
  className: `rcs-emulator-profile-section rcs-emulator-rounded-xl rcs-emulator-overflow-hidden rcs-emulator-border rcs-emulator-divide-y ${r ? "rcs-emulator-dark rcs-emulator-divide-zinc-800" : "rcs-emulator-light rcs-emulator-divide-gray-200"}`,
1756
1717
  children: [
1757
- o.phoneNumbers?.map((c, l) => /* @__PURE__ */ e(
1758
- U,
1718
+ o.phoneNumbers?.map((l, c) => /* @__PURE__ */ e(
1719
+ F,
1759
1720
  {
1760
1721
  icon: "phone",
1761
- primary: c.number,
1762
- secondary: c.label,
1722
+ primary: l.number,
1723
+ secondary: l.label,
1763
1724
  isDark: r,
1764
1725
  brandColor: t,
1765
- onClick: () => window.location.href = `tel:${c.number}`
1726
+ onClick: () => window.location.href = `tel:${l.number}`
1766
1727
  },
1767
- `phone-${l}`
1728
+ `phone-${c}`
1768
1729
  )),
1769
- o.websites?.map((c, l) => /* @__PURE__ */ e(
1770
- U,
1730
+ o.websites?.map((l, c) => /* @__PURE__ */ e(
1731
+ F,
1771
1732
  {
1772
1733
  icon: "globe",
1773
- primary: c.url.replace(/^https?:\/\//, ""),
1774
- secondary: c.label || "Website",
1734
+ primary: l.url.replace(/^https?:\/\//, ""),
1735
+ secondary: l.label || "Website",
1775
1736
  isDark: r,
1776
1737
  brandColor: t,
1777
- onClick: () => window.open(c.url, "_blank", "noopener,noreferrer")
1738
+ onClick: () => window.open(l.url, "_blank", "noopener,noreferrer")
1778
1739
  },
1779
- `web-${l}`
1740
+ `web-${c}`
1780
1741
  )),
1781
- o.emails?.map((c, l) => /* @__PURE__ */ e(
1782
- U,
1742
+ o.emails?.map((l, c) => /* @__PURE__ */ e(
1743
+ F,
1783
1744
  {
1784
1745
  icon: "mail",
1785
- primary: c.email,
1786
- secondary: c.label || "Email",
1746
+ primary: l.email,
1747
+ secondary: l.label || "Email",
1787
1748
  isDark: r,
1788
1749
  brandColor: t,
1789
- onClick: () => window.location.href = `mailto:${c.email}`
1750
+ onClick: () => window.location.href = `mailto:${l.email}`
1790
1751
  },
1791
- `email-${l}`
1752
+ `email-${c}`
1792
1753
  ))
1793
1754
  ]
1794
1755
  }
@@ -1799,17 +1760,17 @@ const We = p(function({
1799
1760
  children: "No contact information available"
1800
1761
  }
1801
1762
  );
1802
- }), U = p(function({
1763
+ }), F = f(function({
1803
1764
  icon: r,
1804
1765
  primary: t,
1805
1766
  secondary: o,
1806
1767
  isDark: a,
1807
- onClick: c
1768
+ onClick: l
1808
1769
  }) {
1809
1770
  return /* @__PURE__ */ n(
1810
1771
  "button",
1811
1772
  {
1812
- onClick: c,
1773
+ onClick: l,
1813
1774
  className: `rcs-emulator-list-item rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-4 rcs-emulator-px-4 rcs-emulator-py-3-5 rcs-emulator-text-left rcs-emulator-transition-colors ${a ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
1814
1775
  children: [
1815
1776
  /* @__PURE__ */ e(
@@ -1853,14 +1814,14 @@ const We = p(function({
1853
1814
  ]
1854
1815
  }
1855
1816
  );
1856
- }), Ue = p(function({ isDark: r }) {
1817
+ }), qe = f(function({ isDark: r }) {
1857
1818
  return /* @__PURE__ */ n(
1858
1819
  "div",
1859
1820
  {
1860
1821
  className: `rcs-emulator-profile-section rcs-emulator-rounded-xl rcs-emulator-overflow-hidden rcs-emulator-border rcs-emulator-divide-y ${r ? "rcs-emulator-dark rcs-emulator-divide-zinc-800" : "rcs-emulator-light rcs-emulator-divide-gray-200"}`,
1861
1822
  children: [
1862
1823
  /* @__PURE__ */ e(
1863
- D,
1824
+ J,
1864
1825
  {
1865
1826
  icon: "bell",
1866
1827
  label: "Notifications",
@@ -1868,7 +1829,7 @@ const We = p(function({
1868
1829
  }
1869
1830
  ),
1870
1831
  /* @__PURE__ */ e(
1871
- D,
1832
+ J,
1872
1833
  {
1873
1834
  icon: "block",
1874
1835
  label: "Block & report spam",
@@ -1876,7 +1837,7 @@ const We = p(function({
1876
1837
  }
1877
1838
  ),
1878
1839
  /* @__PURE__ */ e(
1879
- D,
1840
+ J,
1880
1841
  {
1881
1842
  icon: "info",
1882
1843
  label: "About RCS",
@@ -1886,7 +1847,7 @@ const We = p(function({
1886
1847
  ]
1887
1848
  }
1888
1849
  );
1889
- }), D = p(function({
1850
+ }), J = f(function({
1890
1851
  icon: r,
1891
1852
  label: t,
1892
1853
  isDark: o
@@ -1928,39 +1889,39 @@ const We = p(function({
1928
1889
  ]
1929
1890
  }
1930
1891
  );
1931
- }), q = {
1892
+ }), K = {
1932
1893
  FULL: "rcs-emulator-webview-full",
1933
1894
  TALL: "rcs-emulator-webview-tall",
1934
1895
  HALF: "rcs-emulator-webview-half"
1935
- }, De = p(function() {
1936
- const { theme: r, businessInfo: t, webView: o, closeWebView: a } = k(), [c, l] = A(!0), [u, m] = A(!1), i = r === "dark", h = t.brandColor || "#0084ff";
1937
- j(() => {
1938
- o?.url && (l(!0), m(!1));
1896
+ }, Qe = f(function() {
1897
+ const { theme: r, businessInfo: t, webView: o, closeWebView: a } = C(), [l, c] = A(!0), [i, m] = A(!1), u = r === "dark", d = t.brandColor || "#0084ff";
1898
+ B(() => {
1899
+ o?.url && (c(!0), m(!1));
1939
1900
  }, [o?.url]);
1940
- const f = $(() => {
1941
- l(!1);
1942
- }, []), v = $(() => {
1943
- l(!1), m(!0);
1944
- }, []), b = (C) => {
1901
+ const h = M(() => {
1902
+ c(!1);
1903
+ }, []), v = M(() => {
1904
+ c(!1), m(!0);
1905
+ }, []), y = (N) => {
1945
1906
  try {
1946
- return new URL(C).hostname;
1907
+ return new URL(N).hostname;
1947
1908
  } catch {
1948
1909
  return "Web Page";
1949
1910
  }
1950
1911
  };
1951
1912
  if (!o || !o.isOpen) return null;
1952
- const { url: N, viewMode: y, title: w, postbackData: g } = o, d = w || b(N), x = y === "FULL", L = y === "TALL" || y === "HALF", z = q[y] || q.TALL;
1913
+ const { url: k, viewMode: w, title: g, postbackData: x } = o, L = g || y(k), b = w === "FULL", $ = w === "TALL" || w === "HALF", S = K[w] || K.TALL;
1953
1914
  return /* @__PURE__ */ n(
1954
1915
  "div",
1955
1916
  {
1956
- className: `rcs-emulator-webview-overlay ${x ? "rcs-emulator-webview-full" : "rcs-emulator-webview-bottom-sheet"} rcs-emulator-absolute rcs-emulator-inset-0 rcs-emulator-z-50 rcs-emulator-flex rcs-emulator-flex-col ${x ? "" : "rcs-emulator-justify-end"} ${i ? "rcs-emulator-bg-black-60" : "rcs-emulator-bg-black-40"}`,
1917
+ className: `rcs-emulator-webview-overlay ${b ? "rcs-emulator-webview-full" : "rcs-emulator-webview-bottom-sheet"} rcs-emulator-absolute rcs-emulator-inset-0 rcs-emulator-z-50 rcs-emulator-flex rcs-emulator-flex-col ${b ? "" : "rcs-emulator-justify-end"} ${u ? "rcs-emulator-bg-black-60" : "rcs-emulator-bg-black-40"}`,
1957
1918
  role: "dialog",
1958
1919
  "aria-modal": "true",
1959
- "aria-label": `WebView: ${d}`,
1960
- "data-postback": g,
1961
- "data-view-mode": y,
1920
+ "aria-label": `WebView: ${L}`,
1921
+ "data-postback": x,
1922
+ "data-view-mode": w,
1962
1923
  children: [
1963
- L && /* @__PURE__ */ e(
1924
+ $ && /* @__PURE__ */ e(
1964
1925
  "button",
1965
1926
  {
1966
1927
  type: "button",
@@ -1972,7 +1933,7 @@ const We = p(function({
1972
1933
  /* @__PURE__ */ n(
1973
1934
  "div",
1974
1935
  {
1975
- className: `rcs-emulator-relative rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-overflow-hidden ${i ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-white"} ${z} rcs-emulator-w-full ${L ? "rcs-emulator-rounded-t-2xl rcs-emulator-shadow-2xl" : ""}`,
1936
+ className: `rcs-emulator-relative rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-overflow-hidden ${u ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-white"} ${S} rcs-emulator-w-full ${$ ? "rcs-emulator-rounded-t-2xl rcs-emulator-shadow-2xl" : ""}`,
1976
1937
  style: {
1977
1938
  // Ensure container is above backdrop
1978
1939
  position: "relative",
@@ -1982,14 +1943,14 @@ const We = p(function({
1982
1943
  /* @__PURE__ */ n(
1983
1944
  "header",
1984
1945
  {
1985
- className: `rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-2 rcs-emulator-py-2 rcs-emulator-flex-shrink-0 rcs-emulator-border-b ${i ? "rcs-emulator-bg-zinc-900 rcs-emulator-border-zinc-800" : "rcs-emulator-bg-white rcs-emulator-border-gray-200"}`,
1946
+ className: `rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-2 rcs-emulator-py-2 rcs-emulator-flex-shrink-0 rcs-emulator-border-b ${u ? "rcs-emulator-bg-zinc-900 rcs-emulator-border-zinc-800" : "rcs-emulator-bg-white rcs-emulator-border-gray-200"}`,
1986
1947
  children: [
1987
1948
  /* @__PURE__ */ e(
1988
1949
  "button",
1989
1950
  {
1990
1951
  type: "button",
1991
1952
  onClick: a,
1992
- className: `rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-rounded-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-transition-colors ${i ? "rcs-emulator-text-white rcs-emulator-hover-bg-zinc-800" : "rcs-emulator-text-gray-700 rcs-emulator-hover-bg-gray-100"}`,
1953
+ className: `rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-rounded-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-transition-colors ${u ? "rcs-emulator-text-white rcs-emulator-hover-bg-zinc-800" : "rcs-emulator-text-gray-700 rcs-emulator-hover-bg-gray-100"}`,
1993
1954
  "aria-label": "Close WebView",
1994
1955
  children: /* @__PURE__ */ e(
1995
1956
  "svg",
@@ -2015,15 +1976,15 @@ const We = p(function({
2015
1976
  /* @__PURE__ */ e(
2016
1977
  "h2",
2017
1978
  {
2018
- className: `rcs-emulator-text-base rcs-emulator-font-medium rcs-emulator-truncate ${i ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2019
- children: d
1979
+ className: `rcs-emulator-text-base rcs-emulator-font-medium rcs-emulator-truncate ${u ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
1980
+ children: L
2020
1981
  }
2021
1982
  ),
2022
1983
  /* @__PURE__ */ e(
2023
1984
  "p",
2024
1985
  {
2025
- className: `rcs-emulator-text-xs rcs-emulator-truncate ${i ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2026
- children: b(N)
1986
+ className: `rcs-emulator-text-xs rcs-emulator-truncate ${u ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
1987
+ children: y(k)
2027
1988
  }
2028
1989
  )
2029
1990
  ] }),
@@ -2031,7 +1992,7 @@ const We = p(function({
2031
1992
  "button",
2032
1993
  {
2033
1994
  type: "button",
2034
- className: `rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-rounded-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center ${i ? "rcs-emulator-text-zinc-400 rcs-emulator-hover-bg-zinc-800" : "rcs-emulator-text-gray-500 rcs-emulator-hover-bg-gray-100"}`,
1995
+ className: `rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-rounded-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center ${u ? "rcs-emulator-text-zinc-400 rcs-emulator-hover-bg-zinc-800" : "rcs-emulator-text-gray-500 rcs-emulator-hover-bg-gray-100"}`,
2035
1996
  "aria-label": "More options",
2036
1997
  children: /* @__PURE__ */ n(
2037
1998
  "svg",
@@ -2051,27 +2012,27 @@ const We = p(function({
2051
2012
  ]
2052
2013
  }
2053
2014
  ),
2054
- c && /* @__PURE__ */ e(
2015
+ l && /* @__PURE__ */ e(
2055
2016
  "div",
2056
2017
  {
2057
2018
  className: "rcs-emulator-absolute rcs-emulator-top-14 rcs-emulator-left-0 rcs-emulator-right-0 rcs-emulator-h-1 rcs-emulator-overflow-hidden",
2058
- style: { backgroundColor: `${h}20` },
2019
+ style: { backgroundColor: `${d}20` },
2059
2020
  children: /* @__PURE__ */ e(
2060
2021
  "div",
2061
2022
  {
2062
2023
  className: "rcs-emulator-h-full rcs-emulator-animate-pulse rcs-emulator-webview-loading-bar",
2063
2024
  style: {
2064
- backgroundColor: h,
2025
+ backgroundColor: d,
2065
2026
  width: "30%"
2066
2027
  }
2067
2028
  }
2068
2029
  )
2069
2030
  }
2070
2031
  ),
2071
- u && /* @__PURE__ */ n(
2032
+ i && /* @__PURE__ */ n(
2072
2033
  "div",
2073
2034
  {
2074
- className: `rcs-emulator-flex-1 rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-p-6 rcs-emulator-text-center ${i ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2035
+ className: `rcs-emulator-flex-1 rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-p-6 rcs-emulator-text-center ${u ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2075
2036
  children: [
2076
2037
  /* @__PURE__ */ e(
2077
2038
  "svg",
@@ -2098,30 +2059,30 @@ const We = p(function({
2098
2059
  {
2099
2060
  type: "button",
2100
2061
  onClick: a,
2101
- className: `rcs-emulator-px-4 rcs-emulator-py-2 rcs-emulator-rounded-full rcs-emulator-text-sm rcs-emulator-font-medium ${i ? "rcs-emulator-bg-zinc-800 rcs-emulator-text-white rcs-emulator-hover-bg-zinc-700" : "rcs-emulator-bg-gray-100 rcs-emulator-text-gray-700 rcs-emulator-hover-bg-gray-200"}`,
2062
+ className: `rcs-emulator-px-4 rcs-emulator-py-2 rcs-emulator-rounded-full rcs-emulator-text-sm rcs-emulator-font-medium ${u ? "rcs-emulator-bg-zinc-800 rcs-emulator-text-white rcs-emulator-hover-bg-zinc-700" : "rcs-emulator-bg-gray-100 rcs-emulator-text-gray-700 rcs-emulator-hover-bg-gray-200"}`,
2102
2063
  children: "Go Back"
2103
2064
  }
2104
2065
  )
2105
2066
  ]
2106
2067
  }
2107
2068
  ),
2108
- !u && /* @__PURE__ */ e("div", { className: "rcs-emulator-flex-1 rcs-emulator-overflow-hidden", children: /* @__PURE__ */ e(
2069
+ !i && /* @__PURE__ */ e("div", { className: "rcs-emulator-flex-1 rcs-emulator-overflow-hidden", children: /* @__PURE__ */ e(
2109
2070
  "iframe",
2110
2071
  {
2111
- src: N,
2112
- title: d,
2072
+ src: k,
2073
+ title: L,
2113
2074
  className: "rcs-emulator-w-full rcs-emulator-h-full rcs-emulator-border-0",
2114
- onLoad: f,
2075
+ onLoad: h,
2115
2076
  onError: v,
2116
2077
  sandbox: "allow-scripts allow-same-origin allow-forms allow-popups",
2117
2078
  referrerPolicy: "no-referrer-when-downgrade",
2118
2079
  loading: "lazy"
2119
2080
  }
2120
2081
  ) }),
2121
- L && /* @__PURE__ */ e(
2082
+ $ && /* @__PURE__ */ e(
2122
2083
  "div",
2123
2084
  {
2124
- className: `rcs-emulator-h-2 rcs-emulator-flex-shrink-0 ${i ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-white"}`
2085
+ className: `rcs-emulator-h-2 rcs-emulator-flex-shrink-0 ${u ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-white"}`
2125
2086
  }
2126
2087
  )
2127
2088
  ]
@@ -2130,22 +2091,22 @@ const We = p(function({
2130
2091
  ]
2131
2092
  }
2132
2093
  );
2133
- }), Oe = p(function({
2094
+ }), Ze = f(function({
2134
2095
  onUnlock: r,
2135
2096
  messagePreview: t = "New message"
2136
2097
  }) {
2137
- const { theme: o, businessInfo: a } = k(), [c, l] = A(/* @__PURE__ */ new Date()), u = o === "dark";
2138
- j(() => {
2139
- const h = setInterval(() => {
2140
- l(/* @__PURE__ */ new Date());
2098
+ const { theme: o, businessInfo: a } = C(), [l, c] = A(/* @__PURE__ */ new Date()), i = o === "dark";
2099
+ B(() => {
2100
+ const d = setInterval(() => {
2101
+ c(/* @__PURE__ */ new Date());
2141
2102
  }, 1e3);
2142
- return () => clearInterval(h);
2103
+ return () => clearInterval(d);
2143
2104
  }, []);
2144
- const m = c.toLocaleTimeString([], {
2105
+ const m = l.toLocaleTimeString([], {
2145
2106
  hour: "numeric",
2146
2107
  minute: "2-digit",
2147
2108
  hour12: !0
2148
- }), i = c.toLocaleDateString([], {
2109
+ }), u = l.toLocaleDateString([], {
2149
2110
  weekday: "short",
2150
2111
  month: "long",
2151
2112
  day: "numeric"
@@ -2153,7 +2114,7 @@ const We = p(function({
2153
2114
  return /* @__PURE__ */ n(
2154
2115
  "div",
2155
2116
  {
2156
- className: `rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-h-full rcs-emulator-w-full rcs-emulator-select-none ${u ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-zinc-800"}`,
2117
+ className: `rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-h-full rcs-emulator-w-full rcs-emulator-select-none ${i ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-zinc-800"}`,
2157
2118
  children: [
2158
2119
  /* @__PURE__ */ e("div", { className: "rcs-emulator-h-6" }),
2159
2120
  /* @__PURE__ */ e("div", { className: "rcs-emulator-flex rcs-emulator-justify-center rcs-emulator-mt-4", children: /* @__PURE__ */ e("div", { className: "rcs-emulator-w-8 rcs-emulator-h-8 rcs-emulator-rounded-full rcs-emulator-bg-zinc-700 rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center", children: /* @__PURE__ */ e(
@@ -2173,7 +2134,7 @@ const We = p(function({
2173
2134
  }
2174
2135
  ) }) }),
2175
2136
  /* @__PURE__ */ e("div", { className: "rcs-emulator-mt-6 rcs-emulator-text-center", children: /* @__PURE__ */ e("h1", { className: "rcs-emulator-text-5xl rcs-emulator-font-light rcs-emulator-text-white rcs-emulator-tracking-tight", children: m }) }),
2176
- /* @__PURE__ */ e("div", { className: "rcs-emulator-mt-2 rcs-emulator-text-center", children: /* @__PURE__ */ e("p", { className: "rcs-emulator-text-zinc-400 rcs-emulator-text-sm", children: i }) }),
2137
+ /* @__PURE__ */ e("div", { className: "rcs-emulator-mt-2 rcs-emulator-text-center", children: /* @__PURE__ */ e("p", { className: "rcs-emulator-text-zinc-400 rcs-emulator-text-sm", children: u }) }),
2177
2138
  /* @__PURE__ */ e("div", { className: "rcs-emulator-h-24" }),
2178
2139
  /* @__PURE__ */ e("div", { className: "rcs-emulator-px-4 rcs-emulator-pb-8", children: /* @__PURE__ */ n(
2179
2140
  "button",
@@ -2224,144 +2185,374 @@ const We = p(function({
2224
2185
  ]
2225
2186
  }
2226
2187
  );
2227
- }), J = {
2188
+ }), Ke = () => /* @__PURE__ */ e(
2189
+ "svg",
2190
+ {
2191
+ className: "rcs-emulator-w-5 rcs-emulator-h-5",
2192
+ fill: "none",
2193
+ viewBox: "0 0 24 24",
2194
+ stroke: "currentColor",
2195
+ strokeWidth: 2,
2196
+ children: /* @__PURE__ */ e(
2197
+ "path",
2198
+ {
2199
+ strokeLinecap: "round",
2200
+ strokeLinejoin: "round",
2201
+ d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
2202
+ }
2203
+ )
2204
+ }
2205
+ ), Xe = () => /* @__PURE__ */ e(
2206
+ "svg",
2207
+ {
2208
+ className: "rcs-emulator-w-5 rcs-emulator-h-5",
2209
+ fill: "none",
2210
+ viewBox: "0 0 24 24",
2211
+ stroke: "currentColor",
2212
+ strokeWidth: 2,
2213
+ children: /* @__PURE__ */ e(
2214
+ "path",
2215
+ {
2216
+ strokeLinecap: "round",
2217
+ strokeLinejoin: "round",
2218
+ d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
2219
+ }
2220
+ )
2221
+ }
2222
+ ), er = () => /* @__PURE__ */ n(
2223
+ "svg",
2224
+ {
2225
+ className: "rcs-emulator-w-5 rcs-emulator-h-5",
2226
+ fill: "none",
2227
+ viewBox: "0 0 24 24",
2228
+ stroke: "currentColor",
2229
+ strokeWidth: 2,
2230
+ children: [
2231
+ /* @__PURE__ */ e(
2232
+ "path",
2233
+ {
2234
+ strokeLinecap: "round",
2235
+ strokeLinejoin: "round",
2236
+ d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
2237
+ }
2238
+ ),
2239
+ /* @__PURE__ */ e(
2240
+ "path",
2241
+ {
2242
+ strokeLinecap: "round",
2243
+ strokeLinejoin: "round",
2244
+ d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
2245
+ }
2246
+ )
2247
+ ]
2248
+ }
2249
+ ), rr = () => /* @__PURE__ */ e(
2250
+ "svg",
2251
+ {
2252
+ className: "rcs-emulator-w-5 rcs-emulator-h-5",
2253
+ fill: "none",
2254
+ viewBox: "0 0 24 24",
2255
+ stroke: "currentColor",
2256
+ strokeWidth: 2,
2257
+ children: /* @__PURE__ */ e(
2258
+ "path",
2259
+ {
2260
+ strokeLinecap: "round",
2261
+ strokeLinejoin: "round",
2262
+ d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
2263
+ }
2264
+ )
2265
+ }
2266
+ ), tr = (s) => {
2267
+ switch (s) {
2268
+ case "dial":
2269
+ return /* @__PURE__ */ e(Ke, {});
2270
+ case "calendar":
2271
+ return /* @__PURE__ */ e(Xe, {});
2272
+ case "map":
2273
+ return /* @__PURE__ */ e(er, {});
2274
+ default:
2275
+ return /* @__PURE__ */ e(rr, {});
2276
+ }
2277
+ }, sr = (s) => {
2278
+ switch (s) {
2279
+ case "dial":
2280
+ return "#4CAF50";
2281
+ // Green for call
2282
+ case "calendar":
2283
+ return "#2196F3";
2284
+ // Blue for calendar
2285
+ case "map":
2286
+ return "#FF5722";
2287
+ // Orange for map
2288
+ default:
2289
+ return "#9E9E9E";
2290
+ }
2291
+ }, or = f(function() {
2292
+ const { theme: r, toast: t, showToast: o } = C();
2293
+ if (B(() => {
2294
+ if (t) {
2295
+ const l = setTimeout(() => {
2296
+ o(null);
2297
+ }, 3e3);
2298
+ return () => clearTimeout(l);
2299
+ }
2300
+ }, [t, o]), !t) return null;
2301
+ const a = r === "dark";
2302
+ return /* @__PURE__ */ e(
2303
+ "div",
2304
+ {
2305
+ className: "rcs-emulator-absolute rcs-emulator-bottom-20 rcs-emulator-left-4 rcs-emulator-right-4 rcs-emulator-z-50",
2306
+ role: "alert",
2307
+ "aria-live": "polite",
2308
+ children: /* @__PURE__ */ n(
2309
+ "div",
2310
+ {
2311
+ className: `rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-p-4 rcs-emulator-rounded-2xl rcs-emulator-shadow-lg ${a ? "rcs-emulator-bg-zinc-800" : "rcs-emulator-bg-white"}`,
2312
+ style: {
2313
+ boxShadow: "0 4px 20px rgba(0, 0, 0, 0.15)",
2314
+ animation: "rcs-toast-slide-up 0.3s ease-out"
2315
+ },
2316
+ children: [
2317
+ /* @__PURE__ */ e(
2318
+ "div",
2319
+ {
2320
+ className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-rounded-full rcs-emulator-flex-shrink-0 rcs-emulator-text-white",
2321
+ style: { backgroundColor: sr(t.type) },
2322
+ children: tr(t.type)
2323
+ }
2324
+ ),
2325
+ /* @__PURE__ */ n("div", { className: "rcs-emulator-flex-1 rcs-emulator-min-w-0", children: [
2326
+ /* @__PURE__ */ e(
2327
+ "p",
2328
+ {
2329
+ className: `rcs-emulator-text-sm rcs-emulator-font-medium ${a ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2330
+ children: t.message
2331
+ }
2332
+ ),
2333
+ t.details && /* @__PURE__ */ e(
2334
+ "p",
2335
+ {
2336
+ className: `rcs-emulator-text-xs rcs-emulator-mt-0.5 rcs-emulator-truncate ${a ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2337
+ children: t.details
2338
+ }
2339
+ )
2340
+ ] }),
2341
+ /* @__PURE__ */ e(
2342
+ "span",
2343
+ {
2344
+ className: `rcs-emulator-text-xs rcs-emulator-px-2 rcs-emulator-py-1 rcs-emulator-rounded-full rcs-emulator-flex-shrink-0 ${a ? "rcs-emulator-bg-zinc-700 rcs-emulator-text-zinc-300" : "rcs-emulator-bg-gray-100 rcs-emulator-text-gray-500"}`,
2345
+ children: "Simulation"
2346
+ }
2347
+ )
2348
+ ]
2349
+ }
2350
+ )
2351
+ }
2352
+ );
2353
+ }), X = {
2228
2354
  name: "Business",
2229
2355
  verified: !1
2230
- }, Pe = p(function({
2356
+ }, ar = f(function({
2231
2357
  flow: r,
2232
2358
  onUserReply: t,
2233
2359
  theme: o,
2234
2360
  device: a,
2235
- businessInfo: c,
2236
- showSuggestions: l
2361
+ businessInfo: l,
2362
+ showSuggestions: c,
2363
+ onBack: i
2237
2364
  }) {
2238
2365
  const {
2239
- state: u,
2240
- handleReply: m,
2241
- handleAction: i
2242
- } = fe({
2366
+ state: m,
2367
+ handleReply: u,
2368
+ handleAction: d
2369
+ } = be({
2243
2370
  flow: r,
2244
2371
  onUserReply: t,
2245
2372
  typingDelay: 800
2246
- }), [h, f] = A(!1), v = $(() => {
2247
- f((d) => !d);
2248
- }, []), [b, N] = A(null), y = $((d) => {
2249
- N({
2250
- ...d,
2373
+ }), [h, v] = A(!1), y = M(() => {
2374
+ v((N) => !N);
2375
+ }, []), [k, w] = A(null), g = M((N) => {
2376
+ w({
2377
+ ...N,
2251
2378
  isOpen: !0
2252
2379
  });
2253
- }, []), w = $(() => {
2254
- N(null);
2255
- }, []), g = $(
2256
- (d) => {
2257
- if (!I(d)) return;
2258
- const x = oe(d);
2259
- if (x) {
2260
- y({
2261
- url: x.url,
2262
- viewMode: x.webviewViewMode || "TALL",
2263
- title: x.description || "",
2264
- postbackData: d.action.postback.data
2380
+ }, []), x = M(() => {
2381
+ w(null);
2382
+ }, []), [L, b] = A(null), $ = M((N) => {
2383
+ b(N);
2384
+ }, []), S = M(
2385
+ (N) => {
2386
+ if (!T(N)) return;
2387
+ const { action: p } = N, I = p.postback.data, z = p.displayText, E = ne(N);
2388
+ if (E) {
2389
+ g({
2390
+ url: E.url,
2391
+ viewMode: E.webviewViewMode || "TALL",
2392
+ title: E.description || "",
2393
+ postbackData: I
2265
2394
  }), t({
2266
2395
  type: "action",
2267
- postbackData: d.action.postback.data,
2268
- displayText: d.action.displayText,
2396
+ postbackData: I,
2397
+ displayText: z,
2269
2398
  timestamp: Date.now(),
2270
2399
  actionData: {
2271
2400
  type: "webview",
2272
- url: x.url,
2273
- viewMode: x.webviewViewMode || "TALL",
2274
- description: x.description
2401
+ url: E.url,
2402
+ viewMode: E.webviewViewMode || "TALL",
2403
+ description: E.description
2275
2404
  }
2276
2405
  });
2277
2406
  return;
2278
2407
  }
2279
- i(d);
2408
+ const D = p.dialAction?.phoneNumber || p.dialerAction?.dialPhoneNumber?.phoneNumber;
2409
+ if (D) {
2410
+ $({
2411
+ type: "dial",
2412
+ message: "Would call",
2413
+ details: D
2414
+ }), t({
2415
+ type: "action",
2416
+ postbackData: I,
2417
+ displayText: z,
2418
+ timestamp: Date.now(),
2419
+ actionData: { type: "dial", phoneNumber: D }
2420
+ }), d(N);
2421
+ return;
2422
+ }
2423
+ const P = p.calendarAction?.createCalendarEvent || p.createCalendarEventAction;
2424
+ if (P) {
2425
+ const R = P.title || "Event";
2426
+ $({
2427
+ type: "calendar",
2428
+ message: "Would add calendar event",
2429
+ details: R
2430
+ }), t({
2431
+ type: "action",
2432
+ postbackData: I,
2433
+ displayText: z,
2434
+ timestamp: Date.now(),
2435
+ actionData: {
2436
+ type: "createCalendarEvent",
2437
+ title: R,
2438
+ description: P.description
2439
+ }
2440
+ }), d(N);
2441
+ return;
2442
+ }
2443
+ const _ = p.mapAction?.showLocation?.location || p.viewLocationAction?.latLong;
2444
+ if (_ || p.viewLocationAction) {
2445
+ const R = p.mapAction?.showLocation?.location?.label || p.viewLocationAction?.label || "Location";
2446
+ $({
2447
+ type: "map",
2448
+ message: "Would open maps",
2449
+ details: R
2450
+ }), t({
2451
+ type: "action",
2452
+ postbackData: I,
2453
+ displayText: z,
2454
+ timestamp: Date.now(),
2455
+ actionData: {
2456
+ type: "viewLocation",
2457
+ latitude: _?.latitude,
2458
+ longitude: _?.longitude,
2459
+ query: p.viewLocationAction?.query
2460
+ }
2461
+ }), d(N);
2462
+ return;
2463
+ }
2464
+ d(N);
2280
2465
  },
2281
- [i, y, t]
2466
+ [d, g, t, $]
2282
2467
  );
2283
2468
  return /* @__PURE__ */ n(
2284
- Z,
2469
+ te,
2285
2470
  {
2286
2471
  theme: o,
2287
2472
  device: a,
2288
- businessInfo: c,
2289
- state: u,
2290
- showSuggestions: l,
2473
+ businessInfo: l,
2474
+ state: m,
2475
+ showSuggestions: c,
2291
2476
  isProfileOpen: h,
2292
- toggleProfile: v,
2293
- onReply: m,
2294
- onAction: g,
2295
- webView: b,
2296
- openWebView: y,
2297
- closeWebView: w,
2477
+ toggleProfile: y,
2478
+ onReply: u,
2479
+ onAction: S,
2480
+ webView: k,
2481
+ openWebView: g,
2482
+ closeWebView: x,
2483
+ toast: L,
2484
+ showToast: $,
2485
+ onBack: i,
2298
2486
  children: [
2299
- /* @__PURE__ */ e(Ve, {}),
2300
- h && /* @__PURE__ */ e(He, {}),
2301
- /* @__PURE__ */ e(De, {})
2487
+ /* @__PURE__ */ e(Fe, {}),
2488
+ h && /* @__PURE__ */ e(Je, {}),
2489
+ /* @__PURE__ */ e(Qe, {}),
2490
+ /* @__PURE__ */ e(or, {})
2302
2491
  ]
2303
2492
  }
2304
2493
  );
2305
- }), Je = p(function({
2494
+ }), ir = f(function({
2306
2495
  messages: r,
2307
2496
  jsonUrl: t,
2308
2497
  onUserReply: o,
2309
2498
  theme: a = "light",
2310
- device: c = "android",
2311
- businessInfo: l,
2312
- className: u = "",
2499
+ device: l = "android",
2500
+ businessInfo: c,
2501
+ className: i = "",
2313
2502
  width: m = 375,
2314
- height: i = 667,
2315
- showSuggestions: h = !0,
2316
- showLockScreen: f = !1
2503
+ height: u = 667,
2504
+ showSuggestions: d = !0,
2505
+ showLockScreen: h = !1
2317
2506
  }) {
2318
- const [v, b] = A(f), N = $(() => {
2319
- b(!1);
2507
+ const [v, y] = A(h), k = M(() => {
2508
+ y(!1);
2509
+ }, []), w = M(() => {
2510
+ y(!0);
2320
2511
  }, []), {
2321
- data: y,
2322
- isLoading: w,
2323
- error: g
2324
- } = pe(t), d = t ? y : r, x = V(
2325
- () => d ? me(d) : !1,
2326
- [d]
2327
- ), L = V(
2512
+ data: g,
2513
+ isLoading: x,
2514
+ error: L
2515
+ } = ve(t), b = t ? g : r, $ = O(
2516
+ () => b ? pe(b) : !1,
2517
+ [b]
2518
+ ), S = O(
2328
2519
  () => ({
2329
- ...J,
2330
- ...l,
2520
+ ...X,
2521
+ ...c,
2331
2522
  // Extract name from flow if not provided
2332
- name: l?.name || d?.name || J.name
2523
+ name: c?.name || b?.name || X.name
2333
2524
  }),
2334
- [l, d?.name]
2335
- ), z = V(
2336
- () => d && x ? de(d) : "New message",
2337
- [d, x]
2338
- ), C = a === "dark", T = C ? "rcs-emulator-dark" : "rcs-emulator-light", M = ({ children: S }) => /* @__PURE__ */ e(
2525
+ [c, b?.name]
2526
+ ), N = O(
2527
+ () => b && $ ? ge(b) : "New message",
2528
+ [b, $]
2529
+ ), p = a === "dark", I = p ? "rcs-emulator-dark" : "rcs-emulator-light", z = ({ children: E }) => /* @__PURE__ */ e(
2339
2530
  "div",
2340
2531
  {
2341
- className: `rcs-emulator rcs-emulator-container ${T} ${u}`,
2342
- style: { width: m, height: i },
2532
+ className: `rcs-emulator rcs-emulator-container ${I} ${i}`,
2533
+ style: { width: m, height: u },
2343
2534
  role: "application",
2344
2535
  "aria-label": "RCS Message Emulator",
2345
2536
  "data-theme": a,
2346
- "data-device": c,
2347
- children: S
2537
+ "data-device": l,
2538
+ children: E
2348
2539
  }
2349
2540
  );
2350
- return t && w ? /* @__PURE__ */ e(M, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6", children: [
2541
+ return t && x ? /* @__PURE__ */ e(z, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6", children: [
2351
2542
  /* @__PURE__ */ e(
2352
2543
  "div",
2353
2544
  {
2354
- className: `rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-spinner rcs-emulator-mb-4 ${T}`
2545
+ className: `rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-spinner rcs-emulator-mb-4 ${I}`
2355
2546
  }
2356
2547
  ),
2357
2548
  /* @__PURE__ */ e(
2358
2549
  "p",
2359
2550
  {
2360
- className: `rcs-emulator-text-sm ${C ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2551
+ className: `rcs-emulator-text-sm ${p ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2361
2552
  children: "Loading conversation..."
2362
2553
  }
2363
2554
  )
2364
- ] }) }) : t && g ? /* @__PURE__ */ e(M, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6 rcs-emulator-text-center", children: [
2555
+ ] }) }) : t && L ? /* @__PURE__ */ e(z, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6 rcs-emulator-text-center", children: [
2365
2556
  /* @__PURE__ */ e(
2366
2557
  "svg",
2367
2558
  {
@@ -2383,31 +2574,31 @@ const We = p(function({
2383
2574
  /* @__PURE__ */ e(
2384
2575
  "h3",
2385
2576
  {
2386
- className: `rcs-emulator-text-lg rcs-emulator-font-medium rcs-emulator-mb-2 ${C ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2577
+ className: `rcs-emulator-text-lg rcs-emulator-font-medium rcs-emulator-mb-2 ${p ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2387
2578
  children: "Failed to Load"
2388
2579
  }
2389
2580
  ),
2390
2581
  /* @__PURE__ */ e(
2391
2582
  "p",
2392
2583
  {
2393
- className: `rcs-emulator-text-sm ${C ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2394
- children: g
2584
+ className: `rcs-emulator-text-sm ${p ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2585
+ children: L
2395
2586
  }
2396
2587
  ),
2397
2588
  /* @__PURE__ */ e(
2398
2589
  "p",
2399
2590
  {
2400
- className: `rcs-emulator-text-xs rcs-emulator-mt-2 rcs-emulator-max-w-full ${C ? "rcs-emulator-text-zinc-500" : "rcs-emulator-text-gray-400"}`,
2591
+ className: `rcs-emulator-text-xs rcs-emulator-mt-2 rcs-emulator-max-w-full ${p ? "rcs-emulator-text-zinc-500" : "rcs-emulator-text-gray-400"}`,
2401
2592
  style: { wordBreak: "break-all" },
2402
2593
  children: t
2403
2594
  }
2404
2595
  )
2405
- ] }) }) : d ? x ? /* @__PURE__ */ e(M, { children: v ? /* @__PURE__ */ e(
2406
- Z,
2596
+ ] }) }) : b ? $ ? /* @__PURE__ */ e(z, { children: v ? /* @__PURE__ */ e(
2597
+ te,
2407
2598
  {
2408
2599
  theme: a,
2409
- device: c,
2410
- businessInfo: L,
2600
+ device: l,
2601
+ businessInfo: S,
2411
2602
  state: {
2412
2603
  currentMessageId: null,
2413
2604
  chatHistory: [],
@@ -2427,19 +2618,24 @@ const We = p(function({
2427
2618
  },
2428
2619
  closeWebView: () => {
2429
2620
  },
2430
- children: /* @__PURE__ */ e(Oe, { onUnlock: N, messagePreview: z })
2621
+ toast: null,
2622
+ showToast: () => {
2623
+ },
2624
+ onBack: null,
2625
+ children: /* @__PURE__ */ e(Ze, { onUnlock: k, messagePreview: N })
2431
2626
  }
2432
2627
  ) : /* @__PURE__ */ e(
2433
- Pe,
2628
+ ar,
2434
2629
  {
2435
- flow: d,
2630
+ flow: b,
2436
2631
  onUserReply: o,
2437
2632
  theme: a,
2438
- device: c,
2439
- businessInfo: L,
2440
- showSuggestions: h
2633
+ device: l,
2634
+ businessInfo: S,
2635
+ showSuggestions: d,
2636
+ onBack: h ? w : null
2441
2637
  }
2442
- ) }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6 rcs-emulator-text-center", children: [
2638
+ ) }) : /* @__PURE__ */ e(z, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6 rcs-emulator-text-center", children: [
2443
2639
  /* @__PURE__ */ e(
2444
2640
  "svg",
2445
2641
  {
@@ -2462,22 +2658,22 @@ const We = p(function({
2462
2658
  /* @__PURE__ */ e(
2463
2659
  "h3",
2464
2660
  {
2465
- className: `rcs-emulator-text-lg rcs-emulator-font-medium rcs-emulator-mb-2 ${C ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2661
+ className: `rcs-emulator-text-lg rcs-emulator-font-medium rcs-emulator-mb-2 ${p ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2466
2662
  children: "Invalid RBM JSON"
2467
2663
  }
2468
2664
  ),
2469
2665
  /* @__PURE__ */ e(
2470
2666
  "p",
2471
2667
  {
2472
- className: `rcs-emulator-text-sm ${C ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2668
+ className: `rcs-emulator-text-sm ${p ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2473
2669
  children: "The conversation flow structure is not valid"
2474
2670
  }
2475
2671
  )
2476
- ] }) }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6 rcs-emulator-text-center", children: [
2672
+ ] }) }) : /* @__PURE__ */ e(z, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6 rcs-emulator-text-center", children: [
2477
2673
  /* @__PURE__ */ e(
2478
2674
  "svg",
2479
2675
  {
2480
- className: `rcs-emulator-w-12 rcs-emulator-h-12 rcs-emulator-mb-4 ${C ? "rcs-emulator-text-zinc-600" : "rcs-emulator-text-gray-300"}`,
2676
+ className: `rcs-emulator-w-12 rcs-emulator-h-12 rcs-emulator-mb-4 ${p ? "rcs-emulator-text-zinc-600" : "rcs-emulator-text-gray-300"}`,
2481
2677
  fill: "none",
2482
2678
  viewBox: "0 0 24 24",
2483
2679
  stroke: "currentColor",
@@ -2495,22 +2691,22 @@ const We = p(function({
2495
2691
  /* @__PURE__ */ e(
2496
2692
  "h3",
2497
2693
  {
2498
- className: `rcs-emulator-text-lg rcs-emulator-font-medium rcs-emulator-mb-2 ${C ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2694
+ className: `rcs-emulator-text-lg rcs-emulator-font-medium rcs-emulator-mb-2 ${p ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2499
2695
  children: "No Conversation Data"
2500
2696
  }
2501
2697
  ),
2502
2698
  /* @__PURE__ */ n(
2503
2699
  "p",
2504
2700
  {
2505
- className: `rcs-emulator-text-sm ${C ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2701
+ className: `rcs-emulator-text-sm ${p ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2506
2702
  children: [
2507
2703
  "Provide either",
2508
2704
  " ",
2509
- /* @__PURE__ */ e("code", { className: `rcs-emulator-code-inline ${T}`, children: "messages" }),
2705
+ /* @__PURE__ */ e("code", { className: `rcs-emulator-code-inline ${I}`, children: "messages" }),
2510
2706
  " ",
2511
2707
  "or",
2512
2708
  " ",
2513
- /* @__PURE__ */ e("code", { className: `rcs-emulator-code-inline ${T}`, children: "jsonUrl" }),
2709
+ /* @__PURE__ */ e("code", { className: `rcs-emulator-code-inline ${I}`, children: "jsonUrl" }),
2514
2710
  " ",
2515
2711
  "prop"
2516
2712
  ]
@@ -2519,15 +2715,15 @@ const We = p(function({
2519
2715
  ] }) });
2520
2716
  });
2521
2717
  export {
2522
- Je as RcsEmulator,
2523
- De as WebViewRenderer,
2524
- Je as default,
2525
- de as getFirstMessagePreview,
2526
- oe as getWebViewConfig,
2527
- I as isSuggestedAction,
2528
- Y as isSuggestedReply,
2529
- qe as isWebViewAction,
2530
- pe as useJsonFetch,
2531
- me as validateConversationFlow
2718
+ ir as RcsEmulator,
2719
+ Qe as WebViewRenderer,
2720
+ ir as default,
2721
+ ge as getFirstMessagePreview,
2722
+ ne as getWebViewConfig,
2723
+ T as isSuggestedAction,
2724
+ ee as isSuggestedReply,
2725
+ nr as isWebViewAction,
2726
+ ve as useJsonFetch,
2727
+ pe as validateConversationFlow
2532
2728
  };
2533
2729
  //# sourceMappingURL=rcs-emulator.es.js.map