@akropolys/kiku 1.7.11 → 1.7.13
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 +525 -503
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +525 -503
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +77 -7
- 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,49 @@ 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" } }) }),
|
|
709
|
+
msg.thinking && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { className: "hsk-thinking-details", open: streaming && idx === chatHistory.length - 1 && !msg.content, children: [
|
|
710
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("summary", { className: "hsk-thinking-summary", children: [
|
|
711
|
+
"Thought for ",
|
|
712
|
+
msg.thoughtForSeconds ?? 1,
|
|
713
|
+
"s"
|
|
714
|
+
] }),
|
|
715
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-thinking-text", children: msg.thinking })
|
|
716
|
+
] }),
|
|
717
|
+
msg.statusMessage && idx === chatHistory.length - 1 && !msg.content && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-status-live", children: [
|
|
718
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-status-dot" }),
|
|
719
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: msg.statusMessage })
|
|
720
|
+
] }),
|
|
688
721
|
renderMarkdown(msg.content),
|
|
689
|
-
msg.
|
|
690
|
-
|
|
691
|
-
/* @__PURE__ */ (0,
|
|
692
|
-
|
|
693
|
-
/* @__PURE__ */ (0,
|
|
694
|
-
|
|
722
|
+
streaming && idx === chatHistory.length - 1 && msg.role === "assistant" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-streaming-cursor" }),
|
|
723
|
+
msg.styleDNA && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "kiku-vs-preview-banner", style: { marginTop: "10px" }, children: [
|
|
724
|
+
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" }),
|
|
725
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "kiku-vs-preview-info", children: [
|
|
726
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "kiku-vs-preview-label", children: "Visual Match Palette" }),
|
|
727
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "kiku-vs-preview-palette", children: msg.styleDNA.color_palette || "Detected Style DNA" }),
|
|
728
|
+
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
729
|
"#",
|
|
696
730
|
tag
|
|
697
731
|
] }, ti)) })
|
|
@@ -699,13 +733,13 @@ I couldn't find any matching products in the store.`;
|
|
|
699
733
|
] })
|
|
700
734
|
] })
|
|
701
735
|
] }),
|
|
702
|
-
msg.role === "assistant" && msg.visualSources && msg.visualSources.length > 0 && /* @__PURE__ */ (0,
|
|
736
|
+
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
737
|
msg.role === "assistant" && idx === chatHistory.length - 1 && !msg.visualSources && sources.length > 0 && (() => {
|
|
704
738
|
const isStreamingActive = chatLoading || streaming;
|
|
705
739
|
if (isStreamingActive) {
|
|
706
|
-
return /* @__PURE__ */ (0,
|
|
740
|
+
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
741
|
const isReferenced = !!(src.id && referencedIds.includes(src.id));
|
|
708
|
-
return /* @__PURE__ */ (0,
|
|
742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
709
743
|
SourceCard,
|
|
710
744
|
{
|
|
711
745
|
source: src,
|
|
@@ -719,10 +753,10 @@ I couldn't find any matching products in the store.`;
|
|
|
719
753
|
}
|
|
720
754
|
const featured = sources.filter((src) => src.id && referencedIds.includes(src.id));
|
|
721
755
|
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,
|
|
756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-sources-container", children: [
|
|
757
|
+
featured.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-sources-group", style: { marginBottom: "10px" }, children: [
|
|
758
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources-group-title", children: "\u2B50 Featured in response" }),
|
|
759
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources", children: featured.map((src, si) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
726
760
|
SourceCard,
|
|
727
761
|
{
|
|
728
762
|
source: src,
|
|
@@ -733,9 +767,9 @@ I couldn't find any matching products in the store.`;
|
|
|
733
767
|
`feat-${si}`
|
|
734
768
|
)) })
|
|
735
769
|
] }),
|
|
736
|
-
general.length > 0 && /* @__PURE__ */ (0,
|
|
737
|
-
featured.length > 0 && /* @__PURE__ */ (0,
|
|
738
|
-
/* @__PURE__ */ (0,
|
|
770
|
+
general.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-sources-group", children: [
|
|
771
|
+
featured.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources-group-title", children: "All matches" }),
|
|
772
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources", children: general.map((src, si) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
739
773
|
SourceCard,
|
|
740
774
|
{
|
|
741
775
|
source: src,
|
|
@@ -749,21 +783,21 @@ I couldn't find any matching products in the store.`;
|
|
|
749
783
|
] });
|
|
750
784
|
})()
|
|
751
785
|
] }, idx)),
|
|
752
|
-
loading && /* @__PURE__ */ (0,
|
|
753
|
-
/* @__PURE__ */ (0,
|
|
754
|
-
/* @__PURE__ */ (0,
|
|
755
|
-
/* @__PURE__ */ (0,
|
|
756
|
-
/* @__PURE__ */ (0,
|
|
757
|
-
/* @__PURE__ */ (0,
|
|
786
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-msg-row", children: [
|
|
787
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-msg-avatar ai", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SparkleIcon, {}) }),
|
|
788
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-pending", role: "status", "aria-live": "polite", children: [
|
|
789
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-pending-glyph", children: [
|
|
790
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-ring" }),
|
|
791
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-dot" })
|
|
758
792
|
] }),
|
|
759
|
-
/* @__PURE__ */ (0,
|
|
760
|
-
/* @__PURE__ */ (0,
|
|
761
|
-
/* @__PURE__ */ (0,
|
|
762
|
-
/* @__PURE__ */ (0,
|
|
793
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-pending-text", children: [
|
|
794
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-step step-1", children: "Searching catalog" }),
|
|
795
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-step step-2", children: "Reasoning" }),
|
|
796
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-step step-3", children: "Composing" })
|
|
763
797
|
] })
|
|
764
798
|
] })
|
|
765
799
|
] }),
|
|
766
|
-
error && /* @__PURE__ */ (0,
|
|
800
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-chat-error", children: (() => {
|
|
767
801
|
try {
|
|
768
802
|
const parsed = JSON.parse(error);
|
|
769
803
|
return parsed.error || parsed.message || error;
|
|
@@ -771,10 +805,10 @@ I couldn't find any matching products in the store.`;
|
|
|
771
805
|
return error;
|
|
772
806
|
}
|
|
773
807
|
})() }),
|
|
774
|
-
/* @__PURE__ */ (0,
|
|
808
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ref: bottomRef })
|
|
775
809
|
] }),
|
|
776
|
-
/* @__PURE__ */ (0,
|
|
777
|
-
enableVision && /* @__PURE__ */ (0,
|
|
810
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-chat-input-area", style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
811
|
+
enableVision && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
778
812
|
VisualSearch,
|
|
779
813
|
{
|
|
780
814
|
onResults: handleVisualResults,
|
|
@@ -783,7 +817,7 @@ I couldn't find any matching products in the store.`;
|
|
|
783
817
|
disabled: loading
|
|
784
818
|
}
|
|
785
819
|
),
|
|
786
|
-
/* @__PURE__ */ (0,
|
|
820
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
787
821
|
"textarea",
|
|
788
822
|
{
|
|
789
823
|
ref: textareaRef,
|
|
@@ -797,7 +831,7 @@ I couldn't find any matching products in the store.`;
|
|
|
797
831
|
style: { flex: 1 }
|
|
798
832
|
}
|
|
799
833
|
),
|
|
800
|
-
enableVoice && /* @__PURE__ */ (0,
|
|
834
|
+
enableVoice && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
801
835
|
VoiceButton,
|
|
802
836
|
{
|
|
803
837
|
onTranscript: (text) => {
|
|
@@ -809,14 +843,14 @@ I couldn't find any matching products in the store.`;
|
|
|
809
843
|
disabled: loading
|
|
810
844
|
}
|
|
811
845
|
),
|
|
812
|
-
/* @__PURE__ */ (0,
|
|
846
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
813
847
|
"button",
|
|
814
848
|
{
|
|
815
849
|
className: "hsk-chat-send",
|
|
816
850
|
onClick: handleSend,
|
|
817
851
|
disabled: !input.trim() || loading,
|
|
818
852
|
"aria-label": "Send message",
|
|
819
|
-
children: /* @__PURE__ */ (0,
|
|
853
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ArrowUpIcon, {})
|
|
820
854
|
}
|
|
821
855
|
)
|
|
822
856
|
] })
|
|
@@ -833,7 +867,7 @@ var import_sdk6 = require("@akropolys/sdk");
|
|
|
833
867
|
|
|
834
868
|
// src/components/ComparisonMatrix.tsx
|
|
835
869
|
var import_sdk4 = require("@akropolys/sdk");
|
|
836
|
-
var
|
|
870
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
837
871
|
function normalizeKey(key) {
|
|
838
872
|
let s = key.replace(/[_-]+/g, " ");
|
|
839
873
|
s = s.replace(/([a-z])([A-Z])/g, "$1 $2");
|
|
@@ -995,9 +1029,9 @@ function buildRows(products, displayConfig, defaultCurrency = "KES") {
|
|
|
995
1029
|
}
|
|
996
1030
|
function ImageCell({ value, name }) {
|
|
997
1031
|
if (!value) {
|
|
998
|
-
return /* @__PURE__ */ (0,
|
|
1032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { fontSize: 28, textAlign: "center" }, children: "\u{1F4E6}" });
|
|
999
1033
|
}
|
|
1000
|
-
return /* @__PURE__ */ (0,
|
|
1034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1001
1035
|
"img",
|
|
1002
1036
|
{
|
|
1003
1037
|
src: value,
|
|
@@ -1014,10 +1048,10 @@ function ImageCell({ value, name }) {
|
|
|
1014
1048
|
);
|
|
1015
1049
|
}
|
|
1016
1050
|
function AvailabilityCell({ value }) {
|
|
1017
|
-
if (!value) return /* @__PURE__ */ (0,
|
|
1051
|
+
if (!value) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { color: "#9ca3af" }, children: "\u2014" });
|
|
1018
1052
|
const inStock = /in.?stock/i.test(value);
|
|
1019
|
-
return /* @__PURE__ */ (0,
|
|
1020
|
-
/* @__PURE__ */ (0,
|
|
1053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 13, color: "var(--hsk-text, #111827)" }, children: [
|
|
1054
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: {
|
|
1021
1055
|
width: 8,
|
|
1022
1056
|
height: 8,
|
|
1023
1057
|
borderRadius: "50%",
|
|
@@ -1056,7 +1090,7 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
|
|
|
1056
1090
|
display: "flex",
|
|
1057
1091
|
alignItems: "center"
|
|
1058
1092
|
};
|
|
1059
|
-
return /* @__PURE__ */ (0,
|
|
1093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1060
1094
|
"div",
|
|
1061
1095
|
{
|
|
1062
1096
|
className: "hsk-compare-matrix",
|
|
@@ -1069,11 +1103,11 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
|
|
|
1069
1103
|
fontSize: 13
|
|
1070
1104
|
},
|
|
1071
1105
|
children: [
|
|
1072
|
-
/* @__PURE__ */ (0,
|
|
1073
|
-
/* @__PURE__ */ (0,
|
|
1106
|
+
/* @__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: [
|
|
1107
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { ...labelStyle, borderBottom: "none", color: "var(--hsk-text, #111)", fontSize: 12 }, children: "Feature" }),
|
|
1074
1108
|
products.map((p, i) => {
|
|
1075
1109
|
const { title } = (0, import_sdk4.resolveDisplayFields)(p.fields || p, displayConfig);
|
|
1076
|
-
return /* @__PURE__ */ (0,
|
|
1110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1077
1111
|
"a",
|
|
1078
1112
|
{
|
|
1079
1113
|
href: p.url || "#",
|
|
@@ -1096,7 +1130,7 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
|
|
|
1096
1130
|
);
|
|
1097
1131
|
})
|
|
1098
1132
|
] }),
|
|
1099
|
-
rows.map((row, rowIdx) => /* @__PURE__ */ (0,
|
|
1133
|
+
rows.map((row, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1100
1134
|
"div",
|
|
1101
1135
|
{
|
|
1102
1136
|
style: {
|
|
@@ -1105,18 +1139,18 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
|
|
|
1105
1139
|
background: rowIdx % 2 === 1 ? "var(--hsk-surface2, rgba(0,0,0,0.015))" : "transparent"
|
|
1106
1140
|
},
|
|
1107
1141
|
children: [
|
|
1108
|
-
/* @__PURE__ */ (0,
|
|
1142
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: labelStyle, children: row.label }),
|
|
1109
1143
|
products.map((p, i) => {
|
|
1110
1144
|
const val = row.values[i];
|
|
1111
1145
|
const isBest = row.bestIdx === i && row.values.filter(Boolean).length > 1;
|
|
1112
1146
|
const { title } = (0, import_sdk4.resolveDisplayFields)(p.fields || p, displayConfig);
|
|
1113
1147
|
if (row.type === "image") {
|
|
1114
|
-
return /* @__PURE__ */ (0,
|
|
1148
|
+
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
1149
|
}
|
|
1116
1150
|
if (row.type === "availability") {
|
|
1117
|
-
return /* @__PURE__ */ (0,
|
|
1151
|
+
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
1152
|
}
|
|
1119
|
-
return /* @__PURE__ */ (0,
|
|
1153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1120
1154
|
"div",
|
|
1121
1155
|
{
|
|
1122
1156
|
style: {
|
|
@@ -1125,7 +1159,7 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
|
|
|
1125
1159
|
color: isBest ? "var(--hsk-primary, #ea580c)" : row.type === "price" ? "var(--hsk-text, #374151)" : "var(--hsk-text, #111827)",
|
|
1126
1160
|
borderLeft: i > 0 ? "1px solid var(--hsk-border, rgba(0,0,0,0.07))" : "none"
|
|
1127
1161
|
},
|
|
1128
|
-
children: val ?? /* @__PURE__ */ (0,
|
|
1162
|
+
children: val ?? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { color: "#9ca3af" }, children: "\u2014" })
|
|
1129
1163
|
},
|
|
1130
1164
|
i
|
|
1131
1165
|
);
|
|
@@ -1141,7 +1175,7 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
|
|
|
1141
1175
|
|
|
1142
1176
|
// src/components/MarkupEditor.tsx
|
|
1143
1177
|
var import_react5 = require("react");
|
|
1144
|
-
var
|
|
1178
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1145
1179
|
var COLORS = ["#111111", "#ff5a5a", "#ffb300", "#22c55e", "#06b6d4", "#d946ef", "#9ca3af"];
|
|
1146
1180
|
var MAX_EXPORT_DIM = 1280;
|
|
1147
1181
|
function MarkupEditor({ src, onCancel, onSend }) {
|
|
@@ -1264,13 +1298,13 @@ function MarkupEditor({ src, onCancel, onSend }) {
|
|
|
1264
1298
|
}
|
|
1265
1299
|
};
|
|
1266
1300
|
const hasMarks = actions.length > 0;
|
|
1267
|
-
return /* @__PURE__ */ (0,
|
|
1268
|
-
/* @__PURE__ */ (0,
|
|
1269
|
-
/* @__PURE__ */ (0,
|
|
1270
|
-
/* @__PURE__ */ (0,
|
|
1301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup", role: "dialog", "aria-label": "Mark up image", children: [
|
|
1302
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-head", children: [
|
|
1303
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-markup-title", children: "Mark where you want the change" }),
|
|
1304
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-markup-cancel", onClick: onCancel, children: "Cancel" })
|
|
1271
1305
|
] }),
|
|
1272
|
-
/* @__PURE__ */ (0,
|
|
1273
|
-
/* @__PURE__ */ (0,
|
|
1306
|
+
/* @__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: [
|
|
1307
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1274
1308
|
"canvas",
|
|
1275
1309
|
{
|
|
1276
1310
|
ref: canvasRef,
|
|
@@ -1283,7 +1317,7 @@ function MarkupEditor({ src, onCancel, onSend }) {
|
|
|
1283
1317
|
onPointerLeave: onPointerUp
|
|
1284
1318
|
}
|
|
1285
1319
|
),
|
|
1286
|
-
pendingText && canvasRef.current && /* @__PURE__ */ (0,
|
|
1320
|
+
pendingText && canvasRef.current && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1287
1321
|
"input",
|
|
1288
1322
|
{
|
|
1289
1323
|
ref: textInputRef,
|
|
@@ -1307,8 +1341,8 @@ function MarkupEditor({ src, onCancel, onSend }) {
|
|
|
1307
1341
|
}
|
|
1308
1342
|
)
|
|
1309
1343
|
] }) }),
|
|
1310
|
-
/* @__PURE__ */ (0,
|
|
1311
|
-
/* @__PURE__ */ (0,
|
|
1344
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-tools", children: [
|
|
1345
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-colors", children: COLORS.map((c) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1312
1346
|
"button",
|
|
1313
1347
|
{
|
|
1314
1348
|
className: `hsk-markup-color${color === c ? " hsk-markup-color--on" : ""}`,
|
|
@@ -1321,16 +1355,16 @@ function MarkupEditor({ src, onCancel, onSend }) {
|
|
|
1321
1355
|
},
|
|
1322
1356
|
c
|
|
1323
1357
|
)) }),
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1325
|
-
/* @__PURE__ */ (0,
|
|
1326
|
-
/* @__PURE__ */ (0,
|
|
1327
|
-
/* @__PURE__ */ (0,
|
|
1328
|
-
/* @__PURE__ */ (0,
|
|
1329
|
-
/* @__PURE__ */ (0,
|
|
1358
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-actions", children: [
|
|
1359
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: `hsk-markup-tool${tool === "pen" ? " hsk-markup-tool--on" : ""}`, onClick: () => setTool("pen"), children: "Sketch" }),
|
|
1360
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: `hsk-markup-tool${tool === "text" ? " hsk-markup-tool--on" : ""}`, onClick: () => setTool("text"), children: "Text" }),
|
|
1361
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: `hsk-markup-tool${tool === "eraser" ? " hsk-markup-tool--on" : ""}`, onClick: () => setTool("eraser"), children: "Eraser" }),
|
|
1362
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-markup-tool", onClick: () => setActions((prev) => prev.slice(0, -1)), disabled: !hasMarks, children: "Undo" }),
|
|
1363
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-markup-tool", onClick: () => setActions([]), disabled: !hasMarks, children: "Clear" })
|
|
1330
1364
|
] })
|
|
1331
1365
|
] }),
|
|
1332
|
-
/* @__PURE__ */ (0,
|
|
1333
|
-
/* @__PURE__ */ (0,
|
|
1366
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-send", children: [
|
|
1367
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1334
1368
|
"input",
|
|
1335
1369
|
{
|
|
1336
1370
|
className: "hsk-markup-instruction",
|
|
@@ -1342,7 +1376,7 @@ function MarkupEditor({ src, onCancel, onSend }) {
|
|
|
1342
1376
|
}
|
|
1343
1377
|
}
|
|
1344
1378
|
),
|
|
1345
|
-
/* @__PURE__ */ (0,
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1346
1380
|
"button",
|
|
1347
1381
|
{
|
|
1348
1382
|
className: "hsk-markup-go",
|
|
@@ -1352,13 +1386,13 @@ function MarkupEditor({ src, onCancel, onSend }) {
|
|
|
1352
1386
|
}
|
|
1353
1387
|
)
|
|
1354
1388
|
] }),
|
|
1355
|
-
exportError && /* @__PURE__ */ (0,
|
|
1389
|
+
exportError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-error", children: "Couldn't process this image \u2014 try a newer visualization." })
|
|
1356
1390
|
] });
|
|
1357
1391
|
}
|
|
1358
1392
|
|
|
1359
1393
|
// src/components/KikuButton.tsx
|
|
1360
|
-
var
|
|
1361
|
-
var KikuIcon = ({ className, size = 18 }) => /* @__PURE__ */ (0,
|
|
1394
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1395
|
+
var KikuIcon = ({ className, size = 18 }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1362
1396
|
"svg",
|
|
1363
1397
|
{
|
|
1364
1398
|
className: cn("hsk-brand-mark", className),
|
|
@@ -1367,52 +1401,48 @@ var KikuIcon = ({ className, size = 18 }) => /* @__PURE__ */ (0, import_jsx_runt
|
|
|
1367
1401
|
viewBox: "0 0 100 100",
|
|
1368
1402
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1369
1403
|
"aria-label": "kiku",
|
|
1370
|
-
children: /* @__PURE__ */ (0,
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
1404
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("g", { transform: "translate(22.7 19) scale(0.62)", fill: "currentColor", fillRule: "evenodd", children: [
|
|
1405
|
+
/* @__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" }),
|
|
1406
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "55", cy: "82", r: "3.4" })
|
|
1373
1407
|
] })
|
|
1374
1408
|
}
|
|
1375
1409
|
);
|
|
1376
1410
|
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" })
|
|
1411
|
+
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" }) });
|
|
1412
|
+
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: [
|
|
1413
|
+
/* @__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" }),
|
|
1414
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("polyline", { points: "15 3 21 3 21 9" }),
|
|
1415
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
1386
1416
|
] });
|
|
1387
|
-
var ContinueIcon = () => /* @__PURE__ */ (0,
|
|
1388
|
-
var CloseIcon = () => /* @__PURE__ */ (0,
|
|
1389
|
-
/* @__PURE__ */ (0,
|
|
1390
|
-
/* @__PURE__ */ (0,
|
|
1417
|
+
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" }) });
|
|
1418
|
+
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: [
|
|
1419
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1420
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1391
1421
|
] });
|
|
1392
|
-
var ChevronRightIcon = () => /* @__PURE__ */ (0,
|
|
1393
|
-
var HistoryIcon = () => /* @__PURE__ */ (0,
|
|
1394
|
-
/* @__PURE__ */ (0,
|
|
1395
|
-
/* @__PURE__ */ (0,
|
|
1396
|
-
/* @__PURE__ */ (0,
|
|
1422
|
+
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" }) });
|
|
1423
|
+
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: [
|
|
1424
|
+
/* @__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" }),
|
|
1425
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M3 3v5h5" }),
|
|
1426
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 7v5l4 2" })
|
|
1397
1427
|
] });
|
|
1398
|
-
var BookmarkIcon = () => /* @__PURE__ */ (0,
|
|
1399
|
-
var TrashIcon = () => /* @__PURE__ */ (0,
|
|
1400
|
-
/* @__PURE__ */ (0,
|
|
1401
|
-
/* @__PURE__ */ (0,
|
|
1428
|
+
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" }) });
|
|
1429
|
+
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: [
|
|
1430
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M3 6h18" }),
|
|
1431
|
+
/* @__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
1432
|
] });
|
|
1403
|
-
var PaperclipIcon = () => /* @__PURE__ */ (0,
|
|
1404
|
-
var MicIcon2 = () => /* @__PURE__ */ (0,
|
|
1405
|
-
/* @__PURE__ */ (0,
|
|
1406
|
-
/* @__PURE__ */ (0,
|
|
1407
|
-
/* @__PURE__ */ (0,
|
|
1433
|
+
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" }) });
|
|
1434
|
+
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: [
|
|
1435
|
+
/* @__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" }),
|
|
1436
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
1437
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
|
|
1408
1438
|
] });
|
|
1409
|
-
var MicOffIcon = () => /* @__PURE__ */ (0,
|
|
1410
|
-
/* @__PURE__ */ (0,
|
|
1411
|
-
/* @__PURE__ */ (0,
|
|
1412
|
-
/* @__PURE__ */ (0,
|
|
1413
|
-
/* @__PURE__ */ (0,
|
|
1414
|
-
/* @__PURE__ */ (0,
|
|
1415
|
-
/* @__PURE__ */ (0,
|
|
1439
|
+
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: [
|
|
1440
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "2", y1: "2", x2: "22", y2: "22" }),
|
|
1441
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M18.89 13.23A7.12 7.12 0 0 0 19 12v-2" }),
|
|
1442
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M5 10v2a7 7 0 0 0 12 5" }),
|
|
1443
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M15 9.34V5a3 3 0 0 0-5.68-1.33" }),
|
|
1444
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" }),
|
|
1445
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
|
|
1416
1446
|
] });
|
|
1417
1447
|
var DEFAULT_CHIPS = [];
|
|
1418
1448
|
function extractName(raw) {
|
|
@@ -1462,7 +1492,7 @@ function KikuPickerMenu({
|
|
|
1462
1492
|
onDismiss
|
|
1463
1493
|
}) {
|
|
1464
1494
|
const discussed = sources.filter((s) => s.id && referencedIds.includes(s.id));
|
|
1465
|
-
return /* @__PURE__ */ (0,
|
|
1495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1466
1496
|
"div",
|
|
1467
1497
|
{
|
|
1468
1498
|
className: "hsk-kiku-picker",
|
|
@@ -1470,7 +1500,7 @@ function KikuPickerMenu({
|
|
|
1470
1500
|
"aria-label": "@kiku commands",
|
|
1471
1501
|
onMouseDown: (e) => e.preventDefault(),
|
|
1472
1502
|
children: [
|
|
1473
|
-
discussed.map((src, i) => /* @__PURE__ */ (0,
|
|
1503
|
+
discussed.map((src, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1474
1504
|
"button",
|
|
1475
1505
|
{
|
|
1476
1506
|
className: "hsk-kiku-picker-item",
|
|
@@ -1480,9 +1510,9 @@ function KikuPickerMenu({
|
|
|
1480
1510
|
onDismiss();
|
|
1481
1511
|
},
|
|
1482
1512
|
children: [
|
|
1483
|
-
/* @__PURE__ */ (0,
|
|
1484
|
-
/* @__PURE__ */ (0,
|
|
1485
|
-
src.price && /* @__PURE__ */ (0,
|
|
1513
|
+
/* @__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, {}) }),
|
|
1514
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: src.name }),
|
|
1515
|
+
src.price && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-kiku-picker-item-price", children: [
|
|
1486
1516
|
src.currency ?? defaultCurrency,
|
|
1487
1517
|
" ",
|
|
1488
1518
|
parseFloat(String(src.price).replace(/[^0-9.]/g, "") || "0").toLocaleString()
|
|
@@ -1491,7 +1521,7 @@ function KikuPickerMenu({
|
|
|
1491
1521
|
},
|
|
1492
1522
|
src.id ?? i
|
|
1493
1523
|
)),
|
|
1494
|
-
discussed.length > 1 && /* @__PURE__ */ (0,
|
|
1524
|
+
discussed.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1495
1525
|
"button",
|
|
1496
1526
|
{
|
|
1497
1527
|
className: "hsk-kiku-picker-item",
|
|
@@ -1501,8 +1531,8 @@ function KikuPickerMenu({
|
|
|
1501
1531
|
onDismiss();
|
|
1502
1532
|
},
|
|
1503
1533
|
children: [
|
|
1504
|
-
/* @__PURE__ */ (0,
|
|
1505
|
-
/* @__PURE__ */ (0,
|
|
1534
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BookmarkIcon, {}) }),
|
|
1535
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-kiku-picker-item-name", children: [
|
|
1506
1536
|
"Capture all (",
|
|
1507
1537
|
discussed.length,
|
|
1508
1538
|
")"
|
|
@@ -1510,7 +1540,7 @@ function KikuPickerMenu({
|
|
|
1510
1540
|
]
|
|
1511
1541
|
}
|
|
1512
1542
|
),
|
|
1513
|
-
discussed.length === 0 && /* @__PURE__ */ (0,
|
|
1543
|
+
discussed.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1514
1544
|
"button",
|
|
1515
1545
|
{
|
|
1516
1546
|
className: "hsk-kiku-picker-item",
|
|
@@ -1520,12 +1550,12 @@ function KikuPickerMenu({
|
|
|
1520
1550
|
onDismiss();
|
|
1521
1551
|
},
|
|
1522
1552
|
children: [
|
|
1523
|
-
/* @__PURE__ */ (0,
|
|
1524
|
-
/* @__PURE__ */ (0,
|
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BookmarkIcon, {}) }),
|
|
1554
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "Capture current page" })
|
|
1525
1555
|
]
|
|
1526
1556
|
}
|
|
1527
1557
|
),
|
|
1528
|
-
/* @__PURE__ */ (0,
|
|
1558
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1529
1559
|
"button",
|
|
1530
1560
|
{
|
|
1531
1561
|
className: "hsk-kiku-picker-item",
|
|
@@ -1535,12 +1565,12 @@ function KikuPickerMenu({
|
|
|
1535
1565
|
onDismiss();
|
|
1536
1566
|
},
|
|
1537
1567
|
children: [
|
|
1538
|
-
/* @__PURE__ */ (0,
|
|
1539
|
-
/* @__PURE__ */ (0,
|
|
1568
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(HistoryIcon, {}) }),
|
|
1569
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "What have you saved?" })
|
|
1540
1570
|
]
|
|
1541
1571
|
}
|
|
1542
1572
|
),
|
|
1543
|
-
/* @__PURE__ */ (0,
|
|
1573
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1544
1574
|
"button",
|
|
1545
1575
|
{
|
|
1546
1576
|
className: "hsk-kiku-picker-item",
|
|
@@ -1550,8 +1580,8 @@ function KikuPickerMenu({
|
|
|
1550
1580
|
onDismiss();
|
|
1551
1581
|
},
|
|
1552
1582
|
children: [
|
|
1553
|
-
/* @__PURE__ */ (0,
|
|
1554
|
-
/* @__PURE__ */ (0,
|
|
1583
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TrashIcon, {}) }),
|
|
1584
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "Delete this" })
|
|
1555
1585
|
]
|
|
1556
1586
|
}
|
|
1557
1587
|
)
|
|
@@ -1560,22 +1590,22 @@ function KikuPickerMenu({
|
|
|
1560
1590
|
);
|
|
1561
1591
|
}
|
|
1562
1592
|
function AtPickerMenu({ onSelect, onDismiss }) {
|
|
1563
|
-
return /* @__PURE__ */ (0,
|
|
1593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1564
1594
|
"div",
|
|
1565
1595
|
{
|
|
1566
1596
|
className: "hsk-kiku-picker",
|
|
1567
1597
|
role: "menu",
|
|
1568
1598
|
"aria-label": "Extensions",
|
|
1569
1599
|
onMouseDown: (e) => e.preventDefault(),
|
|
1570
|
-
children: /* @__PURE__ */ (0,
|
|
1600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1571
1601
|
"button",
|
|
1572
1602
|
{
|
|
1573
1603
|
className: "hsk-kiku-picker-item",
|
|
1574
1604
|
role: "menuitem",
|
|
1575
1605
|
onClick: () => onSelect("@kiku"),
|
|
1576
1606
|
children: [
|
|
1577
|
-
/* @__PURE__ */ (0,
|
|
1578
|
-
/* @__PURE__ */ (0,
|
|
1607
|
+
/* @__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, {}) }),
|
|
1608
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "kiku \u2014 capture & remember" })
|
|
1579
1609
|
]
|
|
1580
1610
|
}
|
|
1581
1611
|
)
|
|
@@ -1585,9 +1615,9 @@ function AtPickerMenu({ onSelect, onDismiss }) {
|
|
|
1585
1615
|
function SourceImg({ src, alt, onImageClick }) {
|
|
1586
1616
|
const [failed, setFailed] = (0, import_react6.useState)(false);
|
|
1587
1617
|
if (failed) {
|
|
1588
|
-
return /* @__PURE__ */ (0,
|
|
1618
|
+
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
1619
|
}
|
|
1590
|
-
return /* @__PURE__ */ (0,
|
|
1620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1591
1621
|
"img",
|
|
1592
1622
|
{
|
|
1593
1623
|
src,
|
|
@@ -1628,20 +1658,20 @@ function SourcesCarousel({ sources, defaultCurrency, onSelectSource, onImageClic
|
|
|
1628
1658
|
};
|
|
1629
1659
|
const display = sources.filter((s) => s.id && referencedIds.includes(s.id));
|
|
1630
1660
|
if (display.length === 0) return null;
|
|
1631
|
-
return /* @__PURE__ */ (0,
|
|
1632
|
-
/* @__PURE__ */ (0,
|
|
1661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("hsk-cb-sources-wrap", compact && "hsk-cb-sources-wrap--compact"), children: [
|
|
1662
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-sources", ref: railRef, children: display.map((src, si) => {
|
|
1633
1663
|
const isReferenced = !!(src.id && referencedIds.includes(src.id));
|
|
1634
|
-
return /* @__PURE__ */ (0,
|
|
1664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1635
1665
|
"div",
|
|
1636
1666
|
{
|
|
1637
1667
|
className: cn("hsk-cb-source", isReferenced && "hsk-cb-source--referenced"),
|
|
1638
1668
|
style: { animationDelay: `${si * 50}ms` },
|
|
1639
1669
|
onClick: () => onSelectSource?.(src),
|
|
1640
1670
|
children: [
|
|
1641
|
-
src.image ? /* @__PURE__ */ (0,
|
|
1642
|
-
/* @__PURE__ */ (0,
|
|
1643
|
-
isReferenced && /* @__PURE__ */ (0,
|
|
1644
|
-
isProperty && /* @__PURE__ */ (0,
|
|
1671
|
+
src.image ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-src-imgwrap", style: { position: "relative" }, children: [
|
|
1672
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SourceImg, { src: src.image, alt: src.name, onImageClick }),
|
|
1673
|
+
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 }) }),
|
|
1674
|
+
isProperty && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: {
|
|
1645
1675
|
position: "absolute",
|
|
1646
1676
|
top: "6px",
|
|
1647
1677
|
right: "6px",
|
|
@@ -1656,14 +1686,14 @@ function SourcesCarousel({ sources, defaultCurrency, onSelectSource, onImageClic
|
|
|
1656
1686
|
color: "#fbbf24",
|
|
1657
1687
|
// Gold sparkle badge
|
|
1658
1688
|
boxShadow: "0 2px 4px rgba(0,0,0,0.2)"
|
|
1659
|
-
}, children: /* @__PURE__ */ (0,
|
|
1660
|
-
] }) : /* @__PURE__ */ (0,
|
|
1661
|
-
/* @__PURE__ */ (0,
|
|
1662
|
-
isReferenced && /* @__PURE__ */ (0,
|
|
1689
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, { size: 12 }) })
|
|
1690
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-src-imgwrap-empty", style: { position: "relative" }, children: [
|
|
1691
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}),
|
|
1692
|
+
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
1693
|
] }),
|
|
1664
|
-
/* @__PURE__ */ (0,
|
|
1665
|
-
/* @__PURE__ */ (0,
|
|
1666
|
-
src.price && /* @__PURE__ */ (0,
|
|
1694
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-src-info", children: [
|
|
1695
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-src-name", children: src.name }),
|
|
1696
|
+
src.price && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-src-price", children: [
|
|
1667
1697
|
src.currency ?? defaultCurrency,
|
|
1668
1698
|
" ",
|
|
1669
1699
|
parseFloat(String(src.price).replace(/[^0-9.]/g, "") || "0").toLocaleString()
|
|
@@ -1674,15 +1704,15 @@ function SourcesCarousel({ sources, defaultCurrency, onSelectSource, onImageClic
|
|
|
1674
1704
|
src.id ?? si
|
|
1675
1705
|
);
|
|
1676
1706
|
}) }),
|
|
1677
|
-
showNext && /* @__PURE__ */ (0,
|
|
1678
|
-
/* @__PURE__ */ (0,
|
|
1707
|
+
showNext && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1708
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1679
1709
|
"div",
|
|
1680
1710
|
{
|
|
1681
1711
|
className: "hsk-cb-sources-fade",
|
|
1682
1712
|
style: { background: "linear-gradient(to right, transparent, var(--hsk-fade-bg, #0e0e0f))" }
|
|
1683
1713
|
}
|
|
1684
1714
|
),
|
|
1685
|
-
/* @__PURE__ */ (0,
|
|
1715
|
+
/* @__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
1716
|
] })
|
|
1687
1717
|
] });
|
|
1688
1718
|
}
|
|
@@ -1759,14 +1789,14 @@ function SmartContextPills({
|
|
|
1759
1789
|
pills.push({ emoji: "\u{1F4A1}", label: "Recommend something", query: "What do you recommend for me?" });
|
|
1760
1790
|
}
|
|
1761
1791
|
if (pills.length === 0) return null;
|
|
1762
|
-
return /* @__PURE__ */ (0,
|
|
1792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-action-pills", children: pills.map((pill) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1763
1793
|
"button",
|
|
1764
1794
|
{
|
|
1765
1795
|
className: "hsk-action-pill",
|
|
1766
1796
|
onClick: () => onSend(pill.query),
|
|
1767
1797
|
disabled: loading,
|
|
1768
1798
|
children: [
|
|
1769
|
-
/* @__PURE__ */ (0,
|
|
1799
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-pill-emoji", children: pill.emoji }),
|
|
1770
1800
|
pill.label
|
|
1771
1801
|
]
|
|
1772
1802
|
},
|
|
@@ -1847,8 +1877,8 @@ function ThinkingBlock({ text, isComplete, seconds: fixedSeconds }) {
|
|
|
1847
1877
|
const finalSeconds = fixedSeconds ?? seconds;
|
|
1848
1878
|
const label = isComplete ? finalSeconds !== null && finalSeconds !== void 0 ? `Thought for ${finalSeconds}s` : "Thought process" : `Thinking${seconds ? ` \xB7 ${seconds}s` : "\u2026"}`;
|
|
1849
1879
|
const expandable = !!text;
|
|
1850
|
-
return /* @__PURE__ */ (0,
|
|
1851
|
-
/* @__PURE__ */ (0,
|
|
1880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("hsk-cb-think", !isComplete && "hsk-cb-think--live"), children: [
|
|
1881
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1852
1882
|
"button",
|
|
1853
1883
|
{
|
|
1854
1884
|
type: "button",
|
|
@@ -1856,16 +1886,16 @@ function ThinkingBlock({ text, isComplete, seconds: fixedSeconds }) {
|
|
|
1856
1886
|
onClick: expandable ? () => setIsOpen((o) => !o) : void 0,
|
|
1857
1887
|
"aria-expanded": expandable ? isOpen : void 0,
|
|
1858
1888
|
children: [
|
|
1859
|
-
/* @__PURE__ */ (0,
|
|
1860
|
-
/* @__PURE__ */ (0,
|
|
1861
|
-
/* @__PURE__ */ (0,
|
|
1889
|
+
/* @__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: [
|
|
1890
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1891
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 6v6l4 2" })
|
|
1862
1892
|
] }),
|
|
1863
|
-
/* @__PURE__ */ (0,
|
|
1864
|
-
expandable && /* @__PURE__ */ (0,
|
|
1893
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: label }),
|
|
1894
|
+
expandable && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: cn("hsk-cb-think-chevron", isOpen && "hsk-cb-think-chevron--open"), children: "\u25B6" })
|
|
1865
1895
|
]
|
|
1866
1896
|
}
|
|
1867
1897
|
),
|
|
1868
|
-
expandable && isOpen && /* @__PURE__ */ (0,
|
|
1898
|
+
expandable && isOpen && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-think-body", children: text })
|
|
1869
1899
|
] });
|
|
1870
1900
|
}
|
|
1871
1901
|
function ChatModal({
|
|
@@ -2011,15 +2041,7 @@ function ChatModal({
|
|
|
2011
2041
|
}, 1e3);
|
|
2012
2042
|
return () => clearInterval(t);
|
|
2013
2043
|
}, [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;
|
|
2044
|
+
const { themeAttr: hskThemeAttr, vars: customStyles } = resolveTheme(theme);
|
|
2023
2045
|
const retryLastMessage = async () => {
|
|
2024
2046
|
const lastUserMsg = [...messages].reverse().find((m) => m.role === "user");
|
|
2025
2047
|
if (lastUserMsg) await handleSend(lastUserMsg.content);
|
|
@@ -2215,7 +2237,7 @@ function ChatModal({
|
|
|
2215
2237
|
}, [voiceState]);
|
|
2216
2238
|
const blurVal = typeof backdropBlur === "number" ? `${backdropBlur}px` : backdropBlur ?? "20px";
|
|
2217
2239
|
const displayMessages = messages;
|
|
2218
|
-
return /* @__PURE__ */ (0,
|
|
2240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2219
2241
|
"div",
|
|
2220
2242
|
{
|
|
2221
2243
|
className: cn("hsk-cb-overlay", classNames.overlay),
|
|
@@ -2227,7 +2249,7 @@ function ChatModal({
|
|
|
2227
2249
|
...backdropColor ? { background: backdropColor } : {},
|
|
2228
2250
|
...customStyles
|
|
2229
2251
|
},
|
|
2230
|
-
children: /* @__PURE__ */ (0,
|
|
2252
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2231
2253
|
"div",
|
|
2232
2254
|
{
|
|
2233
2255
|
className: cn("hsk-cb-panel", classNames.panel),
|
|
@@ -2240,11 +2262,11 @@ function ChatModal({
|
|
|
2240
2262
|
}
|
|
2241
2263
|
},
|
|
2242
2264
|
children: [
|
|
2243
|
-
lightboxSrc && /* @__PURE__ */ (0,
|
|
2244
|
-
/* @__PURE__ */ (0,
|
|
2245
|
-
/* @__PURE__ */ (0,
|
|
2265
|
+
lightboxSrc && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-lightbox", onClick: () => setLightboxSrc(null), children: [
|
|
2266
|
+
/* @__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, {}) }),
|
|
2267
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: lightboxSrc, alt: "", className: "hsk-lightbox-img", onClick: (e) => e.stopPropagation() })
|
|
2246
2268
|
] }),
|
|
2247
|
-
markupSrc && /* @__PURE__ */ (0,
|
|
2269
|
+
markupSrc && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-markup-overlay", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2248
2270
|
MarkupEditor,
|
|
2249
2271
|
{
|
|
2250
2272
|
src: markupSrc,
|
|
@@ -2258,44 +2280,44 @@ function ChatModal({
|
|
|
2258
2280
|
}
|
|
2259
2281
|
}
|
|
2260
2282
|
) }),
|
|
2261
|
-
/* @__PURE__ */ (0,
|
|
2262
|
-
/* @__PURE__ */ (0,
|
|
2263
|
-
/* @__PURE__ */ (0,
|
|
2264
|
-
/* @__PURE__ */ (0,
|
|
2265
|
-
/* @__PURE__ */ (0,
|
|
2283
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-main", children: [
|
|
2284
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-topbar", children: [
|
|
2285
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-topbar-left", children: [
|
|
2286
|
+
/* @__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, {}) }),
|
|
2287
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-topbar-title", children: activeTitle }) })
|
|
2266
2288
|
] }),
|
|
2267
|
-
/* @__PURE__ */ (0,
|
|
2268
|
-
messages.length > 0 && /* @__PURE__ */ (0,
|
|
2269
|
-
/* @__PURE__ */ (0,
|
|
2289
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-topbar-actions", children: [
|
|
2290
|
+
messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-topbar-btn", onClick: handleReset, children: "Clear chat" }),
|
|
2291
|
+
/* @__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
2292
|
] })
|
|
2271
2293
|
] }),
|
|
2272
|
-
/* @__PURE__ */ (0,
|
|
2273
|
-
displayMessages.length === 0 ? /* @__PURE__ */ (0,
|
|
2274
|
-
awaitingName ? /* @__PURE__ */ (0,
|
|
2275
|
-
/* @__PURE__ */ (0,
|
|
2294
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-msgs", ref: msgsContainerRef, children: [
|
|
2295
|
+
displayMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-empty", children: [
|
|
2296
|
+
awaitingName ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2297
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("h2", { className: "hsk-cb-hello", children: [
|
|
2276
2298
|
"Hi, I'm ",
|
|
2277
|
-
/* @__PURE__ */ (0,
|
|
2299
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("b", { children: "kiku" }),
|
|
2278
2300
|
"."
|
|
2279
2301
|
] }),
|
|
2280
|
-
/* @__PURE__ */ (0,
|
|
2281
|
-
/* @__PURE__ */ (0,
|
|
2282
|
-
/* @__PURE__ */ (0,
|
|
2283
|
-
] }) : shopperName ? /* @__PURE__ */ (0,
|
|
2284
|
-
/* @__PURE__ */ (0,
|
|
2302
|
+
/* @__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." }),
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "hsk-cb-hello-ask", children: "What should I call you?" }),
|
|
2304
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-hello-skip", onClick: () => setNameSkipped(true), children: "Skip for now" })
|
|
2305
|
+
] }) : shopperName ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2306
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("h2", { className: "hsk-cb-hello", children: [
|
|
2285
2307
|
"Hi, ",
|
|
2286
2308
|
shopperName,
|
|
2287
2309
|
"."
|
|
2288
2310
|
] }),
|
|
2289
|
-
/* @__PURE__ */ (0,
|
|
2290
|
-
] }) : /* @__PURE__ */ (0,
|
|
2291
|
-
/* @__PURE__ */ (0,
|
|
2311
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "hsk-cb-hello-lead", children: "What can I find for you today?" })
|
|
2312
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2313
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("h2", { className: "hsk-cb-hello", children: [
|
|
2292
2314
|
"Hi, I'm ",
|
|
2293
|
-
/* @__PURE__ */ (0,
|
|
2315
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("b", { children: "kiku" }),
|
|
2294
2316
|
"."
|
|
2295
2317
|
] }),
|
|
2296
|
-
/* @__PURE__ */ (0,
|
|
2318
|
+
/* @__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
2319
|
] }),
|
|
2298
|
-
!awaitingName && activeChips.length > 0 && /* @__PURE__ */ (0,
|
|
2320
|
+
!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
2321
|
"button",
|
|
2300
2322
|
{
|
|
2301
2323
|
className: "hsk-cb-chip",
|
|
@@ -2311,37 +2333,49 @@ function ChatModal({
|
|
|
2311
2333
|
const compareSources = sources.filter((s) => s.id && referencedIds.includes(s.id));
|
|
2312
2334
|
const showMatrix = isLast && lastIntent === "compare" && compareSources.length >= 2;
|
|
2313
2335
|
const displayContent = !isUser && showMatrix ? stripMarkdownTables(msg.content) : msg.content;
|
|
2314
|
-
return /* @__PURE__ */ (0,
|
|
2336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-msg-group", ref: (el) => {
|
|
2315
2337
|
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,
|
|
2338
|
+
}, children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: `hsk-cb-user-msg${isLastUser ? " hsk-sent" : ""}`, children: [
|
|
2339
|
+
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)) }),
|
|
2340
|
+
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: [
|
|
2341
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-badge", children: "@kiku" }),
|
|
2320
2342
|
msg.content.replace(/^@kiku\s*/i, "")
|
|
2321
2343
|
] }) : msg.content })
|
|
2322
|
-
] }) : /* @__PURE__ */ (0,
|
|
2323
|
-
/* @__PURE__ */ (0,
|
|
2324
|
-
/* @__PURE__ */ (0,
|
|
2344
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
|
|
2345
|
+
/* @__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, {}) }),
|
|
2346
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-body", children: [
|
|
2325
2347
|
(() => {
|
|
2326
2348
|
const parsed = parseThinking(displayContent);
|
|
2327
2349
|
const thinking = msg.thinking || parsed.thinking;
|
|
2328
2350
|
const content = parsed.content;
|
|
2329
2351
|
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,
|
|
2352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2353
|
+
(thinking || msg.thoughtForSeconds != null) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ThinkingBlock, { text: thinking, isComplete, seconds: msg.thoughtForSeconds }),
|
|
2354
|
+
content && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-text", children: [
|
|
2333
2355
|
renderMarkdown(content, isLast && streaming),
|
|
2334
|
-
isLast && streaming && /* @__PURE__ */ (0,
|
|
2356
|
+
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
2357
|
] })
|
|
2336
2358
|
] });
|
|
2337
2359
|
})(),
|
|
2338
|
-
msg.visualizing && /* @__PURE__ */ (0,
|
|
2339
|
-
/* @__PURE__ */ (0,
|
|
2340
|
-
/* @__PURE__ */ (0,
|
|
2360
|
+
msg.visualizing && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-viz hsk-cb-viz--loading", children: [
|
|
2361
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-viz-spinner" }),
|
|
2362
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: msg.visualizingText || "Visualizing\u2026" })
|
|
2341
2363
|
] }),
|
|
2342
|
-
msg.visualization && /* @__PURE__ */ (0,
|
|
2343
|
-
/* @__PURE__ */ (0,
|
|
2344
|
-
/* @__PURE__ */ (0,
|
|
2364
|
+
msg.visualization && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-viz", children: [
|
|
2365
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-viz-imgwrap", children: [
|
|
2366
|
+
msg.visualizationType === "video" || msg.visualization.includes("/videos/") ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2367
|
+
"video",
|
|
2368
|
+
{
|
|
2369
|
+
src: msg.visualization,
|
|
2370
|
+
controls: true,
|
|
2371
|
+
autoPlay: true,
|
|
2372
|
+
loop: true,
|
|
2373
|
+
muted: true,
|
|
2374
|
+
playsInline: true,
|
|
2375
|
+
className: "hsk-markdown-video",
|
|
2376
|
+
style: { display: "block", maxHeight: "400px", objectFit: "contain", width: "100%" }
|
|
2377
|
+
}
|
|
2378
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2345
2379
|
"img",
|
|
2346
2380
|
{
|
|
2347
2381
|
src: msg.visualization,
|
|
@@ -2352,18 +2386,18 @@ function ChatModal({
|
|
|
2352
2386
|
}
|
|
2353
2387
|
}
|
|
2354
2388
|
),
|
|
2355
|
-
isLast && !streaming && /* @__PURE__ */ (0,
|
|
2356
|
-
/* @__PURE__ */ (0,
|
|
2357
|
-
/* @__PURE__ */ (0,
|
|
2358
|
-
/* @__PURE__ */ (0,
|
|
2389
|
+
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: [
|
|
2390
|
+
/* @__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: [
|
|
2391
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 20h9" }),
|
|
2392
|
+
/* @__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
2393
|
] }),
|
|
2360
2394
|
"Mark & edit"
|
|
2361
2395
|
] })
|
|
2362
2396
|
] }),
|
|
2363
|
-
/* @__PURE__ */ (0,
|
|
2397
|
+
/* @__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
2398
|
] }),
|
|
2365
|
-
!isUser && (msg.knowledgeImages?.length ?? 0) > 0 && /* @__PURE__ */ (0,
|
|
2366
|
-
/* @__PURE__ */ (0,
|
|
2399
|
+
!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: [
|
|
2400
|
+
/* @__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
2401
|
"img",
|
|
2368
2402
|
{
|
|
2369
2403
|
src: img.url,
|
|
@@ -2377,16 +2411,16 @@ function ChatModal({
|
|
|
2377
2411
|
},
|
|
2378
2412
|
i
|
|
2379
2413
|
)) }),
|
|
2380
|
-
(ref.title || ref.images[0]?.note) && /* @__PURE__ */ (0,
|
|
2414
|
+
(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
2415
|
] }, ref.entryId)) }),
|
|
2382
|
-
showMatrix && /* @__PURE__ */ (0,
|
|
2416
|
+
showMatrix && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComparisonMatrix, { sources: compareSources, defaultCurrency }),
|
|
2383
2417
|
(() => {
|
|
2384
2418
|
const msgReferencedIds = isLast ? referencedIds : msg.referencedIds ?? [];
|
|
2385
2419
|
const msgSources = isLast ? sources : msg.sources ?? [];
|
|
2386
2420
|
const msgIntent = isLast ? lastIntent : msg.intent;
|
|
2387
2421
|
const hiddenIntent = msgIntent === "compare" || msgIntent === "capture" || msgIntent === "capture_all" || msgIntent === "delete" || msgIntent === "view_history";
|
|
2388
2422
|
const showCarousel = msgReferencedIds.length > 0 && !hiddenIntent && (!isLast || lastAction?.type !== "request_kiku_key");
|
|
2389
|
-
return showCarousel && /* @__PURE__ */ (0,
|
|
2423
|
+
return showCarousel && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2390
2424
|
SourcesCarousel,
|
|
2391
2425
|
{
|
|
2392
2426
|
sources: msgSources,
|
|
@@ -2398,11 +2432,11 @@ function ChatModal({
|
|
|
2398
2432
|
}
|
|
2399
2433
|
);
|
|
2400
2434
|
})(),
|
|
2401
|
-
isLast && !loading && lastAction?.url && /* @__PURE__ */ (0,
|
|
2435
|
+
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
2436
|
String(lastAction.type || "continue").replace(/_/g, " "),
|
|
2403
2437
|
" \u2192"
|
|
2404
2438
|
] }) }),
|
|
2405
|
-
isLast && !loading && /* @__PURE__ */ (0,
|
|
2439
|
+
isLast && !loading && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2406
2440
|
SmartContextPills,
|
|
2407
2441
|
{
|
|
2408
2442
|
intent: lastIntent,
|
|
@@ -2414,16 +2448,16 @@ function ChatModal({
|
|
|
2414
2448
|
] })
|
|
2415
2449
|
] }) }, idx);
|
|
2416
2450
|
}),
|
|
2417
|
-
selectedProduct && loading && /* @__PURE__ */ (0,
|
|
2451
|
+
selectedProduct && loading && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2418
2452
|
"div",
|
|
2419
2453
|
{
|
|
2420
2454
|
className: "hsk-cb-selected-product",
|
|
2421
2455
|
onClick: () => selectedProduct.url && window.open(selectedProduct.url, "_blank"),
|
|
2422
2456
|
children: [
|
|
2423
|
-
selectedProduct.image && /* @__PURE__ */ (0,
|
|
2424
|
-
/* @__PURE__ */ (0,
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2426
|
-
selectedProduct.price && /* @__PURE__ */ (0,
|
|
2457
|
+
selectedProduct.image && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { className: "hsk-cb-selected-img", src: selectedProduct.image, alt: selectedProduct.name }),
|
|
2458
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-selected-info", children: [
|
|
2459
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-selected-name", children: selectedProduct.name }),
|
|
2460
|
+
selectedProduct.price && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-selected-price", children: [
|
|
2427
2461
|
selectedProduct.currency ?? defaultCurrency,
|
|
2428
2462
|
" ",
|
|
2429
2463
|
parseFloat(String(selectedProduct.price ?? "").replace(/[^0-9.]/g, "") || "0").toLocaleString()
|
|
@@ -2432,22 +2466,22 @@ function ChatModal({
|
|
|
2432
2466
|
]
|
|
2433
2467
|
}
|
|
2434
2468
|
),
|
|
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,
|
|
2469
|
+
loading && !streaming && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-typing-row", style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
2470
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-thinking-icon", children: [
|
|
2471
|
+
/* @__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" }) }),
|
|
2472
|
+
/* @__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" }) }),
|
|
2473
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-orbit", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-handle-ring", children: [
|
|
2474
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" }),
|
|
2475
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" }),
|
|
2476
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" }),
|
|
2477
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" }),
|
|
2478
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" })
|
|
2445
2479
|
] }) }),
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2480
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-rest" })
|
|
2447
2481
|
] }),
|
|
2448
|
-
/* @__PURE__ */ (0,
|
|
2482
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-thinking-text", children: "Thinking\u2026" })
|
|
2449
2483
|
] }),
|
|
2450
|
-
lastAction?.type === "open_memory" && lastAction.url && !loading && !streaming && /* @__PURE__ */ (0,
|
|
2484
|
+
lastAction?.type === "open_memory" && lastAction.url && !loading && !streaming && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2451
2485
|
"a",
|
|
2452
2486
|
{
|
|
2453
2487
|
className: "hsk-cb-memory-pill",
|
|
@@ -2456,23 +2490,23 @@ function ChatModal({
|
|
|
2456
2490
|
rel: "noopener noreferrer",
|
|
2457
2491
|
children: [
|
|
2458
2492
|
"Open my memory on mimi",
|
|
2459
|
-
/* @__PURE__ */ (0,
|
|
2493
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ExternalIcon, {})
|
|
2460
2494
|
]
|
|
2461
2495
|
}
|
|
2462
2496
|
),
|
|
2463
|
-
(stopped || interrupted) && !loading && !streaming && messages.length > 0 && /* @__PURE__ */ (0,
|
|
2464
|
-
/* @__PURE__ */ (0,
|
|
2465
|
-
/* @__PURE__ */ (0,
|
|
2466
|
-
/* @__PURE__ */ (0,
|
|
2497
|
+
(stopped || interrupted) && !loading && !streaming && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-stopped", children: [
|
|
2498
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-stopped-label", children: stopped ? "You stopped this response." : "This response was interrupted." }),
|
|
2499
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { className: "hsk-cb-continue", onClick: continueGenerating, children: [
|
|
2500
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ContinueIcon, {}),
|
|
2467
2501
|
messages[messages.length - 1]?.role === "assistant" ? "Continue generating" : "Generate response"
|
|
2468
2502
|
] })
|
|
2469
2503
|
] }),
|
|
2470
|
-
error && /* @__PURE__ */ (0,
|
|
2471
|
-
keyPhase === "prompt_key" && /* @__PURE__ */ (0,
|
|
2472
|
-
/* @__PURE__ */ (0,
|
|
2473
|
-
/* @__PURE__ */ (0,
|
|
2474
|
-
/* @__PURE__ */ (0,
|
|
2475
|
-
/* @__PURE__ */ (0,
|
|
2504
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-error", children: getFriendlyError(error) }),
|
|
2505
|
+
keyPhase === "prompt_key" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
|
|
2506
|
+
/* @__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, {}) }),
|
|
2507
|
+
/* @__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: [
|
|
2508
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "hsk-cb-phone-label", children: "Paste your public id \u2014 or create one" }),
|
|
2509
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2476
2510
|
"input",
|
|
2477
2511
|
{
|
|
2478
2512
|
type: "text",
|
|
@@ -2484,49 +2518,49 @@ function ChatModal({
|
|
|
2484
2518
|
autoFocus: true
|
|
2485
2519
|
}
|
|
2486
2520
|
),
|
|
2487
|
-
/* @__PURE__ */ (0,
|
|
2488
|
-
/* @__PURE__ */ (0,
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2521
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", gap: 8 }, children: [
|
|
2522
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-phone-submit", onClick: handleUseExistingKey, disabled: !keyInput.trim(), children: "Use my id" }),
|
|
2523
|
+
/* @__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
2524
|
] })
|
|
2491
2525
|
] }) }) })
|
|
2492
2526
|
] }),
|
|
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,
|
|
2527
|
+
mintedKey && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
|
|
2528
|
+
/* @__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, {}) }),
|
|
2529
|
+
/* @__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: [
|
|
2530
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
|
|
2531
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 12, fontWeight: 600, marginBottom: 4 }, children: "Your secret \u2014 shown only once" }),
|
|
2532
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("code", { style: { display: "block", fontSize: 14, fontWeight: 700, marginBottom: 6, wordBreak: "break-all" }, children: mintedKey }),
|
|
2533
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
2534
|
+
/* @__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" }),
|
|
2535
|
+
/* @__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
2536
|
] })
|
|
2503
2537
|
] }),
|
|
2504
|
-
mintedPub && /* @__PURE__ */ (0,
|
|
2505
|
-
/* @__PURE__ */ (0,
|
|
2506
|
-
/* @__PURE__ */ (0,
|
|
2507
|
-
/* @__PURE__ */ (0,
|
|
2508
|
-
/* @__PURE__ */ (0,
|
|
2509
|
-
/* @__PURE__ */ (0,
|
|
2538
|
+
mintedPub && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
|
|
2539
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 12, fontWeight: 600, marginBottom: 4 }, children: "Your public id" }),
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("code", { style: { display: "block", fontSize: 13, fontWeight: 600, marginBottom: 6, wordBreak: "break-all", opacity: 0.85 }, children: mintedPub }),
|
|
2541
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
2542
|
+
/* @__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" }),
|
|
2543
|
+
/* @__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
2544
|
] })
|
|
2511
2545
|
] }),
|
|
2512
|
-
/* @__PURE__ */ (0,
|
|
2546
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { fontSize: 11, opacity: 0.6 }, children: [
|
|
2513
2547
|
"Hidden in ",
|
|
2514
2548
|
keyCountdown,
|
|
2515
2549
|
"s."
|
|
2516
2550
|
] })
|
|
2517
2551
|
] }) }) })
|
|
2518
2552
|
] }),
|
|
2519
|
-
/* @__PURE__ */ (0,
|
|
2553
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: bottomRef, style: { height: 1 } })
|
|
2520
2554
|
] }),
|
|
2521
|
-
/* @__PURE__ */ (0,
|
|
2522
|
-
showAtPicker && /* @__PURE__ */ (0,
|
|
2555
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-input-wrap", children: [
|
|
2556
|
+
showAtPicker && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2523
2557
|
AtPickerMenu,
|
|
2524
2558
|
{
|
|
2525
2559
|
onSelect: handleSelectExtension,
|
|
2526
2560
|
onDismiss: () => setShowAtPicker(false)
|
|
2527
2561
|
}
|
|
2528
2562
|
),
|
|
2529
|
-
showKikuPicker && /* @__PURE__ */ (0,
|
|
2563
|
+
showKikuPicker && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2530
2564
|
KikuPickerMenu,
|
|
2531
2565
|
{
|
|
2532
2566
|
sources,
|
|
@@ -2539,9 +2573,9 @@ function ChatModal({
|
|
|
2539
2573
|
onDismiss: () => setShowKikuPicker(false)
|
|
2540
2574
|
}
|
|
2541
2575
|
),
|
|
2542
|
-
attachments.length > 0 && /* @__PURE__ */ (0,
|
|
2543
|
-
/* @__PURE__ */ (0,
|
|
2544
|
-
/* @__PURE__ */ (0,
|
|
2576
|
+
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: [
|
|
2577
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: att.data, alt: `attachment ${i + 1}`, className: "hsk-cb-img-thumb" }),
|
|
2578
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2545
2579
|
"button",
|
|
2546
2580
|
{
|
|
2547
2581
|
className: "hsk-cb-img-thumb-remove",
|
|
@@ -2551,8 +2585,8 @@ function ChatModal({
|
|
|
2551
2585
|
}
|
|
2552
2586
|
)
|
|
2553
2587
|
] }, i)) }),
|
|
2554
|
-
/* @__PURE__ */ (0,
|
|
2555
|
-
/* @__PURE__ */ (0,
|
|
2588
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-input-box", children: [
|
|
2589
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2556
2590
|
"input",
|
|
2557
2591
|
{
|
|
2558
2592
|
ref: imageInputRef,
|
|
@@ -2563,7 +2597,7 @@ function ChatModal({
|
|
|
2563
2597
|
onChange: (e) => handleImageFiles(e.target.files)
|
|
2564
2598
|
}
|
|
2565
2599
|
),
|
|
2566
|
-
enableVision && /* @__PURE__ */ (0,
|
|
2600
|
+
enableVision && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2567
2601
|
"button",
|
|
2568
2602
|
{
|
|
2569
2603
|
className: "hsk-cb-attach-btn",
|
|
@@ -2571,10 +2605,10 @@ function ChatModal({
|
|
|
2571
2605
|
disabled: loading,
|
|
2572
2606
|
"aria-label": "Attach image",
|
|
2573
2607
|
title: "Attach image",
|
|
2574
|
-
children: /* @__PURE__ */ (0,
|
|
2608
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PaperclipIcon, {})
|
|
2575
2609
|
}
|
|
2576
2610
|
),
|
|
2577
|
-
/* @__PURE__ */ (0,
|
|
2611
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2578
2612
|
"textarea",
|
|
2579
2613
|
{
|
|
2580
2614
|
ref: textareaRef,
|
|
@@ -2588,7 +2622,7 @@ function ChatModal({
|
|
|
2588
2622
|
autoFocus: true
|
|
2589
2623
|
}
|
|
2590
2624
|
),
|
|
2591
|
-
hasSpeechAPI && enableVoice && /* @__PURE__ */ (0,
|
|
2625
|
+
hasSpeechAPI && enableVoice && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2592
2626
|
"button",
|
|
2593
2627
|
{
|
|
2594
2628
|
className: cn(
|
|
@@ -2601,32 +2635,32 @@ function ChatModal({
|
|
|
2601
2635
|
"aria-label": voiceState === "idle" ? "Start voice input" : "Stop recording",
|
|
2602
2636
|
title: voiceState === "idle" ? "Voice input" : "Stop",
|
|
2603
2637
|
children: [
|
|
2604
|
-
voiceState === "listening" ? /* @__PURE__ */ (0,
|
|
2605
|
-
voiceState === "listening" && /* @__PURE__ */ (0,
|
|
2638
|
+
voiceState === "listening" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MicOffIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MicIcon2, {}),
|
|
2639
|
+
voiceState === "listening" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-mic-pulse" })
|
|
2606
2640
|
]
|
|
2607
2641
|
}
|
|
2608
2642
|
),
|
|
2609
|
-
loading || streaming ? /* @__PURE__ */ (0,
|
|
2643
|
+
loading || streaming ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2610
2644
|
"button",
|
|
2611
2645
|
{
|
|
2612
2646
|
className: cn("hsk-cb-send", "hsk-cb-send--stop", classNames.sendButton),
|
|
2613
2647
|
onClick: stop,
|
|
2614
2648
|
"aria-label": "Stop generating",
|
|
2615
2649
|
title: "Stop generating",
|
|
2616
|
-
children: /* @__PURE__ */ (0,
|
|
2650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StopIcon, {})
|
|
2617
2651
|
}
|
|
2618
|
-
) : /* @__PURE__ */ (0,
|
|
2652
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2619
2653
|
"button",
|
|
2620
2654
|
{
|
|
2621
2655
|
className: cn("hsk-cb-send", classNames.sendButton),
|
|
2622
2656
|
onClick: () => handleSend(),
|
|
2623
2657
|
disabled: !input.trim() && attachments.length === 0,
|
|
2624
2658
|
"aria-label": "Send message",
|
|
2625
|
-
children: /* @__PURE__ */ (0,
|
|
2659
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ArrowUpIcon, {})
|
|
2626
2660
|
}
|
|
2627
2661
|
)
|
|
2628
2662
|
] }),
|
|
2629
|
-
/* @__PURE__ */ (0,
|
|
2663
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-hint", children: "kiku \xB7 searches the whole catalogue in real time" })
|
|
2630
2664
|
] })
|
|
2631
2665
|
] })
|
|
2632
2666
|
]
|
|
@@ -2679,17 +2713,9 @@ function KikuButton({
|
|
|
2679
2713
|
window.removeEventListener("akropolys:navigation", handleNavigation);
|
|
2680
2714
|
};
|
|
2681
2715
|
}, []);
|
|
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)(
|
|
2716
|
+
const { themeAttr: hskThemeAttr, vars: customStyles } = resolveTheme(theme);
|
|
2717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2693
2719
|
"button",
|
|
2694
2720
|
{
|
|
2695
2721
|
className: cn("hsk-cb-btn", classNames.button, className),
|
|
@@ -2698,13 +2724,13 @@ function KikuButton({
|
|
|
2698
2724
|
"data-hsk-theme": hskThemeAttr,
|
|
2699
2725
|
"aria-label": "Open AI chat",
|
|
2700
2726
|
children: [
|
|
2701
|
-
/* @__PURE__ */ (0,
|
|
2727
|
+
/* @__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
2728
|
label !== void 0 ? label : null
|
|
2703
2729
|
]
|
|
2704
2730
|
}
|
|
2705
2731
|
),
|
|
2706
2732
|
open && mounted && (0, import_react_dom.createPortal)(
|
|
2707
|
-
/* @__PURE__ */ (0,
|
|
2733
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2708
2734
|
ChatModal,
|
|
2709
2735
|
{
|
|
2710
2736
|
title,
|
|
@@ -2732,8 +2758,8 @@ function KikuButton({
|
|
|
2732
2758
|
var import_react7 = require("react");
|
|
2733
2759
|
var import_react_dom2 = require("react-dom");
|
|
2734
2760
|
var import_sdk7 = require("@akropolys/sdk");
|
|
2735
|
-
var
|
|
2736
|
-
var SparkleIcon3 = ({ className, size = 16 }) => /* @__PURE__ */ (0,
|
|
2761
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2762
|
+
var SparkleIcon3 = ({ className, size = 16 }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2737
2763
|
"svg",
|
|
2738
2764
|
{
|
|
2739
2765
|
className: cn("hsk-brand-mark", className),
|
|
@@ -2742,19 +2768,15 @@ var SparkleIcon3 = ({ className, size = 16 }) => /* @__PURE__ */ (0, import_jsx_
|
|
|
2742
2768
|
viewBox: "0 0 100 100",
|
|
2743
2769
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2744
2770
|
"aria-label": "kiku",
|
|
2745
|
-
children: /* @__PURE__ */ (0,
|
|
2746
|
-
/* @__PURE__ */ (0,
|
|
2747
|
-
/* @__PURE__ */ (0,
|
|
2771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("g", { transform: "translate(22.7 19) scale(0.62)", fill: "currentColor", fillRule: "evenodd", children: [
|
|
2772
|
+
/* @__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" }),
|
|
2773
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "55", cy: "82", r: "3.4" })
|
|
2748
2774
|
] })
|
|
2749
2775
|
}
|
|
2750
2776
|
);
|
|
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" })
|
|
2777
|
+
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: [
|
|
2778
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2779
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2758
2780
|
] });
|
|
2759
2781
|
var getFriendlyError2 = (err) => {
|
|
2760
2782
|
let str = "";
|
|
@@ -2880,7 +2902,7 @@ Question: ${q}`;
|
|
|
2880
2902
|
}
|
|
2881
2903
|
] : messages;
|
|
2882
2904
|
if (isMobile) {
|
|
2883
|
-
return /* @__PURE__ */ (0,
|
|
2905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2884
2906
|
"div",
|
|
2885
2907
|
{
|
|
2886
2908
|
className: cn("hsk-sp-backdrop hsk-sp-mobile-view", classNames.backdrop),
|
|
@@ -2891,13 +2913,13 @@ Question: ${q}`;
|
|
|
2891
2913
|
background: bg ?? void 0,
|
|
2892
2914
|
...customStyles
|
|
2893
2915
|
},
|
|
2894
|
-
children: /* @__PURE__ */ (0,
|
|
2895
|
-
/* @__PURE__ */ (0,
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
2898
|
-
/* @__PURE__ */ (0,
|
|
2899
|
-
/* @__PURE__ */ (0,
|
|
2900
|
-
displayProduct && /* @__PURE__ */ (0,
|
|
2916
|
+
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: [
|
|
2917
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header", children: [
|
|
2918
|
+
/* @__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, {}) }),
|
|
2919
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header-body", children: [
|
|
2920
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header-title-row", children: [
|
|
2921
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-header-title", children: displayProduct?.name || productName }),
|
|
2922
|
+
displayProduct && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2901
2923
|
"button",
|
|
2902
2924
|
{
|
|
2903
2925
|
type: "button",
|
|
@@ -2907,32 +2929,32 @@ Question: ${q}`;
|
|
|
2907
2929
|
}
|
|
2908
2930
|
)
|
|
2909
2931
|
] }),
|
|
2910
|
-
/* @__PURE__ */ (0,
|
|
2932
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-header-sub", children: "kiku" })
|
|
2911
2933
|
] }),
|
|
2912
|
-
/* @__PURE__ */ (0,
|
|
2934
|
+
/* @__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
2935
|
] }),
|
|
2914
|
-
searchLoading && /* @__PURE__ */ (0,
|
|
2915
|
-
/* @__PURE__ */ (0,
|
|
2916
|
-
/* @__PURE__ */ (0,
|
|
2936
|
+
searchLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-bar" }),
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-chat-container", children: [
|
|
2938
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-msgs", children: [
|
|
2917
2939
|
displayMessages.map((msg, idx) => {
|
|
2918
2940
|
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,
|
|
2941
|
+
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: [
|
|
2942
|
+
/* @__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, {}) }),
|
|
2943
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-ai-body", children: [
|
|
2944
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-text", children: renderMarkdown(msg.content) }),
|
|
2945
|
+
idx === 0 && displayProduct && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-attachment-deck", children: [
|
|
2946
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-main-card", children: [
|
|
2947
|
+
/* @__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" }) }),
|
|
2948
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-main-card-info", children: [
|
|
2949
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-main-card-brand", children: displayProduct.brand || displayProduct.category || "Product" }),
|
|
2950
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-main-card-name", children: displayProduct.name }),
|
|
2951
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-main-card-price", children: [
|
|
2930
2952
|
displayProduct.currency ?? "KES",
|
|
2931
2953
|
" ",
|
|
2932
2954
|
parseFloat(displayProduct.price?.replace(/[^0-9.]/g, "") || "0").toLocaleString()
|
|
2933
2955
|
] })
|
|
2934
2956
|
] }),
|
|
2935
|
-
(displayProduct.specs && Object.keys(displayProduct.specs).length > 0 || displayProduct.description) && /* @__PURE__ */ (0,
|
|
2957
|
+
(displayProduct.specs && Object.keys(displayProduct.specs).length > 0 || displayProduct.description) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2936
2958
|
"button",
|
|
2937
2959
|
{
|
|
2938
2960
|
type: "button",
|
|
@@ -2951,21 +2973,21 @@ Question: ${q}`;
|
|
|
2951
2973
|
}
|
|
2952
2974
|
);
|
|
2953
2975
|
if (similarProducts.length === 0) return null;
|
|
2954
|
-
return /* @__PURE__ */ (0,
|
|
2955
|
-
/* @__PURE__ */ (0,
|
|
2956
|
-
/* @__PURE__ */ (0,
|
|
2976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-similar-carousel-inline", children: [
|
|
2977
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-title", children: "Similar Products" }),
|
|
2978
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-list", children: similarProducts.map((r) => {
|
|
2957
2979
|
const price = parseFloat(r.entity.price?.replace(/[^0-9.]/g, "") || "0");
|
|
2958
2980
|
const currency = r.entity.currency ?? "KES";
|
|
2959
|
-
return /* @__PURE__ */ (0,
|
|
2981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2960
2982
|
"div",
|
|
2961
2983
|
{
|
|
2962
2984
|
className: "hsk-sp-mobile-similar-carousel-item",
|
|
2963
2985
|
onClick: () => handleNav(r),
|
|
2964
2986
|
children: [
|
|
2965
|
-
/* @__PURE__ */ (0,
|
|
2966
|
-
/* @__PURE__ */ (0,
|
|
2967
|
-
/* @__PURE__ */ (0,
|
|
2968
|
-
/* @__PURE__ */ (0,
|
|
2987
|
+
/* @__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" }) }),
|
|
2988
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-similar-carousel-meta", children: [
|
|
2989
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-name", title: r.entity.name, children: r.entity.name }),
|
|
2990
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-similar-carousel-price", children: [
|
|
2969
2991
|
currency,
|
|
2970
2992
|
" ",
|
|
2971
2993
|
price.toLocaleString()
|
|
@@ -2982,19 +3004,19 @@ Question: ${q}`;
|
|
|
2982
3004
|
] })
|
|
2983
3005
|
] }) }, idx);
|
|
2984
3006
|
}),
|
|
2985
|
-
chatLoading && /* @__PURE__ */ (0,
|
|
2986
|
-
/* @__PURE__ */ (0,
|
|
2987
|
-
/* @__PURE__ */ (0,
|
|
2988
|
-
/* @__PURE__ */ (0,
|
|
2989
|
-
/* @__PURE__ */ (0,
|
|
2990
|
-
/* @__PURE__ */ (0,
|
|
3007
|
+
chatLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-typing-row", children: [
|
|
3008
|
+
/* @__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, {}) }),
|
|
3009
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-typing", children: [
|
|
3010
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" }),
|
|
3011
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" }),
|
|
3012
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" })
|
|
2991
3013
|
] })
|
|
2992
3014
|
] }),
|
|
2993
|
-
chatError && /* @__PURE__ */ (0,
|
|
2994
|
-
/* @__PURE__ */ (0,
|
|
3015
|
+
chatError && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-error", children: getFriendlyError2(chatError) }),
|
|
3016
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: chatBottomRef, style: { height: 1 } })
|
|
2995
3017
|
] }),
|
|
2996
|
-
/* @__PURE__ */ (0,
|
|
2997
|
-
/* @__PURE__ */ (0,
|
|
3018
|
+
/* @__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: [
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2998
3020
|
"textarea",
|
|
2999
3021
|
{
|
|
3000
3022
|
ref: chatTextareaRef,
|
|
@@ -3007,34 +3029,34 @@ Question: ${q}`;
|
|
|
3007
3029
|
disabled: chatLoading
|
|
3008
3030
|
}
|
|
3009
3031
|
),
|
|
3010
|
-
/* @__PURE__ */ (0,
|
|
3032
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3011
3033
|
"button",
|
|
3012
3034
|
{
|
|
3013
3035
|
className: "hsk-cb-send",
|
|
3014
3036
|
onClick: () => handleSend(),
|
|
3015
3037
|
disabled: !chatInput.trim() || chatLoading,
|
|
3016
3038
|
"aria-label": "Send message",
|
|
3017
|
-
children: /* @__PURE__ */ (0,
|
|
3039
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ArrowUpIcon, {})
|
|
3018
3040
|
}
|
|
3019
3041
|
)
|
|
3020
3042
|
] }) })
|
|
3021
3043
|
] }),
|
|
3022
|
-
showSpecs && displayProduct && /* @__PURE__ */ (0,
|
|
3023
|
-
/* @__PURE__ */ (0,
|
|
3024
|
-
/* @__PURE__ */ (0,
|
|
3025
|
-
/* @__PURE__ */ (0,
|
|
3044
|
+
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: [
|
|
3045
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-header", children: [
|
|
3046
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: "Specifications" }),
|
|
3047
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setShowSpecs(false), children: "Close" })
|
|
3026
3048
|
] }),
|
|
3027
|
-
/* @__PURE__ */ (0,
|
|
3028
|
-
/* @__PURE__ */ (0,
|
|
3029
|
-
displayProduct.description && /* @__PURE__ */ (0,
|
|
3030
|
-
/* @__PURE__ */ (0,
|
|
3031
|
-
/* @__PURE__ */ (0,
|
|
3049
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-body", children: [
|
|
3050
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h4", { className: "hsk-sp-mobile-specs-title", children: displayProduct.name }),
|
|
3051
|
+
displayProduct.description && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-desc", children: [
|
|
3052
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h5", { children: "Description" }),
|
|
3053
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: displayProduct.description })
|
|
3032
3054
|
] }),
|
|
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,
|
|
3055
|
+
displayProduct.specs && Object.keys(displayProduct.specs).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-list", children: [
|
|
3056
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h5", { children: "Details" }),
|
|
3057
|
+
Object.entries(displayProduct.specs).map(([key, val]) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-spec-row", children: [
|
|
3058
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-mobile-spec-label", children: key }),
|
|
3059
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-mobile-spec-value", children: val })
|
|
3038
3060
|
] }, key))
|
|
3039
3061
|
] })
|
|
3040
3062
|
] })
|
|
@@ -3043,7 +3065,7 @@ Question: ${q}`;
|
|
|
3043
3065
|
}
|
|
3044
3066
|
);
|
|
3045
3067
|
}
|
|
3046
|
-
return /* @__PURE__ */ (0,
|
|
3068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3047
3069
|
"div",
|
|
3048
3070
|
{
|
|
3049
3071
|
className: cn("hsk-sp-backdrop", classNames.backdrop),
|
|
@@ -3054,65 +3076,65 @@ Question: ${q}`;
|
|
|
3054
3076
|
background: bg ?? void 0,
|
|
3055
3077
|
...customStyles
|
|
3056
3078
|
},
|
|
3057
|
-
children: /* @__PURE__ */ (0,
|
|
3058
|
-
/* @__PURE__ */ (0,
|
|
3059
|
-
/* @__PURE__ */ (0,
|
|
3060
|
-
/* @__PURE__ */ (0,
|
|
3061
|
-
/* @__PURE__ */ (0,
|
|
3062
|
-
/* @__PURE__ */ (0,
|
|
3079
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("hsk-sp-card hsk-sp-fullscreen", classNames.card), onClick: (e) => e.stopPropagation(), children: [
|
|
3080
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header", children: [
|
|
3081
|
+
/* @__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, {}) }),
|
|
3082
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header-body", children: [
|
|
3083
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-header-title", children: displayProduct?.name || productName }),
|
|
3084
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-header-sub", children: "Ask questions, compare specs, or check similar products" })
|
|
3063
3085
|
] }),
|
|
3064
|
-
/* @__PURE__ */ (0,
|
|
3086
|
+
/* @__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
3087
|
] }),
|
|
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,
|
|
3088
|
+
searchLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-bar" }),
|
|
3089
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-body", children: [
|
|
3090
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-details-pane", children: [
|
|
3091
|
+
displayProduct && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-product-profile-container", children: [
|
|
3092
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-product-profile", children: [
|
|
3093
|
+
/* @__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" }) }),
|
|
3094
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-details-meta", children: [
|
|
3095
|
+
displayProduct.brand && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-brand", children: displayProduct.brand }),
|
|
3096
|
+
displayProduct.category && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-cat", children: displayProduct.category }),
|
|
3097
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h2", { className: "hsk-sp-details-name", children: displayProduct.name }),
|
|
3098
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-item-price-row", children: [
|
|
3099
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-currency", children: displayProduct.currency ?? "KES" }),
|
|
3100
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-price", children: parseFloat(displayProduct.price?.replace(/[^0-9.]/g, "") || "0").toLocaleString() }),
|
|
3101
|
+
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() }),
|
|
3102
|
+
displayProduct.discount && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "hsk-sp-item-discount", children: [
|
|
3081
3103
|
"(",
|
|
3082
3104
|
displayProduct.discount,
|
|
3083
3105
|
")"
|
|
3084
3106
|
] })
|
|
3085
3107
|
] }),
|
|
3086
|
-
/* @__PURE__ */ (0,
|
|
3087
|
-
displayProduct.rating && /* @__PURE__ */ (0,
|
|
3108
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-item-meta-badges", children: [
|
|
3109
|
+
displayProduct.rating && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "hsk-sp-meta-badge hsk-sp-meta-badge-rating", children: [
|
|
3088
3110
|
"\xE2\u02DC\u2026 ",
|
|
3089
3111
|
parseFloat(displayProduct.rating.toString()).toFixed(1),
|
|
3090
3112
|
" ",
|
|
3091
3113
|
displayProduct.reviewCount ? `(${displayProduct.reviewCount})` : ""
|
|
3092
3114
|
] }),
|
|
3093
|
-
displayProduct.availability && /* @__PURE__ */ (0,
|
|
3094
|
-
displayProduct.stock && !displayProduct.availability && /* @__PURE__ */ (0,
|
|
3115
|
+
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 }),
|
|
3116
|
+
displayProduct.stock && !displayProduct.availability && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "hsk-sp-meta-badge hsk-sp-meta-badge-stock", children: [
|
|
3095
3117
|
"Stock: ",
|
|
3096
3118
|
displayProduct.stock
|
|
3097
3119
|
] })
|
|
3098
3120
|
] })
|
|
3099
3121
|
] })
|
|
3100
3122
|
] }),
|
|
3101
|
-
displayProduct.specs && Object.keys(displayProduct.specs).length > 0 && /* @__PURE__ */ (0,
|
|
3102
|
-
/* @__PURE__ */ (0,
|
|
3123
|
+
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: [
|
|
3124
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "hsk-sp-spec-label-horizontal", children: [
|
|
3103
3125
|
key,
|
|
3104
3126
|
":"
|
|
3105
3127
|
] }),
|
|
3106
|
-
/* @__PURE__ */ (0,
|
|
3128
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-spec-value-horizontal", title: val, children: val })
|
|
3107
3129
|
] }, key)) }),
|
|
3108
|
-
displayProduct.description && /* @__PURE__ */ (0,
|
|
3109
|
-
/* @__PURE__ */ (0,
|
|
3110
|
-
/* @__PURE__ */ (0,
|
|
3130
|
+
displayProduct.description && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-details-desc", children: [
|
|
3131
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h4", { children: "Description" }),
|
|
3132
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: displayProduct.description })
|
|
3111
3133
|
] })
|
|
3112
3134
|
] }),
|
|
3113
|
-
/* @__PURE__ */ (0,
|
|
3114
|
-
/* @__PURE__ */ (0,
|
|
3115
|
-
/* @__PURE__ */ (0,
|
|
3135
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-similar-section", children: [
|
|
3136
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: "Similar Products" }),
|
|
3137
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-results", children: (() => {
|
|
3116
3138
|
const similarProducts = results.filter(
|
|
3117
3139
|
(r) => {
|
|
3118
3140
|
const isSameName = !!(r.entity.name && displayProduct?.name && r.entity.name.toLowerCase() === displayProduct.name.toLowerCase());
|
|
@@ -3121,29 +3143,29 @@ Question: ${q}`;
|
|
|
3121
3143
|
}
|
|
3122
3144
|
);
|
|
3123
3145
|
if (!searchLoading && similarProducts.length === 0) {
|
|
3124
|
-
return /* @__PURE__ */ (0,
|
|
3146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-empty", children: "No similar products found." });
|
|
3125
3147
|
}
|
|
3126
3148
|
return similarProducts.map((r, i) => {
|
|
3127
3149
|
const price = parseFloat(r.entity.price?.replace(/[^0-9.]/g, "") || "0");
|
|
3128
3150
|
const currency = r.entity.currency ?? "KES";
|
|
3129
|
-
return /* @__PURE__ */ (0,
|
|
3151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3130
3152
|
"div",
|
|
3131
3153
|
{
|
|
3132
3154
|
className: cn("hsk-sp-item", classNames.item),
|
|
3133
3155
|
style: { animationDelay: `${i * 55}ms`, cursor: "pointer" },
|
|
3134
3156
|
onClick: () => handleNav(r),
|
|
3135
3157
|
children: [
|
|
3136
|
-
/* @__PURE__ */ (0,
|
|
3137
|
-
/* @__PURE__ */ (0,
|
|
3138
|
-
/* @__PURE__ */ (0,
|
|
3139
|
-
r.entity.category && /* @__PURE__ */ (0,
|
|
3140
|
-
/* @__PURE__ */ (0,
|
|
3158
|
+
/* @__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" }) }),
|
|
3159
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-item-body", children: [
|
|
3160
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3161
|
+
r.entity.category && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-item-cat", children: r.entity.category }),
|
|
3162
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-item-name", title: r.entity.name, children: r.entity.name })
|
|
3141
3163
|
] }),
|
|
3142
|
-
/* @__PURE__ */ (0,
|
|
3143
|
-
/* @__PURE__ */ (0,
|
|
3144
|
-
/* @__PURE__ */ (0,
|
|
3164
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-item-price-row", children: [
|
|
3165
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-currency", children: currency }),
|
|
3166
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-price", children: price.toLocaleString() })
|
|
3145
3167
|
] }),
|
|
3146
|
-
/* @__PURE__ */ (0,
|
|
3168
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-actions", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3147
3169
|
"button",
|
|
3148
3170
|
{
|
|
3149
3171
|
className: "hsk-sp-action hsk-sp-action-primary",
|
|
@@ -3163,29 +3185,29 @@ Question: ${q}`;
|
|
|
3163
3185
|
})() })
|
|
3164
3186
|
] })
|
|
3165
3187
|
] }),
|
|
3166
|
-
/* @__PURE__ */ (0,
|
|
3167
|
-
/* @__PURE__ */ (0,
|
|
3188
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-chat-pane", children: [
|
|
3189
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-msgs", children: [
|
|
3168
3190
|
displayMessages.map((msg, idx) => {
|
|
3169
3191
|
const isUser = msg.role === "user";
|
|
3170
|
-
return /* @__PURE__ */ (0,
|
|
3171
|
-
/* @__PURE__ */ (0,
|
|
3172
|
-
/* @__PURE__ */ (0,
|
|
3192
|
+
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: [
|
|
3193
|
+
/* @__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, {}) }),
|
|
3194
|
+
/* @__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
3195
|
] }) }, idx);
|
|
3174
3196
|
}),
|
|
3175
|
-
chatLoading && /* @__PURE__ */ (0,
|
|
3176
|
-
/* @__PURE__ */ (0,
|
|
3177
|
-
/* @__PURE__ */ (0,
|
|
3178
|
-
/* @__PURE__ */ (0,
|
|
3179
|
-
/* @__PURE__ */ (0,
|
|
3180
|
-
/* @__PURE__ */ (0,
|
|
3197
|
+
chatLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-typing-row", children: [
|
|
3198
|
+
/* @__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, {}) }),
|
|
3199
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-typing", children: [
|
|
3200
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" }),
|
|
3201
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" }),
|
|
3202
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" })
|
|
3181
3203
|
] })
|
|
3182
3204
|
] }),
|
|
3183
|
-
chatError && /* @__PURE__ */ (0,
|
|
3184
|
-
/* @__PURE__ */ (0,
|
|
3205
|
+
chatError && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-error", children: getFriendlyError2(chatError) }),
|
|
3206
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: chatBottomRef, style: { height: 1 } })
|
|
3185
3207
|
] }),
|
|
3186
|
-
/* @__PURE__ */ (0,
|
|
3187
|
-
/* @__PURE__ */ (0,
|
|
3188
|
-
/* @__PURE__ */ (0,
|
|
3208
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-input-wrap", children: [
|
|
3209
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-input-box", children: [
|
|
3210
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3189
3211
|
"textarea",
|
|
3190
3212
|
{
|
|
3191
3213
|
ref: chatTextareaRef,
|
|
@@ -3198,22 +3220,22 @@ Question: ${q}`;
|
|
|
3198
3220
|
disabled: chatLoading
|
|
3199
3221
|
}
|
|
3200
3222
|
),
|
|
3201
|
-
/* @__PURE__ */ (0,
|
|
3223
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3202
3224
|
"button",
|
|
3203
3225
|
{
|
|
3204
3226
|
className: "hsk-cb-send",
|
|
3205
3227
|
onClick: () => handleSend(),
|
|
3206
3228
|
disabled: !chatInput.trim() || chatLoading,
|
|
3207
3229
|
"aria-label": "Send message",
|
|
3208
|
-
children: /* @__PURE__ */ (0,
|
|
3230
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ArrowUpIcon, {})
|
|
3209
3231
|
}
|
|
3210
3232
|
)
|
|
3211
3233
|
] }),
|
|
3212
|
-
/* @__PURE__ */ (0,
|
|
3234
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-hint", children: "Akropolys \xB7 instant product knowledge" })
|
|
3213
3235
|
] })
|
|
3214
3236
|
] })
|
|
3215
3237
|
] }),
|
|
3216
|
-
/* @__PURE__ */ (0,
|
|
3238
|
+
/* @__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
3239
|
] })
|
|
3218
3240
|
}
|
|
3219
3241
|
);
|
|
@@ -3243,8 +3265,8 @@ function Sparkle({
|
|
|
3243
3265
|
...theme?.fontFamily && { "--hsk-font": theme.fontFamily },
|
|
3244
3266
|
...theme?.borderRadius && { "--hsk-border-radius": theme.borderRadius }
|
|
3245
3267
|
};
|
|
3246
|
-
return /* @__PURE__ */ (0,
|
|
3247
|
-
/* @__PURE__ */ (0,
|
|
3268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
3269
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3248
3270
|
"button",
|
|
3249
3271
|
{
|
|
3250
3272
|
className: cn("hsk-sp-btn", classNames.button, className),
|
|
@@ -3252,11 +3274,11 @@ function Sparkle({
|
|
|
3252
3274
|
style: customStyles,
|
|
3253
3275
|
title: "Find similar products",
|
|
3254
3276
|
"aria-label": "Find similar products",
|
|
3255
|
-
children: children || /* @__PURE__ */ (0,
|
|
3277
|
+
children: children || /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {})
|
|
3256
3278
|
}
|
|
3257
3279
|
),
|
|
3258
3280
|
open && mounted && (0, import_react_dom2.createPortal)(
|
|
3259
|
-
/* @__PURE__ */ (0,
|
|
3281
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3260
3282
|
SparkleModal,
|
|
3261
3283
|
{
|
|
3262
3284
|
productName,
|