"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[735,4977],{24977:(n,e,t)=>{t.d(e,{A:()=>p});var r=t(95155),o=t(72131),i=t(16150),a=t(20772),s=t(18648),l=t(22837),c=t(43973),d=t(83194),h=t(12115);let A=(0,l.A)(),p=n=>{let{isOpen:e,activeTab:t,messages:l,setMessages:p,onClose:g}=n;return(0,h.useEffect)(()=>{"enquiry"===t&&p([])},[t]),(0,r.jsx)(o.Ay,{anchor:"right",open:e,onClose:g,sx:{"& .MuiDrawer-paper":{width:"chat"===t?"388px":"auto",height:"100vh",borderTopLeftRadius:"12px",borderTopRightRadius:"12px",padding:"12px",paddingTop:(()=>{switch(t){case"enquiry":return"24px";case"chat":return"98px";default:return"20px"}})(),transition:"width 0.3s ease-in-out"}},children:(0,r.jsxs)(i.A,{sx:{maxHeight:"90vh",overflowY:"auto",position:"relative","&::-webkit-scrollbar":{width:0,height:0},"&::-webkit-scrollbar-thumb":{background:"transparent"},"&::-webkit-scrollbar-track":{background:"transparent"}},role:"presentation",children:[(0,r.jsx)("button",{onClick:g,className:"absolute ".concat("chat"===t?"top-[-12px]":"top-[64px]"," right-[2px] bg-[white] p-1 border-none"),children:(0,r.jsx)(a.default,{fontSize:"large"})}),(0,r.jsxs)(s.Kq,{store:A,children:["enquiry"===t&&(0,r.jsx)(c.A,{open:e}),"chat"===t&&(0,r.jsx)(d.A,{messages:l,setMessages:p})]},t)]})})}},41058:(n,e,t)=>{t.d(e,{A:()=>r});let r={src:"https://static.rivexa.com/_next/static/media/send.50847591.png",height:24,width:25,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAIVBMVEVMaXH///////////////////////////////////////8c1D1MAAAAC3RSTlMALoh9QBVdbwoir3LOxHsAAAAJcEhZcwAACxMAAAsTAQCanBgAAAA0SURBVHicHcrJDcAwDMAw+kicdv+Bi/QnQITTDTG5q5kJepNWqSDyjZPXqHXP1VnrD/HgAxYzAI5nhF/qAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}},69442:(n,e,t)=>{t.d(e,{A:()=>a});var r=t(15933),o=t(13380);function i(){let n=(0,r._)(['\n  .chatbotbody {\n    position: relative;\n    background: #ffffff;\n    --tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);\n    --tw-shadow-colored: 0 50px 75px -12px var(--tw-shadow-color);\n    box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000),\n      var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n    border-radius: 20px; /* Rounded corners */\n    overflow: hidden; /* Prevent scroll */\n  }\n\n  .chatbotheader {\n    position: relative;\n    left: 0px;\n    top: 0px;\n    margin: auto;\n    padding: 1.8rem 0rem;\n    background: linear-gradient(87.2deg, #4a3587 -2.53%, #120d21 152.2%);\n  }\n  .chatbotsubheader {\n    position: absolute;\n    display: flex;\n    flex-direction: row;\n    gap: 5rem;\n    text-align: center;\n    margin: auto;\n    box-sizing: border-box;\n    padding: 2.5242px 24px;\n    background: #ffffff;\n    border-bottom: 0.544126px solid #4a3587;\n    box-shadow: 0px 0px 56.4831px rgba(0, 0, 0, 0.05);\n    border-radius: 9.68282px;\n    align-items: center;\n    justify-content: center;\n    left: 50%;\n    top: 3.5rem;\n    transform: translate(-50%, -50%);\n  }\n  .chatbotsubheaderdiv {\n    display: flex;\n    flex-direction: column;\n  }\n  .chatbotsubheaderdiv button {\n    background: transparent;\n    border: none;\n    cursor: pointer;\n  }\n  .chatbotsubheaderimage {\n    height: 100%;\n    width: 100%;\n  }\n  .chatmessagebody {\n    margin: auto;\n    text-align: center;\n    position: relative;\n    height: 100%;\n  }\n  .enquiryparentdiv {\n    padding: 2rem;\n    height: 60vh;\n    overflow-x: hidden;\n    overflow-y: scroll;\n  }\n  .userChatSection {\n    align-items: center;\n    padding: 10px;\n    gap: 8px;\n    background: #d9ddff;\n    border-radius: 12px;\n    font-family: Arial;\n    font-size: 18px;\n    font-weight: 400;\n  }\n  .robotchatsection {\n    align-items: center;\n    padding: 10px;\n    gap: 8px;\n    background: #4a3587;\n    border-radius: 12px;\n    color: white;\n    font-family: Arial;\n    font-size: 18px;\n    font-weight: 400;\n  }\n  .hithere {\n    font-family: "Chillax";\n    font-style: normal;\n    font-weight: 600;\n    font-size: 20.1679px;\n    line-height: 120%;\n    color: #524646;\n    opacity: 0.7;\n  }\n  .howcanwehelp {\n    font-family: "Chillax";\n    font-style: normal;\n    font-weight: 600;\n    font-size: 20.1679px;\n    line-height: 120%;\n    color: #4a3587;\n  }\n  .allserviceenquiry {\n    font-family: "Chillax";\n    font-style: normal;\n    font-weight: 600;\n    font-size: 16px;\n    line-height: 120%;\n    color: #4a3587;\n  }\n  .emptysubtext {\n    font-family: "Urbanist";\n    font-style: normal;\n    font-weight: 400;\n    font-size: 8.8976px;\n    line-height: 120%;\n    color: #463333;\n  }\n  .chatinputfield {\n    position: fixed;\n    bottom: -30px;\n    left: 16px;\n    width: 92%;\n    transform: translate(0, -50%);\n    margin: auto;\n    text-align: center;\n  }\n\n  .chatinputfield div {\n    position: relative;\n  }\n  .inputfield {\n    align-items: center;\n    padding: 11.8635px;\n    gap: 17.8px;\n    width: 90%;\n    height: 44px;\n    left: 20px;\n    background: #fafafa;\n  }\n  .chatbutton {\n    position: absolute;\n    bottom: 15px;\n    right: 25px;\n    background: transparent;\n    border: none;\n    cursor: pointer;\n  }\n  .buttonimage {\n    width: 35px;\n  }\n  .faqparentdiv {\n    height: 110vh;\n    overflow-x: hidden;\n    overflow-y: scroll;\n    border: none;\n    position: relative;\n  }\n  .faqchatinput {\n    padding: 16px 20px;\n    align-items: center;\n    gap: 10px;\n    border-radius: 4px;\n    background: #f5f5f5;\n  }\n  .faqchatinput::placeholder {\n    color: #c5c0db;\n    font-family: "Chillax Semibold";\n    font-size: 16px;\n    font-style: normal;\n    font-weight: 400;\n    line-height: 24px;\n  }\n  .faqquestions {\n    font-family: Arial;\n    font-style: normal;\n    font-weight: 500;\n    line-height: 30px;\n  }\n  .faqanswerchat {\n    color: #8896ab;\n    font-family: Arial;\n    font-style: normal;\n    font-weight: 500;\n    line-height: 24px;\n  }\n  .middlefaqmainchat {\n    background: #ffffff;\n    box-shadow: 0px 7.25532px 14.5106px rgba(75, 52, 37, 0.05);\n    border-radius: 1119.13px;\n    flex: none;\n    order: 1;\n    align-self: stretch;\n    flex-grow: 0;\n  }\n  .MuiAccordion-root {\n    box-shadow: none;\n    position: inherit;\n  }\n  .faqsectionchat {\n    overflow: hidden;\n  }\n  .faqsectionchat:hover {\n    scroll-behavior: smooth;\n    overflow-y: scroll;\n    overflow-x: hidden;\n  }\n  .faqsectionchat::-webkit-scrollbar {\n    width: 5px;\n    background-color: #2a3342;\n    color: white;\n  }\n  .faqsectionchat::-webkit-scrollbar-thumb {\n    background-color: #2a3342;\n    color: white;\n    border-radius: 5px;\n  }\n  .faqsectionchat::-moz-scrollbar {\n    width: 5px;\n  }\n  .faqsectionchat::-moz-scrollbar-thumb {\n    background-color: #2a3342;\n    color: white;\n    border-radius: 5px;\n  }\n  .differentform > h2 > button > .MuiSvgIcon-root {\n    display: none;\n  }\n  .differentform > h2 {\n    background: #fff;\n  }\n  .differentform .MuiDialogContent-root {\n    background: #fff;\n  }\n']);return i=function(){return n},n}let a=()=>(0,o.AH)(i())},75334:(n,e,t)=>{t.d(e,{A:()=>r});let r={src:"https://static.rivexa.com/_next/static/media/user-chat-icon.f9bb5e6e.png",height:43,width:44,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAM1BMVEXw8PDp6ent7ezHyMn08/NMaXHq6uqMjo/s7Ozs7Ozo6OjMzM3MzMzj4+P9/f2ztLWam51YJogqAAAADXRSTlP9PrT+wQDx/Tb3wfr6fgq0TwAAAAlwSFlzAAALEwAACxMBAJqcGAAAADlJREFUeJwFwYkBwCAIALFTeW1B95/WBI0NO5RBr9UMpD/3v4Wk7i2S5LgfEimv8hKGAVigMc1m6AM+pwGv2ajtXgAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}},83194:(n,e,t)=>{t.d(e,{A:()=>x});var r=t(41364),o=t(12115),i=t(66766),a=t(38637),s=t.n(a),l=t(62179),c=t.n(l),d=t(2518),h=t(91217),A=t(75334),p=t(94076),g=t(41058),f=t(69442);let u=()=>{let[n,e]=(0,o.useState)(""),t=null;return(0,o.useEffect)(()=>(t=setTimeout(()=>{3===n.length?e(""):e(e=>e+"..."[n.length])},500),()=>clearTimeout(t)),[n]),(0,r.Y)("div",{className:"align-middle justify-center items-center w-6 h-6 text-primaryWhite text-[2rem] relative -top-3.5",children:n})},m=n=>{let{messageContent:e,onTypingEnd:t}=n,[i,a]=(0,o.useState)("..."),[s,l]=(0,o.useState)(0);return(0,o.useEffect)(()=>{a(""),setTimeout(()=>{a(e),l(n=>n+1)},500)},[e]),(0,r.Y)(c(),{onInit:n=>{n.typeString(i).callFunction(()=>{setTimeout(()=>{document.querySelectorAll(".Typewriter__cursor").forEach(n=>{n.style.display="none"})},100)}).pauseFor(1e3).callFunction(()=>{t()}).start()},options:{delay:10,cursor:"|",deleteSpeed:5}},s)};m.propTypes={messageContent:s().string.isRequired,onTypingEnd:s().func.isRequired};let b=n=>{let{messages:e,setMessages:t}=n,[a,s]=(0,o.useState)(""),[l,c]=(0,o.useState)(!1),[b]=(0,d.Mk)(),x=(0,o.useRef)(null),w=()=>{var n;null===(n=x.current)||void 0===n||n.scrollIntoView({behavior:"smooth"})};(0,o.useEffect)(()=>{w()},[e]);let v=async()=>{if(c(!0),a){let n=[{id:e.length+1,type:"user",isUser:!0,content:a},{id:e.length+2,type:"robot",isUser:!1,content:"...",isLoading:!0,isDisplayed:!1}];t(e=>[...e,...n]);try{let{data:e}=await b({query:a}),r=[{...n[0]},{...n[1],content:(null==e?void 0:e.response)||"No response",isLoading:!1}];t(n=>{let e=[...n];return e.splice(-2,2,...r),e})}catch(n){console.error("Error fetching API response:",n)}finally{s(""),setTimeout(()=>c(!1),1e3)}}};return(0,r.Y)(r.FK,{children:(0,r.FD)("div",{css:f.A,classname:"",children:[(0,r.FD)("div",{className:"chatmessagebody",children:[0===e.length&&(0,r.FD)("div",{className:"p-8 overflow-x-hidden overflow-y-scroll h-[50vh] md:h-[70vh] lg:h-[70vh] xs:mt-10 mt-0 md:mt-0",children:[(0,r.Y)(i.default,{src:h.A,alt:"EmptyBotIcon",className:"mt-7"}),(0,r.Y)("div",{className:"grid grid-cols-1 m-auto text-center justify-center",children:(0,r.Y)("div",{className:"howcanwehelp",children:"Hi there, I am riv! How can I help you?"})})]}),e.length>0&&(0,r.FD)("div",{className:"p-8 xs:p-12 md:p-8  overflow-x-hidden overflow-y-scroll h-[50vh] md:h-[70vh] lg:h-[70vh] xs:mt-10 mt-0 md:mt-0",children:[e.map((n,e)=>(0,r.FD)("div",{className:"w-full inline-flex flex-row justify-start items-start text-left gap-5 space-y-8",children:[(0,r.Y)("div",{className:"flex-shrink-0 self-start relative top-7",children:(0,r.Y)(i.default,{src:n.isUser?A.A:p.A,alt:n.isUser?"UserChatIcon":"RobotChatIcon",className:"w-8 h-8"})}),(0,r.Y)("div",{className:"".concat(n.isUser?"userChatSection":"robotchatsection"),children:n.isUser?n.content:n.isLoading?(0,r.Y)(u,{}):n.isDisplayed?(0,r.Y)("div",{dangerouslySetInnerHTML:{__html:n.content}}):(0,r.Y)(m,{messageContent:n.content,onTypingEnd:()=>{t(n=>{let t=[...n];return t[e].isDisplayed=!0,t})}})})]},n.id)),(0,r.Y)("div",{ref:x})]})]}),(0,r.FD)("div",{className:"chatinputfield",children:[(0,r.FD)("div",{children:[(0,r.Y)("input",{placeholder:"",value:a,onChange:n=>s(n.target.value),onKeyDown:n=>{"Enter"===n.key&&v()},className:" placeholder:text-grayLight placeholder:text-lg placeholder:font-medium placeholder:font-['Urbanist'] bg-[#FAFAFA] rounded-3xl w-[80%] h-14 shadow-md focus:outline-none indent-5"}),(0,r.Y)("button",{type:"button",onClick:v,disabled:""===a||l,className:"cursor-pointer flex justify-center items-center m-auto p-2 border-none absolute rounded-full bg-[#856ACF] top-3 right-[1rem] xs:right-[3.5rem] sm:right-[2.5rem] ssm:right-[3rem] md:right-[6rem] lg:right-[6rem]",children:(0,r.Y)(i.default,{src:g.A,alt:"SendIcon"})})]}),(0,r.Y)("small",{className:"text-[12px] italic",children:"The response has been generated through AI and may not be correct at all times. Please use your discretion."})]})]})})};b.defaultProps={messages:[],setMessages:()=>{}},b.propTypes={messages:s().array,setMessages:s().func};let x=b},91217:(n,e,t)=>{t.d(e,{A:()=>r});let r={src:"https://static.rivexa.com/_next/static/media/empty_bot_icon.e92a953a.png",height:196,width:155,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAICAMAAADtGH4KAAAARVBMVEVMaXHc09Pv7euZmZn6+vrq6unp6enGxsbb29vV1taHh4exsbHc3Nu5ubm+w8Lx8fH///+qs7KxvLqlsbCmrq1yiYgqTktdibVvAAAAFXRSTlMATPsZL+0LrhyeMcaOkopgCOfZ5rLQBqOKAAAACXBIWXMAAAsTAAALEwEAmpwYAAAANklEQVR4nBXFSRKAIAwAwWFNIgrK4v+fStGXhuheII41T+vvGaifA1rypor5ZEV4RPIVuBVgAyjAAVlq1ApqAAAAAElFTkSuQmCC",blurWidth:6,blurHeight:8}},94076:(n,e,t)=>{t.d(e,{A:()=>r});let r={src:"https://static.rivexa.com/_next/static/media/chat-icon.fc6fd481.png",height:43,width:44,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAATlBMVEXo5+fr4ubu5s3c5ujo6enp6+vs7vHx7u1MaXHv8PC/4O+53efr7Oz3+vz/+vryp8Tl09iS0chpzbzr4brv0lXj2Ih6zubO28FPw/K33tcnpKzQAAAADXRSTlM7/v39vvr3+ADC/v7Aw/HA9gAAAAlwSFlzAAALEwAACxMBAJqcGAAAAD9JREFUeJwFwYkRgDAIAMHLC+iAib/9N+ouShWpKPRYlxCwKO+T3ZBv3td5dKTscxu5YyFja24gnpILKLW1iv5V6QJHcHFAQAAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}}}]);