UNPKG

@infomatebot/chatbot-widget

Version:

Build intelligent chatbots using pre-designed conversation flows with quick reply options. Upload documents for AI-powered, context-aware responses and reduce support costs by 80% with guided conversations

1 lines 91.5 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).InfoMateChatbot={})}(this,function(e){"use strict";const t={apiBaseUrl:"http://localhost:3000",apiKey:"",botName:"InfoMate Assistant",welcomeMessage:"Hi! How can I help you today?",inputPlaceholder:"Type your message ...",primaryColor:"#667eea",secondaryColor:"#764ba2",size:"medium",position:"bottom-right",autoOpen:!1,enableTyping:!0,theme:"light",showPoweredBy:!0,welcomeFlow:void 0},n="infomate-chatbot",i="1.0.5",s={trigger:"chatbot-trigger",window:"chatbot-window",windowActive:"chatbot-window-active",header:"header",messages:"messages",message:"message",messageBot:"message-bot",messageUser:"message-user",messageError:"message-error",typing:"typing-message",typingIndicator:"typing-indicator",quickReplies:"quick-replies",quickReply:"quick-reply",inputArea:"input-area",messageInput:"message-input",sendButton:"send-button",closeButton:"close-button",botAvatar:"bot-avatar",msgAvatar:"msg-avatar",msgContent:"msg-content",botInfo:"bot-info",botName:"bot-name",botStatus:"bot-status",maximizeButton:"maximize-button",windowMaximized:"chatbot-window-maximized",quickReplyAction:"quick-reply-action",quickReplyDisabled:"quick-reply-disabled",inputCollector:"input-collector",inputCollectorField:"input-collector-field",inputCollectorButtons:"input-collector-buttons",inputCollectorSubmit:"input-collector-submit",inputCollectorCancel:"input-collector-cancel",inputCollectorError:"input-collector-error",actionLoader:"action-loader",messageLoading:"message-loading",messageProcessing:"message-processing",inputDisabled:"input-disabled",actionFeedback:"action-feedback",poweredBy:"powered-by"},o="typingIndicator",r="messagesContainer",a={apiBaseUrl:"api-base-url",apibaseurl:"apibaseurl",apiBaseUrlCamel:"apiBaseUrl",apiKey:"api-key",apikey:"apikey",apiKeyCamel:"apiKey"},l=320,c=450,d=380,h=520,p=450,u=600,g=520,m=680,b=["Hello! Great to meet you! How can I assist you today?","Hi there! I'm here to help. What can I do for you?","Hey! Nice to chat with you. What would you like to know?"],f=["I'm here to help! I can answer questions, provide information, and assist with various tasks. What specific help do you need?","Happy to help! Feel free to ask me anything - I'm designed to be as helpful as possible!"],y=["We offer a comprehensive range of services including customer support, technical assistance, product information, and general inquiries. What specific service interests you?"],C=["You can reach our support team at support@infomate.com or call 1-800-INFOMATE. We're available 24/7!"],w=["That's a great question! I'm working on providing you with the best answer possible. Is there anything specific you'd like to know more about?","Thanks for asking! I understand what you're looking for. Let me help you with that right away!","Interesting point! I'm here to provide you with accurate and helpful information. How else can I assist you?"],v={greeting:/\b(hello|hi|hey|greetings|good\s*(morning|afternoon|evening))\b/i,help:/\b(help|assist|support|guidance)\b/i,services:/\b(service|offer|provide|what\s*do\s*you\s*do)\b/i,contact:/\b(contact|phone|email|reach|support)\b/i},x="Maximize chat window",k={variable:/\{\{([\w.]+)\}\}/g,conditionalBlock:/\{\{#([\w.]+)\}\}(.*?)\{\{\/\1\}\}/gs,arrayLoop:/\{\{#each\s+([\w.]+)\}\}(.*?)\{\{\/each\}\}/gs};function $(e){return new Promise(t=>setTimeout(t,e))}function I(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}function S(e,t=!0){const n={behavior:t?"smooth":"auto",block:"end"},i=document.createElement("div");e.appendChild(i),i.scrollIntoView(n),e.removeChild(i)}function M(e,t=120){if(e.scrollHeight<=e.clientHeight&&e.style.height)return;e.style.height="auto";const n=Math.max(46,Math.min(e.scrollHeight,t));e.style.height=n+"px"}function T(e){const t=e.toLowerCase();return v.greeting.test(t)?E(b):v.help.test(t)?E(f):v.services.test(t)?E(y):v.contact.test(t)?E(C):E(w)}function E(e){return e[Math.floor(Math.random()*e.length)]}function B(e,t,n="text"){return{id:`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"bot"===t?e:I(e),sender:t,timestamp:(new Date).toISOString(),type:n}}const A="infomate_session_tracking",z="Session has expired, please refresh",L="Invalid input provided",q="Service temporarily unavailable";function R(e){return e&&"string"==typeof e?e.trim().substring(0,1e3).replace(/<[^>]*>/g,"").replace(/&[a-z0-9#]+;/gi,"").replace(/javascript:/gi,"").replace(/vbscript:/gi,"").replace(/data:/gi,"").replace(/on\w+\s*=/gi,"").replace(/\bscript\b/gi,"").replace(/\beval\b/gi,"").replace(/\bfunction\b/gi,"").replace(/['"`;\\]/g,"").replace(/\b(union|select|insert|update|delete|drop|create|alter|exec|execute)\b/gi,"").replace(/[\x00-\x1F\x7F]/g,""):""}function F(e,t){"undefined"==typeof window||"localhost"===window.location.hostname||window.location.hostname.includes("127.0.0.1")?console.error(`InfoMate Error [${t}]:`,e):console.error(`InfoMate Error: ${t||"Unknown"}`)}class ApiService{constructor(e){this.apiBaseUrl=e.apiBaseUrl.replace(/\/$/,""),this.apiKey=e.apiKey}async initializeChat(){if(!this.apiKey||!this.apiBaseUrl)return{success:!1,error:"Invalid configuration"};const e=this.buildUrl("/chat/start");try{const t=await this.makeRequest(e,{method:"POST",headers:{"Content-Type":"application/json","x-chat-token":this.apiKey},body:JSON.stringify({})});if(!t.ok)return F(`Chat init failed: ${t.status}`,"initializeChat"),{success:!1,error:q};const n=await t.json();if(!n.success||!n.data){const e=n.error?.message||"Unknown init error";return F(e,"initializeChat"),{success:!1,error:e||"Failed to initialize chatbot"}}if(n.data.sessionToken)try{localStorage.setItem(A,n.data.sessionToken)}catch{}return n.data.config&&(this.backendConfig=n.data.config),{success:!0,config:this.createInternalConfig()}}catch(t){return F("Chat initialization exception","initializeChat"),{success:!1,error:q}}}async sendMessage(e){const t=this.getSessionToken();if(!t)return{success:!1,error:z};const n=function(e){if(!e||"object"!=typeof e)return;const t=e.message?R(e.message):"",n=e.replyChoiceId?R(e.replyChoiceId):"";return t||n?{message:t,replyChoiceId:n}:void 0}(e);if(!n)return{success:!1,error:L};const i=this.buildUrl("/chat/send"),s={message:n.message,replyChoiceId:n.replyChoiceId};try{const e=await this.makeRequestWithRetry(i,{method:"POST",headers:{"Content-Type":"application/json","x-chat-token":this.apiKey,Authorization:`Bearer ${t}`},body:JSON.stringify(s)});if(!e.ok)return 401===e.status?(this.clearSession(),{success:!1,error:z}):429===e.status?{success:!1,error:"You have exceeded your limit.. please upgrade the plan"}:(F(`Message send failed: ${e.status}`,"sendMessage"),{success:!1,error:"Failed to send message"});const n=await e.json(),o=n.data||n,r=this.sanitizeApiResponse(o);return{success:!0,message:r.message,quickReplies:r.quickReplies,inputCollector:r.inputCollector}}catch(o){return F("Message send exception","sendMessage"),{success:!1,error:q}}}async checkHealth(){try{const e=this.buildUrl("/health");return(await this.makeRequest(e,{method:"GET",headers:{"Content-Type":"application/json"}})).ok}catch{return!1}}getConfig(){return this.createInternalConfig()}isInitialized(){return Boolean(this.getSessionToken())&&Boolean(this.backendConfig)}clearSession(){this.backendConfig=void 0;try{localStorage.removeItem(A)}catch{}}async validateSession(){const e=this.getSessionToken();if(!e||!this.apiKey)return!1;try{const t=this.buildUrl("/session/validate");return!!(await this.makeRequest(t,{method:"POST",headers:{"Content-Type":"application/json","x-chat-token":this.apiKey,Authorization:`Bearer ${e}`},body:JSON.stringify({})})).ok||(this.clearSession(),!1)}catch{return this.clearSession(),!1}}async getConversationHistory(e=20){const t=this.getSessionToken();if(!t)return{success:!1,error:z};try{const n=this.buildUrl(`/conversation/history?limit=${e}`),i=await this.makeRequest(n,{method:"GET",headers:{"Content-Type":"application/json","x-chat-token":this.apiKey,Authorization:`Bearer ${t}`}});if(!i.ok)return 401===i.status?(this.clearSession(),{success:!1,error:z}):{success:!1,error:"Failed to fetch history"};const s=await i.json();return{success:!0,messages:Array.isArray(s.messages)?s.messages.slice(0,e):[]}}catch(n){return F("History fetch exception","getConversationHistory"),{success:!1,error:q}}}async sendFeedback(e,t,n){const i=this.getSessionToken();if(!i)return{success:!1,error:z};if(!e||!t)return{success:!1,error:L};try{const s=this.buildUrl("/feedback"),o=await this.makeRequest(s,{method:"POST",headers:{"Content-Type":"application/json","x-chat-token":this.apiKey,Authorization:`Bearer ${i}`},body:JSON.stringify({messageId:e,rating:t,comment:n?.trim().substring(0,500)})});return o.ok?{success:!0}:401===o.status?(this.clearSession(),{success:!1,error:z}):{success:!1,error:"Failed to send feedback"}}catch(s){return F("Feedback send exception","sendFeedback"),{success:!1,error:q}}}getSessionToken(){try{return localStorage.getItem(A)}catch{return null}}createInternalConfig(){return this.backendConfig?{apiBaseUrl:this.apiBaseUrl,apiKey:this.apiKey,botName:this.backendConfig.botName||"Assistant",welcomeMessage:this.backendConfig.welcomeMessage||"Hello!",inputPlaceholder:this.backendConfig.inputPlaceholder||"Type your message...",primaryColor:this.backendConfig.primaryColor||"#667eea",secondaryColor:this.backendConfig.secondaryColor||"#764ba2",size:this.backendConfig.size||"medium",position:this.backendConfig.position||"bottom-right",autoOpen:this.backendConfig.autoOpen??!1,enableTyping:this.backendConfig.enableTyping??!0,theme:this.backendConfig.theme||"light",showPoweredBy:this.backendConfig.showPoweredBy??!0,welcomeFlow:this.backendConfig.welcomeFlow,fallbackFlow:this.backendConfig.fallbackFlow}:{apiBaseUrl:this.apiBaseUrl,apiKey:this.apiKey,botName:"Loading...",welcomeMessage:"Connecting...",inputPlaceholder:"Type your message...",primaryColor:"#667eea",secondaryColor:"#764ba2",size:"medium",position:"bottom-right",autoOpen:!1,enableTyping:!0,theme:"light",showPoweredBy:!0}}sanitizeApiResponse(e){if(!e||"object"!=typeof e)throw new Error("Invalid response format");if(!e.message||"string"!=typeof e.message)throw new Error("Invalid message format");let t,n;return e.quickReplies&&Array.isArray(e.quickReplies)&&(t=e.quickReplies.filter(e=>e&&"object"==typeof e&&e.id&&e.label).map(e=>({id:String(e.id),label:String(e.label)}))),e.inputCollector&&"object"==typeof e.inputCollector&&(n=e.inputCollector),{message:e.message,quickReplies:t&&t.length>0?t:void 0,inputCollector:n}}buildUrl(e){return`${this.apiBaseUrl}${e}`}async makeRequest(e,t,n=3e4){const i=new AbortController,s=setTimeout(()=>i.abort(),n);try{const n=await fetch(e,{...t,signal:i.signal});return clearTimeout(s),n}catch(o){if(clearTimeout(s),o instanceof Error&&"AbortError"===o.name)throw new Error("Request timeout");throw o}}async makeRequestWithRetry(e,t,n=3){let i;for(let o=0;o<=n;o++)try{const i=await this.makeRequest(e,t);if(i.status>=400&&i.status<500&&429!==i.status)return i;if(i.ok||o===n)return i;throw new Error(`Server error: ${i.status}`)}catch(s){if(i=s,o<n){const e=1e3*Math.pow(2,o);await new Promise(t=>setTimeout(t,e));continue}break}throw i}}class ChatbotUI{constructor(e,t){this.elements={},this.isRendered=!1,this.isMaximized=!1,this.currentQuickReplies=[],this.shadow=e,this.config=t}create(){this.isRendered||(this.shadow.innerHTML+=this.getHTML(),this.cacheElements(),this.setupInitialState(),this.isRendered=!0)}getHTML(){return`\n <div class="position-${this.config.position}">\n ${this.getTriggerHTML()}\n ${this.getWindowHTML()}\n </div>\n `}getTriggerHTML(){return`\n <button \n class="${s.trigger}" \n aria-label="Open chat"\n type="button"\n role="button"\n >\n ${this.getChatIcon()}\n </button>\n `}getWindowHTML(){return`\n <div class="${s.window} size-${this.config.size}" role="dialog" aria-modal="true" aria-labelledby="bot-name">\n ${this.getHeaderHTML()}\n ${this.getMessagesHTML()}\n ${this.getInputAreaHTML()}\n ${this.getPoweredByHTML()}\n </div>\n `}getHeaderHTML(){return`\n <header class="${s.header}">\n <div class="${s.botAvatar}" aria-hidden="true">\n ${this.getBotIcon()}\n </div>\n <div class="${s.botInfo}">\n <h3 class="${s.botName}" id="bot-name">${I(this.config.botName)}</h3>\n <div class="${s.botStatus}" aria-live="polite">\n <span class="status-indicator online"></span>\n <span class="status-text">Online</span>\n </div>\n </div>\n <div class="header-controls">\n <button \n class="${s.maximizeButton}" \n aria-label="${x}"\n type="button"\n >\n ${this.getMaximizeIcon()}\n </button>\n <button \n class="${s.closeButton}" \n aria-label="Close chat"\n type="button"\n >\n ${this.getCloseIcon()}\n </button>\n </div>\n </header>\n `}getMessagesHTML(){return`\n <div \n class="${s.messages}" \n id="${r}"\n role="log" \n aria-live="polite" \n aria-label="Chat messages"\n tabindex="0"\n ></div>\n `}getInputAreaHTML(){return`\n <div class="${s.inputArea}">\n <textarea \n class="${s.messageInput}" \n placeholder="${I(this.config.inputPlaceholder)}" \n aria-label="Type your message"\n maxlength="4000"\n autocomplete="off"\n spellcheck="true"\n ></textarea>\n <button \n class="${s.sendButton}" \n aria-label="Send message"\n type="button"\n disabled\n >\n ${this.getSendIcon()}\n </button>\n </div>\n `}getPoweredByHTML(){return this.config.showPoweredBy?`\n <div class="${s.poweredBy}">\n <a href="https://infomatebot.com" target="_blank" rel="noopener noreferrer">\n Powered by ${this.getLogoSVG()}\n </a>\n </div>\n `:""}cacheElements(){this.elements={trigger:this.shadow.querySelector(`.${s.trigger}`),window:this.shadow.querySelector(`.${s.window}`),messages:this.shadow.querySelector(`.${s.messages}`),input:this.shadow.querySelector(`.${s.messageInput}`),sendBtn:this.shadow.querySelector(`.${s.sendButton}`),closeBtn:this.shadow.querySelector(`.${s.closeButton}`),botName:this.shadow.querySelector(`.${s.botName}`),botStatus:this.shadow.querySelector(`.${s.botStatus}`),maximizeBtn:this.shadow.querySelector(`.${s.maximizeButton}`)}}setupInitialState(){this.elements.botName&&(this.elements.botName.textContent=this.config.botName),this.elements.input&&(this.elements.input.placeholder=this.config.inputPlaceholder,this.setupInputHandlers()),this.elements.maximizeBtn&&this.elements.maximizeBtn.addEventListener("click",()=>{this.toggleMaximize()}),this.updateSendButtonState()}setupInputHandlers(){if(!this.elements.input||!this.elements.sendBtn)return;const e=this.elements.input;e.addEventListener("input",()=>{M(e,120),this.updateSendButtonState()}),e.addEventListener("paste",t=>{setTimeout(()=>{M(e,120),this.updateSendButtonState()},0)}),e.addEventListener("keydown",e=>{"Enter"!==e.key||e.shiftKey||e.preventDefault()})}addMessage(e,t){if(!this.elements.messages)return;const n=this.createMessageElement(e);if(this.elements.messages.appendChild(n),"bot"===e.sender&&t&&t.length>0){this.currentQuickReplies=t;const e=this.createQuickRepliesElement(t);this.elements.messages.appendChild(e)}"bot"===e.sender&&this.announceToScreenReader(e.content),this.scrollToBottom()}getCurrentQuickReplies(){return this.currentQuickReplies}createQuickRepliesElement(e){const t=document.createElement("div");return t.className="inline-quick-replies",e.forEach(e=>{const n=document.createElement("button");n.className=s.quickReply,n.textContent=e.label,n.setAttribute("data-label",e.label),n.setAttribute("data-reply-choice-id",e.id),n.setAttribute("type","button"),n.setAttribute("aria-label",`Quick reply option: ${e.label}`),t.appendChild(n)}),t}removeAllQuickReplies(){const e=this.elements.messages?.querySelectorAll(".inline-quick-replies");e?.forEach(e=>{e.remove()})}toggleMaximize(){this.isMaximized=!this.isMaximized,this.elements.window&&this.elements.maximizeBtn&&(this.isMaximized?(this.elements.window.classList.add(s.windowMaximized),this.elements.maximizeBtn.setAttribute("aria-label","Minimize chat window")):(this.elements.window.classList.remove(s.windowMaximized),this.elements.maximizeBtn.setAttribute("aria-label",x))),setTimeout(()=>this.scrollToBottom(),300)}getMaximizeIcon(){return'<svg viewBox="0 0 16 16" fill="none">\n <path d="M6.49001 8.30999L3.69 11.11V9.40999C3.69 8.93999 3.31 8.55999 2.84 8.55999C2.37 8.55999 1.99001 8.93999 1.99001 9.40999V14.01H6.59C7.06 14.01 7.44 13.63 7.44 13.16C7.44 12.69 7.06 12.31 6.59 12.31H4.89L7.69 9.50999L6.49001 8.30999ZM9.41 1.98999C8.94 1.98999 8.56001 2.36999 8.56001 2.83999C8.56001 3.30999 8.94 3.68999 9.41 3.68999H11.11L8.31001 6.48999L9.51 7.68999L12.31 4.88999V6.58999C12.31 7.05999 12.69 7.43999 13.16 7.43999C13.63 7.43999 14.01 7.05999 14.01 6.58999V1.98999H9.41Z" fill="currentColor"/>\n </svg>'}createMessageElement(e){const t=document.createElement("div");t.className=`${s.message} ${s["message"+("bot"===e.sender?"Bot":"User")]}`,t.setAttribute("data-message-id",e.id),t.setAttribute("data-timestamp",e.timestamp),"error"===e.type&&t.classList.add(s.messageError);const n=document.createElement("div");n.className=s.msgAvatar,n.setAttribute("aria-hidden","true"),n.innerHTML="bot"===e.sender?this.getBotIcon():this.getUserIcon();const i=document.createElement("div");i.className=s.msgContent,i.innerHTML=this.formatMessageContent(e.content);const o=document.createElement("span");return o.className="sr-only",o.textContent=` sent at ${new Date(e.timestamp).toLocaleTimeString()}`,i.appendChild(o),t.appendChild(n),t.appendChild(i),t}showTypingIndicator(){if(!this.elements.messages)return;this.hideTypingIndicator();const e=document.createElement("div");e.className=`${s.message} ${s.messageBot} ${s.typing}`,e.id=o,e.setAttribute("aria-label","Bot is typing");const t=document.createElement("div");t.className=s.msgAvatar,t.setAttribute("aria-hidden","true"),t.innerHTML=this.getBotIcon();const n=document.createElement("div");n.className=s.typingIndicator,n.innerHTML='\n <div class="typing-dots" aria-hidden="true">\n <div class="typing-dot"></div>\n <div class="typing-dot"></div>\n <div class="typing-dot"></div>\n </div>\n ',e.appendChild(t),e.appendChild(n),this.elements.messages.appendChild(e),this.announceToScreenReader("Bot is typing"),this.scrollToBottom()}hideTypingIndicator(){const e=this.shadow.getElementById(o);e&&e.remove()}clearMessages(){this.elements.messages&&(this.elements.messages.innerHTML="")}clearInput(){this.elements.input&&(this.elements.input.value="",this.elements.input.style.height="auto",this.updateSendButtonState())}focusInput(){this.elements.input&&setTimeout(()=>{this.elements.input?.focus()},300)}setInputDisabled(e){this.elements.input&&(this.elements.input.disabled=e),this.elements.sendBtn&&(this.elements.sendBtn.disabled=e||!this.isInputValid())}show(){this.elements.window&&(this.elements.window.classList.add(s.windowActive),this.elements.window.setAttribute("aria-hidden","false"),this.updateTriggerIcon(!0))}hide(){this.elements.window&&(this.elements.window.classList.remove(s.windowActive),this.elements.window.setAttribute("aria-hidden","true"),this.updateTriggerIcon(!1),setTimeout(()=>{this.elements.trigger?.focus()}))}updateBotStatus(e){if(this.elements.botStatus){const t=this.elements.botStatus.querySelector(".status-indicator"),n=this.elements.botStatus.querySelector(".status-text");t&&n&&(n.textContent=e,t.className=`status-indicator ${e.toLowerCase()}`)}}updateConfig(e){this.config=e,this.elements.botName&&(this.elements.botName.textContent=e.botName),this.elements.input&&(this.elements.input.placeholder=e.inputPlaceholder),this.elements.window&&(this.elements.window.className=this.elements.window.className.replace(/size-(small|medium|large|xl)/,`size-${e.size}`));const t=this.shadow.querySelector(".position-bottom-right, .position-bottom-left");t&&(t.className=`position-${e.position}`)}getInputValue(){return this.elements.input?.value.trim()||""}onTriggerClick(e){this.elements.trigger?.addEventListener("click",e)}onCloseClick(e){this.elements.closeBtn?.addEventListener("click",e)}onSendMessage(e){const t=()=>{const t=this.getInputValue();t&&this.isInputValid()&&e(t)};this.elements.sendBtn?.addEventListener("click",t),this.elements.input?.addEventListener("keydown",e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),t())})}onQuickReplyClick(e){this.elements.messages?.addEventListener("click",async t=>{const n=t.target;if(n.classList.contains(s.quickReply)){const t=n.dataset.label,s=n.dataset.replyChoiceId;if(t&&s){this.disableQuickReplies();try{await e(t,s)}catch(i){this.enableQuickReplies()}}}})}disableQuickReplies(){const e=this.elements.messages?.querySelectorAll(`.${s.quickReply}`);e?.forEach(e=>{e.disabled=!0,e.style.opacity="0.5",e.style.pointerEvents="none"})}enableQuickReplies(){const e=this.elements.messages?.querySelectorAll(`.${s.quickReply}`);e?.forEach(e=>{e.disabled=!1,e.style.opacity="1",e.style.pointerEvents="auto"})}isInputValid(){const e=this.getInputValue();return e.length>0&&e.length<=4e3}updateSendButtonState(){if(this.elements.sendBtn){const e=this.isInputValid();this.elements.sendBtn.disabled=!e,this.elements.sendBtn.setAttribute("aria-disabled",(!e).toString())}}scrollToBottom(){this.elements.messages&&setTimeout(()=>{S(this.elements.messages,!0)},50)}updateTriggerIcon(e){this.elements.trigger&&(this.elements.trigger.innerHTML=e?this.getDownArrowIcon():this.getChatIcon(),this.elements.trigger.setAttribute("aria-label",e?"Close chat":"Open chat"))}getDownArrowIcon(){return'<svg width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M18.601 8.39897C18.269 8.06702 17.7309 8.06702 17.3989 8.39897L12 13.7979L6.60099 8.39897C6.26904 8.06702 5.73086 8.06702 5.39891 8.39897C5.06696 8.73091 5.06696 9.2691 5.39891 9.60105L11.3989 15.601C11.7309 15.933 12.269 15.933 12.601 15.601L18.601 9.60105C18.9329 9.2691 18.9329 8.73091 18.601 8.39897Z" fill="currentColor"/>\n </svg>'}announceToScreenReader(e){const t=document.createElement("div");t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,this.shadow.appendChild(t),setTimeout(()=>{t.remove()},1e3)}isUIRendered(){return this.isRendered}getMessageCount(){return this.elements.messages?.children.length||0}destroy(){this.elements={},this.isRendered=!1}getChatIcon(){return'\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>\n </svg>\n '}getBotIcon(){return'\n <svg viewBox="0 0 24 24" fill="currentColor">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>\n </svg>\n '}getUserIcon(){return'\n <svg viewBox="0 0 24 24" fill="currentColor">\n <path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>\n </svg>\n '}getCloseIcon(){return'\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <line x1="18" y1="6" x2="6" y2="18"/>\n <line x1="6" y1="6" x2="18" y2="18"/>\n </svg>\n '}getSendIcon(){return'\n <svg viewBox="0 0 24 24" fill="currentColor">\n <path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/>\n </svg>\n '}getLogoSVG(){return'<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100px" height="12px" viewBox="0 0 101 12" version="1.1">\n<g id="surface1">\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(1.568628%,58.823532%,40.784314%);fill-opacity:1;" d="M 0.0195312 2.226562 C 3.195312 2.226562 6.371094 2.226562 9.640625 2.226562 C 9.640625 4.820312 9.640625 7.417969 9.640625 10.09375 C 6.558594 10.019531 6.558594 10.019531 5.601562 9.980469 C 3.929688 9.929688 3.929688 9.929688 2.511719 10.710938 C 2.160156 11.054688 1.851562 11.433594 1.5625 11.835938 C 1.519531 11.890625 1.480469 11.941406 1.4375 12 C 1.414062 12 1.386719 12 1.359375 12 C 1.359375 11.371094 1.359375 10.742188 1.359375 10.09375 C 0.917969 10.09375 0.472656 10.09375 0.0195312 10.09375 C 0.0195312 7.496094 0.0195312 4.898438 0.0195312 2.226562 Z M 1.519531 3.65625 C 1.519531 5.28125 1.519531 6.90625 1.519531 8.582031 C 3.703125 8.582031 5.890625 8.582031 8.144531 8.582031 C 8.144531 6.957031 8.144531 5.332031 8.144531 3.65625 C 5.957031 3.65625 3.769531 3.65625 1.519531 3.65625 Z M 1.519531 3.65625 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(1.568628%,58.823532%,40.784314%);fill-opacity:1;" d="M 46.238281 1.273438 C 46.65625 1.273438 47.074219 1.273438 47.503906 1.273438 C 48.429688 3.03125 49.304688 4.816406 50.183594 6.597656 C 50.371094 6.359375 50.507812 6.121094 50.640625 5.847656 C 50.683594 5.761719 50.722656 5.679688 50.765625 5.589844 C 50.808594 5.5 50.855469 5.414062 50.898438 5.320312 C 51.210938 4.679688 51.527344 4.046875 51.859375 3.417969 C 52.234375 2.707031 52.59375 1.992188 52.945312 1.273438 C 53.359375 1.273438 53.777344 1.273438 54.207031 1.273438 C 54.207031 3.738281 54.207031 6.203125 54.207031 8.742188 C 53.84375 8.742188 53.480469 8.742188 53.101562 8.742188 C 53.078125 7.0625 53.050781 5.382812 53.023438 3.65625 C 52.660156 4.390625 52.296875 5.125 51.917969 5.878906 C 51.6875 6.324219 51.460938 6.769531 51.222656 7.214844 C 51.089844 7.46875 50.957031 7.722656 50.824219 7.976562 C 50.691406 8.230469 50.554688 8.488281 50.421875 8.742188 C 50.289062 8.742188 50.160156 8.742188 50.027344 8.742188 C 49.355469 7.46875 48.714844 6.183594 48.082031 4.894531 C 48.050781 4.832031 48.015625 4.769531 47.984375 4.699219 C 47.925781 4.578125 47.863281 4.457031 47.804688 4.335938 C 47.6875 4.097656 47.570312 3.875 47.421875 3.65625 C 47.398438 5.332031 47.371094 7.011719 47.34375 8.742188 C 46.980469 8.742188 46.617188 8.742188 46.238281 8.742188 C 46.238281 6.277344 46.238281 3.8125 46.238281 1.273438 Z M 46.238281 1.273438 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(26.666668%,73.333335%,29.803923%);fill-opacity:1;" d="M 3.960938 0 C 7.136719 0 10.3125 0 13.585938 0 C 13.585938 2.597656 13.585938 5.191406 13.585938 7.867188 C 13.144531 7.867188 12.699219 7.867188 12.246094 7.867188 C 12.246094 8.496094 12.246094 9.125 12.246094 9.773438 C 12.0625 9.617188 11.878906 9.460938 11.691406 9.296875 C 11.632812 9.246094 11.570312 9.195312 11.507812 9.144531 C 10.34375 8.171875 10.34375 8.171875 10.265625 7.523438 C 10.246094 7.148438 10.304688 6.820312 10.351562 6.4375 C 10.925781 6.4375 11.496094 6.4375 12.085938 6.4375 C 12.085938 4.785156 12.085938 3.132812 12.085938 1.429688 C 9.40625 1.429688 6.722656 1.429688 3.960938 1.429688 C 3.960938 0.957031 3.960938 0.484375 3.960938 0 Z M 3.960938 0 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(1.568628%,58.823532%,40.784314%);fill-opacity:1;" d="M 78.738281 1.273438 C 79.453125 1.265625 80.167969 1.261719 80.90625 1.257812 C 81.132812 1.253906 81.355469 1.253906 81.589844 1.25 C 81.769531 1.25 81.949219 1.25 82.125 1.25 C 82.21875 1.246094 82.3125 1.246094 82.40625 1.246094 C 82.976562 1.246094 83.480469 1.265625 83.945312 1.636719 C 83.980469 1.683594 84.015625 1.726562 84.050781 1.773438 C 84.105469 1.839844 84.105469 1.839844 84.164062 1.90625 C 84.527344 2.507812 84.503906 3.285156 84.375 3.957031 C 84.265625 4.3125 84.117188 4.574219 83.863281 4.847656 C 83.9375 4.902344 84.011719 4.957031 84.085938 5.011719 C 84.476562 5.339844 84.605469 5.78125 84.652344 6.277344 C 84.691406 7.015625 84.6875 7.765625 84.179688 8.34375 C 83.710938 8.652344 83.261719 8.753906 82.703125 8.75 C 82.617188 8.75 82.527344 8.75 82.433594 8.75 C 82.339844 8.75 82.246094 8.75 82.148438 8.75 C 82.0625 8.75 81.976562 8.75 81.886719 8.75 C 81.566406 8.75 81.242188 8.746094 80.921875 8.746094 C 80.203125 8.746094 79.480469 8.742188 78.738281 8.742188 C 78.738281 6.277344 78.738281 3.8125 78.738281 1.273438 Z M 79.84375 2.382812 C 79.84375 3.039062 79.84375 3.695312 79.84375 4.371094 C 80.273438 4.378906 80.703125 4.386719 81.132812 4.394531 C 81.28125 4.394531 81.425781 4.398438 81.574219 4.402344 C 81.785156 4.40625 81.996094 4.40625 82.207031 4.410156 C 82.273438 4.410156 82.335938 4.414062 82.40625 4.417969 C 82.746094 4.417969 82.878906 4.402344 83.15625 4.1875 C 83.355469 3.914062 83.363281 3.753906 83.351562 3.417969 C 83.351562 3.320312 83.351562 3.226562 83.351562 3.128906 C 83.3125 2.847656 83.246094 2.691406 83.074219 2.464844 C 82.8125 2.332031 82.519531 2.375 82.230469 2.375 C 82.164062 2.378906 82.09375 2.378906 82.023438 2.378906 C 81.804688 2.378906 81.585938 2.378906 81.371094 2.378906 C 81.222656 2.378906 81.074219 2.378906 80.925781 2.378906 C 80.566406 2.378906 80.203125 2.382812 79.84375 2.382812 Z M 79.84375 5.484375 C 79.84375 6.191406 79.84375 6.898438 79.84375 7.628906 C 80.285156 7.632812 80.726562 7.640625 81.167969 7.640625 C 81.320312 7.644531 81.46875 7.644531 81.621094 7.648438 C 81.835938 7.652344 82.050781 7.652344 82.269531 7.652344 C 82.335938 7.652344 82.402344 7.65625 82.472656 7.65625 C 82.84375 7.65625 83.089844 7.636719 83.390625 7.390625 C 83.546875 7.113281 83.570312 6.871094 83.570312 6.554688 C 83.570312 6.484375 83.570312 6.410156 83.570312 6.335938 C 83.546875 6.09375 83.507812 5.933594 83.390625 5.722656 C 83.035156 5.429688 82.703125 5.453125 82.269531 5.460938 C 82.164062 5.460938 82.164062 5.460938 82.058594 5.460938 C 81.835938 5.460938 81.617188 5.464844 81.394531 5.46875 C 81.246094 5.46875 81.09375 5.472656 80.945312 5.472656 C 80.578125 5.472656 80.210938 5.480469 79.84375 5.484375 Z M 79.84375 5.484375 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(1.568628%,58.823532%,40.784314%);fill-opacity:1;" d="M 38.601562 1.238281 C 38.746094 1.238281 38.746094 1.238281 38.894531 1.234375 C 38.996094 1.234375 39.101562 1.238281 39.207031 1.238281 C 39.316406 1.238281 39.425781 1.234375 39.53125 1.234375 C 39.757812 1.234375 39.984375 1.234375 40.210938 1.234375 C 40.5 1.238281 40.785156 1.234375 41.074219 1.234375 C 41.296875 1.230469 41.519531 1.230469 41.742188 1.230469 C 41.902344 1.230469 42.058594 1.230469 42.21875 1.230469 C 43.125 1.234375 43.125 1.234375 43.480469 1.589844 C 43.71875 1.914062 43.75 2.1875 43.75 2.578125 C 43.75 2.636719 43.75 2.695312 43.75 2.753906 C 43.75 2.945312 43.75 3.136719 43.75 3.332031 C 43.75 3.464844 43.75 3.597656 43.753906 3.730469 C 43.753906 4.011719 43.753906 4.292969 43.75 4.570312 C 43.75 4.929688 43.753906 5.285156 43.753906 5.644531 C 43.757812 5.921875 43.757812 6.199219 43.757812 6.472656 C 43.757812 6.605469 43.757812 6.738281 43.757812 6.871094 C 43.757812 7.054688 43.757812 7.238281 43.757812 7.425781 C 43.757812 7.476562 43.757812 7.53125 43.757812 7.589844 C 43.753906 7.980469 43.65625 8.207031 43.402344 8.503906 C 43.078125 8.710938 42.828125 8.773438 42.449219 8.773438 C 42.308594 8.777344 42.308594 8.777344 42.167969 8.777344 C 42.066406 8.777344 41.96875 8.777344 41.863281 8.777344 C 41.761719 8.777344 41.660156 8.777344 41.554688 8.777344 C 41.335938 8.777344 41.117188 8.777344 40.898438 8.777344 C 40.625 8.777344 40.34375 8.777344 40.066406 8.78125 C 39.800781 8.78125 39.535156 8.78125 39.265625 8.78125 C 39.167969 8.78125 39.070312 8.78125 38.96875 8.785156 C 38.433594 8.777344 38.066406 8.765625 37.644531 8.425781 C 37.402344 8.101562 37.371094 7.824219 37.375 7.433594 C 37.375 7.375 37.375 7.320312 37.371094 7.257812 C 37.371094 7.066406 37.371094 6.875 37.371094 6.683594 C 37.371094 6.550781 37.371094 6.414062 37.371094 6.28125 C 37.371094 6.003906 37.371094 5.722656 37.371094 5.441406 C 37.371094 5.082031 37.371094 4.726562 37.367188 4.367188 C 37.367188 4.089844 37.367188 3.816406 37.367188 3.539062 C 37.367188 3.40625 37.367188 3.273438 37.367188 3.144531 C 37.363281 2.957031 37.367188 2.773438 37.367188 2.589844 C 37.367188 2.535156 37.367188 2.480469 37.363281 2.425781 C 37.371094 2.03125 37.472656 1.808594 37.722656 1.511719 C 38.015625 1.277344 38.234375 1.242188 38.601562 1.238281 Z M 38.511719 2.382812 C 38.511719 4.113281 38.511719 5.847656 38.511719 7.628906 C 39.863281 7.628906 41.21875 7.628906 42.613281 7.628906 C 42.613281 5.898438 42.613281 4.167969 42.613281 2.382812 C 41.257812 2.382812 39.90625 2.382812 38.511719 2.382812 Z M 38.511719 2.382812 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(1.568628%,58.823532%,40.784314%);fill-opacity:1;" d="M 88.671875 1.230469 C 88.78125 1.230469 88.886719 1.230469 88.996094 1.230469 C 89.222656 1.226562 89.445312 1.230469 89.671875 1.230469 C 89.960938 1.230469 90.246094 1.230469 90.535156 1.230469 C 90.757812 1.226562 90.980469 1.230469 91.203125 1.230469 C 91.359375 1.230469 91.519531 1.230469 91.675781 1.226562 C 92.582031 1.238281 92.582031 1.238281 92.9375 1.589844 C 93.175781 1.914062 93.207031 2.1875 93.203125 2.578125 C 93.203125 2.636719 93.203125 2.695312 93.207031 2.753906 C 93.207031 2.945312 93.207031 3.136719 93.207031 3.332031 C 93.207031 3.464844 93.207031 3.597656 93.207031 3.730469 C 93.207031 4.011719 93.207031 4.292969 93.207031 4.570312 C 93.207031 4.929688 93.207031 5.285156 93.210938 5.644531 C 93.210938 5.921875 93.210938 6.199219 93.210938 6.472656 C 93.210938 6.605469 93.210938 6.738281 93.214844 6.871094 C 93.214844 7.054688 93.214844 7.238281 93.210938 7.425781 C 93.210938 7.476562 93.214844 7.53125 93.214844 7.589844 C 93.207031 7.980469 93.101562 8.203125 92.855469 8.503906 C 92.359375 8.820312 91.824219 8.777344 91.253906 8.777344 C 91.101562 8.777344 91.101562 8.777344 90.945312 8.777344 C 90.730469 8.777344 90.519531 8.777344 90.304688 8.777344 C 90.03125 8.777344 89.761719 8.777344 89.488281 8.78125 C 89.226562 8.78125 88.964844 8.78125 88.703125 8.78125 C 88.558594 8.78125 88.558594 8.78125 88.410156 8.785156 C 87.878906 8.777344 87.519531 8.761719 87.097656 8.425781 C 86.855469 8.101562 86.828125 7.824219 86.832031 7.433594 C 86.832031 7.375 86.832031 7.316406 86.828125 7.257812 C 86.828125 7.066406 86.828125 6.871094 86.832031 6.679688 C 86.832031 6.546875 86.828125 6.414062 86.828125 6.277344 C 86.828125 6 86.828125 5.71875 86.832031 5.4375 C 86.832031 5.078125 86.832031 4.71875 86.832031 4.363281 C 86.828125 4.085938 86.828125 3.808594 86.832031 3.53125 C 86.832031 3.398438 86.832031 3.269531 86.828125 3.136719 C 86.828125 2.949219 86.828125 2.765625 86.832031 2.582031 C 86.832031 2.523438 86.832031 2.472656 86.828125 2.414062 C 86.835938 1.964844 86.96875 1.71875 87.28125 1.410156 C 87.691406 1.160156 88.210938 1.226562 88.671875 1.230469 Z M 87.964844 2.382812 C 87.964844 4.113281 87.964844 5.847656 87.964844 7.628906 C 89.320312 7.628906 90.671875 7.628906 92.070312 7.628906 C 92.070312 5.898438 92.070312 4.167969 92.070312 2.382812 C 90.714844 2.382812 89.363281 2.382812 87.964844 2.382812 Z M 87.964844 2.382812 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(1.568628%,58.823532%,40.784314%);fill-opacity:1;" d="M 20.761719 1.273438 C 21.945312 1.273438 21.945312 1.273438 22.277344 1.546875 C 22.363281 1.671875 22.445312 1.792969 22.523438 1.921875 C 22.570312 1.988281 22.613281 2.054688 22.660156 2.121094 C 22.75 2.253906 22.839844 2.386719 22.929688 2.519531 C 23.089844 2.761719 23.265625 2.988281 23.445312 3.21875 C 23.507812 3.300781 23.570312 3.382812 23.632812 3.464844 C 24.019531 3.972656 24.40625 4.472656 24.796875 4.976562 C 24.949219 5.171875 25.105469 5.375 25.257812 5.570312 C 25.332031 5.671875 25.332031 5.671875 25.410156 5.773438 C 25.507812 5.898438 25.605469 6.027344 25.707031 6.152344 C 25.746094 6.210938 25.792969 6.265625 25.835938 6.324219 C 25.875 6.375 25.914062 6.425781 25.953125 6.480469 C 26.042969 6.59375 26.042969 6.59375 26.125 6.675781 C 26.152344 4.890625 26.179688 3.109375 26.207031 1.273438 C 26.570312 1.273438 26.933594 1.273438 27.308594 1.273438 C 27.308594 3.738281 27.308594 6.203125 27.308594 8.742188 C 26.207031 8.742188 26.207031 8.742188 25.945312 8.546875 C 25.855469 8.417969 25.855469 8.417969 25.773438 8.273438 C 25.703125 8.171875 25.632812 8.070312 25.5625 7.964844 C 25.527344 7.910156 25.488281 7.855469 25.453125 7.800781 C 25.25 7.5 25.023438 7.21875 24.800781 6.933594 C 24.707031 6.8125 24.613281 6.691406 24.519531 6.570312 C 24.328125 6.320312 24.136719 6.074219 23.945312 5.824219 C 23.527344 5.285156 23.105469 4.742188 22.691406 4.195312 C 22.601562 4.082031 22.601562 4.082031 22.511719 3.964844 C 22.320312 3.707031 22.132812 3.441406 21.945312 3.179688 C 21.921875 5.015625 21.894531 6.851562 21.867188 8.742188 C 21.503906 8.742188 21.140625 8.742188 20.761719 8.742188 C 20.761719 6.277344 20.761719 3.8125 20.761719 1.273438 Z M 20.761719 1.273438 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(1.568628%,58.431375%,41.176471%);fill-opacity:1;" d="M 71.167969 1.273438 C 72.9375 1.273438 74.707031 1.273438 76.53125 1.273438 C 76.53125 1.636719 76.53125 2.003906 76.53125 2.382812 C 75.125 2.382812 73.71875 2.382812 72.269531 2.382812 C 72.269531 3.066406 72.269531 3.746094 72.269531 4.449219 C 73.46875 4.449219 74.664062 4.449219 75.898438 4.449219 C 75.898438 4.816406 75.898438 5.183594 75.898438 5.5625 C 74.699219 5.5625 73.503906 5.5625 72.269531 5.5625 C 72.269531 6.246094 72.269531 6.925781 72.269531 7.628906 C 73.675781 7.628906 75.082031 7.628906 76.53125 7.628906 C 76.53125 7.996094 76.53125 8.363281 76.53125 8.742188 C 74.757812 8.742188 72.988281 8.742188 71.167969 8.742188 C 71.167969 6.277344 71.167969 3.8125 71.167969 1.273438 Z M 71.167969 1.273438 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(1.568628%,58.823532%,40.784314%);fill-opacity:1;" d="M 59.1875 1.261719 C 59.34375 1.265625 59.34375 1.265625 59.496094 1.265625 C 59.597656 1.265625 59.699219 1.269531 59.804688 1.269531 C 59.882812 1.269531 59.960938 1.269531 60.042969 1.273438 C 60.308594 1.84375 60.550781 2.421875 60.769531 3.011719 C 60.800781 3.09375 60.832031 3.175781 60.863281 3.257812 C 60.960938 3.515625 61.054688 3.773438 61.152344 4.035156 C 61.285156 4.390625 61.421875 4.746094 61.554688 5.101562 C 61.585938 5.191406 61.621094 5.277344 61.652344 5.367188 C 61.847656 5.886719 62.046875 6.40625 62.246094 6.921875 C 62.269531 6.980469 62.292969 7.039062 62.3125 7.101562 C 62.417969 7.367188 62.519531 7.628906 62.625 7.894531 C 62.660156 7.984375 62.691406 8.074219 62.730469 8.167969 C 62.773438 8.285156 62.773438 8.285156 62.820312 8.402344 C 62.882812 8.582031 62.882812 8.582031 62.882812 8.742188 C 62.519531 8.742188 62.15625 8.742188 61.777344 8.742188 C 61.492188 8.191406 61.296875 7.664062 61.070312 7.074219 C 59.46875 7.035156 59.46875 7.035156 57.835938 6.992188 C 57.808594 7.125 57.785156 7.253906 57.757812 7.390625 C 57.722656 7.496094 57.6875 7.601562 57.648438 7.703125 C 57.628906 7.761719 57.605469 7.816406 57.585938 7.875 C 57.554688 7.957031 57.554688 7.957031 57.519531 8.046875 C 57.5 8.105469 57.476562 8.164062 57.453125 8.222656 C 57.292969 8.652344 57.292969 8.652344 57.203125 8.742188 C 57.019531 8.746094 56.832031 8.75 56.648438 8.746094 C 56.496094 8.746094 56.496094 8.746094 56.339844 8.746094 C 56.261719 8.742188 56.183594 8.742188 56.101562 8.742188 C 56.148438 8.46875 56.214844 8.222656 56.316406 7.964844 C 56.34375 7.890625 56.371094 7.816406 56.398438 7.742188 C 56.445312 7.625 56.445312 7.625 56.492188 7.503906 C 56.523438 7.417969 56.554688 7.335938 56.589844 7.25 C 56.695312 6.976562 56.800781 6.703125 56.902344 6.433594 C 56.976562 6.246094 57.046875 6.058594 57.117188 5.871094 C 57.261719 5.496094 57.40625 5.121094 57.550781 4.746094 C 57.710938 4.335938 57.867188 3.925781 58.023438 3.515625 C 58.125 3.25 58.226562 2.980469 58.332031 2.710938 C 58.378906 2.589844 58.425781 2.46875 58.472656 2.34375 C 58.539062 2.175781 58.601562 2.007812 58.667969 1.839844 C 58.703125 1.746094 58.738281 1.652344 58.777344 1.558594 C 58.894531 1.273438 58.894531 1.273438 59.1875 1.261719 Z M 59.414062 2.941406 C 59.257812 3.347656 59.097656 3.753906 58.941406 4.160156 C 58.886719 4.296875 58.835938 4.433594 58.78125 4.574219 C 58.703125 4.769531 58.625 4.96875 58.550781 5.167969 C 58.527344 5.230469 58.5 5.292969 58.476562 5.355469 C 58.359375 5.613281 58.359375 5.613281 58.308594 5.878906 C 59.089844 5.878906 59.871094 5.878906 60.675781 5.878906 C 60.335938 4.886719 59.964844 3.914062 59.570312 2.941406 C 59.519531 2.941406 59.464844 2.941406 59.414062 2.941406 Z M 59.414062 2.941406 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(1.960784%,58.431375%,41.176471%);fill-opacity:1;" d="M 29.832031 1.273438 C 31.628906 1.273438 33.425781 1.273438 35.277344 1.273438 C 35.277344 1.636719 35.277344 2.003906 35.277344 2.382812 C 33.871094 2.382812 32.464844 2.382812 31.015625 2.382812 C 31.015625 3.066406 31.015625 3.746094 31.015625 4.449219 C 32.214844 4.449219 33.410156 4.449219 34.644531 4.449219 C 34.644531 4.816406 34.644531 5.183594 34.644531 5.5625 C 33.449219 5.5625 32.25 5.5625 31.015625 5.5625 C 31.015625 6.613281 31.015625 7.660156 31.015625 8.742188 C 30.625 8.742188 30.238281 8.742188 29.832031 8.742188 C 29.832031 6.277344 29.832031 3.8125 29.832031 1.273438 Z M 29.832031 1.273438 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(1.568628%,58.823532%,40.784314%);fill-opacity:1;" d="M 63.277344 1.273438 C 65.257812 1.273438 67.234375 1.273438 69.273438 1.273438 C 69.273438 1.636719 69.273438 2.003906 69.273438 2.382812 C 68.464844 2.382812 67.660156 2.382812 66.828125 2.382812 C 66.828125 4.484375 66.828125 6.578125 66.828125 8.742188 C 66.460938 8.742188 66.097656 8.742188 65.722656 8.742188 C 65.722656 6.644531 65.722656 4.546875 65.722656 2.382812 C 64.914062 2.382812 64.109375 2.382812 63.277344 2.382812 C 63.277344 2.015625 63.277344 1.648438 63.277344 1.273438 Z M 63.277344 1.273438 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(1.568628%,58.823532%,40.784314%);fill-opacity:1;" d="M 95.066406 1.273438 C 97.019531 1.273438 98.96875 1.273438 100.980469 1.273438 C 100.980469 1.636719 100.980469 2.003906 100.980469 2.382812 C 100.199219 2.382812 99.417969 2.382812 98.613281 2.382812 C 98.613281 4.484375 98.613281 6.578125 98.613281 8.742188 C 98.25 8.742188 97.886719 8.742188 97.511719 8.742188 C 97.511719 6.644531 97.511719 4.546875 97.511719 2.382812 C 96.703125 2.382812 95.898438 2.382812 95.066406 2.382812 C 95.066406 2.015625 95.066406 1.648438 95.066406 1.273438 Z M 95.066406 1.273438 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(1.568628%,58.431375%,41.176471%);fill-opacity:1;" d="M 17.136719 1.273438 C 17.5 1.273438 17.863281 1.273438 18.238281 1.273438 C 18.238281 3.738281 18.238281 6.203125 18.238281 8.742188 C 17.875 8.742188 17.511719 8.742188 17.136719 8.742188 C 17.136719 6.277344 17.136719 3.8125 17.136719 1.273438 Z M 17.136719 1.273438 "/>\n<path style=" stroke:none;fill-rule:nonzero;fill:rgb(26.666668%,73.725492%,29.411766%);fill-opacity:1;" d="M 3.960938 4.449219 C 4.457031 4.449219 4.953125 4.449219 5.460938 4.449219 C 5.460938 5.078125 5.460938 5.707031 5.460938 6.359375 C 6.082031 6.355469 6.082031 6.355469 6.699219 6.351562 C 6.777344 6.351562 6.851562 6.351562 6.933594 6.351562 C 7.050781 6.347656 7.050781 6.347656 7.171875 6.347656 C 7.355469 6.359375 7.355469 6.359375 7.433594 6.4375 C 7.433594 6.910156 7.433594 7.382812 7.433594 7.867188 C 6.289062 7.867188 5.140625 7.867188 3.960938 7.867188 C 3.960938 6.738281 3.960938 5.613281 3.960938 4.449219 Z M 3.960938 4.449219 "/>\n</g>\n</svg>'}formatMessageContent(e){return e||""}}class ChatbotStyles{constructor(e){this.config=e}getStyles(){return`\n ${this.getHostStyles()}\n ${this.getLayoutStyles()}\n ${this.getTriggerStyles()}\n ${this.getWindowStyles()}\n ${this.getHeaderStyles()}\n ${this.getMessagesStyles()}\n ${this.getTypingStyles()}\n ${this.getQuickRepliesStyles()}\n ${this.getInputStyles()}\n ${this.getPoweredByStyles()}\n ${this.getInputCollectorStyles()}\n ${this.getAnimationStyles()}\n ${this.getResponsiveStyles()}\n ${this.getAccessibilityStyles()}\n `}getHostStyles(){const e="bottom-left"===this.config.position?"bottom: 20px; left: 20px;":"bottom: 20px; right: 20px;";return`\n :host {\n ${this.getCssVarDeclarations()}\n \n display: block;\n position: fixed;\n ${e}\n z-index: 999999;\n font-family: var(--chatbot-font);\n font-size: 14px;\n line-height: 1.5;\n box-sizing: border-box;\n \n color: var(--chatbot-text);\n background: transparent;\n border: none;\n margin: 0;\n padding: 0;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: border-box;\n }\n\n .${s.trigger}:focus-visible,\n .${s.closeButton}:focus-visible,\n .${s.sendButton}:focus-visible,\n .${s.quickReply}:focus-visible {\n border-color: var(--chatbot-primary);\n }\n `}getLayoutStyles(){return`\n .position-bottom-right {\n bottom: 20px;\n right: 20px;\n }\n\n .position-bottom-left {\n bottom: 20px;\n left: 20px;\n }\n\n .size-small {\n --chatbot-width: ${l}px;\n --chatbot-height: ${c}px;\n }\n\n .size-medium {\n --chatbot-width: ${d}px;\n --chatbot-height: ${h}px;\n }\n\n .size-large {\n --chatbot-width: ${p}px;\n --chatbot-height: ${u}px;\n }\n\n .size-xl {\n --chatbot-width: ${g}px;\n --chatbot-height: ${m}px;\n }\n `}getTriggerStyles(){return`\n .${s.trigger} {\n width: 60px;\n height: 60px;\n background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);\n border: none;\n border-radius: 50%;\n cursor: pointer;\n box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.3s ease;\n color: white;\n outline: none;\n position: relative;\n overflow: hidden;\n }\n\n .${s.trigger}::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);\n opacity: 0;\n transition: opacity 0.2s ease;\n }\n\n .${s.trigger}:hover {\n transform: scale(1.1);\n box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);\n }\n\n .${s.trigger}:hover::before {\n opacity: 1;\n }\n\n .${s.trigger}:active {\n transform: scale(0.95);\n }\n\n .${s.trigger} svg {\n width: 24px;\n height: 24px;\n fill: currentColor;\n transition: transform 0.2s ease;\n }\n\n .${s.trigger}:hover svg {\n transform: scale(1.1);\n }\n `}getWindowStyles(){return`\n .${s.window} {\n position: absolute;\n bottom: 80px;\n width: var(--chatbot-width);\n height: var(--chatbot-height);\n background: var(--chatbot-bg);\n border-radius: var(--chatbot-radius);\n box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);\n border: 1px solid var(--chatbot-border);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n transform: translateY(20px) scale(0.9);\n opacity: 0;\n visibility: hidden;\n transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);\n backdrop-filter: blur(10px);\n }\n\n .${s.window}.${s.windowActive} {\n transform: translateY(0) scale(1);\n opacity: 1;\n visibility: visible;\n }\n\n .position-bottom-right .${s.window} { \n right: 0; \n }\n \n .position-bottom-left .${s.window} { \n left: 0; \n }\n `}getHeaderStyles(){return`\n .${s.header} {\n background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);\n color: white;\n padding: 20px;\n display: flex;\n align-items: center;\n gap: 12px;\n position: relative;\n overflow: hidden;\n }\n\n .${s.header}::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);\n transform: translateX(-100%);\n animation: shimmer 3s ease-in-out infinite;\n }\n\n @keyframes shimmer {\n 0% { transform: translateX(-100%); }\n 50% { transform: translateX(100%); }\n 100% { transform: translateX(100%); }\n }\n\n .${s.botAvatar} {\n width: 40px;\n height: 40px;\n background: rgba(255, 255, 255, 0.2);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n backdrop-filter: blur(5px);\n }\n\n .${s.botAvatar} svg {\n width: 18px;\n height: 18px;\n fill: currentColor;\n }\n\n .${s.botInfo} {\n flex: 1;\n min-width: