@headwai/chat-bubble 2.0.2 → 2.0.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.
@@ -278,4 +278,4 @@ ${r.map((t,e)=>{const n=t.name||"Untitled Reference";let a=`**[${e+1}]** `;retur
278
278
 
279
279
  `)}`}function Ba(r){let s,t,e,n,a;return{c(){s=Ut("div"),t=Ut("img"),Hs(t.src,e=r[5])||Ee(t,"src",e),Ee(t,"alt","AI Assistant"),Ee(t,"class","svelte-bjand4"),Ee(s,"class","ai-assistant-icon svelte-bjand4"),Pr(s,"background",r[2]),Ee(s,"role","button"),Ee(s,"tabindex","0")},m(i,o){hr(i,s,o),dr(s,t),n||(a=[Or(s,"click",r[10]),Or(s,"keydown",r[27])],n=!0)},p(i,o){o[0]&4&&Pr(s,"background",i[2])},d(i){i&&_n(s),n=!1,Kt(a)}}}function Da(r){let s,t;return{c(){s=Ut("div"),t=Ut("deep-chat"),ve(t,"demo","false"),ve(t,"textInput",r[9]),ve(t,"messageStyles",r[3]),ve(t,"history",r[6]),ve(t,"connect",r[4]),ve(t,"requestBodyLimits",r[8]),ve(t,"requestInterceptor",r[12]),ve(t,"responseInterceptor",r[13]),ve(t,"customButtons",r[7]),ve(t,"onMessage",r[11]),Ee(s,"class","chat-container svelte-bjand4")},m(e,n){hr(e,s,n),dr(s,t),r[28](t)},p(e,n){n[0]&8&&ve(t,"messageStyles",e[3]),n[0]&16&&ve(t,"connect",e[4])},d(e){e&&_n(s),r[28](null)}}}function nc(r){let s,t,e=!r[0]&&Ba(r),n=r[0]&&Da(r);return{c(){s=Ut("main"),e&&e.c(),t=zs(),n&&n.c(),Ee(s,"class","svelte-bjand4")},m(a,i){hr(a,s,i),e&&e.m(s,null),dr(s,t),n&&n.m(s,null)},p(a,i){a[0]?e&&(e.d(1),e=null):e?e.p(a,i):(e=Ba(a),e.c(),e.m(s,t)),a[0]?n?n.p(a,i):(n=Da(a),n.c(),n.m(s,null)):n&&(n.d(1),n=null)},i:Ft,o:Ft,d(a){a&&_n(s),e&&e.d(),n&&n.d()}}}function rc(r,s){r=r.replace("#","");const t=parseInt(r,16),e=(t>>16)+s,n=(t>>8&255)+s,a=(t&255)+s,i=Math.max(0,Math.min(255,e)),o=Math.max(0,Math.min(255,n)),l=Math.max(0,Math.min(255,a));return`#${(i<<16|o<<8|l).toString(16).padStart(6,"0")}`}function ac(r){return r.map(s=>{let t=s.text||s.content;return(s.role==="ai"||s.role==="assistant")&&(t=t.replace(/\n\n---\n\n\*\*References:\*\*[\s\S]*$/,"")),{role:s.role==="ai"?"assistant":s.role,content:t}})}function sc(r,s,t){let e,n,a,{apiUrl:i=void 0}=s,{apiKey:o=void 0}=s,{modelId:l=void 0}=s,{maxMessages:u=void 0}=s,{placeholderText:c=void 0}=s,{faviconPath:d=void 0}=s,{initialMessage:p=void 0}=s,{userMessageBackgroundColor:h=void 0}=s,{aiMessageBackgroundColor:v=void 0}=s,{userMessageTextColor:f=void 0}=s,{aiMessageTextColor:g=void 0}=s,{faviconBackgroundColor:y=void 0}=s,_=!1,C=null,I=[],w="",A="",U=[],P="",G;const x=d||void 0||Qu,T=p||"Hey, how can I assist you?",E=[{role:"ai",text:T}],B=[{styles:{button:{default:{container:{default:{backgroundColor:"transparent",borderRadius:"4px",width:"24px",height:"24px",border:"1px solid #e0e0e0",cursor:"pointer",transition:"all 0.2s ease"},hover:{backgroundColor:"#2196F3",borderColor:"#2196F3",transform:"scale(1.05)"},click:{backgroundColor:"#1976D2",borderColor:"#1976D2"}},svg:{content:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
280
280
  <path d="M19 14L12 21L5 14" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
281
- </svg>`,styles:{default:{width:"14px",height:"14px",color:"#666"},hover:{color:"white"}}}}}},position:"outside-right",tooltip:{text:"Minimize chat",timeout:300,style:{backgroundColor:"#333",color:"white",fontSize:"12px",padding:"4px 8px",borderRadius:"4px",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"}},onClick:()=>(Y(),"default")}],M={maxMessages:parseInt(u||"0")||0},K={placeholder:{text:c||"Welcome to the demo!"}};function Y(){_?(t(26,C=null),I=[]):$([{role:"assistant",content:T}]),t(0,_=!_)}function ie(){if(console.log("=== Message History ==="),I.length===0){console.log("No messages in history");return}I.forEach((R,W)=>{const se=R.content.length>50?R.content.substring(0,50)+"...":R.content;console.log(`${W+1}. ${R.role.toUpperCase()}: ${se}`)}),console.log("=====================")}async function $(R){var W;try{const se=Math.floor(Date.now()/1e3),ge=[l||"test-model"],oe=[],We={};let $e=null;R.forEach((Me,Xe)=>{const Ye=rn(),lt=Xe<R.length-1?rn():null,ut={id:Ye,parentId:$e,childrenIds:lt?[lt]:[],role:Me.role,content:Me.content,timestamp:se,models:ge};Me.role==="assistant"&&(ut.model=ge[0],ut.modelId=ge[0],ut.modelIdx=0),oe.push(ut),We[Ye]=ut,$e=Ye}),oe.forEach((Me,Xe)=>{Xe<oe.length-1&&(Me.childrenIds=[oe[Xe+1].id])});const Je=(W=oe[oe.length-1])==null?void 0:W.id,xn={chat:{id:"",title:"New Chatbubble Chat",models:ge,params:{},history:{messages:We,currentId:Je},messages:oe,tags:[],timestamp:Date.now()},folder_id:null},Xt=`${(i||"https://localchat.headwai.org/").replace(/\/$/,"")}/api/v1/chats/new`,ot=await fetch(Xt,{method:"POST",headers:{Authorization:`Bearer ${o||"sk-47ec23c1fd214846ada1e9c812596eef"}`,"Content-Type":"application/json"},body:JSON.stringify(xn)});if(ot.ok){const Me=await ot.json();return t(26,C=Me.id),console.log("New chat created with ID:",C),I=oe,ie(),C}else return console.error("Failed to create new chat:",ot.statusText),null}catch(se){return console.error("Error creating new chat:",se),null}}async function ne(R,W,se){if(!C){console.error("Cannot store chat history: no chat ID available");return}console.log("assistantMessageSources:",se);try{const ge=Math.floor(Date.now()/1e3),oe=[l||"test-model"],We=rn(),$e=rn(),Je=I[I.length-1],xn={id:We,parentId:Je?Je.id:null,childrenIds:[$e],role:"user",content:R,timestamp:ge,models:oe},Rr={id:$e,parentId:We,childrenIds:[],role:"assistant",content:W,model:oe[0],modelId:oe[0],modelIdx:0,timestamp:ge,sources:se};Je&&(Je.childrenIds=[We]),I.push(xn,Rr);const Xt={};I.forEach(lt=>{Xt[lt.id]=lt});const ot={chat:{models:oe,history:{messages:Xt,currentId:$e},messages:I,params:{}}},Xe=`${(i||"https://localchat.headwai.org/").replace(/\/$/,"")}/api/v1/chats/${C}`,Ye=await fetch(Xe,{method:"POST",headers:{Authorization:`Bearer ${o||"sk-47ec23c1fd214846ada1e9c812596eef"}`,"Content-Type":"application/json"},body:JSON.stringify(ot)});Ye.ok?(console.log("Chat history stored successfully"),ie()):console.error("Failed to store chat history:",Ye.statusText)}catch(ge){console.error("Error storing chat history:",ge)}}async function fe(R){const{message:W,isHistory:se}=R;if(console.log(R),console.log(W),!se&&(W.role==="ai"||W.role==="assistant")&&(console.log("🤖 AI answered:",W.text||W.content),P&&G)){console.log("📚 Updating AI message with references");const oe=(W.text||W.content||"")+P;console.log(G.getMessages()),console.log(G.getMessages().length-1),G.updateMessage({text:oe},G.getMessages().length-1),P=""}}const me=async R=>{if(R.body&&R.body.messages){R.body.messages=ac(R.body.messages);const W=R.body.messages.filter(se=>se.role==="user");W.length>0&&(w=W[W.length-1].content),C&&(R.body.chat_id=C)}return R},Jt=R=>{console.log(R),R.sources&&Array.isArray(R.sources)&&(U=R.sources,console.log(`Found ${U.length} sources in response`),console.log("assistantMessageSources:",U));try{const W=ec(R);W.length>0&&(P=tc(W),console.log(`Found ${W.length} references in response`))}catch(W){console.error("Error extracting references:",W)}if(R.choices&&R.choices[0]&&R.choices[0].delta){const W=R.choices[0].delta,se=W.content||"";return se&&(A+=se),R.choices[0].finish_reason&&(console.log("Streaming response ended"),w&&A&&ne(w,A,U),A="",w=""),{text:se,role:W.role==="assistant"?"ai":W.role||"ai"}}if(R.choices&&R.choices[0]&&R.choices[0].message){const W=R.choices[0].message;return console.log("Non-streaming response received"),w&&W.content&&(ne(w,W.content),w=""),{text:W.content,role:W.role==="assistant"?"ai":W.role}}return R.text||R.html||R.files?R:typeof R=="string"?{text:R}:R},it=R=>R.key==="Enter"&&Y();function Pe(R){Fn[R?"unshift":"push"](()=>{G=R,t(1,G)})}return r.$$set=R=>{"apiUrl"in R&&t(14,i=R.apiUrl),"apiKey"in R&&t(15,o=R.apiKey),"modelId"in R&&t(16,l=R.modelId),"maxMessages"in R&&t(17,u=R.maxMessages),"placeholderText"in R&&t(18,c=R.placeholderText),"faviconPath"in R&&t(19,d=R.faviconPath),"initialMessage"in R&&t(20,p=R.initialMessage),"userMessageBackgroundColor"in R&&t(21,h=R.userMessageBackgroundColor),"aiMessageBackgroundColor"in R&&t(22,v=R.aiMessageBackgroundColor),"userMessageTextColor"in R&&t(23,f=R.userMessageTextColor),"aiMessageTextColor"in R&&t(24,g=R.aiMessageTextColor),"faviconBackgroundColor"in R&&t(25,y=R.faviconBackgroundColor)},r.$$.update=()=>{r.$$.dirty[0]&67223552&&t(4,e={type:"websocket",url:`${(i||"https://localchat.headwai.org/").replace(/\/$/,"")}/api/chat/completions`,headers:{Authorization:`Bearer ${o||"sk-47ec23c1fd214846ada1e9c812596eef"}`,"Content-Type":"application/json"},additionalBodyProps:{model:l||"test-model",stream:!0,params:{},tool_servers:[],features:{image_generation:!1,code_interpreter:!1,web_search:!1,memory:!1},variables:{"{{USER_NAME}}":"David Schneebauer | headwAI GmbH","{{USER_LOCATION}}":"Unknown","{{CURRENT_DATETIME}}":new Date().toISOString().slice(0,19).replace("T"," "),"{{CURRENT_DATE}}":new Date().toISOString().slice(0,10),"{{CURRENT_TIME}}":new Date().toTimeString().slice(0,8),"{{CURRENT_WEEKDAY}}":new Date().toLocaleDateString("en-US",{weekday:"long"}),"{{CURRENT_TIMEZONE}}":Intl.DateTimeFormat().resolvedOptions().timeZone,"{{USER_LANGUAGE}}":"en-GB"},...C&&{chat_id:C},background_tasks:{title_generation:!0,tags_generation:!1,follow_up_generation:!1}},stream:!0}),r.$$.dirty[0]&31457280&&t(3,n={default:{user:{bubble:{backgroundColor:h||"green",color:f||"white"}},ai:{bubble:{backgroundColor:v||"gray",color:g||"black"}}}}),r.$$.dirty[0]&33554432&&t(2,a=(()=>{const R=y||"lightgreen",W=rc(R,-20);return`linear-gradient(135deg, ${R} 0%, ${W} 100%)`})())},[_,G,a,n,e,x,E,B,M,K,Y,fe,me,Jt,i,o,l,u,c,d,p,h,v,f,g,y,C,it,Pe]}class cr extends ni{constructor(s){super(),ti(this,s,sc,nc,js,{apiUrl:14,apiKey:15,modelId:16,maxMessages:17,placeholderText:18,faviconPath:19,initialMessage:20,userMessageBackgroundColor:21,aiMessageBackgroundColor:22,userMessageTextColor:23,aiMessageTextColor:24,faviconBackgroundColor:25},null,[-1,-1])}}function Ds(){const r={apiUrl:"https://localchat.headwai.org/",apiKey:"sk-47ec23c1fd214846ada1e9c812596eef",modelId:"test-model",connectionType:void 0,contentType:void 0,maxMessages:"0",placeholderText:"Welcome to the demo!",demoMode:void 0,userMessageBackgroundColor:"green",aiMessageBackgroundColor:"gray",userMessageTextColor:"white",aiMessageTextColor:"black",faviconBackgroundColor:"lightgreen"},s=typeof window<"u"&&window.HEADWAI_CHAT_BUBBLE_CONFIG||{};return{...r,...s}}typeof window<"u"&&window.document&&document.addEventListener("DOMContentLoaded",()=>{const r=Ds(),s=document.querySelectorAll("[data-chat-bubble]");if(s.length===0){const t=document.getElementById("chat-bubble-container");t&&new cr({target:t,props:r})}else s.forEach(t=>{const e={...r};Object.keys(t.dataset).forEach(n=>{if(n.startsWith("chatBubble")){const a=n.replace("chatBubble","").toLowerCase();e[a]=t.dataset[n]}}),new cr({target:t,props:e})})});window.ChatBubble={init:(r,s={})=>new cr({target:r,props:{...Ds(),...s}})};
281
+ </svg>`,styles:{default:{width:"14px",height:"14px",color:"#666"},hover:{color:"white"}}}}}},position:"outside-right",tooltip:{text:"Minimize chat",timeout:300,style:{backgroundColor:"#333",color:"white",fontSize:"12px",padding:"4px 8px",borderRadius:"4px",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"}},onClick:()=>(Y(),"default")}],M={maxMessages:parseInt(u||"0")||0},K={placeholder:{text:c||"Welcome to the demo!"}};function Y(){_?(t(26,C=null),I=[]):$([{role:"assistant",content:T}]),t(0,_=!_)}function ie(){if(console.log("=== Message History ==="),I.length===0){console.log("No messages in history");return}I.forEach((R,W)=>{const se=R.content.length>50?R.content.substring(0,50)+"...":R.content;console.log(`${W+1}. ${R.role.toUpperCase()}: ${se}`)}),console.log("=====================")}async function $(R){var W;try{const se=Math.floor(Date.now()/1e3),ge=[l||"test-model"],oe=[],We={};let $e=null;R.forEach((Me,Xe)=>{const Ye=rn(),lt=Xe<R.length-1?rn():null,ut={id:Ye,parentId:$e,childrenIds:lt?[lt]:[],role:Me.role,content:Me.content,timestamp:se,models:ge};Me.role==="assistant"&&(ut.model=ge[0],ut.modelId=ge[0],ut.modelIdx=0),oe.push(ut),We[Ye]=ut,$e=Ye}),oe.forEach((Me,Xe)=>{Xe<oe.length-1&&(Me.childrenIds=[oe[Xe+1].id])});const Je=(W=oe[oe.length-1])==null?void 0:W.id,xn={chat:{id:"",title:"New Chatbubble Chat",models:ge,params:{},history:{messages:We,currentId:Je},messages:oe,tags:[],timestamp:Date.now()},folder_id:null},Xt=`${(i||"https://localchat.headwai.org/").replace(/\/$/,"")}/api/v1/chats/new`,ot=await fetch(Xt,{method:"POST",headers:{Authorization:`Bearer ${o||"sk-47ec23c1fd214846ada1e9c812596eef"}`,"Content-Type":"application/json"},body:JSON.stringify(xn)});if(ot.ok){const Me=await ot.json();return t(26,C=Me.id),console.log("New chat created with ID:",C),I=oe,ie(),C}else return console.error("Failed to create new chat:",ot.statusText),null}catch(se){return console.error("Error creating new chat:",se),null}}async function ne(R,W,se){if(!C){console.error("Cannot store chat history: no chat ID available");return}console.log("assistantMessageSources:",se);try{const ge=Math.floor(Date.now()/1e3),oe=[l||"test-model"],We=rn(),$e=rn(),Je=I[I.length-1],xn={id:We,parentId:Je?Je.id:null,childrenIds:[$e],role:"user",content:R,timestamp:ge,models:oe},Rr={id:$e,parentId:We,childrenIds:[],role:"assistant",content:W,model:oe[0],modelId:oe[0],modelIdx:0,timestamp:ge,sources:se};Je&&(Je.childrenIds=[We]),I.push(xn,Rr);const Xt={};I.forEach(lt=>{Xt[lt.id]=lt});const ot={chat:{models:oe,history:{messages:Xt,currentId:$e},messages:I,params:{}}},Xe=`${(i||"https://localchat.headwai.org/").replace(/\/$/,"")}/api/v1/chats/${C}`,Ye=await fetch(Xe,{method:"POST",headers:{Authorization:`Bearer ${o||"sk-47ec23c1fd214846ada1e9c812596eef"}`,"Content-Type":"application/json"},body:JSON.stringify(ot)});Ye.ok?(console.log("Chat history stored successfully"),ie()):console.error("Failed to store chat history:",Ye.statusText)}catch(ge){console.error("Error storing chat history:",ge)}}async function fe(R){const{message:W,isHistory:se}=R;if(console.log(R),console.log(W),!se&&(W.role==="ai"||W.role==="assistant")&&(console.log("🤖 AI answered:",W.text||W.content),P&&G)){console.log("📚 Updating AI message with references");const oe=(W.text||W.content||"")+P;console.log(G.getMessages()),console.log(G.getMessages().length-1),G.updateMessage({text:oe},G.getMessages().length-1),P=""}}const me=async R=>{if(R.body&&R.body.messages){R.body.messages=ac(R.body.messages);const W=R.body.messages.filter(se=>se.role==="user");W.length>0&&(w=W[W.length-1].content),C&&(R.body.chat_id=C)}return R},Jt=R=>{console.log(R),R.sources&&Array.isArray(R.sources)&&(U=R.sources,console.log(`Found ${U.length} sources in response`),console.log("assistantMessageSources:",U));try{const W=ec(R);W.length>0&&(P=tc(W),console.log(`Found ${W.length} references in response`))}catch(W){console.error("Error extracting references:",W)}if(R.choices&&R.choices[0]&&R.choices[0].delta){const W=R.choices[0].delta,se=W.content||"";return se&&(A+=se),R.choices[0].finish_reason&&(console.log("Streaming response ended"),w&&A&&ne(w,A,U),A="",w=""),{text:se,role:W.role==="assistant"?"ai":W.role||"ai"}}if(R.choices&&R.choices[0]&&R.choices[0].message){const W=R.choices[0].message;return console.log("Non-streaming response received"),w&&W.content&&(ne(w,W.content),w=""),{text:W.content,role:W.role==="assistant"?"ai":W.role}}return R.text||R.html||R.files?R:typeof R=="string"?{text:R}:R},it=R=>R.key==="Enter"&&Y();function Pe(R){Fn[R?"unshift":"push"](()=>{G=R,t(1,G)})}return r.$$set=R=>{"apiUrl"in R&&t(14,i=R.apiUrl),"apiKey"in R&&t(15,o=R.apiKey),"modelId"in R&&t(16,l=R.modelId),"maxMessages"in R&&t(17,u=R.maxMessages),"placeholderText"in R&&t(18,c=R.placeholderText),"faviconPath"in R&&t(19,d=R.faviconPath),"initialMessage"in R&&t(20,p=R.initialMessage),"userMessageBackgroundColor"in R&&t(21,h=R.userMessageBackgroundColor),"aiMessageBackgroundColor"in R&&t(22,v=R.aiMessageBackgroundColor),"userMessageTextColor"in R&&t(23,f=R.userMessageTextColor),"aiMessageTextColor"in R&&t(24,g=R.aiMessageTextColor),"faviconBackgroundColor"in R&&t(25,y=R.faviconBackgroundColor)},r.$$.update=()=>{r.$$.dirty[0]&67223552&&t(4,e={type:"websocket",url:`${(i||"https://localchat.headwai.org/").replace(/\/$/,"")}/api/chat/completions`,headers:{Authorization:`Bearer ${o||"sk-47ec23c1fd214846ada1e9c812596eef"}`,"Content-Type":"application/json"},additionalBodyProps:{model:l||"test-model",stream:!0,params:{},tool_servers:[],features:{image_generation:!1,code_interpreter:!1,web_search:!1,memory:!1},variables:{"{{USER_NAME}}":"David Schneebauer | headwAI GmbH","{{USER_LOCATION}}":"Unknown","{{CURRENT_DATETIME}}":new Date().toISOString().slice(0,19).replace("T"," "),"{{CURRENT_DATE}}":new Date().toISOString().slice(0,10),"{{CURRENT_TIME}}":new Date().toTimeString().slice(0,8),"{{CURRENT_WEEKDAY}}":new Date().toLocaleDateString("en-US",{weekday:"long"}),"{{CURRENT_TIMEZONE}}":Intl.DateTimeFormat().resolvedOptions().timeZone,"{{USER_LANGUAGE}}":"en-GB"},...C&&{chat_id:C},background_tasks:{title_generation:!0,tags_generation:!1,follow_up_generation:!1}},stream:!0}),r.$$.dirty[0]&31457280&&t(3,n={default:{user:{bubble:{backgroundColor:h||"green",color:f||"white"}},ai:{bubble:{backgroundColor:v||"gray",color:g||"black"}}}}),r.$$.dirty[0]&33554432&&t(2,a=(()=>{const R=y||"lightgreen",W=rc(R,-20);return`linear-gradient(135deg, ${R} 0%, ${W} 100%)`})())},[_,G,a,n,e,x,E,B,M,K,Y,fe,me,Jt,i,o,l,u,c,d,p,h,v,f,g,y,C,it,Pe]}class cr extends ni{constructor(s){super(),ti(this,s,sc,nc,js,{apiUrl:14,apiKey:15,modelId:16,maxMessages:17,placeholderText:18,faviconPath:19,initialMessage:20,userMessageBackgroundColor:21,aiMessageBackgroundColor:22,userMessageTextColor:23,aiMessageTextColor:24,faviconBackgroundColor:25},null,[-1,-1])}}function Ds(){const r={apiUrl:"https://localchat.headwai.org/",apiKey:"sk-47ec23c1fd214846ada1e9c812596eef",modelId:"test-model",connectionType:void 0,contentType:void 0,maxMessages:"0",placeholderText:"Welcome to the demo!",demoMode:void 0,userMessageBackgroundColor:"green",aiMessageBackgroundColor:"gray",userMessageTextColor:"white",aiMessageTextColor:"black",faviconBackgroundColor:"lightgreen"},s=typeof window<"u"&&window.HEADWAI_CHAT_BUBBLE_CONFIG||{},t=Object.fromEntries(Object.entries(r).filter(([n,a])=>a!==void 0));console.log("Environment config:",t),console.log("Global config:",s);const e={...t,...s};return console.log("Final merged config:",e),e}typeof window<"u"&&window.document&&document.addEventListener("DOMContentLoaded",()=>{const r=Ds(),s=document.querySelectorAll("[data-chat-bubble]");if(s.length===0){const t=document.getElementById("chat-bubble-container");t&&new cr({target:t,props:r})}else s.forEach(t=>{const e={...r},n={chatBubbleApiUrl:"apiUrl",chatBubbleApiKey:"apiKey",chatBubbleModelId:"modelId",chatBubbleMaxMessages:"maxMessages",chatBubblePlaceholderText:"placeholderText",chatBubbleFaviconPath:"faviconPath",chatBubbleInitialMessage:"initialMessage",chatBubbleUserMessageBackgroundColor:"userMessageBackgroundColor",chatBubbleAiMessageBackgroundColor:"aiMessageBackgroundColor",chatBubbleUserMessageTextColor:"userMessageTextColor",chatBubbleAiMessageTextColor:"aiMessageTextColor",chatBubbleFaviconBackgroundColor:"faviconBackgroundColor"};Object.keys(t.dataset).forEach(a=>{n[a]&&(e[n[a]]=t.dataset[a])}),new cr({target:t,props:e})})});window.ChatBubble={init:(r,s={})=>new cr({target:r,props:{...Ds(),...s}})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headwai/chat-bubble",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "A chat bubble component for LocalChat by headwAI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",