import{j as a}from"./vendor-mui-69397583.js";import{Y as A,l as D,O as S,Q as E,d as $,A as n,D as v,H as w}from"./index-c62ac197.js";import{r}from"./vendor-react-ece1c85f.js";import{u as l,C as M,M as I,r as O,h as P,t as m,c as R}from"./MessageInput-6dc83761.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./index-42e65911.js";import"./useDeviceCheck-920641a5.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import"./useControllableState-d0909575.js";import"./index-c2088808.js";import"./useDidUpdate-25c4d4ed.js";import"./Drawer-949c18c6.js";import"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import"./Upload-fb34ce03.js";import"./BrainServices-a4bb698e.js";import"./index-f6be0390.js";const d="/img/logo/";A("aiChat",O);const ia=g=>{const t=D(),c=l(s=>s.aiChat.data.error),h=l(s=>s.aiChat.data.isChatDialog);l(s=>s.aiChat.data);const[f,u]=r.useState("");r.useEffect(()=>{(async()=>{try{const e=await w.get("https://api.ipify.org?format=json");u(e.data.ip),console.log("response.data.ip",e.data.ip)}catch(e){console.error(e)}})()},[]);const C=()=>{t(P({file:"",fileName:"",fileType:""})),t(m(!0))},p=()=>{t(m(!1))};r.useEffect(()=>{c&&S.push(a.jsx(E,{title:"Error",type:"danger",duration:2500,children:"Something went wrong. Please try again later."}),{placement:"top-center"})},[c]);const x=s=>{t(R({message:s,ipAddress:f}))},{type:_="full",mode:o="light",className:j,imgClass:i,style:N,logoWidth:y="auto"}=g;return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:$("aica",j),style:{...N,width:y},onClick:()=>C(),children:a.jsx("img",{className:i,src:`${d}aica.svg`,alt:`${n} logo`,style:{fill:`${o}`}})}),a.jsx(v,{isOpen:h,portalClassName:"aica-dialog",contentClassName:"h-auto p-0",closable:!1,onClose:p,onRequestClose:p,children:a.jsxs("div",{className:"p-4",children:[a.jsx("div",{className:"aica-m-logo",children:a.jsx("img",{style:{fill:`${o}`},className:i,src:`${d}aica.svg`,alt:`${n} logo`})}),a.jsx(M,{mode:o,imgClass:i}),a.jsx(I,{onSendMessage:x})]})})]})};export{ia as default};
