(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{1973:function(e,t,s){Promise.resolve().then(s.bind(s,3367))},3367:function(e,t,s){"use strict";s.d(t,{default:function(){return p}});var r=s(7437),n=s(2265),l=s(9725),a=s(3124),i=s(5432);function o(e){let t=(0,n.useRef)(null),{scene:s}=(0,i.L)("/kawaii_cute_flying_robot/scene.gltf");return(0,l.C)(e=>{t.current&&(t.current.position.y=.05*Math.sin(2*e.clock.elapsedTime))}),(0,r.jsx)("group",{ref:t,...e,dispose:null,children:(0,r.jsx)("primitive",{object:s,scale:.55})})}function c(e){let{onClick:t}=e;return(0,r.jsx)("div",{onClick:t,className:"  fixed bottom-2 right-1 z-[9999] w-24 h-24 cursor-pointer active:scale-90 transition-transform",children:(0,r.jsxs)(a.Xz,{camera:{position:[0,0,1.5],fov:45},children:[(0,r.jsx)("ambientLight",{intensity:1.8}),(0,r.jsx)("directionalLight",{position:[3,3,3],intensity:1.5}),(0,r.jsx)(o,{position:[0,-.1,0]})]})})}function p(){let[e,t]=(0,n.useState)(!1),[s,l]=(0,n.useState)([{role:"assistant",content:"Hello! I am SoftiqTech AI Agent. How can I help you today?"}]),[a,i]=(0,n.useState)(""),[o,p]=(0,n.useState)(!1),u=async()=>{if(!a.trim())return;let e={role:"user",content:a};l(t=>[...t,e]),i(""),p(!0);let t=await fetch("http://127.0.0.1:8000/assistant",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:a})}),s=await t.json();p(!1),l(e=>[...e,{role:"assistant",content:s.assistant_response}])};return(0,r.jsxs)(r.Fragment,{children:[!e&&(0,r.jsx)(c,{onClick:()=>t(!0)}),e&&(0,r.jsx)("div",{className:"fixed bottom-28 right-6 w-80 sm:w-96 z-[9999] animate-float",children:(0,r.jsxs)("div",{className:"backdrop-blur-lg bg-purple-900/30 border border-purple-700/60 rounded-3xl shadow-[0_0_30px_rgba(128,0,128,0.6)] flex flex-col overflow-hidden",children:[(0,r.jsxs)("div",{className:"px-4 py-3 bg-purple-800 flex justify-between items-center border-b border-purple-700/50",children:[(0,r.jsx)("h1",{className:"text-white font-bold text-lg tracking-wide drop-shadow-md ",children:"Sofi – AI Assistant"}),(0,r.jsx)("button",{onClick:()=>t(!1),className:"text-white text-xl font-bold hover:text-purple-300 transition",children:"✕"})]}),(0,r.jsxs)("div",{className:"p-3 h-80 overflow-y-auto space-y-4 scrollbar-thin scrollbar-thumb-purple-500 scrollbar-track-purple-900/20",children:[s.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-start gap-2 ".concat("user"===e.role?"flex-row-reverse":""),children:[(0,r.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center shadow-[0_0_10px_rgba(255,255,255,0.3)] ".concat("user"===e.role?"bg-gradient-to-tr from-purple-700 to-purple-500 text-white":"bg-purple-800 text-purple-200"),children:"user"===e.role?"\uD83E\uDDD1":"\uD83E\uDD16"}),(0,r.jsx)("div",{className:"p-3 rounded-2xl max-w-[70%] text-sm ".concat("user"===e.role?"bg-gradient-to-tr from-purple-600/90 to-purple-500/80 text-white shadow-[0_5px_15px_rgba(128,0,128,0.5)]":"bg-purple-800/70 text-purple-200 shadow-[0_5px_15px_rgba(0,0,0,0.4)]"),children:e.content})]},t)),o&&(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)("div",{className:"w-8 h-8 rounded-full bg-purple-800/70 flex items-center justify-center text-purple-200 shadow-[0_0_10px_rgba(255,255,255,0.3)]",children:"\uD83E\uDD16"}),(0,r.jsx)("div",{className:"bg-purple-800/70 text-purple-200 p-3 rounded-2xl max-w-[70%] shadow-[0_5px_15px_rgba(0,0,0,0.4)]",children:(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-white rounded-full animate-bounce"}),(0,r.jsx)("div",{className:"w-2 h-2 bg-white rounded-full animate-bounce delay-150"}),(0,r.jsx)("div",{className:"w-2 h-2 bg-white rounded-full animate-bounce delay-300"})]})})]})]}),(0,r.jsxs)("div",{className:"flex items-center p-3 border-t border-purple-700/50 gap-2 bg-purple-900/20 ",children:[(0,r.jsx)("input",{type:"text",value:a,placeholder:"Type a message...",className:"flex-1 rounded-2xl p-2 text-white bg-purple-800/50 placeholder-purple-300 focus:outline-none focus:ring-2 focus:ring-purple-500 shadow-inner",onChange:e=>i(e.target.value),onKeyDown:e=>"Enter"===e.key&&u()}),(0,r.jsx)("button",{onClick:u,className:"px-4 py-2 rounded-2xl bg-purple-600 hover:bg-purple-700 text-white transition-all transform hover:scale-105",children:"Send"})]})]})}),(0,r.jsx)("style",{children:"\n        @keyframes float {\n          0%, 100% { transform: translateY(0px); }\n          50% { transform: translateY(-10px); }\n        }\n        .animate-float {\n          animation: float 3s ease-in-out infinite;\n        }\n      "})]})}}},function(e){e.O(0,[689,757,971,23,744],function(){return e(e.s=1973)}),_N_E=e.O()}]);