1import{j as e,u as _,L as h}from"../(auth)/_layout-fSOULLBw.js";import{p as k,C as g,I as N,F as v,D as C,M as b}from"../admin/users/_id_/index-B_ZeE-gG.js";import{S as x}from"../admin/benchmarks/index-C-NNkdkz.js";import{l as f}from"../admin/dashboard/index-DOBN427n.js";import{E as $}from"../../vendor-mdeditor-D6wvMulb.js";import{m as F,c as S}from"../admin/finetuning-mode/_id_-C0ZahpjT.js";import{V as w,B as T}from"../(auth)/forgot-password-CtaxQ-XW.js";import{q as z,aN as D,t as A,a2 as P}from"../(auth)/login-DrXQhAYv.js";import{i as B,d8 as E,aL as L}from"../admin/_layout-BlZhNhrP.js";import{i as M}from"../main/_slug_/index-BYsVyKmw.js";import"../admin/guru-builder/_sessionId_/index-C-ePafio.js";import"../admin/cost-analysis/index-DwK7rcRW.js";import"../admin/category/index-BwjE5ygG.js";import"../admin/guru-builder/index-3D4jvyTW.js";import"../admin/jobs/index-DYYI8qrN.js";import"../admin/users-memory/_id_/index-CFz--tRt.js";import"../../vendor-docx-KZh7AJyU.js";import"../admin/knowledge-management/index-BCsKNlJ5.js";const y=l=>l.replace(/"/g,""").replace(/\n/g,"<br /> "),I=(l,a)=>{let o=l.replace(/\[(\d+)\]/g,(i,r)=>{const t=a.urls?.[r];if(t)return`[[${r}]](${t})`;const n=a.text?.[r];return n?`<span data-tooltip-id="tip-${r}" data-tooltip-content="${y(n)}">${r}</span>`:`[${r}]`});return o=o.replace(/\[([a-zA-Z]+[0-9]*)\]/g,(i,r)=>{const t=a.text?.[r];return t?`<span data-tooltip-id="tip-${r}" data-tooltip-content="${y(t)}">${r}</span>`:`[${r}]`}),o},j=l=>{const a=document.createElement("textarea");a.value=l,a.style.position="fixed",document.body.appendChild(a),a.focus(),a.select();try{document.execCommand("copy"),w.success("Copied!")}catch(o){console.error("Fallback copy failed:",o)}document.body.removeChild(a)},R=async l=>{try{const a=F.parse(l),o=` 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <style> 6 body { font-family: Arial, sans-serif; font-size: 14px; } 7 table { 8 border-collapse: collapse; 9 width: 100%; 10 } 11 table, th, td { 12 border: 1px solid black; 13 } 14 th, td { 15 padding: 8px; 16 text-align: left; 17 } 18 </style> 19 </head> 20 <body> 21 ${a} 22 </body> 23 </html> 24 `,i=document.createElement("div");i.innerHTML=a;const r=i.innerText;if(navigator.clipboard&&navigator.clipboard.write){const t=new Blob([o],{type:"text/html"}),n=new Blob([r],{type:"text/plain"}),s=[new ClipboardItem({"text/html":t,"text/plain":n})];await navigator.clipboard.write(s),w.success("Copied!")}else j(r)}catch(a){console.error("Failed to copy text:",a),j(l)}};function q({messages:l,isLoading:a,isDarkMode:o,showCopyButton:i=!1,directFileDownloadOnly:r=!1}){return a?e.jsxs("div",{className:"space-y-3 w-full max-w-[600px]",children:[e.jsx(x,{className:"h-4 w-[60%]"}),e.jsx(x,{className:"h-4 w-[80%]"}),e.jsx(x,{className:"h-4 w-[40%]"})]}):e.jsxs(e.Fragment,{children:[l?.map((t,n)=>e.jsx("div",{className:`flex ${t.role==="user"?"justify-end flex-col items-end":"justify-start"}`,children:e.jsx("div",{className:`${t.role==="user"?t.uploaded_image_url?"":"bg-[#e9e9e980] p-3 dark:bg-[#8
241818150] text-black dark:text-white max-w-[650px] rounded-2xl [overflow-wrap:anywhere]":"w-full"}`,children:t.role==="assistant"?e.jsx("div",{className:"text-black dark:text-white rounded-l-2xl mt-6",children:t.isAnalyzing?e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(z,{className:"animate-spin h-5 w-5"}),e.jsx("span",{className:"animate-pulse",children:"Analyzing your files..."})]}):e.jsxs(e.Fragment,{children:[t?.model_display_name&&e.jsx("div",{className:"w-full flex items-center justify-end mb-2",children:e.jsx("div",{className:"bg-blue-400 w-fit text-white py-1 px-3 rounded-full",children:t?.model_display_name})}),k(t.citations?I(t.content,t.citations):t.content).map((s,d)=>s.type==="chart"?e.jsx(g,{chartJson:s.content},`seg-${d}`):e.jsx($.Markdown,{source:s.content,components:{a:({children:p,href:c,...m})=>e.jsx("a",{...m,href:c,target:"_blank",rel:"noopener noreferrer","data-tooltip-id":"chat-link-tooltip","data-tooltip-content":`${c}`,children:p}),span:({children:p,...c})=>{const m=c["data-tooltip-id"],u=c["data-tooltip-content"];return m&&u?e.jsxs("span",{className:"bg-yellow-200 ml-1 first:ml-0 text-black",...c,"data-tooltip-id":"chat-citation-tooltip","data-tooltip-html":u,children:[" ","[",p,"]"]}):e.jsx("span",{...c,children:p})}},className:"prose max-w-none text-justify marker:text-black dark:marker:text-white !mb-2",style:{backgroundColor:"transparent",border:"none",outline:"none",padding:0,margin:0,fontSize:"1rem",lineHeight:"1.5",fontFamily:"inherit",color:o?"white":"black"}},`seg-${d}`)),t&&e.jsx(N,{imageS3Path:t?.image_s3_path,imageUrl:t.image_url,messageId:t?.message_id}),(t.ppt_url||t.excel_url||t.output_url)&&e.jsx(v,{url:t.ppt_url||t.excel_url||t.output_url||"",directDownloadOnly:r,artifactId:t.output_artifact_id||t.ppt_artifact_id||t.excel_artifact_id||t.report_artifact_id}),(t.report_url||t.document_url)&&e.jsx(C,{url:t.report_url||t.document_url||""}),t?.created_at&&e.jsx("div",{className:"text-xs mt-2 w-full flex items-center",children:e.jsx("span",{children:f(t?.created_at)})}),i&&t.content&&e.jsx("div",{className:"action-icons flex gap-2 p-2",children:e.jsx("button",{type:"button",onClick:()=>R(t.copy_text||t.content),className:"icon-button","aria-label":"Copy",children:e.jsx(D,{size:20})})})]})}):e.jsx(e.Fragment,{children:t.uploaded_image_url?e.jsx("div",{className:"flex flex-col items-end gap-2",children:e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg max-w-[200px]",children:e.jsx("img",{src:t.uploaded_image_url,alt:"Uploaded",className:"w-full max-h-[300px] rounded-md object-contain"})})}):e.jsxs("div",{className:"text-sm flex flex-col items-end gap-1",children:[e.jsx("span",{children:t.content}),t?.created_at&&e.jsx("span",{className:"text-xs",children:f(t?.created_at||"")})]})})})},t.message_id||n)),e.jsx(b,{id:"chat-link-tooltip",place:"bottom",className:"max-w-[300px] max-h-[200px] overflow-auto whitespace-normal break-words"}),e.jsx(b,{id:"chat-citation-tooltip",place:"bottom",style:{pointerEvents:"auto"},float:!0,clickable:!0,className:"!bg-[#1d1b1b] hover:!opacity-100 !text-white text-xl max-w-[600px] max-h-[400px] overflow-auto whitespace-normal break-words rounded-lg shadow-lg p-4 !z-50"})]})}const G=l=>B({queryKey:["PublicChatShare",l],queryFn:()=>E(l||""),enabled:!!l,refetchOnWindowFocus:!1,retry:1});function ie(){const{isDarkMode:l}=L(),{public_token:a}=_(),{data:o,isLoading:i,isError:r}=G(a),t=o?.data,n=Array.isArray(t?.messages)?t.messages.map(s=>{const d=M(s.recommended_gurus,s.guru_configs,s.recommended_guru);return{...s,...S(s.artifacts),recommended_gurus:d.length?d:s.recommended_gurus,recommended_guru:d[0]??s.recommended_guru??null}}):[];return e.jsxs("main",{className:"h-dvh w-full overflow-y-auto bg-white text-black scrollbar-view dark:bg-[#1b1b19] dark:text-white",children:[e.jsxs("header",{className:"sticky top-0 z-20 flex min-h-14 items-center justify-between gap-4 bg-white/95 px-3 py-2 backdrop-blur dark:bg-[#1b1b19]/95",children:[e.jsx("div",{className:"min-w-0",children:i?e.jsx(x,{className:"h-4 w-64 max-w-[60vw]"}):e.jsx("h1",{className:"truncate text-sm font-medium sm:text-base",children:t?.session_name||"Shared chat"})}),i?e.jsx(x,{className:"h-8 w-32 shrink-0 rounded-full"}):t?.shared_by_name&&e.jsxs("div",{className:"shrink-0 rounded-full bg-gray-100 px-3 py-1.5 text-sm text-gray-700 dark:bg-black/35 dar
24k:text-gray-100",children:["Shared by ",t.shared_by_name]})]}),e.jsxs("div",{className:"mx-auto min-h-[calc(100dvh-3.5rem)] max-w-3xl px-3 pb-10 pt-3 flex flex-col",children:[r?e.jsxs("div",{className:"flex min-h-[calc(100dvh-8rem)] flex-col items-center justify-center px-6 text-center",children:[e.jsx(A,{className:"mb-4 text-red-500",size:44}),e.jsx("h2",{className:"mb-2 text-lg font-semibold",children:"Shared chat unavailable"}),e.jsx("p",{className:"max-w-md text-sm text-gray-600 dark:text-gray-300",children:"This public link may have expired or is no longer active."})]}):e.jsx("div",{className:"flex w-full flex-col gap-2 flex-grow",children:e.jsx(q,{messages:n,isLoading:i,isDarkMode:l,showCopyButton:!0,directFileDownloadOnly:!0})}),!i&&!r&&e.jsxs("div",{className:"mt-12 flex flex-col items-center justify-center rounded-xl bg-gray-50 p-8 text-center dark:bg-black/20",children:[e.jsx("div",{className:"mb-4 inline-flex items-center justify-center rounded-full bg-blue-100 p-3 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400",children:e.jsx(P,{className:"h-6 w-6"})}),e.jsx("h3",{className:"mb-3 text-2xl font-bold tracking-tight",children:"Your unfair advantage retail launch."}),e.jsxs("p",{className:"mb-6 max-w-lg text-base text-gray-600 dark:text-gray-400",children:["50+ specialized AI Gurus for market research, financial modeling, brand strategy, and investor readiness â all in one platform built for CPG entrepreneurs"," ",e.jsx(h,{to:"/",className:"underline cursor-pointer text-blue-600 dark:text-blue-400 underline-offset-4",children:"Know more"}),"."]}),e.jsx(h,{to:"/signup",children:e.jsx(T,{size:"lg",className:"px-8 shadow-blue-500/25",children:"Start your free trial now!"})})]})]})]})}export{ie as default}; 25//# sourceMappingURL=_public_token_-vLjD5lt_.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.