(()=>{if("loading"===document.readyState)return;let e=document.createElement("div");e.id="4dbe1c3f-2515-45a5-b1ff-012823468aa7",e.classList.add("typingmind-chat-widget-button"),document.body.appendChild(e);var t=document.currentScript||(t=document.getElementsByTagName("script"))[t.length-1],i=t.getAttribute("data-external-auth-code"),l=t.getAttribute("data-agent");let s=!1,n=!1,o=!1,r=document.createElement("img"),d=(r.src="proxy.php?url=https://www.typingmind.com/logo.png",r.onclick=function(){o||(n=!0,c.style.display="block",o=!0),s=!0,g()},r.style.position="fixed",r.style.bottom="16px",r.style.right="16px",r.style.width="55px",r.style.height="55px",r.style.borderRadius="50%",r.style.cursor="pointer",r.style.zIndex="1000",r.style.boxShadow="rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px",document.createElement("div"));d.style.position="fixed",d.style.bottom="85px",d.style.right="16px",d.style.padding="15px",d.style.background="white",d.style.borderRadius="9px",d.style.boxShadow="rgba(0, 0, 0, 0.1) 0px 0px 5px 0px, rgba(0, 0, 0, 0.1) 0px 0px 1px 0px",d.style.zIndex="1000",d.style.visibility="block";var a=document.createElement("div"),p=(a.style.width="100%",a.style.height="100%",a.style.position="relative",a.innerText="👋 Questions? Chat with our AI!",a.style.fontSize="14px",a.style.lineHeight="20px",a.style.fontFamily="ui-sans-serif, system-ui, -apple-system",document.createElement("span"));p.innerHTML="×",p.style.fontWeight="400",p.style.cursor="pointer",p.style.position="absolute",p.style.top="-20px",p.style.right="-20px",p.style.borderRadius="50%",p.style.background="rgb(243 244 246)",p.style.border="1px solid rgb(229 231 235)",p.style.padding="2px",p.style.width="17px",p.style.height="17px",p.style.display="flex",p.style.alignItems="center",p.style.justifyContent="center",a.appendChild(p),d.appendChild(a),p.onclick=function(){d.style.visibility="hidden"};let y=document.createElement("div"),x=(y.innerHTML=` `,y.style.backgroundImage='linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("https://www.typingmind.com/logo.png")',y.style.backgroundSize="contain",y.onclick=function(){s=!1,g()},y.onmouseover=function(){this.firstChild.style.transform="rotate(90deg)"},y.onmouseout=function(){this.firstChild.style.transform="rotate(0deg)"},y.style.position="fixed",y.style.bottom="16px",y.style.right="16px",y.style.width="55px",y.style.height="55px",y.style.borderRadius="50%",y.style.cursor="pointer",y.style.display="flex",y.style.alignItems="center",y.style.justifyContent="center",y.style.zIndex="1000",y.style.boxShadow="rgba(0, 0, 0, 0.3) 0px 10px 15px -3px, rgba(0, 0, 0, 0.1) 0px 4px 6px -2px",document.createElement("div"));x.style.position="fixed",x.style.bottom="85px",x.style.right="16px",x.style.maxWidth="23rem",x.style.zIndex="1000",x.style.overflowY="auto",x.style.marginLeft="1rem",x.style.width="90%",x.style.boxShadow="0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.1)",x.style.borderRadius="0.5rem",x.style.border="1px solid #F3F4F6",x.style.height="65%";a=document.createElement("div"),a.style.position="relative",a.style.overflow="hidden",a.style.borderRadius="0.5rem",a.style.backgroundColor="#F9FAFB",a.style.textAlign="left",a.style.transition="all",a.style.height="100%",a.style.width="100%",a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="center",a.style.border="unset",p=document.createElement("style");p.innerHTML=` .loader { border: 6px solid #f3f3f3; border-top: 6px solid rgb(37 99 235); border-radius: 50%; width: 30px; height: 30px; animation: spin 2s linear infinite; position: absolute; right: 1/2; bottom: 50%; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } `,document.head.appendChild(p);let h={externalAuthCode:i,agent:l};p=Object.keys(h).filter(e=>h[e]).map(e=>e+"="+h[e]).join("&");let c=document.createElement("iframe");function g(){for(;e.firstChild;)e.removeChild(e.firstChild);s?(e.appendChild(y),e.appendChild(x)):(e.appendChild(r),e.appendChild(d))}c.src="proxy.php?url=https://typingmindfaq.typingcloud.com"+(p?"?"+p:""),c.style.display="none",c.allow="microphone",c.onload=function(){n=!1},n?c.style.display="none":c.style.display="block",c.style.border="unset",c.style.width="100%",c.style.height="100%",a.appendChild(c),x.appendChild(a),g()})();