cosmic-ai-genius 0.3.67 → 0.3.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -518,7 +518,7 @@ Please choose files smaller than 6MB.`)}it.length>0&&(Y(mt=>[...mt,...it]),conso
518
518
 
519
519
  `).filter(We=>We.trim()).forEach(We=>zn(We)),gn&&on&&(console.log("Saving complete conversation to IndexedDB:",{sessionId:gn,userMessage:je,botResponse:on,metadata:Lt}),fe(je,on,Lt,gn,H.length>0?[...H]:void 0).catch(ut=>{console.error("Failed to save message to IndexedDB:",ut)}));break}ln++;const Ze=Jt.decode(Rt,{stream:!0});console.log("🔍 DEBUG: Raw chunk #"+ln+":",Ze),mi+=Ze;const ft=mi.split(`
520
520
 
521
- `),Tt=ft.slice(0,-1);mi=ft[ft.length-1],console.log("🔍 DEBUG: Complete events:",Tt.length,"Buffer remaining:",mi.length),Tt.forEach(ut=>zn(ut))}}catch(Ye){if(Ye instanceof Error&&Ye.name==="AbortError"){console.log("Request was aborted");return}if(console.error("Error sending message:",Ye),b.some(Mt=>Mt.role==="assistant"&&Mt.timestamp>new Date(Date.now()-6e4)))console.log("Stream ended with error but data was received, not showing error message");else{let Mt="Unable to connect to Genius Analytics. Please check your network connection and try again.";Ye instanceof Error&&Ye.message.includes("Authentication token not found")?Mt="Session expired or not authenticated. Please log in to continue using Genius Analytics.":Ye instanceof Error&&Ye.message.includes("status 401")?Mt="Invalid authentication credentials. Please log in with valid credentials.":Ye instanceof Error&&Ye.message.includes("status 403")?Mt="Access denied. You don't have permission to access this data.":Ye instanceof Error&&Ye.message.includes("status 404")?Mt="Analytics service not found. Please contact support if this issue persists.":Ye instanceof Error&&Ye.message.includes("status 500")?Mt="Server error occurred. Our team has been notified. Please try again later.":Ye instanceof Error&&Ye.message.includes("Failed to fetch")&&(Mt="Network error. Please check your internet connection and ensure the analytics service is accessible.");const Yt={id:(Date.now()+1).toString(),content:Mt,role:"assistant",timestamp:new Date};v(zt=>[...zt,Yt])}}finally{N(!1),P(!1),R(null)}},os=je=>{je.key==="Enter"&&!je.shiftKey&&(je.preventDefault(),B?bn():Pn())},ys=oe.jsxs("div",{className:Fe["genius-dashboard-input-area"],children:[q&&b.length>0&&oe.jsx("button",{className:Fe["genius-dashboard-scroll-button"],onClick:()=>{be.current=!1,Te(!0)},"aria-label":"Scroll to bottom",children:oe.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:oe.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 3C12.5523 3 13 3.44772 13 4V17.5858L17.2929 13.2929C17.6834 12.9024 18.3166 12.9024 18.7071 13.2929C19.0976 13.6834 19.0976 14.3166 18.7071 14.7071L12.7071 20.7071C12.3166 21.0976 11.6834 21.0976 11.2929 20.7071L5.29289 14.7071C4.90237 14.3166 4.90237 13.6834 5.29289 13.2929C5.68342 12.9024 6.31658 12.9024 6.70711 13.2929L11 17.5858V4C11 3.44772 11.4477 3 12 3Z",fill:"black"})})}),!F&&oe.jsxs("div",{className:`${Fe["genius-dashboard-input-container"]} ${b.length>0?Fe["single-line"]:""} ${H.length>0?Fe["has-attachments"]:""}`,children:[b.length===0?oe.jsxs("div",{className:Fe["genius-dashboard-input-wrapper"],children:[H.length>0&&oe.jsx("div",{className:Fe["genius-dashboard-inline-attachments"],children:H.map((je,st)=>oe.jsxs("div",{className:Fe["genius-dashboard-inline-attachment"],children:[je.type.startsWith("image/")?oe.jsx("img",{src:`data:${je.type};base64,${je.base64}`,alt:je.name,className:Fe["genius-dashboard-attachment-preview"]}):oe.jsxs("div",{className:Fe["genius-dashboard-attachment-file-preview"],children:[oe.jsx("span",{className:Fe["genius-dashboard-file-icon"],children:x2(je.type)}),oe.jsx("span",{className:Fe["genius-dashboard-file-name"],children:je.name})]}),oe.jsx("button",{className:Fe["genius-dashboard-inline-attachment-remove"],onClick:()=>pt(st),"aria-label":`Remove ${je.name}`,children:"×"})]},st))}),oe.jsx("textarea",{ref:ee,placeholder:r,value:g,onChange:je=>y(je.target.value),onKeyDown:os,className:Fe["genius-dashboard-input"],rows:2})]}):oe.jsxs("div",{className:Fe["genius-dashboard-input-wrapper"],children:[H.length>0&&oe.jsx("div",{className:Fe["genius-dashboard-inline-attachments"],children:H.map((je,st)=>oe.jsxs("div",{className:Fe["genius-dashboard-inline-attachment"],children:[je.type.startsWith("image/")?oe.jsx("img",{src:`data:${je.type};base64,${je.base64}`,alt:je.name,className:Fe["genius-dashboard-attachment-preview"]}):oe.jsxs("div",{className:Fe["genius-dashboard-attachment-file-preview"],children:[oe.jsx("span",{className:Fe["genius-dashboard-file-icon"],children:x2(je.type)}),oe.jsx("span",{className:Fe["genius-dashboard-file-name"],children:je.name})]}),oe.jsx("button",{className:Fe["genius-dashboard-inline-attachment-remove"],onClick:()=>pt(st),"aria-label":`Remove ${je.name}`,children:"×"})]},st))}),oe.jsxs("div",{className:Fe["genius-dashboard-input-row"],children:[(t==null?void 0:t.showAttachmentButton)!==!1&&oe.jsx("button",{className:Fe["genius-dashboard-attachment-button"],"aria-label":"Attach file",onClick:Ge,disabled:B||Q,children:oe.jsx(mk,{})}),oe.jsx("input",{ref:ee,type:"text",placeholder:r,value:g,onChange:je=>y(je.target.value),onKeyDown:os,className:`${Fe["genius-dashboard-input"]} ${Fe["single-line-input"]}`})]})]}),oe.jsxs("div",{className:Fe["genius-dashboard-input-actions"],children:[oe.jsx("div",{className:Fe["genius-dashboard-left-actions"],children:b.length===0&&(t==null?void 0:t.showAttachmentButton)!==!1&&oe.jsx("button",{className:Fe["genius-dashboard-attachment-button"],"aria-label":"Attach file",onClick:Ge,disabled:B||Q,children:oe.jsx(mk,{})})}),oe.jsxs("div",{className:Fe["genius-dashboard-voice-container"],children:[oe.jsx("div",{className:Fe["genius-dashboard-rca-toggle-container"],children:oe.jsxs("label",{className:Fe["genius-dashboard-rca-toggle-label"],children:[oe.jsx("input",{type:"checkbox",checked:Z,onChange:je=>K(je.target.checked),className:Fe["genius-dashboard-rca-toggle-input"],disabled:B||Q}),oe.jsx("span",{className:Fe["genius-dashboard-rca-toggle-slider"]}),oe.jsx("span",{className:Fe["genius-dashboard-rca-toggle-text"],children:"RCA"})]})}),(t==null?void 0:t.showMicrophoneButton)!==!1&&oe.jsx("button",{className:Fe["genius-dashboard-microphone-button"],"aria-label":"Voice input",onClick:Ue,disabled:B||Q,children:oe.jsx(KD,{})}),B?oe.jsx("button",{className:Fe["genius-dashboard-cancel-button"],"aria-label":"Cancel",onClick:bn,children:oe.jsx(vk,{})}):oe.jsxs("div",{className:Fe["genius-dashboard-send-retry-container"],children:[I&&oe.jsx(oe.Fragment,{}),oe.jsx("button",{className:Fe["genius-dashboard-send-button"],"aria-label":"Send",onClick:Pn,disabled:Q,children:oe.jsx(ZD,{})})]})]})]})]}),oe.jsx("input",{type:"file",ref:ie,onChange:Qe,style:{display:"none"},multiple:!0,accept:".pdf,.txt,.csv,.json,.docx,.xlsx,.jpeg,.jpg,.png,.gif,.webp,.bmp,.svg"})]}),Mr=t&&t.userEmail||"",kn=je=>{m(je),se(!0),v(st=>st.map(it=>({...it,skipAnimation:!0})))},Bn=async je=>{const st=localStorage.getItem("login")||"",it=b.find(ze=>ze.id===ce);if(!(!(it!=null&&it.feedbackId)||!st))try{const ze=d.replace(/\/api\/v3\/analytics\/?$/,""),St=`Basic ${btoa(st+":")}`,mt=await fetch(`${ze}/api/v3/analytics/feedback`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:St},body:JSON.stringify({id:it.feedbackId,feedbackEnum:"DISLIKE",feedbackText:je})});mt.ok?(v(Ye=>Ye.map(Et=>Et.id===ce?{...Et,hasDisliked:!0,skipAnimation:!0}:Et)),se(!1),m(null),console.log("Dislike feedback submitted successfully")):console.error("Failed to submit dislike feedback",mt.status,mt.statusText)}catch(ze){console.error("Error submitting dislike feedback:",ze)}};return Re.useEffect(()=>{console.log("aaaaaaa",b)},[b]),oe.jsxs(oe.Fragment,{children:[oe.jsx("div",{className:`${Fe["genius-dashboard-backdrop"]} ${Fe.visible}`}),oe.jsxs("div",{className:`${Fe["genius-dashboard-container"]} ${Fe.expanded}`,ref:ue,children:[A&&oe.jsx("div",{className:Fe["genius-dashboard-history-overlay"],children:oe.jsxs("div",{className:Fe["genius-dashboard-history-container"],children:[oe.jsxs("div",{className:Fe["genius-dashboard-history-header"],children:[oe.jsxs("div",{className:Fe["genius-dashboard-history-header-left"],children:[oe.jsx("button",{className:Fe["genius-dashboard-history-back"],onClick:Ot,"aria-label":"Back",children:oe.jsx(yk,{})}),oe.jsx("h2",{children:"Chat History"})]}),oe.jsxs("div",{className:Fe["genius-dashboard-history-actions"],children:[oe.jsx("button",{className:Fe["genius-dashboard-history-action"],"aria-label":"New Chat",onClick:()=>{hn(),Ot()},children:oe.jsx(RS,{})}),oe.jsx("button",{className:Fe["genius-dashboard-history-action"],"aria-label":"Close",onClick:me,children:oe.jsx(gk,{})})]})]}),oe.jsx("div",{className:Fe["genius-dashboard-history-list"],ref:ge,onWheel:ke,children:D?oe.jsx("div",{className:Fe["genius-dashboard-history-loading"],children:"Loading history..."}):x.length===0?oe.jsx("div",{className:Fe["genius-dashboard-history-empty"],children:"No chat history found"}):x.map(je=>oe.jsxs("div",{className:Fe["genius-dashboard-history-item"],onClick:()=>Bt(je),children:[oe.jsxs("div",{className:Fe["genius-dashboard-history-item-content"],children:[oe.jsx("div",{className:Fe["genius-dashboard-history-item-title"],children:je.title}),oe.jsxs("div",{className:Fe["genius-dashboard-history-item-date"],children:[Ln(je.timestamp)," • ",je.messageCount," messages"]})]}),oe.jsx("button",{className:Fe["genius-dashboard-history-item-delete"],onClick:st=>qt(je.sessionId,st),"aria-label":"Delete session",children:oe.jsx(bk,{})})]},je.sessionId))})]})}),oe.jsxs("div",{className:Fe["genius-dashboard-top-bar"],children:[oe.jsx("div",{className:Fe["genius-dashboard-icons-left"],children:O&&oe.jsxs("button",{className:`${Fe["genius-dashboard-icon-container"]} ${Fe["with-text"]}`,onClick:()=>se(!1),"aria-label":"Back",children:[oe.jsx(xk,{}),oe.jsx("span",{className:Fe["genius-dashboard-back-text"],children:"Back"})]})}),oe.jsxs("div",{className:Fe["genius-dashboard-icons-right"],children:[b.length>0&&!O&&oe.jsx("button",{className:Fe["genius-dashboard-icon-container"],"aria-label":"Edit",onClick:hn,children:oe.jsx(RS,{})}),oe.jsx("button",{className:Fe["genius-dashboard-icon-container"],"aria-label":"History",onClick:()=>{O&&se(!1),F&&U(!1),et()},children:oe.jsx(WD,{})}),oe.jsx("button",{className:Fe["genius-dashboard-icon-container"],onClick:me,"aria-label":"Close",children:oe.jsx(gk,{})})]})]}),oe.jsx(Sk,{message:(t==null?void 0:t.bannerDescription)||"",isVisible:ne&&b.length===0,onClose:()=>de(!1),isCompact:!1}),oe.jsxs("div",{className:Fe["genius-dashboard-body"],children:[O?oe.jsx("div",{className:Fe["genius-dashboard-feedback-overlay"],children:oe.jsx(MT,{feedbackType:"DISLIKE",onFeedbackClick:Bn,onBack:()=>se(!1),onClose:()=>se(!1),onHistoryClick:()=>{se(!1),et()}})}):F?oe.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"#fff",zIndex:1e3,display:"flex",flexDirection:"column",overflow:"hidden"},children:oe.jsxs("div",{className:Fe["genius-voice-assistant-wrapper"],style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",position:"relative",overflow:"hidden"},children:[oe.jsx("style",{children:`
521
+ `),Tt=ft.slice(0,-1);mi=ft[ft.length-1],console.log("🔍 DEBUG: Complete events:",Tt.length,"Buffer remaining:",mi.length),Tt.forEach(ut=>zn(ut))}}catch(Ye){if(Ye instanceof Error&&Ye.name==="AbortError"){console.log("Request was aborted");return}if(console.error("Error sending message:",Ye),b.some(Mt=>Mt.role==="assistant"&&Mt.timestamp>new Date(Date.now()-6e4)))console.log("Stream ended with error but data was received, not showing error message");else{let Mt="Unable to connect to Genius Analytics. Please check your network connection and try again.";Ye instanceof Error&&Ye.message.includes("Authentication token not found")?Mt="Session expired or not authenticated. Please log in to continue using Genius Analytics.":Ye instanceof Error&&Ye.message.includes("status 401")?Mt="Invalid authentication credentials. Please log in with valid credentials.":Ye instanceof Error&&Ye.message.includes("status 403")?Mt="Access denied. You don't have permission to access this data.":Ye instanceof Error&&Ye.message.includes("status 404")?Mt="Analytics service not found. Please contact support if this issue persists.":Ye instanceof Error&&Ye.message.includes("status 500")?Mt="Server error occurred. Our team has been notified. Please try again later.":Ye instanceof Error&&Ye.message.includes("Failed to fetch")&&(Mt="Network error. Please check your internet connection and ensure the analytics service is accessible.");const Yt={id:(Date.now()+1).toString(),content:Mt,role:"assistant",timestamp:new Date};v(zt=>[...zt,Yt])}}finally{N(!1),P(!1),R(null)}},os=je=>{je.key==="Enter"&&!je.shiftKey&&(je.preventDefault(),B?bn():Pn())},ys=oe.jsxs("div",{className:Fe["genius-dashboard-input-area"],children:[q&&b.length>0&&oe.jsx("button",{className:Fe["genius-dashboard-scroll-button"],onClick:()=>{be.current=!1,Te(!0)},"aria-label":"Scroll to bottom",children:oe.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:oe.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 3C12.5523 3 13 3.44772 13 4V17.5858L17.2929 13.2929C17.6834 12.9024 18.3166 12.9024 18.7071 13.2929C19.0976 13.6834 19.0976 14.3166 18.7071 14.7071L12.7071 20.7071C12.3166 21.0976 11.6834 21.0976 11.2929 20.7071L5.29289 14.7071C4.90237 14.3166 4.90237 13.6834 5.29289 13.2929C5.68342 12.9024 6.31658 12.9024 6.70711 13.2929L11 17.5858V4C11 3.44772 11.4477 3 12 3Z",fill:"black"})})}),!F&&oe.jsxs("div",{className:`${Fe["genius-dashboard-input-container"]} ${b.length>0?Fe["single-line"]:""} ${H.length>0?Fe["has-attachments"]:""}`,children:[b.length===0?oe.jsxs("div",{className:Fe["genius-dashboard-input-wrapper"],children:[H.length>0&&oe.jsx("div",{className:Fe["genius-dashboard-inline-attachments"],children:H.map((je,st)=>oe.jsxs("div",{className:Fe["genius-dashboard-inline-attachment"],children:[je.type.startsWith("image/")?oe.jsx("img",{src:`data:${je.type};base64,${je.base64}`,alt:je.name,className:Fe["genius-dashboard-attachment-preview"]}):oe.jsxs("div",{className:Fe["genius-dashboard-attachment-file-preview"],children:[oe.jsx("span",{className:Fe["genius-dashboard-file-icon"],children:x2(je.type)}),oe.jsx("span",{className:Fe["genius-dashboard-file-name"],children:je.name})]}),oe.jsx("button",{className:Fe["genius-dashboard-inline-attachment-remove"],onClick:()=>pt(st),"aria-label":`Remove ${je.name}`,children:"×"})]},st))}),oe.jsx("textarea",{ref:ee,placeholder:r,value:g,onChange:je=>y(je.target.value),onKeyDown:os,className:Fe["genius-dashboard-input"],rows:2})]}):oe.jsxs("div",{className:Fe["genius-dashboard-input-wrapper"],children:[H.length>0&&oe.jsx("div",{className:Fe["genius-dashboard-inline-attachments"],children:H.map((je,st)=>oe.jsxs("div",{className:Fe["genius-dashboard-inline-attachment"],children:[je.type.startsWith("image/")?oe.jsx("img",{src:`data:${je.type};base64,${je.base64}`,alt:je.name,className:Fe["genius-dashboard-attachment-preview"]}):oe.jsxs("div",{className:Fe["genius-dashboard-attachment-file-preview"],children:[oe.jsx("span",{className:Fe["genius-dashboard-file-icon"],children:x2(je.type)}),oe.jsx("span",{className:Fe["genius-dashboard-file-name"],children:je.name})]}),oe.jsx("button",{className:Fe["genius-dashboard-inline-attachment-remove"],onClick:()=>pt(st),"aria-label":`Remove ${je.name}`,children:"×"})]},st))}),oe.jsxs("div",{className:Fe["genius-dashboard-input-row"],children:[(t==null?void 0:t.showAttachmentButton)!==!1&&oe.jsx("button",{className:Fe["genius-dashboard-attachment-button"],"aria-label":"Attach file",onClick:Ge,disabled:B||Q,children:oe.jsx(mk,{})}),oe.jsx("input",{ref:ee,type:"text",placeholder:r,value:g,onChange:je=>y(je.target.value),onKeyDown:os,className:`${Fe["genius-dashboard-input"]} ${Fe["single-line-input"]}`})]})]}),oe.jsxs("div",{className:Fe["genius-dashboard-input-actions"],children:[oe.jsx("div",{className:Fe["genius-dashboard-left-actions"],children:b.length===0&&(t==null?void 0:t.showAttachmentButton)!==!1&&oe.jsx("button",{className:Fe["genius-dashboard-attachment-button"],"aria-label":"Attach file",onClick:Ge,disabled:B||Q,children:oe.jsx(mk,{})})}),oe.jsxs("div",{className:Fe["genius-dashboard-voice-container"],children:[(t==null?void 0:t.showRCAToggle)===!0&&oe.jsx("div",{className:Fe["genius-dashboard-rca-toggle-container"],children:oe.jsxs("label",{className:Fe["genius-dashboard-rca-toggle-label"],children:[oe.jsx("input",{type:"checkbox",checked:Z,onChange:je=>K(je.target.checked),className:Fe["genius-dashboard-rca-toggle-input"],disabled:B||Q}),oe.jsx("span",{className:Fe["genius-dashboard-rca-toggle-slider"]}),oe.jsx("span",{className:Fe["genius-dashboard-rca-toggle-text"],children:"RCA"})]})}),(t==null?void 0:t.showMicrophoneButton)!==!1&&oe.jsx("button",{className:Fe["genius-dashboard-microphone-button"],"aria-label":"Voice input",onClick:Ue,disabled:B||Q,children:oe.jsx(KD,{})}),B?oe.jsx("button",{className:Fe["genius-dashboard-cancel-button"],"aria-label":"Cancel",onClick:bn,children:oe.jsx(vk,{})}):oe.jsxs("div",{className:Fe["genius-dashboard-send-retry-container"],children:[I&&oe.jsx(oe.Fragment,{}),oe.jsx("button",{className:Fe["genius-dashboard-send-button"],"aria-label":"Send",onClick:Pn,disabled:Q,children:oe.jsx(ZD,{})})]})]})]})]}),oe.jsx("input",{type:"file",ref:ie,onChange:Qe,style:{display:"none"},multiple:!0,accept:".pdf,.txt,.csv,.json,.docx,.xlsx,.jpeg,.jpg,.png,.gif,.webp,.bmp,.svg"})]}),Mr=t&&t.userEmail||"",kn=je=>{m(je),se(!0),v(st=>st.map(it=>({...it,skipAnimation:!0})))},Bn=async je=>{const st=localStorage.getItem("login")||"",it=b.find(ze=>ze.id===ce);if(!(!(it!=null&&it.feedbackId)||!st))try{const ze=d.replace(/\/api\/v3\/analytics\/?$/,""),St=`Basic ${btoa(st+":")}`,mt=await fetch(`${ze}/api/v3/analytics/feedback`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:St},body:JSON.stringify({id:it.feedbackId,feedbackEnum:"DISLIKE",feedbackText:je})});mt.ok?(v(Ye=>Ye.map(Et=>Et.id===ce?{...Et,hasDisliked:!0,skipAnimation:!0}:Et)),se(!1),m(null),console.log("Dislike feedback submitted successfully")):console.error("Failed to submit dislike feedback",mt.status,mt.statusText)}catch(ze){console.error("Error submitting dislike feedback:",ze)}};return Re.useEffect(()=>{console.log("aaaaaaa",b)},[b]),oe.jsxs(oe.Fragment,{children:[oe.jsx("div",{className:`${Fe["genius-dashboard-backdrop"]} ${Fe.visible}`}),oe.jsxs("div",{className:`${Fe["genius-dashboard-container"]} ${Fe.expanded}`,ref:ue,children:[A&&oe.jsx("div",{className:Fe["genius-dashboard-history-overlay"],children:oe.jsxs("div",{className:Fe["genius-dashboard-history-container"],children:[oe.jsxs("div",{className:Fe["genius-dashboard-history-header"],children:[oe.jsxs("div",{className:Fe["genius-dashboard-history-header-left"],children:[oe.jsx("button",{className:Fe["genius-dashboard-history-back"],onClick:Ot,"aria-label":"Back",children:oe.jsx(yk,{})}),oe.jsx("h2",{children:"Chat History"})]}),oe.jsxs("div",{className:Fe["genius-dashboard-history-actions"],children:[oe.jsx("button",{className:Fe["genius-dashboard-history-action"],"aria-label":"New Chat",onClick:()=>{hn(),Ot()},children:oe.jsx(RS,{})}),oe.jsx("button",{className:Fe["genius-dashboard-history-action"],"aria-label":"Close",onClick:me,children:oe.jsx(gk,{})})]})]}),oe.jsx("div",{className:Fe["genius-dashboard-history-list"],ref:ge,onWheel:ke,children:D?oe.jsx("div",{className:Fe["genius-dashboard-history-loading"],children:"Loading history..."}):x.length===0?oe.jsx("div",{className:Fe["genius-dashboard-history-empty"],children:"No chat history found"}):x.map(je=>oe.jsxs("div",{className:Fe["genius-dashboard-history-item"],onClick:()=>Bt(je),children:[oe.jsxs("div",{className:Fe["genius-dashboard-history-item-content"],children:[oe.jsx("div",{className:Fe["genius-dashboard-history-item-title"],children:je.title}),oe.jsxs("div",{className:Fe["genius-dashboard-history-item-date"],children:[Ln(je.timestamp)," • ",je.messageCount," messages"]})]}),oe.jsx("button",{className:Fe["genius-dashboard-history-item-delete"],onClick:st=>qt(je.sessionId,st),"aria-label":"Delete session",children:oe.jsx(bk,{})})]},je.sessionId))})]})}),oe.jsxs("div",{className:Fe["genius-dashboard-top-bar"],children:[oe.jsx("div",{className:Fe["genius-dashboard-icons-left"],children:O&&oe.jsxs("button",{className:`${Fe["genius-dashboard-icon-container"]} ${Fe["with-text"]}`,onClick:()=>se(!1),"aria-label":"Back",children:[oe.jsx(xk,{}),oe.jsx("span",{className:Fe["genius-dashboard-back-text"],children:"Back"})]})}),oe.jsxs("div",{className:Fe["genius-dashboard-icons-right"],children:[b.length>0&&!O&&oe.jsx("button",{className:Fe["genius-dashboard-icon-container"],"aria-label":"Edit",onClick:hn,children:oe.jsx(RS,{})}),oe.jsx("button",{className:Fe["genius-dashboard-icon-container"],"aria-label":"History",onClick:()=>{O&&se(!1),F&&U(!1),et()},children:oe.jsx(WD,{})}),oe.jsx("button",{className:Fe["genius-dashboard-icon-container"],onClick:me,"aria-label":"Close",children:oe.jsx(gk,{})})]})]}),oe.jsx(Sk,{message:(t==null?void 0:t.bannerDescription)||"",isVisible:ne&&b.length===0,onClose:()=>de(!1),isCompact:!1}),oe.jsxs("div",{className:Fe["genius-dashboard-body"],children:[O?oe.jsx("div",{className:Fe["genius-dashboard-feedback-overlay"],children:oe.jsx(MT,{feedbackType:"DISLIKE",onFeedbackClick:Bn,onBack:()=>se(!1),onClose:()=>se(!1),onHistoryClick:()=>{se(!1),et()}})}):F?oe.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"#fff",zIndex:1e3,display:"flex",flexDirection:"column",overflow:"hidden"},children:oe.jsxs("div",{className:Fe["genius-voice-assistant-wrapper"],style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",position:"relative",overflow:"hidden"},children:[oe.jsx("style",{children:`
522
522
  .${Fe["genius-voice-assistant-wrapper"]} .bottom-bar-container {
523
523
  position: absolute !important;
524
524
  bottom: 20px !important;