@maebgch/rcs-emulator 0.1.0

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.
@@ -0,0 +1,2084 @@
1
+ import { jsx as n, jsxs as C } from "react/jsx-runtime";
2
+ import Me, { useContext as je, createContext as Ee, useReducer as De, useRef as ue, useEffect as ie, useState as ne, useCallback as Be, memo as F } from "react";
3
+ var fe = { exports: {} }, he = {};
4
+ var ve;
5
+ function We() {
6
+ if (ve) return he;
7
+ ve = 1;
8
+ var c = Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
9
+ return he.c = function(t) {
10
+ return c.H.useMemoCache(t);
11
+ }, he;
12
+ }
13
+ var ge = {};
14
+ var we;
15
+ function Ve() {
16
+ return we || (we = 1, process.env.NODE_ENV !== "production" && (function() {
17
+ var c = Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
18
+ ge.c = function(t) {
19
+ var e = c.H;
20
+ return e === null && console.error(
21
+ `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
22
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
23
+ 2. You might be breaking the Rules of Hooks
24
+ 3. You might have more than one copy of React in the same app
25
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
26
+ ), e.useMemoCache(t);
27
+ };
28
+ })()), ge;
29
+ }
30
+ var ke;
31
+ function Ue() {
32
+ return ke || (ke = 1, process.env.NODE_ENV === "production" ? fe.exports = We() : fe.exports = Ve()), fe.exports;
33
+ }
34
+ var D = Ue();
35
+ function ze(c) {
36
+ return "reply" in c;
37
+ }
38
+ function le(c) {
39
+ return "action" in c;
40
+ }
41
+ function Bt(c) {
42
+ if (!le(c)) return !1;
43
+ const {
44
+ urlAction: t
45
+ } = c.action;
46
+ return t?.openUrl?.application === "WEBVIEW";
47
+ }
48
+ function He(c) {
49
+ const {
50
+ urlAction: t
51
+ } = c.action;
52
+ return t?.openUrl?.application === "WEBVIEW" ? t.openUrl : null;
53
+ }
54
+ const Oe = {
55
+ name: "Business",
56
+ verified: !1
57
+ }, Pe = {
58
+ currentMessageId: null,
59
+ chatHistory: [],
60
+ isTyping: !1,
61
+ error: null
62
+ }, Ie = Ee(null);
63
+ function Ae(c) {
64
+ const t = D.c(20), {
65
+ children: e,
66
+ theme: s,
67
+ device: l,
68
+ businessInfo: i,
69
+ state: g,
70
+ showSuggestions: r,
71
+ isProfileOpen: o,
72
+ toggleProfile: a,
73
+ onReply: f,
74
+ onAction: h,
75
+ webView: d,
76
+ openWebView: u,
77
+ closeWebView: m
78
+ } = c;
79
+ let p;
80
+ t[0] !== i ? (p = {
81
+ ...Oe,
82
+ ...i
83
+ }, t[0] = i, t[1] = p) : p = t[1];
84
+ let b;
85
+ t[2] !== g ? (b = {
86
+ ...Pe,
87
+ ...g
88
+ }, t[2] = g, t[3] = b) : b = t[3];
89
+ let y;
90
+ t[4] !== m || t[5] !== l || t[6] !== o || t[7] !== h || t[8] !== f || t[9] !== u || t[10] !== r || t[11] !== p || t[12] !== b || t[13] !== s || t[14] !== a || t[15] !== d ? (y = {
91
+ theme: s,
92
+ device: l,
93
+ businessInfo: p,
94
+ state: b,
95
+ showSuggestions: r,
96
+ isProfileOpen: o,
97
+ toggleProfile: a,
98
+ handleReply: f,
99
+ handleAction: h,
100
+ webView: d,
101
+ openWebView: u,
102
+ closeWebView: m
103
+ }, t[4] = m, t[5] = l, t[6] = o, t[7] = h, t[8] = f, t[9] = u, t[10] = r, t[11] = p, t[12] = b, t[13] = s, t[14] = a, t[15] = d, t[16] = y) : y = t[16];
104
+ const v = y;
105
+ let x;
106
+ return t[17] !== e || t[18] !== v ? (x = /* @__PURE__ */ n(Ie.Provider, { value: v, children: e }), t[17] = e, t[18] = v, t[19] = x) : x = t[19], x;
107
+ }
108
+ function K() {
109
+ const c = je(Ie);
110
+ if (!c)
111
+ throw new Error("useEmulator must be used within an EmulatorProvider");
112
+ return c;
113
+ }
114
+ function Re(c) {
115
+ const t = Object.values(c.messages);
116
+ return t.find((e) => e.is_first) || t[0] || null;
117
+ }
118
+ function me(c, t) {
119
+ return c.messages[t] || null;
120
+ }
121
+ function Ne(c, t) {
122
+ const e = c.responses?.keyword?.keyword_response?.choices;
123
+ return e && e[t]?.next_message || null;
124
+ }
125
+ function pe(c, t) {
126
+ const e = c.parts, s = Ge(e), l = qe(e);
127
+ return {
128
+ id: `${c.id}-${t}-${Date.now()}`,
129
+ sender: "business",
130
+ content: s,
131
+ timestamp: Date.now(),
132
+ suggestions: l
133
+ };
134
+ }
135
+ function Ge(c) {
136
+ for (const t of c) {
137
+ const e = t.RCSMessage;
138
+ if (e.textMessage)
139
+ return {
140
+ type: "text",
141
+ text: e.textMessage
142
+ };
143
+ const s = e.richcardMessage?.message?.generalPurposeCard;
144
+ if (s)
145
+ return {
146
+ type: "richcard",
147
+ card: Ce(s.content, s.layout)
148
+ };
149
+ const l = e.richcardMessage?.message?.generalPurposeCardCarousel;
150
+ if (l)
151
+ return {
152
+ type: "carousel",
153
+ cards: l.content.map((i) => Ce(i, {
154
+ cardOrientation: "VERTICAL",
155
+ cardWidth: l.layout.cardWidth
156
+ }))
157
+ };
158
+ }
159
+ return {
160
+ type: "text",
161
+ text: "[Unsupported message type]"
162
+ };
163
+ }
164
+ function Ce(c, t) {
165
+ const e = () => {
166
+ if (c.media) {
167
+ if (c.media.mediaUrl) return c.media.mediaUrl;
168
+ if (c.media.contentInfo?.fileUrl) return c.media.contentInfo.fileUrl;
169
+ }
170
+ }, s = () => {
171
+ if (c.media) {
172
+ if (c.media.thumbnailUri) return c.media.thumbnailUri;
173
+ if (c.media.contentInfo?.thumbnailUrl) return c.media.contentInfo.thumbnailUrl;
174
+ }
175
+ }, l = e();
176
+ return {
177
+ title: c.title,
178
+ description: c.description,
179
+ media: l ? {
180
+ url: l,
181
+ height: Fe(c.media?.height || "MEDIUM_HEIGHT"),
182
+ thumbnailUrl: s()
183
+ } : void 0,
184
+ suggestions: c.suggestions,
185
+ layout: {
186
+ orientation: t.cardOrientation === "HORIZONTAL" ? "horizontal" : "vertical",
187
+ width: t.cardWidth === "SMALL_WIDTH" ? "small" : "medium",
188
+ imageAlignment: t.imageAlignment === "RIGHT" ? "right" : "left"
189
+ }
190
+ };
191
+ }
192
+ function Fe(c) {
193
+ switch (c) {
194
+ case "SHORT_HEIGHT":
195
+ return "short";
196
+ case "TALL_HEIGHT":
197
+ return "tall";
198
+ default:
199
+ return "medium";
200
+ }
201
+ }
202
+ function qe(c) {
203
+ const t = [];
204
+ for (const e of c) {
205
+ const s = e.RCSMessage;
206
+ s.suggestedChipList?.suggestions && t.push(...s.suggestedChipList.suggestions);
207
+ }
208
+ return t;
209
+ }
210
+ function Ye(c) {
211
+ return {
212
+ id: `user-${Date.now()}`,
213
+ sender: "user",
214
+ content: {
215
+ type: "userReply",
216
+ text: c
217
+ },
218
+ timestamp: Date.now()
219
+ };
220
+ }
221
+ function Je(c) {
222
+ if (!c || typeof c != "object") return !1;
223
+ const t = c;
224
+ if (typeof t.name != "string" || !t.messages || typeof t.messages != "object") return !1;
225
+ const e = Object.values(t.messages);
226
+ if (e.length === 0) return !1;
227
+ for (const s of e) {
228
+ if (!s || typeof s != "object") return !1;
229
+ const l = s;
230
+ if (typeof l.id != "string" || !Array.isArray(l.parts)) return !1;
231
+ }
232
+ return !0;
233
+ }
234
+ function Qe(c) {
235
+ const t = Re(c);
236
+ if (!t || !t.parts.length) return "New message";
237
+ const s = t.parts[0].RCSMessage;
238
+ if (s.textMessage)
239
+ return s.textMessage.slice(0, 50) + (s.textMessage.length > 50 ? "..." : "");
240
+ const l = s.richcardMessage?.message?.generalPurposeCard;
241
+ if (l?.content.title)
242
+ return l.content.title;
243
+ const i = s.richcardMessage?.message?.generalPurposeCardCarousel;
244
+ return i?.content[0]?.title ? i.content[0].title : "New message";
245
+ }
246
+ const Te = {
247
+ currentMessageId: null,
248
+ chatHistory: [],
249
+ isTyping: !1,
250
+ error: null
251
+ };
252
+ function Xe(c, t) {
253
+ switch (t.type) {
254
+ case "INIT":
255
+ return {
256
+ ...c,
257
+ currentMessageId: t.messageId,
258
+ error: null
259
+ };
260
+ case "ADD_BUSINESS_MESSAGE":
261
+ return {
262
+ ...c,
263
+ chatHistory: [...c.chatHistory, t.message],
264
+ isTyping: !1
265
+ };
266
+ case "ADD_USER_REPLY": {
267
+ const e = Ye(t.text), s = c.chatHistory.map((l, i) => i === c.chatHistory.length - 1 ? {
268
+ ...l,
269
+ suggestions: void 0
270
+ } : l);
271
+ return {
272
+ ...c,
273
+ chatHistory: [...s, e]
274
+ };
275
+ }
276
+ case "SET_TYPING":
277
+ return {
278
+ ...c,
279
+ isTyping: t.isTyping
280
+ };
281
+ case "NAVIGATE_TO":
282
+ return {
283
+ ...c,
284
+ currentMessageId: t.messageId
285
+ };
286
+ case "SET_ERROR":
287
+ return {
288
+ ...c,
289
+ error: t.error,
290
+ isTyping: !1
291
+ };
292
+ case "RESET":
293
+ return Te;
294
+ default:
295
+ return c;
296
+ }
297
+ }
298
+ function Ze(c) {
299
+ const t = D.c(18), {
300
+ flow: e,
301
+ onUserReply: s,
302
+ typingDelay: l
303
+ } = c, i = l === void 0 ? 800 : l, [g, r] = De(Xe, Te), o = ue(0), a = ue(!1);
304
+ let f, h;
305
+ t[0] !== e ? (f = () => {
306
+ if (a.current)
307
+ return;
308
+ a.current = !0;
309
+ const x = Re(e);
310
+ if (!x) {
311
+ r({
312
+ type: "SET_ERROR",
313
+ error: "No first message found in conversation flow"
314
+ });
315
+ return;
316
+ }
317
+ r({
318
+ type: "INIT",
319
+ messageId: x.id
320
+ }), o.current = o.current + 1;
321
+ const k = pe(x, o.current);
322
+ r({
323
+ type: "ADD_BUSINESS_MESSAGE",
324
+ message: k
325
+ });
326
+ }, h = [e], t[0] = e, t[1] = f, t[2] = h) : (f = t[1], h = t[2]), ie(f, h);
327
+ let d;
328
+ t[3] !== e || t[4] !== s || t[5] !== g.currentMessageId || t[6] !== i ? (d = (x) => {
329
+ if (!ze(x))
330
+ return;
331
+ const {
332
+ displayText: k,
333
+ postback: w
334
+ } = x.reply, N = w.data;
335
+ r({
336
+ type: "ADD_USER_REPLY",
337
+ text: k,
338
+ postbackData: N
339
+ });
340
+ const _ = {
341
+ type: "reply",
342
+ postbackData: N,
343
+ displayText: k,
344
+ timestamp: Date.now()
345
+ };
346
+ s(_);
347
+ const $ = g.currentMessageId ? me(e, g.currentMessageId) : null;
348
+ if (!$) {
349
+ r({
350
+ type: "SET_ERROR",
351
+ error: "Current message not found"
352
+ });
353
+ return;
354
+ }
355
+ const L = Ne($, N);
356
+ if (!L)
357
+ return;
358
+ const A = me(e, L);
359
+ if (!A) {
360
+ r({
361
+ type: "SET_ERROR",
362
+ error: `Next message "${L}" not found`
363
+ });
364
+ return;
365
+ }
366
+ r({
367
+ type: "SET_TYPING",
368
+ isTyping: !0
369
+ }), r({
370
+ type: "NAVIGATE_TO",
371
+ messageId: L
372
+ }), setTimeout(() => {
373
+ o.current = o.current + 1;
374
+ const z = pe(A, o.current);
375
+ r({
376
+ type: "ADD_BUSINESS_MESSAGE",
377
+ message: z
378
+ });
379
+ }, i);
380
+ }, t[3] = e, t[4] = s, t[5] = g.currentMessageId, t[6] = i, t[7] = d) : d = t[7];
381
+ const u = d;
382
+ let m;
383
+ t[8] !== e || t[9] !== s || t[10] !== g.currentMessageId || t[11] !== i ? (m = (x) => {
384
+ if (!le(x))
385
+ return;
386
+ const {
387
+ displayText: k,
388
+ postback: w,
389
+ openUrlAction: N,
390
+ dialAction: _,
391
+ dialerAction: $,
392
+ mapAction: L,
393
+ viewLocationAction: A
394
+ } = x.action, z = w.data, S = _?.phoneNumber || $?.dialPhoneNumber?.phoneNumber, M = L?.showLocation?.location || A?.latLong;
395
+ let I;
396
+ N ? I = {
397
+ type: "openUrl",
398
+ url: N.url
399
+ } : S ? I = {
400
+ type: "dial",
401
+ phoneNumber: S
402
+ } : M && (I = {
403
+ type: "viewLocation",
404
+ latitude: M.latitude,
405
+ longitude: M.longitude,
406
+ query: A?.query
407
+ });
408
+ const R = {
409
+ type: "action",
410
+ postbackData: z,
411
+ displayText: k,
412
+ timestamp: Date.now(),
413
+ actionData: I
414
+ };
415
+ if (s(R), N)
416
+ window.open(N.url, "_blank", "noopener,noreferrer");
417
+ else if (S)
418
+ window.location.href = `tel:${S}`;
419
+ else if (M) {
420
+ const T = L?.showLocation?.location?.label || A?.label || "", O = `https://www.google.com/maps/search/?api=1&query=${M.latitude},${M.longitude}${T ? `&query_place_id=${encodeURIComponent(T)}` : ""}`;
421
+ window.open(O, "_blank", "noopener,noreferrer");
422
+ }
423
+ const B = g.currentMessageId ? me(e, g.currentMessageId) : null;
424
+ if (B) {
425
+ const T = Ne(B, z);
426
+ if (T) {
427
+ const O = me(e, T);
428
+ O && (r({
429
+ type: "ADD_USER_REPLY",
430
+ text: k,
431
+ postbackData: z
432
+ }), r({
433
+ type: "SET_TYPING",
434
+ isTyping: !0
435
+ }), r({
436
+ type: "NAVIGATE_TO",
437
+ messageId: T
438
+ }), setTimeout(() => {
439
+ o.current = o.current + 1;
440
+ const q = pe(O, o.current);
441
+ r({
442
+ type: "ADD_BUSINESS_MESSAGE",
443
+ message: q
444
+ });
445
+ }, i));
446
+ }
447
+ }
448
+ }, t[8] = e, t[9] = s, t[10] = g.currentMessageId, t[11] = i, t[12] = m) : m = t[12];
449
+ const p = m;
450
+ let b;
451
+ t[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = () => {
452
+ a.current = !1, o.current = 0, r({
453
+ type: "RESET"
454
+ });
455
+ }, t[13] = b) : b = t[13];
456
+ const y = b;
457
+ let v;
458
+ return t[14] !== p || t[15] !== u || t[16] !== g ? (v = {
459
+ state: g,
460
+ handleReply: u,
461
+ handleAction: p,
462
+ reset: y
463
+ }, t[14] = p, t[15] = u, t[16] = g, t[17] = v) : v = t[17], v;
464
+ }
465
+ function Ke(c) {
466
+ const [t, e] = ne(null), [s, l] = ne(!1), [i, g] = ne(null), r = Be(async () => {
467
+ if (!c) {
468
+ e(null), g(null);
469
+ return;
470
+ }
471
+ l(!0), g(null);
472
+ try {
473
+ const o = await fetch(c, {
474
+ method: "GET",
475
+ headers: {
476
+ Accept: "application/json"
477
+ }
478
+ });
479
+ if (!o.ok)
480
+ throw new Error(`HTTP ${o.status}: ${o.statusText}`);
481
+ const a = await o.json();
482
+ if (!a || typeof a != "object")
483
+ throw new Error("Invalid JSON: Expected an object");
484
+ if (!a.messages || typeof a.messages != "object")
485
+ throw new Error("Invalid RBM JSON: Missing 'messages' object");
486
+ e(a);
487
+ } catch (o) {
488
+ const a = o instanceof Error ? o.message : "Failed to fetch JSON";
489
+ g(a), e(null);
490
+ } finally {
491
+ l(!1);
492
+ }
493
+ }, [c]);
494
+ return ie(() => {
495
+ r();
496
+ }, [r]), {
497
+ data: t,
498
+ isLoading: s,
499
+ error: i,
500
+ refetch: r
501
+ };
502
+ }
503
+ function et(c) {
504
+ const t = D.c(3), e = ue(null);
505
+ let s;
506
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = () => {
507
+ e.current && e.current.scrollTo({
508
+ top: e.current.scrollHeight,
509
+ behavior: "smooth"
510
+ });
511
+ }, t[0] = s) : s = t[0];
512
+ let l;
513
+ return t[1] !== c ? (l = [c], t[1] = c, t[2] = l) : l = t[2], ie(s, l), e;
514
+ }
515
+ const tt = F(function() {
516
+ const t = D.c(34), {
517
+ theme: e,
518
+ businessInfo: s,
519
+ toggleProfile: l
520
+ } = K(), i = e === "dark", g = s.brandColor || "#0084ff", r = `
521
+ flex items-center gap-3 px-3 py-2.5 border-b
522
+ ${i ? "bg-zinc-900 border-zinc-800" : "bg-white border-gray-100"}
523
+ `, o = `Chat with ${s.name}`, a = `
524
+ p-1.5 -ml-1 rounded-full transition-colors
525
+ ${i ? "hover:bg-zinc-800 text-white" : "hover:bg-gray-100 text-gray-700"}
526
+ `;
527
+ let f;
528
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), t[0] = f) : f = t[0];
529
+ let h;
530
+ t[1] !== a ? (h = /* @__PURE__ */ n("button", { type: "button", className: a, "aria-label": "Go back", children: f }), t[1] = a, t[2] = h) : h = t[2];
531
+ const d = `
532
+ relative w-9 h-9 rounded-full overflow-hidden flex-shrink-0
533
+ ${i ? "bg-zinc-800" : "bg-gray-100"}
534
+ `, u = s.logo ? void 0 : g;
535
+ let m;
536
+ t[3] !== u ? (m = {
537
+ backgroundColor: u
538
+ }, t[3] = u, t[4] = m) : m = t[4];
539
+ let p;
540
+ t[5] !== s.logo || t[6] !== s.name ? (p = s.logo ? /* @__PURE__ */ n("img", { src: s.logo, alt: `${s.name} logo`, className: "w-full h-full object-cover" }) : /* @__PURE__ */ n("div", { className: "w-full h-full flex items-center justify-center text-sm font-bold text-white", children: s.name.charAt(0).toUpperCase() }), t[5] = s.logo, t[6] = s.name, t[7] = p) : p = t[7];
541
+ let b;
542
+ t[8] !== d || t[9] !== m || t[10] !== p ? (b = /* @__PURE__ */ n("div", { className: d, style: m, children: p }), t[8] = d, t[9] = m, t[10] = p, t[11] = b) : b = t[11];
543
+ const y = `
544
+ text-base font-medium truncate
545
+ ${i ? "text-white" : "text-gray-900"}
546
+ `;
547
+ let v;
548
+ t[12] !== s.name || t[13] !== y ? (v = /* @__PURE__ */ n("h1", { className: y, children: s.name }), t[12] = s.name, t[13] = y, t[14] = v) : v = t[14];
549
+ let x;
550
+ t[15] !== v || t[16] !== b || t[17] !== l ? (x = /* @__PURE__ */ C("button", { onClick: l, className: "flex items-center gap-2.5 flex-1 min-w-0 text-left", "aria-label": "View business info", children: [
551
+ b,
552
+ v
553
+ ] }), t[15] = v, t[16] = b, t[17] = l, t[18] = x) : x = t[18];
554
+ let k;
555
+ t[19] !== s.verified || t[20] !== i ? (k = s.verified && /* @__PURE__ */ n("button", { type: "button", className: `
556
+ p-2 rounded-full transition-colors
557
+ ${i ? "hover:bg-zinc-800" : "hover:bg-gray-100"}
558
+ `, "aria-label": "Verified business", children: /* @__PURE__ */ C("svg", { className: "w-5 h-5", viewBox: "0 0 24 24", fill: "none", children: [
559
+ /* @__PURE__ */ n("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z", stroke: i ? "#9ca3af" : "#6b7280", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }),
560
+ /* @__PURE__ */ n("path", { d: "M9 12l2 2 4-4", stroke: "#3b82f6", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })
561
+ ] }) }), t[19] = s.verified, t[20] = i, t[21] = k) : k = t[21];
562
+ const w = `
563
+ p-2 rounded-full transition-colors
564
+ ${i ? "hover:bg-zinc-800 text-zinc-400" : "hover:bg-gray-100 text-gray-500"}
565
+ `;
566
+ let N;
567
+ t[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z" }) }), t[22] = N) : N = t[22];
568
+ let _;
569
+ t[23] !== w ? (_ = /* @__PURE__ */ n("button", { type: "button", className: w, "aria-label": "More options", children: N }), t[23] = w, t[24] = _) : _ = t[24];
570
+ let $;
571
+ t[25] !== k || t[26] !== _ ? ($ = /* @__PURE__ */ C("div", { className: "flex items-center gap-0.5", children: [
572
+ k,
573
+ _
574
+ ] }), t[25] = k, t[26] = _, t[27] = $) : $ = t[27];
575
+ let L;
576
+ return t[28] !== r || t[29] !== o || t[30] !== x || t[31] !== $ || t[32] !== h ? (L = /* @__PURE__ */ C("header", { className: r, role: "banner", "aria-label": o, children: [
577
+ h,
578
+ x,
579
+ $
580
+ ] }), t[28] = r, t[29] = o, t[30] = x, t[31] = $, t[32] = h, t[33] = L) : L = t[33], L;
581
+ }), nt = F(function() {
582
+ const t = D.c(24), {
583
+ theme: e,
584
+ businessInfo: s
585
+ } = K(), l = e === "dark", i = s.brandColor || "#0084ff", g = `
586
+ w-16 h-16 rounded-full overflow-hidden
587
+ ${l ? "bg-zinc-800" : "bg-gray-100"}
588
+ shadow-lg
589
+ `, r = s.logo ? void 0 : i;
590
+ let o;
591
+ t[0] !== r ? (o = {
592
+ backgroundColor: r
593
+ }, t[0] = r, t[1] = o) : o = t[1];
594
+ let a;
595
+ t[2] !== s.logo || t[3] !== s.name ? (a = s.logo ? /* @__PURE__ */ n("img", { src: s.logo, alt: `${s.name} logo`, className: "w-full h-full object-cover" }) : /* @__PURE__ */ n("div", { className: "w-full h-full flex items-center justify-center text-2xl font-bold text-white", children: s.name.charAt(0).toUpperCase() }), t[2] = s.logo, t[3] = s.name, t[4] = a) : a = t[4];
596
+ let f;
597
+ t[5] !== g || t[6] !== o || t[7] !== a ? (f = /* @__PURE__ */ n("div", { className: g, style: o, children: a }), t[5] = g, t[6] = o, t[7] = a, t[8] = f) : f = t[8];
598
+ let h;
599
+ t[9] !== s.verified ? (h = s.verified && /* @__PURE__ */ n("div", { className: "absolute -bottom-0.5 -right-0.5 w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center border-2 border-white shadow-sm", children: /* @__PURE__ */ n("svg", { className: "w-3 h-3 text-white", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ n("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" }) }) }), t[9] = s.verified, t[10] = h) : h = t[10];
600
+ let d;
601
+ t[11] !== f || t[12] !== h ? (d = /* @__PURE__ */ C("div", { className: "relative mb-3", children: [
602
+ f,
603
+ h
604
+ ] }), t[11] = f, t[12] = h, t[13] = d) : d = t[13];
605
+ const u = `
606
+ text-lg font-semibold text-center
607
+ ${l ? "text-white" : "text-gray-900"}
608
+ `;
609
+ let m;
610
+ t[14] !== s.name || t[15] !== u ? (m = /* @__PURE__ */ n("h1", { className: u, children: s.name }), t[14] = s.name, t[15] = u, t[16] = m) : m = t[16];
611
+ let p;
612
+ t[17] !== s.description || t[18] !== l ? (p = s.description && /* @__PURE__ */ n("p", { className: `
613
+ text-sm text-center mt-0.5
614
+ ${l ? "text-zinc-400" : "text-gray-500"}
615
+ `, children: s.description }), t[17] = s.description, t[18] = l, t[19] = p) : p = t[19];
616
+ let b;
617
+ return t[20] !== d || t[21] !== m || t[22] !== p ? (b = /* @__PURE__ */ C("div", { className: "flex flex-col items-center py-4 px-4", children: [
618
+ d,
619
+ m,
620
+ p
621
+ ] }), t[20] = d, t[21] = m, t[22] = p, t[23] = b) : b = t[23], b;
622
+ }), st = F(function(t) {
623
+ const e = D.c(26), {
624
+ text: s,
625
+ sender: l,
626
+ timestamp: i
627
+ } = t, {
628
+ theme: g,
629
+ businessInfo: r
630
+ } = K(), o = g === "dark", a = l === "business", f = r.brandColor || "#0084ff";
631
+ let h;
632
+ e[0] !== i ? (h = new Date(i).toLocaleTimeString([], {
633
+ hour: "2-digit",
634
+ minute: "2-digit"
635
+ }), e[0] = i, e[1] = h) : h = e[1];
636
+ const d = h;
637
+ if (a) {
638
+ const k = `
639
+ px-4 py-3 rounded-2xl text-sm leading-relaxed
640
+ ${o ? "bg-zinc-800 text-white" : "bg-gray-100 text-gray-900"}
641
+ `;
642
+ let w;
643
+ e[2] !== k || e[3] !== s ? (w = /* @__PURE__ */ n("div", { className: k, children: s }), e[2] = k, e[3] = s, e[4] = w) : w = e[4];
644
+ let N;
645
+ e[5] !== d ? (N = /* @__PURE__ */ n("span", { className: "sr-only", children: d }), e[5] = d, e[6] = N) : N = e[6];
646
+ let _;
647
+ return e[7] !== w || e[8] !== N ? (_ = /* @__PURE__ */ C("div", { className: "max-w-[90%]", children: [
648
+ w,
649
+ N
650
+ ] }), e[7] = w, e[8] = N, e[9] = _) : _ = e[9], _;
651
+ }
652
+ let u;
653
+ e[10] !== f ? (u = {
654
+ backgroundColor: f
655
+ }, e[10] = f, e[11] = u) : u = e[11];
656
+ let m;
657
+ e[12] !== u || e[13] !== s ? (m = /* @__PURE__ */ n("div", { className: "px-4 py-2.5 rounded-full text-white text-sm leading-relaxed", style: u, children: s }), e[12] = u, e[13] = s, e[14] = m) : m = e[14];
658
+ let p;
659
+ e[15] !== f ? (p = {
660
+ backgroundColor: f
661
+ }, e[15] = f, e[16] = p) : p = e[16];
662
+ let b;
663
+ e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ n("svg", { className: "w-3 h-3 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), e[17] = b) : b = e[17];
664
+ let y;
665
+ e[18] !== p ? (y = /* @__PURE__ */ n("div", { className: "w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0", style: p, children: b }), e[18] = p, e[19] = y) : y = e[19];
666
+ let v;
667
+ e[20] !== d ? (v = /* @__PURE__ */ n("span", { className: "sr-only", children: d }), e[20] = d, e[21] = v) : v = e[21];
668
+ let x;
669
+ return e[22] !== m || e[23] !== y || e[24] !== v ? (x = /* @__PURE__ */ C("div", { className: "flex items-end gap-1.5 max-w-[85%] ml-auto", children: [
670
+ m,
671
+ y,
672
+ v
673
+ ] }), e[22] = m, e[23] = y, e[24] = v, e[25] = x) : x = e[25], x;
674
+ }), lt = F(function(t) {
675
+ const e = D.c(18), {
676
+ text: s,
677
+ timestamp: l
678
+ } = t, {
679
+ businessInfo: i
680
+ } = K(), g = i.brandColor || "#0084ff";
681
+ let r;
682
+ e[0] !== l ? (r = new Date(l).toLocaleTimeString([], {
683
+ hour: "2-digit",
684
+ minute: "2-digit"
685
+ }), e[0] = l, e[1] = r) : r = e[1];
686
+ const o = r;
687
+ let a;
688
+ e[2] !== g ? (a = {
689
+ backgroundColor: g
690
+ }, e[2] = g, e[3] = a) : a = e[3];
691
+ let f;
692
+ e[4] !== a || e[5] !== s ? (f = /* @__PURE__ */ n("div", { className: "px-4 py-2.5 rounded-full text-white text-sm leading-relaxed shadow-sm", style: a, children: s }), e[4] = a, e[5] = s, e[6] = f) : f = e[6];
693
+ let h;
694
+ e[7] !== g ? (h = {
695
+ backgroundColor: g
696
+ }, e[7] = g, e[8] = h) : h = e[8];
697
+ let d;
698
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ n("svg", { className: "w-3 h-3 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), e[9] = d) : d = e[9];
699
+ let u;
700
+ e[10] !== h ? (u = /* @__PURE__ */ n("div", { className: "w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0", style: h, children: d }), e[10] = h, e[11] = u) : u = e[11];
701
+ let m;
702
+ e[12] !== o ? (m = /* @__PURE__ */ n("span", { className: "sr-only", children: o }), e[12] = o, e[13] = m) : m = e[13];
703
+ let p;
704
+ return e[14] !== f || e[15] !== u || e[16] !== m ? (p = /* @__PURE__ */ C("div", { className: "flex items-end gap-1.5 max-w-[85%] ml-auto", children: [
705
+ f,
706
+ u,
707
+ m
708
+ ] }), e[14] = f, e[15] = u, e[16] = m, e[17] = p) : p = e[17], p;
709
+ }), rt = F(function(t) {
710
+ const e = D.c(32), {
711
+ card: s,
712
+ timestamp: l
713
+ } = t, {
714
+ theme: i,
715
+ handleReply: g,
716
+ handleAction: r
717
+ } = K(), o = i === "dark";
718
+ let a;
719
+ e[0] !== l ? (a = new Date(l).toLocaleTimeString([], {
720
+ hour: "2-digit",
721
+ minute: "2-digit"
722
+ }), e[0] = l, e[1] = a) : a = e[1];
723
+ const f = a;
724
+ let h;
725
+ e[2] !== r || e[3] !== g ? (h = (L) => {
726
+ "reply" in L ? g(L) : r(L);
727
+ }, e[2] = r, e[3] = g, e[4] = h) : h = e[4];
728
+ const d = h;
729
+ let u;
730
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = {
731
+ short: "h-36",
732
+ medium: "h-44",
733
+ tall: "h-56"
734
+ }, e[5] = u) : u = e[5];
735
+ const m = u, b = `
736
+ overflow-hidden rounded-2xl w-full shadow-sm
737
+ ${o ? "bg-zinc-800" : "bg-[#e8f5e9]"}
738
+ `;
739
+ let y;
740
+ e[6] !== s.media || e[7] !== s.title ? (y = s.media && /* @__PURE__ */ n("div", { className: `
741
+ w-full overflow-hidden
742
+ ${m[s.media.height]}
743
+ `, children: /* @__PURE__ */ n("img", { src: s.media.url, alt: s.title || "Rich card media", className: "w-full h-full object-cover", loading: "lazy" }) }), e[6] = s.media, e[7] = s.title, e[8] = y) : y = e[8];
744
+ let v;
745
+ e[9] !== s.title || e[10] !== o ? (v = s.title && /* @__PURE__ */ n("h3", { className: `
746
+ text-base font-semibold leading-snug
747
+ ${o ? "text-white" : "text-gray-900"}
748
+ `, children: s.title }), e[9] = s.title, e[10] = o, e[11] = v) : v = e[11];
749
+ let x;
750
+ e[12] !== s.description || e[13] !== o ? (x = s.description && /* @__PURE__ */ n("p", { className: `
751
+ text-sm leading-relaxed mt-1.5
752
+ ${o ? "text-zinc-300" : "text-gray-700"}
753
+ `, children: s.description }), e[12] = s.description, e[13] = o, e[14] = x) : x = e[14];
754
+ let k;
755
+ e[15] !== s.suggestions || e[16] !== d || e[17] !== o ? (k = s.suggestions && s.suggestions.length > 0 && /* @__PURE__ */ n("div", { className: `
756
+ mt-4 rounded-xl overflow-hidden divide-y
757
+ ${o ? "divide-zinc-700 bg-zinc-800" : "divide-gray-100 bg-white"}
758
+ `, children: s.suggestions.map((L, A) => /* @__PURE__ */ n(dt, { suggestion: L, onClick: () => d(L), isDark: o }, A)) }), e[15] = s.suggestions, e[16] = d, e[17] = o, e[18] = k) : k = e[18];
759
+ let w;
760
+ e[19] !== v || e[20] !== x || e[21] !== k ? (w = /* @__PURE__ */ C("div", { className: "p-4", children: [
761
+ v,
762
+ x,
763
+ k
764
+ ] }), e[19] = v, e[20] = x, e[21] = k, e[22] = w) : w = e[22];
765
+ let N;
766
+ e[23] !== b || e[24] !== y || e[25] !== w ? (N = /* @__PURE__ */ C("div", { className: b, children: [
767
+ y,
768
+ w
769
+ ] }), e[23] = b, e[24] = y, e[25] = w, e[26] = N) : N = e[26];
770
+ let _;
771
+ e[27] !== f ? (_ = /* @__PURE__ */ n("span", { className: "sr-only", children: f }), e[27] = f, e[28] = _) : _ = e[28];
772
+ let $;
773
+ return e[29] !== N || e[30] !== _ ? ($ = /* @__PURE__ */ C("div", { className: "w-full", children: [
774
+ N,
775
+ _
776
+ ] }), e[29] = N, e[30] = _, e[31] = $) : $ = e[31], $;
777
+ }), ae = "w-5 h-5 text-gray-400", ot = () => {
778
+ const c = D.c(1);
779
+ let t;
780
+ return c[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ n("svg", { className: ae, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }), c[0] = t) : t = c[0], t;
781
+ }, it = () => {
782
+ const c = D.c(1);
783
+ let t;
784
+ return c[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ n("svg", { className: ae, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }), c[0] = t) : t = c[0], t;
785
+ }, at = () => {
786
+ const c = D.c(1);
787
+ let t;
788
+ return c[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ C("svg", { className: ae, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
789
+ /* @__PURE__ */ n("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" }),
790
+ /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
791
+ ] }), c[0] = t) : t = c[0], t;
792
+ }, ct = () => {
793
+ const c = D.c(1);
794
+ let t;
795
+ return c[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ n("svg", { className: ae, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }), c[0] = t) : t = c[0], t;
796
+ }, _e = () => {
797
+ const c = D.c(1);
798
+ let t;
799
+ return c[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ n("svg", { className: ae, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }), c[0] = t) : t = c[0], t;
800
+ }, dt = F(function(t) {
801
+ const e = D.c(15), {
802
+ suggestion: s,
803
+ onClick: l,
804
+ isDark: i
805
+ } = t;
806
+ let g;
807
+ e[0] !== s ? (g = le(s), e[0] = s, e[1] = g) : g = e[1];
808
+ const r = g, o = r ? s.action.displayText : s.reply.displayText;
809
+ let a;
810
+ e[2] !== r || e[3] !== s ? (a = () => {
811
+ if (!r)
812
+ return /* @__PURE__ */ n(_e, {});
813
+ const {
814
+ action: b
815
+ } = s;
816
+ return b.urlAction || b.openUrlAction ? /* @__PURE__ */ n(ot, {}) : b.dialerAction || b.dialAction ? /* @__PURE__ */ n(it, {}) : b.mapAction || b.viewLocationAction ? /* @__PURE__ */ n(at, {}) : b.calendarAction || b.createCalendarEventAction ? /* @__PURE__ */ n(ct, {}) : /* @__PURE__ */ n(_e, {});
817
+ }, e[2] = r, e[3] = s, e[4] = a) : a = e[4];
818
+ const f = a, h = `
819
+ w-full flex items-center gap-3 px-4 py-3 text-left transition-colors
820
+ ${i ? "hover:bg-zinc-700" : "hover:bg-gray-50"}
821
+ `;
822
+ let d;
823
+ e[5] !== f ? (d = /* @__PURE__ */ n("span", { className: "flex-shrink-0", children: f() }), e[5] = f, e[6] = d) : d = e[6];
824
+ const u = `text-sm ${i ? "text-white" : "text-gray-900"}`;
825
+ let m;
826
+ e[7] !== o || e[8] !== u ? (m = /* @__PURE__ */ n("span", { className: u, children: o }), e[7] = o, e[8] = u, e[9] = m) : m = e[9];
827
+ let p;
828
+ return e[10] !== l || e[11] !== h || e[12] !== d || e[13] !== m ? (p = /* @__PURE__ */ C("button", { onClick: l, className: h, children: [
829
+ d,
830
+ m
831
+ ] }), e[10] = l, e[11] = h, e[12] = d, e[13] = m, e[14] = p) : p = e[14], p;
832
+ }), ft = F(function(t) {
833
+ const e = D.c(32), {
834
+ cards: s,
835
+ timestamp: l
836
+ } = t, {
837
+ theme: i,
838
+ handleReply: g,
839
+ handleAction: r
840
+ } = K(), o = ue(null), [a, f] = ne(!1), [h, d] = ne(s.length > 1), u = i === "dark";
841
+ let m;
842
+ e[0] !== l ? (m = new Date(l).toLocaleTimeString([], {
843
+ hour: "2-digit",
844
+ minute: "2-digit"
845
+ }), e[0] = l, e[1] = m) : m = e[1];
846
+ const p = m;
847
+ let b;
848
+ e[2] !== r || e[3] !== g ? (b = (I) => {
849
+ "reply" in I ? g(I) : r(I);
850
+ }, e[2] = r, e[3] = g, e[4] = b) : b = e[4];
851
+ const y = b;
852
+ let v;
853
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = () => {
854
+ if (o.current) {
855
+ const {
856
+ scrollLeft: I,
857
+ scrollWidth: R,
858
+ clientWidth: B
859
+ } = o.current;
860
+ f(I > 0), d(I < R - B - 10);
861
+ }
862
+ }, e[5] = v) : v = e[5];
863
+ const x = v;
864
+ let k;
865
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = (I) => {
866
+ o.current && o.current.scrollBy({
867
+ left: I === "left" ? -200 : 200,
868
+ behavior: "smooth"
869
+ });
870
+ }, e[6] = k) : k = e[6];
871
+ const w = k;
872
+ let N;
873
+ e[7] !== a || e[8] !== u ? (N = a && /* @__PURE__ */ n("button", { onClick: () => w("left"), className: `
874
+ absolute left-2 top-1/2 -translate-y-1/2 z-10
875
+ w-8 h-8 rounded-full flex items-center justify-center
876
+ shadow-lg transition-opacity
877
+ ${u ? "bg-zinc-700 text-white" : "bg-white text-gray-700"}
878
+ `, "aria-label": "Scroll left", children: /* @__PURE__ */ n("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }) }), e[7] = a, e[8] = u, e[9] = N) : N = e[9];
879
+ let _;
880
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = {
881
+ scrollbarWidth: "none",
882
+ msOverflowStyle: "none"
883
+ }, e[10] = _) : _ = e[10];
884
+ let $;
885
+ if (e[11] !== s || e[12] !== y || e[13] !== u) {
886
+ let I;
887
+ e[15] !== y || e[16] !== u ? (I = (R, B) => /* @__PURE__ */ n(ut, { card: R, isDark: u, onSuggestionClick: y }, B), e[15] = y, e[16] = u, e[17] = I) : I = e[17], $ = s.map(I), e[11] = s, e[12] = y, e[13] = u, e[14] = $;
888
+ } else
889
+ $ = e[14];
890
+ let L;
891
+ e[18] !== $ ? (L = /* @__PURE__ */ n("div", { ref: o, onScroll: x, className: "flex gap-2.5 overflow-x-auto py-1 px-3 snap-x snap-mandatory", style: _, children: $ }), e[18] = $, e[19] = L) : L = e[19];
892
+ let A;
893
+ e[20] !== h || e[21] !== u ? (A = h && /* @__PURE__ */ n("button", { onClick: () => w("right"), className: `
894
+ absolute right-2 top-1/2 -translate-y-1/2 z-10
895
+ w-8 h-8 rounded-full flex items-center justify-center
896
+ shadow-lg transition-opacity
897
+ ${u ? "bg-zinc-700 text-white" : "bg-white text-gray-700"}
898
+ `, "aria-label": "Scroll right", children: /* @__PURE__ */ n("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) }) }), e[20] = h, e[21] = u, e[22] = A) : A = e[22];
899
+ let z;
900
+ e[23] !== N || e[24] !== L || e[25] !== A ? (z = /* @__PURE__ */ C("div", { className: "relative", children: [
901
+ N,
902
+ L,
903
+ A
904
+ ] }), e[23] = N, e[24] = L, e[25] = A, e[26] = z) : z = e[26];
905
+ let S;
906
+ e[27] !== p ? (S = /* @__PURE__ */ n("span", { className: "sr-only", children: p }), e[27] = p, e[28] = S) : S = e[28];
907
+ let M;
908
+ return e[29] !== z || e[30] !== S ? (M = /* @__PURE__ */ C("div", { className: "w-full -mx-3", children: [
909
+ z,
910
+ S
911
+ ] }), e[29] = z, e[30] = S, e[31] = M) : M = e[31], M;
912
+ }), oe = "w-4 h-4 text-gray-400", mt = (c) => {
913
+ if (!le(c))
914
+ return /* @__PURE__ */ n("svg", { className: oe, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) });
915
+ const {
916
+ action: t
917
+ } = c;
918
+ return t.urlAction || t.openUrlAction ? /* @__PURE__ */ n("svg", { className: oe, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }) : t.dialerAction || t.dialAction ? /* @__PURE__ */ n("svg", { className: oe, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }) : t.mapAction || t.viewLocationAction ? /* @__PURE__ */ C("svg", { className: oe, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
919
+ /* @__PURE__ */ n("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" }),
920
+ /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
921
+ ] }) : t.calendarAction || t.createCalendarEventAction ? /* @__PURE__ */ n("svg", { className: oe, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }) : /* @__PURE__ */ n("svg", { className: oe, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) });
922
+ }, ut = F(function(t) {
923
+ const e = D.c(21), {
924
+ card: s,
925
+ isDark: l,
926
+ onSuggestionClick: i
927
+ } = t, r = `
928
+ flex-shrink-0 snap-start rounded-2xl overflow-hidden shadow-sm
929
+ ${s.layout.width === "small" ? "w-44" : "w-52"}
930
+ ${l ? "bg-zinc-800" : "bg-[#e8f5e9]"}
931
+ `;
932
+ let o;
933
+ e[0] !== s.media || e[1] !== s.title ? (o = s.media && /* @__PURE__ */ n("div", { className: "w-full h-32 bg-gray-200 overflow-hidden", children: /* @__PURE__ */ n("img", { src: s.media.url, alt: s.title || "Carousel card media", className: "w-full h-full object-cover", loading: "lazy" }) }), e[0] = s.media, e[1] = s.title, e[2] = o) : o = e[2];
934
+ let a;
935
+ e[3] !== s.title || e[4] !== l ? (a = s.title && /* @__PURE__ */ n("h4", { className: `
936
+ text-sm font-semibold leading-tight mb-1 line-clamp-2
937
+ ${l ? "text-white" : "text-gray-900"}
938
+ `, children: s.title }), e[3] = s.title, e[4] = l, e[5] = a) : a = e[5];
939
+ let f;
940
+ e[6] !== s.description || e[7] !== l ? (f = s.description && /* @__PURE__ */ n("p", { className: `
941
+ text-xs leading-relaxed line-clamp-3
942
+ ${l ? "text-zinc-400" : "text-gray-700"}
943
+ `, children: s.description }), e[6] = s.description, e[7] = l, e[8] = f) : f = e[8];
944
+ let h;
945
+ e[9] !== s.suggestions || e[10] !== l || e[11] !== i ? (h = s.suggestions && s.suggestions.length > 0 && /* @__PURE__ */ n("div", { className: `
946
+ mt-3 rounded-lg overflow-hidden divide-y
947
+ ${l ? "divide-zinc-600 bg-zinc-700" : "divide-gray-100 bg-white"}
948
+ `, children: s.suggestions.map((m, p) => {
949
+ const y = le(m) ? m.action.displayText : m.reply.displayText;
950
+ return /* @__PURE__ */ C("button", { onClick: () => i(m), className: `
951
+ w-full flex items-center gap-2 px-3 py-2.5
952
+ text-xs transition-colors text-left
953
+ ${l ? "hover:bg-zinc-600 text-white" : "hover:bg-gray-50 text-gray-900"}
954
+ `, children: [
955
+ /* @__PURE__ */ n("span", { className: "flex-shrink-0", children: mt(m) }),
956
+ /* @__PURE__ */ n("span", { className: "truncate", children: y })
957
+ ] }, p);
958
+ }) }), e[9] = s.suggestions, e[10] = l, e[11] = i, e[12] = h) : h = e[12];
959
+ let d;
960
+ e[13] !== a || e[14] !== f || e[15] !== h ? (d = /* @__PURE__ */ C("div", { className: "p-3", children: [
961
+ a,
962
+ f,
963
+ h
964
+ ] }), e[13] = a, e[14] = f, e[15] = h, e[16] = d) : d = e[16];
965
+ let u;
966
+ return e[17] !== r || e[18] !== o || e[19] !== d ? (u = /* @__PURE__ */ C("div", { className: r, children: [
967
+ o,
968
+ d
969
+ ] }), e[17] = r, e[18] = o, e[19] = d, e[20] = u) : u = e[20], u;
970
+ }), ht = {
971
+ text: ({
972
+ content: c,
973
+ sender: t,
974
+ timestamp: e
975
+ }) => c.type !== "text" ? null : /* @__PURE__ */ n(st, { text: c.text, sender: t, timestamp: e }),
976
+ userReply: ({
977
+ content: c,
978
+ timestamp: t
979
+ }) => c.type !== "userReply" ? null : /* @__PURE__ */ n(lt, { text: c.text, timestamp: t }),
980
+ richcard: ({
981
+ content: c,
982
+ timestamp: t
983
+ }) => c.type !== "richcard" ? null : /* @__PURE__ */ n(rt, { card: c.card, timestamp: t }),
984
+ carousel: ({
985
+ content: c,
986
+ timestamp: t
987
+ }) => c.type !== "carousel" ? null : /* @__PURE__ */ n(ft, { cards: c.cards, timestamp: t })
988
+ }, gt = F(function(t) {
989
+ const e = D.c(7), {
990
+ message: s,
991
+ isLast: l
992
+ } = t, {
993
+ content: i,
994
+ sender: g,
995
+ timestamp: r
996
+ } = s, o = ht[i.type];
997
+ if (!o) {
998
+ console.warn(`Unknown message type: ${i.type}`);
999
+ let h;
1000
+ return e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ n("div", { className: "px-4 py-2 text-gray-500 text-sm italic", children: "[Unsupported message type]" }), e[0] = h) : h = e[0], h;
1001
+ }
1002
+ const a = l && g === "business";
1003
+ let f;
1004
+ return e[1] !== o || e[2] !== i || e[3] !== g || e[4] !== a || e[5] !== r ? (f = /* @__PURE__ */ n(o, { content: i, sender: g, timestamp: r, showSuggestions: a }), e[1] = o, e[2] = i, e[3] = g, e[4] = a, e[5] = r, e[6] = f) : f = e[6], f;
1005
+ }), pt = F(function() {
1006
+ const t = D.c(11), {
1007
+ theme: e
1008
+ } = K(), s = e === "dark", l = `
1009
+ inline-flex items-center gap-1 px-4 py-3 rounded-2xl rounded-bl-sm
1010
+ ${s ? "bg-zinc-800" : "bg-gray-100"}
1011
+ `, i = `
1012
+ rcs-typing-dot w-2 h-2 rounded-full
1013
+ ${s ? "bg-zinc-500" : "bg-gray-400"}
1014
+ `;
1015
+ let g;
1016
+ t[0] !== i ? (g = /* @__PURE__ */ n("span", { className: i }), t[0] = i, t[1] = g) : g = t[1];
1017
+ const r = `
1018
+ rcs-typing-dot w-2 h-2 rounded-full
1019
+ ${s ? "bg-zinc-500" : "bg-gray-400"}
1020
+ `;
1021
+ let o;
1022
+ t[2] !== r ? (o = /* @__PURE__ */ n("span", { className: r }), t[2] = r, t[3] = o) : o = t[3];
1023
+ const a = `
1024
+ rcs-typing-dot w-2 h-2 rounded-full
1025
+ ${s ? "bg-zinc-500" : "bg-gray-400"}
1026
+ `;
1027
+ let f;
1028
+ t[4] !== a ? (f = /* @__PURE__ */ n("span", { className: a }), t[4] = a, t[5] = f) : f = t[5];
1029
+ let h;
1030
+ return t[6] !== l || t[7] !== g || t[8] !== o || t[9] !== f ? (h = /* @__PURE__ */ n("div", { className: "flex items-start gap-2 px-4 py-2", role: "status", "aria-label": "Business is typing", children: /* @__PURE__ */ C("div", { className: l, children: [
1031
+ g,
1032
+ o,
1033
+ f
1034
+ ] }) }), t[6] = l, t[7] = g, t[8] = o, t[9] = f, t[10] = h) : h = t[10], h;
1035
+ }), bt = F(function() {
1036
+ const t = D.c(25), {
1037
+ theme: e,
1038
+ state: s
1039
+ } = K(), {
1040
+ chatHistory: l,
1041
+ isTyping: i
1042
+ } = s, g = e === "dark";
1043
+ let r;
1044
+ t[0] !== l.length || t[1] !== g ? (r = l.length > 0 && /* @__PURE__ */ n("div", { className: "flex justify-center py-2", children: /* @__PURE__ */ n("span", { className: `
1045
+ text-xs font-medium px-3 py-1
1046
+ ${g ? "text-zinc-500" : "text-gray-500"}
1047
+ `, children: "Today" }) }), t[0] = l.length, t[1] = g, t[2] = r) : r = t[2];
1048
+ const o = `
1049
+ rounded-3xl overflow-hidden
1050
+ ${g ? "bg-zinc-900" : "bg-gray-50"}
1051
+ `;
1052
+ let a;
1053
+ t[3] !== l.length || t[4] !== g || t[5] !== i ? (a = l.length === 0 && !i && /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ n("p", { className: `text-sm ${g ? "text-zinc-500" : "text-gray-400"}`, children: "No messages yet" }) }), t[3] = l.length, t[4] = g, t[5] = i, t[6] = a) : a = t[6];
1054
+ let f;
1055
+ if (t[7] !== l || t[8] !== i) {
1056
+ let p;
1057
+ t[10] !== l.length || t[11] !== i ? (p = (b, y) => /* @__PURE__ */ n("div", { className: `
1058
+ ${b.sender === "user" ? "flex justify-end" : "flex justify-start"}
1059
+ `, children: /* @__PURE__ */ n(gt, { message: b, isLast: y === l.length - 1 && !i }) }, b.id), t[10] = l.length, t[11] = i, t[12] = p) : p = t[12], f = l.map(p), t[7] = l, t[8] = i, t[9] = f;
1060
+ } else
1061
+ f = t[9];
1062
+ let h;
1063
+ t[13] !== i ? (h = i && /* @__PURE__ */ n(pt, {}), t[13] = i, t[14] = h) : h = t[14];
1064
+ let d;
1065
+ t[15] !== f || t[16] !== h ? (d = /* @__PURE__ */ C("div", { className: "p-3 space-y-3", children: [
1066
+ f,
1067
+ h
1068
+ ] }), t[15] = f, t[16] = h, t[17] = d) : d = t[17];
1069
+ let u;
1070
+ t[18] !== o || t[19] !== a || t[20] !== d ? (u = /* @__PURE__ */ C("div", { className: o, children: [
1071
+ a,
1072
+ d
1073
+ ] }), t[18] = o, t[19] = a, t[20] = d, t[21] = u) : u = t[21];
1074
+ let m;
1075
+ return t[22] !== r || t[23] !== u ? (m = /* @__PURE__ */ C("div", { className: "px-3 pb-3 space-y-3", role: "log", "aria-label": "Chat messages", "aria-live": "polite", children: [
1076
+ r,
1077
+ u
1078
+ ] }), t[22] = r, t[23] = u, t[24] = m) : m = t[24], m;
1079
+ }), xt = F(function(t) {
1080
+ const e = D.c(35), {
1081
+ suggestion: s,
1082
+ onClick: l,
1083
+ variant: i
1084
+ } = t, g = i === void 0 ? "bar" : i, {
1085
+ theme: r,
1086
+ businessInfo: o
1087
+ } = K(), a = r === "dark";
1088
+ let f;
1089
+ e[0] !== s ? (f = le(s), e[0] = s, e[1] = f) : f = e[1];
1090
+ const h = f, d = h ? s.action.displayText : s.reply.displayText;
1091
+ let u;
1092
+ e[2] !== h || e[3] !== s ? (u = h ? yt(s) : null, e[2] = h, e[3] = s, e[4] = u) : u = e[4];
1093
+ const m = u, p = o.brandColor || "#0084ff";
1094
+ if (g === "bar") {
1095
+ const v = `
1096
+ inline-flex items-center gap-2 px-4 py-2 rounded-full text-sm font-medium
1097
+ whitespace-nowrap transition-colors flex-shrink-0
1098
+ border
1099
+ ${a ? "bg-zinc-800 border-zinc-700 hover:bg-zinc-700 text-white" : "bg-white border-gray-300 hover:bg-gray-50 text-gray-900"}
1100
+ `;
1101
+ let x;
1102
+ e[5] !== d || e[6] !== h || e[7] !== s ? (x = h ? `${vt(s)}: ${d}` : d, e[5] = d, e[6] = h, e[7] = s, e[8] = x) : x = e[8];
1103
+ let k;
1104
+ e[9] !== m || e[10] !== p ? (k = m && /* @__PURE__ */ n("span", { style: {
1105
+ color: p
1106
+ }, children: /* @__PURE__ */ n(m, { className: "w-4 h-4" }) }), e[9] = m, e[10] = p, e[11] = k) : k = e[11];
1107
+ let w;
1108
+ e[12] !== d ? (w = /* @__PURE__ */ n("span", { children: d }), e[12] = d, e[13] = w) : w = e[13];
1109
+ let N;
1110
+ return e[14] !== l || e[15] !== v || e[16] !== x || e[17] !== k || e[18] !== w ? (N = /* @__PURE__ */ C("button", { type: "button", onClick: l, className: v, "aria-label": x, children: [
1111
+ k,
1112
+ w
1113
+ ] }), e[14] = l, e[15] = v, e[16] = x, e[17] = k, e[18] = w, e[19] = N) : N = e[19], N;
1114
+ }
1115
+ if (g === "card") {
1116
+ const v = `
1117
+ w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors rounded-lg
1118
+ ${a ? "hover:bg-zinc-700" : "hover:bg-gray-100"}
1119
+ `;
1120
+ let x;
1121
+ e[20] !== m || e[21] !== p ? (x = m && /* @__PURE__ */ n("div", { className: "w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0", style: {
1122
+ backgroundColor: `${p}15`
1123
+ }, children: /* @__PURE__ */ n(m, { className: "w-4 h-4", style: {
1124
+ color: p
1125
+ } }) }), e[20] = m, e[21] = p, e[22] = x) : x = e[22];
1126
+ const k = `text-sm font-medium ${a ? "text-white" : "text-gray-900"}`;
1127
+ let w;
1128
+ e[23] !== d || e[24] !== k ? (w = /* @__PURE__ */ n("span", { className: k, children: d }), e[23] = d, e[24] = k, e[25] = w) : w = e[25];
1129
+ let N;
1130
+ return e[26] !== l || e[27] !== v || e[28] !== x || e[29] !== w ? (N = /* @__PURE__ */ C("button", { type: "button", onClick: l, className: v, children: [
1131
+ x,
1132
+ w
1133
+ ] }), e[26] = l, e[27] = v, e[28] = x, e[29] = w, e[30] = N) : N = e[30], N;
1134
+ }
1135
+ const b = `
1136
+ w-full px-3 py-2 rounded-lg text-xs font-medium text-center
1137
+ border transition-colors
1138
+ ${a ? "border-zinc-600 hover:bg-zinc-700 text-white" : "border-gray-300 hover:bg-gray-50 text-gray-900"}
1139
+ `;
1140
+ let y;
1141
+ return e[31] !== d || e[32] !== l || e[33] !== b ? (y = /* @__PURE__ */ n("button", { type: "button", onClick: l, className: b, children: d }), e[31] = d, e[32] = l, e[33] = b, e[34] = y) : y = e[34], y;
1142
+ });
1143
+ function yt(c) {
1144
+ if (!le(c)) return null;
1145
+ const {
1146
+ action: t
1147
+ } = c;
1148
+ return t.openUrlAction ? ({
1149
+ className: e,
1150
+ style: s
1151
+ }) => /* @__PURE__ */ n("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ n("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" }) }) : t.dialAction ? ({
1152
+ className: e,
1153
+ style: s
1154
+ }) => /* @__PURE__ */ n("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ n("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" }) }) : t.shareLocationAction ? ({
1155
+ className: e,
1156
+ style: s
1157
+ }) => /* @__PURE__ */ C("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
1158
+ /* @__PURE__ */ n("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" }),
1159
+ /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
1160
+ ] }) : t.viewLocationAction ? ({
1161
+ className: e,
1162
+ style: s
1163
+ }) => /* @__PURE__ */ C("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
1164
+ /* @__PURE__ */ n("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" }),
1165
+ /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
1166
+ ] }) : t.createCalendarEventAction ? ({
1167
+ className: e,
1168
+ style: s
1169
+ }) => /* @__PURE__ */ n("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ n("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" }) }) : null;
1170
+ }
1171
+ function vt(c) {
1172
+ if (!le(c)) return "Reply";
1173
+ const {
1174
+ action: t
1175
+ } = c;
1176
+ return t.openUrlAction ? "Open link" : t.dialAction ? "Call" : t.shareLocationAction ? "Share location" : t.viewLocationAction ? "View location" : t.createCalendarEventAction ? "Add to calendar" : "Action";
1177
+ }
1178
+ const wt = F(function(t) {
1179
+ const e = D.c(14), {
1180
+ suggestions: s
1181
+ } = t, {
1182
+ theme: l,
1183
+ handleReply: i,
1184
+ handleAction: g
1185
+ } = K(), r = l === "dark";
1186
+ if (!s || s.length === 0)
1187
+ return null;
1188
+ let o;
1189
+ e[0] !== g || e[1] !== i ? (o = (p) => {
1190
+ ze(p) ? i(p) : le(p) && g(p);
1191
+ }, e[0] = g, e[1] = i, e[2] = o) : o = e[2];
1192
+ const a = o, f = `
1193
+ px-3 py-2
1194
+ ${r ? "bg-zinc-900" : "bg-white"}
1195
+ `;
1196
+ let h;
1197
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = {
1198
+ scrollbarWidth: "none",
1199
+ msOverflowStyle: "none"
1200
+ }, e[3] = h) : h = e[3];
1201
+ let d;
1202
+ if (e[4] !== a || e[5] !== s) {
1203
+ let p;
1204
+ e[7] !== a ? (p = (b, y) => /* @__PURE__ */ n(xt, { suggestion: b, onClick: () => a(b), variant: "bar" }, y), e[7] = a, e[8] = p) : p = e[8], d = s.map(p), e[4] = a, e[5] = s, e[6] = d;
1205
+ } else
1206
+ d = e[6];
1207
+ let u;
1208
+ e[9] !== d ? (u = /* @__PURE__ */ n("div", { className: "flex gap-2 overflow-x-auto pb-1 -mx-1 px-1", style: h, children: d }), e[9] = d, e[10] = u) : u = e[10];
1209
+ let m;
1210
+ return e[11] !== f || e[12] !== u ? (m = /* @__PURE__ */ n("div", { className: f, role: "group", "aria-label": "Quick replies", children: u }), e[11] = f, e[12] = u, e[13] = m) : m = e[13], m;
1211
+ }), kt = F(function() {
1212
+ const t = D.c(39), {
1213
+ theme: e,
1214
+ state: s,
1215
+ showSuggestions: l
1216
+ } = K(), {
1217
+ chatHistory: i,
1218
+ isTyping: g,
1219
+ error: r
1220
+ } = s;
1221
+ let o;
1222
+ t[0] !== i.length || t[1] !== g ? (o = [i.length, g], t[0] = i.length, t[1] = g, t[2] = o) : o = t[2];
1223
+ const a = et(o), f = e === "dark", h = i[i.length - 1], d = l && h?.sender === "business" && !g ? h.suggestions : void 0, u = `
1224
+ flex flex-col h-full w-full overflow-hidden
1225
+ ${f ? "bg-zinc-950" : "bg-white"}
1226
+ `;
1227
+ let m;
1228
+ t[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ n(tt, {}), t[3] = m) : m = t[3];
1229
+ let p;
1230
+ t[4] !== r ? (p = r && /* @__PURE__ */ n("div", { className: "px-4 py-2 bg-red-500/10 border-b border-red-500/20", role: "alert", children: /* @__PURE__ */ n("p", { className: "text-sm text-red-500", children: r }) }), t[4] = r, t[5] = p) : p = t[5];
1231
+ let b, y;
1232
+ t[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ n(nt, {}), y = /* @__PURE__ */ n(bt, {}), t[6] = b, t[7] = y) : (b = t[6], y = t[7]);
1233
+ let v;
1234
+ t[8] !== a ? (v = /* @__PURE__ */ C("div", { ref: a, className: "flex-1 overflow-y-auto rcs-scrollbar", children: [
1235
+ b,
1236
+ y
1237
+ ] }), t[8] = a, t[9] = v) : v = t[9];
1238
+ let x;
1239
+ t[10] !== d ? (x = d && d.length > 0 && /* @__PURE__ */ n(wt, { suggestions: d }), t[10] = d, t[11] = x) : x = t[11];
1240
+ const k = `
1241
+ px-3 py-2 flex items-center gap-2
1242
+ ${f ? "bg-zinc-900" : "bg-white"}
1243
+ `, w = `
1244
+ w-9 h-9 flex items-center justify-center rounded-full flex-shrink-0
1245
+ border transition-colors
1246
+ ${f ? "border-zinc-700 text-zinc-400 hover:bg-zinc-800" : "border-gray-300 text-gray-500 hover:bg-gray-100"}
1247
+ `;
1248
+ let N;
1249
+ t[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t[12] = N) : N = t[12];
1250
+ let _;
1251
+ t[13] !== w ? (_ = /* @__PURE__ */ n("button", { type: "button", className: w, "aria-label": "Add attachment", children: N }), t[13] = w, t[14] = _) : _ = t[14];
1252
+ const $ = `
1253
+ flex-1 flex items-center gap-2 px-4 py-2 rounded-full
1254
+ ${f ? "bg-zinc-800" : "bg-gray-100"}
1255
+ `, L = `flex-1 text-sm ${f ? "text-zinc-500" : "text-gray-400"}`;
1256
+ let A;
1257
+ t[15] !== L ? (A = /* @__PURE__ */ n("span", { className: L, children: "RCS message" }), t[15] = L, t[16] = A) : A = t[16];
1258
+ const z = `p-1 ${f ? "text-zinc-500" : "text-gray-400"}`;
1259
+ let S;
1260
+ t[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), t[17] = S) : S = t[17];
1261
+ let M;
1262
+ t[18] !== z ? (M = /* @__PURE__ */ n("button", { type: "button", className: z, "aria-label": "Emoji", children: S }), t[18] = z, t[19] = M) : M = t[19];
1263
+ const I = `p-1 ${f ? "text-zinc-500" : "text-gray-400"}`;
1264
+ let R;
1265
+ t[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t[20] = R) : R = t[20];
1266
+ let B;
1267
+ t[21] !== I ? (B = /* @__PURE__ */ n("button", { type: "button", className: I, "aria-label": "Attach image", children: R }), t[21] = I, t[22] = B) : B = t[22];
1268
+ let T;
1269
+ t[23] !== $ || t[24] !== A || t[25] !== M || t[26] !== B ? (T = /* @__PURE__ */ C("div", { className: $, children: [
1270
+ A,
1271
+ M,
1272
+ B
1273
+ ] }), t[23] = $, t[24] = A, t[25] = M, t[26] = B, t[27] = T) : T = t[27];
1274
+ let O;
1275
+ t[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ n("button", { type: "button", className: "w-10 h-10 flex items-center justify-center rounded-full bg-green-100 text-green-600 flex-shrink-0", "aria-label": "Voice message", children: /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { d: "M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm-1 1.93c-3.94-.49-7-3.85-7-7.93h2c0 3.31 2.69 6 6 6s6-2.69 6-6h2c0 4.08-3.06 7.44-7 7.93V20h4v2H8v-2h4v-4.07z" }) }) }), t[28] = O) : O = t[28];
1276
+ let q;
1277
+ t[29] !== _ || t[30] !== T || t[31] !== k ? (q = /* @__PURE__ */ C("div", { className: k, children: [
1278
+ _,
1279
+ T,
1280
+ O
1281
+ ] }), t[29] = _, t[30] = T, t[31] = k, t[32] = q) : q = t[32];
1282
+ let V;
1283
+ return t[33] !== u || t[34] !== q || t[35] !== p || t[36] !== v || t[37] !== x ? (V = /* @__PURE__ */ C("div", { className: u, children: [
1284
+ m,
1285
+ p,
1286
+ v,
1287
+ x,
1288
+ q
1289
+ ] }), t[33] = u, t[34] = q, t[35] = p, t[36] = v, t[37] = x, t[38] = V) : V = t[38], V;
1290
+ }), Nt = F(function() {
1291
+ const t = D.c(73), {
1292
+ theme: e,
1293
+ businessInfo: s,
1294
+ toggleProfile: l
1295
+ } = K(), [i, g] = ne("info"), r = e === "dark", o = s.bannerImage || "https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=800&q=80", a = s.brandColor || "#0084ff", f = `
1296
+ absolute inset-0 z-50 flex flex-col
1297
+ ${r ? "bg-zinc-950" : "bg-white"}
1298
+ `, h = `
1299
+ flex items-center gap-3 px-4 py-3 border-b
1300
+ ${r ? "bg-zinc-900 border-zinc-800" : "bg-white border-gray-200"}
1301
+ `, d = `
1302
+ p-1.5 -ml-1.5 rounded-full transition-colors
1303
+ ${r ? "hover:bg-zinc-800 text-white" : "hover:bg-gray-100 text-gray-900"}
1304
+ `;
1305
+ let u;
1306
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), t[0] = u) : u = t[0];
1307
+ let m;
1308
+ t[1] !== d || t[2] !== l ? (m = /* @__PURE__ */ n("button", { onClick: l, className: d, "aria-label": "Go back", children: u }), t[1] = d, t[2] = l, t[3] = m) : m = t[3];
1309
+ const p = `text-base font-medium ${r ? "text-white" : "text-gray-900"}`;
1310
+ let b;
1311
+ t[4] !== p ? (b = /* @__PURE__ */ n("span", { className: p, children: "Info & options" }), t[4] = p, t[5] = b) : b = t[5];
1312
+ let y;
1313
+ t[6] !== h || t[7] !== m || t[8] !== b ? (y = /* @__PURE__ */ C("header", { className: h, children: [
1314
+ m,
1315
+ b
1316
+ ] }), t[6] = h, t[7] = m, t[8] = b, t[9] = y) : y = t[9];
1317
+ let v;
1318
+ t[10] !== o ? (v = /* @__PURE__ */ n("div", { className: "relative h-40 bg-gray-200", children: /* @__PURE__ */ n("img", { src: o, alt: "Business banner", className: "w-full h-full object-cover" }) }), t[10] = o, t[11] = v) : v = t[11];
1319
+ const x = `
1320
+ absolute -top-10 left-1/2 -translate-x-1/2
1321
+ w-20 h-20 rounded-full overflow-hidden border-4
1322
+ ${r ? "border-zinc-950 bg-zinc-800" : "border-white bg-gray-100"}
1323
+ shadow-lg
1324
+ `;
1325
+ let k;
1326
+ t[12] !== a || t[13] !== s.logo || t[14] !== s.name ? (k = s.logo ? /* @__PURE__ */ n("img", { src: s.logo, alt: `${s.name} logo`, className: "w-full h-full object-cover" }) : /* @__PURE__ */ n("div", { className: "w-full h-full flex items-center justify-center text-2xl font-bold text-white", style: {
1327
+ backgroundColor: a
1328
+ }, children: s.name.charAt(0).toUpperCase() }), t[12] = a, t[13] = s.logo, t[14] = s.name, t[15] = k) : k = t[15];
1329
+ let w;
1330
+ t[16] !== k || t[17] !== x ? (w = /* @__PURE__ */ n("div", { className: "relative px-4", children: /* @__PURE__ */ n("div", { className: x, children: k }) }), t[16] = k, t[17] = x, t[18] = w) : w = t[18];
1331
+ const N = `text-xl font-semibold ${r ? "text-white" : "text-gray-900"}`;
1332
+ let _;
1333
+ t[19] !== s.name || t[20] !== N ? (_ = /* @__PURE__ */ n("h1", { className: N, children: s.name }), t[19] = s.name, t[20] = N, t[21] = _) : _ = t[21];
1334
+ let $;
1335
+ t[22] !== s.description || t[23] !== r ? ($ = s.description && /* @__PURE__ */ n("p", { className: `text-sm mt-1 ${r ? "text-zinc-400" : "text-gray-500"}`, children: s.description }), t[22] = s.description, t[23] = r, t[24] = $) : $ = t[24];
1336
+ let L;
1337
+ t[25] !== _ || t[26] !== $ ? (L = /* @__PURE__ */ C("div", { className: "pt-12 pb-4 px-4 text-center", children: [
1338
+ _,
1339
+ $
1340
+ ] }), t[25] = _, t[26] = $, t[27] = L) : L = t[27];
1341
+ let A;
1342
+ t[28] !== a || t[29] !== s.phoneNumbers || t[30] !== r ? (A = s.phoneNumbers && s.phoneNumbers.length > 0 && /* @__PURE__ */ n(be, { icon: "phone", label: "Call", isDark: r, brandColor: a, onClick: () => {
1343
+ const j = s.phoneNumbers?.[0]?.number;
1344
+ j && (window.location.href = `tel:${j}`);
1345
+ } }), t[28] = a, t[29] = s.phoneNumbers, t[30] = r, t[31] = A) : A = t[31];
1346
+ let z;
1347
+ t[32] !== a || t[33] !== s.websites || t[34] !== r ? (z = s.websites && s.websites.length > 0 && /* @__PURE__ */ n(be, { icon: "globe", label: "Website", isDark: r, brandColor: a, onClick: () => {
1348
+ const j = s.websites?.[0]?.url;
1349
+ j && window.open(j, "_blank", "noopener,noreferrer");
1350
+ } }), t[32] = a, t[33] = s.websites, t[34] = r, t[35] = z) : z = t[35];
1351
+ let S;
1352
+ t[36] !== a || t[37] !== s.emails || t[38] !== r ? (S = s.emails && s.emails.length > 0 && /* @__PURE__ */ n(be, { icon: "mail", label: "Contact", isDark: r, brandColor: a, onClick: () => {
1353
+ const j = s.emails?.[0]?.email;
1354
+ j && (window.location.href = `mailto:${j}`);
1355
+ } }), t[36] = a, t[37] = s.emails, t[38] = r, t[39] = S) : S = t[39];
1356
+ let M;
1357
+ t[40] !== A || t[41] !== z || t[42] !== S ? (M = /* @__PURE__ */ C("div", { className: "flex justify-center gap-4 px-4 pb-4", children: [
1358
+ A,
1359
+ z,
1360
+ S
1361
+ ] }), t[40] = A, t[41] = z, t[42] = S, t[43] = M) : M = t[43];
1362
+ const I = `
1363
+ flex mx-4 rounded-lg overflow-hidden border
1364
+ ${r ? "border-zinc-700 bg-zinc-800" : "border-gray-200 bg-gray-100"}
1365
+ `, R = i === "info";
1366
+ let B;
1367
+ t[44] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = () => g("info"), t[44] = B) : B = t[44];
1368
+ let T;
1369
+ t[45] !== a || t[46] !== r || t[47] !== R ? (T = /* @__PURE__ */ n(Le, { active: R, onClick: B, isDark: r, brandColor: a, children: "Info" }), t[45] = a, t[46] = r, t[47] = R, t[48] = T) : T = t[48];
1370
+ const O = i === "options";
1371
+ let q;
1372
+ t[49] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (q = () => g("options"), t[49] = q) : q = t[49];
1373
+ let V;
1374
+ t[50] !== a || t[51] !== r || t[52] !== O ? (V = /* @__PURE__ */ n(Le, { active: O, onClick: q, isDark: r, brandColor: a, children: "Options" }), t[50] = a, t[51] = r, t[52] = O, t[53] = V) : V = t[53];
1375
+ let Q;
1376
+ t[54] !== I || t[55] !== T || t[56] !== V ? (Q = /* @__PURE__ */ C("div", { className: I, children: [
1377
+ T,
1378
+ V
1379
+ ] }), t[54] = I, t[55] = T, t[56] = V, t[57] = Q) : Q = t[57];
1380
+ let P;
1381
+ t[58] !== i || t[59] !== a || t[60] !== r ? (P = /* @__PURE__ */ n("div", { className: "p-4", children: i === "info" ? /* @__PURE__ */ n(Ct, { isDark: r, brandColor: a }) : /* @__PURE__ */ n(_t, { isDark: r }) }), t[58] = i, t[59] = a, t[60] = r, t[61] = P) : P = t[61];
1382
+ let Y;
1383
+ t[62] !== w || t[63] !== L || t[64] !== M || t[65] !== Q || t[66] !== P || t[67] !== v ? (Y = /* @__PURE__ */ C("div", { className: "flex-1 overflow-y-auto", children: [
1384
+ v,
1385
+ w,
1386
+ L,
1387
+ M,
1388
+ Q,
1389
+ P
1390
+ ] }), t[62] = w, t[63] = L, t[64] = M, t[65] = Q, t[66] = P, t[67] = v, t[68] = Y) : Y = t[68];
1391
+ let ee;
1392
+ return t[69] !== f || t[70] !== Y || t[71] !== y ? (ee = /* @__PURE__ */ C("div", { className: f, children: [
1393
+ y,
1394
+ Y
1395
+ ] }), t[69] = f, t[70] = Y, t[71] = y, t[72] = ee) : ee = t[72], ee;
1396
+ }), be = F(function(t) {
1397
+ const e = D.c(12), {
1398
+ icon: s,
1399
+ label: l,
1400
+ isDark: i,
1401
+ brandColor: g,
1402
+ onClick: r
1403
+ } = t;
1404
+ let o;
1405
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {
1406
+ phone: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, 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" }),
1407
+ globe: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, 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" }),
1408
+ mail: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" })
1409
+ }, e[0] = o) : o = e[0];
1410
+ const a = o, f = `
1411
+ flex flex-col items-center gap-2 px-6 py-3 rounded-xl border transition-colors
1412
+ ${i ? "bg-zinc-800 border-zinc-700 hover:bg-zinc-700" : "bg-white border-gray-200 hover:bg-gray-50"}
1413
+ `, h = a[s];
1414
+ let d;
1415
+ e[1] !== g || e[2] !== h ? (d = /* @__PURE__ */ n("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: g, children: h }), e[1] = g, e[2] = h, e[3] = d) : d = e[3];
1416
+ const u = `text-xs font-medium ${i ? "text-zinc-300" : "text-gray-600"}`;
1417
+ let m;
1418
+ e[4] !== l || e[5] !== u ? (m = /* @__PURE__ */ n("span", { className: u, children: l }), e[4] = l, e[5] = u, e[6] = m) : m = e[6];
1419
+ let p;
1420
+ return e[7] !== r || e[8] !== f || e[9] !== d || e[10] !== m ? (p = /* @__PURE__ */ C("button", { onClick: r, className: f, children: [
1421
+ d,
1422
+ m
1423
+ ] }), e[7] = r, e[8] = f, e[9] = d, e[10] = m, e[11] = p) : p = e[11], p;
1424
+ }), Le = F(function(t) {
1425
+ const e = D.c(8), {
1426
+ active: s,
1427
+ onClick: l,
1428
+ isDark: i,
1429
+ brandColor: g,
1430
+ children: r
1431
+ } = t, o = `
1432
+ flex-1 py-2.5 text-sm font-medium transition-colors rounded-lg
1433
+ ${s ? "text-white" : i ? "text-zinc-400 hover:text-zinc-200" : "text-gray-500 hover:text-gray-700"}
1434
+ `;
1435
+ let a;
1436
+ e[0] !== s || e[1] !== g ? (a = s ? {
1437
+ backgroundColor: g
1438
+ } : void 0, e[0] = s, e[1] = g, e[2] = a) : a = e[2];
1439
+ let f;
1440
+ return e[3] !== r || e[4] !== l || e[5] !== o || e[6] !== a ? (f = /* @__PURE__ */ n("button", { onClick: l, className: o, style: a, children: r }), e[3] = r, e[4] = l, e[5] = o, e[6] = a, e[7] = f) : f = e[7], f;
1441
+ }), Ct = F(function(t) {
1442
+ const e = D.c(19), {
1443
+ isDark: s,
1444
+ brandColor: l
1445
+ } = t, {
1446
+ businessInfo: i
1447
+ } = K();
1448
+ if (!(i.phoneNumbers && i.phoneNumbers.length > 0 || i.websites && i.websites.length > 0 || i.emails && i.emails.length > 0)) {
1449
+ const d = `text-center py-8 ${s ? "text-zinc-500" : "text-gray-400"}`;
1450
+ let u;
1451
+ return e[0] !== d ? (u = /* @__PURE__ */ n("div", { className: d, children: "No contact information available" }), e[0] = d, e[1] = u) : u = e[1], u;
1452
+ }
1453
+ const r = `
1454
+ rounded-xl overflow-hidden border divide-y
1455
+ ${s ? "bg-zinc-900 border-zinc-800 divide-zinc-800" : "bg-gray-50 border-gray-200 divide-gray-200"}
1456
+ `;
1457
+ let o;
1458
+ e[2] !== l || e[3] !== i.phoneNumbers || e[4] !== s ? (o = i.phoneNumbers?.map((d, u) => /* @__PURE__ */ n(xe, { icon: "phone", primary: d.number, secondary: d.label, isDark: s, brandColor: l, onClick: () => window.location.href = `tel:${d.number}` }, `phone-${u}`)), e[2] = l, e[3] = i.phoneNumbers, e[4] = s, e[5] = o) : o = e[5];
1459
+ let a;
1460
+ e[6] !== l || e[7] !== i.websites || e[8] !== s ? (a = i.websites?.map((d, u) => /* @__PURE__ */ n(xe, { icon: "globe", primary: d.url.replace(/^https?:\/\//, ""), secondary: d.label || "Website", isDark: s, brandColor: l, onClick: () => window.open(d.url, "_blank", "noopener,noreferrer") }, `web-${u}`)), e[6] = l, e[7] = i.websites, e[8] = s, e[9] = a) : a = e[9];
1461
+ let f;
1462
+ e[10] !== l || e[11] !== i.emails || e[12] !== s ? (f = i.emails?.map((d, u) => /* @__PURE__ */ n(xe, { icon: "mail", primary: d.email, secondary: d.label || "Email", isDark: s, brandColor: l, onClick: () => window.location.href = `mailto:${d.email}` }, `email-${u}`)), e[10] = l, e[11] = i.emails, e[12] = s, e[13] = f) : f = e[13];
1463
+ let h;
1464
+ return e[14] !== r || e[15] !== o || e[16] !== a || e[17] !== f ? (h = /* @__PURE__ */ C("div", { className: r, children: [
1465
+ o,
1466
+ a,
1467
+ f
1468
+ ] }), e[14] = r, e[15] = o, e[16] = a, e[17] = f, e[18] = h) : h = e[18], h;
1469
+ }), xe = F(function(t) {
1470
+ const e = D.c(20), {
1471
+ icon: s,
1472
+ primary: l,
1473
+ secondary: i,
1474
+ isDark: g,
1475
+ onClick: r
1476
+ } = t;
1477
+ let o;
1478
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {
1479
+ phone: "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",
1480
+ globe: "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",
1481
+ mail: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
1482
+ }, e[0] = o) : o = e[0];
1483
+ const a = o, f = `
1484
+ w-full flex items-center gap-4 px-4 py-3.5 text-left transition-colors
1485
+ ${g ? "hover:bg-zinc-800" : "hover:bg-gray-100"}
1486
+ `, h = `w-5 h-5 flex-shrink-0 ${g ? "text-zinc-500" : "text-gray-400"}`, d = a[s];
1487
+ let u;
1488
+ e[1] !== d ? (u = /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d }), e[1] = d, e[2] = u) : u = e[2];
1489
+ let m;
1490
+ e[3] !== h || e[4] !== u ? (m = /* @__PURE__ */ n("svg", { className: h, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: u }), e[3] = h, e[4] = u, e[5] = m) : m = e[5];
1491
+ const p = `text-sm font-medium truncate ${g ? "text-white" : "text-gray-900"}`;
1492
+ let b;
1493
+ e[6] !== l || e[7] !== p ? (b = /* @__PURE__ */ n("p", { className: p, children: l }), e[6] = l, e[7] = p, e[8] = b) : b = e[8];
1494
+ let y;
1495
+ e[9] !== g || e[10] !== i ? (y = i && /* @__PURE__ */ n("p", { className: `text-xs truncate ${g ? "text-zinc-500" : "text-gray-500"}`, children: i }), e[9] = g, e[10] = i, e[11] = y) : y = e[11];
1496
+ let v;
1497
+ e[12] !== b || e[13] !== y ? (v = /* @__PURE__ */ C("div", { className: "flex-1 min-w-0", children: [
1498
+ b,
1499
+ y
1500
+ ] }), e[12] = b, e[13] = y, e[14] = v) : v = e[14];
1501
+ let x;
1502
+ return e[15] !== r || e[16] !== v || e[17] !== f || e[18] !== m ? (x = /* @__PURE__ */ C("button", { onClick: r, className: f, children: [
1503
+ m,
1504
+ v
1505
+ ] }), e[15] = r, e[16] = v, e[17] = f, e[18] = m, e[19] = x) : x = e[19], x;
1506
+ }), _t = F(function(t) {
1507
+ const e = D.c(9), {
1508
+ isDark: s
1509
+ } = t, l = `
1510
+ rounded-xl overflow-hidden border divide-y
1511
+ ${s ? "bg-zinc-900 border-zinc-800 divide-zinc-800" : "bg-gray-50 border-gray-200 divide-gray-200"}
1512
+ `;
1513
+ let i, g, r;
1514
+ e[0] !== s ? (i = /* @__PURE__ */ n(ye, { icon: "bell", label: "Notifications", isDark: s }), g = /* @__PURE__ */ n(ye, { icon: "block", label: "Block & report spam", isDark: s }), r = /* @__PURE__ */ n(ye, { icon: "info", label: "About RCS", isDark: s }), e[0] = s, e[1] = i, e[2] = g, e[3] = r) : (i = e[1], g = e[2], r = e[3]);
1515
+ let o;
1516
+ return e[4] !== l || e[5] !== i || e[6] !== g || e[7] !== r ? (o = /* @__PURE__ */ C("div", { className: l, children: [
1517
+ i,
1518
+ g,
1519
+ r
1520
+ ] }), e[4] = l, e[5] = i, e[6] = g, e[7] = r, e[8] = o) : o = e[8], o;
1521
+ }), ye = F(function(t) {
1522
+ const e = D.c(13), {
1523
+ icon: s,
1524
+ label: l,
1525
+ isDark: i
1526
+ } = t;
1527
+ let g;
1528
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = {
1529
+ bell: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",
1530
+ block: "M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636",
1531
+ info: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
1532
+ }, e[0] = g) : g = e[0];
1533
+ const r = g, o = `
1534
+ w-full flex items-center gap-4 px-4 py-3.5 text-left transition-colors
1535
+ ${i ? "hover:bg-zinc-800" : "hover:bg-gray-100"}
1536
+ `, a = `w-5 h-5 flex-shrink-0 ${i ? "text-zinc-500" : "text-gray-400"}`, f = r[s];
1537
+ let h;
1538
+ e[1] !== f ? (h = /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: f }), e[1] = f, e[2] = h) : h = e[2];
1539
+ let d;
1540
+ e[3] !== a || e[4] !== h ? (d = /* @__PURE__ */ n("svg", { className: a, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: h }), e[3] = a, e[4] = h, e[5] = d) : d = e[5];
1541
+ const u = `text-sm font-medium ${i ? "text-white" : "text-gray-900"}`;
1542
+ let m;
1543
+ e[6] !== l || e[7] !== u ? (m = /* @__PURE__ */ n("span", { className: u, children: l }), e[6] = l, e[7] = u, e[8] = m) : m = e[8];
1544
+ let p;
1545
+ return e[9] !== o || e[10] !== d || e[11] !== m ? (p = /* @__PURE__ */ C("button", { className: o, children: [
1546
+ d,
1547
+ m
1548
+ ] }), e[9] = o, e[10] = d, e[11] = m, e[12] = p) : p = e[12], p;
1549
+ }), Se = {
1550
+ FULL: "h-full",
1551
+ TALL: "h-[80%]",
1552
+ HALF: "h-[50%]"
1553
+ }, Lt = F(function() {
1554
+ const t = D.c(65), {
1555
+ theme: e,
1556
+ businessInfo: s,
1557
+ webView: l,
1558
+ closeWebView: i
1559
+ } = K(), [g, r] = ne(!0), [o, a] = ne(!1), f = e === "dark", h = s.brandColor || "#0084ff";
1560
+ let d;
1561
+ t[0] !== l?.url ? (d = () => {
1562
+ l?.url && (r(!0), a(!1));
1563
+ }, t[0] = l?.url, t[1] = d) : d = t[1];
1564
+ const u = l?.url;
1565
+ let m;
1566
+ t[2] !== u ? (m = [u], t[2] = u, t[3] = m) : m = t[3], ie(d, m);
1567
+ let p;
1568
+ t[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = () => {
1569
+ r(!1);
1570
+ }, t[4] = p) : p = t[4];
1571
+ const b = p;
1572
+ let y;
1573
+ t[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = () => {
1574
+ r(!1), a(!0);
1575
+ }, t[5] = y) : y = t[5];
1576
+ const v = y, x = St;
1577
+ if (!l || !l.isOpen)
1578
+ return null;
1579
+ const {
1580
+ url: k,
1581
+ viewMode: w,
1582
+ title: N,
1583
+ postbackData: _
1584
+ } = l;
1585
+ let $;
1586
+ t[6] !== N || t[7] !== k ? ($ = N || x(k), t[6] = N, t[7] = k, t[8] = $) : $ = t[8];
1587
+ const L = $, A = w === "FULL", z = w === "TALL" || w === "HALF", S = Se[w] || Se.TALL, M = `
1588
+ rcs-webview-overlay absolute inset-0 z-50 flex flex-col
1589
+ ${A ? "" : "justify-end"}
1590
+ ${f ? "bg-black/60" : "bg-black/40"}
1591
+ `, I = `WebView: ${L}`;
1592
+ let R;
1593
+ t[9] !== i || t[10] !== z ? (R = z && /* @__PURE__ */ n("button", { type: "button", className: "absolute inset-0 w-full h-full cursor-default", onClick: i, "aria-label": "Close WebView" }), t[9] = i, t[10] = z, t[11] = R) : R = t[11];
1594
+ const B = `
1595
+ rcs-webview-container relative flex flex-col overflow-hidden
1596
+ ${f ? "bg-zinc-900" : "bg-white"}
1597
+ ${S} w-full
1598
+ ${z ? "rounded-t-2xl shadow-2xl" : ""}
1599
+ `;
1600
+ let T;
1601
+ t[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = {
1602
+ position: "relative",
1603
+ zIndex: 1
1604
+ }, t[12] = T) : T = t[12];
1605
+ const O = `
1606
+ rcs-webview-header flex items-center gap-3 px-2 py-2 flex-shrink-0
1607
+ border-b
1608
+ ${f ? "bg-zinc-900 border-zinc-800" : "bg-white border-gray-200"}
1609
+ `, q = `
1610
+ rcs-webview-close w-10 h-10 rounded-full flex items-center justify-center
1611
+ transition-colors
1612
+ ${f ? "text-white hover:bg-zinc-800" : "text-gray-700 hover:bg-gray-100"}
1613
+ `;
1614
+ let V;
1615
+ t[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ n("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), t[13] = V) : V = t[13];
1616
+ let Q;
1617
+ t[14] !== i || t[15] !== q ? (Q = /* @__PURE__ */ n("button", { type: "button", onClick: i, className: q, "aria-label": "Close WebView", children: V }), t[14] = i, t[15] = q, t[16] = Q) : Q = t[16];
1618
+ const P = `
1619
+ rcs-webview-title text-base font-medium truncate
1620
+ ${f ? "text-white" : "text-gray-900"}
1621
+ `;
1622
+ let Y;
1623
+ t[17] !== L || t[18] !== P ? (Y = /* @__PURE__ */ n("h2", { className: P, children: L }), t[17] = L, t[18] = P, t[19] = Y) : Y = t[19];
1624
+ const ee = `
1625
+ rcs-webview-url text-xs truncate
1626
+ ${f ? "text-zinc-400" : "text-gray-500"}
1627
+ `;
1628
+ let j;
1629
+ t[20] !== k ? (j = x(k), t[20] = k, t[21] = j) : j = t[21];
1630
+ let G;
1631
+ t[22] !== ee || t[23] !== j ? (G = /* @__PURE__ */ n("p", { className: ee, children: j }), t[22] = ee, t[23] = j, t[24] = G) : G = t[24];
1632
+ let E;
1633
+ t[25] !== Y || t[26] !== G ? (E = /* @__PURE__ */ C("div", { className: "flex-1 min-w-0", children: [
1634
+ Y,
1635
+ G
1636
+ ] }), t[25] = Y, t[26] = G, t[27] = E) : E = t[27];
1637
+ const J = `
1638
+ w-10 h-10 rounded-full flex items-center justify-center
1639
+ ${f ? "text-zinc-400 hover:bg-zinc-800" : "text-gray-500 hover:bg-gray-100"}
1640
+ `;
1641
+ let W;
1642
+ t[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ C("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 24 24", children: [
1643
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "5", r: "2" }),
1644
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" }),
1645
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "19", r: "2" })
1646
+ ] }), t[28] = W) : W = t[28];
1647
+ let U;
1648
+ t[29] !== J ? (U = /* @__PURE__ */ n("button", { type: "button", className: J, "aria-label": "More options", children: W }), t[29] = J, t[30] = U) : U = t[30];
1649
+ let H;
1650
+ t[31] !== O || t[32] !== Q || t[33] !== E || t[34] !== U ? (H = /* @__PURE__ */ C("header", { className: O, children: [
1651
+ Q,
1652
+ E,
1653
+ U
1654
+ ] }), t[31] = O, t[32] = Q, t[33] = E, t[34] = U, t[35] = H) : H = t[35];
1655
+ let X;
1656
+ t[36] !== h || t[37] !== g ? (X = g && /* @__PURE__ */ n("div", { className: "rcs-webview-loading absolute top-14 left-0 right-0 h-1 overflow-hidden", style: {
1657
+ backgroundColor: `${h}20`
1658
+ }, children: /* @__PURE__ */ n("div", { className: "h-full animate-pulse", style: {
1659
+ backgroundColor: h,
1660
+ animation: "webview-loading 1.5s ease-in-out infinite",
1661
+ width: "30%"
1662
+ } }) }), t[36] = h, t[37] = g, t[38] = X) : X = t[38];
1663
+ let Z;
1664
+ t[39] !== i || t[40] !== f || t[41] !== o ? (Z = o && /* @__PURE__ */ C("div", { className: `
1665
+ rcs-webview-error flex-1 flex flex-col items-center justify-center p-6 text-center
1666
+ ${f ? "text-zinc-400" : "text-gray-500"}
1667
+ `, children: [
1668
+ /* @__PURE__ */ n("svg", { className: "w-16 h-16 mb-4 opacity-50", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
1669
+ /* @__PURE__ */ n("p", { className: "text-sm font-medium mb-2", children: "Unable to load page" }),
1670
+ /* @__PURE__ */ n("p", { className: "text-xs opacity-75 mb-4", children: "This content cannot be displayed in the emulator" }),
1671
+ /* @__PURE__ */ n("button", { type: "button", onClick: i, className: `
1672
+ px-4 py-2 rounded-full text-sm font-medium
1673
+ ${f ? "bg-zinc-800 text-white hover:bg-zinc-700" : "bg-gray-100 text-gray-700 hover:bg-gray-200"}
1674
+ `, children: "Go Back" })
1675
+ ] }), t[39] = i, t[40] = f, t[41] = o, t[42] = Z) : Z = t[42];
1676
+ let te;
1677
+ t[43] !== L || t[44] !== o || t[45] !== k ? (te = !o && /* @__PURE__ */ n("div", { className: "rcs-webview-iframe-container flex-1 overflow-hidden", children: /* @__PURE__ */ n("iframe", { src: k, title: L, className: "w-full h-full border-0", onLoad: b, onError: v, sandbox: "allow-scripts allow-same-origin allow-forms allow-popups", referrerPolicy: "no-referrer-when-downgrade", loading: "lazy" }) }), t[43] = L, t[44] = o, t[45] = k, t[46] = te) : te = t[46];
1678
+ let se;
1679
+ t[47] !== z || t[48] !== f ? (se = z && /* @__PURE__ */ n("div", { className: `
1680
+ rcs-webview-safe-area h-2 flex-shrink-0
1681
+ ${f ? "bg-zinc-900" : "bg-white"}
1682
+ ` }), t[47] = z, t[48] = f, t[49] = se) : se = t[49];
1683
+ let re;
1684
+ t[50] !== H || t[51] !== X || t[52] !== Z || t[53] !== te || t[54] !== se || t[55] !== B ? (re = /* @__PURE__ */ C("div", { className: B, style: T, children: [
1685
+ H,
1686
+ X,
1687
+ Z,
1688
+ te,
1689
+ se
1690
+ ] }), t[50] = H, t[51] = X, t[52] = Z, t[53] = te, t[54] = se, t[55] = B, t[56] = re) : re = t[56];
1691
+ let ce;
1692
+ t[57] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ce = /* @__PURE__ */ n("style", { children: `
1693
+ @keyframes webview-loading {
1694
+ 0% { transform: translateX(-100%); }
1695
+ 50% { transform: translateX(200%); }
1696
+ 100% { transform: translateX(-100%); }
1697
+ }
1698
+ ` }), t[57] = ce) : ce = t[57];
1699
+ let de;
1700
+ return t[58] !== _ || t[59] !== re || t[60] !== M || t[61] !== I || t[62] !== R || t[63] !== w ? (de = /* @__PURE__ */ C("div", { className: M, role: "dialog", "aria-modal": "true", "aria-label": I, "data-postback": _, "data-view-mode": w, children: [
1701
+ R,
1702
+ re,
1703
+ ce
1704
+ ] }), t[58] = _, t[59] = re, t[60] = M, t[61] = I, t[62] = R, t[63] = w, t[64] = de) : de = t[64], de;
1705
+ });
1706
+ function St(c) {
1707
+ try {
1708
+ return new URL(c).hostname;
1709
+ } catch {
1710
+ return "Web Page";
1711
+ }
1712
+ }
1713
+ const $t = F(function(t) {
1714
+ const e = D.c(39), {
1715
+ onUnlock: s,
1716
+ messagePreview: l
1717
+ } = t, i = l === void 0 ? "New message" : l, {
1718
+ theme: g,
1719
+ businessInfo: r
1720
+ } = K();
1721
+ let o;
1722
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ new Date(), e[0] = o) : o = e[0];
1723
+ const [a, f] = ne(o), h = g === "dark";
1724
+ let d, u;
1725
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = () => {
1726
+ const q = setInterval(() => {
1727
+ f(/* @__PURE__ */ new Date());
1728
+ }, 1e3);
1729
+ return () => clearInterval(q);
1730
+ }, u = [], e[1] = d, e[2] = u) : (d = e[1], u = e[2]), ie(d, u);
1731
+ let m;
1732
+ e[3] !== a ? (m = a.toLocaleTimeString([], {
1733
+ hour: "numeric",
1734
+ minute: "2-digit",
1735
+ hour12: !0
1736
+ }), e[3] = a, e[4] = m) : m = e[4];
1737
+ const p = m;
1738
+ let b;
1739
+ e[5] !== a ? (b = a.toLocaleDateString([], {
1740
+ weekday: "short",
1741
+ month: "long",
1742
+ day: "numeric"
1743
+ }), e[5] = a, e[6] = b) : b = e[6];
1744
+ const y = b, v = `
1745
+ lock-screen flex flex-col h-full w-full select-none
1746
+ ${h ? "bg-zinc-900" : "bg-zinc-800"}
1747
+ `;
1748
+ let x;
1749
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ n("div", { className: "h-6" }), e[7] = x) : x = e[7];
1750
+ let k;
1751
+ e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ n("div", { className: "flex justify-center mt-4", children: /* @__PURE__ */ n("div", { className: "w-8 h-8 rounded-full bg-zinc-700 flex items-center justify-center", children: /* @__PURE__ */ n("svg", { className: "w-4 h-4 text-zinc-400", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n("path", { fillRule: "evenodd", d: "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z", clipRule: "evenodd" }) }) }) }), e[8] = k) : k = e[8];
1752
+ let w;
1753
+ e[9] !== p ? (w = /* @__PURE__ */ n("div", { className: "mt-6 text-center", children: /* @__PURE__ */ n("h1", { className: "text-5xl font-light text-white tracking-tight", children: p }) }), e[9] = p, e[10] = w) : w = e[10];
1754
+ let N;
1755
+ e[11] !== y ? (N = /* @__PURE__ */ n("p", { className: "text-zinc-400 text-sm", children: y }), e[11] = y, e[12] = N) : N = e[12];
1756
+ let _;
1757
+ e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ C("div", { className: "flex items-center justify-center gap-1 mt-1 text-zinc-500 text-xs", children: [
1758
+ /* @__PURE__ */ n("svg", { className: "w-3.5 h-3.5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n("path", { d: "M5.5 16a3.5 3.5 0 01-.369-6.98 4 4 0 117.753-1.977A4.5 4.5 0 1113.5 16h-8z" }) }),
1759
+ /* @__PURE__ */ n("span", { children: "19°C" })
1760
+ ] }), e[13] = _) : _ = e[13];
1761
+ let $;
1762
+ e[14] !== N ? ($ = /* @__PURE__ */ C("div", { className: "mt-2 text-center", children: [
1763
+ N,
1764
+ _
1765
+ ] }), e[14] = N, e[15] = $) : $ = e[15];
1766
+ let L;
1767
+ e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */ n("div", { className: "h-24" }), e[16] = L) : L = e[16];
1768
+ let A;
1769
+ e[17] !== r.logo || e[18] !== r.name ? (A = /* @__PURE__ */ n("div", { className: "w-12 h-12 rounded-xl bg-zinc-900 flex items-center justify-center flex-shrink-0 overflow-hidden", children: r.logo ? /* @__PURE__ */ n("img", { src: r.logo, alt: r.name, className: "w-full h-full object-cover" }) : /* @__PURE__ */ n("div", { className: "text-white", children: /* @__PURE__ */ C("svg", { className: "w-7 h-7", viewBox: "0 0 24 24", fill: "currentColor", children: [
1770
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "1.5" }),
1771
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "6", r: "1" }),
1772
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "18", r: "1" }),
1773
+ /* @__PURE__ */ n("circle", { cx: "6", cy: "12", r: "1" }),
1774
+ /* @__PURE__ */ n("circle", { cx: "18", cy: "12", r: "1" }),
1775
+ /* @__PURE__ */ n("circle", { cx: "8", cy: "8", r: "0.8" }),
1776
+ /* @__PURE__ */ n("circle", { cx: "16", cy: "8", r: "0.8" }),
1777
+ /* @__PURE__ */ n("circle", { cx: "8", cy: "16", r: "0.8" }),
1778
+ /* @__PURE__ */ n("circle", { cx: "16", cy: "16", r: "0.8" }),
1779
+ /* @__PURE__ */ n("circle", { cx: "6", cy: "6", r: "0.5" }),
1780
+ /* @__PURE__ */ n("circle", { cx: "18", cy: "6", r: "0.5" }),
1781
+ /* @__PURE__ */ n("circle", { cx: "6", cy: "18", r: "0.5" }),
1782
+ /* @__PURE__ */ n("circle", { cx: "18", cy: "18", r: "0.5" })
1783
+ ] }) }) }), e[17] = r.logo, e[18] = r.name, e[19] = A) : A = e[19];
1784
+ let z;
1785
+ e[20] !== r.name ? (z = /* @__PURE__ */ n("p", { className: "text-sm font-semibold text-gray-900 truncate", children: r.name }), e[20] = r.name, e[21] = z) : z = e[21];
1786
+ let S;
1787
+ e[22] !== i ? (S = /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 truncate", children: i }), e[22] = i, e[23] = S) : S = e[23];
1788
+ let M;
1789
+ e[24] !== z || e[25] !== S ? (M = /* @__PURE__ */ C("div", { className: "flex-1 text-left min-w-0", children: [
1790
+ z,
1791
+ S
1792
+ ] }), e[24] = z, e[25] = S, e[26] = M) : M = e[26];
1793
+ let I;
1794
+ e[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ n("span", { className: "text-xs text-gray-400 flex-shrink-0", children: "now" }), e[27] = I) : I = e[27];
1795
+ let R;
1796
+ e[28] !== s || e[29] !== A || e[30] !== M ? (R = /* @__PURE__ */ n("div", { className: "px-4 pb-8", children: /* @__PURE__ */ C("button", { onClick: s, className: `w-full bg-white rounded-2xl p-3 flex items-center gap-3 shadow-lg \r
1797
+ transition-transform active:scale-[0.98] hover:shadow-xl`, children: [
1798
+ A,
1799
+ M,
1800
+ I
1801
+ ] }) }), e[28] = s, e[29] = A, e[30] = M, e[31] = R) : R = e[31];
1802
+ let B;
1803
+ e[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ n("div", { className: "flex-1" }), e[32] = B) : B = e[32];
1804
+ let T;
1805
+ e[33] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ n("div", { className: "flex justify-center pb-2", children: /* @__PURE__ */ n("div", { className: "w-32 h-1 rounded-full bg-zinc-600" }) }), e[33] = T) : T = e[33];
1806
+ let O;
1807
+ return e[34] !== w || e[35] !== $ || e[36] !== R || e[37] !== v ? (O = /* @__PURE__ */ C("div", { className: v, children: [
1808
+ x,
1809
+ k,
1810
+ w,
1811
+ $,
1812
+ L,
1813
+ R,
1814
+ B,
1815
+ T
1816
+ ] }), e[34] = w, e[35] = $, e[36] = R, e[37] = v, e[38] = O) : O = e[38], O;
1817
+ }), $e = {
1818
+ name: "Business",
1819
+ verified: !1
1820
+ }, Mt = F(function(t) {
1821
+ const e = D.c(24), {
1822
+ flow: s,
1823
+ onUserReply: l,
1824
+ theme: i,
1825
+ device: g,
1826
+ businessInfo: r,
1827
+ showSuggestions: o
1828
+ } = t;
1829
+ let a;
1830
+ e[0] !== s || e[1] !== l ? (a = {
1831
+ flow: s,
1832
+ onUserReply: l,
1833
+ typingDelay: 800
1834
+ }, e[0] = s, e[1] = l, e[2] = a) : a = e[2];
1835
+ const {
1836
+ state: f,
1837
+ handleReply: h,
1838
+ handleAction: d
1839
+ } = Ze(a), [u, m] = ne(!1);
1840
+ let p;
1841
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = () => {
1842
+ m(zt);
1843
+ }, e[3] = p) : p = e[3];
1844
+ const b = p, [y, v] = ne(null);
1845
+ let x;
1846
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = (M) => {
1847
+ v({
1848
+ ...M,
1849
+ isOpen: !0
1850
+ });
1851
+ }, e[4] = x) : x = e[4];
1852
+ const k = x;
1853
+ let w;
1854
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = () => {
1855
+ v(null);
1856
+ }, e[5] = w) : w = e[5];
1857
+ const N = w;
1858
+ let _;
1859
+ e[6] !== d || e[7] !== l ? (_ = (M) => {
1860
+ if (!le(M))
1861
+ return;
1862
+ const I = He(M);
1863
+ if (I) {
1864
+ k({
1865
+ url: I.url,
1866
+ viewMode: I.webviewViewMode || "TALL",
1867
+ title: I.description || "",
1868
+ postbackData: M.action.postback.data
1869
+ }), l({
1870
+ type: "action",
1871
+ postbackData: M.action.postback.data,
1872
+ displayText: M.action.displayText,
1873
+ timestamp: Date.now(),
1874
+ actionData: {
1875
+ type: "webview",
1876
+ url: I.url,
1877
+ viewMode: I.webviewViewMode || "TALL",
1878
+ description: I.description
1879
+ }
1880
+ });
1881
+ return;
1882
+ }
1883
+ d(M);
1884
+ }, e[6] = d, e[7] = l, e[8] = _) : _ = e[8];
1885
+ const $ = _;
1886
+ let L;
1887
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */ n(kt, {}), e[9] = L) : L = e[9];
1888
+ let A;
1889
+ e[10] !== u ? (A = u && /* @__PURE__ */ n(Nt, {}), e[10] = u, e[11] = A) : A = e[11];
1890
+ let z;
1891
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ n(Lt, {}), e[12] = z) : z = e[12];
1892
+ let S;
1893
+ return e[13] !== r || e[14] !== g || e[15] !== $ || e[16] !== h || e[17] !== u || e[18] !== o || e[19] !== f || e[20] !== A || e[21] !== i || e[22] !== y ? (S = /* @__PURE__ */ C(Ae, { theme: i, device: g, businessInfo: r, state: f, showSuggestions: o, isProfileOpen: u, toggleProfile: b, onReply: h, onAction: $, webView: y, openWebView: k, closeWebView: N, children: [
1894
+ L,
1895
+ A,
1896
+ z
1897
+ ] }), e[13] = r, e[14] = g, e[15] = $, e[16] = h, e[17] = u, e[18] = o, e[19] = f, e[20] = A, e[21] = i, e[22] = y, e[23] = S) : S = e[23], S;
1898
+ }), Wt = F(function(t) {
1899
+ const e = D.c(84), {
1900
+ messages: s,
1901
+ jsonUrl: l,
1902
+ onUserReply: i,
1903
+ theme: g,
1904
+ device: r,
1905
+ businessInfo: o,
1906
+ className: a,
1907
+ width: f,
1908
+ height: h,
1909
+ showSuggestions: d,
1910
+ showLockScreen: u
1911
+ } = t, m = g === void 0 ? "light" : g, p = r === void 0 ? "android" : r, b = a === void 0 ? "" : a, y = f === void 0 ? 375 : f, v = h === void 0 ? 667 : h, x = d === void 0 ? !0 : d, k = u === void 0 ? !1 : u, [w, N] = ne(k);
1912
+ let _;
1913
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = () => {
1914
+ N(!1);
1915
+ }, e[0] = _) : _ = e[0];
1916
+ const $ = _, {
1917
+ data: L,
1918
+ isLoading: A,
1919
+ error: z
1920
+ } = Ke(l), S = l ? L : s;
1921
+ let M;
1922
+ e[1] !== S ? (M = S ? Je(S) : !1, e[1] = S, e[2] = M) : M = e[2];
1923
+ const I = M;
1924
+ let R;
1925
+ e[3] !== o || e[4] !== S?.name ? (R = () => ({
1926
+ ...$e,
1927
+ ...o,
1928
+ name: o?.name || S?.name || $e.name
1929
+ }), e[3] = o, e[4] = S?.name, e[5] = R) : R = e[5], S?.name;
1930
+ let B;
1931
+ e[6] !== R ? (B = R(), e[6] = R, e[7] = B) : B = e[7];
1932
+ const T = B;
1933
+ let O;
1934
+ e[8] !== S || e[9] !== I ? (O = S && I ? Qe(S) : "New message", e[8] = S, e[9] = I, e[10] = O) : O = e[10];
1935
+ const q = O, V = m === "dark";
1936
+ let Q;
1937
+ e[11] !== b || e[12] !== p || e[13] !== v || e[14] !== V || e[15] !== m || e[16] !== y ? (Q = (j) => {
1938
+ const {
1939
+ children: G
1940
+ } = j;
1941
+ return /* @__PURE__ */ n("div", { className: `
1942
+ rcs-emulator relative overflow-hidden
1943
+ rounded-2xl shadow-2xl
1944
+ ${V ? "bg-zinc-950" : "bg-white"}
1945
+ ${b}
1946
+ `, style: {
1947
+ width: y,
1948
+ height: v
1949
+ }, role: "application", "aria-label": "RCS Message Emulator", "data-theme": m, "data-device": p, children: G });
1950
+ }, e[11] = b, e[12] = p, e[13] = v, e[14] = V, e[15] = m, e[16] = y, e[17] = Q) : Q = e[17];
1951
+ const P = Q;
1952
+ if (l && A) {
1953
+ const j = `
1954
+ w-10 h-10 border-3 border-t-transparent rounded-full animate-spin mb-4
1955
+ ${V ? "border-zinc-600" : "border-gray-300"}
1956
+ `;
1957
+ let G;
1958
+ e[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = {
1959
+ borderTopColor: "transparent"
1960
+ }, e[18] = G) : G = e[18];
1961
+ let E;
1962
+ e[19] !== j ? (E = /* @__PURE__ */ n("div", { className: j, style: G }), e[19] = j, e[20] = E) : E = e[20];
1963
+ const J = `text-sm ${V ? "text-zinc-400" : "text-gray-500"}`;
1964
+ let W;
1965
+ e[21] !== J ? (W = /* @__PURE__ */ n("p", { className: J, children: "Loading conversation..." }), e[21] = J, e[22] = W) : W = e[22];
1966
+ let U;
1967
+ e[23] !== E || e[24] !== W ? (U = /* @__PURE__ */ C("div", { className: "flex flex-col items-center justify-center h-full p-6", children: [
1968
+ E,
1969
+ W
1970
+ ] }), e[23] = E, e[24] = W, e[25] = U) : U = e[25];
1971
+ let H;
1972
+ return e[26] !== P || e[27] !== U ? (H = /* @__PURE__ */ n(P, { children: U }), e[26] = P, e[27] = U, e[28] = H) : H = e[28], H;
1973
+ }
1974
+ if (l && z) {
1975
+ let j;
1976
+ e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ n("svg", { className: "w-12 h-12 mx-auto mb-4 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), e[29] = j) : j = e[29];
1977
+ const G = `text-lg font-medium mb-2 ${V ? "text-white" : "text-gray-900"}`;
1978
+ let E;
1979
+ e[30] !== G ? (E = /* @__PURE__ */ n("h3", { className: G, children: "Failed to Load" }), e[30] = G, e[31] = E) : E = e[31];
1980
+ const J = `text-sm ${V ? "text-zinc-400" : "text-gray-500"}`;
1981
+ let W;
1982
+ e[32] !== z || e[33] !== J ? (W = /* @__PURE__ */ n("p", { className: J, children: z }), e[32] = z, e[33] = J, e[34] = W) : W = e[34];
1983
+ const U = `text-xs mt-2 break-all max-w-full ${V ? "text-zinc-500" : "text-gray-400"}`;
1984
+ let H;
1985
+ e[35] !== l || e[36] !== U ? (H = /* @__PURE__ */ n("p", { className: U, children: l }), e[35] = l, e[36] = U, e[37] = H) : H = e[37];
1986
+ let X;
1987
+ e[38] !== E || e[39] !== W || e[40] !== H ? (X = /* @__PURE__ */ C("div", { className: "flex flex-col items-center justify-center h-full p-6 text-center", children: [
1988
+ j,
1989
+ E,
1990
+ W,
1991
+ H
1992
+ ] }), e[38] = E, e[39] = W, e[40] = H, e[41] = X) : X = e[41];
1993
+ let Z;
1994
+ return e[42] !== P || e[43] !== X ? (Z = /* @__PURE__ */ n(P, { children: X }), e[42] = P, e[43] = X, e[44] = Z) : Z = e[44], Z;
1995
+ }
1996
+ if (!S) {
1997
+ const j = `w-12 h-12 mx-auto mb-4 ${V ? "text-zinc-600" : "text-gray-300"}`;
1998
+ let G;
1999
+ e[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, 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" }), e[45] = G) : G = e[45];
2000
+ let E;
2001
+ e[46] !== j ? (E = /* @__PURE__ */ n("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: G }), e[46] = j, e[47] = E) : E = e[47];
2002
+ const J = `text-lg font-medium mb-2 ${V ? "text-white" : "text-gray-900"}`;
2003
+ let W;
2004
+ e[48] !== J ? (W = /* @__PURE__ */ n("h3", { className: J, children: "No Conversation Data" }), e[48] = J, e[49] = W) : W = e[49];
2005
+ const U = `text-sm ${V ? "text-zinc-400" : "text-gray-500"}`;
2006
+ let H;
2007
+ e[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ n("code", { className: "px-1 py-0.5 rounded bg-gray-100 dark:bg-zinc-800", children: "messages" }), e[50] = H) : H = e[50];
2008
+ let X;
2009
+ e[51] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ n("code", { className: "px-1 py-0.5 rounded bg-gray-100 dark:bg-zinc-800", children: "jsonUrl" }), e[51] = X) : X = e[51];
2010
+ let Z;
2011
+ e[52] !== U ? (Z = /* @__PURE__ */ C("p", { className: U, children: [
2012
+ "Provide either",
2013
+ " ",
2014
+ H,
2015
+ " ",
2016
+ "or",
2017
+ " ",
2018
+ X,
2019
+ " ",
2020
+ "prop"
2021
+ ] }), e[52] = U, e[53] = Z) : Z = e[53];
2022
+ let te;
2023
+ e[54] !== E || e[55] !== W || e[56] !== Z ? (te = /* @__PURE__ */ C("div", { className: "flex flex-col items-center justify-center h-full p-6 text-center", children: [
2024
+ E,
2025
+ W,
2026
+ Z
2027
+ ] }), e[54] = E, e[55] = W, e[56] = Z, e[57] = te) : te = e[57];
2028
+ let se;
2029
+ return e[58] !== P || e[59] !== te ? (se = /* @__PURE__ */ n(P, { children: te }), e[58] = P, e[59] = te, e[60] = se) : se = e[60], se;
2030
+ }
2031
+ if (!I) {
2032
+ let j;
2033
+ e[61] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ n("svg", { className: "w-12 h-12 mx-auto mb-4 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }), e[61] = j) : j = e[61];
2034
+ const G = `text-lg font-medium mb-2 ${V ? "text-white" : "text-gray-900"}`;
2035
+ let E;
2036
+ e[62] !== G ? (E = /* @__PURE__ */ n("h3", { className: G, children: "Invalid RBM JSON" }), e[62] = G, e[63] = E) : E = e[63];
2037
+ const J = `text-sm ${V ? "text-zinc-400" : "text-gray-500"}`;
2038
+ let W;
2039
+ e[64] !== J ? (W = /* @__PURE__ */ n("p", { className: J, children: "The conversation flow structure is not valid" }), e[64] = J, e[65] = W) : W = e[65];
2040
+ let U;
2041
+ e[66] !== E || e[67] !== W ? (U = /* @__PURE__ */ C("div", { className: "flex flex-col items-center justify-center h-full p-6 text-center", children: [
2042
+ j,
2043
+ E,
2044
+ W
2045
+ ] }), e[66] = E, e[67] = W, e[68] = U) : U = e[68];
2046
+ let H;
2047
+ return e[69] !== P || e[70] !== U ? (H = /* @__PURE__ */ n(P, { children: U }), e[69] = P, e[70] = U, e[71] = H) : H = e[71], H;
2048
+ }
2049
+ let Y;
2050
+ e[72] !== p || e[73] !== S || e[74] !== w || e[75] !== T || e[76] !== q || e[77] !== i || e[78] !== x || e[79] !== m ? (Y = w ? /* @__PURE__ */ n(Ae, { theme: m, device: p, businessInfo: T, state: {
2051
+ currentMessageId: null,
2052
+ chatHistory: [],
2053
+ isTyping: !1,
2054
+ error: null
2055
+ }, showSuggestions: !1, isProfileOpen: !1, toggleProfile: It, onReply: At, onAction: Rt, webView: null, openWebView: Tt, closeWebView: jt, children: /* @__PURE__ */ n($t, { onUnlock: $, messagePreview: q }) }) : /* @__PURE__ */ n(Mt, { flow: S, onUserReply: i, theme: m, device: p, businessInfo: T, showSuggestions: x }), e[72] = p, e[73] = S, e[74] = w, e[75] = T, e[76] = q, e[77] = i, e[78] = x, e[79] = m, e[80] = Y) : Y = e[80];
2056
+ let ee;
2057
+ return e[81] !== P || e[82] !== Y ? (ee = /* @__PURE__ */ n(P, { children: Y }), e[81] = P, e[82] = Y, e[83] = ee) : ee = e[83], ee;
2058
+ });
2059
+ function zt(c) {
2060
+ return !c;
2061
+ }
2062
+ function It() {
2063
+ }
2064
+ function At() {
2065
+ }
2066
+ function Rt() {
2067
+ }
2068
+ function Tt() {
2069
+ }
2070
+ function jt() {
2071
+ }
2072
+ export {
2073
+ Wt as RcsEmulator,
2074
+ Lt as WebViewRenderer,
2075
+ Wt as default,
2076
+ Qe as getFirstMessagePreview,
2077
+ He as getWebViewConfig,
2078
+ le as isSuggestedAction,
2079
+ ze as isSuggestedReply,
2080
+ Bt as isWebViewAction,
2081
+ Ke as useJsonFetch,
2082
+ Je as validateConversationFlow
2083
+ };
2084
+ //# sourceMappingURL=rcs-emulator.es.js.map