@aizu-chat/react 0.1.2 → 0.1.4
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/index.js +162 -211
- package/dist/index.mjs +162 -211
- package/package.json +9 -4
package/dist/index.js
CHANGED
|
@@ -114,63 +114,11 @@ function cn(...args) {
|
|
|
114
114
|
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(args));
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
// src/assets/icons/ai/index.tsx
|
|
118
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
119
|
-
var IconAI = (_a) => {
|
|
120
|
-
var _b = _a, { className = "" } = _b, props = __objRest(_b, ["className"]);
|
|
121
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
122
|
-
"svg",
|
|
123
|
-
__spreadProps(__spreadValues({
|
|
124
|
-
width: "64",
|
|
125
|
-
height: "64",
|
|
126
|
-
viewBox: "0 0 64 64",
|
|
127
|
-
fill: "none",
|
|
128
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
129
|
-
className: cn("w-8 h-8", className)
|
|
130
|
-
}, props), {
|
|
131
|
-
children: [
|
|
132
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", { children: "Icon AI" }),
|
|
133
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { filter: "url(#filter0_ii_48_32)", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "32.0001", cy: "32", r: "32", fill: "url(#paint0_linear_48_32)" }) }),
|
|
134
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M34.2288 17.7789C33.9922 16.7384 33.0671 16 32 16C30.9329 16 30.0078 16.7384 29.7712 17.7789L28.5065 23.3405C27.9216 25.9129 25.9129 27.9216 23.3405 28.5065L17.7789 29.7712C16.7384 30.0078 16 30.9329 16 32C16 33.0671 16.7384 33.9922 17.7789 34.2288L23.3405 35.4935C25.9129 36.0784 27.9216 38.0871 28.5065 40.6595L29.7712 46.2211C30.0078 47.2616 30.9329 48 32 48C33.0671 48 33.9922 47.2616 34.2288 46.2211L35.4935 40.6595C36.0784 38.0871 38.0871 36.0784 40.6595 35.4935L46.2211 34.2288C47.2616 33.9922 48 33.0671 48 32C48 30.9329 47.2616 30.0078 46.2211 29.7712L40.6595 28.5065C38.0871 27.9216 36.0784 25.9129 35.4935 23.3405L34.2288 17.7789Z", fill: "url(#paint1_linear_48_32)" }),
|
|
135
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("defs", { children: [
|
|
136
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("filter", { id: "filter0_ii_48_32", x: "0.00012207", y: "0", width: "63.9999", height: "64", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB", children: [
|
|
137
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
138
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
139
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }),
|
|
140
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feMorphology", { radius: "4", operator: "erode", in: "SourceAlpha", result: "effect1_innerShadow_48_32" }),
|
|
141
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feOffset", {}),
|
|
142
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feGaussianBlur", { stdDeviation: "4" }),
|
|
143
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feComposite", { in2: "hardAlpha", operator: "arithmetic", k2: "-1", k3: "1" }),
|
|
144
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feColorMatrix", { type: "matrix", values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.2 0" }),
|
|
145
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feBlend", { mode: "normal", in2: "shape", result: "effect1_innerShadow_48_32" }),
|
|
146
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }),
|
|
147
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feOffset", {}),
|
|
148
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feGaussianBlur", { stdDeviation: "1" }),
|
|
149
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feComposite", { in2: "hardAlpha", operator: "arithmetic", k2: "-1", k3: "1" }),
|
|
150
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feColorMatrix", { type: "matrix", values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.3 0" }),
|
|
151
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feBlend", { mode: "normal", in2: "effect1_innerShadow_48_32", result: "effect2_innerShadow_48_32" })
|
|
152
|
-
] }),
|
|
153
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("linearGradient", { id: "paint0_linear_48_32", x1: "32.0001", y1: "-5.96047e-08", x2: "32.0001", y2: "64", gradientUnits: "userSpaceOnUse", children: [
|
|
154
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", { stopColor: "#3D3D3D" }),
|
|
155
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", { offset: "0.496312" }),
|
|
156
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", { offset: "0.723156", stopColor: "#803500" }),
|
|
157
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", { offset: "0.95", stopColor: "#FF6A00" })
|
|
158
|
-
] }),
|
|
159
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("linearGradient", { id: "paint1_linear_48_32", x1: "32", y1: "16", x2: "32", y2: "48", gradientUnits: "userSpaceOnUse", children: [
|
|
160
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", { stopColor: "white" }),
|
|
161
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", { offset: "1", stopColor: "#EBEBEB" })
|
|
162
|
-
] })
|
|
163
|
-
] })
|
|
164
|
-
]
|
|
165
|
-
})
|
|
166
|
-
);
|
|
167
|
-
};
|
|
168
|
-
|
|
169
117
|
// src/assets/icons/arrow-narrow-up/index.tsx
|
|
170
|
-
var
|
|
118
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
171
119
|
var IconArrowNarrowUp = (_a) => {
|
|
172
120
|
var _b = _a, { className = "" } = _b, props = __objRest(_b, ["className"]);
|
|
173
|
-
return /* @__PURE__ */ (0,
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
174
122
|
"svg",
|
|
175
123
|
__spreadProps(__spreadValues({
|
|
176
124
|
width: "20",
|
|
@@ -181,8 +129,8 @@ var IconArrowNarrowUp = (_a) => {
|
|
|
181
129
|
className
|
|
182
130
|
}, props), {
|
|
183
131
|
children: [
|
|
184
|
-
/* @__PURE__ */ (0,
|
|
185
|
-
/* @__PURE__ */ (0,
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", { children: "Arrow Narrow up" }),
|
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
186
134
|
"path",
|
|
187
135
|
{
|
|
188
136
|
d: "M10 16.6666V3.33331M10 3.33331L5 8.33331M10 3.33331L15 8.33331",
|
|
@@ -198,10 +146,10 @@ var IconArrowNarrowUp = (_a) => {
|
|
|
198
146
|
};
|
|
199
147
|
|
|
200
148
|
// src/assets/icons/chevron-left/index.tsx
|
|
201
|
-
var
|
|
149
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
202
150
|
var IconChevronLeft = (_a) => {
|
|
203
151
|
var _b = _a, { className = "" } = _b, props = __objRest(_b, ["className"]);
|
|
204
|
-
return /* @__PURE__ */ (0,
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
205
153
|
"svg",
|
|
206
154
|
__spreadProps(__spreadValues({
|
|
207
155
|
width: "20",
|
|
@@ -212,8 +160,8 @@ var IconChevronLeft = (_a) => {
|
|
|
212
160
|
className
|
|
213
161
|
}, props), {
|
|
214
162
|
children: [
|
|
215
|
-
/* @__PURE__ */ (0,
|
|
216
|
-
/* @__PURE__ */ (0,
|
|
163
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("title", { children: "Chevron Left" }),
|
|
164
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
217
165
|
"path",
|
|
218
166
|
{
|
|
219
167
|
d: "M12.5 15L7.5 10L12.5 5",
|
|
@@ -229,10 +177,10 @@ var IconChevronLeft = (_a) => {
|
|
|
229
177
|
};
|
|
230
178
|
|
|
231
179
|
// src/assets/icons/expand/index.tsx
|
|
232
|
-
var
|
|
180
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
233
181
|
var IconExpand = (_a) => {
|
|
234
182
|
var _b = _a, { className = "" } = _b, props = __objRest(_b, ["className"]);
|
|
235
|
-
return /* @__PURE__ */ (0,
|
|
183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
236
184
|
"svg",
|
|
237
185
|
__spreadProps(__spreadValues({
|
|
238
186
|
width: "20",
|
|
@@ -243,8 +191,8 @@ var IconExpand = (_a) => {
|
|
|
243
191
|
className: cn("text-[#3D3D3D]", className)
|
|
244
192
|
}, props), {
|
|
245
193
|
children: [
|
|
246
|
-
/* @__PURE__ */ (0,
|
|
247
|
-
/* @__PURE__ */ (0,
|
|
194
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("title", { children: "Icon Expand" }),
|
|
195
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
248
196
|
"path",
|
|
249
197
|
{
|
|
250
198
|
d: "M11.6667 8.33333L17.5 2.5M17.5 2.5H12.5M17.5 2.5V7.5M8.33333 11.6667L2.5 17.5M2.5 17.5H7.5M2.5 17.5L2.5 12.5",
|
|
@@ -260,10 +208,10 @@ var IconExpand = (_a) => {
|
|
|
260
208
|
};
|
|
261
209
|
|
|
262
210
|
// src/assets/icons/image-plus/index.tsx
|
|
263
|
-
var
|
|
211
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
264
212
|
var IconImagePlus = (_a) => {
|
|
265
213
|
var _b = _a, { className = "text-[#FFF8EC]" } = _b, props = __objRest(_b, ["className"]);
|
|
266
|
-
return /* @__PURE__ */ (0,
|
|
214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
267
215
|
"svg",
|
|
268
216
|
__spreadProps(__spreadValues({
|
|
269
217
|
width: "20",
|
|
@@ -274,8 +222,8 @@ var IconImagePlus = (_a) => {
|
|
|
274
222
|
className
|
|
275
223
|
}, props), {
|
|
276
224
|
children: [
|
|
277
|
-
/* @__PURE__ */ (0,
|
|
278
|
-
/* @__PURE__ */ (0,
|
|
225
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("title", { children: "Icon Image Plus" }),
|
|
226
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
279
227
|
"path",
|
|
280
228
|
{
|
|
281
229
|
d: "M10.4167 2.50002H6.5C5.09987 2.50002 4.3998 2.50002 3.86502 2.7725C3.39462 3.01219 3.01217 3.39464 2.77248 3.86504C2.5 4.39982 2.5 5.09989 2.5 6.50002V13.5C2.5 14.9002 2.5 15.6002 2.77248 16.135C3.01217 16.6054 3.39462 16.9879 3.86502 17.2275C4.3998 17.5 5.09987 17.5 6.5 17.5H14.1667C14.9416 17.5 15.3291 17.5 15.647 17.4148C16.5098 17.1837 17.1836 16.5098 17.4148 15.6471C17.5 15.3292 17.5 14.9417 17.5 14.1667M15.8333 6.66669V1.66669M13.3333 4.16669H18.3333M8.75 7.08335C8.75 8.00383 8.00381 8.75002 7.08333 8.75002C6.16286 8.75002 5.41667 8.00383 5.41667 7.08335C5.41667 6.16288 6.16286 5.41669 7.08333 5.41669C8.00381 5.41669 8.75 6.16288 8.75 7.08335ZM12.4917 9.93181L5.44262 16.3401C5.04614 16.7005 4.84789 16.8807 4.83036 17.0368C4.81516 17.1722 4.86704 17.3064 4.96932 17.3963C5.08732 17.5 5.35523 17.5 5.89107 17.5H13.7133C14.9126 17.5 15.5123 17.5 15.9833 17.2985C16.5745 17.0456 17.0456 16.5746 17.2985 15.9833C17.5 15.5123 17.5 14.9126 17.5 13.7133C17.5 13.3098 17.5 13.108 17.4559 12.9201C17.4004 12.684 17.2941 12.4628 17.1444 12.272C17.0252 12.1202 16.8677 11.9941 16.5526 11.7421L14.2215 9.87724C13.9062 9.62494 13.7485 9.4988 13.5748 9.45428C13.4218 9.41504 13.2607 9.42012 13.1104 9.46893C12.94 9.5243 12.7905 9.66014 12.4917 9.93181Z",
|
|
@@ -291,10 +239,10 @@ var IconImagePlus = (_a) => {
|
|
|
291
239
|
};
|
|
292
240
|
|
|
293
241
|
// src/assets/icons/minimize/index.tsx
|
|
294
|
-
var
|
|
242
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
295
243
|
var IconMinimize = (_a) => {
|
|
296
244
|
var _b = _a, { className = "" } = _b, props = __objRest(_b, ["className"]);
|
|
297
|
-
return /* @__PURE__ */ (0,
|
|
245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
298
246
|
"svg",
|
|
299
247
|
__spreadProps(__spreadValues({
|
|
300
248
|
width: "20",
|
|
@@ -305,8 +253,8 @@ var IconMinimize = (_a) => {
|
|
|
305
253
|
className: cn("text-[#3D3D3D]", className)
|
|
306
254
|
}, props), {
|
|
307
255
|
children: [
|
|
308
|
-
/* @__PURE__ */ (0,
|
|
309
|
-
/* @__PURE__ */ (0,
|
|
256
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("title", { children: "Icon Minimize" }),
|
|
257
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
310
258
|
"path",
|
|
311
259
|
{
|
|
312
260
|
d: "M3.33333 11.6667H8.33333M8.33333 11.6667V16.6667M8.33333 11.6667L2.5 17.5M16.6667 8.33333H11.6667M11.6667 8.33333V3.33333M11.6667 8.33333L17.5 2.5",
|
|
@@ -322,10 +270,10 @@ var IconMinimize = (_a) => {
|
|
|
322
270
|
};
|
|
323
271
|
|
|
324
272
|
// src/assets/icons/x-close/index.tsx
|
|
325
|
-
var
|
|
273
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
326
274
|
var IconXClose = (_a) => {
|
|
327
275
|
var _b = _a, { className = "" } = _b, props = __objRest(_b, ["className"]);
|
|
328
|
-
return /* @__PURE__ */ (0,
|
|
276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
329
277
|
"svg",
|
|
330
278
|
__spreadProps(__spreadValues({
|
|
331
279
|
width: "20",
|
|
@@ -336,8 +284,8 @@ var IconXClose = (_a) => {
|
|
|
336
284
|
className: cn("text-[#3D3D3D]", className)
|
|
337
285
|
}, props), {
|
|
338
286
|
children: [
|
|
339
|
-
/* @__PURE__ */ (0,
|
|
340
|
-
/* @__PURE__ */ (0,
|
|
287
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("title", { children: "Icon XClose" }),
|
|
288
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
341
289
|
"path",
|
|
342
290
|
{
|
|
343
291
|
d: "M15 5L5 15M5 5L15 15",
|
|
@@ -548,7 +496,7 @@ Detail
|
|
|
548
496
|
];
|
|
549
497
|
|
|
550
498
|
// src/constant/default.ts
|
|
551
|
-
var defaultQuickMenuMessage = "\u0E2A\u0E27\u0E31\u0E2A\u0E14\u0E35\u0E04\u0E23\u0E31\u0E1A
|
|
499
|
+
var defaultQuickMenuMessage = "\u0E2A\u0E27\u0E31\u0E2A\u0E14\u0E35\u0E04\u0E48\u0E30 \u0E22\u0E34\u0E19\u0E14\u0E35\u0E15\u0E49\u0E2D\u0E19\u0E23\u0E31\u0E1A\u0E2A\u0E39\u0E48 ZIMCRAFT \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E43\u0E2B\u0E49\u0E04\u0E38\u0E13\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E1E\u0E31\u0E01\u0E1C\u0E48\u0E2D\u0E19\u0E17\u0E35\u0E48\u0E14\u0E35\u0E17\u0E35\u0E48\u0E2A\u0E38\u0E14 \u0E43\u0E2B\u0E49 AI \u0E0A\u0E48\u0E27\u0E22\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2B\u0E21\u0E2D\u0E19\u0E17\u0E35\u0E48\u0E40\u0E2B\u0E21\u0E32\u0E30\u0E01\u0E31\u0E1A\u0E2A\u0E23\u0E35\u0E23\u0E30\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E44\u0E2B\u0E21\u0E04\u0E23\u0E31\u0E1A? \u0E43\u0E0A\u0E49\u0E40\u0E27\u0E25\u0E32\u0E41\u0E04\u0E48 1 \u0E19\u0E32\u0E17\u0E35";
|
|
552
500
|
var defaultBanner = "https://utech-dev.zimpligital.com/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcoupon-banner-th.edad52fd.webp&w=640&q=75";
|
|
553
501
|
var defaultQuickMenus = [
|
|
554
502
|
{ id: "1", title: "\u0E2A\u0E31\u0E48\u0E07\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 \u{1F6CD}\uFE0F", value: "\u0E2A\u0E31\u0E48\u0E07\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32", mockResponse: "QUICK_MENU_SHOP" /* QUICK_MENU_SHOP */ },
|
|
@@ -885,7 +833,7 @@ var useAizuChat = (client) => {
|
|
|
885
833
|
};
|
|
886
834
|
|
|
887
835
|
// src/contexts/aizu-client-context.tsx
|
|
888
|
-
var
|
|
836
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
889
837
|
var AizuClientContext = (0, import_react3.createContext)(
|
|
890
838
|
void 0
|
|
891
839
|
);
|
|
@@ -918,7 +866,7 @@ var AizuClientProvider = ({
|
|
|
918
866
|
cancelRequest
|
|
919
867
|
]
|
|
920
868
|
);
|
|
921
|
-
return /* @__PURE__ */ (0,
|
|
869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AizuClientContext.Provider, { value, children });
|
|
922
870
|
};
|
|
923
871
|
var useAizuClient = () => {
|
|
924
872
|
const context = (0, import_react3.useContext)(AizuClientContext);
|
|
@@ -970,7 +918,7 @@ var useOpenChat = () => {
|
|
|
970
918
|
|
|
971
919
|
// src/contexts/chat-context.tsx
|
|
972
920
|
var import_react5 = require("react");
|
|
973
|
-
var
|
|
921
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
974
922
|
var ChatContext = (0, import_react5.createContext)(void 0);
|
|
975
923
|
var ChatProvider = ({ children }) => {
|
|
976
924
|
const [messages, setMessages] = (0, import_react5.useState)([]);
|
|
@@ -1012,7 +960,7 @@ var ChatProvider = ({ children }) => {
|
|
|
1012
960
|
}),
|
|
1013
961
|
[messages, userMessages, latestMessage, isLoading, chatControls, addUserMessage, addBotMessage, clearMessages]
|
|
1014
962
|
);
|
|
1015
|
-
return /* @__PURE__ */ (0,
|
|
963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChatContext.Provider, { value, children });
|
|
1016
964
|
};
|
|
1017
965
|
var useChatContext = () => {
|
|
1018
966
|
const context = (0, import_react5.useContext)(ChatContext);
|
|
@@ -1318,10 +1266,10 @@ var useKeyboard = ({ userMessages, isLoading, onSend }) => {
|
|
|
1318
1266
|
};
|
|
1319
1267
|
|
|
1320
1268
|
// src/components/input-bar/index.tsx
|
|
1321
|
-
var
|
|
1269
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1322
1270
|
var ButtonSelectImage = (_a) => {
|
|
1323
1271
|
var _b = _a, { onClick, className } = _b, props = __objRest(_b, ["onClick", "className"]);
|
|
1324
|
-
return /* @__PURE__ */ (0,
|
|
1272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1325
1273
|
"button",
|
|
1326
1274
|
__spreadProps(__spreadValues({
|
|
1327
1275
|
type: "button",
|
|
@@ -1332,13 +1280,13 @@ var ButtonSelectImage = (_a) => {
|
|
|
1332
1280
|
),
|
|
1333
1281
|
"aria-label": "Upload image"
|
|
1334
1282
|
}, props), {
|
|
1335
|
-
children: /* @__PURE__ */ (0,
|
|
1283
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconImagePlus, {})
|
|
1336
1284
|
})
|
|
1337
1285
|
);
|
|
1338
1286
|
};
|
|
1339
1287
|
var InputTextArea = (_a) => {
|
|
1340
1288
|
var _b = _a, { onMagicClick, placeholder, className } = _b, props = __objRest(_b, ["onMagicClick", "placeholder", "className"]);
|
|
1341
|
-
return /* @__PURE__ */ (0,
|
|
1289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex-1 relative", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1342
1290
|
"textarea",
|
|
1343
1291
|
__spreadValues({
|
|
1344
1292
|
placeholder,
|
|
@@ -1349,7 +1297,7 @@ var InputTextArea = (_a) => {
|
|
|
1349
1297
|
};
|
|
1350
1298
|
var ButtonConfirm = (_a) => {
|
|
1351
1299
|
var _b = _a, { className, disabled } = _b, props = __objRest(_b, ["className", "disabled"]);
|
|
1352
|
-
return /* @__PURE__ */ (0,
|
|
1300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1353
1301
|
"button",
|
|
1354
1302
|
__spreadProps(__spreadValues({
|
|
1355
1303
|
type: "submit",
|
|
@@ -1364,7 +1312,7 @@ var ButtonConfirm = (_a) => {
|
|
|
1364
1312
|
"aria-label": "Send message",
|
|
1365
1313
|
disabled
|
|
1366
1314
|
}, props), {
|
|
1367
|
-
children: /* @__PURE__ */ (0,
|
|
1315
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconArrowNarrowUp, { className: "text-black" })
|
|
1368
1316
|
})
|
|
1369
1317
|
);
|
|
1370
1318
|
};
|
|
@@ -1375,7 +1323,7 @@ var ButtonCancel = () => {
|
|
|
1375
1323
|
cancelRequest();
|
|
1376
1324
|
setIsLoading(false);
|
|
1377
1325
|
};
|
|
1378
|
-
return /* @__PURE__ */ (0,
|
|
1326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1379
1327
|
"button",
|
|
1380
1328
|
{
|
|
1381
1329
|
type: "button",
|
|
@@ -1386,7 +1334,7 @@ var ButtonCancel = () => {
|
|
|
1386
1334
|
"flex items-center justify-center",
|
|
1387
1335
|
"cursor-pointer"
|
|
1388
1336
|
),
|
|
1389
|
-
children: /* @__PURE__ */ (0,
|
|
1337
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "bg-black w-4 h-4" })
|
|
1390
1338
|
}
|
|
1391
1339
|
);
|
|
1392
1340
|
};
|
|
@@ -1409,15 +1357,15 @@ var InputBar = (_a) => {
|
|
|
1409
1357
|
"className"
|
|
1410
1358
|
]);
|
|
1411
1359
|
const { value, textareaRef, handleChange, handleSubmit, handleKeyDown } = useKeyboard({ userMessages, isLoading, onSend });
|
|
1412
|
-
return /* @__PURE__ */ (0,
|
|
1413
|
-
/* @__PURE__ */ (0,
|
|
1360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("section", __spreadProps(__spreadValues({ className: cn("bg-white p-4", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("form", { onSubmit: handleSubmit, className: "flex items-end gap-3", children: [
|
|
1361
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1414
1362
|
"label",
|
|
1415
1363
|
{
|
|
1416
1364
|
htmlFor: "chat-input-text",
|
|
1417
1365
|
className: "flex items-end rounded-3xl bg-gray-100 flex-1 p-2 focus-within:ring-2 focus-within:ring-orange-300",
|
|
1418
1366
|
children: [
|
|
1419
|
-
/* @__PURE__ */ (0,
|
|
1420
|
-
/* @__PURE__ */ (0,
|
|
1367
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ButtonSelectImage, { onClick: onImageClick, className: "mr-3" }),
|
|
1368
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1421
1369
|
InputTextArea,
|
|
1422
1370
|
{
|
|
1423
1371
|
ref: textareaRef,
|
|
@@ -1432,7 +1380,7 @@ var InputBar = (_a) => {
|
|
|
1432
1380
|
]
|
|
1433
1381
|
}
|
|
1434
1382
|
),
|
|
1435
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
1383
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ButtonCancel, {}) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ButtonConfirm, { disabled: isLoading })
|
|
1436
1384
|
] }) }));
|
|
1437
1385
|
};
|
|
1438
1386
|
InputBar.ButtonSelectImage = ButtonSelectImage;
|
|
@@ -1440,24 +1388,24 @@ InputBar.InputTextArea = InputTextArea;
|
|
|
1440
1388
|
InputBar.ButtonConfirm = ButtonConfirm;
|
|
1441
1389
|
|
|
1442
1390
|
// src/components/loading.tsx
|
|
1443
|
-
var
|
|
1391
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1444
1392
|
var Loading = ({ message }) => {
|
|
1445
|
-
return /* @__PURE__ */ (0,
|
|
1446
|
-
/* @__PURE__ */ (0,
|
|
1447
|
-
/* @__PURE__ */ (0,
|
|
1448
|
-
/* @__PURE__ */ (0,
|
|
1449
|
-
/* @__PURE__ */ (0,
|
|
1393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: cn("flex flex-col justify-center items-center border border-orange-400 shadow shadow-orange-400 h-10 max-w-69.5 rounded-3xl", { "h-16": !!message }), children: [
|
|
1394
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex justify-center items-center gap-x-1 ", children: [
|
|
1395
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w-2 h-2 rounded-full bg-orange-400 animate-circle-keys animation-delay-300" }),
|
|
1396
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w-2 h-2 rounded-full bg-orange-400 animate-circle-keys animation-delay-600" }),
|
|
1397
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w-2 h-2 rounded-full bg-orange-400 animate-circle-keys animation-delay-900" })
|
|
1450
1398
|
] }),
|
|
1451
|
-
message && /* @__PURE__ */ (0,
|
|
1399
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-center text-[12px] text-gray-500 mt-1", children: message })
|
|
1452
1400
|
] });
|
|
1453
1401
|
};
|
|
1454
1402
|
|
|
1455
1403
|
// src/components/button.tsx
|
|
1456
1404
|
var import_react8 = require("react");
|
|
1457
|
-
var
|
|
1405
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1458
1406
|
var ButtonInner = (props, ref) => {
|
|
1459
1407
|
const _a = props, { children, className, onClick } = _a, rest = __objRest(_a, ["children", "className", "onClick"]);
|
|
1460
|
-
return /* @__PURE__ */ (0,
|
|
1408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1461
1409
|
"button",
|
|
1462
1410
|
__spreadProps(__spreadValues({
|
|
1463
1411
|
ref,
|
|
@@ -1479,33 +1427,33 @@ var Button = (0, import_react8.memo)((0, import_react8.forwardRef)(ButtonInner))
|
|
|
1479
1427
|
Button.displayName = "Button";
|
|
1480
1428
|
|
|
1481
1429
|
// src/components/container.tsx
|
|
1482
|
-
var
|
|
1430
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1483
1431
|
var Container = (_a) => {
|
|
1484
1432
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
1485
|
-
return /* @__PURE__ */ (0,
|
|
1433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: cn("p-3 rounded-3xl border border-orange-300", className), children });
|
|
1486
1434
|
};
|
|
1487
1435
|
|
|
1488
1436
|
// src/components/product-preview-card/index.tsx
|
|
1489
|
-
var
|
|
1437
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1490
1438
|
var ProductPreviewCard = ({ product, className }) => {
|
|
1491
|
-
return /* @__PURE__ */ (0,
|
|
1492
|
-
/* @__PURE__ */ (0,
|
|
1493
|
-
/* @__PURE__ */ (0,
|
|
1494
|
-
/* @__PURE__ */ (0,
|
|
1495
|
-
/* @__PURE__ */ (0,
|
|
1496
|
-
/* @__PURE__ */ (0,
|
|
1497
|
-
/* @__PURE__ */ (0,
|
|
1498
|
-
/* @__PURE__ */ (0,
|
|
1439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cn("bg-white overflow-hidden rounded-2xl h-full p-3 lg:hover:shadow", className), children: [
|
|
1440
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ProductThumbnail, __spreadValues({}, product)),
|
|
1441
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ProductSuggest, __spreadValues({}, product)),
|
|
1442
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ProductTitle, __spreadValues({}, product)),
|
|
1443
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ProductDescription, __spreadValues({}, product)),
|
|
1444
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ProductPrice, __spreadValues({}, product)),
|
|
1445
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ProductBadges, {}),
|
|
1446
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ProductMenus, __spreadValues({}, product))
|
|
1499
1447
|
] });
|
|
1500
1448
|
};
|
|
1501
1449
|
var ProductThumbnail = (product) => {
|
|
1502
1450
|
if (!product.thumbnail) {
|
|
1503
|
-
return /* @__PURE__ */ (0,
|
|
1451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "border aspect-square flex justify-center items-center", children: "No Image" });
|
|
1504
1452
|
}
|
|
1505
|
-
return /* @__PURE__ */ (0,
|
|
1453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w-full aspect-square flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("img", { src: product.thumbnail, alt: product.title, className: "w-full" }) });
|
|
1506
1454
|
};
|
|
1507
1455
|
var ProductSuggest = (product) => {
|
|
1508
|
-
return /* @__PURE__ */ (0,
|
|
1456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1509
1457
|
"div",
|
|
1510
1458
|
{
|
|
1511
1459
|
className: "text-[10px] text-[#FF6B00] font-bold bg-[#FFF0D3] max-w-max rounded-sm px-2\n py-px mb-2",
|
|
@@ -1517,7 +1465,7 @@ var ProductSuggest = (product) => {
|
|
|
1517
1465
|
);
|
|
1518
1466
|
};
|
|
1519
1467
|
var ProductTitle = (product) => {
|
|
1520
|
-
return /* @__PURE__ */ (0,
|
|
1468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1521
1469
|
"div",
|
|
1522
1470
|
{
|
|
1523
1471
|
className: "font-semibold line-clamp-2 mb-2 min-h-12",
|
|
@@ -1526,7 +1474,7 @@ var ProductTitle = (product) => {
|
|
|
1526
1474
|
);
|
|
1527
1475
|
};
|
|
1528
1476
|
var ProductDescription = (product) => {
|
|
1529
|
-
return /* @__PURE__ */ (0,
|
|
1477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1530
1478
|
"div",
|
|
1531
1479
|
{
|
|
1532
1480
|
className: "text-sm text-[#525252] line-clamp-2 mb-3",
|
|
@@ -1535,7 +1483,7 @@ var ProductDescription = (product) => {
|
|
|
1535
1483
|
);
|
|
1536
1484
|
};
|
|
1537
1485
|
var ProductPrice = (product) => {
|
|
1538
|
-
return /* @__PURE__ */ (0,
|
|
1486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1539
1487
|
"div",
|
|
1540
1488
|
{
|
|
1541
1489
|
className: "text-lg text-red-500 font-semibold mb-3",
|
|
@@ -1552,7 +1500,7 @@ var ProductBadges = () => {
|
|
|
1552
1500
|
{ id: "badge2", text: "\u0E2A\u0E48\u0E07\u0E1F\u0E23\u0E35" },
|
|
1553
1501
|
{ id: "badge3", text: "Cashback 500" }
|
|
1554
1502
|
];
|
|
1555
|
-
return /* @__PURE__ */ (0,
|
|
1503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "flex flex-wrap gap-1 mb-6", children: badges == null ? void 0 : badges.map((badge) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { className: "text-[10px] text-[#656565] font-bold bg-gray-200 px-2 py-px rounded-sm", children: badge.text }, badge.id)) });
|
|
1556
1504
|
};
|
|
1557
1505
|
var ProductMenus = (product) => {
|
|
1558
1506
|
const menus = [
|
|
@@ -1560,37 +1508,40 @@ var ProductMenus = (product) => {
|
|
|
1560
1508
|
{ id: "product-menu2", text: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E25\u0E07\u0E43\u0E19\u0E23\u0E16\u0E40\u0E02\u0E47\u0E19 \u{1F6D2} " },
|
|
1561
1509
|
{ id: "product-menu3", text: "\u0E2A\u0E2D\u0E1A\u0E16\u0E32\u0E21\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21 \u{1F4AC}" }
|
|
1562
1510
|
];
|
|
1563
|
-
return /* @__PURE__ */ (0,
|
|
1511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "flex flex-col gap-y-3", children: menus == null ? void 0 : menus.map((menu) => {
|
|
1564
1512
|
if (menu.text.includes("\u0E09\u0E31\u0E19\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32")) {
|
|
1565
|
-
return /* @__PURE__ */ (0,
|
|
1513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("a", { href: `/products/${product.handle}`, target: "_blank", rel: "noreferrer", className: "border border-orange-300 rounded-3xl px-3 py-2 text-orange-500 text-sm text-center block", children: menu.text }) }, menu.id);
|
|
1566
1514
|
}
|
|
1567
|
-
return /* @__PURE__ */ (0,
|
|
1515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button, { className: cn("text-nowrap w-full", { "bg-orange-500 text-white/80": menu.text.includes("\u0E09\u0E31\u0E19\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32") }), children: menu.text }) }, menu.id);
|
|
1568
1516
|
}) });
|
|
1569
1517
|
};
|
|
1570
1518
|
|
|
1519
|
+
// src/assets/images/zImple-solotion-logo.svg
|
|
1520
|
+
var zImple_solotion_logo_default = 'data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?>%0A<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 143 143">%0A <!-- Generator: Adobe Illustrator 30.1.0, SVG Export Plug-In . SVG Version: 2.1.1 Build 136) -->%0A <defs>%0A <style>%0A .st0 {%0A fill: %23ef001d;%0A }%0A%0A .st1 {%0A fill: url(%23linear-gradient1);%0A }%0A%0A .st2 {%0A fill: url(%23linear-gradient);%0A }%0A </style>%0A <linearGradient id="linear-gradient" x1="-142.5" y1="180.1" x2="-96.4" y2="180.1" gradientTransform="translate(253.5 -51.1) rotate(30)" gradientUnits="userSpaceOnUse">%0A <stop offset="0" stop-color="%23f0562f"/>%0A <stop offset="0" stop-color="%23ef542e"/>%0A <stop offset=".5" stop-color="%23ef2625"/>%0A <stop offset=".8" stop-color="%23ef0a1f"/>%0A <stop offset="1" stop-color="%23ef001d"/>%0A </linearGradient>%0A <linearGradient id="linear-gradient1" x1="-56.8" y1="214.2" x2="-113.8" y2="214.2" xlink:href="%23linear-gradient"/>%0A </defs>%0A <path class="st0" d="M112.2,91.2c0-2.4-1.3-4.5-3.3-5.7l-14.8-8.5-13.2,7.6,11.5,6.6-20.9,12.1-20.9-12.1,58.3-33.7c2-1.2,3.3-3.4,3.3-5.7,0-2.4-1.3-4.5-3.3-5.7l-34.1-19.7c-2-1.2-4.6-1.2-6.6,0l-34.1,19.7c-2,1.2-3.3,3.4-3.3,5.7s1.3,4.5,3.3,5.7l14.8,8.5,13.2-7.6h0s-11.5-6.6-11.5-6.6l20.9-12.1,20.9,12.1-58.3,33.7c-2,1.2-3.3,3.4-3.3,5.7,0,2.4,1.3,4.5,3.3,5.7l34.1,19.7c2,1.2,4.6,1.2,6.6,0l34.1-19.7c2-1.2,3.3-3.4,3.3-5.7Z"/>%0A <path class="st2" d="M108.9,46.1l-34.1-19.7c-2-1.2-4.6-1.2-6.6,0l-34.1,19.7c-2,1.2-3.3,3.4-3.3,5.7s1.3,4.5,3.3,5.7l14.8,8.5,13.2-7.6h0s-11.5-6.6-11.5-6.6l20.9-12.1,20.9,12.1"/>%0A <path class="st1" d="M34.1,96.9l34.1,19.7c2,1.2,4.6,1.2,6.6,0l34.1-19.7c2-1.2,3.3-3.4,3.3-5.7s-1.3-4.5-3.3-5.7l-14.8-8.5-13.2,7.6h0s11.5,6.6,11.5,6.6l-20.9,12.1-20.9-12.1"/>%0A</svg>';
|
|
1521
|
+
|
|
1571
1522
|
// src/components/message/index.tsx
|
|
1572
|
-
var
|
|
1523
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1573
1524
|
var MessageBubble = ({ message, handleClick, focus }) => {
|
|
1574
1525
|
if (message.type === "USER_TEXT" /* USER_TEXT */) {
|
|
1575
|
-
return /* @__PURE__ */ (0,
|
|
1526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MessageText, { message: message.text, role: "user" /* USER */ });
|
|
1576
1527
|
}
|
|
1577
1528
|
if (message.type === "BOT_TEXT" /* BOT_TEXT */) {
|
|
1578
|
-
return /* @__PURE__ */ (0,
|
|
1529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(BotMessageWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MessageText, { message: message.text, role: "bot" /* BOT */, focus }) });
|
|
1579
1530
|
}
|
|
1580
1531
|
if (message.type === "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */ || message.type === "BOT_QUICK_MENUS" /* BOT_QUICK_MENUS */ || message.type === "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */ || message.type === "BOT_TEXT_WITH_MENUS_COL" /* BOT_TEXT_WITH_MENUS_COL */) {
|
|
1581
|
-
return /* @__PURE__ */ (0,
|
|
1532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(BotMessageWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1582
1533
|
MessageWithMenus,
|
|
1583
1534
|
{
|
|
1584
1535
|
type: message.type,
|
|
1585
1536
|
message: message.text || "",
|
|
1586
|
-
menus:
|
|
1537
|
+
menus: [],
|
|
1587
1538
|
handleClick,
|
|
1588
1539
|
focus
|
|
1589
1540
|
}
|
|
1590
1541
|
) });
|
|
1591
1542
|
}
|
|
1592
1543
|
if (message.type === "BOT_TEXT_WITH_PRODUCTS" /* BOT_TEXT_WITH_PRODUCTS */) {
|
|
1593
|
-
return /* @__PURE__ */ (0,
|
|
1544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(BotMessageWrapper, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1594
1545
|
MessageWithProducts,
|
|
1595
1546
|
{
|
|
1596
1547
|
type: message.type,
|
|
@@ -1601,10 +1552,10 @@ var MessageBubble = ({ message, handleClick, focus }) => {
|
|
|
1601
1552
|
}
|
|
1602
1553
|
) });
|
|
1603
1554
|
}
|
|
1604
|
-
return /* @__PURE__ */ (0,
|
|
1555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(BotMessageWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MessageText, { message: message.text, role: "bot" /* BOT */, focus }) });
|
|
1605
1556
|
};
|
|
1606
1557
|
var MessageText = ({ role, message, focus, className }) => {
|
|
1607
|
-
return /* @__PURE__ */ (0,
|
|
1558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1608
1559
|
Container,
|
|
1609
1560
|
{
|
|
1610
1561
|
className: cn(
|
|
@@ -1621,7 +1572,7 @@ var MessageText = ({ role, message, focus, className }) => {
|
|
|
1621
1572
|
);
|
|
1622
1573
|
};
|
|
1623
1574
|
var MessageWithMenus = ({ type, message, menus, className, handleClick, focus }) => {
|
|
1624
|
-
return /* @__PURE__ */ (0,
|
|
1575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1625
1576
|
Container,
|
|
1626
1577
|
{
|
|
1627
1578
|
className: cn(
|
|
@@ -1633,10 +1584,10 @@ var MessageWithMenus = ({ type, message, menus, className, handleClick, focus })
|
|
|
1633
1584
|
className
|
|
1634
1585
|
),
|
|
1635
1586
|
children: [
|
|
1636
|
-
/* @__PURE__ */ (0,
|
|
1637
|
-
/* @__PURE__ */ (0,
|
|
1587
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-sm mb-4", children: message }),
|
|
1588
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: cn("flex flex-wrap gap-x-1 gap-y-3", { "flex-col": type === "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */ }), children: menus == null ? void 0 : menus.map((menu) => {
|
|
1638
1589
|
if (menu == null ? void 0 : menu.phoneNumber) {
|
|
1639
|
-
return /* @__PURE__ */ (0,
|
|
1590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { className: "w-full ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1640
1591
|
"a",
|
|
1641
1592
|
{
|
|
1642
1593
|
href: `tel:+${menu == null ? void 0 : menu.phoneNumber}`,
|
|
@@ -1646,9 +1597,9 @@ var MessageWithMenus = ({ type, message, menus, className, handleClick, focus })
|
|
|
1646
1597
|
) }, menu.id);
|
|
1647
1598
|
}
|
|
1648
1599
|
if (menu == null ? void 0 : menu.url) {
|
|
1649
|
-
return /* @__PURE__ */ (0,
|
|
1600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { className: "w-full min-w-max", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { href: menu.url, target: "_blank", rel: "noreferrer", className: "border border-orange-300 rounded-3xl px-4 py-2 text-orange-500 text-sm text-center block", children: menu.title }) }, menu.id);
|
|
1650
1601
|
}
|
|
1651
|
-
return /* @__PURE__ */ (0,
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { className: cn("min-w-max ", { "min-w-full": type === "BOT_TEXT_WITH_MENUS_COL" /* BOT_TEXT_WITH_MENUS_COL */ }), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1652
1603
|
Button,
|
|
1653
1604
|
{
|
|
1654
1605
|
className: cn({ "w-full": type === "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */ || type === "BOT_TEXT_WITH_MENUS_COL" /* BOT_TEXT_WITH_MENUS_COL */ }),
|
|
@@ -1665,13 +1616,13 @@ var MessageWithMenus = ({ type, message, menus, className, handleClick, focus })
|
|
|
1665
1616
|
};
|
|
1666
1617
|
var MessageWithProducts = ({ message, className, products, focus, handleClick }) => {
|
|
1667
1618
|
const { chatControls } = useChatContext();
|
|
1668
|
-
return /* @__PURE__ */ (0,
|
|
1669
|
-
message && /* @__PURE__ */ (0,
|
|
1670
|
-
/* @__PURE__ */ (0,
|
|
1619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: cn("w-full", className), children: [
|
|
1620
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MessageText, { message, role: "bot" /* BOT */, className: "mb-4", focus }),
|
|
1621
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "pl-4", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1671
1622
|
"ul",
|
|
1672
1623
|
{
|
|
1673
1624
|
className: "flex gap-3 lg:gap-x-2 overflow-x-auto scrollbar-hide -mx-4 snap-x snap-mandatory",
|
|
1674
|
-
children: products == null ? void 0 : products.map((product) => /* @__PURE__ */ (0,
|
|
1625
|
+
children: products == null ? void 0 : products.map((product) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1675
1626
|
"li",
|
|
1676
1627
|
{
|
|
1677
1628
|
className: cn(
|
|
@@ -1686,7 +1637,7 @@ var MessageWithProducts = ({ message, className, products, focus, handleClick })
|
|
|
1686
1637
|
"lg:w-[calc(100%/4.6)] lg:max-w-[calc(100%/4.6)]": chatControls.isExpanded
|
|
1687
1638
|
}
|
|
1688
1639
|
),
|
|
1689
|
-
children: /* @__PURE__ */ (0,
|
|
1640
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ProductPreviewCard, { product })
|
|
1690
1641
|
},
|
|
1691
1642
|
product.product_id
|
|
1692
1643
|
))
|
|
@@ -1694,19 +1645,19 @@ var MessageWithProducts = ({ message, className, products, focus, handleClick })
|
|
|
1694
1645
|
) })
|
|
1695
1646
|
] });
|
|
1696
1647
|
};
|
|
1697
|
-
var BotMessageWrapper = ({ children, className }) => /* @__PURE__ */ (0,
|
|
1698
|
-
/* @__PURE__ */ (0,
|
|
1648
|
+
var BotMessageWrapper = ({ children, className }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: cn("flex flex-col items-start w-full", className), children: [
|
|
1649
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { className: "w-8 h-8 mb-2", src: zImple_solotion_logo_default, alt: "Zimple Solution Logo" }),
|
|
1699
1650
|
children
|
|
1700
1651
|
] });
|
|
1701
1652
|
|
|
1702
1653
|
// src/components/quick-menus.tsx
|
|
1703
|
-
var
|
|
1654
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1704
1655
|
var QuickMenus = ({ bannerSrc, message = "welcome message", menus, handleClick }) => {
|
|
1705
|
-
return /* @__PURE__ */ (0,
|
|
1706
|
-
bannerSrc ? /* @__PURE__ */ (0,
|
|
1707
|
-
/* @__PURE__ */ (0,
|
|
1708
|
-
/* @__PURE__ */ (0,
|
|
1709
|
-
/* @__PURE__ */ (0,
|
|
1656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "w-75.5 bg-white shadow rounded-3xl overflow-hidden", children: [
|
|
1657
|
+
bannerSrc ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: bannerSrc, alt: "banner" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w-75.5 h-29.5 border-b border-gray-200" }),
|
|
1658
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "p-3 flex flex-col gap-y-3", children: [
|
|
1659
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-sm ", children: message }),
|
|
1660
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "flex gap-3 flex-wrap", children: menus == null ? void 0 : menus.map((menu) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { onClick: () => {
|
|
1710
1661
|
handleClick(menu);
|
|
1711
1662
|
}, children: menu.title }) }, menu.id)) })
|
|
1712
1663
|
] })
|
|
@@ -1714,19 +1665,19 @@ var QuickMenus = ({ bannerSrc, message = "welcome message", menus, handleClick }
|
|
|
1714
1665
|
};
|
|
1715
1666
|
|
|
1716
1667
|
// src/components/quick-menus-chip.tsx
|
|
1717
|
-
var
|
|
1668
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1718
1669
|
var QuickMenuChips = ({ menus, handleClick, className }) => {
|
|
1719
1670
|
const { chatControls } = useChatContext();
|
|
1720
|
-
return /* @__PURE__ */ (0,
|
|
1721
|
-
/* @__PURE__ */ (0,
|
|
1722
|
-
/* @__PURE__ */ (0,
|
|
1671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "relative", children: [
|
|
1672
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "absolute lg:hidden right-0 top-0 bottom-0 w-8 bg-linear-to-l from-white to-transparent pointer-events-none z-10" }),
|
|
1673
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: cn(
|
|
1723
1674
|
"flex gap-3 overflow-x-scroll scrollbar-hide pr-10",
|
|
1724
1675
|
{
|
|
1725
1676
|
"lg:flex-wrap lg:max-h-28": !chatControls.isExpanded,
|
|
1726
1677
|
"h-14": chatControls.isExpanded
|
|
1727
1678
|
},
|
|
1728
1679
|
className
|
|
1729
|
-
), children: menus == null ? void 0 : menus.map((menu) => /* @__PURE__ */ (0,
|
|
1680
|
+
), children: menus == null ? void 0 : menus.map((menu) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1730
1681
|
Button,
|
|
1731
1682
|
{
|
|
1732
1683
|
onClick: () => {
|
|
@@ -1741,21 +1692,21 @@ var QuickMenuChips = ({ menus, handleClick, className }) => {
|
|
|
1741
1692
|
var quick_menus_chip_default = QuickMenuChips;
|
|
1742
1693
|
|
|
1743
1694
|
// src/components/aizu-chat.tsx
|
|
1744
|
-
var
|
|
1695
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1745
1696
|
var LOADING_TIMEOUT = 15e3;
|
|
1746
1697
|
var AizuChat = ({ aizuClient }) => {
|
|
1747
|
-
return /* @__PURE__ */ (0,
|
|
1748
|
-
/* @__PURE__ */ (0,
|
|
1749
|
-
/* @__PURE__ */ (0,
|
|
1750
|
-
/* @__PURE__ */ (0,
|
|
1751
|
-
/* @__PURE__ */ (0,
|
|
1752
|
-
/* @__PURE__ */ (0,
|
|
1698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AizuClientProvider, { client: aizuClient, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChatProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
|
|
1699
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FloatingButton, {}),
|
|
1700
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(ChatWindow, { children: [
|
|
1701
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChatHeader, {}),
|
|
1702
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChatBody, {}),
|
|
1703
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChatFooter, {})
|
|
1753
1704
|
] })
|
|
1754
1705
|
] }) }) });
|
|
1755
1706
|
};
|
|
1756
1707
|
var FloatingButton = () => {
|
|
1757
1708
|
const { chatControls } = useChatContext();
|
|
1758
|
-
return /* @__PURE__ */ (0,
|
|
1709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1759
1710
|
"button",
|
|
1760
1711
|
{
|
|
1761
1712
|
type: "button",
|
|
@@ -1767,14 +1718,14 @@ var FloatingButton = () => {
|
|
|
1767
1718
|
}
|
|
1768
1719
|
),
|
|
1769
1720
|
"aria-label": "Toggle chat",
|
|
1770
|
-
children: /* @__PURE__ */ (0,
|
|
1721
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", { src: zImple_solotion_logo_default, alt: "Zimple Solution Logo" })
|
|
1771
1722
|
}
|
|
1772
1723
|
);
|
|
1773
1724
|
};
|
|
1774
1725
|
var ChatWindow = ({ children }) => {
|
|
1775
1726
|
const { chatControls } = useChatContext();
|
|
1776
|
-
return /* @__PURE__ */ (0,
|
|
1777
|
-
chatControls.isExpanded && /* @__PURE__ */ (0,
|
|
1727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1728
|
+
chatControls.isExpanded && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1778
1729
|
"div",
|
|
1779
1730
|
{
|
|
1780
1731
|
className: "fixed inset-0 bg-black/50 z-9998 transition-opacity duration-300",
|
|
@@ -1783,7 +1734,7 @@ var ChatWindow = ({ children }) => {
|
|
|
1783
1734
|
"aria-hidden": "true"
|
|
1784
1735
|
}
|
|
1785
1736
|
),
|
|
1786
|
-
/* @__PURE__ */ (0,
|
|
1737
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1787
1738
|
"div",
|
|
1788
1739
|
{
|
|
1789
1740
|
className: cn(
|
|
@@ -1807,42 +1758,42 @@ var ChatWindow = ({ children }) => {
|
|
|
1807
1758
|
};
|
|
1808
1759
|
var ChatHeader = () => {
|
|
1809
1760
|
const { chatControls } = useChatContext();
|
|
1810
|
-
return /* @__PURE__ */ (0,
|
|
1811
|
-
/* @__PURE__ */ (0,
|
|
1761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "flex justify-between items-center bg-white py-3 px-4", children: [
|
|
1762
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1812
1763
|
"button",
|
|
1813
1764
|
{
|
|
1814
1765
|
type: "button",
|
|
1815
1766
|
onClick: chatControls.closeChat,
|
|
1816
1767
|
className: "text-sm text-left cursor-pointer flex flex-1 lg:invisible",
|
|
1817
1768
|
children: [
|
|
1818
|
-
/* @__PURE__ */ (0,
|
|
1819
|
-
/* @__PURE__ */ (0,
|
|
1769
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconChevronLeft, {}),
|
|
1770
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "\u0E22\u0E49\u0E2D\u0E19\u0E01\u0E25\u0E31\u0E1A" })
|
|
1820
1771
|
]
|
|
1821
1772
|
}
|
|
1822
1773
|
),
|
|
1823
|
-
/* @__PURE__ */ (0,
|
|
1824
|
-
/* @__PURE__ */ (0,
|
|
1825
|
-
/* @__PURE__ */ (0,
|
|
1774
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col items-center flex-1 ", children: [
|
|
1775
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-nowrap", children: "ZIMCRAFT STORE" }),
|
|
1776
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-[10px] text-[#7C7C7C]", children: "Powered by Zimpligital" })
|
|
1826
1777
|
] }),
|
|
1827
|
-
/* @__PURE__ */ (0,
|
|
1828
|
-
/* @__PURE__ */ (0,
|
|
1778
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex-1 flex items-center justify-end gap-2 invisible lg:visible", children: [
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1829
1780
|
"button",
|
|
1830
1781
|
{
|
|
1831
1782
|
type: "button",
|
|
1832
1783
|
"aria-label": "Expand chat",
|
|
1833
1784
|
onClick: chatControls.toggleExpand,
|
|
1834
1785
|
className: "text-sm p-2.5 cursor-pointer",
|
|
1835
|
-
children: chatControls.isExpanded ? /* @__PURE__ */ (0,
|
|
1786
|
+
children: chatControls.isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconMinimize, { className: "hover:text-orange-500" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconExpand, { className: "hover:text-orange-500" })
|
|
1836
1787
|
}
|
|
1837
1788
|
),
|
|
1838
|
-
/* @__PURE__ */ (0,
|
|
1789
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1839
1790
|
"button",
|
|
1840
1791
|
{
|
|
1841
1792
|
type: "button",
|
|
1842
1793
|
"aria-label": "Close chat",
|
|
1843
1794
|
onClick: chatControls.closeChat,
|
|
1844
1795
|
className: "text-sm p-2.5 cursor-pointer",
|
|
1845
|
-
children: /* @__PURE__ */ (0,
|
|
1796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconXClose, { className: "hover:text-orange-500" })
|
|
1846
1797
|
}
|
|
1847
1798
|
)
|
|
1848
1799
|
] })
|
|
@@ -1881,10 +1832,10 @@ var ChatBody = () => {
|
|
|
1881
1832
|
if (timer) clearTimeout(timer);
|
|
1882
1833
|
};
|
|
1883
1834
|
}, [isLoading]);
|
|
1884
|
-
return /* @__PURE__ */ (0,
|
|
1885
|
-
/* @__PURE__ */ (0,
|
|
1886
|
-
/* @__PURE__ */ (0,
|
|
1887
|
-
/* @__PURE__ */ (0,
|
|
1835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("section", { className: "flex-1 overflow-y-auto relative scrollbar-hide", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: " p-4 flex flex-col gap-y-3 overflow-y-auto min-h-full", children: [
|
|
1836
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
|
|
1837
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", { className: "w-8 h-8 mb-2", src: zImple_solotion_logo_default, alt: "Zimple Solution Logo" }),
|
|
1838
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1888
1839
|
QuickMenus,
|
|
1889
1840
|
{
|
|
1890
1841
|
bannerSrc: defaultBanner,
|
|
@@ -1895,14 +1846,14 @@ var ChatBody = () => {
|
|
|
1895
1846
|
)
|
|
1896
1847
|
] }),
|
|
1897
1848
|
messagesDisplay == null ? void 0 : messagesDisplay.map((message, index) => {
|
|
1898
|
-
return /* @__PURE__ */ (0,
|
|
1849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w-full flex flex-col items-start", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MessageBubble, { message, handleClick: handleClickMenu, focus: messagesDisplay.length - 1 === index }) }, message.id);
|
|
1899
1850
|
}),
|
|
1900
|
-
isLoading && /* @__PURE__ */ (0,
|
|
1901
|
-
/* @__PURE__ */ (0,
|
|
1902
|
-
/* @__PURE__ */ (0,
|
|
1851
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
|
|
1852
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", { className: "w-8 h-8 mb-2", src: zImple_solotion_logo_default, alt: "Zimple Solution Logo" }),
|
|
1853
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Loading, { message: loadingMessage })
|
|
1903
1854
|
] }),
|
|
1904
|
-
/* @__PURE__ */ (0,
|
|
1905
|
-
displayWelcomeMessage && /* @__PURE__ */ (0,
|
|
1855
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { ref: messagesEndRef }),
|
|
1856
|
+
displayWelcomeMessage && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "mt-auto text-center text-sm text-gray-500", children: "\u0E04\u0E38\u0E13\u0E01\u0E33\u0E25\u0E31\u0E07\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E2A\u0E19\u0E17\u0E19\u0E32\u0E01\u0E31\u0E1A ZIMCRAFT AI" })
|
|
1906
1857
|
] }) });
|
|
1907
1858
|
};
|
|
1908
1859
|
var ChatFooter = () => {
|
|
@@ -1916,11 +1867,11 @@ var ChatFooter = () => {
|
|
|
1916
1867
|
isLoading,
|
|
1917
1868
|
setIsLoading
|
|
1918
1869
|
});
|
|
1919
|
-
return /* @__PURE__ */ (0,
|
|
1870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: cn(
|
|
1920
1871
|
"bg-white min:h-42.5 lg:h-auto",
|
|
1921
1872
|
{ "lg:h-auto": chatControls.isExpanded }
|
|
1922
1873
|
), children: [
|
|
1923
|
-
/* @__PURE__ */ (0,
|
|
1874
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1924
1875
|
quick_menus_chip_default,
|
|
1925
1876
|
{
|
|
1926
1877
|
handleClick: handleClickMenu,
|
|
@@ -1928,7 +1879,7 @@ var ChatFooter = () => {
|
|
|
1928
1879
|
className: "pl-4 pt-4 pb-2"
|
|
1929
1880
|
}
|
|
1930
1881
|
),
|
|
1931
|
-
/* @__PURE__ */ (0,
|
|
1882
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1932
1883
|
InputBar,
|
|
1933
1884
|
{
|
|
1934
1885
|
placeholder: "\u0E16\u0E32\u0E21\u0E04\u0E33\u0E16\u0E32\u0E21\u0E44\u0E14\u0E49\u0E40\u0E25\u0E22...",
|
|
@@ -1944,9 +1895,9 @@ var ChatFooter = () => {
|
|
|
1944
1895
|
|
|
1945
1896
|
// src/components/test-component.tsx
|
|
1946
1897
|
var import_react10 = require("react");
|
|
1947
|
-
var
|
|
1898
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1948
1899
|
var TestComponent = ({ client }) => {
|
|
1949
|
-
return /* @__PURE__ */ (0,
|
|
1900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AizuClientProvider, { client, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TestComponentContent, {}) });
|
|
1950
1901
|
};
|
|
1951
1902
|
var TestComponentContent = () => {
|
|
1952
1903
|
const {
|
|
@@ -1989,10 +1940,10 @@ var TestComponentContent = () => {
|
|
|
1989
1940
|
setResponse("\u26A0\uFE0F Request cancelled by user");
|
|
1990
1941
|
console.log("\u{1F6D1} Request cancelled");
|
|
1991
1942
|
};
|
|
1992
|
-
return /* @__PURE__ */ (0,
|
|
1993
|
-
/* @__PURE__ */ (0,
|
|
1994
|
-
/* @__PURE__ */ (0,
|
|
1995
|
-
/* @__PURE__ */ (0,
|
|
1943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "border-2 border-blue-500 p-4 rounded space-y-4", children: [
|
|
1944
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex justify-between items-center", children: [
|
|
1945
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h2", { className: "font-bold text-xl", children: "Test API Call" }),
|
|
1946
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1996
1947
|
"button",
|
|
1997
1948
|
{
|
|
1998
1949
|
type: "button",
|
|
@@ -2003,18 +1954,18 @@ var TestComponentContent = () => {
|
|
|
2003
1954
|
}
|
|
2004
1955
|
)
|
|
2005
1956
|
] }),
|
|
2006
|
-
/* @__PURE__ */ (0,
|
|
2007
|
-
/* @__PURE__ */ (0,
|
|
1957
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "text-sm space-y-1", children: [
|
|
1958
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: threadId ? "text-green-600" : "text-gray-400", children: [
|
|
2008
1959
|
"\u{1F517} Thread ID: ",
|
|
2009
1960
|
threadId || "(waiting for first message)"
|
|
2010
1961
|
] }),
|
|
2011
|
-
/* @__PURE__ */ (0,
|
|
1962
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: resourceId ? "text-green-600" : "text-gray-400", children: [
|
|
2012
1963
|
"\u{1F4E6} Resource ID: ",
|
|
2013
1964
|
resourceId || "(waiting for first message)"
|
|
2014
1965
|
] })
|
|
2015
1966
|
] }),
|
|
2016
|
-
/* @__PURE__ */ (0,
|
|
2017
|
-
/* @__PURE__ */ (0,
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex gap-2", children: [
|
|
1968
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2018
1969
|
"input",
|
|
2019
1970
|
{
|
|
2020
1971
|
type: "text",
|
|
@@ -2026,7 +1977,7 @@ var TestComponentContent = () => {
|
|
|
2026
1977
|
disabled: loading
|
|
2027
1978
|
}
|
|
2028
1979
|
),
|
|
2029
|
-
loading ? /* @__PURE__ */ (0,
|
|
1980
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2030
1981
|
"button",
|
|
2031
1982
|
{
|
|
2032
1983
|
type: "button",
|
|
@@ -2034,7 +1985,7 @@ var TestComponentContent = () => {
|
|
|
2034
1985
|
className: "bg-red-500 text-white px-4 py-2 rounded hover:bg-red-600 min-w-[100px]",
|
|
2035
1986
|
children: "\u23F9 Cancel"
|
|
2036
1987
|
}
|
|
2037
|
-
) : /* @__PURE__ */ (0,
|
|
1988
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2038
1989
|
"button",
|
|
2039
1990
|
{
|
|
2040
1991
|
type: "button",
|
|
@@ -2045,13 +1996,13 @@ var TestComponentContent = () => {
|
|
|
2045
1996
|
}
|
|
2046
1997
|
)
|
|
2047
1998
|
] }),
|
|
2048
|
-
response && /* @__PURE__ */ (0,
|
|
2049
|
-
/* @__PURE__ */ (0,
|
|
2050
|
-
/* @__PURE__ */ (0,
|
|
1999
|
+
response && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "p-3 bg-gray-100 rounded", children: [
|
|
2000
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("strong", { className: "text-gray-700", children: "Response:" }),
|
|
2001
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-1 whitespace-pre-wrap text-gray-900", children: response })
|
|
2051
2002
|
] }),
|
|
2052
|
-
!threadId && /* @__PURE__ */ (0,
|
|
2003
|
+
!threadId && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "text-xs text-gray-500 border-t pt-2 mt-2", children: [
|
|
2053
2004
|
"\u{1F4A1} ",
|
|
2054
|
-
/* @__PURE__ */ (0,
|
|
2005
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("strong", { children: "Tip:" }),
|
|
2055
2006
|
" Send your first message to start a conversation. The thread ID will be saved and persist across page refreshes."
|
|
2056
2007
|
] })
|
|
2057
2008
|
] });
|