@copilotkit/react-ui 1.1.3-feat-runtime-remote-actions.2 → 1.2.1
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/CHANGELOG.md +21 -19
- package/dist/components/chat/Button.d.mts +7 -0
- package/dist/components/chat/Button.js.map +1 -1
- package/dist/components/chat/Button.mjs +30 -6
- package/dist/components/chat/Button.mjs.map +1 -1
- package/dist/components/chat/Chat.d.mts +87 -0
- package/dist/components/chat/Chat.d.ts +2 -2
- package/dist/components/chat/Chat.js +8 -107
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +1754 -20
- package/dist/components/chat/Chat.mjs.map +1 -1
- package/dist/components/chat/ChatContext.d.mts +105 -0
- package/dist/components/chat/ChatContext.d.ts +1 -1
- package/dist/components/chat/ChatContext.mjs +228 -7
- package/dist/components/chat/ChatContext.mjs.map +1 -1
- package/dist/components/chat/CodeBlock.d.mts +14 -0
- package/dist/components/chat/CodeBlock.js +1 -2
- package/dist/components/chat/CodeBlock.js.map +1 -1
- package/dist/components/chat/CodeBlock.mjs +482 -8
- package/dist/components/chat/CodeBlock.mjs.map +1 -1
- package/dist/components/chat/Header.d.mts +7 -0
- package/dist/components/chat/Header.mjs +23 -6
- package/dist/components/chat/Header.mjs.map +1 -1
- package/dist/components/chat/Icons.d.mts +18 -0
- package/dist/components/chat/Icons.mjs +271 -16
- package/dist/components/chat/Icons.mjs.map +1 -1
- package/dist/components/chat/Input.d.mts +7 -0
- package/dist/components/chat/Input.js +2 -4
- package/dist/components/chat/Input.js.map +1 -1
- package/dist/components/chat/Input.mjs +255 -8
- package/dist/components/chat/Input.mjs.map +1 -1
- package/dist/components/chat/Markdown.d.mts +8 -0
- package/dist/components/chat/Markdown.js +1 -2
- package/dist/components/chat/Markdown.js.map +1 -1
- package/dist/components/chat/Markdown.mjs +546 -7
- package/dist/components/chat/Markdown.mjs.map +1 -1
- package/dist/components/chat/Messages.d.mts +7 -0
- package/dist/components/chat/Messages.js +3 -48
- package/dist/components/chat/Messages.js.map +1 -1
- package/dist/components/chat/Messages.mjs +678 -8
- package/dist/components/chat/Messages.mjs.map +1 -1
- package/dist/components/chat/Modal.d.mts +51 -0
- package/dist/components/chat/Modal.d.ts +1 -1
- package/dist/components/chat/Modal.js +9 -107
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +1956 -22
- package/dist/components/chat/Modal.mjs.map +1 -1
- package/dist/components/chat/Popup.d.mts +13 -0
- package/dist/components/chat/Popup.js +9 -107
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +1965 -23
- package/dist/components/chat/Popup.mjs.map +1 -1
- package/dist/components/chat/Response.d.mts +7 -0
- package/dist/components/chat/Response.mjs +23 -6
- package/dist/components/chat/Response.mjs.map +1 -1
- package/dist/components/chat/Sidebar.d.mts +13 -0
- package/dist/components/chat/Sidebar.js +10 -107
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +1977 -23
- package/dist/components/chat/Sidebar.mjs.map +1 -1
- package/dist/components/chat/Suggestion.d.mts +14 -0
- package/dist/components/chat/Suggestion.js.map +1 -1
- package/dist/components/chat/Suggestion.mjs +152 -5
- package/dist/components/chat/Suggestion.mjs.map +1 -1
- package/dist/components/chat/Textarea.d.mts +13 -0
- package/dist/components/chat/Textarea.js.map +1 -1
- package/dist/components/chat/Textarea.mjs +48 -4
- package/dist/components/chat/Textarea.mjs.map +1 -1
- package/dist/components/chat/Window.d.mts +7 -0
- package/dist/components/chat/Window.js.map +1 -1
- package/dist/components/chat/Window.mjs +125 -6
- package/dist/components/chat/Window.mjs.map +1 -1
- package/dist/components/chat/index.d.mts +11 -0
- package/dist/components/chat/index.js +10 -107
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +1983 -31
- package/dist/components/chat/index.mjs.map +1 -1
- package/dist/components/chat/props.d.mts +35 -0
- package/dist/components/chat/props.d.ts +1 -1
- package/dist/components/chat/props.mjs +0 -1
- package/dist/components/dev-console/console.d.mts +10 -0
- package/dist/components/dev-console/console.js +0 -52
- package/dist/components/dev-console/console.js.map +1 -1
- package/dist/components/dev-console/console.mjs +426 -8
- package/dist/components/dev-console/console.mjs.map +1 -1
- package/dist/components/dev-console/icons.d.mts +9 -0
- package/dist/components/dev-console/icons.mjs +83 -8
- package/dist/components/dev-console/icons.mjs.map +1 -1
- package/dist/components/dev-console/index.d.mts +5 -0
- package/dist/components/dev-console/index.js +0 -52
- package/dist/components/dev-console/index.js.map +1 -1
- package/dist/components/dev-console/index.mjs +424 -10
- package/dist/components/dev-console/index.mjs.map +1 -1
- package/dist/components/dev-console/types.d.mts +9 -0
- package/dist/components/dev-console/types.d.ts +1 -1
- package/dist/components/dev-console/utils.d.mts +9 -0
- package/dist/components/dev-console/utils.d.ts +1 -2
- package/dist/components/dev-console/utils.js +0 -53
- package/dist/components/dev-console/utils.js.map +1 -1
- package/dist/components/dev-console/utils.mjs +103 -9
- package/dist/components/dev-console/utils.mjs.map +1 -1
- package/dist/components/index.d.mts +11 -0
- package/dist/components/index.js +10 -107
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +1983 -32
- package/dist/components/index.mjs.map +1 -1
- package/dist/context/index.d.mts +2 -0
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.mjs +0 -1
- package/dist/hooks/index.d.mts +1 -0
- package/dist/hooks/index.mjs +24 -5
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/use-copilot-chat-suggestions.d.mts +83 -0
- package/dist/hooks/use-copilot-chat-suggestions.mjs +24 -4
- package/dist/hooks/use-copilot-chat-suggestions.mjs.map +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.mts +9 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -1
- package/dist/hooks/use-copy-to-clipboard.mjs +21 -4
- package/dist/hooks/use-copy-to-clipboard.mjs.map +1 -1
- package/dist/hooks/use-push-to-talk.d.mts +19 -0
- package/dist/hooks/use-push-to-talk.d.ts +1 -1
- package/dist/hooks/use-push-to-talk.js.map +1 -1
- package/dist/hooks/use-push-to-talk.mjs +148 -6
- package/dist/hooks/use-push-to-talk.mjs.map +1 -1
- package/dist/index.css +1 -747
- package/dist/index.d.mts +13 -0
- package/dist/index.js +17 -107
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2015 -38
- package/dist/index.mjs.map +1 -1
- package/dist/lib/utils.d.mts +4 -0
- package/dist/lib/utils.mjs +20 -3
- package/dist/lib/utils.mjs.map +1 -1
- package/dist/lib/utils.test.d.mts +2 -0
- package/dist/lib/utils.test.d.ts +1 -1
- package/dist/types/css.d.mts +16 -0
- package/dist/types/css.d.ts +1 -1
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.mjs +0 -1
- package/dist/types/suggestions.d.mts +8 -0
- package/dist/types/suggestions.d.ts +1 -1
- package/package.json +19 -11
- package/src/components/chat/Chat.tsx +2 -5
- package/src/components/chat/Messages.tsx +2 -83
- package/src/components/chat/Modal.tsx +1 -0
- package/src/components/chat/Popup.tsx +1 -4
- package/src/components/chat/Sidebar.tsx +2 -3
- package/src/components/chat/Suggestion.tsx +0 -2
- package/src/components/dev-console/console.tsx +0 -6
- package/src/components/dev-console/utils.ts +0 -56
- package/tsup.config.ts +59 -15
- package/dist/chunk-54JAUBUJ.mjs +0 -26
- package/dist/chunk-54JAUBUJ.mjs.map +0 -1
- package/dist/chunk-5HHVL5WK.mjs +0 -29
- package/dist/chunk-5HHVL5WK.mjs.map +0 -1
- package/dist/chunk-B2KQEX2R.mjs +0 -91
- package/dist/chunk-B2KQEX2R.mjs.map +0 -1
- package/dist/chunk-BJPGMY3I.mjs +0 -70
- package/dist/chunk-BJPGMY3I.mjs.map +0 -1
- package/dist/chunk-EFZPSZWO.mjs +0 -1
- package/dist/chunk-EFZPSZWO.mjs.map +0 -1
- package/dist/chunk-FL4ETWFB.mjs +0 -21
- package/dist/chunk-FL4ETWFB.mjs.map +0 -1
- package/dist/chunk-FLV3J3VX.mjs +0 -18
- package/dist/chunk-FLV3J3VX.mjs.map +0 -1
- package/dist/chunk-FO7Z5LAL.mjs +0 -118
- package/dist/chunk-FO7Z5LAL.mjs.map +0 -1
- package/dist/chunk-FOZVHL73.mjs +0 -171
- package/dist/chunk-FOZVHL73.mjs.map +0 -1
- package/dist/chunk-FZC7X5PK.mjs +0 -262
- package/dist/chunk-FZC7X5PK.mjs.map +0 -1
- package/dist/chunk-H7TM5JE6.mjs +0 -146
- package/dist/chunk-H7TM5JE6.mjs.map +0 -1
- package/dist/chunk-HR36Y2FQ.mjs +0 -167
- package/dist/chunk-HR36Y2FQ.mjs.map +0 -1
- package/dist/chunk-I4QG2ZZU.mjs +0 -220
- package/dist/chunk-I4QG2ZZU.mjs.map +0 -1
- package/dist/chunk-IU3WTXLQ.mjs +0 -1
- package/dist/chunk-IU3WTXLQ.mjs.map +0 -1
- package/dist/chunk-JD7BAH7U.mjs +0 -1
- package/dist/chunk-JD7BAH7U.mjs.map +0 -1
- package/dist/chunk-MRFF7GSQ.mjs +0 -1
- package/dist/chunk-MRFF7GSQ.mjs.map +0 -1
- package/dist/chunk-MRXNTQOX.mjs +0 -59
- package/dist/chunk-MRXNTQOX.mjs.map +0 -1
- package/dist/chunk-OTPAZXVR.mjs +0 -92
- package/dist/chunk-OTPAZXVR.mjs.map +0 -1
- package/dist/chunk-QOEAEMUQ.mjs +0 -30
- package/dist/chunk-QOEAEMUQ.mjs.map +0 -1
- package/dist/chunk-T26KLXLH.mjs +0 -1
- package/dist/chunk-T26KLXLH.mjs.map +0 -1
- package/dist/chunk-U6J5DGOE.mjs +0 -83
- package/dist/chunk-U6J5DGOE.mjs.map +0 -1
- package/dist/chunk-UPTB2MVO.mjs +0 -395
- package/dist/chunk-UPTB2MVO.mjs.map +0 -1
- package/dist/chunk-V7W6IM2V.mjs +0 -1
- package/dist/chunk-V7W6IM2V.mjs.map +0 -1
- package/dist/chunk-VOBX4JOA.mjs +0 -138
- package/dist/chunk-VOBX4JOA.mjs.map +0 -1
- package/dist/chunk-WB3YULQ4.mjs +0 -1
- package/dist/chunk-WB3YULQ4.mjs.map +0 -1
- package/dist/chunk-WCPLXRZX.mjs +0 -106
- package/dist/chunk-WCPLXRZX.mjs.map +0 -1
- package/dist/chunk-XSUSSWDS.mjs +0 -18
- package/dist/chunk-XSUSSWDS.mjs.map +0 -1
- package/dist/chunk-YOH25I6N.mjs +0 -25
- package/dist/chunk-YOH25I6N.mjs.map +0 -1
- package/dist/chunk-YQ3D5IQV.mjs +0 -75
- package/dist/chunk-YQ3D5IQV.mjs.map +0 -1
- package/dist/chunk-YQFVRDNC.mjs +0 -53
- package/dist/chunk-YQFVRDNC.mjs.map +0 -1
- package/dist/index.css.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/Popup.tsx"],"sourcesContent":["/**\n * <br/>\n * <img src=\"/images/CopilotPopup.gif\" width=\"500\" />\n *\n * A chatbot popup component for the CopilotKit framework. The component allows for a high degree\n * of customization through various props and custom CSS.\n *\n * See [CopilotSidebar](/reference/components/CopilotSidebar) for a sidebar version of this component.\n *\n * ## Install Dependencies\n *\n * This component is part of the [@copilotkit/react-ui](https://npmjs.com/package/@copilotkit/react-ui) package.\n *\n * ```shell npm2yarn \\\"@copilotkit/react-ui\"\\\n * npm install @copilotkit/react-core @copilotkit/react-ui\n * ```\n * ## Usage\n *\n * ```tsx\n * import { CopilotPopup } from \"@copilotkit/react-ui\";\n * import \"@copilotkit/react-ui/styles.css\";\n *\n * <CopilotPopup\n * labels={{\n * title: \"Your Assistant\",\n * initial: \"Hi! 👋 How can I assist you today?\",\n * }}\n * />\n * ```\n *\n * ### Look & Feel\n *\n * By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:\n * ```tsx fileName=\"YourRootComponent.tsx\" {2}\n * ...\n * import \"@copilotkit/react-ui/styles.css\";\n *\n * export function YourRootComponent() {\n * return (\n * <CopilotKit>\n * ...\n * </CopilotKit>\n * );\n * }\n * ```\n * For more information about how to customize the styles, check out the [Customize Look & Feel](/concepts/customize-look-and-feel) guide.\n */\n\nimport { CopilotModal, CopilotModalProps } from \"./Modal\";\n\nexport function CopilotPopup(props: CopilotModalProps) {\n props = {\n ...props,\n className: props.className ? props.className + \" copilotKitPopup\" : \"copilotKitPopup\",\n };\n return <CopilotModal {...props}>{props.children}</CopilotModal>;\n}\n"],"mappings":";;;;;;;;;AAuDS;AALF,SAAS,aAAa,OAA0B;AACrD,UAAQ,iCACH,QADG;AAAA,IAEN,WAAW,MAAM,YAAY,MAAM,YAAY,qBAAqB;AAAA,EACtE;AACA,SAAO,oBAAC,+CAAiB,QAAjB,EAAyB,gBAAM,WAAS;AAClD;","names":[]}
|
package/dist/chunk-FLV3J3VX.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useChatContext
|
|
3
|
-
} from "./chunk-BJPGMY3I.mjs";
|
|
4
|
-
|
|
5
|
-
// src/components/chat/Header.tsx
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
var Header = ({}) => {
|
|
8
|
-
const { setOpen, icons, labels } = useChatContext();
|
|
9
|
-
return /* @__PURE__ */ jsxs("div", { className: "copilotKitHeader", children: [
|
|
10
|
-
/* @__PURE__ */ jsx("div", { children: labels.title }),
|
|
11
|
-
/* @__PURE__ */ jsx("button", { onClick: () => setOpen(false), "aria-label": "Close", children: icons.headerCloseIcon })
|
|
12
|
-
] });
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
Header
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=chunk-FLV3J3VX.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/Header.tsx"],"sourcesContent":["import { HeaderProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\n\nexport const Header = ({}: HeaderProps) => {\n const { setOpen, icons, labels } = useChatContext();\n\n return (\n <div className=\"copilotKitHeader\">\n <div>{labels.title}</div>\n <button onClick={() => setOpen(false)} aria-label=\"Close\">\n {icons.headerCloseIcon}\n </button>\n </div>\n );\n};\n"],"mappings":";;;;;AAOI,SACE,KADF;AAJG,IAAM,SAAS,CAAC,CAAC,MAAmB;AACzC,QAAM,EAAE,SAAS,OAAO,OAAO,IAAI,eAAe;AAElD,SACE,qBAAC,SAAI,WAAU,oBACb;AAAA,wBAAC,SAAK,iBAAO,OAAM;AAAA,IACnB,oBAAC,YAAO,SAAS,MAAM,QAAQ,KAAK,GAAG,cAAW,SAC/C,gBAAM,iBACT;AAAA,KACF;AAEJ;","names":[]}
|
package/dist/chunk-FO7Z5LAL.mjs
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useChatContext
|
|
3
|
-
} from "./chunk-BJPGMY3I.mjs";
|
|
4
|
-
|
|
5
|
-
// src/components/chat/Window.tsx
|
|
6
|
-
import React, { useCallback, useEffect } from "react";
|
|
7
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
var Window = ({
|
|
9
|
-
children,
|
|
10
|
-
clickOutsideToClose,
|
|
11
|
-
shortcut,
|
|
12
|
-
hitEscapeToClose
|
|
13
|
-
}) => {
|
|
14
|
-
const windowRef = React.useRef(null);
|
|
15
|
-
const { open, setOpen } = useChatContext();
|
|
16
|
-
const handleClickOutside = useCallback(
|
|
17
|
-
(event) => {
|
|
18
|
-
var _a;
|
|
19
|
-
if (!clickOutsideToClose) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
const parentElement = (_a = windowRef.current) == null ? void 0 : _a.parentElement;
|
|
23
|
-
let className = "";
|
|
24
|
-
if (event.target instanceof HTMLElement) {
|
|
25
|
-
className = event.target.className;
|
|
26
|
-
}
|
|
27
|
-
if (open && parentElement && !parentElement.contains(event.target) && // prevent closing the window when clicking on the debug menu
|
|
28
|
-
!className.includes("copilotKitDebugMenu")) {
|
|
29
|
-
setOpen(false);
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
[clickOutsideToClose, open, setOpen]
|
|
33
|
-
);
|
|
34
|
-
const handleKeyDown = useCallback(
|
|
35
|
-
(event) => {
|
|
36
|
-
var _a;
|
|
37
|
-
const target = event.target;
|
|
38
|
-
const isInput = target.tagName === "INPUT" || target.tagName === "SELECT" || target.tagName === "TEXTAREA" || target.isContentEditable;
|
|
39
|
-
const isDescendantOfWrapper = (_a = windowRef.current) == null ? void 0 : _a.contains(target);
|
|
40
|
-
if (open && event.key === "Escape" && (!isInput || isDescendantOfWrapper) && hitEscapeToClose) {
|
|
41
|
-
setOpen(false);
|
|
42
|
-
} else if (event.key === shortcut && (isMacOS() && event.metaKey || !isMacOS() && event.ctrlKey) && (!isInput || isDescendantOfWrapper)) {
|
|
43
|
-
setOpen(!open);
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
[hitEscapeToClose, shortcut, open, setOpen]
|
|
47
|
-
);
|
|
48
|
-
const adjustForMobile = useCallback(() => {
|
|
49
|
-
const copilotKitWindow = windowRef.current;
|
|
50
|
-
const vv = window.visualViewport;
|
|
51
|
-
if (!copilotKitWindow || !vv) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (window.innerWidth < 640 && open) {
|
|
55
|
-
copilotKitWindow.style.height = `${vv.height}px`;
|
|
56
|
-
copilotKitWindow.style.left = `${vv.offsetLeft}px`;
|
|
57
|
-
copilotKitWindow.style.top = `${vv.offsetTop}px`;
|
|
58
|
-
document.body.style.position = "fixed";
|
|
59
|
-
document.body.style.width = "100%";
|
|
60
|
-
document.body.style.height = `${window.innerHeight}px`;
|
|
61
|
-
document.body.style.overflow = "hidden";
|
|
62
|
-
document.body.style.touchAction = "none";
|
|
63
|
-
document.body.addEventListener("touchmove", preventScroll, {
|
|
64
|
-
passive: false
|
|
65
|
-
});
|
|
66
|
-
} else {
|
|
67
|
-
copilotKitWindow.style.height = "";
|
|
68
|
-
copilotKitWindow.style.left = "";
|
|
69
|
-
copilotKitWindow.style.top = "";
|
|
70
|
-
document.body.style.position = "";
|
|
71
|
-
document.body.style.height = "";
|
|
72
|
-
document.body.style.width = "";
|
|
73
|
-
document.body.style.overflow = "";
|
|
74
|
-
document.body.style.top = "";
|
|
75
|
-
document.body.style.touchAction = "";
|
|
76
|
-
document.body.removeEventListener("touchmove", preventScroll);
|
|
77
|
-
}
|
|
78
|
-
}, [open]);
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
81
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
82
|
-
if (window.visualViewport) {
|
|
83
|
-
window.visualViewport.addEventListener("resize", adjustForMobile);
|
|
84
|
-
adjustForMobile();
|
|
85
|
-
}
|
|
86
|
-
return () => {
|
|
87
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
88
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
89
|
-
if (window.visualViewport) {
|
|
90
|
-
window.visualViewport.removeEventListener("resize", adjustForMobile);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
}, [adjustForMobile, handleClickOutside, handleKeyDown]);
|
|
94
|
-
return /* @__PURE__ */ jsx("div", { className: `copilotKitWindow${open ? " open" : ""}`, ref: windowRef, children });
|
|
95
|
-
};
|
|
96
|
-
var preventScroll = (event) => {
|
|
97
|
-
let targetElement = event.target;
|
|
98
|
-
const hasParentWithClass = (element, className) => {
|
|
99
|
-
while (element && element !== document.body) {
|
|
100
|
-
if (element.classList.contains(className)) {
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
element = element.parentElement;
|
|
104
|
-
}
|
|
105
|
-
return false;
|
|
106
|
-
};
|
|
107
|
-
if (!hasParentWithClass(targetElement, "copilotKitMessages")) {
|
|
108
|
-
event.preventDefault();
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
function isMacOS() {
|
|
112
|
-
return /Mac|iMac|Macintosh/i.test(navigator.userAgent);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export {
|
|
116
|
-
Window
|
|
117
|
-
};
|
|
118
|
-
//# sourceMappingURL=chunk-FO7Z5LAL.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/Window.tsx"],"sourcesContent":["import React, { useCallback, useEffect } from \"react\";\nimport { WindowProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\n\nexport const Window = ({\n children,\n clickOutsideToClose,\n shortcut,\n hitEscapeToClose,\n}: WindowProps) => {\n const windowRef = React.useRef<HTMLDivElement>(null);\n\n const { open, setOpen } = useChatContext();\n\n const handleClickOutside = useCallback(\n (event: MouseEvent) => {\n if (!clickOutsideToClose) {\n return;\n }\n\n const parentElement = windowRef.current?.parentElement;\n\n let className = \"\";\n if (event.target instanceof HTMLElement) {\n className = event.target.className;\n }\n\n if (\n open &&\n parentElement &&\n !parentElement.contains(event.target as any) &&\n // prevent closing the window when clicking on the debug menu\n !className.includes(\"copilotKitDebugMenu\")\n ) {\n setOpen(false);\n }\n },\n [clickOutsideToClose, open, setOpen],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n const isInput =\n target.tagName === \"INPUT\" ||\n target.tagName === \"SELECT\" ||\n target.tagName === \"TEXTAREA\" ||\n target.isContentEditable;\n\n const isDescendantOfWrapper = windowRef.current?.contains(target);\n\n if (\n open &&\n event.key === \"Escape\" &&\n (!isInput || isDescendantOfWrapper) &&\n hitEscapeToClose\n ) {\n setOpen(false);\n } else if (\n event.key === shortcut &&\n ((isMacOS() && event.metaKey) || (!isMacOS() && event.ctrlKey)) &&\n (!isInput || isDescendantOfWrapper)\n ) {\n setOpen(!open);\n }\n },\n [hitEscapeToClose, shortcut, open, setOpen],\n );\n\n const adjustForMobile = useCallback(() => {\n const copilotKitWindow = windowRef.current;\n const vv = window.visualViewport;\n if (!copilotKitWindow || !vv) {\n return;\n }\n\n if (window.innerWidth < 640 && open) {\n copilotKitWindow.style.height = `${vv.height}px`;\n copilotKitWindow.style.left = `${vv.offsetLeft}px`;\n copilotKitWindow.style.top = `${vv.offsetTop}px`;\n\n document.body.style.position = \"fixed\";\n document.body.style.width = \"100%\";\n document.body.style.height = `${window.innerHeight}px`;\n document.body.style.overflow = \"hidden\";\n document.body.style.touchAction = \"none\";\n\n // Prevent scrolling on iOS\n document.body.addEventListener(\"touchmove\", preventScroll, {\n passive: false,\n });\n } else {\n copilotKitWindow.style.height = \"\";\n copilotKitWindow.style.left = \"\";\n copilotKitWindow.style.top = \"\";\n document.body.style.position = \"\";\n document.body.style.height = \"\";\n document.body.style.width = \"\";\n document.body.style.overflow = \"\";\n document.body.style.top = \"\";\n document.body.style.touchAction = \"\";\n\n document.body.removeEventListener(\"touchmove\", preventScroll);\n }\n }, [open]);\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleKeyDown);\n if (window.visualViewport) {\n window.visualViewport.addEventListener(\"resize\", adjustForMobile);\n adjustForMobile();\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleKeyDown);\n if (window.visualViewport) {\n window.visualViewport.removeEventListener(\"resize\", adjustForMobile);\n }\n };\n }, [adjustForMobile, handleClickOutside, handleKeyDown]);\n\n return (\n <div className={`copilotKitWindow${open ? \" open\" : \"\"}`} ref={windowRef}>\n {children}\n </div>\n );\n};\n\nconst preventScroll = (event: TouchEvent): void => {\n let targetElement = event.target as Element;\n\n // Function to check if the target has the parent with a given class\n const hasParentWithClass = (element: Element, className: string): boolean => {\n while (element && element !== document.body) {\n if (element.classList.contains(className)) {\n return true;\n }\n element = element.parentElement!;\n }\n return false;\n };\n\n // Check if the target of the touch event is inside an element with the 'copilotKitMessages' class\n if (!hasParentWithClass(targetElement, \"copilotKitMessages\")) {\n event.preventDefault();\n }\n};\n\nfunction isMacOS() {\n return /M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a,CAAC;AAEvD,SACE,oBAAC,SAAI,WAAW,mBAAmB,OAAO,UAAU,MAAM,KAAK,WAC5D,UACH;AAEJ;AAEA,IAAM,gBAAgB,CAAC,UAA4B;AACjD,MAAI,gBAAgB,MAAM;AAG1B,QAAM,qBAAqB,CAAC,SAAkB,cAA+B;AAC3E,WAAO,WAAW,YAAY,SAAS,MAAM;AAC3C,UAAI,QAAQ,UAAU,SAAS,SAAS,GAAG;AACzC,eAAO;AAAA,MACT;AACA,gBAAU,QAAQ;AAAA,IACpB;AACA,WAAO;AAAA,EACT;AAGA,MAAI,CAAC,mBAAmB,eAAe,oBAAoB,GAAG;AAC5D,UAAM,eAAe;AAAA,EACvB;AACF;AAEA,SAAS,UAAU;AACjB,SAAO,sBAAsB,KAAK,UAAU,SAAS;AACvD;","names":[]}
|
package/dist/chunk-FOZVHL73.mjs
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Markdown
|
|
3
|
-
} from "./chunk-YQ3D5IQV.mjs";
|
|
4
|
-
import {
|
|
5
|
-
useChatContext
|
|
6
|
-
} from "./chunk-BJPGMY3I.mjs";
|
|
7
|
-
|
|
8
|
-
// src/components/chat/Messages.tsx
|
|
9
|
-
import React, { useEffect, useMemo } from "react";
|
|
10
|
-
import { useCopilotContext } from "@copilotkit/react-core";
|
|
11
|
-
import {
|
|
12
|
-
MessageStatusCode,
|
|
13
|
-
ActionExecutionMessage,
|
|
14
|
-
ResultMessage,
|
|
15
|
-
TextMessage,
|
|
16
|
-
Role,
|
|
17
|
-
AgentStateMessage
|
|
18
|
-
} from "@copilotkit/runtime-client-gql";
|
|
19
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
-
var Messages = ({ messages, inProgress, children }) => {
|
|
21
|
-
const { chatComponentsCache } = useCopilotContext();
|
|
22
|
-
const context = useChatContext();
|
|
23
|
-
const initialMessages = useMemo(
|
|
24
|
-
() => makeInitialMessages(context.labels.initial),
|
|
25
|
-
[context.labels.initial]
|
|
26
|
-
);
|
|
27
|
-
messages = [...initialMessages, ...messages];
|
|
28
|
-
const functionResults = {};
|
|
29
|
-
for (let i = 0; i < messages.length; i++) {
|
|
30
|
-
if (messages[i] instanceof ActionExecutionMessage) {
|
|
31
|
-
const id = messages[i].id;
|
|
32
|
-
const resultMessage = messages.find(
|
|
33
|
-
(message) => message instanceof ResultMessage && message.actionExecutionId === id
|
|
34
|
-
);
|
|
35
|
-
if (resultMessage) {
|
|
36
|
-
functionResults[id] = ResultMessage.decodeResult(resultMessage.result || "");
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const messagesEndRef = React.useRef(null);
|
|
41
|
-
const scrollToBottom = () => {
|
|
42
|
-
if (messagesEndRef.current) {
|
|
43
|
-
messagesEndRef.current.scrollIntoView({
|
|
44
|
-
behavior: "auto"
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
scrollToBottom();
|
|
50
|
-
}, [messages]);
|
|
51
|
-
return /* @__PURE__ */ jsxs("div", { className: "copilotKitMessages", children: [
|
|
52
|
-
messages.map((message, index) => {
|
|
53
|
-
const isCurrentMessage = index === messages.length - 1;
|
|
54
|
-
if (message instanceof TextMessage && message.role === "user") {
|
|
55
|
-
return /* @__PURE__ */ jsx("div", { className: "copilotKitMessage copilotKitUserMessage", children: message.content }, index);
|
|
56
|
-
} else if (message instanceof TextMessage && message.role == "assistant") {
|
|
57
|
-
return /* @__PURE__ */ jsx("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: isCurrentMessage && inProgress && !message.content ? context.icons.spinnerIcon : /* @__PURE__ */ jsx(Markdown, { content: message.content }) }, index);
|
|
58
|
-
} else if (message instanceof ActionExecutionMessage) {
|
|
59
|
-
if (chatComponentsCache.current !== null && chatComponentsCache.current.actions[message.name]) {
|
|
60
|
-
const render = chatComponentsCache.current.actions[message.name];
|
|
61
|
-
if (typeof render === "string") {
|
|
62
|
-
if (isCurrentMessage && inProgress) {
|
|
63
|
-
return /* @__PURE__ */ jsxs("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
64
|
-
context.icons.spinnerIcon,
|
|
65
|
-
" ",
|
|
66
|
-
/* @__PURE__ */ jsx("span", { className: "inProgressLabel", children: render })
|
|
67
|
-
] }, index);
|
|
68
|
-
} else {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
} else {
|
|
72
|
-
const args = message.arguments;
|
|
73
|
-
let status = "inProgress";
|
|
74
|
-
if (functionResults[message.id] !== void 0) {
|
|
75
|
-
status = "complete";
|
|
76
|
-
} else if (message.status.code !== MessageStatusCode.Pending) {
|
|
77
|
-
status = "executing";
|
|
78
|
-
}
|
|
79
|
-
const toRender = render({
|
|
80
|
-
status,
|
|
81
|
-
args,
|
|
82
|
-
result: functionResults[message.id]
|
|
83
|
-
});
|
|
84
|
-
if (!toRender && status === "complete") {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
if (typeof toRender === "string") {
|
|
88
|
-
return /* @__PURE__ */ jsxs("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
89
|
-
isCurrentMessage && inProgress && context.icons.spinnerIcon,
|
|
90
|
-
" ",
|
|
91
|
-
toRender
|
|
92
|
-
] }, index);
|
|
93
|
-
} else {
|
|
94
|
-
return /* @__PURE__ */ jsx("div", { className: "copilotKitCustomAssistantMessage", children: toRender }, index);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
} else if (!inProgress || !isCurrentMessage) {
|
|
98
|
-
return null;
|
|
99
|
-
} else {
|
|
100
|
-
return /* @__PURE__ */ jsx("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: context.icons.spinnerIcon }, index);
|
|
101
|
-
}
|
|
102
|
-
} else if (message instanceof AgentStateMessage) {
|
|
103
|
-
let render;
|
|
104
|
-
if (chatComponentsCache.current !== null) {
|
|
105
|
-
render = chatComponentsCache.current.coagentActions[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coagentActions[`${message.agentName}-global`];
|
|
106
|
-
}
|
|
107
|
-
if (render) {
|
|
108
|
-
if (typeof render === "string") {
|
|
109
|
-
if (isCurrentMessage && inProgress) {
|
|
110
|
-
return /* @__PURE__ */ jsxs("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
111
|
-
context.icons.spinnerIcon,
|
|
112
|
-
" ",
|
|
113
|
-
/* @__PURE__ */ jsx("span", { className: "inProgressLabel", children: render })
|
|
114
|
-
] }, index);
|
|
115
|
-
} else {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
} else {
|
|
119
|
-
const state = message.state;
|
|
120
|
-
let status = message.active ? "inProgress" : "complete";
|
|
121
|
-
const toRender = render({
|
|
122
|
-
status,
|
|
123
|
-
state,
|
|
124
|
-
nodeName: message.nodeName
|
|
125
|
-
});
|
|
126
|
-
if (!toRender && status === "complete") {
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
if (typeof toRender === "string") {
|
|
130
|
-
return /* @__PURE__ */ jsxs("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
131
|
-
isCurrentMessage && inProgress && context.icons.spinnerIcon,
|
|
132
|
-
" ",
|
|
133
|
-
toRender
|
|
134
|
-
] }, index);
|
|
135
|
-
} else {
|
|
136
|
-
return /* @__PURE__ */ jsx("div", { className: "copilotKitCustomAssistantMessage", children: toRender }, index);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
} else if (!inProgress || !isCurrentMessage) {
|
|
140
|
-
return null;
|
|
141
|
-
} else {
|
|
142
|
-
return /* @__PURE__ */ jsx("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: context.icons.spinnerIcon }, index);
|
|
143
|
-
}
|
|
144
|
-
} else if (message instanceof ResultMessage && inProgress && isCurrentMessage) {
|
|
145
|
-
return /* @__PURE__ */ jsx("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: context.icons.spinnerIcon }, index);
|
|
146
|
-
}
|
|
147
|
-
}),
|
|
148
|
-
/* @__PURE__ */ jsx("footer", { ref: messagesEndRef, children })
|
|
149
|
-
] });
|
|
150
|
-
};
|
|
151
|
-
function makeInitialMessages(initial) {
|
|
152
|
-
let initialArray = [];
|
|
153
|
-
if (initial) {
|
|
154
|
-
if (Array.isArray(initial)) {
|
|
155
|
-
initialArray.push(...initial);
|
|
156
|
-
} else {
|
|
157
|
-
initialArray.push(initial);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return initialArray.map(
|
|
161
|
-
(message) => new TextMessage({
|
|
162
|
-
role: Role.Assistant,
|
|
163
|
-
content: message
|
|
164
|
-
})
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export {
|
|
169
|
-
Messages
|
|
170
|
-
};
|
|
171
|
-
//# sourceMappingURL=chunk-FOZVHL73.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/Messages.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport { MessagesProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport { Markdown } from \"./Markdown\";\nimport { RenderFunctionStatus, useCopilotContext } from \"@copilotkit/react-core\";\nimport {\n MessageStatusCode,\n ActionExecutionMessage,\n Message,\n ResultMessage,\n TextMessage,\n Role,\n AgentStateMessage,\n} from \"@copilotkit/runtime-client-gql\";\nimport { CoagentInChatRenderFunction } from \"@copilotkit/react-core/dist/context/copilot-context\";\n\nexport const Messages = ({ messages, inProgress, children }: MessagesProps) => {\n const { chatComponentsCache } = useCopilotContext();\n\n const context = useChatContext();\n const initialMessages = useMemo(\n () => makeInitialMessages(context.labels.initial),\n [context.labels.initial],\n );\n messages = [...initialMessages, ...messages];\n\n const functionResults: Record<string, string> = {};\n\n for (let i = 0; i < messages.length; i++) {\n if (messages[i] instanceof ActionExecutionMessage) {\n const id = messages[i].id;\n const resultMessage: ResultMessage | undefined = messages.find(\n (message) => message instanceof ResultMessage && message.actionExecutionId === id,\n ) as ResultMessage | undefined;\n\n if (resultMessage) {\n functionResults[id] = ResultMessage.decodeResult(resultMessage.result || \"\");\n }\n }\n }\n\n const messagesEndRef = React.useRef<HTMLDivElement>(null);\n\n const scrollToBottom = () => {\n if (messagesEndRef.current) {\n messagesEndRef.current.scrollIntoView({\n behavior: \"auto\",\n });\n }\n };\n\n useEffect(() => {\n scrollToBottom();\n }, [messages]);\n\n return (\n <div className=\"copilotKitMessages\">\n {messages.map((message, index) => {\n const isCurrentMessage = index === messages.length - 1;\n\n if (message instanceof TextMessage && message.role === \"user\") {\n return (\n <div key={index} className=\"copilotKitMessage copilotKitUserMessage\">\n {message.content}\n </div>\n );\n } else if (message instanceof TextMessage && message.role == \"assistant\") {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {isCurrentMessage && inProgress && !message.content ? (\n context.icons.spinnerIcon\n ) : (\n <Markdown content={message.content} />\n )}\n </div>\n );\n } else if (message instanceof ActionExecutionMessage) {\n if (\n chatComponentsCache.current !== null &&\n chatComponentsCache.current.actions[message.name]\n ) {\n const render = chatComponentsCache.current.actions[message.name];\n // render a static string\n if (typeof render === \"string\") {\n // when render is static, we show it only when in progress\n if (isCurrentMessage && inProgress) {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {context.icons.spinnerIcon} <span className=\"inProgressLabel\">{render}</span>\n </div>\n );\n }\n // Done - silent by default to avoid a series of \"done\" messages\n else {\n return null;\n }\n }\n // render is a function\n else {\n const args = message.arguments;\n\n let status: RenderFunctionStatus = \"inProgress\";\n\n if (functionResults[message.id] !== undefined) {\n status = \"complete\";\n } else if (message.status.code !== MessageStatusCode.Pending) {\n status = \"executing\";\n }\n\n const toRender = render({\n status: status as any,\n args,\n result: functionResults[message.id],\n });\n\n // No result and complete: stay silent\n if (!toRender && status === \"complete\") {\n return null;\n }\n\n if (typeof toRender === \"string\") {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {isCurrentMessage && inProgress && context.icons.spinnerIcon} {toRender}\n </div>\n );\n } else {\n return (\n <div key={index} className=\"copilotKitCustomAssistantMessage\">\n {toRender}\n </div>\n );\n }\n }\n }\n // No render function found- show the default message\n else if (!inProgress || !isCurrentMessage) {\n // Done - silent by default to avoid a series of \"done\" messages\n return null;\n } else {\n // In progress\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {context.icons.spinnerIcon}\n </div>\n );\n }\n } else if (message instanceof AgentStateMessage) {\n let render: string | CoagentInChatRenderFunction | undefined;\n\n if (chatComponentsCache.current !== null) {\n render =\n chatComponentsCache.current.coagentActions[\n `${message.agentName}-${message.nodeName}`\n ] || chatComponentsCache.current.coagentActions[`${message.agentName}-global`];\n }\n\n if (render) {\n // render a static string\n if (typeof render === \"string\") {\n // when render is static, we show it only when in progress\n if (isCurrentMessage && inProgress) {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {context.icons.spinnerIcon} <span className=\"inProgressLabel\">{render}</span>\n </div>\n );\n }\n // Done - silent by default to avoid a series of \"done\" messages\n else {\n return null;\n }\n }\n // render is a function\n else {\n const state = message.state;\n\n let status = message.active ? \"inProgress\" : \"complete\";\n\n const toRender = render({\n status: status as any,\n state,\n nodeName: message.nodeName,\n });\n\n // No result and complete: stay silent\n if (!toRender && status === \"complete\") {\n return null;\n }\n\n if (typeof toRender === \"string\") {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {isCurrentMessage && inProgress && context.icons.spinnerIcon} {toRender}\n </div>\n );\n } else {\n return (\n <div key={index} className=\"copilotKitCustomAssistantMessage\">\n {toRender}\n </div>\n );\n }\n }\n }\n // No render function found- show the default message\n else if (!inProgress || !isCurrentMessage) {\n // Done - silent by default to avoid a series of \"done\" messages\n return null;\n } else {\n // In progress\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {context.icons.spinnerIcon}\n </div>\n );\n }\n } else if (message instanceof ResultMessage && inProgress && isCurrentMessage) {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {context.icons.spinnerIcon}\n </div>\n );\n }\n })}\n <footer ref={messagesEndRef}>{children}</footer>\n </div>\n );\n};\n\nfunction makeInitialMessages(initial?: string | string[]): Message[] {\n let initialArray: string[] = [];\n if (initial) {\n if (Array.isArray(initial)) {\n initialArray.push(...initial);\n } else {\n initialArray.push(initial);\n }\n }\n\n return initialArray.map(\n (message) =>\n new TextMessage({\n role: Role.Assistant,\n content: message,\n }),\n );\n}\n"],"mappings":";;;;;;;;AAAA,OAAO,SAAS,WAAW,eAAe;AAI1C,SAA+B,yBAAyB;AACxD;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAiDK,cAyBM,YAzBN;AA9CL,IAAM,WAAW,CAAC,EAAE,UAAU,YAAY,SAAS,MAAqB;AAC7E,QAAM,EAAE,oBAAoB,IAAI,kBAAkB;AAElD,QAAM,UAAU,eAAe;AAC/B,QAAM,kBAAkB;AAAA,IACtB,MAAM,oBAAoB,QAAQ,OAAO,OAAO;AAAA,IAChD,CAAC,QAAQ,OAAO,OAAO;AAAA,EACzB;AACA,aAAW,CAAC,GAAG,iBAAiB,GAAG,QAAQ;AAE3C,QAAM,kBAA0C,CAAC;AAEjD,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,QAAI,SAAS,CAAC,aAAa,wBAAwB;AACjD,YAAM,KAAK,SAAS,CAAC,EAAE;AACvB,YAAM,gBAA2C,SAAS;AAAA,QACxD,CAAC,YAAY,mBAAmB,iBAAiB,QAAQ,sBAAsB;AAAA,MACjF;AAEA,UAAI,eAAe;AACjB,wBAAgB,EAAE,IAAI,cAAc,aAAa,cAAc,UAAU,EAAE;AAAA,MAC7E;AAAA,IACF;AAAA,EACF;AAEA,QAAM,iBAAiB,MAAM,OAAuB,I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WAAW,YAAY;AACtC,qBAAO;AAAA,YACT;AAEA,gBAAI,OAAO,aAAa,UAAU;AAChC,qBACE,qBAAC,SAAgB,WAAW,gDACzB;AAAA,oCAAoB,cAAc,QAAQ,MAAM;AAAA,gBAAY;AAAA,gBAAE;AAAA,mBADvD,KAEV;AAAA,YAEJ,OAAO;AACL,qBACE,oBAAC,SAAgB,WAAU,oCACxB,sBADO,KAEV;AAAA,YAEJ;AAAA,UACF;AAAA,QACF,WAES,CAAC,cAAc,CAAC,kBAAkB;AAEzC,iBAAO;AAAA,QACT,OAAO;AAEL,iBACE,oBAAC,SAAgB,WAAW,gDACzB,kBAAQ,MAAM,eADP,KAEV;AAAA,QAEJ;AAAA,MACF,WAAW,mBAAmB,iBAAiB,cAAc,kBAAkB;AAC7E,eACE,oBAAC,SAAgB,WAAW,gDACzB,kBAAQ,MAAM,eADP,KAEV;AAAA,MAEJ;AAAA,IACF,CAAC;AAAA,IACD,oBAAC,YAAO,KAAK,gBAAiB,UAAS;AAAA,KACzC;AAEJ;AAEA,SAAS,oBAAoB,SAAwC;AACnE,MAAI,eAAyB,CAAC;AAC9B,MAAI,SAAS;AACX,QAAI,MAAM,QAAQ,OAAO,GAAG;AAC1B,mBAAa,KAAK,GAAG,OAAO;AAAA,IAC9B,OAAO;AACL,mBAAa,KAAK,OAAO;AAAA,IAC3B;AAAA,EACF;AAEA,SAAO,aAAa;AAAA,IAClB,CAAC,YACC,IAAI,YAAY;AAAA,MACd,MAAM,KAAK;AAAA,MACX,SAAS;AAAA,IACX,CAAC;AAAA,EACL;AACF;","names":[]}
|
package/dist/chunk-FZC7X5PK.mjs
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__objRest,
|
|
3
|
-
__spreadProps,
|
|
4
|
-
__spreadValues
|
|
5
|
-
} from "./chunk-MRXNTQOX.mjs";
|
|
6
|
-
|
|
7
|
-
// src/components/chat/Icons.tsx
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
var OpenIcon = /* @__PURE__ */ jsx(
|
|
10
|
-
"svg",
|
|
11
|
-
{
|
|
12
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
-
viewBox: "0 0 24 24",
|
|
14
|
-
fill: "currentColor",
|
|
15
|
-
width: "24",
|
|
16
|
-
height: "24",
|
|
17
|
-
children: /* @__PURE__ */ jsx("g", { transform: "translate(24, 0) scale(-1, 1)", children: /* @__PURE__ */ jsx(
|
|
18
|
-
"path",
|
|
19
|
-
{
|
|
20
|
-
fillRule: "evenodd",
|
|
21
|
-
d: "M5.337 21.718a6.707 6.707 0 01-.533-.074.75.75 0 01-.44-1.223 3.73 3.73 0 00.814-1.686c.023-.115-.022-.317-.254-.543C3.274 16.587 2.25 14.41 2.25 12c0-5.03 4.428-9 9.75-9s9.75 3.97 9.75 9c0 5.03-4.428 9-9.75 9-.833 0-1.643-.097-2.417-.279a6.721 6.721 0 01-4.246.997z",
|
|
22
|
-
clipRule: "evenodd"
|
|
23
|
-
}
|
|
24
|
-
) })
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
var CloseIcon = /* @__PURE__ */ jsx(
|
|
28
|
-
"svg",
|
|
29
|
-
{
|
|
30
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
31
|
-
fill: "none",
|
|
32
|
-
viewBox: "0 0 24 24",
|
|
33
|
-
strokeWidth: "1.5",
|
|
34
|
-
stroke: "currentColor",
|
|
35
|
-
width: "24",
|
|
36
|
-
height: "24",
|
|
37
|
-
children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" })
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
var HeaderCloseIcon = /* @__PURE__ */ jsx(
|
|
41
|
-
"svg",
|
|
42
|
-
{
|
|
43
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
44
|
-
fill: "none",
|
|
45
|
-
viewBox: "0 0 24 24",
|
|
46
|
-
strokeWidth: "1.5",
|
|
47
|
-
stroke: "currentColor",
|
|
48
|
-
width: "24",
|
|
49
|
-
height: "24",
|
|
50
|
-
children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
var SendIcon = /* @__PURE__ */ jsx(
|
|
54
|
-
"svg",
|
|
55
|
-
{
|
|
56
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
57
|
-
fill: "none",
|
|
58
|
-
viewBox: "0 0 24 24",
|
|
59
|
-
strokeWidth: 1.5,
|
|
60
|
-
stroke: "currentColor",
|
|
61
|
-
width: "24",
|
|
62
|
-
height: "24",
|
|
63
|
-
children: /* @__PURE__ */ jsx(
|
|
64
|
-
"path",
|
|
65
|
-
{
|
|
66
|
-
strokeLinecap: "round",
|
|
67
|
-
strokeLinejoin: "round",
|
|
68
|
-
d: "M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
var SpinnerIcon = /* @__PURE__ */ jsxs(
|
|
74
|
-
"svg",
|
|
75
|
-
{
|
|
76
|
-
style: {
|
|
77
|
-
animation: "copilotKitSpinAnimation 1s linear infinite",
|
|
78
|
-
color: "rgb(107 114 128)"
|
|
79
|
-
},
|
|
80
|
-
width: "24",
|
|
81
|
-
height: "24",
|
|
82
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
83
|
-
fill: "none",
|
|
84
|
-
viewBox: "0 0 24 24",
|
|
85
|
-
children: [
|
|
86
|
-
/* @__PURE__ */ jsx(
|
|
87
|
-
"circle",
|
|
88
|
-
{
|
|
89
|
-
style: { opacity: 0.25 },
|
|
90
|
-
cx: "12",
|
|
91
|
-
cy: "12",
|
|
92
|
-
r: "10",
|
|
93
|
-
stroke: "currentColor",
|
|
94
|
-
strokeWidth: "4"
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
/* @__PURE__ */ jsx(
|
|
98
|
-
"path",
|
|
99
|
-
{
|
|
100
|
-
style: { opacity: 0.75 },
|
|
101
|
-
fill: "currentColor",
|
|
102
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
]
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
var SmallSpinnerIcon = /* @__PURE__ */ jsxs(
|
|
109
|
-
"svg",
|
|
110
|
-
{
|
|
111
|
-
style: {
|
|
112
|
-
animation: "copilotKitSpinAnimation 1s linear infinite"
|
|
113
|
-
},
|
|
114
|
-
width: "13",
|
|
115
|
-
height: "13",
|
|
116
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
117
|
-
fill: "none",
|
|
118
|
-
viewBox: "0 0 24 24",
|
|
119
|
-
children: [
|
|
120
|
-
/* @__PURE__ */ jsx(
|
|
121
|
-
"circle",
|
|
122
|
-
{
|
|
123
|
-
style: { opacity: 0.25 },
|
|
124
|
-
cx: "12",
|
|
125
|
-
cy: "12",
|
|
126
|
-
r: "10",
|
|
127
|
-
stroke: "currentColor",
|
|
128
|
-
strokeWidth: "4"
|
|
129
|
-
}
|
|
130
|
-
),
|
|
131
|
-
/* @__PURE__ */ jsx(
|
|
132
|
-
"path",
|
|
133
|
-
{
|
|
134
|
-
style: { opacity: 0.75 },
|
|
135
|
-
fill: "currentColor",
|
|
136
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
137
|
-
}
|
|
138
|
-
)
|
|
139
|
-
]
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
var ActivityIcon = /* @__PURE__ */ jsxs(
|
|
143
|
-
"svg",
|
|
144
|
-
{
|
|
145
|
-
style: {
|
|
146
|
-
display: "inline-block",
|
|
147
|
-
marginLeft: "0.25rem",
|
|
148
|
-
marginRight: "0.25rem"
|
|
149
|
-
},
|
|
150
|
-
height: "24",
|
|
151
|
-
width: "24",
|
|
152
|
-
viewBox: "0 0 27 27",
|
|
153
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
154
|
-
fill: "currentColor",
|
|
155
|
-
children: [
|
|
156
|
-
/* @__PURE__ */ jsx("circle", { className: "copilotKitActivityDot1", cx: "4", cy: "12", r: "3" }),
|
|
157
|
-
/* @__PURE__ */ jsx("circle", { className: "copilotKitActivityDot1 copilotKitActivityDot2", cx: "12", cy: "12", r: "3" }),
|
|
158
|
-
/* @__PURE__ */ jsx("circle", { className: "copilotKitActivityDot1 copilotKitActivityDot3", cx: "20", cy: "12", r: "3" })
|
|
159
|
-
]
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
function CheckIcon(_a) {
|
|
163
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
164
|
-
return /* @__PURE__ */ jsx(
|
|
165
|
-
"svg",
|
|
166
|
-
__spreadProps(__spreadValues({
|
|
167
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
168
|
-
viewBox: "0 0 256 256",
|
|
169
|
-
fill: "currentColor",
|
|
170
|
-
style: { height: "1rem", width: "1rem" },
|
|
171
|
-
className
|
|
172
|
-
}, props), {
|
|
173
|
-
children: /* @__PURE__ */ jsx("path", { d: "m229.66 77.66-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69 218.34 66.34a8 8 0 0 1 11.32 11.32Z" })
|
|
174
|
-
})
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
function DownloadIcon(_a) {
|
|
178
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
179
|
-
return /* @__PURE__ */ jsx(
|
|
180
|
-
"svg",
|
|
181
|
-
__spreadProps(__spreadValues({
|
|
182
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
183
|
-
viewBox: "0 0 256 256",
|
|
184
|
-
fill: "currentColor",
|
|
185
|
-
style: { height: "1rem", width: "1rem" },
|
|
186
|
-
className
|
|
187
|
-
}, props), {
|
|
188
|
-
children: /* @__PURE__ */ jsx("path", { d: "M224 152v56a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16v-56a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0Zm-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 132.69V40a8 8 0 0 0-16 0v92.69l-26.34-26.35a8 8 0 0 0-11.32 11.32Z" })
|
|
189
|
-
})
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
function CopyIcon(_a) {
|
|
193
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
194
|
-
return /* @__PURE__ */ jsx(
|
|
195
|
-
"svg",
|
|
196
|
-
__spreadProps(__spreadValues({
|
|
197
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
198
|
-
viewBox: "0 0 256 256",
|
|
199
|
-
fill: "currentColor",
|
|
200
|
-
style: { height: "1rem", width: "1rem" },
|
|
201
|
-
className
|
|
202
|
-
}, props), {
|
|
203
|
-
children: /* @__PURE__ */ jsx("path", { d: "M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8Zm-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z" })
|
|
204
|
-
})
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
var StopIcon = /* @__PURE__ */ jsx(
|
|
208
|
-
"svg",
|
|
209
|
-
{
|
|
210
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
211
|
-
viewBox: "0 0 256 256",
|
|
212
|
-
fill: "currentColor",
|
|
213
|
-
style: { height: "1rem", width: "1rem" },
|
|
214
|
-
children: /* @__PURE__ */ jsx("path", { d: "M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm24-120h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8Zm-8 48h-32v-32h32Z" })
|
|
215
|
-
}
|
|
216
|
-
);
|
|
217
|
-
var RegenerateIcon = /* @__PURE__ */ jsx(
|
|
218
|
-
"svg",
|
|
219
|
-
{
|
|
220
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
221
|
-
viewBox: "0 0 256 256",
|
|
222
|
-
fill: "currentColor",
|
|
223
|
-
style: { height: "1rem", width: "1rem" },
|
|
224
|
-
children: /* @__PURE__ */ jsx("path", { d: "M197.67 186.37a8 8 0 0 1 0 11.29C196.58 198.73 170.82 224 128 224c-37.39 0-64.53-22.4-80-39.85V208a8 8 0 0 1-16 0v-48a8 8 0 0 1 8-8h48a8 8 0 0 1 0 16H55.44C67.76 183.35 93 208 128 208c36 0 58.14-21.46 58.36-21.68a8 8 0 0 1 11.31.05ZM216 40a8 8 0 0 0-8 8v23.85C192.53 54.4 165.39 32 128 32c-42.82 0-68.58 25.27-69.66 26.34a8 8 0 0 0 11.3 11.34C69.86 69.46 92 48 128 48c35 0 60.24 24.65 72.56 40H168a8 8 0 0 0 0 16h48a8 8 0 0 0 8-8V48a8 8 0 0 0-8-8Z" })
|
|
225
|
-
}
|
|
226
|
-
);
|
|
227
|
-
var PushToTalkIcon = /* @__PURE__ */ jsx(
|
|
228
|
-
"svg",
|
|
229
|
-
{
|
|
230
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
231
|
-
fill: "none",
|
|
232
|
-
viewBox: "0 0 24 24",
|
|
233
|
-
strokeWidth: 1.5,
|
|
234
|
-
stroke: "currentColor",
|
|
235
|
-
className: "w-6 h-6",
|
|
236
|
-
children: /* @__PURE__ */ jsx(
|
|
237
|
-
"path",
|
|
238
|
-
{
|
|
239
|
-
strokeLinecap: "round",
|
|
240
|
-
strokeLinejoin: "round",
|
|
241
|
-
d: "M12 18.75a6 6 0 0 0 6-6v-1.5m-6 7.5a6 6 0 0 1-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 0 1-3-3V4.5a3 3 0 1 1 6 0v8.25a3 3 0 0 1-3 3Z"
|
|
242
|
-
}
|
|
243
|
-
)
|
|
244
|
-
}
|
|
245
|
-
);
|
|
246
|
-
|
|
247
|
-
export {
|
|
248
|
-
OpenIcon,
|
|
249
|
-
CloseIcon,
|
|
250
|
-
HeaderCloseIcon,
|
|
251
|
-
SendIcon,
|
|
252
|
-
SpinnerIcon,
|
|
253
|
-
SmallSpinnerIcon,
|
|
254
|
-
ActivityIcon,
|
|
255
|
-
CheckIcon,
|
|
256
|
-
DownloadIcon,
|
|
257
|
-
CopyIcon,
|
|
258
|
-
StopIcon,
|
|
259
|
-
RegenerateIcon,
|
|
260
|
-
PushToTalkIcon
|
|
261
|
-
};
|
|
262
|
-
//# sourceMappingURL=chunk-FZC7X5PK.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/Icons.tsx"],"sourcesContent":["import React from \"react\";\n\nexport const OpenIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <g transform=\"translate(24, 0) scale(-1, 1)\">\n <path\n fillRule=\"evenodd\"\n d=\"M5.337 21.718a6.707 6.707 0 01-.533-.074.75.75 0 01-.44-1.223 3.73 3.73 0 00.814-1.686c.023-.115-.022-.317-.254-.543C3.274 16.587 2.25 14.41 2.25 12c0-5.03 4.428-9 9.75-9s9.75 3.97 9.75 9c0 5.03-4.428 9-9.75 9-.833 0-1.643-.097-2.417-.279a6.721 6.721 0 01-4.246.997z\"\n clipRule=\"evenodd\"\n />\n </g>\n </svg>\n);\n\nexport const CloseIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19.5 8.25l-7.5 7.5-7.5-7.5\" />\n </svg>\n);\n\nexport const HeaderCloseIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n);\n\nexport const SendIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={1.5}\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5\"\n />\n </svg>\n);\n\nexport const SpinnerIcon = (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color: \"rgb(107 114 128)\",\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n);\n\nexport const SmallSpinnerIcon = (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n }}\n width=\"13\"\n height=\"13\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n);\n\nexport const ActivityIcon = (\n <svg\n style={{\n display: \"inline-block\",\n marginLeft: \"0.25rem\",\n marginRight: \"0.25rem\",\n }}\n height=\"24\"\n width=\"24\"\n viewBox=\"0 0 27 27\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n >\n <circle className=\"copilotKitActivityDot1\" cx=\"4\" cy=\"12\" r=\"3\" />\n <circle className=\"copilotKitActivityDot1 copilotKitActivityDot2\" cx=\"12\" cy=\"12\" r=\"3\" />\n <circle className=\"copilotKitActivityDot1 copilotKitActivityDot3\" cx=\"20\" cy=\"12\" r=\"3\" />\n </svg>\n);\n\nexport function CheckIcon({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n className={className}\n {...props}\n >\n <path d=\"m229.66 77.66-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69 218.34 66.34a8 8 0 0 1 11.32 11.32Z\" />\n </svg>\n );\n}\n\nexport function DownloadIcon({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n className={className}\n {...props}\n >\n <path d=\"M224 152v56a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16v-56a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0Zm-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 132.69V40a8 8 0 0 0-16 0v92.69l-26.34-26.35a8 8 0 0 0-11.32 11.32Z\" />\n </svg>\n );\n}\n\nexport function CopyIcon({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n className={className}\n {...props}\n >\n <path d=\"M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8Zm-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z\" />\n </svg>\n );\n}\n\nexport const StopIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n >\n <path d=\"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm24-120h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8Zm-8 48h-32v-32h32Z\" />\n </svg>\n);\n\nexport const RegenerateIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n >\n <path d=\"M197.67 186.37a8 8 0 0 1 0 11.29C196.58 198.73 170.82 224 128 224c-37.39 0-64.53-22.4-80-39.85V208a8 8 0 0 1-16 0v-48a8 8 0 0 1 8-8h48a8 8 0 0 1 0 16H55.44C67.76 183.35 93 208 128 208c36 0 58.14-21.46 58.36-21.68a8 8 0 0 1 11.31.05ZM216 40a8 8 0 0 0-8 8v23.85C192.53 54.4 165.39 32 128 32c-42.82 0-68.58 25.27-69.66 26.34a8 8 0 0 0 11.3 11.34C69.86 69.46 92 48 128 48c35 0 60.24 24.65 72.56 40H168a8 8 0 0 0 0 16h48a8 8 0 0 0 8-8V48a8 8 0 0 0-8-8Z\" />\n </svg>\n);\n\nexport const PushToTalkIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={1.5}\n stroke=\"currentColor\"\n className=\"w-6 h-6\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 18.75a6 6 0 0 0 6-6v-1.5m-6 7.5a6 6 0 0 1-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 0 1-3-3V4.5a3 3 0 1 1 6 0v8.25a3 3 0 0 1-3 3Z\"\n />\n </svg>\n);\n"],"mappings":";;;;;;;AAWM,cAwDJ,YAxDI;AATC,IAAM,WACX;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACN,QAAO;AAAA,IAEP,8BAAC,OAAE,WAAU,iCACX;AAAA,MAAC;AAAA;AAAA,QACC,UAAS;AAAA,QACT,GAAE;AAAA,QACF,UAAS;AAAA;AAAA,IACX,GACF;AAAA;AACF;AAGK,IAAM,YACX;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,aAAY;AAAA,IACZ,QAAO;AAAA,IACP,OAAM;AAAA,IACN,QAAO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