1import{u as g,s as a,j as r,L as n}from"./index-hs4a0mYW.js";import{u as s}from"./useQuery-C-iGd3mh.js";import{S as p}from"./SiteHeader-BqOOKgqK.js";import{S as y}from"./SiteFooter-CpQk1rby.js";import"./useServerFn-DgMZqDJQ.js";import"./newsletter.functions-BPJ19l6O.js";function j(){const l=g(),{data:d}=s({queryKey:["account-user"],queryFn:async()=>{const{data:e}=await a.auth.getUser();return e.user?.email??null}}),{data:i,isLoading:m}=s({queryKey:["account-entitlements"],queryFn:async()=>{const{data:e,error:o}=await a.from("entitlements").select("id,kind,created_at,book_id,book:books(title,author)").order("created_at",{ascending:!1});if(o)throw o;return e??[]}}),c=i?.some(e=>e.kind==="library"),t=i?.filter(e=>e.kind==="book")??[];async function u(){await a.auth.signOut(),l({to:"/"})}return r.jsxs("div",{style:{minHeight:"100vh",background:"var(--background)",color:"var(--foreground)",display:"flex",flexDirection:"column"},children:[r.jsx(p,{}),r.jsx("main",{style:{flex:1,padding:"3rem 1.5rem 5rem",fontFamily:"'Inter', system-ui, sans-serif"},children:r.jsxs("div",{style:{maxWidth:"44rem",margin:"0 auto"},children:[r.jsx("h1",{style:{fontFamily:"'Playfair Display', Georgia, serif",fontWeight:600,fontSize:"clamp(2rem, 4vw, 2.75rem)",color:"var(--navy)",margin:"0 0 0.5rem"},children:"Your account"}),r.jsxs("p",{style:{color:"var(--muted-foreground)",fontSize:"1rem",margin:"0 0 2rem"},children:["Signed in as ",d??"unknown","."]}),r.jsxs("div",{style:{display:"flex",gap:"0.75rem",flexWrap:"wrap",marginBottom:"2.5rem"},children:[r.jsx(n,{to:"/account/orders",style:{background:"var(--navy)",color:"var(--background)",padding:"0.75rem 1.25rem",textDecoration:"none",fontSize:"0.8125rem",letterSpacing:"0.08em",textTransform:"uppercase",borderRadius:4},children:"My orders & downloads"}),r.jsx(n,{to:"/shop",style:{background:"transparent",color:"var(--foreground)",padding:"0.75rem 1.25rem",textDecoration:"none",fontSize:"0.8125rem",letterSpacing:"0.08em",textTransform:"uppercase",border:"1px solid var(--border, #E8E2D2)",borderRadius:4},children:"Continue shopping"}),r.jsx(n,{to:"/",style:{background:"transparent",color:"var(--foreground)",padding:"0.75rem 1.25rem",textDecoration:"none",fontSize:"0.8125rem",letterSpacing:"0.08em",textTransform:"uppercase",border:"1px solid var(--border, #E8E2D2)",borderRadius:4},children:"Home"})]}),r.jsxs("section",{style:{background:"var(--card, transparent)",borderTop:"1px solid var(--gold)",padding:"1.5rem 1.5rem 1.25rem",marginBottom:"1.25rem"},children:[r.jsx("h2",{style:{fontFamily:"'Playfair Display', Georgia, serif",fontSize:"0.875rem",letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--navy)",margin:"0 0 0.75rem",fontStyle:"italic",fontWeight:500},children:"Library membership"}),c?r.jsx("p",{style:{margin:0,lineHeight:1.65},children:"Active. Every Talkable Edition, current and forthcoming, is yours."}):r.jsx("p",{style:{margin:0,color:"var(--muted-foreground)",lineHeight:1.65},children:"No Library membership yet."})]}),r.jsxs("section",{style:{background:"var(--card, transparent)",border:"1px solid var(--border, #E8E2D2)",padding:"1.5rem 1.5rem 1.25rem",marginBottom:"2.5rem"},children:[r.jsx("h2",{style:{fontFamily:"'Playfair Display', Georgia, serif",fontSize:"0.875rem",letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--navy)",margin:"0 0 1rem",fontStyle:"italic",fontWeight:500},children:"Books you have unlocked"}),m?r.jsx("p",{style:{color:"var(--muted-foreground)",margin:0},children:"Checking your shelfâ¦"}):t.length===0?r.jsxs("p",{style:{color:"var(--muted-foreground)",margin:0,lineHeight:1.65},children:["No individual unlocks yet."," ",r.jsx(n,{to:"/shop",style:{color:"var(--gold)"},children:"Browse the shop"}),"."]}):r.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:t.map((e,o)=>r.jsx("li",{style:{paddingBottom:o===t.length-1?0:"1rem",marginBottom:o===t.length-1?0:"1rem",borderBottom:o===t.length-1?"none":"1px solid var(--border, #ECE6D5)"},children:r.jsxs("span",{style:{fontFamily:"'Playfair Display', Georgia, serif",fontSize:"1.125rem",color:"var(--navy)"},children:[e.book?.title??"Untitled",e.book?.author?r.jsxs("span",{style:{color:"var(--muted-foreground)",fontSize:"0.9375rem"},children:[" ","· ",e.book.author]}):null]})},e.id))})]}),r.jsx("button",{onClick:u,style:{background:"transparent",color:"var(--foreground)",border:"1px solid var(--border, #E8E2D2)",padding:"0.75rem 1.25rem",fontFamily:"'Inter', system-ui, sans-serif",fontSize:"0.8125rem",letterSpacing:"0.08em",textTransform:"uppercase",cursor:"pointer",borderRadius:4},children:"Sign out"})]})}),r.jsx(y,{})]})}
1export{j as component};
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.