@instockng/storefront-ui 1.0.118 → 1.0.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AssistantDrawer.d.ts.map +1 -1
- package/dist/index117.mjs +2 -2
- package/dist/index118.mjs +2 -2
- package/dist/index153.mjs +1 -1
- package/dist/index155.mjs +1 -1
- package/dist/index156.mjs +2 -2
- package/dist/index160.mjs +2 -2
- package/dist/index169.mjs +1 -1
- package/dist/index170.mjs +1 -1
- package/dist/index172.mjs +1 -1
- package/dist/index173.mjs +1 -1
- package/dist/index175.mjs +3 -3
- package/dist/index176.mjs +1 -1
- package/dist/index178.mjs +2 -2
- package/dist/index179.mjs +1 -1
- package/dist/index184.mjs +2 -2
- package/dist/index186.mjs +1 -1
- package/dist/index188.mjs +2 -2
- package/dist/index189.mjs +5 -5
- package/dist/index192.mjs +1 -1
- package/dist/index195.mjs +1 -1
- package/dist/index198.mjs +1 -1
- package/dist/index199.mjs +1 -1
- package/dist/index203.mjs +1 -1
- package/dist/index205.mjs +1 -1
- package/dist/index22.mjs +122 -133
- package/dist/index224.mjs +12 -30
- package/dist/index225.mjs +7 -11
- package/dist/index226.mjs +30 -3
- package/dist/index227.mjs +10 -3
- package/dist/index228.mjs +4 -13
- package/dist/index229.mjs +4 -7
- package/dist/index232.mjs +2 -2
- package/dist/index233.mjs +2 -2
- package/dist/index236.mjs +2 -2
- package/dist/index237.mjs +2 -2
- package/dist/index239.mjs +2 -2
- package/dist/index240.mjs +2 -2
- package/dist/index242.mjs +2 -2
- package/dist/index243.mjs +2 -2
- package/dist/index244.mjs +37 -2
- package/dist/index245.mjs +2 -108
- package/dist/index246.mjs +244 -2
- package/dist/index248.mjs +28 -32
- package/dist/index249.mjs +65 -2
- package/dist/index250.mjs +24 -243
- package/dist/index251.mjs +2 -2
- package/dist/index252.mjs +2 -33
- package/dist/index253.mjs +99 -56
- package/dist/index254.mjs +2 -25
- package/dist/index255.mjs +2 -2
- package/dist/index256.mjs +2 -2
- package/dist/index257.mjs +2 -2
- package/dist/index259.mjs +2 -2
- package/dist/index264.mjs +2 -2
- package/dist/index267.mjs +2 -2
- package/dist/index268.mjs +2 -2
- package/dist/index269.mjs +2 -18
- package/dist/index270.mjs +2 -47
- package/dist/index271.mjs +91 -2
- package/dist/index272.mjs +2 -2
- package/dist/index273.mjs +18 -2
- package/dist/index274.mjs +47 -2
- package/dist/index275.mjs +2 -91
- package/dist/index276.mjs +1 -2
- package/dist/index277.mjs +3 -2
- package/dist/index278.mjs +2 -2
- package/dist/index279.mjs +2 -17
- package/dist/index280.mjs +15 -11
- package/dist/index281.mjs +13 -6
- package/dist/index282.mjs +6 -30
- package/dist/index283.mjs +30 -2
- package/dist/index43.mjs +1 -1
- package/dist/index44.mjs +1 -1
- package/dist/index45.mjs +1 -1
- package/dist/index46.mjs +1 -1
- package/dist/index47.mjs +1 -1
- package/dist/index48.mjs +2 -2
- package/dist/index50.mjs +1 -1
- package/dist/index58.mjs +1 -1
- package/dist/index64.mjs +2 -2
- package/dist/index65.mjs +1 -1
- package/dist/index66.mjs +1 -1
- package/dist/index67.mjs +1 -1
- package/dist/index68.mjs +1 -1
- package/dist/index69.mjs +1 -1
- package/dist/index70.mjs +1 -1
- package/dist/index71.mjs +1 -1
- package/dist/index72.mjs +1 -1
- package/dist/index73.mjs +1 -1
- package/dist/index74.mjs +1 -1
- package/dist/index75.mjs +1 -1
- package/dist/index76.mjs +1 -1
- package/dist/index77.mjs +1 -1
- package/dist/index78.mjs +1 -1
- package/dist/index79.mjs +4 -23
- package/dist/index80.mjs +23 -2
- package/dist/index81.mjs +21 -20
- package/dist/index82.mjs +7 -7
- package/dist/index83.mjs +2 -5
- package/dist/index86.mjs +1 -1
- package/dist/index87.mjs +37 -2
- package/dist/index88.mjs +42 -5
- package/dist/index89.mjs +2 -1134
- package/dist/index90.mjs +5 -19
- package/dist/index91.mjs +1119 -40
- package/dist/index92.mjs +14 -27
- package/dist/index93.mjs +55 -2
- package/dist/index94.mjs +33 -37
- package/dist/index95.mjs +2 -43
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/AssistantDrawer.tsx +0 -21
package/dist/index22.mjs
CHANGED
|
@@ -1,179 +1,169 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { Sparkles as
|
|
6
|
-
import { cn as k, formatCurrency as
|
|
7
|
-
import { useHideBodyOverflow as
|
|
8
|
-
function
|
|
3
|
+
import { useState as g, useRef as x, useCallback as O, useEffect as S } from "react";
|
|
4
|
+
import { createPortal as Z } from "react-dom";
|
|
5
|
+
import { Sparkles as Q, X as ee, MessageCircle as te, Loader2 as re, Send as se } from "lucide-react";
|
|
6
|
+
import { cn as k, formatCurrency as ne, WHATSAPP_HELP_LINK as ae } from "./index30.mjs";
|
|
7
|
+
import { useHideBodyOverflow as oe } from "./index53.mjs";
|
|
8
|
+
function le(a) {
|
|
9
9
|
return a.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>").replace(/\*(.+?)\*/g, "<em>$1</em>").replace(/\n/g, "<br />");
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function ie(a) {
|
|
12
12
|
return a.replace(/\s*PRO\w*UCTS?:[\w\-,]*\s*/gi, "").replace(/\s*CONTACT_SUPPORT\s*/gi, "").replace(/\s*SUGGESTIONS:[^\n]*\s*/g, "");
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function he({
|
|
15
15
|
isOpen: a,
|
|
16
|
-
onClose:
|
|
17
|
-
apiUrl:
|
|
18
|
-
brandSlug:
|
|
19
|
-
productSlug:
|
|
20
|
-
initialQuestion:
|
|
21
|
-
assistantName:
|
|
22
|
-
className:
|
|
23
|
-
disablePortal:
|
|
16
|
+
onClose: y,
|
|
17
|
+
apiUrl: R,
|
|
18
|
+
brandSlug: j,
|
|
19
|
+
productSlug: I,
|
|
20
|
+
initialQuestion: w,
|
|
21
|
+
assistantName: L = "AI Assistant",
|
|
22
|
+
className: z,
|
|
23
|
+
disablePortal: B = !1
|
|
24
24
|
}) {
|
|
25
|
-
const [
|
|
26
|
-
|
|
27
|
-
const
|
|
25
|
+
const [d, u] = g([]), [N, A] = g(""), [m, _] = g(!1), [$, h] = g(null), [M, W] = g(!1), [K, H] = g(!1), U = x(null), D = x(null), E = x(!1), J = x([]);
|
|
26
|
+
J.current = d, oe(a);
|
|
27
|
+
const q = O((e, l) => {
|
|
28
28
|
if (e === "token")
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
if ((
|
|
32
|
-
const
|
|
33
|
-
|
|
29
|
+
u((s) => {
|
|
30
|
+
const o = [...s], r = o[o.length - 1];
|
|
31
|
+
if ((r == null ? void 0 : r.role) === "assistant") {
|
|
32
|
+
const n = r.content + l, i = ie(n);
|
|
33
|
+
o[o.length - 1] = { ...r, content: i };
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return o;
|
|
36
36
|
});
|
|
37
37
|
else if (e === "done")
|
|
38
38
|
try {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
var i,
|
|
42
|
-
const
|
|
43
|
-
return (
|
|
44
|
-
...
|
|
45
|
-
content:
|
|
46
|
-
products: ((i =
|
|
47
|
-
whatsapp:
|
|
48
|
-
suggestions: ((
|
|
49
|
-
}),
|
|
39
|
+
const s = JSON.parse(l);
|
|
40
|
+
u((o) => {
|
|
41
|
+
var i, f;
|
|
42
|
+
const r = [...o], n = r[r.length - 1];
|
|
43
|
+
return (n == null ? void 0 : n.role) === "assistant" && (r[r.length - 1] = {
|
|
44
|
+
...n,
|
|
45
|
+
content: s.answer || n.content,
|
|
46
|
+
products: ((i = s.products) == null ? void 0 : i.length) > 0 ? s.products : void 0,
|
|
47
|
+
whatsapp: s.whatsapp || !1,
|
|
48
|
+
suggestions: ((f = s.suggestions) == null ? void 0 : f.length) > 0 ? s.suggestions : void 0
|
|
49
|
+
}), r;
|
|
50
50
|
});
|
|
51
51
|
} catch {
|
|
52
52
|
}
|
|
53
53
|
else if (e === "error")
|
|
54
54
|
try {
|
|
55
|
-
const
|
|
56
|
-
h(
|
|
55
|
+
const s = JSON.parse(l);
|
|
56
|
+
h(s.message || "An error occurred");
|
|
57
57
|
} catch {
|
|
58
58
|
h("An error occurred");
|
|
59
59
|
}
|
|
60
|
-
}, []),
|
|
60
|
+
}, []), v = x(null), T = O(
|
|
61
61
|
async (e) => {
|
|
62
|
-
var
|
|
62
|
+
var o;
|
|
63
63
|
if (!e.trim()) return;
|
|
64
64
|
h(null);
|
|
65
|
-
const
|
|
66
|
-
role:
|
|
67
|
-
content:
|
|
65
|
+
const l = { role: "user", content: e }, s = J.current.slice(-20).map((r) => ({
|
|
66
|
+
role: r.role,
|
|
67
|
+
content: r.content
|
|
68
68
|
}));
|
|
69
|
-
|
|
69
|
+
u((r) => [...r, l]), A(""), _(!0), u((r) => [...r, { role: "assistant", content: "" }]);
|
|
70
70
|
try {
|
|
71
|
-
const
|
|
71
|
+
const r = await fetch(`${R}/v1/assistant/ask`, {
|
|
72
72
|
method: "POST",
|
|
73
73
|
headers: { "Content-Type": "application/json" },
|
|
74
74
|
body: JSON.stringify({
|
|
75
75
|
question: e,
|
|
76
|
-
brandSlug:
|
|
77
|
-
productSlug:
|
|
78
|
-
history:
|
|
76
|
+
brandSlug: j,
|
|
77
|
+
productSlug: I,
|
|
78
|
+
history: s
|
|
79
79
|
})
|
|
80
80
|
});
|
|
81
|
-
if (!
|
|
82
|
-
const p = await
|
|
81
|
+
if (!r.ok) {
|
|
82
|
+
const p = await r.json().catch(() => ({}));
|
|
83
83
|
throw new Error(
|
|
84
|
-
((
|
|
84
|
+
((o = p == null ? void 0 : p.error) == null ? void 0 : o.message) || `Request failed (${r.status})`
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
|
-
if (!
|
|
88
|
-
const
|
|
89
|
-
let
|
|
87
|
+
if (!r.body) throw new Error("No response body");
|
|
88
|
+
const n = r.body.getReader(), i = new TextDecoder();
|
|
89
|
+
let f = "", C = "";
|
|
90
90
|
for (; ; ) {
|
|
91
|
-
const { done: p, value:
|
|
91
|
+
const { done: p, value: X } = await n.read();
|
|
92
92
|
if (p) break;
|
|
93
|
-
|
|
94
|
-
const
|
|
93
|
+
f += i.decode(X, { stream: !0 });
|
|
94
|
+
const G = f.split(`
|
|
95
95
|
`);
|
|
96
|
-
|
|
97
|
-
for (const b of
|
|
96
|
+
f = G.pop() || "";
|
|
97
|
+
for (const b of G)
|
|
98
98
|
if (b.trim() !== "") {
|
|
99
99
|
if (b.trimStart().startsWith("event:"))
|
|
100
100
|
C = b.trimStart().slice(6).trim();
|
|
101
101
|
else if (b.trimStart().startsWith("data:") && C) {
|
|
102
|
-
const
|
|
103
|
-
|
|
102
|
+
const P = b.trimStart().slice(5), Y = P.startsWith(" ") ? P.slice(1) : P;
|
|
103
|
+
q(C, Y);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
} catch (
|
|
108
|
-
h(
|
|
109
|
-
const i =
|
|
110
|
-
return (i == null ? void 0 : i.role) === "assistant" && !i.content ?
|
|
107
|
+
} catch (r) {
|
|
108
|
+
h(r.message || "Something went wrong"), u((n) => {
|
|
109
|
+
const i = n[n.length - 1];
|
|
110
|
+
return (i == null ? void 0 : i.role) === "assistant" && !i.content ? n.slice(0, -1) : n;
|
|
111
111
|
});
|
|
112
112
|
} finally {
|
|
113
|
-
|
|
113
|
+
_(!1);
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
|
-
[
|
|
116
|
+
[R, j, I, q]
|
|
117
117
|
);
|
|
118
|
-
|
|
118
|
+
v.current = T, S(() => {
|
|
119
119
|
if (a)
|
|
120
|
-
|
|
120
|
+
H(!0), requestAnimationFrame(() => {
|
|
121
121
|
requestAnimationFrame(() => {
|
|
122
|
-
|
|
122
|
+
W(!0);
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
else {
|
|
126
|
-
|
|
126
|
+
W(!1);
|
|
127
127
|
const e = setTimeout(() => {
|
|
128
|
-
|
|
128
|
+
H(!1), u([]), A(""), h(null), E.current = !1;
|
|
129
129
|
}, 300);
|
|
130
130
|
return () => clearTimeout(e);
|
|
131
131
|
}
|
|
132
|
-
}, [a]),
|
|
133
|
-
a &&
|
|
132
|
+
}, [a]), S(() => {
|
|
133
|
+
a && w && !E.current && (E.current = !0, w.trim() ? setTimeout(() => {
|
|
134
134
|
var e;
|
|
135
|
-
return (e =
|
|
135
|
+
return (e = v.current) == null ? void 0 : e.call(v, w);
|
|
136
136
|
}, 100) : setTimeout(() => {
|
|
137
137
|
var e;
|
|
138
|
-
return (e =
|
|
138
|
+
return (e = D.current) == null ? void 0 : e.focus();
|
|
139
139
|
}, 350));
|
|
140
|
-
}, [a,
|
|
140
|
+
}, [a, w]), S(() => {
|
|
141
141
|
var e;
|
|
142
|
-
(e =
|
|
143
|
-
}, [
|
|
144
|
-
const e = (
|
|
145
|
-
|
|
142
|
+
(e = U.current) == null || e.scrollIntoView({ behavior: "smooth" });
|
|
143
|
+
}, [d]), S(() => {
|
|
144
|
+
const e = (l) => {
|
|
145
|
+
l.key === "Escape" && a && y();
|
|
146
146
|
};
|
|
147
147
|
if (a)
|
|
148
148
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
149
|
-
}, [a,
|
|
150
|
-
|
|
151
|
-
if (!e || !a) return;
|
|
152
|
-
const n = () => {
|
|
153
|
-
const r = window.innerHeight - e.height;
|
|
154
|
-
z(r > 50 ? r : 0);
|
|
155
|
-
};
|
|
156
|
-
return e.addEventListener("resize", n), e.addEventListener("scroll", n), () => {
|
|
157
|
-
e.removeEventListener("resize", n), e.removeEventListener("scroll", n), z(0);
|
|
158
|
-
};
|
|
159
|
-
}, [a]);
|
|
160
|
-
const Y = (e) => {
|
|
149
|
+
}, [a, y]);
|
|
150
|
+
const V = (e) => {
|
|
161
151
|
e.preventDefault(), N.trim() && T(N.trim());
|
|
162
152
|
};
|
|
163
|
-
if (!
|
|
164
|
-
const
|
|
153
|
+
if (!K) return null;
|
|
154
|
+
const F = /* @__PURE__ */ c(
|
|
165
155
|
"div",
|
|
166
156
|
{
|
|
167
157
|
className: k(
|
|
168
158
|
"fixed inset-0 z-50 transition-opacity duration-300",
|
|
169
|
-
|
|
159
|
+
M ? "opacity-100" : "opacity-0"
|
|
170
160
|
),
|
|
171
161
|
children: [
|
|
172
162
|
/* @__PURE__ */ t(
|
|
173
163
|
"div",
|
|
174
164
|
{
|
|
175
165
|
className: "absolute inset-0 bg-black/40 backdrop-blur-sm",
|
|
176
|
-
onClick:
|
|
166
|
+
onClick: y
|
|
177
167
|
}
|
|
178
168
|
),
|
|
179
169
|
/* @__PURE__ */ c(
|
|
@@ -186,94 +176,93 @@ function be({
|
|
|
186
176
|
// Desktop: left side drawer
|
|
187
177
|
"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",
|
|
188
178
|
// Animation
|
|
189
|
-
|
|
190
|
-
|
|
179
|
+
M ? "translate-y-0 sm:translate-x-0" : "translate-y-full sm:translate-y-0 sm:-translate-x-full",
|
|
180
|
+
z
|
|
191
181
|
),
|
|
192
|
-
style: U > 0 ? { bottom: `${U}px` } : void 0,
|
|
193
182
|
children: [
|
|
194
183
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between border-b border-gray-200 px-4 py-3 flex-shrink-0", children: [
|
|
195
184
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
196
|
-
/* @__PURE__ */ t(
|
|
197
|
-
/* @__PURE__ */ t("span", { className: "font-semibold text-gray-900", children:
|
|
185
|
+
/* @__PURE__ */ t(Q, { className: "h-5 w-5 text-orange-500" }),
|
|
186
|
+
/* @__PURE__ */ t("span", { className: "font-semibold text-gray-900", children: L }),
|
|
198
187
|
/* @__PURE__ */ t("span", { className: "text-xs text-gray-400 bg-gray-100 rounded px-1.5 py-0.5", children: "beta" })
|
|
199
188
|
] }),
|
|
200
189
|
/* @__PURE__ */ t(
|
|
201
190
|
"button",
|
|
202
191
|
{
|
|
203
192
|
type: "button",
|
|
204
|
-
onClick:
|
|
193
|
+
onClick: y,
|
|
205
194
|
className: "p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",
|
|
206
195
|
"aria-label": "Close",
|
|
207
|
-
children: /* @__PURE__ */ t(
|
|
196
|
+
children: /* @__PURE__ */ t(ee, { className: "h-5 w-5" })
|
|
208
197
|
}
|
|
209
198
|
)
|
|
210
199
|
] }),
|
|
211
200
|
/* @__PURE__ */ c("div", { className: "flex-1 overflow-y-auto p-4 space-y-4 min-h-0", children: [
|
|
212
|
-
|
|
213
|
-
|
|
201
|
+
d.length === 0 && !m && /* @__PURE__ */ t("div", { className: "text-center text-gray-400 text-sm py-8", children: "Ask me anything about our products!" }),
|
|
202
|
+
d.map((e, l) => /* @__PURE__ */ t("div", { children: e.role === "user" ? /* @__PURE__ */ t("div", { className: "flex justify-end", children: /* @__PURE__ */ t("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__ */ c("div", { className: "space-y-3", children: [
|
|
214
203
|
/* @__PURE__ */ c("div", { className: "text-sm text-gray-800 leading-relaxed", children: [
|
|
215
|
-
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html:
|
|
216
|
-
|
|
204
|
+
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: le(e.content) } }),
|
|
205
|
+
m && l === d.length - 1 && /* @__PURE__ */ t("span", { className: "inline-block w-1.5 h-4 bg-gray-400 animate-pulse ml-0.5 align-text-bottom" })
|
|
217
206
|
] }),
|
|
218
|
-
e.products && e.products.length > 0 && /* @__PURE__ */ t("div", { className: "space-y-2", children: e.products.map((
|
|
207
|
+
e.products && e.products.length > 0 && /* @__PURE__ */ t("div", { className: "space-y-2", children: e.products.map((s) => /* @__PURE__ */ c(
|
|
219
208
|
"a",
|
|
220
209
|
{
|
|
221
|
-
href: `/product/${
|
|
210
|
+
href: `/product/${s.slug}`,
|
|
222
211
|
className: "flex items-center gap-3 w-full rounded-xl border border-gray-200 p-2 hover:bg-gray-50 transition-colors text-left no-underline",
|
|
223
212
|
children: [
|
|
224
|
-
|
|
213
|
+
s.thumbnailUrl ? /* @__PURE__ */ t(
|
|
225
214
|
"img",
|
|
226
215
|
{
|
|
227
|
-
src:
|
|
228
|
-
alt:
|
|
216
|
+
src: s.thumbnailUrl,
|
|
217
|
+
alt: s.name,
|
|
229
218
|
className: "h-16 w-16 rounded-lg object-cover flex-shrink-0"
|
|
230
219
|
}
|
|
231
220
|
) : /* @__PURE__ */ t("div", { className: "h-16 w-16 rounded-lg bg-gray-100 flex-shrink-0" }),
|
|
232
221
|
/* @__PURE__ */ c("div", { className: "min-w-0", children: [
|
|
233
|
-
/* @__PURE__ */ t("p", { className: "text-sm font-medium text-gray-900 line-clamp-2", children:
|
|
234
|
-
/* @__PURE__ */ t("p", { className: "text-sm font-semibold text-blue-600", children:
|
|
222
|
+
/* @__PURE__ */ t("p", { className: "text-sm font-medium text-gray-900 line-clamp-2", children: s.name }),
|
|
223
|
+
/* @__PURE__ */ t("p", { className: "text-sm font-semibold text-blue-600", children: ne(s.price) })
|
|
235
224
|
] })
|
|
236
225
|
]
|
|
237
226
|
},
|
|
238
|
-
|
|
227
|
+
s.slug
|
|
239
228
|
)) }),
|
|
240
229
|
e.whatsapp && /* @__PURE__ */ c(
|
|
241
230
|
"a",
|
|
242
231
|
{
|
|
243
|
-
href:
|
|
232
|
+
href: ae,
|
|
244
233
|
target: "_blank",
|
|
245
234
|
rel: "noopener noreferrer",
|
|
246
235
|
className: "inline-flex items-center gap-2 rounded-full bg-green-500 px-4 py-2 text-sm font-medium text-white hover:bg-green-600 transition-colors no-underline",
|
|
247
236
|
children: [
|
|
248
|
-
/* @__PURE__ */ t(
|
|
237
|
+
/* @__PURE__ */ t(te, { className: "h-4 w-4" }),
|
|
249
238
|
"Chat on WhatsApp"
|
|
250
239
|
]
|
|
251
240
|
}
|
|
252
241
|
),
|
|
253
|
-
e.suggestions && e.suggestions.length > 0 && !
|
|
242
|
+
e.suggestions && e.suggestions.length > 0 && !m && l === d.length - 1 && /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: e.suggestions.map((s, o) => /* @__PURE__ */ t(
|
|
254
243
|
"button",
|
|
255
244
|
{
|
|
256
245
|
type: "button",
|
|
257
|
-
onClick: () => T(
|
|
246
|
+
onClick: () => T(s),
|
|
258
247
|
className: "rounded-full border border-gray-200 bg-gray-50 px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 hover:border-gray-300 transition-colors text-left",
|
|
259
|
-
children:
|
|
248
|
+
children: s
|
|
260
249
|
},
|
|
261
|
-
|
|
250
|
+
o
|
|
262
251
|
)) })
|
|
263
|
-
] }) },
|
|
252
|
+
] }) }, l)),
|
|
264
253
|
$ && /* @__PURE__ */ t("div", { className: "rounded-lg bg-red-50 border border-red-200 p-3 text-sm text-red-700", children: $ }),
|
|
265
|
-
/* @__PURE__ */ t("div", { ref:
|
|
254
|
+
/* @__PURE__ */ t("div", { ref: U })
|
|
266
255
|
] }),
|
|
267
|
-
/* @__PURE__ */ t("div", { className: "border-t border-gray-200 p-3 flex-shrink-0", children: /* @__PURE__ */ c("form", { onSubmit:
|
|
256
|
+
/* @__PURE__ */ t("div", { className: "border-t border-gray-200 p-3 flex-shrink-0", children: /* @__PURE__ */ c("form", { onSubmit: V, className: "flex items-center gap-2", children: [
|
|
268
257
|
/* @__PURE__ */ t(
|
|
269
258
|
"input",
|
|
270
259
|
{
|
|
271
|
-
ref:
|
|
260
|
+
ref: D,
|
|
272
261
|
type: "text",
|
|
273
262
|
value: N,
|
|
274
|
-
onChange: (e) =>
|
|
275
|
-
placeholder: `Ask ${
|
|
276
|
-
disabled:
|
|
263
|
+
onChange: (e) => A(e.target.value),
|
|
264
|
+
placeholder: `Ask ${L} a question`,
|
|
265
|
+
disabled: m,
|
|
277
266
|
className: k(
|
|
278
267
|
"flex-1 rounded-full border border-gray-300 px-4 py-2.5 text-base",
|
|
279
268
|
"focus:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-400/30",
|
|
@@ -285,14 +274,14 @@ function be({
|
|
|
285
274
|
"button",
|
|
286
275
|
{
|
|
287
276
|
type: "submit",
|
|
288
|
-
disabled: !N.trim() ||
|
|
277
|
+
disabled: !N.trim() || m,
|
|
289
278
|
className: k(
|
|
290
279
|
"flex h-10 w-10 items-center justify-center rounded-full",
|
|
291
280
|
"bg-gray-800 text-white",
|
|
292
281
|
"hover:bg-gray-700 transition-colors",
|
|
293
282
|
"disabled:opacity-40 disabled:cursor-not-allowed"
|
|
294
283
|
),
|
|
295
|
-
children:
|
|
284
|
+
children: m ? /* @__PURE__ */ t(re, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ t(se, { className: "h-4 w-4" })
|
|
296
285
|
}
|
|
297
286
|
)
|
|
298
287
|
] }) })
|
|
@@ -302,8 +291,8 @@ function be({
|
|
|
302
291
|
]
|
|
303
292
|
}
|
|
304
293
|
);
|
|
305
|
-
return
|
|
294
|
+
return B ? F : Z(F, document.body);
|
|
306
295
|
}
|
|
307
296
|
export {
|
|
308
|
-
|
|
297
|
+
he as AssistantDrawer
|
|
309
298
|
};
|
package/dist/index224.mjs
CHANGED
|
@@ -1,34 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g, function(r) {
|
|
14
|
-
return t[r];
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
function a(n, t) {
|
|
18
|
-
this._pairs = [], n && p(n, this, t);
|
|
19
|
-
}
|
|
20
|
-
const c = a.prototype;
|
|
21
|
-
c.append = function(t, o) {
|
|
22
|
-
this._pairs.push([t, o]);
|
|
23
|
-
};
|
|
24
|
-
c.toString = function(t) {
|
|
25
|
-
const o = t ? function(r) {
|
|
26
|
-
return t.call(this, r, i);
|
|
27
|
-
} : i;
|
|
28
|
-
return this._pairs.map(function(e) {
|
|
29
|
-
return o(e[0]) + "=" + o(e[1]);
|
|
30
|
-
}, "").join("&");
|
|
2
|
+
import o from "./index277.mjs";
|
|
3
|
+
import r from "./index278.mjs";
|
|
4
|
+
import t from "./index279.mjs";
|
|
5
|
+
const l = {
|
|
6
|
+
isBrowser: !0,
|
|
7
|
+
classes: {
|
|
8
|
+
URLSearchParams: o,
|
|
9
|
+
FormData: r,
|
|
10
|
+
Blob: t
|
|
11
|
+
},
|
|
12
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
31
13
|
};
|
|
32
14
|
export {
|
|
33
|
-
|
|
15
|
+
l as default
|
|
34
16
|
};
|
package/dist/index225.mjs
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import s from "./index110.mjs";
|
|
5
|
-
function h(f, t) {
|
|
6
|
-
const o = this || m, r = t || o, n = s.from(r.headers);
|
|
7
|
-
let a = r.data;
|
|
8
|
-
return i.forEach(f, function(e) {
|
|
9
|
-
a = e.call(o, a, n.normalize(), t ? t.status : void 0);
|
|
10
|
-
}), n.normalize(), a;
|
|
11
|
-
}
|
|
2
|
+
const e = typeof window < "u" && typeof document < "u", o = typeof navigator == "object" && navigator || void 0, n = e && (!o || ["ReactNative", "NativeScript", "NS"].indexOf(o.product) < 0), t = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
3
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", r = e && window.location.href || "http://localhost";
|
|
12
4
|
export {
|
|
13
|
-
|
|
5
|
+
e as hasBrowserEnv,
|
|
6
|
+
n as hasStandardBrowserEnv,
|
|
7
|
+
t as hasStandardBrowserWebWorkerEnv,
|
|
8
|
+
o as navigator,
|
|
9
|
+
r as origin
|
|
14
10
|
};
|
package/dist/index226.mjs
CHANGED
|
@@ -1,7 +1,34 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import p from "./index106.mjs";
|
|
3
|
+
function i(n) {
|
|
4
|
+
const t = {
|
|
5
|
+
"!": "%21",
|
|
6
|
+
"'": "%27",
|
|
7
|
+
"(": "%28",
|
|
8
|
+
")": "%29",
|
|
9
|
+
"~": "%7E",
|
|
10
|
+
"%20": "+",
|
|
11
|
+
"%00": "\0"
|
|
12
|
+
};
|
|
13
|
+
return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g, function(r) {
|
|
14
|
+
return t[r];
|
|
15
|
+
});
|
|
4
16
|
}
|
|
17
|
+
function a(n, t) {
|
|
18
|
+
this._pairs = [], n && p(n, this, t);
|
|
19
|
+
}
|
|
20
|
+
const c = a.prototype;
|
|
21
|
+
c.append = function(t, o) {
|
|
22
|
+
this._pairs.push([t, o]);
|
|
23
|
+
};
|
|
24
|
+
c.toString = function(t) {
|
|
25
|
+
const o = t ? function(r) {
|
|
26
|
+
return t.call(this, r, i);
|
|
27
|
+
} : i;
|
|
28
|
+
return this._pairs.map(function(e) {
|
|
29
|
+
return o(e[0]) + "=" + o(e[1]);
|
|
30
|
+
}, "").join("&");
|
|
31
|
+
};
|
|
5
32
|
export {
|
|
6
|
-
|
|
33
|
+
a as default
|
|
7
34
|
};
|
package/dist/index227.mjs
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import i from "./index96.mjs";
|
|
3
|
+
import m from "./index100.mjs";
|
|
4
|
+
import s from "./index110.mjs";
|
|
5
|
+
function h(f, t) {
|
|
6
|
+
const o = this || m, r = t || o, n = s.from(r.headers);
|
|
7
|
+
let a = r.data;
|
|
8
|
+
return i.forEach(f, function(e) {
|
|
9
|
+
a = e.call(o, a, n.normalize(), t ? t.status : void 0);
|
|
10
|
+
}), n.normalize(), a;
|
|
4
11
|
}
|
|
5
12
|
export {
|
|
6
|
-
|
|
13
|
+
h as default
|
|
7
14
|
};
|
package/dist/index228.mjs
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const l = {
|
|
6
|
-
isBrowser: !0,
|
|
7
|
-
classes: {
|
|
8
|
-
URLSearchParams: o,
|
|
9
|
-
FormData: r,
|
|
10
|
-
Blob: t
|
|
11
|
-
},
|
|
12
|
-
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
13
|
-
};
|
|
2
|
+
function e(t) {
|
|
3
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
4
|
+
}
|
|
14
5
|
export {
|
|
15
|
-
|
|
6
|
+
e as default
|
|
16
7
|
};
|
package/dist/index229.mjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
function n(e, c) {
|
|
3
|
+
return c ? e.replace(/\/?\/$/, "") + "/" + c.replace(/^\/+/, "") : e;
|
|
4
|
+
}
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
-
n as hasStandardBrowserEnv,
|
|
7
|
-
t as hasStandardBrowserWebWorkerEnv,
|
|
8
|
-
o as navigator,
|
|
9
|
-
r as origin
|
|
6
|
+
n as default
|
|
10
7
|
};
|
package/dist/index232.mjs
CHANGED
package/dist/index233.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import n from "./index160.mjs";
|
|
3
3
|
import m from "./index96.mjs";
|
|
4
|
-
import c from "./
|
|
5
|
-
import h from "./
|
|
4
|
+
import c from "./index282.mjs";
|
|
5
|
+
import h from "./index283.mjs";
|
|
6
6
|
import w from "./index156.mjs";
|
|
7
7
|
import b from "./index99.mjs";
|
|
8
8
|
import C from "./index110.mjs";
|
package/dist/index236.mjs
CHANGED
package/dist/index237.mjs
CHANGED
package/dist/index239.mjs
CHANGED