@inkeep/agents-ui 0.14.11 → 0.14.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1225,8 +1225,20 @@ export declare const dataAttr: (guard: boolean | undefined) => Booleanish;
1225
1225
 
1226
1226
  declare type DataParts = {
1227
1227
  operation: {
1228
- type: 'error' | 'agent_thinking' | 'agent_ready' | 'agent_initializing' | 'completion'
1228
+ type:
1229
+ | 'error'
1230
+ | 'agent_initializing'
1231
+ | 'completion'
1232
+ | 'agent_generate'
1233
+ | 'agent_reasoning'
1234
+ | 'tool_execution'
1235
+ | 'transfer'
1236
+ | 'delegation_sent'
1237
+ | 'delegation_returned'
1238
+ | 'artifact_saved'
1229
1239
  ctx: Record<string, unknown>
1240
+ message?: string
1241
+ label?: string
1230
1242
  }
1231
1243
  summary: {
1232
1244
  type: string
@@ -4908,6 +4920,7 @@ declare const useInkeepChat: () => {
4908
4920
  isLoading: boolean;
4909
4921
  isStreaming: boolean;
4910
4922
  error: Error | null;
4923
+ setError: Dispatch<SetStateAction<Error | null>>;
4911
4924
  isSubmitDisabled: boolean;
4912
4925
  input: string;
4913
4926
  handleInputChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
package/dist/index.d.ts CHANGED
@@ -1225,8 +1225,20 @@ export declare const dataAttr: (guard: boolean | undefined) => Booleanish;
1225
1225
 
1226
1226
  declare type DataParts = {
1227
1227
  operation: {
1228
- type: 'error' | 'agent_thinking' | 'agent_ready' | 'agent_initializing' | 'completion'
1228
+ type:
1229
+ | 'error'
1230
+ | 'agent_initializing'
1231
+ | 'completion'
1232
+ | 'agent_generate'
1233
+ | 'agent_reasoning'
1234
+ | 'tool_execution'
1235
+ | 'transfer'
1236
+ | 'delegation_sent'
1237
+ | 'delegation_returned'
1238
+ | 'artifact_saved'
1229
1239
  ctx: Record<string, unknown>
1240
+ message?: string
1241
+ label?: string
1230
1242
  }
1231
1243
  summary: {
1232
1244
  type: string
@@ -4908,6 +4920,7 @@ declare const useInkeepChat: () => {
4908
4920
  isLoading: boolean;
4909
4921
  isStreaming: boolean;
4910
4922
  error: Error | null;
4923
+ setError: Dispatch<SetStateAction<Error | null>>;
4911
4924
  isSubmitDisabled: boolean;
4912
4925
  input: string;
4913
4926
  handleInputChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
@@ -1,3 +1,3 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("@ai-sdk/react"),X=require("ai"),t=require("react"),Y=require("../../providers/config-provider.cjs"),Z=require("../../hooks/use-media-query.cjs"),ee=require("../../utils/generate-uid.cjs"),te=require("../../providers/base-events-provider.cjs"),se=require("../../providers/chat-form-provider.cjs"),ne=require("../../providers/widget-provider.cjs"),re=require("@radix-ui/react-use-controllable-state"),ae=require("../../hooks/use-streaming-events.cjs"),oe=()=>{const{baseSettings:h,aiChatSettings:o}=Y.useInkeepConfig(),[n="",f]=re.useControllableState({prop:o.conversationId,defaultProp:o.conversationId??""}),{logEvent:i}=te.useBaseEvents(),{setConversationId:_,emitStreamError:k}=ae.useStreamingEvents(),[a,u]=t.useState(""),F=e=>u(e.target.value),{filters:v}=h,{onInputMessageChange:P,filters:S,graphUrl:x,context:N,headers:D,apiKey:C}=o,A=e=>{switch(e.code){case 400:return e.message;case 403:return`There seems to be a configuration error. Please contact ${h.organizationDisplayName??"Administrator"}`;default:return`Hmm..
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("@ai-sdk/react"),Y=require("ai"),t=require("react"),Z=require("../../providers/config-provider.cjs"),ee=require("../../hooks/use-media-query.cjs"),te=require("../../utils/generate-uid.cjs"),se=require("../../providers/base-events-provider.cjs"),ne=require("../../providers/chat-form-provider.cjs"),re=require("../../providers/widget-provider.cjs"),ae=require("@radix-ui/react-use-controllable-state"),oe=require("../../hooks/use-streaming-events.cjs"),q=`Hmm..
2
2
 
3
- It seems I might be having some issues right now. Please clear the chat and try again.`}},[B,R]=t.useState({}),[U,l]=t.useState([]),[K,I]=t.useState(null),{messages:g,sendMessage:T,status:b,setMessages:y,stop:W,error:d}=G.useChat({transport:new X.DefaultChatTransport({api:x,headers:{...C?{Authorization:`Bearer ${C}`}:{},...D},body:{requestContext:N}}),async onFinish(){await i({eventName:"assistant_message_received",properties:{conversationId:n}}),i({eventName:"assistant_answer_displayed",properties:{conversationId:n}})},onError(e){console.log("onError",e.message),k(e.message,void 0,e.code?.toString()),y(c=>{const r=[...c],s=r[r.length-1];return s&&(s.parts=[{type:"text",text:A(e)}]),r})}}),E=b==="submitted",$=b==="streaming",z=g.length===0,m=!a.trim()||E,H=Z.useMediaQuery("(max-width: 768px)"),[O,w]=t.useState(null);t.useEffect(()=>{d&&w(d)},[d]);const Q=()=>w(null),M=t.useRef(null);t.useEffect(()=>{P?.(a)},[a]);const j=e=>{e.key==="Enter"&&!e.shiftKey&&!m&&!e.nativeEvent.isComposing&&(e.preventDefault(),p())},p=async(e=a)=>{if(m&&(!e||e.trim().length===0))return;l([]),u(""),await i({eventName:"user_message_submitted",properties:{conversationId:n}});const c=v||S?JSON.stringify({...v,...S}):void 0,r={};c&&(r["inkeep-filters"]=c);let s=n;s||(s=`conv_${ee.generateUid(16)}`,f(s)),_(s),T({text:e},{headers:r,body:{conversationId:s}})},J=()=>{W()},q=()=>{Q(),y([]),f(""),R({}),l([]),I(null),i({eventName:"chat_clear_button_clicked",properties:{conversationId:n}})},{openForm:L}=se.useChatForm(),V=ne.useWidget();return t.useImperativeHandle(o.chatFunctionsRef,()=>({submitMessage:p,updateInputMessage(e){u(e)},clearChat:q,openForm:e=>{V?.setView("chat"),L(e,void 0)},focusInput:()=>{M.current?.focus()}})),{messages:g,isLoading:E,isStreaming:$,error:O,isSubmitDisabled:m,input:a,handleInputChange:F,handleInputKeyDown:j,handleSubmit:p,stop:J,clear:q,messageButtons:B,isEmpty:g.length===0,inputRef:M,isMobile:H,messageAttachments:U,setMessageAttachments:l,selectedWorkflow:K,setSelectedWorkflow:I,isNewChat:z,conversationId:n}};exports.useInkeepChat=oe;
3
+ It seems I might be having some issues right now. Please clear the chat and try again.`,ie=()=>{const{baseSettings:f,aiChatSettings:o}=Z.useInkeepConfig(),[n="",v]=ae.useControllableState({prop:o.conversationId,defaultProp:o.conversationId??""}),{logEvent:i}=se.useBaseEvents(),{setConversationId:F,emitStreamError:R}=oe.useStreamingEvents(),[a,u]=t.useState(""),k=e=>u(e.target.value),{filters:S}=f,{onInputMessageChange:A,filters:E,agentUrl:P,context:x,headers:D,apiKey:C}=o,N=e=>{switch(e.code){case 400:return e.message;case 403:return`There seems to be a configuration error. Please contact ${f.organizationDisplayName??"Administrator"}`;default:return q}},[U,T]=t.useState({}),[B,l]=t.useState([]),[O,I]=t.useState(null),{messages:g,sendMessage:K,status:b,setMessages:y,stop:L,error:d}=X.useChat({transport:new Y.DefaultChatTransport({api:P,headers:{...C?{Authorization:`Bearer ${C}`}:{},...D},body:{requestContext:x}}),async onFinish(){await i({eventName:"assistant_message_received",properties:{conversationId:n}}),i({eventName:"assistant_answer_displayed",properties:{conversationId:n}})},onError(e){console.log("onError",e.message),R(e.message,void 0,e.code?.toString()),y(c=>{const r=[...c],s=r[r.length-1];return s&&(s.parts=[{type:"text",text:N(e)}]),r})}}),w=b==="submitted",W=b==="streaming",$=g.length===0,m=!a.trim()||w,z=ee.useMediaQuery("(max-width: 768px)"),[G,p]=t.useState(null);t.useEffect(()=>{d&&p(d)},[d]);const H=()=>p(null),M=t.useRef(null);t.useEffect(()=>{A?.(a)},[a]);const Q=e=>{e.key==="Enter"&&!e.shiftKey&&!m&&!e.nativeEvent.isComposing&&(e.preventDefault(),h())},h=async(e=a)=>{if(m&&(!e||e.trim().length===0))return;l([]),u(""),await i({eventName:"user_message_submitted",properties:{conversationId:n}});const c=S||E?JSON.stringify({...S,...E}):void 0,r={};c&&(r["inkeep-filters"]=c);let s=n;s||(s=`conv_${te.generateUid(16)}`,v(s)),F(s),K({text:e},{headers:r,body:{conversationId:s}})},j=()=>{L()},_=()=>{H(),y([]),v(""),T({}),l([]),I(null),i({eventName:"chat_clear_button_clicked",properties:{conversationId:n}})},{openForm:J}=ne.useChatForm(),V=re.useWidget();return t.useImperativeHandle(o.chatFunctionsRef,()=>({submitMessage:h,updateInputMessage(e){u(e)},clearChat:_,openForm:e=>{V?.setView("chat"),J(e,void 0)},focusInput:()=>{M.current?.focus()}})),{messages:g,isLoading:w,isStreaming:W,error:G,setError:p,isSubmitDisabled:m,input:a,handleInputChange:k,handleInputKeyDown:Q,handleSubmit:h,stop:j,clear:_,messageButtons:U,isEmpty:g.length===0,inputRef:M,isMobile:z,messageAttachments:B,setMessageAttachments:l,selectedWorkflow:O,setSelectedWorkflow:I,isNewChat:$,conversationId:n}};exports.DEFAULT_ERROR_MESSAGE=q;exports.useInkeepChat=ie;
@@ -10,47 +10,47 @@ import { useChatForm as re } from "../../providers/chat-form-provider.js";
10
10
  import { useWidget as ae } from "../../providers/widget-provider.js";
11
11
  import { useControllableState as ie } from "@radix-ui/react-use-controllable-state";
12
12
  import { useStreamingEvents as ce } from "../../hooks/use-streaming-events.js";
13
- const be = () => {
14
- const { baseSettings: h, aiChatSettings: a } = te(), [s = "", f] = ie({
13
+ const me = `Hmm..
14
+
15
+ It seems I might be having some issues right now. Please clear the chat and try again.`, Se = () => {
16
+ const { baseSettings: f, aiChatSettings: a } = te(), [s = "", v] = ie({
15
17
  prop: a.conversationId,
16
18
  defaultProp: a.conversationId ?? ""
17
- }), { logEvent: i } = oe(), { setConversationId: k, emitStreamError: F } = ce(), [o, m] = r(""), N = (e) => m(e.target.value), {
19
+ }), { logEvent: i } = oe(), { setConversationId: F, emitStreamError: k } = ce(), [o, m] = r(""), N = (e) => m(e.target.value), {
18
20
  /* shouldBypassCaptcha, */
19
- filters: v
20
- } = h, {
21
- onInputMessageChange: D,
22
- filters: I,
23
- graphUrl: A,
24
- context: B,
25
- headers: K,
26
- apiKey: C
27
- } = a, P = (e) => {
21
+ filters: I
22
+ } = f, {
23
+ onInputMessageChange: A,
24
+ filters: C,
25
+ agentUrl: D,
26
+ context: R,
27
+ headers: B,
28
+ apiKey: E
29
+ } = a, K = (e) => {
28
30
  switch (e.code) {
29
31
  case 400:
30
32
  return e.message;
31
33
  case 403:
32
- return `There seems to be a configuration error. Please contact ${h.organizationDisplayName ?? "Administrator"}`;
34
+ return `There seems to be a configuration error. Please contact ${f.organizationDisplayName ?? "Administrator"}`;
33
35
  default:
34
- return `Hmm..
35
-
36
- It seems I might be having some issues right now. Please clear the chat and try again.`;
36
+ return me;
37
37
  }
38
- }, [R, W] = r({}), [$, u] = r([]), [z, b] = r(null), {
38
+ }, [P, T] = r({}), [U, u] = r([]), [W, S] = r(null), {
39
39
  messages: l,
40
- sendMessage: H,
41
- status: y,
42
- setMessages: w,
43
- stop: T,
40
+ sendMessage: $,
41
+ status: b,
42
+ setMessages: y,
43
+ stop: z,
44
44
  error: p
45
45
  } = X({
46
46
  transport: new Y({
47
- api: A,
47
+ api: D,
48
48
  headers: {
49
- ...C ? { Authorization: `Bearer ${C}` } : {},
50
- ...K
49
+ ...E ? { Authorization: `Bearer ${E}` } : {},
50
+ ...B
51
51
  },
52
52
  body: {
53
- requestContext: B
53
+ requestContext: R
54
54
  }
55
55
  }),
56
56
  async onFinish() {
@@ -67,22 +67,22 @@ It seems I might be having some issues right now. Please clear the chat and try
67
67
  });
68
68
  },
69
69
  onError(e) {
70
- console.log("onError", e.message), F(e.message, void 0, e.code?.toString()), w((c) => {
70
+ console.log("onError", e.message), k(e.message, void 0, e.code?.toString()), y((c) => {
71
71
  const n = [...c], t = n[n.length - 1];
72
- return t && (t.parts = [{ type: "text", text: P(e) }]), n;
72
+ return t && (t.parts = [{ type: "text", text: K(e) }]), n;
73
73
  });
74
74
  }
75
- }), E = y === "submitted", U = y === "streaming", q = l.length === 0, g = !o.trim() || E, J = se("(max-width: 768px)"), [L, S] = r(null);
75
+ }), w = b === "submitted", H = b === "streaming", L = l.length === 0, g = !o.trim() || w, O = se("(max-width: 768px)"), [q, d] = r(null);
76
76
  x(() => {
77
- p && S(p);
77
+ p && d(p);
78
78
  }, [p]);
79
- const O = () => S(null), M = Z(null);
79
+ const G = () => d(null), M = Z(null);
80
80
  x(() => {
81
- D?.(o);
81
+ A?.(o);
82
82
  }, [o]);
83
- const Q = (e) => {
84
- e.key === "Enter" && !e.shiftKey && !g && !e.nativeEvent.isComposing && (e.preventDefault(), d());
85
- }, d = async (e = o) => {
83
+ const J = (e) => {
84
+ e.key === "Enter" && !e.shiftKey && !g && !e.nativeEvent.isComposing && (e.preventDefault(), h());
85
+ }, h = async (e = o) => {
86
86
  if (g && (!e || e.trim().length === 0)) return;
87
87
  u([]), m(""), await i({
88
88
  eventName: "user_message_submitted",
@@ -90,13 +90,13 @@ It seems I might be having some issues right now. Please clear the chat and try
90
90
  conversationId: s
91
91
  }
92
92
  });
93
- const c = v || I ? JSON.stringify({
94
- ...v,
95
- ...I
93
+ const c = I || C ? JSON.stringify({
94
+ ...I,
95
+ ...C
96
96
  }) : void 0, n = {};
97
97
  c && (n["inkeep-filters"] = c);
98
98
  let t = s;
99
- t || (t = `conv_${ne(16)}`, f(t)), k(t), H(
99
+ t || (t = `conv_${ne(16)}`, v(t)), F(t), $(
100
100
  // { ...userMessage, files },
101
101
  // { ...userMessage, },
102
102
  {
@@ -109,53 +109,55 @@ It seems I might be having some issues right now. Please clear the chat and try
109
109
  }
110
110
  }
111
111
  );
112
- }, V = () => {
113
- T();
112
+ }, Q = () => {
113
+ z();
114
114
  }, _ = () => {
115
- O(), w([]), f(""), W({}), u([]), b(null), i({
115
+ G(), y([]), v(""), T({}), u([]), S(null), i({
116
116
  eventName: "chat_clear_button_clicked",
117
117
  properties: {
118
118
  conversationId: s
119
119
  }
120
120
  });
121
- }, { openForm: j } = re(), G = ae();
121
+ }, { openForm: V } = re(), j = ae();
122
122
  return ee(a.chatFunctionsRef, () => ({
123
- submitMessage: d,
123
+ submitMessage: h,
124
124
  updateInputMessage(e) {
125
125
  m(e);
126
126
  },
127
127
  clearChat: _,
128
128
  openForm: (e) => {
129
- G?.setView("chat"), j(e, void 0);
129
+ j?.setView("chat"), V(e, void 0);
130
130
  },
131
131
  focusInput: () => {
132
132
  M.current?.focus();
133
133
  }
134
134
  })), {
135
135
  messages: l,
136
- isLoading: E,
137
- isStreaming: U,
138
- error: L,
136
+ isLoading: w,
137
+ isStreaming: H,
138
+ error: q,
139
+ setError: d,
139
140
  isSubmitDisabled: g,
140
141
  input: o,
141
142
  handleInputChange: N,
142
- handleInputKeyDown: Q,
143
- handleSubmit: d,
144
- stop: V,
143
+ handleInputKeyDown: J,
144
+ handleSubmit: h,
145
+ stop: Q,
145
146
  clear: _,
146
- messageButtons: R,
147
+ messageButtons: P,
147
148
  isEmpty: l.length === 0,
148
149
  inputRef: M,
149
- isMobile: J,
150
+ isMobile: O,
150
151
  // Additional state for attachments and workflow
151
- messageAttachments: $,
152
+ messageAttachments: U,
152
153
  setMessageAttachments: u,
153
- selectedWorkflow: z,
154
- setSelectedWorkflow: b,
155
- isNewChat: q,
154
+ selectedWorkflow: W,
155
+ setSelectedWorkflow: S,
156
+ isNewChat: L,
156
157
  conversationId: s
157
158
  };
158
159
  };
159
160
  export {
160
- be as useInkeepChat
161
+ me as DEFAULT_ERROR_MESSAGE,
162
+ Se as useInkeepChat
161
163
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),b=require("../../../types/message.cjs"),L=require("../../hooks/use-streaming-events.cjs");function E(r,c){const[u,A]=a.useState([]),[p,D]=a.useState(new Map),[d,P]=a.useState(Date.now()),[R,g]=a.useState(!1),h=a.useRef(0),y=a.useRef(0),w=a.useRef([]),l=a.useRef(p);l.current=p;const{emitArtifactSaved:S,emitCompletion:x,emitAgentInitializing:k,emitTextDelta:C}=L.useStreamingEvents(),T=a.useCallback(()=>{const n=[];let e="",o=[];r.length>h.current&&(P(Date.now()),h.current=r.length),y.current=0;const i=new Map,m=(t=!1)=>{if(o.length>0){const s=`group-${y.current++}`,f=l.current.get(s);f?i.set(s,{...f,isCompleted:t}):i.set(s,{isCompleted:t}),n.push({type:"summary-group",summaries:[...o],groupKey:s}),o=[]}};for(const t of r)if(t.type==="text")m(!0),t.text&&c&&C(t.text),e+=t.text||"";else if(t.type==="data-summary")e.trim()&&(n.push({type:"text",text:e}),e=""),o.push(t.data);else if(t.type==="data-operation"){const s=t.data;if(s?.type)switch(s.type){case"completion":x("unknown",1),m(!0);break;case"agent_initializing":k("unknown","unknown");break;case"error":console.warn("Data operation error:",s.ctx);break;case"agent_thinking":case"agent_ready":console.log("Agent state:",s.type,s.ctx);break}}else if(t.type==="data-artifact")if(t.data?.type?.toLowerCase()===b.CITATION_ARTIFACT_TYPE){const s=t.data,f=s.artifactSummary||{title:s.name};e+=` ^${f?.title||s.name}^`}else e.trim()&&(n.push({type:"text",text:e}),e=""),n.push(t),t.data&&S(t.data.artifactId||"unknown",t.data.taskId||"unknown","unknown",t.data.artifactType||"unknown",t.data.artifactSummary||{},{},{name:t.data.name,description:t.data.description});else t.type==="data-component"&&(e.trim()&&(n.push({type:"text",text:e}),e=""),n.push(t));return m(!c),e.trim()&&n.push({type:"text",text:e}),{processed:n,newTimings:i}},[r,c,S,x,k,C]);a.useEffect(()=>{if(w.current===r)return;w.current=r;const{processed:n,newTimings:e}=T();A(n),(e.size!==l.current.size||Array.from(e.entries()).some(([i,m])=>{const t=l.current.get(i);return!t||t.isCompleted!==m.isCompleted}))&&D(e)},[T,r]);const v=a.useCallback(()=>{const n=Date.now()-d,e=Array.from(l.current.values()).some(i=>!i.isCompleted),o=n>1e3&&!e;g(o)},[d]);a.useEffect(()=>{if(!c){g(!1);return}if(!(u.length>0)){g(!1);return}const e=setInterval(v,200);return()=>clearInterval(e)},[c,v,u.length]);const I=a.useMemo(()=>!(u.length>0),[u.length]);return{processedParts:u,summaryTimings:p,shouldShowInitialLoading:I,shouldShowStreamDelayLoading:R}}exports.useStreamProcessor=E;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),M=require("./use-inkeep-chat.cjs"),_=require("../../hooks/use-streaming-events.cjs"),q=require("../../../types/message.cjs");function z(u,l,g){const[m,D]=r.useState([]),[d,E]=r.useState(new Map),[y,I]=r.useState(Date.now()),[P,h]=r.useState(!1),w=r.useRef(0),S=r.useRef(0),x=r.useRef([]),f=r.useRef(d);f.current=d;const{emitArtifactSaved:k,emitCompletion:C,emitAgentInitializing:T,emitTextDelta:A}=_.useStreamingEvents(),R=r.useCallback(()=>{const n=[];let e="",o=[],c=!1;u.length>w.current&&(I(Date.now()),w.current=u.length),S.current=0;const p=new Map,i=(t=!1)=>{if(o.length>0){const s=`group-${S.current++}`,a=f.current.get(s);a?p.set(s,{...a,isCompleted:t}):p.set(s,{isCompleted:t}),n.push({type:"summary-group",summaries:[...o],groupKey:s}),o=[]}};for(const t of u)if(t.type==="text")i(!0),t.text&&l&&A(t.text),e+=t.text||"";else if(t.type==="data-summary")e.trim()&&(n.push({type:"text",text:e}),e=""),o.push(t.data);else if(t.type==="data-operation"){e.trim()&&(n.push({type:"text",text:e}),e="");const s=t.data;if(s?.type)switch(s.type){case"completion":C("unknown",1),i(!0);break;case"agent_initializing":T("unknown","unknown");break;case"error":{i(!0);const a=s.message||"Unknown error";console.warn("Data operation error:",a),g(new Error(a)),c||(n.push({type:"text",text:M.DEFAULT_ERROR_MESSAGE}),c=!0);break}default:{const{type:a,label:L}=s;o.push({type:a,label:L});break}}}else if(t.type==="data-artifact")if(t.data?.type?.toLowerCase()===q.CITATION_ARTIFACT_TYPE){const s=t.data,a=s.artifactSummary||{title:s.name};e+=` ^${a?.title||s.name}^`}else e.trim()&&(n.push({type:"text",text:e}),e=""),n.push(t),t.data&&k(t.data.artifactId||"unknown",t.data.taskId||"unknown","unknown",t.data.artifactType||"unknown",t.data.artifactSummary||{},{},{name:t.data.name,description:t.data.description});else t.type==="data-component"&&(e.trim()&&(n.push({type:"text",text:e}),e=""),i(!0),n.push(t));return i(!l),e.trim()&&n.push({type:"text",text:e}),{processed:n,newTimings:p}},[u,l,k,C,T,A,g]);r.useEffect(()=>{if(x.current===u)return;x.current=u;const{processed:n,newTimings:e}=R();D(n),(e.size!==f.current.size||Array.from(e.entries()).some(([c,p])=>{const i=f.current.get(c);return!i||i.isCompleted!==p.isCompleted}))&&E(e)},[R,u]);const v=r.useCallback(()=>{const n=Date.now()-y,e=Array.from(f.current.values()).some(c=>!c.isCompleted),o=n>1e3&&!e;h(o)},[y]);r.useEffect(()=>{if(!l){h(!1);return}if(!(m.length>0)){h(!1);return}const e=setInterval(v,200);return()=>clearInterval(e)},[l,v,m.length]);const b=r.useMemo(()=>!(m.length>0),[m.length]);return{processedParts:m,summaryTimings:d,shouldShowInitialLoading:b,shouldShowStreamDelayLoading:P}}exports.useStreamProcessor=z;
@@ -1,121 +1,135 @@
1
1
  "use client";
2
- import { useState as f, useRef as p, useCallback as D, useEffect as I, useMemo as z } from "react";
3
- import { CITATION_ARTIFACT_TYPE as E } from "../../../types/message.js";
4
- import { useStreamingEvents as M } from "../../hooks/use-streaming-events.js";
5
- function $(r, i) {
6
- const [c, P] = f([]), [d, L] = f(/* @__PURE__ */ new Map()), [g, R] = f(Date.now()), [b, h] = f(!1), y = p(0), w = p(0), x = p([]), u = p(d);
7
- u.current = d;
8
- const { emitArtifactSaved: k, emitCompletion: C, emitAgentInitializing: T, emitTextDelta: S } = M(), A = D(() => {
2
+ import { useState as p, useRef as d, useCallback as R, useEffect as E, useMemo as F } from "react";
3
+ import { DEFAULT_ERROR_MESSAGE as G } from "./use-inkeep-chat.js";
4
+ import { useStreamingEvents as O } from "../../hooks/use-streaming-events.js";
5
+ import { CITATION_ARTIFACT_TYPE as U } from "../../../types/message.js";
6
+ function j(i, u, g) {
7
+ const [m, L] = p([]), [h, P] = p(/* @__PURE__ */ new Map()), [w, b] = p(Date.now()), [M, y] = p(!1), x = d(0), k = d(0), S = d([]), f = d(h);
8
+ f.current = h;
9
+ const { emitArtifactSaved: T, emitCompletion: C, emitAgentInitializing: A, emitTextDelta: D } = O(), v = R(() => {
9
10
  const n = [];
10
- let e = "", s = [];
11
- r.length > y.current && (R(Date.now()), y.current = r.length), w.current = 0;
12
- const o = /* @__PURE__ */ new Map(), m = (t = !1) => {
11
+ let t = "", s = [], c = !1;
12
+ i.length > x.current && (b(Date.now()), x.current = i.length), k.current = 0;
13
+ const l = /* @__PURE__ */ new Map(), o = (e = !1) => {
13
14
  if (s.length > 0) {
14
- const a = `group-${w.current++}`, l = u.current.get(a);
15
- l ? o.set(a, {
16
- ...l,
17
- isCompleted: t
18
- }) : o.set(a, {
19
- isCompleted: t
15
+ const r = `group-${k.current++}`, a = f.current.get(r);
16
+ a ? l.set(r, {
17
+ ...a,
18
+ isCompleted: e
19
+ }) : l.set(r, {
20
+ isCompleted: e
20
21
  }), n.push({
21
22
  type: "summary-group",
22
23
  summaries: [...s],
23
- groupKey: a
24
+ groupKey: r
24
25
  }), s = [];
25
26
  }
26
27
  };
27
- for (const t of r)
28
- if (t.type === "text")
29
- m(!0), t.text && i && S(t.text), e += t.text || "";
30
- else if (t.type === "data-summary")
31
- e.trim() && (n.push({ type: "text", text: e }), e = ""), s.push(t.data);
32
- else if (t.type === "data-operation") {
33
- const a = t.data;
34
- if (a?.type)
35
- switch (a.type) {
28
+ for (const e of i)
29
+ if (e.type === "text")
30
+ o(!0), e.text && u && D(e.text), t += e.text || "";
31
+ else if (e.type === "data-summary")
32
+ t.trim() && (n.push({ type: "text", text: t }), t = ""), s.push(e.data);
33
+ else if (e.type === "data-operation") {
34
+ t.trim() && (n.push({ type: "text", text: t }), t = "");
35
+ const r = e.data;
36
+ if (r?.type)
37
+ switch (r.type) {
36
38
  case "completion":
37
39
  C(
38
40
  "unknown",
39
41
  // No agent ID available in current structure
40
42
  1
41
43
  // No iteration available in current structure
42
- ), m(!0);
44
+ ), o(!0);
43
45
  break;
44
46
  case "agent_initializing":
45
- T(
47
+ A(
46
48
  "unknown",
47
49
  // No session ID available in current structure
48
50
  "unknown"
49
51
  // No graph ID available in current structure
50
52
  );
51
53
  break;
52
- case "error":
53
- console.warn("Data operation error:", a.ctx);
54
+ case "error": {
55
+ o(!0);
56
+ const a = r.message || "Unknown error";
57
+ console.warn("Data operation error:", a), g(new Error(a)), c || (n.push({ type: "text", text: G }), c = !0);
54
58
  break;
55
- case "agent_thinking":
56
- case "agent_ready":
57
- console.log("Agent state:", a.type, a.ctx);
59
+ }
60
+ default: {
61
+ const { type: a, label: z } = r;
62
+ s.push({ type: a, label: z });
58
63
  break;
64
+ }
59
65
  }
60
- } else if (t.type === "data-artifact")
61
- if (t.data?.type?.toLowerCase() === E) {
62
- const a = t.data, l = a.artifactSummary || {
63
- title: a.name
66
+ } else if (e.type === "data-artifact")
67
+ if (e.data?.type?.toLowerCase() === U) {
68
+ const r = e.data, a = r.artifactSummary || {
69
+ title: r.name
64
70
  };
65
- e += ` ^${l?.title || a.name}^`;
71
+ t += ` ^${a?.title || r.name}^`;
66
72
  } else
67
- e.trim() && (n.push({ type: "text", text: e }), e = ""), n.push(t), t.data && k(
68
- t.data.artifactId || "unknown",
69
- t.data.taskId || "unknown",
73
+ t.trim() && (n.push({ type: "text", text: t }), t = ""), n.push(e), e.data && T(
74
+ e.data.artifactId || "unknown",
75
+ e.data.taskId || "unknown",
70
76
  "unknown",
71
77
  // toolCallId not available in current structure
72
- t.data.artifactType || "unknown",
73
- t.data.artifactSummary || {},
78
+ e.data.artifactType || "unknown",
79
+ e.data.artifactSummary || {},
74
80
  // Use artifactSummary as summaryData
75
81
  {},
76
82
  // fullData not available in current structure
77
- { name: t.data.name, description: t.data.description }
83
+ { name: e.data.name, description: e.data.description }
78
84
  // Use available fields as metadata
79
85
  );
80
- else t.type === "data-component" && (e.trim() && (n.push({ type: "text", text: e }), e = ""), n.push(t));
81
- return m(!i), e.trim() && n.push({ type: "text", text: e }), { processed: n, newTimings: o };
82
- }, [r, i, k, C, T, S]);
83
- I(() => {
84
- if (x.current === r)
86
+ else e.type === "data-component" && (t.trim() && (n.push({ type: "text", text: t }), t = ""), o(!0), n.push(e));
87
+ return o(!u), t.trim() && n.push({ type: "text", text: t }), { processed: n, newTimings: l };
88
+ }, [
89
+ i,
90
+ u,
91
+ T,
92
+ C,
93
+ A,
94
+ D,
95
+ g
96
+ ]);
97
+ E(() => {
98
+ if (S.current === i)
85
99
  return;
86
- x.current = r;
87
- const { processed: n, newTimings: e } = A();
88
- P(n), (e.size !== u.current.size || Array.from(e.entries()).some(([o, m]) => {
89
- const t = u.current.get(o);
90
- return !t || t.isCompleted !== m.isCompleted;
91
- })) && L(e);
92
- }, [A, r]);
93
- const v = D(() => {
94
- const n = Date.now() - g, e = Array.from(u.current.values()).some(
95
- (o) => !o.isCompleted
96
- ), s = n > 1e3 && !e;
97
- h(s);
98
- }, [g]);
99
- I(() => {
100
- if (!i) {
101
- h(!1);
100
+ S.current = i;
101
+ const { processed: n, newTimings: t } = v();
102
+ L(n), (t.size !== f.current.size || Array.from(t.entries()).some(([c, l]) => {
103
+ const o = f.current.get(c);
104
+ return !o || o.isCompleted !== l.isCompleted;
105
+ })) && P(t);
106
+ }, [v, i]);
107
+ const I = R(() => {
108
+ const n = Date.now() - w, t = Array.from(f.current.values()).some(
109
+ (c) => !c.isCompleted
110
+ ), s = n > 1e3 && !t;
111
+ y(s);
112
+ }, [w]);
113
+ E(() => {
114
+ if (!u) {
115
+ y(!1);
102
116
  return;
103
117
  }
104
- if (!(c.length > 0)) {
105
- h(!1);
118
+ if (!(m.length > 0)) {
119
+ y(!1);
106
120
  return;
107
121
  }
108
- const e = setInterval(v, 200);
109
- return () => clearInterval(e);
110
- }, [i, v, c.length]);
111
- const _ = z(() => !(c.length > 0), [c.length]);
122
+ const t = setInterval(I, 200);
123
+ return () => clearInterval(t);
124
+ }, [u, I, m.length]);
125
+ const _ = F(() => !(m.length > 0), [m.length]);
112
126
  return {
113
- processedParts: c,
114
- summaryTimings: d,
127
+ processedParts: m,
128
+ summaryTimings: h,
115
129
  shouldShowInitialLoading: _,
116
- shouldShowStreamDelayLoading: b
130
+ shouldShowStreamDelayLoading: M
117
131
  };
118
132
  }
119
133
  export {
120
- $ as useStreamProcessor
134
+ j as useStreamProcessor
121
135
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),T=require("../../atoms/cmdk/index.cjs"),C=require("../../providers/search-events-provider.cjs"),E=require("../../providers/config-provider.cjs"),_=require("./search-provider.cjs"),k=400,P=()=>{const{setResultsList:t,setLoading:n,showSearchResults:i,setShowSearchResults:h}=_.useSearch(),{searchSettings:p}=E.useInkeepConfig(),{debounceTimeMs:b,onQueryChange:w,onSearch:f}=p,{logEvent:u}=C.useSearchEvents(),a=r.useRef({}),S=r.useRef(null),d=r.useRef(null),v=r.useCallback(async e=>{if(!f){console.warn("No search implementation provided. Please provide onSearch callback in searchSettings."),t([]);return}const s=new AbortController;S.current=s;try{n(!0);const o=await f(e,s.signal);a.current[e]=o,t(o)}catch(o){if(o.name==="AbortError")return;console.error("Search implementation failed:",o),t([])}finally{n(!1)}},[f,n,t]),R=r.useCallback(e=>{const s=a.current[e];u({eventName:"search_query_response_received",properties:{searchQuery:e,totalResults:s?.length}})},[u]),m=r.useCallback(()=>{S.current&&(S.current.abort(),n(!1))},[n]),g=r.useCallback(e=>{if(d.current&&window.clearTimeout(d.current),!e){m(),t([]);return}d.current=window.setTimeout(()=>{m(),u({eventName:"search_query_submitted",properties:{searchQuery:e}}),a.current[e]?(t(a.current[e]),R(e)):v(e).then(()=>{R(e)})},b)},[b,v,R,m,u,t]),c=T.useCommandState(e=>e.search),l=r.useRef(null);r.useEffect(()=>{const e=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},s=!!c;return s&&!i?(e(),l.current=window.setTimeout(()=>{h(!0)},k)):!s&&i&&(e(),h(!1)),e},[c,i,h]),r.useEffect(()=>{w?.(c),g(c)},[g,c,w])};exports.useSearchFetch=P;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),T=require("../../atoms/cmdk/index.cjs"),C=require("../../providers/search-events-provider.cjs"),E=require("../../providers/config-provider.cjs"),_=require("./search-provider.cjs"),k=250,P=()=>{const{setResultsList:t,setLoading:n,showSearchResults:i,setShowSearchResults:h}=_.useSearch(),{searchSettings:p}=E.useInkeepConfig(),{debounceTimeMs:b,onQueryChange:w,onSearch:f}=p,{logEvent:u}=C.useSearchEvents(),a=r.useRef({}),S=r.useRef(null),d=r.useRef(null),v=r.useCallback(async e=>{if(!f){console.warn("No search implementation provided. Please provide onSearch callback in searchSettings."),t([]);return}const s=new AbortController;S.current=s;try{n(!0);const o=await f(e,s.signal);a.current[e]=o,t(o)}catch(o){if(o.name==="AbortError")return;console.error("Search implementation failed:",o),t([])}finally{n(!1)}},[f,n,t]),R=r.useCallback(e=>{const s=a.current[e];u({eventName:"search_query_response_received",properties:{searchQuery:e,totalResults:s?.length}})},[u]),m=r.useCallback(()=>{S.current&&(S.current.abort(),n(!1))},[n]),g=r.useCallback(e=>{if(d.current&&window.clearTimeout(d.current),!e){m(),t([]);return}d.current=window.setTimeout(()=>{m(),u({eventName:"search_query_submitted",properties:{searchQuery:e}}),a.current[e]?(t(a.current[e]),R(e)):v(e).then(()=>{R(e)})},b)},[b,v,R,m,u,t]),c=T.useCommandState(e=>e.search),l=r.useRef(null);r.useEffect(()=>{const e=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},s=!!c;return s&&!i?(e(),l.current=window.setTimeout(()=>{h(!0)},k)):!s&&i&&(e(),h(!1)),e},[c,i,h]),r.useEffect(()=>{w?.(c),g(c)},[g,c,w])};exports.useSearchFetch=P;
@@ -4,7 +4,7 @@ import { useCommandState as _ } from "../../atoms/cmdk/index.js";
4
4
  import { useSearchEvents as E } from "../../providers/search-events-provider.js";
5
5
  import { useInkeepConfig as k } from "../../providers/config-provider.js";
6
6
  import { useSearch as L } from "./search-provider.js";
7
- const A = 400, O = () => {
7
+ const A = 250, O = () => {
8
8
  const { setResultsList: t, setLoading: s, showSearchResults: h, setShowSearchResults: m } = L(), { searchSettings: C } = k(), { debounceTimeMs: w, onQueryChange: T, onSearch: f } = C, { logEvent: c } = E(), a = u({}), S = u(null), d = u(null), b = i(
9
9
  async (e) => {
10
10
  if (!f) {
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.14.10",componentType:n,tags:o}),[n,o]),u={logEvent:t.useCallback(async c=>{const v={...i,...c.properties,...r},d={eventName:c.eventName,properties:v};return s.onEvent?.(d)},[s,i,r])};return E.jsx(a.Provider,{value:u,children:e})},g=()=>{const e=t.useContext(a);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=p;exports.useBaseEvents=g;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.14.12",componentType:n,tags:o}),[n,o]),u={logEvent:t.useCallback(async c=>{const v={...i,...c.properties,...r},d={eventName:c.eventName,properties:v};return s.onEvent?.(d)},[s,i,r])};return E.jsx(a.Provider,{value:u,children:e})},g=()=>{const e=t.useContext(a);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=p;exports.useBaseEvents=g;
@@ -5,7 +5,7 @@ import { useInkeepConfig as g } from "./config-provider.js";
5
5
  const a = d(void 0), P = ({ children: e }) => {
6
6
  const { baseSettings: t, componentType: o } = g(), { tags: s, analyticsProperties: n } = t, r = u(
7
7
  () => ({
8
- widgetLibraryVersion: "0.14.10",
8
+ widgetLibraryVersion: "0.14.12",
9
9
  componentType: o,
10
10
  tags: s
11
11
  }),
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),s=require("../styled/components/embedded-chat.cjs"),h=require("../styled/components/modal.cjs"),M=require("../styled/components/shadow.cjs"),g=require("../styled/components/message.cjs"),p=require("../primitives/providers/config-provider.cjs"),C=require("../primitives/providers/root-provider.cjs"),k=require("../primitives/providers/widget-provider.cjs"),T=require("../primitives/components/modal/modal-provider.cjs"),F=require("../primitives/utils/misc.cjs"),j=require("../primitives/atoms/portal-with-theme.cjs"),B=require("../primitives/atoms/error-boundary.cjs"),S=require("./modal.cjs"),v=require("./widget-toggle.cjs");function w(n){const{baseSettings:t,aiChatSettings:r}=n;return e.jsx(B.ErrorBoundary,{children:e.jsx(M.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(C.RootProvider,{config:{baseSettings:t,aiChatSettings:r},componentType:p.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(b,{...n})})})})}function A(n){const{children:t,onToggleView:r,isHidden:a,shouldAutoFocusInput:o=!r}=n;return e.jsx(s.Provider,{isHidden:a,shouldAutoFocusInput:o,children:t})}function b(n){return e.jsx(A,{...n,children:e.jsx(I,{...n})})}function I(n){const{onToggleView:t,variant:r,header:a=y}=n,o=T.useModal(),i=k.useWidget(),c=o&&!i?S.ModalContent:x.Fragment;return e.jsx(c,{children:e.jsxs(s.Wrapper,{variant:r??(t?"no-shadow":"container-with-shadow"),"data-composite":F.dataAttr(!!n.onToggleView||o?.isOpen),children:[e.jsxs(s.Root,{children:[a&&e.jsx(a,{...n}),e.jsx(f,{}),e.jsx(W,{})]}),e.jsx(V,{}),e.jsx(O,{})]})})}const y=n=>{const{onToggleView:t,askAILabel:r,searchLabel:a}=n,o=!!t;return e.jsx(s.Header,{"data-show-toolbar":F.dataAttr(o),children:o?e.jsxs(s.HeaderToolbar,{children:[e.jsxs(s.HeaderToolbarWrapper,{children:[e.jsx(s.ToolbarHeader,{}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{side:"bottom",align:"start",children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]})]}),e.jsx(v.WidgetToggle,{onToggleView:t,askAILabel:r,searchLabel:a,view:"chat"}),e.jsx(h.Close,{})]}):e.jsx(h.Close,{})})};function f(){return e.jsx(s.Content,{children:e.jsxs(s.ContentScrollArea,{children:[e.jsx(s.ContentScrollAreaViewport,{children:e.jsx(E,{})}),e.jsx(s.ContentScrollAreaScrollbar,{children:e.jsx(s.ContentScrollAreaThumb,{})}),e.jsx(s.ContentScrollAreaCorner,{})]})})}function E(){const{aiChatSettings:{components:n}}=p.useInkeepConfig();return e.jsx(s.Messages,{children:({messages:t,isLoading:r})=>{const a=t.at(-1),o=(c,m)=>{const d=n?.[c];if(!d)return console.warn(`Component "${c}" not found in components config`),null;try{if(typeof d=="function"&&d.length<=1)return x.createElement(d,m);const l=d(m,document.createElement("div"),null);return x.isValidElement(l)||typeof l=="string"?l:null}catch(l){return console.error(`🔍 [renderComponent] Error rendering component "${c}":`,l),null}},i=c=>e.jsx(s.Markdown,{text:c});return e.jsxs(e.Fragment,{children:[e.jsx(H,{}),t.map(c=>e.jsxs(s.MessageWrapper,{message:c,children:[e.jsx(u,{}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:n?.IkpMessage?e.jsx(s.DynamicComponent,{name:"IkpMessage",props:{message:c,renderComponent:o,renderMarkdown:i},componentDef:n.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(g.EmbeddedChatMessagePart,{isLast:a?.id===c.id}),e.jsx(L,{})]})}),e.jsx(D,{}),e.jsx(P,{})]})]},c.id)),r&&a?.parts.length&&e.jsx(s.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:e.jsx(u,{})})]})}})}function H(){return e.jsxs(s.IntroMessageWrapper,{children:[e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsxs(s.MessageAvatarContent,{children:[e.jsx(s.MessageAvatarFallback,{}),e.jsx(s.MessageAvatarImage,{})]})}),e.jsx(s.MessageName,{})]}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:e.jsx(g.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerLabel,{}),e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]}),e.jsxs(s.ExampleQuestions,{children:[e.jsx(s.ExampleQuestionsLabel,{}),e.jsx(s.ExampleQuestionsList,{children:n=>n.map(t=>e.jsx(s.ExampleQuestion,{children:e.jsx(s.ExampleQuestionButton,{question:t})},t))})]})]})]})}function u(){return e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsxs(s.MessageAvatarContent,{children:[e.jsx(s.MessageAvatarFallback,{}),e.jsx(s.MessageAvatarImage,{})]})}),e.jsx(s.MessageName,{})]})}function D(){return e.jsxs(s.MessageAttachments,{children:[e.jsx(s.MessageAttachmentsList,{children:n=>n.map(t=>e.jsxs(s.MessageAttachmentsItem,{attachment:t,children:[e.jsx(s.MessageAttachmentsItemIcon,{}),e.jsx(s.MessageAttachmentsItemTitle,{})]},t.id))}),e.jsx(s.MessageAttachmentsPreview,{children:e.jsx(j.PortalWithTheme,{children:e.jsx(s.MessageAttachmentsPreviewOverlay,{children:e.jsxs(s.MessageAttachmentsPreviewContent,{children:[e.jsx(s.MessageAttachmentsPreviewHeader,{}),e.jsx(s.MessageAttachmentsPreviewClose,{}),e.jsx(s.MessageAttachmentsPreviewBody,{})]})})})})]})}function P(){return e.jsxs(s.MessageToolbar,{children:[e.jsx(s.MessageAnnotationActions,{children:n=>n.map((t,r)=>e.jsx(s.MessageAnnotationAction,{action:t},`action-${r}`))}),e.jsx(s.MessageAction,{action:"copy"}),e.jsx(s.MessageAction,{action:"upvote"}),e.jsx(s.MessageAction,{action:"downvote"})]})}function L(){return e.jsxs(s.MessageSources,{children:[e.jsx(s.MessageSourcesHeader,{}),e.jsx(s.MessageSourcesList,{children:n=>n.map((t,r)=>e.jsxs(s.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(s.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(a=>e.jsxs(x.Fragment,{children:[a,e.jsx(s.MessageSourceItemBreadcrumbIcon,{})]},a))}),e.jsx(s.MessageSourceItemIcon,{}),e.jsx(s.MessageSourceItemTitle,{}),e.jsx(s.MessageSourceItemTag,{}),e.jsx(s.MessageSourceItemDescription,{children:a=>a.map((o,i)=>e.jsx(s.MessageSourceItemDescriptionPart,{part:o},`part-${i}`))}),e.jsx(s.MessageSourceItemIndicator,{})]},r))})]})}function W(){return e.jsxs(s.Footer,{children:[e.jsx(q,{}),e.jsx(_,{})]})}function q(){return e.jsxs(s.InputFieldset,{children:[e.jsxs(s.InputGroup,{children:[e.jsx(s.Input,{}),e.jsx(s.SendButton,{children:e.jsx(s.SendButtonIcon,{})})]}),e.jsxs(s.AttachmentsBar,{children:[e.jsx(s.AttachmentsBarList,{children:n=>n.map(t=>e.jsxs(s.AttachmentsBarAttachment,{attachment:t,children:[e.jsx(s.AttachmentsBarAttachmentIcon,{}),e.jsx(s.AttachmentsBarAttachmentTitle,{}),e.jsx(s.AttachmentsBarAttachmentDelete,{})]},t.id))}),e.jsxs(s.AttachmentsBarActions,{children:[e.jsxs(s.AttachmentsBarInfoTip,{children:[e.jsx(s.AttachmentsBarInfoTipIcon,{}),e.jsx(s.AttachmentsBarInfoTipText,{})]}),e.jsx(s.AttachmentsBarInputs,{children:n=>n.map(t=>e.jsx(s.AttachmentsBarInput,{input:t,children:t.displayName},t.id))})]}),e.jsx(j.PortalWithTheme,{children:e.jsx(s.AttachmentsBarModal,{children:e.jsx(s.AttachmentsBarModalOverlay,{children:e.jsxs(s.AttachmentsBarModalContent,{children:[e.jsxs(s.AttachmentsBarModalHeader,{children:[e.jsx(s.AttachmentsBarModalHeading,{}),e.jsx(s.AttachmentsBarModalDescription,{}),e.jsx(s.AttachmentsBarModalHelp,{})]}),e.jsx(s.AttachmentsBarModalClose,{}),e.jsx(s.AttachmentsBarModalBody,{children:e.jsxs(s.AttachmentsBarForm,{children:[e.jsxs(s.AttachmentsBarFormTitle,{children:[e.jsx(s.AttachmentsBarFormTitleLabel,{}),e.jsx(s.AttachmentsBarFormTitleInput,{}),e.jsx(s.AttachmentsBarFormTitleError,{})]}),e.jsxs(s.AttachmentsBarFormContent,{children:[e.jsx(s.AttachmentsBarFormContentLabel,{}),e.jsx(s.AttachmentsBarFormContentInput,{}),e.jsx(s.AttachmentsBarFormContentError,{})]}),e.jsx(s.AttachmentsBarFormSubmitButton,{})]})})]})})})})]})]})}function _(){return e.jsxs(s.ActionBar,{children:[e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{}),e.jsx(s.TaglineBrandName,{})]}),e.jsxs(s.Actions,{children:[e.jsx(s.HelpActions,{children:({pinned:n,unpinned:t})=>e.jsxs(e.Fragment,{children:[n.map(r=>e.jsx(s.HelpAction,{action:r},r.name)),t.length>0&&e.jsx(s.HelpActionsTrigger,{}),e.jsxs(s.HelpActionsMenu,{children:[e.jsx(s.HelpActionsMenuArrow,{}),t.map(r=>e.jsxs(s.HelpActionsMenuItem,{action:r,children:[e.jsx(s.HelpActionsMenuItemIcon,{action:r}),r.name]},r.name))]})]})}),e.jsxs(s.ChatAction,{action:"copy",children:[e.jsx(s.ChatActionLabel,{action:"copy"}),e.jsx(s.ChatActionFeedback,{action:"copy"})]}),e.jsx(s.ChatAction,{action:"clear"}),e.jsx(s.ChatAction,{action:"stop"})]})]})}function V(){return e.jsx(j.PortalWithTheme,{children:e.jsx(s.FeedbackModal,{children:e.jsx(s.FeedbackModalOverlay,{children:e.jsxs(s.FeedbackModalContent,{children:[e.jsx(s.FeedbackModalHeader,{}),e.jsx(s.FeedbackModalClose,{}),e.jsx(s.FeedbackModalBody,{children:e.jsxs(s.FeedbackForm,{children:[e.jsxs(s.FeedbackItem,{name:"unrelated_response",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsxs(s.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsxs(s.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsxs(s.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{})]}),e.jsx(s.FeedbackSubmitButton,{})]})})]})})})})}function O(){return e.jsxs(s.FormWrapper,{children:[e.jsx(s.FormClose,{}),e.jsxs(s.Form,{children:[e.jsxs(s.FormHeader,{children:[e.jsx(s.FormHeading,{}),e.jsx(s.FormDescription,{})]}),e.jsx(s.FormContent,{children:n=>e.jsxs(e.Fragment,{children:[n.map((t,r)=>e.jsxs(s.FormField,{field:t,autoFocus:r===0,children:[e.jsx(s.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(s.FormFieldText,{}),t.inputType==="email"&&e.jsx(s.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(s.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(s.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(s.FormFieldCheckbox,{children:e.jsx(s.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(s.FormFieldSelect,{children:[e.jsxs(s.FormFieldSelectTrigger,{children:[e.jsx(s.FormFieldSelectValue,{}),e.jsx(s.FormFieldSelectIcon,{})]}),e.jsx(s.FormFieldSelectContent,{children:e.jsx(s.FormFieldSelectViewport,{children:t.items.map(a=>e.jsxs(s.FormFieldSelectItem,{value:a.value,children:[e.jsx(s.FormFieldSelectItemText,{children:a.label}),e.jsx(s.FormFieldSelectItemIndicator,{})]},a.value))})})]}),e.jsx(s.FormFieldError,{})]},t.name)),e.jsx(s.FormError,{})]})}),e.jsxs(s.FormFooter,{children:[e.jsx(s.FormCancel,{}),e.jsx(s.FormSubmit,{})]})]}),e.jsxs(s.FormSuccess,{children:[e.jsx(s.FormSuccessHeading,{}),e.jsx(s.FormSuccessMessage,{}),e.jsx(s.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=w;exports.InkeepEmbeddedChatImpl=b;exports.InkeepEmbeddedChatImplContent=I;exports.InkeepEmbeddedChatProvider=A;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),s=require("../styled/components/embedded-chat.cjs"),h=require("../styled/components/modal.cjs"),M=require("../styled/components/shadow.cjs"),g=require("../styled/components/message.cjs"),p=require("../primitives/providers/config-provider.cjs"),C=require("../primitives/providers/root-provider.cjs"),k=require("../primitives/providers/widget-provider.cjs"),T=require("../primitives/components/modal/modal-provider.cjs"),F=require("../primitives/utils/misc.cjs"),j=require("../primitives/atoms/portal-with-theme.cjs"),B=require("../primitives/atoms/error-boundary.cjs"),S=require("./modal.cjs"),v=require("./widget-toggle.cjs");function w(n){const{baseSettings:t,aiChatSettings:r}=n;return e.jsx(B.ErrorBoundary,{children:e.jsx(M.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(C.RootProvider,{config:{baseSettings:t,aiChatSettings:r},componentType:p.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(b,{...n})})})})}function A(n){const{children:t,onToggleView:r,isHidden:a,shouldAutoFocusInput:o=!r}=n;return e.jsx(s.Provider,{isHidden:a,shouldAutoFocusInput:o,children:t})}function b(n){return e.jsx(A,{...n,children:e.jsx(I,{...n})})}function I(n){const{onToggleView:t,variant:r,header:a=y}=n,o=T.useModal(),i=k.useWidget(),c=o&&!i?S.ModalContent:x.Fragment;return e.jsx(c,{children:e.jsxs(s.Wrapper,{variant:r??(t?"no-shadow":"container-with-shadow"),"data-composite":F.dataAttr(!!n.onToggleView||o?.isOpen),children:[e.jsxs(s.Root,{children:[a&&e.jsx(a,{...n}),e.jsx(f,{}),e.jsx(W,{})]}),e.jsx(V,{}),e.jsx(O,{})]})})}const y=n=>{const{onToggleView:t,askAILabel:r,searchLabel:a}=n,o=!!t;return e.jsx(s.Header,{"data-show-toolbar":F.dataAttr(o),children:o?e.jsxs(s.HeaderToolbar,{children:[e.jsxs(s.HeaderToolbarWrapper,{children:[e.jsx(s.ToolbarHeader,{}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{side:"bottom",align:"start",children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]})]}),e.jsx(v.WidgetToggle,{onToggleView:t,askAILabel:r,searchLabel:a,view:"chat"}),e.jsx(h.Close,{})]}):e.jsx(h.Close,{})})};function f(){return e.jsx(s.Content,{children:e.jsxs(s.ContentScrollArea,{children:[e.jsx(s.ContentScrollAreaViewport,{children:e.jsx(E,{})}),e.jsx(s.ContentScrollAreaScrollbar,{children:e.jsx(s.ContentScrollAreaThumb,{})}),e.jsx(s.ContentScrollAreaCorner,{})]})})}function E(){const{aiChatSettings:{components:n}}=p.useInkeepConfig();return e.jsx(s.Messages,{children:({messages:t,isLoading:r})=>{const a=t.at(-1),o=(c,m)=>{const d=n?.[c];if(!d)return console.warn(`Component "${c}" not found in components config`),null;try{if(typeof d=="function"&&d.length<=1)return x.createElement(d,m);const l=d(m,document.createElement("div"),null);return x.isValidElement(l)||typeof l=="string"?l:null}catch(l){return console.error(`🔍 [renderComponent] Error rendering component "${c}":`,l),null}},i=c=>e.jsx(s.Markdown,{text:c});return e.jsxs(e.Fragment,{children:[e.jsx(H,{}),t.map(c=>e.jsxs(s.MessageWrapper,{message:c,children:[e.jsx(u,{}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:n?.IkpMessage?e.jsx(s.DynamicComponent,{name:"IkpMessage",props:{message:c,renderComponent:o,renderMarkdown:i},componentDef:n.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(g.EmbeddedChatMessagePart,{isLast:a?.id===c.id}),e.jsx(L,{})]})}),e.jsx(D,{}),e.jsx(P,{})]})]},c.id)),r&&a?.parts.length&&e.jsxs(s.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:[e.jsx(u,{}),e.jsx(s.MessageLoading,{})]})]})}})}function H(){return e.jsxs(s.IntroMessageWrapper,{children:[e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsxs(s.MessageAvatarContent,{children:[e.jsx(s.MessageAvatarFallback,{}),e.jsx(s.MessageAvatarImage,{})]})}),e.jsx(s.MessageName,{})]}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:e.jsx(g.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerLabel,{}),e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]}),e.jsxs(s.ExampleQuestions,{children:[e.jsx(s.ExampleQuestionsLabel,{}),e.jsx(s.ExampleQuestionsList,{children:n=>n.map(t=>e.jsx(s.ExampleQuestion,{children:e.jsx(s.ExampleQuestionButton,{question:t})},t))})]})]})]})}function u(){return e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsxs(s.MessageAvatarContent,{children:[e.jsx(s.MessageAvatarFallback,{}),e.jsx(s.MessageAvatarImage,{})]})}),e.jsx(s.MessageName,{})]})}function D(){return e.jsxs(s.MessageAttachments,{children:[e.jsx(s.MessageAttachmentsList,{children:n=>n.map(t=>e.jsxs(s.MessageAttachmentsItem,{attachment:t,children:[e.jsx(s.MessageAttachmentsItemIcon,{}),e.jsx(s.MessageAttachmentsItemTitle,{})]},t.id))}),e.jsx(s.MessageAttachmentsPreview,{children:e.jsx(j.PortalWithTheme,{children:e.jsx(s.MessageAttachmentsPreviewOverlay,{children:e.jsxs(s.MessageAttachmentsPreviewContent,{children:[e.jsx(s.MessageAttachmentsPreviewHeader,{}),e.jsx(s.MessageAttachmentsPreviewClose,{}),e.jsx(s.MessageAttachmentsPreviewBody,{})]})})})})]})}function P(){return e.jsxs(s.MessageToolbar,{children:[e.jsx(s.MessageAnnotationActions,{children:n=>n.map((t,r)=>e.jsx(s.MessageAnnotationAction,{action:t},`action-${r}`))}),e.jsx(s.MessageAction,{action:"copy"}),e.jsx(s.MessageAction,{action:"upvote"}),e.jsx(s.MessageAction,{action:"downvote"})]})}function L(){return e.jsxs(s.MessageSources,{children:[e.jsx(s.MessageSourcesHeader,{}),e.jsx(s.MessageSourcesList,{children:n=>n.map((t,r)=>e.jsxs(s.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(s.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(a=>e.jsxs(x.Fragment,{children:[a,e.jsx(s.MessageSourceItemBreadcrumbIcon,{})]},a))}),e.jsx(s.MessageSourceItemIcon,{}),e.jsx(s.MessageSourceItemTitle,{}),e.jsx(s.MessageSourceItemTag,{}),e.jsx(s.MessageSourceItemDescription,{children:a=>a.map((o,i)=>e.jsx(s.MessageSourceItemDescriptionPart,{part:o},`part-${i}`))}),e.jsx(s.MessageSourceItemIndicator,{})]},r))})]})}function W(){return e.jsxs(s.Footer,{children:[e.jsx(q,{}),e.jsx(_,{})]})}function q(){return e.jsxs(s.InputFieldset,{children:[e.jsxs(s.InputGroup,{children:[e.jsx(s.Input,{}),e.jsx(s.SendButton,{children:e.jsx(s.SendButtonIcon,{})})]}),e.jsxs(s.AttachmentsBar,{children:[e.jsx(s.AttachmentsBarList,{children:n=>n.map(t=>e.jsxs(s.AttachmentsBarAttachment,{attachment:t,children:[e.jsx(s.AttachmentsBarAttachmentIcon,{}),e.jsx(s.AttachmentsBarAttachmentTitle,{}),e.jsx(s.AttachmentsBarAttachmentDelete,{})]},t.id))}),e.jsxs(s.AttachmentsBarActions,{children:[e.jsxs(s.AttachmentsBarInfoTip,{children:[e.jsx(s.AttachmentsBarInfoTipIcon,{}),e.jsx(s.AttachmentsBarInfoTipText,{})]}),e.jsx(s.AttachmentsBarInputs,{children:n=>n.map(t=>e.jsx(s.AttachmentsBarInput,{input:t,children:t.displayName},t.id))})]}),e.jsx(j.PortalWithTheme,{children:e.jsx(s.AttachmentsBarModal,{children:e.jsx(s.AttachmentsBarModalOverlay,{children:e.jsxs(s.AttachmentsBarModalContent,{children:[e.jsxs(s.AttachmentsBarModalHeader,{children:[e.jsx(s.AttachmentsBarModalHeading,{}),e.jsx(s.AttachmentsBarModalDescription,{}),e.jsx(s.AttachmentsBarModalHelp,{})]}),e.jsx(s.AttachmentsBarModalClose,{}),e.jsx(s.AttachmentsBarModalBody,{children:e.jsxs(s.AttachmentsBarForm,{children:[e.jsxs(s.AttachmentsBarFormTitle,{children:[e.jsx(s.AttachmentsBarFormTitleLabel,{}),e.jsx(s.AttachmentsBarFormTitleInput,{}),e.jsx(s.AttachmentsBarFormTitleError,{})]}),e.jsxs(s.AttachmentsBarFormContent,{children:[e.jsx(s.AttachmentsBarFormContentLabel,{}),e.jsx(s.AttachmentsBarFormContentInput,{}),e.jsx(s.AttachmentsBarFormContentError,{})]}),e.jsx(s.AttachmentsBarFormSubmitButton,{})]})})]})})})})]})]})}function _(){return e.jsxs(s.ActionBar,{children:[e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{}),e.jsx(s.TaglineBrandName,{})]}),e.jsxs(s.Actions,{children:[e.jsx(s.HelpActions,{children:({pinned:n,unpinned:t})=>e.jsxs(e.Fragment,{children:[n.map(r=>e.jsx(s.HelpAction,{action:r},r.name)),t.length>0&&e.jsx(s.HelpActionsTrigger,{}),e.jsxs(s.HelpActionsMenu,{children:[e.jsx(s.HelpActionsMenuArrow,{}),t.map(r=>e.jsxs(s.HelpActionsMenuItem,{action:r,children:[e.jsx(s.HelpActionsMenuItemIcon,{action:r}),r.name]},r.name))]})]})}),e.jsxs(s.ChatAction,{action:"copy",children:[e.jsx(s.ChatActionLabel,{action:"copy"}),e.jsx(s.ChatActionFeedback,{action:"copy"})]}),e.jsx(s.ChatAction,{action:"clear"}),e.jsx(s.ChatAction,{action:"stop"})]})]})}function V(){return e.jsx(j.PortalWithTheme,{children:e.jsx(s.FeedbackModal,{children:e.jsx(s.FeedbackModalOverlay,{children:e.jsxs(s.FeedbackModalContent,{children:[e.jsx(s.FeedbackModalHeader,{}),e.jsx(s.FeedbackModalClose,{}),e.jsx(s.FeedbackModalBody,{children:e.jsxs(s.FeedbackForm,{children:[e.jsxs(s.FeedbackItem,{name:"unrelated_response",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsxs(s.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsxs(s.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsxs(s.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{})]}),e.jsx(s.FeedbackSubmitButton,{})]})})]})})})})}function O(){return e.jsxs(s.FormWrapper,{children:[e.jsx(s.FormClose,{}),e.jsxs(s.Form,{children:[e.jsxs(s.FormHeader,{children:[e.jsx(s.FormHeading,{}),e.jsx(s.FormDescription,{})]}),e.jsx(s.FormContent,{children:n=>e.jsxs(e.Fragment,{children:[n.map((t,r)=>e.jsxs(s.FormField,{field:t,autoFocus:r===0,children:[e.jsx(s.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(s.FormFieldText,{}),t.inputType==="email"&&e.jsx(s.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(s.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(s.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(s.FormFieldCheckbox,{children:e.jsx(s.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(s.FormFieldSelect,{children:[e.jsxs(s.FormFieldSelectTrigger,{children:[e.jsx(s.FormFieldSelectValue,{}),e.jsx(s.FormFieldSelectIcon,{})]}),e.jsx(s.FormFieldSelectContent,{children:e.jsx(s.FormFieldSelectViewport,{children:t.items.map(a=>e.jsxs(s.FormFieldSelectItem,{value:a.value,children:[e.jsx(s.FormFieldSelectItemText,{children:a.label}),e.jsx(s.FormFieldSelectItemIndicator,{})]},a.value))})})]}),e.jsx(s.FormFieldError,{})]},t.name)),e.jsx(s.FormError,{})]})}),e.jsxs(s.FormFooter,{children:[e.jsx(s.FormCancel,{}),e.jsx(s.FormSubmit,{})]})]}),e.jsxs(s.FormSuccess,{children:[e.jsx(s.FormSuccessHeading,{}),e.jsx(s.FormSuccessMessage,{}),e.jsx(s.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=w;exports.InkeepEmbeddedChatImpl=b;exports.InkeepEmbeddedChatImplContent=I;exports.InkeepEmbeddedChatProvider=A;