1var g=Object.defineProperty;var t=(a,r)=>g(a,"name",{value:r,configurable:!0});import{h as v,i as f,j as e,k as j}from"./main-CvlyoxHK.js";import{h as b,u as N,r as n}from"./vendor-hWTltVOd.js";import{r as p,J as y,Q as C}from"./lucide-BJF7tXNc.js";import"./supabase-BPX15Vv1.js";function M(){const{shareToken:a}=b(),r=N(),[l,m]=n.useState(null),[h,c]=n.useState(!0),[d,i]=n.useState(null),{getSharedConversation:x}=v(),{messages:u}=f(l?.id||null);return n.useEffect(()=>{t(async()=>{if(!a){i("Invalid share link"),c(!1);return}try{const o=await x(a);o?m(o):i("Conversation not found or no longer shared")}catch{i("Failed to load conversation")}finally{c(!1)}},"fetchSharedConversation")()},[a,x]),h?e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600 mx-auto"}),e.jsx("p",{className:"mt-2 text-gray-600",children:"Loading conversation..."})]})}):d?e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(p,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),e.jsx("h1",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Conversation Not Available"}),e.jsx("p",{className:"text-gray-600 mb-4",children:d}),e.jsx("button",{onClick:t(()=>r("/"),"onClick"),className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Go Home"})]})}):e.jsxs("div",{className:"min-h-screen bg-gray-50",children:[e.jsx("header",{className:"bg-white border-b border-gray-200",children:e.jsx("div",{className:"max-w-4xl mx-auto px-4 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:t(()=>r("/"),"onClick"),className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:e.jsx(y,{className:"w-5 h-5"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{className:"w-5 h-5 text-blue-600"}),e.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:l.title})]})]}),e.jsx("div",{className:"text-sm text-gray-500",children:"Shared conversation"})]})})}),e.jsx("div",{className:"max-w-3xl mx-auto px-2 sm:px-0 py-6",children:e.jsx("div",{className:"space-y-4",children:u.map(s=>e.jsx(j,{content:s.content,role:s.role,timestamp:s.created_at,messageId:s.id,feedbackRating:s.feedback_rating},s.id))})})]})}t(M,"SharedConversationPage");export{M as SharedConversationPage};
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.