@bikdotai/bik-component-library 0.0.863-beta.1 → 0.0.863-beta.3

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.
Files changed (102) hide show
  1. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  2. package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
  3. package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
  4. package/dist/cjs/components/agent-builder/utils/sourceIcons.js.map +1 -1
  5. package/dist/cjs/index.js +1 -1
  6. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  7. package/dist/esm/components/agent-builder/constants/tools.d.ts +6 -5
  8. package/dist/esm/components/agent-builder/constants/tools.js +24 -21
  9. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
  10. package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +4 -0
  11. package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
  12. package/dist/esm/index.d.ts +0 -1
  13. package/dist/esm/index.js +782 -832
  14. package/dist/esm/index.js.map +1 -1
  15. package/package.json +1 -1
  16. package/dist/cjs/components/bik-copilot/BIKCopilot.js +0 -2
  17. package/dist/cjs/components/bik-copilot/BIKCopilot.js.map +0 -1
  18. package/dist/cjs/components/bik-copilot/ControlledCopilot.js +0 -2
  19. package/dist/cjs/components/bik-copilot/ControlledCopilot.js.map +0 -1
  20. package/dist/cjs/components/bik-copilot/ControlledCopilot.styled.js +0 -27
  21. package/dist/cjs/components/bik-copilot/ControlledCopilot.styled.js.map +0 -1
  22. package/dist/cjs/components/bik-copilot/CopilotBall.js +0 -2
  23. package/dist/cjs/components/bik-copilot/CopilotBall.js.map +0 -1
  24. package/dist/cjs/components/bik-copilot/CopilotBall.styled.js +0 -42
  25. package/dist/cjs/components/bik-copilot/CopilotBall.styled.js.map +0 -1
  26. package/dist/cjs/components/bik-copilot/CopilotPanel.js +0 -2
  27. package/dist/cjs/components/bik-copilot/CopilotPanel.js.map +0 -1
  28. package/dist/cjs/components/bik-copilot/CopilotPanel.styled.js +0 -460
  29. package/dist/cjs/components/bik-copilot/CopilotPanel.styled.js.map +0 -1
  30. package/dist/cjs/components/bik-copilot/copilotPlacement.js +0 -2
  31. package/dist/cjs/components/bik-copilot/copilotPlacement.js.map +0 -1
  32. package/dist/cjs/components/bik-copilot/services/copilotDb.js +0 -2
  33. package/dist/cjs/components/bik-copilot/services/copilotDb.js.map +0 -1
  34. package/dist/cjs/components/bik-copilot/services/copilotIcebreakersClient.js +0 -2
  35. package/dist/cjs/components/bik-copilot/services/copilotIcebreakersClient.js.map +0 -1
  36. package/dist/cjs/components/bik-copilot/services/copilotMessagesClient.js +0 -2
  37. package/dist/cjs/components/bik-copilot/services/copilotMessagesClient.js.map +0 -1
  38. package/dist/cjs/components/bik-copilot/services/copilotPageSession.js +0 -2
  39. package/dist/cjs/components/bik-copilot/services/copilotPageSession.js.map +0 -1
  40. package/dist/cjs/components/bik-copilot/services/copilotSseParser.js +0 -7
  41. package/dist/cjs/components/bik-copilot/services/copilotSseParser.js.map +0 -1
  42. package/dist/cjs/components/bik-copilot/services/copilotStreamClient.js +0 -2
  43. package/dist/cjs/components/bik-copilot/services/copilotStreamClient.js.map +0 -1
  44. package/dist/cjs/components/bik-copilot/useCopilotIcebreakers.js +0 -2
  45. package/dist/cjs/components/bik-copilot/useCopilotIcebreakers.js.map +0 -1
  46. package/dist/cjs/components/bik-copilot/useCopilotStreamChat.js +0 -2
  47. package/dist/cjs/components/bik-copilot/useCopilotStreamChat.js.map +0 -1
  48. package/dist/cjs/components/bik-copilot/useDraggableFloater.js +0 -2
  49. package/dist/cjs/components/bik-copilot/useDraggableFloater.js.map +0 -1
  50. package/dist/esm/components/bik-copilot/BIKCopilot.d.ts +0 -32
  51. package/dist/esm/components/bik-copilot/BIKCopilot.js +0 -114
  52. package/dist/esm/components/bik-copilot/BIKCopilot.js.map +0 -1
  53. package/dist/esm/components/bik-copilot/ControlledCopilot.d.ts +0 -14
  54. package/dist/esm/components/bik-copilot/ControlledCopilot.js +0 -170
  55. package/dist/esm/components/bik-copilot/ControlledCopilot.js.map +0 -1
  56. package/dist/esm/components/bik-copilot/ControlledCopilot.styled.d.ts +0 -7
  57. package/dist/esm/components/bik-copilot/ControlledCopilot.styled.js +0 -31
  58. package/dist/esm/components/bik-copilot/ControlledCopilot.styled.js.map +0 -1
  59. package/dist/esm/components/bik-copilot/CopilotBall.d.ts +0 -13
  60. package/dist/esm/components/bik-copilot/CopilotBall.js +0 -50
  61. package/dist/esm/components/bik-copilot/CopilotBall.js.map +0 -1
  62. package/dist/esm/components/bik-copilot/CopilotBall.styled.d.ts +0 -9
  63. package/dist/esm/components/bik-copilot/CopilotBall.styled.js +0 -46
  64. package/dist/esm/components/bik-copilot/CopilotBall.styled.js.map +0 -1
  65. package/dist/esm/components/bik-copilot/CopilotPanel.d.ts +0 -9
  66. package/dist/esm/components/bik-copilot/CopilotPanel.js +0 -379
  67. package/dist/esm/components/bik-copilot/CopilotPanel.js.map +0 -1
  68. package/dist/esm/components/bik-copilot/CopilotPanel.styled.d.ts +0 -64
  69. package/dist/esm/components/bik-copilot/CopilotPanel.styled.js +0 -496
  70. package/dist/esm/components/bik-copilot/CopilotPanel.styled.js.map +0 -1
  71. package/dist/esm/components/bik-copilot/copilotPlacement.d.ts +0 -24
  72. package/dist/esm/components/bik-copilot/copilotPlacement.js +0 -38
  73. package/dist/esm/components/bik-copilot/copilotPlacement.js.map +0 -1
  74. package/dist/esm/components/bik-copilot/index.d.ts +0 -16
  75. package/dist/esm/components/bik-copilot/model.d.ts +0 -674
  76. package/dist/esm/components/bik-copilot/services/copilotDb.d.ts +0 -90
  77. package/dist/esm/components/bik-copilot/services/copilotDb.js +0 -96
  78. package/dist/esm/components/bik-copilot/services/copilotDb.js.map +0 -1
  79. package/dist/esm/components/bik-copilot/services/copilotIcebreakersClient.d.ts +0 -11
  80. package/dist/esm/components/bik-copilot/services/copilotIcebreakersClient.js +0 -54
  81. package/dist/esm/components/bik-copilot/services/copilotIcebreakersClient.js.map +0 -1
  82. package/dist/esm/components/bik-copilot/services/copilotMessagesClient.d.ts +0 -23
  83. package/dist/esm/components/bik-copilot/services/copilotMessagesClient.js +0 -78
  84. package/dist/esm/components/bik-copilot/services/copilotMessagesClient.js.map +0 -1
  85. package/dist/esm/components/bik-copilot/services/copilotPageSession.d.ts +0 -37
  86. package/dist/esm/components/bik-copilot/services/copilotPageSession.js +0 -35
  87. package/dist/esm/components/bik-copilot/services/copilotPageSession.js.map +0 -1
  88. package/dist/esm/components/bik-copilot/services/copilotSseParser.d.ts +0 -22
  89. package/dist/esm/components/bik-copilot/services/copilotSseParser.js +0 -52
  90. package/dist/esm/components/bik-copilot/services/copilotSseParser.js.map +0 -1
  91. package/dist/esm/components/bik-copilot/services/copilotStreamClient.d.ts +0 -31
  92. package/dist/esm/components/bik-copilot/services/copilotStreamClient.js +0 -103
  93. package/dist/esm/components/bik-copilot/services/copilotStreamClient.js.map +0 -1
  94. package/dist/esm/components/bik-copilot/useCopilotIcebreakers.d.ts +0 -17
  95. package/dist/esm/components/bik-copilot/useCopilotIcebreakers.js +0 -60
  96. package/dist/esm/components/bik-copilot/useCopilotIcebreakers.js.map +0 -1
  97. package/dist/esm/components/bik-copilot/useCopilotStreamChat.d.ts +0 -20
  98. package/dist/esm/components/bik-copilot/useCopilotStreamChat.js +0 -333
  99. package/dist/esm/components/bik-copilot/useCopilotStreamChat.js.map +0 -1
  100. package/dist/esm/components/bik-copilot/useDraggableFloater.d.ts +0 -9
  101. package/dist/esm/components/bik-copilot/useDraggableFloater.js +0 -118
  102. package/dist/esm/components/bik-copilot/useDraggableFloater.js.map +0 -1
@@ -1,50 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import b from "../../assets/icons/bik_ai_stars_icon.svg.js";
3
- import s from "../../assets/icons/chevronDown.svg.js";
4
- import { BallButton as x } from "./CopilotBall.styled.js";
5
- const C = "data-bik-copilot-ball", w = ({
6
- isOpen: t,
7
- onToggle: n,
8
- position: i,
9
- size: a,
10
- isDragging: e,
11
- draggable: c,
12
- color: d,
13
- zIndex: g,
14
- icon: h,
15
- openIcon: m,
16
- ariaLabel: p,
17
- onPointerDown: $,
18
- onPointerMove: f,
19
- onPointerUp: u,
20
- onPointerCancel: B
21
- }) => {
22
- const o = Math.round(a * 0.42), l = t ? /* @__PURE__ */ r(s, { width: o, height: o }) : /* @__PURE__ */ r(b, { width: o, height: o }), I = t ? m ?? l : h ?? l;
23
- return /* @__PURE__ */ r(
24
- x,
25
- {
26
- type: "button",
27
- [C]: "true",
28
- $size: a,
29
- $left: i.x,
30
- $top: i.y,
31
- $color: d,
32
- $zIndex: g,
33
- $isDragging: e,
34
- $draggable: c,
35
- "aria-label": p || "Copilot",
36
- "aria-expanded": t,
37
- onClick: n,
38
- onPointerDown: $,
39
- onPointerMove: f,
40
- onPointerUp: u,
41
- onPointerCancel: B,
42
- children: I
43
- }
44
- );
45
- };
46
- export {
47
- C as COPILOT_BALL_ATTRIBUTE,
48
- w as CopilotBall
49
- };
50
- //# sourceMappingURL=CopilotBall.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CopilotBall.js","sources":["../../../../src/components/bik-copilot/CopilotBall.tsx"],"sourcesContent":["import AiStarsIcon from '@src/assets/icons/bik_ai_stars_icon.svg';\nimport ChevronDownIcon from '@src/assets/icons/chevronDown.svg';\nimport React from 'react';\nimport { BallButton } from './CopilotBall.styled';\nimport { CopilotBallProps } from './model';\n\n/**\n * Marks the ball in the DOM so an outside-click handler can tell the ball apart\n * from the rest of the page and not fight the ball's own toggle.\n */\nexport const COPILOT_BALL_ATTRIBUTE = 'data-bik-copilot-ball';\n\n/**\n * The floating ball that opens the copilot panel. Purely presentational — the\n * drag gesture lives in `useDraggableFloater` and is passed in as handlers.\n */\nexport const CopilotBall: React.FC<CopilotBallProps> = ({\n\tisOpen,\n\tonToggle,\n\tposition,\n\tsize,\n\tisDragging,\n\tdraggable,\n\tcolor,\n\tzIndex,\n\ticon,\n\topenIcon,\n\tariaLabel,\n\tonPointerDown,\n\tonPointerMove,\n\tonPointerUp,\n\tonPointerCancel,\n}) => {\n\tconst iconSize = Math.round(size * 0.42);\n\tconst defaultIcon = isOpen ? (\n\t\t<ChevronDownIcon width={iconSize} height={iconSize} />\n\t) : (\n\t\t<AiStarsIcon width={iconSize} height={iconSize} />\n\t);\n\tconst activeIcon = isOpen ? openIcon ?? defaultIcon : icon ?? defaultIcon;\n\n\treturn (\n\t\t<BallButton\n\t\t\ttype=\"button\"\n\t\t\t{...{ [COPILOT_BALL_ATTRIBUTE]: 'true' }}\n\t\t\t$size={size}\n\t\t\t$left={position.x}\n\t\t\t$top={position.y}\n\t\t\t$color={color}\n\t\t\t$zIndex={zIndex}\n\t\t\t$isDragging={isDragging}\n\t\t\t$draggable={draggable}\n\t\t\t/* A disclosure button keeps a stable name and reports its state through\n\t\t\t aria-expanded, so this must not become \"Open/Close copilot\" — that\n\t\t\t would also collide with the panel's own close button. */\n\t\t\taria-label={ariaLabel || 'Copilot'}\n\t\t\taria-expanded={isOpen}\n\t\t\tonClick={onToggle}\n\t\t\tonPointerDown={onPointerDown}\n\t\t\tonPointerMove={onPointerMove}\n\t\t\tonPointerUp={onPointerUp}\n\t\t\tonPointerCancel={onPointerCancel}\n\t\t>\n\t\t\t{activeIcon}\n\t\t</BallButton>\n\t);\n};\n\nexport default CopilotBall;\n"],"names":["COPILOT_BALL_ATTRIBUTE","CopilotBall","isOpen","onToggle","position","size","isDragging","draggable","color","zIndex","icon","openIcon","ariaLabel","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","iconSize","defaultIcon","jsx","ChevronDownIcon","AiStarsIcon","activeIcon","BallButton"],"mappings":";;;;AAUO,MAAMA,IAAyB,yBAMzBC,IAA0C,CAAC;AAAA,EACvD,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,iBAAAC;AACD,MAAM;AACL,QAAMC,IAAW,KAAK,MAAMZ,IAAO,IAAI,GACjCa,IAAchB,IACnB,gBAAAiB,EAACC,GAAA,EAAgB,OAAOH,GAAU,QAAQA,EAAA,CAAU,IAEpD,gBAAAE,EAACE,GAAA,EAAY,OAAOJ,GAAU,QAAQA,GAAU,GAE3CK,IAAapB,IAASS,KAAYO,IAAcR,KAAQQ;AAE9D,SACC,gBAAAC;AAAA,IAACI;AAAA,IAAA;AAAA,MACA,MAAK;AAAA,MACC,CAACvB,CAAsB,GAAG;AAAA,MAChC,OAAOK;AAAA,MACP,OAAOD,EAAS;AAAA,MAChB,MAAMA,EAAS;AAAA,MACf,QAAQI;AAAA,MACR,SAASC;AAAA,MACT,aAAaH;AAAA,MACb,YAAYC;AAAA,MAIZ,cAAYK,KAAa;AAAA,MACzB,iBAAeV;AAAA,MACf,SAASC;AAAA,MACT,eAAAU;AAAA,MACA,eAAAC;AAAA,MACA,aAAAC;AAAA,MACA,iBAAAC;AAAA,MAEC,UAAAM;AAAA,IAAA;AAAA,EAAA;AAGJ;"}
@@ -1,9 +0,0 @@
1
- export declare const BallButton: import('styled-components').StyledComponent<"button", any, {
2
- $size: number;
3
- $left: number;
4
- $top: number;
5
- $color: string;
6
- $zIndex: number;
7
- $isDragging: boolean;
8
- $draggable: boolean;
9
- }, never>;
@@ -1,46 +0,0 @@
1
- import s from "styled-components";
2
- const t = s.button`
3
- position: fixed;
4
- left: ${(e) => e.$left}px;
5
- top: ${(e) => e.$top}px;
6
- width: ${(e) => e.$size}px;
7
- height: ${(e) => e.$size}px;
8
- z-index: ${(e) => e.$zIndex};
9
-
10
- display: flex;
11
- align-items: center;
12
- justify-content: center;
13
- padding: 0;
14
- border: none;
15
- border-radius: 50%;
16
- background: ${(e) => e.$color};
17
- color: #ffffff;
18
- box-shadow: ${(e) => e.$isDragging ? "0 12px 32px rgba(40, 3, 78, 0.36)" : "0 6px 20px rgba(40, 3, 78, 0.24)"};
19
-
20
- cursor: ${(e) => e.$isDragging ? "grabbing" : e.$draggable ? "grab" : "pointer"};
21
- touch-action: none;
22
- user-select: none;
23
- -webkit-user-select: none;
24
-
25
- /* Position changes animate on release but must track the pointer 1:1 while
26
- the user is dragging. */
27
- transition: ${(e) => e.$isDragging ? "box-shadow 0.15s ease, transform 0.15s ease" : "left 0.22s ease, top 0.22s ease, box-shadow 0.15s ease, transform 0.15s ease"};
28
- transform: ${(e) => e.$isDragging ? "scale(1.06)" : "scale(1)"};
29
-
30
- &:hover {
31
- transform: scale(1.06);
32
- }
33
-
34
- &:focus-visible {
35
- outline: 2px solid #ffffff;
36
- outline-offset: 2px;
37
- }
38
-
39
- svg {
40
- pointer-events: none;
41
- }
42
- `;
43
- export {
44
- t as BallButton
45
- };
46
- //# sourceMappingURL=CopilotBall.styled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CopilotBall.styled.js","sources":["../../../../src/components/bik-copilot/CopilotBall.styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const BallButton = styled.button<{\n\t$size: number;\n\t$left: number;\n\t$top: number;\n\t$color: string;\n\t$zIndex: number;\n\t$isDragging: boolean;\n\t$draggable: boolean;\n}>`\n\tposition: fixed;\n\tleft: ${(props) => props.$left}px;\n\ttop: ${(props) => props.$top}px;\n\twidth: ${(props) => props.$size}px;\n\theight: ${(props) => props.$size}px;\n\tz-index: ${(props) => props.$zIndex};\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tborder: none;\n\tborder-radius: 50%;\n\tbackground: ${(props) => props.$color};\n\tcolor: #ffffff;\n\tbox-shadow: ${(props) =>\n\t\tprops.$isDragging\n\t\t\t? '0 12px 32px rgba(40, 3, 78, 0.36)'\n\t\t\t: '0 6px 20px rgba(40, 3, 78, 0.24)'};\n\n\tcursor: ${(props) =>\n\t\tprops.$isDragging ? 'grabbing' : props.$draggable ? 'grab' : 'pointer'};\n\ttouch-action: none;\n\tuser-select: none;\n\t-webkit-user-select: none;\n\n\t/* Position changes animate on release but must track the pointer 1:1 while\n\t the user is dragging. */\n\ttransition: ${(props) =>\n\t\tprops.$isDragging\n\t\t\t? 'box-shadow 0.15s ease, transform 0.15s ease'\n\t\t\t: 'left 0.22s ease, top 0.22s ease, box-shadow 0.15s ease, transform 0.15s ease'};\n\ttransform: ${(props) => (props.$isDragging ? 'scale(1.06)' : 'scale(1)')};\n\n\t&:hover {\n\t\ttransform: scale(1.06);\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid #ffffff;\n\t\toutline-offset: 2px;\n\t}\n\n\tsvg {\n\t\tpointer-events: none;\n\t}\n`;\n"],"names":["BallButton","styled","props"],"mappings":";AAEO,MAAMA,IAAaC,EAAO;AAAA;AAAA,SAUxB,CAACC,MAAUA,EAAM,KAAK;AAAA,QACvB,CAACA,MAAUA,EAAM,IAAI;AAAA,UACnB,CAACA,MAAUA,EAAM,KAAK;AAAA,WACrB,CAACA,MAAUA,EAAM,KAAK;AAAA,YACrB,CAACA,MAAUA,EAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAQrB,CAACA,MAAUA,EAAM,MAAM;AAAA;AAAA,eAEvB,CAACA,MACdA,EAAM,cACH,sCACA,kCAAkC;AAAA;AAAA,WAE5B,CAACA,MACVA,EAAM,cAAc,aAAaA,EAAM,aAAa,SAAS,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAOzD,CAACA,MACdA,EAAM,cACH,gDACA,8EAA8E;AAAA,cACrE,CAACA,MAAWA,EAAM,cAAc,gBAAgB,UAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -1,9 +0,0 @@
1
- import { default as React } from 'react';
2
- import { CopilotPanelProps } from './model';
3
- /**
4
- * Chat panel used by the copilot. Fully presentational: it renders the
5
- * transcript it is given and reports user intent through callbacks, so it works
6
- * against any backend.
7
- */
8
- export declare const CopilotPanel: React.FC<CopilotPanelProps>;
9
- export default CopilotPanel;
@@ -1,379 +0,0 @@
1
- import { jsxs as r, jsx as t, Fragment as ke } from "react/jsx-runtime";
2
- import g from "../../assets/icons/bik_ai_stars_icon.svg.js";
3
- import Ie from "../../assets/icons/cross.svg.js";
4
- import Te from "../../assets/icons/refresh.svg.js";
5
- import be, { useState as m, useRef as a, useEffect as L } from "react";
6
- import { COLORS as h } from "../../constants/Theme.js";
7
- import { renderMarkdownLite as Se } from "../bik-chatbot/utils/markdown.js";
8
- import { TitleSmall as xe, BodyCaption as q, BodySecondary as Ae } from "../TypographyStyle.js";
9
- import { PanelContainer as Me, PanelHeader as Be, HeaderAvatar as Le, HeaderText as Ee, HeaderTitleRow as Fe, HeaderBadge as Re, HeaderActions as _e, IconAction as Q, MessagesViewport as He, MessagesArea as Pe, EmptyState as We, EmptyStateIcon as je, SuggestionList as Oe, SuggestionChip as $e, HistoryLoader as Ne, MessageBubble as Ue, InterruptedNote as Ve, MessageActions as Ke, MessageAction as Xe, FollowUpList as ze, FollowUpsLabel as De, FollowUpChip as Je, ThinkingBubble as Ge, ThinkingLabel as qe, ScrollFade as Qe, JumpToLatestButton as Ye, ErrorBanner as Ze, InputArea as et, InputWrapper as tt, MessageInput as rt, SendButton as ot, Disclaimer as nt } from "./CopilotPanel.styled.js";
10
- import { DotPulse as Y } from "../dot-pulse/DotPulse.js";
11
- const it = 96, lt = 24, ct = 1800, at = async (i) => {
12
- try {
13
- if (navigator.clipboard?.writeText)
14
- return await navigator.clipboard.writeText(i), !0;
15
- } catch {
16
- }
17
- try {
18
- const o = document.createElement("textarea");
19
- o.value = i, o.setAttribute("readonly", ""), o.style.position = "fixed", o.style.top = "-1000px", o.style.opacity = "0", document.body.appendChild(o), o.select();
20
- const y = document.execCommand("copy");
21
- return document.body.removeChild(o), y;
22
- } catch {
23
- return !1;
24
- }
25
- }, dt = 48, st = () => /* @__PURE__ */ r(
26
- "svg",
27
- {
28
- viewBox: "0 0 24 24",
29
- width: "16",
30
- height: "16",
31
- fill: "none",
32
- stroke: "currentColor",
33
- strokeWidth: "2",
34
- strokeLinecap: "round",
35
- strokeLinejoin: "round",
36
- "aria-hidden": "true",
37
- children: [
38
- /* @__PURE__ */ t("path", { d: "M12 19V5" }),
39
- /* @__PURE__ */ t("path", { d: "M6 11l6-6 6 6" })
40
- ]
41
- }
42
- ), ht = () => /* @__PURE__ */ r(
43
- "svg",
44
- {
45
- viewBox: "0 0 24 24",
46
- width: "14",
47
- height: "14",
48
- fill: "none",
49
- stroke: "currentColor",
50
- strokeWidth: "2",
51
- strokeLinecap: "round",
52
- strokeLinejoin: "round",
53
- "aria-hidden": "true",
54
- children: [
55
- /* @__PURE__ */ t("path", { d: "M5 12h14" }),
56
- /* @__PURE__ */ t("path", { d: "M13 6l6 6-6 6" })
57
- ]
58
- }
59
- ), Z = ({ size: i = 16 }) => /* @__PURE__ */ t(
60
- "svg",
61
- {
62
- viewBox: "0 0 24 24",
63
- width: i,
64
- height: i,
65
- fill: "currentColor",
66
- "aria-hidden": "true",
67
- children: /* @__PURE__ */ t("rect", { x: "7", y: "7", width: "10", height: "10", rx: "2" })
68
- }
69
- ), ut = () => /* @__PURE__ */ r(
70
- "svg",
71
- {
72
- viewBox: "0 0 24 24",
73
- width: "14",
74
- height: "14",
75
- fill: "none",
76
- stroke: "currentColor",
77
- strokeWidth: "1.8",
78
- strokeLinecap: "round",
79
- strokeLinejoin: "round",
80
- "aria-hidden": "true",
81
- children: [
82
- /* @__PURE__ */ t("rect", { x: "9", y: "9", width: "11", height: "11", rx: "2" }),
83
- /* @__PURE__ */ t("path", { d: "M15 5.5A1.5 1.5 0 0 0 13.5 4H5.5A1.5 1.5 0 0 0 4 5.5v8A1.5 1.5 0 0 0 5.5 15" })
84
- ]
85
- }
86
- ), pt = () => /* @__PURE__ */ t(
87
- "svg",
88
- {
89
- viewBox: "0 0 24 24",
90
- width: "14",
91
- height: "14",
92
- fill: "none",
93
- stroke: "currentColor",
94
- strokeWidth: "2.2",
95
- strokeLinecap: "round",
96
- strokeLinejoin: "round",
97
- "aria-hidden": "true",
98
- children: /* @__PURE__ */ t("path", { d: "M5 13l4 4L19 7" })
99
- }
100
- ), ft = () => /* @__PURE__ */ t(
101
- "svg",
102
- {
103
- viewBox: "0 0 24 24",
104
- width: "14",
105
- height: "14",
106
- fill: "none",
107
- stroke: "currentColor",
108
- strokeWidth: "2.5",
109
- strokeLinecap: "round",
110
- strokeLinejoin: "round",
111
- "aria-hidden": "true",
112
- children: /* @__PURE__ */ t("path", { d: "M6 9l6 6 6-6" })
113
- }
114
- ), St = ({
115
- messages: i,
116
- onSend: o,
117
- onClose: y,
118
- title: C = "Copilot",
119
- badge: E,
120
- subtitle: F,
121
- avatar: ee,
122
- placeholder: te = "Write your message...",
123
- disclaimer: R = "AI can make mistakes, Verify the responses.",
124
- emptyStateTitle: re,
125
- emptyStateSubtitle: _ = "Here are some things you can try",
126
- suggestions: v,
127
- onSuggestionClick: oe,
128
- showRefresh: ne = !0,
129
- onRefresh: H,
130
- isThinking: u = !1,
131
- thinkingLabel: P = "Thinking",
132
- isStreaming: ie = !1,
133
- onStop: W,
134
- interruptedLabel: j = "This message was interrupted",
135
- followUpsLabel: O = "Follow ups",
136
- hasMoreHistory: le = !1,
137
- isLoadingHistory: p = !1,
138
- onLoadOlderMessages: $,
139
- historyLoadingLabel: ce = "Loading earlier messages",
140
- inputDisabled: l = !1,
141
- errorMessage: N,
142
- width: ae,
143
- height: de,
144
- className: se,
145
- style: he
146
- }) => {
147
- const [k, U] = m(""), [ue, V] = m(!1), [I, T] = m(!0), [f, K] = m(null), X = a(null), d = a(null), b = a(null), S = a(null), x = a(0), A = a(null), w = i.filter(
148
- (e) => e.content.length > 0 || e.wasInterrupted
149
- ), z = w.length === 0 && !u, c = u || ie, D = !l && !c && k.trim().length > 0, s = c && !!W, J = w[w.length - 1], M = !c && J?.role === "assistant" ? J.followUps : void 0, B = !z && !I;
150
- L(() => {
151
- I && b.current?.scrollIntoView({ behavior: "smooth" });
152
- }, [i, u, I]), L(() => {
153
- const e = S.current, n = A.current;
154
- !e || n === null || p || (A.current = null, e.scrollTop = e.scrollHeight - n, x.current = e.scrollTop);
155
- }, [i, p]);
156
- const pe = () => {
157
- const e = S.current;
158
- if (!e)
159
- return;
160
- const n = e.scrollHeight - e.scrollTop - e.clientHeight;
161
- e.scrollTop <= dt && le && !p && $ && (A.current = e.scrollHeight - e.scrollTop, $());
162
- const ve = e.scrollTop < x.current - 1;
163
- if (x.current = e.scrollTop, n <= lt) {
164
- T(!0);
165
- return;
166
- }
167
- ve && T(!1);
168
- }, fe = () => {
169
- T(!0), b.current?.scrollIntoView({ behavior: "smooth" });
170
- };
171
- L(
172
- () => () => {
173
- d.current && window.clearTimeout(d.current);
174
- },
175
- []
176
- );
177
- const we = async (e) => {
178
- await at(e.content) && (d.current && window.clearTimeout(d.current), K(e.id), d.current = window.setTimeout(
179
- () => K(null),
180
- ct
181
- ));
182
- }, G = () => {
183
- const e = k.trim();
184
- if (!e || l || c)
185
- return;
186
- o(e), U("");
187
- const n = X.current;
188
- n && (n.style.height = "auto");
189
- }, ge = (e) => {
190
- U(e.target.value);
191
- const n = e.target;
192
- n.style.height = "auto", n.style.height = `${Math.min(
193
- n.scrollHeight,
194
- it
195
- )}px`;
196
- }, me = (e) => {
197
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), G());
198
- }, ye = (e) => {
199
- l || c || (oe?.(e), o(e.text));
200
- }, Ce = (e) => {
201
- l || c || o(e);
202
- };
203
- return /* @__PURE__ */ r(
204
- Me,
205
- {
206
- className: se,
207
- style: { width: ae, height: de, ...he },
208
- role: "dialog",
209
- "aria-label": C,
210
- children: [
211
- /* @__PURE__ */ r(Be, { children: [
212
- /* @__PURE__ */ t(Le, { children: ee ?? /* @__PURE__ */ t(g, { width: 18, height: 18 }) }),
213
- /* @__PURE__ */ r(Ee, { children: [
214
- /* @__PURE__ */ r(Fe, { children: [
215
- /* @__PURE__ */ t(xe, { children: C }),
216
- E && /* @__PURE__ */ t(Re, { children: E })
217
- ] }),
218
- F && /* @__PURE__ */ t(q, { color: h.content.secondary, children: F })
219
- ] }),
220
- /* @__PURE__ */ r(_e, { children: [
221
- ne && H && /* @__PURE__ */ t(
222
- Q,
223
- {
224
- type: "button",
225
- onClick: H,
226
- "aria-label": "Start a new conversation",
227
- children: /* @__PURE__ */ t(Te, { width: 16, height: 16 })
228
- }
229
- ),
230
- /* @__PURE__ */ t(
231
- Q,
232
- {
233
- type: "button",
234
- onClick: y,
235
- "aria-label": "Close copilot",
236
- children: /* @__PURE__ */ t(Ie, { width: 18, height: 18 })
237
- }
238
- )
239
- ] })
240
- ] }),
241
- /* @__PURE__ */ r(He, { children: [
242
- /* @__PURE__ */ t(
243
- Pe,
244
- {
245
- ref: S,
246
- onScroll: pe,
247
- role: "region",
248
- "aria-label": "Conversation",
249
- children: z ? /* @__PURE__ */ r(We, { children: [
250
- /* @__PURE__ */ t(je, { children: /* @__PURE__ */ t(g, { width: 28, height: 28 }) }),
251
- /* @__PURE__ */ t(Ae, { style: { fontWeight: 600 }, children: re || C }),
252
- _ && /* @__PURE__ */ t(q, { color: h.content.secondary, children: _ }),
253
- v && v.length > 0 && /* @__PURE__ */ t(Oe, { children: v.map((e) => /* @__PURE__ */ r(
254
- $e,
255
- {
256
- type: "button",
257
- disabled: l || c,
258
- onClick: () => ye(e),
259
- children: [
260
- /* @__PURE__ */ t(g, { width: 14, height: 14 }),
261
- e.text
262
- ]
263
- },
264
- e.id
265
- )) })
266
- ] }) : /* @__PURE__ */ r(ke, { children: [
267
- p && /* @__PURE__ */ r(Ne, { role: "status", "aria-live": "polite", children: [
268
- /* @__PURE__ */ t(Y, { color: h.content.placeholder, size: 4 }),
269
- ce
270
- ] }),
271
- w.map((e) => /* @__PURE__ */ r(be.Fragment, { children: [
272
- e.content.length > 0 && /* @__PURE__ */ t(Ue, { $role: e.role, children: e.role === "assistant" ? /* @__PURE__ */ t(
273
- "div",
274
- {
275
- dangerouslySetInnerHTML: {
276
- __html: Se(e.content)
277
- }
278
- }
279
- ) : /* @__PURE__ */ t("div", { style: { whiteSpace: "pre-wrap" }, children: e.content }) }),
280
- e.wasInterrupted && j && /* @__PURE__ */ r(Ve, { children: [
281
- /* @__PURE__ */ t(Z, { size: 12 }),
282
- j
283
- ] }),
284
- e.role === "assistant" && e.content.length > 0 && !e.isStreaming && /* @__PURE__ */ t(Ke, { children: /* @__PURE__ */ t(
285
- Xe,
286
- {
287
- type: "button",
288
- onClick: () => {
289
- we(e);
290
- },
291
- "data-copied": f === e.id,
292
- title: f === e.id ? "Copied" : "Copy",
293
- "aria-label": f === e.id ? "Response copied to clipboard" : "Copy response",
294
- children: f === e.id ? /* @__PURE__ */ t(pt, {}) : /* @__PURE__ */ t(ut, {})
295
- }
296
- ) })
297
- ] }, e.id)),
298
- M && M.length > 0 && /* @__PURE__ */ r(ze, { children: [
299
- O && /* @__PURE__ */ t(De, { children: O }),
300
- M.map((e) => /* @__PURE__ */ r(
301
- Je,
302
- {
303
- type: "button",
304
- disabled: l,
305
- onClick: () => Ce(e),
306
- children: [
307
- /* @__PURE__ */ t(ht, {}),
308
- e
309
- ]
310
- },
311
- e
312
- ))
313
- ] }),
314
- u && /* @__PURE__ */ r(Ge, { role: "status", "aria-live": "polite", children: [
315
- /* @__PURE__ */ t(
316
- g,
317
- {
318
- width: 14,
319
- height: 14,
320
- color: h.content.brand
321
- }
322
- ),
323
- P && /* @__PURE__ */ t(qe, { children: P }),
324
- /* @__PURE__ */ t(Y, { color: h.background.brand, size: 5 })
325
- ] }),
326
- /* @__PURE__ */ t("div", { ref: b })
327
- ] })
328
- }
329
- ),
330
- /* @__PURE__ */ t(Qe, { $visible: B, "aria-hidden": "true" }),
331
- /* @__PURE__ */ t(
332
- Ye,
333
- {
334
- type: "button",
335
- $visible: B,
336
- onClick: fe,
337
- tabIndex: B ? 0 : -1,
338
- "aria-label": "Scroll to the latest message",
339
- children: /* @__PURE__ */ t(ft, {})
340
- }
341
- )
342
- ] }),
343
- N && /* @__PURE__ */ t(Ze, { role: "alert", children: N }),
344
- /* @__PURE__ */ t(et, { children: /* @__PURE__ */ r(tt, { $focused: ue, children: [
345
- /* @__PURE__ */ t(
346
- rt,
347
- {
348
- ref: X,
349
- rows: 1,
350
- value: k,
351
- placeholder: te,
352
- disabled: l,
353
- onChange: ge,
354
- onKeyDown: me,
355
- onFocus: () => V(!0),
356
- onBlur: () => V(!1)
357
- }
358
- ),
359
- /* @__PURE__ */ t(
360
- ot,
361
- {
362
- type: "button",
363
- $active: s || D,
364
- disabled: !s && !D,
365
- onClick: s ? W : G,
366
- "aria-label": s ? "Stop generating" : "Send message",
367
- children: s ? /* @__PURE__ */ t(Z, {}) : /* @__PURE__ */ t(st, {})
368
- }
369
- )
370
- ] }) }),
371
- R && /* @__PURE__ */ t(nt, { children: R })
372
- ]
373
- }
374
- );
375
- };
376
- export {
377
- St as CopilotPanel
378
- };
379
- //# sourceMappingURL=CopilotPanel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CopilotPanel.js","sources":["../../../../src/components/bik-copilot/CopilotPanel.tsx"],"sourcesContent":["import AiStarsIcon from '@src/assets/icons/bik_ai_stars_icon.svg';\nimport CrossIcon from '@src/assets/icons/cross.svg';\nimport RefreshIcon from '@src/assets/icons/refresh.svg';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { renderMarkdownLite } from '../bik-chatbot/utils/markdown';\nimport { DotPulse } from '../dot-pulse';\nimport { BodyCaption, BodySecondary, TitleSmall } from '../TypographyStyle';\nimport {\n\tDisclaimer,\n\tEmptyState,\n\tEmptyStateIcon,\n\tErrorBanner,\n\tFollowUpChip,\n\tFollowUpList,\n\tFollowUpsLabel,\n\tHeaderActions,\n\tHeaderAvatar,\n\tHeaderBadge,\n\tHeaderText,\n\tHeaderTitleRow,\n\tHistoryLoader,\n\tIconAction,\n\tInputArea,\n\tInputWrapper,\n\tInterruptedNote,\n\tJumpToLatestButton,\n\tMessageAction,\n\tMessageActions,\n\tMessageBubble,\n\tMessageInput,\n\tMessagesArea,\n\tMessagesViewport,\n\tPanelContainer,\n\tPanelHeader,\n\tScrollFade,\n\tSendButton,\n\tSuggestionChip,\n\tSuggestionList,\n\tThinkingBubble,\n\tThinkingLabel,\n} from './CopilotPanel.styled';\nimport { CopilotPanelProps } from './model';\n\nconst MAX_INPUT_HEIGHT_PX = 96;\n\n/** Slack at the bottom of the scroller that still counts as \"at the latest\". */\nconst AT_BOTTOM_TOLERANCE_PX = 24;\n\n/** How long the copy button shows its confirmation before reverting. */\nconst COPIED_FEEDBACK_MS = 1800;\n\n/**\n * Writes text to the clipboard.\n *\n * `navigator.clipboard` is missing outside a secure context and can reject when\n * the document is not focused, so a hidden-textarea `execCommand` fallback keeps\n * the button working there rather than failing silently.\n */\nconst writeToClipboard = async (text: string): Promise<boolean> => {\n\ttry {\n\t\tif (navigator.clipboard?.writeText) {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t\treturn true;\n\t\t}\n\t} catch {\n\t\t// Fall through to the legacy path.\n\t}\n\n\ttry {\n\t\tconst textarea = document.createElement('textarea');\n\t\ttextarea.value = text;\n\t\t// Off-screen rather than hidden: `display: none` cannot be selected.\n\t\ttextarea.setAttribute('readonly', '');\n\t\ttextarea.style.position = 'fixed';\n\t\ttextarea.style.top = '-1000px';\n\t\ttextarea.style.opacity = '0';\n\t\tdocument.body.appendChild(textarea);\n\t\ttextarea.select();\n\t\tconst copied = document.execCommand('copy');\n\t\tdocument.body.removeChild(textarea);\n\t\treturn copied;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n/** How close to the top counts as asking for the previous page. */\nconst NEAR_TOP_TOLERANCE_PX = 48;\n\nconst SendArrowIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M12 19V5\" />\n\t\t<path d=\"M6 11l6-6 6 6\" />\n\t</svg>\n);\n\nconst ArrowRightIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M5 12h14\" />\n\t\t<path d=\"M13 6l6 6-6 6\" />\n\t</svg>\n);\n\nconst StopIcon = ({ size = 16 }: { size?: number }) => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth={size}\n\t\theight={size}\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<rect x=\"7\" y=\"7\" width=\"10\" height=\"10\" rx=\"2\" />\n\t</svg>\n);\n\nconst CopyIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n\t\t<path d=\"M15 5.5A1.5 1.5 0 0 0 13.5 4H5.5A1.5 1.5 0 0 0 4 5.5v8A1.5 1.5 0 0 0 5.5 15\" />\n\t</svg>\n);\n\nconst CheckIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2.2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M5 13l4 4L19 7\" />\n\t</svg>\n);\n\nconst ChevronDownIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2.5\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M6 9l6 6 6-6\" />\n\t</svg>\n);\n\n/**\n * Chat panel used by the copilot. Fully presentational: it renders the\n * transcript it is given and reports user intent through callbacks, so it works\n * against any backend.\n */\nexport const CopilotPanel: React.FC<CopilotPanelProps> = ({\n\tmessages,\n\tonSend,\n\tonClose,\n\ttitle = 'Copilot',\n\tbadge,\n\tsubtitle,\n\tavatar,\n\tplaceholder = 'Write your message...',\n\tdisclaimer = 'AI can make mistakes, Verify the responses.',\n\temptyStateTitle,\n\temptyStateSubtitle = 'Here are some things you can try',\n\tsuggestions,\n\tonSuggestionClick,\n\tshowRefresh = true,\n\tonRefresh,\n\tisThinking = false,\n\tthinkingLabel = 'Thinking',\n\tisStreaming = false,\n\tonStop,\n\tinterruptedLabel = 'This message was interrupted',\n\tfollowUpsLabel = 'Follow ups',\n\thasMoreHistory = false,\n\tisLoadingHistory = false,\n\tonLoadOlderMessages,\n\thistoryLoadingLabel = 'Loading earlier messages',\n\tinputDisabled = false,\n\terrorMessage,\n\twidth,\n\theight,\n\tclassName,\n\tstyle,\n}) => {\n\tconst [input, setInput] = useState('');\n\tconst [isInputFocused, setIsInputFocused] = useState(false);\n\tconst [isAtLatest, setIsAtLatest] = useState(true);\n\t// Which reply is showing \"Copied\" — per message, so copying one does not tick\n\t// the button under another.\n\tconst [copiedMessageId, setCopiedMessageId] = useState<string | null>(null);\n\tconst inputRef = useRef<HTMLTextAreaElement>(null);\n\tconst copiedTimeoutRef = useRef<number | null>(null);\n\tconst bottomRef = useRef<HTMLDivElement>(null);\n\tconst scrollerRef = useRef<HTMLDivElement>(null);\n\tconst lastScrollTopRef = useRef(0);\n\t// Distance from the bottom at the moment an older page was asked for. Older\n\t// messages land *above* the viewport, so without restoring against this the\n\t// content under the reader jumps down by the height of what arrived.\n\tconst anchorFromBottomRef = useRef<number | null>(null);\n\n\t// An assistant bubble is pushed the moment a turn starts, before any text has\n\t// arrived; the thinking indicator stands in for it until then, so rendering it\n\t// too would show an empty balloon next to the dots. A turn stopped before its\n\t// first token keeps its place, carrying only the interrupted note.\n\tconst visibleMessages = messages.filter(\n\t\t(message) => message.content.length > 0 || message.wasInterrupted,\n\t);\n\tconst isEmpty = visibleMessages.length === 0 && !isThinking;\n\tconst isTurnInFlight = isThinking || isStreaming;\n\tconst canSend = !inputDisabled && !isTurnInFlight && input.trim().length > 0;\n\t// Stopping is the only thing the button can do mid-answer, so it becomes the\n\t// stop button rather than sitting there disabled.\n\tconst canStop = isTurnInFlight && Boolean(onStop);\n\t// Only the newest reply's suggestions are on offer — older ones answer a\n\t// question the conversation has already moved past.\n\tconst newestMessage = visibleMessages[visibleMessages.length - 1];\n\tconst followUps =\n\t\t!isTurnInFlight && newestMessage?.role === 'assistant'\n\t\t\t? newestMessage.followUps\n\t\t\t: undefined;\n\t// A long answer that the reader has scrolled up from: the tail is clipped, so\n\t// the fade and the arrow say there is more below.\n\tconst showScrollAffordance = !isEmpty && !isAtLatest;\n\n\t// Following the conversation is the default, but a reader who has scrolled up\n\t// mid-answer must not be yanked back down by the next chunk.\n\tuseEffect(() => {\n\t\tif (!isAtLatest) {\n\t\t\treturn;\n\t\t}\n\t\tbottomRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t}, [messages, isThinking, isAtLatest]);\n\n\t// Older messages have landed: put the reader back on the message they were\n\t// looking at, which is now that much further down.\n\tuseEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tconst anchor = anchorFromBottomRef.current;\n\t\tif (!scroller || anchor === null || isLoadingHistory) {\n\t\t\treturn;\n\t\t}\n\t\tanchorFromBottomRef.current = null;\n\t\tscroller.scrollTop = scroller.scrollHeight - anchor;\n\t\tlastScrollTopRef.current = scroller.scrollTop;\n\t}, [messages, isLoadingHistory]);\n\n\tconst handleScroll = () => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) {\n\t\t\treturn;\n\t\t}\n\t\tconst distanceFromBottom =\n\t\t\tscroller.scrollHeight - scroller.scrollTop - scroller.clientHeight;\n\n\t\t// Reaching the top asks for the page before this one. The threshold gives\n\t\t// the request a head start, so the page is usually there by the time the\n\t\t// reader arrives.\n\t\tif (\n\t\t\tscroller.scrollTop <= NEAR_TOP_TOLERANCE_PX &&\n\t\t\thasMoreHistory &&\n\t\t\t!isLoadingHistory &&\n\t\t\tonLoadOlderMessages\n\t\t) {\n\t\t\tanchorFromBottomRef.current = scroller.scrollHeight - scroller.scrollTop;\n\t\t\tonLoadOlderMessages();\n\t\t}\n\t\t// Scrolling *up* is the only thing that detaches from the latest message:\n\t\t// growing content also pushes the bottom away, and auto-scroll itself only\n\t\t// ever moves down, so distance alone would flap mid-stream.\n\t\tconst scrolledUp = scroller.scrollTop < lastScrollTopRef.current - 1;\n\t\tlastScrollTopRef.current = scroller.scrollTop;\n\n\t\tif (distanceFromBottom <= AT_BOTTOM_TOLERANCE_PX) {\n\t\t\tsetIsAtLatest(true);\n\t\t\treturn;\n\t\t}\n\t\tif (scrolledUp) {\n\t\t\tsetIsAtLatest(false);\n\t\t}\n\t};\n\n\tconst handleJumpToLatest = () => {\n\t\tsetIsAtLatest(true);\n\t\tbottomRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t};\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tif (copiedTimeoutRef.current) {\n\t\t\t\twindow.clearTimeout(copiedTimeoutRef.current);\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\n\tconst handleCopyMessage = async (\n\t\tmessage: CopilotPanelProps['messages'][number],\n\t) => {\n\t\t// The raw markdown, not the rendered HTML — that is what a reader wants to\n\t\t// paste into a doc or a ticket.\n\t\tconst copied = await writeToClipboard(message.content);\n\t\tif (!copied) {\n\t\t\treturn;\n\t\t}\n\t\tif (copiedTimeoutRef.current) {\n\t\t\twindow.clearTimeout(copiedTimeoutRef.current);\n\t\t}\n\t\tsetCopiedMessageId(message.id);\n\t\tcopiedTimeoutRef.current = window.setTimeout(\n\t\t\t() => setCopiedMessageId(null),\n\t\t\tCOPIED_FEEDBACK_MS,\n\t\t);\n\t};\n\n\tconst handleSend = () => {\n\t\tconst trimmed = input.trim();\n\t\tif (!trimmed || inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonSend(trimmed);\n\t\tsetInput('');\n\t\tconst textarea = inputRef.current;\n\t\tif (textarea) {\n\t\t\ttextarea.style.height = 'auto';\n\t\t}\n\t};\n\n\tconst handleInputChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\tsetInput(event.target.value);\n\t\tconst textarea = event.target;\n\t\ttextarea.style.height = 'auto';\n\t\ttextarea.style.height = `${Math.min(\n\t\t\ttextarea.scrollHeight,\n\t\t\tMAX_INPUT_HEIGHT_PX,\n\t\t)}px`;\n\t};\n\n\tconst handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n\t\tif (event.key === 'Enter' && !event.shiftKey) {\n\t\t\tevent.preventDefault();\n\t\t\thandleSend();\n\t\t}\n\t};\n\n\tconst handleSuggestionClick = (\n\t\tsuggestion: NonNullable<CopilotPanelProps['suggestions']>[number],\n\t) => {\n\t\tif (inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonSuggestionClick?.(suggestion);\n\t\tonSend(suggestion.text);\n\t};\n\n\tconst handleFollowUpClick = (followUp: string) => {\n\t\tif (inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonSend(followUp);\n\t};\n\n\treturn (\n\t\t<PanelContainer\n\t\t\tclassName={className}\n\t\t\tstyle={{ width, height, ...style }}\n\t\t\trole=\"dialog\"\n\t\t\taria-label={title}\n\t\t>\n\t\t\t<PanelHeader>\n\t\t\t\t<HeaderAvatar>\n\t\t\t\t\t{avatar ?? <AiStarsIcon width={18} height={18} />}\n\t\t\t\t</HeaderAvatar>\n\t\t\t\t<HeaderText>\n\t\t\t\t\t<HeaderTitleRow>\n\t\t\t\t\t\t<TitleSmall>{title}</TitleSmall>\n\t\t\t\t\t\t{badge && <HeaderBadge>{badge}</HeaderBadge>}\n\t\t\t\t\t</HeaderTitleRow>\n\t\t\t\t\t{subtitle && (\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t{subtitle}\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t)}\n\t\t\t\t</HeaderText>\n\t\t\t\t<HeaderActions>\n\t\t\t\t\t{showRefresh && onRefresh && (\n\t\t\t\t\t\t<IconAction\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tonClick={onRefresh}\n\t\t\t\t\t\t\taria-label=\"Start a new conversation\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RefreshIcon width={16} height={16} />\n\t\t\t\t\t\t</IconAction>\n\t\t\t\t\t)}\n\t\t\t\t\t<IconAction\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\taria-label=\"Close copilot\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CrossIcon width={18} height={18} />\n\t\t\t\t\t</IconAction>\n\t\t\t\t</HeaderActions>\n\t\t\t</PanelHeader>\n\n\t\t\t<MessagesViewport>\n\t\t\t\t<MessagesArea\n\t\t\t\t\tref={scrollerRef}\n\t\t\t\t\tonScroll={handleScroll}\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label=\"Conversation\"\n\t\t\t\t>\n\t\t\t\t\t{isEmpty ? (\n\t\t\t\t\t\t<EmptyState>\n\t\t\t\t\t\t\t<EmptyStateIcon>\n\t\t\t\t\t\t\t\t<AiStarsIcon width={28} height={28} />\n\t\t\t\t\t\t\t</EmptyStateIcon>\n\t\t\t\t\t\t\t<BodySecondary style={{ fontWeight: 600 }}>\n\t\t\t\t\t\t\t\t{emptyStateTitle || title}\n\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t{emptyStateSubtitle && (\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t\t{emptyStateSubtitle}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{suggestions && suggestions.length > 0 && (\n\t\t\t\t\t\t\t\t<SuggestionList>\n\t\t\t\t\t\t\t\t\t{suggestions.map((suggestion) => (\n\t\t\t\t\t\t\t\t\t\t<SuggestionChip\n\t\t\t\t\t\t\t\t\t\t\tkey={suggestion.id}\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tdisabled={inputDisabled || isTurnInFlight}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleSuggestionClick(suggestion)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<AiStarsIcon width={14} height={14} />\n\t\t\t\t\t\t\t\t\t\t\t{suggestion.text}\n\t\t\t\t\t\t\t\t\t\t</SuggestionChip>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</SuggestionList>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</EmptyState>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{isLoadingHistory && (\n\t\t\t\t\t\t\t\t<HistoryLoader role=\"status\" aria-live=\"polite\">\n\t\t\t\t\t\t\t\t\t<DotPulse color={COLORS.content.placeholder} size={4} />\n\t\t\t\t\t\t\t\t\t{historyLoadingLabel}\n\t\t\t\t\t\t\t\t</HistoryLoader>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{visibleMessages.map((message) => (\n\t\t\t\t\t\t\t\t<React.Fragment key={message.id}>\n\t\t\t\t\t\t\t\t\t{message.content.length > 0 && (\n\t\t\t\t\t\t\t\t\t\t<MessageBubble $role={message.role}>\n\t\t\t\t\t\t\t\t\t\t\t{message.role === 'assistant' ? (\n\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__html: renderMarkdownLite(message.content),\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t<div style={{ whiteSpace: 'pre-wrap' }}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{message.content}\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t</MessageBubble>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t{message.wasInterrupted && interruptedLabel && (\n\t\t\t\t\t\t\t\t\t\t<InterruptedNote>\n\t\t\t\t\t\t\t\t\t\t\t<StopIcon size={12} />\n\t\t\t\t\t\t\t\t\t\t\t{interruptedLabel}\n\t\t\t\t\t\t\t\t\t\t</InterruptedNote>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t{/* Only under a finished reply: mid-stream the text is still\n\t\t\t\t\t\t\t\t\t changing, so copying it would capture a partial answer. */}\n\t\t\t\t\t\t\t\t\t{message.role === 'assistant' &&\n\t\t\t\t\t\t\t\t\t\tmessage.content.length > 0 &&\n\t\t\t\t\t\t\t\t\t\t!message.isStreaming && (\n\t\t\t\t\t\t\t\t\t\t\t<MessageActions>\n\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => void handleCopyMessage(message)}\n\t\t\t\t\t\t\t\t\t\t\t\t\tdata-copied={copiedMessageId === message.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcopiedMessageId === message.id ? 'Copied' : 'Copy'\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t// The label changes with the state, so a screen reader\n\t\t\t\t\t\t\t\t\t\t\t\t\t// hears the confirmation the tick shows visually.\n\t\t\t\t\t\t\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcopiedMessageId === message.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'Response copied to clipboard'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'Copy response'\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{copiedMessageId === message.id ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<CheckIcon />\n\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<CopyIcon />\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t</MessageActions>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t{followUps && followUps.length > 0 && (\n\t\t\t\t\t\t\t\t<FollowUpList>\n\t\t\t\t\t\t\t\t\t{followUpsLabel && (\n\t\t\t\t\t\t\t\t\t\t<FollowUpsLabel>{followUpsLabel}</FollowUpsLabel>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t{followUps.map((followUp) => (\n\t\t\t\t\t\t\t\t\t\t<FollowUpChip\n\t\t\t\t\t\t\t\t\t\t\tkey={followUp}\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tdisabled={inputDisabled}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleFollowUpClick(followUp)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ArrowRightIcon />\n\t\t\t\t\t\t\t\t\t\t\t{followUp}\n\t\t\t\t\t\t\t\t\t\t</FollowUpChip>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</FollowUpList>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{isThinking && (\n\t\t\t\t\t\t\t\t<ThinkingBubble role=\"status\" aria-live=\"polite\">\n\t\t\t\t\t\t\t\t\t<AiStarsIcon\n\t\t\t\t\t\t\t\t\t\twidth={14}\n\t\t\t\t\t\t\t\t\t\theight={14}\n\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.brand}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{thinkingLabel && (\n\t\t\t\t\t\t\t\t\t\t<ThinkingLabel>{thinkingLabel}</ThinkingLabel>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<DotPulse color={COLORS.background.brand} size={5} />\n\t\t\t\t\t\t\t\t</ThinkingBubble>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<div ref={bottomRef} />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t</MessagesArea>\n\n\t\t\t\t<ScrollFade $visible={showScrollAffordance} aria-hidden=\"true\" />\n\t\t\t\t<JumpToLatestButton\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t$visible={showScrollAffordance}\n\t\t\t\t\tonClick={handleJumpToLatest}\n\t\t\t\t\ttabIndex={showScrollAffordance ? 0 : -1}\n\t\t\t\t\taria-label=\"Scroll to the latest message\"\n\t\t\t\t>\n\t\t\t\t\t<ChevronDownIcon />\n\t\t\t\t</JumpToLatestButton>\n\t\t\t</MessagesViewport>\n\n\t\t\t{errorMessage && <ErrorBanner role=\"alert\">{errorMessage}</ErrorBanner>}\n\n\t\t\t<InputArea>\n\t\t\t\t<InputWrapper $focused={isInputFocused}>\n\t\t\t\t\t<MessageInput\n\t\t\t\t\t\tref={inputRef}\n\t\t\t\t\t\trows={1}\n\t\t\t\t\t\tvalue={input}\n\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\tdisabled={inputDisabled}\n\t\t\t\t\t\tonChange={handleInputChange}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tonFocus={() => setIsInputFocused(true)}\n\t\t\t\t\t\tonBlur={() => setIsInputFocused(false)}\n\t\t\t\t\t/>\n\t\t\t\t\t<SendButton\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t$active={canStop || canSend}\n\t\t\t\t\t\tdisabled={!canStop && !canSend}\n\t\t\t\t\t\tonClick={canStop ? onStop : handleSend}\n\t\t\t\t\t\taria-label={canStop ? 'Stop generating' : 'Send message'}\n\t\t\t\t\t>\n\t\t\t\t\t\t{canStop ? <StopIcon /> : <SendArrowIcon />}\n\t\t\t\t\t</SendButton>\n\t\t\t\t</InputWrapper>\n\t\t\t</InputArea>\n\n\t\t\t{disclaimer && <Disclaimer>{disclaimer}</Disclaimer>}\n\t\t</PanelContainer>\n\t);\n};\n\nexport default CopilotPanel;\n"],"names":["MAX_INPUT_HEIGHT_PX","AT_BOTTOM_TOLERANCE_PX","COPIED_FEEDBACK_MS","writeToClipboard","text","textarea","copied","NEAR_TOP_TOLERANCE_PX","SendArrowIcon","jsxs","jsx","ArrowRightIcon","StopIcon","size","CopyIcon","CheckIcon","ChevronDownIcon","CopilotPanel","messages","onSend","onClose","title","badge","subtitle","avatar","placeholder","disclaimer","emptyStateTitle","emptyStateSubtitle","suggestions","onSuggestionClick","showRefresh","onRefresh","isThinking","thinkingLabel","isStreaming","onStop","interruptedLabel","followUpsLabel","hasMoreHistory","isLoadingHistory","onLoadOlderMessages","historyLoadingLabel","inputDisabled","errorMessage","width","height","className","style","input","setInput","useState","isInputFocused","setIsInputFocused","isAtLatest","setIsAtLatest","copiedMessageId","setCopiedMessageId","inputRef","useRef","copiedTimeoutRef","bottomRef","scrollerRef","lastScrollTopRef","anchorFromBottomRef","visibleMessages","message","isEmpty","isTurnInFlight","canSend","canStop","newestMessage","followUps","showScrollAffordance","useEffect","scroller","anchor","handleScroll","distanceFromBottom","scrolledUp","handleJumpToLatest","handleCopyMessage","handleSend","trimmed","handleInputChange","event","handleKeyDown","handleSuggestionClick","suggestion","handleFollowUpClick","followUp","PanelContainer","PanelHeader","HeaderAvatar","AiStarsIcon","HeaderText","HeaderTitleRow","TitleSmall","HeaderBadge","BodyCaption","COLORS","HeaderActions","IconAction","RefreshIcon","CrossIcon","MessagesViewport","MessagesArea","EmptyState","EmptyStateIcon","BodySecondary","SuggestionList","SuggestionChip","Fragment","HistoryLoader","DotPulse","React","MessageBubble","renderMarkdownLite","InterruptedNote","MessageActions","MessageAction","FollowUpList","FollowUpsLabel","FollowUpChip","ThinkingBubble","ThinkingLabel","ScrollFade","JumpToLatestButton","ErrorBanner","InputArea","InputWrapper","MessageInput","SendButton","Disclaimer"],"mappings":";;;;;;;;;;AA4CA,MAAMA,KAAsB,IAGtBC,KAAyB,IAGzBC,KAAqB,MASrBC,KAAmB,OAAOC,MAAmC;AAClE,MAAI;AACH,QAAI,UAAU,WAAW;AACxB,mBAAM,UAAU,UAAU,UAAUA,CAAI,GACjC;AAAA,EAET,QAAQ;AAAA,EAER;AAEA,MAAI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