@maebgch/rcs-emulator 0.1.6 → 0.1.8

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