@akropolys/kiku 1.7.11 → 1.7.12
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 +512 -503
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +512 -503
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +8 -6
- package/dist/styles.css.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -364,14 +364,45 @@ function renderMarkdown(content, streaming = false) {
|
|
|
364
364
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: elements });
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
+
// src/utils/icons.tsx
|
|
368
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
369
|
+
var ArrowUpIcon = () => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
370
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "m5 12 7-7 7 7" }),
|
|
371
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M12 19V5" })
|
|
372
|
+
] });
|
|
373
|
+
|
|
374
|
+
// src/utils/theme.ts
|
|
375
|
+
function resolveTheme(theme) {
|
|
376
|
+
if (typeof theme === "string") {
|
|
377
|
+
return { themeAttr: theme, vars: void 0 };
|
|
378
|
+
}
|
|
379
|
+
if (!theme) {
|
|
380
|
+
return { themeAttr: void 0, vars: void 0 };
|
|
381
|
+
}
|
|
382
|
+
const vars = {};
|
|
383
|
+
if (theme.primaryColor) vars["--hsk-primary"] = theme.primaryColor;
|
|
384
|
+
if (theme.backgroundColor) {
|
|
385
|
+
vars["--hsk-bg"] = theme.backgroundColor;
|
|
386
|
+
vars["--hsk-chat-bg"] = theme.backgroundColor;
|
|
387
|
+
}
|
|
388
|
+
if (theme.textColor) {
|
|
389
|
+
vars["--hsk-text"] = theme.textColor;
|
|
390
|
+
vars["--hsk-chat-text"] = theme.textColor;
|
|
391
|
+
}
|
|
392
|
+
if (theme.fontFamily) vars["--hsk-font"] = theme.fontFamily;
|
|
393
|
+
if (theme.fontSize) vars["--hsk-font-size"] = theme.fontSize;
|
|
394
|
+
if (theme.borderRadius) vars["--hsk-border-radius"] = theme.borderRadius;
|
|
395
|
+
return { themeAttr: void 0, vars };
|
|
396
|
+
}
|
|
397
|
+
|
|
367
398
|
// src/components/VoiceButton.tsx
|
|
368
399
|
var import_react2 = require("react");
|
|
369
|
-
var
|
|
370
|
-
var MicIcon = ({ active }) => /* @__PURE__ */ (0,
|
|
371
|
-
/* @__PURE__ */ (0,
|
|
372
|
-
/* @__PURE__ */ (0,
|
|
373
|
-
/* @__PURE__ */ (0,
|
|
374
|
-
/* @__PURE__ */ (0,
|
|
400
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
401
|
+
var MicIcon = ({ active }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
402
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("rect", { x: "9", y: "2", width: "6", height: "11", rx: "3", fill: active ? "currentColor" : "none" }),
|
|
403
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M5 10a7 7 0 0 0 14 0" }),
|
|
404
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
|
|
405
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "8", y1: "23", x2: "16", y2: "23" })
|
|
375
406
|
] });
|
|
376
407
|
function VoiceButton({
|
|
377
408
|
onTranscript,
|
|
@@ -412,7 +443,7 @@ function VoiceButton({
|
|
|
412
443
|
setListening(false);
|
|
413
444
|
}, []);
|
|
414
445
|
if (!isSupported) return null;
|
|
415
|
-
return /* @__PURE__ */ (0,
|
|
446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
416
447
|
"button",
|
|
417
448
|
{
|
|
418
449
|
type: "button",
|
|
@@ -422,8 +453,8 @@ function VoiceButton({
|
|
|
422
453
|
title: listening ? "Stop listening" : "Speak your search",
|
|
423
454
|
"aria-label": listening ? "Stop voice input" : "Start voice input",
|
|
424
455
|
children: [
|
|
425
|
-
/* @__PURE__ */ (0,
|
|
426
|
-
listening && /* @__PURE__ */ (0,
|
|
456
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MicIcon, { active: listening }),
|
|
457
|
+
listening && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "kiku-voice-ripple", "aria-hidden": "true" })
|
|
427
458
|
]
|
|
428
459
|
}
|
|
429
460
|
);
|
|
@@ -432,12 +463,12 @@ function VoiceButton({
|
|
|
432
463
|
// src/components/VisualSearch.tsx
|
|
433
464
|
var import_react3 = require("react");
|
|
434
465
|
var import_sdk2 = require("@akropolys/sdk");
|
|
435
|
-
var
|
|
436
|
-
var CameraIcon = () => /* @__PURE__ */ (0,
|
|
437
|
-
/* @__PURE__ */ (0,
|
|
438
|
-
/* @__PURE__ */ (0,
|
|
466
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
467
|
+
var CameraIcon = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
468
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" }),
|
|
469
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "13", r: "4" })
|
|
439
470
|
] });
|
|
440
|
-
var SpinnerIcon = () => /* @__PURE__ */ (0,
|
|
471
|
+
var SpinnerIcon = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "kiku-vs-spin", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
|
|
441
472
|
function fileToBase64(file) {
|
|
442
473
|
return new Promise((resolve, reject) => {
|
|
443
474
|
const reader = new FileReader();
|
|
@@ -470,7 +501,7 @@ function VisualSearch({
|
|
|
470
501
|
if (inputRef.current) inputRef.current.value = "";
|
|
471
502
|
}
|
|
472
503
|
};
|
|
473
|
-
return /* @__PURE__ */ (0,
|
|
504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
474
505
|
"label",
|
|
475
506
|
{
|
|
476
507
|
className: `kiku-vs-btn${loading ? " kiku-vs-btn--loading" : ""} ${className}`,
|
|
@@ -478,7 +509,7 @@ function VisualSearch({
|
|
|
478
509
|
"aria-label": "Search by uploading a photo",
|
|
479
510
|
style: { cursor: disabled || loading ? "not-allowed" : "pointer" },
|
|
480
511
|
children: [
|
|
481
|
-
/* @__PURE__ */ (0,
|
|
512
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
482
513
|
"input",
|
|
483
514
|
{
|
|
484
515
|
ref: inputRef,
|
|
@@ -490,36 +521,32 @@ function VisualSearch({
|
|
|
490
521
|
hidden: true
|
|
491
522
|
}
|
|
492
523
|
),
|
|
493
|
-
loading ? /* @__PURE__ */ (0,
|
|
524
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SpinnerIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CameraIcon, {})
|
|
494
525
|
]
|
|
495
526
|
}
|
|
496
527
|
);
|
|
497
528
|
}
|
|
498
529
|
|
|
499
530
|
// src/components/ChatWidget.tsx
|
|
500
|
-
var
|
|
501
|
-
var SparkleIcon = () => /* @__PURE__ */ (0,
|
|
502
|
-
var ArrowUpIcon = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
503
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "m5 12 7-7 7 7" }),
|
|
504
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 19V5" })
|
|
505
|
-
] });
|
|
531
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
532
|
+
var SparkleIcon = () => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z" }) });
|
|
506
533
|
function SourceCard({
|
|
507
534
|
source,
|
|
508
535
|
defaultCurrency,
|
|
509
536
|
onSelect,
|
|
510
537
|
isReferenced
|
|
511
538
|
}) {
|
|
512
|
-
return /* @__PURE__ */ (0,
|
|
539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
513
540
|
"div",
|
|
514
541
|
{
|
|
515
542
|
className: cn("hsk-source-card", isReferenced && "hsk-source-card--referenced"),
|
|
516
543
|
onClick: () => onSelect?.(source),
|
|
517
544
|
children: [
|
|
518
|
-
source.image && /* @__PURE__ */ (0,
|
|
519
|
-
/* @__PURE__ */ (0,
|
|
520
|
-
isReferenced && /* @__PURE__ */ (0,
|
|
521
|
-
/* @__PURE__ */ (0,
|
|
522
|
-
source.price && /* @__PURE__ */ (0,
|
|
545
|
+
source.image && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: source.image, alt: source.name, className: "hsk-source-img" }),
|
|
546
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { flex: 1, minWidth: 0, position: "relative" }, children: [
|
|
547
|
+
isReferenced && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-cb-source-ref-badge", title: "Featured in response", style: { top: "0", right: "0" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SparkleIcon, {}) }),
|
|
548
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-source-name", style: { paddingRight: isReferenced ? "20px" : void 0 }, children: source.name }),
|
|
549
|
+
source.price && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-source-price", children: [
|
|
523
550
|
source.currency ?? defaultCurrency,
|
|
524
551
|
" ",
|
|
525
552
|
source.price
|
|
@@ -656,42 +683,36 @@ I couldn't find any matching products in the store.`;
|
|
|
656
683
|
};
|
|
657
684
|
setChatHistory((prev) => [...prev, userMsg, assistantMsg]);
|
|
658
685
|
};
|
|
659
|
-
const customStyles =
|
|
660
|
-
|
|
661
|
-
...theme?.backgroundColor && { "--hsk-bg": theme.backgroundColor },
|
|
662
|
-
...theme?.textColor && { "--hsk-text": theme.textColor },
|
|
663
|
-
...theme?.fontFamily && { "--hsk-font": theme.fontFamily },
|
|
664
|
-
...theme?.borderRadius && { "--hsk-border-radius": theme.borderRadius }
|
|
665
|
-
};
|
|
666
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
686
|
+
const { vars: customStyles } = resolveTheme(theme);
|
|
687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
667
688
|
"div",
|
|
668
689
|
{
|
|
669
690
|
className: cn("hsk-chat-widget", classNames.root, className),
|
|
670
691
|
style: customStyles,
|
|
671
692
|
children: [
|
|
672
|
-
/* @__PURE__ */ (0,
|
|
673
|
-
/* @__PURE__ */ (0,
|
|
674
|
-
/* @__PURE__ */ (0,
|
|
675
|
-
/* @__PURE__ */ (0,
|
|
676
|
-
chatHistory.length > 0 && /* @__PURE__ */ (0,
|
|
693
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: cn("hsk-chat-header", classNames.header), children: [
|
|
694
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-chat-header-icon", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SparkleIcon, {}) }),
|
|
695
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-chat-title", children: title }),
|
|
696
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-chat-badge", children: "AI" }),
|
|
697
|
+
chatHistory.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { className: "hsk-chat-reset", onClick: reset, style: { marginLeft: "auto" }, children: "Clear" })
|
|
677
698
|
] }),
|
|
678
|
-
/* @__PURE__ */ (0,
|
|
679
|
-
chatHistory.length === 0 ? /* @__PURE__ */ (0,
|
|
680
|
-
/* @__PURE__ */ (0,
|
|
681
|
-
/* @__PURE__ */ (0,
|
|
682
|
-
/* @__PURE__ */ (0,
|
|
683
|
-
] }) : chatHistory.map((msg, idx) => /* @__PURE__ */ (0,
|
|
684
|
-
/* @__PURE__ */ (0,
|
|
685
|
-
/* @__PURE__ */ (0,
|
|
686
|
-
/* @__PURE__ */ (0,
|
|
687
|
-
msg.imagePreview && /* @__PURE__ */ (0,
|
|
699
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-chat-messages", children: [
|
|
700
|
+
chatHistory.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-chat-empty", children: [
|
|
701
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-chat-empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SparkleIcon, {}) }),
|
|
702
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: emptyStateText }),
|
|
703
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-chat-empty-suggestions", children: emptyStateSuggestions })
|
|
704
|
+
] }) : chatHistory.map((msg, idx) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
705
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: `hsk-msg-row ${msg.role}`, children: [
|
|
706
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: cn("hsk-msg-avatar", msg.role === "assistant" ? "ai" : "user"), children: msg.role === "assistant" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SparkleIcon, {}) : "U" }),
|
|
707
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: cn("hsk-msg-bubble", msg.role, classNames.messageBubble), children: [
|
|
708
|
+
msg.imagePreview && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "kiku-vs-preview-bubble", style: { marginBottom: "8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: msg.imagePreview, alt: "Uploaded Preview", className: "kiku-vs-preview-bubble-img", style: { maxWidth: "200px", borderRadius: "8px" } }) }),
|
|
688
709
|
renderMarkdown(msg.content),
|
|
689
|
-
msg.styleDNA && /* @__PURE__ */ (0,
|
|
690
|
-
chatHistory[idx - 1]?.imagePreview && /* @__PURE__ */ (0,
|
|
691
|
-
/* @__PURE__ */ (0,
|
|
692
|
-
/* @__PURE__ */ (0,
|
|
693
|
-
/* @__PURE__ */ (0,
|
|
694
|
-
msg.styleDNA.style_tags && msg.styleDNA.style_tags.length > 0 && /* @__PURE__ */ (0,
|
|
710
|
+
msg.styleDNA && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "kiku-vs-preview-banner", style: { marginTop: "10px" }, children: [
|
|
711
|
+
chatHistory[idx - 1]?.imagePreview && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: chatHistory[idx - 1].imagePreview, alt: "Visual Search Input", className: "kiku-vs-preview-img" }),
|
|
712
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "kiku-vs-preview-info", children: [
|
|
713
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "kiku-vs-preview-label", children: "Visual Match Palette" }),
|
|
714
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "kiku-vs-preview-palette", children: msg.styleDNA.color_palette || "Detected Style DNA" }),
|
|
715
|
+
msg.styleDNA.style_tags && msg.styleDNA.style_tags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "kiku-style-tags", children: msg.styleDNA.style_tags.map((tag, ti) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "kiku-style-tag", children: [
|
|
695
716
|
"#",
|
|
696
717
|
tag
|
|
697
718
|
] }, ti)) })
|
|
@@ -699,13 +720,13 @@ I couldn't find any matching products in the store.`;
|
|
|
699
720
|
] })
|
|
700
721
|
] })
|
|
701
722
|
] }),
|
|
702
|
-
msg.role === "assistant" && msg.visualSources && msg.visualSources.length > 0 && /* @__PURE__ */ (0,
|
|
723
|
+
msg.role === "assistant" && msg.visualSources && msg.visualSources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources-container", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources", children: msg.visualSources.map((src, si) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SourceCard, { source: src, defaultCurrency, onSelect: onSelectSource }, si)) }) }),
|
|
703
724
|
msg.role === "assistant" && idx === chatHistory.length - 1 && !msg.visualSources && sources.length > 0 && (() => {
|
|
704
725
|
const isStreamingActive = chatLoading || streaming;
|
|
705
726
|
if (isStreamingActive) {
|
|
706
|
-
return /* @__PURE__ */ (0,
|
|
727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources-container", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources", children: sources.map((src, si) => {
|
|
707
728
|
const isReferenced = !!(src.id && referencedIds.includes(src.id));
|
|
708
|
-
return /* @__PURE__ */ (0,
|
|
729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
709
730
|
SourceCard,
|
|
710
731
|
{
|
|
711
732
|
source: src,
|
|
@@ -719,10 +740,10 @@ I couldn't find any matching products in the store.`;
|
|
|
719
740
|
}
|
|
720
741
|
const featured = sources.filter((src) => src.id && referencedIds.includes(src.id));
|
|
721
742
|
const general = referencedIds.length > 0 ? [] : sources.filter((src) => !src.id || !referencedIds.includes(src.id));
|
|
722
|
-
return /* @__PURE__ */ (0,
|
|
723
|
-
featured.length > 0 && /* @__PURE__ */ (0,
|
|
724
|
-
/* @__PURE__ */ (0,
|
|
725
|
-
/* @__PURE__ */ (0,
|
|
743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-sources-container", children: [
|
|
744
|
+
featured.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-sources-group", style: { marginBottom: "10px" }, children: [
|
|
745
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources-group-title", children: "\u2B50 Featured in response" }),
|
|
746
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources", children: featured.map((src, si) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
726
747
|
SourceCard,
|
|
727
748
|
{
|
|
728
749
|
source: src,
|
|
@@ -733,9 +754,9 @@ I couldn't find any matching products in the store.`;
|
|
|
733
754
|
`feat-${si}`
|
|
734
755
|
)) })
|
|
735
756
|
] }),
|
|
736
|
-
general.length > 0 && /* @__PURE__ */ (0,
|
|
737
|
-
featured.length > 0 && /* @__PURE__ */ (0,
|
|
738
|
-
/* @__PURE__ */ (0,
|
|
757
|
+
general.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-sources-group", children: [
|
|
758
|
+
featured.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources-group-title", children: "All matches" }),
|
|
759
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources", children: general.map((src, si) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
739
760
|
SourceCard,
|
|
740
761
|
{
|
|
741
762
|
source: src,
|
|
@@ -749,21 +770,21 @@ I couldn't find any matching products in the store.`;
|
|
|
749
770
|
] });
|
|
750
771
|
})()
|
|
751
772
|
] }, idx)),
|
|
752
|
-
loading && /* @__PURE__ */ (0,
|
|
753
|
-
/* @__PURE__ */ (0,
|
|
754
|
-
/* @__PURE__ */ (0,
|
|
755
|
-
/* @__PURE__ */ (0,
|
|
756
|
-
/* @__PURE__ */ (0,
|
|
757
|
-
/* @__PURE__ */ (0,
|
|
773
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-msg-row", children: [
|
|
774
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-msg-avatar ai", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SparkleIcon, {}) }),
|
|
775
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-pending", role: "status", "aria-live": "polite", children: [
|
|
776
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-pending-glyph", children: [
|
|
777
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-ring" }),
|
|
778
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-dot" })
|
|
758
779
|
] }),
|
|
759
|
-
/* @__PURE__ */ (0,
|
|
760
|
-
/* @__PURE__ */ (0,
|
|
761
|
-
/* @__PURE__ */ (0,
|
|
762
|
-
/* @__PURE__ */ (0,
|
|
780
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-pending-text", children: [
|
|
781
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-step step-1", children: "Searching catalog" }),
|
|
782
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-step step-2", children: "Reasoning" }),
|
|
783
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-step step-3", children: "Composing" })
|
|
763
784
|
] })
|
|
764
785
|
] })
|
|
765
786
|
] }),
|
|
766
|
-
error && /* @__PURE__ */ (0,
|
|
787
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-chat-error", children: (() => {
|
|
767
788
|
try {
|
|
768
789
|
const parsed = JSON.parse(error);
|
|
769
790
|
return parsed.error || parsed.message || error;
|
|
@@ -771,10 +792,10 @@ I couldn't find any matching products in the store.`;
|
|
|
771
792
|
return error;
|
|
772
793
|
}
|
|
773
794
|
})() }),
|
|
774
|
-
/* @__PURE__ */ (0,
|
|
795
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ref: bottomRef })
|
|
775
796
|
] }),
|
|
776
|
-
/* @__PURE__ */ (0,
|
|
777
|
-
enableVision && /* @__PURE__ */ (0,
|
|
797
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-chat-input-area", style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
798
|
+
enableVision && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
778
799
|
VisualSearch,
|
|
779
800
|
{
|
|
780
801
|
onResults: handleVisualResults,
|
|
@@ -783,7 +804,7 @@ I couldn't find any matching products in the store.`;
|
|
|
783
804
|
disabled: loading
|
|
784
805
|
}
|
|
785
806
|
),
|
|
786
|
-
/* @__PURE__ */ (0,
|
|
807
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
787
808
|
"textarea",
|
|
788
809
|
{
|
|
789
810
|
ref: textareaRef,
|
|
@@ -797,7 +818,7 @@ I couldn't find any matching products in the store.`;
|
|
|
797
818
|
style: { flex: 1 }
|
|
798
819
|
}
|
|
799
820
|
),
|
|
800
|
-
enableVoice && /* @__PURE__ */ (0,
|
|
821
|
+
enableVoice && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
801
822
|
VoiceButton,
|
|
802
823
|
{
|
|
803
824
|
onTranscript: (text) => {
|
|
@@ -809,14 +830,14 @@ I couldn't find any matching products in the store.`;
|
|
|
809
830
|
disabled: loading
|
|
810
831
|
}
|
|
811
832
|
),
|
|
812
|
-
/* @__PURE__ */ (0,
|
|
833
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
813
834
|
"button",
|
|
814
835
|
{
|
|
815
836
|
className: "hsk-chat-send",
|
|
816
837
|
onClick: handleSend,
|
|
817
838
|
disabled: !input.trim() || loading,
|
|
818
839
|
"aria-label": "Send message",
|
|
819
|
-
children: /* @__PURE__ */ (0,
|
|
840
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ArrowUpIcon, {})
|
|
820
841
|
}
|
|
821
842
|
)
|
|
822
843
|
] })
|
|
@@ -833,7 +854,7 @@ var import_sdk6 = require("@akropolys/sdk");
|
|
|
833
854
|
|
|
834
855
|
// src/components/ComparisonMatrix.tsx
|
|
835
856
|
var import_sdk4 = require("@akropolys/sdk");
|
|
836
|
-
var
|
|
857
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
837
858
|
function normalizeKey(key) {
|
|
838
859
|
let s = key.replace(/[_-]+/g, " ");
|
|
839
860
|
s = s.replace(/([a-z])([A-Z])/g, "$1 $2");
|
|
@@ -995,9 +1016,9 @@ function buildRows(products, displayConfig, defaultCurrency = "KES") {
|
|
|
995
1016
|
}
|
|
996
1017
|
function ImageCell({ value, name }) {
|
|
997
1018
|
if (!value) {
|
|
998
|
-
return /* @__PURE__ */ (0,
|
|
1019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { fontSize: 28, textAlign: "center" }, children: "\u{1F4E6}" });
|
|
999
1020
|
}
|
|
1000
|
-
return /* @__PURE__ */ (0,
|
|
1021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1001
1022
|
"img",
|
|
1002
1023
|
{
|
|
1003
1024
|
src: value,
|
|
@@ -1014,10 +1035,10 @@ function ImageCell({ value, name }) {
|
|
|
1014
1035
|
);
|
|
1015
1036
|
}
|
|
1016
1037
|
function AvailabilityCell({ value }) {
|
|
1017
|
-
if (!value) return /* @__PURE__ */ (0,
|
|
1038
|
+
if (!value) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { color: "#9ca3af" }, children: "\u2014" });
|
|
1018
1039
|
const inStock = /in.?stock/i.test(value);
|
|
1019
|
-
return /* @__PURE__ */ (0,
|
|
1020
|
-
/* @__PURE__ */ (0,
|
|
1040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 13, color: "var(--hsk-text, #111827)" }, children: [
|
|
1041
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: {
|
|
1021
1042
|
width: 8,
|
|
1022
1043
|
height: 8,
|
|
1023
1044
|
borderRadius: "50%",
|
|
@@ -1056,7 +1077,7 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
|
|
|
1056
1077
|
display: "flex",
|
|
1057
1078
|
alignItems: "center"
|
|
1058
1079
|
};
|
|
1059
|
-
return /* @__PURE__ */ (0,
|
|
1080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1060
1081
|
"div",
|
|
1061
1082
|
{
|
|
1062
1083
|
className: "hsk-compare-matrix",
|
|
@@ -1069,11 +1090,11 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
|
|
|
1069
1090
|
fontSize: 13
|
|
1070
1091
|
},
|
|
1071
1092
|
children: [
|
|
1072
|
-
/* @__PURE__ */ (0,
|
|
1073
|
-
/* @__PURE__ */ (0,
|
|
1093
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "grid", gridTemplateColumns: colTemplate, background: "var(--hsk-surface2, #f9fafb)", borderBottom: "2px solid var(--hsk-border, rgba(0,0,0,0.09))" }, children: [
|
|
1094
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { ...labelStyle, borderBottom: "none", color: "var(--hsk-text, #111)", fontSize: 12 }, children: "Feature" }),
|
|
1074
1095
|
products.map((p, i) => {
|
|
1075
1096
|
const { title } = (0, import_sdk4.resolveDisplayFields)(p.fields || p, displayConfig);
|
|
1076
|
-
return /* @__PURE__ */ (0,
|
|
1097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1077
1098
|
"a",
|
|
1078
1099
|
{
|
|
1079
1100
|
href: p.url || "#",
|
|
@@ -1096,7 +1117,7 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
|
|
|
1096
1117
|
);
|
|
1097
1118
|
})
|
|
1098
1119
|
] }),
|
|
1099
|
-
rows.map((row, rowIdx) => /* @__PURE__ */ (0,
|
|
1120
|
+
rows.map((row, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1100
1121
|
"div",
|
|
1101
1122
|
{
|
|
1102
1123
|
style: {
|
|
@@ -1105,18 +1126,18 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
|
|
|
1105
1126
|
background: rowIdx % 2 === 1 ? "var(--hsk-surface2, rgba(0,0,0,0.015))" : "transparent"
|
|
1106
1127
|
},
|
|
1107
1128
|
children: [
|
|
1108
|
-
/* @__PURE__ */ (0,
|
|
1129
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: labelStyle, children: row.label }),
|
|
1109
1130
|
products.map((p, i) => {
|
|
1110
1131
|
const val = row.values[i];
|
|
1111
1132
|
const isBest = row.bestIdx === i && row.values.filter(Boolean).length > 1;
|
|
1112
1133
|
const { title } = (0, import_sdk4.resolveDisplayFields)(p.fields || p, displayConfig);
|
|
1113
1134
|
if (row.type === "image") {
|
|
1114
|
-
return /* @__PURE__ */ (0,
|
|
1135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { ...cellBase, justifyContent: "center", padding: "12px", borderLeft: i > 0 ? "1px solid var(--hsk-border, rgba(0,0,0,0.07))" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ImageCell, { value: val, name: title }) }, i);
|
|
1115
1136
|
}
|
|
1116
1137
|
if (row.type === "availability") {
|
|
1117
|
-
return /* @__PURE__ */ (0,
|
|
1138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { ...cellBase, borderLeft: i > 0 ? "1px solid var(--hsk-border, rgba(0,0,0,0.07))" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AvailabilityCell, { value: val }) }, i);
|
|
1118
1139
|
}
|
|
1119
|
-
return /* @__PURE__ */ (0,
|
|
1140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1120
1141
|
"div",
|
|
1121
1142
|
{
|
|
1122
1143
|
style: {
|
|
@@ -1125,7 +1146,7 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
|
|
|
1125
1146
|
color: isBest ? "var(--hsk-primary, #ea580c)" : row.type === "price" ? "var(--hsk-text, #374151)" : "var(--hsk-text, #111827)",
|
|
1126
1147
|
borderLeft: i > 0 ? "1px solid var(--hsk-border, rgba(0,0,0,0.07))" : "none"
|
|
1127
1148
|
},
|
|
1128
|
-
children: val ?? /* @__PURE__ */ (0,
|
|
1149
|
+
children: val ?? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { color: "#9ca3af" }, children: "\u2014" })
|
|
1129
1150
|
},
|
|
1130
1151
|
i
|
|
1131
1152
|
);
|
|
@@ -1141,7 +1162,7 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
|
|
|
1141
1162
|
|
|
1142
1163
|
// src/components/MarkupEditor.tsx
|
|
1143
1164
|
var import_react5 = require("react");
|
|
1144
|
-
var
|
|
1165
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1145
1166
|
var COLORS = ["#111111", "#ff5a5a", "#ffb300", "#22c55e", "#06b6d4", "#d946ef", "#9ca3af"];
|
|
1146
1167
|
var MAX_EXPORT_DIM = 1280;
|
|
1147
1168
|
function MarkupEditor({ src, onCancel, onSend }) {
|
|
@@ -1264,13 +1285,13 @@ function MarkupEditor({ src, onCancel, onSend }) {
|
|
|
1264
1285
|
}
|
|
1265
1286
|
};
|
|
1266
1287
|
const hasMarks = actions.length > 0;
|
|
1267
|
-
return /* @__PURE__ */ (0,
|
|
1268
|
-
/* @__PURE__ */ (0,
|
|
1269
|
-
/* @__PURE__ */ (0,
|
|
1270
|
-
/* @__PURE__ */ (0,
|
|
1288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup", role: "dialog", "aria-label": "Mark up image", children: [
|
|
1289
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-head", children: [
|
|
1290
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-markup-title", children: "Mark where you want the change" }),
|
|
1291
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-markup-cancel", onClick: onCancel, children: "Cancel" })
|
|
1271
1292
|
] }),
|
|
1272
|
-
/* @__PURE__ */ (0,
|
|
1273
|
-
/* @__PURE__ */ (0,
|
|
1293
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-stage", children: loadError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-error", children: "This image can't be edited here." }) : !img ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-loading", children: "Loading image\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-canvas-wrap", children: [
|
|
1294
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1274
1295
|
"canvas",
|
|
1275
1296
|
{
|
|
1276
1297
|
ref: canvasRef,
|
|
@@ -1283,7 +1304,7 @@ function MarkupEditor({ src, onCancel, onSend }) {
|
|
|
1283
1304
|
onPointerLeave: onPointerUp
|
|
1284
1305
|
}
|
|
1285
1306
|
),
|
|
1286
|
-
pendingText && canvasRef.current && /* @__PURE__ */ (0,
|
|
1307
|
+
pendingText && canvasRef.current && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1287
1308
|
"input",
|
|
1288
1309
|
{
|
|
1289
1310
|
ref: textInputRef,
|
|
@@ -1307,8 +1328,8 @@ function MarkupEditor({ src, onCancel, onSend }) {
|
|
|
1307
1328
|
}
|
|
1308
1329
|
)
|
|
1309
1330
|
] }) }),
|
|
1310
|
-
/* @__PURE__ */ (0,
|
|
1311
|
-
/* @__PURE__ */ (0,
|
|
1331
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-tools", children: [
|
|
1332
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-colors", children: COLORS.map((c) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1312
1333
|
"button",
|
|
1313
1334
|
{
|
|
1314
1335
|
className: `hsk-markup-color${color === c ? " hsk-markup-color--on" : ""}`,
|
|
@@ -1321,16 +1342,16 @@ function MarkupEditor({ src, onCancel, onSend }) {
|
|
|
1321
1342
|
},
|
|
1322
1343
|
c
|
|
1323
1344
|
)) }),
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1325
|
-
/* @__PURE__ */ (0,
|
|
1326
|
-
/* @__PURE__ */ (0,
|
|
1327
|
-
/* @__PURE__ */ (0,
|
|
1328
|
-
/* @__PURE__ */ (0,
|
|
1329
|
-
/* @__PURE__ */ (0,
|
|
1345
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-actions", children: [
|
|
1346
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: `hsk-markup-tool${tool === "pen" ? " hsk-markup-tool--on" : ""}`, onClick: () => setTool("pen"), children: "Sketch" }),
|
|
1347
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: `hsk-markup-tool${tool === "text" ? " hsk-markup-tool--on" : ""}`, onClick: () => setTool("text"), children: "Text" }),
|
|
1348
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: `hsk-markup-tool${tool === "eraser" ? " hsk-markup-tool--on" : ""}`, onClick: () => setTool("eraser"), children: "Eraser" }),
|
|
1349
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-markup-tool", onClick: () => setActions((prev) => prev.slice(0, -1)), disabled: !hasMarks, children: "Undo" }),
|
|
1350
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-markup-tool", onClick: () => setActions([]), disabled: !hasMarks, children: "Clear" })
|
|
1330
1351
|
] })
|
|
1331
1352
|
] }),
|
|
1332
|
-
/* @__PURE__ */ (0,
|
|
1333
|
-
/* @__PURE__ */ (0,
|
|
1353
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-send", children: [
|
|
1354
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1334
1355
|
"input",
|
|
1335
1356
|
{
|
|
1336
1357
|
className: "hsk-markup-instruction",
|
|
@@ -1342,7 +1363,7 @@ function MarkupEditor({ src, onCancel, onSend }) {
|
|
|
1342
1363
|
}
|
|
1343
1364
|
}
|
|
1344
1365
|
),
|
|
1345
|
-
/* @__PURE__ */ (0,
|
|
1366
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1346
1367
|
"button",
|
|
1347
1368
|
{
|
|
1348
1369
|
className: "hsk-markup-go",
|
|
@@ -1352,13 +1373,13 @@ function MarkupEditor({ src, onCancel, onSend }) {
|
|
|
1352
1373
|
}
|
|
1353
1374
|
)
|
|
1354
1375
|
] }),
|
|
1355
|
-
exportError && /* @__PURE__ */ (0,
|
|
1376
|
+
exportError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-error", children: "Couldn't process this image \u2014 try a newer visualization." })
|
|
1356
1377
|
] });
|
|
1357
1378
|
}
|
|
1358
1379
|
|
|
1359
1380
|
// src/components/KikuButton.tsx
|
|
1360
|
-
var
|
|
1361
|
-
var KikuIcon = ({ className, size = 18 }) => /* @__PURE__ */ (0,
|
|
1381
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1382
|
+
var KikuIcon = ({ className, size = 18 }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1362
1383
|
"svg",
|
|
1363
1384
|
{
|
|
1364
1385
|
className: cn("hsk-brand-mark", className),
|
|
@@ -1367,52 +1388,48 @@ var KikuIcon = ({ className, size = 18 }) => /* @__PURE__ */ (0, import_jsx_runt
|
|
|
1367
1388
|
viewBox: "0 0 100 100",
|
|
1368
1389
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1369
1390
|
"aria-label": "kiku",
|
|
1370
|
-
children: /* @__PURE__ */ (0,
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
1391
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("g", { transform: "translate(22.7 19) scale(0.62)", fill: "currentColor", fillRule: "evenodd", children: [
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M39.4 10.4 Q44 0 48.6 10.4 L86.1 95.8 Q88 100 83.4 100 L4.6 100 Q0 100 1.9 95.8 Z M24 100 L24 65 Q24 60 27.4 56.3 Q44 38 60.6 56.3 Q64 60 64 65 L64 100 Z" }),
|
|
1393
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "55", cy: "82", r: "3.4" })
|
|
1373
1394
|
] })
|
|
1374
1395
|
}
|
|
1375
1396
|
);
|
|
1376
1397
|
var SparkleIcon2 = KikuIcon;
|
|
1377
|
-
var
|
|
1378
|
-
|
|
1379
|
-
/* @__PURE__ */ (0,
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
var ExternalIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1383
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
1384
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("polyline", { points: "15 3 21 3 21 9" }),
|
|
1385
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
1398
|
+
var StopIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("rect", { x: "5", y: "5", width: "14", height: "14", rx: "2" }) });
|
|
1399
|
+
var ExternalIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1400
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
1401
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("polyline", { points: "15 3 21 3 21 9" }),
|
|
1402
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
1386
1403
|
] });
|
|
1387
|
-
var ContinueIcon = () => /* @__PURE__ */ (0,
|
|
1388
|
-
var CloseIcon = () => /* @__PURE__ */ (0,
|
|
1389
|
-
/* @__PURE__ */ (0,
|
|
1390
|
-
/* @__PURE__ */ (0,
|
|
1404
|
+
var ContinueIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M8 5v14l11-7z" }) });
|
|
1405
|
+
var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1406
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1407
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1391
1408
|
] });
|
|
1392
|
-
var ChevronRightIcon = () => /* @__PURE__ */ (0,
|
|
1393
|
-
var HistoryIcon = () => /* @__PURE__ */ (0,
|
|
1394
|
-
/* @__PURE__ */ (0,
|
|
1395
|
-
/* @__PURE__ */ (0,
|
|
1396
|
-
/* @__PURE__ */ (0,
|
|
1409
|
+
var ChevronRightIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "m9 18 6-6-6-6" }) });
|
|
1410
|
+
var HistoryIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1411
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
1412
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M3 3v5h5" }),
|
|
1413
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 7v5l4 2" })
|
|
1397
1414
|
] });
|
|
1398
|
-
var BookmarkIcon = () => /* @__PURE__ */ (0,
|
|
1399
|
-
var TrashIcon = () => /* @__PURE__ */ (0,
|
|
1400
|
-
/* @__PURE__ */ (0,
|
|
1401
|
-
/* @__PURE__ */ (0,
|
|
1415
|
+
var BookmarkIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M19 21 12 16l-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" }) });
|
|
1416
|
+
var TrashIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1417
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M3 6h18" }),
|
|
1418
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
1402
1419
|
] });
|
|
1403
|
-
var PaperclipIcon = () => /* @__PURE__ */ (0,
|
|
1404
|
-
var MicIcon2 = () => /* @__PURE__ */ (0,
|
|
1405
|
-
/* @__PURE__ */ (0,
|
|
1406
|
-
/* @__PURE__ */ (0,
|
|
1407
|
-
/* @__PURE__ */ (0,
|
|
1420
|
+
var PaperclipIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48" }) });
|
|
1421
|
+
var MicIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1422
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z" }),
|
|
1423
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
1424
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
|
|
1408
1425
|
] });
|
|
1409
|
-
var MicOffIcon = () => /* @__PURE__ */ (0,
|
|
1410
|
-
/* @__PURE__ */ (0,
|
|
1411
|
-
/* @__PURE__ */ (0,
|
|
1412
|
-
/* @__PURE__ */ (0,
|
|
1413
|
-
/* @__PURE__ */ (0,
|
|
1414
|
-
/* @__PURE__ */ (0,
|
|
1415
|
-
/* @__PURE__ */ (0,
|
|
1426
|
+
var MicOffIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "2", y1: "2", x2: "22", y2: "22" }),
|
|
1428
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M18.89 13.23A7.12 7.12 0 0 0 19 12v-2" }),
|
|
1429
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M5 10v2a7 7 0 0 0 12 5" }),
|
|
1430
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M15 9.34V5a3 3 0 0 0-5.68-1.33" }),
|
|
1431
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" }),
|
|
1432
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
|
|
1416
1433
|
] });
|
|
1417
1434
|
var DEFAULT_CHIPS = [];
|
|
1418
1435
|
function extractName(raw) {
|
|
@@ -1462,7 +1479,7 @@ function KikuPickerMenu({
|
|
|
1462
1479
|
onDismiss
|
|
1463
1480
|
}) {
|
|
1464
1481
|
const discussed = sources.filter((s) => s.id && referencedIds.includes(s.id));
|
|
1465
|
-
return /* @__PURE__ */ (0,
|
|
1482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1466
1483
|
"div",
|
|
1467
1484
|
{
|
|
1468
1485
|
className: "hsk-kiku-picker",
|
|
@@ -1470,7 +1487,7 @@ function KikuPickerMenu({
|
|
|
1470
1487
|
"aria-label": "@kiku commands",
|
|
1471
1488
|
onMouseDown: (e) => e.preventDefault(),
|
|
1472
1489
|
children: [
|
|
1473
|
-
discussed.map((src, i) => /* @__PURE__ */ (0,
|
|
1490
|
+
discussed.map((src, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1474
1491
|
"button",
|
|
1475
1492
|
{
|
|
1476
1493
|
className: "hsk-kiku-picker-item",
|
|
@@ -1480,9 +1497,9 @@ function KikuPickerMenu({
|
|
|
1480
1497
|
onDismiss();
|
|
1481
1498
|
},
|
|
1482
1499
|
children: [
|
|
1483
|
-
/* @__PURE__ */ (0,
|
|
1484
|
-
/* @__PURE__ */ (0,
|
|
1485
|
-
src.price && /* @__PURE__ */ (0,
|
|
1500
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: src.image ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: src.image, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BookmarkIcon, {}) }),
|
|
1501
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: src.name }),
|
|
1502
|
+
src.price && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-kiku-picker-item-price", children: [
|
|
1486
1503
|
src.currency ?? defaultCurrency,
|
|
1487
1504
|
" ",
|
|
1488
1505
|
parseFloat(String(src.price).replace(/[^0-9.]/g, "") || "0").toLocaleString()
|
|
@@ -1491,7 +1508,7 @@ function KikuPickerMenu({
|
|
|
1491
1508
|
},
|
|
1492
1509
|
src.id ?? i
|
|
1493
1510
|
)),
|
|
1494
|
-
discussed.length > 1 && /* @__PURE__ */ (0,
|
|
1511
|
+
discussed.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1495
1512
|
"button",
|
|
1496
1513
|
{
|
|
1497
1514
|
className: "hsk-kiku-picker-item",
|
|
@@ -1501,8 +1518,8 @@ function KikuPickerMenu({
|
|
|
1501
1518
|
onDismiss();
|
|
1502
1519
|
},
|
|
1503
1520
|
children: [
|
|
1504
|
-
/* @__PURE__ */ (0,
|
|
1505
|
-
/* @__PURE__ */ (0,
|
|
1521
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BookmarkIcon, {}) }),
|
|
1522
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-kiku-picker-item-name", children: [
|
|
1506
1523
|
"Capture all (",
|
|
1507
1524
|
discussed.length,
|
|
1508
1525
|
")"
|
|
@@ -1510,7 +1527,7 @@ function KikuPickerMenu({
|
|
|
1510
1527
|
]
|
|
1511
1528
|
}
|
|
1512
1529
|
),
|
|
1513
|
-
discussed.length === 0 && /* @__PURE__ */ (0,
|
|
1530
|
+
discussed.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1514
1531
|
"button",
|
|
1515
1532
|
{
|
|
1516
1533
|
className: "hsk-kiku-picker-item",
|
|
@@ -1520,12 +1537,12 @@ function KikuPickerMenu({
|
|
|
1520
1537
|
onDismiss();
|
|
1521
1538
|
},
|
|
1522
1539
|
children: [
|
|
1523
|
-
/* @__PURE__ */ (0,
|
|
1524
|
-
/* @__PURE__ */ (0,
|
|
1540
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BookmarkIcon, {}) }),
|
|
1541
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "Capture current page" })
|
|
1525
1542
|
]
|
|
1526
1543
|
}
|
|
1527
1544
|
),
|
|
1528
|
-
/* @__PURE__ */ (0,
|
|
1545
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1529
1546
|
"button",
|
|
1530
1547
|
{
|
|
1531
1548
|
className: "hsk-kiku-picker-item",
|
|
@@ -1535,12 +1552,12 @@ function KikuPickerMenu({
|
|
|
1535
1552
|
onDismiss();
|
|
1536
1553
|
},
|
|
1537
1554
|
children: [
|
|
1538
|
-
/* @__PURE__ */ (0,
|
|
1539
|
-
/* @__PURE__ */ (0,
|
|
1555
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(HistoryIcon, {}) }),
|
|
1556
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "What have you saved?" })
|
|
1540
1557
|
]
|
|
1541
1558
|
}
|
|
1542
1559
|
),
|
|
1543
|
-
/* @__PURE__ */ (0,
|
|
1560
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1544
1561
|
"button",
|
|
1545
1562
|
{
|
|
1546
1563
|
className: "hsk-kiku-picker-item",
|
|
@@ -1550,8 +1567,8 @@ function KikuPickerMenu({
|
|
|
1550
1567
|
onDismiss();
|
|
1551
1568
|
},
|
|
1552
1569
|
children: [
|
|
1553
|
-
/* @__PURE__ */ (0,
|
|
1554
|
-
/* @__PURE__ */ (0,
|
|
1570
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TrashIcon, {}) }),
|
|
1571
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "Delete this" })
|
|
1555
1572
|
]
|
|
1556
1573
|
}
|
|
1557
1574
|
)
|
|
@@ -1560,22 +1577,22 @@ function KikuPickerMenu({
|
|
|
1560
1577
|
);
|
|
1561
1578
|
}
|
|
1562
1579
|
function AtPickerMenu({ onSelect, onDismiss }) {
|
|
1563
|
-
return /* @__PURE__ */ (0,
|
|
1580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1564
1581
|
"div",
|
|
1565
1582
|
{
|
|
1566
1583
|
className: "hsk-kiku-picker",
|
|
1567
1584
|
role: "menu",
|
|
1568
1585
|
"aria-label": "Extensions",
|
|
1569
1586
|
onMouseDown: (e) => e.preventDefault(),
|
|
1570
|
-
children: /* @__PURE__ */ (0,
|
|
1587
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1571
1588
|
"button",
|
|
1572
1589
|
{
|
|
1573
1590
|
className: "hsk-kiku-picker-item",
|
|
1574
1591
|
role: "menuitem",
|
|
1575
1592
|
onClick: () => onSelect("@kiku"),
|
|
1576
1593
|
children: [
|
|
1577
|
-
/* @__PURE__ */ (0,
|
|
1578
|
-
/* @__PURE__ */ (0,
|
|
1594
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon hsk-kiku-picker-icon--accent", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) }),
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "kiku \u2014 capture & remember" })
|
|
1579
1596
|
]
|
|
1580
1597
|
}
|
|
1581
1598
|
)
|
|
@@ -1585,9 +1602,9 @@ function AtPickerMenu({ onSelect, onDismiss }) {
|
|
|
1585
1602
|
function SourceImg({ src, alt, onImageClick }) {
|
|
1586
1603
|
const [failed, setFailed] = (0, import_react6.useState)(false);
|
|
1587
1604
|
if (failed) {
|
|
1588
|
-
return /* @__PURE__ */ (0,
|
|
1605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { width: "100%", height: "100%", display: "flex", alignItems: "center", justifyContent: "center", background: "var(--hsk-chat-source-bg, rgba(0,0,0,.04))", color: "var(--hsk-chat-muted, #888)" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) });
|
|
1589
1606
|
}
|
|
1590
|
-
return /* @__PURE__ */ (0,
|
|
1607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1591
1608
|
"img",
|
|
1592
1609
|
{
|
|
1593
1610
|
src,
|
|
@@ -1628,20 +1645,20 @@ function SourcesCarousel({ sources, defaultCurrency, onSelectSource, onImageClic
|
|
|
1628
1645
|
};
|
|
1629
1646
|
const display = sources.filter((s) => s.id && referencedIds.includes(s.id));
|
|
1630
1647
|
if (display.length === 0) return null;
|
|
1631
|
-
return /* @__PURE__ */ (0,
|
|
1632
|
-
/* @__PURE__ */ (0,
|
|
1648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("hsk-cb-sources-wrap", compact && "hsk-cb-sources-wrap--compact"), children: [
|
|
1649
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-sources", ref: railRef, children: display.map((src, si) => {
|
|
1633
1650
|
const isReferenced = !!(src.id && referencedIds.includes(src.id));
|
|
1634
|
-
return /* @__PURE__ */ (0,
|
|
1651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1635
1652
|
"div",
|
|
1636
1653
|
{
|
|
1637
1654
|
className: cn("hsk-cb-source", isReferenced && "hsk-cb-source--referenced"),
|
|
1638
1655
|
style: { animationDelay: `${si * 50}ms` },
|
|
1639
1656
|
onClick: () => onSelectSource?.(src),
|
|
1640
1657
|
children: [
|
|
1641
|
-
src.image ? /* @__PURE__ */ (0,
|
|
1642
|
-
/* @__PURE__ */ (0,
|
|
1643
|
-
isReferenced && /* @__PURE__ */ (0,
|
|
1644
|
-
isProperty && /* @__PURE__ */ (0,
|
|
1658
|
+
src.image ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-src-imgwrap", style: { position: "relative" }, children: [
|
|
1659
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SourceImg, { src: src.image, alt: src.name, onImageClick }),
|
|
1660
|
+
isReferenced && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-source-ref-badge", title: "Featured in response", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, { size: 10 }) }),
|
|
1661
|
+
isProperty && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: {
|
|
1645
1662
|
position: "absolute",
|
|
1646
1663
|
top: "6px",
|
|
1647
1664
|
right: "6px",
|
|
@@ -1656,14 +1673,14 @@ function SourcesCarousel({ sources, defaultCurrency, onSelectSource, onImageClic
|
|
|
1656
1673
|
color: "#fbbf24",
|
|
1657
1674
|
// Gold sparkle badge
|
|
1658
1675
|
boxShadow: "0 2px 4px rgba(0,0,0,0.2)"
|
|
1659
|
-
}, children: /* @__PURE__ */ (0,
|
|
1660
|
-
] }) : /* @__PURE__ */ (0,
|
|
1661
|
-
/* @__PURE__ */ (0,
|
|
1662
|
-
isReferenced && /* @__PURE__ */ (0,
|
|
1676
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, { size: 12 }) })
|
|
1677
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-src-imgwrap-empty", style: { position: "relative" }, children: [
|
|
1678
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}),
|
|
1679
|
+
isReferenced && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-source-ref-badge", title: "Featured in response", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, { size: 10 }) })
|
|
1663
1680
|
] }),
|
|
1664
|
-
/* @__PURE__ */ (0,
|
|
1665
|
-
/* @__PURE__ */ (0,
|
|
1666
|
-
src.price && /* @__PURE__ */ (0,
|
|
1681
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-src-info", children: [
|
|
1682
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-src-name", children: src.name }),
|
|
1683
|
+
src.price && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-src-price", children: [
|
|
1667
1684
|
src.currency ?? defaultCurrency,
|
|
1668
1685
|
" ",
|
|
1669
1686
|
parseFloat(String(src.price).replace(/[^0-9.]/g, "") || "0").toLocaleString()
|
|
@@ -1674,15 +1691,15 @@ function SourcesCarousel({ sources, defaultCurrency, onSelectSource, onImageClic
|
|
|
1674
1691
|
src.id ?? si
|
|
1675
1692
|
);
|
|
1676
1693
|
}) }),
|
|
1677
|
-
showNext && /* @__PURE__ */ (0,
|
|
1678
|
-
/* @__PURE__ */ (0,
|
|
1694
|
+
showNext && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1695
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1679
1696
|
"div",
|
|
1680
1697
|
{
|
|
1681
1698
|
className: "hsk-cb-sources-fade",
|
|
1682
1699
|
style: { background: "linear-gradient(to right, transparent, var(--hsk-fade-bg, #0e0e0f))" }
|
|
1683
1700
|
}
|
|
1684
1701
|
),
|
|
1685
|
-
/* @__PURE__ */ (0,
|
|
1702
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-sources-next", onClick: scrollNext, "aria-label": "See more", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronRightIcon, {}) })
|
|
1686
1703
|
] })
|
|
1687
1704
|
] });
|
|
1688
1705
|
}
|
|
@@ -1759,14 +1776,14 @@ function SmartContextPills({
|
|
|
1759
1776
|
pills.push({ emoji: "\u{1F4A1}", label: "Recommend something", query: "What do you recommend for me?" });
|
|
1760
1777
|
}
|
|
1761
1778
|
if (pills.length === 0) return null;
|
|
1762
|
-
return /* @__PURE__ */ (0,
|
|
1779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-action-pills", children: pills.map((pill) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1763
1780
|
"button",
|
|
1764
1781
|
{
|
|
1765
1782
|
className: "hsk-action-pill",
|
|
1766
1783
|
onClick: () => onSend(pill.query),
|
|
1767
1784
|
disabled: loading,
|
|
1768
1785
|
children: [
|
|
1769
|
-
/* @__PURE__ */ (0,
|
|
1786
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-pill-emoji", children: pill.emoji }),
|
|
1770
1787
|
pill.label
|
|
1771
1788
|
]
|
|
1772
1789
|
},
|
|
@@ -1847,8 +1864,8 @@ function ThinkingBlock({ text, isComplete, seconds: fixedSeconds }) {
|
|
|
1847
1864
|
const finalSeconds = fixedSeconds ?? seconds;
|
|
1848
1865
|
const label = isComplete ? finalSeconds !== null && finalSeconds !== void 0 ? `Thought for ${finalSeconds}s` : "Thought process" : `Thinking${seconds ? ` \xB7 ${seconds}s` : "\u2026"}`;
|
|
1849
1866
|
const expandable = !!text;
|
|
1850
|
-
return /* @__PURE__ */ (0,
|
|
1851
|
-
/* @__PURE__ */ (0,
|
|
1867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("hsk-cb-think", !isComplete && "hsk-cb-think--live"), children: [
|
|
1868
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1852
1869
|
"button",
|
|
1853
1870
|
{
|
|
1854
1871
|
type: "button",
|
|
@@ -1856,16 +1873,16 @@ function ThinkingBlock({ text, isComplete, seconds: fixedSeconds }) {
|
|
|
1856
1873
|
onClick: expandable ? () => setIsOpen((o) => !o) : void 0,
|
|
1857
1874
|
"aria-expanded": expandable ? isOpen : void 0,
|
|
1858
1875
|
children: [
|
|
1859
|
-
/* @__PURE__ */ (0,
|
|
1860
|
-
/* @__PURE__ */ (0,
|
|
1861
|
-
/* @__PURE__ */ (0,
|
|
1876
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: !isComplete ? "hsk-cb-think-spin" : void 0, children: [
|
|
1877
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1878
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 6v6l4 2" })
|
|
1862
1879
|
] }),
|
|
1863
|
-
/* @__PURE__ */ (0,
|
|
1864
|
-
expandable && /* @__PURE__ */ (0,
|
|
1880
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: label }),
|
|
1881
|
+
expandable && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: cn("hsk-cb-think-chevron", isOpen && "hsk-cb-think-chevron--open"), children: "\u25B6" })
|
|
1865
1882
|
]
|
|
1866
1883
|
}
|
|
1867
1884
|
),
|
|
1868
|
-
expandable && isOpen && /* @__PURE__ */ (0,
|
|
1885
|
+
expandable && isOpen && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-think-body", children: text })
|
|
1869
1886
|
] });
|
|
1870
1887
|
}
|
|
1871
1888
|
function ChatModal({
|
|
@@ -2011,15 +2028,7 @@ function ChatModal({
|
|
|
2011
2028
|
}, 1e3);
|
|
2012
2029
|
return () => clearInterval(t);
|
|
2013
2030
|
}, [mintedKey]);
|
|
2014
|
-
const
|
|
2015
|
-
const hskThemeAttr = isStringTheme ? theme : void 0;
|
|
2016
|
-
const customStyles = !isStringTheme && theme ? {
|
|
2017
|
-
...theme?.primaryColor && { "--hsk-primary": theme.primaryColor },
|
|
2018
|
-
...theme?.backgroundColor && { "--hsk-bg": theme.backgroundColor },
|
|
2019
|
-
...theme?.textColor && { "--hsk-text": theme.textColor },
|
|
2020
|
-
...theme?.fontFamily && { "--hsk-font": theme.fontFamily },
|
|
2021
|
-
...theme?.borderRadius && { "--hsk-border-radius": theme.borderRadius }
|
|
2022
|
-
} : void 0;
|
|
2031
|
+
const { themeAttr: hskThemeAttr, vars: customStyles } = resolveTheme(theme);
|
|
2023
2032
|
const retryLastMessage = async () => {
|
|
2024
2033
|
const lastUserMsg = [...messages].reverse().find((m) => m.role === "user");
|
|
2025
2034
|
if (lastUserMsg) await handleSend(lastUserMsg.content);
|
|
@@ -2215,7 +2224,7 @@ function ChatModal({
|
|
|
2215
2224
|
}, [voiceState]);
|
|
2216
2225
|
const blurVal = typeof backdropBlur === "number" ? `${backdropBlur}px` : backdropBlur ?? "20px";
|
|
2217
2226
|
const displayMessages = messages;
|
|
2218
|
-
return /* @__PURE__ */ (0,
|
|
2227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2219
2228
|
"div",
|
|
2220
2229
|
{
|
|
2221
2230
|
className: cn("hsk-cb-overlay", classNames.overlay),
|
|
@@ -2227,7 +2236,7 @@ function ChatModal({
|
|
|
2227
2236
|
...backdropColor ? { background: backdropColor } : {},
|
|
2228
2237
|
...customStyles
|
|
2229
2238
|
},
|
|
2230
|
-
children: /* @__PURE__ */ (0,
|
|
2239
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2231
2240
|
"div",
|
|
2232
2241
|
{
|
|
2233
2242
|
className: cn("hsk-cb-panel", classNames.panel),
|
|
@@ -2240,11 +2249,11 @@ function ChatModal({
|
|
|
2240
2249
|
}
|
|
2241
2250
|
},
|
|
2242
2251
|
children: [
|
|
2243
|
-
lightboxSrc && /* @__PURE__ */ (0,
|
|
2244
|
-
/* @__PURE__ */ (0,
|
|
2245
|
-
/* @__PURE__ */ (0,
|
|
2252
|
+
lightboxSrc && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-lightbox", onClick: () => setLightboxSrc(null), children: [
|
|
2253
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-lightbox-close", onClick: () => setLightboxSrc(null), "aria-label": "Close image", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CloseIcon, {}) }),
|
|
2254
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: lightboxSrc, alt: "", className: "hsk-lightbox-img", onClick: (e) => e.stopPropagation() })
|
|
2246
2255
|
] }),
|
|
2247
|
-
markupSrc && /* @__PURE__ */ (0,
|
|
2256
|
+
markupSrc && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-markup-overlay", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2248
2257
|
MarkupEditor,
|
|
2249
2258
|
{
|
|
2250
2259
|
src: markupSrc,
|
|
@@ -2258,44 +2267,44 @@ function ChatModal({
|
|
|
2258
2267
|
}
|
|
2259
2268
|
}
|
|
2260
2269
|
) }),
|
|
2261
|
-
/* @__PURE__ */ (0,
|
|
2262
|
-
/* @__PURE__ */ (0,
|
|
2263
|
-
/* @__PURE__ */ (0,
|
|
2264
|
-
/* @__PURE__ */ (0,
|
|
2265
|
-
/* @__PURE__ */ (0,
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-main", children: [
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-topbar", children: [
|
|
2272
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-topbar-left", children: [
|
|
2273
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-topbar-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) }),
|
|
2274
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-topbar-title", children: activeTitle }) })
|
|
2266
2275
|
] }),
|
|
2267
|
-
/* @__PURE__ */ (0,
|
|
2268
|
-
messages.length > 0 && /* @__PURE__ */ (0,
|
|
2269
|
-
/* @__PURE__ */ (0,
|
|
2276
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-topbar-actions", children: [
|
|
2277
|
+
messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-topbar-btn", onClick: handleReset, children: "Clear chat" }),
|
|
2278
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CloseIcon, {}) })
|
|
2270
2279
|
] })
|
|
2271
2280
|
] }),
|
|
2272
|
-
/* @__PURE__ */ (0,
|
|
2273
|
-
displayMessages.length === 0 ? /* @__PURE__ */ (0,
|
|
2274
|
-
awaitingName ? /* @__PURE__ */ (0,
|
|
2275
|
-
/* @__PURE__ */ (0,
|
|
2281
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-msgs", ref: msgsContainerRef, children: [
|
|
2282
|
+
displayMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-empty", children: [
|
|
2283
|
+
awaitingName ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2284
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("h2", { className: "hsk-cb-hello", children: [
|
|
2276
2285
|
"Hi, I'm ",
|
|
2277
|
-
/* @__PURE__ */ (0,
|
|
2286
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("b", { children: "kiku" }),
|
|
2278
2287
|
"."
|
|
2279
2288
|
] }),
|
|
2280
|
-
/* @__PURE__ */ (0,
|
|
2281
|
-
/* @__PURE__ */ (0,
|
|
2282
|
-
/* @__PURE__ */ (0,
|
|
2283
|
-
] }) : shopperName ? /* @__PURE__ */ (0,
|
|
2284
|
-
/* @__PURE__ */ (0,
|
|
2289
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "hsk-cb-hello-lead", children: "I can search, visualize, or capture anything for you \u2014 on this site or any other." }),
|
|
2290
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "hsk-cb-hello-ask", children: "What should I call you?" }),
|
|
2291
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-hello-skip", onClick: () => setNameSkipped(true), children: "Skip for now" })
|
|
2292
|
+
] }) : shopperName ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2293
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("h2", { className: "hsk-cb-hello", children: [
|
|
2285
2294
|
"Hi, ",
|
|
2286
2295
|
shopperName,
|
|
2287
2296
|
"."
|
|
2288
2297
|
] }),
|
|
2289
|
-
/* @__PURE__ */ (0,
|
|
2290
|
-
] }) : /* @__PURE__ */ (0,
|
|
2291
|
-
/* @__PURE__ */ (0,
|
|
2298
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "hsk-cb-hello-lead", children: "What can I find for you today?" })
|
|
2299
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2300
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("h2", { className: "hsk-cb-hello", children: [
|
|
2292
2301
|
"Hi, I'm ",
|
|
2293
|
-
/* @__PURE__ */ (0,
|
|
2302
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("b", { children: "kiku" }),
|
|
2294
2303
|
"."
|
|
2295
2304
|
] }),
|
|
2296
|
-
/* @__PURE__ */ (0,
|
|
2305
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "hsk-cb-hello-lead", children: "Ask me to search, visualize, or capture anything \u2014 I look across the whole site in real time." })
|
|
2297
2306
|
] }),
|
|
2298
|
-
!awaitingName && activeChips.length > 0 && /* @__PURE__ */ (0,
|
|
2307
|
+
!awaitingName && activeChips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-chips", children: activeChips.map((chip) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2299
2308
|
"button",
|
|
2300
2309
|
{
|
|
2301
2310
|
className: "hsk-cb-chip",
|
|
@@ -2311,37 +2320,49 @@ function ChatModal({
|
|
|
2311
2320
|
const compareSources = sources.filter((s) => s.id && referencedIds.includes(s.id));
|
|
2312
2321
|
const showMatrix = isLast && lastIntent === "compare" && compareSources.length >= 2;
|
|
2313
2322
|
const displayContent = !isUser && showMatrix ? stripMarkdownTables(msg.content) : msg.content;
|
|
2314
|
-
return /* @__PURE__ */ (0,
|
|
2323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-msg-group", ref: (el) => {
|
|
2315
2324
|
messageRefs.current[idx] = el;
|
|
2316
|
-
}, children: isUser ? /* @__PURE__ */ (0,
|
|
2317
|
-
msg.images && msg.images.length > 0 && /* @__PURE__ */ (0,
|
|
2318
|
-
msg.content && /* @__PURE__ */ (0,
|
|
2319
|
-
/* @__PURE__ */ (0,
|
|
2325
|
+
}, children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: `hsk-cb-user-msg${isLastUser ? " hsk-sent" : ""}`, children: [
|
|
2326
|
+
msg.images && msg.images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-user-imgs", children: msg.images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: img, alt: `attachment ${i + 1}`, className: "hsk-cb-user-img-thumb" }, i)) }),
|
|
2327
|
+
msg.content && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-user-bubble", children: /^@kiku\b/i.test(msg.content) ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2328
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-badge", children: "@kiku" }),
|
|
2320
2329
|
msg.content.replace(/^@kiku\s*/i, "")
|
|
2321
2330
|
] }) : msg.content })
|
|
2322
|
-
] }) : /* @__PURE__ */ (0,
|
|
2323
|
-
/* @__PURE__ */ (0,
|
|
2324
|
-
/* @__PURE__ */ (0,
|
|
2331
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
|
|
2332
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) }),
|
|
2333
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-body", children: [
|
|
2325
2334
|
(() => {
|
|
2326
2335
|
const parsed = parseThinking(displayContent);
|
|
2327
2336
|
const thinking = msg.thinking || parsed.thinking;
|
|
2328
2337
|
const content = parsed.content;
|
|
2329
2338
|
const isComplete = msg.thinking ? content.length > 0 || !(isLast && streaming) : parsed.isComplete;
|
|
2330
|
-
return /* @__PURE__ */ (0,
|
|
2331
|
-
(thinking || msg.thoughtForSeconds != null) && /* @__PURE__ */ (0,
|
|
2332
|
-
content && /* @__PURE__ */ (0,
|
|
2339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2340
|
+
(thinking || msg.thoughtForSeconds != null) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ThinkingBlock, { text: thinking, isComplete, seconds: msg.thoughtForSeconds }),
|
|
2341
|
+
content && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-text", children: [
|
|
2333
2342
|
renderMarkdown(content, isLast && streaming),
|
|
2334
|
-
isLast && streaming && /* @__PURE__ */ (0,
|
|
2343
|
+
isLast && streaming && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { display: "inline-block", width: "0.5em", height: "1.05em", marginLeft: "2px", verticalAlign: "text-bottom", background: "currentColor", opacity: 0.55, borderRadius: "1px" } })
|
|
2335
2344
|
] })
|
|
2336
2345
|
] });
|
|
2337
2346
|
})(),
|
|
2338
|
-
msg.visualizing && /* @__PURE__ */ (0,
|
|
2339
|
-
/* @__PURE__ */ (0,
|
|
2340
|
-
/* @__PURE__ */ (0,
|
|
2347
|
+
msg.visualizing && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-viz hsk-cb-viz--loading", children: [
|
|
2348
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-viz-spinner" }),
|
|
2349
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: msg.visualizingText || "Visualizing\u2026" })
|
|
2341
2350
|
] }),
|
|
2342
|
-
msg.visualization && /* @__PURE__ */ (0,
|
|
2343
|
-
/* @__PURE__ */ (0,
|
|
2344
|
-
/* @__PURE__ */ (0,
|
|
2351
|
+
msg.visualization && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-viz", children: [
|
|
2352
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-viz-imgwrap", children: [
|
|
2353
|
+
msg.visualizationType === "video" || msg.visualization.includes("/videos/") ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2354
|
+
"video",
|
|
2355
|
+
{
|
|
2356
|
+
src: msg.visualization,
|
|
2357
|
+
controls: true,
|
|
2358
|
+
autoPlay: true,
|
|
2359
|
+
loop: true,
|
|
2360
|
+
muted: true,
|
|
2361
|
+
playsInline: true,
|
|
2362
|
+
className: "hsk-markdown-video",
|
|
2363
|
+
style: { display: "block", maxHeight: "400px", objectFit: "contain", width: "100%" }
|
|
2364
|
+
}
|
|
2365
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2345
2366
|
"img",
|
|
2346
2367
|
{
|
|
2347
2368
|
src: msg.visualization,
|
|
@@ -2352,18 +2373,18 @@ function ChatModal({
|
|
|
2352
2373
|
}
|
|
2353
2374
|
}
|
|
2354
2375
|
),
|
|
2355
|
-
isLast && !streaming && /* @__PURE__ */ (0,
|
|
2356
|
-
/* @__PURE__ */ (0,
|
|
2357
|
-
/* @__PURE__ */ (0,
|
|
2358
|
-
/* @__PURE__ */ (0,
|
|
2376
|
+
isLast && !streaming && (msg.visualizationType !== "video" && !msg.visualization.includes("/videos/")) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { className: "hsk-cb-viz-mark", onClick: () => setMarkupSrc(msg.visualization), children: [
|
|
2377
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
2378
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 20h9" }),
|
|
2379
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z" })
|
|
2359
2380
|
] }),
|
|
2360
2381
|
"Mark & edit"
|
|
2361
2382
|
] })
|
|
2362
2383
|
] }),
|
|
2363
|
-
/* @__PURE__ */ (0,
|
|
2384
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-viz-disclaimer", children: msg.visualizationType === "video" || msg.visualization.includes("/videos/") ? "AI-generated video makeover \u2014 colors, size and movement may differ from the real product." : "AI-generated preview \u2014 colours, size and placement may differ from the real product." })
|
|
2364
2385
|
] }),
|
|
2365
|
-
!isUser && (msg.knowledgeImages?.length ?? 0) > 0 && /* @__PURE__ */ (0,
|
|
2366
|
-
/* @__PURE__ */ (0,
|
|
2386
|
+
!isUser && (msg.knowledgeImages?.length ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-kimgs", children: msg.knowledgeImages.map((ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-kimg-group", children: [
|
|
2387
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-kimg-grid", children: ref.images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2367
2388
|
"img",
|
|
2368
2389
|
{
|
|
2369
2390
|
src: img.url,
|
|
@@ -2377,16 +2398,16 @@ function ChatModal({
|
|
|
2377
2398
|
},
|
|
2378
2399
|
i
|
|
2379
2400
|
)) }),
|
|
2380
|
-
(ref.title || ref.images[0]?.note) && /* @__PURE__ */ (0,
|
|
2401
|
+
(ref.title || ref.images[0]?.note) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-kimg-caption", children: ref.title || ref.images[0]?.note })
|
|
2381
2402
|
] }, ref.entryId)) }),
|
|
2382
|
-
showMatrix && /* @__PURE__ */ (0,
|
|
2403
|
+
showMatrix && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComparisonMatrix, { sources: compareSources, defaultCurrency }),
|
|
2383
2404
|
(() => {
|
|
2384
2405
|
const msgReferencedIds = isLast ? referencedIds : msg.referencedIds ?? [];
|
|
2385
2406
|
const msgSources = isLast ? sources : msg.sources ?? [];
|
|
2386
2407
|
const msgIntent = isLast ? lastIntent : msg.intent;
|
|
2387
2408
|
const hiddenIntent = msgIntent === "compare" || msgIntent === "capture" || msgIntent === "capture_all" || msgIntent === "delete" || msgIntent === "view_history";
|
|
2388
2409
|
const showCarousel = msgReferencedIds.length > 0 && !hiddenIntent && (!isLast || lastAction?.type !== "request_kiku_key");
|
|
2389
|
-
return showCarousel && /* @__PURE__ */ (0,
|
|
2410
|
+
return showCarousel && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2390
2411
|
SourcesCarousel,
|
|
2391
2412
|
{
|
|
2392
2413
|
sources: msgSources,
|
|
@@ -2398,11 +2419,11 @@ function ChatModal({
|
|
|
2398
2419
|
}
|
|
2399
2420
|
);
|
|
2400
2421
|
})(),
|
|
2401
|
-
isLast && !loading && lastAction?.url && /* @__PURE__ */ (0,
|
|
2422
|
+
isLast && !loading && lastAction?.url && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-action-pills", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("a", { className: "hsk-action-pill", href: lastAction.url, children: [
|
|
2402
2423
|
String(lastAction.type || "continue").replace(/_/g, " "),
|
|
2403
2424
|
" \u2192"
|
|
2404
2425
|
] }) }),
|
|
2405
|
-
isLast && !loading && /* @__PURE__ */ (0,
|
|
2426
|
+
isLast && !loading && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2406
2427
|
SmartContextPills,
|
|
2407
2428
|
{
|
|
2408
2429
|
intent: lastIntent,
|
|
@@ -2414,16 +2435,16 @@ function ChatModal({
|
|
|
2414
2435
|
] })
|
|
2415
2436
|
] }) }, idx);
|
|
2416
2437
|
}),
|
|
2417
|
-
selectedProduct && loading && /* @__PURE__ */ (0,
|
|
2438
|
+
selectedProduct && loading && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2418
2439
|
"div",
|
|
2419
2440
|
{
|
|
2420
2441
|
className: "hsk-cb-selected-product",
|
|
2421
2442
|
onClick: () => selectedProduct.url && window.open(selectedProduct.url, "_blank"),
|
|
2422
2443
|
children: [
|
|
2423
|
-
selectedProduct.image && /* @__PURE__ */ (0,
|
|
2424
|
-
/* @__PURE__ */ (0,
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2426
|
-
selectedProduct.price && /* @__PURE__ */ (0,
|
|
2444
|
+
selectedProduct.image && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { className: "hsk-cb-selected-img", src: selectedProduct.image, alt: selectedProduct.name }),
|
|
2445
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-selected-info", children: [
|
|
2446
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-selected-name", children: selectedProduct.name }),
|
|
2447
|
+
selectedProduct.price && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-selected-price", children: [
|
|
2427
2448
|
selectedProduct.currency ?? defaultCurrency,
|
|
2428
2449
|
" ",
|
|
2429
2450
|
parseFloat(String(selectedProduct.price ?? "").replace(/[^0-9.]/g, "") || "0").toLocaleString()
|
|
@@ -2432,22 +2453,22 @@ function ChatModal({
|
|
|
2432
2453
|
]
|
|
2433
2454
|
}
|
|
2434
2455
|
),
|
|
2435
|
-
loading && !streaming && /* @__PURE__ */ (0,
|
|
2436
|
-
/* @__PURE__ */ (0,
|
|
2437
|
-
/* @__PURE__ */ (0,
|
|
2438
|
-
/* @__PURE__ */ (0,
|
|
2439
|
-
/* @__PURE__ */ (0,
|
|
2440
|
-
/* @__PURE__ */ (0,
|
|
2441
|
-
/* @__PURE__ */ (0,
|
|
2442
|
-
/* @__PURE__ */ (0,
|
|
2443
|
-
/* @__PURE__ */ (0,
|
|
2444
|
-
/* @__PURE__ */ (0,
|
|
2456
|
+
loading && !streaming && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-typing-row", style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
2457
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-thinking-icon", children: [
|
|
2458
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { className: "hsk-brand-mark", viewBox: "0 0 100 100", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M39.4 10.4 Q44 0 48.6 10.4 L86.1 95.8 Q88 100 83.4 100 L4.6 100 Q0 100 1.9 95.8 Z M24 100 L24 65 Q24 60 27.4 56.3 Q44 38 60.6 56.3 Q64 60 64 65 L64 100 Z", transform: "translate(22.7 19) scale(0.62)", fillRule: "evenodd" }) }),
|
|
2459
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { className: "hsk-brand-mark hsk-brand-mark--sheen", viewBox: "0 0 100 100", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M39.4 10.4 Q44 0 48.6 10.4 L86.1 95.8 Q88 100 83.4 100 L4.6 100 Q0 100 1.9 95.8 Z M24 100 L24 65 Q24 60 27.4 56.3 Q44 38 60.6 56.3 Q64 60 64 65 L64 100 Z", transform: "translate(22.7 19) scale(0.62)", fillRule: "evenodd" }) }),
|
|
2460
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-orbit", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-handle-ring", children: [
|
|
2461
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" }),
|
|
2462
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" }),
|
|
2463
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" }),
|
|
2464
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" }),
|
|
2465
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" })
|
|
2445
2466
|
] }) }),
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2467
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-rest" })
|
|
2447
2468
|
] }),
|
|
2448
|
-
/* @__PURE__ */ (0,
|
|
2469
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-thinking-text", children: "Thinking\u2026" })
|
|
2449
2470
|
] }),
|
|
2450
|
-
lastAction?.type === "open_memory" && lastAction.url && !loading && !streaming && /* @__PURE__ */ (0,
|
|
2471
|
+
lastAction?.type === "open_memory" && lastAction.url && !loading && !streaming && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2451
2472
|
"a",
|
|
2452
2473
|
{
|
|
2453
2474
|
className: "hsk-cb-memory-pill",
|
|
@@ -2456,23 +2477,23 @@ function ChatModal({
|
|
|
2456
2477
|
rel: "noopener noreferrer",
|
|
2457
2478
|
children: [
|
|
2458
2479
|
"Open my memory on mimi",
|
|
2459
|
-
/* @__PURE__ */ (0,
|
|
2480
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ExternalIcon, {})
|
|
2460
2481
|
]
|
|
2461
2482
|
}
|
|
2462
2483
|
),
|
|
2463
|
-
(stopped || interrupted) && !loading && !streaming && messages.length > 0 && /* @__PURE__ */ (0,
|
|
2464
|
-
/* @__PURE__ */ (0,
|
|
2465
|
-
/* @__PURE__ */ (0,
|
|
2466
|
-
/* @__PURE__ */ (0,
|
|
2484
|
+
(stopped || interrupted) && !loading && !streaming && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-stopped", children: [
|
|
2485
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-stopped-label", children: stopped ? "You stopped this response." : "This response was interrupted." }),
|
|
2486
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { className: "hsk-cb-continue", onClick: continueGenerating, children: [
|
|
2487
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ContinueIcon, {}),
|
|
2467
2488
|
messages[messages.length - 1]?.role === "assistant" ? "Continue generating" : "Generate response"
|
|
2468
2489
|
] })
|
|
2469
2490
|
] }),
|
|
2470
|
-
error && /* @__PURE__ */ (0,
|
|
2471
|
-
keyPhase === "prompt_key" && /* @__PURE__ */ (0,
|
|
2472
|
-
/* @__PURE__ */ (0,
|
|
2473
|
-
/* @__PURE__ */ (0,
|
|
2474
|
-
/* @__PURE__ */ (0,
|
|
2475
|
-
/* @__PURE__ */ (0,
|
|
2491
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-error", children: getFriendlyError(error) }),
|
|
2492
|
+
keyPhase === "prompt_key" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
|
|
2493
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) }),
|
|
2494
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-body", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-text", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-phone-form", children: [
|
|
2495
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "hsk-cb-phone-label", children: "Paste your public id \u2014 or create one" }),
|
|
2496
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2476
2497
|
"input",
|
|
2477
2498
|
{
|
|
2478
2499
|
type: "text",
|
|
@@ -2484,49 +2505,49 @@ function ChatModal({
|
|
|
2484
2505
|
autoFocus: true
|
|
2485
2506
|
}
|
|
2486
2507
|
),
|
|
2487
|
-
/* @__PURE__ */ (0,
|
|
2488
|
-
/* @__PURE__ */ (0,
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2508
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", gap: 8 }, children: [
|
|
2509
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-phone-submit", onClick: handleUseExistingKey, disabled: !keyInput.trim(), children: "Use my id" }),
|
|
2510
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-phone-submit", onClick: handleCreateKey, disabled: minting, children: minting ? "Creating\u2026" : "I'm new \u2014 create one" })
|
|
2490
2511
|
] })
|
|
2491
2512
|
] }) }) })
|
|
2492
2513
|
] }),
|
|
2493
|
-
mintedKey && /* @__PURE__ */ (0,
|
|
2494
|
-
/* @__PURE__ */ (0,
|
|
2495
|
-
/* @__PURE__ */ (0,
|
|
2496
|
-
/* @__PURE__ */ (0,
|
|
2497
|
-
/* @__PURE__ */ (0,
|
|
2498
|
-
/* @__PURE__ */ (0,
|
|
2499
|
-
/* @__PURE__ */ (0,
|
|
2500
|
-
/* @__PURE__ */ (0,
|
|
2501
|
-
/* @__PURE__ */ (0,
|
|
2514
|
+
mintedKey && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
|
|
2515
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) }),
|
|
2516
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-body", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-text", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { padding: "12px 14px", border: "1px solid var(--hsk-border, #e5e5e5)", borderRadius: "var(--hsk-border-radius, 0px)", display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
2517
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
|
|
2518
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 12, fontWeight: 600, marginBottom: 4 }, children: "Your secret \u2014 shown only once" }),
|
|
2519
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("code", { style: { display: "block", fontSize: 14, fontWeight: 700, marginBottom: 6, wordBreak: "break-all" }, children: mintedKey }),
|
|
2520
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
2521
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-phone-submit", style: { padding: "4px 10px" }, onClick: () => copyValue(mintedKey, "secret"), children: copied === "secret" ? "Copied" : "Copy secret" }),
|
|
2522
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { fontSize: 11, opacity: 0.7 }, children: "Keep it private \u2014 use it to unlock your memory at mimi.akropolys.cloud. If lost, the memory is lost with it." })
|
|
2502
2523
|
] })
|
|
2503
2524
|
] }),
|
|
2504
|
-
mintedPub && /* @__PURE__ */ (0,
|
|
2505
|
-
/* @__PURE__ */ (0,
|
|
2506
|
-
/* @__PURE__ */ (0,
|
|
2507
|
-
/* @__PURE__ */ (0,
|
|
2508
|
-
/* @__PURE__ */ (0,
|
|
2509
|
-
/* @__PURE__ */ (0,
|
|
2525
|
+
mintedPub && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
|
|
2526
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 12, fontWeight: 600, marginBottom: 4 }, children: "Your public id" }),
|
|
2527
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("code", { style: { display: "block", fontSize: 13, fontWeight: 600, marginBottom: 6, wordBreak: "break-all", opacity: 0.85 }, children: mintedPub }),
|
|
2528
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
2529
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-phone-submit", style: { padding: "4px 10px" }, onClick: () => copyValue(mintedPub, "pub"), children: copied === "pub" ? "Copied" : "Copy id" }),
|
|
2530
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { fontSize: 11, opacity: 0.7 }, children: "Paste this on any site to keep saving to the same memory." })
|
|
2510
2531
|
] })
|
|
2511
2532
|
] }),
|
|
2512
|
-
/* @__PURE__ */ (0,
|
|
2533
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { fontSize: 11, opacity: 0.6 }, children: [
|
|
2513
2534
|
"Hidden in ",
|
|
2514
2535
|
keyCountdown,
|
|
2515
2536
|
"s."
|
|
2516
2537
|
] })
|
|
2517
2538
|
] }) }) })
|
|
2518
2539
|
] }),
|
|
2519
|
-
/* @__PURE__ */ (0,
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: bottomRef, style: { height: 1 } })
|
|
2520
2541
|
] }),
|
|
2521
|
-
/* @__PURE__ */ (0,
|
|
2522
|
-
showAtPicker && /* @__PURE__ */ (0,
|
|
2542
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-input-wrap", children: [
|
|
2543
|
+
showAtPicker && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2523
2544
|
AtPickerMenu,
|
|
2524
2545
|
{
|
|
2525
2546
|
onSelect: handleSelectExtension,
|
|
2526
2547
|
onDismiss: () => setShowAtPicker(false)
|
|
2527
2548
|
}
|
|
2528
2549
|
),
|
|
2529
|
-
showKikuPicker && /* @__PURE__ */ (0,
|
|
2550
|
+
showKikuPicker && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2530
2551
|
KikuPickerMenu,
|
|
2531
2552
|
{
|
|
2532
2553
|
sources,
|
|
@@ -2539,9 +2560,9 @@ function ChatModal({
|
|
|
2539
2560
|
onDismiss: () => setShowKikuPicker(false)
|
|
2540
2561
|
}
|
|
2541
2562
|
),
|
|
2542
|
-
attachments.length > 0 && /* @__PURE__ */ (0,
|
|
2543
|
-
/* @__PURE__ */ (0,
|
|
2544
|
-
/* @__PURE__ */ (0,
|
|
2563
|
+
attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-img-strip", children: attachments.map((att, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-img-thumb-wrap", children: [
|
|
2564
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: att.data, alt: `attachment ${i + 1}`, className: "hsk-cb-img-thumb" }),
|
|
2565
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2545
2566
|
"button",
|
|
2546
2567
|
{
|
|
2547
2568
|
className: "hsk-cb-img-thumb-remove",
|
|
@@ -2551,8 +2572,8 @@ function ChatModal({
|
|
|
2551
2572
|
}
|
|
2552
2573
|
)
|
|
2553
2574
|
] }, i)) }),
|
|
2554
|
-
/* @__PURE__ */ (0,
|
|
2555
|
-
/* @__PURE__ */ (0,
|
|
2575
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-input-box", children: [
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2556
2577
|
"input",
|
|
2557
2578
|
{
|
|
2558
2579
|
ref: imageInputRef,
|
|
@@ -2563,7 +2584,7 @@ function ChatModal({
|
|
|
2563
2584
|
onChange: (e) => handleImageFiles(e.target.files)
|
|
2564
2585
|
}
|
|
2565
2586
|
),
|
|
2566
|
-
enableVision && /* @__PURE__ */ (0,
|
|
2587
|
+
enableVision && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2567
2588
|
"button",
|
|
2568
2589
|
{
|
|
2569
2590
|
className: "hsk-cb-attach-btn",
|
|
@@ -2571,10 +2592,10 @@ function ChatModal({
|
|
|
2571
2592
|
disabled: loading,
|
|
2572
2593
|
"aria-label": "Attach image",
|
|
2573
2594
|
title: "Attach image",
|
|
2574
|
-
children: /* @__PURE__ */ (0,
|
|
2595
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PaperclipIcon, {})
|
|
2575
2596
|
}
|
|
2576
2597
|
),
|
|
2577
|
-
/* @__PURE__ */ (0,
|
|
2598
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2578
2599
|
"textarea",
|
|
2579
2600
|
{
|
|
2580
2601
|
ref: textareaRef,
|
|
@@ -2588,7 +2609,7 @@ function ChatModal({
|
|
|
2588
2609
|
autoFocus: true
|
|
2589
2610
|
}
|
|
2590
2611
|
),
|
|
2591
|
-
hasSpeechAPI && enableVoice && /* @__PURE__ */ (0,
|
|
2612
|
+
hasSpeechAPI && enableVoice && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2592
2613
|
"button",
|
|
2593
2614
|
{
|
|
2594
2615
|
className: cn(
|
|
@@ -2601,32 +2622,32 @@ function ChatModal({
|
|
|
2601
2622
|
"aria-label": voiceState === "idle" ? "Start voice input" : "Stop recording",
|
|
2602
2623
|
title: voiceState === "idle" ? "Voice input" : "Stop",
|
|
2603
2624
|
children: [
|
|
2604
|
-
voiceState === "listening" ? /* @__PURE__ */ (0,
|
|
2605
|
-
voiceState === "listening" && /* @__PURE__ */ (0,
|
|
2625
|
+
voiceState === "listening" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MicOffIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MicIcon2, {}),
|
|
2626
|
+
voiceState === "listening" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-mic-pulse" })
|
|
2606
2627
|
]
|
|
2607
2628
|
}
|
|
2608
2629
|
),
|
|
2609
|
-
loading || streaming ? /* @__PURE__ */ (0,
|
|
2630
|
+
loading || streaming ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2610
2631
|
"button",
|
|
2611
2632
|
{
|
|
2612
2633
|
className: cn("hsk-cb-send", "hsk-cb-send--stop", classNames.sendButton),
|
|
2613
2634
|
onClick: stop,
|
|
2614
2635
|
"aria-label": "Stop generating",
|
|
2615
2636
|
title: "Stop generating",
|
|
2616
|
-
children: /* @__PURE__ */ (0,
|
|
2637
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StopIcon, {})
|
|
2617
2638
|
}
|
|
2618
|
-
) : /* @__PURE__ */ (0,
|
|
2639
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2619
2640
|
"button",
|
|
2620
2641
|
{
|
|
2621
2642
|
className: cn("hsk-cb-send", classNames.sendButton),
|
|
2622
2643
|
onClick: () => handleSend(),
|
|
2623
2644
|
disabled: !input.trim() && attachments.length === 0,
|
|
2624
2645
|
"aria-label": "Send message",
|
|
2625
|
-
children: /* @__PURE__ */ (0,
|
|
2646
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ArrowUpIcon, {})
|
|
2626
2647
|
}
|
|
2627
2648
|
)
|
|
2628
2649
|
] }),
|
|
2629
|
-
/* @__PURE__ */ (0,
|
|
2650
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-hint", children: "kiku \xB7 searches the whole catalogue in real time" })
|
|
2630
2651
|
] })
|
|
2631
2652
|
] })
|
|
2632
2653
|
]
|
|
@@ -2679,17 +2700,9 @@ function KikuButton({
|
|
|
2679
2700
|
window.removeEventListener("akropolys:navigation", handleNavigation);
|
|
2680
2701
|
};
|
|
2681
2702
|
}, []);
|
|
2682
|
-
const
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
...theme?.primaryColor && { "--hsk-primary": theme.primaryColor },
|
|
2686
|
-
...theme?.backgroundColor && { "--hsk-bg": theme.backgroundColor },
|
|
2687
|
-
...theme?.textColor && { "--hsk-text": theme.textColor },
|
|
2688
|
-
...theme?.fontFamily && { "--hsk-font": theme.fontFamily },
|
|
2689
|
-
...theme?.borderRadius && { "--hsk-border-radius": theme.borderRadius }
|
|
2690
|
-
} : void 0;
|
|
2691
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
2692
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2703
|
+
const { themeAttr: hskThemeAttr, vars: customStyles } = resolveTheme(theme);
|
|
2704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2705
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2693
2706
|
"button",
|
|
2694
2707
|
{
|
|
2695
2708
|
className: cn("hsk-cb-btn", classNames.button, className),
|
|
@@ -2698,13 +2711,13 @@ function KikuButton({
|
|
|
2698
2711
|
"data-hsk-theme": hskThemeAttr,
|
|
2699
2712
|
"aria-label": "Open AI chat",
|
|
2700
2713
|
children: [
|
|
2701
|
-
/* @__PURE__ */ (0,
|
|
2714
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-btn-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) }),
|
|
2702
2715
|
label !== void 0 ? label : null
|
|
2703
2716
|
]
|
|
2704
2717
|
}
|
|
2705
2718
|
),
|
|
2706
2719
|
open && mounted && (0, import_react_dom.createPortal)(
|
|
2707
|
-
/* @__PURE__ */ (0,
|
|
2720
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2708
2721
|
ChatModal,
|
|
2709
2722
|
{
|
|
2710
2723
|
title,
|
|
@@ -2732,8 +2745,8 @@ function KikuButton({
|
|
|
2732
2745
|
var import_react7 = require("react");
|
|
2733
2746
|
var import_react_dom2 = require("react-dom");
|
|
2734
2747
|
var import_sdk7 = require("@akropolys/sdk");
|
|
2735
|
-
var
|
|
2736
|
-
var SparkleIcon3 = ({ className, size = 16 }) => /* @__PURE__ */ (0,
|
|
2748
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2749
|
+
var SparkleIcon3 = ({ className, size = 16 }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2737
2750
|
"svg",
|
|
2738
2751
|
{
|
|
2739
2752
|
className: cn("hsk-brand-mark", className),
|
|
@@ -2742,19 +2755,15 @@ var SparkleIcon3 = ({ className, size = 16 }) => /* @__PURE__ */ (0, import_jsx_
|
|
|
2742
2755
|
viewBox: "0 0 100 100",
|
|
2743
2756
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2744
2757
|
"aria-label": "kiku",
|
|
2745
|
-
children: /* @__PURE__ */ (0,
|
|
2746
|
-
/* @__PURE__ */ (0,
|
|
2747
|
-
/* @__PURE__ */ (0,
|
|
2758
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("g", { transform: "translate(22.7 19) scale(0.62)", fill: "currentColor", fillRule: "evenodd", children: [
|
|
2759
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M39.4 10.4 Q44 0 48.6 10.4 L86.1 95.8 Q88 100 83.4 100 L4.6 100 Q0 100 1.9 95.8 Z M24 100 L24 65 Q24 60 27.4 56.3 Q44 38 60.6 56.3 Q64 60 64 65 L64 100 Z" }),
|
|
2760
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "55", cy: "82", r: "3.4" })
|
|
2748
2761
|
] })
|
|
2749
2762
|
}
|
|
2750
2763
|
);
|
|
2751
|
-
var CloseIcon2 = () => /* @__PURE__ */ (0,
|
|
2752
|
-
/* @__PURE__ */ (0,
|
|
2753
|
-
/* @__PURE__ */ (0,
|
|
2754
|
-
] });
|
|
2755
|
-
var ArrowUpIcon3 = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2756
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "m5 12 7-7 7 7" }),
|
|
2757
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 19V5" })
|
|
2764
|
+
var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2765
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2766
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2758
2767
|
] });
|
|
2759
2768
|
var getFriendlyError2 = (err) => {
|
|
2760
2769
|
let str = "";
|
|
@@ -2880,7 +2889,7 @@ Question: ${q}`;
|
|
|
2880
2889
|
}
|
|
2881
2890
|
] : messages;
|
|
2882
2891
|
if (isMobile) {
|
|
2883
|
-
return /* @__PURE__ */ (0,
|
|
2892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2884
2893
|
"div",
|
|
2885
2894
|
{
|
|
2886
2895
|
className: cn("hsk-sp-backdrop hsk-sp-mobile-view", classNames.backdrop),
|
|
@@ -2891,13 +2900,13 @@ Question: ${q}`;
|
|
|
2891
2900
|
background: bg ?? void 0,
|
|
2892
2901
|
...customStyles
|
|
2893
2902
|
},
|
|
2894
|
-
children: /* @__PURE__ */ (0,
|
|
2895
|
-
/* @__PURE__ */ (0,
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
2898
|
-
/* @__PURE__ */ (0,
|
|
2899
|
-
/* @__PURE__ */ (0,
|
|
2900
|
-
displayProduct && /* @__PURE__ */ (0,
|
|
2903
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("hsk-sp-card hsk-sp-fullscreen hsk-sp-mobile-card", classNames.card), onClick: (e) => e.stopPropagation(), children: [
|
|
2904
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header", children: [
|
|
2905
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-header-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {}) }),
|
|
2906
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header-body", children: [
|
|
2907
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header-title-row", children: [
|
|
2908
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-header-title", children: displayProduct?.name || productName }),
|
|
2909
|
+
displayProduct && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2901
2910
|
"button",
|
|
2902
2911
|
{
|
|
2903
2912
|
type: "button",
|
|
@@ -2907,32 +2916,32 @@ Question: ${q}`;
|
|
|
2907
2916
|
}
|
|
2908
2917
|
)
|
|
2909
2918
|
] }),
|
|
2910
|
-
/* @__PURE__ */ (0,
|
|
2919
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-header-sub", children: "kiku" })
|
|
2911
2920
|
] }),
|
|
2912
|
-
/* @__PURE__ */ (0,
|
|
2921
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { className: "hsk-sp-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CloseIcon2, {}) })
|
|
2913
2922
|
] }),
|
|
2914
|
-
searchLoading && /* @__PURE__ */ (0,
|
|
2915
|
-
/* @__PURE__ */ (0,
|
|
2916
|
-
/* @__PURE__ */ (0,
|
|
2923
|
+
searchLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-bar" }),
|
|
2924
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-chat-container", children: [
|
|
2925
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-msgs", children: [
|
|
2917
2926
|
displayMessages.map((msg, idx) => {
|
|
2918
2927
|
const isUser = msg.role === "user";
|
|
2919
|
-
return /* @__PURE__ */ (0,
|
|
2920
|
-
/* @__PURE__ */ (0,
|
|
2921
|
-
/* @__PURE__ */ (0,
|
|
2922
|
-
/* @__PURE__ */ (0,
|
|
2923
|
-
idx === 0 && displayProduct && /* @__PURE__ */ (0,
|
|
2924
|
-
/* @__PURE__ */ (0,
|
|
2925
|
-
/* @__PURE__ */ (0,
|
|
2926
|
-
/* @__PURE__ */ (0,
|
|
2927
|
-
/* @__PURE__ */ (0,
|
|
2928
|
-
/* @__PURE__ */ (0,
|
|
2929
|
-
/* @__PURE__ */ (0,
|
|
2928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-msg-group", children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-user-msg", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-user-bubble", children: msg.content }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
|
|
2929
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {}) }),
|
|
2930
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-ai-body", children: [
|
|
2931
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-text", children: renderMarkdown(msg.content) }),
|
|
2932
|
+
idx === 0 && displayProduct && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-attachment-deck", children: [
|
|
2933
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-main-card", children: [
|
|
2934
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-main-card-img", children: displayProduct.images?.[0] ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("img", { src: displayProduct.images[0], alt: displayProduct.name }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\xF0\u0178\u203A\x8D" }) }),
|
|
2935
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-main-card-info", children: [
|
|
2936
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-main-card-brand", children: displayProduct.brand || displayProduct.category || "Product" }),
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-main-card-name", children: displayProduct.name }),
|
|
2938
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-main-card-price", children: [
|
|
2930
2939
|
displayProduct.currency ?? "KES",
|
|
2931
2940
|
" ",
|
|
2932
2941
|
parseFloat(displayProduct.price?.replace(/[^0-9.]/g, "") || "0").toLocaleString()
|
|
2933
2942
|
] })
|
|
2934
2943
|
] }),
|
|
2935
|
-
(displayProduct.specs && Object.keys(displayProduct.specs).length > 0 || displayProduct.description) && /* @__PURE__ */ (0,
|
|
2944
|
+
(displayProduct.specs && Object.keys(displayProduct.specs).length > 0 || displayProduct.description) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2936
2945
|
"button",
|
|
2937
2946
|
{
|
|
2938
2947
|
type: "button",
|
|
@@ -2951,21 +2960,21 @@ Question: ${q}`;
|
|
|
2951
2960
|
}
|
|
2952
2961
|
);
|
|
2953
2962
|
if (similarProducts.length === 0) return null;
|
|
2954
|
-
return /* @__PURE__ */ (0,
|
|
2955
|
-
/* @__PURE__ */ (0,
|
|
2956
|
-
/* @__PURE__ */ (0,
|
|
2963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-similar-carousel-inline", children: [
|
|
2964
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-title", children: "Similar Products" }),
|
|
2965
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-list", children: similarProducts.map((r) => {
|
|
2957
2966
|
const price = parseFloat(r.entity.price?.replace(/[^0-9.]/g, "") || "0");
|
|
2958
2967
|
const currency = r.entity.currency ?? "KES";
|
|
2959
|
-
return /* @__PURE__ */ (0,
|
|
2968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2960
2969
|
"div",
|
|
2961
2970
|
{
|
|
2962
2971
|
className: "hsk-sp-mobile-similar-carousel-item",
|
|
2963
2972
|
onClick: () => handleNav(r),
|
|
2964
2973
|
children: [
|
|
2965
|
-
/* @__PURE__ */ (0,
|
|
2966
|
-
/* @__PURE__ */ (0,
|
|
2967
|
-
/* @__PURE__ */ (0,
|
|
2968
|
-
/* @__PURE__ */ (0,
|
|
2974
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-img", children: r.entity.images?.[0] ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("img", { src: r.entity.images[0], alt: r.entity.name }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\xF0\u0178\u203A\x8D" }) }),
|
|
2975
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-similar-carousel-meta", children: [
|
|
2976
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-name", title: r.entity.name, children: r.entity.name }),
|
|
2977
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-similar-carousel-price", children: [
|
|
2969
2978
|
currency,
|
|
2970
2979
|
" ",
|
|
2971
2980
|
price.toLocaleString()
|
|
@@ -2982,19 +2991,19 @@ Question: ${q}`;
|
|
|
2982
2991
|
] })
|
|
2983
2992
|
] }) }, idx);
|
|
2984
2993
|
}),
|
|
2985
|
-
chatLoading && /* @__PURE__ */ (0,
|
|
2986
|
-
/* @__PURE__ */ (0,
|
|
2987
|
-
/* @__PURE__ */ (0,
|
|
2988
|
-
/* @__PURE__ */ (0,
|
|
2989
|
-
/* @__PURE__ */ (0,
|
|
2990
|
-
/* @__PURE__ */ (0,
|
|
2994
|
+
chatLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-typing-row", children: [
|
|
2995
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {}) }),
|
|
2996
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-typing", children: [
|
|
2997
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" }),
|
|
2998
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" }),
|
|
2999
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" })
|
|
2991
3000
|
] })
|
|
2992
3001
|
] }),
|
|
2993
|
-
chatError && /* @__PURE__ */ (0,
|
|
2994
|
-
/* @__PURE__ */ (0,
|
|
3002
|
+
chatError && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-error", children: getFriendlyError2(chatError) }),
|
|
3003
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: chatBottomRef, style: { height: 1 } })
|
|
2995
3004
|
] }),
|
|
2996
|
-
/* @__PURE__ */ (0,
|
|
2997
|
-
/* @__PURE__ */ (0,
|
|
3005
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-input-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-input-box", children: [
|
|
3006
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2998
3007
|
"textarea",
|
|
2999
3008
|
{
|
|
3000
3009
|
ref: chatTextareaRef,
|
|
@@ -3007,34 +3016,34 @@ Question: ${q}`;
|
|
|
3007
3016
|
disabled: chatLoading
|
|
3008
3017
|
}
|
|
3009
3018
|
),
|
|
3010
|
-
/* @__PURE__ */ (0,
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3011
3020
|
"button",
|
|
3012
3021
|
{
|
|
3013
3022
|
className: "hsk-cb-send",
|
|
3014
3023
|
onClick: () => handleSend(),
|
|
3015
3024
|
disabled: !chatInput.trim() || chatLoading,
|
|
3016
3025
|
"aria-label": "Send message",
|
|
3017
|
-
children: /* @__PURE__ */ (0,
|
|
3026
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ArrowUpIcon, {})
|
|
3018
3027
|
}
|
|
3019
3028
|
)
|
|
3020
3029
|
] }) })
|
|
3021
3030
|
] }),
|
|
3022
|
-
showSpecs && displayProduct && /* @__PURE__ */ (0,
|
|
3023
|
-
/* @__PURE__ */ (0,
|
|
3024
|
-
/* @__PURE__ */ (0,
|
|
3025
|
-
/* @__PURE__ */ (0,
|
|
3031
|
+
showSpecs && displayProduct && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-specs-overlay", onClick: () => setShowSpecs(false), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-drawer", onClick: (e) => e.stopPropagation(), children: [
|
|
3032
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-header", children: [
|
|
3033
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: "Specifications" }),
|
|
3034
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setShowSpecs(false), children: "Close" })
|
|
3026
3035
|
] }),
|
|
3027
|
-
/* @__PURE__ */ (0,
|
|
3028
|
-
/* @__PURE__ */ (0,
|
|
3029
|
-
displayProduct.description && /* @__PURE__ */ (0,
|
|
3030
|
-
/* @__PURE__ */ (0,
|
|
3031
|
-
/* @__PURE__ */ (0,
|
|
3036
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-body", children: [
|
|
3037
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h4", { className: "hsk-sp-mobile-specs-title", children: displayProduct.name }),
|
|
3038
|
+
displayProduct.description && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-desc", children: [
|
|
3039
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h5", { children: "Description" }),
|
|
3040
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: displayProduct.description })
|
|
3032
3041
|
] }),
|
|
3033
|
-
displayProduct.specs && Object.keys(displayProduct.specs).length > 0 && /* @__PURE__ */ (0,
|
|
3034
|
-
/* @__PURE__ */ (0,
|
|
3035
|
-
Object.entries(displayProduct.specs).map(([key, val]) => /* @__PURE__ */ (0,
|
|
3036
|
-
/* @__PURE__ */ (0,
|
|
3037
|
-
/* @__PURE__ */ (0,
|
|
3042
|
+
displayProduct.specs && Object.keys(displayProduct.specs).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-list", children: [
|
|
3043
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h5", { children: "Details" }),
|
|
3044
|
+
Object.entries(displayProduct.specs).map(([key, val]) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-spec-row", children: [
|
|
3045
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-mobile-spec-label", children: key }),
|
|
3046
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-mobile-spec-value", children: val })
|
|
3038
3047
|
] }, key))
|
|
3039
3048
|
] })
|
|
3040
3049
|
] })
|
|
@@ -3043,7 +3052,7 @@ Question: ${q}`;
|
|
|
3043
3052
|
}
|
|
3044
3053
|
);
|
|
3045
3054
|
}
|
|
3046
|
-
return /* @__PURE__ */ (0,
|
|
3055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3047
3056
|
"div",
|
|
3048
3057
|
{
|
|
3049
3058
|
className: cn("hsk-sp-backdrop", classNames.backdrop),
|
|
@@ -3054,65 +3063,65 @@ Question: ${q}`;
|
|
|
3054
3063
|
background: bg ?? void 0,
|
|
3055
3064
|
...customStyles
|
|
3056
3065
|
},
|
|
3057
|
-
children: /* @__PURE__ */ (0,
|
|
3058
|
-
/* @__PURE__ */ (0,
|
|
3059
|
-
/* @__PURE__ */ (0,
|
|
3060
|
-
/* @__PURE__ */ (0,
|
|
3061
|
-
/* @__PURE__ */ (0,
|
|
3062
|
-
/* @__PURE__ */ (0,
|
|
3066
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("hsk-sp-card hsk-sp-fullscreen", classNames.card), onClick: (e) => e.stopPropagation(), children: [
|
|
3067
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header", children: [
|
|
3068
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-header-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {}) }),
|
|
3069
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header-body", children: [
|
|
3070
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-header-title", children: displayProduct?.name || productName }),
|
|
3071
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-header-sub", children: "Ask questions, compare specs, or check similar products" })
|
|
3063
3072
|
] }),
|
|
3064
|
-
/* @__PURE__ */ (0,
|
|
3073
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { className: "hsk-sp-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CloseIcon2, {}) })
|
|
3065
3074
|
] }),
|
|
3066
|
-
searchLoading && /* @__PURE__ */ (0,
|
|
3067
|
-
/* @__PURE__ */ (0,
|
|
3068
|
-
/* @__PURE__ */ (0,
|
|
3069
|
-
displayProduct && /* @__PURE__ */ (0,
|
|
3070
|
-
/* @__PURE__ */ (0,
|
|
3071
|
-
/* @__PURE__ */ (0,
|
|
3072
|
-
/* @__PURE__ */ (0,
|
|
3073
|
-
displayProduct.brand && /* @__PURE__ */ (0,
|
|
3074
|
-
displayProduct.category && /* @__PURE__ */ (0,
|
|
3075
|
-
/* @__PURE__ */ (0,
|
|
3076
|
-
/* @__PURE__ */ (0,
|
|
3077
|
-
/* @__PURE__ */ (0,
|
|
3078
|
-
/* @__PURE__ */ (0,
|
|
3079
|
-
displayProduct.originalPrice && /* @__PURE__ */ (0,
|
|
3080
|
-
displayProduct.discount && /* @__PURE__ */ (0,
|
|
3075
|
+
searchLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-bar" }),
|
|
3076
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-body", children: [
|
|
3077
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-details-pane", children: [
|
|
3078
|
+
displayProduct && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-product-profile-container", children: [
|
|
3079
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-product-profile", children: [
|
|
3080
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-details-imgwrap", children: displayProduct.images?.[0] ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("img", { src: displayProduct.images[0], alt: displayProduct.name }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-img-placeholder", children: "\xF0\u0178\u203A\x8D" }) }),
|
|
3081
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-details-meta", children: [
|
|
3082
|
+
displayProduct.brand && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-brand", children: displayProduct.brand }),
|
|
3083
|
+
displayProduct.category && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-cat", children: displayProduct.category }),
|
|
3084
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h2", { className: "hsk-sp-details-name", children: displayProduct.name }),
|
|
3085
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-item-price-row", children: [
|
|
3086
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-currency", children: displayProduct.currency ?? "KES" }),
|
|
3087
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-price", children: parseFloat(displayProduct.price?.replace(/[^0-9.]/g, "") || "0").toLocaleString() }),
|
|
3088
|
+
displayProduct.originalPrice && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-original-price", children: parseFloat(displayProduct.originalPrice.replace(/[^0-9.]/g, "") || "0").toLocaleString() }),
|
|
3089
|
+
displayProduct.discount && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "hsk-sp-item-discount", children: [
|
|
3081
3090
|
"(",
|
|
3082
3091
|
displayProduct.discount,
|
|
3083
3092
|
")"
|
|
3084
3093
|
] })
|
|
3085
3094
|
] }),
|
|
3086
|
-
/* @__PURE__ */ (0,
|
|
3087
|
-
displayProduct.rating && /* @__PURE__ */ (0,
|
|
3095
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-item-meta-badges", children: [
|
|
3096
|
+
displayProduct.rating && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "hsk-sp-meta-badge hsk-sp-meta-badge-rating", children: [
|
|
3088
3097
|
"\xE2\u02DC\u2026 ",
|
|
3089
3098
|
parseFloat(displayProduct.rating.toString()).toFixed(1),
|
|
3090
3099
|
" ",
|
|
3091
3100
|
displayProduct.reviewCount ? `(${displayProduct.reviewCount})` : ""
|
|
3092
3101
|
] }),
|
|
3093
|
-
displayProduct.availability && /* @__PURE__ */ (0,
|
|
3094
|
-
displayProduct.stock && !displayProduct.availability && /* @__PURE__ */ (0,
|
|
3102
|
+
displayProduct.availability && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: `hsk-sp-meta-badge hsk-sp-meta-badge-avail ${displayProduct.availability.toLowerCase().includes("in") ? "in-stock" : "out-stock"}`, children: displayProduct.availability }),
|
|
3103
|
+
displayProduct.stock && !displayProduct.availability && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "hsk-sp-meta-badge hsk-sp-meta-badge-stock", children: [
|
|
3095
3104
|
"Stock: ",
|
|
3096
3105
|
displayProduct.stock
|
|
3097
3106
|
] })
|
|
3098
3107
|
] })
|
|
3099
3108
|
] })
|
|
3100
3109
|
] }),
|
|
3101
|
-
displayProduct.specs && Object.keys(displayProduct.specs).length > 0 && /* @__PURE__ */ (0,
|
|
3102
|
-
/* @__PURE__ */ (0,
|
|
3110
|
+
displayProduct.specs && Object.keys(displayProduct.specs).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-specs-horizontal", children: Object.entries(displayProduct.specs).map(([key, val]) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-spec-item-horizontal", children: [
|
|
3111
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "hsk-sp-spec-label-horizontal", children: [
|
|
3103
3112
|
key,
|
|
3104
3113
|
":"
|
|
3105
3114
|
] }),
|
|
3106
|
-
/* @__PURE__ */ (0,
|
|
3115
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-spec-value-horizontal", title: val, children: val })
|
|
3107
3116
|
] }, key)) }),
|
|
3108
|
-
displayProduct.description && /* @__PURE__ */ (0,
|
|
3109
|
-
/* @__PURE__ */ (0,
|
|
3110
|
-
/* @__PURE__ */ (0,
|
|
3117
|
+
displayProduct.description && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-details-desc", children: [
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h4", { children: "Description" }),
|
|
3119
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: displayProduct.description })
|
|
3111
3120
|
] })
|
|
3112
3121
|
] }),
|
|
3113
|
-
/* @__PURE__ */ (0,
|
|
3114
|
-
/* @__PURE__ */ (0,
|
|
3115
|
-
/* @__PURE__ */ (0,
|
|
3122
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-similar-section", children: [
|
|
3123
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: "Similar Products" }),
|
|
3124
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-results", children: (() => {
|
|
3116
3125
|
const similarProducts = results.filter(
|
|
3117
3126
|
(r) => {
|
|
3118
3127
|
const isSameName = !!(r.entity.name && displayProduct?.name && r.entity.name.toLowerCase() === displayProduct.name.toLowerCase());
|
|
@@ -3121,29 +3130,29 @@ Question: ${q}`;
|
|
|
3121
3130
|
}
|
|
3122
3131
|
);
|
|
3123
3132
|
if (!searchLoading && similarProducts.length === 0) {
|
|
3124
|
-
return /* @__PURE__ */ (0,
|
|
3133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-empty", children: "No similar products found." });
|
|
3125
3134
|
}
|
|
3126
3135
|
return similarProducts.map((r, i) => {
|
|
3127
3136
|
const price = parseFloat(r.entity.price?.replace(/[^0-9.]/g, "") || "0");
|
|
3128
3137
|
const currency = r.entity.currency ?? "KES";
|
|
3129
|
-
return /* @__PURE__ */ (0,
|
|
3138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3130
3139
|
"div",
|
|
3131
3140
|
{
|
|
3132
3141
|
className: cn("hsk-sp-item", classNames.item),
|
|
3133
3142
|
style: { animationDelay: `${i * 55}ms`, cursor: "pointer" },
|
|
3134
3143
|
onClick: () => handleNav(r),
|
|
3135
3144
|
children: [
|
|
3136
|
-
/* @__PURE__ */ (0,
|
|
3137
|
-
/* @__PURE__ */ (0,
|
|
3138
|
-
/* @__PURE__ */ (0,
|
|
3139
|
-
r.entity.category && /* @__PURE__ */ (0,
|
|
3140
|
-
/* @__PURE__ */ (0,
|
|
3145
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-img-wrap", children: r.entity.images?.[0] ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("img", { src: r.entity.images[0], alt: r.entity.name }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-img-placeholder", children: "\xF0\u0178\u203A\x8D" }) }),
|
|
3146
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-item-body", children: [
|
|
3147
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3148
|
+
r.entity.category && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-item-cat", children: r.entity.category }),
|
|
3149
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-item-name", title: r.entity.name, children: r.entity.name })
|
|
3141
3150
|
] }),
|
|
3142
|
-
/* @__PURE__ */ (0,
|
|
3143
|
-
/* @__PURE__ */ (0,
|
|
3144
|
-
/* @__PURE__ */ (0,
|
|
3151
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-item-price-row", children: [
|
|
3152
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-currency", children: currency }),
|
|
3153
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-price", children: price.toLocaleString() })
|
|
3145
3154
|
] }),
|
|
3146
|
-
/* @__PURE__ */ (0,
|
|
3155
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-actions", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3147
3156
|
"button",
|
|
3148
3157
|
{
|
|
3149
3158
|
className: "hsk-sp-action hsk-sp-action-primary",
|
|
@@ -3163,29 +3172,29 @@ Question: ${q}`;
|
|
|
3163
3172
|
})() })
|
|
3164
3173
|
] })
|
|
3165
3174
|
] }),
|
|
3166
|
-
/* @__PURE__ */ (0,
|
|
3167
|
-
/* @__PURE__ */ (0,
|
|
3175
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-chat-pane", children: [
|
|
3176
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-msgs", children: [
|
|
3168
3177
|
displayMessages.map((msg, idx) => {
|
|
3169
3178
|
const isUser = msg.role === "user";
|
|
3170
|
-
return /* @__PURE__ */ (0,
|
|
3171
|
-
/* @__PURE__ */ (0,
|
|
3172
|
-
/* @__PURE__ */ (0,
|
|
3179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-msg-group", children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-user-msg", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-user-bubble", children: msg.content }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
|
|
3180
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {}) }),
|
|
3181
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-body", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-text", children: renderMarkdown(msg.content) }) })
|
|
3173
3182
|
] }) }, idx);
|
|
3174
3183
|
}),
|
|
3175
|
-
chatLoading && /* @__PURE__ */ (0,
|
|
3176
|
-
/* @__PURE__ */ (0,
|
|
3177
|
-
/* @__PURE__ */ (0,
|
|
3178
|
-
/* @__PURE__ */ (0,
|
|
3179
|
-
/* @__PURE__ */ (0,
|
|
3180
|
-
/* @__PURE__ */ (0,
|
|
3184
|
+
chatLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-typing-row", children: [
|
|
3185
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {}) }),
|
|
3186
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-typing", children: [
|
|
3187
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" }),
|
|
3188
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" }),
|
|
3189
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" })
|
|
3181
3190
|
] })
|
|
3182
3191
|
] }),
|
|
3183
|
-
chatError && /* @__PURE__ */ (0,
|
|
3184
|
-
/* @__PURE__ */ (0,
|
|
3192
|
+
chatError && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-error", children: getFriendlyError2(chatError) }),
|
|
3193
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: chatBottomRef, style: { height: 1 } })
|
|
3185
3194
|
] }),
|
|
3186
|
-
/* @__PURE__ */ (0,
|
|
3187
|
-
/* @__PURE__ */ (0,
|
|
3188
|
-
/* @__PURE__ */ (0,
|
|
3195
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-input-wrap", children: [
|
|
3196
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-input-box", children: [
|
|
3197
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3189
3198
|
"textarea",
|
|
3190
3199
|
{
|
|
3191
3200
|
ref: chatTextareaRef,
|
|
@@ -3198,22 +3207,22 @@ Question: ${q}`;
|
|
|
3198
3207
|
disabled: chatLoading
|
|
3199
3208
|
}
|
|
3200
3209
|
),
|
|
3201
|
-
/* @__PURE__ */ (0,
|
|
3210
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3202
3211
|
"button",
|
|
3203
3212
|
{
|
|
3204
3213
|
className: "hsk-cb-send",
|
|
3205
3214
|
onClick: () => handleSend(),
|
|
3206
3215
|
disabled: !chatInput.trim() || chatLoading,
|
|
3207
3216
|
"aria-label": "Send message",
|
|
3208
|
-
children: /* @__PURE__ */ (0,
|
|
3217
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ArrowUpIcon, {})
|
|
3209
3218
|
}
|
|
3210
3219
|
)
|
|
3211
3220
|
] }),
|
|
3212
|
-
/* @__PURE__ */ (0,
|
|
3221
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-hint", children: "Akropolys \xB7 instant product knowledge" })
|
|
3213
3222
|
] })
|
|
3214
3223
|
] })
|
|
3215
3224
|
] }),
|
|
3216
|
-
/* @__PURE__ */ (0,
|
|
3225
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-footer", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-esc", children: "Esc to close" }) })
|
|
3217
3226
|
] })
|
|
3218
3227
|
}
|
|
3219
3228
|
);
|
|
@@ -3243,8 +3252,8 @@ function Sparkle({
|
|
|
3243
3252
|
...theme?.fontFamily && { "--hsk-font": theme.fontFamily },
|
|
3244
3253
|
...theme?.borderRadius && { "--hsk-border-radius": theme.borderRadius }
|
|
3245
3254
|
};
|
|
3246
|
-
return /* @__PURE__ */ (0,
|
|
3247
|
-
/* @__PURE__ */ (0,
|
|
3255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
3256
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3248
3257
|
"button",
|
|
3249
3258
|
{
|
|
3250
3259
|
className: cn("hsk-sp-btn", classNames.button, className),
|
|
@@ -3252,11 +3261,11 @@ function Sparkle({
|
|
|
3252
3261
|
style: customStyles,
|
|
3253
3262
|
title: "Find similar products",
|
|
3254
3263
|
"aria-label": "Find similar products",
|
|
3255
|
-
children: children || /* @__PURE__ */ (0,
|
|
3264
|
+
children: children || /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {})
|
|
3256
3265
|
}
|
|
3257
3266
|
),
|
|
3258
3267
|
open && mounted && (0, import_react_dom2.createPortal)(
|
|
3259
|
-
/* @__PURE__ */ (0,
|
|
3268
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3260
3269
|
SparkleModal,
|
|
3261
3270
|
{
|
|
3262
3271
|
productName,
|