@instockng/storefront-ui 1.0.111 → 1.0.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/dist/components/AssistantDrawer.d.ts.map +1 -1
  2. package/dist/index100.mjs +67 -8
  3. package/dist/index101.mjs +83 -71
  4. package/dist/index102.mjs +28 -3
  5. package/dist/index103.mjs +9 -2
  6. package/dist/index104.mjs +70 -78
  7. package/dist/index105.mjs +3 -53
  8. package/dist/index106.mjs +2 -6
  9. package/dist/index107.mjs +82 -4
  10. package/dist/index108.mjs +51 -176
  11. package/dist/index109.mjs +6 -53
  12. package/dist/index110.mjs +5 -69
  13. package/dist/index111.mjs +179 -37
  14. package/dist/index112.mjs +51 -41
  15. package/dist/index113.mjs +69 -2
  16. package/dist/index115.mjs +1 -1
  17. package/dist/index116.mjs +1 -1
  18. package/dist/index117.mjs +6 -6
  19. package/dist/index118.mjs +4 -4
  20. package/dist/index119.mjs +3 -3
  21. package/dist/index120.mjs +1 -1
  22. package/dist/index121.mjs +1 -1
  23. package/dist/index122.mjs +1 -1
  24. package/dist/index123.mjs +2 -2
  25. package/dist/index124.mjs +2 -2
  26. package/dist/index125.mjs +3 -3
  27. package/dist/index126.mjs +1 -1
  28. package/dist/index127.mjs +3 -3
  29. package/dist/index128.mjs +2 -2
  30. package/dist/index129.mjs +2 -2
  31. package/dist/index130.mjs +1 -1
  32. package/dist/index131.mjs +3 -3
  33. package/dist/index132.mjs +1 -1
  34. package/dist/index133.mjs +1 -1
  35. package/dist/index134.mjs +3 -3
  36. package/dist/index135.mjs +2 -2
  37. package/dist/index136.mjs +4 -4
  38. package/dist/index137.mjs +1 -1
  39. package/dist/index138.mjs +3 -3
  40. package/dist/index139.mjs +4 -4
  41. package/dist/index140.mjs +1 -1
  42. package/dist/index141.mjs +1 -1
  43. package/dist/index142.mjs +1 -1
  44. package/dist/index143.mjs +1 -1
  45. package/dist/index144.mjs +1 -1
  46. package/dist/index145.mjs +1 -1
  47. package/dist/index146.mjs +1 -1
  48. package/dist/index147.mjs +2 -2
  49. package/dist/index148.mjs +3 -3
  50. package/dist/index151.mjs +1 -1
  51. package/dist/index153.mjs +2 -21
  52. package/dist/index154.mjs +2 -56
  53. package/dist/index155.mjs +2 -29
  54. package/dist/index156.mjs +2 -7
  55. package/dist/index157.mjs +16 -50
  56. package/dist/index158.mjs +32 -6
  57. package/dist/index159.mjs +37 -11
  58. package/dist/index160.mjs +18 -7
  59. package/dist/index161.mjs +18 -28
  60. package/dist/index162.mjs +2 -2
  61. package/dist/index163.mjs +20 -70
  62. package/dist/index164.mjs +42 -163
  63. package/dist/index166.mjs +30 -2
  64. package/dist/index167.mjs +18 -2
  65. package/dist/index168.mjs +2 -2
  66. package/dist/index169.mjs +2 -18
  67. package/dist/index170.mjs +2 -32
  68. package/dist/index171.mjs +2 -38
  69. package/dist/index172.mjs +67 -13
  70. package/dist/index173.mjs +2 -18
  71. package/dist/index174.mjs +53 -2
  72. package/dist/index175.mjs +2 -20
  73. package/dist/index176.mjs +29 -39
  74. package/dist/index177.mjs +152 -2
  75. package/dist/index178.mjs +2 -30
  76. package/dist/index179.mjs +2 -18
  77. package/dist/index180.mjs +19 -2
  78. package/dist/index181.mjs +2 -2
  79. package/dist/index182.mjs +2 -2
  80. package/dist/index183.mjs +26 -2
  81. package/dist/index184.mjs +2 -72
  82. package/dist/index185.mjs +2 -2
  83. package/dist/index186.mjs +20 -49
  84. package/dist/index187.mjs +23 -2
  85. package/dist/index188.mjs +2 -36
  86. package/dist/index189.mjs +2 -152
  87. package/dist/index190.mjs +2 -2
  88. package/dist/index191.mjs +23 -2
  89. package/dist/index192.mjs +2 -19
  90. package/dist/index193.mjs +23 -2
  91. package/dist/index195.mjs +2 -26
  92. package/dist/index196.mjs +2 -2
  93. package/dist/index197.mjs +23 -2
  94. package/dist/index198.mjs +2 -24
  95. package/dist/index199.mjs +15 -15
  96. package/dist/index200.mjs +2 -2
  97. package/dist/index201.mjs +2 -2
  98. package/dist/index202.mjs +2 -2
  99. package/dist/index203.mjs +2 -23
  100. package/dist/index204.mjs +2 -2
  101. package/dist/index205.mjs +2 -23
  102. package/dist/index206.mjs +2 -2
  103. package/dist/index207.mjs +2 -2
  104. package/dist/index208.mjs +127 -2
  105. package/dist/index209.mjs +2 -23
  106. package/dist/index210.mjs +74 -2
  107. package/dist/index211.mjs +71 -20
  108. package/dist/index212.mjs +21 -2
  109. package/dist/index213.mjs +56 -2
  110. package/dist/index214.mjs +29 -2
  111. package/dist/index215.mjs +7 -2
  112. package/dist/index216.mjs +52 -2
  113. package/dist/index217.mjs +6 -2
  114. package/dist/index218.mjs +12 -2
  115. package/dist/index219.mjs +7 -2
  116. package/dist/index22.mjs +97 -87
  117. package/dist/index220.mjs +28 -127
  118. package/dist/index221.mjs +2 -2
  119. package/dist/index222.mjs +69 -73
  120. package/dist/index223.mjs +164 -71
  121. package/dist/index224.mjs +2 -31
  122. package/dist/index225.mjs +2 -11
  123. package/dist/index226.mjs +2 -4
  124. package/dist/index227.mjs +2 -4
  125. package/dist/index228.mjs +2 -13
  126. package/dist/index229.mjs +2 -7
  127. package/dist/index230.mjs +2 -12
  128. package/dist/index231.mjs +2 -5
  129. package/dist/index232.mjs +244 -33
  130. package/dist/index233.mjs +2 -31
  131. package/dist/index234.mjs +32 -27
  132. package/dist/index235.mjs +63 -59
  133. package/dist/index236.mjs +25 -2
  134. package/dist/index237.mjs +2 -2
  135. package/dist/index238.mjs +2 -2
  136. package/dist/index239.mjs +37 -2
  137. package/dist/index240.mjs +2 -2
  138. package/dist/index242.mjs +2 -2
  139. package/dist/index243.mjs +2 -2
  140. package/dist/index244.mjs +2 -108
  141. package/dist/index246.mjs +2 -2
  142. package/dist/index247.mjs +96 -25
  143. package/dist/index249.mjs +2 -2
  144. package/dist/index251.mjs +2 -244
  145. package/dist/index253.mjs +2 -33
  146. package/dist/index254.mjs +4 -65
  147. package/dist/index255.mjs +13 -25
  148. package/dist/index256.mjs +7 -2
  149. package/dist/index257.mjs +31 -2
  150. package/dist/index258.mjs +11 -2
  151. package/dist/index259.mjs +4 -2
  152. package/dist/index260.mjs +4 -2
  153. package/dist/index261.mjs +12 -2
  154. package/dist/index262.mjs +5 -2
  155. package/dist/index263.mjs +33 -2
  156. package/dist/index264.mjs +31 -4
  157. package/dist/index265.mjs +28 -2
  158. package/dist/index266.mjs +61 -2
  159. package/dist/index267.mjs +2 -2
  160. package/dist/index268.mjs +2 -18
  161. package/dist/index269.mjs +13 -42
  162. package/dist/index270.mjs +47 -2
  163. package/dist/index271.mjs +2 -2
  164. package/dist/index272.mjs +2 -2
  165. package/dist/index273.mjs +2 -2
  166. package/dist/index274.mjs +91 -2
  167. package/dist/index275.mjs +2 -91
  168. package/dist/index276.mjs +1 -2
  169. package/dist/index277.mjs +3 -2
  170. package/dist/index278.mjs +2 -2
  171. package/dist/index279.mjs +2 -2
  172. package/dist/index282.mjs +1 -1
  173. package/dist/index283.mjs +2 -2
  174. package/dist/index43.mjs +1 -1
  175. package/dist/index44.mjs +1 -1
  176. package/dist/index45.mjs +1 -1
  177. package/dist/index46.mjs +1 -1
  178. package/dist/index47.mjs +1 -1
  179. package/dist/index54.mjs +3 -3
  180. package/dist/index58.mjs +1 -1
  181. package/dist/index63.mjs +17 -17
  182. package/dist/index64.mjs +2 -2
  183. package/dist/index65.mjs +1 -1
  184. package/dist/index66.mjs +1 -1
  185. package/dist/index67.mjs +1 -1
  186. package/dist/index68.mjs +1 -1
  187. package/dist/index69.mjs +1 -1
  188. package/dist/index70.mjs +1 -1
  189. package/dist/index71.mjs +1 -1
  190. package/dist/index72.mjs +1 -1
  191. package/dist/index73.mjs +1 -1
  192. package/dist/index74.mjs +1 -1
  193. package/dist/index75.mjs +1 -1
  194. package/dist/index76.mjs +1 -1
  195. package/dist/index77.mjs +1 -1
  196. package/dist/index78.mjs +1 -1
  197. package/dist/index82.mjs +22 -4
  198. package/dist/index83.mjs +73 -21
  199. package/dist/index84.mjs +14 -74
  200. package/dist/index85.mjs +62 -14
  201. package/dist/index86.mjs +4 -62
  202. package/dist/index94.mjs +2 -235
  203. package/dist/index95.mjs +37 -6
  204. package/dist/index96.mjs +39 -130
  205. package/dist/index97.mjs +229 -62
  206. package/dist/index98.mjs +5 -86
  207. package/dist/index99.mjs +131 -26
  208. package/package.json +1 -1
  209. package/src/components/AssistantDrawer.tsx +23 -3
package/dist/index22.mjs CHANGED
@@ -1,39 +1,49 @@
1
1
  'use client';
2
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
3
- import { useState as m, useRef as b, useCallback as K, useEffect as v } from "react";
4
- import { createPortal as O } from "react-dom";
2
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
3
+ import { useState as m, useRef as b, useCallback as B, useEffect as v } from "react";
4
+ import { createPortal as Z } from "react-dom";
5
5
  import { Sparkles as Q, X as ee, MessageCircle as te, Loader2 as re, Send as se } from "lucide-react";
6
6
  import { cn as k, formatCurrency as ne, WHATSAPP_HELP_LINK as ae } from "./index30.mjs";
7
7
  import { useHideBodyOverflow as oe } from "./index53.mjs";
8
- function fe({
9
- isOpen: c,
8
+ function le(a) {
9
+ return a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>").replace(/\*(.+?)\*/g, "<em>$1</em>").replace(/\n/g, "<br />");
10
+ }
11
+ function ce(a) {
12
+ return a.replace(/\s*PRODUCTS:[\w\-,]*\s*/g, "").replace(/\s*CONTACT_SUPPORT\s*/gi, "");
13
+ }
14
+ function ge({
15
+ isOpen: a,
10
16
  onClose: x,
11
- apiUrl: C,
17
+ apiUrl: P,
12
18
  brandSlug: R,
13
- productSlug: I,
19
+ productSlug: j,
14
20
  initialQuestion: y,
15
- assistantName: P = "AI Assistant",
16
- className: U,
17
- disablePortal: V = !1
21
+ assistantName: I = "AI Assistant",
22
+ className: K,
23
+ disablePortal: O = !1
18
24
  }) {
19
- const [u, d] = m([]), [w, S] = m(""), [f, L] = m(!1), [W, h] = m(null), [$, D] = m(!1), [X, H] = m(!1), J = b(null), M = b(null), A = b(!1), _ = b([]);
20
- _.current = u, oe(c);
21
- const q = K((e, o) => {
25
+ const [u, d] = m([]), [w, S] = m(""), [f, L] = m(!1), [_, h] = m(null), [$, M] = m(!1), [V, W] = m(!1), D = b(null), H = b(null), A = b(!1), J = b([]);
26
+ J.current = u, oe(a);
27
+ const U = B((e, c) => {
22
28
  if (e === "token")
23
29
  d((s) => {
24
- const l = [...s], t = l[l.length - 1];
25
- return (t == null ? void 0 : t.role) === "assistant" && (l[l.length - 1] = { ...t, content: t.content + o }), l;
30
+ const i = [...s], t = i[i.length - 1];
31
+ if ((t == null ? void 0 : t.role) === "assistant") {
32
+ const n = t.content + c, o = ce(n);
33
+ i[i.length - 1] = { ...t, content: o };
34
+ }
35
+ return i;
26
36
  });
27
37
  else if (e === "done")
28
38
  try {
29
- const s = JSON.parse(o);
30
- d((l) => {
31
- var i;
32
- const t = [...l], n = t[t.length - 1];
39
+ const s = JSON.parse(c);
40
+ d((i) => {
41
+ var o;
42
+ const t = [...i], n = t[t.length - 1];
33
43
  return (n == null ? void 0 : n.role) === "assistant" && (t[t.length - 1] = {
34
44
  ...n,
35
45
  content: s.answer || n.content,
36
- products: ((i = s.products) == null ? void 0 : i.length) > 0 ? s.products : void 0,
46
+ products: ((o = s.products) == null ? void 0 : o.length) > 0 ? s.products : void 0,
37
47
  whatsapp: s.whatsapp || !1
38
48
  }), t;
39
49
  });
@@ -41,109 +51,109 @@ function fe({
41
51
  }
42
52
  else if (e === "error")
43
53
  try {
44
- const s = JSON.parse(o);
54
+ const s = JSON.parse(c);
45
55
  h(s.message || "An error occurred");
46
56
  } catch {
47
57
  h("An error occurred");
48
58
  }
49
- }, []), N = b(null), F = K(
59
+ }, []), N = b(null), q = B(
50
60
  async (e) => {
51
- var l;
61
+ var i;
52
62
  if (!e.trim()) return;
53
63
  h(null);
54
- const o = { role: "user", content: e }, s = _.current.slice(-20).map((t) => ({
64
+ const c = { role: "user", content: e }, s = J.current.slice(-20).map((t) => ({
55
65
  role: t.role,
56
66
  content: t.content
57
67
  }));
58
- d((t) => [...t, o]), S(""), L(!0), d((t) => [...t, { role: "assistant", content: "" }]);
68
+ d((t) => [...t, c]), S(""), L(!0), d((t) => [...t, { role: "assistant", content: "" }]);
59
69
  try {
60
- const t = await fetch(`${C}/v1/assistant/ask`, {
70
+ const t = await fetch(`${P}/v1/assistant/ask`, {
61
71
  method: "POST",
62
72
  headers: { "Content-Type": "application/json" },
63
73
  body: JSON.stringify({
64
74
  question: e,
65
75
  brandSlug: R,
66
- productSlug: I,
76
+ productSlug: j,
67
77
  history: s
68
78
  })
69
79
  });
70
80
  if (!t.ok) {
71
- const p = await t.json().catch(() => ({}));
81
+ const g = await t.json().catch(() => ({}));
72
82
  throw new Error(
73
- ((l = p == null ? void 0 : p.error) == null ? void 0 : l.message) || `Request failed (${t.status})`
83
+ ((i = g == null ? void 0 : g.error) == null ? void 0 : i.message) || `Request failed (${t.status})`
74
84
  );
75
85
  }
76
86
  if (!t.body) throw new Error("No response body");
77
- const n = t.body.getReader(), i = new TextDecoder();
78
- let E = "", j = "";
87
+ const n = t.body.getReader(), o = new TextDecoder();
88
+ let E = "", T = "";
79
89
  for (; ; ) {
80
- const { done: p, value: Y } = await n.read();
81
- if (p) break;
82
- E += i.decode(Y, { stream: !0 });
83
- const B = E.split(`
90
+ const { done: g, value: G } = await n.read();
91
+ if (g) break;
92
+ E += o.decode(G, { stream: !0 });
93
+ const z = E.split(`
84
94
  `);
85
- E = B.pop() || "";
86
- for (const g of B) {
87
- if (g.trim() === "") {
88
- j = "";
95
+ E = z.pop() || "";
96
+ for (const p of z) {
97
+ if (p.trim() === "") {
98
+ T = "";
89
99
  continue;
90
100
  }
91
- if (g.trimStart().startsWith("event:"))
92
- j = g.trimStart().slice(6).trim();
93
- else if (g.trimStart().startsWith("data:")) {
94
- const T = g.trimStart().slice(5), Z = T.startsWith(" ") ? T.slice(1) : T;
95
- q(j || "token", Z);
101
+ if (p.trimStart().startsWith("event:"))
102
+ T = p.trimStart().slice(6).trim();
103
+ else if (p.trimStart().startsWith("data:")) {
104
+ const C = p.trimStart().slice(5), Y = C.startsWith(" ") ? C.slice(1) : C;
105
+ U(T || "token", Y);
96
106
  }
97
107
  }
98
108
  }
99
109
  } catch (t) {
100
110
  h(t.message || "Something went wrong"), d((n) => {
101
- const i = n[n.length - 1];
102
- return (i == null ? void 0 : i.role) === "assistant" && !i.content ? n.slice(0, -1) : n;
111
+ const o = n[n.length - 1];
112
+ return (o == null ? void 0 : o.role) === "assistant" && !o.content ? n.slice(0, -1) : n;
103
113
  });
104
114
  } finally {
105
115
  L(!1);
106
116
  }
107
117
  },
108
- [C, R, I, q]
118
+ [P, R, j, U]
109
119
  );
110
- N.current = F, v(() => {
111
- if (c)
112
- H(!0), requestAnimationFrame(() => {
120
+ N.current = q, v(() => {
121
+ if (a)
122
+ W(!0), requestAnimationFrame(() => {
113
123
  requestAnimationFrame(() => {
114
- D(!0);
124
+ M(!0);
115
125
  });
116
126
  });
117
127
  else {
118
- D(!1);
128
+ M(!1);
119
129
  const e = setTimeout(() => {
120
- H(!1), d([]), S(""), h(null), A.current = !1;
130
+ W(!1), d([]), S(""), h(null), A.current = !1;
121
131
  }, 300);
122
132
  return () => clearTimeout(e);
123
133
  }
124
- }, [c]), v(() => {
125
- c && y && !A.current && (A.current = !0, y.trim() ? setTimeout(() => {
134
+ }, [a]), v(() => {
135
+ a && y && !A.current && (A.current = !0, y.trim() ? setTimeout(() => {
126
136
  var e;
127
137
  return (e = N.current) == null ? void 0 : e.call(N, y);
128
138
  }, 100) : setTimeout(() => {
129
139
  var e;
130
- return (e = M.current) == null ? void 0 : e.focus();
140
+ return (e = H.current) == null ? void 0 : e.focus();
131
141
  }, 350));
132
- }, [c, y]), v(() => {
142
+ }, [a, y]), v(() => {
133
143
  var e;
134
- (e = J.current) == null || e.scrollIntoView({ behavior: "smooth" });
144
+ (e = D.current) == null || e.scrollIntoView({ behavior: "smooth" });
135
145
  }, [u]), v(() => {
136
- const e = (o) => {
137
- o.key === "Escape" && c && x();
146
+ const e = (c) => {
147
+ c.key === "Escape" && a && x();
138
148
  };
139
- if (c)
149
+ if (a)
140
150
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
141
- }, [c, x]);
142
- const G = (e) => {
143
- e.preventDefault(), w.trim() && F(w.trim());
151
+ }, [a, x]);
152
+ const X = (e) => {
153
+ e.preventDefault(), w.trim() && q(w.trim());
144
154
  };
145
- if (!X) return null;
146
- const z = /* @__PURE__ */ a(
155
+ if (!V) return null;
156
+ const F = /* @__PURE__ */ l(
147
157
  "div",
148
158
  {
149
159
  className: k(
@@ -158,7 +168,7 @@ function fe({
158
168
  onClick: x
159
169
  }
160
170
  ),
161
- /* @__PURE__ */ a(
171
+ /* @__PURE__ */ l(
162
172
  "div",
163
173
  {
164
174
  className: k(
@@ -169,13 +179,13 @@ function fe({
169
179
  "sm:inset-y-0 sm:left-0 sm:right-auto sm:w-[420px] sm:max-w-full sm:rounded-t-none sm:rounded-r-2xl",
170
180
  // Animation
171
181
  $ ? "translate-y-0 sm:translate-x-0" : "translate-y-full sm:translate-y-0 sm:-translate-x-full",
172
- U
182
+ K
173
183
  ),
174
184
  children: [
175
- /* @__PURE__ */ a("div", { className: "flex items-center justify-between border-b border-gray-200 px-4 py-3 flex-shrink-0", children: [
176
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
185
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-between border-b border-gray-200 px-4 py-3 flex-shrink-0", children: [
186
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
177
187
  /* @__PURE__ */ r(Q, { className: "h-5 w-5 text-orange-500" }),
178
- /* @__PURE__ */ r("span", { className: "font-semibold text-gray-900", children: P }),
188
+ /* @__PURE__ */ r("span", { className: "font-semibold text-gray-900", children: I }),
179
189
  /* @__PURE__ */ r("span", { className: "text-xs text-gray-400 bg-gray-100 rounded px-1.5 py-0.5", children: "beta" })
180
190
  ] }),
181
191
  /* @__PURE__ */ r(
@@ -189,14 +199,14 @@ function fe({
189
199
  }
190
200
  )
191
201
  ] }),
192
- /* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto p-4 space-y-4 min-h-0", children: [
202
+ /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto p-4 space-y-4 min-h-0", children: [
193
203
  u.length === 0 && !f && /* @__PURE__ */ r("div", { className: "text-center text-gray-400 text-sm py-8", children: "Ask me anything about our products!" }),
194
- u.map((e, o) => /* @__PURE__ */ r("div", { children: e.role === "user" ? /* @__PURE__ */ r("div", { className: "flex justify-end", children: /* @__PURE__ */ r("div", { className: "bg-gray-800 text-white rounded-2xl rounded-br-sm px-4 py-2 max-w-[80%] text-sm", children: e.content }) }) : /* @__PURE__ */ a("div", { className: "space-y-3", children: [
195
- /* @__PURE__ */ a("div", { className: "text-sm text-gray-800 leading-relaxed whitespace-pre-wrap", children: [
196
- e.content,
197
- f && o === u.length - 1 && /* @__PURE__ */ r("span", { className: "inline-block w-1.5 h-4 bg-gray-400 animate-pulse ml-0.5 align-text-bottom" })
204
+ u.map((e, c) => /* @__PURE__ */ r("div", { children: e.role === "user" ? /* @__PURE__ */ r("div", { className: "flex justify-end", children: /* @__PURE__ */ r("div", { className: "bg-gray-800 text-white rounded-2xl rounded-br-sm px-4 py-2 max-w-[80%] text-sm", children: e.content }) }) : /* @__PURE__ */ l("div", { className: "space-y-3", children: [
205
+ /* @__PURE__ */ l("div", { className: "text-sm text-gray-800 leading-relaxed", children: [
206
+ /* @__PURE__ */ r("span", { dangerouslySetInnerHTML: { __html: le(e.content) } }),
207
+ f && c === u.length - 1 && /* @__PURE__ */ r("span", { className: "inline-block w-1.5 h-4 bg-gray-400 animate-pulse ml-0.5 align-text-bottom" })
198
208
  ] }),
199
- e.products && e.products.length > 0 && /* @__PURE__ */ r("div", { className: "space-y-2", children: e.products.map((s) => /* @__PURE__ */ a(
209
+ e.products && e.products.length > 0 && /* @__PURE__ */ r("div", { className: "space-y-2", children: e.products.map((s) => /* @__PURE__ */ l(
200
210
  "a",
201
211
  {
202
212
  href: `/product/${s.slug}`,
@@ -210,7 +220,7 @@ function fe({
210
220
  className: "h-16 w-16 rounded-lg object-cover flex-shrink-0"
211
221
  }
212
222
  ) : /* @__PURE__ */ r("div", { className: "h-16 w-16 rounded-lg bg-gray-100 flex-shrink-0" }),
213
- /* @__PURE__ */ a("div", { className: "min-w-0", children: [
223
+ /* @__PURE__ */ l("div", { className: "min-w-0", children: [
214
224
  /* @__PURE__ */ r("p", { className: "text-sm font-medium text-gray-900 line-clamp-2", children: s.name }),
215
225
  /* @__PURE__ */ r("p", { className: "text-sm font-semibold text-blue-600", children: ne(s.price) })
216
226
  ] })
@@ -218,7 +228,7 @@ function fe({
218
228
  },
219
229
  s.slug
220
230
  )) }),
221
- e.whatsapp && /* @__PURE__ */ a(
231
+ e.whatsapp && /* @__PURE__ */ l(
222
232
  "a",
223
233
  {
224
234
  href: ae,
@@ -231,19 +241,19 @@ function fe({
231
241
  ]
232
242
  }
233
243
  )
234
- ] }) }, o)),
235
- W && /* @__PURE__ */ r("div", { className: "rounded-lg bg-red-50 border border-red-200 p-3 text-sm text-red-700", children: W }),
236
- /* @__PURE__ */ r("div", { ref: J })
244
+ ] }) }, c)),
245
+ _ && /* @__PURE__ */ r("div", { className: "rounded-lg bg-red-50 border border-red-200 p-3 text-sm text-red-700", children: _ }),
246
+ /* @__PURE__ */ r("div", { ref: D })
237
247
  ] }),
238
- /* @__PURE__ */ r("div", { className: "border-t border-gray-200 p-3 flex-shrink-0", children: /* @__PURE__ */ a("form", { onSubmit: G, className: "flex items-center gap-2", children: [
248
+ /* @__PURE__ */ r("div", { className: "border-t border-gray-200 p-3 flex-shrink-0", children: /* @__PURE__ */ l("form", { onSubmit: X, className: "flex items-center gap-2", children: [
239
249
  /* @__PURE__ */ r(
240
250
  "input",
241
251
  {
242
- ref: M,
252
+ ref: H,
243
253
  type: "text",
244
254
  value: w,
245
255
  onChange: (e) => S(e.target.value),
246
- placeholder: `Ask ${P} a question`,
256
+ placeholder: `Ask ${I} a question`,
247
257
  disabled: f,
248
258
  className: k(
249
259
  "flex-1 rounded-full border border-gray-300 px-4 py-2.5 text-sm",
@@ -273,8 +283,8 @@ function fe({
273
283
  ]
274
284
  }
275
285
  );
276
- return V ? z : O(z, document.body);
286
+ return O ? F : Z(F, document.body);
277
287
  }
278
288
  export {
279
- fe as AssistantDrawer
289
+ ge as AssistantDrawer
280
290
  };
package/dist/index220.mjs CHANGED
@@ -1,130 +1,31 @@
1
1
  'use client';
2
- import { __module as b } from "./index263.mjs";
3
- import S from "./index264.mjs";
4
- var _;
5
- function $() {
6
- return _ ? b.exports : (_ = 1, (() => {
7
- var O = { 154: (t, m, n) => {
8
- var i = n(781), u = ["write", "end", "destroy"], f = ["resume", "pause"], l = ["data", "close"], c = Array.prototype.slice;
9
- t.exports = s;
10
- function r(o, a) {
11
- if (o.forEach)
12
- return o.forEach(a);
13
- for (var e = 0; e < o.length; e++)
14
- a(o[e], e);
15
- }
16
- function s(o, a) {
17
- var e = new i(), d = !1;
18
- return r(u, x), r(f, z), r(l, E), a.on("end", F), o.on("drain", function() {
19
- e.emit("drain");
20
- }), o.on("error", w), a.on("error", w), e.writable = o.writable, e.readable = a.readable, e;
21
- function x(p) {
22
- e[p] = h;
23
- function h() {
24
- return o[p].apply(o, arguments);
25
- }
26
- }
27
- function z(p) {
28
- e[p] = h;
29
- function h() {
30
- e.emit(p);
31
- var y = a[p];
32
- if (y)
33
- return y.apply(a, arguments);
34
- a.emit(p);
35
- }
36
- }
37
- function E(p) {
38
- a.on(p, h);
39
- function h() {
40
- var y = c.call(arguments);
41
- y.unshift(p), e.emit.apply(e, y);
42
- }
43
- }
44
- function F() {
45
- if (!d) {
46
- d = !0;
47
- var p = c.call(arguments);
48
- p.unshift("end"), e.emit.apply(e, p);
49
- }
50
- }
51
- function w(p) {
52
- e.emit("error", p);
53
- }
54
- }
55
- }, 349: (t, m, n) => {
56
- const i = n(147), u = n(781), f = n(796), l = n(154), c = n(530), r = (s) => Object.assign({ level: 9 }, s);
57
- t.exports = (s, o) => s ? c(f.gzip)(s, r(o)).then((a) => a.length).catch((a) => 0) : Promise.resolve(0), t.exports.sync = (s, o) => f.gzipSync(s, r(o)).length, t.exports.stream = (s) => {
58
- const o = new u.PassThrough(), a = new u.PassThrough(), e = l(o, a);
59
- let d = 0;
60
- const x = f.createGzip(r(s)).on("data", (z) => {
61
- d += z.length;
62
- }).on("error", () => {
63
- e.gzipSize = 0;
64
- }).on("end", () => {
65
- e.gzipSize = d, e.emit("gzip-size", d), a.end();
66
- });
67
- return o.pipe(x), o.pipe(a, { end: !1 }), e;
68
- }, t.exports.file = (s, o) => new Promise((a, e) => {
69
- const d = i.createReadStream(s);
70
- d.on("error", e);
71
- const x = d.pipe(t.exports.stream(o));
72
- x.on("error", e), x.on("gzip-size", a);
73
- }), t.exports.fileSync = (s, o) => t.exports.sync(i.readFileSync(s), o);
74
- }, 530: (t) => {
75
- const m = (n, i) => function(...u) {
76
- const f = i.promiseModule;
77
- return new f((l, c) => {
78
- i.multiArgs ? u.push((...r) => {
79
- i.errorFirst ? r[0] ? c(r) : (r.shift(), l(r)) : l(r);
80
- }) : i.errorFirst ? u.push((r, s) => {
81
- r ? c(r) : l(s);
82
- }) : u.push(l), n.apply(this, u);
83
- });
84
- };
85
- t.exports = (n, i) => {
86
- i = Object.assign({ exclude: [/.+(Sync|Stream)$/], errorFirst: !0, promiseModule: Promise }, i);
87
- const u = typeof n;
88
- if (!(n !== null && (u === "object" || u === "function")))
89
- throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${n === null ? "null" : u}\``);
90
- const f = (c) => {
91
- const r = (s) => typeof s == "string" ? c === s : s.test(c);
92
- return i.include ? i.include.some(r) : !i.exclude.some(r);
93
- };
94
- let l;
95
- u === "function" ? l = function(...c) {
96
- return i.excludeMain ? n(...c) : m(n, i).apply(this, c);
97
- } : l = Object.create(Object.getPrototypeOf(n));
98
- for (const c in n) {
99
- const r = n[c];
100
- l[c] = typeof r == "function" && f(c) ? m(r, i) : r;
101
- }
102
- return l;
103
- };
104
- }, 147: (t) => {
105
- t.exports = S;
106
- }, 781: (t) => {
107
- t.exports = S;
108
- }, 796: (t) => {
109
- t.exports = S;
110
- } }, v = {};
111
- function g(t) {
112
- var m = v[t];
113
- if (m !== void 0)
114
- return m.exports;
115
- var n = v[t] = { exports: {} }, i = !0;
116
- try {
117
- O[t](n, n.exports, g), i = !1;
118
- } finally {
119
- i && delete v[t];
120
- }
121
- return n.exports;
122
- }
123
- typeof g < "u" && (g.ab = __dirname + "/");
124
- var j = g(349);
125
- b.exports = j;
126
- })(), b.exports);
127
- }
2
+ import n from "./index97.mjs";
3
+ const a = n.toObjectSet([
4
+ "age",
5
+ "authorization",
6
+ "content-length",
7
+ "content-type",
8
+ "etag",
9
+ "expires",
10
+ "from",
11
+ "host",
12
+ "if-modified-since",
13
+ "if-unmodified-since",
14
+ "last-modified",
15
+ "location",
16
+ "max-forwards",
17
+ "proxy-authorization",
18
+ "referer",
19
+ "retry-after",
20
+ "user-agent"
21
+ ]), u = (s) => {
22
+ const t = {};
23
+ let e, r, i;
24
+ return s && s.split(`
25
+ `).forEach(function(o) {
26
+ i = o.indexOf(":"), e = o.substring(0, i).trim().toLowerCase(), r = o.substring(i + 1).trim(), !(!e || t[e] && a[e]) && (e === "set-cookie" ? t[e] ? t[e].push(r) : t[e] = [r] : t[e] = t[e] ? t[e] + ", " + r : r);
27
+ }), t;
28
+ };
128
29
  export {
129
- $ as __require
30
+ u as default
130
31
  };
package/dist/index221.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- var e = { exports: {} };
2
+ const t = null;
3
3
  export {
4
- e as __module
4
+ t as default
5
5
  };
package/dist/index222.mjs CHANGED
@@ -1,77 +1,73 @@
1
1
  'use client';
2
- import { __exports as e } from "./index265.mjs";
3
- /**
4
- * @license React
5
- * react-is.production.js
6
- *
7
- * Copyright (c) Meta Platforms, Inc. and affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
- var R;
13
- function d() {
14
- if (R) return e;
15
- R = 1;
16
- var l = Symbol.for("react.transitional.element"), T = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), s = Symbol.for("react.consumer"), i = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), a = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), c = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), C = Symbol.for("react.client.reference");
17
- function t(r) {
18
- if (typeof r == "object" && r !== null) {
19
- var m = r.$$typeof;
20
- switch (m) {
21
- case l:
22
- switch (r = r.type, r) {
23
- case n:
24
- case f:
25
- case o:
26
- case a:
27
- case E:
28
- return r;
29
- default:
30
- switch (r = r && r.$$typeof, r) {
31
- case i:
32
- case u:
33
- case _:
34
- case c:
35
- return r;
36
- case s:
37
- return r;
38
- default:
39
- return m;
40
- }
41
- }
42
- case T:
43
- return m;
44
- }
2
+ import H from "./index97.mjs";
3
+ import D from "./index261.mjs";
4
+ import L from "./index217.mjs";
5
+ import n from "./index108.mjs";
6
+ import y from "./index103.mjs";
7
+ import O from "./index262.mjs";
8
+ import U from "./index219.mjs";
9
+ import q from "./index111.mjs";
10
+ import { progressEventReducer as A } from "./index263.mjs";
11
+ import v from "./index264.mjs";
12
+ const N = typeof XMLHttpRequest < "u", Q = N && function(s) {
13
+ return new Promise(function(C, i) {
14
+ const t = v(s);
15
+ let E = t.data;
16
+ const T = q.from(t.headers).normalize();
17
+ let { responseType: d, onUploadProgress: R, onDownloadProgress: h } = t, l, g, w, u, f;
18
+ function x() {
19
+ u && u(), f && f(), t.cancelToken && t.cancelToken.unsubscribe(l), t.signal && t.signal.removeEventListener("abort", l);
45
20
  }
46
- }
47
- return e.ContextConsumer = s, e.ContextProvider = i, e.Element = l, e.ForwardRef = u, e.Fragment = n, e.Lazy = _, e.Memo = c, e.Portal = T, e.Profiler = f, e.StrictMode = o, e.Suspense = a, e.SuspenseList = E, e.isContextConsumer = function(r) {
48
- return t(r) === s;
49
- }, e.isContextProvider = function(r) {
50
- return t(r) === i;
51
- }, e.isElement = function(r) {
52
- return typeof r == "object" && r !== null && r.$$typeof === l;
53
- }, e.isForwardRef = function(r) {
54
- return t(r) === u;
55
- }, e.isFragment = function(r) {
56
- return t(r) === n;
57
- }, e.isLazy = function(r) {
58
- return t(r) === _;
59
- }, e.isMemo = function(r) {
60
- return t(r) === c;
61
- }, e.isPortal = function(r) {
62
- return t(r) === T;
63
- }, e.isProfiler = function(r) {
64
- return t(r) === f;
65
- }, e.isStrictMode = function(r) {
66
- return t(r) === o;
67
- }, e.isSuspense = function(r) {
68
- return t(r) === a;
69
- }, e.isSuspenseList = function(r) {
70
- return t(r) === E;
71
- }, e.isValidElementType = function(r) {
72
- return typeof r == "string" || typeof r == "function" || r === n || r === f || r === o || r === a || r === E || r === S || typeof r == "object" && r !== null && (r.$$typeof === _ || r.$$typeof === c || r.$$typeof === i || r.$$typeof === s || r.$$typeof === u || r.$$typeof === C || r.getModuleId !== void 0);
73
- }, e.typeOf = t, e;
74
- }
21
+ let e = new XMLHttpRequest();
22
+ e.open(t.method.toUpperCase(), t.url, !0), e.timeout = t.timeout;
23
+ function b() {
24
+ if (!e)
25
+ return;
26
+ const o = q.from(
27
+ "getAllResponseHeaders" in e && e.getAllResponseHeaders()
28
+ ), a = {
29
+ data: !d || d === "text" || d === "json" ? e.responseText : e.response,
30
+ status: e.status,
31
+ statusText: e.statusText,
32
+ headers: o,
33
+ config: s,
34
+ request: e
35
+ };
36
+ D(function(c) {
37
+ C(c), x();
38
+ }, function(c) {
39
+ i(c), x();
40
+ }, a), e = null;
41
+ }
42
+ "onloadend" in e ? e.onloadend = b : e.onreadystatechange = function() {
43
+ !e || e.readyState !== 4 || e.status === 0 && !(e.responseURL && e.responseURL.indexOf("file:") === 0) || setTimeout(b);
44
+ }, e.onabort = function() {
45
+ e && (i(new n("Request aborted", n.ECONNABORTED, s, e)), e = null);
46
+ }, e.onerror = function(r) {
47
+ const a = r && r.message ? r.message : "Network Error", p = new n(a, n.ERR_NETWORK, s, e);
48
+ p.event = r || null, i(p), e = null;
49
+ }, e.ontimeout = function() {
50
+ let r = t.timeout ? "timeout of " + t.timeout + "ms exceeded" : "timeout exceeded";
51
+ const a = t.transitional || L;
52
+ t.timeoutErrorMessage && (r = t.timeoutErrorMessage), i(new n(
53
+ r,
54
+ a.clarifyTimeoutError ? n.ETIMEDOUT : n.ECONNABORTED,
55
+ s,
56
+ e
57
+ )), e = null;
58
+ }, E === void 0 && T.setContentType(null), "setRequestHeader" in e && H.forEach(T.toJSON(), function(r, a) {
59
+ e.setRequestHeader(a, r);
60
+ }), H.isUndefined(t.withCredentials) || (e.withCredentials = !!t.withCredentials), d && d !== "json" && (e.responseType = t.responseType), h && ([w, f] = A(h, !0), e.addEventListener("progress", w)), R && e.upload && ([g, u] = A(R), e.upload.addEventListener("progress", g), e.upload.addEventListener("loadend", u)), (t.cancelToken || t.signal) && (l = (o) => {
61
+ e && (i(!o || o.type ? new y(null, s, e) : o), e.abort(), e = null);
62
+ }, t.cancelToken && t.cancelToken.subscribe(l), t.signal && (t.signal.aborted ? l() : t.signal.addEventListener("abort", l)));
63
+ const m = O(t.url);
64
+ if (m && U.protocols.indexOf(m) === -1) {
65
+ i(new n("Unsupported protocol " + m + ":", n.ERR_BAD_REQUEST, s));
66
+ return;
67
+ }
68
+ e.send(E || null);
69
+ });
70
+ };
75
71
  export {
76
- d as __require
72
+ Q as default
77
73
  };